+ // Constraint for the given length of a line
+ if (aConstraintKind.compare(SKETCH_CONSTRAINT_LENGTH_KIND) == 0)
+ {
+ int aNbLines = 0;
+ for (unsigned int indAttr = 0; indAttr < CONSTRAINT_ATTR_SIZE; indAttr++)
+ {
+ boost::shared_ptr<ModelAPI_AttributeRefAttr> anAttr =
+ boost::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
+ theConstraint->data()->attribute(CONSTRAINT_ATTRIBUTES[indAttr])
+ );
+ if (!anAttr) continue;
+ if (anAttr->isFeature() && anAttr->feature() &&
+ anAttr->feature()->getKind().compare(SKETCH_LINE_KIND) == 0)
+ {
+ myAttributesList[aNbLines++] = CONSTRAINT_ATTRIBUTES[indAttr];
+ break;
+ }
+ }
+ if (aNbLines == 1)
+ myType = SLVS_C_PT_PT_DISTANCE;
+ return getType();
+ }
+