X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModelAPI%2FModelAPI_Object.h;h=9241d9b6545310c70a13dd62e1e65d30186314d4;hb=b2a34ee4bab2fe2d97f900cbdafcaf122344c46c;hp=91167b871b71331c26b305d006d64570a62f1ae7;hpb=8dc74f82810d5f597b78633b457efb0ef4f89f9f;p=modules%2Fshaper.git diff --git a/src/ModelAPI/ModelAPI_Object.h b/src/ModelAPI/ModelAPI_Object.h index 91167b871..9241d9b65 100644 --- a/src/ModelAPI/ModelAPI_Object.h +++ b/src/ModelAPI/ModelAPI_Object.h @@ -6,6 +6,7 @@ #define ModelAPI_Object_H_ #include "ModelAPI.h" +#include "ModelAPI_Data.h" #include @@ -24,7 +25,7 @@ class ModelAPI_Document; class ModelAPI_Object { boost::shared_ptr myData; ///< manager of the data model of a feature - boost::shared_ptr myDoc; ///< document this feature belongs to + boost::shared_ptr myDoc; ///< document this object belongs to public: /// By default object is displayed in the object browser. virtual bool isInHistory() @@ -66,7 +67,14 @@ class ModelAPI_Object myDoc = theDoc; } + /// removes all fields from this feature + MODELAPI_EXPORT virtual void erase() { + if (myData) myData->erase(); + setData(DataPtr()); + } + friend class Model_Document; + }; typedef boost::shared_ptr ObjectPtr;