+AddMesh(
+ vtkPolyData* mesh, const std::string& name, const std::string& parent
+ )
+{
+ if( name == "" || parent == "" )
+ return( false );
+
+ auto iIt = this->m_Data.find( name );
+ if( iIt == this->m_Data.end( ) )
+ {
+ // Add new data
+ Data nd;
+ nd.Tag = Data::MESH;
+ nd.Mesh.Configure( mesh );
+ this->m_Data[ name ] = nd;
+
+ // Update tree
+ auto pIt = this->m_Data.find( parent );
+ if( pIt != this->m_Data.end( ) )
+ this->m_Tree[ name ] = parent;
+ else
+ return( false );
+
+ // Add to tree view
+ this->_UpdateItem( name, parent );
+ return( true );
+ }
+ 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->_FindItem( 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->ClearAll( );
+ 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 )
+ {
+ this->m_MPRObjects->AddImage( iIt->second.Image );
+ }
+ else if( iIt->second.Tag == Data::MESH )
+ {
+ } // fi
+}
+
+// -------------------------------------------------------------------------
+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(