Salome HOME
Issue #2109 trim - wrong result due to constarints
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintPerpendicular.cpp
index 152fabe222534208c3096a2a9e6db326f05468cb..c03277b093b951420d25da99fa6ebc759428f2d5 100644 (file)
@@ -28,8 +28,8 @@ SketchPlugin_ConstraintPerpendicular::SketchPlugin_ConstraintPerpendicular()
 
 void SketchPlugin_ConstraintPerpendicular::initAttributes()
 {
-  data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::type());
-  data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::type());
+  data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
+  data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
 }
 
 void SketchPlugin_ConstraintPerpendicular::execute()
@@ -41,10 +41,8 @@ AISObjectPtr SketchPlugin_ConstraintPerpendicular::getAISObject(AISObjectPtr the
   if (!sketch())
     return thePrevious;
 
-  AISObjectPtr anAIS = thePrevious;
-  if (!anAIS) {
-    anAIS = SketcherPrs_Factory::perpendicularConstraint(this, sketch()->coordinatePlane());
-  }
+  AISObjectPtr anAIS = SketcherPrs_Factory::perpendicularConstraint(this,
+    sketch()->coordinatePlane(), thePrevious);
   return anAIS;
 }