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