QFrame* aFrame = new QFrame( aPage );
QGridLayout* aLayout = new QGridLayout( aPage );
+
+ QLabel* aResultsOnGeomObjectsLabel = new QLabel( tr( "RESULTS_ON_GEOMETRY_OBJECTS" ), aFrame );
myBrowser = new HYDROGUI_DataBrowser( module(), NULL, aPage );
myBrowser->setAutoOpenLevel( 3 );
aLayout->setMargin( 5 );
aLayout->setSpacing( 5 );
- aLayout->addWidget( myBrowser, 0, 0, 1, 2 );
+ aLayout->addWidget( aResultsOnGeomObjectsLabel, 0, 0 );
+ aLayout->addWidget( myBrowser, 1, 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 );
+ aLayout->addWidget( myBathymetryLabel, 2, 0 );
+ aLayout->addWidget( myBathymetryChoice, 2, 1 );
aPage->setLayout( aLayout );
QGridLayout* aLayout = new QGridLayout( aPage );
- myLandCoverBrowser = new HYDROGUI_DataBrowser( module(), NULL, aPage );
+ QLabel* aResultsOnLandCoversLabel = new QLabel( tr( "RESULTS_ON_LAND_COVERS" ), aFrame );
+
+ myLandCoverBrowser = new HYDROGUI_DataBrowser( module(), NULL, aPage, true );
myLandCoverBrowser->setAutoOpenLevel( 3 );
aLayout->setMargin( 5 );
aLayout->setSpacing( 5 );
- aLayout->addWidget( myLandCoverBrowser, 0, 0, 1, 2 );
+ aLayout->addWidget( aResultsOnLandCoversLabel, 0, 0 );
+ aLayout->addWidget( myLandCoverBrowser, 1, 0, 1, 2 );
myStricklerTypeLabel = new QLabel( tr( "STRICKLER_TYPE" ), aFrame );
myStricklerTypeChoice = new QComboBox( aFrame );
myStricklerTypeLabel->setVisible( false );
myStricklerTypeChoice->setVisible( false );
- aLayout->addWidget( myBathymetryLabel, 1, 0 );
- aLayout->addWidget( myBathymetryChoice, 1, 1 );
+ aLayout->addWidget( myStricklerTypeLabel, 2, 0 );
+ aLayout->addWidget( myStricklerTypeChoice, 2, 1 );
aPage->setLayout( aLayout );
myBathymetryChoice->addItem( tr("MERGE_UNKNOWN"), HYDROData_Zone::Merge_UNKNOWN );
myBathymetryChoice->addItem( tr("MERGE_ZMIN"), HYDROData_Zone::Merge_ZMIN );
myBathymetryChoice->addItem( tr("MERGE_ZMAX"), HYDROData_Zone::Merge_ZMAX );
- QStringList aList = aZone->getAltitudes();
+ QStringList aList = aZone->getObjects();
for ( int i = 0; i < aList.length(); i++ )
{
myBathymetryChoice->addItem( aList.at( i ), HYDROData_Zone::Merge_Object );
myCurrentZone = aZone;
myStricklerTypeChoice->clear();
myStricklerTypeChoice->addItem( tr("MERGE_UNKNOWN"), HYDROData_Zone::Merge_UNKNOWN );
- /*QStringList aList = aZone->getStricklerTypes();
+ QStringList aList = aZone->getObjects();
for ( int i = 0; i < aList.length(); i++ )
{
myStricklerTypeChoice->addItem( aList.at( i ), HYDROData_Zone::Merge_Object );
default:
aCurIndex = 0; // Select unknown by default
}
- myStricklerTypeChoice->setCurrentIndex( aCurIndex );*/
+ myStricklerTypeChoice->setCurrentIndex( aCurIndex );
myStricklerTypeChoice->blockSignals( prevBlock );
}
myStricklerTypeChoice->setVisible( doShow );
myStricklerTypeChoice->setEnabled( getLandCoverMode() == HYDROData_CalculationCase::MANUAL );
- myStricklerTypeChoice->setVisible( doShow );
+ myStricklerTypeLabel->setVisible( doShow );
}
void HYDROGUI_CalculationDlg::onMergeStricklerTypeSelected( int theIndex )
void HYDROGUI_CalculationDlg::onLandCoverZonesDropped( const QList<SUIT_DataObject*>& theList,
SUIT_DataObject* theTargetParent, int theTargetRow, Qt::DropAction theDropAction )
{
- // TODO: implement this function
+ QList<SUIT_DataObject*> aZonesList;
+ HYDROGUI_Zone* aZone;
+ // Get a list of dropped land cover zones
+ for ( int i = 0; i < theList.length(); i++ )
+ {
+ aZone = dynamic_cast<HYDROGUI_Zone*>( theList.at( i ) );
+ if ( aZone )
+ {
+ aZonesList.append( aZone );
+ }
+ }
+ if ( aZonesList.length() > 0 )
+ {
+ // Get the target region
+ HYDROGUI_NamedObject* aRegionsRoot = dynamic_cast<HYDROGUI_NamedObject*>(theTargetParent);
+ if ( aRegionsRoot )
+ {
+ // Create a new region
+ emit createLandCoverRegion( aZonesList );
+ }
+ else
+ {
+ HYDROGUI_Region* aRegion = dynamic_cast<HYDROGUI_Region*>(theTargetParent);
+ if ( aRegion )
+ {
+ emit moveZones( theTargetParent, aZonesList, true );
+ }
+ }
+ }
}
void HYDROGUI_CalculationDlg::setObjectName( const QString& theName )