From a8e7693a421c11517ee9c8d24a125db0e1e0c813 Mon Sep 17 00:00:00 2001 From: isn Date: Mon, 30 Oct 2017 17:38:37 +0300 Subject: [PATCH] refs #1340 Conflicts: src/HYDROGUI/HYDROGUI_Operations.cxx src/HYDROGUI/HYDROGUI_Operations.h --- src/HYDROGUI/CMakeLists.txt | 2 ++ src/HYDROGUI/HYDROGUI_Module.cxx | 8 ++++++++ src/HYDROGUI/HYDROGUI_Operations.cxx | 4 ++++ src/HYDROGUI/HYDROGUI_Operations.h | 2 +- 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/HYDROGUI/CMakeLists.txt b/src/HYDROGUI/CMakeLists.txt index b87dca70..7a575a8f 100644 --- a/src/HYDROGUI/CMakeLists.txt +++ b/src/HYDROGUI/CMakeLists.txt @@ -150,6 +150,7 @@ set(PROJECT_HEADERS HYDROGUI_PolylineStyleOp.h HYDROGUI_PolylineStyleDlg.h HYDROGUI_ZoneTool.h + HYDROGUI_RegenerateRegionColorsOp.h ) QT_WRAP_MOC(PROJECT_HEADERS_MOC ${PROJECT_HEADERS}) @@ -302,6 +303,7 @@ set(PROJECT_SOURCES HYDROGUI_PolylineStyleOp.cxx HYDROGUI_PolylineStyleDlg.cxx HYDROGUI_ZoneTool.cxx + HYDROGUI_RegenerateRegionColorsOp.cxx ) add_definitions( diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index 9b9f9e5e..a8097c75 100644 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -570,6 +570,14 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient, } theMenu->addSeparator(); } + else + { + Handle(HYDROData_CalculationCase) aCalcCase; + QString outStr; + HYDROGUI_Tool::IsSelectedPartOfCalcCase(this, aCalcCase, outStr); + if (outStr == HYDROGUI_DataModel::partitionName( KIND_REGION )) + theMenu->addAction( action( RegenerateRegionColorsId ) ); + } } if( anIsSelectedDataObjects ) diff --git a/src/HYDROGUI/HYDROGUI_Operations.cxx b/src/HYDROGUI/HYDROGUI_Operations.cxx index f57063c2..c14e7172 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.cxx +++ b/src/HYDROGUI/HYDROGUI_Operations.cxx @@ -72,6 +72,7 @@ #include "HYDROGUI_ImportLandCoverMapOp.h" #include "HYDROGUI_BathymetrySelectionOp.h" #include "HYDROGUI_BathymetryOp.h" +#include "HYDROGUI_RegenerateRegionColorsOp.h" #include "HYDROGUI_PolylineStyleOp.h" #include @@ -244,6 +245,7 @@ void HYDROGUI_Module::createActions() createAction( LandCoverScalarMapModeOnId, "LC_SCALARMAP_COLORING_ON" ); createAction( LandCoverScalarMapModeOffId, "LC_SCALARMAP_COLORING_OFF" ); + createAction( RegenerateRegionColorsId, "REGENERATE_REGION_COLORS" ); createAction( ShowHideArrows, "SHOW_HIDE_ARROWS" ); } @@ -765,6 +767,8 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const case LandCoverScalarMapModeOffId: anOp = new HYDROGUI_LandCoverColoringOp( aModule, theId ); break; + case RegenerateRegionColorsId: + anOp = new HYDROGUI_RegenerateRegionColorsOp( aModule ); } if( !anOp ) diff --git a/src/HYDROGUI/HYDROGUI_Operations.h b/src/HYDROGUI/HYDROGUI_Operations.h index bb168a69..f0ce5bea 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.h +++ b/src/HYDROGUI/HYDROGUI_Operations.h @@ -144,7 +144,7 @@ enum OperationId BathymetryRescaleVisibleId, BathymetryRescaleUserId, BathymetryRescaleDefaultId, - + RegenerateRegionColorsId, ShowHideArrows, }; -- 2.39.2