2 #include <cpPlugins/Interface/ImplicitFunction.h>
3 #include <cpPlugins/Interface/Mesh.h>
6 #include <vtkProperty.h>
8 // -------------------------------------------------------------------------
9 cpPlugins::BasicFilters::Cutter::
13 this->m_ClassName = "cpPlugins::BasicFilters::Cutter";
14 this->m_ClassCategory = "MeshToMeshFilter";
16 this->SetNumberOfInputs( 2 );
17 this->SetNumberOfOutputs( 1 );
18 this->_MakeOutput< cpPlugins::Interface::Mesh >( 0 );
20 this->m_Parameters = this->m_DefaultParameters;
23 // -------------------------------------------------------------------------
24 cpPlugins::BasicFilters::Cutter::
29 // -------------------------------------------------------------------------
30 std::string cpPlugins::BasicFilters::Cutter::
34 cpPlugins::Interface::Mesh* mesh =
35 this->GetInput< cpPlugins::Interface::Mesh >( 0 );
36 cpPlugins::Interface::ImplicitFunction* function =
37 this->GetInput< cpPlugins::Interface::ImplicitFunction >( 1 );
38 if( function == NULL )
39 return( "Cutter: Input data 1 is not a valid implicit function." );
41 vtkCutter* cutter = this->_CreateVTK< vtkCutter >( );
42 cutter->SetInputData( mesh->GetVTK< vtkPolyData >( ) );
43 cutter->SetCutFunction( function->GetVTK< vtkImplicitFunction >( ) );
44 cutter->GenerateTrianglesOff( );
48 cpPlugins::Interface::Mesh* out =
49 this->GetOutput< cpPlugins::Interface::Mesh >( 0 );
50 out->SetVTK( cutter->GetOutput( ) );