]> SALOME platform Git repositories - modules/smesh.git/blobdiff - src/DriverMED/DriverMED_Family.cxx
Salome HOME
Fix for Bug IPAL17943
[modules/smesh.git] / src / DriverMED / DriverMED_Family.cxx
index 25646c67c45a768ae471f0ae52ead8a38a70ef78..16363f8e63ee46d80c9c2188d80a5708758cbd0e 100644 (file)
@@ -129,16 +129,6 @@ DriverMED_Family
   return myElements.empty(); 
 }
 
-bool CompareColors( const SALOMEDS::Color& theColor, const SALOMEDS::Color& theRefColor )
-{
-  if( fabs( theColor.R - theRefColor.R ) < 0.01 &&
-      fabs( theColor.G - theRefColor.G ) < 0.01 &&
-      fabs( theColor.B - theRefColor.B ) < 0.01 )
-    return true;
-
-  return false;
-}
-
 //=============================================================================
 /*!
  *  Split each group from list <aGroups> on some parts (families)
@@ -211,37 +201,11 @@ DriverMED_Family
   }
 
   // Process groups
-  SMESHDS_GroupBasePtrList::const_iterator aGroupsIter;
-
-  int id = 0;
-  ColorMap aColorMap;
-  for (aGroupsIter = theGroups.begin(); aGroupsIter != theGroups.end(); aGroupsIter++)
-  {
-    Quantity_Color aQColor = (*aGroupsIter)->GetColor();
-    SALOMEDS::Color aColor;
-    aColor.R = aQColor.Red();
-    aColor.G = aQColor.Green();
-    aColor.B = aQColor.Blue();
-
-    bool isFound = false;
-    for (ColorMap::iterator aColorIter = aColorMap.begin(); aColorIter != aColorMap.end(); aColorIter++)
-    {
-      SALOMEDS::Color aRefColor = aColorIter->second;
-      if( CompareColors( aColor, aRefColor ) )
-      {
-       isFound = true;
-       break;
-      }
-    }
-
-    if( !isFound )
-      aColorMap[ id++ ] = aColor;
-  }
-
-  for (aGroupsIter = theGroups.begin(); aGroupsIter != theGroups.end(); aGroupsIter++)
+  SMESHDS_GroupBasePtrList::const_iterator aGroupsIter = theGroups.begin();
+  for (; aGroupsIter != theGroups.end(); aGroupsIter++)
   {
     DriverMED_FamilyPtr aFam2 (new DriverMED_Family);
-    aFam2->Init(*aGroupsIter, aColorMap);
+    aFam2->Init(*aGroupsIter);
 
     DriverMED_FamilyPtrList::iterator aFamsIter = aFamilies.begin();
     while (aFamsIter != aFamilies.end())
@@ -400,7 +364,7 @@ DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper,
  *  Initialize the tool by SMESHDS_GroupBase
  */
 //=============================================================================
-void DriverMED_Family::Init (SMESHDS_GroupBase* theGroup, const ColorMap& theColorMap)
+void DriverMED_Family::Init (SMESHDS_GroupBase* theGroup)
 {
   // Elements
   myElements.clear();
@@ -417,24 +381,8 @@ void DriverMED_Family::Init (SMESHDS_GroupBase* theGroup, const ColorMap& theCol
   myGroupNames.clear();
   myGroupNames.insert(string(theGroup->GetStoreName()));
 
-  myGroupAttributVal = 0;
-  
-  ColorMap::const_iterator aColorIter = theColorMap.begin();
-  for (; aColorIter != theColorMap.end(); aColorIter++)
-  {
-    Quantity_Color aGroupQColor = theGroup->GetColor();
-    SALOMEDS::Color aGroupColor;
-    aGroupColor.R = aGroupQColor.Red();
-    aGroupColor.G = aGroupQColor.Green();
-    aGroupColor.B = aGroupQColor.Blue();
-
-    SALOMEDS::Color aColor = aColorIter->second;
-    if( CompareColors( aGroupColor, aColor ) )
-    {
-      myGroupAttributVal = aColorIter->first;
-      break;
-    }
-  }
+  Quantity_Color aColor = theGroup->GetColor();
+  myGroupAttributVal = aColor.Hue();
 }
 
 //=============================================================================