]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
To introduce usgae of SetResolution method of VISU::Result IDL interface to support...
authorapo <apo@opencascade.com>
Wed, 4 Jul 2007 07:58:57 +0000 (07:58 +0000)
committerapo <apo@opencascade.com>
Wed, 4 Jul 2007 07:58:57 +0000 (07:58 +0000)
src/VISUGUI/VisuGUI.cxx
src/VISUGUI/VisuGUI.h

index 311657fe2ed3c127daa5f09b3cd12d9ab040577f..9e75a7f62df90bc0859c9694fa8a9af24fa74980 100644 (file)
@@ -3451,33 +3451,33 @@ void VisuGUI::OnCacheProperties()
 //---------------------------------------------------------------
 void VisuGUI::OnMultiprViewFullRes()
 {
-  OnMultiprChangeRes('F');
+  OnMultiprChangeRes(VISU::Result::FULL);
 }
 
 
 //---------------------------------------------------------------
 void VisuGUI::OnMultiprViewMediumRes()
 {
-  OnMultiprChangeRes('M');
+  OnMultiprChangeRes(VISU::Result::MEDIUM);
 }
 
 
 //---------------------------------------------------------------
 void VisuGUI::OnMultiprViewLowRes()
 {
-  OnMultiprChangeRes('L');
+  OnMultiprChangeRes(VISU::Result::LOW);
 }
 
 
 //---------------------------------------------------------------
 void VisuGUI::OnMultiprViewHide()
 {
-  OnMultiprChangeRes('H');
+  OnMultiprChangeRes(VISU::Result::HIDDEN);
 }
 
 
 //---------------------------------------------------------------
-void VisuGUI::OnMultiprChangeRes(char theResolution)
+void VisuGUI::OnMultiprChangeRes(VISU::Result::Resolution theResolution)
 {
   _PTR(Study) aCStudy = GetCStudy(GetAppStudy(this));
   if (CheckLock(aCStudy,GetDesktop(this)))
@@ -3487,9 +3487,11 @@ void VisuGUI::OnMultiprChangeRes(char theResolution)
   if(aSelectionInfo.empty())
     return;
 
+  QApplication::setOverrideCursor(Qt::waitCursor);
+
   typedef SALOME::GenericObjPtr<VISU::Result_i> TResultPtr;
-  typedef std::set<TResultPtr> TResultSet;
-  TResultSet aResultSet;
+  typedef std::map<TResultPtr, _PTR(SObject)> TResult2SObject;
+  TResult2SObject aResult2SObject;
 
   for (int i=0; i < aSelectionInfo.size(); i++) {
     VISU::TSelectionItem aSelectionItem = aSelectionInfo[i];
@@ -3506,17 +3508,28 @@ void VisuGUI::OnMultiprChangeRes(char theResolution)
     if(!aCResult)
       continue;
 
-    aResultSet.insert(TResultPtr(aCResult));
-    aCResult->SetResolution(aSObject->GetName().c_str(), theResolution);
+    Storable::TRestoringMap aRestoringMap = Storable::GetStorableMap(aSObject);
+    bool anIsFound = false;
+    QString aMeshName = Storable::FindValue(aRestoringMap, "myMeshName", &anIsFound);
+    if(!anIsFound)
+      continue;
+      
+    std::string aPartName = aSObject->GetName();
+
+    aCResult->SetResolution(aMeshName.latin1(), aPartName.c_str(), theResolution);
+
+    aResult2SObject[TResultPtr(aCResult)] = aSObject;
   }
 
   // To update all result observers
-  TResultSet::const_iterator anIter = aResultSet.begin();
-  for(; anIter != aResultSet.end(); anIter++){
-    const TResultPtr& aResultPtr = *anIter;
+  TResult2SObject::const_iterator anIter = aResult2SObject.begin();
+  for(; anIter != aResult2SObject.end(); anIter++){
+    const TResultPtr& aResultPtr = anIter->first;
+    const _PTR(SObject)& aSObject = anIter->second;
     aResultPtr->UpdateObservers();
+    VISU::UpdateObjBrowser(this, false, aSObject);
   }
 
-  UpdateObjBrowser(this, false);
+  QApplication::restoreOverrideCursor();
 }
 
index 50be5f8d351c4ef9ce00637ceb9bcc4b1071b4c7..f44d67f6704e584db8195c47f8bb3c4e8003f849 100644 (file)
@@ -170,7 +170,7 @@ protected slots:
   void OnMultiprViewMediumRes();
   void OnMultiprViewLowRes();
   void OnMultiprViewHide();
-  void OnMultiprChangeRes(char resolution);
+  void OnMultiprChangeRes(VISU::Result::Resolution theResolution);
 
 protected:
   virtual LightApp_Selection* createSelection() const;