Salome HOME
Construction elements are auxiliary entities:
[modules/shaper.git] / src / SketchPlugin / SketchPlugin_Line.cpp
index 50d8f438f5072358de6535d2d05472f8f110e230..ee7193e72b5d7b24ecda26152b6fe58134500c4f 100644 (file)
@@ -9,6 +9,7 @@
 #include <ModelAPI_Data.h>
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_AttributeSelection.h>
+#include <ModelAPI_AttributeBoolean.h>
 #include <ModelAPI_Validator.h>
 #include <ModelAPI_Session.h>
 
@@ -29,6 +30,7 @@ void SketchPlugin_Line::initAttributes()
 {
   data()->addAttribute(START_ID(), GeomDataAPI_Point2D::type());
   data()->addAttribute(END_ID(), GeomDataAPI_Point2D::type());
+  data()->addAttribute(CONSTRUCTION_ID(), ModelAPI_AttributeBoolean::type());
   data()->addAttribute(EXTERNAL_ID(), ModelAPI_AttributeSelection::type());
   ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), EXTERNAL_ID());
 }
@@ -98,7 +100,7 @@ double SketchPlugin_Line::distanceToPoint(const std::shared_ptr<GeomAPI_Pnt2d>&
 }
 
 bool SketchPlugin_Line::isFixed() {
-  return data()->selection(EXTERNAL_ID())->context();
+  return data()->selection(EXTERNAL_ID())->context().get();
 }
 
 void SketchPlugin_Line::attributeChanged(const std::string& theID) {