]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
second ver of fix 1107
authorisn <isn@opencascade.com>
Fri, 27 Jan 2017 17:01:27 +0000 (20:01 +0300)
committerisn <isn@opencascade.com>
Fri, 27 Jan 2017 17:04:37 +0000 (20:04 +0300)
src/HYDROData/HYDROData_Entity.cxx
src/HYDROData/HYDROData_Entity.h
src/HYDROData/HYDROData_Object.cxx

index e5baa747adbcae0b0b23c6200e7f8644d4bb6c39..31ae1a67e1a81b309e886b75843b224c4c1c54cb 100644 (file)
@@ -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;
+} 
+
index d82b3d7b015ff69068a4ed005751b168ac47c105..593f5855562b8a8908bb2c51296fae1a6bd746e7 100644 (file)
@@ -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:
 
index 4838908a9f5c7bb25a332615ff42eb9f3c059d3b..0f6776241e7b4cf3fb4b1749f6d5d56820534db8 100644 (file)
@@ -26,7 +26,6 @@
 #include <TopoDS_Shape.hxx>
 #include <TDataStd_Integer.hxx>
 #include <TDataStd_Real.hxx>
-#include <TDF_Tool.hxx>
 
 #include <QColor>
 
@@ -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;
     }