#include "HYDROGUI_ChannelOp.h"
#include "HYDROGUI_DataModel.h"
#include "HYDROGUI_DeleteOp.h"
+#include "HYDROGUI_DigueOp.h"
#include "HYDROGUI_ExportImageOp.h"
#include "HYDROGUI_ImportImageOp.h"
#include "HYDROGUI_ImportBathymetryOp.h"
createAction( CreateChannelId, "CREATE_CHANNEL", "CREATE_CHANNEL_ICO" );
createAction( EditChannelId, "EDIT_CHANNEL", "EDIT_CHANNEL_ICO" );
+ createAction( CreateDigueId, "CREATE_DIGUE", "CREATE_DIGUE_ICO" );
+ createAction( EditDigueId, "EDIT_DIGUE", "EDIT_DIGUE_ICO" );
+
createAction( ImportObstacleFromFileId, "IMPORT_OBSTACLE_FROM_FILE", "IMPORT_OBSTACLE_FROM_FILE_ICO" );
createAction( ImportGeomObjectId, "IMPORT_GEOM_OBJECT", "IMPORT_GEOM_OBJECT_ICO" );
createAction( CreateBoxId, "CREATE_BOX", "CREATE_BOX_ICO" );
int anArtificialMenuId = createMenu( tr( "MEN_DESK_ARTIFICIAL" ), aHydroId, -1 );
createMenu( CreateChannelId, anArtificialMenuId, -1, -1 );
+ createMenu( CreateDigueId, anArtificialMenuId, -1, -1 );
int aNaturalMenuId = createMenu( tr( "MEN_DESK_NATURAL" ), aHydroId, -1 );
createMenu( CreateImmersibleZoneId, aNaturalMenuId, -1, -1 );
createTool( separator(), aToolBar );
createTool( CreateChannelId, aToolBar );
+ createTool( CreateDigueId, aToolBar );
createTool( separator(), aToolBar );
createTool( CreateImmersibleZoneId, aToolBar );
case EditChannelId:
anOp = new HYDROGUI_ChannelOp( aModule, theId == EditChannelId );
break;
+ case CreateDigueId:
+ case EditDigueId:
+ anOp = new HYDROGUI_DigueOp( aModule, theId == EditDigueId );
+ break;
case CreateCalculationId:
case EditCalculationId:
anOp = new HYDROGUI_CalculationOp( aModule, theId == EditCalculationId );
bool HYDROGUI_Module::renameObject( const QString& theEntry, const QString& theName )
{
Handle(HYDROData_Entity) anEntity = getDataModel()->objectByEntry( theEntry );
- bool aRes = !anEntity.IsNull();
- if ( aRes )
+ bool aRes = false;
+ if ( !anEntity.IsNull() )
{
HYDROGUI_DataModel* aModel = getDataModel();
if( aModel )
{
// check that there are no other objects with the same name in the document
Handle(HYDROData_Entity) anObject = HYDROGUI_Tool::FindObjectByName( this, theName );
- aRes = anObject.IsNull();
- if ( aRes )
+ if ( anObject.IsNull() )
{
- aRes = aModel->rename( anEntity, theName );
+ SUIT_Operation* anOp = application()->activeStudy()->activeOperation();
+ if ( anOp && anOp->inherits( "HYDROGUI_CalculationOp" ) )
+ {
+ anEntity->SetName( theName );
+ aRes = true;
+ }
+ else
+ {
+ aRes = aModel->rename( anEntity, theName );
+ }
}
else
{