From f193301282670fecb290c9cda36fdc356d1667de Mon Sep 17 00:00:00 2001 From: asl Date: Thu, 28 Sep 2017 16:13:27 +0300 Subject: [PATCH] refs #1326, #1327: bathymetry operations --- src/HYDROGUI/CMakeLists.txt | 2 + src/HYDROGUI/HYDROGUI_BathymetryOp.cxx | 39 +++++++++++++++++ src/HYDROGUI/HYDROGUI_BathymetryOp.h | 41 ++++++++++++++++++ .../HYDROGUI_BathymetrySelectionOp.cxx | 10 ----- src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.h | 2 - src/HYDROGUI/HYDROGUI_Module.h | 1 + src/HYDROGUI/HYDROGUI_Operations.cxx | 27 ++++++++++++ src/HYDROGUI/HYDROGUI_Operations.h | 5 +++ src/HYDROGUI/resources/HYDROGUI_images.ts | 5 ++- src/HYDROGUI/resources/HYDROGUI_msg_en.ts | 12 +++++ .../resources/icon_bathymetry_selection.png | Bin 0 -> 2649 bytes 11 files changed, 131 insertions(+), 13 deletions(-) create mode 100644 src/HYDROGUI/HYDROGUI_BathymetryOp.cxx create mode 100644 src/HYDROGUI/HYDROGUI_BathymetryOp.h create mode 100644 src/HYDROGUI/resources/icon_bathymetry_selection.png diff --git a/src/HYDROGUI/CMakeLists.txt b/src/HYDROGUI/CMakeLists.txt index 81e524ba..05491dc5 100644 --- a/src/HYDROGUI/CMakeLists.txt +++ b/src/HYDROGUI/CMakeLists.txt @@ -124,6 +124,7 @@ set(PROJECT_HEADERS HYDROGUI_Actor.h HYDROGUI_BathymetryBoundsOp.h HYDROGUI_BathymetrySelectionOp.h + HYDROGUI_BathymetryOp.h HYDROGUI_TranslateObstacleDlg.h HYDROGUI_TranslateObstacleOp.h HYDROGUI_ListModel.h @@ -269,6 +270,7 @@ set(PROJECT_SOURCES HYDROGUI_Actor.cxx HYDROGUI_BathymetryBoundsOp.cxx HYDROGUI_BathymetrySelectionOp.cxx + HYDROGUI_BathymetryOp.cxx HYDROGUI_TranslateObstacleDlg.cxx HYDROGUI_TranslateObstacleOp.cxx HYDROGUI_ListModel.cxx diff --git a/src/HYDROGUI/HYDROGUI_BathymetryOp.cxx b/src/HYDROGUI/HYDROGUI_BathymetryOp.cxx new file mode 100644 index 00000000..787053cf --- /dev/null +++ b/src/HYDROGUI/HYDROGUI_BathymetryOp.cxx @@ -0,0 +1,39 @@ +// Copyright (C) 2014-2015 EDF-R&D +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +//See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include + +HYDROGUI_BathymetryOp::HYDROGUI_BathymetryOp( HYDROGUI_Module* theModule, int theMode ) +: HYDROGUI_Operation( theModule ), myMode( theMode ) +{ +} + +HYDROGUI_BathymetryOp::~HYDROGUI_BathymetryOp() +{ +} + +void HYDROGUI_BathymetryOp::startOperation() +{ + //TODO +} + +void HYDROGUI_BathymetryOp::abortOperation() +{ + //TODO +} diff --git a/src/HYDROGUI/HYDROGUI_BathymetryOp.h b/src/HYDROGUI/HYDROGUI_BathymetryOp.h new file mode 100644 index 00000000..7855f84f --- /dev/null +++ b/src/HYDROGUI/HYDROGUI_BathymetryOp.h @@ -0,0 +1,41 @@ +// Copyright (C) 2014-2015 EDF-R&D +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + + +#ifndef HYDROGUI_BATHYMETRY_OP_H +#define HYDROGUI_BATHYMETRY_OP_H + +#include + +class HYDROGUI_BathymetryOp : public HYDROGUI_Operation +{ + Q_OBJECT + +public: + HYDROGUI_BathymetryOp( HYDROGUI_Module* theModule, int theMode ); + virtual ~HYDROGUI_BathymetryOp(); + +protected: + virtual void startOperation(); + virtual void abortOperation(); + +private: + int myMode; +}; + +#endif diff --git a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx index 317ca6aa..2fc0fc9c 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx +++ b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.cxx @@ -42,16 +42,6 @@ void HYDROGUI_BathymetrySelectionOp::abortOperation() activateSelection( false ); } -void HYDROGUI_BathymetrySelectionOp::commitOperation() -{ - activateSelection( false ); -} - -void HYDROGUI_BathymetrySelectionOp::stopOperation() -{ - activateSelection( false ); -} - void HYDROGUI_BathymetrySelectionOp::activateSelection( bool isActive ) { if( myIsActive==isActive ) diff --git a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.h b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.h index 60feb727..227e582e 100644 --- a/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.h +++ b/src/HYDROGUI/HYDROGUI_BathymetrySelectionOp.h @@ -33,8 +33,6 @@ public: protected: virtual void startOperation(); virtual void abortOperation(); - virtual void commitOperation(); - virtual void stopOperation(); void activateSelection( bool ); diff --git a/src/HYDROGUI/HYDROGUI_Module.h b/src/HYDROGUI/HYDROGUI_Module.h index 73e4acc7..b7b4ffa2 100644 --- a/src/HYDROGUI/HYDROGUI_Module.h +++ b/src/HYDROGUI/HYDROGUI_Module.h @@ -274,6 +274,7 @@ protected slots: void onOperation(); void onDelete(); void onBathymetrySelection(); + void onBathymetryText(); bool onUndo( int theNumActions ); diff --git a/src/HYDROGUI/HYDROGUI_Operations.cxx b/src/HYDROGUI/HYDROGUI_Operations.cxx index 3fa2afa3..75ca6f83 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.cxx +++ b/src/HYDROGUI/HYDROGUI_Operations.cxx @@ -71,6 +71,7 @@ #include "HYDROGUI_SetTransparencyOp.h" #include "HYDROGUI_ImportLandCoverMapOp.h" #include "HYDROGUI_BathymetrySelectionOp.h" +#include "HYDROGUI_BathymetryOp.h" #include #include @@ -156,6 +157,14 @@ void HYDROGUI_Module::createActions() createAction( BathymetrySelectionId, "BATHYMETRY_SELECTION", "BATHYMETRY_SELECTION_ICO", 0, true, SLOT( onBathymetrySelection() ) ); + createAction( BathymetryTextId, "BATHYMETRY_TEXT", "BATHYMETRY_TEXT_ICO", + 0, true, SLOT( onBathymetryText() ) ); + + createAction( BathymetryRescaleSelectionId, "BATHYMETRY_RESCALE_SELECTION", "BATHYMETRY_RESCALE_SELECTION_ICO" ); + createAction( BathymetryRescaleVisibleId, "BATHYMETRY_RESCALE_VISIBLE", "BATHYMETRY_RESCALE_VISIBLE_ICO" ); + createAction( BathymetryRescaleUserId, "BATHYMETRY_RESCALE_USER", "BATHYMETRY_RESCALE_USER_ICO" ); + createAction( BathymetryRescaleDefaultId, "BATHYMETRY_RESCALE_DEFAULT", "BATHYMETRY_RESCALE_DEFAULT_ICO" ); + createAction( CreateImmersibleZoneId, "CREATE_IMMERSIBLE_ZONE", "CREATE_IMMERSIBLE_ZONE_ICO" ); createAction( EditImmersibleZoneId, "EDIT_IMMERSIBLE_ZONE", "EDIT_IMMERSIBLE_ZONE_ICO" ); @@ -370,6 +379,11 @@ void HYDROGUI_Module::createToolbars() createTool( separator(), aToolBar ); createTool( BathymetrySelectionId, aToolBar ); + createTool( BathymetryTextId, aToolBar ); + createTool( BathymetryRescaleSelectionId, aToolBar ); + createTool( BathymetryRescaleVisibleId, aToolBar ); + createTool( BathymetryRescaleUserId, aToolBar ); + createTool( BathymetryRescaleDefaultId, aToolBar ); } void HYDROGUI_Module::createUndoRedoActions() @@ -573,6 +587,14 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const case BathymetrySelectionId: anOp = new HYDROGUI_BathymetrySelectionOp( aModule ); break; + case BathymetryTextId: + case BathymetryRescaleSelectionId: + case BathymetryRescaleVisibleId: + case BathymetryRescaleUserId: + case BathymetryRescaleDefaultId: + anOp = new HYDROGUI_BathymetryOp( aModule, theId ); + break; + case CreateImmersibleZoneId: case EditImmersibleZoneId: anOp = new HYDROGUI_ImmersibleZoneOp( aModule, theId == EditImmersibleZoneId ); @@ -776,3 +798,8 @@ void HYDROGUI_Module::onBathymetrySelection() else operation( BathymetrySelectionId )->abort(); } + +void HYDROGUI_Module::onBathymetryText() +{ + //TODO +} diff --git a/src/HYDROGUI/HYDROGUI_Operations.h b/src/HYDROGUI/HYDROGUI_Operations.h index f7916633..c558cfbd 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.h +++ b/src/HYDROGUI/HYDROGUI_Operations.h @@ -138,6 +138,11 @@ enum OperationId LandCoverScalarMapModeOffId, BathymetrySelectionId, + BathymetryTextId, + BathymetryRescaleSelectionId, + BathymetryRescaleVisibleId, + BathymetryRescaleUserId, + BathymetryRescaleDefaultId, }; #endif diff --git a/src/HYDROGUI/resources/HYDROGUI_images.ts b/src/HYDROGUI/resources/HYDROGUI_images.ts index e71e1c5a..6249163c 100644 --- a/src/HYDROGUI/resources/HYDROGUI_images.ts +++ b/src/HYDROGUI/resources/HYDROGUI_images.ts @@ -572,6 +572,9 @@ ICON_CURSOR_18 icon_cursor_18.png - + + BATHYMETRY_SELECTION_ICO + icon_bathymetry_selection.png + diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 82ce2e0f..391221f9 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -967,6 +967,10 @@ Would you like to remove all references from the image? DSK_BATHYMETRY_BOUNDS Create boundary polyline + + DSK_BATHYMETRY_SELECTION + Selection on bathymetry + DSK_IMPORT_IMAGE Import image @@ -1312,6 +1316,10 @@ Would you like to remove all references from the image? MEN_BATHYMETRY_BOUNDS Create boundary polyline + + MEN_BATHYMETRY_SELECTION + Selection on bathymetry + MEN_IMPORT_IMAGE Import image @@ -1621,6 +1629,10 @@ Would you like to remove all references from the image? STB_BATHYMETRY_BOUNDS Create boundary polyline + + STB_BATHYMETRY_SELECTION + Selection on bathymetry + STB_IMPORT_IMAGE Import image diff --git a/src/HYDROGUI/resources/icon_bathymetry_selection.png b/src/HYDROGUI/resources/icon_bathymetry_selection.png new file mode 100644 index 0000000000000000000000000000000000000000..2b43780337ba7d9b5cd0ab9fea01815585c0524b GIT binary patch literal 2649 zcmV-f3a0gmP)Px#1ZP1_K>z@;j|==^1poj532;bRa{vGi!vFvd!vV){sAK>D02*{fSaefwW^{L9 za%BKeVQFr3E>1;MAa*k@H7+qQF!XYv000TdNklZirmO)f`-!E(Ntm*Jct2N0lDRx;RcC#M8Efy33~`!M7}dS{O~q3+~jv)9vvtd%RwY z)oC_5G)BYzo?_qfc)#Yo^rjRrYddh{9a>2&?RW_F@OzXqk<`jWdQBp&A&$b>K`D5L z@?#+FSddRvFhCxe%N4h`cXf1h|N3kH?b~<9#-5Bkc=+()lZnZxsXzXBI59c=aD3>& z*zU^obs2F1IZ5kslU_a+{nD4g0f)lYefF=l2ez-vj9*)@=cQ8#t1@>0M>f*aUi1BS zJ>|eU+L1R_1VkcPMn=}I|HcUXI)+{m;mZv5IU59K{F9Ov0FcLLvG^GoCrCIg?MPMr9eJtc-EIASdMD?kyjN2c?8=*|T%Y{^+2OqBrji-;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