ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), ANGLE_ID());
}
-/*static FeaturePtr CreatePoint(FeaturePtr theCircleFeature, SketchPlugin_Sketch* theSketch,
+static FeaturePtr CreatePoint(FeaturePtr theCircleFeature, SketchPlugin_Sketch* theSketch,
GeomPnt2dPtr thePoint)
{
// create point at sewing point of circle
aCoord->setValue(thePoint);
aPointFeature->execute();
return aPointFeature;
-}*/
+}
void SketchPlugin_Circle::execute()
{
aResult->setIsInHistory(false);
setResult(aResult, 1);
- /*if (!reference(ROTATE_REF_ID())->value())
+ if (!reference(ROTATE_REF_ID())->value())
{
+ //this->keepCurrentFeature();
+ //this->restoreCurrentFeature();
aWasBlocked = data()->blockSendAttributeUpdated(true);
auto aCurCircle = this->document()->currentFeature(true);
auto aCrPoint = CreatePoint(aCurCircle, sketch(), std::dynamic_pointer_cast<GeomDataAPI_Point2D>(data()->attribute(ROTATE_ID()))->pnt());
aCrPoint->boolean(AUXILIARY_ID())->setValue(boolean(AUXILIARY_ID())->value());
reference(SketchPlugin_Circle::ROTATE_REF_ID())->setValue(aCrPoint);
data()->blockSendAttributeUpdated(aWasBlocked, false);
- }*/
+ }
}
bool SketchPlugin_Circle::isFixed() {
#include <ModelAPI_Validator.h>
#include <ModelAPI_AttributeString.h>
+#include <iostream>
#include <ModelAPI_Events.h>
#include <SketchPlugin_Point.h>
#include <SketchPlugin_Tools.h>
void SketchPlugin_ConstraintMiddle::initAttributes()
{
- data()->addAttribute(SketchPlugin_ConstraintMiddle::MIDDLE_TYPE(), ModelAPI_AttributeString::typeId());
-
data()->addAttribute(SketchPlugin_Constraint::ENTITY_A(), ModelAPI_AttributeRefAttr::typeId());
data()->addAttribute(SketchPlugin_Constraint::ENTITY_B(), ModelAPI_AttributeRefAttr::typeId());
+ data()->addAttribute(SketchPlugin_ConstraintMiddle::MIDDLE_TYPE(), ModelAPI_AttributeString::typeId());
+ data()->string(SketchPlugin_ConstraintMiddle::MIDDLE_TYPE())->setValue(SketchPlugin_ConstraintMiddle::MIDDLE_TYPE_BY_LINE_AND_POINT());
data()->addAttribute(POINT_REF_ID(), GeomDataAPI_Point2D::typeId());
ModelAPI_Session::get()->validators()->registerNotObligatory(getKind(), POINT_REF_ID());
if (!attribute(ENTITY_B())->isInitialized())
CreatePoint(); // Create new point
+ std::cout << attribute(ENTITY_A())->attributeType() << std::endl;
+ std::cout << refattr(ENTITY_A())->attributeType() << std::endl;
+ std::wcout << refattr(ENTITY_A())->object()->data()->name() << std::endl;
+ std::cout << refattr(ENTITY_A())->attr() << std::endl;
}
}
aCircleFeature->execute();
// Create point
- FeaturePtr aNPoint = CreatePoint(aCircleFeature, myRotPoint);
+ //FeaturePtr aNPoint = CreatePoint(aCircleFeature, myRotPoint);
return aCircleFeature;
}