From: isn Date: Mon, 30 Oct 2017 14:38:37 +0000 (+0300) Subject: refs #1340 X-Git-Tag: v2.1~52 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=a8e7693a421c11517ee9c8d24a125db0e1e0c813;p=modules%2Fhydro.git refs #1340 Conflicts: src/HYDROGUI/HYDROGUI_Operations.cxx src/HYDROGUI/HYDROGUI_Operations.h --- 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, };