X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_Operations.cxx;h=8371e64d1dbe85ea64a6e5e8dee481e4aaab7d7a;hb=dbee981213585cb317e098b0d2a288761cd3d37b;hp=b3c604ab3acfb94d16cf0902b8f3172d7ac4464c;hpb=3a5d19ec64b7a2398b5bdc37390173dadbcdb809;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_Operations.cxx b/src/HYDROGUI/HYDROGUI_Operations.cxx index b3c604ab..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" @@ -68,12 +68,14 @@ #include "HYDROGUI_MergePolylinesOp.h" #include "HYDROGUI_SplitPolylinesOp.h" #include "HYDROGUI_LandCoverColoringOp.h" -// TODO -//#include "HYDROGUI_ImportLandCoverMapOp.h" +#include "HYDROGUI_SetTransparencyOp.h" + +#include "HYDROGUI_ImportLandCoverMapOp.h" #include #include #include +#include #include #include @@ -195,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" ); @@ -205,6 +207,7 @@ void HYDROGUI_Module::createActions() SLOT( onDelete() ) ); createAction( SetColorId, "COLOR" ); + createAction( SetTransparencyId, "TRANSPARENCY" ); createAction( SetZLevelId, "ZLEVEL" ); createAction( EditLocalCSId, "EDIT_LOCAL_CS" ); @@ -353,6 +356,7 @@ void HYDROGUI_Module::createToolbars() createTool( SplitLandCoverId, aToolBar ); createTool( MergeLandCoverId, aToolBar ); createTool( ChangeLandCoverTypeId, aToolBar ); + enableLCMActions(); createTool( separator(), aToolBar ); createTool( CreateCalculationId, aToolBar ); @@ -404,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() ); @@ -507,8 +529,7 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const anOp = new HYDROGUI_ExportFileOp( aModule ); break; case ImportLandCoverMapId: - // TODO - //anOp = new HYDROGUI_ImportLandCoverMapOp( aModule ); + anOp = new HYDROGUI_ImportLandCoverMapOp( aModule ); break; case RemoveImageRefsId: anOp = new HYDROGUI_RemoveImageRefsOp( aModule ); @@ -570,8 +591,6 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const case RemoveLandCoverId: case SplitLandCoverId: case MergeLandCoverId: - anOp = new HYDROGUI_LandCoverMapOp( aModule, theId ); - break; case ChangeLandCoverTypeId: anOp = new HYDROGUI_LandCoverMapOp( aModule, theId ); break; @@ -594,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 ); @@ -626,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;