#include <ModelAPI_Data.h>
#include <ModelAPI_ResultConstruction.h>
+#include <ModelAPI_AttributeSelection.h>
+#include <ModelAPI_Validator.h>
+#include <ModelAPI_Session.h>
#include <GeomAPI_Pnt2d.h>
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()
boost::shared_ptr<GeomDataAPI_Point2D> aPoint1 = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(
aData->attribute(SketchPlugin_Point::COORD_ID()));
- aPoint1->setValue(aPoint1->x() + theDeltaX, aPoint1->y() + theDeltaY);
+ aPoint1->move(theDeltaX, theDeltaY);
}
double SketchPlugin_Point::distanceToPoint(const boost::shared_ptr<GeomAPI_Pnt2d>& thePoint)
return aPoint->pnt()->distance(thePoint);
}
+
+bool SketchPlugin_Point::isFixed() {
+ return data()->selection(EXTERNAL_ID())->context();
+}