From 3f5985973d0fb31476b8d0efa7fa187ece1fca90 Mon Sep 17 00:00:00 2001 From: mkr Date: Mon, 22 Jun 2015 13:43:39 +0300 Subject: [PATCH] refs #575, #580: display the information about the chosen land cover objects in the last column of data browser, resolve Strickler types conflicts for zones constructed on land covers, add static labels on two last pages of the dialog. --- src/HYDROGUI/HYDROGUI_CalculationDlg.cxx | 18 ++++++++++----- src/HYDROGUI/HYDROGUI_DataBrowser.cxx | 2 +- src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx | 4 ++-- src/HYDROGUI/HYDROGUI_Zone.cxx | 27 ++++++++++++++++++----- src/HYDROGUI/resources/HYDROGUI_msg_en.ts | 12 ++++++++-- 5 files changed, 47 insertions(+), 16 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx b/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx index 7e153019..889d2b61 100644 --- a/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_CalculationDlg.cxx @@ -453,13 +453,16 @@ QWizardPage* HYDROGUI_CalculationDlg::createZonesPage() { 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 ); @@ -467,8 +470,8 @@ QWizardPage* HYDROGUI_CalculationDlg::createZonesPage() { 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 ); @@ -490,12 +493,15 @@ QWizardPage* HYDROGUI_CalculationDlg::createLandCoverZonesPage() { QGridLayout* aLayout = new QGridLayout( 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 ); @@ -503,8 +509,8 @@ QWizardPage* HYDROGUI_CalculationDlg::createLandCoverZonesPage() { myStricklerTypeLabel->setVisible( false ); myStricklerTypeChoice->setVisible( false ); - aLayout->addWidget( myStricklerTypeLabel, 1, 0 ); - aLayout->addWidget( myStricklerTypeChoice, 1, 1 ); + aLayout->addWidget( myStricklerTypeLabel, 2, 0 ); + aLayout->addWidget( myStricklerTypeChoice, 2, 1 ); aPage->setLayout( aLayout ); diff --git a/src/HYDROGUI/HYDROGUI_DataBrowser.cxx b/src/HYDROGUI/HYDROGUI_DataBrowser.cxx index 3d8b1875..9092fa87 100644 --- a/src/HYDROGUI/HYDROGUI_DataBrowser.cxx +++ b/src/HYDROGUI/HYDROGUI_DataBrowser.cxx @@ -216,7 +216,7 @@ HYDROGUI_DataBrowser::HYDROGUI_DataBrowser( HYDROGUI_Module* theModule, QString RefObjCol = tr( "REF_OBJECT_COLUMN" ); QString AltitudeCol; if ( theLandCover ) - AltitudeCol = tr( "STRICKLER_TABLE_COLUMN" ); + AltitudeCol = tr( "LAND_COVER_COLUMN" ); else AltitudeCol = tr( "ALTITUDE_COLUMN" ); diff --git a/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx b/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx index 6554e5ef..52969e5e 100644 --- a/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx +++ b/src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx @@ -192,8 +192,8 @@ void HYDROGUI_VTKPrsShape::buildShape() HYDROData_SequenceOfObjects::Iterator anIter( aRefObjects ); for ( ; anIter.More(); anIter.Next() ) { - Handle(HYDROData_Object) aRefbject = - Handle(HYDROData_Object)::DownCast( anIter.Value() ); + Handle(HYDROData_Entity) aRefbject = + Handle(HYDROData_Entity)::DownCast( anIter.Value() ); if ( aRefbject.IsNull() ) continue; diff --git a/src/HYDROGUI/HYDROGUI_Zone.cxx b/src/HYDROGUI/HYDROGUI_Zone.cxx index 469695cf..c1139e1e 100644 --- a/src/HYDROGUI/HYDROGUI_Zone.cxx +++ b/src/HYDROGUI/HYDROGUI_Zone.cxx @@ -101,6 +101,7 @@ QString HYDROGUI_Zone::getObjectName() const QString aName; for ( ; anIter.More(); anIter.Next() ) { + aName.clear(); Handle(HYDROData_Object) aRefGeomObj = Handle(HYDROData_Object)::DownCast( anIter.Value() ); if ( !aRefGeomObj.IsNull() ) @@ -116,13 +117,29 @@ QString HYDROGUI_Zone::getObjectName() const aRes = aName; break; } - - if ( !aNamesSet.contains( aName ) ) + } + } + else + { + Handle(HYDROData_LandCover) aRefLandCoverObj = + Handle(HYDROData_LandCover)::DownCast( anIter.Value() ); + if ( !aRefLandCoverObj.IsNull() ) + { + // Get name of land cover object + aName = aRefLandCoverObj->GetName(); + if ( !isMergingNeed ) { - aRes += aName + ", "; - aNamesSet.insert( aName ); + // Get the first land cover object's altitude name and go out + aRes = aName; + break; } - } + } + } + + if ( !aName.isEmpty() && !aNamesSet.contains( aName ) ) + { + aRes += aName + ", "; + aNamesSet.insert( aName ); } } // Remove the last comma if necessary diff --git a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts index c464bb86..fa807278 100644 --- a/src/HYDROGUI/resources/HYDROGUI_msg_en.ts +++ b/src/HYDROGUI/resources/HYDROGUI_msg_en.ts @@ -365,6 +365,14 @@ All supported formats (*.brep *.iges *.igs *.step *.stp) STRICKLER_TYPE Strickler type from land cover + + RESULTS_ON_GEOMETRY_OBJECTS + Results on geometry objects + + + RESULTS_ON_LAND_COVERS + Results on land covers + @@ -430,8 +438,8 @@ All supported formats (*.brep *.iges *.igs *.step *.stp) Altitude.Object - STRICKLER_TABLE_COLUMN - Strickler table + LAND_COVER_COLUMN + Land cover ZONE_TO_NEW_REGION -- 2.39.2