X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPluginsExtensions%2FSimple3DCurve.cxx;fp=lib%2FcpPluginsExtensions%2FSimple3DCurve.cxx;h=86db732ba7fe2e746d4703514cad03d62662529e;hb=ced860e96e5d2e10481582649664505396b0054d;hp=0000000000000000000000000000000000000000;hpb=d8c6c19cd58d865ddfde7a5724bd99bbad19878c;p=cpPlugins.git diff --git a/lib/cpPluginsExtensions/Simple3DCurve.cxx b/lib/cpPluginsExtensions/Simple3DCurve.cxx new file mode 100644 index 0000000..86db732 --- /dev/null +++ b/lib/cpPluginsExtensions/Simple3DCurve.cxx @@ -0,0 +1,63 @@ +#include +#include +#include + +// ------------------------------------------------------------------------- +void cpPluginsExtensions::Simple3DCurve:: +SetITK( itk::LightObject* o ) +{ + cpPlugins_Demangle_Simple3DCurve_All_1( o, _ITK_2_VTK ) + { + this->m_VTK = NULL; + this->m_ITKvVTK = NULL; + } +} + +// ------------------------------------------------------------------------- +void cpPluginsExtensions::Simple3DCurve:: +SetVTK( vtkObjectBase* o ) +{ + // Do nothing + this->m_ITK = NULL; + this->m_VTK = NULL; + this->m_ITKvVTK = NULL; +} + +// ------------------------------------------------------------------------- +cpPluginsExtensions::Simple3DCurve:: +Simple3DCurve( ) + : Superclass( ) +{ +} + +// ------------------------------------------------------------------------- +cpPluginsExtensions::Simple3DCurve:: +~Simple3DCurve( ) +{ +} + +// ------------------------------------------------------------------------- +template< class _TSimple3DCurve > +void cpPluginsExtensions::Simple3DCurve:: +_ITK_2_VTK( _TSimple3DCurve* curve ) +{ + typedef + cpExtensions::Visualization::Simple3DCurveToPolyData< _TSimple3DCurve > + _TFilter; + _TFilter* f = dynamic_cast< _TFilter* >( this->m_ITKvVTK.GetPointer( ) ); + if( f == NULL ) + { + _TFilter* nf = _TFilter::New( ); + this->m_ITKvVTK = nf; + f = nf; + + } // fi + f->SetInput( curve ); + f->Update( ); + + // Keep object track + this->m_ITK = curve; + this->m_VTK = f->GetOutput( ); +} + +// eof - $RCSfile$