X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=plugins%2FVTKFilters%2FMarchingCubes.cxx;fp=plugins%2FVTKFilters%2FMarchingCubes.cxx;h=0000000000000000000000000000000000000000;hb=2e142df11d6f312a2a2b5097b8da73571ed523e8;hp=b01a9dc6e8667c670d7abc5daccbea981c44ab2a;hpb=61b3659afe961ed248f30e26f9ca8f28fcfafddc;p=cpPlugins.git diff --git a/plugins/VTKFilters/MarchingCubes.cxx b/plugins/VTKFilters/MarchingCubes.cxx deleted file mode 100644 index b01a9dc..0000000 --- a/plugins/VTKFilters/MarchingCubes.cxx +++ /dev/null @@ -1,64 +0,0 @@ -#include -#include -#include - -#include -#include -#include - -// ------------------------------------------------------------------------- -cpPluginsVTKFilters::MarchingCubes:: -MarchingCubes( ) - : Superclass( ) -{ - this->_ConfigureInput< cpInstances::DataObjects::Image >( "Input", true, false ); - this->_ConfigureOutput< cpInstances::DataObjects::Mesh >( "Output" ); - this->m_Parameters.ConfigureAsRealList( "Thresholds" ); -} - -// ------------------------------------------------------------------------- -cpPluginsVTKFilters::MarchingCubes:: -~MarchingCubes( ) -{ -} - -// ------------------------------------------------------------------------- -void cpPluginsVTKFilters::MarchingCubes:: -_GenerateData( ) -{ - // Get input - auto image = this->GetInput( "Input" ); - vtkImageData* vtk_image = image->GetVTK< vtkImageData >( ); - if( vtk_image == NULL ) - this->_Error( "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 - this->_Error( "Input data does not have a valid dimension." ); - - // Connect output - this->GetOutput( "Output" )->SetVTK( pd ); -} - -// eof - $RCSfile$