]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Compsolid: define to do not visualize compsolid itself, to visualize subobjects only.
authornds <natalia.donis@opencascade.com>
Fri, 31 Jul 2015 12:39:56 +0000 (15:39 +0300)
committernds <natalia.donis@opencascade.com>
Fri, 31 Jul 2015 12:39:56 +0000 (15:39 +0300)
src/FeaturesPlugin/partition_widget.xml
src/XGUI/XGUI_Displayer.cpp

index 33e2c01741f28e4584556654e6976f46b8e56cd0..10671d60dbe54b29bcb0c0814bc511d811fe6b1d 100755 (executable)
@@ -14,7 +14,7 @@
   <multi_selector id="tool_objects" 
     label="Tool object" 
     icon=":icons/cut_tool.png" 
-    tooltip="Select a tool solid"
+    tooltip="Select a tool face or solid"
     type_choice="Faces"
     concealment="true" >
     <validator id="PartSet_DifferentObjects"/>
index b76ded07548661491fc5754202c842f5a0ca74ef..78ecbc64119373a88158b81e7b71bf468969b2de 100644 (file)
@@ -18,6 +18,7 @@
 #include <ModelAPI_Object.h>
 #include <ModelAPI_Tools.h>
 #include <ModelAPI_AttributeIntArray.h>
+#include <ModelAPI_ResultCompSolid.h>
 
 #include <ModuleBase_ResultPrs.h>
 #include <ModuleBase_Tools.h>
@@ -58,6 +59,7 @@ const int MOUSE_SENSITIVITY_IN_PIXEL = 10;  ///< defines the local context mouse
 //#define DEBUG_FEATURE_REDISPLAY
 //#define DEBUG_SELECTION_FILTERS
 
+//#define DEBUG_COMPOSILID_DISPLAY
 // Workaround for bug #25637
 void displayedObjects(const Handle(AIS_InteractiveContext)& theAIS, AIS_ListOfInteractive& theList)
 {
@@ -109,7 +111,20 @@ bool XGUI_Displayer::isVisible(ObjectPtr theObject) const
 void XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer)
 {
   if (isVisible(theObject)) {
-    redisplay(theObject, theUpdateViewer);
+#ifdef DEBUG_COMPOSILID_DISPLAY
+    ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(theObject);
+    if (aCompsolidResult.get()) {
+      for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) {
+        ResultPtr aSubResult = aCompsolidResult->subResult(i);
+        if (aSubResult.get())
+          redisplay(aSubResult, false);
+      }
+      if (theUpdateViewer)
+        updateViewer();
+    }
+    else
+#endif
+      redisplay(theObject, theUpdateViewer);
   } else {
     AISObjectPtr anAIS;
 
@@ -120,6 +135,19 @@ void XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer)
     } else {
       ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
       if (aResult.get() != NULL) {
+#ifdef DEBUG_COMPOSILID_DISPLAY
+        ResultCompSolidPtr aCompsolidResult = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(theObject);
+        if (aCompsolidResult.get()) {
+          for(int i = 0; i < aCompsolidResult->numberOfSubs(); i++) {
+            ResultPtr aSubResult = aCompsolidResult->subResult(i);
+            if (aSubResult.get())
+              display(aSubResult, false);
+          }
+          if (theUpdateViewer)
+            updateViewer();
+        }
+        else {
+#endif
         std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aResult);
         if (aShapePtr.get() != NULL) {
           anAIS = AISObjectPtr(new GeomAPI_AISObject());
@@ -127,6 +155,9 @@ void XGUI_Displayer::display(ObjectPtr theObject, bool theUpdateViewer)
           //anAIS->createShape(aShapePtr);
           isShading = true;
         }
+#ifdef DEBUG_COMPOSILID_DISPLAY
+        } // close else
+#endif
       }
     }
     if (anAIS)