1 #include <cpExtensions/Visualization/MeshActor.h>
4 #include <vtkPolyData.h>
5 #include <vtkPolyDataMapper.h>
6 #include <vtkQuadricLODActor.h>
8 // -------------------------------------------------------------------------
9 cpExtensions::Visualization::MeshActor::
14 // -------------------------------------------------------------------------
15 cpExtensions::Visualization::MeshActor::
20 // -------------------------------------------------------------------------
21 void cpExtensions::Visualization::MeshActor::
22 SetMesh( vtkPolyData* mesh )
24 static unsigned long MAX = std::numeric_limits< unsigned short >::max( );
27 this->m_Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( );
28 unsigned long c = mesh->GetNumberOfPolys( ) + mesh->GetNumberOfStrips( );
31 vtkSmartPointer< vtkQuadricLODActor > q =
32 vtkSmartPointer< vtkQuadricLODActor >::New( );
33 q->DeferLODConstructionOff( );
34 this->m_Actor = q.GetPointer( );
37 this->m_Actor = vtkSmartPointer< vtkActor >::New( );
38 this->m_Mapper->SetInputData( this->m_Mesh );
39 this->m_Actor->SetMapper( this->m_Mapper );
42 // -------------------------------------------------------------------------
43 vtkActor* cpExtensions::Visualization::MeshActor::
46 return( this->m_Actor.GetPointer( ) );
49 // -------------------------------------------------------------------------
50 const vtkActor* cpExtensions::Visualization::MeshActor::
53 return( this->m_Actor.GetPointer( ) );