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->_AddOutput< cpPlugins::Interface::Mesh >( "Output" );
21 // -------------------------------------------------------------------------
22 cpPlugins::BasicFilters::Cutter::
27 // -------------------------------------------------------------------------
28 std::string cpPlugins::BasicFilters::Cutter::
32 auto mesh = this->GetInputData< cpPlugins::Interface::Mesh >( "InputMesh" );
34 this->GetInputData< cpPlugins::Interface::ImplicitFunction >(
37 if( function == NULL )
38 return( "Cutter: Input data 1 is not a valid implicit function." );
40 vtkCutter* cutter = this->_CreateVTK< vtkCutter >( );
42 cutter->SetInputData( mesh->GetVTK< vtkPolyData >( ) );
43 cutter->SetCutFunction( function->GetVTK< vtkImplicitFunction >( ) );
44 cutter->SetValue( 0, 1 );
45 cutter->GenerateTrianglesOff( );
49 auto out = this->GetOutputData< cpPlugins::Interface::Mesh >( "Output" );
50 out->SetVTK( cutter->GetOutput( ) );