- ObjectPtr(), false);
- SketchPlugin_Tools::createConstraint(
- this, MAJOR_AXIS_POINT_REF_ID(), AttributePtr(),
- theEllipseFeature->lastResult(), true);
- SketchPlugin_Tools::createConstraint(
- this, PASSED_POINT_REF_ID(), AttributePtr(),
- theEllipseFeature->lastResult(), true);
+ ObjectPtr(), isTangencyApplicable);
+ SketchPlugin_Tools::createCoincidenceOrTangency(
+ this, MAJOR_AXIS_POINT_REF_ID(),
+ theEllipseFeature->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_END_ID()),
+ ObjectPtr(), isTangencyApplicable);
+ // make coincidence only if PASSED_POINT_REF_ID() refers a point but not an object
+ if (!refattr(PASSED_POINT_REF_ID())->isObject()) {
+ SketchPlugin_Tools::createCoincidenceOrTangency(
+ this, PASSED_POINT_REF_ID(), AttributePtr(),
+ theEllipseFeature->lastResult(), isTangencyApplicable);
+ }
+}
+
+void SketchPlugin_MacroEllipse::constraintsForEllipseByMajoxAxisAndPassed(
+ FeaturePtr theEllipseFeature)
+{
+ // tangency on-the-fly is not applicable for ellipses
+ static const bool isTangencyApplicable = false;
+ // Create constraints.
+ SketchPlugin_Tools::createCoincidenceOrTangency(
+ this, MAJOR_AXIS_START_REF_ID(),
+ theEllipseFeature->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_START_ID()),
+ ObjectPtr(), isTangencyApplicable);
+ SketchPlugin_Tools::createCoincidenceOrTangency(
+ this, MAJOR_AXIS_END_REF_ID(),
+ theEllipseFeature->attribute(SketchPlugin_Ellipse::MAJOR_AXIS_END_ID()),
+ ObjectPtr(), isTangencyApplicable);
+ // make coincidence only if PASSED_POINT_REF_ID() refers a point but not an object
+ if (!refattr(PASSED_POINT_1_REF_ID())->isObject()) {
+ SketchPlugin_Tools::createCoincidenceOrTangency(
+ this, PASSED_POINT_1_REF_ID(), AttributePtr(),
+ theEllipseFeature->lastResult(), isTangencyApplicable);
+ }