Salome HOME
Delete key regression corrections: in previous implementation sketch entities did...
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Plugin.cpp
index 8e96b123e356550a033210d3a1d7d7c1bcb655e1..06a3d570257e14ff0a9163602e8e8331d2219db5 100644 (file)
@@ -68,6 +68,10 @@ SketchPlugin_Plugin::SketchPlugin_Plugin()
                               new SketchPlugin_CoincidenceAttrValidator);
   aFactory->registerValidator("SketchPlugin_CopyValidator",
                               new SketchPlugin_CopyValidator);
+  aFactory->registerValidator("SketchPlugin_SolverErrorValidator",
+                              new SketchPlugin_SolverErrorValidator);
+  aFactory->registerValidator("SketchPlugin_FilletVertexValidator",
+                              new SketchPlugin_FilletVertexValidator);
 
   // register this plugin
   ModelAPI_Session::get()->registerPlugin(this);
@@ -170,7 +174,10 @@ std::shared_ptr<ModelAPI_FeatureStateMessage> SketchPlugin_Plugin
     if (aData) {
       std::shared_ptr<GeomDataAPI_Dir> aNormal =
         std::dynamic_pointer_cast<GeomDataAPI_Dir>(aData->attribute(SketchPlugin_Sketch::NORM_ID()));
-      aHasSketchPlane = aNormal && !(aNormal->x() == 0 && aNormal->y() == 0 && aNormal->z() == 0);
+      // it is important to check whether the normal attribute is initialized
+      // because it is possible that normal values are filled when the plane is checked on validity
+      aHasSketchPlane = aNormal && aNormal->isInitialized() &&
+                        !(aNormal->x() == 0 && aNormal->y() == 0 && aNormal->z() == 0);
 
       aMsg->setState(SketchPlugin_Point::ID(), aHasSketchPlane);
       aMsg->setState(SketchPlugin_Line::ID(), aHasSketchPlane);