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_LandCoverMap.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();
58 void setObjectName( const QString& theName );
59 QString getObjectName() const;
61 void setEditedObject( const Handle(HYDROData_CalculationCase) theCase );
63 void setAllGeomObjects( const QStringList& theObjects, const QStringList& theObjectsEntries );
64 QStringList getAllGeomObjects() const;
65 void setPolylineNames( const QStringList& theObjects, const QStringList& theObjectsEntries );
66 void setLandCoverMapsNames( const QStringList& theObjects, const QStringList& theObjectsEntries );
67 void setStricklerTableNames( const QStringList& theObjects, const QStringList& theObjectsEntries );
68 QStringList getSelectedGeomObjects() const;
69 QStringList getSelectedAvailableGeomObjects() const;
70 QStringList getSelectedGroups() const;
71 QStringList getSelectedAvailableGroups() const;
72 QStringList getSelectedBoundaryPolygons() const;
73 QStringList getSelectedISBoundaryPolygons() const;
74 QStringList getSelectedAvailableBoundaryPolygons() const;
75 HYDROGUI_Zone* getCurrentZone() const;
77 void setAvailableGroups( const QStringList& );
79 void setAvailableBoundaryPolygons( const QStringList&, const QVector<int>& );
81 void setEditZonesEnabled( const bool theIsEnabled );
83 HYDROData_ListOfRules getRules() const;
84 void setRules( const HYDROData_ListOfRules& theRules ) const;
86 QList<Handle(HYDROData_Entity)> getGeometryObjects(bool GeomObjOnly = true);
89 void setMode( int theMode );
90 void setBoundary( const QString& theObjName );
91 void includeGeomObjects( const QStringList& theObjects );
92 void excludeGeomObjects( const QStringList& theObjects );
93 void includeGroups( const QStringList& theObjects );
94 void excludeGroups( const QStringList& theObjects );
96 void includeBoundaryPolygons( const QStringList& theObjects );
97 void includeISBoundaryPolygons( const QStringList& theObjects );
99 void excludeBoundaryPolygons( const QStringList& theObjects );
100 void excludeISBoundaryPolygons( const QStringList& theObjects );
104 void onAlreadyExists( QString theName );
105 void refreshZonesBrowser();
106 void onDataChanged();
107 void onOrderChanged();
108 void onRuleChanged();
110 void setStricklerTable( const QString& theStricklerTableName, bool theBlockSignals = true );
111 void setLandCoverMap( const QString& theLandCoverMapName, bool theBlockSignals = true );
114 * Process items selection: hide/show bathymetry merge type selector.
116 void onSelected( SUIT_DataObject* theObject );
118 * Process merge type selection: set the selected bathymetry merge type for the currently selected zone.
120 void onMergeTypeSelected( int theIndex );
122 * Process zones moving. Create a new region with dropped zones or add to existing one.
124 void onZonesDropped( const QList<SUIT_DataObject*>& theList,
125 SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
128 void changeMode( int theMode );
131 void removeObjects();
132 void objectsSelected();
133 void orderChanged( bool& isConfirmed );
134 void ruleChanged( bool& isConfirmed );
138 void groupsSelected();
140 void addBoundaryPolygons();
141 void removeBoundaryPolygons();
143 void boundarySelected( const QString & theObjName );
144 void setMergeType( int theMergeType, QString& theBathymetryName );
145 void createRegion( const QList<SUIT_DataObject*>& theZonesList );
146 void moveZones( SUIT_DataObject* theRegion, const QList<SUIT_DataObject*>& theZonesList );
147 void clickedInZonesBrowser( SUIT_DataObject* );
149 void landCoverMapSelected( const QString & theObjName );
151 void StricklerTableSelected( const QString & theObjName );
153 void regenerateColors();
157 virtual bool acceptCurrent() const;
165 QWizardPage* createObjectsPage();
166 QWizardPage* createGroupsPage();
167 QWizardPage* createBoundaryPolygonsPage();
169 QWizardPage* createLandCoverMapPage();
170 QWizardPage* createZonesPage();
172 QSplitter* mySplitter;
174 QGroupBox* myObjectNameGroup;
175 QLineEdit* myObjectName;
176 HYDROGUI_NameValidator* myValidator;
178 QComboBox* myPolylineName;
179 QComboBox* myLandCoverMapName;
180 QComboBox* myStricklerTableName;
182 QButtonGroup* myModeButtons;
184 QListWidget* myAvailableGeomObjects;
185 HYDROGUI_OrderedListWidget* myGeomObjects;
187 HYDROGUI_PriorityWidget* myPriorityWidget;
189 QListWidget* myAvailableGroups;
190 QListWidget* myGroups;
192 QListWidget* myAvailableBoundaryPolygons;
193 QListWidget* myBoundaryPolygons;
194 QListWidget* myISBoundaryPolygons;
197 HYDROGUI_DataBrowser* myBrowser;
198 Handle(HYDROData_CalculationCase) myEditedObject;
199 QComboBox* myBathymetryChoice;
200 QLabel* myBathymetryLabel;
201 HYDROGUI_Zone* myCurrentZone;