Salome HOME
TShell cannot be disconnected; use TCompound of shells/faces instead
[modules/hydro.git] / src / HYDROData / HYDROData_Document.cxx
index 0cf4c403258ebc2c8dffdbf4913aca7922b66b57..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)
@@ -267,6 +270,7 @@ bool HYDROData_Document::DumpToPython( const QString& theFileName,
   aRes = aRes && dumpPartitionToPython( aFile, theIsMultiFile, aTreatedObjects, KIND_CHANNEL );
   aRes = aRes && dumpPartitionToPython( aFile, theIsMultiFile, aTreatedObjects, KIND_DIGUE );
   aRes = aRes && dumpPartitionToPython( aFile, theIsMultiFile, aTreatedObjects, KIND_OBSTACLE );
+  aRes = aRes && dumpPartitionToPython( aFile, theIsMultiFile, aTreatedObjects, KIND_LAND_COVER_MAP );
   aRes = aRes && dumpPartitionToPython( aFile, theIsMultiFile, aTreatedObjects, KIND_CALCULATION );
 
   // Dump code to close python fuction
@@ -867,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