Sketcher: Fix bug of auto-constraints icon not clearing up on mouseMove.
This commit is contained in:
committed by
Chris Hennes
parent
00cc1347b8
commit
ca2f369cab
@@ -885,6 +885,22 @@ void DrawSketchHandler::createAutoConstraints(const std::vector<AutoConstraint>&
|
||||
}
|
||||
}
|
||||
|
||||
int DrawSketchHandler::seekAndRenderAutoConstraint(
|
||||
std::vector<AutoConstraint>& suggestedConstraints,
|
||||
const Base::Vector2d& Pos,
|
||||
const Base::Vector2d& Dir,
|
||||
AutoConstraint::TargetType type)
|
||||
{
|
||||
if (seekAutoConstraint(suggestedConstraints, Pos, Dir, type)) {
|
||||
renderSuggestConstraintsCursor(suggestedConstraints);
|
||||
}
|
||||
else {
|
||||
applyCursor();
|
||||
}
|
||||
|
||||
return suggestedConstraints.size();
|
||||
}
|
||||
|
||||
void DrawSketchHandler::renderSuggestConstraintsCursor(
|
||||
std::vector<AutoConstraint>& suggestedConstraints)
|
||||
{
|
||||
|
||||
@@ -172,6 +172,12 @@ public:
|
||||
const Base::Vector2d& Pos,
|
||||
const Base::Vector2d& Dir,
|
||||
AutoConstraint::TargetType type = AutoConstraint::VERTEX);
|
||||
|
||||
int seekAndRenderAutoConstraint(std::vector<AutoConstraint>& suggestedConstraints,
|
||||
const Base::Vector2d& Pos,
|
||||
const Base::Vector2d& Dir,
|
||||
AutoConstraint::TargetType type = AutoConstraint::VERTEX);
|
||||
|
||||
// createowncommand indicates whether a separate command shall be create and committed (for
|
||||
// example for undo purposes) or not is not it is the responsibility of the developer to create
|
||||
// and commit the command appropriately.
|
||||
|
||||
@@ -97,10 +97,9 @@ private:
|
||||
firstPoint = onSketchPos;
|
||||
}
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
case SelectMode::SeekSecond: {
|
||||
if (constructionMethod() == ConstructionMethod::Center) {
|
||||
@@ -123,10 +122,9 @@ private:
|
||||
toolWidgetManager.drawPositionAtCursor(onSketchPos);
|
||||
}
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[1], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[1]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
case SelectMode::SeekThird: {
|
||||
double startAngleBackup = startAngle;
|
||||
@@ -197,22 +195,16 @@ private:
|
||||
|
||||
if (constructionMethod() == ConstructionMethod::Center) {
|
||||
toolWidgetManager.drawDoubleAtCursor(onSketchPos, arcAngle, Base::Unit::Angle);
|
||||
if (seekAutoConstraint(sugConstraints[2],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.0, 0.0))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[2]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[2],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.0, 0.0));
|
||||
}
|
||||
else {
|
||||
toolWidgetManager.drawPositionAtCursor(onSketchPos);
|
||||
if (seekAutoConstraint(sugConstraints[2],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE)) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[2]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[2],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE);
|
||||
}
|
||||
|
||||
} break;
|
||||
|
||||
@@ -70,12 +70,9 @@ public:
|
||||
{
|
||||
if (Mode == STATUS_SEEK_First) {
|
||||
setPositionText(onSketchPos);
|
||||
if (seekAutoConstraint(sugConstr1,
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f))) { // TODO: ellipse prio 1
|
||||
renderSuggestConstraintsCursor(sugConstr1);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr1,
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f)); // TODO: ellipse prio 1
|
||||
}
|
||||
else if (Mode == STATUS_SEEK_Second) {
|
||||
double rx0 = onSketchPos.x - EditCurve[0].x;
|
||||
@@ -100,13 +97,10 @@ public:
|
||||
}
|
||||
|
||||
drawEdit(EditCurve);
|
||||
if (seekAutoConstraint(sugConstr2,
|
||||
onSketchPos,
|
||||
onSketchPos - centerPoint,
|
||||
AutoConstraint::CURVE)) {
|
||||
renderSuggestConstraintsCursor(sugConstr2);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr2,
|
||||
onSketchPos,
|
||||
onSketchPos - centerPoint,
|
||||
AutoConstraint::CURVE);
|
||||
}
|
||||
else if (Mode == STATUS_SEEK_Third) {
|
||||
// angle between the major axis of the ellipse and the X axis
|
||||
@@ -140,10 +134,7 @@ public:
|
||||
}
|
||||
|
||||
drawEdit(EditCurve);
|
||||
if (seekAutoConstraint(sugConstr3, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstr3);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr3, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
else if (Mode == STATUS_SEEK_Fourth) { // here we differ from ellipse creation
|
||||
// angle between the major axis of the ellipse and the X axis
|
||||
@@ -196,14 +187,8 @@ public:
|
||||
}
|
||||
|
||||
drawEdit(EditCurve);
|
||||
if (seekAutoConstraint(sugConstr4, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstr4);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr4, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
|
||||
|
||||
applyCursor();
|
||||
}
|
||||
|
||||
bool pressButton(Base::Vector2d onSketchPos) override
|
||||
|
||||
@@ -67,10 +67,7 @@ public:
|
||||
{
|
||||
if (Mode == STATUS_SEEK_First) {
|
||||
setPositionText(onSketchPos);
|
||||
if (seekAutoConstraint(sugConstr1, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstr1);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr1, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
else if (Mode == STATUS_SEEK_Second) {
|
||||
EditCurve[1] = onSketchPos;
|
||||
@@ -85,13 +82,10 @@ public:
|
||||
}
|
||||
|
||||
drawEdit(EditCurve);
|
||||
if (seekAutoConstraint(sugConstr2,
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE)) {
|
||||
renderSuggestConstraintsCursor(sugConstr2);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr2,
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE);
|
||||
}
|
||||
else if (Mode == STATUS_SEEK_Third) {
|
||||
// angle between the major axis of the hyperbola and the X axis
|
||||
@@ -126,10 +120,7 @@ public:
|
||||
}
|
||||
|
||||
drawEdit(EditCurve);
|
||||
if (seekAutoConstraint(sugConstr3, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstr3);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr3, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
}
|
||||
else if (Mode == STATUS_SEEK_Fourth) {
|
||||
@@ -190,13 +181,8 @@ public:
|
||||
}
|
||||
|
||||
drawEdit(EditCurve);
|
||||
if (seekAutoConstraint(sugConstr4, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstr4);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr4, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
|
||||
applyCursor();
|
||||
}
|
||||
|
||||
bool pressButton(Base::Vector2d onSketchPos) override
|
||||
|
||||
@@ -70,10 +70,7 @@ public:
|
||||
{
|
||||
if (Mode == STATUS_SEEK_First) {
|
||||
setPositionText(onSketchPos);
|
||||
if (seekAutoConstraint(sugConstr1, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstr1);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr1, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
else if (Mode == STATUS_SEEK_Second) {
|
||||
EditCurve[1] = onSketchPos;
|
||||
@@ -88,10 +85,7 @@ public:
|
||||
}
|
||||
|
||||
drawEdit(EditCurve);
|
||||
if (seekAutoConstraint(sugConstr2, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstr2);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr2, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
else if (Mode == STATUS_SEEK_Third) {
|
||||
double focal = (axisPoint - focusPoint).Length();
|
||||
@@ -125,10 +119,7 @@ public:
|
||||
|
||||
drawEdit(EditCurve);
|
||||
|
||||
if (seekAutoConstraint(sugConstr3, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstr3);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr3, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
else if (Mode == STATUS_SEEK_Fourth) {
|
||||
double focal = (axisPoint - focusPoint).Length();
|
||||
@@ -174,13 +165,8 @@ public:
|
||||
}
|
||||
|
||||
drawEdit(EditCurve);
|
||||
if (seekAutoConstraint(sugConstr4, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstr4);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr4, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
|
||||
applyCursor();
|
||||
}
|
||||
|
||||
bool pressButton(Base::Vector2d onSketchPos) override
|
||||
|
||||
@@ -101,10 +101,9 @@ private:
|
||||
|
||||
centerPoint = onSketchPos;
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
case SelectMode::SeekSecond: {
|
||||
toolWidgetManager.drawDirectionAtCursor(onSketchPos, centerPoint);
|
||||
@@ -116,10 +115,9 @@ private:
|
||||
|
||||
CreateAndDrawShapeGeometry();
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[1], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[1]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
case SelectMode::SeekThird: {
|
||||
endPoint = centerPoint + (onSketchPos - centerPoint).Normalize() * radius;
|
||||
@@ -144,10 +142,9 @@ private:
|
||||
|
||||
toolWidgetManager.drawDoubleAtCursor(onSketchPos, arcAngle, Base::Unit::Angle);
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[2], onSketchPos, Base::Vector2d(0.0, 0.0))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[2]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[2],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.0, 0.0));
|
||||
} break;
|
||||
case SelectMode::SeekFourth: {
|
||||
|
||||
|
||||
@@ -103,10 +103,9 @@ private:
|
||||
case SelectMode::SeekFirst: {
|
||||
toolWidgetManager.drawPositionAtCursor(onSketchPos);
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
case SelectMode::SeekSecond: {
|
||||
toolWidgetManager.drawDirectionAtCursor(onSketchPos, getLastPoint());
|
||||
@@ -117,10 +116,9 @@ private:
|
||||
catch (const Base::ValueError&) {
|
||||
} // equal points while hovering raise an objection that can be safely ignored
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[1], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[1]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -84,21 +84,15 @@ private:
|
||||
if (constructionMethod() == ConstructionMethod::Center) {
|
||||
centerPoint = onSketchPos;
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d())) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d());
|
||||
}
|
||||
else {
|
||||
firstPoint = onSketchPos;
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(),
|
||||
AutoConstraint::CURVE)) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(),
|
||||
AutoConstraint::CURVE);
|
||||
}
|
||||
} break;
|
||||
case SelectMode::SeekSecond: {
|
||||
@@ -118,15 +112,12 @@ private:
|
||||
toolWidgetManager.drawPositionAtCursor(onSketchPos);
|
||||
}
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
constructionMethod() == ConstructionMethod::Center
|
||||
? onSketchPos - centerPoint
|
||||
: Base::Vector2d(),
|
||||
AutoConstraint::CURVE)) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[1]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
constructionMethod() == ConstructionMethod::Center
|
||||
? onSketchPos - centerPoint
|
||||
: Base::Vector2d(),
|
||||
AutoConstraint::CURVE);
|
||||
} break;
|
||||
case SelectMode::SeekThird: {
|
||||
try {
|
||||
@@ -144,13 +135,10 @@ private:
|
||||
|
||||
CreateAndDrawShapeGeometry();
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[2],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE)) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[2]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[2],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE);
|
||||
}
|
||||
catch (Base::ValueError& e) {
|
||||
e.ReportException();
|
||||
|
||||
@@ -93,23 +93,17 @@ private:
|
||||
if (constructionMethod() == ConstructionMethod::Center) {
|
||||
centerPoint = onSketchPos;
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
else {
|
||||
apoapsis = onSketchPos;
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE)) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE);
|
||||
}
|
||||
} break;
|
||||
case SelectMode::SeekSecond: {
|
||||
@@ -126,13 +120,10 @@ private:
|
||||
toolWidgetManager.drawPositionAtCursor(onSketchPos);
|
||||
}
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE)) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[1]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE);
|
||||
} break;
|
||||
case SelectMode::SeekThird: {
|
||||
calculateThroughPointMinorAxisParameters(onSketchPos);
|
||||
@@ -148,13 +139,10 @@ private:
|
||||
toolWidgetManager.drawPositionAtCursor(onSketchPos);
|
||||
}
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[2],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE)) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[2]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[2],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f),
|
||||
AutoConstraint::CURVE);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -232,10 +232,8 @@ public:
|
||||
drawEdit(EditCurve);
|
||||
}
|
||||
int curveId = getPreselectCurve();
|
||||
if (BaseGeoId != curveId
|
||||
&& seekAutoConstraint(SugConstr, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(SugConstr);
|
||||
return;
|
||||
if (BaseGeoId != curveId) {
|
||||
seekAndRenderAutoConstraint(SugConstr, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -94,10 +94,9 @@ private:
|
||||
|
||||
startPoint = onSketchPos;
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
case SelectMode::SeekSecond: {
|
||||
toolWidgetManager.drawDirectionAtCursor(onSketchPos, startPoint);
|
||||
@@ -110,10 +109,9 @@ private:
|
||||
catch (const Base::ValueError&) {
|
||||
} // equal points while hovering raise an objection that can be safely ignored
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[1], onSketchPos, onSketchPos - startPoint)) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[1]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
onSketchPos - startPoint);
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -191,10 +191,7 @@ public:
|
||||
suppressTransition = false;
|
||||
if (Mode == STATUS_SEEK_First) {
|
||||
setPositionText(onSketchPos);
|
||||
if (seekAutoConstraint(sugConstr1, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstr1);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr1, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
else if (Mode == STATUS_SEEK_Second) {
|
||||
if (SegmentMode == SEGMENT_MODE_Line) {
|
||||
@@ -231,10 +228,9 @@ public:
|
||||
}
|
||||
|
||||
if (TransitionMode == TRANSITION_MODE_Free) {
|
||||
if (seekAutoConstraint(sugConstr2, onSketchPos, onSketchPos - EditCurve[0])) {
|
||||
renderSuggestConstraintsCursor(sugConstr2);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr2,
|
||||
onSketchPos,
|
||||
onSketchPos - EditCurve[0]);
|
||||
}
|
||||
}
|
||||
else if (SegmentMode == SEGMENT_MODE_Arc) {
|
||||
@@ -325,13 +321,9 @@ public:
|
||||
setPositionText(onSketchPos, text);
|
||||
}
|
||||
|
||||
if (seekAutoConstraint(sugConstr2, onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstr2);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstr2, onSketchPos, Base::Vector2d(0.f, 0.f));
|
||||
}
|
||||
}
|
||||
applyCursor();
|
||||
}
|
||||
|
||||
bool pressButton(Base::Vector2d onSketchPos) override
|
||||
|
||||
@@ -67,10 +67,9 @@ private:
|
||||
|
||||
editPoint = onSketchPos;
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -83,10 +83,9 @@ private:
|
||||
|
||||
centerPoint = onSketchPos;
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
case SelectMode::SeekSecond: {
|
||||
toolWidgetManager.drawDirectionAtCursor(onSketchPos, centerPoint);
|
||||
@@ -95,10 +94,9 @@ private:
|
||||
|
||||
CreateAndDrawShapeGeometry();
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[1], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[1]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -123,10 +123,9 @@ private:
|
||||
center = onSketchPos;
|
||||
}
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
case SelectMode::SeekSecond: {
|
||||
if (constructionMethod() == ConstructionMethod::Diagonal) {
|
||||
@@ -212,10 +211,9 @@ private:
|
||||
catch (const Base::ValueError&) {
|
||||
} // equal points while hovering raise an objection that can be safely ignored
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[1], onSketchPos, Base::Vector2d(0.0, 0.0))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[1]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.0, 0.0));
|
||||
} break;
|
||||
case SelectMode::SeekThird: {
|
||||
if (constructionMethod() == ConstructionMethod::Diagonal
|
||||
@@ -298,12 +296,10 @@ private:
|
||||
} // equal points while hovering raise an objection that can be safely ignored
|
||||
|
||||
if ((constructionMethod() == ConstructionMethod::ThreePoints
|
||||
|| constructionMethod() == ConstructionMethod::CenterAnd3Points)
|
||||
&& seekAutoConstraint(sugConstraints[2],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.0, 0.0))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[2]);
|
||||
return;
|
||||
|| constructionMethod() == ConstructionMethod::CenterAnd3Points)) {
|
||||
seekAndRenderAutoConstraint(sugConstraints[2],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.0, 0.0));
|
||||
}
|
||||
} break;
|
||||
case SelectMode::SeekFourth: {
|
||||
|
||||
@@ -88,10 +88,9 @@ private:
|
||||
|
||||
startPoint = onSketchPos;
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[0], onSketchPos, Base::Vector2d(0.f, 0.f))) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[0]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[0],
|
||||
onSketchPos,
|
||||
Base::Vector2d(0.f, 0.f));
|
||||
} break;
|
||||
case SelectMode::SeekSecond: {
|
||||
toolWidgetManager.drawDirectionAtCursor(onSketchPos, startPoint);
|
||||
@@ -105,13 +104,10 @@ private:
|
||||
|
||||
CreateAndDrawShapeGeometry();
|
||||
|
||||
if (seekAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
secondPoint - startPoint,
|
||||
AutoConstraint::VERTEX_NO_TANGENCY)) {
|
||||
renderSuggestConstraintsCursor(sugConstraints[1]);
|
||||
return;
|
||||
}
|
||||
seekAndRenderAutoConstraint(sugConstraints[1],
|
||||
onSketchPos,
|
||||
secondPoint - startPoint,
|
||||
AutoConstraint::VERTEX_NO_TANGENCY);
|
||||
} break;
|
||||
case SelectMode::SeekThird: {
|
||||
/*To follow the cursor, r should adapt depending on the position of the cursor. If
|
||||
|
||||
Reference in New Issue
Block a user