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 QPushButton* aRegenerateBtn = new QPushButton( tr( "REGENERATE_COLORS" ), this );
481 aLayout->addWidget( aRegenerateBtn, 3, 0 );
483 aPage->setLayout( aLayout );
485 connect( myBrowser, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) );
486 connect( myBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SIGNAL( clickedInZonesBrowser( SUIT_DataObject* ) ) );
487 connect( myBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onSelected( SUIT_DataObject* ) ) );
488 connect( myBathymetryChoice, SIGNAL( activated( int ) ), SLOT( onMergeTypeSelected( int ) ) );
490 SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
491 SLOT( onZonesDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
492 connect( myBrowser, SIGNAL( newRegion() ), this, SLOT( OnNewRegion() ) );
493 connect( aRegenerateBtn, SIGNAL( clicked() ), this, SIGNAL( regenerateColors() ) );
497 QWizardPage* HYDROGUI_CalculationDlg::createLandCoverZonesPage() {
498 QWizardPage* aPage = new QWizardPage( mainFrame() );
499 QFrame* aFrame = new QFrame( aPage );
501 QGridLayout* aLayout = new QGridLayout( aPage );
503 QLabel* aResultsOnLandCoversLabel = new QLabel( tr( "RESULTS_ON_LAND_COVERS" ), aFrame );
505 myLandCoverBrowser = new HYDROGUI_DataBrowser( module(), NULL, aPage, true );
506 myLandCoverBrowser->setAutoOpenLevel( 3 );
507 aLayout->setMargin( 5 );
508 aLayout->setSpacing( 5 );
510 aLayout->addWidget( aResultsOnLandCoversLabel, 0, 0 );
511 aLayout->addWidget( myLandCoverBrowser, 1, 0, 1, 2 );
513 myStricklerTypeLabel = new QLabel( tr( "STRICKLER_TYPE" ), aFrame );
514 myStricklerTypeChoice = new QComboBox( aFrame );
516 myStricklerTypeLabel->setVisible( false );
517 myStricklerTypeChoice->setVisible( false );
519 aLayout->addWidget( myStricklerTypeLabel, 2, 0 );
520 aLayout->addWidget( myStricklerTypeChoice, 2, 1 );
522 aPage->setLayout( aLayout );
525 connect( myLandCoverBrowser, SIGNAL( dataChanged() ), SLOT( onDataLandCoverChanged() ) );
526 connect( myLandCoverBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SIGNAL( clickedInZonesBrowser( SUIT_DataObject* ) ) );
527 connect( myLandCoverBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onLandCoverZoneSelected( SUIT_DataObject* ) ) );
528 connect( myStricklerTypeChoice, SIGNAL( activated( int ) ), SLOT( onMergeStricklerTypeSelected( int ) ) );
529 connect( myLandCoverBrowser,
530 SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
531 SLOT( onLandCoverZonesDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
532 connect( myLandCoverBrowser, SIGNAL( newRegion() ), this, SLOT( OnNewLandCoverRegion() ) );
538 bool HYDROGUI_CalculationDlg::acceptCurrent() const
542 if ( false /*myGeomObjects->count() == 0*/ )
544 anErrorMsg = tr( "EMPTY_GEOMETRY_OBJECTS" );
547 if ( !anErrorMsg.isEmpty() )
549 anErrorMsg += "\n" + tr( "INPUT_VALID_DATA" );
551 QString aTitle = tr( "INSUFFICIENT_INPUT_DATA" );
552 SUIT_MessageBox::critical( module()->getApp()->desktop(), aTitle, anErrorMsg );
555 return anErrorMsg.isEmpty();
558 void HYDROGUI_CalculationDlg::onEmptyName()
560 QString aTitle = tr( "INSUFFICIENT_INPUT_DATA" );
561 QString aMessage = tr( "INCORRECT_OBJECT_NAME" ) + "\n" + tr( "INPUT_VALID_DATA" );
562 SUIT_MessageBox::critical( module()->getApp()->desktop(), aTitle, aMessage );
565 void HYDROGUI_CalculationDlg::onAlreadyExists( QString theName )
567 QString aTitle = tr( "INSUFFICIENT_INPUT_DATA" );
568 QString aMessage = QObject::tr( "OBJECT_EXISTS_IN_DOCUMENT" ).arg( theName ) +
569 "\n" + tr( "INPUT_VALID_DATA" );
570 SUIT_MessageBox::critical( module()->getApp()->desktop(), aTitle, aMessage );
573 void HYDROGUI_CalculationDlg::onZonesDropped( const QList<SUIT_DataObject*>& theList,
574 SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction )
576 QList<SUIT_DataObject*> aZonesList;
577 HYDROGUI_Zone* aZone;
578 // Get a list of dropped zones
579 for ( int i = 0; i < theList.length(); i++ )
581 aZone = dynamic_cast<HYDROGUI_Zone*>( theList.at( i ) );
584 aZonesList.append( aZone );
587 if ( aZonesList.length() > 0 )
589 // Get the target region
590 HYDROGUI_NamedObject* aRegionsRoot = dynamic_cast<HYDROGUI_NamedObject*>(theTargetParent);
593 // Create a new region
594 emit createRegion( aZonesList );
598 HYDROGUI_Region* aRegion = dynamic_cast<HYDROGUI_Region*>(theTargetParent);
601 emit moveZones( theTargetParent, aZonesList, false );
607 void HYDROGUI_CalculationDlg::OnNewRegion()
609 emit createRegion( myBrowser->getSelected() );
612 void HYDROGUI_CalculationDlg::OnNewLandCoverRegion()
614 emit createLandCoverRegion( myLandCoverBrowser->getSelected() );
617 void HYDROGUI_CalculationDlg::onMergeTypeSelected( int theIndex )
619 int aType = myBathymetryChoice->itemData( theIndex ).toInt();
620 QString aText = myBathymetryChoice->itemText( theIndex );
621 emit setMergeType( aType, aText );
624 void HYDROGUI_CalculationDlg::onSelected( SUIT_DataObject* theObject )
627 HYDROGUI_Zone* aZone = dynamic_cast<HYDROGUI_Zone*>( theObject );
630 doShow = aZone->isMergingNeed();
635 // Fill the merge type combo box
636 bool prevBlock = myBathymetryChoice->blockSignals( true );
637 myCurrentZone = aZone;
638 myBathymetryChoice->clear();
639 myBathymetryChoice->addItem( tr("MERGE_UNKNOWN"), HYDROData_Zone::Merge_UNKNOWN );
640 myBathymetryChoice->addItem( tr("MERGE_ZMIN"), HYDROData_Zone::Merge_ZMIN );
641 myBathymetryChoice->addItem( tr("MERGE_ZMAX"), HYDROData_Zone::Merge_ZMAX );
642 QStringList aList = aZone->getObjects();
643 for ( int i = 0; i < aList.length(); i++ )
645 myBathymetryChoice->addItem( aList.at( i ), HYDROData_Zone::Merge_Object );
647 // Select the current choice if any
649 switch ( aZone->getMergeType() )
651 case HYDROData_Zone::Merge_ZMIN:
654 case HYDROData_Zone::Merge_ZMAX:
657 case HYDROData_Zone::Merge_Object:
658 aCurIndex = 3 + aList.indexOf( aZone->text( HYDROGUI_DataObject::AltitudeObjId ) );
661 aCurIndex = 0; // Select unknown by default
663 myBathymetryChoice->setCurrentIndex( aCurIndex );
664 myBathymetryChoice->blockSignals( prevBlock );
667 myBathymetryChoice->setVisible( doShow );
668 myBathymetryChoice->setEnabled( getMode() == HYDROData_CalculationCase::MANUAL );
669 myBathymetryLabel->setVisible( doShow );
672 void HYDROGUI_CalculationDlg::onLandCoverZoneSelected( SUIT_DataObject* theObject )
675 HYDROGUI_Zone* aZone = dynamic_cast<HYDROGUI_Zone*>( theObject );
678 doShow = aZone->isMergingNeed();
683 // Fill the merge type combo box
684 bool prevBlock = myStricklerTypeChoice->blockSignals( true );
685 myCurrentZone = aZone;
686 myStricklerTypeChoice->clear();
687 myStricklerTypeChoice->addItem( tr("MERGE_UNKNOWN"), HYDROData_Zone::Merge_UNKNOWN );
688 QStringList aList = aZone->getObjects();
689 for ( int i = 0; i < aList.length(); i++ )
691 myStricklerTypeChoice->addItem( aList.at( i ), HYDROData_Zone::Merge_Object );
693 // Select the current choice if any
695 switch ( aZone->getMergeType() )
697 case HYDROData_Zone::Merge_Object:
698 aCurIndex = 1 + aList.indexOf( aZone->text( HYDROGUI_DataObject::AltitudeObjId ) );
701 aCurIndex = 0; // Select unknown by default
703 myStricklerTypeChoice->setCurrentIndex( aCurIndex );
704 myStricklerTypeChoice->blockSignals( prevBlock );
707 myStricklerTypeChoice->setVisible( doShow );
708 myStricklerTypeChoice->setEnabled( getLandCoverMode() == HYDROData_CalculationCase::MANUAL );
709 myStricklerTypeLabel->setVisible( doShow );
712 void HYDROGUI_CalculationDlg::onMergeStricklerTypeSelected( int theIndex )
714 int aType = myStricklerTypeChoice->itemData( theIndex ).toInt();
715 QString aText = myStricklerTypeChoice->itemText( theIndex );
716 emit setMergeStricklerType( aType, aText );
719 void HYDROGUI_CalculationDlg::onLandCoverZonesDropped( const QList<SUIT_DataObject*>& theList,
720 SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction )
722 QList<SUIT_DataObject*> aZonesList;
723 HYDROGUI_Zone* aZone;
724 // Get a list of dropped land cover zones
725 for ( int i = 0; i < theList.length(); i++ )
727 aZone = dynamic_cast<HYDROGUI_Zone*>( theList.at( i ) );
730 aZonesList.append( aZone );
733 if ( aZonesList.length() > 0 )
735 // Get the target region
736 HYDROGUI_NamedObject* aRegionsRoot = dynamic_cast<HYDROGUI_NamedObject*>(theTargetParent);
739 // Create a new region
740 emit createLandCoverRegion( aZonesList );
744 HYDROGUI_Region* aRegion = dynamic_cast<HYDROGUI_Region*>(theTargetParent);
747 emit moveZones( theTargetParent, aZonesList, true );
753 void HYDROGUI_CalculationDlg::setObjectName( const QString& theName )
755 myObjectName->setText( theName );
758 QString HYDROGUI_CalculationDlg::getObjectName() const
760 return myObjectName->text();
763 void moveItems( QListWidget* theSource, QListWidget* theDest, const QStringList& theObjects )
765 QList<QListWidgetItem*> aFoundItems;
767 QListWidgetItem* anItem;
769 for ( int i = 0, n = theObjects.length(); i < n; ++i )
771 QString anObjName = theObjects.at( i );
772 aFoundItems = theSource->findItems( anObjName, Qt::MatchExactly );
773 for ( anIdx = 0; anIdx < aFoundItems.length(); anIdx++ )
775 anItem = aFoundItems.at( anIdx );
776 // Remove this object from available objects list
777 anItem = theSource->takeItem( theSource->row( anItem ) );
778 // Add the item to the included objects list
779 theDest->addItem( anItem );
784 void HYDROGUI_CalculationDlg::includeGeomObjects( const QStringList& theObjects )
786 QList<QListWidgetItem*> aFoundItems;
787 foreach ( const QString& anObjName, theObjects ) {
788 // Hide the object in the available objects list
789 aFoundItems = myAvailableGeomObjects->findItems( anObjName, Qt::MatchExactly );
790 foreach ( QListWidgetItem* anItem, aFoundItems ) {
791 anItem->setHidden( true );
794 // Add the object to the list of included objects
795 Handle(HYDROData_Entity) anObject =
796 HYDROGUI_Tool::FindObjectByName( module(), anObjName );
797 myGeomObjects->addObject( HYDROGUI_ListModel::Object2Visible( anObject, true ) );
800 myPriorityWidget->setObjects( getGeometryObjects() );
803 void HYDROGUI_CalculationDlg::excludeGeomObjects( const QStringList& theObjects )
805 QList<QListWidgetItem*> aFoundItems;
806 foreach ( const QString& anObjName, theObjects ) {
807 // Set visible the object in the available objects list
808 aFoundItems = myAvailableGeomObjects->findItems( anObjName, Qt::MatchExactly );
809 foreach ( QListWidgetItem* anItem, aFoundItems ) {
810 anItem->setHidden( false );
813 // Remove the object from the list of included objects
814 myGeomObjects->removeObjectByName( anObjName );
817 myPriorityWidget->setObjects( getGeometryObjects() );
820 void HYDROGUI_CalculationDlg::setBoundary( const QString& theObjName )
822 bool isBlocked = myPolylineName->blockSignals( true );
823 myPolylineName->setCurrentIndex( myPolylineName->findText( theObjName ) );
824 myPolylineName->blockSignals( isBlocked );
827 void HYDROGUI_CalculationDlg::setPolylineNames( const QStringList& theObjects, const QStringList& theObjectsEntries )
829 myPolylineName->clear();
830 myPolylineName->addItem( "", "" ); // No boundary item
832 for ( int i = 0, n = theObjects.length(); i < n; ++i )
834 myPolylineName->addItem( theObjects.at( i ), theObjectsEntries.at( i ) );
838 void HYDROGUI_CalculationDlg::setStricklerTableNames( const QStringList& theObjects, const QStringList& theObjectsEntries )
840 myStricklerTableName->clear();
842 for ( int i = 0, n = theObjects.length(); i < n; ++i )
844 myStricklerTableName->addItem( theObjects.at( i ), theObjectsEntries.at( i ) );
848 void HYDROGUI_CalculationDlg::setAllGeomObjects( const QStringList& theObjects, const QStringList& theObjectsEntries )
850 myAvailableGeomObjects->clear();
852 for ( int i = 0, n = theObjects.length(); i < n; ++i )
854 QString anObjName = theObjects.at( i );
856 QListWidgetItem* aListItem = new QListWidgetItem( anObjName, myAvailableGeomObjects );
857 aListItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
858 aListItem->setData( Qt::UserRole, theObjectsEntries.at( i ) );
862 void HYDROGUI_CalculationDlg::setAllLandCovers( const QStringList& theObjects, const QStringList& theObjectsEntries )
864 myAvailableLandCovers->clear();
866 for ( int i = 0, n = theObjects.length(); i < n; ++i )
868 QString anObjName = theObjects.at( i );
870 QListWidgetItem* aListItem = new QListWidgetItem( anObjName, myAvailableLandCovers );
871 aListItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
872 aListItem->setData( Qt::UserRole, theObjectsEntries.at( i ) );
876 QStringList getSelected( QListWidget* theWidget )
878 QStringList aResList;
879 QList<QListWidgetItem*> aList = theWidget->selectedItems();
880 for ( int i = 0, n = aList.length(); i < n; ++i )
882 aResList.append( aList.at( i )->text() );
887 QStringList HYDROGUI_CalculationDlg::getSelectedGeomObjects() const
889 return myGeomObjects->getSelectedNames();
892 QStringList HYDROGUI_CalculationDlg::getSelectedLandCovers() const
894 return myLandCovers->getSelectedNames();
897 QStringList HYDROGUI_CalculationDlg::getAllGeomObjects() const
899 return myGeomObjects->getAllNames();
902 QStringList HYDROGUI_CalculationDlg::getAllLandCovers() const
904 return myLandCovers->getAllNames();
907 QStringList HYDROGUI_CalculationDlg::getSelectedAvailableGeomObjects() const
909 return getSelected( myAvailableGeomObjects );
912 QStringList HYDROGUI_CalculationDlg::getSelectedAvailableLandCovers() const
914 return getSelected( myAvailableLandCovers );
917 void HYDROGUI_CalculationDlg::setEditedObject( const Handle(HYDROData_CalculationCase) theCase )
919 myEditedObject = theCase;
920 myValidator->setEditedObject( theCase );
922 // Build the calculation case subtree
923 module()->getDataModel()->buildCaseTree( myBrowser->root(), myEditedObject, false );
925 myBrowser->updateTree();
926 myBrowser->openLevels();
927 myBrowser->adjustColumnsWidth();
928 myBrowser->setAutoUpdate( true );
929 myBrowser->setUpdateModified( true );
931 // Build the calculation case subtree for Land Cover regions
932 module()->getDataModel()->buildCaseTree( myLandCoverBrowser->root(), myEditedObject, true );
934 myLandCoverBrowser->updateTree();
935 myLandCoverBrowser->openLevels();
936 myLandCoverBrowser->adjustColumnsWidth();
937 myLandCoverBrowser->setAutoUpdate( true );
938 myLandCoverBrowser->setUpdateModified( true );
941 HYDROGUI_Zone* HYDROGUI_CalculationDlg::getCurrentZone() const
943 return myCurrentZone;
946 void HYDROGUI_CalculationDlg::refreshZonesBrowser()
948 SUIT_DataObject* aRoot = myBrowser->root();
949 module()->getDataModel()->updateObjectTree( myEditedObject );
950 module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, false );
951 myBrowser->updateTree( aRoot );
954 void HYDROGUI_CalculationDlg::onDataChanged()
956 SUIT_DataObject* aRoot = myBrowser->root();
957 module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, false );
958 myBrowser->updateTree( aRoot );
961 void HYDROGUI_CalculationDlg::setAvailableGroups( const QStringList& theGroups )
963 myAvailableGroups->clear();
965 foreach( QString aGroup, theGroups )
966 myAvailableGroups->addItem( aGroup );
969 QStringList HYDROGUI_CalculationDlg::getSelectedGroups() const
971 return getSelected( myGroups );
974 QStringList HYDROGUI_CalculationDlg::getSelectedAvailableGroups() const
976 return getSelected( myAvailableGroups );
979 void HYDROGUI_CalculationDlg::includeGroups( const QStringList& theObjects )
981 moveItems( myAvailableGroups, myGroups, theObjects );
984 void HYDROGUI_CalculationDlg::excludeGroups( const QStringList& theObjects )
986 moveItems( myGroups, myAvailableGroups, theObjects );
991 @param theMode the mode
993 int HYDROGUI_CalculationDlg::getMode() const
995 return myModeButtons->checkedId();
1000 @param theMode the mode
1002 void HYDROGUI_CalculationDlg::setMode( int theMode )
1004 bool isBlocked = myModeButtons->blockSignals( true );
1005 myModeButtons->button( theMode )->setChecked( true );
1006 myModeButtons->blockSignals( isBlocked );
1008 bool isAuto = ( theMode == HYDROData_CalculationCase::AUTOMATIC );
1010 myGeomObjects->setOrderingEnabled( isAuto );
1011 QWidget* aWidget = mySplitter->widget( 1 );
1013 aWidget->setVisible( isAuto );
1018 Get creation mode for land covers panel.
1019 @param theMode the mode
1021 int HYDROGUI_CalculationDlg::getLandCoverMode() const
1023 return myLandCoverModeButtons->checkedId();
1027 Set creation mode for land cover panel.
1028 @param theMode the mode
1030 void HYDROGUI_CalculationDlg::setLandCoverMode( int theMode )
1032 bool isBlocked = myLandCoverModeButtons->blockSignals( true );
1033 myLandCoverModeButtons->button( theMode )->setChecked( true );
1034 myLandCoverModeButtons->blockSignals( isBlocked );
1036 bool isAuto = ( theMode == HYDROData_CalculationCase::AUTOMATIC );
1038 myLandCovers->setOrderingEnabled( isAuto );
1039 QWidget* aWidget = myLandCoverSplitter->widget( 1 );
1041 aWidget->setVisible( isAuto );
1046 Enable/disable zones drag'n'drop and renaming.
1047 @param theIsEnabled if true - zones drag'n'drop and renaming will be enabled
1049 void HYDROGUI_CalculationDlg::setEditZonesEnabled( const bool theIsEnabled )
1051 myBrowser->setReadOnly( !theIsEnabled );
1055 Enable/disable land covers drag'n'drop and renaming.
1056 @param theIsEnabled if true - land covers drag'n'drop and renaming will be enabled
1058 void HYDROGUI_CalculationDlg::setEditLandCoverZonesEnabled( const bool theIsEnabled )
1060 myLandCoverBrowser->setReadOnly( !theIsEnabled );
1064 Get included geometry objects.
1065 @return the list of geometry objects
1067 QList<Handle(HYDROData_Entity)> HYDROGUI_CalculationDlg::getGeometryObjects()
1069 QList<Handle(HYDROData_Entity)> anEntities = myGeomObjects->getObjects();
1070 QList<Handle(HYDROData_Entity)> anObjects;
1072 foreach ( Handle(HYDROData_Entity) anEntity, anEntities ) {
1073 Handle(HYDROData_Object) anObj = Handle(HYDROData_Object)::DownCast( anEntity );
1074 if ( anObj.IsNull() ) {
1085 Get included land covers.
1086 @return the list of land covers
1088 QList<Handle(HYDROData_Entity)> HYDROGUI_CalculationDlg::getLandCovers()
1090 QList<Handle(HYDROData_Entity)> anEntities = myLandCovers->getObjects();
1091 QList<Handle(HYDROData_Entity)> aLandCovers;
1093 foreach ( Handle(HYDROData_Entity) anEntity, anEntities ) {
1094 Handle(HYDROData_LandCover) aLandCover = Handle(HYDROData_LandCover)::DownCast( anEntity );
1095 if ( aLandCover.IsNull() ) {
1099 aLandCovers << aLandCover;
1107 @return the list of rules
1109 HYDROData_ListOfRules HYDROGUI_CalculationDlg::getRules() const
1111 return myPriorityWidget->getRules();
1116 @param theRules the list of rules
1118 void HYDROGUI_CalculationDlg::setRules( const HYDROData_ListOfRules& theRules ) const
1120 myPriorityWidget->setRules( theRules );
1124 Get rules defined for land covers.
1125 @return the list of rules
1127 HYDROData_ListOfRules HYDROGUI_CalculationDlg::getLandCoverRules() const
1129 return myLandCoverPriorityWidget->getRules();
1133 Set rules for land covers.
1134 @param theRules the list of rules
1136 void HYDROGUI_CalculationDlg::setLandCoverRules( const HYDROData_ListOfRules& theRules ) const
1138 myLandCoverPriorityWidget->setRules( theRules );
1142 Slot called when objects order is changed.
1144 void HYDROGUI_CalculationDlg::onOrderChanged()
1146 bool isConfirmed = true;
1147 emit orderChanged( isConfirmed );
1149 myPriorityWidget->setObjects( getGeometryObjects() );
1151 myGeomObjects->undoLastMove();
1155 Slot called when priority rule for geometry objects is changed.
1157 void HYDROGUI_CalculationDlg::onRuleChanged()
1159 bool isConfirmed = true;
1160 emit ruleChanged( isConfirmed );
1162 myPriorityWidget->undoLastChange();
1165 void HYDROGUI_CalculationDlg::setStricklerTable( const QString& theStricklerTableName, bool theBlockSignals )
1168 if ( theBlockSignals )
1169 isBlocked = myStricklerTableName->blockSignals( true );
1171 myStricklerTableName->setCurrentIndex( myStricklerTableName->findText( theStricklerTableName ) );
1173 if ( theBlockSignals )
1174 myStricklerTableName->blockSignals( isBlocked );
1176 emit StricklerTableSelected( theStricklerTableName );
1179 void HYDROGUI_CalculationDlg::includeLandCovers( const QStringList& theLandCovers, bool theReset )
1183 HYDROGUI_ListModel::Object2VisibleList anObject2VisibleList;
1184 myLandCovers->setObjects(anObject2VisibleList);
1187 QList<QListWidgetItem*> aFoundItems;
1188 foreach ( const QString& anObjName, theLandCovers ) {
1189 // Hide the land cover in the available land covers list
1190 aFoundItems = myAvailableLandCovers->findItems( anObjName, Qt::MatchExactly );
1191 foreach ( QListWidgetItem* anItem, aFoundItems ) {
1192 anItem->setHidden( true );
1195 // Add the land cover to the list of included objects
1196 Handle(HYDROData_Entity) anObject =
1197 HYDROGUI_Tool::FindObjectByName( module(), anObjName );
1198 myLandCovers->addObject( HYDROGUI_ListModel::Object2Visible( anObject, true ) );
1201 myLandCoverPriorityWidget->setObjects( getLandCovers() );
1204 void HYDROGUI_CalculationDlg::excludeLandCovers( const QStringList& theLandCovers )
1206 QList<QListWidgetItem*> aFoundItems;
1207 foreach ( const QString& anObjName, theLandCovers ) {
1208 // Set visible the land cover in the available objects list
1209 aFoundItems = myAvailableLandCovers->findItems( anObjName, Qt::MatchExactly );
1210 foreach ( QListWidgetItem* anItem, aFoundItems ) {
1211 anItem->setHidden( false );
1214 // Remove the land cover from the list of included objects
1215 myLandCovers->removeObjectByName( anObjName );
1218 myLandCoverPriorityWidget->setObjects( getLandCovers() );
1221 void HYDROGUI_CalculationDlg::refreshLandCoverZonesBrowser()
1223 SUIT_DataObject* aRoot = myLandCoverBrowser->root();
1224 module()->getDataModel()->updateObjectTree( myEditedObject );
1225 module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, true );
1226 myLandCoverBrowser->updateTree( aRoot );
1230 Slot called when zones created on land covers are changed.
1232 void HYDROGUI_CalculationDlg::onDataLandCoverChanged()
1234 SUIT_DataObject* aRoot = myLandCoverBrowser->root();
1235 module()->getDataModel()->buildCaseTree( aRoot, myEditedObject, true );
1236 myLandCoverBrowser->updateTree( aRoot );
1240 Slot called when land covers order is changed.
1242 void HYDROGUI_CalculationDlg::onOrderLandCoverChanged()
1244 bool isConfirmed = true;
1245 emit orderLandCoverChanged( isConfirmed );
1247 myLandCoverPriorityWidget->setObjects( getLandCovers() );
1249 myLandCovers->undoLastMove();
1253 Slot called when priority rule for land covers is changed.
1255 void HYDROGUI_CalculationDlg::onLandCoverRuleChanged()
1257 bool isConfirmed = true;
1258 emit ruleLandCoverChanged( isConfirmed );
1260 myLandCoverPriorityWidget->undoLastChange();