1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
3 // File: ModelAPI_Object.cpp
4 // Created: 19 May 2014
5 // Author: Mikhail PONIKAROV
7 #include "ModelAPI_Object.h"
8 #include "ModelAPI_Document.h"
10 bool ModelAPI_Object::isInHistory()
15 void ModelAPI_Object::setInHistory(
16 const std::shared_ptr<ModelAPI_Object> theObject, const bool theFlag)
18 if (myInHistory != theFlag) {
19 myInHistory = theFlag;
20 myDoc->addToHistory(theObject);
24 std::shared_ptr<ModelAPI_Data> ModelAPI_Object::data() const
29 bool ModelAPI_Object::isSame(const std::shared_ptr<ModelAPI_Object>& theObject)
31 return theObject.get() == this;
34 std::shared_ptr<ModelAPI_Document> ModelAPI_Object::document() const
39 void ModelAPI_Object::attributeChanged(const std::string& theID)
43 ModelAPI_Object::ModelAPI_Object() : myInHistory(true)
47 ModelAPI_Object::~ModelAPI_Object()
51 void ModelAPI_Object::setData(std::shared_ptr<ModelAPI_Data> theData)
56 void ModelAPI_Object::setDoc(std::shared_ptr<ModelAPI_Document> theDoc)
61 void ModelAPI_Object::erase()
63 if (myData) myData->erase();