1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef HYDROGUI_CALCULATIONDLG_H
21 #define HYDROGUI_CALCULATIONDLG_H
23 #include "HYDROGUI_Wizard.h"
24 #include <HYDROData_CalculationCase.h>
25 #include <HYDROData_LandCover.h>
27 class HYDROGUI_ObjSelector;
28 class HYDROGUI_DataBrowser;
29 class HYDROGUI_NameValidator;
31 class HYDROGUI_OrderedListWidget;
32 class HYDROGUI_PriorityWidget;
34 class SUIT_DataObject;
46 class HYDROGUI_CalculationDlg : public HYDROGUI_Wizard
51 HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle );
52 virtual ~HYDROGUI_CalculationDlg();
57 int getLandCoverMode() const;
59 void setObjectName( const QString& theName );
60 QString getObjectName() const;
62 void setEditedObject( const Handle(HYDROData_CalculationCase) theCase );
64 void setAllGeomObjects( const QStringList& theObjects, const QStringList& theObjectsEntries );
65 QStringList getAllGeomObjects() const;
66 void setAllLandCovers( const QStringList& theObjects, const QStringList& theObjectsEntries );
67 QStringList getAllLandCovers() const;
68 void setPolylineNames( const QStringList& theObjects, const QStringList& theObjectsEntries );
69 void setStricklerTableNames( const QStringList& theObjects, const QStringList& theObjectsEntries );
70 QStringList getSelectedGeomObjects() const;
71 QStringList getSelectedLandCovers() const;
72 QStringList getSelectedAvailableGeomObjects() const;
73 QStringList getSelectedAvailableLandCovers() const;
74 QStringList getSelectedGroups() const;
75 QStringList getSelectedAvailableGroups() const;
76 HYDROGUI_Zone* getCurrentZone() const;
78 void setAvailableGroups( const QStringList& );
80 void setEditZonesEnabled( const bool theIsEnabled );
81 void setEditLandCoverZonesEnabled( const bool theIsEnabled );
83 HYDROData_ListOfRules getRules() const;
84 void setRules( const HYDROData_ListOfRules& theRules ) const;
86 HYDROData_ListOfRules getLandCoverRules() const;
87 void setLandCoverRules( const HYDROData_ListOfRules& theRules ) const;
90 void setMode( int theMode );
91 void setBoundary( const QString& theObjName );
92 void includeGeomObjects( const QStringList& theObjects );
93 void excludeGeomObjects( const QStringList& theObjects );
94 void includeGroups( const QStringList& theObjects );
95 void excludeGroups( const QStringList& theObjects );
97 void onAlreadyExists( QString theName );
98 void refreshZonesBrowser();
100 void onOrderChanged();
101 void onRuleChanged();
103 void setLandCoverMode( int theMode );
104 void setStricklerTable( const QString& theStricklerTableName, bool theBlockSignals = true );
105 void includeLandCovers( const QStringList& theLandCovers, bool theReset );
106 void excludeLandCovers( const QStringList& theLandCovers );
107 void refreshLandCoverZonesBrowser();
108 void onDataLandCoverChanged();
109 void onOrderLandCoverChanged();
110 void onLandCoverRuleChanged();
113 * Process items selection: hide/show bathymetry merge type selector.
115 void onSelected( SUIT_DataObject* theObject );
117 * Process merge type selection: set the selected bathymetry merge type for the currently selected zone.
119 void onMergeTypeSelected( int theIndex );
121 * Process zones moving. Create a new region with dropped zones or add to existing one.
123 void onZonesDropped( const QList<SUIT_DataObject*>& theList,
124 SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
127 * Process items selection: hide/show Strickler type merge type selector.
129 void onLandCoverZoneSelected( SUIT_DataObject* theObject );
131 * Process merge type selection: set the selected Strickler type merge type for the currently selected zone.
133 void onMergeStricklerTypeSelected( int theIndex );
135 * Process land cover zones moving. Create a new region with dropped zones or add to existing one.
137 void onLandCoverZonesDropped( const QList<SUIT_DataObject*>& theList,
138 SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
141 void changeMode( int theMode );
144 void removeObjects();
145 void objectsSelected();
146 void orderChanged( bool& isConfirmed );
147 void ruleChanged( bool& isConfirmed );
151 void groupsSelected();
153 void boundarySelected( const QString & theObjName );
154 void setMergeType( int theMergeType, QString& theBathymetryName );
155 void createRegion( const QList<SUIT_DataObject*>& theZonesList );
156 void moveZones( SUIT_DataObject* theRegion, const QList<SUIT_DataObject*>& theZonesList, bool theLandCover );
157 void clickedInZonesBrowser( SUIT_DataObject* );
159 void changeLandCoverMode( int theMode );
161 void addLandCovers();
162 void removeLandCovers();
163 void landCoversSelected();
164 void orderLandCoverChanged( bool& isConfirmed );
165 void ruleLandCoverChanged( bool& isConfirmed );
167 void createLandCoverRegion( const QList<SUIT_DataObject*>& theLandCoverZonesList );
169 void StricklerTableSelected( const QString & theObjName );
170 void setMergeStricklerType( int theMergeType, QString& theStricklerTypeName );
174 virtual bool acceptCurrent() const;
178 void OnNewLandCoverRegion();
181 QList<Handle(HYDROData_Entity)> getGeometryObjects();
182 QList<Handle(HYDROData_Entity)> getLandCovers();
184 QWizardPage* createObjectsPage();
185 QWizardPage* createGroupsPage();
186 QWizardPage* createLandCoversPage();
187 QWizardPage* createZonesPage();
188 QWizardPage* createLandCoverZonesPage();
190 QSplitter* mySplitter;
191 QSplitter* myLandCoverSplitter;
193 QGroupBox* myObjectNameGroup;
194 QLineEdit* myObjectName;
195 HYDROGUI_NameValidator* myValidator;
197 QComboBox* myPolylineName;
198 QComboBox* myStricklerTableName;
200 QButtonGroup* myModeButtons;
201 QButtonGroup* myLandCoverModeButtons;
203 QListWidget* myAvailableGeomObjects;
204 HYDROGUI_OrderedListWidget* myGeomObjects;
206 HYDROGUI_PriorityWidget* myPriorityWidget;
207 HYDROGUI_PriorityWidget* myLandCoverPriorityWidget;
209 QListWidget* myAvailableGroups;
210 QListWidget* myGroups;
212 QListWidget* myAvailableLandCovers;
213 HYDROGUI_OrderedListWidget* myLandCovers;
215 HYDROGUI_DataBrowser* myBrowser;
216 Handle(HYDROData_CalculationCase) myEditedObject;
217 QComboBox* myBathymetryChoice;
218 QLabel* myBathymetryLabel;
219 HYDROGUI_Zone* myCurrentZone;
221 HYDROGUI_DataBrowser* myLandCoverBrowser;
222 QComboBox* myStricklerTypeChoice;
223 QLabel* myStricklerTypeLabel;