Salome HOME
Access to 'Invalid value' of altitude from Bathymetry is added.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Module.cxx
index 4dd19fe07a0b966ee57c0da1f70d8b4c73f3c29d..c355b2dfe9ea402d64e8b9364e441a9cb2ab3353 100644 (file)
@@ -33,6 +33,8 @@
 #include "HYDROGUI_Tool.h"
 #include "HYDROGUI_UpdateFlags.h"
 
+#include <HYDROData_Image.h>
+
 #include <GraphicsView_ViewFrame.h>
 #include <GraphicsView_ViewManager.h>
 #include <GraphicsView_ViewPort.h>
@@ -139,13 +141,14 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
 {
   HYDROGUI_DataModel* aModel = getDataModel();
 
-  int aViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( this );
+  size_t aViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( this );
 
   bool anIsSelection = false;
   bool anIsVisibleInSelection = false;
   bool anIsHiddenInSelection = false;
 
   bool anIsImage = false;
+  bool anIsCompositeImage = false;
   bool anIsPolyline = false;
   bool anIsVisualState = false;
 
@@ -162,7 +165,12 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
       anIsHiddenInSelection |= !aVisibility;
 
       if( anObject->GetKind() == KIND_IMAGE )
+      {
         anIsImage = true;
+        Handle(HYDROData_Image) anImage = Handle(HYDROData_Image)::DownCast( anObject );
+        if( !anImage.IsNull() )
+          anIsCompositeImage = anImage->NbReferences() > 0;
+      }
       else if( anObject->GetKind() == KIND_POLYLINE )
         anIsPolyline = true;
       else if( anObject->GetKind() == KIND_VISUAL_STATE )
@@ -179,7 +187,7 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
   {
     if( anIsImage )
     {
-      theMenu->addAction( action( EditImageId ) );
+      theMenu->addAction( action( anIsCompositeImage ? EditCompositeImageId : EditImportedImageId ) );
       theMenu->addAction( action( ObserveImageId ) );
       theMenu->addAction( action( ExportImageId ) );
       theMenu->addSeparator();