Salome HOME
Color Number (Color Group) parameter is returned for compatibility
[modules/smesh.git] / src / SMESH_I / SMESH_Group_i.cxx
index 9c0a2f52f0459d4056901c69efc53f58ce77a5f6..9f4c705f3aadbe423ed1258ec8420e4b540d51ad 100644 (file)
@@ -16,7 +16,7 @@
 //  License along with this library; if not, write to the Free Software 
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
 // 
-//  See http://www.salome-platform.org or email : webmaster.salome@opencascade.org 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -419,6 +419,45 @@ GEOM::GEOM_Object_ptr SMESH_GroupOnGeom_i::GetShape()
   return aGeomObj._retn();
 }
 
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+SALOMEDS::Color SMESH_GroupBase_i::GetColor()
+{
+  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
+  if (aGroupDS)
+  {
+    Quantity_Color aQColor = aGroupDS->GetColor();
+    SALOMEDS::Color aColor;
+    aColor.R = aQColor.Red();
+    aColor.G = aQColor.Green();
+    aColor.B = aQColor.Blue();
+
+    return aColor;
+  }
+  MESSAGE("get color of a group");
+  return SALOMEDS::Color();
+}
+
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+void SMESH_GroupBase_i::SetColor(const SALOMEDS::Color& color)
+{
+  SMESHDS_GroupBase* aGroupDS = GetGroupDS();
+  if (aGroupDS)
+  {
+    Quantity_Color aQColor( color.R, color.G, color.B, Quantity_TOC_RGB );
+    return aGroupDS->SetColor(aQColor);
+  }
+  MESSAGE("set color of a group");
+  return ;
+}
+
 //=============================================================================
 /*!
  *
@@ -429,7 +468,7 @@ CORBA::Long SMESH_GroupBase_i::GetColorNumber()
   SMESHDS_GroupBase* aGroupDS = GetGroupDS();
   if (aGroupDS)
     return aGroupDS->GetColorGroup();
-  MESSAGE("get color number of a vague group");
+  MESSAGE("get color number of a group");
   return 0;
 }
 
@@ -443,9 +482,6 @@ void SMESH_GroupBase_i::SetColorNumber(CORBA::Long color)
   SMESHDS_GroupBase* aGroupDS = GetGroupDS();
   if (aGroupDS)
     return aGroupDS->SetColorGroup(color);
-  MESSAGE("set color number of a vague group");
+  MESSAGE("set color number of a group");
   return ;
 }
-
-
-