From 274017fd7e5b5e7104a8442da56ee164bc0b2fda Mon Sep 17 00:00:00 2001 From: mkr Date: Tue, 2 Jun 2015 18:35:53 +0300 Subject: [PATCH] refs #562: automatically create default Strickler table object, add operation and dialog classes for import/modify functionality, add resources. --- src/HYDROData/HYDROData_Entity.cxx | 1 + src/HYDROData/HYDROData_Entity.h | 2 +- src/HYDROData/HYDROData_Iterator.cxx | 2 + src/HYDROData/HYDROData_StricklerTable.h | 6 +- src/HYDROGUI/CMakeLists.txt | 5 ++ src/HYDROGUI/HYDROGUI_DataModel.cxx | 47 ++++++++++++ src/HYDROGUI/HYDROGUI_DataModel.h | 7 ++ src/HYDROGUI/HYDROGUI_Module.cxx | 12 ++++ src/HYDROGUI/HYDROGUI_Operations.cxx | 14 +++- src/HYDROGUI/HYDROGUI_Operations.h | 6 +- src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx | 40 +++++++++++ src/HYDROGUI/HYDROGUI_StricklerTableDlg.h | 41 +++++++++++ src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx | 57 +++++++++++++++ src/HYDROGUI/HYDROGUI_StricklerTableOp.h | 49 +++++++++++++ src/HYDROGUI/resources/HYDROGUI_images.ts | 21 ++++++ src/HYDROGUI/resources/HYDROGUI_msg_en.ts | 68 ++++++++++++++++++ .../resources/icon_edit_strickler_table.png | Bin 0 -> 632 bytes .../resources/icon_export_strickler_table.png | Bin 0 -> 632 bytes .../resources/icon_import_strickler_table.png | Bin 0 -> 632 bytes .../resources/icon_strickler_table.png | Bin 0 -> 632 bytes 20 files changed, 373 insertions(+), 5 deletions(-) create mode 100644 src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx create mode 100644 src/HYDROGUI/HYDROGUI_StricklerTableDlg.h create mode 100644 src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx create mode 100644 src/HYDROGUI/HYDROGUI_StricklerTableOp.h create mode 100644 src/HYDROGUI/resources/icon_edit_strickler_table.png create mode 100644 src/HYDROGUI/resources/icon_export_strickler_table.png create mode 100644 src/HYDROGUI/resources/icon_import_strickler_table.png create mode 100644 src/HYDROGUI/resources/icon_strickler_table.png diff --git a/src/HYDROData/HYDROData_Entity.cxx b/src/HYDROData/HYDROData_Entity.cxx index fe5be13a..f51b2644 100644 --- a/src/HYDROData/HYDROData_Entity.cxx +++ b/src/HYDROData/HYDROData_Entity.cxx @@ -599,6 +599,7 @@ QString HYDROData_Entity::getPyTypeID() const case KIND_SPLITTED_GROUP: return "KIND_SPLITTED_GROUP"; case KIND_STREAM_ALTITUDE: return "KIND_STREAM_ALTITUDE"; case KIND_OBSTACLE_ALTITUDE: return "KIND_OBSTACLE_ALTITUDE"; + case KIND_STRICKLER_TABLE: return "KIND_STRICKLER_TABLE"; default: return "KIND_UNKNOWN"; ///! Unrecognized object } } diff --git a/src/HYDROData/HYDROData_Entity.h b/src/HYDROData/HYDROData_Entity.h index 29036275..fd864063 100644 --- a/src/HYDROData/HYDROData_Entity.h +++ b/src/HYDROData/HYDROData_Entity.h @@ -64,7 +64,7 @@ const ObjectKind KIND_SPLITTED_GROUP = 23; const ObjectKind KIND_STREAM_ALTITUDE = 24; const ObjectKind KIND_OBSTACLE_ALTITUDE = 25; const ObjectKind KIND_STRICKLER_TABLE = 26; -const ObjectKind KIND_LAST = KIND_OBSTACLE_ALTITUDE; +const ObjectKind KIND_LAST = KIND_STRICKLER_TABLE; DEFINE_STANDARD_HANDLE(HYDROData_Entity, MMgt_TShared) diff --git a/src/HYDROData/HYDROData_Iterator.cxx b/src/HYDROData/HYDROData_Iterator.cxx index 62127b9a..18b3dffd 100644 --- a/src/HYDROData/HYDROData_Iterator.cxx +++ b/src/HYDROData/HYDROData_Iterator.cxx @@ -41,6 +41,7 @@ #include "HYDROData_Stream.h" #include "HYDROData_StreamAltitude.h" #include "HYDROData_Zone.h" +#include "HYDROData_StricklerTable.h" #include #include @@ -149,6 +150,7 @@ Handle(HYDROData_Entity) HYDROData_Iterator::Object( const TDF_Label& theLabel ) case KIND_SPLITTED_GROUP: aResult = new HYDROData_SplittedShapesGroup(); break; case KIND_STREAM_ALTITUDE: aResult = new HYDROData_StreamAltitude(); break; case KIND_OBSTACLE_ALTITUDE: aResult = new HYDROData_ObstacleAltitude(); break; + case KIND_STRICKLER_TABLE: aResult = new HYDROData_StricklerTable(); break; default: break; } diff --git a/src/HYDROData/HYDROData_StricklerTable.h b/src/HYDROData/HYDROData_StricklerTable.h index 35a8a452..eae46e33 100644 --- a/src/HYDROData/HYDROData_StricklerTable.h +++ b/src/HYDROData/HYDROData_StricklerTable.h @@ -28,6 +28,8 @@ DEFINE_STANDARD_HANDLE( HYDROData_StricklerTable, HYDROData_Entity ) class HYDROData_StricklerTable : public HYDROData_Entity { protected: + friend class HYDROData_Iterator; + enum DataTag { DataTag_Table = HYDROData_Entity::DataTag_First + 100, ///< first tag, to reserve @@ -41,8 +43,8 @@ public: HYDRODATA_EXPORT virtual const ObjectKind GetKind() const; - bool Import( const TCollection_AsciiString& theFileName ); - bool Export( const TCollection_AsciiString& theFileName ); + HYDRODATA_EXPORT bool Import( const TCollection_AsciiString& theFileName ); + HYDRODATA_EXPORT bool Export( const TCollection_AsciiString& theFileName ); double Get( const TCollection_ExtendedString& theType, double theDefault ) const; void Set( const TCollection_ExtendedString& theType, double theCoefficient ); diff --git a/src/HYDROGUI/CMakeLists.txt b/src/HYDROGUI/CMakeLists.txt index fdd046cd..dadac13b 100644 --- a/src/HYDROGUI/CMakeLists.txt +++ b/src/HYDROGUI/CMakeLists.txt @@ -70,6 +70,8 @@ set(PROJECT_HEADERS HYDROGUI_ShowHideOp.h HYDROGUI_StreamDlg.h HYDROGUI_StreamOp.h + HYDROGUI_StricklerTableDlg.h + HYDROGUI_StricklerTableOp.h HYDROGUI_SubmersibleOp.h HYDROGUI_Tool.h HYDROGUI_TwoImagesDlg.h @@ -183,6 +185,8 @@ set(PROJECT_SOURCES HYDROGUI_ShowHideOp.cxx HYDROGUI_StreamDlg.cxx HYDROGUI_StreamOp.cxx + HYDROGUI_StricklerTableDlg.cxx + HYDROGUI_StricklerTableOp.cxx HYDROGUI_SubmersibleOp.cxx HYDROGUI_Tool.cxx HYDROGUI_TwoImagesDlg.cxx @@ -276,6 +280,7 @@ QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${SALOME_HYDRO_INSTALL_RES_DATA}") FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png") FILE(GLOB GUIXML_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.xml") +FILE(GLOB GUIXML_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.txt") SET(GUI_DATA ${GUIPNG_DATA} ${GUIXML_DATA}) INSTALL(FILES ${GUI_DATA} DESTINATION ${SALOME_HYDRO_INSTALL_RES_DATA}) diff --git a/src/HYDROGUI/HYDROGUI_DataModel.cxx b/src/HYDROGUI/HYDROGUI_DataModel.cxx index 44c63cd2..366f9c78 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.cxx +++ b/src/HYDROGUI/HYDROGUI_DataModel.cxx @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -267,6 +268,9 @@ void HYDROGUI_DataModel::update( const int theStudyId ) // OBSTACLES LightApp_DataObject* anObstaclesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_OBSTACLE ).toAscii() ) ); + // STRICKLER TABLES + LightApp_DataObject* aStricklerTablesRootObj = createObject( aNewRootObj, tr( partitionName( KIND_STRICKLER_TABLE ).toAscii() ) ); + // CALCULATION CASES LightApp_DataObject* aCalculRootObj = createObject( aNewRootObj, tr( partitionName( KIND_CALCULATION ).toAscii() ) ); @@ -282,6 +286,7 @@ void HYDROGUI_DataModel::update( const int theStudyId ) // VISUAL STATES LightApp_DataObject* aVisualStateRootObj = createObject( aNewRootObj, tr( partitionName( KIND_VISUAL_STATE ).toAscii() ) ); + int aNoStricklerTableObj = 0; HYDROData_Iterator anIterator( aDocument, KIND_UNKNOWN ); for( ; anIterator.More(); anIterator.Next() ) { LightApp_DataObject* obj = 0; @@ -368,6 +373,17 @@ void HYDROGUI_DataModel::update( const int theStudyId ) obj = createObject( anObstaclesRootObj, anObstacleObj ); } + break; + } + case KIND_STRICKLER_TABLE: + { + Handle(HYDROData_StricklerTable) anStricklerTableObj = + Handle(HYDROData_StricklerTable)::DownCast( anObj ); + if( !anStricklerTableObj.IsNull() ) { + obj = createObject( aStricklerTablesRootObj, anStricklerTableObj ); + } + aNoStricklerTableObj++; + break; } case KIND_CALCULATION: @@ -424,6 +440,10 @@ void HYDROGUI_DataModel::update( const int theStudyId ) } } + // Create default Strickler table object + if ( aNoStricklerTableObj == 0 ) + createDefaultStricklerTable( aDocument, aStricklerTablesRootObj ); + //if( SUIT_DataBrowser* anObjectBrowser = anApp->objectBrowser() ) //{ // anObjectBrowser->setAutoOpenLevel( 3 ); @@ -661,6 +681,7 @@ QString HYDROGUI_DataModel::partitionName( const ObjectKind theObjectKind ) case KIND_OBSTACLE: return "OBSTACLES"; case KIND_ARTIFICIAL_OBJECT: return "ARTIFICIAL_OBJECTS"; case KIND_NATURAL_OBJECT: return "NATURAL_OBJECTS"; + case KIND_STRICKLER_TABLE: return "STRICKLER_TABLES"; default: break; } return QString(); @@ -754,6 +775,32 @@ LightApp_DataObject* HYDROGUI_DataModel::createRegion( SUIT_DataObject* theParentEntry, theIsBuildTree, theIsInOperation ); } +void HYDROGUI_DataModel::createDefaultStricklerTable( const Handle(HYDROData_Document)& theDocument, + LightApp_DataObject* theParent ) +{ + // Create default Strickler table object + Handle(HYDROData_StricklerTable) anStricklerTableObj = + Handle(HYDROData_StricklerTable)::DownCast( theDocument->CreateObject(KIND_STRICKLER_TABLE) ); + if ( !anStricklerTableObj.IsNull() ) + { + anStricklerTableObj->Import( HYDROGUI_Tool::ToAsciiString( tr( "DEFAULT_STRICKLER_TABLE_FILE" ) ) ); + // Set name + QString aStricklerTableName; + if ( anStricklerTableObj->GetName().isEmpty() ) + { + HYDROGUI_Module* aModule = dynamic_cast( module() ); + if ( aModule ) + aStricklerTableName = HYDROGUI_Tool::GenerateObjectName( aModule, tr( "DEFAULT_STRICKLER_TABLE_NAME" ) ); + } + if ( anStricklerTableObj->GetName() != aStricklerTableName ) + anStricklerTableObj->SetName( aStricklerTableName ); + + anStricklerTableObj->Update(); + + LightApp_DataObject* obj = createObject( theParent, anStricklerTableObj ); + } +} + LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject* theParent, const QString& theName, const QString& theParentEntry ) diff --git a/src/HYDROGUI/HYDROGUI_DataModel.h b/src/HYDROGUI/HYDROGUI_DataModel.h index 473a71fb..f8b4a701 100644 --- a/src/HYDROGUI/HYDROGUI_DataModel.h +++ b/src/HYDROGUI/HYDROGUI_DataModel.h @@ -317,6 +317,13 @@ protected: const QString& theParentEntry, const bool theIsBuildTree , const bool theIsInOperation = false ); + /** + * Creates the default Strickler table object: both GUI data object and corresponding model object + * \param theDocument a document into which created object will be added + * \param theParent a created object will be appended as a child of this GUI object + */ + void createDefaultStricklerTable( const Handle(HYDROData_Document)& theDocument, + LightApp_DataObject* theParent ); /** * Build partition for object. * \param theObject gui object for which the partition will be build diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index 95d4a590..2fadc911 100644 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -336,6 +336,7 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient, bool anIsRegion = false; bool anIsZone = false; bool anIsObstacle = false; + bool anIsStricklerTable = false; bool anIsStream = false; bool anIsChannel = false; bool anIsDigue = false; @@ -454,6 +455,8 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient, anIsBathymetry = true; else if( anObjectKind == KIND_OBSTACLE ) anIsObstacle = true; + else if( anObjectKind == KIND_STRICKLER_TABLE ) + anIsStricklerTable = true; else if( anObjectKind == KIND_STREAM ) { anIsStream = true; @@ -507,6 +510,9 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient, theMenu->addAction( action( CreateBoxId ) ); theMenu->addAction( action( CreateCylinderId ) ); break; + case KIND_STRICKLER_TABLE: + theMenu->addAction( action( ImportStricklerTableFromFileId ) ); + break; case KIND_CALCULATION: theMenu->addAction( action( CreateCalculationId ) ); break; @@ -633,6 +639,12 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient, theMenu->addAction( action( TranslateObstacleId ) ); theMenu->addSeparator(); } + else if( anIsStricklerTable ) + { + theMenu->addAction( action( EditStricklerTableId ) ); + theMenu->addAction( action( ExportStricklerTableFromFileId ) ); + theMenu->addSeparator(); + } else if( anIsVisualState && anIsObjectBrowser ) { theMenu->addAction( action( SaveVisualStateId ) ); diff --git a/src/HYDROGUI/HYDROGUI_Operations.cxx b/src/HYDROGUI/HYDROGUI_Operations.cxx index 6170aca5..569e47a5 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.cxx +++ b/src/HYDROGUI/HYDROGUI_Operations.cxx @@ -57,6 +57,7 @@ #include "HYDROGUI_RiverBottomOp.h" #include "HYDROGUI_ProfileInterpolateOp.h" #include "HYDROGUI_SubmersibleOp.h" +#include "HYDROGUI_StricklerTableOp.h" #include #include @@ -148,6 +149,10 @@ void HYDROGUI_Module::createActions() createAction( CreateDigueId, "CREATE_DIGUE", "CREATE_DIGUE_ICO" ); createAction( EditDigueId, "EDIT_DIGUE", "EDIT_DIGUE_ICO" ); + createAction( ImportStricklerTableFromFileId, "IMPORT_STRICKLER_TABLE", "IMPORT_STRICKLER_TABLE_ICO" ); + createAction( ExportStricklerTableFromFileId, "EXPORT_STRICKLER_TABLE", "EXPORT_STRICKLER_TABLE_ICO" ); + createAction( EditStricklerTableId, "EDIT_STRICKLER_TABLE", "EDIT_STRICKLER_TABLE_ICO" ); + createAction( ImportObstacleFromFileId, "IMPORT_OBSTACLE_FROM_FILE", "IMPORT_OBSTACLE_FROM_FILE_ICO" ); createAction( ImportGeomObjectAsObstacleId, "IMPORT_GEOM_OBJECT_AS_OBSTACLE", "IMPORT_GEOM_OBJECT_ICO" ); createAction( ImportGeomObjectAsPolylineId, "IMPORT_GEOM_OBJECT_AS_POLYLINE", "IMPORT_GEOM_OBJECT_ICO" ); @@ -209,11 +214,12 @@ void HYDROGUI_Module::createMenus() createMenu( ImportImageId, aHydroId, -1, -1 ); createMenu( ImportPolylineId, aHydroId, -1, -1 ); createMenu( ImportBathymetryId, aHydroId, -1, -1 ); + createMenu( ImportStricklerTableFromFileId, aHydroId, -1, -1 ); createMenu( CreatePolylineId, aHydroId, -1, -1 ); createMenu( CreatePolyline3DId, aHydroId, -1, -1 ); createMenu( CreateImmersibleZoneId, aHydroId, -1, -1 ); createMenu( CreateChannelId, aHydroId, -1, -1 ); - createMenu( CreateDigueId, aHydroId, -1, -1 ); + createMenu( CreateDigueId, aHydroId, -1, -1 ); int aNewProfileId = createMenu( tr( "MEN_DESK_PROFILE" ), aHydroId, -1 ); createMenu( CreateProfileId, aNewProfileId, -1, -1 ); @@ -275,6 +281,9 @@ void HYDROGUI_Module::createToolbars() createTool( CreateBoxId, aToolBar ); createTool( CreateCylinderId, aToolBar ); + createTool( separator(), aToolBar ); + createTool( ImportStricklerTableFromFileId, aToolBar ); + createTool( separator(), aToolBar ); createTool( CreateCalculationId, aToolBar ); @@ -468,6 +477,9 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const case EditDigueId: anOp = new HYDROGUI_DigueOp( aModule, theId == EditDigueId ); break; + case EditStricklerTableId: + anOp = new HYDROGUI_StricklerTableOp( aModule, theId == EditStricklerTableId ); + break; case CreateCalculationId: case EditCalculationId: anOp = new HYDROGUI_CalculationOp( aModule, theId == EditCalculationId ); diff --git a/src/HYDROGUI/HYDROGUI_Operations.h b/src/HYDROGUI/HYDROGUI_Operations.h index 3eeebc14..0bbde201 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.h +++ b/src/HYDROGUI/HYDROGUI_Operations.h @@ -109,7 +109,11 @@ enum OperationId SubmersibleId, ImportPolylineId, - ExportPolylineId + ExportPolylineId, + + ImportStricklerTableFromFileId, + ExportStricklerTableFromFileId, + EditStricklerTableId }; diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx new file mode 100644 index 00000000..37ab3bea --- /dev/null +++ b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.cxx @@ -0,0 +1,40 @@ +// 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 +// + +#include "HYDROGUI_StricklerTableDlg.h" + +#include + +HYDROGUI_StricklerTableDlg::HYDROGUI_StricklerTableDlg( HYDROGUI_Module* theModule, const QString& theTitle ) +: HYDROGUI_InputPanel( theModule, theTitle ), myName(NULL) +{ +} + +HYDROGUI_StricklerTableDlg::~HYDROGUI_StricklerTableDlg() +{ +} + +void HYDROGUI_StricklerTableDlg::setStricklerTableName( const QString& theName ) +{ + myName->setText(theName); +} + +QString HYDROGUI_StricklerTableDlg::getStricklerTableName() const +{ + return myName->text(); +} diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.h new file mode 100644 index 00000000..95f1261b --- /dev/null +++ b/src/HYDROGUI/HYDROGUI_StricklerTableDlg.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_STRICKLERTABLEDLG_H +#define HYDROGUI_STRICKLERTABLEDLG_H + +#include "HYDROGUI_InputPanel.h" + +class QLineEdit; + +class HYDROGUI_StricklerTableDlg : public HYDROGUI_InputPanel +{ + Q_OBJECT + +public: + HYDROGUI_StricklerTableDlg( HYDROGUI_Module* theModule, const QString& theTitle ); + virtual ~HYDROGUI_StricklerTableDlg(); + + void setStricklerTableName( const QString& theName ); + QString getStricklerTableName() const; + +private: + QLineEdit* myName; +}; + +#endif diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx b/src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx new file mode 100644 index 00000000..c7be5462 --- /dev/null +++ b/src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx @@ -0,0 +1,57 @@ +// 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 +// + +#include "HYDROGUI_StricklerTableOp.h" + +#include "HYDROGUI_StricklerTableDlg.h" + +HYDROGUI_StricklerTableOp::HYDROGUI_StricklerTableOp( HYDROGUI_Module* theModule, bool theIsEdit ) +: HYDROGUI_Operation( theModule ), + myIsEdit( theIsEdit ) +{ + setName( theIsEdit ? tr( "EDIT_STRICKLER_TABLE" ) : tr( "IMPORT_STRICKLER_TABLE" ) ); +} + + +HYDROGUI_StricklerTableOp::~HYDROGUI_StricklerTableOp() +{ +} + +void HYDROGUI_StricklerTableOp::startOperation() +{ +} + +void HYDROGUI_StricklerTableOp::abortOperation() +{ +} + +void HYDROGUI_StricklerTableOp::commitOperation() +{ +} + +HYDROGUI_InputPanel* HYDROGUI_StricklerTableOp::createInputPanel() const +{ + HYDROGUI_StricklerTableDlg* aDlg = new HYDROGUI_StricklerTableDlg( module(), getName() ); + return aDlg; +} + +bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theErrorMsg, + QStringList& theBrowseObjectsEntries ) +{ + return true; +} diff --git a/src/HYDROGUI/HYDROGUI_StricklerTableOp.h b/src/HYDROGUI/HYDROGUI_StricklerTableOp.h new file mode 100644 index 00000000..a6ed3782 --- /dev/null +++ b/src/HYDROGUI/HYDROGUI_StricklerTableOp.h @@ -0,0 +1,49 @@ +// 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_STRICKLERTABLEOP_H +#define HYDROGUI_STRICKLERTABLEOP_H + +#include "HYDROGUI_Operation.h" + +#include + +class HYDROGUI_StricklerTableOp : public HYDROGUI_Operation +{ + Q_OBJECT + +public: + HYDROGUI_StricklerTableOp( HYDROGUI_Module* theModule, bool isEdit ); + virtual ~HYDROGUI_StricklerTableOp(); + +protected: + virtual void startOperation(); + virtual void abortOperation(); + virtual void commitOperation(); + + virtual HYDROGUI_InputPanel* createInputPanel() const; + + virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg, + QStringList& theBrowseObjectsEntries ); + +private: + bool myIsEdit; + Handle(HYDROData_StricklerTable) myEditedObject; +}; + +#endif diff --git a/src/HYDROGUI/resources/HYDROGUI_images.ts b/src/HYDROGUI/resources/HYDROGUI_images.ts index f6079f8e..7eed358d 100644 --- a/src/HYDROGUI/resources/HYDROGUI_images.ts +++ b/src/HYDROGUI/resources/HYDROGUI_images.ts @@ -137,6 +137,10 @@ HYDRO_TYPE20_ICO icon_hydro_obj.png + + HYDRO_TYPE26_ICO + icon_strickler_table.png + @@ -334,6 +338,23 @@ icon_edit_digue.png + + DEFAULT_STRICKLER_TABLE_FILE + def_strickler_table.txt + + + IMPORT_STRICKLER_TABLE_ICO + icon_import_strickler_table.png + + + EXPORT_STRICKLER_TABLE_ICO + icon_export_strickler_table.png + + + EDIT_STRICKLER_TABLE_ICO + icon_edit_strickler_table.png + + IMPORT_OBSTACLE_FROM_FILE_ICO icon_import_obstacle.png diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index 885092d9..02f0bf9c 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -43,6 +43,10 @@ DEFAULT_IMMERSIBLE_ZONE_NAME Immersible zone + + DEFAULT_STRICKLER_TABLE_NAME + Strickler table + IMAGES IMAGES @@ -75,6 +79,10 @@ OBSTACLES OBSTACLES + + STRICKLER_TABLES + STRICKLER TABLES + ARTIFICIAL_OBJECTS ARTIFICIAL OBJECTS @@ -742,6 +750,18 @@ Would you like to remove all references from the image? DSK_EDIT_DIGUE Edit digue + + DSK_IMPORT_STRICKLER_TABLE + Import Strickler table + + + DSK_EXPORT_STRICKLER_TABLE + Export Strickler table + + + DSK_EDIT_STRICKLER_TABLE + Edit Strickler table + DSK_COPY Copy @@ -978,6 +998,18 @@ Would you like to remove all references from the image? MEN_EDIT_DIGUE Edit digue + + MEN_IMPORT_STRICKLER_TABLE + Import Strickler table + + + MEN_EXPORT_STRICKLER_TABLE + Export Strickler table + + + MEN_EDIT_STRICKLER_TABLE + Edit Strickler table + MEN_CUT_IMAGES Cut images @@ -1238,6 +1270,18 @@ Would you like to remove all references from the image? STB_EDIT_DIGUE Edit digue + + STB_IMPORT_STRICKLER_TABLE + Import Strickler table + + + STB_EXPORT_STRICKLER_TABLE + Export Strickler table + + + STB_EDIT_STRICKLER_TABLE + Edit Strickler table + STB_COPY Copy @@ -2211,6 +2255,30 @@ Polyline should consist from one not closed curve. + + HYDROGUI_StricklerTableDlg + + STRICKLER_TABLE_NAME + Strickler table name + + + + + HYDROGUI_StricklerTableOp + + IMPORT_STRICKLER_TABLE + Import Strickler table + + + EXPORT_STRICKLER_TABLE + Export Strickler table + + + EDIT_STRICKLER_TABLE + Edit Strickler table + + + HYDROGUI_TranslateObstacleDlg diff --git a/src/HYDROGUI/resources/icon_edit_strickler_table.png b/src/HYDROGUI/resources/icon_edit_strickler_table.png new file mode 100644 index 0000000000000000000000000000000000000000..21dfce052821e48b7a6e40a0d328e608fbec8a80 GIT binary patch literal 632 zcmV-;0*C#HP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2j2z) z4Hg#aVXCA600H<(L_t(I%axKnYgIuIhM(E9Ct8JT45UdXM*o79m6al*jh~eoNg+g| zXo`SAM6j^3NVK>KCSqaKD1L#BSXtRv%ZXTMM6?U{-rapI&beO%giN!`%kIp)&x}dp z(elzCQm7#T;{Rb_2G0LIdFu2I4?qgFgNK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