- EntityWrapperPtr anAttrs[2] = {theCoincAttr1, theCoincAttr2};
- for (int i = 0; i < 2 && used; ++i) {
- if (anAttrs[i]->baseAttribute())
- used = used && isUsed(anAttrs[i]->baseAttribute());
- else
- used = used && isUsed(anAttrs[i]->baseFeature());
-
- if (!used) {
- if (anAttrs[i]->type() == ENTITY_POINT) {
- EntityID anID = anAttrs[i]->id();
- for (int j = 0; j < 4; ++j)
- if (anID == aPointIDs[j]) {
- used = true;
- break;
- }
- }
+ // both points of one line is on another line => lines are already collinear,
+ // would like to show "conflicting constraints"
+ if (isPointOnOppositeLine[0] && isPointOnOppositeLine[1])
+ isPointOnOppositeLine[1] = false;
+ if (isPointOnOppositeLine[2] && isPointOnOppositeLine[3])
+ isPointOnOppositeLine[3] = false;
+
+ bool aConstraintToApply[4] = {false, false, false, false};
+ ConstraintWrapperPtr aNewConstraint;
+ std::shared_ptr<PlaneGCSSolver_PointWrapper> aPoints[2];
+ std::shared_ptr<PlaneGCSSolver_EdgeWrapper> aLine;
+
+ if (isPointOnOppositeLine[0] || isPointOnOppositeLine[1]) {
+ // one of points of first line is already on the second line,
+ // make another point of first line to be coincident with second line
+ for (int i = 0; i < 2; ++i) {
+ if (isPointOnOppositeLine[i])
+ continue;
+
+ if (!myIsConstraintApplied[i])
+ aPoints[i] = std::dynamic_pointer_cast<PlaneGCSSolver_PointWrapper>(myPoints[i]);
+ aConstraintToApply[i] = true;