// Check the quantity of entities of each type and their order (arcs first)
int aNbLines = 0;
int aNbCircles = 0;
- bool isSwap = false; // whether need to swap arguments (arc goes before line)
std::vector<EntityWrapperPtr>::iterator anEntIt = theAttributes.begin() + 2;
for (; anEntIt != theAttributes.end(); ++anEntIt) {
if ((*anEntIt)->type() == ENTITY_LINE)
++aNbLines;
- else if ((*anEntIt)->type() == ENTITY_ARC || (*anEntIt)->type() == ENTITY_CIRCLE) {
+ else if ((*anEntIt)->type() == ENTITY_ARC || (*anEntIt)->type() == ENTITY_CIRCLE)
++aNbCircles;
- isSwap = aNbLines > 0;
- }
}
if (aNbCircles < 1) {
if (!hasSingleCoincidence(aFeature1, aFeature2))
myErrorMsg = SketchSolver_Error::TANGENCY_FAILED();
}
-
- if (isSwap) {
- EntityWrapperPtr aTemp = theAttributes[2];
- theAttributes[2] = theAttributes[3];
- theAttributes[3] = aTemp;
- }
}
void SketchSolver_ConstraintTangent::adjustConstraint()