HYDROGUI_DigueDlg.h
HYDROGUI_DigueOp.h
HYDROGUI_Displayer.h
+ HYDROGUI_DuplicateOp.h
HYDROGUI_ExportImageOp.h
HYDROGUI_GVSelector.h
HYDROGUI_ImagePrs.h
HYDROGUI_DigueDlg.cxx
HYDROGUI_DigueOp.cxx
HYDROGUI_Displayer.cxx
+ HYDROGUI_DuplicateOp.cxx
HYDROGUI_ExportImageOp.cxx
HYDROGUI_GVSelector.cxx
HYDROGUI_ImagePrs.cxx
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";
+ case KIND_STRICKLER_TABLE: return "STRICKLER_TABLES";
default: break;
}
return QString();
--- /dev/null
+// 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_DuplicateOp.h"
+
+#include "HYDROGUI_DataModel.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_UpdateFlags.h"
+
+HYDROGUI_DuplicateOp::HYDROGUI_DuplicateOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule )
+{
+ setName( tr( "DUPLICATE" ) );
+}
+
+
+HYDROGUI_DuplicateOp::~HYDROGUI_DuplicateOp()
+{
+}
+
+void HYDROGUI_DuplicateOp::startOperation()
+{
+ HYDROGUI_Operation::startOperation();
+
+ HYDROGUI_DataModel* aModel = module()->getDataModel();
+
+ bool anIsOk = false;
+ int aFlags = 0;
+
+ // Copy object
+ anIsOk = aModel->copy();
+ aFlags = UF_Controls;
+ if( !anIsOk )
+ {
+ abort();
+ return;
+ }
+
+ // Paste object
+ startDocOperation();
+
+ anIsOk = aModel->paste();
+ aFlags = UF_Controls | UF_Model;
+
+ if( anIsOk )
+ commitDocOperation();
+ else
+ abortDocOperation();
+
+ if( anIsOk )
+ {
+ module()->update( aFlags );
+ commit();
+ }
+ else
+ abort();
+}
--- /dev/null
+// 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_DUPLICATEOP_H
+#define HYDROGUI_DUPLICATEOP_H
+
+#include "HYDROGUI_Operation.h"
+
+class HYDROGUI_DuplicateOp : public HYDROGUI_Operation
+{
+ Q_OBJECT
+
+public:
+ HYDROGUI_DuplicateOp( HYDROGUI_Module* theModule );
+ virtual ~HYDROGUI_DuplicateOp();
+
+protected:
+ virtual void startOperation();
+};
+
+#endif
else if( anIsStricklerTable )
{
theMenu->addAction( action( EditStricklerTableId ) );
- theMenu->addAction( action( ExportStricklerTableFromFileId ) );
+ theMenu->addAction( action( ExportStricklerTableFromFileId ) );
+ theMenu->addAction( action( DuplicateStricklerTableId ) );
theMenu->addSeparator();
}
else if( anIsVisualState && anIsObjectBrowser )
int viewerGroup = addPreference( tr( "PREF_GROUP_VIEWER" ), genTab );
addPreference( tr( "PREF_VIEWER_AUTO_FITALL" ), viewerGroup,
LightApp_Preferences::Bool, "HYDRO", "auto_fit_all" );
+
+ int StricklerTableGroup = addPreference( tr( "PREF_GROUP_STRICKLER_TABLE" ), genTab );
+ int defaultStricklerCoef = addPreference( tr( "PREF_DEFAULT_STRICKLER_COEFFICIENT" ), StricklerTableGroup,
+ LightApp_Preferences::DblSpin, "HYDRO", "default_strickler_coefficient" );
+ setPreferenceProperty( defaultStricklerCoef, "precision", 2 );
+ setPreferenceProperty( defaultStricklerCoef, "min", 0.00 );
+ setPreferenceProperty( defaultStricklerCoef, "max", 1000000.00 );
+ setPreferenceProperty( defaultStricklerCoef, "step", 0.01 );
}
QCursor HYDROGUI_Module::getPrefEditCursor() const
#include "HYDROGUI_ProfileInterpolateOp.h"
#include "HYDROGUI_SubmersibleOp.h"
#include "HYDROGUI_StricklerTableOp.h"
+#include "HYDROGUI_DuplicateOp.h"
#include <HYDROData_Document.h>
#include <HYDROData_Obstacle.h>
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( DuplicateStricklerTableId, "DUPLICATE_STRICKLER_TABLE", "DUPLICATE_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" );
case EditStricklerTableId:
anOp = new HYDROGUI_StricklerTableOp( aModule, theId == EditStricklerTableId );
break;
+ case DuplicateStricklerTableId:
+ anOp = new HYDROGUI_DuplicateOp( aModule );
+ break;
case CreateCalculationId:
case EditCalculationId:
anOp = new HYDROGUI_CalculationOp( aModule, theId == EditCalculationId );
ImportStricklerTableFromFileId,
ExportStricklerTableFromFileId,
- EditStricklerTableId
+ EditStricklerTableId,
+ DuplicateStricklerTableId
};
<source>EDIT_STRICKLER_TABLE_ICO</source>
<translation>icon_edit_strickler_table.png</translation>
</message>
+ <message>
+ <source>DUPLICATE_STRICKLER_TABLE_ICO</source>
+ <translation>icon_edit_strickler_table.png</translation>
+ </message>
<message>
<source>IMPORT_OBSTACLE_FROM_FILE_ICO</source>
<source>PREF_VIEWER_AUTO_FITALL</source>
<translation>Make automatic fit all after show object operation</translation>
</message>
+ <message>
+ <source>PREF_GROUP_STRICKLER_TABLE</source>
+ <translation>Strickler table</translation>
+ </message>
+ <message>
+ <source>PREF_DEFAULT_STRICKLER_COEFFICIENT</source>
+ <translation>Default Strickler coefficient</translation>
+ </message>
<message>
<source>STRICKLER_TABLE_FILTER</source>
<translation>Strickler table files (*.txt);;All files (*.* *)</translation>
</message>
</context>
+ <context>
+ <name>HYDROGUI_DuplicateOp</name>
+ <message>
+ <source>DUPLICATE</source>
+ <translation>Duplicate</translation>
+ </message>
+ </context>
+
<context>
<name>HYDROGUI_CopyPastePositionOp</name>
<message>
<source>DSK_EDIT_STRICKLER_TABLE</source>
<translation>Edit Strickler table</translation>
</message>
+ <message>
+ <source>DSK_DUPLICATE_STRICKLER_TABLE</source>
+ <translation>Duplicate Strickler table</translation>
+ </message>
<message>
<source>DSK_COPY</source>
<translation>Copy</translation>
<source>MEN_EDIT_STRICKLER_TABLE</source>
<translation>Edit Strickler table</translation>
</message>
+ <message>
+ <source>MEN_DUPLICATE_STRICKLER_TABLE</source>
+ <translation>Duplicate Strickler table</translation>
+ </message>
<message>
<source>MEN_CUT_IMAGES</source>
<translation>Cut images</translation>
<source>STB_EDIT_STRICKLER_TABLE</source>
<translation>Edit Strickler table</translation>
</message>
+ <message>
+ <source>STB_DUPLICATE_STRICKLER_TABLE</source>
+ <translation>Duplicate Strickler table</translation>
+ </message>
<message>
<source>STB_COPY</source>
<translation>Copy</translation>
</section>
<section name="preferences" >
<parameter name="type_of_cursor" value="2"/>
+ <parameter name="default_strickler_coefficient" value="0.00"/>
</section>
</document>