+
+ // Add if no actors were found
+ if( cont )
+ this->SetMainActor( actor, name );
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+AddMesh( vtkPolyData* mesh, const std::string& name )
+{
+ std::cerr << "SimpleMPR: adding mesh" << std::endl;
+ std::exit( 1 );
+ /* TODO
+ PolyDataActor a;
+ a.Configure( mesh );
+ this->m_PolyDatas[ mesh ] = a;
+ this->m_Renderers[ 3 ]->AddViewProp( a.Actor );
+
+ bool has_main_image = false;
+ for( unsigned int i = 0; i < 3; ++i )
+ {
+ if( this->m_2DSlices[ i ].GetPointer( ) != NULL )
+ {
+ if( this->m_2DSlices[ i ]->GetInputData( ) != NULL )
+ {
+ has_main_image = true;
+ this->m_2DSlices[ i ]->AddMesh( mesh );
+ this->m_2DSlices[ i ]->Render( );
+
+ } // fi
+
+ } // fi
+
+ } // rof
+ if( !has_main_image )
+ this->m_Renderers[ 3 ]->ResetCamera( );
+ this->m_VTK[ 3 ]->GetRenderWindow( )->Render( );
+ */
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+AddMeshActor( vtkProp3D* actor, const std::string& name )
+{
+ if( actor != NULL )
+ {
+ std::cout << name << " " << actor << std::endl;
+
+ this->m_Renderers[ 3 ]->AddViewProp( actor );
+ this->m_VTK[ 3 ]->GetRenderWindow( )->Render( );
+ this->m_NamedActors[ name ].insert( actor );
+ std::cout << "Size: " << this->m_NamedActors.size( ) << " " << this->m_NamedActors[ name ].size( ) << std::endl;
+
+
+ double bounds[ 6 ];
+ this->m_Renderers[ 3 ]->ComputeVisiblePropBounds( bounds );
+ std::cout
+ << bounds[ 0 ] << " " << bounds[ 1 ] << " "
+ << bounds[ 2 ] << " " << bounds[ 3 ] << " "
+ << bounds[ 4 ] << " " << bounds[ 5 ] << std::endl;
+
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+void cpExtensions::QT::SimpleMPRWidget::
+AddActor( vtkProp* actor, const std::string& name )
+{
+ auto ia = dynamic_cast< vtkImageActor* >( actor );
+ if( ia == NULL )
+ {
+ auto ma = dynamic_cast< vtkProp3D* >( actor );
+ if( ma != NULL )
+ this->AddMeshActor( ma, name );
+ }
+ else
+ 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 );