1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 #include <SketchSolver_ConstraintLength.h>
4 #include <SketchSolver_Error.h>
6 #include <SketchPlugin_Line.h>
9 void SketchSolver_ConstraintLength::getAttributes(
10 EntityWrapperPtr& theValue,
11 std::vector<EntityWrapperPtr>& theAttributes)
13 SketchSolver_Constraint::getAttributes(theValue, theAttributes);
14 if (!myErrorMsg.empty() || !theAttributes[2] ||
15 theAttributes[2]->type() != ENTITY_LINE) {
16 theAttributes.clear();
20 AttributeRefAttrPtr aRefAttr = myBaseConstraint->refattr(SketchPlugin_Constraint::ENTITY_A());
21 FeaturePtr aLine = ModelAPI_Feature::feature(aRefAttr->object());
23 theAttributes[0] = myStorage->entity(aLine->attribute(SketchPlugin_Line::START_ID()));
24 theAttributes[1] = myStorage->entity(aLine->attribute(SketchPlugin_Line::END_ID()));
26 myType = CONSTRAINT_PT_PT_DISTANCE;