#include <vtkCutter.h>
#include <vtkProperty.h>
-// -------------------------------------------------------------------------
-vtkAlgorithm* cpPlugins::BasicFilters::Cutter::
-GetVTKAlgorithm( )
-{
- return( this->m_Algorithm );
-}
-
-// -------------------------------------------------------------------------
-const vtkAlgorithm* cpPlugins::BasicFilters::Cutter::
-GetVTKAlgorithm( ) const
-{
- return( this->m_Algorithm );
-}
-
// -------------------------------------------------------------------------
cpPlugins::BasicFilters::Cutter::
Cutter( )
- : Superclass( ),
- m_Algorithm( NULL )
+ : Superclass( )
{
this->m_ClassName = "cpPlugins::BasicFilters::Cutter";
this->m_ClassCategory = "MeshToMeshFilter";
cpPlugins::BasicFilters::Cutter::
~Cutter( )
{
- if( this->m_Algorithm != NULL )
- this->m_Algorithm->Delete( );
}
// -------------------------------------------------------------------------
if( function == NULL )
return( "Cutter: Input data 1 is not a valid implicit function." );
- if( this->m_Algorithm != NULL )
- this->m_Algorithm->Delete( );
-
- vtkCutter* cutter = vtkCutter::New( );
- cutter->SetInputData( mesh->GetVTKMesh( ) );
- cutter->SetCutFunction( function->GetVTKImplicitFunction( ) );
+ vtkCutter* cutter = this->_CreateVTK< vtkCutter >( );
+ cutter->SetInputData( mesh->GetVTK< vtkPolyData >( ) );
+ cutter->SetCutFunction( function->GetVTK< vtkImplicitFunction >( ) );
cutter->GenerateTrianglesOff( );
- this->m_Algorithm = cutter;
+ cutter->Update( );
// Execute filter
- this->m_Algorithm->Update( );
cpPlugins::Interface::Mesh* out =
this->GetOutput< cpPlugins::Interface::Mesh >( 0 );
- out->SetVTKMesh( this->m_Algorithm->GetOutput( ) );
+ out->SetVTK( cutter->GetOutput( ) );
return( "" );
}