Salome HOME
Draft version of "Find River Bottom", new viewer dialog base class, new component...
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationDlg.h
index 3e1374790ea67b0458cf387d98fd75ba40ccabde..e8e14ebc69f245e59d11ceac8d7683c765e61f74 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -6,7 +6,7 @@
 // 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.
+// 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
@@ -20,6 +20,7 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
+
 #ifndef HYDROGUI_CALCULATIONDLG_H
 #define HYDROGUI_CALCULATIONDLG_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_DataBrowser;
-class HYDROGUI_NameValidator;
-class SUIT_DataObject;
-class HYDROGUI_Zone;
+
 
 class HYDROGUI_CalculationDlg : public HYDROGUI_Wizard
 {
@@ -48,19 +56,42 @@ public:
 
   void                       reset();
 
+  int                        getMode() const;
+
   void                       setObjectName( const QString& theName );
   QString                    getObjectName() const;
 
   void                       setEditedObject( const Handle(HYDROData_CalculationCase) theCase );
 
-  void                       setGeomObjects( const QStringList& theObjects );
-  void                       setSelectedGeomObjects( const QStringList& theObjects );
+  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.
    */
@@ -69,28 +100,62 @@ public slots:
    * 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 );
 
 signals:
+  void                       changeMode( int theMode );
+
   void                       addObjects();
   void                       removeObjects();
-  void                       splitZones();
-  void                       setMergeType( int theMergeType, QString theBathymetryName );
+  void                       objectsSelected();
+
+  void                       addGroups();
+  void                       removeGroups();
+  void                       groupsSelected();
+
+  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;
 
-  QListWidget*               myGeomObjects;
+  QComboBox*                 myPolylineName;
+
+  QButtonGroup*              myModeButtons;
+
+  QListWidget*               myAvailableGeomObjects;
+  HYDROGUI_OrderedListWidget* myGeomObjects;
+
+  HYDROGUI_PriorityWidget*   myPriorityWidget;
+
+  QListWidget*               myAvailableGroups;
+  QListWidget*               myGroups;
 
   HYDROGUI_DataBrowser*      myBrowser;
   Handle(HYDROData_CalculationCase) myEditedObject;
   QComboBox*                 myBathymetryChoice;
-  QLabel*                    myBatimetryLabel;
+  QLabel*                    myBathymetryLabel;
   HYDROGUI_Zone*             myCurrentZone;
 };