-void SketchPlugin_ConstraintSplit::updateTangentConstraintsToFeature(
- const std::map<std::shared_ptr<ModelAPI_Feature>, IdToPointPair>& theTangentFeatures,
- const std::set<std::shared_ptr<GeomDataAPI_Point2D> >& theFurtherCoincidences)
-{
- if (theTangentFeatures.empty())
- return;
-
- std::map<FeaturePtr, IdToPointPair>::const_iterator aTIt = theTangentFeatures.begin(),
- aTLast = theTangentFeatures.end();
-#ifdef DEBUG_SPLIT
- std::cout << std::endl;
- std::cout << "Tangencies to feature(modified):"<< std::endl;
-#endif
- for (; aTIt != aTLast; aTIt++) {
- FeaturePtr aTangentFeature = aTIt->first;
- std::string anAttributeId = aTIt->second.first;
- AttributePoint2DPtr aTangentPoint = aTIt->second.second;
- std::set<AttributePoint2DPtr>::const_iterator aFCIt = theFurtherCoincidences.begin(),
- aFCLast = theFurtherCoincidences.end();
- std::shared_ptr<GeomAPI_Pnt2d> aCoincPnt = aTangentPoint->pnt();
- AttributePoint2DPtr aFeaturePointAttribute;
- /// here we rely on created coincidence between further coincidence point and tangent result
- for (; aFCIt != aFCLast && !aFeaturePointAttribute.get(); aFCIt++) {
- AttributePoint2DPtr aFCAttribute = *aFCIt;
- if (aCoincPnt->isEqual(aFCAttribute->pnt()))
- aFeaturePointAttribute = aFCAttribute;
- }
- if (aFeaturePointAttribute.get()) {
- FeaturePtr aFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aFeaturePointAttribute->owner());
- aTangentFeature->refattr(anAttributeId)->setObject(getFeatureResult(aFeature));
- }
-#ifdef DEBUG_SPLIT
- std::cout << " -" << getFeatureInfo(aTangentFeature) << std::endl;
-#endif
- }
-}
-
-void SketchPlugin_ConstraintSplit::updateRefFeatureConstraints(const ResultPtr& theFeatureBaseResult,
- const std::list<AttributePtr>& theRefsToFeature)