- {
- // find by feature
- FeaturePtr aSourceFeature = ModelAPI_Feature::feature(theObject);
-
- const std::set<AttributePtr>& aRefsList = theObject->data()->refsToMe();
- std::set<AttributePtr>::const_iterator aIt;
- for (aIt = aRefsList.cbegin(); aIt != aRefsList.cend(); ++aIt) {
- std::shared_ptr<ModelAPI_Attribute> aAttr = (*aIt);
- FeaturePtr aRefFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aAttr->owner());
- if (aRefFeature->getKind() == theReferenceFeatureKind) {
- std::list<AttributePtr> anAttributes =
- aRefFeature->data()->attributes(ModelAPI_AttributeRefAttr::typeId());
- std::list<AttributePtr>::iterator anIter = anAttributes.begin(), aLast = anAttributes.end();
- bool isSkippedAttribute = false;
- if (isSkipFeatureAttributes) {
- for(anIter = anAttributes.begin(); anIter != aLast && !isSkippedAttribute; anIter++) {
- AttributeRefAttrPtr aRefAttribute =
- std::dynamic_pointer_cast<ModelAPI_AttributeRefAttr>(*anIter);
- if (aRefAttribute.get() && !aRefAttribute->isObject()) {
- std::shared_ptr<GeomDataAPI_Point2D> aPointAttr =
- std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aRefAttribute->attr());
- FeaturePtr anAttributeFeature = ModelAPI_Feature::feature(aPointAttr->owner());
- isSkippedAttribute = aSourceFeature == anAttributeFeature;
- }
- }
- }
- if (isSkippedAttribute)
- continue;