#include #include #include #include #include // ------------------------------------------------------------------------- cpExtensions::Visualization::MeshActor:: MeshActor( ) { } // ------------------------------------------------------------------------- cpExtensions::Visualization::MeshActor:: ~MeshActor( ) { } // ------------------------------------------------------------------------- void cpExtensions::Visualization::MeshActor:: SetMesh( vtkPolyData* mesh ) { static unsigned long MAX = std::numeric_limits< unsigned short >::max( ); this->m_Mesh = mesh; this->m_Mapper = vtkSmartPointer< vtkPolyDataMapper >::New( ); unsigned long c = mesh->GetNumberOfPolys( ) + mesh->GetNumberOfStrips( ); if( c >= MAX ) { vtkSmartPointer< vtkQuadricLODActor > q = vtkSmartPointer< vtkQuadricLODActor >::New( ); q->DeferLODConstructionOff( ); this->m_Actor = q.GetPointer( ); } else this->m_Actor = vtkSmartPointer< vtkActor >::New( ); this->m_Mapper->SetInputData( this->m_Mesh ); this->m_Actor->SetMapper( this->m_Mapper ); } // ------------------------------------------------------------------------- vtkActor* cpExtensions::Visualization::MeshActor:: GetActor( ) { return( this->m_Actor.GetPointer( ) ); } // ------------------------------------------------------------------------- const vtkActor* cpExtensions::Visualization::MeshActor:: GetActor( ) const { return( this->m_Actor.GetPointer( ) ); } // eof - $RCSfile$