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
32 pd->GetScalarRange( range );
34 this->m_Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
35 this->m_Actor = vtkSmartPointer< vtkActor >::New( );
36 this->m_Mapper->SetInputData( pd );
37 this->m_Mapper->UseLookupTableScalarRangeOff( );
38 this->m_Mapper->SetScalarRange(
39 range[ 0 ], ( ( range[ 1 ] - range[ 0 ] ) * 0.75 ) + range[ 0 ]
41 this->m_Actor->SetMapper( this->m_Mapper );
47 // -------------------------------------------------------------------------
48 vtkActor* cpPlugins::Interface::Mesh::
51 return( this->m_Actor );
54 // -------------------------------------------------------------------------
55 const vtkActor* cpPlugins::Interface::Mesh::
58 return( this->m_Actor );
61 // -------------------------------------------------------------------------
62 cpPlugins::Interface::Mesh::
70 // -------------------------------------------------------------------------
71 cpPlugins::Interface::Mesh::