if (aResult) { //check evolution and a label of this shape
for(TNaming_SameShapeIterator aShapes(theShape, theAccess1); aShapes.More(); aShapes.Next())
{
- static Handle(TNaming_NamedShape) aNS;
+ Handle(TNaming_NamedShape) aNS;
if (aShapes.Label().FindAttribute(TNaming_NamedShape::GetID(), aNS)) {
if (aNS->Evolution() != TNaming_SELECTED) {
theOriginalLabel = aNS->Label();
myDoc->CommitCommand();
}
+Model_Document::~Model_Document()
+{
+ if (!myDoc.IsNull())
+ {
+ myDoc->ClearUndos();
+ myDoc->ClearRedos();
+ }
+}
+
void Model_Document::setThis(DocumentPtr theDoc)
{
myObjs->setOwner(theDoc);
aSession->setCheckTransactions(false);
if (myObjs)
delete myObjs;
+ anOldDoc->ClearRedos();
+ anOldDoc->ClearUndos();
anOldDoc.Nullify();
myObjs = new Model_Objects(myDoc->Main()); // synchronization is inside
myObjs->setOwner(theThis);
MODEL_EXPORT virtual std::shared_ptr<ModelAPI_Feature> nextFeature(
std::shared_ptr<ModelAPI_Feature> theCurrent, const bool theReverse = false) const;
+ //! Erases the document structure.
+ ~Model_Document();
+
protected:
//! Returns (creates if needed) the general label
TDF_Label generalLabel() const;
#include <ModelAPI_Result.h>
#include <ModelAPI_ResultParameter.h>
-#include <TDocStd_Document.hxx>
#include <NCollection_DataMap.hxx>
#include <TDF_Label.hxx>
#include <TDF_LabelList.hxx>