Salome HOME
lots 3,8
[modules/hydro.git] / src / HYDROData / HYDROData_Entity.cxx
index a39e125b465d7ffd894dc2c959cb3cf8d33a04d3..cef1e9858eeda5bda18b73d5c8dd2c4bf1876176 100644 (file)
@@ -719,6 +719,25 @@ QColor HYDROData_Entity::GetColor( const QColor& theDefColor,
   return aResColor;
 }
 
+bool HYDROData_Entity::GetColor( QColor& theOutColor,
+                                 const int     theTag ) const
+{
+  TDF_Label aLabel = theTag == 0 ? myLab : myLab.FindChild( theTag );
+
+  Handle(TDataStd_IntegerArray) aColorArray;
+  if ( aLabel.FindAttribute( TDataStd_IntegerArray::GetID(), aColorArray ) )
+  {
+    theOutColor.setRed(   aColorArray->Value( 1 ) );
+    theOutColor.setGreen( aColorArray->Value( 2 ) );
+    theOutColor.setBlue(  aColorArray->Value( 3 ) );
+    theOutColor.setAlpha( aColorArray->Value( 4 ) );
+    return true;
+  }
+
+  return false;
+}
+
+
 QStringList HYDROData_Entity::dumpObjectCreation( MapOfTreatedObjects& theTreatedObjects ) const
 {
   QStringList aResList;