1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #include <SketchSolver_ConstraintLength.h>
4 #include <SketchSolver_Error.h>
7 void SketchSolver_ConstraintLength::getAttributes(
9 std::vector<EntityWrapperPtr>& theAttributes)
11 SketchSolver_Constraint::getAttributes(theValue, theAttributes);
12 if (!myErrorMsg.empty() || !theAttributes[2] ||
13 theAttributes[2]->type() != ENTITY_LINE) {
14 theAttributes.clear();
18 // Get boundary points of line segment and create point-point distance constraint
19 std::list<EntityWrapperPtr> aSubs = theAttributes[2]->subEntities();
20 theAttributes.assign(theAttributes.size(), EntityWrapperPtr());
21 std::vector<EntityWrapperPtr>::iterator anAttrIt = theAttributes.begin();
22 std::list<EntityWrapperPtr>::const_iterator aSubIt = aSubs.begin();
23 for (; aSubIt != aSubs.end(); ++aSubIt, ++anAttrIt)
26 myType = CONSTRAINT_PT_PT_DISTANCE;