#include <ModelAPI_AttributeRefAttr.h>
#include <ModelAPI_AttributeRefList.h>
#include <SketchPlugin_Arc.h>
+#include <SketchPlugin_Circle.h>
#include <SketchPlugin_Line.h>
+#include <SketchPlugin_Point.h>
+#include <SketchPlugin_IntersectionPoint.h>
void SketchSolver_ConstraintMulti::getEntities(std::list<EntityWrapperPtr>& theEntities)
{
updateLocal();
if (isForce)
myAdjusted = false;
- // update parent object
- SketchSolver_Constraint::update();
+ adjustConstraint();
}
void SketchSolver_ConstraintMulti::adjustConstraint()
} else if (aFeature->getKind() == SketchPlugin_Line::ID()) {
aPoints.push_back(aFeature->attribute(SketchPlugin_Line::START_ID()));
aPoints.push_back(aFeature->attribute(SketchPlugin_Line::END_ID()));
- } else
- aPoints = aFeature->data()->attributes(GeomDataAPI_Point2D::typeId());
+ } else if (aFeature->getKind() == SketchPlugin_Circle::ID())
+ aPoints.push_back(aFeature->attribute(SketchPlugin_Circle::CENTER_ID()));
+ else if (aFeature->getKind() == SketchPlugin_Point::ID() ||
+ aFeature->getKind() == SketchPlugin_IntersectionPoint::ID())
+ aPoints.push_back(aFeature->attribute(SketchPlugin_Point::COORD_ID()));
std::list<AttributePtr>::iterator aPtIt = aPoints.begin();
for (aXIt = aX.begin(), aYIt = aY.begin(); aPtIt != aPoints.end(); ++aXIt, ++aYIt, ++aPtIt) {
myAdjusted = true;
}
+
+bool SketchSolver_ConstraintMulti::isUsed(FeaturePtr theFeature) const
+{
+ return myFeatures.find(theFeature) != myFeatures.end() ||
+ SketchSolver_Constraint::isUsed(theFeature);
+}