Salome HOME
++ shapefil
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_StricklerTableOp.cxx
index 7cecf388b79803958b5126490607b04b0eb3d59d..bfb3bb7de368bb0c32b81246d81c666517d11e07 100644 (file)
 
 #include "HYDROGUI_StricklerTableDlg.h"
 #include "HYDROGUI_DataObject.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Operations.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Document.h>
 
@@ -33,7 +36,8 @@ HYDROGUI_StricklerTableOp::HYDROGUI_StricklerTableOp( HYDROGUI_Module* theModule
     : HYDROGUI_Operation( theModule ), 
     myType( theType )
 {
-    setName( isEdit() ? tr( "EDIT_STRICKLER_TABLE" ) : tr( "IMPORT_STRICKLER_TABLE" ) );
+    setName( isEdit() ? tr( "EDIT_STRICKLER_TABLE" ) :
+                        ( isImport() ? tr( "IMPORT_STRICKLER_TABLE" ) : tr( "EXPORT_STRICKLER_TABLE" ) ) );
 }
 
 HYDROGUI_StricklerTableOp::~HYDROGUI_StricklerTableOp()
@@ -59,10 +63,9 @@ void HYDROGUI_StricklerTableOp::startOperation()
 
             // Get Strickler table data from the data model
             HYDROGUI_StricklerTableDlg::StricklerCoefficientList aData;
-            TColStd_SequenceOfExtendedString aTypes = myObject->GetTypes();
-            for ( int i = 1; i <= aTypes.Length(); i++ )
-                aData.append( HYDROGUI_StricklerTableDlg::StricklerCoefficient( HYDROGUI_Tool::ToQString( aTypes.Value( i ) ),
-                myObject->Get( aTypes.Value( i ), 0 ) ) );
+            QStringList aTypes = myObject->GetTypes();
+            for ( QStringList::iterator it = aTypes.begin(); it != aTypes.end(); ++it )
+                aData.append( HYDROGUI_StricklerTableDlg::StricklerCoefficient( *it, myObject->Get( *it, 0 ) ) );
 
             aPanel->setData( aData );
         }
@@ -163,7 +166,7 @@ bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theE
         for ( HYDROGUI_StricklerTableDlg::StricklerCoefficientList::iterator it = aData.begin(); it != aData.end(); ++it )
         {
             const HYDROGUI_StricklerTableDlg::StricklerCoefficient& anInfo = *it;
-            aStricklerTableObj->Set( HYDROGUI_Tool::ToExtString( anInfo.myType ), anInfo.myCoefficient );
+            aStricklerTableObj->Set( anInfo.myType, anInfo.myCoefficient );
         }
     }
     else
@@ -180,9 +183,11 @@ bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theE
     {
         QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aStricklerTableObj );
         theBrowseObjectsEntries.append( anEntry );
+    } else {
+      module()->getOCCDisplayer()->SetToUpdateColorScale();
     }
 
-    theUpdateFlags |= UF_ObjBrowser;
+    theUpdateFlags |= UF_ObjBrowser | UF_OCCViewer;
 
     return true;
 }