]> Creatis software - cpPlugins.git/blob - lib/cpPlugins/Interface/Mesh.cxx
...
[cpPlugins.git] / lib / cpPlugins / Interface / Mesh.cxx
1 #include <cpPlugins/Interface/Mesh.h>
2
3 #include <vtkPolyData.h>
4
5 // -------------------------------------------------------------------------
6 void cpPlugins::Interface::Mesh::
7 SetVTKMesh( vtkPolyData* mesh )
8 {
9   this->m_VTKObject = mesh;
10
11   this->m_Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
12   this->m_Actor = vtkSmartPointer< vtkActor >::New( );
13
14   this->m_Mapper->SetInputData( mesh );
15   this->m_Actor->SetMapper( this->m_Mapper );
16
17   this->Modified( );
18 }
19
20 // -------------------------------------------------------------------------
21 vtkPolyData* cpPlugins::Interface::Mesh::
22 GetVTKMesh( )
23 {
24   return( dynamic_cast< vtkPolyData* >( this->m_VTKObject.GetPointer( ) ) );
25 }
26
27 // -------------------------------------------------------------------------
28 const vtkPolyData* cpPlugins::Interface::Mesh::
29 GetVTKMesh( ) const
30 {
31   return(
32     dynamic_cast< const vtkPolyData* >( this->m_VTKObject.GetPointer( ) )
33     );
34 }
35
36 // -------------------------------------------------------------------------
37 vtkActor* cpPlugins::Interface::Mesh::
38 GetVTKActor( )
39 {
40   return( this->m_Actor );
41 }
42
43 // -------------------------------------------------------------------------
44 const vtkActor* cpPlugins::Interface::Mesh::
45 GetVTKActor( ) const
46 {
47   return( this->m_Actor );
48 }
49
50 // -------------------------------------------------------------------------
51 cpPlugins::Interface::Mesh::
52 Mesh( )
53   : Superclass( )
54 {
55   this->m_ClassName = "cpPlugins::Interface::Mesh";
56   this->m_ClassCategory = "BasicObject";
57 }
58
59 // -------------------------------------------------------------------------
60 cpPlugins::Interface::Mesh::
61 ~Mesh( )
62 {
63 }
64
65 // eof - $RCSfile$