From: isn Date: Fri, 27 Jan 2017 17:01:27 +0000 (+0300) Subject: second ver of fix 1107 X-Git-Tag: Salome_8_3_Hydro_1_1rc1~58^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=b0f6fb8fd96814f0bccf49eb108ea11321b985d1;p=modules%2Fhydro.git second ver of fix 1107 --- 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; }