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 setEditLandCoversEnabled( const bool theIsEnabled );
83 HYDROData_ListOfRules getRules() const;
84 void setRules( const HYDROData_ListOfRules& theRules ) const;
87 void setMode( int theMode );
88 void setBoundary( const QString& theObjName );
89 void includeGeomObjects( const QStringList& theObjects );
90 void excludeGeomObjects( const QStringList& theObjects );
91 void includeGroups( const QStringList& theObjects );
92 void excludeGroups( const QStringList& theObjects );
94 void onAlreadyExists( QString theName );
95 void refreshZonesBrowser();
97 void onOrderChanged();
99 void setLandCoverMode( int theMode );
100 void setStricklerTable( const QString& theStricklerTableName );
101 void includeLandCovers( const QStringList& theLandCovers );
102 void excludeLandCovers( const QStringList& theLandCovers );
103 void onOrderLandCoverChanged();
106 * Process items selection: hide/show bathymetry merge type selector.
108 void onSelected( SUIT_DataObject* theObject );
110 * Process merge type selection: set the selected bathymetry merge type for the currently selected zone.
112 void onMergeTypeSelected( int theIndex );
114 * Process zones moving. Create a new region with dropped zones or add to existing one.
116 void onZonesDropped( const QList<SUIT_DataObject*>& theList,
117 SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
120 void changeMode( int theMode );
123 void removeObjects();
124 void objectsSelected();
125 void orderChanged( bool& isConfirmed );
129 void groupsSelected();
131 void boundarySelected( const QString & theObjName );
132 void setMergeType( int theMergeType, QString& theBathymetryName );
133 void createRegion( const QList<SUIT_DataObject*>& theZonesList );
134 void moveZones( SUIT_DataObject* theRegion, const QList<SUIT_DataObject*>& theZonesList );
135 void clickedInZonesBrowser( SUIT_DataObject* );
137 void changeLandCoverMode( int theMode );
139 void addLandCovers();
140 void removeLandCovers();
141 void landCoversSelected();
142 void orderLandCoverChanged( bool& isConfirmed );
144 void StricklerTableSelected( const QString & theObjName );
148 virtual bool acceptCurrent() const;
154 QList<Handle(HYDROData_Object)> getGeometryObjects();
155 QList<Handle(HYDROData_LandCover)> getLandCovers();
157 QWizardPage* createObjectsPage();
158 QWizardPage* createGroupsPage();
159 QWizardPage* createLandCoversPage();
160 QWizardPage* createZonesPage();
161 QWizardPage* createLandCoversPartitionPage();
163 QSplitter* mySplitter;
164 QSplitter* myLandCoverSplitter;
166 QGroupBox* myObjectNameGroup;
167 QLineEdit* myObjectName;
168 HYDROGUI_NameValidator* myValidator;
170 QComboBox* myPolylineName;
171 QComboBox* myStricklerTableName;
173 QButtonGroup* myModeButtons;
174 QButtonGroup* myLandCoverModeButtons;
176 QListWidget* myAvailableGeomObjects;
177 HYDROGUI_OrderedListWidget* myGeomObjects;
179 HYDROGUI_PriorityWidget* myPriorityWidget;
180 HYDROGUI_PriorityWidget* myLandCoverPriorityWidget;
182 QListWidget* myAvailableGroups;
183 QListWidget* myGroups;
185 QListWidget* myAvailableLandCovers;
186 HYDROGUI_OrderedListWidget* myLandCovers;
188 HYDROGUI_DataBrowser* myBrowser;
189 Handle(HYDROData_CalculationCase) myEditedObject;
190 QComboBox* myBathymetryChoice;
191 QLabel* myBathymetryLabel;
192 HYDROGUI_Zone* myCurrentZone;
194 HYDROGUI_DataBrowser* myLandCoverBrowser;