X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FOrthoNormalBase.h;h=d1ef29e48cb3542bfada3f9cb1c9038d2d762107;hb=f47059eb39b5c9eef5cd2ee1b6c013cd75eff97f;hp=46983dcf107538179553f713bcf2df5a990c1141;hpb=0276214a7bcbb028cb23fa510184a4d0e92c416a;p=cpPlugins.git diff --git a/lib/cpPlugins/OrthoNormalBase.h b/lib/cpPlugins/OrthoNormalBase.h index 46983dc..d1ef29e 100644 --- a/lib/cpPlugins/OrthoNormalBase.h +++ b/lib/cpPlugins/OrthoNormalBase.h @@ -2,6 +2,16 @@ #define __CPPLUGINS__ORTHONORMALBASE__H__ #include +#include +#include +#include +#include +#include +#include +#include +#include + +#include namespace cpPlugins { @@ -16,6 +26,35 @@ namespace cpPlugins typedef itk::SmartPointer< Self > Pointer; typedef itk::SmartPointer< const Self > ConstPointer; + struct BaseActor + { + vtkSmartPointer< vtkPolyData > Axes; + vtkSmartPointer< vtkPolyDataMapper > Mapper; + vtkSmartPointer< vtkActor > Actor; + + void SetBase( vtkMatrix4x4* matrix ) + { + this->Axes = vtkSmartPointer< vtkPolyData >::New( ); + this->Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( ); + this->Actor = vtkSmartPointer< vtkActor >::New( ); + + vtkSmartPointer< vtkPoints > points = vtkSmartPointer< vtkPoints >::New( ); + points->InsertNextPoint( 0, 0, 0 ); + points->InsertNextPoint( 1, 0, 0 ); + points->InsertNextPoint( 0, 1, 0 ); + points->InsertNextPoint( 0, 0, 1 ); + vtkSmartPointer< vtkCellArray > lines = vtkSmartPointer< vtkCellArray >::New( ); + lines->InsertNextCell( 2 ); lines->InsertCellPoint( 0 ); lines->InsertCellPoint( 1 ); + lines->InsertNextCell( 2 ); lines->InsertCellPoint( 0 ); lines->InsertCellPoint( 2 ); + lines->InsertNextCell( 2 ); lines->InsertCellPoint( 0 ); lines->InsertCellPoint( 3 ); + this->Axes->SetPoints( points ); + this->Axes->SetLines( lines ); + + this->Mapper->SetInputData( this->Axes ); + this->Actor->SetMapper( this->Mapper ); + } + }; + public: itkNewMacro( Self ); itkTypeMacro( OrthoNormalBase, DataObject ); @@ -28,6 +67,9 @@ namespace cpPlugins template< class _TMatrix > inline void SetITK( const _TMatrix& m ); + template< class _TMatrix, class _TVector > + inline void SetITK( const _TMatrix& m, const _TVector& v ); + protected: OrthoNormalBase( ); virtual ~OrthoNormalBase( ); @@ -38,6 +80,9 @@ namespace cpPlugins // Purposely not implemented OrthoNormalBase( const Self& ); Self& operator=( const Self& ); + + protected: + mutable BaseActor m_BaseActor; }; } // ecapseman