1 // Copyright (C) 2007-2013 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.
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
23 #ifndef HYDROGUI_CALCULATIONDLG_H
24 #define HYDROGUI_CALCULATIONDLG_H
26 #include "HYDROGUI_Wizard.h"
27 #include <HYDROData_CalculationCase.h>
29 class HYDROGUI_ObjSelector;
30 class HYDROGUI_DataBrowser;
31 class HYDROGUI_NameValidator;
33 class HYDROGUI_OrderedListWidget;
34 class HYDROGUI_PriorityWidget;
36 class SUIT_DataObject;
48 class HYDROGUI_CalculationDlg : public HYDROGUI_Wizard
53 HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle );
54 virtual ~HYDROGUI_CalculationDlg();
60 void setObjectName( const QString& theName );
61 QString getObjectName() const;
63 void setEditedObject( const Handle(HYDROData_CalculationCase) theCase );
65 void setAllGeomObjects( const QStringList& theObjects, const QStringList& theObjectsEntries );
66 QStringList getAllGeomObjects() const;
67 void setPolylineNames( const QStringList& theObjects, const QStringList& theObjectsEntries );
68 QStringList getSelectedGeomObjects() const;
69 QStringList getSelectedAvailableGeomObjects() const;
70 QStringList getSelectedGroups() const;
71 QStringList getSelectedAvailableGroups() const;
72 HYDROGUI_Zone* getCurrentZone() const;
74 void setAvailableGroups( const QStringList& );
76 void setMoveZonesEnabled( const bool theIsEnabled );
78 HYDROData_ListOfRules getRules() const;
79 void setRules( const HYDROData_ListOfRules& theRules ) const;
82 void setMode( int theMode );
83 void setBoundary( const QString& theObjName );
84 void includeGeomObjects( const QStringList& theObjects );
85 void excludeGeomObjects( const QStringList& theObjects );
86 void includeGroups( const QStringList& theObjects );
87 void excludeGroups( const QStringList& theObjects );
89 void onAlreadyExists( QString theName );
90 void refreshZonesBrowser();
93 * Process items selection: hide/show bathymetry merge type selector.
95 void onSelected( SUIT_DataObject* theObject );
97 * Process merge type selection: set the selected bathymetry merge type for the currently selected zone.
99 void onMergeTypeSelected( int theIndex );
101 * Process zones moving. Create a new region with dropped zones or add to existing one.
103 void onZonesDropped( const QList<SUIT_DataObject*>& theList,
104 SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
107 void changeMode( int theMode );
110 void removeObjects();
111 void objectsSelected();
115 void groupsSelected();
117 void boundarySelected( const QString & theObjName );
118 void setMergeType( int theMergeType, QString& theBathymetryName );
119 void createRegion( const QList<SUIT_DataObject*>& theZonesList );
120 void moveZones( SUIT_DataObject* theRegion, const QList<SUIT_DataObject*>& theZonesList );
121 void clickedInZonesBrowser( SUIT_DataObject* );
125 virtual bool acceptCurrent() const;
128 QList<Handle(HYDROData_Object)> getGeometryObjects();
130 QWizardPage* createObjectsPage();
131 QWizardPage* createGroupsPage();
132 QWizardPage* createZonesPage();
134 QSplitter* mySplitter;
136 QGroupBox* myObjectNameGroup;
137 QLineEdit* myObjectName;
138 HYDROGUI_NameValidator* myValidator;
140 QComboBox* myPolylineName;
142 QButtonGroup* myModeButtons;
144 QListWidget* myAvailableGeomObjects;
145 HYDROGUI_OrderedListWidget* myGeomObjects;
147 HYDROGUI_PriorityWidget* myPriorityWidget;
149 QListWidget* myAvailableGroups;
150 QListWidget* myGroups;
152 HYDROGUI_DataBrowser* myBrowser;
153 Handle(HYDROData_CalculationCase) myEditedObject;
154 QComboBox* myBathymetryChoice;
155 QLabel* myBatimetryLabel;
156 HYDROGUI_Zone* myCurrentZone;