]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Correction to do not show DOF message until plane of the sketch is not selected.
authornds <nds@opencascade.com>
Fri, 3 Jun 2016 06:53:54 +0000 (09:53 +0300)
committernds <nds@opencascade.com>
Fri, 3 Jun 2016 06:53:54 +0000 (09:53 +0300)
src/SketchSolver/SketchSolver_Manager.cpp

index 7f4c1e5761e35a8ee59f7997d1430ac8fe25dbb0..350ef59abd044764b7c81e6d2c571f9b3e9cc366 100644 (file)
@@ -491,7 +491,15 @@ void SketchSolver_Manager::degreesOfFreedom()
   std::list<SketchSolver_Group*>::const_iterator aGroupIt = myGroups.begin();
   for (; aGroupIt != myGroups.end(); ++aGroupIt) {
     CompositeFeaturePtr aSketch = (*aGroupIt)->getWorkplane();
-    if (!aSketch->data()->isValid()) {
+    bool isSketchValid = aSketch->data() && aSketch->data()->isValid();
+
+    if (isSketchValid) {
+      std::shared_ptr<GeomDataAPI_Dir> aNormal =
+          std::dynamic_pointer_cast<GeomDataAPI_Dir>(aSketch->data()->attribute(SketchPlugin_Sketch::NORM_ID()));
+      isSketchValid = aNormal && aNormal->isInitialized();
+    }
+
+    if (!isSketchValid) {
       myDoF.erase(aSketch);
       continue;
     }