#include "SketchPlugin_ConstraintAngle.h"
#include <SketchPlugin_Line.h>
+#include <SketcherPrs_Tools.h>
#include <ModelAPI_AttributeDouble.h>
#include <ModelAPI_AttributeInteger.h>
+#include <ModelAPI_Session.h>
+#include <ModelAPI_Validator.h>
#include <GeomDataAPI_Point2D.h>
ModelAPI_AttributeBoolean::typeId());
data()->addAttribute(SketchPlugin_ConstraintAngle::ANGLE_REVERSED_SECOND_LINE_ID(),
ModelAPI_AttributeBoolean::typeId());
+
+ data()->addAttribute(SketchPlugin_ConstraintAngle::LOCATION_TYPE_ID(),
+ ModelAPI_AttributeInteger::typeId());
+ ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), LOCATION_TYPE_ID());
}
void SketchPlugin_ConstraintAngle::colorConfigInfo(std::string& theSection, std::string& theName,
aValueAttr->setValue(anAngle);
}
-void SketchPlugin_ConstraintAngle::move(double theDeltaX, double theDeltaY)
-{
- std::shared_ptr<ModelAPI_Data> aData = data();
- if (!aData->isValid())
- return;
-
- myFlyoutUpdate = true;
- std::shared_ptr<GeomDataAPI_Point2D> aFlyoutAttr = std::dynamic_pointer_cast<
- GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Constraint::FLYOUT_VALUE_PNT()));
- aFlyoutAttr->setValue(aFlyoutAttr->x() + theDeltaX, aFlyoutAttr->y() + theDeltaY);
- myFlyoutUpdate = false;
-}
-
-
bool SketchPlugin_ConstraintAngle::compute(const std::string& theAttributeId)
{
if (theAttributeId != SketchPlugin_Constraint::FLYOUT_VALUE_PNT())