-// -------------------------------------------------------------------------
-cpExtensions::QT::SimpleMPRWidget::PolyDataActor::
-PolyDataActor( )
- : Mesh( NULL ),
- Normals( NULL ),
- Stripper( NULL ),
- Mapper( NULL ),
- Actor( NULL )
-{
-}
-
-// -------------------------------------------------------------------------
-cpExtensions::QT::SimpleMPRWidget::PolyDataActor::
-~PolyDataActor( )
-{
- if( this->Actor != NULL ) this->Actor->Delete( );
- if( this->Mapper != NULL ) this->Mapper->Delete( );
- if( this->Stripper != NULL ) this->Stripper->Delete( );
- if( this->Normals != NULL ) this->Normals->Delete( );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::SimpleMPRWidget::PolyDataActor::
-Configure( vtkPolyData* pd )
-{
- if( pd == NULL )
- return;
-
- double range[ 2 ];
- pd->GetScalarRange( range );
-
- this->Normals = vtkPolyDataNormals::New( );
- this->Stripper = vtkStripper::New( );
- this->Mapper = vtkPolyDataMapper::New( );
- this->Actor = vtkQuadricLODActor::New( );
-
- this->Mesh = pd;
- this->Normals->SetInputData( pd );
- this->Normals->SetFeatureAngle( 60.0 );
- this->Stripper->SetInputConnection( this->Normals->GetOutputPort( ) );
- this->Mapper->SetInputConnection( this->Stripper->GetOutputPort( ) );
- this->Mapper->UseLookupTableScalarRangeOff( );
- this->Mapper->SetScalarRange(
- range[ 0 ], ( ( range[ 1 ] - range[ 0 ] ) * 0.75 ) + range[ 0 ]
- );
- this->Actor->SetMapper( this->Mapper );
- this->Actor->DeferLODConstructionOff( );
-}
-
-// -------------------------------------------------------------------------
-cpExtensions::QT::SimpleMPRWidget::Data::
-Data( )
-{
- this->Tag = Data::IMAGE;
- this->Image = NULL;
-}
-
-// -------------------------------------------------------------------------
-cpExtensions::QT::SimpleMPRWidget::Data::
-~Data( )
-{
-}
-
-// -------------------------------------------------------------------------
-cpExtensions::QT::SimpleMPRWidget::
-Data& cpExtensions::QT::SimpleMPRWidget::Data::
-operator=( const Data& data )
-{
- this->Tag = data.Tag;
- if( this->Tag == Data::IMAGE )
- this->Image = data.Image;
- else if( this->Tag == Data::MESH )
- this->Mesh = data.Mesh;
- return( *this );
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::SimpleMPRWidget::Data::
-SetImageData( vtkImageData* data )
-{
- this->Tag = Data::IMAGE;
- this->Image = data;
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::SimpleMPRWidget::Data::
-SetPolyData( vtkPolyData* data )
-{
- this->Tag = Data::MESH;
- this->Mesh.Configure( data );
-}
-
-// -------------------------------------------------------------------------
-vtkImageData* cpExtensions::QT::SimpleMPRWidget::Data::
-GetImage( )
-{
- if( this->Tag == Data::IMAGE )
- return( this->Image );
- else
- return( NULL );
-}
-
-// -------------------------------------------------------------------------
-vtkPolyData* cpExtensions::QT::SimpleMPRWidget::Data::
-GetMesh( )
-{
- if( this->Tag == Data::MESH )
- return( this->Mesh.Mesh );
- else
- return( NULL );
-}
-
-// -------------------------------------------------------------------------
-vtkProp* cpExtensions::QT::SimpleMPRWidget::Data::
-GetMeshActor( )
-{
- if( this->Tag == Data::MESH )
- return( this->Mesh.Actor );
- else
- return( NULL );
-}
-