Salome HOME
TShell cannot be disconnected; use TCompound of shells/faces instead
[modules/hydro.git] / src / HYDROData / HYDROData_Document.cxx
index 93457716225fdd41c6166418d181343bae9f0950..ae714b1711df2aa8bfe97d4eaa02558813e14098 100644 (file)
@@ -21,6 +21,8 @@
 #include <HYDROData_Iterator.h>
 #include <HYDROData_Tool.h>
 #include <HYDROData_InterpolatorsFactory.h>
+#include <HYDROData_StricklerTable.h>
+#include <HYDROData_LandCoverMap.h>
 
 #include <TDataStd_Real.hxx>
 #include <TDataStd_Integer.hxx>
@@ -33,6 +35,7 @@
 #include <QFile>
 #include <QStringList>
 #include <QTextStream>
+#include <QColor>
 
 IMPLEMENT_STANDARD_HANDLE(HYDROData_Document,MMgt_TShared)
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_Document,MMgt_TShared)
@@ -868,3 +871,18 @@ NCollection_Sequence<TCollection_AsciiString> HYDROData_Document::GetInterpolato
 
   return aNames;
 }
+
+QColor HYDROData_Document::GetAssociatedColor( const QString& theStricklerType, const Handle(HYDROData_StricklerTable)& theTable ) const
+{
+  if( !theTable.IsNull() && theTable->HasType( theStricklerType ) )
+    return theTable->GetColor( theStricklerType );
+
+  HYDROData_Iterator anIt( this, KIND_STRICKLER_TABLE );
+  for( ; anIt.More(); anIt.Next() )
+  {
+    Handle(HYDROData_StricklerTable) aTable = Handle(HYDROData_StricklerTable)::DownCast( anIt.Current() );
+    if( aTable->HasType( theStricklerType ) )
+      return aTable->GetColor( theStricklerType );
+  }
+  return QColor();
+}
\ No newline at end of file