Salome HOME
Merge remote-tracking branch 'remotes/origin/master' into CEA_2019
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_HVDirection.cpp
index 2f4ca10a3ccf8564fbb7d05b471fffc3c6559a29..336f298b28b7305853dd04d79779435c143da702 100644 (file)
@@ -39,19 +39,20 @@ SketcherPrs_HVDirection::SketcherPrs_HVDirection(ModelAPI_Feature* theConstraint
 }
 
 bool SketcherPrs_HVDirection::IsReadyToDisplay(ModelAPI_Feature* theConstraint,
-                                               const std::shared_ptr<GeomAPI_Ax3>&/* thePlane*/)
+                                               const std::shared_ptr<GeomAPI_Ax3>& thePlane)
 {
   bool aReadyToDisplay = false;
-  ObjectPtr aObj =
-    SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
-
-  aReadyToDisplay = SketcherPrs_Tools::getShape(aObj).get() != NULL;
+  if (thePlane.get()) {
+    ObjectPtr aObj =
+        SketcherPrs_Tools::getResult(theConstraint, SketchPlugin_Constraint::ENTITY_A());
+    aReadyToDisplay = SketcherPrs_Tools::getShape(aObj).get() != NULL;
+  }
   return aReadyToDisplay;
 }
 
 bool SketcherPrs_HVDirection::updateIfReadyToDisplay(double theStep, bool withColor) const
 {
-  if (!IsReadyToDisplay(myConstraint, myPlane))
+  if (!IsReadyToDisplay(myConstraint, plane()))
     return false;
 
   // Set point of the symbol