]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Issue 0020570: EDF 1159 VISU: Hide Scalar Bar in contextual menu is inactive
authorouv <ouv@opencascade.com>
Tue, 3 Nov 2009 13:20:36 +0000 (13:20 +0000)
committerouv <ouv@opencascade.com>
Tue, 3 Nov 2009 13:20:36 +0000 (13:20 +0000)
src/VISUGUI/VisuGUI_Tools.cxx

index 4b5ffa39713562e297cdaaac525668954dc0869f..828fd36bf3c0dc386c58fe628d76f42208f2964a 100644 (file)
@@ -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<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
                                             const Handle(SALOME_InteractiveObject)& theIO,
-                                           bool theGP)
+                                            bool theGP)
   {
     std::vector<VISU::Prs3d_i*> aList;
     if (!theIO.IsNull() && theIO->hasEntry()) {
@@ -1335,7 +1336,7 @@ namespace VISU
 
   std::vector<VISU::Prs3d_i*> GetPrs3dList (const SalomeApp_Module* theModule,
                                             _PTR(SObject) theObject,
-                                           bool theGP)
+                                            bool theGP)
   {
     std::vector<VISU::Prs3d_i*> 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<VISU::ColoredPrs3dHolder_i*>(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<VISU::Prs3d_i*> 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<VISU::Prs3d_i*> 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<VISU::Prs3d_i*> 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<VISU::Prs3d_i*> 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;