1 #ifndef __FPA__VTK__POINTPATHTOPOLYDATAFILTER__HXX__
2 #define __FPA__VTK__POINTPATHTOPOLYDATAFILTER__HXX__
4 #include <vtkInformation.h>
5 #include <vtkInformationVector.h>
7 // -------------------------------------------------------------------------
9 typename fpa::VTK::PointPathToPolyDataFilter< C >::
10 Self* fpa::VTK::PointPathToPolyDataFilter< C >::
13 return( new Self( ) );
16 // -------------------------------------------------------------------------
18 const C* fpa::VTK::PointPathToPolyDataFilter< C >::
21 return( this->m_Container );
24 // -------------------------------------------------------------------------
26 void fpa::VTK::PointPathToPolyDataFilter< C >::
27 SetInput( const C* c )
29 if( this->m_Container != c )
31 this->m_Container = c;
37 // -------------------------------------------------------------------------
39 fpa::VTK::PointPathToPolyDataFilter< C >::
40 PointPathToPolyDataFilter( )
41 : vtkPolyDataAlgorithm( ),
44 this->SetNumberOfInputPorts( 0 );
47 // -------------------------------------------------------------------------
49 fpa::VTK::PointPathToPolyDataFilter< C >::
50 ~PointPathToPolyDataFilter( )
54 // -------------------------------------------------------------------------
56 int fpa::VTK::PointPathToPolyDataFilter< C >::
58 vtkInformation* information,
59 vtkInformationVector** input,
60 vtkInformationVector* output
63 if( this->m_Container == NULL )
67 vtkInformation* info = output->GetInformationObject( 0 );
68 vtkPolyData* out = vtkPolyData::SafeDownCast(
69 info->Get( vtkDataObject::DATA_OBJECT( ) )
73 vtkPoints* points = out->GetPoints( );
76 points = vtkPoints::New( );
77 out->SetPoints( points );
81 points->SetNumberOfPoints( this->m_Container->size( ) );
84 vtkSmartPointer< vtkCellArray > cells =
85 vtkSmartPointer< vtkCellArray >::New( );
89 typename C::const_iterator it = this->m_Container->begin( );
90 it != this->m_Container->end( );
95 if( TPoint::Dimension == 1 )
96 points->SetPoint( pId, pnt[ 0 ], 0, 0 );
97 else if( TPoint::Dimension == 2 )
98 points->SetPoint( pId, pnt[ 0 ], pnt[ 1 ], 0 );
100 points->SetPoint( pId, pnt[ 0 ], pnt[ 1 ], pnt[ 2 ] );
102 cells->InsertNextCell( 1 );
103 cells->InsertCellPoint( pId );
106 out->SetPoints( points );
107 out->SetVerts( cells );
111 // -------------------------------------------------------------------------
113 int fpa::VTK::PointPathToPolyDataFilter< C >::
115 vtkInformation* information,
116 vtkInformationVector** input,
117 vtkInformationVector* output
120 vtkInformation* info = output->GetInformationObject( 0 );
123 vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES( ), -1
127 if( this->m_Container != NULL )
130 typename C::TScalar len = this->m_RGC->GetTotalLength( );
131 typename C::TScalar s0 = this->m_RGC->Gets0( );
132 typename C::TPoint p0 = this->m_RGC->Axis( s0 );
133 typename C::TPoint p1 = this->m_RGC->Axis( s0 + len );
136 vtkStreamingDemandDrivenPipeline::WHOLE_BOUNDING_BOX( ),
137 double( p0[ 0 ] ), double( p1[ 0 ] ),
138 double( p0[ 1 ] ), double( p1[ 1 ] ),
139 double( p0[ 2 ] ), double( p1[ 2 ] )
147 #endif // __FPA__VTK__POINTPATHTOPOLYDATAFILTER__HXX__