#include <TDataStd_Comment.hxx>
#include <TDF_ChildIDIterator.hxx>
#include <TDataStd_ReferenceArray.hxx>
+#include <TDataStd_ReferenceList.hxx>
#include <TDataStd_IntegerArray.hxx>
#include <TDataStd_HLabelArray1.hxx>
#include <TDataStd_Name.hxx>
+#include <TDataStd_AsciiString.hxx>
#include <TDF_Reference.hxx>
#include <TDF_ChildIDIterator.hxx>
#include <TDF_LabelMapHasher.hxx>
return false;
if (anArr1->Lower() == anArr2->Lower() && anArr1->Upper() == anArr2->Upper()) {
for(int a = anArr1->Lower(); a <= anArr1->Upper(); a++)
- if (anArr1->Value(a) != anArr2->Value(a))
+ if (a != 1 && anArr1->Value(a) != anArr2->Value(a)) // second is for display
return false;
return true;
}
}
return true;
}
+ } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDataStd_ReferenceArray::GetID())) {
+ Handle(TDataStd_ReferenceArray) anArr1 = Handle(TDataStd_ReferenceArray)::DownCast(theAttr1);
+ Handle(TDataStd_ReferenceArray) anArr2 = Handle(TDataStd_ReferenceArray)::DownCast(theAttr2);
+ if (anArr1.IsNull() && anArr2.IsNull())
+ return true;
+ 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 (anArr1->Value(a) != anArr2->Value(a)) {
+ // avoid the transaction ID checking
+ if (a == 2 && anArr1->Upper() == 2 && anArr2->Label().Tag() == 1 &&
+ (anArr2->Label().Depth() == 4 || anArr2->Label().Depth() == 6))
+ continue;
+ return false;
+ }
+ return true;
+ }
+ } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDataStd_ReferenceList::GetID())) {
+ Handle(TDataStd_ReferenceList) aList1 = Handle(TDataStd_ReferenceList)::DownCast(theAttr1);
+ Handle(TDataStd_ReferenceList) aList2= Handle(TDataStd_ReferenceList)::DownCast(theAttr2);
+ if (aList1.IsNull() && aList2.IsNull())
+ return true;
+ if (aList1.IsNull() || aList2.IsNull())
+ return false;
+ const TDF_LabelList& aLList1 = aList1->List();
+ const TDF_LabelList& aLList2 = aList2->List();
+ TDF_ListIteratorOfLabelList aLIter1(aLList1);
+ TDF_ListIteratorOfLabelList aLIter2(aLList2);
+ for(; aLIter1.More() && aLIter2.More(); aLIter1.Next(), aLIter2.Next()) {
+ if (aLIter1.Value() != aLIter2.Value())
+ return false;
+ }
+ return !aLIter1.More() && !aLIter2.More(); // both lists are with the same size
+ } else if (Standard_GUID::IsEqual(theAttr1->ID(), TDF_TagSource::GetID())) {
+ return true; // it just for created and removed feature: nothing is changed
}
return false;
}
if (isEqualContent(anADelta->Attribute(), aCurrentAttr)) {
continue; // attribute is not changed actually
}
+ } else if (Standard_GUID::IsEqual(anADelta->Attribute()->ID(), TDataStd_AsciiString::GetID())) {
+ continue; // error message is disappeared
}
}
return false;
{
if (!data()->isValid()) // sketch is already removed (case on undo of sketch), sync is not needed
return;
- // to keep the persistent sub-elements indexing, do not remove elements from list,
- // but substitute by nulls
- reflist(SketchPlugin_Sketch::FEATURES_ID())->substitute(theFeature, ObjectPtr());
+ AttributeRefListPtr aList = reflist(SketchPlugin_Sketch::FEATURES_ID());
+ // if the object is last, remove it from the list (needed to skip empty transaction on edit of sketch feature)
+ if (aList->object(aList->size(true) - 1, true) == theFeature) {
+ aList->remove(theFeature);
+ } else {
+ // to keep the persistent sub-elements indexing, do not remove elements from list,
+ // but substitute by nulls
+ aList->substitute(theFeature, ObjectPtr());
+ }
}
int SketchPlugin_Sketch::numberOfSubs(bool forTree) const