From: apo Date: Wed, 4 Jul 2007 07:58:57 +0000 (+0000) Subject: To introduce usgae of SetResolution method of VISU::Result IDL interface to support... X-Git-Tag: T_MULTIPR_INDUS_Dump_python~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ec799fb82514eb46bd106d1e1fb4059cb846ee94;p=modules%2Fvisu.git To introduce usgae of SetResolution method of VISU::Result IDL interface to support VISU MULTIPR extension --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 311657fe..9e75a7f6 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -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 TResultPtr; - typedef std::set TResultSet; - TResultSet aResultSet; + typedef std::map 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(); } diff --git a/src/VISUGUI/VisuGUI.h b/src/VISUGUI/VisuGUI.h index 50be5f8d..f44d67f6 100644 --- a/src/VISUGUI/VisuGUI.h +++ b/src/VISUGUI/VisuGUI.h @@ -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;