X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2FcpPlugins%2FInterface%2FBaseMPRWidget.cxx;h=d96ae328abc3b65133a62b6519711c95f9989729;hb=31f36736e1c12e7247a01bf514e528dfd1188a10;hp=b84d75c2b39aba1b488ea41fe7ae0807c732ded6;hpb=00b54bc0344d74f31df8b93f7c28a07cfc8d6873;p=cpPlugins.git diff --git a/lib/cpPlugins/Interface/BaseMPRWidget.cxx b/lib/cpPlugins/Interface/BaseMPRWidget.cxx index b84d75c..d96ae32 100644 --- a/lib/cpPlugins/Interface/BaseMPRWidget.cxx +++ b/lib/cpPlugins/Interface/BaseMPRWidget.cxx @@ -9,6 +9,19 @@ #include #include +double cpPlugins::Interface::BaseMPRWidget:: +cm_Colors[ 8 ][ 3 ] = +{ + { 1.0, 0.0, 0.0 }, + { 0.0, 1.0, 0.0 }, + { 0.0, 0.0, 1.0 }, + { 0.0, 1.0, 1.0 }, + { 1.0, 0.0, 1.0 }, + { 1.0, 1.0, 0.0 }, + { 1.0, 0.5, 0.0 }, + { 1.0, 0.0, 0.5 } +}; + // ------------------------------------------------------------------------- cpPlugins::Interface::BaseMPRWidget:: BaseMPRWidget( QWidget* parent ) @@ -183,7 +196,15 @@ ShowData( const std::string& name ) if( name == this->m_MainImage ) this->m_MPRObjects->SetInputImage( iIt->second.Image ); else - this->m_MPRObjects->AddBinaryImage( iIt->second.Image, 1, 0, 0 ); + { + 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 ) @@ -327,7 +348,9 @@ QTreeWidgetItem* cpPlugins::Interface::BaseMPRWidget:: _FindItemInTree( const std::string& name ) const { QList< QTreeWidgetItem* > items = - this->m_UI->LoadedData->findItems( name.c_str( ), Qt::MatchExactly ); + this->m_UI->LoadedData->findItems( + name.c_str( ), Qt::MatchExactly | Qt::MatchRecursive + ); if( items.size( ) > 0 ) return( items[ 0 ] ); else