1 // File: Model_Document.cxx
2 // Created: 28 Feb 2014
3 // Author: Mikhail PONIKAROV
5 #include <Model_Document.h>
6 #include <ModelAPI_Feature.h>
7 #include <Model_Data.h>
8 #include <Model_Object.h>
9 #include <Model_Application.h>
10 #include <Model_PluginManager.h>
11 #include <Model_Events.h>
12 #include <Events_Loop.h>
13 #include <Events_Error.h>
15 #include <TDataStd_Integer.hxx>
16 #include <TDataStd_Comment.hxx>
17 #include <TDF_ChildIDIterator.hxx>
18 #include <TDataStd_ReferenceArray.hxx>
19 #include <TDataStd_HLabelArray1.hxx>
20 #include <TDataStd_Name.hxx>
28 # define _separator_ '\\'
30 # define _separator_ '/'
33 static const int UNDO_LIMIT = 10; // number of possible undo operations
35 static const int TAG_GENERAL = 1; // general properties tag
36 static const int TAG_OBJECTS = 2; // tag of the objects sub-tree (features)
37 static const int TAG_HISTORY = 3; // tag of the history sub-tree (python dump)
41 /// Returns the file name of this document by the nameof directory and identifuer of a document
42 static TCollection_ExtendedString DocFileName(const char* theFileName, const string& theID)
44 TCollection_ExtendedString aPath ((const Standard_CString)theFileName);
46 aPath += theID.c_str();
47 aPath += ".cbf"; // standard binary file extension
51 bool Model_Document::load(const char* theFileName)
53 Handle(Model_Application) anApp = Model_Application::getApplication();
54 if (this == Model_PluginManager::get()->rootDocument().get()) {
55 anApp->setLoadPath(theFileName);
57 TCollection_ExtendedString aPath (DocFileName(theFileName, myID));
58 PCDM_ReaderStatus aStatus = (PCDM_ReaderStatus) -1;
61 aStatus = anApp->Open(aPath, myDoc);
63 catch (Standard_Failure)
65 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
66 Events_Error::send(string("Exception in opening of document: ") + aFail->GetMessageString());
69 bool isError = aStatus != PCDM_RS_OK;
74 case PCDM_RS_UnknownDocument:
75 Events_Error::send(string("Can not open document: PCDM_RS_UnknownDocument")); break;
76 case PCDM_RS_AlreadyRetrieved:
77 Events_Error::send(string("Can not open document: PCDM_RS_AlreadyRetrieved")); break;
78 case PCDM_RS_AlreadyRetrievedAndModified:
79 Events_Error::send(string("Can not open document: PCDM_RS_AlreadyRetrievedAndModified")); break;
80 case PCDM_RS_NoDriver:
81 Events_Error::send(string("Can not open document: PCDM_RS_NoDriver")); break;
82 case PCDM_RS_UnknownFileDriver:
83 Events_Error::send(string("Can not open document: PCDM_RS_UnknownFileDriver")); break;
84 case PCDM_RS_OpenError:
85 Events_Error::send(string("Can not open document: PCDM_RS_OpenError")); break;
86 case PCDM_RS_NoVersion:
87 Events_Error::send(string("Can not open document: PCDM_RS_NoVersion")); break;
89 Events_Error::send(string("Can not open document: PCDM_RS_NoModel")); break;
90 case PCDM_RS_NoDocument:
91 Events_Error::send(string("Can not open document: PCDM_RS_NoDocument")); break;
92 case PCDM_RS_FormatFailure:
93 Events_Error::send(string("Can not open document: PCDM_RS_FormatFailure")); break;
94 case PCDM_RS_TypeNotFoundInSchema:
95 Events_Error::send(string("Can not open document: PCDM_RS_TypeNotFoundInSchema")); break;
96 case PCDM_RS_UnrecognizedFileFormat:
97 Events_Error::send(string("Can not open document: PCDM_RS_UnrecognizedFileFormat")); break;
98 case PCDM_RS_MakeFailure:
99 Events_Error::send(string("Can not open document: PCDM_RS_MakeFailure")); break;
100 case PCDM_RS_PermissionDenied:
101 Events_Error::send(string("Can not open document: PCDM_RS_PermissionDenied")); break;
102 case PCDM_RS_DriverFailure:
103 Events_Error::send(string("Can not open document: PCDM_RS_DriverFailure")); break;
105 Events_Error::send(string("Can not open document: unknown error")); break;
109 myDoc->SetUndoLimit(UNDO_LIMIT);
110 synchronizeFeatures();
115 bool Model_Document::save(const char* theFileName)
117 // create a directory in the root document if it is not yet exist
118 if (this == Model_PluginManager::get()->rootDocument().get()) {
120 CreateDirectory(theFileName, NULL);
122 mkdir(theFileName, 0x1ff);
125 // filename in the dir is id of document inside of the given directory
126 TCollection_ExtendedString aPath(DocFileName(theFileName, myID));
127 PCDM_StoreStatus aStatus;
129 aStatus = Model_Application::getApplication()->SaveAs(myDoc, aPath);
131 catch (Standard_Failure) {
132 Handle(Standard_Failure) aFail = Standard_Failure::Caught();
133 Events_Error::send(string("Exception in saving of document: ") + aFail->GetMessageString());
136 bool isDone = aStatus == PCDM_SS_OK || aStatus == PCDM_SS_No_Obj;
141 case PCDM_SS_DriverFailure:
142 Events_Error::send(string("Can not save document: PCDM_SS_DriverFailure"));
144 case PCDM_SS_WriteFailure:
145 Events_Error::send(string("Can not save document: PCDM_SS_WriteFailure"));
147 case PCDM_SS_Failure:
149 Events_Error::send(string("Can not save document: PCDM_SS_Failure"));
153 myTransactionsAfterSave = 0;
154 if (isDone) { // save also sub-documents if any
155 set<string>::iterator aSubIter = mySubs.begin();
156 for(; aSubIter != mySubs.end() && isDone; aSubIter++)
157 isDone = subDocument(*aSubIter)->save(theFileName);
162 void Model_Document::close()
164 boost::shared_ptr<ModelAPI_PluginManager> aPM = Model_PluginManager::get();
165 if (this != aPM->rootDocument().get() &&
166 this == aPM->currentDocument().get()) {
167 aPM->setCurrentDocument(aPM->rootDocument());
170 set<string>::iterator aSubIter = mySubs.begin();
171 for(; aSubIter != mySubs.end(); aSubIter++)
172 subDocument(*aSubIter)->close();
175 /* do not close because it can be undoed
176 if (myDoc->CanClose() == CDM_CCS_OK)
178 Model_Application::getApplication()->deleteDocument(myID);
182 void Model_Document::startOperation()
184 if (myDoc->HasOpenCommand()) { // start of nested command
185 if (myNestedNum == -1) {
187 myDoc->InitDeltaCompaction();
189 myIsEmptyTr[myTransactionsAfterSave] = false;
190 myTransactionsAfterSave++;
192 } else { // start of simple command
195 // new command for all subs
196 set<string>::iterator aSubIter = mySubs.begin();
197 for(; aSubIter != mySubs.end(); aSubIter++)
198 subDocument(*aSubIter)->startOperation();
201 void Model_Document::compactNested() {
202 while(myNestedNum != -1) {
203 myTransactionsAfterSave--;
204 myIsEmptyTr.erase(myTransactionsAfterSave);
207 myIsEmptyTr[myTransactionsAfterSave] = false;
208 myTransactionsAfterSave++;
209 myDoc->PerformDeltaCompaction();
212 void Model_Document::finishOperation()
214 // just to be sure that everybody knows that changes were performed
215 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_CREATED));
216 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED));
217 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_DELETED));
219 if (myNestedNum != -1) // this nested transaction is owervritten
221 if (!myDoc->HasOpenCommand()) {
222 if (myNestedNum != -1) {
227 // returns false if delta is empty and no transaction was made
228 myIsEmptyTr[myTransactionsAfterSave] = !myDoc->CommitCommand() && (myNestedNum == -1);
229 myTransactionsAfterSave++;
232 // finish for all subs
233 set<string>::iterator aSubIter = mySubs.begin();
234 for(; aSubIter != mySubs.end(); aSubIter++)
235 subDocument(*aSubIter)->finishOperation();
238 void Model_Document::abortOperation()
240 if (myNestedNum > 0 && !myDoc->HasOpenCommand()) { // abort all what was done in nested
241 // first compact all nested
243 // for nested it is undo and clear redos
246 myTransactionsAfterSave--;
247 myIsEmptyTr.erase(myTransactionsAfterSave);
249 if (myNestedNum == 0) // abort only high-level
251 myDoc->AbortCommand();
253 synchronizeFeatures(true);
254 // abort for all subs
255 set<string>::iterator aSubIter = mySubs.begin();
256 for(; aSubIter != mySubs.end(); aSubIter++)
257 subDocument(*aSubIter)->abortOperation();
260 bool Model_Document::isOperation()
262 // operation is opened for all documents: no need to check subs
263 return myDoc->HasOpenCommand() == Standard_True;
266 bool Model_Document::isModified()
268 // is modified if at least one operation was commited and not undoed
269 return myTransactionsAfterSave > 0;
272 bool Model_Document::canUndo()
274 if (myDoc->GetAvailableUndos() > 0 && myNestedNum != 0 && myTransactionsAfterSave != 0 /* for omitting the first useless transaction */)
276 // check other subs contains operation that can be undoed
277 set<string>::iterator aSubIter = mySubs.begin();
278 for(; aSubIter != mySubs.end(); aSubIter++)
279 if (subDocument(*aSubIter)->canUndo())
284 void Model_Document::undo()
286 myTransactionsAfterSave--;
287 if (myNestedNum > 0) myNestedNum--;
288 if (!myIsEmptyTr[myTransactionsAfterSave])
290 synchronizeFeatures(true);
292 set<string>::iterator aSubIter = mySubs.begin();
293 for(; aSubIter != mySubs.end(); aSubIter++)
294 subDocument(*aSubIter)->undo();
297 bool Model_Document::canRedo()
299 if (myDoc->GetAvailableRedos() > 0)
301 // check other subs contains operation that can be redoed
302 set<string>::iterator aSubIter = mySubs.begin();
303 for(; aSubIter != mySubs.end(); aSubIter++)
304 if (subDocument(*aSubIter)->canRedo())
309 void Model_Document::redo()
311 if (myNestedNum != -1) myNestedNum++;
312 if (!myIsEmptyTr[myTransactionsAfterSave])
314 myTransactionsAfterSave++;
315 synchronizeFeatures(true);
317 set<string>::iterator aSubIter = mySubs.begin();
318 for(; aSubIter != mySubs.end(); aSubIter++)
319 subDocument(*aSubIter)->redo();
322 FeaturePtr Model_Document::addFeature(string theID)
324 FeaturePtr aFeature =
325 ModelAPI_PluginManager::get()->createFeature(theID);
327 boost::dynamic_pointer_cast<Model_Document>(aFeature->documentToAdd())->addFeature(aFeature);
329 // TODO: generate error that feature is not created
334 /// Appenad to the array of references a new referenced label
335 static void AddToRefArray(TDF_Label& theArrayLab, TDF_Label& theReferenced) {
336 Handle(TDataStd_ReferenceArray) aRefs;
337 if (!theArrayLab.FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs)) {
338 aRefs = TDataStd_ReferenceArray::Set(theArrayLab, 0, 0);
339 aRefs->SetValue(0, theReferenced);
340 } else { // extend array by one more element
341 Handle(TDataStd_HLabelArray1) aNewArray =
342 new TDataStd_HLabelArray1(aRefs->Lower(), aRefs->Upper() + 1);
343 for(int a = aRefs->Lower(); a <= aRefs->Upper(); a++) {
344 aNewArray->SetValue(a, aRefs->Value(a));
346 aNewArray->SetValue(aRefs->Upper() + 1, theReferenced);
347 aRefs->SetInternalArray(aNewArray);
351 void Model_Document::addFeature(const FeaturePtr theFeature)
353 if (theFeature->isAction()) return; // do not add action to the data model
355 boost::shared_ptr<ModelAPI_Document> aThis =
356 Model_Application::getApplication()->getDocument(myID);
357 TDF_Label aFeaturesLab = groupLabel(FEATURES_GROUP);
358 TDF_Label aFeatureLab = aFeaturesLab.NewChild();
360 // organize feature and data objects
361 boost::shared_ptr<Model_Data> aData(new Model_Data);
362 aData->setFeature(theFeature);
363 aData->setLabel(aFeatureLab);
364 theFeature->setDoc(aThis);
365 theFeature->setData(aData);
366 setUniqueName(theFeature);
367 theFeature->initAttributes();
369 // keep the feature ID to restore document later correctly
370 TDataStd_Comment::Set(aFeatureLab, theFeature->getKind().c_str());
371 myFeatures.push_back(theFeature);
372 // store feature in the history of features array
373 if (theFeature->isInHistory()) {
374 AddToRefArray(aFeaturesLab, aFeatureLab);
376 // add featue to the group
377 const std::string& aGroup = theFeature->getGroup();
378 TDF_Label aGroupLab = groupLabel(aGroup);
379 AddToRefArray(aGroupLab, aFeatureLab);
380 // new name of this feature object by default equal to name of feature
381 TDF_Label anObjLab = aGroupLab.NewChild();
382 TCollection_ExtendedString aName(theFeature->data()->getName().c_str());
383 TDataStd_Name::Set(anObjLab, aName);
384 TDF_Label aGrLabChild = aGroupLab.FindChild(1);
385 AddToRefArray(aGrLabChild, anObjLab); // reference to names is on the first sub
387 // event: feature is added
388 static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_CREATED);
389 Model_FeatureUpdatedMessage aMsg(theFeature, anEvent);
390 Events_Loop::loop()->send(aMsg);
393 /// Appenad to the array of references a new referenced label.
394 /// If theIndex is not -1, removes element at thisindex, not theReferenced.
395 /// \returns the index of removed element
396 static int RemoveFromRefArray(
397 TDF_Label theArrayLab, TDF_Label theReferenced, const int theIndex = -1) {
398 int aResult = -1; // no returned
399 Handle(TDataStd_ReferenceArray) aRefs;
400 if (theArrayLab.FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs)) {
401 if (aRefs->Length() == 1) { // just erase an array
402 if ((theIndex == -1 && aRefs->Value(0) == theReferenced) || theIndex == 0) {
403 theArrayLab.ForgetAttribute(TDataStd_ReferenceArray::GetID());
406 } else { // reduce the array
407 Handle(TDataStd_HLabelArray1) aNewArray =
408 new TDataStd_HLabelArray1(aRefs->Lower(), aRefs->Upper() - 1);
409 int aCount = aRefs->Lower();
410 for(int a = aCount; a <= aRefs->Upper(); a++, aCount++) {
411 if ((theIndex == -1 && aRefs->Value(a) == theReferenced) || theIndex == a) {
415 aNewArray->SetValue(aCount, aRefs->Value(a));
418 aRefs->SetInternalArray(aNewArray);
424 void Model_Document::removeFeature(FeaturePtr theFeature)
426 boost::shared_ptr<Model_Data> aData = boost::static_pointer_cast<Model_Data>(theFeature->data());
427 TDF_Label aFeatureLabel = aData->label();
429 TDF_Label aGroupLabel = groupLabel(theFeature->getGroup());
430 int aRemovedIndex = RemoveFromRefArray(aGroupLabel, aFeatureLabel);
431 RemoveFromRefArray(aGroupLabel.FindChild(1), TDF_Label(), aRemovedIndex);
432 // remove feature from the myFeatures list
433 std::vector<FeaturePtr >::iterator aFIter = myFeatures.begin();
434 while(aFIter != myFeatures.end()) {
435 if (*aFIter == theFeature) {
436 aFIter = myFeatures.erase(aFIter);
441 // erase all attributes under the label of feature
442 aFeatureLabel.ForgetAllAttributes();
443 // remove it from the references array
444 RemoveFromRefArray(groupLabel(FEATURES_GROUP), aData->label());
446 // event: feature is added
447 Model_FeatureDeletedMessage aMsg(theFeature->document(), theFeature->getGroup());
448 Events_Loop::loop()->send(aMsg);
451 FeaturePtr Model_Document::feature(TDF_Label& theLabel)
453 // iterate all features, may be optimized later by keeping labels-map
454 vector<FeaturePtr >::iterator aFIter = myFeatures.begin();
455 for(; aFIter != myFeatures.end(); aFIter++) {
456 boost::shared_ptr<Model_Data> aData =
457 boost::dynamic_pointer_cast<Model_Data>((*aFIter)->data());
458 if (aData->label().IsEqual(theLabel))
461 return FeaturePtr(); // not found
464 boost::shared_ptr<ModelAPI_Document> Model_Document::subDocument(string theDocID)
466 // just store sub-document identifier here to manage it later
467 if (mySubs.find(theDocID) == mySubs.end())
468 mySubs.insert(theDocID);
469 return Model_Application::getApplication()->getDocument(theDocID);
472 FeaturePtr Model_Document::feature(
473 const string& theGroupID, const int theIndex, const bool isOperation)
475 TDF_Label aGroupLab = groupLabel(theGroupID);
476 Handle(TDataStd_ReferenceArray) aRefs;
477 if (aGroupLab.FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs)) {
478 if (aRefs->Lower() <= theIndex && aRefs->Upper() >= theIndex) {
479 TDF_Label aFeatureLab = aRefs->Value(theIndex);
480 FeaturePtr aFeature = feature(aFeatureLab);
482 if (theGroupID == FEATURES_GROUP || isOperation) { // just returns the feature from the history
484 } else { // create a new object from the group to return it
485 Handle(TDataStd_Name) aName; // name of the object
486 if (aGroupLab.FindChild(1).FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs))
487 aRefs->Value(theIndex).FindAttribute(TDataStd_Name::GetID(), aName);
488 boost::shared_ptr<Model_Object> anObj(new Model_Object(aFeature, aName));
498 int Model_Document::size(const string& theGroupID)
500 Handle(TDataStd_ReferenceArray) aRefs;
501 if (groupLabel(theGroupID).FindAttribute(TDataStd_ReferenceArray::GetID(), aRefs))
502 return aRefs->Length();
503 // group is not found
507 Model_Document::Model_Document(const std::string theID)
508 : myID(theID), myDoc(new TDocStd_Document("BinOcaf")) // binary OCAF format
510 myDoc->SetUndoLimit(UNDO_LIMIT);
511 myTransactionsAfterSave = 0;
513 //myDoc->SetNestedTransactionMode();
514 // to have something in the document and avoid empty doc open/save problem
515 // in transaction for nesting correct working
517 TDataStd_Integer::Set(myDoc->Main().Father(), 0);
518 myDoc->CommitCommand();
521 TDF_Label Model_Document::groupLabel(const string theGroup)
523 // searching for existing
524 TCollection_ExtendedString aGroup(theGroup.c_str());
525 TDF_ChildIDIterator aGroupIter(myDoc->Main().FindChild(TAG_OBJECTS), TDataStd_Comment::GetID());
526 for(; aGroupIter.More(); aGroupIter.Next()) {
527 Handle(TDataStd_Comment) aName = Handle(TDataStd_Comment)::DownCast(aGroupIter.Value());
528 if (aName->Get() == aGroup)
529 return aGroupIter.Value()->Label();
532 TDF_Label aNew = myDoc->Main().FindChild(TAG_OBJECTS).NewChild();
533 TDataStd_Comment::Set(aNew, aGroup);
537 void Model_Document::setUniqueName(FeaturePtr theFeature)
539 string aName; // result
540 // iterate all features but also iterate group of this feature if object is not in history
541 list<string> aGroups;
542 aGroups.push_back(FEATURES_GROUP);
543 if (!theFeature->isInHistory()) {
544 aGroups.push_back(theFeature->getGroup());
546 for(list<string>::iterator aGIter = aGroups.begin(); aGIter != aGroups.end(); aGIter++) {
547 // first count all objects of such kind to start with index = count + 1
548 int a, aNumObjects = 0;
549 int aSize = size(*aGIter);
550 for(a = 0; a < aSize; a++) {
551 if (feature(*aGIter, a)->getKind() == theFeature->getKind())
554 // generate candidate name
555 stringstream aNameStream;
556 aNameStream<<theFeature->getKind()<<"_"<<aNumObjects + 1;
557 aName = aNameStream.str();
558 // check this is unique, if not, increase index by 1
559 for(a = 0; a < aSize;) {
560 if (feature(*aGIter, a, true)->data()->getName() == aName) {
562 stringstream aNameStream;
563 aNameStream<<theFeature->getKind()<<"_"<<aNumObjects + 1;
564 aName = aNameStream.str();
565 // reinitialize iterator to make sure a new name is unique
570 theFeature->data()->setName(aName);
573 //! Returns the object by the feature
574 FeaturePtr Model_Document::objectByFeature(
575 const FeaturePtr theFeature)
577 for(int a = 0; a < size(theFeature->getGroup()); a++) {
578 boost::shared_ptr<Model_Object> anObj =
579 boost::dynamic_pointer_cast<Model_Object>(feature(theFeature->getGroup(), a));
580 if (anObj && anObj->featureRef() == theFeature) {
584 return FeaturePtr(); // not found
587 void Model_Document::synchronizeFeatures(const bool theMarkUpdated)
589 boost::shared_ptr<ModelAPI_Document> aThis = Model_Application::getApplication()->getDocument(myID);
591 vector<FeaturePtr >::iterator aFIter = myFeatures.begin();
592 // and in parallel iterate labels of features
593 TDF_ChildIDIterator aFLabIter(groupLabel(FEATURES_GROUP), TDataStd_Comment::GetID());
594 while(aFIter != myFeatures.end() || aFLabIter.More()) {
595 static const int INFINITE_TAG = INT_MAX; // no label means that it exists somwhere in infinite
596 int aFeatureTag = INFINITE_TAG;
597 if (aFIter != myFeatures.end()) { // existing tag for feature
598 boost::shared_ptr<Model_Data> aData = boost::dynamic_pointer_cast<Model_Data>((*aFIter)->data());
599 aFeatureTag = aData->label().Tag();
601 int aDSTag = INFINITE_TAG;
602 if (aFLabIter.More()) { // next label in DS is existing
603 aDSTag = aFLabIter.Value()->Label().Tag();
605 if (aDSTag > aFeatureTag) { // feature is removed
606 FeaturePtr aFeature = *aFIter;
607 aFIter = myFeatures.erase(aFIter);
608 // event: model is updated
609 if (aFeature->isInHistory()) {
610 Model_FeatureDeletedMessage aMsg1(aThis, FEATURES_GROUP);
611 Events_Loop::loop()->send(aMsg1);
613 Model_FeatureDeletedMessage aMsg2(aThis, aFeature->getGroup());
614 Events_Loop::loop()->send(aMsg2);
615 } else if (aDSTag < aFeatureTag) { // a new feature is inserted
617 FeaturePtr aFeature = ModelAPI_PluginManager::get()->createFeature(
618 TCollection_AsciiString(Handle(TDataStd_Comment)::DownCast(
619 aFLabIter.Value())->Get()).ToCString());
621 if (aFIter == myFeatures.end()) { // must be before "setData" to redo the sketch line correctly
622 myFeatures.push_back(aFeature);
623 aFIter = myFeatures.end();
626 myFeatures.insert(aFIter, aFeature);
628 boost::shared_ptr<Model_Data> aData(new Model_Data);
629 TDF_Label aLab = aFLabIter.Value()->Label();
630 aData->setLabel(aLab);
631 aData->setFeature(aFeature);
632 aFeature->setDoc(aThis);
633 aFeature->setData(aData);
634 aFeature->initAttributes();
636 // event: model is updated
637 static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_CREATED);
638 Model_FeatureUpdatedMessage aMsg1(aFeature, anEvent);
639 Events_Loop::loop()->send(aMsg1);
640 FeaturePtr anObj = objectByFeature(aFeature);
642 Model_FeatureUpdatedMessage aMsg2(anObj, anEvent);
643 Events_Loop::loop()->send(aMsg2);
646 // feature for this label is added, so go to the next label
648 } else { // nothing is changed, both iterators are incremented
649 if (theMarkUpdated) {
650 static Events_ID anEvent = Events_Loop::eventByName(EVENT_FEATURE_UPDATED);
651 Model_FeatureUpdatedMessage aMsg(*aFIter, anEvent);
652 Events_Loop::loop()->send(aMsg);
658 // after all updates, sends a message that groups of features were created or updated
659 boost::static_pointer_cast<Model_PluginManager>(Model_PluginManager::get())->
660 setCheckTransactions(false);
661 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_CREATED));
663 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_UPDATED));
664 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_FEATURE_DELETED));
665 boost::static_pointer_cast<Model_PluginManager>(Model_PluginManager::get())->
666 setCheckTransactions(true);