#include <TDF_ListIteratorOfAttributeDeltaList.hxx>
#include <TDF_ListIteratorOfLabelList.hxx>
#include <TDF_LabelMap.hxx>
+#include <TDF_DeltaOnAddition.hxx>
+#include <TNaming_Builder.hxx>
#include <TNaming_SameShapeIterator.hxx>
#include <TNaming_Iterator.hxx>
#include <TNaming_NamedShape.hxx>
: myID(theID), myKind(theKind), myIsActive(false),
myDoc(new TDocStd_Document("BinOcaf")) // binary OCAF format
{
-#ifdef DFBROWSER
+#ifdef TINSPECTOR
CDF_Session::CurrentSession()->Directory()->Add(myDoc);
#endif
myObjs = new Model_Objects(myDoc->Main());
if (!isError) {
myDoc = aLoaded;
myDoc->SetUndoLimit(UNDO_LIMIT);
+
// to avoid the problem that feature is created in the current, not this, document
aSession->setActiveDocument(anApp->document(myID), false);
aSession->setCheckTransactions(false);
if (anArr1.IsNull() || anArr2.IsNull())
return false;
if (anArr1->Lower() == anArr2->Lower() && anArr1->Upper() == anArr2->Upper()) {
- for(int a = anArr1->Lower(); a <= anArr1->Upper(); a++)
- if (a != 1 && anArr1->Value(a) != anArr2->Value(a)) // second is for display
+ for(int a = anArr1->Lower(); a <= anArr1->Upper(); a++) {
+ if (a == 1 && // second is for display
+ anArr2->Label().Tag() == 1 && (anArr2->Label().Depth() == 4 ||
+ anArr2->Label().Depth() == 6))
+ continue;
+ if (anArr1->Value(a) != anArr2->Value(a))
return false;
+ }
return true;
}
} else if (Standard_GUID::IsEqual(theAttr1->ID(), TDataStd_IntegerArray::GetID())) {
for (; aSubIter != aSubs.end(); aSubIter++)
subDoc(*aSubIter)->abortOperation();
// references may be changed because they are set in attributes on the fly
- myObjs->synchronizeFeatures(aDeltaLabels, true, false, isRoot());
+ myObjs->synchronizeFeatures(aDeltaLabels, true, false, false, isRoot());
}
bool Model_Document::isOperation() const
}
// after undo of all sub-documents to avoid updates on not-modified data (issue 370)
if (theSynchronize) {
- myObjs->synchronizeFeatures(aDeltaLabels, true, false, isRoot());
+ myObjs->synchronizeFeatures(aDeltaLabels, true, false, false, isRoot());
// update the current features status
setCurrentFeature(currentFeature(false), false);
}
subDoc(*aSubIter)->redo();
// after redo of all sub-documents to avoid updates on not-modified data (issue 370)
- myObjs->synchronizeFeatures(aDeltaLabels, true, false, isRoot());
+ myObjs->synchronizeFeatures(aDeltaLabels, true, false, false, isRoot());
// update the current features status
setCurrentFeature(currentFeature(false), false);
}
if (aName->Get() == aSubName)
return aName->Label();
}
+ // If not found child label with the exact sub-name, then try to find compound with
+ // such sub-name without suffix.
+ Standard_Integer aSuffixPos = aSubName.SearchFromEnd('_');
+ if (aSuffixPos != -1) {
+ TCollection_ExtendedString anIndexStr = aSubName.Split(aSuffixPos);
+ aSubName.Remove(aSuffixPos);
+ aNamesIter.Initialize(aFind->second, TDataStd_Name::GetID(), Standard_True);
+ for(; aNamesIter.More(); aNamesIter.Next()) {
+ Handle(TDataStd_Name) aName = Handle(TDataStd_Name)::DownCast(aNamesIter.Value());
+ if (aName->Get() == aSubName) {
+ return aName->Label();
+ }
+ }
+ }
}
}
return TDF_Label(); // not found