Salome HOME
#878 Segmentation fault when setting distance on the two same points
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_ConstraintCoincidence.cpp
index 02cf66ca06415735860e72076d76f67c2a3f8f03..85a255bfb8fa924fa459ec9bbb82439fb9e35009 100644 (file)
@@ -6,9 +6,13 @@
 
 #include "SketchPlugin_ConstraintCoincidence.h"
 
+#include <SketcherPrs_Factory.h>
+
 #include <ModelAPI_AttributeDouble.h>
 #include <ModelAPI_Data.h>
 #include <SketchPlugin_Point.h>
+#include <GeomDataAPI_Dir.h>
+#include <GeomDataAPI_Point.h>
 
 SketchPlugin_ConstraintCoincidence::SketchPlugin_ConstraintCoincidence()
 {
@@ -24,3 +28,14 @@ void SketchPlugin_ConstraintCoincidence::execute()
 {
 }
 
+AISObjectPtr SketchPlugin_ConstraintCoincidence::getAISObject(AISObjectPtr thePrevious)
+{
+  if (!sketch())
+    return thePrevious;
+
+  AISObjectPtr anAIS = thePrevious;
+  if (!anAIS) {
+    anAIS = SketcherPrs_Factory::coincidentConstraint(this, sketch()->coordinatePlane());
+  }
+  return anAIS;
+}