void Model_Document::startOperation()
{
+ // check is it nested or not
+ if (myDoc->HasOpenCommand()) {
+ myIsNested = true;
+ }
// new command for this
myDoc->NewCommand();
// new command for all subs
// returns false if delta is empty and no transaction was made
myIsEmptyTr[myTransactionsAfterSave] = !myDoc->CommitCommand();
myTransactionsAfterSave++;
+ myIsNested = false;
// finish for all subs
set<string>::iterator aSubIter = mySubs.begin();
for(; aSubIter != mySubs.end(); aSubIter++)
{
myDoc->SetUndoLimit(UNDO_LIMIT);
myTransactionsAfterSave = 0;
+ myIsNested = false;
+ myDoc->SetNestedTransactionMode();
// to have something in the document and avoid empty doc open/save problem
TDataStd_Integer::Set(myDoc->Main().Father(), 0);
}
std::set<std::string> mySubs; ///< set of identifiers of sub-documents of this document
/// transaction indexes (related to myTransactionsAfterSave) which were empty in this doc
std::map<int, bool> myIsEmptyTr;
+ /// true if the current operation is nested
+ bool myIsNested;
};
#endif
PARTSETPLUGIN_EXPORT virtual boost::shared_ptr<ModelAPI_Document> documentToAdd();
+ /// Returns true if this feature must be displayed in the history (top level of Part tree)
+ PARTSETPLUGIN_EXPORT virtual bool isInHistory() {return false;}
+
/// Use plugin manager for features creation
PartSetPlugin_Part();
};