From b0f6fb8fd96814f0bccf49eb108ea11321b985d1 Mon Sep 17 00:00:00 2001 From: isn Date: Fri, 27 Jan 2017 20:01:27 +0300 Subject: [PATCH] second ver of fix 1107 --- src/HYDROData/HYDROData_Entity.cxx | 10 +++++++++- src/HYDROData/HYDROData_Entity.h | 4 ++++ src/HYDROData/HYDROData_Object.cxx | 11 ++--------- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/src/HYDROData/HYDROData_Entity.cxx b/src/HYDROData/HYDROData_Entity.cxx index e5baa747..31ae1a67 100644 --- a/src/HYDROData/HYDROData_Entity.cxx +++ b/src/HYDROData/HYDROData_Entity.cxx @@ -334,7 +334,7 @@ void HYDROData_Entity::RemoveZLevel() void HYDROData_Entity::SetLabel( const TDF_Label& theLabel ) { - myLab = theLabel; + myLab = theLabel; } void HYDROData_Entity::SaveByteArray( const int theTag, @@ -840,3 +840,11 @@ int HYDROData_Entity::GetInteger( int theTag, int theDefValue ) const return anAttr->Get(); } + +bool HYDROData_Entity::CompareLabels(const Handle(HYDROData_Entity)& theOtherObj) +{ + if ( !theOtherObj.IsNull() ) + return this->Label() == theOtherObj->Label(); + return false; +} + diff --git a/src/HYDROData/HYDROData_Entity.h b/src/HYDROData/HYDROData_Entity.h index d82b3d7b..593f5855 100644 --- a/src/HYDROData/HYDROData_Entity.h +++ b/src/HYDROData/HYDROData_Entity.h @@ -411,6 +411,10 @@ protected: * \param theTag tag of a label that keeps the attribute (for 0 this is myLab) */ void ClearReferenceObjects( const int theTag = 0 ); + +public: + + virtual bool CompareLabels(const Handle(HYDROData_Entity)& theOtherObj); protected: diff --git a/src/HYDROData/HYDROData_Object.cxx b/src/HYDROData/HYDROData_Object.cxx index 4838908a..0f677624 100644 --- a/src/HYDROData/HYDROData_Object.cxx +++ b/src/HYDROData/HYDROData_Object.cxx @@ -26,7 +26,6 @@ #include #include #include -#include #include @@ -184,14 +183,8 @@ int HYDROData_Object::GetGroupId( const Handle(HYDROData_ShapesGroup)& theGroup { Handle(HYDROData_ShapesGroup) aGroup = Handle(HYDROData_ShapesGroup)::DownCast( aGroups.Value( i ) ); - - TCollection_AsciiString entry1; - TDF_Tool::Entry(aGroup->Label(),entry1); - - TCollection_AsciiString entry2; - TDF_Tool::Entry(theGroup->Label(),entry2); - - if ( entry1.IsEqual (entry2)/*IsEqual( theGroup, aGroup )*/ ) { + if ( theGroup->CompareLabels ( aGroup ) ) + { aRes = i - 1; break; } -- 2.39.2