From: nds Date: Tue, 9 Feb 2016 10:09:55 +0000 (+0300) Subject: Custom Presentation debug: 1. deselect compsolid in boolean, argument frame is visual... X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=4105b23bedf2387e0b8b2b95c10618bb9820fc2f;p=modules%2Fshaper.git Custom Presentation debug: 1. deselect compsolid in boolean, argument frame is visualized; select compsolid item in multi-selector, highlight in the viewer is absent for it. --- diff --git a/src/PartSet/PartSet_OperationPrs.cpp b/src/PartSet/PartSet_OperationPrs.cpp index 22b5ec243..aa12287af 100755 --- a/src/PartSet/PartSet_OperationPrs.cpp +++ b/src/PartSet/PartSet_OperationPrs.cpp @@ -117,8 +117,21 @@ bool PartSet_OperationPrs::isVisible(XGUI_Displayer* theDisplayer, const ObjectP bool aVisible = false; GeomPresentablePtr aPrs = std::dynamic_pointer_cast(theObject); ResultPtr aResult = std::dynamic_pointer_cast(theObject); - if (aPrs.get() || aResult.get()) + if (aPrs.get() || aResult.get()) { aVisible = theDisplayer->isVisible(theObject); + // compsolid is not visualized in the viewer, but should have presentation when all sub solids are + // visible. It is useful for highlight presentation where compsolid shape is selectable + if (!aVisible && aResult->groupName() == ModelAPI_ResultCompSolid::group()) { + ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast(aResult); + if (aCompsolidResult.get() != NULL) { // change colors for all sub-solids + bool anAllSubsVisible = aCompsolidResult->numberOfSubs() > 0; + for(int i = 0; i < aCompsolidResult->numberOfSubs() && anAllSubsVisible; i++) { + anAllSubsVisible = theDisplayer->isVisible(aCompsolidResult->subResult(i)); + } + aVisible = anAllSubsVisible; + } + } + } else { // check if all results of the feature are visible FeaturePtr aFeature = ModelAPI_Feature::feature(theObject); diff --git a/src/XGUI/XGUI_Displayer.cpp b/src/XGUI/XGUI_Displayer.cpp index 96f63fe2b..3899d5e37 100644 --- a/src/XGUI/XGUI_Displayer.cpp +++ b/src/XGUI/XGUI_Displayer.cpp @@ -857,6 +857,8 @@ bool XGUI_Displayer::eraseAIS(AISObjectPtr theAIS, const bool theUpdateViewer) aErased = true; } } + if (aErased && theUpdateViewer) + updateViewer(); return aErased; }