From: ouv Date: Tue, 3 Nov 2009 13:20:36 +0000 (+0000) Subject: Issue 0020570: EDF 1159 VISU: Hide Scalar Bar in contextual menu is inactive X-Git-Tag: V5_1_main_20091104~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=470095b59b0dc391c66a9a504fda3ca1ed70ea86;p=modules%2Fvisu.git Issue 0020570: EDF 1159 VISU: Hide Scalar Bar in contextual menu is inactive --- diff --git a/src/VISUGUI/VisuGUI_Tools.cxx b/src/VISUGUI/VisuGUI_Tools.cxx index 4b5ffa39..828fd36b 100644 --- a/src/VISUGUI/VisuGUI_Tools.cxx +++ b/src/VISUGUI/VisuGUI_Tools.cxx @@ -31,6 +31,7 @@ #include "VisuGUI.h" +#include "VISU_ColoredPrs3dHolder_i.hh" #include "VISU_Gen_i.hh" #include "VISU_Prs3d_i.hh" #include "VISU_Result_i.hh" @@ -1322,7 +1323,7 @@ namespace VISU // ======================================================================================== std::vector GetPrs3dList (const SalomeApp_Module* theModule, const Handle(SALOME_InteractiveObject)& theIO, - bool theGP) + bool theGP) { std::vector aList; if (!theIO.IsNull() && theIO->hasEntry()) { @@ -1335,7 +1336,7 @@ namespace VISU std::vector GetPrs3dList (const SalomeApp_Module* theModule, _PTR(SObject) theObject, - bool theGP) + bool theGP) { std::vector aList; int k = 0; if (!theObject) @@ -1349,9 +1350,9 @@ namespace VISU if (!CORBA::is_nil(aVisuObj)) { VISU::VISUType aType = aVisuObj->GetType(); switch (aType) { - case VISU::TGAUSSPOINTS: - if ( !theGP ) break; - case VISU::TSCALARMAP: + case VISU::TGAUSSPOINTS: + if ( !theGP ) break; + case VISU::TSCALARMAP: case VISU::TISOSURFACES: case VISU::TDEFORMEDSHAPE: case VISU::TCUTPLANES: @@ -1360,9 +1361,9 @@ namespace VISU case VISU::TVECTORS: case VISU::TSTREAMLINES: case VISU::TPLOT3D: - case VISU::TSCALARMAPONDEFORMEDSHAPE: - case VISU::TDEFORMEDSHAPEANDSCALARMAP: - case VISU::TMESH: + case VISU::TSCALARMAPONDEFORMEDSHAPE: + case VISU::TDEFORMEDSHAPEANDSCALARMAP: + case VISU::TMESH: { PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject); if (aServant.in()) { @@ -1393,47 +1394,60 @@ namespace VISU } } break; + case VISU::TCOLOREDPRS3DHOLDER: + { + PortableServer::ServantBase_var aServant = VISU::GetServant(aCORBAObject); + if (aServant.in()) { + VISU::ColoredPrs3dHolder_i* aPrsHolderObject = dynamic_cast(aServant.in()); + if( aPrsHolderObject ) { + VISU::Prs3d_i* aPrsObject = aPrsHolderObject->GetPrs3dDevice(); + aList.resize(k+1); + aList[k] = aPrsObject; + k++; + } + } + } } } } else { VISU::VISUType aType = VISU::Storable::SObject2Type(theObject); switch (aType) { case VISU::TFIELD: { - _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(theObject); - _PTR(SObject) aTimeStamp; - anIter->Next(); // First is reference on support - for (; anIter->More(); anIter->Next()) { - aTimeStamp = anIter->Value(); - if (!aTimeStamp) continue; - std::vector aSubList = GetPrs3dList(theModule, aTimeStamp); - if (!aSubList.empty()) { - int n = aSubList.size(); - aList.resize(k+n); - for (int i = 0; i < n; i++) { - aList[k] = aSubList[i]; - k++; - } - } - } - break; + _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(theObject); + _PTR(SObject) aTimeStamp; + anIter->Next(); // First is reference on support + for (; anIter->More(); anIter->Next()) { + aTimeStamp = anIter->Value(); + if (!aTimeStamp) continue; + std::vector aSubList = GetPrs3dList(theModule, aTimeStamp); + if (!aSubList.empty()) { + int n = aSubList.size(); + aList.resize(k+n); + for (int i = 0; i < n; i++) { + aList[k] = aSubList[i]; + k++; + } + } + } + break; } case VISU::TTIMESTAMP: { - _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(theObject); - _PTR(SObject) aPrs; - for (; anIter->More(); anIter->Next()) { - aPrs = anIter->Value(); - if (!aPrs) continue; - std::vector aSubList = GetPrs3dList(theModule, aPrs); - if (!aSubList.empty()) { - int n = aSubList.size(); - aList.resize(k+n); - for (int i = 0; i < n; i++) { - aList[k] = aSubList[i]; - k++; - } - } - } - break; + _PTR(ChildIterator) anIter = aCStudy->NewChildIterator(theObject); + _PTR(SObject) aPrs; + for (; anIter->More(); anIter->Next()) { + aPrs = anIter->Value(); + if (!aPrs) continue; + std::vector aSubList = GetPrs3dList(theModule, aPrs); + if (!aSubList.empty()) { + int n = aSubList.size(); + aList.resize(k+n); + for (int i = 0; i < n; i++) { + aList[k] = aSubList[i]; + k++; + } + } + } + break; }} } return aList;