return myObjs->removeFromFolder(theFeatures, theBefore);
}
+void Model_Document::setCreateHistory(const bool isToCreateHistory)
+{
+ myObjs->myCreateHistory = isToCreateHistory;
+}
+
std::shared_ptr<ModelAPI_Feature> Model_Document::feature(
const std::shared_ptr<ModelAPI_Result>& theResult)
{
const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
const bool theBefore = true);
+ //! Set create or not history flag (for performance reasons)
+ //! If flag is false, history in not created and Object Browser will not contain any objects
+ MODEL_EXPORT virtual void setCreateHistory(const bool isToCreateHistory);
+
///! Returns true if parametric updater need to execute feature on recomputation
///! On abort, undo or redo it is not necessary: results in document are updated automatically
bool executeFeatures() {return myExecuteFeatures;}
/// 0:1:2:N:1 - data of the feature N
/// 0:1:2:N:2:K:1 - data of the K result of the feature N
-Model_Objects::Model_Objects(TDF_Label theMainLab) : myMain(theMainLab)
+Model_Objects::Model_Objects(TDF_Label theMainLab) : myMain(theMainLab), myCreateHistory(true)
{
}
void Model_Objects::createHistory(const std::string& theGroupID)
{
+ if (!myCreateHistory)
+ return;
+
std::map<std::string, std::vector<ObjectPtr> >::iterator aHIter = myHistory.find(theGroupID);
if (aHIter == myHistory.end()) {
std::vector<ObjectPtr> aResult;
/// Each array is updated by demand from scratch, by browsing all the features in the history.
std::map<std::string, std::vector<ObjectPtr> > myHistory;
+ /// Flag to create or not history (for performance reason)
+ bool myCreateHistory;
+
friend class Model_Document;
friend class Model_Session;
friend class Model_Update;
const std::list<std::shared_ptr<ModelAPI_Feature> >& theFeatures,
const bool theBefore = true) = 0;
+ //! Set create or not history flag (for performance reasons)
+ //! If flag is false, history in not created and Object Browser will not contain any objects
+ virtual void setCreateHistory(const bool isToCreateHistory) = 0;
+
//! Informs the document that it becomes active and some actions must be performed
virtual void setActive(const bool theFlag) = 0;
//! Returns true if this document is currently active