#ifndef __CPPLUGINS__ORTHONORMALBASE__H__ #define __CPPLUGINS__ORTHONORMALBASE__H__ #include #include #include #include #include #include #include #include #include #include namespace cpPlugins { /** */ class cpPlugins_EXPORT OrthoNormalBase : public DataObject { public: typedef OrthoNormalBase Self; typedef DataObject Superclass; 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 ); cpPlugins_Id_Macro( OrthoNormalBase, Object ); public: virtual void SetITK( itk::LightObject* o ) ITK_OVERRIDE; virtual void SetVTK( vtkObjectBase* o ) ITK_OVERRIDE; 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( ); virtual void _CreateVTKActor( ) const ITK_OVERRIDE; private: // Purposely not implemented OrthoNormalBase( const Self& ); Self& operator=( const Self& ); protected: mutable BaseActor m_BaseActor; }; } // ecapseman #include #endif // __CPPLUGINS__ORTHONORMALBASE__H__ // eof - $RCSfile$