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>
26 class HYDROGUI_ObjSelector;
27 class HYDROGUI_DataBrowser;
28 class HYDROGUI_NameValidator;
30 class HYDROGUI_OrderedListWidget;
31 class HYDROGUI_PriorityWidget;
33 class SUIT_DataObject;
45 class HYDROGUI_CalculationDlg : public HYDROGUI_Wizard
50 HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle );
51 virtual ~HYDROGUI_CalculationDlg();
57 void setObjectName( const QString& theName );
58 QString getObjectName() const;
60 void setEditedObject( const Handle(HYDROData_CalculationCase) theCase );
62 void setAllGeomObjects( const QStringList& theObjects, const QStringList& theObjectsEntries );
63 QStringList getAllGeomObjects() const;
64 void setPolylineNames( const QStringList& theObjects, const QStringList& theObjectsEntries );
65 QStringList getSelectedGeomObjects() const;
66 QStringList getSelectedAvailableGeomObjects() const;
67 QStringList getSelectedGroups() const;
68 QStringList getSelectedAvailableGroups() const;
69 HYDROGUI_Zone* getCurrentZone() const;
71 void setAvailableGroups( const QStringList& );
73 void setEditZonesEnabled( const bool theIsEnabled );
75 HYDROData_ListOfRules getRules() const;
76 void setRules( const HYDROData_ListOfRules& theRules ) const;
79 void setMode( int theMode );
80 void setBoundary( const QString& theObjName );
81 void includeGeomObjects( const QStringList& theObjects );
82 void excludeGeomObjects( const QStringList& theObjects );
83 void includeGroups( const QStringList& theObjects );
84 void excludeGroups( const QStringList& theObjects );
86 void onAlreadyExists( QString theName );
87 void refreshZonesBrowser();
89 void onOrderChanged();
92 * Process items selection: hide/show bathymetry merge type selector.
94 void onSelected( SUIT_DataObject* theObject );
96 * Process merge type selection: set the selected bathymetry merge type for the currently selected zone.
98 void onMergeTypeSelected( int theIndex );
100 * Process zones moving. Create a new region with dropped zones or add to existing one.
102 void onZonesDropped( const QList<SUIT_DataObject*>& theList,
103 SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
106 void changeMode( int theMode );
109 void removeObjects();
110 void objectsSelected();
114 void groupsSelected();
116 void boundarySelected( const QString & theObjName );
117 void setMergeType( int theMergeType, QString& theBathymetryName );
118 void createRegion( const QList<SUIT_DataObject*>& theZonesList );
119 void moveZones( SUIT_DataObject* theRegion, const QList<SUIT_DataObject*>& theZonesList );
120 void clickedInZonesBrowser( SUIT_DataObject* );
124 virtual bool acceptCurrent() const;
130 QList<Handle(HYDROData_Object)> getGeometryObjects();
132 QWizardPage* createObjectsPage();
133 QWizardPage* createGroupsPage();
134 QWizardPage* createZonesPage();
136 QSplitter* mySplitter;
138 QGroupBox* myObjectNameGroup;
139 QLineEdit* myObjectName;
140 HYDROGUI_NameValidator* myValidator;
142 QComboBox* myPolylineName;
144 QButtonGroup* myModeButtons;
146 QListWidget* myAvailableGeomObjects;
147 HYDROGUI_OrderedListWidget* myGeomObjects;
149 HYDROGUI_PriorityWidget* myPriorityWidget;
151 QListWidget* myAvailableGroups;
152 QListWidget* myGroups;
154 HYDROGUI_DataBrowser* myBrowser;
155 Handle(HYDROData_CalculationCase) myEditedObject;
156 QComboBox* myBathymetryChoice;
157 QLabel* myBathymetryLabel;
158 HYDROGUI_Zone* myCurrentZone;