]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Visualize CompSolid sub-shapes when compsolid shape(e.g. through Object Browser)...
authornds <nds@opencascade.com>
Wed, 16 Sep 2015 16:11:45 +0000 (19:11 +0300)
committernds <nds@opencascade.com>
Wed, 16 Sep 2015 16:11:45 +0000 (19:11 +0300)
Extrusion(CompSolid), Boolean, Select extrusion.

src/PartSet/PartSet_OperationPrs.cpp

index 66e146f96210959647f26a920067448f0b35c093..1466994594869ee530523855c2cb73c5ebb9dbd7 100755 (executable)
@@ -23,6 +23,7 @@
 #include <ModelAPI_AttributeRefList.h>
 #include <ModelAPI_Validator.h>
 #include <ModelAPI_Session.h>
+#include <ModelAPI_ResultCompSolid.h>
 
 #include <GeomValidators_Tools.h>
 
@@ -171,6 +172,22 @@ void addValue(const ObjectPtr& theObject, const GeomShapePtr& theShape,
               QMap<ObjectPtr, QList<GeomShapePtr> >& theObjectShapes)
 {
   if (theObject.get()) {
+    ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
+    if (aResult.get()) {
+      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()) {
+            GeomShapePtr aShape;
+            addValue(aSubResult, aShape, theFeature, theObjectShapes);
+          }
+        }
+        return;
+      }
+    }
+
+
     GeomShapePtr aShape = theShape;
     if (!aShape.get()) {
       ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);