1 #include <SketchSolver_ConstraintLength.h>
2 #include <SketchSolver_Error.h>
5 void SketchSolver_ConstraintLength::getAttributes(
7 std::vector<EntityWrapperPtr>& theAttributes)
9 SketchSolver_Constraint::getAttributes(theValue, theAttributes);
10 if (!myErrorMsg.empty() || !theAttributes[2] ||
11 theAttributes[2]->type() != ENTITY_LINE) {
12 theAttributes.clear();
16 // Get boundary points of line segment and create point-point distance constraint
17 std::list<EntityWrapperPtr> aSubs = theAttributes[2]->subEntities();
18 theAttributes.assign(theAttributes.size(), EntityWrapperPtr());
19 std::vector<EntityWrapperPtr>::iterator anAttrIt = theAttributes.begin();
20 std::list<EntityWrapperPtr>::const_iterator aSubIt = aSubs.begin();
21 for (; aSubIt != aSubs.end(); ++aSubIt, ++anAttrIt)
24 myType = CONSTRAINT_PT_PT_DISTANCE;