]> Creatis software - cpPlugins.git/blobdiff - lib/cpPlugins/OrthoNormalBase.h
...
[cpPlugins.git] / lib / cpPlugins / OrthoNormalBase.h
index d1ef29e48cb3542bfada3f9cb1c9038d2d762107..11bf87b986766b823ce1b5b8fd7a8877048d505b 100644 (file)
@@ -2,15 +2,8 @@
 #define __CPPLUGINS__ORTHONORMALBASE__H__
 
 #include <cpPlugins/DataObject.h>
-#include <vtkActor.h>
-#include <vtkAxes.h>
-#include <vtkPolyDataMapper.h>
-#include <vtkActor.h>
-#include <vtkCellArray.h>
-#include <vtkPoints.h>
-#include <vtkPolyData.h>
-#include <vtkPolyDataMapper.h>
 
+#include <vtkAxesActor.h>
 #include <vtkSmartPointer.h>
 
 namespace cpPlugins
@@ -26,35 +19,6 @@ 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 );
@@ -82,7 +46,7 @@ namespace cpPlugins
     Self& operator=( const Self& );
 
   protected:
-    mutable BaseActor m_BaseActor;
+    mutable vtkSmartPointer< vtkAxesActor > m_BaseActor;
   };
 
 } // ecapseman