1 #include <cpPlugins/Interface/Mesh.h>
3 #include <vtkPolyData.h>
5 // -------------------------------------------------------------------------
6 void cpPlugins::Interface::Mesh::
7 SetVTK( vtkObject* mesh )
9 if( dynamic_cast< vtkPolyData* >( mesh ) != NULL )
10 this->m_VTKObject = mesh;
12 this->m_VTKObject = NULL;
13 this->m_Mapper = NULL;
18 // -------------------------------------------------------------------------
19 void cpPlugins::Interface::Mesh::
22 vtkPolyData* pd = this->GetVTK< vtkPolyData >( );
26 this->m_Mapper.GetPointer( ) == NULL ||
27 this->m_Actor.GetPointer( ) == NULL
31 this->m_Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
32 this->m_Actor = vtkSmartPointer< vtkActor >::New( );
33 this->m_Mapper->SetInputData( pd );
34 this->m_Actor->SetMapper( this->m_Mapper );
40 // -------------------------------------------------------------------------
41 vtkActor* cpPlugins::Interface::Mesh::
44 return( this->m_Actor );
47 // -------------------------------------------------------------------------
48 const vtkActor* cpPlugins::Interface::Mesh::
51 return( this->m_Actor );
54 // -------------------------------------------------------------------------
55 cpPlugins::Interface::Mesh::
61 this->m_ClassName = "cpPlugins::Interface::Mesh";
62 this->m_ClassCategory = "BasicObject";
65 // -------------------------------------------------------------------------
66 cpPlugins::Interface::Mesh::