Salome HOME
merge BR_hydro_v_1_0_4 on BR_quadtree
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationDlg.h
index c63fffa51aafe390f669b0a72d1941b621d7a110..5010b7d2cba7d697f1d04e205935d4ff4767c4c1 100644 (file)
 #ifndef HYDROGUI_CALCULATIONDLG_H
 #define HYDROGUI_CALCULATIONDLG_H
 
-#include "HYDROGUI_InputPanel.h"
+#include "HYDROGUI_Wizard.h"
+#include <HYDROData_CalculationCase.h>
 
 class HYDROGUI_ObjSelector;
+class HYDROGUI_DataBrowser;
+class HYDROGUI_NameValidator;
+class HYDROGUI_Zone;
+class HYDROGUI_OrderedListWidget;
+class HYDROGUI_PriorityWidget;
+
+class SUIT_DataObject;
+
+class QButtonGroup;
 class QGroupBox;
 class QLineEdit;
 class QListWidget;
+class QComboBox;
+class QLabel;
+class QSplitter;
+class QStringList;
 
-class HYDROGUI_CalculationDlg : public HYDROGUI_InputPanel
+
+class HYDROGUI_CalculationDlg : public HYDROGUI_Wizard
 {
   Q_OBJECT
 
@@ -40,34 +55,107 @@ public:
 
   void                       reset();
 
+  int                        getMode() const;
+
   void                       setObjectName( const QString& theName );
   QString                    getObjectName() const;
 
-  void                       setPolylineName( const QString& theName );
-  QString                    getPolylineName() const;
+  void                       setEditedObject( const Handle(HYDROData_CalculationCase) theCase );
+
+  void                       setAllGeomObjects( const QStringList& theObjects, const QStringList& theObjectsEntries );
+  QStringList                getAllGeomObjects() const;
+  void                       setPolylineNames( const QStringList& theObjects, const QStringList& theObjectsEntries );
+  QStringList                getSelectedGeomObjects() const;
+  QStringList                getSelectedAvailableGeomObjects() const;
+  QStringList                getSelectedGroups() const;
+  QStringList                getSelectedAvailableGroups() const;
+  HYDROGUI_Zone*             getCurrentZone() const;
+  
+  void                       setAvailableGroups( const QStringList& );
+
+  void                       setEditZonesEnabled( const bool theIsEnabled );
+
+  HYDROData_ListOfRules      getRules() const;
+  void                       setRules( const HYDROData_ListOfRules& theRules ) const;
+
+public slots:
+  void                       setMode( int theMode );
+  void                       setBoundary( const QString& theObjName );
+  void                       includeGeomObjects( const QStringList& theObjects );
+  void                       excludeGeomObjects( const QStringList& theObjects );
+  void                       includeGroups( const QStringList& theObjects );
+  void                       excludeGroups( const QStringList& theObjects );
+  void                       onEmptyName();
+  void                       onAlreadyExists( QString theName );
+  void                       refreshZonesBrowser();
+  void                       onDataChanged();
+  void                       onOrderChanged();
+
+  /**
+   * Process items selection: hide/show bathymetry merge type selector.
+   */
+  void                       onSelected( SUIT_DataObject* theObject );
+  /**
+   * Process merge type selection: set the selected bathymetry merge type for the currently selected zone.
+   */
+  void                       onMergeTypeSelected( int theIndex );
+  /**
+   * Process zones moving. Create a new region with dropped zones or add to existing one.
+   */
+  void                       onZonesDropped( const QList<SUIT_DataObject*>& theList, 
+    SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
 
-  void                       setZones( const QStringList& theZones );
-  void                       setSelectedZones( const QStringList& theZones );
-  QStringList                getSelectedZones() const;
+signals:
+  void                       changeMode( int theMode );
 
-  void                       setRegions( const QStringList& theRegions );
-  QStringList                getRegions() const;
+  void                       addObjects();
+  void                       removeObjects();
+  void                       objectsSelected();
 
-  void                       setSplitZonesPrefix( const QString& theName );
-  QString                    getSplitZonesPrefix() const;
+  void                       addGroups();
+  void                       removeGroups();
+  void                       groupsSelected();
 
-signals:
-  void                       SplitZones();
+  void                       boundarySelected( const QString & theObjName );
+  void                       setMergeType( int theMergeType, QString& theBathymetryName );
+  void                       createRegion( const QList<SUIT_DataObject*>& theZonesList );
+  void                       moveZones( SUIT_DataObject* theRegion, const QList<SUIT_DataObject*>& theZonesList );
+  void                       clickedInZonesBrowser( SUIT_DataObject* );
+
+protected:
+
+  virtual bool               acceptCurrent() const;
 
 private:
+  QList<Handle(HYDROData_Object)> getGeometryObjects();
+
+  QWizardPage*               createObjectsPage();
+  QWizardPage*               createGroupsPage();
+  QWizardPage*               createZonesPage();
+
+  QSplitter*                 mySplitter;
+
   QGroupBox*                 myObjectNameGroup;
   QLineEdit*                 myObjectName;
+  HYDROGUI_NameValidator*    myValidator;
+
+  QComboBox*                 myPolylineName;
+
+  QButtonGroup*              myModeButtons;
+
+  QListWidget*               myAvailableGeomObjects;
+  HYDROGUI_OrderedListWidget* myGeomObjects;
+
+  HYDROGUI_PriorityWidget*   myPriorityWidget;
 
-  HYDROGUI_ObjSelector*      myBndPolyline;
+  QListWidget*               myAvailableGroups;
+  QListWidget*               myGroups;
 
-  QListWidget*               myZones;
-  QListWidget*               myRegions;
-  QLineEdit*                 mySplittedZonesPrefix;
+  HYDROGUI_DataBrowser*      myBrowser;
+  Handle(HYDROData_CalculationCase) myEditedObject;
+  QComboBox*                 myBathymetryChoice;
+  QLabel*                    myBathymetryLabel;
+  HYDROGUI_Zone*             myCurrentZone;
 };
 
 #endif