+ std::list<AttributePtr> aPtAttrs = anAttr->data()->attributes(GeomDataAPI_Point2D::typeId());
+ aPoints.insert(aPtAttrs.begin(), aPtAttrs.end());
+ }
+
+ // Check whether feature's points are already coincident with fixed points.
+ // In this case we need to revert decrease of DoF for these points.
+ // If the coordinates of fixed points are different, it will be processed by solver.
+ for (int k = 0; k < i; ++k) {
+ FeaturePtr aFeature = aSketch->subFeature(k);
+ if (aFeature->getKind() != SketchPlugin_ConstraintCoincidence::ID())
+ continue;
+ AttributePtr aCoincPoint[2] = {AttributePtr(), AttributePtr()};
+ for (int j = 0; j < 2; ++j) {
+ AttributeRefAttrPtr aRefAttr = std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(
+ aFeature->attribute(SketchPlugin_Constraint::ATTRIBUTE(j)));
+ if (!aRefAttr)
+ continue;
+ if (!aRefAttr->isObject())
+ aCoincPoint[j] = aRefAttr->attr();
+ else {
+ FeaturePtr anAttr = ModelAPI_Feature::feature(aRefAttr->object());
+ if (anAttr && anAttr->getKind() == SketchPlugin_Point::ID())
+ aCoincPoint[j] = anAttr->attribute(SketchPlugin_Point::COORD_ID());
+ }
+ }
+ if (aCoincPoint[0] && aCoincPoint[1]) {
+ if ((aFixedPoints.find(aCoincPoint[0]) != aFixedPoints.end() &&
+ aPoints.find(aCoincPoint[1]) != aPoints.end()) ||
+ (aFixedPoints.find(aCoincPoint[1]) != aFixedPoints.end() &&
+ aPoints.find(aCoincPoint[0]) != aPoints.end()))
+ aDoF += 2; // point already fixed
+ }