Salome HOME
Fix for the issue #1605 : optimization of undo/redo and abort processing
[modules/shaper.git] / src / SketcherPrs / SketcherPrs_Collinear.cpp
index 57cf26413fa92fd17caaa4c311e69c13c4bf4138..8b069825aca96ad221829f83d15276b23a7c5ffb 100755 (executable)
@@ -10,8 +10,6 @@
 
 #include <SketchPlugin_Constraint.h>
 
-#include "Events_Error.h"
-
 #include <Graphic3d_AspectLine3d.hxx>
 #include <Prs3d_Root.hxx>
 
@@ -44,7 +42,7 @@ bool SketcherPrs_Collinear::IsReadyToDisplay(ModelAPI_Feature* theConstraint,
   return aReadyToDisplay;
 }
 
-bool SketcherPrs_Collinear::updatePoints(double theStep) const
+bool SketcherPrs_Collinear::updateIfReadyToDisplay(double theStep) const
 {
   if (!IsReadyToDisplay(myConstraint, myPlane))
     return false;
@@ -68,18 +66,8 @@ void SketcherPrs_Collinear::drawLines(const Handle(Prs3d_Presentation)& thePrs,
   Handle(Graphic3d_AspectLine3d) aLineAspect = new Graphic3d_AspectLine3d(theColor, Aspect_TOL_SOLID, 2);
   aGroup->SetPrimitivesAspect(aLineAspect);
 
-  // Draw first line
-  ObjectPtr aObj = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_A());
-  std::shared_ptr<GeomAPI_Shape> aLine = SketcherPrs_Tools::getShape(aObj);
-  if (aLine.get() == NULL)
-    return;
-  drawShape(aLine, thePrs);
-
-  // Draw second line
-  aObj = SketcherPrs_Tools::getResult(myConstraint, SketchPlugin_Constraint::ENTITY_B());
-  aLine = SketcherPrs_Tools::getShape(aObj);
-  if (aLine.get() == NULL)
-    return;
-  drawShape(aLine, thePrs);
+  // Draw constrained lines
+  addLine(aGroup, SketchPlugin_Constraint::ENTITY_A());
+  addLine(aGroup, SketchPlugin_Constraint::ENTITY_B());
 }