2 #include <cpPlugins/Interface/ImplicitFunction.h>
3 #include <cpPlugins/Interface/Mesh.h>
6 #include <vtkProperty.h>
11 // -------------------------------------------------------------------------
12 cpPlugins::BasicFilters::Cutter::
16 this->_AddInput( "InputMesh" );
17 this->_AddInput( "InputFunction" );
18 this->_MakeOutput< cpPlugins::Interface::Mesh >( "Output" );
21 // -------------------------------------------------------------------------
22 cpPlugins::BasicFilters::Cutter::
27 // -------------------------------------------------------------------------
28 std::string cpPlugins::BasicFilters::Cutter::
32 cpPlugins::Interface::Mesh* mesh =
33 this->GetInput< cpPlugins::Interface::Mesh >( "InputMesh" );
34 cpPlugins::Interface::ImplicitFunction* function =
35 this->GetInput< cpPlugins::Interface::ImplicitFunction >(
38 if( function == NULL )
39 return( "Cutter: Input data 1 is not a valid implicit function." );
41 vtkCutter* cutter = this->_CreateVTK< vtkCutter >( );
43 cutter->SetInputData( mesh->GetVTK< vtkPolyData >( ) );
44 cutter->SetCutFunction( function->GetVTK< vtkImplicitFunction >( ) );
45 cutter->SetValue( 0, 1 );
46 cutter->GenerateTrianglesOff( );
50 cpPlugins::Interface::Mesh* out =
51 this->GetOutput< cpPlugins::Interface::Mesh >( "Output" );
52 out->SetVTK( cutter->GetOutput( ) );