// and reference from composite feature is removed automatically
FeaturePtr anOwnerFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(owner());
if (anOwnerFeature.get()) {
- aData->addBackReference(anOwnerFeature, id());
+ aData->addBackReference(anOwnerFeature, id(), false);
}
owner()->data()->sendAttributeUpdated(this);
aRes->setIsConcealed(false);
}
-void Model_Data::addBackReference(FeaturePtr theFeature, std::string theAttrID)
+void Model_Data::addBackReference(FeaturePtr theFeature, std::string theAttrID,
+ const bool theApplyConcealment)
{
myRefsToMe.insert(theFeature->data()->attribute(theAttrID));
- if (ModelAPI_Session::get()->validators()->isConcealed(theFeature->getKind(), theAttrID)) {
+ if (theApplyConcealment &&
+ ModelAPI_Session::get()->validators()->isConcealed(theFeature->getKind(), theAttrID)) {
std::shared_ptr<ModelAPI_Result> aRes =
std::dynamic_pointer_cast<ModelAPI_Result>(myObject);
if (aRes) {
MODEL_EXPORT virtual void copyTo(std::shared_ptr<ModelAPI_Data> theTarget);
private:
- /// removes all information about back references
+ /// Removes all information about back references
void eraseBackReferences();
- // adds a back reference (with identifier which attribute references to this object
- void addBackReference(FeaturePtr theFeature, std::string theAttrID);
+ /// Adds a back reference (with identifier which attribute references to this object
+ /// \param theFeature feature referenced to this
+ /// \param theAttrID identifier of the attribute that is references from theFeature to this
+ /// \param theApplyConcealment applies consealment flag changes
+ void addBackReference(FeaturePtr theFeature, std::string theAttrID,
+ const bool theApplyConcealment = true);
};
#endif