1 // Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License, or (at your option) any later version.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
24 #ifndef HYDROGUI_CALCULATIONDLG_H
25 #define HYDROGUI_CALCULATIONDLG_H
27 #include "HYDROGUI_Wizard.h"
28 #include <HYDROData_CalculationCase.h>
30 class HYDROGUI_ObjSelector;
31 class HYDROGUI_DataBrowser;
32 class HYDROGUI_NameValidator;
34 class HYDROGUI_OrderedListWidget;
35 class HYDROGUI_PriorityWidget;
37 class SUIT_DataObject;
49 class HYDROGUI_CalculationDlg : public HYDROGUI_Wizard
54 HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle );
55 virtual ~HYDROGUI_CalculationDlg();
61 void setObjectName( const QString& theName );
62 QString getObjectName() const;
64 void setEditedObject( const Handle(HYDROData_CalculationCase) theCase );
66 void setAllGeomObjects( const QStringList& theObjects, const QStringList& theObjectsEntries );
67 QStringList getAllGeomObjects() const;
68 void setPolylineNames( const QStringList& theObjects, const QStringList& theObjectsEntries );
69 QStringList getSelectedGeomObjects() const;
70 QStringList getSelectedAvailableGeomObjects() const;
71 QStringList getSelectedGroups() const;
72 QStringList getSelectedAvailableGroups() const;
73 HYDROGUI_Zone* getCurrentZone() const;
75 void setAvailableGroups( const QStringList& );
77 void setEditZonesEnabled( const bool theIsEnabled );
79 HYDROData_ListOfRules getRules() const;
80 void setRules( const HYDROData_ListOfRules& theRules ) const;
83 void setMode( int theMode );
84 void setBoundary( const QString& theObjName );
85 void includeGeomObjects( const QStringList& theObjects );
86 void excludeGeomObjects( const QStringList& theObjects );
87 void includeGroups( const QStringList& theObjects );
88 void excludeGroups( const QStringList& theObjects );
90 void onAlreadyExists( QString theName );
91 void refreshZonesBrowser();
93 void onOrderChanged();
96 * Process items selection: hide/show bathymetry merge type selector.
98 void onSelected( SUIT_DataObject* theObject );
100 * Process merge type selection: set the selected bathymetry merge type for the currently selected zone.
102 void onMergeTypeSelected( int theIndex );
104 * Process zones moving. Create a new region with dropped zones or add to existing one.
106 void onZonesDropped( const QList<SUIT_DataObject*>& theList,
107 SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
110 void changeMode( int theMode );
113 void removeObjects();
114 void objectsSelected();
118 void groupsSelected();
120 void boundarySelected( const QString & theObjName );
121 void setMergeType( int theMergeType, QString& theBathymetryName );
122 void createRegion( const QList<SUIT_DataObject*>& theZonesList );
123 void moveZones( SUIT_DataObject* theRegion, const QList<SUIT_DataObject*>& theZonesList );
124 void clickedInZonesBrowser( SUIT_DataObject* );
128 virtual bool acceptCurrent() const;
131 QList<Handle(HYDROData_Object)> getGeometryObjects();
133 QWizardPage* createObjectsPage();
134 QWizardPage* createGroupsPage();
135 QWizardPage* createZonesPage();
137 QSplitter* mySplitter;
139 QGroupBox* myObjectNameGroup;
140 QLineEdit* myObjectName;
141 HYDROGUI_NameValidator* myValidator;
143 QComboBox* myPolylineName;
145 QButtonGroup* myModeButtons;
147 QListWidget* myAvailableGeomObjects;
148 HYDROGUI_OrderedListWidget* myGeomObjects;
150 HYDROGUI_PriorityWidget* myPriorityWidget;
152 QListWidget* myAvailableGroups;
153 QListWidget* myGroups;
155 HYDROGUI_DataBrowser* myBrowser;
156 Handle(HYDROData_CalculationCase) myEditedObject;
157 QComboBox* myBathymetryChoice;
158 QLabel* myBathymetryLabel;
159 HYDROGUI_Zone* myCurrentZone;