]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
#1466 sketch plane when vertex or edge is shown
authornds <nds@opencascade.com>
Wed, 4 May 2016 07:50:50 +0000 (10:50 +0300)
committernds <nds@opencascade.com>
Wed, 4 May 2016 07:51:17 +0000 (10:51 +0300)
src/PartSet/PartSet_PreviewPlanes.cpp

index 424deec9d0356aeeed7f034cc0d266b4f86ae6cf..7bf7e696327e9eace457a3cc4f1cecb8719c8386 100755 (executable)
@@ -33,10 +33,15 @@ bool PartSet_PreviewPlanes::hasVisualizedBodies(ModuleBase_IWorkshop* theWorksho
   QObjectPtrList aDisplayed = aDisp->displayedObjects();
   foreach (ObjectPtr anObj, aDisplayed) {
     ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObj);
-    if (aResult.get() != NULL) {
-      aBodyIsVisualized = aResult->groupName() == ModelAPI_ResultBody::group();
-      if (aBodyIsVisualized)
-        break;
+    // result constructions should not be taken as a body
+    if (aResult.get() != NULL && aResult->groupName() == ModelAPI_ResultBody::group()) {
+      GeomShapePtr aShape = aResult->shape();
+      if (aShape.get()) {
+        // vertices, edges should not be taken as a body
+        aBodyIsVisualized = aShape->shapeType() <= GeomAPI_Shape::FACE;
+        if (aBodyIsVisualized)
+          break;
+      }
     }
   }
   return aBodyIsVisualized;