-DeleteData( const std::string& name )
-{
- auto iIt = this->m_Data.find( name );
- if( iIt != this->m_Data.end( ) )
- {
- this->m_Data.erase( iIt );
-
- // Get children
- std::vector< std::string > to_erase;
- auto tIt = this->m_Tree.begin( );
- for( ; tIt != this->m_Tree.end( ); ++tIt )
- if( tIt->second == name )
- to_erase.push_back( tIt->first );
-
- // Delete from tree
- tIt = this->m_Tree.find( name );
- if( tIt != this->m_Tree.end( ) )
- this->m_Tree.erase( tIt );
-
- // Recursive erase
- auto dIt = to_erase.begin( );
- for( ; dIt != to_erase.end( ); ++dIt )
- this->DeleteData( *dIt );
-
- // Delete from tree widget
- /* TODO
- QTreeWidgetItem* item = this->_FindItemInTree( name );
- if( item != NULL )
- this->m_UI->LoadedData->removeItemWidget( item, 0 );
- */
-
- // Reset main image, just in case
- if( this->m_Data.size( ) == 0 )
- this->m_MainImage = "";
-
- } // fi
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::SimpleMPRWidget::
-DeleteAllData( )
-{
- this->m_MPRObjects->Clear( );
- this->m_Data.clear( );
- this->m_Tree.clear( );
- // TODO: this->m_UI->LoadedData->clear( );
- this->m_MainImage = "";
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::SimpleMPRWidget::
-SetDataColor(
- const std::string& name, const double& r, const double& g, const double& b
- )
-{
- /*
- auto iIt = this->m_Data.find( name );
- if( iIt == this->m_Data.end( ) )
- return;
-
- if( iIt->second.Tag == Data::IMAGE )
- {
- }
- else if( iIt->second.Tag == Data::MESH )
- {
- } // fi
- */
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::SimpleMPRWidget::
-ShowData( const std::string& name )
-{
- auto iIt = this->m_Data.find( name );
- if( iIt == this->m_Data.end( ) )
- return;
-
- if( iIt->second.Tag == Data::IMAGE )
- {
- if( name == this->m_MainImage )
- this->m_MPRObjects->SetInputImage( iIt->second.Image );
- else
- {
- unsigned int i = ( this->m_MPRObjects->GetNumberOfImages( ) - 1 ) % 8;
- this->m_MPRObjects->AddBinaryImage(
- iIt->second.Image,
- Self::cm_Colors[ i ][ 0 ],
- Self::cm_Colors[ i ][ 1 ],
- Self::cm_Colors[ i ][ 2 ]
- );
- }
- this->m_MPRObjects->Show( );
- }
- else if( iIt->second.Tag == Data::MESH )
- {
- vtkRenderer* ren =
- this->m_VTK[ 3 ]->GetRenderWindow( )->
- GetRenderers( )->GetFirstRenderer( );
- if( ren == NULL )
- return;
- ren->AddActor( iIt->second.GetMeshActor( ) );
- this->m_VTK[ 3 ]->GetRenderWindow( )->Render( );
-
- } // fi
-}
-
-// -------------------------------------------------------------------------
-void cpExtensions::QT::SimpleMPRWidget::
-HideData( const std::string& name )
-{
-}
-
-// -------------------------------------------------------------------------
-vtkRenderWindowInteractor* cpExtensions::QT::SimpleMPRWidget::
-GetInteractor( unsigned int i )