Salome HOME
#878 Segmentation fault when setting distance on the two same points
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintTangent.cpp
index f2cf4a30717bd55cb221c21ff3e52791d31913b8..9d7256c18aef20b54139ab02501caa55b4159c6e 100644 (file)
@@ -23,8 +23,8 @@ SketchPlugin_ConstraintTangent::SketchPlugin_ConstraintTangent()
 
 void SketchPlugin_ConstraintTangent::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_ConstraintTangent::execute()
@@ -37,7 +37,9 @@ AISObjectPtr SketchPlugin_ConstraintTangent::getAISObject(AISObjectPtr thePrevio
     return thePrevious;
 
   AISObjectPtr anAIS = thePrevious;
-  /// TODO: Tangency constraint presentation should be put here
+  if (!anAIS) {
+    anAIS = SketcherPrs_Factory::tangentConstraint(this, sketch()->coordinatePlane());
+  }
   return anAIS;
 }