#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"
#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 <HYDROData_Document.h>
#include <HYDROData_Obstacle.h>
#include <HYDROData_SplitToZonesTool.h>
+#include <HYDROData_Iterator.h>
#include <GeometryGUI.h>
#include <GeometryGUI_Operations.h>
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" );
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" );
SLOT( onDelete() ) );
createAction( SetColorId, "COLOR" );
+ createAction( SetTransparencyId, "TRANSPARENCY" );
createAction( SetZLevelId, "ZLEVEL" );
createAction( EditLocalCSId, "EDIT_LOCAL_CS" );
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 );
createTool( RemoveLandCoverId, aToolBar );
createTool( SplitLandCoverId, aToolBar );
createTool( MergeLandCoverId, aToolBar );
+ createTool( ChangeLandCoverTypeId, aToolBar );
+ enableLCMActions();
createTool( separator(), aToolBar );
createTool( CreateCalculationId, aToolBar );
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<const QAction*>( sender() );
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 );
case RemoveLandCoverId:
case SplitLandCoverId:
case MergeLandCoverId:
+ case ChangeLandCoverTypeId:
anOp = new HYDROGUI_LandCoverMapOp( aModule, theId );
break;
case DuplicateStricklerTableId:
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 );
case SetColorId:
anOp = new HYDROGUI_SetColorOp( aModule );
break;
+ case SetTransparencyId:
+ anOp = new HYDROGUI_SetTransparencyOp( aModule );
+ break;
case SetZLevelId:
anOp = new HYDROGUI_ZLevelsOp( aModule );
break;