]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Mesh.h
...
[cpPlugins.git] / lib / cpPlugins / Mesh.h
1 #ifndef __CPPLUGINS__MESH__H__
2 #define __CPPLUGINS__MESH__H__
3
4 #include <cpPlugins/DataObject.h>
5
6 #include <vtkActor.h>
7 #include <vtkPolyDataNormals.h>
8 #include <vtkPolyData.h>
9 #include <vtkPolyDataMapper.h>
10 #include <vtkQuadricLODActor.h>
11 #include <vtkStripper.h>
12 #include <vtkSmartPointer.h>
13
14 namespace cpPlugins
15 {
16   /**
17    */
18   class cpPlugins_EXPORT Mesh
19     : public DataObject
20   {
21   public:
22     typedef Mesh                            Self;
23     typedef DataObject                      Superclass;
24     typedef itk::SmartPointer< Self >       Pointer;
25     typedef itk::SmartPointer< const Self > ConstPointer;
26
27     struct MeshActor
28     {
29       vtkSmartPointer< vtkPolyDataNormals > Normals;
30       vtkSmartPointer< vtkStripper >        Stripper;
31       vtkSmartPointer< vtkPolyDataMapper >  Mapper;
32       vtkSmartPointer< vtkQuadricLODActor > LODActor;
33       vtkSmartPointer< vtkActor >           Actor;
34
35       void SetMesh( vtkPolyData* mesh );
36     };
37
38   public:
39     itkNewMacro( Self );
40     itkTypeMacro( Mesh, DataObject );
41     cpPlugins_Id_Macro( Mesh, Object );
42
43   public:
44     virtual void SetITK( itk::LightObject* o ) ITK_OVERRIDE;
45     virtual void SetVTK( vtkObjectBase* o ) ITK_OVERRIDE;
46
47   protected:
48     Mesh( );
49     virtual ~Mesh( );
50
51     virtual void _CreateVTKActor( ) const ITK_OVERRIDE;
52
53     template< class M >
54       inline bool _ITK_2_VTK( itk::LightObject* o );
55
56   private:
57     // Purposely not implemented
58     Mesh( const Self& );
59     Self& operator=( const Self& );
60
61   protected:
62     mutable MeshActor m_MeshActor;
63   };
64
65 } // ecapseman
66
67 #include <cpPlugins/Mesh.hxx>
68
69 #endif // __CPPLUGINS__MESH__H__
70
71 // eof - $RCSfile$