]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Visualize default sketcher planes if a shown sketch does not contain faces.
authornds <nds@opencascade.com>
Wed, 22 Jun 2016 04:26:53 +0000 (07:26 +0300)
committernds <nds@opencascade.com>
Wed, 22 Jun 2016 04:27:21 +0000 (07:27 +0300)
src/PartSet/PartSet_PreviewPlanes.cpp

index 7bf7e696327e9eace457a3cc4f1cecb8719c8386..e7210b0ce4cd4ea70de9e93cc64c43c9762a4c24 100755 (executable)
@@ -9,6 +9,7 @@
 #include <ModuleBase_IWorkshop.h>
 
 #include <ModelAPI_ResultBody.h>
+#include <ModelAPI_ResultConstruction.h>
 
 #include <XGUI_Tools.h>
 #include <XGUI_Displayer.h>
@@ -58,9 +59,15 @@ bool PartSet_PreviewPlanes::hasVisualizedSketch(ModuleBase_IWorkshop* theWorksho
     ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(anObj);
     if (aResult.get() != NULL) {
       FeaturePtr aFeature = ModelAPI_Feature::feature(aResult);
-      aSketchIsVisualized = aFeature.get() && aFeature->getKind() == SketchPlugin_Sketch::ID();
-      if (aSketchIsVisualized)
-        break;
+      if (aFeature.get() && aFeature->getKind() == SketchPlugin_Sketch::ID()) {
+        ResultConstructionPtr aCResult =  std::dynamic_pointer_cast<ModelAPI_ResultConstruction>
+                                                                                      (aResult);
+        if (aCResult.get() && aCResult->facesNum() > 0) {
+          aSketchIsVisualized = true;
+          break;
+        }
+      }
+      break;
     }
   }
   return aSketchIsVisualized;