#include "Cutter.h" #include #include #include #include #include // ------------------------------------------------------------------------- cpPlugins::BasicFilters::Cutter:: Cutter( ) : Superclass( ) { this->_AddInput( "InputMesh" ); this->_AddInput( "InputFunction" ); this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" ); } // ------------------------------------------------------------------------- cpPlugins::BasicFilters::Cutter:: ~Cutter( ) { } // ------------------------------------------------------------------------- std::string cpPlugins::BasicFilters::Cutter:: _GenerateData( ) { // Get inputs auto mesh = this->GetInputData< cpPlugins::Interface::Mesh >( "InputMesh" ); auto function = this->GetInputData< cpPlugins::Interface::ImplicitFunction >( "InputFunction" ); if( function == NULL ) return( "Cutter: Input data 1 is not a valid implicit function." ); vtkCutter* cutter = this->_CreateVTK< vtkCutter >( ); cutter->DebugOn( ); cutter->SetInputData( mesh->GetVTK< vtkPolyData >( ) ); cutter->SetCutFunction( function->GetVTK< vtkImplicitFunction >( ) ); cutter->SetValue( 0, 1 ); cutter->GenerateTrianglesOff( ); cutter->Update( ); // Execute filter auto out = this->GetOutputData< cpPlugins::Interface::Mesh >( "Output" ); out->SetVTK( cutter->GetOutput( ) ); return( "" ); } // eof - $RCSfile$