Salome HOME
Image positioning by two points.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationOp.h
index 46ab3bf0da50860ddc8d57352ec38722f37c5bd3..729db62eb18ef1f585fe153a3fa8e3a68ac63ea2 100644 (file)
 
 #include "HYDROGUI_Operation.h"
 
-#include "HYDROGUI_SplitZonesTool.h"
+#include "HYDROData_SplitToZonesTool.h"
 #include "HYDROGUI_Shape.h"
 
-#include <HYDROData_Calculation.h>
+#include <HYDROData_CalculationCase.h>
+#include <HYDROData_Region.h>
 
 class SUIT_ViewManager;
 class OCCViewer_ViewManager;
+class HYDROGUI_CalculationDlg;
 
 class HYDROGUI_CalculationOp : public HYDROGUI_Operation
 {
   Q_OBJECT
 
-  struct SplittedZone
+  struct Region
   {
-    QString                            ZoneName;
-    QString                            PolylineName;
+    QString                            RegionName;
     QColor                             FillingColor;
     QColor                             BorderColor;
-    HYDROGUI_SplitZonesTool::SplitData SplitData;
+    HYDROData_SplitToZonesTool::SplitData SplitData;
     HYDROGUI_Shape*                    Shape;
+    Handle(HYDROData_Region)           DataRegion;
 
-    SplittedZone()
+    Region()
     : Shape( NULL ),
       FillingColor( Qt::green ),
       BorderColor( Qt::transparent )
     { }
 
-    ~SplittedZone()
+    ~Region()
     {
       if ( Shape )
       {
@@ -62,7 +64,7 @@ class HYDROGUI_CalculationOp : public HYDROGUI_Operation
     }
   };
 
-  typedef QList<SplittedZone>         SplittedZonesList;
+  typedef QList<Region>         RegionsList;
 
 public:
   HYDROGUI_CalculationOp( HYDROGUI_Module* theModule, bool theIsEdit );
@@ -75,24 +77,38 @@ protected:
 
   virtual HYDROGUI_InputPanel*    createInputPanel() const;
 
+  virtual void                    onApply();
   virtual bool                    processApply( int& theUpdateFlags, QString& theErrorMsg );
 
 protected slots:
+  /**
+   * Add geometry objects selected in the module browser to the calculation case.
+   */
+  void                            onAddObjects();
+  /**
+   * Remove selected objects from the calculation case.
+   */
+  void                            onRemoveObjects();
+  /**
+   * Set the given bathymetry merge type to the current zone.
+   */
+  void                            onSetMergeType( int theMergeType, QString theBathymetryName );
   void                            onSplitZones();
   void                            onLastViewClosed( SUIT_ViewManager* );
 
 private:
   void                            createPreview();
   void                            closePreview();
+  void                            updateGeomObjectsList( HYDROGUI_CalculationDlg* thePanel ) const;
 
 private:
   bool                            myIsEdit;
-  Handle(HYDROData_Calculation)   myEditedObject;
+  Handle(HYDROData_CalculationCase) myEditedObject;
 
   SUIT_ViewManager*               myActiveViewManager;
 
   OCCViewer_ViewManager*          myPreviewViewManager;
-  SplittedZonesList               mySplittedZones;
+  RegionsList                     myRegionsList;
 };
 
 #endif