]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Merge remote-tracking branch 'origin/BR_LAND_COVER' into BR_v14_rc
authorasl <asl@opencascade.com>
Fri, 26 Jun 2015 08:09:44 +0000 (11:09 +0300)
committerasl <asl@opencascade.com>
Fri, 26 Jun 2015 08:09:44 +0000 (11:09 +0300)
Conflicts:
src/HYDROData/HYDROData_StricklerTable.cxx
src/HYDROData/HYDROData_StricklerTable.h
src/HYDROGUI/CMakeLists.txt
src/HYDROGUI/HYDROGUI_DataModel.cxx
src/HYDROGUI/HYDROGUI_DataModel.h
src/HYDROGUI/HYDROGUI_Module.h
src/HYDROGUI/HYDROGUI_Operations.cxx
src/HYDROGUI/HYDROGUI_Operations.h

283 files changed:
doc/salome/gui/HYDRO/bathymetry.h [new file with mode: 0644]
doc/salome/gui/HYDRO/box_obstacle.h [new file with mode: 0644]
doc/salome/gui/HYDRO/calculation_case.h [new file with mode: 0644]
doc/salome/gui/HYDRO/change_layer_order.h [new file with mode: 0644]
doc/salome/gui/HYDRO/channel.h [new file with mode: 0644]
doc/salome/gui/HYDRO/color.h [new file with mode: 0644]
doc/salome/gui/HYDRO/copy_paste.h [new file with mode: 0644]
doc/salome/gui/HYDRO/copy_position.h [new file with mode: 0644]
doc/salome/gui/HYDRO/create_profile.h [new file with mode: 0644]
doc/salome/gui/HYDRO/cut_images.h [new file with mode: 0644]
doc/salome/gui/HYDRO/cylinder_obstacle.h [new file with mode: 0644]
doc/salome/gui/HYDRO/delete.h [new file with mode: 0644]
doc/salome/gui/HYDRO/digue.h [new file with mode: 0644]
doc/salome/gui/HYDRO/dump_study.h [new file with mode: 0644]
doc/salome/gui/HYDRO/export_polyline.h [new file with mode: 0644]
doc/salome/gui/HYDRO/export_strickler_table.h [new file with mode: 0644]
doc/salome/gui/HYDRO/find_bottom.h [new file with mode: 0644]
doc/salome/gui/HYDRO/fuse_images.h [new file with mode: 0644]
doc/salome/gui/HYDRO/general_services.h [new file with mode: 0644]
doc/salome/gui/HYDRO/georeferencement_profile.h [new file with mode: 0644]
doc/salome/gui/HYDRO/image.h [new file with mode: 0644]
doc/salome/gui/HYDRO/images/add_element_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/addition_mode_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/bathymetry_example.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/box_dialog.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/box_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/box_input_panel_create.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/box_presentation.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/box_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/change_layer_order_dialog_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/channel_empty.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/channel_icon.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/channel_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/channel_presentation.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/channel_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/close_active_study_warning.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/color_example.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/create_immersible_zone_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/create_immersible_zone_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/create_polyline_3d_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/create_polyline_3d_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/create_polyline_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/create_polyline_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/create_profile_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/create_profile_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/create_stream_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/create_stream_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/cut_images_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/cut_images_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/cylinder_dialog.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/cylinder_presentation.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/cylinder_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/delete_objects_dialog_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/delete_objects_warning.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/digue_empty.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/digue_icon.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/digue_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/digue_presentation.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/digue_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/dump_study_dialog_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/edit_element_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/example_change_layer_order_after.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/example_change_layer_order_before.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/export_polyline_dialog_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/export_strickler_table_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/eye_icons.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/find_bottom_example.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/find_bottom_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/fuse_images_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/fuse_images_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/geographic_coordinates.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/georeferencement_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/georeferencemented_profiles.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/immersible_zone_example.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_bathymetry_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_bathymetry_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_image_enabled.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_image_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_obstacle_create_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_obstacle_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_obstacle_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_polyline_dialog_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_polyline_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_profile_dialog_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_profile_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_strickler_table_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/import_strickler_table_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/imported_profiles.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/impot_image_dialog.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/insert_new_section_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/join_selected_sections_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/lambert_coordinates.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/load_python_script_dialog_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/local_cs_transformation_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/modif_mode_table.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/modification_mode_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/move_item_down_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/move_item_on_bottom_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/move_item_on_top_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/move_item_up_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/not_updated_stream.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/obstacle_presentation.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/open_document_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/open_file_dialog.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/open_file_dialog_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/open_file_icon.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/polyline_3d_example.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/preferences.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/preferences_import.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/preferences_type.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/prof_modif_mode_table.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/profile_addition_points.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/profile_edit.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/profile_interpolation_preview.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/profiles_georeferencement_all.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/profiles_georeferencement_selected.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/profiles_interpolation_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/python_console.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/redo_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/redo_combo_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/redo_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/reference_image.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/remove_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/reopen_file_dialog_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/save_document_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/save_file_dialog_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/save_file_warning.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/select_color.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/set_color_dialog_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/split_image_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/split_image_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/stream_2d_example.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/stream_3d_example.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/submersible.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/translate_obstacle_example.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/translate_obstacle_input_panel.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/undo_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/undo_combo_box.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/undo_toolbar_button.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/updated_stream.png [new file with mode: 0644]
doc/salome/gui/HYDRO/images/warning_dump.png [new file with mode: 0644]
doc/salome/gui/HYDRO/immersible_zone.h
doc/salome/gui/HYDRO/import_image.h [new file with mode: 0644]
doc/salome/gui/HYDRO/import_obstacle.h [new file with mode: 0644]
doc/salome/gui/HYDRO/import_obstacle_GEOM.h [new file with mode: 0644]
doc/salome/gui/HYDRO/import_polyline.h [new file with mode: 0644]
doc/salome/gui/HYDRO/import_profile.h [new file with mode: 0644]
doc/salome/gui/HYDRO/import_strickler_table.h [new file with mode: 0644]
doc/salome/gui/HYDRO/land_cover.h [new file with mode: 0644]
doc/salome/gui/HYDRO/load_script.h [new file with mode: 0644]
doc/salome/gui/HYDRO/local_cs.h [new file with mode: 0644]
doc/salome/gui/HYDRO/mainpage.h
doc/salome/gui/HYDRO/obstacle.h [new file with mode: 0644]
doc/salome/gui/HYDRO/open_file.h [new file with mode: 0644]
doc/salome/gui/HYDRO/polyline.h [new file with mode: 0644]
doc/salome/gui/HYDRO/polyline3d.h [new file with mode: 0644]
doc/salome/gui/HYDRO/preferences.h [new file with mode: 0644]
doc/salome/gui/HYDRO/profile.h [new file with mode: 0644]
doc/salome/gui/HYDRO/profile_interpolation.h [new file with mode: 0644]
doc/salome/gui/HYDRO/rename.h [new file with mode: 0644]
doc/salome/gui/HYDRO/save_file.h [new file with mode: 0644]
doc/salome/gui/HYDRO/show_hide.h [new file with mode: 0644]
doc/salome/gui/HYDRO/split_image.h [new file with mode: 0644]
doc/salome/gui/HYDRO/stream.h [new file with mode: 0644]
doc/salome/gui/HYDRO/strickler_table.h [new file with mode: 0644]
doc/salome/gui/HYDRO/submersible.h [new file with mode: 0644]
doc/salome/gui/HYDRO/translate_obstacle.h [new file with mode: 0644]
doc/salome/gui/HYDRO/undo_redo.h [new file with mode: 0644]
doc/salome/gui/HYDRO/update.h [new file with mode: 0644]
src/HYDROData/CMakeLists.txt
src/HYDROData/HYDROData_BSplineOperation.cxx
src/HYDROData/HYDROData_BSplineOperation.h
src/HYDROData/HYDROData_CalculationCase.cxx
src/HYDROData/HYDROData_CalculationCase.h
src/HYDROData/HYDROData_Document.h
src/HYDROData/HYDROData_GeomTool.cxx
src/HYDROData/HYDROData_GeomTool.h
src/HYDROData/HYDROData_IPolyline.h
src/HYDROData/HYDROData_LandCover.cxx
src/HYDROData/HYDROData_LandCover.h
src/HYDROData/HYDROData_Object.h
src/HYDROData/HYDROData_PolylineOperator.cxx [new file with mode: 0644]
src/HYDROData/HYDROData_PolylineOperator.h [new file with mode: 0644]
src/HYDROData/HYDROData_PolylineXY.cxx
src/HYDROData/HYDROData_PolylineXY.h
src/HYDROData/HYDROData_ProfileUZ.cxx
src/HYDROData/HYDROData_ProfileUZ.h
src/HYDROData/HYDROData_Region.cxx
src/HYDROData/HYDROData_SinusX.cxx [new file with mode: 0644]
src/HYDROData/HYDROData_SinusX.h [new file with mode: 0644]
src/HYDROData/HYDROData_Stream.cxx
src/HYDROData/HYDROData_StricklerTable.cxx
src/HYDROData/HYDROData_StricklerTable.h
src/HYDROData/shapelib/shapefil.h
src/HYDROData/test_HYDROData_BSplineOperation.cxx
src/HYDROGUI/CMakeLists.txt
src/HYDROGUI/HYDROGUI_CalculationDlg.cxx
src/HYDROGUI/HYDROGUI_CalculationDlg.h
src/HYDROGUI/HYDROGUI_CalculationOp.cxx
src/HYDROGUI/HYDROGUI_CalculationOp.h
src/HYDROGUI/HYDROGUI_DataBrowser.cxx
src/HYDROGUI/HYDROGUI_DataModel.cxx
src/HYDROGUI/HYDROGUI_DataModel.h
src/HYDROGUI/HYDROGUI_DataObject.h
src/HYDROGUI/HYDROGUI_DataOwner.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_DataOwner.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_DeleteOp.cxx
src/HYDROGUI/HYDROGUI_ExportCalculationOp.cxx
src/HYDROGUI/HYDROGUI_ExportFileOp.cxx
src/HYDROGUI/HYDROGUI_ExportFileOp.h
src/HYDROGUI/HYDROGUI_ExportSinusXDlg.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ExportSinusXDlg.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ExportSinusXOp.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ExportSinusXOp.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ImportLandCoverOp.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ImportPolylineOp.cxx
src/HYDROGUI/HYDROGUI_ImportPolylineOp.h
src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ImportSinusXOp.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_LandCoverColoringOp.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_LandCoverColoringOp.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_LandCoverDlg.cxx
src/HYDROGUI/HYDROGUI_LandCoverDlg.h
src/HYDROGUI/HYDROGUI_LandCoverOp.cxx
src/HYDROGUI/HYDROGUI_MergePolylinesDlg.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_MergePolylinesDlg.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_MergePolylinesOp.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_MergePolylinesOp.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_Module.cxx
src/HYDROGUI/HYDROGUI_Module.h
src/HYDROGUI/HYDROGUI_OCCDisplayer.cxx
src/HYDROGUI/HYDROGUI_OCCDisplayer.h
src/HYDROGUI/HYDROGUI_OCCSelector.cxx
src/HYDROGUI/HYDROGUI_ObjComboBox.cxx
src/HYDROGUI/HYDROGUI_ObjComboBox.h
src/HYDROGUI/HYDROGUI_ObjListBox.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ObjListBox.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_Operations.cxx
src/HYDROGUI/HYDROGUI_Operations.h
src/HYDROGUI/HYDROGUI_OrderedListWidget.cxx
src/HYDROGUI/HYDROGUI_PriorityTableModel.cxx
src/HYDROGUI/HYDROGUI_PriorityTableModel.h
src/HYDROGUI/HYDROGUI_PriorityWidget.cxx
src/HYDROGUI/HYDROGUI_PriorityWidget.h
src/HYDROGUI/HYDROGUI_ProfileInterpolateDlg.cxx
src/HYDROGUI/HYDROGUI_RecognizeContoursDlg.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_RecognizeContoursDlg.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_RecognizeContoursOp.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_RiverBottomDlg.cxx
src/HYDROGUI/HYDROGUI_SetColorOp.cxx
src/HYDROGUI/HYDROGUI_SetColorOp.h
src/HYDROGUI/HYDROGUI_Shape.cxx
src/HYDROGUI/HYDROGUI_ShapeLandCover.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ShapeLandCover.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_ShowHideOp.cxx
src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_SplitPolylinesOp.h [new file with mode: 0644]
src/HYDROGUI/HYDROGUI_StreamDlg.cxx
src/HYDROGUI/HYDROGUI_StreamDlg.h
src/HYDROGUI/HYDROGUI_StreamOp.cxx
src/HYDROGUI/HYDROGUI_StricklerTableOp.cxx
src/HYDROGUI/HYDROGUI_Tool.cxx
src/HYDROGUI/HYDROGUI_Tool.h
src/HYDROGUI/HYDROGUI_VTKPrsShape.cxx
src/HYDROGUI/HYDROGUI_ZLayers.cxx
src/HYDROGUI/HYDROGUI_ZLayers2.cxx
src/HYDROGUI/HYDROGUI_Zone.cxx
src/HYDROGUI/resources/HYDROGUI_images.ts
src/HYDROGUI/resources/HYDROGUI_msg_en.ts
src/HYDROGUI/resources/icon_export_polyline.png [deleted file]
src/HYDROGUI/resources/icon_export_shp.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_export_sx.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_import_polygon.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_import_sx.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_mland_cover.png [new file with mode: 0644]
src/HYDROGUI/resources/icon_recognize_contours.png [new file with mode: 0644]
src/HYDROPy/HYDROData_CalculationCase.sip

diff --git a/doc/salome/gui/HYDRO/bathymetry.h b/doc/salome/gui/HYDRO/bathymetry.h
new file mode 100644 (file)
index 0000000..626b395
--- /dev/null
@@ -0,0 +1,37 @@
+
+/**
+  @file
+  \brief Help for the bathymetry
+*/
+
+/**
+  \page bathymetry Bathymetry
+
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  Bathymetry is an altitude object. It associates an altitude value to each point on the 2D plane.
+  
+  <b>Import bathymetry</b> input panel can be opened via:<ol>
+  <li> The main menu <b>HYDRO => Import bathymetry</b>;
+  <li> Context menu of <b>BATHYMETRIES</b> in Object browser => <b>Import bathymetry</b>;
+  <li> <b>CTRL + B</b> buttons combination;
+  <li> <b>Import bathymetry</b> toolar button.\image html import_bathymetry_toolbar_button.png "Import bathymetry toolbar button"
+  </ol> 
+   
+  Arguments of the input panel: 
+
+  \image html import_bathymetry_input_panel.png "Import bathymetry input panel"
+
+<b>File name</b> - field to select file to import. Supported format: <b>.XYZ</b>(Bathymetry files);<br>  
+<b>Name</b> - field to define bathymetry object name;<br>
+<b>Invert altitude object</b> -  if this checkbox is ON, Z-coordinates of imported bathymetry become inverted. If checkbox is OFF, file is imported without modification.<br>
+<b>Apply</b> - button to create bathymetry object;<br>
+<b>Apply and Close</b> - button to create bathymetry object and close input panel;<br>
+<b>Close</b> - button to close input panel.
+
+<b>Example</b>:<br>
+  
+\image html bathymetry_example.png "Bathymetry zone example"
+
+<a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/box_obstacle.h b/doc/salome/gui/HYDRO/box_obstacle.h
new file mode 100644 (file)
index 0000000..0b19263
--- /dev/null
@@ -0,0 +1,44 @@
+
+/**
+  @file
+  \brief Help for the box obstacle
+*/
+
+/**
+  \page box_obstacle Box obstacle
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+
+  In the HYDROGUI module box obstacle is a geometrical primitive Box. 
+  
+
+  The obstacle can be created via:<ol>
+<li>The main menu <b> HYDRO => Obstacle => Create  box</b>;</li>
+<li>Context menu of OBSTACLES in Object browser - <b>Create box</b>;</li>
+<li><b>Create box obstacle</b> toolbar button </li>
+ </ol> 
+
+\image html box_toolbar_button.png "Create box obstacle toolbar button"
+
+ <b>Box construction</b> dialog box from Geometry module appears
+ \image html box_dialog.png "Box construction dialog box"
+
+User sets necesssary arguments and clicks <b>Apply and Close</b> button.
+
+<b>Box construction</b> dialog box is closed and a new geometrical object box appears in the Geometry module with defined by user name and dimensions.
+
+Help for this dialog is located in Salome Geometry User's guide => Creating geometrical objects => Creating primitives => Box.
+
+ <b>Import GEOM object as obstacle</b> input panel appears.
+
+
+  - \ref import_obstacle_GEOM  "Import GEOM object as obstacle"
+  
+   The box obstacle is presented as the face and 3D object.
+   \image html box_presentation.png  "Box obstacle example" 
+  
+ <a href="index.html"><b>Back to Main page.</b></a>
+
+*/
diff --git a/doc/salome/gui/HYDRO/calculation_case.h b/doc/salome/gui/HYDRO/calculation_case.h
new file mode 100644 (file)
index 0000000..b05b4ad
--- /dev/null
@@ -0,0 +1,13 @@
+/**
+  @file
+  \brief Help for the calculation case
+*/
+
+/**
+  \page calculation_case Calculation case
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/change_layer_order.h b/doc/salome/gui/HYDRO/change_layer_order.h
new file mode 100644 (file)
index 0000000..01642f9
--- /dev/null
@@ -0,0 +1,43 @@
+
+/**
+  @file
+  \brief Help for the change layer order
+*/
+
+/**
+  \page change_layer_order Change layer order
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+
+  The HYDROGUI module allows the user to define priority of visibility 2d objects.<br>
+  This feature is executed with help of <b>Change layer order</b> dialog box, which can be called via according command in context menu, called in OCC viewer.<br>
+
+<b>Change layer order</b> dialog box looks like: 
+
+  \image html change_layer_order_dialog_box.png "Change layer order dialog box"
+  
+   Only shown objects are presented in the dialog box.<br>
+   
+   Controls of the dialog box: <br>  
+   
+   <b>Move the item(s) on top</b> - button to move selected in the list objects on top, i.e. set for them the highest visibility priority;<br>
+   \image html move_item_on_top_button.png "Move the item(s) on top button"
+   <b>Move the item(s) up</b> - button to move selected in the list objects up, i.e. increase visibility priority on one point;<br>
+   \image html move_item_up_button.png "Move the item(s) up button"
+   <b>Move the item(s) down</b> - button to move selected in the list objects down, i.e. decrease visibility priority on one point;<br>
+   \image html move_item_down_button.png "Move the item(s) down button"
+   <b>Move the item(s) on bottom</b> - button to move selected in the list objects on bottom, i.e. set for them least visibility priority;<br>
+   \image html move_item_on_bottom_button.png "Move the item(s) on bottom button"
+   <b>All objects</b> - check-box to show all objects(even hidden) in the list;<br>
+   <b>Apply</b> - button to apply modifications done;<br>
+   <b>Apply and Close</b> - button to apply modifications done and close dialog box;<br>
+   <b>Close</b> - button to close dialog box.
+   
+   Example:
+   \image html example_change_layer_order_before.png "Before changing layer order"
+   
+   \image html example_change_layer_order_after.png "After changing layer order"
+   
+<a href="index.html"><b>Back to Main page.</b></a>
+
+*/
diff --git a/doc/salome/gui/HYDRO/channel.h b/doc/salome/gui/HYDRO/channel.h
new file mode 100644 (file)
index 0000000..df4c9ce
--- /dev/null
@@ -0,0 +1,55 @@
+
+/**
+  @file
+  \brief Help for the channel
+*/
+
+/**
+  \page art_channel Channel
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+
+  The <b>channel</b> is an artificial object.
+
+  In the HYDROGUI module channel is created  using the extrusion operation of profile along the provided path (guide line). 
+
+  The channel 3d shape is shell. 
+
+  Each profile vertex is extruded into channel edge. 
+  
+  Each profile edge is extruded into channel face. 
+
+  All sections of channel should be perpendicular to the extrusion path (guide line), they are NOT parallel to the initial profile plane.  
+
+  Note, that sharp corners in the extrusion path (guide line) can lead to selfinteresctions in the resulting shell.
+
+
+  The channel can be created via:<ol>
+
+<li>The main menu <b> HYDRO => Create  channel</b>;
+<li>Context menu of Artificial objects in Object browser - <b>Create  channel</b>;
+<li><b>Create  channel</b> toolbar button 
+ </ol> 
+
+\image html  channel_toolbar_button.png "Channel construction toolbar button" 
+
+  Channel input panel appears.
+
+  \image html  channel_input_panel.png " Channel input panel"
+
+ Arguments of the input panel: 
+<b>Name</b> - field to define the channel name;<br>
+<b>Guide line</b> - combo - box to select the polyline 3D defining the channel guide line;<br>
+<b>Profile</b> - combo - box to select the profile object describing channel cross-section.
+<b>Apply</b> - button to generate digue;<br>
+<b>Apply and Close</b> - button to generate digue and close input panel;<br>
+<b>Close</b> - button to close input panel.  
+
+
+   The channel is presented as the face and 3D object.
+   \image html channel_presentation.png  "channel example" 
+  
+ <a href="index.html"><b>Back to Main page.</b></a>
+
+*/
diff --git a/doc/salome/gui/HYDRO/color.h b/doc/salome/gui/HYDRO/color.h
new file mode 100644 (file)
index 0000000..fc3e0fb
--- /dev/null
@@ -0,0 +1,43 @@
+
+/**
+  @file
+  \brief Help for the color object
+*/
+
+/**
+  \page color Color object(s)
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  The HYDROGUI module supports changing object's color. This operation is available for all objects except images, bathymetries and strickler tables.<br>
+  
+  To change color of the object, it's necessary to select it  and call <b>Color</b> command from context menu.<br>
+  
+  <b>Set color</b> dialog box looks like:
+  
+  \image html set_color_dialog_box.png "Set color dialog box"
+  
+  Controls inside the dialog:
+  
+  <b>Transparent</b> - radio button to make object transparent;<br>
+  <b>Color</b> - radio button to color the object with selected color;<br>
+  <b>Border</b> - check-box to define any color for object's border;<br>
+  <b>OK</b> - button to apply modifications;<br>
+  <b>Cancel</b> - button to reject color changing.<br>
+  
+  To change color it's necessary to check <b>Color</b> radio button and double click on the colored field near it.<br>
+  
+  To change border color it's necessary to check <b>Border</b> check box and double click on the colored field near it.<br>
+  
+  Appearing <b>Select color</b> dialog box looks like:
+  
+  \image html select_color.png "Select color dialog box"
+  
+  Example:
+  
+  \image html color_example.png "Color example"
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  
+*/
diff --git a/doc/salome/gui/HYDRO/copy_paste.h b/doc/salome/gui/HYDRO/copy_paste.h
new file mode 100644 (file)
index 0000000..fd57224
--- /dev/null
@@ -0,0 +1,29 @@
+
+/**
+  @file
+  \brief Help for the copy/paste
+*/
+
+/**
+  \page copy_paste Copy/Paste object(s)
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+   It is possible to copy and paste objects in HYDROGUI module.
+   
+    To <b>copy</b> any object it's necessary to select it and use one of the following ways:<ol>
+       <li>The main menu <b>Edit => Copy</b>;</li>
+       <li><b>CTRL + C</b> buttons combination; </li>
+       <li>Call context menu of object(s) and <b>Copy</b> command</li>
+    </ol>      
+       
+       When objects have been copied, they can be pasted into the study. To <b>paste</b> them  use one of the following ways:<ol>
+   <li>The main menu <b>Edit => Paste</b>;</li>
+   <li><b>CTRL + V</b> buttons combination; </li>
+  </ol>
+  
+  <b>Paste</b> operation creates new objects, identical to copied and adds them to according branch: <b>polyline</b> - in <b>POLYLINES</b> branch,  <b>stream</b> - in <b>NATURAL OBJECTS</b> branch, etc.
+   
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+*/
diff --git a/doc/salome/gui/HYDRO/copy_position.h b/doc/salome/gui/HYDRO/copy_position.h
new file mode 100644 (file)
index 0000000..89d10fa
--- /dev/null
@@ -0,0 +1,18 @@
+
+/**
+  @file
+  \brief Help for the copy_position
+*/
+
+/**
+  \page copy_position Copy position 
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  It is possible to copy local coordinates of any position in OCC view.<br>
+  
+  For this it is necessary to put the mouse on interesting position in OCC view, call context menu and select <b>Copy position</b> command.<br>
+  
+  Local coordinates become remembered and ready for pasting. 
+  
+*/
diff --git a/doc/salome/gui/HYDRO/create_profile.h b/doc/salome/gui/HYDRO/create_profile.h
new file mode 100644 (file)
index 0000000..77b54d4
--- /dev/null
@@ -0,0 +1,95 @@
+
+/**
+  @file
+  \brief Help for profile
+*/
+
+/**
+  \page create_profile  "Create/Edit profile"
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+  
+   The profile can be created via:<ol>
+  <li> The main menu <b>HYDRO => Profile => Create profile</b>;
+  <li> Context menu of <b>PROFILES</b> in Object browser => <b>Create profile</b>;
+  <li> <b>Create profile</b> toolbar button.
+  </ol> 
+  
+\image html create_profile_toolbar_button.png "Create profile toolbar button"
+
+ The profile can be edited via Context menu of existing profile in Object browser => <b>Edit profile</b>.
+
+
+<b>Create/Edit profile</b> input panel appears.
+  
+
+  \image html create_profile_input_panel.png "Create profile input panel"
+
+  \image html profile_edit.png "Edit profile input panel"
+
+Arguments of the input panel:
+  
+  <b>Name</b> - field to define the profile name;<br>
+  <b>Apply</b> - button to create profile;<br>
+  <b>Apply and Close</b> - button to create profile and close input panel;<br>
+  <b>Close</b> - button to close input panel.<br>
+
+
+  The profile contains only one open section. Double click on section activates <b>Edit element</b> panel.
+   
+  \image html edit_element_panel.png "Edit element panel"
+  
+  <b>Name</b> - field to define the section name. This name is not saved into data model and is lost after closing input panel. Note, that figure in the end of name indicates number of points in section as shown in figure Edit profile input panel;<br>
+  <b>Type</b> - combo-box to define type of section: <b>Polyline</b> or <b>Spline</b>;<br>
+  <b>OK</b> - button to validate changes in section and close <b>Edit element</b> panel;<br>
+  <b>Cancel</b> - button to cancel changes in section and close <b>Edit element</b> panel.<br>
+
+  Section  curve is defined by a list of points through which it passes. 
+   
+  2 modes are available for work with points:<ol>
+
+  <li><b>Addition mode</b></li><br>
+  In this mode only point’s creation is available. Can be activated by <b>Addition mode</b> button clicking.<br/> \image html addition_mode_button.png "Addition mode toolbar button"
+  Each time when user clicks left mouse button in the input panel built-in viewer a new point is created in a 2D space (U, Z). The point is added always between neighbor points according to coordinate U.
+
+ \image html profile_addition_points.png "Profile built-in viewer"
+  
+  <li><b>Modification mode</b></li><br>
+  In this mode the user can edit points of the profile curve. Can be activated by <b>Modification mode</b> button clicking.<br/>\image html modification_mode_button.png "Modification mode toolbar button"
+       <ul>
+       <li>When user selects a point (or several points) in viewer, its (their) coordinates are shown in the the table of input panel. 
+
+The user can change coordinates directly using table cell widgets;</li>
+       
+       \image html prof_modif_mode_table.png "Table with coordinates"
+
+  <li>When user clicks on existing segment, a new point should be added inside this segment with coordinates corresponding to mouse position; </li>
+       <li>When user selects one or several points in viewer, he can activate the “drag-n-drop” mode (holding the mouse left button) to move all selected points inside the plane U, Z;</li>
+       <li>The rectangular and additive (holding Ctrl button) selections should be available for points;</li>
+       <li>User can remove points selecting one or several points and pressing “Delete” on keyboard or calling the popup menu and clicking on operation “Delete”  or clicking  <b>Remove</b> button.</li>
+  \image html remove_button.png "Remove toolbar button"
+       </ul>
+  
+  </ol>
+  
+  Other operations are available during creation/edition of profile:<ul>
+  <li><b>Undo</b></li><br>
+  Undoes last action.
+  \image html undo_button.png "Undo toolbar button"
+  <li><b>Redo</b></li><br>
+  Redoes last undoing.
+  \image html redo_button.png "Redo toolbar button"
+  <li><b>Clear all</b></li><br>
+  Can be called only if modification mode is activated from section context menu.<br> 
+ Remove all points.
+  <li><b>Set polyline</b></li><br>
+  Can be called only if modification mode is activated from section context menu.<br>
+  Modifies selected section into polyline. 
+  <li><b>Set spline</b></li><br>
+  Can be called only if modification mode is activated from section context menu.<br>
+  Modifies selected section into spline.  
+  </ul>
+ <a href="index.html"><b>Back to Main page.</b></a> 
+*/
diff --git a/doc/salome/gui/HYDRO/cut_images.h b/doc/salome/gui/HYDRO/cut_images.h
new file mode 100644 (file)
index 0000000..1ea0807
--- /dev/null
@@ -0,0 +1,34 @@
+
+/**
+  @file
+  \brief Help for the cut images
+*/
+
+/**
+  \page cutimages Cut images
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+
+The user can start <b>Cut images</b> operation via:<ol>
+<li>The main menu <b>HYDRO - Cut images</b>;
+<li>Context menu of any image in Object browser - <b>Cut images</b>;
+<li><b>Cut images</b> toolbar button.\image html cut_images_toolbar_button.png "Cut images toolbar button" 
+</ol>   
+  Arguments of the input panel: 
+
+  \image html cut_images_input_panel.png "Cut images input panel(TO BE UPDATED)"
+  
+<b>Name</b> - field for defining the name of image after cut;<br>
+<b>Image 1</b> - field for defining the image which will be cut;<br>
+<b>Image 2</b> - field for defining the image which will cut;<br>
+<b>Apply</b> - button to create cut image object;<br>
+<b>Apply and Close</b> - button to create cut image object and close input panel;<br>
+<b>Close</b> - button to close input panel.<br>
+It's necessary to select 2 pictures to be cut with help of <b>Image 1</b> and <b>Image 2</b> fields.<br>
+<br>Also, it's possible to change background color of cut image. For this <b>Color</b> radio button should be pushed and <b>Select color</b> dialog box should be called<br> by double clicking on the area near <b>Color</b> radio button.
+
+  \image html select_color.png "Select color dialog box"
+  
+<a href="index.html"><b>Back to Main page.</b></a>
+
+*/
diff --git a/doc/salome/gui/HYDRO/cylinder_obstacle.h b/doc/salome/gui/HYDRO/cylinder_obstacle.h
new file mode 100644 (file)
index 0000000..319e967
--- /dev/null
@@ -0,0 +1,43 @@
+
+/**
+  @file
+  \brief Help for the cylinder obstacle
+*/
+
+/**
+  \page cylinder_obstacle Cylinder obstacle
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+  In the HYDROGUI module cylinder obstacle is a geometrical primitive cylinder. 
+  
+
+  The cylinder obstacle can be created via:<ol>
+<li>The main menu <b> HYDRO => Obstacle => Create  cylinder</b>;</li>
+<li>Context menu of OBSTACLES in Object browser - <b>Create cylinder</b>;</li>
+<li><b>Create cylinder obstacle</b> toolbar button </li>
+ </ol> 
+
+\image html cylinder_toolbar_button.png "Create cylinder obstacle toolbar button"
+
+ <b>Cylinder construction</b> dialog box from Geometry module appears
+ \image html cylinder_dialog.png "Cylinder construction dialog box"
+
+User sets necesssary arguments and clicks <b>Apply and Close</b> button.
+
+<b>Cylinder construction</b> dialog box is closed and a new geometrical object cylinder appears in the Geometry module with defined by user name and dimensions.
+
+Help for this dialog is located in Salome Geometry User's guide => Creating geometrical objects => Creating primitives => Cylinder.
+
+ <b>Import GEOM object as obstacle</b> input panel appears.
+
+
+  - \ref import_obstacle_GEOM  "Import GEOM object as obstacle"
+  
+   The cylinder obstacle is presented as the face and 3D object.
+   \image html cylinder_presentation.png  "Cylinder obstacle example" 
+  
+ <a href="index.html"><b>Back to Main page.</b></a>
+
+*/
diff --git a/doc/salome/gui/HYDRO/delete.h b/doc/salome/gui/HYDRO/delete.h
new file mode 100644 (file)
index 0000000..2856e1d
--- /dev/null
@@ -0,0 +1,29 @@
+
+/**
+  @file
+  \brief Help for the delete object(s)
+*/
+
+/**
+  \page delete Delete object(s)
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  It is possible to delete one or more objects in HYDROGUI module.<br>
+  Following ways are available for beginning this action:<ol>
+  <li>Select object(s) and push <b>Delete</b> button;</li>
+  <li>Select object(s), call context menu and call <b>Delete</b> button;</li>
+  </ol>
+  
+  Further 2 possible ways are possible:<ol>
+  <li>If deleting objects are not used as references for another objects, <b>Delete objects</b> dialog box appears: <br>
+  
+  \image html delete_objects_dialog_box.png "Delete objects dialog box" </li>
+  <li>If removing objects are used as references for another objects, <b>Delete objects</b> warning appears: <br>
+  
+  \image html delete_objects_warning.png "Delete objects warning" 
+  In this case, firstly, it's necessary to remove objects which have been created basing on deleting objects. After that first case will be available.</li>
+  </ol>
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/digue.h b/doc/salome/gui/HYDRO/digue.h
new file mode 100644 (file)
index 0000000..5f641f8
--- /dev/null
@@ -0,0 +1,54 @@
+
+/**
+  @file
+  \brief Help for the digue
+*/
+
+/**
+  \page art_digue Digue
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+
+  The <b> digue</b> is an artificial object.
+
+  In the HYDROGUI module digue is created using the extrusion operation of profile along the provided path (guide line). 
+
+  The digue 3d shape is shell. 
+
+  Each profile vertex is extruded into digue edge. 
+  
+  Each profile edge is extruded into digue face. 
+
+  All sections of digue should be perpendicular to the extrusion path (guide line), they are NOT parallel to the initial profile plane.  
+
+  Note, that sharp corners in the extrusion path (guide line) can lead to selfinteresctions in the resulting shell. 
+  
+
+  The  digue can be created via:<ol>
+
+<li>The main menu <b> HYDRO => Create  digue</b>;
+<li>Context menu of Artificial objects in Object browser - <b>Create  digue</b>;
+<li><b>Create  digue</b> toolbar button 
+ </ol> 
+
+\image html  digue_toolbar_button.png "Create  digue toolbar button" 
+
+    Digue input panel appears.
+
+  \image html  digue_input_panel.png " Digue input panel"
+
+Arguments of the input panel: 
+<b>Name</b> - field to define the digue name;<br>
+<b>Guide line</b> - combo - box to select the polyline 3D defining the digue guide line;<br>
+<b>Profile</b> - combo - box to select the profile object describing digue cross-section;<br>
+<b>Apply</b> - button to generate digue;<br>
+<b>Apply and Close</b> - button to generate digue and close input panel;<br>
+<b>Close</b> - button to close input panel.
+  
+   The  digue is presented as the face and 3D object.
+   \image html  digue_presentation.png  " Digue example" 
+  
+ <a href="index.html"><b>Back to Main page.</b></a>
+
+*/
diff --git a/doc/salome/gui/HYDRO/dump_study.h b/doc/salome/gui/HYDRO/dump_study.h
new file mode 100644 (file)
index 0000000..cc08d9f
--- /dev/null
@@ -0,0 +1,32 @@
+
+/**
+  @file
+  \brief Help for the dump study
+*/
+
+/**
+  \page dump_study Dump study
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  The HYDROGUI module supports dumping documents into Python scripts. This operation can be called via:<ol>
+  <li> The main menu <b>File => Dump study</b>;</li>
+  <li> <b>CTRL + D</b> buttons combination;</li>
+  </ol>
+  
+  
+  <b>Dump study</b> dialog box looks like:
+  
+  \image html dump_study_dialog_box.png "Dump study dialog box"
+  
+  Controls inside <b>Dump study</b> dialog box:<ul>
+  <li><b>Publish in study</b> - check-box to </li>
+  <li><b>Multi file dump</b> - check-box to </li>
+  <li><b>Save GUI state</b> - check-box to </li>
+  </ul>
+  
+  In case if the user tries to save file with the name already used, warning appears, suggested overwriting existing file :
+  \image html warning_dump.png "Warning"
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/export_polyline.h b/doc/salome/gui/HYDRO/export_polyline.h
new file mode 100644 (file)
index 0000000..2917bcf
--- /dev/null
@@ -0,0 +1,19 @@
+
+/**
+  @file
+  \brief Help for the export polyline
+*/
+
+/**
+  \page export_polyline Export polyline
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  It is possible to export polylines from HYDROGUI module. This operation can be called from context menu of selected polylines in Object browser.
+  
+    <b>Export polyline</b> dialog box appears:
+   \image html export_polyline_dialog_box.png "Export polyline dialog box"
+   
+   <b>Supported format</b> - <b>.SHP</b>(shape files). 
+
+*/
diff --git a/doc/salome/gui/HYDRO/export_strickler_table.h b/doc/salome/gui/HYDRO/export_strickler_table.h
new file mode 100644 (file)
index 0000000..0f006c3
--- /dev/null
@@ -0,0 +1,28 @@
+
+/**
+  @file
+  \brief Help for the export strickler table
+*/
+
+/**
+  \page export_strickler_table Export strickler table
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  It is possible to export strickler table from HYDROGUI module. This operation is accessible from context menu of selected strickler table in Object browser.<br>
+  
+  <b>Export Strickler table</b> looks like:
+  \image html export_strickler_table_input_panel.png "Export strickler table input panel"
+  
+   Arguments of the input panel: 
+<b>File name</b> - field to define file to export;<br>
+<b>Name</b> - field to show name of strickler table to export;<br>
+<b>Apply</b> - button to export strickler table object;<br>
+<b>Apply and Close</b> - button to export strickler table object and close input panel;<br>
+<b>Close</b> - button to close input panel.<br>
+  
+  
+  
+
+*/
diff --git a/doc/salome/gui/HYDRO/find_bottom.h b/doc/salome/gui/HYDRO/find_bottom.h
new file mode 100644 (file)
index 0000000..e34acfc
--- /dev/null
@@ -0,0 +1,33 @@
+
+/**
+  @file
+  \brief Help for the find bottom
+*/
+
+/**
+  \page findbottom Find bottom
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+
+  <b>Find bottom</b> operation builds polyline simulating the river bottom. The bottom polyline is constructed as the spline connecting the points with the minimal altitude from each profile inside the stream.
+  
+  <b>Find stream bottom</b> input panel can be opened via:<ol>
+  <li> The main menu <b>HYDRO => Stream => Find bottom</b>;
+  <li>Context menu of <b>Stream</b> object in Object browser - <b>Find bottom</b>;</li>
+  </ol> 
+   
+  Arguments of the input panel: 
+
+  \image html find_bottom_input_panel.png "Find stream bottom input panel"
+  
+<b>Stream object</b> - combo-box to define reference stream object;<br>
+<b>Apply</b> - button to build stream's bottom;<br>
+<b>Apply and Close</b> - button to build stream's bottom and close input panel;<br>
+<b>Close</b> - button to close input panel.
+
+<b>Example</b>:<br>
+  
+\image html find_bottom_example.png "Find bottom example"
+
+<a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/fuse_images.h b/doc/salome/gui/HYDRO/fuse_images.h
new file mode 100644 (file)
index 0000000..9b6a634
--- /dev/null
@@ -0,0 +1,45 @@
+
+/**
+  @file
+  \brief Help for the fuse images
+*/
+
+/*
+div.inline-image,
+div.inline-image > div {
+  display:inline;
+}
+*/
+
+/**
+  \page fuseimages Fuse images
+
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+The user can start <b>Fuse images</b> operation via:<ol>
+<li>The main menu <b>HYDRO - Fuse images</b>; </li>
+<li>Context menu of any image in Object browser - <b>Fuse images</b>; </li>
+<li><b>Fuse images</b> toolbar button. \image html fuse_images_toolbar_button.png "Fuse images toolbar button"
+</ol>   
+
+
+
+
+  Arguments of the input panel:  
+
+  \image html fuse_images_input_panel.png "Fuse images input panel"
+  
+<b>Name</b> - field for defining the name of image after fusing;<br>
+<b>Image 1</b> - field for defining the first fusing image;<br>
+<b>Image 2</b> - field for defining the second fusing image;<br>
+<b>Apply</b> - button to create fused image object;<br>
+<b>Apply and Close</b> - button to create fused image object and close input panel;<br>
+<b>Close</b> - button to close input panel.<br>
+
+<br>Also, it's possible to change background color of fused image. For this <b>Color</b> radio button should be pushed and <b>Select color</b> dialog box should be called<br> by double clicking on the area near <b>Color</b> radio button.
+
+  \image html select_color.png "Select color dialog box"
+  
+<a href="index.html"><b>Back to Main page.</b></a>
+
+*/
diff --git a/doc/salome/gui/HYDRO/general_services.h b/doc/salome/gui/HYDRO/general_services.h
new file mode 100644 (file)
index 0000000..6b1b731
--- /dev/null
@@ -0,0 +1,29 @@
+
+/**
+  @file
+  \brief Help for the general services
+*/
+
+/**
+  \page general_services General services
+  
+  The HYRDOGUI module supports following services:
+  - \ref save "Save file"
+  - \ref open "Open file"
+  - \ref dump_study "Dump study"
+  - \ref load_script "Load script"
+  - \ref undo_redo "Undo/Redo actions"
+  - \ref copy_paste "Copy/Paste object(s)"
+  - \ref delete "Delete object(s)"
+  - \ref color "Color object"
+  - \ref show_hide "Show/Hide object(s)"
+  - \ref update "Update object"
+  - \ref rename "Rename object"
+  - \ref submersible "Submersible"
+  - \ref copy_position "Copy position"
+  - \ref change_layer_order "Change layer order"
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+
+*/
diff --git a/doc/salome/gui/HYDRO/georeferencement_profile.h b/doc/salome/gui/HYDRO/georeferencement_profile.h
new file mode 100644 (file)
index 0000000..faad63f
--- /dev/null
@@ -0,0 +1,41 @@
+
+/**
+  @file
+  \brief Help for the georeferencement profile
+*/
+
+/**
+  \page georeferencement_profile  Georeferencement of profiles
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  Georeferencement of profiles in HYDROGUI module is accessible via:<ul>
+  <li>The main menu <b>HYDRO => Profile => Georeferencement</b>;</li>
+  <li>Context menu of PROFILES in Object browser - <b>Georeferencement</b>;</li>
+  <li>Context menu of selected profiles in Object browser - <b>Georeferencement</b>;</li>
+  <li><b>Profile(s)georeferencement</b> toolar button.</li> 
+
+\image html georeferencement_toolbar_button.png "Profile(s) georeferencement toolbar button"
+  </ul>
+
+  <b>Georeferencement profile</b> input panel appears. The table widget shows either all profiles existing in document or selected profiles depending on the radio button activated:
+
+   \image html profiles_georeferencement_all.png  "Profiles georeferencement input panel- All profiles"
+   \image html profiles_georeferencement_selected.png  "Profiles georeferencement input panel- Selected profiles"
+If the user starts the operation via main menu, context menu of PROFILES or toolar button then the radio button All is activated automatically; if via context menu of selected profiles  - Selected radio button. 
+
+The user can input/change the coordinates of G, D profile points directly in the table using cell widgets or selecting a cell in the table and clicking in viewer. 
+
+<b>Apply</b> - button to validate changes;<br>
+<b>Apply and Close</b> - button to validate changes and close input panel;<br>
+<b>Close</b> - button to close input panel.  
+
+2D profiles that were georeferenced become 3D profiles and their names  color is changed from red to black.
+
+\image html georeferencemented_profiles.png "Profiles in Object browser before and after georeferencement"
+
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/image.h b/doc/salome/gui/HYDRO/image.h
new file mode 100644 (file)
index 0000000..eb9e066
--- /dev/null
@@ -0,0 +1,20 @@
+/**
+  @file
+  \brief Help for the image
+*/
+
+/**
+  \page image Image
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+Image is a picture area, the user is interested in. Images can be used to better visualize the study zone, the positioning of the geometries - polylines, bathymetries, etc.<br>
+  The HYDROGUI module supports the following operations with images:
+
+  - \ref impimage "Import image"
+  - \ref fuseimages "Fuse images"
+  - \ref cutimages "Cut images"
+  - \ref splitimage "Split image"
+
+*/
diff --git a/doc/salome/gui/HYDRO/images/add_element_panel.png b/doc/salome/gui/HYDRO/images/add_element_panel.png
new file mode 100644 (file)
index 0000000..436eab7
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/add_element_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/addition_mode_button.png b/doc/salome/gui/HYDRO/images/addition_mode_button.png
new file mode 100644 (file)
index 0000000..2a49891
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/addition_mode_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/bathymetry_example.png b/doc/salome/gui/HYDRO/images/bathymetry_example.png
new file mode 100644 (file)
index 0000000..ceca81c
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/bathymetry_example.png differ
diff --git a/doc/salome/gui/HYDRO/images/box_dialog.png b/doc/salome/gui/HYDRO/images/box_dialog.png
new file mode 100644 (file)
index 0000000..7e3b5e8
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/box_dialog.png differ
diff --git a/doc/salome/gui/HYDRO/images/box_input_panel.png b/doc/salome/gui/HYDRO/images/box_input_panel.png
new file mode 100644 (file)
index 0000000..e90fba7
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/box_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/box_input_panel_create.png b/doc/salome/gui/HYDRO/images/box_input_panel_create.png
new file mode 100644 (file)
index 0000000..86bceee
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/box_input_panel_create.png differ
diff --git a/doc/salome/gui/HYDRO/images/box_presentation.png b/doc/salome/gui/HYDRO/images/box_presentation.png
new file mode 100644 (file)
index 0000000..e2f9f43
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/box_presentation.png differ
diff --git a/doc/salome/gui/HYDRO/images/box_toolbar_button.png b/doc/salome/gui/HYDRO/images/box_toolbar_button.png
new file mode 100644 (file)
index 0000000..f20fe46
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/box_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/change_layer_order_dialog_box.png b/doc/salome/gui/HYDRO/images/change_layer_order_dialog_box.png
new file mode 100644 (file)
index 0000000..096a046
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/change_layer_order_dialog_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/channel_empty.png b/doc/salome/gui/HYDRO/images/channel_empty.png
new file mode 100644 (file)
index 0000000..eb13b47
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/channel_empty.png differ
diff --git a/doc/salome/gui/HYDRO/images/channel_icon.png b/doc/salome/gui/HYDRO/images/channel_icon.png
new file mode 100644 (file)
index 0000000..f037a8d
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/channel_icon.png differ
diff --git a/doc/salome/gui/HYDRO/images/channel_input_panel.png b/doc/salome/gui/HYDRO/images/channel_input_panel.png
new file mode 100644 (file)
index 0000000..eb13b47
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/channel_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/channel_presentation.png b/doc/salome/gui/HYDRO/images/channel_presentation.png
new file mode 100644 (file)
index 0000000..5187ea5
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/channel_presentation.png differ
diff --git a/doc/salome/gui/HYDRO/images/channel_toolbar_button.png b/doc/salome/gui/HYDRO/images/channel_toolbar_button.png
new file mode 100644 (file)
index 0000000..f037a8d
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/channel_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/close_active_study_warning.png b/doc/salome/gui/HYDRO/images/close_active_study_warning.png
new file mode 100644 (file)
index 0000000..7bf73e6
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/close_active_study_warning.png differ
diff --git a/doc/salome/gui/HYDRO/images/color_example.png b/doc/salome/gui/HYDRO/images/color_example.png
new file mode 100644 (file)
index 0000000..92787b7
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/color_example.png differ
diff --git a/doc/salome/gui/HYDRO/images/create_immersible_zone_input_panel.png b/doc/salome/gui/HYDRO/images/create_immersible_zone_input_panel.png
new file mode 100644 (file)
index 0000000..1a0cd6f
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/create_immersible_zone_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/create_immersible_zone_toolbar_button.png b/doc/salome/gui/HYDRO/images/create_immersible_zone_toolbar_button.png
new file mode 100644 (file)
index 0000000..61abb65
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/create_immersible_zone_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/create_polyline_3d_input_panel.png b/doc/salome/gui/HYDRO/images/create_polyline_3d_input_panel.png
new file mode 100644 (file)
index 0000000..946cf67
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/create_polyline_3d_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/create_polyline_3d_toolbar_button.png b/doc/salome/gui/HYDRO/images/create_polyline_3d_toolbar_button.png
new file mode 100644 (file)
index 0000000..be3e220
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/create_polyline_3d_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/create_polyline_input_panel.png b/doc/salome/gui/HYDRO/images/create_polyline_input_panel.png
new file mode 100644 (file)
index 0000000..b0982e2
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/create_polyline_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/create_polyline_toolbar_button.png b/doc/salome/gui/HYDRO/images/create_polyline_toolbar_button.png
new file mode 100644 (file)
index 0000000..6da1ab0
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/create_polyline_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/create_profile_input_panel.png b/doc/salome/gui/HYDRO/images/create_profile_input_panel.png
new file mode 100644 (file)
index 0000000..9547589
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/create_profile_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/create_profile_toolbar_button.png b/doc/salome/gui/HYDRO/images/create_profile_toolbar_button.png
new file mode 100644 (file)
index 0000000..aff6993
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/create_profile_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/create_stream_input_panel.png b/doc/salome/gui/HYDRO/images/create_stream_input_panel.png
new file mode 100644 (file)
index 0000000..d682dc2
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/create_stream_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/create_stream_toolbar_button.png b/doc/salome/gui/HYDRO/images/create_stream_toolbar_button.png
new file mode 100644 (file)
index 0000000..828cb2c
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/create_stream_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/cut_images_input_panel.png b/doc/salome/gui/HYDRO/images/cut_images_input_panel.png
new file mode 100644 (file)
index 0000000..1e57949
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/cut_images_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/cut_images_toolbar_button.png b/doc/salome/gui/HYDRO/images/cut_images_toolbar_button.png
new file mode 100644 (file)
index 0000000..19a3907
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/cut_images_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/cylinder_dialog.png b/doc/salome/gui/HYDRO/images/cylinder_dialog.png
new file mode 100644 (file)
index 0000000..68ac040
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/cylinder_dialog.png differ
diff --git a/doc/salome/gui/HYDRO/images/cylinder_presentation.png b/doc/salome/gui/HYDRO/images/cylinder_presentation.png
new file mode 100644 (file)
index 0000000..e19eb24
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/cylinder_presentation.png differ
diff --git a/doc/salome/gui/HYDRO/images/cylinder_toolbar_button.png b/doc/salome/gui/HYDRO/images/cylinder_toolbar_button.png
new file mode 100644 (file)
index 0000000..af28f85
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/cylinder_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/delete_objects_dialog_box.png b/doc/salome/gui/HYDRO/images/delete_objects_dialog_box.png
new file mode 100644 (file)
index 0000000..6029e2a
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/delete_objects_dialog_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/delete_objects_warning.png b/doc/salome/gui/HYDRO/images/delete_objects_warning.png
new file mode 100644 (file)
index 0000000..f8b38d4
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/delete_objects_warning.png differ
diff --git a/doc/salome/gui/HYDRO/images/digue_empty.png b/doc/salome/gui/HYDRO/images/digue_empty.png
new file mode 100644 (file)
index 0000000..1925885
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/digue_empty.png differ
diff --git a/doc/salome/gui/HYDRO/images/digue_icon.png b/doc/salome/gui/HYDRO/images/digue_icon.png
new file mode 100644 (file)
index 0000000..df268af
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/digue_icon.png differ
diff --git a/doc/salome/gui/HYDRO/images/digue_input_panel.png b/doc/salome/gui/HYDRO/images/digue_input_panel.png
new file mode 100644 (file)
index 0000000..1925885
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/digue_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/digue_presentation.png b/doc/salome/gui/HYDRO/images/digue_presentation.png
new file mode 100644 (file)
index 0000000..e3c974f
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/digue_presentation.png differ
diff --git a/doc/salome/gui/HYDRO/images/digue_toolbar_button.png b/doc/salome/gui/HYDRO/images/digue_toolbar_button.png
new file mode 100644 (file)
index 0000000..df268af
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/digue_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/dump_study_dialog_box.png b/doc/salome/gui/HYDRO/images/dump_study_dialog_box.png
new file mode 100644 (file)
index 0000000..059cac8
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/dump_study_dialog_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/edit_element_panel.png b/doc/salome/gui/HYDRO/images/edit_element_panel.png
new file mode 100644 (file)
index 0000000..ea104bc
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/edit_element_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/example_change_layer_order_after.png b/doc/salome/gui/HYDRO/images/example_change_layer_order_after.png
new file mode 100644 (file)
index 0000000..3640f11
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/example_change_layer_order_after.png differ
diff --git a/doc/salome/gui/HYDRO/images/example_change_layer_order_before.png b/doc/salome/gui/HYDRO/images/example_change_layer_order_before.png
new file mode 100644 (file)
index 0000000..037e5bb
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/example_change_layer_order_before.png differ
diff --git a/doc/salome/gui/HYDRO/images/export_polyline_dialog_box.png b/doc/salome/gui/HYDRO/images/export_polyline_dialog_box.png
new file mode 100644 (file)
index 0000000..7bdaf12
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/export_polyline_dialog_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/export_strickler_table_input_panel.png b/doc/salome/gui/HYDRO/images/export_strickler_table_input_panel.png
new file mode 100644 (file)
index 0000000..d8363cf
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/export_strickler_table_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/eye_icons.png b/doc/salome/gui/HYDRO/images/eye_icons.png
new file mode 100644 (file)
index 0000000..3cb5919
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/eye_icons.png differ
diff --git a/doc/salome/gui/HYDRO/images/find_bottom_example.png b/doc/salome/gui/HYDRO/images/find_bottom_example.png
new file mode 100644 (file)
index 0000000..a4e247f
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/find_bottom_example.png differ
diff --git a/doc/salome/gui/HYDRO/images/find_bottom_input_panel.png b/doc/salome/gui/HYDRO/images/find_bottom_input_panel.png
new file mode 100644 (file)
index 0000000..01cb5f5
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/find_bottom_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/fuse_images_input_panel.png b/doc/salome/gui/HYDRO/images/fuse_images_input_panel.png
new file mode 100644 (file)
index 0000000..c5e014b
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/fuse_images_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/fuse_images_toolbar_button.png b/doc/salome/gui/HYDRO/images/fuse_images_toolbar_button.png
new file mode 100644 (file)
index 0000000..b152bfe
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/fuse_images_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/geographic_coordinates.png b/doc/salome/gui/HYDRO/images/geographic_coordinates.png
new file mode 100644 (file)
index 0000000..cda9bcb
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/geographic_coordinates.png differ
diff --git a/doc/salome/gui/HYDRO/images/georeferencement_toolbar_button.png b/doc/salome/gui/HYDRO/images/georeferencement_toolbar_button.png
new file mode 100644 (file)
index 0000000..1e99861
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/georeferencement_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/georeferencemented_profiles.png b/doc/salome/gui/HYDRO/images/georeferencemented_profiles.png
new file mode 100644 (file)
index 0000000..440a4ba
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/georeferencemented_profiles.png differ
diff --git a/doc/salome/gui/HYDRO/images/immersible_zone_example.png b/doc/salome/gui/HYDRO/images/immersible_zone_example.png
new file mode 100644 (file)
index 0000000..18712bc
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/immersible_zone_example.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_bathymetry_input_panel.png b/doc/salome/gui/HYDRO/images/import_bathymetry_input_panel.png
new file mode 100644 (file)
index 0000000..7402533
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_bathymetry_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_bathymetry_toolbar_button.png b/doc/salome/gui/HYDRO/images/import_bathymetry_toolbar_button.png
new file mode 100644 (file)
index 0000000..3b90c7e
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_bathymetry_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_image_enabled.png b/doc/salome/gui/HYDRO/images/import_image_enabled.png
new file mode 100644 (file)
index 0000000..ec8d9fb
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_image_enabled.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_image_toolbar_button.png b/doc/salome/gui/HYDRO/images/import_image_toolbar_button.png
new file mode 100644 (file)
index 0000000..aa3d5d4
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_image_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_obstacle_create_input_panel.png b/doc/salome/gui/HYDRO/images/import_obstacle_create_input_panel.png
new file mode 100644 (file)
index 0000000..f834ea6
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_obstacle_create_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_obstacle_input_panel.png b/doc/salome/gui/HYDRO/images/import_obstacle_input_panel.png
new file mode 100644 (file)
index 0000000..3af3c56
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_obstacle_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_obstacle_toolbar_button.png b/doc/salome/gui/HYDRO/images/import_obstacle_toolbar_button.png
new file mode 100644 (file)
index 0000000..2a6e277
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_obstacle_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_polyline_dialog_box.png b/doc/salome/gui/HYDRO/images/import_polyline_dialog_box.png
new file mode 100644 (file)
index 0000000..3ca1067
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_polyline_dialog_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_polyline_toolbar_button.png b/doc/salome/gui/HYDRO/images/import_polyline_toolbar_button.png
new file mode 100644 (file)
index 0000000..f6a6d7b
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_polyline_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_profile_dialog_box.png b/doc/salome/gui/HYDRO/images/import_profile_dialog_box.png
new file mode 100644 (file)
index 0000000..51c9a47
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_profile_dialog_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_profile_toolbar_button.png b/doc/salome/gui/HYDRO/images/import_profile_toolbar_button.png
new file mode 100644 (file)
index 0000000..0982842
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_profile_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_strickler_table_input_panel.png b/doc/salome/gui/HYDRO/images/import_strickler_table_input_panel.png
new file mode 100644 (file)
index 0000000..649a8ab
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_strickler_table_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/import_strickler_table_toolbar_button.png b/doc/salome/gui/HYDRO/images/import_strickler_table_toolbar_button.png
new file mode 100644 (file)
index 0000000..afe7613
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/import_strickler_table_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/imported_profiles.png b/doc/salome/gui/HYDRO/images/imported_profiles.png
new file mode 100644 (file)
index 0000000..ac696c5
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/imported_profiles.png differ
diff --git a/doc/salome/gui/HYDRO/images/impot_image_dialog.png b/doc/salome/gui/HYDRO/images/impot_image_dialog.png
new file mode 100644 (file)
index 0000000..5ef827e
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/impot_image_dialog.png differ
diff --git a/doc/salome/gui/HYDRO/images/insert_new_section_button.png b/doc/salome/gui/HYDRO/images/insert_new_section_button.png
new file mode 100644 (file)
index 0000000..f4244f9
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/insert_new_section_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/join_selected_sections_button.png b/doc/salome/gui/HYDRO/images/join_selected_sections_button.png
new file mode 100644 (file)
index 0000000..d1f5bf3
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/join_selected_sections_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/lambert_coordinates.png b/doc/salome/gui/HYDRO/images/lambert_coordinates.png
new file mode 100644 (file)
index 0000000..2968ede
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/lambert_coordinates.png differ
diff --git a/doc/salome/gui/HYDRO/images/load_python_script_dialog_box.png b/doc/salome/gui/HYDRO/images/load_python_script_dialog_box.png
new file mode 100644 (file)
index 0000000..827d856
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/load_python_script_dialog_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/local_cs_transformation_input_panel.png b/doc/salome/gui/HYDRO/images/local_cs_transformation_input_panel.png
new file mode 100644 (file)
index 0000000..6d8763c
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/local_cs_transformation_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/modif_mode_table.png b/doc/salome/gui/HYDRO/images/modif_mode_table.png
new file mode 100644 (file)
index 0000000..67eca62
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/modif_mode_table.png differ
diff --git a/doc/salome/gui/HYDRO/images/modification_mode_button.png b/doc/salome/gui/HYDRO/images/modification_mode_button.png
new file mode 100644 (file)
index 0000000..d86ac63
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/modification_mode_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/move_item_down_button.png b/doc/salome/gui/HYDRO/images/move_item_down_button.png
new file mode 100644 (file)
index 0000000..6008744
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/move_item_down_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/move_item_on_bottom_button.png b/doc/salome/gui/HYDRO/images/move_item_on_bottom_button.png
new file mode 100644 (file)
index 0000000..6245bc9
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/move_item_on_bottom_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/move_item_on_top_button.png b/doc/salome/gui/HYDRO/images/move_item_on_top_button.png
new file mode 100644 (file)
index 0000000..3aed4eb
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/move_item_on_top_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/move_item_up_button.png b/doc/salome/gui/HYDRO/images/move_item_up_button.png
new file mode 100644 (file)
index 0000000..73a5021
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/move_item_up_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/not_updated_stream.png b/doc/salome/gui/HYDRO/images/not_updated_stream.png
new file mode 100644 (file)
index 0000000..aa0853f
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/not_updated_stream.png differ
diff --git a/doc/salome/gui/HYDRO/images/obstacle_presentation.png b/doc/salome/gui/HYDRO/images/obstacle_presentation.png
new file mode 100644 (file)
index 0000000..af527c7
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/obstacle_presentation.png differ
diff --git a/doc/salome/gui/HYDRO/images/open_document_toolbar_button.png b/doc/salome/gui/HYDRO/images/open_document_toolbar_button.png
new file mode 100644 (file)
index 0000000..94793d0
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/open_document_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/open_file_dialog.png b/doc/salome/gui/HYDRO/images/open_file_dialog.png
new file mode 100644 (file)
index 0000000..fa82793
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/open_file_dialog.png differ
diff --git a/doc/salome/gui/HYDRO/images/open_file_dialog_box.png b/doc/salome/gui/HYDRO/images/open_file_dialog_box.png
new file mode 100644 (file)
index 0000000..17c84c3
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/open_file_dialog_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/open_file_icon.png b/doc/salome/gui/HYDRO/images/open_file_icon.png
new file mode 100644 (file)
index 0000000..fc3bce7
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/open_file_icon.png differ
diff --git a/doc/salome/gui/HYDRO/images/polyline_3d_example.png b/doc/salome/gui/HYDRO/images/polyline_3d_example.png
new file mode 100644 (file)
index 0000000..1d164a8
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/polyline_3d_example.png differ
diff --git a/doc/salome/gui/HYDRO/images/preferences.png b/doc/salome/gui/HYDRO/images/preferences.png
new file mode 100644 (file)
index 0000000..bc57572
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/preferences.png differ
diff --git a/doc/salome/gui/HYDRO/images/preferences_import.png b/doc/salome/gui/HYDRO/images/preferences_import.png
new file mode 100644 (file)
index 0000000..edb9e79
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/preferences_import.png differ
diff --git a/doc/salome/gui/HYDRO/images/preferences_type.png b/doc/salome/gui/HYDRO/images/preferences_type.png
new file mode 100644 (file)
index 0000000..a8fb115
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/preferences_type.png differ
diff --git a/doc/salome/gui/HYDRO/images/prof_modif_mode_table.png b/doc/salome/gui/HYDRO/images/prof_modif_mode_table.png
new file mode 100644 (file)
index 0000000..1bab9f4
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/prof_modif_mode_table.png differ
diff --git a/doc/salome/gui/HYDRO/images/profile_addition_points.png b/doc/salome/gui/HYDRO/images/profile_addition_points.png
new file mode 100644 (file)
index 0000000..94abdd1
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/profile_addition_points.png differ
diff --git a/doc/salome/gui/HYDRO/images/profile_edit.png b/doc/salome/gui/HYDRO/images/profile_edit.png
new file mode 100644 (file)
index 0000000..1b8b30d
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/profile_edit.png differ
diff --git a/doc/salome/gui/HYDRO/images/profile_interpolation_preview.png b/doc/salome/gui/HYDRO/images/profile_interpolation_preview.png
new file mode 100644 (file)
index 0000000..593ebdc
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/profile_interpolation_preview.png differ
diff --git a/doc/salome/gui/HYDRO/images/profiles_georeferencement_all.png b/doc/salome/gui/HYDRO/images/profiles_georeferencement_all.png
new file mode 100644 (file)
index 0000000..ed188e3
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/profiles_georeferencement_all.png differ
diff --git a/doc/salome/gui/HYDRO/images/profiles_georeferencement_selected.png b/doc/salome/gui/HYDRO/images/profiles_georeferencement_selected.png
new file mode 100644 (file)
index 0000000..571dbee
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/profiles_georeferencement_selected.png differ
diff --git a/doc/salome/gui/HYDRO/images/profiles_interpolation_input_panel.png b/doc/salome/gui/HYDRO/images/profiles_interpolation_input_panel.png
new file mode 100644 (file)
index 0000000..e0ace2e
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/profiles_interpolation_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/python_console.png b/doc/salome/gui/HYDRO/images/python_console.png
new file mode 100644 (file)
index 0000000..caa1d15
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/python_console.png differ
diff --git a/doc/salome/gui/HYDRO/images/redo_button.png b/doc/salome/gui/HYDRO/images/redo_button.png
new file mode 100644 (file)
index 0000000..c352a5b
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/redo_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/redo_combo_box.png b/doc/salome/gui/HYDRO/images/redo_combo_box.png
new file mode 100644 (file)
index 0000000..b912599
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/redo_combo_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/redo_toolbar_button.png b/doc/salome/gui/HYDRO/images/redo_toolbar_button.png
new file mode 100644 (file)
index 0000000..4701b3d
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/redo_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/reference_image.png b/doc/salome/gui/HYDRO/images/reference_image.png
new file mode 100644 (file)
index 0000000..ce72152
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/reference_image.png differ
diff --git a/doc/salome/gui/HYDRO/images/remove_button.png b/doc/salome/gui/HYDRO/images/remove_button.png
new file mode 100644 (file)
index 0000000..07f09f8
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/remove_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/reopen_file_dialog_box.png b/doc/salome/gui/HYDRO/images/reopen_file_dialog_box.png
new file mode 100644 (file)
index 0000000..81d3cca
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/reopen_file_dialog_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/save_document_toolbar_button.png b/doc/salome/gui/HYDRO/images/save_document_toolbar_button.png
new file mode 100644 (file)
index 0000000..399c055
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/save_document_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/save_file_dialog_box.png b/doc/salome/gui/HYDRO/images/save_file_dialog_box.png
new file mode 100644 (file)
index 0000000..7ff19ae
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/save_file_dialog_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/save_file_warning.png b/doc/salome/gui/HYDRO/images/save_file_warning.png
new file mode 100644 (file)
index 0000000..e4950d5
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/save_file_warning.png differ
diff --git a/doc/salome/gui/HYDRO/images/select_color.png b/doc/salome/gui/HYDRO/images/select_color.png
new file mode 100644 (file)
index 0000000..045dcd5
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/select_color.png differ
diff --git a/doc/salome/gui/HYDRO/images/set_color_dialog_box.png b/doc/salome/gui/HYDRO/images/set_color_dialog_box.png
new file mode 100644 (file)
index 0000000..fc03c4c
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/set_color_dialog_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/split_image_input_panel.png b/doc/salome/gui/HYDRO/images/split_image_input_panel.png
new file mode 100644 (file)
index 0000000..a89c887
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/split_image_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/split_image_toolbar_button.png b/doc/salome/gui/HYDRO/images/split_image_toolbar_button.png
new file mode 100644 (file)
index 0000000..5890332
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/split_image_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/stream_2d_example.png b/doc/salome/gui/HYDRO/images/stream_2d_example.png
new file mode 100644 (file)
index 0000000..b69fad9
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/stream_2d_example.png differ
diff --git a/doc/salome/gui/HYDRO/images/stream_3d_example.png b/doc/salome/gui/HYDRO/images/stream_3d_example.png
new file mode 100644 (file)
index 0000000..a39c7c3
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/stream_3d_example.png differ
diff --git a/doc/salome/gui/HYDRO/images/submersible.png b/doc/salome/gui/HYDRO/images/submersible.png
new file mode 100644 (file)
index 0000000..125b612
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/submersible.png differ
diff --git a/doc/salome/gui/HYDRO/images/translate_obstacle_example.png b/doc/salome/gui/HYDRO/images/translate_obstacle_example.png
new file mode 100644 (file)
index 0000000..ab1cf3e
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/translate_obstacle_example.png differ
diff --git a/doc/salome/gui/HYDRO/images/translate_obstacle_input_panel.png b/doc/salome/gui/HYDRO/images/translate_obstacle_input_panel.png
new file mode 100644 (file)
index 0000000..00180a4
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/translate_obstacle_input_panel.png differ
diff --git a/doc/salome/gui/HYDRO/images/undo_button.png b/doc/salome/gui/HYDRO/images/undo_button.png
new file mode 100644 (file)
index 0000000..579d5ed
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/undo_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/undo_combo_box.png b/doc/salome/gui/HYDRO/images/undo_combo_box.png
new file mode 100644 (file)
index 0000000..f9b2bab
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/undo_combo_box.png differ
diff --git a/doc/salome/gui/HYDRO/images/undo_toolbar_button.png b/doc/salome/gui/HYDRO/images/undo_toolbar_button.png
new file mode 100644 (file)
index 0000000..6ba2749
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/undo_toolbar_button.png differ
diff --git a/doc/salome/gui/HYDRO/images/updated_stream.png b/doc/salome/gui/HYDRO/images/updated_stream.png
new file mode 100644 (file)
index 0000000..e3d1410
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/updated_stream.png differ
diff --git a/doc/salome/gui/HYDRO/images/warning_dump.png b/doc/salome/gui/HYDRO/images/warning_dump.png
new file mode 100644 (file)
index 0000000..fb95fd6
Binary files /dev/null and b/doc/salome/gui/HYDRO/images/warning_dump.png differ
index 788e9ea8db66ed954a9c976ff4e88a850a08ca79..c0a1ff7ad51756da89449b9bf05f8a43630b2fc4 100644 (file)
@@ -7,24 +7,30 @@
 /**
   \page imzone Immersible zone
 
-  The <b>immersible zone</b> is a natural object.
-  In the HYDROGUI module it is the face limited by one polyline.
-  It simulates the zone under the water.
-
-  The immersible zone can be created via the main menu HYDRO => Create immersible zone.
-
-  In the dialog box: 
-
-  \image html immersible_zone_dlg.png "Immersible zone dialog box"
-
-  the user should select the polyline limited the immersible zone and the bathymetry object associated with the immersible zone.
-
-  The immersible zone can be defined on the polyline with one contour, in this case it will be a simple face limited by the contour:
-
-  \image html simple_immersible_zone.png "A simple immersible zone"
-
-  Also the immersible zone can be defined on the polyline with two contours (one inside another),
-  in this case it will be a face limited by external contour with the hole limited by the internal contour.
-
-  \image html immersible_zone_with_hole.png "An immersible zone with a hole"
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  The <b>immersible zone</b> is a natural object describing the area that is (or may be) under the water.
+  
+  <b>Create immersible zone</b> input panel can be opened via:<ol>
+  <li> The main menu <b>HYDRO => Create immersible zone</b>;
+  <li> Context menu of <b>NATURAL OBJECTS</b> in Object browser => <b>Create immersible zone</b>;
+  <li> <b>Create immersible zone</b> toolar button.\image html create_immersible_zone_toolbar_button.png "Create immersible zone toolbar button"
+  </ol> 
+   
+  Arguments of the input panel: 
+
+  \image html create_immersible_zone_input_panel.png "Create immersible zone input panel"
+  
+<b>Name</b> - field to define the immersible zone name;<br>
+<b>Polyline</b> - combo - box to select the polyline defining the immersible zone border. The combo box contains only closed polylines allowed for the immersible zones creation.<br>
+<b>Bathymetry</b> - combo - box to select the bathymetry object describing immersible zone's profile;<br>
+<b>Apply</b> - button to generate immersible zone;<br>
+<b>Apply and Close</b> - button to generate immersible zone and close input panel;<br>
+<b>Close</b> - button to close input panel.
+
+<b>Example</b>:<br>
+  
+\image html immersible_zone_example.png "Immersible zone example"
+
+<a href="index.html"><b>Back to Main page.</b></a>
 */
diff --git a/doc/salome/gui/HYDRO/import_image.h b/doc/salome/gui/HYDRO/import_image.h
new file mode 100644 (file)
index 0000000..553c26b
--- /dev/null
@@ -0,0 +1,54 @@
+
+/**
+  @file
+  \brief Help for the import image
+*/
+
+/**
+  \page impimage Import image
+
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  <b>Import image</b> input panel can be opened via:<ol>
+  <li> The main menu <b>HYDRO => Import image</b>;
+  <li> Context menu of <b>IMAGES</b> in Object browser => <b>Import image</b>;
+  <li> <b>CTRL + I</b> buttons combination;
+  <li> <b>Import image</b> toolar button. \image html import_image_toolbar_button.png "Import image toolbar button"
+  </ol> 
+   
+   Arguments of the input panel: 
+
+  \image html impot_image_dialog.png "Import image input panel"
+  
+<b>File name</b> - field for defining file to import. Supported formats are .bmp, .jpg, .jpeg, .png, .tif.<br>
+<b>Name</b> - field for defining the name of image after import. By default - the name of the file;<br>
+<b>Apply</b> - button to create image object;<br>
+<b>Apply and Close</b> - button to create image object and close input panel;<br>
+<b>Close</b> - button to close input panel.<br>
+  Another fields become enabled:
+  
+  \image html import_image_enabled.png "Enabled Import image input panel"
+  
+  By default, two points should be used for the image positioning. The corresponding transformation should be built using the rules: only panning, rotation and scaling are allowed; the scaling is same along X, Y; all angles are kept.<br>
+  An additional check box allows the user to activate usage of the 3-rd point (unchecked by default). When user activates it he can select the 3-rd point exactly as previous two and in this case the complete affine transformation is applied (note that angles can be not kept and scaling along X, Y may be different in this case).<br>
+  
+  Coordinates of points can be defined via:<ol>
+  
+  <li> <b>Manually input Geographic coordinates</b>
+       <br>It's necessary to to input latitude and longitude of points.
+       \image html geographic_coordinates.png "Geographic coordinates"
+  
+  <li> <b>Manually input Plane coordinates(Lambert93)</b>
+       <br>It's necessary to input lambert coordinates of points.
+       \image html lambert_coordinates.png "Lambert coordinates"
+  
+  <li> <b>Get Plane coordinates (Lambert93) from file</b>
+       <br>It's necessary to load file with lambert coordinates. Supported format - <b>.GRF</b> (image georeferencement file)
+  
+  <li> <b>Choose points on reference image</b>
+       <br>It's necessary to choose reference image from combo box
+       \image html reference_image.png "Combo-box for defining reference image"
+</ol> 
+
+<a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/import_obstacle.h b/doc/salome/gui/HYDRO/import_obstacle.h
new file mode 100644 (file)
index 0000000..98f499b
--- /dev/null
@@ -0,0 +1,71 @@
+
+/**
+  @file
+  \brief Help for Import obstacle from file operation
+*/
+
+/**
+  \page import_obstacle Import obstacle from file
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+
+  An obstacle can be imported into the HYDROGUI module from external file. 
+  
+
+  The <b>Import obstacle</b> operation can be started via:<ol>
+
+<li>The main menu <b> HYDRO => Obstacle => Import obstacle </b>;
+<li>Context menu of OBSTACLES in Object browser - <b>Import obstacle</b>;
+<li><b>Import obstacle from file</b> toolbar button 
+ </ol> 
+
+\image html  import_obstacle_toolbar_button.png "Import obstacle from file toolbar button" 
+
+ <b>Import obstacle</b> input panel appears.
+
+  
+  \image html import_obstacle_create_input_panel.png " Import obstacle input panel - Create mode"
+  
+   \image html import_obstacle_input_panel.png " Import obstacle input panel - Modify mode"
+
+Arguments of the input panel: 
+
+<b>File name</b> - field for defining file to import. 
+
+
+The user clicks <b>Open File</b> button.
+
+
+\image html  open_file_icon.png  "Open File button"
+
+
+<b>Open File</b> dialog box appears.
+
+
+\image html  open_file_dialog.png  "Open File dialog"
+
+
+The user selects type of file to be imported. Supported formats are BREP, IGES, STEP.
+
+The user selects folder in <b>Look in</b> filed and desired file in this folder.
+
+The user clicks <b>Open</b> button.
+
+<b>Open File</b> dialog box is closed. Selected file appears in <b>File name</b>.
+
+
+<b>Name</b> - field to define the obstacle name. By default name is the same as file name without extension;<br>
+<b>Mode</b> - allows to generate a new obstacle (radio-button <b>Create new</b>) or replace existing obstacle (radio-button <b>Modify</b>) ;<br>
+<b>Apply</b> - button to import obstacle;<br>
+<b>Apply and Close</b> - button to import obstacle and close input panel;<br>
+<b>Close</b> - button to close input panel.
+  
+   The obstacle is presented as the face and 3D object.
+   \image html obstacle_presentation.png  "Obstacle example" 
+  
+ <a href="index.html"><b>Back to Main page.</b></a>
+
+*/
diff --git a/doc/salome/gui/HYDRO/import_obstacle_GEOM.h b/doc/salome/gui/HYDRO/import_obstacle_GEOM.h
new file mode 100644 (file)
index 0000000..bf6ae77
--- /dev/null
@@ -0,0 +1,43 @@
+
+/**
+  @file
+  \brief Help for Import GEOM object as obstacle operation
+*/
+
+/**
+  \page import_obstacle_GEOM Import GEOM object as obstacle
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+  A geometrical object can be imported into the HYDROGUI module as an obstacle. 
+  
+
+  The <b>Import GEOM object as obstacle</b> operation can be started via Context menu of GEOM object in Object browser - <b>Import as obstacle</b>.
+
+ The user can select one/several objects in GEOM, in this case for each selected object the corresponding instance of HYDRO obstacle will be created.
+ <b>Import GEOM object as obstacle</b> input panel appears.
+
+The same input panel appears after creation of new geometrical primitives as results of <b>Create box</b> and <b>Create cylinder</b> operations.
+
+<b>Import GEOM object as obstacle</b> input panel appears.
+
+  \image html box_input_panel_create.png " Import GEOM object as obstacle input panel - Create mode"
+  
+   \image html box_input_panel.png " Import GEOM object as obstacle input panel - Modify mode"
+
+Arguments of the input panel:
+<b>Name</b> - field to define the obstacle name. By default name is the same as name of corresponding GEOM object;<br>
+<b>Mode</b> - allows to generate a new obstacle (radio-button <b>Create new</b>) or replace existing obstacle (radio-button <b>Modify</b>) ;<br>
+<b>Apply</b> - button to generate obstacle;<br>
+<b>Apply and Close</b> - button to generate obstacle and close input panel;<br>
+<b>Close</b> - button to close input panel.
+  
+   The obstacle is presented as the face and 3D object.
+   \image html box_presentation.png  "Box obstacle example" 
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+  
+*/
diff --git a/doc/salome/gui/HYDRO/import_polyline.h b/doc/salome/gui/HYDRO/import_polyline.h
new file mode 100644 (file)
index 0000000..0737324
--- /dev/null
@@ -0,0 +1,21 @@
+
+/**
+  @file
+  \brief Help for the import polyline
+*/
+
+/**
+  \page import_polyline Import polyline
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  It is possible to import polylines in HYDROGUI module. This operation is accessible via:<ul>
+  <li>The main menu <b>HYDRO => Import polyline</b>;</li>
+  <li><b>Import polyline</b> toolar button. \image html import_polyline_toolbar_button.png "Import polyline toolbar button"</li>
+  </ul>
+
+  <b>Import polyline</b> dialog box appears:
+   \image html import_polyline_dialog_box.png "Import polyline dialog box"
+  
+<b>Supported formats</b> - <b>.SX</b>(sinusX files)  and <b>.SHP</b>(shape files). 
+*/
diff --git a/doc/salome/gui/HYDRO/import_profile.h b/doc/salome/gui/HYDRO/import_profile.h
new file mode 100644 (file)
index 0000000..5377ea4
--- /dev/null
@@ -0,0 +1,41 @@
+
+/**
+  @file
+  \brief Help for the import profile
+*/
+
+/**
+  \page import_profile  Import profile
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  Import profiles in HYDROGUI module from external file is accessible via:<ul>
+  <li>The main menu <b>HYDRO => Profile => Import profiles</b>;</li>
+  <li>Context menu of PROFILES in Object browser - <b>Import profiles</b>;</li>
+  <li><b>Import profiles from file(s)</b> toolar button.</li> 
+
+\image html import_profile_toolbar_button.png "Import profiles from file(s) toolbar button"
+  </ul>
+
+  <b>Import profile</b> dialog box appears:
+   \image html import_profile_dialog_box.png "Import profile dialog box"
+
+The user selects folder in <b>Look in</b> filed and one or several desired file in this folder.
+
+The user clicks <b>Open</b> button.
+
+<b>Open File</b> dialog box is closed. Selected profile(s) appear(s) in Object browser. 2D profiles names are colored in red, 3D profile names with georteferncement are colored in black.
+
+\image html imported_profiles.png "Imported profiles in Object browser"
+
+The profile file format is text where each line corresponds to one point in the profile. 
+
+Depending on number of values in line two use cases can be distinguished: <ul>
+
+<li>   2D case -  each line contains 2 double values  (parametric case).  Note, that the X values should increase so if the current value is less than previous it can be  interpreted as start of new profile.</li>
+<li>   3D case - each line contains 3 double values. First and last points are interpreted as points of georeferencement: first point is G (left bank), last point is D (right bank). The intermediate points should be recalculated to parametric presentation according to rule: the profile is straight segment on plan, and for each point U is equal to distance from the current point to the first point and Z is taken as is from the file.</li>
+ </ul>
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/import_strickler_table.h b/doc/salome/gui/HYDRO/import_strickler_table.h
new file mode 100644 (file)
index 0000000..809f941
--- /dev/null
@@ -0,0 +1,27 @@
+
+/**
+  @file
+  \brief Help for the import strickler table
+*/
+
+/**
+  \page import_strickler_table Import strickler table
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  It is possible to import strickler table in HYDROGUI module. This operation is accessible via:<ul>
+  <li>The main menu <b>HYDRO => Import strickler table</b>;</li>
+  <li> Context menu of <b>STRICKLER TABLES</b> in Object browser => <b>Import strickler table</b>;</li>
+  <li><b>Import strickler table</b> toolar button. \image html import_strickler_table_toolbar_button.png "Import strickler table toolbar button"</li>
+  </ul>
+
+  <b>Import strickler table</b> input panel looks like:
+   \image html import_strickler_table_input_panel.png "Import strickler table input panel"
+ Arguments of the input panel: 
+<b>File name</b> - field to define file to import;<br>
+<b>Name</b> - field to define the name of strickler table object after import. By default - the name of the file;<br>
+<b>Apply</b> - button to create strickler table object;<br>
+<b>Apply and Close</b> - button to create strickler table object and close input panel;<br>
+<b>Close</b> - button to close input panel.<br>
+*/
diff --git a/doc/salome/gui/HYDRO/land_cover.h b/doc/salome/gui/HYDRO/land_cover.h
new file mode 100644 (file)
index 0000000..acd21e8
--- /dev/null
@@ -0,0 +1,13 @@
+/**
+  @file
+  \brief Help for the land cover
+*/
+
+/**
+  \page land_cover Land cover
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/load_script.h b/doc/salome/gui/HYDRO/load_script.h
new file mode 100644 (file)
index 0000000..3ae2ccb
--- /dev/null
@@ -0,0 +1,27 @@
+
+/**
+  @file
+  \brief Help for the load script
+*/
+
+/**
+  \page load_script Load script
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  The HYDROGUI module supports loading Python scripts. This operation can be called via:<ol>
+  <li> The main menu <b>File => Load script</b>;</li>
+  <li> <b>CTRL + T</b> buttons combination;</li>
+  </ol>
+  
+  
+  <b>Load python script</b> dialog box looks like:
+  
+  \image html load_python_script_dialog_box.png "Load python script dialog box"
+  
+  When script loading is done, according message appears in Python console. In case of problems during loading, error appears in Python console.
+  
+  \image html python_console.png "Python console"
+  
+    <a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/local_cs.h b/doc/salome/gui/HYDRO/local_cs.h
new file mode 100644 (file)
index 0000000..1c537c3
--- /dev/null
@@ -0,0 +1,31 @@
+
+/**
+  @file
+  \brief Help for the local CS
+*/
+
+/**
+  \page local_cs Local CS
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+
+  The HYDROGUI module allows the user to change local coordinate system to avoid big numbers with Lambert 93 coordinates.<br>
+  For this <b>Local CS transformation</b> input panel should be called via:<ul>
+  <li> The main menu <b>HYDRO => Change local CS</b>;</li>
+  <li>Context menu of <b>HYDRO</b> in Object browser => <b> Change local CS</b>.</li>
+  </ul>  
+<b>Local CS transformation</b> input panel looks like: 
+
+  \image html local_cs_transformation_input_panel.png "Local CS transformation input panel"
+  
+   Arguments of the input panel: <br>  
+   
+   <b>LX</b> - spin-box to define value of OX in local CS;<br>
+   <b>LY</b> - spin-box to define value of OY in local CS.<br>
+   <b>Apply</b> - button to transform local coordinate system;<br>
+   <b>Apply and Close</b> - button to transform local coordinate system and close input panel;<br>
+   <b>Close</b> - button to close input panel.
+   
+<a href="index.html"><b>Back to Main page.</b></a>
+
+*/
index 9e6ec0e387371c70133d2ba39cc9db91959b152c..f57f067382aade068d9ed6213ec9d3a1bbdf3206 100644 (file)
 
   The HYDROGUI module supports the following objects:
   - \ref imzone "Immersible zone"
+  - \ref p_profile "Profile"
+       - \ref create_profile  "Create profile"
+        - \ref import_profile  "Import profile"
+        - \ref georeferencement_profile  "Profile georeferencement"
+  - \ref art_digue "Digue"
+  - \ref art_channel "Channel"
+  - \ref obstacle  "Obstacle"
+        - \ref box_obstacle  "Create Box obstacle"
+       - \ref cylinder_obstacle  "Create Cylinder obstacle"
+       - \ref import_obstacle_GEOM  "Import obstacle from GEOMETRY"
+       - \ref import_obstacle  "Import obstacle from file"
+       - \ref translate_obstacle "Translation of an obstacle"
+
+
+  - \ref polyline3d "Polyline 3D"
+  - \ref polyline "Polyline"
+       - \ref export_polyline "Export polyline"
+       - \ref import_polyline "Import polyline"
+  - \ref bathymetry "Bathymetry"
+  - \ref strickler_table "Strickler table"
+       - \ref export_strickler_table "Export strickler table"
+       - \ref import_strickler_table "Import strickler table"  
+  - \ref stream "Stream"
+       - \ref impimage "Find bottom"
+       - \ref profilesinterpolation "Profiles interpolation"
+  - \ref image "Image"
+       - \ref impimage "Import image"
+       - \ref fuseimages "Fuse images"
+       - \ref cutimages "Cut images"
+       - \ref splitimage "Split image"
+ - \ref calculation_case "Calculation case"
+
+The HYDROGUI module supports the following \ref general_services "services":<br>
+
+
+  - \ref general_services "General services"
+        - \ref preferences  "Preferences"
+       - \ref save "Save file"
+       - \ref open "Open file"
+       - \ref dump_study "Dump study"
+       - \ref load_script "Load script"
+       - \ref undo_redo "Undo/Redo actions"
+       - \ref copy_paste "Copy/Paste object(s)"
+       - \ref delete "Delete object(s)"
+       - \ref color "Color object"
+       - \ref show_hide "Show/Hide object(s)"
+       - \ref update "Update object"
+       - \ref rename "Rename object"
+       - \ref submersible "Submersible"
+       - \ref copy_position "Copy position"
+       - \ref change_layer_order "Change layer order"
+       - \ref local_cs "Local CS"
+
+
 */
diff --git a/doc/salome/gui/HYDRO/obstacle.h b/doc/salome/gui/HYDRO/obstacle.h
new file mode 100644 (file)
index 0000000..3a2d283
--- /dev/null
@@ -0,0 +1,29 @@
+
+/**
+  @file
+  \brief Help for the obstacle
+*/
+
+/**
+  \page obstacle Obstacle
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+ In the HYDROGUI module obstacle is 3D object created in or imported from Geometry module or from external file. 
+  
+ The HYDROGUI module supports the following techniques of obstacles creation:
+
+
+  - \ref box_obstacle  "Create Box obstacle"
+  - \ref cylinder_obstacle  "Create Cylinder obstacle"
+  - \ref import_obstacle_GEOM  "Import obstacle from GEOMETRY"
+  - \ref import_obstacle  "Import obstacle from file"
+  - \ref translate_obstacle "Translation of an obstacle"
+  
+   The obstacle is presented as the 2D face and 3D object.
+   \image html box_presentation.png  "Box obstacle example" 
+  
+ <a href="index.html"><b>Back to Main page.</b></a>
+
+*/
diff --git a/doc/salome/gui/HYDRO/open_file.h b/doc/salome/gui/HYDRO/open_file.h
new file mode 100644 (file)
index 0000000..7e0c980
--- /dev/null
@@ -0,0 +1,38 @@
+
+/**
+  @file
+  \brief Help for the open file
+*/
+
+/**
+  \page open Open file
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+   The HYDROGUI module supports opening documents. This operation can be called via:<ol>
+  <li> The main menu <b>File => Open</b>;</li>
+  <li> <b>CTRL + O</b> buttons combination;</li>
+  <li> <b>Open document</b> toolar button. </li> 
+  \image html open_document_toolbar_button.png "Open document toolbar button"
+  </ol>
+  
+  In case if there is an active study in the session, <b>Close active study</b> warning appears:
+  \image html close_active_study_warning.png "Close active study warning"
+  
+  <b>Save & Close</b> - button to save active study and open new file;<br> 
+  <b>Close w/o saving</b> - button to ingore saving active study and open new file;<br>
+  <b>Cancel</b> - button to reject opening new file.br>
+  
+  <b>Open file</b> dialog box looks like:
+  \image html open_file_dialog_box.png "Save file dialog box"  
+  
+  <b>Supported format: .HDF</b><br>
+  
+  Additionally, <b>Reopen file</b> operation is supported. It can be called from the main menu <b>File => Reopen</b>. After that dialog box appears, clarifying the user's desire to reopen document:
+  \image html reopen_file_dialog_box.png "Reopen file dialog box" 
+  
+  <b>Yes</b> - button to reopen file and lost all not saved data;<br>
+  <b>No</b> - button to reject reopening.<br>
+  
+  <a href="index.html"><b>Back to Main page.</b></a> 
+*/
diff --git a/doc/salome/gui/HYDRO/polyline.h b/doc/salome/gui/HYDRO/polyline.h
new file mode 100644 (file)
index 0000000..9784226
--- /dev/null
@@ -0,0 +1,101 @@
+
+/**
+  @file
+  \brief Help for the polyline
+*/
+
+/**
+  \page polyline Polyline
+  
+   <a href="index.html"><b>Back to Main page.</b></a>
+  
+  The polyline creation is available only in the OCC viewer.
+
+  <b>Create polyline</b> input panel can be opened via:<ol>
+  <li> The main menu <b>HYDRO => Create polyline</b>;
+  <li> Context menu of <b>POLYLINES</b> in Object browser => <b>Create polyline</b>;
+  <li> <b>Create polyline</b> toolar button.\image html create_polyline_toolbar_button.png "Create polyline toolbar button"
+  </ol> 
+   
+  Arguments of the input panel: 
+
+  \image html create_polyline_input_panel.png "Create polyline input panel"
+  
+  <b>Name</b> - field to define the polyline name;<br>
+    <b>Apply</b> - button to create polyline;<br>
+<b>Apply and Close</b> - button to create polyline and close input panel;<br>
+<b>Close</b> - button to close input panel.<br>
+  The polyline creation starts by creation of one or several sections. For adding new section it's necessary to click <b>Insert new section</b> button. \image html insert_new_section_button.png "Insert new section toolbar button"
+  
+  <b>Add element</b> panel is necessary to define parameters of section.
+  
+  \image html add_element_panel.png "Add element panel"
+  
+  <b>Name</b> - field to define the section name;<br>
+  <b>Type</b> - combo-box to define type of section: <b>Polyline</b> or <b>Spline</b>;<br>
+  <b>Closed</b> - if this checkbox is OFF, new section will be open. If checkbox is ON, new section will be closed;<br>
+  <b>Add</b> - button to add new section into the list.<br>
+  
+  A polyline may include several sections not connected with each other.
+  
+  3 modes are available for work with points:<ol>
+  <li><b>Addition mode</b></li><br>
+  In this mode only point’s creation is available. Can be activated by <b>Addition mode</b> button clicking.<br/> \image html addition_mode_button.png "Addition mode toolbar button"
+  Each time when user clicks left mouse button in the viewer a new point is created (the plane X,Y, i.e. Z = 0 should be used for coordinates obtaining). The point is added always to the end of points list.
+  Note that addition of points is performed always to the current (selected) section of the polyline. User should select in the dialog box another section to start points addition to it.
+  <li><b>Modification mode</b></li><br>
+  In this mode the user can edit the built sections and points of the polyline. Can be activated by <b>Modification mode</b> button clicking.<br/>\image html modification_mode_button.png "Modification mode toolbar button"
+       <ul>
+       <li>When user selects a point (or several points) in viewer, its coordinates are shown in the input panel in the table, so the user can change it directly using table cell widgets;</li>
+       <li>When user clicks on existing segment, a new point should be added inside this segment with coordinates corresponding to mouse position; the new point is inserted between segment tail points;</li>
+       <li>When user selects one or several points in viewer, he can activate the “drag-n-drop” mode (holding the mouse left button) to move all selected points inside the plane X, Y;</li>
+       <li>The rectangular and additive (holding Ctrl button) selections should be available for points;</li>
+       <li>User can remove points selecting one or several points and pressing “Delete” on keyboard or calling the popup menu and clicking on operation “Delete”.</li>
+       </ul>
+       \image html modif_mode_table.png "Table with coordinates"
+  <li><b>Detection mode</b></li><br>
+  TO BE UPDATED
+  </ol>
+  
+  Another operations are available during creation/edition of polyline:<ul>
+  <li><b>Undo</b></li><br>
+  Undoes last action.
+  \image html undo_button.png "Undo toolbar button"
+  <li><b>Redo</b></li><br>
+  Redoes last undoing.
+  \image html redo_button.png "Redo toolbar button"
+  <li><b>Remove</b></li><br>
+  Can be called by <b>Remove</b> button clicking.
+  \image html remove_button.png "Remove toolbar button"
+  Removes selected section(s) if no mode is activated.<br>
+  Removes selected points if modification mode is activated.<br>
+  <li><b>Join selected sections</b></li><br>
+  Can be called with help of:<ul>
+  <li><b>Join selected sections</b> toolbar button, if 2 or more selected sections are selected in the list</li>;<br>
+  \image html join_selected_sections_button.png "Join selected sections toolbar button"
+  <li><b>Join</b> command, called from context menu of 2 or more selected sections</li>;<br>
+  </ul>
+  Joines sections selected in the list inside <b>Sections</b> area, creating one section.
+  <li><b>Join all sections</b></li><br>
+  Can be called with help of <b>Join all sections</b> command  from context menu inside <b>Sections</b> area.<br>
+  Joines all existing sections, having creating one section having type closed polyline.<br> 
+  <li><b>Clear all</b></li><br>
+  Can be called only if modification mode is activated from context menu inside <b>Sections</b> area.<br>
+  <li><b>Set closed</b></li><br>
+  Can be called only if modification mode is activated from context menu of selected section(s).<br>
+  Modifies selected section into closed.  
+  <li><b>Set open</b></li><br>
+  Can be called only if modification mode is activated from context menu of selected section(s).<br>
+  Modifies selected section into open.  
+  <li><b>Set polyline</b></li><br>
+  Can be called only if modification mode is activated from context menu of selected section(s).<br>
+  Modifies selected section into polyline.  
+  <li><b>Set spline</b></li><br>
+  Can be called only if modification mode is activated from context menu of selected section(s).<br>
+  Modifies selected section into spline. 
+  </ul>
+ Additionally, the HYDROGUI module supports \ref export_polyline "export" and \ref import_polyline "import polyline".
+ <a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/polyline3d.h b/doc/salome/gui/HYDRO/polyline3d.h
new file mode 100644 (file)
index 0000000..a2ed3e4
--- /dev/null
@@ -0,0 +1,39 @@
+
+/**
+  @file
+  \brief Help for the polyline 3d
+*/
+
+/**
+  \page polyline3d Polyline 3D
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+The polyline 3D object is used as guide line for creation of channel or digue.<br>
+Creation of polyline 3D is available only in the OCC viewer.<br>
+  <b>Create polyline 3D</b> input panel can be opened via:<ol>
+  <li> The main menu <b>HYDRO => Create polyline 3D</b>;
+  <li> Context menu of <b>POLYLINES 3D</b> in Object browser => <b>Create polyline 3D</b>;
+  <li> <b>Create polyline 3D</b> toolar button.\image html create_polyline_3d_toolbar_button.png "Create polyline 3D toolbar button"
+  </ol> 
+   
+  Arguments of the input panel: 
+
+  \image html create_polyline_3d_input_panel.png "Create polyline 3D input panel"
+  
+<b>Name</b> - field for defining the name of polyline 3D;<br>
+<b>Apply</b> - button to create polyline 3D;<br>
+<b>Apply and Close</b> - button to create polyline 3D and close input panel;<br>
+<b>Close</b> - button to close input panel.<br>
+
+Following parameters have to be defined to create polyline 3d object:<ul>
+<li><b>Polyline</b></li> - any polyline object can be selected in this field;
+<li><b>Profile</b> or <b>Bathymetry</b> - one of this fields should be filled by any profile or bathymetry accordingly.</li>
+</ul>
+
+<b>Example</b>:<br>
+  
+\image html polyline_3d_example.png "Polyline 3D example"
+
+<a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/preferences.h b/doc/salome/gui/HYDRO/preferences.h
new file mode 100644 (file)
index 0000000..dc5a065
--- /dev/null
@@ -0,0 +1,64 @@
+
+/
+/**
+  @file
+  \brief Help for the HYDRO module Preferences
+*/
+
+/**
+  \page preferences Preferences
+
+ <a href="index.html"><b>Back to Main page</b></a>
+
+
+  Salome application supports Preferences. The Preferences dialog box can be called via:<ol>
+
+  <li> The main menu <b>File => Preferences</b>;  </li>
+  
+  <li> <b>CTRL + R</b> buttons combination.</li>
+ </ol>
+  
+  
+
+  <b>Preferences</b> dialog box appears. Help for all sections of  <b>Preferences</b> dialog box except HYDRO can be found in Introduction to Salome platform.
+
+The user selects <b>HYDRO</b> in Available preferences section:
+ \image html preferences.png  "Preferences dialog box"
+  
+
+ Controls inside <b>Preferences</b> dialog box:
+
+<b>Type</b> - combo - box to select the cursor presentation for edition operation;<br>
+
+\image html preferences_type.png  "Type combo-box in Preferences dialog box"
+
+<b>Make automatic fit all after show object operation</b> - check - box swith on/off Fit all;<br>
+<b>Default Strickler coefficient</b> field is used for Strickler coefficient asigned to area not covered by land cover or land cover with undefined type;<br>
+<b>OK</b> - button to validate changes and close dialog box;<br>
+<b>Apply</b> - button to validate changes;<br>
+<b>Defaults</b> - button to restore default values in all fields;<br>
+<b>Close</b> - button to close dialog box;<br>
+<b>Import</b> - button to import Preferences from external xml file.
+
+ The user clicks <b>Import</b> button. <b>Import preferences</b> dialog box appears:
+
+\image html preferences_import.png  "Import preferences dialog box"
+  
+  
+
+The user selects folder in <b>Look in</b> filed and desired file in this folder.
+
+The user clicks <b>Open</b> button.
+
+<b>Import preferences</b> dialog box is closed. Prefernces are updated.
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+
+*/
diff --git a/doc/salome/gui/HYDRO/profile.h b/doc/salome/gui/HYDRO/profile.h
new file mode 100644 (file)
index 0000000..a51466e
--- /dev/null
@@ -0,0 +1,48 @@
+
+/**
+  @file
+  \brief Help for profile
+*/
+
+/**
+  \page p_profile Profile
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+  
+The profile is used for definition of a stream cross-section or as a base of extrusion to generate a channel or digue.
+
+The 2D profiles are built/defined in a 2D space (U, Z). The coordinate U is parametric coordinate, it has no unit. The coordinate Z is real altitude (in meters). 
+
+To build 2D profile Use function
+
+  - \ref create_profile  "Create profile".
+
+
+2D profile object is internal data model object and can not be shown in OCC viewer. 2D profile  names are colored in red in object browser.
+
+
+
+Created 2D profiles should be positioned in 3D space using Georeferencement to be converted into 3D profiles:
+
+- \ref georeferencement_profile  "Profile georeferencement".
+
+
+3D profile is 3D  wire describing profile curve in 3d space.
+3D profile names are colored in black in object browser.
+
+
+Both 2D and 3D profiles can be imported from external file:
+    - \ref import_profile  "Import profile"
+ <a href="index.html"><b>Back to Main page.</b></a>
+  
+*/
+
+
+
+
+
diff --git a/doc/salome/gui/HYDRO/profile_interpolation.h b/doc/salome/gui/HYDRO/profile_interpolation.h
new file mode 100644 (file)
index 0000000..7bc9a05
--- /dev/null
@@ -0,0 +1,45 @@
+
+/**
+  @file
+  \brief Help for the find bottom
+*/
+
+/**
+  \page profilesinterpolation Profiles interpolation
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+
+  <b>Profiles interpolation</b> operation builds additional profiles to get more detailed river bed.
+  
+  <b>Profiles interpolation</b> input panel can be opened via:<ol>
+  <li> The main menu <b>HYDRO => Stream => Profiles interpolation</b>;
+  <li>Context menu of <b>Stream</b> object in Object browser - <b>Profiles interpolation</b>;</li>
+  </ol> 
+   
+ <b>Profiles interpolation</b> input panel looks like: 
+
+  \image html profiles_interpolation_input_panel.png "Profiles interpolation input panel"
+  
+ Arguments of the input panel: <br>  
+<b>Stream object</b> - combo-box to define reference stream object;<br>
+<b>Interpolator</b> - combo-box to define interpolation algorithm used. Currently only linear interpolation is accessible;<br>
+<b>Description</b> - field, describing interpolation method's features;<br> 
+<b>Profile 1</b> - combo-box to define profile, which will be the <b>start</b> of interpolation;<br>
+<b>Profile 1</b> - combo-box to define profile, which will be the <b>end</b> of interpolation;<br>
+<b>Number of profiles</b> - spin-box to define the quantity of profiles which will be created;<br>
+<b>Parameters</b> - field to set additional interpolation parameters (name as string, value as string): <ul>
+<li>complete line of parameters should be input by user as a single text line and it should be parsed by spaces i.e. for example “len 5 hypothesis linear” will give additional parameters “len” = “5”; “hypothesis” = “linear”;</li>
+<li>the sense of such parameters depends on the interpolator implementation;</li>
+<li>parameters are passed to interpolator by several calls of “set” function (for each pair name, value);</li>
+</ul>
+<b>Apply</b> - button to build stream's bottom;<br>
+<b>Apply and Close</b> - button to build stream's bottom and close input panel;<br>
+<b>Close</b> - button to close input panel.
+
+The input panel built-in viewer shows profiles from selected reference stream object and  profiles to be created during interpolation. The existing profiles are shown as black curves, the new profiles – as red curves:
+  
+\image html profile_interpolation_preview.png "Profile interpolation preview"
+
+<a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/rename.h b/doc/salome/gui/HYDRO/rename.h
new file mode 100644 (file)
index 0000000..80619d6
--- /dev/null
@@ -0,0 +1,20 @@
+
+/**
+  @file
+  \brief Help for the rename object
+*/
+
+/**
+  \page rename Rename object
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  It is possible to rename any object in HYDROGUI module.<br>
+  
+  Following ways are available for starting this action:<ol>
+  <li>Select object and push <b>F2</b> button;</li>
+  <li>Select object, call context menu and call <b>Rename</b> button;</li>
+  <li>Double click on interesting object.</li>
+  </ol>
+  
+*/
diff --git a/doc/salome/gui/HYDRO/save_file.h b/doc/salome/gui/HYDRO/save_file.h
new file mode 100644 (file)
index 0000000..cb09d80
--- /dev/null
@@ -0,0 +1,28 @@
+
+/**
+  @file
+  \brief Help for the save file
+*/
+
+/**
+  \page save Save file
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  The HYDROGUI module supports saving documents in <b>.HDF</b> format. This operation can be called via:<ol>
+  <li> The main menu <b>File => Save</b>;</li>
+  <li> <b>CTRL + S</b> buttons combination;</li>
+  <li> <b>CTRL + SHIFT + S</b> buttons combination for <b>Save As...</b> operation;</li>
+  <li> <b>Save document</b> toolar button. </li> 
+  \image html save_document_toolbar_button.png "Save document toolbar button"
+  </ol>
+  
+  <b>Save file</b> dialog box looks like:
+  \image html save_file_dialog_box.png "Save file dialog box"  
+
+  
+  In case if the user tries to save document with name already used, warning appears, suggested overwriting existing file :
+  \image html save_file_warning.png "Warning"  
+  
+    <a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/show_hide.h b/doc/salome/gui/HYDRO/show_hide.h
new file mode 100644 (file)
index 0000000..9a0090b
--- /dev/null
@@ -0,0 +1,31 @@
+
+/**
+  @file
+  \brief Help for the show/hide object
+*/
+
+/**
+  \page show_hide Show/hide object(s)
+       
+  <a href="index.html"><b>Back to Main page</b></a>:<br>
+  
+  \ref general_services "Back to general services" 
+  
+  It is possible to show and hide objects in the viewer in HYDROGUI module.<br>
+  
+  The user can show object(s) via the following commands:<ol>
+  <li><b>Show all</b></li> - shows all objects. Can be executed from context menu called from viewer or Object browser;</li>
+  <li><b>Show</b></li> -  shows  selected objects. Can be executed from context menu of selected objects;</li>
+  <li><b>Show only</b></li> - shows  selected objects and hides already shown objects. Can be executed from context menu of selected objects;</li>
+  <li><b>Eye</b> icon</li> - locates in Object browser near every object. Just click on it to show object, if it is hidden.
+  
+  \image html eye_icons.png "Eye icons of shown and hidden objects" 
+  </ol>
+  
+  The user can hide object(s) via the following commands:<ol>
+  <li><b>Hide all</b></li> - hides all objects. Can be executed from context menu called from viewer or Object browser;</li>
+  <li><b>Hide</b></li> -  hides  selected objects. Can be executed from context menu of selected objects;</li>
+  <li><b>Eye</b> icon</li> - locates in Object browser near every object. Just click on it to hide object, if it is shown.
+  </ol>
+  
+*/
diff --git a/doc/salome/gui/HYDRO/split_image.h b/doc/salome/gui/HYDRO/split_image.h
new file mode 100644 (file)
index 0000000..3d1de56
--- /dev/null
@@ -0,0 +1,34 @@
+
+/**
+  @file
+  \brief Help for the split image
+*/
+
+/**
+  \page splitimage Split image
+
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+The user can start <b>Split image</b> operation via:<ol>
+<li>The main menu <b>HYDRO - Split image</b>;
+<li>Context menu of any image in Object browser - <b>Split image</b>;
+<li><b>Split image</b> toolbar button  \image html split_image_toolbar_button.png "Split image toolbar button"
+ </ol> 
+  Arguments of the input panel: 
+  \image html split_image_input_panel.png "Split image input panel"
+  
+<b>Name</b> - field for defining the name of image after cut;<br>
+<b>Modify selected image</b> - if this checkbox is OFF, new object will be created, as result. If checkbox is ON, initial image will be modified.<br>
+<b>Image</b> - field for defining the reference image to be split;<br>
+<b>Polyline</b> - field for defining the the tool for split. Only <b>closed polylines</b> can be selected in this field; <br>
+<b>Apply</b> - button to create split image object;<br>
+<b>Apply and Close</b> - button to create split image object and close input panel;<br>
+<b>Close</b> - button to close input panel.<br>
+
+Also, it's possible to change background color of split image. For this <b>Color</b> radio button should be pushed and <b>Select color</b> dialog box should be called<br> by double clicking on the area near <b>Color</b> radio button.
+
+  \image html select_color.png "Select color dialog box"
+  
+<a href="index.html"><b>Back to Main page.</b></a>
+
+*/
diff --git a/doc/salome/gui/HYDRO/stream.h b/doc/salome/gui/HYDRO/stream.h
new file mode 100644 (file)
index 0000000..0db796e
--- /dev/null
@@ -0,0 +1,54 @@
+
+/**
+  @file
+  \brief Help for the stream
+*/
+
+/**
+  \page stream Stream
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+
+  <b>Stream</b> is a natural object simulating the river bed.
+  
+  <b>Create stream</b> input panel can be opened via:<ol>
+  <li> The main menu <b>HYDRO => Stream => Create stream</b>;
+  <li> Context menu of <b>NATURAL OBJECTS</b> in Object browser => <b>Create stream</b>;
+  <li> <b>Create steam</b> toolar button.\image html create_stream_toolbar_button.png "Create stream toolbar button"
+  </ol> 
+   
+  Arguments of the input panel: 
+
+  \image html create_stream_input_panel.png "Create stream input panel"
+  
+<b>Name</b> - field to define the stream name;<br>
+<b>Polyline</b> - combo - box to select the polyline defining the immersible zone border. The combo box contains only closed polylines allowed for the immersible zones creation.<br>
+<b>Hydraulic axis</b> - combo - box to select the polyline, which is hydraulic axis of the river. Rules are following:<ul>
+<li>Polyline should be open;</li>
+<li>Polyline should consist from one section only;</li>
+<li>Polyline cannot be self-intersected or contain sharp angles, which can lead to self-intersections in resulting shell.</li>
+</ul>
+<b>Apply</b> - button to generate stream;<br>
+<b>Apply and Close</b> - button to generate stream and close input panel;<br>
+<b>Close</b> - button to close input panel.<br>
+
+Also it's necessary to add profiles into the list. For this select one/several profiles objects in the object browser and click the button <b>Add</b>. The rules are following:<ol>
+<li>Invalid (not positioned) profiles can not be added; they are simply ignored;</li>
+<li>Profile can not be added several times to the list; such profiles are simply ignored;</li>
+<li>Each added profile should intersect with the selected hydraulic axis; if for certain profile does not intersect, it is ignored.</li>
+</ol>
+It's possible to remove added profiles from the list. For this select profile(s) in the list and click <b>Remove</b> button.<br>
+
+Generated stream object contains 3D object, simulating the river bed, and its projection on XY plane, which is used for calculation.<br>
+
+Following operations are available with stream:
+       - \ref findbottom "Find bottom"
+       - \ref profilesinterpolation "Profiles interpolation"
+
+<b>Examples</b>:<br>
+  
+\image html stream_3d_example.png "Stream 3D example"
+\image html stream_2d_example.png "Stream 2D example"
+
+<a href="index.html"><b>Back to Main page.</b></a>
+*/
diff --git a/doc/salome/gui/HYDRO/strickler_table.h b/doc/salome/gui/HYDRO/strickler_table.h
new file mode 100644 (file)
index 0000000..305c224
--- /dev/null
@@ -0,0 +1,13 @@
+
+/**
+  @file
+  \brief Help for the strickler table
+*/
+
+/**
+  \page strickler_table Strickler table
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+
+*/
diff --git a/doc/salome/gui/HYDRO/submersible.h b/doc/salome/gui/HYDRO/submersible.h
new file mode 100644 (file)
index 0000000..c799cf7
--- /dev/null
@@ -0,0 +1,21 @@
+
+/**
+  @file
+  \brief Help for the submersible
+*/
+
+/**
+  \page submersible Submersible 
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  Objects in HYDROGUI module have <b>Submersible</b> mark.<br>
+  
+  Regions, created basing on <b>submersible objects are included</b> in final geometry during export calculation case. Regions, created basing on <b>not submersible objects are excluded</b> from final geometry.<br>
+  
+  It is possible to define, is submersible the object or not, with help of its context menu and according command.
+
+\image html submersible.png "Submersible context menu command"   
+  
+  
+*/
diff --git a/doc/salome/gui/HYDRO/translate_obstacle.h b/doc/salome/gui/HYDRO/translate_obstacle.h
new file mode 100644 (file)
index 0000000..7501d32
--- /dev/null
@@ -0,0 +1,36 @@
+
+/**
+  @file
+  \brief Help for translate obstacle operation
+*/
+
+/**
+  \page translate_obstacle
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+  An obstacle can be copied and translated in the HYDROGUI module. 
+  
+
+  The <b>Translation of an obstacle</b> operation can be started via Context menu of obstacle object in Object browser - <b>Translate</b>.
+
+
+ <b>Translation of an obstacle</b> input panel appears.
+
+  \image html translate_obstacle_input_panel.png  " Translation of an obstacle input panel"
+  
+Arguments of the input panel: 
+   
+<b>Name</b> - uneditable field containing the initial obstacle name;<br>
+<b>Dx, Dy, Dz</b> - components of translation vector;<br>
+<b>Apply</b> - button to generate obstacle;<br>
+<b>Apply and Close</b> - button to generate obstacle and close input panel;<br>
+<b>Close</b> - button to close input panel.
+  
+   
+   \image html translate_obstacle_example.png   "Translation of an obstacle example" 
+
+ <a href="index.html"><b>Back to Main page.</b></a>
+  
+*/
diff --git a/doc/salome/gui/HYDRO/undo_redo.h b/doc/salome/gui/HYDRO/undo_redo.h
new file mode 100644 (file)
index 0000000..6ba9693
--- /dev/null
@@ -0,0 +1,44 @@
+
+/**
+  @file
+  \brief Help for the undo redo
+*/
+
+/**
+  \page undo_redo Undo/Redo actions
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+  The HYDROGUI module supports two levels of <b>Undo/Redo</b> functionality:<ul>
+       <li><b>Global</b> undo/redo<br>
+       Global undo reverts last operation, redo performs latest undone operation (if there is any);</li>
+       <li><b>Local</b> undo/redo - is available only for \ref create_profile "profiles" and \ref polyline "polylines" creation/edition</li>.
+  </ul>
+  
+  <b>Global Undo</b> operation can be executed  via:<ol>
+  <li> The main menu <b>Edit => Undo</b>;</li>
+  <li><b>Undo</b> toolbar button; </li>
+  
+   \image html undo_toolbar_button.png "Undo toolbar button"
+   
+   <li><b>CTRL + Z</b> buttons combination; </li>
+   <li>Selection of operations to be undone with help of <b>Undo</b> combo-box</li>
+   
+   \image html undo_combo_box.png "Undo combo-box"
+   </ol>
+   
+   <b>Global Redo</b> operation can be executed  via:<ol>
+   <li> The main menu <b>Edit => Redo</b>;</li>
+  <li><b>Redo</b> toolbar button; </li>
+  
+   \image html redo_toolbar_button.png "Redo toolbar button"
+   
+   <li><b>CTRL + Y</b> buttons combination; </li>
+   <li>Selection of operations to be redone with help of <b>Redo</b> combo-box</li>
+  </ol>
+   
+   \image html redo_combo_box.png "Redo combo-box"
+   
+   <a href="index.html"><b>Back to Main page.</b></a>
+  
+*/
diff --git a/doc/salome/gui/HYDRO/update.h b/doc/salome/gui/HYDRO/update.h
new file mode 100644 (file)
index 0000000..82f6f77
--- /dev/null
@@ -0,0 +1,27 @@
+
+/**
+  @file
+  \brief Help for the update object
+*/
+
+/**
+  \page update Update object(s)
+
+Note that objects update is not automatic in The HYDRO GUI project. 
+
+For example, in the case  when one of profiles used in Stream is changed, the Stream is marked as not updated in object browser. 
+
+\image html  not_updated_stream.png  "Not updated stream in object browser" 
+
+
+The user starts the Update operation via context menu of <b>NATURAL OBJECTS/Stream_1 </b> in Object browser => <b>Update</b>.
+
+The Stream object is updated. If the <b>Stream_1_bottom</b> polyline exists, it is also updated together with parent stream. 
+
+
+\image html  updated_stream.png  "Updated stream in object browser" 
+
+  
+  <a href="index.html"><b>Back to Main page.</b></a>
+  
+*/
index 2476f552d25ecd94120b08492090a9fbb4acead5..05da2c6777b6dff5eb2f439443a69334e3d488c7 100644 (file)
@@ -27,6 +27,7 @@ set(PROJECT_HEADERS
     HYDROData_ObstacleAltitude.h
     HYDROData_OperationsFactory.h
     HYDROData_Pipes.h
+    HYDROData_PolylineOperator.h
     HYDROData_PolylineXY.h
     HYDROData_Polyline3D.h
     HYDROData_PriorityQueue.h
@@ -52,6 +53,7 @@ set(PROJECT_HEADERS
     HYDROData_IProfilesInterpolator.h
     HYDROData_LinearInterpolator.h
     HYDROData_InterpolatorsFactory.h
+    HYDROData_SinusX.h
     shapelib/shapefil.h
 )
 
@@ -81,6 +83,7 @@ set(PROJECT_SOURCES
     HYDROData_ObstacleAltitude.cxx
     HYDROData_OperationsFactory.cxx
     HYDROData_Pipes.cxx
+    HYDROData_PolylineOperator.cxx
     HYDROData_PolylineXY.cxx
     HYDROData_Polyline3D.cxx
     HYDROData_PriorityQueue.cxx
@@ -105,6 +108,7 @@ set(PROJECT_SOURCES
     HYDROData_IProfilesInterpolator.cxx
     HYDROData_LinearInterpolator.cxx
     HYDROData_InterpolatorsFactory.cxx
+    HYDROData_SinusX.cxx
     shapelib/dbfopen.c
     shapelib/safileio.c
     shapelib/shpopen.c
@@ -133,7 +137,7 @@ include_directories(
 add_library(HYDROData SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
 target_link_libraries(HYDROData ${GEOM_GEOMUtils} ${CAS_OCAF} ${CAS_OCAFVIS} ${CAS_TKG3d} ${CAS_TKGeomBase} ${CAS_TKGeomAlgo}
                       ${CAS_TKBrep} ${CAS_TKIGES} ${CAS_TKSTEP} ${CAS_TKTopAlgo} ${CAS_TKBO} ${CAS_TKBool} ${CAS_TKOffset}
-                      ${QT_LIBRARIES} ${GUI_ImageComposer} ${CAS_TKHLR} ${GEOM_GEOM} ${GEOM_GEOMBase} )
+                      ${QT_LIBRARIES} ${GUI_ImageComposer} ${CAS_TKHLR} ${GEOM_GEOM} ${GEOM_GEOMBase} ${GEOM_CurveCreator} )
 INSTALL(TARGETS HYDROData EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS})
 
 set(PROJECT_LIBRARIES HYDROData)
index f07d10174fdd6cb4edefefea321feafcf1ad6492..5b0d4b70b6ae3e10e1ef06fae62c251485c2b4e2 100644 (file)
 //
 
 #include <HYDROData_BSplineOperation.h>
-
-#include <TColgp_HArray1OfPnt.hxx>
-
-#include <GeomAPI_Interpolate.hxx>
 #include <GeomConvert_BSplineCurveToBezierCurve.hxx>
 #include <Geom_BezierCurve.hxx>
-
+#include <gp_Pnt.hxx>
+#include <TColgp_HArray1OfPnt.hxx>
 #include <QPainterPath>
+#include <CurveCreator_Utils.hxx>
 
-HYDROData_BSplineOperation::HYDROData_BSplineOperation(
+Handle(Geom_BSplineCurve) HYDROData_BSplineOperation::ComputeCurve(
   const NCollection_Sequence<gp_XYZ>& thePoints,
   const bool                          theIsClosed,
   const double                        theTolerance )
@@ -56,18 +54,20 @@ HYDROData_BSplineOperation::HYDROData_BSplineOperation(
   }
 
   // compute BSpline
-  GeomAPI_Interpolate aGBC( aHCurvePoints, theIsClosed, gp::Resolution() );
-  aGBC.Perform();
-  if ( aGBC.IsDone() )
-    myCurve = aGBC.Curve();
+  Handle(Geom_BSplineCurve) aBSpline;
+  if( CurveCreator_Utils::constructBSpline( aHCurvePoints, theIsClosed, aBSpline ) )
+    return aBSpline;
+  else
+    return Handle(Geom_BSplineCurve)();
 }
 
-void HYDROData_BSplineOperation::ComputePath( QPainterPath& thePath ) const
+void HYDROData_BSplineOperation::ComputePath( const Handle(Geom_BSplineCurve)& theCurve,
+                                              QPainterPath& thePath )
 {
-  if ( myCurve.IsNull() ) // returns an empty Path if original curve is invalid
+  if ( theCurve.IsNull() ) // returns an empty Path if original curve is invalid
     return;
 
-  GeomConvert_BSplineCurveToBezierCurve aConverter(myCurve);
+  GeomConvert_BSplineCurveToBezierCurve aConverter(theCurve);
   int a, aNumArcs = aConverter.NbArcs();
   for(a = 1; a <= aNumArcs; a++)
   {
index f352ade53d1a4eac5e1712b299bf55a9d6797c8a..cd82a54b4e9e99cb8621f680d83f4a5006a864a2 100644 (file)
@@ -39,25 +39,14 @@ class gp_XYZ;
 class HYDRODATA_EXPORT HYDROData_BSplineOperation
 {
 public:
+  static Handle(Geom_BSplineCurve) ComputeCurve(
+    const NCollection_Sequence<gp_XYZ>& thePoints,
+    const bool                          theIsClosed,
+    const double                        theTolerance );
 
-  //! Creates a spline by list of coordinates: pairs X and Y
-  //! \param thePoints coordinates of curve
-  //! \param theIsClosed flag indicating that the result spline should be closed
-  //! \param theTolerance flag indicating the tolerance to skip equal points
-  HYDROData_BSplineOperation( const NCollection_Sequence<gp_XYZ>& thePoints,
-                              const bool theIsClosed,
-                              const double theTolerance );
-  
-  //! Returns the BSpline curve passing through the points
-  //! \returns Null if Computation of BSpline was failed
-  Handle(Geom_BSplineCurve) Curve() const { return myCurve; }
-  
   //! Performs conversion from BSpline curve to QPainterPath made from Bezier curves
   //! \returns computed PainterPath, not stored in this class, so calling of this method is not fast
-  void ComputePath( QPainterPath& thePath ) const;
-
-private:
-  Handle(Geom_BSplineCurve) myCurve; ///< resulting BSpline, null if something is wrong
+  static void ComputePath( const Handle(Geom_BSplineCurve)& theCurve, QPainterPath& thePath );
 };
 
 #endif
index f8640f813db6e919e8599a72bc4114aa716b3894..b0241aa91ba15b556d27f14eb7c47e5e85870665 100644 (file)
@@ -116,10 +116,14 @@ QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTre
 
   QString aCalculName = GetObjPyName();
 
-  AssignmentMode aMode = GetAssignmentMode();
+  AssignmentMode aMode = GetAssignmentMode();  
   QString aModeStr = aMode==MANUAL ? "HYDROData_CalculationCase.MANUAL" : "HYDROData_CalculationCase.AUTOMATIC";
   aResList << QString( "%0.SetAssignmentMode( %1 )" ).arg( aCalculName ).arg( aModeStr );
 
+  AssignmentMode aModeLC = GetAssignmentLandCoverMode();
+  QString aModeLCStr = aModeLC==MANUAL ? "HYDROData_CalculationCase.MANUAL" : "HYDROData_CalculationCase.AUTOMATIC";
+  aResList << QString( "%0.SetAssignmentLandCoverMode( %1 )" ).arg( aCalculName ).arg( aModeLCStr );
+
   HYDROData_SequenceOfObjects aGeomObjects = GetGeometryObjects();
   HYDROData_SequenceOfObjects::Iterator anIter( aGeomObjects );
   for ( ; anIter.More(); anIter.Next() )
@@ -158,6 +162,8 @@ QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTre
 
   if( aMode==AUTOMATIC )
     DumpRulesToPython( aCalculName, aResList );
+  if( aModeLC==AUTOMATIC )
+    DumpLandCoverRulesToPython( aCalculName, aResList );
 
   aResList << QString( "" );
   aResList << "# Start the algorithm of the partition and assignment";
@@ -167,7 +173,12 @@ QStringList HYDROData_CalculationCase::DumpToPython( MapOfTreatedObjects& theTre
   {
     // Now we restore the
     // - regions and zones order
-    DumpRegionsToPython( aResList, theTreatedObjects, GetRegions( false ) );
+    DumpRegionsToPython( aResList, theTreatedObjects, GetRegions( false ) );   
+  }
+
+  if( aModeLC==MANUAL )
+  {
+    // Now we restore the
     // - land cover regions and zones order
     DumpRegionsToPython( aResList, theTreatedObjects, GetRegions( true ) );
   }
@@ -308,14 +319,23 @@ void HYDROData_CalculationCase::Update()
   switch( GetAssignmentMode() )
   {
   case MANUAL:
-    CreateRegionsDef( aDocument, aZonesList, false );
+    CreateRegionsDef( aDocument, aZonesList, false );    
+    break;
+  case AUTOMATIC:
+    CreateRegionsAuto( aDocument, aZonesList, false );    
+    break;
+  }
+
+  switch( GetAssignmentLandCoverMode() )
+  {
+  case MANUAL:
     CreateRegionsDef( aDocument, aLandCoverZonesList, true );
     break;
   case AUTOMATIC:
-    CreateRegionsAuto( aDocument, aZonesList, false );
     CreateRegionsAuto( aDocument, aLandCoverZonesList, true );
     break;
   }
+
   CreateEdgeGroupsDef( aDocument, anEdgesList );
 }
 
@@ -690,7 +710,8 @@ void HYDROData_CalculationCase::UpdateRegionsOrder()
     return;
 
   HYDROData_SequenceOfObjects aRegions = GetRegions( false );
-  aRegions.Append( GetRegions( true ) );
+  HYDROData_SequenceOfObjects aRegionsLC = GetRegions( true );
+  aRegions.Append( aRegionsLC );
 
   HYDROData_SequenceOfObjects::Iterator anIter( aRegions );
   for ( ; anIter.More(); anIter.Next() )
@@ -1038,14 +1059,15 @@ QString HYDROData_CalculationCase::Export( int theStudyId ) const
   GEOM::GEOM_Gen_var aGEOMEngine = HYDROData_GeomTool::GetGeomGen();
   SALOMEDS::Study_var aDSStudy = HYDROData_GeomTool::GetStudyByID( theStudyId );
   
-  QString aGeomObjEntry;
-  bool isOK = Export( aGEOMEngine, aDSStudy, aGeomObjEntry );
+  QString aGeomObjEntry, anErrorMsg;
+  bool isOK = Export( aGEOMEngine, aDSStudy, aGeomObjEntry, anErrorMsg );
   return isOK ? aGeomObjEntry : QString();
 }
 
 bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var  theGeomEngine,
                                         SALOMEDS::Study_ptr theStudy,
-                                        QString& theGeomObjEntry ) const
+                                        QString& theGeomObjEntry,
+                                        QString& theErrorMsg ) const
 {
   HYDROData_ShapesGroup::SeqOfGroupsDefs aSeqOfGroupsDefs;
 
@@ -1070,6 +1092,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var  theGeomEngine,
   }
   
   // Get faces
+  bool isAllNotSubmersible = true;
   TopTools_ListOfShape aFaces;
   HYDROData_SequenceOfObjects aCaseRegions = GetRegions( false );
   HYDROData_SequenceOfObjects::Iterator aRegionIter( aCaseRegions );
@@ -1079,12 +1102,25 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var  theGeomEngine,
       Handle(HYDROData_Region)::DownCast( aRegionIter.Value() );
     if( aRegion.IsNull() || !aRegion->IsSubmersible() )
       continue;
+    
+    if ( isAllNotSubmersible )
+      isAllNotSubmersible = false;
 
     TopoDS_Shape aRegionShape = aRegion->GetShape( &aSeqOfGroupsDefs );
     aFaces.Append( aRegionShape );
   }
 
-  return Export( theGeomEngine, theStudy, aFaces, aSeqOfGroupsDefs, theGeomObjEntry );
+  bool aRes = false;
+
+  if ( aCaseRegions.IsEmpty() ) {
+    theErrorMsg = QString("the list of regions is empty.");
+  } else if ( isAllNotSubmersible ) {
+    theErrorMsg = QString("there are no submersible regions.");
+  } else {
+    aRes = Export( theGeomEngine, theStudy, aFaces, aSeqOfGroupsDefs, theGeomObjEntry );;
+  }
+
+  return aRes;
 }
 
 bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var                            theGeomEngine,
@@ -1145,7 +1181,7 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var
   // Publish the sewed shape
   QString aName = EXPORT_NAME;
   GEOM::GEOM_Object_ptr aMainShape = 
-    publishShapeInGEOM( theGeomEngine, theStudy, aSewedShape, aName, theGeomObjEntry );
+    HYDROData_GeomTool::publishShapeInGEOM( theGeomEngine, theStudy, aSewedShape, aName, theGeomObjEntry );
 
   if ( aMainShape->_is_nil() )  
     return false;
@@ -1242,52 +1278,6 @@ bool HYDROData_CalculationCase::Export( GEOM::GEOM_Gen_var
   return true;
 }
 
-GEOM::GEOM_Object_ptr HYDROData_CalculationCase::publishShapeInGEOM( 
-  GEOM::GEOM_Gen_var theGeomEngine, SALOMEDS::Study_ptr theStudy,
-  const TopoDS_Shape& theShape, const QString& theName,
-  QString& theGeomObjEntry ) const
-{
-  theGeomObjEntry = "";
-  GEOM::GEOM_Object_var aGeomObj;
-
-  if ( theGeomEngine->_is_nil() || theStudy->_is_nil() ||
-       theShape.IsNull() ) {
-    return aGeomObj._retn();
-  }
-
-  std::ostringstream aStreamShape;
-  // Write TopoDS_Shape in ASCII format to the stream
-  BRepTools::Write( theShape, aStreamShape );
-  // Returns the number of bytes that have been stored in the stream's buffer.
-  int aSize = aStreamShape.str().size();
-  // Allocate octect buffer of required size
-  CORBA::Octet* anOctetBuf = SALOMEDS::TMPFile::allocbuf( aSize );
-  // Copy ostrstream content to the octect buffer
-  memcpy( anOctetBuf, aStreamShape.str().c_str(), aSize );
-  // Create TMPFile
-  SALOMEDS::TMPFile_var aSeqFile = new SALOMEDS::TMPFile( aSize, aSize, anOctetBuf, 1 );
-
-  // Restore shape from the stream and get the GEOM object
-  GEOM::GEOM_IInsertOperations_var anInsOp = theGeomEngine->GetIInsertOperations( theStudy->StudyId() );
-  aGeomObj = anInsOp->RestoreShape( aSeqFile );
-  
-  // Puplish the GEOM object
-  if ( !aGeomObj->_is_nil() ) {
-    QString aName = HYDROData_GeomTool::GetFreeName( theStudy, theName );
-
-    SALOMEDS::SObject_var aResultSO = 
-      theGeomEngine->PublishInStudy( theStudy, SALOMEDS::SObject::_nil(), 
-                                     aGeomObj, qPrintable( aName ) );
-    if ( aResultSO->_is_nil() ) {
-      aGeomObj = GEOM::GEOM_Object::_nil();
-    }
-    else
-      theGeomObjEntry = aResultSO->GetID();
-  }
-
-  return aGeomObj._retn();
-}
-
 void HYDROData_CalculationCase::ClearRules( HYDROData_CalculationCase::DataTag theDataTag,
                                             const bool theIsSetToUpdate )
 {
@@ -1319,6 +1309,12 @@ QString HYDROData_CalculationCase::DumpRules() const
   return HYDROData_PriorityQueue::DumpRules( aRulesLab );
 }
 
+QString HYDROData_CalculationCase::DumpLandCoverRules() const
+{
+  TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomLandCoverRules );
+  return HYDROData_PriorityQueue::DumpRules( aRulesLab );
+}
+
 void HYDROData_CalculationCase::SetAssignmentMode( AssignmentMode theMode )
 {
   TDF_Label aModeLab = myLab.FindChild( DataTag_AssignmentMode );
@@ -1345,6 +1341,13 @@ void HYDROData_CalculationCase::DumpRulesToPython( const QString& theCalcCaseNam
   HYDROData_PriorityQueue::DumpRulesToPython( aRulesLab, theCalcCaseName, theScript );
 }
 
+void HYDROData_CalculationCase::DumpLandCoverRulesToPython( const QString& theCalcCaseName,
+                                                            QStringList& theScript ) const
+{
+  TDF_Label aRulesLab = myLab.FindChild( DataTag_CustomLandCoverRules );
+  HYDROData_PriorityQueue::DumpRulesToPython( aRulesLab, theCalcCaseName, theScript );
+}
+
 HYDROData_Warning HYDROData_CalculationCase::GetLastWarning() const
 {
   return myLastWarning;
index 97c6a35cc15146d518492b2a2e0913b69906f1e3..77c1481d0ad38929a17cbadec8c8116f850eef46 100644 (file)
@@ -297,11 +297,14 @@ public:
    * Exports the calculation case data (shell and groups) to GEOM module.
    * \param theGeomEngine GEOM module engine
    * \param theStudy SALOMEDS study, is used for publishing of GEOM objects
+   * \param theGeomObjEntry the published GEOM object entry
+   * \param theErrorMsg the error message
    * \return true in case of success
    */
   HYDRODATA_EXPORT virtual bool Export( GEOM::GEOM_Gen_var  theGeomEngine,
                                         SALOMEDS::Study_ptr theStudy,
-                                        QString& theGeomObjEntry ) const;
+                                        QString& theGeomObjEntry,
+                                        QString& theErrorMsg ) const;
 
 public:      
   // Public methods to work with Calculation services
@@ -409,6 +412,7 @@ public:
   HYDRODATA_EXPORT AssignmentMode GetAssignmentLandCoverMode() const;
 
   HYDRODATA_EXPORT QString DumpRules() const;
+  HYDRODATA_EXPORT QString DumpLandCoverRules() const;
 
   HYDRODATA_EXPORT HYDROData_Warning GetLastWarning() const;
 
@@ -441,21 +445,7 @@ private:
                const TopTools_ListOfShape&                   theFaces,
                const HYDROData_ShapesGroup::SeqOfGroupsDefs& theGroupsDefs,
                QString& theGeomObjEntry ) const;
-
-  /**
-   * Publish the given shape in GEOM as a GEOM object.
-   * \param theGeomEngine GEOM module engine
-   * \param theStudy SALOMEDS study, used for publishing of the shape
-   * \param theShape the shape to publish as a GEOM object
-   * \param theName the name of the published object
-   * \return the published GEOM object
-   */
-  GEOM::GEOM_Object_ptr publishShapeInGEOM( GEOM::GEOM_Gen_var  theGeomEngine,
-                                            SALOMEDS::Study_ptr theStudy,
-                                            const TopoDS_Shape& theShape, 
-                                            const QString&      theName,
-                                            QString& theGeomObjEntry ) const;
-
+  
   void CreateRegionsDef( const Handle(HYDROData_Document)& theDoc,
                          const HYDROData_SplitToZonesTool::SplitDataList& theZones,
                          const bool theLandCover );
@@ -467,6 +457,7 @@ private:
                             const HYDROData_SplitToZonesTool::SplitDataList& theEdges );
 
   void DumpRulesToPython( const QString& theCalcCaseName, QStringList& theScript ) const;
+  void DumpLandCoverRulesToPython( const QString& theCalcCaseName, QStringList& theScript ) const;
 
   void SetWarning( HYDROData_WarningType theType = WARN_OK, const QString& theData = "" );
 
index 9394f1b60552e99ad12695169843338d5350c274..f79ebad255f8940ff683d38d228914a99e8e884c 100644 (file)
@@ -19,7 +19,6 @@
 #ifndef HYDROData_Document_HeaderFile
 #define HYDROData_Document_HeaderFile
 
-#include <HYDROData.h>
 #include <HYDROData_Entity.h>
 
 #include <TDocStd_Document.hxx>
index 10c0bf4ca90b029ea409f5201125a0c3b8199ae6..a83258e61f7bff4b896da5ca198a886e923faee6 100644 (file)
@@ -20,6 +20,8 @@
 
 #include <TopoDS_Shape.hxx>
 
+#include <BRepTools.hxx>
+
 #include <SALOME_NamingService.hxx>
 #include <SALOME_LifeCycleCORBA.hxx>
 
@@ -106,4 +108,90 @@ QString HYDROData_GeomTool::GetFreeName( SALOMEDS::Study_ptr theStudy, const QSt
   }
 
   return aName;
-}
\ No newline at end of file
+}
+
+GEOM::GEOM_Object_ptr HYDROData_GeomTool::publishShapeInGEOM( 
+  GEOM::GEOM_Gen_var theGeomEngine, SALOMEDS::Study_ptr theStudy,
+  const TopoDS_Shape& theShape, const QString& theName,
+  QString& theGeomObjEntry )
+{
+  theGeomObjEntry = "";
+  GEOM::GEOM_Object_var aGeomObj;
+
+  if ( theGeomEngine->_is_nil() || theStudy->_is_nil() ||
+       theShape.IsNull() ) {
+    return aGeomObj._retn();
+  }
+
+  std::ostringstream aStreamShape;
+  // Write TopoDS_Shape in ASCII format to the stream
+  BRepTools::Write( theShape, aStreamShape );
+  // Returns the number of bytes that have been stored in the stream's buffer.
+  int aSize = aStreamShape.str().size();
+  // Allocate octect buffer of required size
+  CORBA::Octet* anOctetBuf = SALOMEDS::TMPFile::allocbuf( aSize );
+  // Copy ostrstream content to the octect buffer
+  memcpy( anOctetBuf, aStreamShape.str().c_str(), aSize );
+  // Create TMPFile
+  SALOMEDS::TMPFile_var aSeqFile = new SALOMEDS::TMPFile( aSize, aSize, anOctetBuf, 1 );
+
+  // Restore shape from the stream and get the GEOM object
+  GEOM::GEOM_IInsertOperations_var anInsOp = theGeomEngine->GetIInsertOperations( theStudy->StudyId() );
+  aGeomObj = anInsOp->RestoreShape( aSeqFile );
+  
+  // Publish the GEOM object
+  theGeomObjEntry = publishGEOMObject( theGeomEngine, theStudy, aGeomObj, theName );
+  
+  return aGeomObj._retn();
+}
+
+ GEOM::GEOM_Object_ptr HYDROData_GeomTool::createFaceInGEOM( GEOM::GEOM_Gen_var theGeomEngine,
+                                                             SALOMEDS::Study_ptr theStudy,
+                                                             const int theWidth,
+                                                             const int theHeight,
+                                                             const QString& theName,
+                                                             QString& theFaceEntry )
+{
+  theFaceEntry = "";
+  GEOM::GEOM_Object_var aGeomObj;
+
+  if ( theGeomEngine->_is_nil() || theStudy->_is_nil() ) {
+    return aGeomObj._retn();
+  }
+
+  GEOM::GEOM_IBasicOperations_var aBasicOperations = theGeomEngine->GetIBasicOperations( theStudy->StudyId() );
+  GEOM::GEOM_IBlocksOperations_var aBlocksOperations = theGeomEngine->GetIBlocksOperations( theStudy->StudyId() );
+         
+  GEOM::GEOM_Object_var P1 = aBasicOperations->MakePointXYZ( -0.5 * theWidth, -0.5 * theHeight, 0 );
+  GEOM::GEOM_Object_var P2 = aBasicOperations->MakePointXYZ(  0.5 * theWidth, -0.5 * theHeight, 0 );
+  GEOM::GEOM_Object_var P3 = aBasicOperations->MakePointXYZ(  0.5 * theWidth,  0.5 * theHeight, 0 );
+  GEOM::GEOM_Object_var P4 = aBasicOperations->MakePointXYZ( -0.5 * theWidth,  0.5 * theHeight, 0 );
+  
+  GEOM::GEOM_Object_var aFace = aBlocksOperations->MakeQuad4Vertices( P1, P2 ,P3, P4 );
+    
+  // Publish the face
+  theFaceEntry = publishGEOMObject( theGeomEngine, theStudy, aFace, theName );
+
+  return aFace._retn();
+}
+
+QString HYDROData_GeomTool::publishGEOMObject( GEOM::GEOM_Gen_var theGeomEngine,
+                                               SALOMEDS::Study_ptr theStudy,
+                                               GEOM::GEOM_Object_ptr theGeomObj,
+                                               const QString& theName )
+{
+  QString anEntry;
+
+  if ( !theGeomObj->_is_nil() ) {
+    QString aName = HYDROData_GeomTool::GetFreeName( theStudy, theName );
+
+    SALOMEDS::SObject_var aResultSO = 
+      theGeomEngine->PublishInStudy( theStudy, SALOMEDS::SObject::_nil(), 
+                                     theGeomObj, qPrintable( aName ) );
+    if ( !aResultSO->_is_nil() ) {
+      anEntry = aResultSO->GetID();
+    }
+  }
+
+  return anEntry;
+}
index ea4cb95d39dad7d48fbecb721958a8cbc6418aea..554aede3c7e5b6209191433586af4deb31a66b5c 100644 (file)
@@ -58,6 +58,52 @@ public:
    * \return the default name
    */
   static QString GetFreeName( SALOMEDS::Study_ptr theStudy, const QString& theBaseName );
+
+  /**
+   * Publish the given shape in GEOM as a GEOM object.
+   * \param theGeomEngine GEOM module engine
+   * \param theStudy SALOMEDS study, used for publishing of the shape
+   * \param theShape the shape to publish as a GEOM object
+   * \param theName the name of the published object
+   * \param theGeomObjEntry the entry of the published object
+   * \return the published GEOM object
+   */
+  static GEOM::GEOM_Object_ptr publishShapeInGEOM( GEOM::GEOM_Gen_var  theGeomEngine,
+                                                   SALOMEDS::Study_ptr theStudy,
+                                                   const TopoDS_Shape& theShape, 
+                                                   const QString&      theName,
+                                                   QString& theGeomObjEntry );
+
+  /**
+   * Create and publish face in GEOM as a GEOM object.
+   * \param theGeomEngine GEOM module engine
+   * \param theStudy SALOMEDS study, used for publishing of the face
+   * \param theWidth the face width
+   * \param theHeight the face height
+   * \param theName the name of the published face
+   * \param theFaceEntry the entry of the published face
+   * \return the published GEOM object
+   */
+  static GEOM::GEOM_Object_ptr createFaceInGEOM( GEOM::GEOM_Gen_var theGeomEngine,
+                                                 SALOMEDS::Study_ptr theStudy,
+                                                 const int theWidth,
+                                                 const int theHeight,
+                                                 const QString& theName,
+                                                 QString& theFaceEntry );
+
+  /**
+   * Publish the given GEOM object in the study.
+   * \param theGeomEngine GEOM module engine
+   * \param theStudy SALOMEDS study, used for publishing of the object
+   * \param theGeomObj the GEOM object
+   * \param theName the object name
+   * \return the entry of the published object (empty string in case of fail)
+   */
+  static QString publishGEOMObject( GEOM::GEOM_Gen_var theGeomEngine,
+                                    SALOMEDS::Study_ptr theStudy,
+                                    GEOM::GEOM_Object_ptr theGeomObj,
+                                    const QString& theName );
+
 };
 
 #endif
index 08cc1e665131227564c0386aa19986889fd69a13..1c4728995fbed9fcc1ec5ac261a6769f1690611c 100644 (file)
@@ -120,7 +120,7 @@ public:
    */
   HYDRODATA_EXPORT virtual SectionType GetSectionType( const int theSectionIndex ) const = 0;
 
-  /**
+  /** 
    * Set type for section with given index.
    * \param theSectionIndex index of section
    * \param theSectionType new section type
index b588c1faa7b9c6878d298db512696ba779c76d9e..815bc3b58b5fdd37680b0f084003508716d6a167 100644 (file)
@@ -30,6 +30,7 @@
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Wire.hxx>
 #include <TopoDS_Face.hxx>
+#include <TopExp_Explorer.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <NCollection_IncAllocator.hxx>
@@ -120,7 +121,8 @@ void HYDROData_LandCover::Update()
   
   removeShape();
 
-  TopoDS_Shape aResShape = buildShape();
+  TCollection_AsciiString anErrorMsg;
+  TopoDS_Shape aResShape = buildShape( GetPolylines(), anErrorMsg );
   
   setShape( aResShape );
 }
@@ -196,42 +198,62 @@ void HYDROData_LandCover::removeShape()
   }
 }
  
-TopoDS_Shape HYDROData_LandCover::buildShape() const
+TopoDS_Shape HYDROData_LandCover::buildShape( const HYDROData_SequenceOfObjects& thePolylines,
+                                              TCollection_AsciiString& theErrorMsg )
 {
+  theErrorMsg.Clear();
   TopoDS_Shape aResShape;
 
   BRepBuilderAPI_MakeWire aMakeWire;
   
   TopTools_ListOfShape aClosedWires;
 
-  HYDROData_SequenceOfObjects aRefPolylines = GetPolylines();
-  for ( int i = 1, n = aRefPolylines.Length(); i <= n; ++i ) {
+  int aNbPolylines = thePolylines.Length();
+  for ( int i = 1; i <= aNbPolylines; ++i ) {
     Handle(HYDROData_PolylineXY) aPolyline = 
-      Handle(HYDROData_PolylineXY)::DownCast( aRefPolylines.Value( i ) );
+      Handle(HYDROData_PolylineXY)::DownCast( thePolylines.Value( i ) );
     
     if ( aPolyline.IsNull() ) {
       continue;
     }
 
     TopoDS_Shape aPolyShape = aPolyline->GetShape();
-    if ( aPolyShape.IsNull() || aPolyShape.ShapeType() != TopAbs_WIRE ) {
+    if ( aPolyShape.IsNull() ) {
       continue;
     }
 
-    const TopoDS_Wire& aPolylineWire = TopoDS::Wire( aPolyShape );
-    if ( aPolylineWire.IsNull() ) {
-      continue;
+    // Extract polyline wire(s)
+    TopTools_ListOfShape aPolylineWires;
+      
+    if ( aPolyShape.ShapeType() == TopAbs_WIRE ) {
+      const TopoDS_Wire& aPolylineWire = TopoDS::Wire( aPolyShape );
+      if ( !aPolylineWire.IsNull() ) {
+        aPolylineWires.Append( aPolylineWire );
+      }
+    } else if ( aPolyShape.ShapeType() == TopAbs_COMPOUND ) {
+      TopExp_Explorer anExp( aPolyShape, TopAbs_WIRE );
+      for (; anExp.More(); anExp.Next() ) {
+        if(!anExp.Current().IsNull()) {
+          const TopoDS_Wire& aWire = TopoDS::Wire( anExp.Current() );
+          aPolylineWires.Append( aWire );
+        }
+      }
     }
-
-    if ( aPolylineWire.Closed() ) {
-      aClosedWires.Append( aPolylineWire );
-    } else {
-      aMakeWire.Add( aPolylineWire );
-      aMakeWire.Build();
-      if ( aMakeWire.IsDone() ) {
-        if ( aMakeWire.Wire().Closed() ) {
-          aClosedWires.Append( aMakeWire.Wire() );
-          aMakeWire = BRepBuilderAPI_MakeWire();
+    
+    TopTools_ListIteratorOfListOfShape anIt( aPolylineWires );
+    for ( ; anIt.More(); anIt.Next() ) {
+      TopoDS_Wire& aWire = TopoDS::Wire( anIt.Value() );
+      
+      if ( aWire.Closed() ) {
+        aClosedWires.Append( aWire );
+      } else {
+        aMakeWire.Add( aWire );
+        aMakeWire.Build();
+        if ( aMakeWire.IsDone() ) {
+          if ( aMakeWire.Wire().Closed() ) {
+            aClosedWires.Append( aMakeWire.Wire() );
+            aMakeWire = BRepBuilderAPI_MakeWire();
+          }
         }
       }
     }
@@ -260,6 +282,10 @@ TopoDS_Shape HYDROData_LandCover::buildShape() const
     }
 
     aResShape = aCompound;
+  } else if ( aNbPolylines > 0 ) {
+    TCollection_AsciiString aSourceName = aNbPolylines > 1 ? "polylines" : "polyline";
+    theErrorMsg = "Can't build closed contour on the given ";
+    theErrorMsg += aSourceName;
   }
 
   ///< \TODO to be reimplemented
index 3bba4a9e7e895d07d7a049b06ad2c843d5fab3cf..289e4bff1820b2778bac1190edd3312d107335c6 100644 (file)
@@ -126,21 +126,23 @@ public:
    */
   HYDRODATA_EXPORT static QColor DefaultBorderColor();
 
-protected:
+  /**
+   * Build the shape presentation of the land cover.
+   */
+  HYDRODATA_EXPORT static TopoDS_Shape buildShape( const HYDROData_SequenceOfObjects& thePolylines,
+                                                   TCollection_AsciiString& theErrorMsg );
+
   /**
    * Sets the shape presentation of the land cover.
    */
   HYDRODATA_EXPORT virtual void setShape( const TopoDS_Shape& theShape );
 
+protected:
+
   /**
    * Removes the shape from data label of the land cover object.
    */
   HYDRODATA_EXPORT virtual void removeShape();
-
-  /**
-   * Build the shape presentation of the land cover.
-   */
-  HYDRODATA_EXPORT virtual TopoDS_Shape buildShape() const;
 };
 
 #endif
index badf45ea385de93e5e1e53f3cee0ae5ef6b2ab4d..520a70ab3515a41ea4d248f438fc6c70d821ae74 100644 (file)
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License, or (at your option) any later version.
-//
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
-//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-
 #ifndef HYDROData_Object_HeaderFile
 #define HYDROData_Object_HeaderFile
 
 #include <HYDROData_Entity.h>
 
-
 DEFINE_STANDARD_HANDLE(HYDROData_Object, HYDROData_Entity)
 
 class TopoDS_Shape;
diff --git a/src/HYDROData/HYDROData_PolylineOperator.cxx b/src/HYDROData/HYDROData_PolylineOperator.cxx
new file mode 100644 (file)
index 0000000..dff7ce3
--- /dev/null
@@ -0,0 +1,174 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROData_PolylineOperator.h>
+#include <HYDROData_Document.h>
+#include <BRepBuilderAPI_MakeEdge2d.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Wire.hxx>
+
+template<class T> void append( std::vector<T>& theList, const std::vector<T>& theList2 )
+{
+  int aSize = theList.size();
+  int aNewSize = aSize + theList2.size();
+
+  if( aSize==aNewSize )
+    return;
+
+  theList.resize( aNewSize );
+  for( int i=aSize, j=0; i<aNewSize; i++, j++ )
+    theList[i] = theList2[j];
+}
+
+
+bool HYDROData_PolylineOperator::Split( const Handle( HYDROData_Document )& theDoc,
+                                        const TCollection_AsciiString& theNamePrefix,
+                                        const Handle( HYDROData_PolylineXY )& thePolyline,
+                                        const gp_Pnt2d& thePoint ) const
+{
+  std::vector<gp_Pnt2d> aPointsList( 1 );
+  aPointsList[0] = thePoint;
+  std::vector<Handle( Geom2d_Curve )> aCurves = GetCurves( thePolyline );
+  bool isOK = true;
+  for( int i=0, n=aCurves.size(); i<n; i++ )
+  {
+    std::vector<Handle( Geom2d_Curve )> aCurvesList = Split( aCurves[i], aPointsList );
+    bool isLocalOK = CreatePolylines( theDoc, theNamePrefix, aCurvesList );
+    isOK = isOK && isLocalOK;
+  }
+  return isOK;
+}
+
+bool HYDROData_PolylineOperator::Split( const Handle( HYDROData_Document )& theDoc,
+                                        const TCollection_AsciiString& theNamePrefix,
+                                        const Handle( HYDROData_PolylineXY )& thePolyline,
+                                        const Handle( HYDROData_PolylineXY )& theTool ) const
+{
+  std::vector<Handle( Geom2d_Curve )> aCurves = GetCurves( thePolyline );
+  std::vector<Handle( Geom2d_Curve )> aToolCurves = GetCurves( theTool );
+  bool isOK = true;
+  for( int i=0, n=aCurves.size(); i<n; i++ )
+    for( int j=0, m=aToolCurves.size(); j<m; j++ )
+    {
+      std::vector<gp_Pnt2d> aPointsList = Intersection( aCurves[i], aToolCurves[j] );
+      std::vector<Handle( Geom2d_Curve )> aCurvesList = Split( aCurves[i], aPointsList );
+      bool isLocalOK = CreatePolylines( theDoc, theNamePrefix, aCurvesList );
+      isOK = isOK && isLocalOK;
+    }
+  return isOK;
+}
+
+bool HYDROData_PolylineOperator::Split( const Handle( HYDROData_Document )& theDoc,
+                                        const TCollection_AsciiString& theNamePrefix,
+                                        const HYDROData_SequenceOfObjects& thePolylines )
+{
+  int f = thePolylines.Lower(), l = thePolylines.Upper();
+  bool isOK = true;
+  std::vector<Handle( Geom2d_Curve )> anAllCurves;
+  for( int i=f; i<=l; i++ )
+  {
+    Handle( HYDROData_PolylineXY ) aPolyline = Handle( HYDROData_PolylineXY )::DownCast( thePolylines.Value( i ) );
+    std::vector<Handle( Geom2d_Curve )> aCurves = GetCurves( aPolyline );
+    append( anAllCurves, aCurves );
+  }
+
+  for( int i=0, n=anAllCurves.size(); i<n; i++ )
+  {
+    std::vector<gp_Pnt2d> aCompletePointsList;
+    for( int j=0; j<n; j++ )
+    {
+      if( i==j )
+        continue;
+      std::vector<gp_Pnt2d> aPointsList = Intersection( anAllCurves[i], anAllCurves[j] );
+      append( aCompletePointsList, aPointsList );
+    }
+    std::vector<Handle( Geom2d_Curve )> aCurvesList = Split( anAllCurves[i], aCompletePointsList );
+    bool isLocalOK = CreatePolylines( theDoc, theNamePrefix, aCurvesList );
+    isOK = isOK && isLocalOK;
+  }
+  return isOK;
+}
+
+bool HYDROData_PolylineOperator::Merge( const Handle( HYDROData_Document )& theDoc,
+                                        const TCollection_AsciiString& theName,
+                                        const HYDROData_SequenceOfObjects& thePolylines,
+                                        bool isConnectByNewSegment )
+{
+  //TODO
+
+  TopoDS_Shape aMergedPolyline;
+
+  Handle( HYDROData_PolylineXY ) aPolyline = 
+    Handle( HYDROData_PolylineXY )::DownCast( theDoc->CreateObject( KIND_POLYLINEXY ) );
+  if( aPolyline.IsNull() )
+    return false;
+
+  aPolyline->SetShape( aMergedPolyline );
+  //TODO: set name
+
+  return true;
+}
+
+std::vector<Handle( Geom2d_Curve )> HYDROData_PolylineOperator::GetCurves( const Handle( HYDROData_PolylineXY )& thePolyline )
+{
+  std::vector<Handle( Geom2d_Curve )> aResult;
+  //TODO
+  return aResult;
+}
+
+std::vector<gp_Pnt2d> HYDROData_PolylineOperator::Intersection( const Handle( Geom2d_Curve )& theCurve,
+                                                                const Handle( Geom2d_Curve )& theTool )
+{
+  std::vector<gp_Pnt2d> aResult;
+  //TODO
+  return aResult;
+}
+
+std::vector<Handle( Geom2d_Curve )> HYDROData_PolylineOperator::Split( const Handle( Geom2d_Curve )& theCurve,
+                                                                       const std::vector<gp_Pnt2d>& thePoints )
+{
+  std::vector<Handle( Geom2d_Curve )> aResult;
+  //TODO
+  return aResult;
+}
+
+bool HYDROData_PolylineOperator::CreatePolylines( const Handle( HYDROData_Document )& theDoc,
+                                                  const TCollection_AsciiString& theNamePrefix,
+                                                  const std::vector<Handle( Geom2d_Curve )>& theCurves )
+{
+  if( theDoc.IsNull() )
+    return false;
+
+  int n = theCurves.size();
+  for( int i=0; i<n; i++ )
+  {
+    TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge2d( theCurves[i] ).Edge();
+    BRepBuilderAPI_MakeWire aMakeWire;
+    aMakeWire.Add( anEdge );
+
+    Handle( HYDROData_PolylineXY ) aPolyline = 
+      Handle( HYDROData_PolylineXY )::DownCast( theDoc->CreateObject( KIND_POLYLINEXY ) );
+    if( aPolyline.IsNull() )
+      return false;
+
+    aPolyline->SetShape( aMakeWire.Wire() );
+    //TODO: set name
+  }
+  return true;
+}
diff --git a/src/HYDROData/HYDROData_PolylineOperator.h b/src/HYDROData/HYDROData_PolylineOperator.h
new file mode 100644 (file)
index 0000000..a76a6af
--- /dev/null
@@ -0,0 +1,62 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROData_PolylineOperator_HeaderFile
+#define HYDROData_PolylineOperator_HeaderFile
+
+#include <HYDROData_PolylineXY.h>
+#include <Geom2d_Curve.hxx>
+#include <gp_Pnt2d.hxx>
+#include <vector>
+
+class Handle( HYDROData_Document );
+
+class HYDRODATA_EXPORT HYDROData_PolylineOperator
+{
+public:
+  bool Split( const Handle( HYDROData_Document )& theDoc,
+              const TCollection_AsciiString& theNamePrefix,
+              const Handle( HYDROData_PolylineXY )& thePolyline,
+              const gp_Pnt2d& thePoint ) const;
+  bool Split( const Handle( HYDROData_Document )& theDoc,
+              const TCollection_AsciiString& theNamePrefix,
+              const Handle( HYDROData_PolylineXY )& thePolyline,
+              const Handle( HYDROData_PolylineXY )& theTool ) const;
+  bool Split( const Handle( HYDROData_Document )& theDoc,
+              const TCollection_AsciiString& theNamePrefix,
+              const HYDROData_SequenceOfObjects& thePolylines );
+  bool Merge( const Handle( HYDROData_Document )& theDoc,
+              const TCollection_AsciiString& theName,
+              const HYDROData_SequenceOfObjects& thePolylines,
+              bool isConnectByNewSegment );
+
+protected:
+  static std::vector<Handle( Geom2d_Curve )> GetCurves( const Handle( HYDROData_PolylineXY )& thePolyline );
+
+  static std::vector<gp_Pnt2d> Intersection( const Handle( Geom2d_Curve )& theCurve,
+                                             const Handle( Geom2d_Curve )& theTool );
+
+  static std::vector<Handle( Geom2d_Curve )> Split( const Handle( Geom2d_Curve )& theCurve,
+                                                    const std::vector<gp_Pnt2d>& thePoints );
+
+  static bool CreatePolylines( const Handle( HYDROData_Document )& theDoc,
+                               const TCollection_AsciiString& theNamePrefix,
+                               const std::vector<Handle( Geom2d_Curve )>& theCurves );
+};
+
+#endif
index 6c188ac6b727552cd756e33ade5c3dd3a20f5a83..608e5b9510bfa9f2fc2bac174e1e58249b5419f7 100755 (executable)
@@ -247,6 +247,12 @@ TopoDS_Shape HYDROData_PolylineXY::GetShape() const
   return getPolylineShape();
 }
 
+bool HYDROData_PolylineXY::SetShape( const TopoDS_Shape& theShape )
+{
+  setPolylineShape( theShape );
+  return true;
+}
+
 bool convertEdgeToSection( const TopoDS_Edge&                                       theEdge,
                            NCollection_Sequence<TCollection_AsciiString>&           theSectNames,
                            NCollection_Sequence<HYDROData_PolylineXY::SectionType>& theSectTypes,
@@ -428,9 +434,10 @@ TopoDS_Wire HYDROData_PolylineXY::BuildWire( const SectionType&
 
     if ( thePoints.Size() > 1 )
     {
-      HYDROData_BSplineOperation aBSpline( thePoints, theIsClosed, LOCAL_SELECTION_TOLERANCE );
+      Handle(Geom_BSplineCurve) aCurve = 
+        HYDROData_BSplineOperation::ComputeCurve( thePoints, theIsClosed, LOCAL_SELECTION_TOLERANCE );
 
-      TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aBSpline.Curve() ).Edge();
+      TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aCurve ).Edge();
       aMakeWire.Add( anEdge );
     }
     aMakeWire.Build();
@@ -466,8 +473,9 @@ void HYDROData_PolylineXY::BuildPainterPath( QPainterPath&
   }
   else
   {
-    HYDROData_BSplineOperation aBSpline( thePoints, theIsClosed, LOCAL_SELECTION_TOLERANCE );
-    aBSpline.ComputePath( thePath );
+    Handle(Geom_BSplineCurve) aCurve = 
+      HYDROData_BSplineOperation::ComputeCurve( thePoints, theIsClosed, LOCAL_SELECTION_TOLERANCE );
+    HYDROData_BSplineOperation::ComputePath( aCurve, thePath );
   }
 }
 
@@ -655,18 +663,19 @@ double HYDROData_PolylineXY::GetDistance( const int theSectionIndex,
         aPointToTest = aPoint;
     }
 
-    HYDROData_BSplineOperation aBSpline( aPoints, anIsSectionClosed, LOCAL_SELECTION_TOLERANCE );
+    Handle(Geom_BSplineCurve) aCurve = 
+      HYDROData_BSplineOperation::ComputeCurve( aPoints, anIsSectionClosed, LOCAL_SELECTION_TOLERANCE );
 
-    Quantity_Parameter aFirstParam = aBSpline.Curve()->FirstParameter();
-    Quantity_Parameter aSecondParam = aBSpline.Curve()->LastParameter();
+    Quantity_Parameter aFirstParam = aCurve->FirstParameter();
+    Quantity_Parameter aSecondParam = aCurve->LastParameter();
 
     if ( thePointIndex != aSectNbPoints - 1 )
     {
-      GeomAPI_ProjectPointOnCurve aProject( aPointToTest, aBSpline.Curve() );
+      GeomAPI_ProjectPointOnCurve aProject( aPointToTest, aCurve );
       aSecondParam = aProject.LowerDistanceParameter();
     }
 
-    GeomAdaptor_Curve anAdap( aBSpline.Curve() );
+    GeomAdaptor_Curve anAdap( aCurve );
     
     aResDistance = GCPnts_AbscissaPoint::Length( anAdap, aFirstParam, aSecondParam );
   }
@@ -1142,5 +1151,26 @@ void HYDROData_PolylineXY::UpdateLocalCS( double theDx, double theDy )
   SetToUpdate( true );
 }
 
+void HYDROData_PolylineXY::Transform( const QTransform& theTrsf )
+{
+  NCollection_Sequence<TCollection_AsciiString>           aSectNames;
+  NCollection_Sequence<HYDROData_PolylineXY::SectionType> aSectTypes;
+  NCollection_Sequence<bool>                              aSectClosures;
+  GetSections( aSectNames, aSectTypes, aSectClosures );
+
+  for ( int i = 0, aNbSects = aSectNames.Size(); i < aNbSects; i++ ) {
+    PointsList aPoints = GetPoints( i );
+    for( int j = 1, n = aPoints.Size(); j <= n; ++j ) {
+      Point& aPoint = aPoints.ChangeValue( j );
 
+      QPointF aTrsfPoint = theTrsf.map( QPointF( aPoint.X(), aPoint.Y() ) );
+
+      aPoint.SetX( aTrsfPoint.x() );
+      aPoint.SetY( aTrsfPoint.y() );
+    }
+    SetPoints( i, aPoints );
+  }
+
+  Update();
+}
 
index fa764067ac0a874b5f4c349370266042f5298684..3036097263f0ea5ff25c87eed0c64c0346253816 100644 (file)
 DEFINE_STANDARD_HANDLE(HYDROData_PolylineXY, HYDROData_IPolyline)
 
 class QPainterPath;
+class QTransform;
 class TopoDS_Wire;
 class gp_XYZ;
+class gp_Pnt;
 
 /**\class HYDROData_PolylineXY
  * \brief Class that stores/retreives information about the 
@@ -124,13 +126,13 @@ public:
    * Returns the 2D presentation of all points.
    */
   HYDRODATA_EXPORT virtual TopoDS_Shape GetShape() const;
+  HYDRODATA_EXPORT bool SetShape( const TopoDS_Shape& theShape );
 
   /**
    * Returns the 3D presentation of all points.
    */
   HYDRODATA_EXPORT virtual bool ImportShape( const TopoDS_Shape& theShape );
 
-
   /**
    * Returns flag indicating that polyline can be edited or not.
    */
@@ -286,6 +288,11 @@ public:
    */
   HYDRODATA_EXPORT virtual QPainterPath GetPainterPath() const;
 
+  /**
+   * Transform the polyline points.
+   * @param theTrsf the transformation
+   */
+  HYDRODATA_EXPORT void Transform( const QTransform& theTrsf );
 
 protected:
 
index a551f43f2d49248f38bd3df1f8284d12e51cb182..1189970cb45bfe753c1ae92687a2a2eec03186eb 100755 (executable)
@@ -32,6 +32,9 @@
 
 #include <TopoDS_Shape.hxx>
 
+#include <HYDROData_Profile.h>
+#include <HYDROData_PolylineXY.h>
+
 
 IMPLEMENT_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline)
 IMPLEMENT_STANDARD_RTTIEXT(HYDROData_ProfileUZ, HYDROData_IPolyline)
@@ -275,4 +278,36 @@ HYDROData_ProfileUZ::PointsList HYDROData_ProfileUZ::GetPoints( const int /*theS
   return aResList;
 }
 
+void HYDROData_ProfileUZ::CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints, Handle_HYDROData_PolylineXY& thePolylineXY)
+{
+   // Fill 2D polyline
+  for ( int i = 1; i <= theXYZPoints.Size(); i++ ) {
+    const HYDROData_Profile::ProfilePoint& aBottomPoint = theXYZPoints.Value( i );
+    thePolylineXY->AddPoint( 0, HYDROData_PolylineXY::Point( aBottomPoint.X(), aBottomPoint.Y() ) );
+  }
+  
+  // Calculate profile UZ points
+
+  // First point
+  const HYDROData_Profile::ProfilePoint& aFirstBottomPoint = theXYZPoints.First();
+  AddPoint( 0, HYDROData_ProfileUZ::Point( 0, aFirstBottomPoint.Z() ) );
+
+  // Intermediate points
+  double aPolylineCommonDist = thePolylineXY->GetDistance( 0, thePolylineXY->NbPoints( 0 ) - 1 );
+
+  for ( int i = 2, aNbPoints = theXYZPoints.Size(); i < aNbPoints; i++ ) {
+    const HYDROData_Profile::ProfilePoint& aBottomPoint = theXYZPoints.Value( i );
+    
+    double aDistance = thePolylineXY->GetDistance( 0, i - 1 );
+    
+    Standard_Real anU = aDistance; // = ( aDistance / aPolylineCommonDist ) * aPolylineCommonDist;
+    AddPoint( 0, HYDROData_ProfileUZ::Point( anU, aBottomPoint.Z() ) );
+  }
+  
+  // Last point
+  const HYDROData_Profile::ProfilePoint& aLastBottomPoint = theXYZPoints.Last();
+  AddPoint( 0, HYDROData_ProfileUZ::Point( aPolylineCommonDist, aLastBottomPoint.Z() ) );
+}
+
 
index 62a5c14ef3fe98c95fade9ddf868630f1d3a7197..fd543f0723745efbb7263fcd9cca01da943e39a6 100644 (file)
@@ -23,6 +23,9 @@
 
 DEFINE_STANDARD_HANDLE(HYDROData_ProfileUZ, HYDROData_IPolyline)
 
+class gp_XYZ;
+class Handle_HYDROData_PolylineXY;
+
 /**\class HYDROData_ProfileUZ
  * \brief Class that stores/retreives information about the 
  *        parametric profile points.
@@ -167,6 +170,8 @@ public:
    */
   HYDRODATA_EXPORT virtual PointsList GetPoints( const int theSectionIndex = -1 ) const;
 
+  HYDRODATA_EXPORT virtual void CalculateAndAddPoints(const NCollection_Sequence<gp_XYZ>& theXYZPoints, Handle_HYDROData_PolylineXY& thePolylineXY);
+
 protected:
 
   friend class HYDROData_Iterator;
index 194d80e6344902802068f0393603bf1820db5079..20a86e42665435658222b149d6832e021bcf6c0c 100644 (file)
@@ -174,8 +174,7 @@ Handle(HYDROData_Zone) HYDROData_Region::addNewZone( const Handle(HYDROData_Docu
   for ( int i = 0, n = theRefObjects.length(); i < n; ++i )
   {
     const QString& anObjName = theRefObjects.at( i );
-    Handle(HYDROData_Object) aRefObject = 
-      Handle(HYDROData_Object)::DownCast( theDoc->FindObjectByName( anObjName ) );
+    Handle(HYDROData_Entity) aRefObject = theDoc->FindObjectByName( anObjName );
     if ( aRefObject.IsNull() )
       continue;
 
diff --git a/src/HYDROData/HYDROData_SinusX.cxx b/src/HYDROData/HYDROData_SinusX.cxx
new file mode 100644 (file)
index 0000000..86a5b15
--- /dev/null
@@ -0,0 +1,410 @@
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROData_SinusX.h"
+
+#include <HYDROData_PolylineXY.h>
+#include <HYDROData_Bathymetry.h>
+#include <HYDROData_Entity.h>
+#include <HYDROData_Document.h>
+#include <HYDROData_Profile.h>
+#include <HYDROData_Iterator.h>
+
+#include <gp_XYZ.hxx>
+#include <gp_XY.hxx>
+
+#include <QFile>
+#include <QFileInfo>
+#include <QString>
+#include <QStringList>
+#include <QTextStream>
+
+HYDROData_SinusX::HYDROData_SinusX( ) 
+{
+}
+
+HYDROData_SinusX::~HYDROData_SinusX()
+{
+}
+
+void HYDROData_SinusX::CollectExistingNames(Handle_HYDROData_Document theDocument)
+{
+  HYDROData_Iterator anIter( theDocument );
+  int anInd = 0;
+  myExistingNames.clear();
+  std::vector<int> anAllowedIndexes;
+  for( ; anIter.More(); anIter.Next() )
+    myExistingNames.push_back(anIter.Current()->GetName());
+}
+
+QString HYDROData_SinusX::GetName(const QString& theName)
+{
+  if (myExistingNames.contains(theName))
+  { 
+    QString aName = theName; 
+    while (myExistingNames.contains(aName)) 
+    {
+      QStringList aList = aName.split("_");
+      int aLastInd = aName.lastIndexOf("_");
+      bool IsNum = false; 
+      int anInd = -1;
+      anInd = aList.last().toInt(&IsNum);
+      if (IsNum)
+      {
+        aName = aName.left(aLastInd) + "_";
+        aName+= QString::number(++anInd);
+      }
+      else
+        aName = theName + "_0";
+    }
+
+    myExistingNames.push_back(aName);
+    return aName;
+  }
+  else
+  {
+    myExistingNames.push_back(theName);
+    return theName;
+  }
+
+}
+
+
+bool HYDROData_SinusX::Import(const QString& theFilePath, Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+{
+  if ( theFilePath.isEmpty() )
+  { 
+    return false;
+  }
+
+  QString anExt = theFilePath.split('.', QString::SkipEmptyParts).back();
+
+  if (anExt == "sx")
+  {
+    QFile aFile (theFilePath);
+    
+    aFile.open(QIODevice::ReadOnly);
+
+    Parse(aFile);
+   
+    CollectExistingNames(theDocument);
+    SXToHydro(theDocument, theEntities);
+    
+    aFile.close();
+    
+    return true;
+  }
+  else
+    return false;
+
+}
+
+void HYDROData_SinusX::SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+{ 
+  for ( size_t i = 0; i < myCurveBlocks.size(); i++ )
+  {
+    if (myCurveBlocks[i].myType == 4) ///  scatter plot -> to bathy
+    {
+      Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( theDocument->CreateObject( KIND_BATHYMETRY ) );
+      HYDROData_Bathymetry::AltitudePoints aAPoints;
+      for (size_t j = 0; j < myCurveBlocks[i].myXYZPoints.size(); j++)
+        aAPoints.Append(gp_XYZ (myCurveBlocks[i].myXYZPoints[j]));
+
+      aBath->SetAltitudePoints(aAPoints);
+      aBath->SetName(GetName(myCurveBlocks[i].myName + "_bath"));
+      theEntities.Append(aBath);
+    }
+    if (myCurveBlocks[i].myType == 1 || myCurveBlocks[i].myType == 3)
+    {
+      NCollection_Sequence<gp_XYZ> aPoints;
+      for (size_t j = 0; j < myCurveBlocks[i].myXYZPoints.size(); j++)
+        aPoints.Append(gp_XYZ (myCurveBlocks[i].myXYZPoints[j]));
+      /*if (myCurveBlocks[i].myIsClosed)
+        aPoints.Append(gp_XYZ (myCurveBlocks[i].myXYZPoints[0]));*/
+      Handle(HYDROData_ProfileUZ) aProfileUZ = Handle(HYDROData_ProfileUZ)::DownCast( theDocument->CreateObject( KIND_PROFILEUZ ) );
+      Handle(HYDROData_PolylineXY) aPolyXY = Handle(HYDROData_PolylineXY)::DownCast( theDocument->CreateObject( KIND_POLYLINEXY ) );
+      aPolyXY->AddSection( "",  
+        myCurveBlocks[i].myIsSpline ? HYDROData_PolylineXY::SECTION_SPLINE : HYDROData_PolylineXY::SECTION_POLYLINE, 
+        myCurveBlocks[i].myIsClosed ? true : false); 
+      aProfileUZ->CalculateAndAddPoints(aPoints, aPolyXY);
+      Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( theDocument->CreateObject( KIND_PROFILE ) );
+      aProfile->SetParametricPoints(aProfileUZ->GetPoints());
+      aPolyXY->SetName(GetName(myCurveBlocks[i].myName + "_polyXY"));
+      aProfileUZ->SetName(GetName(myCurveBlocks[i].myName + "_profileUZ"));
+      aProfile->SetName(GetName(myCurveBlocks[i].myName + "_profile"));
+      theEntities.Append(aPolyXY);
+      theEntities.Append(aProfileUZ);
+      theEntities.Append(aProfile);
+    }
+    if (myCurveBlocks[i].myType == 2)
+    {
+      if (myCurveBlocks[i].myCurvePlane == 2)
+      {
+        if (myCurveBlocks[i].myAdditionalCurveInfo.size() == 4)
+        {
+          Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( theDocument->CreateObject( KIND_PROFILE ) );
+          HYDROData_ProfileUZ::PointsList aPointList;
+          for (size_t j = 0; j < myCurveBlocks[i].myXYZPoints.size(); j++)
+            aPointList.Append(gp_XY (myCurveBlocks[i].myXYZPoints[j].X(), myCurveBlocks[i].myXYZPoints[j].Z()));
+          aProfile->GetProfileUZ()->SetSectionType(0,  myCurveBlocks[i].myIsSpline ? HYDROData_PolylineXY::SECTION_SPLINE : HYDROData_PolylineXY::SECTION_POLYLINE);
+          aProfile->GetProfileUZ()->SetSectionClosed(0, myCurveBlocks[i].myIsClosed ? true : false);
+          aProfile->SetParametricPoints(aPointList);
+          if ( ! (myCurveBlocks[i].myAdditionalCurveInfo[0] == 0 &&  myCurveBlocks[i].myAdditionalCurveInfo[1] == 0 && 
+            myCurveBlocks[i].myAdditionalCurveInfo[2] == 0 && myCurveBlocks[i].myAdditionalCurveInfo[3] == 0) )
+          {
+            aProfile->SetLeftPoint(gp_XY(myCurveBlocks[i].myAdditionalCurveInfo[0], myCurveBlocks[i].myAdditionalCurveInfo[1]));
+            aProfile->SetRightPoint(gp_XY(myCurveBlocks[i].myAdditionalCurveInfo[2], myCurveBlocks[i].myAdditionalCurveInfo[3]));
+            aProfile->Update();
+          }
+          aProfile->SetName(GetName(myCurveBlocks[i].myName + "_profile"));
+          theEntities.Append(aProfile);
+        }
+      }
+      if (myCurveBlocks[i].myCurvePlane == 0)
+      {
+        Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( theDocument->CreateObject( KIND_PROFILE ) );
+        HYDROData_Profile::ProfilePoints aPointList;
+        for (size_t j = 0; j < myCurveBlocks[i].myXYZPoints.size(); j++)
+          aPointList.Append(myCurveBlocks[i].myXYZPoints[j]);
+        aProfile->GetProfileUZ()->SetSectionType(0,  myCurveBlocks[i].myIsSpline ? HYDROData_PolylineXY::SECTION_SPLINE : HYDROData_PolylineXY::SECTION_POLYLINE);
+        aProfile->GetProfileUZ()->SetSectionClosed(0, myCurveBlocks[i].myIsClosed ? true : false);
+        aProfile->SetProfilePoints(aPointList);
+        aProfile->SetName(GetName(myCurveBlocks[i].myName + "_profile"));
+        theEntities.Append(aProfile);
+      }
+    }
+  }
+
+}
+
+bool HYDROData_SinusX::Parse(QFile& theFile)
+{
+  if ( !theFile.isOpen() )
+    return false;
+
+  QString aLine;
+  QString aBLine;
+  QStringList aList;
+  QStringList aBList;
+  myCurveBlocks.clear();
+  bool aTotStat = true;
+
+  aLine = theFile.readLine().simplified();
+  aList = aLine.split( ' ', QString::SkipEmptyParts );
+
+  for (;!theFile.atEnd();) 
+  {
+    if (aList[0] == "B" && (aList[1] == "C" || aList[1] == "P" || aList[1] == "N" || aList[1] == "S" ))
+    {  
+      HYDROGUI_CurveBlock aCurveBlockInfo;
+      if (aList[1] == "C")
+        aCurveBlockInfo.myType = 1;
+      else if (aList[1] == "P")
+        aCurveBlockInfo.myType = 2;
+      else if (aList[1] == "N")
+        aCurveBlockInfo.myType = 3;
+      else if (aList[1] == "S")
+        aCurveBlockInfo.myType = 4;
+
+      if (aList.size() == 9)
+      {
+        for (int j = 2; j < 8; j++)
+          aCurveBlockInfo.myRefCoords.push_back(aList[j].toDouble());
+        aCurveBlockInfo.myRefRatio = aList[8].toDouble();
+      }
+
+      QString Name;
+      do
+      {
+        aBLine = theFile.readLine().simplified();
+        aBList = aBLine.split( ' ', QString::SkipEmptyParts );
+         
+        if (aBList[0] == "CP")
+        {
+          if (aBList.size() == 2 && (aBList[1] == "0" || aBList[1] == "1" || aBList[1] == "2"))
+            aCurveBlockInfo.myCurvePlane = aBList[1].toInt();
+          else if (aBList.size() == 3 && (aBList[1] == "0" || aBList[1] == "1") && (aBList[2] == "0" || aBList[2] == "1"))
+          {
+            aCurveBlockInfo.myIsClosed = aBList[1].toInt();
+            aCurveBlockInfo.myIsSpline = aBList[2].toInt();
+          }
+          else
+          {
+            for (int j = 1; j < aBList.size(); j++)
+              aCurveBlockInfo.myAdditionalCurveInfo.push_back(aBList[j].toDouble());
+          }
+        }
+        if (aBList[0] == "CN")
+        {
+           for (int i = 1; i < aBList.size(); i++)
+             Name += aBList[i] + "_"; 
+           Name.remove(Name.size() - 1, 1);
+           aCurveBlockInfo.myName = Name;
+        }
+      } while (!theFile.atEnd() && aBLine[0] == 'C' );
+
+      bool aStat;
+      aTotStat = true;
+      do
+      {
+        if (aBList.size() >= 3 && aBLine[0] != 'B' && aBLine[0] != 'C') {
+          gp_XYZ anXYZ;
+          anXYZ.SetX (aBList[0].toDouble(&aStat));  
+          aTotStat = aTotStat && aStat;
+          anXYZ.SetY (aBList[1].toDouble(&aStat));
+          aTotStat = aTotStat && aStat;
+          anXYZ.SetZ (aBList[2].toDouble(&aStat));
+          aTotStat = aTotStat && aStat;
+
+          aCurveBlockInfo.myXYZPoints.push_back(anXYZ);
+          
+          aBLine = theFile.readLine().simplified();
+          aBList = aBLine.split( ' ', QString::SkipEmptyParts );
+        }
+        else 
+          break;
+    
+      } while (!theFile.atEnd() || !aBLine.isEmpty());
+      if (aTotStat)
+        myCurveBlocks.push_back(aCurveBlockInfo);
+
+      aLine = aBLine;
+      aList = aBList;
+
+    }
+    else
+    {
+      aLine = theFile.readLine().simplified();
+      aList = aLine.split( ' ', QString::SkipEmptyParts );
+    }
+
+  }
+
+  return true;
+
+}
+
+bool HYDROData_SinusX::Export(const QString& theFilePath, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+{
+  if ( theFilePath.isEmpty() )
+  { 
+    return false;
+  }
+
+  QString anExt = theFilePath.split('.', QString::SkipEmptyParts).back();
+
+  if (anExt == "sx")
+  {
+    QFile aFile (theFilePath);
+    
+    aFile.open(QIODevice::WriteOnly | QIODevice::Truncate | QIODevice::Text);
+
+    HydroToSX(aFile, theEntities);
+    
+    aFile.close();
+    
+    return true;
+  }
+  else
+    return false;
+
+}
+
+void HYDROData_SinusX::HydroToSX(QFile& theFile, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities)
+{
+  QTextStream aTextStream(&theFile);
+  aTextStream << "C  Generated by HYDRO Module\n";
+  aTextStream << "C\n";
+
+  for (int i = 1; i <= theEntities.Size(); i++)
+  {
+    Handle_HYDROData_Entity anEnt = theEntities.Value(i);
+    if (anEnt->IsKind( STANDARD_TYPE(HYDROData_Bathymetry) ))
+    {
+       Handle(HYDROData_Bathymetry) aBathy = Handle(HYDROData_Bathymetry)::DownCast( anEnt );
+       HYDROData_Bathymetry::AltitudePoints anXYZPoints = aBathy->GetAltitudePoints();
+       //Write to stream
+       aTextStream << "B S\n";
+       aTextStream << "CN " << aBathy->GetName() << "\n";
+       aTextStream << "CP 0 0\n";
+       aTextStream << "CP 0\n";
+       for (int j = anXYZPoints.Lower(); j <= anXYZPoints.Upper(); j++)
+         aTextStream << " " << QString::number(anXYZPoints(j).X(), 'f', 3)  
+                     << " " << QString::number(anXYZPoints(j).Y(), 'f', 3)  
+                     << " " << QString::number(anXYZPoints(j).Z(), 'f', 3) << "\n"; 
+    }
+    else if (anEnt->IsKind( STANDARD_TYPE(HYDROData_PolylineXY) ))
+    {
+      Handle(HYDROData_PolylineXY) aPolyXY = Handle(HYDROData_PolylineXY)::DownCast( anEnt );
+      for (int j = 0; j < aPolyXY->NbSections(); j++)
+      { 
+        //Collect data
+        bool IsClosed = aPolyXY->IsClosedSection(j);
+        bool IsSpline = false;
+        if (aPolyXY->GetSectionType(j) == HYDROData_PolylineXY::SECTION_SPLINE)
+          IsSpline = true;
+        HYDROData_PolylineXY::PointsList anXYPoints = aPolyXY->GetPoints(j);
+        //Write to stream
+        aTextStream << "B N\n";
+        aTextStream << "CN " << aPolyXY->GetName() << "\n";
+        aTextStream << "CP " << IsClosed << " " << IsSpline << "\n";
+        aTextStream << "CP 0.0\n";
+        aTextStream << "CP 0\n";
+        if (aPolyXY->NbSections() > 1)
+          aTextStream << "C " << aPolyXY->GetName() << "_section_" << QString::number(j) << "\n";
+        for (int k = anXYPoints.Lower(); k <= anXYPoints.Upper(); k++)
+         aTextStream << " " << QString::number(anXYPoints(k).X(), 'f', 3)  
+                     << " " << QString::number(anXYPoints(k).Y(), 'f', 3)  
+                     << " 0.000\n"; 
+      }
+    }
+    else if (anEnt->IsKind( STANDARD_TYPE(HYDROData_Profile) ))
+    {
+      //Collect data
+      Handle(HYDROData_Profile) aProfile = Handle(HYDROData_Profile)::DownCast( anEnt );
+      HYDROData_ProfileUZ::PointsList aPointList = aProfile->GetParametricPoints();
+      bool IsClosed = aProfile->GetProfileUZ(false)->IsClosedSection(0);;
+      bool IsSpline = false;
+      if (aProfile->GetProfileUZ(false)->GetSectionType(0) == HYDROData_PolylineXY::SECTION_SPLINE)
+        IsSpline = true;
+      //Write to stream
+      aTextStream << "B P\n";
+      aTextStream << "CN " << aProfile->GetName() << "\n";
+      aTextStream << "CP " << IsClosed << " " << IsSpline << "\n";
+      gp_XY aLeftPoint(0.0, 0.0);
+      gp_XY aRightPoint(0.0, 0.0);
+      if (aProfile->GetLeftPoint(aLeftPoint, true) && aProfile->GetRightPoint(aRightPoint, true))
+        aTextStream << "CP " << QString::number(aLeftPoint.X(), 'f', 3) << " " <<
+                                QString::number(aLeftPoint.Y(), 'f', 3) << " " <<
+                                QString::number(aRightPoint.X(), 'f', 3) << " " <<
+                                QString::number(aRightPoint.Y(), 'f', 3) << "\n";
+      else
+        aTextStream << "CP 0.0 0.0 0.0 0.0\n";
+      aTextStream << "CP 2\n";
+      for (int k = aPointList.Lower(); k <= aPointList.Upper(); k++)
+         aTextStream << " " << QString::number(aPointList(k).X(), 'f', 3)  
+                     << " 0.000 "
+                     << QString::number(aPointList(k).Y(), 'f', 3) << "\n";  
+    }
+  }
+}
\ No newline at end of file
diff --git a/src/HYDROData/HYDROData_SinusX.h b/src/HYDROData/HYDROData_SinusX.h
new file mode 100644 (file)
index 0000000..08c77b2
--- /dev/null
@@ -0,0 +1,74 @@
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDRODATA_SINUSX_H
+#define HYDRODATA_SINUSX_H
+
+#include <vector>
+#include <HYDROData.h>
+#include <NCollection_Sequence.hxx>
+#include <QString>
+#include <QStringList>
+
+class QFile;
+class gp_XYZ;
+class Handle_HYDROData_Entity;
+class Handle_HYDROData_Document;
+
+struct HYDROGUI_CurveBlock
+{
+  //HYDROGUI_CurveBlock() : myType(-1), myIsConnected(false), myIsClosed(false), myName(""), myCurvePlane(-1), myRefRatio(1.0) 
+    //{};
+  std::vector<gp_XYZ> myXYZPoints;
+  int myType;
+  bool myIsSpline;
+  bool myIsClosed;
+  int myCurvePlane;
+  QString myName;
+  std::vector<double> myAdditionalCurveInfo;
+  std::vector<double> myRefCoords;
+  double myRefRatio;
+};
+
+class HYDRODATA_EXPORT HYDROData_SinusX 
+{
+
+public:
+  HYDROData_SinusX( );
+  virtual ~HYDROData_SinusX();
+  bool Import (const QString& theFilePath, Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities);
+  bool Export(const QString& theFilePath, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities);
+  
+private:
+  void SXToHydro(Handle(HYDROData_Document) theDocument, NCollection_Sequence<Handle_HYDROData_Entity>& theEntities);
+  bool Parse( QFile& theFile );
+  void CollectExistingNames(Handle_HYDROData_Document theDocument);
+  QString GetName(const QString& theName);
+  void HydroToSX( QFile& theFile, const NCollection_Sequence<Handle_HYDROData_Entity>& theEntities);
+
+private:
+
+  std::vector<HYDROGUI_CurveBlock> myCurveBlocks;
+  QStringList myExistingNames;
+};
+
+#endif
index 29b7aae65a1f1b64c81ff8b6cad78aaae1b6c208..e9da1296964a7c1b7a99ba8d5be4df0784f08035 100644 (file)
@@ -1082,33 +1082,7 @@ bool HYDROData_Stream::GenerateBottomPolyline()
   
   aProfileUZ->RemoveSection( 0 );
 
-  // Fill 2D polyline
-  for ( int i = 1; i <= aNbBottomPoints; i++ ) {
-    const HYDROData_Profile::ProfilePoint& aBottomPoint = aBottomPoints.Value( i );
-    aPolylineXY->AddPoint( 0, HYDROData_PolylineXY::Point( aBottomPoint.X(), aBottomPoint.Y() ) );
-  }
-  
-  // Calculate profile UZ points
-
-  // First point
-  const HYDROData_Profile::ProfilePoint& aFirstBottomPoint = aBottomPoints.First();
-  aProfileUZ->AddPoint( 0, HYDROData_ProfileUZ::Point( 0, aFirstBottomPoint.Z() ) );
-
-  // Intermediate points
-  double aPolylineCommonDist = aPolylineXY->GetDistance( 0, aPolylineXY->NbPoints( 0 ) - 1 );
-
-  for ( int i = 2, aNbPoints = aBottomPoints.Size(); i < aNbPoints; i++ ) {
-    const HYDROData_Profile::ProfilePoint& aBottomPoint = aBottomPoints.Value( i );
-    
-    double aDistance = aPolylineXY->GetDistance( 0, i - 1 );
-    
-    Standard_Real anU = aDistance; // = ( aDistance / aPolylineCommonDist ) * aPolylineCommonDist;
-    aProfileUZ->AddPoint( 0, HYDROData_ProfileUZ::Point( anU, aBottomPoint.Z() ) );
-  }
-  
-  // Last point
-  const HYDROData_Profile::ProfilePoint& aLastBottomPoint = aBottomPoints.Last();
-  aProfileUZ->AddPoint( 0, HYDROData_ProfileUZ::Point( aPolylineCommonDist, aLastBottomPoint.Z() ) );
+  aProfileUZ->CalculateAndAddPoints(aBottomPoints, aPolylineXY);
   
   return true;
 }
index 279ecaea75d844343183b49c4fa9d3566432a05b..564b65f17663ff834c03a37aef50e267ad0775a9 100644 (file)
@@ -131,6 +131,24 @@ void HYDROData_StricklerTable::Set( const QString& theType, double theCoefficien
     aMap->SetReal( toExtString( theType ), theCoefficient );
 }
 
+void HYDROData_StricklerTable::GetCoefficientRange( double& theMin, double& theMax ) const
+{
+  theMin = 0;
+  theMax = 0;
+  
+  Handle(TDataStd_NamedData) aMap = Map();
+  Standard_Boolean isFirst = Standard_True;
+  for ( TDataStd_DataMapIteratorOfDataMapOfStringReal it( aMap->GetRealsContainer() ); it.More(); it.Next() ) {
+    Standard_Real aValue = it.Value();
+    if ( theMin == 0 || aValue < theMin ) {
+      theMin = aValue;
+    }
+    if ( theMax == 0 || aValue > theMax ) {
+      theMax = aValue;
+    }
+  }
+}
+
 QStringList HYDROData_StricklerTable::GetTypes() const
 {
     QStringList aSeq;
@@ -143,6 +161,13 @@ QStringList HYDROData_StricklerTable::GetTypes() const
     return aSeq;
 }
 
+bool HYDROData_StricklerTable::HasType( const TCollection_ExtendedString& theType ) const
+{
+  Handle(TDataStd_NamedData) aMap = Map();
+  
+  return !aMap.IsNull() && aMap->HasReal( theType );
+}
+
 void HYDROData_StricklerTable::Clear()
 {
     Handle(TDataStd_NamedData) aMap = Map();
index a70e9f71e86d68a11870126515cd8fb75e637c30..080422edb9b5d4b4d2fe4bca454d04f297f5d834 100644 (file)
@@ -52,6 +52,10 @@ public:
   HYDRODATA_EXPORT void Set( const QString& theType, double theCoefficient );
 
   HYDRODATA_EXPORT QStringList GetTypes() const;
+  HYDRODATA_EXPORT void GetCoefficientRange( double& theMin, double& theMax ) const;
+
+
+  HYDRODATA_EXPORT bool HasType( const TCollection_ExtendedString& theType ) const;
 
   HYDRODATA_EXPORT void Clear();
 
index 454e1e8217d23f1c59fe09fb4c2d3da585d19c02..1df356cf8a27112055e08de56b09bc78ab807ba9 100644 (file)
@@ -196,7 +196,9 @@ extern "C" {
 /*      __declspec(dllexport) must appear before them.                  */
 /* -------------------------------------------------------------------- */
 
-#define SHAPELIB_DLLEXPORT 1
+#ifdef WIN32
+  #define SHAPELIB_DLLEXPORT 1
+#endif
 
 #ifdef SHAPELIB_DLLEXPORT
 #  define SHPAPI_CALL __declspec(dllexport)
index a441dea1ef92fc937691dbbc26935eb2741577df..66d279707aed6eb3ee31a996f3178afce9e9ca54 100644 (file)
@@ -26,7 +26,7 @@ const double LOCAL_SELECTION_TOLERANCE = 0.0001;
 
 void test_HYDROData_BSplineOperation::testCurve()
 {
-  // prepare points: function of sin(x)
+  /*// prepare points: function of sin(x)
   NCollection_Sequence<gp_XYZ> aPoints;
   for ( double x = 0; x < 6.28; x += 0.1 )
   {
@@ -48,12 +48,12 @@ void test_HYDROData_BSplineOperation::testCurve()
     double aDiff = aBS->Value( x ).Y() - sin( aBS->Value( x ).X() );
     if ( aDiff < 0 ) aDiff = -aDiff;
     CPPUNIT_ASSERT( aDiff < 3.e-6 ); // this number is found manually
-  }
+  }*/
 }
 
 void test_HYDROData_BSplineOperation::testPath()
 {
-  // prepare points: function of sin(x)
+  /*// prepare points: function of sin(x)
   static const double aScale = 10000000.;
 
   NCollection_Sequence<gp_XYZ> aPoints;
@@ -70,7 +70,7 @@ void test_HYDROData_BSplineOperation::testPath()
 
   QPainterPath aPath;
   aBSpline.ComputePath( aPath );
-  CPPUNIT_ASSERT( !aPath.isEmpty() );
+  CPPUNIT_ASSERT( !aPath.isEmpty() );*/
   
   /*
   QImage aPic(1300, 600, QImage::Format_RGB32);
@@ -80,7 +80,7 @@ void test_HYDROData_BSplineOperation::testPath()
   aPic.save("pic.bmp");
   */
      
-  // check that values of Path are not far from original "sin" function
+  /*// check that values of Path are not far from original "sin" function
   // in all points of the curve
   QList<QPolygonF> aPolyF = aPath.toSubpathPolygons( QTransform() );
   QList<QPolygonF>::iterator aFIter = aPolyF.begin();
@@ -92,5 +92,5 @@ void test_HYDROData_BSplineOperation::testPath()
       if (aDiff < 0) aDiff = -aDiff;
       CPPUNIT_ASSERT(aDiff < 4.e-6); // this number is found manually
     }
-  }
+  }*/
 }
index 2f647b72d98b389919c0ee7059faa2290de1653b..ce49d5f592f4cf095ade09eb81e82fa0517322bf 100644 (file)
@@ -18,6 +18,7 @@ set(PROJECT_HEADERS
     HYDROGUI_DataModel.h
     HYDROGUI_DataModelSync.h
     HYDROGUI_DataObject.h
+    HYDROGUI_DataOwner.h
     HYDROGUI_DeleteDlg.h
     HYDROGUI_DeleteOp.h
     HYDROGUI_DigueDlg.h
@@ -36,9 +37,16 @@ set(PROJECT_HEADERS
     HYDROGUI_ImportImageDlg.h
     HYDROGUI_ImportImageOp.h
     HYDROGUI_ImportPolylineOp.h
+    HYDROGUI_ImportLandCoverOp.h
+    HYDROGUI_ImportLandCoverDlg.h
+    HYDROGUI_ImportSinusXOp.h
+    HYDROGUI_ExportSinusXOp.h
+    HYDROGUI_ExportSinusXDlg.h
     HYDROGUI_InputPanel.h
     HYDROGUI_LocalCSDlg.h
     HYDROGUI_LocalCSOp.h
+    HYDROGUI_MergePolylinesDlg.h
+    HYDROGUI_MergePolylinesOp.h
     HYDROGUI_Module.h
     HYDROGUI_NameValidator.h
     HYDROGUI_ObjSelector.h
@@ -71,6 +79,8 @@ set(PROJECT_HEADERS
     HYDROGUI_ShapeBathymetry.h
     HYDROGUI_ShapeImage.h
     HYDROGUI_ShowHideOp.h
+    HYDROGUI_SplitPolylinesDlg.h
+    HYDROGUI_SplitPolylinesOp.h
     HYDROGUI_StreamDlg.h
     HYDROGUI_StreamOp.h
     HYDROGUI_LineEditDoubleValidator.h
@@ -120,6 +130,11 @@ set(PROJECT_HEADERS
     HYDROGUI_ViewerDlg.h
     HYDROGUI_ObjComboBox.h
     HYDROGUI_PolylineExtractionOp.h
+    HYDROGUI_ObjListBox.h
+    HYDROGUI_RecognizeContoursDlg.h
+    HYDROGUI_RecognizeContoursOp.h
+    HYDROGUI_LandCoverColoringOp.h
+    HYDROGUI_ShapeLandCover.h
 )
 
 QT4_WRAP_CPP(PROJECT_HEADERS_MOC ${PROJECT_HEADERS})
@@ -140,6 +155,7 @@ set(PROJECT_SOURCES
     HYDROGUI_DataModel.cxx
     HYDROGUI_DataModelSync.cxx
     HYDROGUI_DataObject.cxx
+    HYDROGUI_DataOwner.cxx
     HYDROGUI_DeleteDlg.cxx
     HYDROGUI_DeleteOp.cxx
     HYDROGUI_DigueDlg.cxx
@@ -158,9 +174,16 @@ set(PROJECT_SOURCES
     HYDROGUI_ImportImageDlg.cxx
     HYDROGUI_ImportImageOp.cxx
     HYDROGUI_ImportPolylineOp.cxx
+    HYDROGUI_ImportSinusXOp.cxx
+    HYDROGUI_ImportLandCoverOp.cxx
+    HYDROGUI_ImportLandCoverDlg.cxx
+    HYDROGUI_ExportSinusXOp.cxx
+    HYDROGUI_ExportSinusXDlg.cxx
     HYDROGUI_InputPanel.cxx
     HYDROGUI_LocalCSDlg.cxx
     HYDROGUI_LocalCSOp.cxx
+    HYDROGUI_MergePolylinesDlg.cxx
+    HYDROGUI_MergePolylinesOp.cxx
     HYDROGUI_Module.cxx
     HYDROGUI_NameValidator.cxx
     HYDROGUI_ObjSelector.cxx
@@ -200,6 +223,8 @@ set(PROJECT_SOURCES
     HYDROGUI_StricklerTableOp.cxx
     HYDROGUI_LandCoverDlg.cxx
     HYDROGUI_LandCoverOp.cxx
+    HYDROGUI_SplitPolylinesDlg.cxx
+    HYDROGUI_SplitPolylinesOp.cxx
     HYDROGUI_SubmersibleOp.cxx
     HYDROGUI_Tool.cxx
     HYDROGUI_TwoImagesDlg.cxx
@@ -243,6 +268,11 @@ set(PROJECT_SOURCES
     HYDROGUI_ViewerDlg.cxx
     HYDROGUI_ObjComboBox.cxx
     HYDROGUI_PolylineExtractionOp.cxx
+    HYDROGUI_ObjListBox.cxx
+    HYDROGUI_RecognizeContoursDlg.cxx
+    HYDROGUI_RecognizeContoursOp.cxx
+    HYDROGUI_LandCoverColoringOp.cxx
+    HYDROGUI_ShapeLandCover.cxx
 )
 
 add_definitions(
@@ -294,8 +324,8 @@ QT4_INSTALL_TS_RESOURCES("${GUITS_SOURCES}" "${SALOME_HYDRO_INSTALL_RES_DATA}")
 
 FILE(GLOB GUIPNG_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.png")
 FILE(GLOB GUIXML_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.xml")
-FILE(GLOB GUIXML_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.txt")
-SET(GUI_DATA ${GUIPNG_DATA} ${GUIXML_DATA})
+FILE(GLOB GUITXT_DATA "${CMAKE_CURRENT_SOURCE_DIR}/resources/*.txt")
+SET(GUI_DATA ${GUIPNG_DATA} ${GUIXML_DATA} ${GUITXT_DATA})
 INSTALL(FILES ${GUI_DATA} DESTINATION ${SALOME_HYDRO_INSTALL_RES_DATA})
 
 # tests
index 7e1530197d4783f896faab2911b5cb548298be71..396e2c579c436b469beb17c07325d9b77c6551dc 100644 (file)
@@ -245,6 +245,8 @@ QWizardPage* HYDROGUI_CalculationDlg::createObjectsPage() {
 
   connect( myGeomObjects, SIGNAL( orderChanged() ), SLOT( onOrderChanged() ) );
 
+  connect( myPriorityWidget, SIGNAL( ruleChanged() ), SLOT( onRuleChanged() ) );
+
   return aPage;
 }
 
@@ -443,7 +445,9 @@ QWizardPage* HYDROGUI_CalculationDlg::createLandCoversPage() {
   connect( anAddBtn, SIGNAL( clicked() ), SIGNAL( addLandCovers() ) );
   connect( aRemoveBtn, SIGNAL( clicked() ), SIGNAL( removeLandCovers() ) );
 
-  connect( myLandCovers, SIGNAL( orderLandCoverChanged() ), SLOT( onOrderLandCoverChanged() ) );
+  connect( myLandCovers, SIGNAL( orderChanged() ), SLOT( onOrderLandCoverChanged() ) );
+
+  connect( myLandCoverPriorityWidget, SIGNAL( ruleChanged() ), SLOT( onLandCoverRuleChanged() ) );
 
   return aPage;
 }
@@ -453,13 +457,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 +474,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 +497,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 +513,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 );
 
@@ -1138,6 +1148,17 @@ void HYDROGUI_CalculationDlg::onOrderChanged()
     myGeomObjects->undoLastMove();
 }
 
+/**
+  Slot called when priority rule for geometry objects is changed.
+ */
+void HYDROGUI_CalculationDlg::onRuleChanged()
+{
+  bool isConfirmed = true;
+  emit ruleChanged( isConfirmed );
+  if( !isConfirmed )
+    myPriorityWidget->undoLastChange();
+}
+
 void HYDROGUI_CalculationDlg::setStricklerTable( const QString& theStricklerTableName, bool theBlockSignals )
 {
   bool isBlocked;
@@ -1224,3 +1245,14 @@ void HYDROGUI_CalculationDlg::onOrderLandCoverChanged()
   else
     myLandCovers->undoLastMove();  
 }
+
+/**
+  Slot called when priority rule for land covers is changed.
+ */
+void HYDROGUI_CalculationDlg::onLandCoverRuleChanged()
+{
+  bool isConfirmed = true;
+  emit ruleLandCoverChanged( isConfirmed );
+  if( !isConfirmed )
+    myLandCoverPriorityWidget->undoLastChange();
+}
index d6105168c3d8807675d5ba204a60bd93d406b9b0..c0e972c190c70d0c083174fa6b3e7c5ff8b87d04 100644 (file)
@@ -98,6 +98,7 @@ public slots:
   void                       refreshZonesBrowser();
   void                       onDataChanged();
   void                       onOrderChanged();
+  void                       onRuleChanged();
 
   void                       setLandCoverMode( int theMode );
   void                       setStricklerTable( const QString& theStricklerTableName, bool theBlockSignals = true );
@@ -106,6 +107,7 @@ public slots:
   void                       refreshLandCoverZonesBrowser();
   void                       onDataLandCoverChanged();
   void                       onOrderLandCoverChanged();
+  void                       onLandCoverRuleChanged();
 
   /**
    * Process items selection: hide/show bathymetry merge type selector.
@@ -142,6 +144,7 @@ signals:
   void                       removeObjects();
   void                       objectsSelected();
   void                       orderChanged( bool& isConfirmed );
+  void                       ruleChanged( bool& isConfirmed );
 
   void                       addGroups();
   void                       removeGroups();
@@ -159,6 +162,7 @@ signals:
   void                       removeLandCovers();
   void                       landCoversSelected();
   void                       orderLandCoverChanged( bool& isConfirmed );
+  void                       ruleLandCoverChanged( bool& isConfirmed );
 
   void                       createLandCoverRegion( const QList<SUIT_DataObject*>& theLandCoverZonesList );
   
index 82a21857c12505f3c47ecfe19f151277d1d9f98c..2951e5838d5dd4003cb4ab77bac4bb40f461a312 100644 (file)
@@ -55,7 +55,11 @@ HYDROGUI_CalculationOp::HYDROGUI_CalculationOp( HYDROGUI_Module* theModule, bool
 : HYDROGUI_Operation( theModule ),
   myIsEdit( theIsEdit ),
   myActiveViewManager( NULL ),
-  myPreviewViewManager( NULL )
+  myPreviewViewManager( NULL ),
+  myShowGeomObjects( true ),
+  myShowLandCovers( false ),
+  myShowZones( false ),
+  myUpdateLandCoverZonesPrs( false )
 {
   setName( myIsEdit ? tr( "EDIT_CALCULATION" ) : tr( "CREATE_CALCULATION" ) );
 }
@@ -218,7 +222,10 @@ HYDROGUI_InputPanel* HYDROGUI_CalculationOp::createInputPanel() const
   
   connect( aPanel, SIGNAL( orderChanged( bool& ) ), SLOT( onOrderChanged( bool& ) ) );
   connect( aPanel, SIGNAL( orderLandCoverChanged( bool& ) ), SLOT( onOrderLandCoverChanged( bool& ) ) );
-    
+
+  connect( aPanel, SIGNAL( ruleChanged( bool& ) ), SLOT( onRuleChanged( bool& ) ) );
+  connect( aPanel, SIGNAL( ruleLandCoverChanged( bool& ) ), SLOT( onRuleLandCoverChanged( bool& ) ) );
+
   connect( aPanel, SIGNAL( Next( const int ) ), SLOT( onNext( const int ) ) );
   connect( aPanel, SIGNAL( Back( const int ) ), SLOT( onHideZones( const int ) ) );
   //connect( aPanel, SIGNAL( clicked( SUIT_DataObject* ) ), SLOT( onSelected( SUIT_DataObject* ) ) );
@@ -669,6 +676,31 @@ bool HYDROGUI_CalculationOp::confirmOrderChange() const
   return isConfirmed;
 }
 
+bool HYDROGUI_CalculationOp::confirmRuleChange() const
+{
+  // Check if the case is already modified or not
+  bool isConfirmed = myEditedObject->IsMustBeUpdated();
+  if ( !isConfirmed )
+  {
+    // If not modified check if the case has already defined regions with zones
+    HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( false );
+    if ( aSeq.Length() > 0 )
+    {
+      // If there are already defined zones then ask a user to confirm zones recalculation
+      isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
+                               tr( "RULE_CHANGED" ),
+                               tr( "CONFIRM_SPLITTING_ZONES_RECALCULATION_REGIONS" ),
+                               QMessageBox::Yes | QMessageBox::No,
+                               QMessageBox::No ) == QMessageBox::Yes );
+    }
+    else
+    {
+      isConfirmed = true; // No regions - no zones - nothing to recalculate
+    }
+  }
+  return isConfirmed;
+}
+
 bool HYDROGUI_CalculationOp::confirmModeChange() const
 {
   // Check if the case is already modified or not
@@ -723,28 +755,52 @@ bool HYDROGUI_CalculationOp::confirmContinueWithWarning( const HYDROData_Warning
   return ( anAnswer == QMessageBox::Yes );
 }
 
+bool HYDROGUI_CalculationOp::confirmLandCoverRegionsChange() const
+{
+  // Check if the case is already modified or not
+  bool isConfirmed = myEditedObject->IsMustBeUpdated();
+  if ( !isConfirmed )
+  {
+    // If not modified check if the case has already defined regions with land cover zones
+    HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( true );
+    if ( aSeq.Length() > 0 )
+    {
+      // If there are already defined land cover zones then ask a user to confirm land cover zones recalculation
+      isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
+                               tr( "REGIONS_CHANGED" ),
+                               tr( "CONFIRM_LAND_COVER_PARTITION_RECALCULATION_REGIONS" ),
+                               QMessageBox::Yes | QMessageBox::No,
+                               QMessageBox::No ) == QMessageBox::Yes );
+    }
+    else
+    {
+      isConfirmed = true; // No regions - no land cover zones - nothing to recalculate
+    }
+  }
+  return isConfirmed;
+}
+
 bool HYDROGUI_CalculationOp::confirmLandCoverModeChange() const
 {
   // Check if the case is already modified or not
   bool isConfirmed = myEditedObject->IsMustBeUpdated();
   if ( !isConfirmed )
   {
-    // If not modified check if the case has already defined regions with zones
-    // TODO: adapt HYDROData_CalculationCase class to process regions constructed for land covers
-    /*HYDROData_SequenceOfObjects aSeq = myEditedObject->GetLandCoverRegions();
+    // If not modified check if the case has already defined regions with land cover zones
+    HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( true );
     if ( aSeq.Length() > 0 )
-    {*/
-      // If there are already defined zones then ask a user to confirm zones recalculation
+    {
+      // If there are already defined land cover zones then ask a user to confirm land cover zones recalculation
       isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
                                tr( "MODE_CHANGED" ),
                                tr( "CONFIRM_LAND_COVER_PARTITION_RECALCULATION_MODE" ),
                                QMessageBox::Yes | QMessageBox::No,
                                QMessageBox::No ) == QMessageBox::Yes );
-    /*}
+    }
     else
     {
-      isConfirmed = true; // No regions - no zones - nothing to recalculate
-    }*/
+      isConfirmed = true; // No regions - no land cover zones - nothing to recalculate
+    }
   }
   return isConfirmed;
 }
@@ -755,22 +811,46 @@ bool HYDROGUI_CalculationOp::confirmLandCoverOrderChange() const
   bool isConfirmed = myEditedObject->IsMustBeUpdated();
   if ( !isConfirmed )
   {
-    // If not modified check if the case has already defined regions with zones
-    // TODO: adapt HYDROData_CalculationCase class to process regions constructed for land covers
-    /*HYDROData_SequenceOfObjects aSeq = myEditedObject->GetLandCoverRegions();
+    // If not modified check if the case has already defined regions with land cover zones
+    HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( true );
     if ( aSeq.Length() > 0 )
-    {*/
-      // If there are already defined zones then ask a user to confirm zones recalculation
+    {
+      // If there are already defined land cover zones then ask a user to confirm land cover zones recalculation
       isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
                                tr( "ORDER_CHANGED" ),
                                tr( "CONFIRM_LAND_COVER_PARTITION_RECALCULATION_REGIONS" ),
                                QMessageBox::Yes | QMessageBox::No,
                                QMessageBox::No ) == QMessageBox::Yes );
-    /*}
+    }
     else
     {
-      isConfirmed = true; // No regions - no zones - nothing to recalculate
-    }*/
+      isConfirmed = true; // No regions - no land cover zones - nothing to recalculate
+    }
+  }
+  return isConfirmed;
+}
+
+bool HYDROGUI_CalculationOp::confirmLandCoverRuleChange() const
+{
+  // Check if the case is already modified or not
+  bool isConfirmed = myEditedObject->IsMustBeUpdated();
+  if ( !isConfirmed )
+  {
+    // If not modified check if the case has already defined regions with land cover zones
+    HYDROData_SequenceOfObjects aSeq = myEditedObject->GetRegions( true );
+    if ( aSeq.Length() > 0 )
+    {
+      // If there are already defined land cover zones then ask a user to confirm land cover zones recalculation
+      isConfirmed = ( SUIT_MessageBox::question( module()->getApp()->desktop(),
+                               tr( "RULE_CHANGED" ),
+                               tr( "CONFIRM_LAND_COVER_PARTITION_RECALCULATION_REGIONS" ),
+                               QMessageBox::Yes | QMessageBox::No,
+                               QMessageBox::No ) == QMessageBox::Yes );
+    }
+    else
+    {
+      isConfirmed = true; // No regions - no land cover zones - nothing to recalculate
+    }
   }
   return isConfirmed;
 }
@@ -876,6 +956,8 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
     if ( !aPanel )
       return;
 
+    setLandCoversVisible( true );
+
     QStringList aList;
     QStringList anEntryList;
     HYDROData_SequenceOfObjects aSeq;
@@ -902,8 +984,10 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
       }
     }
     aPanel->setStricklerTableNames( aList, anEntryList );
+    bool anUpdateState = myEditedObject->IsMustBeUpdated();
     if ( !aList.isEmpty() )
       aPanel->setStricklerTable( aList.at( 0 ), false );
+    myEditedObject->SetToUpdate( anUpdateState );
 
     // Fill in list widget with all available land covers
     aSeq = HYDROGUI_Tool::GetLandCovers( module() );
@@ -954,7 +1038,10 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
       return;
 
     QApplication::setOverrideCursor( Qt::WaitCursor );
-  
+
+    setGeomObjectsVisible( false );
+    setLandCoversVisible( false );
+
     QString aNewCaseName = aPanel->getObjectName();
     QString anOldCaseName = myEditedObject->GetName();
     bool isNameChanged = anOldCaseName != aNewCaseName;
@@ -965,7 +1052,7 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
     // automatic names generation for regions and zones
     myEditedObject->SetName( aNewCaseName );
     
-    // Set parameters for automatic mode
+    // Zones: set parameters for automatic mode
     int aMode = aPanel->getMode();
     if ( aMode == HYDROData_CalculationCase::AUTOMATIC )
     {
@@ -997,6 +1084,37 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
       }
     }
     aPanel->setEditZonesEnabled( aMode == HYDROData_CalculationCase::MANUAL );
+
+    // Land cover zones: set parameters for automatic mode
+    aMode = aPanel->getLandCoverMode();
+    if ( aMode == HYDROData_CalculationCase::AUTOMATIC )
+    {
+      // Set objects in the specified order
+      if( myEditedObject->IsMustBeUpdated() )
+      {
+        myEditedObject->RemoveLandCovers();
+        foreach ( const QString& aName, aPanel->getAllLandCovers() )
+        {
+          Handle(HYDROData_LandCover) aLandCover = Handle(HYDROData_LandCover)::DownCast( 
+            HYDROGUI_Tool::FindObjectByName( module(), aName ) );
+          if ( aLandCover.IsNull() )
+          {
+            continue;
+          }
+          myEditedObject->AddLandCover( aLandCover );
+        }
+
+        // Clear priority rules
+        myEditedObject->ClearRules( HYDROData_CalculationCase::DataTag_CustomLandCoverRules, true );
+        // Set priority rules
+        foreach ( const HYDROData_CustomRule& aRule, aPanel->getLandCoverRules() ) {
+          myEditedObject->AddRule( aRule.Object1, aRule.Priority,
+                                   aRule.Object2, HYDROData_Zone::Merge_Object,
+                                   HYDROData_CalculationCase::DataTag_CustomLandCoverRules );
+        }
+      }
+    }
+    aPanel->setEditLandCoverZonesEnabled( aMode == HYDROData_CalculationCase::MANUAL );
          
     if ( myEditedObject->IsMustBeUpdated() )
     {
@@ -1013,7 +1131,7 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
 
       anIsToUpdateOb = true;
 
-      myEditedObject->SetToUpdate( true );
+      myUpdateLandCoverZonesPrs = true;
     }
     else
     {
@@ -1037,43 +1155,10 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
 
     QApplication::setOverrideCursor( Qt::WaitCursor );
 
-    // Set parameters for automatic mode
-    int aMode = aPanel->getLandCoverMode();
-    if ( aMode == HYDROData_CalculationCase::AUTOMATIC )
-    {
-      // Set objects in the specified order
-      if( myEditedObject->IsMustBeUpdated() )
-      {
-        myEditedObject->RemoveLandCovers();
-        foreach ( const QString& aName, aPanel->getAllLandCovers() )
-        {
-          Handle(HYDROData_LandCover) aLandCover = Handle(HYDROData_LandCover)::DownCast( 
-            HYDROGUI_Tool::FindObjectByName( module(), aName ) );
-          if ( aLandCover.IsNull() )
-          {
-            continue;
-          }
-          myEditedObject->AddLandCover( aLandCover );
-        }
-
-        // Clear priority rules
-        myEditedObject->ClearRules( HYDROData_CalculationCase::DataTag_CustomLandCoverRules, true );
-        // Set priority rules
-        foreach ( const HYDROData_CustomRule& aRule, aPanel->getLandCoverRules() ) {
-          myEditedObject->AddRule( aRule.Object1, aRule.Priority,
-                                   aRule.Object2, HYDROData_Zone::Merge_Object,
-                                   HYDROData_CalculationCase::DataTag_CustomLandCoverRules );
-        }
-      }
-    }
-    aPanel->setEditLandCoverZonesEnabled( aMode == HYDROData_CalculationCase::MANUAL );
-
     bool anIsToUpdateOb = false;
-    bool anIsToUpdate = myEditedObject->IsMustBeUpdated();
-    if ( anIsToUpdate )
+    if ( myUpdateLandCoverZonesPrs )
     {
       myShowZones = true;
-      myEditedObject->Update();
       
       AssignDefaultZonesColors( true );
 
@@ -1085,7 +1170,9 @@ void HYDROGUI_CalculationOp::onNext( const int theIndex )
     closePreview( false );
     createPreview( true );
     
-    if ( !anIsToUpdate )
+    if ( myUpdateLandCoverZonesPrs )
+      myUpdateLandCoverZonesPrs = false;
+    else
     {
       // Hide zones
       setZonesVisible( false, false );
@@ -1108,11 +1195,15 @@ void HYDROGUI_CalculationOp::onHideZones( const int theIndex )
 {
   if( theIndex==1 )
   {
+    setGeomObjectsVisible( true );
+
     closePreview( false );
     createPreview( false );
   }
   if( theIndex==2 )
   {
+    setLandCoversVisible( true );
+
     closePreview( false );
     createPreview( true );
 
@@ -1169,6 +1260,30 @@ void HYDROGUI_CalculationOp::setZonesVisible( bool theIsVisible, const bool theL
   }
 }
 
+void HYDROGUI_CalculationOp::setGeomObjectsVisible( bool theIsVisible )
+{
+  myShowGeomObjects = theIsVisible;
+
+  HYDROData_SequenceOfObjects aSeq = myEditedObject->GetGeometryObjects();
+
+  HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
+  for ( ; anIter.More(); anIter.Next() ) {
+    setObjectVisibility( anIter.Value(), theIsVisible );
+  }
+}
+
+void HYDROGUI_CalculationOp::setLandCoversVisible( bool theIsVisible )
+{
+  myShowLandCovers = theIsVisible;
+
+  HYDROData_SequenceOfObjects aSeq = myEditedObject->GetLandCovers();
+
+  HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
+  for ( ; anIter.More(); anIter.Next() ) {
+    setObjectVisibility( anIter.Value(), theIsVisible );
+  }
+}
+
 void HYDROGUI_CalculationOp::AssignDefaultZonesColors( const bool theLandCover )
 {
   HYDROData_SequenceOfObjects aRegions = myEditedObject->GetRegions( theLandCover );
@@ -1215,7 +1330,7 @@ QColor HYDROGUI_CalculationOp::GenerateDefaultZonesColor( int theIndex,
                                                           float theValue/* = 0.95*/ ) const
 {
   float aGoldenRatioConjugate = (float)(360./582.);
-  float aHue = (float)rand();
+  float aHue = (float)(rand()%100);
   aHue += aGoldenRatioConjugate*theIndex;
   aHue -= floor(aHue);
 
@@ -1302,10 +1417,17 @@ void HYDROGUI_CalculationOp::createPreview( const bool theLandCover )
 {
   LightApp_Application* anApp = module()->getApp();
   HYDROData_SequenceOfObjects aSeq;
-  if ( theLandCover )
-    aSeq = myEditedObject->GetLandCovers();
-  else
-    aSeq = myEditedObject->GetGeometryObjects();
+  if ( theLandCover && myShowLandCovers )
+  {
+    HYDROData_SequenceOfObjects aSeqLC = myEditedObject->GetLandCovers();
+    aSeq.Append( aSeqLC );
+  }
+  else if ( !theLandCover && myShowGeomObjects )
+  {
+    HYDROData_SequenceOfObjects aSeqGO = myEditedObject->GetGeometryObjects();
+    aSeq.Append( aSeqGO );
+  }
+
   Handle(HYDROData_Entity) anEntity;
 
   if ( myShowZones )
@@ -1564,7 +1686,7 @@ void HYDROGUI_CalculationOp::onAddLandCovers()
 
   // Add land covers selected in the module browser to the calculation case
   QStringList aSelectedList = aPanel->getSelectedAvailableLandCovers();
-  if ( aSelectedList.isEmpty() || !confirmRegionsChange() )
+  if ( aSelectedList.isEmpty() || !confirmLandCoverRegionsChange() )
     return;
 
   QStringList anAddedList;
@@ -1595,7 +1717,7 @@ void HYDROGUI_CalculationOp::onRemoveLandCovers()
     return;
 
   QStringList aSelectedList = aPanel->getSelectedLandCovers();
-  if ( aSelectedList.isEmpty() || !confirmRegionsChange() )
+  if ( aSelectedList.isEmpty() || !confirmLandCoverRegionsChange() )
     return;
 
   for (int i = 0; i < aSelectedList.length(); i++)
@@ -1652,3 +1774,27 @@ void HYDROGUI_CalculationOp::onOrderLandCoverChanged( bool& isConfirmed )
   if( isConfirmed )
     myEditedObject->SetToUpdate( true );
 }
+
+void HYDROGUI_CalculationOp::onRuleChanged( bool& isConfirmed )
+{
+  HYDROGUI_CalculationDlg* aPanel = 
+    ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
+  if ( !aPanel )
+    return;
+
+  isConfirmed = confirmRuleChange();
+  if( isConfirmed )
+    myEditedObject->SetToUpdate( true );
+}
+
+void HYDROGUI_CalculationOp::onRuleLandCoverChanged( bool& isConfirmed )
+{
+  HYDROGUI_CalculationDlg* aPanel = 
+    ::qobject_cast<HYDROGUI_CalculationDlg*>( inputPanel() );
+  if ( !aPanel )
+    return;
+
+  isConfirmed = confirmLandCoverRuleChange();
+  if( isConfirmed )
+    myEditedObject->SetToUpdate( true );
+}
index 17134b7eb2513200510bfd4332ab1ce6917bec2d..cefe99bfddfafc1970be36fa22602abd74a1b61d 100644 (file)
@@ -127,7 +127,7 @@ protected slots:
    */
   void                            onClickedInZonesBrowser( SUIT_DataObject* theItem );
   /**
-   * Hide zones in the viewer.
+   * Slot called on back button click.
    */
   void                            onHideZones( const int );
   /** 
@@ -150,11 +150,16 @@ protected slots:
   void onOrderChanged( bool& isConfirmed );
   void onOrderLandCoverChanged( bool& isConfirmed );
 
+  void onRuleChanged( bool& isConfirmed );
+  void onRuleLandCoverChanged( bool& isConfirmed );
+
 private:
   void                            createPreview( const bool theLandCover);
   void                            closePreview( bool theRemoveViewManager = true );
   void                            setObjectVisibility( Handle(HYDROData_Entity) theEntity, const bool theIsVisible );
   void                            setZonesVisible( bool theIsVisible, const bool theLandCover );
+  void                            setGeomObjectsVisible( bool theIsVisible );
+  void                            setLandCoversVisible( bool theIsVisible );
   void                            getNamesAndEntries( const HYDROData_SequenceOfObjects& theSeq, 
                                                       QStringList& theNames, QStringList& theEntries ) const;
 
@@ -186,14 +191,20 @@ private:
   bool confirmRegionsChange() const;
   bool confirmModeChange() const;
   bool confirmOrderChange() const;
+  bool confirmRuleChange() const;
   bool confirmContinueWithWarning( const HYDROData_Warning& theWarning ) const;
 
+  bool confirmLandCoverRegionsChange() const;
   bool confirmLandCoverModeChange() const;
   bool confirmLandCoverOrderChange() const;
+  bool confirmLandCoverRuleChange() const;
 
 private:
   bool                            myIsEdit;
   bool                            myShowZones;
+  bool                            myShowGeomObjects;
+  bool                            myShowLandCovers;
+  bool                            myUpdateLandCoverZonesPrs;
   Handle(HYDROData_CalculationCase) myEditedObject;
 
   SUIT_ViewManager*               myActiveViewManager;
index 3d8b1875a0b301c930ce55b919ed424059d0e5f2..eb5f2539e9528b890fa1fa61dd49f6743b6bd33f 100644 (file)
@@ -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" );
 
@@ -342,6 +342,14 @@ void HYDROGUI_DataBrowser::createPopupMenu( QMenu* theMenu )
         isOnlyZones = aModelObj->GetKind()==KIND_ZONE;
         if( !isOnlyZones )
           break;
+
+        SUIT_DataObject* aParentObj = aHydroObj->parent();
+        if ( aParentObj )
+        {
+          isOnlyZones = aParentObj->childCount() > 1;
+          if( !isOnlyZones )
+            break;
+        }
       }
       else
       {
index aed8f8a7a4227a6b7c982ff4f853cd0dc40c6c6a..88bb35b290d435bad73c6dacad67b36ae9b8a32a 100644 (file)
@@ -749,18 +749,7 @@ LightApp_DataObject* HYDROGUI_DataModel::createObject( SUIT_DataObject*
 
   if ( visibility )
   {
-    SUIT_AbstractModel* treeModel = 0;
-    LightApp_Application* app = dynamic_cast<LightApp_Application*>( module()->application() );
-    if ( app )
-        treeModel = dynamic_cast<SUIT_AbstractModel*>( app->objectBrowser()->model() );
-
-    if ( treeModel )
-    {
-      HYDROGUI_Module* aModule = dynamic_cast<HYDROGUI_Module*>( module() );
-      bool isVisible = aModule->isObjectVisible( -1, theModelObject );
-      Qtx::VisibilityState aVisState = isVisible ? Qtx::ShownState : Qtx::HiddenState;
-      treeModel->setVisibilityState( aResObj->text( aResObj->customData( Qtx::IdType ).toInt() ), aVisState, false );
-    }
+    setObjectVisibilityState( theModelObject, aResObj );
   }
 
   if ( theIsBuildTree )
@@ -790,8 +779,12 @@ LightApp_DataObject* HYDROGUI_DataModel::createZone( SUIT_DataObject*       theP
                                                      const bool             theIsBuildTree,
                                                      const bool             theIsInOperation )
 {
-  return buildObject( theParent, new HYDROGUI_Zone( theParent, theModelObject, theParentEntry, theIsInOperation ), 
-    theParentEntry, theIsBuildTree, theIsInOperation );
+  HYDROGUI_Zone* aZone = new HYDROGUI_Zone( theParent, theModelObject, theParentEntry, theIsInOperation );
+  LightApp_DataObject* aDataObj = buildObject( theParent, aZone, theParentEntry, theIsBuildTree, theIsInOperation );
+
+  setObjectVisibilityState( theModelObject, aZone );
+
+  return aDataObj;
 }
 
 LightApp_DataObject* HYDROGUI_DataModel::createRegion( SUIT_DataObject*         theParent,
@@ -1092,6 +1085,15 @@ void HYDROGUI_DataModel::buildObjectTree( SUIT_DataObject* theParent,
       createObject( aGuiObj, aBottomPolyline, aGuiObj->entry(), false );
     }
   }
+  else if ( anObjectKind == KIND_LAND_COVER )
+  {
+    Handle(HYDROData_LandCover) aLandCoverObj =
+      Handle(HYDROData_LandCover)::DownCast( aDataObj );
+
+    HYDROData_SequenceOfObjects aPolylines = aLandCoverObj->GetPolylines();
+    buildObjectPartition( aGuiObj, aPolylines, tr( "LAND_COVER_POLYLINES" ), true );
+  }
+  
 }
 
 void HYDROGUI_DataModel::buildCaseTree( SUIT_DataObject* theParent, Handle(HYDROData_CalculationCase) theCase,
@@ -1239,5 +1241,22 @@ void HYDROGUI_DataModel::updateDocument()
     Handle(HYDROData_Document) aDoc = getDocument();
     SUIT_ResourceMgr* resMgr = module()->application()->resourceMgr();
     if ( resMgr && !aDoc.IsNull() )
-        aDoc->SetDefaultStricklerCoefficient( resMgr->doubleValue( "preferences", "default_strickler_coefficient", 0 ) );
+      aDoc->SetDefaultStricklerCoefficient( resMgr->doubleValue( "preferences", "default_strickler_coefficient", 0 ) );
+}
+
+void HYDROGUI_DataModel::setObjectVisibilityState( Handle(HYDROData_Entity) theModelObject,
+                                                   HYDROGUI_DataObject* theObject )
+{
+  SUIT_AbstractModel* treeModel = 0;
+  LightApp_Application* app = dynamic_cast<LightApp_Application*>( module()->application() );
+  if ( app )
+    treeModel = dynamic_cast<SUIT_AbstractModel*>( app->objectBrowser()->model() );
+
+  if ( treeModel )
+  {
+    HYDROGUI_Module* aModule = dynamic_cast<HYDROGUI_Module*>( module() );
+    bool isVisible = aModule->isObjectVisible( -1, theModelObject );
+    Qtx::VisibilityState aVisState = isVisible ? Qtx::ShownState : Qtx::HiddenState;
+    treeModel->setVisibilityState( theObject->text( theObject->customData( Qtx::IdType ).toInt() ), aVisState, false );
+  }
 }
index caaa234d82b14a59dedb8f9d12a08168be34c674..33d6a07f4886c0a3847e13ec85dc08c5eeedf996 100644 (file)
@@ -376,6 +376,15 @@ protected:
 
   void updateDocument();
 
+  /**
+   * Set object visibility state.
+   * \param theModelObject the data model object
+   * \param theDataObject the GUI object
+   */
+  void setObjectVisibilityState( Handle(HYDROData_Entity) theModelObject,
+                                 HYDROGUI_DataObject* theObject );
+                                 
+
 protected:
   QString myStudyURL; ///< the saved/opened document URL
   QByteArray myStates;
index 28aa22e4df5f90e668161e4ae712dd830b1141f3..caa5eba4e653cc20cfd8020602cda67a9e17b4e7 100644 (file)
@@ -34,8 +34,8 @@
 #include <QColor>
 
 #ifdef WIN32
-  #pragma warning( disable: 4250 )
-  #pragma warning( disable: 4251 )
+  #pragma warning( default: 4250 )
+  #pragma warning( default: 4251 )
 #endif
 
 /**
diff --git a/src/HYDROGUI/HYDROGUI_DataOwner.cxx b/src/HYDROGUI/HYDROGUI_DataOwner.cxx
new file mode 100644 (file)
index 0000000..040085b
--- /dev/null
@@ -0,0 +1,49 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_DataOwner.h"
+
+
+HYDROGUI_DataOwner::HYDROGUI_DataOwner()
+{
+}
+
+HYDROGUI_DataOwner::HYDROGUI_DataOwner( const Handle(AIS_InteractiveObject)& theIO ):
+  myIO(theIO)
+{
+}
+
+HYDROGUI_DataOwner::~HYDROGUI_DataOwner()
+{
+}
+
+QString HYDROGUI_DataOwner::keyString() const
+{
+  QString aKey;
+
+  if ( !myIO.IsNull() ) {
+    aKey = QString().sprintf( "%08p", myIO.operator->() );
+  }
+
+  return aKey;
+}
+
+const Handle(AIS_InteractiveObject)& HYDROGUI_DataOwner::IO() const
+{
+  return myIO;
+}
diff --git a/src/HYDROGUI/HYDROGUI_DataOwner.h b/src/HYDROGUI/HYDROGUI_DataOwner.h
new file mode 100644 (file)
index 0000000..f955cbb
--- /dev/null
@@ -0,0 +1,66 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_DATAOWNER_H
+#define HYDROGUI_DATAOWNER_H
+
+#include <SUIT_DataOwner.h>
+
+#include <AIS_InteractiveObject.hxx>
+
+
+/*!
+  This class provide data owner objects.
+*/
+class HYDROGUI_DataOwner : public SUIT_DataOwner
+{
+public:
+    /**
+     * Constructor. Initialize by \a AIS_InteractiveObject.
+     */
+    HYDROGUI_DataOwner( const Handle(AIS_InteractiveObject)& theIO );
+
+    /**
+     * Constructor.
+     */
+    HYDROGUI_DataOwner();
+
+    /**
+     * Destructor.
+     */
+    virtual ~HYDROGUI_DataOwner();
+
+    /**
+     * Gets key string, used for data owners comparison.
+     * \return the empty string
+     */
+    virtual QString keyString() const;
+
+    /**
+     * Gets SALOME_InteractiveObject.
+     * \return the SALOME interactive object
+     */
+    const Handle(AIS_InteractiveObject)& IO() const;
+
+private:
+    Handle(AIS_InteractiveObject) myIO; ///< the AIS interactive object
+};
+
+typedef SMART(HYDROGUI_DataOwner) HYDROGUI_DataOwnerPtr;
+
+#endif
index 8a85237954bf2078226d85a6eef5001eac94f329..1ef77793f9e786513d5392d6a4cf5074c8eddad8 100644 (file)
@@ -123,8 +123,11 @@ void HYDROGUI_DeleteOp::startOperation()
   for( Standard_Integer anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ )
   {
     Handle(HYDROData_Entity) anObject = aSeq.Value( anIndex );
-    if ( !anObject.IsNull() && !anObject->IsRemoved() )
+
+    if ( !anObject.IsNull() && !anObject->IsRemoved() ) {
       anObject->Remove();
+      module()->setObjectRemoved( anObject );
+    }
   }
 
   commitDocOperation();
index 4ee707347258db6519a6c85f9041314163de9ccd..c911f1d048da8969044b861af2f61cf6ea345897 100644 (file)
@@ -84,11 +84,12 @@ bool HYDROGUI_ExportCalculationOp::processApply( int& theUpdateFlags,
     dynamic_cast<SalomeApp_Study*>( module()->getApp()->activeStudy() );
 
   // Export
+  QString anErrorMsg;
   if ( aStudy ) {
     SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy->studyDS() );
     GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen();
     QString anEntry;
-    if ( aCalculation->Export( aGeomEngine, aDSStudy, anEntry ) ) {
+    if ( aCalculation->Export( aGeomEngine, aDSStudy, anEntry, theErrorMsg ) ) {
       theUpdateFlags = UF_ObjBrowser;
       isOk = true;
     }
index f1fb2ed34978e715f5cabf16f3b8c64b30321e95..a902cdadcc5c87d775cc34c8c445129a48983939 100644 (file)
@@ -30,6 +30,7 @@
 #include <HYDROData_Polyline3D.h>
 #include <HYDROGUI_DataObject.h>
 #include <HYDROData_Bathymetry.h>
+#include <HYDROData_LandCover.h>
 
 #include <HYDROData_Profile.h>
 
 #include <QFile>
 #include <QFileInfo>
 #include <SUIT_MessageBox.h>
-
+#include <TopoDS.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Edge.hxx>
+#include <BRep_Tool.hxx>
+#include <Precision.hxx>
+#include <Handle_Geom_Curve.hxx>
+#include <Handle_Geom_Line.hxx>
+#include <Handle_Geom_TrimmedCurve.hxx>
+#include <Geom_TrimmedCurve.hxx>
 
 HYDROGUI_ExportFileOp::HYDROGUI_ExportFileOp( HYDROGUI_Module* theModule )
 : HYDROGUI_Operation( theModule )
 {
-  setName( tr( "EXPORT_POLYLINE" ) );
+  setName( tr( "EXPORT_TO_SHAPE_FILE" ) );
 }
 
 HYDROGUI_ExportFileOp::~HYDROGUI_ExportFileOp()
@@ -57,13 +68,14 @@ void HYDROGUI_ExportFileOp::startOperation()
 {
   HYDROGUI_Operation::startOperation();
   
-  QString aFilter( "*.shp" ); //temp  ext-n; replace with filter; TODO
+  QString aFilter( tr("SHP_FILTER") ); 
   
   Handle(HYDROData_PolylineXY) aPolyXY;
   Handle(HYDROData_Polyline3D) aPoly3D;
+  Handle(HYDROData_LandCover) aLC;
   NCollection_Sequence<Handle_HYDROData_PolylineXY> aPolyXYSeq;
   NCollection_Sequence<Handle_HYDROData_Polyline3D> aPoly3DSeq;
-
+  NCollection_Sequence<Handle_HYDROData_LandCover> aLCSeq;
   
   HYDROData_SequenceOfObjects aSeq = HYDROGUI_Tool::GetSelectedObjects( module() );
   for( int anIndex = 1, aLength = aSeq.Length(); anIndex <= aLength; anIndex++ )
@@ -75,38 +87,76 @@ void HYDROGUI_ExportFileOp::startOperation()
     aPoly3D = Handle(HYDROData_Polyline3D)::DownCast( aSeq.Value( anIndex ));
     if (!aPoly3D.IsNull())
       aPoly3DSeq.Append(aPoly3D);
+
+    aLC = Handle(HYDROData_LandCover)::DownCast( aSeq.Value( anIndex ));
+    if (!aLC.IsNull())
+      aLCSeq.Append(aLC);
   }
 
   if (!aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty())
-    SUIT_MessageBox::warning( module()->getApp()->desktop(), "Export Polyline", "Cannot export polylines of different kind");
+    SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "EXPORT_TO_SHAPE_FILE" ), tr("ERROR_POLYLINES_OF_DIFF_KIND"));
   else
   {
-    QString aFileName = SUIT_FileDlg::getFileName( module()->getApp()->desktop(), "", aFilter, tr( "EXPORT_POLYLINE" ), false );
-    SHPHandle hSHPHandle;
-    if (!aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty())
+    QString aName = "";
+    if (aPolyXYSeq.Size() == 1 && aPoly3DSeq.IsEmpty())
+      aName = aPolyXYSeq(1)->GetName();
+    if (aPoly3DSeq.Size() == 1 && aPolyXYSeq.IsEmpty())
+      aName = aPoly3DSeq(1)->GetName();
+    if (aLCSeq.Size() == 1 && aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty())
+      aName = aLCSeq(1)->GetName();
+    QString aFileName = SUIT_FileDlg::getFileName( module()->getApp()->desktop(), aName, aFilter, tr( "EXPORT_TO_SHAPE_FILE" ), false );
+    if (!aFileName.isEmpty())
     {
-      hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARC );
-      for (int i = 1; i <= aPolyXYSeq.Size(); i++)
-        WriteObjectPolyXY(hSHPHandle, aPolyXYSeq(i));
+      SHPHandle hSHPHandle;
+      QStringList aNonExpList;
+      if (!aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty())
+      {
+        hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARC );        
+        for (int i = 1; i <= aPolyXYSeq.Size(); i++)
+          if (WriteObjectPolyXY(hSHPHandle, aPolyXYSeq(i)) != 1)
+            aNonExpList.append(aPolyXYSeq(i)->GetName());
+
+      }
+      else if (aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty())
+      {
+        hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARCZ );
+        for (int i = 1; i <= aPoly3DSeq.Size(); i++)
+          if (WriteObjectPoly3D(hSHPHandle, aPoly3DSeq(i)) != 1)
+            aNonExpList.append(aPoly3DSeq(i)->GetName());
+      }
+      else if (aPolyXYSeq.IsEmpty() && aPoly3DSeq.IsEmpty() && !aLCSeq.IsEmpty())
+      {
+        hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_POLYGON );
+        for (int i = 1; i <= aLCSeq.Size(); i++)
+          if (WriteObjectLC(hSHPHandle, aLCSeq(i)) != 1)
+            aNonExpList.append(aLCSeq(i)->GetName());
+      }
+      SHPClose( hSHPHandle );
+      if (!aNonExpList.empty())
+      {
+        QString aMessage = tr("CANNOT_BE_EXPORTED") + "\n";
+        foreach (QString anNonExpEntName, aNonExpList)
+          aMessage += anNonExpEntName + "\n"; 
+        SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "EXPORT_TO_SHAPE_FILE" ), aMessage);
+      }
+      commit();
     }
-    else if (aPolyXYSeq.IsEmpty() && !aPoly3DSeq.IsEmpty())
-    {
-      hSHPHandle = SHPCreate( aFileName.toAscii().data(), SHPT_ARCZ );
-      for (int i = 1; i <= aPoly3DSeq.Size(); i++)
-        WriteObjectPoly3D(hSHPHandle, aPoly3DSeq(i));
-    }      
-    SHPClose( hSHPHandle );
+    else
+      abort();
   }
 
-  commit();
 }
 
-void HYDROGUI_ExportFileOp::WriteObjectPolyXY(SHPHandle theShpHandle, Handle_HYDROData_PolylineXY thePoly )
+int HYDROGUI_ExportFileOp::WriteObjectPolyXY(SHPHandle theShpHandle, Handle_HYDROData_PolylineXY thePoly )
 {
   SHPObject    *aSHPObj;
   std::vector<double> x, y;
   std::vector<int> anPartStart;
   
+  for (int i = 0; i < thePoly->NbSections(); i++)    
+    if (thePoly->GetSectionType(i) == HYDROData_IPolyline::SECTION_SPLINE)
+      return -1;
+
   for (int i = 0; i < thePoly->NbSections(); i++)
   {
     anPartStart.push_back(x.size());
@@ -126,13 +176,18 @@ void HYDROGUI_ExportFileOp::WriteObjectPolyXY(SHPHandle theShpHandle, Handle_HYD
   aSHPObj = SHPCreateObject( SHPT_ARC, -1, thePoly->NbSections(), &anPartStart[0], NULL, x.size(), &x[0], &y[0], NULL, NULL );
   SHPWriteObject( theShpHandle, -1, aSHPObj );
   SHPDestroyObject( aSHPObj );
+  return 1;
 }
 
-void HYDROGUI_ExportFileOp::WriteObjectPoly3D(SHPHandle theShpHandle, Handle_HYDROData_Polyline3D thePoly )
+int HYDROGUI_ExportFileOp::WriteObjectPoly3D(SHPHandle theShpHandle, Handle_HYDROData_Polyline3D thePoly )
 {
   SHPObject    *aSHPObj;
   std::vector<double> x, y, z;
   std::vector<int> anPartStart;
+
+  for (int i = 0; i < thePoly->GetPolylineXY()->NbSections(); i++)    
+    if (thePoly->GetPolylineXY()->GetSectionType(i) == HYDROData_IPolyline::SECTION_SPLINE)
+      return -1;
   
   for (int i = 0; i < thePoly->GetPolylineXY()->NbSections(); i++)
   {
@@ -156,7 +211,105 @@ void HYDROGUI_ExportFileOp::WriteObjectPoly3D(SHPHandle theShpHandle, Handle_HYD
   aSHPObj = SHPCreateObject( SHPT_ARCZ, -1, thePoly->GetPolylineXY()->NbSections(), &anPartStart[0], NULL, x.size(), &x[0], &y[0], &z[0], NULL );
   SHPWriteObject( theShpHandle, -1, aSHPObj );
   SHPDestroyObject( aSHPObj );
+  return 1;
+}
+
+int HYDROGUI_ExportFileOp::WriteObjectLC(SHPHandle theShpHandle, Handle_HYDROData_LandCover theLC )
+{
+  TopoDS_Shape aSh = theLC->GetShape();
+  if (aSh.IsNull())
+    return 0;
+  TopExp_Explorer anEdgeEx(aSh, TopAbs_EDGE);
+  for (; anEdgeEx.More(); anEdgeEx.Next()) 
+  {
+    TopoDS_Edge E = TopoDS::Edge(anEdgeEx.Current());
+    double aFP, aLP;
+    Handle_Geom_Curve aCur = BRep_Tool::Curve(E, aFP, aLP);
+    Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast(aCur);
+    if (aLine.IsNull())
+    {
+      Handle(Geom_TrimmedCurve) aTC = Handle(Geom_TrimmedCurve)::DownCast(aCur);
+      if (!aTC.IsNull())
+      {
+        Handle(Geom_Line) aLine = Handle(Geom_Line)::DownCast(aTC->BasisCurve());
+        if (aLine.IsNull())
+          return -1;
+      }
+      else
+        return -1;
+    }
+
+  }
+  if (aSh.ShapeType() == TopAbs_FACE)
+  {
+    ProcessFace(TopoDS::Face(aSh), theShpHandle);
+  }
+  else if (aSh.ShapeType() == TopAbs_COMPOUND)
+  {
+    TopExp_Explorer Ex(aSh, TopAbs_FACE);
+    for (; Ex.More(); Ex.Next()) 
+    {
+      TopoDS_Face aF = TopoDS::Face(Ex.Current());   
+      if (aF.IsNull())
+        continue;
+      ProcessFace(aF, theShpHandle);
+    }
+  }
+  else
+    return 0;
+
+  return 1;
 }
 
+void HYDROGUI_ExportFileOp::ProcessFace(TopoDS_Face theFace, SHPHandle theShpHandle)
+{
+  SHPObject    *aSHPObj;
+  std::vector<double> x, y;
+  std::vector<int> anPartStart;
+  if (theFace.ShapeType() == TopAbs_FACE)
+  {
+    TopExp_Explorer Ex(theFace, TopAbs_WIRE);
+    int NbWires = 0;
+    for (; Ex.More(); Ex.Next()) 
+    {
+      TopoDS_Wire aW = TopoDS::Wire(Ex.Current());   
+      if (aW.IsNull())
+        continue;
+      NbWires++;
+      anPartStart.push_back(x.size());
+      TopExp_Explorer aVEx(aW, TopAbs_VERTEX);
+      NCollection_Sequence<gp_Pnt2d> aPnts;
+      for (; aVEx.More(); aVEx.Next())
+      {
+        TopoDS_Vertex aV = TopoDS::Vertex(aVEx.Current()); 
+        if (aV.IsNull())
+          continue;
+        gp_Pnt P = BRep_Tool::Pnt(aV);
+        aPnts.Append(gp_Pnt2d(P.X(), P.Y()));
+      }
+      NCollection_Sequence<gp_Pnt2d> aNPnts;
+      aNPnts.Append(aPnts.First());
+      for (int j = 1; j <= aPnts.Size() - 1; j++)
+      {
+        if (!aPnts(j).IsEqual(aPnts(j + 1), Precision::Confusion())) 
+          aNPnts.Append(aPnts(j + 1));
+      }
 
+      for (int j = 1; j <= aNPnts.Size(); j++)
+      { 
+        x.push_back( aNPnts(j).X());
+        y.push_back( aNPnts(j).Y()); 
+      }
+      //x.push_back( aNPnts(1).X());
+      //y.push_back( aNPnts(1).Y()); 
 
+    }
+    
+    aSHPObj = SHPCreateObject( SHPT_POLYGON, -1, NbWires, &anPartStart[0], NULL, x.size(), &x[0], &y[0], NULL, NULL );
+    SHPWriteObject( theShpHandle, -1, aSHPObj );
+    SHPDestroyObject( aSHPObj );
+  }
+  else
+    return;
+}
index abab9c298f46841f28da1cba6491089826748347..886424df1b8fccb415d5ac2041b2334de872ab5f 100644 (file)
@@ -34,6 +34,8 @@ class SUIT_FileDlg;
 class gp_XYZ;
 class Handle_HYDROData_PolylineXY;
 class Handle_HYDROData_Polyline3D;
+class Handle_HYDROData_LandCover;
+class TopoDS_Face;
 
 class HYDROGUI_ExportFileOp : public HYDROGUI_Operation
 {
@@ -45,8 +47,11 @@ public:
 
 protected:
   virtual void startOperation();
-  void WriteObjectPolyXY(SHPHandle theShpHandle, Handle_HYDROData_PolylineXY thePoly );
-  void WriteObjectPoly3D(SHPHandle theShpHandle, Handle_HYDROData_Polyline3D thePoly );
+  int WriteObjectPolyXY(SHPHandle theShpHandle, Handle_HYDROData_PolylineXY thePoly );
+  int WriteObjectPoly3D(SHPHandle theShpHandle, Handle_HYDROData_Polyline3D thePoly );
+  int WriteObjectLC(SHPHandle theShpHandle, Handle_HYDROData_LandCover theLC );
+private:
+  void ProcessFace(TopoDS_Face theFace, SHPHandle theShpHandle);
  private:
   SUIT_FileDlg* myFileDlg;
   std::vector<SHPObject*> mySHPObjects;
diff --git a/src/HYDROGUI/HYDROGUI_ExportSinusXDlg.cxx b/src/HYDROGUI/HYDROGUI_ExportSinusXDlg.cxx
new file mode 100644 (file)
index 0000000..f277b75
--- /dev/null
@@ -0,0 +1,71 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_ExportSinusXDlg.h>
+#include <HYDROGUI_Module.h>
+#include <QtxDoubleSpinBox.h>
+#include <QLayout>
+#include <QLabel>
+#include <QStackedWidget>
+#include <QPushButton>
+#include "HYDROGUI_Module.h"
+#include <CAM_Application.h>
+#include <SUIT_Desktop.h>
+#include <QListWidget>
+#include <HYDROGUI_ObjListBox.h>
+
+
+HYDROGUI_ExportSinusXDlg::HYDROGUI_ExportSinusXDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle, false )
+{
+  QFrame* aFrame = new QFrame( mainFrame() );
+  addWidget( aFrame, 1 );
+
+  QGridLayout* aLayout = new QGridLayout( aFrame );
+  aLayout->setMargin( 5 );
+  aLayout->setSpacing( 5 );
+
+  QList<ObjectKind> anAllowedTypesToSave;
+  anAllowedTypesToSave.append(KIND_BATHYMETRY);   
+  anAllowedTypesToSave.append(KIND_POLYLINEXY);
+  anAllowedTypesToSave.append(KIND_PROFILE);
+
+  myList = new HYDROGUI_ObjListBox( theModule, tr( "OBJECTS_TO_EXPORT" ), anAllowedTypesToSave, mainFrame() );
+  aLayout->addWidget( myList, 0, 0 );
+
+  myExportBtn = new QPushButton( tr( "EXPORT" ) );
+
+  QHBoxLayout* aBtnsLayout = qobject_cast<QHBoxLayout*>(buttonFrame()->layout());
+  aBtnsLayout->addWidget( myExportBtn, 0 );
+  aBtnsLayout->addWidget( myCancel, 0 );
+  aBtnsLayout->addStretch( 1 );
+  aBtnsLayout->addWidget( myHelp, 0 );
+
+  connect( myExportBtn, SIGNAL( clicked() ), SIGNAL( ExportItems() ) );
+
+}
+
+HYDROGUI_ExportSinusXDlg::~HYDROGUI_ExportSinusXDlg()
+{
+}
+
+
+HYDROData_SequenceOfObjects HYDROGUI_ExportSinusXDlg::GetSelectedEntities()
+{
+  return myList->selectedObjects();
+}
\ No newline at end of file
diff --git a/src/HYDROGUI/HYDROGUI_ExportSinusXDlg.h b/src/HYDROGUI/HYDROGUI_ExportSinusXDlg.h
new file mode 100644 (file)
index 0000000..72e294a
--- /dev/null
@@ -0,0 +1,52 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_EXPORTSINUSXDLG_H
+#define HYDROGUI_EXPORTSINUSXDLG_H
+
+#include "HYDROGUI_InputPanel.h"
+#include <HYDROData_Entity.h>
+#include <QMap>
+
+class QtxDoubleSpinBox;
+class QStackedWidget;
+class QPushButton;
+class QListWidget;
+class QListWidgetItem;
+class HYDROGUI_ObjListBox;
+
+
+class HYDROGUI_ExportSinusXDlg : public HYDROGUI_InputPanel
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_ExportSinusXDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+  virtual ~HYDROGUI_ExportSinusXDlg();
+  HYDROData_SequenceOfObjects GetSelectedEntities();
+
+signals:
+  void            ExportItems();
+private:
+  
+  HYDROGUI_ObjListBox* myList;
+  QPushButton*    myExportBtn;
+
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_ExportSinusXOp.cxx b/src/HYDROGUI/HYDROGUI_ExportSinusXOp.cxx
new file mode 100644 (file)
index 0000000..6d33a7b
--- /dev/null
@@ -0,0 +1,81 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_ExportSinusXOp.h>
+#include <HYDROGUI_ExportSinusXDlg.h>
+#include <HYDROData_Document.h>
+#include <HYDROGUI_UpdateFlags.h>
+#include <HYDROGUI_Tool.h>
+#include <HYDROData_Bathymetry.h>
+#include <HYDROData_PolylineXY.h>
+#include <HYDROData_Profile.h>
+#include <HYDROData_Entity.h>
+#include <HYDROGUI_ObjListBox.h>
+#include <HYDROGUI_Operation.h>
+#include "HYDROGUI_Module.h"
+#include <HYDROData_SinusX.h>
+
+#include <SUIT_FileDlg.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Desktop.h>
+
+#include <LightApp_Application.h>
+#include <QApplication>
+
+HYDROGUI_ExportSinusXOp::HYDROGUI_ExportSinusXOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule )
+{
+  setName( tr( "EXPORT_SINUSX" ) );
+}
+
+HYDROGUI_ExportSinusXOp::~HYDROGUI_ExportSinusXOp()
+{
+}
+
+void HYDROGUI_ExportSinusXOp::startOperation()
+{
+  HYDROGUI_Operation::startOperation();
+
+  HYDROGUI_ExportSinusXDlg* aPanel = ::qobject_cast<HYDROGUI_ExportSinusXDlg*>( inputPanel() );
+  if ( !aPanel )
+    return;
+}
+
+HYDROGUI_InputPanel* HYDROGUI_ExportSinusXOp::createInputPanel() const
+{
+  HYDROGUI_ExportSinusXDlg* aPanel = new HYDROGUI_ExportSinusXDlg( module(), getName() );
+  connect( aPanel, SIGNAL( ExportItems() ), SLOT( onExportItems() ) );
+  return aPanel;
+}
+
+void HYDROGUI_ExportSinusXOp::onExportItems()
+{
+  QString aFilter( tr("SINUSX_FILTER") ); 
+  HYDROGUI_ExportSinusXDlg* aPanel = ::qobject_cast<HYDROGUI_ExportSinusXDlg*>( inputPanel() );
+  if ( !aPanel )
+    return;
+  if (!aPanel->GetSelectedEntities().IsEmpty())
+  {
+    //Export selected items to SX file
+    QString aFileName = SUIT_FileDlg::getFileName( module()->getApp()->desktop(), "", aFilter, tr( "EXPORT_SINUSX" ), false );
+    HYDROData_SinusX anExporter;
+    anExporter.Export(aFileName, aPanel->GetSelectedEntities());
+  }
+  else
+    SUIT_MessageBox::warning(module()->getApp()->desktop(), tr( "EXPORT_SINUSX" ), tr( "NO_ENTITIES_TO_EXPORT"));
+}
diff --git a/src/HYDROGUI/HYDROGUI_ExportSinusXOp.h b/src/HYDROGUI/HYDROGUI_ExportSinusXOp.h
new file mode 100644 (file)
index 0000000..b5e5bf6
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_EXPORTSINUSXOP_H
+#define HYDROGUI_EXPORTSINUSXOP_H
+
+#include "HYDROGUI_Operation.h"
+
+class HYDROGUI_ExportSinusXOp : public HYDROGUI_Operation
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_ExportSinusXOp( HYDROGUI_Module* theModule );
+  virtual ~HYDROGUI_ExportSinusXOp();
+
+protected:
+  virtual void startOperation();
+
+  virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+protected slots:
+  void   onExportItems();
+
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.cxx
new file mode 100644 (file)
index 0000000..40a4b72
--- /dev/null
@@ -0,0 +1,178 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_ImportLandCoverDlg.h"
+
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QListWidget>
+#include <QVBoxLayout>
+#include <QToolButton>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SUIT_FileDlg.h>
+
+
+HYDROGUI_ImportLandCoverDlg::HYDROGUI_ImportLandCoverDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle )
+{
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+
+  myFileNameGroup = new QGroupBox( tr( "IMPORT_LANDCOVER_FROM_FILE" ) );
+
+  QLabel* aFileNameLabel = new QLabel( tr( "FILE_NAME" ), myFileNameGroup );
+
+  myFileName = new QLineEdit( myFileNameGroup );
+  myFileName->setReadOnly( true );
+
+  QToolButton* aBrowseBtn = new QToolButton( myFileNameGroup );
+  aBrowseBtn->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "BROWSE_ICO" ) ) );
+
+  QBoxLayout* aFileNameLayout = new QHBoxLayout( myFileNameGroup );
+  aFileNameLayout->setMargin( 5 );
+  aFileNameLayout->setSpacing( 5 );
+  aFileNameLayout->addWidget( aFileNameLabel );
+  aFileNameLayout->addWidget( myFileName );
+  aFileNameLayout->addWidget( aBrowseBtn );
+
+  myObjectNameGroup = new QGroupBox( tr( "LANDCOVER_NAME" ) );
+
+  QLabel* aLandcoverNameLabel = new QLabel( tr( "NAME" ), myObjectNameGroup );
+  myObjectName = new QLineEdit( myObjectNameGroup );
+
+  QBoxLayout* aLandcoverNameLayout = new QHBoxLayout( myObjectNameGroup );
+  aLandcoverNameLayout->setMargin( 5 );
+  aLandcoverNameLayout->setSpacing( 5 );
+  aLandcoverNameLayout->addWidget( aLandcoverNameLabel );
+  aLandcoverNameLayout->addWidget( myObjectName );
+
+  QGroupBox* aPolygonsGroup = new QGroupBox( tr( "FOUNDED_POLYGONS" ), mainFrame() );
+  myPolygons = new QListWidget( aPolygonsGroup );
+  myPolygons->setSelectionMode( QListWidget::ExtendedSelection );
+  myPolygons->setEditTriggers( QListWidget::NoEditTriggers );
+  myPolygons->setViewMode( QListWidget::ListMode );
+  myPolygons->setSortingEnabled( false );
+
+  QBoxLayout* aPolygonsLayout = new QVBoxLayout;
+  aPolygonsLayout->addWidget( myPolygons );
+  aPolygonsGroup->setLayout( aPolygonsLayout );
+  
+  // Layout
+  addWidget( myFileNameGroup );
+  addWidget( myObjectNameGroup );  
+  addWidget( aPolygonsGroup );
+
+  // Conections
+  connect( myPolygons, SIGNAL( itemSelectionChanged() ), this, SLOT( onItemSelectionChanged() ) );
+  connect( aBrowseBtn, SIGNAL( clicked() ), this, SLOT( onBrowse() ) );
+}
+
+HYDROGUI_ImportLandCoverDlg::~HYDROGUI_ImportLandCoverDlg()
+{
+}
+
+void HYDROGUI_ImportLandCoverDlg::reset()
+{
+  myPolygons->clear();
+}
+
+void HYDROGUI_ImportLandCoverDlg::setPolygonNames( const QStringList& theNames )
+{
+  myPolygons->clear();
+  myPolygons->addItems( theNames );
+}
+
+void HYDROGUI_ImportLandCoverDlg::removePolygonNames( const QStringList& theNames )
+{
+  QList<QListWidgetItem*> aFoundItems;
+
+  foreach ( const QString& aName, theNames ) {
+    aFoundItems = myPolygons->findItems( aName, Qt::MatchExactly );
+    foreach ( QListWidgetItem* anItem, aFoundItems ) {
+      anItem = myPolygons->takeItem( myPolygons->row( anItem ) );
+      delete anItem;
+    }
+  }
+}
+
+void HYDROGUI_ImportLandCoverDlg::setSelectedPolygonNames( const QStringList& theNames )
+{
+  myPolygons->clearSelection();
+
+  foreach( const QString aName, theNames ) {
+    QList<QListWidgetItem*> anItems = myPolygons->findItems( aName, Qt::MatchExactly );
+    if ( anItems.count() == 1 ) {
+      anItems.first()->setSelected( true );
+    }
+  }
+}
+
+void HYDROGUI_ImportLandCoverDlg::onItemSelectionChanged()
+{
+  emit selectionChanged( getSelectedPolygonNames() );
+}
+
+QStringList HYDROGUI_ImportLandCoverDlg::getSelectedPolygonNames() const
+{
+  QStringList aSelectedNames;
+
+  QList<QListWidgetItem*> aSelectedItems = myPolygons->selectedItems();
+  foreach( const QListWidgetItem* anItem, aSelectedItems ) {
+    aSelectedNames << anItem->text();
+  }
+
+  return aSelectedNames;
+}
+
+
+void HYDROGUI_ImportLandCoverDlg::onBrowse()
+{
+  QString aFilter( tr( "LANDCOVER_FILTER" ) );
+  QString aFileName = SUIT_FileDlg::getFileName( this, "", aFilter, tr( "IMPORT_LANDCOVER_FROM_FILE" ), true );
+
+  if( !aFileName.isEmpty() )
+  {
+    setFileName( aFileName );
+    emit FileSelected( aFileName );
+  }
+}
+
+void HYDROGUI_ImportLandCoverDlg::setObjectName( const QString& theName )
+{
+  myObjectName->setText( theName );
+  myObjectNameGroup->setEnabled( !theName.isEmpty() || !myFileName->text().isEmpty() );
+}
+
+QString HYDROGUI_ImportLandCoverDlg::getObjectName() const
+{
+  return myObjectName->text();
+}
+
+void HYDROGUI_ImportLandCoverDlg::setFileName( const QString& theFileName )
+{
+  myFileName->setText( theFileName );
+
+  if ( !myObjectNameGroup->isEnabled() )
+    myObjectNameGroup->setEnabled( !theFileName.isEmpty() );
+}
+
+QString HYDROGUI_ImportLandCoverDlg::getFileName() const
+{
+  return myFileName->text();
+}
\ No newline at end of file
diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.h b/src/HYDROGUI/HYDROGUI_ImportLandCoverDlg.h
new file mode 100644 (file)
index 0000000..67482a9
--- /dev/null
@@ -0,0 +1,74 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+
+#ifndef HYDROGUI_ImportLandCoverDlg_H
+#define HYDROGUI_ImportLandCoverDlg_H
+
+#include "HYDROGUI_InputPanel.h"
+
+class QListWidget;
+class QLineEdit;
+class QGroupBox;
+
+class HYDROGUI_ImportLandCoverDlg : public HYDROGUI_InputPanel
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_ImportLandCoverDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+  virtual ~HYDROGUI_ImportLandCoverDlg();
+
+  void reset();
+
+  void setPolygonNames( const QStringList& theNames );
+  void removePolygonNames( const QStringList& theNames );
+
+  void setSelectedPolygonNames( const QStringList& theNames );
+
+  QStringList getSelectedPolygonNames() const;
+
+  void                       setObjectName( const QString& theName );
+  QString                    getObjectName() const;
+
+  void                       setFileName( const QString& theFileName );
+  QString                    getFileName() const;
+
+signals:
+  void                       FileSelected( const QString& theFileName );
+
+protected slots:
+  void                       onBrowse();
+  
+signals:
+  void selectionChanged( const QStringList& );
+
+public slots:
+  void onItemSelectionChanged();
+
+private:
+  QLineEdit*                 myFileName; 
+  QGroupBox*                 myFileNameGroup;
+  QListWidget*               myPolygons;       
+
+  QGroupBox*                 myObjectNameGroup;
+  QLineEdit*                 myObjectName;
+
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx b/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.cxx
new file mode 100644 (file)
index 0000000..d072688
--- /dev/null
@@ -0,0 +1,441 @@
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_ImportLandCoverOp.h"
+
+#include "HYDROGUI_DataModel.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_UpdateFlags.h"
+#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_ImportLandCoverDlg.h"
+#include "HYDROGUI_Shape.h"
+#include <HYDROData_LandCover.h>
+#include <HYDROGUI_ZLayers.h>
+
+#include <HYDROGUI_DataObject.h>
+#include <HYDROData_Iterator.h>
+
+#include <HYDROData_Profile.h>
+
+#include <SUIT_Desktop.h>
+#include <SUIT_FileDlg.h>
+#include <LightApp_Application.h>
+
+#include <QApplication>
+#include <QFile>
+#include <QFileInfo>
+#include <SUIT_MessageBox.h>
+
+#include <OCCViewer_ViewManager.h>
+#include <OCCViewer_ViewModel.h>
+
+#include <SalomeApp_Study.h>
+
+#include <LightApp_Application.h>
+#include <LightApp_DataOwner.h>
+#include <LightApp_Displayer.h>
+#include <LightApp_SelectionMgr.h>
+
+#include <SUIT_Desktop.h>
+#include <SUIT_ViewManager.h>
+
+#include <BRep_Builder.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Wire.hxx>
+#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <gp_Pln.hxx>
+#include <BRepLib.hxx>
+#include <ShapeFix_Shape.hxx>
+
+
+HYDROGUI_ImportLandCoverOp::HYDROGUI_ImportLandCoverOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule )
+{
+  setName( tr( "IMPORT_LANDCOVER" ) );
+}
+
+HYDROGUI_ImportLandCoverOp::~HYDROGUI_ImportLandCoverOp()
+{
+  erasePreview();
+}
+
+void HYDROGUI_ImportLandCoverOp::startOperation()
+{
+  HYDROGUI_Operation::startOperation();
+
+  if ( !getPreviewManager() ) {
+    setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>( 
+                       module()->getApp()->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
+  }
+
+  if ( !isApplyAndClose() ) {
+    return;
+  }
+
+  HYDROGUI_ImportLandCoverDlg* aPanel = 
+    ::qobject_cast<HYDROGUI_ImportLandCoverDlg*>( inputPanel() );
+  if ( !aPanel ) {
+    return;
+  }
+
+  aPanel->reset();
+}
+
+
+HYDROGUI_InputPanel* HYDROGUI_ImportLandCoverOp::createInputPanel() const
+{
+  HYDROGUI_InputPanel* aPanel = new HYDROGUI_ImportLandCoverDlg( module(), getName() );
+
+  connect( aPanel, SIGNAL( FileSelected( const QString& ) ), SLOT( onFileSelected() ) );
+
+  connect( aPanel, SIGNAL( selectionChanged( const QStringList& ) ), this, SLOT( onSelectionChanged( const QStringList& ) ) );
+
+  return aPanel;
+}
+
+bool HYDROGUI_ImportLandCoverOp::processApply( int& theUpdateFlags,
+                                                QString& theErrorMsg,
+                                                QStringList& theBrowseObjectsEntries )
+{
+
+  HYDROGUI_ImportLandCoverDlg* aPanel = ::qobject_cast<HYDROGUI_ImportLandCoverDlg*>( inputPanel() );
+  if ( !aPanel ) {
+    return false;
+  }
+  
+  QStringList aSelectedtPolygons = aPanel->getSelectedPolygonNames();
+  aPanel->removePolygonNames( aSelectedtPolygons );
+    
+  if (!aSelectedtPolygons.empty())
+  {
+    Handle(HYDROData_LandCover) aLC =  Handle(HYDROData_LandCover)::DownCast( doc()->CreateObject( KIND_LAND_COVER ) );
+    TopoDS_Shape aResShape;
+    if (aSelectedtPolygons.size() > 1) 
+    {
+      TopoDS_Compound cmp;
+      BRep_Builder BB;
+      BB.MakeCompound(cmp);
+
+      foreach ( QString aName, aSelectedtPolygons ) {
+        TopoDS_Shape aShape = myPolygonName2PrsShape.value( aName )->getTopoShape();
+        if ( aShape.IsNull() ) 
+          continue;
+        BB.Add(cmp, aShape);
+        HYDROGUI_Shape* aShapeToDelete = myPolygonName2PrsShape.take( aName );
+        delete aShapeToDelete;
+      }
+      aResShape = cmp;
+    }
+    else
+    {         
+      TopoDS_Shape aShape = myPolygonName2PrsShape.value( aSelectedtPolygons.first() )->getTopoShape();
+      if ( !aShape.IsNull() ) 
+      {
+        HYDROGUI_Shape* aShapeToDelete = myPolygonName2PrsShape.take( aSelectedtPolygons.first() );
+        delete aShapeToDelete;
+       aResShape = aShape;
+      }
+    }
+    if( !aLC.IsNull() ) 
+    {
+      QString aLCName = aPanel->getObjectName() + "_polygon";
+      int i = 0;
+      for( ;HYDROGUI_Tool::FindObjectByName(module(), aLCName); i++)
+        aLCName = aPanel->getObjectName() + "_polygon_" + QString::number(i);
+      aLC->SetName( aLCName );
+      aLC->SetFillingColor( HYDROData_LandCover::DefaultFillingColor() );
+      aLC->SetBorderColor( HYDROData_LandCover::DefaultBorderColor() );
+      
+      aLC->setShape(aResShape);
+      aLC->Show();
+            
+      //erasePreview();
+      
+      module()->setIsToUpdate( aLC );
+      
+    }
+  }
+  module()->update( UF_Model | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init );
+
+  if ( isApplyAndClose() )
+    erasePreview();
+
+  return true;
+}
+
+
+void HYDROGUI_ImportLandCoverOp::Parse(SHPHandle theHandle)
+{
+  int aShapeType;
+  mySHPObjects.clear();
+  SHPGetInfo( theHandle, NULL, &aShapeType, NULL, NULL );
+  if (aShapeType == 5) 
+  {
+    for (int i = 0; i < theHandle->nRecords; i++) 
+      mySHPObjects.push_back(SHPReadObject(theHandle, i));
+  }
+}
+
+void HYDROGUI_ImportLandCoverOp::ProcessSHP(SHPObject* anObj, int i, TopoDS_Face& F)
+{
+  TopoDS_Wire W;
+  TopoDS_Edge E; 
+  int nParts = anObj->nParts;
+  gp_Pln pln(gp_Pnt(0,0,0), gp_Dir(0,0,1));
+  BRepBuilderAPI_MakeFace aFBuilder(pln);
+
+  //Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;
+  //sfs->FixFaceTool()->FixOrientationMode() = 1;
+  
+  for ( int i = 0 ; i < nParts ; i++ )
+  { 
+    BRepBuilderAPI_MakeWire aBuilder;
+    int StartIndex = anObj->panPartStart[i];
+    int EndIndex;
+    if (i != nParts - 1)
+      EndIndex = anObj->panPartStart[i + 1];
+    else
+      EndIndex = anObj->nVertices;
+
+    for ( int k = StartIndex; k < EndIndex - 1  ; k++ )
+    {
+      gp_Pnt P1 (anObj->padfX[k], anObj->padfY[k], 0);
+      gp_Pnt P2 (anObj->padfX[k+1], anObj->padfY[k+1], 0);
+      if (P1.Distance(P2) < Precision::Confusion())
+        continue;
+      BRepBuilderAPI_MakeEdge aMakeEdge(P1, P2);
+      aBuilder.Add(TopoDS::Edge(aMakeEdge.Shape()));
+    }
+    
+    aBuilder.Build();
+    W = TopoDS::Wire(aBuilder.Shape());
+    W.Reverse();
+    aFBuilder.Add(W);
+  }
+
+  aFBuilder.Build();
+  TopoDS_Face DF = aFBuilder.Face();
+  BRepLib::BuildCurves3d(DF);  
+  bool IsInf = DF.Infinite();
+  if(!DF.IsNull()) 
+  {
+    //sfs->Init ( DF );
+    //sfs->Perform();
+    F = DF; //TopoDS::Face(sfs->Shape());
+  }
+}
+
+void HYDROGUI_ImportLandCoverOp::onFileSelected()
+{
+  HYDROGUI_ImportLandCoverDlg* aPanel = ::qobject_cast<HYDROGUI_ImportLandCoverDlg*>( inputPanel() );
+  if ( !aPanel )
+    return;
+  
+  QString anObjectName = aPanel->getObjectName().simplified();
+  anObjectName = aPanel->getFileName();
+  if ( !anObjectName.isEmpty() ) 
+      anObjectName = QFileInfo( anObjectName ).baseName();
+
+  if ( anObjectName.isEmpty() ) 
+    anObjectName = HYDROGUI_Tool::GenerateObjectName( module(), tr( "DEFAULT_LANDCOVER_NAME" ) );
+  aPanel->setObjectName( anObjectName );
+
+  QString aFileName = aPanel->getFileName();
+  if ( aFileName.isEmpty() )
+  {
+    abort();
+    return;
+  }
+
+  QString anExt = aFileName.split('.', QString::SkipEmptyParts).back();
+
+  if (anExt == "shp")
+  {
+    SHPHandle aHSHP;
+    aHSHP = SHPOpen( aFileName.toAscii().data(), "rb" );
+    Parse(aHSHP);
+    
+    startDocOperation();
+    QStringList aPolygonsList;
+    for (int i = 0; i < mySHPObjects.size(); i++)
+      aPolygonsList.append("polygon_" + QString::number(i + 1));
+    aPanel->setPolygonNames(aPolygonsList);
+
+    SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( module()->getApp()->activeStudy() );
+    if ( !aStudy ) {
+      return;
+    }
+
+    erasePreview();
+
+    Handle(AIS_InteractiveContext) aCtx = NULL;
+
+    LightApp_Application* anApp = module()->getApp();
+    if ( !getPreviewManager() )
+      setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>( anApp->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
+    OCCViewer_ViewManager* aViewManager = getPreviewManager();
+
+    if ( aViewManager )
+    {
+      if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() )
+      {
+        aCtx = aViewer->getAISContext();
+        connect( aViewer, SIGNAL( selectionChanged() ), this, SLOT( onViewerSelectionChanged() ) );
+      }
+    }
+
+    QApplication::setOverrideCursor(Qt::WaitCursor);
+
+    TopTools_SequenceOfShape aFaces;
+    TopoDS_Face aF;
+    if (aHSHP->nShapeType == 5)
+    {
+      for (int i = 0; i < mySHPObjects.size(); i++) 
+      {
+         ProcessSHP(mySHPObjects[i], i, aF);
+         aFaces.Append(aF);
+      }
+    }
+    else
+      SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "IMPORT_LANDCOVER" ), "Cannot import land cover;\nThe shape type is not polygon" );
+    QApplication::restoreOverrideCursor();
+
+    Handle(HYDROData_LandCover) aLC = Handle(HYDROData_LandCover)::DownCast( doc()->CreateObject( KIND_LAND_COVER ) );
+    for ( int i = 1; i <= aFaces.Length(); i++ ) 
+    {
+      TopoDS_Face aFace = TopoDS::Face(aFaces.Value( i ));
+
+      aLC->setShape( aFace );      
+      
+      if ( aViewManager && !aCtx.IsNull() )
+      {
+        HYDROGUI_Shape* aShape = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
+
+        aShape->setFillingColor( HYDROData_LandCover::DefaultFillingColor(), false, false );
+        aShape->setBorderColor( HYDROData_LandCover::DefaultBorderColor(), false, false );
+        if( !aFace.IsNull() )
+          aShape->setShape( aLC->GetShape() );
+        myPolygonName2PrsShape.insert( "polygon_" + QString::number(i), aShape);
+      }
+    }
+    aLC->Remove();
+
+    if ( !aCtx.IsNull() ) {
+      UpdateZLayersOfHilightPresentationsOfDisplayedObjects( aCtx, Graphic3d_ZLayerId_TopOSD );
+      aCtx->UpdateCurrentViewer();
+    }
+
+    commitDocOperation();
+    
+    for (size_t i = 0; i < mySHPObjects.size(); i++ )
+      free (mySHPObjects[i]);
+
+    mySHPObjects.clear();
+    SHPClose(aHSHP);
+  }
+  
+}
+
+void HYDROGUI_ImportLandCoverOp::onSelectionChanged( const QStringList& theSelectedNames )
+{
+  Handle(AIS_InteractiveContext) aCtx = NULL;
+
+  OCCViewer_ViewManager* aViewManager = getPreviewManager();
+  if ( aViewManager ) {
+    if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
+      aCtx = aViewer->getAISContext();
+    }
+  }
+
+  if ( !aCtx.IsNull() ) {
+    foreach ( QString aName, myPolygonName2PrsShape.keys() ) {
+      Handle(AIS_InteractiveObject) anObject = 
+        myPolygonName2PrsShape.value(aName)->getAISObject();
+
+      bool isSelected = theSelectedNames.contains( aName );
+      if ( ( isSelected && !aCtx->IsSelected( anObject) ) ||
+           ( !isSelected && aCtx->IsSelected( anObject) ) ) {
+        aCtx->AddOrRemoveSelected( anObject, Standard_False );
+      }
+    }
+    aCtx->UpdateCurrentViewer();
+  }
+}
+
+
+void HYDROGUI_ImportLandCoverOp::onViewerSelectionChanged()
+{
+  // Get panel
+  HYDROGUI_ImportLandCoverDlg* aPanel = ::qobject_cast<HYDROGUI_ImportLandCoverDlg*>( inputPanel() );
+  if ( !aPanel ) {
+    return;
+  }
+
+  OCCViewer_ViewManager* aViewManager = getPreviewManager();
+  Handle(AIS_InteractiveContext) aCtx = NULL;
+  if ( aViewManager ) {
+    if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
+      aCtx = aViewer->getAISContext();
+    }
+  }
+  
+  if ( !aCtx.IsNull() )
+  {
+    QStringList aSelectedNames;
+    foreach ( QString aName, myPolygonName2PrsShape.keys() ) {
+      bool isSelected = aCtx->IsSelected( myPolygonName2PrsShape.value(aName)->getAISObject() );
+      if ( isSelected ) {
+        aSelectedNames << aName;
+      }
+    }
+    aPanel->setSelectedPolygonNames( aSelectedNames );
+  }
+}
+
+
+void HYDROGUI_ImportLandCoverOp::erasePreview()
+{
+  foreach ( HYDROGUI_Shape* aShape, myPolygonName2PrsShape ) {
+    delete aShape;
+  }
+
+  myPolygonName2PrsShape.clear();
+}
+
+
+void HYDROGUI_ImportLandCoverOp::abortOperation()
+{
+  LightApp_Application* anApp = module()->getApp();
+  if ( anApp ) {
+    anApp->disconnect( this );
+  }
+
+  erasePreview();
+
+  HYDROGUI_Operation::abortOperation();
+}
+
+
diff --git a/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.h b/src/HYDROGUI/HYDROGUI_ImportLandCoverOp.h
new file mode 100644 (file)
index 0000000..35c8ef8
--- /dev/null
@@ -0,0 +1,67 @@
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_IMPORTLANDCOVER_H
+#define HYDROGUI_IMPORTLANDCOVER_H
+
+#include "HYDROGUI_Operation.h"
+#include <vector>
+#include <QMap>
+
+//extern "C" {
+#include <shapelib/shapefil.h> 
+//};
+
+class SUIT_FileDlg;
+class HYDROGUI_Shape;
+class TopoDS_Face;
+
+
+class HYDROGUI_ImportLandCoverOp : public HYDROGUI_Operation
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_ImportLandCoverOp( HYDROGUI_Module* theModule );
+  virtual ~HYDROGUI_ImportLandCoverOp();
+
+protected:
+  virtual void startOperation();
+  virtual void abortOperation();
+
+  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg, QStringList& theBrowseObjectsEntries );
+  HYDROGUI_InputPanel* createInputPanel() const;
+  void Parse(SHPHandle theHandle);
+  void ProcessSHP(SHPObject* anObj, int i, TopoDS_Face& F);
+  void erasePreview();
+protected slots:
+  void onFileSelected();
+  void onSelectionChanged( const QStringList& theSelectedNames );
+  void onViewerSelectionChanged ();
+
+private:
+  std::vector<SHPObject*> mySHPObjects;
+  QMap<QString, HYDROGUI_Shape*> myPolygonName2PrsShape;
+};
+
+#endif
index 210ccf587af15d6c3465bcce95a49bd843a1a8cb..a3c7f833205e32a8f7d36fafb8656da35172235a 100644 (file)
@@ -41,7 +41,7 @@
 #include <QApplication>
 #include <QFile>
 #include <QFileInfo>
-#include <QMessageBox>
+#include <SUIT_MessageBox.h>
 
 
 HYDROGUI_ImportPolylineOp::HYDROGUI_ImportPolylineOp( HYDROGUI_Module* theModule )
@@ -77,173 +77,95 @@ void HYDROGUI_ImportPolylineOp::onApply()
     return;
   }
 
-  QString aFileName = myFileDlg->selectedFile();
-  if ( aFileName.isEmpty() )
+  QStringList aFileNames = myFileDlg->selectedFiles();
+  
+  QApplication::setOverrideCursor( Qt::WaitCursor );  
+  startDocOperation();
+
+  foreach (QString aFileName, aFileNames) 
   {
-    abort();
-    return;
-  }
+    if ( aFileName.isEmpty() )
+      continue;
 
-  QString anExt = aFileName.split('.', QString::SplitBehavior::SkipEmptyParts).back();
+    QString anExt = aFileName.split('.', QString::SkipEmptyParts).back();
 
-  if (anExt == "shp")
-  {
-    SHPHandle aHSHP;
-    aHSHP = SHPOpen( aFileName.toAscii().data(), "rb" );
-    Parse(aHSHP);
-    
-    QApplication::setOverrideCursor( Qt::WaitCursor );
-    
-    startDocOperation();
+    if (anExt == "shp")
+    {
+      SHPHandle aHSHP;
+      aHSHP = SHPOpen( aFileName.toAscii().data(), "rb" );
+      Parse(aHSHP);
 
-    HYDROData_Iterator anIter( doc() );
-    int anInd = 0;
-    QStringList anExistingNames;
-    std::vector<int> anAllowedIndexes;
-    for( ; anIter.More(); anIter.Next() )
-      anExistingNames.push_back(anIter.Current()->GetName());
+      HYDROData_Iterator anIter( doc() );
+      int anInd = 0;
+      QStringList anExistingNames;
+      std::vector<int> anAllowedIndexes;
+      for( ; anIter.More(); anIter.Next() )
+        anExistingNames.push_back(anIter.Current()->GetName());
 
-    QFileInfo aFileInfo(aFileName);
-    QString aBaseFileName = aFileInfo.baseName();
+      QFileInfo aFileInfo(aFileName);
+      QString aBaseFileName = aFileInfo.baseName();
 
-    if (aHSHP->nShapeType == 3 || aHSHP->nShapeType == 23)
-    {
-      anInd = 0;
-      for (;anAllowedIndexes.size() < mySHPObjects.size();)
+      if (aHSHP->nShapeType == 3 || aHSHP->nShapeType == 23)
       {
-        if (!anExistingNames.contains(aBaseFileName + "_PolyXY_" + QString::number(anInd)))
+        anInd = 0;
+        for (;anAllowedIndexes.size() < mySHPObjects.size();)
         {
-          anAllowedIndexes.push_back(anInd);
-          anInd++;
+          if (!anExistingNames.contains(aBaseFileName + "_PolyXY_" + QString::number(anInd)))
+          {
+            anAllowedIndexes.push_back(anInd);
+            anInd++;
+          }
+          else
+            anInd++;
+        }
+        
+        for (size_t i = 0; i < mySHPObjects.size(); i++ )
+        {
+          ProcessSHPPolyXY(mySHPObjects[i], aBaseFileName, anAllowedIndexes[i]);
         }
-        else
-          anInd++;
-      }
-      
-      for (size_t i = 0; i < mySHPObjects.size(); i++ )
-      {
-        ProcessSHPPolyXY(mySHPObjects[i], aBaseFileName, anAllowedIndexes[i]);
       }
-    }
-    else if (aHSHP->nShapeType == 13)
-    {
-      anInd = 0;
-      for (;anAllowedIndexes.size() < mySHPObjects.size();)
+      else if (aHSHP->nShapeType == 13)
       {
-        if (!anExistingNames.contains(aBaseFileName + "_PolyXY_" + QString::number(anInd)) &&
-            !anExistingNames.contains(aBaseFileName + "_Poly3D_" + QString::number(anInd)) &&
-            !anExistingNames.contains(aBaseFileName + "_Bath_" + QString::number(anInd)))
+        anInd = 0;
+        for (;anAllowedIndexes.size() < mySHPObjects.size();)
         {
-          anAllowedIndexes.push_back(anInd);
-          anInd++;
+          if (!anExistingNames.contains(aBaseFileName + "_PolyXY_" + QString::number(anInd)) &&
+              !anExistingNames.contains(aBaseFileName + "_Poly3D_" + QString::number(anInd)) &&
+              !anExistingNames.contains(aBaseFileName + "_Bath_" + QString::number(anInd)))
+          {
+            anAllowedIndexes.push_back(anInd);
+            anInd++;
+          }
+          else
+            anInd++;
         }
-        else
-          anInd++;
+        for (size_t i = 0; i < mySHPObjects.size(); i++ )
+          ProcessSHPPoly3D(mySHPObjects[i], aBaseFileName, anAllowedIndexes[i]);
+      }
+      else  
+      {
+        SUIT_MessageBox::warning( module()->getApp()->desktop(), tr( "IMPORT_POLYLINE" ), "Cannot import polyline;\nThe shape type is incorrect" );
       }
-      for (size_t i = 0; i < mySHPObjects.size(); i++ )
-        ProcessSHPPoly3D(mySHPObjects[i], aBaseFileName, anAllowedIndexes[i]);
-    }
-    commitDocOperation();
-    commit();
     
-    for (size_t i = 0; i < mySHPObjects.size(); i++ )
-      free (mySHPObjects[i]);
+      for (size_t i = 0; i < mySHPObjects.size(); i++ )
+        free (mySHPObjects[i]);
 
-    mySHPObjects.clear();
-    SHPClose(aHSHP);
+      mySHPObjects.clear();
+      SHPClose(aHSHP);
+    }
   }
-  else if (anExt == "sx")
+  if (!aFileNames.empty())
   {
-    QFile aFile (aFileName);
-    aFile.open(QIODevice::ReadOnly);
-
-    Parse(aFile);
-
-    QApplication::setOverrideCursor( Qt::WaitCursor );
-
-    startDocOperation();
-
-    ProcessSX();
-
     commitDocOperation();
     commit();
-    aFile.close();
+    module()->update( UF_Model | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init );
   }
-
-  module()->update( UF_Model | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init );
+  else
+    abort();
   
   QApplication::restoreOverrideCursor();
 }
 
-void HYDROGUI_ImportPolylineOp::ProcessSX()
-{
-  Handle(HYDROData_PolylineXY) aPolylineXY = Handle(HYDROData_PolylineXY)::DownCast( doc()->CreateObject( KIND_POLYLINEXY ) );
-
-  Handle(HYDROData_Polyline3D) aPolylineObj = Handle(HYDROData_Polyline3D)::DownCast( doc()->CreateObject( KIND_POLYLINE ) );
-
-  Handle(HYDROData_Bathymetry) aBath = Handle(HYDROData_Bathymetry)::DownCast( doc()->CreateObject( KIND_BATHYMETRY ) );
-  HYDROData_Bathymetry::AltitudePoints aAPoints;
-
-  int aNSect = myCurveBlocks.size();
-  for ( int i = 0 ; i < aNSect ; i++ )
-  {
-    bool aSectClosure = true;
-    HYDROData_PolylineXY::SectionType aSectType = HYDROData_PolylineXY::SECTION_POLYLINE; 
-    aPolylineXY->AddSection( TCollection_AsciiString(myCurveBlocks[i].myName.toStdString().c_str()), aSectType, myCurveBlocks[i].myIsConnected );
-  
-    for ( int k = 0 ; k < myCurveBlocks[i].myXYZPoints.size() ; k+=3 )
-    {
-      HYDROData_PolylineXY::Point aSectPoint;
-      aSectPoint.SetX( myCurveBlocks[i].myXYZPoints[k].X() );
-      aSectPoint.SetY( myCurveBlocks[i].myXYZPoints[k].Y() );
-      aPolylineXY->AddPoint( i, aSectPoint );
-  
-      aAPoints.Append(myCurveBlocks[i].myXYZPoints[k]);
-    }
-  }
-  QString aFileName = myFileDlg->selectedFile();
-  QFileInfo aFileInfo(aFileName);
-  QString aBaseFileName = aFileInfo.baseName();
-  QString aBathName = aBaseFileName + "_bath_1";
-  QString aPolyXYName = aBaseFileName + "_polyXY_1";
-  QString aPoly3DName = aBaseFileName + "_poly3D_1";
-  
-  int anInd = 2;
-  for (;HYDROGUI_Tool::FindObjectByName( module(), aBathName, KIND_BATHYMETRY) || 
-        HYDROGUI_Tool::FindObjectByName( module(), aPolyXYName, KIND_POLYLINEXY) ||
-        HYDROGUI_Tool::FindObjectByName( module(), aPoly3DName, KIND_POLYLINE);)
-  {
-    aBathName = aBaseFileName + "_bath_" + QString::number(anInd);
-    aPolyXYName = aBaseFileName + "_polyXY_" + QString::number(anInd);
-    aPoly3DName = aBaseFileName + "_poly3D_" + QString::number(anInd);
-    anInd++;
-  }
-  
-  aPolylineXY->SetName( aPolyXYName );
-  aPolylineXY->SetWireColor(HYDROData_PolylineXY::DefaultWireColor());
-  aPolylineXY->Update();
-  
-  aBath->SetAltitudePoints(aAPoints);
-  aBath->SetName( aBathName );
-  
-  aPolylineObj->SetPolylineXY (aPolylineXY, false);
-  aPolylineObj->SetAltitudeObject(aBath);
-  
-  aPolylineObj->SetBorderColor( HYDROData_Polyline3D::DefaultBorderColor() );
-  aPolylineObj->SetName( aPoly3DName );
-  
-  aPolylineObj->Update();
-  
-  size_t anActiveViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( module() );
-  if ( anActiveViewId == 0 )
-    anActiveViewId = HYDROGUI_Tool::GetActiveOCCViewId( module() );
-  
-  module()->setObjectVisible( anActiveViewId, aPolylineXY, true );
-  module()->setObjectVisible( anActiveViewId, aPolylineObj, true );
-  
-  module()->setIsToUpdate( aPolylineObj );
-}
-
 void HYDROGUI_ImportPolylineOp::ProcessSHPPolyXY(SHPObject* anObj, QString theFileName, int theInd)
 {
   //if (anObj->nSHPType != SHPT_ARC && anObj->nSHPType != SHPT_ARCM)
@@ -371,109 +293,6 @@ void HYDROGUI_ImportPolylineOp::ProcessSHPPoly3D(SHPObject* anObj, QString theFi
   module()->setIsToUpdate( aPolylineObj );
 }
 
-
-bool HYDROGUI_ImportPolylineOp::Parse( QFile& theFile)
-{
-  if ( !theFile.isOpen() )
-    return false;
-
-  QString aLine;
-  QString aBLine;
-  QStringList aList;
-  QStringList aBList;
-  myCurveBlocks.clear();
-  bool aTotStat = true;
-
-  aLine = theFile.readLine().simplified();
-  aList = aLine.split( ' ', QString::SkipEmptyParts );
-
-  for (;!theFile.atEnd();) 
-  {
-    if (aList[0] == "B" && (aList[1] == "C" || aList[1] == "P" || aList[1] == "N"))
-    {  
-      HYDROGUI_CurveBlock aCurveBlockInfo;
-      if (aList[1] == "C")
-        aCurveBlockInfo.myType = 1;
-      else if (aList[1] == "P")
-        aCurveBlockInfo.myType = 2;
-      else if (aList[1] == "N")
-        aCurveBlockInfo.myType = 2;
-
-      if (aList.size() == 9)
-      {
-        for (int j = 2; j < 8; j++)
-          aCurveBlockInfo.myRefCoords.push_back(aList[j].toDouble());
-        aCurveBlockInfo.myRefRatio = aList[8].toDouble();
-      }
-
-      QString Name;
-      do
-      {
-        aBLine = theFile.readLine().simplified();
-        aBList = aBLine.split( ' ', QString::SkipEmptyParts );
-         
-        if (aBList[0] == "CP")
-        {
-          if (aBList.size() == 2 && (aBList[1] == "0" || aBList[1] == "1" || aBList[1] == "2"))
-            aCurveBlockInfo.myCurvePlane = aBList[1].toInt();
-          else if (aBList.size() == 3 && (aBList[1] == "0" || aBList[1] == "1") && (aBList[2] == "0" || aBList[2] == "1"))
-          {
-            aCurveBlockInfo.myIsClosed = aBList[1].toInt();
-            aCurveBlockInfo.myIsClosed = aBList[2].toInt();
-          }
-          else
-          {
-            for (int j = 1; j < aBList.size(); j++)
-              aCurveBlockInfo.myAdditionalCurveInfo.push_back(aBList[j].toDouble());
-          }
-        }
-        if (aBList[0] == "CN")
-        {
-           for (int i = 1; i < aBList.size(); i++)
-             Name += aBList[i] + "_"; 
-           Name.remove(Name.size() - 1, 1);
-           aCurveBlockInfo.myName = Name;
-        }
-      } while (!theFile.atEnd() && aBLine[0] == 'C' );
-
-      bool aStat;
-      aTotStat = true;
-      do
-      {
-        if (aBList.size() >= 3 && aBLine[0] != 'B' && aBLine[0] != 'C') {
-          gp_XYZ anXYZ;
-          anXYZ.SetX (aBList[0].toDouble(&aStat));  
-          aTotStat = aTotStat && aStat;
-          anXYZ.SetY (aBList[1].toDouble(&aStat));
-          aTotStat = aTotStat && aStat;
-          anXYZ.SetZ (aBList[2].toDouble(&aStat));
-          aTotStat = aTotStat && aStat;
-
-          aCurveBlockInfo.myXYZPoints.push_back(anXYZ);
-          
-          aBLine = theFile.readLine().simplified();
-          aBList = aBLine.split( ' ', QString::SkipEmptyParts );
-        }
-        else 
-          break;
-    
-      } while (!theFile.atEnd()/* && aBLine[0] == 'B'*/ );
-      if (aTotStat)
-        myCurveBlocks.push_back(aCurveBlockInfo);
-
-    }
-    else
-    {
-      aLine = theFile.readLine().simplified();
-      aList = aLine.split( ' ', QString::SkipEmptyParts );
-    }
-
-  }
-
-  return true;
-
-}
-
 void HYDROGUI_ImportPolylineOp::Parse(SHPHandle theHandle)
 {
   int aShapeType;
index 20b2f6e2ee657f03a0124221aab41729005e38da..157336258bfcc613445b36763078cb780c4cf34d 100644 (file)
 //};
 
 class SUIT_FileDlg;
-class QFile;
-class gp_XYZ;
-
-struct HYDROGUI_CurveBlock
-{
-  //HYDROGUI_CurveBlock() : myType(-1), myIsConnected(false), myIsClosed(false), myName(""), myCurvePlane(-1), myRefRatio(1.0) 
-    //{};
-  std::vector<gp_XYZ> myXYZPoints;
-  int myType;
-  bool myIsConnected;
-  bool myIsClosed;
-  int myCurvePlane;
-  QString myName;
-  std::vector<double> myAdditionalCurveInfo;
-  std::vector<double> myRefCoords;
-  double myRefRatio;
-};
 
 class HYDROGUI_ImportPolylineOp : public HYDROGUI_Operation
 {
@@ -60,14 +43,11 @@ public:
 protected:
   virtual void startOperation();
   virtual void onApply();
-  void ProcessSX();
-  bool Parse( QFile& theFile );
   void Parse( SHPHandle theHandle);
   void ProcessSHPPolyXY(SHPObject* anObj, QString theFileName, int theInd);
   void ProcessSHPPoly3D(SHPObject* anObj, QString theFileName, int theInd);
 private:
   SUIT_FileDlg* myFileDlg;
-  std::vector<HYDROGUI_CurveBlock> myCurveBlocks;
   std::vector<SHPObject*> mySHPObjects;
 };
 
diff --git a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.cxx
new file mode 100644 (file)
index 0000000..621193d
--- /dev/null
@@ -0,0 +1,133 @@
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_ImportSinusXOp.h"
+
+#include "HYDROGUI_DataModel.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_UpdateFlags.h"
+#include "HYDROGUI_Tool.h"
+#include <HYDROData_PolylineXY.h>
+#include <HYDROData_Polyline3D.h>
+#include <HYDROGUI_DataObject.h>
+#include <HYDROData_Bathymetry.h>
+#include <HYDROData_Iterator.h>
+
+#include <HYDROData_Profile.h>
+
+#include <SUIT_Desktop.h>
+#include <SUIT_FileDlg.h>
+#include <LightApp_Application.h>
+
+#include <QApplication>
+#include <QFile>
+#include <QFileInfo>
+#include <QMessageBox>
+
+#include <HYDROData_SinusX.h>
+
+
+HYDROGUI_ImportSinusXOp::HYDROGUI_ImportSinusXOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule )
+{
+  setName( tr( "IMPORT_SINUSX" ) );
+}
+
+HYDROGUI_ImportSinusXOp::~HYDROGUI_ImportSinusXOp()
+{
+}
+
+void HYDROGUI_ImportSinusXOp::startOperation()
+{
+  HYDROGUI_Operation::startOperation();
+
+  myFileDlg = new SUIT_FileDlg( module()->getApp()->desktop(), true );
+  myFileDlg->setWindowTitle( getName() );
+  myFileDlg->setFileMode( SUIT_FileDlg::ExistingFiles );
+  myFileDlg->setFilter( tr("SINUSX_FILTER") );
+
+  connect( myFileDlg, SIGNAL( accepted() ), this, SLOT( onApply() ) );
+  connect( myFileDlg, SIGNAL( rejected() ), this, SLOT( onCancel() ) );
+
+  myFileDlg->exec();
+}
+
+void HYDROGUI_ImportSinusXOp::onApply()
+{
+  if ( !myFileDlg )
+  {
+    abort();
+    return;
+  }
+
+  QStringList aFileNames = myFileDlg->selectedFiles();
+  bool IsImported = false;
+  
+  QApplication::setOverrideCursor( Qt::WaitCursor );  
+  startDocOperation();
+
+  foreach (QString aFileName, aFileNames) 
+  {
+    if ( aFileName.isEmpty() )
+      continue;
+
+    QString anExt = aFileName.split('.', QString::SkipEmptyParts).back();
+
+    if (anExt == "sx")
+    {
+      HYDROData_SinusX aSinusXImporter;
+      NCollection_Sequence<Handle_HYDROData_Entity> anEntities;
+      if (aSinusXImporter.Import(aFileName, doc(), anEntities)) 
+      {
+        UpdateView(anEntities);
+        IsImported = true;
+      }
+    }
+  }
+
+  if (IsImported)
+  {
+    commitDocOperation();
+    commit();
+  }
+  else
+    abort();
+
+  module()->update( UF_Model | UF_VTKViewer | UF_VTK_Forced | UF_VTK_Init );
+  
+  QApplication::restoreOverrideCursor();
+}
+
+void HYDROGUI_ImportSinusXOp::UpdateView( NCollection_Sequence<Handle_HYDROData_Entity>& anEntities)
+{
+  size_t anActiveViewId = HYDROGUI_Tool::GetActiveGraphicsViewId( module() );
+  if ( anActiveViewId == 0 )
+    anActiveViewId = HYDROGUI_Tool::GetActiveOCCViewId( module() );
+
+  for (int i = 1; i <= anEntities.Size() ; i++)
+  {
+    anEntities(i)->Update();
+    module()->setObjectVisible( anActiveViewId, anEntities(i), true );
+    module()->setIsToUpdate( anEntities(i) );
+  }
+}
diff --git a/src/HYDROGUI/HYDROGUI_ImportSinusXOp.h b/src/HYDROGUI/HYDROGUI_ImportSinusXOp.h
new file mode 100644 (file)
index 0000000..d2abad6
--- /dev/null
@@ -0,0 +1,48 @@
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_IMPORTSINUSX_H
+#define HYDROGUI_IMPORTSINUSX_H
+
+#include "HYDROGUI_Operation.h"
+#include <NCollection_Sequence.hxx>
+
+class SUIT_FileDlg;
+class Handle_HYDROData_Entity;
+
+class HYDROGUI_ImportSinusXOp : public HYDROGUI_Operation
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_ImportSinusXOp( HYDROGUI_Module* theModule );
+  virtual ~HYDROGUI_ImportSinusXOp();
+
+protected:
+  virtual void startOperation();
+  virtual void onApply();
+  void UpdateView( NCollection_Sequence<Handle_HYDROData_Entity>& anEntities);
+private:
+  SUIT_FileDlg* myFileDlg;
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_LandCoverColoringOp.cxx b/src/HYDROGUI/HYDROGUI_LandCoverColoringOp.cxx
new file mode 100644 (file)
index 0000000..2edb948
--- /dev/null
@@ -0,0 +1,91 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_LandCoverColoringOp.h"
+
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_OCCDisplayer.h"
+#include "HYDROGUI_Operations.h"
+#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_UpdateFlags.h"
+
+#include <HYDROData_Iterator.h>
+#include <HYDROData_Bathymetry.h>
+#include <HYDROData_StricklerTable.h>
+
+#include <LightApp_Application.h>
+
+#include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewManager.h>
+
+
+HYDROGUI_LandCoverColoringOp::HYDROGUI_LandCoverColoringOp( HYDROGUI_Module* theModule, int theId )
+: HYDROGUI_Operation( theModule ),
+  myId( theId )
+{
+  QString aName;
+  switch( myId )
+  {
+    case LandCoverScalarMapModeOnId:  aName = tr( "LC_SCALARMAP_COLORING_ON" ); break;
+    case LandCoverScalarMapModeOffId: aName = tr( "LC_SCALARMAP_COLORING_OFF" ); break;
+    default: break;
+  }
+  setName( aName );
+}
+
+HYDROGUI_LandCoverColoringOp::~HYDROGUI_LandCoverColoringOp()
+{
+}
+
+void HYDROGUI_LandCoverColoringOp::startOperation()
+{
+  HYDROGUI_Operation::startOperation();
+
+  HYDROGUI_Module* aModule = module();
+
+  LightApp_Application* anApp = module()->getApp();
+  OCCViewer_ViewManager* aViewManager =
+    dynamic_cast<OCCViewer_ViewManager*>( anApp->getViewManager( OCCViewer_Viewer::Type(), false ) );
+
+  size_t aViewId = (size_t)aViewManager->getViewModel();
+
+  Handle(HYDROData_StricklerTable) aTable;
+
+  if ( myId == LandCoverScalarMapModeOnId ) {
+    aTable = Handle(HYDROData_StricklerTable)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
+    if ( !aTable.IsNull() ) {
+      aModule->setLandCoverColoringTable( aViewId, aTable );
+    }
+  } else if ( myId == LandCoverScalarMapModeOffId ) {
+    aModule->setLandCoversScalarMapModeOff( aViewId );
+  }
+    
+  // Hide bathymetries
+  HYDROData_Iterator anIterator( doc(), KIND_BATHYMETRY );
+  for( ; anIterator.More(); anIterator.Next() ) {
+    Handle(HYDROData_Bathymetry) aBath =
+      Handle(HYDROData_Bathymetry)::DownCast( anIterator.Current() );  
+    if ( !aBath.IsNull() && aModule->isObjectVisible( aViewId, aBath ) ) {
+      aModule->setObjectVisible( aViewId, aBath, false );
+    }
+  }
+
+  aModule->getOCCDisplayer()->SetToUpdateColorScale();
+  aModule->update( UF_OCCViewer );
+  commit();
+}
diff --git a/src/HYDROGUI/HYDROGUI_LandCoverColoringOp.h b/src/HYDROGUI/HYDROGUI_LandCoverColoringOp.h
new file mode 100644 (file)
index 0000000..c931018
--- /dev/null
@@ -0,0 +1,44 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_LandCoverColoringOp_H
+#define HYDROGUI_LandCoverColoringOp_H
+
+#include "HYDROGUI_Operation.h"
+
+/** 
+ * \class HYDROGUI_LandCoverColoringOp
+ * \brief The class intended for scalar map coloring of Land Covers
+ */
+class HYDROGUI_LandCoverColoringOp : public HYDROGUI_Operation
+{
+  Q_OBJECT
+
+public:
+
+  HYDROGUI_LandCoverColoringOp( HYDROGUI_Module* theModule, int theId );
+  virtual ~HYDROGUI_LandCoverColoringOp();
+
+protected:
+  virtual void startOperation();
+
+private:
+  int myId;
+};
+
+#endif
index a88666170c177fcadcbd4cd6311480323e8866e0..a0c027becebd8e882c7fa6ff8e10ccf2aa416d93 100644 (file)
@@ -101,23 +101,33 @@ void HYDROGUI_LandCoverDlg::reset()
   onZoneDefChanged();
 }
 
-void HYDROGUI_LandCoverDlg::includePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines )
+bool HYDROGUI_LandCoverDlg::includePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines )
 {
   QStringList anIncludedPolylinesNames = myPolylines->getAllNames();
 
+  bool aSetOfPolylinesChanged = false;
   foreach ( const HYDROGUI_ListModel::Object2Visible& aSelectedPolyline, theSelectedPolylines )
   {
     if ( !anIncludedPolylinesNames.contains( aSelectedPolyline.first->GetName() ) )
+    {
       myPolylines->addObject( aSelectedPolyline );
+      aSetOfPolylinesChanged = true;
+    }
   }
   myPolylines->setOrderingEnabled( myPolylines->getObjects().count() > 1 );
+
+  return aSetOfPolylinesChanged;
 }
 
-void HYDROGUI_LandCoverDlg::excludePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines )
+bool HYDROGUI_LandCoverDlg::excludePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines )
 {
+  bool aSetOfPolylinesChanged = !theSelectedPolylines.isEmpty();
+
   foreach ( const HYDROGUI_ListModel::Object2Visible& aSelectedPolyline, theSelectedPolylines )
     myPolylines->removeObjectByName( aSelectedPolyline.first->GetName() );
   myPolylines->setOrderingEnabled( myPolylines->getObjects().count() > 1 );
+
+  return aSetOfPolylinesChanged;
 }
 
 QStringList HYDROGUI_LandCoverDlg::getPolylineNames() const
index 5c5aa3d8f8aef3922c6e28734180f4b4e62242a9..26b97ba503061a8882c289179805334df34aa9df 100644 (file)
@@ -37,8 +37,8 @@ public:
 
   virtual void               reset();
 
-  void                       includePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines );
-  void                       excludePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines );
+  bool                       includePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines );
+  bool                       excludePolylines( const HYDROGUI_ListModel::Object2VisibleList& theSelectedPolylines );
   QStringList                getPolylineNames() const;
   QStringList                getSelectedPolylineNames() const;
 
index 7923e48587e211572b9fcfe33657435713a37d24..17ac4487b9240f3af18e973d34092387fc4a8712 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "HYDROGUI_LandCoverDlg.h"
 #include "HYDROGUI_Module.h"
+#include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Shape.h"
 #include "HYDROGUI_Tool.h"
 #include "HYDROGUI_UpdateFlags.h"
@@ -190,17 +191,25 @@ bool HYDROGUI_LandCoverOp::processApply( int& theUpdateFlags,
     }
   }
 
+  if ( aZonePolylines.IsEmpty() )
+  {
+    theErrorMsg = tr( "POLYLINES_NOT_DEFINED" );
+    return false;
+  }
+
   QString aSelectedStricklerType = aPanel->getSelectedAdditionalParamName();
   
-  // TODO: Generate TopoDS_Shape based on the set of polylines, implement generateTopShape data model method
-  /*
-  if ( HYDROData_LandCover::generateTopShape( aZonePolylines ).IsNull() )
+  TCollection_AsciiString anError;
+  if ( HYDROData_LandCover::buildShape( aZonePolylines, anError ).IsNull() )
   {
-    theErrorMsg = tr( "ZONE_OBJECT_CANNOT_BE_CREATED" );
+    if ( !anError.IsEmpty() ) {
+      theErrorMsg = HYDROGUI_Tool::ToQString( anError );
+    } else {
+      theErrorMsg = tr( "LAND_COVER_OBJECT_CANNOT_BE_CREATED" );
+    }
     return false;
   }
-  */
-
+  
   Handle(HYDROData_LandCover) aZoneObj = myIsEdit ? myEditedObject :
     Handle(HYDROData_LandCover)::DownCast( doc()->CreateObject( KIND_LAND_COVER ) );
 
@@ -226,6 +235,7 @@ bool HYDROGUI_LandCoverOp::processApply( int& theUpdateFlags,
   }
 
   module()->setIsToUpdate( aZoneObj );
+  module()->getOCCDisplayer()->SetToUpdateColorScale();
 
   theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
 
@@ -240,7 +250,7 @@ void HYDROGUI_LandCoverOp::onCreatePreview( const QStringList& thePolylineNames
 
   QApplication::setOverrideCursor( Qt::WaitCursor );  
 
-  QList<Handle(HYDROData_PolylineXY)> aZonePolylines;
+  HYDROData_SequenceOfObjects aZonePolylines;
   QStringList::const_iterator anIt = thePolylineNames.begin(), aLast = thePolylineNames.end();
   for( ; anIt!=aLast; anIt++ )
   {
@@ -248,14 +258,11 @@ void HYDROGUI_LandCoverOp::onCreatePreview( const QStringList& thePolylineNames
     Handle(HYDROData_PolylineXY) aPolyline = Handle(HYDROData_PolylineXY)::DownCast(
       HYDROGUI_Tool::FindObjectByName( module(), aPolylineName, KIND_POLYLINEXY ) );
     if ( !aPolyline.IsNull() )
-      aZonePolylines.append( aPolyline );
+      aZonePolylines.Append( aPolyline );
   }
-
-  // TODO: Generate TopoDS_Shape based on the set of polylines, implement generateTopShape data model method  
-  TopoDS_Shape aZoneShape;/* = HYDROData_LandCover::generateTopShape( aZonePolylines );
-  if( aZoneShape.IsNull() )
-    printErrorMessage( tr( "ZONE_OBJECT_CANNOT_BE_CREATED" ) );
-  */
+  
+  TCollection_AsciiString anError;
+  TopoDS_Shape aZoneShape = HYDROData_LandCover::buildShape( aZonePolylines, anError );  
 
   LightApp_Application* anApp = module()->getApp();
   if ( !getPreviewManager() )
@@ -284,10 +291,8 @@ void HYDROGUI_LandCoverOp::onCreatePreview( const QStringList& thePolylineNames
     myPreviewPrs->setFillingColor( aFillingColor, false, false );
     myPreviewPrs->setBorderColor( aBorderColor, false, false );
 
-    TopoDS_Face aFace;
     if( !aZoneShape.IsNull() )
-      aFace = TopoDS::Face( aZoneShape );
-    myPreviewPrs->setFace( aFace, true, true, "" );
+      myPreviewPrs->setShape( aZoneShape );
   }
 
   QApplication::restoreOverrideCursor();
@@ -314,8 +319,11 @@ void HYDROGUI_LandCoverOp::onAddPolylines()
       aSelectedPolylines.append( HYDROGUI_ListModel::Object2Visible( aPolyXY, true ) );
   }
   
-  aPanel->includePolylines( aSelectedPolylines );
-  // TODO: create preview of included polylines
+  if ( aPanel->includePolylines( aSelectedPolylines ) )
+  {
+    closePreview();
+    onCreatePreview( aPanel->getPolylineNames() );
+  }  
 }
 
 void HYDROGUI_LandCoverOp::onRemovePolylines()
@@ -341,7 +349,12 @@ void HYDROGUI_LandCoverOp::onRemovePolylines()
   }
 
   module()->update( UF_OCCViewer );
-  aPanel->excludePolylines( aSelectedPolylines );
+  
+  if ( aPanel->excludePolylines( aSelectedPolylines ) )
+  {
+    closePreview();
+    onCreatePreview( aPanel->getPolylineNames() );
+  }
 }
 
 void HYDROGUI_LandCoverOp::closePreview()
diff --git a/src/HYDROGUI/HYDROGUI_MergePolylinesDlg.cxx b/src/HYDROGUI/HYDROGUI_MergePolylinesDlg.cxx
new file mode 100644 (file)
index 0000000..620e839
--- /dev/null
@@ -0,0 +1,75 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_MergePolylinesDlg.h>
+#include <HYDROGUI_ObjListBox.h>
+#include <QFrame>
+#include <QLabel>
+#include <QGridLayout>
+#include <QLineEdit>
+#include <QCheckBox>
+
+HYDROGUI_MergePolylinesDlg::HYDROGUI_MergePolylinesDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle )
+{
+  QFrame* aFrame = new QFrame( mainFrame() );
+  addWidget( aFrame, 1 );
+
+  QGridLayout* aLayout = new QGridLayout( aFrame );
+  aLayout->setMargin( 5 );
+  aLayout->setSpacing( 5 );
+
+  myName = new QLineEdit( mainFrame() );
+  aLayout->addWidget( new QLabel( tr( "RESULT_NAME" ) ), 0, 0 );
+  aLayout->addWidget( myName, 0, 1 );
+
+  myIsConnect = new QCheckBox( tr( "IS_CONNECT" ), mainFrame() );
+  aLayout->addWidget( myIsConnect, 1, 0, 1, 2 );
+
+  myList = new HYDROGUI_ObjListBox( theModule, tr( "POLYLINES" ), KIND_POLYLINEXY, mainFrame() );
+  aLayout->addWidget( myList, 2, 0, 1, 2 );
+}
+
+HYDROGUI_MergePolylinesDlg::~HYDROGUI_MergePolylinesDlg()
+{
+}
+
+HYDROData_SequenceOfObjects HYDROGUI_MergePolylinesDlg::selectedPolylines() const
+{
+  return myList->selectedObjects();
+}
+
+void HYDROGUI_MergePolylinesDlg::setSelectedPolylines( const HYDROData_SequenceOfObjects& theObjects )
+{
+  return myList->setSelectedObjects( theObjects );
+}
+
+void HYDROGUI_MergePolylinesDlg::setPolylinesFromSelection()
+{
+  return myList->setObjectsFromSelection();
+}
+
+QString HYDROGUI_MergePolylinesDlg::GetResultName() const
+{
+  return myName->text();
+}
+
+bool HYDROGUI_MergePolylinesDlg::IsConnectByNewSegment() const
+{
+  return myIsConnect->isChecked();
+}
diff --git a/src/HYDROGUI/HYDROGUI_MergePolylinesDlg.h b/src/HYDROGUI/HYDROGUI_MergePolylinesDlg.h
new file mode 100644 (file)
index 0000000..d0cf3ed
--- /dev/null
@@ -0,0 +1,50 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_MergePolylinesDlg_H
+#define HYDROGUI_MergePolylinesDlg_H
+
+#include <HYDROGUI_InputPanel.h>
+#include <HYDROData_Entity.h>
+
+class QLineEdit;
+class QCheckBox;
+class HYDROGUI_ObjListBox;
+
+class HYDROGUI_MergePolylinesDlg : public HYDROGUI_InputPanel
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_MergePolylinesDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+  virtual ~HYDROGUI_MergePolylinesDlg();
+
+  QString                     GetResultName() const;
+  HYDROData_SequenceOfObjects selectedPolylines() const;
+  void                        setSelectedPolylines( const HYDROData_SequenceOfObjects& );
+  void                        setPolylinesFromSelection();
+
+  bool                        IsConnectByNewSegment() const;
+
+private:
+  QLineEdit*           myName;
+  QCheckBox*           myIsConnect;
+  HYDROGUI_ObjListBox* myList;
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_MergePolylinesOp.cxx b/src/HYDROGUI/HYDROGUI_MergePolylinesOp.cxx
new file mode 100644 (file)
index 0000000..c5067c8
--- /dev/null
@@ -0,0 +1,68 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_MergePolylinesOp.h>
+#include <HYDROGUI_MergePolylinesDlg.h>
+#include <HYDROGUI_UpdateFlags.h>
+#include <HYDROData_Document.h>
+#include <HYDROData_PolylineOperator.h>
+
+HYDROGUI_MergePolylinesOp::HYDROGUI_MergePolylinesOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule )
+{
+  setName( tr( "MERGE_POLYLINES" ) );
+}
+
+HYDROGUI_MergePolylinesOp::~HYDROGUI_MergePolylinesOp()
+{
+}
+
+void HYDROGUI_MergePolylinesOp::startOperation()
+{
+  HYDROGUI_Operation::startOperation();
+
+  HYDROGUI_MergePolylinesDlg* aPanel = 
+    ::qobject_cast<HYDROGUI_MergePolylinesDlg*>( inputPanel() );
+  if ( !aPanel )
+    return;
+
+  aPanel->setPolylinesFromSelection();
+}
+
+HYDROGUI_InputPanel* HYDROGUI_MergePolylinesOp::createInputPanel() const
+{
+  return new HYDROGUI_MergePolylinesDlg( module(), getName() );
+}
+
+bool HYDROGUI_MergePolylinesOp::processApply( int& theUpdateFlags,
+                                              QString& theErrorMsg,
+                                              QStringList& theBrowseObjectsEntries )
+{
+  HYDROGUI_MergePolylinesDlg* aPanel = ::qobject_cast<HYDROGUI_MergePolylinesDlg*>( inputPanel() );
+  if ( !aPanel )
+    return false;
+
+  QString aName = aPanel->GetResultName();
+  bool isConnectByNewSegment = aPanel->IsConnectByNewSegment();
+  HYDROData_SequenceOfObjects aPolylinesList = aPanel->selectedPolylines();
+  HYDROData_PolylineOperator anOp;
+  anOp.Merge( doc(), aName.toLatin1().data(), aPolylinesList, isConnectByNewSegment );
+
+  theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
+  return true;
+}
diff --git a/src/HYDROGUI/HYDROGUI_MergePolylinesOp.h b/src/HYDROGUI/HYDROGUI_MergePolylinesOp.h
new file mode 100644 (file)
index 0000000..b934883
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_MergePolylinesOp_H
+#define HYDROGUI_MergePolylinesOp_H
+
+#include "HYDROGUI_Operation.h"
+
+class HYDROGUI_MergePolylinesOp : public HYDROGUI_Operation
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_MergePolylinesOp( HYDROGUI_Module* theModule );
+  virtual ~HYDROGUI_MergePolylinesOp();
+
+protected:
+  virtual void startOperation();
+
+  virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
+                             QStringList& theBrowseObjectsEntries );
+};
+
+#endif
index d684d927846e2ee1a89c3f978727d74ec3f421bf..2871e99214fc3687dca8eb6d66ab6d36a8b1830b 100644 (file)
@@ -46,6 +46,7 @@
 #include <HYDROData_Profile.h>
 #include <HYDROData_Lambert93.h>
 #include <HYDROData_Polyline3D.h>
+#include <HYDROData_StricklerTable.h>
 
 #include <HYDROData_OperationsFactory.h>
 
@@ -479,7 +480,7 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
     }
 
     if ( !anIsObjectCanBeColored )
-      anIsObjectCanBeColored = HYDROGUI_SetColorOp::CanObjectBeColored( anObject );
+      anIsObjectCanBeColored = HYDROGUI_SetColorOp::CanObjectBeColored( anObject, this );
   }
 
   // Check if all selected objects are profiles
@@ -585,6 +586,8 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         theMenu->addAction( action( CutImagesId ) );
         theMenu->addAction( action( SplitImageId ) );
         theMenu->addSeparator();
+        theMenu->addAction( action( RecognizeContoursId ) );
+        theMenu->addSeparator();
       }
       else if( anIsBathymetry )
       {
@@ -651,6 +654,17 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
         theMenu->addAction( action( ExportStricklerTableFromFileId ) );
         theMenu->addAction( action( DuplicateStricklerTableId ) );
         theMenu->addSeparator();
+
+        Handle(HYDROData_StricklerTable) aTable = 
+          Handle(HYDROData_StricklerTable)::DownCast( aSeq.First() );
+        QString aCurrentTable = 
+          HYDROGUI_DataObject::dataObjectEntry( getLandCoverColoringTable( anActiveViewId ) );
+        bool isUsed = aCurrentTable == HYDROGUI_DataObject::dataObjectEntry( aTable );
+
+        if ( !isUsed && !getObjectShapes( anActiveViewId, KIND_LAND_COVER ).isEmpty() ) {
+          theMenu->addAction( action( LandCoverScalarMapModeOnId ) );
+          theMenu->addSeparator();
+        }
       }
       else if( anIsLandCover )
       {
@@ -681,8 +695,9 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
       theMenu->addSeparator();
     }
 
-    if (anIsPolyline || anIsPolyline3D)
-      theMenu->addAction( action( ExportPolylineId ) );
+    bool anIsPoly = anIsPolyline || anIsPolyline3D;
+    if ((anIsPoly && !anIsLandCover) || (!anIsPoly && anIsLandCover))
+      theMenu->addAction( action( ExportToShapeFileID ) );
 
     // Add copy action
     QAction* aCopyAction = action( CopyId );
@@ -722,6 +737,11 @@ void HYDROGUI_Module::contextMenuPopup( const QString& theClient,
     theMenu->addSeparator();
     theMenu->addAction( action( SetZLevelId ) );
     theMenu->addSeparator();
+
+    if ( isLandCoversScalarMapModeOn( anActiveViewId ) ) {
+      theMenu->addAction( action( LandCoverScalarMapModeOffId ) );
+      theMenu->addSeparator();
+    }
   }
 
   if( anIsObjectBrowser || anIsGraphicsView || anIsOCCView || anIsVTKView )
@@ -785,7 +805,7 @@ void HYDROGUI_Module::createPreferences()
 
   int StricklerTableGroup = addPreference( tr( "PREF_GROUP_STRICKLER_TABLE" ), genTab );
   int defaultStricklerCoef = addPreference( tr( "PREF_DEFAULT_STRICKLER_COEFFICIENT" ), StricklerTableGroup,
-                                            LightApp_Preferences::DblSpin, "HYDRO", "default_strickler_coefficient" );
+                                            LightApp_Preferences::DblSpin, "preferences", "default_strickler_coefficient" );
   setPreferenceProperty( defaultStricklerCoef, "precision", 2 );
   setPreferenceProperty( defaultStricklerCoef, "min", 0.00 );
   setPreferenceProperty( defaultStricklerCoef, "max", 1000000.00 );
@@ -1053,6 +1073,12 @@ void HYDROGUI_Module::setObjectVisible( const int theViewId,
         if ( visState != Qtx::UnpresentableState )
             treeModel->setVisibilityState( id, theState ? Qtx::ShownState : Qtx::HiddenState );
     }
+
+    if ( theObject->GetKind() == KIND_BATHYMETRY && theState ) {
+      setLandCoversScalarMapModeOff( theViewId );
+    } else if ( theObject->GetKind() == KIND_LAND_COVER && theState ) {
+      getOCCDisplayer()->SetToUpdateColorScale();
+    }
   }
 }
 
@@ -1461,8 +1487,11 @@ void HYDROGUI_Module::onViewManagerRemoved( SUIT_ViewManager* theViewManager )
     if ( anOCCViewManager )
     {
       OCCViewer_Viewer* anOCCViewer = anOCCViewManager->getOCCViewer();
-      if ( anOCCViewer )
-        removeViewShapes( (size_t)anOCCViewer );
+      if ( anOCCViewer ) {
+        int aViewerId = (size_t)anOCCViewer;
+        removeViewShapes( aViewerId );
+        setLandCoversScalarMapModeOff( aViewerId );
+      }
     }
 
     if ( getVTKDisplayer()->IsApplicable( theViewManager ) )
@@ -1770,3 +1799,52 @@ void HYDROGUI_Module::onObjectClicked( SUIT_DataObject* theObject, int theColumn
 
   update( UF_OCCViewer | ( visState == Qtx::ShownState ? UF_FitAll : 0 ) );
 }
+
+Handle(HYDROData_StricklerTable) HYDROGUI_Module::getLandCoverColoringTable( const int theViewId ) const
+{
+  Handle(HYDROData_StricklerTable) aTable;
+
+  if ( myLandCoverColoringMap.contains( theViewId ) ) {
+    aTable = myLandCoverColoringMap.value( theViewId );
+  }
+
+  return aTable;
+}
+
+void HYDROGUI_Module::setLandCoverColoringTable( const int theViewId,
+                                                 const Handle(HYDROData_StricklerTable)& theTable )
+{
+  if ( !theTable.IsNull() ) {
+    myLandCoverColoringMap.insert( theViewId, theTable );
+  }
+}
+
+void HYDROGUI_Module::setLandCoversScalarMapModeOff( const int theViewId )
+{
+  myLandCoverColoringMap.remove( theViewId );
+}
+
+bool HYDROGUI_Module::isLandCoversScalarMapModeOn( const int theViewId ) const
+{
+  return myLandCoverColoringMap.contains( theViewId );
+}
+
+void HYDROGUI_Module::setObjectRemoved( const Handle(HYDROData_Entity)& theObject )
+{
+  if ( theObject.IsNull() || !theObject->IsRemoved() ) {
+    return;
+  }
+
+  if ( theObject->GetKind() == KIND_STRICKLER_TABLE ) {
+    Handle(HYDROData_StricklerTable) aTable = 
+      Handle(HYDROData_StricklerTable)::DownCast( theObject );
+    QList<int> aViewIds;
+    QMutableMapIterator<int, Handle(HYDROData_StricklerTable)> anIter( myLandCoverColoringMap );
+    while ( anIter.hasNext() ) {
+      if ( HYDROGUI_DataObject::dataObjectEntry( anIter.next().value() ) == 
+           HYDROGUI_DataObject::dataObjectEntry( aTable ) ) {
+        anIter.remove();
+      }
+    }
+  }
+}
index 28020c12cbfb20f58f610608fd0a2e9a74872eff..1b3523f17cb2c2c82add42cd6cc831ed856e5ba6 100644 (file)
 
 #include <HYDROData_Entity.h>
 
-#include <LightApp_Module.h>
+#ifdef WIN32
+  #pragma warning ( disable: 4251 )
+#endif
 
+#include <LightApp_Module.h>
 #include <QEvent>
 #include <QStack>
 
-class QGraphicsSceneMouseEvent;
+#ifdef WIN32
+  #pragma warning ( default: 4251 )
+#endif
 
+class QGraphicsSceneMouseEvent;
 class GraphicsView_Viewer;
 class OCCViewer_Viewer;
 class SVTK_Viewer;
@@ -35,6 +41,8 @@ class SVTK_Viewer;
 class SUIT_ViewWindow;
 class SUIT_ViewManager;
 
+class Handle(HYDROData_StricklerTable);
+
 class HYDROGUI_DataModel;
 class HYDROGUI_Displayer;
 class HYDROGUI_OCCDisplayer;
@@ -109,6 +117,8 @@ public:
   typedef QList<HYDROGUI_VTKPrs*> ListOfVTKPrs;
   typedef QMap<int,ListOfVTKPrs> ViewId2ListOfVTKPrs;
 
+  typedef QMap<int, Handle(HYDROData_StricklerTable)> ViewId2StricklerTable;
+
 public:
   HYDROGUI_Module();
   virtual ~HYDROGUI_Module();
@@ -209,6 +219,40 @@ public:
 
   void                            clearCache();
 
+  /**
+   * Returns Strickler table used for Land Cover scalar map coloring in the given view.
+   * @param theViewId the view id
+   * @return the Strickler table used for scalar map coloring of Land Covers in the given view;
+             null - if scalar map coloring is off for the view  
+   */
+  Handle(HYDROData_StricklerTable) getLandCoverColoringTable( const int theViewId ) const;
+
+  /**
+   * Set Strickler table to be used for Land Cover scalar map coloring in the given view.
+   * @param theViewId the view id
+   * @param theTable the Strickler table
+   */
+  void                             setLandCoverColoringTable( const int theViewId,
+                                                              const Handle(HYDROData_StricklerTable)& theTable );
+  /**
+   * Set Land Cover scalar map coloring mode off for the given view.
+   * @param theViewId the view id
+   */
+  void                             setLandCoversScalarMapModeOff( const int theViewId );
+
+  /**
+   * Check if Land Cover scalar map coloring mode is on in the given view.
+   * @param theViewId the view id
+   * @return true if the mode is on, false if the mode is off
+   */
+  bool                             isLandCoversScalarMapModeOn( const int theViewId ) const;
+
+  /**
+   * Set object as removed.
+   * @param theObject the removed object
+   */
+  void                            setObjectRemoved( const Handle(HYDROData_Entity)& theObject );
+
 protected:
   CAM_DataModel*                  createDataModel();
 
@@ -284,6 +328,8 @@ private:
   bool                            myIsUpdateEnabled;
 
   QStringList                     myGeomObjectsToImport; ///< entries of GEOM objects to be imported
+
+  ViewId2StricklerTable           myLandCoverColoringMap;
 };
 
 #endif
index 40256a51b2e6b54640a4812ff8cd00e5e8df8d62..433ce8a615bedbf11ccd6fb5e2166797bd46aa82 100644 (file)
 #include "HYDROGUI_Tool.h"
 #include <HYDROGUI_ShapeImage.h>
 #include <HYDROGUI_ShapeBathymetry.h>
+#include <HYDROGUI_ShapeLandCover.h>
 #include "HYDROGUI_Operation.h"
 #include "HYDROGUI_DataObject.h"
 #include "HYDROGUI_ZLayers.h"
+
 #include <HYDROData_Bathymetry.h>
+#include <HYDROData_LandCover.h>
+#include <HYDROData_StricklerTable.h>
 
 #include <AIS_InteractiveContext.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
@@ -141,7 +145,9 @@ void HYDROGUI_OCCDisplayer::Erase( const HYDROData_SequenceOfObjects& theObjs,
     module()->removeObjectShape( (size_t)aViewer, anObj );
   }
   aViewer->update();
-  UpdateColorScale( aViewer );
+  if ( !module()->isLandCoversScalarMapModeOn( (size_t)aViewer ) ) {
+    UpdateColorScale( aViewer );
+  }
 }
 
 HYDROGUI_Shape* HYDROGUI_OCCDisplayer::createShape( const int                             theViewerId,
@@ -159,6 +165,10 @@ HYDROGUI_Shape* HYDROGUI_OCCDisplayer::createShape( const int
     aResShape = new HYDROGUI_ShapeImage( theContext, Handle_HYDROData_Image::DownCast( theObject ) );
   else if( theObject->IsKind( STANDARD_TYPE( HYDROData_Bathymetry ) ) )
     aResShape = new HYDROGUI_ShapeBathymetry( this, theContext, Handle_HYDROData_Bathymetry::DownCast( theObject ) );
+  else if( theObject->IsKind( STANDARD_TYPE( HYDROData_LandCover ) ) ) {
+    bool isScalarMode = module()->isLandCoversScalarMapModeOn( theViewerId );
+    aResShape = new HYDROGUI_ShapeLandCover( this, theContext, Handle_HYDROData_LandCover::DownCast( theObject ), -1, isScalarMode );
+  }
   else
     aResShape = new HYDROGUI_Shape( theContext, theObject );
 
@@ -400,16 +410,19 @@ void HYDROGUI_OCCDisplayer::SetToUpdateColorScale()
 
 void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer )
 {
-  if( !myToUpdateColorScale )
+  if( !myToUpdateColorScale || !theViewer )
     return;
-
+  
   OCCViewer_ViewWindow* aWnd = dynamic_cast<OCCViewer_ViewWindow*>( theViewer->getViewManager()->getActiveView() );
   Handle(V3d_View) aView = aWnd->getViewPort()->getView();
-
+      
   int aViewerId = (size_t)theViewer;//TODO: check if viewer id is correct
-  QList<HYDROGUI_Shape*> aShapes = module()->getObjectShapes( aViewerId, KIND_BATHYMETRY );
+  bool isLandCoverColoringOn = module()->isLandCoversScalarMapModeOn( aViewerId );
+    
+  QList<HYDROGUI_Shape*> aLandCoverShapes = module()->getObjectShapes( aViewerId, KIND_LAND_COVER );
+  QList<HYDROGUI_Shape*> aBathShapes = module()->getObjectShapes( aViewerId, KIND_BATHYMETRY );
 
-  bool isDisplayColorScale = !aShapes.empty();
+  bool isDisplayColorScale = !aBathShapes.empty() || isLandCoverColoringOn;
   Standard_Real anXPos = 0.05; //TODO
   Standard_Real anYPos = 0.1; //TODO
   Standard_Real aWidth = 0.2; //TODO
@@ -418,27 +431,43 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer
   Standard_Integer aNbIntervals = 20; //TODO
   TCollection_ExtendedString aColorScaleTitle = "";//TODO
 
-  Standard_Real aColorScaleMin = 0, aColorScaleMax = 1, aMin, aMax;
-  bool isFirst = true;
-  foreach( HYDROGUI_Shape* aShape, aShapes )
-  {
-    HYDROGUI_ShapeBathymetry* aBathShape = dynamic_cast<HYDROGUI_ShapeBathymetry*>( aShape );
-    if( !aBathShape || !aBathShape->isVisible() )
-      continue;
+  Standard_Real aColorScaleMin = 0, aColorScaleMax = 1;
+
+  // Get range
+  Handle(HYDROData_StricklerTable) aTable;
+  TColStd_SequenceOfExtendedString aTableTypes;
+  if ( isLandCoverColoringOn ) {
+    aTable = module()->getLandCoverColoringTable( aViewerId );
+    if ( !aTable.IsNull() ) {
+      // TODO: non-empty title leads to buggy behaviour
+      // aColorScaleTitle = TCollection_ExtendedString( aTable->GetName().toLatin1().constData() );
+      aTable->GetCoefficientRange( aColorScaleMin, aColorScaleMax );
+      aTableTypes = aTable->GetTypes();
+    }
+  } else {
+    Standard_Real aMin, aMax;
+    bool isFirst = true;
+    foreach( HYDROGUI_Shape* aShape, aBathShapes )
+    {
+      HYDROGUI_ShapeBathymetry* aBathShape = dynamic_cast<HYDROGUI_ShapeBathymetry*>( aShape );
+      if( !aBathShape || !aBathShape->isVisible() )
+        continue;
 
-    aBathShape->GetRange( aMin, aMax );
+      aBathShape->GetRange( aMin, aMax );
 
-    if( isFirst || aMin < aColorScaleMin )
-      aColorScaleMin = aMin;
-    if( isFirst || aMax > aColorScaleMax )
-      aColorScaleMax = aMax;
+      if( isFirst || aMin < aColorScaleMin )
+        aColorScaleMin = aMin;
+      if( isFirst || aMax > aColorScaleMax )
+        aColorScaleMax = aMax;
 
-    isFirst = false;
+      isFirst = false;
+    }
   }
 
+  Handle(Aspect_ColorScale) aColorScale;
   if( isDisplayColorScale )
   {
-    Handle(Aspect_ColorScale) aColorScale = aView->ColorScale();
+    aColorScale = aView->ColorScale();
     if( !aColorScale.IsNull() )
     {
       aColorScale->SetXPosition( anXPos );
@@ -452,13 +481,14 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer
       aColorScale->SetTitle( aColorScaleTitle );
       aColorScale->SetRange( aColorScaleMin, aColorScaleMax );
 
-      foreach( HYDROGUI_Shape* aShape, aShapes )
-      {
-        HYDROGUI_ShapeBathymetry* aBathShape = dynamic_cast<HYDROGUI_ShapeBathymetry*>( aShape );
-        if( !aBathShape || !aBathShape->isVisible() )
-          continue;
+      if ( !isLandCoverColoringOn ) {
+        foreach( HYDROGUI_Shape* aShape, aBathShapes ) {
+          HYDROGUI_ShapeBathymetry* aBathShape = dynamic_cast<HYDROGUI_ShapeBathymetry*>( aShape );
+          if( !aBathShape || !aBathShape->isVisible() )
+            continue;
 
-        aBathShape->UpdateWithColorScale( aColorScale );
+          aBathShape->UpdateWithColorScale( aColorScale );
+        }
       }
     }
     if( !aView->ColorScaleIsDisplayed() )
@@ -470,5 +500,43 @@ void HYDROGUI_OCCDisplayer::UpdateColorScale( const OCCViewer_Viewer* theViewer
       aView->ColorScaleErase();
   }
 
+  foreach( HYDROGUI_Shape* aShape, aLandCoverShapes ) {
+    HYDROGUI_ShapeLandCover* aLandCoverShape = 
+      dynamic_cast<HYDROGUI_ShapeLandCover*>( aShape );
+
+    if ( !aLandCoverShape || !aLandCoverShape->isVisible() ) {
+      continue;
+    }
+    
+    Handle(HYDROData_LandCover) aLandCover = 
+      Handle(HYDROData_LandCover)::DownCast( aLandCoverShape->getObject() );
+
+    if ( aLandCover.IsNull() ) {
+      continue;
+    }
+    
+    QColor aUndefinedColor( Qt::gray );
+    QColor aColor = isLandCoverColoringOn ? aUndefinedColor : aLandCover->GetFillingColor();
+    
+    if ( isLandCoverColoringOn && !aTable.IsNull() ) {
+      TCollection_ExtendedString aStricklerType = 
+        aLandCover->GetStricklerType().toLatin1().constData();
+     
+      if ( aTable->HasType( aStricklerType ) ) {
+        double aStricklerCoeff = aTable->Get( aStricklerType, 0 );
+        Quantity_Color aShapeColor;
+        if ( aColorScale->FindColor( aStricklerCoeff, aShapeColor ) ) {
+          aColor = QColor( aShapeColor.Red() * 255, 
+                           aShapeColor.Green() * 255,
+                           aShapeColor.Blue() * 255 );
+        }
+      }
+    }
+    
+    aLandCoverShape->setFillingColor( aColor, true, true );
+    aLandCoverShape->setScalarMapModeEnabled( isLandCoverColoringOn );
+    theViewer->getAISContext()->Redisplay( aLandCoverShape->getAISObject() );
+  }
+
   myToUpdateColorScale = false;
 }
index bd89dfe291095c74e7b7112e713a80642ede679e..b454518df71d61c18382af2604aa433b2434ec6b 100644 (file)
@@ -109,7 +109,7 @@ protected:
   void                            purgeObjects( const int theViewerId );
 
   void UpdateColorScale( const OCCViewer_Viewer* );
-
+  
 private:
   /**
    * \brief Creates new OCC shape.
index eebfdf3575b8dba74f9c0cbd283dcf59b57294b6..432306627ff08164ce644a83d348cb9dca394d77 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "HYDROGUI_DataModel.h"
 #include "HYDROGUI_DataObject.h"
+#include "HYDROGUI_DataOwner.h"
 #include "HYDROGUI_Module.h"
 
 #include <AIS_ListOfInteractive.hxx>
@@ -53,8 +54,14 @@ void HYDROGUI_OCCSelector::getSelection( SUIT_DataOwnerPtrList& aList ) const
   for ( AIS_ListIteratorOfListOfInteractive anIt( aSelList ); anIt.More(); anIt.Next() )
     if ( !anIt.Value().IsNull() )
     {
-      if ( !isLocalContext )
-        aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( entry( anIt.Value() ) ) ) );
+      if ( !isLocalContext ) {
+        QString anEntry = entry( anIt.Value() );
+        if ( !anEntry.isEmpty() ) {
+          aList.append( SUIT_DataOwnerPtr( new LightApp_DataOwner( entry( anIt.Value() ) ) ) );
+        } else {
+          aList.append( SUIT_DataOwnerPtr( new HYDROGUI_DataOwner( anIt.Value() ) ) );
+        }
+      }
     }
   // add externally selected objects
   SUIT_DataOwnerPtrList::const_iterator anExtIter;
@@ -70,11 +77,39 @@ void HYDROGUI_OCCSelector::setSelection( const SUIT_DataOwnerPtrList& aList )
     return;
 
   Handle(AIS_InteractiveContext) aContext = aViewer->getAISContext();
-  if ( aContext->HasOpenedContext() ) {
+  if ( aContext.IsNull() || aContext->HasOpenedContext() ) {
     return;
   }
 
-  LightApp_OCCSelector::setSelection( aList );
+  QMap<QString, Handle(AIS_InteractiveObject)> aDisplayed;
+  AIS_ListOfInteractive aDispList, aSelList;
+  aContext->DisplayedObjects( aDispList );
+
+  for ( AIS_ListIteratorOfListOfInteractive it( aDispList ); it.More(); it.Next() )
+  {
+    QString entryStr = entry( it.Value() );
+    if ( !entryStr.isEmpty() )
+      aDisplayed.insert( entryStr, it.Value() );
+  }
+  
+  mySelectedExternals.clear();
+
+  for ( SUIT_DataOwnerPtrList::const_iterator itr = aList.begin(); itr != aList.end(); ++itr )
+  {
+    const LightApp_DataOwner* owner = dynamic_cast<const LightApp_DataOwner*>( (*itr).operator->() );
+    if ( owner && aDisplayed.contains( owner->entry() ) )
+      aSelList.Append( aDisplayed[owner->entry()] );
+    else {
+      const HYDROGUI_DataOwner* hydroOwner = dynamic_cast<const HYDROGUI_DataOwner*>( (*itr).operator->() );
+      if ( hydroOwner && !hydroOwner->IO().IsNull() ) {
+        aSelList.Append( hydroOwner->IO() );
+      } else
+        mySelectedExternals.append(*itr);
+    }
+  }
+  aViewer->unHighlightAll( false );
+  aViewer->setObjectsSelected( aSelList );
 }
 
 QString HYDROGUI_OCCSelector::entry( const Handle(AIS_InteractiveObject)& anAIS ) const
index 6ead5e400e990a34767327a589e5f33883aa651d..9b2dfc7a836291facb3d9d3806d3e70744c8ea2a 100644 (file)
@@ -82,7 +82,8 @@ void HYDROGUI_ObjComboBox::reset()
     myObject->blockSignals( true );
 
     myObject->clear();
-    myObject->addItems( objectNames() );
+    myObjects.Clear();
+    myObject->addItems( objectNames( myObjects ) );
     myObject->setCurrentIndex( -1 );
 
     myObject->blockSignals( block );
@@ -91,7 +92,7 @@ void HYDROGUI_ObjComboBox::reset()
     updateSelection();
 }
 
-void HYDROGUI_ObjComboBox::setSectedObject( const QString& theName )
+void HYDROGUI_ObjComboBox::setSelectedObject( const QString& theName )
 {
     int aNewIdx = myObject->findText( theName );
     if ( aNewIdx != myObject->currentIndex() )
@@ -115,13 +116,16 @@ SUIT_SelectionMgr* HYDROGUI_ObjComboBox::selectionMgr() const
     return aSelMgr;
 }
 
-QStringList HYDROGUI_ObjComboBox::objectNames() const
+QStringList HYDROGUI_ObjComboBox::objectNames( HYDROData_SequenceOfObjects& theObjects ) const
 {
     QStringList aNames;
     for ( HYDROData_Iterator it( HYDROData_Document::Document( module()->getStudyId() ), objectType() ); it.More(); it.Next() )
     {
         if ( !objectFilter() || objectFilter()->isOk( it.Current() ) )
+        {
+          theObjects.Append( it.Current() );
             aNames.append( it.Current()->GetName() );
+        }
     }
     return aNames;
 }
@@ -153,3 +157,13 @@ void HYDROGUI_ObjComboBox::updateSelection()
         emit objectSelected( myObject->itemText( idx ) );
     }
 }
+
+Handle( HYDROData_Entity ) HYDROGUI_ObjComboBox::GetObject() const
+{
+  int anIndex = myObject->currentIndex();
+  if( anIndex>=0 && anIndex<myObjects.Length() )
+    return myObjects.Value( myObjects.Lower() + anIndex );
+  else
+    return Handle( HYDROData_Entity )();
+}
+
index 1697309f1268b053fb556fce0541d6c9f060f1a9..5f983c44acfd78d85ea9b3cbbfc9b92d9d19d978 100644 (file)
@@ -42,10 +42,12 @@ public:
     void                        setObjectFilter( HYDROGUI_ObjComboBoxFilter* );
 
     QString                     selectedObject() const;
-    void                        setSectedObject( const QString& );
+    void                        setSelectedObject( const QString& );
 
     void                        reset();
 
+    Handle( HYDROData_Entity )  GetObject() const;
+
 signals:
     void                        objectSelected( const QString& );
 
@@ -56,7 +58,7 @@ private slots:
     void                        updateSelection();
 
 protected:
-    QStringList                 objectNames() const;
+    QStringList                 objectNames( HYDROData_SequenceOfObjects& ) const;
     SUIT_SelectionMgr*          selectionMgr() const;
 
 private:
@@ -64,6 +66,7 @@ private:
     QComboBox*                  myObject;
     HYDROGUI_Module*            myModule;
     HYDROGUI_ObjComboBoxFilter* myFilter;
+    HYDROData_SequenceOfObjects myObjects;
 };
 
 class HYDROGUI_ObjComboBoxFilter
diff --git a/src/HYDROGUI/HYDROGUI_ObjListBox.cxx b/src/HYDROGUI/HYDROGUI_ObjListBox.cxx
new file mode 100644 (file)
index 0000000..8547e8f
--- /dev/null
@@ -0,0 +1,149 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_ObjListBox.h>
+#include <HYDROGUI_ObjComboBox.h>
+#include <HYDROGUI_Tool.h>
+#include <QGridLayout>
+#include <QListWidget>
+#include <QLabel>
+#include <QPushButton>
+
+HYDROGUI_ObjListBox::HYDROGUI_ObjListBox( HYDROGUI_Module* theModule, const QString& theTitle, const ObjectKind& theType, QWidget* theParent )
+: QWidget( theParent ),
+  myModule( theModule ),
+  myFilter( 0 )
+{
+  myTypes.append( theType );
+  Init(theTitle);
+}
+
+HYDROGUI_ObjListBox::HYDROGUI_ObjListBox( HYDROGUI_Module* theModule, const QString& theTitle, const QList<ObjectKind>& theTypes, QWidget* theParent )
+: QWidget( theParent ),
+  myTypes( theTypes ),
+  myModule( theModule ),
+  myFilter( 0 )
+{
+  Init(theTitle);
+}
+
+void HYDROGUI_ObjListBox::Init(const QString& theTitle)
+{
+  QGridLayout* aBase = new QGridLayout( this );
+  aBase->setMargin( 0 );
+
+  QPushButton* anInclude = new QPushButton( tr( "INCLUDE" ), this );
+  QPushButton* anExclude = new QPushButton( tr( "EXCLUDE" ), this );
+
+  aBase->addWidget( anInclude, 0, 0 );
+  aBase->addWidget( anExclude, 0, 1 );
+  if( !theTitle.isEmpty() )
+    aBase->addWidget( new QLabel( theTitle, this ), 1, 0 );
+  aBase->addWidget( myList = new QListWidget( this ), 1, 1, 1, 2 );
+  aBase->setColumnStretch( 0, 0 );
+  aBase->setColumnStretch( 1, 0 );
+  aBase->setColumnStretch( 2, 1 );
+
+  myList->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred ) );
+  myList->setSelectionMode( QListWidget::ExtendedSelection );
+
+  connect( anInclude, SIGNAL( clicked() ), this, SLOT( OnInclude() ) );
+  connect( anExclude, SIGNAL( clicked() ), this, SLOT( OnExclude() ) );
+}
+
+HYDROGUI_ObjListBox::~HYDROGUI_ObjListBox()
+{
+}
+
+HYDROGUI_Module* HYDROGUI_ObjListBox::module() const
+{
+    return myModule;
+}
+
+QList<ObjectKind> HYDROGUI_ObjListBox::objectTypes() const
+{
+    return myTypes;
+}
+
+HYDROGUI_ObjComboBoxFilter* HYDROGUI_ObjListBox::objectFilter() const
+{
+    return myFilter;
+}
+
+void HYDROGUI_ObjListBox::setObjectFilter( HYDROGUI_ObjComboBoxFilter* filter )
+{
+    myFilter = filter;
+}
+
+void HYDROGUI_ObjListBox::reset()
+{
+  myList->clear();
+  mySelection.Clear();
+  emit selectionChanged();
+}
+
+void HYDROGUI_ObjListBox::setSelectedObjects( const HYDROData_SequenceOfObjects& theObjects )
+{
+  reset();
+  Append( theObjects );
+}
+
+void HYDROGUI_ObjListBox::setObjectsFromSelection()
+{
+  setSelectedObjects( HYDROGUI_Tool::GetSelectedObjects( module() ) );
+}
+
+HYDROData_SequenceOfObjects HYDROGUI_ObjListBox::selectedObjects() const
+{
+  return mySelection;
+}
+
+void HYDROGUI_ObjListBox::OnInclude()
+{
+  Append( HYDROGUI_Tool::GetSelectedObjects( module() ) );
+  emit selectionChanged();
+}
+
+void HYDROGUI_ObjListBox::OnExclude()
+{
+  QList<QListWidgetItem*> aSelection = myList->selectedItems();
+  foreach( QListWidgetItem* anItem, aSelection )
+    delete anItem;
+  emit selectionChanged();
+}
+
+void HYDROGUI_ObjListBox::Append( const HYDROData_SequenceOfObjects& theObjects )
+{
+  for( int i=theObjects.Lower(), n=theObjects.Upper(); i<=n; i++ )
+  {
+    Handle( HYDROData_Entity ) anObject = theObjects.Value( i );
+    bool isOK = !anObject.IsNull() && myTypes.contains(anObject->GetKind());
+    if( myFilter && isOK )
+      isOK = myFilter->isOk( anObject );
+
+    if( isOK )
+    {
+      QString aName = anObject->GetName();
+      if (myList->findItems(aName, Qt::MatchExactly).size() == 0)
+      {
+        myList->addItem( aName );
+        mySelection.Append( anObject );
+      }
+    }
+  }
+}
diff --git a/src/HYDROGUI/HYDROGUI_ObjListBox.h b/src/HYDROGUI/HYDROGUI_ObjListBox.h
new file mode 100644 (file)
index 0000000..ddb4da2
--- /dev/null
@@ -0,0 +1,72 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_OBJLISTBOX_H
+#define HYDROGUI_OBJLISTBOX_H
+
+#include <HYDROData_Entity.h>
+#include <QWidget>
+
+class HYDROGUI_Module;
+class HYDROGUI_ObjComboBoxFilter;
+class QListWidget;
+
+class HYDROGUI_ObjListBox : public QWidget
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_ObjListBox( HYDROGUI_Module* theModule, const QString& theTitle,
+                       const ObjectKind& = KIND_UNKNOWN, QWidget* = 0 );
+  HYDROGUI_ObjListBox( HYDROGUI_Module* theModule, const QString& theTitle,
+                       const QList<ObjectKind>& theTypes, QWidget* = 0 );
+  virtual ~HYDROGUI_ObjListBox();
+
+  HYDROGUI_Module*            module() const;
+  QList<ObjectKind>           objectTypes() const;
+
+  HYDROGUI_ObjComboBoxFilter* objectFilter() const;
+  void                        setObjectFilter( HYDROGUI_ObjComboBoxFilter* );
+
+  HYDROData_SequenceOfObjects selectedObjects() const;
+  void                        setSelectedObjects( const HYDROData_SequenceOfObjects& );
+  void                        setObjectsFromSelection();
+  void                        reset();
+
+private:
+  void Init(const QString& theTitle);
+
+signals:
+  void selectionChanged();
+
+private slots:
+  void OnInclude();
+  void OnExclude();
+
+private:
+  void Append( const HYDROData_SequenceOfObjects& );
+
+private:
+  QList<ObjectKind>           myTypes;
+  QListWidget*                myList;
+  HYDROGUI_Module*            myModule;
+  HYDROGUI_ObjComboBoxFilter* myFilter;
+  HYDROData_SequenceOfObjects mySelection;
+};
+
+#endif
index 109b1a55de78cfa9fd7a981e8e9bab284b91ed1a..be2b9cdbdfed1c1ba026abbcbe677749bc4ee6bb 100644 (file)
@@ -29,6 +29,7 @@
 #include "HYDROGUI_ExportFileOp.h"
 #include "HYDROGUI_ImportImageOp.h"
 #include "HYDROGUI_ImportPolylineOp.h"
+#include "HYDROGUI_ImportSinusXOp.h"
 #include "HYDROGUI_ImportBathymetryOp.h"
 #include "HYDROGUI_ImmersibleZoneOp.h"
 #include "HYDROGUI_Module.h"
 #include "HYDROGUI_LocalCSOp.h"
 #include "HYDROGUI_RiverBottomOp.h"
 #include "HYDROGUI_ProfileInterpolateOp.h"
+#include "HYDROGUI_RecognizeContoursOp.h"
 #include "HYDROGUI_SubmersibleOp.h"
 #include "HYDROGUI_StricklerTableOp.h"
 #include "HYDROGUI_DuplicateOp.h"
 #include "HYDROGUI_LandCoverOp.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 <HYDROData_Document.h>
 #include <HYDROData_Obstacle.h>
@@ -124,6 +131,9 @@ void HYDROGUI_Module::createActions()
   createAction( RemoveImageRefsId, "REMOVE_IMAGE_REFERENCE", "REMOVE_IMAGE_REFERENCE_ICO" );
   
   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( CreatePolylineId, "CREATE_POLYLINE", "CREATE_POLYLINE_ICO" );
   createAction( EditPolylineId, "EDIT_POLYLINE", "EDIT_POLYLINE_ICO" ); 
@@ -181,6 +191,8 @@ void HYDROGUI_Module::createActions()
   createAction( SplitImageId, "SPLIT_IMAGE", "SPLIT_IMAGE_ICO" );
   createAction( EditSplittedImageId, "EDIT_SPLITTED_IMAGE", "EDIT_SPLITTED_IMAGE_ICO" );
 
+  createAction( RecognizeContoursId, "RECOGNIZE_CONTOURS", "RECOGNIZE_CONTOURS_ICO" );
+
   createAction( CopyViewerPositionId, "COPY_VIEWER_POSITION", "" );
 
   createAction( DeleteId, "DELETE", "", Qt::Key_Delete, false,
@@ -201,9 +213,14 @@ void HYDROGUI_Module::createActions()
   createAction( ProfileInterpolateId, "PROFILE_INTERPOLATE", "PROFILE_INTERPOLATE_ICO" );
 
   createAction( SubmersibleId, "SUBMERSIBLE", "SUBMERSIBLE_ICO" );
-  createAction( ExportPolylineId, "EXPORT_POLYLINE", "EXPORT_POLYLINE_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" );
 
-  createAction( PolylineExtraction, "POLYLINE_EXTRACTION" );
+  createAction( LandCoverScalarMapModeOnId, "LC_SCALARMAP_COLORING_ON" );
+  createAction( LandCoverScalarMapModeOffId, "LC_SCALARMAP_COLORING_OFF" );
 }
 
 void HYDROGUI_Module::createMenus()
@@ -222,17 +239,30 @@ 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( ImportImageId, aHydroId, -1, -1 );
-  createMenu( ImportPolylineId, aHydroId, -1, -1 );
+  createMenu( ImportSinusXId, aHydroId, -1, -1 );
+  createMenu( ExportSinusXId, aHydroId, -1, -1 );
+  createMenu( ImportLandcoverId, aHydroId, -1, -1 );
+  
   createMenu( ImportBathymetryId, aHydroId, -1, -1 );
   createMenu( ImportStricklerTableFromFileId, aHydroId, -1, -1 );
-  createMenu( CreatePolylineId, 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 );  
 
+  int aNewImageId = createMenu( tr( "MEN_DESK_IMAGE" ), aHydroId, -1 );
+  createMenu( ImportImageId, aNewImageId, -1, -1 );
+  createMenu( FuseImagesId, aNewImageId, -1, -1 );
+  createMenu( CutImagesId, aNewImageId, -1, -1 );
+  createMenu( SplitImageId, aNewImageId, -1, -1 );
+
+  int aNewPolylineId = createMenu( tr( "MEN_DESK_POLYLINE" ), aHydroId, -1 );
+  createMenu( ImportPolylineId, aNewPolylineId, -1, -1 );
+  createMenu( CreatePolylineId, aNewPolylineId, -1, -1 );
+  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 );
@@ -252,10 +282,6 @@ void HYDROGUI_Module::createMenus()
   createMenu( separator(), aHydroId );
   createMenu( EditLocalCSId, aHydroId, -1, -1 );
   createMenu( separator(), aHydroId );
-  createMenu( FuseImagesId, aHydroId, -1, -1 );
-  createMenu( CutImagesId, aHydroId, -1, -1 );
-  createMenu( SplitImageId, aHydroId, -1, -1 );
-  createMenu( separator(), aHydroId );
 }
 
 void HYDROGUI_Module::createPopups()
@@ -271,6 +297,10 @@ void HYDROGUI_Module::createToolbars()
   createTool( separator(), aToolBar );
   createTool( ImportImageId, aToolBar );
   createTool( ImportPolylineId, aToolBar );
+  createTool( ImportSinusXId, aToolBar );
+  createTool( ExportSinusXId, aToolBar );
+  createTool( ImportLandcoverId, aToolBar );
+
   createTool( ImportBathymetryId, aToolBar );
   createTool( CreatePolylineId, aToolBar );
   createTool( CreatePolyline3DId, aToolBar );
@@ -432,6 +462,12 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
   case ImportPolylineId:
     anOp = new HYDROGUI_ImportPolylineOp( aModule/*, theId == EditImportedPolylineId*/ );
     break;
+  case ImportSinusXId:
+    anOp = new HYDROGUI_ImportSinusXOp( aModule );
+    break;
+  case ExportSinusXId:
+    anOp = new HYDROGUI_ExportSinusXOp( aModule );
+    break;
   case ObserveImageId:
     anOp = new HYDROGUI_ObserveImageOp( aModule );
     break;
@@ -442,9 +478,12 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
   case ForcedUpdateObjectId:
     anOp = new HYDROGUI_UpdateObjectOp( aModule, theId == ForcedUpdateObjectId );
     break;
-  case ExportPolylineId:
+  case ExportToShapeFileID:
     anOp = new HYDROGUI_ExportFileOp( aModule );
     break;
+  case ImportLandcoverId:
+    anOp = new HYDROGUI_ImportLandCoverOp( aModule );
+    break;
   case RemoveImageRefsId:
     anOp = new HYDROGUI_RemoveImageRefsOp( aModule );
     break;
@@ -565,6 +604,9 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
   case RiverBottomContextId:
     anOp = new HYDROGUI_RiverBottomOp( aModule );
     break;
+  case RecognizeContoursId:
+    anOp = new HYDROGUI_RecognizeContoursOp( aModule );
+    break;
   case ShowId:
   case ShowOnlyId:
   case ShowAllId:
@@ -575,9 +617,19 @@ LightApp_Operation* HYDROGUI_Module::createOperation( const int theId ) const
   case SubmersibleId:
     anOp = new HYDROGUI_SubmersibleOp( aModule );
     break;
-  case PolylineExtraction:
+  case PolylineExtractionId:
     anOp = new HYDROGUI_PolylineExtractionOp( aModule );
     break;
+  case SplitPolylinesId:
+    anOp = new HYDROGUI_SplitPolylinesOp( aModule );
+    break;
+  case MergePolylinesId:
+    anOp = new HYDROGUI_MergePolylinesOp( aModule );
+    break;
+  case LandCoverScalarMapModeOnId:
+  case LandCoverScalarMapModeOffId:
+    anOp = new HYDROGUI_LandCoverColoringOp( aModule, theId );
+    break;
   }
 
   if( !anOp )
index ab4219acb90604c3f56ab15a1d83f66d488daf97..37d0205378df3670bc5f937836f8927bd22044b2 100644 (file)
@@ -107,9 +107,14 @@ enum OperationId
   RiverBottomContextId,
   ProfileInterpolateId,
 
+  RecognizeContoursId,
   SubmersibleId,
   ImportPolylineId,
-  ExportPolylineId,
+  ImportSinusXId,
+  ExportSinusXId,
+    
+  ExportToShapeFileID,
+  ImportLandcoverId,
 
   ImportStricklerTableFromFileId,
   ExportStricklerTableFromFileId,
@@ -119,7 +124,12 @@ enum OperationId
   CreateLandCoverId,
   EditLandCoverId,
 
-  PolylineExtraction
+  PolylineExtractionId,
+  SplitPolylinesId,
+  MergePolylinesId,
+
+  LandCoverScalarMapModeOnId,
+  LandCoverScalarMapModeOffId,
 };
 
 #endif
index 1b551cfc17799a0f500add6305dadd8d2cd7b94e..c17903a3b67f415d202c00af34d0df081614f63a 100644 (file)
@@ -62,48 +62,53 @@ HYDROGUI_OrderedListWidget::HYDROGUI_OrderedListWidget( QWidget* theParent, int
 
   myList->setModel( aFilteredModel );
 
-  // Buttons top, up, down, bottom
-  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
-  myTop = new QPushButton( this );
-  myTop->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_TOP_ICO" ) ) );
-  myTop->setIconSize( QSize( theArrowIconSize, theArrowIconSize ) );
-  myTop->setToolTip( tr( "TOP_TLT" ) );
-  myUp = new QPushButton( this );
-  myUp->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_UP_ICO" ) ) );
-  myUp->setIconSize( myTop->iconSize() );
-  myUp->setToolTip( tr( "UP_TLT" ) );
-  myDown = new QPushButton( this );
-  myDown->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_DOWN_ICO" ) ) );
-  myDown->setIconSize( myTop->iconSize() );
-  myDown->setToolTip( tr( "DOWN_TLT" ) );
-  myBottom = new QPushButton( this );
-  myBottom->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_BOTTOM_ICO" ) ) );
-  myBottom->setIconSize( myTop->iconSize() );
-  myBottom->setToolTip( tr( "BOTTOM_TLT" ) );
-
-  // Layout
-  // buttons
-  QVBoxLayout* aListButtonsLayout = new QVBoxLayout();
-  aListButtonsLayout->addWidget( myTop );
-  aListButtonsLayout->addWidget( myUp );
-  aListButtonsLayout->addWidget( myDown );
-  aListButtonsLayout->addWidget( myBottom );
-  aListButtonsLayout->addStretch();
-  // main
+  // Add list to the main layout
   aMainLayout->addWidget( myList );
-  aMainLayout->addLayout( aListButtonsLayout );
-
-  // Connections
-  QSignalMapper* aSignalMapper = new QSignalMapper( this );
-  aSignalMapper->setMapping( myTop, HYDROGUI_ListModel::Top );
-  aSignalMapper->setMapping( myUp, HYDROGUI_ListModel::Up );
-  aSignalMapper->setMapping( myDown, HYDROGUI_ListModel::Down );
-  aSignalMapper->setMapping( myBottom, HYDROGUI_ListModel::Bottom );
-  connect( myTop, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
-  connect( myUp, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
-  connect( myDown, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
-  connect( myBottom, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
-  connect( aSignalMapper, SIGNAL( mapped( int ) ), this, SLOT( onMove( int ) ) );
+
+  // Buttons top, up, down, bottom
+  if ( theArrowIconSize > 0 ) {
+    SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+    myTop = new QPushButton( this );
+    myTop->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_TOP_ICO" ) ) );
+    myTop->setIconSize( QSize( theArrowIconSize, theArrowIconSize ) );
+    myTop->setToolTip( tr( "TOP_TLT" ) );
+    myUp = new QPushButton( this );
+    myUp->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_UP_ICO" ) ) );
+    myUp->setIconSize( myTop->iconSize() );
+    myUp->setToolTip( tr( "UP_TLT" ) );
+    myDown = new QPushButton( this );
+    myDown->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_DOWN_ICO" ) ) );
+    myDown->setIconSize( myTop->iconSize() );
+    myDown->setToolTip( tr( "DOWN_TLT" ) );
+    myBottom = new QPushButton( this );
+    myBottom->setIcon( aResMgr->loadPixmap( "HYDRO", tr( "ARROW_BOTTOM_ICO" ) ) );
+    myBottom->setIconSize( myTop->iconSize() );
+    myBottom->setToolTip( tr( "BOTTOM_TLT" ) );
+
+    // Add buttons to the main layout
+    QVBoxLayout* aListButtonsLayout = new QVBoxLayout();
+    aListButtonsLayout->addWidget( myTop );
+    aListButtonsLayout->addWidget( myUp );
+    aListButtonsLayout->addWidget( myDown );
+    aListButtonsLayout->addWidget( myBottom );
+    aListButtonsLayout->addStretch();
+    
+    aMainLayout->addLayout( aListButtonsLayout );
+
+    // Buttons connections
+    QSignalMapper* aSignalMapper = new QSignalMapper( this );
+    aSignalMapper->setMapping( myTop, HYDROGUI_ListModel::Top );
+    aSignalMapper->setMapping( myUp, HYDROGUI_ListModel::Up );
+    aSignalMapper->setMapping( myDown, HYDROGUI_ListModel::Down );
+    aSignalMapper->setMapping( myBottom, HYDROGUI_ListModel::Bottom );
+    connect( myTop, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
+    connect( myUp, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
+    connect( myDown, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
+    connect( myBottom, SIGNAL( clicked() ), aSignalMapper, SLOT( map() ) );
+    connect( aSignalMapper, SIGNAL( mapped( int ) ), this, SLOT( onMove( int ) ) );
+  } else {
+    myTop = myUp = myDown = myBottom = 0;
+  }
 
   connect ( myList->selectionModel(), SIGNAL( selectionChanged( QItemSelection, QItemSelection ) ), 
             this, SIGNAL( selectionChanged() ) );
@@ -352,10 +357,12 @@ HYDROGUI_ListModel* HYDROGUI_OrderedListWidget::getSourceModel() const
 void HYDROGUI_OrderedListWidget::setOrderingEnabled( const bool theIsToEnable )
 {
   // enable/disable arrow buttons
-  myTop->setEnabled( theIsToEnable );
-  myUp->setEnabled( theIsToEnable );
-  myDown->setEnabled( theIsToEnable );
-  myBottom->setEnabled( theIsToEnable );
+  if ( myTop && myUp && myDown && myBottom ) {
+    myTop->setEnabled( theIsToEnable );
+    myUp->setEnabled( theIsToEnable );
+    myDown->setEnabled( theIsToEnable );
+    myBottom->setEnabled( theIsToEnable );
+  }
 
   // enable/disable drag and drop
   myList->setDragEnabled( theIsToEnable );
index c284d7927e94e306a413d6a9b216a4003569e272..684d3a53ea8e614b9194b1008931acb0db8d8cfa 100644 (file)
@@ -19,6 +19,7 @@
 #include "HYDROGUI_PriorityTableModel.h"
 
 #include <HYDROData_LandCover.h>
+#include <HYDROGUI_DataObject.h>
 
 /**
   Constructor.
@@ -119,8 +120,11 @@ bool HYDROGUI_PriorityTableModel::setData( const QModelIndex & theIndex, const Q
   }
 
   bool aRes = false;
-
+  
   if ( theRole ==  Qt::EditRole ) {
+    bool aRuleChanged = false;
+    myPrevRules = myRules;
+
     int aColumn = theIndex.column();
 
     if ( aColumn == 0 || aColumn == 2 ) {
@@ -135,9 +139,16 @@ bool HYDROGUI_PriorityTableModel::setData( const QModelIndex & theIndex, const Q
       if ( !anObject.IsNull() ) {
         HYDROData_CustomRule anEditedRule = myRules[aRow];
         
+        QString anEntryNew = HYDROGUI_DataObject::dataObjectEntry( anObject );
         if ( aColumn == 0 ) {
+          QString anEntryOld = HYDROGUI_DataObject::dataObjectEntry( anEditedRule.Object1 );
+          if ( anEntryOld != anEntryNew )
+            aRuleChanged = true;
           anEditedRule.Object1 = anObject;
         } else {
+          QString anEntryOld = HYDROGUI_DataObject::dataObjectEntry( anEditedRule.Object2 );
+          if ( anEntryOld != anEntryNew )
+            aRuleChanged = true;
           anEditedRule.Object2 = anObject;
         }
         
@@ -145,14 +156,24 @@ bool HYDROGUI_PriorityTableModel::setData( const QModelIndex & theIndex, const Q
           myRules[aRow] = anEditedRule;
           aRes = true;
         } else {
+          aRuleChanged = false;
           emit showError( tr("ALREADY_EXISTS") );
         }
       }
     } else if ( aColumn == 1 ) {
-      myRules[aRow].Priority = (HYDROData_PriorityType)theValue.toInt();
+      HYDROData_PriorityType aNewPriority = (HYDROData_PriorityType)theValue.toInt();
+      if ( myRules[aRow].Priority != aNewPriority )
+        aRuleChanged = true;
+      myRules[aRow].Priority = aNewPriority;
     } else if ( aColumn == 3 ) {
-      myRules[aRow].MergeType = (HYDROData_Zone::MergeType)theValue.toInt();;
+      HYDROData_Zone::MergeType aNewMergeType = (HYDROData_Zone::MergeType)theValue.toInt();
+      if ( myRules[aRow].MergeType != aNewMergeType )
+        aRuleChanged = true;
+      myRules[aRow].MergeType = aNewMergeType;
     }
+
+    if ( aRuleChanged )
+      emit ruleChanged();
   }
 
   return aRes;
@@ -179,6 +200,7 @@ int HYDROGUI_PriorityTableModel::columnCount( const QModelIndex &theParent ) con
 void HYDROGUI_PriorityTableModel::setRules( const HYDROData_ListOfRules& theRules )
 {
   beginResetModel();
+  myPrevRules = myRules;
   myRules = theRules;
   endResetModel();
 }
@@ -238,6 +260,8 @@ void HYDROGUI_PriorityTableModel::setObjects( const QList<Handle(HYDROData_Entit
 {
   myObjects = theObjects;
     
+  myPrevRules = myRules;
+
   beginResetModel();
 
   // Remove rules which use objects which are no longer available
@@ -317,6 +341,8 @@ bool HYDROGUI_PriorityTableModel::createNewRule()
     aNewRule.Priority = aPriorityType;
     aNewRule.MergeType = HYDROData_Zone::Merge_ZMIN;
 
+    myPrevRules = myRules;
+
     beginResetModel();
     myRules << aNewRule;
     endResetModel();
@@ -351,6 +377,8 @@ bool HYDROGUI_PriorityTableModel::removeRows ( int theRow, int theCount, const Q
     aLastRow = myRules.count() - 1;
   }
 
+  myPrevRules = myRules;
+
   beginRemoveRows( theParent, theRow, aLastRow );
 
   // Remove the corresponding rules
@@ -495,6 +523,17 @@ void HYDROGUI_PriorityTableModel::setColumnCount( int theColumnCount )
   myColumnCount = theColumnCount;
 }
 
+/**
+ Undo last change in the list of priority rules.
+ */
+void HYDROGUI_PriorityTableModel::undoLastChange()
+{
+  beginResetModel();
+  myRules = myPrevRules;
+  endResetModel();
+  reset();
+}
+
 /**
   Get type of objects for which rules are defined assuming,
   that all objects in the list have the same type.
index 9133843769deec66b81c69263f3be4624c7aaed7..17dbd802c7809be75c66cedbf71df3d374fb1bce 100644 (file)
@@ -67,6 +67,8 @@ public:
   bool canCreateNewRule() const;
 
   void setColumnCount( int theColumnCount );
+
+  void undoLastChange();
   
 protected:
   bool isUsed( const Handle(HYDROData_Entity)& theObj1, 
@@ -80,6 +82,7 @@ protected:
 
 signals:
   void showError( const QString& theMsg );
+  void ruleChanged();
 
 private:
   const ObjectKind getObjectsKind() const;
@@ -88,7 +91,7 @@ private:
 
   HYDROGUI_Module* myModule;
 
-  HYDROData_ListOfRules myRules;
+  HYDROData_ListOfRules myRules, myPrevRules;
   QList<Handle(HYDROData_Entity)> myObjects;
 
   int myColumnCount;
index 7175941cca187d7ede319a448db90aa92afa00e5..6c85d3e0ab54c76392207576a17c5f2a088dca11 100644 (file)
@@ -185,6 +185,7 @@ HYDROGUI_PriorityWidget::HYDROGUI_PriorityWidget( QWidget* theParent )
             this, SLOT( onSelectionChanged() ) );
 
   connect( aModel, SIGNAL( showError( const QString& ) ), this, SLOT( onShowError( const QString& ) ) );
+  connect( aModel, SIGNAL( ruleChanged() ), this, SIGNAL( ruleChanged() ) );
 }
 
 /**
@@ -204,6 +205,7 @@ void HYDROGUI_PriorityWidget::onAddRule()
   if ( aModel ) {
     if (aModel->createNewRule()) {
       updateControls();
+      emit ruleChanged();
     }
   }
 }
@@ -226,6 +228,7 @@ void HYDROGUI_PriorityWidget::onRemoveRule()
     
     if ( aModel->removeRows( aRows ) ) {
       updateControls();
+      emit ruleChanged();
     }
   }
 }
@@ -239,6 +242,7 @@ void HYDROGUI_PriorityWidget::onClearRules()
     dynamic_cast<HYDROGUI_PriorityTableModel*>( myTable->model() );
   if ( aModel && aModel->removeAll() ) {
     updateControls();
+    emit ruleChanged();
   }
 }
 
@@ -325,4 +329,15 @@ void HYDROGUI_PriorityWidget::updateControls()
  */
 void HYDROGUI_PriorityWidget::onShowError( const QString& theMsg ) {
   SUIT_MessageBox::warning( this, tr( "INCORRECT_INPUT" ), theMsg );
-}
\ No newline at end of file
+}
+
+/**
+ Undo last change in priority rules table.
+ */
+void HYDROGUI_PriorityWidget::undoLastChange()
+{
+  HYDROGUI_PriorityTableModel* aModel = 
+    dynamic_cast<HYDROGUI_PriorityTableModel*>( myTable->model() );
+  if ( aModel )
+    aModel->undoLastChange();
+}
index bbc6c9edf86a43bea946d1f8f5098a50a8897e7c..ff1cfc41a9349c1788645e64a188112eebba0a47 100644 (file)
@@ -54,9 +54,14 @@ public:
 
   QTableView* getTable() const;
 
+  void undoLastChange();
+
 protected:
   void updateControls();
 
+signals:
+  void ruleChanged();
+
 protected slots:
   void onAddRule();
   void onRemoveRule();
index c7594b45bae9aa06f283a76b438944b487dca047..add3b8bb55537cd04b741006c4f1358ed000779d 100644 (file)
@@ -143,7 +143,7 @@ QString HYDROGUI_ProfileInterpolateDlg::river() const
 
 void HYDROGUI_ProfileInterpolateDlg::setRiver( const QString& theName )
 {
-    myRiver->setSectedObject( theName );
+    myRiver->setSelectedObject( theName );
 }
 
 QString HYDROGUI_ProfileInterpolateDlg::profileStart() const
@@ -153,7 +153,7 @@ QString HYDROGUI_ProfileInterpolateDlg::profileStart() const
 
 void HYDROGUI_ProfileInterpolateDlg::setProfileStart( const QString& theName )
 {
-    myProfileStart->setSectedObject( theName );
+    myProfileStart->setSelectedObject( theName );
 }
 
 QString HYDROGUI_ProfileInterpolateDlg::profileFinish() const
@@ -163,7 +163,7 @@ QString HYDROGUI_ProfileInterpolateDlg::profileFinish() const
 
 void HYDROGUI_ProfileInterpolateDlg::setProfileFinish( const QString& theName )
 {
-    myProfileFinish->setSectedObject( theName );
+    myProfileFinish->setSelectedObject( theName );
 }
 
 int HYDROGUI_ProfileInterpolateDlg::profileNumber() const
diff --git a/src/HYDROGUI/HYDROGUI_RecognizeContoursDlg.cxx b/src/HYDROGUI/HYDROGUI_RecognizeContoursDlg.cxx
new file mode 100644 (file)
index 0000000..6840e2d
--- /dev/null
@@ -0,0 +1,156 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_RecognizeContoursDlg.h"
+
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QListWidget>
+#include <QVBoxLayout>
+
+/**
+ * Constructor.
+ * \param theModule the module
+ * \param theTitle the panel title
+ */
+HYDROGUI_RecognizeContoursDlg::HYDROGUI_RecognizeContoursDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle )
+{
+  // Original image
+  QGroupBox* anImageGroup = new QGroupBox( tr( "ORIGINAL_IMAGE" ), mainFrame() );
+  QLabel* aNameLabel = new QLabel( tr("NAME") );
+  myImageName = new QLineEdit;
+  myImageName->setReadOnly( true );
+
+  QHBoxLayout* anImageLayout = new QHBoxLayout();
+  anImageLayout->addWidget( aNameLabel );
+  anImageLayout->addWidget( myImageName );
+  anImageGroup->setLayout( anImageLayout );
+
+  // List of recognized polylines
+  QGroupBox* aPolylinesGroup = new QGroupBox( tr( "RECOGNIZED_POLYLINES" ), mainFrame() );
+  myPolylines = new QListWidget( aPolylinesGroup );
+  myPolylines->setSelectionMode( QListWidget::ExtendedSelection );
+  myPolylines->setEditTriggers( QListWidget::NoEditTriggers );
+  myPolylines->setViewMode( QListWidget::ListMode );
+  myPolylines->setSortingEnabled( false );
+
+  QBoxLayout* aPolylinesLayout = new QVBoxLayout;
+  aPolylinesLayout->addWidget( myPolylines );
+  aPolylinesGroup->setLayout( aPolylinesLayout );
+
+  // Layout
+  addWidget( anImageGroup );
+  addWidget( aPolylinesGroup );
+
+  // Conections
+  connect( myPolylines, SIGNAL( itemSelectionChanged() ), this, SLOT( onItemSelectionChanged() ) );
+}
+
+/**
+ * Destructor.
+ */
+HYDROGUI_RecognizeContoursDlg::~HYDROGUI_RecognizeContoursDlg()
+{
+}
+
+/**
+ * Set the image name.
+ * \param theName the name
+ */
+void HYDROGUI_RecognizeContoursDlg::setImageName( const QString& theName )
+{
+  myImageName->setText( theName );
+}
+
+/**
+ * Reset the panel.
+ */
+void HYDROGUI_RecognizeContoursDlg::reset()
+{
+  myImageName->clear();
+  myPolylines->clear();
+}
+
+/**
+ * Refill the list of polylines names.
+ * \param theNames the list of names
+ */
+void HYDROGUI_RecognizeContoursDlg::setPolylineNames( const QStringList& theNames )
+{
+  myPolylines->clear();
+  myPolylines->addItems( theNames );
+}
+
+/**
+ * Remove the given polyline names from the list.
+ * \param theNames the list of names
+ */
+void HYDROGUI_RecognizeContoursDlg::removePolylineNames( const QStringList& theNames )
+{
+  QList<QListWidgetItem*> aFoundItems;
+
+  foreach ( const QString& aName, theNames ) {
+    aFoundItems = myPolylines->findItems( aName, Qt::MatchExactly );
+    foreach ( QListWidgetItem* anItem, aFoundItems ) {
+      anItem = myPolylines->takeItem( myPolylines->row( anItem ) );
+      delete anItem;
+    }
+  }
+}
+
+/**
+ * Select the given polyline names in the list.
+ * \param theNames the list of names
+ */
+void HYDROGUI_RecognizeContoursDlg::setSelectedPolylineNames( const QStringList& theNames )
+{
+  myPolylines->clearSelection();
+
+  foreach( const QString aName, theNames ) {
+    QList<QListWidgetItem*> anItems = myPolylines->findItems( aName, Qt::MatchExactly );
+    if ( anItems.count() == 1 ) {
+      anItems.first()->setSelected( true );
+    }
+  }
+}
+
+/**
+ * Slot called when polyline names selection changed.
+ */
+void HYDROGUI_RecognizeContoursDlg::onItemSelectionChanged()
+{
+  emit selectionChanged( getSelectedtPolylineNames() );
+}
+
+/**
+ * Get the list of selected polyline names.
+ * \return the list of names
+ */ 
+QStringList HYDROGUI_RecognizeContoursDlg::getSelectedtPolylineNames() const
+{
+  QStringList aSelectedNames;
+
+  QList<QListWidgetItem*> aSelectedItems = myPolylines->selectedItems();
+  foreach( const QListWidgetItem* anItem, aSelectedItems ) {
+    aSelectedNames << anItem->text();
+  }
+
+  return aSelectedNames;
+}
\ No newline at end of file
diff --git a/src/HYDROGUI/HYDROGUI_RecognizeContoursDlg.h b/src/HYDROGUI/HYDROGUI_RecognizeContoursDlg.h
new file mode 100644 (file)
index 0000000..f30d7db
--- /dev/null
@@ -0,0 +1,60 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+
+#ifndef HYDROGUI_RecognizeContoursDlg_H
+#define HYDROGUI_RecognizeContoursDlg_H
+
+#include "HYDROGUI_InputPanel.h"
+
+class QListWidget;
+class QLineEdit;
+
+class HYDROGUI_RecognizeContoursDlg : public HYDROGUI_InputPanel
+{
+  Q_OBJECT
+
+  enum CreationMode { CreateNewId, ModifyExistentId };
+
+public:
+  HYDROGUI_RecognizeContoursDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+  virtual ~HYDROGUI_RecognizeContoursDlg();
+
+  void setImageName( const QString& theName );
+
+  void reset();
+
+  void setPolylineNames( const QStringList& theNames );
+  void removePolylineNames( const QStringList& theNames );
+
+  void setSelectedPolylineNames( const QStringList& theNames );
+
+  QStringList getSelectedtPolylineNames() const;
+  
+signals:
+  void selectionChanged( const QStringList& );
+
+public slots:
+  void onItemSelectionChanged();
+
+private:
+  QLineEdit*   myImageName;
+  QListWidget* myPolylines;    
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx b/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.cxx
new file mode 100644 (file)
index 0000000..c4961c3
--- /dev/null
@@ -0,0 +1,517 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_RecognizeContoursOp.h"
+
+#include "HYDROGUI_RecognizeContoursDlg.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_Shape.h"
+#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_UpdateFlags.h"
+#include "HYDROGUI_OCCSelector.h"
+#include "HYDROGUI_ZLayers.h"
+
+#include <HYDROData_Document.h>
+#include <HYDROData_GeomTool.h>
+#include <HYDROData_ShapesTool.h>
+#include <HYDROData_PolylineXY.h>
+
+#include <GeometryGUI.h>
+#include <GeometryGUI_Operations.h>
+#include <GEOM_Constants.h>
+#include <GEOMBase.h>
+
+#include <OCCViewer_ViewManager.h>
+#include <OCCViewer_ViewModel.h>
+
+#include <SalomeApp_Study.h>
+
+#include <LightApp_Application.h>
+#include <LightApp_DataOwner.h>
+#include <LightApp_Displayer.h>
+#include <LightApp_SelectionMgr.h>
+
+#include <SUIT_Desktop.h>
+#include <SUIT_ViewManager.h>
+
+#include <BRepBuilderAPI_GTransform.hxx>
+#include <gp_GTrsf.hxx>
+
+#include <QDialog>
+#include <QDir>
+#include <QTemporaryFile>
+
+/**
+  Constructor.
+*/
+HYDROGUI_RecognizeContoursOp::HYDROGUI_RecognizeContoursOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule ),
+  myGEOMOpName( "" )
+{
+  setName( tr( "CONTOURS_RECOGNITION" ) );
+}
+
+/**
+  Destructor.
+*/
+HYDROGUI_RecognizeContoursOp::~HYDROGUI_RecognizeContoursOp()
+{
+  cleanup();
+}
+
+/**
+*/
+void HYDROGUI_RecognizeContoursOp::startOperation()
+{
+  HYDROGUI_Operation::startOperation();
+  
+  // Set preview view manager
+  if ( !getPreviewManager() ) {
+    setPreviewManager( ::qobject_cast<OCCViewer_ViewManager*>( 
+                       module()->getApp()->getViewManager( OCCViewer_Viewer::Type(), true ) ) );
+  }
+
+  if ( !isApplyAndClose() ) {
+    return;
+  }
+
+  // Get the selected image
+  myImage = Handle(HYDROData_Image)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
+  if ( myImage.IsNull() ) {
+    abort();
+    return;
+  }
+  QString anImageName = myImage->GetName();
+
+  // Create temporary graphics file
+  QImage aQImage = myImage->Image();
+  myTmpImageFile = new QTemporaryFile( QDir::tempPath() + QDir::separator() + anImageName );
+  if ( !myTmpImageFile->open() || 
+       !aQImage.save( myTmpImageFile->fileName(), "PNG", 100 ) ) {
+    abort();
+    return;
+  }
+
+  // Create the input panel
+  HYDROGUI_RecognizeContoursDlg* aPanel = 
+    ::qobject_cast<HYDROGUI_RecognizeContoursDlg*>( inputPanel() );
+  if ( !aPanel ) {
+    return;
+  }
+
+  // Reset the panel
+  aPanel->reset();
+  aPanel->setImageName( anImageName );
+
+  // Get active study
+  SalomeApp_Study* aStudy = 
+    dynamic_cast<SalomeApp_Study*>( module()->getApp()->activeStudy() );
+
+  // Get active view manager
+  SUIT_ViewManager* aViewMgr = module()->getApp()->activeViewManager();
+
+  // Export the selected image to GEOM module
+  if ( aStudy && aViewMgr ) {
+    SALOMEDS::Study_var aDSStudy = GeometryGUI::ClientStudyToStudy( aStudy->studyDS() );
+    GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen();
+
+    QString aGeomPictureEntry;
+
+    HYDROData_GeomTool::createFaceInGEOM( aGeomEngine, aDSStudy, aQImage.width(), aQImage.height(), 
+                                          anImageName, aGeomPictureEntry );
+    
+    if ( !aGeomPictureEntry.isEmpty() ) {
+      aStudy->setObjectProperty( aViewMgr->getGlobalId(), aGeomPictureEntry, 
+                                 GEOM::propertyName( GEOM::Texture ), myTmpImageFile->fileName() );
+    
+      // update the object browser
+      module()->getApp()->updateObjectBrowser( true );
+
+      // browse the published GEOM picture
+      QStringList anEntries;
+      anEntries << aGeomPictureEntry;
+      browseObjects( anEntries );
+
+      // Add GEOM picture object entry to the list of temporary geom objects
+      myTmpGeomObjects << aGeomPictureEntry;
+    }
+  }
+
+  // Activate GEOM module operation
+  LightApp_Application* anApp = module()->getApp();
+  if ( anApp ) {
+    connect( anApp, SIGNAL( operationFinished( const QString&, const QString&, const QStringList& ) ), 
+             this, SLOT( onExternalOperationFinished( const QString&, const QString&, const QStringList& ) ) );
+
+    module()->getApp()->activateOperation( "Geometry", GEOMOp::OpFeatureDetect );
+  }
+}
+
+/**
+*/
+void HYDROGUI_RecognizeContoursOp::abortOperation()
+{
+  LightApp_Application* anApp = module()->getApp();
+  if ( anApp ) {
+    anApp->disconnect( this );
+  }
+
+  cleanup();
+
+  HYDROGUI_Operation::abortOperation();
+}
+
+/**
+*/
+void HYDROGUI_RecognizeContoursOp::commitOperation()
+{
+  if ( isApplyAndClose() ) {
+    cleanup();
+  }
+
+  HYDROGUI_Operation::commitOperation();
+}
+
+/**
+*/
+bool HYDROGUI_RecognizeContoursOp::processApply( int& theUpdateFlags,
+                                                QString& theErrorMsg,
+                                                QStringList& theBrowseObjectsEntries )
+{
+  // Check the original image
+  if ( myImage.IsNull() ) {
+    return false;
+  }
+
+  // Get panel
+  HYDROGUI_RecognizeContoursDlg* aPanel = 
+    ::qobject_cast<HYDROGUI_RecognizeContoursDlg*>( inputPanel() );
+  if ( !aPanel ) {
+    return false;
+  }
+  
+  // Check if contour GEOM object exists
+  if ( myGeomContourEntry.isEmpty() ) {
+    theErrorMsg = tr( "NO_DETECTED_CONTOURS" );
+    return false;
+  }
+
+  // Get selected polylines
+  QStringList aSelectedtPolylines = aPanel->getSelectedtPolylineNames();
+  // Remove the selected polylines from the panel
+  aPanel->removePolylineNames( aSelectedtPolylines );
+
+  // Create polylines
+  foreach ( QString aName, aSelectedtPolylines ) {
+    TopoDS_Shape aShape = myPolylineShapes.value( aName )->getTopoShape();
+    if ( aShape.IsNull() ) {
+      continue;
+    }
+
+    Handle(HYDROData_PolylineXY) aPolylineObj =
+      Handle(HYDROData_PolylineXY)::DownCast( doc()->CreateObject( KIND_POLYLINEXY ) );
+
+    if( !aPolylineObj.IsNull() ) {
+      aPolylineObj->SetName( aName );
+      aPolylineObj->ImportShape( aShape );
+      aPolylineObj->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
+
+      aPolylineObj->Update();
+      module()->setIsToUpdate( aPolylineObj );
+    }
+
+    // Remove the shape from the map
+    HYDROGUI_Shape* aShapeToDelete = myPolylineShapes.take( aName );
+    delete aShapeToDelete;
+  }
+  theUpdateFlags = UF_Model;
+
+  return true;
+}
+
+/**
+*/
+HYDROGUI_InputPanel* HYDROGUI_RecognizeContoursOp::createInputPanel() const
+{
+  HYDROGUI_InputPanel* aPanel = new HYDROGUI_RecognizeContoursDlg( module(), getName() );
+
+  connect( aPanel, SIGNAL( selectionChanged( const QStringList& ) ), this, SLOT( onSelectionChanged( const QStringList& ) ) );
+
+  return aPanel;
+}
+
+/**
+ * Called when the operation perfomed by another module is finished.
+ * \param theModuleName the name of the module which perfomed the operation
+ * \param theOperationName the operation name
+ * \param theEntryList the list of the created objects entries
+ */
+void HYDROGUI_RecognizeContoursOp::onExternalOperationFinished( 
+  const QString& theModuleName, const QString& theOperationName,
+  const QStringList& theEntryList )
+{
+  // Process "Geometry" module operations only
+  if ( theModuleName != "Geometry" ) {
+    return;
+  }
+    
+  // Store the operation name
+  myGEOMOpName = theOperationName;
+
+  // Close the dialog corresponding to the external operation
+  closeExternalOperationDlg();
+  
+  // Erase the GEOM objects
+  LightApp_Displayer().Erase( theEntryList );
+
+  // Add GEOM object entries to the list of temporary GEOM objects
+  myTmpGeomObjects << theEntryList;
+
+  if ( theEntryList.count() == 1 ) {
+    myGeomContourEntry = theEntryList.first();
+
+    // Update the list of polylines
+    updateRecognizedPolylines();
+  }
+}
+
+/**
+  Close the GEOM contours detection dialog.
+*/
+void HYDROGUI_RecognizeContoursOp::closeExternalOperationDlg()
+{
+  if ( myGEOMOpName.isEmpty() ) {
+    return;
+  }
+
+  SUIT_Desktop* aDesktop = module()->getApp()->desktop();
+  if ( aDesktop ) {
+    QList<QDialog*> aDialogs = aDesktop->findChildren<QDialog*>();
+    foreach ( QDialog* aDlg, aDialogs ) {
+      if ( typeid(*aDlg).name() == myGEOMOpName ) {
+        aDlg->close();
+        break;
+      }
+    }
+  }
+}
+
+/**
+  Update the list of recognized polylines by exploding the GEOM contour object.
+*/
+void HYDROGUI_RecognizeContoursOp::updateRecognizedPolylines()
+{
+  // Erase the preview
+  erasePreview();
+
+  // Get active study
+  SalomeApp_Study* aStudy = 
+    dynamic_cast<SalomeApp_Study*>( module()->getApp()->activeStudy() );
+  if ( !aStudy ) {
+    return;
+  }
+
+  // Explode the compound
+  _PTR(SObject) aSObject( aStudy->studyDS()->FindObjectID( qPrintable( myGeomContourEntry ) ) );
+  if ( aSObject ) {
+    TopoDS_Shape aShape = GEOMBase::GetShapeFromIOR( aSObject->GetIOR().c_str() );
+
+    TopTools_SequenceOfShape aSubShapes;
+    HYDROData_ShapesTool::ExploreShapeToShapes( aShape, TopAbs_WIRE, aSubShapes );
+    if ( aSubShapes.Length() < 1 ) {
+      HYDROData_ShapesTool::ExploreShapeToShapes( aShape, TopAbs_EDGE, aSubShapes );
+    }
+
+    Handle(AIS_InteractiveContext) aCtx = NULL;
+
+    // Display preview
+    OCCViewer_ViewManager* aViewManager = getPreviewManager();
+    if ( aViewManager ) {
+      if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
+        // aViewer->enablePreselection( true );
+        // aViewer->enableSelection( true );
+        aCtx = aViewer->getAISContext();
+        connect( aViewer, SIGNAL( selectionChanged() ), this, SLOT( onViewerSelectionChanged() ) );
+      }
+    }
+
+    QTransform aTrsf = myImage->Trsf();
+    QImage anImage = myImage->Image();
+    QRectF aRect( QPointF( 0, 0 ), QPointF( anImage.width(), anImage.height() ) );
+    aRect = aTrsf.mapRect( aRect );
+    aTrsf.setMatrix( aTrsf.m11(), aTrsf.m12(),  aTrsf.m13(),
+                     aTrsf.m21(), -aTrsf.m22(), aTrsf.m23(),
+                     aTrsf.m31() + aRect.width() * 0.5, aTrsf.m32 () - aRect.height() * 0.5, aTrsf.m33() );
+
+    /*
+    QTransform aTrsf = myImage->Trsf();
+    gp_Mat aMat( aTrsf.m11(), aTrsf.m21(), 0, 
+                 aTrsf.m12(), -aTrsf.m22(), 0, 
+                 0,           0,           1 );
+    QImage anImage = myImage->Image();
+    QRectF aRect( QPointF( 0, 0 ), QPointF( anImage.width(), anImage.height() ) );
+    aRect = aTrsf.mapRect( aRect );
+    gp_XYZ aVec( aTrsf.m31() + aRect.width() * 0.5, 
+                 aTrsf.m32() - aRect.height() * 0.5, 0 );
+
+    BRepBuilderAPI_GTransform aBuilder( gp_GTrsf( aMat, aVec ) );
+    */
+
+    Handle(HYDROData_PolylineXY) aPolylineObj = Handle(HYDROData_PolylineXY)::DownCast( doc()->CreateObject( KIND_POLYLINEXY ) );
+    QStringList aNamesList;
+    for ( int i = 1; i <= aSubShapes.Length(); i++ ) {
+      TopoDS_Shape aSubShape = aSubShapes.Value( i );
+
+      // Transform the sub-shape
+      aPolylineObj->ImportShape( aSubShape );
+      aPolylineObj->Transform( aTrsf );
+
+      /*
+      aBuilder.Perform( aSubShape, Standard_True );
+      if ( aBuilder.IsDone() ) {
+        aSubShape = aBuilder.Shape();
+      }*/
+      
+      HYDROGUI_Shape* aShape = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
+      aShape->setShape( aPolylineObj->GetShape(), true, false );
+      aShape->setBorderColor( HYDROData_PolylineXY::DefaultWireColor(), false, false );
+      
+      QString aPrefix = QString("%1_%2_%3").arg( myImage->GetName(), "Contour", QString::number( i ) );
+      QString aName = HYDROGUI_Tool::GenerateObjectName( module(), aPrefix, QStringList(), true );
+      myPolylineShapes.insert( aName, aShape);
+      aNamesList << aName;
+    }
+
+    aPolylineObj->Remove();
+
+    if ( !aCtx.IsNull() ) {
+      UpdateZLayersOfHilightPresentationsOfDisplayedObjects( aCtx, Graphic3d_ZLayerId_TopOSD );
+      aCtx->UpdateCurrentViewer();
+    }
+
+    // Get panel
+    HYDROGUI_RecognizeContoursDlg* aPanel = 
+      ::qobject_cast<HYDROGUI_RecognizeContoursDlg*>( inputPanel() );
+    if ( aPanel ) {
+      aPanel->setPolylineNames( aNamesList );
+    }
+  }
+}
+
+/**
+  Erase the preview.
+*/
+void HYDROGUI_RecognizeContoursOp::erasePreview()
+{
+  foreach ( HYDROGUI_Shape* aShape, myPolylineShapes ) {
+    delete aShape;
+  }
+
+  myPolylineShapes.clear();
+}
+
+/**
+  Called when selection of the recognized polylines is changed.
+*/
+void HYDROGUI_RecognizeContoursOp::onSelectionChanged( const QStringList& theSelectedNames )
+{
+  Handle(AIS_InteractiveContext) aCtx = NULL;
+
+  OCCViewer_ViewManager* aViewManager = getPreviewManager();
+  if ( aViewManager ) {
+    if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
+      aCtx = aViewer->getAISContext();
+    }
+  }
+
+  if ( !aCtx.IsNull() ) {
+    foreach ( QString aName, myPolylineShapes.keys() ) {
+      Handle(AIS_InteractiveObject) anObject = 
+        myPolylineShapes.value(aName)->getAISObject();
+
+      bool isSelected = theSelectedNames.contains( aName );
+      if ( ( isSelected && !aCtx->IsSelected( anObject) ) ||
+           ( !isSelected && aCtx->IsSelected( anObject) ) ) {
+        aCtx->AddOrRemoveSelected( anObject, Standard_False );
+      }
+      // myPolylineShapes[aName]->highlight( isSelected, true );
+    }
+    aCtx->UpdateCurrentViewer();
+  }
+}
+
+/**
+  Called when selection in the viewer is changed.
+*/
+void HYDROGUI_RecognizeContoursOp::onViewerSelectionChanged()
+{
+  // Get panel
+  HYDROGUI_RecognizeContoursDlg* aPanel = 
+    ::qobject_cast<HYDROGUI_RecognizeContoursDlg*>( inputPanel() );
+  if ( !aPanel ) {
+    return;
+  }
+
+
+  OCCViewer_ViewManager* aViewManager = getPreviewManager();
+  Handle(AIS_InteractiveContext) aCtx = NULL;
+  if ( aViewManager ) {
+    if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() ) {
+      aCtx = aViewer->getAISContext();
+    }
+  }
+  
+  if ( !aCtx.IsNull() ) {
+    QStringList aSelectedNames;
+
+    foreach ( QString aName, myPolylineShapes.keys() ) {
+      bool isSelected = aCtx->IsSelected( myPolylineShapes.value(aName)->getAISObject() );
+      if ( isSelected ) {
+        aSelectedNames << aName;
+      }
+    }
+
+    aPanel->setSelectedPolylineNames( aSelectedNames );
+  }
+}
+
+/**
+  Do the operation data cleanup.
+*/
+void HYDROGUI_RecognizeContoursOp::cleanup()
+{
+  // Close the external operation dialog
+  closeExternalOperationDlg();
+
+  // Erase the preview 
+  erasePreview();
+
+  // Delete temporary image file
+  if ( myTmpImageFile ) {
+    delete myTmpImageFile;
+    myTmpImageFile = NULL;
+  }
+
+  // Delete temporary GEOM objects
+  if ( !myTmpGeomObjects.isEmpty() ) {
+    HYDROGUI_Tool::DeleteGeomObjects( module(), myTmpGeomObjects );
+    // update the object browser
+    module()->getApp()->updateObjectBrowser( true );
+  }
+}
\ No newline at end of file
diff --git a/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.h b/src/HYDROGUI/HYDROGUI_RecognizeContoursOp.h
new file mode 100644 (file)
index 0000000..dfe7b98
--- /dev/null
@@ -0,0 +1,78 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_RecognizeContoursOp_H
+#define HYDROGUI_RecognizeContoursOp_H
+
+#include "HYDROGUI_Operation.h"
+
+#include <HYDROData_Image.h>
+
+#include <QMap>
+#include <QStringList>
+
+class QTemporaryFile;
+
+
+class HYDROGUI_RecognizeContoursOp : public HYDROGUI_Operation
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_RecognizeContoursOp( HYDROGUI_Module* theModule );
+  virtual ~HYDROGUI_RecognizeContoursOp();
+
+protected:
+  virtual void startOperation();
+  virtual void abortOperation();
+  virtual void commitOperation();
+
+  virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
+                             QStringList& theBrowseObjectsEntries );
+
+protected slots:
+  void onExternalOperationFinished( const QString&, const QString&, 
+                                    const QStringList& );
+
+  void onSelectionChanged( const QStringList& theSelectedNames );
+  void onViewerSelectionChanged();
+
+private:
+  void closeExternalOperationDlg();
+
+  void updateRecognizedPolylines();
+
+  void erasePreview();
+
+  void cleanup();
+
+private:
+  Handle(HYDROData_Image) myImage; ///< the image used for contours detection
+
+  QTemporaryFile* myTmpImageFile;  ///< the temporary graphics file
+
+  QStringList myTmpGeomObjects;    ///< the list of temporary GEOM objects entries
+  QString myGeomContourEntry;      ///< the GEOM contour object entry
+  QString myGEOMOpName;            ///< the name of the called GEOM module operation
+  
+  QMap<QString, HYDROGUI_Shape*> myPolylineShapes; ///< the detected polylines shapes map (key: name, value: shape)
+};
+
+#endif
\ No newline at end of file
index 2ca6d905b6a74ea417063a852a74352614e5bbe9..55418b2b81ea0702dfa671b428d46a794acd8c89 100644 (file)
@@ -71,7 +71,7 @@ QString HYDROGUI_RiverBottomDlg::getRiverName() const
 
 void HYDROGUI_RiverBottomDlg::setRiverName( const QString& theName )
 {
-    myRivers->setSectedObject( theName );
+    myRivers->setSelectedObject( theName );
 }
 
 bool HYDROGUI_RiverBottomDlg::isOk( const Handle(HYDROData_Entity)& theEntity ) const
index 45b88dee547714b95df652013d88289608f6d0db..cca862a65321795e3a2e95ffa53e82f40740c2d8 100644 (file)
@@ -44,14 +44,21 @@ HYDROGUI_SetColorOp::~HYDROGUI_SetColorOp()
 {
 }
 
-bool HYDROGUI_SetColorOp::CanObjectBeColored( const Handle(HYDROData_Entity)& theObject )
+bool HYDROGUI_SetColorOp::CanObjectBeColored( const Handle(HYDROData_Entity)& theObject,
+                                              HYDROGUI_Module* theModule )
 {
   if ( theObject.IsNull() )
     return false;
 
-  return theObject->IsKind( STANDARD_TYPE(HYDROData_Object) ) ||
-         theObject->IsKind( STANDARD_TYPE(HYDROData_IPolyline) ) ||
-         theObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) );
+  bool isCanBeColored = false;
+  if ( theObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) ) ) {
+    size_t anActiveViewId = HYDROGUI_Tool::GetActiveOCCViewId( theModule );
+    isCanBeColored = !theModule->isLandCoversScalarMapModeOn( anActiveViewId );
+  }
+
+  return isCanBeColored ||
+         theObject->IsKind( STANDARD_TYPE(HYDROData_Object) ) ||
+         theObject->IsKind( STANDARD_TYPE(HYDROData_IPolyline) );
 }
 
 void HYDROGUI_SetColorOp::startOperation()
@@ -61,7 +68,7 @@ void HYDROGUI_SetColorOp::startOperation()
   // Get the selected object
   //myEditedObject = Handle(HYDROData_Object)::DownCast( HYDROGUI_Tool::GetSelectedObject( module() ) );
   myEditedObject = HYDROGUI_Tool::GetSelectedObject( module() );
-  if ( !CanObjectBeColored( myEditedObject ) )
+  if ( !CanObjectBeColored( myEditedObject, module() ) )
   {
     abort();
     return;
index ceb6f7ac56f7b021b6f97ecd89751ecf64f3485b..cd9affd8b01c98dfbc0b424334f75a12c222d50d 100644 (file)
@@ -34,7 +34,8 @@ public:
   virtual ~HYDROGUI_SetColorOp();
 
 
-  static bool CanObjectBeColored( const Handle(HYDROData_Entity)& theObject );
+  static bool CanObjectBeColored( const Handle(HYDROData_Entity)& theObject,
+                                  HYDROGUI_Module* theModule );
 
 protected:
   virtual void startOperation();
index 339f9453e054787e8a4f54925a84b2563de992f3..7e7f3314dd378a8886e00c3015d736df8c996b85 100644 (file)
@@ -300,22 +300,6 @@ void HYDROGUI_Shape::update( bool isUpdateViewer,
 
       setShape( aCompound, false, false );  
     }
-    else if ( myObject->IsKind( STANDARD_TYPE(HYDROData_LandCover) ) )
-    {
-      Handle(HYDROData_LandCover) aLandCoverObj =
-        Handle(HYDROData_LandCover)::DownCast( myObject );
-
-      TopoDS_Shape aLandCoverShape = aLandCoverObj->GetShape();
-      if ( !aLandCoverShape.IsNull() ) {
-        setShape( aLandCoverShape, false, false );
-      }
-
-      QColor aFillingColor = aLandCoverObj->GetFillingColor();
-      QColor aBorderColor = aLandCoverObj->GetBorderColor();
-
-      setFillingColor( aFillingColor, false, false );
-      setBorderColor( aBorderColor, false, false );
-    }
   }
  
   if ( myShape.IsNull() || !isVisible() )
@@ -462,7 +446,7 @@ QColor HYDROGUI_Shape::getFillingColor() const
 void HYDROGUI_Shape::setBorderColor( const QColor& theColor,
                                      const bool    theToDisplay,
                                      const bool    theIsUpdateViewer )
-{
+{ 
   myBorderColor = theColor;
   updateShape( theToDisplay, theIsUpdateViewer );
 }
@@ -494,11 +478,22 @@ void HYDROGUI_Shape::setZLayer( const int theZLayer )
 
 Handle_AIS_InteractiveObject HYDROGUI_Shape::createShape() const
 {
-  if( myTopoShape.IsNull() )
+  if( myTopoShape.IsNull() ) {
     return Handle_AIS_InteractiveObject();
-  
+  }
+
   TopAbs_ShapeEnum aShapeType = myTopoShape.ShapeType();
-  if ( aShapeType==TopAbs_EDGE || aShapeType==TopAbs_WIRE ) {
+  bool IsWireEdgeCompound = aShapeType==TopAbs_COMPOUND;
+  if (IsWireEdgeCompound) {
+    TopoDS_Iterator itr(myTopoShape);
+    while (itr.More() && IsWireEdgeCompound) {
+      if (itr.Value().ShapeType() != TopAbs_WIRE && itr.Value().ShapeType() != TopAbs_EDGE)
+        IsWireEdgeCompound = false;
+      itr.Next();
+    }
+  }
+
+  if ( aShapeType==TopAbs_EDGE || aShapeType==TopAbs_WIRE || IsWireEdgeCompound) {
     return new HYDROGUI_Polyline( myTopoShape );
   } else {
     return new AIS_Shape( myTopoShape );
@@ -605,7 +600,9 @@ void HYDROGUI_Shape::displayShape( const bool theIsUpdateViewer )
   if ( myZLayer >= 0 )
     myContext->SetZLayer( myShape, myZLayer );
 
-  myContext->UpdateCurrentViewer();
+  if ( theIsUpdateViewer ) {
+    myContext->UpdateCurrentViewer();
+  }
 }
 
 QColor HYDROGUI_Shape::getActiveColor() const
diff --git a/src/HYDROGUI/HYDROGUI_ShapeLandCover.cxx b/src/HYDROGUI/HYDROGUI_ShapeLandCover.cxx
new file mode 100644 (file)
index 0000000..635470a
--- /dev/null
@@ -0,0 +1,94 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "HYDROGUI_ShapeLandCover.h"
+#include "HYDROGUI_OCCDisplayer.h"
+
+#include <HYDROData_LandCover.h>
+
+#include <AIS_InteractiveContext.hxx>
+
+HYDROGUI_ShapeLandCover::HYDROGUI_ShapeLandCover( HYDROGUI_OCCDisplayer*                theDisplayer,
+                                                  const Handle(AIS_InteractiveContext)& theContext,
+                                                  const Handle_HYDROData_LandCover&     theLandCover,
+                                                  const int                             theZLayer,
+                                                  const bool                            theIsScalarMode )
+: HYDROGUI_Shape( theContext, theLandCover, theZLayer ),
+  myDisplayer( theDisplayer ),
+  myIsScalarMapMode( theIsScalarMode )
+{
+}
+
+HYDROGUI_ShapeLandCover::~HYDROGUI_ShapeLandCover()
+{
+}
+
+void HYDROGUI_ShapeLandCover::update( bool theIsUpdateViewer, bool isDeactivateSelection )
+{
+  setIsToUpdate( false );
+
+  Handle(HYDROData_LandCover) aLandCoverObj =
+    Handle(HYDROData_LandCover)::DownCast( getObject() );
+
+  TopoDS_Shape aLandCoverShape = aLandCoverObj->GetShape();
+  if ( !aLandCoverShape.IsNull() ) {
+    setShape( aLandCoverShape, false, false );
+  }
+
+  if ( !myIsScalarMapMode ) {
+    QColor aFillingColor = aLandCoverObj->GetFillingColor();
+    QColor aBorderColor = aLandCoverObj->GetBorderColor();
+
+    setFillingColor( aFillingColor, false, false );
+    setBorderColor( aBorderColor, false, false );
+  } else {
+    updateShape( false, false );
+  }
+
+  HYDROGUI_Shape::update( theIsUpdateViewer, isDeactivateSelection );
+}
+
+void HYDROGUI_ShapeLandCover::setScalarMapModeEnabled( const bool theIsToEnable )
+{
+  myIsScalarMapMode = theIsToEnable;
+}
+
+void HYDROGUI_ShapeLandCover::setVisible( const bool theState,
+                                           const bool theIsUpdateViewer )
+{
+  HYDROGUI_Shape::setVisible( theState, theIsUpdateViewer );
+  myDisplayer->SetToUpdateColorScale();
+}
+
+void HYDROGUI_ShapeLandCover::displayShape( const bool theIsUpdateViewer )
+{
+  HYDROGUI_Shape::displayShape( theIsUpdateViewer );
+  myDisplayer->SetToUpdateColorScale();
+}
+
+void HYDROGUI_ShapeLandCover::display( const bool theIsUpdateViewer )
+{
+  HYDROGUI_Shape::display( theIsUpdateViewer );
+  myDisplayer->SetToUpdateColorScale();
+}
+
+void HYDROGUI_ShapeLandCover::erase( const bool theIsUpdateViewer )
+{
+  HYDROGUI_Shape::erase( theIsUpdateViewer );
+  myDisplayer->SetToUpdateColorScale();
+}
diff --git a/src/HYDROGUI/HYDROGUI_ShapeLandCover.h b/src/HYDROGUI/HYDROGUI_ShapeLandCover.h
new file mode 100644 (file)
index 0000000..3f89307
--- /dev/null
@@ -0,0 +1,60 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_SHAPE_LANDCOVER_H
+#define HYDROGUI_SHAPE_LANDCOVER_H
+
+#include <HYDROGUI_Shape.h>
+
+class Handle_HYDROData_LandCover;
+class HYDROGUI_OCCDisplayer;
+
+class HYDROGUI_ShapeLandCover : public HYDROGUI_Shape
+{
+public:
+  HYDROGUI_ShapeLandCover( HYDROGUI_OCCDisplayer* theDisplayer,
+                            const Handle(AIS_InteractiveContext)& theContext,
+                            const Handle_HYDROData_LandCover&     theLandCover,
+                            const int                             theZLayer = -1,
+                            const bool                            theIsScalarMode = false );
+  virtual ~HYDROGUI_ShapeLandCover();
+  
+  virtual void              update( bool isUpdateViewer,
+                                    bool isDeactivateSelection );
+
+  virtual void display( const bool theIsUpdateViewer = true );
+  virtual void erase( const bool theIsUpdateViewer = true );
+
+  virtual void               setVisible( const bool theState,
+                                         const bool theIsUpdateViewer = true );
+
+  /**
+   * Enable/disable scalar map coloring mode.
+   * @param theIsToEnable if true - scalar map coloring mode willbe enbaled, if false - disabled
+   */
+  virtual void              setScalarMapModeEnabled( const bool theIsToEnable );
+
+protected:
+  virtual void displayShape( const bool theIsUpdateViewer );
+
+private:
+  HYDROGUI_OCCDisplayer* myDisplayer;
+  bool                   myIsScalarMapMode;
+};
+
+#endif
index 066d0190f2bb90ba836c3c300cc40785c31fce2f..c3185734493165204c92c26363cb8b15e007a321 100644 (file)
@@ -21,6 +21,7 @@
 #include <GraphicsView_Viewer.h>
 
 #include "HYDROGUI_Module.h"
+#include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Operations.h"
 #include "HYDROGUI_Tool.h"
 #include "HYDROGUI_UpdateFlags.h"
diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.cxx b/src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.cxx
new file mode 100644 (file)
index 0000000..aa70371
--- /dev/null
@@ -0,0 +1,196 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_SplitPolylinesDlg.h>
+#include <HYDROGUI_ObjComboBox.h>
+#include <HYDROGUI_ObjListBox.h>
+#include <HYDROGUI_Tool.h>
+#include <OCCViewer_ViewManager.h>
+#include <OCCViewer_ViewWindow.h>
+#include <OCCViewer_ViewPort3d.h>
+#include <CurveCreator_Utils.hxx>
+#include <SUIT_ViewWindow.h>
+#include <QtxDoubleSpinBox.h>
+#include <QFrame>
+#include <QLabel>
+#include <QGridLayout>
+#include <QTabWidget>
+#include <QMouseEvent>
+#include <QLineEdit>
+#include <gp_Pnt2d.hxx>
+
+const double MIN_COORD = -1000000;
+const double MAX_COORD =  1000000;
+const double STEP      =  10;
+
+HYDROGUI_SplitPolylinesDlg::HYDROGUI_SplitPolylinesDlg( HYDROGUI_Module* theModule, const QString& theTitle )
+: HYDROGUI_InputPanel( theModule, theTitle ), myOCCViewer( 0 )
+{
+  QFrame* aFrame = new QFrame( mainFrame() );
+  addWidget( aFrame, 1 );
+
+  QGridLayout* aLayout = new QGridLayout( aFrame );
+  aLayout->setMargin( 5 );
+  aLayout->setSpacing( 5 );
+
+  myName = new QLineEdit( mainFrame() );
+  aLayout->addWidget( new QLabel( tr( "RESULT_NAME" ) ), 0, 0 );
+  aLayout->addWidget( myName, 0, 1 );
+
+  myTab = new QTabWidget( aFrame );
+  aLayout->addWidget( myTab, 1, 0, 1, 2 );
+
+  QFrame* aPointPage = new QFrame();
+  myMainPolyline1 = new HYDROGUI_ObjComboBox( theModule, tr( "POLYLINE" ), KIND_POLYLINEXY, aPointPage );
+  myX = new QtxDoubleSpinBox( aPointPage );
+  myX->setRange( MIN_COORD, MAX_COORD );
+  myX->setSingleStep( STEP );
+  myY = new QtxDoubleSpinBox( aPointPage );
+  myY->setRange( MIN_COORD, MAX_COORD );
+  myY->setSingleStep( STEP );
+  
+  QGridLayout* aPointPageLayout = new QGridLayout( aPointPage );
+  aPointPageLayout->addWidget( myMainPolyline1, 0, 0, 1, 3 );
+  aPointPageLayout->addWidget( new QLabel( tr( "POINT" ) ), 1, 0 );
+  aPointPageLayout->addWidget( myX, 1, 1 );
+  aPointPageLayout->addWidget( myY, 1, 2 );
+  aPointPageLayout->setColumnStretch( 1, 1 );
+  aPointPageLayout->setColumnStretch( 2, 1 );
+  aPointPageLayout->setRowStretch( 2, 1 );
+  myTab->addTab( aPointPage, tr( "BY_POINT" ) );
+
+  QFrame* aToolPage = new QFrame();
+  myMainPolyline2 = new HYDROGUI_ObjComboBox( theModule, tr( "POLYLINE" ), KIND_POLYLINEXY, aToolPage );
+  myToolPolyline = new HYDROGUI_ObjComboBox( theModule, tr( "TOOL_POLYLINE" ), KIND_POLYLINEXY, aToolPage );
+
+  QGridLayout* aToolPageLayout = new QGridLayout( aToolPage );
+  aToolPageLayout->addWidget( myMainPolyline2, 0, 0 );
+  aToolPageLayout->addWidget( myToolPolyline, 1, 0 );
+  aToolPageLayout->setRowStretch( 2, 1 );
+  myTab->addTab( aToolPage, tr( "BY_TOOL" ) );
+
+  QFrame* aSplitPage = new QFrame();
+  myPolylines = new HYDROGUI_ObjListBox( theModule, tr( "POLYLINES" ), KIND_POLYLINEXY, aSplitPage );
+  QGridLayout* aSplitPageLayout = new QGridLayout( aSplitPage );
+  aSplitPageLayout->addWidget( myPolylines, 0, 0 );
+  myTab->addTab( aSplitPage, tr( "COMPLETE_SPLIT" ) );
+
+  connect( myX, SIGNAL( valueChanged( double ) ), this, SIGNAL( pointMoved() ) );
+  connect( myY, SIGNAL( valueChanged( double ) ), this, SIGNAL( pointMoved() ) );
+  connect( myTab, SIGNAL( currentChanged( int ) ), this, SIGNAL( modeChanged() ) );
+  connect( myMainPolyline1, SIGNAL( objectSelected( const QString& ) ), this, SIGNAL( selectionChanged() ) );
+  connect( myMainPolyline2, SIGNAL( objectSelected( const QString& ) ), this, SIGNAL( selectionChanged() ) );
+  connect( myToolPolyline, SIGNAL( objectSelected( const QString& ) ), this, SIGNAL( selectionChanged() ) );
+  connect( myPolylines, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) );
+}
+
+HYDROGUI_SplitPolylinesDlg::~HYDROGUI_SplitPolylinesDlg()
+{
+}
+
+HYDROGUI_SplitPolylinesDlg::Mode HYDROGUI_SplitPolylinesDlg::GetMode() const
+{
+  return ( Mode )myTab->currentIndex();
+}
+
+Handle( HYDROData_PolylineXY ) HYDROGUI_SplitPolylinesDlg::GetMainPolyline() const
+{
+  switch( GetMode() )
+  {
+  case ByPoint:
+    if( !myMainPolyline1->GetObject().IsNull() )
+      return Handle( HYDROData_PolylineXY )::DownCast( myMainPolyline1->GetObject() );
+  case ByTool:
+    if( !myMainPolyline2->GetObject().IsNull() )
+      return Handle( HYDROData_PolylineXY )::DownCast( myMainPolyline2->GetObject() );
+  default:
+    return Handle( HYDROData_PolylineXY )();
+  }
+  return Handle( HYDROData_PolylineXY )();
+}
+
+Handle( HYDROData_PolylineXY ) HYDROGUI_SplitPolylinesDlg::GetToolPolyline() const
+{
+  if( GetMode()==ByTool )
+    return Handle( HYDROData_PolylineXY )::DownCast( myToolPolyline->GetObject() );
+  else
+    return Handle( HYDROData_PolylineXY )();
+}
+
+gp_Pnt2d HYDROGUI_SplitPolylinesDlg::GetPoint() const
+{
+  return gp_Pnt2d( myX->value(), myY->value() );
+}
+
+HYDROData_SequenceOfObjects HYDROGUI_SplitPolylinesDlg::GetPolylines() const
+{
+  if( GetMode()==Split )
+    return myPolylines->selectedObjects();
+  else
+    return HYDROData_SequenceOfObjects();
+}
+
+void HYDROGUI_SplitPolylinesDlg::setPolylinesFromSelection()
+{
+  myMainPolyline1->reset();
+  myMainPolyline2->reset();
+  myPolylines->reset();
+
+  Handle( HYDROData_Entity ) anObject = HYDROGUI_Tool::GetSelectedObject( module() );
+  if( anObject.IsNull() || anObject->GetKind() != KIND_POLYLINEXY )
+    return;
+
+  QString aName = anObject->GetName();
+  myMainPolyline1->setObjectName( aName );
+  myMainPolyline2->setObjectName( aName );
+  myPolylines->setObjectsFromSelection();
+}
+
+void HYDROGUI_SplitPolylinesDlg::setOCCViewer( OCCViewer_Viewer* theViewer )
+{
+  if( !theViewer )
+    return;
+  
+  myOCCViewer = theViewer;
+  OCCViewer_ViewManager* aViewManager = dynamic_cast<OCCViewer_ViewManager*>( myOCCViewer->getViewManager() );
+  disconnect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
+              this, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
+  connect( aViewManager, SIGNAL( mousePress( SUIT_ViewWindow*, QMouseEvent* ) ),
+           this, SLOT( onMousePress( SUIT_ViewWindow*, QMouseEvent* ) ) );
+}
+
+void HYDROGUI_SplitPolylinesDlg::onMousePress( SUIT_ViewWindow* theWindow, QMouseEvent* theEvent )
+{
+  gp_Pnt aPnt = CurveCreator_Utils::ConvertClickToPoint( theEvent->x(), theEvent->y(), getViewPort()->getView() );
+  myX->setValue( aPnt.X() );
+  myY->setValue( aPnt.Y() );
+}
+
+OCCViewer_ViewPort3d* HYDROGUI_SplitPolylinesDlg::getViewPort() const
+{
+  OCCViewer_ViewPort3d* aViewPort = 0;
+  if ( myOCCViewer )
+    aViewPort = dynamic_cast<OCCViewer_ViewWindow*>( myOCCViewer->getViewManager()->getActiveView() )->getViewPort();
+    
+  return aViewPort;
+}
+
+QString HYDROGUI_SplitPolylinesDlg::GetResultName() const
+{
+  return myName->text();
+}
diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.h b/src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.h
new file mode 100644 (file)
index 0000000..dedda92
--- /dev/null
@@ -0,0 +1,79 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_SplitPolylinesDlg_H
+#define HYDROGUI_SplitPolylinesDlg_H
+
+#include "HYDROGUI_InputPanel.h"
+#include <HYDROData_PolylineXY.h>
+
+class QTabWidget;
+class QtxDoubleSpinBox;
+class HYDROGUI_ObjComboBox;
+class HYDROGUI_ObjListBox;
+class gp_Pnt2d;
+class OCCViewer_Viewer;
+class SUIT_ViewWindow;
+class OCCViewer_ViewPort3d;
+class QLineEdit;
+
+class HYDROGUI_SplitPolylinesDlg : public HYDROGUI_InputPanel
+{
+  Q_OBJECT
+
+public:
+  enum Mode { ByPoint, ByTool, Split };
+
+public:
+  HYDROGUI_SplitPolylinesDlg( HYDROGUI_Module* theModule, const QString& theTitle );
+  virtual ~HYDROGUI_SplitPolylinesDlg();
+
+  QString                        GetResultName() const;
+  Mode                           GetMode() const; 
+  Handle( HYDROData_PolylineXY ) GetMainPolyline() const;
+  Handle( HYDROData_PolylineXY ) GetToolPolyline() const;
+  gp_Pnt2d                       GetPoint() const;
+  HYDROData_SequenceOfObjects    GetPolylines() const;
+
+  void setPolylinesFromSelection();
+  void setOCCViewer( OCCViewer_Viewer* theViewer );
+
+signals:
+  void modeChanged();
+  void pointMoved();
+  void selectionChanged();
+
+private slots:
+  void onMousePress( SUIT_ViewWindow*, QMouseEvent* );
+
+private:
+  OCCViewer_ViewPort3d* getViewPort() const;
+
+private:
+  QLineEdit*            myName;
+  QTabWidget*           myTab;
+  QtxDoubleSpinBox*     myX;
+  QtxDoubleSpinBox*     myY;
+  HYDROGUI_ObjComboBox* myMainPolyline1;
+  HYDROGUI_ObjComboBox* myMainPolyline2;
+  HYDROGUI_ObjComboBox* myToolPolyline;
+  HYDROGUI_ObjListBox*  myPolylines;
+  OCCViewer_Viewer*     myOCCViewer;
+};
+
+#endif
diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.cxx
new file mode 100644 (file)
index 0000000..d6556fb
--- /dev/null
@@ -0,0 +1,186 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <HYDROGUI_SplitPolylinesOp.h>
+#include <HYDROGUI_SplitPolylinesDlg.h>
+#include <HYDROGUI_Module.h>
+#include <HYDROGUI_UpdateFlags.h>
+#include <HYDROGUI_Shape.h>
+#include <HYDROData_PolylineOperator.h>
+#include <HYDROData_Document.h>
+#include <LightApp_Application.h>
+#include <OCCViewer_ViewModel.h>
+#include <OCCViewer_ViewManager.h>
+#include <gp_Pnt2d.hxx>
+#include <BRepLib_MakeVertex.hxx>
+#include <BRep_Builder.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopoDS_Compound.hxx>
+
+HYDROGUI_SplitPolylinesOp::HYDROGUI_SplitPolylinesOp( HYDROGUI_Module* theModule )
+: HYDROGUI_Operation( theModule ),
+  myPreviewPrs( 0 )
+{
+  setName( tr( "SPLIT_POLYLINES" ) );
+}
+
+HYDROGUI_SplitPolylinesOp::~HYDROGUI_SplitPolylinesOp()
+{
+}
+
+void HYDROGUI_SplitPolylinesOp::startOperation()
+{
+  HYDROGUI_Operation::startOperation();
+
+  HYDROGUI_SplitPolylinesDlg* aPanel = 
+    ::qobject_cast<HYDROGUI_SplitPolylinesDlg*>( inputPanel() );
+  if ( !aPanel )
+    return;
+
+  aPanel->setPolylinesFromSelection();
+  LightApp_Application* anApp = module()->getApp();
+  OCCViewer_ViewManager* aViewManager =
+    dynamic_cast<OCCViewer_ViewManager*>( anApp->getViewManager( OCCViewer_Viewer::Type(), true ) );
+  aPanel->setOCCViewer( aViewManager ? aViewManager->getOCCViewer() : 0 );
+  setPreviewManager( aViewManager );
+
+  OnUpdatePreview();
+}
+
+HYDROGUI_InputPanel* HYDROGUI_SplitPolylinesOp::createInputPanel() const
+{
+  HYDROGUI_SplitPolylinesDlg* aDlg = new HYDROGUI_SplitPolylinesDlg( module(), getName() );
+  connect( aDlg, SIGNAL( pointMoved() ), this, SLOT( OnUpdatePreview() ) );
+  connect( aDlg, SIGNAL( modeChanged() ), this, SLOT( OnUpdatePreview() ) );
+  connect( aDlg, SIGNAL( selectionChanged() ), this, SLOT( OnUpdatePreview() ) );
+  return aDlg;
+}
+
+bool HYDROGUI_SplitPolylinesOp::processApply( int& theUpdateFlags,
+                                              QString& theErrorMsg,
+                                              QStringList& theBrowseObjectsEntries )
+{
+  HYDROGUI_SplitPolylinesDlg* aPanel = ::qobject_cast<HYDROGUI_SplitPolylinesDlg*>( inputPanel() );
+  if ( !aPanel )
+    return false;
+
+  QString aName = aPanel->GetResultName();
+  Handle( HYDROData_PolylineXY ) aMainPolyline = aPanel->GetMainPolyline();
+  Handle( HYDROData_PolylineXY ) aToolPolyline = aPanel->GetToolPolyline();
+  HYDROData_SequenceOfObjects aPolylinesList = aPanel->GetPolylines();
+  gp_Pnt2d aPoint = aPanel->GetPoint();
+
+  HYDROData_PolylineOperator anOp;
+  switch( aPanel->GetMode() )
+  {
+  case HYDROGUI_SplitPolylinesDlg::ByPoint:
+    anOp.Split( doc(), aName.toLatin1().data(), aMainPolyline, aPoint );
+    break;
+  case HYDROGUI_SplitPolylinesDlg::ByTool:
+    anOp.Split( doc(), aName.toLatin1().data(), aMainPolyline, aToolPolyline );
+    break;
+  case HYDROGUI_SplitPolylinesDlg::Split:
+    anOp.Split( doc(), aName.toLatin1().data(), aPolylinesList );
+    break;
+  }
+  
+  theUpdateFlags = UF_Model | UF_OCCViewer | UF_OCC_Forced | UF_VTKViewer;
+  return true;
+}
+
+void HYDROGUI_SplitPolylinesOp::abortOperation()
+{
+  erasePreview();
+  HYDROGUI_Operation::abortOperation();
+}
+
+void HYDROGUI_SplitPolylinesOp::commitOperation()
+{
+  erasePreview();
+  HYDROGUI_Operation::commitOperation();
+}
+
+void HYDROGUI_SplitPolylinesOp::erasePreview()
+{
+  if( myPreviewPrs )
+  {
+    delete myPreviewPrs;
+    myPreviewPrs = 0;
+  }
+}
+
+void HYDROGUI_SplitPolylinesOp::OnUpdatePreview()
+{
+  OCCViewer_ViewManager* aViewManager = getPreviewManager();
+  if ( aViewManager )
+  {
+    if ( OCCViewer_Viewer* aViewer = aViewManager->getOCCViewer() )
+    {
+      Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
+      if ( !aCtx.IsNull() )
+      {
+        if( !myPreviewPrs )
+          myPreviewPrs = new HYDROGUI_Shape( aCtx, NULL, getPreviewZLayer() );
+        aCtx->ClearSelected();
+      }
+    }
+  }
+
+  HYDROGUI_SplitPolylinesDlg* aPanel = ::qobject_cast<HYDROGUI_SplitPolylinesDlg*>( inputPanel() );
+  if( myPreviewPrs && aPanel )
+  {
+    BRep_Builder aBB;
+    TopoDS_Compound aCmp;
+    aBB.MakeCompound( aCmp );
+
+    switch( aPanel->GetMode() )
+    {
+    case HYDROGUI_SplitPolylinesDlg::ByPoint:
+      {
+        gp_Pnt2d aPnt = aPanel->GetPoint();
+        TopoDS_Vertex aVertex = BRepLib_MakeVertex( gp_Pnt( aPnt.X(), aPnt.Y(), 0.0 ) );
+        if( !aPanel->GetMainPolyline().IsNull() )
+          aBB.Add( aCmp, aPanel->GetMainPolyline()->GetShape() );
+        aBB.Add( aCmp, aVertex );
+        break;
+      }
+    case HYDROGUI_SplitPolylinesDlg::ByTool:
+      {
+        if( !aPanel->GetMainPolyline().IsNull() )
+          aBB.Add( aCmp, aPanel->GetMainPolyline()->GetShape() );
+        if( !aPanel->GetToolPolyline().IsNull() )
+          aBB.Add( aCmp, aPanel->GetToolPolyline()->GetShape() );
+        break;
+      }
+    case HYDROGUI_SplitPolylinesDlg::Split:
+      {
+        HYDROData_SequenceOfObjects aPolylines = aPanel->GetPolylines();
+        for( int i=aPolylines.Lower(), n=aPolylines.Upper(); i<=n; i++ )
+        {
+          Handle( HYDROData_PolylineXY ) aPolyline = Handle( HYDROData_PolylineXY )::DownCast( aPolylines.Value( i ) );
+          if( !aPolyline.IsNull() )
+            aBB.Add( aCmp, aPolyline->GetShape() );
+        }
+        break;
+      }
+    }
+
+
+    myPreviewPrs->setShape( aCmp );
+  }
+}
diff --git a/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.h b/src/HYDROGUI/HYDROGUI_SplitPolylinesOp.h
new file mode 100644 (file)
index 0000000..8de00f8
--- /dev/null
@@ -0,0 +1,52 @@
+// Copyright (C) 2014-2015  EDF-R&D
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#ifndef HYDROGUI_SplitPolylinesOp_H
+#define HYDROGUI_SplitPolylinesOp_H
+
+#include "HYDROGUI_Operation.h"
+
+class HYDROGUI_SplitPolylinesOp : public HYDROGUI_Operation
+{
+  Q_OBJECT
+
+public:
+  HYDROGUI_SplitPolylinesOp( HYDROGUI_Module* theModule );
+  virtual ~HYDROGUI_SplitPolylinesOp();
+
+protected:
+  virtual void startOperation();
+  virtual void abortOperation();
+  virtual void commitOperation();
+
+  virtual HYDROGUI_InputPanel* createInputPanel() const;
+
+  virtual bool processApply( int& theUpdateFlags, QString& theErrorMsg,
+                             QStringList& theBrowseObjectsEntries );
+
+  virtual HYDROGUI_Shape*      getPreviewShape() const { return myPreviewPrs; };
+
+protected slots:
+  void OnUpdatePreview();
+  void erasePreview();
+
+private:
+  HYDROGUI_Shape* myPreviewPrs;
+};
+
+#endif
index 8b4f7050fada1831bd6eaeec0962f11f574f2cbc..95f0750bda8f08194e944d5882ba655a72347a68 100644 (file)
 
 #include "HYDROGUI_StreamDlg.h"
 
+#include "HYDROGUI_ListSelector.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_OrderedListWidget.h"
 #include "HYDROGUI_Tool.h"
 
+#include <HYDROData_Profile.h>
+
+#include <LightApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+
 #include <QComboBox>
 #include <QGroupBox>
 #include <QLabel>
@@ -51,12 +59,12 @@ HYDROGUI_StreamDlg::HYDROGUI_StreamDlg( HYDROGUI_Module* theModule, const QStrin
   anAxisLayout->addWidget( new QLabel( tr( "STREAM_HYDRAULIC_AXIS" ) ) );
   anAxisLayout->addWidget( myAxes );
 
-  myProfiles = new QListWidget( aParamGroup );
-  myProfiles->setSelectionMode( QListWidget::ExtendedSelection );
-  myProfiles->setEditTriggers( QListWidget::NoEditTriggers );
-  myProfiles->setViewMode( QListWidget::ListMode );
-  myProfiles->setSortingEnabled( false );
-
+  myProfiles = new HYDROGUI_OrderedListWidget( aParamGroup, 0 );
+  myProfiles->setHiddenObjectsShown(true);
+  myProfiles->setVisibilityIconShown(false);
+  myProfiles->setContentsMargins(QMargins());
+  myProfiles->setOrderingEnabled( false );
   myAddButton = new QPushButton( aParamGroup );
   myAddButton->setText( tr("ADD") );
   myRemoveButton = new QPushButton( aParamGroup );
@@ -80,6 +88,13 @@ HYDROGUI_StreamDlg::HYDROGUI_StreamDlg( HYDROGUI_Module* theModule, const QStrin
   addWidget( aParamGroup );
   addStretch();
 
+  // Create selector
+  if ( module() ) {
+    HYDROGUI_ListSelector* aListSelector = 
+      new HYDROGUI_ListSelector( myProfiles, module()->getApp()->selectionMgr() );
+    aListSelector->setAutoBlock( true );
+  }
+
   // Connect signals and slots
   connect( myAxes, SIGNAL( currentIndexChanged( const QString & ) ), 
            this, SIGNAL( AxisChanged( const QString& ) ) );
@@ -98,7 +113,7 @@ void HYDROGUI_StreamDlg::reset()
   myObjectName->clear();
 
   myAxes->clear();
-  myProfiles->clear();
+  myProfiles->setObjects( HYDROGUI_ListModel::Object2VisibleList() );
   myAddButton->setEnabled( false );
   myRemoveButton->setEnabled( false );
 
@@ -149,13 +164,18 @@ void HYDROGUI_StreamDlg::setProfiles( const QStringList& theProfiles )
 
   myProfiles->setUpdatesEnabled( false );
   
-  myProfiles->clear();
+  HYDROGUI_ListModel::Object2VisibleList aProfiles;
   foreach ( const QString& aProfileName, theProfiles ) {
-    QListWidgetItem* aListItem = new QListWidgetItem( aProfileName, myProfiles );
-    aListItem->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable );
+    Handle(HYDROData_Profile) anObject = Handle(HYDROData_Profile)::DownCast( 
+      HYDROGUI_Tool::FindObjectByName( module(), aProfileName ) );
+    if ( !anObject.IsNull() ) {
+      aProfiles.append( HYDROGUI_ListModel::Object2Visible( anObject, true ) );
+    }
   }
 
-  myRemoveButton->setEnabled( myProfiles->count() > 0 );
+  myProfiles->setObjects( aProfiles );
+
+  myRemoveButton->setEnabled( myProfiles->getObjects().count() > 0 );
 
   myProfiles->setUpdatesEnabled( true );
 
@@ -164,15 +184,7 @@ void HYDROGUI_StreamDlg::setProfiles( const QStringList& theProfiles )
 
 void HYDROGUI_StreamDlg::onRemoveProfiles()
 {
-  QStringList aSelectedProfiles;
-
-  QList<QListWidgetItem*> aSelectedItems = myProfiles->selectedItems();
-  foreach( const QListWidgetItem* anItem, aSelectedItems ) {
-    QString aProfileName = anItem->text();
-    if ( !aProfileName.isEmpty() ) {
-      aSelectedProfiles << aProfileName;
-    }
-  }
+  QStringList aSelectedProfiles = myProfiles->getSelectedNames();
 
   emit RemoveProfiles( aSelectedProfiles );
 }
index 06ffcf1f008327845014cc69803b11ace03ef3d5..a9679f4e7b16160b30d07f3b0199bc662e21e8ad 100644 (file)
@@ -21,6 +21,8 @@
 
 #include "HYDROGUI_InputPanel.h"
 
+class HYDROGUI_OrderedListWidget;
+
 class QComboBox;
 class QGroupBox;
 class QLineEdit;
@@ -59,10 +61,10 @@ private:
   QGroupBox*                 myObjectNameGroup;
   QLineEdit*                 myObjectName;
 
-  QComboBox*                 myAxes;
-  QListWidget*               myProfiles;
-  QPushButton*               myRemoveButton;
-  QPushButton*               myAddButton;
+  QComboBox*                  myAxes;
+  HYDROGUI_OrderedListWidget* myProfiles;
+  QPushButton*                myRemoveButton;
+  QPushButton*                myAddButton;
 };
 
 #endif
index d11ea2c3f3ef669b7479e5c89a86eb8c83e9ba0d..6162acb8e391d9ae2836e8f09dc9e084886dbd42 100755 (executable)
@@ -435,20 +435,7 @@ void HYDROGUI_StreamOp::onAddProfiles()
 void HYDROGUI_StreamOp::onRemoveProfiles( const QStringList& theProfilesToRemove )
 {
   QStringList aToRemove = theProfilesToRemove;
-
-  // Take the Object Browser selection into account
-  HYDROData_SequenceOfObjects aSelectedObjects = HYDROGUI_Tool::GetSelectedObjects( module() ); 
-  for( int i = 1, n = aSelectedObjects.Length(); i <= n; i++ )
-  {
-    Handle(HYDROData_Profile) aProfile = 
-      Handle(HYDROData_Profile)::DownCast( aSelectedObjects.Value( i ) );
-    if ( aProfile.IsNull() )
-      continue;
-
-    QString aProfileName = aProfile->GetName();
-    aToRemove.append( aProfileName );
-  }
-
+  
   aToRemove.removeDuplicates();
   if ( aToRemove.isEmpty() )
     return;
index 289bfb90625257bd8eae50fad2c0abfe1ffd4d5d..bfb3bb7de368bb0c32b81246d81c666517d11e07 100644 (file)
 
 #include "HYDROGUI_StricklerTableDlg.h"
 #include "HYDROGUI_DataObject.h"
+#include "HYDROGUI_Module.h"
+#include "HYDROGUI_OCCDisplayer.h"
 #include "HYDROGUI_Operations.h"
 #include "HYDROGUI_Tool.h"
+#include "HYDROGUI_UpdateFlags.h"
 
 #include <HYDROData_Document.h>
 
@@ -180,9 +183,11 @@ bool HYDROGUI_StricklerTableOp::processApply( int& theUpdateFlags, QString& theE
     {
         QString anEntry = HYDROGUI_DataObject::dataObjectEntry( aStricklerTableObj );
         theBrowseObjectsEntries.append( anEntry );
+    } else {
+      module()->getOCCDisplayer()->SetToUpdateColorScale();
     }
 
-    theUpdateFlags |= UF_ObjBrowser;
+    theUpdateFlags |= UF_ObjBrowser | UF_OCCViewer;
 
     return true;
 }
index 45e356eba33aecb89808930ffa822a9753b8dbb1..414582542baac6aefa2f314055c640bc4a19413e 100644 (file)
@@ -30,6 +30,7 @@
 #include <HYDROData_Profile.h>
 #include <HYDROData_LandCover.h>
 
+#include <GeometryGUI.h>
 #include <GEOMBase.h>
 
 #include <GraphicsView_Viewer.h>
@@ -184,7 +185,7 @@ QString HYDROGUI_Tool::GetTempDir( const bool theToCreate )
 #ifdef WNT
     tmpdir = "C:\\";
 #else
-    tmpdir = "/tmp";
+    tmpdir = strdup( "/tmp" );
 #endif
   }
   aRes = tmpdir;
@@ -791,3 +792,39 @@ Handle(Image_PixMap) HYDROGUI_Tool::Pixmap( const QImage& theImage )
 
     return pix;
 }
+
+void HYDROGUI_Tool::DeleteGeomObjects( HYDROGUI_Module* theModule, const QStringList& theEntries )
+{
+  QStringList anEntryList;
+
+  // Get active SalomeApp_Study
+  SalomeApp_Study* aStudy = NULL;
+  if ( theModule && theModule->getApp() ) {
+    aStudy = dynamic_cast<SalomeApp_Study*>( theModule->getApp()->activeStudy() );
+  }
+  if ( !aStudy ) {
+    return;
+  }
+  // Get GEOM engine
+  GEOM::GEOM_Gen_var aGeomEngine = GeometryGUI::GetGeomGen();
+  if ( aGeomEngine->_is_nil() ) {
+    return;
+  }
+  
+  // Delete GEOM objects
+  _PTR(StudyBuilder) aStudyBuilder( aStudy->studyDS()->NewBuilder() );
+  foreach ( const QString anEntry, theEntries ) {
+    _PTR(SObject) aSObject( aStudy->studyDS()->FindObjectID( qPrintable(anEntry) ) );
+    if ( aSObject ) {
+      GEOM::GEOM_Object_var aGeomObj = 
+        GEOMBase::GetObjectFromIOR( aSObject->GetIOR().c_str() );
+
+      if ( !aGeomObj->_is_nil() ) {
+        aGeomEngine->RemoveObject( aGeomObj );
+      }
+
+      aStudyBuilder->RemoveObject( aSObject );
+    }
+  }
+}
index fada415c5233880283e5493d286456419e6587d7..3231d00b1ec4281fa091263068044feadb7ac818 100644 (file)
@@ -179,16 +179,7 @@ public:
    * \return object kind
    */
   static ObjectKind GetSelectedPartition( HYDROGUI_Module* theModule );
-
-  /**
-   * \brief Get the selected GEOM objects.
-   * \param theModule module
-   * \param theTypes the acceptable GEOM object types
-   * \return list of GEOM objects entries
-   */
-  static QStringList GetSelectedGeomObjects( HYDROGUI_Module* theModule,
-                                             QList<GEOM::shape_type> theTypes );
-
+  
   /**
    * \brief Find the data object with the specified name.
    * \param theModule module
@@ -356,6 +347,22 @@ public:
    * \return Image_PixMap object
    */
   static Handle(Image_PixMap)     Pixmap( const QImage& theImage );
+
+  /**
+   * \brief Get the selected GEOM objects.
+   * \param theModule the module
+   * \param theTypes the acceptable GEOM object types
+   * \return list of GEOM objects entries
+   */
+  static QStringList GetSelectedGeomObjects( HYDROGUI_Module* theModule,
+                                             QList<GEOM::shape_type> theTypes );
+
+  /**
+   * \brief Delete the GEOM objects.
+   * \param theModule the module
+   * \param theEntries the GEOM objects entries
+   */
+  static void DeleteGeomObjects( HYDROGUI_Module* theModule, const QStringList& theEntries );
 };
 
 #endif
index 6554e5ef5213314bec99f3dd133d7ccda950f54c..52969e5e353aacc4b71db07ffff442ff15dd02ea 100644 (file)
@@ -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;
 
index ac479434cafb04f231eb35d9a8c9053b4cedfd39..0fe911d488f0c16f487867dbcf95a4674bd53326 100644 (file)
@@ -93,9 +93,12 @@ void HYDROGUI_ZLayersIterator::Init( const Handle_V3d_Viewer& theViewer )
   theViewer->GetAllZLayers( anExistingZLayers );
   
   int n = anExistingZLayers.Length();
-  myZLayers.resize( n );
-  for( int i=1; i<=n; i++ )
-    myZLayers[i-1] = anExistingZLayers( i );
+  for( int i=1; i<=n; i++ ) {
+    int aLayerId = anExistingZLayers( i );
+    if ( aLayerId >= 0 ) {
+      myZLayers.push_back( aLayerId );
+    }
+  }
 
   myIndex = 0;
 }
index 1d59e75b274ac62d033273e8b9789b817e0ac4e8..76bd41b06414b7c0802b1b98727aaf4775d4a6a0 100644 (file)
@@ -21,6 +21,7 @@
 #include <AIS_InteractiveObject.hxx>
 #include <AIS_ListOfInteractive.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
+#include <AIS_Trihedron.hxx>
 #include <PrsMgr_PresentationManager3d.hxx>
 
 void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle_AIS_InteractiveContext& theContext,
@@ -33,7 +34,7 @@ void UpdateZLayersOfHilightPresentationsOfDisplayedObjects( const Handle_AIS_Int
   for ( ; aListIter.More(); aListIter.Next() )
   {
     Handle(AIS_InteractiveObject) aPrsObj = aListIter.Value();
-    if( !aPrsObj.IsNull() )
+    if( !aPrsObj.IsNull() && !aPrsObj->IsKind( STANDARD_TYPE(AIS_Trihedron) ) )
     {
       int aMode = aPrsObj->HasHilightMode() ? aPrsObj->HilightMode() : 0;
       theContext->MainPrsMgr()->Color( aPrsObj, Quantity_NOC_YELLOW, aMode );
index 8561008c5ae563fda77aa41710130b650839e1c2..c1139e1e4e66153e03a82a6dddabb20245e7f8d7 100644 (file)
@@ -66,8 +66,8 @@ QString HYDROGUI_Zone::getRefObjectNames() const
     HYDROData_SequenceOfObjects::Iterator anIter( aSeq );
     for ( ; anIter.More(); anIter.Next() )
     {
-      Handle(HYDROData_Object) aRefGeomObj =
-        Handle(HYDROData_Object)::DownCast( anIter.Value() );
+      Handle(HYDROData_Entity) aRefGeomObj =
+        Handle(HYDROData_Entity)::DownCast( anIter.Value() );
       if ( !aRefGeomObj.IsNull() )
       {
         // Get Ref.Object name
@@ -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
index 5015949557913659c7b5099804db161e67b1ddf6..475bbaba59020b943d02d948b365629747f60dab 100644 (file)
       <source>HYDRO_M_TYPE20_ICO</source>
       <translation>icon_mhydro_obj.png</translation>
     </message>
+    <message>
+      <source>HYDRO_M_TYPE27_ICO</source>
+      <translation>icon_mland_cover.png</translation>
+    </message>  
 
     <!-- Operations icons -->
     <message>
       <source>CREATE_POLYLINE_ICO</source>
       <translation>icon_create_polyline.png</translation>
     </message>
+
+    <message>
+      <source>IMPORT_SINUSX_ICO</source>
+      <translation>icon_import_sx.png</translation>
+    </message>
+
+    <message>
+      <source>EXPORT_SINUSX_ICO</source>
+      <translation>icon_export_sx.png</translation>
+    </message>
+
     <message>
       <source>EDIT_POLYLINE_ICO</source> 
       <translation>icon_edit_polyline.png</translation>
     </message>
 
     <message>
-      <source>EXPORT_POLYLINE_ICO</source>
-      <translation>icon_export_polyline.png</translation>
+      <source>EXPORT_TO_SHAPE_FILE_ICO</source>
+      <translation>icon_export_shp.png</translation>
     </message>
 
     <message>
       <translation>icon_import_polyline.png</translation>
     </message>
 
+    <message>
+      <source>IMPORT_LANDCOVER_ICO</source>
+      <translation>icon_import_polygon.png</translation>
+    </message>
+
     <message>
       <source>FUSE_IMAGES_ICO</source>
       <translation>icon_fuse_images.png</translation>
       <translation>icon_edit_splitted_image.png</translation>
     </message>
 
+    <message>
+      <source>RECOGNIZE_CONTOURS_ICO</source>
+      <translation>icon_recognize_contours.png</translation>
+    </message>
+
     <message>
       <source>CREATE_STREAM_BOTTOM_ICO</source>
       <translation>icon_stream_bottom_image.png</translation>
index 75dfb7f26ff96b7c7aed04ca0a855b2f698a6d42..0a470c97d1be4def5438f0f4a26f39a620ea1fea 100644 (file)
@@ -277,6 +277,10 @@ All supported formats (*.brep *.iges *.igs *.step *.stp)</translation>
       <source>STRICKLER_TABLE_FILTER</source>
       <translation>Strickler table files (*.txt);;All files (*.* *)</translation>
     </message>
+    <message>
+      <source>LAND_COVER_POLYLINES</source>
+      <translation>Polylines</translation>
+    </message>
   </context>
 
   <context>
@@ -365,6 +369,14 @@ All supported formats (*.brep *.iges *.igs *.step *.stp)</translation>
       <source>STRICKLER_TYPE</source>
       <translation>Strickler type from land cover</translation>
     </message>
+    <message>
+      <source>RESULTS_ON_GEOMETRY_OBJECTS</source>
+      <translation>Results on geometry objects</translation>
+    </message>
+    <message>
+      <source>RESULTS_ON_LAND_COVERS</source>
+      <translation>Results on land covers</translation>
+    </message>
   </context>
 
   <context>
@@ -389,6 +401,10 @@ All supported formats (*.brep *.iges *.igs *.step *.stp)</translation>
       <source>ORDER_CHANGED</source>
       <translation>Order of objects is changed</translation>
     </message>
+    <message>
+      <source>RULE_CHANGED</source>
+      <translation>Priority rule for objects is changed</translation>
+    </message>
     <message>
       <source>CONFIRM_SPLITTING_ZONES_RECALCULATION_REGIONS</source>
       <translation>Case splitting zones already exist and will be recalculated after regions list modification. Do you confirm the recalculation?</translation>
@@ -430,8 +446,8 @@ All supported formats (*.brep *.iges *.igs *.step *.stp)</translation>
       <translation>Altitude.Object</translation>
     </message>
     <message>
-      <source>STRICKLER_TABLE_COLUMN</source>
-      <translation>Strickler table</translation>
+      <source>LAND_COVER_COLUMN</source>
+      <translation>Land cover</translation>
     </message>
     <message>
       <source>ZONE_TO_NEW_REGION</source>
@@ -776,7 +792,7 @@ Would you like to remove all references from the image?</translation>
     </message>
     <message>
       <source>DSK_GEOREFERENCEMENT</source>
-      <translation>Profile(s) georeferencement</translation>
+      <translation>Profiles georeferencement</translation>
     </message>
     <message>
       <source>DSK_CREATE_IMMERSIBLE_ZONE</source>
@@ -918,6 +934,18 @@ Would you like to remove all references from the image?</translation>
       <source>DSK_IMPORT_POLYLINE</source>
       <translation>Import polyline from file(s)</translation>
     </message>
+    <message>
+      <source>DSK_IMPORT_LANDCOVER</source>
+      <translation>Import land cover from file(s)</translation>
+    </message>
+    <message>
+      <source>DSK_IMPORT_SINUSX</source>
+      <translation>Import from SinusX</translation>
+    </message>
+    <message>
+      <source>DSK_EXPORT_SINUSX</source>
+      <translation>Export to SinusX</translation>
+    </message>
     <message>
       <source>DSK_LOAD_VISUAL_STATE</source>
       <translation>Load visual state</translation>
@@ -958,6 +986,14 @@ Would you like to remove all references from the image?</translation>
       <source>DSK_SPLIT_IMAGE</source>
       <translation>Split image</translation>
     </message>
+    <message>
+      <source>DSK_SPLIT_POLYLINES</source>
+      <translation>Split polylines</translation>
+    </message>
+    <message>
+      <source>DSK_MERGE_POLYLINES</source>
+      <translation>Merge polylines</translation>
+    </message>
     <message>
       <source>DSK_UNDO</source>
       <translation>Undo</translation>
@@ -1011,8 +1047,8 @@ Would you like to remove all references from the image?</translation>
       <translation>Submersible</translation>
     </message>
     <message>
-      <source>DSK_EXPORT_POLYLINE</source>
-      <translation>Export Polyline</translation>
+      <source>DSK_EXPORT_TO_SHAPE_FILE</source>
+      <translation>Export to Shape file</translation>
     </message>
     <message>
       <source>DSK_POLYLINE_EXTRACTION</source>
@@ -1135,6 +1171,14 @@ Would you like to remove all references from the image?</translation>
       <source>MEN_DESK_PROFILE</source>
       <translation>Profile</translation>
     </message>
+    <message>
+      <source>MEN_DESK_IMAGE</source>
+      <translation>Image</translation>
+    </message>
+    <message>
+      <source>MEN_DESK_POLYLINE</source>
+      <translation>Polyline</translation>
+    </message>
     <message>
       <source>MEN_EDIT_CALCULATION</source>
       <translation>Edit calculation case</translation>
@@ -1211,6 +1255,18 @@ Would you like to remove all references from the image?</translation>
       <source>MEN_IMPORT_POLYLINE</source>
       <translation>Import polyline</translation>
     </message>
+    <message>
+      <source>MEN_IMPORT_LANDCOVER</source>
+      <translation>Import land cover from file(s)</translation>
+    </message>
+    <message>
+      <source>MEN_IMPORT_SINUSX</source>
+      <translation>Import from SinusX</translation>
+    </message>
+    <message>
+      <source>MEN_EXPORT_SINUSX</source>
+      <translation>Export to SinusX</translation>
+    </message>
     <message>
       <source>MEN_LOAD_VISUAL_STATE</source>
       <translation>Load visual state</translation>
@@ -1255,6 +1311,14 @@ Would you like to remove all references from the image?</translation>
       <source>MEN_SPLIT_IMAGE</source>
       <translation>Split image</translation>
     </message>
+    <message>
+      <source>MEN_SPLIT_POLYLINES</source>
+      <translation>Split polylines</translation>
+    </message>
+    <message>
+      <source>MEN_MERGE_POLYLINES</source>
+      <translation>Merge polylines</translation>
+    </message>
     <message>
       <source>MEN_UNDO</source>
       <translation>Undo</translation>
@@ -1308,8 +1372,8 @@ Would you like to remove all references from the image?</translation>
       <translation>Submersible</translation>
     </message>
     <message>
-      <source>MEN_EXPORT_POLYLINE</source>
-      <translation>Export Polyline</translation>
+      <source>MEN_EXPORT_TO_SHAPE_FILE</source>
+      <translation>Export to Shape file</translation>
     </message>
     <message>
       <source>MEN_POLYLINE_EXTRACTION</source>
@@ -1338,7 +1402,7 @@ Would you like to remove all references from the image?</translation>
     </message>
     <message>
       <source>STB_GEOREFERENCEMENT</source>
-      <translation>Profile(s) georeferencement</translation>
+      <translation>Profiles georeferencement</translation>
     </message>
     <message>
       <source>STB_CREATE_IMMERSIBLE_ZONE</source>
@@ -1480,6 +1544,18 @@ Would you like to remove all references from the image?</translation>
       <source>STB_IMPORT_POLYLINE</source>
       <translation>Import polyline</translation>
     </message>
+    <message>
+      <source>STB_IMPORT_LANDCOVER</source>
+      <translation>Import land cover from file(s)</translation>
+    </message>
+    <message>
+      <source>STB_IMPORT_SINUSX</source>
+      <translation>Import from SinusX</translation>
+    </message>
+    <message>
+      <source>STB_EXPORT_SINUSX</source>
+      <translation>Export to SinusX</translation>
+    </message>
     <message>
       <source>STB_LOAD_VISUAL_STATE</source>
       <translation>Load visual state</translation>
@@ -1520,6 +1596,14 @@ Would you like to remove all references from the image?</translation>
       <source>STB_SPLIT_IMAGE</source>
       <translation>Split image</translation>
     </message>
+    <message>
+      <source>STB_SPLIT_POLYLINES</source>
+      <translation>Split polylines</translation>
+    </message>
+    <message>
+      <source>STB_MERGE_POLYLINES</source>
+      <translation>Merge polylines</translation>
+    </message>
     <message>
       <source>STB_UNDO</source>
       <translation>Undo</translation>
@@ -1590,8 +1674,8 @@ Would you like to remove all references from the image?</translation>
       <translation>If the object is submersible</translation>
     </message>
     <message>
-      <source>STB_EXPORT_POLYLINE</source>
-      <translation>Export Polyline</translation>
+      <source>STB_EXPORT_TO_SHAPE_FILE</source>
+      <translation>Export to Shape file</translation>
     </message>
 
 
@@ -1608,6 +1692,45 @@ Would you like to remove all references from the image?</translation>
       <translation>Creates the new stream profiles using interpolation of selected ones</translation>
     </message>
 
+    <message>
+      <source>MEN_RECOGNIZE_CONTOURS</source>
+      <translation>Recognize contours</translation>
+    </message>
+    <message>
+      <source>DSK_RECOGNIZE_CONTOURS</source>
+      <translation>Recognize contours</translation>
+    </message>
+    <message>
+      <source>STB_RECOGNIZE_CONTOURS</source>
+      <translation>Recognize contours</translation>
+    </message>
+
+    <message>
+      <source>MEN_LC_SCALARMAP_COLORING_ON</source>
+      <translation>Use as scalar scale</translation>
+    </message>
+    <message>
+      <source>DSK_LC_SCALARMAP_COLORING_ON</source>
+      <translation>Use the table as a scalar scale for Land Covers coloring</translation>
+    </message>
+    <message>
+      <source>STB_LC_SCALARMAP_COLORING_ON</source>
+      <translation>Use as scalar scale</translation>
+    </message>
+
+    <message>
+      <source>MEN_LC_SCALARMAP_COLORING_OFF</source>
+      <translation>Scalar map mode off</translation>
+    </message>
+    <message>
+      <source>DSK_LC_SCALARMAP_COLORING_OFF</source>
+      <translation>Turn off Land Covers scalar map coloring mode</translation>
+    </message>
+    <message>
+      <source>STB_LC_SCALARMAP_COLORING_OFF</source>
+      <translation>Scalar map mode off</translation>
+    </message>
+
   </context>
   
   <context>
@@ -2099,7 +2222,7 @@ file cannot be correctly imported for an Obstacle definition.</translation>
     </message>
     <message>
       <source>POLYLINE_FILTER</source>
-      <translation>SinusX Files (*.sx);;Shape files (*.shp)</translation>
+      <translation>Shape files (*.shp)</translation>
     </message>
     <message>
       <source>BAD_IMPORTED_POLYLINE_FILES_TLT</source>
@@ -2118,7 +2241,118 @@ file cannot be correctly imported for an Obstacle definition.</translation>
 
   </context>
 
-   
+ <context>
+    <name>HYDROGUI_ImportLandCoverDlg</name>
+    <message>
+      <source>LANDCOVER_FILTER</source>
+      <translation>Shape files (*.shp)</translation>
+    </message>
+    <message>
+      <source>IMPORT_LANDCOVER_FROM_FILE</source>
+      <translation>Import land cover from file</translation>
+    </message>
+    <message>
+      <source>FILE_NAME</source>
+      <translation>File name</translation>
+    </message>
+    <message>
+      <source>LANDCOVER_NAME</source>
+      <translation>Land cover name</translation>
+    </message>
+    <message>
+      <source>NAME</source>
+      <translation>name:</translation>
+    </message>
+    <message>
+      <source>FOUNDED_POLYGONS</source>
+      <translation>Founded polygons:</translation>
+    </message>
+    <message>
+      <source>BAD_IMPORTED_LANDCOVER_FILES</source>
+      <translation>Land cover import error</translation>
+    </message>
+    <message>
+      <source>NO_ONE_LANDCOVER_IMPORTED</source>
+      <translation>Land cover cannot be read from seleted file</translation>
+    </message>
+  </context>
+
+  <context>
+    <name>HYDROGUI_ImportLandCoverOp</name>
+    <message>
+      <source>IMPORT_LANDCOVER</source>
+      <translation>Import land cover</translation>
+    </message>
+    <message>
+      <source>DEFAULT_LANDCOVER_NAME</source>
+      <translation>Landcover_0</translation>
+    </message>
+  </context>
+  <context>
+    <name>HYDROGUI_ImportSinusXOp</name>
+    <message>
+      <source>IMPORT_SINUSX</source>
+      <translation>Import from SinusX</translation>
+    </message>
+    <message>
+      <source>SINUSX_FILTER</source>
+      <translation>SinusX Files (*.sx)</translation>
+    </message>
+    <message>
+      <source>NO_ONE_ENTITY_IMPORTED</source>
+      <translation>Entities cant be read</translation>
+    </message>
+  </context>
+
+  <context>
+    <name>HYDROGUI_ExportSinusXOp</name>
+    <message>
+      <source>EXPORT_SINUSX</source>
+      <translation>Export to SinusX</translation>
+    </message>
+    <message>
+      <source>SINUSX_FILTER</source>
+      <translation>SinusX Files (*.sx)</translation>
+    </message>
+    <message>
+      <source>NO_ENTITIES_TO_EXPORT</source>
+      <translation>No entities to export</translation>
+    </message>
+  </context>
+
+  <context>
+    <name>HYDROGUI_ExportSinusXDlg</name>
+    <message>
+      <source>OBJECTS_TO_EXPORT</source>
+      <translation>Objects:</translation>
+    </message>
+    <message>
+      <source>EXPORT</source>
+      <translation>Export</translation>
+    </message>
+  </context>
+
+  <context>
+    <name>HYDROGUI_ExportFileOp</name>
+    <message>
+      <source>EXPORT_TO_SHAPE_FILE</source>
+      <translation>Export to Shape file</translation>
+    </message>
+    <message>
+      <source>SHP_FILTER</source>
+      <translation>Shape Files (*.shp)</translation>
+    </message>
+    <message>
+      <source>CANNOT_BE_EXPORTED</source>
+      <translation>The next entities cannot be exported:</translation>
+    </message>
+    <message>
+      <source>ERROR_POLYLINES_OF_DIFF_KIND</source>
+      <translation>Cannot export polylines of different kind</translation>
+    </message>
+  </context>
+  
   <context>
     <name>HYDROGUI_GeoreferencementDlg</name>
     <message>
@@ -2278,7 +2512,7 @@ file cannot be correctly imported for an Obstacle definition.</translation>
     </message>
     <message>
       <source>AXIS_NOT_DEFINED</source>
-      <translation>Hydraulic axis is not defiled.</translation>
+      <translation>Hydraulic axis is not defined.</translation>
     </message>
     <message>
       <source>PROFILES_NOT_DEFINED</source>
@@ -2507,6 +2741,14 @@ Polyline should consist from one not closed curve.</translation>
       <source>CONFIRM_LAND_COVER_RECALCULATION</source>
       <translation>Land cover object already exists and will be recalculated after polylines list modification. Do you confirm the recalculation?</translation>
     </message>
+    <message>
+      <source>POLYLINES_NOT_DEFINED</source>
+      <translation>At least 1 polyline should be defined.</translation>
+    </message>
+    <message>
+      <source>LAND_COVER_OBJECT_CANNOT_BE_CREATED</source>
+      <translation>Land Cover object can not be created</translation>
+    </message>
   </context>
 
   <context>
@@ -2737,6 +2979,121 @@ Polyline should consist from one not closed curve.</translation>
       <translation>Can't obtain stream oject \"%1\"</translation>
     </message>
   </context>
+  
+  <context>
+    <name>HYDROGUI_RecognizeContoursDlg</name>
+    <message>
+      <source>NAME</source>
+      <translation>Name</translation>
+    </message>
+    <message>
+      <source>ORIGINAL_IMAGE</source>
+      <translation>Original image</translation>
+    </message>
+    <message>
+      <source>RECOGNIZED_POLYLINES</source>
+      <translation>Polylines</translation>
+    </message>
+  </context>
+
+  <context>
+    <name>HYDROGUI_RecognizeContoursOp</name>
+    <message>
+      <source>CONTOURS_RECOGNITION</source>
+      <translation>Contours recognition</translation>
+    </message>
+    <message>
+      <source>NO_DETECTED_CONTOURS</source>
+      <translation>No contours were detected.</translation>
+    </message>
+  </context>
+
+  <context>
+    <name>HYDROGUI_SplitPolylinesOp</name>
+    <message>
+      <source>SPLIT_POLYLINES</source>
+      <translation>Split polylines</translation>
+    </message>
+  </context>
+
+  <context>
+    <name>HYDROGUI_SplitPolylinesDlg</name>
+    <message>
+      <source>POLYLINES</source>
+      <translation>Polylines</translation>
+    </message>
+    <message>
+      <source>POINT</source>
+      <translation>Point</translation>
+    </message>
+    <message>
+      <source>POLYLINE</source>
+      <translation>Polyline</translation>
+    </message>
+    <message>
+      <source>TOOL_POLYLINE</source>
+      <translation>Tool polyline</translation>
+    </message>
+    <message>
+      <source>SPLIT_POLYLINES</source>
+      <translation>Split polylines</translation>
+    </message>
+    <message>
+      <source>BY_POINT</source>
+      <translation>By point</translation>
+    </message>
+    <message>
+      <source>BY_TOOL</source>
+      <translation>By tool</translation>
+    </message>
+    <message>
+      <source>COMPLETE_SPLIT</source>
+      <translation>Complete split</translation>
+    </message>
+    <message>
+      <source>RESULT_NAME</source>
+      <translation>Result name prefix:</translation>
+    </message>
+  </context>
+
+  <context>
+    <name>HYDROGUI_MergePolylinesDlg</name>
+    <message>
+      <source>POLYLINES</source>
+      <translation>Polylines</translation>
+    </message>
+    <message>
+      <source>MERGE_POLYLINES</source>
+      <translation>Merge polylines</translation>
+    </message>
+    <message>
+      <source>RESULT_NAME</source>
+      <translation>Result name:</translation>
+    </message>
+    <message>
+      <source>IS_CONNECT</source>
+      <translation>Connect by a new segment</translation>
+    </message>
+  </context>
+  <context>
+    <name>HYDROGUI_MergePolylinesOp</name>
+    <message>
+      <source>MERGE_POLYLINES</source>
+      <translation>Merge polylines</translation>
+    </message>
+  </context>
+
+  <context>
+    <name>HYDROGUI_ObjListBox</name>
+    <message>
+      <source>INCLUDE</source>
+      <translation>Include</translation>
+    </message>
+    <message>
+      <source>EXCLUDE</source>
+      <translation>Exclude</translation>
+    </message>
+  </context>
 
   <context>
     <name>HYDROGUI_PolylineExtractionOp</name>
diff --git a/src/HYDROGUI/resources/icon_export_polyline.png b/src/HYDROGUI/resources/icon_export_polyline.png
deleted file mode 100644 (file)
index 3e28616..0000000
Binary files a/src/HYDROGUI/resources/icon_export_polyline.png and /dev/null differ
diff --git a/src/HYDROGUI/resources/icon_export_shp.png b/src/HYDROGUI/resources/icon_export_shp.png
new file mode 100644 (file)
index 0000000..3e28616
Binary files /dev/null and b/src/HYDROGUI/resources/icon_export_shp.png differ
diff --git a/src/HYDROGUI/resources/icon_export_sx.png b/src/HYDROGUI/resources/icon_export_sx.png
new file mode 100644 (file)
index 0000000..02641f4
Binary files /dev/null and b/src/HYDROGUI/resources/icon_export_sx.png differ
diff --git a/src/HYDROGUI/resources/icon_import_polygon.png b/src/HYDROGUI/resources/icon_import_polygon.png
new file mode 100644 (file)
index 0000000..8b3a2fa
Binary files /dev/null and b/src/HYDROGUI/resources/icon_import_polygon.png differ
diff --git a/src/HYDROGUI/resources/icon_import_sx.png b/src/HYDROGUI/resources/icon_import_sx.png
new file mode 100644 (file)
index 0000000..d5ebf66
Binary files /dev/null and b/src/HYDROGUI/resources/icon_import_sx.png differ
diff --git a/src/HYDROGUI/resources/icon_mland_cover.png b/src/HYDROGUI/resources/icon_mland_cover.png
new file mode 100644 (file)
index 0000000..9607f7c
Binary files /dev/null and b/src/HYDROGUI/resources/icon_mland_cover.png differ
diff --git a/src/HYDROGUI/resources/icon_recognize_contours.png b/src/HYDROGUI/resources/icon_recognize_contours.png
new file mode 100644 (file)
index 0000000..ea1e154
Binary files /dev/null and b/src/HYDROGUI/resources/icon_recognize_contours.png differ
index e6d32a8d4744e581d57c2a6a9abcd935f9aba6bf..34b906213fba2d0ee7a801e6e9ba5487cf10b5d1 100644 (file)
@@ -544,10 +544,14 @@ public:
   %End
 
   QString DumpRules();
+  QString DumpLandCoverRules();
 
   void SetAssignmentMode( AssignmentMode theMode );
   AssignmentMode GetAssignmentMode() const;
 
+  void SetAssignmentLandCoverMode( AssignmentMode theMode );
+  AssignmentMode GetAssignmentLandCoverMode() const;
+
 protected:
 
   /**