From 359debc767145dc7a628ee9c27c9dd09c6a5f2cd Mon Sep 17 00:00:00 2001 From: apo Date: Wed, 18 Jul 2007 09:43:46 +0000 Subject: [PATCH] To improve popup management for changing resolution of partitions --- src/VISUGUI/VisuGUI.cxx | 10 +++++----- src/VISU_I/VISU_MultiResult_i.cc | 18 +++--------------- 2 files changed, 8 insertions(+), 20 deletions(-) diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index aa9c23eb..dbe76f4e 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -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 ); } } diff --git a/src/VISU_I/VISU_MultiResult_i.cc b/src/VISU_I/VISU_MultiResult_i.cc index 3aed7f85..3a2ee405 100644 --- a/src/VISU_I/VISU_MultiResult_i.cc +++ b/src/VISU_I/VISU_MultiResult_i.cc @@ -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; } } -- 2.39.2