-void SketchPlugin_ConstraintDistance::execute()
-{
-}
-
-
-void SketchPlugin_ConstraintDistance::setAttributes(
- const double theDistance,
- const boost::shared_ptr<SketchPlugin_Feature> theEntityA,
- const boost::shared_ptr<SketchPlugin_Feature> theEntityB)
-{
- // Assign the value of the distance
- data()->addAttribute(CONSTRAINT_ATTR_DISTANCE, ModelAPI_AttributeDouble::type());
- boost::dynamic_pointer_cast<ModelAPI_AttributeDouble>(
- data()->attribute(CONSTRAINT_ATTR_DISTANCE))->setValue(theDistance);
-
- // Assign parameters of the constraint
- std::string aPoints[2] = {CONSTRAINT_ATTR_POINT_A, CONSTRAINT_ATTR_POINT_B};
- std::string anEntities[2] = {CONSTRAINT_ATTR_ENTITY_A, CONSTRAINT_ATTR_ENTITY_B};
- int aCurPt = 0;
- int aCurEnt = 0;
- std::string aCurAttr;
- // add entityA depending on its type
- if (theEntityA->getKind() == SketchPlugin_Point().getKind())
- aCurAttr = aPoints[aCurPt++];
- else
- aCurAttr = anEntities[aCurEnt++];
- myAttrList.push_back(aCurAttr);
- data()->addAttribute(aCurAttr, ModelAPI_AttributeReference::type());
- boost::dynamic_pointer_cast<ModelAPI_AttributeReference>(
- data()->attribute(aCurAttr))->setValue(theEntityA);
- // add entityB depending on its type
- if (theEntityB->getKind() == SketchPlugin_Point().getKind())
- aCurAttr = aPoints[aCurPt++];
- else
- aCurAttr = anEntities[aCurEnt++];
- myAttrList.push_back(aCurAttr);
- data()->addAttribute(aCurAttr, ModelAPI_AttributeReference::type());
- boost::dynamic_pointer_cast<ModelAPI_AttributeReference>(
- data()->attribute(aCurAttr))->setValue(theEntityB);
-}
-
-void SketchPlugin_ConstraintDistance::setAttributes(
- const double theDistance,
- const boost::shared_ptr<ModelAPI_Attribute> thePoint,
- const boost::shared_ptr<SketchPlugin_Feature> theEntity)