X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FPlugins%2FBasicFilters%2FMarchingCubes.cxx;fp=lib%2FcpPlugins%2FPlugins%2FBasicFilters%2FMarchingCubes.cxx;h=0000000000000000000000000000000000000000;hb=98390bcac544f7f3a6762ce812dda491213d6f13;hp=f05296ee062d022175f8f993a82f1059dc947c84;hpb=b6c7e73ebcce23619daced67f85d9e1364b33f30;p=cpPlugins.git diff --git a/lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx b/lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx deleted file mode 100644 index f05296e..0000000 --- a/lib/cpPlugins/Plugins/BasicFilters/MarchingCubes.cxx +++ /dev/null @@ -1,67 +0,0 @@ -#include "MarchingCubes.h" -#include -#include - -#include -#include -#include - -// ------------------------------------------------------------------------- -cpPlugins::BasicFilters::MarchingCubes:: -MarchingCubes( ) - : Superclass( ) -{ - this->_AddInput( "Input" ); - this->_AddOutput< cpPlugins::Interface::Mesh >( "Output" ); - - this->m_Parameters->ConfigureAsRealList( "Thresholds" ); -} - -// ------------------------------------------------------------------------- -cpPlugins::BasicFilters::MarchingCubes:: -~MarchingCubes( ) -{ -} - -// ------------------------------------------------------------------------- -std::string cpPlugins::BasicFilters::MarchingCubes:: -_GenerateData( ) -{ - // Get input - auto image = this->GetInputData( "Input" ); - vtkImageData* vtk_image = image->GetVTK< vtkImageData >( ); - if( vtk_image == NULL ) - return( "MarchingCubes: Input does not have a valid VTK conversion." ); - - std::vector< double > values = - this->m_Parameters->GetRealList( "Thresholds" ); - vtkPolyData* pd = NULL; - if( vtk_image->GetDataDimension( ) == 2 ) - { - vtkMarchingSquares* ms = this->_CreateVTK< vtkMarchingSquares >( ); - ms->SetInputData( vtk_image ); - for( unsigned int i = 0; i < values.size( ); ++i ) - ms->SetValue( i, values[ i ] ); - ms->Update( ); - pd = ms->GetOutput( ); - } - else if( vtk_image->GetDataDimension( ) == 3 ) - { - vtkMarchingCubes* mc = this->_CreateVTK< vtkMarchingCubes >( ); - mc->ComputeNormalsOff( ); - mc->SetInputData( vtk_image ); - for( unsigned int i = 0; i < values.size( ); ++i ) - mc->SetValue( i, values[ i ] ); - mc->Update( ); - pd = mc->GetOutput( ); - } - else - return( "MarchingCubes: Input data does not have a valid dimension." ); - - // Execute filter - auto out = this->GetOutputData( "Output" ); - out->SetVTK( pd ); - return( "" ); -} - -// eof - $RCSfile$