+SetMainImage( const std::string& name )
+{
+ auto iIt = this->m_Data.find( name );
+ if( iIt != this->m_Data.end( ) )
+ {
+ if( iIt->second.Tag == Data::IMAGE )
+ {
+ this->m_MainImage = name;
+ return( true );
+ }
+ else
+ return( false );
+ }
+ else
+ return( false );
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::BaseMPRWidget::
+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
+ 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 cpPlugins::Interface::BaseMPRWidget::
+DeleteAllData( )
+{
+ this->m_MPRObjects->Clear( );
+ this->m_Data.clear( );
+ this->m_Tree.clear( );
+ this->m_UI->LoadedData->clear( );
+ this->m_MainImage = "";
+}
+
+// -------------------------------------------------------------------------
+void cpPlugins::Interface::BaseMPRWidget::
+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 cpPlugins::Interface::BaseMPRWidget::
+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 )
+ {
+ /* TODO
+ 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 cpPlugins::Interface::BaseMPRWidget::
+HideData( const std::string& name )
+{
+}
+
+// -------------------------------------------------------------------------
+vtkRenderWindowInteractor* cpPlugins::Interface::BaseMPRWidget::
+GetInteractor( unsigned int i )
+{
+ if( i < 4 )
+ {
+ if( this->m_VTK[ i ] != NULL )
+ return( this->m_VTK[ i ]->GetInteractor( ) );
+ else
+ return( NULL );
+ }
+ else
+ return( NULL );
+}
+
+// -------------------------------------------------------------------------
+/*
+ bool cpPlugins::Interface::BaseMPRWidget::
+ ShowImage(