]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To improve popup management for changing resolution of partitions
authorapo <apo@opencascade.com>
Wed, 18 Jul 2007 09:43:46 +0000 (09:43 +0000)
committerapo <apo@opencascade.com>
Wed, 18 Jul 2007 09:43:46 +0000 (09:43 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISU_I/VISU_MultiResult_i.cc

index aa9c23eb19945100f70c4e570d135e04a89a1ada..dbe76f4e384b3ab111628481709b1009bde2b951 100644 (file)
@@ -2655,21 +2655,21 @@ VisuGUI
   //aRule = "client='ObjectBrowser' and type='MEDFIELD'";
   //mgr->setRule( action( VISU_IMPORT_MED ), aRule, true );
   
-  aRule = "client='ObjectBrowser' and $type in {'VISU::TPART'} and ";
+  aRule = "client='ObjectBrowser' and selcount>=1 and $type in {'VISU::TPART'} and ";
   {
-    QString aCustomRule = aRule + "fullResolution=1 and (selcount>1 or (selcount=1 and resolutionState!='F'))";
+    QString aCustomRule = aRule + "fullResolution=1 and resolutionState!='F'";
     mgr->setRule( action( VISU_MULTIPR_FULL_RES ), aCustomRule, true );
   }
   {
-    QString aCustomRule = aRule + "mediumResolution=1 and (selcount>1 or (selcount=1 and resolutionState!='M'))";
+    QString aCustomRule = aRule + "mediumResolution=1 and resolutionState!='M'";
     mgr->setRule( action( VISU_MULTIPR_MED_RES ), aCustomRule, true );
   }
   {
-    QString aCustomRule = aRule + "lowResolution=1 and (selcount>1 or (selcount=1  and resolutionState!='L'))";
+    QString aCustomRule = aRule + "lowResolution=1 and resolutionState!='L'";
     mgr->setRule( action( VISU_MULTIPR_LOW_RES ), aCustomRule, true );
   }
   {
-    QString aCustomRule = aRule + "(selcount>1 or (selcount=1  and resolutionState!='H'))";
+    QString aCustomRule = aRule + "resolutionState!='H'";
     mgr->setRule( action( VISU_MULTIPR_HIDE), aCustomRule, true );
   }
 }
index 3aed7f857119394210e6750a564c6ed7ca8997c3..3a2ee40550777291bd77a98620f94a0dfa57de14 100644 (file)
@@ -322,7 +322,6 @@ namespace VISU
        aMainPart2SubPartNames[aMainPart].insert(aPartName);
       }
       
-      std::string aLastEntry;
       for (size_t aPartID = 0 ; aPartID < aPartNames.size() ; aPartID++) {
        const MultiResult_i::TPartName& aPartName = aPartNames[aPartID];
        MultiResult_i::TPartInfo aPartInfo = GetPartInfo(aMultiprObj, aPartName);
@@ -343,26 +342,15 @@ namespace VISU
          VISU::Result::Resolution aResolution = GetResolution(aMainPart2SubPartNames, aPartInfo.myName);
          aComment.sprintf("myComment=PART;myMeshName=%s;myName=%s;myResolutions=%s;myState=%d", 
                           aPartInfo.myMeshName.c_str(), aPartInfo.myName.c_str(), aResoltutionsString.c_str(), aResolution); 
-         aLastEntry = CreateAttributes(theStudy,
-                                       aMesh->myPartsEntry,
-                                       anIconName,
-                                       NO_IOR,
-                                       aPartInfo.myName,
-                                       NO_PERFSITENT_REF,
-                                       aComment.latin1(),
-                                       true);
-         aPartName2Resolution[aPartInfo.myName] = aResolution;
-       } else {
-         aComment.sprintf("myComment=PART;myMeshName=%s;myName=%s;myResolutions=%s", 
-                          aPartInfo.myMeshName.c_str(), aPartInfo.myName.c_str(), aResoltutionsString.c_str()); 
          CreateAttributes(theStudy,
-                          aLastEntry,
-                          NO_ICON,
+                          aMesh->myPartsEntry,
+                          anIconName,
                           NO_IOR,
                           aPartInfo.myName,
                           NO_PERFSITENT_REF,
                           aComment.latin1(),
                           true);
+         aPartName2Resolution[aPartInfo.myName] = aResolution;
        }
       }