]> SALOME platform Git repositories - modules/hydro.git/blobdiff - src/HYDROGUI/HYDROGUI_Module.cxx
Salome HOME
Creat\Edit stream operation.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Module.cxx
index 9357c85f6918dd34a5cce0e6d3ebbcc4a98ac118..604ed597512ab270758189fc867e779fdf846210 100644 (file)
@@ -229,6 +229,7 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
   bool anIsSplittedImage = false;
   bool anIsMustBeUpdatedImage = false;
   bool anIsPolyline = false;
+  bool anIsPolyline3D = false;
   bool anIsProfile = false;
   bool anIsValidProfile = false;
   bool anAllAreProfiles = false;
@@ -239,6 +240,7 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
   bool anIsRegion = false;
   bool anIsZone = false;
   bool anIsObstacle = false;
+  bool anIsStream = false;
   bool anIsGeomObject = false;
 
   // check the selected GEOM objects
@@ -261,7 +263,8 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
       anIsVisibleInSelection |= aVisibility;
       anIsHiddenInSelection |= !aVisibility;
 
-      if( anObject->GetKind() == KIND_IMAGE )
+      ObjectKind anObjectKind = anObject->GetKind();
+      if( anObjectKind == KIND_IMAGE )
       {
         anIsImage = true;
         Handle(HYDROData_Image) anImage = Handle(HYDROData_Image)::DownCast( anObject );
@@ -288,9 +291,12 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
           }
         }
       }
-      else if( anObject->GetKind() == KIND_POLYLINEXY )
+      else if( anObjectKind == KIND_POLYLINEXY )
         anIsPolyline = true;
-      else if( anObject->GetKind() == KIND_PROFILE ) {
+      else if( anObjectKind == KIND_POLYLINE )
+        anIsPolyline3D = true;
+      else if( anObjectKind == KIND_PROFILE )
+      {
         anIsProfile = true;
         aNbOfSelectedProfiles++;
 
@@ -300,20 +306,22 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
           anIsValidProfile = true;
         }
       }
-      else if( anObject->GetKind() == KIND_CALCULATION )
+      else if( anObjectKind == KIND_CALCULATION )
         anIsCalculation = true;
-      else if( anObject->GetKind() == KIND_IMMERSIBLE_ZONE )
+      else if( anObjectKind == KIND_IMMERSIBLE_ZONE )
         anIsImmersibleZone = true;
-      else if( anObject->GetKind() == KIND_VISUAL_STATE )
+      else if( anObjectKind == KIND_VISUAL_STATE )
         anIsVisualState = true;
-      else if( anObject->GetKind() == KIND_REGION )
+      else if( anObjectKind == KIND_REGION )
         anIsRegion = true;
-      else if( anObject->GetKind() == KIND_ZONE )
+      else if( anObjectKind == KIND_ZONE )
         anIsZone = true;
-      else if( anObject->GetKind() == KIND_BATHYMETRY )
+      else if( anObjectKind == KIND_BATHYMETRY )
         anIsBathymetry = true;
-      else if( anObject->GetKind() == KIND_OBSTACLE )
+      else if( anObjectKind == KIND_OBSTACLE )
         anIsObstacle = true;
+      else if( anObjectKind == KIND_STREAM )
+        anIsStream = true;
     }
 
     anIsGeomObject = HYDROData_Tool::IsGeometryObject( anObject );
@@ -337,6 +345,9 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         case KIND_POLYLINEXY:
           theMenu->addAction( action( CreatePolylineId ) );
           break;
+        case KIND_POLYLINE:
+          theMenu->addAction( action( CreatePolyline3DId ) );
+          break;
         case KIND_PROFILE:
           theMenu->addAction( action( CreateProfileId ) );
           theMenu->addAction( action( ImportProfilesId ) );
@@ -408,6 +419,11 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         theMenu->addAction( action( EditPolylineId ) );
         theMenu->addSeparator();
       }
+      else if( anIsPolyline3D )
+      {
+        theMenu->addAction( action( EditPolyline3DId ) );
+        theMenu->addSeparator();
+      }
       else if( anIsProfile )
       {
         theMenu->addAction( action( EditProfileId ) );
@@ -425,6 +441,11 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         theMenu->addAction( action( EditImmersibleZoneId ) );
         theMenu->addSeparator();
       }
+      else if( anIsStream )
+      {
+        theMenu->addAction( action( EditStreamId ) );
+        theMenu->addSeparator();
+      }
       else if( anIsVisualState && anIsObjectBrowser )
       {
         theMenu->addAction( action( SaveVisualStateId ) );
@@ -446,8 +467,8 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
     theMenu->addAction( action( DeleteId ) );
     theMenu->addSeparator();
 
-    if( anIsImage || anIsPolyline || anIsImmersibleZone || anIsZone || 
-        anIsRegion || anIsBathymetry || anIsObstacle || anIsValidProfile )
+    if( anIsImage || anIsPolyline || anIsPolyline3D || anIsImmersibleZone || anIsZone || 
+        anIsRegion || anIsBathymetry || anIsObstacle || anIsStream || anIsValidProfile )
     {
       if( anIsHiddenInSelection )
         theMenu->addAction( action( ShowId ) );