Salome HOME
Merge branch 'BR_v14_rc' into BR_quadtree
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationDlg.h
index eaf3aa26aa6a52a2e81a437d88753c6953b79619..d6105168c3d8807675d5ba204a60bd93d406b9b0 100644 (file)
@@ -1,12 +1,8 @@
-// Copyright (C) 2007-2013  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
-//
+// Copyright (C) 2014-2015  EDF-R&D
 // 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
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
+
 #ifndef HYDROGUI_CALCULATIONDLG_H
 #define HYDROGUI_CALCULATIONDLG_H
 
 #include "HYDROGUI_Wizard.h"
 #include <HYDROData_CalculationCase.h>
+#include <HYDROData_LandCover.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,22 +53,41 @@ public:
 
   void                       reset();
 
+  int                        getMode() const;
+  int                        getLandCoverMode() const;
+
   void                       setObjectName( const QString& theName );
   QString                    getObjectName() const;
 
   void                       setEditedObject( const Handle(HYDROData_CalculationCase) theCase );
 
   void                       setAllGeomObjects( const QStringList& theObjects, const QStringList& theObjectsEntries );
+  QStringList                getAllGeomObjects() const;
+  void                       setAllLandCovers( const QStringList& theObjects, const QStringList& theObjectsEntries );
+  QStringList                getAllLandCovers() const;
   void                       setPolylineNames( const QStringList& theObjects, const QStringList& theObjectsEntries );
+  void                       setStricklerTableNames( const QStringList& theObjects, const QStringList& theObjectsEntries );
   QStringList                getSelectedGeomObjects() const;
+  QStringList                getSelectedLandCovers() const;
   QStringList                getSelectedAvailableGeomObjects() const;
+  QStringList                getSelectedAvailableLandCovers() const;
   QStringList                getSelectedGroups() const;
   QStringList                getSelectedAvailableGroups() const;
   HYDROGUI_Zone*             getCurrentZone() const;
-
+  
   void                       setAvailableGroups( const QStringList& );
 
+  void                       setEditZonesEnabled( const bool theIsEnabled );
+  void                       setEditLandCoverZonesEnabled( const bool theIsEnabled );
+
+  HYDROData_ListOfRules      getRules() const;
+  void                       setRules( const HYDROData_ListOfRules& theRules ) const;
+
+  HYDROData_ListOfRules      getLandCoverRules() const;
+  void                       setLandCoverRules( 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 );
@@ -73,6 +97,16 @@ public slots:
   void                       onAlreadyExists( QString theName );
   void                       refreshZonesBrowser();
   void                       onDataChanged();
+  void                       onOrderChanged();
+
+  void                       setLandCoverMode( int theMode );
+  void                       setStricklerTable( const QString& theStricklerTableName, bool theBlockSignals = true );
+  void                       includeLandCovers( const QStringList& theLandCovers, bool theReset );
+  void                       excludeLandCovers( const QStringList& theLandCovers );
+  void                       refreshLandCoverZonesBrowser();
+  void                       onDataLandCoverChanged();
+  void                       onOrderLandCoverChanged();
+
   /**
    * Process items selection: hide/show bathymetry merge type selector.
    */
@@ -87,10 +121,27 @@ public slots:
   void                       onZonesDropped( const QList<SUIT_DataObject*>& theList, 
     SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
 
+  /**
+   * Process items selection: hide/show Strickler type merge type selector.
+   */
+  void                       onLandCoverZoneSelected( SUIT_DataObject* theObject );
+  /**
+   * Process merge type selection: set the selected Strickler type merge type for the currently selected zone.
+   */
+  void                       onMergeStricklerTypeSelected( int theIndex );
+  /**
+   * Process land cover zones moving. Create a new region with dropped zones or add to existing one.
+   */
+  void                       onLandCoverZonesDropped( const QList<SUIT_DataObject*>& theList, 
+    SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
+
 signals:
+  void                       changeMode( int theMode );  
+
   void                       addObjects();
   void                       removeObjects();
   void                       objectsSelected();
+  void                       orderChanged( bool& isConfirmed );
 
   void                       addGroups();
   void                       removeGroups();
@@ -99,36 +150,73 @@ signals:
   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                       moveZones( SUIT_DataObject* theRegion, const QList<SUIT_DataObject*>& theZonesList, bool theLandCover );
   void                       clickedInZonesBrowser( SUIT_DataObject* );
 
+  void                       changeLandCoverMode( int theMode );
+
+  void                       addLandCovers();
+  void                       removeLandCovers();
+  void                       landCoversSelected();
+  void                       orderLandCoverChanged( bool& isConfirmed );
+
+  void                       createLandCoverRegion( const QList<SUIT_DataObject*>& theLandCoverZonesList );
+  
+  void                       StricklerTableSelected( const QString & theObjName );
+  void                       setMergeStricklerType( int theMergeType, QString& theStricklerTypeName );
+
 protected:
 
   virtual bool               acceptCurrent() const;
 
+protected slots:
+  void OnNewRegion();
+  void OnNewLandCoverRegion();
+
 private:
+  QList<Handle(HYDROData_Entity)> getGeometryObjects();
+  QList<Handle(HYDROData_Entity)> getLandCovers();
 
   QWizardPage*               createObjectsPage();
   QWizardPage*               createGroupsPage();
+  QWizardPage*               createLandCoversPage();
   QWizardPage*               createZonesPage();
+  QWizardPage*               createLandCoverZonesPage();
+
+  QSplitter*                 mySplitter;
+  QSplitter*                 myLandCoverSplitter;
 
   QGroupBox*                 myObjectNameGroup;
   QLineEdit*                 myObjectName;
   HYDROGUI_NameValidator*    myValidator;
 
   QComboBox*                 myPolylineName;
+  QComboBox*                 myStricklerTableName;
+
+  QButtonGroup*              myModeButtons;
+  QButtonGroup*              myLandCoverModeButtons;
 
   QListWidget*               myAvailableGeomObjects;
-  QListWidget*               myGeomObjects;
+  HYDROGUI_OrderedListWidget* myGeomObjects;
+
+  HYDROGUI_PriorityWidget*   myPriorityWidget;
+  HYDROGUI_PriorityWidget*   myLandCoverPriorityWidget;
 
   QListWidget*               myAvailableGroups;
   QListWidget*               myGroups;
 
+  QListWidget*               myAvailableLandCovers;
+  HYDROGUI_OrderedListWidget* myLandCovers;
+
   HYDROGUI_DataBrowser*      myBrowser;
   Handle(HYDROData_CalculationCase) myEditedObject;
   QComboBox*                 myBathymetryChoice;
-  QLabel*                    myBatimetryLabel;
+  QLabel*                    myBathymetryLabel;
   HYDROGUI_Zone*             myCurrentZone;
+
+  HYDROGUI_DataBrowser*      myLandCoverBrowser;
+  QComboBox*                 myStricklerTypeChoice;
+  QLabel*                    myStricklerTypeLabel;
 };
 
 #endif