Salome HOME
Merge branch 'master' of https://codev-tuleap.cea.fr/plugins/git/salome/shaper
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Sketch.cpp
index 32e0ec7a1ffcdf67632807ea5cd1e63827bc5d2c..839d3d96193df5376033321f5c030850cac60442 100644 (file)
@@ -326,8 +326,7 @@ void SketchPlugin_Sketch::attributeChanged(const std::string& theID) {
           std::shared_ptr<GeomDataAPI_Dir> aDirX = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
             data()->attribute(SketchPlugin_Sketch::DIRX_ID()));
           aDirX->setValue(aXDir);
-          std::shared_ptr<GeomAPI_Dir> aDir = aPlane->direction();
-          data()->blockSendAttributeUpdated(aWasBlocked, false);
+          data()->blockSendAttributeUpdated(aWasBlocked, true);
         }
       }
     }
@@ -444,7 +443,11 @@ std::shared_ptr<GeomAPI_Ax3> SketchPlugin_Sketch::plane(SketchPlugin_Sketch* the
   std::shared_ptr<GeomDataAPI_Dir> aNorm = std::dynamic_pointer_cast<GeomDataAPI_Dir>(
       aData->attribute(SketchPlugin_Sketch::NORM_ID()));
 
-  return std::shared_ptr<GeomAPI_Ax3>(new GeomAPI_Ax3(anOrigin->pnt(), aDirX->dir(), aNorm->dir()));
+  if (aNorm.get() && aNorm->isInitialized() && anOrigin.get() && anOrigin->isInitialized())
+    return std::shared_ptr<GeomAPI_Ax3>(
+      new GeomAPI_Ax3(anOrigin->pnt(), aDirX->dir(), aNorm->dir()));
+
+  return std::shared_ptr<GeomAPI_Ax3>();
 }
 
 bool SketchPlugin_Sketch::customAction(const std::string& theActionId)