--- /dev/null
+#ifndef __FPA__VTK__POINTPATHTOPOLYDATAFILTER__H__
+#define __FPA__VTK__POINTPATHTOPOLYDATAFILTER__H__
+
+#include <vtkPolyDataAlgorithm.h>
+
+namespace fpa
+{
+ namespace VTK
+ {
+ /**
+ */
+ template< class C >
+ class PointPathToPolyDataFilter
+ : public vtkPolyDataAlgorithm
+ {
+ public:
+ typedef PointPathToPolyDataFilter Self;
+
+ typedef C TContainer;
+ typedef typename C::value_type TPoint;
+
+ public:
+ vtkTypeMacro( PointPathToPolyDataFilter, vtkPolyDataAlgorithm );
+
+ public:
+ static Self* New( );
+
+ const C* GetInput( ) const;
+ void SetInput( const C* c );
+
+ protected:
+ PointPathToPolyDataFilter( );
+ virtual ~PointPathToPolyDataFilter( );
+
+ int RequestData(
+ vtkInformation* information,
+ vtkInformationVector** input,
+ vtkInformationVector* output
+ );
+ int RequestInformation(
+ vtkInformation* information,
+ vtkInformationVector** input,
+ vtkInformationVector* output
+ );
+
+ private:
+ // Purposely not implemented
+ PointPathToPolyDataFilter( const Self& );
+ void operator=( const Self& );
+
+ protected:
+ const C* m_Container;
+ };
+
+ } // ecapseman
+
+} // ecapseman
+
+#include <fpa/VTK/PointPathToPolyDataFilter.hxx>
+
+#endif // __FPA__VTK__POINTPATHTOPOLYDATAFILTER__H__
+
+// eof - $RCSfile$
--- /dev/null
+#ifndef __FPA__VTK__POINTPATHTOPOLYDATAFILTER__HXX__
+#define __FPA__VTK__POINTPATHTOPOLYDATAFILTER__HXX__
+
+#include <vtkInformation.h>
+#include <vtkInformationVector.h>
+
+// -------------------------------------------------------------------------
+template< class C >
+typename fpa::VTK::PointPathToPolyDataFilter< C >::
+Self* fpa::VTK::PointPathToPolyDataFilter< C >::
+New( )
+{
+ return( new Self( ) );
+}
+
+// -------------------------------------------------------------------------
+template< class C >
+const C* fpa::VTK::PointPathToPolyDataFilter< C >::
+GetInput( ) const
+{
+ return( this->m_Container );
+}
+
+// -------------------------------------------------------------------------
+template< class C >
+void fpa::VTK::PointPathToPolyDataFilter< C >::
+SetInput( const C* c )
+{
+ if( this->m_Container != c )
+ {
+ this->m_Container = c;
+ this->Modified( );
+
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+template< class C >
+fpa::VTK::PointPathToPolyDataFilter< C >::
+PointPathToPolyDataFilter( )
+ : vtkPolyDataAlgorithm( ),
+ m_Container( NULL )
+{
+ this->SetNumberOfInputPorts( 0 );
+}
+
+// -------------------------------------------------------------------------
+template< class C >
+fpa::VTK::PointPathToPolyDataFilter< C >::
+~PointPathToPolyDataFilter( )
+{
+}
+
+// -------------------------------------------------------------------------
+template< class C >
+int fpa::VTK::PointPathToPolyDataFilter< C >::
+RequestData(
+ vtkInformation* information,
+ vtkInformationVector** input,
+ vtkInformationVector* output
+ )
+{
+ if( this->m_Container == NULL )
+ return( 0 );
+
+ // Get output
+ vtkInformation* info = output->GetInformationObject( 0 );
+ vtkPolyData* out = vtkPolyData::SafeDownCast(
+ info->Get( vtkDataObject::DATA_OBJECT( ) )
+ );
+
+ // Prepare points
+ vtkPoints* points = out->GetPoints( );
+ if( points == NULL )
+ {
+ points = vtkPoints::New( );
+ out->SetPoints( points );
+ points->Delete( );
+
+ } // fi
+ points->SetNumberOfPoints( this->m_Container->size( ) );
+
+ // Prepare cells
+ vtkSmartPointer< vtkCellArray > cells =
+ vtkSmartPointer< vtkCellArray >::New( );
+
+ unsigned int pId = 0;
+ for(
+ typename C::const_iterator it = this->m_Container->begin( );
+ it != this->m_Container->end( );
+ ++it, ++pId
+ )
+ {
+ TPoint pnt = *it;
+ if( TPoint::Dimension == 1 )
+ points->SetPoint( pId, pnt[ 0 ], 0, 0 );
+ else if( TPoint::Dimension == 2 )
+ points->SetPoint( pId, pnt[ 0 ], pnt[ 1 ], 0 );
+ else
+ points->SetPoint( pId, pnt[ 0 ], pnt[ 1 ], pnt[ 2 ] );
+
+ cells->InsertNextCell( 1 );
+ cells->InsertCellPoint( pId );
+
+ } // rof
+ out->SetPoints( points );
+ out->SetVerts( cells );
+ return( 1 );
+}
+
+// -------------------------------------------------------------------------
+template< class C >
+int fpa::VTK::PointPathToPolyDataFilter< C >::
+RequestInformation(
+ vtkInformation* information,
+ vtkInformationVector** input,
+ vtkInformationVector* output
+ )
+{
+ vtkInformation* info = output->GetInformationObject( 0 );
+ /* TODO
+ info->Set(
+ vtkStreamingDemandDrivenPipeline::MAXIMUM_NUMBER_OF_PIECES( ), -1
+ );
+ */
+
+ if( this->m_Container != NULL )
+ {
+ /* TODO
+ typename C::TScalar len = this->m_RGC->GetTotalLength( );
+ typename C::TScalar s0 = this->m_RGC->Gets0( );
+ typename C::TPoint p0 = this->m_RGC->Axis( s0 );
+ typename C::TPoint p1 = this->m_RGC->Axis( s0 + len );
+
+ info->Set(
+ vtkStreamingDemandDrivenPipeline::WHOLE_BOUNDING_BOX( ),
+ double( p0[ 0 ] ), double( p1[ 0 ] ),
+ double( p0[ 1 ] ), double( p1[ 1 ] ),
+ double( p0[ 2 ] ), double( p1[ 2 ] )
+ );
+ */
+
+ } // fi
+ return( 1 );
+}
+
+#endif // __FPA__VTK__POINTPATHTOPOLYDATAFILTER__HXX__
+
+// eof - $RCSfile$