]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Custom Presentation debug: 1. deselect compsolid in boolean, argument frame is visual...
authornds <nds@opencascade.com>
Tue, 9 Feb 2016 10:09:55 +0000 (13:09 +0300)
committerdbv <dbv@opencascade.com>
Tue, 16 Feb 2016 14:04:40 +0000 (17:04 +0300)
src/PartSet/PartSet_OperationPrs.cpp
src/XGUI/XGUI_Displayer.cpp

index 22b5ec243ad9388d96c7d3ef1897919a4a6550a9..aa12287afaf7254f7245484fcbf1940967297287 100755 (executable)
@@ -117,8 +117,21 @@ bool PartSet_OperationPrs::isVisible(XGUI_Displayer* theDisplayer, const ObjectP
   bool aVisible = false;
   GeomPresentablePtr aPrs = std::dynamic_pointer_cast<GeomAPI_IPresentable>(theObject);
   ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(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<ModelAPI_ResultCompSolid>(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);
index 96f63fe2b362a2e2d279404414d9006defe178c5..3899d5e37fdffb31f1939b95d75823f0e043d6a6 100644 (file)
@@ -857,6 +857,8 @@ bool XGUI_Displayer::eraseAIS(AISObjectPtr theAIS, const bool theUpdateViewer)
       aErased = true;
     }
   }
+  if (aErased && theUpdateViewer)
+    updateViewer();
   return aErased;
 }