From: asl Date: Thu, 28 Sep 2017 13:13:27 +0000 (+0300) Subject: refs #1326, #1327: bathymetry operations X-Git-Tag: v2.1~66^2~19 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f193301282670fecb290c9cda36fdc356d1667de;p=modules%2Fhydro.git refs #1326, #1327: bathymetry operations --- 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 00000000..2b437803 Binary files /dev/null and b/src/HYDROGUI/resources/icon_bathymetry_selection.png differ