+QWizardPage* HYDROGUI_CalculationDlg::createGroupsPage() {
+ QWizardPage* aPage = new QWizardPage( mainFrame() );
+ QFrame* aFrame = new QFrame( aPage );
+
+ myGroups = new QListWidget( aPage );
+ myGroups->setSelectionMode( QListWidget::ExtendedSelection );
+ myGroups->setEditTriggers( QListWidget::NoEditTriggers );
+ myGroups->setViewMode( QListWidget::ListMode );
+ myGroups->setSortingEnabled( true );
+
+ myAvailableGroups = new QListWidget( aPage );
+ myAvailableGroups->setSelectionMode( QListWidget::ExtendedSelection );
+ myAvailableGroups->setEditTriggers( QListWidget::NoEditTriggers );
+ myAvailableGroups->setViewMode( QListWidget::ListMode );
+ myAvailableGroups->setSortingEnabled( true );
+
+ connect( myGroups, SIGNAL( itemSelectionChanged() ),
+ SIGNAL( groupsSelected() ) );
+
+ QFrame* aGroupsFrame = new QFrame( aPage );
+ QGridLayout* aGroupsLayout = new QGridLayout( aGroupsFrame );
+ aGroupsLayout->setMargin( 5 );
+ aGroupsLayout->setSpacing( 5 );
+ aGroupsFrame->setLayout( aGroupsLayout );
+
+ QFrame* aBtnsFrame = new QFrame( aGroupsFrame );
+ QVBoxLayout* aBtnsLayout = new QVBoxLayout( aBtnsFrame );
+ aBtnsLayout->setMargin( 5 );
+ aBtnsLayout->setSpacing( 5 );
+ aBtnsFrame->setLayout( aBtnsLayout );
+ QPushButton* anAddBtn = new QPushButton( tr("INCLUDE"), aBtnsFrame );
+ QPushButton* aRemoveBtn = new QPushButton( tr("EXCLUDE"), aBtnsFrame );
+
+ // Fill the butons frame with two buttons
+ aBtnsLayout->addWidget( anAddBtn );
+ aBtnsLayout->addWidget( aRemoveBtn );
+ aBtnsLayout->addStretch( 1 );
+
+ QLabel* anIncludedLabel = new QLabel( tr( "INCLUDED_GROUPS" ), aGroupsFrame );
+ QLabel* anAvailableLabel = new QLabel( tr( "AVAILABLE_GROUPS" ), aGroupsFrame );
+
+ // Fill the objects frame with two lists, two labels and with buttons frame
+ aGroupsLayout->addWidget( anAvailableLabel, 0, 0, Qt::AlignHCenter );
+ aGroupsLayout->addWidget( anIncludedLabel, 0, 2, Qt::AlignHCenter );
+ aGroupsLayout->addWidget( myAvailableGroups, 1, 0 );
+ aGroupsLayout->addWidget( aBtnsFrame, 1, 1, Qt::AlignHCenter );
+ aGroupsLayout->addWidget( myGroups, 1, 2 );
+
+ // Fill the page
+ QGridLayout* aPageLayout = new QGridLayout( aPage );
+ aPageLayout->setMargin( 5 );
+ aPageLayout->setSpacing( 5 );
+ aPageLayout->setVerticalSpacing( 10 );
+ aPageLayout->addWidget( aGroupsFrame, 0, 0 );
+
+ aPage->setLayout( aPageLayout );
+
+ connect( anAddBtn, SIGNAL( clicked() ), SIGNAL( addGroups() ) );
+ connect( aRemoveBtn, SIGNAL( clicked() ), SIGNAL( removeGroups() ) );
+
+ return aPage;
+}
+
+QWizardPage* HYDROGUI_CalculationDlg::createLandCoversPage() {
+ QWizardPage* aPage = new QWizardPage( mainFrame() );
+ QFrame* aFrame = new QFrame( aPage );
+
+ // Splitter
+ myLandCoverSplitter = new QSplitter(Qt::Vertical);
+
+ // Top of the page
+ QWidget* aTopContainer = new QWidget;
+
+ // Combo-box to choose Strickler table name
+ QLabel* aStricklerTableLabel = new QLabel( tr( "STRICKLER_TABLE" ), aPage );
+ myStricklerTableName = new QComboBox( aPage );
+ myStricklerTableName->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
+ connect( myStricklerTableName, SIGNAL( activated( const QString & ) ),
+ SIGNAL( StricklerTableSelected( const QString & ) ) );
+
+ // Mode selector (auto/manual)
+ QGroupBox* aModeGroup = new QGroupBox( tr( "MODE" ) );
+
+ QRadioButton* aManualRB = new QRadioButton( tr( "MANUAL" ), mainFrame() );
+ QRadioButton* anAutoRB = new QRadioButton( tr( "AUTO" ), mainFrame() );
+
+ myLandCoverModeButtons = new QButtonGroup( mainFrame() );
+ myLandCoverModeButtons->addButton( anAutoRB, HYDROData_CalculationCase::AUTOMATIC );
+ myLandCoverModeButtons->addButton( aManualRB, HYDROData_CalculationCase::MANUAL );
+
+ QBoxLayout* aModeSelectorLayout = new QHBoxLayout;
+ aModeSelectorLayout->setMargin( 5 );
+ aModeSelectorLayout->setSpacing( 5 );
+ aModeSelectorLayout->addWidget( anAutoRB );
+ aModeSelectorLayout->addWidget( aManualRB );
+ aModeGroup->setLayout( aModeSelectorLayout );
+
+ // Available land covers
+ QLabel* aLandCoversLabel = new QLabel( tr( "CALCULATION_REFERENCE_LAND_COVERS" ) );
+ myAvailableLandCovers = new QListWidget( aPage );
+ myAvailableLandCovers->setSelectionMode( QListWidget::ExtendedSelection );
+ myAvailableLandCovers->setEditTriggers( QListWidget::NoEditTriggers );
+ myAvailableLandCovers->setViewMode( QListWidget::ListMode );
+ myAvailableLandCovers->setSortingEnabled( true );
+
+ // Included land covers
+ QLabel* anIncludedLabel = new QLabel( tr( "INCLUDED_LAND_COVERS" ) );
+ myLandCovers = new HYDROGUI_OrderedListWidget( aPage, 16 );
+ myLandCovers->setHiddenObjectsShown(true);
+ myLandCovers->setVisibilityIconShown(false);
+ myLandCovers->setContentsMargins(QMargins());
+
+ // Include/Exclude buttons
+ QFrame* aBtnsFrame = new QFrame;
+ QVBoxLayout* aBtnsLayout = new QVBoxLayout( aBtnsFrame );
+ aBtnsLayout->setMargin( 5 );
+ aBtnsLayout->setSpacing( 5 );
+ aBtnsFrame->setLayout( aBtnsLayout );
+ QPushButton* anAddBtn = new QPushButton( tr("INCLUDE"), aBtnsFrame );
+ QPushButton* aRemoveBtn = new QPushButton( tr("EXCLUDE"), aBtnsFrame );
+
+ // Fill the butons frame with two buttons
+ aBtnsLayout->addWidget( anAddBtn );
+ aBtnsLayout->addWidget( aRemoveBtn );
+ aBtnsLayout->addStretch( 1 );
+
+ // Land covers frame
+ QFrame* aLandCoversFrame = new QFrame( aPage );
+ aLandCoversFrame->setFrameStyle( QFrame::Panel | QFrame::Raised );
+ QGridLayout* aLandCoversLayout = new QGridLayout( aLandCoversFrame );
+ aLandCoversLayout->setMargin( 5 );
+ aLandCoversLayout->setSpacing( 5 );
+ aLandCoversFrame->setLayout( aLandCoversLayout );
+
+ // Fill the land covers frame with two lists, two labels and with buttons frame
+ aLandCoversLayout->addWidget( aLandCoversLabel, 0, 0, Qt::AlignHCenter );
+ aLandCoversLayout->addWidget( anIncludedLabel, 0, 2, Qt::AlignHCenter );
+ aLandCoversLayout->addWidget( myAvailableLandCovers, 1, 0 );
+ aLandCoversLayout->addWidget( aBtnsFrame, 1, 1, Qt::AlignHCenter );
+ aLandCoversLayout->addWidget( myLandCovers, 1, 2 );
+
+ // Fill the top layout of the page
+ QGridLayout* aTopLayout = new QGridLayout;
+ aTopLayout->setMargin( 5 );
+ aTopLayout->setSpacing( 5 );
+ aTopLayout->setVerticalSpacing( 10 );
+ aTopLayout->addWidget( aStricklerTableLabel, 0, 0, Qt::AlignHCenter );
+ aTopLayout->addWidget( myStricklerTableName, 0, 1 );
+ aTopLayout->addWidget( aModeGroup, 1, 0, 1, 2 );
+ aTopLayout->addWidget( aLandCoversFrame, 2, 0, 1, 2 );
+
+ aTopContainer->setLayout( aTopLayout );
+
+ // Add the top of the page to the splitter
+ myLandCoverSplitter->insertWidget(0, aTopContainer);
+ myLandCoverSplitter->setStretchFactor(0, 2);
+
+ // Bottom of the page
+ myLandCoverPriorityWidget = new HYDROGUI_PriorityWidget( mainFrame() );
+ HYDROGUI_PriorityTableModel* aModel =
+ dynamic_cast<HYDROGUI_PriorityTableModel*>( myLandCoverPriorityWidget->getTable()->model() );
+ if ( aModel )
+ aModel->setColumnCount( 3 );
+
+ QGroupBox* aPriorityGroup = new QGroupBox( tr( "PRIORITY" ) );
+ QBoxLayout* aPriorityLayout = new QHBoxLayout;
+ aPriorityLayout->setMargin( 5 );
+ aPriorityLayout->setSpacing( 5 );
+ aPriorityLayout->addWidget( myLandCoverPriorityWidget );
+ aPriorityGroup->setLayout( aPriorityLayout );
+
+ // Add the bottom of the page to the splitter
+ myLandCoverSplitter->insertWidget(1, aPriorityGroup);
+ myLandCoverSplitter->setStretchFactor(1, 1);
+
+ // Page layout
+ QVBoxLayout* aPageLayout = new QVBoxLayout;
+ aPageLayout->setMargin( 5 );
+ aPageLayout->setSpacing( 5 );
+ aPageLayout->addWidget( myLandCoverSplitter );
+
+ aPage->setLayout( aPageLayout );
+
+ // Create selector
+ if ( module() ) {
+ HYDROGUI_ListSelector* aListSelector =
+ new HYDROGUI_ListSelector( myLandCovers, module()->getApp()->selectionMgr() );
+ aListSelector->setAutoBlock( true );
+ }
+
+ // Connections
+ connect( myLandCoverModeButtons, SIGNAL( buttonClicked( int ) ), SIGNAL( changeLandCoverMode( int ) ) );
+ connect( anAddBtn, SIGNAL( clicked() ), SIGNAL( addLandCovers() ) );
+ connect( aRemoveBtn, SIGNAL( clicked() ), SIGNAL( removeLandCovers() ) );
+
+ connect( myLandCovers, SIGNAL( orderLandCoverChanged() ), SLOT( onOrderLandCoverChanged() ) );
+
+ return aPage;
+}
+
+QWizardPage* HYDROGUI_CalculationDlg::createZonesPage() {
+ QWizardPage* aPage = new QWizardPage( mainFrame() );
+ QFrame* aFrame = new QFrame( aPage );
+
+ QGridLayout* aLayout = new QGridLayout( aPage );
+
+ myBrowser = new HYDROGUI_DataBrowser( module(), NULL, aPage );
+ myBrowser->setAutoOpenLevel( 3 );
+ aLayout->setMargin( 5 );
+ aLayout->setSpacing( 5 );
+
+ aLayout->addWidget( myBrowser, 0, 0, 1, 2 );
+
+ myBathymetryLabel = new QLabel( tr( "BATHYMETRY" ), aFrame );
+ myBathymetryChoice = new QComboBox( aFrame );
+
+ myBathymetryChoice->setVisible( false );
+ myBathymetryLabel->setVisible( false );
+
+ aLayout->addWidget( myBathymetryLabel, 1, 0 );
+ aLayout->addWidget( myBathymetryChoice, 1, 1 );
+
+ aPage->setLayout( aLayout );
+
+ connect( myBrowser, SIGNAL( dataChanged() ), SLOT( onDataChanged() ) );
+ connect( myBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SIGNAL( clickedInZonesBrowser( SUIT_DataObject* ) ) );
+ connect( myBrowser, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onSelected( SUIT_DataObject* ) ) );
+ connect( myBathymetryChoice, SIGNAL( activated( int ) ), SLOT( onMergeTypeSelected( int ) ) );
+ connect( myBrowser,
+ SIGNAL( dropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ),
+ SLOT( onZonesDropped( const QList<SUIT_DataObject*>&, SUIT_DataObject*, int, Qt::DropAction ) ) );
+ connect( myBrowser, SIGNAL( newRegion() ), this, SLOT( OnNewRegion() ) );
+
+ return aPage;
+}
+
+QWizardPage* HYDROGUI_CalculationDlg::createLandCoversPartitionPage() {
+ QWizardPage* aPage = new QWizardPage( mainFrame() );
+ QFrame* aFrame = new QFrame( aPage );
+
+ QGridLayout* aLayout = new QGridLayout( aPage );
+
+ myLandCoverBrowser = new HYDROGUI_DataBrowser( module(), NULL, aPage );
+ myLandCoverBrowser->setAutoOpenLevel( 3 );
+ aLayout->setMargin( 5 );
+ aLayout->setSpacing( 5 );
+
+ aLayout->addWidget( myLandCoverBrowser, 0, 0, 1, 2 );
+
+ aPage->setLayout( aLayout );
+
+ // Connections
+ //...
+
+ return aPage;
+}
+
+
+bool HYDROGUI_CalculationDlg::acceptCurrent() const