//---------------------------------------------------------------
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)))
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];
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();
}