1 #ifndef __CPPLUGINS__ORTHONORMALBASE__H__
2 #define __CPPLUGINS__ORTHONORMALBASE__H__
4 #include <cpPlugins/DataObject.h>
7 #include <vtkPolyDataMapper.h>
9 #include <vtkCellArray.h>
10 #include <vtkPoints.h>
11 #include <vtkPolyData.h>
12 #include <vtkPolyDataMapper.h>
14 #include <vtkSmartPointer.h>
20 class cpPlugins_EXPORT OrthoNormalBase
24 typedef OrthoNormalBase Self;
25 typedef DataObject Superclass;
26 typedef itk::SmartPointer< Self > Pointer;
27 typedef itk::SmartPointer< const Self > ConstPointer;
31 vtkSmartPointer< vtkPolyData > Axes;
32 vtkSmartPointer< vtkPolyDataMapper > Mapper;
33 vtkSmartPointer< vtkActor > Actor;
35 void SetBase( vtkMatrix4x4* matrix )
37 this->Axes = vtkSmartPointer< vtkPolyData >::New( );
38 this->Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
39 this->Actor = vtkSmartPointer< vtkActor >::New( );
41 vtkSmartPointer< vtkPoints > points = vtkSmartPointer< vtkPoints >::New( );
42 points->InsertNextPoint( 0, 0, 0 );
43 points->InsertNextPoint( 1, 0, 0 );
44 points->InsertNextPoint( 0, 1, 0 );
45 points->InsertNextPoint( 0, 0, 1 );
46 vtkSmartPointer< vtkCellArray > lines = vtkSmartPointer< vtkCellArray >::New( );
47 lines->InsertNextCell( 2 ); lines->InsertCellPoint( 0 ); lines->InsertCellPoint( 1 );
48 lines->InsertNextCell( 2 ); lines->InsertCellPoint( 0 ); lines->InsertCellPoint( 2 );
49 lines->InsertNextCell( 2 ); lines->InsertCellPoint( 0 ); lines->InsertCellPoint( 3 );
50 this->Axes->SetPoints( points );
51 this->Axes->SetLines( lines );
53 this->Mapper->SetInputData( this->Axes );
54 this->Actor->SetMapper( this->Mapper );
60 itkTypeMacro( OrthoNormalBase, DataObject );
61 cpPlugins_Id_Macro( OrthoNormalBase, Object );
64 virtual void SetITK( itk::LightObject* o ) ITK_OVERRIDE;
65 virtual void SetVTK( vtkObjectBase* o ) ITK_OVERRIDE;
67 template< class _TMatrix >
68 inline void SetITK( const _TMatrix& m );
70 template< class _TMatrix, class _TVector >
71 inline void SetITK( const _TMatrix& m, const _TVector& v );
75 virtual ~OrthoNormalBase( );
77 virtual void _CreateVTKActor( ) const ITK_OVERRIDE;
80 // Purposely not implemented
81 OrthoNormalBase( const Self& );
82 Self& operator=( const Self& );
85 mutable BaseActor m_BaseActor;
90 #include <cpPlugins/OrthoNormalBase.hxx>
92 #endif // __CPPLUGINS__ORTHONORMALBASE__H__