X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_Operations.cxx;h=8371e64d1dbe85ea64a6e5e8dee481e4aaab7d7a;hb=dbee981213585cb317e098b0d2a288761cd3d37b;hp=3ede1f216c9e16197f7606e7538dee7725c9864d;hpb=b783b69a0750273530c87536540b56a444aae6be;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_Operations.cxx b/src/HYDROGUI/HYDROGUI_Operations.cxx index 3ede1f21..8371e64d 100644 --- a/src/HYDROGUI/HYDROGUI_Operations.cxx +++ b/src/HYDROGUI/HYDROGUI_Operations.cxx @@ -53,7 +53,7 @@ #include "HYDROGUI_GeoreferencementOp.h" #include "HYDROGUI_SetColorOp.h" #include "HYDROGUI_BathymetryBoundsOp.h" -#include "HYDROGUI_Tool.h" +#include "HYDROGUI_Tool2.h" #include "HYDROGUI_ZLevelsOp.h" #include "HYDROGUI_LocalCSOp.h" #include "HYDROGUI_RiverBottomOp.h" @@ -62,16 +62,20 @@ #include "HYDROGUI_SubmersibleOp.h" #include "HYDROGUI_StricklerTableOp.h" #include "HYDROGUI_DuplicateOp.h" -#include "HYDROGUI_LandCoverOp.h" +#include "HYDROGUI_LandCoverMapOp.h" +#include "HYDROGUI_PolylineExtractionOp.h" #include "HYDROGUI_ExportSinusXOp.h" #include "HYDROGUI_MergePolylinesOp.h" #include "HYDROGUI_SplitPolylinesOp.h" #include "HYDROGUI_LandCoverColoringOp.h" -#include "HYDROGUI_ImportLandCoverOp.h" +#include "HYDROGUI_SetTransparencyOp.h" + +#include "HYDROGUI_ImportLandCoverMapOp.h" #include #include #include +#include #include #include @@ -132,7 +136,7 @@ void HYDROGUI_Module::createActions() createAction( ImportPolylineId, "IMPORT_POLYLINE", "IMPORT_POLYLINE_ICO" ); createAction( ImportSinusXId, "IMPORT_SINUSX", "IMPORT_SINUSX_ICO" ); createAction( ExportSinusXId, "EXPORT_SINUSX", "EXPORT_SINUSX_ICO" ); - createAction( ImportLandcoverId, "IMPORT_LANDCOVER", "IMPORT_LANDCOVER_ICO" ); + createAction( ImportLandCoverMapId, "IMPORT_LANDCOVER_MAP", "IMPORT_LANDCOVER_MAP_ICO" ); createAction( CreatePolylineId, "CREATE_POLYLINE", "CREATE_POLYLINE_ICO" ); createAction( EditPolylineId, "EDIT_POLYLINE", "EDIT_POLYLINE_ICO" ); @@ -167,8 +171,13 @@ void HYDROGUI_Module::createActions() createAction( EditStricklerTableId, "EDIT_STRICKLER_TABLE", "EDIT_STRICKLER_TABLE_ICO" ); createAction( DuplicateStricklerTableId, "DUPLICATE_STRICKLER_TABLE", "DUPLICATE_STRICKLER_TABLE_ICO" ); - createAction( CreateLandCoverId, "CREATE_LAND_COVER", "CREATE_LAND_COVER_ICO" ); - createAction( EditLandCoverId, "EDIT_LAND_COVER", "EDIT_LAND_COVER_ICO" ); + createAction( CreateLandCoverMapId, "CREATE_LAND_COVER_MAP", "CREATE_LAND_COVER_MAP_ICO" ); + + createAction( AddLandCoverId, "ADD_LAND_COVER", "ADD_LAND_COVER_ICO" ); + 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" ); @@ -188,7 +197,7 @@ void HYDROGUI_Module::createActions() createAction( EditCutImageId, "EDIT_CUT_IMAGE", "EDIT_CUT_IMAGE_ICO" ); createAction( SplitImageId, "SPLIT_IMAGE", "SPLIT_IMAGE_ICO" ); - createAction( EditSplittedImageId, "EDIT_SPLITTED_IMAGE", "EDIT_SPLITTED_IMAGE_ICO" ); + createAction( EditSplitImageId, "EDIT_SPLIT_IMAGE", "EDIT_SPLIT_IMAGE_ICO" ); createAction( RecognizeContoursId, "RECOGNIZE_CONTOURS", "RECOGNIZE_CONTOURS_ICO" ); @@ -198,6 +207,7 @@ void HYDROGUI_Module::createActions() SLOT( onDelete() ) ); createAction( SetColorId, "COLOR" ); + createAction( SetTransparencyId, "TRANSPARENCY" ); createAction( SetZLevelId, "ZLEVEL" ); createAction( EditLocalCSId, "EDIT_LOCAL_CS" ); @@ -214,6 +224,7 @@ void HYDROGUI_Module::createActions() createAction( SubmersibleId, "SUBMERSIBLE", "SUBMERSIBLE_ICO" ); createAction( ExportToShapeFileID, "EXPORT_TO_SHAPE_FILE", "EXPORT_TO_SHAPE_FILE_ICO" ); + createAction( PolylineExtractionId, "POLYLINE_EXTRACTION" ); createAction( SplitPolylinesId, "SPLIT_POLYLINES", "SPLIT_POLYLINES_ICO" ); createAction( MergePolylinesId, "MERGE_POLYLINES", "MERGE_POLYLINES_ICO" ); @@ -238,19 +249,18 @@ void HYDROGUI_Module::createMenus() int aHydroMenu = 6; // Edit menu id == 5, View menu id == 10 int aHydroId = createMenu( tr( "MEN_DESK_HYDRO" ), -1, -1, aHydroMenu ); createMenu( ImportSinusXId, aHydroId, -1, -1 ); - createMenu( ExportSinusXId, aHydroId, -1, -1 ); - createMenu( ImportLandcoverId, aHydroId, -1, -1 ); + createMenu( ExportSinusXId, aHydroId, -1, -1 ); createMenu( ImportBathymetryId, aHydroId, -1, -1 ); createMenu( ImportStricklerTableFromFileId, aHydroId, -1, -1 ); createMenu( CreatePolyline3DId, aHydroId, -1, -1 ); createMenu( CreateImmersibleZoneId, aHydroId, -1, -1 ); createMenu( CreateChannelId, aHydroId, -1, -1 ); - createMenu( CreateDigueId, aHydroId, -1, -1 ); - createMenu( CreateLandCoverId, aHydroId, -1, -1 ); + createMenu( CreateDigueId, aHydroId, -1, -1 ); int aNewImageId = createMenu( tr( "MEN_DESK_IMAGE" ), aHydroId, -1 ); createMenu( ImportImageId, aNewImageId, -1, -1 ); + createMenu( separator(), aNewImageId ); createMenu( FuseImagesId, aNewImageId, -1, -1 ); createMenu( CutImagesId, aNewImageId, -1, -1 ); createMenu( SplitImageId, aNewImageId, -1, -1 ); @@ -258,24 +268,39 @@ void HYDROGUI_Module::createMenus() int aNewPolylineId = createMenu( tr( "MEN_DESK_POLYLINE" ), aHydroId, -1 ); createMenu( ImportPolylineId, aNewPolylineId, -1, -1 ); createMenu( CreatePolylineId, aNewPolylineId, -1, -1 ); + createMenu( separator(), aNewPolylineId ); createMenu( SplitPolylinesId, aNewPolylineId, -1, -1 ); createMenu( MergePolylinesId, aNewPolylineId, -1, -1 ); int aNewProfileId = createMenu( tr( "MEN_DESK_PROFILE" ), aHydroId, -1 ); createMenu( CreateProfileId, aNewProfileId, -1, -1 ); createMenu( ImportProfilesId, aNewProfileId, -1, -1 ); + createMenu( separator(), aNewProfileId ); createMenu( AllGeoreferencementId, aNewProfileId, -1, -1 ); int aStreamMenuId = createMenu( tr( "MEN_DESK_STREAM" ), aHydroId, -1 ); createMenu( CreateStreamId, aStreamMenuId, -1, -1 ); + createMenu( separator(), aStreamMenuId ); createMenu( RiverBottomId, aStreamMenuId, -1, -1 ); createMenu( ProfileInterpolateId, aStreamMenuId, -1, -1 ); int anObstacleMenuId = createMenu( tr( "MEN_DESK_OBSTACLE" ), aHydroId, -1 ); createMenu( ImportObstacleFromFileId, anObstacleMenuId, -1, -1 ); + createMenu( separator(), anObstacleMenuId ); createMenu( CreateBoxId, anObstacleMenuId, -1, -1 ); createMenu( CreateCylinderId, anObstacleMenuId, -1, -1 ); + int aLandCoverMapMenuId = createMenu( tr( "MEN_DESK_LAND_COVER_MAP" ), aHydroId, -1 ); + createMenu( ImportLandCoverMapId, aLandCoverMapMenuId, -1, -1 ); + createMenu( CreateLandCoverMapId, aLandCoverMapMenuId, -1, -1 ); + createMenu( separator(), aLandCoverMapMenuId ); + createMenu( AddLandCoverId, aLandCoverMapMenuId, -1, -1 ); + createMenu( RemoveLandCoverId, aLandCoverMapMenuId, -1, -1 ); + 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 ); createMenu( EditLocalCSId, aHydroId, -1, -1 ); @@ -297,7 +322,7 @@ void HYDROGUI_Module::createToolbars() createTool( ImportPolylineId, aToolBar ); createTool( ImportSinusXId, aToolBar ); createTool( ExportSinusXId, aToolBar ); - createTool( ImportLandcoverId, aToolBar ); + createTool( ImportLandCoverMapId, aToolBar ); createTool( ImportBathymetryId, aToolBar ); createTool( CreatePolylineId, aToolBar ); @@ -325,7 +350,13 @@ void HYDROGUI_Module::createToolbars() createTool( ImportStricklerTableFromFileId, aToolBar ); createTool( separator(), aToolBar ); - createTool( CreateLandCoverId, aToolBar ); + createTool( CreateLandCoverMapId, aToolBar ); + createTool( AddLandCoverId, aToolBar ); + createTool( RemoveLandCoverId, aToolBar ); + createTool( SplitLandCoverId, aToolBar ); + createTool( MergeLandCoverId, aToolBar ); + createTool( ChangeLandCoverTypeId, aToolBar ); + enableLCMActions(); createTool( separator(), aToolBar ); createTool( CreateCalculationId, aToolBar ); @@ -377,6 +408,24 @@ void HYDROGUI_Module::updateUndoRedoControls() aRedoAction->setEnabled( aCanRedo ); } +void HYDROGUI_Module::enableLCMActions() +{ + HYDROData_Iterator anIt( HYDROData_Document::Document( getStudyId() ), KIND_LAND_COVER_MAP ); + bool anEnableTools = anIt.More(); + + QtxListAction* anAction; + anAction = (QtxListAction*)action( AddLandCoverId ); + if ( anAction ) anAction->setEnabled( anEnableTools ); + anAction = (QtxListAction*)action( RemoveLandCoverId ); + if ( anAction ) anAction->setEnabled( anEnableTools ); + anAction = (QtxListAction*)action( SplitLandCoverId ); + if ( anAction ) anAction->setEnabled( anEnableTools ); + anAction = (QtxListAction*)action( MergeLandCoverId ); + if ( anAction ) anAction->setEnabled( anEnableTools ); + anAction = (QtxListAction*)action( ChangeLandCoverTypeId ); + if ( anAction ) anAction->setEnabled( anEnableTools ); +} + void HYDROGUI_Module::onOperation() { const QAction* anAction = dynamic_cast( sender() ); @@ -479,8 +528,8 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const case ExportToShapeFileID: anOp = new HYDROGUI_ExportFileOp( aModule ); break; - case ImportLandcoverId: - anOp = new HYDROGUI_ImportLandCoverOp( aModule ); + case ImportLandCoverMapId: + anOp = new HYDROGUI_ImportLandCoverMapOp( aModule ); break; case RemoveImageRefsId: anOp = new HYDROGUI_RemoveImageRefsOp( aModule ); @@ -537,9 +586,13 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const case EditStricklerTableId: anOp = new HYDROGUI_StricklerTableOp( aModule, theId ); break; - case CreateLandCoverId: - case EditLandCoverId: - anOp = new HYDROGUI_LandCoverOp( aModule, theId == EditLandCoverId ); + case CreateLandCoverMapId: + case AddLandCoverId: + case RemoveLandCoverId: + case SplitLandCoverId: + case MergeLandCoverId: + case ChangeLandCoverTypeId: + anOp = new HYDROGUI_LandCoverMapOp( aModule, theId ); break; case DuplicateStricklerTableId: anOp = new HYDROGUI_DuplicateOp( aModule ); @@ -560,8 +613,8 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const anOp = new HYDROGUI_TwoImagesOp( aModule, HYDROGUI_TwoImagesOp::Cut, theId == EditCutImageId ); break; case SplitImageId: - case EditSplittedImageId: - anOp = new HYDROGUI_TwoImagesOp( aModule, HYDROGUI_TwoImagesOp::Split, theId == EditSplittedImageId ); + case EditSplitImageId: + anOp = new HYDROGUI_TwoImagesOp( aModule, HYDROGUI_TwoImagesOp::Split, theId == EditSplitImageId ); break; case ImportObstacleFromFileId: anOp = new HYDROGUI_ImportObstacleFromFileOp( aModule ); @@ -592,6 +645,9 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const case SetColorId: anOp = new HYDROGUI_SetColorOp( aModule ); break; + case SetTransparencyId: + anOp = new HYDROGUI_SetTransparencyOp( aModule ); + break; case SetZLevelId: anOp = new HYDROGUI_ZLevelsOp( aModule ); break; @@ -615,6 +671,9 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const case SubmersibleId: anOp = new HYDROGUI_SubmersibleOp( aModule ); break; + case PolylineExtractionId: + anOp = new HYDROGUI_PolylineExtractionOp( aModule ); + break; case SplitPolylinesId: anOp = new HYDROGUI_SplitPolylinesOp( aModule ); break;