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
19 #include "HYDROGUI_CalculationDlg.h"
21 #include "HYDROGUI_ObjSelector.h"
22 #include "HYDROGUI_Tool.h"
23 #include "HYDROGUI_DataBrowser.h"
24 #include "HYDROGUI_DataModel.h"
25 #include "HYDROGUI_ListSelector.h"
26 #include "HYDROGUI_Module.h"
27 #include "HYDROGUI_DataObject.h"
28 #include "HYDROGUI_NameValidator.h"
29 #include "HYDROGUI_Region.h"
30 #include "HYDROGUI_Zone.h"
31 #include "HYDROGUI_OrderedListWidget.h"
32 #include "HYDROGUI_PriorityWidget.h"
33 #include "HYDROGUI_PriorityTableModel.h"
35 #include <HYDROData_Document.h>
36 #include <HYDROData_Entity.h>
38 #include <CAM_Application.h>
39 #include <LightApp_DataObject.h>
41 #include <SUIT_DataObject.h>
42 #include <SUIT_FileDlg.h>
43 #include <SUIT_ResourceMgr.h>
44 #include <SUIT_Session.h>
45 #include <SUIT_Study.h>
47 #include <LightApp_Application.h>
48 #include <LightApp_SelectionMgr.h>
49 #include <SUIT_Desktop.h>
50 #include <SUIT_MessageBox.h>
52 #include <QButtonGroup>
58 #include <QListWidget>
60 #include <QPushButton>
61 #include <QRadioButton>
63 #include <QTableWidget>
64 #include <QToolButton>
66 #include <QWizardPage>
69 HYDROGUI_CalculationDlg::HYDROGUI_CalculationDlg( HYDROGUI_Module* theModule, const QString& theTitle )
70 : HYDROGUI_Wizard( theModule, theTitle )
72 addPage( createObjectsPage() );
73 addPage( createGroupsPage() );
74 addPage( createLandCoversPage() );
75 addPage( createZonesPage() );
76 addPage( createLandCoverZonesPage() );
79 HYDROGUI_CalculationDlg::~HYDROGUI_CalculationDlg()
83 void HYDROGUI_CalculationDlg::reset()
85 myObjectName->clear();
86 HYDROGUI_ListModel::Object2VisibleList anObject2VisibleList;
87 myGeomObjects->setObjects(anObject2VisibleList);
88 myLandCovers->setObjects(anObject2VisibleList);
89 myPolylineName->clear();
90 myStricklerTableName->clear();
91 myAvailableGeomObjects->clear();
92 myAvailableLandCovers->clear();
94 // Activate the automatic mode
95 setMode( HYDROData_CalculationCase::AUTOMATIC );
96 setLandCoverMode( HYDROData_CalculationCase::AUTOMATIC );
98 // Reset the priority widget state
99 QList<Handle(HYDROData_Entity)> anObjects;
100 myPriorityWidget->setObjects( anObjects );
101 myLandCoverPriorityWidget->setObjects( anObjects );
104 QWizardPage* HYDROGUI_CalculationDlg::createObjectsPage() {
105 QWizardPage* aPage = new QWizardPage( mainFrame() );
106 QFrame* aFrame = new QFrame( aPage );
109 mySplitter = new QSplitter(Qt::Vertical);
112 QWidget* aTopContainer = new QWidget;
115 myObjectName = new QLineEdit( aPage );
116 myValidator = new HYDROGUI_NameValidator(module(), myObjectName);
117 myObjectName->setValidator( myValidator );
119 connect( myValidator, SIGNAL( emptyName() ), SLOT( onEmptyName() ) );
120 connect( myValidator, SIGNAL( alreadyExists( QString ) ), SLOT( onAlreadyExists( QString ) ) );
123 myPolylineName = new QComboBox( aPage );
124 connect( myPolylineName, SIGNAL( activated( const QString & ) ),
125 SIGNAL( boundarySelected( const QString & ) ) );
128 QLabel* aNameLabel = new QLabel( tr( "NAME" ), aPage );
129 QLabel* aLimitsLabel = new QLabel( tr( "LIMITS" ), aPage );
131 // mode selector (auto/manual)
132 QGroupBox* aModeGroup = new QGroupBox( tr( "MODE" ) );
134 QRadioButton* aManualRB = new QRadioButton( tr( "MANUAL" ), mainFrame() );
135 QRadioButton* anAutoRB = new QRadioButton( tr( "AUTO" ), mainFrame() );
137 myModeButtons = new QButtonGroup( mainFrame() );
138 myModeButtons->addButton( anAutoRB, HYDROData_CalculationCase::AUTOMATIC );
139 myModeButtons->addButton( aManualRB, HYDROData_CalculationCase::MANUAL );
141 QBoxLayout* aModeSelectorLayout = new QHBoxLayout;
142 aModeSelectorLayout->setMargin( 5 );
143 aModeSelectorLayout->setSpacing( 5 );
144 aModeSelectorLayout->addWidget( anAutoRB );
145 aModeSelectorLayout->addWidget( aManualRB );
146 aModeGroup->setLayout( aModeSelectorLayout );
149 QLabel* anObjectsLabel = new QLabel( tr( "CALCULATION_REFERENCE_OBJECTS" ) );
150 myGeomObjects = new HYDROGUI_OrderedListWidget( aPage, 16 );
151 myGeomObjects->setHiddenObjectsShown(true);
152 myGeomObjects->setVisibilityIconShown(false);
153 myGeomObjects->setContentsMargins(QMargins());
155 // included geometry objects
156 QLabel* anIncludedLabel = new QLabel( tr( "INCLUDED_OBJECTS" ) );
157 myAvailableGeomObjects = new QListWidget( aPage );
158 myAvailableGeomObjects->setSelectionMode( QListWidget::ExtendedSelection );
159 myAvailableGeomObjects->setEditTriggers( QListWidget::NoEditTriggers );
160 myAvailableGeomObjects->setViewMode( QListWidget::ListMode );
161 myAvailableGeomObjects->setSortingEnabled( true );
164 QFrame* aBtnsFrame = new QFrame;
165 QVBoxLayout* aBtnsLayout = new QVBoxLayout( aBtnsFrame );
166 aBtnsLayout->setMargin( 5 );
167 aBtnsLayout->setSpacing( 5 );
168 aBtnsFrame->setLayout( aBtnsLayout );
169 QPushButton* anAddBtn = new QPushButton( tr("INCLUDE"), aBtnsFrame );
170 QPushButton* aRemoveBtn = new QPushButton( tr("EXCLUDE"), aBtnsFrame );
172 // fill the butons frame with two buttons
173 aBtnsLayout->addWidget( anAddBtn );
174 aBtnsLayout->addWidget( aRemoveBtn );
175 aBtnsLayout->addStretch( 1 );
177 // top of the page layout
180 QFrame* anObjectsFrame = new QFrame( aPage );
181 anObjectsFrame->setFrameStyle( QFrame::Panel | QFrame::Raised );
182 QGridLayout* anObjsLayout = new QGridLayout( anObjectsFrame );
183 anObjsLayout->setMargin( 5 );
184 anObjsLayout->setSpacing( 5 );
185 anObjectsFrame->setLayout( anObjsLayout );
187 // fill the objects frame with two lists, two labels and with buttons frame
188 anObjsLayout->addWidget( anObjectsLabel, 0, 0, Qt::AlignHCenter );
189 anObjsLayout->addWidget( anIncludedLabel, 0, 2, Qt::AlignHCenter );
190 anObjsLayout->addWidget( myAvailableGeomObjects, 1, 0 );
191 anObjsLayout->addWidget( aBtnsFrame, 1, 1, Qt::AlignHCenter );
192 anObjsLayout->addWidget( myGeomObjects, 1, 2 );
194 // fill the top of the page
195 QGridLayout* aTopLayout = new QGridLayout;
196 aTopLayout->setMargin( 5 );
197 aTopLayout->setSpacing( 5 );
198 aTopLayout->setVerticalSpacing( 10 );
199 aTopLayout->addWidget( aNameLabel, 0, 0, Qt::AlignHCenter );
200 aTopLayout->addWidget( myObjectName, 0, 1 );
201 aTopLayout->addWidget( aLimitsLabel, 1, 0, Qt::AlignHCenter );
202 aTopLayout->addWidget( myPolylineName, 1, 1 );
203 aTopLayout->addWidget( aModeGroup, 2, 0, 1, 2 );
204 aTopLayout->addWidget( anObjectsFrame, 3, 0, 1, 2 );
206 aTopContainer->setLayout( aTopLayout );
208 // add the top of the page to the splitter
209 mySplitter->insertWidget(0, aTopContainer);
210 mySplitter->setStretchFactor(0, 2);
212 // Bottom of the page
213 myPriorityWidget = new HYDROGUI_PriorityWidget( mainFrame() );
215 QGroupBox* aPriorityGroup = new QGroupBox( tr( "PRIORITY" ) );
216 QBoxLayout* aPriorityLayout = new QHBoxLayout;
217 aPriorityLayout->setMargin( 5 );
218 aPriorityLayout->setSpacing( 5 );
219 aPriorityLayout->addWidget( myPriorityWidget );
220 aPriorityGroup->setLayout( aPriorityLayout );
222 // add the bottom of the page to the splitter
223 mySplitter->insertWidget(1, aPriorityGroup);
224 mySplitter->setStretchFactor(1, 1);
227 QVBoxLayout* aPageLayout = new QVBoxLayout;
228 aPageLayout->setMargin( 5 );
229 aPageLayout->setSpacing( 5 );
230 aPageLayout->addWidget( mySplitter );
232 aPage->setLayout( aPageLayout );
236 HYDROGUI_ListSelector* aListSelector =
237 new HYDROGUI_ListSelector( myGeomObjects, module()->getApp()->selectionMgr() );
238 aListSelector->setAutoBlock( true );
242 connect( myModeButtons, SIGNAL( buttonClicked( int ) ), SIGNAL( changeMode( int ) ) );
243 connect( anAddBtn, SIGNAL( clicked() ), SIGNAL( addObjects() ) );
244 connect( aRemoveBtn, SIGNAL( clicked() ), SIGNAL( removeObjects() ) );
246 connect( myGeomObjects, SIGNAL( orderChanged() ), SLOT( onOrderChanged() ) );
248 connect( myPriorityWidget, SIGNAL( ruleChanged() ), SLOT( onRuleChanged() ) );
253 QWizardPage* HYDROGUI_CalculationDlg::createGroupsPage() {
254 QWizardPage* aPage = new QWizardPage( mainFrame() );
255 QFrame* aFrame = new QFrame( aPage );
257 myGroups = new QListWidget( aPage );
258 myGroups->setSelectionMode( QListWidget::ExtendedSelection );
259 myGroups->setEditTriggers( QListWidget::NoEditTriggers );
260 myGroups->setViewMode( QListWidget::ListMode );
261 myGroups->setSortingEnabled( true );
263 myAvailableGroups = new QListWidget( aPage );
264 myAvailableGroups->setSelectionMode( QListWidget::ExtendedSelection );
265 myAvailableGroups->setEditTriggers( QListWidget::NoEditTriggers );
266 myAvailableGroups->setViewMode( QListWidget::ListMode );
267 myAvailableGroups->setSortingEnabled( true );
269 connect( myGroups, SIGNAL( itemSelectionChanged() ),
270 SIGNAL( groupsSelected() ) );
272 QFrame* aGroupsFrame = new QFrame( aPage );
273 QGridLayout* aGroupsLayout = new QGridLayout( aGroupsFrame );
274 aGroupsLayout->setMargin( 5 );
275 aGroupsLayout->setSpacing( 5 );
276 aGroupsFrame->setLayout( aGroupsLayout );
278 QFrame* aBtnsFrame = new QFrame( aGroupsFrame );
279 QVBoxLayout* aBtnsLayout = new QVBoxLayout( aBtnsFrame );
280 aBtnsLayout->setMargin( 5 );
281 aBtnsLayout->setSpacing( 5 );
282 aBtnsFrame->setLayout( aBtnsLayout );
283 QPushButton* anAddBtn = new QPushButton( tr("INCLUDE"), aBtnsFrame );
284 QPushButton* aRemoveBtn = new QPushButton( tr("EXCLUDE"), aBtnsFrame );
286 // Fill the butons frame with two buttons
287 aBtnsLayout->addWidget( anAddBtn );
288 aBtnsLayout->addWidget( aRemoveBtn );
289 aBtnsLayout->addStretch( 1 );
291 QLabel* anIncludedLabel = new QLabel( tr( "INCLUDED_GROUPS" ), aGroupsFrame );
292 QLabel* anAvailableLabel = new QLabel( tr( "AVAILABLE_GROUPS" ), aGroupsFrame );
294 // Fill the objects frame with two lists, two labels and with buttons frame
295 aGroupsLayout->addWidget( anAvailableLabel, 0, 0, Qt::AlignHCenter );
296 aGroupsLayout->addWidget( anIncludedLabel, 0, 2, Qt::AlignHCenter );
297 aGroupsLayout->addWidget( myAvailableGroups, 1, 0 );
298 aGroupsLayout->addWidget( aBtnsFrame, 1, 1, Qt::AlignHCenter );
299 aGroupsLayout->addWidget( myGroups, 1, 2 );
302 QGridLayout* aPageLayout = new QGridLayout( aPage );
303 aPageLayout->setMargin( 5 );
304 aPageLayout->setSpacing( 5 );
305 aPageLayout->setVerticalSpacing( 10 );
306 aPageLayout->addWidget( aGroupsFrame, 0, 0 );
308 aPage->setLayout( aPageLayout );
310 connect( anAddBtn, SIGNAL( clicked() ), SIGNAL( addGroups() ) );
311 connect( aRemoveBtn, SIGNAL( clicked() ), SIGNAL( removeGroups() ) );
316 QWizardPage* HYDROGUI_CalculationDlg::createLandCoversPage() {
317 QWizardPage* aPage = new QWizardPage( mainFrame() );
318 QFrame* aFrame = new QFrame( aPage );
321 myLandCoverSplitter = new QSplitter(Qt::Vertical);
324 QWidget* aTopContainer = new QWidget;
326 // Combo-box to choose Strickler table name
327 QLabel* aStricklerTableLabel = new QLabel( tr( "STRICKLER_TABLE" ), aPage );
328 myStricklerTableName = new QComboBox( aPage );
329 myStricklerTableName->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
330 connect( myStricklerTableName, SIGNAL( activated( const QString & ) ),
331 SIGNAL( StricklerTableSelected( const QString & ) ) );
333 // Mode selector (auto/manual)
334 QGroupBox* aModeGroup = new QGroupBox( tr( "MODE" ) );
336 QRadioButton* aManualRB = new QRadioButton( tr( "MANUAL" ), mainFrame() );
337 QRadioButton* anAutoRB = new QRadioButton( tr( "AUTO" ), mainFrame() );
339 myLandCoverModeButtons = new QButtonGroup( mainFrame() );
340 myLandCoverModeButtons->addButton( anAutoRB, HYDROData_CalculationCase::AUTOMATIC );
341 myLandCoverModeButtons->addButton( aManualRB, HYDROData_CalculationCase::MANUAL );
343 QBoxLayout* aModeSelectorLayout = new QHBoxLayout;
344 aModeSelectorLayout->setMargin( 5 );
345 aModeSelectorLayout->setSpacing( 5 );
346 aModeSelectorLayout->addWidget( anAutoRB );
347 aModeSelectorLayout->addWidget( aManualRB );
348 aModeGroup->setLayout( aModeSelectorLayout );
350 // Available land covers
351 QLabel* aLandCoversLabel = new QLabel( tr( "CALCULATION_REFERENCE_LAND_COVERS" ) );
352 myAvailableLandCovers = new QListWidget( aPage );
353 myAvailableLandCovers->setSelectionMode( QListWidget::ExtendedSelection );
354 myAvailableLandCovers->setEditTriggers( QListWidget::NoEditTriggers );
355 myAvailableLandCovers->setViewMode( QListWidget::ListMode );
356 myAvailableLandCovers->setSortingEnabled( true );
358 // Included land covers
359 QLabel* anIncludedLabel = new QLabel( tr( "INCLUDED_LAND_COVERS" ) );
360 myLandCovers = new HYDROGUI_OrderedListWidget( aPage, 16 );
361 myLandCovers->setHiddenObjectsShown(true);
362 myLandCovers->setVisibilityIconShown(false);
363 myLandCovers->setContentsMargins(QMargins());
365 // Include/Exclude buttons
366 QFrame* aBtnsFrame = new QFrame;
367 QVBoxLayout* aBtnsLayout = new QVBoxLayout( aBtnsFrame );
368 aBtnsLayout->setMargin( 5 );
369 aBtnsLayout->setSpacing( 5 );
370 aBtnsFrame->setLayout( aBtnsLayout );
371 QPushButton* anAddBtn = new QPushButton( tr("INCLUDE"), aBtnsFrame );
372 QPushButton* aRemoveBtn = new QPushButton( tr("EXCLUDE"), aBtnsFrame );
374 // Fill the butons frame with two buttons
375 aBtnsLayout->addWidget( anAddBtn );
376 aBtnsLayout->addWidget( aRemoveBtn );
377 aBtnsLayout->addStretch( 1 );
380 QFrame* aLandCoversFrame = new QFrame( aPage );
381 aLandCoversFrame->setFrameStyle( QFrame::Panel | QFrame::Raised );
382 QGridLayout* aLandCoversLayout = new QGridLayout( aLandCoversFrame );
383 aLandCoversLayout->setMargin( 5 );
384 aLandCoversLayout->setSpacing( 5 );
385 aLandCoversFrame->setLayout( aLandCoversLayout );
387 // Fill the land covers frame with two lists, two labels and with buttons frame
388 aLandCoversLayout->addWidget( aLandCoversLabel, 0, 0, Qt::AlignHCenter );
389 aLandCoversLayout->addWidget( anIncludedLabel, 0, 2, Qt::AlignHCenter );
390 aLandCoversLayout->addWidget( myAvailableLandCovers, 1, 0 );
391 aLandCoversLayout->addWidget( aBtnsFrame, 1, 1, Qt::AlignHCenter );
392 aLandCoversLayout->addWidget( myLandCovers, 1, 2 );
394 // Fill the top layout of the page
395 QGridLayout* aTopLayout = new QGridLayout;
396 aTopLayout->setMargin( 5 );
397 aTopLayout->setSpacing( 5 );
398 aTopLayout->setVerticalSpacing( 10 );
399 aTopLayout->addWidget( aStricklerTableLabel, 0, 0, Qt::AlignHCenter );
400 aTopLayout->addWidget( myStricklerTableName, 0, 1 );
401 aTopLayout->addWidget( aModeGroup, 1, 0, 1, 2 );
402 aTopLayout->addWidget( aLandCoversFrame, 2, 0, 1, 2 );
404 aTopContainer->setLayout( aTopLayout );
406 // Add the top of the page to the splitter
407 myLandCoverSplitter->insertWidget(0, aTopContainer);
408 myLandCoverSplitter->setStretchFactor(0, 2);
410 // Bottom of the page
411 myLandCoverPriorityWidget = new HYDROGUI_PriorityWidget( mainFrame() );
412 HYDROGUI_PriorityTableModel* aModel =
413 dynamic_cast<HYDROGUI_PriorityTableModel*>( myLandCoverPriorityWidget->getTable()->model() );
415 aModel->setColumnCount( 3 );
417 QGroupBox* aPriorityGroup = new QGroupBox( tr( "PRIORITY" ) );
418 QBoxLayout* aPriorityLayout = new QHBoxLayout;
419 aPriorityLayout->setMargin( 5 );
420 aPriorityLayout->setSpacing( 5 );
421 aPriorityLayout->addWidget( myLandCoverPriorityWidget );
422 aPriorityGroup->setLayout( aPriorityLayout );
424 // Add the bottom of the page to the splitter
425 myLandCoverSplitter->insertWidget(1, aPriorityGroup);
426 myLandCoverSplitter->setStretchFactor(1, 1);
429 QVBoxLayout* aPageLayout = new QVBoxLayout;
430 aPageLayout->setMargin( 5 );
431 aPageLayout->setSpacing( 5 );
432 aPageLayout->addWidget( myLandCoverSplitter );
434 aPage->setLayout( aPageLayout );
438 HYDROGUI_ListSelector* aListSelector =
439 new HYDROGUI_ListSelector( myLandCovers, module()->getApp()->selectionMgr() );
440 aListSelector->setAutoBlock( true );
444 connect( myLandCoverModeButtons, SIGNAL( buttonClicked( int ) ), SIGNAL( changeLandCoverMode( int ) ) );
445 connect( anAddBtn, SIGNAL( clicked() ), SIGNAL( addLandCovers() ) );
446 connect( aRemoveBtn, SIGNAL( clicked() ), SIGNAL( removeLandCovers() ) );
448 connect( myLandCovers, SIGNAL( orderChanged() ), SLOT( onOrderLandCoverChanged() ) );
450 connect( myLandCoverPriorityWidget, SIGNAL( ruleChanged() ), SLOT( onLandCoverRuleChanged() ) );
455 QWizardPage* HYDROGUI_CalculationDlg::createZonesPage() {
456 QWizardPage* aPage = new QWizardPage( mainFrame() );
457 QFrame* aFrame = new QFrame( aPage );
459 QGridLayout* aLayout = new QGridLayout( aPage );
461 QLabel* aResultsOnGeomObjectsLabel = new QLabel( tr( "RESULTS_ON_GEOMETRY_OBJECTS" ), aFrame );
463 myBrowser = new HYDROGUI_DataBrowser( module(), NULL, aPage );
464 myBrowser->setAutoOpenLevel( 3 );
465 aLayout->setMargin( 5 );
466 aLayout->setSpacing( 5 );
468 aLayout->addWidget( aResultsOnGeomObjectsLabel, 0, 0 );
469 aLayout->addWidget( myBrowser, 1, 0, 1, 2 );
471 myBathymetryLabel = new QLabel( tr( "BATHYMETRY" ), aFrame );
472 myBathymetryChoice = new QComboBox( aFrame );
474 myBathymetryChoice->setVisible( false );
475 myBathymetryLabel->setVisible( false );
477 aLayout->addWidget( myBathymetryLabel, 2, 0 );
478 aLayout->addWidget( myBathymetryChoice, 2, 1 );
480 aPage->setLayout( aLayout );
482 connect( myBrowser, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) );
483 connect( myBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SIGNAL( clickedInZonesBrowser( SUIT_DataObject* ) ) );
484 connect( myBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onSelected( SUIT_DataObject* ) ) );
485 connect( myBathymetryChoice, SIGNAL( activated( int ) ), SLOT( onMergeTypeSelected( int ) ) );
487 SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
488 SLOT( onZonesDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
489 connect( myBrowser, SIGNAL( newRegion() ), this, SLOT( OnNewRegion() ) );
494 QWizardPage* HYDROGUI_CalculationDlg::createLandCoverZonesPage() {
495 QWizardPage* aPage = new QWizardPage( mainFrame() );
496 QFrame* aFrame = new QFrame( aPage );
498 QGridLayout* aLayout = new QGridLayout( aPage );
500 QLabel* aResultsOnLandCoversLabel = new QLabel( tr( "RESULTS_ON_LAND_COVERS" ), aFrame );
502 myLandCoverBrowser = new HYDROGUI_DataBrowser( module(), NULL, aPage, true );
503 myLandCoverBrowser->setAutoOpenLevel( 3 );
504 aLayout->setMargin( 5 );
505 aLayout->setSpacing( 5 );
507 aLayout->addWidget( aResultsOnLandCoversLabel, 0, 0 );
508 aLayout->addWidget( myLandCoverBrowser, 1, 0, 1, 2 );
510 myStricklerTypeLabel = new QLabel( tr( "STRICKLER_TYPE" ), aFrame );
511 myStricklerTypeChoice = new QComboBox( aFrame );
513 myStricklerTypeLabel->setVisible( false );
514 myStricklerTypeChoice->setVisible( false );
516 aLayout->addWidget( myStricklerTypeLabel, 2, 0 );
517 aLayout->addWidget( myStricklerTypeChoice, 2, 1 );
519 aPage->setLayout( aLayout );
522 connect( myLandCoverBrowser, SIGNAL( dataChanged() ), SLOT( onDataLandCoverChanged() ) );
523 connect( myLandCoverBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SIGNAL( clickedInZonesBrowser( SUIT_DataObject* ) ) );
524 connect( myLandCoverBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onLandCoverZoneSelected( SUIT_DataObject* ) ) );
525 connect( myStricklerTypeChoice, SIGNAL( activated( int ) ), SLOT( onMergeStricklerTypeSelected( int ) ) );
526 connect( myLandCoverBrowser,
527 SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
528 SLOT( onLandCoverZonesDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
529 connect( myLandCoverBrowser, SIGNAL( newRegion() ), this, SLOT( OnNewLandCoverRegion() ) );
535 bool HYDROGUI_CalculationDlg::acceptCurrent() const
539 if ( false /*myGeomObjects->count() == 0*/ )
541 anErrorMsg = tr( "EMPTY_GEOMETRY_OBJECTS" );
544 if ( !anErrorMsg.isEmpty() )
546 anErrorMsg += "\n" + tr( "INPUT_VALID_DATA" );
548 QString aTitle = tr( "INSUFFICIENT_INPUT_DATA" );
549 SUIT_MessageBox::critical( module()->getApp()->desktop(), aTitle, anErrorMsg );
552 return anErrorMsg.isEmpty();
555 void HYDROGUI_CalculationDlg::onEmptyName()
557 QString aTitle = tr( "INSUFFICIENT_INPUT_DATA" );
558 QString aMessage = tr( "INCORRECT_OBJECT_NAME" ) + "\n" + tr( "INPUT_VALID_DATA" );
559 SUIT_MessageBox::critical( module()->getApp()->desktop(), aTitle, aMessage );
562 void HYDROGUI_CalculationDlg::onAlreadyExists( QString theName )
564 QString aTitle = tr( "INSUFFICIENT_INPUT_DATA" );
565 QString aMessage = QObject::tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( theName ) +
566 "\n" + tr( "INPUT_VALID_DATA" );
567 SUIT_MessageBox::critical( module()->getApp()->desktop(), aTitle, aMessage );
570 void HYDROGUI_CalculationDlg::onZonesDropped( const QList<SUIT_DataObject*>& theList,
571 SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction )
573 QList<SUIT_DataObject*> aZonesList;
574 HYDROGUI_Zone* aZone;
575 // Get a list of dropped zones
576 for ( int i = 0; i < theList.length(); i++ )
578 aZone = dynamic_cast<HYDROGUI_Zone*>( theList.at( i ) );
581 aZonesList.append( aZone );
584 if ( aZonesList.length() > 0 )
586 // Get the target region
587 HYDROGUI_NamedObject* aRegionsRoot = dynamic_cast<HYDROGUI_NamedObject*>(theTargetParent);
590 // Create a new region
591 emit createRegion( aZonesList );
595 HYDROGUI_Region* aRegion = dynamic_cast<HYDROGUI_Region*>(theTargetParent);
598 emit moveZones( theTargetParent, aZonesList, false );
604 void HYDROGUI_CalculationDlg::OnNewRegion()
606 emit createRegion( myBrowser->getSelected() );
609 void HYDROGUI_CalculationDlg::OnNewLandCoverRegion()
611 emit createLandCoverRegion( myLandCoverBrowser->getSelected() );
614 void HYDROGUI_CalculationDlg::onMergeTypeSelected( int theIndex )
616 int aType = myBathymetryChoice->itemData( theIndex ).toInt();
617 QString aText = myBathymetryChoice->itemText( theIndex );
618 emit setMergeType( aType, aText );
621 void HYDROGUI_CalculationDlg::onSelected( SUIT_DataObject* theObject )
624 HYDROGUI_Zone* aZone = dynamic_cast<HYDROGUI_Zone*>( theObject );
627 doShow = aZone->isMergingNeed();
632 // Fill the merge type combo box
633 bool prevBlock = myBathymetryChoice->blockSignals( true );
634 myCurrentZone = aZone;
635 myBathymetryChoice->clear();
636 myBathymetryChoice->addItem( tr("MERGE_UNKNOWN"), HYDROData_Zone::Merge_UNKNOWN );
637 myBathymetryChoice->addItem( tr("MERGE_ZMIN"), HYDROData_Zone::Merge_ZMIN );
638 myBathymetryChoice->addItem( tr("MERGE_ZMAX"), HYDROData_Zone::Merge_ZMAX );
639 QStringList aList = aZone->getObjects();
640 for ( int i = 0; i < aList.length(); i++ )
642 myBathymetryChoice->addItem( aList.at( i ), HYDROData_Zone::Merge_Object );
644 // Select the current choice if any
646 switch ( aZone->getMergeType() )
648 case HYDROData_Zone::Merge_ZMIN:
651 case HYDROData_Zone::Merge_ZMAX:
654 case HYDROData_Zone::Merge_Object:
655 aCurIndex = 3 + aList.indexOf( aZone->text( HYDROGUI_DataObject::AltitudeObjId ) );
658 aCurIndex = 0; // Select unknown by default
660 myBathymetryChoice->setCurrentIndex( aCurIndex );
661 myBathymetryChoice->blockSignals( prevBlock );
664 myBathymetryChoice->setVisible( doShow );
665 myBathymetryChoice->setEnabled( getMode() == HYDROData_CalculationCase::MANUAL );
666 myBathymetryLabel->setVisible( doShow );
669 void HYDROGUI_CalculationDlg::onLandCoverZoneSelected( SUIT_DataObject* theObject )
672 HYDROGUI_Zone* aZone = dynamic_cast<HYDROGUI_Zone*>( theObject );
675 doShow = aZone->isMergingNeed();
680 // Fill the merge type combo box
681 bool prevBlock = myStricklerTypeChoice->blockSignals( true );
682 myCurrentZone = aZone;
683 myStricklerTypeChoice->clear();
684 myStricklerTypeChoice->addItem( tr("MERGE_UNKNOWN"), HYDROData_Zone::Merge_UNKNOWN );
685 QStringList aList = aZone->getObjects();
686 for ( int i = 0; i < aList.length(); i++ )
688 myStricklerTypeChoice->addItem( aList.at( i ), HYDROData_Zone::Merge_Object );
690 // Select the current choice if any
692 switch ( aZone->getMergeType() )
694 case HYDROData_Zone::Merge_Object:
695 aCurIndex = 1 + aList.indexOf( aZone->text( HYDROGUI_DataObject::AltitudeObjId ) );
698 aCurIndex = 0; // Select unknown by default
700 myStricklerTypeChoice->setCurrentIndex( aCurIndex );
701 myStricklerTypeChoice->blockSignals( prevBlock );
704 myStricklerTypeChoice->setVisible( doShow );
705 myStricklerTypeChoice->setEnabled( getLandCoverMode() == HYDROData_CalculationCase::MANUAL );
706 myStricklerTypeLabel->setVisible( doShow );
709 void HYDROGUI_CalculationDlg::onMergeStricklerTypeSelected( int theIndex )
711 int aType = myStricklerTypeChoice->itemData( theIndex ).toInt();
712 QString aText = myStricklerTypeChoice->itemText( theIndex );
713 emit setMergeStricklerType( aType, aText );
716 void HYDROGUI_CalculationDlg::onLandCoverZonesDropped( const QList<SUIT_DataObject*>& theList,
717 SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction )
719 QList<SUIT_DataObject*> aZonesList;
720 HYDROGUI_Zone* aZone;
721 // Get a list of dropped land cover zones
722 for ( int i = 0; i < theList.length(); i++ )
724 aZone = dynamic_cast<HYDROGUI_Zone*>( theList.at( i ) );
727 aZonesList.append( aZone );
730 if ( aZonesList.length() > 0 )
732 // Get the target region
733 HYDROGUI_NamedObject* aRegionsRoot = dynamic_cast<HYDROGUI_NamedObject*>(theTargetParent);
736 // Create a new region
737 emit createLandCoverRegion( aZonesList );
741 HYDROGUI_Region* aRegion = dynamic_cast<HYDROGUI_Region*>(theTargetParent);
744 emit moveZones( theTargetParent, aZonesList, true );
750 void HYDROGUI_CalculationDlg::setObjectName( const QString& theName )
752 myObjectName->setText( theName );
755 QString HYDROGUI_CalculationDlg::getObjectName() const
757 return myObjectName->text();
760 void moveItems( QListWidget* theSource, QListWidget* theDest, const QStringList& theObjects )
762 QList<QListWidgetItem*> aFoundItems;
764 QListWidgetItem* anItem;
766 for ( int i = 0, n = theObjects.length(); i < n; ++i )
768 QString anObjName = theObjects.at( i );
769 aFoundItems = theSource->findItems( anObjName, Qt::MatchExactly );
770 for ( anIdx = 0; anIdx < aFoundItems.length(); anIdx++ )
772 anItem = aFoundItems.at( anIdx );
773 // Remove this object from available objects list
774 anItem = theSource->takeItem( theSource->row( anItem ) );
775 // Add the item to the included objects list
776 theDest->addItem( anItem );
781 void HYDROGUI_CalculationDlg::includeGeomObjects( const QStringList& theObjects )
783 QList<QListWidgetItem*> aFoundItems;
784 foreach ( const QString& anObjName, theObjects ) {
785 // Hide the object in the available objects list
786 aFoundItems = myAvailableGeomObjects->findItems( anObjName, Qt::MatchExactly );
787 foreach ( QListWidgetItem* anItem, aFoundItems ) {
788 anItem->setHidden( true );
791 // Add the object to the list of included objects
792 Handle(HYDROData_Entity) anObject =
793 HYDROGUI_Tool::FindObjectByName( module(), anObjName );
794 myGeomObjects->addObject( HYDROGUI_ListModel::Object2Visible( anObject, true ) );
797 myPriorityWidget->setObjects( getGeometryObjects() );
800 void HYDROGUI_CalculationDlg::excludeGeomObjects( const QStringList& theObjects )
802 QList<QListWidgetItem*> aFoundItems;
803 foreach ( const QString& anObjName, theObjects ) {
804 // Set visible the object in the available objects list
805 aFoundItems = myAvailableGeomObjects->findItems( anObjName, Qt::MatchExactly );
806 foreach ( QListWidgetItem* anItem, aFoundItems ) {
807 anItem->setHidden( false );
810 // Remove the object from the list of included objects
811 myGeomObjects->removeObjectByName( anObjName );
814 myPriorityWidget->setObjects( getGeometryObjects() );
817 void HYDROGUI_CalculationDlg::setBoundary( const QString& theObjName )
819 bool isBlocked = myPolylineName->blockSignals( true );
820 myPolylineName->setCurrentIndex( myPolylineName->findText( theObjName ) );
821 myPolylineName->blockSignals( isBlocked );
824 void HYDROGUI_CalculationDlg::setPolylineNames( const QStringList& theObjects, const QStringList& theObjectsEntries )
826 myPolylineName->clear();
827 myPolylineName->addItem( "", "" ); // No boundary item
829 for ( int i = 0, n = theObjects.length(); i < n; ++i )
831 myPolylineName->addItem( theObjects.at( i ), theObjectsEntries.at( i ) );
835 void HYDROGUI_CalculationDlg::setStricklerTableNames( const QStringList& theObjects, const QStringList& theObjectsEntries )
837 myStricklerTableName->clear();
839 for ( int i = 0, n = theObjects.length(); i < n; ++i )
841 myStricklerTableName->addItem( theObjects.at( i ), theObjectsEntries.at( i ) );
845 void HYDROGUI_CalculationDlg::setAllGeomObjects( const QStringList& theObjects, const QStringList& theObjectsEntries )
847 myAvailableGeomObjects->clear();
849 for ( int i = 0, n = theObjects.length(); i < n; ++i )
851 QString anObjName = theObjects.at( i );
853 QListWidgetItem* aListItem = new QListWidgetItem( anObjName, myAvailableGeomObjects );
854 aListItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
855 aListItem->setData( Qt::UserRole, theObjectsEntries.at( i ) );
859 void HYDROGUI_CalculationDlg::setAllLandCovers( const QStringList& theObjects, const QStringList& theObjectsEntries )
861 myAvailableLandCovers->clear();
863 for ( int i = 0, n = theObjects.length(); i < n; ++i )
865 QString anObjName = theObjects.at( i );
867 QListWidgetItem* aListItem = new QListWidgetItem( anObjName, myAvailableLandCovers );
868 aListItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
869 aListItem->setData( Qt::UserRole, theObjectsEntries.at( i ) );
873 QStringList getSelected( QListWidget* theWidget )
875 QStringList aResList;
876 QList<QListWidgetItem*> aList = theWidget->selectedItems();
877 for ( int i = 0, n = aList.length(); i < n; ++i )
879 aResList.append( aList.at( i )->text() );
884 QStringList HYDROGUI_CalculationDlg::getSelectedGeomObjects() const
886 return myGeomObjects->getSelectedNames();
889 QStringList HYDROGUI_CalculationDlg::getSelectedLandCovers() const
891 return myLandCovers->getSelectedNames();
894 QStringList HYDROGUI_CalculationDlg::getAllGeomObjects() const
896 return myGeomObjects->getAllNames();
899 QStringList HYDROGUI_CalculationDlg::getAllLandCovers() const
901 return myLandCovers->getAllNames();
904 QStringList HYDROGUI_CalculationDlg::getSelectedAvailableGeomObjects() const
906 return getSelected( myAvailableGeomObjects );
909 QStringList HYDROGUI_CalculationDlg::getSelectedAvailableLandCovers() const
911 return getSelected( myAvailableLandCovers );
914 void HYDROGUI_CalculationDlg::setEditedObject( const Handle(HYDROData_CalculationCase) theCase )
916 myEditedObject = theCase;
917 myValidator->setEditedObject( theCase );
919 // Build the calculation case subtree
920 module()->getDataModel()->buildCaseTree( myBrowser->root(), myEditedObject, false );
922 myBrowser->updateTree();
923 myBrowser->openLevels();
924 myBrowser->adjustColumnsWidth();
925 myBrowser->setAutoUpdate( true );
926 myBrowser->setUpdateModified( true );
928 // Build the calculation case subtree for Land Cover regions
929 module()->getDataModel()->buildCaseTree( myLandCoverBrowser->root(), myEditedObject, true );
931 myLandCoverBrowser->updateTree();
932 myLandCoverBrowser->openLevels();
933 myLandCoverBrowser->adjustColumnsWidth();
934 myLandCoverBrowser->setAutoUpdate( true );
935 myLandCoverBrowser->setUpdateModified( true );
938 HYDROGUI_Zone* HYDROGUI_CalculationDlg::getCurrentZone() const
940 return myCurrentZone;
943 void HYDROGUI_CalculationDlg::refreshZonesBrowser()
945 SUIT_DataObject* aRoot = myBrowser->root();
946 module()->getDataModel()->updateObjectTree( myEditedObject );
947 module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, false );
948 myBrowser->updateTree( aRoot );
951 void HYDROGUI_CalculationDlg::onDataChanged()
953 SUIT_DataObject* aRoot = myBrowser->root();
954 module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, false );
955 myBrowser->updateTree( aRoot );
958 void HYDROGUI_CalculationDlg::setAvailableGroups( const QStringList& theGroups )
960 myAvailableGroups->clear();
962 foreach( QString aGroup, theGroups )
963 myAvailableGroups->addItem( aGroup );
966 QStringList HYDROGUI_CalculationDlg::getSelectedGroups() const
968 return getSelected( myGroups );
971 QStringList HYDROGUI_CalculationDlg::getSelectedAvailableGroups() const
973 return getSelected( myAvailableGroups );
976 void HYDROGUI_CalculationDlg::includeGroups( const QStringList& theObjects )
978 moveItems( myAvailableGroups, myGroups, theObjects );
981 void HYDROGUI_CalculationDlg::excludeGroups( const QStringList& theObjects )
983 moveItems( myGroups, myAvailableGroups, theObjects );
988 @param theMode the mode
990 int HYDROGUI_CalculationDlg::getMode() const
992 return myModeButtons->checkedId();
997 @param theMode the mode
999 void HYDROGUI_CalculationDlg::setMode( int theMode )
1001 bool isBlocked = myModeButtons->blockSignals( true );
1002 myModeButtons->button( theMode )->setChecked( true );
1003 myModeButtons->blockSignals( isBlocked );
1005 bool isAuto = ( theMode == HYDROData_CalculationCase::AUTOMATIC );
1007 myGeomObjects->setOrderingEnabled( isAuto );
1008 QWidget* aWidget = mySplitter->widget( 1 );
1010 aWidget->setVisible( isAuto );
1015 Get creation mode for land covers panel.
1016 @param theMode the mode
1018 int HYDROGUI_CalculationDlg::getLandCoverMode() const
1020 return myLandCoverModeButtons->checkedId();
1024 Set creation mode for land cover panel.
1025 @param theMode the mode
1027 void HYDROGUI_CalculationDlg::setLandCoverMode( int theMode )
1029 bool isBlocked = myLandCoverModeButtons->blockSignals( true );
1030 myLandCoverModeButtons->button( theMode )->setChecked( true );
1031 myLandCoverModeButtons->blockSignals( isBlocked );
1033 bool isAuto = ( theMode == HYDROData_CalculationCase::AUTOMATIC );
1035 myLandCovers->setOrderingEnabled( isAuto );
1036 QWidget* aWidget = myLandCoverSplitter->widget( 1 );
1038 aWidget->setVisible( isAuto );
1043 Enable/disable zones drag'n'drop and renaming.
1044 @param theIsEnabled if true - zones drag'n'drop and renaming will be enabled
1046 void HYDROGUI_CalculationDlg::setEditZonesEnabled( const bool theIsEnabled )
1048 myBrowser->setReadOnly( !theIsEnabled );
1052 Enable/disable land covers drag'n'drop and renaming.
1053 @param theIsEnabled if true - land covers drag'n'drop and renaming will be enabled
1055 void HYDROGUI_CalculationDlg::setEditLandCoverZonesEnabled( const bool theIsEnabled )
1057 myLandCoverBrowser->setReadOnly( !theIsEnabled );
1061 Get included geometry objects.
1062 @return the list of geometry objects
1064 QList<Handle(HYDROData_Entity)> HYDROGUI_CalculationDlg::getGeometryObjects()
1066 QList<Handle(HYDROData_Entity)> anEntities = myGeomObjects->getObjects();
1067 QList<Handle(HYDROData_Entity)> anObjects;
1069 foreach ( Handle(HYDROData_Entity) anEntity, anEntities ) {
1070 Handle(HYDROData_Object) anObj = Handle(HYDROData_Object)::DownCast( anEntity );
1071 if ( anObj.IsNull() ) {
1082 Get included land covers.
1083 @return the list of land covers
1085 QList<Handle(HYDROData_Entity)> HYDROGUI_CalculationDlg::getLandCovers()
1087 QList<Handle(HYDROData_Entity)> anEntities = myLandCovers->getObjects();
1088 QList<Handle(HYDROData_Entity)> aLandCovers;
1090 foreach ( Handle(HYDROData_Entity) anEntity, anEntities ) {
1091 Handle(HYDROData_LandCover) aLandCover = Handle(HYDROData_LandCover)::DownCast( anEntity );
1092 if ( aLandCover.IsNull() ) {
1096 aLandCovers << aLandCover;
1104 @return the list of rules
1106 HYDROData_ListOfRules HYDROGUI_CalculationDlg::getRules() const
1108 return myPriorityWidget->getRules();
1113 @param theRules the list of rules
1115 void HYDROGUI_CalculationDlg::setRules( const HYDROData_ListOfRules& theRules ) const
1117 myPriorityWidget->setRules( theRules );
1121 Get rules defined for land covers.
1122 @return the list of rules
1124 HYDROData_ListOfRules HYDROGUI_CalculationDlg::getLandCoverRules() const
1126 return myLandCoverPriorityWidget->getRules();
1130 Set rules for land covers.
1131 @param theRules the list of rules
1133 void HYDROGUI_CalculationDlg::setLandCoverRules( const HYDROData_ListOfRules& theRules ) const
1135 myLandCoverPriorityWidget->setRules( theRules );
1139 Slot called when objects order is changed.
1141 void HYDROGUI_CalculationDlg::onOrderChanged()
1143 bool isConfirmed = true;
1144 emit orderChanged( isConfirmed );
1146 myPriorityWidget->setObjects( getGeometryObjects() );
1148 myGeomObjects->undoLastMove();
1152 Slot called when priority rule for geometry objects is changed.
1154 void HYDROGUI_CalculationDlg::onRuleChanged()
1156 bool isConfirmed = true;
1157 emit ruleChanged( isConfirmed );
1159 myPriorityWidget->undoLastChange();
1162 void HYDROGUI_CalculationDlg::setStricklerTable( const QString& theStricklerTableName, bool theBlockSignals )
1165 if ( theBlockSignals )
1166 isBlocked = myStricklerTableName->blockSignals( true );
1168 myStricklerTableName->setCurrentIndex( myStricklerTableName->findText( theStricklerTableName ) );
1170 if ( theBlockSignals )
1171 myStricklerTableName->blockSignals( isBlocked );
1173 emit StricklerTableSelected( theStricklerTableName );
1176 void HYDROGUI_CalculationDlg::includeLandCovers( const QStringList& theLandCovers, bool theReset )
1180 HYDROGUI_ListModel::Object2VisibleList anObject2VisibleList;
1181 myLandCovers->setObjects(anObject2VisibleList);
1184 QList<QListWidgetItem*> aFoundItems;
1185 foreach ( const QString& anObjName, theLandCovers ) {
1186 // Hide the land cover in the available land covers list
1187 aFoundItems = myAvailableLandCovers->findItems( anObjName, Qt::MatchExactly );
1188 foreach ( QListWidgetItem* anItem, aFoundItems ) {
1189 anItem->setHidden( true );
1192 // Add the land cover to the list of included objects
1193 Handle(HYDROData_Entity) anObject =
1194 HYDROGUI_Tool::FindObjectByName( module(), anObjName );
1195 myLandCovers->addObject( HYDROGUI_ListModel::Object2Visible( anObject, true ) );
1198 myLandCoverPriorityWidget->setObjects( getLandCovers() );
1201 void HYDROGUI_CalculationDlg::excludeLandCovers( const QStringList& theLandCovers )
1203 QList<QListWidgetItem*> aFoundItems;
1204 foreach ( const QString& anObjName, theLandCovers ) {
1205 // Set visible the land cover in the available objects list
1206 aFoundItems = myAvailableLandCovers->findItems( anObjName, Qt::MatchExactly );
1207 foreach ( QListWidgetItem* anItem, aFoundItems ) {
1208 anItem->setHidden( false );
1211 // Remove the land cover from the list of included objects
1212 myLandCovers->removeObjectByName( anObjName );
1215 myLandCoverPriorityWidget->setObjects( getLandCovers() );
1218 void HYDROGUI_CalculationDlg::refreshLandCoverZonesBrowser()
1220 SUIT_DataObject* aRoot = myLandCoverBrowser->root();
1221 module()->getDataModel()->updateObjectTree( myEditedObject );
1222 module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, true );
1223 myLandCoverBrowser->updateTree( aRoot );
1227 Slot called when zones created on land covers are changed.
1229 void HYDROGUI_CalculationDlg::onDataLandCoverChanged()
1231 SUIT_DataObject* aRoot = myLandCoverBrowser->root();
1232 module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, true );
1233 myLandCoverBrowser->updateTree( aRoot );
1237 Slot called when land covers order is changed.
1239 void HYDROGUI_CalculationDlg::onOrderLandCoverChanged()
1241 bool isConfirmed = true;
1242 emit orderLandCoverChanged( isConfirmed );
1244 myLandCoverPriorityWidget->setObjects( getLandCovers() );
1246 myLandCovers->undoLastMove();
1250 Slot called when priority rule for land covers is changed.
1252 void HYDROGUI_CalculationDlg::onLandCoverRuleChanged()
1254 bool isConfirmed = true;
1255 emit ruleLandCoverChanged( isConfirmed );
1257 myLandCoverPriorityWidget->undoLastChange();