X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Ffpa%2FVTK%2FImage%2FPolyLineParametricPathToPolyDataFilter.hxx;fp=lib%2Ffpa%2FVTK%2FImage%2FPolyLineParametricPathToPolyDataFilter.hxx;h=0000000000000000000000000000000000000000;hb=a8ac405fe1422bc0792a810f7f0693096a22c20e;hp=ad995aab2d08190f73b0ce6fccb4fb565f03fe03;hpb=8abe87eaa0d29ba667d5cbf35f4ca1ca2e38c6c4;p=FrontAlgorithms.git diff --git a/lib/fpa/VTK/Image/PolyLineParametricPathToPolyDataFilter.hxx b/lib/fpa/VTK/Image/PolyLineParametricPathToPolyDataFilter.hxx deleted file mode 100644 index ad995aa..0000000 --- a/lib/fpa/VTK/Image/PolyLineParametricPathToPolyDataFilter.hxx +++ /dev/null @@ -1,133 +0,0 @@ -// ========================================================================= -// @author Leonardo Florez Valencia -// @email florez-l@javeriana.edu.co -// ========================================================================= -#ifndef __fpa__VTK__Image__PolyLineParametricPathToPolyDataFilter__hxx__ -#define __fpa__VTK__Image__PolyLineParametricPathToPolyDataFilter__hxx__ - -#include -#include -#include -#include -#include -#include - -// ------------------------------------------------------------------------- -template< class _TPath > -typename fpa::VTK::Image::PolyLineParametricPathToPolyDataFilter< _TPath >:: -Self* fpa::VTK::Image::PolyLineParametricPathToPolyDataFilter< _TPath >:: -New( ) -{ - return( new Self( ) ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -const typename -fpa::VTK::Image::PolyLineParametricPathToPolyDataFilter< _TPath >:: -TPath* fpa::VTK::Image::PolyLineParametricPathToPolyDataFilter< _TPath >:: -GetInput( ) const -{ - return( this->m_PolyLineParametricPath ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -void fpa::VTK::Image::PolyLineParametricPathToPolyDataFilter< _TPath >:: -SetInput( const TPath* path ) -{ - if( this->m_PolyLineParametricPath != path ) - { - this->m_PolyLineParametricPath = path; - this->Modified( ); - - } // fi -} - -// ------------------------------------------------------------------------- -template< class _TPath > -fpa::VTK::Image::PolyLineParametricPathToPolyDataFilter< _TPath >:: -PolyLineParametricPathToPolyDataFilter( ) - : vtkPolyDataAlgorithm( ), - m_PolyLineParametricPath( NULL ) -{ - this->SetNumberOfInputPorts( 0 ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -fpa::VTK::Image::PolyLineParametricPathToPolyDataFilter< _TPath >:: -~PolyLineParametricPathToPolyDataFilter( ) -{ -} - -// ------------------------------------------------------------------------- -template< class _TPath > -int fpa::VTK::Image::PolyLineParametricPathToPolyDataFilter< _TPath >:: -RequestData( - vtkInformation* information, - vtkInformationVector** input, - vtkInformationVector* output - ) -{ - static const unsigned int dim = TPath::PathDimension; - if( this->m_PolyLineParametricPath == NULL ) - return( 0 ); - - // Get output - vtkInformation* info = output->GetInformationObject( 0 ); - vtkPolyData* out = vtkPolyData::SafeDownCast( - info->Get( vtkDataObject::DATA_OBJECT( ) ) - ); - - // Prepare data - out->SetPoints( vtkSmartPointer< vtkPoints >::New( ) ); - out->SetVerts( vtkSmartPointer< vtkCellArray >::New( ) ); - out->SetLines( vtkSmartPointer< vtkCellArray >::New( ) ); - out->SetPolys( vtkSmartPointer< vtkCellArray >::New( ) ); - out->SetStrips( vtkSmartPointer< vtkCellArray >::New( ) ); - vtkSmartPointer< vtkUnsignedIntArray > darray = - vtkSmartPointer< vtkUnsignedIntArray >::New( ); - darray->SetNumberOfComponents( 1 ); - out->GetPointData( )->SetScalars( darray ); - vtkPoints* points = out->GetPoints( ); - vtkCellArray* lines = out->GetLines( ); - - // Assign all data - const TPath* path = this->GetInput( ); - for( unsigned long i = 0; i < path->GetSize( ); ++i ) - { - auto pnt = path->GetPoint( i ); - if( dim == 1 ) - points->InsertNextPoint( pnt[ 0 ], 0, 0 ); - else if( dim == 2 ) - points->InsertNextPoint( pnt[ 0 ], pnt[ 1 ], 0 ); - else - points->InsertNextPoint( pnt[ 0 ], pnt[ 1 ], pnt[ 2 ] ); - darray->InsertNextTuple1( double( i ) ); - if( i > 0 ) - { - lines->InsertNextCell( 2 ); - lines->InsertCellPoint( points->GetNumberOfPoints( ) - 2 ); - lines->InsertCellPoint( points->GetNumberOfPoints( ) - 1 ); - - } // fi - - } // rof - return( 1 ); -} - -// ------------------------------------------------------------------------- -template< class _TPath > -int fpa::VTK::Image::PolyLineParametricPathToPolyDataFilter< _TPath >:: -RequestInformation( - vtkInformation* information, - vtkInformationVector** input, - vtkInformationVector* output - ) -{ - return( 1 ); -} - -#endif // __fpa__VTK__Image__PolyLineParametricPathToPolyDataFilterFilter__hxx__ -// eof - $RCSfile$