Salome HOME
Merge remote-tracking branch 'origin/BR_LAND_COVER' into BR_v14_rc
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Module.cxx
index 8afdfc4e587720f6a29ae12062102b95398b493e..9127cb74a747cd7926b26e0583279c62fbf4f614 100644 (file)
@@ -336,6 +336,8 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
   bool anIsRegion = false;
   bool anIsZone = false;
   bool anIsObstacle = false;
+  bool anIsStricklerTable = false;
+  bool anIsLandCover = false;
   bool anIsStream = false;
   bool anIsChannel = false;
   bool anIsDigue = false;
@@ -454,6 +456,10 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         anIsBathymetry = true;
       else if( anObjectKind == KIND_OBSTACLE )
         anIsObstacle = true;
+      else if( anObjectKind == KIND_STRICKLER_TABLE )
+        anIsStricklerTable = true;
+      else if( anObjectKind == KIND_LAND_COVER )
+        anIsLandCover = true;
       else if( anObjectKind == KIND_STREAM )
       {
         anIsStream = true;
@@ -507,6 +513,12 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
           theMenu->addAction( action( CreateBoxId ) );
           theMenu->addAction( action( CreateCylinderId ) );
           break;
+        case KIND_STRICKLER_TABLE:
+          theMenu->addAction( action( ImportStricklerTableFromFileId ) );          
+          break;
+        case KIND_LAND_COVER:
+          theMenu->addAction( action( CreateLandCoverId ) );          
+          break;
         case KIND_CALCULATION:
           theMenu->addAction( action( CreateCalculationId ) );
           break;
@@ -635,6 +647,18 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         theMenu->addAction( action( TranslateObstacleId ) );
         theMenu->addSeparator();
       }
+      else if( anIsStricklerTable )
+      {
+        theMenu->addAction( action( EditStricklerTableId ) );
+        theMenu->addAction( action( ExportStricklerTableFromFileId ) );
+        theMenu->addAction( action( DuplicateStricklerTableId ) );
+        theMenu->addSeparator();
+      }
+      else if( anIsLandCover )
+      {
+        theMenu->addAction( action( EditLandCoverId ) );
+        theMenu->addSeparator();
+      }      
       else if( anIsVisualState && anIsObjectBrowser )
       {
         theMenu->addAction( action( SaveVisualStateId ) );
@@ -653,6 +677,9 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
       theMenu->addSeparator();
     }
 
+    if (anIsPolyline || anIsPolyline3D)
+      theMenu->addAction( action( ExportPolylineId ) );
+
     // Add copy action
     QAction* aCopyAction = action( CopyId );
     if( aCopyAction && aCopyAction->isEnabled() ) {
@@ -670,7 +697,7 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         anIsImmersibleZone || anIsZone || anIsRegion ||
         anIsBathymetry || anIsObstacle || anIsStream ||
         anIsChannel || anIsDigue || anIsDummyObject3D ||
-        anIsValidProfile || anIsGroup )
+        anIsValidProfile || anIsGroup || anIsLandCover )
     {
       if( anIsHiddenInSelection )
         theMenu->addAction( action( ShowId ) );
@@ -751,6 +778,14 @@ void HYDROGUI_Module::createPreferences()
   int viewerGroup = addPreference( tr( "PREF_GROUP_VIEWER" ), genTab );
   addPreference( tr( "PREF_VIEWER_AUTO_FITALL" ), viewerGroup,
                  LightApp_Preferences::Bool, "HYDRO", "auto_fit_all" );
+
+  int StricklerTableGroup = addPreference( tr( "PREF_GROUP_STRICKLER_TABLE" ), genTab );
+  int defaultStricklerCoef = addPreference( tr( "PREF_DEFAULT_STRICKLER_COEFFICIENT" ), StricklerTableGroup,
+                                            LightApp_Preferences::DblSpin, "HYDRO", "default_strickler_coefficient" );
+  setPreferenceProperty( defaultStricklerCoef, "precision", 2 );
+  setPreferenceProperty( defaultStricklerCoef, "min", 0.00 );
+  setPreferenceProperty( defaultStricklerCoef, "max", 1000000.00 );
+  setPreferenceProperty( defaultStricklerCoef, "step", 0.01 );
 }
 
 QCursor HYDROGUI_Module::getPrefEditCursor() const