Salome HOME
Refs #288 - the profile section selected and addition mode is activated
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Operations.cxx
index d3a2d04ffb829f096f0e8f862ba440e795eb0983..d2a7d3f42c665707dd0988b5a77939f3066202db 100644 (file)
@@ -51,6 +51,7 @@
 #include "HYDROGUI_ImportProfilesOp.h"
 #include "HYDROGUI_GeoreferencementOp.h"
 #include "HYDROGUI_SetColorOp.h"
+#include "HYDROGUI_BathymetryBoundsOp.h"
 #include "HYDROGUI_Tool.h"
 
 #include <HYDROData_Document.h>
@@ -105,6 +106,7 @@ void HYDROGUI_Module::createActions()
   createAction( PasteId, "PASTE", "", Qt::CTRL + Qt::Key_V );
 
   createAction( UpdateObjectId, "UPDATE_OBJECT" );
+  createAction( ForcedUpdateObjectId, "FORCED_UPDATE_OBJECT" );
 
   createAction( ImportImageId, "IMPORT_IMAGE", "IMPORT_IMAGE_ICO", Qt::CTRL + Qt::Key_I );
   createAction( EditImportedImageId, "EDIT_IMPORTED_IMAGE", "EDIT_IMPORTED_IMAGE_ICO" );
@@ -126,6 +128,7 @@ void HYDROGUI_Module::createActions()
   
   createAction( ImportBathymetryId, "IMPORT_BATHYMETRY", "IMPORT_BATHYMETRY_ICO", Qt::CTRL + Qt::Key_B );
   createAction( EditImportedBathymetryId, "EDIT_IMPORTED_BATHYMETRY", "EDIT_IMPORTED_BATHYMETRY_ICO" );
+  createAction( BathymetryBoundsId, "BATHYMETRY_BOUNDS", "BATHYMETRY_BOUNDS_ICO" );
 
   createAction( CreateImmersibleZoneId, "CREATE_IMMERSIBLE_ZONE", "CREATE_IMMERSIBLE_ZONE_ICO" );
   createAction( EditImmersibleZoneId, "EDIT_IMMERSIBLE_ZONE", "EDIT_IMMERSIBLE_ZONE_ICO" );
@@ -388,7 +391,8 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
     anOp = new HYDROGUI_ExportImageOp( aModule );
     break;
   case UpdateObjectId:
-    anOp = new HYDROGUI_UpdateObjectOp( aModule );
+  case ForcedUpdateObjectId:
+    anOp = new HYDROGUI_UpdateObjectOp( aModule, theId == ForcedUpdateObjectId );
     break;
   case RemoveImageRefsId:
     anOp = new HYDROGUI_RemoveImageRefsOp( aModule );
@@ -418,6 +422,9 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
   case EditImportedBathymetryId:
     anOp = new HYDROGUI_ImportBathymetryOp( aModule, theId == EditImportedBathymetryId  );
     break;
+  case BathymetryBoundsId:
+    anOp = new HYDROGUI_BathymetryBoundsOp( aModule );
+    break;
   case CreateImmersibleZoneId:
   case EditImmersibleZoneId:
     anOp = new HYDROGUI_ImmersibleZoneOp( aModule, theId == EditImmersibleZoneId );
@@ -456,9 +463,6 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
   case ImportObstacleFromFileId:
     anOp = new HYDROGUI_ImportObstacleFromFileOp( aModule );
     break;
-  case ImportCreatedPrimitiveId:
-    anOp = new HYDROGUI_ImportGeomObjectOp( aModule, HYDROGUI_ImportGeomObjectOp::ImportCreatedAsObstacle );
-    break;
   case ImportGeomObjectAsObstacleId:
     anOp = new HYDROGUI_ImportGeomObjectOp( aModule, HYDROGUI_ImportGeomObjectOp::ImportSelectedAsObstacle );
     break;
@@ -466,10 +470,12 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
     anOp = new HYDROGUI_ImportGeomObjectOp( aModule, HYDROGUI_ImportGeomObjectOp::ImportSelectedAsPolyline );
     break;
   case CreateBoxId:
-    application()->activateOperation( "Geometry", GEOMOp::OpBox );
+    anOp = new HYDROGUI_ImportGeomObjectOp( aModule, 
+      HYDROGUI_ImportGeomObjectOp::ImportCreatedAsObstacle, GEOMOp::OpBox );
     break;
   case CreateCylinderId:
-    application()->activateOperation( "Geometry", GEOMOp::OpCylinder );
+    anOp = new HYDROGUI_ImportGeomObjectOp( aModule, 
+      HYDROGUI_ImportGeomObjectOp::ImportCreatedAsObstacle, GEOMOp::OpCylinder );
     break;
   case DeleteId:
     anOp = new HYDROGUI_DeleteOp( aModule );
@@ -502,35 +508,6 @@ bool HYDROGUI_Module::reusableOperation( const int id )
   return LightApp_Module::reusableOperation( id );
 }
 
-/**
- * Called when the operation perfomed by another module is finished.
- * \param theModuleName the name of the module which perfomed the operation
- * \param theOperationName the operation name
- * \param theEntryList the list of the created objects entries
- */
-void HYDROGUI_Module::onExternalOperationFinished( const QString& theModuleName,
-                                                   const QString& theOperationName,
-                                                   const QStringList& theEntryList )
-{
-  // Process "Geometry" module operations with non-empty list of created objects only
-  if ( theModuleName != "Geometry" || theEntryList.isEmpty() ) {
-    return;
-  }
-  
-  // Start import GEOM object operation
-  myGeomObjectsToImport = theEntryList;
-  startOperation( ImportCreatedPrimitiveId );
-  myGeomObjectsToImport.clear();
-}
-
-/**
- * Returns the list of entries of GEOM objects to be imported.
- */
-QStringList HYDROGUI_Module::GetGeomObjectsToImport()
-{
-  return myGeomObjectsToImport;
-}
-
 /**
  * Returns true if the object with the given entry can be renamed.
  * @param theEntry the object entry