From 3a5d19ec64b7a2398b5bdc37390173dadbcdb809 Mon Sep 17 00:00:00 2001 From: asl Date: Mon, 9 Nov 2015 11:36:37 +0300 Subject: [PATCH] new operation for change land cover type --- src/HYDROGUI/HYDROGUI_LandCoverMapDlg.cxx | 3 ++- src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx | 11 +++++++++-- src/HYDROGUI/HYDROGUI_Operations.cxx | 6 ++++++ src/HYDROGUI/HYDROGUI_Operations.h | 1 + 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_LandCoverMapDlg.cxx b/src/HYDROGUI/HYDROGUI_LandCoverMapDlg.cxx index 9c57ed86..ec2a3e5c 100644 --- a/src/HYDROGUI/HYDROGUI_LandCoverMapDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_LandCoverMapDlg.cxx @@ -189,7 +189,8 @@ void HYDROGUI_LandCoverMapDlg::updateState( bool theInitialConfigure ) bool aShowStricklerTypesCtrls = ( myOperationId == CreateLandCoverMapId || myOperationId == AddLandCoverId || - myOperationId == MergeLandCoverId ); + myOperationId == MergeLandCoverId || + myOperationId == ChangeLandCoverTypeId ); myStricklerTypesLabel->setVisible( aShowStricklerTypesCtrls ); myStricklerTypes->setVisible( aShowStricklerTypesCtrls ); } diff --git a/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx b/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx index 3de085b9..5e2c0b9e 100644 --- a/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx +++ b/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx @@ -57,6 +57,9 @@ HYDROGUI_LandCoverMapOp::HYDROGUI_LandCoverMapOp( HYDROGUI_Module* theModule, co case MergeLandCoverId: setName( tr( "MERGE_LAND_COVER" ) ); break; + case ChangeLandCoverTypeId: + setName( tr( "CHANGE_LAND_COVER_TYPE" ) ); + break; } } @@ -180,7 +183,9 @@ bool HYDROGUI_LandCoverMapOp::processApply( int& theUpdateFlags, } } // Get face(s) selected in the 3d viewer - else if ( myOperationId == RemoveLandCoverId || myOperationId == MergeLandCoverId ) + else if ( myOperationId == RemoveLandCoverId || + myOperationId == MergeLandCoverId || + myOperationId == ChangeLandCoverTypeId ) { // TODO: //Fill in aFacesSelectedInViewer list @@ -188,7 +193,9 @@ bool HYDROGUI_LandCoverMapOp::processApply( int& theUpdateFlags, // Get selected Strickler type QString aSelectedStricklerType; - if ( myOperationId == CreateLandCoverMapId || myOperationId == AddLandCoverId || myOperationId == MergeLandCoverId ) + if ( myOperationId == CreateLandCoverMapId || + myOperationId == AddLandCoverId || + myOperationId == MergeLandCoverId ) { aSelectedStricklerType = aPanel->getSelectedStricklerTypeName(); if ( aSelectedStricklerType.isEmpty() ) diff --git a/src/HYDROGUI/HYDROGUI_Operations.cxx b/src/HYDROGUI/HYDROGUI_Operations.cxx index 1715bc47..b3c604ab 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.cxx +++ b/src/HYDROGUI/HYDROGUI_Operations.cxx @@ -175,6 +175,7 @@ void HYDROGUI_Module::createActions() createAction( RemoveLandCoverId, "REMOVE_LAND_COVER", "REMOVE_LAND_COVER_ICO" ); createAction( SplitLandCoverId, "SPLIT_LAND_COVER", "SPLIT_LAND_COVER_ICO" ); createAction( MergeLandCoverId, "MERGE_LAND_COVER", "MERGE_LAND_COVER_ICO" ); + createAction( ChangeLandCoverTypeId, "CHANGE_LAND_COVER_TYPE", "CHANGE_LAND_COVER_TYPE_ICO" ); createAction( ImportObstacleFromFileId, "IMPORT_OBSTACLE_FROM_FILE", "IMPORT_OBSTACLE_FROM_FILE_ICO" ); createAction( ImportGeomObjectAsObstacleId, "IMPORT_GEOM_OBJECT_AS_OBSTACLE", "IMPORT_GEOM_OBJECT_ICO" ); @@ -295,6 +296,7 @@ void HYDROGUI_Module::createMenus() createMenu( separator(), aLandCoverMapMenuId ); createMenu( SplitLandCoverId, aLandCoverMapMenuId, -1, -1 ); createMenu( MergeLandCoverId, aLandCoverMapMenuId, -1, -1 ); + createMenu( ChangeLandCoverTypeId, aLandCoverMapMenuId, -1, -1 ); createMenu( CreateCalculationId, aHydroId, -1, -1 ); createMenu( separator(), aHydroId ); @@ -350,6 +352,7 @@ void HYDROGUI_Module::createToolbars() createTool( RemoveLandCoverId, aToolBar ); createTool( SplitLandCoverId, aToolBar ); createTool( MergeLandCoverId, aToolBar ); + createTool( ChangeLandCoverTypeId, aToolBar ); createTool( separator(), aToolBar ); createTool( CreateCalculationId, aToolBar ); @@ -569,6 +572,9 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const case MergeLandCoverId: anOp = new HYDROGUI_LandCoverMapOp( aModule, theId ); break; + case ChangeLandCoverTypeId: + anOp = new HYDROGUI_LandCoverMapOp( aModule, theId ); + break; case DuplicateStricklerTableId: anOp = new HYDROGUI_DuplicateOp( aModule ); break; diff --git a/src/HYDROGUI/HYDROGUI_Operations.h b/src/HYDROGUI/HYDROGUI_Operations.h index 1c845bd2..a048c16f 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.h +++ b/src/HYDROGUI/HYDROGUI_Operations.h @@ -127,6 +127,7 @@ enum OperationId RemoveLandCoverId, SplitLandCoverId, MergeLandCoverId, + ChangeLandCoverTypeId, PolylineExtractionId, SplitPolylinesId, -- 2.39.2