Salome HOME
The references to the external edge attribute is added
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Point.cpp
index 5e8f2a65ebd45761393ef070c5b0e8d4ef9c9410..c198e9b90fd22c44e7c066ea30ee88a022aa2df1 100644 (file)
@@ -7,6 +7,8 @@
 
 #include <ModelAPI_Data.h>
 #include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_AttributeSelection.h>
+#include <ModelAPI_Validator.h>
 
 #include <GeomAPI_Pnt2d.h>
 
@@ -22,6 +24,8 @@ SketchPlugin_Point::SketchPlugin_Point()
 void SketchPlugin_Point::initAttributes()
 {
   data()->addAttribute(SketchPlugin_Point::COORD_ID(), GeomDataAPI_Point2D::type());
+  data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::type());
+  ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID());
 }
 
 void SketchPlugin_Point::execute()
@@ -61,3 +65,7 @@ double SketchPlugin_Point::distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d
 
   return aPoint->pnt()->distance(thePoint);
 }
+
+bool SketchPlugin_Point::isFixed() {
+  return data()->selection(EXTERNAL_ID())->context();
+}