From: mpv Date: Tue, 22 Jul 2014 05:29:24 +0000 (+0400) Subject: Debug of remove feature X-Git-Tag: V_0.4.4~163 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=098d387a14241b83d60a96df1f736c205bac6206;p=modules%2Fshaper.git Debug of remove feature --- diff --git a/src/Model/Model_Document.cpp b/src/Model/Model_Document.cpp index 4ca962723..41c7e79bf 100644 --- a/src/Model/Model_Document.cpp +++ b/src/Model/Model_Document.cpp @@ -44,6 +44,21 @@ static const int TAG_HISTORY = 3; // tag of the history sub-tree (python dump) static const int TAG_FEATURE_ARGUMENTS = 1; ///< where the arguments are located static const int TAG_FEATURE_RESULTS = 2; ///< where the results are located + +Model_Document::Model_Document(const std::string theID) + : myID(theID), myDoc(new TDocStd_Document("BinOcaf")) // binary OCAF format +{ + myDoc->SetUndoLimit(UNDO_LIMIT); + myTransactionsAfterSave = 0; + myNestedNum = -1; + //myDoc->SetNestedTransactionMode(); + // to have something in the document and avoid empty doc open/save problem + // in transaction for nesting correct working + myDoc->NewCommand(); + TDataStd_Integer::Set(myDoc->Main().Father(), 0); + myDoc->CommitCommand(); +} + /// Returns the file name of this document by the nameof directory and identifuer of a document static TCollection_ExtendedString DocFileName(const char* theFileName, const std::string& theID) { @@ -426,7 +441,7 @@ void Model_Document::removeFeature(FeaturePtr theFeature) // erase all attributes under the label of feature aFeatureLabel.ForgetAllAttributes(); // remove it from the references array - RemoveFromRefArray(featuresLabel(), aData->label()); + RemoveFromRefArray(featuresLabel(), aFeatureLabel); // event: feature is deleted ModelAPI_EventCreator::get()->sendDeleted(theFeature->document(), ModelAPI_Feature::group()); @@ -536,20 +551,6 @@ int Model_Document::size(const std::string& theGroupID) return aResult; } -Model_Document::Model_Document(const std::string theID) - : myID(theID), myDoc(new TDocStd_Document("BinOcaf")) // binary OCAF format -{ - myDoc->SetUndoLimit(UNDO_LIMIT); - myTransactionsAfterSave = 0; - myNestedNum = -1; - //myDoc->SetNestedTransactionMode(); - // to have something in the document and avoid empty doc open/save problem - // in transaction for nesting correct working - myDoc->NewCommand(); - TDataStd_Integer::Set(myDoc->Main().Father(), 0); - myDoc->CommitCommand(); -} - TDF_Label Model_Document::featuresLabel() { return myDoc->Main().FindChild(TAG_OBJECTS);