#ifdef cpExtensions_QT4
#include <cpExtensions/ui_SimpleMPRWidget.h>
+#include <vtkRenderer.h>
#include <vtkRenderWindow.h>
// -------------------------------------------------------------------------
cpExtensions::QT::SimpleMPRWidget::
~SimpleMPRWidget( )
{
+ this->Clear( );
delete this->m_UI;
}
this->m_3DSlices[ i ]->Clear( );
} // rof
- this->m_PolyDatas.clear( );
+ this->m_NamedActors.clear( );
}
// -------------------------------------------------------------------------
void cpExtensions::QT::SimpleMPRWidget::
-SetMainImage( vtkImageData* image )
+SetMainImage( vtkImageData* image, const std::string& name )
{
this->Clear( );
for( unsigned int i = 0; i < 3; ++i )
)
);
+ this->m_NamedActors[ name ].insert(
+ this->m_2DSlices[ i ]->GetImageActor( )
+ );
+ this->m_NamedActors[ name ].insert(
+ this->m_3DSlices[ i ]->GetImageActor( )
+ );
+
} // rof
this->_AssociateSlices( );
}
// -------------------------------------------------------------------------
void cpExtensions::QT::SimpleMPRWidget::
-SetMainActor( vtkImageActor* actor )
+SetMainActor( vtkImageActor* actor, const std::string& name )
{
this->Clear( );
vtkImageData* image = NULL;
)
);
+ this->m_NamedActors[ name ].insert(
+ this->m_2DSlices[ i ]->GetImageActor( )
+ );
+ this->m_NamedActors[ name ].insert(
+ this->m_3DSlices[ i ]->GetImageActor( )
+ );
+
} // rof
this->_AssociateSlices( );
}
// -------------------------------------------------------------------------
void cpExtensions::QT::SimpleMPRWidget::
-AddImage( vtkImageData* image )
+AddImage( vtkImageData* image, const std::string& name )
{
std::cerr << "SimpleMPR: adding image" << std::endl;
std::exit( 1 );
// -------------------------------------------------------------------------
void cpExtensions::QT::SimpleMPRWidget::
-AddImageActor( vtkImageActor* actor )
+AddImageActor( vtkImageActor* actor, const std::string& name )
{
unsigned int i = 0;
bool cont = true;
// Add if no actors were found
if( cont )
- this->SetMainActor( actor );
+ this->SetMainActor( actor, name );
}
// -------------------------------------------------------------------------
void cpExtensions::QT::SimpleMPRWidget::
-AddMesh( vtkPolyData* mesh )
+AddMesh( vtkPolyData* mesh, const std::string& name )
{
std::cerr << "SimpleMPR: adding mesh" << std::endl;
std::exit( 1 );
// -------------------------------------------------------------------------
void cpExtensions::QT::SimpleMPRWidget::
-AddMeshActor( vtkProp3D* actor )
+AddMeshActor( vtkProp3D* actor, const std::string& name )
{
if( actor != NULL )
{
this->m_Renderers[ 3 ]->AddViewProp( actor );
this->m_VTK[ 3 ]->GetRenderWindow( )->Render( );
+ this->m_NamedActors[ name ].insert( actor );
} // fi
}
// -------------------------------------------------------------------------
void cpExtensions::QT::SimpleMPRWidget::
-AddActor( vtkProp* actor )
+AddActor( vtkProp* actor, const std::string& name )
{
auto ia = dynamic_cast< vtkImageActor* >( actor );
if( ia == NULL )
{
auto ma = dynamic_cast< vtkActor* >( actor );
if( ma != NULL )
- this->AddMeshActor( ma );
+ this->AddMeshActor( ma, name );
}
else
- this->AddImageActor( ia );
+ this->AddImageActor( ia, name );
+}
+
+// -------------------------------------------------------------------------
+const cpExtensions::QT::SimpleMPRWidget::
+TActors& cpExtensions::QT::SimpleMPRWidget::
+GetActors( const std::string& name ) const
+{
+ static const TActors empty;
+ auto i = this->m_NamedActors.find( name );
+ if( i != this->m_NamedActors.end( ) )
+ return( i->second );
+ else
+ return( empty );
}
// -------------------------------------------------------------------------