]> SALOME platform Git repositories - modules/hydro.git/blob - src/HYDROGUI/HYDROGUI_CalculationDlg.h
Salome HOME
merge BR_hydro_v_1_0_4 on BR_quadtree
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_CalculationDlg.h
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
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.
10 //
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.
15 //
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
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef HYDROGUI_CALCULATIONDLG_H
24 #define HYDROGUI_CALCULATIONDLG_H
25
26 #include "HYDROGUI_Wizard.h"
27 #include <HYDROData_CalculationCase.h>
28
29 class HYDROGUI_ObjSelector;
30 class HYDROGUI_DataBrowser;
31 class HYDROGUI_NameValidator;
32 class HYDROGUI_Zone;
33 class HYDROGUI_OrderedListWidget;
34 class HYDROGUI_PriorityWidget;
35
36 class SUIT_DataObject;
37
38 class QButtonGroup;
39 class QGroupBox;
40 class QLineEdit;
41 class QListWidget;
42 class QComboBox;
43 class QLabel;
44 class QSplitter;
45 class QStringList;
46
47
48 class HYDROGUI_CalculationDlg : public HYDROGUI_Wizard
49 {
50   Q_OBJECT
51
52 public:
53   HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle );
54   virtual ~HYDROGUI_CalculationDlg();
55
56   void                       reset();
57
58   int                        getMode() const;
59
60   void                       setObjectName( const QString& theName );
61   QString                    getObjectName() const;
62
63   void                       setEditedObject( const Handle(HYDROData_CalculationCase) theCase );
64
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;
73   
74   void                       setAvailableGroups( const QStringList& );
75
76   void                       setEditZonesEnabled( const bool theIsEnabled );
77
78   HYDROData_ListOfRules      getRules() const;
79   void                       setRules( const HYDROData_ListOfRules& theRules ) const;
80
81 public slots:
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 );
88   void                       onEmptyName();
89   void                       onAlreadyExists( QString theName );
90   void                       refreshZonesBrowser();
91   void                       onDataChanged();
92   void                       onOrderChanged();
93
94   /**
95    * Process items selection: hide/show bathymetry merge type selector.
96    */
97   void                       onSelected( SUIT_DataObject* theObject );
98   /**
99    * Process merge type selection: set the selected bathymetry merge type for the currently selected zone.
100    */
101   void                       onMergeTypeSelected( int theIndex );
102   /**
103    * Process zones moving. Create a new region with dropped zones or add to existing one.
104    */
105   void                       onZonesDropped( const QList<SUIT_DataObject*>& theList, 
106     SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction );
107
108 signals:
109   void                       changeMode( int theMode );
110
111   void                       addObjects();
112   void                       removeObjects();
113   void                       objectsSelected();
114
115   void                       addGroups();
116   void                       removeGroups();
117   void                       groupsSelected();
118
119   void                       boundarySelected( const QString & theObjName );
120   void                       setMergeType( int theMergeType, QString& theBathymetryName );
121   void                       createRegion( const QList<SUIT_DataObject*>& theZonesList );
122   void                       moveZones( SUIT_DataObject* theRegion, const QList<SUIT_DataObject*>& theZonesList );
123   void                       clickedInZonesBrowser( SUIT_DataObject* );
124
125 protected:
126
127   virtual bool               acceptCurrent() const;
128
129 private:
130   QList<Handle(HYDROData_Object)> getGeometryObjects();
131
132   QWizardPage*               createObjectsPage();
133   QWizardPage*               createGroupsPage();
134   QWizardPage*               createZonesPage();
135
136   QSplitter*                 mySplitter;
137
138   QGroupBox*                 myObjectNameGroup;
139   QLineEdit*                 myObjectName;
140   HYDROGUI_NameValidator*    myValidator;
141
142   QComboBox*                 myPolylineName;
143
144   QButtonGroup*              myModeButtons;
145
146   QListWidget*               myAvailableGeomObjects;
147   HYDROGUI_OrderedListWidget* myGeomObjects;
148
149   HYDROGUI_PriorityWidget*   myPriorityWidget;
150
151   QListWidget*               myAvailableGroups;
152   QListWidget*               myGroups;
153
154   HYDROGUI_DataBrowser*      myBrowser;
155   Handle(HYDROData_CalculationCase) myEditedObject;
156   QComboBox*                 myBathymetryChoice;
157   QLabel*                    myBathymetryLabel;
158   HYDROGUI_Zone*             myCurrentZone;
159 };
160
161 #endif
162