friend class Model_ValidatorsFactory;
friend class Model_SelectionNaming;
friend class Model_ResultConstruction;
+ friend class Model_ResultBody;
public:
/// The simplest constructor. "setLabel" must be called just after to initialize correctly.
MODEL_EXPORT virtual std::string name();
/// Defines the name of the feature visible by the user in the object browser
MODEL_EXPORT virtual void setName(const std::string& theName);
+ /// Return \c true if the object has been renamed by the user
+ MODEL_EXPORT virtual bool hasUserDefinedName() const;
/// Returns the attribute that references to another document
MODEL_EXPORT virtual std::shared_ptr<ModelAPI_AttributeDocRef> document(const std::string& theID);
/// Returns the attribute that contains real value with double precision
MODEL_EXPORT virtual bool isValid();
/// Returns the label where the shape must be stored (used in ResultBody)
- TDF_Label& shapeLab()
+ TDF_Label shapeLab() const
{
- return myLab;
+ return myLab.IsNull() ? myLab : myLab.Father().FindChild(2);
}
/// Initializes object by the attributes: must be called just after the object is created
else { \
FolderPtr anAttributeOwnerFolder = std::dynamic_pointer_cast<ModelAPI_Folder>(owner()); \
if (anAttributeOwnerFolder.get()) \
- aTargetData->addBackReference(anAttributeOwnerFolder, id()); \
+ aTargetData->addBackReference(ObjectPtr(anAttributeOwnerFolder), id()); \
} \
}
else { \
FolderPtr anAttributeOwnerFolder = std::dynamic_pointer_cast<ModelAPI_Folder>(owner()); \
if (anAttributeOwnerFolder.get()) \
- aTargetData->removeBackReference(anAttributeOwnerFolder, id()); \
+ aTargetData->removeBackReference(ObjectPtr(anAttributeOwnerFolder), id()); \
} \
}