]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Merge branch 'master' into rnc/t_shape_plugin
authorPaul RASCLE <paul.rascle@edf.fr>
Thu, 7 Jan 2016 17:01:56 +0000 (18:01 +0100)
committerPaul RASCLE <paul.rascle@edf.fr>
Thu, 7 Jan 2016 17:01:56 +0000 (18:01 +0100)
1389 files changed:
CMakeLists.txt
GEOM_version.h.in
SalomeGEOMConfig.cmake.in
adm_local/CMakeLists.txt
adm_local/cmake_files/CMakeLists.txt
adm_local/cmake_files/FindGEOM.cmake
adm_local/cmake_files/FindSalomeGEOM.cmake
adm_local/cmake_files/FindSalomeOpenCV.cmake
adm_local/unix/CMakeLists.txt
adm_local/unix/config_files/CMakeLists.txt
adm_local/unix/config_files/check_GEOM.m4
adm_local/unix/config_files/check_GUI.m4
adm_local/unix/config_files/check_OpenCV.m4
bin/CMakeLists.txt
bin/addvars2notebook_GEOM.py
bin/geom_setenv.py
doc/CMakeLists.txt
doc/salome/CMakeLists.txt
doc/salome/examples/CMakeLists.txt
doc/salome/examples/CTestTestfileInstall.cmake [new file with mode: 0644]
doc/salome/examples/basic_geom_objs_ex10.py [new file with mode: 0644]
doc/salome/examples/basic_operations_ex01.py
doc/salome/examples/basic_operations_ex04.py [new file with mode: 0644]
doc/salome/examples/check_self_intersections.py
doc/salome/examples/check_self_intersections_fast.py [new file with mode: 0644]
doc/salome/examples/check_shape.py
doc/salome/examples/complex_objs_ex03.py
doc/salome/examples/complex_objs_ex05.py
doc/salome/examples/complex_objs_ex11.py [new file with mode: 0755]
doc/salome/examples/fast_intersection.py [new file with mode: 0644]
doc/salome/examples/repairing_operations_ex06.py
doc/salome/examples/repairing_operations_ex10.py
doc/salome/examples/testme.py
doc/salome/examples/topological_geom_objs_ex03.py
doc/salome/examples/topological_geom_objs_ex07.py [new file with mode: 0644]
doc/salome/examples/transformation_operations_ex07.py
doc/salome/examples/transformation_operations_ex14.py [new file with mode: 0644]
doc/salome/examples/viewing_geom_objs_ex01.py
doc/salome/gui/CMakeLists.txt
doc/salome/gui/GEOM/CMakeLists.txt
doc/salome/gui/GEOM/collect_geom_methods.py
doc/salome/gui/GEOM/doxyfile.in
doc/salome/gui/GEOM/doxyfile_py.in
doc/salome/gui/GEOM/doxyfile_tui.in
doc/salome/gui/GEOM/images/divedgebypoint.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/editgroup.png
doc/salome/gui/GEOM/images/extend_edge_example.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/extend_face_example.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/extension1.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/extension2.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/filling.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/flat_contents.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/gen_group_disabled.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/gen_group_dlg.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/gen_group_other.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/gen_group_sides.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/gen_group_tree.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/geomcreategroup.png
doc/salome/gui/GEOM/images/glue1.png
doc/salome/gui/GEOM/images/glue2.png
doc/salome/gui/GEOM/images/glue3.png
doc/salome/gui/GEOM/images/glue4.png
doc/salome/gui/GEOM/images/glue5.png
doc/salome/gui/GEOM/images/glue7.png
doc/salome/gui/GEOM/images/glue8.png
doc/salome/gui/GEOM/images/inspect_object.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/inspect_object2.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/measures10.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/measures11.png
doc/salome/gui/GEOM/images/measures12.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/measures13.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/measures2.png
doc/salome/gui/GEOM/images/measures2a.png
doc/salome/gui/GEOM/images/name_mode.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/neo-detect2.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/neo-obj1.png
doc/salome/gui/GEOM/images/neo-obj4.png
doc/salome/gui/GEOM/images/neo-obj4_2.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/neo-obj4_3.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/neo-obj6.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/neo-obj6_2.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/neo-section.png
doc/salome/gui/GEOM/images/partition1.png
doc/salome/gui/GEOM/images/pipe.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/pipe2.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/pipe3.png
doc/salome/gui/GEOM/images/point3.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/point4.png
doc/salome/gui/GEOM/images/pref15.png
doc/salome/gui/GEOM/images/proj_on_cyl_angles.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/proj_on_cyl_dlg.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/proj_on_cyl_preview.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/projection_dlg.png
doc/salome/gui/GEOM/images/projection_dlg1.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/projection_dlg2.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/remove_webs.png
doc/salome/gui/GEOM/images/repair1.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/repair10.png
doc/salome/gui/GEOM/images/repair6.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/repair8.png [changed mode: 0755->0644]
doc/salome/gui/GEOM/images/shape_statistics.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/shape_statistics_simple.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/shared_shapes.png
doc/salome/gui/GEOM/images/surface_from_face1.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/surface_from_face_example.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/thickness.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/thickness_result.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/thicksolid.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/thicksolid_result.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/tolerances.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/transfer_data1.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/transfer_data2.png [new file with mode: 0644]
doc/salome/gui/GEOM/images/tree_example.png
doc/salome/gui/GEOM/input/add_point_on_edge_operation.doc
doc/salome/gui/GEOM/input/angle.doc
doc/salome/gui/GEOM/input/arranging_study_objects_page.doc
doc/salome/gui/GEOM/input/basic_prop.doc
doc/salome/gui/GEOM/input/bounding_box.doc
doc/salome/gui/GEOM/input/center_mass.doc
doc/salome/gui/GEOM/input/check_compound_of_blocks.doc
doc/salome/gui/GEOM/input/check_self_intersections.doc
doc/salome/gui/GEOM/input/creating_3dsketcher.doc
doc/salome/gui/GEOM/input/creating_basic_go.doc
doc/salome/gui/GEOM/input/creating_complex_obj.doc
doc/salome/gui/GEOM/input/creating_compound.doc
doc/salome/gui/GEOM/input/creating_cylinder.doc
doc/salome/gui/GEOM/input/creating_explode.doc
doc/salome/gui/GEOM/input/creating_extrusion_alongpath.doc
doc/salome/gui/GEOM/input/creating_face.doc
doc/salome/gui/GEOM/input/creating_filling.doc
doc/salome/gui/GEOM/input/creating_groups.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/creating_isoline.doc
doc/salome/gui/GEOM/input/creating_point.doc
doc/salome/gui/GEOM/input/creating_polyline.doc
doc/salome/gui/GEOM/input/creating_shell.doc
doc/salome/gui/GEOM/input/creating_smoothingsurface.doc
doc/salome/gui/GEOM/input/creating_solid.doc
doc/salome/gui/GEOM/input/creating_surface_from_face.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/creating_thickness_page.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/dependency_tree.doc
doc/salome/gui/GEOM/input/display_mode.doc
doc/salome/gui/GEOM/input/extension_operation.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/faq.doc
doc/salome/gui/GEOM/input/fast_intersection.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/free_faces.doc
doc/salome/gui/GEOM/input/geometry_preferences.doc
doc/salome/gui/GEOM/input/geompy.doc
doc/salome/gui/GEOM/input/get_non_blocks.doc
doc/salome/gui/GEOM/input/glue_edges_operation.doc
doc/salome/gui/GEOM/input/glue_faces_operation.doc
doc/salome/gui/GEOM/input/import_export.doc
doc/salome/gui/GEOM/input/inertia.doc
doc/salome/gui/GEOM/input/inspect_object_operation.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/managing_dimensions.doc
doc/salome/gui/GEOM/input/min_distance.doc
doc/salome/gui/GEOM/input/partition.doc
doc/salome/gui/GEOM/input/projection_on_cylinder_operation.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/projection_operation.doc
doc/salome/gui/GEOM/input/reduce_study.doc
doc/salome/gui/GEOM/input/remove_webs_operation.doc
doc/salome/gui/GEOM/input/repairing_operations.doc
doc/salome/gui/GEOM/input/section_operation.doc
doc/salome/gui/GEOM/input/sewing_operation.doc
doc/salome/gui/GEOM/input/shape_processing_operation.doc
doc/salome/gui/GEOM/input/shape_statistics_operation.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/shared_shapes.doc
doc/salome/gui/GEOM/input/size_models_range.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/tolerance.doc
doc/salome/gui/GEOM/input/transfer_data.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/transformation_operations.doc
doc/salome/gui/GEOM/input/transforming_geom_objs.doc
doc/salome/gui/GEOM/input/tui_basic_geom_objs.doc
doc/salome/gui/GEOM/input/tui_basic_operations.doc
doc/salome/gui/GEOM/input/tui_boolean_operations.doc
doc/salome/gui/GEOM/input/tui_check_self_intersections_fast.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/tui_complex_objs.doc
doc/salome/gui/GEOM/input/tui_fast_intersection.doc [new file with mode: 0644]
doc/salome/gui/GEOM/input/tui_measurement_tools.doc
doc/salome/gui/GEOM/input/tui_polyline.doc [deleted file]
doc/salome/gui/GEOM/input/tui_test_all.doc
doc/salome/gui/GEOM/input/tui_test_measures.doc
doc/salome/gui/GEOM/input/tui_test_others.doc
doc/salome/gui/GEOM/input/tui_topological_geom_objs.doc
doc/salome/gui/GEOM/input/tui_transformation_operations.doc
doc/salome/gui/GEOM/input/using_boolean_operations.doc
doc/salome/gui/GEOM/input/using_measurement_tools.doc
doc/salome/gui/GEOM/input/viewing_geom_obj.doc
doc/salome/gui/GEOM/input/whatis.doc
doc/salome/gui/GEOM/input/working_with_groups.doc
doc/salome/gui/GEOM/static/footer.html
doc/salome/tui/CMakeLists.txt
doc/salome/tui/doxyfile.in
doc/salome/tui/static/footer.html
idl/AdvancedGEOM.idl
idl/BREPPlugin.idl
idl/CMakeLists.txt
idl/GEOM_Gen.idl
idl/GEOM_Superv.idl
idl/IGESPlugin.idl
idl/STEPPlugin.idl
idl/STLPlugin.idl
idl/VTKPlugin.idl
idl/XAOPlugin.idl
resources/AdvancedGEOM.xml
resources/BREPPlugin.xml
resources/CMakeLists.txt
resources/GEOMCatalog.xml.in
resources/GEOM_en.xml
resources/GEOM_fr.xml
resources/IGESPlugin.xml
resources/STEPPlugin.xml
resources/STLPlugin.xml
resources/SalomeApp.xml.in
resources/ShHealing
resources/VTKPlugin.xml
resources/XAOPlugin.xml
resources/Y14.5M-2009.ttf [new file with mode: 0644]
resources/build_face_constraints.png [new file with mode: 0644]
resources/build_face_surface.png [new file with mode: 0644]
resources/edgeextension.png [new file with mode: 0644]
resources/faceextension.png [new file with mode: 0644]
resources/facetosurface.png [new file with mode: 0644]
resources/fast_intersect.png [new file with mode: 0644]
resources/import.png [new file with mode: 0644]
resources/pointonedgebypoint.png [new file with mode: 0644]
resources/proj_on_cyl.png [new file with mode: 0644]
resources/projection_on_edge.png [new file with mode: 0644]
resources/projection_on_wire.png [new file with mode: 0644]
resources/solid_from_faces.png [new file with mode: 0644]
resources/thickness.png [new file with mode: 0644]
resources/thickness2.png [new file with mode: 0644]
resources/transfer_data.png [new file with mode: 0644]
src/ARCHIMEDE/Archimede_VolumeSection.cxx
src/ARCHIMEDE/Archimede_VolumeSection.hxx
src/ARCHIMEDE/CMakeLists.txt
src/AdvancedEngine/AdvancedEngine.cxx
src/AdvancedEngine/AdvancedEngine.hxx
src/AdvancedEngine/AdvancedEngine_DividedDiskDriver.cxx
src/AdvancedEngine/AdvancedEngine_DividedDiskDriver.hxx
src/AdvancedEngine/AdvancedEngine_IDividedDisk.hxx
src/AdvancedEngine/AdvancedEngine_IOperations.cxx
src/AdvancedEngine/AdvancedEngine_IOperations.hxx
src/AdvancedEngine/AdvancedEngine_IOperations_i.cc
src/AdvancedEngine/AdvancedEngine_IOperations_i.hh
src/AdvancedEngine/AdvancedEngine_IPipeTShape.hxx
src/AdvancedEngine/AdvancedEngine_ISmoothingSurface.hxx
src/AdvancedEngine/AdvancedEngine_OperationsCreator.cxx
src/AdvancedEngine/AdvancedEngine_OperationsCreator.hxx
src/AdvancedEngine/AdvancedEngine_PipeTShapeDriver.cxx
src/AdvancedEngine/AdvancedEngine_PipeTShapeDriver.hxx
src/AdvancedEngine/AdvancedEngine_SmoothingSurfaceDriver.cxx
src/AdvancedEngine/AdvancedEngine_SmoothingSurfaceDriver.hxx
src/AdvancedEngine/AdvancedEngine_Types.hxx
src/AdvancedEngine/CMakeLists.txt
src/AdvancedGUI/AdvancedGEOM_msg_ja.ts
src/AdvancedGUI/AdvancedGUI.cxx
src/AdvancedGUI/AdvancedGUI.h
src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.cxx
src/AdvancedGUI/AdvancedGUI_DividedCylinderDlg.h
src/AdvancedGUI/AdvancedGUI_DividedDiskDlg.cxx
src/AdvancedGUI/AdvancedGUI_DividedDiskDlg.h
src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.cxx
src/AdvancedGUI/AdvancedGUI_PipeTShapeDlg.h
src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.cxx
src/AdvancedGUI/AdvancedGUI_SmoothingSurfaceDlg.h
src/AdvancedGUI/CMakeLists.txt
src/BREPPlugin/BREPPlugin_Engine.cxx
src/BREPPlugin/BREPPlugin_Engine.hxx
src/BREPPlugin/BREPPlugin_ExportDriver.cxx
src/BREPPlugin/BREPPlugin_ExportDriver.hxx
src/BREPPlugin/BREPPlugin_GUI.cxx
src/BREPPlugin/BREPPlugin_GUI.h
src/BREPPlugin/BREPPlugin_IECallBack.cxx
src/BREPPlugin/BREPPlugin_IECallBack.hxx
src/BREPPlugin/BREPPlugin_IExport.hxx
src/BREPPlugin/BREPPlugin_IImport.hxx
src/BREPPlugin/BREPPlugin_IOperations.cxx
src/BREPPlugin/BREPPlugin_IOperations.hxx
src/BREPPlugin/BREPPlugin_IOperations_i.cc
src/BREPPlugin/BREPPlugin_IOperations_i.hh
src/BREPPlugin/BREPPlugin_ImportDriver.cxx
src/BREPPlugin/BREPPlugin_ImportDriver.hxx
src/BREPPlugin/BREPPlugin_OperationsCreator.cxx
src/BREPPlugin/BREPPlugin_OperationsCreator.hxx
src/BREPPlugin/BREPPlugin_msg_ja.ts
src/BREPPlugin/CMakeLists.txt
src/BasicGUI/BasicGUI.cxx
src/BasicGUI/BasicGUI.h
src/BasicGUI/BasicGUI_ArcDlg.cxx
src/BasicGUI/BasicGUI_ArcDlg.h
src/BasicGUI/BasicGUI_CircleDlg.cxx
src/BasicGUI/BasicGUI_CircleDlg.h
src/BasicGUI/BasicGUI_CurveDlg.cxx
src/BasicGUI/BasicGUI_CurveDlg.h
src/BasicGUI/BasicGUI_EllipseDlg.cxx
src/BasicGUI/BasicGUI_EllipseDlg.h
src/BasicGUI/BasicGUI_LineDlg.cxx
src/BasicGUI/BasicGUI_LineDlg.h
src/BasicGUI/BasicGUI_MarkerDlg.cxx
src/BasicGUI/BasicGUI_MarkerDlg.h
src/BasicGUI/BasicGUI_ParamCurveWidget.cxx
src/BasicGUI/BasicGUI_ParamCurveWidget.h
src/BasicGUI/BasicGUI_PlaneDlg.cxx
src/BasicGUI/BasicGUI_PlaneDlg.h
src/BasicGUI/BasicGUI_PointDlg.cxx
src/BasicGUI/BasicGUI_PointDlg.h
src/BasicGUI/BasicGUI_VectorDlg.cxx
src/BasicGUI/BasicGUI_VectorDlg.h
src/BasicGUI/BasicGUI_WorkingPlaneDlg.cxx
src/BasicGUI/BasicGUI_WorkingPlaneDlg.h
src/BasicGUI/CMakeLists.txt
src/BlockFix/BlockFix.cxx
src/BlockFix/BlockFix.hxx
src/BlockFix/BlockFix_BlockFixAPI.cxx
src/BlockFix/BlockFix_BlockFixAPI.hxx
src/BlockFix/BlockFix_CheckTool.cxx
src/BlockFix/BlockFix_CheckTool.hxx
src/BlockFix/BlockFix_PeriodicSurfaceModifier.cxx
src/BlockFix/BlockFix_PeriodicSurfaceModifier.hxx
src/BlockFix/BlockFix_SphereSpaceModifier.cxx
src/BlockFix/BlockFix_SphereSpaceModifier.hxx
src/BlockFix/BlockFix_UnionEdges.cxx
src/BlockFix/BlockFix_UnionEdges.hxx
src/BlockFix/BlockFix_UnionFaces.cxx
src/BlockFix/BlockFix_UnionFaces.hxx
src/BlockFix/CMakeLists.txt
src/BlocksGUI/BlocksGUI.cxx
src/BlocksGUI/BlocksGUI.h
src/BlocksGUI/BlocksGUI_BlockDlg.cxx
src/BlocksGUI/BlocksGUI_BlockDlg.h
src/BlocksGUI/BlocksGUI_ExplodeDlg.cxx
src/BlocksGUI/BlocksGUI_ExplodeDlg.h
src/BlocksGUI/BlocksGUI_PropagateDlg.cxx
src/BlocksGUI/BlocksGUI_PropagateDlg.h
src/BlocksGUI/BlocksGUI_QuadFaceDlg.cxx
src/BlocksGUI/BlocksGUI_QuadFaceDlg.h
src/BlocksGUI/BlocksGUI_TrsfDlg.cxx
src/BlocksGUI/BlocksGUI_TrsfDlg.h
src/BlocksGUI/CMakeLists.txt
src/BooleanGUI/BooleanGUI.cxx
src/BooleanGUI/BooleanGUI.h
src/BooleanGUI/BooleanGUI_Dialog.cxx
src/BooleanGUI/BooleanGUI_Dialog.h
src/BooleanGUI/CMakeLists.txt
src/BuildGUI/BuildGUI.cxx
src/BuildGUI/BuildGUI.h
src/BuildGUI/BuildGUI_CompoundDlg.cxx
src/BuildGUI/BuildGUI_CompoundDlg.h
src/BuildGUI/BuildGUI_EdgeDlg.cxx
src/BuildGUI/BuildGUI_EdgeDlg.h
src/BuildGUI/BuildGUI_FaceDlg.cxx
src/BuildGUI/BuildGUI_FaceDlg.h
src/BuildGUI/BuildGUI_ShellDlg.cxx
src/BuildGUI/BuildGUI_ShellDlg.h
src/BuildGUI/BuildGUI_SolidDlg.cxx
src/BuildGUI/BuildGUI_SolidDlg.h
src/BuildGUI/BuildGUI_WireDlg.cxx
src/BuildGUI/BuildGUI_WireDlg.h
src/BuildGUI/CMakeLists.txt
src/CMakeLists.txt
src/CurveCreator/CMakeLists.txt
src/CurveCreator/CurveCreator.hxx
src/CurveCreator/CurveCreator_Curve.cxx
src/CurveCreator/CurveCreator_Curve.hxx
src/CurveCreator/CurveCreator_Diff.cxx
src/CurveCreator/CurveCreator_Diff.hxx
src/CurveCreator/CurveCreator_Displayer.cxx
src/CurveCreator/CurveCreator_Displayer.hxx
src/CurveCreator/CurveCreator_ICurve.hxx
src/CurveCreator/CurveCreator_Macro.hxx
src/CurveCreator/CurveCreator_NewSectionDlg.cxx
src/CurveCreator/CurveCreator_NewSectionDlg.h
src/CurveCreator/CurveCreator_Operation.cxx
src/CurveCreator/CurveCreator_Operation.hxx
src/CurveCreator/CurveCreator_PosPoint.hxx
src/CurveCreator/CurveCreator_Section.cxx [new file with mode: 0644]
src/CurveCreator/CurveCreator_Section.hxx
src/CurveCreator/CurveCreator_TableView.cxx
src/CurveCreator/CurveCreator_TableView.h
src/CurveCreator/CurveCreator_TreeView.cxx
src/CurveCreator/CurveCreator_TreeView.h
src/CurveCreator/CurveCreator_Utils.cxx
src/CurveCreator/CurveCreator_Utils.hxx
src/CurveCreator/CurveCreator_UtilsICurve.cxx
src/CurveCreator/CurveCreator_UtilsICurve.hxx
src/CurveCreator/CurveCreator_Widget.cxx
src/CurveCreator/CurveCreator_Widget.h
src/DependencyTree/CMakeLists.txt
src/DependencyTree/DependencyTree.h
src/DependencyTree/DependencyTree_Arrow.cxx
src/DependencyTree/DependencyTree_Arrow.h
src/DependencyTree/DependencyTree_Object.cxx
src/DependencyTree/DependencyTree_Object.h
src/DependencyTree/DependencyTree_Selector.cxx
src/DependencyTree/DependencyTree_Selector.h
src/DependencyTree/DependencyTree_View.cxx
src/DependencyTree/DependencyTree_View.h
src/DependencyTree/DependencyTree_ViewModel.cxx
src/DependencyTree/DependencyTree_ViewModel.h
src/DependencyTree/resources/DependencyTree_msg_fr.ts
src/DependencyTree/resources/DependencyTree_msg_ja.ts
src/DisplayGUI/CMakeLists.txt
src/DisplayGUI/DisplayGUI.cxx
src/DisplayGUI/DisplayGUI.h
src/DlgRef/CMakeLists.txt
src/DlgRef/DlgRef.cxx
src/DlgRef/DlgRef.h
src/EntityGUI/CMakeLists.txt
src/EntityGUI/EntityGUI.cxx
src/EntityGUI/EntityGUI.h
src/EntityGUI/EntityGUI_3DSketcherDlg.cxx
src/EntityGUI/EntityGUI_3DSketcherDlg.h
src/EntityGUI/EntityGUI_FeatureDetectorDlg.cxx
src/EntityGUI/EntityGUI_FeatureDetectorDlg.h
src/EntityGUI/EntityGUI_FieldDlg.cxx
src/EntityGUI/EntityGUI_FieldDlg.h
src/EntityGUI/EntityGUI_IsolineDlg.cxx
src/EntityGUI/EntityGUI_IsolineDlg.h
src/EntityGUI/EntityGUI_PictureImportDlg.cxx
src/EntityGUI/EntityGUI_PictureImportDlg.h
src/EntityGUI/EntityGUI_PolylineDlg.cxx
src/EntityGUI/EntityGUI_PolylineDlg.h
src/EntityGUI/EntityGUI_SketcherDlg.cxx
src/EntityGUI/EntityGUI_SketcherDlg.h
src/EntityGUI/EntityGUI_SubShapeDlg.cxx
src/EntityGUI/EntityGUI_SubShapeDlg.h
src/EntityGUI/EntityGUI_SurfFromFaceDlg.cxx [new file with mode: 0644]
src/EntityGUI/EntityGUI_SurfFromFaceDlg.h [new file with mode: 0644]
src/EntityGUI/EntityGUI_Widgets.cxx
src/EntityGUI/EntityGUI_Widgets.h
src/GEOM/CMakeLists.txt
src/GEOM/GEOM_Application.cxx
src/GEOM/GEOM_Application.hxx
src/GEOM/GEOM_BaseDriver.cxx
src/GEOM/GEOM_BaseDriver.hxx
src/GEOM/GEOM_BaseObject.cxx
src/GEOM/GEOM_BaseObject.hxx
src/GEOM/GEOM_DataMapOfAsciiStringTransient.hxx
src/GEOM/GEOM_Engine.cxx
src/GEOM/GEOM_Engine.hxx
src/GEOM/GEOM_Field.cxx
src/GEOM/GEOM_Field.hxx
src/GEOM/GEOM_Function.cxx
src/GEOM/GEOM_Function.hxx
src/GEOM/GEOM_IField.hxx
src/GEOM/GEOM_IOperations.cxx
src/GEOM/GEOM_IOperations.hxx
src/GEOM/GEOM_ISubShape.hxx
src/GEOM/GEOM_Object.cxx
src/GEOM/GEOM_Object.hxx
src/GEOM/GEOM_PythonDump.cxx
src/GEOM/GEOM_PythonDump.hxx
src/GEOM/GEOM_Solver.cxx
src/GEOM/GEOM_Solver.hxx
src/GEOM/GEOM_SubShapeDriver.cxx
src/GEOM/GEOM_SubShapeDriver.hxx
src/GEOMAlgo/CMakeLists.txt
src/GEOMAlgo/FILES
src/GEOMAlgo/GEOMAlgo.cdl [changed mode: 0755->0644]
src/GEOMAlgo/GEOMAlgo_Algo.cxx
src/GEOMAlgo/GEOMAlgo_Algo.hxx
src/GEOMAlgo/GEOMAlgo_AlgoTools.cxx [changed mode: 0755->0644]
src/GEOMAlgo/GEOMAlgo_AlgoTools.hxx
src/GEOMAlgo/GEOMAlgo_AlgoTools_1.cxx
src/GEOMAlgo/GEOMAlgo_BndSphere.cxx
src/GEOMAlgo/GEOMAlgo_BndSphere.hxx
src/GEOMAlgo/GEOMAlgo_BndSphere.lxx
src/GEOMAlgo/GEOMAlgo_BndSphereTree.cxx
src/GEOMAlgo/GEOMAlgo_BndSphereTree.hxx
src/GEOMAlgo/GEOMAlgo_BoxBndTree.cxx
src/GEOMAlgo/GEOMAlgo_BoxBndTree.hxx
src/GEOMAlgo/GEOMAlgo_BuilderShape.cxx
src/GEOMAlgo/GEOMAlgo_BuilderShape.hxx
src/GEOMAlgo/GEOMAlgo_Clsf.cxx
src/GEOMAlgo/GEOMAlgo_Clsf.hxx
src/GEOMAlgo/GEOMAlgo_ClsfBox.cxx
src/GEOMAlgo/GEOMAlgo_ClsfBox.hxx
src/GEOMAlgo/GEOMAlgo_ClsfQuad.cxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfQuad.hxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_ClsfSolid.cxx
src/GEOMAlgo/GEOMAlgo_ClsfSolid.hxx
src/GEOMAlgo/GEOMAlgo_ClsfSurf.cxx
src/GEOMAlgo/GEOMAlgo_ClsfSurf.hxx
src/GEOMAlgo/GEOMAlgo_CoupleOfShapes.cxx
src/GEOMAlgo/GEOMAlgo_CoupleOfShapes.hxx
src/GEOMAlgo/GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx
src/GEOMAlgo/GEOMAlgo_DataMapOfPassKeyInteger.hxx
src/GEOMAlgo/GEOMAlgo_DataMapOfShapeMapOfShape.hxx
src/GEOMAlgo/GEOMAlgo_DataMapOfShapePnt.hxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn.cxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn.hxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.cxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn1.hxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.cxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOn2.hxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOnQuad.cxx
src/GEOMAlgo/GEOMAlgo_FinderShapeOnQuad.hxx
src/GEOMAlgo/GEOMAlgo_GetInPlace.cxx
src/GEOMAlgo/GEOMAlgo_GetInPlace.hxx
src/GEOMAlgo/GEOMAlgo_GetInPlaceAPI.cxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_GetInPlaceAPI.hxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_GetInPlace_1.cxx
src/GEOMAlgo/GEOMAlgo_GetInPlace_2.cxx
src/GEOMAlgo/GEOMAlgo_GetInPlace_3.cxx
src/GEOMAlgo/GEOMAlgo_GlueAnalyser.cxx
src/GEOMAlgo/GEOMAlgo_GlueAnalyser.hxx
src/GEOMAlgo/GEOMAlgo_GlueDetector.cxx
src/GEOMAlgo/GEOMAlgo_GlueDetector.hxx
src/GEOMAlgo/GEOMAlgo_Gluer.cxx [changed mode: 0755->0644]
src/GEOMAlgo/GEOMAlgo_Gluer.hxx
src/GEOMAlgo/GEOMAlgo_Gluer2.cxx
src/GEOMAlgo/GEOMAlgo_Gluer2.hxx
src/GEOMAlgo/GEOMAlgo_Gluer2_1.cxx
src/GEOMAlgo/GEOMAlgo_Gluer2_2.cxx
src/GEOMAlgo/GEOMAlgo_Gluer2_3.cxx
src/GEOMAlgo/GEOMAlgo_GluerAlgo.cxx
src/GEOMAlgo/GEOMAlgo_GluerAlgo.hxx
src/GEOMAlgo/GEOMAlgo_HAlgo.cxx
src/GEOMAlgo/GEOMAlgo_HAlgo.hxx
src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfIntegerShape.hxx
src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfPassKeyShapeListOfShape.hxx
src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeBndSphere.hxx
src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeBox.hxx
src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeIndexedMapOfShape.hxx
src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx
src/GEOMAlgo/GEOMAlgo_IndexedDataMapOfShapeState.hxx
src/GEOMAlgo/GEOMAlgo_KindOfBounds.hxx
src/GEOMAlgo/GEOMAlgo_KindOfClosed.hxx
src/GEOMAlgo/GEOMAlgo_KindOfDef.hxx [new file with mode: 0644]
src/GEOMAlgo/GEOMAlgo_KindOfName.hxx
src/GEOMAlgo/GEOMAlgo_KindOfShape.hxx
src/GEOMAlgo/GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx
src/GEOMAlgo/GEOMAlgo_ListIteratorOfListOfPnt.hxx
src/GEOMAlgo/GEOMAlgo_ListOfCoupleOfShapes.hxx
src/GEOMAlgo/GEOMAlgo_ListOfPnt.hxx
src/GEOMAlgo/GEOMAlgo_PassKey.cxx
src/GEOMAlgo/GEOMAlgo_PassKey.hxx
src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.cxx
src/GEOMAlgo/GEOMAlgo_PassKeyMapHasher.hxx
src/GEOMAlgo/GEOMAlgo_PassKeyShape.cxx
src/GEOMAlgo/GEOMAlgo_PassKeyShape.hxx
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.cxx
src/GEOMAlgo/GEOMAlgo_PassKeyShapeMapHasher.hxx
src/GEOMAlgo/GEOMAlgo_RemoverWebs.cxx
src/GEOMAlgo/GEOMAlgo_RemoverWebs.hxx
src/GEOMAlgo/GEOMAlgo_ShapeAlgo.cxx
src/GEOMAlgo/GEOMAlgo_ShapeAlgo.hxx
src/GEOMAlgo/GEOMAlgo_ShapeInfo.cxx
src/GEOMAlgo/GEOMAlgo_ShapeInfo.hxx
src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.cxx
src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller.hxx
src/GEOMAlgo/GEOMAlgo_ShapeInfoFiller_1.cxx [changed mode: 0644->0755]
src/GEOMAlgo/GEOMAlgo_ShapeSolid.cxx
src/GEOMAlgo/GEOMAlgo_ShapeSolid.hxx
src/GEOMAlgo/GEOMAlgo_ShellSolid.cxx
src/GEOMAlgo/GEOMAlgo_ShellSolid.hxx
src/GEOMAlgo/GEOMAlgo_SolidSolid.cxx
src/GEOMAlgo/GEOMAlgo_SolidSolid.hxx
src/GEOMAlgo/GEOMAlgo_Splitter.cxx [changed mode: 0755->0644]
src/GEOMAlgo/GEOMAlgo_Splitter.hxx
src/GEOMAlgo/GEOMAlgo_State.hxx
src/GEOMAlgo/GEOMAlgo_StateCollector.cxx
src/GEOMAlgo/GEOMAlgo_StateCollector.hxx
src/GEOMAlgo/GEOMAlgo_SurfaceTools.cxx
src/GEOMAlgo/GEOMAlgo_SurfaceTools.hxx
src/GEOMAlgo/GEOMAlgo_VertexSolid.cxx
src/GEOMAlgo/GEOMAlgo_VertexSolid.hxx
src/GEOMAlgo/GEOMAlgo_WireSolid.cxx
src/GEOMAlgo/GEOMAlgo_WireSolid.hxx
src/GEOMBase/CMakeLists.txt
src/GEOMBase/GEOMBase.cxx
src/GEOMBase/GEOMBase.h
src/GEOMBase/GEOMBase_DlgSkeleton.cxx
src/GEOMBase/GEOMBase_DlgSkeleton.h
src/GEOMBase/GEOMBase_Helper.cxx
src/GEOMBase/GEOMBase_Helper.h
src/GEOMBase/GEOMBase_Skeleton.cxx
src/GEOMBase/GEOMBase_Skeleton.h
src/GEOMBase/GEOM_GEOMBase.hxx
src/GEOMBase/GEOM_GenericObjPtr.cxx
src/GEOMBase/GEOM_GenericObjPtr.h
src/GEOMBase/GEOM_Operation.cxx
src/GEOMBase/GEOM_Operation.h
src/GEOMClient/CMakeLists.txt
src/GEOMClient/GEOM_Client.cxx
src/GEOMClient/GEOM_Client.hxx
src/GEOMFiltersSelection/CMakeLists.txt
src/GEOMFiltersSelection/GEOM_CompoundFilter.cxx
src/GEOMFiltersSelection/GEOM_CompoundFilter.h
src/GEOMFiltersSelection/GEOM_EdgeFilter.cxx
src/GEOMFiltersSelection/GEOM_EdgeFilter.h
src/GEOMFiltersSelection/GEOM_FaceFilter.cxx
src/GEOMFiltersSelection/GEOM_FaceFilter.h
src/GEOMFiltersSelection/GEOM_LogicalFilter.cxx
src/GEOMFiltersSelection/GEOM_LogicalFilter.h
src/GEOMFiltersSelection/GEOM_OCCFilter.cxx
src/GEOMFiltersSelection/GEOM_OCCFilter.h
src/GEOMFiltersSelection/GEOM_PreviewFilter.cxx
src/GEOMFiltersSelection/GEOM_PreviewFilter.h
src/GEOMFiltersSelection/GEOM_SelectionFilter.cxx
src/GEOMFiltersSelection/GEOM_SelectionFilter.h
src/GEOMFiltersSelection/GEOM_TypeFilter.cxx
src/GEOMFiltersSelection/GEOM_TypeFilter.h
src/GEOMGUI/CMakeLists.txt
src/GEOMGUI/GEOMGUI.cxx
src/GEOMGUI/GEOMGUI.h
src/GEOMGUI/GEOMGUI_CreationInfoWdg.cxx
src/GEOMGUI/GEOMGUI_CreationInfoWdg.h
src/GEOMGUI/GEOMGUI_DimensionProperty.cxx
src/GEOMGUI/GEOMGUI_DimensionProperty.h
src/GEOMGUI/GEOMGUI_OCCSelector.cxx
src/GEOMGUI/GEOMGUI_OCCSelector.h
src/GEOMGUI/GEOMGUI_Selection.cxx
src/GEOMGUI/GEOMGUI_Selection.h
src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx [new file with mode: 0644]
src/GEOMGUI/GEOMGUI_TextTreeWdg.h [new file with mode: 0644]
src/GEOMGUI/GEOMPluginGUI.cxx
src/GEOMGUI/GEOMPluginGUI.h
src/GEOMGUI/GEOM_Displayer.cxx
src/GEOMGUI/GEOM_Displayer.h
src/GEOMGUI/GEOM_GEOMGUI.hxx
src/GEOMGUI/GEOM_images.ts
src/GEOMGUI/GEOM_msg_en.ts
src/GEOMGUI/GEOM_msg_fr.ts
src/GEOMGUI/GEOM_msg_ja.ts
src/GEOMGUI/GeometryGUI.cxx
src/GEOMGUI/GeometryGUI.h
src/GEOMGUI/GeometryGUI_Operations.h
src/GEOMImpl/CMakeLists.txt
src/GEOMImpl/GEOMImpl_3DSketcherDriver.cxx
src/GEOMImpl/GEOMImpl_3DSketcherDriver.hxx
src/GEOMImpl/GEOMImpl_ArcDriver.cxx
src/GEOMImpl/GEOMImpl_ArcDriver.hxx
src/GEOMImpl/GEOMImpl_ArchimedeDriver.cxx
src/GEOMImpl/GEOMImpl_ArchimedeDriver.hxx
src/GEOMImpl/GEOMImpl_Block6Explorer.cxx
src/GEOMImpl/GEOMImpl_Block6Explorer.hxx
src/GEOMImpl/GEOMImpl_BlockDriver.cxx
src/GEOMImpl/GEOMImpl_BlockDriver.hxx
src/GEOMImpl/GEOMImpl_BooleanDriver.cxx
src/GEOMImpl/GEOMImpl_BooleanDriver.hxx
src/GEOMImpl/GEOMImpl_BoxDriver.cxx
src/GEOMImpl/GEOMImpl_BoxDriver.hxx
src/GEOMImpl/GEOMImpl_ChamferDriver.cxx
src/GEOMImpl/GEOMImpl_ChamferDriver.hxx
src/GEOMImpl/GEOMImpl_CircleDriver.cxx
src/GEOMImpl/GEOMImpl_CircleDriver.hxx
src/GEOMImpl/GEOMImpl_ConeDriver.cxx
src/GEOMImpl/GEOMImpl_ConeDriver.hxx
src/GEOMImpl/GEOMImpl_CopyDriver.cxx
src/GEOMImpl/GEOMImpl_CopyDriver.hxx
src/GEOMImpl/GEOMImpl_CylinderDriver.cxx
src/GEOMImpl/GEOMImpl_CylinderDriver.hxx
src/GEOMImpl/GEOMImpl_DiskDriver.cxx [changed mode: 0755->0644]
src/GEOMImpl/GEOMImpl_DiskDriver.hxx
src/GEOMImpl/GEOMImpl_EllipseDriver.cxx
src/GEOMImpl/GEOMImpl_EllipseDriver.hxx
src/GEOMImpl/GEOMImpl_ExportDriver.cxx
src/GEOMImpl/GEOMImpl_ExportDriver.hxx
src/GEOMImpl/GEOMImpl_FaceDriver.cxx
src/GEOMImpl/GEOMImpl_FaceDriver.hxx
src/GEOMImpl/GEOMImpl_FieldDriver.cxx
src/GEOMImpl/GEOMImpl_FieldDriver.hxx
src/GEOMImpl/GEOMImpl_Fillet1d.cxx
src/GEOMImpl/GEOMImpl_Fillet1d.hxx
src/GEOMImpl/GEOMImpl_Fillet1dDriver.cxx
src/GEOMImpl/GEOMImpl_Fillet1dDriver.hxx
src/GEOMImpl/GEOMImpl_Fillet2dDriver.cxx
src/GEOMImpl/GEOMImpl_Fillet2dDriver.hxx
src/GEOMImpl/GEOMImpl_FilletDriver.cxx
src/GEOMImpl/GEOMImpl_FilletDriver.hxx
src/GEOMImpl/GEOMImpl_FillingDriver.cxx
src/GEOMImpl/GEOMImpl_FillingDriver.hxx
src/GEOMImpl/GEOMImpl_Gen.cxx
src/GEOMImpl/GEOMImpl_Gen.hxx
src/GEOMImpl/GEOMImpl_GlueDriver.cxx
src/GEOMImpl/GEOMImpl_GlueDriver.hxx
src/GEOMImpl/GEOMImpl_HealingDriver.cxx
src/GEOMImpl/GEOMImpl_HealingDriver.hxx
src/GEOMImpl/GEOMImpl_I3DPrimOperations.cxx
src/GEOMImpl/GEOMImpl_I3DPrimOperations.hxx
src/GEOMImpl/GEOMImpl_I3DSketcher.hxx
src/GEOMImpl/GEOMImpl_IArc.hxx
src/GEOMImpl/GEOMImpl_IArchimede.hxx
src/GEOMImpl/GEOMImpl_IBaseIEOperations.cxx
src/GEOMImpl/GEOMImpl_IBaseIEOperations.hxx
src/GEOMImpl/GEOMImpl_IBasicOperations.cxx
src/GEOMImpl/GEOMImpl_IBasicOperations.hxx
src/GEOMImpl/GEOMImpl_IBlockTrsf.hxx
src/GEOMImpl/GEOMImpl_IBlocks.hxx
src/GEOMImpl/GEOMImpl_IBlocksOperations.cxx
src/GEOMImpl/GEOMImpl_IBlocksOperations.hxx
src/GEOMImpl/GEOMImpl_IBoolean.hxx
src/GEOMImpl/GEOMImpl_IBooleanOperations.cxx
src/GEOMImpl/GEOMImpl_IBooleanOperations.hxx
src/GEOMImpl/GEOMImpl_IBox.hxx
src/GEOMImpl/GEOMImpl_IChamfer.hxx
src/GEOMImpl/GEOMImpl_ICircle.hxx
src/GEOMImpl/GEOMImpl_ICone.hxx
src/GEOMImpl/GEOMImpl_ICopy.hxx
src/GEOMImpl/GEOMImpl_ICurveParametric.hxx
src/GEOMImpl/GEOMImpl_ICurvesOperations.cxx
src/GEOMImpl/GEOMImpl_ICurvesOperations.hxx
src/GEOMImpl/GEOMImpl_ICylinder.hxx
src/GEOMImpl/GEOMImpl_IDisk.hxx
src/GEOMImpl/GEOMImpl_IECallBack.cxx
src/GEOMImpl/GEOMImpl_IECallBack.hxx
src/GEOMImpl/GEOMImpl_IEllipse.hxx
src/GEOMImpl/GEOMImpl_IFace.hxx
src/GEOMImpl/GEOMImpl_IFieldOperations.cxx
src/GEOMImpl/GEOMImpl_IFieldOperations.hxx
src/GEOMImpl/GEOMImpl_IFillet.hxx
src/GEOMImpl/GEOMImpl_IFillet1d.hxx
src/GEOMImpl/GEOMImpl_IFillet2d.hxx
src/GEOMImpl/GEOMImpl_IFilling.hxx
src/GEOMImpl/GEOMImpl_IGlue.hxx
src/GEOMImpl/GEOMImpl_IGroupOperations.cxx
src/GEOMImpl/GEOMImpl_IGroupOperations.hxx
src/GEOMImpl/GEOMImpl_IHealing.hxx
src/GEOMImpl/GEOMImpl_IHealingOperations.cxx
src/GEOMImpl/GEOMImpl_IHealingOperations.hxx
src/GEOMImpl/GEOMImpl_IImportExport.hxx
src/GEOMImpl/GEOMImpl_IInsertOperations.cxx [changed mode: 0755->0644]
src/GEOMImpl/GEOMImpl_IInsertOperations.hxx
src/GEOMImpl/GEOMImpl_IIsoline.hxx
src/GEOMImpl/GEOMImpl_ILine.hxx
src/GEOMImpl/GEOMImpl_ILocalOperations.cxx
src/GEOMImpl/GEOMImpl_ILocalOperations.hxx
src/GEOMImpl/GEOMImpl_IMarker.hxx
src/GEOMImpl/GEOMImpl_IMeasure.hxx
src/GEOMImpl/GEOMImpl_IMeasureOperations.cxx
src/GEOMImpl/GEOMImpl_IMeasureOperations.hxx
src/GEOMImpl/GEOMImpl_IMirror.hxx
src/GEOMImpl/GEOMImpl_IOffset.hxx
src/GEOMImpl/GEOMImpl_IPartition.hxx
src/GEOMImpl/GEOMImpl_IPipe.hxx
src/GEOMImpl/GEOMImpl_IPipeBiNormal.hxx
src/GEOMImpl/GEOMImpl_IPipeDiffSect.hxx
src/GEOMImpl/GEOMImpl_IPipePath.hxx
src/GEOMImpl/GEOMImpl_IPipeShellSect.hxx
src/GEOMImpl/GEOMImpl_IPlane.hxx
src/GEOMImpl/GEOMImpl_IPoint.hxx [changed mode: 0755->0644]
src/GEOMImpl/GEOMImpl_IPolyline.hxx
src/GEOMImpl/GEOMImpl_IPolyline2D.cxx
src/GEOMImpl/GEOMImpl_IPolyline2D.hxx
src/GEOMImpl/GEOMImpl_IPosition.hxx
src/GEOMImpl/GEOMImpl_IPrism.hxx
src/GEOMImpl/GEOMImpl_IProjOnCyl.hxx [new file with mode: 0644]
src/GEOMImpl/GEOMImpl_IProjection.hxx
src/GEOMImpl/GEOMImpl_IRevolution.hxx
src/GEOMImpl/GEOMImpl_IRotate.hxx
src/GEOMImpl/GEOMImpl_IScale.hxx
src/GEOMImpl/GEOMImpl_IShapeExtend.hxx [new file with mode: 0644]
src/GEOMImpl/GEOMImpl_IShapes.hxx
src/GEOMImpl/GEOMImpl_IShapesOperations.cxx
src/GEOMImpl/GEOMImpl_IShapesOperations.hxx
src/GEOMImpl/GEOMImpl_ISketcher.hxx
src/GEOMImpl/GEOMImpl_ISphere.hxx
src/GEOMImpl/GEOMImpl_ISpline.hxx
src/GEOMImpl/GEOMImpl_IThruSections.hxx
src/GEOMImpl/GEOMImpl_ITorus.hxx
src/GEOMImpl/GEOMImpl_ITransferData.cxx [new file with mode: 0644]
src/GEOMImpl/GEOMImpl_ITransferData.hxx [new file with mode: 0644]
src/GEOMImpl/GEOMImpl_ITransformOperations.cxx
src/GEOMImpl/GEOMImpl_ITransformOperations.hxx
src/GEOMImpl/GEOMImpl_ITranslate.hxx
src/GEOMImpl/GEOMImpl_IVector.hxx
src/GEOMImpl/GEOMImpl_ImportDriver.cxx
src/GEOMImpl/GEOMImpl_ImportDriver.hxx
src/GEOMImpl/GEOMImpl_LineDriver.cxx
src/GEOMImpl/GEOMImpl_LineDriver.hxx
src/GEOMImpl/GEOMImpl_MarkerDriver.cxx
src/GEOMImpl/GEOMImpl_MarkerDriver.hxx
src/GEOMImpl/GEOMImpl_MeasureDriver.cxx
src/GEOMImpl/GEOMImpl_MeasureDriver.hxx
src/GEOMImpl/GEOMImpl_MirrorDriver.cxx
src/GEOMImpl/GEOMImpl_MirrorDriver.hxx
src/GEOMImpl/GEOMImpl_OffsetDriver.cxx
src/GEOMImpl/GEOMImpl_OffsetDriver.hxx
src/GEOMImpl/GEOMImpl_PartitionDriver.cxx
src/GEOMImpl/GEOMImpl_PartitionDriver.hxx
src/GEOMImpl/GEOMImpl_PipeDriver.cxx
src/GEOMImpl/GEOMImpl_PipeDriver.hxx
src/GEOMImpl/GEOMImpl_PipePathDriver.cxx
src/GEOMImpl/GEOMImpl_PipePathDriver.hxx
src/GEOMImpl/GEOMImpl_PlaneDriver.cxx
src/GEOMImpl/GEOMImpl_PlaneDriver.hxx
src/GEOMImpl/GEOMImpl_PointDriver.cxx
src/GEOMImpl/GEOMImpl_PointDriver.hxx
src/GEOMImpl/GEOMImpl_PolylineDriver.cxx
src/GEOMImpl/GEOMImpl_PolylineDriver.hxx
src/GEOMImpl/GEOMImpl_PolylineDumper.cxx
src/GEOMImpl/GEOMImpl_PolylineDumper.hxx
src/GEOMImpl/GEOMImpl_PositionDriver.cxx
src/GEOMImpl/GEOMImpl_PositionDriver.hxx
src/GEOMImpl/GEOMImpl_PrismDriver.cxx
src/GEOMImpl/GEOMImpl_PrismDriver.hxx
src/GEOMImpl/GEOMImpl_ProjectionDriver.cxx
src/GEOMImpl/GEOMImpl_ProjectionDriver.hxx
src/GEOMImpl/GEOMImpl_RevolutionDriver.cxx
src/GEOMImpl/GEOMImpl_RevolutionDriver.hxx
src/GEOMImpl/GEOMImpl_RotateDriver.cxx
src/GEOMImpl/GEOMImpl_RotateDriver.hxx
src/GEOMImpl/GEOMImpl_ScaleDriver.cxx
src/GEOMImpl/GEOMImpl_ScaleDriver.hxx
src/GEOMImpl/GEOMImpl_ShapeDriver.cxx
src/GEOMImpl/GEOMImpl_ShapeDriver.hxx
src/GEOMImpl/GEOMImpl_SketcherDriver.cxx
src/GEOMImpl/GEOMImpl_SketcherDriver.hxx
src/GEOMImpl/GEOMImpl_SphereDriver.cxx
src/GEOMImpl/GEOMImpl_SphereDriver.hxx
src/GEOMImpl/GEOMImpl_SplineDriver.cxx
src/GEOMImpl/GEOMImpl_SplineDriver.hxx
src/GEOMImpl/GEOMImpl_ThruSectionsDriver.cxx
src/GEOMImpl/GEOMImpl_ThruSectionsDriver.hxx
src/GEOMImpl/GEOMImpl_TorusDriver.cxx
src/GEOMImpl/GEOMImpl_TorusDriver.hxx
src/GEOMImpl/GEOMImpl_TranslateDriver.cxx
src/GEOMImpl/GEOMImpl_TranslateDriver.hxx
src/GEOMImpl/GEOMImpl_Types.hxx
src/GEOMImpl/GEOMImpl_VectorDriver.cxx
src/GEOMImpl/GEOMImpl_VectorDriver.hxx
src/GEOMImpl/GEOM_GEOMImpl.hxx
src/GEOMToolsGUI/CMakeLists.txt
src/GEOMToolsGUI/GEOMToolsGUI.cxx
src/GEOMToolsGUI/GEOMToolsGUI.h
src/GEOMToolsGUI/GEOMToolsGUI_1.cxx
src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_DeflectionDlg.h
src/GEOMToolsGUI/GEOMToolsGUI_DeleteDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_DeleteDlg.h
src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_LineWidthDlg.h
src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_MarkerDlg.h
src/GEOMToolsGUI/GEOMToolsGUI_MaterialPropertiesDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_MaterialPropertiesDlg.h
src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_NbIsosDlg.h
src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_PublishDlg.h
src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_ReduceStudyDlg.h
src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.cxx
src/GEOMToolsGUI/GEOMToolsGUI_TransparencyDlg.h
src/GEOMToolsGUI/GEOM_ToolsGUI.hxx
src/GEOMUtils/CMakeLists.txt
src/GEOMUtils/GEOMUtils.cxx
src/GEOMUtils/GEOMUtils.hxx
src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx [new file with mode: 0644]
src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx [new file with mode: 0644]
src/GEOMUtils/GEOMUtils_Hatcher.cxx
src/GEOMUtils/GEOMUtils_Hatcher.hxx
src/GEOMUtils/GEOMUtils_ShapeStatistics.cxx [new file with mode: 0644]
src/GEOMUtils/GEOMUtils_ShapeStatistics.hxx [new file with mode: 0644]
src/GEOMUtils/GEOMUtils_Trsf2d.cxx [new file with mode: 0644]
src/GEOMUtils/GEOMUtils_Trsf2d.hxx [new file with mode: 0644]
src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx [new file with mode: 0644]
src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx [new file with mode: 0644]
src/GEOMUtils/GEOMUtils_XmlHandler.cxx
src/GEOMUtils/GEOMUtils_XmlHandler.hxx
src/GEOM_I/CMakeLists.txt
src/GEOM_I/GEOM_BaseObject_i.cc
src/GEOM_I/GEOM_BaseObject_i.hh
src/GEOM_I/GEOM_DumpPython.cc
src/GEOM_I/GEOM_Field_i.cc
src/GEOM_I/GEOM_Field_i.hh
src/GEOM_I/GEOM_GEOM_I.hxx
src/GEOM_I/GEOM_Gen_i.cc
src/GEOM_I/GEOM_Gen_i.hh
src/GEOM_I/GEOM_I3DPrimOperations_i.cc
src/GEOM_I/GEOM_I3DPrimOperations_i.hh
src/GEOM_I/GEOM_IBasicOperations_i.cc
src/GEOM_I/GEOM_IBasicOperations_i.hh
src/GEOM_I/GEOM_IBlocksOperations_i.cc [changed mode: 0755->0644]
src/GEOM_I/GEOM_IBlocksOperations_i.hh
src/GEOM_I/GEOM_IBooleanOperations_i.cc
src/GEOM_I/GEOM_IBooleanOperations_i.hh
src/GEOM_I/GEOM_ICurvesOperations_i.cc
src/GEOM_I/GEOM_ICurvesOperations_i.hh
src/GEOM_I/GEOM_IFieldOperations_i.cc
src/GEOM_I/GEOM_IFieldOperations_i.hh
src/GEOM_I/GEOM_IGroupOperations_i.cc
src/GEOM_I/GEOM_IGroupOperations_i.hh
src/GEOM_I/GEOM_IHealingOperations_i.cc
src/GEOM_I/GEOM_IHealingOperations_i.hh
src/GEOM_I/GEOM_IInsertOperations_i.cc
src/GEOM_I/GEOM_IInsertOperations_i.hh
src/GEOM_I/GEOM_ILocalOperations_i.cc
src/GEOM_I/GEOM_ILocalOperations_i.hh
src/GEOM_I/GEOM_IMeasureOperations_i.cc
src/GEOM_I/GEOM_IMeasureOperations_i.hh
src/GEOM_I/GEOM_IOperations_i.cc
src/GEOM_I/GEOM_IOperations_i.hh
src/GEOM_I/GEOM_IShapesOperations_i.cc
src/GEOM_I/GEOM_IShapesOperations_i.hh
src/GEOM_I/GEOM_ITransformOperations_i.cc
src/GEOM_I/GEOM_ITransformOperations_i.hh
src/GEOM_I/GEOM_Object_i.cc
src/GEOM_I/GEOM_Object_i.hh
src/GEOM_I/GEOM_wrap.hxx
src/GEOM_I_Superv/CMakeLists.txt
src/GEOM_I_Superv/GEOM_I_Superv.hxx
src/GEOM_I_Superv/GEOM_List_i.hh
src/GEOM_I_Superv/GEOM_Superv_i.cc
src/GEOM_I_Superv/GEOM_Superv_i.hh
src/GEOM_PY/CMakeLists.txt
src/GEOM_PY/__init__.py
src/GEOM_PY/geomtools.py
src/GEOM_PY/sketcher.py
src/GEOM_PY/structelem/CMakeLists.txt
src/GEOM_PY/structelem/__init__.py
src/GEOM_PY/structelem/orientation.py
src/GEOM_PY/structelem/parts.py
src/GEOM_SWIG/AdvancedGEOMBuilder.py
src/GEOM_SWIG/BREPPluginBuilder.py
src/GEOM_SWIG/CMakeLists.txt
src/GEOM_SWIG/GEOM_Nut.py
src/GEOM_SWIG/GEOM_ObjectInfo.py
src/GEOM_SWIG/GEOM_Partition1.py
src/GEOM_SWIG/GEOM_Partition2.py
src/GEOM_SWIG/GEOM_Partition3.py
src/GEOM_SWIG/GEOM_Partition4.py
src/GEOM_SWIG/GEOM_Partition5.py
src/GEOM_SWIG/GEOM_Sketcher.py
src/GEOM_SWIG/GEOM_Spanner.py
src/GEOM_SWIG/GEOM_TestAll.py
src/GEOM_SWIG/GEOM_TestField.py
src/GEOM_SWIG/GEOM_TestHealing.py
src/GEOM_SWIG/GEOM_TestMeasures.py
src/GEOM_SWIG/GEOM_TestOthers.py
src/GEOM_SWIG/GEOM_blocks.py
src/GEOM_SWIG/GEOM_cyl2complementary.py
src/GEOM_SWIG/GEOM_example.py
src/GEOM_SWIG/GEOM_example2.py
src/GEOM_SWIG/GEOM_example3.py
src/GEOM_SWIG/GEOM_example4.py
src/GEOM_SWIG/GEOM_example5.py
src/GEOM_SWIG/GEOM_example6.py
src/GEOM_SWIG/GEOM_example7.py
src/GEOM_SWIG/GEOM_moteur.py
src/GEOM_SWIG/GEOM_shared_modules.py
src/GEOM_SWIG/GEOM_shellSolid.py
src/GEOM_SWIG/GEOM_tube_geom.py
src/GEOM_SWIG/GEOM_tube_geom_gg2.py
src/GEOM_SWIG/GEOM_usinggeom.py
src/GEOM_SWIG/IGESPluginBuilder.py
src/GEOM_SWIG/PAL_MESH_019_020_geometry.py
src/GEOM_SWIG/PAL_MESH_028_geometry.py
src/GEOM_SWIG/PAL_MESH_030_geometry.py
src/GEOM_SWIG/PAL_MESH_033_geometry.py
src/GEOM_SWIG/PAL_MESH_035_geometry.py
src/GEOM_SWIG/STEPPluginBuilder.py
src/GEOM_SWIG/STLPluginBuilder.py
src/GEOM_SWIG/VTKPluginBuilder.py
src/GEOM_SWIG/XAOPluginBuilder.py
src/GEOM_SWIG/__init__.py
src/GEOM_SWIG/geomBuilder.py
src/GEOM_SWIG/geompy.py
src/GEOM_SWIG/gsketcher.py
src/GEOM_SWIG_WITHIHM/CMakeLists.txt
src/GEOM_SWIG_WITHIHM/libGEOM_Swig.cxx
src/GEOM_SWIG_WITHIHM/libGEOM_Swig.h
src/GEOM_SWIG_WITHIHM/libGEOM_Swig.i
src/GenerationGUI/CMakeLists.txt
src/GenerationGUI/GenerationGUI.cxx
src/GenerationGUI/GenerationGUI.h
src/GenerationGUI/GenerationGUI_FillingDlg.cxx
src/GenerationGUI/GenerationGUI_FillingDlg.h
src/GenerationGUI/GenerationGUI_PipeDlg.cxx
src/GenerationGUI/GenerationGUI_PipeDlg.h
src/GenerationGUI/GenerationGUI_PipePathDlg.cxx
src/GenerationGUI/GenerationGUI_PipePathDlg.h
src/GenerationGUI/GenerationGUI_PrismDlg.cxx
src/GenerationGUI/GenerationGUI_PrismDlg.h
src/GenerationGUI/GenerationGUI_RevolDlg.cxx
src/GenerationGUI/GenerationGUI_RevolDlg.h
src/GenerationGUI/GenerationGUI_ThicknessDlg.cxx [new file with mode: 0644]
src/GenerationGUI/GenerationGUI_ThicknessDlg.h [new file with mode: 0644]
src/GroupGUI/CMakeLists.txt
src/GroupGUI/GroupGUI.cxx
src/GroupGUI/GroupGUI.h
src/GroupGUI/GroupGUI_BooleanDlg.cxx
src/GroupGUI/GroupGUI_BooleanDlg.h
src/GroupGUI/GroupGUI_GroupDlg.cxx
src/GroupGUI/GroupGUI_GroupDlg.h
src/IGESPlugin/CMakeLists.txt
src/IGESPlugin/IGESPlugin_Engine.cxx
src/IGESPlugin/IGESPlugin_Engine.hxx
src/IGESPlugin/IGESPlugin_ExportDlg.cxx
src/IGESPlugin/IGESPlugin_ExportDlg.h
src/IGESPlugin/IGESPlugin_ExportDriver.cxx
src/IGESPlugin/IGESPlugin_ExportDriver.hxx
src/IGESPlugin/IGESPlugin_GUI.cxx
src/IGESPlugin/IGESPlugin_GUI.h
src/IGESPlugin/IGESPlugin_IECallBack.cxx
src/IGESPlugin/IGESPlugin_IECallBack.hxx
src/IGESPlugin/IGESPlugin_IExport.hxx
src/IGESPlugin/IGESPlugin_IImport.hxx
src/IGESPlugin/IGESPlugin_IOperations.cxx
src/IGESPlugin/IGESPlugin_IOperations.hxx
src/IGESPlugin/IGESPlugin_IOperations_i.cc
src/IGESPlugin/IGESPlugin_IOperations_i.hh
src/IGESPlugin/IGESPlugin_ImportDriver.cxx
src/IGESPlugin/IGESPlugin_ImportDriver.hxx
src/IGESPlugin/IGESPlugin_OperationsCreator.cxx
src/IGESPlugin/IGESPlugin_OperationsCreator.hxx
src/IGESPlugin/IGESPlugin_msg_ja.ts
src/Material/CMakeLists.txt
src/Material/Material.h
src/Material/Material_Model.cxx
src/Material/Material_Model.h
src/Material/Material_ResourceMgr.cxx
src/Material/Material_ResourceMgr.h
src/Material/resources/SalomeMaterial.xml
src/MeasureGUI/CMakeLists.txt
src/MeasureGUI/MeasureGUI.cxx
src/MeasureGUI/MeasureGUI.h
src/MeasureGUI/MeasureGUI_AngleDlg.cxx
src/MeasureGUI/MeasureGUI_AngleDlg.h
src/MeasureGUI/MeasureGUI_BndBoxDlg.cxx
src/MeasureGUI/MeasureGUI_BndBoxDlg.h
src/MeasureGUI/MeasureGUI_CenterMassDlg.cxx
src/MeasureGUI/MeasureGUI_CenterMassDlg.h
src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.cxx
src/MeasureGUI/MeasureGUI_CheckCompoundOfBlocksDlg.h
src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.cxx
src/MeasureGUI/MeasureGUI_CheckSelfIntersectionsDlg.h
src/MeasureGUI/MeasureGUI_CheckShapeDlg.cxx
src/MeasureGUI/MeasureGUI_CheckShapeDlg.h
src/MeasureGUI/MeasureGUI_CreateDimensionDlg.cxx
src/MeasureGUI/MeasureGUI_CreateDimensionDlg.h
src/MeasureGUI/MeasureGUI_DimensionCreateTool.cxx
src/MeasureGUI/MeasureGUI_DimensionCreateTool.h
src/MeasureGUI/MeasureGUI_DimensionFilter.cxx
src/MeasureGUI/MeasureGUI_DimensionFilter.h
src/MeasureGUI/MeasureGUI_DimensionInteractor.cxx
src/MeasureGUI/MeasureGUI_DimensionInteractor.h
src/MeasureGUI/MeasureGUI_DistanceDlg.cxx
src/MeasureGUI/MeasureGUI_DistanceDlg.h
src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx [new file with mode: 0644]
src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.h [new file with mode: 0644]
src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.cxx
src/MeasureGUI/MeasureGUI_GetNonBlocksDlg.h
src/MeasureGUI/MeasureGUI_InertiaDlg.cxx
src/MeasureGUI/MeasureGUI_InertiaDlg.h
src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.cxx
src/MeasureGUI/MeasureGUI_ManageDimensionsDlg.h
src/MeasureGUI/MeasureGUI_MaxToleranceDlg.cxx
src/MeasureGUI/MeasureGUI_MaxToleranceDlg.h
src/MeasureGUI/MeasureGUI_NormaleDlg.cxx
src/MeasureGUI/MeasureGUI_NormaleDlg.h
src/MeasureGUI/MeasureGUI_PointDlg.cxx
src/MeasureGUI/MeasureGUI_PointDlg.h
src/MeasureGUI/MeasureGUI_PropertiesDlg.cxx
src/MeasureGUI/MeasureGUI_PropertiesDlg.h
src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.cxx [new file with mode: 0644]
src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.h [new file with mode: 0644]
src/MeasureGUI/MeasureGUI_Skeleton.cxx
src/MeasureGUI/MeasureGUI_Skeleton.h
src/MeasureGUI/MeasureGUI_WhatisDlg.cxx
src/MeasureGUI/MeasureGUI_WhatisDlg.h
src/MeasureGUI/MeasureGUI_Widgets.cxx
src/MeasureGUI/MeasureGUI_Widgets.h
src/MeasureGUI/MeasureGUI_definitions.h [new file with mode: 0644]
src/OBJECT/CMakeLists.txt
src/OBJECT/GEOM_AISDimension.cxx
src/OBJECT/GEOM_AISDimension.hxx
src/OBJECT/GEOM_AISShape.cxx
src/OBJECT/GEOM_AISShape.hxx
src/OBJECT/GEOM_AISTrihedron.cxx
src/OBJECT/GEOM_AISTrihedron.hxx
src/OBJECT/GEOM_AISVector.cxx
src/OBJECT/GEOM_AISVector.hxx
src/OBJECT/GEOM_Actor.cxx
src/OBJECT/GEOM_Actor.h
src/OBJECT/GEOM_Constants.cxx
src/OBJECT/GEOM_Constants.h
src/OBJECT/GEOM_DeviceActor.cxx
src/OBJECT/GEOM_DeviceActor.h
src/OBJECT/GEOM_InteractiveObject.cxx
src/OBJECT/GEOM_InteractiveObject.hxx
src/OBJECT/GEOM_OBJECT_defs.hxx
src/OBJECT/GEOM_OCCReader.cxx
src/OBJECT/GEOM_OCCReader.h
src/OBJECT/GEOM_PainterPolyDataMapper.cxx
src/OBJECT/GEOM_PainterPolyDataMapper.h
src/OBJECT/GEOM_SmartPtr.h
src/OBJECT/GEOM_TopWireframeShape.cxx
src/OBJECT/GEOM_TopWireframeShape.hxx
src/OBJECT/GEOM_VTKPropertyMaterial.cxx
src/OBJECT/GEOM_VTKPropertyMaterial.hxx
src/OBJECT/GEOM_VTKTrihedron.cxx
src/OBJECT/GEOM_VTKTrihedron.hxx
src/OCC2VTK/CMakeLists.txt
src/OCC2VTK/GEOM_EdgeSource.cxx
src/OCC2VTK/GEOM_EdgeSource.h
src/OCC2VTK/GEOM_FaceSource.cxx
src/OCC2VTK/GEOM_FaceSource.h
src/OCC2VTK/GEOM_ShadingFace.cxx
src/OCC2VTK/GEOM_ShadingFace.h
src/OCC2VTK/GEOM_VertexSource.cxx
src/OCC2VTK/GEOM_VertexSource.h
src/OCC2VTK/GEOM_WireframeFace.cxx
src/OCC2VTK/GEOM_WireframeFace.h
src/OCC2VTK/OCC2VTK.h
src/OCC2VTK/OCC2VTK_Tools.cxx
src/OCC2VTK/OCC2VTK_Tools.h
src/OperationGUI/CMakeLists.txt
src/OperationGUI/OperationGUI.cxx
src/OperationGUI/OperationGUI.h
src/OperationGUI/OperationGUI_ArchimedeDlg.cxx
src/OperationGUI/OperationGUI_ArchimedeDlg.h
src/OperationGUI/OperationGUI_ChamferDlg.cxx
src/OperationGUI/OperationGUI_ChamferDlg.h
src/OperationGUI/OperationGUI_ClippingDlg.cxx
src/OperationGUI/OperationGUI_ClippingDlg.h
src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.cxx
src/OperationGUI/OperationGUI_ExtrudedFeatureDlg.h
src/OperationGUI/OperationGUI_Fillet1d2dDlg.cxx
src/OperationGUI/OperationGUI_Fillet1d2dDlg.h
src/OperationGUI/OperationGUI_FilletDlg.cxx
src/OperationGUI/OperationGUI_FilletDlg.h
src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.cxx
src/OperationGUI/OperationGUI_GetShapesOnShapeDlg.h
src/OperationGUI/OperationGUI_GetSharedShapesDlg.cxx
src/OperationGUI/OperationGUI_GetSharedShapesDlg.h
src/OperationGUI/OperationGUI_MaterialDlg.cxx
src/OperationGUI/OperationGUI_MaterialDlg.h
src/OperationGUI/OperationGUI_PartitionDlg.cxx
src/OperationGUI/OperationGUI_PartitionDlg.h
src/OperationGUI/OperationGUI_TransferDataDlg.cxx [new file with mode: 0755]
src/OperationGUI/OperationGUI_TransferDataDlg.h [new file with mode: 0644]
src/PrimitiveGUI/CMakeLists.txt
src/PrimitiveGUI/PrimitiveGUI.cxx
src/PrimitiveGUI/PrimitiveGUI.h
src/PrimitiveGUI/PrimitiveGUI_BoxDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_BoxDlg.h
src/PrimitiveGUI/PrimitiveGUI_ConeDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_ConeDlg.h
src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_CylinderDlg.h
src/PrimitiveGUI/PrimitiveGUI_DiskDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_DiskDlg.h
src/PrimitiveGUI/PrimitiveGUI_FaceDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_FaceDlg.h
src/PrimitiveGUI/PrimitiveGUI_SphereDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_SphereDlg.h
src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h
src/RepairGUI/CMakeLists.txt
src/RepairGUI/RepairGUI.cxx
src/RepairGUI/RepairGUI.h
src/RepairGUI/RepairGUI_ChangeOrientationDlg.cxx
src/RepairGUI/RepairGUI_ChangeOrientationDlg.h
src/RepairGUI/RepairGUI_CloseContourDlg.cxx
src/RepairGUI/RepairGUI_CloseContourDlg.h
src/RepairGUI/RepairGUI_DivideEdgeDlg.cxx
src/RepairGUI/RepairGUI_DivideEdgeDlg.h
src/RepairGUI/RepairGUI_FreeBoundDlg.cxx
src/RepairGUI/RepairGUI_FreeBoundDlg.h
src/RepairGUI/RepairGUI_FreeFacesDlg.cxx
src/RepairGUI/RepairGUI_FreeFacesDlg.h
src/RepairGUI/RepairGUI_FuseEdgesDlg.cxx
src/RepairGUI/RepairGUI_FuseEdgesDlg.h
src/RepairGUI/RepairGUI_GlueDlg.cxx
src/RepairGUI/RepairGUI_GlueDlg.h
src/RepairGUI/RepairGUI_InspectObjectDlg.cxx [new file with mode: 0644]
src/RepairGUI/RepairGUI_InspectObjectDlg.h [new file with mode: 0644]
src/RepairGUI/RepairGUI_LimitToleranceDlg.cxx
src/RepairGUI/RepairGUI_LimitToleranceDlg.h
src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.cxx
src/RepairGUI/RepairGUI_RemoveExtraEdgesDlg.h
src/RepairGUI/RepairGUI_RemoveHolesDlg.cxx
src/RepairGUI/RepairGUI_RemoveHolesDlg.h
src/RepairGUI/RepairGUI_RemoveIntWiresDlg.cxx
src/RepairGUI/RepairGUI_RemoveIntWiresDlg.h
src/RepairGUI/RepairGUI_RemoveWebsDlg.cxx
src/RepairGUI/RepairGUI_RemoveWebsDlg.h
src/RepairGUI/RepairGUI_SewingDlg.cxx
src/RepairGUI/RepairGUI_SewingDlg.h
src/RepairGUI/RepairGUI_ShapeProcessDlg.cxx
src/RepairGUI/RepairGUI_ShapeProcessDlg.h
src/RepairGUI/RepairGUI_SuppressFacesDlg.cxx
src/RepairGUI/RepairGUI_SuppressFacesDlg.h
src/RepairGUI/RepairGUI_UnionFacesDlg.cxx
src/RepairGUI/RepairGUI_UnionFacesDlg.h
src/SKETCHER/CMakeLists.txt
src/SKETCHER/Sketcher.hxx
src/SKETCHER/Sketcher_Profile.cxx
src/SKETCHER/Sketcher_Profile.hxx
src/SKETCHER/Sketcher_Utils.cxx
src/SKETCHER/Sketcher_Utils.hxx
src/STEPPlugin/CMakeLists.txt
src/STEPPlugin/STEPPlugin_Engine.cxx
src/STEPPlugin/STEPPlugin_Engine.hxx
src/STEPPlugin/STEPPlugin_ExportDlg.cxx [new file with mode: 0644]
src/STEPPlugin/STEPPlugin_ExportDlg.h [new file with mode: 0644]
src/STEPPlugin/STEPPlugin_ExportDriver.cxx
src/STEPPlugin/STEPPlugin_ExportDriver.hxx
src/STEPPlugin/STEPPlugin_GUI.cxx
src/STEPPlugin/STEPPlugin_GUI.h
src/STEPPlugin/STEPPlugin_IECallBack.cxx [changed mode: 0755->0644]
src/STEPPlugin/STEPPlugin_IECallBack.hxx
src/STEPPlugin/STEPPlugin_IExport.hxx
src/STEPPlugin/STEPPlugin_IImport.hxx
src/STEPPlugin/STEPPlugin_IOperations.cxx
src/STEPPlugin/STEPPlugin_IOperations.hxx
src/STEPPlugin/STEPPlugin_IOperations_i.cc
src/STEPPlugin/STEPPlugin_IOperations_i.hh
src/STEPPlugin/STEPPlugin_ImportDriver.cxx
src/STEPPlugin/STEPPlugin_ImportDriver.hxx
src/STEPPlugin/STEPPlugin_OperationsCreator.cxx
src/STEPPlugin/STEPPlugin_OperationsCreator.hxx
src/STEPPlugin/STEPPlugin_msg_en.ts
src/STEPPlugin/STEPPlugin_msg_ja.ts
src/STLPlugin/CMakeLists.txt
src/STLPlugin/STLPlugin_Engine.cxx
src/STLPlugin/STLPlugin_Engine.hxx
src/STLPlugin/STLPlugin_ExportDlg.cxx
src/STLPlugin/STLPlugin_ExportDlg.h
src/STLPlugin/STLPlugin_ExportDriver.cxx
src/STLPlugin/STLPlugin_ExportDriver.hxx
src/STLPlugin/STLPlugin_GUI.cxx
src/STLPlugin/STLPlugin_GUI.h
src/STLPlugin/STLPlugin_IECallBack.cxx
src/STLPlugin/STLPlugin_IECallBack.hxx
src/STLPlugin/STLPlugin_IExport.hxx
src/STLPlugin/STLPlugin_IImport.hxx
src/STLPlugin/STLPlugin_IOperations.cxx
src/STLPlugin/STLPlugin_IOperations.hxx
src/STLPlugin/STLPlugin_IOperations_i.cc
src/STLPlugin/STLPlugin_IOperations_i.hh
src/STLPlugin/STLPlugin_ImportDriver.cxx
src/STLPlugin/STLPlugin_ImportDriver.hxx
src/STLPlugin/STLPlugin_OperationsCreator.cxx
src/STLPlugin/STLPlugin_OperationsCreator.hxx
src/STLPlugin/STLPlugin_msg_fr.ts
src/STLPlugin/STLPlugin_msg_ja.ts
src/ShHealOper/CMakeLists.txt
src/ShHealOper/ShHealOper_ChangeOrientation.cxx
src/ShHealOper/ShHealOper_ChangeOrientation.hxx
src/ShHealOper/ShHealOper_CloseContour.cxx
src/ShHealOper/ShHealOper_CloseContour.hxx
src/ShHealOper/ShHealOper_EdgeDivide.cxx
src/ShHealOper/ShHealOper_EdgeDivide.hxx
src/ShHealOper/ShHealOper_FillHoles.cxx
src/ShHealOper/ShHealOper_FillHoles.hxx
src/ShHealOper/ShHealOper_ModifStats.hxx [new file with mode: 0644]
src/ShHealOper/ShHealOper_RemoveFace.cxx
src/ShHealOper/ShHealOper_RemoveFace.hxx
src/ShHealOper/ShHealOper_RemoveInternalWires.cxx
src/ShHealOper/ShHealOper_RemoveInternalWires.hxx
src/ShHealOper/ShHealOper_Sewing.cxx
src/ShHealOper/ShHealOper_Sewing.hxx
src/ShHealOper/ShHealOper_ShapeProcess.cxx
src/ShHealOper/ShHealOper_ShapeProcess.hxx
src/ShHealOper/ShHealOper_SpiltCurve2d.hxx
src/ShHealOper/ShHealOper_SplitCurve2d.cxx
src/ShHealOper/ShHealOper_SplitCurve2d.hxx
src/ShHealOper/ShHealOper_SplitCurve3d.cxx
src/ShHealOper/ShHealOper_SplitCurve3d.hxx
src/ShHealOper/ShHealOper_Tool.cxx
src/ShHealOper/ShHealOper_Tool.hxx
src/ShapeRecognition/CMakeLists.txt
src/ShapeRecognition/ShapeRec_FeatureDetector.cxx
src/ShapeRecognition/ShapeRec_FeatureDetector.hxx
src/TransformationGUI/CMakeLists.txt
src/TransformationGUI/TransformationGUI.cxx
src/TransformationGUI/TransformationGUI.h
src/TransformationGUI/TransformationGUI_ExtensionDlg.cxx [new file with mode: 0644]
src/TransformationGUI/TransformationGUI_ExtensionDlg.h [new file with mode: 0644]
src/TransformationGUI/TransformationGUI_MirrorDlg.cxx
src/TransformationGUI/TransformationGUI_MirrorDlg.h
src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx
src/TransformationGUI/TransformationGUI_MultiRotationDlg.h
src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx
src/TransformationGUI/TransformationGUI_MultiTranslationDlg.h
src/TransformationGUI/TransformationGUI_OffsetDlg.cxx
src/TransformationGUI/TransformationGUI_OffsetDlg.h
src/TransformationGUI/TransformationGUI_PositionDlg.cxx
src/TransformationGUI/TransformationGUI_PositionDlg.h
src/TransformationGUI/TransformationGUI_ProjectionDlg.cxx
src/TransformationGUI/TransformationGUI_ProjectionDlg.h
src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx [new file with mode: 0644]
src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.h [new file with mode: 0644]
src/TransformationGUI/TransformationGUI_RotationDlg.cxx
src/TransformationGUI/TransformationGUI_RotationDlg.h
src/TransformationGUI/TransformationGUI_ScaleDlg.cxx
src/TransformationGUI/TransformationGUI_ScaleDlg.h
src/TransformationGUI/TransformationGUI_TranslationDlg.cxx
src/TransformationGUI/TransformationGUI_TranslationDlg.h
src/VTKPlugin/CMakeLists.txt
src/VTKPlugin/VTKPlugin_Engine.cxx
src/VTKPlugin/VTKPlugin_Engine.hxx
src/VTKPlugin/VTKPlugin_ExportDlg.cxx
src/VTKPlugin/VTKPlugin_ExportDlg.h
src/VTKPlugin/VTKPlugin_ExportDriver.cxx
src/VTKPlugin/VTKPlugin_ExportDriver.hxx
src/VTKPlugin/VTKPlugin_GUI.cxx
src/VTKPlugin/VTKPlugin_GUI.h
src/VTKPlugin/VTKPlugin_IECallBack.cxx
src/VTKPlugin/VTKPlugin_IECallBack.hxx
src/VTKPlugin/VTKPlugin_IExport.hxx
src/VTKPlugin/VTKPlugin_IOperations.cxx
src/VTKPlugin/VTKPlugin_IOperations.hxx
src/VTKPlugin/VTKPlugin_IOperations_i.cc
src/VTKPlugin/VTKPlugin_IOperations_i.hh
src/VTKPlugin/VTKPlugin_OperationsCreator.cxx
src/VTKPlugin/VTKPlugin_OperationsCreator.hxx
src/VTKPlugin/VTKPlugin_msg_ja.ts
src/XAO/CMakeLists.txt
src/XAO/XAO.hxx
src/XAO/XAO_BooleanField.cxx
src/XAO/XAO_BooleanField.hxx
src/XAO/XAO_BooleanStep.cxx
src/XAO/XAO_BooleanStep.hxx
src/XAO/XAO_BrepGeometry.cxx
src/XAO/XAO_BrepGeometry.hxx
src/XAO/XAO_DoubleField.cxx
src/XAO/XAO_DoubleField.hxx
src/XAO/XAO_DoubleStep.cxx
src/XAO/XAO_DoubleStep.hxx
src/XAO/XAO_Exception.hxx
src/XAO/XAO_Field.cxx
src/XAO/XAO_Field.hxx
src/XAO/XAO_GeometricElement.cxx
src/XAO/XAO_GeometricElement.hxx
src/XAO/XAO_Geometry.cxx
src/XAO/XAO_Geometry.hxx
src/XAO/XAO_Group.cxx
src/XAO/XAO_Group.hxx
src/XAO/XAO_IntegerField.cxx
src/XAO/XAO_IntegerField.hxx
src/XAO/XAO_IntegerStep.cxx
src/XAO/XAO_IntegerStep.hxx
src/XAO/XAO_Step.cxx
src/XAO/XAO_Step.hxx
src/XAO/XAO_StringField.cxx
src/XAO/XAO_StringField.hxx
src/XAO/XAO_StringStep.cxx
src/XAO/XAO_StringStep.hxx
src/XAO/XAO_Xao.cxx
src/XAO/XAO_Xao.hxx
src/XAO/XAO_XaoExporter.cxx
src/XAO/XAO_XaoExporter.hxx
src/XAO/XAO_XaoUtils.cxx
src/XAO/XAO_XaoUtils.hxx
src/XAO/tests/BrepGeometryTest.cxx
src/XAO/tests/BrepGeometryTest.hxx
src/XAO/tests/CMakeLists.txt
src/XAO/tests/FieldTest.cxx
src/XAO/tests/FieldTest.hxx
src/XAO/tests/GeometryTest.cxx
src/XAO/tests/GeometryTest.hxx
src/XAO/tests/GroupTest.cxx
src/XAO/tests/GroupTest.hxx
src/XAO/tests/ImportExportTest.cxx
src/XAO/tests/ImportExportTest.hxx
src/XAO/tests/MainTest.hxx
src/XAO/tests/TestUtils.hxx
src/XAO/tests/XAOTests.cxx
src/XAO/tests/XaoTest.cxx
src/XAO/tests/XaoTest.hxx
src/XAO/tests/XaoUtilsTest.cxx
src/XAO/tests/XaoUtilsTest.hxx
src/XAO/tests/coverage_report.sh
src/XAOPlugin/CMakeLists.txt
src/XAOPlugin/XAOPlugin_Driver.cxx
src/XAOPlugin/XAOPlugin_Driver.hxx
src/XAOPlugin/XAOPlugin_Engine.cxx
src/XAOPlugin/XAOPlugin_Engine.hxx
src/XAOPlugin/XAOPlugin_ExportDlg.cxx
src/XAOPlugin/XAOPlugin_ExportDlg.h
src/XAOPlugin/XAOPlugin_GUI.cxx
src/XAOPlugin/XAOPlugin_GUI.h
src/XAOPlugin/XAOPlugin_IECallBack.cxx
src/XAOPlugin/XAOPlugin_IECallBack.hxx
src/XAOPlugin/XAOPlugin_IImportExport.hxx
src/XAOPlugin/XAOPlugin_IOperations.cxx
src/XAOPlugin/XAOPlugin_IOperations.hxx
src/XAOPlugin/XAOPlugin_IOperations_i.cc
src/XAOPlugin/XAOPlugin_IOperations_i.hh
src/XAOPlugin/XAOPlugin_ImportDlg.cxx
src/XAOPlugin/XAOPlugin_ImportDlg.h
src/XAOPlugin/XAOPlugin_OperationsCreator.cxx
src/XAOPlugin/XAOPlugin_OperationsCreator.hxx
src/XAOPlugin/XAOPlugin_msg_ja.ts
src/XAO_Swig/CMakeLists.txt

index c03791e8cd8609ce1d377ad3537c98fe24c0f634..828cfb7f421afee8a432489d7534c46e01fc64aa 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -30,8 +30,8 @@ CMAKE_POLICY(SET CMP0003 NEW)
 STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
 
 SET(${PROJECT_NAME_UC}_MAJOR_VERSION 7)
-SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
-SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
+SET(${PROJECT_NAME_UC}_MINOR_VERSION 7)
+SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
 SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
@@ -108,7 +108,9 @@ IF(SALOME_BUILD_GUI)
   IF(EXISTS ${GUI_ROOT_DIR})
     LIST(APPEND CMAKE_MODULE_PATH "${GUI_ROOT_DIR}/adm_local/cmake_files")
     FIND_PACKAGE(SalomeGUI)
-    FULL_GUI(TRUE) #check whether GUI builded in full mode and with CORBA
+    SALOME_GUI_WITH_CORBA() #check whether GUI builded with CORBA
+    SALOME_GUI_MODE(SALOME_USE_OCCVIEWER SALOME_USE_VTKVIEWER SALOME_USE_SALOMEOBJECT 
+                    OPTIONAL SALOME_USE_PLOT2DVIEWER SALOME_USE_GRAPHICSVIEW SALOME_USE_PYCONSOLE)
     ADD_DEFINITIONS(${GUI_DEFINITIONS})
     INCLUDE_DIRECTORIES(${GUI_INCLUDE_DIRS})
   ELSE(EXISTS ${GUI_ROOT_DIR})
@@ -125,12 +127,6 @@ IF(SALOME_BUILD_GUI)
 
   # Qt4
   FIND_PACKAGE(SalomeQt4 REQUIRED COMPONENTS QtCore QtGui QtXml)
-
-  # Optional prerequisites for GUI
-  IF(SALOME_USE_GLVIEWER)
-    FIND_PACKAGE(SalomeOpenGL)
-    SALOME_LOG_OPTIONAL_PACKAGE(OpenGL SALOME_USE_GLVIEWER) 
-  ENDIF() 
 ENDIF(SALOME_BUILD_GUI)
 
 ##
@@ -231,9 +227,12 @@ IF(SALOME_BUILD_GUI)
   LIST(APPEND _${PROJECT_NAME}_exposed_targets 
     AdvancedGUI BasicGUI BlocksGUI BooleanGUI BuildGUI DisplayGUI DlgRef CurveCreator EntityGUI GEOMBase
     GEOMFiltersSelection GEOM GEOMToolsGUI GenerationGUI GroupGUI Material MeasureGUI GEOMObject
-    OperationGUI PrimitiveGUI RepairGUI TransformationGUI DependencyTree
+    OperationGUI PrimitiveGUI RepairGUI TransformationGUI
     STLPluginGUI BREPPluginGUI STEPPluginGUI IGESPluginGUI XAOPluginGUI VTKPluginGUI
     )
+  IF(SALOME_USE_GRAPHICSVIEW)
+    LIST(APPEND _${PROJECT_NAME}_exposed_targets DependencyTree)
+  ENDIF(SALOME_USE_GRAPHICSVIEW)
 ENDIF(SALOME_BUILD_GUI)
 
 IF(SALOME_GEOM_USE_OPENCV)
index 13e518fe85846d221518faab6e4fc6ce2b1587a2..0775f17249ffed89a333f303918169748299b61b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 43660c4f821a6b3e882f6fa7572b788ff6602bb2..fe0e4b8f55687129720f7d41e6003aa4647c4d9a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index bedde74e07b3952b1f6c5378ce3ee85bfbfcca7d..3f181513f71f75288e596271c67c21f89659c986 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 35d18d35103e0e1e1947fc2785a3bb77103f79bd..b8361c0fca429d111d5bd410ff2296976edb6dfb 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 1c99fe09f70d5593d2a92cf202f103c509a85cad..2f42ba9c90bfb510bb468d2e92e93feca2a05660 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index c1827f55792b842a571f90fd04f116978af33fb6..bccfc2328892a7c689e2a59e4892ce911a1de208 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index eed3eb8d111a53f3b7ed68b4349e7017f04f243c..63932fea42987990ddccc039ca49b205bf1f0fe5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 #
 #  !! Please read the generic detection procedure in SalomeMacros.cmake !!
 #
-SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OpenCV OpenCV_DIR 2)
+SET(UpCount 2)
+
+IF (WIN32)
+  SET(UpCount 0)
+ENDIF (WIN32)
+
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(OpenCV OpenCV_DIR ${UpCount})
+
 #MARK_AS_ADVANCED()
 
 IF(OpenCV_FOUND) 
index eb508c1f49f2df961ef7e6fbc2a80dae66c28a35..0e752193100775013c5b51b4161e438070edef0e 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 5216cecd9a6413820c071dadcd9a9a21ba30ec9a..534b3d2020dd6ac615bb781cacf48fc333cfbcdd 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 36e743725957a3e887024071bc8d57c692719ba2..2f07c5ae1f420d947067b503be285c7ce52e0677 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
 dnl Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
index 609b55f4e4c54bba1ec4aa1d70fb113399884fd8..96b244408ac193a56bfa9aee6193c93f5c5de193 100755 (executable)
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
 dnl This library is free software; you can redistribute it and/or
 dnl modify it under the terms of the GNU Lesser General Public
index 2e7de0fe40661e5d68022798d04f829c4a643c07..a6950275bccbd6e5446eab7f23d6c60f6ea779c4 100644 (file)
@@ -1,4 +1,4 @@
-dnl Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+dnl Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 dnl
 dnl This library is free software; you can redistribute it and/or
 dnl modify it under the terms of the GNU Lesser General Public
index 37589d0222aff2ad75730b139f1838ec5cc498a0..6ed9cc11314045cbe5cd7f5f507f2fe30d9a8f57 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index dca703327503533ec49cfd6f776bd50faf1d7275..49719a9cd889487125027538ff7cc55bbab19d2e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index b4e8b747ac00edcb2b359775d1d33c49353fd8a9..dc9e38de59ac466905f78019ca77779dca0e8841 100644 (file)
@@ -1,6 +1,6 @@
 #! /usr/bin/env python
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -20,7 +20,7 @@
 #
 
 import os, sys, string
-from salome_utils import getTmpDir, generateFileName, uniteFiles
+from salome_utils import getLogDir, generateFileName, uniteFiles
 from setenv import add_path, get_lib_dir, salome_subdir
 
 # -----------------------------------------------------------------------------
@@ -29,8 +29,8 @@ def set_env( args ):
     """Add to the PATH-variables modules specific paths"""
     psep = os.pathsep
     python_version="python%d.%d" % sys.version_info[0:2]
-    
-    tmp_dir = getTmpDir()
+
+    tmp_dir = getLogDir()
     env_dir = generateFileName( tmp_dir, prefix="env", with_port=True )
     res_dir = os.path.join( os.getenv( "GEOM_ROOT_DIR" ), "share", salome_subdir, "resources", "geom" )
 
index 27aa5730ad3c0f920b3fb11eb6bd16cb656cb8ea..8bfe7cab7739f622848769ec102405c24fa5888e 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 197a24a4f8ae7029626bd058e14cd55749fb4cc6..1ccad11e2426e17b517103ba9c588ece63df21bd 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 3d9da70360de5086702583e23a08f01ee76bef1b..afd0a3a6aa065702db4892b1bb9ef7b7d6374cc1 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
 #
 
 SET(BAD_TESTS
-  repairing_operations_ex09.py 
+  repairing_operations_ex09.py
 )
 
 SET(GOOD_TESTS
-  3dsketcher.py  
-  advanced_geom_objs_ex01.py  
-  advanced_geom_objs_ex02.py  
-  advanced_geom_objs_ex03.py  
-  angle.py  
-  arranging_study_objects.py  
-  basic_geom_objs_ex01.py  
-  basic_geom_objs_ex02.py  
-  basic_geom_objs_ex03.py  
-  basic_geom_objs_ex04.py  
-  basic_geom_objs_ex05.py  
-  basic_geom_objs_ex06.py  
-  basic_geom_objs_ex07.py  
-  basic_geom_objs_ex08.py  
-  basic_geom_objs_ex09.py  
-  basic_operations_ex01.py  
-  basic_operations_ex02.py  
-  basic_operations_ex03.py  
-  basic_properties.py  
-  blocks_operations_ex01.py  
-  blocks_operations_ex02.py  
-  blocks_operations_ex03.py  
-  boolean_operations_ex01.py  
-  boolean_operations_ex02.py  
-  boolean_operations_ex03.py  
-  boolean_operations_ex04.py  
-  bounding_box.py  
-  building_by_blocks_ex01.py  
-  building_by_blocks_ex02.py  
-  center_of_mass.py  
-  check_compound_of_blocks.py  
-  check_self_intersections.py  
-  check_shape.py  
-  complex_objs_ex01.py  
-  complex_objs_ex02.py  
-  complex_objs_ex03.py  
-  complex_objs_ex04.py  
-  complex_objs_ex05.py  
-  complex_objs_ex06.py  
-  complex_objs_ex07.py  
-  complex_objs_ex08.py  
-  complex_objs_ex09.py  
-  complex_objs_ex10.py  
-  free_boundaries.py  
-  free_faces.py  
-  GEOM_box.py  
-  get_non_blocks.py  
-  import_export.py  
-  inertia.py  
-  min_distance.py  
-  normal_face.py  
-  notebook_geom.py  
-  point_coordinates.py  
-  primitives_ex01.py  
-  primitives_ex02.py  
-  primitives_ex03.py  
-  primitives_ex04.py  
-  primitives_ex05.py  
-  primitives_ex06.py  
-  primitives_ex07.py  
-  repairing_operations_ex01.py  
-  repairing_operations_ex02.py  
-  repairing_operations_ex03.py  
-  repairing_operations_ex04.py  
-  repairing_operations_ex05.py  
-  repairing_operations_ex06.py  
-  repairing_operations_ex07.py  
-  repairing_operations_ex08.py  
-  repairing_operations_ex10.py  
-  repairing_operations_ex11.py  
-  repairing_operations_ex12.py  
-  sketcher.py  
-  tolerance.py  
-  topological_geom_objs_ex01.py  
-  topological_geom_objs_ex02.py  
-  topological_geom_objs_ex03.py  
-  topological_geom_objs_ex04.py  
-  topological_geom_objs_ex05.py  
-  topological_geom_objs_ex06.py  
-  transformation_operations_ex01.py  
-  transformation_operations_ex02.py  
-  transformation_operations_ex03.py  
-  transformation_operations_ex04.py  
-  transformation_operations_ex05.py  
-  transformation_operations_ex06.py  
-  transformation_operations_ex07.py  
-  transformation_operations_ex08.py  
-  transformation_operations_ex09.py  
-  transformation_operations_ex10.py  
-  transformation_operations_ex11.py  
-  transformation_operations_ex12.py  
-  transformation_operations_ex13.py  
-  viewing_geom_objs_ex01.py  
-  viewing_geom_objs_ex02.py  
-  viewing_geom_objs_ex03.py  
-  viewing_geom_objs_ex04.py  
-  whatis.py  
-  working_with_groups_ex01.py  
-  working_with_groups_ex02.py  
-  working_with_groups_ex03.py  
-  working_with_groups_ex04.py  
-  working_with_groups_ex05.py  
+  3dsketcher.py
+  advanced_geom_objs_ex01.py
+  advanced_geom_objs_ex02.py
+  advanced_geom_objs_ex03.py
+  angle.py
+  arranging_study_objects.py
+  basic_geom_objs_ex01.py
+  basic_geom_objs_ex02.py
+  basic_geom_objs_ex03.py
+  basic_geom_objs_ex04.py
+  basic_geom_objs_ex05.py
+  basic_geom_objs_ex06.py
+  basic_geom_objs_ex07.py
+  basic_geom_objs_ex08.py
+  basic_geom_objs_ex09.py
+  basic_geom_objs_ex10.py
+  basic_operations_ex01.py
+  basic_operations_ex02.py
+  basic_operations_ex03.py
+  basic_operations_ex04.py
+  basic_properties.py
+  blocks_operations_ex01.py
+  blocks_operations_ex02.py
+  blocks_operations_ex03.py
+  boolean_operations_ex01.py
+  boolean_operations_ex02.py
+  boolean_operations_ex03.py
+  boolean_operations_ex04.py
+  bounding_box.py
+  building_by_blocks_ex01.py
+  building_by_blocks_ex02.py
+  center_of_mass.py
+  check_compound_of_blocks.py
+  check_self_intersections.py
+  check_shape.py
+  complex_objs_ex01.py
+  complex_objs_ex02.py
+  complex_objs_ex03.py
+  complex_objs_ex04.py
+  complex_objs_ex05.py
+  complex_objs_ex06.py
+  complex_objs_ex07.py
+  complex_objs_ex08.py
+  complex_objs_ex09.py
+  complex_objs_ex10.py
+  complex_objs_ex11.py
+  fast_intersection.py
+  free_boundaries.py
+  free_faces.py
+  GEOM_box.py
+  get_non_blocks.py
+  import_export.py
+  inertia.py
+  min_distance.py
+  normal_face.py
+  notebook_geom.py
+  polyline.py
+  point_coordinates.py
+  primitives_ex01.py
+  primitives_ex02.py
+  primitives_ex03.py
+  primitives_ex04.py
+  primitives_ex05.py
+  primitives_ex06.py
+  primitives_ex07.py
+  repairing_operations_ex01.py
+  repairing_operations_ex02.py
+  repairing_operations_ex03.py
+  repairing_operations_ex04.py
+  repairing_operations_ex05.py
+  repairing_operations_ex06.py
+  repairing_operations_ex07.py
+  repairing_operations_ex08.py
+  repairing_operations_ex10.py
+  repairing_operations_ex11.py
+  repairing_operations_ex12.py
+  sketcher.py
+  tolerance.py
+  topological_geom_objs_ex01.py
+  topological_geom_objs_ex02.py
+  topological_geom_objs_ex03.py
+  topological_geom_objs_ex04.py
+  topological_geom_objs_ex05.py
+  topological_geom_objs_ex06.py
+  transformation_operations_ex01.py
+  transformation_operations_ex02.py
+  transformation_operations_ex03.py
+  transformation_operations_ex04.py
+  transformation_operations_ex05.py
+  transformation_operations_ex06.py
+  transformation_operations_ex07.py
+  transformation_operations_ex08.py
+  transformation_operations_ex09.py
+  transformation_operations_ex10.py
+  transformation_operations_ex11.py
+  transformation_operations_ex12.py
+  transformation_operations_ex13.py
+  transformation_operations_ex14.py
+  viewing_geom_objs_ex01.py
+  viewing_geom_objs_ex02.py
+  viewing_geom_objs_ex03.py
+  viewing_geom_objs_ex04.py
+  whatis.py
+  working_with_groups_ex01.py
+  working_with_groups_ex02.py
+  working_with_groups_ex03.py
+  working_with_groups_ex04.py
+  working_with_groups_ex05.py
   working_with_groups_ex06.py
 )
+IF(CAS_VERSION_STR VERSION_GREATER "6.9.0")
+  LIST(APPEND GOOD_TESTS
+    check_self_intersections_fast.py
+  )
+ENDIF()
 
 SET(EXAMPLES_TESTS ${BAD_TESTS} ${GOOD_TESTS} testme.py)
 
@@ -133,10 +144,19 @@ SALOME_GENERATE_TESTS_ENVIRONMENT(tests_env)
 
 FOREACH(test ${GOOD_TESTS})
   GET_FILENAME_COMPONENT(testname ${test} NAME_WE)
-  ADD_TEST(NAME ${testname} 
+  ADD_TEST(NAME ${testname}
            COMMAND ${PYTHON_EXECUTABLE} -B ${CMAKE_SOURCE_DIR}/doc/salome/examples/testme.py ${CMAKE_CURRENT_SOURCE_DIR}/${test})
-  SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}")                   
+  SET_TESTS_PROPERTIES(${testname} PROPERTIES ENVIRONMENT "${tests_env}")
 ENDFOREACH()
 
 # install Python scripts
 SALOME_INSTALL_SCRIPTS("${EXAMPLES_TESTS}" ${SALOME_INSTALL_DOC}/examples/GEOM)
+
+# Application tests
+
+SET(TEST_INSTALL_DIRECTORY ${SALOME_INSTALL_SCRIPT_SCRIPTS}/test)
+INSTALL(FILES ${GOOD_TESTS} DESTINATION ${TEST_INSTALL_DIRECTORY})
+
+INSTALL(FILES CTestTestfileInstall.cmake
+        DESTINATION ${TEST_INSTALL_DIRECTORY}
+        RENAME CTestTestfile.cmake)
diff --git a/doc/salome/examples/CTestTestfileInstall.cmake b/doc/salome/examples/CTestTestfileInstall.cmake
new file mode 100644 (file)
index 0000000..9781ca5
--- /dev/null
@@ -0,0 +1,141 @@
+# Copyright (C) 2015  CEA/DEN, 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
+#
+
+SET(SALOME_TEST_DRIVER "$ENV{ABSOLUTE_APPLI_PATH}/bin/salome/appliskel/salome_test_driver.py")
+SET(COMPONENT_NAME GEOM)
+SET(TIMEOUT        300)
+
+SET(GOOD_TESTS
+  3dsketcher
+  advanced_geom_objs_ex01
+  advanced_geom_objs_ex02
+  advanced_geom_objs_ex03
+  angle
+  arranging_study_objects
+  basic_geom_objs_ex01
+  basic_geom_objs_ex02
+  basic_geom_objs_ex03
+  basic_geom_objs_ex04
+  basic_geom_objs_ex05
+  basic_geom_objs_ex06
+  basic_geom_objs_ex07
+  basic_geom_objs_ex08
+  basic_geom_objs_ex09
+  basic_geom_objs_ex10
+  basic_operations_ex01
+  basic_operations_ex02
+  basic_operations_ex03
+  basic_operations_ex04
+  basic_properties
+  blocks_operations_ex01
+  blocks_operations_ex02
+  blocks_operations_ex03
+  boolean_operations_ex01
+  boolean_operations_ex02
+  boolean_operations_ex03
+  boolean_operations_ex04
+  bounding_box
+  building_by_blocks_ex01
+  building_by_blocks_ex02
+  center_of_mass
+  check_compound_of_blocks
+  check_self_intersections
+  check_shape
+  complex_objs_ex01
+  complex_objs_ex02
+  complex_objs_ex03
+  complex_objs_ex04
+  complex_objs_ex05
+  complex_objs_ex06
+  complex_objs_ex07
+  complex_objs_ex08
+  complex_objs_ex09
+  complex_objs_ex10
+  complex_objs_ex11
+  free_boundaries
+  free_faces
+  GEOM_box
+  get_non_blocks
+  import_export
+  inertia
+  min_distance
+  normal_face
+  notebook_geom
+  polyline
+  point_coordinates
+  primitives_ex01
+  primitives_ex02
+  primitives_ex03
+  primitives_ex04
+  primitives_ex05
+  primitives_ex06
+  primitives_ex07
+  repairing_operations_ex01
+  repairing_operations_ex02
+  repairing_operations_ex03
+  repairing_operations_ex04
+  repairing_operations_ex05
+  repairing_operations_ex06
+  repairing_operations_ex07
+  repairing_operations_ex08
+  repairing_operations_ex10
+  repairing_operations_ex11
+  repairing_operations_ex12
+  sketcher
+  tolerance
+  topological_geom_objs_ex01
+  topological_geom_objs_ex02
+  topological_geom_objs_ex03
+  topological_geom_objs_ex04
+  topological_geom_objs_ex05
+  topological_geom_objs_ex06
+  transformation_operations_ex01
+  transformation_operations_ex02
+  transformation_operations_ex03
+  transformation_operations_ex04
+  transformation_operations_ex05
+  transformation_operations_ex06
+  transformation_operations_ex07
+  transformation_operations_ex08
+  transformation_operations_ex09
+  transformation_operations_ex10
+  transformation_operations_ex11
+  transformation_operations_ex12
+  transformation_operations_ex13
+  transformation_operations_ex14
+  viewing_geom_objs_ex01
+  viewing_geom_objs_ex02
+  viewing_geom_objs_ex03
+  viewing_geom_objs_ex04
+  whatis
+  working_with_groups_ex01
+  working_with_groups_ex02
+  working_with_groups_ex03
+  working_with_groups_ex04
+  working_with_groups_ex05
+  working_with_groups_ex06
+)
+# CAS_VERSION > "6.8.0"
+LIST(APPEND GOOD_TESTS fast_intersection)
+
+FOREACH(tfile ${GOOD_TESTS})
+  SET(TEST_NAME GEOM_${tfile})
+  ADD_TEST(${TEST_NAME} python ${SALOME_TEST_DRIVER} ${TIMEOUT} ${tfile}.py)
+  SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES LABELS "${COMPONENT_NAME}")
+ENDFOREACH()
diff --git a/doc/salome/examples/basic_geom_objs_ex10.py b/doc/salome/examples/basic_geom_objs_ex10.py
new file mode 100644 (file)
index 0000000..f9f7f01
--- /dev/null
@@ -0,0 +1,37 @@
+# Creation of a Surface From Face
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+import math
+import SALOMEDS
+
+# Create Vertices, Edges, Wire, Face and Disk
+Vertex_1 = geompy.MakeVertex(0,    0, 0)
+Vertex_2 = geompy.MakeVertex(100,  0, 0)
+Vertex_3 = geompy.MakeVertex(50, 100, 0)
+Edge_1   = geompy.MakeEdge(Vertex_1, Vertex_2)
+Edge_2   = geompy.MakeEdge(Vertex_2, Vertex_3)
+Edge_3   = geompy.MakeEdge(Vertex_3, Vertex_1)
+Wire_1   = geompy.MakeWire([Edge_1, Edge_2, Edge_3])
+Face_1   = geompy.MakeFace(Wire_1, True)
+Disk_1   = geompy.MakeDiskR(100, 1)
+
+# Create Surfaces From Faces.
+SurfaceFromFace_1 = geompy.MakeSurfaceFromFace(Face_1)
+SurfaceFromFace_2 = geompy.MakeSurfaceFromFace(Disk_1)
+
+#Add created object to study
+geompy.addToStudy( Vertex_1,          "Vertex_1" )
+geompy.addToStudy( Vertex_2,          "Vertex_2" )
+geompy.addToStudy( Vertex_3,          "Vertex_3" )
+geompy.addToStudy( Edge_1,            "Edge_1" )
+geompy.addToStudy( Edge_2,            "Edge_2" )
+geompy.addToStudy( Edge_3,            "Edge_3" )
+geompy.addToStudy( Wire_1,            "Wire_1" )
+geompy.addToStudy( Face_1,            "Face_1" )
+geompy.addToStudy( Disk_1,            "Disk_1" )
+geompy.addToStudy( SurfaceFromFace_1, "SurfaceFromFace_1" )
+geompy.addToStudy( SurfaceFromFace_2, "SurfaceFromFace_2" )
index b9152729ff311f479df8e384abcbbdf7ca563d7e..912c8eb034c4fa2d3e6f9121e5689a1caff09b4f 100644 (file)
@@ -22,23 +22,17 @@ box = geompy.MakeBoxTwoPnt(p0, p200)
 trimsize  = 500.
 plane = geompy.MakePlane(pz, vxyz, trimsize)
 
-# create partition objects
-partition1 = geompy.MakePartition([box], [plane])
-partition2 = geompy.Partition([box], [plane])
-partition3 = geompy.MakeHalfPartition(box, plane)
+# create partition
+partition = geompy.MakePartition([box], [plane])
 
 # add objects in the study
 id_box = geompy.addToStudy(box,"Box")
 id_plane = geompy.addToStudy(plane,"Plane")
-id_partition1 = geompy.addToStudy(partition1,"MakePartition")
-id_partition2 = geompy.addToStudy(partition2,"Partition")
-id_partition3 = geompy.addToStudy(partition3,"MakeHalfPartition")
+id_partition = geompy.addToStudy(partition,"Partition")
 
 # display the partition objects and the plane
 gg.createAndDisplayGO(id_box)
 gg.setDisplayMode(id_box,1)
 gg.createAndDisplayGO(id_plane)
 gg.setDisplayMode(id_plane,1)
-gg.createAndDisplayGO(id_partition1)
-gg.createAndDisplayGO(id_partition2)
-gg.createAndDisplayGO(id_partition3)
+gg.createAndDisplayGO(id_partition)
diff --git a/doc/salome/examples/basic_operations_ex04.py b/doc/salome/examples/basic_operations_ex04.py
new file mode 100644 (file)
index 0000000..287ce39
--- /dev/null
@@ -0,0 +1,40 @@
+# Get shared sub-shapes
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+import SALOMEDS
+
+# create a box and partigion it by two planes
+box = geompy.MakeBoxDXDYDZ(200, 200, 200)
+p = geompy.MakeVertex(100, 100, 100)
+v1 = geompy.MakeVectorDXDYDZ(1, 1, 0)
+v2 = geompy.MakeVectorDXDYDZ(1, -1, 0)
+pln1 = geompy.MakePlane(p, v1, 2000)
+pln2 = geompy.MakePlane(p, v2, 2000)
+partition = geompy.MakePartition([box], [pln1, pln2])
+
+# extract solids from result of partition
+solids = geompy.SubShapeAllSorted(partition, geompy.ShapeType['SOLID'])
+
+# get shared shapes from the partition (compound of 4 solids)
+# a) faces that are shared by all 4 solids (0 found)
+pF_T = geompy.GetSharedShapesMulti(partition, geompy.ShapeType['FACE'])
+# b) faces that are shared by any couple of solids (4 found)
+pF_F = geompy.GetSharedShapesMulti(partition, geompy.ShapeType['FACE'], False)
+# c) edges that are shared by all 4 solids (1 found)
+pE_T = geompy.GetSharedShapesMulti(partition, geompy.ShapeType['EDGE'])
+# d) edges that are shared by any couple of solids (13 found)
+pE_F = geompy.GetSharedShapesMulti(partition, geompy.ShapeType['EDGE'], False)
+
+# get shared shapes from the list of solids
+# a) faces that are shared by all 4 solids (0 found)
+sF_T = geompy.GetSharedShapesMulti(solids, geompy.ShapeType['FACE'])
+# b) faces that are shared by 1st/2nd, 1st/3rd and 1st/4th solids (2 found)
+sF_F = geompy.GetSharedShapesMulti(solids, geompy.ShapeType['FACE'], False)
+# c) edges that are shared by all 4 solids (1 found)
+sE_T = geompy.GetSharedShapesMulti(solids, geompy.ShapeType['EDGE'])
+# d) edges that are shared by 1st/2nd, 1st/3rd and 1st/4th solids (7 found)
+sE_F = geompy.GetSharedShapesMulti(solids, geompy.ShapeType['EDGE'], False)
index 8df91b9fe480015bbb1a8c30063db2dd3a2904f3..f70a545408742406726db20a2cda0181fba96cc9 100644 (file)
@@ -7,9 +7,15 @@ from salome.geom import geomBuilder
 geompy = geomBuilder.New(salome.myStudy)
 
 # create a box
-box = geompy.MakeBoxDXDYDZ(100,30,100)
-IsValid = geompy.CheckSelfIntersections(box)
-if IsValid == 0:
-    raise RuntimeError, "Box with self-intersections created"
+box = geompy.MakeBoxDXDYDZ(100,100,100)
+# create a cylinder
+cylinder = geompy.MakeCylinderRH(100, 300)
+# make a compound
+compound = geompy.MakeCompound([box, cylinder])
+
+# check self-intersection
+IsValid = geompy.CheckSelfIntersections(compound)
+if not IsValid:
+    print "Shape is self-intersected!"
 else:
-    print "\nBox is valid"
+    print "No self-intersection detected in a shape"
diff --git a/doc/salome/examples/check_self_intersections_fast.py b/doc/salome/examples/check_self_intersections_fast.py
new file mode 100644 (file)
index 0000000..83c8a74
--- /dev/null
@@ -0,0 +1,21 @@
+# Detect Self-intersections fast
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+# create a box
+box = geompy.MakeBoxDXDYDZ(100,100,100)
+# create a cylinder
+cylinder = geompy.MakeCylinderRH(100, 300)
+# make a compound
+compound = geompy.MakeCompound([box, cylinder])
+
+# check self-intersection
+IsValid = geompy.CheckSelfIntersectionsFast(compound)
+if not IsValid:
+    print "Shape is self-intersected!"
+else:
+    print "No self-intersection detected in a shape"
index a0e72896798f7dcf8fff52a9a0111d5808ce69e0..f10f31c8a44f91e9e6e4bfcf958c364202174a79 100644 (file)
@@ -10,7 +10,7 @@ geompy = geomBuilder.New(salome.myStudy)
 box = geompy.MakeBoxDXDYDZ(100,30,100)
 (IsValid, err) = geompy.CheckShape(box, 0, 2)
 if IsValid == 0:
-    geompy.PrintShapeError(box, err)
+    geompy.PrintShapeErrors(box, err)
     raise RuntimeError, "Invalid box created"
 else:
     print "\nBox is valid"
index 35ccf08579f728bd45941d9c4d03ca851b9efeb9..0c56c81e8bb5c352c312ce992393653e1462c1c5 100644 (file)
@@ -20,14 +20,12 @@ p3 = geompy.MakeVertex(  -30.,  -30.,  10.)
 
 # create an arc from three points
 arc = geompy.MakeArc(p1, p2, p3)
-ShapeListCompound = []
-i = 0
-while i <= 3 :
+ContoursList = []
+for i in range(4):
     S = geompy.MakeTranslation(arc, i * 50., 0., 0.)
-    ShapeListCompound.append(S)
-    i = i + 1
+    ContoursList.append(S)
 
-compound = geompy.MakeCompound(ShapeListCompound)
+compound = geompy.MakeCompound(ContoursList)
 
 # create a filling
 filling = geompy.MakeFilling(compound, mindeg, maxdeg, tol3d, tol2d, nbiter)
index f38f0816b6feeb868b48d8a04ebf56203813a155..f6681b587c798827bfd27ca6722e22db4fba2c3c 100644 (file)
@@ -18,18 +18,22 @@ circles.append(geompy.MakeCircle(vertices[1], edges[0], 40))
 circles.append(geompy.MakeCircle(vertices[2], edges[2], 30))
 circles.append(geompy.MakeCircle(vertices[3], edges[2], 20))
 
-# create pipe
-Pipe = geompy.MakePipeWithDifferentSections(circles, vertices, Wire_1, 0, 0)
+# create pipes
+Pipe1 = geompy.MakePipeWithDifferentSections(circles, vertices, Wire_1, 0, 0)
+Pipe2 = geompy.MakePipeWithDifferentSectionsBySteps(circles, vertices, Wire_1)
 
 # add objects in the study
 geompy.addToStudy(circles[0], "circles1")
 geompy.addToStudy(circles[1], "circles2")
 geompy.addToStudy(circles[2], "circles3")
 geompy.addToStudy(circles[3], "circles4")
-id_wire = geompy.addToStudy(Wire_1, "Path")
-id_pipe = geompy.addToStudy(Pipe, "Pipe")
+id_wire  = geompy.addToStudy(Wire_1, "Path")
+id_pipe1 = geompy.addToStudy(Pipe1, "Pipe1")
+id_pipe2 = geompy.addToStudy(Pipe2, "Pipe2")
 
 # display the wire(path) and the pipe
 gg.createAndDisplayGO(id_wire)
-gg.createAndDisplayGO(id_pipe)
-gg.setDisplayMode(id_pipe,1) 
+gg.createAndDisplayGO(id_pipe1)
+gg.createAndDisplayGO(id_pipe2)
+gg.setDisplayMode(id_pipe1,1)
+gg.setDisplayMode(id_pipe2,1)
diff --git a/doc/salome/examples/complex_objs_ex11.py b/doc/salome/examples/complex_objs_ex11.py
new file mode 100755 (executable)
index 0000000..6324233
--- /dev/null
@@ -0,0 +1,39 @@
+# Apply thickness for shell
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+gg = salome.ImportComponentGUI("GEOM")
+
+# create box
+box = geompy.MakeBoxDXDYDZ(100, 100, 100)
+
+# get the list of faces
+faces = geompy.SubShapeAllSortedCentres(box, geompy.ShapeType["FACE"])
+
+# get the list of face IDs
+faceIDs = geompy.SubShapeAllSortedCentresIDs(box, geompy.ShapeType["FACE"])
+
+# make a shell from 3 faces
+shell = geompy.MakeShell([faces[0], faces[1], faces[2]])
+
+# apply thickness
+solid = geompy.MakeThickSolid(shell, 30.)
+
+# create box
+hsolid = geompy.MakeBoxDXDYDZ(100, 100, 100)
+
+# make hollowed solid
+geompy.Thicken(hsolid, 30., [faceIDs[0], faceIDs[1]])
+
+# add objects in the study
+id_shell  = geompy.addToStudy(shell, "Shell")
+id_solid  = geompy.addToStudy(solid, "Solid")
+id_hsolid = geompy.addToStudy(hsolid, "Hollowed Solid")
+
+# display the shell and the result thicknen solid and hollowed solid
+gg.createAndDisplayGO(id_shell)
+gg.createAndDisplayGO(id_solid)
+gg.createAndDisplayGO(id_hsolid)
diff --git a/doc/salome/examples/fast_intersection.py b/doc/salome/examples/fast_intersection.py
new file mode 100644 (file)
index 0000000..4854a57
--- /dev/null
@@ -0,0 +1,34 @@
+# Fast intersection
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+
+# create a box
+box = geompy.MakeBoxDXDYDZ(100,100,100)
+# create a cylinder
+cylinder = geompy.MakeCylinderRH(100, 300)
+
+isOk, res1, res2 = geompy.FastIntersect(box, cylinder)
+if isOk == 0:
+    raise RuntimeError, "No intersection!"
+else:
+    print "\nTwo lists of indexes of sub-shapes localize the intersection:"
+    print res1, res2
+
+# create two boxes with gap
+Ver1 = geompy.MakeVertex(0, 0, 0)
+Ver2 = geompy.MakeVertex(100, 100, 100)
+Ver3 = geompy.MakeVertex(100.1, 0, 0)
+Ver4 = geompy.MakeVertex(200, 200, 200)
+box1 = geompy.MakeBoxTwoPnt(Ver1, Ver2)
+box2 = geompy.MakeBoxTwoPnt(Ver3, Ver4)
+
+isOk1, aRes1, aRes2 = geompy.FastIntersect(box1, box2, 1.)
+if isOk1 == 0:
+    raise RuntimeError, "No gaps!"
+else:
+    print "\nTwo lists of indexes of sub-shapes localize the gap:"
+    print aRes1, aRes2
index 8935962bf6457a9661054fb74b220aa6382e7f2e..5f6014e740ad0228ce6ee5875fe59167c47b4ea8 100644 (file)
@@ -1,27 +1,26 @@
 # Sewing
 
-import salome
+import salome, math
 salome.salome_init()
-import GEOM
 from salome.geom import geomBuilder
+
 geompy = geomBuilder.New(salome.myStudy)
-import math
-gg = salome.ImportComponentGUI("GEOM")
+gg     = salome.ImportComponentGUI("GEOM")
 
 # create base points
 px = geompy.MakeVertex(100., 0., 0.)
 py = geompy.MakeVertex(0., 100., 0.)
 pz = geompy.MakeVertex(0., 0., 100.)
 
-# create base geometry 2D & 3D
+# create base geometry 2D
 vector = geompy.MakeVector(px, py)
-arc = geompy.MakeArc(py, pz, px)
+arc    = geompy.MakeArc(py, pz, px)
 
 # create base objects
 angle = 45. * math.pi / 180
-WantPlanarFace = 1 #True
-wire = geompy.MakeWire([vector, arc])
-face = geompy.MakeFace(wire, WantPlanarFace)
+WantPlanarFace = True
+wire     = geompy.MakeWire([vector, arc])
+face     = geompy.MakeFace(wire, WantPlanarFace)
 face_rot = geompy.MakeRotation(face, vector, angle)
 
 # make sewing
@@ -29,9 +28,9 @@ precision = 0.00001
 sewing = geompy.MakeSewing([face, face_rot], precision)
 
 # add objects in the study
-id_face = geompy.addToStudy(face, "Face")
+id_face     = geompy.addToStudy(face, "Face")
 id_face_rot = geompy.addToStudy(face_rot, "Face rotation")
-id_sewing = geompy.addToStudy(sewing, "Sewing")
+id_sewing   = geompy.addToStudy(sewing, "Sewing")
 
 # display the results
 gg.createAndDisplayGO(id_face)
@@ -40,3 +39,12 @@ gg.createAndDisplayGO(id_face_rot)
 gg.setDisplayMode(id_face_rot,1)
 gg.createAndDisplayGO(id_sewing)
 gg.setDisplayMode(id_sewing,1) 
+
+
+# Example 2: make a shell of a multiply translated face
+quad         = geompy.MakeFaceHW( 10, 20, 1 )
+quadCompound = geompy.MakeMultiTranslation1D( quad, geompy.MakeVectorDXDYDZ(1,0,0), 10, 3)
+shell        = geompy.Sew( quadCompound, 1e-6 )
+
+id_shell = geompy.addToStudy( shell, "3 quads shell")
+gg.createAndDisplayGO(id_shell)
index 898991b4e80931ef5f90ac36ef9a8d12997dab49..6b8e4280eedc67846992c7fa9f69e756d9819feb 100644 (file)
@@ -6,6 +6,8 @@ import GEOM
 from salome.geom import geomBuilder
 geompy = geomBuilder.New(salome.myStudy)
 
+# Variant 1: using DivideEdge()
+
 # create vertices
 p1 = geompy.MakeVertex(0,0,50)
 p2 = geompy.MakeVertex(60,0,50)
@@ -27,4 +29,15 @@ edge_points = geompy.SubShapeAllSortedCentres(divide, geompy.ShapeType["VERTEX"]
 for point in edge_points:
     geompy.addToStudyInFather(divide, point, "Edge's point after divide")
 
+
+# Variant 2: using DivideEdgeByPoint()
+box  = geompy.MakeBox(0,0,0, 10,10,10, theName="box")
+p1   = geompy.MakeVertex( 3, -2, 1, theName="point 1 to project" )
+p2   = geompy.MakeVertex( 7, -2, 1, theName="point 2 to project" )
+edge = geompy.GetEdgeNearPoint( box, p1, theName="edge to split")
+
+div  = geompy.DivideEdgeByPoint( box, edge, [p1, p2], theName="box (edge divided)")
+
+
 salome.sg.updateObjBrowser(1) 
index fd3fcc915debe359eeae143f3add358d5fce1122..3e0e49698afcd901bb360a5fdb35523aea1f55dc 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -24,11 +24,21 @@ import unittest, sys, os
 class SalomeSession(object):
     def __init__(self, script):
         import runSalome
-        sys.argv  = ["runSalome.py"]
+        run_script = "runSalome.py"
+        if sys.platform == 'win32':
+            module_dir = os.getenv("KERNEL_ROOT_DIR")
+            if module_dir: run_script = os.path.join(module_dir, "bin", "salome", run_script)
+            pass
+        sys.argv  = [run_script]
         sys.argv += ["--terminal"]
         sys.argv += ["--modules=GEOM"]
         sys.argv += ["%s" % script]
+        if sys.platform == 'win32':
+            main_module_path = sys.modules['__main__'].__file__
+            sys.modules['__main__'].__file__ = ''
         clt, d = runSalome.main()
+        if sys.platform == 'win32':
+            sys.modules['__main__'].__file__ = main_module_path
         return
 
     def __del__(self):
index db2f060a907c074b888d576fbe387f17a62c0a15..6d9d5d43ff77f369cdd9dd250730e26e313e70f5 100644 (file)
@@ -30,17 +30,29 @@ sketcher2 = geompy.MakeSketcher("Sketcher:F 0 0:TT 70 0:TT 70 70:TT 0 70:WW")
 sketcher3 = geompy.MakeSketcher("Sketcher:F 20 20:TT 50 20:TT 50 50:TT 20 50:WW")
 isPlanarFace = 1
 
+sphere = geompy.MakeSphereR(100)
+box = geompy.MakeBoxDXDYDZ(200, 200, 200)
+cut = geompy.MakeCutList(sphere, [box], True)
+
 # create a face from the wire
 face1 = geompy.MakeFace(wire, isPlanarFace)
 
 # create faces from two wires
 face2 = geompy.MakeFaceWires([wire, sketcher1],isPlanarFace)
 face3 = geompy.MakeFaces([sketcher2, sketcher3],isPlanarFace)
+face4 = geompy.MakeFaceFromSurface(face1, sketcher1)
+
+# create face from edges with constraints
+face5 = geompy.MakeFaceWithConstraints([geompy.GetSubShape(cut, [5]), geompy.GetSubShape(cut, [3]), 
+                                        geompy.GetSubShape(cut, [11]), geompy.GetSubShape(cut, [3]), 
+                                        geompy.GetSubShape(cut, [13]), geompy.GetSubShape(cut, [3])])
 
 # add objects in the study
 id_face1 = geompy.addToStudy(face1,"Face1")
 id_face2 = geompy.addToStudy(face2,"Face2")
 id_face3 = geompy.addToStudy(face3,"Face3")
+id_face4 = geompy.addToStudy(face4,"Face4")
+id_face5 = geompy.addToStudy(face5,"Face5")
 
 # display the faces
 gg.createAndDisplayGO(id_face1)
@@ -52,3 +64,9 @@ gg.setTransparency(id_face2,0.2)
 gg.createAndDisplayGO(id_face3)
 gg.setDisplayMode(id_face3,1)
 gg.setTransparency(id_face3,0.2) 
+gg.createAndDisplayGO(id_face4)
+gg.setDisplayMode(id_face4,1)
+gg.setTransparency(id_face4,0.2)
+gg.createAndDisplayGO(id_face5)
+gg.setDisplayMode(id_face5,1)
+gg.setTransparency(id_face5,0.2)
diff --git a/doc/salome/examples/topological_geom_objs_ex07.py b/doc/salome/examples/topological_geom_objs_ex07.py
new file mode 100644 (file)
index 0000000..f1e646a
--- /dev/null
@@ -0,0 +1,46 @@
+# Creation of a Solid(s) from connected faces
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+gg = salome.ImportComponentGUI("GEOM")
+
+# create a box 
+box = geompy.MakeBoxDXDYDZ(200, 200, 200)
+
+# make a copy of a box translated by X coordinate
+box_translation = geompy.MakeTranslation(box, 200, 0, 0)
+
+# extract shells from boxes
+box_shell = geompy.SubShapeAllSorted(box, geompy.ShapeType["SHELL"])[0]
+box_translation_shell = geompy.SubShapeAllSorted(box_translation, geompy.ShapeType["SHELL"])[0]
+
+# extract faces from boxes 
+box_faces = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])
+box_translation_faces = geompy.SubShapeAllSorted(box_translation, geompy.ShapeType["FACE"])
+
+# create solids from shells
+msf_shells_noint = geompy.MakeSolidFromConnectedFaces([box_shell, box_translation_shell],0)
+msf_shells_int = geompy.MakeSolidFromConnectedFaces([box_shell, box_translation_shell], 1)
+
+# create solids from faces
+msf_faces_noint = geompy.MakeSolidFromConnectedFaces(box_faces+box_translation_faces, 0)
+msf_faces_int = geompy.MakeSolidFromConnectedFaces(box_faces+box_translation_faces, 1)
+
+# add objects in the study
+id_solid_shells_noint = geompy.addToStudy(msf_shells_noint,"Solid_from_shells_no_intersect")
+id_solid_shells_int = geompy.addToStudy(msf_shells_int,"Solid_from_shells_intersect")
+id_solid_faces_noint = geompy.addToStudy(msf_faces_noint,"Solid_from_faces_no_intersect")
+id_solid_faces_int = geompy.addToStudy(msf_faces_int,"Solid_from_faces_intersect")
+
+# display the results
+gg.createAndDisplayGO(id_solid_shells_noint)
+gg.setDisplayMode(id_solid_shells_noint,1) 
+gg.createAndDisplayGO(id_solid_shells_int)
+gg.setDisplayMode(id_solid_shells_int,1) 
+gg.createAndDisplayGO(id_solid_faces_noint)
+gg.setDisplayMode(id_solid_faces_noint,1) 
+gg.createAndDisplayGO(id_solid_faces_int)
+gg.setDisplayMode(id_solid_faces_int,1) 
index 0b324a10158db07ce12184a0502137959e2e07f2..d323cf0b7bd4aa9e8cb5badc529990943c63bc7f 100644 (file)
@@ -2,7 +2,6 @@
 
 import salome
 salome.salome_init()
-import GEOM
 from salome.geom import geomBuilder
 geompy = geomBuilder.New(salome.myStudy)
 
@@ -25,24 +24,33 @@ projection = geompy.MakeProjection(curve, face_cyl)
 # add objects in the study
 geompy.addToStudy(cylinder, "cylinder")
 geompy.addToStudyInFather(cylinder, face_cyl, "face_cyl")
-geompy.addToStudy(p1, "p1")
-geompy.addToStudy(p2, "p2")
-geompy.addToStudy(p3, "p3")
-geompy.addToStudy(p4, "p4")
-geompy.addToStudy(p5, "p5")
 geompy.addToStudy(curve, "curve")
 geompy.addToStudy(projection, "projection")
 
-#projection of point on wire.
+#projection of point on wire
 e1 = geompy.MakeLineTwoPnt(p1, p2)
 e2 = geompy.MakeLineTwoPnt(p2, p3)
 
 w1 = geompy.MakeWire([e1, e2], 1.e-7)
 v1 = geompy.MakeVertex(300, 40, 100)
 
-prj = geompy.MakeProjectionOnWire(v1, w1)
-geompy.addToStudy(e1, "e1")
-geompy.addToStudy(e2, "e2")
+prj = geompy.MakeProjection(v1, w1)
 geompy.addToStudy(w1, "w1")
 geompy.addToStudy(v1, "v1")
-geompy.addToStudy(prj[1], "projOnWire")
+geompy.addToStudy(prj, "projOnWire")
+
+#projection of a wire on cylinder
+pp1 = geompy.MakeVertex(100, 200, 0)
+pp2 = geompy.MakeVertex(100, 200, 80)
+pp3 = geompy.MakeVertex(100, 220, 90)
+pp4 = geompy.MakeVertex(100, 130, 80)
+pp5 = geompy.MakeVertex(100, 90, 80)
+cc1 = geompy.MakeInterpol([pp1, pp2, pp3, pp4, pp5], True, False)
+ww1 = geompy.MakeWire([cc1], 1.e-7)
+vx = geompy.MakeVectorDXDYDZ(100, 0, 0)
+pln1 = geompy.MakePlane(pp1, vx, 200)
+face1 = geompy.MakeFaceFromSurface(pln1, ww1)
+prj_cyl = geompy.MakeProjectionOnCylinder(face1, 100)
+
+geompy.addToStudy(face1, "pln_face")
+geompy.addToStudy(prj_cyl, "projOnCylinder")
diff --git a/doc/salome/examples/transformation_operations_ex14.py b/doc/salome/examples/transformation_operations_ex14.py
new file mode 100644 (file)
index 0000000..e8bc167
--- /dev/null
@@ -0,0 +1,75 @@
+# Extend Edge and Face
+
+import salome
+salome.salome_init()
+import GEOM
+from salome.geom import geomBuilder
+geompy = geomBuilder.New(salome.myStudy)
+gg = salome.ImportComponentGUI("GEOM")
+
+# create vertices
+p1 = geompy.MakeVertex(  0.,     0.,   0.)
+p2 = geompy.MakeVertex(100.,   100.,   0.)
+p3 = geompy.MakeVertex(  0.,   100.,   0.)
+
+# create edges
+edge1 = geompy.MakeEdge(p1, p2)
+edge2 = geompy.MakeCircleR(100)
+
+# create faces
+face1   = geompy.MakePlaneThreePnt(p1, p2, p3, 200)
+sphere1 = geompy.MakeSpherePntR(p1, 100)
+faces2  = geompy.SubShapeAllSorted(sphere1, GEOM.FACE)
+face2   = faces2[0]
+
+# perform edge extension
+resEdge1 = geompy.ExtendEdge(edge1,  0.2,  0.8)
+resEdge2 = geompy.ExtendEdge(edge1, -0.3,  1.3)
+resEdge3 = geompy.ExtendEdge(edge2,  0.5,  1)
+resEdge4 = geompy.ExtendEdge(edge2,  0.2,  0.5)
+
+# perform face extension
+resFace1 = geompy.ExtendFace(face1, 0.2, 0.8, -0.3, 1.3)
+resFace2 = geompy.ExtendFace(face1, 0,   0.5,  1,   2)
+resFace3 = geompy.ExtendFace(face2, 0.2, 0.8,  0.3, 0.7)
+resFace4 = geompy.ExtendFace(face2, 0.5, 1,    0.5, 1)
+
+# add objects in the study
+id_edge1    = geompy.addToStudy(edge1,    "Edge 1")
+id_edge2    = geompy.addToStudy(edge2,    "Edge 2")
+id_face1    = geompy.addToStudy(face1,    "Face 1")
+id_face2    = geompy.addToStudy(face2,    "Face 2")
+id_resEdge1 = geompy.addToStudy(resEdge1, "Extended Edge 1")
+id_resEdge2 = geompy.addToStudy(resEdge2, "Extended Edge 1")
+id_resEdge3 = geompy.addToStudy(resEdge3, "Extended Edge 2")
+id_resEdge4 = geompy.addToStudy(resEdge4, "Extended Edge 3")
+id_resFace1 = geompy.addToStudy(resFace1, "Extended Face 1")
+id_resFace2 = geompy.addToStudy(resFace2, "Extended Face 2")
+id_resFace3 = geompy.addToStudy(resFace3, "Extended Face 3")
+id_resFace4 = geompy.addToStudy(resFace4, "Extended Face 4")
+
+# display the prism and the results of chamfer operation
+gg.createAndDisplayGO(id_edge1)
+gg.setDisplayMode(id_edge1, 1)
+gg.createAndDisplayGO(id_edge2)
+gg.setDisplayMode(id_edge2, 1)
+gg.createAndDisplayGO(id_face1)
+gg.setDisplayMode(id_face1, 1)
+gg.createAndDisplayGO(id_face2)
+gg.setDisplayMode(id_face2, 1)
+gg.createAndDisplayGO(id_resEdge1)
+gg.setDisplayMode(id_resEdge1, 1) 
+gg.createAndDisplayGO(id_resEdge2)
+gg.setDisplayMode(id_resEdge2, 1)
+gg.createAndDisplayGO(id_resEdge3)
+gg.setDisplayMode(id_resEdge3, 1)
+gg.createAndDisplayGO(id_resEdge4)
+gg.setDisplayMode(id_resEdge4, 1)
+gg.createAndDisplayGO(id_resFace1)
+gg.setDisplayMode(id_resFace1, 1)
+gg.createAndDisplayGO(id_resFace2)
+gg.setDisplayMode(id_resFace2, 1) 
+gg.createAndDisplayGO(id_resFace3)
+gg.setDisplayMode(id_resFace3, 1)
+gg.createAndDisplayGO(id_resFace4)
+gg.setDisplayMode(id_resFace4, 1) 
index 17387b7247c37a9710f31c3b3957dd1fd586d912..b5935764b0985b5d43aed3f49f81a5adc365945a 100644 (file)
@@ -17,3 +17,4 @@ gg.createAndDisplayGO(fuse_id)
 gg.setDisplayMode(fuse_id,1)
 gg.setVectorsMode(fuse_id, 1)
 gg.setVerticesMode(fuse_id, 1)
+gg.setNameMode(fuse_id, 1)
index bdca86fac76ce3a915c0c42e7c803962f111d219..38115b88bceb7eccfb135cc6f891a99c63722c62 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 3584bc193e58f2a779c99e130589a12496f5e1e0..f7877081bb7c66753d436f6c24e38d52c5e160b4 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 482f5f3fd199b7c051270c650d0057df5381e29e..2f489aefb3be3851e0ea20f20b148ea680525640 100644 (file)
@@ -1,6 +1,6 @@
 #!/usr/bin/env python
 #  -*- coding: utf-8 -*-
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -117,16 +117,22 @@ if __name__ == "__main__":
     if len( args ) < 1: sys.exit("Plugin name is not specified")
 
     f = open(options.output, "w")
-    
+
+    if len(args) > 1:
+        plugins_names = " ".join(args) + " plugins"
+    elif len(args) == 1:
+        plugins_names = args[0] + " plugin"
+    else:
+        plugins_names = ""
     output = []
     if options.dummygeomhelp:
         output.append( "## @package geomBuilder" )
-        output.append( "#  Documentation of the methods dynamically added by the " + plugin_name + " Geometry plug-in to the geomBuilder class." )
+        output.append( "#  Documentation of the methods dynamically added by the " + plugins_names + " to the @b %geomBuilder class." )
         # Add dummy Geometry help
         # This is supposed to be done when generating documentation for Geometry module plug-ins
         output.append( "#  @note The documentation below does not provide complete description of class @b %geomBuilder" )
         output.append( "#  from @b geomBuilder package. This documentation provides only information about" )
-        output.append( "#  the methods dynamically added to the %geomBuilder class by the " + plugin_name + " plugin" )
+        output.append( "#  the methods dynamically added to the %geomBuilder class by the " + plugins_names + "." )
         output.append( "#  For more details on the %geomBuilder class, please refer to the SALOME %Geometry module" )
         output.append( "#  documentation." )
         pass
index 89db026a97ca5e025b3acc469d624f4e074acb8a..5ab087422dca27ea7c4224ca850591d038351ce9 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index f3ad682982f28dd733ae9247788e3a57c2ffc74e..c6532adc198db6d8008970532598be09b0f95466 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 763be7e34d3f8f8e22f9aab45684eec1b5506c70..7b2bb95092acf8eb3cc5c151a632f0097ef43503 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
diff --git a/doc/salome/gui/GEOM/images/divedgebypoint.png b/doc/salome/gui/GEOM/images/divedgebypoint.png
new file mode 100644 (file)
index 0000000..4258a16
Binary files /dev/null and b/doc/salome/gui/GEOM/images/divedgebypoint.png differ
index d0a3c314b7cc10e2d0579a82beb39457e11a1d95..4501fa61ff4701073ab349387730f3f9ec365f1d 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/editgroup.png and b/doc/salome/gui/GEOM/images/editgroup.png differ
diff --git a/doc/salome/gui/GEOM/images/extend_edge_example.png b/doc/salome/gui/GEOM/images/extend_edge_example.png
new file mode 100644 (file)
index 0000000..f8a88e9
Binary files /dev/null and b/doc/salome/gui/GEOM/images/extend_edge_example.png differ
diff --git a/doc/salome/gui/GEOM/images/extend_face_example.png b/doc/salome/gui/GEOM/images/extend_face_example.png
new file mode 100644 (file)
index 0000000..26281f1
Binary files /dev/null and b/doc/salome/gui/GEOM/images/extend_face_example.png differ
diff --git a/doc/salome/gui/GEOM/images/extension1.png b/doc/salome/gui/GEOM/images/extension1.png
new file mode 100644 (file)
index 0000000..419d44e
Binary files /dev/null and b/doc/salome/gui/GEOM/images/extension1.png differ
diff --git a/doc/salome/gui/GEOM/images/extension2.png b/doc/salome/gui/GEOM/images/extension2.png
new file mode 100644 (file)
index 0000000..e4ac66a
Binary files /dev/null and b/doc/salome/gui/GEOM/images/extension2.png differ
old mode 100755 (executable)
new mode 100644 (file)
index 2efb1c8..9235f7a
Binary files a/doc/salome/gui/GEOM/images/filling.png and b/doc/salome/gui/GEOM/images/filling.png differ
diff --git a/doc/salome/gui/GEOM/images/flat_contents.png b/doc/salome/gui/GEOM/images/flat_contents.png
new file mode 100644 (file)
index 0000000..7b5d385
Binary files /dev/null and b/doc/salome/gui/GEOM/images/flat_contents.png differ
diff --git a/doc/salome/gui/GEOM/images/gen_group_disabled.png b/doc/salome/gui/GEOM/images/gen_group_disabled.png
new file mode 100644 (file)
index 0000000..7c97c85
Binary files /dev/null and b/doc/salome/gui/GEOM/images/gen_group_disabled.png differ
diff --git a/doc/salome/gui/GEOM/images/gen_group_dlg.png b/doc/salome/gui/GEOM/images/gen_group_dlg.png
new file mode 100644 (file)
index 0000000..e70e6e2
Binary files /dev/null and b/doc/salome/gui/GEOM/images/gen_group_dlg.png differ
diff --git a/doc/salome/gui/GEOM/images/gen_group_other.png b/doc/salome/gui/GEOM/images/gen_group_other.png
new file mode 100644 (file)
index 0000000..7761066
Binary files /dev/null and b/doc/salome/gui/GEOM/images/gen_group_other.png differ
diff --git a/doc/salome/gui/GEOM/images/gen_group_sides.png b/doc/salome/gui/GEOM/images/gen_group_sides.png
new file mode 100644 (file)
index 0000000..cdf0207
Binary files /dev/null and b/doc/salome/gui/GEOM/images/gen_group_sides.png differ
diff --git a/doc/salome/gui/GEOM/images/gen_group_tree.png b/doc/salome/gui/GEOM/images/gen_group_tree.png
new file mode 100644 (file)
index 0000000..71e7e93
Binary files /dev/null and b/doc/salome/gui/GEOM/images/gen_group_tree.png differ
index b74b00dfbb48dbfb206df831565e7cc3ed66421b..c982f0bc93886bc8de8acdf5d47824c77bc3c99b 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/geomcreategroup.png and b/doc/salome/gui/GEOM/images/geomcreategroup.png differ
index 48a40d6e12dba544f84f52456889c39a6ec60f70..33f8fad0e94b17ead54285148e5ffe2e881d17c8 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/glue1.png and b/doc/salome/gui/GEOM/images/glue1.png differ
index 2df8a68b4d57f1c4f99fa8d0eeb4c6bab818923c..001224ebfcf4361d7c727b2fbcfcd22124baff58 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/glue2.png and b/doc/salome/gui/GEOM/images/glue2.png differ
index de80520b99a01390078bacff525d76bc37212cb0..598fff5aa5b9e8ee98058adbeaeb1049e01ef676 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/glue3.png and b/doc/salome/gui/GEOM/images/glue3.png differ
index 32e07ec223ee2231d29903da73c83e4e42af5c1e..7fbbb0eb0c1518d8f00027dab01f62d0e9bc43ec 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/glue4.png and b/doc/salome/gui/GEOM/images/glue4.png differ
index 3a9a266e23e22d21cc2310384e4673c100c35a3d..c24a0f42c2ba865da6c62aa931d72c5f5fb5341b 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/glue5.png and b/doc/salome/gui/GEOM/images/glue5.png differ
index a365ca2c402bae3b25d9de7dc389fa4faf889f62..c3a58eaefaf733880bb518f0af5f23eaf7dc9e84 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/glue7.png and b/doc/salome/gui/GEOM/images/glue7.png differ
index 20e3aec7dcbbadc44cc75d58fc9182debaec018f..e248988c42c8acc491aa9137c11cc8d2d9de939d 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/glue8.png and b/doc/salome/gui/GEOM/images/glue8.png differ
diff --git a/doc/salome/gui/GEOM/images/inspect_object.png b/doc/salome/gui/GEOM/images/inspect_object.png
new file mode 100644 (file)
index 0000000..23065bd
Binary files /dev/null and b/doc/salome/gui/GEOM/images/inspect_object.png differ
diff --git a/doc/salome/gui/GEOM/images/inspect_object2.png b/doc/salome/gui/GEOM/images/inspect_object2.png
new file mode 100644 (file)
index 0000000..121e152
Binary files /dev/null and b/doc/salome/gui/GEOM/images/inspect_object2.png differ
old mode 100755 (executable)
new mode 100644 (file)
index 091b2c0..7a05b55
Binary files a/doc/salome/gui/GEOM/images/measures10.png and b/doc/salome/gui/GEOM/images/measures10.png differ
index 85af6f187502f209f551313aaf1f40888065dd65..562714d31227c690518d3a8011b2e264e248096d 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/measures11.png and b/doc/salome/gui/GEOM/images/measures11.png differ
diff --git a/doc/salome/gui/GEOM/images/measures12.png b/doc/salome/gui/GEOM/images/measures12.png
new file mode 100644 (file)
index 0000000..0dba542
Binary files /dev/null and b/doc/salome/gui/GEOM/images/measures12.png differ
diff --git a/doc/salome/gui/GEOM/images/measures13.png b/doc/salome/gui/GEOM/images/measures13.png
new file mode 100644 (file)
index 0000000..6e9deb5
Binary files /dev/null and b/doc/salome/gui/GEOM/images/measures13.png differ
index 21e5218a40ea5f27255b8b25ccf88bde62af74ef..a9e064b5e852679d46b4477b1f71e6770a487c9e 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/measures2.png and b/doc/salome/gui/GEOM/images/measures2.png differ
index 3068f49b196e2092a190ac13b284bb72b49b41bd..718c60f9044d47e8b0ccb09697c44ee201867b63 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/measures2a.png and b/doc/salome/gui/GEOM/images/measures2a.png differ
diff --git a/doc/salome/gui/GEOM/images/name_mode.png b/doc/salome/gui/GEOM/images/name_mode.png
new file mode 100644 (file)
index 0000000..cdac11e
Binary files /dev/null and b/doc/salome/gui/GEOM/images/name_mode.png differ
old mode 100755 (executable)
new mode 100644 (file)
index 273d000..20608c4
Binary files a/doc/salome/gui/GEOM/images/neo-detect2.png and b/doc/salome/gui/GEOM/images/neo-detect2.png differ
index df078a1fef32fcb7cffc628472dae353679a5524..438c6339bf7e3fa068256ff7cb0ebafc2aade0fd 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/neo-obj1.png and b/doc/salome/gui/GEOM/images/neo-obj1.png differ
index 283601c26391ac4979958f6ecd55682ea60353a9..63ce57d1d2d2949500432f3718d7ce558f851f21 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/neo-obj4.png and b/doc/salome/gui/GEOM/images/neo-obj4.png differ
diff --git a/doc/salome/gui/GEOM/images/neo-obj4_2.png b/doc/salome/gui/GEOM/images/neo-obj4_2.png
new file mode 100644 (file)
index 0000000..07f3a9d
Binary files /dev/null and b/doc/salome/gui/GEOM/images/neo-obj4_2.png differ
diff --git a/doc/salome/gui/GEOM/images/neo-obj4_3.png b/doc/salome/gui/GEOM/images/neo-obj4_3.png
new file mode 100644 (file)
index 0000000..f819ed4
Binary files /dev/null and b/doc/salome/gui/GEOM/images/neo-obj4_3.png differ
old mode 100755 (executable)
new mode 100644 (file)
index fd8af08..9a38eda
Binary files a/doc/salome/gui/GEOM/images/neo-obj6.png and b/doc/salome/gui/GEOM/images/neo-obj6.png differ
diff --git a/doc/salome/gui/GEOM/images/neo-obj6_2.png b/doc/salome/gui/GEOM/images/neo-obj6_2.png
new file mode 100644 (file)
index 0000000..0906712
Binary files /dev/null and b/doc/salome/gui/GEOM/images/neo-obj6_2.png differ
index 0bc1a14f97368403bec300a01134886d10fe77a1..137bdebf5a1e956cf5af3ca71ac34c62f2863bf6 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/neo-section.png and b/doc/salome/gui/GEOM/images/neo-section.png differ
index f2213999edf79abe010479e7d030be8565138185..595c0ab04c054af1a8b7a354b1c689ed098e4be4 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/partition1.png and b/doc/salome/gui/GEOM/images/partition1.png differ
old mode 100755 (executable)
new mode 100644 (file)
index c1b77a9..a02cc34
Binary files a/doc/salome/gui/GEOM/images/pipe.png and b/doc/salome/gui/GEOM/images/pipe.png differ
old mode 100755 (executable)
new mode 100644 (file)
index a94f293..d66407f
Binary files a/doc/salome/gui/GEOM/images/pipe2.png and b/doc/salome/gui/GEOM/images/pipe2.png differ
index c531ad752d06fd7bc6517e2231f0712406d65da2..c5c3149152a256cb0e62efc775af7a4aaebc1902 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/pipe3.png and b/doc/salome/gui/GEOM/images/pipe3.png differ
old mode 100755 (executable)
new mode 100644 (file)
index 8b4daec..57cccab
Binary files a/doc/salome/gui/GEOM/images/point3.png and b/doc/salome/gui/GEOM/images/point3.png differ
index dc3e08641294a28f28cc5761d7cae25718d471f4..3be67dbca1f2a8cea42414df116ccffe2a007fe5 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/point4.png and b/doc/salome/gui/GEOM/images/point4.png differ
index 64aa25d740097337489f7ab885f4193ca2662496..26d0a40dd9677fb26580e719106ae5b67b9bc330 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/pref15.png and b/doc/salome/gui/GEOM/images/pref15.png differ
diff --git a/doc/salome/gui/GEOM/images/proj_on_cyl_angles.png b/doc/salome/gui/GEOM/images/proj_on_cyl_angles.png
new file mode 100644 (file)
index 0000000..0d36e4e
Binary files /dev/null and b/doc/salome/gui/GEOM/images/proj_on_cyl_angles.png differ
diff --git a/doc/salome/gui/GEOM/images/proj_on_cyl_dlg.png b/doc/salome/gui/GEOM/images/proj_on_cyl_dlg.png
new file mode 100644 (file)
index 0000000..7ce80c1
Binary files /dev/null and b/doc/salome/gui/GEOM/images/proj_on_cyl_dlg.png differ
diff --git a/doc/salome/gui/GEOM/images/proj_on_cyl_preview.png b/doc/salome/gui/GEOM/images/proj_on_cyl_preview.png
new file mode 100644 (file)
index 0000000..85d767e
Binary files /dev/null and b/doc/salome/gui/GEOM/images/proj_on_cyl_preview.png differ
index ac912b9a8ec362dbbe2842fd2e0801f4baff2790..561ca30f3a32b853052f4522e3c157891b9e477c 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/projection_dlg.png and b/doc/salome/gui/GEOM/images/projection_dlg.png differ
diff --git a/doc/salome/gui/GEOM/images/projection_dlg1.png b/doc/salome/gui/GEOM/images/projection_dlg1.png
new file mode 100644 (file)
index 0000000..342e762
Binary files /dev/null and b/doc/salome/gui/GEOM/images/projection_dlg1.png differ
diff --git a/doc/salome/gui/GEOM/images/projection_dlg2.png b/doc/salome/gui/GEOM/images/projection_dlg2.png
new file mode 100644 (file)
index 0000000..1c0ab27
Binary files /dev/null and b/doc/salome/gui/GEOM/images/projection_dlg2.png differ
index 951f5a5c5cf15596f3b527cc6100f8f590e0fb0d..7f677f423881d0f75895d46ab0c8567758096451 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/remove_webs.png and b/doc/salome/gui/GEOM/images/remove_webs.png differ
old mode 100755 (executable)
new mode 100644 (file)
index 7347daa..5e0ee76
Binary files a/doc/salome/gui/GEOM/images/repair1.png and b/doc/salome/gui/GEOM/images/repair1.png differ
index ccdebd77b60674cc9bbcc4a6e3fed88cd7b5e0f7..9c67419a585812dadf59ce6a9cf5893769481ce7 100755 (executable)
Binary files a/doc/salome/gui/GEOM/images/repair10.png and b/doc/salome/gui/GEOM/images/repair10.png differ
old mode 100755 (executable)
new mode 100644 (file)
index 1816e30..a2a0b50
Binary files a/doc/salome/gui/GEOM/images/repair6.png and b/doc/salome/gui/GEOM/images/repair6.png differ
old mode 100755 (executable)
new mode 100644 (file)
index d765446..c15f313
Binary files a/doc/salome/gui/GEOM/images/repair8.png and b/doc/salome/gui/GEOM/images/repair8.png differ
diff --git a/doc/salome/gui/GEOM/images/shape_statistics.png b/doc/salome/gui/GEOM/images/shape_statistics.png
new file mode 100644 (file)
index 0000000..2aaaa9a
Binary files /dev/null and b/doc/salome/gui/GEOM/images/shape_statistics.png differ
diff --git a/doc/salome/gui/GEOM/images/shape_statistics_simple.png b/doc/salome/gui/GEOM/images/shape_statistics_simple.png
new file mode 100644 (file)
index 0000000..bc2c076
Binary files /dev/null and b/doc/salome/gui/GEOM/images/shape_statistics_simple.png differ
index 400a42ba5a1c18a6af0652595dd4f7f8f531ca9d..04c9dc2bfc1d57a38ea85ac17a61245bb9e2b710 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/shared_shapes.png and b/doc/salome/gui/GEOM/images/shared_shapes.png differ
diff --git a/doc/salome/gui/GEOM/images/surface_from_face1.png b/doc/salome/gui/GEOM/images/surface_from_face1.png
new file mode 100644 (file)
index 0000000..ba039fd
Binary files /dev/null and b/doc/salome/gui/GEOM/images/surface_from_face1.png differ
diff --git a/doc/salome/gui/GEOM/images/surface_from_face_example.png b/doc/salome/gui/GEOM/images/surface_from_face_example.png
new file mode 100644 (file)
index 0000000..db22d6f
Binary files /dev/null and b/doc/salome/gui/GEOM/images/surface_from_face_example.png differ
diff --git a/doc/salome/gui/GEOM/images/thickness.png b/doc/salome/gui/GEOM/images/thickness.png
new file mode 100644 (file)
index 0000000..5277857
Binary files /dev/null and b/doc/salome/gui/GEOM/images/thickness.png differ
diff --git a/doc/salome/gui/GEOM/images/thickness_result.png b/doc/salome/gui/GEOM/images/thickness_result.png
new file mode 100644 (file)
index 0000000..47ec5a0
Binary files /dev/null and b/doc/salome/gui/GEOM/images/thickness_result.png differ
diff --git a/doc/salome/gui/GEOM/images/thicksolid.png b/doc/salome/gui/GEOM/images/thicksolid.png
new file mode 100644 (file)
index 0000000..079a754
Binary files /dev/null and b/doc/salome/gui/GEOM/images/thicksolid.png differ
diff --git a/doc/salome/gui/GEOM/images/thicksolid_result.png b/doc/salome/gui/GEOM/images/thicksolid_result.png
new file mode 100644 (file)
index 0000000..6a6087a
Binary files /dev/null and b/doc/salome/gui/GEOM/images/thicksolid_result.png differ
diff --git a/doc/salome/gui/GEOM/images/tolerances.png b/doc/salome/gui/GEOM/images/tolerances.png
new file mode 100644 (file)
index 0000000..69b1367
Binary files /dev/null and b/doc/salome/gui/GEOM/images/tolerances.png differ
diff --git a/doc/salome/gui/GEOM/images/transfer_data1.png b/doc/salome/gui/GEOM/images/transfer_data1.png
new file mode 100644 (file)
index 0000000..4cd1961
Binary files /dev/null and b/doc/salome/gui/GEOM/images/transfer_data1.png differ
diff --git a/doc/salome/gui/GEOM/images/transfer_data2.png b/doc/salome/gui/GEOM/images/transfer_data2.png
new file mode 100644 (file)
index 0000000..374147d
Binary files /dev/null and b/doc/salome/gui/GEOM/images/transfer_data2.png differ
index e41c1b1f857dc47a80fc62eeb3a7792a52a19d22..bb75713c8aa5a6b6c5d11610e567b0829ad2f6b2 100644 (file)
Binary files a/doc/salome/gui/GEOM/images/tree_example.png and b/doc/salome/gui/GEOM/images/tree_example.png differ
index 4a58ee64a66a01126f96464bef71a824b85ab7af..92d6c31a11e968a6fbc79966bac824b4e18c4ca2 100644 (file)
@@ -5,44 +5,65 @@
 \n To <b>Add Point on Edge</b> in the <b>Main Menu</b> select
 <b>Repair - > Add Point on Edge</b>.
 
-\n This operation splits an edge in two new edges in accordance with the
-specified mode (by length or by parameter) and a value specifying the
-position of the point on edge (for example val =0.5; mode =
-by length). This operation is available in <b>OCC Viewer</b> only.
-
-\n The \b Result will be a \b GEOM_Object.
-
-\n <b>TUI Command:</b> <em>geompy.DivideEdge(Shape, EdgeID, Value,
-IsByParameter)</em>
-- \em Shape is a shape which contains an edge to be divided
-- \em EdgeID is the ID of the edge to be divided, if it is = -1, 
-then \em Shape should be an edge itself
-- \em Value is a value of parameter on edge or length parameter,
-depending on \em IsByParameter.
-- \em IsByParameter is a boolean flag, specifying operation mode:
-  - \c True: \em Value is treated as a curve parameter [0..1]
-  - \c False: \em Value is treated as a length parameter [0..1] 
-
-<b>Arguments:</b> Name + 1 Edge + 1 Value setting the position of
-the point according to one of the selected modes.
-
-The difference between "by parameter" and "by length" modes becomes
-apparent on the edges with irregular parametrization (for example,
-b-splines which usually have irregular density by the length).
-For example, value 0.5 "by length" on such edge will produce the point
-in the middle of this edge (equidistant from both its ends); the same
-0.5 value "by parameter" will result in the point situated closer to
-one of the ends (depending on the actual parametrization).
-
-\image html repair8.png
+This operation splits an edge in two or more new edges.
+This operation is available in <b>OCC Viewer</b> only.
+
+The \b Result will be a \b GEOM_Object.
+
+\n The location of a new vertex on the selected edge can be defined in two ways:
+<ol>
+  <li> By specifying the position (ranging from 0.0 to 1.0) by length or by parameter.
+    <p>
+    <b>TUI Command:</b> <em>geompy.DivideEdge(Shape, EdgeID, Value,
+      IsByParameter)</em>
+    <ul>
+      <li> \em Shape is a shape, which contains an edge to be divided;</li>
+      <li>\em EdgeID is the ID of the edge to be divided, if it is = -1,
+        then \em Shape should be an edge itself;</li>
+      <li> \em Value is a value of parameter on edge or length parameter,
+        depending on \em IsByParameter;</li>
+      <li> \em IsByParameter is a boolean flag, specifying the operation mode:
+        - \c True: \em Value is treated as a curve parameter; [0..1]
+        - \c False: \em Value is treated as a length parameter. [0..1] </li>
+    </ul>
+    \b Arguments: Name + 1 Edge + 1 Value setting the position of
+    the point according to the selected mode.
+
+    The difference between "by parameter" and "by length" modes becomes
+    apparent on the edges with irregular parametrization (for example,
+    b-splines which usually have irregular density by the length).
+    For example, value 0.5 "by length" on such edge will produce the point
+    in the middle of this edge (equidistant from both its ends); the same
+    0.5 value "by parameter" will result in the point situated closer to
+    one of the ends (depending on the actual parametrization).
+
+    \image html repair8.png
+    \n\n
+  </li>
+  <li> By selecting several points that will be projected to the selected
+    edge to find the location of new vertices.
+    <p>
+    <b>TUI Command:</b> <em>geompy.DivideEdgeByPoint(Shape, Edge, Points):</em>
+    <ul>
+      <li> \em Shape is a shape, which contains an edge to be divided;</li>
+      <li>\em Edge is an edge to be divided (or its ID, if it is = -1,
+        then \em Shape should be an edge itself);</li>
+      <li> \em Points is a list of points to be projected to the \a Edge.</li>
+    </ul>
+    \b Arguments: Name + 1 Edge + 1 or more Points.
+
+    \image html divedgebypoint.png
+
+  </li>
+</ol>
 
 \n <b>Example:</b>
 
 \image html image167.png "The initial edge"
 
-\image html image168.png "The edge split in two segments" 
+\image html image168.png "The edge split in two segments"
 
-Our <b>TUI Scripts</b> provide you with useful examples of the use of 
+Our <b>TUI Scripts</b> provide you with useful examples of the use of
 \ref tui_add_point_on_edge "Repairing Operations".
 
 */
index 0a3e46b7d79d445bdbcf65584a6b4646e2214c3a..5ceffbb2479b200d2e73edbf5a9f79fa147d0f69 100644 (file)
@@ -8,7 +8,15 @@ This operation returns the angle in degrees between two lines or linear edges.
 
 If both objects are <b>vectors</b>, the angle is computed in accordance with their orientations, otherwise the minimum angle is computed.
 
-\n <b>TUI Command:</b> <em>geompy.GetAngle(shape1, shape2),</em> where
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
+<b>TUI Command:</b> <em>geompy.GetAngle(shape1, shape2),</em> where
 Shape1 and Shape2 are shapes between which the angle is computed. 
 Another TUI command is <em>geompy.GetAngleRadians(shape1,shape2),</em> 
 which returns the value of angle in radians.
index 88aea81d4c7fc3099f16e188460cf7ee0bb9fe59..e496e02f223911f45473bc5be44a233c0f048476 100644 (file)
@@ -36,11 +36,10 @@ and then displays only the children of the selected object(s).
   to change the order (ascending / descending) by clicking the corresponding title bar of the objects list.
 </li>
 
-<li>\ref dependency_tree_page "Show dependency tree" - shows dependency tree of selected objects
-in new 2D View Window.</li>
+<li>\ref dependency_tree_page "Show dependency tree" - shows the dependency tree with parents and children of the selected object
+in new 2D View Window.</li>
 
-<li>\ref reduce_study_page "Reduce study" - allows to reduce study
-by automatic removing objects according to user's options.</li>
+<li>\ref reduce_study_page "Reduce study" - allows reducing the study by removing objects from it.</li>
 </ul>
 
 <h2> Folders </h2>
index 05b539e0c3e540fa8c0818ffe7910105924dc863..4210731ca7509391e0717181c430a1fb75337a54 100644 (file)
@@ -7,7 +7,15 @@ geometrical object.
 
 \image html neo-basicprop.png
 
-\n<b>TUI Command:</b> <em>geompy.BasicProperties(Shape),</em> where
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
+<b>TUI Command:</b> <em>geompy.BasicProperties(Shape),</em> where
 \em Shape is a shape whose properties are inquired.
 
 See also a \ref tui_basic_properties_page "TUI example".
index 5d963b0976981c13f36232ecca67df8a8565918d..a4b60bdd799fb62785aeaedbd0ed37cc5e0af492 100644 (file)
@@ -10,7 +10,15 @@ The coordinates of two corners of its bounding box are shown in the table.
 
 Press \b Apply or <b>Apply and Close</b> button to publish the bounding \b Box in the study. 
 
-\n <b>TUI Commands:</b> <em>[Xmin,Xmax, Ymin,Ymax, Zmin,Zmax] = geompy.BoundingBox(Shape, precise)</em>,
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
+<b>TUI Commands:</b> <em>[Xmin,Xmax, Ymin,Ymax, Zmin,Zmax] = geompy.BoundingBox(Shape, precise)</em>,
 <em>BBox = geompy.MakeBoundingBox(Shape, precise)</em>, where \em Shape
 is the shape for which the bounding box is computed. \em precise TRUE
  for precise computation; FALSE for fast one. Default value is False.
index c50370de5d1165532461579e5115354753e100f1..b965cb3fb53b675316ba49a041988bb3b3f1b87c 100644 (file)
@@ -9,7 +9,15 @@ the selected geometrical object.
 
 Press \b Apply or <b>Apply and Close</b> button to publish the \b Point in the study. 
 
-\n <b>TUI Command:</b> <em> geompy.MakeCDG(Shape),</em> where \em Shape is
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
+<b>TUI Command:</b> <em> geompy.MakeCDG(Shape),</em> where \em Shape is
 the shape for which a center of gravity is computed.
 
 See also a \ref tui_center_of_mass_page "TUI example".
index e9893b8e53f577be45e3d4e1b98516535a619a7a..5b95a87231604430dedfeb3b15704ab8e4d48421 100644 (file)
@@ -2,13 +2,17 @@
 
 \page check_compound_of_blocks_page Check Compound of Blocks
 
-This operation checks whether a shape is a compound of glued blocks. 
+This operation checks whether a shape is a compound of glued blocks
+and improves the shape to include only valid blocks.
 
 \image html measures10.png
 
 To be considered as a compound of blocks, the given shape must satisfy the
 following conditions:
-- Each element of the compound should be a Block (6 faces and 12 edges);
+- Each element of the compound should be a Block, i.e. have 6 quadrangle faces;
+- Each quadrangle face should have one wire with four edges. If there are
+more than four edges in a single wire and C1 continuity mode is switched on,
+a face is quadrangular if it has four bounds with C1 continuity.
 - Blocks can be connected only via an entire quadrangle face or an entire edge;
 - The compound should be connected;
 - Each couple of connecting quadrangle faces should be glued.
@@ -16,21 +20,30 @@ following conditions:
 
 In this dialog:
 
-- \b Object - the checked object. \b Selection button allows picking it in the viewer or in the object browser. 
-- \b Errors list informs of possible errors, for example:. 
+- \b Object - the checked object. \b Selection button allows picking it in the viewer or in the object browser.
+- <b>Use C1 criterion</b> - option switches on/off the C1 continuity mode.
+- <b>Angular Tolerance</b> - angular tolerance to check C1 continuity between neighbor edges in a wire.
+- \b Errors list informs of possible errors, for example:
        - Not a block;
        - Not glued;
        - Not connected;
        - Extra or degenerated edge.
-- <b>Incriminated Sub-shapes</b> field outputs the list of sub-shapes that cause problem. It is possible to select them in the list and publish in the study for further analysis by clicking \b Apply or <b>Apply and Close</b> button. 
+- <b>Incriminated Sub-shapes</b> field outputs the list of sub-shapes that cause problem.
+- \b Apply and <b>Apply and Close</b> buttons launch the improvement process
+and publish the result shape, which includes valid blocks only. The
+algorithm tries to:
+   - remove seam and degenerated edges from surfaces of revolution;
+   - re-approximate surfaces to exclude singularities on boundaries;
+   - unite edges and faces;
+   - glue faces.
 
 
 \n <b>TUI Command:</b>
-<em>geompy.CheckCompoundOfBlocks(Compound).</em> Checks if the shape
+<em>geompy.CheckCompoundOfBlocks(Compound, theIsUseC1 = False, theAngTolerance = 1.e-12).</em> Checks if the shape
 is a valid compound of blocks. If it is true, then the validity flag
 is returned, and encountered errors are printed in the python console.
 
 See also a \ref tui_check_compound_of_blocks_page "TUI example".
 
 
-*/
\ No newline at end of file
+*/
index 86c556786c47d1a54dc5626f3e20ad018e66157e..8533274e27a496a38e11ff2fb100e2c269ee3d55 100644 (file)
@@ -2,26 +2,74 @@
 
 \page check_self_intersections_page Detect Self-intersections
 
+\n To <b>Detect Self-intersections,</b> select in the <b>Main Menu</b> 
+<b>Inspection - > Detect Self-intersections</b>.
+
+There are two ways to check self-intersections.
+
+\anchor check_self_intersections_topological
+<br><h3>Check topological intersections</h3>
+
 This operation checks the topology of the selected shape to detect self-intersections.
 
 \image html measures11.png
 
 In this dialog:
 
-- \b Object - the checked object. \b Selection button allows picking it in the viewer or in the object browser. 
-- \b Errors list contains the list of intersections. Select the intersection to show <b>Incriminated Sub-shapes</b> in the field to the right. 
-
+- \b Object - the checked object. \b Selection button allows picking it in the viewer or in the object browser.
+- <b>Level of check</b> - combo box allows setting the level of self-interference checking. It defines, which interferences will be checked. The default value is "All interferences".
+- <b>Compute self-intersections</b> button performs the computation.
+- \b Summary section contains the general report about self-intersections of the object and/or errors that occurred during the computation.
+- \b Self-intersections list contains the list of detected self-intersections. Select the intersection to show <b>Sub-shapes</b> in the field to the right. 
+- \b Apply and <b>Apply and Close</b> buttons store the interferences selected in the <b>Self-intersections</b> list box in the study for further analysis. 
+If no interferences are selected, all of them are published in the study. Each interference is published as a child compound of the source shape and contains a couple of intersecting sub-shapes.
 
-\note This tool is useful for detection of shapes, not suitable for
+\note This tool is useful for detection of shapes that are not suitable as
 arguments of Boolean operations and Partition algorithm.
 For more information about Partition and Boolean Operations Algorithms
 and their limitations refer to <a href="SALOME_BOA_PA.pdf">this document</a>.
 
 \n <b>Result:</b> Boolean.
-\n <b>TUI Command:</b> <em>geompy.CheckSelfIntersections(theShape),</em>
-where \em theShape is the shape checked for validity.
+\n <b>TUI Command:</b> <em>geompy.CheckSelfIntersections(theShape, theCheckLevel = GEOM.SI_ALL),</em> \n
+where: \n
+\em theShape is the shape checked for validity. \n
+\em theCheckLevel is the level of check. Default value is GEOM.SI_ALL to check all interferences.
 
 See also a \ref tui_check_self_intersections_page "TUI example".
 
+\anchor check_self_intersections_fast
+<br><h3>Fast intersection</h3>
+
+This operation allows quickly detecting self-interferences of the given shape using the algorithm based on mesh intersections.
+
+The algorithm works on the face level, i.e. it computes only face-to-face intersections. No additional intersection types are computed.
+
+This can be useful to detect all intersections between subshapes of type "surface" in an assembly.
+The result quality will depend on the tesselation quality. However, small deflection values can significantly decrease the performance of the algorithm.
+Nevertheless, the performance of Fast Intersect algorithm is much higher than that of the topological intersection.
+
+\image html measures13.png
+
+In this dialog:
+
+- \b Object - the checked object. \b Selection button allows picking it in the viewer or in the object browser.
+- <b>Deflection coefficient</b> -  a linear deflection coefficient that defines the tesselation quality. If theDeflection <= 0, default deflection 0.001 is used.
+- <b>Detect gaps with tolerance</b> specifies the distance between shapes used for detecting gaps:
+     - if theTolerance <= 0, the algorithm detects intersections;
+     - if theTolerance > 0, the algorithm detects gapss. 
+- <b>Compute self-intersections</b> button performs the computation.
+- \b Summary section contains the general report about self-intersections of the object and/or errors that occurred during the computation.
+- \b Self-intersections list contains the list of detected self-intersections. Select the intersection to show <b>Sub-shapes</b> in the field to the right. 
+- \b Apply and <b>Apply and Close</b> buttons store the interferences selected in the <b>Self-intersections</b> list box in the study for further analysis. 
+If no interferences are selected, all of them are published in the study. Each interference is published as a child compound of the source shape and contains a couple of intersecting sub-shapes.
+
+\n <b>Result:</b> Boolean.
+\n <b>TUI Command:</b> <em>geompy.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance),</em> \n
+where: \n
+\em theShape is the shape checked for validity. \n
+\em theDeflection that specifies the quality of tesselation. 
+\em theTolerance Specifies the distance between shapes used for detecting gaps.
+
+See also a \ref tui_check_self_intersections_fast_page "TUI example".
 
-*/
\ No newline at end of file
+*/
index 030912ad65ba002aab4d44b921d2e48d7043f6ab..b04c8aa65958faf809120218bb59be59541212de 100755 (executable)
@@ -25,7 +25,7 @@ By <b>Cartesian coordinates</b> , which can be either:
 - \b Relative coordinates \b DX, \b DY and \b DZ with respect to the previous applied point,
  
 By <b>Angular coordinates</b>, which include:
-- the \b Length of the segment and an \b Angle in the chosen plane (OXY for example) in \b Relative mode. The angle is then relative to a local coordinate system with the last point of the sketch as origin. </li>
+- the \b Length of the segment and an \b Angle in the chosen plane (OXY for example) in \b Relative mode. The angle is then relative to a local coordinate system with the last point of the sketch as origin.
    
 \image html 3dsketch_angle_rel.png
    
index efdff95118b5804968425b48b56f36189cf8316e..cebd3be5ca225706129f57fe8d0357a95a491d5d 100644 (file)
@@ -16,6 +16,7 @@ geometrical objects as:
 <li>\subpage create_sketcher_page</li>
 <li>\subpage create_3dsketcher_page</li>
 <li>\subpage create_polyline_page</li>
+<li>\subpage create_surface_from_face_page</li>
 <li>\subpage create_vector_page</li>
 <li>\subpage create_plane_page</li>
 <li>\subpage create_lcs_page</li>
index a5c6a090f8a8b788db565d032d0b71aca136642a..01b6eb85f16210a389c2e7ff33dc9ce4c3f773b4 100644 (file)
@@ -3,22 +3,24 @@
 \page create_complex_obj_page Creating Complex Objects
 
 <b>New entity -> Generation</b> sub-menu allows creating new geometric
-objects by modification and multiplication of the existing objects: 
+objects by modification and multiplication of the existing objects:
 
 
 <ul>
 <li>\subpage create_extrusion_page "Extrude" a 2D object by vector,
-creating a 3D object. </li> 
+creating a 3D object. </li>
 <li>\subpage create_revolution_page "Revolve" an object around an
 axis, creating a body of revolution.</li>
 <li>\subpage create_filling_page  "Create a surface" from a set of edges.</li>
-<li>\subpage create_extrusion_alongpath_page "Extrude an object along a path", 
+<li>\subpage create_extrusion_alongpath_page "Extrude an object along a path",
 creating a more complex trajectory object.</li>
 <li>\subpage create_pipe_path_page "Restore Path" of a pipe-like shape.</li>
+<li>\subpage create_thickness_page "Add thickness" to objects.</li>
+<li>\subpage create_groups_page "Generate Groups" for certain generation operations.</li>
 </ul>
 
 <b> New entity -> Advanced </b> sub-menu allows creating new geometric
-objects using advanced algorithms: 
+objects using advanced algorithms:
 
 <ul>
 <li>\subpage create_smoothingsurface_page "Smoothing surface" from a
index ecb1655841839cb73e607cd54e2832cbbee95124..704e622c851537b273ca7127a8b8ddf623b7fe41 100644 (file)
@@ -5,7 +5,7 @@
 \n To create a \b Compound in the <b>Main Menu</b> select <b>New
 Entity - > Build - > Compound</b>.
 
-\n You can create a compound from a list of shells.
+\n You can create a compound from a list of shapes.
 \n The \b Result will be a \b GEOM_Object (COMPOUND).
 
 \n <b>TUI Command:</b> <em>geompy.MakeCompound(ListOfShape)</em>
index d2c9f78e3829ffa84ac96077af346606cfe1776b..8b81f79820a668899917dff9f87463d122a8e199 100644 (file)
@@ -10,8 +10,8 @@ Entity - > Primitives - > Cylinder</b>
 
 \n Firstly, you can define a \b Cylinder by the <b>Base Point</b> (the central
 point of the cylinder base), the \b Vector (the axis of the cylinder),
-and its dimensions: the \b Radius and the \b Height. Also, you can optionally specify
-the \b Angle in order to create a portion of cylinder.
+and its dimensions: the \b Radius and the \b Height. You can optionally specify
+the \b Angle to create a portion of cylinder.
 
 \n <b>TUI Command:</b> <em>geompy.MakeCylinder(Point, Axis, Radius, Height)</em>
 \n <b>Arguments:</b>  Name + 1 vertex + 1 vector + 2 values
@@ -26,8 +26,8 @@ the \b Angle in order to create a portion of cylinder.
 \n Secondly, you can define a \b Cylinder by the given \b Radius and
 \b Height at the origin of coordinate system. The axis of the cylinder
 will be collinear to the OZ axis of the coordinate system. 
-Similarly to first constructor, you can optionally specify the \b Angle
-in order to create a portion of cylinder.
+Similarly to the first constructor, you can optionally specify the \b Angle
+to create a portion of cylinder.
 
 \n <b>TUI Command:</b> <em>geompy.MakeCylinderRH(Radius, Height)</em>
 \n <b>Arguments:</b> Name + 2 values (Dimensions at origin: radius and
index 1de29847ad4f599962e0e4d385d727f5b3f8f395..69377397357422652da8702a20691801ffe383fe 100644 (file)
@@ -2,52 +2,97 @@
 
 \page create_explode_page Explode
 
-\n To \b Explode an object into sub-shapes, in the <b>Main Menu</b>
-select <b>New Entity > Explode</b>.
+To \b Explode an object into sub-shapes, in the <b>Main Menu</b>
+select <b>New Entity > Explode</b>. This operation opens the
+<b>Sub Shapes Selection</b> dialog box.
 
-\n To create a list of  sub-shapes (vertices, edges, wires etc.) of the
+\image html neo-obj1.png
+
+To create a list of  sub-shapes (vertices, edges, wires etc.) of the
 given shape using the \b Explode operation, you need to define the <b>Main
 Object</b>, which will be exploded and the <b>Type of Sub-shapes</b> you wish to
 obtain from it.
-\n The \b Result of the operation will be a List of \b GEOM_Objects
+
+The \b Result of the operation will be a List of \b GEOM_Objects
 (vertexes, edges, wires, faces, shells or solids).
 
-\n Using <b>TUI Commands</b> you can perform this operation in a
+The choices available in the <b>Sub Shapes Type</b> combo box depend on the type
+of selected <b>Main Object</b>:
+- \b Compound: to extract compounds;
+- \b Compsolid: to extract compsolids;
+- \b Solid: to extract solids;
+- \b Shell: to extract shells;
+- \b Face: to extract faces;
+- \b Wire: to extract wires;
+- \b Edge: to extract edges;
+- \b Vertex: to extract vertices;
+- \b Shape: to extract top-level contents of the compound shape;
+- \b Flat: to extract "flat" contents of the compound shape.
+
+Note: "flat" contents means that top-level simple-type sub-shapes are extracted from
+the compound object recursively (i.e. there are no compounds in the result).
+
+Let us take, for example, compound C1 that contains solid S1 and another compound C2 that
+contains solids S2 and S3 (see the picture below):
+- Explode operation with \b Shape type given as parameter will return S1 and C2;
+- Explode operation with \b Flat type given as parameter will return S1, S2 and S3.
+
+\image html flat_contents.png
+
+Switching on <b>Select Sub-shapes</b> check box allows manual selection of sub-shapes
+to be extracted from the main object. In this mode it is possible to select sub-shapes
+directly in 3D viewer.
+
+When <b>Select Sub-shapes</b> check box is switched on, additional \b Filter controls
+allow to automatically pick up entities, which satisfy the specified threshold value(s).
+The numerical functor for each sub-shape that is compared with the threshold value(s)
+is computed according to the topological properties of the shape:
+- length for edges and wires;
+- area for faces and shells;
+- volume for solids, compounds and compsolids. 
+
+Filtering capabilities are not available for vertices.
+
+To filter out some entities it is necessary to do the following:
+- Activate one or two filtering controls by switching on the corresponding check boxes;
+- Select the required threshold comparator type; the following choices are available:
+  - <b>Less Than</b> or <b>Equal or Less Than</b> for the first comparator;
+  - <b>Greater Than</b> or <b>Equal or Greater Than</b> for the second comparator;
+- Enter the required threshold value (values);
+- Press \b Apply button in the \b Filter group.
+
+The entities, which correspond to the entered filtering parameters, will be automatically highlighted
+in the 3D viewer.
+
+Using <b>TUI Commands</b> you can perform this operation in a
 variety of ways:
-<ul>
-<li><em>geompy.ExtractShapes(Shape, Type, isSorted)</em> explodes a
-Shape into sub-shapes of a given Type and returns a List of sub-shapes.
-This method does not return the Shape itself if it matches the
-Type.</li>
-<li><em>geompy.SubShapeAll(Shape, Type)</em> explodes a Shape on
-sub-shapes of a given Type and returns a List of sub-shapes.</li>
-<li><em>geompy.SubShapeAllIDs(Shape, Type)</em> explodes a Shape on
-sub-shapes of a given Type and returns a List of IDs of
-sub-shapes.</li>
-<li><em>geompy.SubShapeAllSortedCentres(Shape, Type)</em> explodes a
-shape on sub-shapes of a given type and sorts them taking into account
-their gravity centers, to provide stable order of sub-shapes.
-It returns a list of sub-shapes.</li>
-<li><em>geompy.SubShapeAllSortedCentresIDs(Shape, Type)</em> explodes
-a shape on sub-shapes of a given type and sorts them taking into
-account their gravity centers, to provide stable order of sub-shapes.
-It returns a List of IDs of sub-shapes.</li>
-<li><em>geompy.SubShape(Shape, Type, ListOfInd)</em> allows to obtain
-a compound of sub-shapes of  the Shape,  selected by they indices in a
-list of all sub-shapes of the given Type. Each index is in the range
-[1, Nb_Sub-Shapes_Of_Given_Type].</li>
-<li><em>geompy.SubShapeSortedCentres(Shape, Type, ListOfInd)</em>
-allows to obtain a compound of sub-shapes of the Shape, selected by
-they indices in sorted list of all sub-shapes of the given Type. Each
-index is in the range [1, Nb_Sub-Shapes_Of_Given_Type]</li>
-</ul>
-
-\n <b>Arguments: </b>1 SHAPE + 1 type of SubShape.
+- <em>geompy.ExtractShapes(Shape, Type, isSorted)</em> explodes a
+  Shape into sub-shapes of a given Type and returns a List of sub-shapes.
+  This method does not return the Shape itself if it matches the Type.
+- <em>geompy.SubShapeAll(Shape, Type)</em> explodes a Shape into
+  sub-shapes of a given Type and returns a List of sub-shapes.
+- <em>geompy.SubShapeAllIDs(Shape, Type)</em> explodes a Shape into sub-shapes of a given Type and returns a List of IDs of sub-shapes.
+- <em>geompy.SubShapeAllSortedCentres(Shape, Type)</em> explodes a
+  shape into sub-shapes of a given type and sorts them taking into account
+  their gravity centers, to provide a stable order of sub-shapes.
+  It returns a list of sub-shapes.
+- <em>geompy.SubShapeAllSortedCentresIDs(Shape, Type)</em> explodes
+  a shape into sub-shapes of a given type and sorts them taking into
+  account their gravity centers, to provide a stable order of sub-shapes.
+  It returns a List of IDs of sub-shapes.
+- <em>geompy.SubShape(Shape, Type, ListOfInd)</em> allows to obtain
+  a compound of sub-shapes of the Shape, selected by their indexes in a
+  list of all sub-shapes of the given Type. Each index is in the range
+  [1, Nb_Sub-Shapes_Of_Given_Type].
+- <em>geompy.SubShapeSortedCentres(Shape, Type, ListOfInd)</em>
+  allows to obtain a compound of sub-shapes of the Shape, selected by
+  their indexes in a sorted list of all sub-shapes of the given Type. Each
+  index is in the range [1, Nb_Sub-Shapes_Of_Given_Type]
 
-\image html neo-obj1.png
+<b>Arguments: </b>1 SHAPE + 1 type of SubShape.
 
 <b>Example:</b>
 
-\image html explode.png "A box, exploded into faces"
+\image html explode.png "A box exploded into faces"
 
 */
index 8c543023267310530f903366ac20b68c9d97c0d7..84260fe68dac34089737d6dcf4d9cf330bc57d92 100644 (file)
@@ -14,13 +14,17 @@ is created so that the <b>angle between the normal vector</b> to
 the base shape <b>and the tangent to the path</b> wire remains constant at any point of the
 given path.
 \n <b>Select unpublished edges</b> checkbox - if checked, allows to select an edge of any other shape as the path object. 
+\n <b>Generate groups</b> checkbox - if checked allows to create groups of
+sub-shapes. For more details on groups creation please refer to
+\ref create_groups_page "this description".
 \n The \b Result of the operation will be a GEOM_Object (edge, face, shell,
 solid or compsolid).
 
-\n <b>TUI Command:</b> <em>geompy.MakePipe(baseShape, pathShape)</em>
+\n <b>TUI Command:</b> <em>geompy.MakePipe(baseShape, pathShape,
+ IsGenerateGroups=False)</em>
 \n <b>Arguments:</b> Name + 1 shape (vertex, edge, planar wire, face or
 shell) serving as base object + 1 shape (edge or wire) for
-definition of the path.
+definition of the path + 1 boolean parameter (IsGenerateGroups).
 \n <b>Advanced options</b> \ref preview_anchor "Preview"
 
 \image html pipe.png
@@ -39,14 +43,19 @@ wire).
 to preserve the constant <b>angle between the normal vector</b> to the base
 shape <b>and the BiNormal vector</b> given as the third argument.
 \n <b>Select unpublished edges</b> checkbox - if checked, allows to select an edge of any other shape as the path object. 
+\n <b>Generate groups</b> checkbox - if checked allows to create groups of
+sub-shapes. For more details on groups creation please refer to
+\ref create_groups_page "this description".
 \n The \b Result of the operation will be a GEOM_Object (edge, face, shell,
 solid or compsolid).
 
-\n <b>TUI Command:</b> <em>geompy.MakePipeBiNormalAlongVector(baseShape, pathShape, binormalShape)</em>
+\n <b>TUI Command:</b> <em>geompy.MakePipeBiNormalAlongVector(baseShape, pathShape, binormalShape,
+ IsGenerateGroups=False)</em>
 \n <b>Arguments:</b> Name + 1 shape (edge, planar wire or face) 
 serving as base object + 1 shape (edge or wire) for
 definition of the path + 1 shape (edge or wire) to set a fixed 
-BiNormal direction to perform the extrusion.
+BiNormal direction to perform the extrusion + 1 boolean parameter
+(IsGenerateGroups).
 
 \image html pipe2.png
 
@@ -63,14 +72,33 @@ Additional controls:
 - If <b>With contact</b> is checked, the section is translated in contact with the spine.
 - If <b>With correction</b> is checked, the section is rotated to be orthogonal to the spine
 tangent in the corresponding point.
+- If <b>Step-by-step generation</b> is checked, the result is created
+step-by-step, i.e. it creates pipes between each pair of neighbor sections and
+fuses them into a single shape.
 
+\note If <b>Step-by-step generation</b> is checked, <b>With contact</b> and
+<b>With correction</b> controls are disabled as corrections of bases are
+not allowed in step-by-step mode.
+
+<b>Generate groups</b> checkbox - if checked allows to create groups of
+sub-shapes. For more details on groups creation please refer to
+\ref create_groups_page "this description".
 \n The \b Result of the operation will be a shell or a solid.
 
-\n <b>TUI Command:</b> <em>geompy.MakePipeWithDifferentSections(baseShape, locations, pathShape, withContact, withCorrection)</em>
+\n <b>TUI Commands:</b>
+- <em>geompy.MakePipeWithDifferentSections(baseShape, locations, pathShape, withContact, withCorrection,
+ IsGenerateGroups=False)</em>
 \n <b>Arguments:</b> Name + list of shapes (edges, planar wires, faces or shells) serving as base object + 
 list of locations (vertices) on the path corresponding specified list of the shapes + 
 1 shape (edge or wire) for definition of the path + 
-2 Boolean parameters (withContact, withCorrection).
+3 Boolean parameters (withContact, withCorrection, IsGenerateGroups).
+- <em>geompy.MakePipeWithDifferentSectionsBySteps(baseShape, locations, pathShape,
+ IsGenerateGroups=False)</em>
+\n <b>Arguments:</b> Name + list of shapes (edges, planar wires, faces or shells) serving as base object +
+list of locations (vertices) on the path corresponding specified list of the shapes +
+1 shape (edge or wire) for definition of the path +
+Boolean parameter.
+
 \n <b>Advanced options</b> \ref preview_anchor "Preview"
 
 \image html pipe3.png
index 1bfd520ddd55a5bc5e070346c794bb06de3e5cdd..e75288de730c49f3617e952d802733a75e57ff14 100644 (file)
@@ -5,26 +5,59 @@
 To create a \b Face in the <b>Main Menu</b> select <b>New Entity - >
 Build - > Face</b>
 
-\n To create a \b Face you need to select input shape(s). The list of
-input shapes can include shapes of any type; if the shapes are nor
-wires or edges, the algorithm extracts all edges from
-the input shapes and works on the obtaineed edges.
+There are three algorithms to create a \b Face. In all cases the \b Result
+of the operation will be a GEOM_Object (FACE).
+
+\n Firstly, to create a \b Face you need to select input shape(s). The list of
+input shapes can include shapes of any type except vertices; if the shapes are
+neither wires nor edges, the algorithm extracts all edges from
+the input shapes and works on the obtained edges.
 \n The edges and wires do not necessarily have to be closed, the
 algorithm automatically builds a wire of maximum length from all
-given edges and wires. If it founds multiple closed wires, it can
-build a face with holes or some separate faces, depending on the
-placement of the wires. If some resulting wires remain open, they will
-be added in the resulting compound "as is".
+given edges and wires. If several closed wires are detected the algorithm tries
+to create a face with holes. It is possible only if there is only one wire
+that can be interpreted as an outer one; other wires can be considered as
+inner ones.
 \n Check <b>Try to create a planar face</b> to create a planar
 face or nothing if it is impossible.
-\note Please note, that the resulting face can have a huge tolerance, if the initial wire has a big deviation from the plane. If the final tolerance exceeds 1e-06, a warning will be shown, but the face will be created and published in the study in a normal way. Using such faces can lead to failures or unpredictable results in most operations.
+\note Please note, that the resulting face can have a huge tolerance, if
+the initial wire has a big deviation from the plane. If the final tolerance
+exceeds 1e-06, a warning will be shown, but the face will be created
+and published in the study in a normal way. Using such faces can lead to failures
+or unpredictable results in most operations.
 
-\n The \b Result will be a \b GEOM_Object (FACE).
+\n The \b Result will be a \b GEOM_Object. It can be either a single face or, in specific cases, a compound of faces.
 
 \n <b>TUI Command:</b> <em>geompy.MakeFaceWires([list of Shapes], isPlanarWanted)</em>
 \n <b>Arguments:</b> Name + 1 wire.
 
-\image html neo-obj4.png
+\image html neo-obj4.png "Create face by input shape(s)"
+
+\n Secondly, it is possible to create a face based on another face's surface and bounded by a wire.
+
+\n The \b Result will be a \b GEOM_Object (face).
+
+\n <b>TUI Command:</b> <em>geompy.MakeFaceFromSurface(theFace, theWire)</em>
+\n <b>Arguments:</b> Name + 1 face + 1 wire.
+
+\image html neo-obj4_2.png "Create face by another face's surface"
+
+Thirdly, it is possible to create a \b Face by specifying a set of edges forming a closed wire
+and constraints:
+- Specify an input wire by selecting it in the object browser or in the viewer.
+  The input wire will be exploded on edges which will be shown in the \b Constraints list box.
+- Specify constraints by associating faces with the edges. 
+
+\note Please note, that the constraint face must be connected to a reference edge.
+
+\n The \b Result will be a \b GEOM_Object (face).
+
+\n <b>TUI Command:</b> <em>geompy.MakeFaceWithConstraints([List of constraints])</em>
+\n <b>Arguments:</b> Name + List of input edges and constraint faces. If a constraint
+face is missing for some edge, this means that there is no constraint associated to this edge.
+\note Set of edges should form a closed wire.
+
+\image html neo-obj4_3.png "Create face by a wire and its constraints"
 
 \n <b>Example:</b>
 
@@ -34,7 +67,7 @@ face or nothing if it is impossible.
 
 \image html facesn3.png "Examples of faces"
 
-Our <b>TUI Scripts</b> provide you with useful examples of creation of 
+Our <b>TUI Scripts</b> provide you with useful examples of creation of
 \ref tui_creation_face "Advanced Geometric Objects".
 
 */
index 874cac94ba0ea87e58b854520993289afc7f02c9..0a041c21459414d037f063d14d9f02ddfc4ee5f4 100644 (file)
@@ -6,19 +6,18 @@ To generate a \b Filling in the <b>Main Menu</b> select <b>New Entity - > Genera
 
 To create a curvilinear face from several edges you need to define the
 following parameters:
-\n <b>Input Compound</b> - the list of edges/wires used for creation
-of the surface. To prepare for the filling each wire of the compound
-is converted to an edge created on a BSpline curve built using curves
-from all edges of the wire.
+\n <b>Input Contours</b> - the list of edges/wires to use for creation
+of the surface. You can select either several edges/wires or a
+compound of them. To prepare for the filling, each input wire
+is converted into a single BSpline curve by concatenating its edges.
 \n \b Minimum and <b>Maximum Degree</b> of equation of the resulting
-BSpline or Besier curves describing the surface
+BSpline or Besier curves describing the surface.
 \n \b Tolerance for \b 2D and for \b 3D - minimum distance between the
-created surface and the reference edge; 
+created surface and the input contours.
 \n <b>Number of Iterations</b> - defines the maximum number of iterations. The
 iterations are repeated until the required tolerance is reached. So, a
 greater number of iterations allows producing a better surface. 
 \n <b>Method</b> - Kind of method to perform filling operation
-
 <ol>
 <li>Default - the standard behaviour.</li>
 <li>Use edges orientation - the edges orientation is used: if an edge is
@@ -28,7 +27,7 @@ algorithm.</li>
 minimize the sum of distances between ends points of edges.</li>
 </ol>
 
-\n <b>Approximation</b> - if checked, BSpline curves are generated in
+<b>Approximation</b> - if checked, BSpline curves are generated in
 the process of surface construction (using
 GeomAPI_PointsToBSplineSurface functionality). By default the surface
 is created using Besier curves. The usage of <b>Approximation</b>
@@ -36,21 +35,29 @@ slows the algorithm, but allows building the surface for complex cases.
 
 \n The \b Result of the operation will be a GEOM_Object (face).
 
-\n <b>TUI Command:</b> <em>geompy.MakeFilling(Edges, MinDegree, MaxDegree, Tol2D, Tol3D, NbIter)</em>
-\n <b>Arguments:</b> Name + 1 List of edges + 7 Parameters
-(Min. degree, Max. degree, Number of iterations, 2D tolerance, 3D
-tolerance, Number of iterations, Method, Approximation).
-\n <b>Advanced options</b> \ref preview_anchor "Preview"
+\n <b>TUI Command:</b> <em>geompy.MakeFilling(Contours, MinDegree, MaxDegree, Tol2D, Tol3D, NbIter)</em><br>
+<b>Arguments:</b> List/compound of edges/wires + 7 Parameters
+(Min. degree, Max. degree, 2D tolerance, 3D tolerance, Number of
+iterations, Method, Approximation).
+\n <b>Advanced options:</b> \ref preview_anchor "Preview"
 
 \image html filling.png
 
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
 <b>Example:</b>
 
 \image html filling_compoundsn.png "Initial edges"
 
 \image html fillingsn.png "Resulting surface"
 
-Our <b>TUI Scripts</b> provide you with useful examples of creation of
+Sample <b>TUI Scripts</b> provide you with useful examples of creation of
 \ref tui_creation_filling "Complex Geometric Objects".
 
 */
diff --git a/doc/salome/gui/GEOM/input/creating_groups.doc b/doc/salome/gui/GEOM/input/creating_groups.doc
new file mode 100644 (file)
index 0000000..c86b804
--- /dev/null
@@ -0,0 +1,76 @@
+/*!
+
+\page create_groups_page Generation of Groups
+
+This option is available in some dialogs. To activate it please check
+<b>Generate Groups</b> check box. When it is checked, it is possible to define
+the prefix for generated groups names using <b>Group Names Prefix</b> input
+field.
+
+\image html gen_group_dlg.png "Generate groups option in a dialog"
+
+The groups are created along with the result of the operation when
+\b Apply or <b>Apply and Close</b> button is clicked. Each generated group
+represents a set of sub-shapes of the result that satisfies certain conditions.
+The groups of the following types can be generated:
+ - \b Down - sub-shapes starting the result, e.g. bottom lid
+for the pipe creation operation.
+ - \b Up - sub-shapes ending the result, e.g. top lid
+for the pipe creation operation.
+ - \b Side1, \b Side2 - sub-shapes corresponding to each side
+of the result.
+ - \b Other - faces generated from the bounding edges of
+\b Down group.
+
+The groups are named according to the following naming rule:
+If <b>Group Names Prefix</b> is set <b><Prefix>_<Type></b>, otherwise
+the name is \b <Type>. The following figure shows group names created with
+the prefix \b Group:
+
+\image html gen_group_tree.png "Group_Down, Group_Up, Group_Side1 and Group_Side2 are generated"
+
+
+The general behavior of this functionality is the following:
+<ul>
+<li>If <b>Generate Groups</b> option is not set, the groups are not generated.</li>
+<li>If starting and ending sub-shapes of the result are the same, e.g. if there is
+a closed path for pipe construction, <b>Generate Groups</b> option is disabled
+in the dialog box:</li>
+
+\image html gen_group_disabled.png "Disabled option in the Pipe Construction dialog if the path is closed"
+\n
+<li>Otherwise If the path is not closed edge/wire, the groups are created depending
+on the profile:</li>
+<ul>
+<li>Profile is unclosed edge or wire: \b Down, \b Up, \b Side1, \b Side2:</li>
+
+\image html gen_group_sides.png "Pipe with created groups Down(Red), Up(Green), Side1(Blue) and Side2(Yellow)"
+\n
+<li>Profile is closed edge or wire, face or shell: \b Down, \b Up, \b Other:</li>
+
+\image html gen_group_other.png "Created groups Down(Red), Up(Green) and Other(Yellow)"
+</ul>
+</ul>
+
+\b Down and \b Up groups contain:
+- Edges if the profile is edge or wire;
+- Faces if the profile is face or shell.
+
+\b Side1 and \b Side2 groups contain edges generated from the first and
+last vertices of the profile edge or wire correspondingly. The first and
+last vertices are determined taking into account edge/wire orientation.
+
+\b Other group represents faces generated from the bounding edges of profile.
+
+The behavior in TUI is the following:
+- Each Python function that supports groups generation has a flag
+\b IsGenerateGroups which is equal to \b False by default.
+- If \b IsGenerateGroups is not set the groups are not created; the returned
+value is GEOM_Object that represents a result of the operation.
+- If \b IsGenerateGroups is set the operation returns a list of GEOM_Object.
+Its first element is a result, the remaining ones are the groups in the order:
+\b Down, \b Up, \b Side1, \b Side2 for opened profile or \b Down, \b Up,
+\b Other for closed profile.
+- If \b IsGenerateGroups is set and the path is closed an error occurs.
+
+*/
index c69418547ebbf10e564707fb3b4e96be27799a64..9736a29822525523b734f43acd523d697e4b2d00 100644 (file)
@@ -3,7 +3,9 @@
 \page create_isoline_page Isoline
 
 \b Isoline is a 3D curve built on a bounded face limited by <em> [Umin, Umax] </em> and <em> [Vmin, Vmax] </em>
-values of U and V parameters. For all points of the isoline U or V parameter value is constant. 
+values of U and V parameters. For all points of the isoline U or V parameter value is constant.
+
+Result of this operation is either a single edge or a compound of edges.
 
 To create an \b Isoline of a face in the <b>Main Menu</b> select <b>New Entity - > Basic - > Isoline</b>.
 
index a235bf0cd6a35f7e58e1566f91e178b793791085..5929a8fd1a21888417a43f9c4342130c92123a51 100644 (file)
@@ -28,9 +28,10 @@ the position of this point regarding the reference one.
 \n Thirdly, we can define a point by an \b Edge and a \b Parameter
 indicating its position on the Edge, ranging from 0.0 to 1.0. For example, 0.5 means that the
 point is located in the middle of the edge.
-\n <b>TUI Command:</b> <em>geompy.MakeVertexOnCurve(Edge,Parameter).</em>
+\n <b>TUI Command:</b> <em>geompy.MakeVertexOnCurve(Edge,Parameter,takeOrientationIntoAccount).</em>
 \n <b>Arguments:</b> Name + 1 edge  + 1 Parameter defining the
-position of the point on the given edge.
+position of the point on the given edge + flag that tells if it is necessary
+to take the edge orientation into account.
 \image html point3.png
 
 Alternatively, it is possible to define a point by an \b Edge and a \b Length.
@@ -53,8 +54,8 @@ projected on the given edge to produce the resulting point.
 projected point.
 \image html point3_2.png
 
-\n Fourthly, we can define a point by intersection of two \b Lines or \b Wires (or a Wire and a Line). 
-If they intersect only once, a point will be created. If there are several intersections, a compound of points will be created. The type of the selected object (Line or Wire) can be changed in the popup menu, after clicking the corresponding selection button. 
+\n Fourthly, we can define a point by intersection of two \b Lines or \b Wires (or a Wire and a Line).
+If they intersect only once, a point will be created. If there are several intersections, a compound of points will be created.
 \n <b>TUI Command:</b> <em>geompy.MakePointOnLinesIntersection(myLine1,myWire1).</em>
 \n <b>Arguments:</b> Name + 2 1D objects
 
@@ -75,6 +76,14 @@ The position of the point on it can be defined in one of two ways:
 
 \image html point5_2.png
 
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
 <b>Example:</b>
 
 \image html points.png "Points by edge and parameter and by coordinates"
index 7ec36434dfee03817d6e96adaaa7e73f06858204..2ca7f4ba9fd79e04fb2c0b5a85234884159a2a21 100644 (file)
@@ -9,93 +9,68 @@ To create a <b>2D Polyline</b> select in the main menu  <b>New Entity -> Basic -
 \image html polyline_dlg.png
 
 A polyline represents a section or a set of sections. Each section is constructed from a sequence of 2D points
-connected either by linear setgments or an interpolation curve. Every section has its own attributes:
+connected  by either linear segments or an interpolation curve. Every section has its own attributes:
 - \b Name, 
 - \b Type (Polyline or Spline),
 - \b Closed flag.
 
-A Polyline created represents a shape that lies on the XOY plane. It can have the following types:
+A created Polyline represents a shape that lies on the XOY plane. Its type can be one of the following:
 - \b Vertex for a single section with only 1 point.
-- \b Wire for a single section with 2 or more points. A Wire can have multiple edges for more then 2 points if the section type is Polyline.
-A single edge in the result wire is obtained for a Spline or Polyline with 2 points.
+- \b Wire for a single section with 2 or more points. A Wire can have multiple edges for more then 2 points if the section type is Polyline. A single edge in the resulting wire is obtained for a Spline or Polyline with 2 points.
 - \b Compound of Wires and/or Vertices if there are several sections.
 
-For the moment only one reference coordinate system for polyline creation is supported. The XOY plane of the <b>Global coordinate system</b>
-is suggested. Implementation of another reference coordinate system is a subject of further development of this functionality.
-Restore button orientates the viewer correspondingly to the chosen working plane and fits the scene to show all objects.
+For the moment only one reference coordinate system for polyline creation is supported, which is the XOY plane of the <b>Global coordinate system</b>. 
+\b Restore button orientates the viewer correspondingly to the chosen working plane and fits the scene to show all objects.
 For the moment this button works with only one plane.
 
-It is possible to import a shape in this dialog using <b>Import polyline</b> selection button. To do it an imported object should satisfy conditions
-for polyline shapes mentioned above. If a valid shape is selected, when dialog is opened, it is initialized by this shape.
-Though the shape can be on any plane, an imported polyline will be defined on XOY plane only due to the limitation.
+It is possible to import a shape in this dialog using <b>Import polyline</b> selection button. An imported object should meet the conditions for polyline shapes mentioned above. If a valid shape is selected, when the dialog is opened, it is initialized by this shape.
+Though the shape can be on any plane, the imported polyline will be defined on XOY plane only due to the limitation.
 
-The group \b Sections in this dialog represents the Polyline construction framework. Its toolbar has the following operations:
-- \b Undo
-- \b Redo
-- <b>Insert new section</b>
-- <b>Addition mode</b>
-- <b>Modification mode</b> - not implemented
-- <b>Detection mode</b> - not implemented
-- \b Remove
-- <b>Join selected sections</b>
+The group \b Sections in this dialog represents the Polyline construction framework. 
 
-<b>Undo/Redo</b> buttons allows to undo/redo changes of the polyline.
+The buttons <b>Undo</b> and <b>Redo</b> allow to undo or redo the changes of the polyline.
 
-<b>Insert new section</b> button opens a dialog that allows to add a new section:
+<b>Insert new section</b> button opens the corresponding dialog:
 
 \image html polyline_dlg_add_section.png
 
 In this dialog it is possible to choose:
-- \b Name of section
-- \b Type of section
-- \b Closed flag
+- \b Name of section;
+- \b Type of section;
+- Set \b Closed flag.
 
-To create a new section \b Add button should be clicked. \b Cancel button is used to cancel this operation.
-After clicking \b Add button a new section is appeared on the list. Its name supplemented by its type and closedness
-information (see icon) and the number of points (equal to 0 after creation).
+To create a new section, click \b Add button. \b Cancel button is used to cancel this operation.
+After clicking \b Add button a new section appears in the list. Its name is generated automatically depending on its type, closed or opened state and the number of points (equal to 0 after creation).
 
-To modify section parameters it is possible to double-click on a section in the list. In this case the following dialog appears:
+To modify section parameters, double-click on a section in the list. In this case the following dialog appears:
 
 \image html polyline_dlg_edit_section.png
 
-To apply modifications the button \b Ok should be clicked.
+To apply the modifications, click \b Ok button.
 
-<b>Addition mode</b> allows to add points to a section. It is necessary to select a particular section in a list of sections
-and make some mouse clicks in the viewer. A section preview is recomputed after each click.
+<b>Addition mode</b> allows adding points to a section. Select a particular section in the list of sections
+and left-click in the viewer to add new nodes to the section. A section preview is recomputed after each click.
 
 <b>Modification mode</b> and <b>Detection mode</b> are not implemented for the moment.
 
-\b Remove button allows to remove a section. It is available if all modes are deactivated and one section is selected.
+\b Remove button allows removing a section. It is available if all modes are deactivated and one section is selected.
 
 <b>Join selected sections</b> button is available in modification mode if two or more sections are selected. It is used to
-merge several sections into the first one from selection list. Joined section has parameters of the first selected one. Points of
-the other sections are appended at the end of the list of the first section points.
+merge several sections into the first one from the selection list. The points of the merged sections are appended at the end of the list of points of the first section.
 
-Some actions are available via popup menu by right mouse button click.
+Some actions are available via the context menu activated by right mouse button click.
+- <b>Join all sections</b> - joins all defined sections into the first one.
+- \b Join - joins two or more selected sections.
+- <b>Clear all</b> - removes all selected sections. 
+- <b>Set closed</b> - sets \b Closed flag for all selected section.
+- <b>Set open</b>  - unset \b Closed flag for all selected sections.
+- <b>Set polyline</b> - sets the type of all selected sections to Polyline.
+- <b>Set spline</b>  - set the type of all selected sections to Spline. 
 
-If all modes are deactivated:
-- <b>Join all sections</b> - join all defined sections into the first one.
-- \b Join - join sections. Available if two or more sections are selected.
-
-In <b>Addition mode</b>:
-- <b>Join all sections</b> - join all defined sections into the first one.
-
-In <b>Modification mode</b>:
-- <b>Join all sections</b> - join all defined sections into the first one.
-- \b Join - join sections. Available if two or more sections are selected.
-- <b>Clear all</b> - remove all sections. Available if at least one section is selected.
-- <b>Set closed</b> - set all selected section's Closed flag. Available if at least one section is selected.
-- <b>Set open</b>  - reset all selected section's Closed flag. Available if at least one section is selected.
-- <b>Set polyline</b> - set all selected section's type to Polyline. Available if at least one section is selected.
-- <b>Set spline</b>  - set all selected section's type to Spline. Available if at least one section is selected.
-
-In <b>Detection mode</b>:
-- <b>Join all sections</b> - join all defined sections into the first one.
-- \b Join - join sections. Available if two or more sections are selected.
+Different actions are available depending on the mode and selection.  
 
 <h2>TUI Commands</h2>
 
-
 To create the 2D polyline in TUI Polyline2D interface is used.
 
 <em>pl = geompy.Polyline2D()</em> - returns an instance of Polyline2D interface <i>pl</i>.
@@ -103,5 +78,5 @@ To create the 2D polyline in TUI Polyline2D interface is used.
 See the \ref gsketcher.Polyline2D "Polyline2D" interface documentation for more information.
 
 Our <b>TUI Scripts</b> provide you with useful examples of the use of
-\ref tui_polyline_page "2D Polyline".
+\ref tui_creation_polyline "2D Polyline".
 */
index 32cc8783ce2d37850828216dc1fb78235dbdf533..822b8d95313ce27fab974cddd600bff8a0e3b731 100644 (file)
@@ -6,7 +6,7 @@ To create a \b Shell in the <b>Main Menu</b> select <b>New Entity - >
 Build - > Shell</b>
 
 \n You can create a \b Shell from a compound of faces or a list of faces or shells.
-\n The \b Result will be a \b GEOM_Object (shell).
+\n The \b Result will be a \b GEOM_Object. It can be either a single shell or, in specific cases, a compound of shells.
 
 \n <b>TUI Command:</b> <em>geompy.MakeShell(ListOfShape)</em>
 \n <b>Arguments:</b> Name + Compound of faces or List of faces having connected edges.
index a4d3fb6471d6940d3971141779ba866a439cca94..e59f403b163c3976e47df43dce8b103f6c1badb9 100644 (file)
@@ -14,11 +14,11 @@ In this dialog you can specify the following parameters:
 - <b>Max BSpline surface degree</b> of the resulting BSpline surface;
 - <b>3D tolerance of initial approximation</b>
 
-\note <b>3D tolerance of initial approximation</b> represents a tolerance of
+\note <b>3D tolerance of the initial approximation</b> represents the tolerance of
 initial plate surface approximation. If this parameter is equal to 0 (default),
 its value is automatically computed as <em> max(0.0001, 10*error)</em>,
-where <em>error</em> is a 3D tolerance of the surface representing a maximal
-distance between computed plate surface and given points.
+where <em>error</em> is the 3D tolerance of the surface representing the maximal
+distance between the computed plate surface and given points.
 
 <b>Advanced options:</b> \ref preview_anchor "Preview"
 
@@ -28,7 +28,7 @@ Press "Apply" or "Apply & Close" button to get the resulting <em>GEOM_Object(Sur
 - \em thelPoints is a list of points or compounds of points;
 - \em theNbMax maximum number of Bezier pieces in the resulting surface;
 - \em theDegMax maximum degree;  
-- \em theDMax specifies 3D tolerance of initial approximation
+- \em theDMax specifies 3D tolerance of the initial approximation.
 
 Example:
 
index 48a05750e9d2d56ba4fe96e69f4912e20443cf97..4fe113e2d985a78fffaf6648625fdd25ba2b9e95 100644 (file)
@@ -2,24 +2,40 @@
 
 \page create_solid_page Solid
 
-\n To create a \b Solid in the <b>Main Menu</b> select <b>New Entity - > Build - >
+To create a \b Solid in the <b>Main Menu</b> select <b>New Entity - > Build - >
 Solid</b>.
 
-You can create a \b Solid from a list of shells.
+Firstly, you can create a \b Solid from a list of shells.
 
 The \b Result will be a  \b GEOM_Object (SOLID).
 
-\n <b>TUI Command:</b> <em>geompy.MakeSolid(ListOfShape),</em> where
-ListOfShape is a list of shells from which the solid is constructed.
-\n <b>Arguments:</b> Name + A closed shell or a list of closed shells.
+<b>TUI Command:</b> <em>geompy.MakeSolid(ListOfShape),</em> where
+\c ListOfShape is a list of shells from which the solid is constructed.
+
+<b>Arguments:</b> Name + A closed shell or a list of closed shells.
 
 \image html neo-obj6.png
 
-\n <b>Example:</b>
+<b>Example:</b>
 
 \image html solidsn.png "Solid"
 
+Secondly, it is possible to create a \b Solid (or a compound of solids) from a list of
+connected faces or shells.
+
+The \b Result will be a \b GEOM_Object (SOLID or COMPOUND).
+
+<b>TUI Command:</b> <em>geompy.MakeSolidFromConnectedFaces(ListOfShape, isIntersect),</em> where
+\c ListOfShape is a list of faces and/or shells from which the solid is constructed and 
+\c isIntersect is a boolean flag which, when set to \c True, forces performing intersection/sewing
+between arguments
+
+<b>Arguments:</b> Name + A set of connected faces and/or shells + Boolean flag.
+
+\image html neo-obj6_2.png
+
 Our <b>TUI Scripts</b> provide you with useful examples of creation of 
-\ref tui_creation_solid "Advanced Geometric Objects".
+\ref tui_creation_solid "Solid from shell" and
+\ref tui_creation_solid_from_faces "Solid from connected faces".
 
 */
diff --git a/doc/salome/gui/GEOM/input/creating_surface_from_face.doc b/doc/salome/gui/GEOM/input/creating_surface_from_face.doc
new file mode 100644 (file)
index 0000000..a707dc6
--- /dev/null
@@ -0,0 +1,27 @@
+/*!
+
+\page create_surface_from_face_page Surface From Face
+
+To create a <b>Surface From Face</B> in the <b>Main Menu</b> select <b>New Entity - > Basic - > Surface From Face</b>
+
+\n This function takes a face at input and creates a new
+<b>GEOM_Object</b>, i.e. topological shape by extracting the underlying surface
+of the source face and limiting it by the <b>Umin, Umax, Vmin</b> and <b>Vmax</b>
+parameters of the source face (in the parametric space).
+\n
+\ref restore_presentation_parameters_page "Advanced options".
+
+\n <b>TUI Command:</b> <em>geompy.MakeSurfaceFromFace(theFace)</em>,
+where \em theFace the input face.
+\n <b>Arguments:</b> Name + Object (Face).
+
+\image html surface_from_face1.png "Surface From Face"
+
+\n <b>Example:</b>
+
+\image html surface_from_face_example.png "Original Face (white) and Created Surface"
+
+Our <b>TUI Scripts</b> provide you with useful examples of the use of
+\ref tui_creation_surface "Surface From Face" creation.
+
+*/
diff --git a/doc/salome/gui/GEOM/input/creating_thickness_page.doc b/doc/salome/gui/GEOM/input/creating_thickness_page.doc
new file mode 100644 (file)
index 0000000..88dfc22
--- /dev/null
@@ -0,0 +1,48 @@
+/*!
+
+\page create_thickness_page Thickness Construction
+
+To add \b Thickness to a shape in the <b>Main Menu</b> select <b>New Entity - > Generation  - > Thickness</b>.
+
+Switch between adding thickness to a Face (Shell) or a Solid using radio buttons.
+
+Firstly, \b Thickness can be applied to a Face or a Shell to create a Solid.
+
+\image html thickness.png
+
+It is necessary to define an \b Object (Face or Shell) and the value of \b Thickness.
+<b>Thicken towards the inside</b> check box allows changing the thickness direction.
+
+<b>Example:</b>
+
+\image html thickness_result.png "Thickness of Shell"
+
+Secondly, the \b Thickness can be applied to a Solid to create a hollowed Solid. 
+
+\image html thicksolid.png
+
+It is necessary to define a Solid \b Object \b Faces to be removed from the result and \b Thickness.
+<b>Thicken towards the inside</b> check box allows changing the thickness direction.
+
+<b>Example:</b>
+
+\image html thicksolid_result.png "Thickness of Solid"
+
+\n <b>TUI Commands:</b>
+\n
+<em>geompy.MakeThickSolid(theShape, theThickness, theFacesIDs=[])</em> -
+Makes a thick solid from a shape;
+\n
+<em>geompy.Thicken(theShape, theThickness, theFacesIDs=[])</em> -
+Modifies a shape to make it a thick solid.
+
+<b>Arguments:</b> Name + 1 shape (face, shell or solid) + thickness +
+the list of face IDs.
+\n If the shape is a face or a shell the list of face IDs is not used.
+The thickness can be positive or negative for thickening towards the inside.
+\n\n <b>Advanced options</b> \ref preview_anchor "Preview"
+
+Our <b>TUI Scripts</b> provide you with useful examples of creation of
+\ref tui_creation_thickness "Complex Geometric Objects".
+
+*/
index e44dba4004e11d2995b53040551f5384bbaa9f21..b9bbe9566423190ef2ab915a37f7ff73489b9dcd 100644 (file)
 
 \anchor dependency_tree_general_description_anchor <h2>General description</h2>
 
-In order to better understand the relations between the %GEOM 
-objects in a study the user has a possibility to display the 
-ascendants and descendant of the object(s) in a family tree.
-
-User can build the dependency tree by selecting desirable object 
-in Object Browser or OCC Viewer and calling "Show dependency tree" 
-popup item. It will open a new or clear the existing "Dependency 
-Tree" view window (only one view is supported) and display a 
-dependency tree for the selected object or objects (multiple 
-selection is supported). Also user can rebuild the tree if to select 
-some object(s) right in the "Dependency Tree" view and call 
-"Rebuild the tree" popup menu item.
+You can display the ascendants and descendants of object(s) in a tree structure to better understand the relations between the %GEOM 
+objects in a study .
+
+To build the dependency tree, select the necessary object or objects (multiple 
+selection is supported) in the Object Browser or OCC Viewer and call "Show dependency tree" context menu item. 
 
 \image html tree_example.png
 
-User can change all necessary parameters of Dependency Tree Viewer 
-in \ref pref_dependency_tree "Preferences".
+
+"Dependency Tree" view window will display the dependency tree for the selected object. 
+It is also possible to select an object(s) directly in the "Dependency Tree" view and to rebuild the tree by selecting 
+"Rebuild the tree" context menu item.
+
+All necessary parameters of Dependency Tree Viewer can be edited in the \ref pref_dependency_tree "Preferences".
+
+\note This functionality is available only if the GUI module is built with Graphics view (option SALOME_USE_GRAPHICSVIEW is ON when building GUI module).
 
 <hr>
 \anchor dependency_tree_nodes_anchor <h2>Nodes</h2>
@@ -37,62 +36,48 @@ in \ref pref_dependency_tree "Preferences".
 Tree nodes in the Dependency Viewer are named according to the study 
 names of the corresponding objects. 
 
-Non-published objects are shown in the tree as "unpublished" and 
-colored in special color.
-
-All nodes have the fixed size, so the long names are cut and shown 
-with ellipsis; full name of the object can be seen in the tooltip 
-if to keep the cursor over the node.
+All nodes have fixed size, so long names are cut; the full object name can be seen in the tool-tip 
+when the cursor is hovered over the node.
 
 "Dependency Tree" view supports the following states of nodes:
 
-<ul><li><b>Main node</b> - node of main object(s), which were selected in Object 
-Browser, OCC Viewer or Dependency Tree Viewer in order to build the 
-dependency tree;</li></ul>
+<ul><li><b>Main node</b> - corresponds to the main object(s) selected in Object 
+Browser, OCC Viewer or Dependency Tree Viewer;</li></ul>
 \image html tree_main_node.png
 
-<ul><li><b>Default node</b> - node of published in study object, which participate in building of 
-dependency tree as ascendant or descendant;</li></ul>
+<ul><li><b>Default node</b> - ascendant or descendant node of the dependency tree corresponding to an object published in the study;</li></ul>
 \image html tree_default_node.png
 
-<ul><li><b>Unpublished node</b> - the same as "Default node", but 
-corresponding object was not published in study;</li></ul>
+<ul><li><b>Unpublished node</b> - corresponds to an object that was not published in the study;</li></ul>
 \image html tree_unpublished_node.png
 
-<ul><li><b>Highlighted node</b> - the state of node when mouse 
-cursor is over it;</li></ul>
+<ul><li><b>Highlighted node</b> - the state of a node when the mouse cursor is hovered over it;</li></ul>
 \image html tree_highlighted_node.png
 
-<ul><li><b>Selected node</b> - the state of node when user 
-clicks the left mouse button on node.</li></ul>
+<ul><li><b>Selected node</b> - the state of node when the user clicks the left mouse button it.</li></ul>
 \image html tree_selected_node.png
 
 <hr>
 \anchor dependency_tree_links_anchor <h2>Links</h2>
 
 Dependency Tree Viewer shows oriented links between nodes to 
-represent dependency direction. Viewer supports the following states 
-of links:
+represent the dependency direction. The viewer supports the following states of links:
 
-<ul><li><b>Unidirectional link</b> - shows that A object depends on 
-B object;</li></ul>
+<ul><li><b>Unidirectional link</b> - shows that object \b B depends on object \b A;</li></ul>
 \image html tree_unidir_link.png
 
-<ul><li><b>Bidirectional link</b> - shows that A object depends on 
-B object and, at the same time, B object depends on 
-A object;</li></ul>
+<ul><li><b>Bidirectional link</b> - shows that object \b B depends on 
+object \b A and, at the same time, object \b A depends on object \b B;</li></ul>
 \image html tree_bidir_link.png
 
-<ul><li><b>Self-dependency link</b> - shows that object depends on 
-itself;</li></ul>
+<ul><li><b>Self-dependency link</b> - shows that an object depends on itself;</li></ul>
 \image html tree_selfdep_link.png
 
-<ul><li><b>Cyclic dependency links</b> - shows cyclic dependency of 
-some nodes.</li></ul>
+<ul><li><b>Cyclic dependency links</b> - shows cyclic dependency of some nodes.</li></ul>
 \image html tree_cycldep_link.png
 
 <hr>
-\anchor dependency_tree_operations_anchor <h2>Operations</h2>
+\anchor dependency_tree_operations_anchor <h2>Viewer Operations</h2>
 
 The dependency tree of a chosen %GEOM object is displayed in 
 the dedicated 2D view window.
@@ -103,10 +88,9 @@ Buttons marked with small downward triangles have extended
 functionality which can be accessed by locking on them with left 
 mouse button.
 
-\image tree_tool_bar
+\image html tree_tool_bar.png
 
-<b>Dump View</b> - exports an object from the viewer in bmp, png or
-jpeg image format.
+<b>Dump View</b> - exports the current scene in bmp, png or jpeg image format.
 \image html tree_view_dump.png
 
 <b>Fit all</b> - scales the presentation so that it could fit within
@@ -140,38 +124,32 @@ levels to be shown in the dependency tree.
 <ul>
 <li>Level 1 corresponds to the parents and children of the selected 
 object(s);</li>
-<li>Level 2 is Level 1 plus the grand-parents and grand-children 
+<li>Level 2 adds the grand-parents and grand-children 
 of the selected object(s);</li>
 <li>etc...</li>
 </ul>
 
-<b>Display ascendants</b> - allows user to control the displaying 
-of ascendants.
+<b>Display ascendants</b> - allows showing/hiding the ascendants.
 \image html tree_disp_ascendants.png
 
-<b>Display descendants</b> - allows user to control the displaying 
-of descendants.
+<b>Display descendants</b> - allows showing/hiding the descendants.
 \image html tree_disp_descendants.png
 
-<b>Move nodes</b> - enables/disables of moving the nodes.
+<b>Move nodes</b> -if checked, it is possible to move nodes in the viewer.
 \image html tree_move_nodes.png
 
-<b>Update</b> - allows user to update a dependency tree model and the view.
+<b>Update</b> - updates the dependency tree view, reflecting changes introduced in the hierarchy.
 \image html tree_button_update.png
 
 <hr>
-\anchor dependency_tree_navigation_anchor <h2>Navigation</h2>
-
-Dependency Tree 2D Viewer supports the following navigation mode:
+\anchor dependency_tree_navigation_anchor <h2>Selection and Shortcuts</h2>
 
 <ul>
-<li>rectangle selection in this mode is performed by the left mouse 
-button</li>;
-<li>multiple selection is available when \b Shift button 
+<li>It is possible to select multiple nodes in the view by rectangle selection or by clicking nodes when \b Shift button 
 is pressed.</li>
 </ul>
 
-Also, holding \b Ctrl key with pressed mouse buttons performs 
+Holding \b Ctrl key with pressed mouse buttons performs 
 the following view transformations:
 <ul>
 <li>Ctrl + left mouse button - zooming;</li>
@@ -179,33 +157,23 @@ the following view transformations:
 </ul>
 
 <hr>
-\anchor dependency_tree_popup_menu_anchor <h2>Popup Menu</h2>
+\anchor dependency_tree_popup_menu_anchor <h2>Context Menu</h2>
 
-After the object has appeared in the Dependency Tree 2D Viewer, 
-user can select it with left mouse click to change its presentation 
-parameters and get access to other useful options by right-clicking on 
-the selected object.
+The following operations are available from the context menu of the selected object.
 
 \image html tree_popup_menu1.png
 
 <ul>
-<li>\b Show - allows to show selected object(s) in OCC 3D Viewer;</li>
-<li><b> Show Only</b> - allows to show only selected object(s) 
-in OCC 3D Viewer;</li>
-<li><b> Rebuild the tree</b> - allows to rebuild the dependency tree 
+<li>\b Show - shows the selected object(s) in OCC 3D Viewer;</li>
+<li><b> Show Only</b> - shows only the selected object(s) in OCC 3D Viewer;</li>
+<li><b> Rebuild the tree</b> - rebuilds the dependency tree 
 for selected object(s);</li>
-<li>\ref reduce_study_page "Reduce study" - allows to reduce study.</li>
-</ul>
-
-Some functionalities are available through right-clicking on 
-the viewer background:
+<li>\ref reduce_study_page "Reduce study" - allows reducing the study.</li>
 
 \image html tree_popup_menu2.png
 
-Dependency Tree 2D Viewer background can be customized using the 
-"Change background" popup menu command that opens standard 
-"Select Color" dialog box:
-
-\image html selectcolor.png
+<li>It is also possible to customize the background of Dependency Tree 2D Viewer using the 
+corresponding context menu command.</li>  
+</ul>
 
 */
index f8f2184e7d00e7a18e297a6c3de8f2a8c45e304c..af842ccf1dff480a731e446fb79062bdb830887e 100644 (file)
@@ -29,7 +29,7 @@ functionality for all objects in the current view via the main menu
 
 \n <b>TUI Command:</b> <em>gg.setVectorsMode(ID, Bool)</em>
 
-\n Also it is possible to show the vertices of the selected
+\n It is possible to show the vertices of the selected
 shape. For this, choose in the context menu of the shape
 <b>Display mode -> Show Vertices</b>, or apply this
 functionality for all objects in the current view via the main menu
@@ -40,6 +40,16 @@ functionality for all objects in the current view via the main menu
 
 \n <b>TUI Command:</b> <em>gg.setVerticesMode(ID, Bool)</em>
 
+\n To show the name of the selected shape, choose in its context menu
+<b>Display mode -> Show Name</b>, or apply this
+functionality for all objects in the current view via the main menu option
+<b> View -> Display Mode -> Show/Hide Name.</b>
+
+\image html name_mode.png
+<center><em>Name Mode (Show Name)</em></center>
+
+\n <b>TUI Command:</b> <em>gg.setNameMode(ID, Bool)</em>
+
 Our <b>TUI Scripts</b> provide you with useful examples of 
 \ref tui_change_disp_mode "Changing Display Parameters".
 
diff --git a/doc/salome/gui/GEOM/input/extension_operation.doc b/doc/salome/gui/GEOM/input/extension_operation.doc
new file mode 100644 (file)
index 0000000..dd2ad27
--- /dev/null
@@ -0,0 +1,55 @@
+/*!
+
+\page extension_operation_page Extension 
+
+\n To produce an \b Extension of an Edge or a Face select in the <b>Main Menu</b> 
+<b>Operations - > Transformation - > Extension</b>. The type of extension is defined using the radio buttons.
+
+Firstly it is possible to resize an \b Edge by modifying its first
+and last parameters
+
+\image html extension1.png "Edge Extension" 
+
+\n <b>TUI Command:</b> <em>geompy.ExtendEdge(theEdge, theMin, theMax)</em>,
+where \em theEdge the input edge to be resized, \em theMin the minimal
+parameter value, \em theMax the maximal parameter value.
+\n <b>Arguments:</b> Name + Object (Edge) + 2 values (Min and Max Parameters).
+
+\n <b>Example:</b>
+
+\image html extend_edge_example.png "Original edge (white) and extended edge"
+
+\note The input Edge parameters range is [0, 1]. If \b theMin parameter is
+      negative, the input Edge is extended, otherwise it is shrinked by
+      \b theMin parameter. If \b theMax is greater than 1, the Edge is
+      extended, otherwise it is shrinked by \b theMax parameter.
+       
+Secondly it is possible to resize a \b Face by modifying its 
+minimal and maximal U- and V-Parameters. 
+
+ \image html extension2.png "Face Extension" 
+\n <b>TUI Command:</b> <em>geompy.ExtendFace(theFace, theUMin, theUMax,
+theVMin, theVMax)</em>, where \em theFace the input face to be resized,
+\em theUMin the minimal U-Parameter value, \em theUMax the maximal U-Parameter
+value, \em theVMin the minimal V-Parameter value, \em theVMax the maximal
+V-Parameter value.
+\n <b>Arguments:</b> Name + Object (Face) + 4 values (Min and Max U- and
+V-Parameters).
+
+
+\n <b>Example:</b>
+
+\image html extend_face_example.png "The original face (gray) and a result face shrinked along U-Direction and extended along V-Direction"
+
+\note The input Face U- and V-Parameters range is [0, 1]. If \b theUMin
+      parameter is negative, the input Face is extended, otherwise it is
+      shrinked along U-Direction by \b theUMin parameter. If \b theUMax is
+      greater than 1, the Face is extended, otherwise it is shrinked along
+      U-Direction by \b theUMax parameter. The same applies to \b theVMin, \b theVMax
+      and V-Direction of the input Face.
+
+Our <b>TUI Scripts</b> provide you with useful examples of the use of
+\ref tui_extend "Extension Operations".
+
+*/
index 78fa0d58cdb60aa6e351fbecb3cbe82264ce1009..3976f44ea04828ed2f022a10052f3e4bbc2542f3 100644 (file)
@@ -6,6 +6,7 @@ Here you can find the answers to some frequently asked questions:
 
 <ul>
 <li>\subpage partition_explanation "What is the difference between partition, compounds and fuse operation ?" </li>
+<li>\subpage size_models_range "What are the valid sizes of models ?" </li>
 </ul>
 
 
diff --git a/doc/salome/gui/GEOM/input/fast_intersection.doc b/doc/salome/gui/GEOM/input/fast_intersection.doc
new file mode 100644 (file)
index 0000000..f27a6d9
--- /dev/null
@@ -0,0 +1,60 @@
+/*!
+\page fast_intersection_page Fast intersection
+
+This operation checks if two selected shapes are overlapped.
+
+This tool is useful for fast detection of intersections and gaps.
+In contrast to Boolean Operations, Partition and Detect Self-intersection 
+algorithms that compute topological intersections, this algorithm computes 
+intersections by generating tessellation (triangulation) of the source 
+shapes and detecting overlapping of resulting meshes. High performance is 
+achieved through the use of existing triangulation of faces.
+Due to this fact, the tool is not suitable for computing exact intersection
+of shapes; however, it can be used to quickly find zones where
+intersections can present, and then use these results in further analysis.
+
+\note For more information about Partition and Boolean Operations Algorithms
+and their limitations refer to <a href="SALOME_BOA_PA.pdf">this document</a>.
+
+\image html measures12.png
+
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
+In this dialog:
+
+- <b> Object 1 </b> and <b> Object 2 </b> the checked objects. \b Selection button allows picking them in the viewer or in the object browser.
+- <b>Deflection coefficient</b> specifies the quality of shapes tessellation.
+- <b>Detect gaps</b> - when switched on, allows detecting gaps between shapes. 
+- <b>Tolerance</b> - specifies the distance between shapes used for detecting gaps.
+- <b>Compute intersections</b> - press this button to compute interferences.
+- <b>Sub-shapes of Object 1</b> - list of sub-shapes from the first source shape that localize the intersection.
+- <b>Sub-shapes of Object 2</b> - list of sub-shapes from the second source shape that localize the intersection.
+- \b Apply and <b>Apply and Close</b> buttons are used to store selected intersected shapes in the study for
+further analysis (see below).
+
+\note The result quality depends on the quality of triangulation. Changing the value of the deflection coefficient
+parameter can strongly affect the result. However, small values of the deflection coefficient might lead to
+some performance loss of the algorithm, as number of triangles of the tesselation mesh depends on this parameter.
+
+Press <b>Apply and Close</b> or \b Apply button to store the selected sub-shapes in the study for further analysis.
+The selection will be published as a compound containing intersected sub-shapes from both source objects.
+
+<b>TUI Command:</b> <em>geompy.FastIntersect(theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001),</em> \n
+where:
+- \em theShape1 First shape.
+- \em theShape2 Second shape.
+- \em theTolerance When it is negative or equal to zero, the function detects intersections;
+                   when it is positive, the function detects gaps.
+- \em theDeflection Linear deflection for shapes; if deflection <= 0, default deflection 0.001 is used
+
+<b>Result:</b> Boolean + two lists of IDs of sub-shapes (from input shapes) that localize the intersection.
+
+See also a \ref tui_fast_intersection_page "TUI example".
+
+*/
\ No newline at end of file
index a5996032b43c87c728f8ecd4d9dc6d50fd3ec6c0..f51ece8b218078fe0d8f8c359ff26e096e2d3f5a 100644 (file)
@@ -8,6 +8,8 @@ A free face is a face, which is not shared between several sub-shapes of the sha
 
 \image html repair10.png
 
+Press \b Apply or <b>Apply and Close</b> button to publish the corresponding faces in the study. 
+
 <b>TUI Command:</b> <em>GetFreeFacesIDs(Shape),</em> where \em Shape is
 a shape to be checked.
 
@@ -15,4 +17,4 @@ a shape to be checked.
 
 See also a \ref tui_free_faces_page "TUI example".
 
-*/
\ No newline at end of file
+*/
index 5e9e94e7d69859a5e6d7ebfe81ae93187af5e3ba..454ac3210d5257adab477d9f64429418fd533d06 100644 (file)
@@ -4,10 +4,10 @@
 
 \anchor pref_settings <h2>Settings</h2>
 
-In the \b Geometry module you can set preferences for visualisation of
-geometrical figures, which can be used in later sessions with this module.
-There is also a special group of preferences controlling input
-precision for floating-point data.
+In the \b Geometry module you can set preferences for visualization of
+geometrical figures, which can be used right now or in later sessions 
+with this module according to the preferences.
+
 
 \image html pref15.png
 
@@ -33,6 +33,8 @@ default color for edges, vectors and wires (isolated lines).</li>
 vertices.</li>
 <li><b>Color of isolines</b> - allows to select default color for
 isolines.</li>
+<li><b>Color of labels</b> - allows to select default color for
+labels (textual fields, shape name).</li>
 <li><b>Top level color</b> - allows to select default color for objects which 
 were brought to the viewer foreground.</li>
 <li><b>Top level display mode</b> - allows to select default top level display mode between:</li>
@@ -47,16 +49,16 @@ place (in the back) and add the additional wireframe actor in the viewer foregro
 <li><b>Shading With Edges</b> - allows to switch display mode to shading with edges mode after 
 "top-level" operation.</li>
 </ul>
-<li><b>Transparency</b> - allows to define default transparency value.</li>
-<li><b>Deflection coefficient</b> - allows to define default deflection
+<li><b>Default transparency</b> - allows to define default transparency value.</li>
+<li><b>Default deflection coefficient</b> - allows to define default deflection
 coefficient for lines and surfaces. A smaller coefficient provides
 better quality of a shape in the viewer.</li>
 <li><b>Show predefined materials in popup menu</b> - allows to customize the displaying of popup menu with list of 
 predefined materials.</li>
 <li><b>Default material</b> - allows to define default material.</li>
 <li><b>Subshapes color for editing a group</b> - allows to select default color for subshapes in a group.</li>
-<li><b>Edges width</b> - allows to define default width of the edges.</li>
-<li><b>Isolines width</b> - allows to define default width of the isolines.</li>
+<li><b>Default edges width</b> - allows to define default width of the edges.</li>
+<li><b>Default isolines width</b> - allows to define default width of the isolines.</li>
 <li><b>Preview edges width</b> - allows to define width of the edges for preview.</li>
 <li><b>Measures line width</b> - allows to define lines width of measurements tools.</li>
 <li><b>Step value for spin boxes</b> - allows to define the increment
@@ -67,7 +69,7 @@ of values set in spin boxes.</li>
 </ul>
 
 <ul>
-<li><b>Dimensions (Measurements)</b></li>
+<li><b>Dimensions (Measurements)</b> - a group of preferences controlling the presentation of dimensions.</li>
 <ul>
 <li><b>Color</b> - allows to define color for persistent dimension presentations.</li>
 <li><b>Line width</b> - allows to define pixel width of dimension lines.</li>
@@ -81,7 +83,7 @@ of values set in spin boxes.</li>
 </ul>
 
 <ul>
-<li><b>Number of isolines</b> - allows to specify the number of isolines along <b>Along U</b> and <b>Along V</b> coordinate axes. They are shown on each selected face. For example:
+<li><b>Default number of isolines</b> - allows to specify the default number of isolines along <b>Along U</b> and <b>Along V</b> coordinate axes. They are shown on each selected face. For example:
 
 \image html isos.png
 
@@ -91,7 +93,8 @@ By default <b>Along U</b> and <b>Along V</b> are null and isolines are not drawn
 </ul>
 
 <ul>
-<li><b>Input fields precision</b></li>
+<li><b>Input fields precision</b> - a group of preferences controlling input
+precision for floating-point data.</li>
 <ul>
 <li><b>Length precision</b> - allows to adjust input precision of coordinates and dimensions.</li>
 <li><b>Angular precision</b> - allows to adjust input precision of angles.</li>
@@ -105,26 +108,15 @@ By default <b>Along U</b> and <b>Along V</b> are null and isolines are not drawn
 </ul>
 
 <ul>
-<li><b>Marker of Points</b></li>
+<li><b>Default marker of points</b></li>
 <ul>
-<li><b>Type</b> - allows to select the symbol for representation of
+<li><b>Type</b> - allows to select the default symbol for representation of
 points (cross, asterisk, etc.).</li>
-<li><b>Size</b> - allows to define the size of the marker from 1
+<li><b>Size</b> - allows to define the default size of the marker from 1
 (smallest) to 7 (largest).</li>
 </ul>
 </ul>
 
-<ul>
-<li><b>Origin and base vectors</b></li>
-<ul>
-<li><b>Length of base vectors</b> - allows to define the length
-of base vectors.</li>
-<li><b>Auto create</b> - allows to automatically create a point
-of origin and three base vectors of the rectangular coordinate
-system immediately after the module activation.</li>
-</ul>
-</ul>
-
 <ul>
 <li><b>Scalar bar for field presentation</b></li>
 <ul>
@@ -137,42 +129,51 @@ system immediately after the module activation.</li>
 </ul>
 </ul>
 
+<ul>
+<li><b>Origin and base vectors</b></li>
+<ul>
+<li><b>Length of base vectors</b> - allows to define the length
+of base vectors.</li>
+<li><b>Auto create</b> - allows to automatically create a point
+of origin and three base vectors of the rectangular coordinate
+system immediately after the module activation.</li>
+</ul>
+</ul>
 
 <ul>
 <li><b>Operations</b></li>
 <ul>
 <li><b>Preview</b> - allows to customize the displaying preview by default.</li>
+<li><b>Hide input objects from the viewer</b> - allows automatic hiding of input 
+shapes from the 3D viewer (OCC and VTK) in all operations of Geometry module.</li>
 </ul>
 </ul>
 
 \anchor pref_dependency_tree <h2>Dependency Tree</h2>
 
-Also user can set preferences for visualisation of <b>Dependency Tree</b> in 2D Viewer.
+This tab groups preferences for visualization of <b>Dependency Tree</b> in the 2D Viewer.
 
 \image html pref_dep_tree.png
 
 <ul>
 <li><b>General</b></li>
 <ul>
-<li><b>Hierarchy type</b> - allows to choose default displaying mode of dependency tree.</li>
-<li><b>Possibility to move nodes</b> - enable/disable the possibility of moving nodes by default.</li>
+<li><b>Hierarchy type</b> - allows to choose the default display mode of the dependency tree.</li>
+<li><b>Possibility to move nodes</b> - enables/disables the possibility of moving nodes by default.</li>
 </ul>
 </ul>
 
 <ul>
 <li><b>Color</b></li>
 <ul>
-<li><b>Background color</b> - allows to select default background color.</li>
-<li><b>Default node color</b> - allows to select default node color.</li>
-<li><b>Main node color</b> - allows to select default main node color.</li>
-<li><b>Unpublished node color</b> - allows to select default node color
-for unpublished objects.</li>
-<li><b>Selected node color</b> - allows to select default selected node color.</li>
-<li><b>Default arrow color</b> - allows to select default arrow color.</li>
-<li><b>Highlighted arrow color</b> - allows to select default highlighted 
-arrow color.</li>
-<li><b>Selected arrow color</b> - allows to select default selected 
-arrow color.</li>
+<li><b>Background color</b> - allows to select the default background color.</li>
+<li><b>Default node color</b> - allows to select the default node color.</li>
+<li><b>Main node color</b> - allows to select the default main node color.</li>
+<li><b>Unpublished node color</b> - allows to select the default node color for unpublished objects.</li>
+<li><b>Selected node color</b> - allows to select the default selected node color.</li>
+<li><b>Default arrow color</b> - allows to select the default arrow color.</li>
+<li><b>Highlighted arrow color</b> - allows to select the default highlighted arrow color.</li>
+<li><b>Selected arrow color</b> - allows to select the default selected arrow color.</li>
 </ul>
 </ul>
 
index c483ca71ccd6c90c64b4df02bcaeed659b3e3d6f..a39809963aee53de68a9f52c947374d30301cb38 100644 (file)
@@ -31,6 +31,7 @@ provided by Geometry module.
     <li>\ref tui_working_with_groups_page</li>
     <li>\ref tui_building_by_blocks_page</li>
     <li>\ref tui_sketcher_page</li>
+    <li>\ref tui_3dsketcher_page</li>
     <li>\ref tui_advanced_geom_objs_page</li>
   </ul>
   <li>\subpage tui_viewing_geom_objs_page</li>
index 79f6ba0219ef9b3b633145648cad4ad9e74f8cb6..e2b566dd30431580ae53f5be5f6aac1fa4573e47 100644 (file)
@@ -5,24 +5,45 @@
 
 This operation retrieves all non-block solids and non-quadrangular faces from the selected shape.
 
-A non-block solid is a solid that does not have 6 faces, or has 6 faces, but some of them are not quadrangular.
+A block solid is a solid that has 6 quadrangular faces.
+
+A quadrangular face is a face that has 1 wire with 4 edges. If there are
+more than 4 edges in a single wire and C1 continuity mode is switched on,
+a face is quadrangular if it has 4 bounds of C1 continuity.
+
+All solids and faces from a shape that do not satisfy these conditions are
+returned by this operation.
 
 \image html measures2.png
 
-\b Preview option shows non block solids and faces in the viewer. 
+It is possible to select an \b Object to be explored, to check or uncheck
+<b>Use C1 criterion</b> option and to set the <b>Angular Tolerance</b>
+to check C1 continuity between neighbor edges in a wire.
 
-Press \b Apply or <b>Apply and Close</b> button to publish non block solids and faces in the Object
-Browser under the processed object. Solids and faces are published separately in two groups. 
+\b Preview option shows non-block solids and non-quadrangular faces in the viewer. 
+
+Press \b Apply or <b>Apply and Close</b> button to publish non-block solids
+and non-quadrangular faces in the Object Browser under the processed object.
+Solids and faces are published separately in two groups. 
 
 If no bad sub-shapes have been found, the corresponding warning is shown. 
 
 \image html measures2a.png
 
 \n <b>TUI Command:</b>
-<em>geompy.GetNonBlocks(Compound).</em> Returns a tuple of two GEOM_Objects. 
-
-The first object is a group of all non block solids; the second object is a group of all non
-quadrangular faces.
+<em>geompy.GetNonBlocks(theShape, theIsUseC1 = False, theAngTolerance = 1.e-12).</em> \n
+where \n
+\em theShape is the shape to explore, \n
+\em theIsUseC1 is the flag to check if there are 4 bounds on a face
+    taking into account C1 continuity, \n
+\em theAngTolerance the angular tolerance to check if two neighbor edges are
+    codirectional in the common vertex with this tolerance. This parameter is
+    used only if \em theIsUseC1 is set to True.
+
+This command returns a tuple of two GEOM_Objects. 
+
+The first object is a group of all non-block solids; the second object is a group
+of all non-quadrangular faces.
 
 See also a \ref tui_get_non_blocks_page "TUI example".
 
index e7e6a333082b7ec76972262b3253779c138a798c..2b5c8a98111eb73c77d0f2b70ad8b3df63b7cf7a 100644 (file)
@@ -7,7 +7,7 @@
 \n This operation glues edges that are coincident with respect to the
 given tolerance value.
 
-\n <b>Arguments:</b> Name + Compound of shapes + Tolerance value.
+\n <b>Arguments:</b> Name + Shapes + Tolerance value.
 \n <b>Advanced option:</b>
    \ref restore_presentation_parameters_page "Set presentation parameters and sub-shapes from arguments".
 \n The \b Result will be a \b GEOM_Object.
@@ -16,10 +16,10 @@ given tolerance value.
 \image html glue4.png
 
 \n <b>TUI Command:</b>
-\n <em>geompy.MakeGlueEdges(theShape,theTolerance)</em>,
-\n where \em theShape is a compound of shapes to be glued, and \em 
- theTolerance is a maximum distance between two faces/edges, which can
- be considered as coincident. 
+<p><em>geompy.MakeGlueEdges( theShapes, theTolerance )</em>,
+\n where \em theShapes is a list or compound of shapes to be
+glued, and \em theTolerance is a maximum distance between two
+edges, which can be considered as coincident.
 
 \n It is also possible to manually select the edges that will be 
 glued - select the shape, specify the tolerance and press \b Detect button.
@@ -36,23 +36,24 @@ possible to select the edges for gluing in the 3D viewer.
 The selected edges will be marked in white.
 
 \n <b>TUI Command:</b>
-\n <em>geompy.GetGlueEdges(theShape,theTolerance)</em>,
-\n where \em theShape is a compound of shapes to be glued, \em
+<p><em>geompy.GetGlueEdges( theShapes, theTolerance )</em>,
+\n where \em theShape is either a list or compound of shapes to be glued, \em
  theTolerance is a maximum distance between two edges, which can
  be considered as coincident. The \b Result will be a list of \b
- GEOM_Objects, containing one sub-shape per each detected set of
- coincident sub-shapes.
+ GEOM_Objects (edges), containing one sub-shape per each detected set of
+ coincident sub-shapes. For example, if there are two coincident edges
+in the selected shapes, the result list contains one of the two coincident edges.
 
-\n <em>geompy.MakeGlueEdgesByList(theShape,theTolerance,theEdges)</em>,
-\n where \em theShape is a compound of shapes to be glued, \em
- theTolerance is a maximum distance between two edges, which can
+<em>geompy.MakeGlueEdgesByList( theShapes, theTolerance, theEdges )</em>,
+\n where \em theShape is a list or compound of shapes to be glued, 
+\em theTolerance is a maximum distance between two edges, which can
  be considered as coincident, \em theEdges is a list of
sub-shapes to be glued. 
edges to be glued. 
 
 \n <b>Example:</b>
 
 \image html glue8.png
-<center><em>Box with an edge that can be glued</em></center>
+<center><em>Two boxes with an edge that can be glued</em></center>
 
 Our <b>TUI Scripts</b> provide you with useful examples of the use of
 <b>Repairing Operations</b> \ref tui_glue_edges "Glue Edges".
index 3775aa47928eeaa1aa42e3f96ad24e4b33894954..c6a6fa021583320f6b423d3568f7a032e8ae18d3 100644 (file)
@@ -8,7 +8,7 @@
 \n This operation glues faces that are coincident with respect to the
 given tolerance value.
 
-\n <b>Arguments:</b> Name + Compound of shapes + Tolerance value.
+\n <b>Arguments:</b> Name + Shapes + Tolerance value.
 \n <b>Advanced option:</b>
    \ref restore_presentation_parameters_page "Set presentation parameters and sub-shapes from arguments".
 \n The \b Result will be a \b GEOM_Object.
@@ -17,8 +17,9 @@ given tolerance value.
 
 
 \n <b>TUI Commands:</b>
-\n <em>geompy.MakeGlueFaces(theShape,theTolerance,doKeepNonSolids)</em>,
-\n where \em theShape is a compound of shapes to be glued, \em
+
+<em>geompy.MakeGlueFaces( theShapes, theTolerance, doKeepNonSolids )</em>,
+\n where \em theShapes is either a list or compound of shapes to be glued, \em
  theTolerance is a maximum distance between two faces, which can
  be considered as coincident. The \em doKeepNonSolids flag allows to
  throw away non-solids from the result, if false. The \b Result will
@@ -38,20 +39,23 @@ performed and displays a notification.
 possible to select the faces for gluing in the 3D viewer.
 The selected faces will be marked in white.
 
-\n When the faces are glued their edges are glued as well. By default, other
+When the faces are glued their edges are glued as well. By default, other
 edges are not glued. To force gluing of all edges, check <b>Glue all coincident edges</b>
-checkbox.
+check-box.
 
 \n <b>TUI Commands:</b>
-\n <em>geompy.GetGlueFaces(theShape,theTolerance)</em>,
-\n where \em theShape is a compound of shapes to be glued, \em
- theTolerance is a maximum distance between two faces, which can
- be considered as coincident. The \b Result will be a list of \b
- GEOM_Objects, containing one sub-shape per each detected set of
- coincident sub-shapes.
 
-\n <em>geompy.MakeGlueFacesByList(theShape,theTolerance,theFaces,doKeepNonSolids,doGlueAllEdges)</em>,
-\n where \em theShape is a compound of shapes to be glued, \em
+<em>geompy.GetGlueFaces( theShapes, theTolerance )</em>,
+\n where \em theShapes is a list or compound of shapes to be glued, \em
+theTolerance is a maximum distance between two faces, which can
+be considered as coincident. The \b Result will be a list of \b
+GEOM_Objects (faces), containing one sub-shape per each detected set of
+coincident sub-shapes. For example if there are two coincident faces
+in selected shapes, the result list contains one of the two coincident faces.
+
+<em>geompy.MakeGlueFacesByList( theShapes, theTolerance, theFaces,
+  doKeepNonSolids, doGlueAllEdges )</em>,
+\n where \em theShapes is either a list or compound of shapes to be glued, \em
  theTolerance is a maximum distance between two faces, which can
  be considered as coincident, \em theFaces is a list of
  sub-shapes to be glued. The \em doKeepNonSolids flag allows to throw
index 93ddcc3846ce5dfcfd62ced333dabe2817de5fc5..890ce97e672eef3e2052adff2c8ec2d9bc02a890 100644 (file)
@@ -25,8 +25,8 @@ Our <b>TUI Scripts</b> provide you with useful examples of the use of
 <em>To import geometrical objects from a BREP, IGES, STEP or STL file:</em>
 
 \par
-From the \b File menu choose <b>Import/<FormatName></b>, where <b><FormatName></b> is a name
-of desirable format. In the <b>Import <FormatName></b> dialog box select the file to import
+From the \b File menu choose <b>Import/\<FormatName\></b>, where <b>\<FormatName\></b> is a name
+of desirable format. In the <b>Import \<FormatName\></b> dialog box select the file to import
 and press \b Open. The file will be imported in the module and its contents (geometrical object)
 will be displayed in the <b>Object Browser</b>.
 
@@ -63,8 +63,8 @@ file:</em>
 
 \par
 Select the object you wish to export, then from the \b File menu choose
-<b>Export/<FormatName></b>, where <b><FormatName></b> is a name of desirable format.
-In the <b>Export <FormatName></b> dialog box define the name and the location 
+<b>Export/\<FormatName\></b>, where <b>\<FormatName\></b> is a name of desirable format.
+In the <b>Export \<FormatName\></b> dialog box define the name and the location 
 of the file to export and press \b Save.
 
 The dialog box to export the file can provide additional advanced parameters.
index 70b368497b767128eab193a1b9e40f5f1ede8720..bfb439b884130fdc15609ae0605a05b11b49405c 100644 (file)
@@ -10,7 +10,15 @@ The table displays:
 - 3*3 matrix of its own moments of inertia (in rows <b> 1:1, 2:1</b> and <b>3:1</b>) and  
 - the relative moments of inertia (in row <b>IX & IY & IZ</b>)
 
-\n <b>TUI Command:</b> <em>geompy.Inertia(Shape),</em> where \em Shape is
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
+<b>TUI Command:</b> <em>geompy.Inertia(Shape),</em> where \em Shape is
 a shape for which the own matrix of inertia and the relative moments of inertia are
 returned.
 
diff --git a/doc/salome/gui/GEOM/input/inspect_object_operation.doc b/doc/salome/gui/GEOM/input/inspect_object_operation.doc
new file mode 100644 (file)
index 0000000..bff2fbd
--- /dev/null
@@ -0,0 +1,65 @@
+/*!
+
+\page inspect_object_operation_page Inspect Object
+
+This operation allows browsing the contents of the selected shape.
+
+To <b>Inspect Object</b>, in the <b>Main Menu</b> select <b>Measures - > Inspect Object</b>.
+
+The dialog can be used in two modes. The first one is a tree view mode:
+\image html inspect_object.png "Dialog in the tree view mode"
+
+This is a default mode that allows to inspect an object in the form of tree
+starting from the shape itself. Its children are its direct sub-shapes that
+have they own children as sub-shapes etc. till most very base sub-shapes,
+i.e. vertices.
+
+The second mode is a filtering one. It is activated when the user selects
+<b>Tolerance filter</b> check box:
+\image html inspect_object2.png "Dialog in the filtering mode"
+
+In this mode the user can check the type of sub-shapes to work with using
+the radio-buttons. The type can be either \b Vertex, \b Edge or \b Face.
+Then the user choses a tolerance criterion to be applied to filter out
+sub-shapes. It is possible to chose one of the following values:
+- \b > - greater than (default value)
+- \b >= - greater than or equal to
+- \b < - lower than
+- \b <= - lower than or equal to
+
+The last parameter to be chosen is the tolerance value. The result is the shapes
+of a certain type that satisfy the defined tolerance criterion. E.g. if the user
+chooses \b Face, criterion \b > and tolerance value equal to \b 1.e-6 the faces
+with the tolerance greater than \b 1.e-6 are displayed.
+
+It is possible to set maximal and minimal value of the tolerance using the
+buttons <b>Max value</b> and <b>Min value</b>. These values are displayed in
+the labels <b>Max :</b> and <b>Min :</b>
+
+In this dialog never mind of its mode it is possible to:
+- Click on the "selection" button and select an object to inspect in the Object Browser or in the viewer.
+- Show/hide sub-shape(s) in the 3D viewer, by pressing "eye" icon in the first column of the tree view.
+- Show/hide all sub-shapes in the tree, by pressing "eye" icon in the first column of the tree view header or
+  by pressing <b>Show all</b>/<b>Hide all</b> buttons.
+- Rename the selected sub-shape by double-clicking on the item or pressing <F2> key.
+- Show the selected sub-shape(s) in the 3D viewer by pressing <b>Show Selected</b> button.
+- Show the selected sub-shape(s) in the 3D viewer and erase all currently shown objects by pressing <b>Show Only Selected</b> button.
+- Hide the selected sub-shape(s) from the 3D viewer by pressing <b>Hide Selected</b> button.
+- Publish the selected sub-shapes in the study, by pressing <b>Publish Selected</b> button.
+- Close dialog box, by pressing <b>Close</b> button.
+
+\n <b>TUI Command:</b>
+
+A command to filter sub-shapes is defined:
+
+<em>geompy.GetSubShapesWithTolerance(theShape, theShapeType, theCondition, theTolerance),</em> \n
+where \n
+\em theShape is the shape to be exploded. \n
+\em theShapeType is the type of sub-shapes to be returned. Can have
+    the values \b GEOM.FACE, \b GEOM.EDGE and \b GEOM.VERTEX only.\n
+\em theCondition is the condition type (the value of GEOM.comparison_condition emuneration).\n
+\em theTolerance is the tolerance filter.
+
+See also a \ref swig_GetSubShapesWithTolerance "TUI example".
+
+*/
index 13187978b13a5370dccb9a231fd43d0d8e21aad9..8b49f3ad190c1b4a462de6ce565d6899acd5dee0 100644 (file)
@@ -18,7 +18,7 @@ It is possible to show/hide a dimension in the view by checking on/off the box t
 \r
 The buttons to the right of the list provide the following operations:\r
 <ul>\r
-<li>"Add" - opens \ref add_dimension_page "Add Dimension" dialog to define a new fly-out.</li>\r
+<li>"Add" - opens "Add Dimension" dialog to define a new fly-out.</li>\r
 <li>"Remove" - removes the selected item from the list.</li>\r
 <li>"Show All" / "Hide All" - shows/hides all dimensions existing in the list.</li>\r
 </ul>\r
index d4fa336b77bb3320a8461b055dce45df7b5c5472..2e3db6b1cc57c5fdf388c56461f64749295cac32 100644 (file)
@@ -17,11 +17,20 @@ Select one of the found solutions in the \b Solution list to display it in the V
 Press \b Apply or <b>Apply and Close</b> button to create a set of closest
 points, corresponding to all found solutions.
 
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
 <b>TUI Commands:</b>
-\n<em>aDist = geompy.MinDistance(Shape1, Shape2),</em>
-\n<em>[aDist, DX, DY, DZ] = geompy.MinDistanceComponents(Shape1, Shape2),</em>
-\n<em>[nbSols, (x11, y11, z11, x21, y21, z21, ...)] = geompy.ClosestPoints(Shape1, Shape2),</em>
-\n where \em Shape1 and \em Shape2 are the shapes, between which the minimal
+- <em>aDist = geompy.MinDistance(Shape1, Shape2),</em>
+- <em>[aDist, DX, DY, DZ] = geompy.MinDistanceComponents(Shape1, Shape2),</em>
+- <em>[nbSols, (x11, y11, z11, x21, y21, z21, ...)] = geompy.ClosestPoints(Shape1, Shape2),</em>
+.
+where \em Shape1 and \em Shape2 are the shapes, between which the minimal
 distance is computed.
 
 See also a \ref tui_min_distance_page "TUI example".
index 48d56c0366c71c68d346862ef646f30101740e41..e6e2db8b98dd8e99217e050b0e02599e63278e28 100755 (executable)
@@ -6,15 +6,13 @@ For a detailed description of the Partition operation please refer to <a href="S
 It provides a general review of the Partition and Boolean operations algorithms, describes the usage methodology and highlights
 major limitations of these operations.
 
-Perhaps you also ask yourself : \ref partition_explanation "What's the difference between partition, compounds and fuse operation ?"
+Perhaps you also ask yourself : \ref partition_explanation "What's the difference between partition, compounds and fuse operation?"
 
-To produce a \b Partition in the <b>Main Menu</b> select <b>Operations - > Partition</b>
+To produce a \b Partition in the <b>Main Menu</b> select <b>Operations -> Partition</b>
 
-This operation builds a compound by intersection of several shapes
-with a set of tool objects or with a plane.
-The \b Result will be a \b GEOM_Object.
+This operation builds a compound by partitioning a set of input objects by a set of tool objects.
 
-<br><h2>Intersection of two shapes.</h2>
+The \b Result of the operation is a \b GEOM_Object.
 
 \image html partition1.png
 
@@ -22,7 +20,7 @@ The \b Result will be a \b GEOM_Object.
 first list will be intersected with the shapes from the second list) +
 Resulting Type of shape.
 
-As far as the intersection of two objects can produce any type of
+As far as the partition of two objects can produce any type of
 geometrical objects, <b>Resulting type</b> box allows choosing the
 preferable result, i.e. a solid, a shell, a list of faces, etc.
 
@@ -45,8 +43,8 @@ face intersects with the box, see the corresponding \ref partition_picture_3 "pi
 <b>No sub-shapes intersection (Compounds only)</b> check box affects
 only input shapes of the Compound type.
 - If this option is switched off (default behavior) each input compound will be automatically
-exploded into sub-shapes and the intersection between these shapes will be also computed.
-- If this option is switched on, the intersection between sub-shapes will not be performed.
+exploded into sub-shapes and the partition between these shapes will be also computed.
+- If this option is switched on, the partition between sub-shapes will not be performed.
 In this case the Partition algorithm will work faster, but the result might differ from the 
 default behavior.
 
@@ -59,7 +57,7 @@ If self-intersection is detected, the operation is aborted.
 
 \note This algorithm does not find all types of self-intersections. It is tuned
       to detect vertex/vertex, vertex/edge, edge/edge, vertex/face and edge/face
-      intersections. Face/face intersections detection is switched off as it
+      interferences. Face/face interference detection is switched off as it
       is a time-consuming operation that gives an impact on performance. To find
       all self-intersections please use \ref check_self_intersections_page
       "Detect Self-intersection tool".
@@ -96,28 +94,16 @@ be checked for self-intersection prior to the operation.
 - Other parameters are obsolete and kept only for compatibility with
 previous versions of SALOME.
 
-<br><h2>Intersection of a Shape and a Plane.</h2>
-
-\image html partition2.png
-
-<b>Arguments:</b> Name + 1 shape to be intersected + 1 cutting plane.
-
-Activate \ref restore_presentation_parameters_page "Advanced options" if required.
-
-<b>TUI Command:</b>
-
-<em>geompy.MakeHalfPartition(Shape, Plane)</em>, where:
-- \em Shape is a source shape to be intersected by the \em Plane
-- \em Plane is a tool shape, to intersect the \em Shape.
-
 <b>Examples:</b>
 
-\image html partitionsn1.png "Box intersected by a plane"
+\anchor partition_picture_1
+\image html partitionsn1.png "Input data: box intersected by plane"
 
-\image html partitionsn2.png "Result of intersection"
+\anchor partition_picture_2
+\image html partitionsn2.png "Result: box partitioned by plane"
 
 \anchor partition_picture_3
-\image html partitionsn3.png "Result of intersection of a box and a plane (both as \em Objects, no tools) with the Resulting type \em Solid and checked 'Keep shapes of lower type'"
+\image html partitionsn3.png "Result: partitioned box and plane (both as \em Objects); resulting type is \em Solid; option 'Keep shapes of lower type' is on"
 
 Our <b>TUI Scripts</b> provide you with useful examples of \ref tui_partition "Basic Operations".
 
diff --git a/doc/salome/gui/GEOM/input/projection_on_cylinder_operation.doc b/doc/salome/gui/GEOM/input/projection_on_cylinder_operation.doc
new file mode 100644 (file)
index 0000000..3d8978d
--- /dev/null
@@ -0,0 +1,47 @@
+/*!
+
+\page projection_on_cylinder_operation_page Projection on Cylinder
+
+\n To produce a <b>Projection on Cylinder</b> in the <b>Main Menu</b> select
+<b>Operations - > Transformation - > Projection on Cylinder</b>
+
+\n This operation makes a projection of a <b>Source planar wire or face</b> on
+a cylinder defined by its radius. The cylinder's coordinate system is
+the same as the global coordinate system. The result represents a wire or
+a face that represents a projection of the source shape onto a cylinder.
+
+To make a projection it is necessary to define:
+- \b Object to be projected. It can be either a planar wire or a face;
+- \b Radius of the cylinder;
+- <b>Starting angle</b> from the cylinder's X axis around Z axis. This is
+the angle of the projection start.
+- <b>Length angle</b> where the total length of
+the wire should be projected. If it is unchecked the projection is not scaled and the natural
+wire length is kept for the projection.
+- <b>Rotation angle</b> the angle between the tangent vector to
+the first curve at the first point of the object projection in 2D space
+and U-direction of the cylinder in 2D space.
+- \ref restore_presentation_parameters_page "Advanced options".
+
+\image html proj_on_cyl_dlg.png
+
+\n The following figure explains the meaning of each input angle:
+
+\image html proj_on_cyl_angles.png "Input angles of projection on the cylinder"
+
+\n <b>Example:</b>
+
+\image html proj_on_cyl_preview.png "The curve (in red) and its projection on the cylinder"
+
+\n <b>TUI Command:</b> <em>geompy.MakeProjectionOnCylinder(theObject, theRadius,
+theStartAngle=0.0, theAngleLength=-1.0, theAngleRotation=0.0),</em>
+where \em theObject is a shape to be projected, \em theRadius
+is a cylinder radius, \em theStartAngle is the starting angle of projection in
+radians, \em theAngleLength the projection length angle in radians,
+\em theAngleRotation projection rotation angle in radians.
+The \em Result will be a \em GEOM_Object.
+
+Our <b>TUI Scripts</b> provide you with useful examples of the use of
+\ref tui_projection "Transformation Operations".
+
+*/
index 6f7e8b4eb3fb085af1e9cab4339fef7c53408944..17ccdcfd5ca279eda7da6400ac0f8bf309779b42 100644 (file)
@@ -1,24 +1,44 @@
 /*!
 
-\page projection_operation_page Projection on a Face
+\page projection_operation_page Projection
 
-\n To produce a <b>Projection</b> in the <b>Main Menu</b> select
+To produce a <b>Projection</b> in the <b>Main Menu</b> select
 <b>Operations - > Transformation - > Projection</b>
 
-\n This operation makes normal projection of a <b>Source vertex, edge
-   or wire</b> on a given <b>Target face</b>.
-\ref restore_presentation_parameters_page "Advanced options".
+This operation makes normal projection of one shape to another.
+
+There are 3 types of projection different by types of operands.
+
+Firstly, you can project <b>Source vertex, edge or wire</b> on a given <b>Target face</b>.
 
 \image html projection_dlg.png
 
-\n <b>Example:</b>
+Secondly, you can project <b>Source vertex</b> on a given <b>Target wire</b>.
+
+\image html projection_dlg1.png
+
+Thirdly, you can project <b>Source vertex</b> on a given <b>Target edge</b>.
+
+\image html projection_dlg2.png
+
+\ref restore_presentation_parameters_page "Advanced options".
+
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
+<b>Example:</b>
 
 \image html projection_preview.png "The curve (in red) and its projection on the cylindric surface"
 
-\n <b>TUI Command:</b> <em>geompy.MakeProjection(Source, Target),</em>
-   where \em Source is a shape which has to be projected, \em Target
-   is a face, on which the \em Source shape will be projected. The \em
-   Result will be a \em GEOM_Object.
+<b>TUI Command:</b> <em>geompy.MakeProjection(Source, Target),</em>
+\n where \em Source is a shape which has to be projected, \em Target
+is a shape, on which the \em Source shape will be projected. The \em
+Result will be a \em GEOM_Object.
 
 Our <b>TUI Scripts</b> provide you with useful examples of the use of
 \ref tui_projection "Transformation Operations".
index 8a3c7e7662ee31a2e7ef0d92a1ab061637edfc8c..6757c5a1ad1e14997a746ce3e50a7e61546c53db 100644 (file)
@@ -2,55 +2,52 @@
 
 \page reduce_study_page Reduce Study
 
-The user sometimes needs to keep in the study only some objects that 
+It can be sometimes necessary to keep in the study only the objects that 
 present the final result(s) of the design operations and to delete all 
-other objects which do not contribute to these results.
+other objects, which do not contribute to these results.
 
-The feature is especially useful when the user designs the whole model 
-through the GUI and wants to generate simplified "clean" Python dump only 
-at the end of the model construction with no "useless" objects in the 
-%GEOM module.
+This is especially useful when the model is designed using the GUI 
+and it is necessary to generate a simplified "clean" Python dump without "useless" objects 
+at the end of the model construction.
 
-User can open dialog box by selecting desirable object(s) in Object 
-Browser or OCC Viewer and calling "Reduce study" popup item.
+This feature can be activated by selecting the desirable object(s) in Object 
+Browser or OCC Viewer and calling "Reduce study" context item.
 
 \image html reduce_study_dialog.png
 
 <ul>
 
 <li><b> Objects to be kept</b> - objects that will be kept in the study after 
-applying operation of reduce study. The list of objects being selected by 
+applying reduce study operation. The objects selected by 
 the user are highlighted in bold font.</li>
 
 <li><b> Objects to be removed</b> - objects that will be deleted.</li>
 
-\note Mentioned views provide possibility to show/hide object(s) in 
-current Viewer using "eye" icon near each item of tree. Also user can 
-show/hide ALL objects in tree by clicking "eye" icon in the head of tree view.
+\note It is possible to show/hide object(s) in the 
+current Viewer using "eye" icon next to each tree item. 
+ALL objects in the tree can be shown/hidden by clicking the "eye" icon in the head of the tree view.
+
+<li><b> Intermediate objects</b> group box allows choosing what should be done with the objects that are used to produce the selected object(s):
+<li><b> Sub-objects</b> group box allows choosing the same operations for 
+sub-objects of the selected object(s).</li>
 
-<li><b> Intermediate objects</b> group box allows to choose an action 
-that will be performed with the objects that took part in the operations 
-chain to produce the selected object(s):
 <ul>
 <li>Keep - object(s) will be kept in the study;</li>
 <li>Unpublish - object(s) will be unpublished (hidden) from the study;</li>
 <li>Remove - object(s) will be removed from the study. \note Since use of 
-this option can lead to the broken Dump Python script, the warning message 
-will be shown at the operation commiting to confirm/reject removing 
-intermediate objects.</li>
+this option can cause a broken Dump Python script, the warning message 
+is shown confirm/reject removing intermediate objects.</li>
 </ul>
 </li>
 
-<li><b> Sub-objects</b> group box allows to choose the same operations for 
-sub-objects of selected item(s): keep, unpublish or remove.</li>
 
-<li><b> Remove empty folders</b> - if this option is checked, then all folders, 
+<li><b> Remove empty folders</b> - if this option is checked, all folders, 
 which will become empty after removing unused objects from the study, 
 will be also removed; otherwise, empty folders will be kept.</li>
 
-<li><b> Soft removal</b> - if this option is checked, operation will just 
-unpublish the redundant objects from the study instead of their hard delete.
-\n Soft removal would keep all the data in the study to give the user a 
+<li><b> Soft removal</b> - if this option is checked, the operation will 
+unpublish the redundant objects from the study instead of deleting them.
+\n So, soft removal keeps all data in the study to give the user a 
 chance to revert this operation using \ref publish_hidden_objects 
 "Publish Objects" dialog box.</li>
 
index 26ab2efb1e4ce4e36a388c806f5155052c00746a..eb9fefa03fc5c643b74c08da01e428164c14459d 100644 (file)
@@ -5,21 +5,22 @@
 \n To <b>Remove internal faces</b> in the <b>Main Menu</b> select
 <b>Repair - > Remove internal faces</b>.
 
-\n This operation removes all shared faces from a compound to obtain
+This operation removes all shared faces from given solids to obtain
 one or more bigger solids from a set of smaller solids.
 
 \image html remove_webs.png
 
-\n <b>Arguments:</b> Name + one shape.
+\n <b>Arguments:</b> Name + one or more shapes containing solids.
 \n <b>Advanced option:</b>
    \ref restore_presentation_parameters_page "Set presentation parameters and sub-shapes from arguments".
 
 \note Only shared faces will be removed. Coincident but not shared
-faces will stay as is, use Glue Faces or Partition before
-Remove Internal Faces if you need to remove them.
+faces will stay as is, use \ref glue_faces_operation_page or \ref partition_page before
+<b>Remove Internal Faces</b> if you need to remove them.
 
-\n <b>TUI Command:</b> <em>geompy.RemoveInternalFaces(theCompound)</em>,
-where <em>theCompound</em> is a compound of solids.
+\n <b>TUI Command:</b> <br>
+<em>geompy.RemoveInternalFaces( theSolids )</em>,<br>
+where <em>theSolids</em> is either a compound or a list of solids.
 
 \n Our <b>TUI Scripts</b> provide you with useful examples of the
 \ref tui_remove_webs "Remove Internal Faces" functionality usage.
index d0559d764ccbda15611a569384aa189254bc9cbe..b53ed10d01203be4d4d8bc390be81a03eb7423cd 100644 (file)
@@ -16,9 +16,9 @@ open contour asnd miodifies the underlying face.</li>
 holes with free boundaries on a selected face.</li>
 <li>\subpage sewing_operation_page "Sewing" - sews faces or shells.</li>
 <li>\subpage glue_faces_operation_page "Glue faces" - unites
-coincident faces within the given tolerance.</li>
+faces coincident within the given tolerance.</li>
 <li>\subpage glue_edges_operation_page "Glue edges" - unites
-coincident edges within the given tolerance.</li>
+edges coincident within the given tolerance.</li>
 <li>\subpage limit_tolerance_operation_page "Limit Tolerance" - tries
 to set new tolerance value for the given shape.</li>
 <li>\subpage add_point_on_edge_operation_page "Add point on edge" -
@@ -26,7 +26,7 @@ splits an edge in two.</li>
 <li>\subpage change_orientation_operation_page "Change orientation" -
 reverses the normals of the selected faces.</li>
 <li>\subpage remove_webs_operation_page "Remove internal faces" -
-rebuilds the topology of a compound of solids by removing the faces
+rebuilds the topology of solids by removing the faces
 are shared by several solids.</li>
 <li>\subpage remove_extra_edges_operation_page "Remove extra edges" -
 removes seam and degenerated edges from the given shape.</li>
index 0b741eed44c2465f905efaf1d4a664bb12547ef8..0832ea8865cf72e7355bfea841141ef2efc16c58 100644 (file)
@@ -1,27 +1,29 @@
 /*!
 
-\page section_opeartion_page Section
+\page section_opeartion_page Intersection
 
-\b Section operation creates an edge or a wire representing the intersection of surfaces of two shapes.
+\b Intersection operation creates a vertex, an edge, a wire or a compound
+of them representing the intersection of two shapes.
 
-To produce it, select in the main menu <b>Operations - > Boolean - > Section</b>
+To produce it, select in the main menu <b>Operations - > Boolean - > Intersection</b>
 
-\image html neo-section.png "Section dialog"
+\image html neo-section.png "Intersection dialog"
 
 In this dialog:
 - Input or accept the default \b Name of the resulting shape. 
 - Click the arrow button and select in the Object Browser or in the Viewer the intersecting <b>Objects</b>.
-- Activate the corresponding check-box if you wish to <b> Detect Self-intersections </b>.
+- Activate the corresponding check-box if you wish to <b> Detect Self-intersections</b>. If a self-intersection detected the operation fails.
 - Activate \ref restore_presentation_parameters_page "Advanced options" if required.
-- Press "Apply" or "Apply & Close" button to get the result (EDGE or WIRE).
-
-\note This algorithm does not find all types of self-intersections. It is tuned
-      to detect vertex/vertex, vertex/edge, edge/edge, vertex/face and edge/face
-      intersections. Face/face intersections detection is switched off as it
-      is a time-consuming operation that gives an impact on performance. To find
-      all self-intersections use \ref check_self_intersections_page
-      "Detect Self-intersection tool".
-         
+- Press "Apply" or "Apply & Close" button to get the result (VERTEX, EDGE, WIRE or COMPOUND).
+
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
 This operation can be performed using a <b>TUI Command:</b> 
 
 <em>geompy.MakeSection(s1, s2, checkSelfInte)</em>
index 18d95e881189b5aa227fc328e86f9e3c2fe498e2..9d293dec40d247ee4d24c0b1889b82836e70fb9a 100644 (file)
@@ -2,9 +2,24 @@
 
 \page sewing_operation_page Sewing
 
+\b Sewing operation allows uniting several faces (possibly contained
+in a shell, solid or compound) into one shell. Geometrically
+coincident (within a specified tolerance) edges (or parts of edges) of
+different faces are replaced by one edge thus producing a shell of
+faces with shared boundaries.<p> 
+This operation is similar to <b>New Entity - > Build - > Shell</b>
+operation, the difference is that with \b Sewing you can specify the
+tolerance and get a non-manifold result. <p>
+The possibility to create a non-manifold shell can be used e.g. to create a
+shell forming several closed domains and then to create several solids
+with shared boundaries from this shell.
+
+\note Geometrically coincident faces (or parts of faces) will not be
+replaced by one face during \b Sewing.
+
 To produce a \b Sewing operation in the <b>Main Menu</b> select <b>Repair - > Sewing</b>.
 
-The \b Result will be a \b GEOM_Object. 
+The \b Result will be a \b GEOM_Object (shell)
 
 \image html repair6.png
 
index aa97ec32f8489ef571a0b182fa4c19eb71b29bcd..643c706386bcd9af63d3e7ba3393a47091c7cf72 100644 (file)
@@ -51,11 +51,27 @@ spots and strips.</li>
 possible face size.</li>
 </ul>
 <li><b>Drop Small Edges</b> (DropSmallEdges) - removes edges, which
-merge with neighbouring edges.</li>
+merge with neighboring edges.</li>
 <ul>
 <li><b>3D Tolerance</b> (DropSmallEdges.Tolerance3d) - defines minimum
 possible distance between two parallel edges.</li>
 </ul>
+<li><b>Drop Small Solids</b> (DropSmallSolids) - removes small
+  solids or merges them with neighboring ones.</li>
+<ul>
+<li><b>Width factor tol.</b> (DropSmallSolids.WidthFactorThreshold) -
+  defines the maximum value of <em>2V/S</em> of a solid, which is
+  considered small, where \a V is the volume and \a S is the surface area of
+  the solid.</li>
+<li><b>Volume tol.</b> (DropSmallSolids.VolumeThreshold) - defines
+  the maximum volume of a solid, which is considered small.</li>
+<li><b>To merge solids</b> (DropSmallSolids.MergeSolids) - if
+  activated, small solids are removed, else small solids are merged to
+  adjacent non-small solids or left untouched if they cannot be merged.
+</li>
+</ul>
+If the both tolerances are activated a solid is considered small if
+it meets both criteria.
 <li><b>Split Angle</b> (SplitAngle) - splits faces based on conical
 surfaces, surfaces of revolution and cylindrical surfaces in segments
 using a certain angle.</li>
diff --git a/doc/salome/gui/GEOM/input/shape_statistics_operation.doc b/doc/salome/gui/GEOM/input/shape_statistics_operation.doc
new file mode 100644 (file)
index 0000000..d1fb6fe
--- /dev/null
@@ -0,0 +1,30 @@
+/*!
+
+\page shape_statistics_operation_page Shape Statistics
+
+This operation allows plotting a distribution histogram for the numerical parameters and creating the corresponding geometrical groups of the given shape.
+
+To call <b>Shape Statistics</b> dialog box, in the <b>Main Menu</b> select <b>Inspection - > Shape Statistics</b>.
+
+\image html shape_statistics.png
+
+In this dialog:
+- "Selected objects" standard selection box allows selecting one or more geometrical objects.
+
+- "Type" combo-box with the following items: "Edges length", "Faces area", "Solids volume".
+\note "Type" combo-box includes only parameters applied to the currently selected shape (e.g. "Solids volume" will not be available for a selected face or shell); multiple selection is processed correspondingly (i.e. only types applicable for all selected shapes will be available).
+
+- "Number of intervals" spin box is used to specify number of distribution histogram ranges.
+
+- "Scalar range" checkable group box, when switched ON, allows specifying custom values range used for plotting and creating groups.
+\note By default, "Scalar range" controls are empty; pressing "Compute" button allows automatically computing the initial range of the chosen parameter. This is necessary as the computation of the parameters range can be time-consuming for large or complex models. In case of multiple selection, the scalar range is computed for all selected shapes.
+
+- "Plot" button opens or uses an opened Plot2d viewer and plots the distribution histogram for the selected shape(s).
+
+- "Create groups" button allows creating groups according to the currently specified parameters. The group names will include numerical values of the range, e.g. "Edges_length_0-20", "Edges_length_20-40", etc. Empty groups are not created.
+
+- Close dialog box, by pressing <b>Close</b> button.
+
+\note This functionality is available only if GUI module is built with Plot 2D Viewer (option SALOME_USE_PLOT2DVIEWER is ON when building GUI module).
+
+*/
index 81c0600160f076d70e056ad0b355b198f77497e1..23d94d2f0c7083e878fa18812eda7230405157d3 100755 (executable)
@@ -4,27 +4,37 @@
 
 This operation is a special case of <b>Explode</b> operation. It
 produces sub-shapes of the exploded shape (the first shape in the list
-of argument shapes), which are shared with all other shapes in the
-arguments.
+of argument shapes), which are shared with other shapes in the
+arguments. The argument shapes can also be contained in a compound or
+group.
 
 To use this operation, select in the Main Menu <b>Operations -> Get
 Shared Shapes.</b> The following dialog box will appear.
 
 \image html shared_shapes.png
 
-<ul>
-<li> <b>Name</b> is the base name of the resulting shapes; </li>
-<li> <b>Shapes</b> are the shapes to fing shared sub-shapes of; </li>
-<li> <b>Sub-shapes Type</b> is the type of required sub-shapes; </li>
-</ul>
+In this dialog:
+- <b>Name</b> is the base name of the resulting shapes.
+- <b>Shapes</b> are the shapes whose shared sub-shapes should be found.
+- <b>Sub-shapes Type</b> is the type of required sub-shapes.
+- <b>Shared by all</b> option specifies what type of shared sub-shapes should be checked:
+  - \b On: searches for sub-shapes from the first input shape shared with all other input shapes;
+  - \b Off: searches for sub-shapes shared between couples of input shapes.
 
-\n <b>Advanced options</b> \ref preview_anchor "Preview"
+\note For the case when "Shared by all" option is switched off - if an input list of shapes
+contains a single compound, the sub-shapes shared between all possible couples of its top-level shapes
+are searched for; otherwise, only sub-shapes that are shared between the first input shape and 
+all other input shapes are searched.
 
-\n <b>TUI Command:</b> <em> geompy.GetSharedShapesMulti(Shapes,
-Type),</em> where \em Shapes is a list of shapes to fing shared sub-
-shapes of and \em Type is the type of required sub-shapes.
+<b>Advanced options:</b> \ref preview_anchor "Preview"
+
+<b>TUI Command:</b> <em> geompy.GetSharedShapesMulti( Shapes, Type ),</em> 
+<br> where \em Shapes is a list or compound of shapes, whose shared sub-
+shapes should be found and \em Type is the type of required sub-shapes.
 
 Our <b>TUI Scripts</b> provide you with useful examples of the use of
-\ref swig_GetSharedShapes "Get Shared Shapes" functionality.
+Get Shared Shapes functionality:
+- \ref tui_shared_shapes "Example 1"
+- \ref swig_GetSharedShapes "Example 2"
  
 */
diff --git a/doc/salome/gui/GEOM/input/size_models_range.doc b/doc/salome/gui/GEOM/input/size_models_range.doc
new file mode 100644 (file)
index 0000000..c8594ab
--- /dev/null
@@ -0,0 +1,83 @@
+/*!
+
+\page size_models_range Sizes of Models in Salome
+
+\tableofcontents
+
+In Salome and Open CASCADE Technology (OCCT), which is a modeling core
+of Salome %GEOM module, any model has its location in the 3D-space and size.
+This document defines the range of values (tolerances, locations
+and sizes) that should be taken into account for any 3D model design.
+
+It is not obligatory to create models within this range,
+however, algorithms can fail or return unexpected results if the 
+recommendations are not followed.
+
+\section sec1 Maximal Size of the Model
+
+The Maximal Size of the model corresponds to the maximal diameter of
+enclosed sphere built for the model. In OCCT any model has a location defined
+relatively to the absolute origin. Thus the maximal diameter should be built
+taking into account the model itself and its location.
+
+In OCCT there are two tolerances: Tolerance Confusion (TolC)
+and Tolerance Angular (TolA) (see OCCT Precision package for more details).
+These values are used for geometric comparisons. However, they are not used inside
+low-level algorithms (e.g. intersection), where more precise values are
+used instead. The value TolC guarantees that the error associated with
+the computations for a given geometric entity is not greater than TolC.
+
+- TolC - precision value used to check the coincidence of two points
+  [by default 1.e-7];
+- TolA - precision value used to check the equality of two angles
+  [by default 1.e-12].
+
+For more information on tolerance definition please see
+<a href="SALOME_BOA_PA.pdf">Chapter 4 of this document</a>. To see limitations
+that are due to modeling errors or inaccuracies of tolerance usage please
+refer to <a href="SALOME_BOA_PA.pdf">Chapter 9.2.2 of the same document</a>.
+
+To provide robust geometric modeling the computations should be consistent,
+i.e. the one tolerance value should be used for all computations. Thus, the
+TolC and TolA values should be consistent:
+
+<CENTER><B><PRE>Smax = TolC / TolA             (1)</PRE></B></CENTER>
+
+\image html tolerances.png "TolC, TolA and Maximal Size Consistency"
+
+In accordance with <B>(1)</B> the Maximal Size for the Model is [by default]:
+
+<CENTER><B><PRE>Smax = 1.e-7 / 1.e-12 = 1.e+5  (2)</PRE></B></CENTER>
+
+\section sec2 Minimal Size of the Model
+
+The Minimal Size of the Model is defined as the maximal diameter of enclosed
+sphere built for the smallest BRep entity of the Model.
+
+All models in OCCT are represented using double precision
+floating point numbers. This representation contains approximately 14-16
+significant digits.
+
+From the experience, it is considered that the last four significant
+digits contain rounding-off errors occurring during the computation. So
+(taking into account the worst cases), there are ten reliable significant digits
+for double precision floating point numbers. Having the estimation it is
+possible to compute the value of the Minimal size of the model:
+
+<CENTER><B><PRE>Smin=Smax / 1.e+10             (3)</PRE></B></CENTER>
+
+In accordance with <B>(2)</B> for the default value it will be [by default]:
+
+<CENTER><B><PRE>Smin=1.e-5.                    (4)</PRE></B></CENTER>
+
+\section sec3 Full Range of Sizes
+
+The values <B>Smax (2)</B>, <B>Smin (4)</B> are theoretical. Taking into
+account the practical purposes of improving the reliability, the lower limit
+should be restricted by one order. Thus, the full Range of Sizes of the Models
+is:
+
+<CENTER><B><PRE>[Smin, Smax] = [1.e-4, 1.e+5]  (5)</PRE></B></CENTER>
+
+*/
index 2b0bdd0c697ea9cb4cd35bd15a4b1b39aeeccff2..356817daeae898807a54636f6e7b2b871b0ab87d 100644 (file)
@@ -9,7 +9,15 @@ geometrical object.
 
 The table displays \b Min and \b Max tolerance values for \b Face, \b Edge and \b Vertex tolerance. 
 
-\n <b>TUI Command:</b> <em>geompy.Tolerance(Shape),</em> where \em Shape
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
+<b>TUI Command:</b> <em>geompy.Tolerance(Shape),</em> where \em Shape
 is a shape for which minimal and maximal tolerances are returned.
 
 See also a \ref tui_tolerance_page "TUI example".
diff --git a/doc/salome/gui/GEOM/input/transfer_data.doc b/doc/salome/gui/GEOM/input/transfer_data.doc
new file mode 100644 (file)
index 0000000..87a6486
--- /dev/null
@@ -0,0 +1,52 @@
+/*!
+
+\page transfer_data_page Transfer Data
+
+This operation performs copying of non-topological data
+from one shape to another. The topology of the destination object
+will not change, only non-topological data will be transferred
+(if it is present in the source object). It is possible to transfer
+the following data with this operation:
+<ul>
+<li> <b>Names</b></li>
+<li> <b>Materials</b></li>
+</ul>
+
+To use this operation, select in the Main Menu <b>Operations -> Transfer Data</b>.
+The following dialog box will appear.
+
+\image html transfer_data1.png "Transfer Data Dialog"
+
+In this dialog:
+<ul>
+<li> <b>Source Shape</b> is an object that is a source of non-topological data.</li>
+<li> <b>Destination Shape</b> is a data destination object. </li>
+<li> <b>Type of detection operation</b> allows choosing how to search sub-shapes of the 
+     <b>Source Shape</b> in the <b>Destination Shape</b>. The data are transferred
+     from these corresponding sub-shapes. The following methods are possible:
+    <ul>
+    <li><b>Get In Place</b> - the current implementation of Get In Place algorithm
+        (default value).</li>
+    <li><b>Get In Place (old)</b> - the old implementation of Get In Place
+        algorithm.</li>
+    <li><b>Get In Place By History</b> - Get In Place By History algorithm.</li>
+    </ul>
+</li>
+</ul>
+
+To copy the data click on \b Apply or <b>Apply and Close</b> button. 
+It is possible to see how many names and materials are copied as well as
+the maximum number of names and materials available for copying. This information is
+provided in the following message box:
+
+\image html transfer_data2.png "Transfer Data Information"
+
+<b>TUI Command:</b> <em>geompy.TransferData(ObjectFrom, ObjectTo, FindMethod),</em> 
+<br> where \em ObjectFrom is a data source object, \em ObjectTo is a
+destination object and \em FindMethod is a same shape detection method with
+default value \em GEOM.FSM_GetInPlace.
+
+Our <b>TUI Scripts</b> provide you with useful example of the use of
+\ref swig_TransferData "Transfer Data" functionality.
+*/
index 075973737f418e4212ebe513b6151992ef722f5e..6ce6395ceebece04733f7f56ce39e11cf215fac2 100644 (file)
@@ -16,6 +16,8 @@ which allow to:
 <li>\subpage scale_operation_page "Scale" an object by one or several scale factors.</li>
 <li>Create an \subpage offset_operation_page "Offset" of an object.</li>
 <li>Create a \subpage projection_operation_page "Projection" of an object on a face.</li>
+<li>Create an \subpage extension_operation_page "Extension" of an edge or a face.</li>
+<li>Create a \subpage projection_on_cylinder_operation_page "Projection on cylinder".</li>
 <li>Create a simultaneous \subpage multi_translation_operation_page "Translation in several directions".</li>
 <li>Create a simultaneous \subpage multi_rotation_operation_page</li> "Rotation in several directions".</li>
 </ul>
index 573182a4d63499675156ed2b5894b462b84b350f..8ded8676a235a3b4ddb7d7c0805a202a6141f6b8 100644 (file)
@@ -25,6 +25,8 @@ into water.</li>
 special case of \b Explode operation. </li>
 <li>\subpage shared_shapes_page "Get shared shapes" operation, a
 special case of \b Explode operation. </li>
+<li>\subpage transfer_data_page "Transfer Data" operation, which copies
+non-topological data from one shape to another. </li>
 
 
 <li>\subpage restore_presentation_parameters_page "Restore presentation parameters". 
index 89be6f64b4bb13c51c72a33057bc4f25f9bc6553..4d141752b629aebf3ec4754fea8bc30feb58b436 100644 (file)
 <br><h2>Creation of a Local Coordinate System</h2>
 \tui_script{basic_geom_objs_ex09.py}
 
+\anchor tui_creation_surface
+<br><h2>Creation of a Surface From Face</h2>
+\tui_script{basic_geom_objs_ex10.py}
+
+\anchor tui_creation_polyline
+<br><h2>Creation of 2D Polyline</h2>
+\tui_script{polyline.py}
+
 */
index 743b75dc2ffd6a954a1340151b2d8442c6255f25..7905440f9148e865d564f4b5617614d8fa6d1e0d 100644 (file)
@@ -14,4 +14,8 @@
 <br><h2>Restore presentation parameters and sub-shapes</h2>
 \tui_script{basic_operations_ex03.py}
 
+\anchor tui_shared_shapes
+<br><h2>Get shared shapes</h2>
+\tui_script{basic_operations_ex04.py}
+
 */
index 784003c3ceb79d0966c3c03b183b0db96f32d71c..1babccb693823284bc8fa768cdf082defad25ec7 100644 (file)
@@ -15,7 +15,7 @@
 \tui_script{boolean_operations_ex03.py}
 
 \anchor tui_section
-<br><h2>Section</h2>
+<br><h2>Intersection</h2>
 \tui_script{boolean_operations_ex04.py}
 
 */
diff --git a/doc/salome/gui/GEOM/input/tui_check_self_intersections_fast.doc b/doc/salome/gui/GEOM/input/tui_check_self_intersections_fast.doc
new file mode 100644 (file)
index 0000000..c8266e3
--- /dev/null
@@ -0,0 +1,6 @@
+/*!
+
+\page tui_check_self_intersections_fast_page Detect Self-intersections fast
+\tui_script{check_self_intersections_fast.py}
+
+*/
index 61ce18b5a126d1aa268b8735674cb46d87f98225..3ced40bcacf7fd616b5777c4652e46202988c075 100644 (file)
@@ -42,4 +42,8 @@
 <br><h2>Creation of Tangent Plane On Face</h2>
 \tui_script{complex_objs_ex10.py}
 
+\anchor tui_creation_thickness
+<br><h2>Applying a Thickness to Face, Shell or Solid</h2>
+\tui_script{complex_objs_ex11.py}
+
 */
diff --git a/doc/salome/gui/GEOM/input/tui_fast_intersection.doc b/doc/salome/gui/GEOM/input/tui_fast_intersection.doc
new file mode 100644 (file)
index 0000000..05708da
--- /dev/null
@@ -0,0 +1,6 @@
+/*!
+
+\page tui_fast_intersection_page Fast intersection
+\tui_script{fast_intersection.py}
+
+*/
index 583f3de0f56e4071941db96b1ad0f97ac10cc280..be111dbb16e2372e877388ae8a4dfcca6feaa3a1 100644 (file)
@@ -19,6 +19,8 @@
 <li>\subpage tui_check_compound_of_blocks_page</li>
 <li>\subpage tui_get_non_blocks_page</li>
 <li>\subpage tui_check_self_intersections_page</li>
+<li>\subpage tui_check_self_intersections_fast_page</li>
+<li>\subpage tui_fast_intersection_page</li>
 </ul>
 
 */
diff --git a/doc/salome/gui/GEOM/input/tui_polyline.doc b/doc/salome/gui/GEOM/input/tui_polyline.doc
deleted file mode 100644 (file)
index ff83b90..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-/*!
-
-\page tui_polyline_page 2D Polyline
-\tui_script{polyline.py}
-
-*/
index 56beffc5de137abc085ccd13e4cef45f6f23419e..5ed1334a00c422e25c2482809dafd8e1f663e5ea 100644 (file)
@@ -49,7 +49,7 @@
 \until Line3
 
 \anchor swig_all_advanced
-\until MakeSewing
+\until Thicken
 
 \anchor swig_MakeCopy
 \until MakeCopy
 \until Scale4
 
 \anchor swig_all_trsf_more
-\until MakeOffset
+\until MakeProjectionOnCylinder
 
 \anchor swig_ChangeOrientation
 \until ChangeOrientation
 
+\anchor swig_ExtendFaceEdge
+\until ExtendFace
+
+\anchor swig_SurfaceFromFace
+\until MakeSurfaceFromFace
+
 \anchor swig_ExtractShapes
 \until prism_edges
 
+\until IDlist_f
+
 \anchor swig_FilletChamfer
 \until End of Local operations
 
 \anchor swig_all_patterns
-\until MultiRot2D
+\until MultiRot2Ds
 
 \anchor swig_all_measure
 \until "CheckShape(Prism) = "
 \until nameS
 
 \anchor swig_all_decompose
+\until geompy.RestoreSubShapes(Partition1)
+
+\anchor swig_GetSubShapeEdgeSorted
+\until geompy.GetSubShapeEdgeSorted(Sketcher3d_2, p3, "OrderedEdges")
+
+\anchor swig_GetSubShapesWithTolerance
 \until print "DONE"
 
 */
index 90dafb538c81a6be0de7171e984990cbbf5add92..3e147f3882f8d34099fd87809547948a9b0ad20d 100644 (file)
 \until CheckShape
 
 \anchor swig_CheckShape
-\until MakeCompound
+\until Detect Self-intersections
 
 \anchor swig_CheckSelfIntersections
+\until Detect Self-intersections fast
+
+\anchor swig_CheckSelfIntersectionsFast
+\until Fast intersection
+
+\anchor swig_FastIntersection
 \until WhatIs
 
 \anchor swig_WhatIs
index 701a1b52be3eb69d8a7493ecb471634c6b000cce..86630b77d506254b406f2d1d62ef18e1e78c8853 100644 (file)
@@ -96,6 +96,9 @@
 \anchor swig_GetSharedShapes
 \until "sharedEdge_"
 
+\anchor swig_TransferData
+\until subBlackWhite[1]
+
 \anchor swig_CheckAndImprove
 \until "blocksComp"
 
index 9576e47a8eedd468fa8e36a54a5388bab2f73edf..b643ac9a65a800127536be7215c6fbb5b0379830 100644 (file)
 <br><h2>Creation of a Solid</h2>
 \tui_script{topological_geom_objs_ex05.py}
 
+\anchor tui_creation_solid_from_faces
+<br><h2>Creation of a Solid from the set of connected faces</h2>
+\tui_script{topological_geom_objs_ex07.py}
+
 \anchor tui_creation_compound
 <br><h2>Creation of a Compound</h2>
 \tui_script{topological_geom_objs_ex06.py}
index f25eb9c7644429f1646ec2a18bf2dc851ddb8963..2114d7cba669e00f7a5da43fa00e9fddf65c9921 100644 (file)
@@ -54,4 +54,8 @@
 <br><h2>Chamfer</h2>
 \tui_script{transformation_operations_ex13.py}
 
+\anchor tui_extend
+<br><h2>Extend Edge and Face</h2>
+\tui_script{transformation_operations_ex14.py}
+
 */
index 02a30251d246b12be9d52b9451f964e300c99f73..f5e8f0509edec064de16e5e3368c0bfbb28b22e5 100644 (file)
@@ -17,7 +17,7 @@ complex geometrical objects (2D & 3D elements):
 of a list of objects into an independent object.</li>
 <li>\subpage cut_operation_page "Cut" - cuts one shape with
 a list of others. </li>
-<li>\subpage section_opeartion_page "Section" - creates a section between two shapes.</li>
+<li>\subpage section_opeartion_page "Intersection" - performs an intersection between two shapes.</li>
 </ul>
 
 You can use advanced TUI commands performing these operations
@@ -34,7 +34,7 @@ theMainShape is the object of the operation and \em theShapesList is
 the list of tools for Cut operation;
 \par
 <em>geompy.MakeSection(Shape1, Shape2, checkSelfInte)</em>, where \em Shape1 is the first
-argument and \em Shape2 is the second argument of Section operation;
+argument and \em Shape2 is the second argument of Intersection operation;
 
 
 There are several TUI commands that can be used to perform boolean operations
@@ -45,7 +45,7 @@ operation.
 <em>geompy.MakeBoolean(Shape1, Shape2, Operation, checkSelfInte),</em> where \em
 Shape1 is the first argument and \em Shape2 is the second argument of
 a Boolean operation, \em Operation is the type of a Boolean operation (1
-&mdash; Common, 2 &mdash; Cut, 3 &mdash; Fuse, 4 &mdash; Section).
+&mdash; Common, 2 &mdash; Cut, 3 &mdash; Fuse, 4 &mdash; Intersection).
 
 
 Besides, you can use advanced TUI commands performing these operations
index 40e38c6640d4b1552c46c6f5fd9fccaed4e01930..515a94ce4a7808c7942730e944c6d6ec2b716803 100644 (file)
@@ -18,6 +18,8 @@
 <li>\subpage tolerance_page "Tolerance"</li>
 <li>\subpage managing_dimensions_page "Dimensions"</li>
 <li>\subpage whatis_page "WhatIs"</li>
+<li>\subpage inspect_object_operation_page "Inspect Object"</li>
+<li>\subpage shape_statistics_operation_page "Shape Statistics"</li>
 </ul>
 
 \n To check their integrity:
@@ -29,6 +31,7 @@
 <li>\subpage check_compound_of_blocks_page "Check compound of blocks"</li>
 <li>\subpage get_non_blocks_page "Get non blocks"</li>
 <li>\subpage check_self_intersections_page "Detect Self-intersections"</li>
+<li>\subpage fast_intersection_page "Fast intersection"</li>
 </ul>
 
 \n Our <b>TUI Scripts</b> show how to use
index 29a43cfbf1ca54b70a8d297d8b55ca2b065b4af1..430624deb96dece433c1b50a645358df9cb90ba4 100644 (file)
@@ -64,10 +64,9 @@ geometrical object. TUI Command: <em>sg.DisplayOnly(ID)</em></li>
 
 <li><b>Show all dimensions</b> - shows all of the persistent dimensions created for the selected geometrical object.</li>
 <li><b>Hide all dimensions</b> - hides all of the persistent dimensions created for the selected geometrical object.</li>
-<li>\subpage dependency_tree_page "Show dependency tree" - shows dependency tree of selected objects
-in new 2D View Window.</li>
-<li>\subpage reduce_study_page "Reduce study" - allows to reduce study
-by automatic removing objects according to user's options.</li>
+<li>\subpage dependency_tree_page "Show dependency tree" - shows the dependency tree with parents and children of the selected object
+in a new 2D View Window.</li>
+<li>\subpage reduce_study_page "Reduce study" - allows reducing the study by removing objects from it.</li>
 <li><b>Dump view</b> - exports an object from the viewer in bmp, png,
 jpg or jpeg image format.</li>
 <li><b>Change background</b> - allows to redefine the background
index 5763a6fb4df2738e707623b08542b8823690ff44..43dc0f6f70fe4d97ab17c0f26cb6e4e624551801 100644 (file)
@@ -2,22 +2,33 @@
 
 \page whatis_page What Is ?
 
-This operation provides the list of types and quantities of all topological entities, composing
-the selected geometrical object.
+This operation provides the list of types and quantities of all topological
+entities, composing the selected geometrical object.
+
+The information about \em COMPOUND or \em COMPSOLID shapes additionally shows
+"flat" content - the number of "simple" top-level shapes enclosed into the compound.
 
 \image html measures8.png
 
-\n <b>TUI Command:</b> <em>geompy.WhatIs(Shape),</em> where \em Shape is a
+\note This dialog supports navigation through the selectable objects (in OCC 3D viewer only):
+- Scroll mouse wheel with pressed \em Ctrl key or press \em "S", \em "P" keys when the input focus is
+in the viewer to navigate between selectable objects.
+- Press left mouse button to select an appropriate object to the dialog box.
+.
+For more details, please refer to the \em "Functionality common for OCC and VTK viewers" chapter
+of the GUI module's documentation.
+
+<b>TUI Command:</b> <em>geompy.WhatIs(Shape),</em> where \em Shape is a
 shape from which a description is returned.
 
-\n <b>Kind of Shape</b> field characterizes the
+<b>Kind of Shape</b> field characterizes the
 whole shape. If there is no additional information about the
 shape, <b>Basic Properties</b> button is disabled, otherwise it
 provides information about center and dimensions of the shape.
 
 \image html measures8a.png
 
-\n <b>TUI Command:</b> <em>geompy.KindOfShape(Shape),</em> where \em Shape is a
+<b>TUI Command:</b> <em>geompy.KindOfShape(Shape),</em> where \em Shape is a
 shape from which a description is returned.
 
 See also a \ref tui_whatis_page "TUI example".
index d1eac3994c018e6efdb3729809da5fa45a4ac578..aa9951260b0835d6bdb746acece32379687c4b1c 100644 (file)
@@ -24,7 +24,7 @@ This functionality is available in OCC viewer only.
 
 To create a group of sub-shapes of a geometrical object in the main
 menu select <b>New entity > Group > Create</b>
-\n The following menu will appear:
+\n The following dialog box will appear:
 
 \image html geomcreategroup.png
 
@@ -57,7 +57,7 @@ to the main and the second shape.</li>
 <li><b>Hide selected</b> - hides the sub-shapes selected in the list box.</li>
 <li><b>Show all sub-shapes</b> - displays only the sub-shapes of the Main Shape.</li>
 </ul>
-<li> You can select the elements of your group in two ways:
+<li> You can select the elements of your group in several ways:
 <ul>
 <li>You can select them manually in the 3D Viewer, and add to the
 group by clicking the \b Add button (keep down the Shift button on the
@@ -70,7 +70,9 @@ elements of a certain type in the list of the elements of the
 group. If the <b>Second Shape</b> is used, the elements are added 
 according to <b>Main Shape Selection restriction</b> settings. To delete elements 
 from the list, select them and click \b Remove button.
-</li></ul>
+</li>
+<li>Filtering out some entities according to the specified threshold value or values
+(see below).</li></ul>
 </li>
 <li>Finally, confirm your selection by clicking <b>Apply and Close
 </b> (also closes the Menu) or \b Apply (leaves the Menu open for 
@@ -79,6 +81,31 @@ creation of other groups), or skip it by clicking \b Close button.
 
 \n The Result of the operation will be a \b GEOM_Object.
 
+The \b Filter controls allow to automatically pick up entities, which satisfy specified 
+threshold value(s). The numerical functor for each sub-shape that is compared with
+threshold value(s) is computed according to the shape's topological properties:
+- length for edges and wires;
+- area for faces and shells;
+- volume for solids, compounds, compsolids.
+
+Filtering capabilities are not available for vertices.
+
+In order to filter out some entities:
+- Activate one or two filtering controls by switching on the corresponding check boxes;
+- Select the required threshold comparator type; the following choices are available:
+  - <b>Less Than</b> or <b>Equal or Less Than</b> for the first comparator;
+  - <b>Greater Than</b> or <b>Equal or Greater Than</b> for the second comparator;
+- Enter the required threshold value (values);
+- Press \b Apply button in the \b Filter group.
+
+The entities, which satisfy the entered filtering parameters, will be automatically highlighted
+in the 3D viewer.
+
+\b Plot button gives access 
+to the \ref shape_statistics_operation_page "Shape Statistics" functionality with a simplified look-and-feel:
+
+\image html shape_statistics_simple.png
+
 \n <b>TUI Command:</b> <em>geompy.CreateGroup(MainShape,
 ShapeType),</em> where MainShape is a shape for which the group is
 created, ShapeType is a type of shapes in the created group.
index 2972fc5e3a6d2ce43375a6f49b6313de67ab8dcc..affd43d8422006bcb1acafde91836112e5cf7b98 100755 (executable)
@@ -4,7 +4,7 @@
   <ul>
     $navpath
     <li class="footer">
-      Copyright &copy; 2007-2014  CEA/DEN, EDF R&amp;D, OPEN CASCADE<br>
+      Copyright &copy; 2007-2015  CEA/DEN, EDF R&amp;D, OPEN CASCADE<br>
       Copyright &copy; 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS<br>
     </li>
   </ul>
index 788b503d0c8f90f17f47ad21ff9cfd9894cd36e1..d716f2ae39588f136d06d9aadc56de47a799f142 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
@@ -26,7 +26,10 @@ SALOME_CONFIGURE_FILE(static/header.html.in static/header.html)
 ADD_CUSTOM_TARGET(dev_docs ${DOXYGEN_EXECUTABLE})
 
 INSTALL(CODE "FILE(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/GEOM)")
-INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/GEOM DESTINATION ${SALOME_INSTALL_DOC}/tui)
+INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/GEOM
+        DESTINATION ${SALOME_INSTALL_DOC}/tui
+        PATTERN "*.md5" EXCLUDE
+        PATTERN "*.map" EXCLUDE)
 INSTALL(FILES images/head.png DESTINATION ${SALOME_INSTALL_DOC}/tui/GEOM)
 
 SET_DIRECTORY_PROPERTIES(PROPERTIES ADDITIONAL_MAKE_CLEAN_FILES GEOM)
index 6269a50bf8c13c99bee9ddc8530baef80c2d460c..a40c5d8d52e9b750313f8db9fae19ed86dbc4cca 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 2972fc5e3a6d2ce43375a6f49b6313de67ab8dcc..affd43d8422006bcb1acafde91836112e5cf7b98 100755 (executable)
@@ -4,7 +4,7 @@
   <ul>
     $navpath
     <li class="footer">
-      Copyright &copy; 2007-2014  CEA/DEN, EDF R&amp;D, OPEN CASCADE<br>
+      Copyright &copy; 2007-2015  CEA/DEN, EDF R&amp;D, OPEN CASCADE<br>
       Copyright &copy; 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS<br>
     </li>
   </ul>
index c82edf11f1e285aef37e02c8bd499c5ec9e6637e..a10ac7319d392cdf6b45806581df98b1a7679a8e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index c5e59715f58230a774c7912835e73bf19b9311be..26f2766550dff6ba78293daaf3d2ce0f4ff8ee47 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3b4210096a7e2af6ae30692c32e91c396fe5b717..61ae5ac624b62378e677456b09050edc5d427566 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 8863bae2696b537bc7257d2d8c73dce00ec46bf9..830fcc3984dfdef42f54e5e4567a932a644e3a86 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -39,7 +39,7 @@ module GEOM
    */
   enum shape_type 
   { 
-    /*!  */
+    /*! A collection of arbitrary shapes */
     COMPOUND,
     /*! A collection of solids */ 
     COMPSOLID, 
@@ -47,16 +47,19 @@ module GEOM
     SOLID, 
     /*! A collection of faces connected by some edges of their wire boundaries */
     SHELL,
-    /*! Part of a plane (in 2D geometry) or a surface (in 3D geometry) bounded by a close wire */
+    /*! Part of a plane (in 2D geometry) or a surface (in 3D geometry) bounded by a closed wire */
     FACE, 
-    /*!  A sequence of edges connected by their vertices */
+    /*! A sequence of edges connected by their vertices */
     WIRE, 
     /*! Edge, a shape corresponding to a curve, and bound by a vertex at each extremity */
     EDGE, 
     /*! A zero-dimensional shape corresponding to a point in geometry */
     VERTEX,
-    /*!  */ 
-    SHAPE };
+    /*! Arbitrary shape in a Compound (used for processing of Compounds in some operations) */ 
+    SHAPE,
+    /*! Flat (top-level) contents of a Compound (used for processing of Compounds in some operations) */
+    FLAT
+    };
 
   /*!
    * \brief Marker type
@@ -112,7 +115,8 @@ module GEOM
    *  \brief Kind of method to find inside one main shape some sub-shapes,
    *  corresponding to other given shape (its argument)
    *
-   *  Is used in functions GEOM_Gen.RestoreSubShapesO(), GEOM_Gen.RestoreSubShapesSO()
+   *  Is used in functions GEOM_Gen.RestoreSubShapesO(), GEOM_Gen.RestoreSubShapesSO(),
+   *  TransferNames()
    */
   enum find_shape_method
   {
@@ -136,7 +140,10 @@ module GEOM
     /*! To be used only for multi-transformation result.
      *  Only this method can be used after multi-transformation.
      */
-    FSM_MultiTransformed
+    FSM_MultiTransformed,
+
+    /*! Use old GetInPlace functionality. */
+    FSM_GetInPlace_Old
   };
 
   /*!
@@ -188,6 +195,30 @@ module GEOM
     FDT_String
   };
 
+  /**
+   * This enumeration represents the level of checking shape on
+   * self-interference. It defines which interferferences will be checked.
+   */
+  enum si_check_level
+  {
+    SI_V_V,     // only V/V interferences
+    SI_V_E,     // V/V and V/E interferences
+    SI_E_E,     // V/V, V/E and E/E interferences
+    SI_V_F,     // V/V, V/E, E/E and V/F interferences
+    SI_E_F,     // V/V, V/E, E/E, V/F and E/F interferences
+    SI_ALL      // all interferences
+  };
+
+  /**
+   * This enumeration represents comparison conditions.
+   */
+  enum comparison_condition
+  {
+    CC_GT, ///< Greater then
+    CC_GE, ///< Greater then or equal to
+    CC_LT, ///< Less then
+    CC_LE  ///< Less then or equal to
+  };
 
  /*!
    * \brief Object creation parameters
@@ -197,7 +228,6 @@ module GEOM
   struct Parameter
   {
     string name;
-    //any value;
     string value;
   };
   typedef sequence<Parameter> Parameters;
@@ -207,6 +237,17 @@ module GEOM
     string     operationName;
     Parameters params;
   };
+  typedef sequence<CreationInformation> CreationInformationSeq;
+
+  /*!
+   * \brief Reporting on shape healing
+   */
+  struct ModifInfo
+  {
+    string name;  // what changed
+    long   count; // how many times
+  };
+  typedef sequence<ModifInfo> ModifStatistics;
 
 
   typedef sequence<string>       string_array;
@@ -319,7 +360,7 @@ module GEOM
     /*!
      * \brief Return name of operation and values of parameters used for object creation
      */
-    CreationInformation GetCreationInformation();
+    CreationInformationSeq GetCreationInformation();
   };
 
   //# GEOM_Object
@@ -365,6 +406,18 @@ module GEOM
      */
     shape_type GetMaxShapeType();
 
+    /*!
+     *  \brief Returns a name of a sub-shape if the sub-shape is published in the study
+     *  \param subID - sub-shape ID
+     *  \return string - the found name or an empty string if the sub-shape does not
+     *          exits or is not published in the study
+     *
+     * \note Only sub-shapes directly retrieved (using e.g. ExtractSubShapes() or
+     *       via group creation) can be found. Also, as sub-shape can be published in the study
+     *       many times, only the first found name is returned.
+     */
+    string GetSubShapeName(in long subID);
+
     /*!
      *  \brief Set color of the object.
      *
@@ -690,10 +743,13 @@ module GEOM
      *  Create a point, corresponding to the given parameter on the given curve.
      *  \param theRefCurve The referenced curve.
      *  \param theParameter Value of parameter on the referenced curve.
+     *  \param takeOrientationIntoAccount flag that tells if it is necessary
+     *         to take the curve's orientation into account.
      *  \return New GEOM_Object, containing the created point.
      */
     GEOM_Object MakePointOnCurve (in GEOM_Object theRefCurve,
-                                  in double theParameter);
+                                  in double      theParameter,
+                                  in boolean     takeOrientationIntoAccount);
 
     /*!
      *  \brief Create a point, corresponding to the given length on the given curve.
@@ -1379,6 +1435,35 @@ module GEOM
      *  \return theObject.
      */
     GEOM_Object RecomputeObject (in GEOM_Object theObject);
+
+    /*!
+     *  \brief Compute the projection of a wire or a face on a cylinder.
+     *
+     *  This method computes a wire or a face or a compound of faces
+     *  that represents a projection of the source shape onto cylinder.
+     *  The cylinder's coordinate system is the same as the global coordinate
+     *  system.
+     *
+     *  \param theObject The object to be projected. It can be either
+     *         a planar wire or a face.
+     *  \param theRadius The radius of the cylinder.
+     *  \param theStartAngle The starting angle from the cylinder's X axis
+     *         around Z axis. The angle from which the projection is started.
+     *  \param theAngleLength The projection length angle. The angle in which
+     *         to project the total length of the wire. If it is negative the
+     *         projection is not scaled and natural wire length is kept for
+     *         the projection.
+     *  \param theAngleRotation the desired angle between the tangent vector
+     *         to the first curve at the first point of the theObject's
+     *         projection in 2D space and U-direction of cylinder's 2D space.
+     *  \return A wire or a face or a compound of faces that represents a
+     *         projection of the source shape onto a cylinder.
+     */
+    GEOM_Object MakeProjectionOnCylinder (in GEOM_Object theObject,
+                                          in double      theRadius,
+                                          in double      theStartAngle,
+                                          in double      theAngleLength,
+                                          in double      theAngleRotation);
   };
   
   /*!
@@ -1645,22 +1730,31 @@ module GEOM
      *  \param theHeight Prism dimension along the normal of the face.
      *  \param theAngle Draft angel in degrees
      *  \param theFuse If true material is added else material is removed
+     *  \param theInvert If true material changes the direction 
      *  \return New GEOM_Object, containing the modified shape
      */
     GEOM_Object MakeDraftPrism (in GEOM_Object theInitShape,
                                 in GEOM_Object theBase,
                                 in double theHeight, 
                                 in double theAngle,
-                                in boolean theFuse);
+                                in boolean theFuse,
+                                in boolean theInvert);
 
     /*!
      *  \brief Create a shape by extrusion of the base shape along
      *  the path shape. The path shape can be a wire or an edge.
      *  \param theBase Base shape to be extruded.
      *  \param thePath Path shape to extrude the base shape along it.
-     *  \return New GEOM_Object, containing the created pipe.
+     *  \param IsGenerateGroups flag that tells if it is necessary to
+     *         return groups (true) or not (false).
+     *  \return The list of objects. The first one is a result pipe,
+     *          the other ones are the created groups. If \a IsGenerateGroups
+     *          is not set the returned list contains a single object, which
+     *          is the operation result.
      */
-    GEOM_Object MakePipe (in GEOM_Object theBase, in GEOM_Object thePath);
+    ListOfGO MakePipe (in GEOM_Object theBase,
+                       in GEOM_Object thePath,
+                       in boolean     IsGenerateGroups);
 
     /*!
      *  \brief Create a shape by revolution of the base shape around the axis
@@ -1682,18 +1776,18 @@ module GEOM
                                               in double theAngle);
 
     /*!
-     *  \brief Create a filling from the given compound of contours.
-     *  \param theShape Initial shape on which to perform the feature.
-     *  \param theMinDeg a minimal degree of BSpline surface to create
-     *  \param theMaxDeg a maximal degree of BSpline surface to create
-     *  \param theTol2D a 2d tolerance to be reached
-     *  \param theTol3D a 3d tolerance to be reached
-     *  \param theNbIter a number of iteration of approximation algorithm
+     *  \brief Create a face from a given set of contours.
+     *  \param theContours either a list or a compound of edges/wires.
+     *  \param theMinDeg a minimal degree of BSpline surface to create.
+     *  \param theMaxDeg a maximal degree of BSpline surface to create.
+     *  \param theTol2D a 2d tolerance to be reached.
+     *  \param theTol3D a 3d tolerance to be reached.
+     *  \param theNbIter a number of iteration of approximation algorithm.
      *  \param theMethod Kind of method to perform filling operation.
-     *  \param theApprox Boolean indicating if result should be approximated
-     *  \return New GEOM_Object, containing the created filling surface.
+     *  \param theApprox Boolean indicating if result should be approximated.
+     *  \return New GEOM_Object (face), containing the created filling surface.
      */
-    GEOM_Object MakeFilling (in GEOM_Object theShape,
+    GEOM_Object MakeFilling (in ListOfGO theContours,
                              in long theMinDeg, in long theMaxDeg,
                              in double theTol2D, in double theTol3D,
                              in long theNbIter,
@@ -1725,16 +1819,27 @@ module GEOM
      *                        should be equal to number of bases or list of locations can be empty.
      *  \param thePath - Path shape to extrude the base shape along it.
      *  \param theWithContact - the mode defining that the section is translated to be in
-     *                          contact with the spine.
+     *                          contact with the spine. Ignored if IsBySteps is set.
      *  \param theWithCorrection - defining that the section is rotated to be
-     *                                 orthogonal to the spine tangent in the correspondent point
-     *  \return New GEOM_Object, containing the created pipe.
-     */
-    GEOM_Object MakePipeWithDifferentSections (in ListOfGO theSeqBases,
-                                               in ListOfGO theLocations,
-                                               in GEOM_Object thePath,
-                                               in boolean theWithContact ,
-                                               in boolean theWithCorrection );
+     *                                 orthogonal to the spine tangent in
+     *                          the correspondent point. Ignored if IsBySteps is set.
+     *  \param IsBySteps - flag that tells if the result should be created
+     *         step by step or as a whole. If IsBySteps is set no correction
+     *         of bases is allowed.
+     *  \param IsGenerateGroups flag that tells if it is necessary to
+     *         return groups (true) or not (false).
+     *  \return The list of objects. The first one is a result pipe,
+     *          the other ones are the created groups. If \a IsGenerateGroups
+     *          is not set the returned list contains a single object, which
+     *          is the operation result.
+     */
+    ListOfGO MakePipeWithDifferentSections (in ListOfGO theSeqBases,
+                                            in ListOfGO theLocations,
+                                            in GEOM_Object thePath,
+                                            in boolean theWithContact ,
+                                            in boolean theWithCorrection,
+                                            in boolean IsBySteps,
+                                            in boolean IsGenerateGroups);
 
     /*!
      *  \brief Create a shape by extrusion of the profile shape along
@@ -1752,23 +1857,35 @@ module GEOM
      *                          contact with the spine.
      *  \param theWithCorrection - defining that the section is rotated to be
      *                                 orthogonal to the spine tangent in the correspondent point
-     *  \return New GEOM_Object, containing the created pipe.
-     */
-    GEOM_Object MakePipeWithShellSections (in ListOfGO theSeqBases,
-                                           in ListOfGO theSeqSubBases,
-                                           in ListOfGO theLocations,
-                                           in GEOM_Object thePath,
-                                           in boolean theWithContact ,
-                                           in boolean theWithCorrection );
+     *  \param IsGenerateGroups flag that tells if it is necessary to
+     *         return groups (true) or not (false).
+     *  \return The list of objects. The first one is a result pipe,
+     *          the other ones are the created groups. If \a IsGenerateGroups
+     *          is not set the returned list contains a single object, which
+     *          is the operation result.
+     */
+    ListOfGO MakePipeWithShellSections (in ListOfGO theSeqBases,
+                                        in ListOfGO theSeqSubBases,
+                                        in ListOfGO theLocations,
+                                        in GEOM_Object thePath,
+                                        in boolean theWithContact,
+                                        in boolean theWithCorrection,
+                                        in boolean IsGenerateGroups);
 
     /*!
      *  \brief Create solids between given sections
      *  \param theSeqBases - list of sections (shell or face).
      *  \param theLocations - list of corresponding vertexes
-     *  \return New GEOM_Object, containing the created solids.
+     *  \param IsGenerateGroups flag that tells if it is necessary to
+     *         return groups (true) or not (false).
+     *  \return The list of objects. The first one is a result pipe,
+     *          the other ones are the created groups. If \a IsGenerateGroups
+     *          is not set the returned list contains a single object, which
+     *          is the operation result.
      */
-    GEOM_Object MakePipeShellsWithoutPath (in ListOfGO theSeqBases,
-                                           in ListOfGO theLocations);
+    ListOfGO MakePipeShellsWithoutPath (in ListOfGO theSeqBases,
+                                        in ListOfGO theLocations,
+                                        in boolean  IsGenerateGroups);
 
     /*!
      *  \brief Create a shape by extrusion of the base shape along
@@ -1780,24 +1897,40 @@ module GEOM
      *  \param theVec Vector defines a constant binormal direction to keep the
      *                same angle beetween the Direction and the sections
      *                along the sweep surface.
-     *  \return New GEOM_Object, containing the created pipe.
-     */
-    GEOM_Object MakePipeBiNormalAlongVector (in GEOM_Object theBase,
-                                             in GEOM_Object thePath,
-                                             in GEOM_Object theVec);
+     *  \param IsGenerateGroups flag that tells if it is necessary to
+     *         return groups (true) or not (false).
+     *  \return The list of objects. The first one is a result pipe,
+     *          the other ones are the created groups. If \a IsGenerateGroups
+     *          is not set the returned list contains a single object, which
+     *          is the operation result.
+     */
+    ListOfGO MakePipeBiNormalAlongVector (in GEOM_Object theBase,
+                                          in GEOM_Object thePath,
+                                          in GEOM_Object theVec,
+                                          in boolean     IsGenerateGroups);
 
 
      /*!
-     *  \brief Make a thick solid from a surface shape (face or shell)
-     *  \param theObject Surface from which the thick solid is made
+     *  \brief Make a thick solid from a shape.
+     *
+     *  If the input is a surface shape (face or shell) the result is
+     *  a thick solid. If an input shape is a solid the result is a hollowed
+     *  solid with removed faces.
+     *  \param theObject face or shell to get thick solid or solid to get
+     *         hollowed solid.
+     *  \param theFacesIDs the list of face IDs to be removed from the result.
+     *          It can be empty.
      *  \param theThickness Value of the thickness
-     *  \param isCopy To make a copy of \a theObject ot to modify \a theObject.
+     *  \param isCopy To make a copy of \a theObject or to modify \a theObject
+     *  \param isInside If true the thickness is applied towards inside
      *  \return New GEOM_Object, containing the created pipe if isCopy = true
      *          or the modified object if isCopy = false
      */
     GEOM_Object MakeThickening (in GEOM_Object theObject,
-                                in double theThickness,
-                                in boolean isCopy);
+                                in ListOfLong  theFacesIDs,
+                                in double      theThickness,
+                                in boolean     isCopy,
+                                in boolean     isInside);
 
     
     /*!
@@ -1912,6 +2045,25 @@ module GEOM
      */
     GEOM_Object MakeFaceWires (in ListOfGO theWires, in boolean isPlanarWanted);
 
+    /**
+     *  \brief Create a face based on surface of theFace limited by theWire.
+     *  \param theFace the face whose surface is used to create a new face.
+     *  \param theWire closed Wire build the face.
+     *  \return New GEOM_Object, containing the created face.
+     */
+    GEOM_Object MakeFaceFromSurface(in GEOM_Object theFace,
+                                    in GEOM_Object theWire);
+
+    /*!
+     *  \brief Create a face from a set of edges with the given constraints.
+     *  \param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
+     *         - edges should form a closed wire;
+     *         - for each edge, constraint face is optional: if a constraint face is missing
+     *           for some edge, this means that there no constraint associated with this edge.
+     *  \return New GEOM_Object, containing the created face.
+     */
+    GEOM_Object MakeFaceWithConstraints(in ListOfGO theConstraints);
+
     /*!
      *  \brief Create a shell from the set of faces and shells.
      *  \param theFacesAndShells List of faces and/or shells.
@@ -1941,64 +2093,73 @@ module GEOM
     GEOM_Object MakeCompound (in ListOfGO theShapes);
 
     /*!
-     *  \brief Replace coincident faces in theShape by one face.
-     *  \param theShape Initial shape.
+     *  \brief Make a solid (or solids) from connected set of faces and/or shells.
+     *  \param theFacesOrShells List of faces and/or shells.
+     *  \param isIntersect If TRUE, forces performing intersections between arguments.
+     *
+     *  \return New GEOM_Object, containing the created solid (or compound of solids).
+     */
+    GEOM_Object MakeSolidFromConnectedFaces (in ListOfGO theFacesOrShells, in boolean isIntersect);
+    
+    /*!
+     *  \brief Replace coincident faces in \a theShapes by one face.
+     *  \param theShapes Initial shapes.
      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
      *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
-     *  \return New GEOM_Object, containing a copy of theShape without coincident faces.
+     *  \return New GEOM_Object containing copies of theShapes without coincident faces.
      */
-    GEOM_Object MakeGlueFaces (in GEOM_Object theShape, in double theTolerance, in boolean doKeepNonSolids);
+    GEOM_Object MakeGlueFaces (in ListOfGO theShapes, in double theTolerance, in boolean doKeepNonSolids);
 
     /*!
-     *  Find coincident faces in theShape for possible gluing.
-     *  \param theShape Initial shape.
+     *  Find coincident faces in theShapes for possible gluing.
+     *  \param theShapes Initial shapes.
      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
      *  \return ListOfGO
      */
-    ListOfGO GetGlueFaces (in GEOM_Object theShape, in double theTolerance);
+    ListOfGO GetGlueFaces (in ListOfGO theShapes, in double theTolerance);
 
     /*!
-     *  \brief Replace coincident faces in theShape by one face
-     *  in compliance with given list of faces
-     *  \param theShape Initial shape.
+     *  \brief Replace coincident faces in \a theShapes by one face
+     *         in compliance with given list of faces
+     *  \param theShapes Initial shapes.
      *  \param theTolerance Maximum distance between faces, which can be considered as coincident.
      *  \param theFaces List of faces for gluing.
      *  \param doKeepNonSolids If FALSE, only solids will present in the result, otherwise all initial shapes.
      *  \param doGlueAllEdges If TRUE, all coincident edges of <VAR>theShape</VAR>
      *                        will be glued, otherwise only the edges,
      *                        belonging to <VAR>theFaces</VAR>.
-     *  \return New GEOM_Object, containing a copy of theShape without some faces.
+     *  \return New GEOM_Object containing copies of theShapes without coincident faces.
      */
-    GEOM_Object MakeGlueFacesByList (in GEOM_Object theShape, in double theTolerance,
-                                     in ListOfGO theFaces, in boolean doKeepNonSolids,
+    GEOM_Object MakeGlueFacesByList (in ListOfGO theShapes, in double theTolerance,
+                                     in ListOfGO theFaces,  in boolean doKeepNonSolids,
                                      in boolean doGlueAllEdges);
 
     /*!
-     *  \brief Replace coincident edges in theShape by one edge.
-     *  \param theShape Initial shape.
+     *  \brief Replace coincident edges in \a theShapes by one edge.
+     *  \param theShapes Initial shapes.
      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
-     *  \return New GEOM_Object, containing a copy of theShape without coincident edges.
+     *  \return New GEOM_Object containing copies of theShapes without coincident edges.
      */
-    GEOM_Object MakeGlueEdges (in GEOM_Object theShape, in double theTolerance);
+    GEOM_Object MakeGlueEdges (in ListOfGO theShapes, in double theTolerance);
 
     /*!
-     *  Find coincident edges in theShape for possible gluing.
-     *  \param theShape Initial shape.
+     *  Find coincident edges in \a theShapes for possible gluing.
+     *  \param theShapes Initial shapes.
      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
      *  \return ListOfGO
      */
-    ListOfGO GetGlueEdges (in GEOM_Object theShape, in double theTolerance);
+    ListOfGO GetGlueEdges (in ListOfGO theShapes, in double theTolerance);
 
     /*!
-     *  \brief Replace coincident edges in theShape by one edge
-     *  in compliance with given list of edges
-     *  \param theShape Initial shape.
+     *  \brief Replace coincident edges in \a theShapes by one edge
+     *         in compliance with given list of edges
+     *  \param theShapes Initial shapes.
      *  \param theTolerance Maximum distance between edges, which can be considered as coincident.
      *  \param theEdges List of edges for gluing.
-     *  \return New GEOM_Object, containing a copy of theShape without some edges.
+     *  \return New GEOM_Object containing copies of theShapes without some edges.
      */
-    GEOM_Object MakeGlueEdgesByList (in GEOM_Object theShape,
-                                     in double theTolerance,
+    GEOM_Object MakeGlueEdgesByList (in ListOfGO theShapes,
+                                     in double   theTolerance,
                                      in ListOfGO theEdges);
 
     /*!
@@ -2130,6 +2291,23 @@ module GEOM
      */
     string GetShapeTypeString (in GEOM_Object theShape);
 
+    /*!
+     *  \brief Check if the object is a sub-object of another GEOM object.
+     *
+     *  \param theSubObject Checked sub-object (or its parent object, in case if
+     *                      \a theSubObjectIndex is non-zero).
+     *  \param theSubObjectIndex When non-zero, specifies a sub-shape index that
+     *                           identifies a sub-object within its parent specified via \a theSubObject.
+     *  \param theObject An object that is checked for ownership (or its parent object,
+     *                   in case if \a theObjectIndex is non-zero).
+     *  \param theObjectIndex When non-zero, specifies a sub-shape index that
+     *                        identifies an object within its parent specified via \a theObject.
+     *  \return TRUE, if the given object contains sub-object.
+     */
+    boolean IsSubShapeBelongsTo( in GEOM_Object theSubObject,
+                                 in long        theSubObjectIndex,
+                                 in GEOM_Object theObject,
+                                 in long        theObjectIndex);
     /*!
      *  \brief Count number of faces in the given shape.
      *  \param theShape Shape to count faces in.
@@ -2181,13 +2359,21 @@ module GEOM
                               in long        theShapeType);
 
     /*!
-     *  \brief Get all sub-shapes, shared by all shapes in the list \a theShapes.
+     *  \brief Get sub-shapes, shared by input shapes.
      *  \param theShapes Shapes to find common sub-shapes of.
      *  \param theShapeType Type of sub-shapes to be retrieved.
-     *  \return List of objects, that are sub-shapes of all given shapes.
+     *  \param theMultiShare Specifies what type of shares should be checked:
+     *         - \c TRUE: search sub-shapes from 1st input shape shared with all other input shapes;
+     *         - \c FALSE: causes to search sub-shapes shared between couples of input shapes.
+     *  \note If \a theShapes contains single compound, the shares between all possible couples of 
+     *        its top-level shapes are returned; otherwise, only shares between 1st input shape
+     *        and all rest input shapes are returned.
+     *              
+     *  \return List of all found sub-shapes.
      */
     ListOfGO GetSharedShapesMulti (in ListOfGO theShapes,
-                                   in long     theShapeType);
+                                   in long     theShapeType,
+                                  in boolean  theMultiShare);
 
     /*!
      *  \brief Find in \a theShape all sub-shapes of type \a theShapeType, situated relatively
@@ -2516,6 +2702,82 @@ module GEOM
     ListOfLong GetSameIDs (in GEOM_Object theShapeWhere,
                            in GEOM_Object theShapeWhat);
 
+    /*!
+     *  \brief Resize the input edge with the new Min and Max parameters.
+     *  The input edge parameters range is [0, 1]. If theMin parameter is
+     *  negative, the input edge is extended, otherwise it is shrinked by
+     *  theMin parameter. If theMax is greater than 1, the edge is extended,
+     *  otherwise it is shrinked by theMax parameter.
+     *  \param theEdge the input edge to be resized.
+     *  \param theMin the minimal parameter value.
+     *  \param theMax the maximal parameter value.
+     *  \return a newly created edge.
+     */
+    GEOM_Object ExtendEdge(in GEOM_Object theEdge,
+                           in double      theMin,
+                           in double      theMax);
+
+    /*!
+     *  \brief Resize the input face with the new UMin, UMax, VMin and VMax
+     *  parameters. The input face U and V parameters range is [0, 1]. If
+     *  theUMin parameter is negative, the input face is extended, otherwise
+     *  it is shrinked along U direction by theUMin parameter. If theUMax is
+     *  greater than 1, the face is extended, otherwise it is shrinked along
+     *  U direction by theUMax parameter. So as for theVMin, theVMax and
+     *  V direction of the input face.
+     *  \param theFace the input face to be resized.
+     *  \param theUMin the minimal U parameter value.
+     *  \param theUMax the maximal U parameter value.
+     *  \param theVMin the minimal V parameter value.
+     *  \param theVMax the maximal V parameter value.
+     *  \return a newly created face.
+     */
+    GEOM_Object ExtendFace(in GEOM_Object theFace,
+                           in double      theUMin,
+                           in double      theUMax,
+                           in double      theVMin,
+                           in double      theVMax);
+
+    /*!
+     *  \brief Make a surface from a face. This function takes some face as
+     *  input parameter and creates new GEOM_Object, i.e. topological shape
+     *  by extracting underlying surface of the source face and limiting it
+     *  by the Umin, Umax, Vmin, Vmax parameters of the source face (in the
+     *  parametrical space).
+     *  \param theFace the input face.
+     *  \return a newly created face.
+     */
+    GEOM_Object MakeSurfaceFromFace(in GEOM_Object theFace);
+
+    /*!
+     * \brief Explode a shape into edges sorted in a row from a starting point.
+     * \param theShape - the shape to be exploded on edges.
+     * \param theStartPoint - the starting point.
+     * \return Ordered list of edges sorted in a row from a starting point.
+     */
+    ListOfGO GetSubShapeEdgeSorted (in GEOM_Object theShape,
+                                    in GEOM_Object theStartPoint);
+
+    /*!
+     * \brief Return the list of subshapes that satisfies a certain tolerance
+     * criterion. The user defines the type of shapes to be returned, the
+     * condition and the tolerance value. The operation is defined for
+     * faces, edges and vertices only. E.g. for theShapeType FACE, theCondition
+     * CC_GT and theTolerance 1.e-7 this method returns all faces of theShape
+     * that have tolerances greater then 1.e7.
+     *
+     * \param theShape the shape to be exploded
+     * \param theShapeType the type of shapes to be returned. Can have the
+     *        values FACE, EDGE and VERTEX only.
+     * \param theCondition the condition type.
+     * \param theTolerance the tolerance filter.
+     * \return the list of shapes that satisfy the conditions.
+     */
+    ListOfGO GetSubShapesWithTolerance(in GEOM_Object          theShape,
+                                       in short                theShapeType,
+                                       in comparison_condition theCondition,
+                                       in double               theTolerance);
+
   };
 
  // # GEOM_IBlocksOperations: 
@@ -2761,10 +3023,14 @@ module GEOM
      *  - The glue between two quadrangle faces should be applied.
      *    \note Single block is also accepted as a valid compound of blocks.
      *  \param theCompound The compound to check.
+     *  \param theToleranceC1 the tolerance to check if two neighbor edges are
+     *         collinear in the common vertex with this tolerance. Negative
+     *         value means that C1 criterion is not used (old implementation).
      *  \param theErrors Structure, containing discovered errors and incriminated sub-shapes.
      *  \return TRUE, if the given shape is a compound of blocks.
      */
     boolean CheckCompoundOfBlocks (in GEOM_Object theCompound,
+                                   in double      theToleranceC1,
                                    out BCErrors   theErrors);
 
     /*!
@@ -2781,12 +3047,17 @@ module GEOM
      *  \brief Retrieve all non blocks solids and faces from a shape.
      *
      *  \param theShape The shape to explore.
+     *  \param theToleranceC1 the tolerance to check if two neighbor edges are
+     *         collinear in the common vertex with this tolerance. Negative
+     *         value means that C1 criterion is not used (old implementation).
      *  \param theNonQuads Output parameter. Group of all non quadrangular faces.
      *
      *  \return Group of all non block solids (= not 6 faces, or with 6
      *          faces, but with the presence of non-quadrangular faces).
      */
-    GEOM_Object GetNonBlocks (in GEOM_Object theShape, out GEOM_Object theNonQuads);
+    GEOM_Object GetNonBlocks (in GEOM_Object  theShape,
+                              in double       theToleranceC1,
+                              out GEOM_Object theNonQuads);
 
     /*!
      *  \brief Remove all seam and degenerated edges from \a theShape.
@@ -3049,6 +3320,17 @@ module GEOM
      *  \param theShape Shape to be intersected.
      *  \param thePlane Tool shape, to intersect theShape.
      *  \return New GEOM_Object, containing the result shape.
+     * 
+     *  \note This operation is a shortcut to the more general \ref MakePartition
+     *  operation, where \a theShape specifies single "object" (shape being partitioned)
+     *  and \a thePlane specifies single "tool" (intersector shape). Other parameters of
+     *  \ref MakePartition operation have default values:
+     *  - \a theLimit: GEOM::SHAPE (shape limit corresponds to the type of \a theShape)
+     *  - \a theKeepNonlimitShapes: 0
+     *  - \a theKeepInside, \a theRemoveInside, \a theRemoveWebs,
+     *    \a theMaterials (obsolete parameters): empty
+     *
+     * \sa MakePartition, MakePartitionNonSelfIntersectedShape
      */
     GEOM_Object MakeHalfPartition (in GEOM_Object theShape,
                                    in GEOM_Object thePlane);
@@ -3676,30 +3958,30 @@ module GEOM
 
     /*!
      *  Sewing of the given object.
-     *  \param theObject Shape to be processed.
+     *  \param theObjects Shapes to be processed.
      *  \param theTolerance Required tolerance value.
      *  \return New GEOM_Object, containing processed shape.
      */
-    GEOM_Object Sew (in GEOM_Object theObject, in double theTolerance);
+    GEOM_Object Sew (in ListOfGO theObjects, in double theTolerance);
 
     /*!
      *  Sewing of the given object. Allows non-manifold sewing.
-     *  \param theObject Shape to be processed.
+     *  \param theObjects Shapes to be processed.
      *  \param theTolerance Required tolerance value.
      *  \return New GEOM_Object, containing processed shape.
      */
-    GEOM_Object SewAllowNonManifold(in GEOM_Object theObject, in double theTolerance);
+    GEOM_Object SewAllowNonManifold(in ListOfGO theObjects, in double theTolerance);
 
     /*!
-     *  Rebuild the topology of theCompound of solids by removing
-     *  of the faces that are shared by several solids.
-     *  \param theCompound Shape to be processed.
+     *  Rebuild the topology of theSolids by removing
+     *  the faces that are shared by several solids.
+     *  \param theSolids A list of shapes containing solids to be processed.
      *  \return New GEOM_Object, containing processed shape.
      */
-    GEOM_Object RemoveInternalFaces (in GEOM_Object theCompound);
+    GEOM_Object RemoveInternalFaces (in ListOfGO theSolids);
 
     /*!
-     *  \brief Addition of a point to a given edge object.
+     *  \brief Addition of a point to a given edge of \a theObject.
      *  \param theObject Shape to be processed.
      *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
      *                      if -1, then theObject itself is the edge.
@@ -3707,11 +3989,24 @@ module GEOM
      *                  depending on \a isByParameter.
      *  \param isByParameter If TRUE : \a theValue is treated as a curve parameter [0..1],
      *                       if FALSE : \a theValue is treated as a length parameter [0..1]
-     *  \return New GEOM_Object, containing processed shape.
+     *  \return New GEOM_Object, containing the processed shape.
      */
     GEOM_Object DivideEdge (in GEOM_Object theObject, in short theEdgeIndex,
                             in double theValue, in boolean isByParameter);
 
+    /*!
+     *  \brief Addition of points to a given edge of \a theObject by projecting
+     *         other points to the given edge.
+     *  \param theObject Shape to be processed.
+     *  \param theEdgeIndex Index of edge to be divided within theObject's shape,
+     *                      if -1, then theObject itself is the edge.
+     *  \param thePoints Points to project to theEdgeIndex-th edge.
+     *  \return New GEOM_Object, containing the processed shape.
+     */
+    GEOM_Object DivideEdgeByPoint (in GEOM_Object theObject,
+                                   in short       theEdgeIndex,
+                                   in ListOfGO    thePoints);
+
     /*!
      *  \brief Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
      *  \param theWire Wire to minimize the number of C1 continuous edges in.
@@ -3724,13 +4019,13 @@ module GEOM
 
     /*!
      *  \brief Get a list of wires (wrapped in GEOM_Object-s),
-     *  that constitute a free boundary of the given shape.
-     *  \param theObject Shape to get free boundary of.
+     *  that constitute a free boundary of the given shapes.
+     *  \param theObjects Shapes to get free boundary of.
      *  \param theClosedWires Output. Closed wires on the free boundary of the given shape.
      *  \param theOpenWires Output. Open wires on the free boundary of the given shape.
      *  \return FALSE, if an error(s) occured during the method execution.
      */
-    boolean GetFreeBoundary (in GEOM_Object theObject,
+    boolean GetFreeBoundary (in  ListOfGO theObjects,
                              out ListOfGO theClosedWires,
                              out ListOfGO theOpenWires);
 
@@ -3750,6 +4045,12 @@ module GEOM
      */
     GEOM_Object LimitTolerance (in GEOM_Object theObject, in double theTolerance);
 
+
+    /*!
+     *  \brief Return information on what has been done by the last called healing method.
+     *  \return ModifStatistics, information container.
+     */
+    ModifStatistics GetStatistics();
   };
 
  // # GEOM_IInsertOperations:
@@ -3765,8 +4066,8 @@ module GEOM
     GEOM_Object MakeCopy (in GEOM_Object theOriginal);
 
     /*!
-     *  \brief Deprecated method. Use Export<FormatName> (from the
-     *  corresponding plugin) instead; here <FormatName> is a name of format.
+     *  \brief Deprecated method. Use Export\<FormatName\> (from the
+     *  corresponding plugin) instead; here \<FormatName\> is a name of format.
      *
      *  \brief Export the given shape into a file with given name.
      *  \param theObject Shape to be stored in the file.
@@ -3776,8 +4077,8 @@ module GEOM
     void Export (in GEOM_Object theObject, in string theFileName, in string theFormatName);
 
     /*!
-     *  \brief Deprecated method. Use Import<FormatName> (from the
-     *  corresponding plugin) instead; here <FormatName> is a name of format.
+     *  \brief Deprecated method. Use Import\<FormatName\> (from the
+     *  corresponding plugin) instead; here \<FormatName\> is a name of format.
      *
      *  \brief Import a shape from the STL, BREP, IGES or STEP file
      *  (depends on given format) with given name.
@@ -3840,7 +4141,41 @@ module GEOM
      * \return list of all texture IDs avaiable for the current study
      */
     ListOfLong GetAllTextures();
-    
+
+    /*!
+     *  \brief Non-topological information transfer datum.
+     */
+    struct TransferDatum
+    {
+      string myName;
+      long   myNumber;
+      long   myMaxNumber;
+    };
+
+    /*!
+     *  \brief Sequence of non-topological information tranfer data.
+     */
+    typedef sequence<TransferDatum> ListOfTransferDatum;
+
+    /*!
+     *  \brief Transfer non-topological data from one object to another
+     *  \param theObjectFrom the source object of non-topological data
+     *  \param theObjectTo the destination object of non-topological data
+     *  \param theFindMethod method to search sub-shapes of theObjectFrom
+     *         in shape theObjectTo. Possible values are: GEOM::FSM_GetInPlace,
+     *         GEOM::FSM_GetInPlaceByHistory and GEOM::FSM_GetInPlace_Old.
+     *         Other values of GEOM::find_shape_method are not supported.
+     *  \param theResult statistics of the operation. Output parameter. It
+     *         represents a sequence of Transfer Datum. A datum has the type
+     *         (string code), the total number of items of this type and
+     *         the number of transfered items.
+     *  \return true in case of success; otherwise false.
+     */
+    boolean TransferData(in  GEOM_Object         theObjectFrom,
+                         in  GEOM_Object         theObjectTo,
+                         in  find_shape_method   theFindMethod,
+                         out ListOfTransferDatum theResult);
+
   };
 
  // # GEOM_IKindOfShape:
@@ -3912,6 +4247,7 @@ module GEOM
       // VERTEX
       VERTEX,
       // ADVANCED shapes
+      LCS,
       /*! all advanced shapes (temporary implementation) */
       ADVANCED    
     };
@@ -4148,12 +4484,49 @@ module GEOM
     /*!
      *  \brief Check a topology of the given shape on self-intersections presence.
      *  \param theShape Shape to check validity of.
+     *  \param theCheckLevel the level of self-interference check.
      *  \param theIntersections Output. List of intersected sub-shapes IDs, it contains pairs of IDs.
      *  \return TRUE, if the shape does not have any self-intersections.
      */
     boolean CheckSelfIntersections (in GEOM_Object theShape,
+                                    in long        theCheckLevel,
                                     out ListOfLong theIntersections);
 
+    /*!
+     *  \brief Detect self-intersections of the given shape with algorithm based on mesh intersections.
+     *  \param theShape Shape to check validity of.
+     *  \param theDeflection Linear deflection coefficient that specifies quality of tesselation.
+     *  \param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
+     *                       - if \a theTolerance <= 0, algorithm detects intersections
+     *                       - if \a theTolerance > 0, algorithm detects gaps
+     *  \param theIntersections Output. List of intersected sub-shapes IDs, it contains pairs of IDs.
+     *  \return TRUE, if the shape does not have any self-intersections.
+     */
+    boolean CheckSelfIntersectionsFast (in GEOM_Object theShape,
+                                       in float       theDeflection,
+                                       in double      theTolerance,
+                                       out ListOfLong theIntersections);
+
+    /*!
+     *  \brief Detect intersections of the given shapes with algorithm based on mesh intersections.
+     *  \param theShape1 First source object
+     *  \param theShape2 Second source object
+     *  \param theTolerance Specifies a distance between shapes used for detecting gaps:
+     *                       - if \a theTolerance <= 0, algorithm detects intersections
+     *                       - if \a theTolerance > 0, algorithm detects gaps
+     *  \param theDeflection Linear deflection coefficient that specifies quality of tesselation:
+     *                       - if \a theDeflection <= 0, default deflection 0.001 is used
+     *  \param theIntersections1 Output: contains list of sub-shapes IDs from 1st shape that localize intersection
+     *  \param theIntersections2 Output: contains list of sub-shapes IDs from 2nd shape that localize intersection
+     *  \return TRUE, if the are intersections (gaps) between source shapes
+     */
+    boolean FastIntersect (in GEOM_Object theShape1,
+                          in GEOM_Object theShape2,
+                          in double      theTolerance,
+                          in float       theDeflection,
+                          out ListOfLong theIntersections1,
+                          out ListOfLong theIntersections2);
+
     /*!
      *  \brief Check if the given shape can be an argument for MakeSolid operation
      *  \param theShape Shape to be described.
index 3bf0fea3f9cdd9dfba6259fbe70ea820bfc4bb35..a57977b010999edfe3c7b9947e26e6136b0f0b93 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -391,10 +391,13 @@ module GEOM
                           in boolean     isPlanarWanted) ;
     GEOM_Object MakeFaceWires (in GEOM_List theWires,
                                in boolean   isPlanarWanted) ;
+    GEOM_Object MakeFaceWithConstraints(in GEOM_List theConstraints);
     GEOM_Object MakeShell (in GEOM_List theFacesAndShells) ;
     GEOM_Object MakeSolidShell (in GEOM_Object theShell) ;
     GEOM_Object MakeSolidShells (in GEOM_List theShells) ;
     GEOM_Object MakeCompound (in GEOM_List theShapes) ;
+    GEOM_Object MakeSolidFromConnectedFaces (in GEOM_List theFacesOrShells,
+                                            in boolean isIntersect);
     GEOM_Object MakeGlueFaces (in GEOM_Object theShape,
                                in double theTolerance,
                                in boolean doKeepNonSolids);
index e7d858b957a0574da7623a3523f1626f71cb9801..8655edb1c4724429a0eaf9cb6eae3f6a837d4363 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 8021e666456b9a1d4b3b5bfc38a4bf92cbc52d5a..ba1a74ec8b919b16a24be4c6d81adf3e95868766 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 
 module GEOM
 {
+  /*!
+   *  \brief Units of length
+   */
+  enum length_unit
+  {
+    LU_INCH,
+    LU_MILLIMETER,
+    LU_FOOT,
+    LU_MILE,
+    LU_METER,
+    LU_KILOMETER,
+    LU_MILLIINCH,
+    LU_MICROMETER,
+    LU_CENTIMETER,
+    LU_MICROINCH
+  };
+
   /*!
    *  \brief Interface for STEPPlugin modeling functions.
    */
@@ -34,9 +51,11 @@ module GEOM
      *
      *  \param theObject Shape to be stored in the file.
      *  \param theFileName Name of the file to store the given shape in.
+     *  \param theUnit the length unit.
      */
     void ExportSTEP( in GEOM::GEOM_Object theObject, 
-                     in string            theFileName );
+                     in string            theFileName,
+                     in GEOM::length_unit theUnit);
       
     /*!
      *  \brief Import a shape from the STEP file.
index 7c8f82531b23f18ffd65d70359ed03f6c5fdfaa4..0f9da0012e2c7c48d123afb3c157afe685a68c11 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2b5aa47de1901d0fe0c81718a8534091fc8c8c7b..9c5593787f82c3dcdc68da8fd56e7183e35b4d99 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index c382fd3d95d982d164f4a1a3c19599b0fb1e87c5..41720407bb87e210cc2a9c1bd64bb76df525943a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1d6fda98de7dfe54e049a1dc1a3ccbdb66f29390..fee3b4138f749d1bd38ab8867cc31fed23d33c8a 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE meshers PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  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
index 5b7c97167f40efdc6533369838b146a3dc93f94b..8b3bdff612cd6dd168390ddf982e5c8b156d23aa 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE meshers PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
index 1fa4e9d9dcab40900dd344f3d5a0ce551ba0ed3b..3d47d93edc22f23ef4df2f7c95802f4b251a5e97 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -35,6 +35,7 @@ SET( _res_files
   GEOM.config
   GEOMDS_Resources
   ShHealing
+  Y14.5M-2009.ttf
   3dsketch.png
   isoline.png
   isoline_v.png
@@ -54,6 +55,8 @@ SET( _res_files
   build_edge_wire.png
   build_edge_curve.png
   build_face.png
+  build_face_surface.png
+  build_face_constraints.png
   build_shell.png
   build_solid.png
   build_wire.png
@@ -88,10 +91,13 @@ SET( _res_files
   displayonly.png
   displayall.png
   draft.png
+  edgeextension.png
   erase.png
   eraseall.png
   extruded_boss.png
   extruded_cut.png
+  facetosurface.png
+  faceextension.png
   face_hw.png
   face_vechw.png
   feature_detect.png
@@ -108,6 +114,7 @@ SET( _res_files
   fuse_collinear_edges.png
   geometry.png
   import_picture.png
+  import.png
   limit_tolerance.png
   line.png
   line2points.png
@@ -127,6 +134,9 @@ SET( _res_files
   normale.png
   offset.png
   projection.png
+  projection_on_edge.png
+  projection_on_wire.png
+  proj_on_cyl.png
   origin_and_vectors.png
   partition.png
   partitionkeep.png
@@ -144,6 +154,7 @@ SET( _res_files
   planeworkingorigin.png
   point2.png
   pointonedge.png
+  pointonedgebypoint.png
   pointonface.png
   point_line_intersection.png
   polyline.png
@@ -164,6 +175,7 @@ SET( _res_files
   shapesonshape.png
   shared_shapes.png
   sketch.png
+  solid_from_faces.png
   sphere.png
   spheredxyz.png
   spherepoint.png
@@ -171,10 +183,13 @@ SET( _res_files
   supressHolesOnFaceShell.png
   supressface.png
   supresshole.png
+  thickness.png
+  thickness2.png
   tolerance.png
   torus.png
   torusdxyz.png
   toruspointvector.png
+  transfer_data.png
   translationDxyz.png
   translationPoints.png
   translationVector.png
@@ -249,6 +264,7 @@ SET( _res_files
   check_blocks_compound.png
   get_non_blocks.png
   check_self_intersections.png
+  fast_intersect.png
   free_faces.png
   propagate.png
   redo.png
index bb07e4de7bc0efa9f4374a75348db0da0a32c8e3..b11b46048154173770f12b2c3e083fbe0672bc20 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='us-ascii' ?>
 <!--
-  Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  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
@@ -33,6 +33,7 @@
   <!-- Geom data types  -->
   <type-list>
     <!-- From GEOM_Gen.idl -->
+    <objref name="CORBA/Object" id="" />
     <objref name="GEOM/GEOM_Gen" id="IDL:GEOM/GEOM_Gen:1.0" />
     <objref name="GEOM/GEOM_BaseObject" id="IDL:GEOM/GEOM_BaseObject:1.0" />
     <objref name="GEOM/GEOM_Object" id="IDL:GEOM/GEOM_Object:1.0">
       <member name="error" type="GEOM/ShapeErrorType" />
       <member name="incriminated" type="GEOM/ListOfLong" />
     </struct>
-    <sequence name="GEOM/ShapeError"  content="GEOM/ShapeErrors" />
+    <sequence name="GEOM/ShapeErrors"  content="GEOM/ShapeError" />
 
     <!-- From GEOM_Superv.idl -->
     <objref name="GEOM/GEOM_Superv"  id="IDL:GEOM/GEOM_Superv:1.0" />
               </inParameter>
               <inParameter>
                 <inParameter-name>theObject</inParameter-name>
-                <inParameter-type>Object</inParameter-type>
+                <inParameter-type>CORBA/Object</inParameter-type>
                 <inParameter-comment>unknown</inParameter-comment>
               </inParameter>
             </inParameter-list>
             </outParameter-list>
             <DataStream-list></DataStream-list>
           </component-service>
+          <component-service>
+            <service-name>MakeFaceWithConstraints</service-name>
+            <service-author>SALOME team</service-author>
+            <service-version>@SALOMEGEOM_VERSION@</service-version>
+            <service-comment>unknown</service-comment>
+            <service-by-default>0</service-by-default>
+            <inParameter-list>
+              <inParameter>
+                <inParameter-name>theConstraints</inParameter-name>
+                <inParameter-type>GEOM/GEOM_List</inParameter-type>
+                <inParameter-comment>unknown</inParameter-comment>
+              </inParameter>
+            </inParameter-list>
+            <outParameter-list>
+              <outParameter>
+                <outParameter-name>return</outParameter-name>
+                <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+                <outParameter-comment>unknown</outParameter-comment>
+              </outParameter>
+            </outParameter-list>
+            <DataStream-list></DataStream-list>
+          </component-service>
           <component-service>
             <service-name>MakeSolidShell</service-name>
             <service-author>SALOME team</service-author>
             </outParameter-list>
             <DataStream-list></DataStream-list>
           </component-service>
+          <component-service>
+            <service-name>MakeSolidFromConnectedFaces</service-name>
+            <service-author>SALOME team</service-author>
+            <service-version>@SALOMEGEOM_VERSION@</service-version>
+            <service-comment>unknown</service-comment>
+            <service-by-default>0</service-by-default>
+            <inParameter-list>
+              <inParameter>
+                <inParameter-name>theFacesOrShells</inParameter-name>
+                <inParameter-type>GEOM/GEOM_List</inParameter-type>
+                <inParameter-comment>unknown</inParameter-comment>
+              </inParameter>
+              <inParameter>
+                <inParameter-name>isIntersect</inParameter-name>
+                <inParameter-type>boolean</inParameter-type>
+                <inParameter-comment>unknown</inParameter-comment>
+              </inParameter>
+            </inParameter-list>
+            <outParameter-list>
+              <outParameter>
+                <outParameter-name>return</outParameter-name>
+                <outParameter-type>GEOM/GEOM_Object</outParameter-type>
+                <outParameter-comment>unknown</outParameter-comment>
+              </outParameter>
+            </outParameter-list>
+            <DataStream-list></DataStream-list>
+          </component-service>
           <component-service>
             <service-name>MakeCompound</service-name>
             <service-author>SALOME team</service-author>
index e3a55acfb8673283adb39e31c3f11b1ad14c1375..66c29a86a1e9c0c0f741621e96d2ddda29e5a618 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE application PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  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
index 3bce301c10204f0a2544414d58f2a0272835eca0..d52ecbf18c88ee5fa36b2762208c137ab5f05cb6 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE application PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  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
index 0810a4a0c3280c6f0a577f348c3fe9e8b6229ac2..47ad62289ac23d0e2be101d740bbf6a0c9dfc1c9 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE meshers PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
index 0af939973d93a332b941cbe3ade7762bec710702..b9d21fbd7dcd807e1f2b493e75df1a502b21ebec 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE meshers PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
index 81dd11bb6c74755d7e9ede47a03ac5db9736a2df..56d5ca7d8beb9b154dcb345a53eef3e4afa4263b 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE meshers PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
index 569ff16a8487b6d4d8d2259e79479ac245248484..8e83fdbc2fe8e69c3afd42f3091eb9b90b70b317 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-  Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  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
@@ -58,6 +58,7 @@
     <parameter name="line_color"          value="255, 0, 0" />
     <parameter name="point_color"         value="#ff7700" />
     <parameter name="isos_color"          value="200, 200, 200" />
+    <parameter name="label_color"         value="255, 255, 255" />
     <parameter name="toplevel_color"      value="170, 85, 0" />
     <parameter name="toplevel_dm"         value="0" />
     <parameter name="editgroup_color"     value="170, 85, 0" />
@@ -67,6 +68,7 @@
     <parameter name="base_vectors_length" value="1"  />
     <parameter name="marker_scale"        value="3"  />
     <parameter name="geom_preview"        value="true"  />
+    <parameter name="hide_input_object"   value="true"  />
     <parameter name="material"            value="[ Default ]" />
     <parameter name="predef_materials"    value="true" />
     <parameter name="edge_width"          value="1" />
     <!-- Dimension presentation properties -->
     <parameter name="dimensions_color"          value="#ffffff" />
     <parameter name="dimensions_line_width"     value="1" />
-    <parameter name="dimensions_font_height"    value="10" />
+    <parameter name="dimensions_font"           value="Y14.5M-2009,14" />
     <parameter name="dimensions_arrow_length"   value="5" />
     <parameter name="dimensions_show_units"     value="0" />
     <parameter name="dimensions_length_units"   value="m" />
     <parameter name="dimensions_angle_units"    value="deg" />
-       <parameter name="dimensions_default_flyout" value="20" />
+    <parameter name="dimensions_default_flyout" value="20" />
+    <parameter name="dimensions_use_text3d"     value="0" />
 
     <!-- Scalar bar for field step presentation -->
     <parameter name="scalar_bar_x_position"   value="0.05" />
index 087f7a05b97ecd98bf504f4824d60ea9cf514b65..864e192a1fc30953658abefc95890bfde0b23328 100644 (file)
@@ -18,6 +18,10 @@ ShapeProcess.FixFaceSize.Tolerance                           : 0.05
 
 ShapeProcess.DropSmallEdges.Tolerance3d                : 0.05
 
+ShapeProcess.DropSmallSolids.WidthFactorThreshold       : 1
+ShapeProcess.DropSmallSolids.VolumeThreshold            : 1000
+ShapeProcess.DropSmallSolids.MergeSolids                : 1
+
 ShapeProcess.BSplineRestriction.SurfaceMode            : 1
 ShapeProcess.BSplineRestriction.Curve3dMode            : 1
 ShapeProcess.BSplineRestriction.Curve2dMode            : 1
@@ -210,6 +214,11 @@ ShapeProcess.SameParameter.Tolerance3d                     : 1.e-7
 ! DropSmallEdges                        : Eliminate small edges by removing or merging with neighbour
 ! DropSmallEdges.Tolerance3d            : Tolerance (3d)
 
+! DropSmallSolids                       : Eliminate small solids by a) removing them or b) absorbing them by adjacent larger solids.
+! DropSmallSolids.WidthFactorThreshold  : Maximum value of 2V/S of a solid where V is volume and S is surface area of the solid.
+! DropSmallSolids.VolumeThreshold       : Maximum volume of a solid.
+! DropSmallSolids.MergeSolids           : If false, solids are removed; otherwise, solids are merged to adjacent larger solids.
+
 ! FixShape.Tolerance3d                 : Tolerance (3d) for fixing of shape.
 ! FixShape.MaxTolerance3d              : Maximal possible value of increasing of tolerance during fixing.
 ! FixShape.MinTolerance3d              : Minimal value of tolerance.
index de58fd01b2c098d9c0f7c9e5d8dafd77f01183bc..78ff870e87fc17637985f0366028ef350f9f1c70 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE meshers PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
index c001371213ac28601b4e7870c7c094787f76fa62..742b3ae82ed1d6a597fc73d94838f5f84375d435 100644 (file)
@@ -1,7 +1,7 @@
 <?xml version='1.0' encoding='us-ascii'?>
 <!DOCTYPE meshers PUBLIC "" "desktop.dtd">
 <!--
-  Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
diff --git a/resources/Y14.5M-2009.ttf b/resources/Y14.5M-2009.ttf
new file mode 100644 (file)
index 0000000..1f1ca19
Binary files /dev/null and b/resources/Y14.5M-2009.ttf differ
diff --git a/resources/build_face_constraints.png b/resources/build_face_constraints.png
new file mode 100644 (file)
index 0000000..81cab3b
Binary files /dev/null and b/resources/build_face_constraints.png differ
diff --git a/resources/build_face_surface.png b/resources/build_face_surface.png
new file mode 100644 (file)
index 0000000..f77b0f5
Binary files /dev/null and b/resources/build_face_surface.png differ
diff --git a/resources/edgeextension.png b/resources/edgeextension.png
new file mode 100644 (file)
index 0000000..c468969
Binary files /dev/null and b/resources/edgeextension.png differ
diff --git a/resources/faceextension.png b/resources/faceextension.png
new file mode 100644 (file)
index 0000000..b8429df
Binary files /dev/null and b/resources/faceextension.png differ
diff --git a/resources/facetosurface.png b/resources/facetosurface.png
new file mode 100644 (file)
index 0000000..ecd57cf
Binary files /dev/null and b/resources/facetosurface.png differ
diff --git a/resources/fast_intersect.png b/resources/fast_intersect.png
new file mode 100644 (file)
index 0000000..736adde
Binary files /dev/null and b/resources/fast_intersect.png differ
diff --git a/resources/import.png b/resources/import.png
new file mode 100644 (file)
index 0000000..71690c9
Binary files /dev/null and b/resources/import.png differ
diff --git a/resources/pointonedgebypoint.png b/resources/pointonedgebypoint.png
new file mode 100644 (file)
index 0000000..2068517
Binary files /dev/null and b/resources/pointonedgebypoint.png differ
diff --git a/resources/proj_on_cyl.png b/resources/proj_on_cyl.png
new file mode 100644 (file)
index 0000000..bd52b71
Binary files /dev/null and b/resources/proj_on_cyl.png differ
diff --git a/resources/projection_on_edge.png b/resources/projection_on_edge.png
new file mode 100644 (file)
index 0000000..b1f65ad
Binary files /dev/null and b/resources/projection_on_edge.png differ
diff --git a/resources/projection_on_wire.png b/resources/projection_on_wire.png
new file mode 100644 (file)
index 0000000..a182d8f
Binary files /dev/null and b/resources/projection_on_wire.png differ
diff --git a/resources/solid_from_faces.png b/resources/solid_from_faces.png
new file mode 100644 (file)
index 0000000..f3ce532
Binary files /dev/null and b/resources/solid_from_faces.png differ
diff --git a/resources/thickness.png b/resources/thickness.png
new file mode 100644 (file)
index 0000000..bee2928
Binary files /dev/null and b/resources/thickness.png differ
diff --git a/resources/thickness2.png b/resources/thickness2.png
new file mode 100644 (file)
index 0000000..31b9e56
Binary files /dev/null and b/resources/thickness2.png differ
diff --git a/resources/transfer_data.png b/resources/transfer_data.png
new file mode 100644 (file)
index 0000000..275444b
Binary files /dev/null and b/resources/transfer_data.png differ
index 31978bd841555f35e03ff7cbbef3c3f5fb439e4c..186780b2ac7118b4f9460e717d684663adc498b6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 09686564b77a2025101eb5a1e491295623249731..86b4af26443ac2727e2efbd1d49b777aea49fa20 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e20ac64997722fec0a5873be0fc548a3e91928a5..d326c06f8ad3e85fd0db378fe39f0d5d10f29707 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 8745b3c3e4738655c5957761068cf084cf4194a2..ad9ea4ef4d38ddd95e802a399a3c8990cd4b76ec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b73287b2b36c2f8221583484bf02449b11e321bf..da724c49bd2495882e0b8f7edaa3cc90a6b85ff0 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index d1391bc13db859b84f176885e7dd1af8ed307a35..bb87626777d625fc77ca0cfc7ee0a5d3525e47f4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 9bda25fc404de2c1bd8640b3432e49f949b18320..2eb1bcc2927e0881e8c695a4ce27e612026e2fbd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c0f7e9c40ce2913dcdab2031d13c9b6f3341f702..15aaa86434edb0c47c7b83ec5f315359133a83b0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e713e003a7c818fd3927733c93dcc4c1b014d522..cddf9c5cfb39bc19dcd3824eaf0ed0232dbd5ceb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -36,8 +36,9 @@
 #include "GEOM_Function.hxx"
 #include "GEOM_PythonDump.hxx"
 #include "GEOMUtils.hxx"
+#include "GEOMAlgo_ClsfSurf.hxx"
+#include "GEOMAlgo_FinderShapeOn2.hxx"
 #include "GEOMAlgo_Splitter.hxx"
-#include "GEOMAlgo_FinderShapeOn1.hxx"
 
 #include "GEOMImpl_Gen.hxx"
 #include "GEOMImpl_Types.hxx"
 
 #define FIND_GROUPS_BY_POINTS 1
 
+// Undefine below macro to enable workaround about fillet problem in MakePipeTShapeFillet
+// VSR 30/12/2014: macro enabled
+#define FILLET_FIX_TOLERANCE
+
 //=============================================================================
 /*!
  *  Constructor
@@ -154,9 +159,9 @@ AdvancedEngine_IOperations::~AdvancedEngine_IOperations()
  */
 //=============================================================================
 gp_Trsf AdvancedEngine_IOperations::GetPositionTrsf(double theL1, double theL2,
-                                                   Handle(GEOM_Object) theP1,
-                                                   Handle(GEOM_Object) theP2,
-                                                   Handle(GEOM_Object) theP3)
+                                                    Handle(GEOM_Object) theP1,
+                                                    Handle(GEOM_Object) theP2,
+                                                    Handle(GEOM_Object) theP3)
 {
   // Old Local Coordinates System oldLCS
   gp_Pnt P0(0, 0, 0);
@@ -195,10 +200,10 @@ gp_Trsf AdvancedEngine_IOperations::GetPositionTrsf(double theL1, double theL2,
  */
 //=============================================================================
 bool AdvancedEngine_IOperations::CheckCompatiblePosition(double& theL1, double& theL2,
-                                                        Handle(GEOM_Object) theP1,
-                                                        Handle(GEOM_Object) theP2,
-                                                        Handle(GEOM_Object) theP3,
-                                                        double theTolerance)
+                                                         Handle(GEOM_Object) theP1,
+                                                         Handle(GEOM_Object) theP2,
+                                                         Handle(GEOM_Object) theP3,
+                                                         double theTolerance)
 {
   SetErrorCode(KO);
   gp_Pnt P1 = BRep_Tool::Pnt(TopoDS::Vertex(theP1->GetValue()));
@@ -266,11 +271,11 @@ bool AdvancedEngine_IOperations::CheckCompatiblePosition(double& theL1, double&
  */
 //=============================================================================
 bool AdvancedEngine_IOperations::MakeGroups(Handle(GEOM_Object) theShape, int shapeType,
-                                           double theR1, double theW1, double theL1,
-                                           double theR2, double theW2, double theL2,
-                                           double theH, double theW, double theRF,
-                                           Handle(TColStd_HSequenceOfTransient) theSeq,
-                                           gp_Trsf aTrsf)
+                                            double theR1, double theW1, double theL1,
+                                            double theR2, double theW2, double theL2,
+                                            double theH, double theW, double theRF,
+                                            Handle(TColStd_HSequenceOfTransient) theSeq,
+                                            gp_Trsf aTrsf)
 {
   SetErrorCode(KO);
 
@@ -811,11 +816,13 @@ bool AdvancedEngine_IOperations::GetFacesOnSurf
                       const Standard_Real theTolerance,
                       TopTools_ListOfShape &theFaces)
 {
-  GEOMAlgo_FinderShapeOn1 aFinder;
+  GEOMAlgo_FinderShapeOn2   aFinder;
+  Handle(GEOMAlgo_ClsfSurf) aClsfSurf = new GEOMAlgo_ClsfSurf;
 
+  aClsfSurf->SetSurface(theSurface);
   aFinder.SetShape(theShape);
   aFinder.SetTolerance(theTolerance);
-  aFinder.SetSurface(theSurface);
+  aFinder.SetClsf(aClsfSurf);
   aFinder.SetShapeType(TopAbs_FACE);
   aFinder.SetState(GEOMAlgo_ST_ON);
 
@@ -832,7 +839,7 @@ bool AdvancedEngine_IOperations::GetFacesOnSurf
 
   // Interprete results
   Standard_Integer iErr = aFinder.ErrorStatus();
-  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iErr) {
     MESSAGE(" iErr : " << iErr);
     TCollection_AsciiString aMsg (" iErr : ");
@@ -841,7 +848,7 @@ bool AdvancedEngine_IOperations::GetFacesOnSurf
     return false;
   }
   Standard_Integer iWrn = aFinder.WarningStatus();
-  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iWrn) {
     MESSAGE(" *** iWrn : " << iWrn);
   }
@@ -1132,10 +1139,10 @@ bool AdvancedEngine_IOperations::MakeInternalGroup
 }
 
 bool AdvancedEngine_IOperations::MakePipeTShapePartition(Handle(GEOM_Object) theShape,
-                                                        double theR1, double theW1, double theL1,
-                                                        double theR2, double theW2, double theL2,
-                                                        double theH, double theW,
-                                                        double theRF, bool isNormal)
+                                                         double theR1, double theW1, double theL1,
+                                                         double theR2, double theW2, double theL2,
+                                                         double theH, double theW,
+                                                         double theRF, bool isNormal)
 {
   SetErrorCode(KO);
 
@@ -1203,12 +1210,12 @@ bool AdvancedEngine_IOperations::MakePipeTShapePartition(Handle(GEOM_Object) the
       if (Abs(aP.X()) <= Precision::Confusion()) {
         if (Abs(aP.Y()) < d1min) {
           vi1 = v;
-         d1min = Abs(aP.Y());
-       }
+          d1min = Abs(aP.Y());
+        }
       } else if (Abs(aP.Y()) <= Precision::Confusion()) {
-       if (Abs(aP.X()) < d2min) {
-         vi2 = v;
-         d2min = Abs(aP.X());
+        if (Abs(aP.X()) < d2min) {
+          vi2 = v;
+          d2min = Abs(aP.X());
         }
       }
     }
@@ -1249,14 +1256,14 @@ bool AdvancedEngine_IOperations::MakePipeTShapePartition(Handle(GEOM_Object) the
         if (Abs(aP.X()) <= Precision::Confusion()) {
           if (Abs(aP.Y()) > d1max) {
             ve1 = v;
-           vertex1 = aVertex;
-           d1max = Abs(aP.Y());
+            vertex1 = aVertex;
+            d1max = Abs(aP.Y());
           }
         } else if (Abs(aP.Y()) <= Precision::Confusion()) {
           if (Abs(aP.X()) > d2max) {
             ve2 = v;
-           vertex2 = aVertex;
-           d2max = Abs(aP.X());
+            vertex2 = aVertex;
+            d2max = Abs(aP.X());
           }
         }
       }
@@ -1281,12 +1288,12 @@ bool AdvancedEngine_IOperations::MakePipeTShapePartition(Handle(GEOM_Object) the
       for (int i=1; i<=edges_e->Length();i++) {
         Handle(GEOM_Object) anObj = Handle(GEOM_Object)::DownCast(edges_e->Value(i));
         anObj->GetLastFunction()->SetDescription("");
-       TopoDS_Edge anEdge = TopoDS::Edge(anObj->GetValue());
-       if ( !anEdge.IsNull() && 
-            (sae.FirstVertex(anEdge).IsSame(vertex1) || sae.LastVertex(anEdge).IsSame(vertex1)) && 
-            (sae.FirstVertex(anEdge).IsSame(vertex2) || sae.LastVertex(anEdge).IsSame(vertex2))) {
-         arete_intersect_ext = anObj;
-       }
+        TopoDS_Edge anEdge = TopoDS::Edge(anObj->GetValue());
+        if ( !anEdge.IsNull() && 
+             (sae.FirstVertex(anEdge).IsSame(vertex1) || sae.LastVertex(anEdge).IsSame(vertex1)) && 
+             (sae.FirstVertex(anEdge).IsSame(vertex2) || sae.LastVertex(anEdge).IsSame(vertex2))) {
+          arete_intersect_ext = anObj;
+        }
       }
 
       edge_e1 = myBasicOperations->MakeLineTwoPnt(ve1, vi1);
@@ -1467,70 +1474,16 @@ bool AdvancedEngine_IOperations::MakePipeTShapePartition(Handle(GEOM_Object) the
       face_t->GetLastFunction()->SetDescription("");
       theShapes.push_back(face_t);
 
-      gp_Pnt aP2 = BRep_Tool::Pnt(TopoDS::Vertex(P2->GetValue()));
-      gp_Pnt aP5 = BRep_Tool::Pnt(TopoDS::Vertex(vi1->GetValue()));
-      double deltaZ = aP2.Z() - aP5.Z();
-      //         std::cerr << "Creating new point from vi1 with deltaZ = " << deltaZ << std::endl;
-      Handle(GEOM_Object) P5bis = myTransformOperations->TranslateDXDYDZCopy(vi1, 0, 0, deltaZ);
-      if (P5bis.IsNull()) {
-        SetErrorCode("Impossible to translate vertex");
-        return false;
-      }
-      P5bis->GetLastFunction()->SetDescription("");
-
-      gp_Pnt aP4 = BRep_Tool::Pnt(TopoDS::Vertex(P4->GetValue()));
-      gp_Pnt aP6 = BRep_Tool::Pnt(TopoDS::Vertex(vi2->GetValue()));
-      deltaZ = aP4.Z() - aP6.Z();
-      //         std::cerr << "Creating new point from vi2 with deltaZ = " << deltaZ << std::endl;
-      Handle(GEOM_Object) P6bis = myTransformOperations->TranslateDXDYDZCopy(vi2, 0, 0, deltaZ);
-      if (P6bis.IsNull()) {
-        SetErrorCode("Impossible to translate vertex");
-        return false;
-      }
-      P6bis->GetLastFunction()->SetDescription("");
+      // Create a prism from edge_chan_inc
+      Handle(GEOM_Object) aPrismDir = myBasicOperations->MakeVectorDXDYDZ(1., 1., 0.);
 
-      //         std::cerr << "Creating new line 1 from 2 previous points" << std::endl;
-      Handle(GEOM_Object) Cote_3 = myBasicOperations->MakeLineTwoPnt(P5bis, P2);
-      if (Cote_3.IsNull()) {
-        SetErrorCode("Impossible to build edge in thickness");
+      if (aPrismDir.IsNull()) {
+        SetErrorCode("Impossible to build Prism direction");
         return false;
       }
-      Cote_3->GetLastFunction()->SetDescription("");
+      aPrismDir->GetLastFunction()->SetDescription("");
+      face_t2 = my3DPrimOperations->MakePrismVecH(edge_chan_inc, aPrismDir, theR2 + theW2);
 
-      //         std::cerr << "Creating new line 2 from 2 previous points" << std::endl;
-      Handle(GEOM_Object) Cote_4 = myBasicOperations->MakeLineTwoPnt(P6bis, P4);
-      if (Cote_4.IsNull()) {
-        SetErrorCode("Impossible to build edge in thickness");
-        return false;
-      }
-      Cote_4->GetLastFunction()->SetDescription("");
-
-      //         std::cerr << "Creating new line 3 from 2 previous points" << std::endl;
-      Handle(GEOM_Object) Cote_5 = myBasicOperations->MakeLineTwoPnt(P5bis, P6bis);
-      if (Cote_4.IsNull()) {
-        SetErrorCode("Impossible to build edge in thickness");
-        return false;
-      }
-      Cote_5->GetLastFunction()->SetDescription("");
-
-      //std::list<Handle(GEOM_Object)> edgeList2;
-      //edgeList2.push_back(edge_chan_inc);
-      //edgeList2.push_back(Cote_3);
-      //edgeList2.push_back(Cote_5);
-      //edgeList2.push_back(Cote_4);
-      //         std::cerr << "Creating wire 2" << std::endl;
-      //wire_t2 = myShapesOperations->MakeWire(edgeList2, 1e-7);
-      //if (wire_t2.IsNull()) {
-      //  SetErrorCode("Impossible to build wire");
-      //  return false;
-      //}
-      //wire_t2->GetLastFunction()->SetDescription("");
-      //         std::cerr << "Creating face 2" << std::endl;
-      //face_t2 = myShapesOperations->MakeFace(wire_t2, false);
-
-      // Mantis issue 0021682
-      face_t2 = my3DPrimOperations->MakePrismVecH(edge_chan_inc, Cote_4, - (theR2 + theW2));
-      //face_t2 = my3DPrimOperations->MakePrismVecH(edge_chan_inc, Cote_4, - 2.0*theR2);
       if (face_t2.IsNull()) {
         SetErrorCode("Impossible to build face");
         return false;
@@ -1579,7 +1532,7 @@ bool AdvancedEngine_IOperations::MakePipeTShapePartition(Handle(GEOM_Object) the
 
     // Last verification: result should be a block
     std::list<GEOMImpl_IBlocksOperations::BCError> errList;
-    if (!myBlocksOperations->CheckCompoundOfBlocks(Te3,errList)) {
+    if (!myBlocksOperations->CheckCompoundOfBlocks(Te3, -1, errList)) {
       SetErrorCode("TShape is not a compound of block");
       return false;
     }
@@ -1614,8 +1567,8 @@ bool AdvancedEngine_IOperations::MakePipeTShapePartition(Handle(GEOM_Object) the
 
 // Mirror and glue faces
 bool AdvancedEngine_IOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object) theShape,
-                                                            double theR1, double theW1, double theL1,
-                                                            double theR2, double theW2, double theL2)
+                                                             double theR1, double theW1, double theL1,
+                                                             double theR2, double theW2, double theL2)
 {
   SetErrorCode(KO);
 
@@ -1669,7 +1622,8 @@ bool AdvancedEngine_IOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object)
   TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
   TNaming_CopyShape::CopyTool(Te7->GetValue(), aMapTShapes, aShapeCopy);
 
-  Handle(GEOM_Object) Te8 = myShapesOperations->MakeGlueFaces(Te7, 1e-7, true);
+  std::list<Handle(GEOM_Object)> Te7list( 1, Te7 );
+  Handle(GEOM_Object) Te8 = myShapesOperations->MakeGlueFaces(Te7list, 1e-7, true);
   if (Te8.IsNull()) {
     SetErrorCode("Impossible to glue faces of TShape");
     return false;
@@ -1694,7 +1648,7 @@ bool AdvancedEngine_IOperations::MakePipeTShapeMirrorAndGlue(Handle(GEOM_Object)
 
     // Perform gluing
     Te7->GetLastFunction()->SetValue(aShapeCopy);
-    Te8 = myShapesOperations->MakeGlueFaces(Te7, aTolMax, true);
+    Te8 = myShapesOperations->MakeGlueFaces(Te7list, aTolMax, true);
 
     if (Te8.IsNull()) {
       SetErrorCode("Impossible to glue faces of TShape");
@@ -1845,10 +1799,10 @@ TopoDS_Shape AdvancedEngine_IOperations::MakePipeTShapeThicknessReduction
 //purpose  : Static method. Create one thickness reduction element.
 //=======================================================================
 TopoDS_Shape AdvancedEngine_IOperations::MakeThicknessReduction (gp_Ax2 theAxes,
-                                                                const double R, const double W,
-                                                                const double Rthin, const double Wthin,
-                                                                const double Ltrans, const double Lthin,
-                                                                bool fuse)
+                                                                 const double R, const double W,
+                                                                 const double Rthin, const double Wthin,
+                                                                 const double Ltrans, const double Lthin,
+                                                                 bool fuse)
 {
   double aTol = Precision::Confusion();
   if (Rthin < aTol || Wthin < aTol || Ltrans < aTol) {
@@ -1953,11 +1907,11 @@ TopoDS_Shape AdvancedEngine_IOperations::MakeThicknessReduction (gp_Ax2 theAxes,
 //=============================================================================
 Handle(TColStd_HSequenceOfTransient)
   AdvancedEngine_IOperations::MakePipeTShape(double theR1, double theW1, double theL1,
-                                            double theR2, double theW2, double theL2,
-                                            double theRL, double theWL, double theLtransL, double theLthinL,
-                                            double theRR, double theWR, double theLtransR, double theLthinR,
-                                            double theRI, double theWI, double theLtransI, double theLthinI,
-                                            bool theHexMesh)
+                                             double theR2, double theW2, double theL2,
+                                             double theRL, double theWL, double theLtransL, double theLthinL,
+                                             double theRR, double theWR, double theLtransR, double theLthinR,
+                                             double theRI, double theWI, double theLtransI, double theLthinI,
+                                             bool theHexMesh)
 {
   MESSAGE("AdvancedEngine_IOperations::MakePipeTShape");
   SetErrorCode(KO);
@@ -2842,6 +2796,17 @@ AdvancedEngine_IOperations::MakePipeTShapeFillet
   aFillet->GetLastFunction()->SetDescription("");
 
   TopoDS_Shape aFilletShape = aFillet->GetValue();
+
+#ifdef FILLET_FIX_TOLERANCE
+  // VSR: 30/12/2014: temporary workaround about Fillet problem
+  if (theHexMesh) {
+    GEOMUtils::FixShapeTolerance(aFilletShape, TopAbs_FACE);
+  }
+  else {
+    GEOMUtils::FixShapeCurves(aFilletShape);
+  }
+#endif
+
   aFunction->SetValue(aFilletShape);
   // END of fillet
 
@@ -3087,6 +3052,17 @@ AdvancedEngine_IOperations::MakePipeTShapeFilletWithPosition
   aFillet->GetLastFunction()->SetDescription("");
 
   TopoDS_Shape aFilletShape = aFillet->GetValue();
+
+#ifdef FILLET_FIX_TOLERANCE
+  // VSR: 30/12/2014: temporary workaround about Fillet problem
+  if (theHexMesh) {
+    GEOMUtils::FixShapeTolerance(aFilletShape, TopAbs_FACE);
+  }
+  else {
+    GEOMUtils::FixShapeCurves(aFilletShape);
+  }
+#endif
+
   aFunction->SetValue(aFilletShape);
   // END of fillet
 
@@ -3215,7 +3191,7 @@ AdvancedEngine_IOperations::MakePipeTShapeFilletWithPosition
  */
 //=============================================================================
 Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedDisk (double theR, double theRatio, 
-                                                                int theOrientation, int thePattern)
+                                                                 int theOrientation, int thePattern)
 {
   SetErrorCode(KO);
   
@@ -3287,10 +3263,10 @@ Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedDisk (double theR, do
  */
 //=============================================================================
 Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedDiskPntVecR (Handle(GEOM_Object) thePnt, 
-                                                                       Handle(GEOM_Object) theVec, 
-                                                                       double theR, 
-                                                                       double theRatio,
-                                                                       int    thePattern)
+                                                                        Handle(GEOM_Object) theVec, 
+                                                                        double theR, 
+                                                                        double theRatio,
+                                                                        int    thePattern)
 {
   SetErrorCode(KO);
 
@@ -3362,8 +3338,8 @@ Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedDiskPntVecR (Handle(G
  */
 //=============================================================================
 Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedCylinder (double theR, 
-                                                                    double theH,
-                                                                    int    thePattern)
+                                                                     double theH,
+                                                                     int    thePattern)
 {
   SetErrorCode(KO);
   
@@ -3409,9 +3385,9 @@ Handle(GEOM_Object) AdvancedEngine_IOperations::MakeDividedCylinder (double theR
  */
 //=============================================================================
 Handle(GEOM_Object) AdvancedEngine_IOperations::MakeSmoothingSurface (std::list<Handle(GEOM_Object)> thelPoints, 
-                                                                     int                            theNbMax,
-                                                                     int                            theDegMax,
-                                                                     double                         theDMax)
+                                                                      int                            theNbMax,
+                                                                      int                            theDegMax,
+                                                                      double                         theDMax)
 {
   SetErrorCode(KO);
 
index 939dd0171c79308f0b3af98c8fad1cf153c68312..91026050d7ca8898c92ba022e99fcd345cff634c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 5afb75b599d407cc44c6be1524a0212bb1950060..bacc3853ec86869745fbc9676fdf57852095a758 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 0711b6ab0ea7de9786de98b8eabdbef56a434a52..9e460b54f1bce9ff1bd7ae4d78e2cee23e45ec8a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index b4a26fe9a278b730d107b3fd87ca397b00702705..0ced2142459c1820353eb3f65d0a06dfa1bfb226 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3ee9bde3e491807c58b6b7af63cb755bddb912ed..42c7852de104463a9c65aa77023a11e9c48ef676 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 4ca0a05c5c6247025a58a2b79efed64a43c10427..011d6839a9c63a9d1abf489fb96b14d6a0ee3d79 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1264035caabcc72b4b67b5c32a71d8efb9a153f9..e64d2b64c31c6bab204731a41c22f0e6944271fd 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 7551b43f7f5f199be5edfcc1cc6b67756ddb61d9..5bdf76723208142b09b3e8bd176c714db71970c9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -26,9 +26,9 @@
 #include "GEOM_Function.hxx"
 #include "GEOM_IOperations.hxx"
 #include "GEOMUtils.hxx"
-#include "GEOMAlgo_FinderShapeOn1.hxx"
 #include "GEOMAlgo_FinderShapeOn2.hxx"
 #include "GEOMAlgo_ClsfBox.hxx"
+#include "GEOMAlgo_ClsfSurf.hxx"
 #include "GEOMAlgo_Splitter.hxx"
 
 #include "Geom_CylindricalSurface.hxx"
 
 #include <vector>
 
+// Undefine below macro to enable workaround about problem with wrong 
+// tolerances of intersection curves in MakePipeTShape and MakeQuarterPipeTShape
+// VSR 30/12/2014: macro enabled
+#define FIX_CURVES_TOLERANCES
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -122,7 +127,7 @@ AdvancedEngine_PipeTShapeDriver::GetShapesOnBoxIDs(const TopoDS_Shape& aBox,
 
   // Interprete results
   Standard_Integer iErr = aFinder.ErrorStatus();
-  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iErr) {
     TCollection_AsciiString aMsg (" iErr : ");
     aMsg += TCollection_AsciiString(iErr);
@@ -180,12 +185,14 @@ Handle(TColStd_HSequenceOfInteger)
   }
 
   // Call algo
-  GEOMAlgo_FinderShapeOn1 aFinder;
-  Standard_Real aTol = 1e-6;
+  GEOMAlgo_FinderShapeOn2   aFinder;
+  Handle(GEOMAlgo_ClsfSurf) aClsfSurf = new GEOMAlgo_ClsfSurf;
+  Standard_Real             aTol      = 1e-6;
 
+  aClsfSurf->SetSurface(theSurface);
   aFinder.SetShape(theShape);
   aFinder.SetTolerance(aTol);
-  aFinder.SetSurface(theSurface);
+  aFinder.SetClsf(aClsfSurf);
   aFinder.SetShapeType(theShapeType);
   aFinder.SetState(theState);
 
@@ -203,7 +210,7 @@ Handle(TColStd_HSequenceOfInteger)
 
   // Interprete results
   Standard_Integer iErr = aFinder.ErrorStatus();
-  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iErr) {
 //    MESSAGE(" iErr : " << iErr);
     TCollection_AsciiString aMsg (" iErr : ");
@@ -212,7 +219,7 @@ Handle(TColStd_HSequenceOfInteger)
     return aSeqOfIDs;
   }
 //  Standard_Integer iWrn = aFinder.WarningStatus();
-  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn2.cxx
 //  if (iWrn) {
 //    MESSAGE(" *** iWrn : " << iWrn);
 //  }
@@ -299,7 +306,7 @@ void AdvancedEngine_PipeTShapeDriver::GetCommonShapesOnCylinders(const TopoDS_Sh
 //purpose  :
 //=======================================================================
 TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakePipeTShape (const double r1, const double w1, const double l1,
-                                                        const double r2, const double w2, const double l2) const
+                                                              const double r2, const double w2, const double l2) const
 {
   double r1Ext = r1 + w1;
   double r2Ext = r2 + w2;
@@ -341,7 +348,14 @@ TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakePipeTShape (const double r1, c
     StdFail_NotDone::Raise("Coudn't cut cylinders");
   }
 
-  return Te.Shape();
+  TopoDS_Shape aShape = Te.Shape();
+
+  // VSR: 30/12/2014: temporary workaround about intersection curves problem
+#ifdef FIX_CURVES_TOLERANCES
+  GEOMUtils::FixShapeCurves(aShape);
+#endif
+
+  return aShape;
 }
 
 //=======================================================================
@@ -349,7 +363,7 @@ TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakePipeTShape (const double r1, c
 //purpose  :
 //=======================================================================
 TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakeQuarterPipeTShape (const double r1, const double w1, const double l1,
-                                                               const double r2, const double w2, const double l2) const
+                                                                     const double r2, const double w2, const double l2) const
 {
   TopoDS_Shape Te = MakePipeTShape(r1, w1, l1, r2, w2, l2);
   if (Te.IsNull())
@@ -373,6 +387,13 @@ TopoDS_Shape AdvancedEngine_PipeTShapeDriver::MakeQuarterPipeTShape (const doubl
     StdFail_NotDone::Raise("Couldn't cut Pipe Tshape with box");
   }
 
+  TopoDS_Shape aShape = Te4.Shape();
+
+  // VSR: 30/12/2014: temporary workaround about intersection curves problem
+#ifdef FIX_CURVES_TOLERANCES
+  GEOMUtils::FixShapeCurves(aShape);
+#endif
+
   return Te4.Shape();
 }
 
index 68e6c254e33d0e258f386fa4075266c66c9f7190..084ad5032dd0a644bf5eb2f0c79b4a462483ef88 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 19fef9c5243706c18550f55aa51ca8f729b7b420..2615c3cd9533224556b2d3b81715a4cfa2f658ee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2e2015fe1f435d4af8467d3cd2da1d4db2cad148..96d97cb0cb099e2a1d61352625ecde1072c442d1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 63ee5b5cadb0da934eace033e1dcfc9fbfa07596..622f976d05d641b4c32f58fc1e3be2db8e5d9bf4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 7a2c8e13a40cd0d1c82907347f7019dce14b5b80..6f5e25ef091cded96c0ab5fac3f8aa651505a52a 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index a5e5e0851b26f75d57c893747d836bcf172c326c..67a8923d3348c69dbdd935e3f8684b2e0a9ba9e8 100644 (file)
@@ -21,7 +21,7 @@
     </message>
     <message>
       <source>GEOM_DIVIDEDDISK</source>
-      <translation>Divided_Disk</translation>
+      <translation>分割ディスク</translation>
     </message>
     <message>
       <source>GEOM_DIVIDEDDISK_TITLE</source>
@@ -29,7 +29,7 @@
     </message>
     <message>
       <source>GEOM_DIVIDEDCYLINDER</source>
-      <translation>Divided_Cylinder</translation>
+      <translation>分割シリンダー</translation>
     </message>
     <message>
       <source>GEOM_DIVIDEDCYLINDER_TITLE</source>
     </message>
     <message>
       <source>JUNCTION_FACE_1</source>
-      <translation>Junction 1</translation>
+      <translation>継手面1</translation>
     </message>
     <message>
       <source>JUNCTION_FACE_2</source>
-      <translation>Junction 2</translation>
+      <translation>継手面2</translation>
     </message>
     <message>
       <source>JUNCTION_FACE_3</source>
-      <translation>Junction 3</translation>
+      <translation>継手面3</translation>
     </message>
     <message>
       <source>INTERNAL_FACES</source>
-      <translation>å\86\85é\83¨ã\81®é¡\94</translation>
+      <translation>å\86\85é\83¨ã\81®é\9d¢</translation>
     </message>
   </context>
   <context>
     </message>
     <message>
       <source>GEOM_PIPE_TSHAPE</source>
-      <translation>PipeTShape</translation>
+      <translation>T型パイプ</translation>
     </message>
     <message>
       <source>GEOM_PIPE_TSHAPE_MPIPE</source>
     </message>
     <message>
       <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L1</source>
-      <translation>New L1</translation>
+      <translation>T型パイプの位置 L1</translation>
     </message>
     <message>
       <source>GEOM_PIPE_TSHAPE_POSITION_LBL_L2</source>
-      <translation>New L2</translation>
+      <translation>T型パイプの位置 L2</translation>
     </message>
     <message>
       <source>GEOM_PIPE_TSHAPE_LEFT_TR</source>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_L</source>
-      <translation type="unfinished">メインパイプの半径は、左側薄型化(rL)と等しくすることはできません!</translation>
+      <translation>メインパイプの半径は、左側薄型化(rL)と等しくすることはできません!</translation>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_L</source>
-      <translation type="unfinished">メインパイプの外半径(半径+幅)は、左側薄型化外半径(rL+wL)と等しくすることはできません!</translation>
+      <translation>メインパイプの外半径(半径+幅)は、左側薄型化外半径(rL+wL)と等しくすることはできません!</translation>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_R</source>
-      <translation type="unfinished">メインパイプの半径は、右側薄型化半径(rR)と同じにすることはできません!</translation>
+      <translation>メインパイプの半径は、右側薄型化半径(rR)と同じにすることはできません!</translation>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_R</source>
-      <translation type="unfinished">メインパイプの外半径(半径+幅)は、右側薄型化外半径(rR+wR)と等しくすることはできません!</translation>
+      <translation>メインパイプの外半径(半径+幅)は、右側薄型化外半径(rR+wR)と等しくすることはできません!</translation>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_RADII_I</source>
-      <translation type="unfinished">インシデントパイプの半径は、インシデントパイプ薄肉化半径(rl)と等しくすることはできません!</translation>
+      <translation>インシデントパイプの半径は、インシデントパイプ薄肉化半径(rl)と等しくすることはできません!</translation>
     </message>
     <message>
       <source>GEOM_PIPETSHAPE_ERR_EQUAL_EXT_RADII_I</source>
-      <translation type="unfinished">インシデントパイプの外半径(半径+厚さ)は、インシデントパイプの薄肉化外半径(rI+wI)と等しくすることはできません!</translation>
+      <translation>インシデントパイプの外半径(半径+厚さ)は、インシデントパイプの薄肉化外半径(rI+wI)と等しくすることはできません!</translation>
     </message>
   </context>
   <context>
     </message>
     <message>
       <source>GEOM_SMOOTHINGSURFACE_ARG_NB_MAX</source>
-      <translation>ベジェパッチの最大数</translation>
+      <translation>ベジェパッチの最大数&lt;</translation>
     </message>
     <message>
       <source>GEOM_SMOOTHINGSURFACE_ARG_DEG_MAX</source>
index 44030be21e600bbc16caca042306d4976b00552e..ac2676d0065b135ca3c35cd0de7e5b013e641517 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 47d28e5025b4fbd0cc59795d68cc588c1659d1fd..de7675aea907f757423b4e7ea919598f8022fef5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7216672062462d3aa8a3e586cf6a01989f60bfa7..2a5d7182c008e03c1502e1cbc01eb3d466128d0f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index bc1760cae8adebf7c6b76722f34c8119dca69ad1..d0a2a9595b82c59a46e96b67365b79356c6b052a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 2b409e91fbe7ed85c8d7076ae345588e00180f29..39197f059053afe8eb67c9d5f9a59f2c5465ba82 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -335,11 +335,11 @@ void AdvancedGUI_DividedDiskDlg::SetEditCurrentArgument()
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   if (myEditCurrentArgument == GroupPntVecR->LineEdit2) {
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else {
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -458,3 +458,14 @@ bool AdvancedGUI_DividedDiskDlg::execute (ObjectList& objects)
 
   return res;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> AdvancedGUI_DividedDiskDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint << myDir;
+  return res;
+}
index 60ce1fc070b1032dfc4261d8c7aed687901c3ead..3825258919fc8af372a03b4357710d3bcd8591da 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,7 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index ee07a99cdcec2663479f4c2295344e6ac0b7f67c..f00d74043c56c98dd80b92257f54752c76041465 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -642,7 +642,7 @@ void AdvancedGUI_PipeTShapeDlg::SetEditCurrentArgument()
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   //globalSelection(GEOM_POINT);
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 }
@@ -1252,6 +1252,18 @@ void AdvancedGUI_PipeTShapeDlg::processPreview()
     erasePreview(true);
 }
 
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> AdvancedGUI_PipeTShapeDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr1(myPoint1), aGeomObjPtr2(myPoint2), aGeomObjPtr3(myPoint3);
+  res << aGeomObjPtr1 << aGeomObjPtr2 << aGeomObjPtr3;
+  return res;
+}
+
 //=================================================================================
 // function : AdvancedGUI_4Spin
 // purpose  :
index 8936f4c647e20fd202a5f228c3db3d857f3ef43c..0df296194771bccb27e29c3151785aeecd47642a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -79,6 +79,7 @@ protected:
   virtual bool isValid (QString&);
   virtual bool execute (ObjectList&);
   virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+  virtual QList<GEOM::GeomObjPtr> getSourceObjects();
 
 private:
   void Init();
index 89c5f68ce9ccf3934dfdd5524d6d5d493d170f36..412fa23c66f85cdd75b400d5f72cbaf2a56f3cda 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -119,6 +119,8 @@ void AdvancedGUI_SmoothingSurfaceDlg::Init()
 
   showOnlyPreviewControl();
 
+  globalSelection();
+  localSelection( TopAbs_VERTEX );
   //@@ initialize dialog box widgets here @@//
 
   // Signal/slot connections
@@ -160,7 +162,8 @@ bool AdvancedGUI_SmoothingSurfaceDlg::ClickOnApply()
     return false;
 
   initName();
-
+  globalSelection();
+  localSelection( TopAbs_VERTEX );
   return true;
 }
 
@@ -171,6 +174,8 @@ bool AdvancedGUI_SmoothingSurfaceDlg::ClickOnApply()
 void AdvancedGUI_SmoothingSurfaceDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
+  globalSelection();
+  localSelection( TopAbs_VERTEX );
   //displayPreview();
 }
 
@@ -249,6 +254,26 @@ bool AdvancedGUI_SmoothingSurfaceDlg::execute (ObjectList& objects)
   return res;
 }
 
+//=================================================================================
+// function : addSubshapesToStudy
+// purpose  : virtual method to add new SubObjects if local selection
+//=================================================================================
+void AdvancedGUI_SmoothingSurfaceDlg::addSubshapesToStudy()
+{
+  for ( int i = 0; i < myPoints.count(); i++ )
+    GEOMBase::PublishSubObject( myPoints[i].get() );
+}
+
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> AdvancedGUI_SmoothingSurfaceDlg::getSourceObjects()
+{
+  return myPoints;
+}
+
 //=================================================================================
 // function : getNbPoints()
 // purpose  : Returns the number of points in myPoints list.
@@ -337,5 +362,7 @@ void AdvancedGUI_SmoothingSurfaceDlg::SetEditCurrentArgument()
   if ( sender() == GroupPoints->PushButton1 )
     myEditCurrentArgument = GroupPoints->LineEdit1;
   myEditCurrentArgument->setFocus();
+  globalSelection();
+  localSelection( TopAbs_VERTEX );
   SelectionIntoArgument();
 }
index 822d2aa0f8db29d965c866b85953cfa23faf1cac..5dfef3e41e9efce57902b8da1795f9336087e94c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -45,6 +45,8 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
+  virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 1051f2b1998174123d1d01a7182ac48dcd903691..b2df1cc476a946d7a1094a297e7744a5a996354f 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 03f57d63aaed573c2c83c273cfc8399eee23438d..cafcbd487dd3b172a036e3c74b29f5d69a75e585 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3dde5d56b2395d861f2138d27f0dde919eb06448..467c22b28c2e5b834c1152feb25e4f69fab94336 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2af1fbbef551ace3c0c15501b4bdb3b5f0a2c9ee..8d3accda50171043ca11acfe8f1885661ce054f3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 00c6dbdf321813ad99767b585bef5349801de89c..52fb3aafca7b1d3cb9e43510eb8947b6f60899f1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 8ccabe9a8de49905a688b43821caf4c70e38a222..312919727318c0be62709c8c70ec57855d6acd83 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include "GEOM_Operation.h"
 #include "GEOMBase.h"
 #include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(BREPPlugin)
 
+typedef GEOM::GenericObjPtr<GEOM::IBREPOperations> BREPOpPtr;
+
 //=======================================================================
 // function : BREPPlugin_GUI()
 // purpose  : Constructor
@@ -111,8 +114,8 @@ bool BREPPlugin_GUI::importBREP( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "BREPPluginEngine" );
-  GEOM::IBREPOperations_var brepOp = GEOM::IBREPOperations::_narrow( op );
-  if ( CORBA::is_nil( brepOp ) ) return false;
+  BREPOpPtr brepOp = GEOM::IBREPOperations::_narrow( op );
+  if ( brepOp.isNull() ) return false;
   
   QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
                                                 tr( "BREP_FILES" ),
@@ -126,7 +129,7 @@ bool BREPPlugin_GUI::importBREP( SUIT_Desktop* parent )
     foreach( QString fileName, fileNames )
     {
       SUIT_OverrideCursor wc;
-      GEOM_Operation transaction( app, brepOp.in() );
+      GEOM_Operation transaction( app, brepOp.get() );
       
       try
       {
@@ -145,6 +148,7 @@ bool BREPPlugin_GUI::importBREP( SUIT_Desktop* parent )
          entryList.append( so->GetID() );
          transaction.commit();
          GEOM_Displayer( study ).Display( main.in() );
+          main->UnRegister();
        }
        else
        {
@@ -183,8 +187,8 @@ bool BREPPlugin_GUI::exportBREP( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "BREPPluginEngine" );
-  GEOM::IBREPOperations_var brepOp = GEOM::IBREPOperations::_narrow( op );
-  if ( CORBA::is_nil( brepOp ) ) return false;
+  BREPOpPtr brepOp = GEOM::IBREPOperations::_narrow( op );
+  if ( brepOp.isNull() ) return false;
 
   LightApp_SelectionMgr* sm = app->selectionMgr();
   if ( !sm ) return false;
@@ -212,7 +216,7 @@ bool BREPPlugin_GUI::exportBREP( SUIT_Desktop* parent )
     
     SUIT_OverrideCursor wc;
     
-    GEOM_Operation transaction( app, brepOp.in() );
+    GEOM_Operation transaction( app, brepOp.get() );
     
     try
     {
index 89ec7ebc2158eb2cc0cd0304808f19a138901102..fd55e8c639510b331012a78a6854b42b0ed6b85d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 83e1cbbb84b1178f60f4cabf7cb56d34c8a21aad..9534d7f958430705a23b4c6e7c57c5be9c9d415a 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index dfa66b06b6d91c5e77c31268f3a6e3579881c6fc..c8a7b4128f5c49df653c408c9add576d509880d0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 28b00e78092bae394c5fc5b2dd46eb87e7c92961..119e9834a3dd0e393b3c4431079293a371f6aedd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1eac3d403205dcd7fd10e19c6b1f7883afe9b635..1b0eda3f5aa4e696bd2fe23e6719ed1d7bcd95eb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d929407988a9f8a180c845f7c832783f60235356..25578c14424284b0f30bc360a6e9567e5980bdda 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index b5950e7cd2d2009239544298921cbd31b71ae603..6dc93095ab967407b324bdfb8ce44a11401b72ad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index aee5e9eb0b12d089b61db8adf76ccf71c5f990f0..7925d531a2dd8e4b01e145156aaf9380ad3db624 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 02f9d813858816ff89debf370f7bc13fdac3cf72..71a4bdfd501cba9cece58ac4e998e4c88b1e21cc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3f24fea44c880c552f5520b7009932a8738e8ffc..2201bdd045dd4a617771c6aa5cbac1a5c9d9ce35 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e6a2940d01f90201cb7d94467c7a7cbc8219196f..70695677530d9971ea486fffecf0dae493f41c94 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 27808c748fd0e08e6a125338913aec5cdd0abdbb..2f8939b123ed04cb14689f7154d40d6cf14e1bf4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 6870144363ac7b5d2b4f05d3cbd4efad0629a735..a75490754ae601d11d77023e2c2302a6b20eabe7 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 4a23773a343889e68645b00a2ce627a04356a660..cc1bb291f1733dff07f79de400f235c165e6f60f 100644 (file)
@@ -1,46 +1,46 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
-        <source>MEN_EXPORTBREP</source>
-        <translation type="unfinished">BREP</translation>
+      <source>MEN_EXPORTBREP</source>
+      <translation>BREPエキスポート</translation>
     </message>
     <message>
-        <source>TOP_EXPORTBREP</source>
-        <translation type="unfinished">Export BREP</translation>
+      <source>TOP_EXPORTBREP</source>
+      <translation>BREPエキスポート</translation>
     </message>
     <message>
-        <source>STB_EXPORTBREP</source>
-        <translation type="unfinished">Export BREP</translation>
+      <source>STB_EXPORTBREP</source>
+      <translation>BREPエキスポート</translation>
     </message>
     <message>
-        <source>MEN_IMPORTBREP</source>
-        <translation type="unfinished">BREP</translation>
+      <source>MEN_IMPORTBREP</source>
+      <translation>BREPインポート</translation>
     </message>
     <message>
-        <source>TOP_IMPORTBREP</source>
-        <translation type="unfinished">Import BREP</translation>
+      <source>TOP_IMPORTBREP</source>
+      <translation>BREPインポート</translation>
     </message>
     <message>
-        <source>STB_IMPORTBREP</source>
-        <translation type="unfinished">Import BREP</translation>
+      <source>STB_IMPORTBREP</source>
+      <translation>BREPインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>BREPPlugin_GUI</name>
     <message>
-        <source>BREP_FILES</source>
-        <translation type="unfinished">BREP files( *.brep )</translation>
+      <source>BREP_FILES</source>
+      <translation>BREP ファイル ( *.brep )</translation>
     </message>
     <message>
-        <source>EXPORT_TITLE</source>
-        <translation type="unfinished">Export BREP</translation>
+      <source>EXPORT_TITLE</source>
+      <translation>BREPエキスポート</translation>
     </message>
     <message>
-        <source>IMPORT_TITLE</source>
-        <translation type="unfinished">Import BREP</translation>
+      <source>IMPORT_TITLE</source>
+      <translation>BREPインポート</translation>
     </message>
-</context>
+  </context>
 </TS>
index 34a88046bf688004fc536da99bb5974b8143dc09..0372c1e6402b5a998f5515f5aa5f5c8ea0fcb740 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index d9e9a003dbb8ba8b84b4b41aaf126fe875cae7f9..0c2e3ec5385b847b676d50f1cc4197e004877d6c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index a5a01cc2640d0675db29b635091acccbeff8e9eb..79a7b4e5720d2609f4d798bb6af57a25b0f45426 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index fff94014cf7e256ba83ced29a16787bf5d389aed..43cb1f4936fda5b873310a906730723b5deb62b9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -330,7 +330,7 @@ void BasicGUI_ArcDlg::SelectionIntoArgument()
 void BasicGUI_ArcDlg::SetEditCurrentArgument()
 {
   globalSelection(); // close local selection to clear it
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 
   QPushButton* send = (QPushButton*)sender();
   switch ( getConstructorId() ) {
@@ -580,7 +580,7 @@ void BasicGUI_ArcDlg::ConstructorsClicked( int constructorId )
   }
 
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX ); //Select Vertex on All Shapes
+  localSelection( TopAbs_VERTEX ); //Select Vertex on All Shapes
   
   qApp->processEvents();
   updateGeometry();
@@ -622,3 +622,14 @@ void BasicGUI_ArcDlg::addSubshapesToStudy()
     break;
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BasicGUI_ArcDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint1 << myPoint2 << myPoint3;
+  return res;
+}
index d3849700c581dd64ae63ab0a097f8b36d1d238ae..d2c63c19feba9d42d4e1131fa5ad83c72eddcae2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
   
 private:
   void                               Init();
index 54cbb52befa64d148272a3aa1b549956dd59d07e..55dabb28522e1c842e35f6e89868d6ba21a5a305 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -35,6 +35,7 @@
 #include <SUIT_Session.h>
 #include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
+#include "utilities.h"
 
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopoDS_Shape.hxx>
@@ -282,7 +283,7 @@ void BasicGUI_CircleDlg::ConstructorsClicked( int constructorId )
 
   myEditCurrentArgument->setFocus();
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 
   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged() ),
            this, SLOT( SelectionIntoArgument() ) );
@@ -470,7 +471,7 @@ void BasicGUI_CircleDlg::SetEditCurrentArgument()
   TopAbs_ShapeEnum aNeedType = ( myEditCurrentArgument == GroupPntVecR->LineEdit2 ) ?
     TopAbs_EDGE : TopAbs_VERTEX;
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+  localSelection( aNeedType );
 
   myEditCurrentArgument->setFocus();
   //  SelectionIntoArgument();
@@ -639,3 +640,15 @@ void BasicGUI_CircleDlg::addSubshapesToStudy()
    break;
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BasicGUI_CircleDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint << myDir << myPoint1 << myPoint2 << myPoint3
+      << myPoint4 << myPoint5 << myPoint6;
+  return res;
+}
index 5fc81bbabc377460018d103efe71dc3fbc8964d7..94e69cb90fdd95efca7c7d28810ef263fd286dc8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -50,8 +50,8 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
-  
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
   
 private:
   void                               Init();
index 500f204d4925d2d6862924ca42899f0134426091..0b4d9030eb250d46327761b5f1908dd919457716 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -280,15 +280,15 @@ void BasicGUI_CurveDlg::SetEditCurrentArgument()
 
   if (sender() == myGroupPoints->PushButton1) {
     myEditCurrentArgument = myGroupPoints->LineEdit1;
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (sender() == myPushBtnV1) {
     myEditCurrentArgument = myLineEditV1;
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else if (sender() == myPushBtnV2) {
     myEditCurrentArgument = myLineEditV2;
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
 
   myEditCurrentArgument->setFocus();
@@ -541,6 +541,14 @@ void BasicGUI_CurveDlg::addSubshapesToStudy()
     GEOMBase::PublishSubObject( myPoints[i].get() );
 }
 
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BasicGUI_CurveDlg::getSourceObjects()
+{
+  return myPoints;
+}
 //=================================================================================
 // function : CreationModeChanged
 // purpose  :
index f88a39261a005f0b98cfb71b1cc538336d1fa690..c30f2f1b879ab785c3a5ca6730257e83bb2dd318 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -57,6 +57,7 @@ protected:
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 4b471bec00875306d520b501cc7e4ff3fd7b0aa6..53ac9b4910cb6216e341ebff203dd3b1e39f37bc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -155,7 +155,7 @@ void BasicGUI_EllipseDlg::Init()
   initName( tr( "GEOM_ELLIPSE" ) );
 
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 
   resize( minimumSizeHint() );
   SelectionIntoArgument();
@@ -212,7 +212,7 @@ bool BasicGUI_EllipseDlg::ClickOnApply()
   myEditCurrentArgument = GroupPoints->LineEdit1;
 
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
   displayPreview(true);
   
   return true;
@@ -303,7 +303,7 @@ void BasicGUI_EllipseDlg::SetEditCurrentArgument()
                                  myEditCurrentArgument == GroupPoints->LineEdit3 ) ? 
     TopAbs_EDGE : TopAbs_VERTEX;
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+  localSelection( aNeedType );
   
   myEditCurrentArgument->setFocus();
   //SelectionIntoArgument();
@@ -333,7 +333,7 @@ void BasicGUI_EllipseDlg::ActivateThisDialog()
   myDir.nullify();
   //globalSelection( GEOM_POINT );
   globalSelection(); // close local contexts, if any
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 }
 
 //=================================================================================
@@ -430,3 +430,14 @@ void BasicGUI_EllipseDlg::addSubshapesToStudy()
   GEOMBase::PublishSubObject( myDir.get() );
   GEOMBase::PublishSubObject( myMajor.get() );
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BasicGUI_EllipseDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint << myDir << myMajor;
+  return res;
+}
index 88e665d26ff85a0a8a8c0d0631102f7852e0f0e4..84b790e1372f441e2a8d37661bbe1b0d539dfb28 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -50,6 +50,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
   
 private:
   void                               Init();
index 9b2dc3dac9c4434e5403f6a52bc2503b9cf9e1e1..6ac2df336d845287dfe36b54aa9c3eb266cd4273 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -220,7 +220,7 @@ void BasicGUI_LineDlg::ConstructorsClicked( int constructorId )
                                  myEditCurrentArgument == GroupFaces->LineEdit2 ) ?
     TopAbs_FACE : TopAbs_VERTEX;
   globalSelection(); // close local selection to clear it
-  localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+  localSelection( aNeedType );
 
   qApp->processEvents();
   updateGeometry();
@@ -318,7 +318,7 @@ void BasicGUI_LineDlg::SetEditCurrentArgument()
                                  myEditCurrentArgument == GroupFaces->LineEdit2 ) ?
     TopAbs_FACE : TopAbs_VERTEX;
   globalSelection(); // close local selection to clear it
-  localSelection( GEOM::GEOM_Object::_nil(), aNeedType );
+  localSelection( aNeedType );
 
   myEditCurrentArgument->setFocus();
   //  SelectionIntoArgument();
@@ -432,3 +432,14 @@ void BasicGUI_LineDlg::addSubshapesToStudy()
     break;
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BasicGUI_LineDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint1 << myPoint2 << myFace1 << myFace2;
+  return res;
+}
index 61d59b814ef248b1198d909fcc0684523b945464..4469845c9739aa695a7b9861e65aa7eddf9fbdaa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -50,7 +50,8 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
-    
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
+
 private:
   void                               Init();
   void                               enterEvent( QEvent* );
index 5384c395fdc319c8768400dd1584db8106fe3d3e..7b2a7106cbaccf5e2669f8d71fbbfb73316046dd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -228,7 +228,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
 {
   if ( myConstructorId == constructorId && myConstructorId == 0 ) {
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+    localSelection( TopAbs_VERTEX );
     activate( GEOM_MARKER );
     return;
   }
@@ -244,7 +244,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
       Group2->hide();
       aMainGrp->show();
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
       activate( GEOM_MARKER );
       break;
     }
@@ -269,7 +269,7 @@ void BasicGUI_MarkerDlg::ConstructorsClicked( int constructorId )
       Group2->PushButton2->setDown( false );
       Group2->PushButton3->setDown( false );
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
       myEditCurrentArgument = Group2->LineEdit1;
       Group2->LineEdit1->setText( "" );
       Group2->LineEdit2->setText( "" );
@@ -442,7 +442,7 @@ void BasicGUI_MarkerDlg::SetEditCurrentArgument()
   }
   else if ( send == Group2->PushButton1 ) {
     myEditCurrentArgument = Group2->LineEdit1;
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+    localSelection( TopAbs_VERTEX );
     Group2->PushButton2->setDown( false );
     Group2->PushButton3->setDown( false );
     Group2->LineEdit1->setEnabled( true );
@@ -451,7 +451,7 @@ void BasicGUI_MarkerDlg::SetEditCurrentArgument()
   }
   else if ( send == Group2->PushButton2 ) {
     myEditCurrentArgument = Group2->LineEdit2;
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
     Group2->PushButton1->setDown( false );
     Group2->PushButton3->setDown( false );
     Group2->LineEdit1->setEnabled( false );
@@ -460,7 +460,7 @@ void BasicGUI_MarkerDlg::SetEditCurrentArgument()
   }
   else if ( send == Group2->PushButton3 ) {
     myEditCurrentArgument = Group2->LineEdit3;
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
     Group2->PushButton1->setDown( false );
     Group2->PushButton2->setDown( false );
     Group2->LineEdit1->setEnabled( false );
@@ -609,7 +609,17 @@ void BasicGUI_MarkerDlg::addSubshapesToStudy()
   default:
     break;
   }
+}
 
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BasicGUI_MarkerDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myShape << myPoint << myVectorX << myVectorY;
+  return res;
 }
 
 //=================================================================================
index fad0ff0ad60d2e6cd2d1cdf32fb9d0a23c7dea38..ff28da6cf30a15386dbffe9cffa163d391f7e8d7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -46,47 +46,48 @@ private:
   typedef QMap< int, SalomeApp_DoubleSpinBox* > DataMap;
 
 public:
-                                BasicGUI_MarkerDlg( GeometryGUI*, QWidget* );
-  virtual                       ~BasicGUI_MarkerDlg();
-  void                          Init();
+                                  BasicGUI_MarkerDlg( GeometryGUI*, QWidget* );
+  virtual                         ~BasicGUI_MarkerDlg();
+  void                            Init();
 
 protected:
-  virtual                       GEOM::GEOM_IOperations_ptr createOperation();
-  virtual bool                  isValid( QString& );
-  virtual bool                  execute( ObjectList& );
-  virtual void                  displayPreview ( const bool   = false,
-                                                 const bool   = true,
-                                                 const bool   = true,
-                                                 const double = -1 );
-  virtual void                  addSubshapesToStudy();
+  virtual                         GEOM::GEOM_IOperations_ptr createOperation();
+  virtual bool                    isValid( QString& );
+  virtual bool                    execute( ObjectList& );
+  virtual void                    displayPreview ( const bool   = false,
+                                                   const bool   = true,
+                                                   const bool   = true,
+                                                   const double = -1 );
+  virtual void                    addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr> getSourceObjects();
 
 private:
-  void                          enterEvent( QEvent* );
-  void                          onSelectionDone0();
+  void                            enterEvent( QEvent* );
+  void                            onSelectionDone0();
 
-  GEOM::GeomObjPtr              myShape;
-  GEOM::GeomObjPtr              myPoint;
-  GEOM::GeomObjPtr              myVectorX;
-  GEOM::GeomObjPtr              myVectorY;
+  GEOM::GeomObjPtr                myShape;
+  GEOM::GeomObjPtr                myPoint;
+  GEOM::GeomObjPtr                myVectorX;
+  GEOM::GeomObjPtr                myVectorY;
 
 private slots:
-  void                          onOk();
-  bool                          onApply();
-  void                          onActivate();
-  void                          onDeactivate();
-  void                          onSelectionDone();
-  void                          onValueChanged( double );
-  void                          ConstructorsClicked( int );
-  void                          SetEditCurrentArgument();
+  void                            onOk();
+  bool                            onApply();
+  void                            onActivate();
+  void                            onDeactivate();
+  void                            onSelectionDone();
+  void                            onValueChanged( double );
+  void                            ConstructorsClicked( int );
+  void                            SetEditCurrentArgument();
 
 private:
-  DataMap                       myData;
-  int                           myConstructorId;
-  int                           myBlockPreview;
+  DataMap                         myData;
+  int                             myConstructorId;
+  int                             myBlockPreview;
 
-  QFrame*                       aMainGrp;
-  DlgRef_1Sel*                  Group1;
-  DlgRef_3Sel*                  Group2;
+  QFrame*                         aMainGrp;
+  DlgRef_1Sel*                    Group1;
+  DlgRef_3Sel*                    Group2;
 };
 
 #endif // BASICGUI_MARKERDLG_H
index faac5ac76731a02ba2fa4f5041f756893d755aaa..3160978ebad6a7f5a92fe5768b98687a9ba3d98b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index bca046b40dbb729039fa727451a18f262b5dab6f..a9889ddba7fba9d53688b6a1f4874930fccccdc1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 679be9cf283cac7e5b7846f95b0cbb01b1d0094a..053fa5089942ded2e6cd9d1ccd623c5284367987 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -291,7 +291,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId )
       
       /* for the first argument */
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
       break;
     }
   case 1: /* plane from 3 points */
@@ -315,7 +315,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId )
       
       /* for the first argument */
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
       break;
     }
   case 2: /* plane from a planar face */
@@ -331,7 +331,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId )
       GroupFace->PushButton1->setDown( true );
       
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+      localSelection( TopAbs_FACE );
       break;
     }
   case 3: /* plane from a 2 Vectors */
@@ -347,7 +347,7 @@ void BasicGUI_PlaneDlg::ConstructorsClicked( int constructorId )
       Group2Vec->PushButton1->setDown( true );
       
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+      localSelection( TopAbs_EDGE );
       break;
     }
   case 4: /* plane from a LCS */
@@ -575,7 +575,7 @@ void BasicGUI_PlaneDlg::SetEditCurrentArgument()
   if ( myEditCurrentArgument == GroupPntDir->LineEdit2 || 
        myEditCurrentArgument == Group2Vec->LineEdit1   ||
        myEditCurrentArgument == Group2Vec->LineEdit2 ) {
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
   } else if ( myEditCurrentArgument == GroupFace->LineEdit1 ) {
     TColStd_MapOfInteger aMap;
     aMap.Add( GEOM_PLANE );
@@ -585,7 +585,7 @@ void BasicGUI_PlaneDlg::SetEditCurrentArgument()
     globalSelection( GEOM_MARKER );
   }
   else { // 3 Pnts
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+    localSelection( TopAbs_VERTEX );
   }
 
   //  SelectionIntoArgument();
@@ -787,3 +787,15 @@ void BasicGUI_PlaneDlg::addSubshapesToStudy()
    break;
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BasicGUI_PlaneDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint << myDir << myPoint1 << myPoint2 << myPoint3
+      << myFace << myVec1 << myVec2 << myLCS;
+  return res;
+}
index 1a46fd0f4c7f6a27a02383031e05edb3146f251e..3e9ddbd05dbb6228c3bd73f544e9caa7fa5361b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -53,6 +53,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 868c607bbca6af9a08a1f45efc0716ff390cb792..96a989a88d832be38154cfe41fa39e5ae8642db8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -45,6 +45,7 @@
 #include <QRadioButton>
 #include <QMenu>
 #include <QTimer>
+#include <QList>
 
 #include <gp_Pnt.hxx>
 #include <TopoDS_Shape.hxx>
@@ -68,8 +69,6 @@
 #define SPACING 6
 #define MARGIN  9
 
-enum { SelectEdge, SelectWire };
-
 //=================================================================================
 // class    : BasicGUI_PointDlg()
 // purpose  : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the
@@ -126,13 +125,17 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren
   GroupXYZ->TextLabel2->setText(tr("GEOM_Y"));
   GroupXYZ->TextLabel3->setText(tr("GEOM_Z"));
 
-  GroupOnCurve = new DlgRef_2Sel1Spin(centralWidget());
+  GroupOnCurve = new DlgRef_2Sel1Spin2Check(centralWidget());
   GroupOnCurve->GroupBox1->setTitle(tr("GEOM_POINT_ON_EDGE"));
   GroupOnCurve->TextLabel1->setText(tr("GEOM_EDGE"));
   GroupOnCurve->TextLabel2->setText(tr("GEOM_START_POINT"));
   GroupOnCurve->TextLabel3->setText(tr("GEOM_PARAMETER"));
   GroupOnCurve->PushButton1->setIcon(image2);
   GroupOnCurve->PushButton2->setIcon(image2);
+  GroupOnCurve->TextLabel3->setText(tr("GEOM_PARAMETER"));
+  GroupOnCurve->CheckButton1->setText(tr("GEOM_TAKE_ORIENTATION_INTO_ACCOUNT"));
+  GroupOnCurve->CheckButton2->setAttribute( Qt::WA_DeleteOnClose );
+  GroupOnCurve->CheckButton2->close();
 
   GroupOnSurface = new DlgRef_1Sel2Spin(centralWidget());
   GroupOnSurface->GroupBox1->setTitle(tr("GEOM_POINT_ON_FACE"));
@@ -150,20 +153,15 @@ BasicGUI_PointDlg::BasicGUI_PointDlg(GeometryGUI* theGeometryGUI, QWidget* paren
   GroupRefPoint->TextLabel4->setText(tr("GEOM_DZ"));
 
   /* popup menu for line intersect buttons */
-  myBtnPopup = new QMenu(this);
   QIcon ico_line = QIcon(image6);
   QIcon ico_wire = QIcon(image7);
-  myActions[myBtnPopup->addAction(ico_line, tr("GEOM_EDGE"))] = SelectEdge;
-  myActions[myBtnPopup->addAction(ico_wire, tr("GEOM_WIRE"))] = SelectWire;
 
   GroupLineIntersection = new DlgRef_2Sel(centralWidget());
   GroupLineIntersection->GroupBox1->setTitle(tr("GEOM_LINE_INTERSECTION"));
   GroupLineIntersection->TextLabel1->setText(tr("GEOM_LINE1"));
   GroupLineIntersection->TextLabel2->setText(tr("GEOM_LINE2"));
   GroupLineIntersection->PushButton1->setIcon(image2);
-  GroupLineIntersection->PushButton1->setMenu(myBtnPopup);
   GroupLineIntersection->PushButton2->setIcon(image2);
-  GroupLineIntersection->PushButton2->setMenu(myBtnPopup);
   GroupLineIntersection->LineEdit2->setEnabled(false);
 
   myCoordGrp = new QGroupBox(tr("GEOM_COORDINATES_RES"), centralWidget());
@@ -264,6 +262,7 @@ void BasicGUI_PointDlg::Init()
 
   initSpinBox(GroupOnCurve->SpinBox_DX, 0., 1., step, "parametric_precision");
   GroupOnCurve->SpinBox_DX->setValue(0.5);
+  GroupOnCurve->CheckButton1->setChecked(true);
 
   initSpinBox(GroupOnSurface->SpinBox_DX, 0., 1., step, "parametric_precision");
   GroupOnSurface->SpinBox_DX->setValue(0.5);
@@ -281,14 +280,14 @@ void BasicGUI_PointDlg::Init()
 
   connect(myParamCoord,   SIGNAL(buttonClicked(int)), this, SLOT(ClickParamCoord(int)));
 
+  connect(GroupOnCurve->CheckButton1,         SIGNAL(toggled(bool)), this, SLOT(CheckBoxClicked()));
+
   connect(GroupOnCurve->PushButton1,          SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupOnCurve->PushButton2,          SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupOnSurface->PushButton1,        SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupLineIntersection->PushButton1, SIGNAL(pressed()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupLineIntersection->PushButton2, SIGNAL(pressed()), this, SLOT(SetEditCurrentArgument()));
-
-  connect(myBtnPopup, SIGNAL(triggered(QAction*)), this, SLOT(onBtnPopup(QAction*)));
-
+  
   connect(GroupOnCurve->SpinBox_DX,   SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
   connect(GroupOnSurface->SpinBox_DX, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
   connect(GroupOnSurface->SpinBox_DY, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
@@ -336,7 +335,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
     {
       globalSelection(); // close local contexts, if any
       myNeedType = TopAbs_VERTEX;
-      localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+      localSelection(myNeedType);
 
       GroupRefPoint->hide();
       GroupOnCurve->hide();
@@ -351,7 +350,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
     {
       globalSelection(); // close local contexts, if any
       myNeedType = TopAbs_VERTEX;
-      localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+      localSelection(myNeedType);
 
       myEditCurrentArgument = GroupRefPoint->LineEdit1;
       myEditCurrentArgument->setText("");
@@ -370,7 +369,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
     {
       globalSelection(); // close local contexts, if any
       myNeedType = TopAbs_EDGE;
-      localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+      localSelection(myNeedType);
 
       myEditCurrentArgument = GroupOnCurve->LineEdit1;
       myEditCurrentArgument->setText("");
@@ -391,8 +390,9 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
   case GEOM_POINT_INTINT:
     {
       globalSelection(); // close local contexts, if any
-      myNeedType = TopAbs_EDGE;
-      localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+      std::list<int> needTypes;
+      needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE );
+      localSelection(needTypes );
 
       myEditCurrentArgument = GroupLineIntersection->LineEdit1;
       GroupLineIntersection->LineEdit1->setText("");
@@ -416,7 +416,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
     {
       globalSelection(); // close local contexts, if any
       myNeedType = TopAbs_FACE;
-      localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+      localSelection(myNeedType);
 
       myEditCurrentArgument = GroupOnSurface->LineEdit1;
       myEditCurrentArgument->setText("");
@@ -500,7 +500,14 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
       myLine2.nullify();
   }
 
-  GEOM::GeomObjPtr aSelectedObject = getSelected(myNeedType);
+  GEOM::GeomObjPtr aSelectedObject;
+  if (id == GEOM_POINT_INTINT) {
+    QList<TopAbs_ShapeEnum> needTypes;
+    needTypes << TopAbs_EDGE, needTypes << TopAbs_WIRE;
+    aSelectedObject= getSelected(needTypes);
+  }
+  else 
+    aSelectedObject= getSelected(myNeedType);
   TopoDS_Shape aShape;
   if (aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) && !aShape.IsNull()) {
     QString aName = GEOMBase::GetName(aSelectedObject.get());
@@ -535,19 +542,13 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
       if (myEditCurrentArgument == GroupLineIntersection->LineEdit1) {
         myLine1 = aSelectedObject;
         if (myLine1 && !myLine2) {
-          GroupLineIntersection->PushButton2->setMenu(0);
           GroupLineIntersection->PushButton2->click();
-          GroupLineIntersection->PushButton2->setDown(true);
-          GroupLineIntersection->PushButton2->setMenu(myBtnPopup);
         }
       }
       else if (myEditCurrentArgument == GroupLineIntersection->LineEdit2) {
         myLine2 = aSelectedObject;
         if (myLine2 && !myLine1) {
-          GroupLineIntersection->PushButton1->setMenu(0);
           GroupLineIntersection->PushButton1->click();
-          GroupLineIntersection->PushButton1->setDown(true);
-          GroupLineIntersection->PushButton1->setMenu(myBtnPopup);
         }
       }
     }
@@ -574,14 +575,14 @@ void BasicGUI_PointDlg::SetEditCurrentArgument()
     GroupRefPoint->LineEdit1->setFocus();
     myEditCurrentArgument = GroupRefPoint->LineEdit1;
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupOnCurve->PushButton1) {
     GroupOnCurve->LineEdit1->setFocus();
     myEditCurrentArgument = GroupOnCurve->LineEdit1;
     globalSelection(); // close local contexts, if any
     myNeedType = TopAbs_EDGE;
-    localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+    localSelection(myNeedType);
     GroupOnCurve->PushButton2->setDown(false);
     GroupOnCurve->LineEdit1->setEnabled(true);
     GroupOnCurve->LineEdit2->setEnabled(false);
@@ -591,7 +592,7 @@ void BasicGUI_PointDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupOnCurve->LineEdit2;
     globalSelection(); // close local contexts, if any
     myNeedType = TopAbs_VERTEX;
-    localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+    localSelection(myNeedType);
     GroupOnCurve->PushButton1->setDown(false);
     GroupOnCurve->LineEdit2->setEnabled(true);
     GroupOnCurve->LineEdit1->setEnabled(false);
@@ -601,7 +602,7 @@ void BasicGUI_PointDlg::SetEditCurrentArgument()
     GroupOnSurface->LineEdit1->setFocus();
     myEditCurrentArgument = GroupOnSurface->LineEdit1;
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE);
+    localSelection(TopAbs_FACE);
   }
   else if (send == GroupLineIntersection->PushButton1) {
     GroupLineIntersection->LineEdit1->setFocus();
@@ -619,9 +620,9 @@ void BasicGUI_PointDlg::SetEditCurrentArgument()
   }
   send->setDown(true);
 
-  if ((send == GroupLineIntersection->PushButton1 ||
-         send == GroupLineIntersection->PushButton2) && !myBusy)
-    SelectionIntoArgument();
+  //  if ((send == GroupLineIntersection->PushButton1 ||
+  //         send == GroupLineIntersection->PushButton2) && !myBusy)
+  //    SelectionIntoArgument();
 }
 
 
@@ -675,7 +676,7 @@ void BasicGUI_PointDlg::ValueChangedInSpinBox(double newValue)
 // function : CheckBoxClicked()
 // purpose  : Check Boxes Management
 //=================================================================================
-void BasicGUI_PointDlg::CheckBoxClicked(int  State)
+void BasicGUI_PointDlg::CheckBoxClicked()
 {
   displayPreview(true);
 }
@@ -827,7 +828,9 @@ bool BasicGUI_PointDlg::execute(ObjectList& objects)
   case GEOM_POINT_EDGE :
     {
       if (myParamCoord->checkedId() == PARAM_VALUE) {
-        anObj = anOper->MakePointOnCurve(myEdge.get(), getParameter());
+        bool isUseOrientation = GroupOnCurve->CheckButton1->isChecked();
+
+        anObj = anOper->MakePointOnCurve(myEdge.get(), getParameter(), isUseOrientation);
         aParameters<<GroupOnCurve->SpinBox_DX->text();
       }
       else if (myParamCoord->checkedId() == LENGTH_VALUE) {
@@ -939,6 +942,17 @@ void BasicGUI_PointDlg::addSubshapesToStudy()
   }
 }
 
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BasicGUI_PointDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myRefPoint << myEdge << myLine1 << myLine2 << myFace;
+  return res;
+}
+
 //=================================================================================
 // function : ClickParamCoord()
 // purpose  :
@@ -968,6 +982,7 @@ void BasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
     GroupOnCurve->LineEdit2->setVisible(isLength);
     GroupOnCurve->TextLabel3->setVisible(isParam || isLength);
     GroupOnCurve->SpinBox_DX->setVisible(isParam || isLength);
+    GroupOnCurve->CheckButton1->setVisible(isParam);
     if (isParam){
       initSpinBox(GroupOnCurve->SpinBox_DX, 0., 1., 0.1, "parametric_precision");
       GroupOnCurve->SpinBox_DX->setValue(0.5);
@@ -992,17 +1007,6 @@ void BasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
     QTimer::singleShot(50, this, SLOT(updateSize()));
 }
 
-//=================================================================================
-// function : onBtnPopup()
-// purpose  :
-//=================================================================================
-void BasicGUI_PointDlg::onBtnPopup(QAction* a)
-{
-  globalSelection(); // close local contexts, if any
-  myNeedType = myActions[a] == SelectEdge ? TopAbs_EDGE : TopAbs_WIRE;
-  localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
-}
-
 //=================================================================================
 // function : updateSize
 // purpose  : adjust dialog size to minimum
index ddd413f7b96573070f2161a85d89d8c0c195ec80..ffc01a165876512eca8d7c6dcebae73afd951e84 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -31,7 +31,7 @@
 #include "GEOM_GenericObjPtr.h"
 #include <QMap>
 
-class DlgRef_2Sel1Spin;
+class DlgRef_2Sel1Spin2Check;
 class DlgRef_3Spin;
 class DlgRef_2Sel;
 class DlgRef_1Sel3Spin;
@@ -67,6 +67,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
@@ -87,7 +88,7 @@ private:
 
   DlgRef_3Spin*                      GroupXYZ;
   DlgRef_1Sel3Spin*                  GroupRefPoint;
-  DlgRef_2Sel1Spin*                  GroupOnCurve;
+  DlgRef_2Sel1Spin2Check*            GroupOnCurve;
   DlgRef_2Sel*                       GroupLineIntersection;
   DlgRef_1Sel2Spin*                  GroupOnSurface;
   
@@ -99,7 +100,6 @@ private:
   QGroupBox*                         myParamGroup;
   QButtonGroup*                      myParamCoord;
 
-  QMenu*                             myBtnPopup;
   QMap<QAction*, int>                myActions;
 
   TopAbs_ShapeEnum                   myNeedType;
@@ -115,8 +115,7 @@ private slots:
   void                               ValueChangedInSpinBox( double );
   void                               SetDoubleSpinBoxStep( double );
   void                               ClickParamCoord( int );
-  void                               CheckBoxClicked( int );
-  void                               onBtnPopup( QAction* );
+  void                               CheckBoxClicked();
   void                               updateSize();
 };
 
index 7edde78428af371bef293cc2c05b4164fc409d48..d2648f9cf32d52a73c263cd1f86d118c167ab483 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -204,7 +204,7 @@ void BasicGUI_VectorDlg::ConstructorsClicked( int constructorId )
       GroupPoints->LineEdit2->setEnabled( false );
 
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
       connect( myGeomGUI->getApp()->selectionMgr(),
                SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
       break;
@@ -325,7 +325,7 @@ void BasicGUI_VectorDlg::SetEditCurrentArgument()
   myEditCurrentArgument->setFocus();
   //  SelectionIntoArgument();
   globalSelection(); // close local selection to clear it
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
   send->setDown(true);
   displayPreview(true);
 }
@@ -472,3 +472,14 @@ void BasicGUI_VectorDlg::addSubshapesToStudy()
     GEOMBase::PublishSubObject( myPoint2.get() );
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BasicGUI_VectorDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint1 << myPoint2;
+  return res;
+}
index 7ca69ca8aa979ca483a6cfbd170029f928837e83..7aa5b8cda8a91d84d17b2ec1a99af93e26fb056f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 528d409c8fc27452d033366fa761e7a060f993fd..59e15ead59c017f7ad56bc4e1e0640c2e285511a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c7abd1e1ba44b662db690c8e729a5680bfa3b705..e8805582211e5ce7c6de1fd929bafb42b79c089a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 4bcb7ed166b1dc8731a84c5b8c602664b5865306..3a4821820ca4414fcc4e20b596869f47408c8e90 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index d9775b353c2b0ac71c09e8331727153030160f55..167889e9287b696bee221da483ca12282796a3dc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b1ad92345bc85532b60c1e0fc6d0753f2ddf1862..3339ecfbafee0ddc790b386cf5cde3332d30a167 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 8e9adc599e5462c7fd56989448750e59c067411d..5c42bb07761f2b163b0784844260c965c26731ce 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 078094143747f2becca94988b5020bb0e9f6ae47..dc45167e3ed1d1ddc751b5485516c30072b4b7a0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 32c0714be12bc8ddfe723351794ca404b496ab0a..5c6b398cfed9d027c4b942053c8f4f4415a4c772 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <BRep_Tool.hxx>
 
+#include <Geom_Curve.hxx>
+
+#include <gp_Pnt.hxx>
+#include <gp_Vec.hxx>
+
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Solid.hxx>
 #include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
 
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
@@ -49,6 +56,7 @@
 BlockFix_CheckTool::BlockFix_CheckTool( )
 {
   myHasCheck = Standard_False;
+  myAngTolerance = -1.;
   myPossibleBlocks.Clear();
 }
 
@@ -63,6 +71,17 @@ void BlockFix_CheckTool::SetShape(const TopoDS_Shape& aShape)
   myPossibleBlocks.Clear();
 }
 
+//=======================================================================
+//function : SetAngTolerance
+//purpose  :
+//=======================================================================
+void BlockFix_CheckTool::SetAngTolerance(const Standard_Real theTolerance)
+{
+  myHasCheck     = Standard_False;
+  myAngTolerance = theTolerance;
+  myPossibleBlocks.Clear();
+}
+
 //=======================================================================
 //function : Perform
 //purpose  :
@@ -159,7 +178,6 @@ void BlockFix_CheckTool::Perform()
     if (nbe < 12)
       IsBlock = Standard_False;
     if (nbe > 12) {
-      IsBlock = Standard_False;
       // check edges unification
       // creating map of edge faces
       TopTools_IndexedDataMapOfShapeListOfShape aMapEdgeFaces;
@@ -194,9 +212,19 @@ void BlockFix_CheckTool::Perform()
         Standard_Integer i = 1;
         for (; i <= aMapFacesEdges.Extent(); i++) {
           const TopTools_ListOfShape& ListEdges = aMapFacesEdges.FindFromIndex(i);
-          if (ListEdges.Extent() > 1) break;
+          if (ListEdges.Extent() > 1) {
+            if (myAngTolerance < 0.) {
+              break;
+            }
+
+            // Check if edges have C1 continuity.
+            if (!isC1(ListEdges)) {
+              break;
+            }
+          }
         }
         if (i <= aMapFacesEdges.Extent()) {
+          IsBlock = Standard_False;
           MayBeUE = Standard_True;
           break;
         }
@@ -265,3 +293,84 @@ void BlockFix_CheckTool::DumpCheckResult(Standard_OStream& S) const
     S<<"             number of impossible blocks = "<<nbtmp<<endl;
   }
 }
+
+//=======================================================================
+//function : isC1
+//purpose  :
+//=======================================================================
+Standard_Boolean BlockFix_CheckTool::isC1
+          (const TopTools_ListOfShape &theEdges) const
+{
+  // Fill the map vertex - list of ancestor edges
+  TopTools_IndexedDataMapOfShapeListOfShape aMapVE;
+  TopTools_ListIteratorOfListOfShape        anIter(theEdges);
+  TopTools_MapOfShape                       aMapFence;
+  Standard_Integer                          i;
+  Standard_Integer                          aNbVtx;
+
+  for (; anIter.More(); anIter.Next()) {
+    TopTools_IndexedMapOfShape  aMapVtx;
+    const TopoDS_Shape         &anEdge = anIter.Value();
+
+    if (aMapFence.Add(anEdge)) {
+      TopExp::MapShapes(anEdge, TopAbs_VERTEX, aMapVtx);
+      aNbVtx = aMapVtx.Extent();
+
+      for (i = 1; i <= aNbVtx; ++i) {
+        const TopoDS_Shape &aVtx = aMapVtx.FindKey(i);
+
+        if (!aMapVE.Contains(aVtx)) {
+          aMapVE.Add(aVtx, TopTools_ListOfShape());
+        }
+
+        aMapVE.ChangeFromKey(aVtx).Append(anEdge);
+      }
+    }
+  }
+
+  // Check C1 continuity.
+  Standard_Integer aNbEnds = 0;
+
+  for (i = 1, aNbVtx = aMapVE.Extent(); i <= aNbVtx; ++i) {
+    const TopTools_ListOfShape &anEdges  = aMapVE.FindFromIndex(i);
+    Standard_Integer            aNbEdges = anEdges.Extent();
+
+    if (aNbEdges == 1) {
+      ++aNbEnds;
+    } else if (aNbEdges == 2) {
+      TopoDS_Vertex      aCommonVtx = TopoDS::Vertex(aMapVE.FindKey(i));
+      TopoDS_Edge        anEdge1    = TopoDS::Edge(anEdges.First());
+      TopoDS_Edge        anEdge2    = TopoDS::Edge(anEdges.Last());
+      Standard_Real      aParam1    = BRep_Tool::Parameter(aCommonVtx, anEdge1);
+      Standard_Real      aParam2    = BRep_Tool::Parameter(aCommonVtx, anEdge2);
+      Standard_Real      aPar[2];
+      Handle(Geom_Curve) aCurve1    =
+        BRep_Tool::Curve(anEdge1, aPar[0], aPar[1]);
+      Handle(Geom_Curve) aCurve2    =
+        BRep_Tool::Curve(anEdge2, aPar[0], aPar[1]);
+      gp_Pnt             aPnt;
+      gp_Vec             aVec1;
+      gp_Vec             aVec2;
+
+      aCurve1->D1(aParam1, aPnt, aVec1);
+      aCurve2->D1(aParam2, aPnt, aVec2);
+
+      if (anEdge1.Orientation() != anEdge2.Orientation()) {
+        // Orientations are different. One vector should be reversed.
+        aVec1.Reverse();
+      }
+
+      const Standard_Real anAngle = aVec1.Angle(aVec2);
+
+      if (anAngle > myAngTolerance) {
+        // There is no C1 continuity.
+        break;
+      }
+    } else {
+      // Non-manifold case.
+      break;
+    }
+  }
+
+  return (i > aNbVtx && aNbEnds == 2);
+}
index 83bd5b3c158942595f2a0b051b29506ee126ca1b..b2ffd0f1c0947fb85818eb282eccf3dfe2940f6b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -30,6 +30,7 @@
 #include <Standard_OStream.hxx>
 
 class TopoDS_Shape;
+class TopTools_ListOfShape;
 
 #include <Standard.hxx>
 #include <Standard_Macro.hxx>
@@ -38,14 +39,20 @@ class BlockFix_CheckTool {
 
 public:
   Standard_EXPORT BlockFix_CheckTool();
-  Standard_EXPORT void SetShape(const TopoDS_Shape& aShape) ;
+  Standard_EXPORT void SetShape(const TopoDS_Shape& aShape);
+  Standard_EXPORT void SetAngTolerance(const Standard_Real theTolerance);
   Standard_EXPORT void Perform() ;
   Standard_EXPORT Standard_Integer NbPossibleBlocks() const;
   Standard_EXPORT TopoDS_Shape PossibleBlock(const Standard_Integer num) const;
   Standard_EXPORT void DumpCheckResult(Standard_OStream& S) const;
 
 private:
-  TopoDS_Shape myShape;
+
+  Standard_Boolean isC1(const TopTools_ListOfShape &theEdges) const;
+
+private:
+  TopoDS_Shape     myShape;
+  Standard_Real    myAngTolerance;
   Standard_Boolean myHasCheck;
   Standard_Integer myNbSolids;
   Standard_Integer myNbBlocks;
index d7be344b6a88506fcd78f61658bf7f390705bc9a..64da8a4ec58f50002d3f6b1008010cdc9d8080c9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index a9e40cd554e5387bd47572ad4ef311ab310ac55a..30ebb651d3598b7abdf6c7e26011fefb34fed343 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b3ef081eb7ab885061e1da188ad902ec8ebfbb1b..59dccbfb7728df7b1143464c2fd79a1732a37fc5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 938c3059e85af0e2d22c168d3559b0274c572329..bcdd5eff79292ded68dfcb97c1534df08410c186 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 09c2caf0d398e37180a1237b26299645f02b43a6..4908e5455091f8c815133c7a8999a85ad243d714 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include "utilities.h"
 
+//=======================================================================
+//function : IsToMerge
+//purpose  : This method return Standard_True if two edges have common
+//           vertex. This vertex is returned by output parameter. The
+//           difference with the method TopExp::CommonVertex is only in
+//           the case if there are two common vertices. In this case
+//           this method returns the last vertex of theEdge1, not the first
+//           one that TopExp::CommonVertex does.
+//=======================================================================
+static Standard_Boolean GetCommonVertex(const TopoDS_Edge   &theEdge1,
+                                        const TopoDS_Edge   &theEdge2,
+                                              TopoDS_Vertex &theCommon)
+{
+  Standard_Boolean   isFound = Standard_True;
+  ShapeAnalysis_Edge aSae;
+  TopoDS_Vertex      aVF1 = aSae.FirstVertex(theEdge1);
+  TopoDS_Vertex      aVL1 = aSae.LastVertex(theEdge1);
+  TopoDS_Vertex      aVF2 = aSae.FirstVertex(theEdge2);
+  TopoDS_Vertex      aVL2 = aSae.LastVertex(theEdge2);
+
+  if (aVL1.IsSame(aVF2) || aVL1.IsSame(aVL2)) {
+    theCommon = aVL1;
+  } else if (aVF1.IsSame(aVL2) || aVF1.IsSame(aVF2)) {
+    theCommon = aVF1;
+  } else {
+    theCommon.Nullify();
+    isFound = Standard_False;
+  }
+
+  return isFound;
+}
 
 //=======================================================================
 //function : IsToMerge
 //           be merged. The edges can be merged if:
 //             1. They belong to same faces.
 //             2. They either both seam or both not seam on each face.
-//             3. They are based on coincident lines, or:
-//             4. They are based on coincident circles, or:
-//             5. They are based on either Bezier of BSplines.
+//             3. There are no another edges (e.g. seam) on each common face
+//                that are connected to the common vertex of two edges.
+//             4. They are based on coincident lines, or:
+//             5. They are based on coincident circles, or:
+//             6. They are based on either Bezier of BSplines.
 //=======================================================================
 static Standard_Boolean IsToMerge
     (const TopoDS_Edge                               &theEdge1,
@@ -108,7 +141,6 @@ static Standard_Boolean IsToMerge
   Standard_Boolean aResult  = Standard_False;
   Standard_Boolean isDegen1 = BRep_Tool::Degenerated(theEdge1);
   Standard_Boolean isDegen2 = BRep_Tool::Degenerated(theEdge2);
-  Standard_Boolean isCompareGeom = Standard_False;
 
   if (isDegen1 && isDegen2) {
     // Both of edges are degenerated.
@@ -129,7 +161,7 @@ static Standard_Boolean IsToMerge
 
         isSame = Standard_True;
 
-        for (; anIter1.More(); anIter1.Next()) {
+        for (; anIter1.More() && isSame; anIter1.Next()) {
           TopoDS_Face aFace1 = TopoDS::Face(anIter1.Value());
           TopTools_ListIteratorOfListOfShape  anIter2(aLst2);
 
@@ -141,6 +173,44 @@ static Standard_Boolean IsToMerge
               Standard_Boolean isSeam2 = BRep_Tool::IsClosed(theEdge2, aFace1);
 
               isSame = (isSeam1 && isSeam2) || (isSeam1 == isSeam2);
+
+              if (isSame) {
+                // Check if there are no other edges (e.g. seam) on this face
+                // that are connected to the common vertex.
+                TopoDS_Vertex aVCommon;
+
+                if (GetCommonVertex(theEdge1, theEdge2, aVCommon)) {
+                  TopTools_IndexedDataMapOfShapeListOfShape aMapVE;
+
+                  TopExp::MapShapesAndAncestors
+                    (aFace1, TopAbs_VERTEX, TopAbs_EDGE, aMapVE);
+
+                  if (aMapVE.Contains(aVCommon)) {
+                    TopTools_ListIteratorOfListOfShape 
+                      anItE(aMapVE.FindFromKey(aVCommon));
+
+                    for (; anItE.More(); anItE.Next()) {
+                      const TopoDS_Shape &anEdge = anItE.Value();
+
+                      if (!theEdge1.IsSame(anEdge) &&
+                          !theEdge2.IsSame(anEdge)) {
+                        // There is another edge that shares the common vertex.
+                        // Nothing to merge.
+                        isSame = Standard_False;
+                        break;
+                      }
+                    }
+                  } else {
+                    // Common vertex doesn't belong to the face.
+                    // Nothing to merge. NEVERREACHED.
+                    isSame = Standard_False;
+                  }
+                } else {
+                  // No common vertex. Nothing to merge. NEVERREACHED.
+                  isSame = Standard_False;
+                }
+              }
+
               break;
             }
           }
@@ -289,7 +359,7 @@ static TopoDS_Edge GlueEdgesWithPCurves(const TopTools_SequenceOfShape& aChain,
     
     if (i > 1)
     {
-      TopExp::CommonVertex(PrevEdge, anEdge, CV);
+      GetCommonVertex(PrevEdge, anEdge, CV);
       Standard_Real Tol = BRep_Tool::Tolerance(CV);
       tabtolvertex(i-2) = Tol;
     }
@@ -511,16 +581,24 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
       if (C.IsNull()) {
         // jfa for Mantis issue 0020228
         if (PV1.Distance(PV2) > Precision::Confusion()) continue;
-        // closed chain
-        if (edge1.Orientation() == TopAbs_FORWARD) {
-          C = C1;
-        } else {
-          C = Handle(Geom_Circle)::DownCast(C1->Reversed());
+        // closed chain. Make a closed circular edge starting from V1.
+        gp_Ax1 anAxis = C1->Axis();
+
+        if (edge1.Orientation() == TopAbs_REVERSED) {
+          anAxis.Reverse();
         }
 
+        const gp_Pnt &aP0 = anAxis.Location();
+        gp_Dir        aDX(PV1.XYZ().Subtracted(aP0.XYZ()));
+        gp_Ax2        aNewAxis(aP0, anAxis.Direction(), aDX);
+
+        C = new Geom_Circle(aNewAxis, C1->Radius());
+
         B.MakeEdge (E,C,Precision::Confusion());
         B.Add(E,V1);
         B.Add(E,V2);
+        B.UpdateVertex(V1, 0., E, 0.);
+        B.UpdateVertex(V2, 2.*M_PI, E, 0.);
       }
       else {
         gp_Pnt P0 = C->Location();
index 4bf780e169c95de8d6532ca5ffe5788452215702..3ebd25f08398c0de52a86eefed11ff0e676d4bd7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 86f1065c3dce4a969d8c190ba6045019fb22b941..c1788bbb157405226f08706b4e6188fd4da50760 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -138,8 +138,9 @@ static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges,
 {
   //map of edges
   TopTools_MapOfShape aNewEdges;
+  TopExp_Explorer exp(aShape,TopAbs_EDGE);
   //add edges without seams
-  for(TopExp_Explorer exp(aShape,TopAbs_EDGE); exp.More(); exp.Next()) {
+  for(; exp.More(); exp.Next()) {
     TopoDS_Shape edge = exp.Current();
     if(aNewEdges.Contains(edge))
       aNewEdges.Remove(edge);
@@ -164,9 +165,14 @@ static Standard_Boolean AddOrdinaryEdges(TopTools_SequenceOfShape& edges,
     }
   }
 
-  //add edges to the sequemce
-  for(TopTools_MapIteratorOfMapOfShape anIter(aNewEdges); anIter.More(); anIter.Next())
-    edges.Append(anIter.Key());
+  //add edges to the sequence
+  for(exp.ReInit(); exp.More(); exp.Next()) {
+    const TopoDS_Shape &anEdge = exp.Current();
+
+    if (aNewEdges.Contains(anEdge)) {
+      edges.Append(anEdge);
+    }
+  }
 
   return isDropped;
 }
index 7fbfafcbe369f89f7ab34d704f484047e1f3f4c2..003f22f4071652be35bcaf89f26ef6e6377c814e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 8a1245e36794ea7ddb07ea6b20e220b07ffb85e1..6921e694da0c78f01917aae46f46dacd63b91b77 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 1725f771fcaae1d1dcdaf10517911d1607af8ffa..c03db45c9e985e971301f75fecdbfb9f207272f9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index d2ccd3a12c080e4c4837dc4dafc8b9ad5b9c1a17..b5fed53d5aa83fde3c30261973e2e1e6d2aa9346 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3843239184ee433f8aa0dfd1d030eef48f9da8b2..657d1ac39f7cc2c9ba2f2721bb22ea2b2ebc40e8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -387,7 +387,7 @@ void BlocksGUI_BlockDlg::SetEditCurrentArgument()
   aSender->setDown(true);
 
   globalSelection(); // close local contexts, if any
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE); //Select Faces on All Shapes
+  localSelection(TopAbs_FACE); //Select Faces on All Shapes
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 }
@@ -400,7 +400,7 @@ void BlocksGUI_BlockDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
   globalSelection(); // close local contexts, if any
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE); //Select Faces on All Shapes
+  localSelection(TopAbs_FACE); //Select Faces on All Shapes
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
   displayPreview(true);
@@ -501,3 +501,15 @@ void BlocksGUI_BlockDlg::addSubshapesToStudy()
     break;
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BlocksGUI_BlockDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myFace1 << myFace2 << myFace3
+      << myFace4 << myFace5 << myFace6;
+  return res;
+}
index 70f69b94553bf95229e65ab4ef1908b630f29f97..5560ea9f934d64baf6e8316965c673515daeff27 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 93122335adad4e64e5fbd434babb3836abaed4be..63352c47b11239d6a3916afced4ec8f46ac254e8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -46,7 +46,7 @@
 // purpose  : Constructs a BlocksGUI_ExplodeDlg which is a child of 'parent'.
 //=================================================================================
 BlocksGUI_ExplodeDlg::BlocksGUI_ExplodeDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
-  : GEOMBase_Skeleton( theGeometryGUI, parent )
+  : GEOMBase_Skeleton( theGeometryGUI, parent ), myNbBlocks( 0 )
 {
   QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BLOCK_EXPLODE" ) ) );
   QPixmap imageS( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
@@ -189,7 +189,7 @@ bool BlocksGUI_ExplodeDlg::ClickOnApply()
     }
   }
 
-  if ( !onAccept() )
+  if ( !onAccept( true, true, false ) )
     return false;
 
   activateSelection();
@@ -351,7 +351,7 @@ void BlocksGUI_ExplodeDlg::updateButtonState()
 //=================================================================================
 bool BlocksGUI_ExplodeDlg::isAllSubShapes() const
 {
-  return !myGrp1->CheckBox1->isChecked() || !myGrp1->CheckBox1->isEnabled();
+  return !(myGrp1->CheckBox1->isEnabled() && myGrp1->CheckBox1->isChecked());
 }
 
 //=================================================================================
@@ -513,3 +513,15 @@ QString BlocksGUI_ExplodeDlg::getNewObjectName (int) const
 {
   return QString::null;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BlocksGUI_ExplodeDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObject);
+  res << aGeomObjPtr;
+  return res;
+}
index 6fad07986ad1d55fcdf71d3445bef3fbc8467db4..9296f89e3f67651c404b5c348b37072ffe223860 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual GEOM::GEOM_Object_ptr      getFather( GEOM::GEOM_Object_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
   virtual QString                    getNewObjectName (int CurrObj = -1) const; 
 
index 7d9c9cfc30c336d4a66829810a67394ae89a78e0..f6a95c866034003ceacfff86d3a29199e897329a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -282,3 +282,15 @@ GEOM::GEOM_Object_ptr BlocksGUI_PropagateDlg::getFather( GEOM::GEOM_Object_ptr )
 {
   return myObject;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BlocksGUI_PropagateDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObject);
+  res << aGeomObjPtr;
+  return res;
+}
index 772dfd0ddabd615fd72b4bd533a861758f396568..90fe9fc0d03e99a09b652a20bb5048ffb93e38e5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual GEOM::GEOM_Object_ptr      getFather( GEOM::GEOM_Object_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private slots:
   void                               ClickOnOk();
index 695b74c4e2662455dec0df43973fc0e710b62faa..39c42e5bab8a1867f983fed992b52a4058143806 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -466,11 +466,11 @@ void BlocksGUI_QuadFaceDlg::activateSelection()
       myEditCurrentArgument == mySelName[Vertex3] ||
       myEditCurrentArgument == mySelName[Vertex4])
   {
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX); //Select Vertices on All Shapes
+    localSelection(TopAbs_VERTEX); //Select Vertices on All Shapes
   }
   else
   {
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE); //Select Edges on All Shapes
+    localSelection(TopAbs_EDGE); //Select Edges on All Shapes
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -570,3 +570,14 @@ void BlocksGUI_QuadFaceDlg::addSubshapesToStudy()
     break;
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BlocksGUI_QuadFaceDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myShape1 << myShape2 << myShape3 << myShape4;
+  return res;
+}
index 6da2154c048a810a67829ecf9775ef91dcabc7af..be61b2b7e32d897fc540cc4ff21aa347e3db757f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -58,6 +58,7 @@ protected:
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 52c25e0d9b5e6b0393f10c77105c5881db90263f..985bfc97e63ebf22711f1dbbeb90095385efb9ff 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -219,7 +219,6 @@ bool BlocksGUI_TrsfDlg::ClickOnApply()
 //=================================================================================
 void BlocksGUI_TrsfDlg::SelectionIntoArgument()
 {
-  erasePreview();
   myEditCurrentArgument->setText("");
 
   // Get index of current selection focus
@@ -273,7 +272,6 @@ void BlocksGUI_TrsfDlg::SelectionIntoArgument()
     }
     myEditCurrentArgument->setText(aName);
     myFaces[aCurrFocus] = anIndex;
-    processPreview();
   }
 
   switch (aCurrFocus) {
@@ -316,6 +314,8 @@ void BlocksGUI_TrsfDlg::SelectionIntoArgument()
   default:
     break;
   }
+
+  processPreview();
 }
 
 //=================================================================================
@@ -379,6 +379,8 @@ void BlocksGUI_TrsfDlg::SetEditCurrentArgument()
   aSender->setDown(true);
 
   activateSelection();
+
+  processPreview();
 }
 
 //=================================================================================
@@ -619,3 +621,15 @@ bool BlocksGUI_TrsfDlg::execute (ObjectList& objects)
 
   return res;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BlocksGUI_TrsfDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myShape);
+  res << aGeomObjPtr;
+  return res;
+}
index 41ab8a4ad44de3817afcee543a42b498b722b0c5..9e6ff3c37edc701aeeb21c1b7eac4c120641ab90 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -56,6 +56,7 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index dfd1b3bc8ede2d8267f8e36f3c645e1284ebe5de..ebc68572c05c7eab8ecceba39030c5504c98584b 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 7c2f61ac20e5cafc33810801cb931dfc65fa3411..8166efa8dc0ee5b28091701c05df148137436081 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 34a371df626599b1b6c3ef167a8bd1773de40a49..af4e11e74656c2d80a68fc565d38f826476783de 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index bbf88ebe1687aa0b07f08defdadad638c8e3f350..02ebd41d5c4b0f748dec4a9fe26b3f50fc3a30a9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -187,7 +187,7 @@ void BooleanGUI_Dialog::Init()
   }
 
   connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
-           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()), Qt::UniqueConnection);
 
   initName(mainFrame()->GroupConstructors->title());
 
@@ -198,9 +198,9 @@ void BooleanGUI_Dialog::Init()
   mainFrame()->RadioButton1->setFocus();
 
   globalSelection(GEOM_ALLSHAPES);
-
+  //localSelection(TopAbs_SHAPE); // VSR 24/09/2015: dectivate local selection in BOP (CoTech decision)
+  
   myGroup->PushButton1->click();
-  SelectionIntoArgument();
   resize(100,100);
 }
 
@@ -236,8 +236,7 @@ bool BooleanGUI_Dialog::ClickOnApply()
 //=================================================================================
 void BooleanGUI_Dialog::reset()
 {
-  myObjects = new GEOM::ListOfGO;
-  myObjects->length( 0 );       
+  myObjects.clear();
 }
 
 //=================================================================================
@@ -258,16 +257,16 @@ void BooleanGUI_Dialog::singleSelection()
     disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
     myGeomGUI->getApp()->selectionMgr()->clearSelected();
     connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
-            this, SLOT(SelectionIntoArgument()));
+            this, SLOT(SelectionIntoArgument()), Qt::UniqueConnection);
 
     if (myEditCurrentArgument == myGroup->LineEdit1) {
       myObject1 = aSelectedObject;
-      if (!myGroup->PushButton2->isHidden() && !myObjects->length())
+      if (!myGroup->PushButton2->isHidden() && !myObjects.count())
         myGroup->PushButton2->click();
     }
     else if (myEditCurrentArgument == myGroup->LineEdit2) {
-      myObjects->length(1);
-      myObjects[0] = aSelectedObject.get();
+      myObjects.clear();
+      myObjects << aSelectedObject;
       if (!myObject1)
         myGroup->PushButton1->click();
     }
@@ -287,23 +286,11 @@ void BooleanGUI_Dialog::multipleSelection()
   myEditCurrentArgument->setText( "" );
   reset();
         
-  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
-  SALOME_ListIO aSelList;
-  aSelMgr->selectedObjects(aSelList);
-  myObjects->length(aSelList.Extent());
-
-  int i = 0;
-  for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) {
-    GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value() );
-
-    if ( !CORBA::is_nil( aSelectedObject ) ) {
-      myObjects[i++] = aSelectedObject;
-    }
-  }
+  myObjects = getSelected( TopAbs_SHAPE, -1 );
 
-  myObjects->length( i );
+  int i = myObjects.count();
   if ( i == 1 ) {
-    myEditCurrentArgument->setText( GEOMBase::GetName( myObjects[0] ) );
+    myEditCurrentArgument->setText( GEOMBase::GetName( myObjects.first().get() ) );
   } else if ( i > 0 ) {
     myEditCurrentArgument->setText( QString::number( i ) + "_" + tr( "GEOM_OBJECTS" ) );
   }
@@ -315,6 +302,7 @@ void BooleanGUI_Dialog::multipleSelection()
 //=================================================================================
 void BooleanGUI_Dialog::SelectionIntoArgument()
 {
+  myEditCurrentArgument->setText("");
   if ( myOperation == BooleanGUI::SECTION ||
       (myOperation == BooleanGUI::CUT &&
        myEditCurrentArgument == myGroup->LineEdit1)) {
@@ -349,11 +337,16 @@ void BooleanGUI_Dialog::SetEditCurrentArgument()
     myGroup->LineEdit1->setEnabled(false);
   }
 
+  globalSelection(GEOM_ALLSHAPES);
+  //localSelection(TopAbs_SHAPE); // VSR 24/09/2015: dectivate local selection in BOP (CoTech decision)
+
   // enable line edit
   myEditCurrentArgument->setEnabled(true);
   myEditCurrentArgument->setFocus();
   // after setFocus(), because it will be setDown(false) when loses focus
   send->setDown(true);
+
+  SelectionIntoArgument();
 }
 
 //=================================================================================
@@ -365,7 +358,7 @@ void BooleanGUI_Dialog::ActivateThisDialog()
   GEOMBase_Skeleton::ActivateThisDialog();
 
   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
-           this, SLOT( SelectionIntoArgument() ) );
+           this, SLOT( SelectionIntoArgument() ), Qt::UniqueConnection );
   processPreview();
 }
 
@@ -399,13 +392,13 @@ bool BooleanGUI_Dialog::isValid (QString&)
   switch (myOperation) {
     case BooleanGUI::FUSE:
     case BooleanGUI::COMMON:
-      isOK = myObjects->length() > 1;
+      isOK = myObjects.count() > 1;
     break;
   case BooleanGUI::CUT:
-      isOK = myObject1 && myObjects->length();
+    isOK = myObject1 && myObjects.count();
     break;
   case BooleanGUI::SECTION:
-      isOK = myObject1 && (myObjects->length() == 1);
+    isOK = myObject1 && (myObjects.count() == 1);
     break;
   default:
     break;
@@ -425,25 +418,30 @@ bool BooleanGUI_Dialog::execute (ObjectList& objects)
   GEOM::GEOM_IBooleanOperations_var anOper = GEOM::GEOM_IBooleanOperations::_narrow(getOperation());
   const bool isCheckSelfInte = myGroup->CheckBox1->isChecked();
 
+  GEOM::ListOfGO_var anObjects = new GEOM::ListOfGO();
+  anObjects->length( myObjects.count() );
+  for ( int i = 0; i < myObjects.count(); i++ )
+    anObjects[i] = myObjects[i].copy();
+
   switch (myOperation) {
     case BooleanGUI::FUSE:
       {
         const bool isRmExtraEdges = myGroup->CheckBox2->isChecked();
 
         anObj = anOper->MakeFuseList
-          (myObjects, isCheckSelfInte, isRmExtraEdges);
+          (anObjects, isCheckSelfInte, isRmExtraEdges);
       }
     break;
     case BooleanGUI::COMMON:
-      anObj = anOper->MakeCommonList(myObjects, isCheckSelfInte);
+      anObj = anOper->MakeCommonList(anObjects, isCheckSelfInte);
     break;
   case BooleanGUI::CUT:
       anObj =
-        anOper->MakeCutList(myObject1.get(), myObjects, isCheckSelfInte);
+        anOper->MakeCutList(myObject1.get(), anObjects, isCheckSelfInte);
     break;
   case BooleanGUI::SECTION:
       anObj = anOper->MakeBoolean
-        (myObject1.get(), myObjects[0], myOperation, isCheckSelfInte);
+        (myObject1.get(), anObjects[0], myOperation, isCheckSelfInte);
     break;
   default:
     break;
@@ -470,3 +468,25 @@ void BooleanGUI_Dialog::restoreSubShapes (SALOMEDS::Study_ptr   theStudy,
                                          mainFrame()->CheckBoxAddPrefix->isChecked()); // ? false
   }
 }
+
+//=================================================================================
+// function : addSubshapesToStudy
+// purpose  : virtual method to add new SubObjects if local selection
+//=================================================================================
+void BooleanGUI_Dialog::addSubshapesToStudy()
+{
+  GEOMBase::PublishSubObject( myObject1.get() );
+  for ( int i = 0; i < myObjects.count(); i++ )
+    GEOMBase::PublishSubObject( myObjects[i].get() );
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BooleanGUI_Dialog::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myObjects);
+  res << myObject1;
+  return res;
+}
index 99ead05a6915a5751f31e79cf08a42d4a5446331..00c93069df5d3f42cb6253d9b61a6a2e19d70ab8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,8 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
@@ -63,7 +65,7 @@ private:
   int                                myOperation;
   
   GEOM::GeomObjPtr                   myObject1;
-  GEOM::ListOfGO_var                 myObjects;
+  QList<GEOM::GeomObjPtr>            myObjects;
   
   DlgRef_2Sel2Spin3Check*            myGroup;
 
index fefda9e0c8784d5850160ae513299fec41653fea..e7c9b7850cf6d7744ac87e50485de6871c1662aa 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index c39be072ec7879c0d11f18b2e98ed2556992e12b..4280851328a0c3d060dfad2920032d742ef805c1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3a1684e5852f5147c06665158999e77619bc73ec..3e76b5870f9bc35d83b48b399900a82d51cbfe9d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 153e87f53976c6cdc3d4af1eb2511e9fb35ce190..6b550a63b72a42700a8422f2d30a5da3397fbd90 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -255,3 +255,12 @@ void BuildGUI_CompoundDlg::restoreSubShapes( SALOMEDS::Study_ptr   theStudy,
                                          mainFrame()->CheckBoxAddPrefix->isChecked() );
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BuildGUI_CompoundDlg::getSourceObjects()
+{
+  return myShapes;
+}
index e4614aaf47689c71b98d689c87e4e1f061fcbfae..f7a939df0668a3b11842dc348159e997ffcb35ac 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -50,6 +50,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index e688ade0d27f2b15c8523c834170596046bc00a6..c34e448e5f66b1eedcceba72a6b88fbf106bc9ff 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -145,7 +145,7 @@ void BuildGUI_EdgeDlg::Init()
   myEditCurrentArgument = GroupPoints->LineEdit1;
   GroupPoints->PushButton1->setDown(true);
   globalSelection(); // close local contexts, if any
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+  localSelection(TopAbs_VERTEX);
 
   // signals and slots connections
   connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
@@ -210,7 +210,7 @@ void BuildGUI_EdgeDlg::ConstructorsClicked(int constructorId)
   case 0:
     {
       globalSelection(); // close local contexts, if any
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+      localSelection(TopAbs_VERTEX);
 
       myEditCurrentArgument = GroupPoints->LineEdit1;
       GroupPoints->LineEdit1->setText("");
@@ -229,7 +229,7 @@ void BuildGUI_EdgeDlg::ConstructorsClicked(int constructorId)
   case 1:
     {
       globalSelection(); // close local contexts, if any
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_WIRE);
+      localSelection(TopAbs_WIRE);
 
       myEditCurrentArgument = GroupWire->LineEdit1;
       GroupWire->LineEdit1->setText("");
@@ -244,7 +244,7 @@ void BuildGUI_EdgeDlg::ConstructorsClicked(int constructorId)
   case 2:
     {
       globalSelection(); // close local contexts, if any
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
 
       myEditCurrentArgument = GroupOnCurve->LineEdit1;
       GroupOnCurve->LineEdit1->setText("");
@@ -302,7 +302,7 @@ void BuildGUI_EdgeDlg::SelectionIntoArgument()
     myEditCurrentArgument->setText(aName);
 
     globalSelection();
-    localSelection(GEOM::GEOM_Object::_nil(), aNeedType);
+    localSelection(aNeedType);
 
     if (myEditCurrentArgument == GroupPoints->LineEdit1) {
       myPoint1 = aSelectedObject;
@@ -359,7 +359,7 @@ void BuildGUI_EdgeDlg::SetEditCurrentArgument()
     GroupOnCurve->LineEdit2->setEnabled(false);
 
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else if (send == GroupOnCurve->PushButton2) {
     myEditCurrentArgument = GroupOnCurve->LineEdit2;
@@ -367,7 +367,7 @@ void BuildGUI_EdgeDlg::SetEditCurrentArgument()
     GroupOnCurve->LineEdit1->setEnabled(false);
 
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
 
   // enable line edit
@@ -521,3 +521,14 @@ void BuildGUI_EdgeDlg::addSubshapesToStudy()
     break;
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BuildGUI_EdgeDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint1 << myPoint2 << myWire << myCurve << myStartPoint;
+  return res;
+}
index 3b18ff8a63366a457daa547d3bab57dd235945c2..a2f1ccb50d0059d1186d719b20d6786bbc2e9f5a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -52,6 +52,7 @@ protected:
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);    
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index bdd72265b573ccb3c28a6525efc1bbaafaad3932..d474817f11a5f134135e12703b5d029d6360bbd0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <SUIT_MessageBox.h>
 #include <SUIT_OverrideCursor.h>
 
+#include <QTreeWidget>
+
+//=================================================================================
+// class    : BuildGUI_TreeWidgetItem
+// purpose  : class for constraint(Edge-Face) creation
+//=================================================================================
+class BuildGUI_FaceDlg::TreeWidgetItem : public QTreeWidgetItem
+{
+public:
+  TreeWidgetItem( QTreeWidget*, const GEOM::GeomObjPtr, int = Type );
+  TreeWidgetItem( QTreeWidgetItem*, const GEOM::GeomObjPtr, int = Type );
+  ~TreeWidgetItem();
+  void             setFace( const GEOM::GeomObjPtr );
+  GEOM::GeomObjPtr getFace() const;
+  GEOM::GeomObjPtr getEdge() const;
+private:
+  GEOM::GeomObjPtr myEdge;
+  GEOM::GeomObjPtr myFace;
+};
+
+BuildGUI_FaceDlg::TreeWidgetItem::TreeWidgetItem( QTreeWidget* view, const GEOM::GeomObjPtr edge, int type )
+:QTreeWidgetItem( view, QStringList()<<GEOMBase::GetName( edge.get() ), type ),
+  myEdge( edge ),
+  myFace( 0 )
+{
+}
+
+BuildGUI_FaceDlg::TreeWidgetItem::TreeWidgetItem( QTreeWidgetItem* parent, const GEOM::GeomObjPtr edge, int type )
+:QTreeWidgetItem( parent, QStringList()<<GEOMBase::GetName( edge.get() ), type ),
+  myEdge( edge ),
+  myFace( 0 )
+{
+}
+
+BuildGUI_FaceDlg::TreeWidgetItem::~TreeWidgetItem()
+{
+}
+
+void BuildGUI_FaceDlg::TreeWidgetItem::setFace( const GEOM::GeomObjPtr face )
+{
+  QString aName = GEOMBase::GetName( face.get() );
+  setText( 1, aName );
+  treeWidget()->resizeColumnToContents(1);
+  myFace = face;
+}
+
+GEOM::GeomObjPtr BuildGUI_FaceDlg::TreeWidgetItem::getFace() const
+{
+  return myFace;
+}
+
+GEOM::GeomObjPtr BuildGUI_FaceDlg::TreeWidgetItem::getEdge() const
+{
+  return myEdge;
+}
+
 //=================================================================================
 // class    : BuildGUI_FaceDlg()
 // purpose  : Constructs a BuildGUI_FaceDlg which is a child of 'parent', with the 
 //            TRUE to construct a modal dialog.
 //=================================================================================
 BuildGUI_FaceDlg::BuildGUI_FaceDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
-  : GEOMBase_Skeleton( theGeometryGUI, parent )
+  : GEOMBase_Skeleton( theGeometryGUI, parent ),
+    myGroupWire(0),
+    myGroupSurf(0),
+    myGroupWireConstraints(0)
 {
-  QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BUILD_FACE" ) ) );
-  QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+  QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+  QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BUILD_FACE" ) ) );
+  QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BUILD_FACE_SURFACE" ) ) );
+  QPixmap image3( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BUILD_FACE_CONSTRAINTS" ) ) );
 
   setWindowTitle( tr( "GEOM_FACE_TITLE" ) );
 
   /***************************************************************/
   mainFrame()->GroupConstructors->setTitle( tr( "GEOM_FACE" ) );
-  mainFrame()->RadioButton1->setIcon( image0 );
-  mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
-  mainFrame()->RadioButton2->close();
-  mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
-  mainFrame()->RadioButton3->close();
+  mainFrame()->RadioButton1->setIcon( image1 );
+  mainFrame()->RadioButton2->setIcon( image2 );
+  mainFrame()->RadioButton3->setIcon( image3 );
+
+  // Face creation from wires and/or edges
 
-  GroupWire = new DlgRef_1Sel1Check( centralWidget() );
+  myGroupWire = new DlgRef_1Sel1Check( centralWidget() );
 
-  GroupWire->GroupBox1->setTitle( tr( "GEOM_FACE_FFW" ) );
-  GroupWire->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
-  GroupWire->CheckButton1->setText( tr( "GEOM_FACE_OPT" ) );
-  GroupWire->PushButton1->setIcon( image1 );
+  myGroupWire->GroupBox1->setTitle( tr( "GEOM_FACE_FFW" ) );
+  myGroupWire->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
+  myGroupWire->CheckButton1->setText( tr( "GEOM_FACE_OPT" ) );
+  myGroupWire->PushButton1->setIcon( image0 );
+
+  // Face creation from surface
+
+  myGroupSurf = new DlgRef_2Sel(centralWidget());
+
+  myGroupSurf->GroupBox1->setTitle(tr("GEOM_FACE_FROM_SURFACE" ) );
+  myGroupSurf->TextLabel1->setText(tr("GEOM_FACE"));
+  myGroupSurf->TextLabel2->setText(tr("GEOM_WIRE"));
+  myGroupSurf->PushButton1->setIcon(image0);
+  myGroupSurf->PushButton2->setIcon(image0);
+  
+  // Face creation from wire and constraints
+
+  myGroupWireConstraints = new DlgRef_1SelExt( centralWidget() );
+  myGroupWireConstraints->GroupBox1->setTitle( tr( "GEOM_FACE_FFWC" ) );
+  myGroupWireConstraints->TextLabel1->setText( tr( "GEOM_WIRE" ) );
+  myGroupWireConstraints->PushButton1->setIcon( image0 );
+
+  QLabel* aLabel = new QLabel( tr( "GEOM_CONSTRAINTS" ) );
+  myTreeConstraints = new QTreeWidget( myGroupWireConstraints->Box );
+  myTreeConstraints->setColumnCount(2);
+  QStringList columnNames;
+  columnNames.append( tr( "GEOM_EDGE" ));
+  columnNames.append( tr( "GEOM_FACE_CONSTRAINT" ) );
+  myTreeConstraints->setHeaderLabels( columnNames );
+  myTreeConstraints->header()->setMovable( false );
+  myTreeConstraints->header()->setResizeMode( QHeaderView::ResizeToContents );
+  myTreeConstraints->setMinimumHeight( 140 );
+
+  QHBoxLayout* l = new QHBoxLayout( myGroupWireConstraints->Box );
+  l->setMargin( 0 ); l->setSpacing( 6 );
+  l->addWidget( aLabel);
+  l->addWidget( myTreeConstraints );
 
   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
   layout->setMargin( 0 ); layout->setSpacing( 6 );
-  layout->addWidget( GroupWire );
+  layout->addWidget( myGroupWire );
+  layout->addWidget( myGroupSurf );
+  layout->addWidget( myGroupWireConstraints );
   /***************************************************************/
 
   setHelpFileName("create_face_page.html");
@@ -100,29 +196,187 @@ BuildGUI_FaceDlg::~BuildGUI_FaceDlg()
 void BuildGUI_FaceDlg::Init()
 {
   /* init variables */
-  myEditCurrentArgument = GroupWire->LineEdit1;
-  GroupWire->LineEdit1->setReadOnly( true );
+  myEditCurrentArgument = myGroupWire->LineEdit1;
+  myGroupWire->LineEdit1->setReadOnly( true );
+  myGroupSurf->LineEdit1->setReadOnly( true );
+  myGroupSurf->LineEdit2->setReadOnly( true );
+  myGroupWireConstraints->LineEdit1->setReadOnly( true );
 
-  GroupWire->CheckButton1->setChecked( true );
+  myGroupWire->CheckButton1->setChecked( true );
   myWires.clear();
-
-  TColStd_MapOfInteger aMap;
-  aMap.Add( GEOM_EDGE );
-  aMap.Add( GEOM_WIRE );
-  globalSelection( aMap );
+  myFace.nullify();
+  myWire.nullify();
+  myCurrentItem = 0;
 
   /* signals and slots connections */
+  connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+  connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(ClickOnCancel()));
+
+  connect(this, SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
+
   connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
   connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
-  connect( GroupWire->LineEdit1,   SIGNAL( returnPressed()), this, SLOT( LineEditReturnPressed() ) );
-  connect( GroupWire->PushButton1, SIGNAL( clicked() ),      this, SLOT( SetEditCurrentArgument() ) );
+  connect( myGroupWire->LineEdit1,   SIGNAL( returnPressed()), this, SLOT( LineEditReturnPressed() ) );
+  connect( myGroupWire->PushButton1, SIGNAL( clicked() ),      this, SLOT( SetEditCurrentArgument() ) );
+  connect( myGroupSurf->LineEdit1,   SIGNAL( returnPressed()), this, SLOT( LineEditReturnPressed() ) );
+  connect( myGroupSurf->PushButton1, SIGNAL( clicked() ),      this, SLOT( SetEditCurrentArgument() ) );
+  connect( myGroupSurf->LineEdit2,   SIGNAL( returnPressed()), this, SLOT( LineEditReturnPressed() ) );
+  connect( myGroupSurf->PushButton2, SIGNAL( clicked() ),      this, SLOT( SetEditCurrentArgument() ) );
+  connect( myGroupWireConstraints->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+  connect( myGroupWireConstraints->PushButton1, SIGNAL( clicked() ), this, SLOT( SetEditCurrentArgument() ) );
   connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
 
+  connect( myTreeConstraints, SIGNAL( itemClicked( QTreeWidgetItem*, int) ), this, SLOT( onItemClicked( QTreeWidgetItem*, int ) ) );
+
   initName( tr( "GEOM_FACE" ) );
+
+  ConstructorsClicked(0);
+}
+
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose  : Radio button management
+//=================================================================================
+void BuildGUI_FaceDlg::ConstructorsClicked(int constructorId)
+{
+  switch (constructorId) {
+  case 0:
+    {
+      TColStd_MapOfInteger aMap;
+
+      aMap.Add(GEOM_EDGE);
+      aMap.Add(GEOM_WIRE);
+      aMap.Add(GEOM_FACE);
+      aMap.Add(GEOM_SHELL);
+      aMap.Add(GEOM_SOLID);
+      aMap.Add(GEOM_COMPOUND);
+      globalSelection(aMap);
+
+      myEditCurrentArgument = myGroupWire->LineEdit1;
+      myGroupWire->LineEdit1->setText("");
+      myGroupWire->show();
+      myGroupSurf->hide();
+      myGroupWireConstraints->hide();
+      break;
+    }
+  case 1:
+    {
+      globalSelection(GEOM_FACE); // For the first element.
+      localSelection( TopAbs_FACE );
+
+      myEditCurrentArgument = myGroupSurf->LineEdit1;
+      myGroupSurf->LineEdit1->setText("");
+      myGroupSurf->PushButton1->setDown(true);
+      myGroupSurf->PushButton2->setDown(false);
+      myGroupWire->hide();
+      myGroupSurf->show();
+      myGroupWireConstraints->hide();
+      break;
+    }
+  case 2:
+    {
+      globalSelection();
+      localSelection( TopAbs_WIRE );
+    
+      myTreeConstraints->clear();
+      myCurrentItem = 0;
+      myEditCurrentArgument = myGroupWireConstraints->LineEdit1;
+      myGroupWireConstraints->LineEdit1->setText("");
+      myGroupWireConstraints->LineEdit1->setEnabled(true);
+      myGroupWire->hide();
+      myGroupSurf->hide();
+      myGroupWireConstraints->show();
+      break;
+    }
+  }
+
+  myWires.clear();
+  myFace.nullify();
+  myWire.nullify();
+  qApp->processEvents();
+  updateGeometry();
+  resize(minimumSizeHint());
   SelectionIntoArgument();
 }
 
+//=================================================================================
+// function : updateConstraintsTree
+// purpose  :
+//=================================================================================
+void BuildGUI_FaceDlg::updateConstraintsTree()
+{
+  if ( myEditCurrentArgument != myGroupWireConstraints->LineEdit1 || myWire.isNull() )
+    return;
+
+  myTreeConstraints->clear();
+
+  GEOM::GEOM_IShapesOperations_ptr anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
+  GEOM::ListOfGO_var aList = anOper->ExtractSubShapes( myWire.get(), TopAbs_EDGE, false );
+  if ( !aList->length() )
+    return;
+
+  for ( int i = 0, n = aList->length(); i < n; i++ ) {
+    TreeWidgetItem* item = new TreeWidgetItem( myTreeConstraints,
+                                               GEOM::GeomObjPtr( aList[i] ) );
+  }
+
+  myEditCurrentArgument->setEnabled(false);
+  globalSelection();
+  localSelection( TopAbs_FACE );
+  
+  myTreeConstraints->resizeColumnToContents(0);
+  QTreeWidgetItem* firstItem = myTreeConstraints->topLevelItem(0);
+  firstItem->setSelected( true );
+  onItemClicked( firstItem, 0 );
+}
+
+//=================================================================================
+// function : findEmptyTreeItem()
+// purpose  :
+//=================================================================================
+void BuildGUI_FaceDlg::findEmptyTreeItem()
+{
+  if ( isTreeFull() )
+    return;
+
+  QTreeWidgetItem* nextItem = 0;
+  QTreeWidgetItem* item;
+  for ( item = myTreeConstraints->itemBelow( myCurrentItem );
+        item && !nextItem;
+        item = myTreeConstraints->itemBelow( item ) ) {
+    if ( (dynamic_cast<TreeWidgetItem*>(item))->getFace().isNull() )
+      nextItem = item;
+  }
+  for ( item = myTreeConstraints->topLevelItem(0);
+        item && item != myCurrentItem && !nextItem;
+        item = myTreeConstraints->itemBelow( item ) ) {
+    if ( (dynamic_cast<TreeWidgetItem*>(item))->getFace().isNull() )
+      nextItem = item;
+  }
+
+  if ( nextItem && nextItem != myCurrentItem ) {
+    myCurrentItem->setSelected( false );
+    nextItem->setSelected( true );
+    onItemClicked( nextItem, 0 );
+  }
+}
+
+//=================================================================================
+// function : isTreeFull()
+// purpose  :
+//=================================================================================
+bool BuildGUI_FaceDlg::isTreeFull()
+{
+  bool ok = true;
+  QTreeWidgetItem* item;
+  for ( item = myTreeConstraints->topLevelItem(0);
+        item && ok;
+        item = myTreeConstraints->itemBelow( item ) ) {
+    ok = !(dynamic_cast<TreeWidgetItem*>(item))->getFace().isNull();
+  }
+  return ok;
+}
 
 //=================================================================================
 // function : ClickOnOk()
@@ -146,6 +400,9 @@ bool BuildGUI_FaceDlg::ClickOnApply()
     return false;
 
   initName();
+
+  myEditCurrentArgument->setText("");
+  ConstructorsClicked( getConstructorId() );
   return true;
 }
 
@@ -156,16 +413,78 @@ bool BuildGUI_FaceDlg::ClickOnApply()
 //=================================================================================
 void BuildGUI_FaceDlg::SelectionIntoArgument()
 {
-  myEditCurrentArgument->setText( "" );
-
-  QList<TopAbs_ShapeEnum> types;
-  types << TopAbs_EDGE << TopAbs_WIRE;
-  myWires = getSelected( types, -1 );
+  erasePreview();
+  if ( myEditCurrentArgument == myGroupWire->LineEdit1 ) {
+    myEditCurrentArgument->setText( "" );
+
+    QList<TopAbs_ShapeEnum> types;
+    types << TopAbs_EDGE  << TopAbs_WIRE  << TopAbs_FACE
+          << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPOUND;
+    myWires = getSelected( types, -1 );
+
+    if ( !myWires.isEmpty() ) {
+      QString aName = myWires.count() > 1 ? QString( "%1_objects").arg( myWires.count() ) : GEOMBase::GetName( myWires[0].get() );
+      myEditCurrentArgument->setText( aName );
+    }
+  }
+  else if (myEditCurrentArgument == myGroupSurf->LineEdit1 ||
+           myEditCurrentArgument == myGroupSurf->LineEdit2) {
+    const bool isEditFace = myEditCurrentArgument == myGroupSurf->LineEdit1;
+    const TopAbs_ShapeEnum aType = isEditFace ? TopAbs_FACE : TopAbs_WIRE;
+    GEOM::GeomObjPtr aSelectedObject = getSelected(aType);
+    GEOM::GeomObjPtr &anObj = isEditFace ? myFace : myWire;
+
+    if (aSelectedObject) {
+      myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject.get()));
+      anObj = aSelectedObject;
+    } else {
+      myEditCurrentArgument->setText("");
+      anObj.nullify();
+    }
 
-  if ( !myWires.isEmpty() ) {
-    QString aName = myWires.count() > 1 ? QString( "%1_objects").arg( myWires.count() ) : GEOMBase::GetName( myWires[0].get() );
-    myEditCurrentArgument->setText( aName );
+    if (isEditFace) {
+      if (myFace && !myWire) {
+        myGroupSurf->PushButton2->click();
+      }
+    } else {
+      if (!myFace && myWire) {
+        myGroupSurf->PushButton1->click();
+      }
+    }
   }
+  else if ( myEditCurrentArgument == myGroupWireConstraints->LineEdit1 ) {
+    if ( myCurrentItem ) {
+      GEOM::GeomObjPtr aSelectedObject = getSelected( TopAbs_FACE );
+      TopoDS_Shape aFaceShape;
+      GEOM::GEOM_IShapesOperations_ptr anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
+      if ( aSelectedObject && GEOMBase::GetShape( aSelectedObject.get(), aFaceShape ) && !aFaceShape.IsNull()
+          && anOper->IsSubShapeBelongsTo( myCurrentItem->getEdge().get(), 0, aSelectedObject.get(), 0 ) ) {
+        myCurrentItem->setFace( aSelectedObject );
+        findEmptyTreeItem();
+      }
+      else {
+        myCurrentItem->setFace( 0 );
+        displayPreview( myCurrentItem->getEdge().get(), true, false, true, 5, -1, Quantity_NOC_RED );
+      }
+    }
+    else {
+      myWire.nullify();
+      myEditCurrentArgument->setText( "" );
+      GEOM::GeomObjPtr aSelectedObject = getSelected( TopAbs_WIRE );
+      TopoDS_Shape aWireShape;
+      if ( aSelectedObject && GEOMBase::GetShape( aSelectedObject.get(), aWireShape ) && !aWireShape.IsNull() ) {
+        QString aName = GEOMBase::GetName( aSelectedObject.get() );
+        myEditCurrentArgument->setText( aName );
+        myWire = aSelectedObject;
+        updateConstraintsTree();
+      }
+      else {
+        myTreeConstraints->clear();
+        erasePreview( true );
+      }
+    }
+  }
+  displayPreview( true, false, true, true, -1, -1, -1, true );
 }
 
 
@@ -176,16 +495,41 @@ void BuildGUI_FaceDlg::SelectionIntoArgument()
 void BuildGUI_FaceDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
-  if ( send != GroupWire->PushButton1 )
-    return;
+  if ( send == myGroupWire->PushButton1 ) {
+    TColStd_MapOfInteger aMap;
   
-  TColStd_MapOfInteger aMap;
-  aMap.Add( GEOM_EDGE );
-  aMap.Add( GEOM_WIRE );
-  globalSelection( aMap );
-
-  myEditCurrentArgument = GroupWire->LineEdit1;
+    aMap.Add(GEOM_EDGE);
+    aMap.Add(GEOM_WIRE);
+    aMap.Add(GEOM_FACE);
+    aMap.Add(GEOM_SHELL);
+    aMap.Add(GEOM_SOLID);
+    aMap.Add(GEOM_COMPOUND);
+    globalSelection(aMap);
+    myEditCurrentArgument = myGroupWire->LineEdit1;
+  }
+  else if (send == myGroupSurf->PushButton1) {
+    globalSelection(GEOM_FACE);
+    localSelection( TopAbs_FACE );
+    myEditCurrentArgument = myGroupSurf->LineEdit1;
+    myGroupSurf->PushButton2->setDown(false);
+    myGroupSurf->LineEdit2->setEnabled(false);
+  }
+  else if (send == myGroupSurf->PushButton2) {
+    globalSelection(GEOM_WIRE);
+    localSelection( TopAbs_WIRE );
+    myEditCurrentArgument = myGroupSurf->LineEdit2;
+    myGroupSurf->PushButton1->setDown(false);
+    myGroupSurf->LineEdit1->setEnabled(false);
+  }
+  else if (send == myGroupWireConstraints->PushButton1) {
+    globalSelection();
+    localSelection( TopAbs_WIRE );
+    myEditCurrentArgument = myGroupWireConstraints->LineEdit1;
+    myCurrentItem = 0;
+  }
 
+  // enable line edit
+  myEditCurrentArgument->setEnabled(true);
   myEditCurrentArgument->setFocus();
   SelectionIntoArgument();
 }
@@ -200,12 +544,25 @@ void BuildGUI_FaceDlg::ActivateThisDialog()
   GEOMBase_Skeleton::ActivateThisDialog();
   connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
-  TColStd_MapOfInteger aMap;
-  aMap.Add( GEOM_EDGE );
-  aMap.Add( GEOM_WIRE );
-  globalSelection( aMap );
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+           this, SLOT(SelectionIntoArgument()));
+
+  ConstructorsClicked(getConstructorId());
 }
 
+//=================================================================================
+// function : onItemClicked()
+// purpose  : called when tree item was clicked
+//=================================================================================
+void BuildGUI_FaceDlg::onItemClicked( QTreeWidgetItem* theItem, int theColumn )
+{
+  if ( !theItem || !( theItem->flags() & Qt::ItemIsSelectable ) )
+    return;
+
+  myCurrentItem = dynamic_cast<TreeWidgetItem*>( theItem );
+  displayPreview( true );
+  displayPreview( myCurrentItem->getEdge().get(), true, false, true, 5, -1, Quantity_NOC_RED );
+}
 
 //=================================================================================
 // function : enterEvent()
@@ -232,7 +589,23 @@ GEOM::GEOM_IOperations_ptr BuildGUI_FaceDlg::createOperation()
 //=================================================================================
 bool BuildGUI_FaceDlg::isValid( QString& )
 {
-  return !myWires.isEmpty();
+  bool ok = false;
+
+  switch (getConstructorId()) {
+  case 0:
+    ok = !myWires.isEmpty();
+    break;
+  case 1:
+    ok = myFace && myWire;
+    break;
+  case 2:
+    ok = myWire;
+    break;
+  default:
+    break;
+  }
+
+  return ok;
 }
 
 //=================================================================================
@@ -241,26 +614,104 @@ bool BuildGUI_FaceDlg::isValid( QString& )
 //=================================================================================
 bool BuildGUI_FaceDlg::execute( ObjectList& objects )
 {
+  bool res = false;
   GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
+  GEOM::GEOM_Object_var anObj;
 
-  GEOM::ListOfGO_var objlist = new GEOM::ListOfGO();
-  objlist->length( myWires.count() );
-  for ( int i = 0; i < myWires.count(); i++ )
-    objlist[i] = myWires[i].copy();
+  switch (getConstructorId()) {
+  case 0:
+    {
+      GEOM::ListOfGO_var objlist = new GEOM::ListOfGO();
+      
+      objlist->length( myWires.count() );
 
-  GEOM::GEOM_Object_var anObj = anOper->MakeFaceWires( objlist.in(), GroupWire->CheckButton1->isChecked() );
+      for ( int i = 0; i < myWires.count(); i++ ) {
+        objlist[i] = myWires[i].copy();
+      }
+
+      anObj = anOper->MakeFaceWires( objlist.in(), myGroupWire->CheckButton1->isChecked() );
+      res = true;
+    }
+    break;
+  case 1:
+    anObj = anOper->MakeFaceFromSurface(myFace.get(), myWire.get());
+    res = true;
+    break;
+  case 2:
+    {
+      int numberOfItems = myTreeConstraints->topLevelItemCount();
+      GEOM::ListOfGO_var constraints = new GEOM::ListOfGO();
+      constraints->length( 2 * numberOfItems );
+      int j = 0;
+      for ( int i = 0; i < numberOfItems; i++ ) {
+        TreeWidgetItem* item = dynamic_cast<TreeWidgetItem*>( myTreeConstraints->topLevelItem(i) );
+        constraints[j++] = item->getEdge().copy();
+        if ( item->getFace() )
+          constraints[j++] = item->getFace().copy();
+      }
+      constraints->length(j);
+      anObj = anOper->MakeFaceWithConstraints( constraints.in() );
+      res = true;
+    }
+    break;
+  default:
+    break;
+  }
 
   if (!anObj->_is_nil()) {
+    if ( !anOper->IsDone() && QString(anOper->GetErrorCode()) == "MAKE_FACE_TOLERANCE_TOO_BIG") {
+      if ( !IsPreview() ) {
+        SUIT_OverrideCursor wc;
+        wc.suspend();
+        QString msgw = QObject::tr(anOper->GetErrorCode());
+        SUIT_MessageBox::warning(this, tr("WRN_WARNING"), msgw, tr("BUT_OK"));
+      }
+      anOper->SetErrorCode("PAL_NO_ERROR");
+    }
+    else if ( anObj->GetShapeType() == GEOM::COMPOUND ) {
+      if ( !IsPreview() ) {
+        SUIT_MessageBox::warning(this,
+                                 QObject::tr("GEOM_WRN_WARNING"),
+                                 QObject::tr("GEOM_WRN_FACES_NOT_FACE"));
+      }
+    }
     objects.push_back(anObj._retn());
+  }
 
-    if (!anOper->IsDone() && QString(anOper->GetErrorCode()) == "MAKE_FACE_TOLERANCE_TOO_BIG") {
-      SUIT_OverrideCursor wc;
-      wc.suspend();
-      QString msgw = QObject::tr(anOper->GetErrorCode());
-      SUIT_MessageBox::warning(this, tr("WRN_WARNING"), msgw, tr("BUT_OK"));
-      anOper->SetErrorCode("PAL_NO_ERROR");
+  return res;
+}
+
+//=================================================================================
+// function : addSubshapeToStudy
+// purpose  : virtual method to add new SubObjects if local selection
+//=================================================================================
+void BuildGUI_FaceDlg::addSubshapesToStudy()
+{
+  switch (getConstructorId()) {
+  case 0:
+    break;
+  case 1:
+    break;
+  case 2:
+    for( int i = 0; i < myTreeConstraints->topLevelItemCount(); i++ ) {
+      TreeWidgetItem* item = dynamic_cast<TreeWidgetItem*>( myTreeConstraints->topLevelItem(i) );
+      if ( item->getFace().get() )
+        GEOMBase::PublishSubObject( item->getFace().get() );
+      GEOMBase::PublishSubObject( myWire.get() );
     }
+    break;
+  default:
+    break;
   }
+}
 
-  return true;
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BuildGUI_FaceDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myWires);
+  res << myFace << myWire;
+  return res;
 }
index d0e6670727152f142d9d8866902c2f95404500bc..9c9dcd7a81f95e412b7f118c600797b0c13f2e60 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include "GEOM_GenericObjPtr.h"
 
 class DlgRef_1Sel1Check;
+class DlgRef_2Sel;
+class DlgRef_1SelExt;
+class QTreeWidget;
+class QTreeWidgetItem;
 
 //=================================================================================
 // class    : BuildGUI_FaceDlg
@@ -40,6 +44,8 @@ class BuildGUI_FaceDlg : public GEOMBase_Skeleton
 { 
   Q_OBJECT
 
+  class TreeWidgetItem;
+
 public:
   BuildGUI_FaceDlg( GeometryGUI*, QWidget* = 0 );
   ~BuildGUI_FaceDlg();
@@ -49,22 +55,36 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );    
+  virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
   
 private:
   void                               Init();
   void                               enterEvent( QEvent* );
+  void                               updateConstraintsTree();
+  void                               findEmptyTreeItem();
+  bool                               isTreeFull();
   
 private:
   QList<GEOM::GeomObjPtr>            myWires;
+  GEOM::GeomObjPtr                   myFace;
+  GEOM::GeomObjPtr                   myWire;
   
-  DlgRef_1Sel1Check*                 GroupWire;
+  DlgRef_1Sel1Check*                 myGroupWire;
+  DlgRef_2Sel*                       myGroupSurf;
+  DlgRef_1SelExt*                    myGroupWireConstraints;
+
+  QTreeWidget*                       myTreeConstraints;
+  TreeWidgetItem*                    myCurrentItem;
 
 private slots:
+  void                               ConstructorsClicked( int );
   void                               ClickOnOk();
   bool                               ClickOnApply();
   void                               ActivateThisDialog();
   void                               SelectionIntoArgument();
   void                               SetEditCurrentArgument();
+  void                               onItemClicked( QTreeWidgetItem*, int );
 };
 
 #endif // BUILDGUI_FACEDLG_H
index ff5a558c33e17bcffe06908aeb7fae271bae8acf..6674e9eace88c02a269576aa12d6a894ec13e1bb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -262,10 +262,7 @@ bool BuildGUI_ShellDlg::execute( ObjectList& objects )
   GEOM::GEOM_Object_var anObj = anOper->MakeShell( objlist.in() );
 
   if ( !anObj->_is_nil() ) {
-    TopoDS_Shape aShell;
-    GEOMBase::GetShape(anObj, aShell, TopAbs_SHELL);
-
-    if (aShell.IsNull()) {
+    if (anObj->GetShapeType() == GEOM::COMPOUND) {
       SUIT_MessageBox::warning(this,
                                QObject::tr("GEOM_WRN_WARNING"),
                                QObject::tr("GEOM_WRN_FACES_NOT_SHELL"));
@@ -276,3 +273,12 @@ bool BuildGUI_ShellDlg::execute( ObjectList& objects )
   return true;
 }
 
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BuildGUI_ShellDlg::getSourceObjects()
+{
+  return myFacesAndShells;
+}
+
index 8c2e18061d2b8754992d45790d0b8dfd33664feb..ffdf5838866e5c438282dc6066aee74ebff1b351 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,7 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );    
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 75eedd5f99064cedab65f0b38ec6e787f2a29fab..0382aeaee1dae9e5fb0a3c601218351fbe6f1e4f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 BuildGUI_SolidDlg::BuildGUI_SolidDlg( GeometryGUI* theGeometryGUI, QWidget* parent )
   : GEOMBase_Skeleton( theGeometryGUI, parent )
 {
-  QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BUILD_SOLID" ) ) );
-  QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+  QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+  QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_BUILD_SOLID" ) ) );
+  QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_SOLID_FROM_FACES" ) ) );
 
   setWindowTitle( tr( "GEOM_SOLID_TITLE" ) );
 
   /***************************************************************/
   mainFrame()->GroupConstructors->setTitle( tr( "GEOM_SOLID" ) );
-  mainFrame()->RadioButton1->setIcon( image0 );
-  mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
-  mainFrame()->RadioButton2->close();
+  mainFrame()->RadioButton1->setIcon( image1 );
+  mainFrame()->RadioButton2->setIcon( image2 );
   mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
   mainFrame()->RadioButton3->close();
 
   GroupSolid = new DlgRef_1Sel1Check( centralWidget() );
-
-  GroupSolid->GroupBox1->setTitle( tr( "GEOM_ARGUMENTS" ) );
+  GroupSolid->GroupBox1->setTitle( tr( "GEOM_SOLID_SHELLS" ) );
   GroupSolid->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
   GroupSolid->CheckButton1->setText( tr( "GEOM_CREATE_SINGLE_SOLID" ) );
-  GroupSolid->PushButton1->setIcon( image1 );
+  GroupSolid->PushButton1->setIcon( image0 );
   GroupSolid->LineEdit1->setReadOnly( true );
 
+  GroupFaces = new DlgRef_1Sel1Check( centralWidget() );
+  GroupFaces->GroupBox1->setTitle( tr( "GEOM_SOLID_FACES" ) );
+  GroupFaces->TextLabel1->setText( tr( "GEOM_OBJECTS" ) );
+  GroupFaces->CheckButton1->setText( tr( "GEOM_SOLID_FROM_FACE_OPT" ) );
+  GroupFaces->PushButton1->setIcon( image0 );
+  GroupFaces->LineEdit1->setReadOnly( true );
+
   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
   layout->setMargin( 0 ); layout->setSpacing( 6 );
   layout->addWidget( GroupSolid );
+  layout->addWidget( GroupFaces );
   /***************************************************************/
 
   setHelpFileName("create_solid_page.html");
@@ -118,7 +125,10 @@ void BuildGUI_SolidDlg::Init()
   connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
   connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
 
+  connect(this,      SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
+
   connect( GroupSolid->PushButton1,  SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
+  connect( GroupFaces->PushButton1,  SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
   connect( GroupSolid->CheckButton1, SIGNAL( toggled( bool ) ), this, SLOT( EnableNameField( bool ) ) );
 
   connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
@@ -126,6 +136,8 @@ void BuildGUI_SolidDlg::Init()
 
   initName( tr( "GEOM_SOLID" ) );
   SelectionIntoArgument();
+
+  ConstructorsClicked(0);
 }
 
 
@@ -150,9 +162,45 @@ bool BuildGUI_SolidDlg::ClickOnApply()
     return false;
 
   initName();
+
+  myEditCurrentArgument->setText("");
+  ConstructorsClicked(getConstructorId());
+
   return true;
 }
 
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose  : Radio button management
+//=================================================================================
+void BuildGUI_SolidDlg::ConstructorsClicked(int constructorId)
+{
+  switch (constructorId) {
+  case 0:
+    {
+      globalSelection();
+      GroupFaces->hide();
+      GroupSolid->show();
+      myEditCurrentArgument = GroupSolid->LineEdit1;
+      GroupSolid->LineEdit1->setText("");
+      break;
+    }
+  case 1:
+    {
+      globalSelection();
+      GroupSolid->hide();
+      GroupFaces->show();
+      myEditCurrentArgument = GroupFaces->LineEdit1;
+      GroupFaces->LineEdit1->setText("");
+      break;
+    }
+  }
+
+  qApp->processEvents();
+  updateGeometry();
+  resize(minimumSizeHint());
+  SelectionIntoArgument();
+}
 
 //=================================================================================
 // function : SelectionIntoArgument()
@@ -164,7 +212,10 @@ void BuildGUI_SolidDlg::SelectionIntoArgument()
 
   //myShells = getSelected( TopAbs_SHELL, -1 );
   QList<TopAbs_ShapeEnum> types;
+  if (myEditCurrentArgument == GroupSolid->LineEdit1)
   types << TopAbs_SHELL << TopAbs_COMPOUND;
+  else if (myEditCurrentArgument == GroupFaces->LineEdit1)
+  types << TopAbs_FACE << TopAbs_SHELL << TopAbs_COMPOUND;
   myShells = getSelected( types, -1 );
 
   if ( !myShells.isEmpty() ) {
@@ -180,18 +231,25 @@ void BuildGUI_SolidDlg::SelectionIntoArgument()
 void BuildGUI_SolidDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
-  if ( send != GroupSolid->PushButton1 )
-    return;
 
-  //globalSelection( GEOM_SHELL );
   TColStd_MapOfInteger aMap;
-  aMap.Add( GEOM_SHELL );
-  aMap.Add( GEOM_COMPOUNDFILTER );
   QList<int> aSubShapes;
-  aSubShapes.append( GEOM_SHELL );
-  globalSelection( aMap, aSubShapes );
+  aMap.Add( GEOM_COMPOUNDFILTER );
 
-  myEditCurrentArgument = GroupSolid->LineEdit1;
+  if (send == GroupSolid->PushButton1) {
+    aMap.Add( GEOM_SHELL );
+       aSubShapes.append( GEOM_SHELL );
+       globalSelection( aMap, aSubShapes );
+       myEditCurrentArgument = GroupSolid->LineEdit1;
+  }
+  else if (send == GroupFaces->PushButton1) {
+    aMap.Add( GEOM_SHELL );
+    aMap.Add( GEOM_FACE );
+    aSubShapes.append( GEOM_SHELL );
+    aSubShapes.append( GEOM_FACE );
+    globalSelection( aMap, aSubShapes );
+    myEditCurrentArgument = GroupFaces->LineEdit1;
+  }
 
   myEditCurrentArgument->setFocus();
   SelectionIntoArgument();
@@ -205,16 +263,10 @@ void BuildGUI_SolidDlg::SetEditCurrentArgument()
 void BuildGUI_SolidDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
-           SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+           this, SLOT(SelectionIntoArgument()));
 
-  //globalSelection( GEOM_SHELL );
-  TColStd_MapOfInteger aMap;
-  aMap.Add( GEOM_SHELL );
-  aMap.Add( GEOM_COMPOUNDFILTER );
-  QList<int> aSubShapes;
-  aSubShapes.append( GEOM_SHELL );
-  globalSelection( aMap, aSubShapes );
+  ConstructorsClicked(getConstructorId());
 }
 
 
@@ -257,15 +309,14 @@ bool BuildGUI_SolidDlg::isValid (QString& msg)
 
   GEOM::MeasureOpPtr anOp;
   anOp.take(myGeomGUI->GetGeomGen()->GetIMeasureOperations(getStudyId()));
-
-  if (!GroupSolid->CheckButton1->isChecked() || myShells.count() == 1) {
-    for (int i = 0, n = myShells.count(); i < n && ok; i++) {
-      CORBA::String_var aRes = anOp->IsGoodForSolid(myShells[i].get());
-      if (strlen(aRes.in())) {
-        msg = QObject::tr(aRes.in()).arg(GEOMBase::GetName(myShells[i].get()));
-        ok = false;
-      }
-    }
+  if (getConstructorId() == 0 && (!GroupSolid->CheckButton1->isChecked() || myShells.count() == 1)) {
+       for (int i = 0, n = myShells.count(); i < n && ok; i++) {
+         CORBA::String_var aRes = anOp->IsGoodForSolid(myShells[i].get());
+         if (strlen(aRes.in())) {
+               msg = QObject::tr(aRes.in()).arg(GEOMBase::GetName(myShells[i].get()));
+               ok = false;
+         }
+       }
   }
   return ok;
 }
@@ -315,26 +366,52 @@ bool BuildGUI_SolidDlg::isClosed( GEOM::GEOM_Object_ptr shell )
 bool BuildGUI_SolidDlg::execute( ObjectList& objects )
 {
   GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow( getOperation() );
+  GEOM::GEOM_Object_var anObj;
+
+  switch (getConstructorId()) {
+    case 0:
+    {
+       if ( GroupSolid->CheckButton1->isChecked() ) {
+         GEOM::ListOfGO_var objlist = new GEOM::ListOfGO();
+         objlist->length( myShells.count() );
+         for ( int i = 0; i < myShells.count(); i++ )
+               objlist[i] = myShells[i].copy();
+
+         anObj = anOper->MakeSolidShells( objlist.in() );
+
+         if ( !anObj->_is_nil() ) objects.push_back( anObj._retn() );
+       }
+       else {
+         for ( int i = 0, n = myShells.count(); i< n; i++ ){
+               anObj = anOper->MakeSolidShell( myShells[ i ].get() );
+
+               if ( !anObj->_is_nil() ) objects.push_back( anObj._retn() );
+         }
+       }
+       break;
+    }
+    case 1:
+    {
+      GEOM::ListOfGO_var objlist = new GEOM::ListOfGO();
+      objlist->length( myShells.count() );
+      for ( int i = 0; i < myShells.count(); i++ )
+        objlist[i] = myShells[i].copy();
 
-  if ( GroupSolid->CheckButton1->isChecked() ) {
-    GEOM::ListOfGO_var objlist = new GEOM::ListOfGO();
-    objlist->length( myShells.count() );
-    for ( int i = 0; i < myShells.count(); i++ )
-      objlist[i] = myShells[i].copy();
-
-    GEOM::GEOM_Object_var anObj = anOper->MakeSolidShells( objlist.in() );
-
-    if ( !anObj->_is_nil() )
-      objects.push_back( anObj._retn() );
-  }
-  else {
-    for ( int i = 0, n = myShells.count(); i< n; i++ ) {
-      GEOM::GEOM_Object_var anObj = anOper->MakeSolidShell( myShells[ i ].get() );
+       anObj = anOper->MakeSolidFromConnectedFaces( objlist.in(), GroupFaces->CheckButton1->isChecked() );
 
-     if ( !anObj->_is_nil() )
-       objects.push_back( anObj._retn() );
+       if ( !anObj->_is_nil() ) objects.push_back( anObj._retn() );
+      break;
     }
   }
 
   return true;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BuildGUI_SolidDlg::getSourceObjects()
+{
+  return myShells;
+}
index 6be374c6f10b38ad7116d29d375d672a41873757..bd5be738ea9de44aea87cfa8f392c6c356fc78f7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -48,7 +48,8 @@ protected:
   // redefined from GEOMBase_Helper
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
-  virtual bool                       execute( ObjectList& );    
+  virtual bool                       execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
@@ -59,12 +60,14 @@ private:
   QList<GEOM::GeomObjPtr>            myShells;
 
   DlgRef_1Sel1Check*                 GroupSolid;
+  DlgRef_1Sel1Check*                 GroupFaces;
 
 private slots:
   void                               ClickOnOk();
   bool                               ClickOnApply();
   void                               SetEditCurrentArgument();
   void                               SelectionIntoArgument();
+  void                               ConstructorsClicked( int );
   void                               ActivateThisDialog();
   void                               EnableNameField( bool );
 };
index c0d98db63699384dbed37bc7d14960fc95cbc8be..0970282089c219bd79e23c64ce8e7761569f5398 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -121,7 +121,7 @@ void BuildGUI_WireDlg::Init()
   
   myEdgesAndWires.clear();
 
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+  localSelection( TopAbs_EDGE );
 
   /* signals and slots connections */
   connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
@@ -177,12 +177,12 @@ void BuildGUI_WireDlg::TypeButtonClicked()
 {
   if ( GroupType->RadioButton1->isChecked() ) {
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
     GroupArgs->TextLabel1->setText( tr( "GEOM_EDGE" ) );
   }
   else if ( GroupType->RadioButton2->isChecked() ) {
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_WIRE );
+    localSelection( TopAbs_WIRE );
     GroupArgs->TextLabel1->setText( tr( "GEOM_WIRE" ) );
   }
   SelectionIntoArgument();
@@ -305,3 +305,12 @@ void BuildGUI_WireDlg::addSubshapesToStudy()
   for ( int i = 0; i < myEdgesAndWires.count(); i++ )
     GEOMBase::PublishSubObject( myEdgesAndWires[i].get() );
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> BuildGUI_WireDlg::getSourceObjects()
+{
+  return myEdgesAndWires;
+}
index 8aa929c70f5e71a0714acf069945c7d63b1d1c71..0715e5f1fa3ee45271e7305fd8c423d653b4eb68 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy(); 
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index bd28070bf6489f2bd8bf308d2bafb7fe9137a1d2..37bcff647a4f08fbe34608cc1543a81d70f72736 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index b4f792af168280ad432e6dfaafb9c5ec7560b762..bd7e3428d56bc9104b3e6753b39a5c45c0fc9345 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -42,11 +42,14 @@ ENDIF()
 IF(SALOME_BUILD_GUI)
   SET(SUBDIRS_GUI
     OBJECT DlgRef GEOMFiltersSelection Material GEOMGUI
-    GEOMBase DependencyTree GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI
-    CurveCreator EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI
-    RepairGUI MeasureGUI GroupGUI BlocksGUI AdvancedGUI
+    GEOMBase GEOMToolsGUI DisplayGUI BasicGUI PrimitiveGUI GenerationGUI
+    CurveCreator MeasureGUI EntityGUI BuildGUI BooleanGUI TransformationGUI OperationGUI
+    RepairGUI GroupGUI BlocksGUI AdvancedGUI
     GEOM_SWIG_WITHIHM
     )
+  IF(SALOME_USE_GRAPHICSVIEW)
+    LIST(APPEND SUBDIRS_GUI DependencyTree)
+  ENDIF()
 ENDIF()
 
 SET(SUBDIRS
index 15677b68ca95916d38877be7de81518b37bc7c33..c085fc69f014213067c4a1ded8b8bf7becee394d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -94,6 +94,7 @@ SET(_other_SOURCES
   CurveCreator_Diff.cxx
   CurveCreator_Displayer.cxx
   CurveCreator_Operation.cxx
+  CurveCreator_Section.cxx
   CurveCreator_Utils.cxx
   CurveCreator_UtilsICurve.cxx
 )
index 9cd7ec720723ca117438fbac5f5e60928be73ae7..e95749664421732fcf4e3ced4527b73e4fae9998 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
@@ -33,7 +33,7 @@ struct CurveCreator_PosPoint;
 namespace CurveCreator
 {
   //! Points coordinates
-  typedef float TypeCoord;
+  typedef double TypeCoord;
 
   /** List of coordinates in format depends on section dimension:
    *  2D: [x1, y1,     x2, y2,     x3, y3,     ..]
index e20705c46b2c779655a90a8df2a3e08dd893c831..0185e6cf4343882b391ab47833ff50c5fca2bdb4 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
@@ -88,7 +88,7 @@ std::string CurveCreator_Curve::getUniqSectionName() const
         std::string aName(aBuffer);
         int j;
         for( j = 0 ; j < mySections.size() ; j++ ){
-            aSection = getSection( j );
+            aSection = (CurveCreator_Section*)getSection( j );
             if ( aSection && aSection->myName == aName )
               break;
         }
@@ -263,7 +263,7 @@ bool CurveCreator_Curve::moveSectionInternal(const int theISection,
   int aMovedSectionId = theISection >= 0 ? theISection : mySections.size()-1;
 
   if (aMovedSectionId != theNewIndex) {
-    CurveCreator_Section* aSection = getSection( aMovedSectionId );
+    CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( aMovedSectionId );
 
     // Remove section
     CurveCreator::Sections::iterator anIter = mySections.begin() + aMovedSectionId;
@@ -362,7 +362,7 @@ bool CurveCreator_Curve::clearInternal()
 
   CurveCreator_Section* aSection;
   for (; i < aNbSections; i++) {
-    aSection = getSection( i );
+    aSection = (CurveCreator_Section*)getSection( i );
     if ( aSection )
       delete aSection;
   }
@@ -397,7 +397,8 @@ bool CurveCreator_Curve::joinInternal( const std::list<int>& theSections )
     return res;
 
   int anISectionMain = theSections.front();
-  CurveCreator_Section* aSectionMain = getSection( anISectionMain );
+  CurveCreator_Section* aSectionMain =
+    (CurveCreator_Section*)getSection( anISectionMain );
 
   std::list <int> aSectionsToJoin = theSections;
   aSectionsToJoin.erase( aSectionsToJoin.begin() ); // skip the main section
@@ -408,7 +409,7 @@ bool CurveCreator_Curve::joinInternal( const std::list<int>& theSections )
   std::list<int>::const_iterator anIt = aSectionsToJoin.begin(), aLast = aSectionsToJoin.end();
   CurveCreator_Section* aSection;
   for (; anIt != aLast; anIt++) {
-    aSection = getSection( *anIt );
+    aSection = (CurveCreator_Section*)getSection( *anIt );
     aSectionMain->myPoints.insert(aSectionMain->myPoints.end(), aSection->myPoints.begin(),
                                   aSection->myPoints.end());
     res = removeSectionInternal(*anIt);
@@ -552,12 +553,12 @@ int CurveCreator_Curve::getNbPoints( const int theISection ) const
     const int aNbSections = getNbSections();
 
     for (; i < aNbSections; i++) {
-      aSection = getSection( i );
+      aSection = (CurveCreator_Section*)getSection( i );
       if ( aSection )
         aNbCoords += aSection->myPoints.size();
     }
   } else {
-    aSection = getSection( theISection );
+    aSection = (CurveCreator_Section*)getSection( theISection );
     if ( aSection )
       aNbCoords = aSection->myPoints.size();
   }
@@ -592,7 +593,8 @@ void CurveCreator_Curve::saveCoordDiff( const SectionToPointCoordsList &theOldCo
 //! Get "closed" flag of the specified section
 bool CurveCreator_Curve::isClosed( const int theISection ) const
 {
-  CurveCreator_Section* aSection = getSection( theISection );
+  const CurveCreator_Section* aSection =
+    (CurveCreator_Section*)getSection( theISection );
   return aSection ? aSection->myIsClosed : false;
 }
 
@@ -606,14 +608,14 @@ bool CurveCreator_Curve::setClosedInternal( const int theISection,
     int i;
 
     for (i = 0; i < aSize; i++) {
-      aSection = getSection( i );
+      aSection = (CurveCreator_Section*)getSection( i );
       if( aSection ) {
         aSection->myIsClosed = theIsClosed;
         redisplayCurve();
       }
     }
   } else {
-    aSection = getSection( theISection );
+    aSection = (CurveCreator_Section*)getSection( theISection );
     if ( aSection ) {
       aSection->myIsClosed = theIsClosed;
       redisplayCurve();
@@ -644,7 +646,7 @@ bool CurveCreator_Curve::setClosed( const int theISection,
 //! Returns specified section name
 std::string CurveCreator_Curve::getSectionName( const int theISection ) const
 {
-  CurveCreator_Section* aSection = getSection( theISection );
+  CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
   return aSection ? aSection->myName : "";
 }
 
@@ -653,7 +655,7 @@ bool CurveCreator_Curve::setSectionNameInternal( const int theISection,
                                                  const std::string& theName )
 {
   bool res = false;
-  CurveCreator_Section* aSection = getSection( theISection );
+  CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
   if( aSection ) {
     aSection->myName = theName;
     res = true;
@@ -681,7 +683,7 @@ bool CurveCreator_Curve::setSectionName( const int theISection,
 CurveCreator::SectionType CurveCreator_Curve::getSectionType
   ( const int theISection ) const
 {
-  CurveCreator_Section* aSection = getSection( theISection );
+  CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
   return aSection ? aSection->myType : CurveCreator::Polyline;
 }
 
@@ -695,13 +697,13 @@ bool CurveCreator_Curve::setSectionTypeInternal( const int theISection,
     const int aNbSections = getNbSections();
 
     for (; i < aNbSections; i++) {
-      aSection = getSection( i );
+      aSection = (CurveCreator_Section*)getSection( i );
       if ( aSection )
         aSection->myType = theType;
     }
     redisplayCurve();
   } else {
-    aSection = getSection( theISection );
+    aSection = (CurveCreator_Section*)getSection( theISection );
     if ( aSection && aSection->myType != theType ){
       aSection->myType = theType;
       redisplayCurve();
@@ -744,7 +746,7 @@ bool CurveCreator_Curve::addPointsInternal( const CurveCreator::SectionsMap &the
   CurveCreator_Section *aSection = 0;
   for ( ; anIt != theSectionsMap.end(); anIt++ ) {
     int anISection = anIt->first;
-    aSection = getSection( anISection );
+    aSection = (CurveCreator_Section*)getSection( anISection );
     if( aSection ) {
       CurveCreator::PosPointsList aSectionPoints = anIt->second;
       CurveCreator::PosPointsList::const_iterator aPntIt = aSectionPoints.begin();
@@ -808,7 +810,7 @@ bool CurveCreator_Curve::setPointInternal( const CurveCreator::SectionsMap &theS
   CurveCreator_Section *aSection = 0;
   for ( ; anIt != theSectionsMap.end(); anIt++ ) {
     int anISection = anIt->first;
-    aSection = getSection( anISection );
+    aSection = (CurveCreator_Section*)getSection( anISection );
     if( aSection ) { 
       CurveCreator::PosPointsList aSectionPoints = anIt->second;
       CurveCreator::PosPointsList::const_iterator aPntIt = aSectionPoints.begin();
@@ -948,7 +950,7 @@ bool CurveCreator_Curve::removeSeveralPoints( const SectionToPointList &theSecti
 CurveCreator::Coordinates CurveCreator_Curve::getPoint( const int theISection,
                                                         const int theIPnt) const
 {
-  CurveCreator_Section* aSection = getSection( theISection );
+  CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
   CurveCreator::Coordinates::const_iterator
     anIter = aSection->myPoints.begin() + toICoord(theIPnt);
   CurveCreator::Coordinates aResult(anIter, anIter + myDimension);
@@ -962,7 +964,7 @@ CurveCreator::Coordinates CurveCreator_Curve::getPoint( const int theISection,
 //=======================================================================
 CurveCreator::Coordinates CurveCreator_Curve::getPoints( const int theISection ) const
 {
-  CurveCreator_Section* aSection = getSection( theISection );
+  CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theISection );
   return aSection ? aSection->myPoints : CurveCreator::Coordinates();
 }
 
@@ -974,15 +976,6 @@ void CurveCreator_Curve::constructAISObject()
   myAISShape = new AIS_Shape( aShape );
 }
 
-CurveCreator_Section* CurveCreator_Curve::getSection( const int theSectionId ) const
-{
-  CurveCreator_Section *aSection = 0;
-  if ( theSectionId >= 0 && theSectionId < mySections.size() )
-    aSection = mySections.at( theSectionId );
-
-  return aSection;
-}
-
 Handle(AIS_InteractiveObject) CurveCreator_Curve::getAISObject( const bool theNeedToBuild ) const
 {
   if ( !myAISShape && theNeedToBuild ) {
@@ -997,7 +990,7 @@ bool CurveCreator_Curve::removeSectionPoints( const int theSectionId,
 {
   bool aRes = false;
 
-  CurveCreator_Section* aSection = getSection( theSectionId );
+  CurveCreator_Section* aSection = (CurveCreator_Section*)getSection( theSectionId );
   if ( !aSection )
     return aRes;
 
index adcfc87a8f6f8e21448d463583bfbcb14ae5597a..2443eb87eae8c6a75df4d7e94cbc71f598481873 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
@@ -205,6 +205,21 @@ public:
   virtual bool setSectionType( const int theISection, 
                                const CurveCreator::SectionType theType );
 
+  //! A virtual method.
+  const CurveCreator_ISection* getSection(const int theSectionIndex) const
+  {
+    if (theSectionIndex >= 0 && theSectionIndex < mySections.size())
+    {
+      return (CurveCreator_ISection*)mySections[theSectionIndex];
+    }
+    return NULL;
+  }
+
+  //! A virtual method.
+  CurveCreator_ISection* getSection(const int theSectionIndex)
+  {
+    return (CurveCreator_ISection*)mySections[theSectionIndex];
+  }
 
   /***********************************************/
   /***           Point methods                 ***/
@@ -298,12 +313,6 @@ protected:
 
 protected:
   virtual void constructAISObject();
-  /**
-   * Returns the section by the section index or NULL if the index is out of the section
-   * list range
-   * \param theSectionId the section index
-   */
-  CurveCreator_Section* getSection( const int theSectionId ) const;
 
 protected:
   bool                            mySkipSorting;
index d1a7dc3222e43426504b79b637fea80197b35ce0..c81b2871cc7661e0b99b5fdb63d09d9f81f38ad2 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
index f55f5306ff18f9133319d6985cf110cad6687dcb..87e877d78eefc265f5124767d64384b6458fd1b4 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
index 22ae3990c4708aa0a259618e20acc684c13fbf72..49b0327235472397f8c8f4f7b6e2b7be9f42061f 100644 (file)
@@ -1,3 +1,22 @@
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 "CurveCreator_Displayer.hxx"
 
 CurveCreator_Displayer::CurveCreator_Displayer( Handle_AIS_InteractiveContext theContext,
index f65e9d2ec01e759f8cafb0299ab321a1eb86a460..5814cb5fb50a79b4a487e3fec65a92267c4cdb88 100644 (file)
@@ -1,3 +1,22 @@
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 CURVECREATOR_DISPLAYER_H
 #define CURVECREATOR_DISPLAYER_H
 
index 9effa478a0db3ef2ae5107ac27d1a389a7d7e8c6..20f8508e8e2d39389578684d6e6641767aa07515 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
 #ifndef _CurveCreator_ICurve_HeaderFile
 #define _CurveCreator_ICurve_HeaderFile
 
+#include "CurveCreator.hxx"
 #include "CurveCreator_Macro.hxx"
+
+#include <TColgp_HArray1OfPnt.hxx>
+
 #include <deque>
 #include <vector>
 #include <string>
@@ -49,6 +53,17 @@ namespace CurveCreator
 
 };
 
+//! The type represents the interface to the curve section.
+struct CURVECREATOR_EXPORT CurveCreator_ISection
+{
+  //! The destructor.
+  virtual ~CurveCreator_ISection() {}
+
+  //! Calculates the different points of the section.
+  virtual void GetDifferentPoints(
+    const int theDimension, Handle(TColgp_HArray1OfPnt)& thePoints) const = 0;
+};
+
 /**
  *  The CurveCreator_ICurve object is represented as one or more sets of
  *  connected points; thus CurveCreator_ICurve object can contain several
@@ -62,13 +77,16 @@ public:
   typedef std::pair<int,int> SectionToPoint;
   typedef std::deque<SectionToPoint> SectionToPointList;
 
-  typedef std::deque< std::pair< SectionToPoint,std::deque< float > > > SectionToPointCoordsList;
+  typedef std::deque< std::pair< SectionToPoint, CurveCreator::Coordinates > > SectionToPointCoordsList;
 
 public:
   /***********************************************/
   /***          Undo/Redo methods              ***/
   /***********************************************/
 
+  //! The destructor.
+  virtual ~CurveCreator_ICurve() {}
+
   //! Get number of available undo operations
   virtual int getNbUndo() const = 0;
 
@@ -131,6 +149,13 @@ public:
   virtual bool setSectionType( const int theISection, 
                                const CurveCreator::SectionType theType ) = 0;
 
+  //! Returns the curve section with the index.
+  virtual const CurveCreator_ISection* getSection(
+    const int theSectionIndex) const = 0;
+
+  //! Returns the curve section with the index.
+  virtual CurveCreator_ISection* getSection(const int theSectionIndex) = 0;
+
 
   /***********************************************/
   /***           Point methods                 ***/
@@ -143,14 +168,14 @@ public:
    *  Insert one or several points to the specified section starting from the given theIPnt index
    *  (or add these at the end of section points if \a theIPnt is -1).
    */
-  virtual bool addPoints( const std::deque<float>& theCoords,
+  virtual bool addPoints( const CurveCreator::Coordinates& theCoords,
                           const int theISection,
                           const int theIPnt = -1 ) = 0;
 
   //! Set coordinates of specified point
   virtual bool setPoint( const int theISection,
                          const int theIPnt,
-                         const std::deque<float>& theNewCoords ) = 0;
+                         const CurveCreator::Coordinates& theNewCoords ) = 0;
   
   //! Set coordinates of specified points from different sections
   virtual bool setSeveralPoints( const SectionToPointCoordsList &theSectionToPntCoords,
@@ -162,13 +187,13 @@ public:
   virtual bool removeSeveralPoints( const SectionToPointList &theSectionToPntIDs) = 0;
 
   //! Get coordinates of specified point
-  virtual std::deque<float> getPoint( const int theISection, 
+  virtual CurveCreator::Coordinates getPoint( const int theISection, 
                                       const int theIPnt ) const = 0;
 
   /**
    * Get points of a section (the total points in Curve if theISection is equal to -1)..
    */
-  virtual std::deque<float> getPoints( const int theISection = -1 ) const = 0;
+  virtual CurveCreator::Coordinates getPoints( const int theISection = -1 ) const = 0;
 
   /**
    *  Get number of points in specified section or (the total number of points
index ec814eb49a51c5854b1bc5a6170d796264a32bbf..484bb736fc135b85cb4cfd2fd23be950bc8df4ac 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
index f5f602a3c114640a97035cc4ba71f160c65f8e5d..068f9a1e3f22e210df83f6980de0395c19d20253 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
index d37ed1176ccf79bb738a23e2a651438f26e621b4..08a0bcde6fd0c1d39482c61bebcfade111d07a83 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
index 173e1c8817fdcabd8c6ebf84940c751accafbd22..17c278a979bd5e0bf31a2cd1d522066e6620887e 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
@@ -341,7 +341,7 @@ void CurveCreator_Operation::apply(CurveCreator_Curve *theCurve)
 
           int nbPoints = pInt[0];
           int nbCoords = pInt[1];
-          int nbParams = 3+nbCoords;
+          int nbParams = 3+nbCoords*sizeof(double)/sizeof(int);
           for (int i = 0; i < nbPoints*nbParams; i=i+nbParams) {
             aCoords.clear();
             aPoints.clear();
index 855d0da2a33e0abec6e601c9de97c14a7f743bc5..a818c1056c225dfce0c51cfb15e340856b20a76d 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
index 230137423eb2da905288e1e5d95f050ee096e866..49b0e594f37f9bd4055d294ae9a4be60a0da649d 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
diff --git a/src/CurveCreator/CurveCreator_Section.cxx b/src/CurveCreator/CurveCreator_Section.cxx
new file mode 100644 (file)
index 0000000..c798950
--- /dev/null
@@ -0,0 +1,70 @@
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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
+//
+
+// File:        CurveCreator_Section.cxx
+// Author:      Aleksandr BOBKOV
+
+#include "CurveCreator_Section.hxx"
+
+#include <vector>
+
+const double POINT_CONFUSION = 1e-4;
+
+//=======================================================================
+// function: GetDifferentPoints
+// purpose:
+//=======================================================================
+void CurveCreator_Section::GetDifferentPoints(
+  const int theDimension, Handle(TColgp_HArray1OfPnt)& thePoints) const
+{
+  std::vector<gp_Pnt> aTmpPoints;
+  CurveCreator::Coordinates::const_iterator aPIt = myPoints.begin();
+  CurveCreator::Coordinates::const_iterator aPItLast = myPoints.end();
+  const gp_Pnt aFirstPoint(
+    *aPIt, *(aPIt + 1), (theDimension == 2) ? 0 : *(aPIt + 2));
+  gp_Pnt aPoint = aFirstPoint;
+  aTmpPoints.push_back(aPoint);
+
+  for (; aPIt != aPItLast; aPIt += theDimension)
+  {
+    const gp_Pnt aPoint2(
+      *aPIt, *(aPIt + 1), (theDimension == 2) ? 0 : *(aPIt + 2));
+    if (!aPoint.IsEqual(aPoint2, POINT_CONFUSION))
+    {
+      aPoint = aPoint2;
+      aTmpPoints.push_back(aPoint);
+    }
+  }
+
+  int aPointCount = aTmpPoints.size();
+  if (myIsClosed)
+  {
+    while (aPointCount > 1 &&
+      aFirstPoint.IsEqual(aTmpPoints[aPointCount - 1], POINT_CONFUSION))
+    {
+      --aPointCount;
+    }
+  }
+
+  thePoints = new TColgp_HArray1OfPnt(1, aPointCount);
+  for (int aPI = 0; aPI < aPointCount; ++aPI)
+  {
+    thePoints->SetValue(aPI + 1, aTmpPoints[aPI]);
+  }
+}
index 68b03aaa7e01ba0f75ca82bd9ad1fcecf0cfb6fc..076dc78091c85e665e95363cb17e03023fdb086a 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
 #define _CurveCreator_Section_HeaderFile
 
 #include "CurveCreator.hxx"
+#include "CurveCreator_ICurve.hxx"
 
 #include <string>
 
 //! Structure to store sections representing the CurveCreator_Curve object
-struct CurveCreator_Section
+struct CURVECREATOR_EXPORT CurveCreator_Section :
+  public CurveCreator_ISection
 {
   //! Constructor. Initializes object with default values.
   CurveCreator_Section() : myName("Section"),myType(CurveCreator::Polyline), myIsClosed(false)
@@ -39,6 +41,8 @@ struct CurveCreator_Section
   CurveCreator::SectionType myType;     //!< type of the section
   bool                      myIsClosed; //!< closed or not
 
+  //! A virtual method.
+  void GetDifferentPoints(const int theDimension, Handle(TColgp_HArray1OfPnt)& thePoints) const;
 };
 
 #endif
index b40760511866a6d4ac35f5fbb0d201c7e4f506c6..31bbb5c4d9cf123ae2b9ef52503c1028ab38b4f5 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
@@ -24,6 +24,7 @@
 
 #include <QTableWidget>
 #include <QTableWidgetItem>
+#include <QHeaderView>
 
 #include <QtxDoubleSpinBox.h>
 
@@ -109,6 +110,8 @@ CurveCreator_TableView::CurveCreator_TableView( CurveCreator_ICurve* theCurve,
   //aLabels << tr( "SECTION_LABEL" ) << tr( "IDENTIFIER_LABEL" ) << aCoord1 << aCoord2;
   aLabels << tr( "TABLE_SECTION" ) << tr("TABLE_INDEX") << aCoord1 << aCoord2;
   setHorizontalHeaderLabels( aLabels );
+
+  connect( horizontalHeader(), SIGNAL( sectionClicked( int ) ), this, SLOT( OnHeaderClick( int ) ) );
 }
 
 void CurveCreator_TableView::setCurve( CurveCreator_ICurve* theCurve )
@@ -131,13 +134,14 @@ void CurveCreator_TableView::setLocalPointsToTable(
 
     QTableWidgetItem* anItem;
     anItem = new QTableWidgetItem( myCurve->getSectionName( anISection ).c_str() );
-    anItem->setFlags( anItem->flags() & ~Qt::ItemIsEnabled );
+    anItem->setFlags( anItem->flags() & ~Qt::ItemIsEditable );
     anItem->setData( Qt::UserRole, anISection );
     setItem( aRowId, 0, anItem );
 
     anItem = new QTableWidgetItem( QString::number( anIPoint + 1 ) );
     anItem->setFlags( anItem->flags() & ~Qt::ItemIsEnabled );
     anItem->setData( Qt::UserRole, anIPoint );
+    anItem->setData( Qt::DisplayRole, anIPoint );
     setItem( aRowId, 1, anItem );
 
     gp_Pnt aPoint;
@@ -149,7 +153,7 @@ void CurveCreator_TableView::setLocalPointsToTable(
       setItem( aRowId, 2, anItem );
     }
     anItem->setData( Qt::UserRole, aPoint.X() );
-    anItem->setData( Qt::DisplayRole, QString::number( aPoint.X(), 'f', 2 ) );
+    anItem->setData( Qt::DisplayRole, QString::number( aPoint.X(), 'f', 2 ).toDouble() );
 
     anItem = item( aRowId, 3 );
     if ( !anItem ) {
@@ -157,7 +161,7 @@ void CurveCreator_TableView::setLocalPointsToTable(
       setItem( aRowId, 3, anItem );
     }
     anItem->setData( Qt::UserRole, aPoint.Y() );
-    anItem->setData( Qt::DisplayRole, QString::number( aPoint.Y(), 'f', 2 ) );
+    anItem->setData( Qt::DisplayRole, QString::number( aPoint.Y(), 'f', 2 ).toDouble() );
 
     aRowId++;
   }
@@ -176,3 +180,8 @@ int CurveCreator_TableView::getPointId( const int theRowId ) const
 {
   return item( theRowId, 1 )->data( Qt::UserRole ).toInt();
 }
+
+void CurveCreator_TableView::OnHeaderClick( int theLogicalId )
+{
+  sortByColumn( theLogicalId, Qt::AscendingOrder );
+}
index 4565ab5d7ad4774e48cfae5f993c64381066bfa0..6028e04dd1d8560a4ea6bfc95cec4423c04f98e5 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
@@ -41,6 +41,8 @@ public:
 
 class CurveCreator_TableView : public QTableWidget
 {
+  Q_OBJECT
+
 public:
   CurveCreator_TableView( CurveCreator_ICurve* theCurve, QWidget* theParent = 0,
                           const QStringList& theCoordTitles = QStringList() );
@@ -61,6 +63,9 @@ public:
    */
   int getPointId( const int theRowId ) const;
 
+private slots:
+  void OnHeaderClick( int );
+
 private:
   CurveCreator_ICurve* myCurve;
 
index 36d1dfcfb5dfc3c85f68468445cfdf826ae61514..bb0f8545b0423a571976e083879b427cfe1105a4 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
index be00a75d3c9d9a2d79a9a402d26b329a7c3cc632..608fb5e12608611b9e5bf78fc0b26a445776cbbd 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
index 146676c95c0e2e940ebc65321709959af1464903..863432b4cd3fbb2b892a7ea0cc178a70ce63f5e2 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
 #include "CurveCreator_Utils.hxx"
 #include "CurveCreator.hxx"
 #include "CurveCreator_Curve.hxx"
+#include "CurveCreator_Section.hxx"
 #include "CurveCreator_UtilsICurve.hxx"
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <GEOMUtils.hxx>
 
 #include <gp_Pln.hxx>
@@ -181,116 +184,155 @@ gp_Pnt CurveCreator_Utils::ConvertClickToPoint( int x, int y, Handle(V3d_View) a
   return ResultPoint;
 }
 
-void CurveCreator_Utils::constructShape( const CurveCreator_ICurve* theCurve,
-                                         TopoDS_Shape& theShape )
+//=======================================================================
+// function : constructBSpline
+// purpose  :
+//=======================================================================
+bool CurveCreator_Utils::constructBSpline(
+  const Handle(TColgp_HArray1OfPnt)& thePoints,
+  const Standard_Boolean theIsClosed,
+  Handle(Geom_BSplineCurve)& theBSpline)
 {
-  BRep_Builder aBuilder;
-  TopoDS_Compound aComp;
-  aBuilder.MakeCompound( aComp );
-  for( int iSection = 0 ; iSection < theCurve->getNbSections() ; iSection++ )
+  const int aPointCount = thePoints->Length();
+  if (aPointCount <= 1)
   {
-    int theISection = iSection;
+    return false;
+  }
 
-    CurveCreator::SectionType aSectType = theCurve->getSectionType( theISection );
-    int aPointSize = theCurve->getNbPoints( theISection );
-    if ( aPointSize == 0 )
-      continue;
+  // Calculate the tangents.
+  TColgp_Array1OfVec aTangents(1, aPointCount);
+  Handle(TColStd_HArray1OfBoolean) aTangentFlags =
+    new TColStd_HArray1OfBoolean(1, aPointCount);
+  GeomAPI_Interpolate aInterpolator(thePoints, theIsClosed, 0);
+  if (aPointCount == 2)
+  {
+    aTangentFlags->SetValue(1, Standard_False);
+    aTangentFlags->SetValue(2, Standard_False);
+  }
+  else
+  {
+    for (Standard_Integer aPN = 1; aPN <= aPointCount; ++aPN)
+    {
+      gp_Vec aTangent;
+      if (aPN != 1 || theIsClosed)
+      {
+        const Standard_Integer aPN1 = (aPN != 1) ? (aPN - 1) : aPointCount;
+        aTangent = gp_Vec(thePoints->Value(aPN1),
+          thePoints->Value(aPN)).Normalized();
+      }
+      if (aPN < aPointCount || theIsClosed)
+      {
+        const Standard_Integer aPN2 = (aPN != aPointCount) ? (aPN + 1) : 1;
+        const gp_Vec aTangent2 = aTangent +
+          gp_Vec(thePoints->Value(aPN), thePoints->Value(aPN2)).Normalized();
+        if (aTangent2.SquareMagnitude() >= Precision::SquareConfusion())
+        {
+          aTangent = aTangent2.Normalized();
+        }
+        else
+        {
+          aTangent = -aTangent;
+        }
+      }
+      aTangents.SetValue(aPN, aTangent);
+      aTangentFlags->SetValue(aPN, Standard_True);
+    }
+  }
 
-    bool aSectIsClosed = theCurve->isClosed( theISection );
-    bool isPolyline = aSectType == CurveCreator::Polyline;
-
-    int iPoint = 0;
-    gp_Pnt aPrevPoint, aPoint;
-    // filters the curve points to skip equal points
-    std::vector<gp_Pnt> aPoints;
-    CurveCreator_UtilsICurve::getPoint( theCurve, theISection, iPoint, aPoint );
-    aPoints.push_back( aPoint );
-    aPrevPoint = aPoint;
-    iPoint++;
-    for( ; iPoint < aPointSize; iPoint++ ) {
-      CurveCreator_UtilsICurve::getPoint( theCurve, theISection, iPoint, aPoint );
-      if ( !isEqualPoints( aPrevPoint, aPoint ) )
-        aPoints.push_back( aPoint );
-      aPrevPoint = aPoint;
+  // Interpolate.
+  aInterpolator.Load(aTangents, aTangentFlags, Standard_False);
+  aInterpolator.Perform();
+  const bool aResult = (aInterpolator.IsDone() == Standard_True);
+  if (aResult)
+  {
+    theBSpline = aInterpolator.Curve();
+  }
+  return aResult;
+}
+
+//=======================================================================
+// function : constructWire
+// purpose  :
+//=======================================================================
+TopoDS_Wire CurveCreator_Utils::ConstructWire(
+  Handle(TColgp_HArray1OfPnt) thePoints,
+  const bool theIsPolyline,
+  const bool theIsClosed)
+{
+  TopoDS_Wire aWire;
+  BRep_Builder aBuilder;
+  aBuilder.MakeWire(aWire);
+  const int aPointCount = thePoints->Length();
+  if (theIsPolyline)
+  {
+    const TopoDS_Vertex aFirstVertex =
+      BRepBuilderAPI_MakeVertex(thePoints->Value(1));
+    TopoDS_Vertex aVertex = aFirstVertex;
+    for (Standard_Integer aPN = 1; aPN < aPointCount; ++aPN)
+    {
+      const TopoDS_Vertex aVertex2 =
+        BRepBuilderAPI_MakeVertex(thePoints->Value(aPN + 1));
+      aBuilder.Add(aWire, BRepBuilderAPI_MakeEdge(aVertex, aVertex2));
+      aVertex = aVertex2;
+    }
+    if (theIsClosed && aPointCount > 1)
+    {
+      aBuilder.Add(aWire, BRepBuilderAPI_MakeEdge(aVertex, aFirstVertex));
+    }
+  }
+  else
+  {
+    Handle(Geom_BSplineCurve) aBSpline;
+    if (constructBSpline(thePoints, theIsClosed, aBSpline))
+    {
+      aBuilder.Add(aWire, BRepBuilderAPI_MakeEdge(aBSpline));
     }
-    int aNbPoints = aPoints.size();
+  }
+  return aWire;
+}
 
-    if ( aNbPoints == 1 ) {
-      aPoint = aPoints.front();
-      TopoDS_Vertex aVertex = BRepBuilderAPI_MakeVertex( aPoint ).Vertex();
-      aBuilder.Add( aComp, aVertex );
+//=======================================================================
+// function : constructShape
+// purpose  :
+//=======================================================================
+void CurveCreator_Utils::constructShape(
+  const CurveCreator_ICurve* theCurve, TopoDS_Shape& theShape)
+{
+  BRep_Builder aBuilder;
+  TopoDS_Compound aShape;
+  aBuilder.MakeCompound(aShape);
+  const int aSectionCount = theCurve->getNbSections();
+  for (int aSectionI = 0; aSectionI < aSectionCount; ++aSectionI)
+  {
+    const int aTmpPointCount = theCurve->getNbPoints(aSectionI);
+    if (aTmpPointCount == 0)
+    {
+      continue;
     }
-    else if ( aNbPoints > 1 ) {
-      Handle(TColgp_HArray1OfPnt) aHCurvePoints = new TColgp_HArray1OfPnt(1, aNbPoints);
-      TColgp_Array1OfVec aTangents(1, aNbPoints);
-      Handle(TColStd_HArray1OfBoolean) aTangentFlags = new TColStd_HArray1OfBoolean(1, aNbPoints);
-      gp_Vec aNullVec(0, 0, 0);
-
-      TopoDS_Edge aPointEdge;
-      TopoDS_Vertex aVertex;
-
-      std::vector<gp_Pnt>::const_iterator aPointIt = aPoints.begin(), aPointLast = aPoints.end();
-      aPoint = *aPointIt;
-
-      int aHIndex = 1;
-      aVertex = BRepBuilderAPI_MakeVertex( aPoint ).Vertex();
-      aBuilder.Add( aComp, aVertex );
-      if ( !isPolyline ) {
-        aHCurvePoints->SetValue( aHIndex, aPoint );
-        aTangents.SetValue( aHIndex, aNullVec );
-        aTangentFlags->SetValue( aHIndex, Standard_False );
-        aHIndex++;
-      }
 
-      aPrevPoint = aPoint;
-      aPointIt++;
-      for( ; aPointIt != aPointLast; aPointIt++ ) {
-        aPoint = *aPointIt;
-        aVertex = BRepBuilderAPI_MakeVertex( aPoint ).Vertex();
-        aBuilder.Add( aComp, aVertex );
-        if ( isPolyline ) {
-          TopoDS_Edge aPointEdge = BRepBuilderAPI_MakeEdge( aPrevPoint, aPoint ).Edge();
-          aBuilder.Add( aComp, aPointEdge );
-        }
-        else {
-          aHCurvePoints->SetValue( aHIndex, aPoint );
-          aTangents.SetValue( aHIndex, aNullVec );
-          aTangentFlags->SetValue( aHIndex, Standard_False );
-          aHIndex++;
-        }
-        aPrevPoint = aPoint;
-      }
-      if( aSectIsClosed && ( aNbPoints > 2 ) ) {
-        aPoint = aPoints.front();
-        aVertex = BRepBuilderAPI_MakeVertex( aPoint ).Vertex();
-        aBuilder.Add( aComp, aVertex );
-        if ( isPolyline ) {
-          aPointEdge = BRepBuilderAPI_MakeEdge( aPrevPoint, aPoint ).Edge();
-          aBuilder.Add( aComp, aPointEdge );
-        }
-      }
-      if( !isPolyline ) {
-        // compute BSpline
-        Handle(Geom_BSplineCurve) aBSplineCurve;
-        GeomAPI_Interpolate aGBC(aHCurvePoints, aSectIsClosed, gp::Resolution());
-        // correct the spline degree to be as 3 for non-periodic spline if number of points
-        // less than 3. It is need to have a knot in each spline point. This knots are used
-        // to found a neighbour points when a new point is inserted between two existing.
-        if (!aSectIsClosed ) {
-          if (aHCurvePoints->Length() == 3)
-            aGBC.Load(aTangents, aTangentFlags);
-        }
+    // Get the different points.
+    const CurveCreator_ISection* aSection = theCurve->getSection(aSectionI);
+    Handle(TColgp_HArray1OfPnt) aPoints;
+    aSection->GetDifferentPoints(theCurve->getDimension(), aPoints);
+    const int aPointCount = aPoints->Length();
+    const bool isClosed = theCurve->isClosed(aSectionI);
 
-        aGBC.Perform();
-        if ( aGBC.IsDone() )
-          aBSplineCurve = aGBC.Curve();
-        TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge( aBSplineCurve ).Edge();
-        TopoDS_Wire aWire = BRepBuilderAPI_MakeWire( anEdge ).Wire();
-        aBuilder.Add( aComp, aWire );
-      }
+    // Add the vertices to the shape.
+    for (Standard_Integer aPN = 1; aPN <= aPointCount; ++aPN)
+    {
+      aBuilder.Add(aShape, BRepBuilderAPI_MakeVertex(aPoints->Value(aPN)));
+    }
+
+    // Add the wire to the shape.
+    const bool isPolyline =
+      (theCurve->getSectionType(aSectionI) == CurveCreator::Polyline);
+    const TopoDS_Wire aWire = ConstructWire(aPoints, isPolyline, isClosed);
+    if (!aWire.IsNull())
+    {
+      aBuilder.Add(aShape, aWire);
     }
   }
-  theShape = aComp;
+  theShape = aShape;
 }
 
 /**
@@ -514,7 +556,7 @@ void CurveCreator_Utils::getSelectedPoints( Handle(AIS_InteractiveContext) theCo
 {
   thePoints.clear();
 
-  std::list<float> aSelectedPoints;
+  std::list<double> aSelectedPoints;
   gp_Pnt aPnt;
   std::map<CompareSectionToPoint, int> aPointsMap;
 
@@ -578,8 +620,16 @@ void CurveCreator_Utils::setSelectedPoints( Handle(AIS_InteractiveContext) theCo
 
   Handle_SelectMgr_Selection aSelection = anAISShape->Selection( AIS_Shape::SelectionMode( TopAbs_VERTEX ) );
   for( aSelection->Init(); aSelection->More(); aSelection->Next() )
-  {
+  {    
+#if OCC_VERSION_LARGE > 0x06080100
+    const Handle(SelectMgr_SensitiveEntity) aHSenEntity = aSelection->Sensitive();
+    if( aHSenEntity.IsNull() )
+      continue;
+    Handle_SelectBasics_SensitiveEntity aSenEntity = aHSenEntity->BaseSensitive();
+#else
     Handle_SelectBasics_SensitiveEntity aSenEntity = aSelection->Sensitive();
+#endif
+
     Handle_Select3D_SensitivePoint aSenPnt = Handle_Select3D_SensitivePoint::DownCast( aSenEntity );
 
     gp_Pnt anOwnerPnt = aSenPnt->Point();
@@ -841,7 +891,8 @@ Handle(TColgp_HArray1OfPnt) CurveCreator_Utils::getPoints
 
   anExp.Next();
 
-  if (IsBSpline) {
+  if (IsBSpline)
+  {
     // There should be a single BSpline curve in the wire.
     if (anExp.More()) {
       return aResult;
@@ -869,16 +920,20 @@ Handle(TColgp_HArray1OfPnt) CurveCreator_Utils::getPoints
 
     IsClosed = aV[0].IsSame(aV[1]) ? true : false;
     
-    const Standard_Integer aNbPoints = aBSplCurve->NbKnots();
-    TColStd_Array1OfReal   aKnots(1, aNbPoints);
-
+    Standard_Integer aNbPoints = aBSplCurve->NbKnots();
+    TColStd_Array1OfReal aKnots(1, aNbPoints);
     aBSplCurve->Knots(aKnots);
-    aResult = new TColgp_HArray1OfPnt(1, aBSplCurve->NbKnots());
 
-    for (i = aKnots.Lower(); i <= aKnots.Upper(); ++i) {
-      aResult->SetValue(i, aBSplCurve->Value(aKnots.Value(i)));
-    }
-  } else {
+    // Don't consider the last point as it coincides with the first
+    if (IsClosed)
+      --aNbPoints;
+
+    aResult = new TColgp_HArray1OfPnt(1, aNbPoints);
+    for (i = 1; i <= aNbPoints; ++i)
+      aResult->SetValue(i, aBSplCurve->Value( aKnots.Value(i) ));
+  }
+  else
+  {
     // This is a polyline.
     TopTools_ListOfShape aVertices;
     Standard_Integer     aNbVtx = 1;
@@ -910,6 +965,13 @@ Handle(TColgp_HArray1OfPnt) CurveCreator_Utils::getPoints
 
     IsClosed = aFirstVtx.IsSame(aLastVtx) ? true : false;
 
+    // Store a last vertex
+    if (!IsClosed)
+    {
+      aVertices.Append(aLastVtx);
+      aNbVtx++;
+    }
+
     // Fill the array of points.
     aResult = new TColgp_HArray1OfPnt(1, aNbVtx);
 
index 8dddaf2ff616d78c9ec4b8deefad891c755cfdc7..29393fa3f2c942de66168b7ed775dac9e01b08d0 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
@@ -29,7 +29,9 @@
 #include <gp_Pnt.hxx>
 #include <Geom_Curve.hxx>
 #include <TopoDS_Shape.hxx>
+#include <TopoDS_Wire.hxx>
 #include <TColgp_HArray1OfPnt.hxx>
+#include <Geom_BSplineCurve.hxx>
 
 #include <list>
 #include <vector> // TODO: remove
@@ -132,6 +134,28 @@ public:
                                                  gp_Pnt& thePoint, gp_Pnt& thePoint1,
                                                  gp_Pnt& thePoint2 );
 
+  /**
+   * The algorithm builds the cubic B-spline passing through the points that the
+   * tangent vector in each given point P is calculated by the following way:
+   * if point P is preceded by a point A and is followed by a point B then
+   * the tangent vector is equal to (P - A) / |P - A| + (B - P) / |B - P|;
+   * if point P is preceded by a point A but is not followed by any point then
+   * the tangent vector is equal to P - A;
+   * if point P is followed by a point B but is not preceded by any point then
+   * the tangent vector is equal to B - P.
+   */
+  CURVECREATOR_EXPORT static bool constructBSpline( const Handle(TColgp_HArray1OfPnt)& thePoints,
+                                                    const Standard_Boolean theIsClosed,
+                                                    Handle(Geom_BSplineCurve)& theBSpline );
+
+  /**
+   * Constructs the wire corresponding to the section.
+   */
+  CURVECREATOR_EXPORT static TopoDS_Wire ConstructWire(
+    Handle(TColgp_HArray1OfPnt) thePoints,
+    const bool theIsPolyline,
+    const bool theIsClosed);
+
 protected:
   /*
    * Returns whether the clicked point belong to the curve or has a very near projection
index d11598e257661b781a0191e3ec7694c1a4a22faa..cf6dc203de5fb93fa2d2ec8cd3319efe5bc0e4fd 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
@@ -25,7 +25,7 @@
 const double LOCAL_SELECTION_TOLERANCE = 0.0001;
 
 int CurveCreator_UtilsICurve::findLocalPointIndex( const CurveCreator_ICurve* theCurve,
-                                             int theSectionId, float theX, float theY )
+                                             int theSectionId, double theX, double theY )
 {
   int aPntIndex = -1;
   if ( !theCurve )
index 96b4e454ba76d7e104dfa0d39e36a9081f547056..39c73b537a7d718080baec813d2cea11df750953 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
@@ -39,7 +39,7 @@ public:
    * \param theY the Y coordinate of the point
    */
   CURVECREATOR_EXPORT static int  findLocalPointIndex( const CurveCreator_ICurve* theCurve,
-                                          int theSectionId, float theX, float theY );
+                                          int theSectionId, double theX, double theY );
 
   CURVECREATOR_EXPORT static void findSectionsToPoints( const CurveCreator_ICurve* theCurve,
                                           const double theX, const double theY,
index 9cd21e3b7fe3339a915b1f870a1c204bd037716e..0bbccc6a12c610c234b88e21f13de5e25c214d8c 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
@@ -318,6 +318,7 @@ int CurveCreator_Widget::changeInteractionStyle( int theStyle )
 //=======================================================================
 void CurveCreator_Widget::reset()
 {
+  stopActionMode();
 }
 
 void CurveCreator_Widget::setCurve( CurveCreator_ICurve* theCurve )
@@ -618,8 +619,6 @@ void CurveCreator_Widget::onModifySection()
   mySectionView->sectionChanged(mySection);
   updateUndoRedo();
   onCancelSection();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::onJoin()
@@ -653,8 +652,6 @@ void CurveCreator_Widget::onJoin()
   if( aNewSectSize != aMainSectSize )
     mySectionView->pointsAdded( aMainSect, aMainSectSize, aNewSectSize-aMainSectSize );*/
   updateUndoRedo();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::onRemove()
@@ -683,8 +680,6 @@ void CurveCreator_Widget::onClearAll()
   mySectionView->reset();
   updateActionsStates();
   updateUndoRedo();
-  
-  emit curveModified();
 }
 
 void CurveCreator_Widget::onJoinAll()
@@ -702,8 +697,6 @@ void CurveCreator_Widget::onJoinAll()
   mySectionView->reset();
   updateActionsStates();
   updateUndoRedo();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::onUndoSettings()
@@ -722,8 +715,6 @@ void CurveCreator_Widget::onSetSpline()
     mySectionView->sectionChanged(aSelSections[i]);
   }
   updateUndoRedo();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::onSetPolyline()
@@ -737,8 +728,6 @@ void CurveCreator_Widget::onSetPolyline()
     mySectionView->sectionChanged( aSelSections[i] );
   }
   updateUndoRedo();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::onCloseSections()
@@ -752,8 +741,6 @@ void CurveCreator_Widget::onCloseSections()
     mySectionView->sectionChanged(aSelSections[i]);
   }
   updateUndoRedo();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::onUncloseSections()
@@ -767,8 +754,6 @@ void CurveCreator_Widget::onUncloseSections()
     mySectionView->sectionChanged(aSelSections[i]);
   }
   updateUndoRedo();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::onUndo()
@@ -781,8 +766,6 @@ void CurveCreator_Widget::onUndo()
   myCurve->undo();
   finishCurveModification();
   mySectionView->reset();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::onRedo()
@@ -794,8 +777,6 @@ void CurveCreator_Widget::onRedo()
   myCurve->redo();
   finishCurveModification();
   mySectionView->reset();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::updateUndoRedo()
@@ -973,17 +954,10 @@ void CurveCreator_Widget::addCoordsByClick( QMouseEvent* pe )
       return;
 
     gp_Pnt aPnt;    
+    OCCViewer_ViewPort3d* vp = getViewPort();
 
-    ic->InitSelected();
-    if ( pe->modifiers() == Qt::ShiftModifier )
-      ic->ShiftSelect();  // Append selection
-    else
-      ic->Select();       // New selection
+    aPnt = CurveCreator_Utils::ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
 
-    {
-      OCCViewer_ViewPort3d* vp = getViewPort();
-      aPnt = CurveCreator_Utils::ConvertClickToPoint( pe->x(), pe->y(), vp->getView() );
-    }
     // set the coordinates into dialog
     CurveCreator::Coordinates aCoords;
     aCoords.push_back( aPnt.X() );
@@ -1005,8 +979,9 @@ void CurveCreator_Widget::onMousePress( SUIT_ViewWindow*, QMouseEvent* theEvent
   if ( theEvent->button() != Qt::LeftButton )
     return;
 
-  myPressedX = theEvent->x();
-  myPressedY = theEvent->y();
+  // Initialize the starting point
+  myStartPoint.setX( theEvent->x() );
+  myStartPoint.setY( theEvent->y() );
 
   switch( getActionMode() ) {
     case ModificationMode: {
@@ -1028,15 +1003,71 @@ void CurveCreator_Widget::onMousePress( SUIT_ViewWindow*, QMouseEvent* theEvent
  * \param theWindow an owner of the signal
  * \param theEvent a mouse event
  */
-void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow*, QMouseEvent* theEvent )
+void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow* theWindow, QMouseEvent* theEvent )
 {
-  if ( getActionMode() != ModificationMode )
+  ActionMode aMode = getActionMode();
+  if ( aMode != ModificationMode )
+  {
+    // Emit selectionChanged() signal
+    getOCCViewer()->performSelectionChanged();
+
+    if ( aMode == AdditionMode )
+    {
+      Handle(AIS_InteractiveContext) aCtx = getAISContext();
+      if ( !aCtx.IsNull() )
+        aCtx->ClearSelected();
+    }
     return;
+  } 
+  if (theEvent->button() != Qt::LeftButton) return;
+  if (!theWindow->inherits("OCCViewer_ViewWindow")) return;
+
+  // Initialize the ending point
+  myEndPoint.setX( theEvent->x() );
+  myEndPoint.setY( theEvent->y() );
+
+  bool aHasShift = ( theEvent->modifiers() & Qt::ShiftModifier );
+
+  // Highlight detected objects
+  Handle(AIS_InteractiveContext) aCtx = getAISContext();
+  if ( !aCtx.IsNull() )
+  {
+    OCCViewer_ViewWindow* aView = (OCCViewer_ViewWindow*) theWindow;
+    if (!aView)
+      return;
+
+    if (!aHasShift)
+      aCtx->ClearCurrents( false );
+
+    Handle(V3d_View) aView3d = aView->getViewPort()->getView();
+    if ( !aView3d.IsNull() )
+    {
+      // Initialize the single selection if start and end points are equal,
+      // otherwise a rectangular selection.
+      if ( myStartPoint == myEndPoint )
+      {
+        aCtx->MoveTo( myEndPoint.x(), myEndPoint.y(), aView3d );
+        if ( aHasShift )
+          aCtx->ShiftSelect();
+        else
+          aCtx->Select();
+      }
+      else
+      {
+        if ( aHasShift )
+          aCtx->ShiftSelect( myStartPoint.x(), myStartPoint.y(), myEndPoint.x(), myEndPoint.y(),
+                             aView3d, Standard_False );
+        else
+          aCtx->Select( myStartPoint.x(), myStartPoint.y(), myEndPoint.x(), myEndPoint.y(),
+                        aView3d, Standard_False );
+      }
+    }
+  }
 
   if ( myDragStarted ) {
     bool isDragged = myDragged;
     CurveCreator_ICurve::SectionToPointList aDraggedPoints;
-    QMap<CurveCreator_ICurve::SectionToPoint, std::deque< float > > anInitialDragPointsCoords;
+    QMap<CurveCreator_ICurve::SectionToPoint, CurveCreator::Coordinates > anInitialDragPointsCoords;
     if ( myDragged ) {
       aDraggedPoints = myDragPoints;
       anInitialDragPointsCoords = myInitialDragPointsCoords;
@@ -1082,7 +1113,7 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow*, QMouseEvent* theEven
         for ( ; anIt != aLast; anIt++ ) {
           int aSectionId = anIt->first;
           int aPointId = anIt->second;
-          std::deque<float> aPos = myCurve->getPoint( aSectionId, aPointId );
+          CurveCreator::Coordinates aPos = myCurve->getPoint( aSectionId, aPointId );
 
           aCoordList.push_back(
             std::make_pair( std::make_pair( aSectionId, aPointId ), aPos ) );
@@ -1104,17 +1135,13 @@ void CurveCreator_Widget::onMouseRelease( SUIT_ViewWindow*, QMouseEvent* theEven
   }
   else // check whether the segment is clicked an a new point should be added to the segment
   {
-    int aReleasedX = theEvent->x();
-    int aReleasedY = theEvent->y();
-    if ( myPressedX == aReleasedX && myPressedY == aReleasedY )
-      insertPointToSelectedSegment( aReleasedX, aReleasedY );
+    if ( myStartPoint.x() == myEndPoint.x() && myStartPoint.y() == myEndPoint.y() )
+      insertPointToSelectedSegment( myEndPoint.x(), myStartPoint.y() );
   }
 
   // updates the input panel table to show the selected point coordinates
   updateLocalPointView();
   updateUndoRedo();
-
-  emit curveModified();
 }
 
 /**
@@ -1176,14 +1203,12 @@ void CurveCreator_Widget::onCellChanged( int theRow, int theColumn )
 
   double aX  = myLocalPointView->item( theRow, 2 )->data( Qt::UserRole ).toDouble();
   double anY = myLocalPointView->item( theRow, 3 )->data( Qt::UserRole ).toDouble();
-  std::deque<float> aChangedPos;
+  CurveCreator::Coordinates aChangedPos;
   aChangedPos.push_back( aX );
   aChangedPos.push_back( anY );
   myCurve->setPoint( aCurrSect, aPntIndex, aChangedPos );
 
   finishCurveModification( aSelPoints );
-
-  emit curveModified();
 }
 
 /**
@@ -1201,8 +1226,6 @@ void CurveCreator_Widget::removeSection()
   }
   mySectionView->clearSelection();
   updateUndoRedo();
-
-  emit curveModified();
 }
 
 /**
@@ -1221,8 +1244,6 @@ void CurveCreator_Widget::removePoint()
   myCurve->removeSeveralPoints( aPoints );
   finishCurveModification( CurveCreator_ICurve::SectionToPointList() );
   mySectionView->reset();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::addNewPoint(const CurveCreator::Coordinates& theCoords)
@@ -1238,8 +1259,6 @@ void CurveCreator_Widget::addNewPoint(const CurveCreator::Coordinates& theCoords
   mySectionView->pointsAdded( aSection, myCurve->getNbPoints( aSection ) );
   updateActionsStates();
   updateUndoRedo();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::insertPointToSelectedSegment( const int theX,
@@ -1306,8 +1325,6 @@ void CurveCreator_Widget::insertPointToSelectedSegment( const int theX,
   finishCurveModification( aSelPoints );
 
   setSelectedPoints();
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
@@ -1329,7 +1346,7 @@ void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
   double anYDelta = aStartPnt.Y() - anEndPnt.Y();
 
   CurveCreator_ICurve::SectionToPointCoordsList aCoordList;
-  std::deque<float> aChangedPos;
+  CurveCreator::Coordinates aChangedPos;
   CurveCreator_ICurve::SectionToPointList::const_iterator anIt = myDragPoints.begin(),
                                                           aLast = myDragPoints.end();
   for ( ; anIt != aLast; anIt++ ) {
@@ -1355,8 +1372,6 @@ void CurveCreator_Widget::moveSelectedPoints( const int theXPosition,
 
   myDragged = true;
   finishCurveModification( myDragPoints );
-
-  emit curveModified();
 }
 
 void CurveCreator_Widget::updateLocalPointView()
@@ -1483,7 +1498,7 @@ void CurveCreator_Widget::finishCurveModification(
  * \param theX the X coordinate of the point
  * \param theY the Y coordinate of the point
  */
-int CurveCreator_Widget::findLocalPointIndex( int theSectionId, float theX, float theY )
+int CurveCreator_Widget::findLocalPointIndex( int theSectionId, double theX, double theY )
 {
   return CurveCreator_UtilsICurve::findLocalPointIndex( myCurve, theSectionId, theX, theY );
 }
index e15e923095278f82b0756cbf83d4aef6ed9078f9..87433c553c36f22beb49dacaf56fe853b9d72175 100644 (file)
@@ -1,9 +1,9 @@
-// Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // 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.
+// 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
@@ -100,7 +100,6 @@ signals:
   void selectionChanged();
   void subOperationStarted( QWidget*, bool );
   void subOperationFinished( QWidget* );
-  void curveModified();
 
 public slots:
 
@@ -196,7 +195,7 @@ private:
                                       CurveCreator_ICurve::SectionToPointList() );
 
   // curve algorithm
-  int  findLocalPointIndex( int theSectionId, float theX, float theY );
+  int  findLocalPointIndex( int theSectionId, double theX, double theY );
   void findSectionsToPoints( const double theX, const double theY,
                              CurveCreator_ICurve::SectionToPointList& thePoints );
   void convert( const CurveCreator_ICurve::SectionToPointList& thePoints,
@@ -205,6 +204,11 @@ private:
   bool contains( const CurveCreator_ICurve::SectionToPointList& theList,
                  const CurveCreator_ICurve::SectionToPoint& theValue ) const;
 
+protected:
+  // Boundary points of mouse to select the points
+  QPoint myStartPoint;
+  QPoint myEndPoint;
+
 private:
   QMap<ActionId, QAction*>    myActionMap;
   CurveCreator_ICurve*        myCurve;
@@ -223,8 +227,6 @@ private:
   QMap<CurveCreator_ICurve::SectionToPoint, CurveCreator::Coordinates> myInitialDragPointsCoords;
   bool                        myDragged;
   QByteArray                  myGuiState;
-  int                         myPressedX;
-  int                         myPressedY;
   OCCViewer_ViewWindow::Mode2dType myOld2DMode;
 };
 
index b48e327607959663659ecb8f27e4529d8a365ea5..0aa01462a13db0b3c5d493e89b5dbb469717b75d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 4f47eb3a93f5991728b4a099b395bdc47ef81c57..de8d84a392eaa33b03ce8ae842e5d9d16f437d92 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 945b631bca2f487c87a9e7109b3d055ec4e8c8ef..d7e38c5f65ef983ffeb9c86b551c505ea16715b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 9f73bfe51c87e6f7d3efafe9ecb89387aaa25042..d21abee6f03087916a452752ec49f3ebe281a1e8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 25203629ee1a9b116ac33095c217c826aeb01331..d1df6314ecab581a9beeb72d1d12b7e0c9923b5f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index db2c4a22b538413d431f1a39822010c781190a23..6f63ef6b7ce9fa7006612decdbdb73686c8ff653 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 98f0cc0304603a7976b70a3a3ae0d30fd0ade91a..17ffa81b378c5c0d1a57d613a4e9b8f702c48d24 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 5203d4d55e027c00ed7865fb42cecf81db7ddaa6..a0e6253ced55186967553e338b84e1b26eb90446 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 230bfa53ac729e1526c25fe031792158a91b322e..8ce6cd08c45c50a7783bf7a9d8a3ce37adadc958 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -351,6 +351,18 @@ void DependencyTree_View::onRebuildModel()
   updateModel( true, false );
 }
 
+//=================================================================================
+// function : resizeEvent()
+// purpose  : reimplemented from QGraphicsView::resizeEvent()
+//=================================================================================
+void DependencyTree_View::resizeEvent(QResizeEvent *event)
+{
+  QPointF aCenter = mapToScene( event->oldSize().width()/2,
+                                event->oldSize().height()/2 );
+  QGraphicsView::resizeEvent( event );
+  centerOn( aCenter.x(),aCenter.y() );
+}
+
 //=================================================================================
 // function : onUpdateModel()
 // purpose  : slot for updating tree model for main objects in viewer
@@ -477,7 +489,7 @@ void DependencyTree_View::parseTree()
       GEOMUtils::LevelInfo::const_iterator node;
       for( node = Levelup.begin(); node != Levelup.end(); node++ ) {
         DependencyTree_Object* object = myTreeMap[ node->first ];
-        addArrow( Main_object, object );
+        addArrow( object, Main_object );
       }
     }
     parseTreeWardArrow( i->second.first );
@@ -515,7 +527,7 @@ void DependencyTree_View::parseTreeWardArrow( const GEOMUtils::LevelsList& theWa
       for( int link = 0; link < Links.size(); link++ ) {
         DependencyTree_Object* LinkObject = myTreeMap[ Links[ link ] ];
         if( object && LinkObject )
-          addArrow( object, LinkObject );
+          addArrow( LinkObject, object );
       }
     }
   }
@@ -613,7 +625,7 @@ void DependencyTree_View::drawTree()
         for( node = Levelup.begin(); node != Levelup.end(); node++ ) {
           DependencyTree_Object* object = myTreeMap[ node->first ];
           DependencyTree_Arrow* arrow =
-            myArrows[ std::pair<DependencyTree_Object*,DependencyTree_Object*>( Main_object, object )];
+            myArrows[ std::pair<DependencyTree_Object*,DependencyTree_Object*>( object, Main_object )];
           if( arrow && !isItemAdded( arrow ) )
             addItem( arrow );
         }
@@ -670,7 +682,7 @@ void DependencyTree_View::drawWardArrows( const GEOMUtils::LevelsList& theWard )
       for( int link = 0; link < Links.size(); link++ ) {
         DependencyTree_Object* LinkObject = myTreeMap[ Links[ link ] ];
         if( isItemAdded( object ) && isItemAdded( LinkObject ) ) {
-          DependencyTree_Arrow* arrow = myArrows[ std::pair<DependencyTree_Object*,DependencyTree_Object*>( object, LinkObject ) ];
+          DependencyTree_Arrow* arrow = myArrows[ std::pair<DependencyTree_Object*,DependencyTree_Object*>( LinkObject, object ) ];
           if( arrow && !isItemAdded( arrow ) )
             addItem( arrow );
         }
@@ -689,7 +701,7 @@ void DependencyTree_View::updateView()
     return;
 
   drawTree();
-  fitAll();
+  fitWindow();
 }
 
 //=================================================================================
@@ -734,6 +746,23 @@ void DependencyTree_View::clearView( bool isClearModel )
   }
 }
 
+//=================================================================================
+// function : fitWindow()
+// purpose  : scale the window considering a size of scene
+//=================================================================================
+void DependencyTree_View::fitWindow()
+{
+  int sizeFactor = 4;
+  if( objectsBoundingRect(true).width() > sizeFactor*size().width() ||
+      objectsBoundingRect(true).height() > sizeFactor*size().width() ) {
+    QRectF aRect = QRectF( -sizeFactor*size().width()/2, -sizeFactor*size().height()/2,
+                           sizeFactor*size().width(), sizeFactor*size().height() );
+    fitInView( aRect, Qt::KeepAspectRatio );
+  }
+  else
+    fitAll();
+}
+
 //=================================================================================
 // function : getNewTreeModel()
 // purpose  : get dependency tree model from engine
index 298933729ecbddf6785d3e3b3aa2266f04a617bd..77cf41db9cd0a74451510bb1c3213409d3fc53e1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -68,6 +68,10 @@ public slots:
 
   void                    onRebuildModel();
 
+protected:
+
+  void                    resizeEvent( QResizeEvent *event );
+
 private slots:
 
   void                    onUpdateModel();
@@ -93,6 +97,8 @@ private:
   void                    updateView();
   void                    clearView( bool );
 
+  void                    fitWindow();
+
   int                     checkMaxLevelsNumber();
 
   void                    getNewTreeModel( bool = true, bool = true );
index 750de6f800813b9bb2f1fe901a61421c6da00a1d..6321808e522cabc7bfb0d10e7cbd8fb83523ad75 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 9bac8cbce8ca0bba3a61c95a3c0e63cc4a91157e..7160a215fd3a9061759f6106d9647fc7f6b12d27 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index ffeb404bc57e121e1ce2d5369d0f0fce89d24869..8e838db17a24436110f98bc52bb07f6083c7f07f 100644 (file)
@@ -2,43 +2,43 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="fr_FR">
 <context>
-  <name>DependencyTree_View</name>
+    <name>DependencyTree_View</name>
     <message>
-      <source>DEPENDENCY_TREE</source>
-      <translation type="unfinished">Dependency Tree</translation>
+        <source>DEPENDENCY_TREE</source>
+        <translation>Arbre des dépendances</translation>
     </message>
     <message>
-      <source>MOVE_NODES</source>
-      <translation type="unfinished">Move nodes</translation>
+        <source>MOVE_NODES</source>
+        <translation>Déplacer les noeuds</translation>
     </message>
     <message>
-      <source>HIERARCHY_DEPTH</source>
-      <translation type="unfinished">Hierarchy depth  </translation>
+        <source>HIERARCHY_DEPTH</source>
+        <translation>Niveau hiérarchique</translation>
     </message>
     <message>
-      <source>DISPLAY_ASCENDANTS</source>
-      <translation type="unfinished">Display ascendants</translation>
+        <source>DISPLAY_ASCENDANTS</source>
+        <translation>Montrer les liens ascendants</translation>
     </message>
     <message>
-      <source>DISPLAY_DESCENDANTS</source>
-      <translation type="unfinished">Display descendants</translation>
+        <source>DISPLAY_DESCENDANTS</source>
+        <translation>Montrer les liens descendants</translation>
     </message>
     <message>
-      <source>SHOW_ALL</source>
-      <translation type="unfinished">Show all</translation>
+        <source>SHOW_ALL</source>
+        <translation>Montrer tout</translation>
     </message>
     <message>
-      <source>UPDATE</source>
-      <translation type="unfinished">Update</translation>
+        <source>UPDATE</source>
+        <translation>Mise à jour</translation>
     </message>
-  <name>DependencyTree_ViewModel</name>
+    <name>DependencyTree_ViewModel</name>
     <message>
-      <source>MEN_REBUILD_THE_TREE</source>
-      <translation type="unfinished">Rebuild the tree</translation>
+        <source>MEN_REBUILD_THE_TREE</source>
+        <translation>Reconstruire l'arbre</translation>
     </message>
     <message>
-      <source>MEN_REDUCE_STUDY</source>
-      <translation type="unfinished">Reduce study</translation>
+        <source>MEN_REDUCE_STUDY</source>
+        <translation>Réduire l'étude</translation>
     </message>
 </context>
 </TS>
index 642f04c6a7f36116eae786442980c670ab75e4c7..b53b0f588d86f4e80e4399c411823c100aa66062 100644 (file)
@@ -1,44 +1,44 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS>
-<context>
-  <name>DependencyTree_View</name>
+<TS version="2.0" language="ja" sourcelanguage="en">
+  <context>
+    <name>DependencyTree_View</name>
     <message>
       <source>DEPENDENCY_TREE</source>
-      <translation type="unfinished">Dependency Tree</translation>
+      <translation>依存関係ツリー</translation>
     </message>
     <message>
       <source>MOVE_NODES</source>
-      <translation type="unfinished">Move nodes</translation>
+      <translation>ノードの移動</translation>
     </message>
     <message>
       <source>HIERARCHY_DEPTH</source>
-      <translation type="unfinished">Hierarchy depth  </translation>
+      <translation>階層の深さ</translation>
     </message>
     <message>
       <source>DISPLAY_ASCENDANTS</source>
-      <translation type="unfinished">Display ascendants</translation>
+      <translation>上位の表示</translation>
     </message>
     <message>
       <source>DISPLAY_DESCENDANTS</source>
-      <translation type="unfinished">Display descendants</translation>
+      <translation>下位の表示</translation>
     </message>
     <message>
       <source>SHOW_ALL</source>
-      <translation type="unfinished">Show all</translation>
+      <translation>すべてを表示</translation>
     </message>
     <message>
       <source>UPDATE</source>
-      <translation type="unfinished">Update</translation>
+      <translation>更新</translation>
     </message>
-  <name>DependencyTree_ViewModel</name>
+    <name>DependencyTree_ViewModel</name>
     <message>
       <source>MEN_REBUILD_THE_TREE</source>
-      <translation type="unfinished">Rebuild the tree</translation>
+      <translation>ツリーの再構築</translation>
     </message>
     <message>
       <source>MEN_REDUCE_STUDY</source>
-      <translation type="unfinished">Reduce study</translation>
+      <translation>スタディの削減</translation>
     </message>
-</context>
-</TS>
\ No newline at end of file
+  </context>
+</TS>
index 301b8eadc96206da603701979ef222bdc5df4ca8..7a9d92208017d765c1f2d3ccccfb0717100b5779 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 29f51945df69cda9c75d8b6dfa37bafd153193b4..edbeca37877ce70bf66a43cd56229def3f004feb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -141,6 +141,12 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
       ( GetVerticesMode() ? tr("MEN_VERTICES_MODE_ON") : tr( "MEN_VERTICES_MODE_OFF" ) );
     getGeometryGUI()->menuMgr()->update();
     break;
+  case GEOMOp::OpSwitchName:  // MENU VIEW - DISPLAY MODE - SHOW/HIDE NAME
+    SetNameMode(!GetNameMode());
+    getGeometryGUI()->action( GEOMOp::OpSwitchName )->setText
+      ( GetNameMode() ? tr("MEN_NAME_MODE_ON") : tr( "MEN_NAME_MODE_OFF" ) );
+    getGeometryGUI()->menuMgr()->update();
+    break;
   case GEOMOp::OpWireframe:      // POPUP MENU - DISPLAY MODE - WIREFRAME
     ChangeDisplayMode( 0 );
     break;
@@ -153,12 +159,15 @@ bool DisplayGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
   case GEOMOp::OpTexture:        // POPUP MENU - DISPLAY MODE - TEXTURE
     ChangeDisplayMode( 3 );
     break;
-    case GEOMOp::OpVectors:        // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION
+  case GEOMOp::OpVectors:        // POPUP MENU - DISPLAY MODE - SHOW EDGE DIRECTION
     ChangeDisplayMode( 4 );
     break;
-    case GEOMOp::OpVertices:       // POPUP MENU - DISPLAY MODE - SHOW VERTICES
+  case GEOMOp::OpVertices:       // POPUP MENU - DISPLAY MODE - SHOW VERTICES
     ChangeDisplayMode( 5 );
     break;
+  case GEOMOp::OpShowName:       // POPUP MENU - DISPLAY MODE - SHOW NAME
+    ChangeDisplayMode( 6 );
+    break;
   default:
     app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
     break;
@@ -189,7 +198,7 @@ void DisplayGUI::DisplayAll()
   _PTR(ChildIterator) anIter ( aStudy->NewChildIterator( SC ) );
   anIter->InitEx( true );
 
-  SUIT_OverrideCursor();
+  SUIT_OverrideCursor wc;
 
   while( anIter->More() ) {
     _PTR(SObject) valSO ( anIter->Value() );
@@ -210,7 +219,7 @@ void DisplayGUI::DisplayAll()
 //=====================================================================================
 void DisplayGUI::EraseAll()
 {
-  SUIT_OverrideCursor();
+  SUIT_OverrideCursor wc;
 
   SUIT_Application* app = getGeometryGUI()->getApp();
   if ( app ) {
@@ -261,7 +270,7 @@ void DisplayGUI::DisplayOnlyChildren()
   aSelMgr->selectedObjects(aList, "ObjectBrowser", false);
   SALOME_ListIteratorOfListIO It (aList);
 
-  SUIT_OverrideCursor();
+  SUIT_OverrideCursor wc;
 
   for (; It.More(); It.Next()) {
     Handle(SALOME_InteractiveObject) anIObject = It.Value();
@@ -314,7 +323,7 @@ void DisplayGUI::Display()
   aSelMgr->selectedObjects( aList );
   SALOME_ListIteratorOfListIO It( aList );
 
-  SUIT_OverrideCursor();
+  SUIT_OverrideCursor wc;
 
   for( ;It.More();It.Next() ) {
     Handle(SALOME_InteractiveObject) anIObject = It.Value();
@@ -372,7 +381,7 @@ void DisplayGUI::Erase()
   aSelMgr->selectedObjects( aList );
   SALOME_ListIteratorOfListIO It( aList );
 
-  SUIT_OverrideCursor();
+  SUIT_OverrideCursor wc;
 
   for( ; It.More(); It.Next() ) {
     Handle(SALOME_InteractiveObject) anIObject = It.Value();
@@ -420,7 +429,7 @@ void DisplayGUI::Erase()
 //=====================================================================================
 void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
 {
-  SUIT_OverrideCursor();
+  SUIT_OverrideCursor wc;
 
   SalomeApp_Application* app = getGeometryGUI()->getApp();
   if ( !app ) return;
@@ -435,8 +444,11 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
 
   int mgrId = viewWindow->getViewManager()->getGlobalId();
 
+  SALOME_View* window = displayer.GetActiveView();
+  if ( !window ) return;
+
   SALOME_ListIO anIOlst;
-  displayer.GetActiveView()->GetVisible( anIOlst );
+  window->GetVisible( anIOlst );
 
   for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) {
     Handle( SALOME_InteractiveObject ) io = It.Value();
@@ -453,7 +465,7 @@ void DisplayGUI::SetDisplayMode( const int mode, SUIT_ViewWindow* viewWindow )
 //=====================================================================================
 void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow )
 {
-  SUIT_OverrideCursor();
+  SUIT_OverrideCursor wc;
 
   SalomeApp_Application* app = getGeometryGUI()->getApp();
   if ( !app ) return;
@@ -470,8 +482,11 @@ void DisplayGUI::SetVectorMode( const bool mode, SUIT_ViewWindow* viewWindow )
 
   int aMgrId = viewWindow->getViewManager()->getGlobalId();
 
+  SALOME_View* window = displayer.GetActiveView();
+  if ( !window ) return;
+
   SALOME_ListIO anIOlst;
-  displayer.GetActiveView()->GetVisible( anIOlst );
+  window->GetVisible( anIOlst );
 
   for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) {
     Handle( SALOME_InteractiveObject ) io = It.Value();
@@ -499,7 +514,7 @@ int DisplayGUI::GetVectorMode( SUIT_ViewWindow* viewWindow )
 //=====================================================================================
 void DisplayGUI::SetVerticesMode( const bool mode, SUIT_ViewWindow* viewWindow )
 {
-  SUIT_OverrideCursor();
+  SUIT_OverrideCursor wc;
 
   SalomeApp_Application* app = getGeometryGUI()->getApp();
   if ( !app ) return;
@@ -516,8 +531,11 @@ void DisplayGUI::SetVerticesMode( const bool mode, SUIT_ViewWindow* viewWindow )
 
   int aMgrId = viewWindow->getViewManager()->getGlobalId();
 
+  SALOME_View* window = displayer.GetActiveView();
+  if ( !window ) return;
+
   SALOME_ListIO anIOlst;
-  displayer.GetActiveView()->GetVisible( anIOlst );
+  window->GetVisible( anIOlst );
 
   for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) {
     Handle( SALOME_InteractiveObject ) io = It.Value();
@@ -539,6 +557,55 @@ int DisplayGUI::GetVerticesMode( SUIT_ViewWindow* viewWindow )
   return viewWindow->property( "VerticesMode" ).toBool();
 }
 
+//=====================================================================================
+// function : DisplayGUI::SetNameMode()
+// purpose  : Set name mode for the viewer
+//=====================================================================================
+void DisplayGUI::SetNameMode( const bool mode, SUIT_ViewWindow* viewWindow )
+{
+  SUIT_OverrideCursor();
+
+  SalomeApp_Application* app = getGeometryGUI()->getApp();
+  if ( !app ) return;
+
+  SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
+  if ( !aStudy ) return;
+
+  if ( !viewWindow )
+    viewWindow = app->desktop()->activeWindow();
+
+  viewWindow->setProperty( "NameMode", mode );
+
+  GEOM_Displayer displayer( aStudy );
+
+  int aMgrId = viewWindow->getViewManager()->getGlobalId();
+
+  SALOME_View* window = displayer.GetActiveView();
+  if ( !window ) return;
+
+  SALOME_ListIO anIOlst;
+  window->GetVisible( anIOlst );
+
+  for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) {
+    Handle( SALOME_InteractiveObject ) io = It.Value();
+    aStudy->setObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::ShowName ), mode );
+    displayer.Redisplay( io, false );
+  }
+  displayer.UpdateViewer();
+  GeometryGUI::Modified();
+}
+
+//=====================================================================================
+// function : DisplayGUI::GetNameMode()
+// purpose  : Get the "show name" mode of the viewer
+//=====================================================================================
+int DisplayGUI::GetNameMode( SUIT_ViewWindow* viewWindow )
+{
+  if ( !viewWindow )
+    viewWindow = getGeometryGUI()->getApp()->desktop()->activeWindow();
+  return viewWindow->property( "NameMode" ).toBool();
+}
+
 //=====================================================================================
 // function : DisplayGUI::ChangeDisplayMode()
 // purpose  : Set display mode for selected objects in the viewer given
@@ -558,7 +625,7 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
   SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
   if ( !aStudy ) return;
 
-  SUIT_OverrideCursor();
+  SUIT_OverrideCursor wc;
 
   SALOME_ListIO selected;
   aSelMgr->selectedObjects( selected );
@@ -572,6 +639,8 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
   bool vectorMode =  v.isValid() ? !v.toBool() : false;
   v = aStudy->getObjectProperty( mgrId, selected.First()->getEntry(), GEOM::propertyName( GEOM::Vertices ), QVariant() );
   bool verticesMode =  v.isValid() ? !v.toBool() : false;
+  v = aStudy->getObjectProperty( mgrId, selected.First()->getEntry(), GEOM::propertyName( GEOM::ShowName ), QVariant() );
+  bool nameMode =  v.isValid() ? !v.toBool() : false;
 
   for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
     Handle( SALOME_InteractiveObject ) io = It.Value();
@@ -584,6 +653,9 @@ void DisplayGUI::ChangeDisplayMode( const int mode, SUIT_ViewWindow* viewWindow
     else if ( mode == 5 ) {
       aStudy->setObjectProperty( mgrId, io->getEntry(), GEOM::propertyName( GEOM::Vertices ), verticesMode );
     }
+    else if ( mode == 6 ) {
+      aStudy->setObjectProperty( mgrId, io->getEntry(), GEOM::propertyName( GEOM::ShowName ), nameMode );
+    }
     displayer.Redisplay( io, false );
   }
   displayer.UpdateViewer();
index 5ad5933c7fc5e4ca82a8723a498d51d4baf6d114..252e8a07cae28f643a363655c038410d9e590bed 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -75,6 +75,12 @@ public:
   // Get vertices mode of the viewer
   int  GetVerticesMode( SUIT_ViewWindow* = 0 );
   
+  // NAME MODE methods
+  // Set name mode for the viewer
+  void SetNameMode( const bool, SUIT_ViewWindow* = 0 );
+  // Get name mode of the viewer
+  int  GetNameMode( SUIT_ViewWindow* = 0 );
+  
   // Set display mode for selected objects in the viewer given
   // (current viewer if <viewWindow> = 0 )
   void ChangeDisplayMode( const int, SUIT_ViewWindow* = 0 );
index 29874d83cc7814dd46f3a02777ea78f992ca9fd8..ac45eab233871365dab0e5d82e8f2bc58e13f3d9 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 1e242cb950ecc1e03f71fe2e67620f571f6bbef2..e6cad0a2c2c3ac67a41a4ce091fecba870205df6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 918183677b154574dbf55f7df73b5345eeba51d2..3e79b37a6da5d57ba714e7b30f331e52bc2a1f7a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 79668add1cf4b08310c41def8e5807d3c7522f88..0bb93f921c92435cfd152cf93f47709b534d103f 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -39,6 +39,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/GEOMImpl
   ${PROJECT_SOURCE_DIR}/src/GEOMGUI
   ${PROJECT_SOURCE_DIR}/src/GEOMBase
+  ${PROJECT_SOURCE_DIR}/src/MeasureGUI
   ${PROJECT_SOURCE_DIR}/src/SKETCHER
   ${PROJECT_SOURCE_DIR}/src/CurveCreator
   ${PROJECT_SOURCE_DIR}/src/ShapeRecognition
@@ -67,6 +68,7 @@ SET(_link_LIBRARIES
   DlgRef
   GEOMSketcher
   CurveCreator
+  MeasureGUI
   )
 
 # optional sources
@@ -108,6 +110,7 @@ SET(EntityGUI_HEADERS
   EntityGUI_PolylineDlg.h
   EntityGUI_3DSketcherDlg.h
   EntityGUI_IsolineDlg.h
+  EntityGUI_SurfFromFaceDlg.h
   EntityGUI_SubShapeDlg.h
   EntityGUI_FeatureDetectorDlg.h
   EntityGUI_PictureImportDlg.h
@@ -121,6 +124,7 @@ SET(_moc_HEADERS
   EntityGUI_PolylineDlg.h
   EntityGUI_3DSketcherDlg.h
   EntityGUI_IsolineDlg.h
+  EntityGUI_SurfFromFaceDlg.h
   EntityGUI_SubShapeDlg.h
   EntityGUI_PictureImportDlg.h
   ${FeatureDetectorDlg_moc_h}
@@ -142,6 +146,7 @@ SET(EntityGUI_SOURCES
   EntityGUI_PolylineDlg.cxx
   EntityGUI_3DSketcherDlg.cxx
   EntityGUI_IsolineDlg.cxx
+  EntityGUI_SurfFromFaceDlg.cxx
   EntityGUI_SubShapeDlg.cxx
   EntityGUI_PictureImportDlg.cxx
   ${FeatureDetectorDlg_Sources}
index 95e5f1565291de8638c77c8662733be89872fec9..54a8d68294423017fc7879ec75895e206f9a3e5f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -42,6 +42,7 @@
 #include <SUIT_ViewWindow.h>
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
+#include "utilities.h"
 
 #include <TopoDS_Shape.hxx>
 #include <TopoDS.hxx>
@@ -55,6 +56,7 @@
 #include "EntityGUI_SketcherDlg.h"        // Sketcher
 #include "EntityGUI_3DSketcherDlg.h"      // Sketcher
 #include "EntityGUI_IsolineDlg.h"         // Isoline
+#include "EntityGUI_SurfFromFaceDlg.h"    // Surface From Face
 #include "EntityGUI_SubShapeDlg.h"        // Method SUBSHAPE
 #include "EntityGUI_FeatureDetectorDlg.h" // Feature Detection
 #include "EntityGUI_PictureImportDlg.h"   // Import Picture in viewer
@@ -106,6 +108,9 @@ bool EntityGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   case GEOMOp::OpIsoline:    // ISOLINE
     aDlg = new EntityGUI_IsolineDlg( getGeometryGUI(), parent );
     break;
+  case GEOMOp::OpSurfaceFromFace:    // SURFACE FROM FACE
+    aDlg = new EntityGUI_SurfFromFaceDlg( getGeometryGUI(), parent );
+    break;
   case GEOMOp::OpExplode:    // EXPLODE
     aDlg = new EntityGUI_SubShapeDlg( getGeometryGUI(), parent );
     break;
index 2ee8ca0e31559774331ea4313360fefd625a66b0..567afc1e3824f4e6a8efa87cd541d14121f26b16 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 09b96a2949e22ceb57223417e90b7ec8b99f3ea1..861d7c5b3fd4edcfdb38d47a9a9a4d99be9587c7 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -60,7 +60,6 @@
 #include <AIS_Trihedron.hxx>
 #include <AIS_AngleDimension.hxx>
 #include <AIS_LengthDimension.hxx>
-#include <AIS_Drawer.hxx>
 #include <Geom_Axis2Placement.hxx>
 #include <Geom_Plane.hxx>
 #include <SelectMgr_Selection.hxx>
@@ -328,7 +327,7 @@ void EntityGUI_3DSketcherDlg::Init()
   myLengthPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
   myTextPrs = dynamic_cast<SOCC_Prs*>(((SOCC_Viewer*)(vw->getViewManager()->getViewModel()))->CreatePrs(0));
 
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+  localSelection(TopAbs_VERTEX);
 
   /* Get setting of step value from file configuration */
   double step = SUIT_Session::session()->resourceMgr()->doubleValue("Geometry", "SettingsGeomStep", 100.0);
@@ -824,7 +823,7 @@ void EntityGUI_3DSketcherDlg::ActivateThisDialog()
   connect(myGeomGUI->getApp()->selectionMgr(),
           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+  localSelection(TopAbs_VERTEX);
   GEOMBase_Helper::displayPreview(true, false, true, true, myLineWidth);
 }
 
index a60a8063fbbd40938e5aa9df3bfb71adb985f020..83cc8d06b6c877881846ba28871c82c06f9a791e 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 5636e4a18b9de510f6fd31b5d636cc7051defed8..00b35eaec64dfb4099a0f2d9c0a44693b78072be 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -26,7 +26,8 @@
 
 // SALOME includes
 #include "EntityGUI_FeatureDetectorDlg.h"
-#include <ShapeRec_FeatureDetector.hxx>
+#include "ShapeRec_FeatureDetector.hxx"
+#include "GEOM_Constants.h"
 
 #include <OCCViewer_ViewWindow.h>
 #include <OCCViewer_ViewManager.h>
@@ -399,7 +400,6 @@ void EntityGUI_FeatureDetectorDlg::SelectionIntoArgument()
   
   // TODO supprimer les lignes qui ne servent à rien le cas échéant
   SUIT_ViewWindow*       theViewWindow  = getDesktop()->activeWindow();
-  std::map< std::string , std::vector<Handle(AIS_InteractiveObject)> >::iterator AISit;
   SOCC_Viewer* soccViewer = (SOCC_Viewer*)(theViewWindow->getViewManager()->getViewModel());
 
   if (!myEditCurrentArgument->isEnabled())
@@ -433,24 +433,20 @@ void EntityGUI_FeatureDetectorDlg::SelectionIntoArgument()
     
     if ( myEditCurrentArgument == mySelectionGroup->LineEdit1 ) {
       myFace = aSelectedObject;
-      AISit = soccViewer->entry2aisobjects.find(myFaceEntry.toStdString());
-      if (AISit == soccViewer->entry2aisobjects.end())
+
+      SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+      if ( !study ) return;
+      LightApp_Application* app = ::qobject_cast<LightApp_Application*>( study->application() );
+      if ( !app ) return;
+      SUIT_ViewManager* vm = app->activeViewManager();
+      if ( !vm ) return;
+      PropMap propMap = study->getObjectProperties( vm->getGlobalId(), myFaceEntry );
+      QString theImgFileName = propMap.value( GEOM::propertyName( GEOM::Texture ) ).toString();
+      if ( theImgFileName.isEmpty() )
         return;
-      
-      Handle(AIS_InteractiveObject) myAIS = (*AISit).second[0];
-      Handle(GEOM_AISShape) myAISShape;
-      if( myAIS->IsInstance( STANDARD_TYPE(GEOM_AISShape) ) ) {
-        myAISShape = Handle(GEOM_AISShape)::DownCast( myAIS );
-      }
-      else
-        return ;
-      
-      std::string theImgFileName = myAISShape->TextureFile();      
-      if ( theImgFileName == "" )
-        return ;
 
       // Setting the image caracteristics
-      myDetector->SetPath( theImgFileName );
+      myDetector->SetPath( theImgFileName.toStdString() );
       height            =  myDetector->GetImgHeight();
       width             =  myDetector->GetImgWidth();
       pictureLeft       = -0.5 * width;              // X coordinate of the top left  corner of the background image in the view
@@ -948,3 +944,14 @@ bool EntityGUI_FeatureDetectorDlg::execute( ObjectList& objects )
   
   return res;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> EntityGUI_FeatureDetectorDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myFace;
+  return res;
+}
index c497136890ed2d89861cf313bb3e4eed60b9ce59..16d245cfc3013a58931593caed51376ead330b7e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -65,6 +65,7 @@ protected:
   // redefined from GEOMBase_Helper
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
   
 private:
   void                               Init();
index d940f5040604d77624ee311742efc3b8ef49f00b..6e887f941eca2fbbf3a3d11d8de88ea8fb4ca584 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -1982,3 +1982,15 @@ bool EntityGUI_FieldDlg::execute()
 
   return true;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> EntityGUI_FieldDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myField->GetShape());
+  res << aGeomObjPtr;
+  return res;
+}
index 0fab307296cc54c1659c0dd3af9f19d72cdae559..b59ee2a50434137a8e290de582c8feb6a492b326 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -70,6 +70,7 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr  createOperation();
   virtual bool                        isValid (QString&);
   virtual bool                        execute ();
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
 private slots:
   void                                ClickOnOk();
index bfd01773cf00975b6779a69a9f89affa41caa266..366e425a1cc1be9f444bcebdfa04aad84403c4ab 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -281,3 +281,14 @@ void EntityGUI_IsolineDlg::ValueChangedInSpinBox(double newValue)
 {
   displayPreview(true);
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> EntityGUI_IsolineDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myFace;
+  return res;
+}
index 30988fd794b097614054ea66dca116c08b6975f4..b177f98827dcd618f2bb0bff506134af34db8348 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -56,6 +56,8 @@ protected:
 
   virtual void                       addSubshapesToStudy();
 
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
+
 private:
 
   void                               Init();
index 5a7fe60ae39196ee0b8575b3f8aafe738b7133e9..425980457585b2c014c3e46fe8d55f09eb9cc64b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -34,6 +34,7 @@
 #include <SUIT_Session.h>
 #include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
+#include "utilities.h"
 
 #include <TopoDS_Shape.hxx>
 #include <TopoDS.hxx>
@@ -187,9 +188,9 @@ bool EntityGUI_PictureImportDlg::execute( ObjectList& objects )
   delete pixmap;
   
   GEOM::GEOM_Object_var P1 = aBasicOperations->MakePointXYZ( -0.5*width, -0.5*height, 0 );
-  GEOM::GEOM_Object_var P2 = aBasicOperations->MakePointXYZ( -0.5*width,  0.5*height, 0 );
+  GEOM::GEOM_Object_var P2 = aBasicOperations->MakePointXYZ(  0.5*width, -0.5*height, 0 );
   GEOM::GEOM_Object_var P3 = aBasicOperations->MakePointXYZ(  0.5*width,  0.5*height, 0 );
-  GEOM::GEOM_Object_var P4 = aBasicOperations->MakePointXYZ(  0.5*width, -0.5*height, 0 );
+  GEOM::GEOM_Object_var P4 = aBasicOperations->MakePointXYZ( -0.5*width,  0.5*height, 0 );
   
   GEOM::GEOM_Object_var aFace = aBlocksOperations->MakeQuad4Vertices(P1,P2,P3,P4);
   getDisplayer()->SetDisplayMode(3);
index 6024bd374b12c65f573ff6c231528a3168326ebb..cf7fa854f20a2b2bdd209a0cee424c21306d0ef6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 50c12462aadc4ca76951653c1ae0c791e2bbd1f7..ed2f4ee3696445808775e8f2e869d02106f4827c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -6,7 +6,7 @@
 // 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.
+// 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
 
 #include "EntityGUI_PolylineDlg.h"
 #include <CurveCreator_Curve.hxx>
+#include <CurveCreator_Displayer.hxx>
 #include <CurveCreator_Utils.hxx>
 #include <CurveCreator_Widget.h>
 #include <DlgRef.h>
 #include <GeometryGUI.h>
 #include <GEOMBase.h>
 
+#include "utilities.h"
+
 #include <OCCViewer_ViewManager.h>
 #include <LightApp_SelectionMgr.h>
 #include <SalomeApp_Application.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
+#include "utilities.h"
 
 #include <BRep_Tool.hxx>
 #include <Geom_Surface.hxx>
 #include <GeomLib_IsPlanarSurface.hxx>
+#include <Prs3d_LineAspect.hxx>
 #include <TopoDS.hxx>
 
 #include <QGroupBox>
@@ -60,7 +65,9 @@ EntityGUI_PolylineDlg::EntityGUI_PolylineDlg
     myWPlaneLineEdit      (0),
     myPolylineSelButton   (0),
     myPolylineEdit        (0),
-    myEditCurrentArgument (0)
+    myEditCurrentArgument (0),
+    myPreviewManager(0),
+    myPreviewZLayer(-1)
 {
   QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_CC_POLYLINE")));
   QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
@@ -75,7 +82,7 @@ EntityGUI_PolylineDlg::EntityGUI_PolylineDlg
   mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
   mainFrame()->RadioButton3->close();
 
-  QGroupBox   *aGroupBox1 = new QGroupBox(tr("GEOM_CS"), this);
+  QGroupBox   *aGroupBox1 = new QGroupBox(this);
   QGridLayout *aPlaneLayout = new QGridLayout(aGroupBox1);
 
   aPlaneLayout->setSpacing(6);
@@ -88,6 +95,13 @@ EntityGUI_PolylineDlg::EntityGUI_PolylineDlg
   myPlnButton->setText( tr( "GEOM_SKETCHER_RESTORE" ) );
   aPlaneLayout->addWidget(myPlnButton, 0, 3);
 
+  bool isCS = false;
+#ifdef SET_PLANE
+  isCS = true;
+#endif
+  myPlnComboBox->setVisible( isCS );
+  myPlnButton->setVisible( isCS );
+
 #ifdef SET_PLANE
   QLabel *aPlaneLbl = new QLabel(tr("GEOM_PLANE"), aGroupBox1);
 
@@ -101,6 +115,7 @@ EntityGUI_PolylineDlg::EntityGUI_PolylineDlg
 
   myPolylineSelButton = new QPushButton (aGroupBox1);
   myPolylineSelButton->setIcon(image1);
+  myPolylineSelButton->setCheckable(true);
   myPolylineEdit = new QLineEdit (aGroupBox1);
   myPolylineEdit->setReadOnly(true);
 
@@ -136,7 +151,7 @@ EntityGUI_PolylineDlg::EntityGUI_PolylineDlg
 
   setHelpFileName( "create_polyline_page.html" );
 
-  /* Initialisations */
+  /* Initializations */
   Init();
 }
 
@@ -146,7 +161,8 @@ EntityGUI_PolylineDlg::EntityGUI_PolylineDlg
 //=================================================================================
 EntityGUI_PolylineDlg::~EntityGUI_PolylineDlg()
 {
-  delete myCurve;
+  erasePreview();
+  myEditorWidget->SetViewer2DMode(false);
 }
 
 //=================================================================================
@@ -163,6 +179,7 @@ void EntityGUI_PolylineDlg::Init()
   LightApp_SelectionMgr *aSelMgr = myGeomGUI->getApp()->selectionMgr();
 
   myEditorWidget->setOCCViewer(aViewManager ? aViewManager->getOCCViewer() : 0);
+  setPreviewManager( aViewManager );
 
   // Init the list of local coordinate system
   gp_Pnt aPnt(0., 0., 0.);
@@ -175,35 +192,32 @@ void EntityGUI_PolylineDlg::Init()
   myWPlaneList.push_back(GEOM::GeomObjPtr());
   myLCSList.push_back(aLCS);
 
-  connect(myGeomGUI,      SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
-  connect(myGeomGUI,      SIGNAL(SignalCloseAllDialogs()),        this, SLOT(ClickOnCancel()));
-
 #ifdef SET_PLANE
-  connect(myPlnSelButton, SIGNAL(clicked()),
-          this,           SLOT(SetEditCurrentArgument()));
+  connect( myPlnSelButton, SIGNAL(toggled(bool)),
+           this,           SLOT(SetEditCurrentArgument(bool)) );
 #endif
-  connect(myPolylineSelButton, SIGNAL(clicked()),
-          this,                SLOT(SetEditCurrentArgument()));
-  connect(aSelMgr,        SIGNAL(currentSelectionChanged()),
-          this,           SLOT(SelectionIntoArgument()));
-  connect(myEditorWidget, SIGNAL(subOperationStarted(QWidget*, bool)),
-          this,           SLOT(processStartedSubOperation(QWidget*, bool)));
-  connect(myEditorWidget, SIGNAL(subOperationFinished(QWidget*)),
-          this,           SLOT(processFinishedSubOperation(QWidget*)));
-  connect(myEditorWidget, SIGNAL(curveModified()),
-          this,           SLOT(onUpdatePreview()));
+  connect( myPolylineSelButton, SIGNAL(toggled(bool)),
+           this,                SLOT(SetEditCurrentArgument(bool)) );
+  connect( aSelMgr, SIGNAL(currentSelectionChanged()),
+           this,    SLOT(SelectionIntoArgument()) );
+  connect( myEditorWidget, SIGNAL(subOperationStarted(QWidget*, bool)),
+           this,           SLOT(processStartedSubOperation(QWidget*, bool)) );
+  connect( myEditorWidget, SIGNAL(subOperationFinished(QWidget*)),
+           this,           SLOT(processFinishedSubOperation(QWidget*)) );
 #ifdef SET_PLANE
-  connect(myPlnComboBox,  SIGNAL(activated(int)),
-          this,           SLOT(ActivateLocalCS()));
-  connect(myPlnButton,    SIGNAL(clicked()),
-          this,           SLOT(ActivateLocalCS()));
+  connect( myPlnComboBox,  SIGNAL(activated(int)),
+           this,           SLOT(ActivateLocalCS()) );
+  connect( myPlnButton,    SIGNAL(clicked()),
+           this,           SLOT(ActivateLocalCS()) );
 #endif
-  connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+  connect( buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()) );
+  connect( buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()) );
 
   myAddElementBox->hide();
-  myPolylineSelButton->click();
-  SelectionIntoArgument();
+
+  // Processing of the selected object
+  myPolylineSelButton->setChecked( true );
+  SelectionIntoArgument( true );
 }
 
 //=================================================================================
@@ -362,17 +376,10 @@ bool EntityGUI_PolylineDlg::ClickOnApply()
 
   initName();
 
-  return true;
-}
+  // Reset actions
+  myEditorWidget->reset();
 
-//=================================================================================
-// function : ClickOnCancel()
-// purpose  :
-//=================================================================================
-void EntityGUI_PolylineDlg::ClickOnCancel()
-{
-  myEditorWidget->SetViewer2DMode(false);
-  GEOMBase_Skeleton::ClickOnCancel();
+  return true;
 }
 
 //=================================================================================
@@ -429,17 +436,19 @@ bool EntityGUI_PolylineDlg::deleteEnabled()
 // function : SelectionIntoArgument
 // purpose  : Called when selection is changed
 //=================================================================================
-void EntityGUI_PolylineDlg::SelectionIntoArgument()
+void EntityGUI_PolylineDlg::SelectionIntoArgument( bool isForced )
 {
-  bool             isModified      = false;
+  bool             isModified      = isForced;
   GEOM::GeomObjPtr aSelectedObject = getSelected(TopAbs_SHAPE);
   TopoDS_Shape     aShape;
 
   if (aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) &&
-      !aShape.IsNull()) {
+      !aShape.IsNull())
+  {
     QString aName = GEOMBase::GetName(aSelectedObject.get()); 
 
-    if (myEditCurrentArgument == myPolylineEdit) {
+    if ( myEditCurrentArgument == myPolylineEdit && isCheckToSelect() )
+    {
       // Import a curve
       CurveCreator_Curve *aNewCurve = 
         new CurveCreator_Curve(CurveCreator::Dim2d);
@@ -455,15 +464,22 @@ void EntityGUI_PolylineDlg::SelectionIntoArgument()
 #ifdef SET_PLANE
         AddLocalCS(aSelectedObject.get(), false, aLocalCS);
         myWPlaneLineEdit->clear();
-        myPlnSelButton->setDown(false);
+        myPlnSelButton->setChecked(false);
 #endif
-        myPolylineSelButton->setDown(true);
+        myPolylineSelButton->setChecked(false);
+
+        disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+        myGeomGUI->getApp()->selectionMgr()->clearSelected();
+        connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+                this, SLOT(SelectionIntoArgument()));
       } else {
         // Does nothing, just clears selection.
         delete aNewCurve;
       }
+    }
 #ifdef SET_PLANE
-    } else if (myEditCurrentArgument == myWPlaneLineEdit) {
+    else if ( myEditCurrentArgument == myWPlaneLineEdit && isCheckToSelect() )
+    {
       // Import planar face.
       if (aShape.ShapeType() == TopAbs_FACE) {
         // Check if the face is planar
@@ -476,47 +492,65 @@ void EntityGUI_PolylineDlg::SelectionIntoArgument()
           AddLocalCS(aSelectedObject.get(), true, 
                      WPlaneToLCS(aSelectedObject.get()));
           isModified = true;
-          myPlnSelButton->setDown(true);
-          myPolylineSelButton->setDown(false);
+          myPlnSelButton->setChecked(false);
+          myPolylineSelButton->setChecked(false);
         }
       }
       
       if (!isModified) {
         myEditCurrentArgument->setText(tr("GEOM_SKETCHER_WPLANE"));
       }
+    }
+#endif
+  }
+  else
+  {
+    if (isForced)
+    {
+#ifdef SET_PLANE
+      myPlnSelButton->setChecked(false);
 #endif
+      myPolylineSelButton->setChecked(false);
     }
   }
 
-  if (!isModified) {
+  if (!isModified)
+  {
     // Does nothing, just clears selection.
     disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
     myGeomGUI->getApp()->selectionMgr()->clearSelected();
     connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
             this, SLOT(SelectionIntoArgument()));
   }
+  else
+    displayPreview();
 }
 
 //=================================================================================
 // function : SetEditCurrentArgument()
 // purpose  :
 //=================================================================================
-void EntityGUI_PolylineDlg::SetEditCurrentArgument()
+void EntityGUI_PolylineDlg::SetEditCurrentArgument( bool isChecked )
 {
-  if (sender() == myPlnSelButton) {
+  if (sender() == myPlnSelButton)
+  {
 #ifdef SET_PLANE
     myEditCurrentArgument = myWPlaneLineEdit;
     myEditCurrentArgument->setFocus();
-    myPlnSelButton->setDown(true);
-    myPolylineSelButton->setDown(false);
+    myPolylineSelButton->blockSignals(true);
+    myPolylineSelButton->setChecked(false);
+    myPolylineSelButton->blockSignals(false);
 #endif
-  } else if (sender() == myPolylineSelButton) {
+  }
+  else if (sender() == myPolylineSelButton)
+  {
     myEditCurrentArgument = myPolylineEdit;
     myEditCurrentArgument->setFocus();
 #ifdef SET_PLANE
-    myPlnSelButton->setDown(false);
+    myPlnSelButton->blockSignals(true);
+    myPlnSelButton->setChecked(false);
+    myPlnSelButton->blockSignals(false);
 #endif
-    myPolylineSelButton->setDown(true);
   }
 }
 
@@ -542,15 +576,6 @@ void EntityGUI_PolylineDlg::enterEvent (QEvent*)
     ActivateThisDialog();
 }
 
-//=================================================================================
-// function : onUpdatePreview
-// purpose  : 
-//=================================================================================
-void EntityGUI_PolylineDlg::onUpdatePreview()
-{
-  displayPreview(true);
-}
-
 //=================================================================================
 // function : ActivateLocalCS
 // purpose  : Activate & Fit Working plane
@@ -668,3 +693,136 @@ gp_Ax3 EntityGUI_PolylineDlg::WPlaneToLCS(GEOM::GeomObjPtr theGeomObj)
 
   return aLCS;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> EntityGUI_PolylineDlg::getSourceObjects()
+{
+  return myWPlaneList;
+}
+
+//=================================================================================
+// function : setPreviewManager ( OCCViewer_ViewManager )
+// purpose  : Sets view manager to control the displayed objects.
+//=================================================================================
+void EntityGUI_PolylineDlg::setPreviewManager( OCCViewer_ViewManager* theManager )
+{
+  myPreviewManager = theManager;
+
+  if ( getPreviewManager() )
+  {
+    if( OCCViewer_Viewer* aViewer = getPreviewManager()->getOCCViewer() )
+    {
+      Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
+      if( !aCtx.IsNull() )
+      {
+        // Add Z layer to show temporary objects
+        int aZLayer = -1;
+        aViewer->getViewer3d()->AddZLayer( aZLayer );
+        setPreviewZLayer( aZLayer );
+      }
+    }
+  }
+}
+
+//=================================================================================
+// function : getPreviewManager()
+// purpose  : 
+//=================================================================================
+OCCViewer_ViewManager* EntityGUI_PolylineDlg::getPreviewManager()
+{
+  return myPreviewManager;
+}
+
+//=================================================================================
+// function : setPreviewZLayer( theZLayer )
+// purpose  : Sets Z layer to show temporary objects.
+//=================================================================================
+void EntityGUI_PolylineDlg::setPreviewZLayer( int theZLayer )
+{
+  if ( theZLayer != myPreviewZLayer )
+    myPreviewZLayer = theZLayer;
+}
+
+//=================================================================================
+// function : getPreviewZLayer()
+// purpose  : 
+//=================================================================================
+int EntityGUI_PolylineDlg::getPreviewZLayer() const
+{
+  return myPreviewZLayer;
+}
+
+//=================================================================================
+// function : displayPreview()
+// purpose  : 
+//=================================================================================
+void EntityGUI_PolylineDlg::displayPreview()
+{
+  if ( getPreviewManager() )
+  {
+    if ( OCCViewer_Viewer* aViewer = getPreviewManager()->getOCCViewer() )
+    {
+      // Disable changing of OCCViewer's selection to use vertex of curve selection
+      disconnect(getPreviewManager(), SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
+                 aViewer,             SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
+
+      Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
+      if ( !aCtx.IsNull() )
+      {
+        CurveCreator_Displayer* aDisplayer = new CurveCreator_Displayer( aCtx, getPreviewZLayer() );
+        myCurve->setDisplayer( aDisplayer );
+
+        Handle(AIS_InteractiveObject) anAISObj = myCurve->getAISObject( true );
+        aDisplayer->display( anAISObj, true );
+
+        // Set color for temporary AIS_InteractiveObject
+        anAISObj->Attributes()->WireAspect()->SetColor( Quantity_NOC_VIOLET );
+        aCtx->Redisplay( anAISObj );
+      }
+    }
+  }
+}
+
+//=================================================================================
+// function : erasePreview()
+// purpose  : 
+//=================================================================================
+void EntityGUI_PolylineDlg::erasePreview()
+{
+  CurveCreator_Displayer* aDisplayer = myCurve ? myCurve->getDisplayer() : 0;
+  if( getPreviewManager() )
+  {
+    if( OCCViewer_Viewer* aViewer = getPreviewManager()->getOCCViewer() )
+    {
+      Handle(AIS_InteractiveContext) aCtx = aViewer->getAISContext();
+      if( !aCtx.IsNull() && aDisplayer )
+        aDisplayer->eraseAll( true );
+
+      // Enable changing of OCCViewer's selection
+      connect(getPreviewManager(), SIGNAL(mouseRelease(SUIT_ViewWindow*, QMouseEvent*)),
+              aViewer,             SLOT(onMouseRelease(SUIT_ViewWindow*, QMouseEvent*)));
+    }
+  }
+
+  setPreviewManager( NULL );
+  if ( myCurve )
+  {
+    delete myCurve;
+    myCurve = NULL;
+  }
+}
+
+//=================================================================================
+// function : isCheckToSelect()
+// purpose  : 
+//=================================================================================
+bool EntityGUI_PolylineDlg::isCheckToSelect()
+{
+#ifdef SET_PLANE
+  return myPlnSelButton->isChecked();
+#endif
+  return myPolylineSelButton->isChecked();
+}
index 6f7b009a5faadb6a8928992adad258d8085b42d4..3172a040bd8be89773bddbf56f63b8fb57a5a26b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -6,7 +6,7 @@
 // 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.
+// 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
 #ifndef ENTITYGUI_POLYLINEDLG_H
 #define ENTITYGUI_POLYLINEDLG_H
 
-
 #include <GEOMBase_Skeleton.h>
 
 class CurveCreator_Curve;
 class CurveCreator_Widget;
+class OCCViewer_ViewManager;
 class QGroupBox;
 class QComboBox;
 
-
 //=================================================================================
 // class    : EntityGUI_PolylineDlg
 // purpose  :
@@ -50,13 +49,31 @@ public:
   void  deleteSelected();
   bool  deleteEnabled();
 
+  void  setPreviewZLayer( int theLayer );
+  int   getPreviewZLayer() const;
+
 protected:
 
   // redefined from GEOMBase_Helper
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
-       
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
+
+  /**
+   * This method sets/gets the view manager to control the temporary
+   * displayed objects on Z layer. 
+   * \param theManager the view manager.
+   */
+  void                   setPreviewManager( OCCViewer_ViewManager* theManager );
+  OCCViewer_ViewManager* getPreviewManager();
+
+  /**
+   * This method defines a state of selection button.
+   * \return true if selection button is checked, otherwise false.
+   */
+  bool isCheckToSelect();
+
 private:
 
   void Init();
@@ -102,7 +119,7 @@ private:
    * This method add a local coordinate system of the selected object.
    *
    * \param theSelectedObject the selected object. It can be a planar face
-   *        or an inported polyline.
+   *        or an imported polyline.
    * \param IsPlane true for planar face; false for imported polyline.
    * \param theLCS the local coordinate system.
    */
@@ -119,17 +136,27 @@ private:
    */
   gp_Ax3 WPlaneToLCS(GEOM::GeomObjPtr theGeomObj);
 
+  /**
+   * This method displays the AIS_InteractiveObject(s) to preview
+   * on the Z layer and sets VIOLET color.
+   */
+  void displayPreview();
+
+  /**
+   * This method erases AIS_InteractiveObject(s) from
+   * AIS_InteractiveContext and release memory.
+   */
+  void erasePreview();
+
 protected slots:
 
   void ClickOnOk();
   bool ClickOnApply();
-  void ClickOnCancel();
   void processStartedSubOperation( QWidget*, bool );
   void processFinishedSubOperation( QWidget* );
-  void SetEditCurrentArgument();
-  void SelectionIntoArgument();
+  void SetEditCurrentArgument( bool );
+  void SelectionIntoArgument( bool isForced = false );
   void ActivateThisDialog();
-  void onUpdatePreview();
   void ActivateLocalCS();
 
 private:
@@ -146,6 +173,8 @@ private:
   QLineEdit                    *myEditCurrentArgument;   /* Current LineEdit */
   QList<gp_Ax3>                 myLCSList;
   QList<GEOM::GeomObjPtr>       myWPlaneList;
+  OCCViewer_ViewManager*        myPreviewManager;
+  int                           myPreviewZLayer;
 
 };
 
index fde880b435ff86b93d04d8b036b20a894c0f582e..6b0248b08c2c9986ec43ec78cd3f5f11890ecb83 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -47,6 +47,7 @@
 #include <SalomeApp_Application.h>
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
+#include "utilities.h"
 
 #include <DlgRef.h>
 
@@ -64,6 +65,7 @@
 
 #include <SalomeApp_Study.h>
 #include <SalomeApp_Tools.h>
+#include "utilities.h"
 
 #include <gp_Pln.hxx>
 
@@ -539,7 +541,7 @@ void EntityGUI_SketcherDlg::InitClick()
   Group4Spin->hide();
   GroupRect->hide();
   globalSelection(); // close local selection to clear it
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 }
 
 
@@ -630,15 +632,14 @@ void EntityGUI_SketcherDlg::RectClicked()
        SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
   
   GroupRect->show();
-  
   myX1=0;
-  myX2=10;
-  myY1=0;
-  myY2=10;
-
   GroupRect->SpinBox_DX1->setValue(myX1); 
+  myY1=0;
   GroupRect->SpinBox_DY1->setValue(myY1);
+  myX2=10;
   GroupRect->SpinBox_DX2->setValue(myX2);
+  myY2=10;
   GroupRect->SpinBox_DY2->setValue(myY2);
   
   resize( minimumSizeHint() );
@@ -1570,7 +1571,7 @@ void EntityGUI_SketcherDlg::SetEditCurrentArgument()
     selButton->setDown(true);
   }
   globalSelection(); // close local selection to clear it
-  localSelection(GEOM::GEOM_Object::_nil(), myNeedType);
+  localSelection( myNeedType );
 }
 
 
@@ -2258,7 +2259,7 @@ QString EntityGUI_SketcherDlg::GetNewCommand( QString& theParameters )
                                   + ":TT " + QString::number( myX2, Format, DigNum) + " " + QString::number( myY1, Format, DigNum)
                                   + ":WW";
                           
-      theParameters = myX1Str + ":" + myY1Str + ":" + myX2Str + ":" + myY2Str ;
+      theParameters = myX1Str + ":" + myY1Str + ":" + myX1Str + ":" + myY2Str + ":" + myX2Str + ":" + myY2Str + ":" + myX2Str + ":" + myY1Str;
     }
   return myNewCommand;
 }
index 773b4dde810ef52f641e3663c9ed36f2ce46619e..6aa9c2ae846fe84a58b8143aea023904b9959537 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 667ddd30307ce720a3d6426ed78b44dbfccdd7f0..085028ce12a02984a2b90971e09b9902d2360cbb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <DlgRef.h>
 #include <GeometryGUI.h>
 #include <GEOMBase.h>
+#include <GEOMUtils.hxx>
+#ifndef DISABLE_PLOT2DVIEWER
+  #include <MeasureGUI_ShapeStatisticsDlg.h>
+#endif
 
 #include <OCCViewer_ViewModel.h>
 #include <SVTK_ViewModel.h>
@@ -36,6 +40,7 @@
 #include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 #include <SALOME_ListIO.hxx>
+#include <SUIT_MessageBox.h>
 
 #include <SUIT_Desktop.h>
 #include <SUIT_ResourceMgr.h>
 
 #include <TColStd_IndexedMapOfInteger.hxx>
 
-#include <QMessageBox>
-
 #include <GEOMImpl_Types.hxx>
 
+namespace
+{
+  const char* const ShapeTypes [] = {
+    "Compound",
+    "Compsolid",
+    "Solid",
+    "Shell",
+    "Face",
+    "Wire",
+    "Edge",
+    "Vertex",
+    "Shape",
+    "Flat"
+  };
+
+  enum { Filter_LT, Filter_LE, Filter_GT, Filter_GE };
+
+  unsigned int NumberOfSubShapes(const TopoDS_Shape& S, const int shapeType, TopTools_MapOfShape& M)
+  {
+    unsigned int index = 0;
+
+    if (!S.IsNull()) {
+      if (S.ShapeType() == TopAbs_COMPOUND &&
+          (shapeType == TopAbs_SHAPE || shapeType == TopAbs_FLAT || shapeType == TopAbs_COMPOUND)) {
+        TopoDS_Iterator It(S, Standard_True, Standard_True);
+        for (; It.More(); It.Next()) {
+          TopoDS_Shape SS = It.Value();
+          if (M.Add(SS)) {
+            if (shapeType == TopAbs_FLAT) {
+              if (SS.ShapeType() != TopAbs_COMPOUND)
+                index++;
+              else
+                index += NumberOfSubShapes(SS, shapeType, M);
+            }
+            else if (shapeType == TopAbs_SHAPE || shapeType == SS.ShapeType()) {
+              index++;
+            }
+          }
+        }
+      }
+      else {
+        TopExp_Explorer Exp (S, TopAbs_ShapeEnum(shapeType));
+        for (; Exp.More(); Exp.Next()) {
+          if (M.Add(Exp.Current())) {
+            index++;
+          }
+        }
+      }
+    }
+    return index;
+  }
+  unsigned int NumberOfSubShapes(const TopoDS_Shape& S, const int shapeType)
+  {
+    TopTools_MapOfShape M;
+    return NumberOfSubShapes(S, shapeType, M);
+  }
+}
+
 //=================================================================================
 // class    : EntityGUI_SubShapeDlg
 // purpose  : Constructs a EntityGUI_SubShapeDlg which is a child of 'parent', with the
@@ -66,7 +127,6 @@ EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidge
                                               bool modal, Qt::WindowFlags fl)
   : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
     myDmMode( -1 ),
-    myWithShape(true),
     myIsHiddenMain(false)
 {
   QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_SUBSHAPE")));
@@ -94,9 +154,40 @@ EntityGUI_SubShapeDlg::EntityGUI_SubShapeDlg(GeometryGUI* theGeometryGUI, QWidge
   GroupPoints->PushButton4->setText(tr("SHOW_ALL_SUB_SHAPES"));
   GroupPoints->LineEdit1->setReadOnly(true);
 
+  //filter group
+
+  myFilterGrp = new QGroupBox(tr("GEOM_FILTER"), centralWidget());
+  myLessFilterCheck = new QCheckBox(myFilterGrp);
+  myLessFilterCombo = new QComboBox(myFilterGrp);
+  myLessFilterCombo->addItem( tr("GEOM_LESS_THAN"), Filter_LT );
+  myLessFilterCombo->addItem( tr("GEOM_LESSOREQUAL_THAN"), Filter_LE );
+  myGreaterFilterCheck = new QCheckBox(myFilterGrp);
+  myGreaterFilterCombo = new QComboBox(myFilterGrp);
+  myGreaterFilterCombo->addItem( tr("GEOM_GREAT_THAN"), Filter_GT );
+  myGreaterFilterCombo->addItem( tr("GEOM_GREATOREQUAL_THAN"), Filter_GE );
+  myLessFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
+  myGreaterFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
+  myApplyFilterButton = new QPushButton(tr("GEOM_BUT_APPLY"), myFilterGrp);
+#ifndef DISABLE_PLOT2DVIEWER
+  myPlotDistributionButton = new QPushButton(tr("GEOM_PLOT_DISTRIBUTION"), myFilterGrp);
+#endif
+
+  QGridLayout* filterLayout = new QGridLayout(myFilterGrp);
+  filterLayout->addWidget(myLessFilterCheck,    0, 0);
+  filterLayout->addWidget(myLessFilterCombo,    0, 1);
+  filterLayout->addWidget(myLessFilterSpin,     0, 2);
+  filterLayout->addWidget(myGreaterFilterCheck, 1, 0);
+  filterLayout->addWidget(myGreaterFilterCombo, 1, 1);
+  filterLayout->addWidget(myGreaterFilterSpin,  1, 2);
+  filterLayout->addWidget(myApplyFilterButton,  0, 3);
+#ifndef DISABLE_PLOT2DVIEWER
+  filterLayout->addWidget(myPlotDistributionButton,  1, 3);
+#endif
+
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
   layout->addWidget(GroupPoints);
+  layout->addWidget(myFilterGrp);
   /***************************************************************/
 
   setIsOptimizedBrowsing(true);
@@ -128,23 +219,24 @@ EntityGUI_SubShapeDlg::~EntityGUI_SubShapeDlg()
 //=================================================================================
 void EntityGUI_SubShapeDlg::Init()
 {
+  // Get setting of step value from file configuration
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
+
+  // min, max, step and decimals for spin boxes
+  initSpinBox(myLessFilterSpin, 0., COORD_MAX, step, "length_precision" );
+  initSpinBox(myGreaterFilterSpin, 0., COORD_MAX, step, "length_precision" );
+  myLessFilterSpin->setValue( 0. );
+  myGreaterFilterSpin->setValue( 0. );
+
   /* init variables */
   myDmMode = -1;
   myEditCurrentArgument = GroupPoints->LineEdit1;
   myObject = GEOM::GEOM_Object::_nil();
 
-  myWithShape = true;
-
   /* type for sub-shape selection */
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Compound");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Compsolid");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Solid");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Shell");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Face");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Wire");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Edge");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Vertex");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Shape");
+  for ( int i = 0; i <= (int)GEOM::FLAT; i++ )
+    GroupPoints->ComboBox1->addItem(ShapeTypes[i], i);
 
   if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType()
       != OCCViewer_Viewer::Type())
@@ -166,12 +258,21 @@ void EntityGUI_SubShapeDlg::Init()
   connect(GroupPoints->PushButton3, SIGNAL(clicked()), this, SLOT(showOnlySelected()));
   connect(GroupPoints->PushButton4, SIGNAL(clicked()), this, SLOT(showOnlySelected()));
 
+  connect(myApplyFilterButton, SIGNAL(clicked()),         this, SLOT(ClickOnOkFilter()));
+#ifndef DISABLE_PLOT2DVIEWER
+  connect(myPlotDistributionButton, SIGNAL(clicked()),    this, SLOT(ClickOnPlot()));
+#endif
+  connect(myLessFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
+  connect(myGreaterFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
+
   connect(myGeomGUI->getApp()->selectionMgr(),
           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
   updateButtonState();
   resize(100,100);
   SelectionIntoArgument();
+  SubShapeToggled();
+  MeasureToggled();
 }
 
 //=================================================================================
@@ -223,18 +324,17 @@ void EntityGUI_SubShapeDlg::ClickOnOk()
     /* More than 30 sub-shapes : ask confirmation */
     unsigned int nb = NumberOfSubShapes(myShape, shapeType());
     if (nb > 30) {
-      const QString caption = tr("GEOM_CONFIRM");
-      const QString text = tr("GEOM_CONFIRM_INFO").arg(nb);
-      const QString button0 = tr("GEOM_BUT_EXPLODE");
-      const QString button1 = tr("GEOM_BUT_CANCEL");
-
-      if (QMessageBox::warning(this, caption, text, button0, button1) != 0)
+      if (SUIT_MessageBox::question( this,
+                                     tr("GEOM_CONFIRM"),
+                                     tr("GEOM_CONFIRM_INFO").arg(nb),
+                                     tr("GEOM_BUT_EXPLODE"),
+                                     tr("GEOM_BUT_CANCEL") ) != 0 )
         isOk = false;  /* aborted */
     }
   }
 
   if (isOk)
-    isOk = onAccept();
+    isOk = onAccept( true, true, false );
 
   if (isOk)
     ClickOnCancel();
@@ -253,12 +353,11 @@ bool EntityGUI_SubShapeDlg::ClickOnApply()
     /* More than 30 sub-shapes : ask confirmation */
     unsigned int nb = NumberOfSubShapes(myShape, shapeType());
     if (nb > 30) {
-      const QString caption = tr("GEOM_CONFIRM");
-      const QString text = tr("GEOM_CONFIRM_INFO").arg(nb);
-      const QString button0 = tr("GEOM_BUT_EXPLODE");
-      const QString button1 = tr("GEOM_BUT_CANCEL");
-
-      if (QMessageBox::warning(this, caption, text, button0, button1) != 0)
+      if (SUIT_MessageBox::question( this,
+                                     tr("GEOM_CONFIRM"),
+                                     tr("GEOM_CONFIRM_INFO").arg(nb),
+                                     tr("GEOM_BUT_EXPLODE"),
+                                     tr("GEOM_BUT_CANCEL") ) != 0 )
         return false;  /* aborted */
     }
   }
@@ -282,6 +381,8 @@ void EntityGUI_SubShapeDlg::SelectionIntoArgument()
   if (!isAllSubShapes())
     return;
 
+  int currentType = GroupPoints->ComboBox1->itemData( GroupPoints->ComboBox1->currentIndex() ).toInt();
+
   ResetStateOfDialog();
 
   QString aString = ""; /* name of selection */
@@ -291,87 +392,47 @@ void EntityGUI_SubShapeDlg::SelectionIntoArgument()
   aSelMgr->selectedObjects(aSelList);
 
   int nbSel = GEOMBase::GetNameOfSelectedIObjects(aSelList, aString, true);
-  if (nbSel != 1)
-    return;
-
-  Handle(SALOME_InteractiveObject) IO = aSelList.First();
-  if (!IO->hasEntry()) {
-    SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
-    updateButtonState();
-    return;
-  }
-
-  if (myIsHiddenMain) {
-    GEOM_Displayer* aDisplayer = getDisplayer();
-    aDisplayer->Display(myObject);
-    myIsHiddenMain = false;
-  }
-
-  TopoDS_Shape S = GEOMBase::GetTopoFromSelection(aSelList);
-  if (S.IsNull() || S.ShapeType() == TopAbs_VERTEX) {
-    myObject = GEOM::GEOM_Object::_nil();
-    updateButtonState();
-    return;
-  }
-
-  myObject = GEOMBase::ConvertIOinGEOMObject(IO);
-  if (myObject->_is_nil()) {
-    updateButtonState();
-    return;
-  }
-
-  myShape = S;
-  GroupPoints->LineEdit1->setText(aString);
-
-  int SelectedShapeType = GroupPoints->ComboBox1->currentIndex();
-  int count = GroupPoints->ComboBox1->count();
-
-  if (myWithShape)
-    count = count - 1;
-
-  int i = 0;
-  // Solving PAL5590
-  if (myShape.ShapeType() == TopAbs_COMPOUND) {
-    unsigned int nb = NumberOfSubShapes(myShape, TopAbs_COMPOUND);
-    if (nb > 0)
-      i++;
-  }
-  while (i <= myShape.ShapeType()) {
-    GroupPoints->ComboBox1->removeItem(0);
-    i++;
-  }
-
-  if (myShape.ShapeType() == TopAbs_COMPOUND) {
-    if (myWithShape == false) {
-      GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Shape");
-      myWithShape = true;
-    }
-  }
-  else {
-    if (myWithShape == true) {
-      GroupPoints->ComboBox1->removeItem(GroupPoints->ComboBox1->count() - 1);
-      myWithShape = false;
+  if (nbSel == 1) {
+    Handle(SALOME_InteractiveObject) IO = aSelList.First();
+    if (!IO->hasEntry()) {
+      SUIT_Session::session()->activeApplication()->putInfo(tr("GEOM_PRP_SHAPE_IN_STUDY"));
     }
-  }
-
-  int count1 = GroupPoints->ComboBox1->count();
-  if (myWithShape)
-    count1 = count1 - 1;
-
-  if (SelectedShapeType > myShape.ShapeType()) {
-    if (SelectedShapeType == 8) {
-      if (myShape.ShapeType() != TopAbs_COMPOUND) {
-        GroupPoints->ComboBox1->setCurrentIndex(0);
-        ComboTextChanged();
+    else {
+      TopoDS_Shape S = GEOMBase::GetTopoFromSelection(aSelList);
+      if (S.IsNull() || S.ShapeType() == TopAbs_VERTEX) {
+        myObject = GEOM::GEOM_Object::_nil();
       }
-    }
-    else
-      GroupPoints->ComboBox1->setCurrentIndex(count1 - count + SelectedShapeType);
-  }
-  else {
-    GroupPoints->ComboBox1->setCurrentIndex(0);
-    ComboTextChanged();
-  }
+      else {
+        myObject = GEOMBase::ConvertIOinGEOMObject(IO);
+        if (!CORBA::is_nil(myObject)) {
+          myShape = S;
+          GroupPoints->LineEdit1->setText(aString);
+          int i = 0;
+          // Solving PAL5590
+          if (myShape.ShapeType() == TopAbs_COMPOUND) {
+            unsigned int nb = NumberOfSubShapes(myShape, TopAbs_COMPOUND);
+            if (nb > 0)
+              i++;
+          }
+          while (i <= myShape.ShapeType()) {
+            GroupPoints->ComboBox1->removeItem(0);
+            i++;
+          }
+          // remove Shape and Flat types for non-compound shapes
+          if (myShape.ShapeType() != TopAbs_COMPOUND) {
+            int idx = GroupPoints->ComboBox1->findData( (int)GEOM::SHAPE );
+            if ( idx != -1 ) GroupPoints->ComboBox1->removeItem( idx );
+            idx = GroupPoints->ComboBox1->findData( (int)GEOM::FLAT );
+            if ( idx != -1 ) GroupPoints->ComboBox1->removeItem( idx );
+          } // if (myShape.ShapeType() != TopAbs_COMPOUND)
+        } // if (!CORBA::is_nil(myObject))
+      } // if (S.IsNull() || S.ShapeType() == TopAbs_VERTEX)
+    } // if (!IO->hasEntry()) ... else
+  } // if (nbSel == 1)
+
+  int idx = GroupPoints->ComboBox1->findData( currentType );
+  if ( idx != -1 )
+    GroupPoints->ComboBox1->setCurrentIndex( idx );
 
   updateButtonState();
 }
@@ -420,29 +481,10 @@ void EntityGUI_SubShapeDlg::ResetStateOfDialog()
   myShape.Nullify();
   myEditCurrentArgument->setText("");
 
-  int SelectedShapeType = GroupPoints->ComboBox1->currentIndex();
-  int count = GroupPoints->ComboBox1->count();
-  if (myWithShape)
-    count = count - 1;
-
   /* type for sub-shape selection */
   GroupPoints->ComboBox1->clear();
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Compound");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Compsolid");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Solid");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Shell");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Face");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Wire");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Edge");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Vertex");
-  GroupPoints->ComboBox1->insertItem(GroupPoints->ComboBox1->count(), "Shape");
-
-  myWithShape = true;
-
-  GroupPoints->ComboBox1->setCurrentIndex(8 - count + SelectedShapeType);
-
-  // to avoid recursion: SelectionIntoArgument->ResetStateOfDialog->ComboTextChanged->SubShapeToggled->activateSelection->(currentSelectionChanged)->SelectionIntoArgument
-  //ComboTextChanged();
+  for ( int i = 0; i <= (int)GEOM::FLAT; i++ )
+    GroupPoints->ComboBox1->addItem(ShapeTypes[i], i);
 
   updateButtonState();
 }
@@ -457,6 +499,16 @@ void EntityGUI_SubShapeDlg::SubShapeToggled()
   GroupPoints->PushButton2->setEnabled(!isAllSubShapes());
   GroupPoints->PushButton3->setEnabled(!isAllSubShapes());
   GroupPoints->PushButton4->setEnabled(!isAllSubShapes());
+  myFilterGrp->setEnabled(GroupPoints->CheckButton1->isEnabled() &&
+                          GroupPoints->CheckButton1->isChecked() &&
+                          shapeType() < GEOM::VERTEX);
+
+#ifndef DISABLE_PLOT2DVIEWER
+  myPlotDistributionButton->setEnabled( myFilterGrp->isEnabled() &&
+                                       ( shapeType() == TopAbs_EDGE || 
+                                         shapeType() == TopAbs_FACE ||
+                                         shapeType() == TopAbs_SOLID ) );
+#endif
 
   activateSelection();
 }
@@ -473,58 +525,23 @@ void EntityGUI_SubShapeDlg::ComboTextChanged()
 }
 
 //=================================================================================
-// function : NumberOfSubShapes()
+// function : updateButtonState
 // purpose  :
 //=================================================================================
-unsigned int EntityGUI_SubShapeDlg::NumberOfSubShapes(const TopoDS_Shape& S,
-                                                      const int shapeType) const
+void EntityGUI_SubShapeDlg::updateButtonState()
 {
-  if (S.IsNull())
-    return 0;
+  bool viewOk = SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() == OCCViewer_Viewer::Type();
+  bool shapeTypeOk = shapeType() != TopAbs_SHAPE && shapeType() != TopAbs_FLAT && shapeType() != TopAbs_COMPOUND;
+  bool objectOK = !CORBA::is_nil( myObject );
 
-  unsigned int index = 0;
-  TopTools_MapOfShape M;
-
-  if (S.ShapeType() == TopAbs_COMPOUND &&
-       (TopAbs_ShapeEnum(shapeType) == TopAbs_SHAPE ||
-         TopAbs_ShapeEnum(shapeType) == TopAbs_COMPSOLID ||
-         TopAbs_ShapeEnum(shapeType) == TopAbs_COMPOUND)) {
-    TopoDS_Iterator It(S, Standard_True, Standard_True);
-    for (; It.More(); It.Next()) {
-      if (M.Add(It.Value())) {
-        if (TopAbs_ShapeEnum(shapeType) == TopAbs_SHAPE ||
-             TopAbs_ShapeEnum(shapeType) == It.Value().ShapeType()) {
-          index++;
-        }
-      }
-    }
+  if ( viewOk && objectOK && shapeTypeOk ) {
+    GroupPoints->CheckButton1->setEnabled( true );
   }
   else {
-    TopExp_Explorer Exp (S, TopAbs_ShapeEnum(shapeType));
-    for (; Exp.More(); Exp.Next()) {
-      if (M.Add(Exp.Current())) {
-        index++;
-      }
-    }
-  }
-
-  M.Clear();
-  return index;
-}
-
-//=================================================================================
-// function : updateButtonState
-// purpose  :
-//=================================================================================
-void EntityGUI_SubShapeDlg::updateButtonState()
-{
-  if (SUIT_Session::session()->activeApplication()->desktop()->activeWindow()->getViewManager()->getType() != OCCViewer_Viewer::Type() ||
-      myObject->_is_nil() || shapeType() == TopAbs_SHAPE || shapeType() == TopAbs_COMPOUND) {
-    GroupPoints->CheckButton1->setChecked(false);
-    GroupPoints->CheckButton1->setEnabled(false);
+    GroupPoints->CheckButton1->setChecked( false );
+    GroupPoints->CheckButton1->setEnabled( false );
   }
-  else
-    GroupPoints->CheckButton1->setEnabled(true);
+  myFilterGrp->setEnabled(GroupPoints->CheckButton1->isEnabled() && GroupPoints->CheckButton1->isChecked());
 }
 
 //=================================================================================
@@ -533,7 +550,7 @@ void EntityGUI_SubShapeDlg::updateButtonState()
 //=================================================================================
 bool EntityGUI_SubShapeDlg::isAllSubShapes() const
 {
-  return !GroupPoints->CheckButton1->isChecked() || !GroupPoints->CheckButton1->isEnabled();
+  return !GroupPoints->CheckButton1->isEnabled() || !GroupPoints->CheckButton1->isChecked();
 }
 
 //=================================================================================
@@ -542,19 +559,7 @@ bool EntityGUI_SubShapeDlg::isAllSubShapes() const
 //=================================================================================
 int EntityGUI_SubShapeDlg::shapeType() const
 {
-  int type = GroupPoints->ComboBox1->currentIndex();
-
-  if (myObject->_is_nil())
-    return type;
-
-  // Solving PAL5590
-  type += myShape.ShapeType() + 1;
-  if (myShape.ShapeType() == TopAbs_COMPOUND &&
-      NumberOfSubShapes(myShape, TopAbs_COMPOUND) > 0) {
-    type--;
-  }
-
-  return type;
+  return GroupPoints->ComboBox1->itemData(GroupPoints->ComboBox1->currentIndex()).toInt();
 }
 
 //=================================================================================
@@ -892,3 +897,100 @@ QString EntityGUI_SubShapeDlg::getNewObjectName (int) const
 {
   return QString::null;
 }
+
+//=================================================================================
+// function : ClickOnOkFilter()
+// purpose  : highlight and select entities which parameters (length, area or volume) are less than the value specified by the user
+//=================================================================================
+void EntityGUI_SubShapeDlg::ClickOnOkFilter()
+{
+  if (CORBA::is_nil(myObject) || isAllSubShapes() || shapeType() >= GEOM::VERTEX)
+    return;
+  
+  TopTools_IndexedMapOfShape aSubShapesMap;
+  TopExp::MapShapes(myShape, aSubShapesMap);
+  SALOME_View* view = GEOM_Displayer::GetActiveView();
+  getDisplayer()->Erase(myObject, false, false);
+  CORBA::String_var aMainEntry = myObject->GetStudyEntry();
+  QString anEntryBase = aMainEntry.in();
+
+  SALOME_ListIO toSelect;
+
+  TopExp_Explorer anExp (myShape, (TopAbs_ShapeEnum)shapeType());
+  for (; anExp.More(); anExp.Next())
+  {
+    TopoDS_Shape aSubShape = anExp.Current();
+    int index = aSubShapesMap.FindIndex(aSubShape);
+    QString anEntry = QString( "TEMP_" ) + anEntryBase + QString("_%1").arg(index);
+    if ( !getDisplayer()->IsDisplayed( anEntry ) )
+      continue;
+
+    double factor = GEOMUtils::ShapeToDouble(aSubShape).second;
+    double v1 = myLessFilterSpin->value();
+    double v2 = myGreaterFilterSpin->value();
+    bool isLess = myLessFilterCombo->itemData(myLessFilterCombo->currentIndex()).toInt() == Filter_LT ? factor < v1 : factor <= v1;
+    bool isGreater = myGreaterFilterCombo->itemData(myGreaterFilterCombo->currentIndex()).toInt() == Filter_GT ? factor > v2 : factor >= v2;
+    if ( ( myLessFilterCheck->isChecked() && myGreaterFilterCheck->isChecked() && isLess && isGreater ) ||
+         ( myLessFilterCheck->isChecked() && !myGreaterFilterCheck->isChecked() && isLess ) ||
+         ( myGreaterFilterCheck->isChecked() && !myLessFilterCheck->isChecked() && isGreater ) ) {
+      Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject();
+      io->setEntry( anEntry.toLatin1().constData() );
+      io->setName( myObject->GetName() );
+      toSelect.Append(io);
+    }
+  }
+  if ( toSelect.Extent() > 0 ) {
+    myGeomGUI->getApp()->selectionMgr()->setSelectedObjects(toSelect);
+    SUIT_MessageBox::information( this,
+                                  tr( "INF_INFO" ),
+                                  tr( "GEOM_SOME_SHAPES_SELECTED").arg( toSelect.Extent() ),
+                                  tr( "BUT_OK" ) );
+  }
+  else {
+    SUIT_MessageBox::information( this,
+                                  tr( "INF_INFO" ),
+                                  tr( "GEOM_NO_SHAPES_SELECTED" ),
+                                  tr( "BUT_OK" ) );
+  }
+  updateButtonState();
+}
+
+#ifndef DISABLE_PLOT2DVIEWER
+//=================================================================================
+// function : ClickOnPlot()
+// purpose  : opens "Shape Statistics" dialog box in order to plot sub-shapes distribution.
+//=================================================================================
+void EntityGUI_SubShapeDlg::ClickOnPlot()
+{
+  QDialog* dlg = new MeasureGUI_ShapeStatisticsDlg( this, myShape, (TopAbs_ShapeEnum)shapeType() );
+  if ( dlg ) {
+    dlg->show();
+  }
+}
+#endif
+
+//=================================================================================
+// function : MeasureToggled()
+// purpose  :
+//          : Called when 'myLessFilterCheck' or 'myGreaterFilterCheck' state change
+//=================================================================================
+void EntityGUI_SubShapeDlg::MeasureToggled()
+{
+  myLessFilterSpin->setEnabled(myLessFilterCheck->isChecked());
+  myLessFilterCombo->setEnabled(myLessFilterCheck->isChecked());
+  myGreaterFilterSpin->setEnabled(myGreaterFilterCheck->isChecked());
+  myGreaterFilterCombo->setEnabled(myGreaterFilterCheck->isChecked());
+  myApplyFilterButton->setEnabled(myLessFilterCheck->isChecked() || myGreaterFilterCheck->isChecked());
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> EntityGUI_SubShapeDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObject);
+  res << aGeomObjPtr;
+  return res;
+}
index 14275c83effe1077fb3f5d6c13132c9628cd154c..18c0c9ec87b1804f54a8b46c8fa46eb5a8435258 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <TColStd_IndexedMapOfInteger.hxx>
 
+class QCheckBox;
+class QComboBox;
+class QGroupBox;
+class QPushButton;
+class SalomeApp_DoubleSpinBox;
 class DlgRef_1Sel1List1Check3Btn;
 
 //=================================================================================
@@ -52,6 +57,7 @@ protected:
   virtual bool                        execute (ObjectList&);
   virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
   virtual QString                     getNewObjectName (int CurrObj = -1) const;
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
   void                                closeEvent (QCloseEvent*);
 
@@ -66,6 +72,11 @@ private slots:
   void                                ComboTextChanged();
 
   void                                showOnlySelected();
+  void                                ClickOnOkFilter();
+#ifndef DISABLE_PLOT2DVIEWER
+  void                                ClickOnPlot();
+#endif
+  void                                MeasureToggled();
 
 private:
   void                                Init();
@@ -73,9 +84,6 @@ private:
 
   void                                ResetStateOfDialog();
 
-  unsigned int                        NumberOfSubShapes (const TopoDS_Shape&,
-                                                         const int) const;
-
   void                                activateSelection();
   int                                 getSelectedSubshapes (TColStd_IndexedMapOfInteger& theMapIndex);
   void                                updateButtonState();
@@ -87,11 +95,18 @@ private:
   GEOM::GEOM_Object_var               myObject;
   int                                 myDmMode;
 
-  bool                                myWithShape;
-
   bool                                myIsHiddenMain;
 
   DlgRef_1Sel1List1Check3Btn*         GroupPoints;
+  QCheckBox*                          myLessFilterCheck;
+  QCheckBox*                          myGreaterFilterCheck;
+  QComboBox*                          myLessFilterCombo;
+  QComboBox*                          myGreaterFilterCombo;
+  SalomeApp_DoubleSpinBox*            myLessFilterSpin;
+  SalomeApp_DoubleSpinBox*            myGreaterFilterSpin;
+  QPushButton*                        myApplyFilterButton;
+  QPushButton*                        myPlotDistributionButton;
+  QGroupBox*                          myFilterGrp;
 };
 
 #endif // ENTITYGUI_SUBSHAPEDLG_H
diff --git a/src/EntityGUI/EntityGUI_SurfFromFaceDlg.cxx b/src/EntityGUI/EntityGUI_SurfFromFaceDlg.cxx
new file mode 100644 (file)
index 0000000..0d37076
--- /dev/null
@@ -0,0 +1,236 @@
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : EntityGUI_SurfFromFaceDlg.cxx
+
+#include "EntityGUI_SurfFromFaceDlg.h"
+#include <GeometryGUI.h>
+#include <DlgRef.h>
+#include <GEOMBase.h>
+
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+
+
+//=================================================================================
+// class    : EntityGUI_SurfFromFaceDlg
+// purpose  : 
+//=================================================================================
+EntityGUI_SurfFromFaceDlg::EntityGUI_SurfFromFaceDlg
+                                           (GeometryGUI     *theGeometryGUI,
+                                            QWidget         *parent,
+                                            bool             modal,
+                                            Qt::WindowFlags  fl)
+  : GEOMBase_Skeleton (theGeometryGUI, parent, modal, fl),
+    myGroup           (0)
+{
+  QPixmap image0(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SURFACE_FROM_FACE")));
+  QPixmap image1(SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
+
+  setWindowTitle(tr("GEOM_SURF_FROM_FACE_TITLE"));
+
+  /***************************************************************/
+
+  mainFrame()->GroupConstructors->setTitle(tr("GEOM_SURF_FROM_FACE"));
+  mainFrame()->RadioButton1->setIcon(image0);
+  mainFrame()->RadioButton2->close();
+  mainFrame()->RadioButton3->close();
+
+  // Construct a group.
+  myGroup = new DlgRef_1Sel(centralWidget());
+  myGroup->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
+  myGroup->TextLabel1->setText(tr("GEOM_FACE"));
+  myGroup->PushButton1->setIcon(image1);
+  myGroup->LineEdit1->setReadOnly(true);
+
+  QVBoxLayout* layout = new QVBoxLayout(centralWidget());
+  layout->setMargin(0); layout->setSpacing(6);
+  layout->addWidget(myGroup);
+
+  setHelpFileName("create_surface_from_face_page.html");
+
+  Init();
+}
+
+//=================================================================================
+// function : ~EntityGUI_SurfFromFaceDlg()
+// purpose  : 
+//=================================================================================
+EntityGUI_SurfFromFaceDlg::~EntityGUI_SurfFromFaceDlg()
+{
+}
+
+//=================================================================================
+// function : Init()
+// purpose  :
+//=================================================================================
+void EntityGUI_SurfFromFaceDlg::Init()
+{
+  initName(tr("GEOM_SURF_FROM_FACE_NAME"));
+  showOnlyPreviewControl();
+
+  /* signals and slots connections */
+  connect(myGroup->PushButton1, SIGNAL(clicked()),
+          this,                 SLOT(SetEditCurrentArgument()));
+  connect(myGeomGUI->getApp()->selectionMgr(),
+                                SIGNAL(currentSelectionChanged()),
+          this,                 SLOT(SelectionIntoArgument()));
+  connect(myGeomGUI,            SIGNAL(SignalDeactivateActiveDialog()),
+          this,                 SLOT(DeactivateActiveDialog()));
+  connect(myGeomGUI,            SIGNAL(SignalCloseAllDialogs()),
+          this,                 SLOT(ClickOnCancel()));
+  connect(buttonOk(),           SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+  connect(buttonApply(),        SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+
+  myEditCurrentArgument = myGroup->LineEdit1;
+  myGroup->LineEdit1->setReadOnly(true);
+  SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : SelectionIntoArgument
+// purpose  : Called when selection is changed
+//=================================================================================
+void EntityGUI_SurfFromFaceDlg::SelectionIntoArgument()
+{
+  erasePreview();
+  myEditCurrentArgument->setText("");
+  myFace.nullify();
+
+  GEOM::GeomObjPtr aSelectedObject = getSelected(TopAbs_FACE);
+
+  if (aSelectedObject) {
+    myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject.get()));
+    myFace = aSelectedObject;
+  }
+
+  processPreview();
+}
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose  :
+//=================================================================================
+void EntityGUI_SurfFromFaceDlg::SetEditCurrentArgument()
+{
+  QPushButton* send = (QPushButton*)sender();
+
+  if (send == myGroup->PushButton1) {
+    myEditCurrentArgument->setFocus();
+    SelectionIntoArgument();
+  }
+}
+
+//=================================================================================
+// function : ActivateThisDialog
+// purpose  :
+//=================================================================================
+void EntityGUI_SurfFromFaceDlg::ActivateThisDialog()
+{
+  GEOMBase_Skeleton::ActivateThisDialog();
+  connect(myGeomGUI->getApp()->selectionMgr(),
+                       SIGNAL(currentSelectionChanged()),
+          this,        SLOT(SelectionIntoArgument()));
+  SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : enterEvent()
+// purpose  :
+//=================================================================================
+void EntityGUI_SurfFromFaceDlg::enterEvent (QEvent*)
+{
+  if (!mainFrame()->GroupConstructors->isEnabled())
+    ActivateThisDialog();
+}
+
+//=================================================================================
+// function : createOperation
+// purpose  :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr EntityGUI_SurfFromFaceDlg::createOperation()
+{
+  return myGeomGUI->GetGeomGen()->GetIShapesOperations(getStudyId());
+}
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool EntityGUI_SurfFromFaceDlg::isValid (QString& msg)
+{
+  return myFace;
+}
+
+//=================================================================================
+// function : execute
+// purpose  :
+//=================================================================================
+bool EntityGUI_SurfFromFaceDlg::execute (ObjectList& objects)
+{
+  GEOM::GEOM_IShapesOperations_var anOper =
+    GEOM::GEOM_IShapesOperations::_narrow(getOperation());
+  GEOM::GEOM_Object_var anObj = anOper->MakeSurfaceFromFace(myFace.get());
+
+  if (!anObj->_is_nil()) {
+    objects.push_back(anObj._retn());
+  }
+
+  return true;
+}
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose  :
+//=================================================================================
+void EntityGUI_SurfFromFaceDlg::ClickOnOk()
+{
+  setIsApplyAndClose(true);
+
+  if (ClickOnApply())
+    ClickOnCancel();
+}
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose  :
+//=================================================================================
+bool EntityGUI_SurfFromFaceDlg::ClickOnApply()
+{
+  if (!onAccept())
+    return false;
+
+  initName();
+
+  return true;
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> EntityGUI_SurfFromFaceDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myFace;
+  return res;
+}
diff --git a/src/EntityGUI/EntityGUI_SurfFromFaceDlg.h b/src/EntityGUI/EntityGUI_SurfFromFaceDlg.h
new file mode 100644 (file)
index 0000000..809a411
--- /dev/null
@@ -0,0 +1,76 @@
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : EntityGUI_SurfFromFaceDlg.h
+
+#ifndef ENTITYGUI_SURFFROMFACEDLG_H
+#define ENTITYGUI_SURFFROMFACEDLG_H
+
+
+#include <GEOMBase_Skeleton.h>
+
+class DlgRef_1Sel;
+
+//=================================================================================
+// class    : EntityGUI_SurfFromFaceDlg
+// purpose  :
+//=================================================================================
+class EntityGUI_SurfFromFaceDlg : public GEOMBase_Skeleton
+{ 
+  Q_OBJECT
+
+public:
+
+  EntityGUI_SurfFromFaceDlg (GeometryGUI     *theGeometryGUI,
+                             QWidget         *parent = 0,
+                             bool             modal  = false,
+                             Qt::WindowFlags  fl     = 0);
+
+  ~EntityGUI_SurfFromFaceDlg();
+
+protected:
+  // redefined from GEOMBase_Helper
+  virtual GEOM::GEOM_IOperations_ptr createOperation();
+  virtual bool                       isValid( QString& );
+  virtual bool                       execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
+
+private:
+
+  void                               Init();
+  void                               enterEvent( QEvent* );
+
+private:
+
+  DlgRef_1Sel                       *myGroup;
+  GEOM::GeomObjPtr                   myFace;
+
+private slots:
+
+  void                               ClickOnOk();
+  bool                               ClickOnApply();
+  void                               SelectionIntoArgument();
+  void                               SetEditCurrentArgument();
+  void                               ActivateThisDialog();
+
+};
+
+#endif // ENTITYGUI_SURFFROMFACEDLG_H
index e2b6f42789daaa0cf6e60931dc6d110a49a455a9..17bb76b9fb06d1691d8a457e3173316df7b1e125 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e7788d8fb3b987de8e9e72094f837d0c0c53dd91..9f33b98118c19b15a03d1beee9c97b03972f84c2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 74de5cb4b1e8c59191409206676823d42bc6e180..ccdb2c69e2d21968a66cd6501474bd4c2b90f97b 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 79b8dcc24d6dd84b954940e1e3957451771301f0..abd56e3f754e494cdace847953bc0a948f91c043 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1fad0e099a5b1358dcff1cac4a457dae760d74c4..dde63cded8054c159fe24dcdf4ed6de18aeb44ce 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 2ace1ce544e4ce1240bd0639c6153e450ff1ebdb..2f834dd50843efdb8e556dbbcb4c701614aaf872 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 7313ea6024f9207785cbad2985839902b45ab165..a8c662d6c5d9e4281740c6e8481d423fd4f9c4e8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 889a5b3d29f6d5b20bb2d4cd22f61a73e2d7e89e..b2a5efca736f549287a92abd7a93e473a67b00cc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -493,18 +493,17 @@ Handle(TColStd_HSequenceOfTransient) GEOM_BaseObject::GetLastDependency()
  */
 //================================================================================
 
-Handle(TFunction_Driver) GEOM_BaseObject::GetCreationDriver()
+Handle(TFunction_Driver) GEOM_BaseObject::GetCreationDriver(int funNb)
 {
-  Handle(TFunction_Driver) aDriver;
-
-  Handle(GEOM_Function) function = GetFunction(1);
+  Handle(TFunction_Driver) driver;
+  Handle(GEOM_Function) function = GetFunction(funNb);
   if ( !function.IsNull() )
   {
     Standard_GUID aGUID = function->GetDriverGUID();
-    if ( TFunction_DriverTable::Get()->FindDriver(aGUID, aDriver))
-      aDriver->Init( function->GetEntry() );
+    if ( TFunction_DriverTable::Get()->FindDriver(aGUID, driver ))
+      driver->Init( function->GetEntry() );
   }
-  return aDriver;
+  return driver;
 }
 
 //=============================================================================
index 2be28339af262b00e11dc23f73c688402f854d1e..68e6bdc5ae302df781407611d46d4ddf89c127f1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -31,6 +31,8 @@
 #include <TDF_Label.hxx>
 #include <TDataStd_TreeNode.hxx>
 
+#include <vector>
+
 class GEOM_BaseObject;
 class Handle(TFunction_Driver);
 class GEOM_Engine;
@@ -146,8 +148,8 @@ public:
   //Returns the dependencies of the last function
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetLastDependency();
 
-  //Returns a driver creator of this object
-  Standard_EXPORT Handle(TFunction_Driver) GetCreationDriver();
+  //Returns drivers creators of this object
+  Standard_EXPORT Handle(TFunction_Driver) GetCreationDriver(int funNb);
 
   //###########################################################
   // Internal methods
index 1a1b7004427d03923a7ab269cd07c1500cbe2e88..1b54e75a5a655c4d6fec25bb42c14c2156704ce2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index a2617ff4065c9864d4446f7a85e0d84e4d691324..e7921bed45520072b77f5adaec1feb7d13c833ca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -88,6 +88,7 @@ static int MYDEBUG = 0;
 typedef std::map< TCollection_AsciiString, TCollection_AsciiString > TSting2StringMap;
 typedef std::map< TCollection_AsciiString, TObjectData >             TSting2ObjDataMap;
 typedef std::map< TCollection_AsciiString, TObjectData* >            TSting2ObjDataPtrMap;
+typedef std::map< int, std::list < int > >                           TIntToListIntMap;
 
 static GEOM_Engine* TheEngine = NULL;
 
@@ -123,6 +124,11 @@ bool ProcessFunction(Handle(GEOM_Function)&             theFunction,
                      std::set<TCollection_AsciiString>& theIgnoreObjs,
                      bool&                              theIsDumpCollected);
 
+static int GetTag(const TCollection_AsciiString &theEntry);
+
+static void FillMapOfRef(const Handle(GEOM_Function) &theFunction,
+                               TIntToListIntMap      &theRefMap);
+
 void ReplaceVariables(TCollection_AsciiString& theCommand,
                       const TVariablesList&    theVariables);
 
@@ -148,6 +154,12 @@ void PublishObject (TObjectData&                              theObjectData,
                     std::map< int, TCollection_AsciiString >& theEntryToCmdMap,
                     std::set<TCollection_AsciiString>&        theMapOfPublished);
 
+static TCollection_AsciiString GetPublishCommands
+                   (const int                                       theTag,
+                    const std::map< int, TCollection_AsciiString > &theEntryToCmdMap,
+                    const TIntToListIntMap                         &theMapRefs,
+                          std::set< int >                          &thePublished);
+
 //================================================================================
 /*!
  * \brief Fix up the name of python variable
@@ -674,6 +686,7 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
   // Mantis issue 0020768
   Standard_Integer objectCounter = 0;
   Resource_DataMapOfAsciiStringAsciiString aNameToEntry;
+  TIntToListIntMap                         aRefMap;
 
   if (aDoc->Main().FindAttribute(GEOM_Function::GetFunctionTreeID(), aRoot)) {
     TDataStd_ChildNodeIterator Itr(aRoot);
@@ -702,6 +715,10 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
             continue; // aCurScript is already at the end of aFuncScript
         aFuncScript += aCurScript;
       }
+
+      // Fill the map of references.
+      FillMapOfRef(aFunction, aRefMap);
+
       if (isDumpCollected ) {
         // Replace entries by the names
         ReplaceEntriesByNames( aFuncScript, aEntry2ObjData, isPublished,
@@ -717,9 +734,16 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
                          aNameToEntry, anEntryToCmdMap, anIgnoreObjMap );
         }
         // add publishing commands to the script
+        std::set< int >                                    aPublished;
         std::map< int, TCollection_AsciiString >::iterator anEntryToCmd = anEntryToCmdMap.begin();
-        for ( ; anEntryToCmd != anEntryToCmdMap.end(); ++anEntryToCmd )
-          aFuncScript += anEntryToCmd->second;
+
+        for ( ; anEntryToCmd != anEntryToCmdMap.end(); ++anEntryToCmd ) {
+          const TCollection_AsciiString aPublishCmds =
+              GetPublishCommands(anEntryToCmd->first, anEntryToCmdMap,
+                                 aRefMap, aPublished);
+
+          aFuncScript += aPublishCmds;
+        }
 
         // PTv, 0020001 add result objects from RestoreGivenSubShapes into ignore list,
         //  because they will be published during command execution
@@ -772,9 +796,16 @@ TCollection_AsciiString GEOM_Engine::DumpPython(int theDocID,
                      aNameToEntry, anEntryToCmdMap, anIgnoreObjMap );
     }
     // add publishing commands to the script
+    std::set< int >                                    aPublished;
     std::map< int, TCollection_AsciiString >::iterator anEntryToCmd = anEntryToCmdMap.begin();
-    for ( ; anEntryToCmd != anEntryToCmdMap.end(); ++anEntryToCmd )
-      aScript += anEntryToCmd->second;
+
+    for ( ; anEntryToCmd != anEntryToCmdMap.end(); ++anEntryToCmd ) {
+      const TCollection_AsciiString aPublishCmds =
+          GetPublishCommands(anEntryToCmd->first, anEntryToCmdMap,
+                             aRefMap, aPublished);
+
+      aScript += aPublishCmds;
+    }
   }
 
   //RNV: issue 16219: EDF PAL 469: "RemoveFromStudy" Function
@@ -1197,6 +1228,64 @@ bool ProcessFunction(Handle(GEOM_Function)&             theFunction,
   return true;
 }
 
+//=============================================================================
+/*!
+ *  GetTag: Returns the tag from entry
+ */
+//=============================================================================
+int GetTag(const TCollection_AsciiString &theEntry)
+{
+  const int aGeomObjDepth = 3;
+  const int aTag          = theEntry.Token(":", aGeomObjDepth).IntegerValue();
+
+  return aTag;
+}
+
+//=============================================================================
+/*!
+ *  FillMapOfRef: Fill the map of references
+ */
+//=============================================================================
+void FillMapOfRef(const Handle(GEOM_Function) &theFunction,
+                        TIntToListIntMap      &theRefMap)
+{
+  TDF_LabelSequence       aSeq;
+  TCollection_AsciiString anObjEntry;
+  int                     anObjTag;
+
+  TDF_Tool::Entry(theFunction->GetOwnerEntry(), anObjEntry);
+  anObjTag = GetTag(anObjEntry);
+  theFunction->GetDependency(aSeq);
+
+  const Standard_Integer aLen = aSeq.Length();
+  Standard_Integer       i;
+
+  for (i = 1; i <= aLen; i++) {
+    TDF_Label             aRefLabel = aSeq.Value(i);
+    Handle(TDF_Reference) aRef;
+
+    if (aRefLabel.FindAttribute(TDF_Reference::GetID(), aRef)) {
+      if (!aRef.IsNull() && !aRef->Get().IsNull()) {
+        Handle(TDataStd_TreeNode) aT;
+
+        if (TDataStd_TreeNode::Find(aRef->Get(), aT)) {
+          TDF_Label             aDepLabel = aT->Label();
+          Handle(GEOM_Function) aRefFunct = GEOM_Function::GetFunction(aDepLabel);
+
+          if (!aRefFunct.IsNull()) {
+            // Get entry of the referenced object.
+            TDF_Tool::Entry(aRefFunct->GetOwnerEntry(), anObjEntry);
+
+            const int aRefTag = GetTag(anObjEntry);
+
+            theRefMap[anObjTag].push_back(aRefTag);
+          }
+        }
+      }
+    }
+  }
+}
+
 //=============================================================================
 /*!
  *  FindEntries: Returns a sequence of start/end positions of entries in the string
@@ -1726,8 +1815,6 @@ void PublishObject (TObjectData&                              theObjectData,
   if ( stEntry2DataPtr != theStEntry2ObjDataPtr.end() )
     aFatherData = stEntry2DataPtr->second;
 
-  const int geomObjDepth = 3;
-
   // treat multiply published object
   if ( theObjectData._pyName.IsEmpty() )
   {
@@ -1741,7 +1828,7 @@ void PublishObject (TObjectData&                              theObjectData,
     aCreationCommand += theObjectData._pyName + " = " + data0._pyName;
 
     // store aCreationCommand before publishing commands
-    int tag = theObjectData._entry.Token( ":", geomObjDepth ).IntegerValue();
+    int tag = GetTag(theObjectData._entry);
     theEntryToCmdMap.insert( std::make_pair( tag + 2*theEntry2ObjData.size(), aCreationCommand ));
   }
 
@@ -1756,12 +1843,57 @@ void PublishObject (TObjectData&                              theObjectData,
   aCommand += theObjectData._pyName + ", '" + theObjectData._name + "' )";
 
   // bind a command to the study entry
-  int tag = theObjectData._entry.Token( ":", geomObjDepth ).IntegerValue();
+  int tag = GetTag(theObjectData._entry);
   theEntryToCmdMap.insert( std::make_pair( tag, aCommand ));
 
   theObjectData._studyEntry.Clear(); // not to publish any more
 }
 
+//================================================================================
+/*!
+ * \brief Returns the string of publishing commands. Take into account that
+ *  references should be published prior to the objects refer to them.
+ */
+//================================================================================
+TCollection_AsciiString GetPublishCommands
+                   (const int                                       theTag,
+                    const std::map< int, TCollection_AsciiString > &theEntryToCmdMap,
+                    const TIntToListIntMap                         &theMapRefs,
+                          std::set< int >                          &thePublished)
+{
+  TCollection_AsciiString aResult;
+
+  if (!thePublished.count(theTag)) {
+    // This object is not published yet.
+    std::map< int, TCollection_AsciiString >::const_iterator anIt =
+      theEntryToCmdMap.find(theTag);
+
+    if (anIt != theEntryToCmdMap.end()) {
+      // There is a pubish cmd.
+      TIntToListIntMap::const_iterator aRefIt = theMapRefs.find(theTag);
+
+      if (aRefIt != theMapRefs.end()) {
+        // Recursively publish all references.
+        std::list< int >::const_iterator aRefTagIt = aRefIt->second.begin();
+  
+        for(; aRefTagIt != aRefIt->second.end(); ++aRefTagIt) {
+          const TCollection_AsciiString aRefCmd = GetPublishCommands
+            (*aRefTagIt, theEntryToCmdMap, theMapRefs, thePublished);
+
+          aResult += aRefCmd;
+        }
+      }
+
+      // Add the object command.
+      aResult += anIt->second;
+    }
+
+    thePublished.insert(theTag);
+  }
+
+  return aResult;
+}
+
 //================================================================================
 /*!
  * \brief Constructor
index e802b3a25556da583b885678d32df12346749c4c..69ff2f2eed9e9bd55a312cf3d43cc569bd7ec284 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 92cb1e8c2af7239ee031f3c46146a1f583e28ca3..ea75736512af57df942c724307531e6602607a58 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 6d0a03f9fa0bfb9b873a271ee05e300e8b2fbcb7..9e8d31d2ec4f8465fd50e97aaf5832bb22ef5adf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 458e0a0bc75079623e12f8a53a5d664ff1401bf6..17b45b06457c5393a651130dff16fdad539ee7b5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -62,6 +62,8 @@
 #include <TCollection_AsciiString.hxx>
 #include <TCollection_ExtendedString.hxx>
 
+#include <cstdlib>
+
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
@@ -76,6 +78,7 @@
 #define HISTORY_LABEL 4
 #define SUBSHAPES_LABEL 5 // 0020756: GetGroups
 #define NAMING_LABEL 6 // 0020750: Naming during STEP import
+#define CALLBACK_LABEL 1 // TDataStd_Comment
 
 #ifdef KEEP_ORIENTATION_0021251
 #define ORIENTATION_LABEL 7 // 0021251: TNaming_NamedShape doesn't store orientation
@@ -124,7 +127,7 @@ Handle(GEOM_Function) GEOM_Function::GetFunction(const TDF_Label& theEntry)
  */
 //=============================================================================
 GEOM_Function::GEOM_Function(const TDF_Label& theEntry, const Standard_GUID& theGUID, int theType)
-: _label(theEntry)
+  : _label(theEntry), _isCallBackData(false)
 {
   TFunction_Function::Set(theEntry, theGUID);
   TDataStd_Integer::Set(theEntry, theType);
@@ -139,6 +142,21 @@ GEOM_Function::GEOM_Function(const TDF_Label& theEntry, const Standard_GUID& the
   aRoot->Append(aNode);
 }
 
+//================================================================================
+/*!
+ * \brief 
+ * 
+ * 
+ */
+//================================================================================
+
+GEOM_Function::~GEOM_Function()
+{
+  if ( _isCallBackData ) {
+    _label.FindChild( CALLBACK_LABEL ).ForgetAttribute( TDataStd_Comment::GetID() );
+  }
+}
+
 //================================================================================
 /*!
  * \brief Retuns true if this function is the last one in the study
@@ -571,9 +589,10 @@ TCollection_AsciiString GEOM_Function::GetString(int thePosition)
   Handle(TDataStd_Comment) aString;
   TDF_Label anArgLabel = ARGUMENT(thePosition);
   if(!anArgLabel.FindAttribute(TDataStd_Comment::GetID(), aString)) return aRes;
-
+  char *str = new char[aString->Get().LengthOfCString()+1];
+  aString->Get().ToUTF8CString(str);
+  aRes = TCollection_AsciiString(str);
   _isDone = true;
-  aRes = TCollection_AsciiString(aString->Get());
   return aRes;
 }
 
@@ -928,5 +947,51 @@ TDF_Label GEOM_Function::GetNamingEntry (const Standard_Boolean create)
   return _label.FindChild(NAMING_LABEL, create);
 }
 
+//================================================================================
+/*!
+ * Save a pointer to a data holder intended to pass temporary data Driver -> Operation.
+ * This method should be called by Operation to set the data holder.
+ * An instance of GEOM_Function that sets the data holder will remove the
+ * corresponding OCAF attribute at it's destruction
+ */
+//================================================================================
+
+void GEOM_Function::SetCallBackData( void* data )
+{
+  std::ostringstream strm;
+  strm << (long long) data;
+  TCollection_ExtendedString string( strm.str().c_str() );
+
+  TDF_Label aChild = _label.FindChild(CALLBACK_LABEL);
+  TDataStd_Comment::Set(aChild, string);
+
+  _isCallBackData = true; // I will remove TDataStd_Comment at destruction
+}
+
+//================================================================================
+/*!
+ * Returns a pointer to a data holder intended to pass data Driver -> Operation.
+ * This method should be called by Driver to get the data holder to fill it in.
+ * Returns NULL if the Operation have not set the data holder.
+ */
+//================================================================================
+
+void* GEOM_Function::GetCallBackData()
+{
+  Handle(TDataStd_Comment) aComment;
+  TDF_Label aChild = _label.FindChild( CALLBACK_LABEL );
+  if(!aChild.FindAttribute(TDataStd_Comment::GetID(), aComment)) return NULL;
+  TCollection_AsciiString string( aComment->Get() );
+
+  long long address;
+#ifndef WIN32
+  address = atoll ( string.ToCString() );
+#else
+  address = _strtoi64 ( string.ToCString(), NULL, 10 );
+#endif
+
+  return reinterpret_cast<void*> ( address );
+}
+
 IMPLEMENT_STANDARD_HANDLE (GEOM_Function, Standard_Transient);
 IMPLEMENT_STANDARD_RTTIEXT(GEOM_Function, Standard_Transient );
index 688324dae0c173c3edd72a87364e78513e8bde17..7cbb9707e712dc45325bd2d3b151f86bc141d0c0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -56,7 +56,7 @@ public:
 
 
   Standard_EXPORT GEOM_Function(const TDF_Label& theEntry, const Standard_GUID& theGUID, int theType);
-  Standard_EXPORT ~GEOM_Function() {}
+  Standard_EXPORT ~GEOM_Function();
 
   Standard_EXPORT TDF_Label GetOwnerEntry();
 
@@ -152,6 +152,17 @@ public:
   //Returns a list of references to other function arguments at position thePosition
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetReferenceList (int thePosition);
 
+  // Save a pointer to a data holder intended to pass data Driver -> Operation.
+  // This method should be called by Operation to set the data holder.
+  // An instance of GEOM_Function that sets the data holder will remove the
+  // corresponding OCAF attribute at it's destruction
+  Standard_EXPORT void SetCallBackData( void* data );
+
+  // Returns a pointer to a data holder intended to pass data Driver -> Operation.
+  // This method should be called by Driver to get the data holder to fill it in.
+  // Returns NULL if the Operation have not set the data holder.
+  Standard_EXPORT void* GetCallBackData();
+
   //Sets a TopoDS_Shape argument at position thePosition
   //void SetShape(int thePosition, const TopoDS_Shape& theShape);
 
@@ -190,6 +201,7 @@ public:
 
   TDF_Label _label;
   bool      _isDone;
+  bool      _isCallBackData;
 };
 
 #endif
index 3b18050cf76c019bd40ddc6932d6f5e4aaf83c4c..bdd0a51e09a0dfa925c769c9677013af855bcf70 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 548c66e9c27570c4624ddc2cc71bc4423b5aee2a..4636f5fee10a23f89d6ce086cbeef63cf584a7f3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c6667a34814f43636d602556e2548c45b6584354..d38a749c32abed5747811fd3ace5c058cd40058f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 53c74b63afd448c99117c803ab259db33a62caed..e71b0f64eb0173e1047773d76a1264690dc8a933 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index fc8a1f3262b8765bdec367a9a5f05a96a82e3f59..a9520abd6d72fbeab32b84e5ed37c6a6246e0879 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -46,7 +46,7 @@
  */
 //=============================================================================
 
-Handle(GEOM_Object) GEOM_Object::GetObject(TDF_Label& theLabel)
+Handle(GEOM_Object) GEOM_Object::GetObject(const TDF_Label& theLabel)
 {
   Handle(GEOM_BaseObject) base = GEOM_BaseObject::GetObject(theLabel);
   return Handle(GEOM_Object)::DownCast( base );
@@ -58,7 +58,7 @@ Handle(GEOM_Object) GEOM_Object::GetObject(TDF_Label& theLabel)
  */
 //=============================================================================
 
-Handle(GEOM_Object) GEOM_Object::GetReferencedObject(TDF_Label& theLabel)
+Handle(GEOM_Object) GEOM_Object::GetReferencedObject(const TDF_Label& theLabel)
 {
   Handle(GEOM_BaseObject) base = GEOM_BaseObject::GetReferencedObject(theLabel);
   return Handle(GEOM_Object)::DownCast( base );
@@ -275,5 +275,27 @@ bool GEOM_Object::IsMainShape()
   return false;
 }
 
+//================================================================================
+/*!
+ * \brief Returns GetLastFunction() of given objects
+ */
+//================================================================================
+
+Handle(TColStd_HSequenceOfTransient)
+GEOM_Object::GetLastFunctions( const std::list< Handle(GEOM_Object) >& theObjects )
+{
+  Handle(TColStd_HSequenceOfTransient) funs = new TColStd_HSequenceOfTransient;
+  std::list<Handle(GEOM_Object)>::const_iterator it = theObjects.begin();
+  for (; it != theObjects.end(); it++)
+  {
+    Handle(GEOM_Function) fun = (*it)->GetLastFunction();
+    if ( fun.IsNull())
+      return Handle(TColStd_HSequenceOfTransient)();
+    funs->Append( fun );
+  }
+  return funs;
+}
+
 IMPLEMENT_STANDARD_HANDLE (GEOM_Object, GEOM_BaseObject );
 IMPLEMENT_STANDARD_RTTIEXT(GEOM_Object, GEOM_BaseObject );
+
index 214ca30b9bb79c94c682078a7a66ef277a0f0bc2..ddd3f029f3c0cc02eb4112fd955739f847217489 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <Aspect_TypeOfMarker.hxx>
 #include <Standard_GUID.hxx>
+#include <TColStd_HSequenceOfTransient.hxx>
 #include <TDF_Label.hxx>
 #include <TopoDS_Shape.hxx>
 
+#include <list>
+
 class GEOM_Object;
 class Handle(TFunction_Driver);
 class GEOM_Engine;
@@ -58,10 +61,10 @@ class GEOM_Object : public GEOM_BaseObject
   Standard_EXPORT ~GEOM_Object();
 
   //Finds a GEOM_Object on the label theLabel
-  Standard_EXPORT static Handle(GEOM_Object) GetObject(TDF_Label& theLabel);
+  Standard_EXPORT static Handle(GEOM_Object) GetObject(const TDF_Label& theLabel);
 
   //Finds a GEOM_Object by a reference, stored on the label theLabel
-  Standard_EXPORT static Handle(GEOM_Object) GetReferencedObject(TDF_Label& theLabel);
+  Standard_EXPORT static Handle(GEOM_Object) GetReferencedObject(const TDF_Label& theLabel);
 
   //###########################################################
   //Access to properties
@@ -107,6 +110,10 @@ class GEOM_Object : public GEOM_BaseObject
   //Returns false if the object is a sub-shape of another object
   Standard_EXPORT bool IsMainShape();
 
+  //Comfort method
+  Standard_EXPORT static Handle(TColStd_HSequenceOfTransient)
+    GetLastFunctions( const std::list< Handle(GEOM_Object) >& theObjects );
+
 public:
   DEFINE_STANDARD_RTTI( GEOM_Object );
 };
index 395a3ab72458fcdea316a3336269a0dd843d2dff..bcee3dc0451d34d56c8d965f6f372df7482226b8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -44,11 +44,11 @@ namespace GEOM
   {
     if (--myCounter == 0) {
       TCollection_AsciiString aDescr;
-      if ( myAppend ) {
+      if ( myAppend )
         aDescr = myFunction->GetDescription();
-        if ( !aDescr.IsEmpty() ) aDescr += "\n\t";
-      }
       std::string aString = myStream.str();
+      if ( !aDescr.IsEmpty() && !aString.empty())
+        aDescr += "\n\t";
       aDescr += (char *)aString.c_str();
       myFunction->SetDescription( aDescr );
     }
@@ -140,6 +140,23 @@ namespace GEOM
     }
     return *this;
   }
+  Standard_EXPORT TPythonDump&
+  TPythonDump::operator<< (const std::list<Handle(GEOM_Object)>& theObjects)
+  {
+    Standard_Integer aLength = theObjects.size();
+    if ( aLength != 1 ) {
+      myStream << "[";
+    }
+    std::list<Handle(GEOM_Object)>::const_iterator obj = theObjects.begin();
+    for ( Standard_Integer i = 1; i <= aLength; i++, ++obj ) {
+      *this << *obj;
+      if ( i < aLength ) myStream << ", ";
+    }
+    if ( aLength != 1 ) {
+      myStream << "]";
+    }
+    return *this;
+  }
 
   TPythonDump& TPythonDump::operator<< (const GEOM_BaseObject* theObject)
   {
@@ -184,6 +201,11 @@ namespace GEOM
 
     for (i = 1; i <= aLen; i++) {
       anObject = Handle(GEOM_Object)::DownCast(theObjects->Value(i));
+      if ( anObject.IsNull() ) {
+        Handle(GEOM_Function) fun = Handle(GEOM_Function)::DownCast(theObjects->Value(i));
+        if ( !fun.IsNull() )
+          anObject = GEOM_Object::GetObject( fun->GetOwnerEntry() );
+      }
       aLatest = GetCreatedLast(aLatest, anObject);
     }
     return aLatest;
index 66b87506e9c6e47a9e9351f8e0e0682be08999e2..86db16ac21487d993c69dab45ebe9d871cf98f76 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -30,6 +30,8 @@
 
 #include <TCollection_AsciiString.hxx>
 
+#include <list>
+
 namespace GEOM
 {
   class TPythonDump
@@ -56,7 +58,8 @@ namespace GEOM
     Standard_EXPORT TPythonDump& operator<< (const TCollection_AsciiString theArg);
     Standard_EXPORT TPythonDump& operator<< (const TopAbs_ShapeEnum theArg);
     Standard_EXPORT TPythonDump& operator<< (const Handle(GEOM_BaseObject)& theObject);
-    Standard_EXPORT TPythonDump& operator<< (const Handle(TColStd_HSequenceOfTransient)& theObjects);
+    Standard_EXPORT TPythonDump& operator<< (const Handle(TColStd_HSequenceOfTransient)& objects);
+    Standard_EXPORT TPythonDump& operator<< (const std::list<Handle(GEOM_Object)>& theObjects);
     Standard_EXPORT TPythonDump& operator<< (const GEOM_BaseObject* theObject);
   };
 
index 81617026ceefe403363fb899ff64f60439a92eb3..2ef4468ebb5011728ff948ae3a83390f6f63a299 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b90e43cb9f0de3be8ea84ce332b36a844e7a58e1..752ea3384ab88d68b3b82daf2a06cd71a7372c3d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 5950d0320cd59bc5221186f348cc6f1f288a0a80..1e14b894949319f8d2d595ab84ca4543f27ddf62 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 8b2061bbd4b7ff7e50b95afa251e3b05c707e64a..713c5f8bb272d8dda0182a4db2c817ab542b5ce4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index d85a789f1820b6ec54426e82544f6e6326e686e3..d2b6024abadb4910378579dc3f69c441598a1cf8 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -23,6 +23,8 @@
 INCLUDE_DIRECTORIES(
   ${CAS_INCLUDE_DIRS}
   ${KERNEL_INCLUDE_DIRS}
+  ${PROJECT_SOURCE_DIR}/src/GEOMUtils
+  ${PROJECT_SOURCE_DIR}/src/GEOM
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
 
@@ -34,6 +36,7 @@ ADD_DEFINITIONS(
 # libraries to link to
 SET(_link_LIBRARIES
   ${CAS_KERNEL} ${CAS_TKBool} ${CAS_TKBO} ${CAS_TKMesh}
+  GEOMbasic GEOMUtils
   ${KERNEL_SALOMELocalTrace}
   )
 
@@ -48,6 +51,7 @@ SET(GEOMAlgo_HEADERS
   GEOMAlgo_BuilderShape.hxx
   GEOMAlgo_Clsf.hxx
   GEOMAlgo_ClsfBox.hxx
+  GEOMAlgo_ClsfQuad.hxx
   GEOMAlgo_ClsfSolid.hxx
   GEOMAlgo_ClsfSurf.hxx
   GEOMAlgo_CoupleOfShapes.hxx
@@ -60,6 +64,7 @@ SET(GEOMAlgo_HEADERS
   GEOMAlgo_FinderShapeOn2.hxx
   GEOMAlgo_FinderShapeOnQuad.hxx
   GEOMAlgo_GetInPlace.hxx
+  GEOMAlgo_GetInPlaceAPI.hxx
   GEOMAlgo_GlueAnalyser.hxx
   GEOMAlgo_GlueDetector.hxx
   GEOMAlgo_Gluer.hxx
@@ -75,6 +80,7 @@ SET(GEOMAlgo_HEADERS
   GEOMAlgo_IndexedDataMapOfShapeState.hxx
   GEOMAlgo_KindOfBounds.hxx
   GEOMAlgo_KindOfClosed.hxx
+  GEOMAlgo_KindOfDef.hxx
   GEOMAlgo_KindOfName.hxx
   GEOMAlgo_KindOfShape.hxx
   GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx
@@ -112,17 +118,16 @@ SET(GEOMAlgo_SOURCES
   GEOMAlgo_BuilderShape.cxx
   GEOMAlgo_Clsf.cxx
   GEOMAlgo_ClsfBox.cxx
+  GEOMAlgo_ClsfQuad.cxx
   GEOMAlgo_ClsfSolid.cxx
   GEOMAlgo_ClsfSurf.cxx
   GEOMAlgo_CoupleOfShapes.cxx
-  GEOMAlgo_FinderShapeOn.cxx
-  GEOMAlgo_FinderShapeOn1.cxx
   GEOMAlgo_FinderShapeOn2.cxx
-  GEOMAlgo_FinderShapeOnQuad.cxx
   GEOMAlgo_GetInPlace.cxx
   GEOMAlgo_GetInPlace_1.cxx
   GEOMAlgo_GetInPlace_2.cxx
   GEOMAlgo_GetInPlace_3.cxx
+  GEOMAlgo_GetInPlaceAPI.cxx
   GEOMAlgo_GlueAnalyser.cxx
   GEOMAlgo_GlueDetector.cxx
   GEOMAlgo_Gluer.cxx
@@ -142,7 +147,7 @@ SET(GEOMAlgo_SOURCES
   GEOMAlgo_ShapeInfoFiller.cxx
   GEOMAlgo_ShapeInfoFiller_1.cxx
   GEOMAlgo_ShapeSolid.cxx
-  GEOMAlgo_ShellSolid.cxx      
+  GEOMAlgo_ShellSolid.cxx
   GEOMAlgo_SolidSolid.cxx
   GEOMAlgo_Splitter.cxx
   GEOMAlgo_StateCollector.cxx
index 898eca027286a00e235a8369491ee63e0440ec3c..91e59813fbd294e77a480fa7597e540b8f0a61f6 100644 (file)
@@ -11,7 +11,6 @@ GEOMAlgo_ShellSolid.cxx
 GEOMAlgo_AlgoTools.hxx
 GEOMAlgo_AlgoTools.cxx
 GEOMAlgo_AlgoTools_1.cxx
-GEOMAlgo_AlgoTools_2.cxx
 GEOMAlgo_SolidSolid.hxx
 GEOMAlgo_SolidSolid.cxx
 GEOMAlgo_ShapeAlgo.hxx
@@ -108,3 +107,5 @@ GEOMAlgo_ShapeInfo.cxx
 GEOMAlgo_IndexedDataMapOfShapeShapeInfo.hxx
 
 Basics_OCCTVersion.hxx
+
+GEOMAlgo_KindOfDef.hxx
old mode 100755 (executable)
new mode 100644 (file)
index 9bbdc5f..0d2a653
@@ -1,4 +1,4 @@
--- Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+-- 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
index d754a7992e8ed536a57ce19ba0bbd6e64e90e08c..8b17c2002bdac9496674cb430aee1e3c8805429c 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 02ddc792ea01fbe3d640b7fb49c762df9929eacc..71a342620dee48464673d61e2e4a516e02c0b940 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
old mode 100755 (executable)
new mode 100644 (file)
index 5adf897..57184bf
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -93,15 +93,15 @@ static
                 Standard_Integer& iCnt);
 static
   void CopySource(const TopoDS_Shape& aS,
-                 TopTools_IndexedDataMapOfShapeShape& aMapSS,
-                 TopoDS_Shape& aSC);
+    TopTools_IndexedDataMapOfShapeShape& aMapSS,
+    TopoDS_Shape& aSC);
 
 //=======================================================================
 //function : CopyShape
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
-                                  TopoDS_Shape& aSC)
+       TopoDS_Shape& aSC)
 {
   TopTools_IndexedDataMapOfShapeShape aMapSS;
   //
@@ -112,8 +112,8 @@ void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::CopyShape(const TopoDS_Shape& aS,
-                                  TopoDS_Shape& aSC,
-                                  TopTools_IndexedDataMapOfShapeShape& aMapSS)
+       TopoDS_Shape& aSC,
+       TopTools_IndexedDataMapOfShapeShape& aMapSS)
 {
   CopySource(aS, aMapSS, aSC);
 }
@@ -172,9 +172,9 @@ void CopySource(const TopoDS_Shape& aS,
 //purpose  : 
 //=======================================================================
 void GEOMAlgo_AlgoTools::FaceNormal (const TopoDS_Face& aF,
-                                    const Standard_Real U,
-                                    const Standard_Real V,
-                                    gp_Vec& aN)
+         const Standard_Real U,
+         const Standard_Real V,
+         gp_Vec& aN)
 {
   gp_Pnt aPnt ;
   gp_Vec aD1U, aD1V;
@@ -222,6 +222,19 @@ Standard_Integer GEOMAlgo_AlgoTools::BuildPCurveForEdgeOnFace
     return iRet;
   }
   //
+#if OCC_VERSION_LARGE > 0x06080000
+  // Try to copy PCurve from old edge to the new one.
+  iRet = BOPTools_AlgoTools2D::AttachExistingPCurve(aEold, aEnew, aF, aCtx);
+
+  if (iRet) {
+    // Do PCurve using projection algorithm.
+    iRet = 0;
+  } else {
+    // The PCurve is attached successfully.
+    return iRet;
+  }
+#endif
+  //
   BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aEnew, aF);
   aC2D=BRep_Tool::CurveOnSurface(aEnew, aF, aT1, aT2);
   if (aC2D.IsNull()){
@@ -330,7 +343,7 @@ Standard_Integer GEOMAlgo_AlgoTools::BuildPCurveForEdgeOnFace
 // purpose:
 //=======================================================================
 void GEOMAlgo_AlgoTools::MakeContainer(const TopAbs_ShapeEnum theType,
-                                      TopoDS_Shape& theC)
+           TopoDS_Shape& theC)
 {
   BRep_Builder aBB;
   //
@@ -399,9 +412,9 @@ Standard_Boolean GEOMAlgo_AlgoTools::IsUPeriodic(const  Handle(Geom_Surface) &aS
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(const TopoDS_Edge& aE,
-                                                  const TopoDS_Face& aF,
-                                                  const Standard_Real aUMin,
-                                                  const Standard_Real aUMax)
+         const TopoDS_Face& aF,
+         const Standard_Real aUMin,
+         const Standard_Real aUMax)
 {
   Standard_Real aT1, aT2, aTx, aUx, aTol;
   gp_Pnt2d aP2D;
@@ -546,7 +559,7 @@ Standard_Boolean GEOMAlgo_AlgoTools::ProjectPointOnShape
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
-                                    gp_Pnt& aP3D)
+         gp_Pnt& aP3D)
 {
   Standard_Real aTx, aT1, aT2;
   //
@@ -559,8 +572,8 @@ void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
-                                    const Standard_Real aT,
-                                    gp_Pnt& aP3D)
+         const Standard_Real aT,
+         gp_Pnt& aP3D)
 {
   Standard_Real aT1, aT2;
   Handle(Geom_Curve) aC3D;
@@ -573,9 +586,9 @@ void GEOMAlgo_AlgoTools::PointOnEdge(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
-                                    const Standard_Real aU,
-                                    const Standard_Real aV,
-                                    gp_Pnt& aP3D)
+         const Standard_Real aU,
+         const Standard_Real aV,
+         gp_Pnt& aP3D)
 {
   Handle(Geom_Surface) aS;
   //
@@ -587,7 +600,7 @@ void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
-                                    gp_Pnt& aP3D)
+         gp_Pnt& aP3D)
 {
   Standard_Real aU, aV, aUMin, aUMax, aVMin, aVMax;
   //
@@ -603,7 +616,7 @@ void GEOMAlgo_AlgoTools::PointOnFace(const TopoDS_Face& aF,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_AlgoTools::PointOnShape(const TopoDS_Shape& aS,
-                                     gp_Pnt& aP3D)
+          gp_Pnt& aP3D)
 {
   TopAbs_ShapeEnum aType;
   //
@@ -700,7 +713,7 @@ Standard_Integer GEOMAlgo_AlgoTools::FindSDShapes
     return 0; // Nothing to do
   }
   //
-  while(1) {
+  for(;;) {
     aNbEProcessed=aMProcessed.Extent();
     if (aNbEProcessed==aNbE) {
       break;
@@ -909,8 +922,8 @@ void GetCount(const TopoDS_Shape& aS,
 //purpose  :
 //=======================================================================
 Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF,
-                                              gp_Pnt& theP,
-                                              gp_Pnt2d& theP2D)
+                                               gp_Pnt& theP,
+                                               gp_Pnt2d& theP2D)
 {
   Standard_Boolean bIsDone, bHasFirstPoint, bHasSecondPoint;
   Standard_Integer iErr, aIx, aNbDomains, i;
@@ -935,8 +948,8 @@ Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF,
   //
   Geom2dHatch_Intersector aIntr(aTotArcIntr, aTolTangfIntr);
   Geom2dHatch_Hatcher aHatcher(aIntr,
-                              aTolHatch2D, aTolHatch3D,
-                              Standard_True, Standard_False);
+          aTolHatch2D, aTolHatch3D,
+          Standard_True, Standard_False);
   //
   iErr=0;
   aEpsT=1.e-12;
@@ -991,30 +1004,33 @@ Standard_Integer GEOMAlgo_AlgoTools::PntInFace(const TopoDS_Face& aF,
   }
   //
   // 4.
+  aVx=aVMin;
   aNbDomains=aHatcher.NbDomains(aIx);
-  for (i=1; i<=aNbDomains; ++i) {
-    const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
-    bHasFirstPoint=aDomain.HasFirstPoint();
-    if (!bHasFirstPoint) {
-      iErr=5;
-      return iErr;
-    }
-    //
-    aV1=aDomain.FirstPoint().Parameter();
-    //
-    bHasSecondPoint=aDomain.HasSecondPoint();
-    if (!bHasSecondPoint) {
-      iErr=6;
-      return iErr;
-    }
-    //
-    aV2=aDomain.SecondPoint().Parameter();
-    //
-    aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
-    //
-    break;
+  if (!aNbDomains) {
+    iErr=5;
+    return iErr;
+  }
+  //
+  i=1;
+  const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
+  bHasFirstPoint=aDomain.HasFirstPoint();
+  if (!bHasFirstPoint) {
+    iErr=5;
+    return iErr;
   }
   //
+  aV1=aDomain.FirstPoint().Parameter();
+  //
+  bHasSecondPoint=aDomain.HasSecondPoint();
+  if (!bHasSecondPoint) {
+    iErr=6;
+    return iErr;
+  }
+  //
+  aV2=aDomain.SecondPoint().Parameter();
+  //
+  aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
+  //
   aS->D0(aUx, aVx, aPx);
   //
   theP2D.SetCoord(aUx, aVx);
index 7fba7d88c7ca6963df33181ffb203ef3880c48b0..6df239d6013e52eae12f6a98ef436067418ca319 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index bfd37a138c7fbd7f50f381dfb53dd2c6b5de7ba0..6eea2a97c0a7c3af4c8947a2a7b80065424eb077 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index a22c81ae8841e9fc34f4b584f1b232803f0bda17..e1f757e86d695b30191d9547684c7e1adb2db1b6 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 782b86b1d036ca5ede50115b524ed77deb503bf3..b3c196334c306b903c1d3f78a59438621154350f 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 5b83fadec45fd8a86b44c0af416fa63df48ca0bb..2d019676ced62201aea67fbcb1359bff82604e37 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index bb2d6cb6ece31190dae037f689a1c2a37f6ab256..b102be484711f7f12399a9295611788ff5af3589 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 6546e4be45310d0e2141c0b25941cdee241ffd6b..2791c85f99b6cce438bdac510b4b123c387c6691 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 6312e8b2f333b20f62addc37184eb5b311c93599..3849dbfbc33bed7201193f36cd9a2c7fdf0ec192 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e37634b6b6d1e6f92d342c947042c6fd04674996..af3a59dd8fa66056faed20a60d7d5992657ec181 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 379c7b8116c2d0311f28aaeb2efdd0dcbee046a2..5c1667295b4e8416662c71d860b1cad7a9c4b5e7 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 597bb2dac7dc694e9f57802008ceb6b93d685d6e..168ff8badabf8db1c9457e3a3713c843304baab9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f78efc7ef531dbd7a0dc2ff391eb41a37c3d3ee2..0f278a485ca473728d3bf65773fef45553c5e672 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 86a749149312f4226865d0983aec1c65178b5c1e..f08f161379dd5bff1bfde9a289138b4f6bd6d1c2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3623cd2e5cc494f4d30491e7a86d2f41b96f1ad1..6463dbd71d8b3cf709a646f8fbf261cca83ae975 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1c5a1ccf32bb81e6b638577686b3398ddd70a164..0e009dd5a85bf5cde36fc881c824836b192f1aaf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfQuad.cxx b/src/GEOMAlgo/GEOMAlgo_ClsfQuad.cxx
new file mode 100644 (file)
index 0000000..3011d0b
--- /dev/null
@@ -0,0 +1,220 @@
+// 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
+//
+
+// File:        GEOMAlgo_ClsfQuad.cxx
+// Created:     Fri Feb 13 16:03:19 2015
+// Author:      Sergey KHROMOV
+//
+
+
+#include <GEOMAlgo_ClsfQuad.hxx>
+#include <GEOMAlgo_SurfaceTools.hxx>
+
+#include <Geom_Plane.hxx>
+
+
+IMPLEMENT_STANDARD_HANDLE(GEOMAlgo_ClsfQuad, GEOMAlgo_Clsf);
+IMPLEMENT_STANDARD_RTTIEXT(GEOMAlgo_ClsfQuad, GEOMAlgo_Clsf);
+
+//=======================================================================
+//function :
+//purpose  :
+//=======================================================================
+GEOMAlgo_ClsfQuad::GEOMAlgo_ClsfQuad()
+: GEOMAlgo_Clsf(),
+  myQuadNormal(0., 0., 0.)
+{
+}
+//=======================================================================
+//function : ~
+//purpose  :
+//=======================================================================
+GEOMAlgo_ClsfQuad::~GEOMAlgo_ClsfQuad()
+{
+}
+//=======================================================================
+//function : SetCorners
+//purpose  :
+//=======================================================================
+void GEOMAlgo_ClsfQuad::SetCorners(const gp_Pnt &theTopLeftPoint,
+                                   const gp_Pnt &theTopRigthPoint,
+                                   const gp_Pnt &theBottomLeftPoint,
+                                   const gp_Pnt &theBottomRigthPoint)
+{
+  myPoints.resize(6);
+  myPoints[0] = theTopLeftPoint;
+  myPoints[1] = theTopRigthPoint;
+  myPoints[2] = theBottomRigthPoint;
+  myPoints[3] = theBottomLeftPoint;
+  myPoints[4] = myPoints[0];
+  myPoints[5] = myPoints[1];
+
+  // Find plane normal defined by corner points, it will be used to define
+  // a plane for each quadrangle side.
+  myQuadNormal.SetCoord (0., 0., 0.);
+
+  for ( int i = 1; i <= 4; ++i ) {
+    myQuadNormal +=
+      gp_Vec(myPoints[i], myPoints[i+1]) ^ gp_Vec(myPoints[i], myPoints[i-1]);
+  }
+
+  if (myQuadNormal.SquareMagnitude() <= DBL_MIN) {
+    return;
+  }
+
+  // detect concave quadrangle sides
+  myConcaveQuad = false;
+  myConcaveSide.resize (4, false);
+
+  for ( int i = 1; i <= 4; ++i ) {
+    gp_Vec localQN =
+      gp_Vec(myPoints[i], myPoints[i+1]) ^ gp_Vec(myPoints[i], myPoints[i-1]);
+
+    if (myQuadNormal * localQN < 0) {
+      myConcaveSide[i-1] = myConcaveSide[i] = myConcaveQuad = true;
+    }
+  }
+
+  // loop on quadrangle sides
+  myPlanes.reserve( 4 );
+
+  for ( int i = 0; i < 4; ++i ) {
+    // point1 -> point2 vector
+    gp_Vec aSideVec( myPoints[ i ], myPoints[ i + 1 ]);
+
+    // plane normal
+    gp_Vec aSideNorm = aSideVec ^ myQuadNormal;
+    if (aSideNorm.SquareMagnitude() <= DBL_MIN) {
+      continue;
+    }
+
+    // make plane
+    Handle(Geom_Plane) aPlane = new Geom_Plane(myPoints[i], aSideNorm);
+
+    myPlanes.push_back(GeomAdaptor_Surface());
+    myPlanes.back().Load( aPlane );
+  }
+}
+
+  //=======================================================================
+//function : GetCorners
+//purpose  :
+//=======================================================================
+void GEOMAlgo_ClsfQuad::GetCorners(gp_Pnt &theTopLeftPoint,
+                                   gp_Pnt &theTopRigthPoint,
+                                   gp_Pnt &theBottomLeftPoint,
+                                   gp_Pnt &theBottomRigthPoint) const
+{
+  if (myPoints.size() == 6) {
+    theTopLeftPoint     = myPoints[0];
+    theTopRigthPoint    = myPoints[1];
+    theBottomLeftPoint  = myPoints[3];
+    theBottomRigthPoint = myPoints[2];
+  }
+}
+
+//=======================================================================
+//function : CheckData
+//purpose  :
+//=======================================================================
+void GEOMAlgo_ClsfQuad::CheckData()
+{
+  myErrorStatus = 0;
+
+  if (myQuadNormal.SquareMagnitude() <= DBL_MIN) {
+    myErrorStatus = 10; // undefined quadrangle normal.
+    return;
+  }
+}
+//=======================================================================
+//function : Perform
+//purpose  :
+//=======================================================================
+void GEOMAlgo_ClsfQuad::Perform()
+{
+  myErrorStatus=0;
+  //
+  // Return IN if aP has TopAbs_IN with all sides.
+  // In the case of concave quadrangle, return IN if
+  // aP is OUT of only one concave side
+  double nbIn = 0.;
+
+  for (size_t i = 0; i < myPlanes.size(); ++i) {
+    TopAbs_State aSt;
+
+    GEOMAlgo_SurfaceTools::GetState(myPnt, myPlanes[i], myTolerance, aSt);
+
+    if (aSt == TopAbs_IN) {
+      nbIn += myConcaveSide[i] ? 0.5 : 1.0;
+    } else if (aSt == TopAbs_ON) {
+      // check that aP is between quadrangle corners
+      Handle(Geom_Plane) aSidePlane =
+        Handle(Geom_Plane)::DownCast(myPlanes[i].Surface());
+      gp_Vec aSideNorm = aSidePlane->Axis().Direction();
+      gp_Vec aSideVec = myQuadNormal ^ aSideNorm;
+      gp_Vec c1p (myPoints[i], myPnt);
+      gp_Vec pc2 (myPnt, myPoints[i+1]);
+
+      if (aSideVec * c1p >= 0. && aSideVec * pc2 >= 0.) {
+        myState = TopAbs_ON;
+        return;
+      }
+      // consider to be IN (???????????)
+      //nbIn += myConcaveSide[i] ? 0.5 : 1.0;
+    }
+  }
+
+  Standard_Real inThreshold = myPlanes.size(); // usually 4.0
+
+  if (myConcaveQuad) {
+    inThreshold = 2.5; // 1.0 + 1.0 + 0.5
+  }
+
+  if (nbIn >= inThreshold) {
+    myState = TopAbs_IN;
+  } else {
+    myState = TopAbs_OUT;
+  }
+}
+//=======================================================================
+//function : CanBeON
+//purpose  :
+//=======================================================================
+  Standard_Boolean GEOMAlgo_ClsfQuad::CanBeON(const Handle(Geom_Curve)& aC) const
+{
+  return GEOMAlgo_Clsf::CanBeON(aC);
+}
+//=======================================================================
+//function : CanBeON
+//purpose  :
+//=======================================================================
+  Standard_Boolean GEOMAlgo_ClsfQuad::CanBeON(const Handle(Geom_Surface)& aS1) const
+{
+  GeomAdaptor_Surface aGAS1;
+
+  aGAS1.Load(aS1);
+
+  GeomAbs_SurfaceType aST1 = aGAS1.GetType();
+  Standard_Boolean    bRet = (aST1 == GeomAbs_Plane);
+
+  return bRet;
+}
diff --git a/src/GEOMAlgo/GEOMAlgo_ClsfQuad.hxx b/src/GEOMAlgo/GEOMAlgo_ClsfQuad.hxx
new file mode 100644 (file)
index 0000000..cab2c16
--- /dev/null
@@ -0,0 +1,92 @@
+// 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
+//
+
+// File:        GEOMAlgo_ClsfQuad.hxx
+// Created:     Fri Feb 13 16:03:19 2015
+// Author:      Sergey KHROMOV
+//
+//
+#ifndef _GEOMAlgo_ClsfQuad_HeaderFile
+#define _GEOMAlgo_ClsfQuad_HeaderFile
+
+
+#include <GEOMAlgo_Clsf.hxx>
+
+#include <GeomAdaptor_Surface.hxx>
+#include <Standard_DefineHandle.hxx>
+
+#include <vector>
+
+
+DEFINE_STANDARD_HANDLE(GEOMAlgo_ClsfQuad, GEOMAlgo_Clsf)
+
+//=======================================================================
+// class   : GEOMAlgo_ClsfQuad
+//purpose  :
+//=======================================================================
+class GEOMAlgo_ClsfQuad : public GEOMAlgo_Clsf
+{
+
+public:
+
+  Standard_EXPORT
+    GEOMAlgo_ClsfQuad();
+
+  Standard_EXPORT
+    virtual ~GEOMAlgo_ClsfQuad();
+
+  Standard_EXPORT
+    void SetCorners(const gp_Pnt &theTopLeftPoint,
+                    const gp_Pnt &theTopRigthPoint,
+                    const gp_Pnt &theBottomLeftPoint,
+                    const gp_Pnt &theBottomRigthPoint);
+
+  Standard_EXPORT
+    void GetCorners(gp_Pnt &theTopLeftPoint,
+                    gp_Pnt &theTopRigthPoint,
+                    gp_Pnt &theBottomLeftPoint,
+                    gp_Pnt &theBottomRigthPoint) const;
+
+  Standard_EXPORT
+    virtual  void Perform();
+
+  Standard_EXPORT
+    virtual  void CheckData();
+
+  Standard_EXPORT
+    virtual  Standard_Boolean CanBeON(const Handle(Geom_Curve)& aC) const;
+
+  Standard_EXPORT
+    virtual  Standard_Boolean CanBeON(const Handle(Geom_Surface)& aST) const;
+
+  DEFINE_STANDARD_RTTI(GEOMAlgo_ClsfQuad);
+
+protected:
+
+  bool                              myConcaveQuad;
+  std::vector<bool>                 myConcaveSide;
+  std::vector<gp_Pnt>               myPoints;
+  std::vector<GeomAdaptor_Surface>  myPlanes;
+  gp_Vec                            myQuadNormal;
+
+};
+#endif
index d5bf8dc5b868fb553b239d2dbb725804ebb9111c..46945fc219088d35b24cc4fd88ce899e30a319e6 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 9a7fccaab82cae8317744eb076b0de13b1d09234..5437880b6a2219bbb0c7009e779de63efeceaf5c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7369d127ced965e7fa7814f157e938927aec6053..2727d4fcfd0331570ce8b7c3f7998ad6af9295c3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 679e8bf5b96d8a53d13a04a46c2cd294b9e26245..1c199b02bda778083c82e52dc1ad41a710525412 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ad396db464ea7ffcdb1b768a71017fc0051bc36a..940d488d667c99557a57b77302017eca30bfb56a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 7ca8b1a944deea1cb5dcdb1bf1e6da52d0c25fe5..a127cc9f75ba8e80dd4f0639553497c7c6c55fae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2ad03d69a05b5b8c0cc648ad6b9d24ae1346e25f..adb9b14a46792e4f9eae00c1d0dbb23c762c195b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 990f4cbd0e15cee909b924dfe13f67b8582db9fd..6a8d6a5e2ccdadaefa31ba331a7061aeebcd5e63 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 45678ac9095eb5585b31e83963381c8e099eac6b..3e4854a98ce4f1f3fc314775841a282c09414a25 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index f7401b519ebae7885a43ee657ed9ce3d23753509..43bc7a4172694596ace7e6821dbc03fdc8188f26 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index b98c7de0026f6989fc793622d32b67f75f69f4df..4db6801de96fc7045d33e6a82a11d8ecd443a273 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -62,7 +62,6 @@
 #include <BRepLib_MakeFace.hxx>
 #include <BRepLib_FaceError.hxx>
 
-//#include <BOPTools_DSFiller.hxx>
 
 #include <GEOMAlgo_WireSolid.hxx>
 #include <GEOMAlgo_ShellSolid.hxx>
@@ -300,7 +299,6 @@ void GEOMAlgo_FinderShapeOn::Find(const TopoDS_Shape& aS)
 {
   myErrorStatus=0;
   //
-  Standard_Boolean bIsDone;
   Standard_Integer i, iErr;
   TopAbs_State aSts[]={TopAbs_IN, TopAbs_OUT, TopAbs_ON};
   TopTools_ListIteratorOfListOfShape aIt;
index 1117ed794e02171c16ee761e7e0c6543d0e8a9aa..09ca8d1c08da076beffec36ab0c77f4864e8161b 100644 (file)
@@ -1,5 +1,5 @@
 
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f3d201bbbf3daf31880a87f820c0d998daa51eae..f2f7fe0d51c6c03685a71cd369d116e51f554db3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -309,6 +309,9 @@ void GEOMAlgo_FinderShapeOn1::ProcessEdges()
   aType1=myGAS.GetType();
   //
   TopExp::MapShapes(myShape, TopAbs_EDGE, aM);
+  //
+  bIsConformState=Standard_False;
+  //
   aNb=aM.Extent();
   for (i=1; i<=aNb; ++i) {
     GEOMAlgo_ListOfPnt aLP;
@@ -427,6 +430,8 @@ void GEOMAlgo_FinderShapeOn1::ProcessFaces()
       }
     }
     //
+    bIsConformState=Standard_False;
+    //
     aExp.Init(aF, TopAbs_EDGE);
     for (; aExp.More(); aExp.Next()) {
       const TopoDS_Shape& aE=aExp.Current();
@@ -500,6 +505,9 @@ void GEOMAlgo_FinderShapeOn1::ProcessSolids()
     const TopoDS_Shape& aSd=aM(i);
     aMF.Clear();
     TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
+    //
+    bIsConformState=Standard_False;
+    //
     aNbF=aMF.Extent();
     for (j=1; j<=aNbF; ++j) {
       const TopoDS_Shape& aF=aMF(j);
@@ -660,7 +668,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Face& aF,
     }// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder)
   }// if (!aNb && myNbPntsMin) {
 }
-//modified by NIZNHY-PKV Thu Jan 26 09:56:20 2012f
 //=======================================================================
 //function : InnerPoints
 //purpose  :
@@ -676,7 +683,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
   aLP.Clear();
   InnerPoints(aE, aNbPntsMin, aLP);
 }
-//modified by NIZNHY-PKV Thu Jan 26 09:56:32 2012t
 //=======================================================================
 //function : InnerPoints
 //purpose  :
@@ -702,16 +708,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
     return;
   }
   //
-  //modified by NIZNHY-PKV Thu Jan 26 09:51:20 2012f
-  /*
-  aNbT=myNbPntsMin+1;
-  dT=(aT2-aT1)/aNbT;
-  for (j=1; j<=aNbPntsMin; ++j) {
-    aT=aT1+j*dT;
-    aC3D->D0(aT, aP);
-    aLP.Append(aP);
-  }
-  */
   aNbT=aNbPntsMin+1;
   dT=(aT2-aT1)/aNbT;
   for (j=1; j<aNbT; ++j) {
@@ -719,7 +715,6 @@ void GEOMAlgo_FinderShapeOn1::InnerPoints(const TopoDS_Edge& aE,
     aC3D->D0(aT, aP);
     aLP.Append(aP);
   }
-  //modified by NIZNHY-PKV Thu Jan 26 09:51:24 2012t
 }
 
 //=======================================================================
index f4f2f39a84925c2ac16a26c35936d74a090fb127..2b1b67d3877e0873ad21fd9915c86904878f316a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c255e35b7c0d915db5a0c4530d145ff0bac66121..e2e34de0fefe009075e38d742c2ee8e4c4bd879e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 //              <pkv@irinox>
 //
 #include <GEOMAlgo_FinderShapeOn2.hxx>
-#include <math.h>
-
-#include <Basics_OCCTVersion.hxx>
-
-#include <Precision.hxx>
-#include <TColStd_Array1OfInteger.hxx>
-#include <TColStd_MapOfInteger.hxx>
+#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
+#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
+#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
+#include <GEOMAlgo_PassKey.hxx>
+#include <GEOMAlgo_StateCollector.hxx>
+#include <GEOMAlgo_SurfaceTools.hxx>
 
-#include <gp_Trsf.hxx>
-#include <gp_Cylinder.hxx>
+#include <Bnd_Box.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepBndLib.hxx>
+#include <BRepMesh_IncrementalMesh.hxx>
+#include <BRepTools.hxx>
+#include <Geom_Curve.hxx>
+#include <Geom_Surface.hxx>
+#include <Geom2d_Line.hxx>
+#include <Geom2dAdaptor_Curve.hxx>
+#include <Geom2dHatch_Hatcher.hxx>
+#include <gp_Dir2d.hxx>
+#include <gp_Pnt2d.hxx>
 #include <gp_Pnt.hxx>
-
-#include <TColgp_Array1OfPnt.hxx>
-
+#include <gp_Trsf.hxx>
+#include <HatchGen_Domain.hxx>
+#include <IntTools_Tools.hxx>
 #include <Poly_Array1OfTriangle.hxx>
-#include <Poly_Triangle.hxx>
+#include <Poly_Polygon3D.hxx>
 #include <Poly_PolygonOnTriangulation.hxx>
+#include <Poly_Triangle.hxx>
 #include <Poly_Triangulation.hxx>
-#include <Poly_Polygon3D.hxx>
-
-#include <Geom_Curve.hxx>
-#include <Geom_Surface.hxx>
-#include <GeomAdaptor_Surface.hxx>
-#include <GeomAbs_SurfaceType.hxx>
-#include <GeomAdaptor_Curve.hxx>
-#include <GeomAbs_CurveType.hxx>
-
+#include <Precision.hxx>
+#include <TColgp_Array1OfPnt.hxx>
+#include <TColStd_Array1OfInteger.hxx>
+#include <TColStd_MapOfInteger.hxx>
 #include <TopAbs_State.hxx>
-
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
 #include <TopLoc_Location.hxx>
 #include <TopoDS.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Vertex.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Edge.hxx>
-
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-
 #include <TopTools_IndexedMapOfShape.hxx>
 
-#include <BRep_Tool.hxx>
-#include <BRepLib_MakeEdge.hxx>
-
-#include <GEOMAlgo_ListIteratorOfListOfPnt.hxx>
-#include <GEOMAlgo_SurfaceTools.hxx>
-#include <GEOMAlgo_StateCollector.hxx>
-#include <GEOMAlgo_FinderShapeOn.hxx>
-
-#include <GEOMAlgo_PassKey.hxx>
-#include <GEOMAlgo_DataMapOfPassKeyInteger.hxx>
-#include <GEOMAlgo_DataMapIteratorOfDataMapOfPassKeyInteger.hxx>
-//
-#include <gp_Dir2d.hxx>
-#include <gp_Pnt2d.hxx>
-#include <Geom2d_Line.hxx>
-#include <Geom2dAdaptor_Curve.hxx>
-#include <Geom2dHatch_Hatcher.hxx>
-#include <TColStd_ListOfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <HatchGen_Domain.hxx>
-#include <Geom2dHatch_Hatcher.hxx>
 #if OCC_VERSION_LARGE > 0x06070100
 #include <IntTools_Context.hxx>
 #else
 #include <BOPInt_Context.hxx>
 #endif
-#include <BRepTools.hxx>
-#include <IntTools_Tools.hxx>
 
 //=======================================================================
 //function : 
@@ -383,6 +362,8 @@ void GEOMAlgo_FinderShapeOn2::ProcessEdges()
     //
     const TopoDS_Edge& aE=TopoDS::Edge(aM(i));
     //
+    bIsConformState=Standard_False;
+    //
     aExp.Init(aE, TopAbs_VERTEX);
     for (; aExp.More(); aExp.Next()) {
       const TopoDS_Shape& aV=aExp.Current();
@@ -496,6 +477,9 @@ void GEOMAlgo_FinderShapeOn2::ProcessFaces()
       }
     }
     //
+    //
+    bIsConformState=Standard_False;
+    //
     aExp.Init(aF, TopAbs_EDGE);
     for (; aExp.More(); aExp.Next()) {
       const TopoDS_Shape& aE=aExp.Current();
@@ -579,6 +563,9 @@ void GEOMAlgo_FinderShapeOn2::ProcessSolids()
     const TopoDS_Shape& aSd=aM(i);
     aMF.Clear();
     TopExp::MapShapes(aSd, TopAbs_FACE, aMF);
+    //
+    bIsConformState=Standard_False;
+    //
     aNbF=aMF.Extent();
     for (j=1; j<=aNbF; ++j) {
       const TopoDS_Shape& aF=aMF(j);
@@ -626,7 +613,7 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Face& aF,
   //
   aTRF=BRep_Tool::Triangulation(aF, aLoc);
   if (aTRF.IsNull()) {
-    if (!GEOMAlgo_FinderShapeOn::BuildTriangulation(aF)) {
+    if (!BuildTriangulation(aF)) {
       myWarningStatus=20; // no triangulation found
       return;
     }
@@ -770,7 +757,7 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
   if (aTRE.IsNull() || aPTE.IsNull()) {
     Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(aE, aLoc);
     if (aPE.IsNull()) {
-      if (!GEOMAlgo_FinderShapeOn::BuildTriangulation(aE)) {
+      if (!BuildTriangulation(aE)) {
         myErrorStatus=20; // no triangulation found
         return;
       }
@@ -841,6 +828,59 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
   }
 }
 
+//=======================================================================
+//function : BuildTriangulation
+//purpose  :
+//=======================================================================
+Standard_Boolean
+  GEOMAlgo_FinderShapeOn2::BuildTriangulation (const TopoDS_Shape& theShape)
+{
+  // calculate deflection
+  Standard_Real aDeviationCoefficient = 0.001;
+
+  Bnd_Box B;
+  BRepBndLib::Add(theShape, B);
+  Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+  B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
+
+  Standard_Real dx = aXmax - aXmin, dy = aYmax - aYmin, dz = aZmax - aZmin;
+  Standard_Real aDeflection = Max(Max(dx, dy), dz) * aDeviationCoefficient * 4;
+  Standard_Real aHLRAngle = 0.349066;
+
+  // build triangulation
+  BRepMesh_IncrementalMesh Inc (theShape, aDeflection, Standard_False, aHLRAngle);
+
+  // check triangulation
+  bool isTriangulation = true;
+
+  TopExp_Explorer exp (theShape, TopAbs_FACE);
+  if (exp.More())
+  {
+    TopLoc_Location aTopLoc;
+    Handle(Poly_Triangulation) aTRF;
+    aTRF = BRep_Tool::Triangulation(TopoDS::Face(exp.Current()), aTopLoc);
+    if (aTRF.IsNull()) {
+      isTriangulation = false;
+    }
+  }
+  else // no faces, try edges
+  {
+    TopExp_Explorer expe (theShape, TopAbs_EDGE);
+    if (!expe.More()) {
+      isTriangulation = false;
+    }
+    else {
+      TopLoc_Location aLoc;
+      Handle(Poly_Polygon3D) aPE = BRep_Tool::Polygon3D(TopoDS::Edge(expe.Current()), aLoc);
+      if (aPE.IsNull()) {
+        isTriangulation = false;
+      }
+    }
+  }
+
+  return isTriangulation;
+}
+
 //
 // myErrorStatus :
 //
@@ -854,60 +894,3 @@ void GEOMAlgo_FinderShapeOn2::InnerPoints(const TopoDS_Edge& aE,
 // 40- point can not be classified
 // 41- invalid data for classifier
 // 42- can not compute hatching 
-
-/*
-// A
-if (!aNb && myNbPntsMin) {
-    // try to fill it yourself
-    Standard_Boolean bIsDone;
-    Standard_Integer aN1, aN2;
-    Handle(Geom_Surface) aS;
-    GeomAdaptor_Surface aGAS;
-    GeomAbs_SurfaceType aType;
-    //
-    aS=BRep_Tool::Surface(aF);
-    aGAS.Load(aS);
-    aType=aGAS.GetType();
-    if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder) {
-      // inner links
-      aNbLinks=aMPKI.Extent();
-      aIt.Initialize(aMPKI);
-      for (; aIt.More(); aIt.Next()) {
-        iCnt=aIt.Value();
-        if (iCnt>1) {
-          // take the first having occured inner link
-          // and discretize it
-          const GEOMAlgo_PassKey& aPK=aIt.Key();
-          //
-          aN1=(Standard_Integer)aPK.Id(1);
-          aN2=(Standard_Integer)aPK.Id(2);
-          //
-          aP1=aNodes(aN1).Transformed(aTrsf);
-          aP2=aNodes(aN2).Transformed(aTrsf);
-          //
-          if (aType==GeomAbs_Cylinder) {
-            gp_Cylinder aCyl;
-            //
-            aCyl=aGAS.Cylinder();
-            if (!GEOMAlgo_SurfaceTools::IsCoaxial(aP1, aP2, aCyl, myTolerance)) {
-              continue;
-            }
-          }
-          //
-          BRepLib_MakeEdge aBME(aP1, aP2);
-          bIsDone=aBME.IsDone();
-          if (!bIsDone) {
-            myErrorStatus=30; //can not obtain the line fron the link
-            return;
-          }
-          //
-          const TopoDS_Shape& aSx=aBME.Shape();
-          const TopoDS_Edge& aE=TopoDS::Edge(aSx);
-          //
-          InnerPoints(aE, myNbPntsMin, aLP);
-          break;
-        }// if (iCnt>1)
-      }// for (; aIt.More(); aIt.Next())
-    }// if (aType==GeomAbs_Plane || aType==GeomAbs_Cylinder)
-  }// if (!aNb && myNbPntsMin) {
-*/
index 4b6d73bb33896435ab48fdc521f79201afc43838..d4fea6af9d5bcff12b1e551b7e7f5d19200c6632 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -126,6 +126,9 @@ protected:
                      const Standard_Integer aNbPnts,
                      GEOMAlgo_ListOfPnt& aLP) ;
 
+  Standard_EXPORT
+    Standard_Boolean BuildTriangulation(const TopoDS_Shape& aS) ;
+
 
   TopAbs_ShapeEnum myShapeType;
   GEOMAlgo_State myState;
index c28cd220cd9e212a03760311f23186a29cbf09df..6bfa6855a9c746afbbee004c2aebff9221982d75 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index eca69d42405a0d76de0b708ec16f0e2c986565b3..19ae306f12c775e70c2a6c3c0b266b8054f05601 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 718b25f6768935d67dcff9c855b3854832bda216..b66e897993235b0348b0f56e05276731a78911a3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f10eafca5d705ae5ae26f66a5e6ddaeec5bec1cf..69a8bd7ee96025664fd80bb2deeddb43c394dcf2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
diff --git a/src/GEOMAlgo/GEOMAlgo_GetInPlaceAPI.cxx b/src/GEOMAlgo/GEOMAlgo_GetInPlaceAPI.cxx
new file mode 100644 (file)
index 0000000..878faf1
--- /dev/null
@@ -0,0 +1,432 @@
+// 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
+//
+// File:     GEOMAlgo_GetInPlaceAPI.cxx
+// Created:
+// Author:   Sergey KHROMOV
+
+
+#include <GEOMAlgo_GetInPlaceAPI.hxx>
+#include <GEOMAlgo_GetInPlace.hxx>
+#include <GEOM_Function.hxx>
+#include <GEOM_Object.hxx>
+#include <GEOMUtils.hxx>
+
+#include <Bnd_Box.hxx>
+#include <BRepAdaptor_Surface.hxx>
+#include <BRepBndLib.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRepExtrema_DistShapeShape.hxx>
+#include <BRepGProp.hxx>
+#include <BRep_Tool.hxx>
+#include <Geom2d_Curve.hxx>
+#include <GProp_GProps.hxx>
+#include <gp_Pnt.hxx>
+#include <Precision.hxx>
+#include <TDataStd_IntegerArray.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Vertex.hxx>
+#include <TopTools_MapOfShape.hxx>
+
+
+//=======================================================================
+//function : GetInPlace
+//purpose  : 
+//=======================================================================
+Standard_Boolean GEOMAlgo_GetInPlaceAPI::GetInPlace
+                      (const TopoDS_Shape        &theWhere,
+                       const TopoDS_Shape        &theWhat,
+                             GEOMAlgo_GetInPlace &theGIP)
+{
+  if (theWhere.IsNull() || theWhat.IsNull()) {
+    return Standard_False;
+  }
+
+  // Compute confusion tolerance.
+  Standard_Real    aTolConf = Precision::Confusion();
+  Standard_Integer i;
+
+  for (i = 0; i < 2; ++i) {
+    TopExp_Explorer anExp(i == 0 ? theWhere : theWhat, TopAbs_VERTEX);
+
+    for (; anExp.More(); anExp.Next()) {
+      const TopoDS_Vertex aVtx = TopoDS::Vertex(anExp.Current());
+      const Standard_Real aTolVtx = BRep_Tool::Tolerance(aVtx);
+
+      if (aTolVtx > aTolConf) {
+        aTolConf = aTolVtx;
+      }
+    }
+  }
+
+  // Compute mass tolerance.
+  Bnd_Box       aBoundingBox;
+  Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+  Standard_Real aMassTol;
+
+  BRepBndLib::Add(theWhere, aBoundingBox);
+  BRepBndLib::Add(theWhat,  aBoundingBox);
+  aBoundingBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
+  aMassTol = Max(aXmax - aXmin, aYmax - aYmin);
+  aMassTol = Max(aMassTol, aZmax - aZmin);
+  aMassTol *= aTolConf;
+
+  // Searching for the sub-shapes inside the ShapeWhere shape
+  theGIP.SetTolerance(aTolConf);
+  theGIP.SetTolMass(aMassTol);
+  theGIP.SetTolCG(aTolConf);
+
+  theGIP.SetArgument(theWhat);
+  theGIP.SetShapeWhere(theWhere);
+
+  theGIP.Perform();
+
+  int iErr = theGIP.ErrorStatus();
+
+  if (iErr) {
+    return Standard_False;
+  }
+
+  return Standard_True;
+}
+
+//=======================================================================
+//function : GetInPlaceOld
+//purpose  : 
+//=======================================================================
+Standard_Integer GEOMAlgo_GetInPlaceAPI::GetInPlaceOld
+            (const TopoDS_Shape         &theWhere,
+             const TopoDS_Shape         &theWhat,
+                   TopTools_ListOfShape &theShapesInPlace)
+{
+  theShapesInPlace.Clear();
+
+  if (theWhere.IsNull() || theWhat.IsNull()) {
+    // Error: aWhere and aWhat TopoDS_Shape are Null.
+    return 1;
+  }
+
+  // Check shape type.
+  TopAbs_ShapeEnum iType = GEOMUtils::GetTypeOfSimplePart(theWhat);
+
+  if (iType == TopAbs_SHAPE) {
+    // Error: An attempt to extract a shape of not supported type.
+    return 2;
+  }
+
+  // Compute confusion tolerance.
+  Standard_Real    aTolConf = Precision::Confusion();
+  Standard_Integer i;
+
+  for (i = 0; i < 2; ++i) {
+    TopExp_Explorer anExp(i == 0 ? theWhere : theWhat, TopAbs_VERTEX);
+
+    for (; anExp.More(); anExp.Next()) {
+      const TopoDS_Vertex aVtx = TopoDS::Vertex(anExp.Current());
+      const Standard_Real aTolVtx = BRep_Tool::Tolerance(aVtx);
+
+      if (aTolVtx > aTolConf) {
+        aTolConf = aTolVtx;
+      }
+    }
+  }
+
+  // Compute mass tolerance.
+  Bnd_Box       aBoundingBox;
+  Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+  Standard_Real aMassTol;
+
+  BRepBndLib::Add(theWhere, aBoundingBox);
+  BRepBndLib::Add(theWhat,  aBoundingBox);
+  aBoundingBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
+  aMassTol = Max(aXmax - aXmin, aYmax - aYmin);
+  aMassTol = Max(aMassTol, aZmax - aZmin);
+  aMassTol *= aTolConf;
+
+  // Compute the result.
+  TopExp_Explorer     Exp_aWhat  (theWhat,  iType);
+  TopExp_Explorer     Exp_aWhere (theWhere, iType);
+  Standard_Real       tab_aWhat[4], tab_aWhere[4];
+  gp_Pnt              aPnt, aPnt_aWhat;
+  TopoDS_Shape        aPntShape;
+  TopoDS_Vertex       aVertex;
+  bool                isFound = false;
+  TopTools_MapOfShape map_aWhere;
+
+  for (; Exp_aWhere.More(); Exp_aWhere.Next()) {
+    if (!map_aWhere.Add(Exp_aWhere.Current()))
+      continue; // skip repeated shape to avoid mass addition
+    GetShapeProperties( Exp_aWhere.Current(), tab_aWhere, aPnt );
+    for ( Exp_aWhat.ReInit(); Exp_aWhat.More(); Exp_aWhat.Next() ) {
+      GetShapeProperties( Exp_aWhat.Current(), tab_aWhat, aPnt_aWhat );
+      if (fabs(tab_aWhat[3] - tab_aWhere[3]) <= aMassTol && aPnt_aWhat.Distance(aPnt) <= aTolConf)
+        isFound = true;
+      else {
+        if (tab_aWhat[3] > tab_aWhere[3]) {
+          aPntShape = BRepBuilderAPI_MakeVertex( aPnt ).Shape();
+          aVertex   = TopoDS::Vertex( aPntShape );
+          BRepExtrema_DistShapeShape aWhereDistance ( aVertex, Exp_aWhere.Current() );
+          BRepExtrema_DistShapeShape aWhatDistance  ( aVertex, Exp_aWhat.Current() );
+          if (aWhereDistance.IsDone() && aWhatDistance.IsDone() &&
+              fabs(aWhereDistance.Value() - aWhatDistance.Value()) <= aTolConf)
+          {
+            // 0020162: "EDF 961 GEOM : Getinplace is getting additionnal orthogonal faces"
+            // aVertex must be projected to the same point on Where and on What
+            gp_Pnt pOnWhat  = aWhatDistance.PointOnShape2(1);
+            gp_Pnt pOnWhere = aWhereDistance.PointOnShape2(1);
+            isFound = (pOnWhat.Distance(pOnWhere) <= aTolConf);
+            if ( isFound && iType == TopAbs_FACE )
+            {
+              // check normals at pOnWhat and pOnWhere
+              const double angleTol = M_PI/180.;
+              gp_Vec normToWhat  = GetNormal( TopoDS::Face(Exp_aWhat.Current()), aWhatDistance);
+              gp_Vec normToWhere = GetNormal( TopoDS::Face(Exp_aWhere.Current()), aWhereDistance);
+              if ( normToWhat * normToWhere < 0 )
+                normToWhat.Reverse();
+              isFound = ( normToWhat.Angle( normToWhere ) < angleTol );
+            }
+          }
+        }
+      }
+      if ( isFound ) {
+        theShapesInPlace.Append(Exp_aWhere.Current());
+        //aWhere_Mass += tab_aWhere[3];
+        isFound = false;
+        break;
+      }
+    }
+  }
+
+  if (theShapesInPlace.Extent() == 0) {
+    // Not found any Results
+    return 3;
+  }
+
+  return 0;
+}
+
+//=======================================================================
+//function : GetNormal
+//purpose  : 
+//=======================================================================
+gp_Vec GEOMAlgo_GetInPlaceAPI::GetNormal
+                         (const TopoDS_Face                &theFace,
+                          const BRepExtrema_DistShapeShape &theExtrema)
+{
+  gp_Vec defaultNorm(1,0,0); // to have same normals on different faces
+  try {
+    // get UV at extrema point
+    Standard_Real u,v, f,l;
+    switch ( theExtrema.SupportTypeShape2(1) ) {
+    case BRepExtrema_IsInFace: {
+      theExtrema.ParOnFaceS2(1, u, v );
+      break;
+    }
+    case BRepExtrema_IsOnEdge: {
+      TopoDS_Edge edge = TopoDS::Edge( theExtrema.SupportOnShape2(1));
+      Handle(Geom2d_Curve) pcurve =
+        BRep_Tool::CurveOnSurface(edge, theFace, f,l);
+
+      theExtrema.ParOnEdgeS2( 1, u );
+      gp_Pnt2d uv = pcurve->Value( u );
+      u = uv.Coord(1);
+      v = uv.Coord(2);
+      break;
+    }
+    case BRepExtrema_IsVertex: return defaultNorm;
+    }
+    // get derivatives
+    BRepAdaptor_Surface surface( theFace, false );
+    gp_Vec du, dv; gp_Pnt p;
+    surface.D1( u, v, p, du, dv );
+
+    return du ^ dv;
+
+  } catch (Standard_Failure ) {
+  }
+  return defaultNorm;
+}
+
+//=======================================================================
+//function : GetShapeProperties
+//purpose  : 
+//=======================================================================
+void GEOMAlgo_GetInPlaceAPI::GetShapeProperties(const TopoDS_Shape  &theShape,
+                                                      Standard_Real  theTab[],
+                                                      gp_Pnt        &theVertex)
+{
+  GProp_GProps  aProps;
+  gp_Pnt        aCenterMass;
+  Standard_Real aShapeSize;
+
+  if    (theShape.ShapeType() == TopAbs_VERTEX) {
+    aCenterMass = BRep_Tool::Pnt(TopoDS::Vertex(theShape));
+  } else if (theShape.ShapeType() == TopAbs_EDGE) {
+    BRepGProp::LinearProperties(theShape,  aProps);
+  } else if (theShape.ShapeType() == TopAbs_FACE) {
+    BRepGProp::SurfaceProperties(theShape, aProps);
+  } else {
+    BRepGProp::VolumeProperties(theShape,  aProps);
+  }
+
+  if (theShape.ShapeType() == TopAbs_VERTEX) {
+    aShapeSize = 1;
+  } else {
+    aCenterMass = aProps.CentreOfMass();
+    aShapeSize  = aProps.Mass();
+  }
+
+  theVertex = aCenterMass;
+  theTab[0] = theVertex.X();
+  theTab[1] = theVertex.Y();
+  theTab[2] = theVertex.Z();
+  theTab[3] = aShapeSize;
+}
+
+//=======================================================================
+//function : GetInPlaceByHistory
+//purpose  : 
+//=======================================================================
+Standard_Boolean GEOMAlgo_GetInPlaceAPI::GetInPlaceByHistory
+                      (const Handle(GEOM_Function)      &theWhereFunction,
+                       const TopTools_IndexedMapOfShape &theWhereIndices,
+                       const TopoDS_Shape               &theWhat,
+                             TopTools_ListOfShape       &theShapesInPlace)
+{
+  if (theWhereFunction.IsNull() || theWhat.IsNull())
+    return Standard_False;
+
+  if (theWhereIndices.Contains(theWhat)) {
+    // entity was not changed by the operation
+    theShapesInPlace.Append(theWhat);
+
+    return Standard_True;
+  }
+
+  // try to find in history
+  TDF_Label aHistoryLabel = theWhereFunction->GetHistoryEntry(Standard_False);
+
+  // search in history for all argument shapes
+  Standard_Boolean isFound = Standard_False;
+  Standard_Boolean isGood = Standard_False;
+
+  TDF_LabelSequence aLabelSeq;
+  theWhereFunction->GetDependency(aLabelSeq);
+  Standard_Integer nbArg = aLabelSeq.Length();
+
+  for (Standard_Integer iarg = 1; iarg <= nbArg && !isFound; iarg++) {
+
+    TDF_Label anArgumentRefLabel = aLabelSeq.Value(iarg);
+
+    Handle(GEOM_Object) anArgumentObject = GEOM_Object::GetReferencedObject(anArgumentRefLabel);
+    TopoDS_Shape anArgumentShape = anArgumentObject->GetValue();
+
+    TopTools_IndexedMapOfShape anArgumentIndices;
+    TopExp::MapShapes(anArgumentShape, anArgumentIndices);
+
+    if (anArgumentIndices.Contains(theWhat)) {
+      isFound = Standard_True;
+      Standard_Integer aWhatIndex = anArgumentIndices.FindIndex(theWhat);
+
+      // Find corresponding label in history
+      TDF_Label anArgumentHistoryLabel =
+        theWhereFunction->GetArgumentHistoryEntry(anArgumentRefLabel, Standard_False);
+      if (anArgumentHistoryLabel.IsNull()) {
+        // Lost History of operation argument. Possibly, all its entities was removed.
+        isGood = Standard_True;
+      }
+      else {
+        TDF_Label aWhatHistoryLabel = anArgumentHistoryLabel.FindChild(aWhatIndex, Standard_False);
+
+        if (aWhatHistoryLabel.IsNull()) {
+          // Removed entity ? Compound ? Compsolid ? Shell ? Wire
+          isGood = Standard_False;
+        } else {
+          Handle(TDataStd_IntegerArray) anIntegerArray;
+          if (!aWhatHistoryLabel.FindAttribute(TDataStd_IntegerArray::GetID(), anIntegerArray)) {
+            //Error: Empty modifications history for the sought shape.
+            isGood = Standard_False;
+          }
+          else {
+            isGood = Standard_True;
+            Standard_Integer imod, aModifLen = anIntegerArray->Array()->Length();
+            for (imod = 1; imod <= aModifLen; imod++) {
+              const Standard_Integer anIndex =
+                anIntegerArray->Array()->Value(imod);
+
+              theShapesInPlace.Append(theWhereIndices.FindKey(anIndex));
+            }
+          }
+        }
+      }
+    }
+  }
+
+  isFound = isGood;
+
+  if (!isFound) {
+    // try compound/compsolid/shell/wire element by element
+    Standard_Boolean isFoundAny = Standard_False;
+    TopTools_MapOfShape mapShape;
+
+    if (theWhat.ShapeType() == TopAbs_COMPOUND ||
+        theWhat.ShapeType() == TopAbs_COMPSOLID) {
+      // recursive processing of compound/compsolid
+      TopoDS_Iterator anIt (theWhat, Standard_True, Standard_True);
+      for (; anIt.More(); anIt.Next()) {
+        if (mapShape.Add(anIt.Value())) {
+          TopoDS_Shape curWhat = anIt.Value();
+          isFoundAny = GetInPlaceByHistory(theWhereFunction, theWhereIndices, curWhat, theShapesInPlace);
+          if (isFoundAny) isFound = Standard_True;
+        }
+      }
+    }
+    else if (theWhat.ShapeType() == TopAbs_SHELL) {
+      // try to replace a shell by its faces images
+      TopExp_Explorer anExp (theWhat, TopAbs_FACE);
+      for (; anExp.More(); anExp.Next()) {
+        if (mapShape.Add(anExp.Current())) {
+          TopoDS_Shape curWhat = anExp.Current();
+          isFoundAny = GetInPlaceByHistory(theWhereFunction, theWhereIndices, curWhat, theShapesInPlace);
+          if (isFoundAny) isFound = Standard_True;
+        }
+      }
+    }
+    else if (theWhat.ShapeType() == TopAbs_WIRE) {
+      // try to replace a wire by its edges images
+      TopExp_Explorer anExp (theWhat, TopAbs_EDGE);
+      for (; anExp.More(); anExp.Next()) {
+        if (mapShape.Add(anExp.Current())) {
+          TopoDS_Shape curWhat = anExp.Current();
+          isFoundAny = GetInPlaceByHistory(theWhereFunction, theWhereIndices, curWhat, theShapesInPlace);
+          if (isFoundAny) isFound = Standard_True;
+        }
+      }
+    }
+    else {
+      // Removed entity
+    }
+  }
+
+  return isFound;
+}
diff --git a/src/GEOMAlgo/GEOMAlgo_GetInPlaceAPI.hxx b/src/GEOMAlgo/GEOMAlgo_GetInPlaceAPI.hxx
new file mode 100644 (file)
index 0000000..7f89037
--- /dev/null
@@ -0,0 +1,111 @@
+// 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
+//
+// File:        GEOMAlgo_GetInPlaceAPI.hxx
+// Created:
+// Author:      Sergey KHROMOV
+
+#ifndef _GEOMAlgo_GetInPlaceAPI_HeaderFile
+#define _GEOMAlgo_GetInPlaceAPI_HeaderFile
+
+
+#include <gp_Vec.hxx>
+
+class GEOMAlgo_GetInPlace;
+class Handle_GEOM_Function;
+class BRepExtrema_DistShapeShape;
+class TopoDS_Face;
+class TopoDS_Shape;
+class TopTools_IndexedMapOfShape;
+class TopTools_ListOfShape;
+
+
+/**
+ * This is an API class for all GetInPlace algorithm.
+ * It facilitates using different GetInPlace algorithms:
+ * a new one(GEOMAlgo_GetInPlace), an old one and
+ * GetInPlaceByHistory.
+ */
+class GEOMAlgo_GetInPlaceAPI
+{
+
+public:
+
+  /**
+   *  \brief New GetInPlace method implementation.
+   *  Initializes the GEOMAlgo_GetInPlace object with correct parameters and
+   *  performs computation (calls theGIP's method Perform. Returns
+   *  Standard_True in face of success; Standard_False otherwise.
+   */
+  Standard_EXPORT static Standard_Boolean GetInPlace
+                      (const TopoDS_Shape        &theWhere,
+                       const TopoDS_Shape        &theWhat,
+                             GEOMAlgo_GetInPlace &theGIP);
+
+  /*!
+   *  \brief Old implementation of GetInPlace algoritm.
+   *  This method searches among sub shapes of the shape theWhere parts that are
+   *  coincident with the shape theWhat. The result list of shape is returned as
+   *  an output parameter. It returns the error code with the following possible
+   *  values:
+   *    0 - Success;
+   *    1 - theWhere and/or theWhat TopoDS_Shape are Null;
+   *    2 - An attempt to extract a shape of not supported type;
+   *    3 - Not found any Results.
+   */
+  Standard_EXPORT static Standard_Integer GetInPlaceOld
+            (const TopoDS_Shape         &theWhere,
+             const TopoDS_Shape         &theWhat,
+                   TopTools_ListOfShape &theShapesInPlace);
+
+
+  /**
+   *  \brief GetInPlaceByHistory method implementation.
+   *  Returns Standard_True if something is found. Warning: theShapesInPlace
+   *  list is not cleared at first.
+   */
+  Standard_EXPORT static Standard_Boolean GetInPlaceByHistory
+                      (const Handle_GEOM_Function       &theWhereFunction,
+                       const TopTools_IndexedMapOfShape &theWhereIndices,
+                       const TopoDS_Shape               &theWhat,
+                             TopTools_ListOfShape       &theShapesInPlace);
+
+protected:
+
+  /*!
+   * \brief Return normal to face at extrema point
+   */
+  static gp_Vec GetNormal(const TopoDS_Face                &theFace,
+                          const BRepExtrema_DistShapeShape &theExtrema);
+
+  /*!
+   * Return the global properties of the shape: center of mass and
+   * a size (length, area or volume depending on the shape type).
+   */
+  static void GetShapeProperties(const TopoDS_Shape  &theShape,
+                                       Standard_Real  theTab[],
+                                       gp_Pnt        &theVertex);
+
+};
+
+
+
+#endif
index 168eeffbc4de5ca04106dbe267a629320fe4b4c8..03416d293fa26c0b8cfc1ca0f229a4e6a1196d0c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -239,7 +239,6 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
   gp_Pnt aPx;
   gp_Pnt2d aP2Dx;
   gp_Vec aDNx;
-
   TopoDS_Face aF;
   TopExp_Explorer aExp;
   //
@@ -247,9 +246,8 @@ Standard_Integer PntInSolid(const TopoDS_Solid& aZ,
   aCoef=10.;
   //
   aExp.Init (aZ, TopAbs_FACE);
-  for (; aExp.More() ; aExp.Next()) {
+  if (aExp.More()) {
     aF=*((TopoDS_Face*)&aExp.Current());
-    break;
   }
   //
   iErr=PntInFace(aF, aPx, aP2Dx);
@@ -368,29 +366,31 @@ Standard_Integer PntInFace(const TopoDS_Face& aF,
   //
   // 4.
   aNbDomains=aHatcher.NbDomains(aIx);
-  for (i=1; i<=aNbDomains; ++i) {
-    const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
-    bHasFirstPoint=aDomain.HasFirstPoint();
-    if (!bHasFirstPoint) {
-      iErr=5;
-      return iErr;
-    }
-    //
-    aV1=aDomain.FirstPoint().Parameter();
-    //
-    bHasSecondPoint=aDomain.HasSecondPoint();
-    if (!bHasSecondPoint) {
-      iErr=6;
-      return iErr;
-    }
-    //
-    aV2=aDomain.SecondPoint().Parameter();
-    //
-    aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
-    //
-    break;
+  if (!aNbDomains) {
+    iErr=5;
+    return iErr;
+  }
+  //
+  i=1;
+  const HatchGen_Domain& aDomain=aHatcher.Domain (aIx, i) ;
+  bHasFirstPoint=aDomain.HasFirstPoint();
+  if (!bHasFirstPoint) {
+    iErr=5;
+    return iErr;
+  }
+  //
+  aV1=aDomain.FirstPoint().Parameter();
+  //
+  bHasSecondPoint=aDomain.HasSecondPoint();
+  if (!bHasSecondPoint) {
+    iErr=6;
+    return iErr;
   }
   //
+  aV2=aDomain.SecondPoint().Parameter();
+  //
+  aVx=IntTools_Tools::IntermediatePoint(aV1, aV2);
+  //
   aS->D0(aUx, aVx, aPx);
   //
   theP2D.SetCoord(aUx, aVx);
index 0ac5242e1afc33e372ac0852c9d657501fe0159e..f4faf30f40e32b5c5c2f11ea8664be52c8b8583d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 5e77dd3beb62ca18692829f9dfe6cf449e957340..def0e05e5c8831aa93d4f96a81b1a0b5a26e4e26 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3c44e5137d68b299b3245b0a4a5d0c5a812ba155..57c7bd8e9c14893f77195be66b5b2c070a4b599a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 9ee1e43cb0137c6ded6014f3e2b09cf15e9f5eea..6f9de81d8532f94d62dd9faf93079ed653f7ee89 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 32ab2acefc22088cd6c3b705a1f441ead6c1da9b..bad1fe01f67b65b720463b5deea102cc61b7220c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -90,7 +90,6 @@ GEOMAlgo_GlueDetector::GEOMAlgo_GlueDetector()
 //=======================================================================
 GEOMAlgo_GlueDetector::~GEOMAlgo_GlueDetector()
 {}
-//modified by NIZNHY-PKV Tue Mar 13 12:26:50 2012f
 //=======================================================================
 //function : StickedShapes
 //purpose  :
@@ -100,7 +99,6 @@ const TopTools_IndexedDataMapOfShapeListOfShape&
 {
   return myStickedShapes;
 }
-//modified by NIZNHY-PKV Tue Mar 13 12:26:54 2012t
 //=======================================================================
 //function : Perform
 //purpose  :
@@ -124,12 +122,10 @@ void GEOMAlgo_GlueDetector::Perform()
     return;
   }
   //
-  //modified by NIZNHY-PKV Wed Mar 14 08:00:09 2012f
   CheckDetected();
   if (myErrorStatus) {
     return;
   }
-  //modified by NIZNHY-PKV Wed Mar 14 08:00:12 2012t
   //
   DetectEdges();
   if (myErrorStatus) {
@@ -206,7 +202,7 @@ void GEOMAlgo_GlueDetector::DetectVertices()
     TColStd_MapIteratorOfMapOfInteger aIt1;
     //
     aMIP.Add(i);
-    while(1) {
+    for(;;) {
       aNbIP=aMIP.Extent();
       aIt1.Initialize(aMIP);
       for(; aIt1.More(); aIt1.Next()) {
@@ -460,7 +456,6 @@ void GEOMAlgo_GlueDetector::EdgePassKey(const TopoDS_Edge& aE,
   //
   aPK.SetShapes(aLV);
 }
-//modified by NIZNHY-PKV Tue Mar 13 09:54:18 2012f
 //=======================================================================
 //function : CheckDetected
 //purpose  :
@@ -607,4 +602,3 @@ Standard_Integer CheckAncesstors
   //
   return iRet;
 }
-//modified by NIZNHY-PKV Tue Mar 13 09:54:59 2012t
index 0d298f45829a220ff526a3d094a21f7040b521dc..14ef5b6e0c913c783fbc44c0ca268e86ad9600a8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
old mode 100755 (executable)
new mode 100644 (file)
index 7740b1e..d9f8079
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-// File:       GEOMAlgo_Gluer.cxx
-// Created:    Sat Dec 04 12:45:53 2004
-// Author:     Peter KURNEV
-//             <peter@PREFEX>
+// File: GEOMAlgo_Gluer.cxx
+// Created: Sat Dec 04 12:45:53 2004
+// Author: Peter KURNEV
+//  <peter@PREFEX>
 //
 #include <GEOMAlgo_Gluer.hxx>
 
 //
 static
   void GetSubShapes(const TopoDS_Shape& aS,
-                   TopTools_IndexedMapOfShape& aMSS);
+      TopTools_IndexedMapOfShape& aMSS);
 
 //=======================================================================
 //function : GEOMAlgo_Gluer
@@ -228,10 +228,7 @@ void GEOMAlgo_Gluer::MakeVertices()
   TopTools_DataMapIteratorOfDataMapOfShapeListOfShape aItIm;
   TopTools_DataMapOfShapeListOfShape aMVV;
   GEOMAlgo_IndexedDataMapOfIntegerShape aMIS;
-  //modified by NIZNHY-PKV Thu Jan 21 10:03:07 2010f
-  //GEOMAlgo_IndexedDataMapOfShapeBox aMSB;
   GEOMAlgo_IndexedDataMapOfShapeBndSphere aMSB;
-  //modified by NIZNHY-PKV Thu Jan 21 10:03:10 2010t
   //
   GEOMAlgo_BndSphereTreeSelector aSelector;
   GEOMAlgo_BndSphereTree aBBTree;
@@ -278,57 +275,54 @@ void GEOMAlgo_Gluer::MakeVertices()
     TColStd_MapIteratorOfMapOfInteger aIt1;
     //
     aMIP.Add(i);
-    while(1) {
+    for(;;) {
       aNbIP=aMIP.Extent();
       aIt1.Initialize(aMIP);
       for(; aIt1.More(); aIt1.Next()) {
-       aIP=aIt1.Key();
-       if (aMIPC.Contains(aIP)) {
-         continue;
-       }
-       //
-       const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
-       //modified by NIZNHY-PKV Thu Jan 21 10:04:09 2010f
-       const GEOMAlgo_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
-       //const Bnd_Box& aBoxVP=aMSB.FindFromKey(aVP);
-       //modified by NIZNHY-PKV Thu Jan 21 10:04:11 2010t
-       //
-       aSelector.Clear();
-       aSelector.SetBox(aBoxVP);
-       //
-       aNbVSD=aBBTree.Select(aSelector);
-       if (!aNbVSD) {
-         continue;  // it must not be
-       }
-       //
-       const TColStd_ListOfInteger& aLI=aSelector.Indices();
-       //
-       aIt.Initialize(aLI);
-       for (; aIt.More(); aIt.Next()) {
-         aIP1=aIt.Value();
-         if (aMIP.Contains(aIP1)) {
-           continue;
-         }
-         aMIP1.Add(aIP1);
-       } //for (; aIt.More(); aIt.Next()) {
+        aIP=aIt1.Key();
+        if (aMIPC.Contains(aIP)) {
+          continue;
+        }
+        //
+        const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+        const GEOMAlgo_BndSphere& aBoxVP=aMSB.FindFromKey(aVP);
+        //
+        aSelector.Clear();
+        aSelector.SetBox(aBoxVP);
+        //
+        aNbVSD=aBBTree.Select(aSelector);
+        if (!aNbVSD) {
+          continue;  // it must not be
+ }
+        //
+        const TColStd_ListOfInteger& aLI=aSelector.Indices();
+        //
+        aIt.Initialize(aLI);
+        for (; aIt.More(); aIt.Next()) {
+          aIP1=aIt.Value();
+          if (aMIP.Contains(aIP1)) {
+            continue;
+          }
+          aMIP1.Add(aIP1);
+        } //for (; aIt.More(); aIt.Next()) {
       }//for(; aIt1.More(); aIt1.Next()) {
       //
       aNbIP1=aMIP1.Extent();
       if (!aNbIP1) {
-       break;
+        break;
       }
       //
       aIt1.Initialize(aMIP);
       for(; aIt1.More(); aIt1.Next()) {
-       aIP=aIt1.Key();
-       aMIPC.Add(aIP);
+        aIP=aIt1.Key();
+        aMIPC.Add(aIP);
       }
       //
       aMIP.Clear();
       aIt1.Initialize(aMIP1);
       for(; aIt1.More(); aIt1.Next()) {
-       aIP=aIt1.Key();
-       aMIP.Add(aIP);
+        aIP=aIt1.Key();
+        aMIP.Add(aIP);
       }
       aMIP1.Clear();
     }// while(1)
@@ -344,13 +338,13 @@ void GEOMAlgo_Gluer::MakeVertices()
     else { // SD vertices founded [ aMIPC ]
       aIt1.Initialize(aMIPC);
       for(j=0; aIt1.More(); aIt1.Next(), ++j) {
-       aIP=aIt1.Key();
-       const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
-       if (!j) {
-         aVF=aVP;
-       }
-       aLVSD.Append(aVP);
-       aMVProcessed.Add(aVP);
+        aIP=aIt1.Key();
+        const TopoDS_Shape& aVP=aMIS.FindFromKey(aIP);
+        if (!j) {
+          aVF=aVP;
+        }
+        aLVSD.Append(aVP);
+        aMVProcessed.Add(aVP);
       }
     }
     myImages.Bind(aVF, aLVSD);
@@ -395,7 +389,7 @@ void GEOMAlgo_Gluer::MakeVertices()
     for (; aItS.More(); aItS.Next()) {
       const TopoDS_Shape& aVSD=aItS.Value();
       if (!myOrigins.IsBound(aVSD)) {
-       myOrigins.Bind(aVSD, aV);
+        myOrigins.Bind(aVSD, aV);
       }
     }
   }
@@ -468,7 +462,8 @@ void GEOMAlgo_Gluer::MakeSubShapes (const TopoDS_Shape&  theShape,
           aER.Orientation(TopAbs_FORWARD);
           if (!BRep_Tool::Degenerated(aER)) {
             // orient image
-            Standard_Boolean bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
+            Standard_Boolean bIsToReverse=
+              GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
             if (bIsToReverse) {
               aER.Reverse();
             }
@@ -490,8 +485,7 @@ void GEOMAlgo_Gluer::MakeSubShapes (const TopoDS_Shape&  theShape,
       aBB.Add(theResult, aShapeR);
     }
   }
-  else
-  {
+  else  {
     if (myKeepNonSolids)    {
       // just add image
       const TopoDS_Shape& aShapeR = myOrigins.Find(theShape);
@@ -554,12 +548,12 @@ void GEOMAlgo_Gluer::MakeShells()
       const TopoDS_Face& aF=TopoDS::Face(aExp.Current());
       aFR=TopoDS::Face(myOrigins.Find(aF));
       if (aFR.IsSame(aF)) {
-       aBB.Add(aNewShell, aF);
-       continue;
+        aBB.Add(aNewShell, aF);
+        continue;
       }
       bIsToReverse=IsToReverse(aFR, aF);
       if (bIsToReverse) {
-       aFR.Reverse();
+        aFR.Reverse();
       }
       aBB.Add(aNewShell, aFR);
     }
@@ -660,25 +654,25 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
     if (aNbSDF==1) {
       bHasNewSubShape=HasNewSubShape(aS1);
       if (!bHasNewSubShape) {
-       aNewShape=aS1;
-       aNewShape.Orientation(TopAbs_FORWARD);
+        aNewShape=aS1;
+        aNewShape.Orientation(TopAbs_FORWARD);
       }
     }
     //
     if (bHasNewSubShape) {
       if (aType==TopAbs_FACE) {
-       TopoDS_Face aNewFace;
-       //
-       const TopoDS_Face& aF1=TopoDS::Face(aS1);
-       MakeFace(aF1, aNewFace);
-       aNewShape=aNewFace;
+        TopoDS_Face aNewFace;
+        //
+        const TopoDS_Face& aF1=TopoDS::Face(aS1);
+        MakeFace(aF1, aNewFace);
+        aNewShape=aNewFace;
       }
       else if (aType==TopAbs_EDGE) {
-       TopoDS_Edge aNewEdge;
-       //
-       const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
-       MakeEdge(aE1, aNewEdge);
-       aNewShape=aNewEdge;
+        TopoDS_Edge aNewEdge;
+        //
+        const TopoDS_Edge& aE1=TopoDS::Edge(aS1);
+        MakeEdge(aE1, aNewEdge);
+        aNewShape=aNewEdge;
       }
     }
     //
@@ -688,7 +682,7 @@ void GEOMAlgo_Gluer::MakeShapes(const TopAbs_ShapeEnum aType)
     for (; aItS.More(); aItS.Next()) {
       const TopoDS_Shape& aFSD=aItS.Value();
       if (!myOrigins.IsBound(aFSD)) {
-       myOrigins.Bind(aFSD, aNewShape);
+        myOrigins.Bind(aFSD, aNewShape);
       }
     }
   }
@@ -728,12 +722,12 @@ void GEOMAlgo_Gluer::CheckResult()
     for (j=1; j<=aNbFS; ++j) {
       const TopoDS_Shape& aFS=aMFS(j);
       if (aMFR.Contains(aFS)) {
-       const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
-       aNbSx=aLSx.Extent();
-       if (aNbSx==2) {
-         bFound=!bFound;
-         break;
-       }
+        const TopTools_ListOfShape& aLSx=aMFR.FindFromKey(aFS);
+        aNbSx=aLSx.Extent();
+        if (aNbSx==2) {
+          bFound=!bFound;
+          break;
+        }
       }
     }
     //
@@ -795,7 +789,7 @@ void GEOMAlgo_Gluer::InnerTolerance()
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
-                                GEOMAlgo_PassKeyShape& aPK)
+     GEOMAlgo_PassKeyShape& aPK)
 {
   Standard_Integer i, aNbE;
   TopTools_ListOfShape aLE;
@@ -820,7 +814,7 @@ void GEOMAlgo_Gluer::FacePassKey(const TopoDS_Face& aF,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
-                                GEOMAlgo_PassKeyShape& aPK)
+     GEOMAlgo_PassKeyShape& aPK)
 {
   TopoDS_Vertex aV1, aV2;
   //
@@ -839,7 +833,7 @@ void GEOMAlgo_Gluer::EdgePassKey(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
-                               TopoDS_Vertex& aNewVertex)
+    TopoDS_Vertex& aNewVertex)
 {
   Standard_Integer aNbV;
   Standard_Real aTolV, aD, aDmax;
@@ -885,7 +879,7 @@ void GEOMAlgo_Gluer::MakeVertex(const TopTools_ListOfShape& aLV,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
-                             TopoDS_Edge& aNewEdge)
+         TopoDS_Edge& aNewEdge)
 {
   myErrorStatus=0;
   //
@@ -939,7 +933,7 @@ void GEOMAlgo_Gluer::MakeEdge(const TopoDS_Edge& aE,
 //purpose  :
 //=======================================================================
 void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
-                             TopoDS_Face& aNewFace)
+         TopoDS_Face& aNewFace)
 {
   myErrorStatus=0;
   //
@@ -975,20 +969,20 @@ void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
       //
       aER.Orientation(TopAbs_FORWARD);
       if (!BRep_Tool::Degenerated(aER)) {
-       // build p-curve
-       if (bIsUPeriodic) {
-         GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
-       }
-       BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
-
-       // orient image
-       bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
-       if (bIsToReverse) {
-         aER.Reverse();
-       }
+        // build p-curve
+        if (bIsUPeriodic) {
+          GEOMAlgo_AlgoTools::RefinePCurveForEdgeOnFace(aER, aFFWD, aUMin, aUMax);
+          }
+        BOPTools_AlgoTools2D::BuildPCurveForEdgeOnFace(aER, aFFWD);
+        
+        // orient image
+        bIsToReverse=GEOMAlgo_AlgoTools::IsSplitToReverse(aER, aE, myContext);
+        if (bIsToReverse) {
+          aER.Reverse();
+        }
       }
       else {
-       aER.Orientation(aE.Orientation());
+        aER.Orientation(aE.Orientation());
       }
       //
       aBB.Add(newWire, aER);
@@ -1009,7 +1003,7 @@ void GEOMAlgo_Gluer::MakeFace(const TopoDS_Face& aF,
 //purpose  :
 //=======================================================================
 Standard_Boolean GEOMAlgo_Gluer::IsToReverse(const TopoDS_Face& aFR,
-                                            const TopoDS_Face& aF)
+                                             const TopoDS_Face& aF)
 {
   Standard_Boolean bRet;
   Standard_Real aT, aT1, aT2, aTR, aScPr;
@@ -1088,7 +1082,7 @@ Standard_Boolean GEOMAlgo_Gluer::HasNewSubShape(const TopoDS_Shape& aS)const
 //purpose  :
 //=======================================================================
 void GetSubShapes(const TopoDS_Shape& aS,
-                 TopTools_IndexedMapOfShape& aMSS)
+    TopTools_IndexedMapOfShape& aMSS)
 {
   Standard_Integer aR;
   TopAbs_ShapeEnum aType;
@@ -1111,7 +1105,8 @@ void GetSubShapes(const TopoDS_Shape& aS,
 //function : Modified
 //purpose  :
 //=======================================================================
-const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS)
+const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified
+  (const TopoDS_Shape& aS)
 {
   TopAbs_ShapeEnum aType;
   //
@@ -1127,7 +1122,7 @@ const TopTools_ListOfShape& GEOMAlgo_Gluer::Modified (const TopoDS_Shape& aS)
     if(myOrigins.IsBound(aS)) {
       const TopoDS_Shape& aSnew=myOrigins.Find(aS);
       if (!aSnew.IsSame(aS)) {
-       myGenerated.Append(aSnew);
+        myGenerated.Append(aSnew);
       }
     }
   }
index 726159796fe0130cec4232e98a6ae99a5a64b9db..565c398c6007feb30c7345155c7bb4bfbb1e7672 100644 (file)
@@ -1,5 +1,5 @@
 
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c51dbbcd861260b53b5309cea744bde794e3c475..7ecbd807bb3ee10d9a8efdcc46e997987df52b76 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -84,11 +84,8 @@ void GEOMAlgo_Gluer2::Clear()
   myImagesToWork.Clear();
   myOriginsToWork.Clear();
   myKeepNonSolids=Standard_False;
-  //modified by NIZNHY-PKV Tue Mar 13 13:38:28 2012f
   myDetector.Clear();
-  //modified by NIZNHY-PKV Tue Mar 13 13:38:30 2012t
 }
-//modified by NIZNHY-PKV Tue Mar 13 12:26:50 2012f
 //=======================================================================
 //function : StickedShapes
 //purpose  :
@@ -98,12 +95,12 @@ const TopTools_IndexedDataMapOfShapeListOfShape&
 {
   return myDetector.StickedShapes();
 }
-//modified by NIZNHY-PKV Tue Mar 13 12:26:54 2012t
 //=======================================================================
 //function : SetShapesToGlue
 //purpose  :
 //=======================================================================
-void GEOMAlgo_Gluer2::SetShapesToGlue(const TopTools_DataMapOfShapeListOfShape& aM)
+void GEOMAlgo_Gluer2::SetShapesToGlue
+  (const TopTools_DataMapOfShapeListOfShape& aM)
 {
   myShapesToGlue=aM;
 }
@@ -241,6 +238,7 @@ void GEOMAlgo_Gluer2::CheckData()
   myWarningStatus=0;
   //
   aNbSG=myShapesToGlue.Extent();
+  aType=TopAbs_SHAPE;
   if (aNbSG) {
     // Check myShapesToGlue
     aItDMSLS.Initialize(myShapesToGlue);
@@ -587,6 +585,7 @@ void GEOMAlgo_Gluer2::BuildResult()
   myErrorStatus=0;
   myWarningStatus=0;
   //
+  bHasImage=Standard_False;
   aItC.Initialize(myArgument);
   for (; aItC.More(); aItC.Next()) {
     const TopoDS_Shape& aCx=aItC.Value();
index c5b96eac305e478c2854f680dbefeda4d17152f1..039f935129c016cde01616a2d2254b4e919224e9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ebcb7c06456c0a5176a82268ca90085d2c953225..261763ad82d078b81b48ba8cb781933f9ea77bb0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1378ba7f3027f7aa7b52a1038652740f4ff986ca..8a6d152fd159b70228fd51560cb8bfa273ffde92 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 2d6a6e7ec4fd710a90c705a293b7f9e735d20068..dc4e0ac2bc98396d87df425ebf1dd86205c45716 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 257b9b6c9c5e000ae7b53eae135308a06072905d..7d40ab03677d1a1f827a48a2b76e6ad559396689 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index a1258516bfa273fbbb881c7139a5b44857b4998b..3f0a136c5828457ab680de06664e8c52a58cc9d8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e8525c009240a31652ecb3c685f86a1a59851a98..8dc8712febc5bc6fa7bbc971a73d383f6ced3fd9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ced4aeb180aa80312e7df1eecb50addd68f20638..5de47b25c961b546d2ba2c4bb62affec6e2e054c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 18f767ec2a20efd19c753967158a34daccff96aa..543f350a496f33a05bd74ac833ac61146aab0ba0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 736a7cc1336bf357de1cb54c9ec63d9dc01aafa7..9712b90e4f066d8ea36fc576811805f86e64f44b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index a55c13335483005943951e79b60f0da05a056fb2..24fd9bc14f3dcb66fd3f0c9c56b5f40990c6a4fd 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index a9b00edbcecfbea129abf617b38e44f3ab928120..41af42b22795083b43a5fd8df1993f764cb22cff 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index b5edf4cc01225a95fa42e58ae0103931de1cc00d..8efbc2720c6d0d4d7a2a82de1003010056da4fd1 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 8e77214d1c1ac2f42a42de7c4000a42ecf580ba5..b5d57e8307f4c1abd698334eebc09db4e1961ad3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index a622d6065c0376bd7884b1d99f342cdd84ee686f..085be6dfb5e04385867d0dd945cf10576656c2df 100644 (file)
@@ -1,4 +1,4 @@
-/// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+/// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 ///
 /// This library is free software; you can redistribute it and/or
 /// modify it under the terms of the GNU Lesser General Public
index a8c7b0570a2b4002f1df36436cff16745bac31d9..591e7240f81dc4dabc9bbcb9b2d168295b4c5e58 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 7f1df7ab351dcc81680bbdc24dec80a3ffdfefd2..45dd73a650410cf303ba25e7d24041a927753a08 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
diff --git a/src/GEOMAlgo/GEOMAlgo_KindOfDef.hxx b/src/GEOMAlgo/GEOMAlgo_KindOfDef.hxx
new file mode 100644 (file)
index 0000000..fab5929
--- /dev/null
@@ -0,0 +1,37 @@
+// 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
+//
+//GEOMAlgo_KindOfDef
+#ifndef _GEOMAlgo_KindOfDef_HeaderFile
+#define _GEOMAlgo_KindOfDef_HeaderFile
+
+
+enum GEOMAlgo_KindOfDef {
+GEOMAlgo_KD_UNKNOWN,
+GEOMAlgo_KD_SPECIFIED,
+GEOMAlgo_KD_ARBITRARY
+};
+
+#ifndef _Standard_PrimitiveTypes_HeaderFile
+#include <Standard_PrimitiveTypes.hxx>
+#endif
+
+#endif
index 3075d40a5dbe49a6446e2a19c385cfdb28d8a789..cf012663ecda63232ad00c343cbf6dee2c2545ad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -44,7 +44,8 @@ GEOMAlgo_KN_DISKELLIPSE,
 GEOMAlgo_KN_RECTANGLE,
 GEOMAlgo_KN_TRIANGLE,
 GEOMAlgo_KN_QUADRANGLE,
-GEOMAlgo_KN_ARCELLIPSE
+GEOMAlgo_KN_ARCELLIPSE,
+GEOMAlgo_KN_SOLID
 };
 
 #ifndef _Standard_PrimitiveTypes_HeaderFile
index 3fa852c25196af1caa7cf23a2f2362ed8a516398..382fdef6a0f0068c28f1c30b1d0ebbaca2d3897e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -35,9 +35,7 @@ GEOMAlgo_KS_PLANE,
 GEOMAlgo_KS_CIRCLE,
 GEOMAlgo_KS_LINE,
 GEOMAlgo_KS_DEGENERATED,
-//modified by NIZNHY-PKV Tue Jul 03 10:28:09 2012f
 GEOMAlgo_KS_BSPLINE
-//modified by NIZNHY-PKV Tue Jul 03 10:28:11 2012t
 };
 
 #ifndef _Standard_PrimitiveTypes_HeaderFile
index 5baeecd3e0c044ee38b8b38271972cb06be59231..b651113e9d91c15cf0e41302b61e12df0c720155 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e90d2d86ac615443501ae3c17fdfc872268954b6..3d94910208bbab42d5d3307b8ab950f2c0576de2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 0ffd36d714c30068887d971745265e3ab5f5d83b..636f92f9ccd08ca3cbab23a614fccc6a9fc51938 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 425dfacfdb1a60d086ed35eb9d014af53662ff96..8d797cf2c9a43ff8c0199fe469811543a0670853 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 84856b1fe4e5b8d4ad6ee6cca98303790ddff69a..258e66694d44f5cc4cfd2468363c0894d96df1d1 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 80c84f796910cd43931a155c6d79aec61747a576..e5f70dc99d901af50747a12dde6ed80b26789589 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3b5268a65c023ced39cec29f4eb5100c5df0c999..7be4bcb2d3c66586e87d4e1077ab042fe9eaaf96 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 95655d96b2cd191900cc4b358be576a928bf59cb..ac723321bba538dae282c6a0e804d363de2bb035 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3a3b9c588bf148d3873977d58bce40d4e7a72527..c441877337340d1c01a7884aedd913eb92d6d4e9 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 2c6a3a2f0fda5134c0497fa70360fbdc7418b4a1..161739bac98503ad2d11564af7543452930bac7d 100644 (file)
@@ -1,5 +1,5 @@
 
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 4e1765c6ed9cbf7776ce987de071cb19689c1322..6c255c8966f937f1c799dff0bcff5e1bae2b0bdc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 095a48b4663198f46928c5ba3449aaaf8cf3ba3d..1db58d5645ac9bb9f63356ef6164498fe0c3daa6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 744017a71d25306fe3b69726d4801c8cb0d7fd7f..7267317363b0cdfe0baa1a107240f0a7e0433e20 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index fe9709adeda8477300765a29c0be068462951b2f..f8479417e4e74f645b13e1909c16118c7ffe2644 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index bc52f37bfcd3051f1e07c7c691bf15f393d0a175..9d458377dc1bc0338889a2c549ef11163b5223ef 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 8144af710c2e22356f7638b0a6cb65b6233670af..7731dc58019c556f47890888d5c143e159240772 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 546a5bcc37a6da1ec8412bbdfca75fde32c9d936..fe4b7f69b0fb5d4726d5a1a02be4287c01526c10 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -29,6 +29,8 @@ static
   void DumpKindOfBounds(const GEOMAlgo_KindOfBounds aKB);
 static
   void DumpKindOfName(const GEOMAlgo_KindOfName aKS);
+static
+  void DumpKindOfDef(const GEOMAlgo_KindOfDef aKD);
 static
   void DumpPosition(const gp_Ax3& aAx3);
 static
@@ -39,7 +41,7 @@ static
 //function :
 //purpose  :
 //=======================================================================
-  GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo()
+GEOMAlgo_ShapeInfo::GEOMAlgo_ShapeInfo()
 {
   Reset();
 }
@@ -47,14 +49,14 @@ static
 //function : ~
 //purpose  :
 //=======================================================================
-  GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo()
+GEOMAlgo_ShapeInfo::~GEOMAlgo_ShapeInfo()
 {
 }
 //=======================================================================
 //function : Reset
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::Reset()
+void GEOMAlgo_ShapeInfo::Reset()
 {
   Standard_Integer i;
   //
@@ -69,6 +71,7 @@ static
   myKindOfBounds=GEOMAlgo_KB_UNKNOWN;
   myKindOfClosed=GEOMAlgo_KC_UNKNOWN;
   myKindOfName=GEOMAlgo_KN_UNKNOWN;
+  myKindOfDef=GEOMAlgo_KD_UNKNOWN;
   //
   myLocation.SetCoord(99., 99., 99.);
   myDirection.SetCoord(1.,0.,0.);
@@ -83,7 +86,7 @@ static
 //function : SetType
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType)
+void GEOMAlgo_ShapeInfo::SetType(const TopAbs_ShapeEnum aType)
 {
   myType=aType;
 }
@@ -91,7 +94,7 @@ static
 //function : Type
 //purpose  :
 //=======================================================================
-  TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const
+TopAbs_ShapeEnum GEOMAlgo_ShapeInfo::Type() const
 {
   return myType;
 }
@@ -99,8 +102,8 @@ static
 //function : SetNbSubShapes
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
-                                          const Standard_Integer aNb)
+void GEOMAlgo_ShapeInfo::SetNbSubShapes(const TopAbs_ShapeEnum aType,
+                                        const Standard_Integer aNb)
 {
   Standard_Integer iN;
 
@@ -113,7 +116,8 @@ static
 //function : NbSubShapes
 //purpose  :
 //=======================================================================
-  Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes(const TopAbs_ShapeEnum aType) const
+Standard_Integer GEOMAlgo_ShapeInfo::NbSubShapes
+  (const TopAbs_ShapeEnum aType) const
 {
   Standard_Integer iN;
 
@@ -127,7 +131,7 @@ static
 //function : SetKindOfShape
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT)
+void GEOMAlgo_ShapeInfo::SetKindOfShape(const GEOMAlgo_KindOfShape aT)
 {
   myKindOfShape=aT;
 }
@@ -135,7 +139,7 @@ static
 //function : KindOfShape
 //purpose  :
 //=======================================================================
-  GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const
+GEOMAlgo_KindOfShape GEOMAlgo_ShapeInfo::KindOfShape() const
 {
   return myKindOfShape;
 }
@@ -143,7 +147,7 @@ static
 //function : SetKindOfName
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT)
+void GEOMAlgo_ShapeInfo::SetKindOfName(const GEOMAlgo_KindOfName aT)
 {
   myKindOfName=aT;
 }
@@ -151,7 +155,7 @@ static
 //function : KindOfName
 //purpose  :
 //=======================================================================
-  GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const
+GEOMAlgo_KindOfName GEOMAlgo_ShapeInfo::KindOfName() const
 {
   return myKindOfName;
 }
@@ -159,7 +163,7 @@ static
 //function : SetKindOfBounds
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT)
+void GEOMAlgo_ShapeInfo::SetKindOfBounds(const GEOMAlgo_KindOfBounds aT)
 {
   myKindOfBounds=aT;
 }
@@ -167,7 +171,7 @@ static
 //function : KindOfBounds
 //purpose  :
 //=======================================================================
-  GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const
+GEOMAlgo_KindOfBounds GEOMAlgo_ShapeInfo::KindOfBounds() const
 {
   return myKindOfBounds;
 }
@@ -175,7 +179,7 @@ static
 //function : SetKindOfClosed
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT)
+void GEOMAlgo_ShapeInfo::SetKindOfClosed(const GEOMAlgo_KindOfClosed aT)
 {
   myKindOfClosed=aT;
 }
@@ -183,15 +187,31 @@ static
 //function : KindOfClosed
 //purpose  :
 //=======================================================================
-  GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const
+GEOMAlgo_KindOfClosed GEOMAlgo_ShapeInfo::KindOfClosed() const
 {
   return myKindOfClosed;
 }
 //=======================================================================
+//function : SetKindOfDef
+//purpose  :
+//=======================================================================
+void GEOMAlgo_ShapeInfo::SetKindOfDef(const GEOMAlgo_KindOfDef aT)
+{
+  myKindOfDef=aT;
+}
+//=======================================================================
+//function : KindOfDef
+//purpose  :
+//=======================================================================
+GEOMAlgo_KindOfDef GEOMAlgo_ShapeInfo::KindOfDef() const
+{
+  return myKindOfDef;
+}
+//=======================================================================
 //function : SetLocation
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP)
+void GEOMAlgo_ShapeInfo::SetLocation(const gp_Pnt& aP)
 {
   myLocation=aP;
 }
@@ -199,7 +219,7 @@ static
 //function : Location
 //purpose  :
 //=======================================================================
-  const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const
+const gp_Pnt& GEOMAlgo_ShapeInfo::Location() const
 {
   return myLocation;
 }
@@ -207,7 +227,7 @@ static
 //function : SetDirection
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD)
+void GEOMAlgo_ShapeInfo::SetDirection(const gp_Dir& aD)
 {
   myDirection=aD;
 }
@@ -215,7 +235,7 @@ static
 //function : Direction
 //purpose  :
 //=======================================================================
-  const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const
+const gp_Dir& GEOMAlgo_ShapeInfo::Direction() const
 {
   return myDirection;
 }
@@ -223,7 +243,7 @@ static
 //function : SetPosition
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2)
+void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax2& aAx2)
 {
   gp_Ax3 aAx3(aAx2);
   SetPosition(aAx3);
@@ -232,7 +252,7 @@ static
 //function : SetPosition
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3)
+void GEOMAlgo_ShapeInfo::SetPosition(const gp_Ax3& aAx3)
 {
   myPosition=aAx3;
 }
@@ -240,7 +260,7 @@ static
 //function : Position
 //purpose  :
 //=======================================================================
-  const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const
+const gp_Ax3& GEOMAlgo_ShapeInfo::Position() const
 {
   return myPosition;
 }
@@ -249,7 +269,7 @@ static
 //function : SetPnt1
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP)
+void GEOMAlgo_ShapeInfo::SetPnt1(const gp_Pnt& aP)
 {
   myPnt1=aP;
 }
@@ -257,7 +277,7 @@ static
 //function : Pnt1
 //purpose  :
 //=======================================================================
-  const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const
+const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt1() const
 {
   return myPnt1;
 }
@@ -265,7 +285,7 @@ static
 //function : SetPnt2
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP)
+void GEOMAlgo_ShapeInfo::SetPnt2(const gp_Pnt& aP)
 {
   myPnt2=aP;
 }
@@ -273,7 +293,7 @@ static
 //function : Pnt2
 //purpose  :
 //=======================================================================
-  const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const
+const gp_Pnt& GEOMAlgo_ShapeInfo::Pnt2() const
 {
   return myPnt2;
 }
@@ -281,7 +301,7 @@ static
 //function : SetRadius1
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR)
+void GEOMAlgo_ShapeInfo::SetRadius1(const Standard_Real aR)
 {
   myRadius1=aR;
 }
@@ -289,7 +309,7 @@ static
 //function : Radius1
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfo::Radius1() const
+Standard_Real GEOMAlgo_ShapeInfo::Radius1() const
 {
   return myRadius1;
 }
@@ -297,7 +317,7 @@ static
 //function : SetRadius2
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR)
+void GEOMAlgo_ShapeInfo::SetRadius2(const Standard_Real aR)
 {
   myRadius2=aR;
 }
@@ -305,7 +325,7 @@ static
 //function : Radius2
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfo::Radius2() const
+Standard_Real GEOMAlgo_ShapeInfo::Radius2() const
 {
   return myRadius2;
 }
@@ -313,7 +333,7 @@ static
 //function : SetLength
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL)
+void GEOMAlgo_ShapeInfo::SetLength(const Standard_Real aL)
 {
   myLength=aL;
 }
@@ -321,7 +341,7 @@ static
 //function : Length
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfo::Length() const
+Standard_Real GEOMAlgo_ShapeInfo::Length() const
 {
   return myLength;
 }
@@ -329,7 +349,7 @@ static
 //function : SetWidth
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW)
+void GEOMAlgo_ShapeInfo::SetWidth(const Standard_Real aW)
 {
   myWidth=aW;
 }
@@ -337,7 +357,7 @@ static
 //function : Width
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfo::Width() const
+Standard_Real GEOMAlgo_ShapeInfo::Width() const
 {
   return myWidth;
 }
@@ -345,7 +365,7 @@ static
 //function : SetHeight
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH)
+void GEOMAlgo_ShapeInfo::SetHeight(const Standard_Real aH)
 {
   myHeight=aH;
 }
@@ -353,7 +373,7 @@ static
 //function : Height
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfo::Height() const
+Standard_Real GEOMAlgo_ShapeInfo::Height() const
 {
   return myHeight;
 }
@@ -372,7 +392,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : Dump
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::Dump()const
+void GEOMAlgo_ShapeInfo::Dump()const
 {
   switch (myType) {
     //
@@ -417,7 +437,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpCompound
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpCompound()const
+void GEOMAlgo_ShapeInfo::DumpCompound()const
 {
   Standard_Integer aNbV, aNbE, aNbF, aNbS, aNbC, aNbP;
   GEOMAlgo_KindOfShape aKS;
@@ -452,7 +472,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpCompSolid
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpCompSolid()const
+void GEOMAlgo_ShapeInfo::DumpCompSolid()const
 {
   Standard_Integer aNbV, aNbE, aNbF, aNbS;
   GEOMAlgo_KindOfShape aKS;
@@ -479,12 +499,11 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
   DumpKindOfBounds(aKB);
   DumpKindOfClosed(aKC);
 }
-
 //=======================================================================
 //function : DumpSolid
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpSolid()const
+void GEOMAlgo_ShapeInfo::DumpSolid()const
 {
   Standard_Integer aNbV, aNbE, aNbF;
   GEOMAlgo_KindOfShape aKS;
@@ -545,18 +564,18 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
     printf("  Height    : %.3lf\n", myHeight);
   }
 }
-
 //=======================================================================
 //function : DumpFace
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpFace()const
+void GEOMAlgo_ShapeInfo::DumpFace()const
 {
   Standard_Integer aNbV, aNbE;
   GEOMAlgo_KindOfShape aKS;
   GEOMAlgo_KindOfName aKN;
   GEOMAlgo_KindOfBounds aKB;
   GEOMAlgo_KindOfClosed aKC;
+  GEOMAlgo_KindOfDef aKD;
   //
   aNbV=NbSubShapes(TopAbs_VERTEX);
   aNbE=NbSubShapes(TopAbs_EDGE);
@@ -564,6 +583,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
   aKN=KindOfName();
   aKB=KindOfBounds();
   aKC=KindOfClosed();
+  aKD=KindOfDef();
   //
   printf(" *FACE\n");
   printf("  number of vertices: %d\n", aNbV);
@@ -572,6 +592,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
   DumpKindOfName (aKN);
   DumpKindOfBounds(aKB);
   DumpKindOfClosed(aKC);
+  DumpKindOfDef(aKD);
   //
   // PLANE
   if (aKN==GEOMAlgo_KN_PLANE) {
@@ -641,7 +662,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpShell
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpShell()const
+void GEOMAlgo_ShapeInfo::DumpShell()const
 {
   Standard_Integer aNbV, aNbE, aNbF;
   GEOMAlgo_KindOfClosed aKC;
@@ -662,7 +683,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpWire
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpWire()const
+void GEOMAlgo_ShapeInfo::DumpWire()const
 {
   Standard_Integer aNbV, aNbE;
   GEOMAlgo_KindOfClosed aKC;
@@ -682,7 +703,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpEdge
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpEdge()const
+void GEOMAlgo_ShapeInfo::DumpEdge()const
 {
   Standard_Integer aNbV;
   Standard_Real aX, aY, aZ;
@@ -755,7 +776,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpVertex
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfo::DumpVertex()const
+void GEOMAlgo_ShapeInfo::DumpVertex()const
 {
   printf(" *VERTEX\n");
   DumpLocation(myLocation);
@@ -764,7 +785,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpLocation
 //purpose  :
 //=======================================================================
-  void DumpLocation(const gp_Pnt& aP)
+void DumpLocation(const gp_Pnt& aP)
 {
   Standard_Real aX, aY, aZ;
   //
@@ -775,7 +796,7 @@ Standard_Integer TypeToInteger(const TopAbs_ShapeEnum aType)
 //function : DumpDirection
 //purpose  :
 //=======================================================================
-  void DumpDirection(const gp_Dir& aD)
+void DumpDirection(const gp_Dir& aD)
 {
   Standard_Real aX, aY, aZ;
   //
@@ -881,10 +902,27 @@ void DumpKindOfName(const GEOMAlgo_KindOfName aKS)
     "KN_RECTANGLE",
     "KN_TRIANGLE",
     "KN_QUADRANGLE",
-    "KN_ARCELLIPSE"
+    "KN_ARCELLIPSE",
+    "KN_SOLID"
     };
   int i;
   //
   i=(Standard_Integer)aKS;
   printf(" KindOfName  : %s\n", pStr[i]);
 }
+//=======================================================================
+//function : DumpKindOfDef
+//purpose  :
+//=======================================================================
+void DumpKindOfDef(const GEOMAlgo_KindOfDef aKD)
+{
+  const char *pStr[]={
+    "KD_UNKNOWN",
+    "KD_SPECIFIED",
+    "KB_ARBITRARY"
+  };
+  int i;
+  //
+  i=(Standard_Integer)aKD;
+  printf(" KindOfDef: %s\n", pStr[i]);
+}
index 217be9796455b5edfa16c0d286b2b6f749a64be7..0556e68d47ffa559d644516d19adbb0bf235a486 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -37,6 +37,7 @@
 #include <GEOMAlgo_KindOfName.hxx>
 #include <GEOMAlgo_KindOfBounds.hxx>
 #include <GEOMAlgo_KindOfClosed.hxx>
+#include <GEOMAlgo_KindOfDef.hxx>
 
 
 //=======================================================================
@@ -62,7 +63,8 @@ class GEOMAlgo_ShapeInfo
     TopAbs_ShapeEnum Type() const;
 
   Standard_EXPORT
-    void SetNbSubShapes(const TopAbs_ShapeEnum aType,const Standard_Integer aNb) ;
+    void SetNbSubShapes(const TopAbs_ShapeEnum aType,
+                        const Standard_Integer aNb) ;
 
   Standard_EXPORT
     Standard_Integer NbSubShapes(const TopAbs_ShapeEnum aType) const;
@@ -91,6 +93,12 @@ class GEOMAlgo_ShapeInfo
   Standard_EXPORT
     GEOMAlgo_KindOfClosed KindOfClosed() const;
 
+  Standard_EXPORT
+    void SetKindOfDef(const GEOMAlgo_KindOfDef aT) ;
+
+  Standard_EXPORT
+    GEOMAlgo_KindOfDef KindOfDef() const;
+
   Standard_EXPORT
     void SetLocation(const gp_Pnt& aP) ;
 
@@ -189,6 +197,7 @@ class GEOMAlgo_ShapeInfo
   GEOMAlgo_KindOfName myKindOfName;
   GEOMAlgo_KindOfBounds myKindOfBounds;
   GEOMAlgo_KindOfClosed myKindOfClosed;
+  GEOMAlgo_KindOfDef myKindOfDef;
   gp_Pnt myLocation;
   gp_Dir myDirection;
   gp_Ax3 myPosition;
index dc0f4c43feb0e0adfdeaf78e51a3a1b4ad5af174..e440912b61d6156929762a308c3458e4ca7e8c26 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -59,7 +59,7 @@
 //function :
 //purpose  :
 //=======================================================================
-  GEOMAlgo_ShapeInfoFiller::GEOMAlgo_ShapeInfoFiller()
+GEOMAlgo_ShapeInfoFiller::GEOMAlgo_ShapeInfoFiller()
 :
   GEOMAlgo_Algo()
 {
 //function : ~
 //purpose  :
 //=======================================================================
-  GEOMAlgo_ShapeInfoFiller::~GEOMAlgo_ShapeInfoFiller()
+GEOMAlgo_ShapeInfoFiller::~GEOMAlgo_ShapeInfoFiller()
 {
 }
 //=======================================================================
 //function : SetTolerance
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::SetTolerance(const Standard_Real aT)
+void GEOMAlgo_ShapeInfoFiller::SetTolerance(const Standard_Real aT)
 {
   myTolerance=aT;
 }
@@ -84,7 +84,7 @@
 //function : Tolerance
 //purpose  :
 //=======================================================================
-  Standard_Real GEOMAlgo_ShapeInfoFiller::Tolerance()const
+Standard_Real GEOMAlgo_ShapeInfoFiller::Tolerance()const
 {
   return myTolerance;
 }
@@ -92,7 +92,7 @@
 //function : SetShape
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::SetShape(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::SetShape(const TopoDS_Shape& aS)
 {
   myShape=aS;
 }
 //function : Shape
 //purpose  :
 //=======================================================================
-  const TopoDS_Shape& GEOMAlgo_ShapeInfoFiller::Shape() const
+const TopoDS_Shape& GEOMAlgo_ShapeInfoFiller::Shape() const
 {
   return myShape;
 }
 //function : Info
 //purpose  :
 //=======================================================================
-  const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info() const
+const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info() const
 {
   return Info(myShape);
 }
 //function : Info
 //purpose  :
 //=======================================================================
-  const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info(const TopoDS_Shape& aS) const
+const GEOMAlgo_ShapeInfo& GEOMAlgo_ShapeInfoFiller::Info
+  (const TopoDS_Shape& aS) const
 {
   if (!aS.IsNull()) {
     if (myMapInfo.Contains(aS)) {
 //function : CheckData
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::CheckData()
+void GEOMAlgo_ShapeInfoFiller::CheckData()
 {
   myErrorStatus=0;
   //
 //function : Perform
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::Perform()
+void GEOMAlgo_ShapeInfoFiller::Perform()
 {
   myErrorStatus=0;
   //
 //function :FillShape
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillShape(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillShape(const TopoDS_Shape& aS)
 {
   TopAbs_ShapeEnum aType;
   //
 //function :FillSubShapes
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillSubShapes(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillSubShapes(const TopoDS_Shape& aS)
 {
   TopoDS_Iterator aIt;
   //
 //function : FillContainer
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillContainer(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillContainer(const TopoDS_Shape& aS)
 {
   myErrorStatus=0;
   //
 //function : FillSolid
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillSolid(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillSolid(const TopoDS_Shape& aS)
 {
-  Standard_Integer aNbShells;
   TopoDS_Solid aSd;
   //
   myErrorStatus=0;
   //
   aSd=TopoDS::Solid(aS);
   //
-  aNbShells=GEOMAlgo_ShapeInfoFiller::NbShells(aSd);
-  if (aNbShells>1) {
-    return;
-  }
-  //
   FillDetails(aSd);
 }
 //=======================================================================
 //function :FillFace
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillFace(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillFace(const TopoDS_Shape& aS)
 {
   myErrorStatus=0;
+  if (myMapInfo.Contains(aS)) {
+    return;
+  }
   //
   Standard_Boolean bIsAllowedType;
-  Standard_Integer aNbWires;//, iRet
   Standard_Boolean bInf, bInfU1, bInfU2, bInfV1, bInfV2;
-  Standard_Real aUMin, aUMax, aVMin, aVMax, aR1, aR2;
+  Standard_Real aUMin, aUMax, aVMin, aVMax, aR1, aR2, dV;
   gp_Pnt aP0;
   gp_Dir aDN;
   gp_Ax3 aAx3;
   GeomAbs_SurfaceType aST;
   Handle(Geom_Surface) aSurf;
   TopoDS_Face aF;
-  //GEOMAlgo_KindOfName aKindOfName;
   //----------------------------------------------------
-  if (myMapInfo.Contains(aS)) {
-    return;
-  }
-  else {
-    GEOMAlgo_ShapeInfo aInfoX;
-    myMapInfo.Add(aS, aInfoX);
-  }
+  GEOMAlgo_ShapeInfo aInfoX;
+  myMapInfo.Add(aS, aInfoX);
+  //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aS);
   //----------------------------------------------------
   aInfo.SetType(TopAbs_FACE);
   //
   aF=TopoDS::Face(aS);
   //
-  aNbWires=GEOMAlgo_ShapeInfoFiller::NbWires(aF);
-  //
   aSurf=BRep_Tool::Surface(aF);
   GeomAdaptor_Surface aGAS(aSurf);
   aST=aGAS.GetType();
     return;
   }
   //
+  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
   // 1. Plane
   if (aST==GeomAbs_Plane) {
     gp_Pln aPln;
     aP0=aPln.Location();
     aAx3=aPln.Position();
     //
-    aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE);
+    aInfo.SetKindOfShape(GEOMAlgo_KS_PLANE); 
+    aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
     aInfo.SetKindOfClosed(GEOMAlgo_KC_NOTCLOSED);
     aInfo.SetLocation(aP0);
     aInfo.SetPosition(aAx3);
     //
-    if (aNbWires>1) {
-      return;
-    }
-    //
-    //aSurf->Bounds(aUMin, aUMax, aVMin, aVMax);
     BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
     bInfU1=Precision::IsNegativeInfinite(aUMin);
     bInfU2=Precision::IsPositiveInfinite(aUMax);
     bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
     if (bInf) {
       aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
+      return;
     }
-    else {
-      aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
-    }
+    //
+    aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
     //
     FillDetails(aF, aPln);
   }// if (aCT==GeomAbs_Line) {
   //
+  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
   // 2. Sphere
   else if (aST==GeomAbs_Sphere) {
     gp_Sphere aSphere;
     aR1=aSphere.Radius();
     //
     aInfo.SetKindOfShape(GEOMAlgo_KS_SPHERE);
+    aInfo.SetKindOfName(GEOMAlgo_KN_SPHERE);
     aInfo.SetLocation(aP0);
     aInfo.SetPosition(aAx3);
     aInfo.SetRadius1(aR1);
     //
-    if (aNbWires>1) {
-      return;
-    }
-    //
     aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
     aInfo.SetKindOfClosed(GEOMAlgo_KC_CLOSED);
     //
     FillDetails(aF, aSphere);
   }// else if (aST==GeomAbs_Sphere) {
   //
+  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
   // 3. Cylinder
   else if (aST==GeomAbs_Cylinder) {
     gp_Cylinder aCyl;
     aR1=aCyl.Radius();
     //
     aInfo.SetKindOfShape(GEOMAlgo_KS_CYLINDER);
+    aInfo.SetKindOfName(GEOMAlgo_KN_CYLINDER);
     aInfo.SetLocation(aP0);
     aInfo.SetPosition(aAx3);
     aInfo.SetRadius1(aR1);
     //
-    if (aNbWires>1) {
-      return;
-    }
-    //
     BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
     bInfU1=Precision::IsNegativeInfinite(aUMin);
     bInfU2=Precision::IsPositiveInfinite(aUMax);
     bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
     if (bInf) {
       aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
+      return;
     }
-    else {
-      aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
-    }
+    //
+    aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+    //
+    dV=aVMax-aVMin;
+    aInfo.SetHeight(dV);
+    //
     FillDetails(aF, aCyl);
   }
   //
+  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
   // 4. Cone
   else if (aST==GeomAbs_Cone) {
+    Standard_Real aSemiAngle;
     gp_Cone aCone;
     //
     aCone=aGAS.Cone();
     aP0=aCone.Location();
     aAx3=aCone.Position();
-    //aR1=aCyl.Radius();
     //
     aInfo.SetKindOfShape(GEOMAlgo_KS_CONE);
+    aInfo.SetKindOfName(GEOMAlgo_KN_CONE);
     aInfo.SetLocation(aP0);
     aInfo.SetPosition(aAx3);
-    //aInfo.SetRadius1(aR1);
-    //
-    if (aNbWires>1) {
-      return;
-    }
     //
     BRepTools::UVBounds(aF, aUMin, aUMax, aVMin, aVMax);
     bInfU1=Precision::IsNegativeInfinite(aUMin);
     bInf=(bInfU1 || bInfU2 || bInfV1 || bInfV2);
     if (bInf) {
       aInfo.SetKindOfBounds(GEOMAlgo_KB_INFINITE);
+      return;
     }
-    else {
-      aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
-    }
+    //
+    aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
+    //
+    aSemiAngle=fabs(aCone.SemiAngle());
+    dV=(aVMax-aVMin)*cos(aSemiAngle);
+    
+    aInfo.SetHeight(dV);
+    //
     FillDetails(aF, aCone);
   }
   //
+  //||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
   // 5. Torus
   else if (aST==GeomAbs_Torus) {
     gp_Torus aTorus;
     aR2=aTorus.MinorRadius();
     //
     aInfo.SetKindOfShape(GEOMAlgo_KS_TORUS);
+    aInfo.SetKindOfName(GEOMAlgo_KN_TORUS);
     aInfo.SetLocation(aP0);
     aInfo.SetPosition(aAx3);
     aInfo.SetRadius1(aR1);
     aInfo.SetRadius2(aR2);
     //
-    if (aNbWires>1) {
-      return;
-    }
-    //
     aInfo.SetKindOfBounds(GEOMAlgo_KB_TRIMMED);
     //
     FillDetails(aF, aTorus);
@@ -535,7 +523,6 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
     FillSubShapes(aS);
     return;
   }
-  //modified by NIZNHY-PKV Tue Jul 03 10:19:03 2012f
   // BSplineCurve
   if (aCT==GeomAbs_BSplineCurve) {
     Standard_Integer aNbKnots, aNbPoles, aDegree;
@@ -577,7 +564,6 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
       aInfo.SetDirection(aDir);
     }
   }
-  //modified by NIZNHY-PKV Tue Jul 03 10:19:06 2012t
   // Line
   else if (aCT==GeomAbs_Line) {
     Standard_Boolean bInf1, bInf2;
@@ -712,7 +698,7 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
 //function :FillVertex
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillVertex(const TopoDS_Shape& aS)
+void GEOMAlgo_ShapeInfoFiller::FillVertex(const TopoDS_Shape& aS)
 {
   myErrorStatus=0;
   //
@@ -739,8 +725,8 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
 //function : FillNbSubshapes
 //purpose  :
 //=======================================================================
-  void GEOMAlgo_ShapeInfoFiller::FillNbSubShapes(const TopoDS_Shape& aS,
-                                                 GEOMAlgo_ShapeInfo& aInfo)
+void GEOMAlgo_ShapeInfoFiller::FillNbSubShapes(const TopoDS_Shape& aS,
+                                               GEOMAlgo_ShapeInfo& aInfo)
 {
   myErrorStatus=0;
   //
@@ -776,7 +762,8 @@ void GEOMAlgo_ShapeInfoFiller::FillEdge(const TopoDS_Shape& aS)
 //function :NbShells
 //purpose  :
 //=======================================================================
-Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd)
+Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells
+  (const TopoDS_Solid& aSd)
 {
   Standard_Integer iCnt;
   TopoDS_Iterator aIt;
@@ -785,7 +772,6 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd)
   //
   aIt.Initialize(aSd);
   for (; aIt.More(); aIt.Next()) {
-    //const TopoDS_Shape& aSh=aIt.Value();
     ++iCnt;
   }
   return iCnt;
@@ -794,7 +780,8 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbShells(const TopoDS_Solid& aSd)
 //function : NbWires
 //purpose  :
 //=======================================================================
-Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF)
+Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires
+  (const TopoDS_Face& aF)
 {
   Standard_Integer iCnt;
   TopoDS_Iterator aIt;
@@ -803,7 +790,6 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF)
   //
   aIt.Initialize(aF);
   for (; aIt.More(); aIt.Next()) {
-    //const TopoDS_Shape& aW=aIt.Value();
     ++iCnt;
   }
   return iCnt;
@@ -812,7 +798,8 @@ Standard_Integer GEOMAlgo_ShapeInfoFiller::NbWires(const TopoDS_Face& aF)
 //function : IsAllowedType
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType aCT)
+Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType
+  (const GeomAbs_CurveType aCT)
 {
   Standard_Boolean bRet;
   Standard_Integer i, aNb;
@@ -820,7 +807,7 @@ Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType
     GeomAbs_Line,
     GeomAbs_Circle,
     GeomAbs_Ellipse,
-    GeomAbs_BSplineCurve //modified by NIZNHY-PKV Tue Jul 03 10:18:01 2012ft
+    GeomAbs_BSplineCurve 
   };
   //
   bRet=Standard_False;
@@ -834,7 +821,8 @@ Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_CurveType
 //function : IsAllowedType
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType(const GeomAbs_SurfaceType aST)
+Standard_Boolean GEOMAlgo_ShapeInfoFiller::IsAllowedType
+  (const GeomAbs_SurfaceType aST)
 {
   Standard_Boolean bRet;
   Standard_Integer i, aNb;
index 7dce6865ff232b63f09ffe17c59aaa784ebaffbb..e2e9ac177bed5e15be2cf22d05ea44ada8826843 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
old mode 100644 (file)
new mode 100755 (executable)
index 68fa630..7c4a9b2
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -68,10 +68,12 @@ static
 void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
 {
   Standard_Boolean bIsStepSphere;
-  Standard_Integer i, aNbF, aNbCyl, aNbCon, aNbPgn, aNbRct, aNbCrc, aNbX;
+  Standard_Integer i, aNbF, aNbCyl, aNbCon, aNbPgn, aNbRct;
+  Standard_Integer aNbShells, aNbCrc, aNbX;
   TopoDS_Shape aFCyl, aFCon;
   TopTools_IndexedMapOfShape aMF;
   GEOMAlgo_KindOfName aKNF;
+  GEOMAlgo_KindOfDef aKD;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aSd);
   aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
@@ -83,7 +85,37 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
     return;
   }
   //
+  //modified by NIZNHY-PKV Tue Jun 09 08:35:23 2015f
+  if (aNbF==2) {
+    // case requested by the customer
+    // specific solid that should be treated as a sphere
+    bIsStepSphere=TreatStepSphere(aSd);
+    if (bIsStepSphere) {
+      return;
+    }
+  }
+  //modified by NIZNHY-PKV Tue Jun 09 08:35:28 2015t
+  //
+  aKD=GEOMAlgo_KD_SPECIFIED;
+  for (i=1; i<=aNbF && aKD==GEOMAlgo_KD_SPECIFIED; ++i) {
+    const TopoDS_Shape& aF=aMF(i);
+    GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
+    aKD=aInfoF.KindOfDef();
+  }
+  if (aKD!=GEOMAlgo_KD_SPECIFIED) {
+    aInfo.SetKindOfName(GEOMAlgo_KN_SOLID); 
+    return;
+  }
+  //
+  aNbShells=GEOMAlgo_ShapeInfoFiller::NbShells(aSd);
+  if (aNbShells>1) {
+    aInfo.SetKindOfName(GEOMAlgo_KN_SOLID); 
+    return;
+  }
+  //
+  //
   if (aNbF==1) {
+    // mb: sphere, torus
     const TopoDS_Shape& aF=aMF(1);
     GEOMAlgo_ShapeInfo& aInfoF=myMapInfo.ChangeFromKey(aF);
     aKNF=aInfoF.KindOfName(); // mb: sphere, torus
@@ -99,7 +131,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
       return;
     }
   }
-  //modified by NIZNHY-PKV Tue Jul 03 13:23:55 2012f
+  //modified by NIZNHY-PKV Tue Jun 09 08:36:08 2015f
+  /*
   else if (aNbF==2) {
     // specific solid that should be treated as a sphere
     bIsStepSphere=TreatStepSphere(aSd);
@@ -107,7 +140,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
       return;
     }
   }
-  //modified by NIZNHY-PKV Tue Jul 03 13:23:57 2012t
+  */
+  //modified by NIZNHY-PKV Tue Jun 09 08:36:12 2015t
   //
   aNbCyl=0;
   aNbCon=0;
@@ -229,11 +263,9 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
       const gp_Dir& aDNj=aIFj.Position().Direction();
       //
       aDot=aDNi*aDNj;
-      //modified by NIZNHY-PKV Tue Jul 03 10:01:56 2012f
       if (aDot<0.) {
         aDot=-aDot;
       }
-      //modified by NIZNHY-PKV Tue Jul 03 10:01:52 2012t
       if (fabs(1.-aDot)<0.0001) {
         aMp.Add(i);
         aMp.Add(j);
@@ -248,6 +280,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Solid& aSd)
     return;
   }
   //
+  iMin=-1;
+  iMax=-1;
   aDistMin=1.e15;
   aDistMax=-aDistMin;
   for (i=0; i<aNbFi; ++i) {
@@ -308,21 +342,10 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
   TopTools_IndexedMapOfShape aMV;
   BRepTools_WireExplorer aWExp;
   GEOMAlgo_KindOfName aKN, aKNE;
-  GEOMAlgo_KindOfShape aKS;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
-  aKN=GEOMAlgo_KN_UNKNOWN;
-  aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
-  //
-  aKS=aInfo.KindOfShape();
-  if (aKS!=GEOMAlgo_KS_PLANE) {
-    return;
-  }
   //
-  if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
-    aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
-    return;
-  }
+  aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
   //
   aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
   aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
@@ -330,9 +353,8 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
   // 1. may be it is circle/ellipse
   if (aNbV==1 && aNbE==1) {
     aExp.Init(aF, TopAbs_EDGE);
-    for (; aExp.More(); aExp.Next()) {
+    if (aExp.More()) {
       aE=aExp.Current();
-      break;
     }
     //
     const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
@@ -343,6 +365,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
       aInfo.SetRadius1(aInfoE.Radius1());
       aInfo.SetLocation(aInfoE.Location());
       aInfo.SetPosition(aInfoE.Position());
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
     }
     if (aKNE==GEOMAlgo_KN_ELLIPSE) {
       aKN=GEOMAlgo_KN_DISKELLIPSE;
@@ -351,22 +374,29 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
       aInfo.SetRadius2(aInfoE.Radius2());
       aInfo.SetLocation(aInfoE.Location());
       aInfo.SetPosition(aInfoE.Position());
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
     }
-  }
+    return;
+  }// if (aNbV==1 && aNbE==1) {
   //
-  // 2. may be it is rectangle
-  else  {
-    aExp.Init(aF, TopAbs_EDGE);
-    for (; aExp.More(); aExp.Next()) {
-      aE=aExp.Current();
-      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
-      aKNE=aInfoE.KindOfName();
-      if (aKNE!=GEOMAlgo_KN_SEGMENT) {
-        return;
-      }
+  //
+  Standard_Boolean bSegment;
+  //
+  bSegment=Standard_True;
+  aExp.Init(aF, TopAbs_EDGE);
+  for (; aExp.More() && bSegment; aExp.Next()) {
+    aE=aExp.Current();
+    const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+    aKNE=aInfoE.KindOfName();
+    if (aKNE!=GEOMAlgo_KN_SEGMENT) {
+      bSegment=!bSegment;
     }
-    //
-    aInfo.SetKindOfName(GEOMAlgo_KN_POLYGON);
+  }
+  //
+  if (bSegment) {
+  // 2. may be it is TRIANGLE, POLYGON, QUADRANGLE, RECTANGLE
+    aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
+    aInfo.SetKindOfName(GEOMAlgo_KN_POLYGON); 
     //
     if (aNbV==3 && aNbE==3) {
       aInfo.SetKindOfName(GEOMAlgo_KN_TRIANGLE);
@@ -393,352 +423,327 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
       //
       aInfo.SetLocation(aPc);
       aInfo.SetPosition(aAx3);
-      //
-      return;
-    }
-    //
-    if (!(aNbV==4 && aNbE==4)) {
-      return;
-    }
-    //
-    // aNbV==4 && aNbE==4 and all edges are segments
-    aIt.Initialize(aF);
-    for (; aIt.More(); aIt.Next()){
-      aW=TopoDS::Wire(aIt.Value());
-      break;
-    }
+    } // if (aNbV==3 && aNbE==3) {
     //
-    aWExp.Init(aW, aF);
-    for (i=0; aWExp.More(); aWExp.Next(), ++i) {
-      aEx=aWExp.Current();
-      const GEOMAlgo_ShapeInfo& aInfoEx=myMapInfo.FindFromKey(aEx);
-      aDx[i]=aInfoEx.Direction();
-      aPx[i]=aInfoEx.Location();
-    }
-    //
-    for (i=0; i<4; ++i) {
-      j=(i==3) ? 0 : i+1;
-      aDot=aDx[i]*aDx[j];
-      if (fabs (aDot) > myTolerance) {
-        aInfo.SetKindOfName(GEOMAlgo_KN_QUADRANGLE);
-        return;
+    if (aNbV==4 && aNbE==4) {
+      aIt.Initialize(aF);
+      if (aIt.More()) {
+        aW=*((TopoDS_Wire*)&aIt.Value());
       }
-    }
-    //
-    // rectangle
-    aInfo.SetKindOfName(GEOMAlgo_KN_RECTANGLE);
-    //
-    // shift location to the center and calc. sizes
-    aXYZc.SetCoord(0.,0.,0.);
-    TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
-    for (i=1; i<=aNbV; ++i) {
-      const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
-      aP=BRep_Tool::Pnt(aV);
-      const gp_XYZ& aXYZ=aP.XYZ();
-      aXYZc=aXYZc+aXYZ;
-    }
-    //
-    // Location : aPc in center of rectangle
-    // Position : 0z is plane normal
-    //            0x is along length
-    //
-    aXYZc.Divide(4.);
-    aPc.SetXYZ(aXYZc);
-    //
-    gp_Lin aL0(aPx[0], aDx[0]);
-    gp_Lin aL1(aPx[1], aDx[1]);
-    //
-    aD0=aL0.Distance(aPc);
-    aD1=aL1.Distance(aPc);
-    //
-    aLength=aD0;
-    aWidth =aD1;
-    aDX=aL1.Direction();
-    if (aD0<aD1) {
-      aLength=aD1;
-      aWidth =aD0;
-      aDX=aL0.Direction();
-    }
-    //
-    aLength=2.*aLength;
-    aWidth =2.*aWidth;
-    //
-    aInfo.SetLocation(aPc);
-    aInfo.SetLength(aLength);
-    aInfo.SetWidth(aWidth);
-    //
-    const gp_Dir& aDZ=aPln.Axis().Direction();
-    gp_Ax2 aAx2(aPc, aDZ, aDX);
-    gp_Ax3 aAx3(aAx2);
-    aInfo.SetPosition(aAx3);
-  }
+      //
+      aWExp.Init(aW, aF);
+      for (i=0; aWExp.More(); aWExp.Next(), ++i) {
+        aEx=aWExp.Current();
+        const GEOMAlgo_ShapeInfo& aInfoEx=myMapInfo.FindFromKey(aEx);
+        aDx[i]=aInfoEx.Direction();
+        aPx[i]=aInfoEx.Location();
+      }
+      //
+      Standard_Boolean isRectangle = Standard_True;
+      for (i=0; i<4; ++i) {
+        j=(i==3) ? 0 : i+1;
+        aDot=aDx[i]*aDx[j];
+        if (fabs (aDot) > myTolerance) {
+          isRectangle = Standard_False;
+          break;
+        }
+      }
+      //
+      // rectangle
+      // shift location to the center
+      aXYZc.SetCoord(0.,0.,0.);
+      TopExp::MapShapes(aF, TopAbs_VERTEX, aMV);
+      for (i=1; i<=aNbV; ++i) {
+        const TopoDS_Vertex& aV=TopoDS::Vertex(aMV(i));
+        aP=BRep_Tool::Pnt(aV);
+        const gp_XYZ& aXYZ=aP.XYZ();
+        aXYZc=aXYZc+aXYZ;
+      }
+      //
+      // Location : aPc in center of rectangle
+      // Position : 0z is plane normal
+      //            0x is along the first edge (quadrangle) or
+      //            along length (rectangle)
+      //
+      aXYZc.Divide(4.);
+      aPc.SetXYZ(aXYZc);
+      aDX=aDx[0];
+      aInfo.SetLocation(aPc);
 
-  return;
+      if (isRectangle) {
+      // Calculate sizes
+        gp_Lin aL0(aPx[0], aDx[0]);
+        gp_Lin aL1(aPx[1], aDx[1]);
+        //
+        aD0=aL0.Distance(aPc);
+        aD1=aL1.Distance(aPc);
+        //
+        aLength=aD1;
+        aWidth =aD0;
+        
+        if (aD0>aD1) {
+          aLength=aD0;
+          aWidth =aD1;
+          aDX=aDx[1];
+        }
+        //
+        aLength=2.*aLength;
+        aWidth =2.*aWidth;
+        //
+        aInfo.SetLength(aLength);
+        aInfo.SetWidth(aWidth);
+        aInfo.SetKindOfName(GEOMAlgo_KN_RECTANGLE);
+      } else {
+        aInfo.SetKindOfName(GEOMAlgo_KN_QUADRANGLE);
+      }
+      //
+      const gp_Dir& aDZ=aPln.Axis().Direction();
+      gp_Ax2 aAx2(aPc, aDZ, aDX);
+      gp_Ax3 aAx3(aAx2);
+      aInfo.SetPosition(aAx3);
+      //
+    }// if (aNbV==4 && aNbE==4) {
+    return;
+  }// if (bSegment) {
+  //
+  //aInfo.SetKindOfName(GEOMAlgo_KN_PLANE);
 }
 //=======================================================================
 //function : FillDetails
 //purpose  :
 //=======================================================================
 void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
-                                           const gp_Sphere& )
+                                           const gp_Sphere& )//aSph)
 {
+  
   Standard_Integer aNbV, aNbE, aNbSE, aNbDE;
   TopoDS_Edge aE;
   TopExp_Explorer aExp;
   TopTools_MapOfShape aM;
-  GEOMAlgo_KindOfShape aKS, aKSE;
+  GEOMAlgo_KindOfShape aKSE;//, aKSE;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
-  aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
-  //
-  aKS=aInfo.KindOfShape();
-  if (aKS!=GEOMAlgo_KS_SPHERE) {
-    return;
-  }
-  //
+  // 
+  aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
   aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
   aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
-  if (!(aNbV==2 && aNbE==3)) {
-    return;
-  }
-  //
-  aNbSE=0;
-  aNbDE=0;
-  aExp.Init(aF, TopAbs_EDGE);
-  for (; aExp.More(); aExp.Next()) {
-    aE=TopoDS::Edge(aExp.Current());
-    if(aM.Add(aE)) {
-      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
-      aKSE=aInfoE.KindOfShape();
-      //
-      if (BRep_Tool::IsClosed(aE, aF)) {
-        ++aNbSE;
-      }
-      else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
-        ++aNbDE;
+  if (aNbV==2 && aNbE==3) {
+    aNbSE=0;
+    aNbDE=0;
+    aExp.Init(aF, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      aE=TopoDS::Edge(aExp.Current());
+      if(aM.Add(aE)) {
+        const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+        aKSE=aInfoE.KindOfShape();
+        //
+        if (BRep_Tool::IsClosed(aE, aF)) {
+          ++aNbSE;
+        }
+        else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
+          ++aNbDE;
+        }
       }
     }
+    //
+    if (aNbSE==1 && aNbDE==2) {
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
+    }
   }
-  //
-  if (!(aNbSE==1 && aNbDE==2)) {
-    return;
-  }
-  aInfo.SetKindOfName(GEOMAlgo_KN_SPHERE);
 }
 //=======================================================================
 //function : FillDetails
 //purpose  :
 //=======================================================================
 void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
-                                           const gp_Cone& )//aCone)
+                                           const gp_Cylinder& aCyl)
+     
 {
-  Standard_Integer aNbV, aNbE, aNbCE, aNbSE, aNbDE, i;
-  Standard_Real aR[3], aHeight;
-  gp_Pnt aPC[3], aPD, aPc, aPX[3];
-  TopoDS_Vertex aVD;
+  Standard_Integer i, aNbV, aNbE, aNbCE, aNbSE;
+  Standard_Real aT0, aT1, aHeight;
+  gp_Pnt aPC[3], aPc;
   TopoDS_Edge aE;
-  TopoDS_Iterator aIt;
   TopExp_Explorer aExp;
   TopTools_MapOfShape aM;
-  GEOMAlgo_KindOfShape aKS, aKSE;
-  GEOMAlgo_KindOfName aKN, aKNE;
+  GEOMAlgo_KindOfName aKNE;
   GEOMAlgo_KindOfClosed aKCE;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
-  aKN=GEOMAlgo_KN_UNKNOWN;
-  aInfo.SetKindOfName(aKN);
-  //
-  aKS=aInfo.KindOfShape();
-  if (aKS!=GEOMAlgo_KS_CONE) {
-    return;
-  }
-  //
-  if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
-    return;
-  }
   //
+  aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
   aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
   aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
-  if (!(aNbV==2 && aNbE==3)) {
-    return;
-  }
-  //
-  i=0;
-  aNbCE=0;
-  aNbSE=0;
-  aNbDE=0;
-  aExp.Init(aF, TopAbs_EDGE);
-  for (; aExp.More(); aExp.Next()) {
-    aE=TopoDS::Edge(aExp.Current());
-    if(aM.Add(aE)) {
-      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
-      aKNE=aInfoE.KindOfName();
-      aKCE=aInfoE.KindOfClosed();
-      aKSE=aInfoE.KindOfShape();
-      if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
-        aPC[i]=aInfoE.Location();
-        aR[i]=aInfoE.Radius1();
-        //
-        aIt.Initialize(aE);
-        for (; aIt.More(); aIt.Next()) {
-          aVD=TopoDS::Vertex(aIt.Value());
-          break;
-        }
-        aPX[i]=BRep_Tool::Pnt(aVD);
-        //
-        ++i;
-        ++aNbCE;
-      }
-      else if (aKNE==GEOMAlgo_KN_SEGMENT) {
-        if (BRep_Tool::IsClosed(aE, aF)) {
-          ++aNbSE;
+  if (aNbV==2 && aNbE==3) {
+    const gp_Ax1& aAx1=aCyl.Axis();
+    const gp_Dir& aDir=aAx1.Direction();
+    const gp_Pnt& aPLoc=aAx1.Location();
+    //
+    i=0;
+    aNbCE=0;
+    aNbSE=0;
+    aExp.Init(aF, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      aE=TopoDS::Edge(aExp.Current());
+      if(aM.Add(aE)) {
+        const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+        aKNE=aInfoE.KindOfName();
+        aKCE=aInfoE.KindOfClosed();
+        if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
+          aPC[aNbCE]=aInfoE.Location();
+          ++aNbCE;
         }
-      }
-      else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
-        aIt.Initialize(aE);
-        for (; aIt.More(); aIt.Next()) {
-          aVD=TopoDS::Vertex(aIt.Value());
-          break;
+        else if (aKNE==GEOMAlgo_KN_SEGMENT) {
+          if (BRep_Tool::IsClosed(aE, aF)) {
+            ++aNbSE;
+          }
         }
-        //
-        aPD=BRep_Tool::Pnt(aVD);
-        //
-        ++aNbDE;
       }
     }
-  }
-  //
-  if (!((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1)) {
-    return;
-  }
-  //
-  if (aNbDE==1) {
-    aPC[1]=aPD;
-    aR[1]=0.;
-  }
-  //
-  aHeight=aPC[0].Distance(aPC[1]);
-  //
-  Standard_Real aRmin, aRmax;
-  gp_Ax2 aAx2new;
-  //
-  if (aR[0]>aR[1]) {
-    aRmin=aR[1];
-    aRmax=aR[0];
-    aPc=aPC[0];
-    gp_Vec aVz(aPC[0], aPC[1]);
-    gp_Vec aVx(aPC[0], aPX[0]);
-    gp_Dir aDz(aVz);
-    gp_Dir aDx(aVx);
-    gp_Ax2 aAx2(aPc, aDz, aDx);
-    aAx2new=aAx2;
-  }
-  else {
-    aRmin=aR[0];
-    aRmax=aR[1];
-    aPc=aPC[1];
-    gp_Vec aVz(aPC[1], aPC[0]);
-    gp_Vec aVx(aPC[1], aPX[1]);
-    gp_Dir aDz(aVz);
-    gp_Dir aDx(aVx);
-    gp_Ax2 aAx2(aPc, aDz, aDx);
-    aAx2new=aAx2;
-  }
-  //
-  gp_Ax3 aAx3(aAx2new);
-  aInfo.SetLocation(aPc);
-  aInfo.SetPosition(aAx3);
-  aInfo.SetRadius1(aRmax);
-  aInfo.SetRadius2(aRmin);
-  aInfo.SetHeight(aHeight);
-  //
-  aInfo.SetKindOfName(GEOMAlgo_KN_CONE);
+    //
+    if (aNbCE==2 && aNbSE==1) {
+      gp_Lin aLin(aPLoc, aDir);
+      //
+      aT0=ElCLib::Parameter(aLin, aPC[0]);
+      aT1=ElCLib::Parameter(aLin, aPC[1]);
+      //
+      aPc=aPC[0];
+      if (aT0>aT1) {
+        aPc=aPC[1];
+      }
+      aHeight=aPC[0].Distance(aPC[1]);
+      //
+      gp_Ax3 aAx3=aCyl.Position();
+      aAx3.SetLocation(aPc);
+      //
+      aInfo.SetPosition(aAx3);
+      aInfo.SetLocation(aPc);
+      aInfo.SetHeight(aHeight);
+      //
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
+      return; // conventional cylinder
+    }//if (aNbCE==2 && aNbSE==1) {
+  }//if (aNbV==2 && aNbE==3) {
 }
 //=======================================================================
 //function : FillDetails
 //purpose  :
 //=======================================================================
 void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
-                                           const gp_Cylinder& aCyl)
+                                           const gp_Cone& aCone)
 {
-  Standard_Integer i, aNbV, aNbE, aNbCE, aNbSE;
-  Standard_Real aT0, aT1, aHeight;
-  gp_Pnt aPC[3], aPc;
+  Standard_Integer aNbV, aNbE, aNbCE, aNbSE, aNbDE, i;
+  Standard_Real aR[3], aHeight, aRmin, aRmax;
+  gp_Pnt aPC[3], aPD, aPc, aPX[3];
+  TopoDS_Vertex aVD;
   TopoDS_Edge aE;
+  TopoDS_Iterator aIt;
   TopExp_Explorer aExp;
   TopTools_MapOfShape aM;
-  GEOMAlgo_KindOfShape aKS;
-  GEOMAlgo_KindOfName aKN, aKNE;
+  GEOMAlgo_KindOfShape aKSE;
+  GEOMAlgo_KindOfName aKNE;
   GEOMAlgo_KindOfClosed aKCE;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
-  aKN=GEOMAlgo_KN_UNKNOWN;
-  aInfo.SetKindOfName(aKN);
-  //
-  aKS=aInfo.KindOfShape();
-  if (aKS!=GEOMAlgo_KS_CYLINDER) {
-    return;
-  }
   //
-  if (aInfo.KindOfBounds()==GEOMAlgo_KB_INFINITE) {
-    return;
-  }
+  aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
   //
   aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
   aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
-  if (!(aNbV==2 && aNbE==3)) {
-    return;
-  }
-  //
-  i=0;
-  aNbCE=0;
-  aNbSE=0;
-  aExp.Init(aF, TopAbs_EDGE);
-  for (; aExp.More(); aExp.Next()) {
-    aE=TopoDS::Edge(aExp.Current());
-    if(aM.Add(aE)) {
-      const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
-      aKNE=aInfoE.KindOfName();
-      aKCE=aInfoE.KindOfClosed();
-      if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
-        aPC[aNbCE]=aInfoE.Location();
-        ++aNbCE;
-      }
-      else if (aKNE==GEOMAlgo_KN_SEGMENT) {
-        if (BRep_Tool::IsClosed(aE, aF)) {
-          ++aNbSE;
+  if (aNbV==2 && aNbE==3) {
+    i=0;
+    aNbCE=0;
+    aNbSE=0;
+    aNbDE=0;
+    aExp.Init(aF, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      aE=TopoDS::Edge(aExp.Current());
+      if(aM.Add(aE)) {
+        const GEOMAlgo_ShapeInfo& aInfoE=myMapInfo.FindFromKey(aE);
+        aKNE=aInfoE.KindOfName();
+        aKCE=aInfoE.KindOfClosed();
+        aKSE=aInfoE.KindOfShape();
+        if (aKNE==GEOMAlgo_KN_CIRCLE && aKCE==GEOMAlgo_KC_CLOSED) {
+          aPC[i]=aInfoE.Location();
+          aR[i]=aInfoE.Radius1();
+          //
+          aIt.Initialize(aE);
+          if (aIt.More()) {
+            aVD=*((TopoDS_Vertex*)&aIt.Value());
+          }
+          aPX[i]=BRep_Tool::Pnt(aVD);
+          //
+          ++i;
+          ++aNbCE;
+        }
+        else if (aKNE==GEOMAlgo_KN_SEGMENT) {
+          if (BRep_Tool::IsClosed(aE, aF)) {
+            ++aNbSE;
+          }
+        }
+        else if (aKSE==GEOMAlgo_KS_DEGENERATED) {
+          aIt.Initialize(aE);
+          if (aIt.More()) {
+            aVD=*((TopoDS_Vertex*)&aIt.Value());
+          }
+          //
+          aPD=BRep_Tool::Pnt(aVD);
+          //
+          ++aNbDE;
         }
       }
     }
-  }
-  //
-  if (!(aNbCE==2 && aNbSE==1)) {
-    return;
-  }
-  //
-  const gp_Ax1& aAx1=aCyl.Axis();
-  const gp_Dir& aDir=aAx1.Direction();
-  const gp_Pnt& aPLoc=aAx1.Location();
-  gp_Lin aLin(aPLoc, aDir);
-  //
-  aT0=ElCLib::Parameter(aLin, aPC[0]);
-  aT1=ElCLib::Parameter(aLin, aPC[1]);
-  //
-  aPc=aPC[0];;
-  if (aT0>aT1) {
-    aPc=aPC[1];
-  }
-  aHeight=aPC[0].Distance(aPC[1]);
+    //
+    if ((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1) {
+      if (aNbDE==1) {
+        aPC[1]=aPD;
+        aR[1]=0.;
+      }
+      //
+      aHeight=aPC[0].Distance(aPC[1]);
+      //
+      
+      gp_Ax2 aAx2new;
+      //
+      if (aR[0]>aR[1]) {
+        aRmin=aR[1];
+        aRmax=aR[0];
+        aPc=aPC[0];
+        gp_Vec aVz(aPC[0], aPC[1]);
+        gp_Vec aVx(aPC[0], aPX[0]);
+        gp_Dir aDz(aVz);
+        gp_Dir aDx(aVx);
+        gp_Ax2 aAx2(aPc, aDz, aDx);
+        aAx2new=aAx2;
+      }
+      else {
+        aRmin=aR[0];
+        aRmax=aR[1];
+        aPc=aPC[1];
+        gp_Vec aVz(aPC[1], aPC[0]);
+        gp_Vec aVx(aPC[1], aPX[1]);
+        gp_Dir aDz(aVz);
+        gp_Dir aDx(aVx);
+        gp_Ax2 aAx2(aPc, aDz, aDx);
+        aAx2new=aAx2;
+      }
+      //
+      gp_Ax3 aAx3(aAx2new);
+      aInfo.SetLocation(aPc);
+      aInfo.SetPosition(aAx3);
+      aInfo.SetRadius1(aRmax);
+      aInfo.SetRadius2(aRmin);
+      aInfo.SetHeight(aHeight);
+      //
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
+      return;
+    }//if ((aNbCE==2 || (aNbCE==1 && aNbDE==1)) && aNbSE==1) {
+  }//if (aNbV==2 && aNbE==3) {
   //
-  gp_Ax3 aAx3=aCyl.Position();
-  aAx3.SetLocation(aPc);
+  aInfo.SetRadius1 (aCone.RefRadius());
   //
-  aInfo.SetKindOfName(GEOMAlgo_KN_CYLINDER);
-  aInfo.SetPosition(aAx3);
-  aInfo.SetLocation(aPc);
-  aInfo.SetHeight(aHeight);
+  aRmin=0.;   // ZZ
+  aInfo.SetRadius2(aRmin);
 }
-
 //=======================================================================
 //function : FillDetails
 //purpose  :
@@ -746,6 +751,7 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
 void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
                                            const gp_Torus& )
 {
+  
   Standard_Integer aNbV, aNbE, aNbSE;
   TopoDS_Edge aE;
   TopExp_Explorer aExp;
@@ -753,46 +759,43 @@ void GEOMAlgo_ShapeInfoFiller::FillDetails(const TopoDS_Face& aF,
   GEOMAlgo_KindOfShape aKS;
   //
   GEOMAlgo_ShapeInfo& aInfo=myMapInfo.ChangeFromKey(aF);
-  aInfo.SetKindOfName(GEOMAlgo_KN_UNKNOWN);
+  aInfo.SetKindOfDef(GEOMAlgo_KD_ARBITRARY);
   //
   aKS=aInfo.KindOfShape();
   if (aKS!=GEOMAlgo_KS_TORUS) {
     return;
   }
-  //
+  
   aNbV=aInfo.NbSubShapes(TopAbs_VERTEX);
-  aNbE=aInfo.NbSubShapes(TopAbs_EDGE);
-  if (!(aNbV==1 && aNbE==2)) {
-    return;
-  }
-  //
-  aNbSE=0;
-  aExp.Init(aF, TopAbs_EDGE);
-  for (; aExp.More(); aExp.Next()) {
-    aE=TopoDS::Edge(aExp.Current());
-    if (aM.Add(aE)) {
-      if (BRep_Tool::IsClosed(aE, aF)) {
-        ++aNbSE;
+  aNbE=aInfo.NbSubShapes(TopAbs_EDGE); 
+  
+  if (aNbV==1 && aNbE==2) {
+    aNbSE=0;
+    aExp.Init(aF, TopAbs_EDGE);
+    for (; aExp.More(); aExp.Next()) {
+      aE=TopoDS::Edge(aExp.Current());
+      if (aM.Add(aE)) {
+        if (BRep_Tool::IsClosed(aE, aF)) {
+          ++aNbSE;
+        }
       }
     }
+    //
+    if (aNbSE==2) {
+      aInfo.SetKindOfDef(GEOMAlgo_KD_SPECIFIED);
+    }
   }
-  //
-  if (aNbSE!=2) {
-    return;
-  }
-  aInfo.SetKindOfName(GEOMAlgo_KN_TORUS);
 }
-//modified by NIZNHY-PKV Tue Jul 03 13:29:41 2012f
 //=======================================================================
 //function : TreatStepSphere
 //purpose  :
 //=======================================================================
-Standard_Boolean
-  GEOMAlgo_ShapeInfoFiller::TreatStepSphere(const TopoDS_Solid& aSd)
+Standard_Boolean  GEOMAlgo_ShapeInfoFiller::TreatStepSphere
+  (const TopoDS_Solid& aSd)
 {
   Standard_Boolean bRet, bIsAllowedType, bOnlyClosed, bIsEqual;
   Standard_Integer j;
-  Standard_Real aTolAng, aTolLin;
+  Standard_Real aTolAng, aTol;
   Standard_Real aVolume, aVolumeS, dV, aArea, aAreaS, dA;
   gp_Sphere aSphere[2];
   GeomAbs_SurfaceType aST;
@@ -801,7 +804,7 @@ Standard_Boolean
   TopExp_Explorer aExp;
   //
   bRet=Standard_False;
-  aTolLin=Precision::Confusion();
+  aTol=Precision::Confusion();
   aTolAng=Precision::Angular();
   //
   aExp.Init(aSd, TopAbs_FACE);
@@ -822,7 +825,7 @@ Standard_Boolean
     aSphere[j]=aGAS.Sphere();
   }
   //
-  bIsEqual=IsEqual(aSphere[0], aSphere[1], aTolLin);
+  bIsEqual=IsEqual(aSphere[0], aSphere[1], aTol);
   if (!bIsEqual) {
     return bRet;
   }
@@ -834,24 +837,30 @@ Standard_Boolean
   //
   aVolume=aSphere[0].Volume();
   //
-  BRepGProp::VolumeProperties(aSd, aGProps,  bOnlyClosed);
+  //modified by NIZNHY-PKV Tue Jun 09 08:39:47 2015f
+  BRepGProp::VolumeProperties(aSd, aGProps, aTol,  bOnlyClosed);
+  //BRepGProp::VolumeProperties(aSd, aGProps,  bOnlyClosed);
+  //modified by NIZNHY-PKV Tue Jun 09 08:39:50 2015t
   aVolumeS=aGProps.Mass();
   if (aVolumeS<0.) {
     aVolumeS=-aVolumeS;
   }
   //
   dV=fabs(aVolumeS-aVolume);
-  if (dV>aTolLin) {
+  if (dV>aTol) {
     return bRet;
   }
   //--------------------------------
   aArea=aSphere[0].Area();
   //
-  BRepGProp::SurfaceProperties(aSd, aGProps);
+  //modified by NIZNHY-PKV Tue Jun 09 08:23:54 2015f
+  BRepGProp::SurfaceProperties(aSd, aGProps, aTol);
+  //BRepGProp::SurfaceProperties(aSd, aGProps);
+  //modified by NIZNHY-PKV Tue Jun 09 08:23:56 2015t
   aAreaS=aGProps.Mass();
   //
   dA=fabs(aAreaS-aArea);
-  if (dA>aTolLin) {
+  if (dA>aTol) {
     return bRet;
   }
   //
@@ -899,4 +908,3 @@ Standard_Boolean IsEqual(const gp_Sphere& aSp1,
   //
   return bRet;
 }
-//modified by NIZNHY-PKV Tue Jul 03 13:29:43 2012t
index 2082df3a00faeb775899b856c867483a12f9c718..7dd355c1bbbe317a7daea9f8d86c4342f3313956 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index cec44b4b49f4d5cea218ebd5292a362ced5a9447..4caebe01cc7738c9f680197ccf51cd362f652459 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 47499114c95e0f96fbab454e4d7a354cf9289dd4..964ea96cd98646b71abb1059fac11d921f51d63e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -245,7 +245,7 @@ void GEOMAlgo_ShellSolid::Perform()
     const BOPDS_IndexRange& aRange=pDS->Range(iRank);
     aRange.Indices(iBeg, iEnd);
     const TopoDS_Solid& aSolid=(!iRank) ? *((TopoDS_Solid*)&aTool) : *((TopoDS_Solid*)&aObj);
-    BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
+    //BRepClass3d_SolidClassifier& aSC=aCtx->SolidClassifier(aSolid);
     //
     //------------------------------ShellSolidBuilder
     GEOMAlgo_ShellSolidBuilder aSSB;
@@ -264,50 +264,50 @@ void GEOMAlgo_ShellSolid::Perform()
       const TopoDS_Shape& aS=pDS->Shape(i);
       aType=aS.ShapeType();
       if (aType!=TopAbs_FACE) {
-       continue;
+        continue;
       }
       //
       aState=TopAbs_UNKNOWN;
       aF=*((TopoDS_Face*)&aS);
       //
       if (!aImages.IsBound(aS)) {
-       iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
-       if (iErr) {
-         myErrorStatus=16;
-         return;
-       }
-       //
-       aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
+        iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
+        if (iErr) {
+          myErrorStatus=16;
+          return;
+        }
+        //
+        aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
       }
       else {
-       const BOPCol_ListOfShape& aLSp=aImages.Find(aS);
-       aNbSp=aLSp.Extent();
-       if (aNbSp>0) {
-         continue;
-       }
-       //
-       if (aNbSp==1) {
-         aF=*((TopoDS_Face*)&aLSp.First());
-       }
-       //
-       iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
-       if (iErr) {
-         myErrorStatus=16;
-         return;
-       }
-       //
-       aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
+        const BOPCol_ListOfShape& aLSp=aImages.Find(aS);
+        aNbSp=aLSp.Extent();
+        if (aNbSp>0) {
+          continue;
+        }
+        //
+        if (aNbSp==1) {
+          aF=*((TopoDS_Face*)&aLSp.First());
+        }
+        //
+        iErr=GEOMAlgo_AlgoTools::PntInFace(aF, aP, aP2D);
+        if (iErr) {
+          myErrorStatus=16;
+          return;
+        }
+        //
+        aState=BOPTools_AlgoTools::ComputeState(aP, aSolid, aTol, aCtx);
       }
       //----------
       if (aState==TopAbs_ON) {
-       myLSON.Append(aF);
+        myLSON.Append(aF);
       }
       else if (aState==TopAbs_OUT) {
-       myLSOUT.Append(aF);
+        myLSOUT.Append(aF);
       }
       else if (aState==TopAbs_IN) {
-       myLSIN.Append(aF);
-      }        
+        myLSIN.Append(aF);
+      } 
       //----------
     }//for (i=iBeg; i<=iEnd; ++i) {
     
index 4cdfe41ed499aad1ee9737539d167c829bcd5818..91fb75a417a78b95846e03187201d9109629feee 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c432d2b7072bf933ef553f4e7e2292e211ccb12e..5e2006466f6cf1d8b099cc0a099506845b8eb597 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 0bfe332bf5ade096fee1ce5cdcaef2196fb0a847..62768485fbda71880cdff7c333c5f0e1045afa17 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
old mode 100755 (executable)
new mode 100644 (file)
index 3d0e2ff..f48c5e1
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -301,7 +301,7 @@ void TreatCompound(const TopoDS_Shape& aC1,
   TopoDS_Iterator aItC;
   //
   aLC.Append (aC1);
-  while(1) {
+  for(;;) {
     aLC1.Clear();
     aIt.Initialize(aLC);
     for (; aIt.More(); aIt.Next()) {
index 6e0afcc91f1496c45022538bd58aefbdf75f94cb..5449b9b143371e1248c431506215b71d1bbe3550 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 591312a177fc6fb061b793f26aa5475e2fe42452..d11f816c34a7edd408db7e1b25cf4e5f1c1e7396 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f98df8f116e1ff14dfb7a847396239b270d78f26..ce87e142704fe88632b227edb2ce1c78b8091c1d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index cc76842549727c5455c1962accf62994db1ddc80..0f3d9cc610778a515fb55979d8025590f1cbcd83 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e8b240e7851d9951e88659af14db45f3714d88e0..4a02ac4bef4ba6627213b463e7eadc322923edcf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 //function : GetState
 //purpose  :
 //=======================================================================
- Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
-                                                  const GeomAdaptor_Surface& aGAS,
-                                                  const Standard_Real aTol,
-                                                  TopAbs_State& aState)
+ Standard_Integer GEOMAlgo_SurfaceTools::GetState
+  (const gp_Pnt& aP,
+   const GeomAdaptor_Surface& aGAS,
+   const Standard_Real aTol,
+   TopAbs_State& aState)
 {
   Standard_Integer    iErr  = 0;
   GeomAbs_SurfaceType aType = aGAS.GetType();
 //function : GetState
 //purpose  :
 //=======================================================================
- Standard_Integer GEOMAlgo_SurfaceTools::GetState(const gp_Pnt& aP,
-                                                  const Handle(Geom_Surface)& aSurf,
-                                                  const Standard_Real aTol,
-                                                  TopAbs_State& aState)
+ Standard_Integer GEOMAlgo_SurfaceTools::GetState
+  (const gp_Pnt& aP,
+   const Handle(Geom_Surface)& aSurf,
+   const Standard_Real aTol,
+   TopAbs_State& aState)
 {
   Standard_Integer iErr;
   GeomAdaptor_Surface aGAS;
 //function : ReverseState
 //purpose  :
 //=======================================================================
- TopAbs_State GEOMAlgo_SurfaceTools::ReverseState(const TopAbs_State aState)
+ TopAbs_State GEOMAlgo_SurfaceTools::ReverseState
+  (const TopAbs_State aState)
 {
   TopAbs_State aRSt=aState;
   //
 //function : IsCoaxial
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
-                                                  const gp_Pnt& aP2,
-                                                  const gp_Cylinder& aCyl,
-                                                  const Standard_Real aTol)
+Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial
+  (const gp_Pnt& aP1,
+   const gp_Pnt& aP2,
+   const gp_Cylinder& aCyl,
+   const Standard_Real aTol)
 {
   const gp_XYZ &aLoc   = aCyl.Location().XYZ();
   const gp_Ax1 &aAxis  = aCyl.Axis();
@@ -147,7 +151,7 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
   gp_XYZ        aDP2   = aP2.XYZ().Subtracted(aLoc);
   Standard_Real aDot1  = aDP1.Dot(aDAxis);
   Standard_Real aDot2  = aDP1.Dot(aDAxis);
-  Standard_Real aTol2  = aTol*aTol;
+  //Standard_Real aTol2  = aTol*aTol;
 
   // Project P1 and P2 onto a plane with location aLoc and Norm aDAxis.
   aDP1.Subtract(aDAxis.Multiplied(aDot1));
@@ -160,7 +164,7 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
   if (fabs(aRadius1 - aRadius2) <= aTol) {
     // Check the deflection of the middle point.
     gp_XYZ        aMidP       = 0.5*(aDP1 + aDP2);
-    Standard_Real aMidRadius1 = aMidP.Modulus();
+    //Standard_Real aMidRadius1 = aMidP.Modulus();
 
     if (fabs(aRadius1 - aRadius2) <= aTol) {
       isOn = Standard_True;
@@ -173,7 +177,8 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsCoaxial(const gp_Pnt& aP1,
 //function : IsAnalytic
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic(const Handle(Geom_Surface)& aSurf)
+Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic
+  (const Handle(Geom_Surface)& aSurf)
 {
   Standard_Boolean bRet;
   GeomAbs_SurfaceType aType;
@@ -190,8 +195,9 @@ Standard_Boolean GEOMAlgo_SurfaceTools::IsAnalytic(const Handle(Geom_Surface)& a
 //function : IsConformState
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMAlgo_SurfaceTools::IsConformState(const TopAbs_State aST1,
-                                                       const GEOMAlgo_State aST2)
+Standard_Boolean GEOMAlgo_SurfaceTools::IsConformState
+  (const TopAbs_State aST1,
+   const GEOMAlgo_State aST2)
 {
   Standard_Boolean bRet=Standard_False;
   //
index 4a46ecfca41e86511c9f3159df2818a4227a4ba3..35451acdf242629c9a5bc9d6a545670c21a9857f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 982e21921f602a39a10d68c1fa57ae6af7f5b6de..44eb291d063c163c22a3ed41793726b6fc84d7cd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e9473a30976dfdec3c2879ac3789175a9d1c43c9..237d22f921c163ebe9272bbd39f96c65468f52d8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 0cc8b561016db41023bdcfbdc8fd11ac9ca5fd54..7dd43e95277858215c2079f968249ff6269ac2a4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 526a087b29d7f934d9c911f48e9bb99fc7b8a95d..9cbbe62ef57dead58b7e4d0cc16c9a9a970538d4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 5c5f3c885e39e65e1612466a8c5082588ba7abd2..f3cc03f2680687e6f43bce97e4d87b7998674515 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 849e433afbc10a34dab3ac0c037039162640d844..0cfe8f6aed6d58ba05089445c9f6225452d4e0a2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -808,7 +808,7 @@ bool GEOMBase::IsShape( GEOM::GEOM_Object_ptr object )
 // function : TypeName()
 // purpose  : Get string representation for the shape type
 //=======================================================================
-QString GEOMBase::TypeName( TopAbs_ShapeEnum type )
+QString GEOMBase::TypeName( TopAbs_ShapeEnum type, bool capitalize )
 {
   QString name = "shape";
   switch( type ) {
@@ -831,6 +831,8 @@ QString GEOMBase::TypeName( TopAbs_ShapeEnum type )
   default:
     break;
   }
+  if ( capitalize && !name.isEmpty() )
+    name = name.left(1).toUpper() + name.mid(1);
   return name;
 }
 
@@ -857,7 +859,7 @@ QString GEOMBase::GetEntry( GEOM::GEOM_Object_ptr object )
 // Function : PublishSubObject
 // Purpose  : Publish sub-shape under the main object
 //================================================================
-void GEOMBase::PublishSubObject( GEOM::GEOM_Object_ptr object )
+void GEOMBase::PublishSubObject( GEOM::GEOM_Object_ptr object, const QString& name )
 {
   SalomeApp_Study* study = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
   if ( study && !CORBA::is_nil( object ) ) {
@@ -866,9 +868,9 @@ void GEOMBase::PublishSubObject( GEOM::GEOM_Object_ptr object )
     GEOM::GEOM_Object_var father = object->GetMainShape();
     QString fatherEntry = GetEntry( father );
     if ( entry.isEmpty() && !CORBA::is_nil( father ) && !fatherEntry.isEmpty() ) {
-      QString name = GetName( object );
+      QString aName = !name.isEmpty() ? name : GetName( object );
       GeometryGUI::GetGeomGen()->AddInStudy( GeometryGUI::ClientStudyToStudy( studyDS ),
-                                             object, name.toLatin1().data(), father.in() );
+                                             object, aName.toLatin1().data(), father.in() );
     }
   }
 }
index 1a678233058221c420ab16d01d7ba2a1747f23a7..69e21e778a533a3639928a0cd24c86cfcc7255d3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -127,13 +127,13 @@ public :
   static bool         IsShape( GEOM::GEOM_Object_ptr object );
 
   /* Get string representation of shape type */
-  static QString      TypeName( TopAbs_ShapeEnum type );
+  static QString      TypeName( TopAbs_ShapeEnum type, bool capitalize = false );
   
   /* Get study entry for the given object  */
   static QString      GetEntry( GEOM::GEOM_Object_ptr object );
 
   /* Publish sub-shape under the main object */
-  static void         PublishSubObject( GEOM::GEOM_Object_ptr object );
+  static void         PublishSubObject( GEOM::GEOM_Object_ptr object, const QString& name = QString() );
 
   static void         Synchronize( QList<GEOM::GeomObjPtr>& left, QList<GEOM::GeomObjPtr>& right );
 };
index ab464279f19a53e62d25a7d829379c161f56d66c..b53c2c702a9c8933aff511d5e13e68e4be286610 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2b4db808d65b8088050b79dab63ffbb9a56781e9..4176871125eee6a8bf7b2865d3901a2a4a252a0f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 93c4c2da6e68edfbf92cda0bc3f6f3a2101310a7..4693656172db363162607113f95ff084a37392a2 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <LightApp_DataOwner.h>
 #include <SalomeApp_Tools.h>
 #include <SALOME_ListIO.hxx>
+#include "utilities.h"
 
 #include <SALOME_Prs.h>
+#include "utilities.h"
 
 #include <OCCViewer_ViewModel.h>
 #include <SVTK_ViewModel.h>
@@ -259,7 +261,8 @@ void GEOMBase_Helper::displayPreview( const bool   display,
                                       const bool   toRemoveFromEngine,
                                       const double lineWidth,
                                       const int    displayMode,
-                                      const int    color )
+                                      const int    color,
+                                      const bool   append )
 {
   if(!display) {
     erasePreview( update );
@@ -275,7 +278,8 @@ void GEOMBase_Helper::displayPreview( const bool   display,
     return;
   }
 
-  erasePreview( false );
+  if( !append )
+    erasePreview( false );
 
   try {
     SUIT_OverrideCursor wc;
@@ -407,12 +411,12 @@ void GEOMBase_Helper::erasePreview( const bool update )
     {
       SUIT_ViewManager* aViewManager = myViewWindow->getViewManager();
       if ( aViewManager->getType() == OCCViewer_Viewer::Type() ||
-          aViewManager->getType() == SVTK_Viewer::Type() )
+           aViewManager->getType() == SVTK_Viewer::Type() )
       {
-       SUIT_ViewModel* aViewModel = aViewManager->getViewModel();
-       SALOME_View* aView = dynamic_cast<SALOME_View*>(aViewModel);
-       if (aView)
-         aView->Erase( getDisplayer(), *anIter, true );
+        SUIT_ViewModel* aViewModel = aViewManager->getViewModel();
+        SALOME_View* aView = dynamic_cast<SALOME_View*>(aViewModel);
+        if (aView)
+          aView->Erase( getDisplayer(), *anIter, true );
       }
     }
     delete *anIter;
@@ -461,9 +465,9 @@ void GEOMBase_Helper::activate( const int theType )
 //================================================================
 // Function : localSelection
 // Purpose  : Activate selection of sub-shapes in accordance with mode
-//            theMode is from TopAbs_ShapeEnum
+//            modes are from TopAbs_ShapeEnum
 //================================================================
-void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMode )
+void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const std::list<int> modes )
 {
   SALOME_ListIO aListOfIO;
 
@@ -479,7 +483,7 @@ void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMo
         anEntry.toLatin1().constData(), "GEOM", strdup( GEOMBase::GetName( anObj ).toLatin1().constData() ) ) );
   }
 
-  getDisplayer()->LocalSelection( aListOfIO, theMode );
+  getDisplayer()->LocalSelection( aListOfIO, modes );
 }
 
 //================================================================
@@ -487,19 +491,64 @@ void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMo
 // Purpose  : Activate selection of sub-shapes in accordance with mode
 //            theMode is from TopAbs_ShapeEnum
 //================================================================
-void GEOMBase_Helper::localSelection( GEOM::GEOM_Object_ptr obj, const int mode )
+void GEOMBase_Helper::localSelection( const ObjectList& theObjs, const int theMode )
+{
+  std::list<int> modes;
+  modes.push_back( theMode );
+  localSelection( theObjs, modes );
+}
+
+//================================================================
+// Function : localSelection
+// Purpose  : Activate selection of sub-shapes in accordance with mode
+//            modes are from TopAbs_ShapeEnum
+//================================================================
+void GEOMBase_Helper::localSelection( GEOM::GEOM_Object_ptr obj, const std::list<int> modes )
 {
   // If object is null local selection for all objects is activated
   if ( obj->_is_nil() ) {
-    getDisplayer()->LocalSelection( Handle(SALOME_InteractiveObject)(), mode );
+    getDisplayer()->LocalSelection( Handle(SALOME_InteractiveObject)(), modes );
     return;
   }
 
   ObjectList objList;
   objList.push_back( obj );
-  localSelection( objList, mode );
+  localSelection( objList, modes );
+}
+
+//================================================================
+// Function : localSelection
+// Purpose  : Activate selection of sub-shapes in accordance with mode
+//            mode is from TopAbs_ShapeEnum
+//================================================================
+void GEOMBase_Helper::localSelection( GEOM::GEOM_Object_ptr obj, const int mode )
+{
+  std::list<int> modes;
+  modes.push_back( mode );
+  localSelection( obj, modes );
+}
+
+//================================================================
+// Function : localSelection
+// Purpose  : Activate selection of sub-shapes in accordance with mode
+//            modes are from TopAbs_ShapeEnum
+//================================================================
+void GEOMBase_Helper::localSelection( const std::list<int> modes )
+{
+  localSelection( GEOM::GEOM_Object::_nil(), modes );
 }
 
+//================================================================
+// Function : localSelection
+// Purpose  : Activate selection of sub-shapes in accordance with mode
+//            mode is from TopAbs_ShapeEnum
+//================================================================
+void GEOMBase_Helper::localSelection( const int mode )
+{
+  std::list<int> modes;
+  modes.push_back( mode );
+  localSelection( modes );
+}
 
 //================================================================
 // Function : globalSelection
@@ -833,6 +882,7 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, b
         showError();
       }
       else {
+        QList<GEOM::GeomObjPtr> anObjectList = getSourceObjects( );
         addSubshapesToStudy(); // add Sub-shapes if local selection
         const int nbObjs = objects.size();
         QStringList anEntryList;
@@ -843,21 +893,21 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, b
             QString aName = getObjectName(obj);
             if (aName.isEmpty()) {
               aName = getNewObjectName(currObj);
-                   if ( nbObjs > 1 ) {
-                           if (aName.isEmpty())
-                             aName = getPrefix(obj);
-                             if (nbObjs <= 30) {
-                               // Try to find a unique name
-                               aName = GEOMBase::GetDefaultName(aName, extractPrefix());
-                             } else {
-                               // Don't check name uniqueness in case of numerous objects
-                               aName = aName + "_" + QString::number(aNumber++);
-                             }
-                   } else {
-                           // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
-                           if ( aName.isEmpty() )
-                             aName = GEOMBase::GetDefaultName( getPrefix( obj ) );
-                   }
+                    if ( nbObjs > 1 ) {
+                            if (aName.isEmpty())
+                              aName = getPrefix(obj);
+                              if (nbObjs <= 30) {
+                                // Try to find a unique name
+                                aName = GEOMBase::GetDefaultName(aName, extractPrefix());
+                              } else {
+                                // Don't check name uniqueness in case of numerous objects
+                                aName = aName + "_" + QString::number(aNumber++);
+                              }
+                    } else {
+                            // PAL6521: use a prefix, if some dialog box doesn't reimplement getNewObjectName()
+                            if ( aName.isEmpty() )
+                              aName = GEOMBase::GetDefaultName( getPrefix( obj ) );
+                    }
             }
             anEntryList << addInStudy( obj, aName.toLatin1().constData() );
             // updateView=false
@@ -894,6 +944,8 @@ bool GEOMBase_Helper::onAccept( const bool publish, const bool useTransaction, b
             }
             anApp->putInfo( QObject::tr("GEOM_PRP_DONE") );
           }
+          if ( anObjectList.count() > 0 )
+            hideSourceObjects( anObjectList );
           result = true;
         }
         else
@@ -1137,10 +1189,10 @@ GEOM::GEOM_Object_ptr GEOMBase_Helper::findObjectInFather( GEOM::GEOM_Object_ptr
         if ( !CORBA::is_nil( cobject ) ) {
           GEOM::ListOfLong_var indices = cobject->GetSubShapeIndices();
           int length = indices->length();
-         // VSR 18/03/2014: we need only sub-shapes with single sub-shape index (to exclude groups, etc)
-         if ( length == 1 && indices[0] == theIndex ) {
-           object = cobject;
-           break;
+          // VSR 18/03/2014: we need only sub-shapes with single sub-shape index (to exclude groups, etc)
+          if ( length == 1 && indices[0] == theIndex ) {
+            object = cobject;
+            break;
           }
         }
       }
@@ -1159,6 +1211,17 @@ void GEOMBase_Helper::addSubshapesToStudy()
   //Impemented in Dialogs, called from Accept method
 }
 
+//================================================================
+// Function : getSourceObjects
+// Purpose  : Virtual method to get source objects
+//================================================================
+QList<GEOM::GeomObjPtr> GEOMBase_Helper::getSourceObjects()
+{
+  //Impemented in Dialogs, called from Accept method
+  QList<GEOM::GeomObjPtr> res;
+  return res;
+}
+
 //================================================================
 // Function : getSelected
 // Purpose  : Get selected object by specified type
@@ -1329,6 +1392,19 @@ QList<GEOM::GeomObjPtr> GEOMBase_Helper::getSelected( const QList<TopAbs_ShapeEn
   }
   return result;
 }
+//================================================================
+// Function : hideSourceObject
+// Purpose  :
+//================================================================
+void GEOMBase_Helper::hideSourceObjects( QList<GEOM::GeomObjPtr> theObject )
+{
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  if ( resMgr->booleanValue( "Geometry", "hide_input_object", true) ) {
+    GEOM_Displayer* aDisplayer = getDisplayer();
+    for ( int i = 0; i < theObject.count(); i++ )
+      aDisplayer->Erase( theObject[i].get() );
+  }
+}
 
 //================================================================
 // Function : setIsApplyAndClose
index 438c3c26dd3806ad10c591a50440cc5b1a5918f0..44f424def63df72ff4fb0dd39a3b20dfbaaf20be 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -79,7 +79,8 @@ protected:
                                 const bool   toRemoveFromEngine = true,
                                 const double lineWidth = -1,
                                 const int    displayMode = -1,
-                                const int    color  = -1 );
+                                const int    color  = -1,
+                                const bool   append = false );
   // This is the easiest way to show preview. It is based on execute() method.
   // It removes temporary GEOM::GEOM_Objects automatically.
 
@@ -95,8 +96,12 @@ protected:
                          const bool = true );
   void erasePreview    ( const bool = true );
 
+  void localSelection( const ObjectList&, const std::list<int> );
   void localSelection( const ObjectList&, const int );
+  void localSelection( GEOM::GEOM_Object_ptr, const std::list<int> );
   void localSelection( GEOM::GEOM_Object_ptr, const int );
+  void localSelection( const std::list<int> );
+  void localSelection( const int );
   void activate( const int );
   void globalSelection( const int = GEOM_ALLOBJECTS, const bool = false  );
   void globalSelection( const TColStd_MapOfInteger&, const bool = false );
@@ -168,6 +173,7 @@ protected:
   virtual QString getObjectName(GEOM::GEOM_Object_ptr object) const;
   virtual bool extractPrefix() const;
   virtual void addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr> getSourceObjects();
 
   GEOM::GEOM_Object_ptr findObjectInFather( GEOM::GEOM_Object_ptr theFather, const QString& theName );
   GEOM::GEOM_Object_ptr findObjectInFather( GEOM::GEOM_Object_ptr theFather, int theIndex );
@@ -178,6 +184,7 @@ protected:
   QList<GEOM::GeomObjPtr> getSelected( TopAbs_ShapeEnum type, int count, bool strict = true );
   QList<GEOM::GeomObjPtr> getSelected( const QList<TopAbs_ShapeEnum>& types, int count, bool strict = true );
 
+  void hideSourceObjects( QList<GEOM::GeomObjPtr> theObjectList );
   void SetIsPreview(const bool thePreview) {isPreview = thePreview;}
   bool IsPreview() {return isPreview;}
 
index 7ed88f0b0221d6d657b74fbf154bf15e56c72173..fd6e5ed691087a705d2273a1730dbc65853e7ac9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b41b5d8758c10f247095dcf3e5ad60dbb7f38415..a9eeb6b58a48ccdd37ce27c9aaf4cfd9439ead3c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 30b6adb11d0cabf10c4786945c20972a5bbeff59..18e601f83e021f41aa8c7d9c8ae67c5306f43ce5 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 864a2dc64e0f4983adb1db78283be02b4ae17c3f..4110d6832a6f030dad0d66f533088ba1108f726b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ce5fb31bf514526c60c40d287eb25a432d281ef6..087b311c03579e47227f89bd7ccd9e192b626937 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 614868aebee8c48a007bb47040038565ae0f789f..8eded44ddd1f11a45d3767159887909ae912a11b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1a93e025a86002cc1e4eaa3eb9ccacb00ee0f8ef..05cc211a2d154fa3cd0008a52da9820976d421de 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 01151f0b3153cf73e2bbba240098c2d29ef38280..089a0637d5681d547e112c3f00726babb29e1826 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 7338a3e4618901ee2344440938311c1dda3f6804..ffc392921011d995a97432298216ce5820f75cd7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 38cc179794be930d12b75c39fb92c12a18e89d6f..7d4d32cb0fb20cc39efa9c72c275d53992653503 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 947c5a87502a224e0c1e70ed91d77a5b3a8b022d..d999542d4eba5eed00358da24ec3ebdd106b2e52 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 857c8443d693ccf7f3e292a0a8fb6194035e6550..356c574b8bcd1ef699176972e558f398f226a374 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 054840340cd23e8bed79803b6dab467a43914dfa..8183a9cd7eaf325eef24a20b13f1aeaf0dee3550 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index afc78e36e0be12d414d1b5254904050cb9956c24..8387970d4e842934ebc4b34b493dc561499b02dd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3b800dea5b3e5c42a294cdbfce90247a586e4d1c..1bd3e0d63688d38dd06b17cd9d6ecec29698c2fc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 758ac88840e10e5bde5f8dd67fff64836da7ccfe..dd371d0bc10ce770129f1a8c0487b04e0e56191c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f4d2d5a0ba30c3871a3837066f76163067eaf30a..fca8108faf1b760c3f8cf106724a2499eb6fedb4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ead85e7b7f71cb6ef56d80fdc70ba7ccc4e6ce6a..4f13afd4410f213218f1baadbd6619b7d69f3307 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 44bd618c50ab1d6b475357c035a4a970e893cbbe..a9efe7e88be8f2583116c3678ff8088cba9ecf0a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 6345f7ec769030422563bc89ab03812b493846e0..f8ff0810cd4af2977cf0607df816a9a806d91444 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3c8ba91c4cf4ef143e459555524a78ebb25e9b82..49111b163ed1ff2e603a14fb812e475056605cc1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 8ae46036aafc3f358fcd0e8e629bb1c4e6e1f997..35d24e9b1205c9c214cb3f7b83b5f459ac9ca0fa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index bd0656bac9921da6754a5b4e3e019ad01243d4c6..2ae543df982e50dcac23304c6a7f6b538d022441 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 2f28014f6feae1d8bd3519c57d915b3c7fdbac24..eeb1ef74136246578e3629b6e848c3020fc531bc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 480b35c474eb01295eb054204c8d189b0e67d327..27655ebbe8b6124500dab5d0b8868b3e1b8ca27a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 7b0b25ad77062c9bfd085ee1d8f20bfa116deccd..b3ffed54e97cf8c9f4804939a1b3ab885ca89ba7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 0377e1a4eca7281bdb3d6e4d6f19a8c4a3465bd9..4e9dc38a0353aa9504c9b8f9961d0ab866a1eb7d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 74e2f4f0f71a946560f65e97a186c59b0128a9e4..c5e9e928f19b0d34ec243cdea90f3e10542158c0 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -76,12 +76,14 @@ SET(GEOMGUI_HEADERS
   GEOMGUI_Selection.h
   GEOM_GEOMGUI.hxx
   GEOMGUI_CreationInfoWdg.h
+  GEOMGUI_TextTreeWdg.h
   GEOMGUI_DimensionProperty.h
   )
 
 # header files / to be processed by moc
 SET(_moc_HEADERS 
   GEOMGUI_CreationInfoWdg.h
+  GEOMGUI_TextTreeWdg.h
   GeometryGUI.h
   )
 
@@ -114,6 +116,7 @@ SET(GEOMGUI_SOURCES
   GEOMGUI_OCCSelector.cxx
   GEOMGUI_Selection.cxx
   GEOMGUI_CreationInfoWdg.cxx
+  GEOMGUI_TextTreeWdg.cxx
   GEOMGUI_DimensionProperty.cxx
   ${_moc_SOURCES}
   ${_rcc_SOURCES}
index 3066ead0d3a5bb34fc761dfb32770b2284fccdaf..f743932508e5a96c1d9735520764b7d7e4041771 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 50dd20ace186e457021956385738e3a1372a7da2..e6f493fba010b376b8e4e181e8f3118b8ac680c8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index bd319bfab525a79d6ac6d2dd0a42ff626a8ac1d1..35a59ccfb6c2ab2022e1589a4577e9b64d7739d4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // Author    : Edward AGAPOV (eap)
 
 #include "GEOMGUI_CreationInfoWdg.h"
+#include "GEOMImpl_Types.hxx"
 
-#include <SalomeApp_Application.h>
 #include <SUIT_Desktop.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
 
 #include <QString>
 #include <QLabel>
@@ -38,33 +42,16 @@ GEOMGUI_CreationInfoWdg::GEOMGUI_CreationInfoWdg( SalomeApp_Application* app )
 //:QWidget( app->desktop() )
 {
   setWindowTitle( tr( "CREATION_INFO_TITLE" ) );
-  setObjectName( "geomCreationInformation" );
-
-  QFrame* frame = new QFrame( this );
-
-  QVBoxLayout* myLayout = new QVBoxLayout( this );
-  myLayout->addWidget( frame );
-  myLayout->setMargin(0);
 
-  QGroupBox* operationGB = new QGroupBox( tr( "OPERATION" ), frame );
-
-  myIconLbl      = new QLabel( operationGB );
-  myOperaionLnEd = new QLineEdit( operationGB );
-  myOperaionLnEd->setReadOnly( true );
-  myParamsTreeWd = new QTreeWidget( frame );
+  myParamsTreeWd = new QTreeWidget( this );
   myParamsTreeWd->setColumnCount( 2 );
   myParamsTreeWd->setHeaderLabels( QStringList() << tr( "PARAMETER" ) << tr( "VALUE" ) );
   myParamsTreeWd->header()->setStretchLastSection( true );
   myParamsTreeWd->header()->setResizeMode( 0, QHeaderView::ResizeToContents );
 
-  QHBoxLayout* operationLay = new QHBoxLayout( operationGB );
-  operationLay->addWidget( myIconLbl );
-  operationLay->addWidget( myOperaionLnEd );
-  operationLay->setMargin(5);
-
-  QVBoxLayout* aLayout = new QVBoxLayout( frame );
-  aLayout->addWidget( operationGB );
+  QVBoxLayout* aLayout = new QVBoxLayout( this );
   aLayout->addWidget( myParamsTreeWd );
+  aLayout->setMargin(11);
 
   // get a free dockable window id
   myWindowID = 10;
@@ -73,18 +60,25 @@ GEOMGUI_CreationInfoWdg::GEOMGUI_CreationInfoWdg( SalomeApp_Application* app )
   ++myWindowID; // pb when a GEOM is a sole module: CreationInfoWdg replaces Python console
 }
 
-void GEOMGUI_CreationInfoWdg::setOperation(const QPixmap& icon, const QString& name)
+QTreeWidgetItem* GEOMGUI_CreationInfoWdg::addOperation(const QPixmap& icon, const QString& name)
 {
-  myIconLbl->setPixmap( icon );
-  myOperaionLnEd->setText( name );
+  QTreeWidgetItem* item = new QTreeWidgetItem( myParamsTreeWd );
 
+  item->setIcon( 0, icon );
+  item->setText( 0, name );
   if ( name.isEmpty() )
-    myOperaionLnEd->setText( tr("NO_INFO"));
+    item->setText( 0, tr("NO_INFO"));
+
+  item->setExpanded( true );
+
+  return item;
 }
 
-void GEOMGUI_CreationInfoWdg::addParam (const QString& name, const QString& value)
+void GEOMGUI_CreationInfoWdg::addParam (QTreeWidgetItem* operation,
+                                        const QString&   name,
+                                        const QString&   value)
 {
-  QTreeWidgetItem* item = new QTreeWidgetItem( myParamsTreeWd );
+  QTreeWidgetItem* item = new QTreeWidgetItem( operation );
 
   //item->setFlags( Qt::NoItemFlags );
   item->setExpanded( true );
@@ -95,8 +89,6 @@ void GEOMGUI_CreationInfoWdg::addParam (const QString& name, const QString& valu
 
 void GEOMGUI_CreationInfoWdg::clear()
 {
-  myIconLbl->setPixmap( QPixmap() );
-  myOperaionLnEd->setText( "" );
   myParamsTreeWd->clear();
 }
 
@@ -104,3 +96,60 @@ GEOMGUI_CreationInfoWdg::~GEOMGUI_CreationInfoWdg()
 {
   //std::cout<<"~GEOMGUI_CreationInfoWdg"<<std::endl;
 }
+
+void GEOMGUI_CreationInfoWdg::setInfo( GEOM::CreationInformationSeq& info )
+{
+  clear();
+
+  QPixmap icon;
+  QString operationName;
+
+  try
+  {
+    if ( &info && info.length() > 0 )
+    {
+      SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+      for ( int j = 0, nb = info.length(); j < nb; ++j )
+      {
+        QString name = info[j].operationName.in();
+        if ( !name.isEmpty() )
+        {
+          // get plugin_name if any
+          QString plugin_name;
+          for ( size_t i = 0; i < info[j].params.length(); ++i )
+          {
+            QString value = info[j].params[i].name.in();
+            if ( value == PLUGIN_NAME )
+              plugin_name = info[j].params[i].value.in();
+          }
+          // get icon
+          QString prefix = plugin_name.isEmpty() ? "GEOM" : plugin_name;
+          if ( name.startsWith( "Import"))
+            icon = resMgr->loadPixmap( "GEOM", tr("ICO_IMPORT_SHAPE"), true );
+          else
+            icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false );
+
+          // translate operation name
+          operationName = tr( ("MEN_"+name).toLatin1().constData() );
+          if ( operationName.startsWith( "MEN_" ))
+            operationName = name; // no translation
+
+          QTreeWidgetItem* operation = addOperation( icon, operationName );
+
+          // add parameters
+          for ( size_t i = 0; i < info[j].params.length(); ++i )
+            addParam( operation,
+                      info[j].params[i].name.in(),
+                      info[j].params[i].value.in() );
+        }
+      }
+    }
+    else
+    {
+      addOperation( icon, operationName );
+    }
+  }
+  catch (...)
+  {
+  }
+}
index 37849094e0b74c2f2e0c39f093bad374ce8c355d..de935e8f7c418322ce9fd33084e4d3d4b1495c09 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 
 #include "GEOM_GEOMGUI.hxx"
 
+#include <SALOMEconfig.h>
+#include CORBA_SERVER_HEADER(GEOM_Gen)
+
 #include <QWidget>
 
-class QString;
 class QLabel;
 class QLineEdit;
+class QString;
 class QTreeWidget;
+class QTreeWidgetItem;
 class SalomeApp_Application;
 
 /*!
@@ -46,16 +50,18 @@ class GEOMGUI_EXPORT GEOMGUI_CreationInfoWdg : public QWidget
   GEOMGUI_CreationInfoWdg( SalomeApp_Application* app );
   ~GEOMGUI_CreationInfoWdg();
 
-  int getWinID() { return myWindowID; }
-
+  void setInfo( GEOM::CreationInformationSeq& info );
   void clear();
-  void setOperation(const QPixmap& icon, const QString& name);
-  void addParam    (const QString& name, const QString& value);
+
+  int getWinID() { return myWindowID; }
 
  private:
 
-  QLabel*      myIconLbl;
-  QLineEdit*   myOperaionLnEd;
+  QTreeWidgetItem* addOperation(const QPixmap& icon, const QString& name);
+  void addParam (QTreeWidgetItem* operation, const QString& name, const QString& value);
+
+ QLabel*      myIconLbl;
+  //QLineEdit*   myOperaionLnEd;
   QTreeWidget* myParamsTreeWd;
   int          myWindowID;
 
index 603680f7a789a0017bd008478209d5d060afc697..412fd64fb9544808b89ef8d4a09941dea438135c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ea7dddda7161faa85c9987a5d541a608ebbc95aa..4c7f6aae3823ddc5f32d7f9beeca0447acc82e8d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c9a1698c63b248cad1ab668e8b0f0205e981e709..8bed68fb23623b9058f33fe124039e85c5643724 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -25,6 +25,8 @@
 //
 #include "GEOMGUI_OCCSelector.h"
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <LightApp_DataSubOwner.h>
 
 #include <OCCViewer_ViewModel.h>
@@ -176,7 +178,15 @@ static void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj,
     Handle(SelectMgr_Selection) sel = theObj->Selection( m );
 
     for ( sel->Init(); sel->More(); sel->Next() ) {
+#if OCC_VERSION_LARGE > 0x06080100
+      const Handle(SelectMgr_SensitiveEntity) aHSenEntity = sel->Sensitive();
+      if( aHSenEntity.IsNull() )
+        continue;
+
+      Handle(SelectBasics_SensitiveEntity) entity = aHSenEntity->BaseSensitive();
+#else
       Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive();
+#endif
       if ( entity.IsNull() )
         continue;
 
index 9413ceecaae41e16cfd1ef9afc607cc2cc4980d5..eba12179629fcf73351ad48c283d023e75f001ae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 014c622c29797de5d7d80fc036c37bd0e0f9abd2..02ab2b0c65e82e3eb777df29e4c86213ac9603ec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -65,7 +65,6 @@
 #include <AIS_InteractiveObject.hxx>
 #include <AIS_ListOfInteractive.hxx>
 #include <AIS_GraphicTool.hxx>
-#include <AIS_Drawer.hxx>
 #include <Aspect_TypeOfFacingModel.hxx>
 #include <Prs3d_ShadingAspect.hxx>
 #include<Graphic3d_MaterialAspect.hxx>
@@ -173,6 +172,8 @@ QVariant GEOMGUI_Selection::parameter( const int idx, const QString& p ) const
     v = isVectorsMode( idx );
   else if ( p == "isVerticesMode" )
     v = isVerticesMode( idx );
+  else if ( p == "isNameMode" )
+    v = isNameMode( idx );
   else if ( p == "topLevel" )
     v = topLevel( idx );
   else if ( p == "autoBringToFront" )
@@ -477,6 +478,53 @@ bool GEOMGUI_Selection::isVerticesMode( const int index ) const
   return res;
 }
 
+bool GEOMGUI_Selection::isNameMode( const int index ) const
+{
+#ifdef USE_VISUAL_PROP_MAP
+  QVariant v = visibleProperty( entry( index ), GEOM::propertyName( GEOM::ShowName ) );
+  if ( v.canConvert( QVariant::Bool ) )
+    return v.toBool();
+#endif
+
+  bool res = false;
+
+  SALOME_View* view = GEOM_Displayer::GetActiveView();
+  QString viewType = activeViewType();
+  if ( view && ( viewType == OCCViewer_Viewer::Type() || viewType == SVTK_Viewer::Type() ) ) {
+    SALOME_Prs* prs = view->CreatePrs( entry( index ).toLatin1().constData() );
+    if ( prs ) {
+      if ( viewType == OCCViewer_Viewer::Type() ) { // assuming OCC
+        SOCC_Prs* occPrs = (SOCC_Prs*) prs;
+        AIS_ListOfInteractive lst;
+        occPrs->GetObjects( lst );
+        if ( lst.Extent() ) {
+          Handle(AIS_InteractiveObject) io = lst.First();
+          if ( !io.IsNull() ) {
+            Handle(GEOM_AISShape) aSh = Handle(GEOM_AISShape)::DownCast(io);
+            if ( !aSh.IsNull() )
+              res = aSh->isShowName();
+          }
+        }
+      }
+      else if ( viewType == SVTK_Viewer::Type() ) { // assuming VTK
+        SVTK_Prs* vtkPrs = dynamic_cast<SVTK_Prs*>( prs );
+        vtkActorCollection* lst = vtkPrs ? vtkPrs->GetObjects() : 0;
+        if ( lst ) {
+          lst->InitTraversal();
+          vtkActor* actor = lst->GetNextActor();
+          if ( actor ) {
+            GEOM_Actor* aGeomActor = GEOM_Actor::SafeDownCast(actor);
+            if ( aGeomActor )
+              res = aGeomActor->GetNameMode();
+            }
+        }
+      }
+    }
+  }
+
+  return res;
+}
+
 bool GEOMGUI_Selection::hasChildren( const _PTR(SObject)& obj )
 {
   if ( obj ) {
index d7b69260962cf7993ce89fa76013f3d054cb890c..f62f68699eaa2c7e29f6f2f098e0b85e44de3a11 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -68,6 +68,7 @@ private:
   QString               selectionMode() const;
   bool                  isVectorsMode( const int ) const;
   bool                  isVerticesMode( const int ) const;
+  bool                  isNameMode( const int ) const;
   bool                  hasChildren( const int ) const;
   int                   nbChildren( const int ) const;
   bool                  hasConcealedChildren( const int ) const;
diff --git a/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx b/src/GEOMGUI/GEOMGUI_TextTreeWdg.cxx
new file mode 100644 (file)
index 0000000..2c00a3b
--- /dev/null
@@ -0,0 +1,421 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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
+//
+// File      : GEOMGUI_TextTreeWdg.cxx
+// Author    : Alexander KOVALEV (akl)
+
+#include "GEOMGUI_TextTreeWdg.h"
+
+#include "GEOMGUI_DimensionProperty.h"
+#include "GeometryGUI.h"
+#include "GeometryGUI_Operations.h"
+#include <GEOM_Constants.h>
+#include <GEOMUtils.hxx>
+
+// GUI includes
+#include <LightApp_Module.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_DataBrowser.h>
+
+// Qt includes
+#include <QAction>
+#include <QMenu>
+#include <QString>
+#include <QLabel>
+#include <QLineEdit>
+#include <QTreeWidget>
+#include <QHeaderView>
+#include <QGroupBox>
+#include <QVBoxLayout>
+#include <QHBoxLayout>
+#include <QHash>
+
+GEOMGUI_TextTreeWdg::GEOMGUI_TextTreeWdg( SalomeApp_Application* app )
+  : myDisplayer(NULL)
+{
+  myStudy = dynamic_cast<SalomeApp_Study*>( app->activeStudy() );
+  myDisplayer = GEOM_Displayer( myStudy );
+
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  myVisibleIcon = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) );
+  myInvisibleIcon = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_INVISIBLE" ) ) );
+
+  setWindowTitle( tr( "TEXT_TREE_VIEW_TITLE" ) );
+  setObjectName( "geomTextTreeWdg" );
+
+  setRootIsDecorated( true );
+  setSelectionMode( QAbstractItemView::ExtendedSelection );
+  setAllColumnsShowFocus( true );
+  setUniformRowHeights( true );
+
+  QStringList columnNames;
+  columnNames << tr("TEXT_TREE_VIEW_NAME") << "";
+  QTreeWidgetItem * headerItem = new QTreeWidgetItem( columnNames );
+  headerItem->setIcon( 1, myVisibleIcon );
+  setHeaderItem ( headerItem ); 
+  header()->moveSection( 1, 0 );
+  header()->setResizeMode( 1, QHeaderView::ResizeToContents );
+
+  QStringList rootNames;
+  rootNames << tr("GEOM_DIMENSIONS") << "";
+  myDimensionsItem = new QTreeWidgetItem( this, rootNames );
+  myDimensionsItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );
+  addTopLevelItem( myDimensionsItem );
+
+  // get a free dockable window id
+  myWindowID = 11;
+  while( app->dockWindow( myWindowID ))
+    ++myWindowID;
+  ++myWindowID;
+
+  createActions();
+  setContextMenuPolicy( Qt::CustomContextMenu );
+  connect( this, SIGNAL( customContextMenuRequested(const QPoint&) ),
+          this, SLOT( showContextMenu(const QPoint&) ) );
+
+  connect( myStudy, SIGNAL( objVisibilityChanged( QString, Qtx::VisibilityState ) ), 
+          this, SLOT( updateVisibilityColumn( QString, Qtx::VisibilityState ) ) );
+  connect( app->objectBrowser(), SIGNAL( updated() ), this, SLOT( updateTree() ) );
+  GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( app->module( "Geometry" ) );
+  connect( aGeomGUI, SIGNAL( DimensionsUpdated( const QString& ) ), this, SLOT( updateBranch( const QString& ) ) );
+  connect( this, SIGNAL( itemClicked( QTreeWidgetItem*, int) ), 
+          this, SLOT( onItemClicked( QTreeWidgetItem*, int ) ) );
+
+}
+
+GEOMGUI_TextTreeWdg::~GEOMGUI_TextTreeWdg()
+{
+  //std::cout<<"~GEOMGUI_TextTreeWdg"<<std::endl;
+}
+
+//=================================================================================
+// function : createActions
+// purpose  : Create context popup menu actions.
+//=================================================================================
+void GEOMGUI_TextTreeWdg::createActions()
+{
+  QAction* a = new QAction( tr( "MEN_DISPLAY" ), this );
+  a->setIcon( myVisibleIcon );
+  myActions.insert( GEOMOp::OpShow, a );
+  
+  QAction* b = new QAction( tr( "MEN_ERASE" ), this );
+  b->setIcon( myInvisibleIcon );
+  myActions.insert( GEOMOp::OpHide, b );
+}
+
+//=================================================================================
+// function : updateTree
+// purpose  :
+//=================================================================================
+void GEOMGUI_TextTreeWdg::updateTree()
+{
+  myStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+  _PTR(Study) aDSStudy = myStudy->studyDS();
+  if ( aDSStudy ) {
+    _PTR(SComponent) SC ( aDSStudy->FindComponent( "GEOM" ) );
+    if ( SC ) {
+      _PTR(ChildIterator) anIter ( aDSStudy->NewChildIterator( SC ) );
+      anIter->InitEx( true );
+      QList<QString> objEntries = myObjects.keys();
+      while( anIter->More() ) {
+       _PTR(SObject) valSO ( anIter->Value() );
+       _PTR(SObject) refSO;
+       if ( !valSO->ReferencedObject( refSO ) ) {
+         // update tree of object's dimensions
+         QString anEntry = valSO->GetID().c_str();
+         updateBranch( anEntry );
+         objEntries.removeAll( anEntry );
+       }
+       anIter->Next();
+      }
+      foreach (QString entry, objEntries) {
+       removeBranch( entry, true );
+      }
+    }
+  }
+}
+  
+//=================================================================================
+// function : updateBranch
+// purpose  :
+//=================================================================================
+void GEOMGUI_TextTreeWdg::updateBranch( const QString& theEntry )
+{
+  myStudy = dynamic_cast<SalomeApp_Study*>( SUIT_Session::session()->activeApplication()->activeStudy() );
+  if ( myStudy ) {
+    _PTR(Study) aStudyDS = myStudy->studyDS();
+    if ( aStudyDS ) {
+      _PTR(SObject) obj( aStudyDS->FindObjectID( theEntry.toStdString() ) );
+      QString aName = obj->GetName().c_str();
+  
+      GEOMGUI_DimensionProperty aProp;
+      aProp.LoadFromAttribute( myStudy, theEntry.toStdString() );
+      int nbProps = aProp.GetNumber();
+
+      QTreeWidgetItem* objectItem = itemFromEntry( theEntry );
+      if ( objectItem ) {
+       removeBranch( theEntry, nbProps > 0 ? false : true );
+      }
+      QStringList itemName;
+      if ( nbProps > 0 ) {
+       itemName << aName << "";
+       if ( !objectItem ) {
+         objectItem = new QTreeWidgetItem( myDimensionsItem, itemName );
+         objectItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );
+         objectItem->setData( 1, Qt::UserRole, theEntry );
+         myDimensionsItem->addChild( objectItem );
+         myObjects.insert( theEntry, objectItem );
+         if ( myDimensionsItem->childCount() == 1 )
+           myDimensionsItem->setExpanded( true );
+       }
+       bool isDisplayed = myDisplayer.IsDisplayed( theEntry );
+       // read dimension records from property
+       for ( int anIt = 0; anIt < aProp.GetNumber(); ++anIt )
+         {
+           QString aName  = aProp.GetName( anIt );
+           bool isVisible = aProp.IsVisible( anIt );
+
+           QTreeWidgetItem* anItem = new QTreeWidgetItem;
+           anItem->setText( 0, aName );
+           //  if ( isDisplayed )
+           anItem->setIcon( 1, isVisible ? myVisibleIcon : myInvisibleIcon );
+           anItem->setData( 0, Qt::UserRole, anIt );
+           anItem->setFlags( Qt::ItemIsSelectable | Qt::ItemIsEnabled );
+           objectItem->addChild( anItem ); 
+         }
+      }
+    }
+  }
+}
+
+//=================================================================================
+// function : removeBranch
+// purpose  :
+//=================================================================================
+void GEOMGUI_TextTreeWdg::removeBranch( const QString& theEntry, bool force )
+{
+  QTreeWidgetItem* objectItem = itemFromEntry( theEntry );
+  if ( !objectItem )
+    return;
+  qDeleteAll( objectItem->takeChildren() );
+  if ( force ) {
+    myDimensionsItem->removeChild( objectItem );
+    myObjects.remove( theEntry );
+  }
+}
+
+//=================================================================================
+// function : onItemClicked()
+// purpose  : called when tree item was clicked
+//=================================================================================
+void GEOMGUI_TextTreeWdg::onItemClicked( QTreeWidgetItem* theItem, int theColumn )
+{
+  if( theColumn != 1 || theItem->icon( 1 ).isNull() || theItem->isDisabled() )
+    return;
+  
+  std::string anEntry = entryFromItem( theItem->parent() ).toStdString();
+  int aDimIndex = idFromItem( theItem );
+  GEOMGUI_DimensionProperty aProp;
+  aProp.LoadFromAttribute( myStudy, anEntry );
+  if ( aProp.IsVisible( aDimIndex ) ) {
+    aProp.SetVisible( aDimIndex, false );
+    theItem->setIcon( 1, myInvisibleIcon );
+  } else {
+    aProp.SetVisible( aDimIndex, true );
+    theItem->setIcon( 1, myVisibleIcon );
+  }
+  aProp.SaveToAttribute( myStudy, anEntry );
+  redisplay( anEntry.c_str() );
+}
+
+//=================================================================================
+// function : idFromItem
+// purpose  :
+//=================================================================================
+int GEOMGUI_TextTreeWdg::idFromItem( QTreeWidgetItem* theItem )
+{
+  if ( !theItem )
+    return -1;
+
+  bool isIdOK = false;
+  const int anId = theItem->data( 0, Qt::UserRole ).toInt( &isIdOK );
+
+  return isIdOK ? anId : -1;
+}
+
+//=================================================================================
+// function : entryFromItem
+// purpose  :
+//=================================================================================
+QString GEOMGUI_TextTreeWdg::entryFromItem( QTreeWidgetItem* theShapeItem )
+{
+  if ( !theShapeItem )
+    return "";
+
+  return theShapeItem->data( 1, Qt::UserRole ).toString();
+}
+
+//=================================================================================
+// function : itemFromEntry
+// purpose  :
+//=================================================================================
+QTreeWidgetItem* GEOMGUI_TextTreeWdg::itemFromEntry( QString theEntry )
+{
+  if ( theEntry.isEmpty() )
+    return 0;
+
+  return myObjects.value( theEntry, 0 );
+}
+
+//=================================================================================
+// function : updateVisibilityColumn
+// purpose  : Update icons of dimension items.
+//=================================================================================
+void GEOMGUI_TextTreeWdg::updateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState )
+{
+  QTreeWidgetItem* anItem = itemFromEntry( theEntry );
+  if ( !anItem )
+    return;
+  anItem->setDisabled( theState != Qtx::ShownState );
+  QTreeWidgetItem* aChildItem;
+  GEOMGUI_DimensionProperty aProp;
+  for ( int i=0; i < anItem->childCount(); i++ ) {
+    aChildItem = anItem->child( i );
+    if ( theState == Qtx::ShownState ) {
+      aProp.LoadFromAttribute( myStudy, theEntry.toStdString() );
+      if ( aProp.GetNumber() == 0 )
+       continue;
+      aChildItem->setIcon( 1, aProp.IsVisible( idFromItem( aChildItem ) ) ? myVisibleIcon : myInvisibleIcon );
+      aChildItem->setDisabled( false );
+    } else {
+      aChildItem->setIcon( 1, QIcon() );
+      aChildItem->setDisabled( true );
+    }
+  }
+}
+
+//=================================================================================
+// function : showContextMenu
+// purpose  : 
+//=================================================================================
+void GEOMGUI_TextTreeWdg::showContextMenu( const QPoint& pos )
+{
+  if ( selectedItems().isEmpty() )
+    return;
+  QMenu aMenu;
+  aMenu.addAction( myActions[GEOMOp::OpShow] );
+  aMenu.addAction( myActions[GEOMOp::OpHide] );
+  if ( selectedItems().count() == 1 ) {
+    QTreeWidgetItem* anItem = selectedItems().first();
+    QString anEntry = entryFromItem( anItem->parent() );
+    if ( !anEntry.isEmpty() ) {
+      GEOMGUI_DimensionProperty aProp;
+      aProp.LoadFromAttribute( myStudy, anEntry.toStdString() );
+      if ( aProp.GetNumber() == 0 )
+       return;
+      aMenu.clear();
+      if ( aProp.IsVisible( idFromItem( anItem ) ) )
+       aMenu.addAction( myActions[GEOMOp::OpHide] );
+      else
+       aMenu.addAction( myActions[GEOMOp::OpShow] );
+    }
+  }
+  QAction* selPopupItem = aMenu.exec( viewport()->mapToGlobal(pos) );
+  if ( selPopupItem == myActions[GEOMOp::OpShow] )
+    setVisibility( true );
+  else if ( selPopupItem == myActions[GEOMOp::OpHide] )
+    setVisibility( false );
+}
+
+//=================================================================================
+// function : setVisibility
+// purpose  : 
+//=================================================================================
+void GEOMGUI_TextTreeWdg::setVisibility( bool theVisibility )
+{
+  if ( myDimensionsItem->isSelected() ) {
+    // set visibility for all dimensions
+    QTreeWidgetItem* anItem;
+    foreach ( QString entry, myObjects.keys() ) {
+      anItem = itemFromEntry( entry );
+      if ( !anItem->isDisabled() )
+       setShapeDimensionsVisibility( entry, theVisibility );
+    }
+    return;
+  }
+  foreach ( QTreeWidgetItem* item, selectedItems() ) {
+    if ( item->isDisabled() || item->parent()->isSelected() )
+      continue;
+    QString anEntry = entryFromItem( item );
+    if ( !anEntry.isEmpty() ) {
+      // it is a shape item
+      setShapeDimensionsVisibility( anEntry, theVisibility );
+    } else {
+      // it is a dimension item
+      anEntry = entryFromItem( item->parent() );
+      setDimensionVisibility( anEntry, item, theVisibility );
+    }
+  }
+}
+
+//=================================================================================
+// function : setShapeDimensionsVisibility
+// purpose  : 
+//=================================================================================
+void GEOMGUI_TextTreeWdg::setShapeDimensionsVisibility( QString theEntry, bool theVisibility )
+{
+  QTreeWidgetItem* anItem = itemFromEntry( theEntry );
+  QTreeWidgetItem* aChildItem;
+  for ( int i=0; i < anItem->childCount(); i++ ) {
+    aChildItem = anItem->child( i );
+    setDimensionVisibility( theEntry, aChildItem, theVisibility );
+  }
+  redisplay( theEntry );
+}
+
+//=================================================================================
+// function : setDimensionVisibility
+// purpose  : 
+//=================================================================================
+void GEOMGUI_TextTreeWdg::setDimensionVisibility( QString theEntry, QTreeWidgetItem* theDimItem, bool theVisibility )
+{
+  GEOMGUI_DimensionProperty aProp;
+  aProp.LoadFromAttribute( myStudy, theEntry.toStdString() );
+  int aDimIndex = idFromItem( theDimItem );
+  if ( aProp.GetNumber() == 0  || aProp.IsVisible( aDimIndex ) == theVisibility )
+    return;;
+  aProp.SetVisible( aDimIndex, theVisibility );
+  aProp.SaveToAttribute( myStudy, theEntry.toStdString() );
+
+  theDimItem->setIcon( 1, theVisibility ? myVisibleIcon : myInvisibleIcon );
+  redisplay( theEntry );
+}
+
+//=================================================================================
+// function : redisplay
+// purpose  : 
+//=================================================================================
+void GEOMGUI_TextTreeWdg::redisplay( QString theEntry )
+{
+  Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject( theEntry.toLatin1().constData(), "GEOM", "TEMP_IO" );
+  myDisplayer.Redisplay( io );
+}
diff --git a/src/GEOMGUI/GEOMGUI_TextTreeWdg.h b/src/GEOMGUI/GEOMGUI_TextTreeWdg.h
new file mode 100644 (file)
index 0000000..689a21a
--- /dev/null
@@ -0,0 +1,89 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 GEOMGUI_TEXTTREEWDG_H
+#define GEOMGUI_TEXTTREEWDG_H
+
+#include "GEOM_GEOMGUI.hxx"
+#include "GEOM_Displayer.h"
+
+#include <QTreeWidget>
+#include <QHash>
+
+#include <SALOMEDSClient.hxx>
+
+class QLabel;
+class QLineEdit;
+class QString;
+class QTreeWidgetItem;
+class SalomeApp_Application;
+class SalomeApp_Study;
+
+/*!
+ * \brief Tree view contains Dimension and Annotation text items:
+ *  - text visibility in OCC viewer
+ *  - text object name
+ */
+class GEOMGUI_EXPORT GEOMGUI_TextTreeWdg : public QTreeWidget
+{
+  Q_OBJECT
+
+ public:
+  GEOMGUI_TextTreeWdg( SalomeApp_Application* app );
+  ~GEOMGUI_TextTreeWdg();
+
+  int getWinID() { return myWindowID; }
+
+  void                          removeBranch( const QString& theEntry, 
+                                             bool force = true );
+  int                           idFromItem( QTreeWidgetItem* theItem );
+  QString                       entryFromItem( QTreeWidgetItem* theShapeItem );
+  QTreeWidgetItem*              itemFromEntry( QString theEntry );
+  void                          setShapeDimensionsVisibility( QString theEntry, bool theVisibility );
+  void                          setDimensionVisibility( QString theEntry, QTreeWidgetItem* theDimItem, bool theVisibility );
+
+protected:
+  void                          createActions();
+  void                          redisplay( QString theEntry );
+
+ public slots:
+  void                          updateTree();
+  void                          updateBranch( const QString& theEntry );
+
+private slots:
+  void                          onItemClicked(QTreeWidgetItem*, int );
+  void                          updateVisibilityColumn( QString theEntry, Qtx::VisibilityState theState );
+  void                          setVisibility( bool visibility );
+  void                          showContextMenu( const QPoint& pos );
+
+ private:
+
+  int                           myWindowID;
+
+  QIcon                         myVisibleIcon;
+  QIcon                         myInvisibleIcon;
+  QHash<QString, QTreeWidgetItem*> myObjects;
+  SalomeApp_Study*              myStudy;
+  QTreeWidgetItem*              myDimensionsItem;
+  GEOM_Displayer                myDisplayer;
+
+  QMap<int, QAction*>           myActions;   //!< menu actions list
+
+};
+#endif
index 6b4a12e21a07d2fc5d2968c77d7a3621e5147c7b..c2d71d57c0a1d0f5b150df124c4e8a13a2e65a42 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 291b59c8cbdb9be84ad6d0b85e7fd50ef564ab8b..64562eb3464e29d9fda3f97dd5ea34e0bb5a3819 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 7d79a2cd5e3f6168cfeb9485463f71003207670a..3166ac20a98e47b4ab47eb70e11be71fb4de214c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <LightApp_DataObject.h>
 #include <SalomeApp_TypeFilter.h>
 #include <SalomeApp_Tools.h>
+#include "utilities.h"
 
 #include <SALOME_ListIO.hxx>
 #include <SALOME_Prs.h>
+#include "utilities.h"
 
 #include <SOCC_Prs.h>
 #include <SOCC_ViewModel.h>
@@ -79,7 +81,6 @@
 #include <OCCViewer_Utilities.h>
 
 // OCCT Includes
-#include <AIS_Drawer.hxx>
 #include <AIS_Dimension.hxx>
 #include <AIS_LengthDimension.hxx>
 #include <AIS_DiameterDimension.hxx>
 
 // Hard-coded value of shape deflection coefficient for VTK viewer
 const double VTK_MIN_DEFLECTION = 0.001;
+// If the next macro is defined, the deflection coefficient for VTK presentation
+// is limited by VTK_MIN_DEFLECTION
+//#define LIMIT_DEFLECTION_FOR_VTK
 
 // Pixmap caching support
 namespace
@@ -253,7 +257,20 @@ namespace
 #endif
     }
   }
-}
+
+  uint randomize( uint size )
+  {
+    static bool initialized = false;
+    if ( !initialized ) {
+      qsrand( QDateTime::currentDateTime().toTime_t() );
+      initialized = true;
+    }
+    uint v = qrand();
+    v = uint( (double)( v ) / RAND_MAX * size );
+    v = qMax( uint(0), qMin ( v, size-1 ) );
+    return v;
+  }
+} // namespace
 
 //================================================================
 // Function : getActiveStudy
@@ -460,25 +477,24 @@ GEOM_Displayer::GEOM_Displayer( SalomeApp_Study* st )
   myHasDisplayMode = false;
 
   int aType = resMgr->integerValue("Geometry", "type_of_marker", (int)Aspect_TOM_PLUS);
-  myWidth = resMgr->integerValue("Geometry", "edge_width", -1);
-  myIsosWidth = resMgr->integerValue("Geometry", "isolines_width", -1);
   
-  myTransparency = resMgr->integerValue("Geometry", "transparency", 0) / 100.;
-  myHasTransparency = false;
-
   myTypeOfMarker = (Aspect_TypeOfMarker)(std::min((int)Aspect_TOM_RING3, std::max((int)Aspect_TOM_POINT, aType)));
   myScaleOfMarker = (resMgr->integerValue("Geometry", "marker_scale", 1)-(int)GEOM::MS_10)*0.5 + 1.0;
   myScaleOfMarker = std::min(7.0, std::max(1., myScaleOfMarker));
 
+  // Next properties provide a way to customize displaying of presentations;
+  // for instance, this is useful for preview
   myColor = -1;
-  // This color is used for shape displaying. If it is equal -1 then
-  // default color is used.
   myTexture = "";
-
+  myNbIsos = -1;
   myWidth = -1;
+  myTransparency = -1;
   myType = -1;
+  myIsosColor = -1;
+  myIsosWidth = -1;
+
+  // This parameter is used for activisation/deactivisation (selection) of objects to be displayed
   myToActivate = true;
-  // This parameter is used for activisation/deactivisation of objects to be displayed
 
   // Activate parallel vizualisation only for testing purpose
   // and if the corresponding env variable is set to 1
@@ -816,6 +832,9 @@ void GEOM_Displayer::updateShapeProperties( const Handle(GEOM_AISShape)& AISShap
   // - color for edges in shading+edges mode
   AISShape->SetEdgesInShadingColor( SalomeApp_Tools::color( propMap.value( GEOM::propertyName( GEOM::OutlineColor ) ).value<QColor>() ) );
 
+  // - color of labels (textual fields and shape name)
+  AISShape->SetLabelColor( qColorFromResources( "label_color", QColor( 255, 255, 255 ) ) );
+
   // set display mode
   AISShape->SetDisplayMode( HasDisplayMode() ? 
                             // predefined display mode, manually set to displayer via GEOM_Displayer::SetDisplayMode() function 
@@ -823,11 +842,10 @@ void GEOM_Displayer::updateShapeProperties( const Handle(GEOM_AISShape)& AISShap
                             // display mode from properties
                             propMap.value( GEOM::propertyName( GEOM::DisplayMode ) ).toInt() );
 
-  // - face boundaries color
-  if( AISShape->DisplayMode() == GEOM_AISShape::ShadingWithEdges )
-    AISShape->Attributes()->SetFaceBoundaryDraw( Standard_True );
+  // - face boundaries color and line width
   anAspect = AISShape->Attributes()->FaceBoundaryAspect();
   anAspect->SetColor( SalomeApp_Tools::color( propMap.value( GEOM::propertyName( GEOM::OutlineColor ) ).value<QColor>() ) );
+  anAspect->SetWidth( HasWidth() ? GetWidth() : propMap.value( GEOM::propertyName( GEOM::LineWidth ) ).toInt() );
   AISShape->Attributes()->SetFaceBoundaryAspect( anAspect );
 
   // set display vectors flag
@@ -837,6 +855,10 @@ void GEOM_Displayer::updateShapeProperties( const Handle(GEOM_AISShape)& AISShap
   bool isVerticesMode = propMap.value( GEOM::propertyName( GEOM::Vertices ) ).toBool();
   AISShape->SetDisplayVertices( isVerticesMode );
 
+  // set display name flag
+  bool isNameMode = propMap.value( GEOM::propertyName( GEOM::ShowName ) ).toBool();
+  AISShape->SetDisplayName( isNameMode );
+
   // set transparency
   if( HasTransparency() ) {
     AISShape->SetTransparency( GetTransparency() );
@@ -851,12 +873,34 @@ void GEOM_Displayer::updateShapeProperties( const Handle(GEOM_AISShape)& AISShap
   int isosWidth = propMap.value( GEOM::propertyName( GEOM::IsosWidth ) ).toInt();
   Handle(Prs3d_IsoAspect) uIsoAspect = AISShape->Attributes()->UIsoAspect();
   Handle(Prs3d_IsoAspect) vIsoAspect = AISShape->Attributes()->VIsoAspect();
-  uIsoAspect->SetColor( isosColor );
-  uIsoAspect->SetWidth( isosWidth );
-  uIsoAspect->SetNumber( uIsos );
-  vIsoAspect->SetColor( isosColor );
-  vIsoAspect->SetWidth( isosWidth );
-  vIsoAspect->SetNumber( vIsos );
+
+  if ( HasIsosColor() ) {
+    uIsoAspect->SetColor( (Quantity_NameOfColor)GetIsosColor() );
+    vIsoAspect->SetColor( (Quantity_NameOfColor)GetIsosColor() );
+  }
+  else {
+    uIsoAspect->SetColor( isosColor );
+    vIsoAspect->SetColor( isosColor );
+  }
+
+  if ( HasIsosWidth() ) {
+    uIsoAspect->SetWidth( GetIsosWidth() );
+    vIsoAspect->SetWidth( GetIsosWidth() );
+  }
+  else {
+    uIsoAspect->SetWidth( isosWidth );
+    vIsoAspect->SetWidth( isosWidth );
+  }
+  
+  if ( HasNbIsos() ) {
+    uIsoAspect->SetNumber( GetNbIsos() );
+    vIsoAspect->SetNumber( GetNbIsos() );
+  }
+  else {
+    uIsoAspect->SetNumber( uIsos );
+    vIsoAspect->SetNumber( vIsos );
+  }
+
   AISShape->Attributes()->SetUIsoAspect( uIsoAspect );
   AISShape->Attributes()->SetVIsoAspect( vIsoAspect );
 
@@ -1008,7 +1052,11 @@ void GEOM_Displayer::updateActorProperties( GEOM_Actor* actor, bool create )
   // actor->SetShape(myShape,aDefPropMap.value(GEOM::propertyName( GEOM::Deflection )).toDouble(),myType == GEOM_VECTOR);
   /////////////////////////////////////////////////////////////////////////
   if ( !actor->getTopo().IsSame( myShape ) )
+#ifdef LIMIT_DEFLECTION_FOR_VTK
     actor->SetShape( myShape, VTK_MIN_DEFLECTION, myType == GEOM_VECTOR );
+#else
+    actor->SetShape( myShape, qMax( propMap.value( GEOM::propertyName( GEOM::Deflection ) ).toDouble(), GEOM::minDeflection() ), myType == GEOM_VECTOR );
+#endif
 
   // set material
   Material_Model material;
@@ -1022,16 +1070,25 @@ void GEOM_Displayer::updateActorProperties( GEOM_Actor* actor, bool create )
 
   // - set number of iso-lines
   int nbIsos[2]= { 1, 1 };
-  QStringList isos = propMap.value( GEOM::propertyName( GEOM::NbIsos ) ).toString().split( GEOM::subSectionSeparator() );
-  nbIsos[0] = isos[0].toInt();
-  nbIsos[1] = isos[1].toInt();
+  if ( HasNbIsos() ) {
+    nbIsos[0] = GetNbIsos();
+    nbIsos[1] = GetNbIsos();
+  }
+  else {
+    QStringList isos = propMap.value( GEOM::propertyName( GEOM::NbIsos ) ).toString().split( GEOM::subSectionSeparator() );
+    nbIsos[0] = isos[0].toInt();
+    nbIsos[1] = isos[1].toInt();
+  }
   actor->SetNbIsos( nbIsos );
 
   // - set iso-lines width
-  actor->SetIsosWidth( propMap.value( GEOM::propertyName( GEOM::IsosWidth ) ).toInt() );
+  actor->SetIsosWidth( HasIsosWidth() ? GetIsosWidth() : propMap.value( GEOM::propertyName( GEOM::IsosWidth ) ).toInt() );
 
   // - set iso-lines color
-  c = propMap.value( GEOM::propertyName( GEOM::IsosColor ) ).value<QColor>();
+  if ( HasIsosColor() )
+    c = SalomeApp_Tools::color( Quantity_Color((Quantity_NameOfColor)GetIsosColor()) );
+  else
+    c = propMap.value( GEOM::propertyName( GEOM::IsosColor ) ).value<QColor>();
   actor->SetIsosColor( c.redF(), c.greenF(), c.blueF() );
 
   // set colors
@@ -1070,6 +1127,10 @@ void GEOM_Displayer::updateActorProperties( GEOM_Actor* actor, bool create )
   c = propMap.value( GEOM::propertyName( GEOM::OutlineColor ) ).value<QColor>();
   actor->SetEdgesInShadingColor( c.redF(), c.greenF(), c.blueF() );
 
+  // - color of labels (shape name)
+  c = colorFromResources( "label_color", QColor( 255, 255, 255 ) );
+  actor->SetLabelColor( c.redF(), c.greenF(), c.blueF() );
+
   // set opacity
   if( HasTransparency() ) {
     actor->SetOpacity( 1.0 - GetTransparency() );
@@ -1090,6 +1151,9 @@ void GEOM_Displayer::updateActorProperties( GEOM_Actor* actor, bool create )
   // set display vertices flag
   actor->SetVerticesMode( propMap.value( GEOM::propertyName( GEOM::Vertices ) ).toBool() );
 
+  // set display name flag
+  actor->SetNameMode( propMap.value( GEOM::propertyName( GEOM::ShowName ) ).toBool() );
+
   // set display mode
   int displayMode = HasDisplayMode() ? 
     // predefined display mode, manually set to displayer via GEOM_Displayer::SetDisplayMode() function 
@@ -1170,11 +1234,12 @@ void GEOM_Displayer::updateDimensions( const Handle(SALOME_InteractiveObject)& t
 
   QColor  aQColor       = aResMgr->colorValue  ( "Geometry", "dimensions_color", QColor( 0, 255, 0 ) );
   int     aLineWidth    = aResMgr->integerValue( "Geometry", "dimensions_line_width", 1 );
-  double  aFontHeight   = aResMgr->doubleValue ( "Geometry", "dimensions_font_height", 10 );
+  QFont   aFont         = aResMgr->fontValue   ( "Geometry", "dimensions_font", QFont("Y14.5M-2009", 14) );
   double  anArrowLength = aResMgr->doubleValue ( "Geometry", "dimensions_arrow_length", 5 );
   bool    isUnitsShown  = aResMgr->booleanValue( "Geometry", "dimensions_show_units", false );
   QString aUnitsLength  = aResMgr->stringValue ( "Geometry", "dimensions_length_units", "m" );
   QString aUnitsAngle   = aResMgr->stringValue ( "Geometry", "dimensions_angle_units", "deg" );
+  bool    aUseText3d    = aResMgr->booleanValue( "Geometry", "dimensions_use_text3d", false );
 
   // restore dimension presentation from saved attribute or property data
   AIS_ListOfInteractive aRestoredDimensions;
@@ -1240,10 +1305,12 @@ void GEOM_Displayer::updateDimensions( const Handle(SALOME_InteractiveObject)& t
 
     aStyle->SetCommonColor( aColor );
     aStyle->MakeUnitsDisplayed( (Standard_Boolean) isUnitsShown );
-    aStyle->MakeText3d( Standard_True );
+    aStyle->MakeText3d( aUseText3d );
     aStyle->MakeTextShaded( Standard_True );
-    aStyle->SetExtensionSize( aFontHeight * 0.5 );
-    aStyle->TextAspect()->SetHeight( aFontHeight );
+    int fsize = aFont.pixelSize() != -1 ? aFont.pixelSize() : aFont.pointSize();
+    aStyle->SetExtensionSize( fsize * 0.5 );
+    aStyle->TextAspect()->SetFont( aFont.family().toLatin1().data() );
+    aStyle->TextAspect()->SetHeight( fsize );
     aStyle->ArrowAspect()->SetLength( anArrowLength );
     aStyle->LineAspect()->SetWidth( aLineWidth );
     aStyle->SetTextHorizontalPosition( aPrs->DimensionAspect()->TextHorizontalPosition() );
@@ -1704,6 +1771,7 @@ SALOME_Prs* GEOM_Displayer::buildPresentation( const QString& entry,
 
                   if ( !GeomObject->_is_nil() )
                   {
+                    theIO->setName( GeomObject->GetName() );
                     // finally set shape
                     setShape( GEOM_Client::get_client().GetShape( GeometryGUI::GetGeomGen(), GeomObject ) );
                   }
@@ -1784,7 +1852,7 @@ void GEOM_Displayer::internalReset()
  *  of their sub-shapes (with opened local context for OCC viewer)
  */
 //=================================================================
-void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& theIO, const int theMode )
+void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& theIO, const std::list<int> modes )
 {
   SUIT_Session* session = SUIT_Session::session();
   SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( session->activeApplication() );
@@ -1801,11 +1869,25 @@ void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& the
     if (!theIO.IsNull() && !vf->isVisible(theIO))
       Display(theIO);
     SALOME_Prs* prs = vf->CreatePrs( theIO.IsNull() ? 0 : theIO->getEntry() );
-    vf->LocalSelection( prs, theMode );
+    vf->LocalSelection( prs, modes );
     delete prs;  // delete presentation because displayer is its owner
   }
 }
 
+//=================================================================
+/*!
+ *  GEOM_Displayer::LocalSelection
+ *  Activate selection of CAD shapes with activisation of selection
+ *  of their sub-shapes (with opened local context for OCC viewer)
+ */
+//=================================================================
+void GEOM_Displayer::LocalSelection( const Handle(SALOME_InteractiveObject)& theIO, const int theMode )
+{
+  std::list<int> modes;
+  modes.push_back( theMode );
+  LocalSelection( theIO, modes );
+}
+
 //=================================================================
 /*!
  *  GEOM_Displayer::globalSelection
@@ -1919,11 +2001,25 @@ void GEOM_Displayer::GlobalSelection( const TColStd_MapOfInteger& theModes,
  *  of their sub-shapes (with opened local context for OCC viewer)
  */
 //=================================================================
-void GEOM_Displayer::LocalSelection( const SALOME_ListIO& theIOList, const int theMode )
+void GEOM_Displayer::LocalSelection( const SALOME_ListIO& theIOList, const std::list<int> modes )
 {
   SALOME_ListIteratorOfListIO Iter( theIOList );
   for ( ; Iter.More(); Iter.Next() )
-    LocalSelection( Iter.Value(), theMode );
+    LocalSelection( Iter.Value(), modes );
+}
+
+//=================================================================
+/*!
+ *  GEOM_Displayer::LocalSelection
+ *  Activate selection of CAD shapes with activisation of selection
+ *  of their sub-shapes (with opened local context for OCC viewer)
+ */
+//=================================================================
+void GEOM_Displayer::LocalSelection( const SALOME_ListIO& theIOList, const int theMode )
+{
+  std::list<int> modes;
+  modes.push_back( theMode );
+  LocalSelection( theIOList, modes );
 }
 
 //=================================================================
@@ -2009,15 +2105,9 @@ void GEOM_Displayer::UnsetColor()
 //=================================================================
 double GEOM_Displayer::SetTransparency( const double transparency )
 {
-  double aPrevTransparency = myTransparency;
-  if ( transparency < 0 ) {
-    UnsetTransparency();
-  }
-  else {
-    myTransparency = transparency;
-    myHasTransparency = true;
-  }
-  return aPrevTransparency;
+  double prevTransparency = myTransparency;
+  myTransparency = transparency;
+  return prevTransparency;
 }
 
 //=================================================================
@@ -2039,7 +2129,7 @@ double GEOM_Displayer::GetTransparency() const
 //=================================================================
 bool GEOM_Displayer::HasTransparency() const
 {
-  return myHasTransparency;
+  return myTransparency >= 0;
 }
 
 //=================================================================
@@ -2050,27 +2140,17 @@ bool GEOM_Displayer::HasTransparency() const
 //=================================================================
 double GEOM_Displayer::UnsetTransparency()
 {
-  double aPrevTransparency = myTransparency;
-  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-  myTransparency = resMgr->integerValue("Geometry", "transparency", 0) / 100.;
-  myHasTransparency = false;
-  return aPrevTransparency;
+  return SetTransparency( -1 );
 }
 
-
 //=================================================================
 /*!
  *  GEOM_Displayer::SetTexture
- *  Set color for shape displaying. If it is equal -1 then default color is used.
- *  Available values are from Quantity_NameOfColor enumeration
  */
 //=================================================================
 void GEOM_Displayer::SetTexture( const std::string& texureFileName )
 {
-  if(texureFileName!="")
-  {
-    myTexture = texureFileName;
-  }
+  myTexture = texureFileName;
 }
 
 bool GEOM_Displayer::HasTexture() const
@@ -2109,7 +2189,6 @@ void GEOM_Displayer::UnsetWidth()
   myWidth = -1;
 }
 
-
 int GEOM_Displayer::GetIsosWidth() const
 {
   return myIsosWidth;
@@ -2125,6 +2204,49 @@ bool GEOM_Displayer::HasIsosWidth() const
   return myIsosWidth != -1;
 }
 
+int GEOM_Displayer::SetNbIsos( const int nbIsos )
+{
+  int prevNbIsos = myNbIsos;
+  myNbIsos = nbIsos;
+  return prevNbIsos;
+}
+
+int GEOM_Displayer::UnsetNbIsos()
+{
+  return SetNbIsos( -1 );
+}
+
+int GEOM_Displayer::GetNbIsos() const
+{
+  return myNbIsos;
+}
+
+bool GEOM_Displayer::HasNbIsos() const
+{
+  return myNbIsos >= 0;
+}
+
+int GEOM_Displayer::SetIsosColor( const int color )
+{
+  int prevColor = myIsosColor;
+  myIsosColor = color;
+  return prevColor;
+}
+
+int GEOM_Displayer::GetIsosColor() const
+{
+  return myIsosColor;
+}
+
+bool GEOM_Displayer::HasIsosColor() const
+{
+  return myIsosColor != -1;
+}
+
+int GEOM_Displayer::UnsetIsosColor()
+{
+  return SetIsosColor( -1 );
+}
 
 //=================================================================
 /*!
@@ -2261,7 +2383,7 @@ SALOMEDS::Color GEOM_Displayer::getPredefinedUniqueColor()
     }
   }
 
-  static int currentColor = 0;
+  static int currentColor = randomize( colors.size() );
 
   SALOMEDS::Color color;
   color.R = (double)colors[currentColor].red()   / 255.0;
@@ -2445,6 +2567,9 @@ PropMap GEOM_Displayer::getDefaultPropertyMap()
   // - show vertices flag (false by default)
   propMap.insert( GEOM::propertyName( GEOM::Vertices ), false );
 
+  // - show name flag (false by default)
+  propMap.insert( GEOM::propertyName( GEOM::ShowName ), false );
+
   // - shading color (take default value from preferences)
   propMap.insert( GEOM::propertyName( GEOM::ShadingColor ),
                   colorFromResources( "shading_color", QColor( 255, 255, 0 ) ) );
index 0096c51b2cac3a5a30763e0627828d52e531dc61..c273f7d6ac098f58708cc7ebc287c921f7a7a5fb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -162,7 +162,20 @@ public:
   void          SetIsosWidth  ( const int );
   int           GetIsosWidth  () const;
   bool          HasIsosWidth  () const;
+  /* Set nb iso-libes for displaying. Use -1 to set default values. */
+  int           SetNbIsos( const int );
+  int           UnsetNbIsos();
+  int           GetNbIsos() const;
+  bool          HasNbIsos() const;
   
+  /* Set color for iso-lines displaying. If it is equal -1 then default color is used.
+     Available values are from Quantity_NameOfColor enumeration */
+  int           SetIsosColor  ( const int );
+  int           UnsetIsosColor();
+  int           GetIsosColor  () const;
+  bool          HasIsosColor  () const;
   /* Set display mode shape displaying. If it is equal -1 then display mode is used. */
   int           SetDisplayMode( const int );
   int           GetDisplayMode() const;
@@ -186,7 +199,9 @@ public:
   bool          ToActivate() const;
 
   /* Activate/Deactivate selection*/
+  void         LocalSelection( const Handle(SALOME_InteractiveObject)&, const std::list<int> );
   void         LocalSelection( const Handle(SALOME_InteractiveObject)&, const int );
+  void         LocalSelection( const SALOME_ListIO& theIOList, const std::list<int> );
   void         LocalSelection( const SALOME_ListIO& theIOList, const int );
   void         GlobalSelection( const int = GEOM_ALLOBJECTS, const bool = false );
   void         GlobalSelection( const TColStd_MapOfInteger&, const bool = false, const QList<int>* = 0 );
@@ -289,13 +304,14 @@ protected:
   int                              myColor;
   double                           myWidth;
   int                              myIsosWidth;
+  int                              myNbIsos;
+  int                              myIsosColor;
   bool                             myToActivate;
   int                              myDisplayMode;
   bool                             myHasDisplayMode;
   Aspect_TypeOfMarker              myTypeOfMarker;
   double                           myScaleOfMarker;
   double                           myTransparency;
-  bool                             myHasTransparency;
 
 private:
   SalomeApp_Application* myApp;
index 73d8f3e854010e1b6da050fd5a622ac371db42a9..b62597fe08a4e23cd547adc4b845c5bf46be3d54 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 40c06a6320f4c4b1352bc1d3cfc84289f515be60..cfcccd313b526d0aa9f64ae1c859f2be4c1d67d4 100644 (file)
             <source>ICON_DLG_BUILD_FACE</source>
             <translation>build_face.png</translation>
         </message>
+        <message>
+            <source>ICON_DLG_BUILD_FACE_SURFACE</source>
+            <translation>build_face_surface.png</translation>
+        </message>
+        <message>
+            <source>ICON_DLG_BUILD_FACE_CONSTRAINTS</source>
+            <translation>build_face_constraints.png</translation>
+        </message>
        <message>
             <source>ICON_DLG_FACE_HW</source>
             <translation>face_hw.png</translation>
             <source>ICON_DLG_BUILD_SHELL</source>
             <translation>build_shell.png</translation>
         </message>
+        <message>
+            <source>ICON_DLG_SOLID_FROM_FACES</source>
+            <translation>solid_from_faces.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_BUILD_SOLID</source>
             <translation>build_solid.png</translation>
             <source>ICON_DLG_UNION_FACES</source>
             <translation>union_faces.png</translation>
         </message>
+        <message>
+            <source>ICON_DLG_INSPECT_OBJECT</source>
+            <translation>inspect_object.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_CHECKSHAPE</source>
             <translation>check.png</translation>
             <source>ICON_DLG_CHECK_SELF_INTERSECTIONS</source>
             <translation>check_self_intersections.png</translation>
         </message>
+        <message>
+            <source>ICON_DLG_FAST_CHECK_INTERSECTIONS</source>
+            <translation>fast_intersect.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_CIRCLE_PNTS</source>
             <translation>circle3points.png</translation>
             <source>ICON_DLG_DIVIDE_EDGE</source>
             <translation>pointonedge.png</translation>
         </message>
+        <message>
+            <source>ICON_DLG_DIVIDE_EDGE_BY_PNT</source>
+            <translation>pointonedgebypoint.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_ELLIPSE_PV</source>
             <translation>ellipsepointvector.png</translation>
             <translation>offset.png</translation>
         </message>
         <message>
-            <source>ICON_DLG_PROJECTION</source>
+            <source>ICON_DLG_PROJECTION_ON_FACE</source>
             <translation>projection.png</translation>
         </message>
+        <message>
+            <source>ICON_DLG_PROJECTION_ON_WIRE</source>
+            <translation>projection_on_wire.png</translation>
+        </message>
+        <message>
+            <source>ICON_DLG_PROJECTION_ON_EDGE</source>
+            <translation>projection_on_edge.png</translation>
+        </message>
+        <message>
+            <source>ICON_DLG_EXTEND_EDGE</source>
+            <translation>edgeextension.png</translation>
+        </message>
+        <message>
+            <source>ICON_DLG_EXTEND_FACE</source>
+            <translation>faceextension.png</translation>
+        </message>
+        <message>
+            <source>ICO_DLG_PROJ_ON_CYL</source>
+            <translation>proj_on_cyl.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_PARTITION</source>
             <translation>partition.png</translation>
             <source>ICON_DLG_PRISM_DXDYDZ</source>
             <translation>prism3.png</translation>
         </message>
+        <message>
+            <source>ICON_DLG_THICKNESS</source>
+            <translation>thickness.png</translation>
+        </message>
+        <message>
+            <source>ICON_DLG_THICKNESS_HOLLOWED</source>
+            <translation>thickness2.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_PROPAGATE</source>
             <translation>propagate.png</translation>
             <source>ICON_VERTEX_MARKER_13</source>
             <translation>marker_13.png</translation>
         </message>
+        <message>
+            <source>ICON_SURFACE_FROM_FACE</source>
+            <translation>facetosurface.png</translation>
+        </message>
         <message>
             <source>ICO_ARC</source>
             <translation>arc.png</translation>
             <source>ICO_CHECK_SELF_INTERSECTIONS</source>
             <translation>check_self_intersections.png</translation>
         </message>
+        <message>
+            <source>ICO_FAST_CHECK_INTERSECTIONS</source>
+            <translation>fast_intersect.png</translation>
+        </message>
         <message>
             <source>ICO_CHECK_FREE_BNDS</source>
             <translation>free_bound.png</translation>
             <source>ICO_EXTRUSION</source>
             <translation>prism.png</translation>
         </message>
+        <message>
+            <source>ICO_THICKNESS</source>
+            <translation>thickness.png</translation>
+        </message>
         <message>
             <source>ICO_FACE</source>
             <translation>build_face.png</translation>
             <source>ICO_PROJECTION</source>
             <translation>projection.png</translation>
         </message>
+        <message>
+            <source>ICO_EXTENSION</source>
+            <translation>edgeextension.png</translation>
+        </message>
+        <message>
+            <source>ICO_PROJ_ON_CYL</source>
+            <translation>proj_on_cyl.png</translation>
+        </message>
         <message>
             <source>ICO_ORIGIN_AND_VECTORS</source>
             <translation>origin_and_vectors.png</translation>
             <source>ICO_ISOLINE_V</source>
             <translation>isoline_v.png</translation>
         </message>
+        <message>
+            <source>ICO_SURFACE_FROM_FACE</source>
+            <translation>facetosurface.png</translation>
+        </message>
         <message>
             <source>ICO_SOLID</source>
             <translation>build_solid.png</translation>
         </message>
+        <message>
+            <source>ICO_SOLID_FROM_FACES</source>
+            <translation>solid_from_face.png</translation>
+        </message>
         <message>
             <source>ICO_SOLID_SEL_ONLY</source>
             <translation>build_solid.png</translation>
             <source>ICO_GET_SHARED_SHAPES</source>
             <translation>shared_shapes.png</translation>
         </message>
+        <message>
+            <source>ICO_TRANSFER_DATA</source>
+            <translation>transfer_data.png</translation>
+        </message>
+        <message>
+            <source>ICO_IMPORT_SHAPE</source>
+            <translation>import.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_POINT_FACE</source>
             <translation>pointonface.png</translation>
             <source>ICON_DLG_SHARED_SHAPES</source>
             <translation>shared_shapes.png</translation>
         </message>
+        <message>
+            <source>ICON_DLG_TRANSFER_DATA</source>
+            <translation>transfer_data.png</translation>
+        </message>
         <message>
             <source>ICON_DLG_SCALE_ALONG_AXES</source>
             <translation>scale_along_axes.png</translation>
index 06cb15a74c071a260c0e206a28cc4996213dac93..2f225edbdfc22452eeecfecae315cd2c05525567 100644 (file)
@@ -38,6 +38,14 @@ Do you still want to delete these objects?</translation>
         <source>DEVIDE_EDGE_NEW_OBJECT_NAME</source>
         <translation>NewObject</translation>
     </message>
+    <message>
+        <source>DEVIDE_EDGE_BAD_PROJ_MSG</source>
+        <translation>Projection outside the edge</translation>
+    </message>
+    <message>
+        <source>DEVIDE_EDGE_BY_PROJ_POINT</source>
+        <translation>Points to project</translation>
+    </message>
     <message>
         <source>ERROR_SHAPE_TYPE</source>
         <translation>Object of incorrect type selected!
@@ -407,6 +415,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_NONBLOCKS</source>
         <translation>NonBlocksGroup</translation>
     </message>
+    <message>
+        <source>GEOM_USE_C1_CRITERION</source>
+        <translation>Use C1 criterion</translation>
+    </message>
     <message>
         <source>GEOM_CHECK_INFOS</source>
         <translation>Object And Its Topological Information</translation>
@@ -416,20 +428,12 @@ Please, select face, shell or solid and try again</translation>
         <translation>Detect Self-intersections</translation>
     </message>
     <message>
-        <source>GEOM_CHECK_SELF_INTERSECTIONS_FAILED</source>
-        <translation>Detection of self-intersections failed</translation>
-    </message>
-    <message>
-        <source>GEOM_NO_SELF_INTERSECTIONS</source>
-        <translation>There are no self-intersections in the shape</translation>
-    </message>
-    <message>
-        <source>GEOM_SELF_INTERSECTIONS_FOUND</source>
-        <translation>Some self-intersections detected</translation>
+        <source>GEOM_FAST_CHECK_INTERSECTIONS</source>
+        <translation>Fast intersection</translation>
     </message>
     <message>
-        <source>GEOM_CHECK_SELF_INTERSECTIONS_ERRORS</source>
-        <translation>Warning: there were errors during the operation, so the list may be incomplete.</translation>
+        <source>GEOM_SHAPE_STATISTICS</source>
+        <translation>Shape Statistics</translation>
     </message>
     <message>
         <source>GEOM_CIRCLE</source>
@@ -537,7 +541,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>GEOM_CYLINDER_ANGLE_ERR</source>
-        <translation>Angle values 0 and 360 are unsafe to build proper volumes. Please uncheck the "Angle" box to use the regular cylinder constructor.</translation>
+        <translation>Angle values 0 and 360 are unsafe to build proper volumes. Please uncheck the &quot;Angle&quot; box to use the regular cylinder constructor.</translation>
     </message>
     <message>
         <source>GEOM_D1</source>
@@ -577,7 +581,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>GEOM_DIVIDE_EDGE_TITLE</source>
-        <translation>Addition of point</translation>
+        <translation>Addition of points</translation>
     </message>
     <message>
         <source>GEOM_DX</source>
@@ -675,6 +679,18 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_EXTRUSION_TITLE</source>
         <translation>Construction by Extrusion</translation>
     </message>
+    <message>
+        <source>GEOM_THICKNESS_TITLE</source>
+        <translation>Thickness Construction</translation>
+    </message>
+    <message>
+        <source>GEOM_THICKNESS_NAME</source>
+        <translation>Thickness</translation>
+    </message>
+    <message>
+        <source>GEOM_TOWARDS_INSIDE</source>
+        <translation>Thicken towards the inside</translation>
+    </message>
     <message>
         <source>GEOM_SCALE_PRISM</source>
         <translation>Scale the face opposite to the base</translation>
@@ -707,10 +723,30 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_FACE_FFW</source>
         <translation>Face creation from wires and/or edges</translation>
     </message>
+    <message>
+        <source>GEOM_FACE_FROM_SURFACE</source>
+        <translation>Face creation from surface bounded by wire</translation>
+    </message>
     <message>
         <source>GEOM_FACE_OPT</source>
         <translation>Try to create a planar face</translation>
     </message>
+    <message>
+        <source>GEOM_FACE_FFWC</source>
+        <translation>Face creation from wire and constraints</translation>
+    </message>
+    <message>
+        <source>GEOM_CONSTRAINTS</source>
+        <translation>Constraints</translation>
+    </message>
+    <message>
+        <source>GEOM_FACE_CONSTRAINT</source>
+        <translation>Constraint Face</translation>
+    </message>
+    <message>
+        <source>GEOM_SOLID_FROM_FACE_OPT</source>
+        <translation>Intersect/sew shapes</translation>
+    </message>
     <message>
         <source>MAKE_FACE_TOLERANCE_TOO_BIG</source>
         <translation>Cannot build a planar face: required tolerance is
@@ -790,7 +826,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>GEOM_FILLING_COMPOUND</source>
-        <translation>Input compound</translation>
+        <translation>Input contours</translation>
     </message>
     <message>
         <source>GEOM_FILLING_MAX_DEG</source>
@@ -836,6 +872,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_FREE_FACES</source>
         <translation>Free faces</translation>
     </message>
+    <message>
+        <source>GEOM_FREE_FACES_NAME</source>
+        <translation>Free_face</translation>
+    </message>
     <message>
         <source>GEOM_FREE_FACES_TITLE</source>
         <translation>Free faces</translation>
@@ -868,6 +908,14 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_GLUE_EDGES_TITLE</source>
         <translation>Glue edges</translation>
     </message>
+    <message>
+        <source>GEOM_GLUE_EDGES_DETECT_TITLE</source>
+        <translation>Coincident edges detection</translation>
+    </message>
+    <message>
+        <source>GEOM_GLUE_FACES_DETECT_TITLE</source>
+        <translation>Coincident faces detection</translation>
+    </message>
     <message>
         <source>GLUE_ERROR_STICKED_SHAPES</source>
         <translation>The tolerance value is too big. Sticked shapes are detected.</translation>
@@ -1201,17 +1249,49 @@ Please, select face, shell or solid and try again</translation>
         <translation>Division pattern</translation>
     </message>
     <message>
-        <source>GEOM_PROJECTION</source>
-        <translation>Projection</translation>
+        <source>GEOM_PROJECTION_ON_FACE</source>
+        <translation>Projection on Face</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJECTION_ON_WIRE</source>
+        <translation>Projection on Wire</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJECTION_ON_EDGE</source>
+        <translation>Projection on Edge</translation>
     </message>
     <message>
         <source>GEOM_PROJECTION_TITLE</source>
-        <translation>Projection on Face</translation>
+        <translation>Projection</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJECTION_NAME</source>
+        <translation>Projection</translation>
     </message>
     <message>
-        <source>GEOM_SOURCE_OBJECT</source>
+        <source>GEOM_PROJ_ON_FACE_SOURCE</source>
         <translation>Source vertex, edge or wire</translation>
     </message>
+    <message>
+        <source>GEOM_PROJ_ON_FACE_TARGET</source>
+        <translation>Target face</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_WIRE_SOURCE</source>
+        <translation>Source vertex</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_WIRE_TARGET</source>
+        <translation>Target wire</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_EDGE_SOURCE</source>
+        <translation>Source vertex</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_EDGE_TARGET</source>
+        <translation>Target edge</translation>
+    </message>
     <message>
         <source>GEOM_SOLUTION</source>
         <translation>Solution :</translation>
@@ -1220,10 +1300,6 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_SOLUTION_I</source>
         <translation>Solution %1</translation>
     </message>
-    <message>
-        <source>GEOM_TARGET_OBJECT</source>
-        <translation>Target face</translation>
-    </message>
     <message>
         <source>GEOM_WITH_CONTACT</source>
         <translation>With contact</translation>
@@ -1276,6 +1352,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_LENGTH_VALUE</source>
         <translation>By length</translation>
     </message>
+    <message>
+        <source>GEOM_TAKE_ORIENTATION_INTO_ACCOUNT</source>
+        <translation>Take edge orientation into account</translation>
+    </message>
     <message>
         <source>GEOM_PARTITION</source>
         <translation>Partition</translation>
@@ -1340,6 +1420,18 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_SELECT_UNPUBLISHED_EDGES</source>
         <translation>Select unpublished edges</translation>
     </message>
+    <message>
+        <source>GEOM_GENERATE_GROUPS</source>
+        <translation>Generate Groups</translation>
+    </message>
+    <message>
+        <source>GEOM_GROUP_NAME_PREFIX</source>
+        <translation>Group Names Prefix</translation>
+    </message>
+    <message>
+        <source>GEOM_STEP_BY_STEP</source>
+        <translation>Step-by-step generation</translation>
+    </message>
     <message>
         <source>GEOM_PLANE</source>
         <translation>Plane</translation>
@@ -1638,11 +1730,11 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>GEOM_SECTION</source>
-        <translation>Section</translation>
+        <translation>Intersection</translation>
     </message>
     <message>
         <source>GEOM_SECTION_TITLE</source>
-        <translation>Section Of Two Objects</translation>
+        <translation>Intersection Of Two Objects</translation>
     </message>
     <message>
         <source>GEOM_SELECTED_FACE</source>
@@ -1656,6 +1748,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_SELECTED_SHAPE</source>
         <translation>Selected shape</translation>
     </message>
+    <message>
+        <source>GEOM_SELECTED_SHAPES</source>
+        <translation>Selected shapes</translation>
+    </message>
     <message>
         <source>GEOM_SELECTION</source>
         <translation>Selection</translation>
@@ -1932,6 +2028,14 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_SOLID_TITLE</source>
         <translation>Solid Construction</translation>
     </message>
+    <message>
+        <source>GEOM_SOLID_SHELLS</source>
+        <translation>Make Solid From Shells</translation>
+    </message>
+    <message>
+        <source>GEOM_SOLID_FACES</source>
+        <translation>Make Solid From Connected Set Of Faces/Shells</translation>
+    </message>
     <message>
         <source>GEOM_SPHERE</source>
         <translation>Sphere</translation>
@@ -2058,7 +2162,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>GEOM_SUPRESSFACE</source>
-        <translation>Supress Face</translation>
+        <translation>Suppress Face</translation>
     </message>
     <message>
         <source>GEOM_SUPRESSFACE_SELECT</source>
@@ -2322,7 +2426,11 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>GEOM_WRN_FACES_NOT_SHELL</source>
-        <translation>Unable to create a shell. Result is a compound of faces.</translation>
+        <translation>Unable to create single shell. Result is a compound of shells.</translation>
+    </message>
+    <message>
+        <source>GEOM_WRN_FACES_NOT_FACE</source>
+        <translation>Unable to create single face. Result is a compound of faces.</translation>
     </message>
     <message>
         <source>WRN_SHAPE_UNCLOSED</source>
@@ -2336,6 +2444,26 @@ Please, select face, shell or solid and try again</translation>
         <source>WRN_NULL_OBJECT_OR_SHAPE</source>
         <translation>Shape %1 for solid creation is null</translation>
     </message>
+    <message>
+        <source>GROUP_DOWN</source>
+        <translation>Down</translation>
+    </message>
+    <message>
+        <source>GROUP_UP</source>
+        <translation>Up</translation>
+    </message>
+    <message>
+        <source>GROUP_SIDE1</source>
+        <translation>Side1</translation>
+    </message>
+    <message>
+        <source>GROUP_SIDE2</source>
+        <translation>Side2</translation>
+    </message>
+    <message>
+        <source>GROUP_OTHER</source>
+        <translation>Other</translation>
+    </message>
     <message>
         <source>GEOM_X</source>
         <translation>X :</translation>
@@ -2361,12 +2489,12 @@ Please, select face, shell or solid and try again</translation>
         <translation>2D Polyline</translation>
     </message>
     <message>
-      <source>TOP_CURVE_CREATOR</source>
-      <translation>Create 2D polyline</translation>
+        <source>TOP_CURVE_CREATOR</source>
+        <translation>Create 2D polyline</translation>
     </message>
     <message>
-      <source>STB_CURVE_CREATOR</source>
-      <translation>Create 2D polyline</translation>
+        <source>STB_CURVE_CREATOR</source>
+        <translation>Create 2D polyline</translation>
     </message>
     <message>
         <source>MEN_ALL_SEL_ONLY</source>
@@ -2440,6 +2568,14 @@ Please, select face, shell or solid and try again</translation>
         <source>MEN_CHECK_SELF_INTERSECTIONS</source>
         <translation>Detect Self-intersections</translation>
     </message>
+    <message>
+        <source>MEN_FAST_CHECK_INTERSECTIONS</source>
+        <translation>Fast intersection</translation>
+    </message>
+    <message>
+        <source>MEN_SHAPE_STATISTICS</source>
+        <translation>Shape Statistics</translation>
+    </message>
     <message>
         <source>MEN_CHECK_FREE_BNDS</source>
         <translation>Check Free Boundaries</translation>
@@ -2722,7 +2858,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>MEN_MEASURES</source>
-        <translation>Measures</translation>
+        <translation>Inspection</translation>
     </message>
     <message>
         <source>MEN_MIN_DIST</source>
@@ -2760,6 +2896,10 @@ Please, select face, shell or solid and try again</translation>
         <source>MEN_PROJECTION</source>
         <translation>Projection</translation>
     </message>
+    <message>
+        <source>MEN_PROJ_ON_CYL</source>
+        <translation>Projection on Cylinder</translation>
+    </message>
     <message>
         <source>MEN_OPERATIONS</source>
         <translation>Operations</translation>
@@ -2780,6 +2920,10 @@ Please, select face, shell or solid and try again</translation>
         <source>MEN_PIPE_PATH</source>
         <translation>Restore Path</translation>
     </message>
+    <message>
+        <source>MEN_THICKNESS</source>
+        <translation>Thickness</translation>
+    </message>
     <message>
         <source>MEN_PLANE</source>
         <translation>Plane</translation>
@@ -2896,6 +3040,10 @@ Please, select face, shell or solid and try again</translation>
         <source>MEN_POP_VERTICES</source>
         <translation>Show Vertices</translation>
     </message>
+    <message>
+        <source>MEN_POP_SHOW_NAME</source>
+        <translation>Show Name</translation>
+    </message>
     <message>
         <source>MEN_PREFERENCES</source>
         <translation>Preferences</translation>
@@ -2938,7 +3086,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>MEN_SECTION</source>
-        <translation>Section</translation>
+        <translation>Intersection</translation>
     </message>
     <message>
         <source>MEN_SELECT_ONLY</source>
@@ -2984,10 +3132,18 @@ Please, select face, shell or solid and try again</translation>
         <source>MEN_ISOLINE</source>
         <translation>Isoline</translation>
     </message>
+    <message>
+        <source>MEN_SURFACE_FROM_FACE</source>
+        <translation>Surface From Face</translation>
+    </message>
     <message>
         <source>MEN_SOLID</source>
         <translation>Solid</translation>
     </message>
+    <message>
+        <source>MEN_SOLID_FROM_FACES</source>
+        <translation>Solid from connected faces</translation>
+    </message>
     <message>
         <source>MEN_SOLID_SEL_ONLY</source>
         <translation>Solid</translation>
@@ -3076,6 +3232,14 @@ Please, select face, shell or solid and try again</translation>
         <source>MEN_VERTICES_MODE_OFF</source>
         <translation>Hide Vertices</translation>
     </message>
+    <message>
+        <source>MEN_NAME_MODE_ON</source>
+        <translation>Show Name</translation>
+    </message>
+    <message>
+        <source>MEN_NAME_MODE_OFF</source>
+        <translation>Hide Name</translation>
+    </message>
     <message>
         <source>MEN_WIREFRAME</source>
         <translation>Wireframe</translation>
@@ -3100,6 +3264,14 @@ Please, select face, shell or solid and try again</translation>
         <source>MEN_POP_PREDEF_MATER_CUSTOM</source>
         <translation>Custom...</translation>
     </message>
+    <message>
+        <source>MEN_EDGE_EXTEND</source>
+        <translation>Extended Edge</translation>
+    </message>
+    <message>
+        <source>MEN_FACE_EXTEND</source>
+        <translation>Extended Face</translation>
+    </message>
     <message>
         <source>NAME_LBL</source>
         <translation>Name: </translation>
@@ -3110,7 +3282,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>PREF_DEFLECTION</source>
-        <translation>Deflection coefficient</translation>
+        <translation>Default deflection coefficient</translation>
     </message>
     <message>
         <source>GEOM_PREF_def_precision</source>
@@ -3158,7 +3330,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>PREF_TRANSPARENCY</source>
-        <translation>Transparency</translation>
+        <translation>Default transparency</translation>
     </message>
     <message>
         <source>PREF_FREE_BOUND_COLOR</source>
@@ -3182,12 +3354,16 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>PREF_GROUP_VERTEX</source>
-        <translation>Marker of Points</translation>
+        <translation>Default marker of points</translation>
     </message>
     <message>
         <source>PREF_ISOS_COLOR</source>
         <translation>Color of isolines</translation>
     </message>
+    <message>
+        <source>PREF_LABEL_COLOR</source>
+        <translation>Color of labels</translation>
+    </message>
     <message>
         <source>PREF_TOPLEVEL_COLOR</source>
         <translation>Top level color</translation>
@@ -3258,11 +3434,11 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>PREF_EDGE_WIDTH</source>
-        <translation>Edges width</translation>
+        <translation>Default edges width</translation>
     </message>
     <message>
         <source>PREF_ISOLINES_WIDTH</source>
-        <translation>Iso lines width</translation>
+        <translation>Default isolines width</translation>
     </message>
     <message>
         <source>PREF_PREVIEW_EDGE_WIDTH</source>
@@ -3289,8 +3465,8 @@ Please, select face, shell or solid and try again</translation>
         <translation>Line width</translation>
     </message>
     <message>
-        <source>PREF_DIMENSIONS_FONT_HEIGHT</source>
-        <translation>Font height</translation>
+        <source>PREF_DIMENSIONS_FONT</source>
+        <translation>Font</translation>
     </message>
     <message>
         <source>PREF_DIMENSIONS_ARROW_LENGTH</source>
@@ -3312,9 +3488,17 @@ Please, select face, shell or solid and try again</translation>
         <source>PREF_DIMENSIONS_SHOW_UNITS</source>
         <translation>Show units of measurement</translation>
     </message>
+    <message>
+        <source>PREF_DIMENSIONS_USE_TEXT3D</source>
+        <translation>Use 3D text</translation>
+    </message>
+    <message>
+        <source>PREF_HIDE_INPUT_OBJECT</source>
+        <translation>Hide input objects from the viewer</translation>
+    </message>
     <message>
         <source>PREF_ISOS</source>
-        <translation>Number of isolines</translation>
+        <translation>Default number of isolines</translation>
     </message>
     <message>
         <source>PREF_ISOS_U</source>
@@ -3362,7 +3546,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>REMOVE_HOLES_NEW_OBJ_NAME</source>
-        <translation>SupressHoles</translation>
+        <translation>SuppressHoles</translation>
     </message>
     <message>
         <source>REMOVE_INT_WIRES_NEW_OBJ_NAME</source>
@@ -3429,6 +3613,14 @@ Please, select face, shell or solid and try again</translation>
         <translation>Detect Self-intersections</translation>
     </message>
     <message>
+        <source>STB_FAST_CHECK_INTERSECTIONS</source>
+        <translation>Fast intersection</translation>
+   </message>
+    <message>
+        <source>STB_SHAPE_STATISTICS</source>
+        <translation>Shape Statistics</translation>
+   </message>
+   <message>
         <source>STB_CHECK_FREE_BNDS</source>
         <translation>Check free boundaries</translation>
     </message>
@@ -3676,6 +3868,10 @@ Please, select face, shell or solid and try again</translation>
         <source>STB_PROJECTION</source>
         <translation>Project a point, an edge or a wire on a face</translation>
     </message>
+    <message>
+        <source>STB_PROJ_ON_CYL</source>
+        <translation>Project a wire or a face on a cylinder</translation>
+    </message>
     <message>
         <source>STB_ORIGIN_AND_VECTORS</source>
         <translation>Create an origin and base Vectors</translation>
@@ -3692,6 +3888,10 @@ Please, select face, shell or solid and try again</translation>
         <source>STB_PIPE_PATH</source>
         <translation>Restore path from a pipe-like shape</translation>
     </message>
+    <message>
+        <source>STB_THICKNESS</source>
+        <translation>Make a thick solid</translation>
+    </message>
     <message>
         <source>STB_PLANE</source>
         <translation>Create a plane</translation>
@@ -3768,6 +3968,10 @@ Please, select face, shell or solid and try again</translation>
         <source>STB_POP_VERTICES</source>
         <translation>Show Vertices</translation>
     </message>
+    <message>
+        <source>STB_POP_SHOW_NAME</source>
+        <translation>Show Name</translation>
+    </message>
     <message>
         <source>STB_POP_SETTEXTURE</source>
         <translation>Add a texture</translation>
@@ -3810,7 +4014,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>STB_SECTION</source>
-        <translation>Section</translation>
+        <translation>Intersection</translation>
     </message>
     <message>
         <source>STB_SEWING</source>
@@ -3832,6 +4036,10 @@ Please, select face, shell or solid and try again</translation>
         <source>STB_VECTOR_MODE</source>
         <translation>Change Edge Presentation Mode</translation>
     </message>
+    <message>
+        <source>STB_NAME_MODE</source>
+        <translation>Show/Hide names of visible shapes</translation>
+    </message>
     <message>
         <source>STB_SHADING_COLOR</source>
         <translation>Set shading color</translation>
@@ -3860,6 +4068,10 @@ Please, select face, shell or solid and try again</translation>
         <source>STB_ISOLINE</source>
         <translation>Create U- or V-Isoline</translation>
     </message>
+    <message>
+        <source>STB_SURFACE_FROM_FACE</source>
+        <translation>Create a Surface From Face</translation>
+    </message>
     <message>
         <source>STB_SOLID</source>
         <translation>Build a solid</translation>
@@ -3938,7 +4150,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>SUPRESS_FACE_NEW_OBJ_NAME</source>
-        <translation>SupressFaces</translation>
+        <translation>SuppressFaces</translation>
     </message>
     <message>
         <source>ShHealOper_ErrorExecution_msg</source>
@@ -4036,6 +4248,14 @@ Please, select face, shell or solid and try again</translation>
         <source>TOP_CHECK_SELF_INTERSECTIONS</source>
         <translation>Detect Self-intersections</translation>
     </message>
+    <message>
+        <source>TOP_FAST_CHECK_INTERSECTIONS</source>
+        <translation>Fast intersection</translation>
+    </message>
+    <message>
+        <source>TOP_SHAPE_STATISTICS</source>
+        <translation>Shape Statistics</translation>
+    </message>
     <message>
         <source>TOP_CHECK_FREE_BNDS</source>
         <translation>Check free boundaries</translation>
@@ -4276,6 +4496,10 @@ Please, select face, shell or solid and try again</translation>
         <source>TOP_PROJECTION</source>
         <translation>Projection</translation>
     </message>
+    <message>
+        <source>TOP_PROJ_ON_CYL</source>
+        <translation>Projection on Cylinder</translation>
+    </message>
     <message>
         <source>TOP_ORIGIN_AND_VECTORS</source>
         <translation>Create an origin and base Vectors</translation>
@@ -4292,6 +4516,10 @@ Please, select face, shell or solid and try again</translation>
         <source>TOP_PIPE_PATH</source>
         <translation>Restore path</translation>
     </message>
+    <message>
+        <source>TOP_THICKNESS</source>
+        <translation>Thickness</translation>
+    </message>
     <message>
         <source>TOP_PLANE</source>
         <translation>Create a plane</translation>
@@ -4390,7 +4618,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>TOP_SECTION</source>
-        <translation>Section</translation>
+        <translation>Intersection</translation>
     </message>
     <message>
         <source>TOP_SEWING</source>
@@ -4424,6 +4652,10 @@ Please, select face, shell or solid and try again</translation>
         <source>TOP_ISOLINE</source>
         <translation>Isoline</translation>
     </message>
+    <message>
+        <source>TOP_SURFACE_FROM_FACE</source>
+        <translation>Surface From Face</translation>
+    </message>
     <message>
         <source>TOP_SOLID</source>
         <translation>Build solid</translation>
@@ -4590,7 +4822,7 @@ Please, select face, shell or solid and try again</translation>
     </message>
     <message>
         <source>GEOM_REMOVE_WEBS</source>
-        <translation>Compound of solids</translation>
+        <translation>Solids</translation>
     </message>
     <message>
         <source>REMOVE_WEBS_NEW_OBJ_NAME</source>
@@ -4676,6 +4908,18 @@ Please, select face, shell or solid and try again</translation>
         <source>STB_UNION_FACES</source>
         <translation>Union faces</translation>
     </message>
+    <message>
+        <source>TOP_INSPECT_OBJECT</source>
+        <translation>Inspect Object</translation>
+    </message>
+    <message>
+        <source>MEN_INSPECT_OBJECT</source>
+        <translation>Inspect Object</translation>
+    </message>
+    <message>
+        <source>STB_INSPECT_OBJECT</source>
+        <translation>Inspect Object</translation>
+    </message>
     <message>
         <source>TOP_NORMALE</source>
         <translation>Normal to a face</translation>
@@ -4904,6 +5148,10 @@ Please, select face, shell or solid and try again</translation>
         <source>GEOM_Z_I</source>
         <translation>Z%1 :</translation>
     </message>
+    <message>
+        <source>GEOM_A_I</source>
+        <translation>A%1 :</translation>
+    </message>
     <message>
         <source>GEOM_SHAPES_ON_SHAPE_TITLE</source>
         <translation>Get shapes on shape</translation>
@@ -4968,6 +5216,30 @@ Please, select face, shell or solid and try again</translation>
         <source>STB_GET_SHARED_SHAPES</source>
         <translation>Get shared shapes</translation>
     </message>
+    <message>
+        <source>TOP_TRANSFER_DATA</source>
+        <translation>Transfer Data</translation>
+    </message>
+    <message>
+        <source>MEN_TRANSFER_DATA</source>
+        <translation>Transfer Data</translation>
+    </message>
+    <message>
+        <source>STB_TRANSFER_DATA</source>
+        <translation>Transfer Data</translation>
+    </message>
+    <message>
+        <source>TOP_EXTENSION</source>
+        <translation>Extend Edge or Face</translation>
+    </message>
+    <message>
+        <source>MEN_EXTENSION</source>
+        <translation>Extension</translation>
+    </message>
+    <message>
+        <source>STB_EXTENSION</source>
+        <translation>Extend Edge or Face</translation>
+    </message>
     <message>
         <source>GEOM_PUBLISH_RESULT_GRP</source>
         <translation>Advanced options</translation>
@@ -5108,6 +5380,74 @@ shells and solids on the other hand.</translation>
         <source>CC_PNT_ITEM_X_Y_Z</source>
         <translation>X=%1, Y=%2, Z=%3</translation>
     </message>
+    <message>
+        <source>GEOM_FILTER</source>
+        <translation>Filter</translation>
+    </message>
+    <message>
+        <source>GEOM_LESS_THAN</source>
+        <translation>Less Than</translation>
+    </message>
+    <message>
+        <source>GEOM_LESSOREQUAL_THAN</source>
+        <translation>Equal or Less Than</translation>
+    </message>
+    <message>
+        <source>GEOM_GREAT_THAN</source>
+        <translation>Greater Than</translation>
+    </message>
+    <message>
+        <source>GEOM_GREATOREQUAL_THAN</source>
+        <translation>Equal or Greater Than</translation>
+    </message>
+    <message>
+        <source>GEOM_SOME_SHAPES_SELECTED</source>
+        <translation>%1 shape(s) has(have) been selected</translation>
+    </message>
+    <message>
+        <source>GEOM_NO_SHAPES_SELECTED</source>
+        <translation>There are no shapes that meet filtering parameters</translation>
+    </message>
+    <message>
+        <source>GEOM_HEALING_STATS_TITLE</source>
+        <translation>What is done</translation>
+    </message>
+    <message>
+        <source>GEOM_HEALING_STATS_COL_1</source>
+        <translation>Count</translation>
+    </message>
+    <message>
+        <source>GEOM_HEALING_STATS_COL_2</source>
+        <translation>Modification</translation>
+    </message>
+    <message>
+        <source>GEOM_PLOT_DISTRIBUTION</source>
+        <translation>Plot</translation>
+    </message>
+    <message>
+        <source>GEOM_X_AXIS</source>
+        <translation>X Axis</translation>
+    </message>
+    <message>
+        <source>GEOM_Y_AXIS</source>
+        <translation>Y Axis</translation>
+    </message>
+    <message>
+        <source>GEOM_Z_AXIS</source>
+        <translation>Z Axis</translation>
+    </message>
+    <message>
+        <source>GEOM_DIM_AXES</source>
+        <translation>Dimensions along local axes</translation>
+    </message>
+    <message>
+        <source>SHOW_ALL_BTN</source>
+        <translation>Show all</translation>
+    </message>
+    <message>
+        <source>HIDE_ALL_BTN</source>
+        <translation>Hide all</translation>
+    </message>
 </context>
 <context>
     <name>GeometryGUI</name>
@@ -5157,28 +5497,12 @@ shells and solids on the other hand.</translation>
     </message>
     <message>
         <source>TOOL_MEASURES</source>
-        <translation>Measures</translation>
+        <translation>Inspection</translation>
     </message>
     <message>
         <source>TOOL_IMPORTEXPORT</source>
         <translation>Import / Export XAO</translation>
     </message>
-    <message>
-        <source>TABLE_SECTION</source>
-        <translation>Section</translation>
-    </message>
-    <message>
-        <source>TABLE_INDEX</source>
-        <translation>Index</translation>
-    </message>
-    <message>
-        <source>TABLE_X</source>
-        <translation>X</translation>
-    </message>
-    <message>
-        <source>TABLE_Y</source>
-        <translation>Y</translation>
-    </message>
 </context>
 <context>
     <name>BasicGUI_CurveDlg</name>
@@ -5474,6 +5798,25 @@ shells and solids on the other hand.</translation>
         <translation>X=%1, Y=%2, Z=%3</translation>
     </message>
 </context>
+<context>
+    <name>CurveCreator_TableView</name>
+    <message>
+        <source>TABLE_SECTION</source>
+        <translation>Section</translation>
+    </message>
+    <message>
+        <source>TABLE_INDEX</source>
+        <translation>Index</translation>
+    </message>
+    <message>
+        <source>TABLE_X</source>
+        <translation>X</translation>
+    </message>
+    <message>
+        <source>TABLE_Y</source>
+        <translation>Y</translation>
+    </message>
+</context>
 <context>
     <name>CurveCreator_Widget</name>
     <message>
@@ -5832,10 +6175,6 @@ Number of sketch points too small</translation>
         <source>GEOM_ADD_THICKNESS</source>
         <translation>Add thickness (edges or wires only)</translation>
     </message>
-    <message>
-        <source>GEOM_TOWARDS_INSIDE</source>
-        <translation>Thicken towards the inside</translation>
-    </message>
 </context>
 <context>
     <name>GroupGUI</name>
@@ -6176,14 +6515,6 @@ Number of sketch points too small</translation>
         <source>REMOVE_BTN</source>
         <translation>Remove</translation>
     </message>
-    <message>
-        <source>SHOW_ALL_BTN</source>
-        <translation>Show all</translation>
-    </message>
-    <message>
-        <source>HIDE_ALL_BTN</source>
-        <translation>Hide all</translation>
-    </message>
     <message>
         <source>DISTANCE_ITEM</source>
         <translation>Distance</translation>
@@ -6580,6 +6911,22 @@ Please close this message box and select edges for gluing</translation>
         <translation>Enabling this option may result in a very time-consuming operation for some input shapes.
 Would you like to continue?</translation>
     </message>
+    <message>
+        <source>WIDTH_FACTOR_TOL</source>
+        <translation>Width factor tol.</translation>
+    </message>
+    <message>
+        <source>VOLUME_TOL</source>
+        <translation>Volume tol.</translation>
+    </message>
+    <message>
+        <source>TO_MERGE_SOLIDS</source>
+        <translation>To merge solids</translation>
+    </message>
+    <message>
+        <source>SELECT_ALL</source>
+        <translation>Select All</translation>
+    </message>
 </context>
 <context>
     <name>GEOMToolsGUI_DeleteDlg</name>
@@ -6767,6 +7114,10 @@ Do you want to create new material?</translation>
         <source>GEOM_SHARED_SHAPE</source>
         <translation>Shared_%1</translation>
     </message>
+    <message>
+        <source>GEOM_SHARED_SHAPES_MULTISHARE</source>
+        <translation>Shared by all</translation>
+    </message>
 </context>
 <context>
     <name>GEOMToolsGUI_PublishDlg</name>
@@ -6869,6 +7220,49 @@ Do you want to create new material?</translation>
         <translation>UnionFaces</translation>
     </message>
 </context>
+<context>
+    <name>RepairGUI_InspectObjectDlg</name>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_TITLE</source>
+        <translation>Inspect object</translation>
+    </message>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_MAIN_SHAPE</source>
+        <translation>Main shape</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_TOLERANCE_FILTER</source>
+      <translation>Tolerance filter</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_RESET_MIN</source>
+      <translation>Min value</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_RESET_MAX</source>
+      <translation>Max value</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_OBJECT_SHOW</source>
+        <translation>Show Selected</translation>
+    </message>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_SHOW_ONLY</source>
+        <translation>Show Only Selected</translation>
+    </message>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_HIDE</source>
+        <translation>Hide Selected</translation>
+    </message>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_PUBLISH</source>
+        <translation>Publish Selected</translation>
+    </message>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_NAME</source>
+        <translation>Name</translation>
+    </message>
+</context>
 <context>
     <name>GEOMGUI_CreationInfoWdg</name>
     <message>
@@ -6892,6 +7286,17 @@ Do you want to create new material?</translation>
         <translation>(No info available)</translation>
     </message>
 </context>
+<context>
+    <name>GEOMGUI_TextTreeWdg</name>
+    <message>
+        <source>TEXT_TREE_VIEW_TITLE</source>
+        <translation>Text</translation>
+    </message>
+    <message>
+        <source>TEXT_TREE_VIEW_NAME</source>
+        <translation>Name</translation>
+    </message>
+</context>
 <context>
     <name>EntityGUI_IsolineDlg</name>
     <message>
@@ -6911,4 +7316,309 @@ Do you want to create new material?</translation>
         <translation>V-Isoline</translation>
     </message>
 </context>
+<context>
+    <name>MeasureGUI_CheckSelfIntersectionsDlg</name>
+    <message>
+        <source>GEOM_CHECK_INTERSECT_TYPE</source>
+        <translation>Self-intersection Detection Type</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_INTERSECTIONS</source>
+        <translation>Self-intersections</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_SUBSHAPES</source>
+        <translation>Sub-shapes</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_CHECK_LEVEL</source>
+        <translation>Level of check</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_SUMMARY</source>
+        <translation>Summary</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_COMPUTE</source>
+        <translation>Compute self-intersections</translation>
+    </message>
+    <message>
+        <source>GEOM_SELF_INTERSECTION_NAME</source>
+        <translation>Self_intersection</translation>
+    </message>
+    <message>
+        <source>GEOM_NO_SELF_INTERSECTIONS</source>
+        <translation>There are no self-intersections in the shape</translation>
+    </message>
+    <message>
+        <source>GEOM_SELF_INTERSECTIONS_FOUND</source>
+        <translation>Some self-intersections detected</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_SELF_INTERSECTIONS_FAILED</source>
+        <translation>Detection of self-intersections failed</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_SELF_INTERSECTIONS_ERRORS</source>
+        <translation>Warning: there were errors during the operation, so the list may be incomplete.</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_V_V</source>
+        <translation>Vertex to Vertex</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_V_E</source>
+        <translation>Vertex to Edge + all above</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_E_E</source>
+        <translation>Edge to Edge + all above</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_V_F</source>
+        <translation>Vertex to Face + all above</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_E_F</source>
+        <translation>Edge to Face + all above</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_ALL</source>
+        <translation>Face to Face + all above</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INT_DEFLECT</source>
+        <translation>Deflection coefficient</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INT_DETECT_GAPS</source>
+        <translation>Detect gaps with tolerance</translation>
+    </message>
+</context>
+<context>
+    <name>MeasureGUI_FastCheckIntersectionsDlg</name>
+    <message>
+        <source>GEOM_FAST_CHECK_INT_DEFLECT</source>
+        <translation>Deflection coefficient</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_CHECK_INT_DETECT_GAPS</source>
+        <translation>Detect gaps with tolerance</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_CHECK_INT_SUBSHAPES</source>
+        <translation>Sub-shapes of Object %1:</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_CHECK_INT_COMPUTE</source>
+        <translation>Compute intersections</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_INTERSECTION_NAME</source>
+        <translation>Fast_intersection</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_INTERSECTION_FAILS</source>
+        <translation>No intersections</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_CHECK_OBJ</source>
+        <translation>Objects And Results</translation>
+    </message>
+</context>
+<context>
+    <name>MeasureGUI_ShapeStatisticsDlg</name>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_TYPE</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_LENGTH</source>
+        <translation>Edges length</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_AREA</source>
+        <translation>Faces area</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_VOLUME</source>
+        <translation>Solids volume</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_NB_INTERVALS</source>
+        <translation>Number of intervals</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_SCALAR_RANGE</source>
+        <translation>Scalar range</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_COMPUTE</source>
+        <translation>Compute</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN</source>
+        <translation>Min</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MAX</source>
+        <translation>Max</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_CREATE_GROUPS</source>
+        <translation>Create Groups</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_DISTRIBUTION_NB_ENT</source>
+        <translation>Number of entities</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN_ERROR</source>
+        <translation>Set minimal range value or switch-off Scalar range</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MAX_ERROR</source>
+        <translation>Set maximal range value or switch-off Scalar range</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN_MAX_ERROR</source>
+        <translation>Minimal range value can not be more than maximal</translation>
+    </message>
+    <message>
+        <source>GEOM_MSG_GROUPS_CREATED</source>
+        <translation>%1 groups created</translation>
+    </message>
+</context>
+<context>
+    <name>TransformationGUI_ExtensionDlg</name>
+    <message>
+        <source>GEOM_EXTENSION_TITLE</source>
+        <translation>Extension of Edge or Face</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION</source>
+        <translation>Extension</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MIN</source>
+        <translation>First Parameter</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MAX</source>
+        <translation>Last Parameter</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MIN_U</source>
+        <translation>First U-Parameter</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MAX_U</source>
+        <translation>Last U-Parameter</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MIN_V</source>
+        <translation>First V-Parameter</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MAX_V</source>
+        <translation>Last V-Parameter</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_EDGE_NAME</source>
+        <translation>ExtendedEdge</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_FACE_NAME</source>
+        <translation>ExtendedFace</translation>
+    </message>
+</context>
+<context>
+    <name>EntityGUI_SurfFromFaceDlg</name>
+    <message>
+        <source>GEOM_SURF_FROM_FACE_TITLE</source>
+        <translation>Surface From Face Construction</translation>
+    </message>
+    <message>
+        <source>GEOM_SURF_FROM_FACE</source>
+        <translation>Surface From Face</translation>
+    </message>
+    <message>
+        <source>GEOM_SURF_FROM_FACE_NAME</source>
+        <translation>SurfaceFromFace</translation>
+    </message>
+</context>
+<context>
+    <name>OperationGUI_TransferDataDlg</name>
+    <message>
+        <source>GEOM_TRANSFER_DATA_TITLE</source>
+        <translation>Transfer Data</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA</source>
+        <translation>Transfer Data</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_FROM</source>
+        <translation>Source Shape</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_TO</source>
+        <translation>Destination Shape</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_METHOD</source>
+        <translation>Type of Detection Operation</translation>
+    </message>
+    <message>
+        <source>GEOM_TD_METHOD_GETINPLACE</source>
+        <translation>Get In Place</translation>
+    </message>
+    <message>
+        <source>GEOM_TD_METHOD_GETINPLACE_OLD</source>
+        <translation>Get In Place (old)</translation>
+    </message>
+    <message>
+        <source>GEOM_TD_METHOD_GETINPLACE_HISTORY</source>
+        <translation>Get In Place By History</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_INFO</source>
+        <translation>Transfer Data: Information</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_NOT_COPIED</source>
+        <translation>There is nothing to be copied.</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_COPIED</source>
+        <translation>The following data are copied:</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_NAMES</source>
+        <translation>Names: %1 of %2</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_MATERIALS</source>
+        <translation>Materials: %1 of %2</translation>
+    </message>
+</context>
+<context>
+    <name>TransformationGUI_ProjectionOnCylDlg</name>
+    <message>
+        <source>GEOM_PROJ_ON_CYL_TITLE</source>
+        <translation>Projection On A Cylinder</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_CYL_START_ANGLE</source>
+        <translation>Starting angle</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_CYL_LENGTH_ANGLE</source>
+        <translation>Length angle</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_CYL_ROTATION_ANGLE</source>
+        <translation>Rotation angle</translation>
+    </message>
+</context>
 </TS>
index 7bb28365f6bc1f7b20c3b4416fdfbe8024f40e4b..1a1231364e262448b3064b9240238cbe36347ea7 100644 (file)
@@ -3,14 +3,6 @@
 <TS version="2.0" language="fr_FR">
 <context>
     <name>@default</name>
-    <message>
-        <source>MEN_TEXTURE</source>
-        <translation>Texture</translation>
-    </message>
-    <message>
-        <source>GEOM_WRN_FACES_NOT_SHELL</source>
-        <translation>Impossible de créer une coque. Le résultat est un assemblage de faces.</translation>
-    </message>
     <message>
         <source>BRep_API: command not done</source>
         <translation>Erreur: impossible de construire l&apos;objet</translation>
@@ -38,7 +30,7 @@
     <message>
         <source>DEP_OBJECT</source>
         <translation>L&apos;objet choisi a été utilisé pour créer un autre objet ou est référencé par un autre module.
-La suppression de cet objet peut entrainer un export python invalide. 
+La suppression de cet objet peut entrainer un export python invalide.
 
 Voulez-vous tout de même supprimer ces objets ?</translation>
     </message>
@@ -46,6 +38,14 @@ Voulez-vous tout de même supprimer ces objets ?</translation>
         <source>DEVIDE_EDGE_NEW_OBJECT_NAME</source>
         <translation>Nouvel objet</translation>
     </message>
+    <message>
+        <source>DEVIDE_EDGE_BAD_PROJ_MSG</source>
+        <translation>Projection en dehors de l&apos;arête</translation>
+    </message>
+    <message>
+        <source>DEVIDE_EDGE_BY_PROJ_POINT</source>
+        <translation>Points à projeter</translation>
+    </message>
     <message>
         <source>ERROR_SHAPE_TYPE</source>
         <translation>Le type de l&apos;objet choisi n&apos;est pas correct!
@@ -185,7 +185,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_BEZIER</source>
-        <translation>Bezier</translation>
+        <translation>Bézier</translation>
     </message>
     <message>
         <source>GEOM_BINORMAL</source>
@@ -237,11 +237,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_BNDBOX_TITLE</source>
-        <translation>Boîte englobante</translation>
+        <translation>Informations sur la Boîte englobante</translation>
     </message>
     <message>
         <source>GEOM_BOX</source>
-        <translation>Boite</translation>
+        <translation>Boîte</translation>
     </message>
     <message>
         <source>GEOM_BOX_OBJ</source>
@@ -253,7 +253,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_BSplineRestriction</source>
-        <translation>Limitation BSpline</translation>
+        <translation>LimitationB-Spline</translation>
     </message>
     <message>
         <source>GEOM_BUT_APPLY</source>
@@ -341,7 +341,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_CHAMFER_FACES</source>
-        <translation>Chanfrein sur des faces</translation>
+        <translation>Chanfrein sur les faces sélectionnées</translation>
     </message>
     <message>
         <source>GEOM_CHAMFER_TITLE</source>
@@ -405,43 +405,35 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_GETNONBLOCKS_TITLE</source>
-        <translation>Récupérer les solides non-hexahédres et les faces non-quadrangles</translation>
+        <translation>Récupérer les solides qui ne sontpas des hexahédres et les faces qui ne sont pas des quadrangles</translation>
     </message>
     <message>
         <source>GEOM_GETNONBLOCKS</source>
-        <translation>Récupérer les solides non blocs</translation>
+        <translation>Récupérer les solides qui ne sont pas des blocs</translation>
     </message>
     <message>
         <source>GEOM_NONBLOCKS</source>
         <translation>GroupeSolidesNonBlocs</translation>
     </message>
     <message>
-        <source>GEOM_CHECK_INFOS</source>
-        <translation>Objet et son information topologique</translation>
-    </message>
-    <message>
-        <source>GEOM_CHECK_SHAPE</source>
-        <translation>Contrôler un objet</translation>
+        <source>GEOM_USE_C1_CRITERION</source>
+        <translation>Utiliser un critère C1</translation>
     </message>
     <message>
-        <source>GEOM_CHECK_TITLE</source>
-        <translation>Contrôler la validité de l&apos;objet</translation>
+        <source>GEOM_CHECK_INFOS</source>
+        <translation>Objet et ses informations topologiques</translation>
     </message>
     <message>
         <source>GEOM_CHECK_SELF_INTERSECTIONS</source>
         <translation>Détecter les auto-intersections</translation>
     </message>
     <message>
-        <source>GEOM_CHECK_SELF_INTERSECTIONS_FAILED</source>
-        <translation>La détection d&apos;auto-intersections a échoué</translation>
-    </message>
-    <message>
-        <source>GEOM_NO_SELF_INTERSECTIONS</source>
-        <translation>Il n&apos;y a pas d&apos;auto-intersection dans la géométrie</translation>
+        <source>GEOM_FAST_CHECK_INTERSECTIONS</source>
+        <translation>Intersection rapide</translation>
     </message>
     <message>
-        <source>GEOM_SELF_INTERSECTIONS_FOUND</source>
-        <translation>Des auto-intersections ont été détectées</translation>
+        <source>GEOM_SHAPE_STATISTICS</source>
+        <translation>Statistiques sur l&apos;objet</translation>
     </message>
     <message>
         <source>GEOM_CIRCLE</source>
@@ -549,7 +541,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_CYLINDER_ANGLE_ERR</source>
-        <translation>Les valeurs de l'angle 0 et 360 sont à éviter pour construire des volumes sains. Veuillez décocher la case "Angle" pour utiliser le constructeur de cylindre complet.</translation>
+        <translation>Les valeurs de l&apos;angle 0 et 360 sont à éviter pour construire des volumes sains. Veuillez décocher la case &quot;Angle&quot; pour utiliser le constructeur de cylindre complet.</translation>
     </message>
     <message>
         <source>GEOM_D1</source>
@@ -687,6 +679,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_EXTRUSION_TITLE</source>
         <translation>Construction par extrusion</translation>
     </message>
+    <message>
+        <source>GEOM_THICKNESS_TITLE</source>
+        <translation>Epaississement</translation>
+    </message>
+    <message>
+        <source>GEOM_THICKNESS_NAME</source>
+        <translation>Epaississement</translation>
+    </message>
+    <message>
+        <source>GEOM_TOWARDS_INSIDE</source>
+        <translation>Epaissit vers l&apos;intérieur</translation>
+    </message>
     <message>
         <source>GEOM_SCALE_PRISM</source>
         <translation>Appliquer le facteur d&apos;échelle</translation>
@@ -719,10 +723,30 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_FACE_FFW</source>
         <translation>Création d&apos;une face à partir des contours et/ou arêtes</translation>
     </message>
+    <message>
+        <source>GEOM_FACE_FROM_SURFACE</source>
+        <translation>Création de face depuis une surface bornée par un contour</translation>
+    </message>
     <message>
         <source>GEOM_FACE_OPT</source>
         <translation>Privilégier la création d&apos;une face plane</translation>
     </message>
+    <message>
+        <source>GEOM_FACE_FFWC</source>
+        <translation>Création d&apos;une face depuis un contour et des contraintes</translation>
+    </message>
+    <message>
+        <source>GEOM_CONSTRAINTS</source>
+        <translation>Contraintes</translation>
+    </message>
+    <message>
+        <source>GEOM_FACE_CONSTRAINT</source>
+        <translation>Face de contrainte</translation>
+    </message>
+    <message>
+        <source>GEOM_SOLID_FROM_FACE_OPT</source>
+        <translation>Intersecter/coller les formes</translation>
+    </message>
     <message>
         <source>MAKE_FACE_TOLERANCE_TOO_BIG</source>
         <translation>Impossible de construire une face plane: 
@@ -848,6 +872,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_FREE_FACES</source>
         <translation>Faces libres</translation>
     </message>
+    <message>
+        <source>GEOM_FREE_FACES_NAME</source>
+        <translation>Face_libre</translation>
+    </message>
     <message>
         <source>GEOM_FREE_FACES_TITLE</source>
         <translation>Faces libres</translation>
@@ -880,6 +908,14 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_GLUE_EDGES_TITLE</source>
         <translation>Recoller les arêtes</translation>
     </message>
+    <message>
+        <source>GEOM_GLUE_EDGES_DETECT_TITLE</source>
+        <translation>Détection des arêtes coïncidentes</translation>
+    </message>
+    <message>
+        <source>GEOM_GLUE_FACES_DETECT_TITLE</source>
+        <translation>Détection des faces coïncidentes</translation>
+    </message>
     <message>
         <source>GLUE_ERROR_STICKED_SHAPES</source>
         <translation>La valeur de la tolérance est trop importante. Détection de shapes &quot;sticked&quot;.</translation>
@@ -1213,16 +1249,48 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <translation>Schema de découpe</translation>
     </message>
     <message>
-        <source>GEOM_PROJECTION</source>
-        <translation>Projection</translation>
+        <source>GEOM_PROJECTION_ON_FACE</source>
+        <translation>Projection sur une face</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJECTION_ON_WIRE</source>
+        <translation>Projection sur un contour</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJECTION_ON_EDGE</source>
+        <translation>Projection sur une arête</translation>
     </message>
     <message>
         <source>GEOM_PROJECTION_TITLE</source>
         <translation>Projection sur une face</translation>
     </message>
     <message>
-        <source>GEOM_SOURCE_OBJECT</source>
-        <translation>Point, arête ou contour de source</translation>
+        <source>GEOM_PROJECTION_NAME</source>
+        <translation>Projection</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_FACE_SOURCE</source>
+        <translation>Point, arête ou contour source</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_FACE_TARGET</source>
+        <translation>Face cible</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_WIRE_SOURCE</source>
+        <translation>Point source</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_WIRE_TARGET</source>
+        <translation>Contour cible</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_EDGE_SOURCE</source>
+        <translation>Point source</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_EDGE_TARGET</source>
+        <translation>Arête cible</translation>
     </message>
     <message>
         <source>GEOM_SOLUTION</source>
@@ -1232,10 +1300,6 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_SOLUTION_I</source>
         <translation>Solution %1</translation>
     </message>
-    <message>
-        <source>GEOM_TARGET_OBJECT</source>
-        <translation>Face d&apos;objectif</translation>
-    </message>
     <message>
         <source>GEOM_WITH_CONTACT</source>
         <translation>Avec contact</translation>
@@ -1352,6 +1416,14 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_SELECT_UNPUBLISHED_EDGES</source>
         <translation>Choisir les arêtes non-publiées</translation>
     </message>
+    <message>
+        <source>GEOM_GENERATE_GROUPS</source>
+        <translation>Générer les groupes</translation>
+    </message>
+    <message>
+        <source>GEOM_GROUP_NAME_PREFIX</source>
+        <translation>Préfixe des groupes</translation>
+    </message>
     <message>
         <source>GEOM_PLANE</source>
         <translation>Plan</translation>
@@ -1666,7 +1738,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>GEOM_SELECTED_SHAPE</source>
-        <translation>Forme sélectionnée </translation>
+        <translation>Forme sélectionnée</translation>
+    </message>
+    <message>
+        <source>GEOM_SELECTED_SHAPES</source>
+        <translation>Formes sélectionnées</translation>
     </message>
     <message>
         <source>GEOM_SELECTION</source>
@@ -1944,6 +2020,14 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_SOLID_TITLE</source>
         <translation>Construction d&apos;un solide</translation>
     </message>
+    <message>
+        <source>GEOM_SOLID_SHELLS</source>
+        <translation>Construire un solide depuis des coques</translation>
+    </message>
+    <message>
+        <source>GEOM_SOLID_FACES</source>
+        <translation>Construire un solide depuis des coques/faces connectées</translation>
+    </message>
     <message>
         <source>GEOM_SPHERE</source>
         <translation>Sphère</translation>
@@ -2332,6 +2416,14 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_WRN_WARNING</source>
         <translation>Attention</translation>
     </message>
+    <message>
+        <source>GEOM_WRN_FACES_NOT_SHELL</source>
+        <translation>Impossible de créer une coque. Le résultat est un assemblage de coques.</translation>
+    </message>
+    <message>
+        <source>GEOM_WRN_FACES_NOT_FACE</source>
+        <translation>Impossible de créer une face. Le résultat est un assemblage de faces.</translation>
+    </message>
     <message>
         <source>WRN_SHAPE_UNCLOSED</source>
         <translation>Impossible de créer un solide à partir d&apos;une forme non-fermée %1</translation>
@@ -2344,6 +2436,26 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>WRN_NULL_OBJECT_OR_SHAPE</source>
         <translation>La forme %1 pour la création d&apos;un solide est invalide</translation>
     </message>
+    <message>
+        <source>GROUP_DOWN</source>
+        <translation>Bas</translation>
+    </message>
+    <message>
+        <source>GROUP_UP</source>
+        <translation>Haut</translation>
+    </message>
+    <message>
+        <source>GROUP_SIDE1</source>
+        <translation>Gauche</translation>
+    </message>
+    <message>
+        <source>GROUP_SIDE2</source>
+        <translation>Droite</translation>
+    </message>
+    <message>
+        <source>GROUP_OTHER</source>
+        <translation>Autre</translation>
+    </message>
     <message>
         <source>GEOM_X</source>
         <translation>X :</translation>
@@ -2368,6 +2480,14 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>MEN_CURVE_CREATOR</source>
         <translation>Créateur de courbe</translation>
     </message>
+    <message>
+        <source>TOP_CURVE_CREATOR</source>
+        <translation>Créer une courbe</translation>
+    </message>
+    <message>
+        <source>STB_CURVE_CREATOR</source>
+        <translation>Créer une courbe</translation>
+    </message>
     <message>
         <source>MEN_ALL_SEL_ONLY</source>
         <translation>Sélectionner tout</translation>
@@ -2440,6 +2560,14 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>MEN_CHECK_SELF_INTERSECTIONS</source>
         <translation>Détections des auto-intersections</translation>
     </message>
+    <message>
+        <source>MEN_FAST_CHECK_INTERSECTIONS</source>
+        <translation>Intersection rapide</translation>
+    </message>
+    <message>
+        <source>MEN_SHAPE_STATISTICS</source>
+        <translation>Statistiques sur l&apos;objet</translation>
+    </message>
     <message>
         <source>MEN_CHECK_FREE_BNDS</source>
         <translation>Contrôler les contours libres</translation>
@@ -2722,7 +2850,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>MEN_MEASURES</source>
-        <translation>Mesures</translation>
+        <translation>Inspection</translation>
     </message>
     <message>
         <source>MEN_MIN_DIST</source>
@@ -2760,6 +2888,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>MEN_PROJECTION</source>
         <translation>Projection</translation>
     </message>
+    <message>
+        <source>MEN_PROJ_ON_CYL</source>
+        <translation>Projection sur un cylindre</translation>
+    </message>
     <message>
         <source>MEN_OPERATIONS</source>
         <translation>Opérations</translation>
@@ -2780,6 +2912,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>MEN_PIPE_PATH</source>
         <translation>Retrouver le chemin</translation>
     </message>
+    <message>
+        <source>MEN_THICKNESS</source>
+        <translation>Epaisseur</translation>
+    </message>
     <message>
         <source>MEN_PLANE</source>
         <translation>Plan</translation>
@@ -2894,7 +3030,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>MEN_POP_VERTICES</source>
-        <translation type="unfinished">Show Vertices</translation>
+        <translation>Montrer les sommets</translation>
+    </message>
+    <message>
+        <source>MEN_POP_SHOW_NAME</source>
+        <translation>Montrer le nom</translation>
     </message>
     <message>
         <source>MEN_PREFERENCES</source>
@@ -2984,10 +3124,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>MEN_ISOLINE</source>
         <translation>Isoligne</translation>
     </message>
+    <message>
+        <source>MEN_SURFACE_FROM_FACE</source>
+        <translation>Surface depuis une face</translation>
+    </message>
     <message>
         <source>MEN_SOLID</source>
         <translation>Solide</translation>
     </message>
+    <message>
+        <source>MEN_SOLID_FROM_FACES</source>
+        <translation>Solide depuis des faces connectées</translation>
+    </message>
     <message>
         <source>MEN_SOLID_SEL_ONLY</source>
         <translation>Solide</translation>
@@ -3024,6 +3172,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>MEN_MATERIALS_LIBRARY</source>
         <translation>Librairie de materiaux</translation>
     </message>
+    <message>
+        <source>MEN_TEXTURE</source>
+        <translation>Texture</translation>
+    </message>
     <message>
         <source>MEN_TORUS</source>
         <translation>Tore</translation>
@@ -3066,11 +3218,19 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>MEN_VERTICES_MODE_ON</source>
-        <translation type="unfinished">Show Vertices</translation>
+        <translation>Montrer les sommets</translation>
     </message>
     <message>
         <source>MEN_VERTICES_MODE_OFF</source>
-        <translation type="unfinished">Hide Vertices</translation>
+        <translation>Cacher les sommets</translation>
+    </message>
+    <message>
+        <source>MEN_NAME_MODE_ON</source>
+        <translation>Montrer le nom</translation>
+    </message>
+    <message>
+        <source>MEN_NAME_MODE_OFF</source>
+        <translation>Cacher le nom</translation>
     </message>
     <message>
         <source>MEN_WIREFRAME</source>
@@ -3096,6 +3256,14 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>MEN_POP_PREDEF_MATER_CUSTOM</source>
         <translation>Personnalisé...</translation>
     </message>
+    <message>
+        <source>MEN_EDGE_EXTEND</source>
+        <translation>Arête étendue</translation>
+    </message>
+    <message>
+        <source>MEN_FACE_EXTEND</source>
+        <translation>Face étendue</translation>
+    </message>
     <message>
         <source>NAME_LBL</source>
         <translation>Nom : </translation>
@@ -3106,7 +3274,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>PREF_DEFLECTION</source>
-        <translation>Coefficient de déformation</translation>
+        <translation>Coefficient de déformation par défaut</translation>
     </message>
     <message>
         <source>GEOM_PREF_def_precision</source>
@@ -3154,7 +3322,7 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>PREF_TRANSPARENCY</source>
-        <translation>Transparence</translation>
+        <translation>Transparence par défaut</translation>
     </message>
     <message>
         <source>PREF_FREE_BOUND_COLOR</source>
@@ -3178,12 +3346,16 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>PREF_GROUP_VERTEX</source>
-        <translation>Marqueurs de points</translation>
+        <translation>Marqueurs de points par défaut</translation>
     </message>
     <message>
         <source>PREF_ISOS_COLOR</source>
         <translation>Couleur des isolignes</translation>
     </message>
+    <message>
+        <source>PREF_LABEL_COLOR</source>
+        <translation>Couleur des étiquettes</translation>
+    </message>
     <message>
         <source>PREF_TOPLEVEL_COLOR</source>
         <translation>Couleur des objets mis au premier plan</translation>
@@ -3254,11 +3426,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>PREF_EDGE_WIDTH</source>
-        <translation>Epaisseur des arêtes</translation>
+        <translation>Epaisseur des arêtes par défaut</translation>
     </message>
     <message>
         <source>PREF_ISOLINES_WIDTH</source>
-        <translation>Epaisseur des isolignes</translation>
+        <translation>Epaisseur des isolignes par défaut</translation>
     </message>
     <message>
         <source>PREF_PREVIEW_EDGE_WIDTH</source>
@@ -3285,8 +3457,8 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <translation>Epaisseur de la ligne</translation>
     </message>
     <message>
-        <source>PREF_DIMENSIONS_FONT_HEIGHT</source>
-        <translation>Taille de police</translation>
+        <source>PREF_DIMENSIONS_FONT</source>
+        <translation>Police</translation>
     </message>
     <message>
         <source>PREF_DIMENSIONS_ARROW_LENGTH</source>
@@ -3308,9 +3480,17 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>PREF_DIMENSIONS_SHOW_UNITS</source>
         <translation>Afficher les unités</translation>
     </message>
+    <message>
+        <source>PREF_DIMENSIONS_USE_TEXT3D</source>
+        <translation>Utiliser du texte 3D</translation>
+    </message>
+    <message>
+        <source>PREF_HIDE_INPUT_OBJECT</source>
+        <translation>Cacher dans la vue les objets en entrée</translation>
+    </message>
     <message>
         <source>PREF_ISOS</source>
-        <translation>Nombre d&apos;isolignes</translation>
+        <translation>Nombre d&apos;isolignes par défaut</translation>
     </message>
     <message>
         <source>PREF_ISOS_U</source>
@@ -3424,6 +3604,14 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>STB_CHECK_SELF_INTERSECTIONS</source>
         <translation>Détecte les auto-intersections</translation>
     </message>
+    <message>
+        <source>STB_FAST_CHECK_INTERSECTIONS</source>
+        <translation>Intersection rapide</translation>
+    </message>
+    <message>
+        <source>STB_SHAPE_STATISTICS</source>
+        <translation>Statistique de l&apos;objet</translation>
+    </message>
     <message>
         <source>STB_CHECK_FREE_BNDS</source>
         <translation>Vérifier les contours libres</translation>
@@ -3672,6 +3860,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>STB_PROJECTION</source>
         <translation>Projeter un point, une arête ou un contour sur une face</translation>
     </message>
+    <message>
+        <source>STB_PROJ_ON_CYL</source>
+        <translation>Projète un contour ou une face sur un cylindre</translation>
+    </message>
     <message>
         <source>STB_ORIGIN_AND_VECTORS</source>
         <translation>Créer les vecteurs de base et l&apos;origine</translation>
@@ -3688,6 +3880,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>STB_PIPE_PATH</source>
         <translation>Retrouver le chemin à partir d&apos;un objet de type tuyau</translation>
     </message>
+    <message>
+        <source>STB_THICKNESS</source>
+        <translation>Crée un solide par ajout d&apos;épaisseur</translation>
+    </message>
     <message>
         <source>STB_PLANE</source>
         <translation>Créer un plan</translation>
@@ -3762,7 +3958,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>STB_POP_VERTICES</source>
-        <translation type="unfinished">Show Vertices</translation>
+        <translation>Montrer les sommets</translation>
+    </message>
+    <message>
+        <source>STB_POP_SHOW_NAME</source>
+        <translation>Montrer le nom</translation>
     </message>
     <message>
         <source>STB_POP_SETTEXTURE</source>
@@ -3828,6 +4028,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>STB_VECTOR_MODE</source>
         <translation>Changer le mode de représentation des arêtes</translation>
     </message>
+    <message>
+        <source>STB_NAME_MODE</source>
+        <translation>Montrer/cacher le nom des objets visibles</translation>
+    </message>
     <message>
         <source>STB_SHADING_COLOR</source>
         <translation>Définir la couleur d&apos;ombrage</translation>
@@ -3856,6 +4060,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>STB_ISOLINE</source>
         <translation>Créer une U ou V isoligne</translation>
     </message>
+    <message>
+        <source>STB_SURFACE_FROM_FACE</source>
+        <translation>Créer une surface depuis une face</translation>
+    </message>
     <message>
         <source>STB_SOLID</source>
         <translation>Construire un solide</translation>
@@ -4032,6 +4240,14 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>TOP_CHECK_SELF_INTERSECTIONS</source>
         <translation>Détection des auto-intersections</translation>
     </message>
+    <message>
+        <source>TOP_FAST_CHECK_INTERSECTIONS</source>
+        <translation>Intersection rapide</translation>
+    </message>
+    <message>
+        <source>TOP_SHAPE_STATISTICS</source>
+        <translation>Statistique de l&apos;objet</translation>
+    </message>
     <message>
         <source>TOP_CHECK_FREE_BNDS</source>
         <translation>Valider les contours libres</translation>
@@ -4272,6 +4488,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>TOP_PROJECTION</source>
         <translation>Projection</translation>
     </message>
+    <message>
+        <source>TOP_PROJ_ON_CYL</source>
+        <translation>Projection sur un cylindre</translation>
+    </message>
     <message>
         <source>TOP_ORIGIN_AND_VECTORS</source>
         <translation>Créer l&apos;origine et les vecteurs de base</translation>
@@ -4288,6 +4508,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>TOP_PIPE_PATH</source>
         <translation>Retrouver le chemin</translation>
     </message>
+    <message>
+        <source>TOP_THICKNESS</source>
+        <translation>Epaississement</translation>
+    </message>
     <message>
         <source>TOP_PLANE</source>
         <translation>Créer un plan</translation>
@@ -4420,6 +4644,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>TOP_ISOLINE</source>
         <translation>Isoligne</translation>
     </message>
+    <message>
+        <source>TOP_SURFACE_FROM_FACE</source>
+        <translation>Surface depuis une face</translation>
+    </message>
     <message>
         <source>TOP_SOLID</source>
         <translation>Créer un solide</translation>
@@ -4608,6 +4836,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_REMOVE_EXTRA_EDGES_TITLE</source>
         <translation>Supprimer les arêtes inutiles</translation>
     </message>
+    <message>
+        <source>GEOM_BOOL_REMOVE_EXTRA_EDGES</source>
+        <translation>Supprimer les arêtes inutiles</translation>
+    </message>
     <message>
         <source>GEOM_REMOVE_EXTRA_EDGES</source>
         <translation>Objet dont on supprime les arêtes inutiles</translation>
@@ -4668,6 +4900,18 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>STB_UNION_FACES</source>
         <translation>Unir les faces</translation>
     </message>
+    <message>
+        <source>TOP_INSPECT_OBJECT</source>
+        <translation>Inspecter un objet</translation>
+    </message>
+    <message>
+        <source>MEN_INSPECT_OBJECT</source>
+        <translation>Inspecter un objet</translation>
+    </message>
+    <message>
+        <source>STB_INSPECT_OBJECT</source>
+        <translation>Inspecter un objet</translation>
+    </message>
     <message>
         <source>TOP_NORMALE</source>
         <translation>Vecteur normal à une face</translation>
@@ -4706,11 +4950,11 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
-        <translation type="unfinished">Show dependency tree</translation>
+        <translation>Montrer l&apos;arbre des dépendances</translation>
     </message>
     <message>
-        <source>MEN_POP_SHOW_REDUCE_STUDY</source>
-        <translation type="unfinished">Reduce study</translation>
+        <source>MEN_POP_REDUCE_STUDY</source>
+        <translation>Etude réduite</translation>
     </message>
     <message>
         <source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
@@ -4896,6 +5140,10 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>GEOM_Z_I</source>
         <translation>Z%1 :</translation>
     </message>
+    <message>
+        <source>GEOM_A_I</source>
+        <translation>A%1 :</translation>
+    </message>
     <message>
         <source>GEOM_SHAPES_ON_SHAPE_TITLE</source>
         <translation>Trouver les éléments d&apos;un objet</translation>
@@ -4960,6 +5208,30 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
         <source>STB_GET_SHARED_SHAPES</source>
         <translation>Trouve les éléments partagés</translation>
     </message>
+    <message>
+        <source>TOP_TRANSFER_DATA</source>
+        <translation>Transfert de données</translation>
+    </message>
+    <message>
+        <source>MEN_TRANSFER_DATA</source>
+        <translation>Transfert de données</translation>
+    </message>
+    <message>
+        <source>STB_TRANSFER_DATA</source>
+        <translation>Transfert de données</translation>
+    </message>
+    <message>
+        <source>TOP_EXTENSION</source>
+        <translation>Extend Edge or Face</translation>
+    </message>
+    <message>
+        <source>MEN_EXTENSION</source>
+        <translation>Extension</translation>
+    </message>
+    <message>
+        <source>STB_EXTENSION</source>
+        <translation>Extend Edge or Face</translation>
+    </message>
     <message>
         <source>GEOM_PUBLISH_RESULT_GRP</source>
         <translation>Options avancées</translation>
@@ -4978,63 +5250,63 @@ Choisissez une face, une coque ou un solide et essayez de nouveau</translation>
     </message>
     <message>
         <source>PREF_TAB_DEPENDENCY_VIEW</source>
-        <translation type="unfinished">Dependency Tree</translation>
+        <translation>Arbre des dépendances</translation>
     </message>
     <message>
         <source>PREF_HIERARCHY_TYPE</source>
-        <translation type="unfinished">Hierarchy type</translation>
+        <translation>Type de hiérarchie</translation>
     </message>
     <message>
         <source>MEN_ONLY_ASCENDANTS</source>
-        <translation type="unfinished">Display only ascendants tree</translation>
+        <translation>Montrer seulement les liens ascendants</translation>
     </message>
     <message>
         <source>MEN_ONLY_DESCENDANTS</source>
-        <translation type="unfinished">Display only descendants tree</translation>
+        <translation>Montrer seulement les liens descendants</translation>
     </message>
     <message>
         <source>MEN_BOTH_ASCENDANTS_DESCENDANTS</source>
-        <translation type="unfinished">Display both ascendants and descendants trees</translation>
+        <translation>Montrer les liens ascendants et descendants</translation>
     </message>
     <message>
         <source>GEOM_MOVE_POSSIBILITY</source>
-        <translation type="unfinished">Possibility to move nodes</translation>
+        <translation>Possibilité de déplacer des noeuds</translation>
     </message>
     <message>
         <source>PREF_GROUP_DEPENDENCY_VIEW_COLOR</source>
-        <translation type="unfinished">Color</translation>
+        <translation>Couleur</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR</source>
-        <translation type="unfinished">Background color</translation>
+        <translation>Couleur du fond</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_NODE_COLOR</source>
-        <translation type="unfinished">Default node color</translation>
+        <translation>Couleur des noeuds par défaut</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
-        <translation type="unfinished">Main node color</translation>
+        <translation>Couleur des noeuds principaux</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
-        <translation type="unfinished">Unpublished node color</translation>
+        <translation>Couleur des noeuds non publiés</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
-        <translation type="unfinished">Selected node color</translation>
+        <translation>Couleurs des noeuds sélectionnés</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
-        <translation type="unfinished">Arrow color</translation>
+        <translation>Couleur des flèches par défaut</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
-        <translation type="unfinished">Highlighted arrow color</translation>
+        <translation>Couleur des flèches en surbrillance</translation>
     </message>
     <message>
         <source>PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR</source>
-        <translation type="unfinished">Selected arrow color</translation>
+        <translation>Couleur des flèches sélectionnées</translation>
     </message>
     <message>
         <source>GEOM_ALL_IMPORT_FILES</source>
@@ -5100,6 +5372,66 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
         <source>CC_PNT_ITEM_X_Y_Z</source>
         <translation>X=%1, Y=%2, Z=%3</translation>
     </message>
+    <message>
+        <source>GEOM_FILTER</source>
+        <translation>Filtre</translation>
+    </message>
+    <message>
+        <source>GEOM_LESS_THAN</source>
+        <translation>Moins que</translation>
+    </message>
+    <message>
+        <source>GEOM_LESSOREQUAL_THAN</source>
+        <translation>Egal ou moins que</translation>
+    </message>
+    <message>
+        <source>GEOM_GREAT_THAN</source>
+        <translation>Plus que</translation>
+    </message>
+    <message>
+        <source>GEOM_GREATOREQUAL_THAN</source>
+        <translation>Egal ou plus que</translation>
+    </message>
+    <message>
+        <source>GEOM_SOME_SHAPES_SELECTED</source>
+        <translation>%1 forme(s) a(ont) été sélectionnée(s)</translation>
+    </message>
+    <message>
+        <source>GEOM_NO_SHAPES_SELECTED</source>
+        <translation>Aucune forme ne correspond aux paramètres de filtrage</translation>
+    </message>
+    <message>
+        <source>GEOM_HEALING_STATS_TITLE</source>
+        <translation>Modifications réalisées</translation>
+    </message>
+    <message>
+        <source>GEOM_HEALING_STATS_COL_1</source>
+        <translation>Décompte</translation>
+    </message>
+    <message>
+        <source>GEOM_HEALING_STATS_COL_2</source>
+        <translation>Modification</translation>
+    </message>
+    <message>
+        <source>GEOM_PLOT_DISTRIBUTION</source>
+        <translation>Graphe</translation>
+    </message>
+    <message>
+        <source>GEOM_X_AXIS</source>
+        <translation>Axe X</translation>
+    </message>
+    <message>
+        <source>GEOM_Y_AXIS</source>
+        <translation>Axe Y</translation>
+    </message>
+    <message>
+        <source>GEOM_Z_AXIS</source>
+        <translation>Axe Z</translation>
+    </message>
+    <message>
+        <source>GEOM_DIM_AXES</source>
+        <translation>Dimensions sur les axes locaux</translation>
+    </message>
 </context>
 <context>
     <name>GeometryGUI</name>
@@ -5149,7 +5481,7 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
     </message>
     <message>
         <source>TOOL_MEASURES</source>
-        <translation>Informations</translation>
+        <translation>Inspection</translation>
     </message>
     <message>
         <source>TOOL_IMPORTEXPORT</source>
@@ -5396,74 +5728,39 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
         <translation>Face 2 V</translation>
     </message>
 </context>
-<context>
-    <name>CurveCreator_NewPointDlg</name>
-    <message>
-        <source>ADD_NEW_POINT</source>
-        <translation>Add new points</translation>
-    </message>
-    <message>
-        <source>X_COORD</source>
-        <translation>X</translation>
-    </message>
-    <message>
-        <source>Y_COORD</source>
-        <translation>Y</translation>
-    </message>
-    <message>
-        <source>Z_COORD</source>
-        <translation>Z</translation>
-    </message>
-    <message>
-        <source>ADD_BTN</source>
-        <translation>Add</translation>
-    </message>
-    <message>
-        <source>ADD_CONTINUE_BTN</source>
-        <translation>Add and continue</translation>
-    </message>
-    <message>
-        <source>ADD_NEW_POINT_TO_%1</source>
-        <translation>Add new point to %1</translation>
-    </message>
-    <message>
-        <source>SET_POINT_COORDINATES</source>
-        <translation>Set point coordinates</translation>
-    </message>
-</context>
 <context>
     <name>CurveCreator_NewSectionDlg</name>
     <message>
-        <source>NAME</source>
-        <translation>Name</translation>
+        <source>SECTION_NAME</source>
+        <translation>Nom</translation>
     </message>
     <message>
-        <source>LINE_TYPE</source>
+        <source>SECTION_LINE_TYPE</source>
         <translation>Type</translation>
     </message>
     <message>
-        <source>POLYLINE_TYPE</source>
-        <translation>Polyline</translation>
+        <source>SECTION_POLYLINE_TYPE</source>
+        <translation>Polyligne</translation>
     </message>
     <message>
-        <source>SPLINE_TYPE</source>
+        <source>SECTION_SPLINE_TYPE</source>
         <translation>Spline</translation>
     </message>
     <message>
-        <source>LINE_CLOSED</source>
-        <translation>Closed</translation>
+        <source>SECTION_LINE_CLOSED</source>
+        <translation>Fermée</translation>
     </message>
     <message>
-        <source>OK</source>
-        <translation>Ok</translation>
+        <source>SECTION_ADD_BTN</source>
+        <translation>Ajouter</translation>
     </message>
     <message>
-        <source>ADD_BTN</source>
-        <translation>Add</translation>
+        <source>SECTION_OK_BTN</source>
+        <translation>Ok</translation>
     </message>
     <message>
-        <source>ADD_CONTINUE_BTN</source>
-        <translation>Add and continue</translation>
+        <source>SECTION_CANCEL_BTN</source>
+        <translation>Annuler</translation>
     </message>
     <message>
         <source>ADD_NEW_SECTION</source>
@@ -5486,13 +5783,28 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
     </message>
 </context>
 <context>
-    <name>CurveCreator_Widget</name>
+    <name>CurveCreator_TableView</name>
     <message>
-        <source>CURVE_NAME_TLT</source>
-        <translation>Nom</translation>
+        <source>TABLE_SECTION</source>
+        <translation>Section</translation>
+    </message>
+    <message>
+        <source>TABLE_INDEX</source>
+        <translation>Indice</translation>
+    </message>
+    <message>
+        <source>TABLE_X</source>
+        <translation>X</translation>
+    </message>
+    <message>
+        <source>TABLE_Y</source>
+        <translation>Y</translation>
     </message>
+</context>
+<context>
+    <name>CurveCreator_Widget</name>
     <message>
-        <source>SECTION_GROUP_TLT</source>
+        <source>SECTION_GROUP_TITLE</source>
         <translation>Sections</translation>
     </message>
     <message>
@@ -5519,22 +5831,6 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
         <source>NEW_SECTION_TLT</source>
         <translation>Insérer une nouvelle section</translation>
     </message>
-    <message>
-        <source>INSERT_SECTION_BEFORE</source>
-        <translation>Insérer une section avant</translation>
-    </message>
-    <message>
-        <source>INSERT_SECTION_BEFORE_TLT</source>
-        <translation>Insérer section avant</translation>
-    </message>
-    <message>
-        <source>INSERT_SECTION_AFTER</source>
-        <translation>Insérer une section après</translation>
-    </message>
-    <message>
-        <source>INSERT_SECTION_AFTER_TLT</source>
-        <translation>Insérer section après</translation>
-    </message>
     <message>
         <source>ADDITION_MODE</source>
         <translation>Mode Ajout</translation>
@@ -5559,18 +5855,6 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
         <source>DETECTION_MODE_TLT</source>
         <translation>Mode Détection</translation>
     </message>
-    <message>
-        <source>INSERT_POINT_BEFORE</source>
-        <translation>Insérer point avant</translation>
-    </message>
-    <message>
-        <source>INSERT_POINT_BEFORE_TLT</source>
-        <translation>Insérer un point avant</translation>
-    </message>
-    <message>
-        <source>INSERT_POINT_AFTER</source>
-        <translation>Insérer point après</translation>
-    </message>
     <message>
         <source>CLOSE_SECTIONS</source>
         <translation>Fermer sections</translation>
@@ -5619,22 +5903,6 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
         <source>JOIN_TLT</source>
         <translation>Joindre les sections sélectionnées</translation>
     </message>
-    <message>
-        <source>STEP_UP</source>
-        <translation>Monter</translation>
-    </message>
-    <message>
-        <source>STEP_UP_TLT</source>
-        <translation>Monter les objets sélectionnés</translation>
-    </message>
-    <message>
-        <source>STEP_DOWN</source>
-        <translation>Descendre</translation>
-    </message>
-    <message>
-        <source>STEP_DOWN_TLT</source>
-        <translation>Descendre les objets sélectionnés</translation>
-    </message>
     <message>
         <source>CLEAR_ALL</source>
         <translation>Effacer tout</translation>
@@ -5652,6 +5920,33 @@ le paramètre &apos;%1&apos; aux préférences du module Géométrie.</translati
         <translation>Joindre toutes les sections</translation>
     </message>
 </context>
+<context>
+    <name>EntityGUI_PolylineDlg</name>
+    <message>
+        <source>POLYLINE_DLG_TITLE</source>
+        <translation>Construction de polyligne</translation>
+    </message>
+    <message>
+        <source>POLYLINE_TITLE</source>
+        <translation>Polyligne</translation>
+    </message>
+    <message>
+        <source>POLYLINE_NAME</source>
+        <translation>Polyligne</translation>
+    </message>
+    <message>
+        <source>POLYLINE_IMPORT</source>
+        <translation>Importer une polyligne</translation>
+    </message>
+    <message>
+        <source>POLYLINE_ADD_SECTION</source>
+        <translation>Ajouter une section</translation>
+    </message>
+    <message>
+        <source>POLYLINE_EDIT_SECTION</source>
+        <translation>Modifier une section</translation>
+    </message>
+</context>
 <context>
     <name>EntityGUI_SketcherDlg</name>
     <message>
@@ -5864,10 +6159,6 @@ Le nombre de points n&apos;est pas suffisant</translation>
         <source>GEOM_ADD_THICKNESS</source>
         <translation>Epaissir (arêtes ou contours uniquement)</translation>
     </message>
-    <message>
-        <source>GEOM_TOWARDS_INSIDE</source>
-        <translation>Epaissir vers l&apos;intérieur</translation>
-    </message>
 </context>
 <context>
     <name>GroupGUI</name>
@@ -6612,6 +6903,22 @@ Fermez cette boîte d&apos;alerte et choisissez les arêtes à recoller.</transl
         <translation>L&apos;activation de cette option peut résulter en une perte de temps sur certains objets.
 Voulez-vous continuer?</translation>
     </message>
+    <message>
+        <source>WIDTH_FACTOR_TOL</source>
+        <translation>Tol. du facteur d&apos;épaisseur</translation>
+    </message>
+    <message>
+        <source>VOLUME_TOL</source>
+        <translation>Tol. de volume</translation>
+    </message>
+    <message>
+        <source>TO_MERGE_SOLIDS</source>
+        <translation>Réunir les solides</translation>
+    </message>
+    <message>
+        <source>SELECT_ALL</source>
+        <translation>Tout sélectionner</translation>
+    </message>
 </context>
 <context>
     <name>GEOMToolsGUI_DeleteDlg</name>
@@ -6799,6 +7106,10 @@ Voulez-vous en créer un nouveau ?</translation>
         <source>GEOM_SHARED_SHAPE</source>
         <translation>Partagé_%1</translation>
     </message>
+    <message>
+        <source>GEOM_SHARED_SHAPES_MULTISHARE</source>
+        <translation>Partagé par tous</translation>
+    </message>
 </context>
 <context>
     <name>GEOMToolsGUI_PublishDlg</name>
@@ -6835,55 +7146,55 @@ Voulez-vous en créer un nouveau ?</translation>
     <name>GEOMToolsGUI_ReduceStudyDlg</name>
     <message>
         <source>GEOM_REDUCE_STUDY_TITLE</source>
-        <translation type="unfinished">Reduce study</translation>
+        <translation>Etude réduite</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_KEPT_OBJECTS</source>
-        <translation type="unfinished">Objects to be kept</translation>
+        <translation>Objets à conserver</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_REMOVE_OBJECTS</source>
-        <translation type="unfinished">Objects to be removed</translation>
+        <translation>Objets à enlever</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_NAME</source>
-        <translation type="unfinished">Name</translation>
+        <translation>Nom</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_OPTIONS</source>
-        <translation type="unfinished">Options</translation>
+        <translation>Options</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_INTERMEDIATES</source>
-        <translation type="unfinished">Intermediate objects</translation>
+        <translation>Objets intermédiaires</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_SUB_OBJECTS</source>
-        <translation type="unfinished">Sub-objects</translation>
+        <translation>Sous-objets</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_KEEP</source>
-        <translation type="unfinished">Keep</translation>
+        <translation>Conserver</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_UNPUBLISH</source>
-        <translation type="unfinished">Unpublish</translation>
+        <translation>Dépublier</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_REMOVE</source>
-        <translation type="unfinished">Remove</translation>
+        <translation>Enlever</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_REMOVE_EMPTY_FOLDER</source>
-        <translation type="unfinished">Remove empty folders</translation>
+        <translation>Enlever les dossiers vide</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_SOFT_REMOVAL</source>
-        <translation type="unfinished">Soft removal</translation>
+        <translation>Dépublication seulement</translation>
     </message>
     <message>
         <source>GEOM_REDUCE_STUDY_WARNING_DELETE</source>
-        <translation type="unfinished">Do you really want to delete intermediate objects? After applying this operation study will be broken.</translation>
+        <translation>Voulez-vous vraiment supprimer les objets intermédiaires ? Après la confirmation de cette opération, l&apos;étude sera cassée.</translation>
     </message>
 </context>
 <context>
@@ -6901,6 +7212,37 @@ Voulez-vous en créer un nouveau ?</translation>
         <translation>UnirFaces</translation>
     </message>
 </context>
+<context>
+    <name>RepairGUI_InspectObjectDlg</name>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_TITLE</source>
+        <translation>Inspecter un objet</translation>
+    </message>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_MAIN_SHAPE</source>
+        <translation>Forme principale</translation>
+    </message>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_SHOW</source>
+        <translation>Afficher la sélection</translation>
+    </message>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_SHOW_ONLY</source>
+        <translation>Afficher la sélection seulement</translation>
+    </message>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_HIDE</source>
+        <translation>Cacher la sélection</translation>
+    </message>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_PUBLISH</source>
+        <translation>Publier la sélection</translation>
+    </message>
+    <message>
+        <source>GEOM_INSPECT_OBJECT_NAME</source>
+        <translation>Nom</translation>
+    </message>
+</context>
 <context>
     <name>GEOMGUI_CreationInfoWdg</name>
     <message>
@@ -6924,6 +7266,17 @@ Voulez-vous en créer un nouveau ?</translation>
         <translation>(aucune information disponible)</translation>
     </message>
 </context>
+<context>
+    <name>GEOMGUI_TextTreeWdg</name>
+    <message>
+        <source>TEXT_TREE_VIEW_TITLE</source>
+        <translation>Texte</translation>
+    </message>
+    <message>
+        <source>TEXT_TREE_VIEW_NAME</source>
+        <translation>Nom</translation>
+    </message>
+</context>
 <context>
     <name>EntityGUI_IsolineDlg</name>
     <message>
@@ -6943,4 +7296,305 @@ Voulez-vous en créer un nouveau ?</translation>
         <translation>V-Isoligne</translation>
     </message>
 </context>
+<context>
+    <name>MeasureGUI_CheckSelfIntersectionsDlg</name>
+    <message>
+        <source>GEOM_CHECK_INTERSECT_TYPE</source>
+        <translation>Détection du type d&apos;auto-intersection</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_INTERSECTIONS</source>
+        <translation>Auto-intersections</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_SUBSHAPES</source>
+        <translation>Sous-formes</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_CHECK_LEVEL</source>
+        <translation>Niveau de vérification</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_SUMMARY</source>
+        <translation>Résumé</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_COMPUTE</source>
+        <translation>Calculer les auto-intersections</translation>
+    </message>
+    <message>
+        <source>GEOM_SELF_INTERSECTION_NAME</source>
+        <translation>Auto_intersection</translation>
+    </message>
+    <message>
+        <source>GEOM_NO_SELF_INTERSECTIONS</source>
+        <translation>Il n&apos;y a pas d&apos;auto-intersection dans la géométrie</translation>
+    </message>
+    <message>
+        <source>GEOM_SELF_INTERSECTIONS_FOUND</source>
+        <translation>Des auto-intersections ont été détectées</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_SELF_INTERSECTIONS_FAILED</source>
+        <translation>La détection d&apos;auto-intersections a échoué</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_SELF_INTERSECTIONS_ERRORS</source>
+        <translation>Avertissement: il y a eu des erreurs pendant l&apos;opération, la liste peut donc être incomplète.</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_V_V</source>
+        <translation>Point à point</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_V_E</source>
+        <translation>Point à arête + tout au-delà</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_E_E</source>
+        <translation>Arête à arête + tout au-delà</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_V_F</source>
+        <translation>Point à face + tout au-delà</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_E_F</source>
+        <translation>Arête à Face + tout au-delà</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INTE_ALL</source>
+        <translation>Face à Face + tout au-delà</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INT_DEFLECT</source>
+        <translation>Coefficient de déflexion</translation>
+    </message>
+    <message>
+        <source>GEOM_CHECK_INT_DETECT_GAPS</source>
+        <translation>Détection des écarts avec tolérance</translation>
+    </message>
+</context>
+<context>
+    <name>MeasureGUI_FastCheckIntersectionsDlg</name>
+    <message>
+        <source>GEOM_FAST_CHECK_INT_DEFLECT</source>
+        <translation>Coefficient de déflection</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_CHECK_INT_DETECT_GAPS</source>
+        <translation>Détecter les écarts avec la tolérance</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_CHECK_INT_SUBSHAPES</source>
+        <translation>Sous-formes de l&apos;objet %1:</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_CHECK_INT_COMPUTE</source>
+        <translation>Calculer les intersections</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_INTERSECTION_NAME</source>
+        <translation>Intersection_rapide</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_INTERSECTION_FAILS</source>
+        <translation>Pas d&apos;intersection</translation>
+    </message>
+    <message>
+        <source>GEOM_FAST_CHECK_OBJ</source>
+        <translation>Objets et résultats</translation>
+    </message>
+</context>
+<context>
+    <name>MeasureGUI_ShapeStatisticsDlg</name>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_TYPE</source>
+        <translation>Type</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_LENGTH</source>
+        <translation>Longueur des arêtes</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_AREA</source>
+        <translation>Aire des faces</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_VOLUME</source>
+        <translation>Volume des solides</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_NB_INTERVALS</source>
+        <translation>Nombre d&apos;intervalles</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_SCALAR_RANGE</source>
+        <translation>Echelle de dimension</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_COMPUTE</source>
+        <translation>Calculer</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN</source>
+        <translation>Min</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MAX</source>
+        <translation>Max</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_CREATE_GROUPS</source>
+        <translation>Créer des groupes</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_DISTRIBUTION_NB_ENT</source>
+        <translation>Nombre d&apos;entités</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN_ERROR</source>
+        <translation>Spécifier une valeur minimale ou ignorer l&apos;échelle de dimension</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MAX_ERROR</source>
+        <translation>Spécifier une valeur maximale ou ignorer l&apos;échelle de dimension</translation>
+    </message>
+    <message>
+        <source>GEOM_SHAPE_STATISTICS_MIN_MAX_ERROR</source>
+        <translation>La valeur minimal ne peut pas être plus grande que la maximale</translation>
+    </message>
+    <message>
+        <source>GEOM_MSG_GROUPS_CREATED</source>
+        <translation>%1 groupes créés</translation>
+    </message>
+</context>
+<context>
+    <name>TransformationGUI_ExtensionDlg</name>
+    <message>
+        <source>GEOM_EXTENSION_TITLE</source>
+        <translation>Extension d&apos;arête ou de face</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION</source>
+        <translation>Extension</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MIN</source>
+        <translation>Premier paramètre</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MAX</source>
+        <translation>Dernier paramètre</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MIN_U</source>
+        <translation>Premier U-paramètre</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MAX_U</source>
+        <translation>Dernier U-paramètre</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MIN_V</source>
+        <translation>Premier V-paramètre</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_MAX_V</source>
+        <translation>Dernier V-paramètre</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_EDGE_NAME</source>
+        <translation>AreteEtendue</translation>
+    </message>
+    <message>
+        <source>GEOM_EXTENSION_FACE_NAME</source>
+        <translation>FaceEtendue</translation>
+    </message>
+</context>
+<context>
+    <name>EntityGUI_SurfFromFaceDlg</name>
+    <message>
+        <source>GEOM_SURF_FROM_FACE_TITLE</source>
+        <translation>Construction de surface depuis une face</translation>
+    </message>
+    <message>
+        <source>GEOM_SURF_FROM_FACE</source>
+        <translation>Surface depuis une face</translation>
+    </message>
+    <message>
+        <source>GEOM_SURF_FROM_FACE_NAME</source>
+        <translation>SurfaceDepuisFace</translation>
+    </message>
+</context>
+<context>
+    <name>OperationGUI_TransferDataDlg</name>
+    <message>
+        <source>GEOM_TRANSFER_DATA_TITLE</source>
+        <translation>Transfert de données</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA</source>
+        <translation>Transfert de données</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_FROM</source>
+        <translation>Forme source</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_TO</source>
+        <translation>Forme de destination</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_METHOD</source>
+        <translation>Type d&apos;opération de détection</translation>
+    </message>
+    <message>
+        <source>GEOM_TD_METHOD_GETINPLACE</source>
+        <translation>Get In Place</translation>
+    </message>
+    <message>
+        <source>GEOM_TD_METHOD_GETINPLACE_OLD</source>
+        <translation>Get In Place (old)</translation>
+    </message>
+    <message>
+        <source>GEOM_TD_METHOD_GETINPLACE_HISTORY</source>
+        <translation>Get In Place By History</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_INFO</source>
+        <translation>Transfert de données: Information</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_NOT_COPIED</source>
+        <translation>Il n&apos;y a rien à copier.</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_COPIED</source>
+        <translation>Les données suivantes ont été copiées:</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_NAMES</source>
+        <translation>Noms: %1 de %2</translation>
+    </message>
+    <message>
+        <source>GEOM_TRANSFER_DATA_MATERIALS</source>
+        <translation>Matériaux: %1 de %2</translation>
+    </message>
+</context>
+<context>
+    <name>TransformationGUI_ProjectionOnCylDlg</name>
+    <message>
+        <source>GEOM_PROJ_ON_CYL_TITLE</source>
+        <translation>Projection sur un cylindre</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_CYL_START_ANGLE</source>
+        <translation>Angle de départ</translation>
+    </message>
+    <message>
+        <source>GEOM_PROJ_ON_CYL_LENGTH_ANGLE</source>
+        <translation>Longueur de l&apos;angle</translation>
+    </message>
+</context>
 </TS>
index 8ee7476d70b46e967325b103cc7f780a372ca50c..0a55e444fd7b2cd6d66f5f56061e08721a6aeca1 100644 (file)
       <source>DEVIDE_EDGE_NEW_OBJECT_NAME</source>
       <translation>NewObject</translation>
     </message>
+    <message>
+      <source>DEVIDE_EDGE_BAD_PROJ_MSG</source>
+      <translation>エッジ外側の投影</translation>
+    </message>
+    <message>
+      <source>DEVIDE_EDGE_BY_PROJ_POINT</source>
+      <translation>投影点</translation>
+    </message>
     <message>
       <source>ERROR_SHAPE_TYPE</source>
       <translation>選択したオブジェクトの種類が正しくありません!\nフェース、シェルまたはソリッドを選択し、もう一度やり直してください。</translation>
       <source>GEOM_NONBLOCKS</source>
       <translation>GroupeSolidesNonBlocs</translation>
     </message>
+    <message>
+      <source>GEOM_USE_C1_CRITERION</source>
+      <translation>C1 criterion の使用</translation>
+    </message>
     <message>
       <source>GEOM_CHECK_INFOS</source>
       <translation>オブジェクトとその位相情報</translation>
       <translation>自己交差の検出</translation>
     </message>
     <message>
-      <source>GEOM_CHECK_SELF_INTERSECTIONS_FAILED</source>
-      <translation>自己交差の検出に失敗しました</translation>
-    </message>
-    <message>
-      <source>GEOM_NO_SELF_INTERSECTIONS</source>
-      <translation>自己交差は検出されませんでした。</translation>
-    </message>
-    <message>
-      <source>GEOM_SELF_INTERSECTIONS_FOUND</source>
-      <translation>自己交差が検出されました。</translation>
+      <source>GEOM_FAST_CHECK_INTERSECTIONS</source>
+      <translation>クイック交点</translation>
     </message>
     <message>
-      <source>GEOM_CHECK_SELF_INTERSECTIONS_ERRORS</source>
-      <translation>警告: 操作中にエラーがあったので、リストが不完全かもしれない</translation>
+      <source>GEOM_SHAPE_STATISTICS</source>
+      <translation>形状の統計</translation>
     </message>
     <message>
       <source>GEOM_CIRCLE</source>
       <source>GEOM_CYLINDER_TITLE</source>
       <translation>円柱の作成</translation>
     </message>
+    <message>
+      <source>GEOM_CYLINDER_ANGLE_ERR</source>
+      <translation>角度値0°と360°はボリューム構築には不適切です。標準の円筒構築機能を使用するために角度ボックスのチェックを外してください。</translation>
+    </message>
     <message>
       <source>GEOM_D1</source>
       <translation>D1 を:</translation>
       <source>GEOM_EXTRUSION_TITLE</source>
       <translation>面の押出し</translation>
     </message>
+    <message>
+      <source>GEOM_THICKNESS_TITLE</source>
+      <translation>厚みの構築</translation>
+    </message>
+    <message>
+      <source>GEOM_THICKNESS_NAME</source>
+      <translation>Thickness</translation>
+    </message>
+    <message>
+      <source>GEOM_TOWARDS_INSIDE</source>
+      <translation>内側への厚み</translation>
+    </message>
     <message>
       <source>GEOM_SCALE_PRISM</source>
       <translation>面のサイズを変えながら押し出す</translation>
       <source>GEOM_FACE_FFW</source>
       <translation>顔輪郭またはエッジからの作成</translation>
     </message>
+    <message>
+      <source>GEOM_FACE_FROM_SURFACE</source>
+      <translation>ワイヤによる境界面からの面作成</translation>
+    </message>
     <message>
       <source>GEOM_FACE_OPT</source>
       <translation>平らなフェースを作成</translation>
     </message>
+    <message>
+      <source>GEOM_FACE_FFWC</source>
+      <translation>ワイヤと拘束点からの面作成</translation>
+    </message>
+    <message>
+      <source>GEOM_CONSTRAINTS</source>
+      <translation>拘束</translation>
+    </message>
+    <message>
+      <source>GEOM_FACE_CONSTRAINT</source>
+      <translation>拘束面</translation>
+    </message>
+    <message>
+      <source>GEOM_SOLID_FROM_FACE_OPT</source>
+      <translation>形状の交差・縫合</translation>
+    </message>
     <message>
       <source>MAKE_FACE_TOLERANCE_TOO_BIG</source>
       <translation>平坦な面を作成できません: 作成された顔があまりにも高い耐性</translation>
       <source>GEOM_FREE_FACES</source>
       <translation>フリーフェース</translation>
     </message>
+    <message>
+      <source>GEOM_FREE_FACES_NAME</source>
+      <translation>Free_face</translation>
+    </message>
     <message>
       <source>GEOM_FREE_FACES_TITLE</source>
       <translation>フリーフェース</translation>
       <source>GEOM_GLUE_EDGES_TITLE</source>
       <translation>エッジ固着</translation>
     </message>
+    <message>
+      <source>GEOM_GLUE_EDGES_DETECT_TITLE</source>
+      <translation>一致エッジ検出</translation>
+    </message>
+    <message>
+      <source>GEOM_GLUE_FACES_DETECT_TITLE</source>
+      <translation>一致面検出</translation>
+    </message>
     <message>
       <source>GLUE_ERROR_STICKED_SHAPES</source>
       <translation>公差の値が大きすぎます。「付着」図形の検出。</translation>
       <translation>加工図</translation>
     </message>
     <message>
-      <source>GEOM_PROJECTION</source>
-      <translation>Projection</translation>
+      <source>GEOM_PROJECTION_ON_FACE</source>
+      <translation>面上の投影</translation>
+    </message>
+    <message>
+      <source>GEOM_PROJECTION_ON_WIRE</source>
+      <translation>ワイヤ上の投影</translation>
+    </message>
+    <message>
+      <source>GEOM_PROJECTION_ON_EDGE</source>
+      <translation>エッジ上の投影</translation>
     </message>
     <message>
       <source>GEOM_PROJECTION_TITLE</source>
       <translation>フェース上に投影</translation>
     </message>
     <message>
-      <source>GEOM_SOURCE_OBJECT</source>
-      <translation>基になるポイント、エッジ、またはワイヤー</translation>
+      <source>GEOM_PROJECTION_NAME</source>
+      <translation>Projection</translation>
+    </message>
+    <message>
+      <source>GEOM_PROJ_ON_FACE_SOURCE</source>
+      <translation>ソース頂点、エッジまたはワイヤ</translation>
+    </message>
+    <message>
+      <source>GEOM_PROJ_ON_FACE_TARGET</source>
+      <translation>ターゲット面</translation>
+    </message>
+    <message>
+      <source>GEOM_PROJ_ON_WIRE_SOURCE</source>
+      <translation>ソース頂点</translation>
+    </message>
+    <message>
+      <source>GEOM_PROJ_ON_WIRE_TARGET</source>
+      <translation>ターゲットワイヤ</translation>
+    </message>
+    <message>
+      <source>GEOM_PROJ_ON_EDGE_SOURCE</source>
+      <translation>ソース頂点</translation>
+    </message>
+    <message>
+      <source>GEOM_PROJ_ON_EDGE_TARGET</source>
+      <translation>ターゲットエッジ</translation>
     </message>
     <message>
       <source>GEOM_SOLUTION</source>
       <source>GEOM_SOLUTION_I</source>
       <translation>%1 のソリューション</translation>
     </message>
-    <message>
-      <source>GEOM_TARGET_OBJECT</source>
-      <translation>目的面</translation>
-    </message>
     <message>
       <source>GEOM_WITH_CONTACT</source>
       <translation>接触している</translation>
       <source>GEOM_LENGTH_VALUE</source>
       <translation>長さで</translation>
     </message>
+    <message>
+      <source>GEOM_TAKE_ORIENTATION_INTO_ACCOUNT</source>
+      <translation>エッジの方向に注意</translation>
+    </message>
     <message>
       <source>GEOM_PARTITION</source>
       <translation>Partition</translation>
       <source>GEOM_SELECT_UNPUBLISHED_EDGES</source>
       <translation>非公開のエッジを選択</translation>
     </message>
+    <message>
+      <source>GEOM_GENERATE_GROUPS</source>
+      <translation>グループの作成</translation>
+    </message>
+    <message>
+      <source>GEOM_GROUP_NAME_PREFIX</source>
+      <translation>グループ名Prefix</translation>
+    </message>
+    <message>
+      <source>GEOM_STEP_BY_STEP</source>
+      <translation>ステップ生成</translation>
+    </message>
     <message>
       <source>GEOM_PLANE</source>
       <translation>Plane</translation>
     </message>
     <message>
       <source>GEOM_PRP_EXPORT</source>
-      <translation>ジオメトリを %1 にエクスポート</translation>
+      <translation>ジオメトリを %1 にエクスポート...</translation>
     </message>
     <message>
       <source>GEOM_PRP_LOADING</source>
       <source>GEOM_SELECTED_SHAPE</source>
       <translation>選択した形状</translation>
     </message>
+    <message>
+      <source>GEOM_SELECTED_SHAPES</source>
+      <translation>選択済み形状</translation>
+    </message>
     <message>
       <source>GEOM_SELECTION</source>
       <translation>選択</translation>
       <source>GEOM_SOLID_TITLE</source>
       <translation>ソリッドの構築</translation>
     </message>
+    <message>
+      <source>GEOM_SOLID_SHELLS</source>
+      <translation>シェルからソリッドの作成</translation>
+    </message>
+    <message>
+      <source>GEOM_SOLID_FACES</source>
+      <translation>接続された面、シェルからソリッド作成</translation>
+    </message>
     <message>
       <source>GEOM_SPHERE</source>
       <translation>Sphere</translation>
       <source>GEOM_WRN_FACES_NOT_SHELL</source>
       <translation>シェルを作成できません。面の結合です。</translation>
     </message>
+    <message>
+      <source>GEOM_WRN_FACES_NOT_FACE</source>
+      <translation>たった1つの面を作成することはできません。結果は複合面になります。</translation>
+    </message>
     <message>
       <source>WRN_SHAPE_UNCLOSED</source>
       <translation>閉じていないオブジェクト %1 からソリッドを作成できません</translation>
       <source>WRN_NULL_OBJECT_OR_SHAPE</source>
       <translation>ソリッド作成のオブジェクト %1 が無効</translation>
     </message>
+    <message>
+      <source>GROUP_DOWN</source>
+      <translation>下</translation>
+    </message>
+    <message>
+      <source>GROUP_UP</source>
+      <translation>上</translation>
+    </message>
+    <message>
+      <source>GROUP_SIDE1</source>
+      <translation>横1</translation>
+    </message>
+    <message>
+      <source>GROUP_SIDE2</source>
+      <translation>横2</translation>
+    </message>
+    <message>
+      <source>GROUP_OTHER</source>
+      <translation>その他</translation>
+    </message>
     <message>
       <source>GEOM_X</source>
       <translation>X :</translation>
       <source>MEN_CURVE_CREATOR</source>
       <translation>カーブの作成</translation>
     </message>
+    <message>
+      <source>TOP_CURVE_CREATOR</source>
+      <translation>2Dポリラインの作成</translation>
+    </message>
+    <message>
+      <source>STB_CURVE_CREATOR</source>
+      <translation>2Dポリラインの作成</translation>
+    </message>
     <message>
       <source>MEN_ALL_SEL_ONLY</source>
       <translation>全選択</translation>
       <source>MEN_CHECK_SELF_INTERSECTIONS</source>
       <translation>自己交差の確認</translation>
     </message>
+    <message>
+      <source>MEN_FAST_CHECK_INTERSECTIONS</source>
+      <translation>クイック交点</translation>
+    </message>
+    <message>
+      <source>MEN_SHAPE_STATISTICS</source>
+      <translation>形状の統計</translation>
+    </message>
     <message>
       <source>MEN_CHECK_FREE_BNDS</source>
       <translation>自由境界の確認</translation>
     </message>
     <message>
       <source>MEN_IMPORT</source>
-      <translation>インポート</translation>
+      <translation>インポート...</translation>
     </message>
     <message>
       <source>MEN_INERTIA</source>
       <source>MEN_PROJECTION</source>
       <translation>投影</translation>
     </message>
+    <message>
+      <source>MEN_PROJ_ON_CYL</source>
+      <translation>円筒の投影</translation>
+    </message>
     <message>
       <source>MEN_OPERATIONS</source>
       <translation>操作</translation>
       <source>MEN_PIPE_PATH</source>
       <translation>経路の復元</translation>
     </message>
+    <message>
+      <source>MEN_THICKNESS</source>
+      <translation>厚み</translation>
+    </message>
     <message>
       <source>MEN_PLANE</source>
       <translation>平面</translation>
     </message>
     <message>
       <source>MEN_POP_VERTICES</source>
-      <translation type="unfinished">Show Vertices</translation>
+      <translation>頂点の表示</translation>
+    </message>
+    <message>
+      <source>MEN_POP_SHOW_NAME</source>
+      <translation>名前の表示</translation>
     </message>
     <message>
       <source>MEN_PREFERENCES</source>
       <source>MEN_ISOLINE</source>
       <translation>等高線</translation>
     </message>
+    <message>
+      <source>MEN_SURFACE_FROM_FACE</source>
+      <translation>面から表面</translation>
+    </message>
     <message>
       <source>MEN_SOLID</source>
       <translation>ソリッド</translation>
     </message>
+    <message>
+      <source>MEN_SOLID_FROM_FACES</source>
+      <translation>接続された面からソリッド</translation>
+    </message>
     <message>
       <source>MEN_SOLID_SEL_ONLY</source>
       <translation>ソリッド</translation>
     </message>
     <message>
       <source>MEN_MATERIALS_LIBRARY</source>
-      <translation>æ\9d\90æ\96\99ã\81®ç\89¹æ\80§</translation>
+      <translation>æ\9d\90æ\96\99ã\83©ã\82¤ã\83\96ã\83©ã\83ª</translation>
     </message>
     <message>
       <source>MEN_TEXTURE</source>
     </message>
     <message>
       <source>MEN_VERTICES_MODE_ON</source>
-      <translation type="unfinished">Show Vertices</translation>
+      <translation>頂点の表示</translation>
     </message>
     <message>
       <source>MEN_VERTICES_MODE_OFF</source>
-      <translation type="unfinished">Hide Vertices</translation>
+      <translation>頂点の非表示</translation>
+    </message>
+    <message>
+      <source>MEN_NAME_MODE_ON</source>
+      <translation>名前の表示</translation>
+    </message>
+    <message>
+      <source>MEN_NAME_MODE_OFF</source>
+      <translation>名前の非表示</translation>
     </message>
     <message>
       <source>MEN_WIREFRAME</source>
       <source>MEN_POP_PREDEF_MATER_CUSTOM</source>
       <translation>カスタム...</translation>
     </message>
+    <message>
+      <source>MEN_EDGE_EXTEND</source>
+      <translation>拡張エッジ</translation>
+    </message>
+    <message>
+      <source>MEN_FACE_EXTEND</source>
+      <translation>拡張面</translation>
+    </message>
     <message>
       <source>NAME_LBL</source>
       <translation>名前:</translation>
       <translation>表示モード</translation>
     </message>
     <message>
-        <source>PREF_TRANSPARENCY</source>
-        <translation>透明度</translation>
+      <source>PREF_TRANSPARENCY</source>
+      <translation>透明度</translation>
     </message>
     <message>
       <source>PREF_FREE_BOUND_COLOR</source>
       <source>PREF_ISOS_COLOR</source>
       <translation>輪郭の色</translation>
     </message>
+    <message>
+      <source>PREF_LABEL_COLOR</source>
+      <translation>ラベルの色</translation>
+    </message>
     <message>
       <source>PREF_TOPLEVEL_COLOR</source>
       <translation>前景オブジェクトの色</translation>
       <translation>線幅</translation>
     </message>
     <message>
-      <source>PREF_DIMENSIONS_FONT_HEIGHT</source>
-      <translation>フォント高さ</translation>
+      <source>PREF_DIMENSIONS_FONT</source>
+      <translation>フォント</translation>
     </message>
     <message>
       <source>PREF_DIMENSIONS_ARROW_LENGTH</source>
       <source>PREF_DIMENSIONS_SHOW_UNITS</source>
       <translation>測定単位の表示</translation>
     </message>
+    <message>
+      <source>PREF_DIMENSIONS_USE_TEXT3D</source>
+      <translation>3Dテキストの使用</translation>
+    </message>
+    <message>
+      <source>PREF_HIDE_INPUT_OBJECT</source>
+      <translation>ビューワから入力したオブジェクトの非表示</translation>
+    </message>
     <message>
       <source>PREF_ISOS</source>
       <translation>輪郭の数</translation>
     </message>
     <message>
       <source>MATERIAL_LIBRARY_TLT</source>
-      <translation>図書館資料</translation>
+      <translation>材料ライブラリ</translation>
     </message>
     <message>
       <source>REMOVE_HOLES_NEW_OBJ_NAME</source>
       <source>STB_CHECK_SELF_INTERSECTIONS</source>
       <translation>自己交差の確認</translation>
     </message>
+    <message>
+      <source>STB_FAST_CHECK_INTERSECTIONS</source>
+      <translation>クイック交点</translation>
+    </message>
+    <message>
+      <source>STB_SHAPE_STATISTICS</source>
+      <translation>形状の統計</translation>
+    </message>
     <message>
       <source>STB_CHECK_FREE_BNDS</source>
       <translation>自由境界をチェック</translation>
       <source>STB_PROJECTION</source>
       <translation>ポイント、エッジ、または輪郭上の 1 つの側面を投影</translation>
     </message>
+    <message>
+      <source>STB_PROJ_ON_CYL</source>
+      <translation>円筒上のワイヤまたは面を投影</translation>
+    </message>
     <message>
       <source>STB_ORIGIN_AND_VECTORS</source>
       <translation>起源と基底ベクトルを作成します。</translation>
       <source>STB_PIPE_PATH</source>
       <translation>経路の復元</translation>
     </message>
+    <message>
+      <source>STB_THICKNESS</source>
+      <translation>厚みのあるソリッドの作成</translation>
+    </message>
     <message>
       <source>STB_PLANE</source>
       <translation>平面を作成</translation>
     </message>
     <message>
       <source>STB_POP_VERTICES</source>
-      <translation type="unfinished">Show Vertices</translation>
+      <translation>頂点の表示</translation>
+    </message>
+    <message>
+      <source>STB_POP_SHOW_NAME</source>
+      <translation>名前の表示</translation>
     </message>
     <message>
       <source>STB_POP_SETTEXTURE</source>
       <source>STB_VECTOR_MODE</source>
       <translation>エッジの表示モードを変更</translation>
     </message>
+    <message>
+      <source>STB_NAME_MODE</source>
+      <translation>表示中の形状の名前を表示/非表示</translation>
+    </message>
     <message>
       <source>STB_SHADING_COLOR</source>
       <translation>網かけの色を設定</translation>
       <source>STB_ISOLINE</source>
       <translation>UまたはV方向等高線の作成</translation>
     </message>
+    <message>
+      <source>STB_SURFACE_FROM_FACE</source>
+      <translation>面から表面の作成</translation>
+    </message>
     <message>
       <source>STB_SOLID</source>
       <translation>ソリッドを構築</translation>
       <source>TOP_CHECK_SELF_INTERSECTIONS</source>
       <translation>自己交差の確認</translation>
     </message>
+    <message>
+      <source>TOP_FAST_CHECK_INTERSECTIONS</source>
+      <translation>クイック交点</translation>
+    </message>
+    <message>
+      <source>TOP_SHAPE_STATISTICS</source>
+      <translation>形状の統計</translation>
+    </message>
     <message>
       <source>TOP_CHECK_FREE_BNDS</source>
       <translation>自由境界を確認</translation>
       <source>TOP_PROJECTION</source>
       <translation>投影</translation>
     </message>
+    <message>
+      <source>TOP_PROJ_ON_CYL</source>
+      <translation>円筒上に投影</translation>
+    </message>
     <message>
       <source>TOP_ORIGIN_AND_VECTORS</source>
       <translation>起源と根拠のベクトルを作成します。</translation>
       <source>TOP_PIPE_PATH</source>
       <translation>経路の復元</translation>
     </message>
+    <message>
+      <source>TOP_THICKNESS</source>
+      <translation>厚み</translation>
+    </message>
     <message>
       <source>TOP_PLANE</source>
       <translation>平面を作成</translation>
       <source>TOP_ISOLINE</source>
       <translation>等高線</translation>
     </message>
+    <message>
+      <source>TOP_SURFACE_FROM_FACE</source>
+      <translation>面から表面</translation>
+    </message>
     <message>
       <source>TOP_SOLID</source>
       <translation>ソリッドを作成</translation>
     </message>
     <message>
       <source>MEN_UNION_FACES</source>
-      <translation>é\80£å\90\88ã\81«ç\9b´é\9d¢ã\81\97ã\81¦ã\81\84ã\81¾ã\81\99ã\80\82</translation>
+      <translation>é\9d¢ã\81®å\85±æ\9c\89</translation>
     </message>
     <message>
       <source>STB_UNION_FACES</source>
       <translation>連合に直面しています。</translation>
     </message>
+    <message>
+      <source>TOP_INSPECT_OBJECT</source>
+      <translation>オブジェクトの点検</translation>
+    </message>
+    <message>
+      <source>MEN_INSPECT_OBJECT</source>
+      <translation>オブジェクトの点検</translation>
+    </message>
+    <message>
+      <source>STB_INSPECT_OBJECT</source>
+      <translation>オブジェクトの点検</translation>
+    </message>
     <message>
       <source>TOP_NORMALE</source>
       <translation>フェースに垂直</translation>
       <translation>オブジェクトの基準寸法を管理</translation>
     </message>
     <message>
-        <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
-        <translation type="unfinished">Show dependency tree</translation>
+      <source>MEN_POP_SHOW_DEPENDENCY_TREE</source>
+      <translation>依存ツリーの表示</translation>
     </message>
     <message>
-        <source>MEN_POP_SHOW_REDUCE_STUDY</source>
-        <translation type="unfinished">Reduce study</translation>
+      <source>MEN_POP_REDUCE_STUDY</source>
+      <translation>スタディの削減</translation>
     </message>
     <message>
       <source>MEN_POP_SHOW_ALL_DIMENSIONS</source>
       <source>GEOM_Z_I</source>
       <translation>Z%1 :</translation>
     </message>
+    <message>
+      <source>GEOM_A_I</source>
+      <translation>A%1 :</translation>
+    </message>
     <message>
       <source>GEOM_SHAPES_ON_SHAPE_TITLE</source>
       <translation>オブジェクトの要素を見つける</translation>
       <source>STB_GET_SHARED_SHAPES</source>
       <translation>共有アイテムを取得</translation>
     </message>
+    <message>
+      <source>TOP_TRANSFER_DATA</source>
+      <translation>データ転送</translation>
+    </message>
+    <message>
+      <source>MEN_TRANSFER_DATA</source>
+      <translation>データ転送</translation>
+    </message>
+    <message>
+      <source>STB_TRANSFER_DATA</source>
+      <translation>データ転送</translation>
+    </message>
+    <message>
+      <source>TOP_EXTENSION</source>
+      <translation>エッジまたは面の拡張</translation>
+    </message>
+    <message>
+      <source>MEN_EXTENSION</source>
+      <translation>拡張</translation>
+    </message>
+    <message>
+      <source>STB_EXTENSION</source>
+      <translation>エッジまたは面の拡張</translation>
+    </message>
     <message>
       <source>GEOM_PUBLISH_RESULT_GRP</source>
       <translation>高度なオプション</translation>
       <translation>プレビュー</translation>
     </message>
     <message>
-        <source>PREF_TAB_DEPENDENCY_VIEW</source>
-        <translation type="unfinished">Dependency Tree</translation>
+      <source>PREF_TAB_DEPENDENCY_VIEW</source>
+      <translation>依存ツリー</translation>
     </message>
     <message>
-        <source>PREF_HIERARCHY_TYPE</source>
-        <translation type="unfinished">Hierarchy type</translation>
+      <source>PREF_HIERARCHY_TYPE</source>
+      <translation>階層タイプ</translation>
     </message>
     <message>
-        <source>MEN_ONLY_ASCENDANTS</source>
-        <translation type="unfinished">Display only ascendants tree</translation>
+      <source>MEN_ONLY_ASCENDANTS</source>
+      <translation>ツリー上位のみ表示</translation>
     </message>
     <message>
-        <source>MEN_ONLY_DESCENDANTS</source>
-        <translation type="unfinished">Display only descendants tree</translation>
+      <source>MEN_ONLY_DESCENDANTS</source>
+      <translation>ツリー下位のみ表示</translation>
     </message>
     <message>
-        <source>MEN_BOTH_ASCENDANTS_DESCENDANTS</source>
-        <translation type="unfinished">Display both ascendants and descendants trees</translation>
+      <source>MEN_BOTH_ASCENDANTS_DESCENDANTS</source>
+      <translation>ツリー上位と下位の両方表示</translation>
     </message>
     <message>
-        <source>GEOM_MOVE_POSSIBILITY</source>
-        <translation type="unfinished">Possibility to move nodes</translation>
+      <source>GEOM_MOVE_POSSIBILITY</source>
+      <translation>ノード移動可能性</translation>
     </message>
     <message>
-        <source>PREF_GROUP_DEPENDENCY_VIEW_COLOR</source>
-        <translation type="unfinished">Color</translation>
+      <source>PREF_GROUP_DEPENDENCY_VIEW_COLOR</source>
+      <translation>色</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR</source>
-        <translation type="unfinished">Background color</translation>
+      <source>PREF_DEPENDENCY_VIEW_BACKGROUND_COLOR</source>
+      <translation>背景色</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_NODE_COLOR</source>
-        <translation type="unfinished">Default node color</translation>
+      <source>PREF_DEPENDENCY_VIEW_NODE_COLOR</source>
+      <translation>デフォルトノード色</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
-        <translation type="unfinished">Main node color</translation>
+      <source>PREF_DEPENDENCY_VIEW_MAIN_NODE_COLOR</source>
+      <translation>主ノード色</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
-        <translation type="unfinished">Unpublished node color</translation>
+      <source>PREF_DEPENDENCY_VIEW_UNPUBLISH_NODE_COLOR</source>
+      <translation>非公開ノード色</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
-        <translation type="unfinished">Selected node color</translation>
+      <source>PREF_DEPENDENCY_VIEW_SELECT_NODE_COLOR</source>
+      <translation>選択ノード色</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
-        <translation type="unfinished">Arrow color</translation>
+      <source>PREF_DEPENDENCY_VIEW_ARROW_COLOR</source>
+      <translation>デフォルト矢印色</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
-        <translation type="unfinished">Highlighted arrow color</translation>
+      <source>PREF_DEPENDENCY_VIEW_HIGHLIGHT_ARROW_COLOR</source>
+      <translation>ハイライト矢印色</translation>
     </message>
     <message>
-        <source>PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR</source>
-        <translation type="unfinished">Selected arrow color</translation>
+      <source>PREF_DEPENDENCY_VIEW_SELECT_ARROW_COLOR</source>
+      <translation>選択矢印色</translation>
     </message>
     <message>
       <source>GEOM_ALL_IMPORT_FILES</source>
       <source>CC_PNT_ITEM_X_Y_Z</source>
       <translation>X=%1, Y=%2, Z=%3</translation>
     </message>
+    <message>
+      <source>GEOM_FILTER</source>
+      <translation>フィルタ</translation>
+    </message>
+    <message>
+      <source>GEOM_LESS_THAN</source>
+      <translation>未満</translation>
+    </message>
+    <message>
+      <source>GEOM_LESSOREQUAL_THAN</source>
+      <translation>以下</translation>
+    </message>
+    <message>
+      <source>GEOM_GREAT_THAN</source>
+      <translation>超える</translation>
+    </message>
+    <message>
+      <source>GEOM_GREATOREQUAL_THAN</source>
+      <translation>以上</translation>
+    </message>
+    <message>
+      <source>GEOM_SOME_SHAPES_SELECTED</source>
+      <translation>%1 個選択済み</translation>
+    </message>
+    <message>
+      <source>GEOM_NO_SHAPES_SELECTED</source>
+      <translation>フィルタリングパラメータに適合する形状はありません</translation>
+    </message>
+    <message>
+      <source>GEOM_HEALING_STATS_TITLE</source>
+      <translation>行われた変更</translation>
+    </message>
+    <message>
+      <source>GEOM_HEALING_STATS_COL_1</source>
+      <translation>カウント</translation>
+    </message>
+    <message>
+      <source>GEOM_HEALING_STATS_COL_2</source>
+      <translation>修正</translation>
+    </message>
+    <message>
+      <source>GEOM_PLOT_DISTRIBUTION</source>
+      <translation>Plot</translation>
+    </message>
+    <message>
+      <source>GEOM_X_AXIS</source>
+      <translation>X軸</translation>
+    </message>
+    <message>
+      <source>GEOM_Y_AXIS</source>
+      <translation>Y軸</translation>
+    </message>
+    <message>
+      <source>GEOM_Z_AXIS</source>
+      <translation>Z軸</translation>
+    </message>
+    <message>
+      <source>GEOM_DIM_AXES</source>
+      <translation>局所座標軸に沿った次元</translation>
+    </message>
   </context>
   <context>
     <name>GeometryGUI</name>
     <message>
       <source>TOOL_BASIC</source>
-      <translation>基礎オブジェクト</translation>
+      <translation>基</translation>
     </message>
     <message>
       <source>TOOL_BLOCKS</source>
-      <translation>ブロック分割</translation>
+      <translation>ブロック</translation>
     </message>
     <message>
       <source>TOOL_BOOLEAN</source>
-      <translation>ã\83\96ã\83¼ã\83ªã\82¢ã\83³æ\93\8dä½\9c</translation>
+      <translation>ã\83\96ã\83¼ã\83ªã\82¢ã\83³æ¼\94ç®\97</translation>
     </message>
     <message>
       <source>TOOL_FEATURES</source>
-      <translation>フィーチャー</translation>
+      <translation>修正</translation>
     </message>
     <message>
       <source>TOOL_GENERATION</source>
-      <translation>押し出し/回転</translation>
+      <translation>作成</translation>
     </message>
     <message>
       <source>TOOL_PRIMITIVES</source>
-      <translation>基本図形</translation>
+      <translation>プリミティブ</translation>
     </message>
     <message>
       <source>TOOL_TRANSFORMATION</source>
-      <translation>変形/移動/回転</translation>
+      <translation>変形</translation>
     </message>
     <message>
       <source>TOOL_BUILD</source>
     </message>
     <message>
       <source>TOOL_ADVANCED</source>
-      <translation>高度なツール</translation>
+      <translation>上級</translation>
     </message>
     <message>
       <source>TOOL_MEASURES</source>
-      <translation>æ\83\85å ±/測å®\9a</translation>
+      <translation>測定</translation>
     </message>
     <message>
       <source>TOOL_IMPORTEXPORT</source>
-      <translation>インポート/エクスポート</translation>
+      <translation>インポート / エクスポート XAO</translation>
     </message>
   </context>
   <context>
       <translation>フェース 2 V</translation>
     </message>
   </context>
-  <context>
-    <name>CurveCreator_NewPointDlg</name>
-    <message>
-      <source>ADD_NEW_POINT</source>
-      <translation>新しい点の追加</translation>
-    </message>
-    <message>
-      <source>X_COORD</source>
-      <translation>X</translation>
-    </message>
-    <message>
-      <source>Y_COORD</source>
-      <translation>Y</translation>
-    </message>
-    <message>
-      <source>Z_COORD</source>
-      <translation>Z</translation>
-    </message>
-    <message>
-      <source>ADD_BTN</source>
-      <translation>追加</translation>
-    </message>
-    <message>
-      <source>ADD_CONTINUE_BTN</source>
-      <translation>追加して継続</translation>
-    </message>
-    <message>
-      <source>ADD_NEW_POINT_TO_%1</source>
-      <translation>新しい点を%1に追加</translation>
-    </message>
-    <message>
-      <source>SET_POINT_COORDINATES</source>
-      <translation>点座標の設定</translation>
-    </message>
-  </context>
   <context>
     <name>CurveCreator_NewSectionDlg</name>
     <message>
-      <source>NAME</source>
+      <source>SECTION_NAME</source>
       <translation>名前</translation>
     </message>
     <message>
-      <source>LINE_TYPE</source>
-      <translation>ã\83©ã\82¤ã\83³</translation>
+      <source>SECTION_LINE_TYPE</source>
+      <translation>ã\82¿ã\82¤ã\83\97</translation>
     </message>
     <message>
-      <source>POLYLINE_TYPE</source>
+      <source>SECTION_POLYLINE_TYPE</source>
       <translation>ポリライン</translation>
     </message>
     <message>
-      <source>SPLINE_TYPE</source>
+      <source>SECTION_SPLINE_TYPE</source>
       <translation>スプライン</translation>
     </message>
     <message>
-      <source>LINE_CLOSED</source>
+      <source>SECTION_LINE_CLOSED</source>
       <translation>閉じたライン</translation>
     </message>
     <message>
-      <source>OK</source>
-      <translation>Ok</translation>
+      <source>SECTION_ADD_BTN</source>
+      <translation>追加</translation>
     </message>
     <message>
-      <source>ADD_BTN</source>
-      <translation>追加</translation>
+      <source>SECTION_OK_BTN</source>
+      <translation>Ok</translation>
     </message>
     <message>
-      <source>ADD_CONTINUE_BTN</source>
-      <translation>追加して継続</translation>
+      <source>SECTION_CANCEL_BTN</source>
+      <translation>キャンセル</translation>
     </message>
     <message>
       <source>ADD_NEW_SECTION</source>
     </message>
   </context>
   <context>
-    <name>CurveCreator_Widget</name>
+    <name>CurveCreator_TableView</name>
+    <message>
+      <source>TABLE_SECTION</source>
+      <translation>Section</translation>
+    </message>
     <message>
-      <source>CURVE_NAME_TLT</source>
-      <translation>カーブの名前</translation>
+      <source>TABLE_INDEX</source>
+      <translation>Index</translation>
     </message>
     <message>
-      <source>SECTION_GROUP_TLT</source>
-      <translation>断面グループ</translation>
+      <source>TABLE_X</source>
+      <translation>X</translation>
+    </message>
+    <message>
+      <source>TABLE_Y</source>
+      <translation>Y</translation>
+    </message>
+  </context>
+  <context>
+    <name>CurveCreator_Widget</name>
+    <message>
+      <source>SECTION_GROUP_TITLE</source>
+      <translation>断面</translation>
     </message>
     <message>
       <source>UNDO</source>
       <source>NEW_SECTION_TLT</source>
       <translation>新しい断面の挿入</translation>
     </message>
-    <message>
-      <source>INSERT_SECTION_BEFORE</source>
-      <translation>前に断面を挿入</translation>
-    </message>
-    <message>
-      <source>INSERT_SECTION_BEFORE_TLT</source>
-      <translation>前に断面を挿入</translation>
-    </message>
-    <message>
-      <source>INSERT_SECTION_AFTER</source>
-      <translation>後に断面の挿入</translation>
-    </message>
-    <message>
-      <source>INSERT_SECTION_AFTER_TLT</source>
-      <translation>後に断面の挿入</translation>
-    </message>
     <message>
       <source>ADDITION_MODE</source>
       <translation>追加モード</translation>
       <source>DETECTION_MODE_TLT</source>
       <translation>検出モード</translation>
     </message>
-    <message>
-      <source>INSERT_POINT_BEFORE</source>
-      <translation>前に点の挿入</translation>
-    </message>
-    <message>
-      <source>INSERT_POINT_BEFORE_TLT</source>
-      <translation>前に点の挿入</translation>
-    </message>
-    <message>
-      <source>INSERT_POINT_AFTER</source>
-      <translation>後に点の挿入</translation>
-    </message>
     <message>
       <source>CLOSE_SECTIONS</source>
       <translation>断面を閉じる</translation>
       <source>JOIN_TLT</source>
       <translation>選択した断面を結合</translation>
     </message>
-    <message>
-      <source>STEP_UP</source>
-      <translation>上昇</translation>
-    </message>
-    <message>
-      <source>STEP_UP_TLT</source>
-      <translation>選択したオブジェクトを上昇</translation>
-    </message>
-    <message>
-      <source>STEP_DOWN</source>
-      <translation>下降</translation>
-    </message>
-    <message>
-      <source>STEP_DOWN_TLT</source>
-      <translation>選択したオブジェクトを下降</translation>
-    </message>
     <message>
       <source>CLEAR_ALL</source>
       <translation>すべて消去</translation>
       <translation>すべての断面を結合</translation>
     </message>
   </context>
+  <context>
+    <name>EntityGUI_PolylineDlg</name>
+    <message>
+      <source>POLYLINE_DLG_TITLE</source>
+      <translation>ポリラインの構築</translation>
+    </message>
+    <message>
+      <source>POLYLINE_TITLE</source>
+      <translation>ポリライン</translation>
+    </message>
+    <message>
+      <source>POLYLINE_NAME</source>
+      <translation>Polyline</translation>
+    </message>
+    <message>
+      <source>POLYLINE_IMPORT</source>
+      <translation>ポリラインのインポート</translation>
+    </message>
+    <message>
+      <source>POLYLINE_ADD_SECTION</source>
+      <translation>断面の追加</translation>
+    </message>
+    <message>
+      <source>POLYLINE_EDIT_SECTION</source>
+      <translation>断面の編集</translation>
+    </message>
+  </context>
   <context>
     <name>EntityGUI_SketcherDlg</name>
     <message>
       <source>GEOM_ADD_THICKNESS</source>
       <translation>厚み追加(エッジまたはワイヤーのみ)</translation>
     </message>
-    <message>
-      <source>GEOM_TOWARDS_INSIDE</source>
-      <translation>内側に向かって厚く</translation>
-    </message>
   </context>
   <context>
     <name>GroupGUI</name>
       <source>TIME_CONSUMING</source>
       <translation>このオプションを有効にすると、特定のオブジェクトを時間の無駄が可能性があります。続行しますか。</translation>
     </message>
+    <message>
+      <source>WIDTH_FACTOR_TOL</source>
+      <translation>Width factor tol.</translation>
+    </message>
+    <message>
+      <source>VOLUME_TOL</source>
+      <translation>Volume tol.</translation>
+    </message>
+    <message>
+      <source>TO_MERGE_SOLIDS</source>
+      <translation>ソリッドのマージ 用</translation>
+    </message>
+    <message>
+      <source>SELECT_ALL</source>
+      <translation>すべて選択</translation>
+    </message>
   </context>
   <context>
     <name>GEOMToolsGUI_DeleteDlg</name>
       <source>GEOM_SHARED_SHAPE</source>
       <translation>Shared_%1</translation>
     </message>
+    <message>
+      <source>GEOM_SHARED_SHAPES_MULTISHARE</source>
+      <translation>すべてが共有する</translation>
+    </message>
   </context>
   <context>
     <name>GEOMToolsGUI_PublishDlg</name>
   <context>
     <name>GEOMToolsGUI_ReduceStudyDlg</name>
     <message>
-        <source>GEOM_REDUCE_STUDY_TITLE</source>
-        <translation type="unfinished">Reduce study</translation>
+      <source>GEOM_REDUCE_STUDY_TITLE</source>
+      <translation>スタディの削減</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_KEPT_OBJECTS</source>
-        <translation type="unfinished">Objects to be kept</translation>
+      <source>GEOM_REDUCE_STUDY_KEPT_OBJECTS</source>
+      <translation>保持されたオブジェクト</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_REMOVE_OBJECTS</source>
-        <translation type="unfinished">Objects to be removed</translation>
+      <source>GEOM_REDUCE_STUDY_REMOVE_OBJECTS</source>
+      <translation>削除されたオブジェクト</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_NAME</source>
-        <translation type="unfinished">Name</translation>
+      <source>GEOM_REDUCE_STUDY_NAME</source>
+      <translation>Name</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_OPTIONS</source>
-        <translation type="unfinished">Options</translation>
+      <source>GEOM_REDUCE_STUDY_OPTIONS</source>
+      <translation>オプション</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_INTERMEDIATES</source>
-        <translation type="unfinished">Intermediate objects</translation>
+      <source>GEOM_REDUCE_STUDY_INTERMEDIATES</source>
+      <translation>中間オブジェクト</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_SUB_OBJECTS</source>
-        <translation type="unfinished">Sub-objects</translation>
+      <source>GEOM_REDUCE_STUDY_SUB_OBJECTS</source>
+      <translation>サブオブジェクト</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_KEEP</source>
-        <translation type="unfinished">Keep</translation>
+      <source>GEOM_REDUCE_STUDY_KEEP</source>
+      <translation>保持</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_UNPUBLISH</source>
-        <translation type="unfinished">Unpublish</translation>
+      <source>GEOM_REDUCE_STUDY_UNPUBLISH</source>
+      <translation>非公開</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_REMOVE</source>
-        <translation type="unfinished">Remove</translation>
+      <source>GEOM_REDUCE_STUDY_REMOVE</source>
+      <translation>削除</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_REMOVE_EMPTY_FOLDER</source>
-        <translation type="unfinished">Remove empty folders</translation>
+      <source>GEOM_REDUCE_STUDY_REMOVE_EMPTY_FOLDER</source>
+      <translation>空フォルダの削除</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_SOFT_REMOVAL</source>
-        <translation type="unfinished">Soft removal</translation>
+      <source>GEOM_REDUCE_STUDY_SOFT_REMOVAL</source>
+      <translation>ソフト除去</translation>
     </message>
     <message>
-        <source>GEOM_REDUCE_STUDY_WARNING_DELETE</source>
-        <translation type="unfinished">Do you really want to delete intermediate objects? After applying this operation study will be broken.</translation>
+      <source>GEOM_REDUCE_STUDY_WARNING_DELETE</source>
+      <translation>本当に中間オブジェクトを削除しますか? この操作の適用後、スタディは無くなります。</translation>
     </message>
   </context>
   <context>
       <translation>UnionFaces</translation>
     </message>
   </context>
+  <context>
+    <name>RepairGUI_InspectObjectDlg</name>
+    <message>
+      <source>GEOM_INSPECT_OBJECT_TITLE</source>
+      <translation>オブジェクト点検</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_OBJECT_MAIN_SHAPE</source>
+      <translation>主形状</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_OBJECT_SHOW</source>
+      <translation>選択を表示</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_OBJECT_SHOW_ONLY</source>
+      <translation>選択のみを表示</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_OBJECT_HIDE</source>
+      <translation>選択を非表示</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_OBJECT_PUBLISH</source>
+      <translation>選択を公開</translation>
+    </message>
+    <message>
+      <source>GEOM_INSPECT_OBJECT_NAME</source>
+      <translation>名前</translation>
+    </message>
+  </context>
   <context>
     <name>GEOMGUI_CreationInfoWdg</name>
     <message>
       <translation>(有効情報なし)</translation>
     </message>
   </context>
+  <context>
+    <name>GEOMGUI_TextTreeWdg</name>
+    <message>
+      <source>TEXT_TREE_VIEW_TITLE</source>
+      <translation>テキスト</translation>
+    </message>
+    <message>
+      <source>TEXT_TREE_VIEW_NAME</source>
+      <translation>名前</translation>
+    </message>
+  </context>
   <context>
     <name>EntityGUI_IsolineDlg</name>
     <message>
       <translation>V-Isoline</translation>
     </message>
   </context>
+  <context>
+    <name>MeasureGUI_CheckSelfIntersectionsDlg</name>
+    <message>
+      <source>GEOM_CHECK_INTERSECT_TYPE</source>
+      <translation>自己交差検出型</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INTE_INTERSECTIONS</source>
+      <translation>自己交差</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INTE_SUBSHAPES</source>
+      <translation>サブ形状</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INTE_CHECK_LEVEL</source>
+      <translation>チェックのレベル</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INTE_SUMMARY</source>
+      <translation>サマリ</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INTE_COMPUTE</source>
+      <translation>自己交差の計算</translation>
+    </message>
+    <message>
+      <source>GEOM_SELF_INTERSECTION_NAME</source>
+      <translation>自己交差</translation>
+    </message>
+    <message>
+      <source>GEOM_NO_SELF_INTERSECTIONS</source>
+      <translation>形状内に自己交差はありません。</translation>
+    </message>
+    <message>
+      <source>GEOM_SELF_INTERSECTIONS_FOUND</source>
+      <translation>いくつかの自己交差が検出されました</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_SELF_INTERSECTIONS_FAILED</source>
+      <translation>自己交差の検出に失敗しました</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_SELF_INTERSECTIONS_ERRORS</source>
+      <translation>警告: 操作中にエラーが発生したため、リストは完成されません。</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INTE_V_V</source>
+      <translation>頂点から頂点</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INTE_V_E</source>
+      <translation>頂点からエッジ と上記すべて</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INTE_E_E</source>
+      <translation>エッジからエッジと上記すべて</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INTE_V_F</source>
+      <translation>頂点から面と上記すべて</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INTE_E_F</source>
+      <translation>エッジから面と上記すべて</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INTE_ALL</source>
+      <translation>面から面と上記すべて</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INT_DEFLECT</source>
+      <translation>偏向係数</translation>
+    </message>
+    <message>
+      <source>GEOM_CHECK_INT_DETECT_GAPS</source>
+      <translation>トレランスとのギャップ検出</translation>
+    </message>
+  </context>
+  <context>
+    <name>MeasureGUI_FastCheckIntersectionsDlg</name>
+    <message>
+      <source>GEOM_FAST_CHECK_INT_DEFLECT</source>
+      <translation>たわみ係数</translation>
+    </message>
+    <message>
+      <source>GEOM_FAST_CHECK_INT_DETECT_GAPS</source>
+      <translation>トレランスによるギャップ検出</translation>
+    </message>
+    <message>
+      <source>GEOM_FAST_CHECK_INT_SUBSHAPES</source>
+      <translation>オブジェクト %1 のサブ形状:</translation>
+    </message>
+    <message>
+      <source>GEOM_FAST_CHECK_INT_COMPUTE</source>
+      <translation>交点の計算</translation>
+    </message>
+    <message>
+      <source>GEOM_FAST_INTERSECTION_NAME</source>
+      <translation>クイック交点</translation>
+    </message>
+    <message>
+      <source>GEOM_FAST_INTERSECTION_FAILS</source>
+      <translation>交点はない</translation>
+    </message>
+    <message>
+      <source>GEOM_FAST_CHECK_OBJ</source>
+      <translation>オブジェクトと結果</translation>
+    </message>
+  </context>
+  <context>
+    <name>MeasureGUI_ShapeStatisticsDlg</name>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_TYPE</source>
+      <translation>タイプ</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_LENGTH</source>
+      <translation>エッジ長さ</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_AREA</source>
+      <translation>面の面積</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_VOLUME</source>
+      <translation>ソリッドの体積</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_NB_INTERVALS</source>
+      <translation>間隔数</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_SCALAR_RANGE</source>
+      <translation>スカラ範囲</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_COMPUTE</source>
+      <translation>計算</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_MIN</source>
+      <translation>Min</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_MAX</source>
+      <translation>Max</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_CREATE_GROUPS</source>
+      <translation>グループの作成</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_DISTRIBUTION_NB_ENT</source>
+      <translation>エンティティ数</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_MIN_ERROR</source>
+      <translation>範囲内最小の値をセットするかスカラ範囲のスイッチをOFFにしてください。</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_MAX_ERROR</source>
+      <translation>範囲内最大の値をセットするかスカラ範囲のスイッチをOFFにしてください。</translation>
+    </message>
+    <message>
+      <source>GEOM_SHAPE_STATISTICS_MIN_MAX_ERROR</source>
+      <translation>範囲内最小値が最大値より大きくすることはできません</translation>
+    </message>
+    <message>
+      <source>GEOM_MSG_GROUPS_CREATED</source>
+      <translation>%1 グループを作成しました。</translation>
+    </message>
+  </context>
+  <context>
+    <name>TransformationGUI_ExtensionDlg</name>
+    <message>
+      <source>GEOM_EXTENSION_TITLE</source>
+      <translation>エッジまたは面の拡張</translation>
+    </message>
+    <message>
+      <source>GEOM_EXTENSION</source>
+      <translation>拡張</translation>
+    </message>
+    <message>
+      <source>GEOM_EXTENSION_MIN</source>
+      <translation>第1パラメータ</translation>
+    </message>
+    <message>
+      <source>GEOM_EXTENSION_MAX</source>
+      <translation>最後のパラメータ</translation>
+    </message>
+    <message>
+      <source>GEOM_EXTENSION_MIN_U</source>
+      <translation>第1U-パラメータ</translation>
+    </message>
+    <message>
+      <source>GEOM_EXTENSION_MAX_U</source>
+      <translation>最後のU-パラメータ</translation>
+    </message>
+    <message>
+      <source>GEOM_EXTENSION_MIN_V</source>
+      <translation>第1V-パラメータ</translation>
+    </message>
+    <message>
+      <source>GEOM_EXTENSION_MAX_V</source>
+      <translation>最後のV-パラメータ</translation>
+    </message>
+    <message>
+      <source>GEOM_EXTENSION_EDGE_NAME</source>
+      <translation>ExtendedEdge</translation>
+    </message>
+    <message>
+      <source>GEOM_EXTENSION_FACE_NAME</source>
+      <translation>拡張面</translation>
+    </message>
+  </context>
+  <context>
+    <name>EntityGUI_SurfFromFaceDlg</name>
+    <message>
+      <source>GEOM_SURF_FROM_FACE_TITLE</source>
+      <translation>面から表面の作成</translation>
+    </message>
+    <message>
+      <source>GEOM_SURF_FROM_FACE</source>
+      <translation>面から表面</translation>
+    </message>
+    <message>
+      <source>GEOM_SURF_FROM_FACE_NAME</source>
+      <translation>SurfaceFromFace</translation>
+    </message>
+  </context>
+  <context>
+    <name>OperationGUI_TransferDataDlg</name>
+    <message>
+      <source>GEOM_TRANSFER_DATA_TITLE</source>
+      <translation>データ転送</translation>
+    </message>
+    <message>
+      <source>GEOM_TRANSFER_DATA</source>
+      <translation>データ転送</translation>
+    </message>
+    <message>
+      <source>GEOM_TRANSFER_DATA_FROM</source>
+      <translation>ソース形状</translation>
+    </message>
+    <message>
+      <source>GEOM_TRANSFER_DATA_TO</source>
+      <translation>行き先形状</translation>
+    </message>
+    <message>
+      <source>GEOM_TRANSFER_DATA_METHOD</source>
+      <translation>検出操作のタイプ</translation>
+    </message>
+    <message>
+      <source>GEOM_TD_METHOD_GETINPLACE</source>
+      <translation>場所の中で取得</translation>
+    </message>
+    <message>
+      <source>GEOM_TD_METHOD_GETINPLACE_OLD</source>
+      <translation>場所(旧)の中で取得</translation>
+    </message>
+    <message>
+      <source>GEOM_TD_METHOD_GETINPLACE_HISTORY</source>
+      <translation>履歴より場所の中で取得</translation>
+    </message>
+    <message>
+      <source>GEOM_TRANSFER_DATA_INFO</source>
+      <translation>データ転送: 情報</translation>
+    </message>
+    <message>
+      <source>GEOM_TRANSFER_DATA_NOT_COPIED</source>
+      <translation>コピーされたものはありません。</translation>
+    </message>
+    <message>
+      <source>GEOM_TRANSFER_DATA_COPIED</source>
+      <translation>以下のデータがコピーされます:</translation>
+    </message>
+    <message>
+      <source>GEOM_TRANSFER_DATA_NAMES</source>
+      <translation>名前: %2 の %1</translation>
+    </message>
+    <message>
+      <source>GEOM_TRANSFER_DATA_MATERIALS</source>
+      <translation>材料: %2 の %1</translation>
+    </message>
+  </context>
+  <context>
+    <name>TransformationGUI_ProjectionOnCylDlg</name>
+    <message>
+      <source>GEOM_PROJ_ON_CYL_TITLE</source>
+      <translation>円筒上に投影</translation>
+    </message>
+    <message>
+      <source>GEOM_PROJ_ON_CYL_START_ANGLE</source>
+      <translation>Starting angle</translation>
+    </message>
+    <message>
+      <source>GEOM_PROJ_ON_CYL_LENGTH_ANGLE</source>
+      <translation>Length angle</translation>
+    </message>
+    <message>
+      <source>GEOM_PROJ_ON_CYL_ROTATION_ANGLE</source>
+      <translation>回転角度</translation>
+    </message>
+  </context>
 </TS>
index c7e69aec226daf19ba5ee7a8b50e9a7ac759beaf..0d3f733a6bdea793139f3782842eb58bf3cb7b6f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -33,6 +33,7 @@
 #include "GEOMGUI_OCCSelector.h"
 #include "GEOMGUI_Selection.h"
 #include "GEOMGUI_CreationInfoWdg.h"
+#include "GEOMGUI_TextTreeWdg.h"
 #include "GEOMGUI_DimensionProperty.h"
 #include "GEOM_Constants.h"
 #include "GEOM_Displayer.h"
@@ -50,8 +51,6 @@
 #include <SUIT_Session.h>
 #include <SUIT_ViewManager.h>
 
-#include <PyInterp_Interp.h>
-
 #include <OCCViewer_ViewWindow.h>
 #include <OCCViewer_ViewPort3d.h>
 #include <OCCViewer_ViewModel.h>
@@ -65,7 +64,9 @@
 #include <SVTK_InteractorStyle.h>
 #include <SVTK_ViewModel.h>
 
+#ifndef DISABLE_GRAPHICSVIEW
 #include <GraphicsView_Viewer.h>
+#endif
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_DataObject.h>
@@ -86,6 +87,7 @@
 #include <SALOMEDS_SObject.hxx>
 
 #include <Basics_OCCTVersion.hxx>
+#include <QtxFontEdit.h>
 
 // External includes
 #include <QDir>
@@ -97,8 +99,8 @@
 #include <QString>
 #include <QPainter>
 #include <QSignalMapper>
+#include <QFontDatabase>
 
-#include <AIS_Drawer.hxx>
 #include <AIS_ListOfInteractive.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <NCollection_DataMap.hxx>
 
 #include <TColStd_HArray1OfByte.hxx>
+#include <TColStd_SequenceOfHAsciiString.hxx>
 
 #include <utilities.h>
 
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx>
 
+#include <Font_SystemFont.hxx>
+#include <Font_FontMgr.hxx>
+#include <TCollection_HAsciiString.hxx>
+
 #include "GEOM_version.h"
 #include "GEOMImpl_Types.hxx" // dangerous hxx (defines short-name macros) - include after all
 
@@ -219,6 +226,7 @@ GeometryGUI::GeometryGUI() :
   myLocalSelectionMode = GEOM_ALLOBJECTS;
 
   myCreationInfoWdg = 0;
+  myTextTreeWdg = 0;
 
   connect( Material_ResourceMgr::resourceMgr(), SIGNAL( changed() ), this, SLOT( updateMaterials() ) );
 
@@ -430,7 +438,11 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   SUIT_ViewWindow* window = desk->activeWindow();
   bool ViewOCC = ( window && window->getViewManager()->getType() == OCCViewer_Viewer::Type() );
   bool ViewVTK = ( window && window->getViewManager()->getType() == SVTK_Viewer::Type() );
+#ifndef DISABLE_GRAPHICSVIEW
   bool ViewDep = ( window && window->getViewManager()->getType() == GraphicsView_Viewer::Type() );
+#else
+  bool ViewDep = 0;
+#endif
   // if current viewframe is not of OCC and not of VTK type - return immediately
   // fix for IPAL8958 - allow some commands to execute even when NO viewer is active (rename for example)
   QList<int> NotViewerDependentCommands;
@@ -471,7 +483,9 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpSelectCompound:     // POPUP MENU - SELECT ONLY - COMPOUND
   case GEOMOp::OpSelectAll:          // POPUP MENU - SELECT ONLY - SELECT ALL
   case GEOMOp::OpDelete:             // MENU EDIT - DELETE
+#ifndef DISABLE_PYCONSOLE
   case GEOMOp::OpCheckGeom:          // MENU TOOLS - CHECK GEOMETRY
+#endif
   case GEOMOp::OpMaterialsLibrary:   // MENU TOOLS - MATERIALS LIBRARY
   case GEOMOp::OpDeflection:         // POPUP MENU - DEFLECTION COEFFICIENT
   case GEOMOp::OpColor:              // POPUP MENU - COLOR
@@ -498,7 +512,9 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpClsBringToFront:    //
   case GEOMOp::OpCreateFolder:       // POPUP MENU - CREATE FOLDER
   case GEOMOp::OpSortChildren:       // POPUP MENU - SORT CHILD ITEMS
+#ifndef DISABLE_GRAPHICSVIEW
   case GEOMOp::OpShowDependencyTree: // POPUP MENU - SHOW DEPENDENCY TREE
+#endif
   case GEOMOp::OpReduceStudy:        // POPUP MENU - REDUCE STUDY
     libName = "GEOMToolsGUI";
     break;
@@ -514,12 +530,14 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpShow:               // MENU VIEW - DISPLAY
   case GEOMOp::OpSwitchVectors:      // MENU VIEW - VECTOR MODE
   case GEOMOp::OpSwitchVertices:     // MENU VIEW - VERTICES MODE
+  case GEOMOp::OpSwitchName:         // MENU VIEW - VERTICES MODE
   case GEOMOp::OpWireframe:          // POPUP MENU - WIREFRAME
   case GEOMOp::OpShading:            // POPUP MENU - SHADING
   case GEOMOp::OpShadingWithEdges:   // POPUP MENU - SHADING WITH EDGES
   case GEOMOp::OpTexture:            // POPUP MENU - TEXTURE
   case GEOMOp::OpVectors:            // POPUP MENU - VECTORS
   case GEOMOp::OpVertices:           // POPUP MENU - VERTICES
+  case GEOMOp::OpShowName:           // POPUP MENU - SHOW NAME
     libName = "DisplayGUI";
     break;
   case GEOMOp::OpPoint:              // MENU BASIC - POINT
@@ -547,12 +565,14 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpFilling:            // MENU GENERATION - FILLING
   case GEOMOp::OpPipe:               // MENU GENERATION - PIPE
   case GEOMOp::OpPipePath:           // MENU GENERATION - RESTORE PATH
+  case GEOMOp::OpThickness:          // MENU GENERATION - THICKNESS
     libName = "GenerationGUI";
     break;
   case GEOMOp::Op2dSketcher:         // MENU ENTITY - SKETCHER
   case GEOMOp::Op3dSketcher:         // MENU ENTITY - 3D SKETCHER
   case GEOMOp::OpIsoline:            // MENU BASIC  - ISOLINE
   case GEOMOp::OpExplode:            // MENU ENTITY - EXPLODE
+  case GEOMOp::OpSurfaceFromFace:    // MENU ENTITY - SURFACE FROM FACE
 #ifdef WITH_OPENCV
   case GEOMOp::OpFeatureDetect:      // MENU ENTITY - FEATURE DETECTION
 #endif
@@ -584,9 +604,11 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpScale:              // MENU TRANSFORMATION - SCALE
   case GEOMOp::OpOffset:             // MENU TRANSFORMATION - OFFSET
   case GEOMOp::OpProjection:         // MENU TRANSFORMATION - PROJECTION
+  case GEOMOp::OpProjOnCyl:          // MENU TRANSFORMATION - PROJECTION ON CYLINDER
   case GEOMOp::OpMultiTranslate:     // MENU TRANSFORMATION - MULTI-TRANSLATION
   case GEOMOp::OpMultiRotate:        // MENU TRANSFORMATION - MULTI-ROTATION
   case GEOMOp::OpReimport:           // CONTEXT(POPUP) MENU - RELOAD_IMPORTED
+  case GEOMOp::OpExtension:          // MENU TRANSFORMATION - EXTENSION
     libName = "TransformationGUI";
     break;
   case GEOMOp::OpPartition:          // MENU OPERATION - PARTITION
@@ -600,6 +622,7 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpSharedShapes:       // MENU OPERATION - GET SHARED SHAPES
   case GEOMOp::OpExtrudedBoss:       // MENU OPERATION - EXTRUDED BOSS
   case GEOMOp::OpExtrudedCut:        // MENU OPERATION - EXTRUDED CUT
+  case GEOMOp::OpTransferData:       // MENU OPERATION - TRANSFER DATA
     libName = "OperationGUI";
     break;
   case GEOMOp::OpSewing:             // MENU REPAIR - SEWING
@@ -619,6 +642,7 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpRemoveExtraEdges:   // MENU REPAIR - REMOVE EXTRA EDGES
   case GEOMOp::OpFuseEdges:          // MENU REPAIR - FUSE COLLINEAR EDGES
   case GEOMOp::OpUnionFaces:         // MENU REPAIR - UNION FACES
+  case GEOMOp::OpInspectObj:         // MENU REPAIR - INSPECT OBJECT
     libName = "RepairGUI";
     break;
   case GEOMOp::OpProperties:         // MENU MEASURE - PROPERTIES
@@ -635,7 +659,11 @@ void GeometryGUI::OnGUIEvent( int id, const QVariant& theParam )
   case GEOMOp::OpGetNonBlocks:       // MENU MEASURE - Get NON BLOCKS
   case GEOMOp::OpPointCoordinates:   // MENU MEASURE - POINT COORDINATES
   case GEOMOp::OpCheckSelfInters:    // MENU MEASURE - CHECK SELF INTERSECTIONS
+  case GEOMOp::OpFastCheckInters:    // MENU MEASURE - FAST CHECK INTERSECTIONS
   case GEOMOp::OpManageDimensions:   // MENU MEASURE - MANAGE DIMENSIONS
+#ifndef DISABLE_PLOT2DVIEWER
+  case GEOMOp::OpShapeStatistics:    // MENU MEASURE - SHAPE STATISTICS
+#endif
   case GEOMOp::OpShowAllDimensions:  // POPUP MENU - SHOW ALL DIMENSIONS
   case GEOMOp::OpHideAllDimensions:  // POPUP MENU - HIDE ALL DIMENSIONS
     libName = "MeasureGUI";
@@ -870,6 +898,11 @@ void GeometryGUI::createOriginAndBaseVectors()
         GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOX, "OX" );
         GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOY, "OY" );
         GetGeomGen()->PublishInStudy( aDSStudy, SALOMEDS::SObject::_nil(), anOZ, "OZ" );
+        anOrigin->UnRegister();
+        anOX->UnRegister();
+        anOY->UnRegister();
+        anOZ->UnRegister();
+        aBasicOperations->UnRegister();
 
         getApp()->updateObjectBrowser( true );
       }
@@ -900,6 +933,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpPlane,      "PLANE" );
   createGeomAction( GEOMOp::OpLCS,        "LOCAL_CS" );
   createGeomAction( GEOMOp::OpOriginAndVectors, "ORIGIN_AND_VECTORS" );
+  createGeomAction( GEOMOp::OpSurfaceFromFace,  "SURFACE_FROM_FACE" );
 
   createGeomAction( GEOMOp::OpBox,        "BOX" );
   createGeomAction( GEOMOp::OpCylinder,   "CYLINDER" );
@@ -914,6 +948,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpFilling,     "FILLING" );
   createGeomAction( GEOMOp::OpPipe,        "PIPE" );
   createGeomAction( GEOMOp::OpPipePath,    "PIPE_PATH" );
+  createGeomAction( GEOMOp::OpThickness,   "THICKNESS" );
 
   createGeomAction( GEOMOp::OpGroupCreate, "GROUP_CREATE" );
   createGeomAction( GEOMOp::OpGroupEdit,   "GROUP_EDIT" );
@@ -931,7 +966,6 @@ void GeometryGUI::initialize( CAM_Application* app )
 
   createGeomAction( GEOMOp::Op2dSketcher,  "SKETCH" );
   createGeomAction( GEOMOp::Op3dSketcher,  "3DSKETCH" );
-  createGeomAction( GEOMOp::OpIsoline,     "ISOLINE" );
   createGeomAction( GEOMOp::OpExplode,     "EXPLODE" );
 #ifdef WITH_OPENCV
   createGeomAction( GEOMOp::OpFeatureDetect,"FEATURE_DETECTION" );
@@ -958,8 +992,10 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpScale,          "SCALE" );
   createGeomAction( GEOMOp::OpOffset,         "OFFSET" );
   createGeomAction( GEOMOp::OpProjection,     "PROJECTION" );
+  createGeomAction( GEOMOp::OpProjOnCyl,      "PROJ_ON_CYL" );
   createGeomAction( GEOMOp::OpMultiTranslate, "MUL_TRANSLATION" );
   createGeomAction( GEOMOp::OpMultiRotate,    "MUL_ROTATION" );
+  createGeomAction( GEOMOp::OpExtension,      "EXTENSION" );
 
   createGeomAction( GEOMOp::OpPartition,      "PARTITION" );
   createGeomAction( GEOMOp::OpArchimede,      "ARCHIMEDE" );
@@ -968,6 +1004,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   //createGeomAction( GEOMOp::OpClipping,        "CLIPPING" );
   createGeomAction( GEOMOp::OpShapesOnShape,  "GET_SHAPES_ON_SHAPE" );
   createGeomAction( GEOMOp::OpSharedShapes,   "GET_SHARED_SHAPES" );
+  createGeomAction( GEOMOp::OpTransferData,   "TRANSFER_DATA" );
   createGeomAction( GEOMOp::OpExtrudedCut,    "EXTRUDED_CUT" );
   createGeomAction( GEOMOp::OpExtrudedBoss,   "EXTRUDED_BOSS" );
   createGeomAction( GEOMOp::OpFillet1d,       "FILLET_1D" );
@@ -994,6 +1031,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpRemoveExtraEdges, "REMOVE_EXTRA_EDGES" );
   createGeomAction( GEOMOp::OpFuseEdges,        "FUSE_EDGES" );
   createGeomAction( GEOMOp::OpUnionFaces,       "UNION_FACES" );
+  createGeomAction( GEOMOp::OpInspectObj,       "INSPECT_OBJECT" );
 
   createGeomAction( GEOMOp::OpPointCoordinates, "POINT_COORDS" );
   createGeomAction( GEOMOp::OpProperties,       "BASIC_PROPS" );
@@ -1011,9 +1049,15 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpCheckCompound,    "CHECK_COMPOUND" );
   createGeomAction( GEOMOp::OpGetNonBlocks,     "GET_NON_BLOCKS" );
   createGeomAction( GEOMOp::OpCheckSelfInters,  "CHECK_SELF_INTERSECTIONS" );
+  createGeomAction( GEOMOp::OpFastCheckInters,  "FAST_CHECK_INTERSECTIONS" );
+#ifndef DISABLE_PLOT2DVIEWER
+  createGeomAction( GEOMOp::OpShapeStatistics,  "SHAPE_STATISTICS" );
+#endif
 
+#ifndef DISABLE_PYCONSOLE
 #ifdef _DEBUG_ // PAL16821
   createGeomAction( GEOMOp::OpCheckGeom,        "CHECK_GEOMETRY" );
+#endif
 #endif
 
   createGeomAction( GEOMOp::OpMaterialsLibrary,   "MATERIALS_LIBRARY" );
@@ -1026,6 +1070,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpShow,             "DISPLAY" );
   createGeomAction( GEOMOp::OpSwitchVectors,    "VECTOR_MODE");
   createGeomAction( GEOMOp::OpSwitchVertices,   "VERTICES_MODE");
+  createGeomAction( GEOMOp::OpSwitchName,       "NAME_MODE");
   createGeomAction( GEOMOp::OpSelectVertex,     "VERTEX_SEL_ONLY" ,"", 0, true );
   createGeomAction( GEOMOp::OpSelectEdge,       "EDGE_SEL_ONLY", "", 0, true );
   createGeomAction( GEOMOp::OpSelectWire,       "WIRE_SEL_ONLY", "",  0, true );
@@ -1048,6 +1093,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpIsosWidth,        "ISOS_WIDTH");
   createGeomAction( GEOMOp::OpVectors,          "POP_VECTORS", "", 0, true );
   createGeomAction( GEOMOp::OpVertices,         "POP_VERTICES", "", 0, true );
+  createGeomAction( GEOMOp::OpShowName,         "POP_SHOW_NAME", "", 0, true );
   createGeomAction( GEOMOp::OpDeflection,       "POP_DEFLECTION" );
   createGeomAction( GEOMOp::OpColor,            "POP_COLOR" );
   createGeomAction( GEOMOp::OpSetTexture,       "POP_SETTEXTURE" );
@@ -1066,7 +1112,9 @@ void GeometryGUI::initialize( CAM_Application* app )
   createGeomAction( GEOMOp::OpPredefMaterCustom,    "POP_PREDEF_MATER_CUSTOM" );
   createGeomAction( GEOMOp::OpCreateFolder, "POP_CREATE_FOLDER" );
   createGeomAction( GEOMOp::OpSortChildren, "POP_SORT_CHILD_ITEMS" );
+#ifndef DISABLE_GRAPHICSVIEW
   createGeomAction( GEOMOp::OpShowDependencyTree, "POP_SHOW_DEPENDENCY_TREE" );
+#endif
   createGeomAction( GEOMOp::OpReduceStudy,       "POP_REDUCE_STUDY" );
   createGeomAction( GEOMOp::OpShowAllDimensions, "POP_SHOW_ALL_DIMENSIONS" );
   createGeomAction( GEOMOp::OpHideAllDimensions, "POP_HIDE_ALL_DIMENSIONS" );
@@ -1109,6 +1157,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( GEOMOp::Op2dPolylineEditor, basicId, -1 );
   createMenu( GEOMOp::Op3dSketcher,       basicId, -1 );
   createMenu( GEOMOp::OpIsoline,          basicId, -1 );
+  createMenu( GEOMOp::OpSurfaceFromFace, basicId, -1 );
   createMenu( separator(),                basicId, -1 );
   createMenu( GEOMOp::OpVector,           basicId, -1 );
   createMenu( GEOMOp::OpPlane,            basicId, -1 );
@@ -1131,6 +1180,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( GEOMOp::OpFilling,    genId, -1 );
   createMenu( GEOMOp::OpPipe,       genId, -1 );
   createMenu( GEOMOp::OpPipePath,   genId, -1 );
+  createMenu( GEOMOp::OpThickness,  genId, -1 );
 
   //int advId = createMenu( tr( "MEN_ADVANCED" ), newEntId, -1 );
   //createMenu( GEOMOp::OpSmoothingSurface, advId, -1 );
@@ -1194,6 +1244,8 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( GEOMOp::OpScale,          transId, -1 );
   createMenu( GEOMOp::OpOffset,         transId, -1 );
   createMenu( GEOMOp::OpProjection,     transId, -1 );
+  createMenu( GEOMOp::OpExtension,      transId, -1 );
+  createMenu( GEOMOp::OpProjOnCyl,      transId, -1 );
   createMenu( separator(),              transId, -1 );
   createMenu( GEOMOp::OpMultiTranslate, transId, -1 );
   createMenu( GEOMOp::OpMultiRotate,    transId, -1 );
@@ -1209,6 +1261,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( GEOMOp::OpArchimede,     operId, -1 );
   createMenu( GEOMOp::OpShapesOnShape, operId, -1 );
   createMenu( GEOMOp::OpSharedShapes,  operId, -1 );
+  createMenu( GEOMOp::OpTransferData,  operId, -1 );
 
   createMenu( separator(), operId, -1 );
 
@@ -1265,11 +1318,18 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( GEOMOp::OpCheckCompound,   measurId, -1 );
   createMenu( GEOMOp::OpGetNonBlocks,    measurId, -1 );
   createMenu( GEOMOp::OpCheckSelfInters, measurId, -1 );
+  createMenu( GEOMOp::OpFastCheckInters, measurId, -1 );
+  createMenu( GEOMOp::OpInspectObj,      measurId, -1 );
+#ifndef DISABLE_PLOT2DVIEWER
+  createMenu( GEOMOp::OpShapeStatistics, measurId, -1 );
+#endif
 
   int toolsId = createMenu( tr( "MEN_TOOLS" ), -1, -1, 50 );
+#ifndef DISABLE_PYCONSOLE
 #if defined(_DEBUG_) || defined(_DEBUG) // PAL16821
   createMenu( separator(),         toolsId, -1 );
   createMenu( GEOMOp::OpCheckGeom, toolsId, -1 );
+#endif
 #endif
 
   createMenu( separator(),         toolsId, -1 );
@@ -1287,6 +1347,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createMenu( separator(),                  dispmodeId, -1 );
   createMenu( GEOMOp::OpSwitchVectors,      dispmodeId, -1 );
   createMenu( GEOMOp::OpSwitchVertices,     dispmodeId, -1 );
+  createMenu( GEOMOp::OpSwitchName,         dispmodeId, -1 );
 
   createMenu( separator(),       viewId, -1 );
   createMenu( GEOMOp::OpShowAll, viewId, -1 );
@@ -1319,6 +1380,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createTool( GEOMOp::Op2dPolylineEditor, basicTbId ); 
   createTool( GEOMOp::Op3dSketcher,       basicTbId ); //rnc
   createTool( GEOMOp::OpIsoline,          basicTbId );
+  createTool( GEOMOp::OpSurfaceFromFace,  basicTbId );
   createTool( GEOMOp::OpPlane,            basicTbId );
   createTool( GEOMOp::OpLCS,              basicTbId );
   createTool( GEOMOp::OpOriginAndVectors, basicTbId );
@@ -1353,6 +1415,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createTool( GEOMOp::OpFilling,    genTbId );
   createTool( GEOMOp::OpPipe,       genTbId );
   createTool( GEOMOp::OpPipePath,   genTbId );
+  createTool( GEOMOp::OpThickness,  genTbId );
 
   int transTbId = createTool( tr( "TOOL_TRANSFORMATION" ), QString( "GEOMTransformation" ) );
   createTool( GEOMOp::OpTranslate,      transTbId );
@@ -1362,6 +1425,8 @@ void GeometryGUI::initialize( CAM_Application* app )
   createTool( GEOMOp::OpScale,          transTbId );
   createTool( GEOMOp::OpOffset,         transTbId );
   createTool( GEOMOp::OpProjection,     transTbId );
+  createTool( GEOMOp::OpExtension,      transTbId );
+  createTool( GEOMOp::OpProjOnCyl,      transTbId );
   createTool( separator(),              transTbId );
   createTool( GEOMOp::OpMultiTranslate, transTbId );
   createTool( GEOMOp::OpMultiRotate,    transTbId );
@@ -1372,6 +1437,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createTool( GEOMOp::OpArchimede,       operTbId );
   createTool( GEOMOp::OpShapesOnShape,   operTbId );
   createTool( GEOMOp::OpSharedShapes,    operTbId );
+  createTool( GEOMOp::OpTransferData,    operTbId );
 
   int featTbId = createTool( tr( "TOOL_FEATURES" ), QString( "GEOMModification" ) );
   createTool( GEOMOp::OpFillet1d,        featTbId );
@@ -1409,6 +1475,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   createTool( GEOMOp::OpCheckCompound,    measureTbId );
   createTool( GEOMOp::OpGetNonBlocks,     measureTbId );
   createTool( GEOMOp::OpCheckSelfInters,  measureTbId );
+  createTool( GEOMOp::OpFastCheckInters,  measureTbId );
 
   int picturesTbId = createTool( tr( "TOOL_PICTURES" ), QString( "GEOMPictures" ) );
   createTool( GEOMOp::OpPictureImport,    picturesTbId );
@@ -1433,7 +1500,7 @@ void GeometryGUI::initialize( CAM_Application* app )
   QString clientOCCorOB_AndSomeVisible = clientOCCorOB + " and selcount>0 and isVisible";
 
   QString autoColorPrefix =
-    "(client='ObjectBrowser' or client='OCCViewer') and type='Shape' and selcount=1 and isOCC=true";
+    "(client='ObjectBrowser' or client='OCCViewer' or client='VTKViewer') and type='Shape' and selcount=1";
 
   QtxPopupMgr* mgr = popupMgr();
 
@@ -1480,6 +1547,9 @@ void GeometryGUI::initialize( CAM_Application* app )
   mgr->insert( action(  GEOMOp::OpVertices ), dispmodeId, -1 ); // vertices
   mgr->setRule( action( GEOMOp::OpVertices ), clientOCCorVTK_AndSomeVisible  + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule );
   mgr->setRule( action( GEOMOp::OpVertices ), clientOCCorVTK + " and isVerticesMode", QtxPopupMgr::ToggleRule );
+  mgr->insert( action(  GEOMOp::OpShowName ), dispmodeId, -1 ); // show name
+  mgr->setRule( action( GEOMOp::OpShowName ), clientOCCorVTK_AndSomeVisible  + " and ($component={'GEOM'})", QtxPopupMgr::VisibleRule );
+  mgr->setRule( action( GEOMOp::OpShowName ), clientOCCorVTK + " and isNameMode", QtxPopupMgr::ToggleRule );
   mgr->insert( separator(), -1, -1 );     // -----------
 
   mgr->insert( action(  GEOMOp::OpColor ), -1, -1 ); // color
@@ -1588,9 +1658,11 @@ void GeometryGUI::initialize( CAM_Application* app )
   mgr->insert( action(  GEOMOp::OpSortChildren ), -1, -1 ); // Sort child items
   mgr->setRule( action( GEOMOp::OpSortChildren ), QString("client='ObjectBrowser' and $component={'GEOM'} and nbChildren>1"), QtxPopupMgr::VisibleRule );
 
+#ifndef DISABLE_GRAPHICSVIEW
   mgr->insert( separator(), -1, -1 );     // -----------
   mgr->insert( action(  GEOMOp::OpShowDependencyTree ), -1, -1 ); // Show dependency tree
   mgr->setRule( action( GEOMOp::OpShowDependencyTree ), clientOCCorVTKorOB + " and selcount>0 and ($component={'GEOM'}) and type='Shape'", QtxPopupMgr::VisibleRule );
+#endif
 
   mgr->insert( separator(), -1, -1 );     // -----------
   mgr->insert( action(  GEOMOp::OpReduceStudy ), -1, -1 ); // Reduce Study
@@ -1641,7 +1713,7 @@ void GeometryGUI::addPluginActions()
       // icon
       QPixmap icon;
       if ( !adata.icon.empty() )
-       icon = resMgr->loadPixmap( pdata.name.c_str(), adata.icon.c_str() );
+        icon = resMgr->loadPixmap( pdata.name.c_str(), adata.icon.c_str() );
       // menu text (path)
       QStringList smenus = QString( adata.menuText.c_str() ).split( "/" );
       QString actionName = smenus.last();
@@ -1658,30 +1730,30 @@ void GeometryGUI::addPluginActions()
       actionStat = actionStat.toUpper().prepend( "STB_" );
 
       createAction( id, // ~ adata.label
-                   tr( actionTool.toLatin1().constData() ),
-                   icon,
-                   tr( actionName.toLatin1().constData() ),
-                   tr( actionStat.toLatin1().constData() ),
-                   QKeySequence( tr( adata.accel.c_str() ) ),
-                   application()->desktop(),
-                   false /*toggle*/,
-                   this, SLOT( OnGUIEvent() ),
-                   QString() /*shortcutAction*/ );
+                    tr( actionTool.toLatin1().constData() ),
+                    icon,
+                    tr( actionName.toLatin1().constData() ),
+                    tr( actionStat.toLatin1().constData() ),
+                    QKeySequence( tr( adata.accel.c_str() ) ),
+                    application()->desktop(),
+                    false /*toggle*/,
+                    this, SLOT( OnGUIEvent() ),
+                    QString() /*shortcutAction*/ );
       
       int menuId = -1;
       foreach ( QString subMenu, smenus ) {
-       QStringList subMenuList = subMenu.split( ":" );
-       QString subMenuName = subMenuList[0].toUpper().prepend( "MEN_" );
-       int subMenuGroup = subMenuList.size() > 1 ? subMenuList[1].toInt() : -1;
-       menuId = createMenu( tr( subMenuName.toLatin1().constData() ), menuId, -1, subMenuGroup );
+        QStringList subMenuList = subMenu.split( ":" );
+        QString subMenuName = subMenuList[0].toUpper().prepend( "MEN_" );
+        int subMenuGroup = subMenuList.size() > 1 ? subMenuList[1].toInt() : -1;
+        menuId = createMenu( tr( subMenuName.toLatin1().constData() ), menuId, -1, subMenuGroup );
       }
       createMenu( id, menuId, -1 );
       
       if ( !stools.isEmpty() ) {
-       QString subTool = stools[0];
-       subTool = subTool.toUpper().prepend( "TOOL_" );
-       int toolId = createTool( tr( subTool.toLatin1().constData() ) );
-       createTool(id, toolId);
+        QString subTool = stools[0];
+        subTool = subTool.toUpper().prepend( "TOOL_" );
+        int toolId = createTool( tr( subTool.toLatin1().constData() ) );
+        createTool(id, toolId);
       }
 
       // add action id to map
@@ -1711,17 +1783,18 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
 
   // import Python module that manages GEOM plugins (need to be here because SalomePyQt API uses active module)
   PyGILState_STATE gstate = PyGILState_Ensure();
-  PyObjWrapper pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager");
+  PyObject* pluginsmanager = PyImport_ImportModuleNoBlock((char*)"salome_pluginsmanager");
   if ( !pluginsmanager ) {
     PyErr_Print();
   }
   else {
-    PyObjWrapper result =
+    PyObject* result =
       PyObject_CallMethod(pluginsmanager, (char*)"initialize", (char*)"isss", 1, "geom",
-                          tr("MEN_NEW_ENTITY").toStdString().c_str(),
-                          tr("GEOM_PLUGINS_OTHER").toStdString().c_str());
+                          tr("MEN_NEW_ENTITY").toUtf8().data(),
+                          tr("GEOM_PLUGINS_OTHER").toUtf8().data());
     if ( !result )
       PyErr_Print();
+    Py_XDECREF(result);
   }
   PyGILState_Release(gstate);
   // end of GEOM plugins loading
@@ -1747,6 +1820,11 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
   getApp()->insertDockWindow( myCreationInfoWdg->getWinID(), myCreationInfoWdg );
   getApp()->placeDockWindow( myCreationInfoWdg->getWinID(), Qt::LeftDockWidgetArea );
 
+  if ( !myTextTreeWdg )
+    myTextTreeWdg = new GEOMGUI_TextTreeWdg( getApp() );
+  getApp()->insertDockWindow( myTextTreeWdg->getWinID(), myTextTreeWdg );
+  getApp()->placeDockWindow( myTextTreeWdg->getWinID(), Qt::LeftDockWidgetArea );
+
   //NPAL 19674
   SALOME_ListIO selected;
   sm->selectedObjects( selected );
@@ -1785,6 +1863,7 @@ bool GeometryGUI::activateModule( SUIT_Study* study )
     }
   }
 
+  Py_XDECREF(pluginsmanager);
   return true;
 }
 
@@ -1808,8 +1887,15 @@ bool GeometryGUI::deactivateModule( SUIT_Study* study )
 
   disconnect( selMrg, SIGNAL( currentSelectionChanged() ), this, SLOT( updateCreationInfo() ));
   disconnect( selMrg, SIGNAL( currentSelectionChanged() ), this, SLOT( updateFieldColorScale() ));
-  getApp()->removeDockWindow( myCreationInfoWdg->getWinID() );
-  myCreationInfoWdg = 0;
+  if ( myCreationInfoWdg ) {
+    getApp()->removeDockWindow( myCreationInfoWdg->getWinID() );
+    myCreationInfoWdg = 0;
+  }
+  if ( myTextTreeWdg ) {
+    getApp()->removeDockWindow( myTextTreeWdg->getWinID() );
+    disconnect( application(), 0, myTextTreeWdg, 0 );
+    myTextTreeWdg = 0;
+  }
 
   EmitSignalCloseAllDialogs();
 
@@ -1840,8 +1926,8 @@ void GeometryGUI::onWindowActivated( SUIT_ViewWindow* win )
   if ( !win )
     return;
 
-  const bool ViewOCC = ( win->getViewManager()->getType() == OCCViewer_Viewer::Type() );
-  //const bool ViewVTK = ( win->getViewManager()->getType() == SVTK_Viewer::Type() );
+  const bool ViewOCC = ( win->getViewManager() ? win->getViewManager()->getType() == OCCViewer_Viewer::Type() : false );
+  //const bool ViewVTK = ( win->getViewManager() ? win->getViewManager()->getType() == SVTK_Viewer::Type() : false );
 
   // disable non-OCC viewframe menu commands
 //  action( GEOMOp::Op2dSketcher )->setEnabled( ViewOCC ); // SKETCHER
@@ -1864,9 +1950,13 @@ void GeometryGUI::windows( QMap<int, int>& mappa ) const
 {
   mappa.insert( SalomeApp_Application::WT_ObjectBrowser, Qt::LeftDockWidgetArea );
   mappa.insert( SalomeApp_Application::WT_NoteBook, Qt::LeftDockWidgetArea );
+#ifndef DISABLE_PYCONSOLE
   mappa.insert( SalomeApp_Application::WT_PyConsole, Qt::BottomDockWidgetArea );
+#endif
   if ( myCreationInfoWdg )
     mappa.insert( myCreationInfoWdg->getWinID(), Qt::LeftDockWidgetArea );
+  if ( myTextTreeWdg )
+    mappa.insert( myTextTreeWdg->getWinID(), Qt::LeftDockWidgetArea );
 }
 
 void GeometryGUI::viewManagers( QStringList& lst ) const
@@ -1982,38 +2072,15 @@ void GeometryGUI::updateCreationInfo()
   // pass creation info of geomObj to myCreationInfoWdg
 
   if ( myCreationInfoWdg ) {
-    QPixmap icon;
-    QString operationName;
-    myCreationInfoWdg->setOperation( icon, operationName );
 
+    GEOM::CreationInformationSeq_var info;
     try {
       OCC_CATCH_SIGNALS;
-      GEOM::CreationInformation_var info = geomObj->GetCreationInformation();
-      if ( &info.in() ) {
-        SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-        QString name = info->operationName.in();
-        if ( !name.isEmpty() ) {
-         
-         QString plugin_name;
-          for ( size_t i = 0; i < info->params.length(); ++i ) {
-            myCreationInfoWdg->addParam( info->params[i].name.in(),
-                                         info->params[i].value.in() );
-            QString value = info->params[i].name.in();
-           if( value == PLUGIN_NAME ) {
-             plugin_name = info->params[i].value.in();
-           }
-         }
-         QString prefix = plugin_name.isEmpty() ? "GEOM" : plugin_name;
-          icon = resMgr->loadPixmap( prefix, tr( ("ICO_"+name).toLatin1().constData() ), false );
-          operationName = tr( ("MEN_"+name).toLatin1().constData() );
-          if ( operationName.startsWith( "MEN_" ))
-            operationName = name; // no translation
-          myCreationInfoWdg->setOperation( icon, operationName );
-        }
-      }
+      info = geomObj->GetCreationInformation();
     }
     catch (...) {
     }
+    myCreationInfoWdg->setInfo( info );
   }
 }
 
@@ -2201,6 +2268,8 @@ void GeometryGUI::OnSetMaterial(const QString& theName)
 
 void GeometryGUI::createPreferences()
 {
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+
   int tabId = addPreference( tr( "PREF_TAB_SETTINGS" ) );
 
   int genGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), tabId );
@@ -2231,6 +2300,11 @@ void GeometryGUI::createPreferences()
   addPreference( tr( "PREF_ISOS_COLOR" ), genGroup,
                  LightApp_Preferences::Color, "Geometry", "isos_color" );
 
+  addPreference( tr( "PREF_LABEL_COLOR" ), genGroup,
+                 LightApp_Preferences::Color, "Geometry", "label_color" );
+
+  addPreference( "", genGroup, LightApp_Preferences::Space );
+
   addPreference( tr( "PREF_TOPLEVEL_COLOR" ), genGroup,
                  LightApp_Preferences::Color, "Geometry", "toplevel_color" );
 
@@ -2238,7 +2312,7 @@ void GeometryGUI::createPreferences()
                       LightApp_Preferences::Selector, "Geometry", "toplevel_dm" );
 
   int transparency = addPreference( tr( "PREF_TRANSPARENCY" ), genGroup,
-                                   LightApp_Preferences::IntSpin, "Geometry", "transparency" );
+                                    LightApp_Preferences::IntSpin, "Geometry", "transparency" );
 
   int defl = addPreference( tr( "PREF_DEFLECTION" ), genGroup,
                             LightApp_Preferences::DblSpin, "Geometry", "deflection_coeff" );
@@ -2292,12 +2366,36 @@ void GeometryGUI::createPreferences()
   setPreferenceProperty( aDimLineWidthId, "min", 1 );
   setPreferenceProperty( aDimLineWidthId, "max", 5 );
 
-  int aDimFontHeightId = addPreference( tr( "PREF_DIMENSIONS_FONT_HEIGHT" ), aDimGroupId,
-                                        LightApp_Preferences::DblSpin, "Geometry", "dimensions_font_height" );
-
-  setPreferenceProperty( aDimFontHeightId, "min", 1e-9 );
-  setPreferenceProperty( aDimFontHeightId, "max", 1e+9 );
-  setPreferenceProperty( aDimFontHeightId, "precision", 9 );
+  int aDimFontId = addPreference( tr( "PREF_DIMENSIONS_FONT" ), aDimGroupId, LightApp_Preferences::Font, "Geometry", "dimensions_font" );
+
+  int f = QtxFontEdit::Family | QtxFontEdit::Size;
+  setPreferenceProperty( aDimFontId, "features", f );
+  setPreferenceProperty( aDimFontId, "mode", QtxFontEdit::Custom );
+
+  Handle(Font_FontMgr) fmgr = Font_FontMgr::GetInstance();
+  QString aFontFile = "";
+  resMgr->value("resources", "GEOM", aFontFile);
+  aFontFile = aFontFile + QDir::separator() + "Y14.5M-2009.ttf";
+  // add enginier font into combobox
+  int fontID = QFontDatabase::addApplicationFont( aFontFile );
+  Handle(Font_SystemFont) sf = new Font_SystemFont( 
+    new TCollection_HAsciiString("Y14.5M-2009"), 
+    Font_FA_Regular, 
+    new TCollection_HAsciiString(aFontFile.toLatin1().data()) );
+  // register font in OCC font manager
+  fmgr->RegisterFont( sf, Standard_False );
+
+  // get list of supported fonts by OCC
+  QStringList anOCCFonts;
+  TColStd_SequenceOfHAsciiString theFontsNames;
+  fmgr->GetAvailableFontsNames( theFontsNames );
+  for(Standard_Integer i=1; i<=theFontsNames.Length(); i++) {
+    Handle(TCollection_HAsciiString) str = theFontsNames(i);
+    anOCCFonts << str->ToCString();
+  }
+  anOCCFonts.removeDuplicates();
+  // set the supported fonts into combobox to use its only
+  setPreferenceProperty( aDimFontId, "fonts", anOCCFonts );
 
   int aDimArrLengthId = addPreference( tr( "PREF_DIMENSIONS_ARROW_LENGTH" ), aDimGroupId,
                                        LightApp_Preferences::DblSpin, "Geometry", "dimensions_arrow_length" );
@@ -2312,9 +2410,6 @@ void GeometryGUI::createPreferences()
   int anAngUnitsId = addPreference( tr( "PREF_DIMENSIONS_ANGLE_UNITS" ), aDimGroupId,
                                    LightApp_Preferences::Selector, "Geometry", "dimensions_angle_units" );
 
-  addPreference( tr( "PREF_DIMENSIONS_SHOW_UNITS" ), aDimGroupId,
-                 LightApp_Preferences::Bool, "Geometry", "dimensions_show_units" );
-
   QStringList aListOfLengthUnits;
   aListOfLengthUnits << "m";
   aListOfLengthUnits << "cm";
@@ -2329,6 +2424,9 @@ void GeometryGUI::createPreferences()
   setPreferenceProperty( aLengthUnitsId, "strings", aListOfLengthUnits );
   setPreferenceProperty( anAngUnitsId,   "strings", aListOfAngUnits );
 
+  addPreference( tr( "PREF_DIMENSIONS_SHOW_UNITS" ), aDimGroupId,
+                 LightApp_Preferences::Bool, "Geometry", "dimensions_show_units" );
+
   int aDimDefFlyout = addPreference( tr( "PREF_DIMENSIONS_DEFAULT_FLYOUT" ), aDimGroupId,
                                      LightApp_Preferences::DblSpin, "Geometry", "dimensions_default_flyout" );
 
@@ -2336,6 +2434,9 @@ void GeometryGUI::createPreferences()
   setPreferenceProperty( aDimDefFlyout, "max", 1e+9 );
   setPreferenceProperty( aDimDefFlyout, "precision", 9 );
 
+  addPreference( tr( "PREF_DIMENSIONS_USE_TEXT3D" ), aDimGroupId,
+                 LightApp_Preferences::Bool, "Geometry", "dimensions_use_text3d" );
+
   int isoGroup = addPreference( tr( "PREF_ISOS" ), tabId );
   setPreferenceProperty( isoGroup, "columns", 2 );
   int isoU = addPreference( tr( "PREF_ISOS_U" ), isoGroup,
@@ -2442,7 +2543,6 @@ void GeometryGUI::createPreferences()
   QList<QVariant> aMarkerTypeIndicesList;
   QList<QVariant> aMarkerTypeIconsList;
 
-  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
   for ( int i = GEOM::MT_POINT; i < GEOM::MT_USER; i++ ) {
     QString icoFile = QString( "ICON_VERTEX_MARKER_%1" ).arg( i );
     QPixmap pixmap = resMgr->loadPixmap( "GEOM", tr( qPrintable( icoFile ) ) );
@@ -2522,6 +2622,9 @@ void GeometryGUI::createPreferences()
   addPreference( tr( "GEOM_PREVIEW" ), operationsGroup,
                  LightApp_Preferences::Bool, "Geometry", "geom_preview" );
 
+  addPreference( tr( "PREF_HIDE_INPUT_OBJECT" ), operationsGroup,
+                 LightApp_Preferences::Bool, "Geometry", "hide_input_object" );
+
   int DependencyViewId = addPreference( tr( "PREF_TAB_DEPENDENCY_VIEW" ) );
 
   int treeGeneralGroup = addPreference( tr( "PREF_GROUP_GENERAL" ), DependencyViewId );
@@ -2601,11 +2704,13 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par
     }
     else if ( param == QString("dimensions_color")        ||
               param == QString("dimensions_line_width")   ||
-              param == QString("dimensions_font_height")  ||
+              param == QString("dimensions_font")         ||
               param == QString("dimensions_arrow_length") ||
               param == QString("dimensions_show_units")   ||
               param == QString("dimensions_length_units") ||
-              param == QString("dimensions_angle_units") )
+              param == QString("dimensions_angle_units")  ||
+              param == QString("dimensions_use_text3d")  ||
+              param == QString("label_color") )
     {
       SalomeApp_Application* anApp = getApp();
       if ( !anApp )
@@ -2636,7 +2741,22 @@ void GeometryGUI::preferencesChanged( const QString& section, const QString& par
         aViewer->GetVisible( aVisible );
         aDisplayer.Redisplay( aVisible, false, aViewer );
       }
-
+      if ( param == QString( "label_color" ) ) {
+        ViewManagerList aVMsVTK;
+        anApp->viewManagers( SVTK_Viewer::Type(), aVMsVTK );
+        ViewManagerList::Iterator anIt = aVMsVTK.begin();
+        for ( ; anIt != aVMsVTK.end(); ++anIt )
+        {
+            SVTK_Viewer* aViewer = dynamic_cast<SVTK_Viewer*>( (*anIt)->getViewModel() );
+            if ( !aViewer )
+            {
+              continue;
+            }
+            SALOME_ListIO aVisible;
+            aViewer->GetVisible( aVisible );
+            aDisplayer.Redisplay( aVisible, false, aViewer );
+          }
+      }
       aDisplayer.UpdateViewer();
     }
     else if ( param.startsWith( "dependency_tree") )
@@ -2789,6 +2909,11 @@ void GeometryGUI::storeVisualParameters (int savePoint)
           ip->setParameter(entry, param.toStdString(), aProps.value(GEOM::propertyName( GEOM::Vertices )).toString().toStdString());
         }
 
+        if (aProps.contains(GEOM::propertyName( GEOM::ShowName ))) {
+          param = occParam + GEOM::propertyName( GEOM::ShowName );
+          ip->setParameter(entry, param.toStdString(), aProps.value(GEOM::propertyName( GEOM::ShowName )).toString().toStdString());
+        }
+
         if (aProps.contains(GEOM::propertyName( GEOM::Deflection ))) {
           param = occParam + GEOM::propertyName( GEOM::Deflection );
           ip->setParameter(entry, param.toStdString(), aProps.value(GEOM::propertyName( GEOM::Deflection )).toString().toStdString());
@@ -2961,6 +3086,8 @@ void GeometryGUI::restoreVisualParameters (int savePoint)
         aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::EdgesDirection ), val == "true" || val == "1");
       } else if (paramNameStr == GEOM::propertyName( GEOM::Vertices )) {
         aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::Vertices ), val == "true" || val == "1");
+      } else if (paramNameStr == GEOM::propertyName( GEOM::ShowName )) {
+        aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::ShowName ), val == "true" || val == "1");
       } else if (paramNameStr == GEOM::propertyName( GEOM::Deflection )) {
         aListOfMap[viewIndex].insert( GEOM::propertyName( GEOM::Deflection ), val.toDouble());
       } else if (paramNameStr == GEOM::propertyName( GEOM::PointMarker )) {
@@ -3009,11 +3136,37 @@ void GeometryGUI::restoreVisualParameters (int savePoint)
   }
 }
 
+// Compute current name mode of the viewer
+void UpdateNameMode( SalomeApp_Application* app )
+{
+  bool isMode = false;
+  SalomeApp_Study* aStudy = dynamic_cast< SalomeApp_Study* >( app->activeStudy() );
+  SUIT_ViewWindow* viewWindow = app->desktop()->activeWindow();
+  GEOM_Displayer displayer( aStudy );
+  int aMgrId = viewWindow->getViewManager()->getGlobalId();
+
+  SALOME_View* window = displayer.GetActiveView();
+  if ( !window ) return;
+
+  SALOME_ListIO anIOlst;
+  window->GetVisible( anIOlst );
+
+  for ( SALOME_ListIteratorOfListIO It( anIOlst ); It.More(); It.Next() ) {
+    Handle( SALOME_InteractiveObject ) io = It.Value();
+    QVariant v = aStudy->getObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::ShowName ), QVariant() );
+    bool isIONameMode =  v.isValid() ? v.toBool() : false;
+    if( isIONameMode )
+      isMode = true;
+  }
+  viewWindow->setProperty( "NameMode", isMode );
+}
+
 void GeometryGUI::onViewAboutToShow()
 {
   SUIT_ViewWindow* window = application()->desktop()->activeWindow();
   QAction* a = action( GEOMOp::OpSwitchVectors );
   QAction* aVerticesAction = action( GEOMOp::OpSwitchVertices );
+  QAction* aNameAction = action( GEOMOp::OpSwitchName );
   if ( window ) {
     a->setEnabled(true);
     bool vmode = window->property("VectorsMode").toBool();
@@ -3021,11 +3174,17 @@ void GeometryGUI::onViewAboutToShow()
     aVerticesAction->setEnabled(true);
     vmode = window->property("VerticesMode").toBool();
     aVerticesAction->setText ( vmode == 1 ? tr( "MEN_VERTICES_MODE_OFF" ) : tr("MEN_VERTICES_MODE_ON") );
+    UpdateNameMode( getApp() );
+    aNameAction->setEnabled(true);
+    vmode = window->property("NameMode").toBool();
+    aNameAction->setText ( vmode == 1 ? tr( "MEN_NAME_MODE_OFF" ) : tr("MEN_NAME_MODE_ON") );
   } else {
     a->setText ( tr("MEN_VECTOR_MODE_ON") );
     a->setEnabled(false);
     aVerticesAction->setText ( tr("MEN_VERTICES_MODE_ON") );
     aVerticesAction->setEnabled(false);
+    aNameAction->setText ( tr("MEN_NAME_MODE_ON") );
+    aNameAction->setEnabled(false);
   }
 }
 
@@ -3369,3 +3528,8 @@ void GeometryGUI::dropObjects( const DataObjectList& what, SUIT_DataObject* wher
   // update Object browser
   getApp()->updateObjectBrowser( false );
 }
+
+void GeometryGUI::emitDimensionsUpdated( QString entry )
+{
+  emit DimensionsUpdated( entry );
+}
index 5dde1ed7f1d82559c13ea3662d553d3c217268b6..f0abf2da2244d5ba81cfdd3985a19d45769d5dbb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -64,6 +64,7 @@ class LightApp_Selection;
 class SUIT_ViewManager;
 class SalomeApp_Study;
 class GEOMGUI_CreationInfoWdg;
+class GEOMGUI_TextTreeWdg;
 
 //=================================================================================
 // class    : GeometryGUI
@@ -145,8 +146,10 @@ public:
   virtual bool                isDraggable( const SUIT_DataObject* what ) const;
   virtual bool                isDropAccepted( const SUIT_DataObject* where ) const;
   virtual void                dropObjects( const DataObjectList& what, 
-                                          SUIT_DataObject* where,
-                                          const int row, Qt::DropAction action );
+                                           SUIT_DataObject* where,
+                                           const int row, Qt::DropAction action );
+
+  void                        emitDimensionsUpdated( QString entry );
 
 public slots:
   virtual bool                deactivateModule( SUIT_Study* );
@@ -176,6 +179,7 @@ signals :
   void                        SignalDefaultStepValueChanged( double newVal );
   void                        SignalDependencyTreeParamChanged( const QString&, const QString& );
   void                        SignalDependencyTreeRenameObject( const QString& );
+  void                        DimensionsUpdated( const QString& );
 
 protected:
   virtual LightApp_Selection* createSelection() const;
@@ -224,6 +228,8 @@ private:
 
   GEOMGUI_CreationInfoWdg*    myCreationInfoWdg;
   
+  GEOMGUI_TextTreeWdg*       myTextTreeWdg;
+  
   SALOME_ListIO               myTopLevelIOList;               
 
   friend class DisplayGUI;
index f66c19df10cc4c453b316ca8d9a514bb3a4c326e..480b7d2fd366ebfbc47dad62cb8f21043d09529d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -26,7 +26,9 @@ namespace GEOMOp {
   enum {
     // ToolsGUI --------------------//--------------------------------
     OpDelete              = 1020,   // MENU EDIT  - DELETE
+#ifndef DISABLE_PYCONSOLE
     OpCheckGeom           = 1030,   // MENU TOOLS - CHECK GEOMETRY
+#endif
     OpMaterialsLibrary    = 1040,   // MENU TOOLS - MATERIALS LIBRARY
     OpSelectVertex        = 1100,   // POPUP MENU - SELECT ONLY - VERTEX
     OpSelectEdge          = 1101,   // POPUP MENU - SELECT ONLY - EDGE
@@ -59,7 +61,9 @@ namespace GEOMOp {
     OpIsosWidth           = 1261,   // POPUP MENU - LINE WIDTH - ISOS WIDTH
     OpCreateFolder        = 1262,   // POPUP MENU - CREATE FOLDER
     OpSortChildren        = 1263,   // POPUP MENU - SORT CHILD ITEMS
+#ifndef DISABLE_GRAPHICSVIEW
     OpShowDependencyTree  = 1264,   // POPUP MENU - SHOW DEPENDENCY TREE
+#endif
     OpReduceStudy         = 1265,   // POPUP MENU - REDUCE STUDY
     // DisplayGUI ------------------//--------------------------------
     OpSwitchVectors       = 2001,   // MENU VIEW  - DISPLAY MODE - SHOW/HIDE EDGE DIRECTION
@@ -70,6 +74,7 @@ namespace GEOMOp {
     OpDMShadingWithEdges  = 2012,   // MENU VIEW  - DISPLAY MODE - SHADING WITH EDGES
     OpDMTexture           = 2013,   // MENU VIEW  - DISPLAY MODE - TEXTURE
     OpSwitchVertices      = 2014,   // MENU VIEW  - DISPLAY MODE - SHOW/HIDE VERTICES
+    OpSwitchName          = 2015,   // MENU VIEW  - DISPLAY MODE - SHOW/HIDE NAME
     OpShow                = 2100,   // POPUP MENU - SHOW
     OpShowOnly            = 2101,   // POPUP MENU - SHOW ONLY
     OpHide                = 2102,   // POPUP MENU - HIDE
@@ -82,6 +87,7 @@ namespace GEOMOp {
     OpBringToFront        = 2205,   // POPUP MENU - BRING TO FRONT
     OpClsBringToFront     = 2206,
     OpVertices            = 2208,   // POPUP MENU - DISPLAY MODE - SHOW VERTICES
+    OpShowName            = 2209,   // POPUP MENU - DISPLAY MODE - SHOW NAME
     // BasicGUI --------------------//--------------------------------
     OpPoint               = 3000,   // MENU NEW ENTITY - BASIC - POINT
     OpLine                = 3001,   // MENU NEW ENTITY - BASIC - LINE
@@ -94,6 +100,7 @@ namespace GEOMOp {
     OpLCS                 = 3008,   // MENU NEW ENTITY - BASIC - LOCAL COORDINATE SYSTEM
     OpOriginAndVectors    = 3009,   // MENU NEW ENTITY - BASIC - ORIGIN AND BASE VECTORS
     OpIsoline             = 3010,   // MENU NEW ENTITY - BASIC - ISOLINE
+    OpSurfaceFromFace     = 3011,   // MENU NEW ENTITY - BASIC - SURFACE FROM FACE
     // PrimitiveGUI ----------------//--------------------------------
     OpBox                 = 3100,   // MENU NEW ENTITY - PRIMITIVES - BOX
     OpCylinder            = 3101,   // MENU NEW ENTITY - PRIMITIVES - CYLINDER
@@ -108,6 +115,7 @@ namespace GEOMOp {
     OpFilling             = 3202,   // MENU NEW ENTITY - GENERATION - FILLING
     OpPipe                = 3203,   // MENU NEW ENTITY - GENERATION - EXTRUSION ALONG PATH
     OpPipePath            = 3204,   // MENU NEW ENTITY - GENERATION - RESTORE PATH
+    OpThickness           = 3205,   // MENU NEW ENTITY - GENERATION - THICKNESS
     // EntityGUI -------------------//--------------------------------
     Op2dSketcher          = 3300,   // MENU NEW ENTITY - SKETCHER
     Op3dSketcher          = 3301,   // MENU NEW ENTITY - 3D SKETCHER
@@ -143,6 +151,8 @@ namespace GEOMOp {
     OpMultiRotate         = 3607,   // MENU OPERATIONS - TRANSFORMATION - MULTI-ROTATION
     OpReimport            = 3608,   // POPUP MENU - RELOAD IMPORTED
     OpProjection          = 3609,   // MENU OPERATIONS - TRANSFORMATION - PROJECTION
+    OpExtension           = 3610,   // MENU OPERATIONS - TRANSFORMATION - EXTENSION
+    OpProjOnCyl           = 3611,   // MENU OPERATIONS - TRANSFORMATION - PROJECTION ON CYLINDER
     // OperationGUI ----------------//--------------------------------
     OpPartition           = 3700,   // MENU OPERATION - PARTITION
     OpArchimede           = 3701,   // MENU OPERATION - ARCHIMEDE
@@ -155,6 +165,7 @@ namespace GEOMOp {
     OpSharedShapes        = 3708,   // MENU OPERATION - GET SHARED SHAPES
     OpExtrudedBoss        = 3709,   // MENU OPERATION - ETRUDED BOSS
     OpExtrudedCut         = 3710,   // MENU OPERATION - ETRUDED CUT
+    OpTransferData        = 3711,   // MENU OPERATION - TRANSFER DATA
     // RepairGUI -------------------//--------------------------------
     OpSewing              = 4000,   // MENU REPAIR - SEWING
     OpSuppressFaces       = 4001,   // MENU REPAIR - SUPPRESS FACES
@@ -191,6 +202,11 @@ namespace GEOMOp {
     OpManageDimensions    = 5014,   // MENU MEASURES - MANAGE DIMENSIONS
     OpShowAllDimensions   = 5015,   // POPUP MENU - SHOW ALL DIMENSIONS
     OpHideAllDimensions   = 5016,   // POPUP MENU - HIDE ALL DIMENSIONS
+    OpFastCheckInters     = 5017,   // MENU MEASURES - FAST CHECK INTERSECTIONS
+    OpInspectObj         = 5018,       // MENU MEASURES - INSPECT OBJECT
+#ifndef DISABLE_PLOT2DVIEWER
+    OpShapeStatistics    = 5019,   // MENU MEASURES - SHAPE STATISTICS
+#endif
     // GroupGUI --------------------//--------------------------------
     OpGroupCreate         = 6000,   // MENU GROUP - CREATE
     OpGroupEdit           = 6001,   // MENU GROUP - EDIT
index a09066811d366dd93546347d84c08eedcce281d0..5c59b2e7257e40f61210197bbfebea6c4302cfb3 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -33,6 +33,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/SKETCHER
   ${PROJECT_SOURCE_DIR}/src/ARCHIMEDE
   ${PROJECT_SOURCE_DIR}/src/XAO
+  ${PROJECT_SOURCE_DIR}/src/ShHealOper
   ${CMAKE_CURRENT_SOURCE_DIR}
   )
 
@@ -96,6 +97,7 @@ SET(GEOMImpl_HEADERS
   GEOMImpl_ITranslate.hxx
   GEOMImpl_IMirror.hxx
   GEOMImpl_IProjection.hxx
+  GEOMImpl_IProjOnCyl.hxx
   GEOMImpl_IOffset.hxx
   GEOMImpl_IScale.hxx
   GEOMImpl_IRotate.hxx
@@ -110,12 +112,14 @@ SET(GEOMImpl_HEADERS
   GEOMImpl_ICone.hxx
   GEOMImpl_ISphere.hxx
   GEOMImpl_ITorus.hxx
+  GEOMImpl_ITransferData.hxx
   GEOMImpl_IPrism.hxx
   GEOMImpl_IPipe.hxx
   GEOMImpl_IPipePath.hxx
   GEOMImpl_IRevolution.hxx
   GEOMImpl_IMeasure.hxx
   GEOMImpl_IShapes.hxx
+  GEOMImpl_IShapeExtend.hxx
   GEOMImpl_IFilling.hxx
   GEOMImpl_IThruSections.hxx
   GEOMImpl_IPartition.hxx
@@ -195,6 +199,7 @@ SET(GEOMImpl_SOURCES
   GEOMImpl_IFieldOperations.cxx
   GEOMImpl_IBaseIEOperations.cxx
   GEOMImpl_IPolyline2D.cxx
+  GEOMImpl_ITransferData.cxx
   GEOMImpl_Gen.cxx
   GEOMImpl_PointDriver.cxx
   GEOMImpl_VectorDriver.cxx
index e0c2fcd3323ba58abfeba3c4631494114d86b836..712f47731a14951620107c323d54d3afa9859b8c 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1b3436ebce9afe15aaf36cca52c83a9db21bdec0..86c9518f26501e3ec30c87fe430dfdfb3cb567ef 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 25e51611e551c29cf58b0fd189a137eb5beefe62..37aabd4da6a5255fb963922e9229ba4a9513eab0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 57f8dbcac058e61d9bc81681aa5584ae03feacdd..fe9ac8605852c3496204277a986575e0268209bc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index a5c99d9304d78aa62d7a7fc32da080ac725b4a25..67786e19f31518f959070531558da1591c6e4b03 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 9792071d259c50f52fe1fcb8b745c54d14f04c4d..ea1c759cd84ce25718e3ed8fe3f5f2a15ec510bf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ac7176133c50fa4ade48295abc96c984e723e27e..2e3066fe7ab37b74e469093bde3cedc0456a1c96 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #define PLANAR_FACE_MAX_TOLERANCE 1e-06
 
+// The following macro, when enabled, causes pcurves upgrade after MakeFilling algorithm
+// in MakeAnyFace function;
+// WARNING: it may lead to extra vertices generation by partition algorithm
+// in some cases, for example when fillet is made on a PipeTShape - 
+// see issues 0021568 and 0021550
+// VSR (15/05/2012): macro commented out (disabled) to avoid extra vertices!
+//#define MAKE_FACE_UPGRADE_PCURVES
+
+// The following macro, when enabled, causes fixing tolerance for pcurves
+// after BRepBuilderAPI_MakeFace + ShHealOper_ShapeProcess in MakeAnyFace function;
+// This sometimes allows to fix problems of extra vertices generation
+// see issue 0022706
+// VSR (17/11/2014): macro enabled
+#define MAKE_FACE_PCURVES_FIX_TOLERANCE
+
+#ifdef MAKE_FACE_PCURVES_FIX_TOLERANCE
+#include <BOPTools_AlgoTools.hxx>
+#include <NCollection_DataMap.hxx>
+#include <ShapeFix_ShapeTolerance.hxx>
+#endif
+
 static Standard_Integer mod4 (Standard_Integer nb)
 {
   if (nb <= 0) return nb + 4;
@@ -1362,11 +1383,7 @@ TCollection_AsciiString GEOMImpl_Block6Explorer::MakeAnyFace (const TopoDS_Wire&
   // 12.04.2006 for PAL12149 begin
   Handle(Geom_Surface) aGS = BRep_Tool::Surface(TopoDS::Face(aFace));
 
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - BEGIN
-// the following block, when enabled, leads to extra vertices generation by partition algorithm
-// in some cases, for example when fillet is made on a PipeTShape
-#if 0
-// VSR: debug issues 0021568 and 0021550 (15/05/2012) - END
+#ifdef MAKE_FACE_UPGRADE_PCURVES
   BRep_Builder BB;
   TopoDS_Iterator itw(theWire);
   for (; itw.More(); itw.Next())
@@ -1396,7 +1413,46 @@ TCollection_AsciiString GEOMImpl_Block6Explorer::MakeAnyFace (const TopoDS_Wire&
   }
   // 12.04.2006 for PAL12149 end
 
-  if (theResult.IsNull()) { // try to deal with pure result of filling
+  if (!theResult.IsNull()) {
+    // try to deal with result of BRepBuilderAPI_MakeFace + ShHealOper_ShapeProcess
+#if OCC_VERSION_LARGE >= 0x06080000
+#ifdef MAKE_FACE_PCURVES_FIX_TOLERANCE
+    // check and fix pcurves, if necessary
+    Standard_Real aT, aTolE, aD, aDMax;
+    TopExp_Explorer aExpF, aExpE;
+    NCollection_DataMap<TopoDS_Shape, Standard_Real, TopTools_ShapeMapHasher> aDMETol;
+    aExpF.Init(theResult, TopAbs_FACE);
+    for (; aExpF.More(); aExpF.Next()) {
+      const TopoDS_Face& aF = *(TopoDS_Face*)&aExpF.Current();
+      aExpE.Init(aF, TopAbs_EDGE);
+      for (; aExpE.More(); aExpE.Next()) {
+        const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExpE.Current();
+        if (!BOPTools_AlgoTools::ComputeTolerance(aF, aE, aDMax, aT)) continue;
+        aTolE = BRep_Tool::Tolerance(aE);
+        if (aDMax < aTolE) continue;
+        if (aDMETol.IsBound(aE)) {
+          aD = aDMETol.Find(aE);
+          if (aDMax > aD) {
+            aDMETol.UnBind(aE);
+            aDMETol.Bind(aE, aDMax);
+          }
+        }
+        else {
+          aDMETol.Bind(aE, aDMax);
+        }
+      }
+    }
+    NCollection_DataMap<TopoDS_Shape, Standard_Real, TopTools_ShapeMapHasher>::Iterator aDMETolIt(aDMETol);
+    ShapeFix_ShapeTolerance sat;
+    for (; aDMETolIt.More(); aDMETolIt.Next()) {
+      sat.LimitTolerance(aDMETolIt.Key(), aDMETolIt.Value());
+    }
+#endif
+#endif
+  }
+  else {
+    // try to deal with pure result of BRepOffsetAPI_MakeFilling
+
     // Update tolerance
     Standard_Real aTol = MF.G0Error();
 
index 4cf4f6be6166a4b222a45fe87094cc7410ae5241..162040a2d06b94563fd044088bcc038f01748238 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 0412b52b74654145088ebed8b323307ea0860439..e586a7d5e90e7e7d893741470bf61c7248edec75 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 41f01081cfa026be19f5947c60905ef7ddb36df1..8cf09c8bb45a8a224db5758be98210cdd1709069 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 32b0b04fa21b02af7d5861013d0b7f0e8a5dadd5..54ab687215c0f6cc3dde0e0bcc0bf57dfad2699a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <TNaming_CopyShape.hxx>
 
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
 #include <BRep_Builder.hxx>
-#include <BRepAlgo.hxx>
 #include <BRepAlgoAPI_Common.hxx>
 #include <BRepAlgoAPI_Cut.hxx>
 #include <BRepAlgoAPI_Fuse.hxx>
 #include <BRepAlgoAPI_Section.hxx>
-#include <BRepCheck_Analyzer.hxx>
 #include <BOPAlgo_CheckerSI.hxx>
 #include <BOPDS_DS.hxx>
 
@@ -73,33 +68,23 @@ static TopoDS_Shape RemoveExtraEdges(const TopoDS_Shape &theShape)
 {
   TopoDS_Shape aResult;
 
-  if (theShape.IsNull() == Standard_False) {
+  if (!theShape.IsNull()) {
     BlockFix_BlockFixAPI aTool;
 
     aTool.OptimumNbFaces() = 0;
     aTool.SetShape(theShape);
     aTool.Perform();
-    aResult = aTool.Shape();
-
-    // Repair result
-    BRepCheck_Analyzer anAna (aResult, false);
-    Standard_Boolean isValid = anAna.IsValid();
+    TopoDS_Shape aShape = aTool.Shape();
 
-    if (!isValid) {
+    if (GEOMUtils::CheckShape(aShape)) {
+      aResult = aShape;
+    }
+    else {
       TopoDS_Shape aFixed;
       ShHealOper_ShapeProcess aHealer;
-
-      aHealer.Perform(aResult, aFixed);
-
-      if (aHealer.isDone()) {
+      aHealer.Perform(aShape, aFixed);
+      if (aHealer.isDone() && GEOMUtils::CheckShape(aFixed))
         aResult = aFixed;
-        anAna.Init(aResult, false);
-        isValid = anAna.IsValid();
-      }
-    }
-
-    if (!isValid) {
-      aResult.Nullify();
     }
   }
 
@@ -153,11 +138,7 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
 
       if (!aShape1.IsNull() && !aShape2.IsNull()) {
         // check arguments for Mantis issue 0021019
-        BRepCheck_Analyzer ana (aShape1, Standard_True);
-        if (!ana.IsValid())
-          StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
-        ana.Init(aShape2);
-        if (!ana.IsValid())
+        if (!GEOMUtils::CheckShape(aShape1, true) || !GEOMUtils::CheckShape(aShape2, true))
           StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
 
         if (isCheckSelfInte) {
@@ -211,10 +192,9 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
         aShape = aRefShape->GetValue();
        
         if (!aShape.IsNull()) {
-          BRepCheck_Analyzer anAna (aShape, Standard_True);
-          if (!anAna.IsValid()) {
+          // check arguments for Mantis issue 0021019
+          if (!GEOMUtils::CheckShape(aShape, true))
             StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
-          }
 
           BOPAlgo_CheckerSI aCSI;  // checker of self-interferences
 
@@ -239,11 +219,9 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
           for (i = 2; i <= nbShapes; i++) {
            aRefShape = Handle(GEOM_Function)::DownCast(aShapes->Value(i));
            aShape2 = aRefShape->GetValue();
-           anAna.Init(aShape2);
-           
-           if (!anAna.IsValid()) {
+            
+            if (!GEOMUtils::CheckShape(aShape2, true))
              StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
-           }
            
             if (isCheckSelfInte) {
               BOPCol_ListOfShape aList2;
@@ -280,11 +258,8 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
 
       if (!aShape.IsNull()) {
         // check arguments for Mantis issue 0021019
-        BRepCheck_Analyzer anAna (aShape, Standard_True);
-
-        if (!anAna.IsValid()) {
+        if (!GEOMUtils::CheckShape(aShape, true))
           StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
-        }
 
        BOPAlgo_CheckerSI aCSI;  // checker of self-interferences
 
@@ -315,11 +290,9 @@ Standard_Integer GEOMImpl_BooleanDriver::Execute (TFunction_Logbook& log) const
         for (i = 1; i <= nbShapes; i++) {
           aRefTool = Handle(GEOM_Function)::DownCast(aTools->Value(i));
           aTool = aRefTool->GetValue();
-          anAna.Init(aTool);
 
-          if (!anAna.IsValid()) {
+          if (!GEOMUtils::CheckShape(aTool, true))
             StdFail_NotDone::Raise("Boolean operation will not be performed, because argument shape is not valid");
-          }
 
           if (isCheckSelfInte) {
             BOPCol_ListOfShape aList2;
@@ -572,91 +545,8 @@ TopoDS_Shape GEOMImpl_BooleanDriver::performOperation
   }
 
   // 08.07.2008 skl for bug 19761 from Mantis
-  BRepCheck_Analyzer ana (aShape, Standard_True);
-  ana.Init(aShape);
-  if (!ana.IsValid()) {
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape, Precision::Confusion(),
-                        Precision::Confusion(), TopAbs_SHAPE);
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-    ana.Init(aShape);
-    if (!ana.IsValid())
-      Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
-  }
-
-  // BEGIN: Mantis issue 0021060: always limit tolerance of BOP result
-  // 1. Get shape parameters for comparison
-  int nbTypes [TopAbs_SHAPE];
-  {
-    for (int iType = 0; iType < TopAbs_SHAPE; ++iType)
-      nbTypes[iType] = 0;
-    nbTypes[aShape.ShapeType()]++;
-
-    TopTools_MapOfShape aMapOfShape;
-    aMapOfShape.Add(aShape);
-    TopTools_ListOfShape aListOfShape;
-    aListOfShape.Append(aShape);
-
-    TopTools_ListIteratorOfListOfShape itL (aListOfShape);
-    for (; itL.More(); itL.Next()) {
-      TopoDS_Iterator it (itL.Value());
-      for (; it.More(); it.Next()) {
-        TopoDS_Shape s = it.Value();
-        if (aMapOfShape.Add(s)) {
-          aListOfShape.Append(s);
-          nbTypes[s.ShapeType()]++;
-        }
-      }
-    }
-  }
-
-  // 2. Limit tolerance
-  TopoDS_Shape aShapeCopy;
-  TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
-  TNaming_CopyShape::CopyTool(aShape, aMapTShapes, aShapeCopy);
-  ShapeFix_ShapeTolerance aSFT;
-  aSFT.LimitTolerance(aShapeCopy, Precision::Confusion(), Precision::Confusion(), TopAbs_SHAPE);
-  Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape (aShapeCopy);
-  aSfs->Perform();
-  aShapeCopy = aSfs->Shape();
-
-  // 3. Check parameters
-  ana.Init(aShapeCopy);
-  if (ana.IsValid()) {
-    int iType, nbTypesCopy [TopAbs_SHAPE];
-
-    for (iType = 0; iType < TopAbs_SHAPE; ++iType)
-      nbTypesCopy[iType] = 0;
-    nbTypesCopy[aShapeCopy.ShapeType()]++;
-
-    TopTools_MapOfShape aMapOfShape;
-    aMapOfShape.Add(aShapeCopy);
-    TopTools_ListOfShape aListOfShape;
-    aListOfShape.Append(aShapeCopy);
-
-    TopTools_ListIteratorOfListOfShape itL (aListOfShape);
-    for (; itL.More(); itL.Next()) {
-      TopoDS_Iterator it (itL.Value());
-      for (; it.More(); it.Next()) {
-        TopoDS_Shape s = it.Value();
-        if (aMapOfShape.Add(s)) {
-          aListOfShape.Append(s);
-          nbTypesCopy[s.ShapeType()]++;
-        }
-      }
-    }
-
-    bool isEqual = true;
-    for (iType = 0; iType < TopAbs_SHAPE && isEqual; ++iType) {
-      if (nbTypes[iType] != nbTypesCopy[iType])
-        isEqual = false;
-    }
-    if (isEqual)
-      aShape = aShapeCopy;
-  }
-  // END: Mantis issue 0021060
+  if ( !GEOMUtils::CheckShape(aShape, true) && !GEOMUtils::FixShapeTolerance(aShape) )
+    Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
 
   return aShape;
 }
index e6e1d2dab6bb306a478c6b06da8e769708fcf6fe..410c12aaf9452678405c1457eb33eaf5eeeca810 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index cbf0caf398b70884829e2e7b20fb63755c02ab06..519166a9c69a4ad710f9c1f9f9e9a24bcd08b30d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f419f7997b0577bb628d0365e21ceced29ebde71..a4ce01b89a0a00652c79428a9a0994df39ec950c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e845c72a71a9f396ff63766943f0ec978015fdb7..a32a01e682fe6a4c5a9b6e909c00a1aeaa418cb8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_ChamferDriver.hxx>
 #include <GEOMImpl_IChamfer.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOMImpl_ILocalOperations.hxx>
 #include <GEOMImpl_Block6Explorer.hxx>
-
+#include <GEOMUtils.hxx>
 #include <GEOM_Function.hxx>
 
 #include <BRepLib.hxx>
 #include <BRepTools.hxx>
 #include <BRepFilletAPI_MakeChamfer.hxx>
 
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-
 #include <TopAbs.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Iterator.hxx>
-#include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 
-#include <Precision.hxx>
-#include <gp_Pnt.hxx>
 #include <StdFail_NotDone.hxx>
 
 //=======================================================================
@@ -63,7 +55,6 @@ const Standard_GUID& GEOMImpl_ChamferDriver::GetID()
   return aChamferDriver;
 }
 
-
 //=======================================================================
 //function : GEOMImpl_ChamferDriver
 //purpose  :
@@ -264,17 +255,12 @@ Standard_Integer GEOMImpl_ChamferDriver::Execute(TFunction_Logbook& log) const
   if (!fill.IsDone()) {
     StdFail_NotDone::Raise("Chamfer can not be computed on the given shape with the given parameters");
   }
-  aShape = fill.Shape();
+  aShape = GEOMUtils::ReduceCompound( fill.Shape() );
 
   if (aShape.IsNull()) return 0;
 
   // reduce tolerances
-  ShapeFix_ShapeTolerance aSFT;
-  aSFT.LimitTolerance(aShape, Precision::Confusion(),
-                      Precision::Confusion(), TopAbs_SHAPE);
-  Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-  aSfs->Perform();
-  aShape = aSfs->Shape();
+  GEOMUtils::FixShapeTolerance( aShape );
 
   // fix SameParameter flag
   BRepLib::SameParameter(aShape, 1.E-5, Standard_True);
index 37c91658beecf09933827c1accccbb60ec641fe2..2d395fcf402a5d399d937e9c3227de4fd39c9b56 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b5e696e6436757bdccc1574c3cd9286adb04d700..053189e39d46cbefe4d8c8eb6cbea043fd35c17c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 6e68435ffbe27eb11760fa46db36463482c7a052..bebdd6bf5b16489a7bc11b9abbb921439aa570af 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 9b77198ed80dae3cc3e99a4c44f8d1b17535c32a..c273a664fdd87af9063eaff336a89e15cbbe21f8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index adf480bb56cbe15cb17b7e87e9f59ed4009f8b8e..7537788de41796a7436019d7f5177776331dfad7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 6009804a356702a3e897a38f08882f46f3b3f356..37fb1074097cf43c0570caa0c23319556fe89fa1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include "GEOMImpl_CopyDriver.hxx"
 #include "GEOMImpl_ICopy.hxx"
+#include "GEOMImpl_ITransferData.hxx"
 #include "GEOMImpl_Types.hxx"
 #include "GEOM_Function.hxx"
 #include "GEOM_Object.hxx"
+#include "GEOMAlgo_GetInPlace.hxx"
+#include "GEOMAlgo_GetInPlaceAPI.hxx"
 
-#include <BRep_Tool.hxx>
-#include <gp_Pnt.hxx>
-#include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopAbs.hxx>
+#include <TopExp.hxx>
 #include <TNaming_CopyShape.hxx>
 #include <TColStd_IndexedDataMapOfTransientTransient.hxx>
+#include <TFunction_Logbook.hxx>
+#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_MapIteratorOfMapOfShape.hxx>
+
+
+#define NB_DATUM             2
+#define DATUM_NAME_INDEX     1
+#define DATUM_MATERIAL_INDEX 2
+
 
 //=======================================================================
 //function : GetID
@@ -65,6 +76,10 @@ Standard_Integer GEOMImpl_CopyDriver::Execute(TFunction_Logbook& log) const
 
   Standard_Integer aType = aFunction->GetType();
 
+  if (aType == TRANSFER_DATA) {
+    return transferData(log);
+  }
+
   GEOMImpl_ICopy aCI (aFunction);
   TopoDS_Shape aCopy;
   
@@ -129,6 +144,276 @@ GetCreationInformation(std::string&             theOperationName,
   return true;
 }
 
+//================================================================================
+/*!
+ * \brief Performs Transfer Data operation.
+ */
+//================================================================================
+
+Standard_Integer GEOMImpl_CopyDriver::transferData(TFunction_Logbook& log) const
+{
+  Handle(GEOM_Function)  aFunction = GEOM_Function::GetFunction(Label());
+  GEOMImpl_ITransferData aTD (aFunction);
+  Handle(GEOM_Function)  aRef1     = aTD.GetRef1();
+  Handle(GEOM_Function)  aRef2     = aTD.GetRef2();
+
+  if (aRef1.IsNull() || aRef2.IsNull()) {
+    return 0;
+  }
+
+  TopoDS_Shape                              aShape1     = aRef1->GetValue();
+  TopoDS_Shape                              aShape2     = aRef2->GetValue();
+  const int                                 aFindMethod = aTD.GetFindMethod();
+  TopTools_IndexedDataMapOfShapeListOfShape aMapSoDest;
+  TopTools_IndexedMapOfShape                anIndices1;
+
+  TopExp::MapShapes(aShape1, anIndices1);
+
+  switch (aFindMethod) {
+    case TD_GET_IN_PLACE:
+      if (!getInPlace(aShape1, anIndices1, aShape2, aMapSoDest)) {
+        return 0;
+      }
+      break;
+    case TD_GET_IN_PLACE_OLD:
+      if (!getInPlaceOld(aRef1, anIndices1, aShape2, aMapSoDest)) {
+        return 0;
+      }
+      break;
+    case TD_GET_IN_PLACE_BY_HISTORY:
+      if (!getInPlaceByHistory(aRef1, anIndices1, aShape2, aRef2, aMapSoDest)) {
+        return 0;
+      }
+      break;
+    default:
+      return 0;
+  }
+
+  // Perform copying names.
+  Handle(TColStd_HArray1OfExtendedString) aDatumName   =
+    new TColStd_HArray1OfExtendedString(1, NB_DATUM);
+  Handle(TColStd_HArray1OfInteger)        aDatumMaxVal =
+    new TColStd_HArray1OfInteger(1, NB_DATUM, 0);
+  Handle(TColStd_HArray1OfInteger)        aDatumVal    =
+    new TColStd_HArray1OfInteger(1, NB_DATUM, 0);
+  GEOMImpl_ITransferData                  aTD1(aRef1);
+  GEOMImpl_ITransferData                  aTD2(aRef2);
+  Standard_Integer                        i;
+  Standard_Integer                        aNbShapes = anIndices1.Extent();
+  TopTools_MapOfShape                     aMapFence;
+
+  aDatumName->SetValue(DATUM_NAME_INDEX,     "GEOM_TRANSFER_DATA_NAMES");
+  aDatumName->SetValue(DATUM_MATERIAL_INDEX, "GEOM_TRANSFER_DATA_MATERIALS");
+
+  for (i = 1; i <= aNbShapes; ++i) {
+    const TopoDS_Shape      &aSource   = anIndices1.FindKey(i);
+    TCollection_AsciiString  aName     = aTD1.GetName(aSource);
+    TCollection_AsciiString  aMaterial = aTD1.GetMaterial(aSource);
+
+    // Transfer name
+    if (!aName.IsEmpty()) {
+      aDatumMaxVal->ChangeValue(DATUM_NAME_INDEX)++;
+
+      if (aMapSoDest.Contains(aSource)) {
+        aDatumVal->ChangeValue(DATUM_NAME_INDEX)++;
+
+        // Copy name to the list of subshapes of the second shape.
+        const TopTools_ListOfShape         &aListDest =
+          aMapSoDest.FindFromKey(aSource);
+        TopTools_ListIteratorOfListOfShape  anIt(aListDest);
+
+        for (; anIt.More(); anIt.Next()) {
+          const TopoDS_Shape &aShapeDest = anIt.Value();
+
+          if (aMapFence.Add(aShapeDest)) {
+            aTD2.SetName(aShapeDest, aName);
+          }
+        }
+      }
+    }
+
+    // Transfer Material
+    if (!aMaterial.IsEmpty()) {
+      aDatumMaxVal->ChangeValue(DATUM_MATERIAL_INDEX)++;
+
+      if (aMapSoDest.Contains(aSource)) {
+        aDatumVal->ChangeValue(DATUM_MATERIAL_INDEX)++;
+
+        // Copy material to the list of subshapes of the second shape.
+        const TopTools_ListOfShape         &aListDest =
+          aMapSoDest.FindFromKey(aSource);
+        TopTools_ListIteratorOfListOfShape  anIt(aListDest);
+
+        for (; anIt.More(); anIt.Next()) {
+          const TopoDS_Shape &aShapeDest = anIt.Value();
+
+          if (aMapFence.Add(aShapeDest)) {
+            aTD2.SetMaterial(aShapeDest, aMaterial);
+          }
+        }
+      }
+    }
+  }
+
+  // Store results.
+  aTD.SetDatumName(aDatumName);
+  aTD.SetDatumMaxVal(aDatumMaxVal);
+  aTD.SetDatumVal(aDatumVal);
+
+  return 1;
+}
+
+//================================================================================
+/*!
+ * \brief For each subshape of the source shape compute coinsident sub-shapes
+ *        of the destination shape using GetInPlace method.
+ */
+//================================================================================
+
+Standard_Boolean GEOMImpl_CopyDriver::getInPlace
+    (const TopoDS_Shape                              &theSourceShape,
+     const TopTools_IndexedMapOfShape                &theSourceIndices,
+     const TopoDS_Shape                              &theDestinationShape,
+           TopTools_IndexedDataMapOfShapeListOfShape &theMapSourceDest) const
+{
+  // Searching for the sub-shapes inside theDestinationShape shape
+  GEOMAlgo_GetInPlace aGIP;
+
+  if (!GEOMAlgo_GetInPlaceAPI::GetInPlace
+          (theDestinationShape, theSourceShape, aGIP)) {
+    return Standard_False;
+  }
+
+  const GEOMAlgo_DataMapOfShapeMapOfShape &aShapesIn = aGIP.ShapesIn();
+  const GEOMAlgo_DataMapOfShapeMapOfShape &aShapesOn = aGIP.ShapesOn();
+  Standard_Integer                         i;
+  Standard_Integer                         j;
+  Standard_Integer                         aNbShapes = theSourceIndices.Extent();
+
+  for (i = 1; i <= aNbShapes; ++i) {
+    const TopoDS_Shape   &aSource = theSourceIndices.FindKey(i);
+    TopTools_ListOfShape  aListShapes2;
+    TopTools_MapOfShape   aMapShapes2;
+
+    for (j = 0; j < 2; ++j) {
+      const GEOMAlgo_DataMapOfShapeMapOfShape &aShapes2 =
+                    j == 0 ? aShapesIn : aShapesOn;
+
+      if (aShapes2.IsBound(aSource)) {
+        const TopTools_MapOfShape &aMapShapesDest =
+          aShapes2.Find(aSource);
+        TopTools_MapIteratorOfMapOfShape aMapIter(aMapShapesDest);
+
+        for (; aMapIter.More(); aMapIter.Next()) {
+          const TopoDS_Shape &aShapeDest = aMapIter.Key();
+
+          if (aMapShapes2.Add(aShapeDest)) {
+            aListShapes2.Append(aShapeDest);
+          }
+        }
+      }
+    }
+
+    if (!aListShapes2.IsEmpty()) {
+      theMapSourceDest.Add(aSource, aListShapes2);
+    }
+  }
+
+  return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief For each subshape of the source shape compute coinsident sub-shapes
+ *        of the destination shape using an old implementation
+ *        of GetInPlace algorithm.
+ */
+//================================================================================
+
+Standard_Boolean GEOMImpl_CopyDriver::getInPlaceOld
+    (const Handle(GEOM_Function)                     &theSourceRef,
+     const TopTools_IndexedMapOfShape                &theSourceIndices,
+     const TopoDS_Shape                              &theDestinationShape,
+           TopTools_IndexedDataMapOfShapeListOfShape &theMapSourceDest) const
+{
+  const Standard_Integer aNbShapes = theSourceIndices.Extent();
+  Standard_Integer       i;
+  Standard_Integer       iErr;
+  TopTools_ListOfShape   aModifiedList;
+  GEOMImpl_ITransferData aTDSource(theSourceRef);
+
+  for (i = 1; i <= aNbShapes; ++i) {
+    const TopoDS_Shape      &aSource   = theSourceIndices.FindKey(i);
+    TCollection_AsciiString  aName     = aTDSource.GetName(aSource);
+    TCollection_AsciiString  aMaterial = aTDSource.GetMaterial(aSource);
+
+    if (aName.IsEmpty() && aMaterial.IsEmpty()) {
+      continue;
+    }
+
+    // Call old GetInPlace.
+    iErr = GEOMAlgo_GetInPlaceAPI::GetInPlaceOld
+      (theDestinationShape, aSource, aModifiedList);
+
+    if (iErr == 3) {
+      // Nothing is found. Skip.
+      continue;
+    }
+
+    if (iErr) {
+      // Error.
+      return Standard_False;
+    }
+
+    theMapSourceDest.Add(aSource, aModifiedList);
+  }
+
+  return Standard_True;
+}
+
+//================================================================================
+/*!
+ * \brief For each subshape of the source shape compute coinsident sub-shapes
+ *        of the destination shape using GetInPlaceByHistory algorithm.
+ */
+//================================================================================
+
+Standard_Boolean GEOMImpl_CopyDriver::getInPlaceByHistory
+    (const Handle(GEOM_Function)                     &theSourceRef,
+     const TopTools_IndexedMapOfShape                &theSourceIndices,
+     const TopoDS_Shape                              &theDestinationShape,
+     const Handle(GEOM_Function)                     &theDestinationRef,
+           TopTools_IndexedDataMapOfShapeListOfShape &theMapSourceDest) const
+{
+  const Standard_Integer aNbShapes = theSourceIndices.Extent();
+  Standard_Integer       i;
+  GEOMImpl_ITransferData aTDSource(theSourceRef);
+  TopTools_IndexedMapOfShape aDestIndices;
+
+  TopExp::MapShapes(theDestinationShape, aDestIndices);
+
+  for (i = 1; i <= aNbShapes; ++i) {
+    const TopoDS_Shape      &aSource   = theSourceIndices.FindKey(i);
+    TCollection_AsciiString  aName     = aTDSource.GetName(aSource);
+    TCollection_AsciiString  aMaterial = aTDSource.GetMaterial(aSource);
+
+    if (aName.IsEmpty() && aMaterial.IsEmpty()) {
+      continue;
+    }
+
+    // Call GetInPlaceByHistory.
+    TopTools_ListOfShape aModifiedList;
+    const Standard_Boolean isFound = GEOMAlgo_GetInPlaceAPI::GetInPlaceByHistory
+      (theDestinationRef, aDestIndices, aSource, aModifiedList);
+
+    if (isFound && !aModifiedList.IsEmpty()) {
+      theMapSourceDest.Add(aSource, aModifiedList);
+    }
+  }
+
+  return Standard_True;
+}
+
 IMPLEMENT_STANDARD_HANDLE (GEOMImpl_CopyDriver,GEOM_BaseDriver);
 
 IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_CopyDriver,GEOM_BaseDriver);
index 66380dbb33dfe60354368de31a3b7e4cc0f12b3d..cec1ba6aade6a4c51132eec50a6536d3ee74f042 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #ifndef _GEOMImpl_CopyDriver_HeaderFile
 #define _GEOMImpl_CopyDriver_HeaderFile
 
-#ifndef _TColStd_SequenceOfExtendedString_HeaderFile
-#include <TColStd_SequenceOfExtendedString.hxx>
-#endif
-#ifndef _Standard_TypeMismatch_HeaderFile
-#include <Standard_TypeMismatch.hxx>
-#endif
-
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-
-#ifndef _Standard_Macro_HeaderFile
-#include <Standard_Macro.hxx>
-#endif
-#ifndef _Standard_HeaderFile
-#include <Standard.hxx>
-#endif
-#ifndef _Standard_GUID_HeaderFile
-#include <Standard_GUID.hxx>
-#endif 
-
-#ifndef _TFunction_Driver_HeaderFile
-#include <TFunction_Driver.hxx>
-#endif
-#ifndef _TFunction_Logbook_HeaderFile
-#include <TFunction_Logbook.hxx>
-#endif
-#ifndef _Standard_CString_HeaderFile
-#include <Standard_CString.hxx>
-#endif
-
-class TColStd_SequenceOfExtendedString;
+class TopoDS_Shape;
+class TopTools_IndexedDataMapOfShapeListOfShape;
+class TopTools_IndexedMapOfShape;
+class Standard_GUID;
 
 
 #include "GEOM_BaseDriver.hxx"
 
+
 DEFINE_STANDARD_HANDLE( GEOMImpl_CopyDriver, GEOM_BaseDriver );
 
 class GEOMImpl_CopyDriver : public GEOM_BaseDriver {
@@ -82,6 +55,30 @@ Standard_EXPORT ~GEOMImpl_CopyDriver() {};
                               std::vector<GEOM_Param>& params);
 
 DEFINE_STANDARD_RTTI( GEOMImpl_CopyDriver )
+
+private:
+
+  Standard_Integer transferData(TFunction_Logbook& log) const;
+
+  Standard_Boolean getInPlace
+    (const TopoDS_Shape                              &theSourceShape,
+     const TopTools_IndexedMapOfShape                &theSourceIndices,
+     const TopoDS_Shape                              &theDestinationShape,
+           TopTools_IndexedDataMapOfShapeListOfShape &theMapSourceDest) const;
+
+  Standard_Boolean getInPlaceOld
+    (const Handle(GEOM_Function)                     &theSourceShapeRef,
+     const TopTools_IndexedMapOfShape                &theSourceIndices,
+     const TopoDS_Shape                              &theDestinationShape,
+           TopTools_IndexedDataMapOfShapeListOfShape &theMapSourceDest) const;
+
+  Standard_Boolean getInPlaceByHistory
+    (const Handle(GEOM_Function)                     &theSourceShapeRef,
+     const TopTools_IndexedMapOfShape                &theSourceIndices,
+     const TopoDS_Shape                              &theDestinationShape,
+     const Handle(GEOM_Function)                     &theDestinationRef,
+           TopTools_IndexedDataMapOfShapeListOfShape &theMapSourceDest) const;
+
 };
 
 #endif
index 3c91625b3440790a4358348d62a19c79447fafae..e7b2bd95d565164114b0f839b90876591b87011d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -119,7 +119,7 @@ Standard_Integer GEOMImpl_CylinderDriver::Execute(TFunction_Logbook& log) const
       BRepPrimAPI_MakeCylinder MC (anAxes, aCI.GetR(), Abs(aCI.GetH()));
       MC.Build();
       if (!MC.IsDone()) {
-       StdFail_NotDone::Raise("Cylinder can't be computed from the given parameters");
+        StdFail_NotDone::Raise("Cylinder can't be computed from the given parameters");
       }
       aShape = MC.Shape();
       break;
@@ -130,7 +130,7 @@ Standard_Integer GEOMImpl_CylinderDriver::Execute(TFunction_Logbook& log) const
       BRepPrimAPI_MakeCylinder MC (anAxes, aCI.GetR(), Abs(aCI.GetH()), aCI.GetA());
       MC.Build();
       if (!MC.IsDone()) {
-       StdFail_NotDone::Raise("Cylinder can't be computed from the given parameters. Failure.");
+        StdFail_NotDone::Raise("Cylinder can't be computed from the given parameters. Failure.");
       }
       aShape = MC.Shape();
       break;
@@ -169,16 +169,28 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam( theParams, "Radius", aCI.GetR() );
     AddParam( theParams, "Height", aCI.GetH() );
     break;
-  case CONE_PNT_VEC_R1_R2_H:
+  case CYLINDER_R_H_A:
+    AddParam( theParams, "Radius", aCI.GetR() );
+    AddParam( theParams, "Height", aCI.GetH() );
+    AddParam( theParams, "Angle",  aCI.GetA() );
+    break;
+  case CYLINDER_PNT_VEC_R_H:
     AddParam( theParams, "Base Point", aCI.GetPoint() );
     AddParam( theParams, "Vector", aCI.GetVector() );
     AddParam( theParams, "Radius", aCI.GetR() );
     AddParam( theParams, "Height", aCI.GetH() );
     break;
+  case CYLINDER_PNT_VEC_R_H_A:
+    AddParam( theParams, "Base Point", aCI.GetPoint() );
+    AddParam( theParams, "Vector", aCI.GetVector() );
+    AddParam( theParams, "Radius", aCI.GetR() );
+    AddParam( theParams, "Height", aCI.GetH() );
+    AddParam( theParams, "Angle",  aCI.GetA() );
+    break;
   default:
     return false;
   }
-  
+
   return true;
 }
 
index c1aeb491aefd8e3f10729102821571062714df3c..c36fd147d0e527c43c085c6ea88b0fbcf2a35c2f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
old mode 100755 (executable)
new mode 100644 (file)
index 3fcab04..460f105
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -41,6 +41,7 @@
 
 #include <Standard_ConstructionError.hxx>
 #include <Precision.hxx>
+#include <gp_Pln.hxx>
 #include <gp_Pnt.hxx>
 #include <gp_Vec.hxx>
 #include <gp_Circ.hxx>
@@ -91,12 +92,15 @@ Standard_Integer GEOMImpl_DiskDriver::Execute(TFunction_Logbook& log) const
       TopExp::Vertices(anE, V1, V2, Standard_True);
       if (!V1.IsNull() && !V2.IsNull()) {
         gp_Vec aV (BRep_Tool::Pnt(V1), BRep_Tool::Pnt(V2));
-        gp_Ax2 anAxes (aP, -aV);
-        gp_Circ aCirc (anAxes, aCI.GetRadius());
+        gp_Ax2 anAxes (aP, aV);
+        gp_Ax3 anAxes3(anAxes);
+        gp_Pln aPln(anAxes3);
+        gp_Ax2 anAxes1(aP, -aV);
+        gp_Circ aCirc (anAxes1, aCI.GetRadius());
         TopoDS_Shape aCircle = BRepBuilderAPI_MakeEdge(aCirc).Edge();
         BRepBuilderAPI_MakeWire MW;
         MW.Add(TopoDS::Edge(aCircle));
-        BRepBuilderAPI_MakeFace MF (MW, Standard_False);
+        BRepBuilderAPI_MakeFace MF (aPln, MW);
         aShape = MF.Shape();
       }
     }
@@ -121,10 +125,14 @@ Standard_Integer GEOMImpl_DiskDriver::Execute(TFunction_Logbook& log) const
       if (gp_Vec(aP1, aP2).IsParallel(gp_Vec(aP1, aP3), Precision::Angular()))
         Standard_ConstructionError::Raise("Disk creation aborted: points lay on one line");
       Handle(Geom_Circle) aCirc = GC_MakeCircle(aP3, aP2, aP1).Value();
+      gp_Circ aGpCirc = aCirc->Circ();
+      gp_Ax2 anAxes = aGpCirc.Position();
+      gp_Ax3 anAxes3(anAxes.Location(), -anAxes.Direction());
+      gp_Pln aPln(anAxes3);
       TopoDS_Shape aCircle = BRepBuilderAPI_MakeEdge(aCirc).Edge();
       BRepBuilderAPI_MakeWire MW;
       MW.Add(TopoDS::Edge(aCircle));
-      BRepBuilderAPI_MakeFace MF (MW, Standard_False);
+      BRepBuilderAPI_MakeFace MF (aPln, MW);
       aShape = MF.Shape();
     }  
   }
@@ -139,12 +147,15 @@ Standard_Integer GEOMImpl_DiskDriver::Execute(TFunction_Logbook& log) const
     else if (anOrient == 3)
       aV = gp::DY();
 
-    gp_Ax2 anAxes (aP, -aV);
-    gp_Circ aCirc (anAxes, aCI.GetRadius());
+    gp_Ax2 anAxes (aP, aV);
+    gp_Ax2 anAxes1(aP, -aV);
+    gp_Ax3 anAxes3(anAxes);
+    gp_Pln aPln(anAxes3);
+    gp_Circ aCirc (anAxes1, aCI.GetRadius());
     TopoDS_Shape aCircle = BRepBuilderAPI_MakeEdge(aCirc).Edge();
     BRepBuilderAPI_MakeWire MW;
     MW.Add(TopoDS::Edge(aCircle));
-    BRepBuilderAPI_MakeFace MF (MW, Standard_False);
+    BRepBuilderAPI_MakeFace MF (aPln, MW);
     aShape = MF.Shape();
   }
    else {
index 039958676908562a23921ba3f43a2f983fda31ca..6d9911108d95bb92bbabe94f29029e66900b0574 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 72fc19c0320db2069d1fc7bbf6583e5e63c95ae6..5f99502204159c2aac1edc062e83a6ef5b4baa86 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c839b8edc7a0eef249c20b5d93870771f0823aa0..4f36f153514b62e678bc032f927192cd76fa6677 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 8e177e9a686f6d175b15b12bab1e802ec0f8d31c..9ee9c61a6b1dc08062eb575cdfe8fc64945308cc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 62933b053d1be48a864ac90cd59c93e68e4951ef..ba2724f0f015f2c546cbb828fd4f15d95f074b79 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1e42276054f8c37e952ca7ffb1ea4cb3d0b0b23b..4e4e9315f93832f90eac32886ed8f6a31b35692a 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 05816d1d0b1fac87508852b8cd48e666ab9d6200..335bcdf7d65d71dd0b58e52798bf78792525bd66 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 213f325ce94e573b4a0fc889212507ced4c01615..96c30e6a67f94b21a21622fe510b5f51715d4dcd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -83,6 +83,20 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam( theParams, "Step", data.GetStepID() );
     AddParam( theParams, "Stamp", data.GetStepStamp() );
   }
+  else if ( funType == GEOM_Field::FUN_CHANGE_COMP_NAMES )
+  {
+    theOperationName = "Change component names";
+  }
+  else if ( funType == GEOM_Field::FUN_CHANGE_STEP_STAMP )
+  {
+    theOperationName = "Change stamp";
+    AddParam( theParams, "Stamp", data.GetStepStamp() );
+  }
+  else if ( funType == GEOM_Field::FUN_CHANGE_VALUE )
+  {
+    theOperationName = "FIELD_EDIT";//"Change values";
+    AddParam( theParams, "Values", "..." );
+  }
   else
   {
     return false;
index 8bb714a8e8b20fed2ce83c67041f9dac7e49b204..6f040c7acb9b286dc27d43411facff54a9ce86c3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 6da8953a07b38a635a48c7dcb6b292d8e8a1f70b..b58136b03228defb569bc2ba2e09bbc6672065d7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include <Precision.hxx>
 #include <TColStd_ListIteratorOfListOfReal.hxx>
 #include <IntRes2d_IntersectionSegment.hxx>
+#include <TopExp.hxx>
+
+
+/**
+ * This function returns Standard_True if it is possible to divide edge, i.e.
+ * if one parameter either start or end one is inside the edge. This function
+ * is used in the method GEOMImpl_Fillet1d::Result.
+ *
+ * \param theEdge the edge
+ * \param theStart the start parameter
+ * \param theEnd the end parameter
+ * \return Standard_True if it is possible to split edge;
+ *         Standard_False otherwise.
+ */
+static Standard_Boolean IsDivideEdge(const TopoDS_Edge   &theEdge,
+                                     const Standard_Real  theStart,
+                                     const Standard_Real  theEnd)
+{
+  Standard_Real      aFirst;
+  Standard_Real      aLast;
+  Handle(Geom_Curve) aCurve    = BRep_Tool::Curve(theEdge, aFirst, aLast);
+  gp_Pnt             aPStart   = aCurve->Value(theStart);
+  gp_Pnt             aPEnd     = aCurve->Value(theEnd);
+  TopoDS_Vertex      aVFirst   = TopExp::FirstVertex(theEdge);
+  TopoDS_Vertex      aVLast    = TopExp::FirstVertex(theEdge);
+  Standard_Real      aTolFirst = BRep_Tool::Tolerance(aVFirst);
+  Standard_Real      aTolLast  = BRep_Tool::Tolerance(aVLast);
+  Standard_Real      aTolConf  = Precision::Confusion();
+  gp_Pnt             aPFirst   = BRep_Tool::Pnt(aVFirst);
+  gp_Pnt             aPLast    = BRep_Tool::Pnt(aVLast);
+  Standard_Real      aDistSF   = aPStart.Distance(aPFirst);
+  Standard_Real      aDistSL   = aPStart.Distance(aPLast);
+  Standard_Real      aDistEF   = aPEnd.Distance(aPFirst);
+  Standard_Real      aDistEL   = aPEnd.Distance(aPLast);
+  Standard_Boolean   isSplit   = Standard_True;
+
+  if (aDistSF <= aTolFirst + aTolConf ||
+      aDistSL <= aTolLast  + aTolConf) {
+    if (aDistEF <= aTolFirst + aTolConf ||
+        aDistEL <= aTolLast  + aTolConf) {
+      isSplit   = Standard_False;
+    }
+  }
+
+  return isSplit;
+}
 
 /**
  * class GEOMImpl_Fillet1d
@@ -617,7 +663,7 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint,
   else
     anEnd = aNearest->GetParam();
 
-  if (fabs(aStart - anEnd) > Precision::Confusion())
+  if (IsDivideEdge(myEdge1, aStart, anEnd))
   {
       //Divide edge
       BRepBuilderAPI_MakeEdge aDivider1(aCurve, aStart, anEnd);
@@ -636,7 +682,7 @@ TopoDS_Edge GEOMImpl_Fillet1d::Result(const gp_Pnt& thePoint,
   else
     anEnd = aNearest->GetParam2();
 
-  if (fabs(aStart - anEnd) > Precision::Confusion())
+  if (IsDivideEdge(myEdge2, aStart, anEnd))
   {
       BRepBuilderAPI_MakeEdge aDivider2(aCurve, aStart, anEnd);
       if (myEdgesExchnged)
index edec66a2580aab197f42bb43eef392170d11fefc..fefaf673220aaff622d5aa346205cc3defa51d9b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index ea4fd94d35ec0f20301da65446145768fc368e0a..7fa3cbe52f1bd7cc67b8111467ad5c259c2a6857 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -251,6 +251,11 @@ Standard_Integer GEOMImpl_Fillet1dDriver::Execute(TFunction_Logbook& log) const
     MakeFillet(aWireNew, aVertexListNew, rad, isFinalPass, aResult);
   }
 
+  if (!GEOMUtils::CheckShape(aResult, true) &&
+      !GEOMUtils::FixShapeTolerance(aResult)) {
+    Standard_ConstructionError::Raise("Non valid shape result");
+  }
+
   aFunction->SetValue(aResult);
   log.SetTouched(Label());
 
index cafabd15b5fede981b4276b37cb19e3b20d76d66..2d74b1796f60615f46bc5921546ea148df5432a3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index ad3fb2d12522483c5e3bad87c76f833bea3c4567..0374c21c4283ff4dbf1e4ce84d298a098ddb1cea 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_Fillet2dDriver.hxx>
 #include <GEOMImpl_IFillet2d.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOMImpl_ILocalOperations.hxx>
 #include <GEOMImpl_Block6Explorer.hxx>
 #include <GEOM_Function.hxx>
+#include <GEOMUtils.hxx>
 
 #include <BRepFilletAPI_MakeFillet2d.hxx>
-#include <BRepCheck_Analyzer.hxx>
-#include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
 
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
-#include <TopoDS_Edge.hxx>
 #include <TopoDS_Iterator.hxx>
 #include <TopAbs.hxx>
-#include <TopExp_Explorer.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
 
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
-#include <Precision.hxx>
-#include <gp_Pnt.hxx>
 #include <StdFail_NotDone.hxx>
 
 //=======================================================================
index c3e1a4572f919551e81e7c5eee3e95b74e9f83c5..d4a58befaff0754a9785ba6c44563217439e4733 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 33e942e793d79bdd18626c942dc78fb9fa12b920..034d2f274d8e56ffad30d3d32987ab8a16740f4b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_FilletDriver.hxx>
 #include <GEOMImpl_IFillet.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOMImpl_ILocalOperations.hxx>
+#include <GEOMUtils.hxx>
 #include <GEOM_Function.hxx>
 
 #include <BRepFilletAPI_MakeFillet.hxx>
-#include <BRepCheck_Analyzer.hxx>
-#include <BRep_Tool.hxx>
-
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopAbs.hxx>
 #include <TopExp_Explorer.hxx>
-
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
-#include <Precision.hxx>
-#include <gp_Pnt.hxx>
 #include <StdFail_NotDone.hxx>
 
+// Debug PipeTShape function: uncomment the macro below to correct tolerance
+// of resulting face after fillet creation
+// VSR 30/12/2014: macro disabled
+//#define FIX_FACE_TOLERANCE
+// Debug PipeTShape function: uncomment the macro below to correct tolerance
+// of resulting curves after fillet creation
+// VSR 30/12/2014: macro disabled
+//#define FIX_CURVES_TOLERANCES
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -131,24 +130,20 @@ Standard_Integer GEOMImpl_FilletDriver::Execute(TFunction_Logbook& log) const
   if (!fill.IsDone()) {
     StdFail_NotDone::Raise("Fillet can't be computed on the given shape with the given radius");
   }
-  aShape = fill.Shape();
+  aShape = GEOMUtils::ReduceCompound( fill.Shape() );
 
   if (aShape.IsNull()) return 0;
 
-  // Check shape validity
-  BRepCheck_Analyzer ana (aShape, false);
-  if (!ana.IsValid()) {
-    // 08.07.2008 added by skl during fixing bug 19761 from Mantis
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape, Precision::Confusion(),
-                        Precision::Confusion(), TopAbs_SHAPE);
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-    ana.Init(aShape);
-    if (!ana.IsValid())
-      StdFail_NotDone::Raise("Fillet algorithm have produced an invalid shape result");
-  }
+#if defined(FIX_CURVES_TOLERANCES)
+  bool isOk = GEOMUtils::FixShapeCurves(aShape);
+#elif defined(FIX_FACE_TOLERANCE)
+  bool isOk = GEOMUtils::FixShapeTolerance(aShape, TopAbs_FACE);
+#else
+  // 08.07.2008 added by skl during fixing bug 19761 from Mantis
+  bool isOk = GEOMUtils::CheckShape(aShape) || GEOMUtils::FixShapeTolerance(aShape);
+#endif
+  if ( !isOk )
+    StdFail_NotDone::Raise("Fillet algorithm have produced an invalid shape result");
 
   aFunction->SetValue(aShape);
 
index 0c96de415508cd711b3d9d127e6722ee6ca24664..09c5b0791169cce011590b488d7cab91681ca507 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 57d0317cb35e7c52f8473fb574648278a05c6a08..6fc53d0b62ba0ac3e69acf0fe9e54de2c2406a21 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <Basics_OCCTVersion.hxx>
 
-#include <ShapeFix_Face.hxx>
-
-#include <BRep_Tool.hxx>
 #include <BRepAlgo.hxx>
-#include <BRep_Builder.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
 #include <BRepBuilderAPI_Copy.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+#include <BRepOffsetAPI_MakeFilling.hxx>
 
-#include <TopAbs.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Vertex.hxx>
-
+#include <GeomAPI_PointsToBSpline.hxx>
+#include <GeomAPI_PointsToBSplineSurface.hxx>
+#include <GeomFill_AppSurf.hxx>
+#include <GeomFill_Line.hxx>
+#include <GeomFill_SectionGenerator.hxx>
+#include <Geom_BSplineCurve.hxx>
+#include <Geom_BSplineSurface.hxx>
+#include <Geom_BezierCurve.hxx>
+#include <Geom_Circle.hxx>
 #include <Geom_Curve.hxx>
+#include <Geom_Ellipse.hxx>
+#include <Geom_Line.hxx>
 #include <Geom_Surface.hxx>
 #include <Geom_TrimmedCurve.hxx>
-#include <Geom_Line.hxx>
-#include <Geom_Circle.hxx>
-#include <Geom_Ellipse.hxx>
-#include <Geom_BezierCurve.hxx>
-#include <Geom_BSplineCurve.hxx>
-#include <Geom_BSplineSurface.hxx>
-#include <GeomFill_Line.hxx>
-#include <GeomFill_AppSurf.hxx>
-#include <GeomFill_SectionGenerator.hxx>
-#include <GeomAPI_PointsToBSplineSurface.hxx>
-#include <GeomAPI_PointsToBSpline.hxx>
 
-#include <TColGeom_SequenceOfCurve.hxx>
+#include <Precision.hxx>
+#include <ShapeFix_Face.hxx>
 
-#include <TColgp_SequenceOfPnt.hxx>
+#include <TColGeom_SequenceOfCurve.hxx>
 #include <TColgp_Array1OfPnt.hxx>
+#include <TColgp_SequenceOfPnt.hxx>
 
-#include <Precision.hxx>
+#include <TopAbs.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopTools_SequenceOfShape.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Vertex.hxx>
 
 #include <Standard_ConstructionError.hxx>
 
@@ -98,203 +99,255 @@ Standard_Integer GEOMImpl_FillingDriver::Execute(TFunction_Logbook& log) const
   if (Label().IsNull()) return 0;
   Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
   if (aFunction.IsNull()) return 0;
-  if (aFunction->GetType() != BASIC_FILLING) return 0;
-
-  GEOMImpl_IFilling IF (aFunction);
-  Handle(GEOM_Function) aShapeFunction = IF.GetShape();
-  if (aShapeFunction.IsNull()) return 0;
-
   TopoDS_Shape aShape;
-  BRepBuilderAPI_Copy Copy (aShapeFunction->GetValue());
-  if (Copy.IsDone())
-    aShape = Copy.Shape();
-
-  if (aShape.IsNull() || aShape.ShapeType() != TopAbs_COMPOUND) return 0;
-
-  Standard_Integer mindeg = IF.GetMinDeg();
-  Standard_Integer maxdeg = IF.GetMaxDeg();
-  Standard_Real tol3d = IF.GetTol3D();
-  Standard_Boolean isApprox = IF.GetApprox();
+  GEOMImpl_IFilling IF (aFunction);
+  if( aFunction->GetType() == BASIC_FILLING )
+  {
+    GEOMImpl_IFilling IF (aFunction);
+    Standard_Integer   mindeg = IF.GetMinDeg();
+    Standard_Integer   maxdeg = IF.GetMaxDeg();
+    Standard_Real       tol3d = IF.GetTol3D();
+    Standard_Boolean isApprox = IF.GetApprox();
+
+    if (mindeg > maxdeg) {
+      Standard_RangeError::Raise("Minimal degree can not be more than maximal degree");
+    }
 
-  if (mindeg > maxdeg) {
-    Standard_RangeError::Raise("Minimal degree can not be more than maximal degree");
-  }
+    /* we verify the contents of the shape */
+    TopExp_Explorer Ex;
+    TopoDS_Shape Scurrent;
+    Standard_Real First, Last;
+    Handle(Geom_Curve) C;
+
+    TopoDS_Compound aComp;
+    BRep_Builder B;
+    B.MakeCompound(aComp);
+
+    // input is either a list or compound of contours
+    TopTools_SequenceOfShape contours;
+    Handle(TColStd_HSequenceOfTransient) aShapeFunctions = IF.GetShapes();
+    if ( aShapeFunctions.IsNull() || aShapeFunctions->IsEmpty() ) return 0;
+    for ( int i = 1; i <= aShapeFunctions->Length(); ++i )
+    {
+      Handle(GEOM_Function) fun = Handle(GEOM_Function)::DownCast( aShapeFunctions->Value( i ));
+      if ( fun.IsNull() ) return 0;
+      TopoDS_Shape s = fun->GetValue();
+      if ( s.IsNull() ) return 0;
+      BRepBuilderAPI_Copy Copy (s);
+      if ( Copy.IsDone() )
+        contours.Append( Copy.Shape() );
+    }
 
-  /* we verify the contents of the shape */
-  TopExp_Explorer Ex;
-  TopoDS_Shape Scurrent;
-  Standard_Real First, Last;
-  Handle(Geom_Curve) C;
-
-  TopoDS_Compound aComp;
-  BRep_Builder B;
-  B.MakeCompound(aComp);
-
-  // 1. Convert argument wires, if any, into BSpline edges
-  TopoDS_Iterator It (aShape);
-  for (; It.More(); It.Next()) {
-    Scurrent = It.Value();
-    if (Scurrent.ShapeType() != TopAbs_EDGE) {
-      TopoDS_Edge NewEdge;
-      if (Scurrent.ShapeType() == TopAbs_WIRE)
-      {
-        const TopoDS_Wire& CurWire = TopoDS::Wire(Scurrent);
-        NewEdge = BRepAlgo::ConcatenateWireC0(CurWire);
-      }
-      if (NewEdge.IsNull()) {
-        Standard_ConstructionError::Raise("The argument compound must contain only edges");
+    // 1. Convert argument wires, if any, into BSpline edges
+    for ( int i = 1; i <= contours.Length(); ++i )
+    {
+      Scurrent = contours.Value( i );
+      if (Scurrent.ShapeType() != TopAbs_EDGE) {
+      
+        if (Scurrent.ShapeType() == TopAbs_WIRE)
+        {
+          const TopoDS_Wire& CurWire = TopoDS::Wire(Scurrent);
+          TopoDS_Edge NewEdge = BRepAlgo::ConcatenateWireC0(CurWire);
+          if (NewEdge.IsNull())
+            Standard_ConstructionError::Raise("Failed to join several edges into one");
+          Scurrent = NewEdge;
+        }
+        else if (Scurrent.ShapeType() == TopAbs_COMPOUND)
+        {
+          for ( TopoDS_Iterator It( Scurrent ); It.More(); It.Next() )
+            contours.Append( It.Value() );
+          continue;
+        }
+        else
+        {
+          Standard_ConstructionError::Raise("Input must contain only edges or/and wires");
+        }
       }
-      Scurrent = NewEdge;
+      B.Add(aComp,Scurrent);
     }
-    B.Add(aComp,Scurrent);
-  }
-  aShape = aComp;
-
-  // 2. The surface construction
-  if (!isApprox) {
-    // make filling as in old version of SALOME (before 4.1.1)
-
-    Standard_Real tol2d = IF.GetTol2D();
-    Standard_Integer nbiter = IF.GetNbIter();
-    Standard_Integer aMethod = IF.GetMethod();
-
-    GeomFill_SectionGenerator Section;
-    Standard_Integer i = 0;
-    Handle(Geom_Curve) aLastC;
-    gp_Pnt PL1,PL2;
-    for (Ex.Init(aShape, TopAbs_EDGE); Ex.More(); Ex.Next()) {
-      Scurrent = Ex.Current();
-      if (Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE) return 0;
-      if (BRep_Tool::Degenerated(TopoDS::Edge(Scurrent))) continue;
-      C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
-      //if (Scurrent.Orientation() == TopAbs_REVERSED)
-      //  // Mantis isuue 0020659: consider the orientation of the edges
-      //  C = new Geom_TrimmedCurve(C, Last, First);
-      //else
-      //  C = new Geom_TrimmedCurve(C, First, Last);
-      C = new Geom_TrimmedCurve(C, First, Last);
-      gp_Pnt P1,P2;
-      C->D0(First,P1);
-      C->D0(Last,P2);
-
-      if (aMethod == 1 && Scurrent.Orientation() == TopAbs_REVERSED) {
-        C->Reverse();
-      }
-      else if (aMethod == 2) {
-        if (i == 0) {
-          PL1 = P1;
-          PL2 = P2;
+    aShape = aComp;
+
+    // 2. The surface construction
+    if (!isApprox) {
+      // make filling as in old version of SALOME (before 4.1.1)
+
+      Standard_Real      tol2d = IF.GetTol2D();
+      Standard_Integer  nbiter = IF.GetNbIter();
+      Standard_Integer aMethod = IF.GetMethod();
+
+      GeomFill_SectionGenerator Section;
+      Standard_Integer i = 0;
+      Handle(Geom_Curve) aLastC;
+      gp_Pnt PL1,PL2;
+      for (Ex.Init(aShape, TopAbs_EDGE); Ex.More(); Ex.Next()) {
+        Scurrent = Ex.Current();
+        if (Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE) return 0;
+        if (BRep_Tool::Degenerated(TopoDS::Edge(Scurrent))) continue;
+        C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
+        //if (Scurrent.Orientation() == TopAbs_REVERSED)
+        //  // Mantis isuue 0020659: consider the orientation of the edges
+        //  C = new Geom_TrimmedCurve(C, Last, First);
+        //else
+        //  C = new Geom_TrimmedCurve(C, First, Last);
+        C = new Geom_TrimmedCurve(C, First, Last);
+        gp_Pnt P1,P2;
+        C->D0(First,P1);
+        C->D0(Last,P2);
+
+        if (aMethod == 1 && Scurrent.Orientation() == TopAbs_REVERSED) {
+          C->Reverse();
         }
-        else {
-          double d1 = PL1.Distance(P1) + PL2.Distance(P2);
-          double d2 = PL1.Distance(P2) + PL2.Distance(P1);
-          if (d2 < d1) {
-            C->Reverse();
-            PL1 = P2;
-            PL2 = P1;
-          }
-          else {
+        else if (aMethod == 2) {
+          if (i == 0) {
             PL1 = P1;
             PL2 = P2;
           }
+          else {
+            double d1 = PL1.Distance(P1) + PL2.Distance(P2);
+            double d2 = PL1.Distance(P2) + PL2.Distance(P1);
+            if (d2 < d1) {
+              C->Reverse();
+              PL1 = P2;
+              PL2 = P1;
+            }
+            else {
+              PL1 = P1;
+              PL2 = P2;
+            }
+          }
         }
-      }
 
-      Section.AddCurve(C);
-      i++;
-    }
+        Section.AddCurve(C);
+        i++;
+      }
 
-    /* a 'tolerance' is used to compare 2 knots : see GeomFill_Generator.cdl */
-    Section.Perform(Precision::Confusion());
-    Handle(GeomFill_Line) Line = new GeomFill_Line(i);
+      /* a 'tolerance' is used to compare 2 knots : see GeomFill_Generator.cdl */
+      Section.Perform(Precision::PConfusion());
+      Handle(GeomFill_Line) Line = new GeomFill_Line(i);
 
-    GeomFill_AppSurf App (mindeg, maxdeg, tol3d, tol2d, nbiter); /* user parameters */
-    App.Perform(Line, Section);
+      GeomFill_AppSurf App (mindeg, maxdeg, tol3d, tol2d, nbiter); /* user parameters */
+      App.Perform(Line, Section);
 
-    if (!App.IsDone()) return 0;
-    Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots;
-    App.SurfShape(UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots);
-    Handle(Geom_BSplineSurface) GBS = new Geom_BSplineSurface
-      (App.SurfPoles(), App.SurfWeights(), App.SurfUKnots(), App.SurfVKnots(),
-       App.SurfUMults(), App.SurfVMults(), App.UDegree(), App.VDegree());
+      if (!App.IsDone()) return 0;
+      Standard_Integer UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots;
+      App.SurfShape(UDegree, VDegree, NbUPoles, NbVPoles, NbUKnots, NbVKnots);
+      Handle(Geom_BSplineSurface) GBS = new Geom_BSplineSurface
+        (App.SurfPoles(), App.SurfWeights(), App.SurfUKnots(), App.SurfVKnots(),
+         App.SurfUMults(), App.SurfVMults(), App.UDegree(), App.VDegree());
 
-    if (GBS.IsNull()) return 0;
-    aShape = BRepBuilderAPI_MakeFace(GBS, Precision::Confusion());
-  }
-  else {
-    // implemented by skl 20.03.2008 for bug 16568
-    // make approximation - try to create bspline surface
-    // using GeomAPI_PointsToBSplineSurface
-
-    TColGeom_SequenceOfCurve aSeq;
-    int MaxNbPoles = 0;
-
-    // add curves from edges to sequence and find maximal
-    // number of poles if some of them are bsplines
-    for (Ex.Init(aShape, TopAbs_EDGE); Ex.More(); Ex.Next()) {
-      Scurrent = Ex.Current();
-      if (Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE) return 0;
-      if (BRep_Tool::Degenerated(TopoDS::Edge(Scurrent))) continue;
-      C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
-      Handle(Geom_TrimmedCurve) TC = Handle(Geom_TrimmedCurve)::DownCast(C);
-      if (TC.IsNull()) {
-        Handle(Geom_BSplineCurve) BC = Handle(Geom_BSplineCurve)::DownCast(C);
-        if (!BC.IsNull()) {
-          MaxNbPoles = Max(MaxNbPoles,BC->NbPoles());
+      if (GBS.IsNull()) return 0;
+      aShape = BRepBuilderAPI_MakeFace(GBS, Precision::Confusion());
+    }
+    else {
+      // implemented by skl 20.03.2008 for bug 16568
+      // make approximation - try to create bspline surface
+      // using GeomAPI_PointsToBSplineSurface
+
+      TColGeom_SequenceOfCurve aSeq;
+      int MaxNbPoles = 0;
+
+      // add curves from edges to sequence and find maximal
+      // number of poles if some of them are bsplines
+      for (Ex.Init(aShape, TopAbs_EDGE); Ex.More(); Ex.Next()) {
+        Scurrent = Ex.Current();
+        if (Scurrent.IsNull() || Scurrent.ShapeType() != TopAbs_EDGE) return 0;
+        if (BRep_Tool::Degenerated(TopoDS::Edge(Scurrent))) continue;
+        C = BRep_Tool::Curve(TopoDS::Edge(Scurrent), First, Last);
+        Handle(Geom_TrimmedCurve) TC = Handle(Geom_TrimmedCurve)::DownCast(C);
+        if (TC.IsNull()) {
+          Handle(Geom_BSplineCurve) BC = Handle(Geom_BSplineCurve)::DownCast(C);
+          if (!BC.IsNull()) {
+            MaxNbPoles = Max(MaxNbPoles,BC->NbPoles());
+          }
         }
-      }
-      else {
-        Handle(Geom_BSplineCurve) BC = Handle(Geom_BSplineCurve)::DownCast(TC->BasisCurve());
-        if (BC.IsNull()) {
-          Handle(Geom_TrimmedCurve) TC1 = Handle(Geom_TrimmedCurve)::DownCast(TC->BasisCurve());
-          if (!TC1.IsNull()) {
-            BC = Handle(Geom_BSplineCurve)::DownCast(TC1->BasisCurve());
+        else {
+          Handle(Geom_BSplineCurve) BC = Handle(Geom_BSplineCurve)::DownCast(TC->BasisCurve());
+          if (BC.IsNull()) {
+            Handle(Geom_TrimmedCurve) TC1 = Handle(Geom_TrimmedCurve)::DownCast(TC->BasisCurve());
+            if (!TC1.IsNull()) {
+              BC = Handle(Geom_BSplineCurve)::DownCast(TC1->BasisCurve());
+            }
+          }
+          if (!BC.IsNull()) {
+            MaxNbPoles = Max(MaxNbPoles,BC->NbPoles());
           }
         }
-        if (!BC.IsNull()) {
-          MaxNbPoles = Max(MaxNbPoles,BC->NbPoles());
+        aSeq.Append(C);
+      }
+      // prepare array of points for creation bspline surface
+      // size of this array: by U parameter - number of curves,
+      // by V parameter - determ using MaxNbPoles but it's
+      // value must be between 21(min) and 101(max)
+      int nbc = aSeq.Length();
+      int nbp = Max(21, 2*MaxNbPoles-1);
+
+      // commented for Mantis issue 0021541
+      //if (nbp > 101) nbp = 101;
+
+      TColgp_Array2OfPnt Points (1, nbc, 1, nbp);
+      int ic = 1;
+      for (; ic <= nbc; ic++) {
+        Handle(Geom_Curve) C = aSeq.Value(ic);
+        double fp = C->FirstParameter();
+        double lp = C->LastParameter();
+        double dp = (lp-fp)/(nbp-1);
+        int j = 0;
+        gp_Pnt P;
+        for (; j < nbp; j++) {
+          C->D0(fp+dp*j, P);
+          Points.SetValue(ic, j+1, P);
+       }
+      }
+      GeomAPI_PointsToBSplineSurface PTB (Points, mindeg, maxdeg, GeomAbs_C2, tol3d);
+      Handle(Geom_BSplineSurface) BS = PTB.Surface();
+      BRepBuilderAPI_MakeFace BB (BS, Precision::Confusion());
+      TopoDS_Face NewF = BB.Face();
+      Handle(ShapeFix_Face) sff = new ShapeFix_Face (NewF);
+      sff->Perform();
+      sff->FixOrientation();
+      aShape = sff->Face();
+    }
+  }
+  else if( aFunction->GetType() == FILLING_ON_CONSTRAINTS )
+  {
+    BRepOffsetAPI_MakeFilling MakeFilling;
+
+    Handle(TColStd_HSequenceOfTransient) aConstraints = IF.GetShapes();
+
+    for ( unsigned int ind = 1; ind <= aConstraints->Length(); ind++ ) {
+      TopoDS_Edge E;
+      TopoDS_Face F;
+      Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast( aConstraints->Value(ind) );
+      if ( !aRefShape->GetValue().IsNull() && aRefShape->GetValue().ShapeType() == TopAbs_EDGE )
+        E = TopoDS::Edge(aRefShape->GetValue() );
+      else {
+        Standard_RangeError::Raise("Wrong parameters");
+      }
+      if ( ind < aConstraints->Length() ) {
+        Handle(GEOM_Function) aRefFaceShape = Handle(GEOM_Function)::DownCast( aConstraints->Value(ind+1) );
+        if ( !aRefFaceShape->GetValue().IsNull() && aRefFaceShape->GetValue().ShapeType() == TopAbs_FACE ) {
+          F = TopoDS::Face( aRefFaceShape->GetValue() );
+          ind++;
         }
       }
-      aSeq.Append(C);
+      if ( !F.IsNull() )
+        MakeFilling.Add( E, F, GeomAbs_G1 );
+      else
+        MakeFilling.Add( E, GeomAbs_C0 );
     }
-    // prepare array of points for creation bspline surface
-    // size of this array: by U parameter - number of curves,
-    // by V parameter - determ using MaxNbPoles but it's
-    // value must be between 21(min) and 101(max)
-    int nbc = aSeq.Length();
-    int nbp = Max(21, 2*MaxNbPoles-1);
-
-    // commented for Mantis issue 0021541
-    //if (nbp > 101) nbp = 101;
-
-    TColgp_Array2OfPnt Points (1, nbc, 1, nbp);
-    int ic = 1;
-    for (; ic <= nbc; ic++) {
-      Handle(Geom_Curve) C = aSeq.Value(ic);
-      double fp = C->FirstParameter();
-      double lp = C->LastParameter();
-      double dp = (lp-fp)/(nbp-1);
-      int j = 0;
-      gp_Pnt P;
-      for (; j < nbp; j++) {
-        C->D0(fp+dp*j, P);
-        Points.SetValue(ic, j+1, P);
-     }
+
+    MakeFilling.Build();
+    if ( !MakeFilling.IsDone() )
+    {
+      Standard_RangeError::Raise("Filling on constraints failed");
     }
-    GeomAPI_PointsToBSplineSurface PTB (Points, mindeg, maxdeg, GeomAbs_C2, tol3d);
-    Handle(Geom_BSplineSurface) BS = PTB.Surface();
-    BRepBuilderAPI_MakeFace BB (BS, Precision::Confusion());
-    TopoDS_Face NewF = BB.Face();
-    Handle(ShapeFix_Face) sff = new ShapeFix_Face (NewF);
-    sff->Perform();
-    sff->FixOrientation();
-    aShape = sff->Face();
+
+    aShape = TopoDS::Face( MakeFilling.Shape() );
   }
 
   /* We test the validity of resulting shape */
   if (!BRepAlgo::IsValid((aShape))) {
     Standard_ConstructionError::Raise("Algorithm has produced an invalid shape result");
-    return 0;
   }
 
   aFunction->SetValue(aShape);
@@ -324,7 +377,7 @@ GetCreationInformation(std::string&             theOperationName,
   switch ( aType ) {
   case BASIC_FILLING:
   {
-    AddParam( theParams, "Input compound", aCI.GetShape() );
+    AddParam( theParams, "Input compound", aCI.GetShapes() );
     AddParam( theParams, "Method", aCI.GetMethod() );
     const char* method[3] =
       { "Standard", "Use edges orientation", "Correct edges orientation" };
@@ -338,6 +391,12 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam( theParams, "Approximation", aCI.GetApprox() );
     break;
   }
+  case FILLING_ON_CONSTRAINTS:
+  {
+       theOperationName = "FACE";
+    AddParam( theParams, "Edges/Faces", aCI.GetShapes() );
+    break;
+  }
   default:
     return false;
   }
index a510b719b190182dc21c8726781dbed4869f99bd..c0243c185ecbc5dc8acde31d667e5653d6cf6d8c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 081bf21255d9beff033d080d1dcee6b5f2bc0e74..d441293324c2b0bc6731d3571e89796a31448c0c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 03d4d48b27f12a9e34cc71f9faca9b30a004d3ed..2a4d103c10e2734fcb238e4a5eab9d9867e33227 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1f03275c5a6da57af76f42aaa621f16523b4a4f3..42c064f741b2065d78757a99fc26f9f2c61e9e19 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include "utilities.h"
 
+#include <BRep_Builder.hxx>
+#include <ShapeFix_Shape.hxx>
 #include <TDataStd_IntegerArray.hxx>
-
 #include <TopExp.hxx>
-#include <TopoDS_Shape.hxx>
 #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
-#include <TopTools_ListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
-
-#include <ShapeFix_Shape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopoDS_Shape.hxx>
 
 #include <Standard_NullObject.hxx>
 #include <Standard_Failure.hxx>
@@ -324,9 +323,11 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFacesByList (const TopoDS_Shape& theShape,
 //function : GlueFaces
 //purpose  :
 //=======================================================================
-TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
-                                             const Standard_Real theTolerance,
-                                             const Standard_Boolean doKeepNonSolids)
+TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces
+          (const TopoDS_Shape                       &theShape,
+           const Standard_Real                       theTolerance,
+           const Standard_Boolean                    doKeepNonSolids,
+                 TopTools_DataMapOfShapeListOfShape *pMapModif)
 {
   TopoDS_Shape aRes;
 
@@ -410,6 +411,26 @@ TopoDS_Shape GEOMImpl_GlueDriver::GlueFaces (const TopoDS_Shape& theShape,
   // 5. Result
   aRes = aGA.Shape();
 
+  if (pMapModif) {
+    // Fill the map of modified shapes.
+    TopTools_IndexedMapOfShape aMapSubShapes;
+
+    TopExp::MapShapes(theShape, aMapSubShapes);
+    pMapModif->Clear();
+
+    const Standard_Integer aNbShapes = aMapSubShapes.Extent();
+    Standard_Integer       i;
+
+    for (i = 1; i <= aNbShapes; ++i) {
+      const TopoDS_Shape         &aSubShape = aMapSubShapes.FindKey(i);
+      const TopTools_ListOfShape &aModif    = aGA.Modified(aSubShape);
+
+      if (!aModif.IsEmpty()) {
+        pMapModif->Bind(aSubShape, aModif);
+      }
+    }
+  }
+
   return aRes;
 }
 
@@ -729,8 +750,36 @@ Standard_Integer GEOMImpl_GlueDriver::Execute(TFunction_Logbook& log) const
   TopoDS_Shape aShape;
   TCollection_AsciiString aWrn;
 
-  Handle(GEOM_Function) aRefBase = aCI.GetBase();
-  TopoDS_Shape aShapeBase = aRefBase->GetValue();
+  TopoDS_Shape aShapeBase;
+  Handle(TColStd_HSequenceOfTransient) aRefBases = aCI.GetBase();
+  if ( aRefBases && !aRefBases->IsEmpty() )
+  {
+    if ( aRefBases->Length() == 1 )
+    {
+      Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(aRefBases->Value(1));
+      if ( !aRefShape.IsNull() )
+        aShapeBase = aRefShape->GetValue();
+    }
+    else
+    {
+      TopoDS_Compound compound;
+      BRep_Builder builder;
+      builder.MakeCompound( compound );
+      int ind = 1;
+      for ( ; ind <= aRefBases->Length(); ind++)
+      {
+        Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(aRefBases->Value(ind));
+        if ( aRefShape.IsNull() ) break;
+        TopoDS_Shape aShape = aRefShape->GetValue();
+        if (aShape.IsNull()) break;
+        builder.Add( compound, aShape );
+      }
+      if ( ind > aRefBases->Length() )
+        aShapeBase = compound;
+      else
+        aShapeBase.Nullify();
+    }
+  }
   if (aShapeBase.IsNull()) {
     Standard_NullObject::Raise("Shape for gluing is null");
   }
@@ -803,18 +852,18 @@ GetCreationInformation(std::string&             theOperationName,
   switch ( aType ) {
   case GLUE_FACES:
     theOperationName = "GLUE_FACES";
-    AddParam( theParams, "Selected shape", aCI.GetBase() );
+    AddParam( theParams, "Selected shapes", aCI.GetBase() );
     AddParam( theParams, "Tolerance", aCI.GetTolerance() );
     AddParam( theParams, "To keep non solids", aCI.GetKeepNonSolids() );
     break;
   case GLUE_EDGES:
     theOperationName = "GLUE_EDGES";
-    AddParam( theParams, "Selected shape", aCI.GetBase() );
+    AddParam( theParams, "Selected shapes", aCI.GetBase() );
     AddParam( theParams, "Tolerance", aCI.GetTolerance() );
     break;
   case GLUE_FACES_BY_LIST:
     theOperationName = "GLUE_FACES";
-    AddParam( theParams, "Selected shape", aCI.GetBase() );
+    AddParam( theParams, "Selected shapes", aCI.GetBase() );
     AddParam( theParams, "Tolerance", aCI.GetTolerance() );
     AddParam( theParams, "Faces", aCI.GetFaces() );
     AddParam( theParams, "To keep non solids", aCI.GetKeepNonSolids() );
@@ -822,7 +871,7 @@ GetCreationInformation(std::string&             theOperationName,
     break;
   case GLUE_EDGES_BY_LIST:
     theOperationName = "GLUE_EDGES";
-    AddParam( theParams, "Selected shape", aCI.GetBase() );
+    AddParam( theParams, "Selected shapes", aCI.GetBase() );
     AddParam( theParams, "Tolerance", aCI.GetTolerance() );
     AddParam( theParams, "Edges", aCI.GetFaces() );
     break;
index a65a67d08cddd0633ff53e018290dbc58de7ce1b..7ebcbad8e47889682bd727100b2012048dd96b15 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -63,6 +63,7 @@
 #include <TCollection_AsciiString.hxx>
 
 class TColStd_SequenceOfExtendedString;
+class TopTools_DataMapOfShapeListOfShape;
 
 
 #include "GEOM_BaseDriver.hxx"
@@ -86,9 +87,11 @@ Standard_EXPORT ~GEOMImpl_GlueDriver() {};
   bool GetCreationInformation(std::string&             theOperationName,
                               std::vector<GEOM_Param>& params);
 
-Standard_EXPORT static TopoDS_Shape GlueFaces (const TopoDS_Shape& theShape,
-                                               const Standard_Real theTolerance,
-                                               const Standard_Boolean doKeepNonSolids = Standard_True);
+Standard_EXPORT static TopoDS_Shape GlueFaces
+   (const TopoDS_Shape                       &theShape,
+    const Standard_Real                       theTolerance,
+    const Standard_Boolean                    doKeepNonSolids = Standard_True,
+          TopTools_DataMapOfShapeListOfShape *pMapModif       = NULL);
   /*
 Standard_EXPORT TopoDS_Shape GlueFacesWithWarnings (const TopoDS_Shape& theShape,
                                                     const Standard_Real theTolerance,
index 09441ab23dd683491d274f440846ee1e0f7c035e..fab57241a61731153ec96b7e589dea27593da6ec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -20,8 +20,6 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_HealingDriver.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOMImpl_IHealing.hxx>
 
 #include <TNaming_CopyShape.hxx>
 
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
 #include <BRep_Builder.hxx>
 #include <BRepAdaptor_Curve.hxx>
-#include <BRepCheck_Analyzer.hxx>
 #include <BRepTools_WireExplorer.hxx>
 
 #include <TopExp.hxx>
@@ -142,9 +136,10 @@ Standard_Integer GEOMImpl_HealingDriver::Execute(TFunction_Logbook& log) const
     Sew(&HI, anOriginalShape, aShape, true);
     break;
   case REMOVE_INTERNAL_FACES:
-    RemoveInternalFaces(anOriginalShape, aShape);
+    RemoveInternalFaces(&HI, anOriginalShape, aShape);
     break;
   case DIVIDE_EDGE:
+  case DIVIDE_EDGE_BY_POINT:
     AddPointOnEdge(&HI, anOriginalShape, aShape);
     break;
   case CHANGE_ORIENTATION:
@@ -215,6 +210,8 @@ Standard_Boolean GEOMImpl_HealingDriver::ShapeProcess (GEOMImpl_IHealing* theHI,
   if (!aHealer.isDone())
     raiseNotDoneExeption( ShHealOper_NotError );
 
+  SaveStatistics( aHealer );
+
   return Standard_True;
 }
 
@@ -222,9 +219,9 @@ Standard_Boolean GEOMImpl_HealingDriver::ShapeProcess (GEOMImpl_IHealing* theHI,
 //function :  SupressFaces
 //purpose  :
 //=======================================================================
-void SuppressFacesRec (const TopTools_SequenceOfShape& theShapesFaces,
-                       const TopoDS_Shape&             theOriginalShape,
-                       TopoDS_Shape&                   theOutShape)
+void GEOMImpl_HealingDriver::SuppressFacesRec (const TopTools_SequenceOfShape& theShapesFaces,
+                                               const TopoDS_Shape&             theOriginalShape,
+                                               TopoDS_Shape&                   theOutShape) const
 {
   if ((theOriginalShape.ShapeType() != TopAbs_COMPOUND &&
        theOriginalShape.ShapeType() != TopAbs_COMPSOLID))
@@ -306,6 +303,21 @@ Standard_Boolean GEOMImpl_HealingDriver::SuppressFaces (GEOMImpl_IHealing* theHI
       theOutShape = GEOMImpl_GlueDriver::GlueFaces(aSh, Precision::Confusion(), Standard_True);
     }
   }
+  // count removed faces
+  TopTools_IndexedMapOfShape faces;
+  TopExp::MapShapes(theOriginalShape, TopAbs_FACE, faces);
+  int nbBefore = faces.Extent();
+  faces.Clear();
+  TopExp::MapShapes(theOutShape, TopAbs_FACE, faces);
+  int nbAfter = faces.Extent();
+
+  if ( nbAfter < nbBefore )
+  {
+    ShHealOper_Tool tool;
+    ShHealOper_ModifStats& stats = tool.GetStatistics();
+    stats.AddModif( "Face removed", nbBefore - nbAfter );
+    SaveStatistics( tool );
+  }
 
   return Standard_True;
 }
@@ -346,6 +358,8 @@ Standard_Boolean GEOMImpl_HealingDriver::CloseContour (GEOMImpl_IHealing* theHI,
   else
     raiseNotDoneExeption( aHealer.GetErrorStatus() );
 
+  SaveStatistics( aHealer );
+
   return aResult;
 }
 
@@ -382,6 +396,8 @@ Standard_Boolean GEOMImpl_HealingDriver::RemoveIntWires (GEOMImpl_IHealing* theH
   else
     raiseNotDoneExeption( aHealer.GetErrorStatus() );
 
+  SaveStatistics( aHealer );
+
   return aResult;
 }
 
@@ -418,6 +434,8 @@ Standard_Boolean GEOMImpl_HealingDriver::RemoveHoles (GEOMImpl_IHealing* theHI,
   else
     raiseNotDoneExeption( aHealer.GetErrorStatus() );
 
+  SaveStatistics( aHealer );
+
   return aResult;
 }
 
@@ -425,14 +443,26 @@ Standard_Boolean GEOMImpl_HealingDriver::RemoveHoles (GEOMImpl_IHealing* theHI,
 //function :  Sew
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMImpl_HealingDriver::Sew (GEOMImpl_IHealing* theHI,
+Standard_Boolean GEOMImpl_HealingDriver::Sew (GEOMImpl_IHealing*  theHI,
                                               const TopoDS_Shape& theOriginalShape,
-                                              TopoDS_Shape& theOutShape,
-                                              Standard_Boolean isAllowNonManifold) const
+                                              TopoDS_Shape&       theOutShape,
+                                              Standard_Boolean    isAllowNonManifold) const
 {
   Standard_Real aTol = theHI->GetTolerance();
 
-  ShHealOper_Sewing aHealer (theOriginalShape, aTol);
+  TopoDS_Compound aCompound;
+  BRep_Builder builder;
+  builder.MakeCompound( aCompound );
+
+  builder.Add( aCompound, theOriginalShape );
+  Handle(TColStd_HSequenceOfTransient) otherObjs = theHI->GetShapes();
+  for ( int ind = 1; ind <= otherObjs->Length(); ind++)
+  {
+    Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(otherObjs->Value(ind));
+    builder.Add( aCompound, aRefShape->GetValue() );
+  }
+
+  ShHealOper_Sewing aHealer (aCompound, aTol);
 
   // Set non-manifold mode.
   aHealer.SetNonManifoldMode(isAllowNonManifold);
@@ -444,6 +474,8 @@ Standard_Boolean GEOMImpl_HealingDriver::Sew (GEOMImpl_IHealing* theHI,
   else
     raiseNotDoneExeption( aHealer.GetErrorStatus() );
 
+  SaveStatistics( aHealer );
+
   return aResult;
 }
 
@@ -451,11 +483,44 @@ Standard_Boolean GEOMImpl_HealingDriver::Sew (GEOMImpl_IHealing* theHI,
 //function : RemoveInternalFaces
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMImpl_HealingDriver::RemoveInternalFaces (const TopoDS_Shape& theOriginalShape,
-                                                              TopoDS_Shape& theOutShape) const
+Standard_Boolean
+GEOMImpl_HealingDriver::RemoveInternalFaces (GEOMImpl_IHealing*  theHI,
+                                             const TopoDS_Shape& theOriginalShape,
+                                             TopoDS_Shape&       theOutShape) const
 {
+  // get all input shapes
+  TopTools_SequenceOfShape shapeSeq;
+  shapeSeq.Append( theOriginalShape );
+  Handle(TColStd_HSequenceOfTransient) otherObjs = theHI->GetShapes();
+  if ( !otherObjs.IsNull() )
+    for ( int ind = 1; ind <= otherObjs->Length(); ind++)
+    {
+      Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(otherObjs->Value(ind));
+      TopoDS_Shape aShape = aRefShape->GetValue();
+      if (aShape.IsNull())
+        Standard_NullObject::Raise("Null object given");
+      shapeSeq.Append( aShape );
+    }
+
+  // pass input shapes to the algorithm
   GEOMAlgo_RemoverWebs aTool;
-  aTool.SetShape(theOriginalShape);
+  if ( shapeSeq.Length() == 1 )
+  {
+    aTool.SetShape( shapeSeq.First() );
+  }
+  else
+  {
+    TopoDS_Compound solidCompound;
+    BRep_Builder builder;
+    builder.MakeCompound( solidCompound );
+    for ( int ind = 1; ind <= shapeSeq.Length(); ++ind )
+      for ( TopExp_Explorer so( shapeSeq( ind ), TopAbs_SOLID ); so.More(); so.Next() )
+        builder.Add( solidCompound, so.Current() );
+
+    aTool.SetShape( solidCompound );
+  }
+
+  // run the algorithm
   aTool.Perform();
 
   if (aTool.ErrorStatus() == 0) { // OK
@@ -481,26 +546,53 @@ Standard_Boolean GEOMImpl_HealingDriver::RemoveInternalFaces (const TopoDS_Shape
 //function :  AddPointOnEdge
 //purpose  :
 //=======================================================================
-Standard_Boolean GEOMImpl_HealingDriver::AddPointOnEdge (GEOMImpl_IHealing* theHI,
+Standard_Boolean GEOMImpl_HealingDriver::AddPointOnEdge (GEOMImpl_IHealing*  theHI,
                                                          const TopoDS_Shape& theOriginalShape,
-                                                         TopoDS_Shape& theOutShape) const
+                                                         TopoDS_Shape&       theOutShape) const
 {
   Standard_Boolean isByParameter = theHI->GetIsByParameter();
-  Standard_Integer anIndex = theHI->GetIndex();
-  Standard_Real aValue = theHI->GetDevideEdgeValue();
+  Standard_Integer       anIndex = theHI->GetIndex();
+  Standard_Real           aValue = theHI->GetDevideEdgeValue();
+
+  TopoDS_Shape pointToProject;
+  {
+    Handle(TColStd_HSequenceOfTransient) funs = theHI->GetShapes();
+    if ( !funs.IsNull() && funs->Length() > 0 ) {
+      TopoDS_Compound vCompound;
+      BRep_Builder builder;
+      builder.MakeCompound( vCompound );
+      pointToProject = vCompound;
+      for ( int ind = 1; ind <= funs->Length(); ind++)
+      {
+        Handle(GEOM_Function) vFun = Handle(GEOM_Function)::DownCast(funs->Value(ind));
+        TopoDS_Shape vertex = vFun->GetValue();
+        if ( vertex.IsNull() )
+          Standard_NullObject::Raise("Null vertex given");
+        builder.Add( vCompound, vertex );
+      }
+    }
+  }
 
   ShHealOper_EdgeDivide aHealer (theOriginalShape);
 
   Standard_Boolean aResult = Standard_False;
-  if (anIndex == -1) { // apply algorythm for the whole shape which is EDGE
-    if (theOriginalShape.ShapeType() == TopAbs_EDGE)
-      aResult = aHealer.Perform(TopoDS::Edge(theOriginalShape), aValue, isByParameter);
+  if (anIndex == -1) { // apply algorithm for the whole shape which is EDGE
+    if (theOriginalShape.ShapeType() == TopAbs_EDGE) {
+      if ( pointToProject.IsNull() )
+        aResult = aHealer.Perform(TopoDS::Edge(theOriginalShape), aValue, isByParameter);
+      else
+        aResult = aHealer.Perform(TopoDS::Edge(theOriginalShape), pointToProject);
+    }
   } else {
     TopTools_IndexedMapOfShape aShapes;
     TopExp::MapShapes(theOriginalShape, aShapes);
     TopoDS_Shape aEdgeShape = aShapes.FindKey(anIndex);
-    if (aEdgeShape.ShapeType() == TopAbs_EDGE)
-      aResult = aHealer.Perform(TopoDS::Edge(aEdgeShape), aValue, isByParameter);
+    if (aEdgeShape.ShapeType() == TopAbs_EDGE) {
+      if ( pointToProject.IsNull() )
+        aResult = aHealer.Perform(TopoDS::Edge(aEdgeShape), aValue, isByParameter);
+      else
+        aResult = aHealer.Perform(TopoDS::Edge(aEdgeShape), pointToProject);
+    }
   }
 
   if (aResult)
@@ -508,6 +600,8 @@ Standard_Boolean GEOMImpl_HealingDriver::AddPointOnEdge (GEOMImpl_IHealing* theH
   else
     raiseNotDoneExeption( aHealer.GetErrorStatus() );
 
+  SaveStatistics( aHealer );
+
   return aResult;
 }
 
@@ -529,6 +623,8 @@ Standard_Boolean GEOMImpl_HealingDriver::ChangeOrientation (GEOMImpl_IHealing* t
   else
     raiseNotDoneExeption( aHealer.GetErrorStatus() );
 
+  SaveStatistics( aHealer );
+
   return aResult;
 }
 
@@ -541,26 +637,86 @@ void GEOMImpl_HealingDriver::LimitTolerance (GEOMImpl_IHealing* theHI,
                                              TopoDS_Shape& theOutShape) const
 {
   Standard_Real aTol = theHI->GetTolerance();
+  TopAbs_ShapeEnum aType = theHI->GetType();
+
   if (aTol < Precision::Confusion())
     aTol = Precision::Confusion();
 
   // 1. Make a copy to prevent the original shape changes.
   TopoDS_Shape aShapeCopy;
-  TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
-  TNaming_CopyShape::CopyTool(theOriginalShape, aMapTShapes, aShapeCopy);
+  {
+    TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
+    TNaming_CopyShape::CopyTool(theOriginalShape, aMapTShapes, aShapeCopy);
+  }
 
   // 2. Limit tolerance.
-  ShapeFix_ShapeTolerance aSFT;
-  aSFT.LimitTolerance(aShapeCopy, aTol, aTol, TopAbs_SHAPE);
+  if (!GEOMUtils::FixShapeTolerance(aShapeCopy, aType, aTol))
+    StdFail_NotDone::Raise("Non valid shape result");
 
-  // 3. Fix obtained shape.
-  Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape (aShapeCopy);
-  aSfs->Perform();
-  theOutShape = aSfs->Shape();
+  // 3. Set the result
+  theOutShape = aShapeCopy;
 
-  BRepCheck_Analyzer ana (theOutShape, Standard_True);
-  if (!ana.IsValid())
-    StdFail_NotDone::Raise("Non valid shape result");
+  // 4. Collect statistics
+  {
+    ShHealOper_Tool tool;
+    ShHealOper_ModifStats& stats = tool.GetStatistics();
+
+    int nb[3] = { 0,0,0 };
+    TopTools_IndexedMapOfShape aShapes;
+    TopExp::MapShapes( theOutShape, TopAbs_VERTEX, aShapes);
+    for ( int i = 1; i <= aShapes.Extent(); ++i )
+    {
+      const TopoDS_Vertex& v = TopoDS::Vertex( aShapes( i ));
+      double tol = BRep_Tool::Tolerance( v );
+      if      ( tol < aTol ) nb[0]++;
+      else if ( tol > aTol ) nb[2]++;
+      else                   nb[1]++;
+    }
+    if ( nb[0] > 0 )
+      stats.AddModif( "Tolerance of vertex decreased for shape validity", nb[0] );
+    if ( nb[1] > 0 )
+      stats.AddModif( "Tolerance of vertex limited as requested", nb[1] );
+    if ( nb[2] > 0 )
+      stats.AddModif( "Tolerance of vertex increased for shape validity", nb[2] );
+
+    nb[0] = nb[1] = nb[2] = 0;
+    aShapes.Clear();
+    TopExp::MapShapes( theOutShape, TopAbs_EDGE, aShapes);
+    for ( int i = 1; i <= aShapes.Extent(); ++i )
+    {
+      const TopoDS_Edge& e = TopoDS::Edge( aShapes( i ));
+      double tol = BRep_Tool::Tolerance( e );
+      if      ( tol < aTol ) nb[0]++;
+      else if ( tol > aTol ) nb[2]++;
+      else                   nb[1]++;
+    }
+    if ( nb[0] > 0 )
+      stats.AddModif( "Tolerance of edge decreased for shape validity", nb[0] );
+    if ( nb[1] > 0 )
+      stats.AddModif( "Tolerance of edge limited as requested", nb[1] );
+    if ( nb[2] > 0 )
+      stats.AddModif( "Tolerance of edge increased for shape validity", nb[2] );
+
+    nb[0] = nb[1] = nb[2] = 0;
+    aShapes.Clear();
+    TopExp::MapShapes( theOutShape, TopAbs_FACE, aShapes);
+    for ( int i = 1; i <= aShapes.Extent(); ++i )
+    {
+      const TopoDS_Face& f = TopoDS::Face( aShapes( i ));
+      double tol = BRep_Tool::Tolerance( f );
+      if      ( tol < aTol ) nb[0]++;
+      else if ( tol > aTol ) nb[2]++;
+      else                   nb[1]++;
+    }
+    if ( nb[0] > 0 )
+      stats.AddModif( "Tolerance of face decreased for shape validity", nb[0] );
+    if ( nb[1] > 0 )
+      stats.AddModif( "Tolerance of face limited as requested", nb[1] );
+    if ( nb[2] > 0 )
+      stats.AddModif( "Tolerance of face increased for shape validity", nb[2] );
+
+    SaveStatistics( tool );
+  }
 }
 
 //=======================================================================
@@ -606,7 +762,7 @@ void GEOMImpl_HealingDriver::FuseCollinearEdges (const TopoDS_Shape& theOriginal
     removeAll = true;
 
   if (!removeAll) {
-    for (unsigned int ind = 1; ind <= aVerts->Length(); ind++) {
+    for ( int ind = 1; ind <= aVerts->Length(); ind++) {
       Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(aVerts->Value(ind));
       TopoDS_Shape aShape_i = aRefShape->GetValue();
       if (aShape_i.IsNull())
@@ -648,25 +804,73 @@ void GEOMImpl_HealingDriver::FuseCollinearEdges (const TopoDS_Shape& theOriginal
   theWire = TopoDS::Wire(Fixer->Shape());
   */
 
-  TopoDS_Edge prevEdge;
-  TopTools_ListOfShape finalList, currChain;
+  // Get the ordered list of edges.
+  TopTools_ListOfShape   anEdges;
+  TopTools_ListOfShape   aCurVertices;
+  BRepTools_WireExplorer aWExp (theWire);
 
-  BRepTools_WireExplorer wexp (theWire);
-  if (wexp.More()) {
-    prevEdge = wexp.Current();
-    currChain.Append(prevEdge);
-    wexp.Next();
+  for (; aWExp.More(); aWExp.Next()) {
+    anEdges.Append(aWExp.Current());
+    aCurVertices.Append(aWExp.CurrentVertex());
   }
-  else {
+
+  if (anEdges.IsEmpty()) {
     Standard_NullObject::Raise("Empty wire given");
   }
 
-  for (; wexp.More(); wexp.Next()) {
-    TopoDS_Edge anEdge = wexp.Current();
-    TopoDS_Vertex CurVertex = wexp.CurrentVertex();
+  // Treat the case if the wire is closed and first and last edges are C1.
+  Standard_Boolean isShift = Standard_False;
+
+  if (BRep_Tool::IsClosed(theWire)) {
+    // Wire is closed. Check if there are more than 2 edges in the wire.
+    if (!anEdges.First().IsSame(anEdges.Last())) {
+      isShift = Standard_True;
+    }
+  }
+
+  if (isShift) {
+    // Put first edge to the end of the list while the chain break is reached.
+    TopoDS_Shape aFirstEdge = anEdges.First();
+
+    while (isShift) {
+      isShift = Standard_False;
+
+      // Check if the first vertex should be kept
+      if (aMapToRemove.Contains(aCurVertices.First()) || removeAll) {
+        // Check if first and last edges are C1.
+        TopoDS_Edge anEdge1 = TopoDS::Edge(anEdges.Last());
+        TopoDS_Edge anEdge2 = TopoDS::Edge(anEdges.First());
+
+        if (AreEdgesC1(anEdge1, anEdge2)) {
+          // Make the first edge last.
+          anEdges.Append(anEdge2);
+          anEdges.RemoveFirst();
+          aCurVertices.Append(aCurVertices.First());
+          aCurVertices.RemoveFirst();
+
+          // Check if we reached the first edge again.
+          // Break the loop in this case.
+          isShift = !aFirstEdge.IsSame(anEdges.First());
+        }
+      }
+    }
+  }
+
+  TopTools_ListOfShape finalList, currChain;
+  TopTools_ListIteratorOfListOfShape anEIter(anEdges);
+  TopTools_ListIteratorOfListOfShape aVIter(aCurVertices);
+  TopoDS_Edge                        prevEdge = TopoDS::Edge(anEIter.Value());
+
+  currChain.Append(prevEdge);
+  anEIter.Next();
+  aVIter.Next();
+
+  for (; anEIter.More(); anEIter.Next(), aVIter.Next()) {
+    TopoDS_Edge         anEdge     = TopoDS::Edge(anEIter.Value());
+    const TopoDS_Shape &aCurVertex = aVIter.Value();
 
     bool continueChain = false;
-    if (aMapToRemove.Contains(CurVertex) || removeAll) {
+    if (aMapToRemove.Contains(aCurVertex) || removeAll) {
       // if C1 -> continue chain
       if (AreEdgesC1(prevEdge, anEdge)) {
         continueChain = true;
@@ -735,8 +939,7 @@ void GEOMImpl_HealingDriver::FuseCollinearEdges (const TopoDS_Shape& theOriginal
   }
   theOutShape = aFinalWire;
 
-  BRepCheck_Analyzer ana (theOutShape, Standard_True);
-  if (!ana.IsValid())
+  if (!GEOMUtils::CheckShape(theOutShape, true))
     StdFail_NotDone::Raise("Non valid shape result");
 }
 
@@ -881,7 +1084,7 @@ GetCreationInformation(std::string&             theOperationName,
   case SEWING:
   case SEWING_NON_MANIFOLD:
     theOperationName = "SEWING";
-    AddParam( theParams, "Selected shape", aCI.GetOriginal() );
+    AddParam( theParams, "Selected shapes", aCI.GetOriginalAndShapes() );
     AddParam( theParams, "Allow Non Manifold", ( aType == SEWING_NON_MANIFOLD ));
     AddParam( theParams, "Tolerance", aCI.GetTolerance() );
     break;
@@ -894,6 +1097,14 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam( theParams, "By parameter", aCI.GetIsByParameter() );
     AddParam( theParams, "Value", aCI.GetDevideEdgeValue() );
     break;
+  case DIVIDE_EDGE_BY_POINT:
+    theOperationName = "POINT_ON_EDGE";
+    if ( aCI.GetIndex() > 0 )
+      AddParam( theParams, "Edge", "#" ) << aCI.GetIndex() << " of " << aCI.GetOriginal();
+    else
+      AddParam( theParams, "Edge", aCI.GetOriginal() );
+    AddParam( theParams, "Points", aCI.GetShapes() );
+    break;
   case CHANGE_ORIENTATION:
     theOperationName = "CHANGE_ORIENTATION";
     AddParam( theParams, "Selected shape", aCI.GetOriginal() );
@@ -902,6 +1113,7 @@ GetCreationInformation(std::string&             theOperationName,
     theOperationName = "LIMIT_TOLERANCE";
     AddParam( theParams, "Selected shape", aCI.GetOriginal() );
     AddParam( theParams, "Tolerance", aCI.GetTolerance() );
+    AddParam( theParams, "Type", aCI.GetType() );
     break;
   case FUSE_COLLINEAR_EDGES:
     theOperationName = "FUSE_EDGES";
@@ -910,7 +1122,7 @@ GetCreationInformation(std::string&             theOperationName,
     break;
   case REMOVE_INTERNAL_FACES:
     theOperationName = "REMOVE_WEBS";
-    AddParam( theParams, "Selected shape", aCI.GetOriginal() );
+    AddParam( theParams, "Selected shapes", aCI.GetOriginalAndShapes() );
     break;
   default:
     return false;
@@ -918,6 +1130,33 @@ GetCreationInformation(std::string&             theOperationName,
   
   return true;
 }
+
+//================================================================================
+/*!
+ * \brief Pass a record of what is done to the operation
+ */
+//================================================================================
+
+void GEOMImpl_HealingDriver::SaveStatistics( const ShHealOper_Tool& healer, bool add ) const
+{
+  if ( healer.GetStatistics().GetData().empty() )
+    return;
+
+  if (Label().IsNull()) return;
+
+  Handle(GEOM_Function) aFunction = GEOM_Function::GetFunction(Label());
+  if (aFunction.IsNull()) return;
+
+  GEOMImpl_IHealing HI (aFunction);
+  ShHealOper_ModifStats * stats = HI.GetStatistics();
+  if ( !stats ) return;
+
+  if ( add )
+    stats->Add( healer.GetStatistics() );
+  else
+    *stats = healer.GetStatistics();
+}
+
 IMPLEMENT_STANDARD_HANDLE (GEOMImpl_HealingDriver,GEOM_BaseDriver);
 
 IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_HealingDriver,GEOM_BaseDriver);
index 2da99fa4f1e2a2a1bdef92a1fe4fead45350c6cb..546fd8356ecb9dd88e9864ffa1f9106a17e8aff9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <Standard_CString.hxx>
 #endif
 
-class GEOMImpl_IHealing;
+#include "GEOM_BaseDriver.hxx"
 
+class GEOMImpl_IHealing;
+class ShHealOper_Tool;
+class TopTools_SequenceOfShape;
 
-#include "GEOM_BaseDriver.hxx"
 
 DEFINE_STANDARD_HANDLE( GEOMImpl_HealingDriver, GEOM_BaseDriver );
 
@@ -99,15 +101,19 @@ DEFINE_STANDARD_RTTI( GEOMImpl_HealingDriver )
 private:
   Standard_Boolean ShapeProcess  ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
   Standard_Boolean SuppressFaces ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
+  void             SuppressFacesRec (const TopTools_SequenceOfShape& theShapesFaces,
+                                     const TopoDS_Shape&             theOriginalShape,
+                                     TopoDS_Shape&                   theOutShape) const;
   Standard_Boolean CloseContour  ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
   Standard_Boolean RemoveIntWires( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
   Standard_Boolean RemoveHoles   ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
   Standard_Boolean Sew           ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape&, Standard_Boolean ) const;
-  Standard_Boolean RemoveInternalFaces ( const TopoDS_Shape&, TopoDS_Shape& ) const;
+  Standard_Boolean RemoveInternalFaces ( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
   Standard_Boolean AddPointOnEdge( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
   Standard_Boolean ChangeOrientation( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
   void             LimitTolerance( GEOMImpl_IHealing*, const TopoDS_Shape&, TopoDS_Shape& ) const;
 
+  void             SaveStatistics( const ShHealOper_Tool& healer, bool add=false ) const;
 };
 
 #endif
index 27c366d8e01dbff2140a0177ecf9409613845c3a..4f46c1bbdb41622b4a906d3672019e81f7a83240 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -61,6 +61,7 @@
 #include <GEOMImpl_IDisk.hxx>
 #include <GEOMImpl_ICylinder.hxx>
 #include <GEOMImpl_ICone.hxx>
+#include <GEOMImpl_IGroupOperations.hxx>
 #include <GEOMImpl_ISphere.hxx>
 #include <GEOMImpl_ITorus.hxx>
 #include <GEOMImpl_IPrism.hxx>
@@ -75,6 +76,8 @@
 #include <GEOMImpl_IPipePath.hxx>
 
 #include <Precision.hxx>
+#include <TopExp.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
 
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
@@ -88,6 +91,7 @@ GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations (GEOM_Engine* theEngine,
 : GEOM_IOperations(theEngine, theDocID)
 {
   MESSAGE("GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations");
+  myGroupOperations = new GEOMImpl_IGroupOperations(GetEngine(), GetDocID());
 }
 
 //=============================================================================
@@ -98,6 +102,7 @@ GEOMImpl_I3DPrimOperations::GEOMImpl_I3DPrimOperations (GEOM_Engine* theEngine,
 GEOMImpl_I3DPrimOperations::~GEOMImpl_I3DPrimOperations()
 {
   MESSAGE("GEOMImpl_I3DPrimOperations::~GEOMImpl_I3DPrimOperations");
+  delete myGroupOperations;
 }
 
 
@@ -626,8 +631,8 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRH (Handle(GEO
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeCylinderPntVecRHA (Handle(GEOM_Object) thePnt,
-                                                                      Handle(GEOM_Object) theVec,
-                                                                      double theR, double theH, double theA)
+                                                                       Handle(GEOM_Object) theVec,
+                                                                       double theR, double theH, double theA)
 {
   SetErrorCode(KO);
 
@@ -1367,7 +1372,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePrismDXDYDZ2Ways
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDraftPrism
-       (Handle(GEOM_Object) theInitShape ,Handle(GEOM_Object) theBase, double theHeight, double theAngle, bool theFuse)
+       (Handle(GEOM_Object) theInitShape ,Handle(GEOM_Object) theBase, double theHeight, double theAngle, bool theFuse, bool theInvert)
 {
   SetErrorCode(KO);
 
@@ -1410,6 +1415,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDraftPrism
     aCI.SetFuseFlag(1);
   else
     aCI.SetFuseFlag(0);
+  aCI.SetInvertFlag(theInvert);
   
   //Compute the Draft Prism Feature value
   try {
@@ -1426,16 +1432,20 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDraftPrism
   }
   
   //Make a Python command
+  GEOM::TPythonDump pd (aFunction);
   if(theFuse)
   {
-    GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakeExtrudedBoss("
-      << theInitShape << ", " << theBase << ", " << theHeight << ", " << theAngle << ")";
+    pd << aPrism << " = geompy.MakeExtrudedBoss(" << theInitShape << ", " << theBase << ", "
+      << theHeight << ", " << theAngle;
   }
   else
   {   
-    GEOM::TPythonDump(aFunction) << aPrism << " = geompy.MakeExtrudedCut("
-      << theInitShape << ", " << theBase << ", " << theHeight << ", " << theAngle << ")";
+    pd << aPrism << " = geompy.MakeExtrudedCut(" << theInitShape << ", " << theBase << ", "
+      << theHeight << ", " << theAngle;
   }
+  if (theInvert)
+    pd << ", " << theInvert;
+  pd << ")";
 
   SetErrorCode(OK);
   return aPrism;
@@ -1446,8 +1456,10 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeDraftPrism
  *  MakePipe
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) theBase,
-                                                          Handle(GEOM_Object) thePath)
+Handle(TColStd_HSequenceOfTransient) GEOMImpl_I3DPrimOperations::MakePipe
+                            (const Handle(GEOM_Object) &theBase,
+                             const Handle(GEOM_Object) &thePath,
+                             const bool                 IsGenerateGroups)
 {
   SetErrorCode(KO);
 
@@ -1473,6 +1485,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) th
 
   aCI.SetBase(aRefBase);
   aCI.SetPath(aRefPath);
+  aCI.SetGenerateGroups(IsGenerateGroups);
 
   //Compute the Pipe value
   try {
@@ -1488,12 +1501,31 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipe (Handle(GEOM_Object) th
     return NULL;
   }
 
+  // Create the sequence of objects.
+  Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+
+  aSeq->Append(aPipe);
+  createGroups(aPipe, &aCI, aSeq);
+
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aPipe << " = geompy.MakePipe("
-    << theBase << ", " << thePath << ")";
+  GEOM::TPythonDump pyDump(aFunction);
+
+  if (IsGenerateGroups) {
+    pyDump << aSeq;
+  } else {
+    pyDump << aPipe;
+  }
+
+  pyDump << " = geompy.MakePipe(" << theBase << ", " << thePath;
+
+  if (IsGenerateGroups) {
+    pyDump << ", True";
+  }
+
+  pyDump << ")";
 
   SetErrorCode(OK);
-  return aPipe;
+  return aSeq;
 }
 
 
@@ -1615,15 +1647,19 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeRevolutionAxisAngle2Ways
  *  MakeFilling
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
-       (Handle(GEOM_Object) theShape, int theMinDeg, int theMaxDeg,
-        double theTol2D, double theTol3D, int theNbIter,
-        int theMethod, bool isApprox)
+Handle(GEOM_Object)
+GEOMImpl_I3DPrimOperations::MakeFilling (std::list< Handle(GEOM_Object)> & theContours,
+                                         int theMinDeg, int theMaxDeg,
+                                         double theTol2D, double theTol3D, int theNbIter,
+                                         int theMethod, bool isApprox)
 {
   SetErrorCode(KO);
 
-  if (theShape.IsNull()) return NULL;
-
+  Handle(TColStd_HSequenceOfTransient) contours = GEOM_Object::GetLastFunctions( theContours );
+  if ( contours.IsNull() || contours->IsEmpty() ) {
+    SetErrorCode("NULL argument shape");
+    return NULL;
+  }
   //Add a new Filling object
   Handle(GEOM_Object) aFilling = GetEngine()->AddObject(GetDocID(), GEOM_FILLING);
 
@@ -1635,12 +1671,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
   if (aFunction->GetDriverGUID() != GEOMImpl_FillingDriver::GetID()) return NULL;
 
   GEOMImpl_IFilling aFI (aFunction);
-
-  Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
-
-  if (aRefShape.IsNull()) return NULL;
-
-  aFI.SetShape(aRefShape);
+  aFI.SetShapes(contours);
   aFI.SetMinDeg(theMinDeg);
   aFI.SetMaxDeg(theMaxDeg);
   aFI.SetTol2D(theTol2D);
@@ -1668,17 +1699,17 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeFilling
 
   //Make a Python command
   GEOM::TPythonDump pd (aFunction);
-  pd << aFilling << " = geompy.MakeFilling(" << theShape ;
+  pd << aFilling << " = geompy.MakeFilling(" << theContours ;
   if ( theMinDeg != 2 )   pd << ", theMinDeg=" << theMinDeg ;
   if ( theMaxDeg != 5 )   pd << ", theMaxDeg=" << theMaxDeg ;
   if ( fabs(theTol2D-0.0001) > Precision::Confusion() )
-                          pd << ", theTol2D=" << theTol2D ;
+  {                       pd << ", theTol2D=" << theTol2D ; }
   if ( fabs(theTol3D-0.0001) > Precision::Confusion() )
-                          pd << ", theTol3D=" << theTol3D ;
+  {                       pd << ", theTol3D=" << theTol3D ; }
   if ( theNbIter != 0 )   pd << ", theNbIter=" << theNbIter ;
   if ( theMethod==1 )     pd << ", theMethod=GEOM.FOM_UseOri";
   else if( theMethod==2 ) pd << ", theMethod=GEOM.FOM_AutoCorrect";
-  if(isApprox)            pd << ", isApprox=" << isApprox ;
+  if ( isApprox )         pd << ", isApprox=" << isApprox ;
   pd << ")";
 
   SetErrorCode(OK);
@@ -1790,22 +1821,24 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThruSections(
  *  MakePipeWithDifferentSections
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
-                const Handle(TColStd_HSequenceOfTransient)& theBases,
-                const Handle(TColStd_HSequenceOfTransient)& theLocations,
-                const Handle(GEOM_Object)& thePath,
-                bool theWithContact,
-                bool theWithCorrections)
+Handle(TColStd_HSequenceOfTransient)
+  GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections
+              (const Handle(TColStd_HSequenceOfTransient) &theBases,
+               const Handle(TColStd_HSequenceOfTransient) &theLocations,
+               const Handle(GEOM_Object)                  &thePath,
+               const bool                                  theWithContact,
+               const bool                                  theWithCorrections,
+               const bool                                  IsBySteps,
+               const bool                                  IsGenerateGroups)
 {
-  Handle(GEOM_Object) anObj;
   SetErrorCode(KO);
   if(theBases.IsNull())
-    return anObj;
+    return NULL;
 
   Standard_Integer nbBases = theBases->Length();
 
   if (!nbBases)
-    return anObj;
+    return NULL;
 
   Standard_Integer nbLocs =  (theLocations.IsNull() ? 0 :theLocations->Length());
   //Add a new Pipe object
@@ -1815,16 +1848,16 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
 
   Handle(GEOM_Function) aFunction =
     aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_DIFFERENT_SECTIONS);
-  if (aFunction.IsNull()) return anObj;
+  if (aFunction.IsNull()) return NULL;
 
   //Check if the function is set correctly
-  if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return anObj;
+  if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return NULL;
 
   GEOMImpl_IPipeDiffSect aCI (aFunction);
 
   Handle(GEOM_Function) aRefPath = thePath->GetLastFunction();
   if(aRefPath.IsNull())
-    return anObj;
+    return NULL;
 
   Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
   Handle(TColStd_HSequenceOfTransient) aSeqLocs = new TColStd_HSequenceOfTransient;
@@ -1860,31 +1893,54 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
   }
 
   if(!aSeqBases->Length())
-    return anObj;
+    return NULL;
 
   aCI.SetBases(aSeqBases);
   aCI.SetLocations(aSeqLocs);
   aCI.SetPath(aRefPath);
-  aCI.SetWithContactMode(theWithContact);
-  aCI.SetWithCorrectionMode(theWithCorrections);
+
+  if (!IsBySteps) {
+    aCI.SetWithContactMode(theWithContact);
+    aCI.SetWithCorrectionMode(theWithCorrections);
+  }
+
+  aCI.SetIsBySteps(IsBySteps);
+  aCI.SetGenerateGroups(IsGenerateGroups);
 
   //Compute the Pipe value
   try {
     OCC_CATCH_SIGNALS;
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Pipe with defferent section driver failed");
-      return anObj;
+      return NULL;
     }
   }
   catch (Standard_Failure) {
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
     SetErrorCode(aFail->GetMessageString());
-    return anObj;
+    return NULL;
   }
 
+  // Create the sequence of objects.
+  Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+
+  aSeq->Append(aPipeDS);
+  createGroups(aPipeDS, &aCI, aSeq);
+
   //Make a Python command
   GEOM::TPythonDump pyDump(aFunction);
-  pyDump << aPipeDS << " = geompy.MakePipeWithDifferentSections([";
+
+  if (IsGenerateGroups) {
+    pyDump << aSeq;
+  } else {
+    pyDump << aPipeDS;
+  }
+
+  if (IsBySteps) {
+    pyDump << " = geompy.MakePipeWithDifferentSectionsBySteps([";
+  } else {
+    pyDump << " = geompy.MakePipeWithDifferentSections([";
+  }
 
   for(i =1 ; i <= nbBases; i++) {
 
@@ -1916,10 +1972,20 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
     }
   }
 
-  pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
+  pyDump<< "], "<<thePath;
+
+  if (!IsBySteps) {
+    pyDump<<","<<theWithContact << "," << theWithCorrections;
+  }
+
+  if (IsGenerateGroups) {
+    pyDump << ", True";
+  }
+
+  pyDump << ")";
 
   SetErrorCode(OK);
-  return aPipeDS;
+  return aSeq;
 }
 
 
@@ -1928,23 +1994,24 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithDifferentSections(
  *  MakePipeWithShellSections
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
-                const Handle(TColStd_HSequenceOfTransient)& theBases,
-                const Handle(TColStd_HSequenceOfTransient)& theSubBases,
-                const Handle(TColStd_HSequenceOfTransient)& theLocations,
-                const Handle(GEOM_Object)& thePath,
-                bool theWithContact,
-                bool theWithCorrections)
+Handle(TColStd_HSequenceOfTransient)
+      GEOMImpl_I3DPrimOperations::MakePipeWithShellSections
+              (const Handle(TColStd_HSequenceOfTransient) &theBases,
+               const Handle(TColStd_HSequenceOfTransient) &theSubBases,
+               const Handle(TColStd_HSequenceOfTransient) &theLocations,
+               const Handle(GEOM_Object)                  &thePath,
+               const bool                                  theWithContact,
+               const bool                                  theWithCorrections,
+               const bool                                  IsGenerateGroups)
 {
-  Handle(GEOM_Object) anObj;
   SetErrorCode(KO);
   if(theBases.IsNull())
-    return anObj;
+    return NULL;
 
   Standard_Integer nbBases = theBases->Length();
 
   if (!nbBases)
-    return anObj;
+    return NULL;
 
   Standard_Integer nbSubBases =  (theSubBases.IsNull() ? 0 :theSubBases->Length());
 
@@ -1957,17 +2024,17 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
 
   Handle(GEOM_Function) aFunction =
     aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_SHELL_SECTIONS);
-  if (aFunction.IsNull()) return anObj;
+  if (aFunction.IsNull()) return NULL;
 
   //Check if the function is set correctly
-  if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return anObj;
+  if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return NULL;
 
   //GEOMImpl_IPipeDiffSect aCI (aFunction);
   GEOMImpl_IPipeShellSect aCI (aFunction);
 
   Handle(GEOM_Function) aRefPath = thePath->GetLastFunction();
   if(aRefPath.IsNull())
-    return anObj;
+    return NULL;
 
   Handle(TColStd_HSequenceOfTransient) aSeqBases = new TColStd_HSequenceOfTransient;
   Handle(TColStd_HSequenceOfTransient) aSeqSubBases = new TColStd_HSequenceOfTransient;
@@ -2016,7 +2083,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
   }
 
   if(!aSeqBases->Length())
-    return anObj;
+    return NULL;
 
   aCI.SetBases(aSeqBases);
   aCI.SetSubBases(aSeqSubBases);
@@ -2024,24 +2091,38 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
   aCI.SetPath(aRefPath);
   aCI.SetWithContactMode(theWithContact);
   aCI.SetWithCorrectionMode(theWithCorrections);
+  aCI.SetGenerateGroups(IsGenerateGroups);
 
   //Compute the Pipe value
   try {
     OCC_CATCH_SIGNALS;
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Pipe with shell sections driver failed");
-      return anObj;
+      return NULL;
     }
   }
   catch (Standard_Failure) {
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
     SetErrorCode(aFail->GetMessageString());
-    return anObj;
+    return NULL;
   }
 
+  // Create the sequence of objects.
+  Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+
+  aSeq->Append(aPipeDS);
+  createGroups(aPipeDS, &aCI, aSeq);
+
   //Make a Python command
   GEOM::TPythonDump pyDump(aFunction);
-  pyDump << aPipeDS << " = geompy.MakePipeWithShellSections([";
+
+  if (IsGenerateGroups) {
+    pyDump << aSeq;
+  } else {
+    pyDump << aPipeDS;
+  }
+
+  pyDump << " = geompy.MakePipeWithShellSections([";
 
   for(i =1 ; i <= nbBases; i++) {
 
@@ -2089,10 +2170,16 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
     }
   }
 
-  pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections<<")";
+  pyDump<< "], "<<thePath<<","<<theWithContact << "," << theWithCorrections;
+
+  if (IsGenerateGroups) {
+    pyDump << ", True";
+  }
+
+  pyDump << ")";
 
   SetErrorCode(OK);
-  return aPipeDS;
+  return aSeq;
 
 }
 
@@ -2102,19 +2189,20 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeWithShellSections(
  *  MakePipeShellsWithoutPath
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
-                const Handle(TColStd_HSequenceOfTransient)& theBases,
-                const Handle(TColStd_HSequenceOfTransient)& theLocations)
+Handle(TColStd_HSequenceOfTransient)
+      GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath
+              (const Handle(TColStd_HSequenceOfTransient) &theBases,
+               const Handle(TColStd_HSequenceOfTransient) &theLocations,
+               const bool                                  IsGenerateGroups)
 {
-  Handle(GEOM_Object) anObj;
   SetErrorCode(KO);
   if(theBases.IsNull())
-    return anObj;
+    return NULL;
 
   Standard_Integer nbBases = theBases->Length();
 
   if (!nbBases)
-    return anObj;
+    return NULL;
 
   Standard_Integer nbLocs =  (theLocations.IsNull() ? 0 :theLocations->Length());
 
@@ -2125,10 +2213,10 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
 
   Handle(GEOM_Function) aFunction =
     aPipeDS->AddFunction(GEOMImpl_PipeDriver::GetID(), PIPE_SHELLS_WITHOUT_PATH);
-  if (aFunction.IsNull()) return anObj;
+  if (aFunction.IsNull()) return NULL;
 
   //Check if the function is set correctly
-  if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return anObj;
+  if (aFunction->GetDriverGUID() != GEOMImpl_PipeDriver::GetID()) return NULL;
 
   GEOMImpl_IPipeShellSect aCI (aFunction);
 
@@ -2165,28 +2253,42 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
   }
 
   if(!aSeqBases->Length())
-    return anObj;
+    return NULL;
 
   aCI.SetBases(aSeqBases);
   aCI.SetLocations(aSeqLocs);
+  aCI.SetGenerateGroups(IsGenerateGroups);
 
   //Compute the Pipe value
   try {
     OCC_CATCH_SIGNALS;
     if (!GetSolver()->ComputeFunction(aFunction)) {
       SetErrorCode("Pipe with shell sections without path driver failed");
-      return anObj;
+      return NULL;
     }
   }
   catch (Standard_Failure) {
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
     SetErrorCode(aFail->GetMessageString());
-    return anObj;
+    return NULL;
   }
 
+  // Create the sequence of objects.
+  Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+
+  aSeq->Append(aPipeDS);
+  createGroups(aPipeDS, &aCI, aSeq);
+
   //Make a Python command
   GEOM::TPythonDump pyDump(aFunction);
-  pyDump << aPipeDS << " = geompy.MakePipeShellsWithoutPath([";
+
+  if (IsGenerateGroups) {
+    pyDump << aSeq;
+  } else {
+    pyDump << aPipeDS;
+  }
+
+  pyDump << " = geompy.MakePipeShellsWithoutPath([";
 
   for(i =1 ; i <= nbBases; i++) {
 
@@ -2218,10 +2320,16 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
     }
   }
 
-  pyDump<< "])";
+  pyDump<< "]";
+
+  if (IsGenerateGroups) {
+    pyDump << ", True";
+  }
+
+  pyDump << ")";
 
   SetErrorCode(OK);
-  return aPipeDS;
+  return aSeq;
 
 }
 
@@ -2230,9 +2338,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeShellsWithoutPath(
  *  MakePipeBiNormalAlongVector
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase,
-                                                                             Handle(GEOM_Object) thePath,
-                                                                             Handle(GEOM_Object) theVec)
+Handle(TColStd_HSequenceOfTransient)
+  GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector
+                (const Handle(GEOM_Object) &theBase,
+                 const Handle(GEOM_Object) &thePath,
+                 const Handle(GEOM_Object) &theVec,
+                 const bool                 IsGenerateGroups)
 {
   SetErrorCode(KO);
 
@@ -2260,6 +2371,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Han
   aCI.SetBase(aRefBase);
   aCI.SetPath(aRefPath);
   aCI.SetVector(aRefVec);
+  aCI.SetGenerateGroups(IsGenerateGroups);
 
   //Compute the Pipe value
   try {
@@ -2275,12 +2387,32 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Han
     return NULL;
   }
 
+  // Create the sequence of objects.
+  Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
+
+  aSeq->Append(aPipe);
+  createGroups(aPipe, &aCI, aSeq);
+
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aPipe << " = geompy.MakePipeBiNormalAlongVector("
-    << theBase << ", " << thePath << ", " << theVec << ")";
+  GEOM::TPythonDump pyDump(aFunction);
+
+  if (IsGenerateGroups) {
+    pyDump << aSeq;
+  } else {
+    pyDump << aPipe;
+  }
+
+  pyDump << " = geompy.MakePipeBiNormalAlongVector("
+         << theBase << ", " << thePath << ", " << theVec;
+
+  if (IsGenerateGroups) {
+    pyDump << ", True";
+  }
+
+  pyDump << ")";
 
   SetErrorCode(OK);
-  return aPipe;
+  return aSeq;
 }
 
 //=============================================================================
@@ -2288,9 +2420,12 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakePipeBiNormalAlongVector (Han
  *  MakeThickening
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening(Handle(GEOM_Object) theObject,
-                                                              double theOffset,
-                                                              bool copy = true)
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening
+                (Handle(GEOM_Object)                     theObject,
+                 const Handle(TColStd_HArray1OfInteger) &theFacesIDs,
+                 double                                  theOffset,
+                 bool                                    isCopy,
+                 bool                                    theInside)
 {
   SetErrorCode(KO);
 
@@ -2302,7 +2437,7 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening(Handle(GEOM_Objec
   //Add a new Offset function
   Handle(GEOM_Function) aFunction;
   Handle(GEOM_Object) aCopy; 
-  if (copy)
+  if (isCopy)
   { 
     //Add a new Copy object
     aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
@@ -2319,6 +2454,11 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening(Handle(GEOM_Objec
   GEOMImpl_IOffset aTI (aFunction);
   aTI.SetShape(anOriginal);
   aTI.SetValue(theOffset);
+  aTI.SetParam(theInside);
+
+  if (theFacesIDs.IsNull() == Standard_False) {
+    aTI.SetFaceIDs(theFacesIDs);
+  }
 
   //Compute the offset
   try {
@@ -2335,20 +2475,38 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::MakeThickening(Handle(GEOM_Objec
   }
 
   //Make a Python command
-  if(copy)
-  {
-    GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeThickSolid("
-                               << theObject << ", " << theOffset << ")";
-    SetErrorCode(OK);
-    return aCopy;
+  GEOM::TPythonDump   pd (aFunction);
+  Handle(GEOM_Object) aResult; 
+
+  if (isCopy) {
+    pd << aCopy << " = geompy.MakeThickSolid("
+       << theObject << ", " << theOffset;
+    aResult = aCopy;
+  } else {
+    pd << "geompy.Thicken(" << theObject << ", " << theOffset;
+    aResult = theObject;
   }
-  else
-  {
-    GEOM::TPythonDump(aFunction) << "geompy.Thicken("
-                               << theObject << ", " << theOffset << ")";
-    SetErrorCode(OK);
-    return theObject;
+
+  pd << ", [";
+  if (theFacesIDs.IsNull() == Standard_False) {
+    // Dump faces IDs.
+    Standard_Integer i;
+
+    for (i = theFacesIDs->Lower(); i < theFacesIDs->Upper(); ++i) {
+      pd << theFacesIDs->Value(i) << ", ";
+    }
+    // Dump the last value.
+    pd << theFacesIDs->Value(i);
   }
+  pd << "]";
+
+  if (theInside)
+    pd << ", " << theInside;
+
+  pd << ")";
+  SetErrorCode(OK);
+
+  return aResult;
 }
 
 //=============================================================================
@@ -2516,3 +2674,122 @@ Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::RestorePath
   SetErrorCode(OK);
   return aPath;
 }
+
+//=============================================================================
+/*!
+ *  createGroup
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_I3DPrimOperations::createGroup
+                  (const Handle(GEOM_Object)              &theBaseObject,
+                   const Handle(TColStd_HArray1OfInteger) &theGroupIDs,
+                   const TCollection_AsciiString          &theName,
+                   const TopTools_IndexedMapOfShape       &theIndices)
+{
+  if (theBaseObject.IsNull() || theGroupIDs.IsNull()) {
+    return NULL;
+  }
+
+  // Get the Shape type.
+  const Standard_Integer anID      = theGroupIDs->Value(theGroupIDs->Lower());
+  const Standard_Integer aNbShapes = theIndices.Extent();
+
+  if (anID < 1 || anID > aNbShapes) {
+    return NULL;
+  }
+
+  const TopoDS_Shape aSubShape = theIndices.FindKey(anID);
+
+  if (aSubShape.IsNull()) {
+    return NULL;
+  }
+
+  // Create a group.
+  const TopAbs_ShapeEnum aGroupType = aSubShape.ShapeType();
+  Handle(GEOM_Object)    aGroup     =
+    myGroupOperations->CreateGroup(theBaseObject, aGroupType);
+
+  if (aGroup.IsNull() == Standard_False) {
+    aGroup->GetLastFunction()->SetDescription("");
+    aGroup->SetName(theName.ToCString());
+
+    Handle(TColStd_HSequenceOfInteger) aSeqIDs = new TColStd_HSequenceOfInteger;
+    Standard_Integer                   i;
+
+    for (i = theGroupIDs->Lower(); i <= theGroupIDs->Upper(); ++i) {
+      // Get and check the index.
+      const Standard_Integer anIndex = theGroupIDs->Value(i);
+
+      if (anIndex < 1 || anIndex > aNbShapes) {
+        return NULL;
+      }
+
+      // Get and check the sub-shape.
+      const TopoDS_Shape aSubShape = theIndices.FindKey(anIndex);
+
+      if (aSubShape.IsNull()) {
+        return NULL;
+      }
+
+      // Check the shape type.
+      if (aSubShape.ShapeType() != aGroupType) {
+        return NULL;
+      }
+
+      aSeqIDs->Append(anIndex);
+    }
+
+    myGroupOperations->UnionIDs(aGroup, aSeqIDs);
+    aGroup->GetLastFunction()->SetDescription("");
+  }
+
+  return aGroup;
+}
+
+//=============================================================================
+/*!
+ *  createGroups
+ */
+//=============================================================================
+void GEOMImpl_I3DPrimOperations::createGroups
+                   (const Handle(GEOM_Object)                  &theBaseObject,
+                          GEOMImpl_IPipe                       *thePipe,
+                          Handle(TColStd_HSequenceOfTransient) &theSequence)
+{
+  if (theBaseObject.IsNull() || thePipe == NULL || theSequence.IsNull()) {
+    return;
+  }
+
+  TopoDS_Shape aShape = theBaseObject->GetValue();
+
+  if (aShape.IsNull()) {
+    return;
+  }
+
+  TopTools_IndexedMapOfShape       anIndices;
+  Handle(TColStd_HArray1OfInteger) aGroupIDs;
+  TopoDS_Shape                     aShapeType;
+  const Standard_Integer           aNbGroups = 5;
+  Handle(GEOM_Object)              aGrps[aNbGroups];
+  Standard_Integer                 i;
+
+  TopExp::MapShapes(aShape, anIndices);
+
+  // Create groups.
+  aGroupIDs = thePipe->GetGroupDown();
+  aGrps[0]  = createGroup(theBaseObject, aGroupIDs, "GROUP_DOWN", anIndices);
+  aGroupIDs = thePipe->GetGroupUp();
+  aGrps[1]  = createGroup(theBaseObject, aGroupIDs, "GROUP_UP", anIndices);
+  aGroupIDs = thePipe->GetGroupSide1();
+  aGrps[2]  = createGroup(theBaseObject, aGroupIDs, "GROUP_SIDE1", anIndices);
+  aGroupIDs = thePipe->GetGroupSide2();
+  aGrps[3]  = createGroup(theBaseObject, aGroupIDs, "GROUP_SIDE2", anIndices);
+  aGroupIDs = thePipe->GetGroupOther();
+  aGrps[4]  = createGroup(theBaseObject, aGroupIDs, "GROUP_OTHER", anIndices);
+
+  for (i = 0; i < aNbGroups; ++i) {
+    if (aGrps[i].IsNull() == Standard_False) {
+      theSequence->Append(aGrps[i]);
+    }
+  }
+}
index de227452e41f7cfe88d56403c14b66fa9f5f1a58..91f4f46bb3c7e296522305f8cf901acff9020300 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <TDocStd_Document.hxx>
 #include <TColStd_HSequenceOfTransient.hxx>
 
+class GEOMImpl_IGroupOperations;
+class GEOMImpl_IPipe;
+class TopTools_IndexedMapOfShape;
+
+
 class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
  public:
   Standard_EXPORT GEOMImpl_I3DPrimOperations(GEOM_Engine* theEngine, int theDocID);
@@ -50,17 +55,17 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
   Standard_EXPORT Handle(GEOM_Object) MakeDiskR (double theR, int theOrientation);
   Standard_EXPORT Handle(GEOM_Object) MakeCylinderRH       (double theR, double theH);
   Standard_EXPORT Handle(GEOM_Object) MakeCylinderPntVecRH (Handle(GEOM_Object) thePnt,
-                                                           Handle(GEOM_Object) theVec,
-                                                           double theR, double theH);
+                                                            Handle(GEOM_Object) theVec,
+                                                            double theR, double theH);
   Standard_EXPORT Handle(GEOM_Object) MakeCylinderRHA       (double theR, double theH, double theA);
   Standard_EXPORT Handle(GEOM_Object) MakeCylinderPntVecRHA (Handle(GEOM_Object) thePnt,
-                                                            Handle(GEOM_Object) theVec,
-                                                            double theR, double theH, double theA);                                        
+                                                             Handle(GEOM_Object) theVec,
+                                                             double theR, double theH, double theA);                                        
 
   Standard_EXPORT Handle(GEOM_Object) MakeConeR1R2H       (double theR1, double theR2, double theH);
   Standard_EXPORT Handle(GEOM_Object) MakeConePntVecR1R2H (Handle(GEOM_Object) thePnt,
-                                                          Handle(GEOM_Object) theVec,
-                                                          double theR1, double theR2, double theH);
+                                                           Handle(GEOM_Object) theVec,
+                                                           double theR1, double theR2, double theH);
 
   Standard_EXPORT Handle(GEOM_Object) MakeSphereR    (double theR);
   Standard_EXPORT Handle(GEOM_Object) MakeSpherePntR (Handle(GEOM_Object) thePnt, double theR);
@@ -68,8 +73,8 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
   Standard_EXPORT Handle(GEOM_Object) MakeTorusRR (double theRMajor, double theRMinor);
 
   Standard_EXPORT Handle(GEOM_Object) MakeTorusPntVecRR (Handle(GEOM_Object) thePnt,
-                                                        Handle(GEOM_Object) theVec,
-                                                        double theRMajor, double theRMinor);
+                                                         Handle(GEOM_Object) theVec,
+                                                         double theRMajor, double theRMinor);
 
   Standard_EXPORT Handle(GEOM_Object) MakePrismVecH (Handle(GEOM_Object) theBase,
                                                      Handle(GEOM_Object) theVec,
@@ -96,10 +101,12 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
                                                             double theDX, double theDY, double theDZ);
   
   Standard_EXPORT Handle(GEOM_Object) MakeDraftPrism  (Handle(GEOM_Object) theInitShape, Handle(GEOM_Object) theBase,
-                                                       double theHeight, double theAngle, bool theFuse);
+                                                       double theHeight, double theAngle, bool theFuse, bool theInvert = false );
   
-  Standard_EXPORT Handle(GEOM_Object) MakePipe (Handle(GEOM_Object) theBase,
-                                                Handle(GEOM_Object) thePath);
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipe
+                            (const Handle(GEOM_Object) &theBase,
+                             const Handle(GEOM_Object) &thePath,
+                             const bool                 IsGenerateGroups);
 
   Standard_EXPORT Handle(GEOM_Object) MakeRevolutionAxisAngle (Handle(GEOM_Object) theBase,
                                                                Handle(GEOM_Object) theAxis,
@@ -109,7 +116,7 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
                                                                     Handle(GEOM_Object) theAxis,
                                                                     double theAngle);
 
-  Standard_EXPORT Handle(GEOM_Object) MakeFilling (Handle(GEOM_Object) theShape,
+  Standard_EXPORT Handle(GEOM_Object) MakeFilling (std::list< Handle(GEOM_Object)> & theContours,
                                                    int theMinDeg, int theMaxDeg,
                                                    double theTol2D, double theTol3D,
                                                    int theNbIter, int theMethod,
@@ -121,32 +128,42 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
                                        double thePreci,
                                        bool theRuled);
 
-  Standard_EXPORT Handle(GEOM_Object) MakePipeWithDifferentSections(
-                const Handle(TColStd_HSequenceOfTransient)& theBases,
-                const Handle(TColStd_HSequenceOfTransient)& theLocations,
-                const Handle(GEOM_Object)& thePath,
-                bool theWithContact,
-                bool theWithCorrections);
-
-  Standard_EXPORT Handle(GEOM_Object) MakePipeWithShellSections(
-                const Handle(TColStd_HSequenceOfTransient)& theBases,
-                const Handle(TColStd_HSequenceOfTransient)& theSubBases,
-                const Handle(TColStd_HSequenceOfTransient)& theLocations,
-                const Handle(GEOM_Object)& thePath,
-                bool theWithContact,
-                bool theWithCorrections);
-
-  Standard_EXPORT Handle(GEOM_Object) MakePipeShellsWithoutPath
-                (const Handle(TColStd_HSequenceOfTransient)& theBases,
-                 const Handle(TColStd_HSequenceOfTransient)& theLocations);
-
-  Standard_EXPORT Handle(GEOM_Object) MakePipeBiNormalAlongVector (Handle(GEOM_Object) theBase,
-                                                                   Handle(GEOM_Object) thePath,
-                                                                   Handle(GEOM_Object) theVec);
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
+      MakePipeWithDifferentSections
+              (const Handle(TColStd_HSequenceOfTransient) &theBases,
+               const Handle(TColStd_HSequenceOfTransient) &theLocations,
+               const Handle(GEOM_Object)                  &thePath,
+               const bool                                  theWithContact,
+               const bool                                  theWithCorrections,
+               const bool                                  IsBySteps,
+               const bool                                  IsGenerateGroups);
+
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeWithShellSections
+              (const Handle(TColStd_HSequenceOfTransient) &theBases,
+               const Handle(TColStd_HSequenceOfTransient) &theSubBases,
+               const Handle(TColStd_HSequenceOfTransient) &theLocations,
+               const Handle(GEOM_Object)                  &thePath,
+               const bool                                  theWithContact,
+               const bool                                  theWithCorrections,
+               const bool                                  IsGenerateGroups);
+
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeShellsWithoutPath
+              (const Handle(TColStd_HSequenceOfTransient) &theBases,
+               const Handle(TColStd_HSequenceOfTransient) &theLocations,
+               const bool                                  IsGenerateGroups);
+
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) MakePipeBiNormalAlongVector
+                (const Handle(GEOM_Object) &theBase,
+                 const Handle(GEOM_Object) &thePath,
+                 const Handle(GEOM_Object) &theVec,
+                 const bool                 IsGenerateGroups);
   
-  Standard_EXPORT Handle(GEOM_Object) MakeThickening (Handle(GEOM_Object) theObject, 
-                                                      double theOffset,
-                                                      bool isCopy);
+  Standard_EXPORT Handle(GEOM_Object) MakeThickening
+                (Handle(GEOM_Object)                     theObject,
+                 const Handle(TColStd_HArray1OfInteger) &theFacesIDs,
+                 double                                  theOffset,
+                 bool                                    isCopy,
+                 bool                                    theInside = false);
 
   Standard_EXPORT Handle(GEOM_Object) RestorePath (Handle(GEOM_Object) theShape,
                                                    Handle(GEOM_Object) theBase1,
@@ -155,6 +172,23 @@ class GEOMImpl_I3DPrimOperations : public GEOM_IOperations {
   Standard_EXPORT Handle(GEOM_Object) RestorePath (Handle(GEOM_Object) theShape,
                                                    const Handle(TColStd_HSequenceOfTransient)& theBase1,
                                                    const Handle(TColStd_HSequenceOfTransient)& theBase2);
+
+private:
+
+  Handle(GEOM_Object) createGroup
+                  (const Handle(GEOM_Object)              &theBaseObject,
+                   const Handle(TColStd_HArray1OfInteger) &theGroupIDs,
+                   const TCollection_AsciiString          &theName,
+                   const TopTools_IndexedMapOfShape       &theIndices);
+
+  void createGroups(const Handle(GEOM_Object)                  &theBaseObject,
+                          GEOMImpl_IPipe                       *thePipe,
+                          Handle(TColStd_HSequenceOfTransient) &theSequence);
+
+private:
+
+  GEOMImpl_IGroupOperations *myGroupOperations;
+
 };
 
 #endif
index c54a026b1ed9ba442f9727f2dc1b704e70ab4b37..79ee8a3d2b270794df4487ce774af4c92d8f658d 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index b485a35fb604d1d83541c1562ff4a31d7951c9c3..ee9b6682a561ed533fc0d5363327dd00311f8626 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 80f76088b9ee487ea405acf73ac1054397d095d4..be0610719c8a1fc44b8922842992d8d3b8a37d17 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 0f494319a529badaa0fa9864e3030b00ec9ffe02..f5ddf8eaebd3330c7f3d364e2eecb5e49219711b 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e547cb3edeaf8fe628be9048007f27a60b0f84da..ada231c3e414e4a44de25264b7ffe0800a2d905f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index cb81f958f70ce6cc3eb20189729b77e72f043b7d..8f282f2ae477fa3c06457de0f06a7af2483bcf0a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -186,10 +186,11 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointWithReference
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
                     (Handle(GEOM_Object) theGeomObj,
-                     double theParam1,
-                     double theParam2,
-                     double theParam3,
+                     double              theParam1,
+                     double              theParam2,
+                     double              theParam3,
                      const PointLocation theLocation,
+                     const bool          takeOrientationIntoAccount,
                      Handle(GEOM_Object) theRefPoint)
 {
   SetErrorCode(KO);
@@ -226,6 +227,7 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
     case PointOn_CurveByParam:
       aPI.SetCurve(aRefFunction);
       aPI.SetParameter(theParam1);
+      aPI.SetTakeOrientationIntoAccount(takeOrientationIntoAccount);
       break;
     case PointOn_CurveByLength:
       aPI.SetCurve(aRefFunction);
@@ -277,7 +279,8 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
     {
     case PointOn_CurveByParam:
       GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurve("
-                                   << theGeomObj << ", " << theParam1 << ")";
+                                   << theGeomObj << ", " << theParam1 << ", "
+                                   << takeOrientationIntoAccount <<  ")";
       break;
     case PointOn_CurveByLength:
       GEOM::TPythonDump(aFunction) << aPoint << " = geompy.MakeVertexOnCurveByLength("
@@ -315,9 +318,12 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::makePointOnGeom
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurve
-                            (Handle(GEOM_Object) theCurve, double theParameter)
+                            (Handle(GEOM_Object) theCurve,
+                             double              theParameter,
+                             bool                takeOrientationIntoAccount)
 {
-  return makePointOnGeom(theCurve, theParameter, 0.0, 0.0, PointOn_CurveByParam);
+  return makePointOnGeom(theCurve, theParameter, 0.0, 0.0, PointOn_CurveByParam,
+                         takeOrientationIntoAccount);
 }
 
 //=============================================================================
@@ -344,7 +350,8 @@ Handle(GEOM_Object) GEOMImpl_IBasicOperations::MakePointOnCurveByLength
                      double              theLength, 
                      Handle(GEOM_Object) theStartPoint)
 {
-  return makePointOnGeom(theCurve, theLength, 0.0, 0.0, PointOn_CurveByLength, theStartPoint);
+  return makePointOnGeom(theCurve, theLength, 0.0, 0.0, PointOn_CurveByLength,
+                         false, theStartPoint);
 }
 
 //=============================================================================
index 44347702600e4bd743fae970b4836ab2e464b1b2..df8051ab683d187316d590fde79d6ac394e11497 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -40,8 +40,10 @@ class GEOMImpl_IBasicOperations : public GEOM_IOperations {
   Standard_EXPORT Handle(GEOM_Object) MakePointWithReference (Handle(GEOM_Object) theReference,
                                               double theX, double theY, double theZ);
 
-  Standard_EXPORT Handle(GEOM_Object) MakePointOnCurve (Handle(GEOM_Object) theCurve,
-                                                        double theParameter);
+  Standard_EXPORT Handle(GEOM_Object) MakePointOnCurve
+                              (Handle(GEOM_Object) theCurve,
+                               double              theParameter,
+                               bool                takeOrientationIntoAccount);
 
   Standard_EXPORT Handle(GEOM_Object) MakePointOnCurveByLength (Handle(GEOM_Object) theCurve,
                                                                 double              theLength,
@@ -134,12 +136,14 @@ class GEOMImpl_IBasicOperations : public GEOM_IOperations {
     PointOn_Face
   };
 
-  Handle(GEOM_Object) makePointOnGeom (Handle(GEOM_Object) theGeomObj,
-                                       double theParam1,
-                                       double theParam2,
-                                       double theParam3,
-                                       const PointLocation theLocation,
-                                       Handle(GEOM_Object) theRefPoint = 0);
+  Handle(GEOM_Object) makePointOnGeom
+                     (Handle(GEOM_Object) theGeomObj,
+                      double              theParam1,
+                      double              theParam2,
+                      double              theParam3,
+                      const PointLocation theLocation,
+                      const bool          takeOrientationIntoAccount = false,
+                      Handle(GEOM_Object) theRefPoint = 0);
 };
 
 #endif
index 8c524b2f81d86351dbcda7565099399f8ffee810..020ef57dff17c5bcc827d36faa09b259373b023b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 4834552e1cce81c21ee4b22e1912387769be7a15..d4a25492ab673eb5b96760325e902160b6bf5dc9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index cca9f381f3b9586673588f7f03f042312cf646e4..210b9843e7edf7f35ed48059a38496207db4bd0c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -88,6 +88,7 @@
 #include <Bnd_Box.hxx>
 #include <GProp_GProps.hxx>
 
+#include <Geom_Curve.hxx>
 #include <Geom_Surface.hxx>
 #include <ShapeAnalysis_Surface.hxx>
 
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
+
+/**
+ * This function returns Standard_True if the face is quadrangular. It means
+ * that it has only 1 wire with 4 edges. If there are more then 4 edges in
+ * the wire and theToleranceC1 is not negative the new implementation is used.
+ * According to it the face is quadrangular if it is quadrangular according to
+ * an old implementation or if it has a single wire with more then 4 edges
+ * that form exactly 4 bounds of C1 continuity with the given tolerance.
+ *
+ * \param theFace the face to be checked
+ * \param theToleranceC1 if negative, it is not used; otherwise it is used
+ *        to check if two neighbor edges of face have C1 continuity.
+ * \return Standard_True if the face is quadrangular; Standard_False otherwise.
+ */
+static Standard_Boolean IsQuadrangle(const TopoDS_Face   &theFace,
+                                     const Standard_Real  theToleranceC1)
+{
+  TopExp_Explorer aFExp (theFace, TopAbs_WIRE);
+
+  if (!aFExp.More()) {
+    // no wire in the face
+    return Standard_False;
+  }
+
+  TopoDS_Shape aWire = aFExp.Current();
+
+  aFExp.Next();
+
+  if (aFExp.More()) {
+    // multiple wires in the face
+    return Standard_False;
+  }
+
+  // Check number of edges in the face
+  Standard_Integer    aNbEdges = 0;
+  TopTools_MapOfShape aMapEdges;
+  TopExp_Explorer     aWExp(aWire, TopAbs_EDGE);
+
+  for (; aWExp.More(); aWExp.Next()) {
+    if (aMapEdges.Add(aWExp.Current())) {
+      aNbEdges++;
+
+      if (aNbEdges > 4) {
+        break;
+      }
+    }
+  }
+
+  if (aNbEdges < 4) {
+    return Standard_False;
+  }
+
+  if (aNbEdges > 4) {
+    if (theToleranceC1 < 0.) {
+      return Standard_False;
+    }
+
+    // Check if a wire has 4 bounds of C1 continuity.
+    BRepTools_WireExplorer aWireExp(TopoDS::Wire(aWire), theFace);
+    TopTools_ListOfShape   anEdges;
+
+    for (aNbEdges = 0; aWireExp.More(); aWireExp.Next()) {
+      const TopoDS_Edge &anEdge = aWireExp.Current();
+
+      // Skip degenerated edges.
+      if (!BRep_Tool::Degenerated(anEdge)) {
+        anEdges.Append(anEdge);
+        ++aNbEdges;
+      }
+    }
+
+    if (aNbEdges < 4) {
+      return Standard_False;
+    }
+
+    // Compute number of sharp corners.
+    anEdges.Append(anEdges.First()); // To make a loop.
+
+    TopTools_ListIteratorOfListOfShape anIter(anEdges);
+    Standard_Real      aPar[2];
+    Standard_Integer   aNbCorners = 0;
+    TopoDS_Edge        anEdge1    = TopoDS::Edge(anEdges.First());
+    Handle(Geom_Curve) aCurve1    = BRep_Tool::Curve(anEdge1, aPar[0], aPar[1]);
+    Handle(Geom_Curve) aCurve2;
+    TopoDS_Edge        anEdge2;
+    TopoDS_Vertex      aCommonVtx;
+    gp_Pnt             aPnt;
+    gp_Vec             aVec1;
+    gp_Vec             aVec2;
+    Standard_Boolean   isReversed1 = (anEdge1.Orientation() == TopAbs_REVERSED);
+    Standard_Boolean   isReversed2;
+
+    for (anIter.Next(); anIter.More(); anIter.Next()) {
+      TopoDS_Edge anEdge2 = TopoDS::Edge(anIter.Value());
+
+      if (!TopExp::CommonVertex(anEdge1, anEdge2, aCommonVtx)) {
+        // NEVERREACHED
+        return Standard_False;
+      }
+
+      // Check the angle between tangent vectors of 2 curves at this point.
+      Standard_Real aParam1 = BRep_Tool::Parameter(aCommonVtx, anEdge1);
+      Standard_Real aParam2 = BRep_Tool::Parameter(aCommonVtx, anEdge2);
+
+      aCurve2     = BRep_Tool::Curve(anEdge2, aPar[0], aPar[1]);
+      isReversed2 = (anEdge2.Orientation() == TopAbs_REVERSED);
+      aCurve1->D1(aParam1, aPnt, aVec1);
+      aCurve2->D1(aParam2, aPnt, aVec2);
+
+      if (isReversed1) {
+        aVec1.Reverse();
+      }
+
+      if (isReversed2) {
+        aVec2.Reverse();
+      }
+      const Standard_Real anAngle = aVec1.Angle(aVec2);
+
+      if (anAngle > theToleranceC1) {
+        ++aNbCorners;
+
+        if (aNbCorners > 4) {
+          break;
+        }
+      }
+
+      // Go to the next couple of edges.
+      anEdge1     = anEdge2;
+      aCurve1     = aCurve2;
+      isReversed1 = isReversed2;
+    }
+
+    // Check the total number of corners.
+    if (aNbCorners != 4) {
+      return Standard_False;
+    }
+  }
+
+  return Standard_True;
+}
+
 //=============================================================================
 /*!
  *   constructor:
@@ -1647,7 +1789,8 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
                                                 TopTools_ListOfShape& BLO,
                                                 TopTools_ListOfShape& NOT,
                                                 TopTools_ListOfShape& EXT,
-                                                TopTools_ListOfShape& NOQ)
+                                                TopTools_ListOfShape& NOQ,
+                                                const Standard_Real   theToleranceC1)
 {
   TopAbs_ShapeEnum aType = theShape.ShapeType();
   switch (aType) {
@@ -1656,7 +1799,7 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
     {
       TopoDS_Iterator It (theShape);
       for (; It.More(); It.Next()) {
-        AddBlocksFrom(It.Value(), BLO, NOT, EXT, NOQ);
+        AddBlocksFrom(It.Value(), BLO, NOT, EXT, NOQ, theToleranceC1);
       }
     }
     break;
@@ -1665,6 +1808,7 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
       // Check, if there are seam or degenerated edges
       BlockFix_CheckTool aTool;
       aTool.SetShape(theShape);
+      aTool.SetAngTolerance(theToleranceC1);
       aTool.Perform();
       if (aTool.NbPossibleBlocks() > 0) {
         EXT.Append(theShape);
@@ -1676,41 +1820,12 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
         TopExp_Explorer expF (theShape, TopAbs_FACE);
 
         for (; expF.More(); expF.Next()) {
-          if (mapFaces.Add(expF.Current())) {
-            nbFaces++;
-            //0021483//if (nbFaces > 6) break;
+          TopoDS_Face aF = TopoDS::Face(expF.Current());
 
-            // get wire
-            TopoDS_Shape aF = expF.Current();
-            TopExp_Explorer wires (aF, TopAbs_WIRE);
-            if (!wires.More()) {
-              // no wire in the face
-              hasNonQuadr = Standard_True;
-              NOQ.Append(aF);//0021483
-              //0021483//break;
-              continue;
-            }
-            TopoDS_Shape aWire = wires.Current();
-            wires.Next();
-            if (wires.More()) {
-              // multiple wires in the face
-              hasNonQuadr = Standard_True;
-              NOQ.Append(aF);//0021483
-              //0021483//break;
-              continue;
-            }
+          if (mapFaces.Add(aF)) {
+            nbFaces++;
 
-            // Check number of edges in the face
-            Standard_Integer nbEdges = 0;
-            TopTools_MapOfShape mapEdges;
-            TopExp_Explorer expW (aWire, TopAbs_EDGE);
-            for (; expW.More(); expW.Next()) {
-              if (mapEdges.Add(expW.Current())) {
-                nbEdges++;
-                if (nbEdges > 4) break;
-              }
-            }
-            if (nbEdges != 4) {
+            if (!IsQuadrangle(aF, theToleranceC1)) {
               hasNonQuadr = Standard_True;
               NOQ.Append(aF);//0021483
             }
@@ -1732,34 +1847,10 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
       TopTools_MapOfShape mapFaces;
       TopExp_Explorer expF (theShape, TopAbs_FACE);
       for (; expF.More(); expF.Next()) {
-        if (mapFaces.Add(expF.Current())) {
-          // get wire
-          TopoDS_Shape aF = expF.Current();
-          TopExp_Explorer wires (aF, TopAbs_WIRE);
-          if (!wires.More()) {
-            // no wire in the face
-            NOQ.Append(aF);//0021483
-            continue;
-          }
-          TopoDS_Shape aWire = wires.Current();
-          wires.Next();
-          if (wires.More()) {
-            // multiple wires in the face
-            NOQ.Append(aF);//0021483
-            continue;
-          }
+        TopoDS_Face aF = TopoDS::Face(expF.Current());
 
-          // Check number of edges in the face
-          Standard_Integer nbEdges = 0;
-          TopTools_MapOfShape mapEdges;
-          TopExp_Explorer expW (aWire, TopAbs_EDGE);
-          for (; expW.More(); expW.Next()) {
-            if (mapEdges.Add(expW.Current())) {
-              nbEdges++;
-              if (nbEdges > 4) break;
-            }
-          }
-          if (nbEdges != 4) {
+        if (mapFaces.Add(aF)) {
+          if (!IsQuadrangle(aF, theToleranceC1)) {
             NOQ.Append(aF);//0021483
           }
         }
@@ -1771,99 +1862,6 @@ void GEOMImpl_IBlocksOperations::AddBlocksFrom (const TopoDS_Shape&   theShape,
   }
 }
 
-void AddBlocksFromOld (const TopoDS_Shape&   theShape,
-                       TopTools_ListOfShape& BLO,
-                       TopTools_ListOfShape& NOT,
-                       TopTools_ListOfShape& DEG,
-                       TopTools_ListOfShape& SEA)
-{
-  TopAbs_ShapeEnum aType = theShape.ShapeType();
-  switch (aType) {
-  case TopAbs_COMPOUND:
-  case TopAbs_COMPSOLID:
-    {
-      TopoDS_Iterator It (theShape);
-      for (; It.More(); It.Next()) {
-        AddBlocksFromOld(It.Value(), BLO, NOT, DEG, SEA);
-      }
-    }
-    break;
-  case TopAbs_SOLID:
-    {
-      TopTools_MapOfShape mapFaces;
-      TopExp_Explorer expF (theShape, TopAbs_FACE);
-      Standard_Integer nbFaces = 0;
-      Standard_Boolean hasNonQuadr = Standard_False;
-      Standard_Boolean hasDegenerated = Standard_False;
-      Standard_Boolean hasSeam = Standard_False;
-      for (; expF.More(); expF.Next()) {
-        if (mapFaces.Add(expF.Current())) {
-          nbFaces++;
-          if (nbFaces > 6) break;
-
-          // Check number of edges in the face
-          Standard_Integer nbEdges = 0;
-          TopTools_MapOfShape mapEdges;
-
-          // get wire
-          TopoDS_Shape aF = expF.Current();
-          TopExp_Explorer wires (aF, TopAbs_WIRE);
-          if (!wires.More()) {
-            // no wire in the face
-            hasNonQuadr = Standard_True;
-            break;
-          }
-          TopoDS_Shape aWire = wires.Current();
-          wires.Next();
-          if (wires.More()) {
-            // multiple wires in the face
-            hasNonQuadr = Standard_True;
-            break;
-          }
-
-          // iterate on wire
-          BRepTools_WireExplorer aWE (TopoDS::Wire(aWire), TopoDS::Face(aF));
-          for (; aWE.More(); aWE.Next(), nbEdges++) {
-            if (BRep_Tool::Degenerated(aWE.Current())) {
-              // degenerated edge found
-              hasDegenerated = Standard_True;
-//              break;
-            }
-            if (mapEdges.Contains(aWE.Current())) {
-              // seam edge found
-              hasSeam = Standard_True;
-//              break;
-            }
-            mapEdges.Add(aWE.Current());
-          }
-          if (nbEdges != 4) {
-            hasNonQuadr = Standard_True;
-          }
-        }
-      }
-      if (nbFaces == 6) {
-        if (hasDegenerated || hasSeam) {
-          if (hasDegenerated) {
-            DEG.Append(theShape);
-          }
-          if (hasSeam) {
-            SEA.Append(theShape);
-          }
-        } else if (hasNonQuadr) {
-          NOT.Append(theShape);
-        } else {
-          BLO.Append(theShape);
-        }
-      } else {
-        NOT.Append(theShape);
-      }
-    }
-    break;
-  default:
-    NOT.Append(theShape);
-  }
-}
-
 #define REL_NOT_CONNECTED 0
 #define REL_OK            1
 #define REL_NOT_GLUED     2
@@ -2086,158 +2084,6 @@ Standard_Boolean HasAnyConnection (const Standard_Integer         theBlockIndex,
   return Standard_False;
 }
 
-//=============================================================================
-/*!
- *  CheckCompoundOfBlocksOld
- */
-//=============================================================================
-Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocksOld
-                                                (Handle(GEOM_Object) theCompound,
-                                                 std::list<BCError>&      theErrors)
-{
-  SetErrorCode(KO);
-
-  if (theCompound.IsNull()) return Standard_False;
-  TopoDS_Shape aBlockOrComp = theCompound->GetValue();
-
-  Standard_Boolean isCompOfBlocks = Standard_True;
-
-  // Map sub-shapes and their indices
-  TopTools_IndexedMapOfShape anIndices;
-  TopExp::MapShapes(aBlockOrComp, anIndices);
-
-  // 1. Report non-blocks
-  TopTools_ListOfShape NOT; // Not blocks
-  TopTools_ListOfShape DEG; // Hexahedral solids, having degenerated edges
-  TopTools_ListOfShape SEA; // Hexahedral solids, having seam edges
-  TopTools_ListOfShape BLO; // All blocks from the given compound
-  AddBlocksFromOld(aBlockOrComp, BLO, NOT, DEG, SEA);
-
-  if (NOT.Extent() > 0) {
-    isCompOfBlocks = Standard_False;
-    BCError anErr;
-    anErr.error = NOT_BLOCK;
-    TopTools_ListIteratorOfListOfShape it (NOT);
-    for (; it.More(); it.Next()) {
-      anErr.incriminated.push_back(anIndices.FindIndex(it.Value()));
-    }
-    theErrors.push_back(anErr);
-  }
-
-  if (DEG.Extent() > 0 || SEA.Extent() > 0) {
-    isCompOfBlocks = Standard_False;
-    BCError anErr;
-    anErr.error = EXTRA_EDGE;
-
-    TopTools_ListIteratorOfListOfShape itDEG (DEG);
-    for (; itDEG.More(); itDEG.Next()) {
-      anErr.incriminated.push_back(anIndices.FindIndex(itDEG.Value()));
-    }
-
-    TopTools_ListIteratorOfListOfShape itSEA (SEA);
-    for (; itSEA.More(); itSEA.Next()) {
-      anErr.incriminated.push_back(anIndices.FindIndex(itSEA.Value()));
-    }
-
-    theErrors.push_back(anErr);
-  }
-
-  Standard_Integer nbBlocks = BLO.Extent();
-  if (nbBlocks == 0) {
-    isCompOfBlocks = Standard_False;
-    SetErrorCode(OK);
-    return isCompOfBlocks;
-  }
-  if (nbBlocks == 1) {
-    SetErrorCode(OK);
-    return isCompOfBlocks;
-  }
-
-  // Convert list of blocks into array for easy and fast access
-  Standard_Integer ibl = 1;
-  TopTools_Array1OfShape aBlocks (1, nbBlocks);
-  TopTools_ListIteratorOfListOfShape BLOit (BLO);
-  for (; BLOit.More(); BLOit.Next(), ibl++) {
-    aBlocks.SetValue(ibl, BLOit.Value());
-  }
-
-  // 2. Find relations between all blocks,
-  //    report connection errors (NOT_GLUED and INVALID_CONNECTION)
-  TColStd_Array2OfInteger aRelations (1, nbBlocks, 1, nbBlocks);
-  aRelations.Init(REL_NOT_CONNECTED);
-
-  Standard_Integer row = 1;
-  for (row = 1; row <= nbBlocks; row++) {
-    TopoDS_Shape aBlock = aBlocks.Value(row);
-
-    Standard_Integer col = row + 1;
-    for (; col <= nbBlocks; col++) {
-      Standard_Integer aRel = BlocksRelation(aBlock, aBlocks.Value(col));
-      if (aRel != REL_NOT_CONNECTED) {
-        aRelations.SetValue(row, col, aRel);
-        aRelations.SetValue(col, row, aRel);
-        if (aRel == REL_NOT_GLUED) {
-          // report connection error
-          isCompOfBlocks = Standard_False;
-          BCError anErr;
-          anErr.error = NOT_GLUED;
-          anErr.incriminated.push_back(anIndices.FindIndex(aBlocks.Value(row)));
-          anErr.incriminated.push_back(anIndices.FindIndex(aBlocks.Value(col)));
-          theErrors.push_back(anErr);
-        } else if (aRel == REL_COLLISION_VV ||
-                   aRel == REL_COLLISION_FF ||
-                   aRel == REL_COLLISION_EE ||
-                   aRel == REL_UNKNOWN) {
-          // report connection error
-          isCompOfBlocks = Standard_False;
-          BCError anErr;
-          anErr.error = INVALID_CONNECTION;
-          anErr.incriminated.push_back(anIndices.FindIndex(aBlocks.Value(row)));
-          anErr.incriminated.push_back(anIndices.FindIndex(aBlocks.Value(col)));
-          theErrors.push_back(anErr);
-        } else {
-        }
-      }
-    }
-  }
-
-  // 3. Find largest set of connected (good connection or not glued) blocks
-  TColStd_MapOfInteger aProcessedMap;
-  TColStd_MapOfInteger aLargestSet;
-  TColStd_MapOfInteger aCurrentSet;
-  for (ibl = 1; ibl <= nbBlocks; ibl++) {
-    if (!aProcessedMap.Contains(ibl)) {
-      aCurrentSet.Clear();
-      FindConnected(ibl, aRelations, aProcessedMap, aCurrentSet);
-      if (aCurrentSet.Extent() > aLargestSet.Extent()) {
-        aLargestSet = aCurrentSet;
-      }
-    }
-  }
-
-  // 4. Report all blocks, isolated from <aLargestSet>
-  BCError anErr;
-  anErr.error = NOT_CONNECTED;
-  Standard_Boolean hasIsolated = Standard_False;
-  for (ibl = 1; ibl <= nbBlocks; ibl++) {
-    if (!aLargestSet.Contains(ibl)) {
-      aProcessedMap.Clear();
-      if (!HasAnyConnection(ibl, aLargestSet, aRelations, aProcessedMap)) {
-        // report connection absence
-        hasIsolated = Standard_True;
-        anErr.incriminated.push_back(anIndices.FindIndex(aBlocks.Value(ibl)));
-      }
-    }
-  }
-  if (hasIsolated) {
-    isCompOfBlocks = Standard_False;
-    theErrors.push_back(anErr);
-  }
-
-  SetErrorCode(OK);
-  return isCompOfBlocks;
-}
-
 //=============================================================================
 /*!
  *  PrintBCErrors
@@ -2294,6 +2140,7 @@ TCollection_AsciiString GEOMImpl_IBlocksOperations::PrintBCErrors
 //=============================================================================
 Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocks
                                               (Handle(GEOM_Object) theCompound,
+                                               const Standard_Real theToleranceC1,
                                                std::list<BCError>& theErrors)
 {
   SetErrorCode(KO);
@@ -2312,7 +2159,7 @@ Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocks
   TopTools_ListOfShape EXT; // Hexahedral solids, having degenerated and/or seam edges
   TopTools_ListOfShape BLO; // All blocks from the given compound
   TopTools_ListOfShape NOQ; // All non-quadrangular faces
-  AddBlocksFrom(aBlockOrComp, BLO, NOT, EXT, NOQ);
+  AddBlocksFrom(aBlockOrComp, BLO, NOT, EXT, NOQ, theToleranceC1);
 
   // Report non-blocks
   if (NOT.Extent() > 0) {
@@ -2478,7 +2325,8 @@ Standard_Boolean GEOMImpl_IBlocksOperations::CheckCompoundOfBlocks
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetNonBlocks
-                                     (Handle(GEOM_Object) theShape,
+                                     (Handle(GEOM_Object)  theShape,
+                                      const Standard_Real  theToleranceC1,
                                       Handle(GEOM_Object)& theNonQuads)
 {
   SetErrorCode(KO);
@@ -2491,7 +2339,7 @@ Handle(GEOM_Object) GEOMImpl_IBlocksOperations::GetNonBlocks
   TopTools_ListOfShape NOT; // Not blocks
   TopTools_ListOfShape EXT; // Hexahedral solids, having degenerated and/or seam edges
   TopTools_ListOfShape NOQ; // All non-quadrangular faces
-  AddBlocksFrom(aShape, BLO, NOT, EXT, NOQ);
+  AddBlocksFrom(aShape, BLO, NOT, EXT, NOQ, theToleranceC1);
 
   if (NOT.IsEmpty() && EXT.IsEmpty() && NOQ.IsEmpty()) {
     SetErrorCode("NOT_FOUND_ANY");
index 8a03b6e23f5bc6d5c62958a1922e9e37d7e47f26..4b118cf09e83ba590a3dcdc40dd3374ef66a441f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -125,16 +125,15 @@ class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
     std::list<int>   incriminated;
   };
 
-  Standard_EXPORT Standard_Boolean CheckCompoundOfBlocksOld (Handle(GEOM_Object) theCompound,
-                                                             std::list<BCError>& theErrors);
-
   Standard_EXPORT Standard_Boolean CheckCompoundOfBlocks (Handle(GEOM_Object) theCompound,
+                                                          const Standard_Real theToleranceC1,
                                                           std::list<BCError>& theErrors);
 
   Standard_EXPORT TCollection_AsciiString PrintBCErrors (Handle(GEOM_Object)       theCompound,
                                                          const std::list<BCError>& theErrors);
 
-  Standard_EXPORT Handle(GEOM_Object) GetNonBlocks (Handle(GEOM_Object) theShape,
+  Standard_EXPORT Handle(GEOM_Object) GetNonBlocks (Handle(GEOM_Object)  theShape,
+                                                    const Standard_Real  theToleranceC1,
                                                     Handle(GEOM_Object)& theNonQuads);
 
   Standard_EXPORT Handle(GEOM_Object) RemoveExtraEdges (Handle(GEOM_Object) theShape,
@@ -148,7 +147,8 @@ class GEOMImpl_IBlocksOperations : public GEOM_IOperations {
                                              TopTools_ListOfShape& BLO,
                                              TopTools_ListOfShape& NOT,
                                              TopTools_ListOfShape& EXT,
-                                             TopTools_ListOfShape& NOQ);
+                                             TopTools_ListOfShape& NOQ,
+                                             const Standard_Real  theToleranceC1 = -1.);
 
   // Extract blocks from blocks compounds
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) ExplodeCompoundOfBlocks
index 7d9460fcedc3e1fce60735adca605cf514fe61f9..c8f498855351d31d6bbc31ce92e20cc842fedf68 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index eddc96add4747623e0d02a7441ab0839742e10d9..05202784166617038590292bf45a037926ecb7b0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 75c230e2c33c53ade3a2b1361336e39a2c212dac..bc6d4d40a9a44d9ef35b825caf036582a7518c84 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c4a8ac1fe296df19042e5ffea0c57365155cf65b..a4e00f7f005ff76c3cb6901862aa3986cecb6130 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index dba2380475ade451e900237aab9dc9816600aa59..f4466a2e8d42b860a4bdac14a72a4488df3d8794 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 68357cdcdf40422e671a1350bdc7acd954cce30e..ac802db63eff04586ac8af1d9358f6be77b88170 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 32b4621341788e4d4783279a6323c7c702f35077..87c072fde16638cf43781daa4e9e69d4cc119005 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b102c92fe5f6641c79e6e144304540470e077995..211a3874dbeb4b72a0b3258857c3108cc4799633 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f1cdb50fb4e8b65a603a0f58073c7ba9db9f73fb..63dc86a9724c73f552939890dc3881412c83aa4e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f6c452b951ebbb6dc730764b009df7bba96e10fc..229024df4028641243ba7f0ce07506c67a920db4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
  * ===========  PYTHON ==============
  * ==================================*/
 
-typedef struct {
-  PyObject_HEAD
-  int softspace;
-  std::string *out;
-  } PyStdOut;
-
-static void
-PyStdOut_dealloc(PyStdOut *self)
-{
-  PyObject_Del(self);
-}
-
-static PyObject *
-PyStdOut_write(PyStdOut *self, PyObject *args)
+namespace
 {
-  char *c;
-  int l;
-  if (!PyArg_ParseTuple(args, "t#:write",&c, &l))
-    return NULL;
-
-  //std::cerr << c ;
-  *(self->out)=*(self->out)+c;
-
-  Py_INCREF(Py_None);
-  return Py_None;
-}
+  typedef struct {
+    PyObject_HEAD
+    int softspace;
+    std::string *out;
+  } PyStdOut;
+  
+  static void
+  PyStdOut_dealloc(PyStdOut *self)
+  {
+    PyObject_Del(self);
+  }
 
-static PyMethodDef PyStdOut_methods[] = {
-  {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS,
-    PyDoc_STR("write(string) -> None")},
-  {NULL,    NULL}   /* sentinel */
-};
-
-static PyMemberDef PyStdOut_memberlist[] = {
-  {(char*)"softspace", T_INT,  offsetof(PyStdOut, softspace), 0,
-   (char*)"flag indicating that a space needs to be printed; used by print"},
-  {NULL} /* Sentinel */
-};
-
-static PyTypeObject PyStdOut_Type = {
-  /* The ob_type field must be initialized in the module init function
-   * to be portable to Windows without using C++. */
-  PyObject_HEAD_INIT(NULL)
-  0,                            /*ob_size*/
-  "PyOut",                      /*tp_name*/
-  sizeof(PyStdOut),             /*tp_basicsize*/
-  0,                            /*tp_itemsize*/
-  /* methods */
-  (destructor)PyStdOut_dealloc, /*tp_dealloc*/
-  0,                            /*tp_print*/
-  0,                            /*tp_getattr*/
-  0,                            /*tp_setattr*/
-  0,                            /*tp_compare*/
-  0,                            /*tp_repr*/
-  0,                            /*tp_as_number*/
-  0,                            /*tp_as_sequence*/
-  0,                            /*tp_as_mapping*/
-  0,                            /*tp_hash*/
-  0,                            /*tp_call*/
-  0,                            /*tp_str*/
-  PyObject_GenericGetAttr,      /*tp_getattro*/
-  /* softspace is writable:  we must supply tp_setattro */
-  PyObject_GenericSetAttr,      /* tp_setattro */
-  0,                            /*tp_as_buffer*/
-  Py_TPFLAGS_DEFAULT,           /*tp_flags*/
-  0,                            /*tp_doc*/
-  0,                            /*tp_traverse*/
-  0,                            /*tp_clear*/
-  0,                            /*tp_richcompare*/
-  0,                            /*tp_weaklistoffset*/
-  0,                            /*tp_iter*/
-  0,                            /*tp_iternext*/
-  PyStdOut_methods,             /*tp_methods*/
-  PyStdOut_memberlist,          /*tp_members*/
-  0,                            /*tp_getset*/
-  0,                            /*tp_base*/
-  0,                            /*tp_dict*/
-  0,                            /*tp_descr_get*/
-  0,                            /*tp_descr_set*/
-  0,                            /*tp_dictoffset*/
-  0,                            /*tp_init*/
-  0,                            /*tp_alloc*/
-  0,                            /*tp_new*/
-  0,                            /*tp_free*/
-  0,                            /*tp_is_gc*/
-};
-
-PyObject * newPyStdOut( std::string& out )
-{
-  PyStdOut *self;
-  self = PyObject_New(PyStdOut, &PyStdOut_Type);
-  if (self == NULL)
-    return NULL;
-  self->softspace = 0;
-  self->out=&out;
-  return (PyObject*)self;
+  static PyObject*
+  PyStdOut_write(PyStdOut* self, PyObject* args)
+  {
+    char *c;
+    int l;
+    if (!PyArg_ParseTuple(args, "t#:write", &c, &l))
+      return NULL;
+    
+    *(self->out) = *(self->out) + c;
+    
+    Py_INCREF(Py_None);
+    return Py_None;
+  }
+  
+  static PyMethodDef PyStdOut_methods[] = {
+    {"write",  (PyCFunction)PyStdOut_write,  METH_VARARGS,
+     PyDoc_STR("write(string) -> None")},
+    {NULL,    NULL}   /* sentinel */
+  };
+
+  static PyMemberDef PyStdOut_memberlist[] = {
+    {(char*)"softspace", T_INT,  offsetof(PyStdOut, softspace), 0,
+     (char*)"flag indicating that a space needs to be printed; used by print"},
+    {NULL} /* Sentinel */
+  };
+  
+  static PyTypeObject PyStdOut_Type = {
+    /* The ob_type field must be initialized in the module init function
+     * to be portable to Windows without using C++. */
+    PyObject_HEAD_INIT(NULL)
+    0,                            /*ob_size*/
+    "PyOut",                      /*tp_name*/
+    sizeof(PyStdOut),             /*tp_basicsize*/
+    0,                            /*tp_itemsize*/
+    /* methods */
+    (destructor)PyStdOut_dealloc, /*tp_dealloc*/
+    0,                            /*tp_print*/
+    0,                            /*tp_getattr*/
+    0,                            /*tp_setattr*/
+    0,                            /*tp_compare*/
+    0,                            /*tp_repr*/
+    0,                            /*tp_as_number*/
+    0,                            /*tp_as_sequence*/
+    0,                            /*tp_as_mapping*/
+    0,                            /*tp_hash*/
+    0,                            /*tp_call*/
+    0,                            /*tp_str*/
+    PyObject_GenericGetAttr,      /*tp_getattro*/
+    /* softspace is writable:  we must supply tp_setattro */
+    PyObject_GenericSetAttr,      /* tp_setattro */
+    0,                            /*tp_as_buffer*/
+    Py_TPFLAGS_DEFAULT,           /*tp_flags*/
+    0,                            /*tp_doc*/
+    0,                            /*tp_traverse*/
+    0,                            /*tp_clear*/
+    0,                            /*tp_richcompare*/
+    0,                            /*tp_weaklistoffset*/
+    0,                            /*tp_iter*/
+    0,                            /*tp_iternext*/
+    PyStdOut_methods,             /*tp_methods*/
+    PyStdOut_memberlist,          /*tp_members*/
+    0,                            /*tp_getset*/
+    0,                            /*tp_base*/
+    0,                            /*tp_dict*/
+    0,                            /*tp_descr_get*/
+    0,                            /*tp_descr_set*/
+    0,                            /*tp_dictoffset*/
+    0,                            /*tp_init*/
+    0,                            /*tp_alloc*/
+    0,                            /*tp_new*/
+    0,                            /*tp_free*/
+    0,                            /*tp_is_gc*/
+  };
+  
+  PyObject* newPyStdOut( std::string& out )
+  {
+    PyStdOut* self = PyObject_New(PyStdOut, &PyStdOut_Type);
+    if (self) {
+      self->softspace = 0;
+      self->out=&out;
+    }
+    return (PyObject*)self;
+  }
 }
 
-
 ////////////////////////END PYTHON///////////////////////////
 //=============================================================================
 /*!
@@ -1008,7 +1008,7 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
 
   PyObject * func = NULL;
   func = PyObject_GetAttrString(main_mod, "coordCalculator");
-
   if (func == NULL){
     SetErrorCode("Can't get function from python module !!!");
     PyGILState_Release(gstate);
@@ -1021,15 +1021,15 @@ Handle(GEOM_Object) GEOMImpl_ICurvesOperations::MakeCurveParametric
   else
     coords = PyObject_CallFunction(func,(char*)"(d, d, d)", theParamMin, theParamMax, theParamStep );
 
-  PyObject* new_stderr = NULL;
-
   if (coords == NULL){
     fflush(stderr);
     std::string err_description="";
-    new_stderr = newPyStdOut(err_description);
+    PyObject* new_stderr = newPyStdOut(err_description);
+    PyObject* old_stderr = PySys_GetObject((char*)"stderr");
+    Py_INCREF(old_stderr);
     PySys_SetObject((char*)"stderr", new_stderr);
     PyErr_Print();
-    PySys_SetObject((char*)"stderr", PySys_GetObject((char*)"__stderr__"));
+    PySys_SetObject((char*)"stderr", old_stderr);
     Py_DECREF(new_stderr);
     MESSAGE("Can't evaluate coordCalculator()" << " error is " << err_description);
     SetErrorCode("Can't evaluate the expressions, please check them !!!");
index fe4278cc630b94ac846db8505d9c45408740f401..83870c0ef9a90dc3a4cb3c773be94fdef8e87ac4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c092c950eea5f4c4c02642c0aff56ba14197603e..0afdf8f0d8d5971d9b6627b093a9d588d1922a11 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ddc5224ba39eff7e3e6b0c87f2318a4d3d87cc90..0736977421be6dbc36d9ef500580dc50b8dec866 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1cd65c13597520cc0f628aa1a35c1a1d8621d9fe..839261c396de926a11a930c7f28a1e91136d155e 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index a6c26b7e014aa5973d4fd900a586247daf54b7aa..3d8e39983964297bc612c98e855ebe7e5f44c17d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index b6c8221a65eb8779e64b6f6cb890a9a0ebaee7c1..90147ff3f02c2acc96a1ae8456ab8dcfc0f60e98 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 6ec2b44c42ae66cc1e7c18570014bc3c125ba0b4..453a502d5e952b6242f8439005c783ace36e8d98 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7e817402fff0901fe1cf8b3d884da4c9b4f4ce57..6ef83de748a198e527ccc8260a35ac31e01ba1db 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 97cdecb842bb2d3ea924a42d666972fa02260077..73a8ef8559b5db50980107710b07cf9e1411670a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c31eab8a1bd32c3ed8ecec6540b8ea6673ba27df..e37771166a8816126c6f26623a055d50790e88f4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3db056a06789ac6f0ee41f776948eb76e608d702..d233438be9d139dbf17ba3d9514250291f9ec171 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7b343f5330c8f99ba2b0900aab0b2daf9cc9f401..6440e3d8a6972a726556500d1302e55ac8ec5527 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index a8fabe3bb492563010db73526e5ea7e40a32d7a9..9c74d50dc73c36f8a25625d16f16349249b9596a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 //NOTE: This is an intreface to a function for the Filling operation.
 //
 #include "GEOM_Function.hxx"
+#include <TColStd_HSequenceOfTransient.hxx>
 
-#define FILL_ARG_MINDEG   1
-#define FILL_ARG_MAXDEG   2
-#define FILL_ARG_TOL2D    3
-#define FILL_ARG_TOL3D    4
-#define FILL_ARG_SHAPE    5
-#define FILL_ARG_NBITER   6
-#define FILL_ARG_APPROX   7
-#define FILL_ARG_METHOD   8
+enum GEOMImpl_IFilling_Arg {
+  FILL_ARG_MINDEG = 1,
+  FILL_ARG_MAXDEG = 2,
+  FILL_ARG_TOL2D  = 3,
+  FILL_ARG_TOL3D  = 4,
+  FILL_ARG_SHAPE  = 5,
+  FILL_ARG_NBITER = 6,
+  FILL_ARG_APPROX = 7,
+  FILL_ARG_METHOD = 8
+};
 
 class GEOMImpl_IFilling
 {
- public:
+public:
 
   GEOMImpl_IFilling(Handle(GEOM_Function) theFunction): _func(theFunction) {}
+
   void SetTol2D(double theTol2D) { _func->SetReal(FILL_ARG_TOL2D, theTol2D); }
-  void SetTol3D(double theTol3D) { _func->SetReal(FILL_ARG_TOL3D, theTol3D); }   
+  void SetTol3D(double theTol3D) { _func->SetReal(FILL_ARG_TOL3D, theTol3D); }
   double GetTol2D() { return _func->GetReal(FILL_ARG_TOL2D); }
-  double GetTol3D() { return _func->GetReal(FILL_ARG_TOL3D); } 
-  
+  double GetTol3D() { return _func->GetReal(FILL_ARG_TOL3D); }
+
   void SetMinDeg(int theMinDeg) { _func->SetInteger(FILL_ARG_MINDEG, theMinDeg); }
   void SetMaxDeg(int theMaxDeg) { _func->SetInteger(FILL_ARG_MAXDEG, theMaxDeg); }
   int GetMinDeg() { return _func->GetInteger(FILL_ARG_MINDEG); }
   int GetMaxDeg() { return _func->GetInteger(FILL_ARG_MAXDEG); }
   void SetNbIter(int theNbIter) { _func->SetInteger(FILL_ARG_NBITER, theNbIter); }
-  int GetNbIter() { return _func->GetInteger(FILL_ARG_NBITER); } 
+  int GetNbIter() { return _func->GetInteger(FILL_ARG_NBITER); }
 
   void SetApprox(bool theApprox) { _func->SetInteger(FILL_ARG_APPROX, theApprox); }
-  bool GetApprox() { return _func->GetInteger(FILL_ARG_APPROX); } 
+  bool GetApprox() { return _func->GetInteger(FILL_ARG_APPROX); }
 
   void SetMethod(int theMethod) { _func->SetInteger(FILL_ARG_METHOD, theMethod); }
-  int GetMethod() { return _func->GetInteger(FILL_ARG_METHOD); } 
+  int GetMethod() { return _func->GetInteger(FILL_ARG_METHOD); }
 
+  void SetShapes(const Handle(TColStd_HSequenceOfTransient)& theShapes)
+  { _func->SetReferenceList(FILL_ARG_SHAPE, theShapes); }
+  Handle(TColStd_HSequenceOfTransient) GetShapes()
+  {
+    Handle(TColStd_HSequenceOfTransient) aSeq = _func->GetReferenceList(FILL_ARG_SHAPE);
+    if ( aSeq.IsNull() ) {
+      Handle(GEOM_Function) fun = GetShape();
+      if ( !fun.IsNull() ) {
+        aSeq = new TColStd_HSequenceOfTransient;
+        aSeq->Append( fun );
+      }
+    }
+    return aSeq;
+  }
   void SetShape(Handle(GEOM_Function) theShape) { _func->SetReference(FILL_ARG_SHAPE, theShape); }
   Handle(GEOM_Function) GetShape() { return _func->GetReference(FILL_ARG_SHAPE); }
 
- private:
+private:
 
   Handle(GEOM_Function) _func;
 };
index b0765454118cff95439d7320c636b42dd715f7a3..54bd65165176142f71caa54550204de5a87ca39e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -26,9 +26,9 @@
 
 #include <TColStd_HSequenceOfTransient.hxx>
 
-#define GLUE_ARG_BASE   1
-#define GLUE_ARG_TOLER  2
-#define GLUE_ARG_FACES  3
+#define GLUE_ARG_BASE    1
+#define GLUE_ARG_TOLER   2
+#define GLUE_ARG_FACES   3
 #define GLUE_ARG_KEEPALL 4
 #define GLUE_ARG_GLUEEDG 5
 
@@ -38,10 +38,11 @@ class GEOMImpl_IGlue
 
   GEOMImpl_IGlue(Handle(GEOM_Function) theFunction): _func(theFunction) {}
 
-  void SetBase(Handle(GEOM_Function) theRefBase)
-  { _func->SetReference(GLUE_ARG_BASE, theRefBase); }
+  void SetBase(const Handle(TColStd_HSequenceOfTransient)& theShapes)
+  { _func->SetReferenceList(GLUE_ARG_BASE, theShapes); }
 
-  Handle(GEOM_Function) GetBase() { return _func->GetReference(GLUE_ARG_BASE); }
+  Handle(TColStd_HSequenceOfTransient) GetBase()
+  { return _func->GetReferenceList(GLUE_ARG_BASE); }
 
   void SetTolerance(const Standard_Real theTolerance)
   { _func->SetReal(GLUE_ARG_TOLER, theTolerance); }
index e603adc90ad2a5fbf72d70075ffa1f0d93e401f6..cb5b09782f99484aeaaab881e55d322011c54b4b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index d7a4bf585539c88d8b70707d695ac9c28f5ad8ee..77932fcf49aeb4e6097cd64ce9de4a52fb539ba3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 8fcbf31103edb146bbecfb928d8718a6d7f5b093..b4b1af9d1838bb0ea0125441e57a8bc1ff5c3725 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -24,7 +24,9 @@
 
 #include <TColStd_HArray1OfInteger.hxx>
 #include <TColStd_HArray1OfExtendedString.hxx>
-#include "TColStd_HSequenceOfTransient.hxx"
+#include <TColStd_HSequenceOfTransient.hxx>
+#include <TopAbs.hxx>
+#include <ShHealOper_ModifStats.hxx>
 
 class GEOMImpl_IHealing
 {
@@ -41,7 +43,8 @@ public:
     ARG_DEV_EDGE_VALUE          =  8,
     ARG_IS_BY_PARAMETER         =  9,
     ARG_SUBSHAPE_INDEX          = 10,
-    ARG_LIST_SHAPES             = 11
+    ARG_LIST_SHAPES             = 11,
+    ARG_TYPE                    = 12
   };
 
   GEOMImpl_IHealing(Handle(GEOM_Function) theFunction): _func(theFunction) {}
@@ -55,7 +58,7 @@ public:
   void SetValues( const Handle(TColStd_HArray1OfExtendedString)& arr ) {  if ( !arr.IsNull() ) _func->SetStringArray(ARG_SHAPE_PROCESS_VALUES, arr); }
   Handle(TColStd_HArray1OfExtendedString) GetValues() { return _func->GetStringArray(ARG_SHAPE_PROCESS_VALUES); }
 
-  void SetOriginal( Handle(GEOM_Function)& f ) { _func->SetReference(ARG_ORIGINAL, f); }
+  void SetOriginal( Handle(GEOM_Function) f ) { _func->SetReference(ARG_ORIGINAL, f); }
   Handle(GEOM_Function) GetOriginal() { return _func->GetReference(ARG_ORIGINAL); }
 
   void SetFaces( const Handle(TColStd_HArray1OfInteger)& arr ) { if ( !arr.IsNull() ) _func->SetIntegerArray(ARG_LIST_ARGUMENTS, arr); }
@@ -73,6 +76,9 @@ public:
   void SetTolerance( Standard_Real val ) { _func->SetReal(ARG_TOLERANCE, val); }
   Standard_Real GetTolerance() { return _func->GetReal(ARG_TOLERANCE); }
 
+  void SetType( TopAbs_ShapeEnum val ) { _func->SetInteger(ARG_TYPE, (Standard_Integer)val); }
+  TopAbs_ShapeEnum GetType() { TopAbs_ShapeEnum type = (TopAbs_ShapeEnum)(_func->GetInteger(ARG_TYPE)); return _func->IsDone() ? type : TopAbs_SHAPE; }
+
   void SetDevideEdgeValue( Standard_Real val ) { _func->SetReal(ARG_DEV_EDGE_VALUE, val); }
   Standard_Real GetDevideEdgeValue() { return _func->GetReal(ARG_DEV_EDGE_VALUE); }
 
@@ -84,6 +90,24 @@ public:
   Handle(TColStd_HSequenceOfTransient) GetShapes()
   { return _func->GetReferenceList(ARG_LIST_SHAPES); }
 
+  Handle(TColStd_HSequenceOfTransient) GetOriginalAndShapes()
+  {
+    Handle(TColStd_HSequenceOfTransient) funs = GetShapes();
+    if ( funs.IsNull() ) funs = new TColStd_HSequenceOfTransient;
+    funs->Prepend( GetOriginal() );
+    return funs;
+  }
+
+  void SetStatistics( ShHealOper_ModifStats* ms )
+  {
+    if ( ms ) ms->Clear();
+    _func->SetCallBackData( (void*) ms );
+  }
+  ShHealOper_ModifStats* GetStatistics()
+  {
+    return (ShHealOper_ModifStats*) _func->GetCallBackData();
+  }
+
 private:
   Handle(GEOM_Function) _func;
 };
index b45374c45b73a97d7aaf626578c5f715ffbba77e..82654f21ffac3deb4c03f9f51498cf7a23eb7a67 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #endif
 
 #include <Standard_Version.hxx>
-#include <Standard_Stream.hxx>
 
 #include <GEOMImpl_IHealingOperations.hxx>
-
 #include <GEOM_PythonDump.hxx>
-
 #include <GEOMImpl_HealingDriver.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOMImpl_IHealing.hxx>
 #include <GEOMImpl_IVector.hxx>
 #include <GEOMImpl_VectorDriver.hxx>
 #include <GEOMImpl_CopyDriver.hxx>
+#include <ShHealOper_ModifStats.hxx>
+#include <ShHealOper_ShapeProcess.hxx>
 
 #include <Basics_OCCTVersion.hxx>
 
-#include "utilities.h"
+#include <utilities.h>
 #include <OpUtil.hxx>
 #include <Utils_ExceptHandlers.hxx>
 
-#include <ShHealOper_ShapeProcess.hxx>
-
+#include <BRep_Builder.hxx>
 #include <ShapeAnalysis_FreeBounds.hxx>
-
-#include <TopoDS_Compound.hxx>
-#include <TopExp_Explorer.hxx>
-
 #include <TColStd_HArray1OfExtendedString.hxx>
 #include <TColStd_HSequenceOfTransient.hxx>
 #include <TCollection_AsciiString.hxx>
-
-#include <TDF_Tool.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopTools_SequenceOfShape.hxx>
+#include <TopoDS_Compound.hxx>
 
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
@@ -68,6 +63,7 @@
 GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine, int theDocID)
 : GEOM_IOperations(theEngine, theDocID)
 {
+  myModifStats = new ShHealOper_ModifStats;
   MESSAGE("GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations");
 }
 
@@ -78,6 +74,7 @@ GEOMImpl_IHealingOperations::GEOMImpl_IHealingOperations (GEOM_Engine* theEngine
 //=============================================================================
 GEOMImpl_IHealingOperations::~GEOMImpl_IHealingOperations()
 {
+  delete myModifStats;
   MESSAGE("GEOMImpl_IHealingOperations::~GEOMImpl_IHealingOperations");
 }
 
@@ -138,6 +135,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ShapeProcess (Handle(GEOM_Objec
     HI.SetParameters( theParams );
     HI.SetValues( theValues );
   }
+  HI.SetStatistics( myModifStats );
 
   //Compute the translation
   try {
@@ -277,6 +275,11 @@ bool GEOMImpl_IHealingOperations::GetParameters (const std::string theOperation,
   } else if( theOperation == "DropSmallEdges" ) {
     theParams.push_back( "DropSmallEdges.Tolerance3d" );
 
+  } else if( theOperation == "DropSmallSolids" ) {
+    theParams.push_back( "DropSmallSolids.WidthFactorThreshold" );
+    theParams.push_back( "DropSmallSolids.VolumeThreshold" );
+    theParams.push_back( "DropSmallSolids.MergeSolids" );
+
   } else if( theOperation == "BSplineRestriction" ) {
     theParams.push_back( "BSplineRestriction.SurfaceMode" );
     theParams.push_back( "BSplineRestriction.Curve3dMode" );
@@ -345,6 +348,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::SuppressFaces
   GEOMImpl_IHealing HI (aFunction);
   HI.SetFaces(theFaces);
   HI.SetOriginal(aLastFunction);
+  HI.SetStatistics( myModifStats );
 
   //Compute the translation
   try {
@@ -413,6 +417,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::CloseContour
   HI.SetWires( theWires );
   HI.SetIsCommonVertex( isCommonVertex );
   HI.SetOriginal( aLastFunction );
+  HI.SetStatistics( myModifStats );
 
   //Compute the translation
   try {
@@ -480,6 +485,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveIntWires
   GEOMImpl_IHealing HI(aFunction);
   HI.SetWires( theWires );
   HI.SetOriginal( aLastFunction );
+  HI.SetStatistics( myModifStats );
 
   //Compute the translation
   try {
@@ -546,6 +552,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::FillHoles (Handle(GEOM_Object)
   GEOMImpl_IHealing HI(aFunction);
   HI.SetWires( theWires );
   HI.SetOriginal( aLastFunction );
+  HI.SetStatistics( myModifStats );
 
   //Compute the translation
   try {
@@ -585,27 +592,31 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::FillHoles (Handle(GEOM_Object)
  *  Sew
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_IHealingOperations::Sew (Handle(GEOM_Object) theObject,
-                                                      double theTolerance,
-                                                      bool isAllowNonManifold)
+Handle(GEOM_Object)
+GEOMImpl_IHealingOperations::Sew (std::list<Handle(GEOM_Object)>& theObjects,
+                                  double                          theTolerance,
+                                  bool                            isAllowNonManifold)
 {
   // set error code, check parameters
   SetErrorCode(KO);
 
-  if (theObject.IsNull())
+  if (theObjects.empty())
     return NULL;
 
-  Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
-  if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
+  Handle(TColStd_HSequenceOfTransient) objects =
+    GEOM_Object::GetLastFunctions( theObjects );
+  if ( objects.IsNull() || objects->IsEmpty() ) {
+    SetErrorCode("NULL argument shape");
+    return NULL;
+  }
 
   // Add a new object
   Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
 
   //Add the function
   int aFunctionType = (isAllowNonManifold ? SEWING_NON_MANIFOLD : SEWING);
-
-  aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), aFunctionType);
-
+  Handle(GEOM_Function) aFunction =
+    aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), aFunctionType);
   if (aFunction.IsNull()) return NULL;
 
   //Check if the function is set correctly
@@ -614,7 +625,9 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::Sew (Handle(GEOM_Object) theObj
   // prepare "data container" class IHealing
   GEOMImpl_IHealing HI(aFunction);
   HI.SetTolerance( theTolerance );
-  HI.SetOriginal( aLastFunction );
+  HI.SetOriginal( theObjects.front()->GetLastFunction() ); objects->Remove(1);
+  HI.SetShapes( objects );
+  HI.SetStatistics( myModifStats );
 
   //Compute the result
   try {
@@ -634,10 +647,10 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::Sew (Handle(GEOM_Object) theObj
   //Make a Python command
   GEOM::TPythonDump pd(aFunction);
   
-  pd << aNewObject << " = geompy.Sew(" << theObject << ", " << theTolerance;
+  pd << aNewObject << " = geompy.Sew(" << theObjects << ", " << theTolerance;
 
   if (isAllowNonManifold) {
-    pd << ", true";
+    pd << ", True";
   }
 
   pd << ")";
@@ -651,22 +664,27 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::Sew (Handle(GEOM_Object) theObj
  *  RemoveInternalFaces
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveInternalFaces (Handle(GEOM_Object) theObject)
+Handle(GEOM_Object)
+GEOMImpl_IHealingOperations::RemoveInternalFaces (std::list< Handle(GEOM_Object)> & theSolids)
 {
   // set error code, check parameters
   SetErrorCode(KO);
 
-  if (theObject.IsNull())
+  if (theSolids.empty())
     return NULL;
 
-  Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
-  if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be processed
+  Handle(TColStd_HSequenceOfTransient) objects = GEOM_Object::GetLastFunctions( theSolids );
+  if ( objects.IsNull() || objects->IsEmpty() ) {
+    SetErrorCode("NULL argument shape");
+    return NULL;
+  }
 
   // Add a new object
   Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add the function
-  aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), REMOVE_INTERNAL_FACES);
+  Handle(GEOM_Function)
+    aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), REMOVE_INTERNAL_FACES);
   if (aFunction.IsNull()) return NULL;
 
   //Check if the function is set correctly
@@ -674,7 +692,9 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveInternalFaces (Handle(GEO
 
   // prepare "data container" class IHealing
   GEOMImpl_IHealing HI (aFunction);
-  HI.SetOriginal(aLastFunction);
+  HI.SetOriginal( theSolids.front()->GetLastFunction() ); objects->Remove(1);
+  HI.SetShapes( objects );
+  HI.SetStatistics( myModifStats );
 
   //Compute the result
   try {
@@ -692,7 +712,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::RemoveInternalFaces (Handle(GEO
   }
 
   //Make a Python command
-  GEOM::TPythonDump(aFunction) << aNewObject << " = geompy.RemoveInternalFaces(" << theObject << ")";
+  GEOM::TPythonDump(aFunction) << aNewObject << " = geompy.RemoveInternalFaces(" << theSolids << ")";
 
   SetErrorCode(OK);
   return aNewObject;
@@ -734,6 +754,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::DivideEdge (Handle(GEOM_Object)
   HI.SetDevideEdgeValue( theValue );
   HI.SetIsByParameter( isByParameter );
   HI.SetOriginal( aLastFunction );
+  HI.SetStatistics( myModifStats );
 
   //Compute the translation
   try {
@@ -757,6 +778,74 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::DivideEdge (Handle(GEOM_Object)
   return aNewObject;
 }
 
+//=============================================================================
+/*!
+ *  DivideEdgeByPoint
+ */
+//=============================================================================
+Handle(GEOM_Object)
+GEOMImpl_IHealingOperations::DivideEdgeByPoint (Handle(GEOM_Object)               theObject,
+                                                int                               theIndex,
+                                                std::list< Handle(GEOM_Object)> & thePoints)
+{
+  // set error code, check parameters
+  SetErrorCode(KO);
+
+  if (theObject.IsNull() || thePoints.empty() )
+    return NULL;
+
+  Handle(GEOM_Function) aFunction, aLastFunction = theObject->GetLastFunction();
+  if (aLastFunction.IsNull() )
+    return NULL; //There is no function which creates an object to be processed
+
+  Handle(TColStd_HSequenceOfTransient) aPointFunc = GEOM_Object::GetLastFunctions( thePoints );
+  if ( aPointFunc.IsNull() || aPointFunc->IsEmpty() ) {
+    SetErrorCode("NULL argument points");
+    return NULL;
+  }
+
+  // Add a new object
+  Handle(GEOM_Object) aNewObject = GetEngine()->AddObject( GetDocID(), GEOM_COPY );
+
+  //Add the function
+  aFunction = aNewObject->AddFunction(GEOMImpl_HealingDriver::GetID(), DIVIDE_EDGE_BY_POINT);
+
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL;
+
+  // prepare "data container" class IHealing
+  GEOMImpl_IHealing HI(aFunction);
+  HI.SetIndex     ( theIndex );
+  HI.SetOriginal  ( aLastFunction );
+  HI.SetShapes    ( aPointFunc );
+
+  HI.SetStatistics( myModifStats );
+
+  //Compute the translation
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Healing driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction)
+    << aNewObject << " = geompy.DivideEdgeByPoint(" << theObject
+    << ", " << theIndex << ", " << thePoints << ")";
+
+  SetErrorCode(OK);
+  return aNewObject;
+}
+
 //=============================================================================
 /*!
  *  FuseCollinearEdgesWithinWire
@@ -782,6 +871,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::FuseCollinearEdgesWithinWire
   if (aFunction->GetDriverGUID() != GEOMImpl_HealingDriver::GetID()) return NULL;
 
   GEOMImpl_IHealing aCI (aFunction);
+  aCI.SetStatistics( myModifStats );
 
   Handle(GEOM_Function) aRefShape = theWire->GetLastFunction();
   if (aRefShape.IsNull()) return NULL;
@@ -835,19 +925,40 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::FuseCollinearEdgesWithinWire
  *  GetFreeBoundary
  */
 //=============================================================================
-bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(GEOM_Object) theObject,
+bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(TColStd_HSequenceOfTransient)& theObjects,
                                                    Handle(TColStd_HSequenceOfTransient)& theClosed,
                                                    Handle(TColStd_HSequenceOfTransient)& theOpen )
 {
   // set error code, check parameters
   SetErrorCode(KO);
 
-  if ( theObject.IsNull() || theClosed.IsNull() || theOpen.IsNull() )
+  if ( theObjects.IsNull() || theObjects->Length() == 0 ||
+       theClosed.IsNull()  || theOpen.IsNull() )
     return false;
 
-  TopoDS_Shape aShape = theObject->GetValue();
-  if ( aShape.IsNull() )
-    return false;
+  TopoDS_Shape aShape;
+  TopTools_SequenceOfShape shapes;
+  for ( int ind = 1; ind <= theObjects->Length(); ind++)
+  {
+    Handle(GEOM_Object) aRefShape = Handle(GEOM_Object)::DownCast( theObjects->Value(ind));
+    if ( aRefShape.IsNull() )
+      return false;
+    aShape = aRefShape->GetValue();
+    if ( aShape.IsNull() )
+      return false;
+    shapes.Append( aShape );
+  }
+
+  if ( shapes.Length() > 1 )
+  {
+    TopoDS_Compound compound;
+    BRep_Builder builder;
+    builder.MakeCompound( compound );
+    for ( int i = 1; i <= shapes.Length(); ++i )
+      builder.Add( compound, shapes( i ) );
+
+    aShape = compound;
+  }
 
   // get free boundary shapes
 
@@ -906,7 +1017,7 @@ bool GEOMImpl_IHealingOperations::GetFreeBoundary (Handle(GEOM_Object) theObject
       pd << "empty_list";
     }
 
-    pd << ") = geompy.GetFreeBoundary(" << theObject << ")";
+    pd << ") = geompy.GetFreeBoundary(" << theObjects << ")";
   }
 
   SetErrorCode(OK);
@@ -947,6 +1058,9 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientation (Handle(GEOM_
     // prepare "data container" class IVector
     GEOMImpl_IVector aVI (aFunction);
     aVI.SetCurve(aLastFunction);
+
+    myModifStats->Clear();
+    myModifStats->AddModif( "Vector reversed" );
   }
   else {
     //Add the function
@@ -959,6 +1073,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientation (Handle(GEOM_
     // prepare "data container" class IHealing
     GEOMImpl_IHealing HI (aFunction);
     HI.SetOriginal(aLastFunction);
+    HI.SetStatistics( myModifStats );
   }
 
   //Compute the translation
@@ -1001,7 +1116,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G
     return NULL; //There is no function which creates an object to be processed
 
   // Add a new object
-  Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aNewObject = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   if (theObject->GetType() == GEOM_VECTOR) { // Mantis issue 21066
     //Add the function
@@ -1014,6 +1129,9 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G
     // prepare "data container" class IVector
     GEOMImpl_IVector aVI (aFunction);
     aVI.SetCurve(aLastFunction);
+
+    myModifStats->Clear();
+    myModifStats->AddModif( "Vector reversed" );
   }
   else {
     //Add the function
@@ -1026,6 +1144,7 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G
     // prepare "data container" class IHealing
     GEOMImpl_IHealing aHI (aFunction);
     aHI.SetOriginal(aLastFunction);
+    aHI.SetStatistics( myModifStats );
   }
 
   // Compute the result
@@ -1056,7 +1175,8 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::ChangeOrientationCopy (Handle(G
  */
 //=============================================================================
 Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Object) theObject,
-                                                                 double theTolerance)
+                                                                 double theTolerance,
+                                                                 TopAbs_ShapeEnum theType)
 {
   // Set error code, check parameters
   SetErrorCode(KO);
@@ -1084,6 +1204,8 @@ Handle(GEOM_Object) GEOMImpl_IHealingOperations::LimitTolerance (Handle(GEOM_Obj
   GEOMImpl_IHealing HI (aFunction);
   HI.SetOriginal(aLastFunction);
   HI.SetTolerance(theTolerance);
+  HI.SetType(theType);
+  HI.SetStatistics( myModifStats );
 
   // Compute
   try {
index 607ecc4b4cae624684c40a919a4bd8d3d6bb5274..504a9b7780b1a6ff7c1004b0e9996a387e358619 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include "GEOM_Engine.hxx"
 #include "GEOM_Object.hxx"
 
+#include <TopAbs.hxx>
 #include <TColStd_HArray1OfExtendedString.hxx>
 #include <TColStd_HArray1OfInteger.hxx>
 
 #include <list>
 
+class ShHealOper_ModifStats;
+
 class GEOMImpl_IHealingOperations : public GEOM_IOperations {
  public:
   Standard_EXPORT GEOMImpl_IHealingOperations(GEOM_Engine* theEngine, int theDocID);
@@ -70,16 +73,20 @@ class GEOMImpl_IHealingOperations : public GEOM_IOperations {
   Standard_EXPORT Handle(GEOM_Object) FillHoles( Handle(GEOM_Object) theObject,
                                  const Handle(TColStd_HArray1OfInteger)& theWires);
 
-  Standard_EXPORT Handle(GEOM_Object) Sew( Handle(GEOM_Object) theObject,
-                           double theTolerance,
-                           bool isAllowNonManifold);
+  Standard_EXPORT Handle(GEOM_Object) Sew( std::list<Handle(GEOM_Object)> & theObject,
+                                           double                           theTolerance,
+                                           bool                             isAllowNonManifold);
 
-  Standard_EXPORT Handle(GEOM_Object) RemoveInternalFaces (Handle(GEOM_Object) theObject);
+  Standard_EXPORT Handle(GEOM_Object) RemoveInternalFaces (std::list< Handle(GEOM_Object)> & theSolids);
 
   Standard_EXPORT Handle(GEOM_Object) DivideEdge( Handle(GEOM_Object) theObject,
-                                                  int theIndex,
-                                                  double theValue,
-                                                  bool isByParameter );
+                                                  int                 theIndex,
+                                                  double              theValue,
+                                                  bool                isByParameter );
+
+  Standard_EXPORT Handle(GEOM_Object) DivideEdgeByPoint( Handle(GEOM_Object)             theObject,
+                                                         int                             theIndex,
+                                                         std::list<Handle(GEOM_Object)>& thePoint );
 
   Standard_EXPORT Handle(GEOM_Object) FuseCollinearEdgesWithinWire
                                      (Handle(GEOM_Object) theWire,
@@ -88,16 +95,22 @@ class GEOMImpl_IHealingOperations : public GEOM_IOperations {
   // this function does not use Function-Driver mechanism, it just computes the free
   // boundary edges and returns them in the sequence.  It is called just for information reasons
   // and it's not intended for history/undo/redo/etc..
-  Standard_EXPORT bool GetFreeBoundary ( Handle(GEOM_Object) theObject,
-                         Handle(TColStd_HSequenceOfTransient)& theOutClosedWires,
-                         Handle(TColStd_HSequenceOfTransient)& theOutOpenWires );
+  Standard_EXPORT bool GetFreeBoundary ( Handle(TColStd_HSequenceOfTransient)& theObjects,
+                                         Handle(TColStd_HSequenceOfTransient)& theOutClosedWires,
+                                         Handle(TColStd_HSequenceOfTransient)& theOutOpenWires );
 
   Standard_EXPORT Handle(GEOM_Object) ChangeOrientation( Handle(GEOM_Object) theObject);
   Standard_EXPORT Handle(GEOM_Object) ChangeOrientationCopy( Handle(GEOM_Object) theObject);
 
   Standard_EXPORT Handle(GEOM_Object) LimitTolerance( Handle(GEOM_Object) theObject,
-                                                      double theTolerance );
+                                                      double theTolerance,
+                                                      TopAbs_ShapeEnum theType = TopAbs_SHAPE );
+
+  const ShHealOper_ModifStats* GetStatistics() { return myModifStats; }
+
+private:
 
+  ShHealOper_ModifStats* myModifStats;
 };
 
 #endif
index 854b27a0722a70ec96839658d652f4701a3cf2fc..4c5a3e4197450dc35698dbdd572b0dc65eede0e7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
old mode 100755 (executable)
new mode 100644 (file)
index e5f5a1f..18127be
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -29,6 +29,7 @@
 #include <GEOMImpl_ImportDriver.hxx>
 #include <GEOMImpl_ICopy.hxx>
 #include <GEOMImpl_IImportExport.hxx>
+#include <GEOMImpl_ITransferData.hxx>
 #include <GEOMImpl_Types.hxx>
 #include "GEOMImpl_IShapesOperations.hxx"
 #include "GEOMImpl_IGroupOperations.hxx"
@@ -340,3 +341,107 @@ std::list<int> GEOMImpl_IInsertOperations::GetAllTextures()
   SetErrorCode(OK);
   return id_list;
 }
+
+//=============================================================================
+/*!
+ *  TransferData
+ */
+//=============================================================================
+bool GEOMImpl_IInsertOperations::TransferData
+                          (const Handle(GEOM_Object)      &theObjectFrom,
+                           const Handle(GEOM_Object)      &theObjectTo,
+                           const int                       theFindMethod,
+                                 std::list<TransferDatum> &theResult)
+{
+  SetErrorCode(KO);
+
+  if (theObjectFrom.IsNull() || theObjectTo.IsNull()) {
+    return false;
+  }
+
+  //Add a new Transfer Data object object
+  Handle(GEOM_Object) aTDObj =
+    GetEngine()->AddObject(GetDocID(), GEOM_TRANSFER_DATA);
+
+  //Add a Transfer Data function for created object
+  Handle(GEOM_Function) aFunction =
+    aTDObj->AddFunction(GEOMImpl_CopyDriver::GetID(), TRANSFER_DATA);
+
+  //Check if the function is set correctly
+  if(aFunction->GetDriverGUID() != GEOMImpl_CopyDriver::GetID()) {
+    return false;
+  }
+
+  Handle(GEOM_Function) aFunctionFrom = theObjectFrom->GetLastFunction();
+  Handle(GEOM_Function) aFunctionTo   = theObjectTo->GetLastFunction();
+
+  if (aFunctionFrom.IsNull() || aFunctionTo.IsNull()) {
+    return false;
+  }
+
+  GEOMImpl_ITransferData aTD(aFunction);
+
+  aTD.SetRef1(aFunctionFrom);
+  aTD.SetRef2(aFunctionTo);
+  aTD.SetFindMethod(theFindMethod);
+
+  // Transfer data
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Transfer data failed");
+      return false;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return false;
+  }
+
+  // Fill result list of data.
+  theResult.clear();
+
+  Handle(TColStd_HArray1OfExtendedString) aDatumName   = aTD.GetDatumName();
+  Handle(TColStd_HArray1OfInteger)        aDatumMaxVal = aTD.GetDatumMaxVal();
+  Handle(TColStd_HArray1OfInteger)        aDatumVal    = aTD.GetDatumVal();
+
+  if (!aDatumName.IsNull() && !aDatumMaxVal.IsNull() && !aDatumVal.IsNull()) {
+    Standard_Integer i;
+    Standard_Integer aNbDatum = aDatumName->Length();
+
+    for (i = 1; i <= aNbDatum; ++i) {
+      if (aDatumMaxVal->Value(i) > 0) {
+        TransferDatum aDatum;
+
+        aDatum.myName      = TCollection_AsciiString(aDatumName->Value(i));
+        aDatum.myNumber    = aDatumVal->Value(i);
+        aDatum.myMaxNumber = aDatumMaxVal->Value(i);
+        theResult.push_back(aDatum);
+      }
+    }
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump pd (aFunction);
+  pd << "geompy.TransferData(" << theObjectFrom << ", " << theObjectTo;
+  pd << ", GEOM.";
+
+  switch (theFindMethod) {
+  case TD_GET_IN_PLACE:
+    pd << "FSM_GetInPlace";
+    break;
+  case TD_GET_IN_PLACE_OLD:
+    pd << "FSM_GetInPlace_Old";
+    break;
+  case TD_GET_IN_PLACE_BY_HISTORY:
+  default:
+    pd << "FSM_GetInPlaceByHistory";
+    break;
+  }
+  pd << ")";
+
+  SetErrorCode(OK);
+
+  return true;
+}
index 9341c2b8da8a4edf542cb3feb123b85e79bea207..dd5b343905791b04f0323ef4874f3580cd4e4e42 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,14 @@ class Handle_TColStd_HArray1OfByte;
 
 class GEOMImpl_IInsertOperations : public GEOM_IOperations {
  public:
+
+  struct TransferDatum
+  {
+    TCollection_AsciiString myName;
+    long                    myNumber;
+    long                    myMaxNumber;
+  };
+
   Standard_EXPORT GEOMImpl_IInsertOperations(GEOM_Engine* theEngine, int theDocID);
   Standard_EXPORT ~GEOMImpl_IInsertOperations();
 
@@ -79,6 +87,12 @@ class GEOMImpl_IInsertOperations : public GEOM_IOperations {
 
   Standard_EXPORT std::list<int> GetAllTextures();
 
+  Standard_EXPORT bool TransferData
+                          (const Handle(GEOM_Object)      &theObjectFrom,
+                           const Handle(GEOM_Object)      &theObjectTo,
+                           const int                       theFindMethod,
+                                 std::list<TransferDatum> &theResult);
+
  private:
   std::vector<Handle(Resource_Manager)> myResMgrList;
   GEOMImpl_IShapesOperations* myShapesOperations;
index 4d16c1c0203f30edf2fd73de0f1d87b6212b07df..e11d161e83f0b907f0cec5f59ac4c2d47bb13eee 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ab2df9a8156d88717d7e5735cd184aa592f10491..80a145fc268013ee40d81357664dce29cac42360 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b3c270ef8b8534eeb4c8cc99be67ab8807810f5a..4bc0ce831e40c8f932b0645234560413c56e5ff1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index df47366cba9f0b20ffcb776f908cdc69fa6413f8..c316c230a680f602b38ff4e8b1137d1efadc6604 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 6875ecc01f7be3740a0e35d8fe22da1d2b44bc40..2c409a8e7139bc579a7d7270a26522df61478b30 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 8801d4eef58a94547bfc3b15e5d2ba3398b33199..e933332234bf2bb507efe8adc491260b25525a01 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 0cf9dd339f55ad7e1832c97600e10b5826e43e0c..e1b9e08cd63d38493c730d01c0ca03fce03ed834 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -20,6 +20,8 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
+#include <Basics_OCCTVersion.hxx>
+
 #include <GEOMImpl_IMeasureOperations.hxx>
 #include <GEOMImpl_IMeasure.hxx>
 #include <GEOMImpl_MeasureDriver.hxx>
 #include <BRepClass3d_SolidClassifier.hxx>
 #include <BRepClass_FaceClassifier.hxx>
 #include <BRepExtrema_DistShapeShape.hxx>
+#include <BRepExtrema_ShapeProximity.hxx>
+#if OCC_VERSION_LARGE > 0x06090000
+#include <BRepExtrema_SelfIntersection.hxx>
+#include <BRepExtrema_MapOfIntegerPackedMapOfInteger.hxx>
+#endif
 #include <BRepGProp.hxx>
 #include <BRepTools.hxx>
 #include <BRep_Tool.hxx>
@@ -56,6 +63,7 @@
 #include <GeomAPI_ProjectPointOnSurf.hxx>
 #include <GeomLProp_CLProps.hxx>
 #include <GeomLProp_SLProps.hxx>
+#include <Geom_Plane.hxx>
 #include <GProp_GProps.hxx>
 #include <GProp_PrincipalProps.hxx>
 #include <ShapeAnalysis.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopTools_DataMapIteratorOfDataMapOfIntegerListOfShape.hxx>
+#include <TColStd_MapIteratorOfPackedMapOfInteger.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_ListOfShape.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
+#include <set>
+
 //=============================================================================
 /*!
  *  Constructor
@@ -137,6 +148,38 @@ GEOMImpl_IMeasureOperations::ShapeKind GEOMImpl_IMeasureOperations::KindOfShape
   }
   const GEOMAlgo_ShapeInfo& anInfo = aSF.Info();
 
+  // specific processing for some "advandced" objects
+  switch ( geom_type ) {
+  case GEOM_MARKER:
+    // local coordinate systen
+    // (+) geompy.kind.LCS  xc yc zc xx xy xz yx yy yz zx zy zz
+
+    TopoDS_Face aFace = TopoDS::Face( aShape );
+    Handle(Geom_Plane) aPlane = Handle(Geom_Plane)::DownCast( BRep_Tool::Surface( aFace ) );
+    gp_Pnt aC = aPlane->Pln().Location();
+    gp_Ax3 anAx3 = aPlane->Pln().Position();
+
+    theDoubles->Append(aC.X());
+    theDoubles->Append(aC.Y());
+    theDoubles->Append(aC.Z());
+    
+    gp_Dir aD = anAx3.XDirection();
+    theDoubles->Append(aD.X());
+    theDoubles->Append(aD.Y());
+    theDoubles->Append(aD.Z());
+    aD = anAx3.YDirection();
+    theDoubles->Append(aD.X());
+    theDoubles->Append(aD.Y());
+    theDoubles->Append(aD.Z());
+    aD = anAx3.Direction();
+    theDoubles->Append(aD.X());
+    theDoubles->Append(aD.Y());
+    theDoubles->Append(aD.Z());
+
+    SetErrorCode(OK);
+    return SK_LCS;
+  }
+
   // Interprete results
   TopAbs_ShapeEnum aType = anInfo.Type();
   switch (aType)
@@ -518,35 +561,22 @@ GEOMImpl_IMeasureOperations::ShapeKind GEOMImpl_IMeasureOperations::KindOfShape
           theDoubles->Append(aD.X());
           theDoubles->Append(aD.Y());
           theDoubles->Append(aD.Z());
+
+          if (anInfo.KindOfBounds() != GEOMAlgo_KB_INFINITE)
+          {
+            // (+) geompy.kind.PLANAR  xo yo zo  dx dy dz  nb_edges nb_vertices
+            aKind = SK_PLANAR;
+            
+            theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+            theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
+          }
         }
         break;
       default:
-        if (anInfo.KindOfShape() == GEOMAlgo_KS_PLANE) {
-          // (+) geompy.kind.PLANAR  xo yo zo  dx dy dz  nb_edges nb_vertices
-
-          aKind = SK_PLANAR;
-
-          gp_Pnt aC = anInfo.Location();
-          theDoubles->Append(aC.X());
-          theDoubles->Append(aC.Y());
-          theDoubles->Append(aC.Z());
-
-          gp_Ax3 anAx3 = anInfo.Position();
-          gp_Dir aD = anAx3.Direction();
-          theDoubles->Append(aD.X());
-          theDoubles->Append(aD.Y());
-          theDoubles->Append(aD.Z());
-
-          theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
-          theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
-        }
-        else {
-          // ??? geompy.kind.FACE  nb_edges nb_vertices _surface_type_id_
-          // (+) geompy.kind.FACE  nb_edges nb_vertices
-
-          theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
-          theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
-        }
+        // ??? geompy.kind.FACE  nb_edges nb_vertices _surface_type_id_
+        // (+) geompy.kind.FACE  nb_edges nb_vertices
+        theIntegers->Append(anInfo.NbSubShapes(TopAbs_EDGE));
+        theIntegers->Append(anInfo.NbSubShapes(TopAbs_VERTEX));
       }
     }
     break;
@@ -1501,10 +1531,10 @@ TCollection_AsciiString GEOMImpl_IMeasureOperations::PrintShapeErrors
 //=============================================================================
 bool GEOMImpl_IMeasureOperations::CheckSelfIntersections
                          (Handle(GEOM_Object)                 theShape,
+                          const SICheckLevel                  theCheckLevel,
                           Handle(TColStd_HSequenceOfInteger)& theIntersections)
 {
   SetErrorCode(KO);
-  bool isGood = false;
 
   if (theIntersections.IsNull())
     theIntersections = new TColStd_HSequenceOfInteger;
@@ -1512,13 +1542,13 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections
     theIntersections->Clear();
 
   if (theShape.IsNull())
-    return isGood;
+    return false;
 
   Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
-  if (aRefShape.IsNull()) return isGood;
+  if (aRefShape.IsNull()) return false;
 
   TopoDS_Shape aShape = aRefShape->GetValue();
-  if (aShape.IsNull()) return isGood;
+  if (aShape.IsNull()) return false;
 
   // 0. Prepare data
   TopoDS_Shape aScopy;
@@ -1534,12 +1564,12 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections
   //
   BOPAlgo_CheckerSI aCSI; // checker of self-interferences
   aCSI.SetArguments(aLCS);
+  aCSI.SetLevelOfCheck(theCheckLevel);
 
   // 1. Launch the checker
   aCSI.Perform();
   Standard_Integer iErr = aCSI.ErrorStatus();
 
-  isGood = true;
   //
   Standard_Integer aNbS, n1, n2;
   BOPDS_MapIteratorMapOfPassKey aItMPK;
@@ -1563,13 +1593,173 @@ bool GEOMImpl_IMeasureOperations::CheckSelfIntersections
 
     theIntersections->Append(anIndices.FindIndex(aS1));
     theIntersections->Append(anIndices.FindIndex(aS2));
-    isGood = false;
   }
 
   if (!iErr) {
     SetErrorCode(OK);
   }
 
+  return theIntersections->IsEmpty();
+}
+
+//=============================================================================
+/*!
+ *  CheckSelfIntersectionsFast
+ */
+//=============================================================================
+bool GEOMImpl_IMeasureOperations::CheckSelfIntersectionsFast
+                         (Handle(GEOM_Object) theShape,
+                         float theDeflection, double theTolerance,
+                          Handle(TColStd_HSequenceOfInteger)& theIntersections)
+{
+  SetErrorCode(KO);
+
+  if (theIntersections.IsNull())
+    theIntersections = new TColStd_HSequenceOfInteger;
+  else
+    theIntersections->Clear();
+
+  if (theShape.IsNull())
+    return false;
+
+  Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
+  if (aRefShape.IsNull()) return false;
+
+  TopoDS_Shape aShape = aRefShape->GetValue();
+  if (aShape.IsNull()) return false;
+
+  // Prepare data
+  TopoDS_Shape aScopy;
+
+  GEOMAlgo_AlgoTools::CopyShape(aShape, aScopy);
+  GEOMUtils::MeshShape(aScopy, theDeflection);
+
+  // Map sub-shapes and their indices
+  TopTools_IndexedMapOfShape anIndices;
+  TopExp::MapShapes(aScopy, anIndices);
+
+#if OCC_VERSION_LARGE > 0x06090000
+  // Checker of fast interferences
+  BRepExtrema_SelfIntersection aTool(aScopy, (theTolerance <= 0.) ? 0.0 : theTolerance);
+
+  // Launch the checker
+  aTool.Perform();
+  
+  const BRepExtrema_MapOfIntegerPackedMapOfInteger& intersections = aTool.OverlapElements();
+  
+  std::set<Standard_Integer> processed;
+  
+  for (BRepExtrema_MapOfIntegerPackedMapOfInteger::Iterator it(intersections); it.More(); it.Next()) {
+    Standard_Integer idxLeft = it.Key();
+    if (processed.count(idxLeft) > 0) continue; // already added
+    processed.insert(idxLeft);
+    const TColStd_PackedMapOfInteger& overlaps = it.Value();
+    for (TColStd_MapIteratorOfPackedMapOfInteger subit(overlaps); subit.More(); subit.Next()) {
+      Standard_Integer idxRight = subit.Key();
+      if (processed.count(idxRight) > 0) continue; // already added
+      const TopoDS_Shape& aS1 = aTool.GetSubShape(idxLeft);
+      const TopoDS_Shape& aS2 = aTool.GetSubShape(idxRight);
+      theIntersections->Append(anIndices.FindIndex(aS1));
+      theIntersections->Append(anIndices.FindIndex(aS2));
+    }
+  }
+
+  if (aTool.IsDone())
+    SetErrorCode(OK);
+#endif
+
+  return theIntersections->IsEmpty();
+}
+
+//=============================================================================
+/*!
+ *  FastIntersect
+ */
+//=============================================================================
+bool GEOMImpl_IMeasureOperations::FastIntersect (Handle(GEOM_Object) theShape1, Handle(GEOM_Object) theShape2,
+                                                 double theTolerance, float theDeflection,
+                                                 Handle(TColStd_HSequenceOfInteger)& theIntersections1,
+                                                 Handle(TColStd_HSequenceOfInteger)& theIntersections2)
+{
+  SetErrorCode(KO);
+  bool isGood = false;
+
+  if (theIntersections1.IsNull())
+    theIntersections1 = new TColStd_HSequenceOfInteger;
+  else
+    theIntersections1->Clear();
+
+  if (theIntersections2.IsNull())
+    theIntersections2 = new TColStd_HSequenceOfInteger;
+  else
+    theIntersections2->Clear();
+
+  if (theShape1.IsNull() || theShape2.IsNull()) {
+    SetErrorCode("Objects have NULL Shape");
+    return isGood;
+  }
+
+  if (theShape1 == theShape2) {
+    SetErrorCode("Objects are equal");
+    return isGood;
+  }
+  Handle(GEOM_Function) aRefShape1 = theShape1->GetLastFunction();
+  Handle(GEOM_Function) aRefShape2 = theShape2->GetLastFunction();
+  if (aRefShape1.IsNull() || aRefShape2.IsNull()) return isGood;
+
+  TopoDS_Shape aShape1 = aRefShape1->GetValue();
+  TopoDS_Shape aShape2 = aRefShape2->GetValue();
+  if (aShape1.IsNull() || aShape2.IsNull()) return isGood;
+
+  // 0. Prepare data
+  TopoDS_Shape aScopy1, aScopy2;
+  GEOMAlgo_AlgoTools::CopyShape(aShape1, aScopy1);
+  GEOMAlgo_AlgoTools::CopyShape(aShape2, aScopy2);
+
+  GEOMUtils::MeshShape(aScopy1, theDeflection);
+  GEOMUtils::MeshShape(aScopy2, theDeflection);
+  //
+  // Map sub-shapes and their indices
+  TopTools_IndexedMapOfShape anIndices1, anIndices2;
+  TopExp::MapShapes(aScopy1, anIndices1);
+  TopExp::MapShapes(aScopy2, anIndices2);
+
+  BOPCol_ListOfShape aLCS1, aLCS2;
+  aLCS1.Append(aScopy1); aLCS2.Append(aScopy2);
+  //
+  BRepExtrema_ShapeProximity aBSP; // checker of fast interferences
+  aBSP.LoadShape1(aScopy1); aBSP.LoadShape2(aScopy2);
+  aBSP.SetTolerance((theTolerance <= 0.) ? 0.0 : theTolerance);
+
+  // 1. Launch the checker
+  aBSP.Perform();
+  // 2. Get sets of IDs of overlapped faces
+#if OCC_VERSION_LARGE > 0x06090000
+  for (BRepExtrema_MapOfIntegerPackedMapOfInteger::Iterator anIt1 (aBSP.OverlapSubShapes1()); anIt1.More(); anIt1.Next())
+#else
+  for (BRepExtrema_OverlappedSubShapes::Iterator anIt1 (aBSP.OverlapSubShapes1()); anIt1.More(); anIt1.Next())
+#endif
+  {
+    const TopoDS_Shape& aS1 = aBSP.GetSubShape1(anIt1.Key());
+    theIntersections1->Append(anIndices1.FindIndex(aS1));
+  }
+  
+#if OCC_VERSION_LARGE > 0x06090000
+  for (BRepExtrema_MapOfIntegerPackedMapOfInteger::Iterator anIt2 (aBSP.OverlapSubShapes2()); anIt2.More(); anIt2.Next())
+#else
+  for (BRepExtrema_OverlappedSubShapes::Iterator anIt2 (aBSP.OverlapSubShapes2()); anIt2.More(); anIt2.Next())
+#endif
+  {
+    const TopoDS_Shape& aS2 = aBSP.GetSubShape2(anIt2.Key());
+    theIntersections2->Append(anIndices2.FindIndex(aS2));
+  }
+
+  isGood = !theIntersections1->IsEmpty() && !theIntersections1->IsEmpty();
+
+  if (aBSP.IsDone())
+    SetErrorCode(OK);
+
   return isGood;
 }
 
@@ -1654,9 +1844,11 @@ TCollection_AsciiString GEOMImpl_IMeasureOperations::WhatIs (Handle(GEOM_Object)
 
   try {
     OCC_CATCH_SIGNALS;
-    int iType, nbTypes [TopAbs_SHAPE];
-    for (iType = 0; iType < TopAbs_SHAPE; ++iType)
+    int iType, nbTypes [TopAbs_SHAPE], nbFlatType [TopAbs_SHAPE];
+    for (iType = 0; iType < TopAbs_SHAPE; ++iType) {
       nbTypes[iType] = 0;
+      nbFlatType[iType] = 0;
+    }
     nbTypes[aShape.ShapeType()]++;
 
     TopTools_MapOfShape aMapOfShape;
@@ -1666,12 +1858,16 @@ TCollection_AsciiString GEOMImpl_IMeasureOperations::WhatIs (Handle(GEOM_Object)
 
     TopTools_ListIteratorOfListOfShape itL (aListOfShape);
     for (; itL.More(); itL.Next()) {
-      TopoDS_Iterator it (itL.Value());
+      TopoDS_Shape sp = itL.Value();
+      TopoDS_Iterator it (sp);
       for (; it.More(); it.Next()) {
         TopoDS_Shape s = it.Value();
         if (aMapOfShape.Add(s)) {
           aListOfShape.Append(s);
           nbTypes[s.ShapeType()]++;
+          if ((sp.ShapeType() == TopAbs_COMPOUND) || (sp.ShapeType() == TopAbs_COMPSOLID)) {
+           nbFlatType[s.ShapeType()]++;
+          }
         }
       }
     }
@@ -1684,7 +1880,23 @@ TCollection_AsciiString GEOMImpl_IMeasureOperations::WhatIs (Handle(GEOM_Object)
     Astr = Astr + " SOLID : " + TCollection_AsciiString(nbTypes[TopAbs_SOLID]) + "\n";
     Astr = Astr + " COMPSOLID : " + TCollection_AsciiString(nbTypes[TopAbs_COMPSOLID]) + "\n";
     Astr = Astr + " COMPOUND : " + TCollection_AsciiString(nbTypes[TopAbs_COMPOUND]) + "\n";
-    Astr = Astr + " SHAPE : " + TCollection_AsciiString(aMapOfShape.Extent());
+    Astr = Astr + " SHAPE : " + TCollection_AsciiString(aMapOfShape.Extent()) + "\n";
+
+    if ((aShape.ShapeType() == TopAbs_COMPOUND) || (aShape.ShapeType() == TopAbs_COMPSOLID)){
+      Astr = Astr + " --------------------- \n Flat content : \n";
+      if (nbFlatType[TopAbs_VERTEX] > 0)
+       Astr = Astr + " VERTEX : " + TCollection_AsciiString(nbFlatType[TopAbs_VERTEX]) + "\n";
+      if (nbFlatType[TopAbs_EDGE] > 0)
+       Astr = Astr + " EDGE : " + TCollection_AsciiString(nbFlatType[TopAbs_EDGE]) + "\n";
+      if (nbFlatType[TopAbs_WIRE] > 0)
+       Astr = Astr + " WIRE : " + TCollection_AsciiString(nbFlatType[TopAbs_WIRE]) + "\n";
+      if (nbFlatType[TopAbs_FACE] > 0)
+       Astr = Astr + " FACE : " + TCollection_AsciiString(nbFlatType[TopAbs_FACE]) + "\n";
+      if (nbFlatType[TopAbs_SHELL] > 0)
+       Astr = Astr + " SHELL : " + TCollection_AsciiString(nbFlatType[TopAbs_SHELL]) + "\n";
+      if (nbFlatType[TopAbs_SOLID] > 0)
+       Astr = Astr + " SOLID : " + TCollection_AsciiString(nbFlatType[TopAbs_SOLID]) + "\n";
+    }
   }
   catch (Standard_Failure) {
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
index 86d0a9c7b2b83125f67acb9e36dda8658b4c5ab4..72329c18d868bcfc8e41267517e30cabaaa6c06f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -80,11 +80,27 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
     SK_SEGMENT,      // segment
     SK_EDGE,         // other edge
     // VERTEX
-    SK_VERTEX,
+    SK_VERTEX,       // vertex
     // ADVANCED shapes
+    SK_LCS,          // local coordinate system
+    // (other advanced shapes)
     SK_ADVANCED,     // all advanced shapes (temporary implementation)
   };
 
+  /**
+   * This enumeration represents the level of checking shape on
+   * self-interference. It defines which interferferences will be checked.
+   */
+  enum SICheckLevel
+  {
+    SI_V_V = 0, // only V/V interferences
+    SI_V_E,     // V/V and V/E interferences
+    SI_E_E,     // V/V, V/E and E/E interferences
+    SI_V_F,     // V/V, V/E, E/E and V/F interferences
+    SI_E_F,     // V/V, V/E, E/E, V/F and E/F interferences
+    SI_ALL      // all interferences
+  };
+
   Standard_EXPORT ShapeKind KindOfShape (Handle(GEOM_Object) theShape,
                                          Handle(TColStd_HSequenceOfInteger)& theIntegers,
                                          Handle(TColStd_HSequenceOfReal)&    theDoubles);
@@ -141,7 +157,18 @@ class GEOMImpl_IMeasureOperations : public GEOM_IOperations {
                                    const std::list<ShapeError> &theErrors);
 
   Standard_EXPORT bool CheckSelfIntersections (Handle(GEOM_Object) theShape,
+                                               const SICheckLevel  theCheckLevel,
                                                Handle(TColStd_HSequenceOfInteger)& theIntersections);
+  
+  Standard_EXPORT bool CheckSelfIntersectionsFast (Handle(GEOM_Object) theShape,
+                                                  float  deflection, 
+                                                  double tolerance,
+                                                  Handle(TColStd_HSequenceOfInteger)& theIntersections);
+  
+  Standard_EXPORT bool FastIntersect (Handle(GEOM_Object) theShape1, Handle(GEOM_Object) theShape2,
+                                      double tolerance, float deflection,
+                                      Handle(TColStd_HSequenceOfInteger)& theIntersections1,
+                                      Handle(TColStd_HSequenceOfInteger)& theIntersections2);
 
   Standard_EXPORT TCollection_AsciiString IsGoodForSolid (Handle(GEOM_Object) theShape);
 
index fe1137b6653e923ac47299b7db9669c935162e0e..4abd356456c817d64161dbd1a97786841da151ac 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index df4ebb84077ff2149e4ae714d2e648c95bc7e3f7..82c8bc5fee319e6cd60c20128588dd7c0714d209 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 //NOTE: This is an intreface to a function for the Offset creation.
 //
 #include "GEOM_Function.hxx"
+#include <TColStd_HArray1OfInteger.hxx>
 
 #define OFF_ARG_SHAPE 1
 #define OFF_ARG_VALUE 2
+#define OFF_ARG_IDS   3
+#define OFF_ARG_PARAM 4
 
 class GEOMImpl_IOffset
 {
@@ -41,6 +44,16 @@ class GEOMImpl_IOffset
 
   double GetValue() { return _func->GetReal(OFF_ARG_VALUE); }
 
+  void SetParam(Standard_Boolean theParam) { _func->SetInteger(OFF_ARG_PARAM, theParam ? 1 : 0); }
+
+  Standard_Boolean GetParam() { return _func->GetInteger(OFF_ARG_PARAM); }
+
+  void SetFaceIDs(const Handle(TColStd_HArray1OfInteger)& theFaceIDs)
+    { _func->SetIntegerArray(OFF_ARG_IDS, theFaceIDs); }
+
+  Handle(TColStd_HArray1OfInteger) GetFaceIDs()
+    { return _func->GetIntegerArray(OFF_ARG_IDS); }
+
  private:
 
   Handle(GEOM_Function) _func;
index 105ff257d647035342149e86ee2b86fea790a0a6..71d18d8db0d8cde103326dfd06230867d84c1f23 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 84eec251d3b4fbad751a9621167a982fc0c96168..3e0892f819baa00b4c7e991c26399213f7ee880a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include "GEOM_Function.hxx"
 
-#define PIPE_ARG_BASE 1
-#define PIPE_ARG_PATH 2
+#include <TColStd_HArray1OfInteger.hxx>
+
+// ---- GEOMImpl_IPipe
+#define PIPE_ARG_BASE          1
+#define PIPE_ARG_PATH          2
+
+// ---- GEOMImpl_IPipeBiNormal
+#define PIPE_ARG_VEC           3
+
+// ---- GEOMImpl_IPipeDiffSect
+#define PIPEDS_LIST_BASES      1
+//#define PIPEDS_ARG_PATH      2
+#define PIPEDS_LIST_LOCATIONS  3
+#define PIPEDS_ARG_WITHCONTACT 4
+#define PIPEDS_ARG_WITHCORRECT 5
+#define PIPEDS_ARG_BY_STEPS    6
+
+// ---- GEOMImpl_IPipeShellSect
+#define PIPEDS_LIST_SUBBASES   6
+
+// ---- Generate groups block (common)
+#define PIPE_GENERATE_GROUPS   7
+#define PIPE_GROUP_DOWN        8
+#define PIPE_GROUP_UP          9
+#define PIPE_GROUP_SIDE1       10
+#define PIPE_GROUP_SIDE2       11
+#define PIPE_GROUP_OTHER       12
+
 
 class GEOMImpl_IPipe
 {
  public:
 
   GEOMImpl_IPipe(Handle(GEOM_Function) theFunction): _func(theFunction) {}
+  virtual ~GEOMImpl_IPipe() {}
 
   void SetBase (Handle(GEOM_Function) theBase) { _func->SetReference(PIPE_ARG_BASE, theBase); }
   void SetPath (Handle(GEOM_Function) thePath) { _func->SetReference(PIPE_ARG_PATH, thePath); }
+  void SetGenerateGroups (int theGenerateGroups)
+  { _func->SetInteger(PIPE_GENERATE_GROUPS, theGenerateGroups); }
+  void SetGroupDown (const Handle(TColStd_HArray1OfInteger) &theGroup)
+  { _func->SetIntegerArray(PIPE_GROUP_DOWN, theGroup); }
+  void SetGroupUp (const Handle(TColStd_HArray1OfInteger) &theGroup)
+  { _func->SetIntegerArray(PIPE_GROUP_UP, theGroup); }
+  void SetGroupSide1 (const Handle(TColStd_HArray1OfInteger) &theGroup)
+  { _func->SetIntegerArray(PIPE_GROUP_SIDE1, theGroup); }
+  void SetGroupSide2 (const Handle(TColStd_HArray1OfInteger) &theGroup)
+  { _func->SetIntegerArray(PIPE_GROUP_SIDE2, theGroup); }
+  void SetGroupOther (const Handle(TColStd_HArray1OfInteger) &theGroup)
+  { _func->SetIntegerArray(PIPE_GROUP_OTHER, theGroup); }
 
   Handle(GEOM_Function) GetBase() { return _func->GetReference(PIPE_ARG_BASE); }
   Handle(GEOM_Function) GetPath() { return _func->GetReference(PIPE_ARG_PATH); }
+  int GetGenerateGroups () { return _func->GetInteger(PIPE_GENERATE_GROUPS); }
+  Handle(TColStd_HArray1OfInteger) GetGroupDown ()
+  { return _func->GetIntegerArray(PIPE_GROUP_DOWN); }
+  Handle(TColStd_HArray1OfInteger) GetGroupUp ()
+  { return _func->GetIntegerArray(PIPE_GROUP_UP); }
+  Handle(TColStd_HArray1OfInteger) GetGroupSide1 ()
+  { return _func->GetIntegerArray(PIPE_GROUP_SIDE1); }
+  Handle(TColStd_HArray1OfInteger) GetGroupSide2 ()
+  { return _func->GetIntegerArray(PIPE_GROUP_SIDE2); }
+  Handle(TColStd_HArray1OfInteger) GetGroupOther ()
+  { return _func->GetIntegerArray(PIPE_GROUP_OTHER); }
 
  protected:
 
index 0b418e1688c6cbb37e935726051206ef9fdb8915..e6b154c164cf99a4c7c9a4082d4b5f883dfbcf58 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #ifndef _GEOMImpl_IPIPEBINORMAL_HXX_
 #define _GEOMImpl_IPIPEBINORMAL_HXX_
 
-#include "GEOM_Function.hxx"
 
-#ifndef _GEOMImpl_IPIPE_HXX_
 #include "GEOMImpl_IPipe.hxx"
-#endif
 
-#define PIPE_ARG_BASE 1
-#define PIPE_ARG_PATH 2
-#define PIPE_ARG_VEC  3
+// Position definitions are declared in the base class.
 
 class GEOMImpl_IPipeBiNormal : public GEOMImpl_IPipe
 {
index b912200501b28fa62bafc555da45d3786e43c5fa..ad9b10db32b981c3dd760d50ec20bd514f13bce7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #ifndef _GEOMImpl_IPIPEDIFFSECT_HXX_
 #define _GEOMImpl_IPIPEDIFFSECT_HXX_
 
-#include "GEOM_Function.hxx"
 
-#include <TColStd_HSequenceOfTransient.hxx>
-
-#ifndef _GEOMImpl_IPIPE_HXX_
 #include "GEOMImpl_IPipe.hxx"
-#endif
-
-#define PIPEDS_LIST_BASES 1
-#define PIPEDS_LIST_LOCATIONS 3
-//#define PIPEDS_ARG_PATH 2
-#define PIPEDS_ARG_WITHCONTACT 4
-#define PIPEDS_ARG_WITHCORRECT 5
+#include <TColStd_HSequenceOfTransient.hxx>
 
+// Position definitions are declared in the base class.
 
 class GEOMImpl_IPipeDiffSect : public GEOMImpl_IPipe
 {
@@ -82,6 +73,12 @@ class GEOMImpl_IPipeDiffSect : public GEOMImpl_IPipe
   int GetWithCorrectionMode()
   { return _func->GetInteger(PIPEDS_ARG_WITHCORRECT); }
 
+  void SetIsBySteps (int IsBySteps)
+  { _func->SetInteger(PIPEDS_ARG_BY_STEPS, IsBySteps); }
+
+  int GetIsBySteps()
+  { return _func->GetInteger(PIPEDS_ARG_BY_STEPS); }
+
 };
 
 #endif
index 96982792764299b241164a342e64c5c46168c3a0..06739f005b5534ed5b32b95050f063aeaa6f3d72 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3d2241c114afce0bff68cb8307669586de42b191..f162a0b97d4be8d0d253dc2f4952f88186da628b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #ifndef _GEOMImpl_IPIPESHELLSECT_HXX_
 #define _GEOMImpl_IPIPESHELLSECT_HXX_
 
-#include "GEOM_Function.hxx"
 
-#ifndef _GEOMImpl_IPIPEDIFFSECT_HXX_
 #include "GEOMImpl_IPipeDiffSect.hxx"
-#endif
-
+#include "GEOM_Function.hxx"
 #include <TColStd_HSequenceOfTransient.hxx>
 
-#define PIPEDS_LIST_SUBBASES 6
-
+// Position definitions are declared in the base class GEOMImpl_IPipe.
 
 class GEOMImpl_IPipeShellSect : public GEOMImpl_IPipeDiffSect
 {
index 594823694ce5022ce380084b4b3efc18013f279f..1c73c16acd973352588e798f134dd3c45cd0899e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
old mode 100755 (executable)
new mode 100644 (file)
index baeb551..07f81f0
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -40,7 +40,7 @@
 
 #define ARG_LENGTH 11
 
-//#define ARG_FLAG 12
+#define ARG_USE_ORIENTATION 12
 
 class GEOMImpl_IPoint
 {
@@ -73,12 +73,13 @@ class GEOMImpl_IPoint
   void SetParameter(double theParam) { _func->SetReal(ARG_PARAM, theParam); }
   void SetParameter2(double theParam) { _func->SetReal(ARG_PARAM2, theParam); }
   void SetLength(double theLength) { _func->SetReal(ARG_LENGTH, theLength); }
-  //void SetReversed(bool theReversed)  { _func->SetInteger(ARG_FLAG, theReversed); }
+  void SetTakeOrientationIntoAccount(bool takeOrientationIntoAccount)
+        { _func->SetInteger(ARG_USE_ORIENTATION, takeOrientationIntoAccount); }
 
   double GetParameter() { return _func->GetReal(ARG_PARAM); }
   double GetParameter2() { return _func->GetReal(ARG_PARAM2); }
   double GetLength() { return _func->GetReal(ARG_LENGTH); }
-  //bool   GetReversed() { return _func->GetInteger(ARG_FLAG); }
+  bool   GetTakeOrientationIntoAccount() { return _func->GetInteger(ARG_USE_ORIENTATION); }
 
  private:
 
index d736b30e917ffd993d4a5cb8354a77f68a53323e..08b0b23b14b3ad3827ed2ec7f647bed3b9c83bed 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index eb1bcfdd7287a432801e5593d760e5ffa2429781..d7607119b183cf98274c3f1563df933f95957162 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 302e9f89984092f3a6b42140d4d41d3912850733..2631c162bcb085012fe90f19e99f7fcd62b48ef3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index edd5483fd1eacac82879921b9a7e9e7c9108f1a7..e578731fb3e057a01ef28f0a4aaf7fa15e4b08a0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index a70118ac2eec497f20e2b368a0d5b5ea4f5cc52d..4153cc29fbd50697ff0faf722b09b2b89f7898fb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -38,6 +38,7 @@
 #define PRISM_ARG_FUSE     11
 #define PRISM_ARG_INIT     12
 #define PRISM_ARG_MODE     13
+#define PRISM_ARG_INVERT   14
 
 class GEOMImpl_IPrism
 {
@@ -75,9 +76,11 @@ class GEOMImpl_IPrism
   
   void SetFuseFlag(int theFlag) { _func->SetInteger(PRISM_ARG_FUSE, theFlag); }
 //   void SetMode(GEOMImpl_Mode theMode) { _func->SetInteger(PRISM_ARG_MODE, theMode); }  //TEST
+  void SetInvertFlag(Standard_Boolean theInvert) { _func->SetInteger(PRISM_ARG_INVERT, theInvert ? 1 : 0);}
 
   int  GetFuseFlag()      { return _func->GetInteger(PRISM_ARG_FUSE); }
 //   GEOMImpl_Mode GetMode() { return _func->GetInteger(PRISM_ARG_MODE); }   //TEST
+  Standard_Boolean GetInvertFlag() { return _func->GetInteger(PRISM_ARG_INVERT); }
 
  private:
 
diff --git a/src/GEOMImpl/GEOMImpl_IProjOnCyl.hxx b/src/GEOMImpl/GEOMImpl_IProjOnCyl.hxx
new file mode 100644 (file)
index 0000000..8e0dd2b
--- /dev/null
@@ -0,0 +1,66 @@
+// Copyright (C) 2007-2014  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
+//
+
+//NOTE: This is an interface to a function for the Projection on cylinder creation.
+
+#include "GEOM_Function.hxx"
+
+#define PROJCYL_ARG_SHAPE            1
+#define PROJCYL_ARG_RADIUS           2
+#define PROJCYL_ARG_START_ANGLE      3
+#define PROJCYL_ARG_ANGLE_LENGTH     4
+#define PROJCYL_ARG_ANGLE_ROTATION   5
+
+class GEOMImpl_IProjOnCyl
+{
+
+public:
+
+  GEOMImpl_IProjOnCyl(Handle(GEOM_Function) theFunction): _func(theFunction) {}
+
+  void SetShape         (const Handle(GEOM_Function) &theShape)
+          { _func->SetReference(PROJCYL_ARG_SHAPE,     theShape); }
+  void SetRadius        (const Standard_Real          theRadius)
+          { _func->SetReal(PROJCYL_ARG_RADIUS,         theRadius); }
+  void SetStartAngle    (const Standard_Real          theStartAngle)
+          { _func->SetReal(PROJCYL_ARG_START_ANGLE,    theStartAngle); }
+  void SetAngleLength   (const Standard_Real          theAngleLength)
+          { _func->SetReal(PROJCYL_ARG_ANGLE_LENGTH,   theAngleLength); }
+  void SetAngleRotation (const Standard_Real          theAngleLength)
+          { _func->SetReal(PROJCYL_ARG_ANGLE_ROTATION, theAngleLength); }
+
+  Handle(GEOM_Function) GetShape()
+          { return _func->GetReference(PROJCYL_ARG_SHAPE); }
+  Standard_Real         GetRadius()
+          { return _func->GetReal(PROJCYL_ARG_RADIUS ); }
+  Standard_Real         GetStartAngle()
+          { return _func->GetReal(PROJCYL_ARG_START_ANGLE ); }
+  Standard_Real         GetAngleLength()
+          { return _func->GetReal(PROJCYL_ARG_ANGLE_LENGTH ); }
+  Standard_Real         GetAngleRotation()
+          { return _func->GetReal(PROJCYL_ARG_ANGLE_ROTATION ); }
+
+ private:
+
+  Handle(GEOM_Function) _func;
+
+};
index a3a9ea0ada7a3ddb814018929930084779c8f0fa..ea9490e71845cc1fe57cf20f36ae885d5b4cc705 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3402022e150ab459f09baced92c18cd4db5eddb4..8c7d302c5ed69818041fe8c31ccfa497e3b035d0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 614b2fa01be4d679695483e386a9a830a9871b43..696cfbb10a9843ed056ad70e5be1b010c1c412a3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e60f31e2a6cdb32557956fed92a7d68b584ca9e9..2e6d0e0d4bbc034a4834e36bc220580a3fb5f8e0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
diff --git a/src/GEOMImpl/GEOMImpl_IShapeExtend.hxx b/src/GEOMImpl/GEOMImpl_IShapeExtend.hxx
new file mode 100644 (file)
index 0000000..f2f2c7a
--- /dev/null
@@ -0,0 +1,72 @@
+// 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
+//
+
+//NOTE: This is an intreface to a function for the extended shape creation.
+//
+#include "GEOM_Function.hxx"
+
+#define SHAPE_EXTEND_SHAPE  1
+#define SHAPE_EXTEND_UMIN   2
+#define SHAPE_EXTEND_UMAX   3
+#define SHAPE_EXTEND_VMIN   4
+#define SHAPE_EXTEND_VMAX   5
+
+class GEOMImpl_IShapeExtend
+{
+ public:
+
+  GEOMImpl_IShapeExtend(Handle(GEOM_Function) theFunction): _func(theFunction) {}
+
+  void SetShape(Handle(GEOM_Function) theShape)
+  { _func->SetReference(SHAPE_EXTEND_SHAPE, theShape); }
+
+  Handle(GEOM_Function) GetShape()
+  { return _func->GetReference(SHAPE_EXTEND_SHAPE); }
+
+  void SetUMin(const Standard_Real theUMin)
+  { _func->SetReal(SHAPE_EXTEND_UMIN, theUMin); }
+
+  double GetUMin()
+  { return _func->GetReal(SHAPE_EXTEND_UMIN); }
+
+  void SetUMax(const Standard_Real theUMax)
+  { _func->SetReal(SHAPE_EXTEND_UMAX, theUMax); }
+
+  double GetUMax()
+  { return _func->GetReal(SHAPE_EXTEND_UMAX); }
+
+  void SetVMin(const Standard_Real theVMin)
+  { _func->SetReal(SHAPE_EXTEND_VMIN, theVMin); }
+
+  double GetVMin()
+  { return _func->GetReal(SHAPE_EXTEND_VMIN); }
+
+  void SetVMax(const Standard_Real theVMax)
+  { _func->SetReal(SHAPE_EXTEND_VMAX, theVMax); }
+
+  double GetVMax()
+  { return _func->GetReal(SHAPE_EXTEND_VMAX); }
+
+ private:
+
+  Handle(GEOM_Function) _func;
+};
index a43024b78dfbd70b83d6421b648e99d18e506836..144eae0950caa4cc75867eb65128818095a272bf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -36,6 +36,7 @@ class GEOMImpl_IShapes
     SHAPE_ARG_SHAPES    = 1, // for Wire, Shell, Solid and Compound
     SHAPE_ARG_BASE      = 2, // for Face, Solid and Sub-shape
     SHAPE_ARG_PLANAR    = 3, // for Face
+    SHAPE_ARG_INTERSECT = 3, // for Solid From Connected Faces (NOTE: same value as SHAPE_ARG_PLANAR is used!)
     SHAPE_ARG_SUBTYPE   = 4, // for Sub-shape
     SHAPE_ARG_INDICES   = 5, // for Sub-shape
     SHAPE_ARG_TOLERANCE = 6, // linear tolerance (for Wire, Edge)
@@ -81,6 +82,11 @@ class GEOMImpl_IShapes
 
   Standard_Real GetAngularTolerance() { return _func->GetReal(SHAPE_ARG_ANGLE_TOL); }
 
+  void SetIsIntersect(const Standard_Boolean isIntersect)
+  {_func->SetInteger(SHAPE_ARG_INTERSECT, isIntersect ? 1 : 0);}
+
+  Standard_Boolean GetIsIntersect() { return (_func->GetInteger(SHAPE_ARG_INTERSECT) == 1); }
+
  private:
 
   Handle(GEOM_Function) _func;
index fab086b96478dc14abaa44e28393963fee2c8b3b..65716670c9e393839fade61a8d9ac9b74a4c3655 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -25,7 +25,7 @@
 //  Author    : modified by Lioka RAZAFINDRAZAKA (CEA) 22/06/2007
 //  Project   : SALOME
 
-#include <Standard_Stream.hxx>
+//#include <Standard_Stream.hxx>
 
 #include "GEOMImpl_IShapesOperations.hxx"
 
 #include "GEOMImpl_VectorDriver.hxx"
 #include "GEOMImpl_ShapeDriver.hxx"
 #include "GEOMImpl_GlueDriver.hxx"
+#include "GEOMImpl_FillingDriver.hxx"
 
 #include "GEOMImpl_IVector.hxx"
 #include "GEOMImpl_IShapes.hxx"
+#include "GEOMImpl_IShapeExtend.hxx"
 #include "GEOMImpl_IGlue.hxx"
+#include "GEOMImpl_IFilling.hxx"
 
 #include "GEOMImpl_Block6Explorer.hxx"
 #include "GEOMImpl_IHealingOperations.hxx"
 #include "GEOMUtils.hxx"
 
 #include "GEOMAlgo_ClsfBox.hxx"
+#include "GEOMAlgo_ClsfQuad.hxx"
 #include "GEOMAlgo_ClsfSolid.hxx"
-#include "GEOMAlgo_CoupleOfShapes.hxx"
-#include "GEOMAlgo_FinderShapeOn1.hxx"
-#include "GEOMAlgo_FinderShapeOnQuad.hxx"
+#include "GEOMAlgo_ClsfSurf.hxx"
 #include "GEOMAlgo_FinderShapeOn2.hxx"
 #include "GEOMAlgo_GetInPlace.hxx"
+#include "GEOMAlgo_GetInPlaceAPI.hxx"
 #include "GEOMAlgo_GlueDetector.hxx"
-#include "GEOMAlgo_ListIteratorOfListOfCoupleOfShapes.hxx"
-#include "GEOMAlgo_ListOfCoupleOfShapes.hxx"
-
-#include <Basics_OCCTVersion.hxx>
 
 #include <utilities.h>
-#include <OpUtil.hxx>
-#include <Utils_ExceptHandlers.hxx>
-
-#include <TFunction_DriverTable.hxx>
-#include <TFunction_Driver.hxx>
-#include <TFunction_Logbook.hxx>
-#include <TDataStd_Integer.hxx>
-#include <TDataStd_IntegerArray.hxx>
-#include <TDataStd_ListIteratorOfListOfExtendedString.hxx>
-#include <TDF_Tool.hxx>
-
-#include <BRepExtrema_ExtCF.hxx>
-#include <BRepExtrema_DistShapeShape.hxx>
 
-#include <BRep_Tool.hxx>
-#include <BRep_Builder.hxx>
-#include <BRepTools.hxx>
-#include <BRepGProp.hxx>
 #include <BRepAdaptor_Curve.hxx>
 #include <BRepAdaptor_Surface.hxx>
-#include <BRepBndLib.hxx>
-#include <BRepMesh_IncrementalMesh.hxx>
-
-#include <TopAbs.hxx>
+#include <BRepTools.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+#include <GeomLib_Tool.hxx>
+#include <Geom_CylindricalSurface.hxx>
+#include <Geom_Plane.hxx>
+#include <Geom_SphericalSurface.hxx>
+#include <Geom_Surface.hxx>
+#include <Geom_TrimmedCurve.hxx>
+#include <Precision.hxx>
+#include <TColStd_HArray1OfInteger.hxx>
+#include <TDF_Tool.hxx>
+#include <TDataStd_Integer.hxx>
+#include <TDataStd_ListIteratorOfListOfExtendedString.hxx>
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
-#include <TopLoc_Location.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Solid.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopoDS_Iterator.hxx>
-#include <TopTools_Array1OfShape.hxx>
 #include <TopTools_DataMapIteratorOfDataMapOfShapeListOfShape.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <TopTools_MapOfShape.hxx>
 #include <TopTools_MapOfOrientedShape.hxx>
-
-#include <Geom_Surface.hxx>
-#include <Geom_Plane.hxx>
-#include <Geom_SphericalSurface.hxx>
-#include <Geom_CylindricalSurface.hxx>
-#include <GeomAdaptor_Surface.hxx>
-
-#include <GeomLib_Tool.hxx>
-#include <Geom2d_Curve.hxx>
-
-#include <Bnd_Box.hxx>
-#include <GProp_GProps.hxx>
-#include <TColStd_Array1OfReal.hxx>
-#include <TColStd_HArray1OfInteger.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TColStd_ListOfInteger.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopTools_SequenceOfShape.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopoDS_Edge.hxx>
+#include <TopoDS_Face.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <TopoDS_Shape.hxx>
+#include <TopoDS_Solid.hxx>
+#include <TopoDS_Vertex.hxx>
 #include <gp_Cylinder.hxx>
-#include <gp_Lin.hxx>
 #include <gp_Pnt.hxx>
 
 #include <vector>
-#include <algorithm>
-#include <functional>
 
-#include <Standard_NullObject.hxx>
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
-// Includes added for GetInPlace algorithm improvement
+namespace {
+
+  void AddFlatSubShapes(const TopoDS_Shape& S, TopTools_ListOfShape& L, TopTools_MapOfShape& M)
+  {
+    if (S.ShapeType() != TopAbs_COMPOUND) {
+      L.Append(S);
+    }
+    else {
+      TopoDS_Iterator It(S, Standard_True, Standard_True);
+      for (; It.More(); It.Next()) {
+       TopoDS_Shape SS = It.Value();
+       if (M.Add(SS))
+         AddFlatSubShapes(SS, L, M);
+      }
+    }
+  }
+}
 
-#include <GEOMImpl_MeasureDriver.hxx>
-#include <GEOMImpl_IMeasure.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
+namespace
+{
+  const double MAX_TOLERANCE = 1.e-7;
+
+  /**
+   * \brief Returns the vertex from theWhere shape that is coincident with
+   * theVertex.
+   *
+   * \param theWhere the shape where the coinsident vertex is searched.
+   * \param theVertex the vertex to be searched.
+   * \return the coincident vertex if it is found. Otherwise null object.
+   */
+  static TopoDS_Vertex getSameVertex(const TopoDS_Shape  &theWhere,
+                                     const TopoDS_Vertex &theVertex)
+  {
+    TopoDS_Vertex       aResult;
+    gp_Pnt              aPoint = BRep_Tool::Pnt(theVertex);
+    TopExp_Explorer     anExp(theWhere, TopAbs_VERTEX);
+    TopTools_MapOfShape aMap;
+    
+    for(; anExp.More(); anExp.Next()) {
+      const TopoDS_Shape &aLocalShape = anExp.Current();
 
-#include <BRepClass_FaceClassifier.hxx>
-#include <BRepClass3d_SolidClassifier.hxx>
-#include <Precision.hxx>
+      if(!aMap.Add(aLocalShape)) {
+        continue;
+      }
+
+      TopoDS_Vertex aVertex = TopoDS::Vertex(aLocalShape);
+      gp_Pnt        aPoint2 = BRep_Tool::Pnt(aVertex);
+
+      if(aPoint.Distance(aPoint2) <= MAX_TOLERANCE) {
+        aResult = aVertex;
+        break;
+      }
+    }
+
+    return aResult;
+  }
+} // end of namespace
 
 //=============================================================================
 /*!
@@ -556,6 +575,182 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWires
   return aShape;
 }
 
+//=============================================================================
+/*!
+ *  MakeFaceFromSurface
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceFromSurface
+                                              (Handle(GEOM_Object) theFace,
+                                               Handle(GEOM_Object) theWire)
+{
+  SetErrorCode(KO);
+
+  //Add a new object
+  Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+
+  //Add a new function
+  Handle(GEOM_Function) aFunction =
+    aShape->AddFunction(GEOMImpl_ShapeDriver::GetID(), FACE_FROM_SURFACE);
+
+  if (aFunction.IsNull()) {
+    return NULL;
+  }
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) {
+    return NULL;
+  }
+
+  GEOMImpl_IShapes aCI (aFunction);
+  Handle(TColStd_HSequenceOfTransient) aShapesSeq =
+    new TColStd_HSequenceOfTransient;
+  Handle(GEOM_Function) aRefFace = theFace->GetLastFunction();
+  Handle(GEOM_Function) aRefWire = theWire->GetLastFunction();
+
+  if (aRefFace.IsNull()) {
+    SetErrorCode("NULL argument face for the face construction");
+    return NULL;
+  }
+
+  if (aRefWire.IsNull()) {
+    SetErrorCode("NULL argument wire for the face construction");
+    return NULL;
+  }
+
+  aShapesSeq->Append(aRefFace);
+  aShapesSeq->Append(aRefWire);
+
+  aCI.SetShapes(aShapesSeq);
+
+  //Compute the face
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Shape driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump (aFunction) << aShape
+    << " = geompy.MakeFaceFromSurface(" << theFace << ", " << theWire << ")";
+
+  SetErrorCode(OK);
+
+  return aShape;
+}
+
+//=============================================================================
+/*!
+ *  MakeFaceWithConstraints
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeFaceWithConstraints
+                             (std::list<Handle(GEOM_Object)> theConstraints)
+{
+  SetErrorCode(KO);
+
+  //Add a new object
+  Handle(GEOM_Object) aShape = GetEngine()->AddObject(GetDocID(), GEOM_FILLING);
+
+  //Add a new function
+  Handle(GEOM_Function) aFunction =
+    aShape->AddFunction(GEOMImpl_FillingDriver::GetID(), FILLING_ON_CONSTRAINTS);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_FillingDriver::GetID()) return NULL;
+
+  GEOMImpl_IFilling aCI (aFunction);
+  Handle(TColStd_HSequenceOfTransient) aConstraints = new TColStd_HSequenceOfTransient;
+
+  // Shapes
+  std::list<Handle(GEOM_Object)>::iterator it = theConstraints.begin();
+  while (it != theConstraints.end()) {
+    Handle(GEOM_Object) anObject = (*it);
+    if ( anObject.IsNull() || anObject->GetValue().ShapeType() != TopAbs_EDGE ) {
+      SetErrorCode("NULL argument edge for the face construction");
+      return NULL;
+    }
+    Handle(GEOM_Function) aRefSh = anObject->GetLastFunction();
+    aConstraints->Append(aRefSh);
+    it++;
+    if ( it != theConstraints.end() ) {
+      Handle(GEOM_Object) aFace = (*it);
+      if ( aFace.IsNull() ) {
+        // null constraint face - it is a valid case
+        it++;
+        continue;
+      }
+      if ( aFace->GetValue().ShapeType() != TopAbs_FACE )
+        // constraint face can be omitted - it is a valid case
+        continue;
+      // Keep the old error code as IsSubShapeBelongsTo changes it.
+      TCollection_AsciiString anOldCode = GetErrorCode();
+
+      if ( IsSubShapeBelongsTo( anObject, 0, aFace, 0 ) ) {
+        // valid constraint
+        SetErrorCode(anOldCode);
+        aRefSh = aFace->GetLastFunction();
+        aConstraints->Append(aRefSh);
+        it++;
+      }
+      else {
+        // bad constraint
+        SetErrorCode("Face is NULL or not connected to the Edge");
+        return NULL;
+      }
+    }
+  }
+  aCI.SetShapes( aConstraints );
+
+  //Compute the shape
+  Standard_Boolean isWarning = Standard_False;
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Shape driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    // to provide warning
+    if (!aFunction->GetValue().IsNull()) {
+      isWarning = Standard_True;
+    } else {
+      return NULL;
+    }
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump pd (aFunction);
+  pd << aShape << " = geompy.MakeFaceWithConstraints([";
+
+  // Constraints
+  it = theConstraints.begin();
+  if (it != theConstraints.end() ) {
+    pd << (*it++);
+    while (it != theConstraints.end()) {
+      Handle(GEOM_Object) anObject = (*it++);
+      if( !anObject.IsNull() )
+        pd << ", " << anObject;
+    }
+  }
+  pd << "])";
+
+  // to provide warning
+  if (!isWarning) SetErrorCode(OK);
+  return aShape;
+}
+
 //=============================================================================
 /*!
  *  MakeShell
@@ -661,19 +856,94 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeShape
   return aShape;
 }
 
+//=============================================================================
+/*!
+ *  MakeSolidFromConnectedFaces
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSolidFromConnectedFaces
+                             (std::list<Handle(GEOM_Object)> theFacesOrShells,
+                              const Standard_Boolean isIntersect)
+{
+  SetErrorCode(KO);
+
+  //Add a new object
+  Handle(GEOM_Object) aSolid = GetEngine()->AddObject(GetDocID(), GEOM_SOLID);
+
+  //Add a new function
+  Handle(GEOM_Function) aFunction =
+    aSolid->AddFunction(GEOMImpl_ShapeDriver::GetID(), SOLID_FACES);
+  if (aFunction.IsNull()) return NULL;
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) return NULL;
+
+  GEOMImpl_IShapes aCI (aFunction);
+
+  Handle(TColStd_HSequenceOfTransient) aShapesSeq = new TColStd_HSequenceOfTransient;
+
+  // Shapes
+  std::list<Handle(GEOM_Object)>::iterator it = theFacesOrShells.begin();
+  for (; it != theFacesOrShells.end(); it++) {
+    Handle(GEOM_Function) aRefSh = (*it)->GetLastFunction();
+    if (aRefSh.IsNull()) {
+      SetErrorCode("NULL argument shape for the shape construction");
+      return NULL;
+    }
+    aShapesSeq->Append(aRefSh);
+  }
+  aCI.SetShapes(aShapesSeq);
+  aCI.SetIsIntersect(isIntersect);
+
+  //Compute the shape
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Shape driver failed");
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump pd (aFunction);
+  pd << aSolid << " = geompy.MakeSolidFromConnectedFaces([";
+
+  // Shapes
+  it = theFacesOrShells.begin();
+  if (it != theFacesOrShells.end()) {
+    pd << (*it++);
+    while (it != theFacesOrShells.end()) {
+      pd << ", " << (*it++);
+    }
+  }
+  pd << "]," << (isIntersect ? "True" : "False") << ")";
+
+  SetErrorCode(OK);
+  return aSolid;
+}
+
 //=============================================================================
 /*!
  *  MakeGlueFaces
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFaces
-                                                (Handle(GEOM_Object) theShape,
-                                                 const Standard_Real theTolerance,
-                                                 const Standard_Boolean doKeepNonSolids)
+Handle(GEOM_Object)
+GEOMImpl_IShapesOperations::MakeGlueFaces (std::list< Handle(GEOM_Object) >& theShapes,
+                                           const Standard_Real               theTolerance,
+                                           const Standard_Boolean            doKeepNonSolids)
 {
   SetErrorCode(KO);
 
-  if (theShape.IsNull()) return NULL;
+  Handle(TColStd_HSequenceOfTransient) objects = GEOM_Object::GetLastFunctions( theShapes );
+  if ( objects.IsNull() || objects->IsEmpty() ) {
+    SetErrorCode("NULL argument shape");
+    return NULL;
+  }
 
   //Add a new Glued object
   Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
@@ -688,10 +958,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFaces
 
   GEOMImpl_IGlue aCI (aFunction);
 
-  Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
-  if (aRefShape.IsNull()) return NULL;
-
-  aCI.SetBase(aRefShape);
+  aCI.SetBase( objects );
   aCI.SetTolerance(theTolerance);
   aCI.SetKeepNonSolids(doKeepNonSolids);
 
@@ -717,7 +984,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFaces
 
   //Make a Python command
   GEOM::TPythonDump(aFunction) << aGlued << " = geompy.MakeGlueFaces("
-    << theShape << ", " << theTolerance << ")";
+    << theShapes << ", " << theTolerance << ")";
 
   // to provide warning
   if (!isWarning) SetErrorCode(OK);
@@ -806,16 +1073,25 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetGlueFaces
  *  MakeGlueFacesByList
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList
-                                                (Handle(GEOM_Object) theShape,
-                                                 const Standard_Real theTolerance,
-                                                 std::list<Handle(GEOM_Object)> theFaces,
-                                                 const Standard_Boolean doKeepNonSolids,
-                                                 const Standard_Boolean doGlueAllEdges)
+Handle(GEOM_Object)
+GEOMImpl_IShapesOperations::MakeGlueFacesByList(std::list< Handle(GEOM_Object) >& theShapes,
+                                                const Standard_Real               theTolerance,
+                                                std::list<Handle(GEOM_Object)> &  theFaces,
+                                                const Standard_Boolean            doKeepNonSolids,
+                                                const Standard_Boolean            doGlueAllEdges)
 {
   SetErrorCode(KO);
 
-  if (theShape.IsNull()) return NULL;
+  Handle(TColStd_HSequenceOfTransient) objects = GEOM_Object::GetLastFunctions( theShapes );
+  if ( objects.IsNull() || objects->IsEmpty() ) {
+    SetErrorCode("NULL argument shape");
+    return NULL;
+  }
+  Handle(TColStd_HSequenceOfTransient) aFaces = GEOM_Object::GetLastFunctions( theFaces );
+  if ( aFaces.IsNull() ) {
+    SetErrorCode("NULL argument shape for the shape construction");
+    return NULL;
+  }
 
   //Add a new Glued object
   Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
@@ -830,25 +1106,11 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList
 
   GEOMImpl_IGlue aCI (aFunction);
 
-  Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
-  if (aRefShape.IsNull()) return NULL;
-
-  aCI.SetBase(aRefShape);
+  aCI.SetBase( objects );
   aCI.SetTolerance(theTolerance);
   aCI.SetKeepNonSolids(doKeepNonSolids);
   aCI.SetGlueAllEdges(doGlueAllEdges);
-
-  Handle(TColStd_HSequenceOfTransient) aFaces = new TColStd_HSequenceOfTransient;
-  std::list<Handle(GEOM_Object)>::iterator it = theFaces.begin();
-  for (; it != theFaces.end(); it++) {
-    Handle(GEOM_Function) aRefSh = (*it)->GetLastFunction();
-    if (aRefSh.IsNull()) {
-      SetErrorCode("NULL argument shape for the shape construction");
-      return NULL;
-    }
-    aFaces->Append(aRefSh);
-  }
-  aCI.SetFaces(aFaces);
+  aCI.SetFaces(aFaces);
 
   //Compute the sub-shape value
   Standard_Boolean isWarning = Standard_False;
@@ -874,16 +1136,8 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList
 
   GEOM::TPythonDump pd(aFunction);
   pd << aGlued << " = geompy.MakeGlueFacesByList("
-     << theShape << ", " << theTolerance << ", [";
-  // Faces
-  it = theFaces.begin();
-  if (it != theFaces.end()) {
-    pd << (*it++);
-    while (it != theFaces.end()) {
-      pd << ", " << (*it++);
-    }
-  }
-  pd << "], " << (bool)doKeepNonSolids << ", " << (bool)doGlueAllEdges << ")";
+     << theShapes << ", " << theTolerance << ", " << theFaces << ", "
+     << (bool)doKeepNonSolids << ", " << (bool)doGlueAllEdges << ")";
 
   // to provide warning
   if (!isWarning) SetErrorCode(OK);
@@ -895,13 +1149,17 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueFacesByList
  *  MakeGlueEdges
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueEdges
-                                                (Handle(GEOM_Object) theShape,
-                                                 const Standard_Real theTolerance)
+Handle(GEOM_Object)
+GEOMImpl_IShapesOperations::MakeGlueEdges (std::list< Handle(GEOM_Object) >& theShapes,
+                                           const Standard_Real               theTolerance)
 {
   SetErrorCode(KO);
 
-  if (theShape.IsNull()) return NULL;
+  Handle(TColStd_HSequenceOfTransient) objects = GEOM_Object::GetLastFunctions( theShapes );
+  if ( objects.IsNull() || objects->IsEmpty() ) {
+    SetErrorCode("NULL argument shape");
+    return NULL;
+  }
 
   //Add a new Glued object
   Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
@@ -916,10 +1174,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueEdges
 
   GEOMImpl_IGlue aCI (aFunction);
 
-  Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
-  if (aRefShape.IsNull()) return NULL;
-
-  aCI.SetBase(aRefShape);
+  aCI.SetBase( objects );
   aCI.SetTolerance(theTolerance);
   aCI.SetKeepNonSolids(true);
 
@@ -945,7 +1200,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueEdges
 
   //Make a Python command
   GEOM::TPythonDump(aFunction) << aGlued << " = geompy.MakeGlueEdges("
-    << theShape << ", " << theTolerance << ")";
+    << theShapes << ", " << theTolerance << ")";
 
   // to provide warning
   if (!isWarning) SetErrorCode(OK);
@@ -957,16 +1212,36 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueEdges
  *  GetGlueShapes
  */
 //=============================================================================
-Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetGlueShapes
-                                                (Handle(GEOM_Object)    theShape,
-                                                 const Standard_Real    theTolerance,
-                                                 const TopAbs_ShapeEnum theType)
+Handle(TColStd_HSequenceOfTransient)
+GEOMImpl_IShapesOperations::GetGlueShapes (std::list< Handle(GEOM_Object) >& theShapes,
+                                           const Standard_Real               theTolerance,
+                                           const TopAbs_ShapeEnum            theType)
 {
   SetErrorCode(KO);
 
-  if (theShape.IsNull()) return NULL;
-  TopoDS_Shape aShape = theShape->GetValue();
-  if (aShape.IsNull()) return NULL;
+  TopoDS_Shape aShape;
+  TopTools_SequenceOfShape shapes;
+  std::list< Handle(GEOM_Object) >::iterator s = theShapes.begin();
+  Handle(GEOM_Object) lastCreatedGO;
+  for ( ; s != theShapes.end(); ++s )
+  {
+    Handle(GEOM_Object) go = *s;
+    if ( go.IsNull() ) return NULL;
+    aShape = go->GetValue();
+    if ( aShape.IsNull() ) return NULL;
+    shapes.Append( aShape );
+    lastCreatedGO = GEOM::GetCreatedLast( lastCreatedGO, go );
+  }
+  if ( shapes.Length() > 1 )
+  {
+    TopoDS_Compound compound;
+    BRep_Builder builder;
+    builder.MakeCompound( compound );
+    for ( int i = 1; i <= shapes.Length(); ++i )
+      builder.Add( compound, shapes( i ) );
+
+    aShape = compound;
+  }
 
   Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
 
@@ -977,9 +1252,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetGlueShapes
   Standard_Integer iErr = aGluer.ErrorStatus();
   if (iErr) return NULL;
 
-  TCollection_AsciiString anAsciiList, anEntry;
-  TopTools_IndexedMapOfShape anIndices;
-  TopExp::MapShapes(aShape, anIndices);
+  std::vector< TopTools_IndexedMapOfShape* > anIndices( shapes.Length(), NULL );
   Handle(TColStd_HArray1OfInteger) anArray;
   Handle(GEOM_Object) anObj;
 
@@ -1006,31 +1279,40 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetGlueShapes
   GEOMUtils::SortShapes(listOnePerSet, Standard_False);
 
   TopTools_ListIteratorOfListOfShape aListIt (listOnePerSet);
-  for (; aListIt.More(); aListIt.Next()) {
+  for (; aListIt.More(); aListIt.Next())
+  {
     TopoDS_Shape aValue = aListIt.Value();
-    anArray = new TColStd_HArray1OfInteger(1,1);
-    anArray->SetValue(1, anIndices.FindIndex(aValue));
-    anObj = GetEngine()->AddSubShape(theShape, anArray);
-    if (!anObj.IsNull()) {
-      aSeq->Append(anObj);
-
-      // for python command
-      TDF_Tool::Entry(anObj->GetEntry(), anEntry);
-      anAsciiList += anEntry;
-      anAsciiList += ",";
+    // find a shape to add aValue as a sub-shape
+    anObj.Nullify();
+    s = theShapes.begin();
+    for ( int i = 0; i < shapes.Length(); ++i, ++s )
+    {
+      Handle(GEOM_Object) object = *s;
+      if ( !anIndices[i] ) {
+        anIndices[i] = new TopTools_IndexedMapOfShape;
+        TopExp::MapShapes( object->GetValue(), *anIndices[i]);
+      }
+      if (int index = anIndices[i]->FindIndex( aValue )) {
+        anArray = new TColStd_HArray1OfInteger(1,1);
+        anArray->SetValue(1, index);
+        anObj = GetEngine()->AddSubShape( object, anArray);
+        break;
+      }
     }
+    if (!anObj.IsNull())
+      aSeq->Append(anObj);
   }
+  for ( size_t i = 0 ; i < anIndices.size(); ++i )
+    delete anIndices[i];
 
   // Make a Python command
-  if (anAsciiList.Length() > 0) {
-    anAsciiList.Trunc(anAsciiList.Length() - 1);
-    Handle(GEOM_Function) aFunction = theShape->GetLastFunction();
+  if ( aSeq->Length() > 0)
+  {
+    Handle(GEOM_Function) aFunction = lastCreatedGO->GetLastFunction();
     GEOM::TPythonDump pd (aFunction, /*append=*/true);
-    pd << "[" << anAsciiList.ToCString();
-    if (theType == TopAbs_FACE)
-      pd << "] = geompy.GetGlueFaces(" << theShape << ", " << theTolerance << ")";
-    else if (theType == TopAbs_EDGE)
-      pd << "] = geompy.GetGlueEdges(" << theShape << ", " << theTolerance << ")";
+    pd << aSeq
+       << " = geompy." << (theType == TopAbs_FACE ? "GetGlueFaces" : "GetGlueEdges" )
+       << "( " << theShapes << ", " << theTolerance << ")";
   }
 
   SetErrorCode(OK);
@@ -1043,15 +1325,23 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetGlueShapes
  *  MakeGlueEdgesByList
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueEdgesByList
-                                                (Handle(GEOM_Object) theShape,
-                                                 const Standard_Real theTolerance,
-                                                 std::list<Handle(GEOM_Object)> theEdges)
+Handle(GEOM_Object)
+GEOMImpl_IShapesOperations::MakeGlueEdgesByList (std::list< Handle(GEOM_Object) >& theShapes,
+                                                 const Standard_Real               theTolerance,
+                                                 std::list<Handle(GEOM_Object)>&   theEdges)
 {
   SetErrorCode(KO);
 
-  if (theShape.IsNull()) return NULL;
-
+  Handle(TColStd_HSequenceOfTransient) objects = GEOM_Object::GetLastFunctions( theShapes );
+  if ( objects.IsNull() || objects->IsEmpty() ) {
+    SetErrorCode("NULL argument shape");
+    return NULL;
+  }
+  Handle(TColStd_HSequenceOfTransient) anEdges = GEOM_Object::GetLastFunctions( theEdges );
+  if ( anEdges.IsNull() ) {
+    SetErrorCode("NULL argument shape for the shape construction");
+    return NULL;
+  }
   //Add a new Glued object
   Handle(GEOM_Object) aGlued = GetEngine()->AddObject(GetDocID(), GEOM_GLUED);
 
@@ -1065,23 +1355,9 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueEdgesByList
 
   GEOMImpl_IGlue aCI (aFunction);
 
-  Handle(GEOM_Function) aRefShape = theShape->GetLastFunction();
-  if (aRefShape.IsNull()) return NULL;
-
-  aCI.SetBase(aRefShape);
+  aCI.SetBase( objects );
   aCI.SetTolerance(theTolerance);
   aCI.SetKeepNonSolids(true);
-
-  Handle(TColStd_HSequenceOfTransient) anEdges = new TColStd_HSequenceOfTransient;
-  std::list<Handle(GEOM_Object)>::iterator it = theEdges.begin();
-  for (; it != theEdges.end(); it++) {
-    Handle(GEOM_Function) aRefSh = (*it)->GetLastFunction();
-    if (aRefSh.IsNull()) {
-      SetErrorCode("NULL argument shape for the shape construction");
-      return NULL;
-    }
-    anEdges->Append(aRefSh);
-  }
   aCI.SetFaces(anEdges);
 
   //Compute the sub-shape value
@@ -1108,16 +1384,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueEdgesByList
 
   GEOM::TPythonDump pd (aFunction);
   pd << aGlued << " = geompy.MakeGlueEdgesByList("
-     << theShape << ", " << theTolerance << ", [";
-  // Edges
-  it = theEdges.begin();
-  if (it != theEdges.end()) {
-    pd << (*it++);
-    while (it != theEdges.end()) {
-      pd << ", " << (*it++);
-    }
-  }
-  pd << "])";
+     << theShapes << ", " << theTolerance << ", " << theEdges << " )";
 
   // to provide warning
   if (!isWarning) SetErrorCode(OK);
@@ -1131,7 +1398,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeGlueEdgesByList
 //=============================================================================
 Handle(TColStd_HSequenceOfTransient)
 GEOMImpl_IShapesOperations::GetExistingSubObjects(Handle(GEOM_Object)    theShape,
-                                                 const Standard_Boolean theGroupsOnly)
+                                                  const Standard_Boolean theGroupsOnly)
 {
   // note: this method does not return fields
 
@@ -1146,7 +1413,7 @@ GEOMImpl_IShapesOperations::GetExistingSubObjects(Handle(GEOM_Object)    theShap
       Handle(GEOM_BaseObject) obj = Handle(GEOM_BaseObject)::DownCast( results->Value(i));
       obj->GetEntryString();
       if ( i < results->Length() )
-       anAsciiList += ",";
+        anAsciiList += ",";
     }
     
     GEOM::TPythonDump pd (theShape->GetLastFunction(), /*append=*/true);
@@ -1160,7 +1427,7 @@ GEOMImpl_IShapesOperations::GetExistingSubObjects(Handle(GEOM_Object)    theShap
 
 Handle(TColStd_HSequenceOfTransient)
 GEOMImpl_IShapesOperations::GetExistingSubObjects(Handle(GEOM_Object)    theShape,
-                                                 const Standard_Integer theTypes)
+                                                  const Standard_Integer theTypes)
 {
   SetErrorCode(KO);
 
@@ -1190,8 +1457,8 @@ GEOMImpl_IShapesOperations::GetExistingSubObjects(Handle(GEOM_Object)    theShap
       bool isSubShape = anObj->IsKind(STANDARD_TYPE(GEOM_Object)) && anObj->GetType() != GEOM_GROUP;
       bool isField    = anObj->IsKind(STANDARD_TYPE(GEOM_Field));
       if (theTypes & Groups    && isGroup ||
-         theTypes & SubShapes && isSubShape ||
-         theTypes & Fields    && isField) {
+          theTypes & SubShapes && isSubShape ||
+          theTypes & Fields    && isField) {
         aSeq->Append(anObj);
       }
     }
@@ -1233,17 +1500,20 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeExplode
   TopTools_ListOfShape listShape;
 
   if (aShape.ShapeType() == TopAbs_COMPOUND &&
-      (TopAbs_ShapeEnum(theShapeType) == TopAbs_SHAPE ||
-       TopAbs_ShapeEnum(theShapeType) == TopAbs_COMPSOLID ||
-       TopAbs_ShapeEnum(theShapeType) == TopAbs_COMPOUND))
+      (theShapeType == TopAbs_SHAPE || theShapeType == TopAbs_FLAT || theShapeType == TopAbs_COMPOUND))
   {
     TopoDS_Iterator It (aShape, Standard_True, Standard_True);
     for (; It.More(); It.Next()) {
-      if (mapShape.Add(It.Value())) {
-        if (TopAbs_ShapeEnum(theShapeType) == TopAbs_SHAPE ||
-            TopAbs_ShapeEnum(theShapeType) == It.Value().ShapeType()) {
-          listShape.Append(It.Value());
+      TopoDS_Shape SS = It.Value();
+      if (mapShape.Add(SS)) {
+       if (theShapeType == TopAbs_FLAT) {
+          AddFlatSubShapes(SS, listShape, mapShape);
+       }
+        else if (theShapeType == TopAbs_SHAPE || theShapeType == SS.ShapeType()) {
+         listShape.Append(SS);
         }
+        // VSR: for EXPLODE_NEW_INCLUDE_MAIN and EXPLODE_OLD_INCLUDE_MAIN:
+        // it seems it is necessary to add top-level shape if theShapeType == TopAbs_COMPOUND
       }
     }
   }
@@ -1255,7 +1525,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeExplode
         listShape.Append(exp.Current());
   }
 
-  if (listShape.IsEmpty()) {
+  if (listShape.IsEmpty()){
     //SetErrorCode("The given shape has no sub-shapes of the requested type");
     SetErrorCode(NOT_FOUND_ANY); // NPAL18017
     return aSeq;
@@ -1299,16 +1569,15 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::MakeExplode
       // Put this subshape in the list of sub-shapes of theMainShape
       aMainShape->AddSubShapeReference(aFunction);
     }
-
     if (!anObj.IsNull()) {
-      aSeq->Append(anObj);
+          aSeq->Append(anObj);
 
-      // for python command
-      TDF_Tool::Entry(anObj->GetEntry(), anEntry);
-      anAsciiList += anEntry;
-      anAsciiList += ",";
-    }
-  }
+          // for python command
+          TDF_Tool::Entry(anObj->GetEntry(), anEntry);
+          anAsciiList += anEntry;
+          anAsciiList += ",";
+        }
+      }
 
   //Make a Python command
   anAsciiList.Trunc(anAsciiList.Length() - 1);
@@ -1357,16 +1626,17 @@ Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::SubShapeAllIDs
   TopTools_ListOfShape listShape;
 
   if (aShape.ShapeType() == TopAbs_COMPOUND &&
-      (TopAbs_ShapeEnum(theShapeType) == TopAbs_SHAPE ||
-       TopAbs_ShapeEnum(theShapeType) == TopAbs_COMPSOLID ||
-       TopAbs_ShapeEnum(theShapeType) == TopAbs_COMPOUND))
+      (theShapeType == TopAbs_SHAPE || theShapeType == TopAbs_FLAT || theShapeType == TopAbs_COMPOUND))
   {
     TopoDS_Iterator It (aShape, Standard_True, Standard_True);
     for (; It.More(); It.Next()) {
-      if (mapShape.Add(It.Value())) {
-        if (TopAbs_ShapeEnum(theShapeType) == TopAbs_SHAPE ||
-            TopAbs_ShapeEnum(theShapeType) == It.Value().ShapeType()) {
-          listShape.Append(It.Value());
+      TopoDS_Shape SS = It.Value();
+      if (mapShape.Add(SS)) {
+       if (theShapeType == TopAbs_FLAT) {
+          AddFlatSubShapes(SS, listShape, mapShape);
+       }
+        else if (theShapeType == TopAbs_SHAPE || theShapeType == SS.ShapeType()) {
+          listShape.Append(SS);
         }
       }
     }
@@ -1744,6 +2014,46 @@ TCollection_AsciiString GEOMImpl_IShapesOperations::GetShapeTypeString (Handle(G
   return aTypeName;
 }
 
+//=============================================================================
+/*!
+ *  IsSubShapeBelongsTo
+ */
+//=============================================================================
+Standard_Boolean GEOMImpl_IShapesOperations::IsSubShapeBelongsTo( Handle(GEOM_Object) theSubObject,
+                                                                  const Standard_Integer theSubObjectIndex,
+                                                                  Handle(GEOM_Object) theObject,
+                                                                  const Standard_Integer theObjectIndex)
+{
+  SetErrorCode(KO);
+
+  if ( theObject.IsNull() || theSubObject.IsNull() )
+    return false;
+
+  TopoDS_Shape shape    = theObject->GetValue();
+  TopoDS_Shape subShape = theSubObject->GetValue();
+
+  if ( shape.IsNull() || subShape.IsNull() )
+    return false;
+
+  TopTools_IndexedMapOfShape anIndices;
+  if ( theObjectIndex > 0 ) {
+    TopExp::MapShapes( shape, anIndices );
+    shape = anIndices.FindKey(theObjectIndex);
+  }
+  if ( theSubObjectIndex > 0 ) {
+    TopExp::MapShapes( subShape, anIndices );
+    subShape = anIndices.FindKey(theSubObjectIndex);
+  }
+
+  TopExp::MapShapes( shape, anIndices );
+
+  const Standard_Boolean isBelongTo = anIndices.Contains(subShape);
+
+  SetErrorCode(OK);
+
+  return isBelongTo;
+}
+
 //=============================================================================
 /*!
  *  NumberOfSubShapes
@@ -1785,33 +2095,41 @@ Standard_Integer GEOMImpl_IShapesOperations::NumberOfSubShapes
   */
 
   try {
-    OCC_CATCH_SIGNALS;
-    int iType, nbTypes [TopAbs_SHAPE];
-    for (iType = 0; iType < TopAbs_SHAPE; ++iType)
-      nbTypes[iType] = 0;
-    nbTypes[aShape.ShapeType()]++;
-
-    TopTools_MapOfShape aMapOfShape;
-    aMapOfShape.Add(aShape);
-    TopTools_ListOfShape aListOfShape;
-    aListOfShape.Append(aShape);
-
-    TopTools_ListIteratorOfListOfShape itL (aListOfShape);
-    for (; itL.More(); itL.Next()) {
-      TopoDS_Iterator it (itL.Value());
-      for (; it.More(); it.Next()) {
-        TopoDS_Shape s = it.Value();
-        if (aMapOfShape.Add(s)) {
-          aListOfShape.Append(s);
-          nbTypes[s.ShapeType()]++;
+    if (theShapeType == TopAbs_FLAT) {
+      TopTools_MapOfShape aMapOfShape;
+      TopTools_ListOfShape aListOfShape;
+      AddFlatSubShapes(aShape, aListOfShape, aMapOfShape);
+      nbShapes = aListOfShape.Extent();
+    }
+    else {
+      OCC_CATCH_SIGNALS;
+      int iType, nbTypes [TopAbs_SHAPE];
+      for (iType = 0; iType < TopAbs_SHAPE; ++iType)
+        nbTypes[iType] = 0;
+      nbTypes[aShape.ShapeType()]++;
+      
+      TopTools_MapOfShape aMapOfShape;
+      aMapOfShape.Add(aShape);
+      TopTools_ListOfShape aListOfShape;
+      aListOfShape.Append(aShape);
+      
+      TopTools_ListIteratorOfListOfShape itL (aListOfShape);
+      for (; itL.More(); itL.Next()) {
+        TopoDS_Iterator it (itL.Value());
+        for (; it.More(); it.Next()) {
+          TopoDS_Shape s = it.Value();
+          if (aMapOfShape.Add(s)) {
+            aListOfShape.Append(s);
+            nbTypes[s.ShapeType()]++;
+          }
         }
       }
+      
+      if (TopAbs_ShapeEnum(theShapeType) == TopAbs_SHAPE)
+        nbShapes = aMapOfShape.Extent();
+      else
+        nbShapes = nbTypes[theShapeType];
     }
-
-    if (TopAbs_ShapeEnum(theShapeType) == TopAbs_SHAPE)
-      nbShapes = aMapOfShape.Extent();
-    else
-      nbShapes = nbTypes[theShapeType];
   }
   catch (Standard_Failure) {
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
@@ -1986,7 +2304,7 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetSharedShapes
   }
 
   if (aSeq->IsEmpty()) {
-    SetErrorCode("The given shapes have no shared sub-shapes of the requested type");
+    SetErrorCode(NOT_FOUND_ANY);
     return aSeq;
   }
 
@@ -2006,118 +2324,168 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetSharedShapes
 //=======================================================================
 //function : GetSharedShapes
 //purpose  :
+//
+// NOTE on the implementation
+// 
+// 1) Resulting sub-shapes are published as a children of the 1st input shape
+//    from theShapes list. Due to this reason only direct sub-shapes of the 1st
+//    shape can be contained in the result of the operation (i.e. shares between
+//    2nd/3rd, etc couples cannot be retrieved.
+// 2) An exception from above case is when a single compound is specified as an
+//    input. In this case we search shares between its top-level content, so we
+//    are able to search shares between all possible couples of shapes.
+// 3) Parameter theMultiShare controls what types of shares to search:
+//    - True: get sub-shapes that are shared between ALL input shapes;
+//    - False: get shares between couples of input sub-shapes (see points 1 and 2).
+//
+// Thus, we have the following cases:
+// [1] theShapes = N shapes (N>1), theMultiShare = True
+//     Result: sub-shapes that are shared by all theShapes
+// [2] theShapes = N shapes (N>1), theMultiShare = False
+//     Result: sub-shapes of 1st shape from theShapes that are shared with any shape
+//     from theShapes
+// [3] theShapes = 1 shape, theMultiShare = True
+//     Result: sub-shapes that are shared by all top-level sub-objects of theShapes[0]
+// [4] theShapes = 1 shape, theMultiShare = False
+//     Result: sub-shapes of all possible couples of all top-level sub-objects of
+//     theShapes[0].
 //=======================================================================
 Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::GetSharedShapes
-                                     (std::list<Handle(GEOM_Object)> theShapes,
-                                      const Standard_Integer         theShapeType)
+                                     (std::list<Handle(GEOM_Object)> & theShapes,
+                                      const Standard_Integer           theShapeType,
+                                      const bool                       theMultiShare)
 {
   SetErrorCode(KO);
 
   int aLen = theShapes.size();
   if (aLen < 1) return NULL;
 
-  int ind = 1;
   std::list<Handle(GEOM_Object)>::iterator it = theShapes.begin();
 
-  Handle(GEOM_Object) aMainObj = (*it++);
+  // main object is always first in the input list
+  // it is the object from which sub-shapes indices are taken
+  // and where results are published
+  Handle(GEOM_Object) aMainObj = *it;
   Handle(GEOM_Function) aMainShape = aMainObj->GetLastFunction();
-  if (aMainShape.IsNull()) {
-    SetErrorCode("NULL shape for GetSharedShapes");
-    return NULL;
-  }
-
-  TopoDS_Shape aShape1 = aMainShape->GetValue();
-  if (aShape1.IsNull()) return NULL;
-
-  TopTools_IndexedMapOfShape anIndices;
-  TopExp::MapShapes(aShape1, anIndices);
-
-  TopTools_IndexedMapOfShape mapSelected;
-  TopExp::MapShapes(aShape1, TopAbs_ShapeEnum(theShapeType), mapSelected);
-
-  // Find shared shapes
-  BRep_Builder B;
-  TopoDS_Compound aCurrSelection;
 
-  for (; it != theShapes.end(); it++, ind++) {
+  // collect all shapes from the input list (including first one) for processing
+  TopTools_SequenceOfShape shapeSeq;
+  for (; it != theShapes.end(); it++) {
     Handle(GEOM_Function) aRefShape = (*it)->GetLastFunction();
     if (aRefShape.IsNull()) {
       SetErrorCode("NULL shape for GetSharedShapes");
       return NULL;
     }
+    TopoDS_Shape aShape = aRefShape->GetValue();
+    if (aShape.IsNull()) {
+      SetErrorCode("NULL shape for GetSharedShapes");
+      return NULL;
+    }
+    shapeSeq.Append( aShape );
+  }
+
+  // if only single shape is specified as input
+  // collect all ites top-level sub-shapes for processing
+  if ( shapeSeq.Length() == 1 )
+  {
+    TopoDS_Shape aShape = shapeSeq.First();
+    shapeSeq.Clear();
+    for ( TopoDS_Iterator it( aShape ); it.More(); it.Next() )
+      shapeSeq.Append( it.Value() );
+  }
 
-    TopoDS_Compound aCompound;
-    B.MakeCompound(aCompound);
+  // map all sub-shapes in a main shape to their indices
+  TopTools_IndexedMapOfShape anIndices;
+  TopExp::MapShapes(aMainShape->GetValue(), anIndices);
+  TopTools_MapOfShape mapShape;
 
-    TopoDS_Shape aShape2 = aRefShape->GetValue();
-    if (aShape2.IsNull()) return NULL;
+  // find shared shapes
 
-    TopTools_MapOfShape mapShape2;
-    TopExp_Explorer exp (aShape2, TopAbs_ShapeEnum(theShapeType));
-    for (; exp.More(); exp.Next()) {
-      TopoDS_Shape aSS = exp.Current();
-      if (mapShape2.Add(aSS) && mapSelected.Contains(aSS)) {
-        B.Add(aCompound, aSS);
+  // here we will collect all shares
+  TopTools_ListOfShape aShared;
+
+  // number of iterations
+  int nbIters  =  theMultiShare || theShapes.size() > 1 ? 1 : shapeSeq.Length()-1;
+  // numShares factor to search (i.e. by what nb of shapes each found sub-shape should be shared)
+  int nbShares =  theMultiShare ? shapeSeq.Length()-1 : 1;
+    
+  for ( int iter = 1; iter <= nbIters; iter++) {
+    for ( int ind = iter+1; ind <= shapeSeq.Length(); ind++) {
+      if ( ind-1+nbShares > shapeSeq.Length() ) break;
+      TopoDS_Compound aCurrSelection;
+      TopoDS_Shape aShape1 = shapeSeq.Value( iter );
+      TopTools_IndexedMapOfShape mapSelected;
+      TopExp::MapShapes(aShape1, TopAbs_ShapeEnum(theShapeType), mapSelected);
+      for ( int s = 0; s < nbShares; s++ ) {
+        BRep_Builder B;
+        TopoDS_Compound aCompound;
+        B.MakeCompound(aCompound);
+        const TopoDS_Shape& aShape2 = shapeSeq.Value( ind+s );
+        TopTools_MapOfShape mapShape2;
+        TopExp_Explorer exp (aShape2, TopAbs_ShapeEnum(theShapeType));
+        for (; exp.More(); exp.Next()) {
+          const TopoDS_Shape& aSS = exp.Current();
+          if (mapShape2.Add(aSS) && mapSelected.Contains(aSS)) {
+            B.Add(aCompound, aSS);
+          }
+        }
+        mapSelected.Clear();
+        aCurrSelection = aCompound;
+        TopExp::MapShapes(aCurrSelection, TopAbs_ShapeEnum(theShapeType), mapSelected);
+      }
+      TopoDS_Iterator itSel(aCurrSelection, Standard_True, Standard_True);
+      for (; itSel.More(); itSel.Next()) {
+        const TopoDS_Shape& aSS = itSel.Value();
+        if (mapShape.Add(aSS) )
+         aShared.Append(aSS);
       }
     }
-
-    mapSelected.Clear();
-    TopExp::MapShapes(aCompound, TopAbs_ShapeEnum(theShapeType), mapSelected);
-    aCurrSelection = aCompound;
   }
 
-  // Create GEOM_Object for each found shared shape (collected in aCurrSelection)
-  Handle(GEOM_Object) anObj;
-  Handle(TColStd_HArray1OfInteger) anArray;
   Handle(TColStd_HSequenceOfTransient) aSeq = new TColStd_HSequenceOfTransient;
-  TCollection_AsciiString anAsciiList, anEntry;
 
-  TopoDS_Iterator itSel (aCurrSelection, Standard_True, Standard_True);
-  for (; itSel.More(); itSel.Next()) {
-    anArray = new TColStd_HArray1OfInteger(1,1);
-    anArray->SetValue(1, anIndices.FindIndex(itSel.Value()));
+  if (aShared.IsEmpty()){
+    SetErrorCode(NOT_FOUND_ANY);
+    return aSeq;
+  }
+
+  // create GEOM_Object for each found shared shape (collected in aShared)
+  TCollection_AsciiString anAsciiList;
+  Handle(GEOM_Object) anObj;
+  TopTools_ListIteratorOfListOfShape itSub (aShared);
+  for (; itSub.More(); itSub.Next()) {
+    TopoDS_Shape aValue = itSub.Value();
+    Handle(TColStd_HArray1OfInteger) anArray = new TColStd_HArray1OfInteger(1,1);
+    anArray->SetValue(1, anIndices.FindIndex(aValue));
     anObj = GetEngine()->AddSubShape(aMainObj, anArray);
     aSeq->Append(anObj);
 
     // for python command
+    TCollection_AsciiString anEntry;
     TDF_Tool::Entry(anObj->GetEntry(), anEntry);
     anAsciiList += anEntry;
     anAsciiList += ",";
   }
 
-  if (aSeq->IsEmpty()) {
-    SetErrorCode("The given shapes have no shared sub-shapes of the requested type");
-    return aSeq;
-  }
-
-  // Make a Python command
+  // make a Python command
   anAsciiList.Trunc(anAsciiList.Length() - 1);
 
-  // IPAL22904: TC6.5.0: order of python commands is wrong after dump study
-  Handle(TColStd_HSequenceOfTransient) anObjects = new TColStd_HSequenceOfTransient;
-  for( it = theShapes.begin(); it != theShapes.end(); it++ )
-  {
-    Handle(GEOM_Object) anObj = *it;
-    if( !anObj.IsNull() )
-      anObjects->Append( anObj );
-  }
-
-  // Get the function of the latest published object
-  Handle(GEOM_Function) aFunction = GEOM::GetCreatedLast( anObjects )->GetLastFunction();
-  if( aFunction.IsNull() ) // just in case
-    aFunction = aMainShape;
-
-  GEOM::TPythonDump pd (aFunction, /*append=*/true);
+  GEOM::TPythonDump pd (anObj->GetLastFunction());
   pd << "[" << anAsciiList.ToCString()
-     << "] = geompy.GetSharedShapesMulti([";
+     << "] = geompy.GetSharedShapesMulti(";
+
+  if ( aLen > 1 )
+    pd << "[";
 
   it = theShapes.begin();
   pd << (*it++);
   while (it != theShapes.end()) {
     pd << ", " << (*it++);
   }
+  if ( aLen > 1 )
+    pd << "]";
 
-  pd << "], " << TopAbs_ShapeEnum(theShapeType) << ")";
+  pd << ", " << TopAbs_ShapeEnum(theShapeType) << ", " << theMultiShare << ")";
 
   SetErrorCode(OK);
   return aSeq;
@@ -2259,7 +2627,7 @@ Handle(TColStd_HSequenceOfInteger)
   TopoDS_Shape aShape = theShape->GetValue();
 
   // Check presence of triangulation, build if need
-  if (!GEOMUtils::CheckTriangulation(aShape)) {
+  if (theShapeType != TopAbs_VERTEX && !GEOMUtils::CheckTriangulation(aShape)) {
     SetErrorCode("Cannot build triangulation on the shape");
     return aSeqOfIDs;
   }
@@ -2280,7 +2648,7 @@ Handle(TColStd_HSequenceOfInteger)
 
   // Interprete results
   Standard_Integer iErr = aFinder.ErrorStatus();
-  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iErr) {
     MESSAGE(" iErr : " << iErr);
     TCollection_AsciiString aMsg (" iErr : ");
@@ -2289,7 +2657,7 @@ Handle(TColStd_HSequenceOfInteger)
     return aSeqOfIDs;
   }
   Standard_Integer iWrn = aFinder.WarningStatus();
-  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iWrn) {
     MESSAGE(" *** iWrn : " << iWrn);
   }
@@ -2426,14 +2794,36 @@ Handle(TColStd_HSequenceOfInteger)
   TopTools_ListOfShape res;
 
   // Check presence of triangulation, build if need
-  if (!GEOMUtils::CheckTriangulation(aShape)) {
+  if (theShapeType != TopAbs_VERTEX && !GEOMUtils::CheckTriangulation(aShape)) {
     SetErrorCode("Cannot build triangulation on the shape");
     return aSeqOfIDs;
   }
 
+  // Compute classification tolerance.
+  TopTools_IndexedMapOfShape aMapVtx;
+  Standard_Real              aTol = Precision::Confusion();
+
+  TopExp::MapShapes(aShape, TopAbs_VERTEX, aMapVtx);
+
+  Standard_Integer i;
+  Standard_Integer aNbVtx = aMapVtx.Extent();
+
+  for (i = 1; i <= aNbVtx; ++i) {
+    const TopoDS_Vertex aVtx    = TopoDS::Vertex(aMapVtx.FindKey(i));
+    const Standard_Real aVtxTol = BRep_Tool::Tolerance(aVtx);
+
+    if (aTol < aVtxTol) {
+      aTol = aVtxTol;
+    }
+  }
+
+  // Bound the tolerance value.
+  if (aTol > 0.0001) {
+    aTol = 0.0001;
+  }
+
   // Call algo
   GEOMAlgo_FinderShapeOn2 aFinder;
-  Standard_Real aTol = 0.0001; // default value
 
   Handle(GEOMAlgo_ClsfSolid) aClsfSolid = new GEOMAlgo_ClsfSolid;
   aClsfSolid->SetShape(aCheckShape);
@@ -2447,7 +2837,7 @@ Handle(TColStd_HSequenceOfInteger)
 
   // Interprete results
   Standard_Integer iErr = aFinder.ErrorStatus();
-  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iErr) {
     if (iErr == 41) {
       SetErrorCode("theCheckShape must be a solid");
@@ -2461,7 +2851,7 @@ Handle(TColStd_HSequenceOfInteger)
     return aSeqOfIDs;
   }
   Standard_Integer iWrn = aFinder.WarningStatus();
-  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iWrn) {
     MESSAGE(" *** iWrn : " << iWrn);
   }
@@ -2635,85 +3025,225 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetShapesOnShapeAsCompound
   return aRes;
 }
 
-//=======================================================================
-//function : getShapesOnSurfaceIDs
-  /*!
-   * \brief Find IDs of sub-shapes complying with given status about surface
-    * \param theSurface - the surface to check state of sub-shapes against
-    * \param theShape - the shape to explore
-    * \param theShapeType - type of sub-shape of theShape
-    * \param theState - required state
-    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
-   */
-//=======================================================================
-Handle(TColStd_HSequenceOfInteger)
-  GEOMImpl_IShapesOperations::getShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
-                                                    const TopoDS_Shape&         theShape,
-                                                    TopAbs_ShapeEnum            theShapeType,
-                                                    GEOMAlgo_State              theState)
+//=============================================================================
+/*!
+ *  GetSubShapeEdgeSorted
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+    GEOMImpl_IShapesOperations::GetSubShapeEdgeSorted
+                          (const Handle(GEOM_Object) &theShape,
+                           const Handle(GEOM_Object) &theStartPoint)
 {
-  Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
+  // Get the sorted edges indices.
+  Handle(TColStd_HSequenceOfInteger) aSortedIDs =
+    getSubShapeEdgeSortedIDs(theShape, theStartPoint);
 
-  // Check presence of triangulation, build if need
-  if (!GEOMUtils::CheckTriangulation(theShape)) {
-    SetErrorCode("Cannot build triangulation on the shape");
-    return aSeqOfIDs;
-  }
+  // Get object by indices.
+  TCollection_AsciiString              anAsciiList;
+  Handle(TColStd_HSequenceOfTransient) aSeq =
+    getObjectsShapesOn(theShape, aSortedIDs, anAsciiList);
 
-  // BEGIN: Mantis issue 0020961: Error on a pipe T-Shape
-  // Compute tolerance
-  Standard_Real T, VertMax = -RealLast();
-  try {
-    OCC_CATCH_SIGNALS;
-    for (TopExp_Explorer ExV (theShape, TopAbs_VERTEX); ExV.More(); ExV.Next()) {
-      TopoDS_Vertex Vertex = TopoDS::Vertex(ExV.Current());
-      T = BRep_Tool::Tolerance(Vertex);
-      if (T > VertMax)
-        VertMax = T;
-    }
-  }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
-    return aSeqOfIDs;
+  if (aSeq.IsNull() || aSeq->IsEmpty()) {
+    SetErrorCode("Empty sequence of edges");
+    return NULL;
   }
-  // END: Mantis issue 0020961
 
-  // Call algo
-  GEOMAlgo_FinderShapeOn1 aFinder;
-  //Standard_Real aTol = 0.0001; // default value
-  Standard_Real aTol = VertMax; // Mantis issue 0020961
+  // Make a Python command
+  Handle(GEOM_Object)   anObj     =
+    Handle(GEOM_Object)::DownCast(aSeq->Value(1));
+  Handle(GEOM_Function) aFunction = anObj->GetLastFunction();
 
-  aFinder.SetShape(theShape);
-  aFinder.SetTolerance(aTol);
-  aFinder.SetSurface(theSurface);
-  aFinder.SetShapeType(theShapeType);
-  aFinder.SetState(theState);
+  GEOM::TPythonDump(aFunction)
+    << "[" << anAsciiList.ToCString() << "] = geompy.GetSubShapeEdgeSorted("
+    << theShape << ", " << theStartPoint << ")";
 
-  // Sets the minimal number of inner points for the faces that do not have own
-  // inner points at all (for e.g. rectangular planar faces have just 2 triangles).
-  // Default value=3
-  aFinder.SetNbPntsMin(3);
-  // Sets the maximal number of inner points for edges or faces.
-  // It is usefull for the cases when this number is very big (e.g =2000) to improve
-  // the performance. If this value =0, all inner points will be taken into account.
-  // Default value=0
-  aFinder.SetNbPntsMax(100);
+  SetErrorCode(OK);
 
-  aFinder.Perform();
+  return aSeq;
+}
 
-  // Interprete results
-  Standard_Integer iErr = aFinder.ErrorStatus();
-  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
-  if (iErr) {
-    MESSAGE(" iErr : " << iErr);
+//=============================================================================
+/*!
+ *  GetSubShapesWithTolerance
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfTransient)
+    GEOMImpl_IShapesOperations::GetSubShapesWithTolerance
+                     (const Handle(GEOM_Object)            &theShape,
+                      const Standard_Integer                theShapeType,
+                      const GEOMUtils::ComparisonCondition  theCondition,
+                      const Standard_Real                   theTolerance)
+{
+  if (theShape.IsNull()) {
+    SetErrorCode("NULL GEOM object");
+    return NULL;
+  }
+
+  TopoDS_Shape aShape = theShape->GetValue();
+
+  if (aShape.IsNull()) {
+    SetErrorCode("NULL Shape");
+    return NULL;
+  }
+
+  if (theShapeType != TopAbs_FACE && theShapeType != TopAbs_EDGE &&
+      theShapeType != TopAbs_VERTEX && aShape.ShapeType() >= theShapeType) {
+    SetErrorCode("Invalid shape type");
+    return NULL;
+  }
+
+  TopTools_IndexedMapOfShape         anIndices;
+  TopTools_MapOfShape                aMapFence;
+  TopExp_Explorer                    anExp(aShape,
+                                           (TopAbs_ShapeEnum) theShapeType);
+  Handle(TColStd_HSequenceOfInteger) anIDs = new TColStd_HSequenceOfInteger;
+
+  TopExp::MapShapes(aShape, anIndices);
+
+  for (; anExp.More(); anExp.Next()) {
+    const TopoDS_Shape &aSubShape = anExp.Current();
+
+    if (aMapFence.Add(aSubShape)) {
+      // Compute tolerance
+      Standard_Real aTolerance = -1.;
+
+      switch (aSubShape.ShapeType()) {
+        case TopAbs_FACE:
+          aTolerance = BRep_Tool::Tolerance(TopoDS::Face(aSubShape));
+          break;
+        case TopAbs_EDGE:
+          aTolerance = BRep_Tool::Tolerance(TopoDS::Edge(aSubShape));
+          break;
+        case TopAbs_VERTEX:
+          aTolerance = BRep_Tool::Tolerance(TopoDS::Vertex(aSubShape));
+          break;
+        default:
+          break;
+      }
+
+      if (aTolerance < 0.) {
+        continue;
+      }
+
+      // Compare the tolerance with reference value.
+      if (GEOMUtils::IsFitCondition (theCondition, aTolerance, theTolerance)) {
+        anIDs->Append(anIndices.FindIndex(aSubShape));
+      }
+    }
+  }
+
+  if (anIDs->IsEmpty()) {
+    SetErrorCode("Empty sequence of sub-shapes");
+    return NULL;
+  }
+
+  // Get objects by indices.
+  TCollection_AsciiString              anAsciiList;
+  Handle(TColStd_HSequenceOfTransient) aSeq =
+    getObjectsShapesOn(theShape, anIDs, anAsciiList);
+
+  if (aSeq.IsNull() || aSeq->IsEmpty()) {
+    SetErrorCode("Empty sequence of edges");
+    return NULL;
+  }
+
+  // Make a Python command
+  Handle(GEOM_Object)   anObj     =
+    Handle(GEOM_Object)::DownCast(aSeq->Value(1));
+  Handle(GEOM_Function) aFunction = anObj->GetLastFunction();
+
+  GEOM::TPythonDump(aFunction)
+    << "[" << anAsciiList.ToCString() << "] = geompy.GetSubShapesWithTolerance("
+    << theShape << ", " << theShapeType << ", " << theCondition << ", "
+    << theTolerance << ")";
+
+  SetErrorCode(OK);
+
+  return aSeq;
+}
+
+//=======================================================================
+//function : getShapesOnSurfaceIDs
+  /*!
+   * \brief Find IDs of sub-shapes complying with given status about surface
+    * \param theSurface - the surface to check state of sub-shapes against
+    * \param theShape - the shape to explore
+    * \param theShapeType - type of sub-shape of theShape
+    * \param theState - required state
+    * \retval Handle(TColStd_HSequenceOfInteger) - IDs of found sub-shapes
+   */
+//=======================================================================
+Handle(TColStd_HSequenceOfInteger)
+  GEOMImpl_IShapesOperations::getShapesOnSurfaceIDs(const Handle(Geom_Surface)& theSurface,
+                                                    const TopoDS_Shape&         theShape,
+                                                    TopAbs_ShapeEnum            theShapeType,
+                                                    GEOMAlgo_State              theState)
+{
+  Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
+
+  // Check presence of triangulation, build if need
+  if (theShapeType != TopAbs_VERTEX &&
+      !GEOMUtils::CheckTriangulation(theShape)) {
+    SetErrorCode("Cannot build triangulation on the shape");
+    return aSeqOfIDs;
+  }
+
+  // BEGIN: Mantis issue 0020961: Error on a pipe T-Shape
+  // Compute tolerance
+  Standard_Real T, VertMax = -RealLast();
+  try {
+    OCC_CATCH_SIGNALS;
+    for (TopExp_Explorer ExV (theShape, TopAbs_VERTEX); ExV.More(); ExV.Next()) {
+      TopoDS_Vertex Vertex = TopoDS::Vertex(ExV.Current());
+      T = BRep_Tool::Tolerance(Vertex);
+      if (T > VertMax)
+        VertMax = T;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return aSeqOfIDs;
+  }
+  // END: Mantis issue 0020961
+
+  // Call algo
+  GEOMAlgo_FinderShapeOn2   aFinder;
+  Handle(GEOMAlgo_ClsfSurf) aClsfSurf = new GEOMAlgo_ClsfSurf;
+  Standard_Real             aTol      = VertMax; // Mantis issue 0020961
+
+  aClsfSurf->SetSurface(theSurface);
+  aFinder.SetShape(theShape);
+  aFinder.SetTolerance(aTol);
+  aFinder.SetClsf(aClsfSurf);
+  aFinder.SetShapeType(theShapeType);
+  aFinder.SetState(theState);
+
+  // Sets the minimal number of inner points for the faces that do not have own
+  // inner points at all (for e.g. rectangular planar faces have just 2 triangles).
+  // Default value=3
+  aFinder.SetNbPntsMin(3);
+  // Sets the maximal number of inner points for edges or faces.
+  // It is usefull for the cases when this number is very big (e.g =2000) to improve
+  // the performance. If this value =0, all inner points will be taken into account.
+  // Default value=0
+  aFinder.SetNbPntsMax(100);
+
+  aFinder.Perform();
+
+  // Interprete results
+  Standard_Integer iErr = aFinder.ErrorStatus();
+  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn2.cxx
+  if (iErr) {
+    MESSAGE(" iErr : " << iErr);
     TCollection_AsciiString aMsg (" iErr : ");
     aMsg += TCollection_AsciiString(iErr);
     SetErrorCode(aMsg);
     return aSeqOfIDs;
   }
   Standard_Integer iWrn = aFinder.WarningStatus();
-  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iWrn) {
     MESSAGE(" *** iWrn : " << iWrn);
   }
@@ -2776,6 +3306,152 @@ Handle(TColStd_HSequenceOfTransient) GEOMImpl_IShapesOperations::
   return aSeq;
 }
 
+//=============================================================================
+/*!
+ *  getSubShapeEdgeSortedIDs
+ */
+//=============================================================================
+Handle(TColStd_HSequenceOfInteger)
+    GEOMImpl_IShapesOperations::getSubShapeEdgeSortedIDs
+                               (const Handle(GEOM_Object) &theShape,
+                                const Handle(GEOM_Object) &theStartPoint)
+{
+  Handle(TColStd_HSequenceOfInteger) aResult;
+
+  if (theShape.IsNull() || theStartPoint.IsNull()) {
+    SetErrorCode("NULL GEOM object");
+    return aResult;
+  }
+
+  const TopoDS_Shape aShape      = theShape->GetValue();
+  const TopoDS_Shape aStartPoint = theStartPoint->GetValue();
+
+  if (aShape.IsNull() || aStartPoint.IsNull()) {
+    SetErrorCode("NULL Shape");
+    return aResult;
+  }
+
+  if (aStartPoint.ShapeType() != TopAbs_VERTEX) {
+    SetErrorCode("Starting point is not a vertex");
+    return aResult;
+  }
+
+  TopExp_Explorer      anExp(aShape, TopAbs_EDGE);
+  TopTools_MapOfShape  aMapFence;
+  TopTools_ListOfShape anEdges;
+
+  for (; anExp.More(); anExp.Next()) {
+    const TopoDS_Shape &anEdge = anExp.Current();
+
+    if (aMapFence.Add(anEdge)) {
+      anEdges.Append(anEdge);
+    }
+  }
+
+  if (anEdges.IsEmpty()) {
+    SetErrorCode("Shape doesn't contain edges");
+    return aResult;
+  }
+
+  // Step 1: Sort edges
+  GEOMUtils::SortShapes(anEdges, Standard_False);
+
+  TopTools_ListIteratorOfListOfShape anIter(anEdges);
+  TopoDS_Vertex                      aV[2];
+  TopTools_DataMapOfShapeListOfShape aMapVE;
+
+  // Step 2: Fill the map vertex - list of edges.
+  for (; anIter.More(); anIter.Next()) {
+    TopoDS_Edge anEdge = TopoDS::Edge(anIter.Value());
+
+    TopExp::Vertices(anEdge, aV[0], aV[1]);
+
+    const Standard_Integer aNbV = aV[0].IsSame(aV[1]) ? 1 : 2;
+    Standard_Integer       i;
+
+    for (i = 0; i < aNbV; ++i) {
+      if (aV[i].IsNull() == Standard_False) {
+        if (!aMapVE.IsBound(aV[i])) {
+          // There is no this vertex in the map.
+          aMapVE.Bind(aV[i], TopTools_ListOfShape());
+        }
+
+        // Add the edge to the list bound with the vertex aV[i].
+        TopTools_ListOfShape &aLEdges = aMapVE.ChangeFind(aV[i]);
+
+        aLEdges.Append(anEdge);
+      }
+    }
+  }
+
+  // Step 3: Find starting point in aMapVE.
+  TopoDS_Vertex aStartVtx = TopoDS::Vertex(aStartPoint);
+
+  if (!aMapVE.IsBound(aStartVtx)) {
+    aStartVtx = getSameVertex(aShape, aStartVtx);
+
+    if (aStartVtx.IsNull()) {
+      SetErrorCode("Invalid Starting point");
+      return aResult;
+    }
+  }
+
+  TopTools_IndexedMapOfShape anIndices;
+  TopTools_MapOfShape        aMapVFence;
+  TopoDS_Shape               aCurVtx  = aStartVtx;
+  TopoDS_Edge                aCurEdge =
+    TopoDS::Edge(aMapVE.Find(aCurVtx).First());
+
+  aResult = new TColStd_HSequenceOfInteger;
+  TopExp::MapShapes(aShape, anIndices);
+
+  // Step 4: Fill the list of sorted edges.
+  while (aMapVFence.Add(aCurVtx)) {
+    // Append the ID of the current edge to the list of sorted.
+    aResult->Append(anIndices.FindIndex(aCurEdge));
+    TopExp::Vertices(aCurEdge, aV[0], aV[1]);
+
+    // Get the next vertex.
+    if (aCurVtx.IsSame(aV[0])) {
+      if (aCurVtx.IsSame(aV[1])) {
+        // There is no next vertex.
+        break;
+      } else {
+        aCurVtx = aV[1];
+      }
+    } else {
+      aCurVtx = aV[0];
+    }
+
+    if (aCurVtx.IsNull()) {
+      // There is no next vertex.
+      break;
+    }
+
+    // Get the next edge.
+    const TopTools_ListOfShape         &aLEdges = aMapVE.Find(aCurVtx);
+    TopTools_ListIteratorOfListOfShape  anEIter(aLEdges);
+
+    for (; anEIter.More(); anEIter.Next()) {
+      const TopoDS_Shape &aLocalEdge = anEIter.Value();
+
+      if (aLocalEdge.IsNull() == Standard_False) {
+        if (!aCurEdge.IsSame(aLocalEdge)) {
+          aCurEdge = TopoDS::Edge(aLocalEdge);
+          break;
+        }
+      }
+    }
+
+    if (!anEIter.More()) {
+      // There is no next edge.
+      break;
+    }
+  }
+
+  return aResult;
+}
+
 //=======================================================================
 //function : getShapesOnSurface
 /*!
@@ -3434,7 +4110,7 @@ Handle(TColStd_HSequenceOfInteger)
   Handle(TColStd_HSequenceOfInteger) aSeqOfIDs;
 
   // Check presence of triangulation, build if need
-  if (!GEOMUtils::CheckTriangulation(aShape)) {
+  if (theShapeType != TopAbs_VERTEX && !GEOMUtils::CheckTriangulation(aShape)) {
     SetErrorCode("Cannot build triangulation on the shape");
     return aSeqOfIDs;
   }
@@ -3445,12 +4121,15 @@ Handle(TColStd_HSequenceOfInteger)
   gp_Pnt aPntBL = BRep_Tool::Pnt(TopoDS::Vertex(aBL));
   gp_Pnt aPntBR = BRep_Tool::Pnt(TopoDS::Vertex(aBR));
 
-  GEOMAlgo_FinderShapeOnQuad aFinder( aPntTL, aPntTR, aPntBL, aPntBR );
+  GEOMAlgo_FinderShapeOn2  aFinder;
+  Handle(GEOMAlgo_ClsfQuad) aClsfQuad = new GEOMAlgo_ClsfQuad;
+
   Standard_Real aTol = 0.0001; // default value
 
+  aClsfQuad->SetCorners(aPntTL, aPntTR, aPntBL, aPntBR);
   aFinder.SetShape(aShape);
   aFinder.SetTolerance(aTol);
-  //aFinder.SetSurface(theSurface);
+  aFinder.SetClsf(aClsfQuad);
   aFinder.SetShapeType(aShapeType);
   aFinder.SetState(theState);
 
@@ -3468,7 +4147,7 @@ Handle(TColStd_HSequenceOfInteger)
 
   // Interprete results
   Standard_Integer iErr = aFinder.ErrorStatus();
-  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of error codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iErr) {
     MESSAGE(" iErr : " << iErr);
     TCollection_AsciiString aMsg (" iErr : ");
@@ -3477,7 +4156,7 @@ Handle(TColStd_HSequenceOfInteger)
     return aSeqOfIDs;
   }
   Standard_Integer iWrn = aFinder.WarningStatus();
-  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn1.cxx
+  // the detailed description of warning codes is in GEOMAlgo_FinderShapeOn2.cxx
   if (iWrn) {
     MESSAGE(" *** iWrn : " << iWrn);
   }
@@ -3623,208 +4302,6 @@ Handle(TColStd_HSequenceOfInteger)
   return aSeqOfIDs;
 }
 
-//=============================================================================
-/*!
- *  GetInPlaceOfShape
- */
-//=============================================================================
-static bool GetInPlaceOfShape (const Handle(GEOM_Function)& theWhereFunction,
-                               const TopTools_IndexedMapOfShape& theWhereIndices,
-                               const TopoDS_Shape& theWhat,
-                               TColStd_ListOfInteger& theModifiedList)
-{
-  if (theWhereFunction.IsNull() || theWhat.IsNull()) return false;
-
-  if (theWhereIndices.Contains(theWhat)) {
-    // entity was not changed by the operation
-    Standard_Integer aWhatIndex = theWhereIndices.FindIndex(theWhat);
-    theModifiedList.Append(aWhatIndex);
-    return true;
-  }
-
-  // try to find in history
-  TDF_Label aHistoryLabel = theWhereFunction->GetHistoryEntry(Standard_False);
-
-  // search in history for all argument shapes
-  Standard_Boolean isFound = Standard_False;
-  Standard_Boolean isGood = Standard_False;
-
-  TDF_LabelSequence aLabelSeq;
-  theWhereFunction->GetDependency(aLabelSeq);
-  Standard_Integer nbArg = aLabelSeq.Length();
-
-  for (Standard_Integer iarg = 1; iarg <= nbArg && !isFound; iarg++) {
-
-    TDF_Label anArgumentRefLabel = aLabelSeq.Value(iarg);
-
-    Handle(GEOM_Object) anArgumentObject = GEOM_Object::GetReferencedObject(anArgumentRefLabel);
-    TopoDS_Shape anArgumentShape = anArgumentObject->GetValue();
-
-    TopTools_IndexedMapOfShape anArgumentIndices;
-    TopExp::MapShapes(anArgumentShape, anArgumentIndices);
-
-    if (anArgumentIndices.Contains(theWhat)) {
-      isFound = Standard_True;
-      Standard_Integer aWhatIndex = anArgumentIndices.FindIndex(theWhat);
-
-      // Find corresponding label in history
-      TDF_Label anArgumentHistoryLabel =
-        theWhereFunction->GetArgumentHistoryEntry(anArgumentRefLabel, Standard_False);
-      if (anArgumentHistoryLabel.IsNull()) {
-        // Lost History of operation argument. Possibly, all its entities was removed.
-        isGood = Standard_True;
-      }
-      else {
-        TDF_Label aWhatHistoryLabel = anArgumentHistoryLabel.FindChild(aWhatIndex, Standard_False);
-
-        if (aWhatHistoryLabel.IsNull()) {
-          // Removed entity ? Compound ? Compsolid ? Shell ? Wire
-          isGood = Standard_False;
-        } else {
-          Handle(TDataStd_IntegerArray) anIntegerArray;
-          if (!aWhatHistoryLabel.FindAttribute(TDataStd_IntegerArray::GetID(), anIntegerArray)) {
-            //Error: Empty modifications history for the sought shape.
-            isGood = Standard_False;
-          }
-          else {
-            isGood = Standard_True;
-            Standard_Integer imod, aModifLen = anIntegerArray->Array()->Length();
-            for (imod = 1; imod <= aModifLen; imod++) {
-              theModifiedList.Append(anIntegerArray->Array()->Value(imod));
-            }
-          }
-        }
-      }
-    }
-  }
-
-  isFound = isGood;
-
-  if (!isFound) {
-    // try compound/compsolid/shell/wire element by element
-    bool isFoundAny = false;
-    TopTools_MapOfShape mapShape;
-
-    if (theWhat.ShapeType() == TopAbs_COMPOUND ||
-        theWhat.ShapeType() == TopAbs_COMPSOLID) {
-      // recursive processing of compound/compsolid
-      TopoDS_Iterator anIt (theWhat, Standard_True, Standard_True);
-      for (; anIt.More(); anIt.Next()) {
-        if (mapShape.Add(anIt.Value())) {
-          TopoDS_Shape curWhat = anIt.Value();
-          isFoundAny = GetInPlaceOfShape(theWhereFunction, theWhereIndices, curWhat, theModifiedList);
-          if (isFoundAny) isFound = Standard_True;
-        }
-      }
-    }
-    else if (theWhat.ShapeType() == TopAbs_SHELL) {
-      // try to replace a shell by its faces images
-      TopExp_Explorer anExp (theWhat, TopAbs_FACE);
-      for (; anExp.More(); anExp.Next()) {
-        if (mapShape.Add(anExp.Current())) {
-          TopoDS_Shape curWhat = anExp.Current();
-          isFoundAny = GetInPlaceOfShape(theWhereFunction, theWhereIndices, curWhat, theModifiedList);
-          if (isFoundAny) isFound = Standard_True;
-        }
-      }
-    }
-    else if (theWhat.ShapeType() == TopAbs_WIRE) {
-      // try to replace a wire by its edges images
-      TopExp_Explorer anExp (theWhat, TopAbs_EDGE);
-      for (; anExp.More(); anExp.Next()) {
-        if (mapShape.Add(anExp.Current())) {
-          TopoDS_Shape curWhat = anExp.Current();
-          isFoundAny = GetInPlaceOfShape(theWhereFunction, theWhereIndices, curWhat, theModifiedList);
-          if (isFoundAny) isFound = Standard_True;
-        }
-      }
-    }
-    else {
-      // Removed entity
-    }
-  }
-
-  return isFound;
-}
-
-//=============================================================================
-/*!
- *  GetShapeProperties
- */
-//=============================================================================
-void GEOMImpl_IShapesOperations::GetShapeProperties( const TopoDS_Shape aShape, Standard_Real tab[],
-                                                     gp_Pnt & aVertex )
-{
-  GProp_GProps theProps;
-  gp_Pnt aCenterMass;
-  //TopoDS_Shape aPntShape;
-  Standard_Real aShapeSize;
-
-  if    (aShape.ShapeType() == TopAbs_VERTEX) aCenterMass = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
-  else if (aShape.ShapeType() == TopAbs_EDGE) BRepGProp::LinearProperties(aShape,  theProps);
-  else if (aShape.ShapeType() == TopAbs_FACE) BRepGProp::SurfaceProperties(aShape, theProps);
-  else                                        BRepGProp::VolumeProperties(aShape,  theProps);
-
-  if (aShape.ShapeType() == TopAbs_VERTEX)
-    aShapeSize = 1;
-  else {
-    aCenterMass = theProps.CentreOfMass();
-    aShapeSize  = theProps.Mass();
-  }
-
-//   aPntShape = BRepBuilderAPI_MakeVertex(aCenterMass).Shape();
-//   aVertex   = BRep_Tool::Pnt( TopoDS::Vertex( aPntShape ) );
-  aVertex = aCenterMass;
-  tab[0] = aVertex.X();
-  tab[1] = aVertex.Y();
-  tab[2] = aVertex.Z();
-  tab[3] = aShapeSize;
-  return;
-}
-
-namespace {
-
-  //================================================================================
-  /*!
-   * \brief Return normal to face at extrema point
-   */
-  //================================================================================
-
-  gp_Vec GetNormal (const TopoDS_Face& face, const BRepExtrema_DistShapeShape& extrema)
-  {
-    gp_Vec defaultNorm(1,0,0); // to have same normals on different faces
-    try {
-      // get UV at extrema point
-      Standard_Real u,v, f,l;
-      switch ( extrema.SupportTypeShape2(1) ) {
-      case BRepExtrema_IsInFace: {
-        extrema.ParOnFaceS2(1, u, v );
-        break;
-      }
-      case BRepExtrema_IsOnEdge: {
-        TopoDS_Edge edge = TopoDS::Edge( extrema.SupportOnShape2(1));
-        Handle(Geom2d_Curve) pcurve = BRep_Tool::CurveOnSurface( edge, face, f,l );
-        extrema.ParOnEdgeS2( 1, u );
-        gp_Pnt2d uv = pcurve->Value( u );
-        u = uv.Coord(1);
-        v = uv.Coord(2);
-        break;
-      }
-      case BRepExtrema_IsVertex: return defaultNorm;
-      }
-      // get derivatives
-      BRepAdaptor_Surface surface( face, false );
-      gp_Vec du, dv; gp_Pnt p;
-      surface.D1( u, v, p, du, dv );
-
-      return du ^ dv;
-
-    } catch (Standard_Failure ) {
-    }
-    return defaultNorm;
-  }
-}
-
 //=============================================================================
 /*!
  *  case GetInPlace:
@@ -3840,119 +4317,47 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
 
   TopoDS_Shape aWhere = theShapeWhere->GetValue();
   TopoDS_Shape aWhat  = theShapeWhat->GetValue();
-  TopoDS_Shape aPntShape;
-  TopoDS_Vertex aVertex;
 
   if (aWhere.IsNull() || aWhat.IsNull()) {
     SetErrorCode("Error: aWhere and aWhat TopoDS_Shape are Null.");
     return NULL;
   }
 
-  Handle(GEOM_Function) aWhereFunction = theShapeWhere->GetLastFunction();
-  if (aWhereFunction.IsNull()) {
-    SetErrorCode("Error: aWhereFunction is Null.");
-    return NULL;
-  }
-
-  TopTools_IndexedMapOfShape aWhereIndices;
-  TopExp::MapShapes(aWhere, aWhereIndices);
-
-  TopAbs_ShapeEnum iType = TopAbs_SOLID;
-  Standard_Real    dl_l = 1e-3;
-  Standard_Real    min_l, Tol_0D, Tol_1D, Tol_2D, Tol_3D, Tol_Mass;
-  Standard_Real    aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
-  Bnd_Box          BoundingBox;
-  gp_Pnt           aPnt, aPnt_aWhat, tab_Pnt[2];
-  GProp_GProps     aProps;
-
-  // Find the iType of the aWhat shape
-  iType = GEOMUtils::GetTypeOfSimplePart(aWhat);
-  if (iType == TopAbs_SHAPE) {
-    SetErrorCode("Error: An attempt to extract a shape of not supported type.");
-    return NULL;
-  }
-
-  TopExp_Explorer Exp_aWhat  ( aWhat,  iType );
-  TopExp_Explorer Exp_aWhere ( aWhere, iType );
-  TopExp_Explorer Exp_Edge   ( aWhere, TopAbs_EDGE );
-
-  // Find the shortest edge in theShapeWhere shape
-  BRepBndLib::Add(aWhere, BoundingBox);
-  BoundingBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
-  min_l = fabs(aXmax - aXmin);
-  if( min_l < fabs(aYmax - aYmin) ) min_l = fabs(aYmax - aYmin);
-  if( min_l < fabs(aZmax - aZmin) ) min_l = fabs(aZmax - aZmin);
-
-  // Mantis issue 0020908 BEGIN
-  if (!Exp_Edge.More()) {
-    min_l = Precision::Confusion();
-  }
-  // Mantis issue 0020908 END
-  for ( Standard_Integer nbEdge = 0; Exp_Edge.More(); Exp_Edge.Next(), nbEdge++ ) {
-    TopExp_Explorer Exp_Vertex( Exp_Edge.Current(), TopAbs_VERTEX);
-    for ( Standard_Integer nbVertex = 0; Exp_Vertex.More(); Exp_Vertex.Next(), nbVertex++ ) {
-      aPnt = BRep_Tool::Pnt( TopoDS::Vertex( Exp_Vertex.Current() ) );
-      tab_Pnt[nbVertex] = aPnt;
-    }
-    if ( ! tab_Pnt[0].IsEqual(tab_Pnt[1], dl_l) ) {
-      BRepGProp::LinearProperties(Exp_Edge.Current(), aProps);
-      if ( aProps.Mass() < min_l ) min_l = aProps.Mass();
-    }
-  }
-  min_l *= dl_l;
-
-  // Compute tolerances
-  Tol_0D = dl_l;
-  Tol_1D = dl_l * min_l;
-  Tol_2D = dl_l * ( min_l * min_l) * ( 2. + dl_l);
-  Tol_3D = dl_l * ( min_l * min_l * min_l ) * ( 3. + (3 * dl_l) + (dl_l * dl_l) );
-
-  if (Tol_0D < Precision::Confusion()) Tol_0D = Precision::Confusion();
-  if (Tol_1D < Precision::Confusion()) Tol_1D = Precision::Confusion();
-  if (Tol_2D < Precision::Confusion()) Tol_2D = Precision::Confusion();
-  if (Tol_3D < Precision::Confusion()) Tol_3D = Precision::Confusion();
-
-  Tol_Mass = Tol_3D;
-  if ( iType == TopAbs_VERTEX )    Tol_Mass = Tol_0D;
-  else if ( iType == TopAbs_EDGE ) Tol_Mass = Tol_1D;
-  else if ( iType == TopAbs_FACE ) Tol_Mass = Tol_2D;
-
   // Searching for the sub-shapes inside the ShapeWhere shape
   GEOMAlgo_GetInPlace aGIP;
-  aGIP.SetTolerance(Tol_1D);
-  aGIP.SetTolMass(Tol_Mass);
-  aGIP.SetTolCG(Tol_1D);
 
-  aGIP.SetArgument(aWhat);
-  aGIP.SetShapeWhere(aWhere);
-
-  aGIP.Perform();
-  int iErr = aGIP.ErrorStatus();
-  if (iErr) {
+  if (!GEOMAlgo_GetInPlaceAPI::GetInPlace(aWhere, aWhat, aGIP)) {
     SetErrorCode("Error in GEOMAlgo_GetInPlace");
     return NULL;
   }
 
-  // aGIP.IsFound() returns true only when the whole theShapeWhat
-  // is found (as one shape or several parts). But we are also interested
-  // in the partial result, that is why this check is commented.
-  //if (!aGIP.IsFound()) {
-  //  SetErrorCode(NOT_FOUND_ANY);
-  //  return NULL;
-  //}
-
   // Add direct result.
-  TopTools_ListOfShape  aLSA;
-  const TopoDS_Shape   &aShapeResult = aGIP.Result();
-  TopTools_MapOfShape   aMFence;
+  TopTools_ListOfShape        aLSA;
+  const TopoDS_Shape         &aShapeResult = aGIP.Result();
+  TopTools_MapOfShape         aMFence;
+  TopTools_IndexedMapOfShape  aWhereIndices;
+  Standard_Integer            aShapeType = -1;
+
+  TopExp::MapShapes(aWhere, aWhereIndices);
 
   if (aShapeResult.IsNull() == Standard_False) {
-    TopoDS_Iterator anIt(aShapeResult);
+    TopoDS_Iterator  anIt(aShapeResult);
+    Standard_Boolean isFirst = Standard_True;
 
     for (; anIt.More(); anIt.Next()) {
       const TopoDS_Shape &aPart = anIt.Value();
 
       if(aWhereIndices.Contains(aPart) && aMFence.Add(aPart)) {
+        const TopAbs_ShapeEnum aType = aPart.ShapeType();
+
+        if (aShapeType == -1) {
+          // Initialization.
+          aShapeType = aType;
+        } else if (aShapeType != TopAbs_SHAPE && aShapeType != aType) {
+          // Different types.
+          aShapeType = TopAbs_SHAPE;
+        }
+
         aLSA.Append(aPart);
       }
     }
@@ -3966,13 +4371,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
   Handle(TColStd_HArray1OfInteger) aModifiedArray = new TColStd_HArray1OfInteger (1, aLSA.Extent());
   TopTools_ListIteratorOfListOfShape anIterModif (aLSA);
   for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++) {
-    if (aWhereIndices.Contains(anIterModif.Value())) {
-      aModifiedArray->SetValue(imod, aWhereIndices.FindIndex(anIterModif.Value()));
-    }
-    else {
-      SetErrorCode("Error: wrong sub-shape returned");
-      return NULL;
-    }
+    aModifiedArray->SetValue(imod, aWhereIndices.FindIndex(anIterModif.Value()));
   }
 
   //Add a new object
@@ -3982,7 +4381,10 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
     return NULL;
   }
 
-  if (aModifiedArray->Length() > 1 || theShapeWhat->GetType() == GEOM_GROUP) {
+  const Standard_Boolean isSameType = (aShapeType != TopAbs_SHAPE);
+
+  if ((aModifiedArray->Length() > 1 && isSameType) ||
+      theShapeWhat->GetType() == GEOM_GROUP) {
     //Set a GROUP type
     aResult->SetType(GEOM_GROUP);
 
@@ -4010,207 +4412,78 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlace (Handle(GEOM_Object)
  *  default:
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceOld (Handle(GEOM_Object) theShapeWhere,
-                                                               Handle(GEOM_Object) theShapeWhat)
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceOld
+                            (Handle(GEOM_Object) theShapeWhere,
+                             Handle(GEOM_Object) theShapeWhat)
 {
   SetErrorCode(KO);
 
   if (theShapeWhere.IsNull() || theShapeWhat.IsNull()) return NULL;
 
-  TopoDS_Shape aWhere = theShapeWhere->GetValue();
-  TopoDS_Shape aWhat  = theShapeWhat->GetValue();
-  TopoDS_Shape aPntShape;
-  TopoDS_Vertex aVertex;
+  TopoDS_Shape           aWhere = theShapeWhere->GetValue();
+  TopoDS_Shape           aWhat  = theShapeWhat->GetValue();
+  TopTools_ListOfShape   aModifiedList;
+  const Standard_Integer iErr   =
+    GEOMAlgo_GetInPlaceAPI::GetInPlaceOld(aWhere, aWhat, aModifiedList);
 
-  if (aWhere.IsNull() || aWhat.IsNull()) {
-    SetErrorCode("Error: aWhere and aWhat TopoDS_Shape are Null.");
-    return NULL;
-  }
+  if (iErr) {
+    switch (iErr) {
+      case 1:
+        SetErrorCode("Error: aWhere and aWhat TopoDS_Shape are Null.");
+        break;
+      case 2:
+        SetErrorCode
+          ("Error: An attempt to extract a shape of not supported type.");
+        break;
+      case 3:
+        SetErrorCode(NOT_FOUND_ANY);
+        break;
+      default:
+        SetErrorCode("Shape driver failed");
+        break;
+    }
 
-  Handle(GEOM_Function) aWhereFunction = theShapeWhere->GetLastFunction();
-  if (aWhereFunction.IsNull()) {
-    SetErrorCode("Error: aWhereFunction is Null.");
     return NULL;
   }
 
   TopTools_IndexedMapOfShape aWhereIndices;
   TopExp::MapShapes(aWhere, aWhereIndices);
 
-  TColStd_ListOfInteger aModifiedList;
-  Standard_Integer aWhereIndex;
-  Handle(TColStd_HArray1OfInteger) aModifiedArray;
-  Handle(GEOM_Object) aResult;
-
-  bool isFound = false;
-  TopAbs_ShapeEnum iType = TopAbs_SOLID;
-  //Standard_Real    aWhat_Mass = 0., aWhere_Mass = 0.;
-  Standard_Real    tab_aWhat[4],    tab_aWhere[4];
-  Standard_Real    dl_l = 1e-3;
-  Standard_Real    min_l, Tol_0D, Tol_1D, Tol_2D, Tol_3D, Tol_Mass;
-  Standard_Real    aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
-  Bnd_Box          BoundingBox;
-  gp_Pnt           aPnt, aPnt_aWhat, tab_Pnt[2];
-  GProp_GProps     aProps;
-
-  // Find the iType of the aWhat shape
-  /*
-  if      ( aWhat.ShapeType() == TopAbs_VERTEX )                                         iType = TopAbs_VERTEX;
-  else if ( aWhat.ShapeType() == TopAbs_EDGE  || aWhat.ShapeType() == TopAbs_WIRE )      iType = TopAbs_EDGE;
-  else if ( aWhat.ShapeType() == TopAbs_FACE  || aWhat.ShapeType() == TopAbs_SHELL )     iType = TopAbs_FACE;
-  else if ( aWhat.ShapeType() == TopAbs_SOLID || aWhat.ShapeType() == TopAbs_COMPSOLID ) iType = TopAbs_SOLID;
-  else if ( aWhat.ShapeType() == TopAbs_COMPOUND ) {
-    // Only the iType of the first shape in the compound is taken into account
-    TopoDS_Iterator It (aWhat, Standard_False, Standard_False);
-    if ( !It.More() ) {
-      SetErrorCode("Error: theShapeWhat is an empty COMPOUND.");
-      return NULL;
-    }
-    TopAbs_ShapeEnum compType = It.Value().ShapeType();
-    if      ( compType == TopAbs_VERTEX )                               iType = TopAbs_VERTEX;
-    else if ( compType == TopAbs_EDGE  || compType == TopAbs_WIRE )     iType = TopAbs_EDGE;
-    else if ( compType == TopAbs_FACE  || compType == TopAbs_SHELL)     iType = TopAbs_FACE;
-    else if ( compType == TopAbs_SOLID || compType == TopAbs_COMPSOLID) iType = TopAbs_SOLID;
-  }
-  else {
-    SetErrorCode("Error: An attempt to extract a shape of not supported type.");
-    return NULL;
-  }
-  */
-  iType = GEOMUtils::GetTypeOfSimplePart(aWhat);
-  if (iType == TopAbs_SHAPE) {
-    SetErrorCode("Error: An attempt to extract a shape of not supported type.");
-    return NULL;
-  }
-
-  TopExp_Explorer Exp_aWhat  ( aWhat,  iType );
-  TopExp_Explorer Exp_aWhere ( aWhere, iType );
-  TopExp_Explorer Exp_Edge   ( aWhere, TopAbs_EDGE );
-
-  // Find the shortest edge in theShapeWhere shape
-  BRepBndLib::Add(aWhere, BoundingBox);
-  BoundingBox.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
-  min_l = fabs(aXmax - aXmin);
-  if( min_l < fabs(aYmax - aYmin) ) min_l = fabs(aYmax - aYmin);
-  if( min_l < fabs(aZmax - aZmin) ) min_l = fabs(aZmax - aZmin);
-  min_l /= dl_l;
-  // Mantis issue 0020908 BEGIN
-  if (!Exp_Edge.More()) {
-    min_l = Precision::Confusion();
-  }
-  // Mantis issue 0020908 END
-  for ( Standard_Integer nbEdge = 0; Exp_Edge.More(); Exp_Edge.Next(), nbEdge++ ) {
-    TopExp_Explorer Exp_Vertex( Exp_Edge.Current(), TopAbs_VERTEX);
-    for ( Standard_Integer nbVertex = 0; Exp_Vertex.More(); Exp_Vertex.Next(), nbVertex++ ) {
-      aPnt = BRep_Tool::Pnt( TopoDS::Vertex( Exp_Vertex.Current() ) );
-      tab_Pnt[nbVertex] = aPnt;
-    }
-    if ( ! tab_Pnt[0].IsEqual(tab_Pnt[1], dl_l) ) {
-      BRepGProp::LinearProperties(Exp_Edge.Current(), aProps);
-      if ( aProps.Mass() < min_l ) min_l = aProps.Mass();
-    }
-  }
-
-  // Compute tolerances
-  Tol_0D = dl_l;
-  Tol_1D = dl_l * min_l;
-  Tol_2D = dl_l * ( min_l * min_l) * ( 2. + dl_l);
-  Tol_3D = dl_l * ( min_l * min_l * min_l ) * ( 3. + (3 * dl_l) + (dl_l * dl_l) );
-
-  if (Tol_0D < Precision::Confusion()) Tol_0D = Precision::Confusion();
-  if (Tol_1D < Precision::Confusion()) Tol_1D = Precision::Confusion();
-  if (Tol_2D < Precision::Confusion()) Tol_2D = Precision::Confusion();
-  if (Tol_3D < Precision::Confusion()) Tol_3D = Precision::Confusion();
-
-  //if (Tol_1D > 1.0) Tol_1D = 1.0;
-  //if (Tol_2D > 1.0) Tol_2D = 1.0;
-  //if (Tol_3D > 1.0) Tol_3D = 1.0;
-
-  Tol_Mass = Tol_3D;
-  if ( iType == TopAbs_VERTEX )    Tol_Mass = Tol_0D;
-  else if ( iType == TopAbs_EDGE ) Tol_Mass = Tol_1D;
-  else if ( iType == TopAbs_FACE ) Tol_Mass = Tol_2D;
-
-  // Compute the ShapeWhat Mass
-  /*
-  for ( ; Exp_aWhat.More(); Exp_aWhat.Next() ) {
-    if ( iType == TopAbs_VERTEX ) {
-      aWhat_Mass += 1;
-      continue;
-    }
-    else if ( iType == TopAbs_EDGE ) BRepGProp::LinearProperties(Exp_aWhat.Current(),  aProps);
-    else if ( iType == TopAbs_FACE ) BRepGProp::SurfaceProperties(Exp_aWhat.Current(), aProps);
-    else                             BRepGProp::VolumeProperties(Exp_aWhat.Current(),  aProps);
-    aWhat_Mass += aProps.Mass();
-  }
-  */
-
-  // Searching for the sub-shapes inside the ShapeWhere shape
-  TopTools_MapOfShape map_aWhere;
-  for ( Exp_aWhere.ReInit(); Exp_aWhere.More(); Exp_aWhere.Next() ) {
-    if (!map_aWhere.Add(Exp_aWhere.Current()))
-      continue; // skip repeated shape to avoid mass addition
-    GetShapeProperties( Exp_aWhere.Current(), tab_aWhere, aPnt );
-    for ( Exp_aWhat.ReInit(); Exp_aWhat.More(); Exp_aWhat.Next() ) {
-      GetShapeProperties( Exp_aWhat.Current(), tab_aWhat, aPnt_aWhat );
-      if ( fabs(tab_aWhat[3] - tab_aWhere[3]) <= Tol_Mass && aPnt_aWhat.Distance(aPnt) <= Tol_1D )
-        isFound = true;
-      else {
-        if ( (tab_aWhat[3] - tab_aWhere[3]) > Tol_Mass ) {
-          aPntShape = BRepBuilderAPI_MakeVertex( aPnt ).Shape();
-          aVertex   = TopoDS::Vertex( aPntShape );
-          BRepExtrema_DistShapeShape aWhereDistance ( aVertex, Exp_aWhere.Current() );
-          BRepExtrema_DistShapeShape aWhatDistance  ( aVertex, Exp_aWhat.Current() );
-          if ( aWhereDistance.IsDone() && aWhatDistance.IsDone() &&
-               fabs(aWhereDistance.Value() - aWhatDistance.Value()) <= Tol_1D )
-          {
-            // 0020162: "EDF 961 GEOM : Getinplace is getting additionnal orthogonal faces"
-            // aVertex must be projected to the same point on Where and on What
-            gp_Pnt pOnWhat  = aWhatDistance.PointOnShape2(1);
-            gp_Pnt pOnWhere = aWhereDistance.PointOnShape2(1);
-            isFound = ( pOnWhat.Distance(pOnWhere) <= Tol_1D );
-            if ( isFound && iType == TopAbs_FACE )
-            {
-              // check normals at pOnWhat and pOnWhere
-              const double angleTol = M_PI/180.;
-              gp_Vec normToWhat  = GetNormal( TopoDS::Face(Exp_aWhat.Current()), aWhatDistance);
-              gp_Vec normToWhere = GetNormal( TopoDS::Face(Exp_aWhere.Current()), aWhereDistance);
-              if ( normToWhat * normToWhere < 0 )
-                normToWhat.Reverse();
-              isFound = ( normToWhat.Angle( normToWhere ) < angleTol );
-            }
-          }
-        }
-      }
-      if ( isFound ) {
-        aWhereIndex = aWhereIndices.FindIndex(Exp_aWhere.Current());
-        aModifiedList.Append(aWhereIndex);
-        //aWhere_Mass += tab_aWhere[3];
-        isFound = false;
-        break;
-      }
+  Handle(TColStd_HArray1OfInteger)   aModifiedArray =
+    new TColStd_HArray1OfInteger (1, aModifiedList.Extent());
+  TopTools_ListIteratorOfListOfShape anIterModif (aModifiedList);
+  Standard_Integer                   imod;
+  Standard_Integer                   aShapeType = -1;
+
+  for (imod = 1; anIterModif.More(); anIterModif.Next(), imod++) {
+    const Standard_Integer anIndex =
+      aWhereIndices.FindIndex(anIterModif.Value());
+    const TopAbs_ShapeEnum aType   = anIterModif.Value().ShapeType();
+
+    if (aShapeType == -1) {
+      // Initialization.
+      aShapeType = aType;
+    } else if (aShapeType != TopAbs_SHAPE && aShapeType != aType) {
+      // Different types.
+      aShapeType = TopAbs_SHAPE;
     }
-    //if ( fabs( aWhat_Mass - aWhere_Mass ) <= Tol_Mass )
-      //break;
-  }
 
-  if (aModifiedList.Extent() == 0) { // Not found any Results
-    SetErrorCode(NOT_FOUND_ANY);
-    return NULL;
+    aModifiedArray->SetValue(imod, anIndex);
   }
 
-  aModifiedArray = new TColStd_HArray1OfInteger (1, aModifiedList.Extent());
-  TColStd_ListIteratorOfListOfInteger anIterModif (aModifiedList);
-  for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++)
-    aModifiedArray->SetValue(imod, anIterModif.Value());
-
   //Add a new object
-  aResult = GetEngine()->AddSubShape(theShapeWhere, aModifiedArray);
+  Handle(GEOM_Object) aResult =
+    GetEngine()->AddSubShape(theShapeWhere, aModifiedArray);
+
   if (aResult.IsNull()) {
     SetErrorCode("Error in algorithm: result found, but cannot be returned.");
     return NULL;
   }
 
-  if (aModifiedArray->Length() > 1 || theShapeWhat->GetType() == GEOM_GROUP) {
+  const Standard_Boolean isSameType = (aShapeType != TopAbs_SHAPE);
+
+  if ((aModifiedArray->Length() > 1 && isSameType) ||
+      theShapeWhat->GetType() == GEOM_GROUP) {
     //Set a GROUP type
     aResult->SetType(GEOM_GROUP);
 
@@ -4229,6 +4502,7 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceOld (Handle(GEOM_Objec
     << theShapeWhere << ", " << theShapeWhat << ", False)";
 
   SetErrorCode(OK);
+
   return aResult;
 }
 
@@ -4254,50 +4528,40 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceByHistory
 
   //Fill array of indices
   TopTools_IndexedMapOfShape aWhereIndices;
+
   TopExp::MapShapes(aWhere, aWhereIndices);
 
   // process shape
-  TColStd_ListOfInteger aModifiedList;
-  bool isFound = GetInPlaceOfShape(aWhereFunction, aWhereIndices, aWhat, aModifiedList);
+  TopTools_ListOfShape aModifiedList;
+  bool isFound = GEOMAlgo_GetInPlaceAPI::GetInPlaceByHistory
+    (aWhereFunction, aWhereIndices, aWhat, aModifiedList);
 
   if (!isFound || aModifiedList.Extent() < 1) {
     SetErrorCode("Error: No history found for the sought shape or its sub-shapes.");
     return NULL;
   }
 
-  Standard_Integer nbFound = aModifiedList.Extent();
-  TColStd_ListIteratorOfListOfInteger anIterModif (aModifiedList);
-  if ( nbFound > 1 )
-  {
-    // remove sub-shapes inappropriate for group creation
-    TopAbs_ShapeEnum subType = TopAbs_SHAPE;
-    while ( anIterModif.More() ) {
-      TopAbs_ShapeEnum type = aWhereIndices( anIterModif.Value() ).ShapeType();
-      bool okForGroup = ( type == TopAbs_VERTEX || type == TopAbs_EDGE ||
-                          type == TopAbs_FACE   || type == TopAbs_SOLID );
-      if ( okForGroup ) {
-        if ( subType == TopAbs_SHAPE )
-          subType = type;
-        else
-          okForGroup = ( subType == type );
-      }
-      if ( okForGroup )
-        anIterModif.Next();
-      else
-        aModifiedList.Remove( anIterModif );
-      nbFound -= ( !okForGroup );
-    }
-    if ( nbFound == 0 ) {
-      SetErrorCode("Error: result found but it's type is inappropriate for group creation.");
-      return NULL;
+  Handle(TColStd_HArray1OfInteger)   aModifiedArray =
+    new TColStd_HArray1OfInteger (1, aModifiedList.Extent());
+  TopTools_ListIteratorOfListOfShape anIterModif (aModifiedList);
+  Standard_Integer                   imod;
+  Standard_Integer                   aShapeType = -1;
+
+  for (imod = 1; anIterModif.More(); anIterModif.Next(), imod++) {
+    const Standard_Integer anIndex =
+      aWhereIndices.FindIndex(anIterModif.Value());
+    const TopAbs_ShapeEnum aType   = anIterModif.Value().ShapeType();
+
+    if (aShapeType == -1) {
+      // Initialization.
+      aShapeType = aType;
+    } else if (aShapeType != TopAbs_SHAPE && aShapeType != aType) {
+      // Different types.
+      aShapeType = TopAbs_SHAPE;
     }
-  }
 
-  Handle(TColStd_HArray1OfInteger) aModifiedArray =
-    new TColStd_HArray1OfInteger( 1, nbFound );
-  anIterModif.Initialize(aModifiedList);
-  for (Standard_Integer imod = 1; anIterModif.More(); anIterModif.Next(), imod++)
-    aModifiedArray->SetValue(imod, anIterModif.Value());
+    aModifiedArray->SetValue(imod, anIndex);
+  }
 
   //Add a new object
   Handle(GEOM_Object) aResult = GetEngine()->AddSubShape(theShapeWhere, aModifiedArray);
@@ -4306,7 +4570,10 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceByHistory
     return NULL;
   }
 
-  if (aModifiedArray->Length() > 1) {
+  const Standard_Boolean isSameType = (aShapeType != TopAbs_SHAPE);
+
+  if ((aModifiedArray->Length() > 1 && isSameType) ||
+      theShapeWhat->GetType() == GEOM_GROUP) {
     //Set a GROUP type
     aResult->SetType(GEOM_GROUP);
 
@@ -4328,8 +4595,6 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetInPlaceByHistory
   return aResult;
 }
 
-#define MAX_TOLERANCE 1.e-7
-
 //=======================================================================
 //function : isSameEdge
 //purpose  : Returns True if two edges coincide
@@ -4364,7 +4629,6 @@ static bool isSameEdge(const TopoDS_Edge& theEdge1, const TopoDS_Edge& theEdge2)
   double U11, U12, U21, U22;
   Handle(Geom_Curve) C1 = BRep_Tool::Curve(theEdge1, U11, U12);
   Handle(Geom_Curve) C2 = BRep_Tool::Curve(theEdge2, U21, U22);
-  if(C1->DynamicType() == C2->DynamicType()) return true;
 
   //Check that both edges has the same geometry
   double range = U12-U11;
@@ -4373,6 +4637,8 @@ static bool isSameEdge(const TopoDS_Edge& theEdge1, const TopoDS_Edge& theEdge2)
   U = U11+range*2.0/3.0;
   gp_Pnt P2 = C1->Value(U);     //Compute a point on two thirds of the edge's length
 
+  C2 = new Geom_TrimmedCurve(C2, U21, U22);
+
   if(!GeomLib_Tool::Parameter(C2, P1, MAX_TOLERANCE, U) ||  U < U21 || U > U22)
     return false;
 
@@ -4581,17 +4847,8 @@ Handle(GEOM_Object) GEOMImpl_IShapesOperations::GetSame(const Handle(GEOM_Object
 
   switch (aWhat.ShapeType()) {
     case TopAbs_VERTEX: {
-      gp_Pnt P = BRep_Tool::Pnt(TopoDS::Vertex(aWhat));
-      TopExp_Explorer E(aWhere, TopAbs_VERTEX);
-      for(; E.More(); E.Next()) {
-        if(!aMap.Add(E.Current())) continue;
-        gp_Pnt P2 = BRep_Tool::Pnt(TopoDS::Vertex(E.Current()));
-        if(P.Distance(P2) <= MAX_TOLERANCE) {
-          isFound = true;
-          aSubShape = E.Current();
-          break;
-        }
-      }
+      aSubShape = getSameVertex(aWhere, TopoDS::Vertex(aWhat));
+      isFound   = !aSubShape.IsNull();
       break;
                         }
     case TopAbs_EDGE: {
@@ -4765,3 +5022,199 @@ Handle(TColStd_HSequenceOfInteger) GEOMImpl_IShapesOperations::GetSameIDs
     return NULL;
   }
 }
+
+//=======================================================================
+//function : ExtendEdge
+//purpose  :
+//=======================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::ExtendEdge
+                                      (const Handle(GEOM_Object) &theEdge,
+                                       const Standard_Real        theMin,
+                                       const Standard_Real        theMax)
+{
+  SetErrorCode(KO);
+
+  if (theEdge.IsNull()) {
+    return NULL;
+  }
+
+  //Add a new Edge object
+  Handle(GEOM_Object) aResEdge = GetEngine()->AddObject(GetDocID(), GEOM_EDGE);
+
+  //Add a new Vector function
+  Handle(GEOM_Function) aFunction =
+    aResEdge->AddFunction(GEOMImpl_ShapeDriver::GetID(), EDGE_UV);
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) {
+    return NULL;
+  }
+
+  GEOMImpl_IShapeExtend aCI (aFunction);
+
+  Handle(GEOM_Function) anEdge = theEdge->GetLastFunction();
+
+  if (anEdge.IsNull()) {
+    return NULL;
+  }
+
+  aCI.SetShape(anEdge);
+  aCI.SetUMin(theMin);
+  aCI.SetUMax(theMax);
+
+  //Compute the Edge value
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Shape driver failed");
+
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction)
+             << aResEdge  << " = geompy.ExtendEdge("
+             << theEdge << ", " << theMin << ", " << theMax << ")";
+
+  SetErrorCode(OK);
+
+  return aResEdge;
+}
+
+//=======================================================================
+//function : ExtendFace
+//purpose  :
+//=======================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::ExtendFace
+                                      (const Handle(GEOM_Object) &theFace,
+                                       const Standard_Real        theUMin,
+                                       const Standard_Real        theUMax,
+                                       const Standard_Real        theVMin,
+                                       const Standard_Real        theVMax)
+{
+  SetErrorCode(KO);
+
+  if (theFace.IsNull()) {
+    return NULL;
+  }
+
+  //Add a new Face object
+  Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+
+  //Add a new Vector function
+  Handle(GEOM_Function) aFunction =
+    aResFace->AddFunction(GEOMImpl_ShapeDriver::GetID(), FACE_UV);
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) {
+    return NULL;
+  }
+
+  GEOMImpl_IShapeExtend aCI (aFunction);
+
+  Handle(GEOM_Function) aFace = theFace->GetLastFunction();
+
+  if (aFace.IsNull()) {
+    return NULL;
+  }
+
+  aCI.SetShape(aFace);
+  aCI.SetUMin(theUMin);
+  aCI.SetUMax(theUMax);
+  aCI.SetVMin(theVMin);
+  aCI.SetVMax(theVMax);
+
+  //Compute the Face value
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Shape driver failed");
+
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction)
+             << aResFace  << " = geompy.ExtendFace("
+             << theFace << ", " << theUMin << ", " << theUMax << ", "
+             << theVMin << ", " << theVMax << ")";
+
+  SetErrorCode(OK);
+
+  return aResFace;
+}
+
+//=======================================================================
+//function : MakeSurfaceFromFace
+//purpose  :
+//=======================================================================
+Handle(GEOM_Object) GEOMImpl_IShapesOperations::MakeSurfaceFromFace
+                                      (const Handle(GEOM_Object) &theFace)
+{
+  SetErrorCode(KO);
+
+  if (theFace.IsNull()) {
+    return NULL;
+  }
+
+  //Add a new Face object
+  Handle(GEOM_Object) aResFace = GetEngine()->AddObject(GetDocID(), GEOM_FACE);
+
+  //Add a new Vector function
+  Handle(GEOM_Function) aFunction =
+    aResFace->AddFunction(GEOMImpl_ShapeDriver::GetID(), SURFACE_FROM_FACE);
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_ShapeDriver::GetID()) {
+    return NULL;
+  }
+
+  GEOMImpl_IShapeExtend aCI (aFunction);
+
+  Handle(GEOM_Function) aFace = theFace->GetLastFunction();
+
+  if (aFace.IsNull()) {
+    return NULL;
+  }
+
+  aCI.SetShape(aFace);
+
+  //Compute the Face value
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Shape driver failed");
+
+      return NULL;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+
+    return NULL;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction)
+             << aResFace  << " = geompy.MakeSurfaceFromFace("
+             << theFace << ")";
+
+  SetErrorCode(OK);
+
+  return aResFace;
+}
index d12642a36ed980a532aedc92e631867acd4d69a6..d8e4f9fb21606071fd9146a6282c088ddf210850 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include "GEOM_IOperations.hxx"
 
 #include "GEOMAlgo_State.hxx"
+#include "GEOMUtils.hxx"
 
-#include <TopoDS_Shape.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <NCollection_DataMap.hxx>
 #include <TColStd_HSequenceOfTransient.hxx>
 #include <TColStd_HSequenceOfInteger.hxx>
 
-#include <Handle_Geom_Surface.hxx>
-
-#include <gp_Pnt.hxx>
+#include <Geom_Surface.hxx>
 
 #include <list>
-#include <functional>
 
 class GEOM_Engine;
 class Handle(GEOM_Object);
 class Handle(TColStd_HArray1OfInteger);
+class TopoDS_Shape;
 
 class GEOMImpl_IShapesOperations : public GEOM_IOperations
 {
@@ -85,40 +81,46 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
   Standard_EXPORT Handle(GEOM_Object) MakeFaceWires (std::list<Handle(GEOM_Object)> theWires,
                                                      const bool isPlanarWanted);
 
+  Standard_EXPORT Handle(GEOM_Object) MakeFaceFromSurface
+                                              (Handle(GEOM_Object) theFace,
+                                               Handle(GEOM_Object) theWire);
+                                               
+  Standard_EXPORT Handle(GEOM_Object) MakeFaceWithConstraints (std::list<Handle(GEOM_Object)> theConstraints);
+
   Standard_EXPORT Handle(GEOM_Object) MakeShell (std::list<Handle(GEOM_Object)> theShapes);
 
   Standard_EXPORT Handle(GEOM_Object) MakeSolidShells (std::list<Handle(GEOM_Object)> theShells);
 
   Standard_EXPORT Handle(GEOM_Object) MakeCompound (std::list<Handle(GEOM_Object)> theShapes);
 
-  Standard_EXPORT Handle(GEOM_Object) MakeGlueFaces (Handle(GEOM_Object) theShape,
+  Standard_EXPORT Handle(GEOM_Object) MakeSolidFromConnectedFaces (std::list<Handle(GEOM_Object)> theFacesOrShells,
+                                                                   const Standard_Boolean isIntersect);
+
+  Standard_EXPORT Handle(GEOM_Object) MakeGlueFaces (std::list< Handle(GEOM_Object) >& theShapes,
                                                      const Standard_Real theTolerance,
                                                      const Standard_Boolean doKeepNonSolids);
 
-  //Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueFaces (Handle(GEOM_Object) theShape,
-  //                                                                   const Standard_Real theTolerance);
-
-  Standard_EXPORT Handle(GEOM_Object) MakeGlueFacesByList (Handle(GEOM_Object) theShape,
+  Standard_EXPORT Handle(GEOM_Object) MakeGlueFacesByList (std::list< Handle(GEOM_Object) >& theShapes,
                                                            const Standard_Real theTolerance,
-                                                           std::list<Handle(GEOM_Object)> theFaces,
+                                                           std::list<Handle(GEOM_Object)>& theFaces,
                                                            const Standard_Boolean doKeepNonSolids,
                                                            const Standard_Boolean doGlueAllEdges);
 
-  Standard_EXPORT Handle(GEOM_Object) MakeGlueEdges (Handle(GEOM_Object) theShape,
+  Standard_EXPORT Handle(GEOM_Object) MakeGlueEdges (std::list< Handle(GEOM_Object) >& theShapes,
                                                      const Standard_Real theTolerance);
 
-  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueShapes (Handle(GEOM_Object) theShape,
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetGlueShapes (std::list< Handle(GEOM_Object) >& theShapes,
                                                                       const Standard_Real theTolerance,
                                                                       const TopAbs_ShapeEnum theType);
 
-  Standard_EXPORT Handle(GEOM_Object) MakeGlueEdgesByList (Handle(GEOM_Object) theShape,
+  Standard_EXPORT Handle(GEOM_Object) MakeGlueEdgesByList (std::list< Handle(GEOM_Object) >& theShapes,
                                                            const Standard_Real theTolerance,
-                                                           std::list<Handle(GEOM_Object)> theEdges);
+                                                           std::list<Handle(GEOM_Object)> theEdges);
 
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects(Handle(GEOM_Object)    theShape,
-                                                                            const Standard_Boolean theGroupsOnly);
+                                                                             const Standard_Boolean theGroupsOnly);
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetExistingSubObjects(Handle(GEOM_Object)    theShape,
-                                                                            const Standard_Integer theTypes = All);
+                                                                             const Standard_Integer theTypes = All);
   
   enum ExplodeType {
     EXPLODE_OLD_INCLUDE_MAIN,
@@ -156,6 +158,11 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
 
   Standard_EXPORT TCollection_AsciiString GetShapeTypeString (Handle(GEOM_Object) theShape);
 
+  Standard_EXPORT Standard_Boolean IsSubShapeBelongsTo(Handle(GEOM_Object) theSubObject,
+                                                       const Standard_Integer theSubObjectIndex,
+                                                       Handle(GEOM_Object) theObject,
+                                                       const Standard_Integer theObjectIndex);
+
   Standard_EXPORT Standard_Integer NumberOfSubShapes (Handle(GEOM_Object)    theShape,
                                                       const Standard_Integer theShapeType);
 
@@ -169,8 +176,9 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
                      const Standard_Integer theShapeType);
 
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
-    GetSharedShapes (std::list<Handle(GEOM_Object)> theShapes,
-                     const Standard_Integer         theShapeType);
+    GetSharedShapes (std::list<Handle(GEOM_Object)>& theShapes,
+                     const Standard_Integer          theShapeType,
+                     const bool                      theMultiShare = true);
 
   Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
     GetShapesOnPlane (const Handle(GEOM_Object)& theShape,
@@ -293,8 +301,6 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
                                                             Handle(GEOM_Object)    theCenter,
                                                             const Standard_Real    theRadius);
 
-  void GetShapeProperties(const TopoDS_Shape aShape, Standard_Real propertiesArray[], gp_Pnt & aPnt);
-
   Standard_EXPORT Handle(GEOM_Object) GetInPlace (Handle(GEOM_Object) theShapeWhere,
                                                   Handle(GEOM_Object) theShapeWhat);
 
@@ -383,6 +389,87 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
                                        const Standard_Integer theShapeType,
                                        GEOMAlgo_State theState);
 
+  /*!
+   * \brief Resize the input edge with the new Min and Max parameters.
+   * The input edge parameters range is [0, 1]. If theMin parameter is
+   * negative, the input edge is extended, otherwise it is shrinked by
+   * theMin parameter. If theMax is greater than 1, the edge is extended,
+   * otherwise it is shrinked by theMax parameter
+   * \param theEdge the input edge to be resized
+   * \param theMin the minimal parameter value
+   * \param theMax the maximal parameter value
+   * \retval Handle(GEOM_Object) - newly created edge
+   */
+  Standard_EXPORT Handle(GEOM_Object)
+                            ExtendEdge(const Handle(GEOM_Object)& theEdge,
+                                       const Standard_Real        theMin,
+                                       const Standard_Real        theMax);
+
+  /*!
+   * \brief Resize the input face with the new UMin, UMax, VMin and VMax
+   * parameters. The input face U and V parameters range is [0, 1]. If
+   * theUMin parameter is negative, the input face is extended, otherwise
+   * it is shrinked along U direction by theUMin parameter. If theUMax is
+   * greater than 1, the face is extended, otherwise it is shrinked along
+   * U direction by theUMax parameter. So as for theVMin, theVMax and
+   * V direction of the input face.
+   * \param theFace the input face to be resized
+   * \param theUMin the minimal U parameter value
+   * \param theUMax the maximal U parameter value
+   * \param theVMin the minimal V parameter value
+   * \param theVMax the maximal V parameter value
+   * \retval Handle(GEOM_Object) - newly created face
+   */
+  Standard_EXPORT Handle(GEOM_Object)
+                            ExtendFace(const Handle(GEOM_Object)& theFace,
+                                       const Standard_Real        theUMin,
+                                       const Standard_Real        theUMax,
+                                       const Standard_Real        theVMin,
+                                       const Standard_Real        theVMax);
+  
+  /*!
+   * \brief Make a surface from a face. This function takes some face as
+   * input parameter and creates new GEOM_Object, i.e. topological shape
+   * by extracting underlying surface of the source face and limiting it
+   * by the Umin, Umax, Vmin, Vmax parameters of the source face (in the
+   * parametrical space).
+   * \param theFace the input face
+   * \retval Handle(GEOM_Object) - newly created face
+   */
+  Standard_EXPORT Handle(GEOM_Object)
+                   MakeSurfaceFromFace(const Handle(GEOM_Object) &theFace);
+
+  /*!
+   * \brief Explode a shape into edges sorted in a row from a starting point.
+   * \param theShape - the shape to be exploded on edges.
+   * \param theStartPoint - the starting point.
+   * \return Ordered list of edges sorted in a row from a starting point.
+   */
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient)
+    GetSubShapeEdgeSorted (const Handle(GEOM_Object) &theShape,
+                           const Handle(GEOM_Object) &theStartPoint);
+
+  /*!
+   * \brief Return the list of subshapes that satisfies a certain tolerance
+   * criterion. The user defines the type of shapes to be returned, the
+   * condition and the tolerance value. The operation is defined for
+   * faces, edges and vertices only. E.g. for theShapeType FACE, theCondition
+   * CC_GT and theTolerance 1.e-7 this method returns all faces of theShape
+   * that have tolerances greater then 1.e7.
+   *
+   * \param theShape the shape to be exploded
+   * \param theShapeType the type of shapes to be returned. Can have the
+   *        values FACE, EDGE and VERTEX only.
+   * \param theCondition the condition type.
+   * \param theTolerance the tolerance filter.
+   * \return the list of shapes that satisfy the conditions.
+   */
+  Standard_EXPORT Handle(TColStd_HSequenceOfTransient) GetSubShapesWithTolerance
+                     (const Handle(GEOM_Object)            &theShape,
+                      const Standard_Integer                theShapeType,
+                      const GEOMUtils::ComparisonCondition  theCondition,
+                      const Standard_Real                   theTolerance);
+
  private:
   Handle(GEOM_Object) MakeShape (std::list<Handle(GEOM_Object)>      theShapes,
                                  const Standard_Integer         theObjectType,
@@ -505,6 +592,16 @@ class GEOMImpl_IShapesOperations : public GEOM_IOperations
                        const Handle(TColStd_HSequenceOfInteger)& theShapeIDs,
                        TCollection_AsciiString &                 theShapeEntries);
 
+  /*!
+   * \brief Explode a shape into edges sorted in a row from a starting point.
+   * \param theShape - the shape to be exploded on edges.
+   * \param theStartPoint - the starting point.
+   * \return Ordered list of edges sorted in a row from a starting point.
+   */
+  Handle(TColStd_HSequenceOfInteger) getSubShapeEdgeSortedIDs
+                                (const Handle(GEOM_Object) &theShape,
+                                 const Handle(GEOM_Object) &theStartPoint);
+
   /*!
    * \brief Select the object created last
    * \param theObj1 - Object 1
index 1673e88b98bffe73b06c8bd8558f4c571198d30c..189635f881f695921e373b4779c603372408c85f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index d485b2c3a40911b9193bddb68e63c9983fcfdb87..483743e9153be6a7c6ed1443a8d15f24f50707b8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 466a177afc2495dd56fb44b9ba245cf3485637fa..024e2d72198c0c9f8a2df9b05340d52c1bc7265a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 304a857893d389a3f089762532fb3d2a28dde491..5624f88899e6016160120d03b866a7866d1769a7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3677ea5e53ac37b9ee5858ef3c2504b1736cf278..1929866ef55369e6edf4e4fd8581e95b5795f98a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
diff --git a/src/GEOMImpl/GEOMImpl_ITransferData.cxx b/src/GEOMImpl/GEOMImpl_ITransferData.cxx
new file mode 100644 (file)
index 0000000..62b4e51
--- /dev/null
@@ -0,0 +1,137 @@
+// 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
+//
+
+//NOTE: This is an intreface to a function for the Transfer Data functionality.
+//
+
+
+#include "GEOMImpl_ITransferData.hxx"
+
+#include <TDataStd_Comment.hxx>
+#include <TDataStd_Name.hxx>
+#include <TDF_ChildIDIterator.hxx>
+#include <TNaming_Builder.hxx>
+#include <TNaming_NamedShape.hxx>
+
+
+//=============================================================================
+/*!
+ *  SetName
+ */
+//=============================================================================
+void GEOMImpl_ITransferData::SetStringData
+                  (const TopoDS_Shape            &theSubShape,
+                   const TCollection_AsciiString &theData,
+                   const Standard_Boolean         IsName)
+{
+  TDF_Label           aLabel;
+  TDF_ChildIDIterator anIt
+    (_func->GetNamingEntry(), TDataStd_Name::GetID(), Standard_True);
+
+  for (; anIt.More(); anIt.Next()) {
+    Handle(TDataStd_Name) aNameAttr =
+        Handle(TDataStd_Name)::DownCast(anIt.Value());
+
+    if (aNameAttr.IsNull()) {
+      continue;
+    }
+
+    TDF_Label aLab = aNameAttr->Label();
+    Handle(TNaming_NamedShape) aShAttr;
+
+    if (aLab.FindAttribute(TNaming_NamedShape::GetID(), aShAttr) &&
+        aShAttr->Get().IsEqual(theSubShape)) {
+      aLabel = aLab;
+      break;
+    }
+  }
+
+  if (aLabel.IsNull()) {
+    TDF_TagSource aTag;
+
+    aLabel = aTag.NewChild(_func->GetNamingEntry());
+
+    TNaming_Builder aTnBuild (aLabel);
+
+    aTnBuild.Generated(theSubShape);
+  }
+
+  // set a name or a material
+  TCollection_ExtendedString aDataExt(theData);
+
+  if (IsName) {
+    TDataStd_Name::Set(aLabel, aDataExt);
+  } else {
+    TDataStd_Comment::Set(aLabel, aDataExt);
+  }
+}
+
+//=============================================================================
+/*!
+ *  GetStringData
+ */
+//=============================================================================
+TCollection_AsciiString GEOMImpl_ITransferData::GetStringData
+                  (const TopoDS_Shape     &theSubShape,
+                   const Standard_Boolean  IsName)
+{
+  // check all named shapes using iterator
+  TCollection_AsciiString aResult;
+  TDF_ChildIDIterator     anIt
+    (_func->GetNamingEntry(), TNaming_NamedShape::GetID(), Standard_True);
+
+  for (; anIt.More(); anIt.Next()) {
+    Handle(TNaming_NamedShape) aShAttr =
+        Handle(TNaming_NamedShape)::DownCast(anIt.Value());
+
+    if (aShAttr.IsNull()) {
+      continue;
+    }
+
+    if (aShAttr->Get().IsEqual(theSubShape)) {
+      TDF_Label        aLabel  = aShAttr->Label();
+      Standard_Boolean isFound = Standard_False;
+
+      if (IsName) {
+        Handle(TDataStd_Name) aString;
+
+        if(aLabel.FindAttribute(TDataStd_Name::GetID(), aString)) {
+          aResult = TCollection_AsciiString(aString->Get());
+          isFound = Standard_True;
+        }
+      } else {
+        Handle(TDataStd_Comment) aString;
+
+        if(aLabel.FindAttribute(TDataStd_Comment::GetID(), aString)) {
+          aResult = TCollection_AsciiString(aString->Get());
+          isFound = Standard_True;
+        }
+      }
+
+      if (isFound) {
+        break;
+      }
+    }
+  }
+
+  return aResult;
+}
diff --git a/src/GEOMImpl/GEOMImpl_ITransferData.hxx b/src/GEOMImpl/GEOMImpl_ITransferData.hxx
new file mode 100644 (file)
index 0000000..e2bf81b
--- /dev/null
@@ -0,0 +1,114 @@
+// 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
+//
+
+//NOTE: This is an intreface to a function for the Transfer Data functionality.
+//
+
+
+#ifndef _GEOMImpl_ITransferData_HXX_
+#define _GEOMImpl_ITransferData_HXX_
+
+
+#include "GEOM_GEOMImpl.hxx"
+#include "GEOM_Function.hxx"
+
+#include <TColStd_HArray1OfInteger.hxx>
+
+
+#define TD_ARG_REF1            1
+#define TD_ARG_REF2            2
+#define TD_ARG_METHOD          3
+#define TD_ARG_DATUM_NAME      4
+#define TD_ARG_DATUM_MAX_VALUE 5
+#define TD_ARG_DATUM_VALUE     6
+
+class GEOMImpl_ITransferData
+{
+ public:
+
+  GEOMImpl_ITransferData(const Handle(GEOM_Function) &theFunction)
+    : _func(theFunction) {}
+
+  void SetRef1(const Handle(GEOM_Function) &theRefPoint1)
+  { _func->SetReference(TD_ARG_REF1, theRefPoint1); }
+
+  Handle(GEOM_Function) GetRef1() { return _func->GetReference(TD_ARG_REF1); }
+
+  void SetRef2(const Handle(GEOM_Function) &theRefPoint2)
+  { _func->SetReference(TD_ARG_REF2, theRefPoint2); }
+
+  Handle(GEOM_Function) GetRef2() { return _func->GetReference(TD_ARG_REF2); }
+
+  void SetFindMethod(const int theFindMethod)
+  { _func->SetInteger(TD_ARG_METHOD, theFindMethod); }
+
+  int GetFindMethod() { return _func->GetInteger(TD_ARG_METHOD); }
+
+  void SetDatumName(const Handle(TColStd_HArray1OfExtendedString) &theDatumName)
+  { _func->SetStringArray(TD_ARG_DATUM_NAME, theDatumName); }
+
+  Handle(TColStd_HArray1OfExtendedString) GetDatumName()
+  { return _func->GetStringArray(TD_ARG_DATUM_NAME); }
+
+  void SetDatumMaxVal(const Handle(TColStd_HArray1OfInteger) &theDatumMaxVal)
+  { _func->SetIntegerArray(TD_ARG_DATUM_MAX_VALUE, theDatumMaxVal); }
+
+  Handle(TColStd_HArray1OfInteger) GetDatumMaxVal()
+  { return _func->GetIntegerArray(TD_ARG_DATUM_MAX_VALUE); }
+
+  void SetDatumVal(const Handle(TColStd_HArray1OfInteger) &theDatumVal)
+  { _func->SetIntegerArray(TD_ARG_DATUM_VALUE, theDatumVal); }
+
+  Handle(TColStd_HArray1OfInteger) GetDatumVal()
+  { return _func->GetIntegerArray(TD_ARG_DATUM_VALUE); }
+
+  GEOMIMPL_EXPORT void SetName(const TopoDS_Shape            &theSubShape,
+                                const TCollection_AsciiString &theName)
+  { SetStringData(theSubShape, theName, Standard_True); }
+
+  GEOMIMPL_EXPORT TCollection_AsciiString GetName
+                               (const TopoDS_Shape &theSubShape)
+  { return GetStringData(theSubShape, Standard_True); }
+
+  GEOMIMPL_EXPORT void SetMaterial(const TopoDS_Shape         &theSubShape,
+                                   const TCollection_AsciiString &theName)
+  { SetStringData(theSubShape, theName, Standard_False); }
+
+  GEOMIMPL_EXPORT TCollection_AsciiString GetMaterial
+                               (const TopoDS_Shape &theSubShape)
+  { return GetStringData(theSubShape, Standard_False); }
+
+ private:
+
+  TCollection_AsciiString GetStringData(const TopoDS_Shape     &theSubShape,
+                                        const Standard_Boolean  IsName);
+
+  void SetStringData(const TopoDS_Shape            &theSubShape,
+                     const TCollection_AsciiString &theData,
+                     const Standard_Boolean         IsName);
+
+ private:
+
+  Handle(GEOM_Function) _func;
+};
+
+#endif
index 8e04e15ec2ef1cb75d4385f96a81c5c2a4e34be7..6cc2010005f1dba1f424b5ea6a8d6a7b440c2c52 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -35,6 +35,7 @@
 #include <GEOMImpl_ITranslate.hxx>
 #include <GEOMImpl_IMirror.hxx>
 #include <GEOMImpl_IProjection.hxx>
+#include <GEOMImpl_IProjOnCyl.hxx>
 #include <GEOMImpl_IOffset.hxx>
 #include <GEOMImpl_IScale.hxx>
 #include <GEOMImpl_IRotate.hxx>
@@ -217,7 +218,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateTwoPointsCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a translate function
   Handle(GEOM_Function) aFunction =
@@ -270,7 +271,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateDXDYDZCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a translate function
   Handle(GEOM_Function) aFunction =
@@ -375,7 +376,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TranslateVectorCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be moved
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a translate function
   Handle(GEOM_Function) aFunction =
@@ -806,7 +807,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPlaneCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a mirror function
   Handle(GEOM_Function) aFunction =
@@ -909,7 +910,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorPointCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a mirror function
   Handle(GEOM_Function) aFunction =
@@ -1012,7 +1013,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::MirrorAxisCopy
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be mirrored
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a mirror function
   Handle(GEOM_Function) aFunction =
@@ -1113,7 +1114,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShapeCopy
   if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be offset
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a new Offset function
   Handle(GEOM_Function) aFunction =
@@ -1155,8 +1156,9 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::OffsetShapeCopy
  *  ProjectShapeCopy
  */
 //=============================================================================
-Handle(GEOM_Object) GEOMImpl_ITransformOperations::ProjectShapeCopy
-       (Handle(GEOM_Object) theSource, Handle(GEOM_Object) theTarget)
+Handle(GEOM_Object)
+GEOMImpl_ITransformOperations::ProjectShapeCopy (Handle(GEOM_Object) theSource,
+                                                 Handle(GEOM_Object) theTarget)
 {
   SetErrorCode(KO);
 
@@ -1165,35 +1167,54 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ProjectShapeCopy
   Handle(GEOM_Function) aLastFunction = theSource->GetLastFunction();
   if (aLastFunction.IsNull()) return NULL; //There is no function which creates an object to be projected
 
-  //Add a new Projection object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+  Handle(GEOM_Object) aCopy;
 
-  //Add a Projection function
-  Handle(GEOM_Function) aFunction =
-    aCopy->AddFunction(GEOMImpl_ProjectionDriver::GetID(), PROJECTION_COPY);
+  TopoDS_Shape aTarget = theTarget->GetValue();
+  if ( aTarget.IsNull() ) return NULL;
+  if ( aTarget.ShapeType() == TopAbs_EDGE ||
+       aTarget.ShapeType() == TopAbs_WIRE )
+  {
+    // a TPythonDump prevents dumping ProjectPointOnWire(),
+    // dump of MakeProjection() is done at the end of this function
+    GEOM::TPythonDump preventDump(aLastFunction, /*append=*/true);
+    Standard_Integer dummy;
+    ProjectPointOnWire( theSource, theTarget, aCopy, dummy );
+    if ( aCopy.IsNull() || !IsDone() )
+      return NULL;
+  }
+  else
+  {
+    //Add a new Projection object
+    aCopy = GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
 
-  //Check if the function is set correctly
-  if (aFunction->GetDriverGUID() != GEOMImpl_ProjectionDriver::GetID()) return NULL;
+    //Add a Projection function
+    Handle(GEOM_Function) aFunction =
+      aCopy->AddFunction(GEOMImpl_ProjectionDriver::GetID(), PROJECTION_COPY);
 
-  GEOMImpl_IMirror aTI (aFunction);
-  aTI.SetPlane(theTarget->GetLastFunction());
-  aTI.SetOriginal(aLastFunction);
+    //Check if the function is set correctly
+    if (aFunction->GetDriverGUID() != GEOMImpl_ProjectionDriver::GetID()) return NULL;
 
-  //Compute the Projection
-  try {
-    OCC_CATCH_SIGNALS;
-    if (!GetSolver()->ComputeFunction(aFunction)) {
-      SetErrorCode("Projection driver failed");
+    GEOMImpl_IMirror aTI (aFunction);
+    aTI.SetPlane(theTarget->GetLastFunction());
+    aTI.SetOriginal(aLastFunction);
+
+    //Compute the Projection
+    try {
+      OCC_CATCH_SIGNALS;
+      if (!GetSolver()->ComputeFunction(aFunction)) {
+        SetErrorCode("Projection driver failed");
+        return NULL;
+      }
+    }
+    catch (Standard_Failure) {
+      Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+      SetErrorCode(aFail->GetMessageString());
       return NULL;
     }
   }
-  catch (Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
-    SetErrorCode(aFail->GetMessageString());
-    return NULL;
-  }
 
   //Make a Python command
+  Handle(GEOM_Function) aFunction = aCopy->GetLastFunction();
   GEOM::TPythonDump(aFunction) << aCopy << " = geompy.MakeProjection("
                                << theSource << ", " << theTarget << ")";
 
@@ -1343,7 +1364,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::ScaleShapeCopy
   if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be scaled
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a scale function
   Handle(GEOM_Function) aFunction =
@@ -1534,7 +1555,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::PositionShapeCopy
   if (anOriginal.IsNull()) return NULL; //There is no function which creates an object to be set in position
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a position function
   Standard_Integer aType = POSITION_SHAPE_COPY;
@@ -1713,7 +1734,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateCopy (Handle(GEOM_Objec
   if (aLastFunction.IsNull()) return NULL;  //There is no function which creates an object to be rotated
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a rotate function
   aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_COPY);
@@ -2067,7 +2088,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::RotateThreePointsCopy (Handle
   if (aLastFunction.IsNull()) return NULL;  //There is no function which creates an object to be rotated
 
   //Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   //Add a rotate function
   aFunction = aCopy->AddFunction(GEOMImpl_RotateDriver::GetID(), ROTATE_THREE_POINTS_COPY);
@@ -2124,7 +2145,7 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TransformLikeOtherCopy
   if (aSampleFunc.IsNull()) return NULL; // There is no function which creates a sample object
 
   // Add a new Copy object
-  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), theObject->GetType());
+  Handle(GEOM_Object) aCopy = GetEngine()->AddObject(GetDocID(), GEOM_COPY);
 
   // Add a transform function (depends on theSample function)
   Handle(GEOM_Function) aFunction =
@@ -2247,3 +2268,74 @@ Handle(GEOM_Object) GEOMImpl_ITransformOperations::TransformLikeOtherCopy
   SetErrorCode(OK);
   return aCopy;
 }
+
+//=============================================================================
+/*!
+ *  MakeProjectionOnCylinder
+ */
+//=============================================================================
+Handle(GEOM_Object) GEOMImpl_ITransformOperations::MakeProjectionOnCylinder
+                             (const Handle(GEOM_Object) &theObject,
+                              const Standard_Real        theRadius,
+                              const Standard_Real        theStartAngle,
+                              const Standard_Real        theAngleLength,
+                              const Standard_Real        theAngleRotation)
+{
+  SetErrorCode(KO);
+
+  if (theObject.IsNull()) {
+    return NULL;
+  }
+
+  Handle(GEOM_Function) aLastFunction = theObject->GetLastFunction();
+
+  if (aLastFunction.IsNull()) {
+    //There is no function which creates an object to be projected
+    return NULL;
+  }
+
+  //Add a new Projection object
+  Handle(GEOM_Object) aResult =
+    GetEngine()->AddObject(GetDocID(), GEOM_PROJECTION);
+
+  //Add a Projection function
+  Handle(GEOM_Function) aFunction = aResult->AddFunction
+    (GEOMImpl_ProjectionDriver::GetID(), PROJECTION_ON_CYLINDER);
+
+  //Check if the function is set correctly
+  if (aFunction->GetDriverGUID() != GEOMImpl_ProjectionDriver::GetID()) {
+    return aResult;
+  }
+
+  GEOMImpl_IProjOnCyl aProj (aFunction);
+
+  aProj.SetShape(aLastFunction);
+  aProj.SetRadius(theRadius);
+  aProj.SetStartAngle(theStartAngle);
+  aProj.SetAngleLength(theAngleLength);
+  aProj.SetAngleRotation(theAngleRotation);
+
+  //Compute the Projection
+  try {
+    OCC_CATCH_SIGNALS;
+    if (!GetSolver()->ComputeFunction(aFunction)) {
+      SetErrorCode("Projection driver failed");
+      return aResult;
+    }
+  }
+  catch (Standard_Failure) {
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
+    SetErrorCode(aFail->GetMessageString());
+    return aResult;
+  }
+
+  //Make a Python command
+  GEOM::TPythonDump(aFunction)
+    << aResult << " = geompy.MakeProjectionOnCylinder("
+    << theObject << ", " << theRadius << ", " << theStartAngle
+    << ", " << theAngleLength << ", " << theAngleRotation << ")";
+
+  SetErrorCode(OK);
+
+  return aResult;
+}
index c2752f0a9716f87c9ce7ef594a4438dfc8a9c9d7..3742157bf7e387567700a9ab61e8286945ebd64a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -191,6 +191,13 @@ class GEOMImpl_ITransformOperations : public GEOM_IOperations
   Standard_EXPORT Handle(GEOM_Object) TransformLikeOtherCopy (Handle(GEOM_Object) theObject,
                                                               Handle(GEOM_Object) theSample);
 
+  Standard_EXPORT Handle(GEOM_Object) MakeProjectionOnCylinder
+                             (const Handle(GEOM_Object) &theObject,
+                              const Standard_Real        theRadius,
+                              const Standard_Real        theStartAngle,
+                              const Standard_Real        theAngleLength,
+                              const Standard_Real        theAngleRotation);
+
 };
 
 #endif
index a3048b80d82d323f3aec0680d56e737cfe681ed8..f3853e461d307f1813f170a1dd5daaabe2617989 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 2a633fec3c949aee63eeb8d38f0fe7048e2caa51..9bc77ad24fe552892f629bf72731d30313d8755e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 86b3f32e64d9539fe9a5d8a903b3446d9da2d877..28e5b89c592a5dbc429544d73b709bed8c2190c6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c6e4b7b6845747109afb4ce436d542c65f4cd111..8b47aeef3d0658a0001d7a76dddceef557da631b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 9a4e4b4bfc1801e15b490ebf3a8366245d802753..884eb5ae0e86b5ff1b542400653bdeb45ee310d2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1337e0c08c31703608cbb31f3a1b32664bb92485..9005128f7d805e31bc819f6bb34f97bac8b063a9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 7cee4d96ea723f142c702204208331543460f1b1..6471c655996370e30e99e6b3bf057fd7307058f6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 58e9a8615c5a4b143667499380ba09b9b2c9609f..feda9d4e5aa34acc4d45d8586e2f6894416f47a3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b507640e69b786b903af35073721dbc454f55645..b004dfe9b52611f92f854a8534bd0adf2c34b3cf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 20e4ada7d4573e617cc172ad18b42cd6e5f72096..379ae2847e34855a3a221c5c15849e15c46f7175 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 97bcb31f0c0d09414b14ec6b80a6c95aa85b82b7..99a7cc377186c77abfa349ab61928147f9c4838a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 07742851f641f1534d75306582453df709d03e4b..c3cdc5f277755d051e84f8cf4289e3e17da92fe5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index fe5bb0580489bc72fdd2d47750271e77cc389b10..112966a3f276b1f5547febd55111bccb3bf11e86 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <GEOMImpl_IOffset.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
+#include <GEOMUtils.hxx>
 
 #include <BRepOffsetAPI_MakeOffsetShape.hxx>
-#include <BRep_Tool.hxx>
-#include <TopoDS.hxx>
+#include <BRepOffsetAPI_MakeThickSolid.hxx>
 #include <TopoDS_Shape.hxx>
-#include <TopoDS_Vertex.hxx>
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
-
 #include <BRepClass3d_SolidClassifier.hxx>
-
 #include <Precision.hxx>
-#include <gp_Pnt.hxx>
-
-#include <BRepCheck_Analyzer.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
 #include <Standard_ConstructionError.hxx>
 #include <StdFail_NotDone.hxx>
 
-#include "utilities.h"
-
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -59,7 +48,6 @@ const Standard_GUID& GEOMImpl_OffsetDriver::GetID()
   return aOffsetDriver;
 }
 
-
 //=======================================================================
 //function : GEOMImpl_OffsetDriver
 //purpose  :
@@ -85,8 +73,12 @@ Standard_Integer GEOMImpl_OffsetDriver::Execute(TFunction_Logbook& log) const
   Handle(GEOM_Function) aRefShape = aCI.GetShape();
   TopoDS_Shape aShapeBase = aRefShape->GetValue();
   Standard_Real anOffset = aCI.GetValue();
+  Standard_Boolean isInside = aCI.GetParam();
   Standard_Real aTol = Precision::Confusion();
 
+  if (isInside)
+    anOffset = -anOffset;
+
   if (Abs(anOffset) < aTol) {
     TCollection_AsciiString aMsg ("Absolute value of offset can not be less than the tolerance value (");
     aMsg += TCollection_AsciiString(aTol);
@@ -100,20 +92,8 @@ Standard_Integer GEOMImpl_OffsetDriver::Execute(TFunction_Logbook& log) const
                                       aTol);
     if (MO.IsDone()) {
       aShape = MO.Shape();
-      // 23.04.2010 skl for bug 21699 from Mantis
-      BRepCheck_Analyzer ana (aShape, Standard_True);
-      ana.Init(aShape);
-      if (!ana.IsValid()) {
-        ShapeFix_ShapeTolerance aSFT;
-        aSFT.LimitTolerance(aShape, Precision::Confusion(),
-                            Precision::Confusion(), TopAbs_SHAPE);
-        Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-        aSfs->Perform();
-        aShape = aSfs->Shape();
-        ana.Init(aShape);
-        if (!ana.IsValid())
-          Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
-      }
+      if ( !GEOMUtils::CheckShape(aShape, true) && !GEOMUtils::FixShapeTolerance(aShape) )
+        Standard_ConstructionError::Raise("Boolean operation aborted : non valid shape result");
     }
     else {
       StdFail_NotDone::Raise("Offset construction failed");
@@ -121,31 +101,78 @@ Standard_Integer GEOMImpl_OffsetDriver::Execute(TFunction_Logbook& log) const
   }
   else if (aType == OFFSET_THICKENING || aType == OFFSET_THICKENING_COPY)
   {
-    BRepClass3d_SolidClassifier aClassifier = BRepClass3d_SolidClassifier(aShapeBase);
-    aClassifier.PerformInfinitePoint(Precision::Confusion());
-    if (aClassifier.State()==TopAbs_IN)
-    {
-      // If the generated pipe faces normals are oriented towards the inside, the offset is negative
-      // so that the thickening is still towards outside
-      anOffset=-anOffset;
-    }
+    const TopAbs_ShapeEnum aType = aShapeBase.ShapeType();
+
+    if (aType == TopAbs_FACE || aType == TopAbs_SHELL) {
+      // Create a thick solid.
+      BRepClass3d_SolidClassifier aClassifier = BRepClass3d_SolidClassifier(aShapeBase);
+      aClassifier.PerformInfinitePoint(Precision::Confusion());
+      if (aClassifier.State()==TopAbs_IN)
+      {
+        // If the generated pipe faces normals are oriented towards the inside, the offset is negative
+        // so that the thickening is still towards outside
+        anOffset=-anOffset;
+      }
 
-    BRepOffset_MakeOffset myOffsetShape(aShapeBase, anOffset, aTol, BRepOffset_Skin,
-                                        Standard_False, Standard_False, GeomAbs_Intersection, Standard_True);
+      BRepOffset_MakeOffset myOffsetShape(aShapeBase, anOffset, aTol, BRepOffset_Skin,
+                                          Standard_False, Standard_False, GeomAbs_Intersection, Standard_True);
 
-    if (!myOffsetShape.IsDone())
-    {
-      StdFail_NotDone::Raise("Thickening construction failed");
-    }
-    aShape = myOffsetShape.Shape();
+      if (!myOffsetShape.IsDone())
+      {
+        StdFail_NotDone::Raise("Thickening construction failed");
+      }
+      aShape = myOffsetShape.Shape();
+
+      // Control the solid orientation. This is mostly done to fix a bug in case of extrusion
+      // of a circle. The built solid is then badly oriented
+      BRepClass3d_SolidClassifier anotherClassifier = BRepClass3d_SolidClassifier(aShape);
+      anotherClassifier.PerformInfinitePoint(Precision::Confusion());
+      if (anotherClassifier.State()==TopAbs_IN)
+      {
+        aShape.Reverse();
+      }
+    } else if (aType == TopAbs_SOLID) {
+      // Create a hollowed solid.
+      Handle(TColStd_HArray1OfInteger) aFacesIDs = aCI.GetFaceIDs();
+      TopTools_ListOfShape aFacesToRm;
 
-    // Control the solid orientation. This is mostly done to fix a bug in case of extrusion
-    // of a circle. The built solid is then badly oriented
-    BRepClass3d_SolidClassifier anotherClassifier = BRepClass3d_SolidClassifier(aShape);
-    anotherClassifier.PerformInfinitePoint(Precision::Confusion());
-    if (anotherClassifier.State()==TopAbs_IN)
-    {
-      aShape.Reverse();
+      if (aFacesIDs.IsNull()) {
+        return 0;
+      }
+
+      TopTools_IndexedMapOfShape anIndices;
+
+      TopExp::MapShapes(aShapeBase, anIndices);
+
+      Standard_Integer aNbShapes = anIndices.Extent();
+      Standard_Integer i;
+
+      for (i = aFacesIDs->Lower(); i <= aFacesIDs->Upper(); ++i) {
+        const Standard_Integer anIndex = aFacesIDs->Value(i);
+
+        if (anIndex < 1 || anIndex > aNbShapes) {
+          // Invalid index.
+          return 0;
+        }
+
+        const TopoDS_Shape &aFace = anIndices.FindKey(anIndex);
+
+        if (aFace.ShapeType() != TopAbs_FACE) {
+          // Shape by index is not a face.
+          return 0;
+        }
+
+        aFacesToRm.Append(aFace);
+      }
+
+      // Create a hollowed solid.
+      BRepOffsetAPI_MakeThickSolid aMkSolid
+                  (aShapeBase, aFacesToRm, anOffset, aTol, BRepOffset_Skin,
+                   Standard_False, Standard_False, GeomAbs_Intersection);
+
+      if (aMkSolid.IsDone()) {
+        aShape = aMkSolid.Shape();
+      }
     }
   }
 
@@ -183,9 +210,16 @@ GetCreationInformation(std::string&             theOperationName,
     break;
   case OFFSET_THICKENING:
   case OFFSET_THICKENING_COPY:
-    theOperationName = "MakeThickening";
+    theOperationName = "THICKNESS";
     AddParam( theParams, "Object", aCI.GetShape() );
-    AddParam( theParams, "Offset", aCI.GetValue() );
+    AddParam( theParams, "Offset", aCI.GetParam() ? -aCI.GetValue() : aCI.GetValue() );
+    {
+      Handle(TColStd_HArray1OfInteger) aFacesIDs = aCI.GetFaceIDs();
+
+      if (aFacesIDs.IsNull() == Standard_False) {
+        AddParam(theParams, "Faces IDs", aFacesIDs);
+      }
+    }
     break;
   default:
     return false;
index 483c2be9ab3ec85834f84795cff00f7102979c91..8b1b1171ffca3ba91bbac7afcc2228fc6faf4d21 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c50b0a86addd27bcd9770953af2552b8dcb9e9b0..fa7526643c15f17d42a06e51100b76cf32cb8e05 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_PartitionDriver.hxx>
 #include <GEOMImpl_IPartition.hxx>
 #include <GEOMImpl_Types.hxx>
-
+#include <GEOMUtils.hxx>
 #include <GEOM_Object.hxx>
 #include <GEOM_Function.hxx>
-
 #include <GEOMAlgo_Splitter.hxx>
 
 #include <TDataStd_IntegerArray.hxx>
 #include <TNaming_CopyShape.hxx>
 
-//#include <BRepBuilderAPI_Copy.hxx>
-#include <BRep_Tool.hxx>
-#include <BRepAlgo.hxx>
-#include <BRepTools.hxx>
-
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
-#include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS_Wire.hxx>
 #include <TopoDS_Iterator.hxx>
 #include <TopTools_MapOfShape.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
 #include <TopTools_DataMapOfShapeShape.hxx>
 
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <ShapeFix_Shape.hxx>
-
 #include <TColStd_IndexedDataMapOfTransientTransient.hxx>
-#include <TColStd_ListIteratorOfListOfInteger.hxx>
-#include <TColStd_ListOfInteger.hxx>
 #include <Standard_NullObject.hxx>
 #include <StdFail_NotDone.hxx>
-#include <Precision.hxx>
-#include <gp_Pnt.hxx>
 #include <BOPAlgo_CheckerSI.hxx>
 #include <BOPCol_IndexedDataMapOfShapeListOfShape.hxx>
 #include <BOPCol_ListOfShape.hxx>
@@ -444,17 +426,8 @@ Standard_Integer GEOMImpl_PartitionDriver::Execute(TFunction_Logbook& log) const
     Standard_ConstructionError::Raise("Partition aborted : non valid shape result");
   //end of IPAL21418
 
-  if (!BRepAlgo::IsValid(aShape)) {
-    // 08.07.2008 added by skl during fixing bug 19761 from Mantis
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape, Precision::Confusion(),
-                        Precision::Confusion(), TopAbs_SHAPE);
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-    if (!BRepAlgo::IsValid(aShape))
-      Standard_ConstructionError::Raise("Partition aborted : non valid shape result");
-  }
+  if ( !GEOMUtils::CheckShape(aShape, true) && !GEOMUtils::FixShapeTolerance(aShape) )
+    Standard_ConstructionError::Raise("Partition aborted : non valid shape result");
 
   aFunction->SetValue(aShape);
 
index e73601ddf8869391f727a778aa58b2db5f182d81..be4c9b9e8b8786814c8c309daeda3cc346b46944 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 5f580ddb95ef9f38a6fdeb56811dbe0045affe50..ef5b07e7943a51d232e5e7aa9ed7e7a13bcdebf7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <ShapeAnalysis_Edge.hxx>
 #include <ShapeFix_Face.hxx>
 #include <ShapeFix_Shell.hxx>
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
 
 #include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
 #include <BRepBuilderAPI_Copy.hxx>
 #include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepBuilderAPI_MakeSolid.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
 #include <BRepBuilderAPI_Sewing.hxx>
-#include <BRepCheck_Analyzer.hxx>
+#include <BRepClass3d_SolidClassifier.hxx>
 #include <BRepGProp.hxx>
 #include <GeomFill_Trihedron.hxx>
 #include <GeomFill_CorrectedFrenet.hxx>
 #include <TopoDS_Shell.hxx>
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Compound.hxx>
+#include <TopTools_DataMapOfShapeSequenceOfShape.hxx>
 #include <TopTools_SequenceOfShape.hxx>
 #include <TopTools_HSequenceOfShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeShape.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 #include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_MapIteratorOfMapOfShape.hxx>
 
 #include <GProp_GProps.hxx>
 
 
 #include "utilities.h"
 
+#define GROUP_DOWN  0
+#define GROUP_UP    1
+#define GROUP_SIDE1 2
+#define GROUP_SIDE2 3
+#define GROUP_OTHER 4
+
+static const Standard_Real TolPipeSurf = 5.e-4;
+
+static bool FillGroups(const TopTools_SequenceOfShape         *theGroups,
+                       const TopTools_IndexedMapOfShape       &theIndices,
+                             Handle(TColStd_HArray1OfInteger) *theGroupIds);
+
+static void StoreGroups(GEOMImpl_IPipe                   *theCI,
+                        Handle(TColStd_HArray1OfInteger) *theGroups);
+
+static bool DoGroups(BRepOffsetAPI_MakePipeShell &theSweep,
+                     TopTools_SequenceOfShape    *theGroups);
+
+static bool CreateGroups(BRepOffsetAPI_MakePipeShell &theSweep,
+                         GEOMImpl_IPipe              *theCI);
 
 //=======================================================================
 //function : GetID
@@ -163,7 +184,8 @@ static Standard_Boolean BuildPipeShell(BRepOffsetAPI_MakePipeShell &theBuilder)
 
   Standard_Boolean isDone = theBuilder.IsDone();
 
-  if (!isDone) {
+  if (!isDone ||
+      theBuilder.ErrorOnSurface() > TolPipeSurf) {
     // Try to use Descrete Trihedron mode.
     theBuilder.SetDiscreteMode();
     theBuilder.Build();
@@ -280,15 +302,6 @@ static bool FillCorrespondingEdges(const TopoDS_Shape& FS1,
   BuildPipeShell(aBuilder);
 
   TopoDS_Shape aShape = aBuilder.Shape();
-  /*
-  TopoDS_Compound C;
-  BRep_Builder B;
-  B.MakeCompound(C);
-  B.Add(C,aShape);
-  B.Add(C,FS1);
-  B.Add(C,FS2);
-  BRepTools::Write(C,"/dn02/users_Linux/skl/work/Bugs/14857/comp.brep");
-  */
   ShapeAnalysis_Edge sae;
   double tol = Max(BRep_Tool::Tolerance(TopoDS::Face(FS1)),
                     BRep_Tool::Tolerance(TopoDS::Face(FS2)));
@@ -678,16 +691,54 @@ static void FindFirstPairFaces(const TopoDS_Shape& S1, const TopoDS_Shape& S2,
   FS2 = Fs(numface);
 }
 
+//=======================================================================
+//function : RemoveFaces
+//purpose  : This function returns theShapeFrom without faces of the shape
+//           theFacesToRm. It returns a shell if theShapeFrom is a solid or
+//           a compound otherwise. Auxilary for CreatePipeWithDifferentSections
+//           method.
+//=======================================================================
+static TopoDS_Shape RemoveFaces(const TopoDS_Shape &theShapeFrom,
+                                const TopoDS_Shape &theFacesToRm)
+{
+  TopTools_IndexedMapOfShape aMapFaces;
+  TopExp_Explorer            anExp(theShapeFrom, TopAbs_FACE);
+  BRep_Builder               aBuilder;
+  TopoDS_Shape               aResult;
+
+  if (theShapeFrom.ShapeType() == TopAbs_SOLID) {
+    // Create shell
+    aBuilder.MakeShell(TopoDS::Shell(aResult));
+  } else {
+    // Create compound
+    aBuilder.MakeCompound(TopoDS::Compound(aResult));
+  }
+
+  TopExp::MapShapes(theFacesToRm, TopAbs_FACE, aMapFaces);
+
+  for (; anExp.More(); anExp.Next()) {
+    const TopoDS_Shape &aFace = anExp.Current();
+
+    if (!aMapFaces.Contains(aFace)) {
+      aBuilder.Add(aResult, aFace);
+    }
+  }
+
+  return aResult;
+}
+
 //=======================================================================
 //function : CreatePipeWithDifferentSections
 //purpose  :
 //=======================================================================
 TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
-                                  (const TopoDS_Wire& theWirePath,
-                                   const Handle(TopTools_HSequenceOfShape) theHSeqBases,
-                                   const Handle(TopTools_HSequenceOfShape) theHSeqLocs,
-                                   const Standard_Boolean theWithContact,
-                                   const Standard_Boolean theWithCorrect)
+                  (const TopoDS_Wire                       &theWirePath,
+                   const Handle(TopTools_HSequenceOfShape)  theHSeqBases,
+                   const Handle(TopTools_HSequenceOfShape)  theHSeqLocs,
+                   const Standard_Boolean                   theWithContact,
+                   const Standard_Boolean                   theWithCorrect,
+                   const Standard_Boolean                   IsBySteps,
+                         Handle(TColStd_HArray1OfInteger)  *theGroups)
 {
   TopoDS_Shape aShape;
 
@@ -874,53 +925,90 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
     }
   }
 
-  // check curvature of wire for condition that
-  // max summary angle between directions along
-  // wire path must be < 4*PI. If not - split wire
-  // and seguences of shapes, perform pipe for each
-  // and make sewing after that
-  double fp,lp;
-  gp_Pnt P1,P2;
-  gp_Vec Vec1,Vec2;
-  double SumAng = 0;
-  if ( Edges.Length() > 0 ) {
-    Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(Edges.Value(1)),fp,lp);
-    C->D1(fp,P1,Vec1);
-    C->D1(lp,P2,Vec2);
-    SumAng = fabs(Vec1.Angle(Vec2));
-    Vec1 = Vec2;
-    P1 = P2;
-  }
   TColStd_SequenceOfInteger SplitEdgeNums,SplitLocNums;
-  int LastLoc = 1;
-  //cout<<"Edges.Length()="<<Edges.Length()<<endl;
-  for (i=2; i<=Edges.Length(); i++) {
-      TopoDS_Edge edge = TopoDS::Edge(Edges.Value(i));
-      double tol = BRep_Tool::Tolerance(edge);
-      Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
-      C->D1(lp,P2,Vec2);
-      double ang = fabs(Vec1.Angle(Vec2));
-      SumAng += ang;
-      if (SumAng>4*M_PI) {
-        SumAng = ang;
-        SplitEdgeNums.Append(i-1);
-        int j;
-        for (j=LastLoc+1; j<=aSeqLocs.Length(); j++) {
-          TopoDS_Vertex aVert = TopoDS::Vertex(aSeqLocs.Value(j));
-          gp_Pnt P = BRep_Tool::Pnt(aVert);
-          if (P1.Distance(P) < tol) {
-            SplitLocNums.Append(j);
-            LastLoc = j;
-            break;
-          }
+
+  if (IsBySteps) {
+    // Fill SplitEdgeNums and SplitLocNums with intermediate location indices
+    // and corresponding edge indices.
+    Standard_Integer i = 1;
+    Standard_Integer j;
+    TopoDS_Vertex    aVert;
+    gp_Pnt           aP;
+
+    for (j = 2; j < aSeqLocs.Length(); j++) {
+      SplitLocNums.Append(j);
+      aVert = TopoDS::Vertex(aSeqLocs.Value(j));
+      aP    = BRep_Tool::Pnt(aVert);
+
+      while (i < Edges.Length()) {
+        Standard_Real      aFp;
+        Standard_Real      aLp;
+        TopoDS_Edge        anEdge = TopoDS::Edge(Edges.Value(i));
+        Standard_Real      aTol   = BRep_Tool::Tolerance(anEdge);
+        Handle(Geom_Curve) aC     = BRep_Tool::Curve(anEdge, aFp, aLp);
+        gp_Pnt             aPLast;
+
+        aC->D0(aLp, aPLast);
+        i++;
+
+        if (aP.Distance(aPLast) < aTol) {
+          SplitEdgeNums.Append(i - 1);
+          break;
         }
       }
+    }
+  } else {
+    // check curvature of wire for condition that
+    // max summary angle between directions along
+    // wire path must be < 4*PI. If not - split wire
+    // and seguences of shapes, perform pipe for each
+    // and make sewing after that
+    double fp,lp;
+    gp_Pnt P1,P2;
+    gp_Vec Vec1,Vec2;
+    double SumAng = 0;
+    if ( Edges.Length() > 0 ) {
+      Handle(Geom_Curve) C = BRep_Tool::Curve(TopoDS::Edge(Edges.Value(1)),fp,lp);
+      C->D1(fp,P1,Vec1);
+      C->D1(lp,P2,Vec2);
+      SumAng = fabs(Vec1.Angle(Vec2));
       Vec1 = Vec2;
       P1 = P2;
+    }
+    int LastLoc = 1;
+    //cout<<"Edges.Length()="<<Edges.Length()<<endl;
+    for (i=2; i<=Edges.Length(); i++) {
+        TopoDS_Edge edge = TopoDS::Edge(Edges.Value(i));
+        double tol = BRep_Tool::Tolerance(edge);
+        Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
+        C->D1(lp,P2,Vec2);
+        double ang = fabs(Vec1.Angle(Vec2));
+        SumAng += ang;
+        if (SumAng>4*M_PI) {
+          SumAng = ang;
+          SplitEdgeNums.Append(i-1);
+          int j;
+          for (j=LastLoc+1; j<=aSeqLocs.Length(); j++) {
+            TopoDS_Vertex aVert = TopoDS::Vertex(aSeqLocs.Value(j));
+            gp_Pnt P = BRep_Tool::Pnt(aVert);
+            if (P1.Distance(P) < tol) {
+              SplitLocNums.Append(j);
+              LastLoc = j;
+              break;
+            }
+          }
+        }
+        Vec1 = Vec2;
+        P1 = P2;
+    }
   }
 
+  bool isCreateGroups = (theGroups != NULL);
+
   if (SplitLocNums.Length()==SplitEdgeNums.Length() && SplitEdgeNums.Length()>0) {
-      TopTools_SequenceOfShape aSeqRes;
+      TopTools_SequenceOfShape               aSeqRes;
+      TopTools_DataMapOfShapeSequenceOfShape aMapResGroups[5];
+      Standard_Integer                       iGrp;
       int nn, num1 = 1, num2 = 1;
       for (nn=1; nn<=SplitEdgeNums.Length(); nn++) {
         // create wirepath and sequences of shapes
@@ -953,10 +1041,40 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
           Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
         }
 
-        BuildPipeShell(aBuilder);
+        Standard_Boolean isDone = BuildPipeShell(aBuilder);
+
+        if (isDone && NeedCreateSolid && nn == 1) {
+          // Make solid for the first step.
+          isDone = aBuilder.MakeSolid();
+        }
+
+        if (!isDone) {
+          Standard_ConstructionError::Raise("Pipe construction failure");
+        }
 
         TopoDS_Shape resShape = aBuilder.Shape();
+
+        if (NeedCreateSolid && nn == 1) {
+          // Remove top lid from the result.
+          resShape = RemoveFaces(resShape, aBuilder.LastShape());
+        }
+
         aSeqRes.Append(resShape);
+
+        // Create groups.
+        if (isCreateGroups) {
+          // Make groups.
+          TopTools_SequenceOfShape aGroups[5];
+
+          if (!DoGroups(aBuilder, aGroups)) {
+            Standard_ConstructionError::Raise("Generate groups failure");
+          }
+
+          // Get shapes from all groups.
+          for (iGrp = 0; iGrp < 5; ++iGrp) {
+            aMapResGroups[iGrp].Bind(resShape, aGroups[iGrp]);
+          }
+        }
       }
       // create wirepath and sequences of shapes for last part
       BRep_Builder B;
@@ -986,10 +1104,40 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
         Standard_ConstructionError::Raise("Invalid input data for building PIPE: bases are invalid");
       }
 
-      BuildPipeShell(aBuilder);
+      Standard_Boolean isDone = BuildPipeShell(aBuilder);
+
+      if (isDone && NeedCreateSolid) {
+        isDone = aBuilder.MakeSolid();
+      }
+
+      if (!isDone) {
+        Standard_ConstructionError::Raise("Pipe construction failure");
+      }
 
       TopoDS_Shape resShape = aBuilder.Shape();
+
+      if (NeedCreateSolid) {
+        // Remove bottom lid from the result.
+        resShape = RemoveFaces(resShape, aBuilder.FirstShape());
+      }
+
       aSeqRes.Append(resShape);
+
+      // Create groups.
+      if (isCreateGroups) {
+        // Make groups.
+        TopTools_SequenceOfShape aGroups[5];
+
+        if (!DoGroups(aBuilder, aGroups)) {
+          Standard_ConstructionError::Raise("Generate groups failure");
+        }
+
+        // Get shapes from all groups.
+        for (iGrp = 0; iGrp < 5; ++iGrp) {
+          aMapResGroups[iGrp].Bind(resShape, aGroups[iGrp]);
+        }
+      }
+
       // make sewing for result
       Handle(BRepBuilderAPI_Sewing) aSewing = new BRepBuilderAPI_Sewing;
       aSewing->SetTolerance(Precision::Confusion());
@@ -1001,6 +1149,78 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
       }
       aSewing->Perform();
       aShape = aSewing->SewedShape();
+
+      if (NeedCreateSolid && aShape.ShapeType() == TopAbs_SHELL) {
+        // Build a solid.
+        BRepBuilderAPI_MakeSolid aMkSolid;
+
+        aMkSolid.Add(TopoDS::Shell(aShape));
+
+        if (!aMkSolid.IsDone()) {
+          Standard_ConstructionError::Raise("Can't create solid pipe");
+        }
+
+        TopoDS_Solid                aSolid = aMkSolid.Solid();
+        BRepClass3d_SolidClassifier aSC(aSolid);
+
+        aSC.PerformInfinitePoint(Precision::Confusion());
+
+        if (aSC.State() == TopAbs_IN) {
+          aShape = aSolid.Reversed();
+        } else {
+          aShape = aSolid;
+        }
+      }
+
+      if (isCreateGroups) {
+        // Replase Group shapes by modified ones.
+        TopTools_SequenceOfShape aSeqGroups[5];
+
+        // For each group.
+        for (iGrp = 0; iGrp < 5; ++iGrp) {
+          // For each pipe
+          for (i = 1; i <= aSeqRes.Length(); ++i) {
+            if (iGrp == GROUP_DOWN && i > 1) {
+              // For DOWN group we use only the first pipe.
+              continue;
+            }
+
+            if (iGrp == GROUP_UP && i < aSeqRes.Length()) {
+              // For UP group we use only the last pipe.
+              continue;
+            }
+
+            const TopTools_SequenceOfShape &aShapes =
+              aMapResGroups[iGrp].Find(aSeqRes.Value(i));
+            Standard_Integer                j;
+
+            // For each sub-shape of pipe
+            for (j = 1; j <= aShapes.Length(); ++j) {
+              const TopoDS_Shape &aGrpShape = aShapes.Value(j);
+
+              if (aSewing->IsModifiedSubShape(aGrpShape)) {
+                // Use the shape modified by sewing.
+                const TopoDS_Shape &aModifGrpShape =
+                  aSewing->ModifiedSubShape(aGrpShape);
+
+                aSeqGroups[iGrp].Append(aModifGrpShape);
+              } else {
+                // Use the shape as it is.
+                aSeqGroups[iGrp].Append(aGrpShape);
+              }
+            }
+          }
+        }
+
+        // Fill groups
+        TopTools_IndexedMapOfShape anIndices;
+
+        TopExp::MapShapes(aShape, anIndices);
+
+        if (!FillGroups(aSeqGroups, anIndices, theGroups)) {
+          Standard_ConstructionError::Raise("Generate groups failure");
+        }
+      }
   }
   else {
       // old implementation without splitting
@@ -1050,6 +1270,26 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
           Standard_ConstructionError::Raise("Pipe construction failure");
         }
         aShape = aBuilder.Shape();
+
+        if (isCreateGroups) {
+          // Make groups.
+          TopTools_SequenceOfShape aSeqGroups[5];
+
+          if (!DoGroups(aBuilder, aSeqGroups)) {
+            Standard_ConstructionError::Raise("Generate groups failure");
+          }
+
+          // Fill the groups.
+          Handle(TColStd_HArray1OfInteger) aGroupIds[5];
+          TopTools_IndexedMapOfShape       anIndices;
+          const TopoDS_Shape               aResult = aBuilder.Shape();
+
+          TopExp::MapShapes(aResult, anIndices);
+
+          if (!FillGroups(aSeqGroups, anIndices, theGroups)) {
+            Standard_ConstructionError::Raise("Generate groups failure");
+          }
+        }
         aSeqFaces.Append(aShape);
         for (j = 1; j <=usedBases.Length(); j++)
           aBuilder.Delete(usedBases.Value(j));
@@ -1066,8 +1306,6 @@ TopoDS_Shape GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
 static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
                                                GEOMImpl_IPipe* aCI)
 {
-  //cout<<"CreatePipeForShellSections"<<endl;
-  //TopoDS_Shape res;
   int i,j;
   BRep_Builder B;
 
@@ -1077,6 +1315,7 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
   Handle(TColStd_HSequenceOfTransient) aLocObjs = aCIDS->GetLocations();
   Standard_Boolean aWithContact = (aCIDS->GetWithContactMode());
   Standard_Boolean aWithCorrect = (aCIDS->GetWithCorrectionMode());
+  Standard_Boolean isGenerateGroups = aCIDS->GetGenerateGroups();
 
   Standard_Integer nbBases = aBasesObjs->Length(),
     nbSubBases = (aSubBasesObjs.IsNull() ? 0 :aSubBasesObjs->Length()),
@@ -1091,8 +1330,6 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
     Standard_ConstructionError::Raise("Number of sections is not equal to number of subsections ");
   }
 
-  //BRepOffsetAPI_MakePipeShell aBuilder(aWirePath);
-
   TopTools_SequenceOfShape VLocs;
   for (i=1; i<=nbBases; i++) {
     Handle(Standard_Transient) anItemLoc = aLocObjs->Value(i);
@@ -1264,7 +1501,6 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
     for (; i<=Edges.Length(); i++)
       B.Add(W,Edges.Value(i));
     Wires.Append(W);
-    //cout<<"Wires.Length()="<<Wires.Length()<<endl;
   }
 
   if (Wires.Length() != nbLocs-1) {
@@ -1273,10 +1509,8 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
       ("One of location shapes is not lied on the path");
   }
 
-  //TopTools_SequenceOfShape aSeqBases;
-  //TopTools_SequenceOfShape aSeqSubBases;
-  //TopTools_SequenceOfShape aSeqFaces;
-  TopoDS_Compound aComp;
+  TopTools_SequenceOfShape aGroups[5];
+  TopoDS_Compound          aComp;
   B.MakeCompound(aComp);
   for (i = 1; i < nbBases; i++) {
     TopoDS_Wire WPath = TopoDS::Wire(Wires.Value(i));
@@ -1303,8 +1537,6 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
       continue;
     TopAbs_ShapeEnum aType2 = aShBase2.ShapeType();
 
-    //BRepTools::Write(aShBase1,"/dn02/users_Linux/skl/work/Bugs/14857/base1.brep");
-
     bool OkSec = (aType1==TopAbs_SHELL || aType1==TopAbs_FACE) &&
                  (aType2==TopAbs_SHELL || aType2==TopAbs_FACE);
     if (!OkSec) {
@@ -1327,153 +1559,6 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
       CreateFewSolids = true;
     }
 
-    /*
-    // check orientation of sections
-    bool NeedReverse = false;
-    {
-      // first section
-      anExp.Init(aShBase1, TopAbs_FACE);
-      TopoDS_Shape aFace = anExp.Current();
-      TColgp_SequenceOfPnt aPnts;
-      double xc=0, yc=0, zc=0;
-      for (anExp.Init(aFace, TopAbs_VERTEX); anExp.More(); anExp.Next()) {
-        TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
-        aPnts.Append(BRep_Tool::Pnt(V));
-        xc += aPnts.Last().X();
-        yc += aPnts.Last().Y();
-        zc += aPnts.Last().Z();
-      }
-      gp_Pnt PC(xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length());
-      gp_Vec V1(PC,aPnts.Value(1));
-      gp_Vec V2(PC,aPnts.Value(2));
-      gp_Vec VN = V1.Crossed(V2);
-      for (int ip=2; ip<aPnts.Length(); ip++) {
-        V1 = gp_Vec(PC,aPnts.Value(ip));
-        V2 = gp_Vec(PC,aPnts.Value(ip+1));
-        VN.Add(V1.Crossed(V2));
-      }
-      gp_Vec PathNorm;
-      gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i)));
-      TopExp_Explorer WE;
-      for (WE.Init(WPath, TopAbs_EDGE); WE.More(); WE.Next()) {
-        TopoDS_Edge edge = TopoDS::Edge(WE.Current());
-        double tol = BRep_Tool::Tolerance(edge);
-        TopoDS_Vertex VF = sae.FirstVertex(edge);
-        gp_Pnt PF = BRep_Tool::Pnt(VF);
-        if (PF.Distance(PLoc) < tol) {
-          double fp,lp;
-          Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
-          gp_Pnt P1,P2;
-          C->D0(fp,P1);
-          if (P1.Distance(PLoc) < tol) {
-            C->D0(fp+(lp-fp)/100,P2);
-          }
-          else {
-            C->D0(lp,P1);
-            C->D0(lp+(fp-lp)/100,P2);
-          }
-          PathNorm = gp_Vec(P1,P2);
-          break;
-        }
-        else {
-          TopoDS_Vertex VL = sae.LastVertex(edge);
-          gp_Pnt PL = BRep_Tool::Pnt(VL);
-          if (PL.Distance(PLoc) < tol) {
-            double fp,lp;
-            Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
-            gp_Pnt P1,P2;
-            C->D0(fp,P1);
-            if (P1.Distance(PLoc) < tol) {
-              C->D0(fp+(lp-fp)/100,P2);
-            }
-            else {
-              C->D0(lp,P1);
-              C->D0(lp+(fp-lp)/100,P2);
-            }
-            PathNorm = gp_Vec(P2,P1);
-            break;
-          }
-        }
-      }
-      cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
-      cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
-      if (fabs(VN.Angle(PathNorm))>PI/2.) {
-        NeedReverse = true;
-        aShBase1.Reverse();
-      }
-    }
-    {
-      // second section
-      anExp.Init(aShBase2, TopAbs_FACE);
-      TopoDS_Shape aFace = anExp.Current();
-      TColgp_SequenceOfPnt aPnts;
-      double xc=0, yc=0, zc=0;
-      for (anExp.Init(aFace, TopAbs_VERTEX); anExp.More(); anExp.Next()) {
-        TopoDS_Vertex V = TopoDS::Vertex(anExp.Current());
-        aPnts.Append(BRep_Tool::Pnt(V));
-        xc += aPnts.Last().X();
-        yc += aPnts.Last().Y();
-        zc += aPnts.Last().Z();
-      }
-      gp_Pnt PC(xc/aPnts.Length(), yc/aPnts.Length(), zc/aPnts.Length());
-      gp_Vec V1(PC,aPnts.Value(1));
-      gp_Vec V2(PC,aPnts.Value(2));
-      gp_Vec VN = V1.Crossed(V2);
-      for (int ip=2; ip<aPnts.Length(); ip++) {
-        V1 = gp_Vec(PC,aPnts.Value(ip));
-        V2 = gp_Vec(PC,aPnts.Value(ip+1));
-        VN.Add(V1.Crossed(V2));
-      }
-      gp_Vec PathNorm;
-      gp_Pnt PLoc = BRep_Tool::Pnt(TopoDS::Vertex(VLocs(i+1)));
-      TopExp_Explorer WE;
-      for (WE.Init(WPath, TopAbs_EDGE); WE.More(); WE.Next()) {
-        TopoDS_Edge edge = TopoDS::Edge(WE.Current());
-        double tol = BRep_Tool::Tolerance(edge);
-        TopoDS_Vertex VF = sae.FirstVertex(edge);
-        gp_Pnt PF = BRep_Tool::Pnt(VF);
-        if (PF.Distance(PLoc) < tol) {
-          double fp,lp;
-          Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
-          gp_Pnt P1,P2;
-          C->D0(fp,P1);
-          if (P1.Distance(PLoc) < tol) {
-            C->D0(fp+(lp-fp)/100,P2);
-          }
-          else {
-            C->D0(lp,P1);
-            C->D0(lp+(fp-lp)/100,P2);
-          }
-          PathNorm = gp_Vec(P2,P1);
-          break;
-        }
-        else {
-          TopoDS_Vertex VL = sae.LastVertex(edge);
-          gp_Pnt PL = BRep_Tool::Pnt(VL);
-          if (PL.Distance(PLoc) < tol) {
-            double fp,lp;
-            Handle(Geom_Curve) C = BRep_Tool::Curve(edge,fp,lp);
-            gp_Pnt P1,P2;
-            C->D0(fp,P1);
-            if (P1.Distance(PLoc) < tol) {
-              C->D0(fp+(lp-fp)/100,P2);
-            }
-            else {
-              C->D0(lp,P1);
-              C->D0(lp+(fp-lp)/100,P2);
-            }
-            PathNorm = gp_Vec(P2,P1);
-            break;
-          }
-        }
-      }
-      //cout<<"VN("<<VN.X()<<","<<VN.Y()<<","<<VN.Z()<<")"<<endl;
-      //cout<<"PathNorm("<<PathNorm.X()<<","<<PathNorm.Y()<<","<<PathNorm.Z()<<")"<<endl;
-      if (fabs(VN.Angle(PathNorm))>PI/2.)
-        aShBase2.Reverse();
-    }
-    */
-
     if (!CreateFewSolids) {
       // we can create only one solid
       TopoDS_Shape aWire1, aWire2;
@@ -1539,7 +1624,22 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
 
         BuildPipeShell(aBuilder);
 
-        TopoDS_Shape aShape = aBuilder.Shape();
+        TopoDS_Shape             aShape = aBuilder.Shape();
+        TopTools_SequenceOfShape aLocalGroups[5];
+
+        // Create groups.
+        if (isGenerateGroups) {
+          // Make groups.
+          if (!DoGroups(aBuilder, aLocalGroups)) {
+            if (aCI) delete aCI;
+            Standard_ConstructionError::Raise("Generate groups failure");
+          }
+
+          // Clear the groups Down and Up.
+          aLocalGroups[GROUP_DOWN].Clear();
+          aLocalGroups[GROUP_UP].Clear();
+        }
+
         TopoDS_Shell aShell;
         B.MakeShell(aShell);
         for (anExp.Init(aShape, TopAbs_FACE); anExp.More(); anExp.Next()) {
@@ -1547,9 +1647,17 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
         }
         for (anExp.Init(aShBase1, TopAbs_FACE); anExp.More(); anExp.Next()) {
           B.Add(aShell,anExp.Current());
+
+          if (isGenerateGroups && i == 1) {
+            aLocalGroups[GROUP_DOWN].Append(anExp.Current());
+          }
         }
         for (anExp.Init(aShBase2, TopAbs_FACE); anExp.More(); anExp.Next()) {
           B.Add(aShell,anExp.Current());
+
+          if (isGenerateGroups && i == nbBases - 1) {
+            aLocalGroups[GROUP_UP].Append(anExp.Current());
+          }
         }
         // make sewing for this shell
         Handle(BRepBuilderAPI_Sewing) aSewing = new BRepBuilderAPI_Sewing;
@@ -1582,6 +1690,30 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
         else {
           B.Add(aComp,aShell);
         }
+
+        if (isGenerateGroups) {
+          Standard_Integer iGrp;
+
+          for (iGrp = 0; iGrp < 5; ++iGrp) {
+            Standard_Integer j;
+
+            // For each sub-shape of pipe
+            for (j = 1; j <= aLocalGroups[iGrp].Length(); ++j) {
+              const TopoDS_Shape &aGrpShape = aLocalGroups[iGrp].Value(j);
+
+              if (aSewing->IsModifiedSubShape(aGrpShape)) {
+                // Use the shape modified by sewing.
+                const TopoDS_Shape &aModifGrpShape =
+                  aSewing->ModifiedSubShape(aGrpShape);
+
+                aGroups[iGrp].Append(aModifGrpShape);
+              } else {
+                // Use the shape as it is.
+                aGroups[iGrp].Append(aGrpShape);
+              }
+            }
+          }
+        }
       }
     }
     else {
@@ -1779,7 +1911,30 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
 
           BuildPipeShell(aBuilder);
 
-          TopoDS_Shape aShape = aBuilder.Shape();
+          TopoDS_Shape             aShape = aBuilder.Shape();
+          TopTools_SequenceOfShape aLocalGroups[5];
+
+          // Create groups.
+          if (isGenerateGroups) {
+            // Make groups.
+            if (!DoGroups(aBuilder, aLocalGroups)) {
+              if (aCI) delete aCI;
+              Standard_ConstructionError::Raise("Generate groups failure");
+            }
+
+            // Clear the groups Down and Up.
+            aLocalGroups[GROUP_DOWN].Clear();
+            aLocalGroups[GROUP_UP].Clear();
+
+            if (i == 1) {
+              aLocalGroups[GROUP_DOWN].Append(F1);
+            }
+
+            if (i == nbBases - 1) {
+              aLocalGroups[GROUP_UP].Append(F2);
+            }
+          }
+
           TopoDS_Shell aShell;
           B.MakeShell(aShell);
           for (anExp.Init(aShape, TopAbs_FACE); anExp.More(); anExp.Next()) {
@@ -1820,13 +1975,52 @@ static TopoDS_Shape CreatePipeForShellSections(const TopoDS_Wire& aWirePath,
           else {
             B.Add(aComp,aShell);
           }
+
+          if (isGenerateGroups) {
+            // Replase Group shapes by modified ones.
+            Standard_Integer iGrp;
+
+            // For each group.
+            for (iGrp = 0; iGrp < 5; ++iGrp) {
+              Standard_Integer j;
+
+              // For each sub-shape of pipe
+              for (j = 1; j <= aLocalGroups[iGrp].Length(); ++j) {
+                const TopoDS_Shape &aGrpShape = aLocalGroups[iGrp].Value(j);
+
+                if (aSewing->IsModifiedSubShape(aGrpShape)) {
+                  // Use the shape modified by sewing.
+                  const TopoDS_Shape &aModifGrpShape =
+                    aSewing->ModifiedSubShape(aGrpShape);
+
+                  aGroups[iGrp].Append(aModifGrpShape);
+                } else {
+                  // Use the shape as it is.
+                  aGroups[iGrp].Append(aGrpShape);
+                }
+              }
+            }
+          }
         }
       }
+    }
+  }
 
+  if (isGenerateGroups) {
+    // Fill the groups.
+    Handle(TColStd_HArray1OfInteger) aGroupIds[5];
+    TopTools_IndexedMapOfShape       anIndices;
+
+    TopExp::MapShapes(aComp, anIndices);
+
+    if (!FillGroups(aGroups, anIndices, aGroupIds)) {
+      if (aCI) delete aCI;
+      Standard_ConstructionError::Raise("Generate groups failure");
     }
+
+    StoreGroups(aCI, aGroupIds);
   }
 
-  //BRepTools::Write(aComp,"/dn02/users_Linux/skl/work/Bugs/14857/comp.brep");
   return aComp;
 }
 
@@ -1845,6 +2039,7 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
   Handle(TColStd_HSequenceOfTransient) aBasesObjs = aCIDS->GetBases();
   // vertex for recognition
   Handle(TColStd_HSequenceOfTransient) VObjs = aCIDS->GetLocations();
+  Standard_Boolean isGenerateGroups = aCIDS->GetGenerateGroups();
 
   Standard_Integer nbBases = aBasesObjs->Length(),
     nbv = (VObjs.IsNull() ? 0 :VObjs->Length());
@@ -1854,6 +2049,7 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
     Standard_ConstructionError::Raise("Number of shapes for recognition is invalid");
   }
 
+  TopTools_SequenceOfShape aGroups[5];
   TopTools_SequenceOfShape SecVs,Bases;
   for (i=1; i<=nbBases; i++) {
     // vertex
@@ -1905,8 +2101,23 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
     }
 
     TopTools_MapOfShape aFaces1,aFaces2;
+    TopTools_MapOfShape aBndEdges1;
+
     for (anExp.Init(aShBase1, TopAbs_FACE); anExp.More(); anExp.Next()) {
-      aFaces1.Add(anExp.Current());
+      const TopoDS_Shape &aBaseFace1 = anExp.Current();
+
+      if (aFaces1.Add(aBaseFace1)) {
+        // Get boundary edges.
+        TopExp_Explorer anExpE(aBaseFace1, TopAbs_EDGE);
+
+        for (; anExpE.More(); anExpE.Next()) {
+          const TopoDS_Shape &aBaseEdge1 = anExpE.Current();
+
+          if (!aBndEdges1.Add(aBaseEdge1)) {
+            aBndEdges1.Remove(aBaseEdge1);
+          }
+        }
+      }
     }
     for (anExp.Init(aShBase2, TopAbs_FACE); anExp.More(); anExp.Next()) {
       aFaces2.Add(anExp.Current());
@@ -1994,6 +2205,8 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
 
       TopExp_Explorer anExpE(F1,TopAbs_EDGE);
       TopTools_SequenceOfShape aNewFs;
+      TopTools_SequenceOfShape aLocalGroups[5];
+
       //int nbee=0;
       for (; anExpE.More(); anExpE.Next()) {
         TopoDS_Edge E1 = TopoDS::Edge(anExpE.Current());
@@ -2074,8 +2287,6 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
         B.Add(W,E2);
         B.Add(W,E3);
         B.Add(W,E4.Reversed());
-        //cout<<"      wire for edge "<<nbee<<" is created"<<endl;
-        //BRepTools::Write(W,"/dn02/users_Linux/skl/work/Bugs/14857/w.brep");
 
         // make surface
 
@@ -2117,13 +2328,6 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
           GeomConvert::CurveToBSplineCurve(C4,Convert_RationalC1);
         if (CE4->Degree()<3)
           CE4->IncreaseDegree(3);
-        //cout<<"CE1->Degree()="<<CE1->Degree()<<" CE2->Degree()="<<CE2->Degree()
-        //    <<" CE3->Degree()="<<CE3->Degree()<<" CE4->Degree()="<<CE4->Degree()<<endl;
-        //if (fic.open("/dn02/users_Linux/skl/work/Bugs/14857/ce1.brep",ios::out)) {
-        //  os<<"DrawTrSurf_BSplineCurve"<<endl;
-        //  GeomTools::Write(CE1,os);
-        //  fic.close();
-        //}
 
         Handle(Geom_Surface) BS;
         try {
@@ -2221,8 +2425,13 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
         TopoDS_Face FixedFace = sff->Face();
         aNewFs.Append(FixedFace);
         VPE.Add(E1,FixedFace);
-        //cout<<"      face for edge "<<nbee<<" is created"<<endl;
-        //BRepTools::Write(FixedFace,"/dn02/users_Linux/skl/work/Bugs/14857/f.brep");
+
+        if (isGenerateGroups) {
+          if (aBndEdges1.Contains(E1)) {
+            // This is a boundary face.
+            aLocalGroups[GROUP_OTHER].Append(FixedFace);
+          }
+        }
       }
       // make shell
       TopoDS_Shell aShell;
@@ -2233,6 +2442,15 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
       B.Add(aShell,F1);
       B.Add(aShell,F2);
 
+      // Create groups.
+      if (isGenerateGroups && i == 1) {
+        aLocalGroups[GROUP_DOWN].Append(F1);
+      }
+
+      if (isGenerateGroups && i == nbBases - 1) {
+        aLocalGroups[GROUP_UP].Append(F2);
+      }
+
       // make sewing for this shell
       Handle(BRepBuilderAPI_Sewing) aSewing = new BRepBuilderAPI_Sewing;
       aSewing->SetTolerance(Precision::Confusion());
@@ -2245,7 +2463,6 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
       aSewing->Perform();
       MESSAGE ("    shell for face "<<nbff<<" is created");
       const TopoDS_Shape aSewShape = aSewing->SewedShape();
-      //BRepTools::Write(aSewShape,"/dn02/users_Linux/skl/work/Bugs/14857/sew.brep");
       if (aSewShape.ShapeType() == TopAbs_SHELL) {
         aShell = TopoDS::Shell(aSewShape);
         GProp_GProps aSystem;
@@ -2270,32 +2487,48 @@ static TopoDS_Shape CreatePipeShellsWithoutPath(GEOMImpl_IPipe* aCI)
         B.Add(aComp,aShell);
         MESSAGE ("    solid for face "<<nbff<<" is not created");
       }
-      //cout<<"    solid for face "<<nbff<<" is created"<<endl;
 
-      //Handle(ShapeFix_Shell) sfs = new ShapeFix_Shell(aShell);
-      //sfs->Perform();
-      //TopoDS_Shell FixedShell = sfs->Shell();
-      /*
-      GProp_GProps aSystem;
-      BRepGProp::VolumeProperties(FixedShell, aSystem);
-      if (aSystem.Mass()<0) {
-        //cout<<"aSewShape is reversed"<<endl;
-        FixedShell.Reverse();
-      }
-      if (BRep_Tool::IsClosed(FixedShell)) {
-        TopoDS_Solid aSolid;
-        B.MakeSolid(aSolid);
-        B.Add(aSolid,aShell);
-        B.Add(aComp,aSolid);
-      }
-      else {
-        B.Add(aComp,FixedShell);
+      if (isGenerateGroups) {
+        Standard_Integer iGrp;
+
+        for (iGrp = 0; iGrp < 5; ++iGrp) {
+          Standard_Integer j;
+
+          // For each sub-shape of pipe
+          for (j = 1; j <= aLocalGroups[iGrp].Length(); ++j) {
+            const TopoDS_Shape &aGrpShape = aLocalGroups[iGrp].Value(j);
+
+            if (aSewing->IsModifiedSubShape(aGrpShape)) {
+              // Use the shape modified by sewing.
+              const TopoDS_Shape &aModifGrpShape =
+                aSewing->ModifiedSubShape(aGrpShape);
+
+              aGroups[iGrp].Append(aModifGrpShape);
+            } else {
+              // Use the shape as it is.
+              aGroups[iGrp].Append(aGrpShape);
+            }
+          }
+        }
       }
-      */
     }
   }
 
-  //BRepTools::Write(aComp,"/dn02/users_Linux/skl/work/Bugs/14857/comp.brep");
+  if (isGenerateGroups) {
+    // Fill the groups.
+    Handle(TColStd_HArray1OfInteger) aGroupIds[5];
+    TopTools_IndexedMapOfShape       anIndices;
+
+    TopExp::MapShapes(aComp, anIndices);
+
+    if (!FillGroups(aGroups, anIndices, aGroupIds)) {
+      if (aCI) delete aCI;
+      Standard_ConstructionError::Raise("Generate groups failure");
+    }
+
+    StoreGroups(aCI, aGroupIds);
+  }
+
   return aComp;
 }
 
@@ -2368,9 +2601,397 @@ static TopoDS_Shape CreatePipeBiNormalAlongVector(const TopoDS_Wire& aWirePath,
       PipeBuilder.MakeSolid();
   }
 
+  if (!CreateGroups(PipeBuilder, aCIBN)) {
+    if (aCIBN) delete aCIBN;
+    Standard_ConstructionError::Raise("Generate groups failure");
+  }
+
   return PipeBuilder.Shape();
 }
 
+//=======================================================================
+//function : FillGroups
+//purpose  : auxilary for DoGroups()
+//=======================================================================
+bool FillGroups(const TopTools_SequenceOfShape         *theGroups,
+                const TopTools_IndexedMapOfShape       &theIndices,
+                      Handle(TColStd_HArray1OfInteger) *theGroupIds)
+{
+  Standard_Integer i;
+
+  for (i = 0; i < 5; ++i) {
+    if (!theGroups[i].IsEmpty()) {
+      const Standard_Integer aNbShapes = theGroups[i].Length();
+      Standard_Integer       j;
+
+      theGroupIds[i] = new TColStd_HArray1OfInteger(1, aNbShapes);
+
+      for (j = 1; j <= aNbShapes; ++j) {
+        const TopoDS_Shape     &aShape  = theGroups[i].Value(j);
+        const Standard_Integer  anIndex = theIndices.FindIndex(aShape);
+
+        if (anIndex == 0) {
+          return false;
+        }
+
+        theGroupIds[i]->SetValue(j, anIndex);
+      }
+    }
+  }
+
+  return true;
+}
+
+//=======================================================================
+//function : StoreGroups
+//purpose  : auxilary for CreateGroups()
+//=======================================================================
+void StoreGroups(GEOMImpl_IPipe                   *theCI,
+                 Handle(TColStd_HArray1OfInteger) *theGroups)
+{
+  if (theGroups[GROUP_DOWN].IsNull() == Standard_False) {
+    theCI->SetGroupDown(theGroups[GROUP_DOWN]);
+  }
+
+  if (theGroups[GROUP_UP].IsNull() == Standard_False) {
+    theCI->SetGroupUp(theGroups[GROUP_UP]);
+  }
+
+  if (theGroups[GROUP_SIDE1].IsNull() == Standard_False) {
+    theCI->SetGroupSide1(theGroups[GROUP_SIDE1]);
+  }
+
+  if (theGroups[GROUP_SIDE2].IsNull() == Standard_False) {
+    theCI->SetGroupSide2(theGroups[GROUP_SIDE2]);
+  }
+
+  if (theGroups[GROUP_OTHER].IsNull() == Standard_False) {
+    theCI->SetGroupOther(theGroups[GROUP_OTHER]);
+  }
+}
+
+//=======================================================================
+//function : CreateDownUpGroups
+//purpose  : auxilary for DoGroups()
+//=======================================================================
+static bool CreateDownUpGroups(BRepPrimAPI_MakeSweep    *theSweep,
+                               TopTools_SequenceOfShape *theGroups,
+                               Standard_Boolean         &IsDoSides)
+{
+  const TopoDS_Shape     aDownShape   = theSweep->FirstShape();
+  const TopAbs_ShapeEnum aType        = aDownShape.ShapeType();
+  TopAbs_ShapeEnum       anUpDownType = TopAbs_SHAPE;
+
+  IsDoSides  = Standard_False;
+
+  switch (aType) {
+    case TopAbs_EDGE:
+    case TopAbs_WIRE:
+      anUpDownType = TopAbs_EDGE;
+
+      if (GEOMUtils::IsOpenPath(aDownShape)) {
+        IsDoSides = Standard_True;
+      }
+      break;
+    case TopAbs_FACE:
+    case TopAbs_SHELL:
+      anUpDownType = TopAbs_FACE;
+      break;
+    default:
+      break;
+  }
+
+  if (anUpDownType == TopAbs_SHAPE) {
+    // Invalid Up and Down group type.
+    return false;
+  }
+
+  TopExp_Explorer     anExp(aDownShape, anUpDownType);
+  TopTools_MapOfShape aMapFence;
+
+  // Create Down group.
+  for (; anExp.More(); anExp.Next()) {
+    const TopoDS_Shape &aShape = anExp.Current();
+
+    if (aMapFence.Add(aShape)) {
+      theGroups[GROUP_DOWN].Append(aShape);
+    }
+  }
+
+  // Create Up group
+  const TopoDS_Shape anUpShape = theSweep->LastShape();
+
+  aMapFence.Clear();
+  anExp.Init(anUpShape, anUpDownType);
+
+  for (; anExp.More(); anExp.Next()) {
+    const TopoDS_Shape &aShape = anExp.Current();
+
+    if (aMapFence.Add(aShape)) {
+      theGroups[GROUP_UP].Append(aShape);
+    }
+  }
+
+  return true;
+}
+
+//=======================================================================
+//function : DoGroups
+//purpose  : auxilary for CreateGroups()
+//=======================================================================
+bool DoGroups(BRepOffsetAPI_MakePipeShell &theSweep,
+              TopTools_SequenceOfShape    *theGroups)
+{
+  Standard_Boolean isDoSides = Standard_False;
+
+  if (!CreateDownUpGroups(&theSweep, theGroups, isDoSides)) {
+    // Up and Down groups creation failure
+    return false;
+  }
+
+  const TopoDS_Shape aDownShape = theSweep.FirstShape();
+
+  if (isDoSides) {
+    // Create Side1 and Side2 groups.
+    const TopAbs_ShapeEnum aType = aDownShape.ShapeType();
+    TopoDS_Vertex          aV[2];
+    Standard_Integer       i;
+
+    if (aType == TopAbs_EDGE) {
+      TopExp::Vertices(TopoDS::Edge(aDownShape), aV[0], aV[1], Standard_True);
+    } else { // aType == TopAbs_WIRE
+      TopExp::Vertices(TopoDS::Wire(aDownShape), aV[0], aV[1]);
+    }
+
+    for (i = 0; i < 2; ++i) {
+      if (aV[i].IsNull() == Standard_False) {
+        const TopTools_ListOfShape &aLstSide = theSweep.Generated(aV[i]);
+
+        if (!aLstSide.IsEmpty()) {
+          TopTools_ListIteratorOfListOfShape aSideIt(aLstSide);
+          TopTools_MapOfShape                aMapFence;
+          const Standard_Integer             anIdSide =
+                      (i == 0 ? GROUP_SIDE1 : GROUP_SIDE2);
+
+          for (; aSideIt.More(); aSideIt.Next()) {
+            const TopoDS_Shape &aSideShape = aSideIt.Value();
+
+            if (aSideShape.ShapeType() == TopAbs_EDGE) {
+              if (aMapFence.Add(aSideShape)) {
+                theGroups[anIdSide].Append(aSideShape);
+              }
+            } else {
+              // Only edges can be is Side1 and Side2 groups.
+              return false;
+            }
+          }
+        }
+      }
+    }
+  } else {
+    // Create Other group. Get boudnary edges of the profile.
+    TopTools_MapOfShape aMapBndEdges;
+    TopExp_Explorer     anExp(aDownShape, TopAbs_EDGE);
+
+    for (; anExp.More(); anExp.Next()) {
+      const TopoDS_Shape &anEdge = anExp.Current();
+
+      if (!aMapBndEdges.Add(anEdge)) {
+        aMapBndEdges.Remove(anEdge);
+      }
+    }
+
+    // Fill the map of faces generated from profile's boundary edges.
+    TopTools_MapIteratorOfMapOfShape anIter(aMapBndEdges);
+    TopTools_MapOfShape              aMapFence;
+
+    for (; anIter.More(); anIter.Next()) {
+      const TopTools_ListOfShape &aLstOther = theSweep.Generated(anIter.Key());
+
+      if (!aLstOther.IsEmpty()) {
+        TopTools_ListIteratorOfListOfShape anOtherIt(aLstOther);
+
+        for (; anOtherIt.More(); anOtherIt.Next()) {
+          const TopoDS_Shape &anOtherShape = anOtherIt.Value();
+
+          if (anOtherShape.ShapeType() == TopAbs_FACE) {
+            if (aMapFence.Add(anOtherShape)) {
+              theGroups[GROUP_OTHER].Append(anOtherShape);
+            }
+          } else {
+            // Only faces can be in Other group.
+            return false;
+          }
+        }
+      }
+    }
+  }
+
+  return true;
+}
+
+//=======================================================================
+//function : CreateGroups
+//purpose  : auxilary for Execute()
+//=======================================================================
+bool CreateGroups(BRepOffsetAPI_MakePipeShell &theSweep,
+                  GEOMImpl_IPipe              *theCI)
+{
+  if (!theCI->GetGenerateGroups()) {
+    // Nothing to do.
+    return true;
+  }
+
+  // Make groups.
+  TopTools_SequenceOfShape aGroups[5];
+
+  if (!DoGroups(theSweep, aGroups)) {
+    return false;
+  }
+
+  // Fill the groups.
+  Handle(TColStd_HArray1OfInteger) aGroupIds[5];
+  TopTools_IndexedMapOfShape       anIndices;
+  const TopoDS_Shape               aResult = theSweep.Shape();
+
+  TopExp::MapShapes(aResult, anIndices);
+
+  if (!FillGroups(aGroups, anIndices, aGroupIds)) {
+    return false;
+  }
+
+  // Store groups.
+  StoreGroups(theCI, aGroupIds);
+
+  return true;
+}
+
+//=======================================================================
+//function : DoGroups
+//purpose  : auxilary for CreateGroups()
+//=======================================================================
+static bool DoGroups(const TopoDS_Shape             &theProfile,
+                     const TopoDS_Shape             &thePath,
+                           BRepOffsetAPI_MakePipe   &theSweep,
+                           TopTools_SequenceOfShape *theGroups)
+{
+  Standard_Boolean isDoSides = Standard_False;
+
+  if (!CreateDownUpGroups(&theSweep, theGroups, isDoSides)) {
+    // Up and Down groups creation failure
+    return false;
+  }
+
+  if (isDoSides) {
+    // Create Side1 and Side2 groups.
+    const TopAbs_ShapeEnum aType = theProfile.ShapeType();
+    TopoDS_Vertex          aV[2];
+    Standard_Integer       i;
+
+    if (aType == TopAbs_EDGE) {
+      TopExp::Vertices(TopoDS::Edge(theProfile), aV[0], aV[1], Standard_True);
+    } else { // aType == TopAbs_WIRE
+      TopExp::Vertices(TopoDS::Wire(theProfile), aV[0], aV[1]);
+    }
+
+    for (i = 0; i < 2; ++i) {
+      if (aV[i].IsNull() == Standard_False) {
+        TopExp_Explorer        anExpP(thePath, TopAbs_EDGE);
+        TopTools_MapOfShape    aMapFence;
+        const Standard_Integer anIdSide =
+                      (i == 0 ? GROUP_SIDE1 : GROUP_SIDE2);
+
+        for (; anExpP.More(); anExpP.Next()) {
+          const TopoDS_Shape aSideShape =
+            theSweep.Generated(anExpP.Current(), aV[i]);
+
+          if (aSideShape.ShapeType() == TopAbs_EDGE) {
+            if (aMapFence.Add(aSideShape)) {
+              theGroups[anIdSide].Append(aSideShape);
+            }
+          } else {
+            // Only edges can be is Side1 and Side2 groups.
+            return false;
+          }
+        }
+      }
+    }
+  } else {
+    // Create Other group. Get boudnary edges of the profile.
+    TopTools_MapOfShape aMapBndEdges;
+    TopExp_Explorer     anExp(theProfile, TopAbs_EDGE);
+
+    for (; anExp.More(); anExp.Next()) {
+      const TopoDS_Shape &anEdge = anExp.Current();
+
+      if (!aMapBndEdges.Add(anEdge)) {
+        aMapBndEdges.Remove(anEdge);
+      }
+    }
+
+    TopExp_Explorer        anExpP(thePath, TopAbs_EDGE);
+    TopTools_MapOfShape    aMapFence;
+
+    for (; anExpP.More(); anExpP.Next()) {
+      TopTools_MapIteratorOfMapOfShape anIter(aMapBndEdges);
+
+      for (; anIter.More(); anIter.Next()) {
+        const TopoDS_Shape anOtherShape =
+          theSweep.Generated(anExpP.Current(), anIter.Key());
+
+        if (anOtherShape.ShapeType() == TopAbs_FACE) {
+          if (aMapFence.Add(anOtherShape)) {
+            theGroups[GROUP_OTHER].Append(anOtherShape);
+          }
+        } else {
+          // Only faces can be in Other group.
+          return false;
+        }
+      }
+    }
+  }
+
+  return true;
+}
+
+//=======================================================================
+//function : CreateGroups
+//purpose  : auxilary for Execute()
+//=======================================================================
+static bool CreateGroups(const TopoDS_Shape     &theProfile,
+                         const TopoDS_Shape     &thePath,
+                         BRepOffsetAPI_MakePipe &theSweep,
+                         GEOMImpl_IPipe         *theCI)
+{
+  if (!theCI->GetGenerateGroups()) {
+    // Nothing to do.
+    return true;
+  }
+
+  // Make groups.
+  TopTools_SequenceOfShape aGroups[5];
+
+  if (!DoGroups(theProfile, thePath, theSweep, aGroups)) {
+    return false;
+  }
+
+  // Fill the groups.
+  Handle(TColStd_HArray1OfInteger) aGroupIds[5];
+  TopTools_IndexedMapOfShape       anIndices;
+  const TopoDS_Shape               aResult = theSweep.Shape();
+
+  TopExp::MapShapes(aResult, anIndices);
+
+  if (!FillGroups(aGroups, anIndices, aGroupIds)) {
+    return false;
+  }
+
+  // Store groups.
+  StoreGroups(theCI, aGroupIds);
+
+  return true;
+}
+
 //=======================================================================
 //function : Execute
 //purpose  :
@@ -2437,9 +3058,20 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
       if (aCI) delete aCI;
       Standard_TypeMismatch::Raise("MakePipe aborted : path shape is neither a wire nor an edge");
     }
+
+    // Check if it is possible to create groups.
+    if (aCI->GetGenerateGroups() && !GEOMUtils::IsOpenPath(aWirePath)) {
+      if (aCI) {
+        delete aCI;
+      }
+
+      Standard_ConstructionError::Raise
+        ("Can't create groups if the path is closed");
+    }
   }
 
-  TopoDS_Shape aShape;
+  TopoDS_Shape           aShape;
+  const Standard_Boolean isGenerateGroups = aCI->GetGenerateGroups();
 
   if (aType == PIPE_BASE_PATH) {
     Handle(GEOM_Function) aRefBase = aCI->GetBase();
@@ -2484,15 +3116,24 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
       }
       else
         aShape = Sweep.Shape(); //result is good
-      
+
+      if (!CreateGroups(Sweep, aCI)) {
+        if (aCI) delete aCI;
+        Standard_ConstructionError::Raise("Generate groups failure");
+      }
     }
     else
     {
       GeomFill_Trihedron theBestMode = EvaluateBestSweepMode(aWirePath);
       BRepOffsetAPI_MakePipe aMkPipe(aWirePath, aShapeBase, theBestMode);
 
-      if (aMkPipe.IsDone()) {
+      if (aMkPipe.IsDone() && aMkPipe.ErrorOnSurface() <= TolPipeSurf) {
         aShape = aMkPipe.Shape();
+
+        if (!CreateGroups(aShapeBase, aWirePath, aMkPipe, aCI)) {
+          if (aCI) delete aCI;
+          Standard_ConstructionError::Raise("Generate groups failure");
+        }
       } else if (theBestMode != GeomFill_IsDiscreteTrihedron) {
         // Try to use Descrete Trihedron mode.
         BRepOffsetAPI_MakePipe aMkPipeDescrete
@@ -2500,6 +3141,11 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
 
         if (aMkPipeDescrete.IsDone()) {
           aShape = aMkPipeDescrete.Shape();
+
+          if (!CreateGroups(aShapeBase, aWirePath, aMkPipeDescrete, aCI)) {
+            if (aCI) delete aCI;
+            Standard_ConstructionError::Raise("Generate groups failure");
+          }
         }
       }
     }
@@ -2512,6 +3158,8 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
     Handle(TColStd_HSequenceOfTransient) aLocObjs = aCIDS->GetLocations ();
     Standard_Boolean aWithContact = (aCIDS->GetWithContactMode());
     Standard_Boolean aWithCorrect = (aCIDS->GetWithCorrectionMode());
+    Standard_Boolean isBySteps = aCIDS->GetIsBySteps();
+
     if (aCI) {
       delete aCI;
       aCI = 0;
@@ -2548,7 +3196,24 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
       aHSeqLocs->Append(aShapeLoc);
     }
 
-    aShape = CreatePipeWithDifferentSections(aWirePath, aHSeqBases, aHSeqLocs, aWithContact, aWithCorrect);
+
+    Handle(TColStd_HArray1OfInteger) *pGroups = NULL;
+    Handle(TColStd_HArray1OfInteger)  aGroups[5];
+
+    if (isGenerateGroups) {
+      pGroups = aGroups;
+    }
+
+    aShape = CreatePipeWithDifferentSections
+              (aWirePath, aHSeqBases, aHSeqLocs,
+               aWithContact, aWithCorrect, isBySteps, pGroups);
+
+    if (isGenerateGroups) {
+      // Store created groups.
+      GEOMImpl_IPipeDiffSect aPipeDS(aFunction);
+
+      StoreGroups(&aPipeDS, aGroups);
+    }
   }
 
   //building pipe with shell sections
@@ -2573,19 +3238,8 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
 
   if (aShape.IsNull()) return 0;
 
-  BRepCheck_Analyzer ana (aShape, Standard_False);
-  if (!ana.IsValid()) {
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape,Precision::Confusion(),Precision::Confusion());
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->SetPrecision(Precision::Confusion());
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-
-    ana.Init(aShape, Standard_False);
-    if (!ana.IsValid())
-      Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
-  }
+  if ( !GEOMUtils::CheckShape(aShape) && !GEOMUtils::FixShapeTolerance(aShape) ) 
+    Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
 
   if (aType != PIPE_BASE_PATH &&
       aType != PIPE_SHELLS_WITHOUT_PATH) {
@@ -2599,11 +3253,99 @@ Standard_Integer GEOMImpl_PipeDriver::Execute (TFunction_Logbook& log) const
           aVertMaxTol = aTol;
       }
       aVertMaxTol += Precision::Confusion();
-      aShape = GEOMImpl_GlueDriver::GlueFaces(aShape, aVertMaxTol, Standard_True);
-      //aShape = GEOMImpl_GlueDriver::GlueFaces(aShape, Precision::Confusion(), Standard_True);
+
+      TopTools_DataMapOfShapeListOfShape  aMapModif;
+      TopTools_DataMapOfShapeListOfShape *pMapModif = NULL;
+
+      if (isGenerateGroups) {
+        pMapModif = &aMapModif;
+      }
+
+      TopoDS_Shape aNewShape = GEOMImpl_GlueDriver::GlueFaces
+        (aShape, aVertMaxTol, Standard_True, pMapModif);
+
+      if (isGenerateGroups && !aMapModif.IsEmpty()) {
+        // Update groups.
+        GEOMImpl_IPipe                   aCI(aFunction);
+        Handle(TColStd_HArray1OfInteger) aGroupIDs[5] =
+          { aCI.GetGroupDown(), aCI.GetGroupUp(), aCI.GetGroupSide1(),
+            aCI.GetGroupSide2(), aCI.GetGroupOther() };
+        TopTools_IndexedMapOfShape       anIndices;
+        TopTools_IndexedMapOfShape       aNewIndices;
+        TopTools_SequenceOfShape         aNewShapes[5];
+        TopTools_MapOfShape              aMapReplaced;
+        TopTools_MapOfShape              aMapGlued;
+        Standard_Integer                 iGrp;
+        Standard_Integer                 i;
+
+        TopExp::MapShapes(aShape,    anIndices);
+        TopExp::MapShapes(aNewShape, aNewIndices);
+
+        for (iGrp = 0; iGrp < 5; ++iGrp) {
+          if (aGroupIDs[iGrp].IsNull() == Standard_False) {
+            const Standard_Integer aLower  = aGroupIDs[iGrp]->Lower();
+            const Standard_Integer anUpper = aGroupIDs[iGrp]->Upper();
+
+            for (i = aLower; i <= anUpper; ++i) {
+              const Standard_Integer  anIndex   = aGroupIDs[iGrp]->Value(i);
+              const TopoDS_Shape     &aSubShape = anIndices.FindKey(anIndex);
+
+              if (aMapModif.IsBound(aSubShape)) {
+                const TopTools_ListOfShape         &aListModif =
+                  aMapModif.Find(aSubShape);
+                TopTools_ListIteratorOfListOfShape  anIter(aListModif);
+
+                for (; anIter.More(); anIter.Next()) {
+                  const TopoDS_Shape &aNewShape = anIter.Value();
+
+                  if (aMapReplaced.Add(aNewShape)) {
+                    aNewShapes[iGrp].Append(aNewShape);
+                  } else {
+                    // This is a glued shape. It means that it is internal
+                    // one and should be removed from groups later.
+                    aMapGlued.Add(aNewShape);
+                  }
+                }
+              } else {
+                // Shape is not modified.
+                aNewShapes[iGrp].Append(aSubShape);
+              }
+            }
+          }
+        }
+
+        if (!aMapGlued.IsEmpty()) {
+          // Remove glued (internal) shapes from groups.
+          for (iGrp = 0; iGrp < 5; ++iGrp) {
+            Standard_Integer aNbShapes = aNewShapes[iGrp].Length();
+
+            for (i = 1; i < aNbShapes; ++i) {
+              const TopoDS_Shape &aNewShape = aNewShapes[iGrp].Value(i);
+
+              if (aMapGlued.Contains(aNewShape)) {
+                aNewShapes[iGrp].Remove(i);
+                --i;
+                --aNbShapes;
+              }
+            }
+          }
+        }
+
+        // Store modified groups.
+        Handle(TColStd_HArray1OfInteger) aNewGroupIDs[5];
+
+        if (!FillGroups(aNewShapes, aNewIndices, aNewGroupIDs)) {
+          Standard_ConstructionError::Raise("Generate groups failure");
+        }
+
+        StoreGroups(&aCI, aNewGroupIDs);
+      }
+
+      aShape = aNewShape;
     }
   }
 
+  // Note: group indices should not be changed after the next call.
   TopoDS_Shape aRes = GEOMUtils::CompsolidToCompound(aShape);
   aFunction->SetValue(aRes);
 
@@ -2650,8 +3392,13 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam( theParams, "Bases", aCI.GetBases() );
     AddParam( theParams, "Locations", aCI.GetLocations() );
     AddParam( theParams, "Path", aCI.GetPath() );
-    AddParam( theParams, "With contact", aCI.GetWithContactMode() );
-    AddParam( theParams, "With correction", aCI.GetWithCorrectionMode() );
+
+    if (!aCI.GetIsBySteps()) {
+      AddParam( theParams, "With contact", aCI.GetWithContactMode() );
+      AddParam( theParams, "With correction", aCI.GetWithCorrectionMode() );
+    }
+
+    AddParam( theParams, "Step by step", aCI.GetIsBySteps() );
     break;
   }
   case PIPE_SHELL_SECTIONS:
index ddc520250b9944975275e59ae4826a489afd8c2c..7675369469e974b071a688c8235522e8e365141a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -83,11 +83,13 @@ public:
   Standard_EXPORT ~GEOMImpl_PipeDriver() {};
 
   Standard_EXPORT static TopoDS_Shape CreatePipeWithDifferentSections
-                                     (const TopoDS_Wire& theWirePath,
-                                      const Handle(TopTools_HSequenceOfShape) theBases,
-                                      const Handle(TopTools_HSequenceOfShape) theLocs,
-                                      const Standard_Boolean theWithContact,
-                                      const Standard_Boolean theWithCorrect);
+                  (const TopoDS_Wire                       &theWirePath,
+                   const Handle(TopTools_HSequenceOfShape)  theBases,
+                   const Handle(TopTools_HSequenceOfShape)  theLocs,
+                   const Standard_Boolean                   theWithContact,
+                   const Standard_Boolean                   theWithCorrect,
+                   const Standard_Boolean                   IsBySteps,
+                         Handle(TColStd_HArray1OfInteger)  *theGroups = NULL);
 
   Standard_EXPORT virtual
   bool GetCreationInformation(std::string&             theOperationName,
index 25bf5cdffc87750b8b91688960aaeccfaf42ed30..d76487edd34b2f899582ca119a85e25432dec699 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
-#include <Basics_OCCTVersion.hxx>
-
 #include <GEOMImpl_PipePathDriver.hxx>
-
-#include <GEOMImpl_IShapesOperations.hxx>
 #include <GEOMImpl_ShapeDriver.hxx>
 #include <GEOMImpl_IPipePath.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
 
-#include <ShapeAnalysis_FreeBounds.hxx>
-#include <ShapeAnalysis_Edge.hxx>
-#include <ShapeFix_Face.hxx>
-#include <ShapeFix_Shell.hxx>
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-
-#include <BRep_Tool.hxx>
-#include <BRep_Builder.hxx>
-#include <BRepBuilderAPI_Copy.hxx>
-#include <BRepBuilderAPI_MakeFace.hxx>
-#include <BRepBuilderAPI_MakeWire.hxx>
-#include <BRepBuilderAPI_Sewing.hxx>
-#include <BRepCheck_Analyzer.hxx>
-#include <BRepGProp.hxx>
-#include <BRepOffsetAPI_MakePipe.hxx>
-#include <BRepOffsetAPI_MakePipeShell.hxx>
-
 #include <BRepOffsetAPI_MiddlePath.hxx>
-
-#include <TopAbs.hxx>
-#include <TopExp.hxx>
-#include <TopExp_Explorer.hxx>
-#include <TopoDS.hxx>
-#include <TopoDS_Wire.hxx>
-#include <TopoDS_Edge.hxx>
-#include <TopoDS_Shape.hxx>
-#include <TopoDS_Solid.hxx>
-#include <TopoDS_Shell.hxx>
-#include <TopoDS_Face.hxx>
-#include <TopoDS_Compound.hxx>
-#include <TopTools_SequenceOfShape.hxx>
-#include <TopTools_HSequenceOfShape.hxx>
-#include <TopTools_IndexedDataMapOfShapeShape.hxx>
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-
-#include <GProp_GProps.hxx>
-
-#include <GeomAPI_ProjectPointOnCurve.hxx>
-#include <GeomAPI_Interpolate.hxx>
-#include <Geom_TrimmedCurve.hxx>
-#include <Geom_Plane.hxx>
-#include <Geom_RectangularTrimmedSurface.hxx>
-#include <Geom_BezierSurface.hxx>
-#include <Geom_Line.hxx>
-#include <Geom_Conic.hxx>
-#include <Geom_BSplineCurve.hxx>
-#include <Geom_BSplineSurface.hxx>
-#include <GeomFill_BSplineCurves.hxx>
-#include <GeomConvert_ApproxCurve.hxx>
-#include <GeomConvert.hxx>
-
-#include <TColgp_SequenceOfPnt.hxx>
-#include <TColgp_HArray1OfPnt.hxx>
-#include <TColgp_Array2OfPnt.hxx>
 #include <TColStd_HSequenceOfTransient.hxx>
-
 #include <Precision.hxx>
-
 #include <Standard_NullObject.hxx>
-#include <Standard_TypeMismatch.hxx>
-#include <Standard_ConstructionError.hxx>
-
-#include "utilities.h"
 
 //=======================================================================
 //function : GetID
index cf4d6812dafebf2373d888b289b6eb3f2f2bb39c..9cc2080f3b9c564d490bb5c395dc603a0635bcd0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ef21d17645d375b95df8eb8d2329b031c45c4de7..2dfcfc42cd940ad933e6a839d69d2fb63554c751 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index daa5c633ffbf1ea40b369a564fbd9b39b4d2a0f8..0b6fa941892474feb292a0dab044a864eabd30b6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c0c72508ae9df5fcba6830948d32cedf0e9e7d2e..f80ba42b986d9cf384d24c537f849386a3c4b76c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -145,7 +145,14 @@ Standard_Integer GEOMImpl_PointDriver::Execute(TFunction_Logbook& log) const
     Standard_Real aFP, aLP, aP;
     Handle(Geom_Curve) aCurve = BRep_Tool::Curve(TopoDS::Edge(aRefShape), aFP, aLP);
     if ( !aCurve.IsNull() ) {
-      aP = aFP + (aLP - aFP) * aPI.GetParameter();
+      if (aPI.GetTakeOrientationIntoAccount() &&
+          aRefShape.Orientation() == TopAbs_REVERSED) {
+        aP = 1. - aPI.GetParameter();
+      } else {
+        aP = aPI.GetParameter();
+      }
+
+      aP = aFP + (aLP - aFP) * aP;
       aPnt = aCurve->Value(aP);
     }
     else {
@@ -393,6 +400,7 @@ GetCreationInformation(std::string&             theOperationName,
   case POINT_CURVE_PAR:
     AddParam( theParams, "Edge", aCI.GetCurve() );
     AddParam( theParams, "Parameter", aCI.GetParameter() );
+    AddParam( theParams, "Use Orientation", aCI.GetTakeOrientationIntoAccount() );
     break;
   case POINT_CURVE_COORD:
     AddParam( theParams, "X", aCI.GetX() );
index 5fa8c7fb34120b0540a5ebf450f5eb6d95cfb466..86cbfbbe6542728cc899d16ab0860d49c61cd566 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1a996c1e514e19efea9155654dabffed4258a108..60a8aaa409e6ca6103d170e323bb27b9d56371ea 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b3f89d91e817c5cad7c847e684ccbdf801bd8520..0f43235ce87a9b33fa50e86de76b3184702f794c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 05fb9a61a796ddbadc08e1abb9215d79660fa29c..a661b0a8dfc83363bfee5d9ce0e559061956ea55 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -152,7 +152,7 @@ void GEOMImpl_PolylineDumper::init()
     }
   }
 
-  char *aSeparator = "\n\t";
+  const char *aSeparator = "\n\t";
   Standard_Integer i;
   std::list <std::list <double> >::const_iterator anIt = myCoords.begin();
 
index 1fe396bfd94a4b696db21ee9b8a7cf185291a942..ca14e806fe552591818d418bdfedb8813dbbf09c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3e4a9058d05a9d801388eeaa462fb9b69090143d..94a251dea520578d3a21222a6fa253ccdc12f6db 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f60befe0bed69eb3b4904b341e5cad941adc286b..b7abfa02bdc84320ce2eb27f07e1a717c17d3258 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1b9c4e4f89e0990acbb815d89a1a10615d5c7b48..48e5353ea0989379389548146902734337606ac3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -196,6 +196,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
     Standard_Real aHeight    = aCI.GetH();                  // Height of the extrusion
     Standard_Real anAngle    = aCI.GetDraftAngle();         // Draft angle
     Standard_Boolean isProtrusion = (aCI.GetFuseFlag()==1); 
+    Standard_Boolean isInvert = aCI.GetInvertFlag();
     // Flag to know wether the feature is a protrusion (fuse) or a depression (cut)
     
     // history of the Base wire (RefBase)
@@ -217,7 +218,7 @@ Standard_Integer GEOMImpl_PrismDriver::Execute(TFunction_Logbook& log) const
     if(!aSuppObj.IsNull())      // If the wire has a support
       aSupport = aSuppObj->GetValue();
     
-    aShape = MakeDraftPrism(anInitShape, aSketch, aHeight, anAngle, isProtrusion, aSupport); 
+    aShape = MakeDraftPrism(anInitShape, aSketch, aHeight, anAngle, isProtrusion, aSupport, isInvert);
   }
 
   if (aShape.IsNull()) return 0;
@@ -350,7 +351,8 @@ TopoDS_Shape GEOMImpl_PrismDriver::MakeScaledPrism (const TopoDS_Shape& theShape
   aLocs->Append(aShapeCDG_1);
   aLocs->Append(aShapeCDG_2);
 
-  aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections(aWirePath, aBases, aLocs, false, false);
+  aShape = GEOMImpl_PipeDriver::CreatePipeWithDifferentSections
+              (aWirePath, aBases, aLocs, false, false, false);
 
   // 7. Make a solid, if possible
   if (theShapeBase.ShapeType() == TopAbs_FACE) {
@@ -411,7 +413,8 @@ TopoDS_Shape GEOMImpl_PrismDriver::MakeDraftPrism ( const TopoDS_Shape& theInitS
                                                     const Standard_Real theHeight,
                                                     const Standard_Real theAngle,
                                                     bool                isProtrusion,
-                                                    const TopoDS_Shape& theSupport)
+                                                    const TopoDS_Shape& theSupport,
+                                                    bool                isInvert)
 {
   TopoDS_Shape aShape;
   
@@ -470,11 +473,11 @@ TopoDS_Shape GEOMImpl_PrismDriver::MakeDraftPrism ( const TopoDS_Shape& theInitS
     } 
     
     // Invert height and angle if the operation is an extruded cut
-    bool invert = !isProtrusion; 
+    bool invert = isInvert? isProtrusion : !isProtrusion;
     
     // If the face has a reversed orientation invert for extruded boss operations
     if(aFaceBase.Orientation() == TopAbs_REVERSED)
-      invert = isProtrusion;
+      invert = !invert;
 
     Standard_Real anAngle = theAngle;
     Standard_Real aHeight = theHeight;
index 4eb9bfb4626a3d4fe1a0434fc861997181cbc19f..2d771557824603bb7f0b23c26d8ea17524b4e489 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -93,7 +93,8 @@ public:
                                                       const Standard_Real theHeight,
                                                       const Standard_Real theAngle,
                                                       bool                isProtrusion,
-                                                      const TopoDS_Shape& theSupport);
+                                                      const TopoDS_Shape& theSupport,
+                                                      bool                isInvert = false);
 
   Standard_EXPORT virtual
   bool GetCreationInformation(std::string&             theOperationName,
index 3e025ccd04f992b1c35728dd465824964e3d5cd9..db0fae3496395fbd10559987dc381c6985eeeb17 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <GEOMImpl_IMirror.hxx>
 #include <GEOMImpl_IProjection.hxx>
+#include <GEOMImpl_IProjOnCyl.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
+#include <GEOMUtils.hxx>
+#include <GEOMUtils_HTrsfCurve2d.hxx>
 
+#include <Approx_Curve2d.hxx>
+#include <Bnd_Box2d.hxx>
+#include <BndLib_Add2dCurve.hxx>
 #include <BRep_Tool.hxx>
+#include <BRepAdaptor_Curve2d.hxx>
 #include <BRepBuilderAPI_Transform.hxx>
+#include <BRepBuilderAPI_MakeEdge.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
 #include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRepBuilderAPI_MakeWire.hxx>
 #include <BRepClass_FaceClassifier.hxx>
 #include <BRepExtrema_DistShapeShape.hxx>
+#include <BRepLib.hxx>
 #include <BRepOffsetAPI_NormalProjection.hxx>
 #include <BRepTools.hxx>
+#include <BRepTools_WireExplorer.hxx>
 
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Face.hxx>
 #include <TopoDS_Vertex.hxx>
-#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopoDS_Wire.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
 
 #include <GeomAPI_ProjectPointOnSurf.hxx>
 #include <Geom_Curve.hxx>
+#include <Geom_CylindricalSurface.hxx>
 #include <Geom_Plane.hxx>
+#include <Geom2d_TrimmedCurve.hxx>
 
 #include <gp_Trsf.hxx>
 #include <gp_Pnt.hxx>
@@ -400,6 +415,43 @@ Standard_Integer GEOMImpl_ProjectionDriver::Execute(TFunction_Logbook& log) cons
     if (!hasValidSolution) {
       Standard_ConstructionError::Raise("Projection aborted : no projection");
     }
+  } else if (aType == PROJECTION_ON_CYLINDER) {
+    GEOMImpl_IProjOnCyl   aProj (aFunction);
+    Handle(GEOM_Function) aShapeFunction = aProj.GetShape();
+      
+    if (aShapeFunction.IsNull()) {
+      return 0;
+    }
+
+    TopoDS_Shape aShape = aShapeFunction->GetValue();
+
+    if (aShape.IsNull()) {
+      return 0;
+    }
+
+    // Get the face.
+    const TopAbs_ShapeEnum aType          = aShape.ShapeType();
+    const Standard_Real    aRadius        = aProj.GetRadius();
+    const Standard_Real    aStartAngle    = aProj.GetStartAngle();
+    const Standard_Real    aLengthAngle   = aProj.GetAngleLength();
+    const Standard_Real    aRotationAngle = aProj.GetAngleRotation();
+
+    if (aType != TopAbs_WIRE && aType != TopAbs_FACE) {
+      return 0;
+    }
+
+    if (aRadius <= Precision::Confusion()) {
+      return 0;
+    }
+
+    TopoDS_Shape aProjShape = projectOnCylinder
+      (aShape, aRadius, aStartAngle, aLengthAngle, aRotationAngle);
+
+    if (aProjShape.IsNull()) {
+      return 0;
+    }
+
+    aFunction->SetValue(aProjShape);
   }
 
   return 1;
@@ -424,28 +476,328 @@ GetCreationInformation(std::string&             theOperationName,
 
   switch ( aType ) {
   case PROJECTION_COPY:
-    {
-      GEOMImpl_IMirror aCI( function );
+  {
+    GEOMImpl_IMirror aCI( function );
 
-      AddParam( theParams, "Source object", aCI.GetOriginal() );
-      AddParam( theParams, "Target face", aCI.GetPlane() );
-      break;
-    }
+    AddParam( theParams, "Source object", aCI.GetOriginal() );
+    AddParam( theParams, "Target face", aCI.GetPlane() );
+    break;
+  }
   case PROJECTION_ON_WIRE:
-    {
-      GEOMImpl_IProjection aProj (function);
+  {
+    GEOMImpl_IProjection aProj (function);
+
+    AddParam(theParams, "Point", aProj.GetPoint());
+    AddParam(theParams, "Shape", aProj.GetShape());
 
-      AddParam(theParams, "Point", aProj.GetPoint());
-      AddParam(theParams, "Shape", aProj.GetShape());
+    break;
+  }
+  case PROJECTION_ON_CYLINDER:
+  {
+    theOperationName = "PROJ_ON_CYL";
+
+    GEOMImpl_IProjOnCyl aProj (function);
+    const Standard_Real aLengthAngle = aProj.GetAngleLength();
 
-      break;
+    AddParam(theParams, "Shape",        aProj.GetShape());
+    AddParam(theParams, "Radius",       aProj.GetRadius());
+    AddParam(theParams, "Start angle",  aProj.GetStartAngle());
+
+    if (aLengthAngle >= 0.) {
+      AddParam(theParams, "Length angle", aLengthAngle);
     }
+
+    AddParam(theParams, "Rotation angle", aProj.GetAngleRotation());
+
+    break;
+  }
   default:
     return false;
   }
-  
+
   return true;
 }
 
+//================================================================================
+/*!
+ * \brief Performs projection of a planar wire or a face on a cylinder.
+ */
+//================================================================================
+
+TopoDS_Shape GEOMImpl_ProjectionDriver::projectOnCylinder
+                                (const TopoDS_Shape  &theShape,
+                                 const Standard_Real  theRadius,
+                                 const Standard_Real  theStartAngle,
+                                 const Standard_Real  theAngleLength,
+                                 const Standard_Real  theAngleRotation) const
+{
+  TopoDS_Shape aResult;
+
+  // Get the face.
+  const TopAbs_ShapeEnum aType = theShape.ShapeType();
+  TopoDS_Face            aFace;
+
+  if (aType == TopAbs_WIRE) {
+    // Try to create a planar face.
+    TopoDS_Wire             aWire = TopoDS::Wire(theShape);
+    BRepBuilderAPI_MakeFace aMkFace(aWire, Standard_True);
+
+    if (aMkFace.IsDone()) {
+      aFace = aMkFace.Face();
+    } else {
+      // Check if the wire is a straight line.
+      TopExp_Explorer anEExp(aWire, TopAbs_EDGE);
+      TopoDS_Edge     anEdge;
+
+      for (; anEExp.More(); anEExp.Next()) {
+        anEdge = TopoDS::Edge(anEExp.Current());
+
+        if (!BRep_Tool::Degenerated(anEdge)) {
+          break;
+        }
+      }
+
+      if (anEExp.More()) {
+        // Not degenerated edge found. Try to create a plane.
+        Standard_Real      aPar[2];
+        Handle(Geom_Curve) aCurve = BRep_Tool::Curve(anEdge, aPar[0], aPar[1]);
+        gp_Pnt             aP0    = aCurve->Value(aPar[0]);
+        gp_Pnt             aP1    = aCurve->Value(0.5*(aPar[1] + aPar[0]));
+        gp_Vec             aX(aP1.XYZ().Subtracted(aP0.XYZ()));
+        Standard_Real      aTolConf = Precision::Confusion();
+
+        if (aX.Magnitude() > aTolConf) {
+          aX.Normalize();
+
+          // Get the plane normal ortogonal to Z axis.
+          gp_Vec aZ(0., 0., 1.);
+          gp_Vec aN = aX.Crossed(aZ);
+
+          if (aN.Magnitude() <= aTolConf) {
+            // aX is parallel to aZ. Get the plane normal ortogonal to Y axis.
+            gp_Vec aY(0., 1., 0.);
+
+            aN = aX.Crossed(aY);
+          }
+
+          if (aN.Magnitude() >      aTolConf) {
+            gp_Ax3                  anAxis(aP0, gp_Dir(aN), gp_Dir(aX));
+            Handle(Geom_Plane)      aPlane = new Geom_Plane(anAxis);
+            BRepBuilderAPI_MakeFace aMkFace(aPlane, aWire);
+
+            if (aMkFace.IsDone()) {
+              aFace = aMkFace.Face();
+            }
+          }
+        }
+      }
+    }
+  } else if (aType == TopAbs_FACE) {
+    aFace = TopoDS::Face(theShape);
+  }
+
+  if (aFace.IsNull()) {
+    return aResult;
+  }
+
+  // Compute 2d translation transformation.
+  TopoDS_Wire            anOuterWire = BRepTools::OuterWire(aFace);
+  BRepTools_WireExplorer aOWExp(anOuterWire, aFace);
+
+  if (!aOWExp.More()) {
+    // NEVERREACHED
+    return aResult;
+  }
+
+  // Rotate 2D presentation of face.
+  TopoDS_Vertex       aFirstVertex = aOWExp.CurrentVertex();
+  TopoDS_Edge         aFirstEdge   = aOWExp.Current();
+  gp_Pnt              aPnt         = BRep_Tool::Pnt(aFirstVertex);
+  BRepAdaptor_Curve2d anAdaptorCurve(aFirstEdge, aFace);
+  Standard_Real       aParam       =
+    BRep_Tool::Parameter(aFirstVertex, aFirstEdge, aFace);
+  gp_Pnt2d            aPntUV;
+  gp_Vec2d            aVecUV;
+  gp_Vec2d            aVecU0(1., 0);
+
+  anAdaptorCurve.D1(aParam, aPntUV, aVecUV);
+
+  if (aVecUV.Magnitude() <= gp::Resolution()) {
+    return aResult;
+  }
+
+  if (aFirstEdge.Orientation() == TopAbs_REVERSED) {
+    aVecUV.Reverse();
+  }
+
+  const Standard_Real    anAngle    = aVecUV.Angle(aVecU0) + theAngleRotation;
+  const Standard_Boolean isToRotate = Abs(anAngle) > Precision::Angular();
+  gp_Trsf2d              aRotTrsf;
+  Bnd_Box2d              aUVBox;
+  Standard_Real          aPar[2];
+
+  if (isToRotate) {
+    aRotTrsf.SetRotation(aPntUV, anAngle);
+  }
+
+  for (; aOWExp.More(); aOWExp.Next()) {
+    TopoDS_Edge                 anEdge   = aOWExp.Current();
+    Handle(Geom2d_Curve)        aCurve   =
+        BRep_Tool::CurveOnSurface(anEdge, aFace, aPar[0], aPar[1]);
+
+    if (aCurve.IsNull()) {
+      continue;
+    }
+
+    if (isToRotate) {
+      aCurve = Handle(Geom2d_Curve)::DownCast(aCurve->Transformed(aRotTrsf));
+    }
+
+    BndLib_Add2dCurve::Add(aCurve, aPar[0], aPar[1], 0., aUVBox);
+  }
+
+  Standard_Real aU[2];
+  Standard_Real aV[2];
+
+  aUVBox.Get(aU[0], aV[0], aU[1], aV[1]);
+
+  // Compute anisotropic transformation from a face's 2d space
+  // to cylinder's 2d space.
+  GEOMUtils::Trsf2d aTrsf2d
+            (1./theRadius, 0., theStartAngle - aU[0]/theRadius,
+             0.,           1., aPnt.Z() - aPntUV.Y());
+
+  // Compute scaling trsf.
+  const Standard_Boolean isToScale = theAngleLength >= Precision::Angular();
+  gp_Trsf2d aScaleTrsf;
+
+  if (isToScale) {
+    // Perform 2d scaling.
+    gp_Pnt2d            aMidPnt(0.5*(aU[1] + aU[0]), 0.5*(aV[1] + aV[0]));
+    const Standard_Real aScaleFactor = theAngleLength*theRadius/(aU[1] - aU[0]);
+
+    aTrsf2d.TransformD0(aMidPnt);
+
+    aScaleTrsf.SetScale(aMidPnt, aScaleFactor);
+  }
+
+  // Get 2d presentation of a face.
+  Handle(Geom_Surface) aCylinder =
+    new Geom_CylindricalSurface(gp_Ax3(), theRadius);
+  GeomAdaptor_Surface  aGACyl(aCylinder);
+  TopExp_Explorer      anExp(aFace, TopAbs_WIRE);
+  TopTools_ListOfShape aWires;
+  Standard_Real        aUResol = aGACyl.UResolution(Precision::Confusion());
+  Standard_Real        aVResol = aGACyl.VResolution(Precision::Confusion());
+
+  for (; anExp.More(); anExp.Next()) {
+    TopoDS_Wire             aWire = TopoDS::Wire(anExp.Current());
+    BRepTools_WireExplorer  aWExp(aWire, aFace);
+    BRepBuilderAPI_MakeWire aMkWire;
+
+    for (; aWExp.More(); aWExp.Next()) {
+      TopoDS_Edge                 anEdge   = aWExp.Current();
+      Handle(Geom2d_Curve)        aCurve   =
+        BRep_Tool::CurveOnSurface(anEdge, aFace, aPar[0], aPar[1]);
+
+      if (aCurve.IsNull()) {
+        continue;
+      }
+
+      if (isToRotate) {
+        aCurve = Handle(Geom2d_Curve)::DownCast(aCurve->Transformed(aRotTrsf));
+      }
+
+      // Transform the curve to cylinder's parametric space.
+      GEOMUtils::Handle(HTrsfCurve2d) aTrsfCurve =
+        new GEOMUtils::HTrsfCurve2d(aCurve, aPar[0], aPar[1], aTrsf2d);
+      Approx_Curve2d                  aConv (aTrsfCurve, aPar[0], aPar[1],
+                                                         aUResol, aVResol, GeomAbs_C1,
+                                             9, 1000);
+
+      if (!aConv.IsDone() && !aConv.HasResult()) {
+        return aResult;
+      }
+
+      Handle(Geom2d_Curve) aCylCurve = aConv.Curve();
+
+      if (isToScale) {
+        aCylCurve->Transform(aScaleTrsf);
+      }
+
+      // Create edge and add it to the wire.
+      BRepBuilderAPI_MakeEdge aMkEdge(aCylCurve, aCylinder);
+
+      if (!aMkEdge.IsDone()) {
+        return aResult;
+      }
+
+      aMkWire.Add(aMkEdge.Edge());
+
+      if (!aMkWire.IsDone()) {
+        return aResult;
+      }
+    }
+
+    if (aWire.IsSame(anOuterWire)) {
+      // Make the outer wire first.
+      aWires.Prepend(aMkWire.Wire());
+    } else {
+      aWires.Append(aMkWire.Wire());
+    }
+  }
+
+  // Create a face.
+  if (aWires.IsEmpty()) {
+    return aResult;
+  }
+
+  TopTools_ListIteratorOfListOfShape aWIter(aWires);
+  TopoDS_Wire                        aWire = TopoDS::Wire(aWIter.Value());
+  BRepBuilderAPI_MakeFace aMkFace(aCylinder, aWire);
+
+  if (!aMkFace.IsDone()) {
+    return aResult;
+  }
+
+  for (aWIter.Next(); aWIter.More(); aWIter.Next()) {
+    aWire = TopoDS::Wire(aWIter.Value());
+    aMkFace.Add(aWire);
+
+    if (!aMkFace.IsDone()) {
+      return aResult;
+    }
+  }
+
+  // Build 3D curves.
+  TopoDS_Face  aCylFace = aMkFace.Face();
+  TopoDS_Shape aResShape;
+
+  BRepLib::BuildCurves3d(aCylFace);
+
+  // Check shape.
+  if (aType == TopAbs_WIRE) {
+    TopExp_Explorer aResExp(aCylFace, TopAbs_WIRE);
+
+    if (aResExp.More()) {
+      aResShape = aResExp.Current();
+    }
+  } else {
+    aResShape = aCylFace;
+  }
+
+  if (aResShape.IsNull() == Standard_False) {
+    if (!GEOMUtils::CheckShape(aResShape, true)) {
+      if (!GEOMUtils::FixShapeTolerance(aResShape)) {
+        return aResult;
+      }
+    }
+
+    aResult = aResShape;
+  }
+
+  return aResult;
+}
+
 IMPLEMENT_STANDARD_HANDLE (GEOMImpl_ProjectionDriver,GEOM_BaseDriver);
 IMPLEMENT_STANDARD_RTTIEXT (GEOMImpl_ProjectionDriver,GEOM_BaseDriver);
index e601573a4ee8c6b46f74babc312ca71350c9376f..47dfc44139c34e2e80295629722394668ae7d90e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -58,6 +58,7 @@
 #endif
 
 class TColStd_SequenceOfExtendedString;
+class TopoDS_Shape;
 
 
 #include "GEOM_BaseDriver.hxx"
@@ -81,6 +82,16 @@ Standard_EXPORT ~GEOMImpl_ProjectionDriver() {};
   bool GetCreationInformation(std::string&             theOperationName,
                               std::vector<GEOM_Param>& params);
 
+private:
+
+  TopoDS_Shape projectOnCylinder(const TopoDS_Shape  &theShape,
+                                 const Standard_Real  theRadius,
+                                 const Standard_Real  theStartAngle,
+                                 const Standard_Real  theAngleLength,
+                                 const Standard_Real  theAngleRotation) const;
+
+public:
+
 DEFINE_STANDARD_RTTI( GEOMImpl_ProjectionDriver )
 };
 
index e58d349d68ba25d27771f011263891782582a84f..7a09b445fbd9ec48b4b98b8761a82073c665ad79 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 625069f44467345be784bc67f0e3eaf91442149b..74766f8eedf8a3f3cda7b94b608f363750b8f30e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c1278f7f4644c1135bc97e22de7482b180aa523b..b9a4ff32f5461cf6909f4e32ebcbbf8ce484a859 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 6e428fb0c38b1cc5fb7b4f6bc494bbc90f01a346..fca3db742525073b38d586e5782af80a47552f3f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3525ed57b489258e6e4bdb61a57893f28f36368c..2312a74a987a1429d90bb8553c11054ee0fa3b68 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_ScaleDriver.hxx>
 #include <GEOMImpl_IScale.hxx>
 #include <GEOMImpl_Types.hxx>
+#include <GEOMUtils.hxx>
 #include <GEOM_Function.hxx>
 
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-
 #include <BRepBuilderAPI_Transform.hxx>
 #include <BRepBuilderAPI_GTransform.hxx>
 #include <BRep_Tool.hxx>
-#include <BRepAlgo.hxx>
-#include <BRepCheck_Analyzer.hxx>
 
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
-#include <TopoDS_Vertex.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 
 #include <Precision.hxx>
@@ -175,19 +168,8 @@ Standard_Integer GEOMImpl_ScaleDriver::Execute(TFunction_Logbook& log) const
 
   if (aShape.IsNull()) return 0;
 
-  BRepCheck_Analyzer ana (aShape, Standard_False);
-  if (!ana.IsValid()) {
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape,Precision::Confusion(),Precision::Confusion());
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->SetPrecision(Precision::Confusion());
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-
-    ana.Init(aShape, Standard_False);
-    if (!ana.IsValid())
-      Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result");
-  }
+  if ( !GEOMUtils::CheckShape(aShape) && !GEOMUtils::FixShapeTolerance(aShape) )
+    Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result");
 
   aFunction->SetValue(aShape);
 
index a88645819f343499255d54269d6b377a4b293766..998b781d7fd1928a714540b38c2f268f87dc3199 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 037e6290005ccdc7adc7d9dd14689d903605c213..8b585f83eb84600974d473540fda0a53d1070955 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <GEOMImpl_IIsoline.hxx>
 #include <GEOMImpl_IShapes.hxx>
+#include <GEOMImpl_IShapeExtend.hxx>
 #include <GEOMImpl_IVector.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOMImpl_Block6Explorer.hxx>
 
 #include <GEOM_Function.hxx>
 #include <GEOMUtils_Hatcher.hxx>
+#include <GEOMAlgo_State.hxx>
 
 // OCCT Includes
 #include <ShapeFix_Wire.hxx>
@@ -42,6 +44,7 @@
 #include <BRepAlgo_FaceRestrictor.hxx>
 #include <BRepBuilderAPI_Copy.hxx>
 #include <BRepBuilderAPI_Sewing.hxx>
+#include <BRepBuilderAPI_MakeFace.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
 #include <BRepBuilderAPI_MakeEdge.hxx>
 #include <BRepBuilderAPI_MakeSolid.hxx>
@@ -56,6 +59,8 @@
 #include <ShapeAnalysis.hxx>
 #include <ShapeAnalysis_FreeBounds.hxx>
 
+#include <TNaming_CopyShape.hxx>
+
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
 #include <TopExp_Explorer.hxx>
 #include <GCPnts_AbscissaPoint.hxx>
 
 #include <Geom_TrimmedCurve.hxx>
+#include <Geom_RectangularTrimmedSurface.hxx>
 #include <Geom_Surface.hxx>
 #include <GeomAbs_CurveType.hxx>
 #include <GeomConvert_CompCurveToBSplineCurve.hxx>
 #include <GeomConvert.hxx>
 #include <GeomLProp.hxx>
 
+#include <TColStd_IndexedDataMapOfTransientTransient.hxx>
 #include <TColStd_SequenceOfReal.hxx>
 #include <TColStd_HSequenceOfTransient.hxx>
 #include <TColStd_Array1OfReal.hxx>
 #include <Standard_TypeMismatch.hxx>
 #include <Standard_ConstructionError.hxx>
 
-// Uncomment this definition to check if type of created shape is the same
-// as expected. For further details please see the Mantis issue
-// http://salome.mantis.opencascade.com/view.php?id=22674 
-//#define RESULT_TYPE_CHECK
+#include <BOPAlgo_PaveFiller.hxx>
+#include <BOPAlgo_MakerVolume.hxx>
+
+#include <list>
+
+namespace
+{
+  // check that compound includes only shapes of expected type
+  bool checkCompound( TopoDS_Shape& c, TopAbs_ShapeEnum t )
+  {
+    TopoDS_Iterator it( c, Standard_True, Standard_True );
+
+    // empty compound is OK only if we explicitly create a compound of shapes
+    bool result = true;
+
+    // => if expected type is TopAbs_SHAPE, we allow compound consisting of any shapes, this above check is enough
+    // => otherwise we have to check compound's content
+    // => compound sometimes can contain enclosed compound(s), we process them recursively and rebuild initial compound
+
+    if ( t != TopAbs_SHAPE ) {
+      result = it.More();
+      std::list<TopoDS_Shape> compounds, shapes;
+      compounds.push_back( c );
+      while ( !compounds.empty() && result ) {
+        // check that compound contains only shapes of expected type
+        TopoDS_Shape cc = compounds.front();
+        compounds.pop_front();
+        it.Initialize( cc, Standard_True, Standard_True );
+        for ( ; it.More() && result; it.Next() ) {
+          TopAbs_ShapeEnum tt = it.Value().ShapeType();
+          if ( tt == TopAbs_COMPOUND || tt == TopAbs_COMPSOLID ) {
+            compounds.push_back( it.Value() );
+            continue;
+          }
+          shapes.push_back( it.Value() );
+          result = tt == t;
+        }
+      }
+      if ( result ) {
+        if ( shapes.empty() ) {
+          result = false;
+        }
+        else if ( shapes.size() == 1 ) {
+          c = shapes.front();
+        }
+        else {
+          BRep_Builder b;
+          TopoDS_Compound newc;
+          b.MakeCompound( newc );
+          std::list<TopoDS_Shape> ::const_iterator sit;
+          for ( sit = shapes.begin(); sit != shapes.end(); ++sit )
+          b.Add( newc, *sit );
+          c = newc;
+        }
+      }
+    }
+
+    return result;
+  }
+}
 
 //modified by NIZNHY-PKV Wed Dec 28 13:48:20 2011f
 //static
@@ -139,16 +202,17 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
 
   TopoDS_Shape aShape;
   TCollection_AsciiString aWarning;
-#ifdef RESULT_TYPE_CHECK
+
+  // this is an exact type of expected shape, or shape in a compound if compound is allowed as a result (see below)
   TopAbs_ShapeEnum anExpectedType = TopAbs_SHAPE;
-#endif
+  // this should be true if result can be a compound of shapes of strict type (see above)
+  bool allowCompound = false;
 
   BRep_Builder B;
 
   if (aType == WIRE_EDGES) {
-#ifdef RESULT_TYPE_CHECK
+    // result may be only a single wire
     anExpectedType = TopAbs_WIRE;
-#endif
 
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
 
@@ -159,9 +223,9 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     aShape = MakeWireFromEdges(aShapes, aTolerance);
   }
   else if (aType == FACE_WIRE) {
-#ifdef RESULT_TYPE_CHECK
+    // result may be a face or a compound of faces
     anExpectedType = TopAbs_FACE;
-#endif
+    allowCompound = true;
 
     Handle(GEOM_Function) aRefBase = aCI.GetBase();
     TopoDS_Shape aShapeBase = aRefBase->GetValue();
@@ -178,7 +242,7 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
         Standard_NullObject::Raise
           ("Shape for face construction is not closed");
     }
-    else if (aShapeBase.ShapeType() == TopAbs_EDGE && aShapeBase.Closed()) {
+    else if (aShapeBase.ShapeType() == TopAbs_EDGE && BRep_Tool::IsClosed(aShapeBase)) {
       BRepBuilderAPI_MakeWire MW;
       MW.Add(TopoDS::Edge(aShapeBase));
       if (!MW.IsDone()) {
@@ -196,9 +260,9 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     }
   }
   else if (aType == FACE_WIRES) {
-#ifdef RESULT_TYPE_CHECK
+    // result may be a face or a compound of faces
     anExpectedType = TopAbs_FACE;
-#endif
+    allowCompound = true;
 
     // Try to build a face from a set of wires and edges
     int ind;
@@ -212,6 +276,7 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     // 1. Extract all edges from the given arguments
     TopTools_MapOfShape aMapEdges;
     Handle(TopTools_HSequenceOfShape) aSeqEdgesIn = new TopTools_HSequenceOfShape;
+    TColStd_IndexedDataMapOfTransientTransient aMapTShapes;
 
     for (ind = 1; ind <= nbshapes; ind++) {
       Handle(GEOM_Function) aRefSh_i = Handle(GEOM_Function)::DownCast(aShapes->Value(ind));
@@ -220,11 +285,20 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
       TopExp_Explorer anExpE_i (aSh_i, TopAbs_EDGE);
       for (; anExpE_i.More(); anExpE_i.Next()) {
         if (aMapEdges.Add(anExpE_i.Current())) {
-          aSeqEdgesIn->Append(anExpE_i.Current());
+          // Copy the original shape.
+          TopoDS_Shape aShapeCopy;
+
+          TNaming_CopyShape::CopyTool
+            (anExpE_i.Current(), aMapTShapes, aShapeCopy);
+          aSeqEdgesIn->Append(aShapeCopy);
         }
       }
     }
 
+    if (aSeqEdgesIn->IsEmpty()) {
+      Standard_ConstructionError::Raise("No edges given");
+    }
+
     // 2. Connect edges to wires of maximum length
     Handle(TopTools_HSequenceOfShape) aSeqWiresOut;
     ShapeAnalysis_FreeBounds::ConnectEdgesToWires(aSeqEdgesIn, Precision::Confusion(),
@@ -315,10 +389,47 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
       aShape = C;
     }
   }
+  else if (aType == FACE_FROM_SURFACE) {
+    // result may be only a face
+    anExpectedType = TopAbs_FACE;
+
+    Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
+
+    if (aShapes.IsNull() == Standard_False) {
+      Standard_Integer aNbShapes = aShapes->Length();
+
+      if (aNbShapes == 2) {
+        Handle(GEOM_Function) aRefFace =
+          Handle(GEOM_Function)::DownCast(aShapes->Value(1));
+        Handle(GEOM_Function) aRefWire =
+          Handle(GEOM_Function)::DownCast(aShapes->Value(2));
+
+        if (aRefFace.IsNull() == Standard_False &&
+            aRefWire.IsNull() == Standard_False) {
+          TopoDS_Shape aShFace = aRefFace->GetValue();
+          TopoDS_Shape aShWire = aRefWire->GetValue();
+
+          if (aShFace.IsNull()    == Standard_False &&
+              aShFace.ShapeType() == TopAbs_FACE    &&
+              aShWire.IsNull()    == Standard_False &&
+              aShWire.ShapeType() == TopAbs_WIRE) {
+            TopoDS_Face             aFace = TopoDS::Face(aShFace);
+            TopoDS_Wire             aWire = TopoDS::Wire(aShWire);
+            Handle(Geom_Surface)    aSurf = BRep_Tool::Surface(aFace);
+            BRepBuilderAPI_MakeFace aMkFace(aSurf, aWire);
+
+            if (aMkFace.IsDone()) {
+              aShape = aMkFace.Shape();
+            }
+          }
+        }
+      }
+    }
+  }
   else if (aType == SHELL_FACES) {
-#ifdef RESULT_TYPE_CHECK
+    // result may be only a shell or a compound of shells
     anExpectedType = TopAbs_SHELL;
-#endif
+    allowCompound = true;
 
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
     unsigned int ind, nbshapes = aShapes->Length();
@@ -375,42 +486,11 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
       }
     }
 
-  }
-  else if (aType == SOLID_SHELL) {
-#ifdef RESULT_TYPE_CHECK
-    anExpectedType = TopAbs_SOLID;
-#endif
-
-    Handle(GEOM_Function) aRefShell = aCI.GetBase();
-    TopoDS_Shape aShapeShell = aRefShell->GetValue();
-    if (!aShapeShell.IsNull() && aShapeShell.ShapeType() == TopAbs_COMPOUND) {
-      TopoDS_Iterator It (aShapeShell, Standard_True, Standard_True);
-      if (It.More()) aShapeShell = It.Value();
-    }
-    if (aShapeShell.IsNull() || aShapeShell.ShapeType() != TopAbs_SHELL) {
-      Standard_NullObject::Raise("Shape for solid construction is null or not a shell");
-    }
-
-    BRepCheck_Shell chkShell(TopoDS::Shell(aShapeShell));
-    if (chkShell.Closed() == BRepCheck_NotClosed) return 0;
-
-    TopoDS_Solid Sol;
-    B.MakeSolid(Sol);
-    B.Add(Sol, aShapeShell);
-    BRepClass3d_SolidClassifier SC (Sol);
-    SC.PerformInfinitePoint(Precision::Confusion());
-    if (SC.State() == TopAbs_IN) {
-      B.MakeSolid(Sol);
-      B.Add(Sol, aShapeShell.Reversed());
-    }
-
-    aShape = Sol;
-
   }
   else if (aType == SOLID_SHELLS) {
-#ifdef RESULT_TYPE_CHECK
+    // result may be only a solid or a compound of solids
     anExpectedType = TopAbs_SOLID;
-#endif
+    allowCompound = true;
 
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
     unsigned int ind, nbshapes = aShapes->Length();
@@ -426,9 +506,18 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
       }
       if (aShapeShell.ShapeType() == TopAbs_COMPOUND) {
         TopoDS_Iterator It (aShapeShell, Standard_True, Standard_True);
-        if (It.More()) aShapeShell = It.Value();
+        for (; It.More(); It.Next()) {
+          TopoDS_Shape aSubShape = It.Value();
+          if (aSubShape.ShapeType() == TopAbs_SHELL) {
+            aMkSolid.Add(TopoDS::Shell(aSubShape));
+            ish++;
+          }
+          else
+            Standard_TypeMismatch::Raise
+              ("Shape for solid construction is neither a shell nor a compound of shells");
+        }
       }
-      if (aShapeShell.ShapeType() == TopAbs_SHELL) {
+      else if (aShapeShell.ShapeType() == TopAbs_SHELL) {
         aMkSolid.Add(TopoDS::Shell(aShapeShell));
         ish++;
       }
@@ -444,9 +533,8 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
       aShape = Sol;
   }
   else if (aType == COMPOUND_SHAPES) {
-#ifdef RESULT_TYPE_CHECK
-    anExpectedType = TopAbs_COMPOUND;
-#endif
+    // result may be only a compound of any shapes
+    allowCompound = true;
 
     Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
     unsigned int ind, nbshapes = aShapes->Length();
@@ -466,34 +554,9 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     aShape = C;
 
   }
-  /*
-  else if (aType == REVERSE_ORIENTATION) {
-    Handle(GEOM_Function) aRefShape = aCI.GetBase();
-    TopoDS_Shape aShape_i = aRefShape->GetValue();
-    if (aShape_i.IsNull()) {
-       Standard_NullObject::Raise("Shape for reverse is null");
-    }
-
-    BRepBuilderAPI_Copy Copy(aShape_i);
-    if( Copy.IsDone() ) {
-      TopoDS_Shape tds = Copy.Shape();
-      if( tds.IsNull() ) {
-        Standard_ConstructionError::Raise("Orientation aborted : Can not reverse the shape");
-      }
-
-      if( tds.Orientation() == TopAbs_FORWARD)
-        tds.Orientation(TopAbs_REVERSED);
-      else
-        tds.Orientation(TopAbs_FORWARD);
-
-      aShape = tds;
-    }
-  }
-  */
   else if (aType == EDGE_WIRE) {
-#ifdef RESULT_TYPE_CHECK
+    // result may be only an edge
     anExpectedType = TopAbs_EDGE;
-#endif
 
     Handle(GEOM_Function) aRefBase = aCI.GetBase();
     TopoDS_Shape aWire = aRefBase->GetValue();
@@ -503,10 +566,48 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
 
     aShape = MakeEdgeFromWire(aWire, LinTol, AngTol);
   }
+  else if (aType == SOLID_FACES) {
+    // result may be only a solid or a compound of solids
+    anExpectedType = TopAbs_SOLID;
+    allowCompound = true;
+    
+    Handle(TColStd_HSequenceOfTransient) aShapes = aCI.GetShapes();
+    unsigned int ind, nbshapes = aShapes->Length();
+    
+    // add faces
+    BOPCol_ListOfShape aLS;
+    for (ind = 1; ind <= nbshapes; ind++) {
+      Handle(GEOM_Function) aRefShape = Handle(GEOM_Function)::DownCast(aShapes->Value(ind));
+      TopoDS_Shape aShape_i = aRefShape->GetValue();
+      if (aShape_i.IsNull()) {
+        Standard_NullObject::Raise("Shape for solid construction is null");
+      }
+      if (aShape_i.ShapeType() == TopAbs_COMPOUND) {
+        TopoDS_Iterator It (aShape_i, Standard_True, Standard_True);
+        for (; It.More(); It.Next()) {
+          TopoDS_Shape aSubShape = It.Value();
+          if (aSubShape.ShapeType() == TopAbs_FACE || aSubShape.ShapeType() == TopAbs_SHELL)
+            aLS.Append(aSubShape);
+          else
+            Standard_TypeMismatch::Raise
+              ("Shape for solid construction is neither a list of faces and/or shells "
+               "nor a compound of faces and/or shells");
+        }
+      }
+      aLS.Append(aShape_i);
+    }
+
+    BOPAlgo_MakerVolume aMV;
+    aMV.SetArguments(aLS);
+    aMV.SetIntersect(aCI.GetIsIntersect());
+    aMV.Perform();
+    if (aMV.ErrorStatus()) return 0;
+
+    aShape = aMV.Shape();
+  }
   else if (aType == EDGE_CURVE_LENGTH) {
-#ifdef RESULT_TYPE_CHECK
+    // result may be only an edge
     anExpectedType = TopAbs_EDGE;
-#endif
 
     GEOMImpl_IVector aVI (aFunction);
 
@@ -581,10 +682,11 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     BRepBuilderAPI_MakeEdge aME (ReOrientedCurve, UFirst, aParam);
     if (aME.IsDone())
       aShape = aME.Shape();
-  } else if (aType == SHAPE_ISOLINE) {
-#ifdef RESULT_TYPE_CHECK
+  }
+  else if (aType == SHAPE_ISOLINE) {
+    // result may be only an edge or compound of edges
     anExpectedType = TopAbs_EDGE;
-#endif
+    allowCompound = true;
 
     GEOMImpl_IIsoline     aII (aFunction);
     Handle(GEOM_Function) aRefFace = aII.GetFace();
@@ -612,13 +714,84 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
         ("Shape for isoline construction is not a face");
     }
   }
+  else if (aType == EDGE_UV) {
+    // result may be only an edge
+    anExpectedType = TopAbs_EDGE;
+
+    GEOMImpl_IShapeExtend aSE (aFunction);
+    Handle(GEOM_Function) aRefEdge   = aSE.GetShape();
+    TopoDS_Shape          aShapeEdge = aRefEdge->GetValue();
+
+    if (aShapeEdge.ShapeType() == TopAbs_EDGE) {
+      TopoDS_Edge anEdge = TopoDS::Edge(aShapeEdge);
+
+      aShape = ExtendEdge(anEdge, aSE.GetUMin(), aSE.GetUMax());
+    }
+  }
+  else if (aType == FACE_UV) {
+    // result may be only a face
+    anExpectedType = TopAbs_FACE;
+
+    GEOMImpl_IShapeExtend aSE (aFunction);
+    Handle(GEOM_Function) aRefFace   = aSE.GetShape();
+    TopoDS_Shape          aShapeFace = aRefFace->GetValue();
+
+    if (aShapeFace.ShapeType() == TopAbs_FACE) {
+      TopoDS_Face aFace = TopoDS::Face(aShapeFace);
+
+      aFace.Orientation(TopAbs_FORWARD);
+      aShape = ExtendFace(aFace, aSE.GetUMin(), aSE.GetUMax(),
+                          aSE.GetVMin(), aSE.GetVMax()); 
+    }
+  }
+  else if (aType == SURFACE_FROM_FACE) {
+    // result may be only a face
+    anExpectedType = TopAbs_FACE;
+
+    GEOMImpl_IShapeExtend aSE (aFunction);
+    Handle(GEOM_Function) aRefFace   = aSE.GetShape();
+    TopoDS_Shape          aShapeFace = aRefFace->GetValue();
+
+    if (aShapeFace.ShapeType() == TopAbs_FACE) {
+      TopoDS_Face          aFace    = TopoDS::Face(aShapeFace);
+      Handle(Geom_Surface) aSurface = BRep_Tool::Surface(aFace);
+
+      if (aSurface.IsNull() == Standard_False) {
+        Handle(Standard_Type) aType = aSurface->DynamicType();
+        Standard_Real         aU1;
+        Standard_Real         aU2;
+        Standard_Real         aV1;
+        Standard_Real         aV2;
+
+         // Get U, V bounds of the face.
+        aFace.Orientation(TopAbs_FORWARD);
+        ShapeAnalysis::GetFaceUVBounds(aFace, aU1, aU2, aV1, aV2);
+
+        // Get the surface of original type
+        while (aType == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
+          Handle(Geom_RectangularTrimmedSurface) aTrSurface =
+            Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurface);
+
+          aSurface = aTrSurface->BasisSurface();
+          aType    = aSurface->DynamicType();
+        }
+
+        const Standard_Real     aTol = BRep_Tool::Tolerance(aFace);
+        BRepBuilderAPI_MakeFace aMF(aSurface, aU1, aU2, aV1, aV2, aTol);
+
+        if (aMF.IsDone()) {
+          aShape = aMF.Shape();
+        }
+      }
+    }
+  }
   else {
   }
 
   if (aShape.IsNull()) return 0;
 
   // Check shape validity
-  BRepCheck_Analyzer ana (aShape, false);
+  BRepCheck_Analyzer ana (aShape, true);
   if (!ana.IsValid()) {
     //Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
     // For Mantis issue 0021772: EDF 2336 GEOM: Non valid face created from two circles
@@ -627,34 +800,18 @@ Standard_Integer GEOMImpl_ShapeDriver::Execute(TFunction_Logbook& log) const
     aShape = aSfs->Shape();
   }
 
-#ifdef RESULT_TYPE_CHECK
-  // Check if the result shape type is compatible with the expected.
+  // Check if the result shape is of expected type.
   const TopAbs_ShapeEnum aShType = aShape.ShapeType();
 
-  if (anExpectedType != TopAbs_SHAPE && anExpectedType != aShType) {
-    if (aShType == TopAbs_COMPOUND) {
-      // The result is compound. Check its sub-shapes.
-      TopoDS_Iterator anIter(aShape);
-
-      if (!anIter.More()) {
-        // The result is an empty compound.
-        Standard_ConstructionError::Raise("Result type check failed");
-      }
-
-      for (; anIter.More(); anIter.Next()) {
-        const TopAbs_ShapeEnum aSubType = anIter.Value().ShapeType();
-
-        if (anExpectedType != aSubType) {
-          // There is an incompatible type.
-          Standard_ConstructionError::Raise("Result type check failed");
-        }
-      }
-    } else {
-      // There is an incompatible type.
-      Standard_ConstructionError::Raise("Result type check failed");
-    }
+  bool ok = false;
+  if ( aShType == TopAbs_COMPOUND || aShType == TopAbs_COMPSOLID ) {
+    ok = allowCompound && checkCompound( aShape, anExpectedType );
   }
-#endif
+  else {
+    ok = ( anExpectedType == TopAbs_SHAPE ) || ( aShType == anExpectedType );
+  }
+  if (!ok)
+    Standard_ConstructionError::Raise("Result type check failed");
 
   aFunction->SetValue(aShape);
 
@@ -753,6 +910,7 @@ TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
     TColStd_SequenceOfReal TolSeq;
     GeomAbs_CurveType CurType;
     TopoDS_Vertex FirstVertex, LastVertex;
+    Standard_Real aPntShiftDist = 0.;
 
     BRepTools_WireExplorer wexp(theWire) ;
     for (; wexp.More(); wexp.Next())
@@ -789,11 +947,13 @@ TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
       {
         Standard_Boolean Done = Standard_False;
         Standard_Real NewFpar, NewLpar;
-        GeomAdaptor_Curve GAprevcurve(CurveSeq.Last());
+        Handle(Geom_Geometry) aTrsfGeom = CurveSeq.Last()->Transformed
+                      (LocSeq.Last().Location().Transformation());
+        GeomAdaptor_Curve GAprevcurve(Handle(Geom_Curve)::DownCast(aTrsfGeom));
         TopoDS_Vertex CurVertex = wexp.CurrentVertex();
         TopoDS_Vertex CurFirstVer = TopExp::FirstVertex(anEdge);
         TopAbs_Orientation ConnectByOrigin = (CurVertex.IsSame(CurFirstVer))? TopAbs_FORWARD : TopAbs_REVERSED;
-        if (aCurve == CurveSeq.Last())
+        if (aCurve == CurveSeq.Last() && aLoc.IsEqual(LocSeq.Last().Location()))
         {
           NewFpar = fpar;
           NewLpar = lpar;
@@ -830,6 +990,18 @@ TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
                 gp_Pnt P2 = ElCLib::Value(lpar, aLine);
                 NewFpar = ElCLib::Parameter(PrevLine, P1);
                 NewLpar = ElCLib::Parameter(PrevLine, P2);
+
+                // Compute shift
+                if (ConnectByOrigin == TopAbs_FORWARD) {
+                  gp_Pnt aNewP2 = ElCLib::Value(NewLpar, PrevLine);
+
+                  aPntShiftDist += P2.Distance(aNewP2);
+                } else {
+                  gp_Pnt aNewP1 = ElCLib::Value(NewFpar, PrevLine);
+
+                  aPntShiftDist += P1.Distance(aNewP1);
+                }
+
                 if (NewLpar < NewFpar)
                 {
                   Standard_Real MemNewFpar = NewFpar;
@@ -849,6 +1021,8 @@ TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
                   Abs(aCircle.Radius() - PrevCircle.Radius()) <= LinTol &&
                   aCircle.Axis().IsParallel(PrevCircle.Axis(), AngTol))
               {
+                const Standard_Boolean isFwd = ConnectByOrigin == TopAbs_FORWARD;
+
                 if (aCircle.Axis().Direction() * PrevCircle.Axis().Direction() < 0.)
                 {
                   Standard_Real memfpar = fpar;
@@ -860,6 +1034,18 @@ TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
                 gp_Pnt P2 = ElCLib::Value(lpar, aCircle);
                 NewFpar = ElCLib::Parameter(PrevCircle, P1);
                 NewLpar = ElCLib::Parameter(PrevCircle, P2);
+
+                // Compute shift
+                if (isFwd) {
+                  gp_Pnt aNewP2 = ElCLib::Value(NewLpar, PrevCircle);
+
+                  aPntShiftDist += P2.Distance(aNewP2);
+                } else {
+                  gp_Pnt aNewP1 = ElCLib::Value(NewFpar, PrevCircle);
+
+                  aPntShiftDist += P1.Distance(aNewP1);
+                }
+
                 if (NewLpar < NewFpar)
                   NewLpar += 2.*M_PI;
                 //Standard_Real MemNewFpar = NewFpar, MemNewLpar =  NewLpar;
@@ -885,6 +1071,8 @@ TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
                   Abs(anEllipse.MinorRadius() - PrevEllipse.MinorRadius()) <= LinTol &&
                   anEllipse.Axis().IsParallel(PrevEllipse.Axis(), AngTol))
               {
+                const Standard_Boolean isFwd = ConnectByOrigin == TopAbs_FORWARD;
+
                 if (anEllipse.Axis().Direction() * PrevEllipse.Axis().Direction() < 0.)
                 {
                   Standard_Real memfpar = fpar;
@@ -896,6 +1084,18 @@ TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
                 gp_Pnt P2 = ElCLib::Value(lpar, anEllipse);
                 NewFpar = ElCLib::Parameter(PrevEllipse, P1);
                 NewLpar = ElCLib::Parameter(PrevEllipse, P2);
+
+                // Compute shift
+                if (isFwd) {
+                  gp_Pnt aNewP2 = ElCLib::Value(NewLpar, PrevEllipse);
+
+                  aPntShiftDist += P2.Distance(aNewP2);
+                } else {
+                  gp_Pnt aNewP1 = ElCLib::Value(NewFpar, PrevEllipse);
+
+                  aPntShiftDist += P1.Distance(aNewP1);
+                }
+
                 if (NewLpar < NewFpar)
                   NewLpar += 2.*M_PI;
                 if (ConnectByOrigin == TopAbs_FORWARD)
@@ -924,6 +1124,18 @@ TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
                 gp_Pnt P2 = ElCLib::Value(lpar, aHypr);
                 NewFpar = ElCLib::Parameter(PrevHypr, P1);
                 NewLpar = ElCLib::Parameter(PrevHypr, P2);
+
+                // Compute shift
+                if (ConnectByOrigin == TopAbs_FORWARD) {
+                  gp_Pnt aNewP2 = ElCLib::Value(NewLpar, PrevHypr);
+
+                  aPntShiftDist += P2.Distance(aNewP2);
+                } else {
+                  gp_Pnt aNewP1 = ElCLib::Value(NewFpar, PrevHypr);
+
+                  aPntShiftDist += P1.Distance(aNewP1);
+                }
+
                 if (NewLpar < NewFpar)
                 {
                   Standard_Real MemNewFpar = NewFpar;
@@ -948,6 +1160,18 @@ TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
                 gp_Pnt P2 = ElCLib::Value(lpar, aParab);
                 NewFpar = ElCLib::Parameter(PrevParab, P1);
                 NewLpar = ElCLib::Parameter(PrevParab, P2);
+
+                // Compute shift
+                if (ConnectByOrigin == TopAbs_FORWARD) {
+                  gp_Pnt aNewP2 = ElCLib::Value(NewLpar, PrevParab);
+
+                  aPntShiftDist += P2.Distance(aNewP2);
+                } else {
+                  gp_Pnt aNewP1 = ElCLib::Value(NewFpar, PrevParab);
+
+                  aPntShiftDist += P1.Distance(aNewP1);
+                }
+
                 if (NewLpar < NewFpar)
                 {
                   Standard_Real MemNewFpar = NewFpar;
@@ -977,14 +1201,15 @@ TopoDS_Edge GEOMImpl_ShapeDriver::MakeEdgeFromWire(const TopoDS_Shape& aWire,
           LocSeq.Append(aLocShape);
           FparSeq.Append(fpar);
           LparSeq.Append(lpar);
-          TolSeq.Append(BRep_Tool::Tolerance(CurVertex));
+          TolSeq.Append(aPntShiftDist + BRep_Tool::Tolerance(CurVertex));
+          aPntShiftDist = 0.;
           CurType = aType;
         }
       } // end of else (CurveSeq.IsEmpty()) -> not first time
     } // end for (; wexp.More(); wexp.Next())
 
     LastVertex = wexp.CurrentVertex();
-    TolSeq.Append(BRep_Tool::Tolerance(LastVertex));
+    TolSeq.Append(aPntShiftDist + BRep_Tool::Tolerance(LastVertex));
 
     FirstVertex.Orientation(TopAbs_FORWARD);
     LastVertex.Orientation(TopAbs_REVERSED);
@@ -1236,6 +1461,150 @@ TopoDS_Shape GEOMImpl_ShapeDriver::MakeIsoline
   return aResult;
 }
 
+//=============================================================================
+/*!
+ * \brief Returns an extended edge.
+ */
+//=============================================================================
+
+TopoDS_Shape GEOMImpl_ShapeDriver::ExtendEdge
+                         (const TopoDS_Edge   &theEdge,
+                          const Standard_Real  theMin,
+                          const Standard_Real  theMax) const
+{
+  TopoDS_Shape        aResult;
+  Standard_Real       aF;
+  Standard_Real       aL;
+  Handle(Geom_Curve)  aCurve   = BRep_Tool::Curve(theEdge, aF, aL);
+  const Standard_Real aTol     = BRep_Tool::Tolerance(theEdge);
+  Standard_Real       aRange2d = aL - aF;
+
+  if (aCurve.IsNull() == Standard_False && aRange2d > aTol) {
+    Standard_Real aMin = aF + aRange2d*theMin;
+    Standard_Real aMax = aF + aRange2d*theMax;
+
+    Handle(Standard_Type) aType = aCurve->DynamicType();
+
+    // Get the curve of original type
+    while (aType == STANDARD_TYPE(Geom_TrimmedCurve)) {
+      Handle(Geom_TrimmedCurve) aTrCurve =
+        Handle(Geom_TrimmedCurve)::DownCast(aCurve);
+
+      aCurve = aTrCurve->BasisCurve();
+      aType  = aCurve->DynamicType();
+    }
+
+    if (aCurve->IsPeriodic()) {
+      // The curve is periodic. Check if a new range is less then a period.
+      if (aMax - aMin > aCurve->Period()) {
+        aMax = aMin + aCurve->Period();
+      }
+    } else {
+      // The curve is not periodic. Check if aMin and aMax within bounds.
+      aMin = Max(aMin, aCurve->FirstParameter());
+      aMax = Min(aMax, aCurve->LastParameter());
+    }
+
+    if (aMax - aMin > aTol) {
+      // Create a new edge.
+      BRepBuilderAPI_MakeEdge aME (aCurve, aMin, aMax);
+
+      if (aME.IsDone()) {
+        aResult = aME.Shape();
+      }
+    }
+  }
+
+  return aResult;
+}
+
+//=============================================================================
+/*!
+ * \brief Returns an extended face.
+ */
+//=============================================================================
+
+TopoDS_Shape GEOMImpl_ShapeDriver::ExtendFace
+                         (const TopoDS_Face   &theFace,
+                          const Standard_Real  theUMin,
+                          const Standard_Real  theUMax,
+                          const Standard_Real  theVMin,
+                          const Standard_Real  theVMax) const
+{
+  TopoDS_Shape         aResult;
+  Handle(Geom_Surface) aSurface = BRep_Tool::Surface(theFace);
+  const Standard_Real  aTol     = BRep_Tool::Tolerance(theFace);
+  Standard_Real        aU1;
+  Standard_Real        aU2;
+  Standard_Real        aV1;
+  Standard_Real        aV2;
+
+  // Get U, V bounds of the face.
+  ShapeAnalysis::GetFaceUVBounds(theFace, aU1, aU2, aV1, aV2);
+
+  const Standard_Real aURange = aU2 - aU1;
+  const Standard_Real aVRange = aV2 - aV1;
+
+  if (aSurface.IsNull() == Standard_False &&
+      aURange > aTol && aURange > aTol) {
+    Handle(Standard_Type) aType = aSurface->DynamicType();
+
+    // Get the surface of original type
+    while (aType == STANDARD_TYPE(Geom_RectangularTrimmedSurface)) {
+      Handle(Geom_RectangularTrimmedSurface) aTrSurface =
+        Handle(Geom_RectangularTrimmedSurface)::DownCast(aSurface);
+
+      aSurface = aTrSurface->BasisSurface();
+      aType    = aSurface->DynamicType();
+    }
+
+    Standard_Real aUMin = aU1 + aURange*theUMin;
+    Standard_Real aUMax = aU1 + aURange*theUMax;
+    Standard_Real aVMin = aV1 + aVRange*theVMin;
+    Standard_Real aVMax = aV1 + aVRange*theVMax;
+
+    aSurface->Bounds(aU1, aU2, aV1, aV2);
+
+    if (aSurface->IsUPeriodic()) {
+      // The surface is U-periodic. Check if a new U range is less
+      // then a period.
+      if (aUMax - aUMin > aSurface->UPeriod()) {
+        aUMax = aUMin + aSurface->UPeriod();
+      }
+    } else {
+      // The surface is not V-periodic. Check if aUMin and aUMax
+      // within bounds.
+      aUMin = Max(aUMin, aU1);
+      aUMax = Min(aUMax, aU2);
+    }
+
+    if (aSurface->IsVPeriodic()) {
+      // The surface is V-periodic. Check if a new V range is less
+      // then a period.
+      if (aVMax - aVMin > aSurface->VPeriod()) {
+        aVMax = aVMin + aSurface->VPeriod();
+      }
+    } else {
+      // The surface is not V-periodic. Check if aVMin and aVMax
+      // within bounds.
+      aVMin = Max(aVMin, aV1);
+      aVMax = Min(aVMax, aV2);
+    }
+
+    if (aUMax - aUMin > aTol && aVMax - aVMin > aTol) {
+      // Create a new edge.
+      BRepBuilderAPI_MakeFace aMF
+        (aSurface, aUMin, aUMax, aVMin, aVMax, aTol);
+    
+      if (aMF.IsDone()) {
+        aResult = aMF.Shape();
+      }
+    }
+  }
+
+  return aResult;
+}
+
 //================================================================================
 /*!
  * \brief Returns a name of creation operation and names and values of creation parameters
@@ -1268,15 +1637,38 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam( theParams, "Wires/edges", aCI.GetShapes() );
     AddParam( theParams, "Is planar wanted", aCI.GetIsPlanar() );
     break;
+  case FACE_FROM_SURFACE:
+  {
+    theOperationName = "FACE";
+
+    Handle(TColStd_HSequenceOfTransient) shapes = aCI.GetShapes();
+
+    if (shapes.IsNull() == Standard_False) {
+      Standard_Integer aNbShapes = shapes->Length();
+
+      if (aNbShapes > 0) {
+        AddParam(theParams, "Face", shapes->Value(1));
+
+        if (aNbShapes > 1) {
+          AddParam(theParams, "Wire", shapes->Value(2));
+        }
+      }
+    }
+    break;
+  }
   case SHELL_FACES:
     theOperationName = "SHELL";
     AddParam( theParams, "Objects", aCI.GetShapes() );
     break;
-  case SOLID_SHELL:
   case SOLID_SHELLS:
     theOperationName = "SOLID";
     AddParam( theParams, "Objects", aCI.GetShapes() );
     break;
+  case SOLID_FACES:
+    theOperationName = "SOLID_FROM_FACES";
+    AddParam( theParams, "Objects", aCI.GetShapes() );
+    AddParam( theParams, "Is intersect", aCI.GetIsIntersect() );
+    break;
   case COMPOUND_SHAPES:
     theOperationName = "COMPOUND";
     AddParam( theParams, "Objects", aCI.GetShapes() );
@@ -1305,7 +1697,13 @@ GetCreationInformation(std::string&             theOperationName,
     if ( !shapes.IsNull() && shapes->Length() > 1 )
       AddParam( theParams, "Shape", shapes->Value(2) );
     AddParam( theParams, "Shape type", TopAbs_ShapeEnum( aCI.GetSubShapeType() ));
-    AddParam( theParams, "State", TopAbs_State((int) aCI.GetTolerance() ));
+    AddParam( theParams, "State" );
+    GEOMAlgo_State st = GEOMAlgo_State( (int) ( aCI.GetTolerance()+0.1 ) );
+    const char* stName[] = { "UNKNOWN","IN","OUT","ON","ONIN","ONOUT","INOUT" };
+    if ( 0 <= st && st <= GEOMAlgo_ST_INOUT )
+      theParams.back() << stName[ st ];
+    else
+      theParams.back() << (int) st;
     break;
   }
   case SHAPE_ISOLINE:
@@ -1318,6 +1716,36 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam(theParams, "Parameter", aII.GetParameter());
     break;
   }
+  case EDGE_UV:
+  {
+    GEOMImpl_IShapeExtend aSE (function);
+
+    theOperationName = "EDGE_EXTEND";
+    AddParam(theParams, "Edge", aSE.GetShape());
+    AddParam(theParams, "Min", aSE.GetUMin());
+    AddParam(theParams, "Max", aSE.GetUMax());
+    break;
+  }
+  case FACE_UV:
+  {
+    GEOMImpl_IShapeExtend aSE (function);
+
+    theOperationName = "FACE_EXTEND";
+    AddParam(theParams, "Face", aSE.GetShape());
+    AddParam(theParams, "UMin", aSE.GetUMin());
+    AddParam(theParams, "UMax", aSE.GetUMax());
+    AddParam(theParams, "VMin", aSE.GetVMin());
+    AddParam(theParams, "VMax", aSE.GetVMax());
+    break;
+  }
+  case SURFACE_FROM_FACE:
+  {
+    GEOMImpl_IShapeExtend aSE (function);
+
+    theOperationName = "SURFACE_FROM_FACE";
+    AddParam(theParams, "Face", aSE.GetShape());
+    break;
+  }
   default:
     return false;
   }
index da699188c320e8558106467617e99aa9f7e2f282..8ec400574598af4bd08fb358ba281410f2c22a85 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -105,6 +105,16 @@ private:
                            const bool         IsUIso,
                            const double       theParameter) const;
 
+  TopoDS_Shape ExtendEdge(const TopoDS_Edge   &theEdge,
+                          const Standard_Real  theMin,
+                          const Standard_Real  theMax) const;
+
+  TopoDS_Shape ExtendFace(const TopoDS_Face   &theFace,
+                          const Standard_Real  theUMin,
+                          const Standard_Real  theUMax,
+                          const Standard_Real  theVMin,
+                          const Standard_Real  theVMax) const;
+
 };
 
 #endif
index 60b7fc03c4f734a9145008fe862b77e947f80d90..cd47948acbf851dd7aaa9ada80c78b4298ca4a40 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 5e8a21d501dc03c4cc234a2986d76fd15f590d6b..348554ae8e28235b3c0fab3f6c75e00bb086aa1a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 7ccf03510bec09579757309efeb5005e880c3763..f16566817cb2e0e4ea300e1d9f17f092a1202dc3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 84aa9dc0c5d43f623e243614515afacd4a3a5cb7..2143c0b97ed5bf140d789f22df46ddf0e6061dd2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3865908ee541575d650cccbc9d28c480a7321497..c4c3b509dd8b93f7250e206c549deec04154f094 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <Standard_NullObject.hxx>
 
+// Below macro specifies how the closed point set is processed (issue 0022885).
+// See below for more information.
+// Currently solution 4 is chosen!
+#define BSPLINE_PROCESS_CLOSED_PNTSET 2
+
+namespace
+{
+  /*!
+    \brief Generate list of points from the list of (x,y,z) coordinates
+    \param coords list of values specifying (x y z) coordinates of points
+    \return list of points
+    \internal
+  */
+  Handle(TColgp_HArray1OfPnt) pointsFromCoords(Handle(TColStd_HArray1OfReal) coords)
+  {
+    Standard_Integer length = coords->Length() / 3;
+
+    Handle(TColgp_HArray1OfPnt) points = new TColgp_HArray1OfPnt(1, length);
+    
+    for (int i = 0; i < length; i ++) {
+      Standard_Real x = coords->Value( i*3+1 );
+      Standard_Real y = coords->Value( i*3+2 );
+      Standard_Real z = coords->Value( i*3+3 );
+      points->SetValue(i+1, gp_Pnt(x, y, z));
+    }
+
+    return points;
+  }
+
+  /*!
+    \brief Generate list of points from the sequence of input objects
+    \param coords list of objects as it is stored within the CAF tree
+    \return list of points
+    \internal
+  */
+  Handle(TColgp_HArray1OfPnt) pointsFromObjs(Handle(TColStd_HSequenceOfTransient) objects)
+  {
+    Standard_Integer length = objects->Length();
+
+    Handle(TColgp_HArray1OfPnt) points = new TColgp_HArray1OfPnt(1, length);
+    
+    for (int i = 1; i <= length; i ++) {
+      TopoDS_Shape shape = Handle(GEOM_Function)::DownCast(objects->Value(i))->GetValue();
+      if (shape.ShapeType() != TopAbs_VERTEX)
+        // error: only vertices are allowed in the input
+        Standard_ConstructionError::Raise("Input should contain only vertices");
+      points->SetValue(i, BRep_Tool::Pnt(TopoDS::Vertex(shape)));
+    }
+
+    return points;
+  }
+}
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -91,173 +144,184 @@ Standard_Integer GEOMImpl_SplineDriver::Execute(TFunction_Logbook& log) const
 
     bool useCoords = aCI.GetConstructorType() == COORD_CONSTRUCTOR;
 
-    Handle(TColStd_HArray1OfReal) aCoordsArray; // parametric case
-    Handle(TColStd_HSequenceOfTransient) aPoints; // points case
-
-    int aLen = 0;
-    if (useCoords) {
-      aCoordsArray = aCI.GetCoordinates();
-      aLen = aCoordsArray->Length() / 3;
-    }
-    else {
-      aPoints = aCI.GetPoints();
-      aLen = aPoints->Length();
-    }
-
-    if (aLen < 2) return 0;
-
-    TColgp_Array1OfPnt points (1, (useCoords ? aLen : 1));
-    if (useCoords) {
-      int anArrayLength = aCoordsArray->Length();
-      for (int i = 0, j = 1; i <= (anArrayLength-3); i += 3) {
-        gp_Pnt aPnt = gp_Pnt(aCoordsArray->Value(i+1), aCoordsArray->Value(i+2), aCoordsArray->Value(i+3));
-        points.SetValue(j, aPnt);
-        j++;
-      }
-    }
-
-    int aRealLen = aLen;
-
-    if (aType == SPLINE_BEZIER && aCI.GetIsClosed()) {
-      TopoDS_Vertex aV1;
-      if (useCoords) {
-        aV1 = BRepBuilderAPI_MakeVertex(points.Value(1));
-      }
-      else {
-        Handle(GEOM_Function) aFPoint = Handle(GEOM_Function)::DownCast(aPoints->Value(1));
-        TopoDS_Shape aFirstPnt = aFPoint->GetValue();
-        aV1 = TopoDS::Vertex(aFirstPnt);
-      }
-
-      TopoDS_Vertex aV2;
-      if (useCoords) {
-        aV2 = BRepBuilderAPI_MakeVertex(points.Value(aLen));
-      }
-      else {
-        Handle(GEOM_Function) aLPoint = Handle(GEOM_Function)::DownCast(aPoints->Value(aLen));
-        TopoDS_Shape aLastPnt = aLPoint->GetValue();
-        aV2 = TopoDS::Vertex(aLastPnt);
-      }
-
-      if (!aV1.IsNull() && !aV2.IsNull() && !aV1.IsSame(aV2)) {
-        aRealLen++;
-      }
-    }
-
-    int ind;
-    Standard_Boolean isSeveral = Standard_False;
-    gp_Pnt aPrevP;
-
-    TColgp_Array1OfPnt CurvePoints (1, aRealLen);
-    for (ind = 1; ind <= aLen; ind++) {
-      gp_Pnt aP;
-      if (useCoords) {
-        aP = points.Value(ind);
-        if (!isSeveral && ind > 1) {
-          if (aP.Distance(aPrevP) > Precision::Confusion()) {
-            isSeveral = Standard_True;
+    // collect points from input parameters: objects or coordinates
+    Handle(TColgp_HArray1OfPnt) points = useCoords ? pointsFromCoords(aCI.GetCoordinates()) : pointsFromObjs(aCI.GetPoints());
+    int length = points->Length();
+
+    if (length < 2) return 0; // error: not enough points in the input list
+
+    // reorder points if required (bspline only)
+    if ((aType == SPLINE_INTERPOLATION || aType == SPLINE_INTERPOL_TANGENTS) && aCI.GetDoReordering()) {
+      int nbDup = 0;
+      gp_Pnt pPrev = points->Value(1);
+      for (int i = 1; i < length - 1; i++) {
+        gp_Pnt pi = points->Value(i);
+        int nearest = 0;
+        double minDist = RealLast();
+        for (int j = i+1; j <= length; j++) {
+          double dist = pi.SquareDistance(points->Value(j));
+          if (dist < minDist && (minDist - dist) > Precision::Confusion()) {
+            nearest = j;
+            minDist = dist;
           }
         }
-        CurvePoints.SetValue(ind, aP);
-        aPrevP = aP;
+        if (nearest > 0 && nearest != i + 1) {
+          // Keep given order of points to use it in case of equidistant candidates
+          //               .-<---<-.
+          //              /         \
+          // o  o  o  c  o->o->o->o->n  o  o
+          //          |  |           |
+          //          i i+1       nearest
+          gp_Pnt p = points->Value(nearest);
+          for (int j = nearest; j > i+1; j--)
+            points->SetValue(j, points->Value(j-1));
+          points->SetValue(i+1, p);
+        }
+        if ( pPrev.Distance(points->Value(i+1)) <= Precision::Confusion() )
+          nbDup++;
+        else
+          pPrev = points->Value(i+1);
       }
-      else {
-        Handle(GEOM_Function) aRefPoint = Handle(GEOM_Function)::DownCast(aPoints->Value(ind));
-        TopoDS_Shape aShapePnt = aRefPoint->GetValue();
-        if (aShapePnt.ShapeType() == TopAbs_VERTEX) {
-          aP = BRep_Tool::Pnt(TopoDS::Vertex(aShapePnt));
-          if (!isSeveral && ind > 1) {
-            if (aP.Distance(aPrevP) > Precision::Confusion()) {
-              isSeveral = Standard_True;
-            }
+      if ( nbDup > 0 ) {
+        Handle(TColgp_HArray1OfPnt) tmpPoints = new TColgp_HArray1OfPnt(1, length-nbDup);
+        int j = 1;
+        for (int i = 1; i <= length; i++) {
+          if (i == 1 || pPrev.Distance(points->Value(i)) > Precision::Confusion() ) {
+            tmpPoints->SetValue(j++, points->Value(i));
+            pPrev = points->Value(i);
           }
-          CurvePoints.SetValue(ind, aP);
-          aPrevP = aP;
         }
+        points = tmpPoints;
+        length = points->Length();
       }
-    }
+    } // end of reordering
+
+    bool closed = points->Value(1).Distance(points->Value(length)) <= gp::Resolution();
 
     if (aType == SPLINE_BEZIER) {
-      if (!isSeveral) {
-        Standard_ConstructionError::Raise("Points for Bezier Curve are too close");
+      // for Bezier curve we should append first point to the list if:
+      // a) "closed" flag is set, and
+      // b) first and last vertices are not too close
+      bool addFirst = aCI.GetIsClosed() && !closed;
+      
+      // re-fill points and check that there's enough points to create a curve
+      bool isValid = false;
+      TColgp_Array1OfPnt curvePoints(1, length + (addFirst ? 1 : 0));
+      gp_Pnt pp;
+      for (int i = 1; i <= length; i++) {
+        gp_Pnt p = points->Value(i);
+        if (!isValid && i > 1 && p.Distance(pp) > Precision::Confusion())
+          isValid = true;
+        curvePoints.SetValue(i, p);
+        pp = p;
       }
-      if (aRealLen > aLen) { // set last point equal to first for the closed curve
-        CurvePoints.SetValue(aRealLen, CurvePoints.Value(1));
-      }
-      Handle(Geom_BezierCurve) GBC = new Geom_BezierCurve (CurvePoints);
+
+      if (!isValid)
+        // error: not enough points to create curve
+        Standard_ConstructionError::Raise("Points for Bezier Curve are too close");
+      
+      // set last point equal to first for the closed Bezier curve
+      if (addFirst) curvePoints.SetValue(length+1, curvePoints.Value(1));
+      
+      // create Bezier curve
+      Handle(Geom_BezierCurve) GBC = new Geom_BezierCurve(curvePoints);
       aShape = BRepBuilderAPI_MakeEdge(GBC).Edge();
     }
     else {
-      //GeomAPI_PointsToBSpline GBC (CurvePoints);
-      //aShape = BRepBuilderAPI_MakeEdge(GBC).Edge();
-
-      if (aCI.GetDoReordering()) {
-        for (int curInd = 1; curInd < aLen - 1; curInd++) {
-          gp_Pnt curPnt = CurvePoints.Value(curInd);
-          int nearInd = 0;
-          double nearDist = RealLast();
-          for (ind = curInd + 1; ind <= aLen; ind++) {
-            double dist = curPnt.SquareDistance(CurvePoints.Value(ind));
-            if (dist < nearDist && (nearDist - dist) > Precision::Confusion()) {
-              nearInd = ind;
-              nearDist = dist;
-            }
-          }
-          if (nearInd > 0 && nearInd != curInd + 1) {
-            // Keep given order of points to use it in case of equidistant candidates
-            //               .-<---<-.
-            //              /         \
-            // o  o  o  c  o->o->o->o->n  o  o
-            //          |  |           |
-            //     curInd  curInd+1    nearInd
-            gp_Pnt nearPnt = CurvePoints.Value(nearInd);
-            for (ind = nearInd; ind > curInd + 1; ind--) {
-              CurvePoints.SetValue(ind, CurvePoints.Value(ind - 1));
-            }
-            CurvePoints.SetValue(curInd + 1, nearPnt);
-          }
-        }
+      // Below described processing of closed points set case
+      // is not done for constrained bsplined
+      bool typeok = aType == SPLINE_INTERPOLATION;
+#if BSPLINE_PROCESS_CLOSED_PNTSET == 1
+      // Last point is removed from the list if:
+      // a) first and last vertices are equal;
+      // b) "closed" flag is not taken into account.
+      // If first and last points are equal, we force "closed" flag to be set to true.
+      // For the case when first and last vertices are equal, this approach causes
+      // result different that would be if last point had NOT be removed and "closed" flag is false.
+      bool isClosed = typeok && (aCI.GetIsClosed() || closed);
+      bool removeLast = typeok && closed;
+      bool addFirst = false;
+#elif BSPLINE_PROCESS_CLOSED_PNTSET == 2
+      // Last point is removed from the list if:
+      // a) first and last vertices are equal;
+      // b) "closed" flag is set to true.
+      // Flag "closed" is taken "as is".
+      // For the case when first and last vertices are equal, this approach causes
+      // different results with "closed" flag set to true and false.
+      bool isClosed = typeok && aCI.GetIsClosed();
+      bool removeLast = typeok && aCI.GetIsClosed() && closed;
+      bool addFirst = false;
+#elif BSPLINE_PROCESS_CLOSED_PNTSET == 3
+      // Points are passed "as is" to the creator.
+      // If first and last points are equal, we force "closed" flag to be set to false.
+      // For the case when first and last vertices are equal, this approach gives
+      // the same results with "closed" flag set to true and false.
+      bool isClosed = typeok && aCI.GetIsClosed() && !closed;
+      bool removeLast = false;
+      bool addFirst = false;
+#elif BSPLINE_PROCESS_CLOSED_PNTSET == 4
+      // First point is added to the list if:
+      // a) first and last vertices are not equal;
+      // b) "closed" flag is set to true.
+      // In this case "closed" flag is forcidly set to false - bspline creator is 
+      // capable to create closed edge in this case.
+      // This approach gives the same results with "closed" flag set to true not
+      // depending on if set of points is closed or no.
+      // Also, it gives equal reqults in both case if set of points is closed or not
+      // and "closed" flag is set to true, in contrast to solution 3 above.
+      bool isClosed = false;
+      bool removeLast = false;
+      bool addFirst = typeok && aCI.GetIsClosed() && !closed;
+#else
+      // Points are passed "as is" to the creator.
+      // This causes an error when first point is equal to last one and
+      // "closed" flag is set to true; see bug 0022885.
+      bool isClosed = typeok && aCI.GetIsClosed();
+      bool removeLast = false;
+      bool addFirst = false;
+#endif
+
+      // remove last point or append first one if the conditions are observed (see above)
+      if (removeLast || addFirst) {
+        int extra = removeLast ? -1 : (addFirst ? 1 : 0 );
+        int nb = removeLast ? length-1 : length;
+        Handle(TColgp_HArray1OfPnt) curvePoints = new TColgp_HArray1OfPnt (1, length+extra);
+        for (int i = 1; i <= nb; i++)
+          curvePoints->SetValue(i, points->Value(i));
+        if (addFirst) curvePoints->SetValue(length+1, points->Value(1));
+        points = curvePoints;
       }
 
-      Handle(TColgp_HArray1OfPnt) aHCurvePoints = new TColgp_HArray1OfPnt (1, aLen);
-      for (ind = 1; ind <= aLen; ind++) {
-        aHCurvePoints->SetValue(ind, CurvePoints.Value(ind));
-      }
-
-      bool isClosed = Standard_False;
-      if (aType == SPLINE_INTERPOLATION)
-        isClosed = aCI.GetIsClosed();
-
-      GeomAPI_Interpolate GBC (aHCurvePoints, isClosed, gp::Resolution());
+      // initial set-up of curve creator
+      GeomAPI_Interpolate GBC(points, isClosed, gp::Resolution());
 
+      // add tangent vectors constraints
       if (aType == SPLINE_INTERPOL_TANGENTS) {
-        Handle(GEOM_Function) aVec1Ref  = aCI.GetFirstVector();
-        Handle(GEOM_Function) aVec2Ref  = aCI.GetLastVector();
+        Handle(GEOM_Function) aVec1Ref = aCI.GetFirstVector();
+        Handle(GEOM_Function) aVec2Ref = aCI.GetLastVector();
 
         if (aVec1Ref.IsNull() || aVec2Ref.IsNull())
+          // error: bad vector parameter is specified
           Standard_NullObject::Raise("Null object is given for a vector");
 
-        TopoDS_Shape aVec1Sh = aVec1Ref->GetValue();
-        TopoDS_Shape aVec2Sh = aVec2Ref->GetValue();
-
         // take orientation of edge into account to avoid regressions, as it was implemented so
-        gp_Vec aV1 = GEOMUtils::GetVector(aVec1Sh, Standard_True);
-        gp_Vec aV2 = GEOMUtils::GetVector(aVec2Sh, Standard_True);
+        gp_Vec aV1 = GEOMUtils::GetVector(aVec1Ref->GetValue(), Standard_True);
+        gp_Vec aV2 = GEOMUtils::GetVector(aVec2Ref->GetValue(), Standard_True);
 
+        // push constraint vectors to the curve creator
         GBC.Load(aV1, aV2, /*Scale*/Standard_True);
       }
 
+      // create bspline curve
       GBC.Perform();
       if (GBC.IsDone())
         aShape = BRepBuilderAPI_MakeEdge(GBC.Curve()).Edge();
-      else
-        return 0;
     }
   }
   else {
   }
 
-  if (aShape.IsNull()) return 0;
+  if (aShape.IsNull()) return 0; // error: bad result
 
   aFunction->SetValue(aShape);
 
index 945554090244bab919b2092194d4af475ad27355..59a5963f4d35f15d33a5ff6538244e06fad07a8e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index d4df6a4b6ca5c99e1298422a3948023084b00dbe..c77f476beea7490f71cdd7f9159ca51f7b2fa325 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_ThruSectionsDriver.hxx>
 #include <GEOMImpl_IThruSections.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
+#include <GEOMUtils.hxx>
 
 #include <TColStd_HSequenceOfTransient.hxx>
 #include <Precision.hxx>
-#include <BRepCheck_Analyzer.hxx>
 #include <BRepOffsetAPI_ThruSections.hxx>
 #include <BRepBuilderAPI_MakeWire.hxx>
-#include <TopExp_Explorer.hxx>
 #include <TopoDS.hxx>
 
 #include <TopAbs.hxx>
 #include <TopoDS_Edge.hxx>
 #include <TopoDS_Shape.hxx>
 
-#include <Standard_NullObject.hxx>
 #include <Standard_TypeMismatch.hxx>
 #include <Standard_ConstructionError.hxx>
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-#include <Precision.hxx>
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -132,21 +126,11 @@ Standard_Integer GEOMImpl_ThruSectionsDriver::Execute(TFunction_Logbook& log) co
     return 0;
   }
 
-  BRepCheck_Analyzer ana (aShape, Standard_False);
-  if (!ana.IsValid()) {
+  if ( !GEOMUtils::CheckShape(aShape) && !GEOMUtils::FixShapeTolerance(aShape) ) {
     //algoritm thru section creats on the arcs invalid shapes gka
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape,Precision::Confusion(),Precision::Confusion());
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->SetPrecision(Precision::Confusion());
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-    //ana.Init(aShape, Standard_False);
-    //if (!ana.IsValid()) 
     //  Standard_ConstructionError::Raise("Algorithm have produced an invalid shape result");
   }
 
-
   aFunction->SetValue(aShape);
 
   log.SetTouched(Label());
index a0821e6284f7cde87ca506ac844cd12e8db5fbde..a397c2d146ad1d73324b71a0647406cf79fa3305 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ba9f4ca3c05f439eff3d846efe8e19113da9eaa9..528fb75adddc1c8e28a00ed2f734a0b402d1a69e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 685edda97777f818c17d412c1ec1c0f9567397bf..08bfff17e9064644d721367c5bc6b03004047218 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 0fab3342e8b7ca3a9701bef35dec34349588f5b2..0533b040b2ea2d94ad701a520bdff779abdf7480 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
-#include <Standard_Stream.hxx>
-
 #include <GEOMImpl_TranslateDriver.hxx>
 #include <GEOMImpl_ITranslate.hxx>
-#include <GEOMImpl_ITransformOperations.hxx>
 #include <GEOMImpl_Types.hxx>
 #include <GEOM_Function.hxx>
 #include <GEOMUtils.hxx>
 
-#include <ShapeFix_Shape.hxx>
-#include <ShapeFix_ShapeTolerance.hxx>
-
 #include <BRep_Tool.hxx>
 #include <BRep_Builder.hxx>
-#include <BRepCheck_Analyzer.hxx>
-#include <BRepBuilderAPI_Transform.hxx>
 
 #include <TopoDS.hxx>
 #include <TopoDS_Shape.hxx>
@@ -43,8 +35,6 @@
 #include <TopoDS_Compound.hxx>
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
-#include <TopoDS_Vertex.hxx>
-#include <TopoDS_Edge.hxx>
 
 #include <gp_Trsf.hxx>
 #include <gp_Pnt.hxx>
@@ -197,7 +187,6 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
       B.Add(aCompound, anOriginal.Located(aLocRes));
     }
     aShape = aCompound;
-    //aShape = GEOMImpl_ITransformOperations::TranslateShape1D(anOriginal, &TI);
   }
   else if (aType == TRANSLATE_2D) {
     Standard_Integer nbtimes1 = TI.GetNbIter1(), nbtimes2 = TI.GetNbIter2();
@@ -242,25 +231,13 @@ Standard_Integer GEOMImpl_TranslateDriver::Execute(TFunction_Logbook& log) const
       }
     }
     aShape = aCompound;
-    //aShape = GEOMImpl_ITransformOperations::TranslateShape2D(anOriginal, &TI);
   }
   else return 0;
 
   if (aShape.IsNull()) return 0;
 
-  BRepCheck_Analyzer ana (aShape, Standard_True);
-  if (!ana.IsValid()) {
-    ShapeFix_ShapeTolerance aSFT;
-    aSFT.LimitTolerance(aShape,Precision::Confusion(),Precision::Confusion());
-    Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape(aShape);
-    aSfs->SetPrecision(Precision::Confusion());
-    aSfs->Perform();
-    aShape = aSfs->Shape();
-
-    ana.Init(aShape, Standard_False);
-    if (!ana.IsValid())
-      Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result");
-  }
+  if ( !GEOMUtils::CheckShape(aShape, true) && !GEOMUtils::FixShapeTolerance(aShape) )
+    Standard_ConstructionError::Raise("Scaling aborted : algorithm has produced an invalid shape result");
 
   aFunction->SetValue(aShape);
 
index 5bdebc3975a63a6345756259c0532c29f852b11c..37b5379625ce958071057fec88ab21c67bdbe89c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 0ea9449e22f6fe19c4cb198bd5bf752ee2722685..393b4303c76d34b7eb1aa70f57244f68571b216c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
+#ifndef GEOMImpl_Types_HXX
+#define GEOMImpl_Types_HXX
+
+#include <TopAbs_ShapeEnum.hxx>
 
 // GEOM_Object types
 
 
 #define GEOM_POLYLINE2D 56
 
+#define GEOM_TRANSFER_DATA 57
+
 //GEOM_Function types
 
 #define COPY_WITH_REF    1
 #define COPY_WITHOUT_REF 2
+#define TRANSFER_DATA    3
 
 #define IMPORT_SHAPE 1
 #define EXPORT_SHAPE 2
 #define OFFSET_THICKENING 3
 #define OFFSET_THICKENING_COPY 4
 
-#define PROJECTION_COPY    1
-#define PROJECTION_ON_WIRE 2
+#define PROJECTION_COPY        1
+#define PROJECTION_ON_WIRE     2
+#define PROJECTION_ON_CYLINDER 3
 
 #define SCALE_SHAPE      1
 #define SCALE_SHAPE_COPY 2
 #define DISK_THREE_PNT    2
 #define DISK_R            3
 
-#define CYLINDER_R_H           1
-#define CYLINDER_PNT_VEC_R_H   2
-#define CYLINDER_R_H_A         3
-#define CYLINDER_PNT_VEC_R_H_A         4
+#define CYLINDER_R_H            1
+#define CYLINDER_PNT_VEC_R_H    2
+#define CYLINDER_R_H_A          3
+#define CYLINDER_PNT_VEC_R_H_A  4
 
 #define CONE_R1_R2_H         1
 #define CONE_PNT_VEC_R1_R2_H 2
 #define WIRE_EDGES          1
 #define FACE_WIRE           2
 #define SHELL_FACES         3
-#define SOLID_SHELL         4
+//#define SOLID_SHELL         4
 #define SOLID_SHELLS        5
 #define COMPOUND_SHAPES     6
 #define SUBSHAPE_SORTED     7
 #define EDGE_CURVE_LENGTH   12
 #define SHAPES_ON_SHAPE     13
 #define SHAPE_ISOLINE       14
-
+#define FACE_FROM_SURFACE   15
+#define EDGE_UV             16
+#define FACE_UV             17
+#define SURFACE_FROM_FACE   18
+#define SOLID_FACES         19
 
 #define ARCHIMEDE_TYPE 1
 
 #define FUSE_COLLINEAR_EDGES  10
 #define SEWING_NON_MANIFOLD   11
 #define REMOVE_INTERNAL_FACES 12
+#define DIVIDE_EDGE_BY_POINT  13
 
 #define BASIC_FILLING 1
+#define FILLING_ON_CONSTRAINTS 2
 
 #define GLUE_FACES         1
 #define GLUE_FACES_BY_LIST 2
 #define USER_TYPE 200     // Base type for GEOM advanced shapes
 #define USER_TYPE_EX 1000 // Base type for GEOM plugins
 
+// Transfer data method type
+#define TD_GET_IN_PLACE            1
+#define TD_GET_IN_PLACE_OLD        2
+#define TD_GET_IN_PLACE_BY_HISTORY 3
 
-//Plugins specified constants
+// Plugins specified constants
 #define PLUGIN_NAME "Plugin Name"
+
+// Flat type for TopAbs
+enum { TopAbs_FLAT = TopAbs_SHAPE+1 };
+
+#endif // GEOMImpl_Types_HXX
index f123e4fefc208c772bd2bc01c3325aa208146ba0..03c0db5dad1621e10970aa756fedf6dc0a9299e3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <Standard_ConstructionError.hxx>
 
+namespace
+{
+  Handle(GEOM_Object) GetOwner( const TDF_Label& l )
+  {
+    TDF_Label label = l;
+    // object is stored on a grandfather label of a driver label
+    if ( !label.IsNull() )
+      label = label.Father();
+    if ( !label.IsNull() )
+      label = label.Father();
+    
+    return GEOM_Object::GetObject( label );
+  }
+}
+
 //=======================================================================
 //function : GetID
 //purpose  :
@@ -179,8 +194,7 @@ GetCreationInformation(std::string&             theOperationName,
     AddParam( theParams, "Dz", aCI.GetDZ() );
     break;
   case VECTOR_TWO_PNT: {
-    TDF_Label label = Label();
-    Handle(GEOM_Object) obj = GEOM_Object::GetObject( label );
+    Handle(GEOM_Object) obj = GetOwner( Label() );
     if ( !obj.IsNull() && obj->GetType() == GEOM_EDGE )
       theOperationName = "EDGE";
     else
index 3f914399aa8e513076abff457aaa0342558789ca..f2f5dddb0369ed3cc2db15c92065f9b00af8a5d5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 53e966bdb35f6048e332f8269667d0803937e3e9..531caa6a9d58e36b207e3912f5daafc2ad0c48f2 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index fe6a01b4e17b83b5ffc62f8e3341f8cd158f46a3..cb3e004cb7117deb010018b833fb92fb5150c4c2 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -58,8 +58,13 @@ SET(_link_LIBRARIES
   GEOM
   GEOMBase
   Material
-  DependencyTree
   )
+  
+IF(SALOME_USE_GRAPHICSVIEW)
+  LIST(APPEND _link_LIBRARIES
+    DependencyTree
+    )
+ENDIF()
 
 # --- headers ---
 
index b56bc9c67a91876f04b3e49b94bfe87cc69ab600..7a437d272feb4ac70e75578ae7ca2add8c70c7d1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -206,9 +206,11 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
   case GEOMOp::OpDelete:         // EDIT - DELETE
     OnEditDelete();
     break;
+#ifndef DISABLE_PYCONSOLE
   case GEOMOp::OpCheckGeom:      // TOOLS - CHECK GEOMETRY
     OnCheckGeometry();
     break;
+#endif
   case GEOMOp::OpSelectVertex:   // POPUP - SELECT ONLY - VERTEX
     OnSelectOnly( GEOM_POINT );
     break;
@@ -306,9 +308,11 @@ bool GEOMToolsGUI::OnGUIEvent(int theCommandID, SUIT_Desktop* parent)
   case GEOMOp::OpSortChildren:
     OnSortChildren();
     break;
+#ifndef DISABLE_GRAPHICSVIEW
   case GEOMOp::OpShowDependencyTree:
     OnShowDependencyTree();
      break;
+#endif
   case GEOMOp::OpReduceStudy:
     OnReduceStudy();
     break;
index a79c7d30c110abdd8ee8474c867b909595f6441a..6916bdfa83ef76f8450d46daf2513b1e5152d07e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -87,7 +87,9 @@ private:
   void         OnClsBringToFront();
   void         OnCreateFolder();
   void         OnSortChildren();
+#ifndef DISABLE_GRAPHICSVIEW
   void         OnShowDependencyTree();
+#endif
   void         OnReduceStudy();
 
   // Shortcut commands
index 4c8d4c7d809467bf637c5b19608b90f5def46b5f..b83b3e77e30da171467a31beb1753d5d0fb24763 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -24,7 +24,9 @@
 //  File   : GEOMToolsGUI_1.cxx
 //  Author : Sergey ANIKIN, Open CASCADE S.A.S. (sergey.anikin@opencascade.com)
 
+#ifndef DISABLE_PYCONSOLE
 #include <PyConsole_Console.h>
+#endif
 
 #include "GEOMToolsGUI.h"
 #include "GEOMToolsGUI_TransparencyDlg.h"
 #include <GEOMBase.h>
 #include <GEOM_Actor.h>
 
+#ifndef DISABLE_GRAPHICSVIEW
 #include <DependencyTree_ViewModel.h>
 #include <DependencyTree_View.h>
 #include <DependencyTree_Selector.h>
+#endif
 
 #include <Basics_OCCTVersion.hxx>
 
 #include <SUIT_MessageBox.h>
 #include <SUIT_Tools.h>
 
+#include <STD_TabDesktop.h>
+
+#include <QtxWorkstack.h>
+
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
 #include <SalomeApp_Module.h>
@@ -86,7 +94,6 @@
 #include "utilities.h"
 
 // OCCT Includes
-#include <AIS_Drawer.hxx>
 #include <Prs3d_IsoAspect.hxx>
 #include <Prs3d_PointAspect.hxx>
 #include <Graphic3d_AspectMarker3d.hxx>
 
 // QT Includes
 #include <QAction>
+#include <QApplication>
 #include <QColorDialog>
 #include <QInputDialog>
 #include <QFileDialog>
 // VTK includes
 #include <vtkRenderer.h>
 
-class QtxDialog;
 // If the next macro is defined, autocolor feature works for all sub-shapes;
 // if it is undefined, autocolor feature works for groups only
 #define GENERAL_AUTOCOLOR
 // Below macro, when uncommented, switches on simplified (more performant) algorithm
 // of auto-color picking up
 #define SIMPLE_AUTOCOLOR
+// Below macro, when defined, switches on automatic layouting of OCC and Dependecy views
+// on Show Dependencies operation
+#define LAYOUT_DEPVIEW
 
+#ifndef DISABLE_PYCONSOLE
 void GEOMToolsGUI::OnCheckGeometry()
 {
   SalomeApp_Application* app =
@@ -129,6 +140,7 @@ void GEOMToolsGUI::OnCheckGeometry()
   if (pyConsole)
     pyConsole->exec("from GEOM_usinggeom import *");
 }
+#endif
 
 void GEOMToolsGUI::OnAutoColor()
 {
@@ -185,9 +197,9 @@ void GEOMToolsGUI::OnAutoColor()
   
     QColor c( (int)( aColor.R * 255.0 ), (int)( aColor.G * 255.0 ), (int)( aColor.B * 255.0 ) );
 
-    SUIT_OverrideCursor();
+    SUIT_OverrideCursor wc;
     
-    appStudy->setObjectProperty( aMgrId, aChildObject->GetEntry(), GEOM::propertyName( GEOM::Color ), c );
+    appStudy->setObjectProperty( aMgrId, aChildObject->GetStudyEntry(), GEOM::propertyName( GEOM::Color ), c );
     Handle( SALOME_InteractiveObject ) io = new SALOME_InteractiveObject( aChildObject->GetStudyEntry(), "GEOM", "" );
     if ( window->isVisible( io ) ) displayer.Redisplay( io, false );
   }
@@ -260,10 +272,17 @@ void GEOMToolsGUI::OnColor()
   color = QColorDialog::getColor( v.value<QColor>(), app->desktop() );
   if ( !color.isValid() ) return;
 
+  SALOMEDS::Color aSColor;
+  aSColor.R = (double)color.red() / 255.0;
+  aSColor.G = (double)color.green() / 255.0;
+  aSColor.B = (double)color.blue() / 255.0;
+
   // iterate through list of objects and assign new color
-  SUIT_OverrideCursor();
+  SUIT_OverrideCursor wc;
   for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
     Handle( SALOME_InteractiveObject ) io = It.Value();
+    GEOM::GEOM_Object_var aObject = GEOMBase::ConvertIOinGEOMObject( io );
+    if ( !CORBA::is_nil( aObject ) ) aObject->SetColor( aSColor );
     appStudy->setObjectProperty( aMgrId, io->getEntry(), GEOM::propertyName( GEOM::Color ), color );
     if ( window->isVisible( io ) ) displayer.Redisplay( io, false );
   }
@@ -404,7 +423,7 @@ void GEOMToolsGUI::OnNbIsos( ActionType actionType )
     NbIsosDlg->setV( VIso );
 
     if ( NbIsosDlg->exec() ) {
-      SUIT_OverrideCursor();     
+      SUIT_OverrideCursor wc;     
       newNbUIso = NbIsosDlg->getU();
       newNbVIso = NbIsosDlg->getV();
     } else //Cancel case
@@ -460,7 +479,7 @@ void GEOMToolsGUI::OnDeflection()
     ( SUIT_Session::session()->activeApplication()->desktop() );
   DeflectionDlg->setTheDC( aDC );
   if ( DeflectionDlg->exec() ) {
-    SUIT_OverrideCursor();
+    SUIT_OverrideCursor wc;
     aDC = DeflectionDlg->getTheDC();
 
     for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
@@ -661,7 +680,7 @@ void GEOMToolsGUI::OnEdgeWidth()
 
   Dlg->setTheLW( aWidth );
   if ( Dlg->exec() ) {
-    SUIT_OverrideCursor();
+    SUIT_OverrideCursor wc;
     aWidth = Dlg->getTheLW();
   } else
     return; //Cancel case
@@ -704,7 +723,7 @@ void GEOMToolsGUI::OnIsosWidth() {
 
   Dlg->setTheLW( aWidth );
   if ( Dlg->exec() ) {
-    SUIT_OverrideCursor();
+    SUIT_OverrideCursor wc;
     aWidth = Dlg->getTheLW();
   } else
     return; //Cancel case
@@ -869,6 +888,7 @@ void GEOMToolsGUI::OnSortChildren()
   app->updateObjectBrowser( true );
 }
 
+#ifndef DISABLE_GRAPHICSVIEW
 void GEOMToolsGUI::OnShowDependencyTree()
 {
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
@@ -876,31 +896,50 @@ void GEOMToolsGUI::OnShowDependencyTree()
   SalomeApp_Application* app = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
   if ( !app ) return;
 
-  SUIT_ViewManager *svm = app->getViewManager( GraphicsView_Viewer::Type(), false );
+#ifdef LAYOUT_DEPVIEW
+  SUIT_ViewManager* occVm = app->getViewManager( OCCViewer_Viewer::Type(), true );
+  SUIT_ViewWindow* occVw = occVm->getActiveView();
+#endif
+  SUIT_ViewManager* depVm = app->getViewManager( GraphicsView_Viewer::Type(), false );
+  SUIT_ViewWindow* depVw = 0;
 
-  if( !svm ) {
+  if ( !depVm ) {
     DependencyTree_View* view = new DependencyTree_View();
     DependencyTree_ViewModel* viewModel = new DependencyTree_ViewModel( GraphicsView_Viewer::Type(), view );
-    SUIT_ViewManager *svm = app->createViewManager( viewModel );
+    depVm = app->createViewManager( viewModel );
 
     LightApp_SelectionMgr* selMgr = app->selectionMgr();
     new DependencyTree_Selector( viewModel, (SUIT_SelectionMgr*)selMgr );
 
-    SUIT_ViewWindow* svw = svm->getActiveView();
+    depVw = depVm->getActiveView();
     GraphicsView_ViewFrame* aViewFrame = 0;
-    if (!svw) svw = svm->createViewWindow();
-    if (svw) aViewFrame = dynamic_cast<GraphicsView_ViewFrame*>(svw);
+    if ( !depVw ) depVw = depVm->createViewWindow();
+    if ( depVw ) aViewFrame = dynamic_cast<GraphicsView_ViewFrame*>( depVw );
 
     view->init( aViewFrame );
-    svm->setTitle( view->getViewName() );
+    depVm->setTitle( view->getViewName() );
   }
-  else
-    if( DependencyTree_ViewModel* viewModel = dynamic_cast<DependencyTree_ViewModel*>( svm->getViewModel() ) )
-      if( DependencyTree_View* view = dynamic_cast<DependencyTree_View*>( viewModel->getActiveViewPort() ) ) {
-        svm->getActiveView()->setFocus();
-        view->updateModel();
-      }
+  else if ( DependencyTree_ViewModel* viewModel = dynamic_cast<DependencyTree_ViewModel*>( depVm->getViewModel() ) ) {
+    if ( DependencyTree_View* view = dynamic_cast<DependencyTree_View*>( viewModel->getActiveViewPort() ) ) {
+      depVw = depVm->getActiveView();
+      view->updateModel();
+    }
+  }
+
+#ifdef LAYOUT_DEPVIEW
+  // layout views properly
+  STD_TabDesktop* d = dynamic_cast<STD_TabDesktop*>( app->desktop() );
+  if ( d && depVw && occVw ) {
+    QtxWorkstack* ws = d->workstack();
+    ws->stack();
+    QApplication::instance()->processEvents();
+    ws->Split( depVw, Qt::Horizontal, QtxWorkstack::SplitMove );
+    occVw->setFocus();
+  }
+#endif
+  depVw->setFocus();
 }
+#endif
 
 void GEOMToolsGUI::OnReduceStudy()
 {
index 3a3ed488ccdfbdb1dfa1df6d6c957c97fae9c918..f977e08d92da60bef029ab573c05fabab0da8213 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 8999ffdce83019c17f2edf81b9e9b486fd7a059a..055f52e803f50d593dbafd44cdcbe889b610efc5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 31dc95d3543ca68ec4decbb05bd1eec9ace3dfb2..5f3fd28ec1e41a70c3a0f4489c79ecf1dd78da5b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 13da2625c2c86b7c41cbfac9b15386dd3d559f06..0dcedf01464cf1417ce5b6a51629f3e421aad8ab 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d8748d41b2429dfbbbccefd0450c82dcd59f56ef..95713739cdd944e1c35502b35323aa480ebc9d32 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2e5ec22d39ac255599f3eb2b32feb975bb17e3c3..e5049cc2bac7ce4748ca77d9dfc1036e08dbae4c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3d8686c7dadd25b7ef140a9b80cd61c50a1c10ea..22316b51cb066987670186591f2fa00836bf2dcd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index c927bc79c9ce616680a89caf3492062061ae2702..c445ca6245c70e5b10890c1ca3456aa7628836d6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 657230a11093bf437d7025c6592c1d813b4b096b..ce58cb3d61af86c42bea4dd1f84ecb4f37cc5f75 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index ffd65964eaded5d1baeb5a88b6db362f4f48cf6f..27b34ccb47589484cff0a1e82d0061a3f53300cf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2f1e86ccf7e7a75094143b444aa1920df2d8d4fc..ab1ea6692e4399a7afcc2405b0d9468f077e15fe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 94e06964413a950e53ac73b93006616d55c0da39..6a52f70aa1a7b0f388d74778230406bd07dda36b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 17c3a2b3f691cb14e947ed81dbe5550d9d791445..0ac5eb330aabdd9c3bcba9e91fc295ceda15d1a6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 4f25918d4434cf3167b479be51035e2935f46678..c746b3dc7227d2bf27ad6bb0c1d06a898f610cf4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ffa36f27c55e9a9990a41d6c7dbcce4f347bd7ed..d5e69e2ec838fdc6dd03e3cb1fc33bbeec6bd96f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -282,7 +282,10 @@ GEOMToolsGUI_TreeWidgetItem* GEOMToolsGUI_ReduceStudyDlg::addSubObject( QTreeWid
 {
   GEOMToolsGUI_TreeWidgetItem* item;
   if( !theObject->IsMainShape() ) {
-    GEOMToolsGUI_TreeWidgetItem* parentItem = addSubObject( theWidget, theObjects, theObject->GetMainShape() );
+    GEOM::GEOM_Object_var aMainShape = theObject->GetMainShape();
+    if ( CORBA::is_nil( aMainShape ) )
+      return NULL;
+    GEOMToolsGUI_TreeWidgetItem* parentItem = addSubObject( theWidget, theObjects, aMainShape );
     item = findObjectInTree( theWidget, theObject );
     if( !item )
       item = new GEOMToolsGUI_TreeWidgetItem( parentItem, QStringList() << theObject->GetName(), theObject->GetStudyEntry() );
index ce69292e8d275c75dc7633e22bc83e0240deae5f..bd1f633c9922436202969c8fa1ba31ba3d25f178 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2175e005b678f209505b3f5bb47effb7dbce57cd..7a2db93058035f4d8e866adaa760130978e64f41 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -282,7 +282,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency()
       return;
     }
 
-    SUIT_OverrideCursor();
+    SUIT_OverrideCursor wc;
     for ( SALOME_ListIteratorOfListIO It( selected ); It.More(); It.Next() ) {
       aView->SetTransparency( It.Value(), newValue );
       aStudy->setObjectProperty( aMgrId , It.Value()->getEntry(), GEOM::propertyName( GEOM::Transparency ) , newValue );
@@ -306,7 +306,7 @@ void GEOMToolsGUI_TransparencyDlg::SetTransparency()
       return;
     }
     
-    SUIT_OverrideCursor();
+    SUIT_OverrideCursor wc;
     OCCViewer_Viewer* vm = dynamic_cast<OCCViewer_Viewer*>( window->getViewManager()->getViewModel() );
     if ( !vm )
       return;
index f9fad5b0841cbf3157889b6f52f1c04b57dc4533..2cd37a5a3649ab26f7ee309e314dae638c95cb93 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 38cf648b7e5e32b4570492e0a210bd21d2bac689..bd0d8eb77ecd7cfdbe98b7c77d4e9abfa11fbb53 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index fdd98a68658728819c5b6b482b088f0603749a53..a2bbfd9d00d295b8c7514cf029876560656a52f5 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -42,6 +42,7 @@ SET(_link_LIBRARIES
   ${CAS_TKG3d}
   ${CAS_TKV3d}
   ${CAS_TKGeomBase}
+  ${CAS_TKBO}
   ${LIBXML2_LIBRARIES}
   ${KERNEL_SALOMELocalTrace}
   )
@@ -51,6 +52,10 @@ SET(_link_LIBRARIES
 SET(GEOMUtils_HEADERS
   GEOMUtils.hxx
   GEOMUtils_Hatcher.hxx
+  GEOMUtils_HTrsfCurve2d.hxx
+  GEOMUtils_ShapeStatistics.hxx
+  GEOMUtils_Trsf2d.hxx
+  GEOMUtils_TrsfCurve2d.hxx
   GEOMUtils_XmlHandler.hxx
   )
 # --- sources ---
@@ -58,6 +63,10 @@ SET(GEOMUtils_HEADERS
 SET(GEOMUtils_SOURCES
   GEOMUtils.cxx
   GEOMUtils_Hatcher.cxx
+  GEOMUtils_HTrsfCurve2d.cxx
+  GEOMUtils_ShapeStatistics.cxx
+  GEOMUtils_Trsf2d.cxx
+  GEOMUtils_TrsfCurve2d.cxx
   GEOMUtils_XmlHandler.cxx
   )
 
index 44e55da79024fb50881b22567913ef6dd1c88b5e..c359c25676034168ea8bb651a3c41c5d9db17964 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -26,7 +26,6 @@
 
 #include <Basics_OCCTVersion.hxx>
 
-#include <utilities.h>
 #include <OpUtil.hxx>
 #include <Utils_ExceptHandlers.hxx>
 
 #include <BRepClass3d_SolidClassifier.hxx>
 
 #include <BRepBuilderAPI_MakeFace.hxx>
+#include <BRepBuilderAPI_Sewing.hxx>
+
+#include <BRepCheck_Analyzer.hxx>
 
 #include <Bnd_Box.hxx>
 
+#include <BOPTools_AlgoTools.hxx>
+
 #include <TopAbs.hxx>
 #include <TopExp.hxx>
 #include <TopoDS.hxx>
 
 #include <ShapeAnalysis.hxx>
 #include <ShapeFix_Shape.hxx>
+#include <ShapeFix_ShapeTolerance.hxx>
 
 #include <ProjLib.hxx>
 #include <ElSLib.hxx>
 
 #include <vector>
 #include <sstream>
+#include <algorithm>
 
 #include <Standard_Failure.hxx>
 #include <Standard_NullObject.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
+#define MAX2(X, Y)    (Abs(X) > Abs(Y) ? Abs(X) : Abs(Y))
+#define MAX3(X, Y, Z) (MAX2(MAX2(X,Y), Z))
+
 #define STD_SORT_ALGO 1
 
+#define DEFAULT_TOLERANCE_TOLERANCE     1.e-02
+#define DEFAULT_MAX_TOLERANCE_TOLERANCE 1.e-06
+
+// When the following macro is defined, ShapeFix_ShapeTolerance function is used to set max tolerance of curve
+// in GEOMUtils::FixShapeCurves function; otherwise less restrictive BRep_Builder::UpdateEdge/UpdateVertex
+// approach is used
+// VSR (29/12/2014): macro disabled
+//#define USE_LIMIT_TOLERANCE
+
 namespace
 {
   /**
@@ -112,7 +130,6 @@ namespace
                                TopoDS_Shape  &theModifiedShape,
                                Standard_Real &theAddDist)
   {
-    Standard_Boolean isModified = Standard_False;
     TopExp_Explorer anExp;
     int nbf = 0;
 
@@ -136,120 +153,74 @@ namespace
         const Standard_Boolean isShell =
           (sh.ShapeType()==TopAbs_SHELL || sh.ShapeType()==TopAbs_FACE);
 
-        if( isShell || S->IsUPeriodic() ) {
-          // non solid case or any periodic surface (Mantis 22454).
-          double U1,U2,V1,V2;
-          // changes for 0020677: EDF 1219 GEOM: MinDistance gives 0 instead of 20.88
-          //S->Bounds(U1,U2,V1,V2); changed by
-          ShapeAnalysis::GetFaceUVBounds(TopoDS::Face(theModifiedShape),U1,U2,V1,V2);
-          // end of changes for 020677 (dmv)
-          Handle(Geom_RectangularTrimmedSurface) TrS1 =
-            new Geom_RectangularTrimmedSurface(S,U1,(U1+U2)/2.,V1,V2);
-          Handle(Geom_RectangularTrimmedSurface) TrS2 =
-            new Geom_RectangularTrimmedSurface(S,(U1+U2)/2.,U2,V1,V2);
+        if ( !isShell && S->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ) {
+          Handle(Geom_SphericalSurface) SS = Handle(Geom_SphericalSurface)::DownCast(S);
+          gp_Pnt PC = SS->Location();
           BRep_Builder B;
-          TopoDS_Face F1,F2;
-          TopoDS_Shape aMShape;
-
-          if (isShell) {
-            B.MakeCompound(TopoDS::Compound(aMShape));
-          } else {
-            B.MakeShell(TopoDS::Shell(aMShape));
-          }
-
-          B.MakeFace(F1,TrS1,1.e-7);
-          B.Add(aMShape,F1);
-          B.MakeFace(F2,TrS2,1.e-7);
-          B.Add(aMShape,F2);
-          Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;
-
-          if (!isShell) {
-            // The original shape is a solid.
-            TopoDS_Solid aSolid;
-
-            B.MakeSolid(aSolid);
-            B.Add(aSolid, aMShape);
-            aMShape = aSolid;
-          }
-
-          sfs->Init(aMShape);
-          sfs->SetPrecision(1.e-6);
-          sfs->SetMaxTolerance(1.0);
-          sfs->Perform();
-          theModifiedShape = sfs->Shape();
-          isModified = Standard_True;
+          TopoDS_Vertex V;
+          B.MakeVertex(V,PC,1.e-7);
+          theModifiedShape = V;
+          theAddDist = SS->Radius();
+          return Standard_True;
         }
-        else {
-          if( S->IsKind(STANDARD_TYPE(Geom_SphericalSurface)) ) {
-            Handle(Geom_SphericalSurface) SS = Handle(Geom_SphericalSurface)::DownCast(S);
-            gp_Pnt PC = SS->Location();
-            BRep_Builder B;
-            TopoDS_Vertex V;
-            B.MakeVertex(V,PC,1.e-7);
-            theModifiedShape = V;
-            theAddDist = SS->Radius();
-            isModified = Standard_True;
-          }
-          else {
-            Handle(Geom_ToroidalSurface) TS = Handle(Geom_ToroidalSurface)::DownCast(S);
-            gp_Ax3 ax3 = TS->Position();
-            Handle(Geom_Circle) C = new Geom_Circle(ax3.Ax2(),TS->MajorRadius());
-            BRep_Builder B;
-            TopoDS_Edge E;
-            B.MakeEdge(E,C,1.e-7);
-            theModifiedShape = E;
-            theAddDist = TS->MinorRadius();
-            isModified = Standard_True;
-          }
+        if ( !isShell && S->IsKind(STANDARD_TYPE(Geom_ToroidalSurface)) ) {
+          Handle(Geom_ToroidalSurface) TS = Handle(Geom_ToroidalSurface)::DownCast(S);
+          gp_Ax3 ax3 = TS->Position();
+          Handle(Geom_Circle) C = new Geom_Circle(ax3.Ax2(),TS->MajorRadius());
+          BRep_Builder B;
+          TopoDS_Edge E;
+          B.MakeEdge(E,C,1.e-7);
+          theModifiedShape = E;
+          theAddDist = TS->MinorRadius();
+          return Standard_True;
         }
-      } else {
-        theModifiedShape = theShape;
-      }
-    }
-    else
-      theModifiedShape = theShape;
 
-    return isModified;
-  }
-
-  //=======================================================================
-  //function : ShapeToDouble
-  //purpose  : used by CompareShapes::operator()
-  //=======================================================================
-  std::pair<double, double> ShapeToDouble (const TopoDS_Shape& S, bool isOldSorting)
-  {
-    // Computing of CentreOfMass
-    gp_Pnt GPoint;
-    double Len;
-
-    if (S.ShapeType() == TopAbs_VERTEX) {
-      GPoint = BRep_Tool::Pnt(TopoDS::Vertex(S));
-      Len = (double)S.Orientation();
-    }
-    else {
-      GProp_GProps GPr;
-      // BEGIN: fix for Mantis issue 0020842
-      if (isOldSorting) {
-        BRepGProp::LinearProperties(S, GPr);
-      }
-      else {
-        if (S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE) {
-          BRepGProp::LinearProperties(S, GPr);
-        }
-        else if (S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL) {
-          BRepGProp::SurfaceProperties(S, GPr);
-        }
-        else {
-          BRepGProp::VolumeProperties(S, GPr);
+        // non solid case or any periodic surface (Mantis 22454).
+        double U1,U2,V1,V2;
+        // changes for 0020677: EDF 1219 GEOM: MinDistance gives 0 instead of 20.88
+        //S->Bounds(U1,U2,V1,V2); changed by
+        ShapeAnalysis::GetFaceUVBounds(TopoDS::Face(theModifiedShape),U1,U2,V1,V2);
+        // end of changes for 020677 (dmv)
+        Handle(Geom_RectangularTrimmedSurface) TrS1 =
+          new Geom_RectangularTrimmedSurface(S,U1,(U1+U2)/2.,V1,V2);
+        Handle(Geom_RectangularTrimmedSurface) TrS2 =
+          new Geom_RectangularTrimmedSurface(S,(U1+U2)/2.,U2,V1,V2);
+        TopoDS_Shape aMShape;
+        
+        TopoDS_Face F1 = BRepBuilderAPI_MakeFace(TrS1, Precision::Confusion());
+        TopoDS_Face F2 = BRepBuilderAPI_MakeFace(TrS2, Precision::Confusion());
+        
+        if (isShell) {
+          BRep_Builder B;
+          B.MakeCompound(TopoDS::Compound(aMShape));
+          B.Add(aMShape, F1);
+          B.Add(aMShape, F2);
+        } else {
+          // The original shape is a solid.
+          BRepBuilderAPI_Sewing aSewing (Precision::Confusion()*10.0);
+          aSewing.Add(F1);
+          aSewing.Add(F2);
+          aSewing.Perform();
+          aMShape = aSewing.SewedShape();
+          BRep_Builder B;
+          TopoDS_Solid aSolid;
+          B.MakeSolid(aSolid);
+          B.Add(aSolid, aMShape);
+          aMShape = aSolid;
         }
+        
+        Handle(ShapeFix_Shape) sfs = new ShapeFix_Shape;
+        sfs->Init(aMShape);
+        sfs->SetPrecision(1.e-6);
+        sfs->SetMaxTolerance(1.0);
+        sfs->Perform();
+        theModifiedShape = sfs->Shape();
+        return Standard_True;
       }
-      // END: fix for Mantis issue 0020842
-      GPoint = GPr.CentreOfMass();
-      Len = GPr.Mass();
     }
-
-    double dMidXYZ = GPoint.X() * 999.0 + GPoint.Y() * 99.0 + GPoint.Z() * 0.9;
-    return std::make_pair(dMidXYZ, Len);
+    
+    theModifiedShape = theShape;
+    return Standard_False;
   }
 
   void parseWard( const GEOMUtils::LevelsList &theLevelList, std::string &treeStr )
@@ -324,6 +295,46 @@ namespace
 
 }
 
+//=======================================================================
+//function : ShapeToDouble
+//purpose  : used by CompareShapes::operator()
+//=======================================================================
+std::pair<double, double> GEOMUtils::ShapeToDouble (const TopoDS_Shape& S, bool isOldSorting)
+{
+  // Computing of CentreOfMass
+  gp_Pnt GPoint;
+  double Len;
+
+  if (S.ShapeType() == TopAbs_VERTEX) {
+    GPoint = BRep_Tool::Pnt(TopoDS::Vertex(S));
+    Len = (double)S.Orientation();
+  }
+  else {
+    GProp_GProps GPr;
+    // BEGIN: fix for Mantis issue 0020842
+    if (isOldSorting) {
+      BRepGProp::LinearProperties(S, GPr);
+    }
+    else {
+      if (S.ShapeType() == TopAbs_EDGE || S.ShapeType() == TopAbs_WIRE) {
+        BRepGProp::LinearProperties(S, GPr);
+      }
+      else if (S.ShapeType() == TopAbs_FACE || S.ShapeType() == TopAbs_SHELL) {
+        BRepGProp::SurfaceProperties(S, GPr);
+      }
+      else {
+        BRepGProp::VolumeProperties(S, GPr);
+      }
+    }
+    // END: fix for Mantis issue 0020842
+    GPoint = GPr.CentreOfMass();
+    Len = GPr.Mass();
+  }
+
+  double dMidXYZ = GPoint.X() * 999.0 + GPoint.Y() * 99.0 + GPoint.Z() * 0.9;
+  return std::make_pair(dMidXYZ, Len);
+}
+
 //=======================================================================
 //function : GetPosition
 //purpose  :
@@ -813,6 +824,7 @@ Standard_Boolean GEOMUtils::PreciseBoundingBox
                           (const TopoDS_Shape &theShape, Bnd_Box &theBox)
 {
   if ( theBox.IsVoid() ) BRepBndLib::Add( theShape, theBox );
+  if ( theBox.IsVoid() ) return Standard_False;
 
   Standard_Real aBound[6];
   theBox.Get(aBound[0], aBound[2], aBound[4], aBound[1], aBound[3], aBound[5]);
@@ -1038,19 +1050,19 @@ gp_Pnt GEOMUtils::ConvertClickToPoint( int x, int y, Handle(V3d_View) aView )
 // function : ConvertTreeToString()
 // purpose  : Returns the string representation of dependency tree
 //=======================================================================
-void GEOMUtils::ConvertTreeToString( const TreeModel &tree,
-                                     std::string &treeStr )
+void GEOMUtils::ConvertTreeToString( const TreeModeltree,
+                                     std::string& dependencyStr )
 {
   TreeModel::const_iterator i;
   for ( i = tree.begin(); i != tree.end(); ++i ) {
-    treeStr.append( i->first );
-    treeStr.append( "-" );
+    dependencyStr.append( i->first );
+    dependencyStr.append( "-" );
     std::vector<LevelInfo> upLevelList = i->second.first;
-    treeStr.append( "upward" );
-    parseWard( upLevelList, treeStr );
+    dependencyStr.append( "upward" );
+    parseWard( upLevelList, dependencyStr );
     std::vector<LevelInfo> downLevelList = i->second.second;
-    treeStr.append( "downward" );
-    parseWard( downLevelList, treeStr );
+    dependencyStr.append( "downward" );
+    parseWard( downLevelList, dependencyStr );
   }
 }
 
@@ -1058,23 +1070,275 @@ void GEOMUtils::ConvertTreeToString( const TreeModel &tree,
 // function : ConvertStringToTree()
 // purpose  : Returns the dependency tree
 //=======================================================================
-void GEOMUtils::ConvertStringToTree( const std::string &theData,
-                                     TreeModel &tree )
+void GEOMUtils::ConvertStringToTree( const std::string& dependencyStr,
+                                     TreeModeltree )
 {
   std::size_t cursor = 0;
 
-  while( theData.find('-',cursor) != std::string::npos ) //find next selected object
+  while( dependencyStr.find('-',cursor) != std::string::npos ) //find next selected object
   {
-    std::size_t objectIndex = theData.find( '-', cursor );
-    std::string objectEntry = theData.substr( cursor, objectIndex - cursor );
+    std::size_t objectIndex = dependencyStr.find( '-', cursor );
+    std::string objectEntry = dependencyStr.substr( cursor, objectIndex - cursor );
     cursor = objectIndex;
 
-    std::size_t upwardIndexBegin = theData.find("{",cursor) + 1;
-    std::size_t upwardIndexFinish = theData.find("}",upwardIndexBegin);
-    LevelsList upwardList = parseWard( theData, cursor );
+    std::size_t upwardIndexBegin = dependencyStr.find("{",cursor) + 1;
+    std::size_t upwardIndexFinish = dependencyStr.find("}",upwardIndexBegin);
+    LevelsList upwardList = parseWard( dependencyStr, cursor );
 
-    LevelsList downwardList = parseWard( theData, cursor );
+    LevelsList downwardList = parseWard( dependencyStr, cursor );
 
     tree[objectEntry] = std::pair<LevelsList,LevelsList>( upwardList, downwardList );
   }
 }
+
+bool GEOMUtils::CheckShape( TopoDS_Shape& shape,
+                            bool checkGeometry )
+{
+  BRepCheck_Analyzer analyzer( shape, checkGeometry );
+  return analyzer.IsValid();
+}
+
+bool GEOMUtils::FixShapeTolerance( TopoDS_Shape& shape,
+                                   TopAbs_ShapeEnum type,
+                                   Standard_Real tolerance,
+                                   bool checkGeometry )
+{
+  ShapeFix_ShapeTolerance aSft;
+  aSft.LimitTolerance( shape, tolerance, tolerance, type );
+  Handle(ShapeFix_Shape) aSfs = new ShapeFix_Shape( shape );
+  aSfs->Perform();
+  shape = aSfs->Shape();
+  return CheckShape( shape, checkGeometry );
+}
+
+bool GEOMUtils::FixShapeTolerance( TopoDS_Shape& shape,
+                                   Standard_Real tolerance,
+                                   bool checkGeometry )
+{
+  return FixShapeTolerance( shape, TopAbs_SHAPE, tolerance, checkGeometry );
+}
+
+bool GEOMUtils::FixShapeTolerance( TopoDS_Shape& shape,
+                                   bool checkGeometry )
+{
+  return FixShapeTolerance( shape, Precision::Confusion(), checkGeometry );
+}
+
+bool GEOMUtils::FixShapeCurves( TopoDS_Shape& shape )
+{
+  Standard_Real aT, aTolE, aD, aDMax;
+  TopExp_Explorer aExpF, aExpE;
+  NCollection_DataMap<TopoDS_Edge, Standard_Real, TopTools_ShapeMapHasher> aDMETol;
+  aExpF.Init(shape, TopAbs_FACE);
+  for (; aExpF.More(); aExpF.Next()) {
+    const TopoDS_Face& aF = *(TopoDS_Face*)&aExpF.Current();
+    aExpE.Init(aF, TopAbs_EDGE);
+    for (; aExpE.More(); aExpE.Next()) {
+      const TopoDS_Edge& aE = *(TopoDS_Edge*)&aExpE.Current();
+      try {
+        if (!BOPTools_AlgoTools::ComputeTolerance(aF, aE, aDMax, aT)) {
+          continue;
+        }
+      }
+      catch(...) {
+        continue;
+      }
+      aTolE = BRep_Tool::Tolerance(aE);
+      if (aDMax < aTolE) continue;
+      if (aDMETol.IsBound(aE)) {
+        aD = aDMETol.Find(aE);
+        if (aDMax > aD) {
+          aDMETol.UnBind(aE);
+          aDMETol.Bind(aE, aDMax);
+        }
+      }
+      else {
+        aDMETol.Bind(aE, aDMax);
+      }
+    }
+  }
+  NCollection_DataMap<TopoDS_Edge, Standard_Real, TopTools_ShapeMapHasher>::Iterator aDMETolIt(aDMETol);
+#ifdef USE_LIMIT_TOLERANCE
+  ShapeFix_ShapeTolerance sat;
+#else
+  BRep_Builder b;
+#endif
+  for (; aDMETolIt.More(); aDMETolIt.Next()) {
+#ifdef USE_LIMIT_TOLERANCE
+    sat.LimitTolerance(aDMETolIt.Key(), aDMETolIt.Value()*1.001);
+#else
+    TopoDS_Iterator itv(aDMETolIt.Key());
+    for (; itv.More(); itv.Next())
+      b.UpdateVertex(TopoDS::Vertex(itv.Value()), aDMETolIt.Value()*1.001);
+    b.UpdateEdge(aDMETolIt.Key(), aDMETolIt.Value()*1.001);
+#endif
+  }
+  return CheckShape( shape );
+}
+
+bool GEOMUtils::Write( const TopoDS_Shape& shape, const char* fileName )
+{
+  return BRepTools::Write( shape, fileName );
+}
+
+TopoDS_Shape GEOMUtils::ReduceCompound( const TopoDS_Shape& shape )
+{
+  TopoDS_Shape result = shape;
+
+  if ( shape.ShapeType() == TopAbs_COMPOUND ||
+       shape.ShapeType() == TopAbs_COMPSOLID ) {
+
+    TopTools_ListOfShape l;
+    
+    TopoDS_Iterator it ( shape );
+    for ( ; it.More(); it.Next() )
+      l.Append( it.Value() );
+    if ( l.Extent() == 1 && l.First() != shape )
+      result = ReduceCompound( l.First() );
+  }
+  
+  return result;
+}
+
+void GEOMUtils::MeshShape( const TopoDS_Shape shape,
+                           double deflection, bool theForced )
+{
+  Standard_Real aDeflection = ( deflection <= 0 ) ? DefaultDeflection() : deflection;
+  
+  // Is shape triangulated?
+  Standard_Boolean alreadyMeshed = true;
+  TopExp_Explorer ex;
+  TopLoc_Location aLoc;
+  for ( ex.Init( shape, TopAbs_FACE ); ex.More() && alreadyMeshed; ex.Next() ) {
+    const TopoDS_Face& aFace = TopoDS::Face( ex.Current() );
+    Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation( aFace, aLoc );
+    alreadyMeshed = !aPoly.IsNull(); 
+  }
+  
+  if ( !alreadyMeshed || theForced ) {
+    // Compute bounding box
+    Bnd_Box B;
+    BRepBndLib::Add( shape, B );
+    if ( B.IsVoid() )
+      return; // NPAL15983 (Bug when displaying empty groups) 
+    Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+    B.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax );
+    
+    // This magic line comes from Prs3d_ShadedShape.gxx in OCCT
+    aDeflection = MAX3(aXmax-aXmin, aYmax-aYmin, aZmax-aZmin) * aDeflection * 4;
+    
+    // Clean triangulation before compute incremental mesh
+    BRepTools::Clean( shape );
+    
+    // Compute triangulation
+    BRepMesh_IncrementalMesh mesh( shape, aDeflection ); 
+  }
+}
+
+double GEOMUtils::DefaultDeflection()
+{
+  return 0.001;
+}
+
+//=======================================================================
+//function : IsOpenPath
+//purpose  : 
+//=======================================================================
+bool GEOMUtils::IsOpenPath(const TopoDS_Shape &theShape)
+{
+  bool isOpen = true;
+
+  if (theShape.IsNull() == Standard_False) {
+    if (theShape.Closed()) {
+      // The shape is closed
+      isOpen = false;
+    } else {
+      const TopAbs_ShapeEnum aType = theShape.ShapeType();
+
+      if (aType == TopAbs_EDGE || aType == TopAbs_WIRE) {
+        // Check if path ends are coinsident.
+        TopoDS_Vertex aV[2];
+
+        if (aType == TopAbs_EDGE) {
+          // Edge
+          TopExp::Vertices(TopoDS::Edge(theShape), aV[0], aV[1]);
+        } else {
+          // Wire
+          TopExp::Vertices(TopoDS::Wire(theShape), aV[0], aV[1]);
+        }
+
+        if (aV[0].IsNull() == Standard_False &&
+            aV[1].IsNull() == Standard_False) {
+          if (aV[0].IsSame(aV[1])) {
+            // The shape is closed
+            isOpen = false;
+          } else {
+            const Standard_Real aTol1 = BRep_Tool::Tolerance(aV[0]);
+            const Standard_Real aTol2 = BRep_Tool::Tolerance(aV[1]);
+            const gp_Pnt        aPnt1 = BRep_Tool::Pnt(aV[0]);
+            const gp_Pnt        aPnt2 = BRep_Tool::Pnt(aV[1]);
+
+            if (aPnt1.Distance(aPnt2) <= aTol1 + aTol2) {
+              // The shape is closed
+              isOpen = false;
+            }
+          }
+        }
+      }
+    }
+  }
+
+  return isOpen;
+}
+
+//=======================================================================
+//function : CompareToleranceValues
+//purpose  : 
+//=======================================================================
+int GEOMUtils::CompareToleranceValues(const double theTolShape,
+                                      const double theTolRef)
+{
+  const double aTolTol = Min(DEFAULT_MAX_TOLERANCE_TOLERANCE,
+                             theTolRef*DEFAULT_TOLERANCE_TOLERANCE);
+
+  int aResult = 0;
+
+  if (theTolShape < theTolRef - aTolTol) {
+    aResult = -1;
+  } else if (theTolShape > theTolRef + aTolTol) {
+    aResult = 1;
+  }
+
+  return aResult;
+}
+
+//=======================================================================
+//function : IsFitCondition
+//purpose  : 
+//=======================================================================
+bool GEOMUtils::IsFitCondition(const ComparisonCondition theCondition,
+                               const double              theTolShape,
+                               const double              theTolRef)
+{
+  const int aCompValue = CompareToleranceValues(theTolShape, theTolRef);
+  bool      isFit      = false;
+
+  switch (theCondition) {
+    case CC_GT:
+      isFit = aCompValue == 1;
+      break;
+    case GEOMUtils::CC_GE:
+      isFit = aCompValue != -1;
+      break;
+    case GEOMUtils::CC_LT:
+      isFit = aCompValue == -1;
+      break;
+    case GEOMUtils::CC_LE:
+      isFit = aCompValue != 1;
+      break;
+    default:
+      break;
+  }
+
+  return isFit;
+}
index 95c0e7c0f0201531a4a10d9912e00fc8fb5913c9..184bc970395e4286397f2e9e10cac776ca343f65 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -55,11 +55,43 @@ inline Standard_Boolean IsEqual (const TopoDS_Shape& S1, const TopoDS_Shape& S2)
 namespace GEOMUtils
 {
 
+  /**
+   * This enumeration represents comparison conditions.
+   */
+  enum ComparisonCondition {
+    CC_GT, ///< Greater then
+    CC_GE, ///< Greater then or equal to
+    CC_LT, ///< Less then
+    CC_LE  ///< Less then or equal to
+  };
+
   typedef std::vector<std::string> NodeLinks;
   typedef std::map<std::string, NodeLinks> LevelInfo;
   typedef std::vector<LevelInfo> LevelsList;
   typedef std::map<std::string,std::pair<LevelsList,LevelsList> > TreeModel;
 
+  /*!
+   * \brief Compute numerical functor for the shape.
+   *
+   * Resulting value can be used to sort out shapes according to some parameter.
+   * 
+   * Returns a pair of two values (dist, functor) where
+   * - \a dist is a some value that is computed according to the center of mass of given shape;
+   * - \a functor is a numerical functor value
+   *
+   * The numerical functor is computed according to the shape's topological properties as follows:
+   * - orientation for vertices 
+   * - length for edges and wires
+   * - area for faces and shells
+   * - volume for solids, compounds, compsolids
+   *
+   * If \a isOldSorting parameter is set to \c true, for all cases linear properties of the shape
+   * are used (to support backward compatibility in some methods). By default, this parameter is
+   * set to \c false.
+   */
+  Standard_EXPORT std::pair<double, double> ShapeToDouble (const TopoDS_Shape& theShape,
+                                                           bool isOldSorting = false);
+
   /*!
    * \brief Get Local Coordinate System, corresponding to the given shape.
    *
@@ -193,11 +225,161 @@ namespace GEOMUtils
    */
   Standard_EXPORT gp_Pnt ConvertClickToPoint( int x, int y, Handle(V3d_View) theView );
 
-  Standard_EXPORT void ConvertTreeToString( const TreeModel &theTree,
-                                           std::string &DependencyStr );
+  /*!
+   * \brief Convert dependency tree data to the string representation
+   *
+   * \param tree dependency tree data
+   * \param dependencyStr output string
+   */
+  Standard_EXPORT void ConvertTreeToString( const TreeModel& tree,
+                                           std::string& dependencyStr );
+
+  /*!
+   * \brief Restore dependency tree data from the string representation
+   *
+   * \param dependencyStr string representation of tree data
+   * \param tree output dependency tree data
+   */
+  Standard_EXPORT void ConvertStringToTree( const std::string& dependencyStr,
+                                           TreeModel& tree );
+
+  /*!
+   * \brief Check shape
+   *
+   * \param shape input shape object
+   * \param checkGeometry when set to \c true, causes check of underlying geometry
+   *        in addition to the topology
+   * \return \c true if shape is valid or \c false otherwise
+   */
+  Standard_EXPORT bool CheckShape( TopoDS_Shape& shape, bool checkGeometry = false );
+  
+  /*!
+   * \brief Limit shape tolerance to the given value
+   *
+   * \param shape shape being fixed
+   * \param type topology type which tolerance is to be limited; TopAbs_SHAPE means
+   *             all types of topology
+   * \param tolerance expected tolerance value (1e-7 by default)
+   * \param checkGeometry check geometry validity of result
+   * \return \c true if resulting shape is valid
+   *
+   * \note Resulting tolerance of the shape is not mandatory equal to requested value
+   *       as it might be changed by fixshape operation in order to get valid shape where possible
+   * \note By default, result only checked for topology validity; check of geometry can be done by
+   *       passing \c true to \a checkGeometry parameter
+   */
+  Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape,
+                                          TopAbs_ShapeEnum type,
+                                          Standard_Real tolerance = Precision::Confusion(),
+                                          bool checkGeometry = false );
 
-  Standard_EXPORT void ConvertStringToTree( const std::string &theDependencyStr,
-                                           TreeModel &tree );
+  /*!
+   * \brief Limit shape tolerance to the given value
+   * This is overloaded function, it behaves exactly as previous one
+   */
+  Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape,
+                                          Standard_Real tolerance = Precision::Confusion(),
+                                          bool checkGeometry = false );
+
+  /*!
+   * \brief Limit shape tolerance to the given value
+   * This is overloaded function, it behaves exactly as previous one
+   */
+  Standard_EXPORT bool FixShapeTolerance( TopoDS_Shape& shape,
+                                          bool checkGeometry );
+
+  /*!
+   * \brief Fix curves of the given shape
+   * 
+   * The function checks each curve of the input shape in the following way:
+   * - compute deviation of the curve from the underlying surface in a set of points
+   *   computed with the certain discretization step value
+   * - find maximum tolerance between computed deviation values
+   * - limit tolerance of the curve with the computed maximum value
+   * 
+   * \param shape shape being fixed
+   * \return \c true if resulting shape is valid
+   */
+  Standard_EXPORT bool FixShapeCurves( TopoDS_Shape& shape );
+
+  /*!
+   * \brief Write shape to the BREP file
+   *
+   * \param source shape
+   * \return \c true if file was written or \c false otherwise
+   */
+  Standard_EXPORT bool Write( const TopoDS_Shape& shape,
+                              const char* fileName );
+  
+  /*!
+   * \brief Extract single SOLID from COMPSOLID or COMPOUND.
+   *
+   * If the argument shape is a COMPUND or COMPSOLID and there's
+   * only single simple-shape type inside, this sub-shape is returned as a result;
+   * otherwise, the shape is not changed.
+   *
+   * \param shape compound or compsolid being processed.
+   * \retval TopoDS_Shape resulting shape
+   */
+  Standard_EXPORT TopoDS_Shape ReduceCompound( const TopoDS_Shape& shape );
+
+  /*!
+   * \brief Generate triangulation for the shape.
+   *
+   * \param shape shape being meshed
+   * \param deflection deflection coefficient to be used
+   * \param forced if \c true, causes generation of mesh regardless it is already present in the shape
+   */
+  Standard_EXPORT void MeshShape( const TopoDS_Shape shape,
+                                  double deflection, bool forced = true );
+
+  /*!
+   * \brief Get default deflection coefficient used for triangulation
+   * \return default deflection value
+   */
+  Standard_EXPORT double DefaultDeflection();
+
+  /**
+   * \brief Check if the shape is not a closed wire or edge.
+   *
+   * This function is used for pipe creation algorithm to test if
+   * the pipe path is not closed. It returns false if theShape is a wire or
+   * an edge with coincident end vertices. Otherwise it returns true.
+   *
+   * \param theShape the shape to be tested.
+   * \return true if theShape is not a closed wire or edge.
+   */
+  Standard_EXPORT bool IsOpenPath(const TopoDS_Shape &theShape);
+
+  /**
+   * This function compares two tolerances. The shape tolerance (the first
+   * argument) is considered less than the reference tolerance (the second
+   * argument) if theTolShape < theTolRef - Tolerance(theTolRef). theTolShape is
+   * considered greater than theTolRef if theTolShape > theTolRef +
+   * Tolerance(theTolRef). Otherwise these tolerances are equal.
+   * Tolerance(theTolRef) = theTolRef*DEFAULT_TOLERANCE_TOLERANCE. But this value
+   * should not be greated than DEFAULT_MAX_TOLERANCE_TOLERANCE.
+   *
+   * \param theTolShape the shape tolerance
+   * \param theTolRef the reference tolerance
+   * \return -1 if theTolShape is less than theTolRef; 1 if theTolShape is greater
+   * than theTolRef; 0 if they are equal
+   */
+  Standard_EXPORT int CompareToleranceValues(const double theTolShape,
+                                             const double theTolRef);
+
+  /**
+   * Check if the comarison of tolerances fit the condition. The comparison of
+   * tolerances is performed using the function CompareToleranceValues.
+   *
+   * \param theCondition the condition
+   * \param theTolShape the shape tolerance
+   * \param theTolRef the reference tolerance
+   * \return true if the shape tolerance fits the condition; false otherwise.
+   */
+  Standard_EXPORT bool IsFitCondition(const ComparisonCondition theCondition,
+                                      const double              theTolShape,
+                                      const double              theTolRef);
 
 };
 
diff --git a/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx b/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.cxx
new file mode 100644 (file)
index 0000000..560f43a
--- /dev/null
@@ -0,0 +1,48 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 <GEOMUtils_HTrsfCurve2d.hxx>
+
+namespace GEOMUtils {
+  IMPLEMENT_STANDARD_HANDLE (HTrsfCurve2d, Adaptor2d_HCurve2d);
+  IMPLEMENT_STANDARD_RTTIEXT(HTrsfCurve2d, Adaptor2d_HCurve2d);
+}
+
+//=======================================================================
+//function : TrsfCurve2d
+//purpose  :
+//=======================================================================
+GEOMUtils::HTrsfCurve2d::HTrsfCurve2d(const Handle(Geom2d_Curve) &theCurve,
+                                      const Trsf2d               &theTrsf)
+: myCurve (theCurve, theTrsf)
+{
+}
+
+//=======================================================================
+//function : TrsfCurve2d
+//purpose  :
+//=======================================================================
+GEOMUtils::HTrsfCurve2d::HTrsfCurve2d(const Handle(Geom2d_Curve) &theCurve,
+                                      const Standard_Real         theUFirst,
+                                      const Standard_Real         theULast,
+                                      const Trsf2d               &theTrsf)
+: myCurve (theCurve, theUFirst, theULast, theTrsf)
+{
+}
diff --git a/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx b/src/GEOMUtils/GEOMUtils_HTrsfCurve2d.hxx
new file mode 100644 (file)
index 0000000..510fdcb
--- /dev/null
@@ -0,0 +1,81 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 _GEOMUtils_HTrsfCurve2d_HXX_
+#define _GEOMUtils_HTrsfCurve2d_HXX_
+
+
+#include <GEOMUtils_TrsfCurve2d.hxx>
+
+#include <Adaptor2d_HCurve2d.hxx>
+
+
+namespace GEOMUtils
+{
+
+  class HTrsfCurve2d;
+
+  DEFINE_STANDARD_HANDLE(HTrsfCurve2d, Adaptor2d_HCurve2d);
+
+  /*!
+   *  This class represents an adaptor curve that represents an original curve
+   *  transformed by an anisotropic transformation. This is a class manipulated
+   *  by handle.
+   */
+  class HTrsfCurve2d : public Adaptor2d_HCurve2d
+  {
+
+  public:
+    
+    /**
+     * Constructor. Initializes the object with the transformation parameters.
+     * Input parameters are not checked for validity. It is under responsibility
+     * of the caller.
+     */
+    Standard_EXPORT HTrsfCurve2d(const Handle(Geom2d_Curve) &theCurve,
+                                 const Trsf2d               &theTrsf);
+    
+    /**
+     * Constructor. Initializes the object with the curve, first and last
+     * parameters and transformation. Input parameters are not checked
+     * for validity. It is under responsibility of the caller.
+     */
+    Standard_EXPORT HTrsfCurve2d(const Handle(Geom2d_Curve) &theCurve,
+                                 const Standard_Real         theUFirst,
+                                 const Standard_Real         theULast,
+                                 const Trsf2d               &theTrsf);
+
+    /**
+     * Redefined method from the base class.
+     */
+    const Adaptor2d_Curve2d &Curve2d() const
+    { return myCurve; }
+
+  private:
+
+    TrsfCurve2d myCurve;
+
+  public:
+
+    DEFINE_STANDARD_RTTI(HTrsfCurve2d);
+
+  };
+}
+
+#endif
index 7f0d5083bd5dd779f8297855cc868f1d82f669ca..b005fa1232dc44058daae80810bf78039e5ba10f 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 845fa5dcceace26673f6efb43615bd4b09d6a1f7..274648544b9d09c4ae5cdf2c4f2bac62a86acf4a 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
diff --git a/src/GEOMUtils/GEOMUtils_ShapeStatistics.cxx b/src/GEOMUtils/GEOMUtils_ShapeStatistics.cxx
new file mode 100644 (file)
index 0000000..4ef3b86
--- /dev/null
@@ -0,0 +1,147 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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
+//
+
+// File   : GEOMUtils_ShapeStatisticsDlg.cxx
+// Author : Alexander KOVALEV, OPEN CASCADE S.A.S.
+
+#include "GEOMUtils_ShapeStatistics.hxx"
+
+#include <BRepGProp.hxx>
+#include <GProp_GProps.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+
+namespace GEOMUtils
+{
+//=================================================================================
+// function : ComputeMeasures()
+// purpose  : gets measures of the given type for list of shapes in the range
+//=================================================================================
+  std::map<int,double> ComputeMeasures( std::list<TopoDS_Shape> shapes, 
+                             TopAbs_ShapeEnum entity, 
+                             Range &range)
+{
+  bool hasRange = (range.min != -1.0); // -1.0 means that range must not be used
+  if ( !hasRange )
+    range.min = 1e+32, range.max = 0.0;
+  // list of measures of entities
+  std::map<int, double> measures;
+    
+  std::list<TopoDS_Shape>::const_iterator it;
+  int shift = 0;
+  for ( it = shapes.begin(); it != shapes.end(); ++it ) {
+    double aMeasure;
+    TopTools_IndexedMapOfShape aSubShapesMap;
+    TopExp::MapShapes(*it, aSubShapesMap); // map of all global indices
+    TopTools_IndexedMapOfShape aMx;
+    TopExp::MapShapes( *it, entity, aMx ); // map of current type sub-shape indices 
+    int aNbS = aMx.Extent();
+    int index = -1;
+    for ( int i = 1; i <= aNbS; ++i ) {
+      aMeasure = 0.0;
+      const TopoDS_Shape& aSubShape = aMx( i );
+      //Get the measure: length, area or volume
+      GProp_GProps LProps, SProps, VProps;
+      if ( entity == TopAbs_EDGE ) {
+       BRepGProp::LinearProperties( aSubShape, LProps );
+       aMeasure = LProps.Mass();
+      } else if ( entity == TopAbs_FACE ) {
+       BRepGProp::SurfaceProperties( aSubShape, SProps );
+       aMeasure = SProps.Mass();
+      } else if ( entity == TopAbs_SOLID ) {
+       BRepGProp::VolumeProperties( aSubShape, VProps );
+       aMeasure = VProps.Mass();
+      }
+      // Don't pass sub-shapes with out of range measure, if range is used
+      if ( hasRange ) {
+       if ( aMeasure < range.min || aMeasure > range.max )
+         continue;
+      } else {
+       // get range min and max
+       if ( aMeasure < range.min ) range.min = aMeasure;
+       if ( aMeasure > range.max ) range.max = aMeasure;
+      }
+      // get global index of sub-shape
+      index = aSubShapesMap.FindIndex( aSubShape );
+      // keep measures to distribute it
+      measures[shift+index] = aMeasure;
+    }
+    shift += aSubShapesMap.Extent();
+  }
+  return measures;
+}
+
+//=================================================================================
+// function : ComputeDistribution()
+// purpose  : gets distribution data for single shape
+//=================================================================================
+Distribution ComputeDistribution( TopoDS_Shape shape, 
+                                 TopAbs_ShapeEnum entity, 
+                                 int intervals, 
+                                 Range range)
+{
+  std::list<TopoDS_Shape> aShapes;
+  aShapes.push_back( shape );
+  return ComputeDistribution( aShapes, entity, intervals, range );
+}
+
+//=================================================================================
+// function : ComputeDistribution()
+// purpose  : gets distribution data for list of shapes
+//=================================================================================
+Distribution ComputeDistribution( std::list<TopoDS_Shape> shapes, 
+                                 TopAbs_ShapeEnum entity, 
+                                 int nbIntervals, 
+                                 Range range)
+{
+  // get list of measures and compute range (if it was not specified)
+  std::map<int,double> measures = ComputeMeasures( shapes, entity, range );
+
+  // compute a step
+  double aStep = (range.max - range.min) / nbIntervals;
+
+  // compute distribution in intervals
+  Distribution aDistr;
+  std::map<int,double>::iterator dit;
+  for ( int i = 0; i < nbIntervals; i++ ) {
+    Range localRange; // range of current interval
+    localRange.min = range.min + ( i * aStep );
+    localRange.max = range.min + ( (i+1) * aStep );
+    localRange.count = 0;
+
+    std::vector<int> indicesToErase;
+    for ( dit = measures.begin(); dit != measures.end(); dit++ ) {
+      if ( ( dit->second >= localRange.min && dit->second < localRange.max ) || 
+          ( i == nbIntervals-1 && dit->second == localRange.max ) ) {
+       localRange.count++;
+       localRange.indices.push_back( dit->first );
+       // measure is in interval, so remove it from map of search
+       indicesToErase.push_back( dit->first );
+      }
+    }
+    aDistr.push_back( localRange );
+    for( int j=0; j < indicesToErase.size(); j++ )
+      measures.erase( indicesToErase[j] );
+  }
+
+  return aDistr;
+}
+
+} //namespace GEOMUtils
diff --git a/src/GEOMUtils/GEOMUtils_ShapeStatistics.hxx b/src/GEOMUtils/GEOMUtils_ShapeStatistics.hxx
new file mode 100644 (file)
index 0000000..703050e
--- /dev/null
@@ -0,0 +1,61 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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
+//
+
+// File   : GEOMUtils_ShapeStatisticsDlg.hxx
+// Author : Alexander KOVALEV, OPEN CASCADE S.A.S.
+
+#ifndef _GEOMUtils_ShapeStatistics_HXX_
+#define _GEOMUtils_ShapeStatistics_HXX_
+
+#include <list>
+#include <map>
+#include <vector>
+
+#include <TopoDS_Shape.hxx>
+namespace GEOMUtils
+{
+  // struct to store range data
+  typedef struct { double min; double max; long count; std::list<long> indices; } Range;
+  // distribution is a set of ranges
+  typedef std::vector<Range> Distribution;
+
+  // function to get measures of entities and compute range for list of shapes
+  Standard_EXPORT std::map<int,double> ComputeMeasures(
+    std::list<TopoDS_Shape> shapes, 
+    TopAbs_ShapeEnum entity, 
+    Range &range );
+
+  // function to get distribution data for single shape
+  Standard_EXPORT Distribution ComputeDistribution(
+    TopoDS_Shape shape, 
+    TopAbs_ShapeEnum entity, 
+    int intervals, 
+    Range range );
+
+  // function to get distribution data for list of shapes
+  Standard_EXPORT Distribution ComputeDistribution(
+    std::list<TopoDS_Shape> shapes, 
+    TopAbs_ShapeEnum entity, 
+    int intervals, 
+    Range range );
+
+}
+
+#endif // _GEOMUtils_ShapeStatistics_HXX_
diff --git a/src/GEOMUtils/GEOMUtils_Trsf2d.cxx b/src/GEOMUtils/GEOMUtils_Trsf2d.cxx
new file mode 100644 (file)
index 0000000..f96cb9a
--- /dev/null
@@ -0,0 +1,107 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 <GEOMUtils_Trsf2d.hxx>
+
+
+//=======================================================================
+//function : Trsf2d
+//purpose  :
+//=======================================================================
+GEOMUtils::Trsf2d::Trsf2d(const Standard_Real a11,
+                          const Standard_Real a12,
+                          const Standard_Real a13,
+                          const Standard_Real a21,
+                          const Standard_Real a22,
+                          const Standard_Real a23)
+: myA11(a11),
+  myA12(a12),
+  myA13(a13),
+  myA21(a21),
+  myA22(a22),
+  myA23(a23)
+{
+}
+
+//=======================================================================
+//function : TransformD0
+//purpose  :
+//=======================================================================
+void GEOMUtils::Trsf2d::TransformD0(gp_Pnt2d &thePnt) const
+{
+  const Standard_Real aX = myA11*thePnt.X() + myA12*thePnt.Y() + myA13;
+  const Standard_Real aY = myA21*thePnt.X() + myA22*thePnt.Y() + myA23;
+
+  thePnt.SetCoord(aX, aY);
+}
+
+//=======================================================================
+//function : TransformD1
+//purpose  :
+//=======================================================================
+void GEOMUtils::Trsf2d::TransformD1(gp_Pnt2d &thePnt,
+                                    gp_Vec2d &theVec1) const
+{
+  TransformVector(thePnt, theVec1);
+  TransformD0(thePnt);
+}
+
+//=======================================================================
+//function : TransformD2
+//purpose  :
+//=======================================================================
+void GEOMUtils::Trsf2d::TransformD2(gp_Pnt2d &thePnt,
+                                    gp_Vec2d &theVec1,
+                                    gp_Vec2d &theVec2) const
+{
+  TransformVector(thePnt, theVec1);
+  TransformVector(thePnt, theVec2);
+  TransformD0(thePnt);
+}
+
+//=======================================================================
+//function : TransformD3
+//purpose  :
+//=======================================================================
+void GEOMUtils::Trsf2d::TransformD3(gp_Pnt2d &thePnt,
+                                    gp_Vec2d &theVec1,
+                                    gp_Vec2d &theVec2,
+                                    gp_Vec2d &theVec3) const
+{
+  TransformVector(thePnt, theVec1);
+  TransformVector(thePnt, theVec2);
+  TransformVector(thePnt, theVec3);
+  TransformD0(thePnt);
+}
+
+//=======================================================================
+//function : TransformVector
+//purpose  :
+//=======================================================================
+void GEOMUtils::Trsf2d::TransformVector(const gp_Pnt2d &thePnt,
+                                              gp_Vec2d &theVec) const
+{
+  gp_Pnt2d aP0(thePnt.XY());
+  gp_Pnt2d aP1(thePnt.XY().Added(theVec.XY()));
+
+  TransformD0(aP0);
+  TransformD0(aP1);
+  theVec.SetXY(aP1.XY().Subtracted(aP0.XY()));
+}
diff --git a/src/GEOMUtils/GEOMUtils_Trsf2d.hxx b/src/GEOMUtils/GEOMUtils_Trsf2d.hxx
new file mode 100644 (file)
index 0000000..4bb4366
--- /dev/null
@@ -0,0 +1,131 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 _GEOMUtils_Trsf2d_HXX_
+#define _GEOMUtils_Trsf2d_HXX_
+
+
+#include <Geom2dHatch_Hatcher.hxx>
+#include <GeomAbs_IsoType.hxx>
+#include <TColStd_HArray1OfInteger.hxx>
+#include <TColStd_HArray1OfReal.hxx>
+#include <TopoDS_Face.hxx>
+
+
+/*!
+ *  This class represents a non-persistent transformation in 2D space. 
+ *  The transformations can be represented as follow :
+ *
+ *       V1   V2   T       XY        XY
+ *    | a11  a12  a13 |   | x |     | x'|
+ *    | a21  a22  a23 |   | y |     | y'|
+ *    |  0    0    1  |   | 1 |     | 1 |
+
+ *  where {V1, V2} defines the vectorial part of the transformation
+ *  and T defines the translation part of the transformation.
+ *  This transformation can change the nature of the objects if it is
+ *  anisotropic.
+ */
+namespace GEOMUtils
+{
+  class Trsf2d
+  {
+
+  public:
+    
+    /**
+     * Constructor. Initializes the object with the transformation parameters.
+     * Input parameters are not checked for validity. It is under responsibility
+     * of the caller.
+     */
+    Standard_EXPORT Trsf2d(const Standard_Real a11,
+                           const Standard_Real a12,
+                           const Standard_Real a13,
+                           const Standard_Real a21,
+                           const Standard_Real a22,
+                           const Standard_Real a23);
+
+    /**
+     * Transform the point. The passed parameter is modified to have
+     * a transformed value.
+     *
+     * \param thePnt the point.
+     */
+    Standard_EXPORT void TransformD0(gp_Pnt2d &thePnt)const;
+
+    /**
+     * Transform the point and the first derivative vector. The passed
+     * parameters are modified to have a transformed value.
+     *
+     * \param thePnt the point.
+     * \param theVec1 the first derivative vector.
+     */
+    Standard_EXPORT void TransformD1(gp_Pnt2d &thePnt,
+                                     gp_Vec2d &theVec1) const;
+
+    /**
+     * Transform the point, the first and second derivative vectors. The passed
+     * parameters are modified to have a transformed value.
+     *
+     * \param thePnt the point.
+     * \param theVec1 the first derivative vector.
+     * \param theVec2 the second derivative vector.
+     */
+    Standard_EXPORT void TransformD2(gp_Pnt2d &thePnt,
+                                     gp_Vec2d &theVec1,
+                                     gp_Vec2d &theVec2) const;
+
+    /**
+     * Transform the point, the first, second and third derivative vectors.
+     * The passed parameters are modified to have a transformed value.
+     *
+     * \param thePnt the point.
+     * \param theVec1 the first derivative vector.
+     * \param theVec2 the second derivative vector.
+     * \param theVec2 the third derivative vector.
+     */
+    Standard_EXPORT void TransformD3(gp_Pnt2d &thePnt,
+                                     gp_Vec2d &theVec1,
+                                     gp_Vec2d &theVec2,
+                                     gp_Vec2d &theVec3) const;
+
+  private:
+
+    /**
+     * Transform the vector.
+     *
+     * \param thePnt the point.
+     * \param theVec the vector.
+     */
+    void TransformVector(const gp_Pnt2d &thePnt,
+                               gp_Vec2d &theVec) const;
+
+  private:
+
+    Standard_Real myA11;
+    Standard_Real myA12;
+    Standard_Real myA13;
+    Standard_Real myA21;
+    Standard_Real myA22;
+    Standard_Real myA23;
+
+  };
+}
+
+#endif
diff --git a/src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx b/src/GEOMUtils/GEOMUtils_TrsfCurve2d.cxx
new file mode 100644 (file)
index 0000000..f81acac
--- /dev/null
@@ -0,0 +1,380 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 <GEOMUtils_TrsfCurve2d.hxx>
+#include <GEOMUtils_HTrsfCurve2d.hxx>
+
+//=======================================================================
+//function : TrsfCurve2d
+//purpose  :
+//=======================================================================
+GEOMUtils::TrsfCurve2d::TrsfCurve2d(const Handle(Geom2d_Curve) &theCurve,
+                                    const Trsf2d               &theTrsf)
+: myCurve (theCurve),
+  myTrsf  (theTrsf)
+{
+}
+
+//=======================================================================
+//function : TrsfCurve2d
+//purpose  :
+//=======================================================================
+GEOMUtils::TrsfCurve2d::TrsfCurve2d(const Handle(Geom2d_Curve) &theCurve,
+                                    const Standard_Real         theUFirst,
+                                    const Standard_Real         theULast,
+                                    const Trsf2d               &theTrsf)
+: myCurve (theCurve, theUFirst, theULast),
+  myTrsf  (theTrsf)
+{
+}
+
+//=======================================================================
+//function : FirstParameter
+//purpose  :
+//=======================================================================
+Standard_Real GEOMUtils::TrsfCurve2d::FirstParameter() const
+{
+  return myCurve.FirstParameter();
+}
+
+//=======================================================================
+//function : LastParameter
+//purpose  :
+//=======================================================================
+Standard_Real GEOMUtils::TrsfCurve2d::LastParameter() const
+{
+  return myCurve.LastParameter();
+}
+
+//=======================================================================
+//function : Curve
+//purpose  :
+//=======================================================================
+const Handle(Geom2d_Curve) &GEOMUtils::TrsfCurve2d::Curve() const
+{
+  return myCurve.Curve();
+}
+
+//=======================================================================
+//function : GetType
+//purpose  :
+//=======================================================================
+GeomAbs_CurveType GEOMUtils::TrsfCurve2d::GetType() const
+{
+  return GeomAbs_OtherCurve;
+}
+
+//=======================================================================
+//function : Load
+//purpose  :
+//=======================================================================
+void GEOMUtils::TrsfCurve2d::Load(const Handle(Geom2d_Curve) &C)
+{
+  myCurve.Load(C);
+}
+
+//=======================================================================
+//function : Load
+//purpose  :
+//=======================================================================
+void GEOMUtils::TrsfCurve2d::Load(const Handle(Geom2d_Curve) &C,
+                                  const Standard_Real         UFirst,
+                                  const Standard_Real         ULast)
+{
+  myCurve.Load(C, UFirst, ULast);
+}
+
+//=======================================================================
+//function : Continuity
+//purpose  :
+//=======================================================================
+GeomAbs_Shape GEOMUtils::TrsfCurve2d::Continuity() const
+{
+  return myCurve.Continuity();
+}
+
+//=======================================================================
+//function : NbIntervals
+//purpose  :
+//=======================================================================
+Standard_Integer GEOMUtils::TrsfCurve2d::NbIntervals
+                      (const GeomAbs_Shape S) const
+{
+  return myCurve.NbIntervals(S);
+}
+
+//=======================================================================
+//function : Intervals
+//purpose  :
+//=======================================================================
+void GEOMUtils::TrsfCurve2d::Intervals(TColStd_Array1OfReal &T,
+                                       const GeomAbs_Shape   S) const
+{
+  myCurve.Intervals(T, S);
+}
+
+//=======================================================================
+//function : Trim
+//purpose  :
+//=======================================================================
+Handle(Adaptor2d_HCurve2d) GEOMUtils::TrsfCurve2d::Trim
+              (const Standard_Real First, const Standard_Real Last,
+               const Standard_Real /*Tol*/) const
+{
+  Handle(Geom2d_Curve)            aCurve = myCurve.Curve();
+  GEOMUtils::Handle(HTrsfCurve2d) aAHCurve =
+    new GEOMUtils::HTrsfCurve2d(aCurve, First, Last, myTrsf);
+
+  return aAHCurve;
+}
+
+//=======================================================================
+//function : IsClosed
+//purpose  :
+//=======================================================================
+Standard_Boolean GEOMUtils::TrsfCurve2d::IsClosed() const
+{
+  return myCurve.IsClosed();
+}
+
+//=======================================================================
+//function : IsPeriodic
+//purpose  :
+//=======================================================================
+Standard_Boolean GEOMUtils::TrsfCurve2d::IsPeriodic() const
+{
+  return myCurve.IsPeriodic();
+}
+
+//=======================================================================
+//function : Period
+//purpose  :
+//=======================================================================
+Standard_Real GEOMUtils::TrsfCurve2d::Period() const
+{
+  return myCurve.Period();
+}
+
+//=======================================================================
+//function : Value
+//purpose  :
+//=======================================================================
+gp_Pnt2d GEOMUtils::TrsfCurve2d::Value(const Standard_Real U) const
+{
+  gp_Pnt2d aPnt = myCurve.Value(U);
+
+  myTrsf.TransformD0(aPnt);
+
+  return aPnt;
+}
+
+//=======================================================================
+//function : D0
+//purpose  :
+//=======================================================================
+void GEOMUtils::TrsfCurve2d::D0(const Standard_Real U, gp_Pnt2d &P) const
+{
+  myCurve.D0(U, P);
+  myTrsf.TransformD0(P);
+}
+
+//=======================================================================
+//function : D1
+//purpose  :
+//=======================================================================
+void GEOMUtils::TrsfCurve2d::D1(const Standard_Real U,
+                                gp_Pnt2d &P, gp_Vec2d &V) const
+{
+  myCurve.D1(U, P, V);
+  myTrsf.TransformD1(P, V);
+}
+
+//=======================================================================
+//function : D2
+//purpose  :
+//=======================================================================
+void GEOMUtils::TrsfCurve2d::D2(const Standard_Real U, gp_Pnt2d &P,
+                                gp_Vec2d &V1, gp_Vec2d &V2) const
+{
+  myCurve.D2(U, P, V1, V2);
+  myTrsf.TransformD2(P, V1, V2);
+}
+
+//=======================================================================
+//function : D3
+//purpose  :
+//=======================================================================
+void GEOMUtils::TrsfCurve2d::D3(const Standard_Real U, gp_Pnt2d &P,
+                                gp_Vec2d &V1, gp_Vec2d &V2, gp_Vec2d &V3) const
+{
+  myCurve.D3(U, P, V1, V2, V3);
+  myTrsf.TransformD3(P, V1, V2, V3);
+}
+
+//=======================================================================
+//function : DN
+//purpose  :
+//=======================================================================
+gp_Vec2d GEOMUtils::TrsfCurve2d::DN(const Standard_Real    U,
+                                    const Standard_Integer N) const
+{
+  gp_Pnt2d aPnt = myCurve.Value(U);
+  gp_Vec2d aVec = myCurve.DN(U, N);
+
+  myTrsf.TransformD1(aPnt, aVec);
+  return aVec;
+}
+
+//=======================================================================
+//function : Resolution
+//purpose  :
+//=======================================================================
+Standard_Real GEOMUtils::TrsfCurve2d::Resolution(const Standard_Real Ruv) const
+{
+  return Precision::Parametric(Ruv);
+}
+
+//=======================================================================
+//function : Line
+//purpose  :
+//=======================================================================
+gp_Lin2d GEOMUtils::TrsfCurve2d::Line() const
+{
+  Standard_NoSuchObject::Raise();
+
+  return gp_Lin2d();
+}
+
+//=======================================================================
+//function : Circle
+//purpose  :
+//=======================================================================
+gp_Circ2d  GEOMUtils::TrsfCurve2d::Circle() const
+{
+  Standard_NoSuchObject::Raise();
+
+  return gp_Circ2d();
+}
+
+//=======================================================================
+//function : Ellipse
+//purpose  :
+//=======================================================================
+gp_Elips2d GEOMUtils::TrsfCurve2d::Ellipse() const
+{
+  Standard_NoSuchObject::Raise();
+
+  return gp_Elips2d();
+}
+
+//=======================================================================
+//function : Hyperbola
+//purpose  :
+//=======================================================================
+gp_Hypr2d GEOMUtils::TrsfCurve2d::Hyperbola() const
+{
+  Standard_NoSuchObject::Raise();
+
+  return gp_Hypr2d();
+}
+
+//=======================================================================
+//function : Parabola
+//purpose  :
+//=======================================================================
+gp_Parab2d GEOMUtils::TrsfCurve2d::Parabola() const
+{
+  Standard_NoSuchObject::Raise();
+
+  return gp_Parab2d();
+}
+
+//=======================================================================
+//function : Degree
+//purpose  :
+//=======================================================================
+Standard_Integer GEOMUtils::TrsfCurve2d::Degree() const
+{
+  Standard_NoSuchObject::Raise();
+
+  return 0;
+}
+
+//=======================================================================
+//function : IsRational
+//purpose  :
+//=======================================================================
+Standard_Boolean GEOMUtils::TrsfCurve2d::IsRational() const
+{
+  return Standard_False;
+}
+
+//=======================================================================
+//function : NbPoles
+//purpose  :
+//=======================================================================
+Standard_Integer GEOMUtils::TrsfCurve2d::NbPoles() const
+{
+  Standard_NoSuchObject::Raise();
+
+  return 0;
+}
+
+//=======================================================================
+//function : NbKnots
+//purpose  :
+//=======================================================================
+Standard_Integer GEOMUtils::TrsfCurve2d::NbKnots() const
+{
+  Standard_NoSuchObject::Raise();
+
+  return 0;
+}
+
+//=======================================================================
+//function : Bezier
+//purpose  :
+//=======================================================================
+Handle(Geom2d_BezierCurve) GEOMUtils::TrsfCurve2d::Bezier() const
+{
+  Standard_NoSuchObject::Raise();
+
+  return NULL;
+}
+
+//=======================================================================
+//function : BSpline
+//purpose  :
+//=======================================================================
+Handle(Geom2d_BSplineCurve) GEOMUtils::TrsfCurve2d::BSpline() const
+{
+  Standard_NoSuchObject::Raise();
+
+  return NULL;
+}
+
+//=======================================================================
+//function : NbSamples
+//purpose  :
+//=======================================================================
+Standard_Integer GEOMUtils::TrsfCurve2d::NbSamples() const
+{
+  return myCurve.NbSamples();
+}
diff --git a/src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx b/src/GEOMUtils/GEOMUtils_TrsfCurve2d.hxx
new file mode 100644 (file)
index 0000000..f0d94bb
--- /dev/null
@@ -0,0 +1,239 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 _GEOMUtils_TrsfCurve2d_HXX_
+#define _GEOMUtils_TrsfCurve2d_HXX_
+
+
+#include <GEOMUtils_Trsf2d.hxx>
+
+#include <Geom2dHatch_Hatcher.hxx>
+#include <GeomAbs_IsoType.hxx>
+#include <TColStd_HArray1OfInteger.hxx>
+#include <TColStd_HArray1OfReal.hxx>
+#include <TopoDS_Face.hxx>
+
+
+namespace GEOMUtils
+{
+  /*!
+   *  This class represents an adaptor curve that represents an original curve
+   *  transformed by an anisotropic transformation.
+   */
+  class TrsfCurve2d : public Adaptor2d_Curve2d
+  {
+
+  public:
+    
+    /**
+     * Constructor. Initializes the object with the transformation parameters.
+     * Input parameters are not checked for validity. It is under responsibility
+     * of the caller.
+     */
+    Standard_EXPORT TrsfCurve2d(const Handle(Geom2d_Curve) &theCurve,
+                                const Trsf2d               &theTrsf);
+    
+    /**
+     * Constructor. Initializes the object with the curve, first and last
+     * parameters and transformation. Input parameters are not checked
+     * for validity. It is under responsibility of the caller.
+     */
+    Standard_EXPORT TrsfCurve2d(const Handle(Geom2d_Curve) &theCurve,
+                                const Standard_Real         theUFirst,
+                                const Standard_Real         theULast,
+                                const Trsf2d               &theTrsf);
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Real FirstParameter() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Real LastParameter() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT const Handle(Geom2d_Curve)& Curve() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT GeomAbs_CurveType GetType() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT void Load(const Handle(Geom2d_Curve) &C);
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT void Load(const Handle(Geom2d_Curve) &C,
+                              const Standard_Real         UFirst,
+                              const Standard_Real         ULast);
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT GeomAbs_Shape Continuity() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Integer NbIntervals(const GeomAbs_Shape S) const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT void Intervals(TColStd_Array1OfReal &T,
+                                   const GeomAbs_Shape   S) const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Handle(Adaptor2d_HCurve2d) Trim
+              (const Standard_Real First, const Standard_Real Last,
+               const Standard_Real ) const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Boolean IsClosed() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Boolean IsPeriodic() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Real Period() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT gp_Pnt2d Value(const Standard_Real U) const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT void D0(const Standard_Real U, gp_Pnt2d &P) const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT void D1(const Standard_Real U,
+                            gp_Pnt2d &P, gp_Vec2d &V) const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT void D2(const Standard_Real U, gp_Pnt2d &P,
+                            gp_Vec2d &V1, gp_Vec2d &V2) const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT void D3(const Standard_Real U, gp_Pnt2d &P,
+                            gp_Vec2d &V1, gp_Vec2d &V2, gp_Vec2d &V3) const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT gp_Vec2d DN(const Standard_Real    U,
+                                const Standard_Integer N) const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Real Resolution(const Standard_Real Ruv) const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT gp_Lin2d Line() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT gp_Circ2d  Circle() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT gp_Elips2d Ellipse() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT gp_Hypr2d Hyperbola() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT gp_Parab2d Parabola() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Integer Degree() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Boolean IsRational() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Integer NbPoles() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Integer NbKnots() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Handle(Geom2d_BezierCurve) Bezier() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Handle(Geom2d_BSplineCurve) BSpline() const;
+
+    /**
+     * Redefined method from the base class.
+     */
+    Standard_EXPORT Standard_Integer NbSamples() const;
+
+  private:
+
+    Geom2dAdaptor_Curve myCurve;
+    Trsf2d              myTrsf;
+
+  };
+}
+
+#endif
index a05371b1ce41df8df7a065b0b806c2e3ee090b8c..bbbfef8ec275ef2c420b22eee80af653ad75bfb4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 4617fe7f7683211c9e70aba0aea347a906881ac1..392552ad2270512d95e72db14f3e511facbd09ec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d916ffe60b5febdab8b2c978b4641e183610a5ff..b0092a5a1575b24fcd5931b2f49b1826f728b7be 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -29,6 +29,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/GEOM
   ${PROJECT_SOURCE_DIR}/src/GEOMAlgo
   ${PROJECT_SOURCE_DIR}/src/GEOMUtils
+  ${PROJECT_SOURCE_DIR}/src/ShHealOper
   ${PROJECT_BINARY_DIR}/idl
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${PROJECT_BINARY_DIR}
index f63c3c5e89a290e6dd39c359c8f7cb071bdb24f5..e16ef594070c023138eecf2776c53eab762bd34f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -268,50 +268,59 @@ char* GEOM_BaseObject_i::GetParameters()
  */
 //================================================================================
 
-GEOM::CreationInformation* GEOM_BaseObject_i::GetCreationInformation()
+GEOM::CreationInformationSeq* GEOM_BaseObject_i::GetCreationInformation()
 {
-  GEOM::CreationInformation_var info = new GEOM::CreationInformation;
+  GEOM::CreationInformationSeq_var info = new GEOM::CreationInformationSeq();
 
-  Handle(GEOM_BaseDriver) driver =
-    Handle(GEOM_BaseDriver)::DownCast( _impl->GetCreationDriver() );
-  if ( !driver.IsNull() )
+  int nbFun = _impl->GetNbFunctions();
+  info->length( nbFun );
+  int nbI = 0;
+  for ( int i = 1; i <= nbFun; ++i )
   {
-    std::vector<GEOM_Param> params;
-    std::string             operationName;
-    try
+    Handle(GEOM_BaseDriver) driver =
+      Handle(GEOM_BaseDriver)::DownCast( _impl->GetCreationDriver( i ));
+    if ( !driver.IsNull() )
     {
-      OCC_CATCH_SIGNALS;
-      if ( driver->GetCreationInformation( operationName, params ))
+      std::vector<GEOM_Param> params;
+      std::string             operationName;
+      try
       {
-        info->operationName = operationName.c_str();
-        info->params.length( params.size() );
-        for ( size_t i = 0; i < params.size(); ++i )
+        OCC_CATCH_SIGNALS;
+        if ( driver->GetCreationInformation( operationName, params ))
         {
-          info->params[i].name  = params[i].name.c_str();
-          info->params[i].value = params[i].value.c_str();
+          info[nbI].operationName = operationName.c_str();
+          info[nbI].params.length( params.size() );
+          for ( size_t i = 0; i < params.size(); ++i )
+          {
+            info[nbI].params[i].name  = params[i].name.c_str();
+            info[nbI].params[i].value = params[i].value.c_str();
+          }
+          nbI++;
         }
-      }
 #ifdef _DEBUG_
-      if ( operationName.empty() )
-      {
-        cout << endl << endl << endl << "Warning: " << endl << "Dear developer!!!" << endl
-             << "  Consider implementing "
-             <<    typeid(*(driver.operator->())).name() << "::GetCreationInformation() " << endl
-             << "  for the case of operation which has created '" << GetName() << "' object" << endl
-             << "PLEEEEEEEASE" << endl
-             << "\tPLEEEEEEEASE" << endl
-             << "\t\tPLEEEEEEEASE" << endl
-             << "\t\t\tPLEEEEEEEASE" << endl
-             << "\t\t\t\tPLEEEEEEEASE" << endl;
-      }
+        if ( operationName.empty() )
+        {
+          cout << endl << endl << endl << "Warning: " << endl << "Dear developer!!!" << endl
+               << "  Consider implementing "
+               <<    typeid(*(driver.operator->())).name() << "::GetCreationInformation() " << endl
+               << "  for the case of operation which has created '" << GetName() << "' object" << endl
+               << "PLEEEEEEEASE" << endl
+               << "\tPLEEEEEEEASE" << endl
+               << "\t\tPLEEEEEEEASE" << endl
+               << "\t\t\tPLEEEEEEEASE" << endl
+               << "\t\t\t\tPLEEEEEEEASE" << endl;
+        }
 #endif
-    }
-    catch(...)
-    {
+      }
+      catch(...)
+      {
 #ifdef _DEBUG_
-      cout << "Ecxeption in GEOM_BaseObject_i::GetCreationInformation()" << endl;
+        cout << "Ecxeption in GEOM_BaseObject_i::GetCreationInformation()" << endl;
 #endif
+      }
     }
   }
+  info->length( nbI );
+
   return info._retn();
 }
index bd72cd7a90c6d04e09a83f0cfcdb72caffe671a3..aeb291ca7e8c28f5a542716f8ef9845ec832f29e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -66,7 +66,7 @@ class GEOM_I_EXPORT GEOM_BaseObject_i : public virtual POA_GEOM::GEOM_BaseObject
 
   virtual char* GetParameters();
 
-  virtual GEOM::CreationInformation* GetCreationInformation();
+  virtual GEOM::CreationInformationSeq* GetCreationInformation();
 
   Handle(GEOM_BaseObject) GetImpl() { return _impl; }
 
index a9e00e56dad7beffa05c0b19c17ff00412f3e92b..3acb8ca6565619f549fa2704c5959d461e675935 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c2469dc008c1f273bb2ceb2e248451a1974c0db8..2b500edc7d3ad6c184c2d522c99d9aeb57048cc0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 48c45d818c68f3c1059fab2c479d2fea619a2c24..0659bb3511cb0ca22a9debff7cd837dffcce5c8d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 81863e04640e5a8f8969088424fa16566be16850..30c86c98ca264f1607c57e7c6a06b51ada0d7208 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e939d30f10bea24a0f4868cc1e1709a9284b23e0..7f60f803e615f54ee7c08eaba9049589ea582554 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -66,7 +66,6 @@
 
 #include <SALOMEDS_Tool.hxx>
 #include <SALOMEDS_wrap.hxx>
-#include <SALOME_DataContainer_i.hxx>
 #include <Basics_DirUtils.hxx>
 
 #include <set>
@@ -143,6 +142,9 @@ GEOM_Gen_i::GEOM_Gen_i(CORBA::ORB_ptr            orb,
 GEOM_Gen_i::~GEOM_Gen_i() {
   delete name_service;
   delete _impl;
+  std::map<std::string, GEOM_GenericOperationsCreator*>::const_iterator it;
+  for ( it = myOpCreatorMap.begin(); it != myOpCreatorMap.end(); ++it)
+    delete (*it).second;
 }
 
 
@@ -317,24 +319,25 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::PublishInStudy(SALOMEDS::Study_ptr   theStudy,
     aResultSO->SetAttrString("AttributePixMap","ICON_OBJBROWSER_LCS");
     aNamePrefix = "LocalCS_";
   }  else if ( mytype >= USER_TYPE_EX ) {
-      char buf[20];
-      sprintf( buf, "%d", aBaseObj->GetType() );
-      GEOM::CreationInformation_var info = aBaseObj->GetCreationInformation();
-      std::string plgId;
-      for ( size_t i = 0; i < info->params.length(); ++i ) {
-       std::string param_name = info->params[i].name.in();
-       std::string param_value = info->params[i].value.in();   
-       if( param_name == PLUGIN_NAME) {
-         plgId = param_value;
-         break;
-       }
-      }
-      if(plgId.length() > 0 ) {
-       plgId += "::";
+    char buf[20];
+    sprintf( buf, "%d", aBaseObj->GetType() );
+    GEOM::CreationInformationSeq_var infoSeq = aBaseObj->GetCreationInformation();
+    std::string plgId;
+    for ( size_t j = 0; j < infoSeq->length(); ++j )
+      for ( size_t i = 0; i < infoSeq[j].params.length(); ++i ) {
+        std::string param_name  = infoSeq[j].params[i].name.in();
+        std::string param_value = infoSeq[j].params[i].value.in();
+        if( param_name == PLUGIN_NAME) {
+          plgId = param_value;
+          break;
+        }
       }
-      plgId +="ICON_OBJBROWSER_"; 
-      plgId += buf;
-      aResultSO->SetAttrString("AttributePixMap",plgId.c_str());
+    if(plgId.length() > 0 ) {
+      plgId += "::";
+    }
+    plgId +="ICON_OBJBROWSER_";
+    plgId += buf;
+    aResultSO->SetAttrString("AttributePixMap",plgId.c_str());
   } else if ( mytype > USER_TYPE ) {
     char buf[20];
     sprintf( buf, "%d", aBaseObj->GetType() );
@@ -680,8 +683,8 @@ CORBA::Boolean GEOM_Gen_i::Load(SALOMEDS::SComponent_ptr theComponent,
     useCaseBuilder->SetRootCurrent();
     useCaseBuilder->Append( theComponent ); // component object is added as the top level item
   }
-  
-  SALOMEDS::ChildIterator_wrap it = study->NewChildIterator( theComponent ); 
+
+  SALOMEDS::ChildIterator_wrap it = study->NewChildIterator( theComponent );
   for ( it->InitEx(true); it->More(); it->Next() ) {
     if ( !useCaseBuilder->IsUseCaseNode( it->Value() ) ) {
       useCaseBuilder->AppendTo( it->Value()->GetFather(), it->Value() );
@@ -2455,7 +2458,7 @@ GEOM::GEOM_IOperations_ptr GEOM_Gen_i::GetPluginOperations(CORBA::Long theStudyI
       aServant = myOpCreatorMap[aLibName]->Create(_poa, theStudyID, engine, _impl);
       // activate the CORBA servant
       if (aServant)
-       operations = aServant->_this();
+        operations = aServant->_this();
     }
   }
   catch (SALOME_Exception& S_ex) {
@@ -2480,7 +2483,7 @@ void GEOM_Gen_i::LoadPlugin(const std::string& theLibName)
   aPlatformLibName += theLibName;
   aPlatformLibName += ".so";
 #endif
-  
+
   // check, if corresponding operations are already created
   if (myOpCreatorMap.find(theLibName) == myOpCreatorMap.end()) {
     // load plugin library
@@ -2493,7 +2496,7 @@ void GEOM_Gen_i::LoadPlugin(const std::string& theLibName)
       throw(SALOME_Exception(LOCALIZED( "Can't load server geometry plugin library" )));
 #endif
     }
-    
+
     // get method, returning operations creator
     typedef GEOM_GenericOperationsCreator* (*GetOperationsCreator)();
     GetOperationsCreator procHandle =
@@ -2502,7 +2505,7 @@ void GEOM_Gen_i::LoadPlugin(const std::string& theLibName)
       UnLoadLib(libHandle);
       throw(SALOME_Exception(LOCALIZED("bad geometry plugin library")));
     }
-    
+
     // get operations creator
     GEOM_GenericOperationsCreator* aCreator = procHandle();
     if (aCreator) {
@@ -2804,8 +2807,8 @@ char* GEOM_Gen_i::getVersion()
 // function : CreateFolder()
 // purpose  : Creates and returns a new folder object
 //=================================================================================
-SALOMEDS::SObject_ptr GEOM_Gen_i::CreateFolder(const char* theName, 
-                                              SALOMEDS::SObject_ptr theFather)
+SALOMEDS::SObject_ptr GEOM_Gen_i::CreateFolder(const char* theName,
+                                               SALOMEDS::SObject_ptr theFather)
 {
   SALOMEDS::SObject_var aFolderSO;
 
@@ -2857,8 +2860,8 @@ SALOMEDS::SObject_ptr GEOM_Gen_i::CreateFolder(const char* theName,
 // function : MoveToFolder()
 // purpose  : Moves GEOM object to the specified folder
 //=================================================================================
-void GEOM_Gen_i::MoveToFolder(GEOM::GEOM_Object_ptr theObject, 
-                             SALOMEDS::SObject_ptr theFolder) {
+void GEOM_Gen_i::MoveToFolder(GEOM::GEOM_Object_ptr theObject,
+                              SALOMEDS::SObject_ptr theFolder) {
   GEOM::object_list_var objects = new GEOM::object_list();
   objects->length( 1 );
   SALOMEDS::SObject_var aSO = theFolder->GetStudy()->FindObjectID( theObject->GetStudyEntry() );
@@ -2870,8 +2873,8 @@ void GEOM_Gen_i::MoveToFolder(GEOM::GEOM_Object_ptr theObject,
 // function : MoveListToFolder()
 // purpose  : Moves list of GEOM objects to the specified folder
 //=================================================================================
-void GEOM_Gen_i::MoveListToFolder (const GEOM::ListOfGO& theListOfGO, 
-                                  SALOMEDS::SObject_ptr theFolder) {
+void GEOM_Gen_i::MoveListToFolder (const GEOM::ListOfGO& theListOfGO,
+                                   SALOMEDS::SObject_ptr theFolder) {
   int aLen = theListOfGO.length();
   GEOM::object_list_var objects = new GEOM::object_list();
   objects->length( aLen );
@@ -2888,12 +2891,12 @@ void GEOM_Gen_i::MoveListToFolder (const GEOM::ListOfGO& theListOfGO,
 
 //=================================================================================
 // function : Move()
-// purpose  : Moves objects to the specified position. 
+// purpose  : Moves objects to the specified position.
 //            Is used in the drag-n-drop functionality.
 //=================================================================================
 void GEOM_Gen_i::Move( const GEOM::object_list& what,
-                      SALOMEDS::SObject_ptr where,
-                      CORBA::Long row )
+                       SALOMEDS::SObject_ptr where,
+                       CORBA::Long row )
 {
   if ( CORBA::is_nil( where ) ) return;
 
@@ -2903,7 +2906,7 @@ void GEOM_Gen_i::Move( const GEOM::object_list& what,
   SALOMEDS::SComponent_var father = where->GetFatherComponent();
   std::string dataType = father->ComponentDataType();
   if ( dataType != "GEOM" ) return; // not a GEOM component
-  
+
   SALOMEDS::SObject_var objAfter;
   if ( row >= 0 && useCaseBuilder->HasChildren( where ) ) {
     // insert at given row -> find insertion position
@@ -2914,7 +2917,7 @@ void GEOM_Gen_i::Move( const GEOM::object_list& what,
       objAfter = useCaseIt->Value();
     }
   }
-  
+
   for ( int i = 0; i < what.length(); i++ ) {
     SALOMEDS::SObject_var sobj = what[i];
     if ( CORBA::is_nil( sobj ) ) continue; // skip bad object
@@ -2926,155 +2929,12 @@ void GEOM_Gen_i::Move( const GEOM::object_list& what,
   }
 }
 
-//=================================================================================
-// function : importData
-// purpose  : imports geometrical data file into the GEOM internal data structure
-//=================================================================================
-Engines::ListOfIdentifiers* GEOM_Gen_i::importData(
-  CORBA::Long studyId, Engines::DataContainer_ptr data, const Engines::ListOfOptions& options)
-{
-  CORBA::Object_var aSMObject = name_service->Resolve( "/myStudyManager" );
-  SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow( aSMObject );
-  SALOMEDS::Study_var aStudy = aStudyManager->GetStudyByID( studyId );
-
-  Engines::ListOfIdentifiers_var aResult = new Engines::ListOfIdentifiers;
-  GEOM::GEOM_IInsertOperations_var aInsOp = GetIInsertOperations(aStudy->StudyId());
-  if (aInsOp->_is_nil()) {
-    MESSAGE("No insert operations!");
-    return aResult._retn();
-  }
-
-  // Get a temporary directory to store a file
-  std::string aTmpDir = SALOMEDS_Tool::GetTmpDir();
-  std::string aFileName("file");
-  if (aFileName.rfind("/") != std::string::npos) { // remove folders from the name
-    aFileName = aFileName.substr(aFileName.rfind("/") + 1);
-  }
-
-  std::string anExtension(data->extension());
-  aFileName += "." + anExtension;
-  // convert extension to upper case
-  std::transform(anExtension.begin(), anExtension.end(), anExtension.begin(), ::toupper);
-  std::string aFullPath = aTmpDir + aFileName;
-
-  Engines::TMPFile* aFileStream = data->get();
-  const char *aBuffer = (const char*)aFileStream->NP_data();
-#ifdef WIN32
-  std::ofstream aFile(aFullPath.c_str(), std::ios::binary);
-#else
-  std::ofstream aFile(aFullPath.c_str());
-#endif
-  aFile.write(aBuffer, aFileStream->length());
-  aFile.close();
-
-  GEOM::ListOfGBO_var aObjects = aInsOp->ImportFile(aFullPath.c_str(), "XAO");
-
-  if ( aObjects->length() > 0 && aInsOp->IsDone() ) {
-    aResult->length(aObjects->length());
-    // publish main object (first in the list of returned geom objects)
-    CORBA::String_var aName = aObjects[0]->GetName();
-    SALOMEDS::SObject_var aSO = PublishInStudy(aStudy.in(), SALOMEDS::SObject::_nil(), aObjects[0].in(), aName.in());
-    aResult[0] = aSO->GetID();
-    // publish groups && fields
-    for (int i = 1; i < aObjects->length(); i++ ) {
-      aName = aObjects[i]->GetName();
-      aSO = AddInStudy(aStudy.in(), aObjects[0].in(), aName.in(), aObjects[0].in());
-      aResult[i] = aSO->GetID();
-    }
-  }
-  else {
-    if (aObjects->length() == 0)
-      MESSAGE("ImportXAO operation is failed for file "<<aFullPath.c_str());
-    if (!aInsOp->IsDone())
-      MESSAGE("Import operation is not done for file "<<aFullPath.c_str());
-    return aResult._retn();
-  }
-
-  // remove temporary file and directory
-  SALOMEDS::ListOfFileNames aTmpFiles;
-  aTmpFiles.length(1);
-  aTmpFiles[0] = aFileName.c_str();
-  SALOMEDS_Tool::RemoveTemporaryFiles(aTmpDir, aTmpFiles, true);
-
-  _impl->DocumentModified(studyId, false);
-  return aResult._retn();
-}
-
-//=================================================================================
-// function : getModifiedData
-// purpose  : exports all geometry of this GEOM module into one BRep file
-//=================================================================================
-Engines::ListOfData* GEOM_Gen_i::getModifiedData(CORBA::Long studyId)
-{
-  Engines::ListOfData_var aResult = new Engines::ListOfData;
-
-  if (!_impl->DocumentModified(studyId)) {
-    MESSAGE("Document is not modified")
-    return aResult._retn();
-  }
-
-  CORBA::Object_var aSMObject = name_service->Resolve("/myStudyManager");
-  SALOMEDS::StudyManager_var aStudyManager = SALOMEDS::StudyManager::_narrow( aSMObject );
-  if (CORBA::is_nil(aStudyManager))
-    return aResult._retn();
-  SALOMEDS::Study_var aStudy = aStudyManager->GetStudyByID( studyId );
-  if (CORBA::is_nil(aStudy))
-    return aResult._retn();
-  SALOMEDS::SComponent_var aComponent = aStudy->FindComponent("GEOM");
-  if (CORBA::is_nil(aComponent))
-    return aResult._retn();
-  SALOMEDS::ChildIterator_var anIter = aStudy->NewChildIterator(aComponent); // check only published shapes
-
-  GEOM::GEOM_IInsertOperations_var aInsOp    = GetIInsertOperations(aStudy->StudyId());
-  if (aInsOp->_is_nil()) {
-    MESSAGE("No insert operations!");
-    return aResult._retn();
-  }
-
-  GEOM::GEOM_Object_var shapeObj;
-  
-  for(; anIter->More(); anIter->Next()) {
-    SALOMEDS::SObject_var aSO = anIter->Value();
-    SALOMEDS::SObject_var aRefSO;
-    // export only not referenced objects, or referenced outside of GEOM
-    if (!aSO->ReferencedObject(aRefSO) || aRefSO->GetFatherComponent()->GetID() != aComponent->GetID()) {
-      CORBA::Object_var anObj = aSO->GetObject();
-      if (!CORBA::is_nil(anObj)) {
-        GEOM::GEOM_Object_var aCORBAMainShape = GEOM::GEOM_Object::_narrow(anObj);
-        if(!aCORBAMainShape->_is_nil()) {
-          CORBA::String_var entry = aCORBAMainShape->GetEntry();
-          Handle(GEOM_Object) aMainShape = Handle(GEOM_Object)::DownCast(_impl->GetObject(studyId, entry));
-
-          GEOM::shape_type aCORBAShapeType = aCORBAMainShape->GetShapeType();
-          if (!aMainShape.IsNull() && !(aCORBAShapeType == GEOM::VERTEX) && !(aCORBAShapeType == GEOM::EDGE)) {
-            shapeObj = aCORBAMainShape;
-            break;
-          }
-        }
-      }
-    }
-  }
-
-  if (!CORBA::is_nil(shapeObj)) { // Shape is correct, write it to the temporary file
-    std::string aPath = Kernel_Utils::GetTmpFileName() + ".xao";
-    aInsOp->Export(shapeObj.in(), aPath.c_str(), "XAO");
-    aResult->length(1);
-    Engines::DataContainer_var aData = (new Engines_DataContainer_i(
-                    aPath.c_str(), "", "", true))->_this();
-    aResult[0] = aData;
-  } else {
-    MESSAGE("No shapes to export");
-  }
-
-  return aResult._retn();
-}
-                                                               
 //=======================================================================
 // function : GetDependencyTree
 // purpose  : Collects dependencies of the given objects from other ones
 //=======================================================================
 SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( SALOMEDS::Study_ptr theStudy,
-                                                 const GEOM::string_array& theObjectEntries ) {
+                                                  const GEOM::string_array& theObjectEntries ) {
   // fill in the tree structure
   GEOMUtils::TreeModel tree;
 
@@ -3098,7 +2958,7 @@ SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( SALOMEDS::Study_ptr theStudy,
   // translation the tree into string
   std::string treeStr;
   GEOMUtils::ConvertTreeToString( tree, treeStr );
-  
+
   // put string into stream
   char* aBuffer = (char*)CORBA::string_dup(treeStr.c_str());
   int aBufferSize = strlen((char*)aBuffer);
@@ -3114,10 +2974,10 @@ SALOMEDS::TMPFile* GEOM_Gen_i::GetDependencyTree( SALOMEDS::Study_ptr theStudy,
 // function : getUpwardDependency
 // purpose  : Collects the entries of objects on that the given one depends
 //=======================================================================
-void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo, 
-                                     GEOMUtils::LevelsList &upLevelList, 
-                                     std::map< std::string, std::set<std::string> > &passedEntries,
-                                     int level ) {
+void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+                                      GEOMUtils::LevelsList &upLevelList,
+                                      std::map< std::string, std::set<std::string> > &passedEntries,
+                                      int level ) {
   std::string aGboEntry = gbo->GetEntry();
   GEOMUtils::NodeLinks anEntries;
   GEOMUtils::LevelInfo aLevelMap;
@@ -3129,7 +2989,7 @@ void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
       // get the existent map
       aLevelMap = upLevelList.at(level-1);
       if ( aLevelMap.count( aGboEntry ) > 0 ) {
-       anEntries = aLevelMap[ aGboEntry ];
+        anEntries = aLevelMap[ aGboEntry ];
       }
     }
   }
@@ -3140,7 +3000,7 @@ void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
     if ( depList[j]->_is_nil() )
       continue;
     aDepEntry = depList[j]->GetEntry();
-    if ( passedEntries.count( aGboEntry ) > 0 && 
+    if ( passedEntries.count( aGboEntry ) > 0 &&
          passedEntries[aGboEntry].count( aDepEntry ) > 0 ) {
       //avoid checking the passed objects
       continue;
@@ -3162,10 +3022,10 @@ void GEOM_Gen_i::getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
 // function : getDownwardDependency
 // purpose  : Collects the entries of objects that depends on the given one
 //=======================================================================
-void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo, 
-                                       GEOMUtils::LevelsList &downLevelList, 
-                                       std::map< std::string, std::set<std::string> > &passedEntries,
-                                       int level ) {
+void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+                                        GEOMUtils::LevelsList &downLevelList,
+                                        std::map< std::string, std::set<std::string> > &passedEntries,
+                                        int level ) {
   std::string aGboEntry = gbo->GetEntry();
   Handle(TDocStd_Document) aDoc = GEOM_Engine::GetEngine()->GetDocument(gbo->GetStudyID());
   Handle(TDataStd_TreeNode) aNode, aRoot;
@@ -3197,7 +3057,7 @@ void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
           continue;
         if ( depList[i]->_is_equivalent( gbo ) ) {
           // yes, the current object depends on the given object
-          if ( passedEntries.count( aGoEntry ) > 0 && 
+          if ( passedEntries.count( aGoEntry ) > 0 &&
                passedEntries[aGoEntry].count( aGboEntry ) > 0 ) {
             //avoid checking the passed objects
             continue;
@@ -3230,10 +3090,10 @@ void GEOM_Gen_i::getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
 // purpose  : Fills 3 lists that is used to clean study of redundant objects
 //==============================================================================
 void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
-                                       GEOM::string_array& theSelectedEntries,
-                                       GEOM::string_array& theParentEntries,
-                                       GEOM::string_array& theSubEntries,
-                                       GEOM::string_array& theOtherEntries)
+                                        GEOM::string_array& theSelectedEntries,
+                                        GEOM::string_array& theParentEntries,
+                                        GEOM::string_array& theSubEntries,
+                                        GEOM::string_array& theOtherEntries)
 {
   std::set<std::string> aSelected, aParents, aChildren, anOthers;
   for ( int i = 0; i < theSelectedEntries.length(); i++ ) {
@@ -3267,7 +3127,7 @@ void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
       if ( aSelected.count( anEntry ) > 0 &&
            aParents.count( anEntry ) == 0 ) {
         includeParentDependencies( geomObj, aSelected, aParents, aChildren, anOthers );
-      } else if ( aParents.count( anEntry ) == 0 && 
+      } else if ( aParents.count( anEntry ) == 0 &&
                   aChildren.count( anEntry ) == 0 ) {
         anOthers.insert( geomObj->GetEntry() );
       }
@@ -3284,7 +3144,7 @@ void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
     }
 
     // if some selected object is not a main shape,
-    // we move it's main shapes into 'selected' list, 
+    // we move it's main shapes into 'selected' list,
     // because they could not be modified anyhow.
     std::set<std::string> aToBeInSelected;
     for ( it = aSelected.begin(); it != aSelected.end(); ++it ) {
@@ -3337,13 +3197,13 @@ void GEOM_Gen_i::GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
 
 //==============================================================================
 // function : includeParentDependencies
-// purpose  : 
+// purpose  :
 //==============================================================================
 void GEOM_Gen_i::includeParentDependencies(GEOM::GEOM_BaseObject_ptr geomObj,
-                                          std::set<std::string>& aSelected,
-                                          std::set<std::string>& aParents,
-                                          std::set<std::string>& aChildren,
-                                          std::set<std::string>& anOthers)
+                                           std::set<std::string>& aSelected,
+                                           std::set<std::string>& aParents,
+                                           std::set<std::string>& aChildren,
+                                           std::set<std::string>& anOthers)
 {
   std::string anEntry = geomObj->GetEntry();
   if ( aSelected.count( anEntry ) == 0 ) {
@@ -3365,10 +3225,10 @@ void GEOM_Gen_i::includeParentDependencies(GEOM::GEOM_BaseObject_ptr geomObj,
   for( int i = 0; i < depList->length(); i++ ) {
     aDepEntry = depList[i]->GetEntry();
     if ( depList[i]->_is_nil() ||
-        aDepEntry == anEntry ||             // skip self-depending
-        aSelected.count( aDepEntry ) > 0 || // skip selected objects
-        aParents.count( aDepEntry ) > 0     // skip already processed objects
-        )
+         aDepEntry == anEntry ||             // skip self-depending
+         aSelected.count( aDepEntry ) > 0 || // skip selected objects
+         aParents.count( aDepEntry ) > 0     // skip already processed objects
+         )
       continue;
     includeParentDependencies( depList[i], aSelected, aParents, aChildren, anOthers );
   }
@@ -3376,14 +3236,14 @@ void GEOM_Gen_i::includeParentDependencies(GEOM::GEOM_BaseObject_ptr geomObj,
 
 //==============================================================================
 // function : includeSubObjects
-// purpose  : 
+// purpose  :
 //==============================================================================
 void GEOM_Gen_i::includeSubObjects(SALOMEDS::Study_ptr theStudy,
-                                  const std::string& aSelectedEntry,
-                                  std::set<std::string>& aSelected,
-                                  std::set<std::string>& aParents,
-                                  std::set<std::string>& aChildren,
-                                  std::set<std::string>& anOthers)
+                                   const std::string& aSelectedEntry,
+                                   std::set<std::string>& aSelected,
+                                   std::set<std::string>& aParents,
+                                   std::set<std::string>& aChildren,
+                                   std::set<std::string>& anOthers)
 {
   std::set<std::string>::iterator foundIt;
   Handle(GEOM_BaseObject) handle_object = _impl->GetObject( theStudy->StudyId(), aSelectedEntry.c_str(), false);
@@ -3408,10 +3268,10 @@ void GEOM_Gen_i::includeSubObjects(SALOMEDS::Study_ptr theStudy,
     if ( foundIt == aParents.end() ) { // add to sub-objects if it is not in parents list
       foundIt = aSelected.find( aSubEntryStr );
       if ( foundIt == aSelected.end() ) { // add to sub-objects if it is not in selected list
-           aChildren.insert( aSubEntryStr );
-           foundIt = anOthers.find( aSubEntryStr );
-           if ( foundIt != anOthers.end() )
-             anOthers.erase( foundIt );
+            aChildren.insert( aSubEntryStr );
+            foundIt = anOthers.find( aSubEntryStr );
+            if ( foundIt != anOthers.end() )
+              anOthers.erase( foundIt );
       }
     }
     includeSubObjects( theStudy, aSubEntryStr, aSelected, aParents, aChildren, anOthers );
index 5af30555178ee201fedc9816ade20dc8260cfee5..25963bffdb06659f1bd2a55d217467587edf96cc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -201,7 +201,7 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
 
   //Collects dependencies of the given objects from other ones
   SALOMEDS::TMPFile* GetDependencyTree(SALOMEDS::Study_ptr theStudy,
-                                      const GEOM::string_array& theObjectEntries);
+                                       const GEOM::string_array& theObjectEntries);
 
   //-----------------------------------------------------------------------//
   // Transaction methods                                                   //
@@ -301,37 +301,30 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
   virtual char* getVersion();
 
   // Create a new folder object
-  SALOMEDS::SObject_ptr CreateFolder(const char* theName, 
-                                    SALOMEDS::SObject_ptr theFather);
+  SALOMEDS::SObject_ptr CreateFolder(const char* theName,
+                                     SALOMEDS::SObject_ptr theFather);
 
   // Move GEOM object to the specified folder
-  void MoveToFolder(GEOM::GEOM_Object_ptr theObject, 
-                   SALOMEDS::SObject_ptr theFolder);
+  void MoveToFolder(GEOM::GEOM_Object_ptr theObject,
+                    SALOMEDS::SObject_ptr theFolder);
 
   // Move list of GEOM objects to the specified folder
-  void MoveListToFolder (const GEOM::ListOfGO& theListOfGO, 
-                        SALOMEDS::SObject_ptr theFolder);
+  void MoveListToFolder (const GEOM::ListOfGO& theListOfGO,
+                         SALOMEDS::SObject_ptr theFolder);
 
   // Move objects to the specified position
   void Move( const GEOM::object_list& what,
-            SALOMEDS::SObject_ptr where,
-            CORBA::Long row );
-
-  // SIMAN-related functions (check out/check in) : import data to study
-  virtual Engines::ListOfIdentifiers* importData(CORBA::Long studyId,
-                                                Engines::DataContainer_ptr data,
-                                                const Engines::ListOfOptions& options);
-  // SIMAN-related functions (check out/check in) : get modified data
-  virtual Engines::ListOfData* getModifiedData(CORBA::Long studyId);
+             SALOMEDS::SObject_ptr where,
+             CORBA::Long row );
 
   /*! \brief Fills 3 lists that is used to clean study of redundant objects.
    *         To be used from GUI.
    */
   void GetEntriesToReduceStudy(SALOMEDS::Study_ptr theStudy,
-                              GEOM::string_array& theSelectedEntries,
-                              GEOM::string_array& theParentEntries,
-                              GEOM::string_array& theSubEntries,
-                              GEOM::string_array& theOtherEntries);
+                               GEOM::string_array& theSelectedEntries,
+                               GEOM::string_array& theParentEntries,
+                               GEOM::string_array& theSubEntries,
+                               GEOM::string_array& theOtherEntries);
 
   //-----------------------------------------------------------------------//
   // Internal methods                                                      //
@@ -381,28 +374,28 @@ class GEOM_I_EXPORT GEOM_Gen_i: virtual public POA_GEOM::GEOM_Gen, virtual publi
                              const Standard_CString& GrName,
                              GEOM::ListOfGO_var aResList);
 
-  void getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo, 
-                            GEOMUtils::LevelsList &upLevelList,  
-                           std::map< std::string, std::set<std::string> > &passedEntries,
+  void getUpwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+                            GEOMUtils::LevelsList &upLevelList,
+                            std::map< std::string, std::set<std::string> > &passedEntries,
                             int level = 0 );
 
-  void getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo, 
-                              GEOMUtils::LevelsList &downLevelList, 
-                             std::map< std::string, std::set<std::string> > &passedEntries,
+  void getDownwardDependency( GEOM::GEOM_BaseObject_ptr gbo,
+                              GEOMUtils::LevelsList &downLevelList,
+                              std::map< std::string, std::set<std::string> > &passedEntries,
                               int level = 0 );
 
   void includeParentDependencies(GEOM::GEOM_BaseObject_ptr gbo,
-                                std::set<std::string>& aSelected,
-                                std::set<std::string>& aParents, 
-                                std::set<std::string>& aChildren, 
-                                std::set<std::string>& anOthers);
+                                 std::set<std::string>& aSelected,
+                                 std::set<std::string>& aParents,
+                                 std::set<std::string>& aChildren,
+                                 std::set<std::string>& anOthers);
 
   void includeSubObjects(SALOMEDS::Study_ptr theStudy,
-                        const std::string& aSelectedEntry,
-                        std::set<std::string>& aSelected,
-                        std::set<std::string>& aParents, 
-                        std::set<std::string>& aChildren, 
-                        std::set<std::string>& anOthers);
+                         const std::string& aSelectedEntry,
+                         std::set<std::string>& aSelected,
+                         std::set<std::string>& aParents,
+                         std::set<std::string>& aChildren,
+                         std::set<std::string>& anOthers);
 
   void LoadPlugin(const std::string& theLibName);
 
index ef874e8244c2efd72b8a6dfd793553a0d062db87..41b415ded85820cca037777466bb8d5a5fcc77ad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -766,7 +766,8 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDraftPrism
                       (GEOM::GEOM_Object_ptr theInitShape, GEOM::GEOM_Object_ptr theBase, 
                        CORBA::Double  theHeight,
                        CORBA::Double  theAngle,
-                       CORBA::Boolean theFuse)
+                       CORBA::Boolean theFuse,
+                       CORBA::Boolean theInvert)
 {
   GEOM::GEOM_Object_var aGEOMObject;
   
@@ -780,7 +781,7 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDraftPrism
   if (aBase.IsNull() || aInit.IsNull()) return aGEOMObject._retn();
 
   //Create the Prism
-  Handle(GEOM_Object) anObject = GetOperations()->MakeDraftPrism(aInit, aBase, theHeight, theAngle, theFuse);
+  Handle(GEOM_Object) anObject = GetOperations()->MakeDraftPrism(aInit, aBase, theHeight, theAngle, theFuse, theInvert);
  
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
@@ -793,10 +794,12 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeDraftPrism
  *  MakePipe
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipe
-                 (GEOM::GEOM_Object_ptr theBase, GEOM::GEOM_Object_ptr thePath)
+GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipe
+                           (GEOM::GEOM_Object_ptr theBase,
+                            GEOM::GEOM_Object_ptr thePath,
+                            CORBA::Boolean        IsGenerateGroups)
 {
-  GEOM::GEOM_Object_var aGEOMObject;
+  GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
@@ -805,15 +808,20 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipe
   Handle(GEOM_Object) aBase = GetObjectImpl(theBase);
   Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
 
-  if (aBase.IsNull() || aPath.IsNull()) return aGEOMObject._retn();
+  if (aBase.IsNull() || aPath.IsNull()) return aSeq._retn();
 
   //Create the Pipe
-  Handle(GEOM_Object) anObject =
-    GetOperations()->MakePipe(aBase, aPath);
-  if (!GetOperations()->IsDone() || anObject.IsNull())
-    return aGEOMObject._retn();
+  Handle(TColStd_HSequenceOfTransient) aHSeq =
+    GetOperations()->MakePipe(aBase, aPath, IsGenerateGroups);
+  if (!GetOperations()->IsDone() || aHSeq.IsNull())
+    return aSeq._retn();
 
-  return GetObject(anObject);
+  Standard_Integer aLength = aHSeq->Length();
+  aSeq->length(aLength);
+  for (Standard_Integer i = 1; i <= aLength; i++)
+    aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+  return aSeq._retn();
 }
 
 //=============================================================================
@@ -880,14 +888,14 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeRevolutionAxisAngle2Ways
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr
-GEOM_I3DPrimOperations_i::MakeFilling(GEOM::GEOM_Object_ptr theShape,
-                                      CORBA::Long theMinDeg,
-                                      CORBA::Long theMaxDeg,
-                                      CORBA::Double theTol2D,
-                                      CORBA::Double theTol3D,
-                                      CORBA::Long theNbIter,
+GEOM_I3DPrimOperations_i::MakeFilling(const GEOM::ListOfGO&     theContours,
+                                      CORBA::Long               theMinDeg,
+                                      CORBA::Long               theMaxDeg,
+                                      CORBA::Double             theTol2D,
+                                      CORBA::Double             theTol3D,
+                                      CORBA::Long               theNbIter,
                                       GEOM::filling_oper_method theMethod,
-                                      CORBA::Boolean theApprox)
+                                      CORBA::Boolean            theApprox)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -895,9 +903,9 @@ GEOM_I3DPrimOperations_i::MakeFilling(GEOM::GEOM_Object_ptr theShape,
   GetOperations()->SetNotDone();
 
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
-
-  if (aShape.IsNull()) return aGEOMObject._retn();
+  std::list< Handle(GEOM_Object) > aShapes;
+  if (! GetListOfObjectsImpl( theContours, aShapes ))
+    return aGEOMObject._retn();
 
   int aMethod = 0;
   switch (theMethod) {
@@ -925,8 +933,7 @@ GEOM_I3DPrimOperations_i::MakeFilling(GEOM::GEOM_Object_ptr theShape,
 
   //Create the Solid
   Handle(GEOM_Object) anObject = GetOperations()->MakeFilling
-    (aShape, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter,
-     aMethod, theApprox);
+    (aShapes, theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter, aMethod, theApprox);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
@@ -974,14 +981,16 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThruSections(const GEOM::Lis
  *  MakePipeWithDifferentSections
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
-                      (const GEOM::ListOfGO& theBases,
-                       const GEOM::ListOfGO& theLocations,
-                       GEOM::GEOM_Object_ptr thePath,
-                       CORBA::Boolean theWithContact,
-                       CORBA::Boolean theWithCorrections)
+GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
+                           (const GEOM::ListOfGO        &theBases,
+                            const GEOM::ListOfGO        &theLocations,
+                                  GEOM::GEOM_Object_ptr  thePath,
+                                  CORBA::Boolean         theWithContact,
+                                  CORBA::Boolean         theWithCorrections,
+                                  CORBA::Boolean         IsBySteps,
+                                  CORBA::Boolean         IsGenerateGroups)
 {
-  GEOM::GEOM_Object_var aGEOMObject;
+  GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
@@ -994,11 +1003,11 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
   aNbLocs = theLocations.length();
 
   if (aNbLocs && aNbBases != aNbLocs)
-    return aGEOMObject._retn();
+    return aSeq._retn();
 
   Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
   if (aPath.IsNull())
-    return aGEOMObject._retn();
+    return aSeq._retn();
 
   for (ind = 0; ind < aNbBases; ind++) {
     Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
@@ -1014,16 +1023,23 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
     aSeqBases->Append(aBase);
   }
   if (!aSeqBases->Length())
-    return aGEOMObject._retn();
+    return aSeq._retn();
 
   // Make pipe
-  Handle(GEOM_Object) anObject =
-    GetOperations()->MakePipeWithDifferentSections(aSeqBases,aSeqLocations ,aPath,
-                                                   theWithContact,theWithCorrections);
-  if (!GetOperations()->IsDone() || anObject.IsNull())
-    return aGEOMObject._retn();
-
-  return GetObject(anObject);
+  Handle(TColStd_HSequenceOfTransient) aHSeq =
+    GetOperations()->MakePipeWithDifferentSections
+              (aSeqBases, aSeqLocations,
+               aPath, theWithContact,
+               theWithCorrections, IsBySteps, IsGenerateGroups);
+  if (!GetOperations()->IsDone() || aHSeq.IsNull())
+    return aSeq._retn();
+
+  Standard_Integer aLength = aHSeq->Length();
+  aSeq->length(aLength);
+  for (Standard_Integer i = 1; i <= aLength; i++)
+    aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+  return aSeq._retn();
 }
 
 
@@ -1032,15 +1048,16 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithDifferentSections
  *  MakePipeWithShellSections
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
-                 (const GEOM::ListOfGO& theBases,
-                  const GEOM::ListOfGO& theSubBases,
-                  const GEOM::ListOfGO& theLocations,
-                  GEOM::GEOM_Object_ptr thePath,
-                  CORBA::Boolean theWithContact,
-                  CORBA::Boolean theWithCorrections)
+GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeWithShellSections
+                           (const GEOM::ListOfGO        &theBases,
+                            const GEOM::ListOfGO        &theSubBases,
+                            const GEOM::ListOfGO        &theLocations,
+                                  GEOM::GEOM_Object_ptr  thePath,
+                                  CORBA::Boolean         theWithContact,
+                                  CORBA::Boolean         theWithCorrections,
+                                  CORBA::Boolean         IsGenerateGroups)
 {
-  GEOM::GEOM_Object_var aGEOMObject;
+  GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
@@ -1055,11 +1072,11 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
   aNbLocs = theLocations.length();
 
   if (aNbLocs && aNbBases != aNbLocs)
-    return aGEOMObject._retn();
+    return aSeq._retn();
 
   Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
   if (aPath.IsNull())
-    return aGEOMObject._retn();
+    return aSeq._retn();
 
   for (ind = 0; ind < aNbBases; ind++) {
     Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
@@ -1084,17 +1101,23 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
     }
   }
   if (!aSeqBases->Length())
-    return aGEOMObject._retn();
+    return aSeq._retn();
 
   // Make pipe
-  Handle(GEOM_Object) anObject =
-    GetOperations()->MakePipeWithShellSections(aSeqBases, aSeqSubBases,
-                                               aSeqLocations, aPath,
-                                               theWithContact, theWithCorrections);
-  if (!GetOperations()->IsDone() || anObject.IsNull())
-    return aGEOMObject._retn();
-
-  return GetObject(anObject);
+  Handle(TColStd_HSequenceOfTransient) aHSeq =
+    GetOperations()->MakePipeWithShellSections
+                  (aSeqBases, aSeqSubBases,
+                   aSeqLocations, aPath,
+                   theWithContact, theWithCorrections, IsGenerateGroups);
+  if (!GetOperations()->IsDone() || aHSeq.IsNull())
+    return aSeq._retn();
+
+  Standard_Integer aLength = aHSeq->Length();
+  aSeq->length(aLength);
+  for (Standard_Integer i = 1; i <= aLength; i++)
+    aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+  return aSeq._retn();
 }
 
 
@@ -1103,11 +1126,12 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeWithShellSections
  *  MakePipeShellsWithoutPath
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
-                 (const GEOM::ListOfGO& theBases,
-                  const GEOM::ListOfGO& theLocations)
+GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
+                           (const GEOM::ListOfGO &theBases,
+                            const GEOM::ListOfGO &theLocations,
+                                  CORBA::Boolean  IsGenerateGroups)
 {
-  GEOM::GEOM_Object_var aGEOMObject;
+  GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
@@ -1120,7 +1144,7 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
   aNbLocs = theLocations.length();
 
   if (aNbLocs && aNbBases != aNbLocs)
-    return aGEOMObject._retn();
+    return aSeq._retn();
 
   for (ind = 0; ind < aNbBases; ind++) {
     Handle(GEOM_Object) aBase = GetObjectImpl(theBases[ind]);
@@ -1136,16 +1160,22 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
   }
 
   if (!aSeqBases->Length())
-    return aGEOMObject._retn();
+    return aSeq._retn();
 
   // Make pipe
-  Handle(GEOM_Object) anObject =
-    GetOperations()->MakePipeShellsWithoutPath(aSeqBases,aSeqLocations);
+  Handle(TColStd_HSequenceOfTransient) aHSeq =
+    GetOperations()->MakePipeShellsWithoutPath
+          (aSeqBases, aSeqLocations, IsGenerateGroups);
 
-  if (!GetOperations()->IsDone() || anObject.IsNull())
-    return aGEOMObject._retn();
+  if (!GetOperations()->IsDone() || aHSeq.IsNull())
+    return aSeq._retn();
 
-  return GetObject(anObject);
+  Standard_Integer aLength = aHSeq->Length();
+  aSeq->length(aLength);
+  for (Standard_Integer i = 1; i <= aLength; i++)
+    aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+  return aSeq._retn();
 }
 
 //=============================================================================
@@ -1153,12 +1183,13 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeShellsWithoutPath
  *  MakePipeBiNormalAlongVector
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
-                 (GEOM::GEOM_Object_ptr theBase,
-                  GEOM::GEOM_Object_ptr thePath,
-                  GEOM::GEOM_Object_ptr theVec)
+GEOM::ListOfGO *GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
+                           (GEOM::GEOM_Object_ptr theBase,
+                            GEOM::GEOM_Object_ptr thePath,
+                            GEOM::GEOM_Object_ptr theVec,
+                            CORBA::Boolean        IsGenerateGroups)
 {
-  GEOM::GEOM_Object_var aGEOMObject;
+  GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
   //Set a not done flag
   GetOperations()->SetNotDone();
@@ -1168,15 +1199,21 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
   Handle(GEOM_Object) aPath = GetObjectImpl(thePath);
   Handle(GEOM_Object) aVec = GetObjectImpl(theVec);
 
-  if (aBase.IsNull() || aPath.IsNull() || aVec.IsNull()) return aGEOMObject._retn();
+  if (aBase.IsNull() || aPath.IsNull() || aVec.IsNull()) return aSeq._retn();
 
   //Create the Pipe
-  Handle(GEOM_Object) anObject =
-    GetOperations()->MakePipeBiNormalAlongVector(aBase, aPath, aVec);
-  if (!GetOperations()->IsDone() || anObject.IsNull())
-    return aGEOMObject._retn();
-
-  return GetObject(anObject);
+  Handle(TColStd_HSequenceOfTransient) aHSeq =
+    GetOperations()->MakePipeBiNormalAlongVector
+          (aBase, aPath, aVec, IsGenerateGroups);
+  if (!GetOperations()->IsDone() || aHSeq.IsNull())
+    return aSeq._retn();
+
+  Standard_Integer aLength = aHSeq->Length();
+  aSeq->length(aLength);
+  for (Standard_Integer i = 1; i <= aLength; i++)
+    aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+
+  return aSeq._retn();
 }
 
 //=============================================================================
@@ -1185,9 +1222,11 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakePipeBiNormalAlongVector
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThickening
-                 (GEOM::GEOM_Object_ptr theObject,
-                  CORBA::Double theOffset,
-                  CORBA::Boolean doCopy)
+                 (GEOM::GEOM_Object_ptr   theObject,
+                  const GEOM::ListOfLong &theFacesIDs,
+                  CORBA::Double           theOffset,
+                  CORBA::Boolean          doCopy,
+                  CORBA::Boolean          theInside)
 {
   GEOM::GEOM_Object_var aGEOMObject;
   //Set a not done flag
@@ -1207,12 +1246,25 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThickening
   //Get the basic object
   Handle(GEOM_Object) aBasicObject = GetObjectImpl(theObject);
   if (aBasicObject.IsNull()) return aGEOMObject._retn();
-  
+
+  // Get faces IDs.
+  Handle(TColStd_HArray1OfInteger) aFaceIDs;
+  Standard_Integer                 aNbIDs = theFacesIDs.length();
+  Standard_Integer                 i;
+
+  if (aNbIDs > 0) {
+    aFaceIDs = new TColStd_HArray1OfInteger (1, aNbIDs);
+
+    for (i = 0; i < aNbIDs; i++) {
+      aFaceIDs->SetValue(i + 1, theFacesIDs[i]);
+    }
+  }
+
   //Create the thickened shape
   if (doCopy)
   {
     Handle(GEOM_Object) anObject = GetOperations()->MakeThickening(
-      aBasicObject, theOffset, doCopy);
+      aBasicObject, aFaceIDs, theOffset, doCopy, theInside);
     if (!GetOperations()->IsDone() || anObject.IsNull())
       return aGEOMObject._retn();
     
@@ -1220,7 +1272,7 @@ GEOM::GEOM_Object_ptr GEOM_I3DPrimOperations_i::MakeThickening
   }
   else
   {
-    GetOperations()->MakeThickening(aBasicObject, theOffset, doCopy);
+    GetOperations()->MakeThickening(aBasicObject, aFaceIDs, theOffset, doCopy, theInside);
     
     // Update GUI.
     UpdateGUIForObject(theObject);
index 56c1cbc7b9cc69c4d1af92195e0bfb6b117befcb..3fe2951eb52c1a35e48cfbacef6d90024a150e5d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -153,10 +153,12 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
                                         GEOM::GEOM_Object_ptr theBase,
                                         CORBA::Double         theHeight,
                                         CORBA::Double         theAngle,
-                                        CORBA::Boolean        theFuse);
-                            
-  GEOM::GEOM_Object_ptr MakePipe (GEOM::GEOM_Object_ptr theBase,
-                                 GEOM::GEOM_Object_ptr thePath);
+                                        CORBA::Boolean        theFuse,
+                                        CORBA::Boolean        theInvert);
+
+  GEOM::ListOfGO* MakePipe (GEOM::GEOM_Object_ptr theBase,
+                            GEOM::GEOM_Object_ptr thePath,
+                            CORBA::Boolean        IsGenerateGroups);
 
   GEOM::GEOM_Object_ptr MakeRevolutionAxisAngle (GEOM::GEOM_Object_ptr theBase,
                                                 GEOM::GEOM_Object_ptr theAxis,
@@ -166,7 +168,7 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
                                                      GEOM::GEOM_Object_ptr theAxis,
                                                      CORBA::Double theAngle);
 
-  GEOM::GEOM_Object_ptr MakeFilling(GEOM::GEOM_Object_ptr theShape,
+  GEOM::GEOM_Object_ptr MakeFilling(const GEOM::ListOfGO& theContours,
                                     CORBA::Long theMinDeg, CORBA::Long theMaxDeg,
                                     CORBA::Double theTol2D, CORBA::Double theTol3D,
                                     CORBA::Long theNbIter,
@@ -177,30 +179,41 @@ class GEOM_I_EXPORT GEOM_I3DPrimOperations_i :
                                         CORBA::Boolean theModeSolid,
                                         CORBA::Double thePreci,
                                         CORBA::Boolean theRuled);
-  
-  GEOM::GEOM_Object_ptr MakePipeWithDifferentSections(const GEOM::ListOfGO& theBases,
-                                                     const GEOM::ListOfGO& theLocations,
-                                                     GEOM::GEOM_Object_ptr thePath,
-                                                     CORBA::Boolean theWithContact,
-                                                     CORBA::Boolean theWithCorrections);
-
-  GEOM::GEOM_Object_ptr MakePipeWithShellSections(const GEOM::ListOfGO& theBases,
-                                                 const GEOM::ListOfGO& theSubBases,
-                                                 const GEOM::ListOfGO& theLocations,
-                                                 GEOM::GEOM_Object_ptr thePath,
-                                                 CORBA::Boolean theWithContact,
-                                                 CORBA::Boolean theWithCorrections);
-
-  GEOM::GEOM_Object_ptr MakePipeShellsWithoutPath(const GEOM::ListOfGO& theBases,
-                                                 const GEOM::ListOfGO& theLocations);
-
-  GEOM::GEOM_Object_ptr MakePipeBiNormalAlongVector (GEOM::GEOM_Object_ptr theBase,
-                                                    GEOM::GEOM_Object_ptr thePath,
-                                                    GEOM::GEOM_Object_ptr theVec);
-  
-  GEOM::GEOM_Object_ptr MakeThickening (GEOM::GEOM_Object_ptr theObject,
-                                        CORBA::Double theOffset,
-                                        CORBA::Boolean isCopy);
+
+  GEOM::ListOfGO* MakePipeWithDifferentSections
+                           (const GEOM::ListOfGO        &theBases,
+                            const GEOM::ListOfGO        &theLocations,
+                                  GEOM::GEOM_Object_ptr  thePath,
+                                  CORBA::Boolean         theWithContact,
+                                  CORBA::Boolean         theWithCorrections,
+                                  CORBA::Boolean         IsBySteps,
+                                  CORBA::Boolean         IsGenerateGroups);
+
+  GEOM::ListOfGO* MakePipeWithShellSections
+                           (const GEOM::ListOfGO        &theBases,
+                            const GEOM::ListOfGO        &theSubBases,
+                            const GEOM::ListOfGO        &theLocations,
+                                  GEOM::GEOM_Object_ptr  thePath,
+                                  CORBA::Boolean         theWithContact,
+                                  CORBA::Boolean         theWithCorrections,
+                                  CORBA::Boolean         IsGenerateGroups);
+
+  GEOM::ListOfGO* MakePipeShellsWithoutPath
+                           (const GEOM::ListOfGO &theBases,
+                            const GEOM::ListOfGO &theLocations,
+                                  CORBA::Boolean  IsGenerateGroups);
+
+  GEOM::ListOfGO* MakePipeBiNormalAlongVector
+                           (GEOM::GEOM_Object_ptr theBase,
+                            GEOM::GEOM_Object_ptr thePath,
+                            GEOM::GEOM_Object_ptr theVec,
+                            CORBA::Boolean        IsGenerateGroups);
+
+  GEOM::GEOM_Object_ptr MakeThickening (GEOM::GEOM_Object_ptr   theObject,
+                                        const GEOM::ListOfLong &theFacesIDs,
+                                        CORBA::Double           theOffset,
+                                        CORBA::Boolean          isCopy,
+                                        CORBA::Boolean          theInside);
 
   GEOM::GEOM_Object_ptr RestorePath (GEOM::GEOM_Object_ptr theShape,
                                      GEOM::GEOM_Object_ptr theBase1,
index 634678dca3641796520b205597d52b74f52e2741..b48adfff4de063edbff06bc4f33d51e50d04c988 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -135,7 +135,9 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnLinesIntersection
  */
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve
-                  (GEOM::GEOM_Object_ptr theCurve,  CORBA::Double theParameter)
+                  (GEOM::GEOM_Object_ptr theCurve,
+                   CORBA::Double         theParameter,
+                   CORBA::Boolean        takeOrientationIntoAccount)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -147,8 +149,8 @@ GEOM::GEOM_Object_ptr GEOM_IBasicOperations_i::MakePointOnCurve
   if (aReference.IsNull()) return aGEOMObject._retn();
 
   //Create the point
-  Handle(GEOM_Object) anObject =
-    GetOperations()->MakePointOnCurve(aReference, theParameter);
+  Handle(GEOM_Object) anObject = GetOperations()->MakePointOnCurve
+        (aReference, theParameter, takeOrientationIntoAccount);
   if (!GetOperations()->IsDone() || anObject.IsNull())
     return aGEOMObject._retn();
 
index 1ccace42dc52b84bb6561496fde02bf10ca635e5..c3e1fa3ffda4d67ae4c0bd6114d093b7a1cbc306 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -52,8 +52,10 @@ class GEOM_I_EXPORT GEOM_IBasicOperations_i :
                                                 CORBA::Double theY,
                                                 CORBA::Double theZ);
 
-   GEOM::GEOM_Object_ptr MakePointOnCurve (GEOM::GEOM_Object_ptr theCurve,
-                                          CORBA::Double theParameter);
+   GEOM::GEOM_Object_ptr MakePointOnCurve
+                      (GEOM::GEOM_Object_ptr theCurve,
+                                          CORBA::Double         theParameter,
+                       CORBA::Boolean        takeOrientationIntoAccount);
 
    GEOM::GEOM_Object_ptr MakePointOnCurveByLength (GEOM::GEOM_Object_ptr theCurve,
                                                   CORBA::Double         theLength,
old mode 100755 (executable)
new mode 100644 (file)
index 55a9c3c..d08f7f8
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -614,6 +614,7 @@ CORBA::Boolean GEOM_IBlocksOperations_i::IsCompoundOfBlocks
 //=============================================================================
 CORBA::Boolean GEOM_IBlocksOperations_i::CheckCompoundOfBlocks
                                           (GEOM::GEOM_Object_ptr theCompound,
+                                           const CORBA::Double   theToleranceC1,
                                            GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors)
 {
   CORBA::Boolean isComp = false;
@@ -627,7 +628,8 @@ CORBA::Boolean GEOM_IBlocksOperations_i::CheckCompoundOfBlocks
 
   //Check
   std::list<GEOMImpl_IBlocksOperations::BCError> errList;
-  isComp = GetOperations()->CheckCompoundOfBlocks(aCompound, errList);
+  isComp = GetOperations()->CheckCompoundOfBlocks
+    (aCompound, theToleranceC1, errList);
   if (!GetOperations()->IsDone())
     return isComp;
 
@@ -749,6 +751,7 @@ char* GEOM_IBlocksOperations_i::PrintBCErrors
 //=============================================================================
 GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetNonBlocks
                                       (GEOM::GEOM_Object_ptr theShape,
+                                       const CORBA::Double   theToleranceC1,
                                        GEOM::GEOM_Object_out theNonQuads)
 {
   GEOM::GEOM_Object_var aGEOMObject;
@@ -765,7 +768,8 @@ GEOM::GEOM_Object_ptr GEOM_IBlocksOperations_i::GetNonBlocks
 
   //Get the result
   Handle(GEOM_Object) aFaces;
-  Handle(GEOM_Object) anObject = GetOperations()->GetNonBlocks(aShape, aFaces);
+  Handle(GEOM_Object) anObject =
+    GetOperations()->GetNonBlocks(aShape, theToleranceC1, aFaces);
   if (!GetOperations()->IsDone())
     return aGEOMObject._retn();
 
index fa457b56692605c2ded47949bf4fbd490ce4e453..c2caced61316df98f0ca555f031a4c72399c2fb1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -116,12 +116,14 @@ class GEOM_I_EXPORT GEOM_IBlocksOperations_i :
                                     CORBA::Long&          theNbBlocks);
 
   CORBA::Boolean CheckCompoundOfBlocks (GEOM::GEOM_Object_ptr theCompound,
+                                        const CORBA::Double   theToleranceC1,
                                        GEOM::GEOM_IBlocksOperations::BCErrors_out theErrors);
 
   char* PrintBCErrors (GEOM::GEOM_Object_ptr theCompound,
                       const GEOM::GEOM_IBlocksOperations::BCErrors& theErrors);
 
   GEOM::GEOM_Object_ptr GetNonBlocks (GEOM::GEOM_Object_ptr theShape,
+                                      const CORBA::Double   theToleranceC1,
                                       GEOM::GEOM_Object_out theNonQuads);
 
   GEOM::GEOM_Object_ptr RemoveExtraEdges (GEOM::GEOM_Object_ptr theShape,
index 2df45a9f25c7bb1bff68893a2dc85513e9450df6..f7931d4df289f318fd2e434c4088a87ab0478678 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 943f6cb9b5d41b456d0854710debd3146750edb9..ea4c18f440f64470c9e46d28cbde85d2ea1122d7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 06d9b66d3bd64a1cf4a6e399f2e92e1a7be69b8e..5e03343b9da0f77781bedee832fde4e3f66951fd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 90cbb211497690543ba44c1cd8c47723ac3090a4..52fd9d8fa07d9ed9ef3d2c30fa5fdabafba3fe79 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 53ba0d2e94854109122b968f85d481e56886dac2..00fefe741df37e8043a370850db6b9514a32aec3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index a4757804719bae9c243ee1fee6e7a6647d24396b..f000fa17aa7e2a2ebfa070fe5b5b86183225ae56 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 923c74904e2d040b04b8aa595f167206ba1a4927..154a7510a320ff0d711cb13b050d0e950af0a1ca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 59f61039d8b9a502f875f12946a64a08a057162e..dd59f93be16998ff6510e6d29b81cc0908dbe159 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 51fe6c46e7dc406265bbcbb7d3e5f762b6f12f4e..c87f55e80d7638a7d30eb476420868ebae320427 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include "GEOM_IHealingOperations_i.hh"
 #include "GEOM_Engine.hxx"
 #include "GEOM_Object.hxx"
+#include "ShHealOper_ModifStats.hxx"
 
-#include "utilities.h"
-#include "OpUtil.hxx"
-#include "Utils_ExceptHandlers.hxx"
+#include <utilities.h>
+#include <OpUtil.hxx>
+#include <Utils_ExceptHandlers.hxx>
 #include <Basics_Utils.hxx>
 
 #include <TColStd_HSequenceOfTransient.hxx>
@@ -316,8 +317,8 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::FillHoles (GEOM::GEOM_Object_pt
  *  Sew
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::Sew (GEOM::GEOM_Object_ptr theObject,
-                                                      CORBA::Double theTolerance)
+GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::Sew (const GEOM::ListOfGO& theObjects,
+                                                      CORBA::Double         theTolerance)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -328,14 +329,13 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::Sew (GEOM::GEOM_Object_ptr theO
   if (theTolerance < 0)
     return aGEOMObject._retn();
 
-  // Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
-  if (anObject.IsNull())
+  //Get the shapes
+  std::list< Handle(GEOM_Object) > aShapes;
+  if (! GetListOfObjectsImpl( theObjects, aShapes ))
     return aGEOMObject._retn();
 
   // Perform
-  Handle(GEOM_Object) aNewObject =
-    GetOperations()->Sew( anObject, theTolerance, false );
+  Handle(GEOM_Object) aNewObject = GetOperations()->Sew( aShapes, theTolerance, false );
   if (!GetOperations()->IsDone() || aNewObject.IsNull())
     return aGEOMObject._retn();
 
@@ -347,8 +347,9 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::Sew (GEOM::GEOM_Object_ptr theO
  *  SewAllowNonManifold
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::SewAllowNonManifold (GEOM::GEOM_Object_ptr theObject,
-                                                                      CORBA::Double theTolerance)
+GEOM::GEOM_Object_ptr
+GEOM_IHealingOperations_i::SewAllowNonManifold (const GEOM::ListOfGO& theObjects,
+                                                CORBA::Double         theTolerance)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -359,14 +360,13 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::SewAllowNonManifold (GEOM::GEOM
   if (theTolerance < 0)
     return aGEOMObject._retn();
 
-  // Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
-  if (anObject.IsNull())
+  //Get the shapes
+  std::list< Handle(GEOM_Object) > aShapes;
+  if (! GetListOfObjectsImpl( theObjects, aShapes ))
     return aGEOMObject._retn();
 
   // Perform
-  Handle(GEOM_Object) aNewObject =
-    GetOperations()->Sew( anObject, theTolerance, true );
+  Handle(GEOM_Object) aNewObject = GetOperations()->Sew( aShapes, theTolerance, true );
   if (!GetOperations()->IsDone() || aNewObject.IsNull())
     return aGEOMObject._retn();
 
@@ -378,20 +378,21 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::SewAllowNonManifold (GEOM::GEOM
  *  RemoveInternalFaces
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::RemoveInternalFaces (GEOM::GEOM_Object_ptr theCompound)
+GEOM::GEOM_Object_ptr
+GEOM_IHealingOperations_i::RemoveInternalFaces (const GEOM::ListOfGO& theSolids)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
   // Set a not done flag
   GetOperations()->SetNotDone();
 
-  // Get the object
-  Handle(GEOM_Object) anObject = GetObjectImpl(theCompound);
-  if (anObject.IsNull())
+  // Get the objects
+  std::list< Handle(GEOM_Object) > aShapes;
+  if (! GetListOfObjectsImpl( theSolids, aShapes ))
     return aGEOMObject._retn();
 
   // Perform
-  Handle(GEOM_Object) aNewObject = GetOperations()->RemoveInternalFaces(anObject);
+  Handle(GEOM_Object) aNewObject = GetOperations()->RemoveInternalFaces(aShapes);
   if (!GetOperations()->IsDone() || aNewObject.IsNull())
     return aGEOMObject._retn();
 
@@ -431,6 +432,40 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::DivideEdge (GEOM::GEOM_Object_p
   return GetObject(aNewObject);
 }
 
+//=============================================================================
+/*!
+ *  DivideEdgeByPoint
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr
+GEOM_IHealingOperations_i::DivideEdgeByPoint (GEOM::GEOM_Object_ptr theObject,
+                                              CORBA::Short          theIndex,
+                                              const GEOM::ListOfGO& thePoints)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  // Set a not done flag
+  GetOperations()->SetNotDone();
+
+  // Get the object itself
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+  if (anObject.IsNull())
+    return aGEOMObject._retn();
+
+  // Get the points
+  std::list< Handle(GEOM_Object) > aPoints;
+  if (! GetListOfObjectsImpl( thePoints, aPoints ))
+    return aGEOMObject._retn();
+
+  // Perform
+  Handle(GEOM_Object) aNewObject =
+    GetOperations()->DivideEdgeByPoint( anObject, theIndex, aPoints );
+  if (!GetOperations()->IsDone() || aNewObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(aNewObject);
+}
+
 //=============================================================================
 /*!
  *  FuseCollinearEdgesWithinWire
@@ -473,9 +508,10 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::FuseCollinearEdgesWithinWire
  *  GetFreeBoundary
  */
 //=============================================================================
-CORBA::Boolean GEOM_IHealingOperations_i::GetFreeBoundary ( GEOM::GEOM_Object_ptr theObject,
-                                                            GEOM::ListOfGO_out theClosedWires,
-                                                            GEOM::ListOfGO_out theOpenWires )
+CORBA::Boolean
+GEOM_IHealingOperations_i::GetFreeBoundary ( const GEOM::ListOfGO & theObjects,
+                                             GEOM::ListOfGO_out     theClosedWires,
+                                             GEOM::ListOfGO_out     theOpenWires )
 {
   theClosedWires = new GEOM::ListOfGO;
   theOpenWires = new GEOM::ListOfGO;
@@ -483,14 +519,19 @@ CORBA::Boolean GEOM_IHealingOperations_i::GetFreeBoundary ( GEOM::GEOM_Object_pt
   // Set a not done flag
   GetOperations()->SetNotDone();
 
-  // Get the object itself
-  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
-  if (anObject.IsNull())
-    return false;
+  // Get the objects
+  Handle(TColStd_HSequenceOfTransient) anObjects = new TColStd_HSequenceOfTransient();
+  for ( size_t i = 0; i < theObjects.length(); ++i )
+  {
+    Handle(GEOM_Object) anObject = GetObjectImpl(theObjects[i]);
+    if (anObject.IsNull())
+      return false;
+    anObjects->Append( anObject );
+  }
 
   Handle(TColStd_HSequenceOfTransient) aClosed = new TColStd_HSequenceOfTransient();
   Handle(TColStd_HSequenceOfTransient) anOpen  = new TColStd_HSequenceOfTransient();
-  bool res = GetOperations()->GetFreeBoundary( anObject, aClosed, anOpen );
+  bool res = GetOperations()->GetFreeBoundary( anObjects, aClosed, anOpen );
 
   if ( !GetOperations()->IsDone() || !res )
     return false;
@@ -595,3 +636,33 @@ GEOM::GEOM_Object_ptr GEOM_IHealingOperations_i::LimitTolerance (GEOM::GEOM_Obje
 
   return GetObject(aNewObject);
 }
+
+//================================================================================
+/*!
+ * \brief Return information on what has been done by the last called healing method
+ */
+//================================================================================
+
+GEOM::ModifStatistics* GEOM_IHealingOperations_i::GetStatistics()
+{
+  const ShHealOper_ModifStats& stats = * GetOperations()->GetStatistics();
+  const std::set< ShHealOper_ModifStats::Datum >& modifs = stats.GetData();
+  std::set< ShHealOper_ModifStats::Datum >::const_iterator modif = modifs.begin();
+
+  GEOM::ModifStatistics_var statsVar = new GEOM::ModifStatistics();
+  statsVar->length( modifs.size() );
+  for ( int i = 0; modif != modifs.end(); ++modif, ++i )
+  {
+    statsVar[ i ].name = modif->myModif.c_str();
+    statsVar[ i ].count = modif->myCount;
+
+    // Cut off "Unknown message invoked with the keyword " at the beginning
+    const char* toRm = "Unknown message invoked with the keyword ";
+    const size_t lenToRm = strlen( toRm );
+    if ( modif->myModif.size() > lenToRm &&
+         modif->myModif.compare( 0, lenToRm, toRm ) == 0 )
+      statsVar[ i ].name = modif->myModif.substr( lenToRm ).c_str();
+  }
+
+  return statsVar._retn();
+}
index 091358771536e48cda4c46ae4cf760bc23b99c84..ada0eb4328b5ccffa8c2d32d9580f6f013bf2b85 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -69,25 +69,29 @@ class GEOM_I_EXPORT GEOM_IHealingOperations_i :
    GEOM::GEOM_Object_ptr FillHoles (GEOM::GEOM_Object_ptr theObject,
                                     const GEOM::short_array& theWires);
 
-   GEOM::GEOM_Object_ptr Sew (GEOM::GEOM_Object_ptr theObject,
+   GEOM::GEOM_Object_ptr Sew (const GEOM::ListOfGO & theObject,
                               CORBA::Double theTolerance);
 
-   GEOM::GEOM_Object_ptr SewAllowNonManifold (GEOM::GEOM_Object_ptr theObject,
+   GEOM::GEOM_Object_ptr SewAllowNonManifold (const GEOM::ListOfGO & theObject,
                                               CORBA::Double theTolerance);
 
-   GEOM::GEOM_Object_ptr RemoveInternalFaces (GEOM::GEOM_Object_ptr theCompound);
+   GEOM::GEOM_Object_ptr RemoveInternalFaces (const GEOM::ListOfGO& theSolids);
 
    GEOM::GEOM_Object_ptr DivideEdge (GEOM::GEOM_Object_ptr theObject,
-                                     CORBA::Short theIndex,
-                                     CORBA::Double theValue,
-                                     CORBA::Boolean isByParameter);
+                                     CORBA::Short          theIndex,
+                                     CORBA::Double         theValue,
+                                     CORBA::Boolean        isByParameter);
+
+   GEOM::GEOM_Object_ptr DivideEdgeByPoint (GEOM::GEOM_Object_ptr theObject,
+                                            CORBA::Short          theIndex,
+                                            const GEOM::ListOfGO& thePoints);
 
    GEOM::GEOM_Object_ptr FuseCollinearEdgesWithinWire (GEOM::GEOM_Object_ptr theWire,
                                                        const GEOM::ListOfGO& theVertices);
 
-   CORBA::Boolean GetFreeBoundary(GEOM::GEOM_Object_ptr theObject,
-                                  GEOM::ListOfGO_out theClosedWires,
-                                  GEOM::ListOfGO_out theOpenWires );
+   CORBA::Boolean GetFreeBoundary(const GEOM::ListOfGO& theObjects,
+                                  GEOM::ListOfGO_out    theClosedWires,
+                                  GEOM::ListOfGO_out    theOpenWires );
 
    GEOM::GEOM_Object_ptr ChangeOrientation (GEOM::GEOM_Object_ptr theObject);
    GEOM::GEOM_Object_ptr ChangeOrientationCopy (GEOM::GEOM_Object_ptr theObject);
@@ -97,6 +101,8 @@ class GEOM_I_EXPORT GEOM_IHealingOperations_i :
 
    ::GEOMImpl_IHealingOperations* GetOperations() { return (::GEOMImpl_IHealingOperations*)GetImpl(); }
 
+   GEOM::ModifStatistics* GetStatistics();
+   
 private:
          Handle(TColStd_HArray1OfInteger)        Convert( const GEOM::short_array& );
 
index ab79c87b68bc66e78e6f735cbdb68f93d5619f6c..a0538704e150d6cc7afa5148de90f334cd891dbb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -34,6 +34,7 @@
 
 #include "GEOM_Engine.hxx"
 #include "GEOM_BaseObject.hxx"
+#include "GEOMImpl_Types.hxx"
 
 #include <Basics_OCCTVersion.hxx>
 
@@ -259,4 +260,83 @@ GEOM::ListOfLong* GEOM_IInsertOperations_i::GetAllTextures()
   return anIDs._retn();
 }
 
+//=============================================================================
+/*!
+ *  TransferData
+ */
+//=============================================================================
+CORBA::Boolean GEOM_IInsertOperations_i::TransferData
+        (GEOM::GEOM_Object_ptr                                 theObjectFrom,
+         GEOM::GEOM_Object_ptr                                 theObjectTo,
+         GEOM::find_shape_method                               theFindMethod,
+         GEOM::GEOM_IInsertOperations::ListOfTransferDatum_out theResult)
+{
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  if (CORBA::is_nil(theObjectFrom) || CORBA::is_nil(theObjectTo))
+  {
+    return false;
+  }
+
+  //Get the reference shape
+  Handle(GEOM_Object) aShapeFrom = GetObjectImpl(theObjectFrom);
+  Handle(GEOM_Object) aShapeTo   = GetObjectImpl(theObjectTo);
+
+  if (aShapeFrom.IsNull() || aShapeTo.IsNull())
+  {
+    return false;
+  }
 
+  bool isOk = false;
+  std::list<GEOMImpl_IInsertOperations::TransferDatum> aData;
+  int aFindMethod = -1;
+
+  switch (theFindMethod) {
+  case GEOM::FSM_GetInPlace:
+    aFindMethod = TD_GET_IN_PLACE;
+    break;
+  case GEOM::FSM_GetInPlaceByHistory:
+    aFindMethod = TD_GET_IN_PLACE_BY_HISTORY;
+    break;
+  case GEOM::FSM_GetInPlace_Old:
+    aFindMethod = TD_GET_IN_PLACE_OLD;
+    break;
+  default:
+    break;
+  }
+
+  // Transfer data.
+  if (aFindMethod > 0) {
+    isOk = GetOperations()->TransferData
+      (aShapeFrom, aShapeTo, aFindMethod, aData);
+  }
+
+  if (isOk) {
+    // Copy results.
+    const int aNbDatum = aData.size();
+    GEOM::GEOM_IInsertOperations::ListOfTransferDatum_var aResult =
+      new GEOM::GEOM_IInsertOperations::ListOfTransferDatum;
+
+    aResult->length(aNbDatum);
+
+    // fill the local CORBA array with values from lists
+    std::list<GEOMImpl_IInsertOperations::TransferDatum>::const_iterator
+      anIt = aData.begin();
+    int i = 0;
+
+    for (; anIt != aData.end(); i++, anIt++) {
+      GEOM::GEOM_IInsertOperations::TransferDatum_var aDatum =
+        new GEOM::GEOM_IInsertOperations::TransferDatum;
+
+      aDatum->myName      = CORBA::string_dup(anIt->myName.ToCString());
+      aDatum->myNumber    = anIt->myNumber;
+      aDatum->myMaxNumber = anIt->myMaxNumber;
+      aResult[i]          = aDatum;
+    }
+
+    theResult = aResult._retn();
+  }
+
+  return isOk;
+}
index 4a2b4f2ccccd00f86ae6dc33752d50569e73de0b..3ddc6e913e7cd05e316a05ca2865fe2c509485ab 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -66,7 +66,13 @@ class GEOM_I_EXPORT GEOM_IInsertOperations_i :
                                 CORBA::Long& theHeight);
 
   GEOM::ListOfLong* GetAllTextures();
-  
+
+  CORBA::Boolean TransferData
+        (GEOM::GEOM_Object_ptr                                 theObjectFrom,
+         GEOM::GEOM_Object_ptr                                 theObjectTo,
+         GEOM::find_shape_method                               theFindMethod,
+         GEOM::GEOM_IInsertOperations::ListOfTransferDatum_out theResult);
+
   ::GEOMImpl_IInsertOperations* GetOperations()
   { return (::GEOMImpl_IInsertOperations*)GetImpl(); }
 };
index c4c96013a85b19df942c201bc075548e7c1dcb77..f2d15f2a634684f7cf1c546fc828421f4f3a1085 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 6640748ee5534e3b0f7f2c1c5ca269e3bd0da1e3..7ea0b986896892e82fa8d5981a4db00428eb9312 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b6785bda922a9edf0836974fa0a7b9698892d460..407d71f05f8c972ec0ab716d31181a70b6a0e0ec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -706,6 +706,7 @@ char* GEOM_IMeasureOperations_i::PrintShapeErrors
  */
 //=============================================================================
 CORBA::Boolean GEOM_IMeasureOperations_i::CheckSelfIntersections (GEOM::GEOM_Object_ptr theShape,
+                                                                  CORBA::Long           theCheckLevel,
                                                                   GEOM::ListOfLong_out  theIntersections)
 {
   // Set a not done flag
@@ -720,10 +721,35 @@ CORBA::Boolean GEOM_IMeasureOperations_i::CheckSelfIntersections (GEOM::GEOM_Obj
   Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
 
   if (!aShape.IsNull()) {
+    GEOMImpl_IMeasureOperations::SICheckLevel aCheckLevel;
+
+    switch(theCheckLevel) {
+    case GEOM::SI_V_V:
+      aCheckLevel = GEOMImpl_IMeasureOperations::SI_V_V;
+      break;
+    case GEOM::SI_V_E:
+      aCheckLevel = GEOMImpl_IMeasureOperations::SI_V_E;
+      break;
+    case GEOM::SI_E_E:
+      aCheckLevel = GEOMImpl_IMeasureOperations::SI_E_E;
+      break;
+    case GEOM::SI_V_F:
+      aCheckLevel = GEOMImpl_IMeasureOperations::SI_V_F;
+      break;
+    case GEOM::SI_E_F:
+      aCheckLevel = GEOMImpl_IMeasureOperations::SI_E_F;
+      break;
+    case GEOM::SI_ALL:
+    default:
+      aCheckLevel = GEOMImpl_IMeasureOperations::SI_ALL;
+      break;
+    }
+
     Handle(TColStd_HSequenceOfInteger) anIntegers = new TColStd_HSequenceOfInteger;
 
     // Detect self-intersections
-    isGood = GetOperations()->CheckSelfIntersections(aShape, anIntegers);
+    isGood = GetOperations()->CheckSelfIntersections
+      (aShape, aCheckLevel, anIntegers);
 
     int nbInts = anIntegers->Length();
 
@@ -739,6 +765,102 @@ CORBA::Boolean GEOM_IMeasureOperations_i::CheckSelfIntersections (GEOM::GEOM_Obj
   return isGood;
 }
 
+//=============================================================================
+/*!
+ *  CheckSelfIntersectionsFast
+ */
+//=============================================================================
+CORBA::Boolean GEOM_IMeasureOperations_i::CheckSelfIntersectionsFast 
+  (GEOM::GEOM_Object_ptr theShape,
+   CORBA::Float          theDeflection,
+   CORBA::Double         theTolerance,
+   GEOM::ListOfLong_out  theIntersections)
+{
+  // Set a not done flag
+  GetOperations()->SetNotDone();
+
+  bool isGood = false;
+
+  // Allocate the CORBA arrays
+  GEOM::ListOfLong_var anIntegersArray = new GEOM::ListOfLong();
+
+  // Get the reference shape
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+
+  if (!aShape.IsNull()) {
+    Handle(TColStd_HSequenceOfInteger) anIntegers = new TColStd_HSequenceOfInteger;
+
+    // Detect self-intersections
+    isGood = GetOperations()->CheckSelfIntersectionsFast
+      (aShape, theDeflection, theTolerance, anIntegers);
+
+    int nbInts = anIntegers->Length();
+
+    anIntegersArray->length(nbInts);
+
+    for (int ii = 0; ii < nbInts; ii++) {
+      anIntegersArray[ii] = anIntegers->Value(ii + 1);
+    }
+  }
+
+  // Initialize out-parameters with local arrays
+  theIntersections = anIntegersArray._retn();
+  return isGood;
+}
+
+//=============================================================================
+/*!
+ *  FastIntersect
+ */
+//=============================================================================
+CORBA::Boolean GEOM_IMeasureOperations_i::FastIntersect (GEOM::GEOM_Object_ptr theShape1,
+                                                         GEOM::GEOM_Object_ptr theShape2,
+                                                         CORBA::Double         theTolerance,
+                                                         CORBA::Float          theDeflection,
+                                                         GEOM::ListOfLong_out  theIntersections1,
+                                                         GEOM::ListOfLong_out  theIntersections2)
+{
+  // Set a not done flag
+  GetOperations()->SetNotDone();
+
+  bool isGood = false;
+
+  // Allocate the CORBA arrays
+  GEOM::ListOfLong_var anIntegersArray1 = new GEOM::ListOfLong();
+  GEOM::ListOfLong_var anIntegersArray2 = new GEOM::ListOfLong();
+
+  // Get the reference shape
+  Handle(GEOM_Object) aShape1 = GetObjectImpl(theShape1);
+  Handle(GEOM_Object) aShape2 = GetObjectImpl(theShape2);
+  
+  if (!aShape1.IsNull() && !aShape2.IsNull()) {
+    Handle(TColStd_HSequenceOfInteger) anIntegers1 = new TColStd_HSequenceOfInteger;
+    Handle(TColStd_HSequenceOfInteger) anIntegers2 = new TColStd_HSequenceOfInteger;
+
+    // Detect intersections
+    isGood = GetOperations()->FastIntersect
+      (aShape1, aShape2, theTolerance, theDeflection, anIntegers1, anIntegers2);
+
+    int nbInts1 = anIntegers1->Length();
+    int nbInts2 = anIntegers2->Length();
+
+    anIntegersArray1->length(nbInts1);
+    anIntegersArray2->length(nbInts2);
+
+    for (int ii = 0; ii < nbInts1; ii++) {
+      anIntegersArray1[ii] = anIntegers1->Value(ii + 1);
+    }
+    for (int ii = 0; ii < nbInts2; ii++) {
+      anIntegersArray2[ii] = anIntegers2->Value(ii + 1);
+    }
+  }
+
+  // Initialize out-parameters with local arrays
+  theIntersections1 = anIntegersArray1._retn();
+  theIntersections2 = anIntegersArray2._retn();
+  return isGood;
+}
+
 //=============================================================================
 /*!
  *  IsGoodForSolid
index 690ac5390fb0b31d2df461519b7dfbe4321c5b2f..71e6194bac7780562f53a23b4024fe35d34366cd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -97,8 +97,21 @@ class GEOM_I_EXPORT GEOM_IMeasureOperations_i :
               const GEOM::GEOM_IMeasureOperations::ShapeErrors &theErrors);
 
   CORBA::Boolean CheckSelfIntersections (GEOM::GEOM_Object_ptr theShape,
+                                         CORBA::Long           theCheckLevel,
                                          GEOM::ListOfLong_out  theIntersections);
 
+  CORBA::Boolean CheckSelfIntersectionsFast (GEOM::GEOM_Object_ptr theShape,
+                                            CORBA::Float          theDeflection,
+                                            CORBA::Double         theTolerance,
+                                            GEOM::ListOfLong_out  theIntersections);
+
+  CORBA::Boolean FastIntersect (GEOM::GEOM_Object_ptr theShape1,
+                                GEOM::GEOM_Object_ptr theShape2,
+                                CORBA::Double         theTolerance,
+                                CORBA::Float         theDeflection,
+                                GEOM::ListOfLong_out  theIntersections1,
+                                GEOM::ListOfLong_out  theIntersections2);
+
   char* IsGoodForSolid (GEOM::GEOM_Object_ptr theShape);
 
   char* WhatIs (GEOM::GEOM_Object_ptr theShape);
index 9cb5b846978565cf7fc4b41c872b87bed07f9002..f574da6d2f38622fa0ca4530ce6b9b8144e6e9c8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -209,6 +209,29 @@ Handle(TColStd_HSequenceOfTransient) GEOM_IOperations_i::GetListOfObjectsImpl
   return aResult;
 }
 
+//=======================================================================
+//function : GetListOfObjectsImpl
+//purpose  : 
+//=======================================================================
+
+bool GEOM_IOperations_i::GetListOfObjectsImpl(const GEOM::ListOfGO&             theObjects,
+                                              std::list< Handle(GEOM_Object) >& theList)
+{
+  int i;
+  int aNbObj = theObjects.length();
+
+  for (i = 0; i < aNbObj; i++) {
+    Handle(GEOM_Object) anObj = GetObjectImpl(theObjects[i]);
+
+    if (anObj.IsNull())
+      return false;
+
+    theList.push_back(anObj);
+  }
+
+  return true;
+}
+
 //=============================================================================
 /*!
  *  UpdateGUIForObject
index b82b36c68ab7d3f450d37426c6c298e0912fb921..b57764fb2c45cf4553cf8fef2a560dfa6d7f53eb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -67,6 +67,8 @@ protected:
 
   Handle(TColStd_HSequenceOfTransient)
                GetListOfObjectsImpl(const GEOM::ListOfGO& theObjects);
+  bool GetListOfObjectsImpl(const GEOM::ListOfGO& theObjects,
+                            std::list< Handle(GEOM_Object) >& theList);
 
   Handle(TColStd_HArray1OfExtendedString)
                ConvertStringArray(const GEOM::string_array &theInArray);
index e26497648a04d88803e01280575cd619eca5c48c..7561d9a168461e0fe90191c2214a5d216ddc28d9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <TColStd_HSequenceOfTransient.hxx>
 #include <TColStd_HArray1OfInteger.hxx>
 
+/**
+ * This function converts GEOM::comparison_condition type into
+ * GEOMUtils::ComparisonCondition type.
+ *
+ * \param theCondition the condition of GEOM::comparison_condition type
+ * \return the condition of GEOMUtils::ComparisonCondition type.
+ */
+static GEOMUtils::ComparisonCondition ComparisonCondition
+                    (const GEOM::comparison_condition theCondition)
+{
+  GEOMUtils::ComparisonCondition aResult = GEOMUtils::CC_GT;
+
+  switch (theCondition) {
+  case GEOM::CC_GE:
+    aResult = GEOMUtils::CC_GE;
+    break;
+  case GEOM::CC_LT:
+    aResult = GEOMUtils::CC_LT;
+    break;
+  case GEOM::CC_LE:
+    aResult = GEOMUtils::CC_LE;
+    break;
+  default:
+    break;
+  }
+
+  return aResult;
+}
+
 //=============================================================================
 /*!
  *   constructor:
@@ -246,6 +275,70 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceWires
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  MakeFaceFromSurface
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceFromSurface
+                                  (GEOM::GEOM_Object_ptr theFace,
+                                   GEOM::GEOM_Object_ptr theWire)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the reference face and wire
+  Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
+  Handle(GEOM_Object) aWire = GetObjectImpl(theWire);
+
+  if (aFace.IsNull() || aWire.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  //Create the Face
+  Handle(GEOM_Object) anObject =
+    GetOperations()->MakeFaceFromSurface(aFace, aWire);
+
+  if (anObject.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  return GetObject(anObject);
+}
+
+//=============================================================================
+/*!
+ *  MakeFaceWithConstraints
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeFaceWithConstraints
+                                                (const GEOM::ListOfGO& theConstraints)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the shapes
+  std::list<Handle(GEOM_Object)> aConstraints;
+  for( int ind = 0; ind < theConstraints.length(); ind++ ) {
+    Handle(GEOM_Object) anObject = GetObjectImpl( theConstraints[ind] );
+    aConstraints.push_back(anObject);
+  }
+
+  // Make Face
+  Handle(GEOM_Object) anObject =
+    GetOperations()->MakeFaceWithConstraints( aConstraints );
+
+  // enable warning status
+  if (anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
 //=============================================================================
 /*!
  *  MakeShell
@@ -345,8 +438,8 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidShells
  *  MakeCompound
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeCompound
-                                      (const GEOM::ListOfGO& theShapes)
+GEOM::GEOM_Object_ptr
+GEOM_IShapesOperations_i::MakeCompound (const GEOM::ListOfGO& theShapes)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -373,15 +466,49 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeCompound
   return GetObject(anObject);
 }
 
+//=============================================================================
+/*!
+ *  MakeSolidFromConnectedFaces
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSolidFromConnectedFaces
+                                      (const GEOM::ListOfGO& theFacesOrShells,
+                                       const CORBA::Boolean  isIntersect)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  int ind, aLen;
+  std::list<Handle(GEOM_Object)> aShapes;
+
+  //Get the shapes
+  aLen = theFacesOrShells.length();
+  for (ind = 0; ind < aLen; ind++) {
+    Handle(GEOM_Object) aSh = GetObjectImpl(theFacesOrShells[ind]);
+    if (aSh.IsNull()) return aGEOMObject._retn();
+    aShapes.push_back(aSh);
+  }
+
+  // Make Solid
+  Handle(GEOM_Object) anObject =
+    GetOperations()->MakeSolidFromConnectedFaces(aShapes, isIntersect);
+  if (!GetOperations()->IsDone() || anObject.IsNull())
+    return aGEOMObject._retn();
+
+  return GetObject(anObject);
+}
+
 //=============================================================================
 /*!
  *  MakeGlueFaces
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
-                                           (GEOM::GEOM_Object_ptr theShape,
-                                            CORBA::Double   theTolerance,
-                                            CORBA::Boolean  doKeepNonSolids)
+GEOM::GEOM_Object_ptr
+GEOM_IShapesOperations_i::MakeGlueFaces (const GEOM::ListOfGO& theShapes,
+                                         CORBA::Double         theTolerance,
+                                         CORBA::Boolean  doKeepNonSolids)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -389,12 +516,13 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
   GetOperations()->SetNotDone();
 
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
-  if (aShape.IsNull()) return aGEOMObject._retn();
+  std::list< Handle(GEOM_Object) > aShapes;
+  if (! GetListOfObjectsImpl( theShapes, aShapes ))
+    return aGEOMObject._retn();
 
   //Perform the gluing
   Handle(GEOM_Object) anObject =
-    GetOperations()->MakeGlueFaces(aShape, theTolerance, doKeepNonSolids);
+    GetOperations()->MakeGlueFaces(aShapes, theTolerance, doKeepNonSolids);
   //if (!GetOperations()->IsDone() || anObject.IsNull())
   // to allow warning
   if (anObject.IsNull())
@@ -408,9 +536,9 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFaces
  *  GetGlueFaces
  */
 //=============================================================================
-GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
-                                           (GEOM::GEOM_Object_ptr theShape,
-                                            const CORBA::Double   theTolerance)
+GEOM::ListOfGO*
+GEOM_IShapesOperations_i::GetGlueFaces (const GEOM::ListOfGO& theShapes,
+                                        const CORBA::Double   theTolerance)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
@@ -418,12 +546,12 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
   GetOperations()->SetNotDone();
 
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
-  if (aShape.IsNull()) return aSeq._retn();
+  std::list< Handle(GEOM_Object) > aShapes;
+  if (! GetListOfObjectsImpl( theShapes, aShapes ))
+    return aSeq._retn();
 
   Handle(TColStd_HSequenceOfTransient) aHSeq =
-    //GetOperations()->GetGlueFaces(aShape, theTolerance);
-    GetOperations()->GetGlueShapes(aShape, theTolerance, TopAbs_FACE);
+    GetOperations()->GetGlueShapes(aShapes, theTolerance, TopAbs_FACE);
 
   //if (!GetOperations()->IsDone() || aHSeq.IsNull())
   // to allow warning
@@ -443,12 +571,12 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueFaces
  *  MakeGlueFacesByList
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
-                                           (GEOM::GEOM_Object_ptr theShape,
-                                            CORBA::Double   theTolerance,
-                                            const GEOM::ListOfGO& theFaces,
-                                            CORBA::Boolean doKeepNonSolids,
-                                            CORBA::Boolean doGlueAllEdges)
+GEOM::GEOM_Object_ptr
+GEOM_IShapesOperations_i::MakeGlueFacesByList (const GEOM::ListOfGO& theShapes,
+                                               CORBA::Double         theTolerance,
+                                               const GEOM::ListOfGO& theFaces,
+                                               CORBA::Boolean        doKeepNonSolids,
+                                               CORBA::Boolean        doGlueAllEdges)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -456,22 +584,19 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
   GetOperations()->SetNotDone();
 
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
-  if (aShape.IsNull()) return aGEOMObject._retn();
+  std::list< Handle(GEOM_Object) > aShapes;
+  if (! GetListOfObjectsImpl( theShapes, aShapes ))
+    return aGEOMObject._retn();
 
-  int ind, aLen;
-  std::list<Handle(GEOM_Object)> aFaces;
   //Get the shapes
-  aLen = theFaces.length();
-  for (ind = 0; ind < aLen; ind++) {
-    Handle(GEOM_Object) aSh = GetObjectImpl(theFaces[ind]);
-    if (aSh.IsNull()) return aGEOMObject._retn();
-    aFaces.push_back(aSh);
-  }
+  std::list<Handle(GEOM_Object)> aFaces;
+  if (! GetListOfObjectsImpl( theFaces, aFaces ))
+    return aGEOMObject._retn();
 
   //Perform the gluing
   Handle(GEOM_Object) anObject =
-    GetOperations()->MakeGlueFacesByList(aShape, theTolerance, aFaces, doKeepNonSolids, doGlueAllEdges);
+    GetOperations()->MakeGlueFacesByList(aShapes, theTolerance, aFaces,
+                                         doKeepNonSolids, doGlueAllEdges);
   //if (!GetOperations()->IsDone() || anObject.IsNull())
   // to allow warning
   if (anObject.IsNull())
@@ -485,9 +610,9 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueFacesByList
  *  MakeGlueEdges
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueEdges
-                                           (GEOM::GEOM_Object_ptr theShape,
-                                            CORBA::Double   theTolerance)
+GEOM::GEOM_Object_ptr
+GEOM_IShapesOperations_i::MakeGlueEdges (const GEOM::ListOfGO& theShapes,
+                                         CORBA::Double         theTolerance)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -495,12 +620,13 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueEdges
   GetOperations()->SetNotDone();
 
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
-  if (aShape.IsNull()) return aGEOMObject._retn();
+  std::list< Handle(GEOM_Object) > aShapes;
+  if (! GetListOfObjectsImpl( theShapes, aShapes ))
+    return aGEOMObject._retn();
 
   //Perform the gluing
   Handle(GEOM_Object) anObject =
-    GetOperations()->MakeGlueEdges(aShape, theTolerance);
+    GetOperations()->MakeGlueEdges(aShapes, theTolerance);
   //if (!GetOperations()->IsDone() || anObject.IsNull())
   // to allow warning
   if (anObject.IsNull())
@@ -514,9 +640,9 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueEdges
  *  GetGlueEdges
  */
 //=============================================================================
-GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueEdges
-                                           (GEOM::GEOM_Object_ptr theShape,
-                                            const CORBA::Double   theTolerance)
+GEOM::ListOfGO*
+GEOM_IShapesOperations_i::GetGlueEdges (const GEOM::ListOfGO& theShapes,
+                                        const CORBA::Double   theTolerance)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
@@ -524,11 +650,12 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueEdges
   GetOperations()->SetNotDone();
 
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
-  if (aShape.IsNull()) return aSeq._retn();
+  std::list< Handle(GEOM_Object) > aShapes;
+  if (! GetListOfObjectsImpl( theShapes, aShapes ))
+    return aSeq._retn();
 
   Handle(TColStd_HSequenceOfTransient) aHSeq =
-    GetOperations()->GetGlueShapes(aShape, theTolerance, TopAbs_EDGE);
+    GetOperations()->GetGlueShapes(aShapes, theTolerance, TopAbs_EDGE);
 
   //if (!GetOperations()->IsDone() || aHSeq.IsNull())
   // to allow warning
@@ -548,10 +675,10 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetGlueEdges
  *  MakeGlueEdgesByList
  */
 //=============================================================================
-GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueEdgesByList
-                                           (GEOM::GEOM_Object_ptr theShape,
-                                            CORBA::Double   theTolerance,
-                                            const GEOM::ListOfGO& theEdges)
+GEOM::GEOM_Object_ptr
+GEOM_IShapesOperations_i::MakeGlueEdgesByList (const GEOM::ListOfGO& theShapes,
+                                               CORBA::Double         theTolerance,
+                                               const GEOM::ListOfGO& theEdges)
 {
   GEOM::GEOM_Object_var aGEOMObject;
 
@@ -559,22 +686,18 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueEdgesByList
   GetOperations()->SetNotDone();
 
   //Get the reference objects
-  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
-  if (aShape.IsNull()) return aGEOMObject._retn();
+  std::list< Handle(GEOM_Object) > aShapes;
+  if (! GetListOfObjectsImpl( theShapes, aShapes ))
+    return aGEOMObject._retn();
 
-  int ind, aLen;
-  std::list<Handle(GEOM_Object)> anEdges;
   //Get the shapes
-  aLen = theEdges.length();
-  for (ind = 0; ind < aLen; ind++) {
-    Handle(GEOM_Object) aSh = GetObjectImpl(theEdges[ind]);
-    if (aSh.IsNull()) return aGEOMObject._retn();
-    anEdges.push_back(aSh);
-  }
+  std::list<Handle(GEOM_Object)> anEdges;
+  if (! GetListOfObjectsImpl( theEdges, anEdges ))
+    return aGEOMObject._retn();
 
   //Perform the gluing
   Handle(GEOM_Object) anObject =
-    GetOperations()->MakeGlueEdgesByList(aShape, theTolerance, anEdges);
+    GetOperations()->MakeGlueEdgesByList(aShapes, theTolerance, anEdges);
   //if (!GetOperations()->IsDone() || anObject.IsNull())
   // to allow warning
   if (anObject.IsNull())
@@ -588,8 +711,9 @@ GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeGlueEdgesByList
  *  GetExistingSubObjects
  */
 //=============================================================================
-GEOM::ListOfGO* GEOM_IShapesOperations_i::GetExistingSubObjects (GEOM::GEOM_Object_ptr theShape,
-                                                                 CORBA::Boolean        theGroupsOnly)
+GEOM::ListOfGO*
+GEOM_IShapesOperations_i::GetExistingSubObjects (GEOM::GEOM_Object_ptr theShape,
+                                                 CORBA::Boolean        theGroupsOnly)
 {
   GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
 
@@ -597,7 +721,7 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetExistingSubObjects (GEOM::GEOM_Obje
   if (aShape.IsNull()) return aSeq._retn();
 
   Handle(TColStd_HSequenceOfTransient) aHSeq =
-    GetOperations()->GetExistingSubObjects(aShape, theGroupsOnly);
+    GetOperations()->GetExistingSubObjects(aShape, (Standard_Boolean)theGroupsOnly);
   if (!GetOperations()->IsDone() || aHSeq.IsNull())
     return aSeq._retn();
 
@@ -912,6 +1036,25 @@ char* GEOM_IShapesOperations_i::GetShapeTypeString (GEOM::GEOM_Object_ptr theSha
   return CORBA::string_dup(aDescription.ToCString());
 }
 
+//=============================================================================
+/*!
+ *  IsSubShapeBelongsTo
+ */
+//=============================================================================
+CORBA::Boolean GEOM_IShapesOperations_i::IsSubShapeBelongsTo( GEOM::GEOM_Object_ptr theSubObject,
+                                                              const CORBA::Long theSubObjectIndex,
+                                                              GEOM::GEOM_Object_ptr theObject,
+                                                              const CORBA::Long theObjectIndex)
+{
+  Handle(GEOM_Object) aSubObject = GetObjectImpl( theSubObject );
+  Handle(GEOM_Object) anObject = GetObjectImpl( theObject );
+  if( anObject.IsNull() || aSubObject.IsNull() )
+    return false;
+
+  // Get parameters
+  return GetOperations()->IsSubShapeBelongsTo( aSubObject, theSubObjectIndex, anObject, theObjectIndex );
+}
+
 //=============================================================================
 /*!
  *  NumberOfFaces
@@ -1041,7 +1184,8 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapes
 //=============================================================================
 GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapesMulti
                                           (const GEOM::ListOfGO& theShapes,
-                                           const CORBA::Long     theShapeType)
+                                           const CORBA::Long     theShapeType,
+                                           CORBA::Boolean        theMultiShare)
 {
   //Set a not done flag
   GetOperations()->SetNotDone();
@@ -1050,15 +1194,11 @@ GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSharedShapesMulti
 
   //Get the shapes
   std::list<Handle(GEOM_Object)> aShapes;
-  int aLen = theShapes.length();
-  for (int ind = 0; ind < aLen; ind++) {
-    Handle(GEOM_Object) aSh = GetObjectImpl(theShapes[ind]);
-    if (aSh.IsNull()) return aSeq._retn();
-    aShapes.push_back(aSh);
-  }
+  if (! GetListOfObjectsImpl( theShapes, aShapes ))
+    return aSeq._retn();
 
   Handle(TColStd_HSequenceOfTransient) aHSeq =
-    GetOperations()->GetSharedShapes(aShapes, theShapeType);
+    GetOperations()->GetSharedShapes(aShapes, theShapeType, theMultiShare);
   if (!GetOperations()->IsDone() || aHSeq.IsNull())
     return aSeq._retn();
 
@@ -1906,3 +2046,187 @@ GEOM::ListOfLong* GEOM_IShapesOperations_i::GetSameIDs
 
   return aSeq._retn();
 }
+
+//=============================================================================
+/*!
+ *  ExtendEdge
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ExtendEdge
+                                  (GEOM::GEOM_Object_ptr theEdge,
+                                   CORBA::Double         theMin,
+                                   CORBA::Double         theMax)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the reference objects
+  Handle(GEOM_Object) anEdge = GetObjectImpl(theEdge);
+
+  if (anEdge.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  //Get Shapes in place of aShapeWhat
+  Handle(GEOM_Object) aNewEdge =
+    GetOperations()->ExtendEdge(anEdge, theMin, theMax);
+
+  if (!GetOperations()->IsDone() || aNewEdge.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  return GetObject(aNewEdge);
+}
+
+//=============================================================================
+/*!
+ *  ExtendFace
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::ExtendFace
+                                  (GEOM::GEOM_Object_ptr theFace,
+                                   CORBA::Double         theUMin,
+                                   CORBA::Double         theUMax,
+                                   CORBA::Double         theVMin,
+                                   CORBA::Double         theVMax)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the reference objects
+  Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
+
+  if (aFace.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  //Get Shapes in place of aShapeWhat
+  Handle(GEOM_Object) aNewFace =
+    GetOperations()->ExtendFace(aFace, theUMin, theUMax, theVMin, theVMax);
+
+  if (!GetOperations()->IsDone() || aNewFace.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  return GetObject(aNewFace);
+}
+
+//=============================================================================
+/*!
+ *  MakeSurfaceFromFace
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_IShapesOperations_i::MakeSurfaceFromFace
+                                  (GEOM::GEOM_Object_ptr theFace)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the reference object
+  Handle(GEOM_Object) aFace = GetObjectImpl(theFace);
+
+  if (aFace.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  //Get Shapes in place of aShapeWhat
+  Handle(GEOM_Object) aNewFace = GetOperations()->MakeSurfaceFromFace(aFace);
+
+  if (!GetOperations()->IsDone() || aNewFace.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  return GetObject(aNewFace);
+}
+
+//=============================================================================
+/*!
+ *  GetSubShapeEdgeSorted
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSubShapeEdgeSorted
+                                        (GEOM::GEOM_Object_ptr theShape,
+                                         GEOM::GEOM_Object_ptr theStartPoint)
+{
+  GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the reference objects
+  Handle(GEOM_Object) aShape      = GetObjectImpl(theShape);
+  Handle(GEOM_Object) aStartPoint = GetObjectImpl(theStartPoint);
+
+  if (aShape.IsNull() || aStartPoint.IsNull()) {
+    return aSeq._retn();
+  }
+
+  //Get Shapes On Shape
+  Handle(TColStd_HSequenceOfTransient) aHSeq =
+      GetOperations()->GetSubShapeEdgeSorted(aShape, aStartPoint);
+
+  if (!GetOperations()->IsDone() || aHSeq.IsNull())
+    return aSeq._retn();
+
+  const Standard_Integer aLength = aHSeq->Length();
+  Standard_Integer       i;
+
+  aSeq->length(aLength);
+
+  for (i = 1; i <= aLength; i++) {
+    aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+  }
+
+  return aSeq._retn();
+}
+
+//=============================================================================
+/*!
+ *  GetSubShapesWithTolerance
+ */
+//=============================================================================
+GEOM::ListOfGO* GEOM_IShapesOperations_i::GetSubShapesWithTolerance
+                     (GEOM::GEOM_Object_ptr      theShape,
+                      CORBA::Short               theShapeType,
+                      GEOM::comparison_condition theCondition,
+                      CORBA::Double              theTolerance)
+{
+  GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the reference objects
+  Handle(GEOM_Object) aShape = GetObjectImpl(theShape);
+
+  if (aShape.IsNull()) {
+    return aSeq._retn();
+  }
+
+  //Get Shapes On Shape
+  const GEOMUtils::ComparisonCondition aCondition =
+                ComparisonCondition(theCondition);
+  Handle(TColStd_HSequenceOfTransient) aHSeq      =
+      GetOperations()->GetSubShapesWithTolerance
+                (aShape, theShapeType, aCondition, theTolerance);
+
+  if (!GetOperations()->IsDone() || aHSeq.IsNull())
+    return aSeq._retn();
+
+  const Standard_Integer aLength = aHSeq->Length();
+  Standard_Integer       i;
+
+  aSeq->length(aLength);
+
+  for (i = 1; i <= aLength; i++) {
+    aSeq[i-1] = GetObject(Handle(GEOM_Object)::DownCast(aHSeq->Value(i)));
+  }
+
+  return aSeq._retn();
+}
index 028d927e0a515e9f917e9ea20f55f85edbd297ce..0f36a38c3934aea05221cb243be714a0b59c1fd2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -64,6 +64,11 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
   GEOM::GEOM_Object_ptr MakeFaceWires (const GEOM::ListOfGO& theWires,
                                        CORBA::Boolean  isPlanarWanted);
 
+  GEOM::GEOM_Object_ptr MakeFaceFromSurface(GEOM::GEOM_Object_ptr theFace,
+                                            GEOM::GEOM_Object_ptr theWire);
+
+  GEOM::GEOM_Object_ptr MakeFaceWithConstraints (const GEOM::ListOfGO& theConstraints);
+  
   GEOM::GEOM_Object_ptr MakeShell (const GEOM::ListOfGO& theFacesAndShells);
 
   GEOM::GEOM_Object_ptr MakeSolidShell (GEOM::GEOM_Object_ptr theShell);
@@ -72,26 +77,29 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
 
   GEOM::GEOM_Object_ptr MakeCompound (const GEOM::ListOfGO& theShapes);
 
-  GEOM::GEOM_Object_ptr MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
+  GEOM::GEOM_Object_ptr MakeSolidFromConnectedFaces (const GEOM::ListOfGO& theFacesOrShells,
+                                                     CORBA::Boolean isIntersect);
+
+  GEOM::GEOM_Object_ptr MakeGlueFaces (const GEOM::ListOfGO& theShape,
                                        CORBA::Double         theTolerance,
                                        CORBA::Boolean        doKeepNonSolids);
 
-  GEOM::ListOfGO* GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
+  GEOM::ListOfGO* GetGlueFaces (const GEOM::ListOfGO& theShape,
                                 CORBA::Double         theTolerance);
 
-  GEOM::GEOM_Object_ptr MakeGlueFacesByList (GEOM::GEOM_Object_ptr theShape,
+  GEOM::GEOM_Object_ptr MakeGlueFacesByList (const GEOM::ListOfGO& theShape,
                                              CORBA::Double         theTolerance,
                                              const GEOM::ListOfGO& theFaces,
                                              CORBA::Boolean doKeepNonSolids,
                                              CORBA::Boolean doGlueAllEdges);
 
-  GEOM::GEOM_Object_ptr MakeGlueEdges (GEOM::GEOM_Object_ptr theShape,
+  GEOM::GEOM_Object_ptr MakeGlueEdges (const GEOM::ListOfGO& theShape,
                                        CORBA::Double         theTolerance);
 
-  GEOM::ListOfGO* GetGlueEdges (GEOM::GEOM_Object_ptr theShape,
+  GEOM::ListOfGO* GetGlueEdges (const GEOM::ListOfGO& theShape,
                                 CORBA::Double         theTolerance);
 
-  GEOM::GEOM_Object_ptr MakeGlueEdgesByList (GEOM::GEOM_Object_ptr theShape,
+  GEOM::GEOM_Object_ptr MakeGlueEdgesByList (const GEOM::ListOfGO& theShape,
                                              CORBA::Double         theTolerance,
                                              const GEOM::ListOfGO& theEdges);
 
@@ -138,6 +146,11 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
 
   char* GetShapeTypeString (GEOM::GEOM_Object_ptr theShape);
 
+  CORBA::Boolean IsSubShapeBelongsTo( GEOM::GEOM_Object_ptr theSubobject,
+                                      const CORBA::Long theSubObjectIndex,
+                                      GEOM::GEOM_Object_ptr theObject,
+                                      const CORBA::Long theObjectIndex );
+
   CORBA::Long NumberOfFaces (GEOM::GEOM_Object_ptr theShape);
   CORBA::Long NumberOfEdges (GEOM::GEOM_Object_ptr theShape);
   CORBA::Long NumberOfSubShapes (GEOM::GEOM_Object_ptr theShape,
@@ -152,7 +165,8 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
                                    CORBA::Long           theShapeType);
 
   GEOM::ListOfGO* GetSharedShapesMulti (const GEOM::ListOfGO& theShapes,
-                                        CORBA::Long           theShapeType);
+                                        CORBA::Long           theShapeType,
+                                        CORBA::Boolean        theMultiShare);
 
   GEOM::ListOfGO* GetShapesOnPlane (GEOM::GEOM_Object_ptr theShape,
                                     CORBA::Long           theShapeType,
@@ -271,6 +285,27 @@ class GEOM_I_EXPORT GEOM_IShapesOperations_i :
   GEOM::ListOfLong* GetSameIDs  (GEOM::GEOM_Object_ptr theShapeWhere,
                                  GEOM::GEOM_Object_ptr theShapeWhat);
 
+  GEOM::GEOM_Object_ptr ExtendEdge(GEOM::GEOM_Object_ptr theEdge,
+                                   CORBA::Double         theMin,
+                                   CORBA::Double         theMax);
+
+  GEOM::GEOM_Object_ptr ExtendFace(GEOM::GEOM_Object_ptr theFace,
+                                   CORBA::Double         theUMin,
+                                   CORBA::Double         theUMax,
+                                   CORBA::Double         theVMin,
+                                   CORBA::Double         theVMax);
+
+  GEOM::GEOM_Object_ptr MakeSurfaceFromFace(GEOM::GEOM_Object_ptr theFace);
+
+  GEOM::ListOfGO* GetSubShapeEdgeSorted (GEOM::GEOM_Object_ptr theShape,
+                                         GEOM::GEOM_Object_ptr theStartPoint);
+
+  GEOM::ListOfGO* GetSubShapesWithTolerance
+                     (GEOM::GEOM_Object_ptr      theShape,
+                      CORBA::Short               theShapeType,
+                      GEOM::comparison_condition theCondition,
+                      CORBA::Double              theTolerance);
+
   ::GEOMImpl_IShapesOperations* GetOperations()
   { return (::GEOMImpl_IShapesOperations*)GetImpl(); }
 };
index ef3b9a4523f830ab5f89c5746622b0be4f2b957f..fbfe591f11d6f21f3a96c2bb0a93c95901977937 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -1392,3 +1392,38 @@ GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::RecomputeObject
 
   return aGEOMObject._retn();
 }
+
+//=============================================================================
+/*!
+ *  MakeProjectionOnCylinder
+ */
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_ITransformOperations_i::MakeProjectionOnCylinder
+                                   (GEOM::GEOM_Object_ptr theObject,
+                                    CORBA::Double         theRadius,
+                                    CORBA::Double         theStartAngle,
+                                    CORBA::Double         theAngleLength,
+                                    CORBA::Double         theAngleRotation)
+{
+  GEOM::GEOM_Object_var aGEOMObject;
+
+  //Set a not done flag
+  GetOperations()->SetNotDone();
+
+  //Get the object
+  Handle(GEOM_Object) anObject = GetObjectImpl(theObject);
+
+  if (anObject.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  //Perform the transformation
+  Handle(GEOM_Object) aResObject = GetOperations()->MakeProjectionOnCylinder
+    (anObject, theRadius, theStartAngle, theAngleLength, theAngleRotation);
+
+  if (!GetOperations()->IsDone() || aResObject.IsNull()) {
+    return aGEOMObject._retn();
+  }
+
+  return GetObject(aResObject);
+}
index 161998059eef217033e683af1ada0d3ead12f751..96aa0c23df71ec0280c5e182c0928c68a669608c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -197,6 +197,12 @@ class GEOM_I_EXPORT GEOM_ITransformOperations_i :
 
   GEOM::GEOM_Object_ptr RecomputeObject (GEOM::GEOM_Object_ptr theObject);
 
+  GEOM::GEOM_Object_ptr MakeProjectionOnCylinder
+                                   (GEOM::GEOM_Object_ptr theObject,
+                                    CORBA::Double         theRadius,
+                                    CORBA::Double         theStartAngle,
+                                    CORBA::Double         theAngleLength,
+                                    CORBA::Double         theAngleRotation);
 
   ::GEOMImpl_ITransformOperations* GetOperations() { return (::GEOMImpl_ITransformOperations*)GetImpl(); }
 };
index 54e5c458d28ab550dd224dbd783b89e8cd16ce22..f30746298fe0696e2d096a213da781dea2da30c5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -36,6 +36,7 @@
 #include <TCollection_AsciiString.hxx>
 #include <TDF_Label.hxx>
 #include <TDF_Tool.hxx>
+#include <TDataStd_ListIteratorOfListOfExtendedString.hxx>
 #include <TopAbs.hxx>
 #include <TopoDS_Iterator.hxx>
 
@@ -158,6 +159,47 @@ GEOM::shape_type GEOM_Object_i::GetMaxShapeType()
   return getMinMaxShapeType( _impl->GetValue(), false );
 }
 
+//================================================================================
+/*!
+ * GetSubShapeName
+ */
+//================================================================================
+
+char* GEOM_Object_i::GetSubShapeName(CORBA::Long subID)
+{
+  CORBA::String_var name("");
+
+  Handle(GEOM_Function) aMainFun = _impl->GetLastFunction();
+  if ( aMainFun.IsNull() ) return name._retn();
+
+  const TDataStd_ListOfExtendedString& aListEntries = aMainFun->GetSubShapeReferences();
+  TDataStd_ListIteratorOfListOfExtendedString anIt( aListEntries );
+  for (; anIt.More(); anIt.Next())
+  {
+    TCollection_AsciiString anEntry = anIt.Value();
+    Handle(GEOM_BaseObject) anObj =
+      GEOM_Engine::GetEngine()->GetObject( _impl->GetDocID(), anEntry.ToCString(), false );
+    if ( anObj.IsNull() ) continue;
+
+    TCollection_AsciiString aSubName = anObj->GetName();
+    if ( aSubName.IsEmpty() ) continue;
+
+    Handle(GEOM_Function) aFun = anObj->GetLastFunction();
+    if ( aFun.IsNull() ) continue;
+  
+    GEOM_ISubShape ISS( aFun );
+    Handle(TColStd_HArray1OfInteger) subIDs = ISS.GetIndices();
+    if ( subIDs.IsNull() || subIDs->Length() != 1 ) continue;
+
+    if ( subIDs->Value( subIDs->Lower() ) == subID )
+    {
+      name = aSubName.ToCString();
+      break;
+    }
+  }
+  return name._retn();
+}
+
 //=============================================================================
 /*!
  *  SetColor
@@ -364,15 +406,20 @@ bool GEOM_Object_i::IsShape()
   return !_impl->GetValue().IsNull() && _impl->GetType() != GEOM_MARKER;
 }
 
-bool GEOM_Object_i::IsSame(GEOM::GEOM_Object_ptr other)
+bool GEOM_Object_i::IsSame(GEOM::GEOM_BaseObject_ptr other)
 {
-  TopoDS_Shape thisShape  = _impl->GetValue();
-  TopoDS_Shape otherShape;
-  if ( !CORBA::is_nil( other ) ) {
+  bool result = false;
+
+  GEOM::GEOM_Object_var shapePtr = GEOM::GEOM_Object::_narrow( other );
+  if ( !CORBA::is_nil( shapePtr ) ) {
+    CORBA::String_var entry = shapePtr->GetEntry();
     Handle(GEOM_Object) otherObject = Handle(GEOM_Object)::DownCast
-      ( GEOM_Engine::GetEngine()->GetObject( other->GetStudyID(), other->GetEntry(), false ));
-    if ( !otherObject.IsNull() )
-      otherShape = otherObject->GetValue();
+      ( GEOM_Engine::GetEngine()->GetObject( shapePtr->GetStudyID(), entry, false ));
+    if ( !otherObject.IsNull() ) {
+      TopoDS_Shape thisShape  = _impl->GetValue();
+      TopoDS_Shape otherShape = otherObject->GetValue();
+      result = !thisShape.IsNull() && !otherShape.IsNull() && thisShape.IsSame( otherShape );
+    }
   }
-  return thisShape.IsSame( otherShape );
+  return result;
 }
index da7f035edec011d7aefcd2b5efe1dd2e95464aa2..92fca036e92f6c0b3b6859b130516132e3fe8a23 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -47,6 +47,8 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public
 
   virtual GEOM::shape_type GetMaxShapeType();
 
+  virtual char* GetSubShapeName(CORBA::Long subID);
+
   virtual void SetColor(const SALOMEDS::Color& theColor);
 
   virtual SALOMEDS::Color GetColor();
@@ -75,7 +77,7 @@ class GEOM_I_EXPORT GEOM_Object_i : public virtual POA_GEOM::GEOM_Object, public
 
   virtual GEOM::GEOM_Object_ptr GetMainShape();
 
-  virtual bool IsSame(GEOM::GEOM_Object_ptr other);
+  virtual bool IsSame(GEOM::GEOM_BaseObject_ptr other);
 
   virtual bool IsShape();
 
index d4d99f776079fbfb6101764a3b5dc6e5c3303d2b..4abb827c5e3f438fb97b2b0c79b6fc1bdf3ac839 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 0d5323d4d0e0a6e05351a2e36481be2195fa0a9f..fbf04c21c3f697c71af702b024e4e9ada396367e 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 42fbd6ec7d862ae7ddb1b3e33478f0fe271cdee8..fda87c8370d25fa959e3eead9603492d24b4e7a7 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 456f5759db54b2cfc706be4721c7d68ee03b5d4f..23e86f7d74fbdc5c6e4a69165bc48665261c6982 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 867a5c6f7cea632c19746847fad64ae03b00bc4a..662b2c76894adc3b0ed7a71bda8a0135934908eb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -722,7 +722,7 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePointOnCurve (GEOM::GEOM_Object_ptr the
   beginService( " GEOM_Superv_i::MakePointOnCurve" );
   MESSAGE("GEOM_Superv_i::MakePointOnCurve");
   getBasicOp();
-  GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePointOnCurve(theRefCurve, theParameter);
+  GEOM::GEOM_Object_ptr anObj = myBasicOp->MakePointOnCurve(theRefCurve, theParameter, false);
   endService( " GEOM_Superv_i::MakePointOnCurve" );
   return anObj;
 }
@@ -1403,9 +1403,9 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipe (GEOM::GEOM_Object_ptr theBase,
   beginService( " GEOM_Superv_i::MakePipe" );
   MESSAGE("GEOM_Superv_i::MakePipe");
   get3DPrimOp();
-  GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePipe(theBase, thePath);
+  GEOM::ListOfGO_var aList = my3DPrimOp->MakePipe(theBase, thePath, false);
   endService( " GEOM_Superv_i::MakePipe" );
-  return anObj;
+  return aList[0];
 }
 
 //=============================================================================
@@ -1453,8 +1453,11 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFilling (GEOM::GEOM_Object_ptr theShape
   beginService( " GEOM_Superv_i::MakeFilling" );
   MESSAGE("GEOM_Superv_i::MakeFilling");
   get3DPrimOp();
+  GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+  objList->length( 1 );
+  objList[0] = theShape;
   GEOM::GEOM_Object_ptr anObj =
-    my3DPrimOp->MakeFilling(theShape, theMinDeg, theMaxDeg, theTol2D, theTol3D,
+    my3DPrimOp->MakeFilling(objList, theMinDeg, theMaxDeg, theTol2D, theTol3D,
                             theNbIter, theMethod, theApprox);
   endService( " GEOM_Superv_i::MakeFilling" );
   return anObj;
@@ -1509,9 +1512,9 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeWithDifferentSections
   beginService( " GEOM_Superv_i::MakePipeWithDifferentSections" );
   MESSAGE("GEOM_Superv_i::MakePipeWithDifferentSections");
   get3DPrimOp();
-  GEOM::GEOM_Object_ptr anObj = my3DPrimOp->MakePipeWithDifferentSections(theBases,theLocations, thePath,theWithContact,theWithCorrections);
+  GEOM::ListOfGO_var aList = my3DPrimOp->MakePipeWithDifferentSections(theBases,theLocations, thePath,theWithContact,theWithCorrections, false, false);
   endService( " GEOM_Superv_i::MakePipeWithDifferentSections" );
-  return anObj;
+  return aList[0];
 }
 
 
@@ -1529,12 +1532,13 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeWithShellSections
   beginService( " GEOM_Superv_i::MakePipeWithShellSections" );
   MESSAGE("GEOM_Superv_i::MakePipeWithShellSections");
   get3DPrimOp();
-  GEOM::GEOM_Object_ptr anObj =
+  GEOM::ListOfGO_var aList =
     my3DPrimOp->MakePipeWithShellSections(theBases, theSubBases,
                                           theLocations, thePath,
-                                          theWithContact, theWithCorrections);
+                                          theWithContact, theWithCorrections,
+                                          false);
   endService( " GEOM_Superv_i::MakePipeWithShellSections" );
-  return anObj;
+  return aList[0];
 }
 
 
@@ -1548,10 +1552,10 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeShellsWithoutPath
   beginService( " GEOM_Superv_i::MakePipeShellsWithoutPath" );
   MESSAGE("GEOM_Superv_i::MakePipeShellsWithoutPath");
   get3DPrimOp();
-  GEOM::GEOM_Object_ptr anObj =
-    my3DPrimOp->MakePipeShellsWithoutPath(theBases,theLocations);
+  GEOM::ListOfGO_var aList =
+    my3DPrimOp->MakePipeShellsWithoutPath(theBases,theLocations, false);
   endService( " GEOM_Superv_i::MakePipeShellsWithoutPath" );
-  return anObj;
+  return aList[0];
 }
 
 
@@ -1566,10 +1570,10 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakePipeBiNormalAlongVector
   beginService( " GEOM_Superv_i::MakePipeBiNormalAlongVector" );
   MESSAGE("GEOM_Superv_i::MakePipeBiNormalAlongVector");
   get3DPrimOp();
-  GEOM::GEOM_Object_ptr anObj =
-    my3DPrimOp->MakePipeBiNormalAlongVector(theBase, thePath, theVec);
+  GEOM::ListOfGO_var aList =
+    my3DPrimOp->MakePipeBiNormalAlongVector(theBase, thePath, theVec, false);
   endService( " GEOM_Superv_i::MakePipeBiNormalAlongVector" );
-  return anObj;
+  return aList[0];
 }
 
 
@@ -2271,6 +2275,24 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceWires (GEOM::GEOM_List_ptr theWires
   return NULL;
 }
 
+//=============================================================================
+//  MakeFaceWithConstraints:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeFaceWithConstraints (GEOM::GEOM_List_ptr theConstraints)
+{
+  beginService( " GEOM_Superv_i::MakeFaceWithConstraints" );
+  MESSAGE("GEOM_Superv_i::MakeFaceWithConstraints");
+  if (GEOM_List_i<GEOM::ListOfGO>* aConstraints =
+      dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theConstraints, myPOA).in())) {
+    getShapesOp();
+    GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeFaceWithConstraints(aConstraints->GetList());
+    endService( " GEOM_Superv_i::MakeFaceWithConstraints" );
+    return anObj;
+  }
+  endService( " GEOM_Superv_i::MakeFaceWithConstraints" );
+  return NULL;
+}
+
 //=============================================================================
 //  MakeShell:
 //=============================================================================
@@ -2338,6 +2360,25 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeCompound (GEOM::GEOM_List_ptr theShapes
   return NULL;
 }
 
+//=============================================================================
+//  MakeSolidFromConnectedFaces:
+//=============================================================================
+GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeSolidFromConnectedFaces (GEOM::GEOM_List_ptr theFacesOrShells,
+                                                                  CORBA::Boolean isIntersect)
+{
+  beginService( " GEOM_Superv_i::MakeSolidFromConnectedFaces" );
+  MESSAGE("GEOM_Superv_i::MakeSolidFromConnectedFaces");
+  if (GEOM_List_i<GEOM::ListOfGO>* aListImpl =
+      dynamic_cast<GEOM_List_i<GEOM::ListOfGO>*>(GetServant(theFacesOrShells, myPOA).in())) {
+    getShapesOp();
+    GEOM::GEOM_Object_ptr anObj = myShapesOp->MakeSolidFromConnectedFaces(aListImpl->GetList(), isIntersect);
+    endService( " GEOM_Superv_i::MakeSolidFromConnectedFaces" );
+    return anObj;
+  }
+  endService( " GEOM_Superv_i::MakeSolidFromConnectedFaces" );
+  return NULL;
+}
+
 //=============================================================================
 //  MakeGlueFaces:
 //=============================================================================
@@ -2348,8 +2389,11 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFaces (GEOM::GEOM_Object_ptr theSha
   beginService( " GEOM_Superv_i::MakeGlueFaces" );
   MESSAGE("GEOM_Superv_i::MakeGlueFaces");
   getShapesOp();
+  GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+  objList->length( 1 );
+  objList[0] = theShape;
   GEOM::GEOM_Object_ptr anObj =
-    myShapesOp->MakeGlueFaces(theShape, theTolerance, doKeepNonSolids);
+    myShapesOp->MakeGlueFaces(objList, theTolerance, doKeepNonSolids);
   endService( " GEOM_Superv_i::MakeGlueFaces" );
   return anObj;
 }
@@ -2363,7 +2407,10 @@ GEOM::GEOM_List_ptr GEOM_Superv_i::GetGlueFaces (GEOM::GEOM_Object_ptr theShape,
   beginService( " GEOM_Superv_i::GetGlueFaces" );
   MESSAGE("GEOM_Superv_i::GetGlueFaces");
   getShapesOp();
-  GEOM::ListOfGO* aList = myShapesOp->GetGlueFaces(theShape, theTolerance);
+  GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+  objList->length( 1 );
+  objList[0] = theShape;
+  GEOM::ListOfGO* aList = myShapesOp->GetGlueFaces(objList, theTolerance);
   GEOM_List_i<GEOM::ListOfGO>* aListPtr = new GEOM_List_i<GEOM::ListOfGO>(*(aList));
   MESSAGE(" List of "<<aListPtr->GetList().length()<<" element(s)");
   endService( " GEOM_Superv_i::GetGlueFaces" );
@@ -2382,8 +2429,11 @@ GEOM::GEOM_Object_ptr GEOM_Superv_i::MakeGlueFacesByList (GEOM::GEOM_Object_ptr
   beginService( " GEOM_Superv_i::MakeGlueFacesByList" );
   MESSAGE("GEOM_Superv_i::MakeGlueFacesByList");
   getShapesOp();
+  GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+  objList->length( 1 );
+  objList[0] = theShape;
   GEOM::GEOM_Object_ptr anObj =
-    myShapesOp->MakeGlueFacesByList(theShape, theTolerance, theFaces,
+    myShapesOp->MakeGlueFacesByList(objList, theTolerance, theFaces,
                                     doKeepNonSolids, doGlueAllEdges);
   endService( " GEOM_Superv_i::MakeGlueFacesByList" );
   return anObj;
@@ -2713,7 +2763,7 @@ CORBA::Boolean GEOM_Superv_i::CheckCompoundOfBlocks
   beginService( " GEOM_Superv_i::CheckCompoundOfBlocks" );
   MESSAGE("GEOM_Superv_i::CheckCompoundOfBlocks");
   getBlocksOp();
-  CORBA::Boolean aRes = myBlocksOp->CheckCompoundOfBlocks(theCompound, theErrors);
+  CORBA::Boolean aRes = myBlocksOp->CheckCompoundOfBlocks(theCompound, -1., theErrors);
   endService( " GEOM_Superv_i::CheckCompoundOfBlocks" );
   return aRes;
 }
@@ -3513,7 +3563,10 @@ void GEOM_Superv_i::ExportSTEP( GEOM::GEOM_Object_ptr theObject,
   beginService( " GEOM_Superv_i::ExportSTEP" );
   MESSAGE("GEOM_Superv_i::ExportSTEP");
   getSTEPPluginOp();
-  mySTEPOp->ExportSTEP( theObject, theFileName );
+
+  const GEOM::length_unit aUnit = GEOM::LU_METER;
+
+  mySTEPOp->ExportSTEP( theObject, theFileName, aUnit );
   endService( " GEOM_Superv_i::ExportSTEP" );
 }
 
index f33f4f8bb559de2a746bd1733e9e7e541ff0607f..513e22621c95f3eabce94a00458fca04e99864cc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -503,10 +503,13 @@ public:
                                   CORBA::Boolean isPlanarWanted);
   GEOM::GEOM_Object_ptr MakeFaceWires (GEOM::GEOM_List_ptr theWires,
                                        CORBA::Boolean isPlanarWanted);
+  GEOM::GEOM_Object_ptr MakeFaceWithConstraints (GEOM::GEOM_List_ptr theConstraints);
   GEOM::GEOM_Object_ptr MakeShell (GEOM::GEOM_List_ptr theFacesAndShells);
   GEOM::GEOM_Object_ptr MakeSolidShell (GEOM::GEOM_Object_ptr theShell);
   GEOM::GEOM_Object_ptr MakeSolidShells (GEOM::GEOM_List_ptr theShells);
   GEOM::GEOM_Object_ptr MakeCompound (GEOM::GEOM_List_ptr theShapes);
+  GEOM::GEOM_Object_ptr MakeSolidFromConnectedFaces (GEOM::GEOM_List_ptr theFacesOrShells,
+                                                     CORBA::Boolean isIntersect);
   GEOM::GEOM_Object_ptr MakeGlueFaces (GEOM::GEOM_Object_ptr theShape,
                                        CORBA::Double theTolerance,
                                        CORBA::Boolean doKeepNonSolids);
@@ -534,7 +537,6 @@ public:
                                           CORBA::Short theShapeType,
                                           GEOM::shape_state theState);
 
-
   //-----------------------------------------------------------//
   // BlocksOperations                                          //
   //-----------------------------------------------------------//
index 3b68d34e5f3eb8b81c843b82597903cb096dc5bd..871e4a6bcbe1e4c4f1d38e7d27331c5e72f33d58 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 15f17316db8c23835c7ff096ef3fcd4c5dae8036..f20bac99e397e4007101c48e886f886ebb2a981f 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 #
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 0e5adbba559f820f25981b648202aa46b2bb5dad..a626dd589ba90c44a0c635a445245f004904a294 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index c301962e0fde801ec87d1fc53e5ca3a1708bd016..0ca785f88d9bd5d13fbbe119319218679c80dc54 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: iso-8859-1 -*-
 #
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 2e820e94e1910134f697d037e8a06f0081a50c9d..31886978433fb74c6c8923100e6aded2c0a3d72a 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index d0a3fc4d57c8eeb5631c190bc8fcfca118c02914..9fb94137638749e1f297f7057d8df96dba89a766 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -109,6 +109,8 @@ from salome.geom.geomtools import getGeompy
 from salome.geom.structelem import parts
 from salome.geom.structelem.parts import InvalidParameterError
 
+import GEOM
+
 ## This class manages the structural elements in the study. It is used to
 #  create a new structural element from a list of commands. The parameter
 #  \em studyId defines the ID of the study in which the manager will create
index 18978b923f7893ddcb0764348c8694244395b0f4..460e2e39e2c1daed9059e0c8b325493b9d2044ae 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index d697210f92871cd0aa73baab3c8c0045ff77e69b..ae1e59d0f6f205947937b8dceba306f5495861b8 100644 (file)
@@ -1,6 +1,6 @@
 # -*- coding: utf-8 -*-
 #
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -361,7 +361,8 @@ class Beam(StructuralElementPart):
         face2 = self.geom.MakeFace(wire2, True)
         shell = self.geom.MakePipeWithDifferentSections([wire1, wire2],
                                                         [point1, point2],
-                                                        path, False, False)
+                                                        path, False, False,
+                                                        False)
         closedShell = self.geom.MakeShell([face1, face2, shell])
         solid = self.geom.MakeSolid([closedShell])
         return solid
@@ -790,13 +791,10 @@ class StructuralElementPart2D(StructuralElementPart):
                                           self.geom.ShapeType["FACE"])
             for face in faces:
                 offsetFace = self._makeFaceOffset(face, offset)
-                # get tangent plane on surface by parameters
+                # get the center of the face and the normal at the center
                 center = self.geom.MakeVertexOnSurface(offsetFace,
                                                        uParam, vParam)
-                tangPlane = self.geom.MakeTangentPlaneOnFace(offsetFace,
-                                                             uParam, vParam,
-                                                             1.0)
-                normal = self.geom.GetNormal(tangPlane)
+                normal = self.geom.GetNormal(offsetFace, center)
                 marker = self._orientation.buildMarker(self.geom,
                                                        center, normal)
                 listMarkers.append(marker)
index 4c9b16dbfd387a7f7d57b975c959bec2f9acff3f..f3995fe8a05f235b39ccdba9d0a36bbf3445dd72 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index edaba77a0e7ebe944c1f771e3d3eeafc40952c8f..7f8ebc4da3254d12dd1160574510cfd60c98611e 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 02af16cdf4e8cf0b2313456579e65e22c9427bbf..d96d97f440201cd7ea9ce41266fabc517ab04ba0 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 23298d36829b1aa9991ff5b6eb2657d5a39ba3da..219c3bfc0176671212ee325b3d595d806cf74840 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
@@ -75,10 +75,10 @@ Fillet_1 = geompy.MakeFillet(Common_1, 10, geompy.ShapeType["EDGE"], [5])
 geompy.addToStudy(Fillet_1, "Fillet_1")
 
 #Chamfer applying
-Chamfer_1 = geompy.MakeChamferEdge(Fillet_1, 10, 10, 16, 50 )
+Chamfer_1 = geompy.MakeChamferEdge(Fillet_1, 10, 10, 15, 49 )
 geompy.addToStudy(Chamfer_1, "Chamfer_1")
 
-Chamfer_2 = geompy.MakeChamferEdge(Chamfer_1, 10, 10, 21, 31 )
+Chamfer_2 = geompy.MakeChamferEdge(Chamfer_1, 10, 10, 20, 30 )
 geompy.addToStudy(Chamfer_2, "Chamfer_2")
 
 #Import of the shape from "slots.brep"
index f34e86601d16b0f6f4757f5e131b7b2d964a1a7e..7149d9fd412e33fa48b89605dd9468368b8b92dd 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index db06b06992f2c3b35fb1ecc596a1659eb08989b9..d6450e78d7bfddeeb4b199a3843904a0bf4a514d 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 580e038bbe940ce6d1960d49c2b9b6bce989ef0a..e9dc7a4ad49e63da1e9618cc511a60773c79a67c 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index bfddc1190130c17c53672c8a6106b4bb0082c381..b0e85c9721423ea7fbbee8c60ce5e5d717d620a6 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 72b2997a4e639d8e38c55b63a5770bd349827a10..9e5c6295484bebbb09e8672ffe7a47b884645915 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 5f1a5a2e2b132f1537ed18c1612392d8d99728ce..4ac015c6848e46b2aa363660a1dbee3b39f6d9c1 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 41aa3567d2dd44c891065fa1fa59d80d08742764..a6e5fd59ba1e4ea0488d6c33544ec6ce1d41cd9b 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 9d4b8bae5e652e3a8c10b083b64eae51dccb9215..8d7a0189d540e93ab64e09af1f8d19df5382bf46 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
@@ -36,10 +36,6 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
 
   th = 4.0
 
-  ### BlocksOp ###
-
-  BlocksOp = geompy.BlocksOp
-
   ### Basic points and directions ###
 
   p0  = geompy.MakeVertex(0., 0., 0.)
@@ -279,17 +275,21 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
   Face22h = geompy.GetOppositeFace(Block2h, Face21h)
   id_face22h = geompy.addToStudyInFather(Block2h, Face22h, "Face 2")
 
-  Block3h = BlocksOp.GetBlockByParts(Handle, [Face11h, Face21h])
-  if BlocksOp.IsDone() == 0:
-    Block3h = BlocksOp.GetBlockByParts(Handle, [Face11h, Face22h])
-    if BlocksOp.IsDone() == 0:
-        Block3h = BlocksOp.GetBlockByParts(Handle, [Face12h, Face21h])
-        if BlocksOp.IsDone() == 0:
-            Block3h = BlocksOp.GetBlockByParts(Handle, [Face12h, Face22h])
-  if BlocksOp.IsDone() == 0:
-    print "ERROR: BlocksOp.GetBlockByParts() failed : ", BlocksOp.GetErrorCode()
-  else:
-    id_block3h = geompy.addToStudyInFather(Handle, Block3h, "Block 3 of Handle")
+  try:
+    Block3h = geompy.GetBlockByParts(Handle, [Face11h, Face21h])
+  except RuntimeError:
+    try:
+      Block3h = geompy.GetBlockByParts(Handle, [Face11h, Face22h])
+    except RuntimeError:
+      try:
+        Block3h = geompy.GetBlockByParts(Handle, [Face12h, Face21h])
+      except RuntimeError:
+        try:
+          Block3h = geompy.GetBlockByParts(Handle, [Face12h, Face22h])
+        except RuntimeError:
+          print "ERROR: BlocksOp.GetBlockByParts() failed : ", geompy.BlocksOp.GetErrorCode()
+        else:
+          id_block3h = geompy.addToStudyInFather(Handle, Block3h, "Block 3 of Handle")
 
   ### The whole shape ###
 
@@ -299,7 +299,7 @@ def MakeSpanner (geompy, math, isBlocksTest = 0, isMeshTest = 0, smesh = None):
 
   ### Check the Spanner ###
 
-  isCompOfBlocks6 = BlocksOp.CheckCompoundOfBlocks(Spanner)
+  isCompOfBlocks6 = geompy.CheckCompoundOfBlocks(Spanner)
   if isCompOfBlocks6 == 0:
     print "Spanner is not a compound of hexahedral solids"
     (NonBlocks, NonQuads) = geompy.GetNonBlocks(Spanner)
index b644c196b34bb146ac510209e1f4c5d7f2ae62e3..ea862293f2ab957bf8dfbef186691895e3e96ed7 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
@@ -178,6 +178,13 @@ def TestAll (geompy, math):
   Face2    = geompy.MakeFace(Sketcher, WantPlanarFace)
   Face3    = geompy.MakeFaceHW (100., 200., 1)       #(2 Doubles, 1 Int)->GEOM_Object
   Face4    = geompy.MakeFaceObjHW (vz, 200., 100.)   #(1 GEOM_Object, 2 Doubles)->GEOM_Object
+  Face5    = geompy.MakeFaceFromSurface(Face, Sketcher) #(2 GEOM_Objects)->GEOM_Object
+  
+  Cut2 = geompy.MakeCutList(Sphere1, [Box1], True)
+  #(List of GEOM_Object)->GEOM_Object
+  Face6 = geompy.MakeFaceWithConstraints([geompy.GetSubShape(Cut2, [5]),  geompy.GetSubShape(Cut2, [3]), 
+                                          geompy.GetSubShape(Cut2, [11]), geompy.GetSubShape(Cut2, [3]),
+                                          geompy.GetSubShape(Cut2, [13]), geompy.GetSubShape(Cut2, [3])])
   Disk     = geompy.MakeDiskPntVecR (p0, vz, radius) #(2 GEOM_Object, 1 Double)->GEOM_Object
   Disk2    = geompy.MakeDiskThreePnt(p0, p200, pz)   #(3 GEOM_Object)->GEOM_Object
   Disk3    = geompy.MakeDiskR(100., 1)               #(1 Doubles, 1 Int)->GEOM_Object
@@ -189,7 +196,13 @@ def TestAll (geompy, math):
                                prism1_faces[3], prism1_faces[4],
                                prism1_faces[5], prism1_faces[2]])
   Solid    = geompy.MakeSolid([Shell1])              #(List of GEOM_Object)->GEOM_Object
-
+  
+  Box1_translation = geompy.MakeTranslation(Box1, 10, 0, 0)
+  Box1_shell = geompy.SubShapeAllSorted(Box1, geompy.ShapeType["SHELL"])[0]
+  Box1_translation_shell = geompy.SubShapeAllSorted(Box1_translation, geompy.ShapeType["SHELL"])[0]
+  
+  Solid_from_shells = geompy.MakeSolidFromConnectedFaces([Box1_shell, Box1_translation_shell], 1) #(List of GEOM_Object, Boolean)->GEOM_Object
+  
   # Create Isoline
   Isoline = geompy.MakeIsoline(Face1, True, 0.5)     #(1 GEOM_Object, Boolean, Double)->GEOM_Object
 
@@ -216,7 +229,6 @@ def TestAll (geompy, math):
   Line3 = geompy.MakeLineTwoFaces(prism1_faces[0], prism1_faces[1]) #(2 GEOM_Object)->GEOM_Object
 
   #Create advanced objects
-  Copy             = geompy.MakeCopy(Box)                      #(GEOM_Object)->GEOM_Object
   Prism            = geompy.MakePrismVecH(Face, vz, 100.0)     #(2 GEOM_Object, Double)->GEOM_Object
   Prism2Ways       = geompy.MakePrismVecH2Ways(Face, vz, 10.0) #(2 GEOM_Object, Double)->GEOM_Object
   PrismTwoPnt      = geompy.MakePrism(Face2, p0, pxyz)         #(3 GEOM_Object)->GEOM_Object
@@ -229,6 +241,13 @@ def TestAll (geompy, math):
                                         tol2d, tol3d, nbiter)  #(GEOM_Object, 4 Doubles, Short)->GEOM_Object
   Pipe             = geompy.MakePipe(Wire, Edge)               #(2 GEOM_Object)->GEOM_Object
   Sewing           = geompy.MakeSewing([Face, S], precision)   #(List Of GEOM_Object, Double)->GEOM_Object
+  ThickSolid       = geompy.MakeCopy(Box)
+  faces            = geompy.SubShapeAllSortedCentres(Box, geompy.ShapeType["FACE"])
+  shell            = geompy.MakeShell([faces[0], faces[1], faces[2]])
+  faceIDs          = geompy.SubShapeAllSortedCentresIDs(ThickSolid, geompy.ShapeType["FACE"])
+  ThickShell       = geompy.MakeThickSolid(shell, 50)          #(GEOM_Object, Double)->GEOM_Object
+  geompy.Thicken(ThickSolid, 50, [faceIDs[0], faceIDs[1]])     #(GEOM_Object) modification
+  Copy             = geompy.MakeCopy(Box)                      #(GEOM_Object)->GEOM_Object
 
   #Transform objects
   Translation = geompy.MakeTranslationTwoPoints(Box, px, pz)    #(3 GEOM_Object)->GEOM_Object
@@ -252,8 +271,12 @@ def TestAll (geompy, math):
   Position    = geompy.MakePosition(Box, cs1, cs2)   #(3 GEOM_Object)->GEOM_Object
   Position2   = geompy.PositionAlongPath(Box, Arc, 0.5, 1, 0)  #(2 GEOM_Object, 1 Double, 2 Bool)->GEOM_Object
   Offset      = geompy.MakeOffset(Box, 10.)          #(GEOM_Object, Double)->GEOM_Object
-  Orientation = geompy.ChangeOrientation(Box)
   ProjOnWire  = geompy.MakeProjectionOnWire(p0, Wire)
+  ProjOnCyl   = geompy.MakeProjectionOnCylinder(Wire, 100)
+  Orientation = geompy.ChangeOrientation(Box)
+  ExtEdge     = geompy.ExtendEdge(Edge1, -0.3, 1.3)
+  ExtFace     = geompy.ExtendFace(Face5, -0.3, 1.3, -0.1, 1.1)
+  Surface     = geompy.MakeSurfaceFromFace(Face5)
 
   #IDList for Fillet/Chamfer
   prism_edges = geompy.ExtractShapes(Prism, geompy.ShapeType["EDGE"], True)
@@ -386,6 +409,7 @@ def TestAll (geompy, math):
 
   id_Common  = geompy.addToStudy(Common,  "Common")
   id_Cut     = geompy.addToStudy(Cut,     "Cut")
+  id_Cut2    = geompy.addToStudy(Cut2,    "Cut2")
   id_Fuse    = geompy.addToStudy(Fuse,    "Fuse")
   id_Section = geompy.addToStudy(Section, "Section")
 
@@ -397,6 +421,8 @@ def TestAll (geompy, math):
   id_Face2    = geompy.addToStudy(Face2,    "Face from Sketcher")
   id_Face3    = geompy.addToStudy(Face3,    "Face Height Width")
   id_Face4    = geompy.addToStudy(Face4,    "Face Plane_HW")
+  id_Face5    = geompy.addToStudy(Face5,    "Face from surface and wire")
+  id_Face6    = geompy.addToStudy(Face6,    "Face from edges with constraints")
   id_Disk     = geompy.addToStudy(Disk,     "Disk PntVecR")
   id_Disk2    = geompy.addToStudy(Disk2,    "Disk Three Points")
   id_Disk3    = geompy.addToStudy(Disk3,    "Disk OXY Radius")
@@ -411,11 +437,16 @@ def TestAll (geompy, math):
   id_Prism1   = geompy.addToStudy(Prism1,     "Prism by Two Pnt")
   id_Shell1   = geompy.addToStudy(Shell1,   "Shell from Prism1 faces")
   id_Solid    = geompy.addToStudy(Solid,    "Solid")
+  id_Solid1   = geompy.addToStudy(Solid_from_shells,   "Solid1")
+  
   id_Compound = geompy.addToStudy(Compound, "Compound")
 
   id_Plane2   = geompy.addToStudy(Plane2,   "Plane on Face")
 
   id_Copy       = geompy.addToStudy(Copy,       "Copy")
+  id_ThickShell = geompy.addToStudy(ThickShell, "ThickShell")
+  id_ThickSolid = geompy.addToStudy(ThickSolid, "ThickSolid")
+
   id_Prism            = geompy.addToStudy(Prism,            "Prism")
   id_Prism2Ways       = geompy.addToStudy(Prism2Ways,       "Prism2Ways")
   id_PrismTwoPnt      = geompy.addToStudy(PrismTwoPnt,      "PrismTwoPnt")
@@ -467,6 +498,10 @@ def TestAll (geompy, math):
   id_Offset      = geompy.addToStudy(Offset,        "Offset")
   id_Orientation = geompy.addToStudy(Orientation,   "Orientation")
   id_ProjOnWire  = geompy.addToStudy(ProjOnWire[1], "ProjOnWire")
+  id_ProjOnCyl   = geompy.addToStudy(ProjOnCyl,     "ProjOnCyl")
+  id_ExtEdge     = geompy.addToStudy(ExtEdge,       "ExtendedEdge")
+  id_ExtFace     = geompy.addToStudy(ExtFace,       "ExtendedFace")
+  id_Surface     = geompy.addToStudy(Surface,       "Surface From Face")
 
   id_Fillet   = geompy.addToStudy(Fillet,   "Fillet")
   id_Fillet2  = geompy.addToStudy(Fillet2,  "Fillet2")
@@ -489,7 +524,7 @@ def TestAll (geompy, math):
 
   id_Partition  = geompy.addToStudy(Partition, "Partition")
   id_Partition1 = geompy.addToStudy(Partition1, "Half Partition")
-
+  
   #Decompose objects
 
   # SubShape
@@ -541,4 +576,19 @@ def TestAll (geompy, math):
   geompy.RestoreSubShapes(Partition, [Box])
   geompy.RestoreSubShapes(Partition1)
 
+  # GetSubShapeEdgeSorted
+  p1 = geompy.GetFirstVertex(Sketcher)
+  p2 = geompy.GetFirstVertex(Sketcher3d_1)
+  p3 = geompy.GetFirstVertex(Sketcher3d_2)
+  geompy.GetSubShapeEdgeSorted(Sketcher, p1, "OrderedEdges")
+  geompy.GetSubShapeEdgeSorted(Sketcher3d_1, p2, "OrderedEdges")
+  geompy.GetSubShapeEdgeSorted(Sketcher3d_2, p3, "OrderedEdges")
+
+  # GetSubShapesWithTolerance
+  geompy.GetSubShapesWithTolerance(Box, GEOM.FACE, GEOM.CC_GT, 1.e-8, "gt")
+  geompy.GetSubShapesWithTolerance(Box, GEOM.FACE, GEOM.CC_GE, 1.e-7, "ge")
+  geompy.GetSubShapesWithTolerance(Box, GEOM.FACE, GEOM.CC_LT, 2.e-7, "lt")
+  geompy.GetSubShapesWithTolerance(Box, GEOM.FACE, GEOM.CC_LE, 1.e-7, "le")
+
+
   print "DONE"
index a155398275fa82e75ffbc9692d38b57734dcd6a7..1200655def308f138b7358e4bae6e3fe4301d4c0 100644 (file)
@@ -1,23 +1,23 @@
- # Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
- #
- # 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
- #
- # Python API for field on geometry manipulations:
+# Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# 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
+#
+
+# Python API for field on geometry manipulations:
 
 # field          = geompy.CreateField(shape, name, type, dimension, componentNames)
 # geompy.RemoveField(field)
index d3d7af966267191d690f1dde7a6692bedd9948b1..e233fda6fb7e90320ed09fc31c41c972b0834a68 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
@@ -323,6 +323,12 @@ def TestDivideEdge (geompy):
   Id_Box    = geompy.addToStudy(Box, "Box")
   Id_Divide = geompy.addToStudy(Divide, "Box with Divided Edge")
 
+  # using geompy.DivideEdgeByPoint()
+  p    = geompy.MakeVertex( 30, -5, 10, theName="Point to project" )
+  edge = geompy.GetEdgeNearPoint( Box, p, theName="Edge to split")
+  div  = geompy.DivideEdgeByPoint( Box, edge, p, theName="Box (edge divided)")
+  assert geompy.NumberOfEdges( Box ) == geompy.NumberOfEdges( div ) - 1
+
 def TestFuseEdges (geompy):
 
   # create vertices
@@ -387,8 +393,133 @@ def TestRemoveWebs (geompy):
   Joined_1 = geompy.RemoveInternalFaces(Partition_1)
   geompy.addToStudy(Joined_1, 'Joined_1')
 
+def TestSewGluing(geompy):
+
+  import GEOM
+  box1 = geompy.MakeBox(0,0,0, 1,1,1)
+  box2 = geompy.MakeBox(1,0,0, 2,1,1)
+  comp = geompy.MakeCompound( [box1, box2] )
+
+  # no sewing with AllowNonManifold=False
+  sew1 = geompy.MakeSewing( [box1,box2], 1e-5, AllowNonManifold=False)
+  assert not sew1
+  sew2 = geompy.MakeSewing( comp, 1e-5, AllowNonManifold=False)
+  assert not sew2
+  sew3 = geompy.MakeSewing( [comp], 1e-5, AllowNonManifold=False)
+  assert not sew3
+  sew1 = geompy.Sew( [box1,box2], 1e-5, AllowNonManifold=False)
+  assert not sew1
+  sew2 = geompy.Sew( comp, 1e-5, AllowNonManifold=False)
+  assert not sew2
+  sew3 = geompy.Sew( [comp], 1e-5, AllowNonManifold=False)
+  assert not sew3
+
+  # check MakeSewing()
+  sew1 = geompy.MakeSewing( [box1,box2], 1e-5, AllowNonManifold=True)
+  assert sew1.GetShapeType() == GEOM.SHELL
+  assert geompy.NumberOfFaces( sew1 ) == geompy.NumberOfFaces( comp )
+  assert geompy.NumberOfEdges( sew1 ) == geompy.NumberOfEdges( comp ) - 4
+  sew2 = geompy.MakeSewing( comp, 1e-5, AllowNonManifold=True)
+  assert sew2.GetShapeType() == GEOM.SHELL
+  assert geompy.NumberOfFaces( sew2 ) == geompy.NumberOfFaces( comp )
+  assert geompy.NumberOfEdges( sew2 ) == geompy.NumberOfEdges( comp ) - 4
+  sew3 = geompy.MakeSewing( [comp], 1e-5, AllowNonManifold=True)
+  assert sew3.GetShapeType() == GEOM.SHELL
+  assert geompy.NumberOfFaces( sew3 ) == geompy.NumberOfFaces( comp )
+  assert geompy.NumberOfEdges( sew3 ) == geompy.NumberOfEdges( comp ) - 4
+  # check Sew()
+  sew1 = geompy.Sew( [box1,box2], 1e-5, AllowNonManifold=True)
+  assert sew1.GetShapeType() == GEOM.SHELL
+  assert geompy.NumberOfFaces( sew1 ) == geompy.NumberOfFaces( comp )
+  assert geompy.NumberOfEdges( sew1 ) == geompy.NumberOfEdges( comp ) - 4
+  sew2 = geompy.Sew( comp, 1e-5, AllowNonManifold=True)
+  assert sew2.GetShapeType() == GEOM.SHELL
+  assert geompy.NumberOfFaces( sew2 ) == geompy.NumberOfFaces( comp )
+  assert geompy.NumberOfEdges( sew2 ) == geompy.NumberOfEdges( comp ) - 4
+  sew3 = geompy.Sew( [comp], 1e-5, AllowNonManifold=True)
+  assert sew3.GetShapeType() == GEOM.SHELL
+  assert geompy.NumberOfFaces( sew3 ) == geompy.NumberOfFaces( comp )
+  assert geompy.NumberOfEdges( sew3 ) == geompy.NumberOfEdges( comp ) - 4
+
+  # check MakeGlueFaces()
+  glueF1 = geompy.MakeGlueFaces( [box1,box2], 1e-5)
+  assert glueF1.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfFaces( glueF1 ) == geompy.NumberOfFaces( comp ) - 1
+  assert geompy.NumberOfEdges( glueF1 ) == geompy.NumberOfEdges( comp ) - 4
+  glueF2 = geompy.MakeGlueFaces( [comp], 1e-5)
+  assert glueF2.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfFaces( glueF2 ) == geompy.NumberOfFaces( comp ) - 1
+  assert geompy.NumberOfEdges( glueF2 ) == geompy.NumberOfEdges( comp ) - 4
+  glueF3 = geompy.MakeGlueFaces( comp, 1e-5)
+  assert glueF3.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfFaces( glueF3 ) == geompy.NumberOfFaces( comp ) - 1
+  assert geompy.NumberOfEdges( glueF3 ) == geompy.NumberOfEdges( comp ) - 4
+
+  # check GetGlueFaces()
+  glueFF1 = geompy.GetGlueFaces( [box1,box2], 1e-5)
+  assert len( glueFF1 ) == 1 and glueFF1[0].GetShapeType() == GEOM.FACE
+  glueFF2 = geompy.GetGlueFaces( [comp], 1e-5)
+  assert len( glueFF2 ) == 1 and glueFF2[0].GetShapeType() == GEOM.FACE
+  glueFF3 = geompy.GetGlueFaces( comp, 1e-5)
+  assert len( glueFF3 ) == 1 and glueFF3[0].GetShapeType() == GEOM.FACE
+
+  #check MakeGlueFacesByList()
+  glueF1 = geompy.MakeGlueFacesByList( [box1,box2], 1e-5, glueFF1)
+  assert glueF1.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfFaces( glueF1 ) == geompy.NumberOfFaces( comp ) - 1
+  assert geompy.NumberOfEdges( glueF1 ) == geompy.NumberOfEdges( comp ) - 4
+  glueF2 = geompy.MakeGlueFacesByList( [comp], 1e-5, glueFF2)
+  assert glueF2.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfFaces( glueF2 ) == geompy.NumberOfFaces( comp ) - 1
+  assert geompy.NumberOfEdges( glueF2 ) == geompy.NumberOfEdges( comp ) - 4
+  glueF3 = geompy.MakeGlueFacesByList( comp, 1e-5, glueFF3 )
+  assert glueF3.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfFaces( glueF3 ) == geompy.NumberOfFaces( comp ) - 1
+  assert geompy.NumberOfEdges( glueF3 ) == geompy.NumberOfEdges( comp ) - 4
+
+  # check MakeGlueEdges()
+  glueE1 = geompy.MakeGlueEdges( [box1,box2], 1e-5)
+  assert glueE1.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfEdges( glueE1 ) == geompy.NumberOfEdges( comp ) - 4
+  glueE2 = geompy.MakeGlueEdges( [comp], 1e-5)
+  assert glueE2.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfEdges( glueE2 ) == geompy.NumberOfEdges( comp ) - 4
+  glueE3 = geompy.MakeGlueEdges( comp, 1e-5)
+  assert glueE3.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfEdges( glueE3 ) == geompy.NumberOfEdges( comp ) - 4
+
+  # check GetGlueEdges()
+  glueEE1 = geompy.GetGlueEdges( [box1,box2], 1e-5)
+  assert len( glueEE1 ) == 4 and glueEE1[0].GetShapeType() == GEOM.EDGE
+  glueEE2 = geompy.GetGlueEdges( [comp], 1e-5)
+  assert len( glueEE2 ) == 4 and glueEE2[0].GetShapeType() == GEOM.EDGE
+  glueEE3 = geompy.GetGlueEdges( comp, 1e-5)
+  assert len( glueEE3 ) == 4 and glueEE3[0].GetShapeType() == GEOM.EDGE
+
+  #check MakeGlueEdgesByList()
+  glueEL1 = geompy.MakeGlueEdgesByList( [box1,box2], 1e-5, glueEE1)
+  assert glueEL1.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfEdges( glueEL1 ) == geompy.NumberOfEdges( comp ) - 4
+  glueEL2 = geompy.MakeGlueEdgesByList( [comp], 1e-5, glueEE2)
+  assert glueEL2.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfEdges( glueEL2 ) == geompy.NumberOfEdges( comp ) - 4
+  glueEL3 = geompy.MakeGlueEdgesByList( comp, 1e-5, glueEE3 )
+  assert glueEL3.GetShapeType() == GEOM.COMPOUND
+  assert geompy.NumberOfEdges( glueEL3 ) == geompy.NumberOfEdges( comp ) - 4
+
+  # check GetSharedShapesMulti()
+  sharedEE = geompy.GetSharedShapesMulti( glueEL3, geompy.ShapeType["EDGE"])
+  assert len( sharedEE ) == 4
+  assert sharedEE[0].GetShapeType() == GEOM.EDGE
+  assert sharedEE[1].GetShapeType() == GEOM.EDGE
+  assert sharedEE[2].GetShapeType() == GEOM.EDGE
+  assert sharedEE[3].GetShapeType() == GEOM.EDGE
+
+  return
+
 def TestHealingOperations (geompy, math):
 
+  TestSewGluing(geompy)
   TestMakeSewing(geompy, math)
   TestDivideEdge(geompy)
   TestSuppressHoles(geompy)
index 2aed6d6a5a2c3c4bb7c1454883956a1998f7c126..7ad571552f9104b8b77ad2422c0a9cf514ac96cf 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
@@ -21,6 +21,8 @@
 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
 
+import salome_version
+
 def TestMeasureOperations (geompy, math):
 
   p0   = geompy.MakeVertex(0 ,  0,  0)
@@ -31,8 +33,12 @@ def TestMeasureOperations (geompy, math):
   p678 = geompy.MakeVertex(60, 70, 80)
   p789 = geompy.MakeVertex(70, 80, 90)
 
+  vz = geompy.MakeVectorDXDYDZ(0, 0, 1)
+
   cube = geompy.MakeBoxTwoPnt(p678, p789)
 
+  cylinder = geompy.MakeCylinder(p0, vz, 5, 70)
+
   ####### PointCoordinates #######
 
   Coords = geompy.PointCoordinates(p137)
@@ -50,12 +56,21 @@ def TestMeasureOperations (geompy, math):
 
   ####### Detect Self-intersections #######
 
-  [Face_1,Face_2] = geompy.SubShapes(box, [33, 23])
-  Translation_1 = geompy.MakeTranslation(Face_1, 5, -15, -40)
-  Compound_1 = geompy.MakeCompound([Face_2, Translation_1])
-  if geompy.CheckSelfIntersections(Compound_1) == True:
+  selfIntersected = geompy.MakeCompound([box, cylinder])
+  if geompy.CheckSelfIntersections(selfIntersected):
     raise RuntimeError, "Existing self-intersection is not detected"
 
+  ####### Detect Self-intersections fast #######
+
+  if salome_version.getXVersion() > "0x70600":
+    if geompy.CheckSelfIntersectionsFast(selfIntersected):
+      raise RuntimeError, "Existing self-intersection is not detected"
+
+  ####### Fast intersection #######
+
+  if not geompy.FastIntersect(box, cylinder)[0]:
+    raise RuntimeError, "Existing intersection is not detected"
+
   ####### WhatIs #######
 
   Descr = geompy.WhatIs(box)
index 2cb39a2bf9e298641dd69e8b34d6e4c1eead5716..62d1511ee47e0bdb31439d973eb75e83c67a1fdc 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
@@ -562,6 +562,18 @@ def TestOtherOperations (geompy, math):
     ind = ind + 1
     pass
 
+  # TransferData
+  path = os.getenv("DATA_DIR")
+  fileName = path + "/Shapes/Step/black_and_white.step"
+  blackWhite = geompy.ImportSTEP(fileName)
+  blackWhiteCopy = geompy.MakeCopy(blackWhite[0])
+  subBlackWhite = geompy.SubShapeAll(blackWhiteCopy, GEOM.SOLID)
+  geompy.TransferData(blackWhite[0], blackWhiteCopy)
+  geompy.addToStudy(blackWhite[0], "blackWhite")
+  geompy.addToStudy(blackWhiteCopy, "blackWhiteCopy")
+  geompy.addToStudyInFather( blackWhiteCopy, subBlackWhite[0], "" )
+  geompy.addToStudyInFather( blackWhiteCopy, subBlackWhite[1], "" )
+
   # CheckAndImprove
   blocksComp = geompy.CheckAndImprove(part)
 
index 5027e0a6199cf7a7d22660ee1c55b7ee7fcd393d..24182e349d0db860b7a100a6f408e4fe21fe844a 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 7b6cc26f2714aca9d8bed4323f0ff0744715476e..e95cbca9c196a8e70bbb039b158cc9def802de28 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 73312dd87f50a8043b5abcc9a2d2191a26c95d76..98f15e6604d3b119296be2075b2d3bb4a5f15f30 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 3346186418b65a8b28a558f2c96d1f3d71e18d76..321402861981aa29522415848f7b8162bcf2cee8 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index b2432f339e2d6127a61a0ec5160b0ec7ec06db6c..3d8430e735a5c74564e2bf7a7133e7a0facb89d5 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index bdefd7d4311af757a8370eaa27eb63b599d4a8fc..ce9ea8836e2ae922ab6cc412e6694bd71f07bd08 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 4ea3780a1a82392f48c1e84284ac7c10ad28066c..5362a1b09a7d118c857ab5fefefe97a6c02050b4 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 5563cb14593efa8054e271d486a2d0455fec77b8..7b32875a9b12fde26f3c0678e90226ae7f12286d 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 20b58eb2a55e15dc5e22b9c623c0b06a6c0e1b35..761e70b62b64602ee208d86933374da16f7c5f5d 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 58934a8dc28e824ca82c6f570d41b995c28d775f..d0b343b43bef5ea9cc27f8779a74cefb81a224bd 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index f1fd2160e6a264d9632cc714ee3eb0b9e6f99791..3179f962142f37365e7718e9ac95173e6055f192 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index f38c7ced9386b14f5d591bec125235acc9e818fc..07e8a1d6d1b03f2e293ca6eaa84bedc8c37a7ed7 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 4c927c75c642d83a0169397fc34fecba067eae22..f4683bbdb1b31ffbe9947136cfc5768a16a6fc46 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 5ea5a1c0969fe202689aae08a581cc7551cc19f6..003149ddf2734bee9d168d1111373b10fa7baf4f 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 8713db28320d1ec33455613f7e474771d80dcabd..943ca754c4668ccadf4c4c482189072c73a169f8 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 684b0296f14cf76911028133bd64ecf59f8cf347..39778ee7dd97ee493a585d191313f109b9c8721b 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index b48b4b16b48edc15405e17eb2990c147655a7d5f..958dae36c67f21c96a81a779257b6ab837cca004 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 8426b6caa511aeb65c9d3f3b397945bf3a1c9f2d..4cb30dc5472d1ca458987fd6f654db011168582d 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index d2c1e5069448ec406fca87274530f7701133f876..a73e0cb164e6ae5c66284332036100ffd50e4ee6 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 2447a5668e81c18b08610a514f841a5dc5e4b709..a36bf40496bd4395a07edbc6e337710d475ae319 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 2781d211a993249d83d232bdc3d241df96d117cb..984fc1426f66d3ac395c93270798ff4409a712bf 100755 (executable)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 1a12060dd56c6ba74cc682cbe7995fad5567c541..1ee4fc6c79a8d9f6c62150d482e1e682807e6400 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -19,6 +19,7 @@
 #
 
 from GEOM import ISTEPOperations
+import GEOM
 
 # Engine Library Name
 __libraryName__ = "STEPPluginEngine"
@@ -30,17 +31,19 @@ def GetSTEPPluginOperations(self):
 ## Export the given shape into a file with given name in STEP format.
 #  @param theObject Shape to be stored in the file.
 #  @param theFileName Name of the file to store the given shape in.
+#  @param theUnit the length unit (see GEOM::length_unit). In meters by default.
 #  @ingroup l2_import_export
-def ExportSTEP(self, theObject, theFileName):
+def ExportSTEP(self, theObject, theFileName, theUnit=GEOM.LU_METER):
     """
     Export the given shape into a file with given name in STEP format.
 
     Parameters: 
         theObject Shape to be stored in the file.
         theFileName Name of the file to store the given shape in.
+        theUnit the length unit (see GEOM::length_unit). In meters by default.
     """
     anOp = GetSTEPPluginOperations(self)
-    anOp.ExportSTEP(theObject, theFileName)
+    anOp.ExportSTEP(theObject, theFileName, theUnit)
     if anOp.IsDone() == 0:
         raise RuntimeError,  "Export : " + anOp.GetErrorCode()
         pass
index 39674429f36b3abce1321a9ffa73d6b7dbb38177..e9ded2cd267362d5f67ecba8e6982fb85dfcefb9 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 300535737b30c765a4f239ed78a38567245174e4..b2fe46e251c18c7b1c3b557ef85250c86f127342 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index aa9eef6814957863cac6c8eabed18dd98f71de37..b30467f0e54327edf2a50fbeb0c221478035eb3c 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 812011f86458678f8589a3d26b02f81a2b19cc55..cf3bf058402a62d00ffbb6406010ea2eb8b8a52b 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 27b194dc265bd449f3335bac5cba121c46dd8caa..0f90ef502729c5cd536a1c8c0cf915e1220f8f15 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -80,7 +80,7 @@
 ## # create and publish cylinder
 ## cyl = geompy.MakeCylinderRH(100, 100, "cylinder")
 ## # get non blocks from cylinder
-## g1, g2 = geompy.GetNonBlocks(cyl, "nonblock")
+## g1, g2 = geompy.GetNonBlocks(cyl, theName="nonblock")
 ## @endcode
 ##
 ## Above example will publish both result compounds (first with non-hexa solids and
@@ -88,7 +88,7 @@
 ## However, if second command is invoked as
 ##
 ## @code
-## g1, g2 = geompy.GetNonBlocks(cyl, ("nonhexa", "nonquad"))
+## g1, g2 = geompy.GetNonBlocks(cyl, theName=("nonhexa", "nonquad"))
 ## @endcode
 ##
 ## ... the first compound will be published with "nonhexa" name, and second will be named "nonquad".
@@ -295,7 +295,7 @@ def ManageTransactions(theOpeName):
 ## Raise an Error, containing the Method_name, if Operation is Failed
 ## @ingroup l1_geomBuilder_auxiliary
 def RaiseIfFailed (Method_name, Operation):
-    if Operation.IsDone() == 0 and Operation.GetErrorCode() != "NOT_FOUND_ANY":
+    if not Operation.IsDone() and Operation.GetErrorCode() != "NOT_FOUND_ANY":
         raise RuntimeError, Method_name + " : " + Operation.GetErrorCode()
 
 ## Return list of variables value from salome notebook
@@ -517,6 +517,14 @@ def EnumToLong(theItem):
     if hasattr(theItem, "_v"): ret = theItem._v
     return ret
 
+## Pack an argument into a list
+def ToList( arg ):
+    if isinstance( arg, list ):
+        return arg
+    if hasattr( arg, "__getitem__" ):
+        return list( arg )
+    return [ arg ]
+
 ## Information about closed/unclosed state of shell or wire
 #  @ingroup l1_geomBuilder_auxiliary
 class info:
@@ -551,7 +559,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Enumeration ShapeType as a dictionary. \n
         ## Topological types of shapes (like Open Cascade types). See GEOM::shape_type for details.
         #  @ingroup l1_geomBuilder_auxiliary
-        ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8}
+        ShapeType = {"AUTO":-1, "COMPOUND":0, "COMPSOLID":1, "SOLID":2, "SHELL":3, "FACE":4, "WIRE":5, "EDGE":6, "VERTEX":7, "SHAPE":8, "FLAT":9}
 
         ## Kinds of shape in terms of <VAR>GEOM.GEOM_IKindOfShape.shape_kind</VAR> enumeration
         #  and a list of parameters, describing the shape.
@@ -592,6 +600,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  - EDGE:                                                 [nb_vertices]
         #
         #  - VERTEX:       [x  y  z]
+        #
+        #  - LCS:          [x y z  xx xy xz  yx yy yz  zx zy zz]
         #  @ingroup l1_geomBuilder_auxiliary
         kind = GEOM.GEOM_IKindOfShape
 
@@ -777,6 +787,9 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self.myUseCaseBuilder = self.myStudy.GetUseCaseBuilder()
             self.myUseCaseBuilder.SetRootCurrent()
             self.myUseCaseBuilder.Append(self.father)
+
+            # load data from the study file, if necessary
+            self.myBuilder.LoadWith(self.father, self)
             pass
 
         def GetPluginOperations(self, studyID, libraryName):
@@ -1137,6 +1150,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Create a point, corresponding to the given parameter on the given curve.
         #  @param theRefCurve The referenced curve.
         #  @param theParameter Value of parameter on the referenced curve.
+        #  @param takeOrientationIntoAccount flag that tells if it is necessary
+        #         to take the curve's orientation into account for the
+        #         operation. I.e. if this flag is set, the results for the same
+        #         parameters (except the value 0.5) is different for forward
+        #         and reversed curves. If it is not set the result is the same.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -1145,13 +1163,20 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_creation_point "Example"
         @ManageTransactions("BasicOp")
-        def MakeVertexOnCurve(self, theRefCurve, theParameter, theName=None):
+        def MakeVertexOnCurve(self, theRefCurve, theParameter,
+                              takeOrientationIntoAccount=False, theName=None):
             """
             Create a point, corresponding to the given parameter on the given curve.
 
             Parameters:
                 theRefCurve The referenced curve.
                 theParameter Value of parameter on the referenced curve.
+                takeOrientationIntoAccount flag that tells if it is necessary
+                        to take the curve's orientation into account for the
+                        operation. I.e. if this flag is set, the results for
+                        the same parameters (except the value 0.5) is different
+                        for forward and reversed curves. If it is not set
+                        the result is the same.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -1163,8 +1188,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 p_on_arc = geompy.MakeVertexOnCurve(Arc, 0.25)
             """
             # Example: see GEOM_TestAll.py
-            theParameter, Parameters = ParseParameters(theParameter)
-            anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter)
+            theParameter, takeOrientationIntoAccount, Parameters = ParseParameters(
+                theParameter, takeOrientationIntoAccount)
+            anObj = self.BasicOp.MakePointOnCurve(theRefCurve, theParameter,
+                                                  takeOrientationIntoAccount)
             RaiseIfFailed("MakePointOnCurve", self.BasicOp)
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "vertex")
@@ -2387,7 +2414,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
               anObj = self.CurvesOp.MakeCurveParametricNew(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
             else:
               anObj = self.CurvesOp.MakeCurveParametric(thexExpr,theyExpr,thezExpr,theParamMin,theParamMax,theParamStep,theCurveType)
-            RaiseIfFailed("MakeSplineInterpolation", self.CurvesOp)
+            RaiseIfFailed("MakeCurveParametric", self.CurvesOp)
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "curve")
             return anObj
@@ -3022,7 +3049,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         @ManageTransactions("PrimOp")
         def MakeCylinderA(self, thePnt, theAxis, theR, theH, theA, theName=None):
             """
-            Create a portion of cylinder with given base point, axis, radius, height and angle.
+            Create a portion of cylinder with given base point, axis, radius, height and angle.
 
             Parameters:
                 thePnt Central point of cylinder base.
@@ -3044,10 +3071,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
            if flag:
                 theA = theA*math.pi/180.
-            anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
-            RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
-            anObj.SetParameters(Parameters)
-            self._autoPublish(anObj, theName, "cylinder")
+           if theA<=0. or theA>=2*math.pi:
+             raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
+           anObj = self.PrimOp.MakeCylinderPntVecRHA(thePnt, theAxis, theR, theH, theA)
+           RaiseIfFailed("MakeCylinderPntVecRHA", self.PrimOp)
+           anObj.SetParameters(Parameters)
+           self._autoPublish(anObj, theName, "cylinder")
             return anObj
 
         ## Create a cylinder with given radius and height at
@@ -3125,6 +3154,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             theR,theH,theA,Parameters = ParseParameters(theR, theH, theA)
             if flag:
                 theA = theA*math.pi/180.
+            if theA<=0. or theA>=2*math.pi:
+             raise ValueError("The angle parameter should be strictly between 0 and 2*pi.")
             anObj = self.PrimOp.MakeCylinderRHA(theR, theH, theA)
             RaiseIfFailed("MakeCylinderRHA", self.PrimOp)
             anObj.SetParameters(Parameters)
@@ -3717,14 +3748,15 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "revolution")
             return anObj
 
-        ## Create a filling from the given compound of contours.
-        #  @param theShape the compound of contours
-        #  @param theMinDeg a minimal degree of BSpline surface to create
-        #  @param theMaxDeg a maximal degree of BSpline surface to create
-        #  @param theTol2D a 2d tolerance to be reached
-        #  @param theTol3D a 3d tolerance to be reached
-        #  @param theNbIter a number of iteration of approximation algorithm
-        #  @param theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
+        ## Create a face from a given set of contours.
+        #  @param theContours either a list or a compound of edges/wires.
+        #  @param theMinDeg a minimal degree of BSpline surface to create.
+        #  @param theMaxDeg a maximal degree of BSpline surface to create.
+        #  @param theTol2D a 2d tolerance to be reached.
+        #  @param theTol3D a 3d tolerance to be reached.
+        #  @param theNbIter a number of iteration of approximation algorithm.
+        #  @param theMethod Kind of method to perform filling operation
+        #         (see GEOM.filling_oper_method enum).
         #  @param isApprox if True, BSpline curves are generated in the process
         #                  of surface construction. By default it is False, that means
         #                  the surface is created using given curves. The usage of
@@ -3734,41 +3766,42 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created filling surface.
+        #  @return New GEOM.GEOM_Object (face), containing the created filling surface.
         #
         #  @ref tui_creation_filling "Example"
         @ManageTransactions("PrimOp")
-        def MakeFilling(self, theShape, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
+        def MakeFilling(self, theContours, theMinDeg=2, theMaxDeg=5, theTol2D=0.0001,
                         theTol3D=0.0001, theNbIter=0, theMethod=GEOM.FOM_Default, isApprox=0, theName=None):
             """
-            Create a filling from the given compound of contours.
+            Create a face from a given set of contours.
 
             Parameters:
-                theShape the compound of contours
-                theMinDeg a minimal degree of BSpline surface to create
-                theMaxDeg a maximal degree of BSpline surface to create
-                theTol2D a 2d tolerance to be reached
-                theTol3D a 3d tolerance to be reached
-                theNbIter a number of iteration of approximation algorithm
-                theMethod Kind of method to perform filling operation(see GEOM::filling_oper_method())
+                theContours either a list or a compound of edges/wires.
+                theMinDeg a minimal degree of BSpline surface to create.
+                theMaxDeg a maximal degree of BSpline surface to create.
+                theTol2D a 2d tolerance to be reached.
+                theTol3D a 3d tolerance to be reached.
+                theNbIter a number of iteration of approximation algorithm.
+                theMethod Kind of method to perform filling operation
+                          (see GEOM.filling_oper_method enum).
                 isApprox if True, BSpline curves are generated in the process
                          of surface construction. By default it is False, that means
                          the surface is created using given curves. The usage of
                          Approximation makes the algorithm work slower, but allows
-                         building the surface for rather complex cases
+                         building the surface for rather complex cases.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created filling surface.
+                New GEOM.GEOM_Object (face), containing the created filling surface.
 
             Example of usage:
                 filling = geompy.MakeFilling(compound, 2, 5, 0.0001, 0.0001, 5)
             """
             # Example: see GEOM_TestAll.py
             theMinDeg,theMaxDeg,theTol2D,theTol3D,theNbIter,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol2D, theTol3D, theNbIter)
-            anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
+            anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
                                             theTol2D, theTol3D, theNbIter,
                                             theMethod, isApprox)
             RaiseIfFailed("MakeFilling", self.PrimOp)
@@ -3777,43 +3810,43 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             return anObj
 
 
-        ## Create a filling from the given compound of contours.
-        #  This method corresponds to MakeFilling with isApprox=True
-        #  @param theShape the compound of contours
-        #  @param theMinDeg a minimal degree of BSpline surface to create
-        #  @param theMaxDeg a maximal degree of BSpline surface to create
-        #  @param theTol3D a 3d tolerance to be reached
+        ## Create a face from a given set of contours.
+        #  This method corresponds to MakeFilling() with isApprox=True.
+        #  @param theContours either a list or a compound of edges/wires.
+        #  @param theMinDeg a minimal degree of BSpline surface to create.
+        #  @param theMaxDeg a maximal degree of BSpline surface to create.
+        #  @param theTol3D a 3d tolerance to be reached.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created filling surface.
+        #  @return New GEOM.GEOM_Object (face), containing the created filling surface.
         #
         #  @ref tui_creation_filling "Example"
         @ManageTransactions("PrimOp")
-        def MakeFillingNew(self, theShape, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
+        def MakeFillingNew(self, theContours, theMinDeg=2, theMaxDeg=5, theTol3D=0.0001, theName=None):
             """
             Create a filling from the given compound of contours.
-            This method corresponds to MakeFilling with isApprox=True
+            This method corresponds to MakeFilling() with isApprox=True.
 
             Parameters:
-                theShape the compound of contours
-                theMinDeg a minimal degree of BSpline surface to create
-                theMaxDeg a maximal degree of BSpline surface to create
-                theTol3D a 3d tolerance to be reached
+                theContours either a list or a compound of edges/wires.
+                theMinDeg a minimal degree of BSpline surface to create.
+                theMaxDeg a maximal degree of BSpline surface to create.
+                theTol3D a 3d tolerance to be reached.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created filling surface.
+                New GEOM.GEOM_Object (face), containing the created filling surface.
 
             Example of usage:
                 filling = geompy.MakeFillingNew(compound, 2, 5, 0.0001)
             """
             # Example: see GEOM_TestAll.py
             theMinDeg,theMaxDeg,theTol3D,Parameters = ParseParameters(theMinDeg, theMaxDeg, theTol3D)
-            anObj = self.PrimOp.MakeFilling(theShape, theMinDeg, theMaxDeg,
+            anObj = self.PrimOp.MakeFilling(ToList(theContours), theMinDeg, theMaxDeg,
                                             0, theTol3D, 0, GEOM.FOM_Default, True)
             RaiseIfFailed("MakeFillingNew", self.PrimOp)
             anObj.SetParameters(Parameters)
@@ -3856,41 +3889,97 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             return anObj
 
         ## Create a shape by extrusion of the base shape along
-        #  the path shape. The path shape can be a wire or an edge.
+        #  the path shape. The path shape can be a wire or an edge. It is
+        #  possible to generate groups along with the result by means of
+        #  setting the flag \a IsGenerateGroups.<BR>
+        #  If \a thePath is a closed edge or wire and \a IsGenerateGroups is
+        #  set, an error is occured. If \a thePath is not closed edge/wire,
+        #  the following groups are returned:
+        #  - If \a theBase is unclosed edge or wire: "Down", "Up", "Side1",
+        #    "Side2";
+        #  - If \a theBase is closed edge or wire, face or shell: "Down", "Up",
+        #    "Other".
+        #  .
+        #  "Down" and "Up" groups contain:
+        #  - Edges if \a theBase is edge or wire;
+        #  - Faces if \a theBase is face or shell.<BR>
+        #  .
+        #  "Side1" and "Side2" groups contain edges generated from the first
+        #  and last vertices of \a theBase. The first and last vertices are
+        #  determined taking into account edge/wire orientation.<BR>
+        #  "Other" group represents faces generated from the bounding edges of
+        #  \a theBase.
+        #
         #  @param theBase Base shape to be extruded.
         #  @param thePath Path shape to extrude the base shape along it.
+        #  @param IsGenerateGroups flag that tells if it is necessary to
+        #         create groups. It is equal to False by default.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created pipe.
+        #  @return New GEOM.GEOM_Object, containing the created pipe if 
+        #          \a IsGenerateGroups is not set. Otherwise it returns new
+        #          GEOM.ListOfGO. Its first element is the created pipe, the
+        #          remaining ones are created groups.
         #
         #  @ref tui_creation_pipe "Example"
         @ManageTransactions("PrimOp")
-        def MakePipe(self, theBase, thePath, theName=None):
+        def MakePipe(self, theBase, thePath,
+                     IsGenerateGroups=False, theName=None):
             """
             Create a shape by extrusion of the base shape along
-            the path shape. The path shape can be a wire or an edge.
+            the path shape. The path shape can be a wire or an edge. It is
+            possible to generate groups along with the result by means of
+            setting the flag IsGenerateGroups.
+            If thePath is a closed edge or wire and IsGenerateGroups is
+            set, an error is occured. If thePath is not closed edge/wire,
+            the following groups are returned:
+            - If theBase is unclosed edge or wire: "Down", "Up", "Side1",
+              "Side2";
+            - If theBase is closed edge or wire, face or shell: "Down", "Up",
+              "Other".
+            "Down" and "Up" groups contain:
+            - Edges if theBase is edge or wire;
+            - Faces if theBase is face or shell.
+            "Side1" and "Side2" groups contain edges generated from the first
+            and last vertices of theBase. The first and last vertices are
+            determined taking into account edge/wire orientation.
+            "Other" group represents faces generated from the bounding edges of
+            theBase.
 
             Parameters:
                 theBase Base shape to be extruded.
                 thePath Path shape to extrude the base shape along it.
+                IsGenerateGroups flag that tells if it is necessary to
+                        create groups. It is equal to False by default.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created pipe.
+                New GEOM.GEOM_Object, containing the created pipe if 
+                IsGenerateGroups is not set. Otherwise it returns new
+                GEOM.ListOfGO. Its first element is the created pipe, the
+                remaining ones are created groups.
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.PrimOp.MakePipe(theBase, thePath)
+            aList = self.PrimOp.MakePipe(theBase, thePath, IsGenerateGroups)
             RaiseIfFailed("MakePipe", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
-            return anObj
+
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
 
         ## Create a shape by extrusion of the profile shape along
         #  the path shape. The path shape can be a wire or an edge.
         #  the several profiles can be specified in the several locations of path.
+        #  It is possible to generate groups along with the result by means of
+        #  setting the flag \a IsGenerateGroups. For detailed information on
+        #  groups that can be created please see the method MakePipe().
         #  @param theSeqBases - list of  Bases shape to be extruded.
         #  @param theLocations - list of locations on the path corresponding
         #                        specified list of the Bases shapes. Number of locations
@@ -3900,21 +3989,30 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #                          contact with the spine.
         #  @param theWithCorrection - defining that the section is rotated to be
         #                             orthogonal to the spine tangent in the correspondent point
+        #  @param IsGenerateGroups - flag that tells if it is necessary to
+        #                          create groups. It is equal to False by default.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created pipe.
+        #  @return New GEOM.GEOM_Object, containing the created pipe if 
+        #          \a IsGenerateGroups is not set. Otherwise it returns new
+        #          GEOM.ListOfGO. Its first element is the created pipe, the
+        #          remaining ones are created groups.
         #
         #  @ref tui_creation_pipe_with_diff_sec "Example"
         @ManageTransactions("PrimOp")
         def MakePipeWithDifferentSections(self, theSeqBases,
                                           theLocations, thePath,
-                                          theWithContact, theWithCorrection, theName=None):
+                                          theWithContact, theWithCorrection,
+                                          IsGenerateGroups=False, theName=None):
             """
             Create a shape by extrusion of the profile shape along
             the path shape. The path shape can be a wire or an edge.
             the several profiles can be specified in the several locations of path.
+            It is possible to generate groups along with the result by means of
+            setting the flag IsGenerateGroups. For detailed information on
+            groups that can be created please see the method geompy.MakePipe().
 
             Parameters:
                 theSeqBases - list of  Bases shape to be extruded.
@@ -3926,23 +4024,74 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                                  contact with the spine(0/1)
                 theWithCorrection - defining that the section is rotated to be
                                     orthogonal to the spine tangent in the correspondent point (0/1)
+                IsGenerateGroups - flag that tells if it is necessary to
+                                 create groups. It is equal to False by default.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created pipe.
+                New GEOM.GEOM_Object, containing the created pipe if 
+                IsGenerateGroups is not set. Otherwise it returns new
+                GEOM.ListOfGO. Its first element is the created pipe, the
+                remaining ones are created groups.
             """
-            anObj = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
+            aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
                                                               theLocations, thePath,
-                                                              theWithContact, theWithCorrection)
+                                                              theWithContact, theWithCorrection,
+                                                              False, IsGenerateGroups)
             RaiseIfFailed("MakePipeWithDifferentSections", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
-            return anObj
+
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
 
         ## Create a shape by extrusion of the profile shape along
-        #  the path shape. The path shape can be a wire or a edge.
+        #  the path shape. This function is a version of
+        #  MakePipeWithDifferentSections() with the same parameters, except
+        #  eliminated theWithContact and theWithCorrection. So it is
+        #  possible to find the description of all parameters is in this
+        #  method. The difference is that this method performs the operation
+        #  step by step, i.e. it creates pipes between each pair of neighbor
+        #  sections and fuses them into a single shape.
+        #
+        #  @ref tui_creation_pipe_with_diff_sec "Example"
+        @ManageTransactions("PrimOp")
+        def MakePipeWithDifferentSectionsBySteps(self, theSeqBases,
+                                                 theLocations, thePath,
+                                                 IsGenerateGroups=False, theName=None):
+            """
+            Create a shape by extrusion of the profile shape along
+            the path shape. This function is a version of
+            MakePipeWithDifferentSections() with the same parameters, except
+            eliminated theWithContact and theWithCorrection. So it is
+            possible to find the description of all parameters is in this
+            method. The difference is that this method performs the operation
+            step by step, i.e. it creates pipes between each pair of neighbor
+            sections and fuses them into a single shape.
+            """
+            aList = self.PrimOp.MakePipeWithDifferentSections(theSeqBases,
+                                                              theLocations, thePath,
+                                                              False, False,
+                                                              True, IsGenerateGroups)
+            RaiseIfFailed("MakePipeWithDifferentSectionsBySteps", self.PrimOp)
+
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
+
+        ## Create a shape by extrusion of the profile shape along
+        #  the path shape. The path shape can be a wire or an edge.
         #  the several profiles can be specified in the several locations of path.
+        #  It is possible to generate groups along with the result by means of
+        #  setting the flag \a IsGenerateGroups. For detailed information on
+        #  groups that can be created please see the method MakePipe().
         #  @param theSeqBases - list of  Bases shape to be extruded. Base shape must be
         #                       shell or face. If number of faces in neighbour sections
         #                       aren't coincided result solid between such sections will
@@ -3961,21 +4110,30 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #                          contact with the spine.
         #  @param theWithCorrection - defining that the section is rotated to be
         #                             orthogonal to the spine tangent in the correspondent point
+        #  @param IsGenerateGroups - flag that tells if it is necessary to
+        #                          create groups. It is equal to False by default.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created solids.
+        #  @return New GEOM.GEOM_Object, containing the created solids if 
+        #          \a IsGenerateGroups is not set. Otherwise it returns new
+        #          GEOM.ListOfGO. Its first element is the created solids, the
+        #          remaining ones are created groups.
         #
         #  @ref tui_creation_pipe_with_shell_sec "Example"
         @ManageTransactions("PrimOp")
         def MakePipeWithShellSections(self, theSeqBases, theSeqSubBases,
                                       theLocations, thePath,
-                                      theWithContact, theWithCorrection, theName=None):
+                                      theWithContact, theWithCorrection,
+                                      IsGenerateGroups=False, theName=None):
             """
             Create a shape by extrusion of the profile shape along
-            the path shape. The path shape can be a wire or a edge.
+            the path shape. The path shape can be a wire or an edge.
             the several profiles can be specified in the several locations of path.
+            It is possible to generate groups along with the result by means of
+            setting the flag IsGenerateGroups. For detailed information on
+            groups that can be created please see the method geompy.MakePipe().
 
             Parameters:
                 theSeqBases - list of  Bases shape to be extruded. Base shape must be
@@ -3996,19 +4154,30 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                                  contact with the spine (0/1)
                 theWithCorrection - defining that the section is rotated to be
                                     orthogonal to the spine tangent in the correspondent point (0/1)
+                IsGenerateGroups - flag that tells if it is necessary to
+                                 create groups. It is equal to False by default.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created solids.
+                New GEOM.GEOM_Object, containing the created solids if 
+                IsGenerateGroups is not set. Otherwise it returns new
+                GEOM.ListOfGO. Its first element is the created solids, the
+                remaining ones are created groups.
             """
-            anObj = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
+            aList = self.PrimOp.MakePipeWithShellSections(theSeqBases, theSeqSubBases,
                                                           theLocations, thePath,
-                                                          theWithContact, theWithCorrection)
+                                                          theWithContact, theWithCorrection,
+                                                          IsGenerateGroups)
             RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
-            return anObj
+
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
 
         ## Create a shape by extrusion of the profile shape along
         #  the path shape. This function is used only for debug pipe
@@ -4018,7 +4187,8 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         @ManageTransactions("PrimOp")
         def MakePipeWithShellSectionsBySteps(self, theSeqBases, theSeqSubBases,
                                              theLocations, thePath,
-                                             theWithContact, theWithCorrection, theName=None):
+                                             theWithContact, theWithCorrection,
+                                             IsGenerateGroups=False, theName=None):
             """
             Create a shape by extrusion of the profile shape along
             the path shape. This function is used only for debug pipe
@@ -4037,16 +4207,17 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 tmpLocations = [ theLocations[i-1], theLocations[i] ]
                 tmpSeqSubBases = []
                 if nbsubsect>0: tmpSeqSubBases = [ theSeqSubBases[i-1], theSeqSubBases[i] ]
-                anObj = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
+                aList = self.PrimOp.MakePipeWithShellSections(tmpSeqBases, tmpSeqSubBases,
                                                               tmpLocations, thePath,
-                                                              theWithContact, theWithCorrection)
+                                                              theWithContact, theWithCorrection,
+                                                              IsGenerateGroups)
                 if self.PrimOp.IsDone() == 0:
                     print "Problems with pipe creation between ",i," and ",i+1," sections"
                     RaiseIfFailed("MakePipeWithShellSections", self.PrimOp)
                     break
                 else:
                     print "Pipe between ",i," and ",i+1," sections is OK"
-                    res.append(anObj)
+                    res.append(aList[0])
                     pass
                 pass
 
@@ -4056,57 +4227,92 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(resc, theName, "pipe")
             return resc
 
-        ## Create solids between given sections
+        ## Create solids between given sections.
+        #  It is possible to generate groups along with the result by means of
+        #  setting the flag \a IsGenerateGroups. For detailed information on
+        #  groups that can be created please see the method MakePipe().
         #  @param theSeqBases - list of sections (shell or face).
         #  @param theLocations - list of corresponding vertexes
+        #  @param IsGenerateGroups - flag that tells if it is necessary to
+        #         create groups. It is equal to False by default.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created solids.
+        #  @return New GEOM.GEOM_Object, containing the created solids if 
+        #          \a IsGenerateGroups is not set. Otherwise it returns new
+        #          GEOM.ListOfGO. Its first element is the created solids, the
+        #          remaining ones are created groups.
         #
         #  @ref tui_creation_pipe_without_path "Example"
         @ManageTransactions("PrimOp")
-        def MakePipeShellsWithoutPath(self, theSeqBases, theLocations, theName=None):
+        def MakePipeShellsWithoutPath(self, theSeqBases, theLocations,
+                                      IsGenerateGroups=False, theName=None):
             """
-            Create solids between given sections
+            Create solids between given sections.
+            It is possible to generate groups along with the result by means of
+            setting the flag IsGenerateGroups. For detailed information on
+            groups that can be created please see the method geompy.MakePipe().
 
             Parameters:
                 theSeqBases - list of sections (shell or face).
                 theLocations - list of corresponding vertexes
+                IsGenerateGroups - flag that tells if it is necessary to
+                                 create groups. It is equal to False by default.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created solids.
+                New GEOM.GEOM_Object, containing the created solids if 
+                IsGenerateGroups is not set. Otherwise it returns new
+                GEOM.ListOfGO. Its first element is the created solids, the
+                remaining ones are created groups.
             """
-            anObj = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations)
+            aList = self.PrimOp.MakePipeShellsWithoutPath(theSeqBases, theLocations,
+                                                          IsGenerateGroups)
             RaiseIfFailed("MakePipeShellsWithoutPath", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
-            return anObj
+
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
 
         ## Create a shape by extrusion of the base shape along
         #  the path shape with constant bi-normal direction along the given vector.
         #  The path shape can be a wire or an edge.
+        #  It is possible to generate groups along with the result by means of
+        #  setting the flag \a IsGenerateGroups. For detailed information on
+        #  groups that can be created please see the method MakePipe().
         #  @param theBase Base shape to be extruded.
         #  @param thePath Path shape to extrude the base shape along it.
         #  @param theVec Vector defines a constant binormal direction to keep the
         #                same angle beetween the direction and the sections
         #                along the sweep surface.
+        #  @param IsGenerateGroups flag that tells if it is necessary to
+        #         create groups. It is equal to False by default.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created pipe.
+        #  @return New GEOM.GEOM_Object, containing the created pipe if 
+        #          \a IsGenerateGroups is not set. Otherwise it returns new
+        #          GEOM.ListOfGO. Its first element is the created pipe, the
+        #          remaining ones are created groups.
         #
         #  @ref tui_creation_pipe "Example"
         @ManageTransactions("PrimOp")
-        def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec, theName=None):
+        def MakePipeBiNormalAlongVector(self, theBase, thePath, theVec,
+                                        IsGenerateGroups=False, theName=None):
             """
             Create a shape by extrusion of the base shape along
             the path shape with constant bi-normal direction along the given vector.
             The path shape can be a wire or an edge.
+            It is possible to generate groups along with the result by means of
+            setting the flag IsGenerateGroups. For detailed information on
+            groups that can be created please see the method geompy.MakePipe().
 
             Parameters:
                 theBase Base shape to be extruded.
@@ -4114,74 +4320,120 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 theVec Vector defines a constant binormal direction to keep the
                        same angle beetween the direction and the sections
                        along the sweep surface.
+                IsGenerateGroups flag that tells if it is necessary to
+                                 create groups. It is equal to False by default.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created pipe.
+                New GEOM.GEOM_Object, containing the created pipe if 
+                IsGenerateGroups is not set. Otherwise it returns new
+                GEOM.ListOfGO. Its first element is the created pipe, the
+                remaining ones are created groups.
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath, theVec)
+            aList = self.PrimOp.MakePipeBiNormalAlongVector(theBase, thePath,
+                          theVec, IsGenerateGroups)
             RaiseIfFailed("MakePipeBiNormalAlongVector", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
-            return anObj
 
-        ## Makes a thick solid from a face or a shell
-        #  @param theShape Face or Shell to be thicken
+            if IsGenerateGroups:
+              self._autoPublish(aList, theName, "pipe")
+              return aList
+
+            self._autoPublish(aList[0], theName, "pipe")
+            return aList[0]
+
+        ## Makes a thick solid from a shape. If the input is a surface shape
+        #  (face or shell) the result is a thick solid. If an input shape is
+        #  a solid the result is a hollowed solid with removed faces.
+        #  @param theShape Face or Shell to get thick solid or solid to get
+        #         hollowed solid.
         #  @param theThickness Thickness of the resulting solid
+        #  @param theFacesIDs the list of face IDs to be removed from the
+        #         result. It is ignored if \a theShape is a face or a shell.
+        #         It is empty by default. 
+        #  @param theInside If true the thickness is applied towards inside
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
         #  @return New GEOM.GEOM_Object, containing the created solid
         #
+        #  @ref tui_creation_thickness "Example"
         @ManageTransactions("PrimOp")
-        def MakeThickSolid(self, theShape, theThickness, theName=None):
+        def MakeThickSolid(self, theShape, theThickness,
+                           theFacesIDs=[], theInside=False, theName=None):
             """
-            Make a thick solid from a face or a shell
+            Make a thick solid from a shape. If the input is a surface shape
+            (face or shell) the result is a thick solid. If an input shape is
+            a solid the result is a hollowed solid with removed faces.
 
             Parameters:
-                 theShape Face or Shell to be thicken
+                 theShape Face or Shell to get thick solid or solid to get
+                          hollowed solid.
                  theThickness Thickness of the resulting solid
+                 theFacesIDs the list of face IDs to be removed from the
+                          result. It is ignored if theShape is a face or a
+                          shell. It is empty by default. 
+                 theInside If true the thickness is applied towards inside
                  theName Object name; when specified, this parameter is used
-                 for result publication in the study. Otherwise, if automatic
-                 publication is switched on, default value is used for result name.
+                         for result publication in the study. Otherwise, if automatic
+                         publication is switched on, default value is used for result name.
 
             Returns:
                 New GEOM.GEOM_Object, containing the created solid
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.PrimOp.MakeThickening(theShape, theThickness, True)
-            RaiseIfFailed("MakeThickening", self.PrimOp)
-            self._autoPublish(anObj, theName, "pipe")
+            theThickness,Parameters = ParseParameters(theThickness)
+            anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
+                                               theThickness, True, theInside)
+            RaiseIfFailed("MakeThickSolid", self.PrimOp)
+            anObj.SetParameters(Parameters)
+            self._autoPublish(anObj, theName, "thickSolid")
             return anObj
 
 
-        ## Modifies a face or a shell to make it a thick solid
-        #  @param theShape Face or Shell to be thicken
+        ## Modifies a shape to make it a thick solid. If the input is a surface
+        #  shape (face or shell) the result is a thick solid. If an input shape
+        #  is a solid the result is a hollowed solid with removed faces.
+        #  @param theShape Face or Shell to get thick solid or solid to get
+        #         hollowed solid.
         #  @param theThickness Thickness of the resulting solid
+        #  @param theFacesIDs the list of face IDs to be removed from the
+        #         result. It is ignored if \a theShape is a face or a shell.
+        #         It is empty by default. 
+        #  @param theInside If true the thickness is applied towards inside
         #
         #  @return The modified shape
         #
+        #  @ref tui_creation_thickness "Example"
         @ManageTransactions("PrimOp")
-        def Thicken(self, theShape, theThickness):
+        def Thicken(self, theShape, theThickness, theFacesIDs=[], theInside=False):
             """
-            Modifies a face or a shell to make it a thick solid
+            Modifies a shape to make it a thick solid. If the input is a
+            surface shape (face or shell) the result is a thick solid. If
+            an input shape is a solid the result is a hollowed solid with
+            removed faces.
 
             Parameters:
-                theBase Base shape to be extruded.
-                thePath Path shape to extrude the base shape along it.
-                theName Object name; when specified, this parameter is used
-                        for result publication in the study. Otherwise, if automatic
-                        publication is switched on, default value is used for result name.
+                theShape Face or Shell to get thick solid or solid to get
+                         hollowed solid.
+                theThickness Thickness of the resulting solid
+                theFacesIDs the list of face IDs to be removed from the
+                         result. It is ignored if \a theShape is a face or
+                         a shell. It is empty by default. 
+                theInside If true the thickness is applied towards inside
 
             Returns:
                 The modified shape
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.PrimOp.MakeThickening(theShape, theThickness, False)
-            RaiseIfFailed("MakeThickening", self.PrimOp)
+            theThickness,Parameters = ParseParameters(theThickness)
+            anObj = self.PrimOp.MakeThickening(theShape, theFacesIDs,
+                                               theThickness, False, theInside)
+            RaiseIfFailed("Thicken", self.PrimOp)
+            anObj.SetParameters(Parameters)
             return anObj
 
         ## Build a middle path of a pipe-like shape.
@@ -4277,7 +4529,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         # end of l3_complex
         ## @}
 
-        ## @addtogroup l3_advanced
+        ## @addtogroup l3_basic_go
         ## @{
 
         ## Create a linear edge with specified ends.
@@ -4427,7 +4679,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created face.
+        #  @return New GEOM.GEOM_Object, containing the created face (compound of faces).
         #
         #  @ref tui_creation_face "Example"
         @ManageTransactions("ShapesOp")
@@ -4447,7 +4699,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created face.
+                New GEOM.GEOM_Object, containing the created face (compound of faces).
             """
             # Example: see GEOM_TestAll.py
             anObj = self.ShapesOp.MakeFace(theWire, isPlanarWanted)
@@ -4469,7 +4721,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created face.
+        #  @return New GEOM.GEOM_Object, containing the created face (compound of faces).
         #
         #  @ref tui_creation_face "Example"
         @ManageTransactions("ShapesOp")
@@ -4489,10 +4741,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created face.
+                New GEOM.GEOM_Object, containing the created face (compound of faces).
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.ShapesOp.MakeFaceWires(theWires, isPlanarWanted)
+            anObj = self.ShapesOp.MakeFaceWires(ToList(theWires), isPlanarWanted)
             if isPlanarWanted and anObj is not None and self.ShapesOp.GetErrorCode() == "MAKE_FACE_TOLERANCE_TOO_BIG":
                 print "WARNING: Cannot build a planar face: required tolerance is too big. Non-planar face is built."
             else:
@@ -4513,13 +4765,82 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             anObj = self.MakeFaceWires(theWires, isPlanarWanted, theName)
             return anObj
 
+        ## Create a face based on a surface from given face bounded
+        #  by given wire.
+        #  @param theFace the face whose surface is used to create a new face.
+        #  @param theWire the wire that will bound a new face.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #
+        #  @return New GEOM.GEOM_Object, containing the created face.
+        #
+        #  @ref tui_creation_face "Example"
+        @ManageTransactions("ShapesOp")
+        def MakeFaceFromSurface(self, theFace, theWire, theName=None):
+            """
+            Create a face based on a surface from given face bounded
+            by given wire.
+
+            Parameters:
+                theFace the face whose surface is used to create a new face.
+                theWire the wire that will bound a new face.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                New GEOM.GEOM_Object, containing the created face.
+            """
+            # Example: see GEOM_TestAll.py
+            anObj = self.ShapesOp.MakeFaceFromSurface(theFace, theWire)
+            RaiseIfFailed("MakeFaceFromSurface", self.ShapesOp)
+            self._autoPublish(anObj, theName, "face")
+            return anObj
+          
+        ## Create a face from a set of edges with the given constraints.
+        #  @param theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
+        #         - edges should form a closed wire;
+        #         - for each edge, constraint face is optional: if a constraint face is missing
+        #           for some edge, this means that there no constraint associated with this edge.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        # 
+        # @return New GEOM.GEOM_Object, containing the created face.
+        # 
+        # @ref tui_creation_face "Example"
+        @ManageTransactions("ShapesOp")
+        def MakeFaceWithConstraints(self, theConstraints, theName=None):
+            """
+            Create a face from a set of edges with the given constraints.
+
+            Parameters:
+                theConstraints List of edges and constraint faces (as a sequence of a Edge + Face couples):
+                        - edges should form a closed wire;
+                        - for each edge, constraint face is optional: if a constraint face is missing
+                          for some edge, this means that there no constraint associated with this edge.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                New GEOM.GEOM_Object, containing the created face.
+            """
+            # Example: see GEOM_TestAll.py
+            anObj = self.ShapesOp.MakeFaceWithConstraints(theConstraints)
+            if anObj is None:
+                RaiseIfFailed("MakeFaceWithConstraints", self.ShapesOp)
+            self._autoPublish(anObj, theName, "face")
+            return anObj
+
         ## Create a shell from the set of faces and shells.
         #  @param theFacesAndShells List of faces and/or shells.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing the created shell.
+        #  @return New GEOM.GEOM_Object, containing the created shell (compound of shells).
         #
         #  @ref tui_creation_shell "Example"
         @ManageTransactions("ShapesOp")
@@ -4534,10 +4855,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing the created shell.
+                New GEOM.GEOM_Object, containing the created shell (compound of shells).
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.ShapesOp.MakeShell(theFacesAndShells)
+            anObj = self.ShapesOp.MakeShell( ToList( theFacesAndShells ))
             RaiseIfFailed("MakeShell", self.ShapesOp)
             self._autoPublish(anObj, theName, "shell")
             return anObj
@@ -4566,6 +4887,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 New GEOM.GEOM_Object, containing the created solid.
             """
             # Example: see GEOM_TestAll.py
+            theShells = ToList(theShells)
             if len(theShells) == 1:
                 descr = self._IsGoodForSolid(theShells[0])
                 #if len(descr) > 0:
@@ -4601,12 +4923,45 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 New GEOM.GEOM_Object, containing the created compound.
             """
             # Example: see GEOM_TestAll.py
-            anObj = self.ShapesOp.MakeCompound(theShapes)
+            anObj = self.ShapesOp.MakeCompound(ToList(theShapes))
             RaiseIfFailed("MakeCompound", self.ShapesOp)
             self._autoPublish(anObj, theName, "compound")
             return anObj
+        
+        ## Create a solid (or solids) from the set of faces and/or shells.
+        #  @param theFacesOrShells List of faces and/or shells.
+        #  @param isIntersect If TRUE, forces performing intersections
+        #         between arguments; otherwise (default) intersection is not performed.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #
+        #  @return New GEOM.GEOM_Object, containing the created solid (or compound of solids).
+        #
+        #  @ref tui_creation_solid_from_faces "Example"
+        @ManageTransactions("ShapesOp")
+        def MakeSolidFromConnectedFaces(self, theFacesOrShells, isIntersect = False, theName=None):
+            """
+            Create a solid (or solids) from the set of connected faces and/or shells.
+
+            Parameters:
+                theFacesOrShells List of faces and/or shells.
+                isIntersect If TRUE, forces performing intersections
+                        between arguments; otherwise (default) intersection is not performed
+                theName Object name; when specified, this parameter is used.
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                New GEOM.GEOM_Object, containing the created solid (or compound of solids).
+            """
+            # Example: see GEOM_TestAll.py
+            anObj = self.ShapesOp.MakeSolidFromConnectedFaces(theFacesOrShells, isIntersect)
+            RaiseIfFailed("MakeSolidFromConnectedFaces", self.ShapesOp)
+            self._autoPublish(anObj, theName, "solid")
+            return anObj
 
-        # end of l3_advanced
+        # end of l3_basic_go
         ## @}
 
         ## @addtogroup l2_measure
@@ -4756,7 +5111,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theShape Shape to find free faces in.
         #  @return List of IDs of all free faces, contained in theShape.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_free_faces_page "Example"
         @ManageTransactions("ShapesOp")
         def GetFreeFacesIDs(self,theShape):
             """
@@ -4807,33 +5162,49 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(aList, theName, "shared")
             return aList
 
-        ## Get all sub-shapes, shared by all shapes in the list <VAR>theShapes</VAR>.
-        #  @param theShapes Shapes to find common sub-shapes of.
-        #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType())
+        ## Get sub-shapes, shared by input shapes.
+        #  @param theShapes Either a list or compound of shapes to find common sub-shapes of.
+        #  @param theShapeType Type of sub-shapes to be retrieved (see ShapeType()).
+        #  @param theMultiShare Specifies what type of shares should be checked:
+        #         - @c True (default): search sub-shapes from 1st input shape shared with all other input shapes;
+        #         - @c False: causes to search sub-shapes shared between couples of input shapes.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return List of objects, that are sub-shapes of all given shapes.
+        #  @note If @a theShapes contains single compound, the shares between all possible couples of 
+        #        its top-level shapes are returned; otherwise, only shares between 1st input shape
+        #        and all rest input shapes are returned.
         #
-        #  @ref swig_GetSharedShapes "Example"
+        #  @return List of all found sub-shapes.
+        #
+        #  Examples:
+        #  - @ref tui_shared_shapes "Example 1"
+        #  - @ref swig_GetSharedShapes "Example 2"
         @ManageTransactions("ShapesOp")
-        def GetSharedShapesMulti(self, theShapes, theShapeType, theName=None):
+        def GetSharedShapesMulti(self, theShapes, theShapeType, theMultiShare=True, theName=None):
             """
-            Get all sub-shapes, shared by all shapes in the list theShapes.
+            Get sub-shapes, shared by input shapes.
 
             Parameters:
-                theShapes Shapes to find common sub-shapes of.
-                theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType)
+                theShapes Either a list or compound of shapes to find common sub-shapes of.
+                theShapeType Type of sub-shapes to be retrieved (see geompy.ShapeType).
+                theMultiShare Specifies what type of shares should be checked:
+                  - True (default): search sub-shapes from 1st input shape shared with all other input shapes;
+                  - False: causes to search sub-shapes shared between couples of input shapes.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
+            Note: if theShapes contains single compound, the shares between all possible couples of 
+                  its top-level shapes are returned; otherwise, only shares between 1st input shape
+                  and all rest input shapes are returned.
+
             Returns:
-                List of GEOM.GEOM_Object, that are sub-shapes of all given shapes.
+                List of all found sub-shapes.
             """
             # Example: see GEOM_TestOthers.py
-            aList = self.ShapesOp.GetSharedShapesMulti(theShapes, theShapeType)
+            aList = self.ShapesOp.GetSharedShapesMulti(ToList(theShapes), theShapeType, theMultiShare)
             RaiseIfFailed("GetSharedShapesMulti", self.ShapesOp)
             self._autoPublish(aList, theName, "shared")
             return aList
@@ -5642,6 +6013,130 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             RaiseIfFailed("GetSameIDs", self.ShapesOp)
             return anObj
 
+        ## Resize the input edge with the new Min and Max parameters.
+        #  The input edge parameters range is [0, 1]. If theMin parameter is
+        #  negative, the input edge is extended, otherwise it is shrinked by
+        #  theMin parameter. If theMax is greater than 1, the edge is extended,
+        #  otherwise it is shrinked by theMax parameter.
+        #  @param theEdge the input edge to be resized.
+        #  @param theMin the minimal parameter value.
+        #  @param theMax the maximal parameter value.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #  @return New GEOM.GEOM_Object, containing the created edge.
+        #
+        #  @ref tui_extend "Example"
+        @ManageTransactions("ShapesOp")
+        def ExtendEdge(self, theEdge, theMin, theMax, theName=None):
+            """
+            Resize the input edge with the new Min and Max parameters.
+            The input edge parameters range is [0, 1]. If theMin parameter is
+            negative, the input edge is extended, otherwise it is shrinked by
+            theMin parameter. If theMax is greater than 1, the edge is extended,
+            otherwise it is shrinked by theMax parameter.
+
+            Parameters:
+                theEdge the input edge to be resized.
+                theMin the minimal parameter value.
+                theMax the maximal parameter value.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                New GEOM.GEOM_Object, containing the created edge.
+            """
+            theMin, theMax, Parameters = ParseParameters(theMin, theMax)
+            anObj = self.ShapesOp.ExtendEdge(theEdge, theMin, theMax)
+            RaiseIfFailed("ExtendEdge", self.ShapesOp)
+            anObj.SetParameters(Parameters)
+            self._autoPublish(anObj, theName, "edge")
+            return anObj
+
+        ## Resize the input face with the new UMin, UMax, VMin and VMax
+        #  parameters. The input face U and V parameters range is [0, 1]. If
+        #  theUMin parameter is negative, the input face is extended, otherwise
+        #  it is shrinked along U direction by theUMin parameter. If theUMax is
+        #  greater than 1, the face is extended, otherwise it is shrinked along
+        #  U direction by theUMax parameter. So as for theVMin, theVMax and
+        #  V direction of the input face.
+        #  @param theFace the input face to be resized.
+        #  @param theUMin the minimal U parameter value.
+        #  @param theUMax the maximal U parameter value.
+        #  @param theVMin the minimal V parameter value.
+        #  @param theVMax the maximal V parameter value.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #  @return New GEOM.GEOM_Object, containing the created face.
+        #
+        #  @ref tui_extend "Example"
+        @ManageTransactions("ShapesOp")
+        def ExtendFace(self, theFace, theUMin, theUMax,
+                       theVMin, theVMax, theName=None):
+            """
+            Resize the input face with the new UMin, UMax, VMin and VMax
+            parameters. The input face U and V parameters range is [0, 1]. If
+            theUMin parameter is negative, the input face is extended, otherwise
+            it is shrinked along U direction by theUMin parameter. If theUMax is
+            greater than 1, the face is extended, otherwise it is shrinked along
+            U direction by theUMax parameter. So as for theVMin, theVMax and
+            V direction of the input face.
+
+            Parameters:
+                theFace the input face to be resized.
+                theUMin the minimal U parameter value.
+                theUMax the maximal U parameter value.
+                theVMin the minimal V parameter value.
+                theVMax the maximal V parameter value.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                New GEOM.GEOM_Object, containing the created face.
+            """
+            theUMin, theUMax, theVMin, theVMax, Parameters = ParseParameters(theUMin, theUMax, theVMin, theVMax)
+            anObj = self.ShapesOp.ExtendFace(theFace, theUMin, theUMax,
+                                             theVMin, theVMax)
+            RaiseIfFailed("ExtendFace", self.ShapesOp)
+            anObj.SetParameters(Parameters)
+            self._autoPublish(anObj, theName, "face")
+            return anObj
+
+        ## This function takes some face as input parameter and creates new
+        #  GEOM_Object, i.e. topological shape by extracting underlying surface
+        #  of the source face and limiting it by the Umin, Umax, Vmin, Vmax
+        #  parameters of the source face (in the parametrical space).
+        #  @param theFace the input face.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #  @return New GEOM.GEOM_Object, containing the created face.
+        #
+        #  @ref tui_creation_surface "Example"
+        @ManageTransactions("ShapesOp")
+        def MakeSurfaceFromFace(self, theFace, theName=None):
+            """
+            This function takes some face as input parameter and creates new
+            GEOM_Object, i.e. topological shape by extracting underlying surface
+            of the source face and limiting it by the Umin, Umax, Vmin, Vmax
+            parameters of the source face (in the parametrical space).
+
+            Parameters:
+                theFace the input face.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                New GEOM.GEOM_Object, containing the created face.
+            """
+            anObj = self.ShapesOp.MakeSurfaceFromFace(theFace)
+            RaiseIfFailed("MakeSurfaceFromFace", self.ShapesOp)
+            self._autoPublish(anObj, theName, "surface")
+            return anObj
 
         # end of l4_obtain
         ## @}
@@ -6047,6 +6542,121 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(ListObj, theName, "subshape")
             return ListObj
 
+        ## Explode a shape into edges sorted in a row from a starting point.
+        #  @param theShape the shape to be exploded on edges.
+        #  @param theStartPoint the starting point.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #  @return List of GEOM.GEOM_Object that is actually an ordered list
+        #          of edges sorted in a row from a starting point.
+        #
+        #  @ref swig_GetSubShapeEdgeSorted "Example"
+        @ManageTransactions("ShapesOp")
+        def GetSubShapeEdgeSorted(self, theShape, theStartPoint, theName=None):
+            """
+            Explode a shape into edges sorted in a row from a starting point.
+
+            Parameters:
+                theShape the shape to be exploded on edges.
+                theStartPoint the starting point.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                List of GEOM.GEOM_Object that is actually an ordered list
+                of edges sorted in a row from a starting point.
+            """
+            # Example: see GEOM_TestAll.py
+            ListObj = self.ShapesOp.GetSubShapeEdgeSorted(theShape, theStartPoint)
+            RaiseIfFailed("GetSubShapeEdgeSorted", self.ShapesOp)
+            self._autoPublish(ListObj, theName, "SortedEdges")
+            return ListObj
+
+        ##
+        # Return the list of subshapes that satisfies a certain tolerance
+        # criterion. The user defines the type of shapes to be returned, the
+        # condition and the tolerance value. The operation is defined for
+        # faces, edges and vertices only. E.g. for theShapeType FACE,
+        # theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
+        # all faces of theShape that have tolerances greater then 1.e7.
+        #
+        #  @param theShape the shape to be exploded
+        #  @param theShapeType the type of sub-shapes to be returned (see
+        #         ShapeType()). Can have the values FACE, EDGE and VERTEX only.
+        #  @param theCondition the condition type (see GEOM::comparison_condition).
+        #  @param theTolerance the tolerance filter.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #  @return the list of shapes that satisfy the conditions.
+        #
+        #  @ref swig_GetSubShapesWithTolerance "Example"
+        @ManageTransactions("ShapesOp")
+        def GetSubShapesWithTolerance(self, theShape, theShapeType,
+                                      theCondition, theTolerance, theName=None):
+            """
+            Return the list of subshapes that satisfies a certain tolerance
+            criterion. The user defines the type of shapes to be returned, the
+            condition and the tolerance value. The operation is defined for
+            faces, edges and vertices only. E.g. for theShapeType FACE,
+            theCondition GEOM::CC_GT and theTolerance 1.e-7 this method returns
+            all faces of theShape that have tolerances greater then 1.e7.
+            
+            Parameters:
+                theShape the shape to be exploded
+                theShapeType the type of sub-shapes to be returned (see
+                             ShapeType()). Can have the values FACE,
+                             EDGE and VERTEX only.
+                theCondition the condition type (see GEOM::comparison_condition).
+                theTolerance the tolerance filter.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                The list of shapes that satisfy the conditions.
+            """
+            # Example: see GEOM_TestAll.py
+            ListObj = self.ShapesOp.GetSubShapesWithTolerance(theShape, EnumToLong(theShapeType),
+                                                              theCondition, theTolerance)
+            RaiseIfFailed("GetSubShapesWithTolerance", self.ShapesOp)
+            self._autoPublish(ListObj, theName, "SubShapeWithTolerance")
+            return ListObj
+
+        ## Check if the object is a sub-object of another GEOM object.
+        #  @param aSubObject Checked sub-object (or its parent object, in case if
+        #         \a theSubObjectIndex is non-zero).
+        #  @param anObject An object that is checked for ownership (or its parent object,
+        #         in case if \a theObjectIndex is non-zero).
+        #  @param aSubObjectIndex When non-zero, specifies a sub-shape index that
+        #         identifies a sub-object within its parent specified via \a theSubObject.
+        #  @param anObjectIndex When non-zero, specifies a sub-shape index that
+        #         identifies an object within its parent specified via \a theObject.
+        #  @return TRUE, if the given object contains sub-object.
+        @ManageTransactions("ShapesOp")
+        def IsSubShapeBelongsTo(self, aSubObject, anObject, aSubObjectIndex = 0, anObjectIndex = 0):
+            """
+            Check if the object is a sub-object of another GEOM object.
+            
+            Parameters:
+                aSubObject Checked sub-object (or its parent object, in case if
+                    \a theSubObjectIndex is non-zero).
+                anObject An object that is checked for ownership (or its parent object,
+                    in case if \a theObjectIndex is non-zero).
+                aSubObjectIndex When non-zero, specifies a sub-shape index that
+                    identifies a sub-object within its parent specified via \a theSubObject.
+                anObjectIndex When non-zero, specifies a sub-shape index that
+                    identifies an object within its parent specified via \a theObject.
+
+            Returns
+                TRUE, if the given object contains sub-object.
+            """
+            IsOk = self.ShapesOp.IsSubShapeBelongsTo(aSubObject, aSubObjectIndex, anObject, anObjectIndex)
+            RaiseIfFailed("IsSubShapeBelongsTo", self.ShapesOp)
+            return IsOk
+
         # end of l4_decompose
         ## @}
 
@@ -6126,6 +6736,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  - \b FixFaceSize.Tolerance - defines minimum possible face size. \n
         #  - \b DropSmallEdges - removes edges, which merge with neighbouring edges. \n
         #  - \b DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.\n
+        #  - \b DropSmallSolids - either removes small solids or merges them with neighboring ones. \n
+        #  - \b DropSmallSolids.WidthFactorThreshold - defines maximum value of <em>2V/S</em> of a solid which is considered small, where \a V is volume and \a S is surface area of the solid. \n
+        #  - \b DropSmallSolids.VolumeThreshold - defines maximum volume of a solid which is considered small. If the both tolerances are privided a solid is considered small if it meets the both criteria. \n
+        #  - \b DropSmallSolids.MergeSolids - if "1", small solids are removed; if "0" small solids are merged to adjacent non-small solids or left untouched if cannot be merged. \n
         #
         #  * \b SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical
         #    surfaces in segments using a certain angle. \n
@@ -6195,9 +6809,9 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 theShape Shape to be processed.
                 theValues List of values of parameters, in the same order
                           as parameters are listed in theParameters list.
-                theOperators List of names of operators ("FixShape", "SplitClosedFaces", etc.).
+                theOperators List of names of operators ('FixShape', 'SplitClosedFaces', etc.).
                 theParameters List of names of parameters
-                              ("FixShape.Tolerance3d", "SplitClosedFaces.NbSplitPoints", etc.).
+                              ('FixShape.Tolerance3d', 'SplitClosedFaces.NbSplitPoints', etc.).
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -6209,8 +6823,13 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                      * FixShape.MaxTolerance3d - maximal possible tolerance of the shape after correction.
                  * FixFaceSize - removes small faces, such as spots and strips.
                      * FixFaceSize.Tolerance - defines minimum possible face size.
-                     * DropSmallEdges - removes edges, which merge with neighbouring edges.
+                 * DropSmallEdges - removes edges, which merge with neighbouring edges.
                      * DropSmallEdges.Tolerance3d - defines minimum possible distance between two parallel edges.
+                 * DropSmallSolids - either removes small solids or merges them with neighboring ones.
+                     * DropSmallSolids.WidthFactorThreshold - defines maximum value of 2V/S of a solid which is considered small, where V is volume and S is surface area of the solid.
+                     * DropSmallSolids.VolumeThreshold - defines maximum volume of a solid which is considered small. If the both tolerances are privided a solid is considered small if it meets the both criteria.
+                     * DropSmallSolids.MergeSolids - if '1', small solids are removed; if '0' small solids are merged to adjacent non-small solids or left untouched if cannot be merged.
+
                  * SplitAngle - splits faces based on conical surfaces, surfaces of revolution and cylindrical surfaces
                                 in segments using a certain angle.
                      * SplitAngle.Angle - the central angle of the resulting segments (i.e. we obtain two segments
@@ -6317,7 +6936,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "suppressFaces")
             return anObj
 
-        ## Sewing of some shapes into single shape.
+        ## Sewing of faces into a single shell.
         #  @param ListShape Shapes to be processed.
         #  @param theTolerance Required tolerance value.
         #  @param AllowNonManifold Flag that allows non-manifold sewing.
@@ -6325,12 +6944,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing processed shape.
+        #  @return New GEOM.GEOM_Object, containing a result shell.
         #
         #  @ref tui_sewing "Example"
         def MakeSewing(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
             """
-            Sewing of some shapes into single shape.
+            Sewing of faces into a single shell.
 
             Parameters:
                 ListShape Shapes to be processed.
@@ -6341,30 +6960,29 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing processed shape.
+                New GEOM.GEOM_Object, containing containing a result shell.
             """
             # Example: see GEOM_TestHealing.py
-            comp = self.MakeCompound(ListShape)
             # note: auto-publishing is done in self.Sew()
-            anObj = self.Sew(comp, theTolerance, AllowNonManifold, theName)
+            anObj = self.Sew(ListShape, theTolerance, AllowNonManifold, theName)
             return anObj
 
-        ## Sewing of the given object.
-        #  @param theObject Shape to be processed.
+        ## Sewing of faces into a single shell.
+        #  @param ListShape Shapes to be processed.
         #  @param theTolerance Required tolerance value.
         #  @param AllowNonManifold Flag that allows non-manifold sewing.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing processed shape.
+        #  @return New GEOM.GEOM_Object, containing a result shell.
         @ManageTransactions("HealOp")
-        def Sew(self, theObject, theTolerance, AllowNonManifold=False, theName=None):
+        def Sew(self, ListShape, theTolerance, AllowNonManifold=False, theName=None):
             """
-            Sewing of the given object.
+            Sewing of faces into a single shell.
 
             Parameters:
-                theObject Shape to be processed.
+                ListShape Shapes to be processed.
                 theTolerance Required tolerance value.
                 AllowNonManifold Flag that allows non-manifold sewing.
                 theName Object name; when specified, this parameter is used
@@ -6372,25 +6990,26 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing processed shape.
+                New GEOM.GEOM_Object, containing a result shell.
             """
             # Example: see MakeSewing() above
             theTolerance,Parameters = ParseParameters(theTolerance)
             if AllowNonManifold:
-                anObj = self.HealOp.SewAllowNonManifold(theObject, theTolerance)
+                anObj = self.HealOp.SewAllowNonManifold( ToList( ListShape ), theTolerance)
             else:
-                anObj = self.HealOp.Sew(theObject, theTolerance)
+                anObj = self.HealOp.Sew( ToList( ListShape ), theTolerance)
             # To avoid script failure in case of good argument shape
+            # (Fix of test cases geom/bugs11/L7,L8)
             if self.HealOp.GetErrorCode() == "ShHealOper_NotError_msg":
-                return theObject
+                return anObj
             RaiseIfFailed("Sew", self.HealOp)
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "sewed")
             return anObj
 
-        ## Rebuild the topology of theCompound of solids by removing
-        #  of the faces that are shared by several solids.
-        #  @param theCompound Shape to be processed.
+        ## Rebuild the topology of theSolids by removing
+        #  the faces that are shared by several solids.
+        #  @param theSolids A compound or a list of solids to be processed.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -6399,13 +7018,13 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_remove_webs "Example"
         @ManageTransactions("HealOp")
-        def RemoveInternalFaces (self, theCompound, theName=None):
+        def RemoveInternalFaces (self, theSolids, theName=None):
             """
-            Rebuild the topology of theCompound of solids by removing
-            of the faces that are shared by several solids.
+            Rebuild the topology of theSolids by removing
+            the faces that are shared by several solids.
 
             Parameters:
-                theCompound Shape to be processed.
+                theSolids A compound or a list of solids to be processed.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -6414,7 +7033,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 New GEOM.GEOM_Object, containing processed shape.
             """
             # Example: see GEOM_TestHealing.py
-            anObj = self.HealOp.RemoveInternalFaces(theCompound)
+            anObj = self.HealOp.RemoveInternalFaces(ToList(theSolids))
             RaiseIfFailed("RemoveInternalFaces", self.HealOp)
             self._autoPublish(anObj, theName, "removeWebs")
             return anObj
@@ -6565,6 +7184,45 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "divideEdge")
             return anObj
 
+        ## Addition of points to a given edge of \a theObject by projecting
+        #  other points to the given edge.
+        #  @param theObject Shape to be processed.
+        #  @param theEdgeIndex Index of edge to be divided within theObject's shape,
+        #                      if -1, then theObject itself is the edge.
+        #  @param thePoints List of points to project to theEdgeIndex-th edge.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #
+        #  @return New GEOM.GEOM_Object, containing processed shape.
+        #
+        #  @ref tui_add_point_on_edge "Example"
+        @ManageTransactions("HealOp")
+        def DivideEdgeByPoint(self, theObject, theEdgeIndex, thePoints, theName=None):
+            """
+            Addition of points to a given edge of \a theObject by projecting
+            other points to the given edge.
+
+            Parameters:
+                theObject Shape to be processed.
+                theEdgeIndex The edge or its index to be divided within theObject's shape,
+                             if -1, then theObject itself is the edge.
+                thePoints List of points to project to theEdgeIndex-th edge.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                New GEOM.GEOM_Object, containing processed shape.
+            """
+            # Example: see GEOM_TestHealing.py
+            if isinstance( theEdgeIndex, GEOM._objref_GEOM_Object ):
+                theEdgeIndex = self.GetSubShapeID( theObject, theEdgeIndex )
+            anObj = self.HealOp.DivideEdgeByPoint(theObject, theEdgeIndex, ToList( thePoints ))
+            RaiseIfFailed("DivideEdgeByPoint", self.HealOp)
+            self._autoPublish(anObj, theName, "divideEdge")
+            return anObj
+
         ## Suppress the vertices in the wire in case if adjacent edges are C1 continuous.
         #  @param theWire Wire to minimize the number of C1 continuous edges in.
         #  @param theVertices A list of vertices to suppress. If the list
@@ -6687,7 +7345,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  \n \a theClosedWires: Closed wires on the free boundary of the given shape.
         #  \n \a theOpenWires: Open wires on the free boundary of the given shape.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_free_boundaries_page "Example"
         @ManageTransactions("HealOp")
         def GetFreeBoundary(self, theObject, theName=None):
             """
@@ -6707,14 +7365,14 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                  theOpenWires: Open wires on the free boundary of the given shape.
             """
             # Example: see GEOM_TestHealing.py
-            anObj = self.HealOp.GetFreeBoundary(theObject)
+            anObj = self.HealOp.GetFreeBoundary( ToList( theObject ))
             RaiseIfFailed("GetFreeBoundary", self.HealOp)
             self._autoPublish(anObj[1], theName, "closedWire")
             self._autoPublish(anObj[2], theName, "openWire")
             return anObj
 
-        ## Replace coincident faces in theShape by one face.
-        #  @param theShape Initial shape.
+        ## Replace coincident faces in \a theShapes by one face.
+        #  @param theShapes Initial shapes, either a list or compound of shapes.
         #  @param theTolerance Maximum distance between faces, which can be considered as coincident.
         #  @param doKeepNonSolids If FALSE, only solids will present in the result,
         #                         otherwise all initial shapes.
@@ -6722,16 +7380,16 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
+        #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
         #
         #  @ref tui_glue_faces "Example"
         @ManageTransactions("ShapesOp")
-        def MakeGlueFaces(self, theShape, theTolerance, doKeepNonSolids=True, theName=None):
+        def MakeGlueFaces(self, theShapes, theTolerance, doKeepNonSolids=True, theName=None):
             """
-            Replace coincident faces in theShape by one face.
+            Replace coincident faces in theShapes by one face.
 
             Parameters:
-                theShape Initial shape.
+                theShapes Initial shapes, either a list or compound of shapes.
                 theTolerance Maximum distance between faces, which can be considered as coincident.
                 doKeepNonSolids If FALSE, only solids will present in the result,
                                 otherwise all initial shapes.
@@ -6740,19 +7398,19 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing a copy of theShape without coincident faces.
+                New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
             """
             # Example: see GEOM_Spanner.py
             theTolerance,Parameters = ParseParameters(theTolerance)
-            anObj = self.ShapesOp.MakeGlueFaces(theShape, theTolerance, doKeepNonSolids)
+            anObj = self.ShapesOp.MakeGlueFaces(ToList(theShapes), theTolerance, doKeepNonSolids)
             if anObj is None:
                 raise RuntimeError, "MakeGlueFaces : " + self.ShapesOp.GetErrorCode()
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "glueFaces")
             return anObj
 
-        ## Find coincident faces in theShape for possible gluing.
-        #  @param theShape Initial shape.
+        ## Find coincident faces in \a theShapes for possible gluing.
+        #  @param theShapes Initial shapes, either a list or compound of shapes.
         #  @param theTolerance Maximum distance between faces,
         #                      which can be considered as coincident.
         #  @param theName Object name; when specified, this parameter is used
@@ -6763,12 +7421,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_glue_faces "Example"
         @ManageTransactions("ShapesOp")
-        def GetGlueFaces(self, theShape, theTolerance, theName=None):
+        def GetGlueFaces(self, theShapes, theTolerance, theName=None):
             """
-            Find coincident faces in theShape for possible gluing.
+            Find coincident faces in theShapes for possible gluing.
 
             Parameters:
-                theShape Initial shape.
+                theShapes Initial shapes, either a list or compound of shapes.
                 theTolerance Maximum distance between faces,
                              which can be considered as coincident.
                 theName Object name; when specified, this parameter is used
@@ -6778,14 +7436,14 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Returns:
                 GEOM.ListOfGO
             """
-            anObj = self.ShapesOp.GetGlueFaces(theShape, theTolerance)
+            anObj = self.ShapesOp.GetGlueFaces(ToList(theShapes), theTolerance)
             RaiseIfFailed("GetGlueFaces", self.ShapesOp)
             self._autoPublish(anObj, theName, "facesToGlue")
             return anObj
 
-        ## Replace coincident faces in theShape by one face
+        ## Replace coincident faces in \a theShapes by one face
         #  in compliance with given list of faces
-        #  @param theShape Initial shape.
+        #  @param theShapes Initial shapes, either a list or compound of shapes.
         #  @param theTolerance Maximum distance between faces,
         #                      which can be considered as coincident.
         #  @param theFaces List of faces for gluing.
@@ -6798,19 +7456,18 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing a copy of theShape
-        #          without some faces.
+        #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
         #
         #  @ref tui_glue_faces "Example"
         @ManageTransactions("ShapesOp")
-        def MakeGlueFacesByList(self, theShape, theTolerance, theFaces,
+        def MakeGlueFacesByList(self, theShapes, theTolerance, theFaces,
                                 doKeepNonSolids=True, doGlueAllEdges=True, theName=None):
             """
-            Replace coincident faces in theShape by one face
+            Replace coincident faces in theShapes by one face
             in compliance with given list of faces
 
             Parameters:
-                theShape Initial shape.
+                theShapes theShapes Initial shapes, either a list or compound of shapes.
                 theTolerance Maximum distance between faces,
                              which can be considered as coincident.
                 theFaces List of faces for gluing.
@@ -6824,51 +7481,50 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing a copy of theShape
-                    without some faces.
+                New GEOM.GEOM_Object, containing copies of theShapes without coincident faces.
             """
-            anObj = self.ShapesOp.MakeGlueFacesByList(theShape, theTolerance, theFaces,
+            anObj = self.ShapesOp.MakeGlueFacesByList(ToList(theShapes), theTolerance, ToList(theFaces),
                                                       doKeepNonSolids, doGlueAllEdges)
             if anObj is None:
                 raise RuntimeError, "MakeGlueFacesByList : " + self.ShapesOp.GetErrorCode()
             self._autoPublish(anObj, theName, "glueFaces")
             return anObj
 
-        ## Replace coincident edges in theShape by one edge.
-        #  @param theShape Initial shape.
+        ## Replace coincident edges in \a theShapes by one edge.
+        #  @param theShapes Initial shapes, either a list or compound of shapes.
         #  @param theTolerance Maximum distance between edges, which can be considered as coincident.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
+        #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
         #
         #  @ref tui_glue_edges "Example"
         @ManageTransactions("ShapesOp")
-        def MakeGlueEdges(self, theShape, theTolerance, theName=None):
+        def MakeGlueEdges(self, theShapes, theTolerance, theName=None):
             """
-            Replace coincident edges in theShape by one edge.
+            Replace coincident edges in theShapes by one edge.
 
             Parameters:
-                theShape Initial shape.
+                theShapes Initial shapes, either a list or compound of shapes.
                 theTolerance Maximum distance between edges, which can be considered as coincident.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing a copy of theShape without coincident edges.
+                New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
             """
             theTolerance,Parameters = ParseParameters(theTolerance)
-            anObj = self.ShapesOp.MakeGlueEdges(theShape, theTolerance)
+            anObj = self.ShapesOp.MakeGlueEdges(ToList(theShapes), theTolerance)
             if anObj is None:
                 raise RuntimeError, "MakeGlueEdges : " + self.ShapesOp.GetErrorCode()
             anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "glueEdges")
             return anObj
 
-        ## Find coincident edges in theShape for possible gluing.
-        #  @param theShape Initial shape.
+        ## Find coincident edges in \a theShapes for possible gluing.
+        #  @param theShapes Initial shapes, either a list or compound of shapes.
         #  @param theTolerance Maximum distance between edges,
         #                      which can be considered as coincident.
         #  @param theName Object name; when specified, this parameter is used
@@ -6879,12 +7535,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_glue_edges "Example"
         @ManageTransactions("ShapesOp")
-        def GetGlueEdges(self, theShape, theTolerance, theName=None):
+        def GetGlueEdges(self, theShapes, theTolerance, theName=None):
             """
-            Find coincident edges in theShape for possible gluing.
+            Find coincident edges in theShapes for possible gluing.
 
             Parameters:
-                theShape Initial shape.
+                theShapes Initial shapes, either a list or compound of shapes.
                 theTolerance Maximum distance between edges,
                              which can be considered as coincident.
                 theName Object name; when specified, this parameter is used
@@ -6894,14 +7550,14 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             Returns:
                 GEOM.ListOfGO
             """
-            anObj = self.ShapesOp.GetGlueEdges(theShape, theTolerance)
+            anObj = self.ShapesOp.GetGlueEdges(ToList(theShapes), theTolerance)
             RaiseIfFailed("GetGlueEdges", self.ShapesOp)
             self._autoPublish(anObj, theName, "edgesToGlue")
             return anObj
 
-        ## Replace coincident edges in theShape by one edge
+        ## Replace coincident edges in theShapes by one edge
         #  in compliance with given list of edges.
-        #  @param theShape Initial shape.
+        #  @param theShapes Initial shapes, either a list or compound of shapes.
         #  @param theTolerance Maximum distance between edges,
         #                      which can be considered as coincident.
         #  @param theEdges List of edges for gluing.
@@ -6909,18 +7565,17 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
         #
-        #  @return New GEOM.GEOM_Object, containing a copy of theShape
-        #          without some edges.
+        #  @return New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
         #
         #  @ref tui_glue_edges "Example"
         @ManageTransactions("ShapesOp")
-        def MakeGlueEdgesByList(self, theShape, theTolerance, theEdges, theName=None):
+        def MakeGlueEdgesByList(self, theShapes, theTolerance, theEdges, theName=None):
             """
-            Replace coincident edges in theShape by one edge
+            Replace coincident edges in theShapes by one edge
             in compliance with given list of edges.
 
             Parameters:
-                theShape Initial shape.
+                theShapes Initial shapes, either a list or compound of shapes.
                 theTolerance Maximum distance between edges,
                              which can be considered as coincident.
                 theEdges List of edges for gluing.
@@ -6929,10 +7584,9 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                         publication is switched on, default value is used for result name.
 
             Returns:
-                New GEOM.GEOM_Object, containing a copy of theShape
-                without some edges.
+                New GEOM.GEOM_Object, containing copies of theShapes without coincident edges.
             """
-            anObj = self.ShapesOp.MakeGlueEdgesByList(theShape, theTolerance, theEdges)
+            anObj = self.ShapesOp.MakeGlueEdgesByList(ToList(theShapes), theTolerance, theEdges)
             if anObj is None:
                 raise RuntimeError, "MakeGlueEdgesByList : " + self.ShapesOp.GetErrorCode()
             self._autoPublish(anObj, theName, "glueEdges")
@@ -7175,18 +7829,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theShape2 Second argument for boolean operation.
         #  @param checkSelfInte The flag that tells if the arguments should
         #         be checked for self-intersection prior to the operation.
+        #         If a self-intersection detected the operation fails.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
-        #
-        #  @note This algorithm doesn't find all types of self-intersections.
-        #        It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
-        #        vertex/face and edge/face intersections. Face/face
-        #        intersections detection is switched off as it is a
-        #        time-consuming operation that gives an impact on performance.
-        #        To find all self-intersections please use
-        #        CheckSelfIntersections() method.
-        #
         #  @return New GEOM.GEOM_Object, containing the result shape.
         #
         #  @ref tui_section "Example 1"
@@ -7199,21 +7845,11 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 theShape1 First argument for boolean operation.
                 theShape2 Second argument for boolean operation.
                 checkSelfInte The flag that tells if the arguments should
-                              be checked for self-intersection prior to
-                              the operation.
+                              be checked for self-intersection prior to the operation.
+                              If a self-intersection detected the operation fails.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
-
-            Note:
-                    This algorithm doesn't find all types of self-intersections.
-                    It is tuned to detect vertex/vertex, vertex/edge, edge/edge,
-                    vertex/face and edge/face intersections. Face/face
-                    intersections detection is switched off as it is a
-                    time-consuming operation that gives an impact on performance.
-                    To find all self-intersections please use
-                    CheckSelfIntersections() method.
-
             Returns:
                 New GEOM.GEOM_Object, containing the result shape.
 
@@ -7583,6 +8219,23 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @return New GEOM.GEOM_Object, containing the result shape.
         #
+        #  @note This operation is a shortcut to the more general @ref MakePartition
+        #  operation, where @a theShape specifies single "object" (shape being partitioned)
+        #  and @a thePlane specifies single "tool" (intersector shape). Other parameters of
+        #  @ref MakePartition operation have default values:
+        #  - @a Limit: GEOM::SHAPE (shape limit corresponds to the type of @a theShape)
+        #  - @a KeepNonlimitShapes: 0
+        #  - @a KeepInside, @a RemoveInside, @a RemoveWebs,
+        #    @a Materials (obsolete parameters): empty
+        #
+        #  @note I.e. the following two operations are equivalent:
+        #  @code
+        #  Result = geompy.MakeHalfPartition(Object, Plane)
+        #  Result = geompy.MakePartition([Object], [Plane])
+        #  @endcode
+        #
+        #  @sa MakePartition, MakePartitionNonSelfIntersectedShape
+        #
         #  @ref tui_partition "Example"
         @ManageTransactions("BoolOp")
         def MakeHalfPartition(self, theShape, thePlane, theName=None):
@@ -7598,6 +8251,18 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
             Returns:
                 New GEOM.GEOM_Object, containing the result shape.
+         
+            Note: This operation is a shortcut to the more general MakePartition
+            operation, where theShape specifies single "object" (shape being partitioned)
+            and thePlane specifies single "tool" (intersector shape). Other parameters of
+            MakePartition operation have default values:
+            - Limit: GEOM::SHAPE (shape limit corresponds to the type of theShape)
+            - KeepNonlimitShapes: 0
+            - KeepInside, RemoveInside, RemoveWebs, Materials (obsolete parameters): empty
+         
+            I.e. the following two operations are equivalent:
+              Result = geompy.MakeHalfPartition(Object, Plane)
+              Result = geompy.MakePartition([Object], [Plane])
             """
             # Example: see GEOM_TestAll.py
             anObj = self.BoolOp.MakeHalfPartition(theShape, thePlane)
@@ -8571,9 +9236,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "offset")
             return anObj
 
-        ## Create new object as projection of the given one on a 2D surface.
+        ## Create new object as projection of the given one on another.
         #  @param theSource The source object for the projection. It can be a point, edge or wire.
-        #  @param theTarget The target object. It can be planar or cylindrical face.
+        #         Edge and wire are acceptable if @a theTarget is a face.
+        #  @param theTarget The target object. It can be planar or cylindrical face, edge or wire.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -8584,11 +9250,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         @ManageTransactions("TrsfOp")
         def MakeProjection(self, theSource, theTarget, theName=None):
             """
-            Create new object as projection of the given one on a 2D surface.
+            Create new object as projection of the given one on another.
 
             Parameters:
                 theSource The source object for the projection. It can be a point, edge or wire.
-                theTarget The target object. It can be planar or cylindrical face.
+                          Edge and wire are acceptable if theTarget is a face.
+                theTarget The target object. It can be planar or cylindrical face, edge or wire.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -8602,7 +9269,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             self._autoPublish(anObj, theName, "projection")
             return anObj
 
-        ## Create a projection projection of the given point on a wire or an edge.
+        ## Create a projection of the given point on a wire or an edge.
         #  If there are no solutions or there are 2 or more solutions It throws an
         #  exception.
         #  @param thePoint the point to be projected.
@@ -8620,7 +9287,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         @ManageTransactions("TrsfOp")
         def MakeProjectionOnWire(self, thePoint, theWire, theName=None):
             """
-            Create a projection projection of the given point on a wire or an edge.
+            Create a projection of the given point on a wire or an edge.
             If there are no solutions or there are 2 or more solutions It throws an
             exception.
 
@@ -9003,6 +9670,91 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             anObj = self.MultiRotate2DByStep(aShape, aVec, anAngle, nbtimes1, aStep, nbtimes2, theName)
             return anObj
 
+        ##
+        #  Compute a wire or a face that represents a projection of the source
+        #  shape onto cylinder. The cylinder's coordinate system is the same
+        #  as the global coordinate system.
+        #
+        #  @param theObject The object to be projected. It can be either
+        #         a planar wire or a face.
+        #  @param theRadius The radius of the cylinder.
+        #  @param theStartAngle The starting angle in radians from
+        #         the cylinder's X axis around Z axis. The angle from which
+        #         the projection is started.
+        #  @param theAngleLength The projection length angle in radians.
+        #         The angle in which to project the total length of the wire.
+        #         If it is negative the projection is not scaled and natural
+        #         wire length is kept for the projection.
+        #  @param theAngleRotation The desired angle in radians between
+        #         the tangent vector to the first curve at the first point of
+        #         the theObject's projection in 2D space and U-direction of
+        #         cylinder's 2D space.
+        #  @param theName Object name; when specified, this parameter is used
+        #         for result publication in the study. Otherwise, if automatic
+        #         publication is switched on, default value is used for result name.
+        #
+        #  @return New GEOM.GEOM_Object, containing the result shape. The result
+        #         represents a wire or a face that represents a projection of
+        #         the source shape onto a cylinder.
+        #
+        #  @ref tui_projection "Example"
+        def MakeProjectionOnCylinder (self, theObject, theRadius,
+                                      theStartAngle=0.0, theAngleLength=-1.0,
+                                      theAngleRotation=0.0,
+                                      theName=None):
+            """
+            Compute a wire or a face that represents a projection of the source
+            shape onto cylinder. The cylinder's coordinate system is the same
+            as the global coordinate system.
+
+            Parameters:
+                theObject The object to be projected. It can be either
+                        a planar wire or a face.
+                theRadius The radius of the cylinder.
+                theStartAngle The starting angle in radians from the cylinder's X axis
+                        around Z axis. The angle from which the projection is started.
+                theAngleLength The projection length angle in radians. The angle in which
+                        to project the total length of the wire. If it is negative the
+                        projection is not scaled and natural wire length is kept for
+                        the projection.
+                theAngleRotation The desired angle in radians between
+                        the tangent vector to the first curve at the first
+                        point of the theObject's projection in 2D space and
+                        U-direction of cylinder's 2D space.
+                theName Object name; when specified, this parameter is used
+                        for result publication in the study. Otherwise, if automatic
+                        publication is switched on, default value is used for result name.
+
+            Returns:
+                New GEOM.GEOM_Object, containing the result shape. The result
+                represents a wire or a face that represents a projection of
+                the source shape onto a cylinder.
+            """
+            # Example: see GEOM_TestAll.py
+            flagStartAngle = False
+            if isinstance(theStartAngle,str):
+                flagStartAngle = True
+            flagAngleLength = False
+            if isinstance(theAngleLength,str):
+                flagAngleLength = True
+            flagAngleRotation = False
+            if isinstance(theAngleRotation,str):
+                flagAngleRotation = True
+            theRadius, theStartAngle, theAngleLength, theAngleRotation, Parameters = ParseParameters(
+              theRadius, theStartAngle, theAngleLength, theAngleRotation)
+            if flagStartAngle:
+                theStartAngle = theStartAngle*math.pi/180.
+            if flagAngleLength:
+                theAngleLength = theAngleLength*math.pi/180.
+            if flagAngleRotation:
+                theAngleRotation = theAngleRotation*math.pi/180.
+            anObj = self.TrsfOp.MakeProjectionOnCylinder(theObject, theRadius,
+                theStartAngle, theAngleLength, theAngleRotation)
+            RaiseIfFailed("MakeProjectionOnCylinder", self.TrsfOp)
+            anObj.SetParameters(Parameters)
+            self._autoPublish(anObj, theName, "projection")
+            return anObj
+
         # end of l3_transform
         ## @}
 
@@ -9588,6 +10340,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theBase Closed edge or wire defining the base shape to be extruded.
         #  @param theH Prism dimension along the normal to theBase
         #  @param theAngle Draft angle in degrees.
+        #  @param theInvert If true material changes the direction
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -9596,7 +10349,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_creation_prism "Example"
         @ManageTransactions("PrimOp")
-        def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theName=None):
+        def MakeExtrudedCut(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
             """
             Add material to a solid by extrusion of the base shape on the given distance.
 
@@ -9605,6 +10358,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 theBase Closed edge or wire defining the base shape to be extruded.
                 theH Prism dimension along the normal  to theBase
                 theAngle Draft angle in degrees.
+                theInvert If true material changes the direction.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -9613,10 +10367,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 New GEOM.GEOM_Object,  containing the initial shape with removed material.
             """
             # Example: see GEOM_TestAll.py
-            #theH,Parameters = ParseParameters(theH)
-            anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False)
+            theH,theAngle,Parameters = ParseParameters(theH,theAngle)
+            anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, False, theInvert)
             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
-            #anObj.SetParameters(Parameters)
+            anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "extrudedCut")
             return anObj
 
@@ -9626,6 +10380,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theBase Closed edge or wire defining the base shape to be extruded.
         #  @param theH Prism dimension along the normal to theBase
         #  @param theAngle Draft angle in degrees.
+        #  @param theInvert If true material changes the direction
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -9634,7 +10389,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @ref tui_creation_prism "Example"
         @ManageTransactions("PrimOp")
-        def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theName=None):
+        def MakeExtrudedBoss(self, theInit, theBase, theH, theAngle, theInvert=False, theName=None):
             """
             Add material to a solid by extrusion of the base shape on the given distance.
 
@@ -9643,6 +10398,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 theBase Closed edge or wire defining the base shape to be extruded.
                 theH Prism dimension along the normal  to theBase
                 theAngle Draft angle in degrees.
+                theInvert If true material changes the direction.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -9651,10 +10407,10 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 New GEOM.GEOM_Object,  containing the initial shape with added material.
             """
             # Example: see GEOM_TestAll.py
-            #theH,Parameters = ParseParameters(theH)
-            anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True)
+            theH,theAngle,Parameters = ParseParameters(theH,theAngle)
+            anObj = self.PrimOp.MakeDraftPrism(theInit, theBase, theH, theAngle, True, theInvert)
             RaiseIfFailed("MakeExtrudedBoss", self.PrimOp)
-            #anObj.SetParameters(Parameters)
+            anObj.SetParameters(Parameters)
             self._autoPublish(anObj, theName, "extrudedBoss")
             return anObj
 
@@ -9667,7 +10423,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Perform an Archimde operation on the given shape with given parameters.
         #  The object presenting the resulting face is returned.
         #  @param theShape Shape to be put in water.
-        #  @param theWeight Weight og the shape.
+        #  @param theWeight Weight of the shape.
         #  @param theWaterDensity Density of the water.
         #  @param theMeshDeflection Deflection of the mesh, using to compute the section.
         #  @param theName Object name; when specified, this parameter is used
@@ -9686,7 +10442,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
             Parameters:
                 theShape Shape to be put in water.
-                theWeight Weight og the shape.
+                theWeight Weight of the shape.
                 theWaterDensity Density of the water.
                 theMeshDeflection Deflection of the mesh, using to compute the section.
                 theName Object name; when specified, this parameter is used
@@ -9715,7 +10471,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Get point coordinates
         #  @return [x, y, z]
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_point_coordinates_page "Example"
         @ManageTransactions("MeasuOp")
         def PointCoordinates(self,Point):
             """
@@ -9791,7 +10547,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  theSurfArea: Area of surface of the given shape.\n
         #  theVolume:   Volume of the given shape.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_basic_properties_page "Example"
         @ManageTransactions("MeasuOp")
         def BasicProperties(self,theShape):
             """
@@ -9820,7 +10576,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  Ymin,Ymax: Limits of shape along OY axis.
         #  Zmin,Zmax: Limits of shape along OZ axis.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_bounding_box_page "Example"
         @ManageTransactions("MeasuOp")
         def BoundingBox (self, theShape, precise=False):
             """
@@ -9850,7 +10606,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @return New GEOM.GEOM_Object, containing the created box.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_bounding_box_page "Example"
         @ManageTransactions("MeasuOp")
         def MakeBoundingBox (self, theShape, precise=False, theName=None):
             """
@@ -9878,7 +10634,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  I(1-3)(1-3): Components of the inertia matrix of the given shape.
         #  Ix,Iy,Iz:    Moments of inertia of the given shape.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_inertia_page "Example"
         @ManageTransactions("MeasuOp")
         def Inertia(self,theShape):
             """
@@ -9921,7 +10677,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theShape1,theShape2 Shapes to find minimal distance between.
         #  @return Value of the minimal distance between the given shapes.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_min_distance_page "Example"
         @ManageTransactions("MeasuOp")
         def MinDistance(self, theShape1, theShape2):
             """
@@ -9943,7 +10699,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @return Value of the minimal distance between the given shapes, in form of list
         #          [Distance, DX, DY, DZ].
         #
-        #  @ref swig_all_measure "Example"
+        #  @ref tui_min_distance_page "Example"
         @ManageTransactions("MeasuOp")
         def MinDistanceComponents(self, theShape1, theShape2):
             """
@@ -9967,7 +10723,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @return The number of found solutions (-1 in case of infinite number of
         #          solutions) and a list of (X, Y, Z) coordinates for all couples of points.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_min_distance_page "Example"
         @ManageTransactions("MeasuOp")
         def ClosestPoints (self, theShape1, theShape2):
             """
@@ -9991,7 +10747,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #        with their orientations, otherwise the minimum angle is computed.
         #  @return Value of the angle between the given shapes in degrees.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_angle_page "Example"
         @ManageTransactions("MeasuOp")
         def GetAngle(self, theShape1, theShape2):
             """
@@ -10018,7 +10774,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #        with their orientations, otherwise the minimum angle is computed.
         #  @return Value of the angle between the given shapes in radians.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_angle_page "Example"
         @ManageTransactions("MeasuOp")
         def GetAngleRadians(self, theShape1, theShape2):
             """
@@ -10046,7 +10802,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #                 if False, the opposite vector to the normal vector is used.
         #  @return Value of the angle between the given vectors in degrees.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_angle_page "Example"
         @ManageTransactions("MeasuOp")
         def GetAngleVectors(self, theShape1, theShape2, theFlag = True):
             """
@@ -10239,7 +10995,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  EdgeMin,EdgeMax: Min and max tolerances of the edges.\n
         #  VertMin,VertMax: Min and max tolerances of the vertices.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_tolerance_page "Example"
         @ManageTransactions("MeasuOp")
         def Tolerance(self,theShape):
             """
@@ -10263,7 +11019,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @param theShape Shape to be described.
         #  @return Description of the given shape.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_whatis_page "Example"
         @ManageTransactions("MeasuOp")
         def WhatIs(self,theShape):
             """
@@ -10332,14 +11088,17 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             return aDict
 
         def GetCreationInformation(self, theShape):
-            info = theShape.GetCreationInformation()
-            # operationName
-            opName = info.operationName
-            if not opName: opName = "no info available"
-            res = "Operation: " + opName
-            # parameters
-            for parVal in info.params:
-                res += " \n %s = %s" % ( parVal.name, parVal.value )
+            res = ''
+            infos = theShape.GetCreationInformation()
+            for info in infos:
+                # operationName
+                opName = info.operationName
+                if not opName: opName = "no info available"
+                if res: res += "\n"
+                res += "Operation: " + opName
+                # parameters
+                for parVal in info.params:
+                    res += "\n \t%s = %s" % ( parVal.name, parVal.value )
             return res
 
         ## Get a point, situated at the centre of mass of theShape.
@@ -10350,7 +11109,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #
         #  @return New GEOM.GEOM_Object, containing the created point.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_center_of_mass_page "Example"
         @ManageTransactions("MeasuOp")
         def MakeCDG(self, theShape, theName=None):
             """
@@ -10496,7 +11255,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @return If theReturnStatus is equal to 1 the description is returned.
         #          Otherwise doesn't return anything.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_check_shape_page "Example"
         @ManageTransactions("MeasuOp")
         def PrintShapeErrors(self, theShape, theShapeErrors, theReturnStatus = 0):
             """
@@ -10536,7 +11295,7 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #          If theReturnStatus is equal to 2 the list of error data is
         #          returned along with IsValid flag.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_check_shape_page "Example"
         @ManageTransactions("MeasuOp")
         def CheckShape(self,theShape, theIsCheckGeom = 0, theReturnStatus = 0):
             """
@@ -10581,25 +11340,109 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
         ## Detect self-intersections in the given shape.
         #  @param theShape Shape to check.
+        #  @param theCheckLevel is the level of self-intersection check.
+        #         Possible input values are:
+        #         - GEOM.SI_V_V(0) - only V/V interferences
+        #         - GEOM.SI_V_E(1) - V/V and V/E interferences
+        #         - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
+        #         - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
+        #         - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
+        #         - GEOM.SI_ALL(5) - all interferences.
         #  @return TRUE, if the shape contains no self-intersections.
         #
-        #  @ref tui_measurement_tools_page "Example"
+        #  @ref tui_check_self_intersections_page "Example"
         @ManageTransactions("MeasuOp")
-        def CheckSelfIntersections(self, theShape):
+        def CheckSelfIntersections(self, theShape, theCheckLevel = GEOM.SI_ALL):
             """
             Detect self-intersections in the given shape.
 
             Parameters:
                 theShape Shape to check.
-
+                theCheckLevel is the level of self-intersection check.
+                  Possible input values are:
+                   - GEOM.SI_V_V(0) - only V/V interferences
+                   - GEOM.SI_V_E(1) - V/V and V/E interferences
+                   - GEOM.SI_E_E(2) - V/V, V/E and E/E interferences
+                   - GEOM.SI_V_F(3) - V/V, V/E, E/E and V/F interferences
+                   - GEOM.SI_E_F(4) - V/V, V/E, E/E, V/F and E/F interferences
+                   - GEOM.SI_ALL(5) - all interferences.
             Returns:
                 TRUE, if the shape contains no self-intersections.
             """
             # Example: see GEOM_TestMeasures.py
-            (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape)
+            (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersections(theShape, EnumToLong(theCheckLevel))
             RaiseIfFailed("CheckSelfIntersections", self.MeasuOp)
             return IsValid
 
+        ## Detect self-intersections of the given shape with algorithm based on mesh intersections.
+        #  @param theShape Shape to check.
+        #  @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
+        #         - if \a theDeflection <= 0, default deflection 0.001 is used
+        #  @param theTolerance Specifies a distance between sub-shapes used for detecting gaps:
+        #         - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
+        #         - if \a theTolerance > 0, algorithm detects gaps
+        #  @return TRUE, if the shape contains no self-intersections.
+        #
+        #  @ref tui_check_self_intersections_fast_page "Example"
+        @ManageTransactions("MeasuOp")
+        def CheckSelfIntersectionsFast(self, theShape, theDeflection = 0.001, theTolerance = 0.0):
+            """
+            Detect self-intersections of the given shape with algorithm based on mesh intersections.
+
+            Parameters:
+                theShape Shape to check.
+                theDeflection Linear deflection coefficient that specifies quality of tesselation:
+                    - if theDeflection <= 0, default deflection 0.001 is used
+                theTolerance Specifies a distance between shapes used for detecting gaps:
+                    - if theTolerance <= 0, algorithm detects intersections (default behavior)
+                    - if theTolerance > 0, algorithm detects gaps
+            Returns:
+                TRUE, if the shape contains no self-intersections.
+            """
+            # Example: see GEOM_TestMeasures.py
+            (IsValid, Pairs) = self.MeasuOp.CheckSelfIntersectionsFast(theShape, theDeflection, theTolerance)
+            RaiseIfFailed("CheckSelfIntersectionsFast", self.MeasuOp)
+            return IsValid
+
+        ## Detect intersections of the given shapes with algorithm based on mesh intersections.
+        #  @param theShape1 First source object
+        #  @param theShape2 Second source object
+        #  @param theTolerance Specifies a distance between shapes used for detecting gaps:
+        #         - if \a theTolerance <= 0, algorithm detects intersections (default behavior)
+        #         - if \a theTolerance > 0, algorithm detects gaps
+        #  @param theDeflection Linear deflection coefficient that specifies quality of tesselation:
+        #         - if \a theDeflection <= 0, default deflection 0.001 is used
+        #  @return TRUE, if there are intersections (gaps) between source shapes
+        #  @return List of sub-shapes IDs from 1st shape that localize intersection.
+        #  @return List of sub-shapes IDs from 2nd shape that localize intersection.
+        #
+        #  @ref tui_fast_intersection_page "Example"
+        @ManageTransactions("MeasuOp")
+        def FastIntersect(self, theShape1, theShape2, theTolerance = 0.0, theDeflection = 0.001):
+            """
+            Detect intersections of the given shapes with algorithm based on mesh intersections.
+
+            Parameters:
+                theShape1 First source object
+                theShape2 Second source object
+                theTolerance Specifies a distance between shapes used for detecting gaps:
+                    - if theTolerance <= 0, algorithm detects intersections (default behavior)
+                    - if theTolerance > 0, algorithm detects gaps
+                theDeflection Linear deflection coefficient that specifies quality of tesselation:
+                    - if theDeflection <= 0, default deflection 0.001 is used
+            Returns:
+                TRUE, if there are intersections (gaps) between source shapes
+                List of sub-shapes IDs from 1st shape that localize intersection.
+                List of sub-shapes IDs from 2nd shape that localize intersection.
+            """
+            # Example: see GEOM_TestMeasures.py
+            IsOk, Res1, Res2 = self.MeasuOp.FastIntersect(theShape1, theShape2, theTolerance, theDeflection)
+            RaiseIfFailed("FastIntersect", self.MeasuOp)
+            return IsOk, Res1, Res2
+
         ## Get position (LCS) of theShape.
         #
         #  Origin of the LCS is situated at the shape's center of mass.
@@ -11393,36 +12236,62 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         ## Check, if the compound of blocks is given.
         #  To be considered as a compound of blocks, the
         #  given shape must satisfy the following conditions:
-        #  - Each element of the compound should be a Block (6 faces and 12 edges).
+        #  - Each element of the compound should be a Block (6 faces).
+        #  - Each face should be a quadrangle, i.e. it should have only 1 wire
+        #       with 4 edges. If <VAR>theIsUseC1</VAR> is set to True and
+        #       there are more than 4 edges in the only wire of a face,
+        #       this face is considered to be quadrangle if it has 4 bounds
+        #       (1 or more edge) of C1 continuity.
         #  - A connection between two Blocks should be an entire quadrangle face or an entire edge.
         #  - The compound should be connexe.
         #  - The glue between two quadrangle faces should be applied.
         #  @param theCompound The compound to check.
+        #  @param theIsUseC1 Flag to check if there are 4 bounds on a face
+        #         taking into account C1 continuity.
+        #  @param theAngTolerance the angular tolerance to check if two neighbor
+        #         edges are codirectional in the common vertex with this
+        #         tolerance. This parameter is used only if
+        #         <VAR>theIsUseC1</VAR> is set to True.
         #  @return TRUE, if the given shape is a compound of blocks.
         #  If theCompound is not valid, prints all discovered errors.
         #
-        #  @ref tui_measurement_tools_page "Example 1"
+        #  @ref tui_check_compound_of_blocks_page "Example 1"
         #  \n @ref swig_CheckCompoundOfBlocks "Example 2"
         @ManageTransactions("BlocksOp")
-        def CheckCompoundOfBlocks(self,theCompound):
+        def CheckCompoundOfBlocks(self,theCompound, theIsUseC1 = False,
+                                  theAngTolerance = 1.e-12):
             """
             Check, if the compound of blocks is given.
             To be considered as a compound of blocks, the
             given shape must satisfy the following conditions:
-            - Each element of the compound should be a Block (6 faces and 12 edges).
+            - Each element of the compound should be a Block (6 faces).
+            - Each face should be a quadrangle, i.e. it should have only 1 wire
+                 with 4 edges. If theIsUseC1 is set to True and
+                 there are more than 4 edges in the only wire of a face,
+                 this face is considered to be quadrangle if it has 4 bounds
+                 (1 or more edge) of C1 continuity.
             - A connection between two Blocks should be an entire quadrangle face or an entire edge.
             - The compound should be connexe.
             - The glue between two quadrangle faces should be applied.
 
             Parameters:
                 theCompound The compound to check.
+                theIsUseC1 Flag to check if there are 4 bounds on a face
+                           taking into account C1 continuity.
+                theAngTolerance the angular tolerance to check if two neighbor
+                           edges are codirectional in the common vertex with this
+                           tolerance. This parameter is used only if
+                           theIsUseC1 is set to True.
 
             Returns:
                 TRUE, if the given shape is a compound of blocks.
                 If theCompound is not valid, prints all discovered errors.
             """
             # Example: see GEOM_Spanner.py
-            (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound)
+            aTolerance = -1.0
+            if theIsUseC1:
+                aTolerance = theAngTolerance
+            (IsValid, BCErrors) = self.BlocksOp.CheckCompoundOfBlocks(theCompound, aTolerance)
             RaiseIfFailed("CheckCompoundOfBlocks", self.BlocksOp)
             if IsValid == 0:
                 Descr = self.BlocksOp.PrintBCErrors(theCompound, BCErrors)
@@ -11431,6 +12300,12 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
 
         ## Retrieve all non blocks solids and faces from \a theShape.
         #  @param theShape The shape to explore.
+        #  @param theIsUseC1 Flag to check if there are 4 bounds on a face
+        #         taking into account C1 continuity.
+        #  @param theAngTolerance the angular tolerance to check if two neighbor
+        #         edges are codirectional in the common vertex with this
+        #         tolerance. This parameter is used only if
+        #         <VAR>theIsUseC1</VAR> is set to True.
         #  @param theName Object name; when specified, this parameter is used
         #         for result publication in the study. Otherwise, if automatic
         #         publication is switched on, default value is used for result name.
@@ -11438,17 +12313,27 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
         #  @return A tuple of two GEOM_Objects. The first object is a group of all
         #          non block solids (= not 6 faces, or with 6 faces, but with the
         #          presence of non-quadrangular faces). The second object is a
-        #          group of all non quadrangular faces.
+        #          group of all non quadrangular faces (= faces with more then
+        #          1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
+        #          with 1 wire with not 4 edges that do not form 4 bounds of
+        #          C1 continuity).
         #
-        #  @ref tui_measurement_tools_page "Example 1"
+        #  @ref tui_get_non_blocks_page "Example 1"
         #  \n @ref swig_GetNonBlocks "Example 2"
         @ManageTransactions("BlocksOp")
-        def GetNonBlocks (self, theShape, theName=None):
+        def GetNonBlocks (self, theShape, theIsUseC1 = False,
+                          theAngTolerance = 1.e-12, theName=None):
             """
             Retrieve all non blocks solids and faces from theShape.
 
             Parameters:
                 theShape The shape to explore.
+                theIsUseC1 Flag to check if there are 4 bounds on a face
+                           taking into account C1 continuity.
+                theAngTolerance the angular tolerance to check if two neighbor
+                           edges are codirectional in the common vertex with this
+                           tolerance. This parameter is used only if
+                           theIsUseC1 is set to True.
                 theName Object name; when specified, this parameter is used
                         for result publication in the study. Otherwise, if automatic
                         publication is switched on, default value is used for result name.
@@ -11457,13 +12342,19 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
                 A tuple of two GEOM_Objects. The first object is a group of all
                 non block solids (= not 6 faces, or with 6 faces, but with the
                 presence of non-quadrangular faces). The second object is a
-                group of all non quadrangular faces.
+                group of all non quadrangular faces (= faces with more then
+                1 wire or, if <VAR>theIsUseC1</VAR> is set to True, faces
+                with 1 wire with not 4 edges that do not form 4 bounds of
+                C1 continuity).
 
             Usage:
                 (res_sols, res_faces) = geompy.GetNonBlocks(myShape1)
             """
             # Example: see GEOM_Spanner.py
-            aTuple = self.BlocksOp.GetNonBlocks(theShape)
+            aTolerance = -1.0
+            if theIsUseC1:
+                aTolerance = theAngTolerance
+            aTuple = self.BlocksOp.GetNonBlocks(theShape, aTolerance)
             RaiseIfFailed("GetNonBlocks", self.BlocksOp)
             self._autoPublish(aTuple, theName, ("groupNonHexas", "groupNonQuads"))
             return aTuple
@@ -12625,6 +13516,46 @@ class geomBuilder(object, GEOM._objref_GEOM_Gen):
             RaiseIfFailed("AddTexture", self.InsertOp)
             return ID
 
+        ## Transfer not topological data from one GEOM object to another.
+        #
+        #  @param theObjectFrom the source object of non-topological data
+        #  @param theObjectTo the destination object of non-topological data
+        #  @param theFindMethod method to search sub-shapes of theObjectFrom
+        #         in shape theObjectTo. Possible values are: GEOM.FSM_GetInPlace,
+        #         GEOM.FSM_GetInPlaceByHistory and GEOM.FSM_GetInPlace_Old.
+        #         Other values of GEOM.find_shape_method are not supported.
+        #
+        #  @return True in case of success; False otherwise.
+        #
+        #  @ingroup l1_geomBuilder_auxiliary
+        #
+        #  @ref swig_TransferData "Example"
+        @ManageTransactions("InsertOp")
+        def TransferData(self, theObjectFrom, theObjectTo,
+                         theFindMethod=GEOM.FSM_GetInPlace):
+            """
+            Transfer not topological data from one GEOM object to another.
+
+            Parameters:
+                theObjectFrom the source object of non-topological data
+                theObjectTo the destination object of non-topological data
+                theFindMethod method to search sub-shapes of theObjectFrom
+                              in shape theObjectTo. Possible values are:
+                              GEOM.FSM_GetInPlace, GEOM.FSM_GetInPlaceByHistory
+                              and GEOM.FSM_GetInPlace_Old. Other values of
+                              GEOM.find_shape_method are not supported.
+
+            Returns:
+                True in case of success; False otherwise.
+
+            # Example: see GEOM_TestOthers.py
+            """
+            # Example: see GEOM_TestAll.py
+            isOk = self.InsertOp.TransferData(theObjectFrom,
+                                               theObjectTo, theFindMethod)
+            RaiseIfFailed("TransferData", self.InsertOp)
+            return isOk
+
         ## Creates a new folder object. It is a container for any GEOM objects.
         #  @param Name name of the container
         #  @param Father parent object. If None,
index 3c632bf8af371362ec25d50ac0f3193add245822..1433d3daa305e5d56d2fa488e89a0df17a793790 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# 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
index 004e8e63e9a171e558b218f351f3988ee00da3bb..cde94b39cbb60de71a8a69dcac4a8d9b2c4780af 100644 (file)
@@ -1,5 +1,5 @@
 #  -*- coding: iso-8859-1 -*-
-# Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -1160,11 +1160,16 @@ class Sketcher2D:
         if self.closed:
             self.myCommand = self.myCommand + ":WW"
 
+        from salome.geom.geomBuilder import ParseSketcherCommand, RaiseIfFailed
+        Command,Parameters = ParseSketcherCommand(self.myCommand)
+
         import GEOM
-        if isinstance(WorkingPlane, list): wire = self.geompyD.CurvesOp.MakeSketcher(self.myCommand, WorkingPlane)
-        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): wire = self.geompyD.CurvesOp.MakeSketcherOnPlane(self.myCommand, WorkingPlane)
+        if isinstance(WorkingPlane, list): wire = self.geompyD.CurvesOp.MakeSketcher(Command, WorkingPlane)
+        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): wire = self.geompyD.CurvesOp.MakeSketcherOnPlane(Command, WorkingPlane)
 
         self.myCommand = "Sketcher"
+        RaiseIfFailed("Sketcher", self.geompyD.CurvesOp)
+        wire.SetParameters(Parameters)
         self.geompyD._autoPublish(wire, theName, "wire")
         return wire
         
@@ -1204,11 +1209,16 @@ class Sketcher2D:
         else:
             raise RuntimeError, "Sketcher2D.close() : can't build face on unclosed wire"
 
+        from salome.geom.geomBuilder import ParseSketcherCommand, RaiseIfFailed
+        Command,Parameters = ParseSketcherCommand(self.myCommand)
+
         import GEOM
-        if isinstance(WorkingPlane, list): face = self.geompyD.CurvesOp.MakeSketcher(self.myCommand, WorkingPlane)
-        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): face = self.geompyD.CurvesOp.MakeSketcherOnPlane(self.myCommand, WorkingPlane)
+        if isinstance(WorkingPlane, list): face = self.geompyD.CurvesOp.MakeSketcher(Command, WorkingPlane)
+        if isinstance(WorkingPlane, GEOM._objref_GEOM_Object): face = self.geompyD.CurvesOp.MakeSketcherOnPlane(Command, WorkingPlane)
 
         self.myCommand = "Sketcher"
+        RaiseIfFailed("Sketcher", self.geompyD.CurvesOp)
+        face.SetParameters(Parameters)
         self.geompyD._autoPublish(face, theName, "face")
         return face
 
index 85635618328af83c089561dc43b092f07b7274ec..99e8d185699de1d616214165dd3ac84546aa9d51 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 2b918cc1204ce29e42f9e38dd88694b1fcd44104..9b688ead67654683afc9af7a74b2eb409e2901b4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -403,6 +403,18 @@ void GEOM_Swig::setVerticesMode( const char* theEntry, bool theOn, bool theUpdat
                                            theOn, theUpdateViewer ) );
 }
 
+/*!
+  \brief Show / hide name of shape for the presentation
+  \param theEntry geometry object's entry
+  \param theOn \c true to show name or \c false otherwise
+  \param theUpdateViewer \c true to update active view's contents
+*/
+void GEOM_Swig::setNameMode( const char* theEntry, bool theOn, bool theUpdateViewer )
+{
+  ProcessVoidEvent( new TSetPropertyEvent( theEntry, GEOM::propertyName( GEOM::ShowName ),
+                                           theOn, theUpdateViewer ) );
+}
+
 /*!
   \brief Change color of the presentation
   \param theEntry geometry object's entry
index 1fd1d864e10ec59941e13c99985141579b748f17..05ce3e4134b1ebb180c6943551e6b9513dc81fd6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -42,6 +42,7 @@ public:
   void setDisplayMode( const char* theEntry, int theMode, bool theUpdateViewer = true );
   void setVectorsMode( const char* theEntry, bool theOn, bool theUpdateViewer = true );
   void setVerticesMode( const char* theEntry, bool theOn, bool theUpdateViewer = true );
+  void setNameMode( const char* theEntry, bool theOn, bool theUpdateViewer = true );
   void setColor( const char* theEntry, int theRed, int theGreen, int theBlue, bool theUpdateViewer = true );
   void setTransparency( const char* theEntry, float theTransparency, bool theUpdateViewer = true );
   void setIsos( const char* theEntry, int theNbU, int theNbV, bool theUpdateViewer = true );
index 30f6065c7dcd919d6cf8a8316294d406b9200d19..3afe5358824a776d44681c86ce9a2daec5537527 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -64,6 +64,7 @@ class GEOM_Swig
   void setDisplayMode( const char* theEntry, int theMode, bool theUpdateViewer = true );
   void setVectorsMode( const char* theEntry, bool theOn, bool theUpdateViewer = true );
   void setVerticesMode( const char* theEntry, bool theOn, bool theUpdateViewer = true );
+  void setNameMode( const char* theEntry, bool theOn, bool theUpdateViewer = true );
   void setColor( const char* theEntry, int theRed, int theGreen, int theBlue, bool theUpdateViewer = true );
   void setTransparency( const char* theEntry, float theTransparency, bool theUpdateViewer = true );
   void setIsos( const char* theEntry, int theNbU, int theNbV, bool theUpdateViewer = true );
index 57ec76c76833da4b7119dbd74bffdda2b355df91..b60f1dde6b0d767bff471d15b103adf154ae4376 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -37,6 +37,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/GEOMImpl
   ${PROJECT_SOURCE_DIR}/src/GEOMGUI
   ${PROJECT_SOURCE_DIR}/src/GEOMBase
+  ${PROJECT_SOURCE_DIR}/src/GEOMUtils
   ${PROJECT_SOURCE_DIR}/src/DlgRef
   ${PROJECT_BINARY_DIR}/src/DlgRef
   ${CMAKE_CURRENT_SOURCE_DIR}
@@ -49,12 +50,17 @@ ADD_DEFINITIONS(
   ${QT_DEFINITIONS}
   )
 
+IF(WIN32)
+  ADD_DEFINITIONS(-DNOGDI)
+ENDIF(WIN32)
+
 # libraries to link to
 SET(_link_LIBRARIES
   GEOMObject
   GEOMClient
   GEOMImpl
   GEOMBase
+  GEOMUtils
   GEOM
   DlgRef
   )
@@ -68,6 +74,7 @@ SET(GenerationGUI_HEADERS
   GenerationGUI_FillingDlg.h
   GenerationGUI_PipeDlg.h
   GenerationGUI_PipePathDlg.h
+  GenerationGUI_ThicknessDlg.h
   )
 
 # header files / to be processed by moc
@@ -77,6 +84,7 @@ SET(_moc_HEADERS
   GenerationGUI_FillingDlg.h
   GenerationGUI_PipeDlg.h
   GenerationGUI_PipePathDlg.h
+  GenerationGUI_ThicknessDlg.h
   )
 
 # --- sources ---
@@ -91,6 +99,7 @@ SET(GenerationGUI_SOURCES
   GenerationGUI_FillingDlg.cxx
   GenerationGUI_PipeDlg.cxx
   GenerationGUI_PipePathDlg.cxx
+  GenerationGUI_ThicknessDlg.cxx
   ${_moc_SOURCES}
   )
 
index b5aec7548600d2eb002f29f06dac4ccd29f5658d..f206a4f955e3b8cc9192ed11c3733b1f6f030660 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -37,6 +37,7 @@
 #include "GenerationGUI_FillingDlg.h"   // Method FILLING
 #include "GenerationGUI_PipeDlg.h"      // Method PIPE
 #include "GenerationGUI_PipePathDlg.h"  // Method RESTORE PATH
+#include "GenerationGUI_ThicknessDlg.h" // Method THICKNESS
 
 //=======================================================================
 // function : GenerationGUI()
@@ -70,11 +71,12 @@ bool GenerationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   QDialog* aDlg = NULL;
 
   switch ( theCommandID ) {
-  case GEOMOp::OpPrism:      aDlg = new GenerationGUI_PrismDlg   ( getGeometryGUI(), parent ); break;
-  case GEOMOp::OpRevolution: aDlg = new GenerationGUI_RevolDlg   ( getGeometryGUI(), parent ); break;
-  case GEOMOp::OpFilling:    aDlg = new GenerationGUI_FillingDlg ( getGeometryGUI(), parent ); break;
-  case GEOMOp::OpPipe:       aDlg = new GenerationGUI_PipeDlg    ( getGeometryGUI(), parent ); break;
-  case GEOMOp::OpPipePath:   aDlg = new GenerationGUI_PipePathDlg( getGeometryGUI(), parent ); break;
+  case GEOMOp::OpPrism:      aDlg = new GenerationGUI_PrismDlg    ( getGeometryGUI(), parent ); break;
+  case GEOMOp::OpRevolution: aDlg = new GenerationGUI_RevolDlg    ( getGeometryGUI(), parent ); break;
+  case GEOMOp::OpFilling:    aDlg = new GenerationGUI_FillingDlg  ( getGeometryGUI(), parent ); break;
+  case GEOMOp::OpPipe:       aDlg = new GenerationGUI_PipeDlg     ( getGeometryGUI(), parent ); break;
+  case GEOMOp::OpPipePath:   aDlg = new GenerationGUI_PipePathDlg ( getGeometryGUI(), parent ); break;
+  case GEOMOp::OpThickness:  aDlg = new GenerationGUI_ThicknessDlg( getGeometryGUI(), parent ); break;
     
   default: app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) ); break;
   }
index 1692a42b6dfaaf719905430db63235f309b0b93c..2b88d6eda2b7454a7cf110c8072acf744109d321 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 141b9598f91301ffde8e47ca6a14704eb9687178..884b75d9df6d13f052c41d1e0d76bc2aa1752beb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -35,7 +35,8 @@
 #include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 
-#include <TopoDS_Iterator.hxx>
+#include <TColStd_MapOfInteger.hxx>
+
 #include <GEOMImpl_Types.hxx>
 
 //=================================================================================
@@ -105,7 +106,7 @@ void GenerationGUI_FillingDlg::Init()
   myEditCurrentArgument = GroupPoints->LineEdit1;
   GroupPoints->LineEdit1->setReadOnly(true);
 
-  globalSelection(GEOM_COMPOUND);
+  initSelection();
 
   int SpecificStep1 = 1;
   double SpecificStep2 = 0.0001;
@@ -186,9 +187,31 @@ bool GenerationGUI_FillingDlg::ClickOnApply()
     return false;
 
   initName();
+  initSelection();
+
   return true;
 }
 
+//=================================================================================
+// function : initSelection
+// purpose  :
+//=================================================================================
+void GenerationGUI_FillingDlg::initSelection()
+{
+  TColStd_MapOfInteger aTypes;
+  aTypes.Add( GEOM_EDGE );
+  aTypes.Add( GEOM_WIRE );
+  aTypes.Add( GEOM_COMPOUND );
+
+  std::list<int> needTypes;
+  needTypes.push_back( TopAbs_EDGE );
+  needTypes.push_back( TopAbs_WIRE );
+  needTypes.push_back( TopAbs_COMPOUND );
+
+  globalSelection( aTypes );
+  localSelection( needTypes );
+}
+
 //=================================================================================
 // function : SelectionIntoArgument()
 // purpose  : Called when selection as changed or other case
@@ -199,18 +222,13 @@ void GenerationGUI_FillingDlg::SelectionIntoArgument()
   myEditCurrentArgument->setText("");
 
   if (myEditCurrentArgument == GroupPoints->LineEdit1) {
-    myCompound = getSelected(TopAbs_COMPOUND);
-    if (myCompound) {
-      if (myCompound->GetMaxShapeType() < GEOM::WIRE || myCompound->GetMinShapeType() > GEOM::EDGE) {
-        myCompound.nullify();
-      }
-      else {
-        QString aName = GEOMBase::GetName(myCompound.get());
-        myEditCurrentArgument->setText(aName);
-      }
+    QList<GEOM::GeomObjPtr> objs = getSelected(TopAbs_SHAPE, -1);
+    GEOMBase::Synchronize(myObjects, objs);
+    if ( !myObjects.isEmpty() ) {
+      QString aName = myObjects.count() > 1 ? QString( "%1_objects").arg( myObjects.count() ) : GEOMBase::GetName( myObjects[0].get() );
+      myEditCurrentArgument->setText( aName );
     }
   }
-
   processPreview();
 }
 
@@ -221,12 +239,11 @@ void GenerationGUI_FillingDlg::SelectionIntoArgument()
 void GenerationGUI_FillingDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
-  globalSelection(GEOM_ALLSHAPES);
 
   if (send == GroupPoints->PushButton1) {
     GroupPoints->LineEdit1->setFocus();
     myEditCurrentArgument = GroupPoints->LineEdit1;
-    globalSelection(GEOM_COMPOUND);
+    initSelection();
     this->SelectionIntoArgument();
   }
 }
@@ -240,7 +257,7 @@ void GenerationGUI_FillingDlg::ActivateThisDialog()
   GEOMBase_Skeleton::ActivateThisDialog();
   connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
            SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
-  globalSelection(GEOM_COMPOUND);
+  initSelection();
   processPreview();
 }
 
@@ -319,12 +336,12 @@ GEOM::GEOM_IOperations_ptr GenerationGUI_FillingDlg::createOperation()
 //=================================================================================
 bool GenerationGUI_FillingDlg::isValid(QString& msg)
 {
-  bool ok = GroupPoints->SpinBox1->isValid(msg, !IsPreview()) &&
-            GroupPoints->SpinBox2->isValid(msg, !IsPreview()) &&
-            GroupPoints->SpinBox3->isValid(msg, !IsPreview()) &&
-            GroupPoints->SpinBox4->isValid(msg, !IsPreview()) &&
-            GroupPoints->SpinBox5->isValid(msg, !IsPreview()) &&
-            myCompound;
+  bool ok = GroupPoints->SpinBox1->isValid(msg, !IsPreview()) &&
+              GroupPoints->SpinBox2->isValid(msg, !IsPreview()) &&
+              GroupPoints->SpinBox3->isValid(msg, !IsPreview()) &&
+              GroupPoints->SpinBox4->isValid(msg, !IsPreview()) &&
+              GroupPoints->SpinBox5->isValid(msg, !IsPreview()) &&
+              myObjects.count() );
   return ok;
 }
 
@@ -340,21 +357,26 @@ bool GenerationGUI_FillingDlg::execute(ObjectList& objects)
   GEOM::filling_oper_method aMethod;
   switch (GroupPoints->ComboBox1->currentIndex())
   {
-    case 0:  aMethod = GEOM::FOM_Default; break;
-    case 1:  aMethod = GEOM::FOM_UseOri; break;
-    case 2:  aMethod = GEOM::FOM_AutoCorrect; break;
-    default: break;
+  case 0:  aMethod = GEOM::FOM_Default; break;
+  case 1:  aMethod = GEOM::FOM_UseOri; break;
+  case 2:  aMethod = GEOM::FOM_AutoCorrect; break;
+  default: break;
   }
 
+  GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+  objList->length( myObjects.count() );
+  for ( int i = 0; i < myObjects.count(); ++i )
+    objList[i] = myObjects[i].copy();
+
   GEOM::GEOM_Object_var anObj =
-    anOper->MakeFilling(myCompound.get(),
-                         GroupPoints->SpinBox1->value(),
-                         GroupPoints->SpinBox4->value(),
-                         GroupPoints->SpinBox2->value(),
-                         GroupPoints->SpinBox5->value(),
-                         GroupPoints->SpinBox3->value(),
-                         aMethod,
-                         GroupPoints->CheckBox1->isChecked());
+    anOper->MakeFilling(objList,
+                        GroupPoints->SpinBox1->value(),
+                        GroupPoints->SpinBox4->value(),
+                        GroupPoints->SpinBox2->value(),
+                        GroupPoints->SpinBox5->value(),
+                        GroupPoints->SpinBox3->value(),
+                        aMethod,
+                        GroupPoints->CheckBox1->isChecked());
   if (!anObj->_is_nil())
   {
     if (!IsPreview())
@@ -372,3 +394,22 @@ bool GenerationGUI_FillingDlg::execute(ObjectList& objects)
 
   return true;
 }
+
+//=================================================================================
+// function : addSubshapesToStudy
+// purpose  : virtual method to add new SubObjects if local selection
+//=================================================================================
+void GenerationGUI_FillingDlg::addSubshapesToStudy()
+{
+  foreach( GEOM::GeomObjPtr o, myObjects )
+    GEOMBase::PublishSubObject( o.get() );
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> GenerationGUI_FillingDlg::getSourceObjects()
+{
+  return myObjects;
+}
index a6a828a0431a65d79599a76e503010876d04f2b2..8591f1cb9892cc5e95098050bd8a87277b2e51e1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,13 +49,16 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );    
+  virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
   void                               enterEvent( QEvent* );
+  void                               initSelection();
 
 private:
-  GEOM::GeomObjPtr                   myCompound; /* compound of curves */
+  QList<GEOM::GeomObjPtr>            myObjects;/* lit or compound of curves */
   DlgRef_1Sel5Spin1Check*            GroupPoints;
     
 private slots:
index 2068d5fda15525e577d7a98e5dba422cea20000c..c00a0c27529c5f17f8e9656c381d07284d956373 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -29,6 +29,7 @@
 #include <DlgRef.h>
 #include <GeometryGUI.h>
 #include <GEOMBase.h>
+#include <GEOMUtils.hxx>
 
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <LightApp_SelectionMgr.h>
 
 #include <TopoDS_Shape.hxx>
-#include <TopoDS.hxx>
-#include <TopExp.hxx>
-#include <TopTools_IndexedMapOfShape.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
 
 #include <GEOMImpl_Types.hxx>
 //=================================================================================
 GenerationGUI_PipeDlg::GenerationGUI_PipeDlg (GeometryGUI* theGeometryGUI, QWidget* parent,
                                               bool modal, Qt::WindowFlags fl)
-  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl)
+  : GEOMBase_Skeleton    (theGeometryGUI, parent, modal, fl),
+    myGenGroupCheckGP    (0),
+    myPrefixLblGP        (0),
+    myPrefixEditGP       (0),
+    myStepByStepCheckGMP (0),
+    myGenGroupCheckGMP   (0),
+    myPrefixLblGMP       (0),
+    myPrefixEditGMP      (0)
 {
   QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_PIPE")));
   QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
@@ -81,6 +85,19 @@ GenerationGUI_PipeDlg::GenerationGUI_PipeDlg (GeometryGUI* theGeometryGUI, QWidg
   GroupPoints->PushButton3->setIcon(image1);
   GroupPoints->CheckButton1->setText(tr("GEOM_SELECT_UNPUBLISHED_EDGES"));
 
+  // Add widgets for group generation
+  QGridLayout *aLayoutGP = (QGridLayout *)GroupPoints->GroupBox1->layout();
+
+  myGenGroupCheckGP =
+    new QCheckBox(tr("GEOM_GENERATE_GROUPS"), GroupPoints->GroupBox1);
+  myPrefixLblGP     =
+    new QLabel (tr("GEOM_GROUP_NAME_PREFIX"), GroupPoints->GroupBox1);
+  myPrefixEditGP    = new QLineEdit(GroupPoints->GroupBox1);
+
+  aLayoutGP->addWidget(myGenGroupCheckGP, 4, 0, 1, 3);
+  aLayoutGP->addWidget(myPrefixLblGP,     5, 0, 1, 2);
+  aLayoutGP->addWidget(myPrefixEditGP,    5, 2);
+
   GroupMakePoints = new DlgRef_3Sel2Check3Spin(centralWidget());
 
   GroupMakePoints->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
@@ -92,6 +109,12 @@ GenerationGUI_PipeDlg::GenerationGUI_PipeDlg (GeometryGUI* theGeometryGUI, QWidg
   GroupMakePoints->PushButton3->setIcon(image1);
   GroupMakePoints->CheckBox1->setText(tr("GEOM_WITH_CONTACT"));
   GroupMakePoints->CheckBox2->setText(tr("GEOM_WITH_CORRECTION"));
+  GroupMakePoints->SpinBox1->setAttribute(Qt::WA_DeleteOnClose);
+  GroupMakePoints->SpinBox2->setAttribute(Qt::WA_DeleteOnClose);
+  GroupMakePoints->SpinBox3->setAttribute(Qt::WA_DeleteOnClose);
+  GroupMakePoints->TextLabel4->setAttribute(Qt::WA_DeleteOnClose);
+  GroupMakePoints->TextLabel5->setAttribute(Qt::WA_DeleteOnClose);
+  GroupMakePoints->TextLabel6->setAttribute(Qt::WA_DeleteOnClose);
   GroupMakePoints->SpinBox1->close();
   GroupMakePoints->SpinBox2->close();
   GroupMakePoints->SpinBox3->close();
@@ -99,6 +122,22 @@ GenerationGUI_PipeDlg::GenerationGUI_PipeDlg (GeometryGUI* theGeometryGUI, QWidg
   GroupMakePoints->TextLabel5->close();
   GroupMakePoints->TextLabel6->close();
 
+  // Add widgets for group generation
+  QGridLayout *aLayoutGMP = (QGridLayout *)GroupMakePoints->GroupBox1->layout();
+
+  myStepByStepCheckGMP =
+    new QCheckBox(tr("GEOM_STEP_BY_STEP"), GroupMakePoints->GroupBox1);
+  myGenGroupCheckGMP   =
+    new QCheckBox(tr("GEOM_GENERATE_GROUPS"), GroupMakePoints->GroupBox1);
+  myPrefixLblGMP       =
+    new QLabel (tr("GEOM_GROUP_NAME_PREFIX"), GroupMakePoints->GroupBox1);
+  myPrefixEditGMP      = new QLineEdit(GroupMakePoints->GroupBox1);
+
+  aLayoutGMP->addWidget(myStepByStepCheckGMP, 8,  0, 1, 3);
+  aLayoutGMP->addWidget(myGenGroupCheckGMP,   9,  0, 1, 3);
+  aLayoutGMP->addWidget(myPrefixLblGMP,       10, 0, 1, 2);
+  aLayoutGMP->addWidget(myPrefixEditGMP,      10, 2);
+
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
   layout->addWidget(GroupPoints);
@@ -166,6 +205,10 @@ void GenerationGUI_PipeDlg::Init()
   connect(GroupMakePoints->PushButton3, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
   connect(GroupMakePoints->CheckBox1, SIGNAL(clicked()), this, SLOT(processPreview()));
   connect(GroupMakePoints->CheckBox2, SIGNAL(clicked()), this, SLOT(processPreview()));
+  connect(myStepByStepCheckGMP,       SIGNAL(clicked()), this, SLOT(processPreview()));
+  connect(myGenGroupCheckGP,    SIGNAL(toggled(bool)), this, SLOT(GenGroupClicked(bool)));
+  connect(myGenGroupCheckGMP,   SIGNAL(toggled(bool)), this, SLOT(GenGroupClicked(bool)));
+  connect(myStepByStepCheckGMP, SIGNAL(toggled(bool)), this, SLOT(StepByStepClicked(bool)));
 
   initName(tr("GEOM_PIPE"));
   resize(100,100);
@@ -177,6 +220,7 @@ void GenerationGUI_PipeDlg::Init()
 
   GroupPoints->PushButton1->click();
   SelectionIntoArgument();
+  updateGenGroup();
 }
 
 //=================================================================================
@@ -195,6 +239,8 @@ void GenerationGUI_PipeDlg::ConstructorsClicked( int constructorId )
     GroupPoints->PushButton3->hide();
     GroupPoints->LineEdit3->hide();
     GroupPoints->PushButton1->click();
+    myGenGroupCheckGP->setChecked(false);
+    resetGenGroup(myGenGroupCheckGP, false, true);
     break;
   case 1:
     GroupMakePoints->hide();
@@ -203,11 +249,16 @@ void GenerationGUI_PipeDlg::ConstructorsClicked( int constructorId )
     GroupPoints->PushButton3->show();
     GroupPoints->LineEdit3->show();
     GroupPoints->PushButton1->click();
+    myGenGroupCheckGP->setChecked(false);
+    resetGenGroup(myGenGroupCheckGP, false, true);
     break;
   case 2:
     GroupPoints->hide();
     GroupMakePoints->show();
     GroupMakePoints->PushButton1->click();
+    myStepByStepCheckGMP->setChecked(false);
+    myGenGroupCheckGMP->setChecked(false);
+    resetGenGroup(myGenGroupCheckGMP, false, true);
     break;
   default:
     break;
@@ -229,7 +280,7 @@ void GenerationGUI_PipeDlg::SelectionTypeButtonClicked()
 {
   globalSelection();
   if ( GroupPoints->CheckButton1->isChecked() ) {
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
   } else {
     TColStd_MapOfInteger aMap;
     aMap.Add(GEOM_COMPOUND);
@@ -240,6 +291,7 @@ void GenerationGUI_PipeDlg::SelectionTypeButtonClicked()
   if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
     myEditCurrentArgument->setText("");
     myPath.nullify();
+    updateGenGroup();
   }
   processPreview();
 }
@@ -306,6 +358,7 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
       else if ( myBaseObjects.isEmpty() )
         GroupPoints->PushButton1->click();
     }
+    updateGenGroup();
   }
   else if (myEditCurrentArgument == GroupPoints->LineEdit3) {
     myVec = getSelected( TopAbs_EDGE );
@@ -329,7 +382,7 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
     }
   }
   else if ( myEditCurrentArgument == GroupMakePoints->LineEdit2 ) {
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+    localSelection( TopAbs_VERTEX );
     QList<GEOM::GeomObjPtr> objects = getSelected( TopAbs_VERTEX, -1 );
     GEOMBase::Synchronize( myLocations, objects );
     if ( !myLocations.isEmpty() ) {
@@ -345,6 +398,7 @@ void GenerationGUI_PipeDlg::SelectionIntoArgument()
       QString aName = GEOMBase::GetName( myPath.get() );
       myEditCurrentArgument->setText( aName );
     }
+    updateGenGroup();
   }
 
   processPreview();
@@ -374,7 +428,7 @@ void GenerationGUI_PipeDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupPoints->LineEdit2;
 
     if ( GroupPoints->CheckButton1->isChecked() ) {
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+      localSelection( TopAbs_EDGE );
     } else {
       TColStd_MapOfInteger aMap;
       aMap.Add(GEOM_COMPOUND);
@@ -387,7 +441,7 @@ void GenerationGUI_PipeDlg::SetEditCurrentArgument()
   else if(send == GroupPoints->PushButton3) {
     myEditCurrentArgument = GroupPoints->LineEdit3;
     GroupPoints->CheckButton1->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
 
   GroupMakePoints->PushButton1->setDown(false);
@@ -480,24 +534,42 @@ bool GenerationGUI_PipeDlg::isValid (QString&)
 //=================================================================================
 bool GenerationGUI_PipeDlg::execute (ObjectList& objects)
 {
-  GEOM::GEOM_Object_var anObj;
+  GEOM::ListOfGO_var aList;
 
   GEOM::GEOM_I3DPrimOperations_var anOper = GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
+  bool doGroups = !IsPreview();
+
+  myGroupObjectsMap.clear();
+
   switch( getConstructorId() ) {
   case 0:
   case 1:
+    if (doGroups) {
+      doGroups = myGenGroupCheckGP->isEnabled() &&
+                 myGenGroupCheckGP->isChecked();
+    }
+
     for (int i = 0; i < myBaseObjects.count(); i++) {
       switch ( getConstructorId() ) {
       case 0 :
-       anObj = anOper->MakePipe(myBaseObjects[i].get(), myPath.get());
-       break;
+        aList = anOper->MakePipe(myBaseObjects[i].get(),
+                                 myPath.get(), doGroups);
+        break;
       case 1 :
-       anObj = anOper->MakePipeBiNormalAlongVector(myBaseObjects[i].get(), myPath.get(), myVec.get());
-       break;
+        aList = anOper->MakePipeBiNormalAlongVector
+              (myBaseObjects[i].get(), myPath.get(), myVec.get(), doGroups);
+        break;
+      }
+
+      if (aList->length() > 0) {
+        if (doGroups) {
+          addGroups(aList);
+        }
+
+        if (!aList[0]->_is_nil()) {
+          objects.push_back(aList[0]._retn());
+        }
       }
-    
-      if (!anObj->_is_nil())
-       objects.push_back(anObj._retn());
     }
     break;
   case 2:
@@ -507,17 +579,37 @@ bool GenerationGUI_PipeDlg::execute (ObjectList& objects)
       myBaseGO->length( myBaseObjects.count() );
       myLocationsGO->length( myLocations.count() );
       for (int i = 0; i < myBaseObjects.count(); i++) {
-       myBaseGO[i] = myBaseObjects[i].copy();
+        myBaseGO[i] = myBaseObjects[i].copy();
       }
       for (int i = 0; i < myLocations.count(); i++) {
-       myLocationsGO[i] = myLocations[i].copy();
+        myLocationsGO[i] = myLocations[i].copy();
+      }
+
+      if (doGroups) {
+        doGroups = myGenGroupCheckGMP->isEnabled() &&
+                   myGenGroupCheckGMP->isChecked();
+      }
+
+      bool isWithContact    = GroupMakePoints->CheckBox1->isEnabled() &&
+                              GroupMakePoints->CheckBox1->isChecked();
+      bool isWithCorrection = GroupMakePoints->CheckBox2->isEnabled() &&
+                              GroupMakePoints->CheckBox2->isChecked();
+
+      aList = anOper->MakePipeWithDifferentSections
+                          (myBaseGO.in(), myLocationsGO.in(), myPath.get(),
+                           isWithContact, isWithCorrection,
+                           myStepByStepCheckGMP->isChecked(),
+                           doGroups);
+
+      if (aList->length() > 0) {
+        if (doGroups) {
+          addGroups(aList);
+        }
+
+        if (!aList[0]->_is_nil()) {
+          objects.push_back(aList[0]._retn());
+        }
       }
-      
-      anObj = anOper->MakePipeWithDifferentSections(myBaseGO.in(), myLocationsGO.in(), myPath.get(), 
-                                                   GroupMakePoints->CheckBox1->isChecked(), 
-                                                   GroupMakePoints->CheckBox2->isChecked());
-      if (!anObj->_is_nil())
-       objects.push_back(anObj._retn());
     }
     break;
   default:
@@ -544,3 +636,185 @@ bool GenerationGUI_PipeDlg::extractPrefix() const
 {
   return myBaseObjects.count() > 1;
 }
+
+//=================================================================================
+// function : restoreSubShapes
+// purpose  : virtual method to restore tree of argument's sub-shapes under
+//            the resulting shape. Redefined from GEOMBase_Helper class.
+//=================================================================================
+void GenerationGUI_PipeDlg::restoreSubShapes
+              (SALOMEDS::Study_ptr theStudy, SALOMEDS::SObject_ptr theSObject)
+{
+  QCheckBox *aGenGroupCheck = NULL;
+  QLineEdit *aPrefixEdit    = NULL;
+
+  switch (getConstructorId()) {
+  case 0 :
+  case 1 :
+    aGenGroupCheck = myGenGroupCheckGP;
+    aPrefixEdit    = myPrefixEditGP;
+    break;
+  case 2 :
+    aGenGroupCheck = myGenGroupCheckGMP;
+    aPrefixEdit    = myPrefixEditGMP;
+    break;
+  default:
+    break;
+  }
+
+  if (aGenGroupCheck == NULL || !aGenGroupCheck->isChecked()) {
+    return;
+  }
+
+  // get Object from SObject
+  GEOM::GEOM_Object_var aFather = GEOM::GEOM_Object::_narrow
+            (theSObject->GetObject());
+
+  if (CORBA::is_nil(aFather)) {
+    return;
+  }
+
+  ObjectMap::const_iterator anIter    =
+    myGroupObjectsMap.find(aFather->GetEntry());
+  QString                   aPrefix   = aPrefixEdit->text();
+  bool                      hasPrefix = !aPrefix.isEmpty();
+
+  if (anIter != myGroupObjectsMap.end()) {
+    QList<GEOM::GeomObjPtr>::const_iterator it = anIter->second.begin();
+
+    for (; it != anIter->second.end(); it++) {
+      // Compose the name
+      QString aName;
+
+      if (hasPrefix) {
+        aName = aPrefix + "_";
+      }
+
+      aName += tr((*it)->GetName());
+      getGeomEngine()->AddInStudy(theStudy, (*it).get(),
+                                  aName.toStdString().c_str(), aFather);
+    }
+  }
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> GenerationGUI_PipeDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myBaseObjects);
+  res << myPath << myVec;
+  for (int i = 0; i < myLocations.count(); i++)
+    res << myLocations[i];
+  return res;
+}
+
+//=================================================================================
+// function : GenGroupClicked
+// purpose  : Slot to treat checking "Generate groups" check box.
+//=================================================================================
+void GenerationGUI_PipeDlg::GenGroupClicked(bool isChecked)
+{
+  resetGenGroup((QCheckBox *)sender(), isChecked, false);
+}
+
+//=================================================================================
+// function : StepByStepClicked
+// purpose  : Slot to treat checking "Step-by-step generation" check box.
+//=================================================================================
+void GenerationGUI_PipeDlg::StepByStepClicked(bool isChecked)
+{
+  GroupMakePoints->CheckBox1->setEnabled(!isChecked);
+  GroupMakePoints->CheckBox2->setEnabled(!isChecked);
+}
+
+//=================================================================================
+// function : updateGenGroup
+// purpose  : Update "Generate groups" widgets depending on the path.
+//=================================================================================
+void GenerationGUI_PipeDlg::updateGenGroup()
+{
+  bool isEnable = true;
+
+  if (myPath) {
+    // Check if the path is closed.
+    TopoDS_Shape aShapePath;
+
+    if (GEOMBase::GetShape(myPath.get(), aShapePath)) {
+      isEnable = GEOMUtils::IsOpenPath(aShapePath);
+    }
+  }
+
+  QCheckBox *aGenGroupCheck = NULL;
+
+  switch (getConstructorId()) {
+  case 0 :
+  case 1 :
+    aGenGroupCheck = myGenGroupCheckGP;
+    break;
+  case 2 :
+    aGenGroupCheck = myGenGroupCheckGMP;
+    break;
+  default:
+    break;
+  }
+
+  if (aGenGroupCheck != NULL) {
+    const bool isChecked = aGenGroupCheck->isChecked();
+
+    aGenGroupCheck->setEnabled(isEnable);
+    resetGenGroup(aGenGroupCheck, isEnable && isChecked, false);
+  }
+}
+
+//=================================================================================
+// function : resetGenGroup
+// purpose  : Resets data of "Generate groups" widgets.
+//=================================================================================
+void GenerationGUI_PipeDlg::resetGenGroup(QCheckBox  *theGenGroup,
+                                          const bool  isChecked,
+                                          const bool  isClearPrefix)
+{
+  QLabel    *aPrefixLbl  = NULL;
+  QLineEdit *aPrefixEdit = NULL;
+
+  if (theGenGroup == myGenGroupCheckGP) {
+    aPrefixLbl  = myPrefixLblGP;
+    aPrefixEdit = myPrefixEditGP;
+  } else if (theGenGroup == myGenGroupCheckGMP) {
+    aPrefixLbl  = myPrefixLblGMP;
+    aPrefixEdit = myPrefixEditGMP;
+  }
+
+  if (aPrefixLbl != NULL) {
+    aPrefixLbl->setEnabled(isChecked);
+    aPrefixEdit->setEnabled(isChecked);
+
+    if (isClearPrefix) {
+      aPrefixEdit->setText("");
+    }
+  }
+}
+
+//=================================================================================
+// function : addGroups
+// purpose  : Add result groups to the list of groups.
+//=================================================================================
+void GenerationGUI_PipeDlg::addGroups(GEOM::ListOfGO_var &theResult)
+{
+  const int aNbObj = theResult->length();
+
+  if (aNbObj > 0) {
+    if (!theResult[0]->_is_nil()) {
+      QString anEntry = theResult[0]->GetEntry();
+      int     i;
+
+      for (i = 1; i < aNbObj; ++i) {
+        if (!theResult[i]->_is_nil()) {
+          myGroupObjectsMap[anEntry].append(GEOM::GeomObjPtr(theResult[i]));
+        }
+      }
+    }
+  }
+}
index ee15f709f47f3abdc8345692ebcba16db2826599..341fb18f4f08710a39a9b72ab9bf5742149c955f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -30,6 +30,9 @@
 #include "GEOMBase_Skeleton.h"
 #include "GEOM_GenericObjPtr.h"
 
+typedef std::map<QString, QList<GEOM::GeomObjPtr> > ObjectMap;
+
+
 class DlgRef_3Sel1Check;
 class DlgRef_3Sel2Check3Spin;
 
@@ -52,10 +55,20 @@ protected:
   virtual bool                       execute( ObjectList& );    
   virtual void                       addSubshapesToStudy();
   virtual bool                       extractPrefix() const;
+  virtual void                       restoreSubShapes
+                                 (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
   void                               enterEvent( QEvent* );
+  void                               updateGenGroup();
+  void                               resetGenGroup
+                                        (QCheckBox *theGenGroup,
+                                         const bool isChecked,
+                                         const bool isClearPrefix);
+  void                               addGroups
+                                      (GEOM::ListOfGO_var &theResult);
   
 private:
   QList<GEOM::GeomObjPtr>            myBaseObjects;  /* Base shapes */
@@ -65,6 +78,14 @@ private:
   
   DlgRef_3Sel1Check*                 GroupPoints;
   DlgRef_3Sel2Check3Spin*            GroupMakePoints;
+  QCheckBox                         *myGenGroupCheckGP;
+  QLabel                            *myPrefixLblGP;
+  QLineEdit                         *myPrefixEditGP;
+  QCheckBox                         *myStepByStepCheckGMP;
+  QCheckBox                         *myGenGroupCheckGMP;
+  QLabel                            *myPrefixLblGMP;
+  QLineEdit                         *myPrefixEditGMP;
+  ObjectMap                          myGroupObjectsMap;
 
 private slots:
   void                               ClickOnOk();
@@ -74,6 +95,8 @@ private slots:
   void                               SetEditCurrentArgument();
   void                               ConstructorsClicked( int );
   void                               SelectionTypeButtonClicked();
+  void                               GenGroupClicked(bool);
+  void                               StepByStepClicked(bool);
 };
 
 #endif // GENERATIONGUI_PIPEDLG_H
index 791308dba5ac37bc2982b5ccb3bbdec2275238db..5c465f3bb44d0320b8bf50f92b94b9b13ee2c69b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -148,7 +148,7 @@ void GenerationGUI_PipePathDlg::SelectionTypeButtonClicked()
 {
   globalSelection();
   if (GroupPoints->CheckButton1->isChecked()) {
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else {
     TColStd_MapOfInteger aMap;
@@ -269,7 +269,7 @@ void GenerationGUI_PipePathDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupPoints->LineEdit2;
 
     if (GroupPoints->CheckButton1->isChecked()) {
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
     }
     else {
       TColStd_MapOfInteger aMap;
@@ -284,7 +284,7 @@ void GenerationGUI_PipePathDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupPoints->LineEdit3;
 
     if (GroupPoints->CheckButton1->isChecked()) {
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
     }
     else {
       TColStd_MapOfInteger aMap;
@@ -391,3 +391,16 @@ void GenerationGUI_PipePathDlg::addSubshapesToStudy()
   for (i = 0; i < myBase2Objects.count(); i++)
     GEOMBase::PublishSubObject(myBase2Objects[i].get());
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> GenerationGUI_PipePathDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myBase1Objects);
+  res << myShape ;
+  for (int i = 0; i < myBase2Objects.count(); i++)
+    res << myBase2Objects[i];
+  return res;
+}
index 58b2c8cec8aa7bba5351873b38f9832c15de8c8c..3e99ed6438e506917e272515e910d0bbe0f70757 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,7 @@ protected:
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);    
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index a1a6cc0ad0180426aea4dcd69129a067b532432e..11cfd2c6e3120a7b1b177e53b012a7bc44cd9403 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -446,7 +446,7 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupVecH->LineEdit2;
     GroupVecH->PushButton1->setDown(false);
     GroupVecH->LineEdit1->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else if (send == Group2Points->PushButton1) {
     myEditCurrentArgument = Group2Points->LineEdit1;
@@ -461,7 +461,7 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
     Group2Points->PushButton3->setDown(false);
     Group2Points->LineEdit1->setEnabled(false);
     Group2Points->LineEdit3->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == Group2Points->PushButton3) {
     myEditCurrentArgument = Group2Points->LineEdit3;
@@ -469,7 +469,7 @@ void GenerationGUI_PrismDlg::SetEditCurrentArgument()
     Group2Points->PushButton2->setDown(false);
     Group2Points->LineEdit1->setEnabled(false);
     Group2Points->LineEdit2->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else   if (send == GroupDXDYDZ->PushButton1) {
     myEditCurrentArgument = GroupDXDYDZ->LineEdit1;
@@ -717,12 +717,15 @@ bool GenerationGUI_PrismDlg::execute (ObjectList& objects)
     if(GroupThickening->checkButton1->isChecked())
     { 
       double aThickness = GroupThickening->SpinBox_DX->value();
-      if (GroupThickening->checkButton2->isChecked())
-      {
-        aThickness = -aThickness;  
-      }
-      
-      anObj = anotherOper->MakeThickening(anObj, aThickness, /*copy=*/false);    
+      bool isInside = GroupThickening->checkButton2->isChecked();
+
+      GEOM::ListOfLong_var anArray = new GEOM::ListOfLong;
+
+      anObj = anotherOper->MakeThickening
+        (anObj, anArray, aThickness, /*copy=*/false, isInside);
+
+      if (!anObj->_is_nil() && !IsPreview())
+        anObj->SetParameters(GroupThickening->SpinBox_DX->text().toUtf8().constData());
     }
     
     if (!anObj->_is_nil())
@@ -759,3 +762,14 @@ bool GenerationGUI_PrismDlg::extractPrefix() const
 {
   return myBaseObjects.count() > 1;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> GenerationGUI_PrismDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myBaseObjects);
+  res << myVec << myPoint1 << myPoint2 ;
+  return res;
+}
index f8a7f1fde8724c516877f997d70d58a4b78fffd6..9ab922a6bb49a99698542a1c832c0cde3f02931c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -54,6 +54,7 @@ protected:
   virtual bool                       execute( ObjectList& );    
   virtual void                       addSubshapesToStudy();
   virtual bool                       extractPrefix() const;
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index f31cab6d80456e5117e87bcb8270feeb32545ceb..2d798fcbfafd8547a42eee2ca98e3049ecdd23f6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -234,7 +234,7 @@ void GenerationGUI_RevolDlg::SetEditCurrentArgument()
     myEditCurrentArgument = GroupPoints->LineEdit2;
     GroupPoints->PushButton1->setDown(false);
     GroupPoints->LineEdit1->setEnabled(false);
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -375,3 +375,14 @@ bool GenerationGUI_RevolDlg::extractPrefix() const
 {
   return myBaseObjects.count() > 1;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> GenerationGUI_RevolDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myBaseObjects);
+  res << myAxis;
+  return res;
+}
index 7fe5aa34c00735c0e457ad572e09356cda09405f..3f3ef4c736ff473c9dfcd8ad3f6e90b2f2ef53ae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       execute( ObjectList& );    
   virtual void                       addSubshapesToStudy();
   virtual bool                       extractPrefix() const;
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
diff --git a/src/GenerationGUI/GenerationGUI_ThicknessDlg.cxx b/src/GenerationGUI/GenerationGUI_ThicknessDlg.cxx
new file mode 100644 (file)
index 0000000..3c6bd00
--- /dev/null
@@ -0,0 +1,480 @@
+// 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
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : GenerationGUI_ThicknessDlg.cxx
+// Author : Sergey KHROMOV, Open CASCADE S.A.S.
+
+#include "GenerationGUI_ThicknessDlg.h"
+
+#include <GEOMBase.h>
+#include <GeometryGUI.h>
+
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+
+#include <QApplication>
+#include <QCheckBox>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+
+#include <TopExp.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <Precision.hxx>
+
+#define GEOM_SOLID_THICK     0
+#define GEOM_SOLID_HOLLOWED  1
+
+//==============================================================================
+// class    : GenerationGUI_ThicknessDlg()
+// purpose  : 
+//==============================================================================
+GenerationGUI_ThicknessDlg::GenerationGUI_ThicknessDlg
+                            (GeometryGUI* theGeometryGUI, QWidget* parent,
+                             bool modal, Qt::WindowFlags fl)
+  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
+    myFacesLbl       (0),
+    myObjSelBtn      (0),
+    myFacesSelBtn    (0),
+    myObjEdit        (0),
+    myFacesEdit      (0),
+    myThicknessSpin  (0),
+    myInsideCheck    (0)
+{
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  QPixmap image0(aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+  QPixmap image1(aResMgr->loadPixmap("GEOM", tr("ICON_DLG_THICKNESS")));
+  QPixmap image2
+    (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_THICKNESS_HOLLOWED")));
+
+  setWindowTitle(tr("GEOM_THICKNESS_TITLE"));
+
+  /***************************************************************/
+  mainFrame()->GroupConstructors->setTitle(tr("GEOM_THICKNESS"));
+  mainFrame()->RadioButton1->setIcon(image1);
+  mainFrame()->RadioButton2->setIcon(image2);
+
+  mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
+  mainFrame()->RadioButton3->close();
+
+  mainFrame()->RadioButton1->setChecked(true);
+
+  QGroupBox   *aMainGrp      = new QGroupBox (tr("GEOM_ARGUMENTS"), this);
+  QGridLayout *aParamsLayout = new QGridLayout(aMainGrp);
+  QLabel      *anObjLbl      = new QLabel (tr("GEOM_OBJECT"), aMainGrp);
+  QLabel      *aThicknessLbl = new QLabel (tr("GEOM_THICKNESS"), aMainGrp);
+  
+  myFacesLbl      = new QLabel (tr("GEOM_FACES"), aMainGrp);
+  myObjSelBtn     = new QPushButton(aMainGrp);
+  myFacesSelBtn   = new QPushButton(aMainGrp);
+  myObjEdit       = new QLineEdit(aMainGrp);
+  myFacesEdit     = new QLineEdit(aMainGrp);
+  myThicknessSpin = new SalomeApp_DoubleSpinBox(aMainGrp);
+  myInsideCheck   = new QCheckBox(tr("GEOM_TOWARDS_INSIDE"), aMainGrp);
+
+  myObjSelBtn->setIcon(image0);
+  myFacesSelBtn->setIcon(image0);
+  myObjEdit->setReadOnly(true);
+  myObjEdit->setSizePolicy
+    (QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+  myFacesEdit->setReadOnly(true);
+  myFacesEdit->setSizePolicy
+    (QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
+
+  aParamsLayout->setMargin(9);
+  aParamsLayout->setSpacing(6);
+  aParamsLayout->addWidget(anObjLbl,        0, 0);
+  aParamsLayout->addWidget(myObjSelBtn,     0, 1);
+  aParamsLayout->addWidget(myObjEdit,       0, 2);
+  aParamsLayout->addWidget(myFacesLbl,      1, 0);
+  aParamsLayout->addWidget(myFacesSelBtn,   1, 1);
+  aParamsLayout->addWidget(myFacesEdit,     1, 2);
+  aParamsLayout->addWidget(aThicknessLbl,   2, 0);
+  aParamsLayout->addWidget(myThicknessSpin, 2, 1, 1, 2);
+  aParamsLayout->addWidget(myInsideCheck,   3, 0, 1, 3);
+
+  QVBoxLayout* layout = new QVBoxLayout(centralWidget());
+
+  layout->setMargin(0);
+  layout->setSpacing(6);
+  layout->addWidget(aMainGrp);
+
+  myHelpFileName = "create_thickness_page.html";
+
+  /* Initialisation */
+  Init();
+}
+
+//==============================================================================
+// function : ~GenerationGUI_ThicknessDlg()
+// purpose  : 
+//==============================================================================
+GenerationGUI_ThicknessDlg::~GenerationGUI_ThicknessDlg()
+{
+  // no need to delete child widgets, Qt does it all for us
+}
+
+//==============================================================================
+// function : Init()
+// purpose  :
+//==============================================================================
+void GenerationGUI_ThicknessDlg::Init()
+{
+  // Get setting of step value from file configuration
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  double aStep = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
+  double aThickness    = 10.;
+  double aThicknessMin = Precision::Confusion() * 10.0;
+
+  initSpinBox(myThicknessSpin, aThicknessMin,
+              COORD_MAX, aStep, "length_precision");
+  myThicknessSpin->setValue(aThickness);
+  myObject.nullify();
+  myFaces.clear();
+
+  showOnlyPreviewControl();
+    
+  // signals and slots connections
+  connect(buttonOk(),      SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+  connect(buttonApply(),   SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+  connect(this,            SIGNAL(constructorsClicked(int)),
+          this,            SLOT(ConstructorsClicked(int)));
+  connect(myObjSelBtn,     SIGNAL(clicked()),
+          this,            SLOT(SetEditCurrentArgument()));
+  connect(myFacesSelBtn,   SIGNAL(clicked()),
+          this,            SLOT(SetEditCurrentArgument()));
+  connect(myThicknessSpin, SIGNAL(valueChanged(double)),
+          this,            SLOT(ValueChangedInSpinBox()));
+  connect(myGeomGUI,       SIGNAL(SignalDefaultStepValueChanged(double)),
+          this,            SLOT(SetDoubleSpinBoxStep(double)));
+  connect(myInsideCheck,   SIGNAL(toggled(bool)),
+          this,            SLOT(onChangeDirection(bool)));
+
+  connect(myGeomGUI->getApp()->selectionMgr(),
+          SIGNAL(currentSelectionChanged()),
+          this, SLOT(SelectionIntoArgument()));
+
+  initName(tr("GEOM_THICKNESS"));
+
+  ConstructorsClicked(0);
+}
+
+//==============================================================================
+// function : SetDoubleSpinBoxStep()
+// purpose  : Double spin box management
+//==============================================================================
+void GenerationGUI_ThicknessDlg::SetDoubleSpinBoxStep (double step)
+{
+  myThicknessSpin->setSingleStep(step);
+}
+
+//==============================================================================
+// function : ConstructorsClicked()
+// purpose  : Radio button management
+//==============================================================================
+void GenerationGUI_ThicknessDlg::ConstructorsClicked (int constructorId)
+{
+  switch (constructorId) {
+  case GEOM_SOLID_THICK:
+    myObjSelBtn->setDown(false);
+    myFacesLbl->hide();
+    myFacesSelBtn->hide();
+    myFacesEdit->hide();
+    myFaces.clear();
+    break;
+  case GEOM_SOLID_HOLLOWED:
+    myObjSelBtn->setDown(true);
+    myFacesLbl->show();
+    myFacesSelBtn->show();
+    myFacesEdit->show();
+    break;
+  default:
+    break;
+  }
+
+  myEditCurrentArgument = myObjEdit;
+  qApp->processEvents();
+  updateGeometry();
+  resize(minimumSizeHint());
+
+  SelectionIntoArgument();
+}
+
+//==============================================================================
+// function : ClickOnOk()
+// purpose  :
+//==============================================================================
+void GenerationGUI_ThicknessDlg::ClickOnOk()
+{
+  setIsApplyAndClose(true);
+
+  if (ClickOnApply()) {
+    ClickOnCancel();
+  }
+}
+
+//==============================================================================
+// function : ClickOnApply()
+// purpose  :
+//==============================================================================
+bool GenerationGUI_ThicknessDlg::ClickOnApply()
+{
+  if (!onAccept()) {
+    return false;
+  }
+
+  initName();
+
+  // activate selection and connect selection manager
+  ConstructorsClicked(getConstructorId());
+
+  return true;
+}
+
+//==============================================================================
+// function : SelectionIntoArgument()
+// purpose  : Called when selection is changed or on dialog initialization or
+//            activation
+//==============================================================================
+void GenerationGUI_ThicknessDlg::SelectionIntoArgument()
+{
+  erasePreview();
+  myEditCurrentArgument->setText("");
+
+  if (myEditCurrentArgument == myObjEdit) {
+    QList<TopAbs_ShapeEnum> aTypes;
+    const int               anID = getConstructorId();
+
+    if (anID == GEOM_SOLID_THICK) {
+      aTypes << TopAbs_SHELL << TopAbs_FACE;
+    } else if (anID == GEOM_SOLID_HOLLOWED) {
+      aTypes << TopAbs_SOLID;
+    }
+
+    myObject = getSelected(aTypes);
+
+    if (myObject) {
+      QString aName = GEOMBase::GetName(myObject.get());
+
+      myEditCurrentArgument->setText(aName);
+
+      if (anID == GEOM_SOLID_HOLLOWED && myFaces.empty()) {
+        myFacesSelBtn->click();
+      }
+    }
+  } else if (myEditCurrentArgument == myFacesEdit) {
+    myFaces.clear();
+    myFaces = getSelected(TopAbs_FACE, -1);
+
+    int i = myFaces.count();
+
+    if (i == 1) {
+      myEditCurrentArgument->setText(GEOMBase::GetName(myFaces.first().get()));
+    } else if (i > 0) {
+      myEditCurrentArgument->setText
+        (QString::number( i ) + "_" + tr("GEOM_OBJECTS"));
+    }
+  }
+
+  processPreview();
+}
+
+//==============================================================================
+// function : SetEditCurrentArgument()
+// purpose  :
+//==============================================================================
+void GenerationGUI_ThicknessDlg::SetEditCurrentArgument()
+{
+  QPushButton* send = (QPushButton*)sender();
+
+  if (send == myObjSelBtn) {
+    myFacesSelBtn->setDown(false);
+    myEditCurrentArgument = myObjEdit;
+    globalSelection(GEOM_ALLSHAPES);
+  } else if (send == myFacesSelBtn) {
+    myObjSelBtn->setDown(false);
+    myEditCurrentArgument = myFacesEdit;
+    globalSelection(); // close local contexts, if any
+    localSelection(myObject.get(), TopAbs_FACE);
+  }
+
+  myEditCurrentArgument->setFocus();
+
+  const int anID = getConstructorId();
+
+  // after setFocus(), because it will be setDown(false) when loses focus
+  send->setDown(anID == GEOM_SOLID_HOLLOWED);
+
+  // seems we need it only to avoid preview disappearing, caused by selection
+  // mode change
+  processPreview();
+}
+
+//==============================================================================
+// function : ActivateThisDialog()
+// purpose  :
+//==============================================================================
+void GenerationGUI_ThicknessDlg::ActivateThisDialog()
+{
+  GEOMBase_Skeleton::ActivateThisDialog();
+
+  connect(myGeomGUI->getApp()->selectionMgr(),
+          SIGNAL(currentSelectionChanged()),
+          this, SLOT(SelectionIntoArgument()));
+
+  ConstructorsClicked(getConstructorId());
+}
+
+//==============================================================================
+// function : enterEvent()
+// purpose  : when mouse enter onto the QWidget
+//==============================================================================
+void GenerationGUI_ThicknessDlg::enterEvent (QEvent*)
+{
+  if (!mainFrame()->GroupConstructors->isEnabled())
+    ActivateThisDialog();
+}
+
+//==============================================================================
+// function : ValueChangedInSpinBox()
+// purpose  :
+//==============================================================================
+void GenerationGUI_ThicknessDlg::ValueChangedInSpinBox()
+{
+  processPreview();
+}
+
+//==============================================================================
+// function : createOperation
+// purpose  :
+//==============================================================================
+GEOM::GEOM_IOperations_ptr GenerationGUI_ThicknessDlg::createOperation()
+{
+  return getGeomEngine()->GetI3DPrimOperations(getStudyId());
+}
+
+//==============================================================================
+// function : isValid
+// purpose  :
+//==============================================================================
+bool GenerationGUI_ThicknessDlg::isValid (QString& msg)
+{
+  bool isOk = false;
+
+  switch (getConstructorId()) {
+  case GEOM_SOLID_THICK:
+    isOk = myThicknessSpin->isValid(msg, !IsPreview()) && myObject;
+    break;
+  case GEOM_SOLID_HOLLOWED:
+    isOk = myThicknessSpin->isValid(msg, !IsPreview()) &&
+           myObject && !myFaces.empty();
+    break;
+  default:
+    break;
+  }
+
+  return isOk;
+}
+
+//==============================================================================
+// function : onChangeDirection(bool)
+// purpose  :
+//==============================================================================
+void GenerationGUI_ThicknessDlg::onChangeDirection(bool)
+{
+  processPreview();
+}
+
+//==============================================================================
+// function : execute
+// purpose  :
+//==============================================================================
+bool GenerationGUI_ThicknessDlg::execute (ObjectList& objects)
+{
+  GEOM::GEOM_Object_var            anObj;
+  GEOM::GEOM_I3DPrimOperations_var anOper       =
+    GEOM::GEOM_I3DPrimOperations::_narrow(getOperation());
+  double                           aThickness   = myThicknessSpin->value();
+  bool                             anInside = myInsideCheck->isChecked();
+  GEOM::ListOfLong_var             anObjIDsList = new GEOM::ListOfLong();
+  TopoDS_Shape                     aShape;
+
+  if (GEOMBase::GetShape(myObject.get(), aShape)) {
+    TopTools_IndexedMapOfShape aMainMap;
+    QList<int>                 aListIDs;
+
+    TopExp::MapShapes(aShape, aMainMap);
+
+    for (int i = 0; i < myFaces.count(); i++) {
+      TopoDS_Shape aFace;
+
+      if (GEOMBase::GetShape(myFaces[i].get(), aFace)) {
+        int anIndex = aMainMap.FindIndex(aFace);
+
+        if (anIndex >= 0) {
+          aListIDs << anIndex;
+        }
+      }
+    }
+
+
+    if (!aListIDs.empty()) {
+      anObjIDsList->length(aListIDs.length());
+
+      for (int i = 0; i < aListIDs.length(); i++) {
+        anObjIDsList[i] = aListIDs[i];
+      }
+    }
+  }
+
+  anObj = anOper->MakeThickening
+    (myObject.get(), anObjIDsList.in(), aThickness, true, anInside);
+    
+  if (!anObj->_is_nil()) {
+    if (!IsPreview()) {
+      QStringList aParameters;
+      aParameters << myThicknessSpin->text();
+      anObj->SetParameters(aParameters.join(":").toUtf8().constData());
+    }
+    objects.push_back(anObj._retn());
+  }
+
+  return true;
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> GenerationGUI_ThicknessDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myFaces);
+  res << myObject;
+  return res;
+}
diff --git a/src/GenerationGUI/GenerationGUI_ThicknessDlg.h b/src/GenerationGUI/GenerationGUI_ThicknessDlg.h
new file mode 100644 (file)
index 0000000..3473760
--- /dev/null
@@ -0,0 +1,84 @@
+// 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
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : GenerationGUI_ThicknessDlg.h
+// Author : Sergey KHROMOV, Open CASCADE S.A.S.
+
+#ifndef GENERATIONGUI_THICKNESSDLG_H
+#define GENERATIONGUI_THICKNESSDLG_H
+
+#include "GEOMBase_Skeleton.h"
+
+
+//=================================================================================
+// class    : GenerationGUI_ThicknessDlg
+// purpose  :
+//=================================================================================
+class GenerationGUI_ThicknessDlg : public GEOMBase_Skeleton
+{ 
+  Q_OBJECT
+
+public:
+
+  GenerationGUI_ThicknessDlg(GeometryGUI*, QWidget* = 0,
+                             bool = false, Qt::WindowFlags = 0);
+  ~GenerationGUI_ThicknessDlg();
+  
+protected:
+
+  // redefined from GEOMBase_Helper
+  virtual GEOM::GEOM_IOperations_ptr createOperation();
+  virtual bool                       isValid( QString& );
+  virtual bool                       execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
+
+private:
+  void                               Init();
+  void                               enterEvent( QEvent* );
+private:
+  GEOM::GeomObjPtr                   myObject;
+  QList<GEOM::GeomObjPtr>            myFaces;
+
+  QLabel                            *myFacesLbl;
+  QPushButton                       *myObjSelBtn;
+  QPushButton                       *myFacesSelBtn;
+  QLineEdit                         *myObjEdit;
+  QLineEdit                         *myFacesEdit;
+  SalomeApp_DoubleSpinBox           *myThicknessSpin;
+  QCheckBox                         *myInsideCheck;
+
+  
+private slots:
+  void                               ClickOnOk();
+  bool                               ClickOnApply();
+  void                               ActivateThisDialog();
+  void                               SelectionIntoArgument();
+  void                               SetEditCurrentArgument();
+  void                               ConstructorsClicked(int);
+  void                               ValueChangedInSpinBox();
+  void                               SetDoubleSpinBoxStep(double);
+  void                               onChangeDirection(bool);
+};
+
+#endif // GENERATIONGUI_THICKNESSDLG_H
index 72673f3be397a0c43901cd3b748a3e670d9a70ca..73e18271bbad8586b320fa1d3d9df1ec762b64f8 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -34,10 +34,12 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_BINARY_DIR}/idl
   ${PROJECT_BINARY_DIR}
   ${PROJECT_SOURCE_DIR}/src/OBJECT
+  ${PROJECT_SOURCE_DIR}/src/GEOMUtils
   ${PROJECT_SOURCE_DIR}/src/GEOMClient
   ${PROJECT_SOURCE_DIR}/src/GEOMImpl
   ${PROJECT_SOURCE_DIR}/src/GEOMGUI
   ${PROJECT_SOURCE_DIR}/src/GEOMBase
+  ${PROJECT_SOURCE_DIR}/src/MeasureGUI
   ${PROJECT_SOURCE_DIR}/src/DlgRef
   ${PROJECT_BINARY_DIR}/src/DlgRef
   ${CMAKE_CURRENT_SOURCE_DIR}
@@ -54,6 +56,8 @@ ADD_DEFINITIONS(
 # libraries to link to
 SET(_link_LIBRARIES
   GEOMBase
+  GEOMUtils
+  MeasureGUI
   )
 
 # --- resources ---
index eb1796861ba0abeeceb2ede5a6b7b5120d9b1e5c..1fad2e71280f65c9266f94efc98158917c1144c0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 5c1343356ea5e473b55a1e8c76c09cb9697b11cb..89ea84c70c95443feda2ee4d8e6c59b2a159215c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 0f91260f6cdc36c9bdaed344038c5733776a83c0..ff4ba6205bfc5444bd1c7ba452ecea4f3aab1e2e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -319,3 +319,21 @@ GEOM::GEOM_Object_ptr GroupGUI_BooleanDlg::getFather(GEOM::GEOM_Object_ptr theOb
   }
   return aFatherObj._retn();
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> GroupGUI_BooleanDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  for (int i = 0; i < myListShapes.length(); i++) {
+    GEOM::GeomObjPtr aGeomObjPtr(myListShapes[i]);
+    res << aGeomObjPtr;
+  }
+  for (int i = 0; i < myListTools.length(); i++) {
+    GEOM::GeomObjPtr aGeomObjPtr(myListTools[i]);
+    res << aGeomObjPtr;
+  }
+  return res;
+}
index 469581775dba4f99e06526e54bd67019ce178405..9ff9ca90216e10b0f051c8b3ec6f83c178750d00 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -53,6 +53,7 @@ protected:
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);
   virtual GEOM::GEOM_Object_ptr      getFather (GEOM::GEOM_Object_ptr);
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index a34a137d427e28795587b15c5a4f813c32640971..aec21881f3cfd50afd055b31effe0229429e5d53 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <GEOMBase.h>
 #include <GeometryGUI.h>
 #include <GEOM_Displayer.h>
+#include <GEOMUtils.hxx>
+#ifndef DISABLE_PLOT2DVIEWER
+#include <MeasureGUI_ShapeStatisticsDlg.h>
+#endif
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
 #include <SalomeApp_Tools.h>
 
 #include <LightApp_SelectionMgr.h>
+#include "utilities.h"
 
 #include <OCCViewer_ViewModel.h>
 #include <OCCViewer_ViewManager.h>
 #include <SVTK_ViewModel.h>
 #include <SALOME_Prs.h>
 #include <SALOME_ListIO.hxx>
+#include "utilities.h"
 
 #include <SUIT_Desktop.h>
 #include <SUIT_MessageBox.h>
 #define GROUP_IDLST_COLOR Qt::blue // Specific color for the IDs of subShapes in the dialog box
 #define GROUP_NEWIDLST_COLOR Qt::red // Specific color for the new IDs of subShapes in the dialog box
 
-enum { ALL_SUBSHAPES = 0, GET_IN_PLACE, SUBSHAPES_OF_SHAPE2, SUBSHAPES_OF_INVISIBLE_SHAPE2 };
+namespace {
+  enum { ALL_SUBSHAPES = 0, GET_IN_PLACE, SUBSHAPES_OF_SHAPE2, SUBSHAPES_OF_INVISIBLE_SHAPE2 };
+  enum { Filter_LT, Filter_LE, Filter_GT, Filter_GE };
+}
 
 GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QWidget* parent)
   : GEOMBase_Skeleton(theGeometryGUI, parent, false),
@@ -79,7 +88,8 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
     myBusy(false),
     myIsShapeType(false),
     myIsHiddenMain(false),
-    myWasHiddenMain(true)
+    myWasHiddenMain(true),
+    myIsAccept(false)
 {
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
 
@@ -180,9 +190,40 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
   aMedLayout->setRowStretch(5, 5);
   aMedLayout->setRowStretch(8, 5);
 
+  //filter group
+
+  myFilterGrp = new QGroupBox(tr("GEOM_FILTER"), centralWidget());
+  myLessFilterCheck = new QCheckBox(myFilterGrp);
+  myLessFilterCombo = new QComboBox(myFilterGrp);
+  myLessFilterCombo->addItem( tr("GEOM_LESS_THAN"), Filter_LT );
+  myLessFilterCombo->addItem( tr("GEOM_LESSOREQUAL_THAN"), Filter_LE );
+  myGreaterFilterCheck = new QCheckBox(myFilterGrp);
+  myGreaterFilterCombo = new QComboBox(myFilterGrp);
+  myGreaterFilterCombo->addItem( tr("GEOM_GREAT_THAN"), Filter_GT );
+  myGreaterFilterCombo->addItem( tr("GEOM_GREATOREQUAL_THAN"), Filter_GE );
+  myLessFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
+  myGreaterFilterSpin = new SalomeApp_DoubleSpinBox(myFilterGrp);
+  myApplyFilterButton = new QPushButton(tr("GEOM_BUT_APPLY"), myFilterGrp);
+#ifndef DISABLE_PLOT2DVIEWER
+  myPlotDistributionButton = new QPushButton(tr("GEOM_PLOT_DISTRIBUTION"), myFilterGrp);
+#endif
+
+  QGridLayout* filterLayout = new QGridLayout(myFilterGrp);
+  filterLayout->addWidget(myLessFilterCheck,    0, 0);
+  filterLayout->addWidget(myLessFilterCombo,    0, 1);
+  filterLayout->addWidget(myLessFilterSpin,     0, 2);
+  filterLayout->addWidget(myGreaterFilterCheck, 1, 0);
+  filterLayout->addWidget(myGreaterFilterCombo, 1, 1);
+  filterLayout->addWidget(myGreaterFilterSpin,  1, 2);
+  filterLayout->addWidget(myApplyFilterButton,  0, 3);
+#ifndef DISABLE_PLOT2DVIEWER
+  filterLayout->addWidget(myPlotDistributionButton,  1, 3);
+#endif
+
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
   layout->addWidget(GroupMedium);
+  layout->addWidget(myFilterGrp);
 
   setHelpFileName("work_with_groups_page.html");
 
@@ -193,10 +234,12 @@ GroupGUI_GroupDlg::GroupGUI_GroupDlg (Mode mode, GeometryGUI* theGeometryGUI, QW
 GroupGUI_GroupDlg::~GroupGUI_GroupDlg()
 {
   GEOM_Displayer* aDisplayer = getDisplayer();
-  if (myWasHiddenMain) {
-    aDisplayer->Erase(myMainObj);
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  bool isHideObjects = resMgr->booleanValue( "Geometry", "hide_input_object", true);
+  if (myWasHiddenMain || ( isHideObjects && myIsAccept ) ) {
     myIsHiddenMain = true;
-  } else {
+  }
+  else {
     aDisplayer->Display(myMainObj);
     myIsHiddenMain = false;
   }
@@ -210,6 +253,16 @@ GroupGUI_GroupDlg::~GroupGUI_GroupDlg()
 //=================================================================================
 void GroupGUI_GroupDlg::Init()
 {
+  // Get setting of step value from file configuration
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
+
+  // min, max, step and decimals for spin boxes
+  initSpinBox(myLessFilterSpin, 0., COORD_MAX, step, "length_precision" );
+  initSpinBox(myGreaterFilterSpin, 0., COORD_MAX, step, "length_precision" );
+  myLessFilterSpin->setValue( 0. );
+  myGreaterFilterSpin->setValue( 0. );
+
   myDmMode = -1;
   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
 
@@ -282,11 +335,19 @@ void GroupGUI_GroupDlg::Init()
   connect(myShowAllBtn,    SIGNAL(clicked()),              this, SLOT(showOnlySelected()));
   connect(myIdList,        SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged()));
 
+  connect(myApplyFilterButton, SIGNAL(clicked()),         this, SLOT(ClickOnOkFilter()));
+#ifndef DISABLE_PLOT2DVIEWER
+  connect(myPlotDistributionButton, SIGNAL(clicked()),    this, SLOT(ClickOnPlot()));
+#endif
+  connect(myLessFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
+  connect(myGreaterFilterCheck,   SIGNAL(stateChanged(int)), this, SLOT(MeasureToggled()));
+
   setInPlaceObj(GEOM::GEOM_Object::_nil());
 
   myBusy = true; // just activate but do not select in the list
   activateSelection();
   myBusy = false;
+  MeasureToggled();
 }
 
 //=================================================================================
@@ -335,7 +396,8 @@ bool GroupGUI_GroupDlg::ClickOnApply()
     setIsDisplayResult( false );
   }
     
-  if (!onAccept(myMode == CreateGroup, true, isApplyAndClose()))
+  myIsAccept = onAccept(myMode == CreateGroup, true, isApplyAndClose());
+  if (!myIsAccept)
     return false;
 
   if(!isApplyAndClose()) {
@@ -386,16 +448,22 @@ void GroupGUI_GroupDlg::ActivateThisDialog()
 //=================================================================================
 void GroupGUI_GroupDlg::SetEditCurrentArgument()
 {
-  QPushButton* send = (QPushButton*)sender();
+  QPushButton* send = qobject_cast<QPushButton*>( sender() );
 
   if (send == mySelBtn) {
     myEditCurrentArgument = myMainName;
     myShape2Name->setText("");
+    mySelBtn->setDown(true);
+    mySelBtn2->setDown(false);
   }
   else if (send == mySelBtn2 || sender() == myRestrictGroup) {
     setInPlaceObj(GEOM::GEOM_Object::_nil());
     myShape2Name->setText("");
-    if (subSelectionWay() != ALL_SUBSHAPES) {
+    if ( send == mySelBtn2 ) {
+      mySelBtn2->setDown(true);
+      mySelBtn->setDown(false);
+    }
+  if (subSelectionWay() != ALL_SUBSHAPES) {
       myEditCurrentArgument = myShape2Name;
     }
     else {
@@ -403,7 +471,12 @@ void GroupGUI_GroupDlg::SetEditCurrentArgument()
     }
   }
 
-  activateSelection();
+  //  activateSelection();
+  if(myEditCurrentArgument) {
+    myEditCurrentArgument->setFocus();
+    if ( send )
+      send->setDown(true);
+  }
 
   updateState();
 }
@@ -510,6 +583,9 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
 {
   if (subSelectionWay() != ALL_SUBSHAPES && myEditCurrentArgument == myShape2Name) {
     onGetInPlace();
+    if( !myInPlaceObj->_is_nil() ) {
+      mySelBtn2->setDown(false);
+    }
     return;
   }
 
@@ -534,6 +610,7 @@ void GroupGUI_GroupDlg::SelectionIntoArgument()
         }
         myMainObj = anObj;
         if (!CORBA::is_nil(myMainObj)) {
+         mySelBtn->setDown(false);
           SALOME_View* view = GEOM_Displayer::GetActiveView();
           if (view) {
             CORBA::String_var aMainEntry = myMainObj->GetStudyEntry();
@@ -804,6 +881,12 @@ int GroupGUI_GroupDlg::getSelectedSubshapes (TColStd_IndexedMapOfInteger& theMap
         TopoDS_Shape aShape;
         if (GEOMBase::GetShape(aGeomObj, aShape)) {
           if (aGeomObj->GetType() == GEOM_GROUP || aShape.ShapeType() == getShapeType()) {
+            if (subSelectionWay() != ALL_SUBSHAPES &&
+                GEOMBase::GetName(aGeomObj) == myShape2Name->text()) {
+              // Skip selected in place object.
+              continue;
+            }
+
             TopTools_IndexedMapOfShape aMainMap;
             TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj);
             TopExp::MapShapes(aMainShape, aMainMap);
@@ -1080,9 +1163,25 @@ void GroupGUI_GroupDlg::updateState (bool isAdd)
   myRemBtn->setEnabled(hasSel);
   myRestrictGroupBox->setEnabled(!CORBA::is_nil(myMainObj));
   mySelAllBtn->setEnabled(!CORBA::is_nil(myMainObj));
-
+  
   mySelBtn2->setEnabled(subSelectionWay() != ALL_SUBSHAPES);
   myShape2Name->setEnabled(subSelectionWay() != ALL_SUBSHAPES);
+  myFilterGrp->setEnabled(!CORBA::is_nil(myMainObj) &&
+                          subSelectionWay() == ALL_SUBSHAPES &&
+                          myIsShapeType &&
+                          getShapeType() != TopAbs_VERTEX);
+  // manage of 'Plot' button access
+  GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+  GEOM::ListOfLong_var aSubShapes = aShOp->SubShapeAllIDs( myMainObj, getShapeType(), false );
+  bool hasCurrentEntities = aSubShapes->length() > 0;
+#ifndef DISABLE_PLOT2DVIEWER
+  myPlotDistributionButton->setEnabled( myFilterGrp->isEnabled() &&
+                                       myIsShapeType &&
+                                       ( getShapeType() == TopAbs_EDGE || 
+                                         getShapeType() == TopAbs_FACE ||
+                                         getShapeType() == TopAbs_SOLID ) &&
+                                       hasCurrentEntities );
+#endif
   if (subSelectionWay() == ALL_SUBSHAPES)
     setInPlaceObj(GEOM::GEOM_Object::_nil());
 }
@@ -1317,3 +1416,92 @@ GEOM::GEOM_Object_ptr GroupGUI_GroupDlg::getFather(GEOM::GEOM_Object_ptr theObj)
   }
   return aFatherObj._retn();
 }
+
+void GroupGUI_GroupDlg::ClickOnOkFilter()
+{
+  if (CORBA::is_nil(myMainObj) || subSelectionWay() != ALL_SUBSHAPES || !myIsShapeType || getShapeType() == TopAbs_VERTEX)
+    return;
+  
+  TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj);
+  TopTools_IndexedMapOfShape aSubShapesMap;
+  TopExp::MapShapes(aMainShape, aSubShapesMap);
+  SALOME_View* view = GEOM_Displayer::GetActiveView();
+  getDisplayer()->Erase(myMainObj, false, false);
+  CORBA::String_var aMainEntry = myMainObj->GetStudyEntry();
+  QString anEntryBase = aMainEntry.in();
+
+  SALOME_ListIO toSelect;
+
+  TopExp_Explorer anExp (aMainShape, (TopAbs_ShapeEnum)getShapeType());
+  for (; anExp.More(); anExp.Next())
+  {
+    TopoDS_Shape aSubShape = anExp.Current();
+    int index = aSubShapesMap.FindIndex(aSubShape);
+    QString anEntry = QString( "TEMP_" ) + anEntryBase + QString("_%1").arg(index);
+    if ( !getDisplayer()->IsDisplayed( anEntry ) )
+      continue;
+
+    double factor = GEOMUtils::ShapeToDouble(aSubShape).second;
+    double v1 = myLessFilterSpin->value();
+    double v2 = myGreaterFilterSpin->value();
+    bool isLess = myLessFilterCombo->itemData(myLessFilterCombo->currentIndex()).toInt() == Filter_LT ? factor < v1 : factor <= v1;
+    bool isGreater = myGreaterFilterCombo->itemData(myGreaterFilterCombo->currentIndex()).toInt() == Filter_GT ? factor > v2 : factor >= v2;
+    if ( ( myLessFilterCheck->isChecked() && myGreaterFilterCheck->isChecked() && isLess && isGreater ) ||
+         ( myLessFilterCheck->isChecked() && !myGreaterFilterCheck->isChecked() && isLess ) ||
+         ( myGreaterFilterCheck->isChecked() && !myLessFilterCheck->isChecked() && isGreater ) ) {
+      Handle(SALOME_InteractiveObject) io = new SALOME_InteractiveObject();
+      io->setEntry( anEntry.toLatin1().constData() );
+      toSelect.Append(io);
+    }
+  }
+  if ( toSelect.Extent() > 0 ) {
+    myGeomGUI->getApp()->selectionMgr()->setSelectedObjects(toSelect);
+    SUIT_MessageBox::information( this,
+                                  tr( "INF_INFO" ),
+                                  tr( "GEOM_SOME_SHAPES_SELECTED").arg( toSelect.Extent() ),
+                                  tr( "BUT_OK" ) );
+  }
+  else {
+    SUIT_MessageBox::information( this,
+                                  tr( "INF_INFO" ),
+                                  tr( "GEOM_NO_SHAPES_SELECTED" ),
+                                  tr( "BUT_OK" ) );
+  }
+  updateState(true);
+}
+
+#ifndef DISABLE_PLOT2DVIEWER
+//=================================================================================
+// function : ClickOnPlot()
+// purpose  : opens "Shape Statistics" dialog box in order to plot sub-shapes distribution.
+//=================================================================================
+void GroupGUI_GroupDlg::ClickOnPlot()
+{
+  TopoDS_Shape aMainShape = GEOM_Client::get_client().GetShape(GeometryGUI::GetGeomGen(), myMainObj);
+  QDialog* dlg = new MeasureGUI_ShapeStatisticsDlg( this, aMainShape, getShapeType() );
+  if ( dlg ) {
+    dlg->show();
+  }
+}
+#endif
+
+void GroupGUI_GroupDlg::MeasureToggled()
+{
+  myLessFilterSpin->setEnabled(myLessFilterCheck->isChecked());
+  myLessFilterCombo->setEnabled(myLessFilterCheck->isChecked());
+  myGreaterFilterSpin->setEnabled(myGreaterFilterCheck->isChecked());
+  myGreaterFilterCombo->setEnabled(myGreaterFilterCheck->isChecked());
+  myApplyFilterButton->setEnabled(myLessFilterCheck->isChecked() || myGreaterFilterCheck->isChecked());
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> GroupGUI_GroupDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr1(myMainObj), aGeomObjPtr2(myInPlaceObj);
+  res << aGeomObjPtr1 << aGeomObjPtr2;
+  return res;
+}
index fe43e22213ebbee9a33bb497ed58da0216ec7d16..4a2385b042dfdd11053bd9ddd2a1b9398e7a8c14 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <TColStd_DataMapOfIntegerInteger.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
 
+class QCheckBox;
+class QComboBox;
+class QPushButton;
 class QGroupBox;
 class QLineEdit;
 class QListWidget;
 class QButtonGroup;
+class SalomeApp_DoubleSpinBox;
 
 //=================================================================================
 // class    : GroupGUI_GroupDlg
@@ -61,6 +65,7 @@ protected:
   virtual bool                        isValid (QString&);
   virtual bool                        execute (ObjectList&);
   virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
   void                                closeEvent (QCloseEvent*);
 
@@ -77,6 +82,11 @@ private slots:
   void                                remove();
   void                                showOnlySelected();
   void                                selectionChanged();
+  void                                ClickOnOkFilter();
+#ifndef DISABLE_PLOT2DVIEWER
+  void                                ClickOnPlot();
+#endif
+  void                                MeasureToggled();
 
 private:
   void                                Init();
@@ -105,6 +115,7 @@ private:
   TColStd_DataMapOfIntegerInteger     myMain2InPlaceIndices;
   QList<int>                          myGroupIdList;
   int                                 myDmMode;
+  bool                                myIsAccept;
 
   QPushButton*                        mySelBtn;
   QLineEdit*                          myMainName;
@@ -119,6 +130,15 @@ private:
   QPushButton*                        myHideSelBtn;
   QPushButton*                        myShowAllBtn;
   QListWidget*                        myIdList;
+  QCheckBox*                          myLessFilterCheck;
+  QCheckBox*                          myGreaterFilterCheck;
+  QComboBox*                          myLessFilterCombo;
+  QComboBox*                          myGreaterFilterCombo;
+  SalomeApp_DoubleSpinBox*            myLessFilterSpin;
+  SalomeApp_DoubleSpinBox*            myGreaterFilterSpin;
+  QPushButton*                        myApplyFilterButton;
+  QPushButton*                        myPlotDistributionButton;
+  QGroupBox*                          myFilterGrp;
 };
 
 #endif
index ee240841dfec6bc3fc861f5f0bcec56c14d0e075..b380989f415c12ccb4a01b02398bf6c46f6fef78 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 6f0c726eec442ce8e784f7243f9389a8cc821f7f..3f55d9d14aff4c3edb145c32ff4691f82fe9c36d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index cb20e5463d4696a5bde441b4834b0b8c5041a9c9..eb8b3ffc8ac9020808ba4cd4b457a93c142c5d8c 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1b21c2c304c2c5c3c45fc44093abec2b09b34a86..cb667070f99dfe86f83d92a7b5a8ae55e24d42ea 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 454b09a2af79c15126886c38104262202ab47672..b3c029bff1a34df5a421e251f57bb7243ed06c6b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 29d1ea789d1951e20986f28cb0f4cb6d8b033cec..f9b0adb19a10415e448761a9405c126a15a33bd3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 53d9be6c594a03c0356bea33e4003412630d1bbc..cd9e000c17d6c3f8287952154b939658efc348cb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d6c3feb397f2f39efe1c095e9dd92cd09575883a..f3dd0d0accb9861e2d67f5bc620e543e6d743cf9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include "GEOM_Operation.h"
 #include "GEOMBase.h"
 #include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(IGESPlugin)
 
+typedef GEOM::GenericObjPtr<GEOM::IIGESOperations> IGESOpPtr;
+
 //=======================================================================
 // function : IGESPlugin_GUI()
 // purpose  : Constructor
@@ -109,8 +112,8 @@ bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "IGESPluginEngine" );
-  GEOM::IIGESOperations_var igesOp = GEOM::IIGESOperations::_narrow( op );
-  if ( CORBA::is_nil( igesOp ) ) return false;
+  IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op );
+  if ( igesOp.isNull() ) return false;
 
   QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
                                                 tr( "IGES_FILES" ),
@@ -126,7 +129,7 @@ bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent )
     {
       QString fileName = fileNames.at( i );
       SUIT_OverrideCursor wc;
-      GEOM_Operation transaction( app, igesOp.in() );
+      GEOM_Operation transaction( app, igesOp.get() );
       bool ignoreUnits = false;
       
       try
@@ -182,6 +185,7 @@ bool IGESPlugin_GUI::importIGES( SUIT_Desktop* parent )
          entryList.append( so->GetID() );
          transaction.commit();
          GEOM_Displayer( study ).Display( main.in() );
+          main->UnRegister();
        }
        else
        {
@@ -221,8 +225,8 @@ bool IGESPlugin_GUI::exportIGES( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "IGESPluginEngine" );
-  GEOM::IIGESOperations_var igesOp = GEOM::IIGESOperations::_narrow( op );
-  if ( CORBA::is_nil( igesOp ) ) return false;
+  IGESOpPtr igesOp = GEOM::IIGESOperations::_narrow( op );
+  if ( igesOp.isNull() ) return false;
 
   LightApp_SelectionMgr* sm = app->selectionMgr();
   if ( !sm ) return false;
@@ -251,7 +255,7 @@ bool IGESPlugin_GUI::exportIGES( SUIT_Desktop* parent )
     
     SUIT_OverrideCursor wc;
     
-    GEOM_Operation transaction( app, igesOp.in() );
+    GEOM_Operation transaction( app, igesOp.get() );
     
     try
     {
index 58f6f9ccd6a98d99b36c85bc0f6e1f605537dd2f..3858f17e7fb5d59216d2ded5e41ad822390a265d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 85937db656cdc4412bbca490b298bd479c034e5a..69e6764e38232676d2ebade9a469295edef57307 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 49b1f14e1436c0048a79706a9a37a769a3c2a672..289aadc4ed8678fb3337bd10f0e92969c3745b83 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 212480193fe72e62dad9a5228bfedb79b4fd4676..942015049684ba40c0dec84c0c74cbd19424e4f8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index da1953d80c8de1a67b0d12843e3987fba027736c..1a42732c93a634136541bf1aaf6e957b06155367 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7547da3a0a13dc5b52a444336d2015fb8812a90c..2e1f45a94114aa0b22bd99e7f9904e512c096767 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index a834f5765e0b97c9a2f98fb1f22c0c938b86addc..3ab0d0e26f675ec4d32a102c0c2b493a13e96292 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 0b8766629a6112e0a2ed6d3c10ad9f550bf0cf53..19316aa8555ea8d781d9054f401ae3f7a437e0b5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 755b097693f8983dd2ce1dbe2b499aa8381689b5..62936a33212e5e49ffc471702d727654728abf2a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 4ae420e9b37dceb7edd78888da782ec13d26153e..23e8dd9bdbf5b21b4b12c5699e7684e7a0829bf5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 0b12fa8141cf9bcfa78ab132eab30c1c13e9f583..0c799f7038baf8fa02084c27c0a3aab098a58198 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3ea6fc73d818fa7d1e7e21277404b17e4ae5af23..8aa03529fa3040e2c9a6f435e53f7bbf2ac284f9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index fa2eeb0140da5d14dcecb78a170a4dcf072dc3fc..2b62eec711cd5ca309b454c6671ff6c6b24d2c1b 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 5064dead25ff0bc4881ed72d27c9f524840bfaa1..ef4817a65c134b866525b07a79170ccaee803e55 100644 (file)
@@ -1,57 +1,57 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
-        <source>MEN_EXPORTIGES</source>
-        <translation type="unfinished">IGES</translation>
+      <source>MEN_EXPORTIGES</source>
+      <translation>IGESエクスポート</translation>
     </message>
     <message>
-        <source>TOP_EXPORTIGES</source>
-        <translation type="unfinished">Export IGES</translation>
+      <source>TOP_EXPORTIGES</source>
+      <translation>IGESエクスポート</translation>
     </message>
     <message>
-        <source>STB_EXPORTIGES</source>
-        <translation type="unfinished">Export IGES</translation>
+      <source>STB_EXPORTIGES</source>
+      <translation>IGESエクスポート</translation>
     </message>
     <message>
-        <source>MEN_IMPORTIGES</source>
-        <translation type="unfinished">IGES</translation>
+      <source>MEN_IMPORTIGES</source>
+      <translation>IGESインポート</translation>
     </message>
     <message>
-        <source>TOP_IMPORTIGES</source>
-        <translation type="unfinished">Import IGES</translation>
+      <source>TOP_IMPORTIGES</source>
+      <translation>IGESインポート</translation>
     </message>
     <message>
-        <source>STB_IMPORTIGES</source>
-        <translation type="unfinished">Import IGES</translation>
+      <source>STB_IMPORTIGES</source>
+      <translation>IGESインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>IGESPlugin_GUI</name>
     <message>
-        <source>IGES_FILES</source>
-        <translation type="unfinished">IGES Files ( *.iges *.igs )</translation>
+      <source>IGES_FILES</source>
+      <translation>IGES ファイル ( *.iges *.igs )</translation>
     </message>
     <message>
-        <source>EXPORT_TITLE</source>
-        <translation type="unfinished">Export IGES</translation>
+      <source>EXPORT_TITLE</source>
+      <translation>IGESエクスポート</translation>
     </message>
     <message>
-        <source>IMPORT_TITLE</source>
-        <translation type="unfinished">Import IGES</translation>
+      <source>IMPORT_TITLE</source>
+      <translation>IGESインポート</translation>
     </message>
     <message>
-        <source>SCALE_DIMENSIONS</source>
-        <translation>インポートしたファイルの単位をミリメートルからメートルに変換しますか?いいえを選んだ場合、メートル単位として解釈します。</translation>
+      <source>SCALE_DIMENSIONS</source>
+      <translation>インポートしたファイルの単位をミリメートルからメートルに変換しますか?いいえを選んだ場合、メートル単位として解釈します。</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>IGESPlugin_ExportDlg</name>
     <message>
-        <source>IGES_VERSION</source>
-        <translation type="unfinished">Version</translation>
+      <source>IGES_VERSION</source>
+      <translation>IGESバージョン</translation>
     </message>
-</context>
+  </context>
 </TS>
index c9782eb19e24ac1ee0fcc078048f68564573a7df..f8957e5623f27760bb64ac97c6353f560d40afcd 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 4ead0a14577d8c1e0ea2419c1a598758384368aa..c4a25e7903efca13e07ec04e159032ce104f690d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3eafd3c38eabbab1bc8853a6b379f5a28c6f90cd..4765179a9c9a16126c6aa0e47918501d2ac2f4ca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index deea5cca784a6531eccea9613d36e9cfc20b1d72..c719231d64def552bddd6df51b0605382c701f95 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 0f302783961bfe1e942fe8f7254be0734e0bcbba..9a62c492ee85aca41be495496f67612f0c7a4171 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 8896929ae91b37f22841782c7d6b5028aa370c1b..658e0c0932c6e1e220886defdb2bd0ee804368c3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2155eb0138a2d70090c9c88e86e4e8a5dec16f66..2754129411ac4adc59cc464a5b7541bff07763ff 100644 (file)
@@ -1,5 +1,5 @@
 <!--
-  Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+  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
index 8f57e40ad500c0f97f5b50fdf178d37611007604..eaae08f27afdae774af31ddf9153abbe10c31ee8 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -97,12 +97,14 @@ SET(MeasureGUI_HEADERS
   MeasureGUI_CheckCompoundOfBlocksDlg.h
   MeasureGUI_GetNonBlocksDlg.h
   MeasureGUI_CheckSelfIntersectionsDlg.h
+  MeasureGUI_FastCheckIntersectionsDlg.h
   MeasureGUI_PointDlg.h
   MeasureGUI_ManageDimensionsDlg.h
   MeasureGUI_CreateDimensionDlg.h
   MeasureGUI_DimensionCreateTool.h
   MeasureGUI_DimensionInteractor.h
   MeasureGUI_DimensionFilter.h
+  MeasureGUI_definitions.h
   )
 
 # header files / to be processed by moc
@@ -123,11 +125,18 @@ SET(_moc_HEADERS
   MeasureGUI_CheckCompoundOfBlocksDlg.h
   MeasureGUI_GetNonBlocksDlg.h
   MeasureGUI_CheckSelfIntersectionsDlg.h
+  MeasureGUI_FastCheckIntersectionsDlg.h
   MeasureGUI_PointDlg.h
   MeasureGUI_ManageDimensionsDlg.h
   MeasureGUI_CreateDimensionDlg.h
   MeasureGUI_DimensionInteractor.h
   )
+  
+IF(SALOME_USE_PLOT2DVIEWER)
+  LIST(APPEND _moc_HEADERS
+    MeasureGUI_ShapeStatisticsDlg.h
+    )
+ENDIF()
 
 # header files / uic wrappings
 QT4_WRAP_UI(_uic_HEADERS ${_uic_files})
@@ -154,6 +163,7 @@ SET(MeasureGUI_SOURCES
   MeasureGUI_CheckCompoundOfBlocksDlg.cxx
   MeasureGUI_GetNonBlocksDlg.cxx
   MeasureGUI_CheckSelfIntersectionsDlg.cxx
+  MeasureGUI_FastCheckIntersectionsDlg.cxx
   MeasureGUI_PointDlg.cxx
   MeasureGUI_ManageDimensionsDlg.cxx
   MeasureGUI_CreateDimensionDlg.cxx
@@ -164,6 +174,12 @@ SET(MeasureGUI_SOURCES
   ${_uic_files}
   )
 
+IF(SALOME_USE_PLOT2DVIEWER)
+  LIST(APPEND MeasureGUI_SOURCES
+    MeasureGUI_ShapeStatisticsDlg.cxx
+    )
+ENDIF()
+
 # --- rules ---
 
 ADD_LIBRARY(MeasureGUI ${MeasureGUI_SOURCES})
index 3f5358745c0d2fbd527457563652778fc1951f5e..d76f132ff0e1c04bc5b5c55afb302507d08e9ed3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include "MeasureGUI_CheckCompoundOfBlocksDlg.h"  // Method CHECKCOMPOUND
 #include "MeasureGUI_GetNonBlocksDlg.h"           // Method GET NON BLOCKS
 #include "MeasureGUI_CheckSelfIntersectionsDlg.h" // Method CHECK SELF INTERSCTIONS
+#include "MeasureGUI_FastCheckIntersectionsDlg.h" // Method FAST CHECK INTERSCTIONS
 #include "MeasureGUI_PointDlg.h"                  // Method POINTCOORDINATES
 #include "MeasureGUI_ManageDimensionsDlg.h"       // Method MANAGEDIMENSIONS
+#ifndef DISABLE_PLOT2DVIEWER
+#include "MeasureGUI_ShapeStatisticsDlg.h"        // Method SHAPE STATISTICS
+#endif
 
 #include <QApplication>
 
@@ -125,6 +129,14 @@ bool MeasureGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   case GEOMOp::OpCheckSelfInters:
     dlg = new MeasureGUI_CheckSelfIntersectionsDlg( getGeometryGUI(), parent );
     break; // CHECK SELF INTERSCTIONS
+  case GEOMOp::OpFastCheckInters:
+    dlg = new MeasureGUI_FastCheckIntersectionsDlg( getGeometryGUI(), parent );
+    break; // FAST CHECK INTERSCTIONS
+#ifndef DISABLE_PLOT2DVIEWER
+  case GEOMOp::OpShapeStatistics:
+    dlg = new MeasureGUI_ShapeStatisticsDlg( parent );
+    break; // SHAPE STATISTICS
+#endif
   case GEOMOp::OpPointCoordinates:
     dlg = new MeasureGUI_PointDlg( getGeometryGUI(), parent );
     break; // POINT COORDINATES
@@ -191,7 +203,7 @@ void MeasureGUI::ChangeDimensionsVisibility( const bool theIsVisible )
     return;
   }
 
-  SUIT_OverrideCursor();
+  SUIT_OverrideCursor wc;
 
   GEOMGUI_DimensionProperty aDimensions( anActiveStudy, anIObject->getEntry() );
 
index bbc71bf96bf065db96cbc58ef293a08e9270e3ca..90bca374c0bf0818d9ab8c577963d82f38c33122 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 2f8f47bbd4c5c4d0533e5ae3b62839a80f2bcbec..2d8de0fcc5f6609f412da43b40954539a7035fbf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -55,7 +55,6 @@
 #include <gce_MakePln.hxx>
 #include <Precision.hxx>
 #include <AIS.hxx>
-#include <AIS_Drawer.hxx>
 #include <Prs3d_LineAspect.hxx> 
 #include <IntTools_EdgeEdge.hxx>
 #include <IntTools_SequenceOfCommonPrts.hxx>
@@ -136,7 +135,10 @@ void MeasureGUI_AngleDlg::Init()
   // init variables
   myGrp->LineEdit1->setText("");
   myGrp->LineEdit2->setText("");
-  myObj = myObj2 = GEOM::GEOM_Object::_nil();
+  myGrp->LineEdit1->setEnabled(true);
+  myGrp->LineEdit2->setEnabled(false);
+  myObj.nullify();
+  myObj2.nullify();
 
   mySelBtn   = myGrp->PushButton1;
   mySelEdit  = myGrp->LineEdit1;
@@ -149,7 +151,7 @@ void MeasureGUI_AngleDlg::Init()
   connect(mySelEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
   connect(mySelBtn2,  SIGNAL(clicked()),       this, SLOT(SetEditCurrentArgument()));
 
-  globalSelection(GEOM_LINE);
+  activateSelection();  
   MeasureGUI_Skeleton::Init();
 }
 
@@ -159,15 +161,7 @@ void MeasureGUI_AngleDlg::Init()
 //=================================================================================
 void MeasureGUI_AngleDlg::SelectionIntoArgument()
 {
-  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
-  SALOME_ListIO aSelList;
-  aSelMgr->selectedObjects(aSelList);
-
-  GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
-
-  if (aSelList.Extent() > 0) {
-    aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
-  }
+  GEOM::GeomObjPtr aSelectedObject = getSelected( TopAbs_EDGE );
 
   // clear selection
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
@@ -177,12 +171,12 @@ void MeasureGUI_AngleDlg::SelectionIntoArgument()
 
   if (myEditCurrentArgument == mySelEdit) {
     myObj = aSelectedObject;
-    if (!myObj->_is_nil() && myObj2->_is_nil())
+    if (myObj && !myObj2)
       myGrp->PushButton2->click();
   }
   else {
     myObj2 = aSelectedObject;
-    if (!myObj2->_is_nil() && myObj->_is_nil())
+    if (myObj2 && !myObj)
       myGrp->PushButton1->click();
   }
 
@@ -195,8 +189,8 @@ void MeasureGUI_AngleDlg::SelectionIntoArgument()
 //=================================================================================
 void MeasureGUI_AngleDlg::processObject()
 {
-  myGrp->LineEdit1->setText(!myObj->_is_nil()  ? GEOMBase::GetName(myObj ) : "");
-  myGrp->LineEdit2->setText(!myObj2->_is_nil() ? GEOMBase::GetName(myObj2) : "");
+  myGrp->LineEdit1->setText(myObj  ? GEOMBase::GetName(myObj.get()) : "");
+  myGrp->LineEdit2->setText(myObj2 ? GEOMBase::GetName(myObj2.get()) : "");
 
   double anAngle = 0.;
   if (getParameters(anAngle)) {
@@ -220,7 +214,7 @@ bool MeasureGUI_AngleDlg::getParameters (double& theAngle)
   if (isValid(msg)) {
     GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
     try {
-      theAngle = anOper->GetAngle(myObj, myObj2);
+      theAngle = anOper->GetAngle(myObj.get(), myObj2.get());
     }
     catch(const SALOME::SALOME_Exception& e) {
       SalomeApp_Tools::QtCatchCorbaException(e);
@@ -262,7 +256,7 @@ void MeasureGUI_AngleDlg::SetEditCurrentArgument()
   }
 
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-  globalSelection(GEOM_LINE);
+  activateSelection();
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 
@@ -304,10 +298,11 @@ void MeasureGUI_AngleDlg::LineEditReturnPressed()
 SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
 {
   double anAngle = 0.;
+  myGrp->LineEdit3->setText("");
 
   SUIT_ViewWindow* vw = SUIT_Session::session()->activeApplication()->desktop()->activeWindow();
 
-  if (myObj->_is_nil() || myObj2->_is_nil() || !getParameters(anAngle) ||
+  if (!myObj || !myObj2 || !getParameters(anAngle) ||
        vw->getViewManager()->getType() != OCCViewer_Viewer::Type())
     return 0;
 
@@ -315,8 +310,8 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
     try {
       OCC_CATCH_SIGNALS;
       TopoDS_Shape S1, S2;
-      if (GEOMBase::GetShape(myObj , S1, TopAbs_EDGE) &&
-           GEOMBase::GetShape(myObj2, S2, TopAbs_EDGE)) {
+      if (GEOMBase::GetShape(myObj.get() , S1, TopAbs_EDGE) &&
+        GEOMBase::GetShape(myObj2.get(), S2, TopAbs_EDGE)) {
         TopoDS_Edge anEdge1 = TopoDS::Edge(S1);
         TopoDS_Edge anEdge2 = TopoDS::Edge(S2);
 
@@ -399,5 +394,15 @@ SALOME_Prs* MeasureGUI_AngleDlg::buildPrs()
 //=================================================================================
 bool MeasureGUI_AngleDlg::isValid (QString& msg)
 {
-  return MeasureGUI_Skeleton::isValid(msg) && !myObj2->_is_nil();
+  return MeasureGUI_Skeleton::isValid(msg) && myObj2;
+}
+
+//=================================================================================
+// function : activateSelection()
+// purpose  :
+//=================================================================================
+void MeasureGUI_AngleDlg::activateSelection()
+{
+  globalSelection(GEOM_LINE);
+  localSelection( TopAbs_EDGE );
 }
index 46615265d6c2578913099c8063b4eca48e92efa2..a417f0ed3bc76563eaf32b411f8e8b578bd10d3f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -52,6 +52,7 @@ protected:
 private:
   void                          Init();
   bool                          getParameters( double& );
+  void                          activateSelection();
 
 private:
   QLineEdit*                    myEditCurrentArgument;
@@ -59,7 +60,7 @@ private:
   QPushButton*                  mySelBtn2;
   MeasureGUI_2Sel1LineEdit*     myGrp;
 
-  GEOM::GEOM_Object_var         myObj2;
+  GEOM::GeomObjPtr              myObj2;
 };
 
 #endif // MEASUREGUI_ANGLEDLG_H
index 0da5051ba80048134ca09d06f4b8e36bcae91a15..ddb2e566a5ee9e66e669c745f00530dfa63a3eb5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -124,7 +124,7 @@ void MeasureGUI_BndBoxDlg::Init()
           this, SLOT(SelectionIntoArgument()));
 
   initName(tr("GEOM_BNDBOX"));
-  globalSelection();
+  activateSelection();
   SelectionIntoArgument();
 }
 
@@ -148,6 +148,7 @@ bool MeasureGUI_BndBoxDlg::ClickOnApply()
     return false;
 
   initName();
+  activateSelection();
   return true;
 }
 
@@ -162,7 +163,7 @@ void MeasureGUI_BndBoxDlg::ActivateThisDialog()
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 
-  globalSelection();
+  activateSelection();
   redisplayPreview();
 }
 
@@ -216,11 +217,11 @@ bool MeasureGUI_BndBoxDlg::getParameters (double& theXmin, double& theXmax,
                                           double& theYmin, double& theYmax,
                                           double& theZmin, double& theZmax)
 {
-  if (myObj->_is_nil())
+  if (!myObj)
     return false;
 
   GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
-  anOper->GetBoundingBox(myObj, true, theXmin, theXmax, theYmin, theYmax, theZmin, theZmax);
+  anOper->GetBoundingBox(myObj.get(), true, theXmin, theXmax, theYmin, theYmax, theZmin, theZmax);
 
   return anOper->IsDone();
 }
@@ -249,28 +250,19 @@ SALOME_Prs* MeasureGUI_BndBoxDlg::buildPrs()
 void MeasureGUI_BndBoxDlg::SelectionIntoArgument()
 {
   myEditCurrentArgument->setText("");
-  myObj = GEOM::GEOM_Object::_nil();
+  myObj.nullify();
 
-  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
-  SALOME_ListIO aSelList;
-  aSelMgr->selectedObjects(aSelList);
+  QList<TopAbs_ShapeEnum> aTypes;
+  aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE;
+  myObj = getSelected( aTypes );
 
-  if (aSelList.Extent() != 1) {
+  if ( !myObj ) {
     processObject();
     erasePreview();
     return;
   }
 
-  GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First());
-
-  if (aSelectedObject->_is_nil()) {
-    processObject();
-    erasePreview();
-    return;
-  }
-
-  myObj = aSelectedObject;
-  myEditCurrentArgument->setText(GEOMBase::GetName(myObj));
+  myEditCurrentArgument->setText(GEOMBase::GetName(myObj.get()));
   processObject();
   redisplayPreview();
 }
@@ -290,7 +282,7 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_BndBoxDlg::createOperation()
 //=================================================================================
 bool MeasureGUI_BndBoxDlg::isValid (QString&)
 {
-  return !myObj->_is_nil();
+  return myObj;
 }
 
 //=================================================================================
@@ -300,7 +292,7 @@ bool MeasureGUI_BndBoxDlg::isValid (QString&)
 bool MeasureGUI_BndBoxDlg::execute (ObjectList& objects)
 {
   GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
-  GEOM::GEOM_Object_var anObj = anOper->MakeBoundingBox(myObj, true);
+  GEOM::GEOM_Object_var anObj = anOper->MakeBoundingBox(myObj.get(), true);
 
   if (!anObj->_is_nil())
     objects.push_back(anObj._retn());
@@ -308,6 +300,16 @@ bool MeasureGUI_BndBoxDlg::execute (ObjectList& objects)
   return true;
 }
 
+//=================================================================================
+// function : activateSelection()
+// purpose  :
+//=================================================================================
+void MeasureGUI_BndBoxDlg::activateSelection()
+{
+  globalSelection( GEOM_ALLSHAPES );
+  localSelection( TopAbs_SHAPE );
+}
+
 //=================================================================================
 // function : redisplayPreview()
 // purpose  :
@@ -323,7 +325,7 @@ void MeasureGUI_BndBoxDlg::redisplayPreview()
   erasePreview(false);
 
   try {
-    SUIT_OverrideCursor();
+    SUIT_OverrideCursor wc;
 
     getDisplayer()->SetColor(Quantity_NOC_VIOLET);
     getDisplayer()->SetToActivate(false);
@@ -337,3 +339,23 @@ void MeasureGUI_BndBoxDlg::redisplayPreview()
   catch (...) {
   }
 }
+
+//=================================================================================
+// function : addSubshapeToStudy
+// purpose  : virtual method to add new SubObjects if local selection
+//=================================================================================
+void MeasureGUI_BndBoxDlg::addSubshapesToStudy()
+{
+  GEOMBase::PublishSubObject( myObj.get() );
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> MeasureGUI_BndBoxDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myObj;
+  return res;
+}
index 1386f0c30a239f2d4a18cf23fda6b1ed66d922e7..500de9eaab3114ba44f0df94ba857fcb44e976ec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -48,18 +48,20 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);
-
+  virtual void                       addSubshapesToStudy();
   void                               redisplayPreview();
   virtual void                       processObject();
   virtual SALOME_Prs*                buildPrs();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
   void                               enterEvent (QEvent*);
+  void                               activateSelection();
   bool                               getParameters (double&, double&, double&, double&, double&, double&);
 
 private:
-  GEOM::GEOM_Object_var              myObj;
+  GEOM::GeomObjPtr                   myObj;
   MeasureGUI_1Sel6LineEdit*          myGrp;
 
 private slots:
index 64a3f556eae2376a79452de55bd64dd0dfbbeadb..0fdecafde5dd57660cdbee7f778e182525500aa5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -120,10 +120,19 @@ void MeasureGUI_CenterMassDlg::Init()
            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
 
   initName( tr( "GEOM_POINT") );
-  globalSelection();
+  activateSelection();
   SelectionIntoArgument();
 }
 
+//=================================================================================
+// function : activateSelection
+// purpose  : 
+//=================================================================================
+void MeasureGUI_CenterMassDlg::activateSelection()
+{
+  globalSelection( GEOM_ALLSHAPES );
+  localSelection( TopAbs_SHAPE );
+}
 
 //=================================================================================
 // function : ClickOnOk()
@@ -146,6 +155,7 @@ bool MeasureGUI_CenterMassDlg::ClickOnApply()
     return false;
 
   initName();
+  activateSelection();
   return true;
 
 //    myMeasureGUI->MakeCDGAndDisplay( myGeomShape );
@@ -159,26 +169,17 @@ bool MeasureGUI_CenterMassDlg::ClickOnApply()
 void MeasureGUI_CenterMassDlg::SelectionIntoArgument()
 {
   erasePreview();
-  myObj = GEOM::GEOM_Object::_nil();
-
-  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
-  SALOME_ListIO aSelList;
-  aSelMgr->selectedObjects(aSelList);
 
-  if (aSelList.Extent() != 1) {
-    processObject();
-    return;
-  }
+  myObj.nullify();
+  QList<TopAbs_ShapeEnum> aTypes;
+  aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE;
+  myObj = getSelected( aTypes );
 
-  GEOM::GEOM_Object_var aSelectedObject =
-    GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
-
-  if ( aSelectedObject->_is_nil() ) {
+  if ( !myObj ) {
     processObject();
     return;
   }
 
-  myObj = aSelectedObject;
   processObject();
   displayPreview(true);
 }
@@ -220,7 +221,7 @@ void MeasureGUI_CenterMassDlg::ActivateThisDialog()
   connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 
            SIGNAL(currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
 
-  globalSelection();
+  activateSelection();
   displayPreview(true);
 }
 
@@ -230,7 +231,7 @@ void MeasureGUI_CenterMassDlg::ActivateThisDialog()
 //=================================================================================
 void MeasureGUI_CenterMassDlg::processObject()
 {
-  if ( myObj->_is_nil() ) {
+  if ( !myObj ) {
     myGrp->LineEdit1->setText( "" );
     myGrp->LineEdit2->setText( "" );
     myGrp->LineEdit3->setText( "" );
@@ -242,7 +243,7 @@ void MeasureGUI_CenterMassDlg::processObject()
     
     getParameters( x, y, z );
     
-    myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) );
+    myGrp->LineEdit1->setText( GEOMBase::GetName( myObj.get() ) );
 
     SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
     int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
@@ -280,7 +281,7 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_CenterMassDlg::createOperation()
 //=================================================================================
 bool MeasureGUI_CenterMassDlg::isValid( QString& )
 {
-  return !myObj->_is_nil();
+  return myObj;
 }
 
 //=================================================================================
@@ -289,12 +290,12 @@ bool MeasureGUI_CenterMassDlg::isValid( QString& )
 //=================================================================================
 bool MeasureGUI_CenterMassDlg::getParameters( double& theX, double& theY, double& theZ )
 {
-  if ( myObj->_is_nil() )
+  if ( !myObj )
     return false;
   else {
     try {
       GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
-      GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj );
+      GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj.get() );
       if ( !anOper->IsDone() )
         return false;
 
@@ -328,10 +329,30 @@ bool MeasureGUI_CenterMassDlg::getParameters( double& theX, double& theY, double
 bool MeasureGUI_CenterMassDlg::execute( ObjectList& objects )
 {
   GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
-  GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj );
+  GEOM::GEOM_Object_var anObj = anOper->GetCentreOfMass( myObj.get() );
 
   if ( !anObj->_is_nil() )
     objects.push_back( anObj._retn() );
 
   return true;
 }
+
+//=================================================================================
+// function : addSubshapeToStudy
+// purpose  : virtual method to add new SubObjects if local selection
+//=================================================================================
+void MeasureGUI_CenterMassDlg::addSubshapesToStudy()
+{
+  GEOMBase::PublishSubObject( myObj.get() );
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> MeasureGUI_CenterMassDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myObj;
+  return res;
+}
index f279c6c3364e42a56a399d1a4904b99fb53c22bf..85b7fea0553cdd1977653b833cdc150daa515735 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -47,7 +47,9 @@ protected:
   // redefined from GEOMBase_Helper
   virtual GEOM::GEOM_IOperations_ptr  createOperation();
   virtual bool                        isValid( QString& );
+  virtual void                        addSubshapesToStudy();
   virtual bool                        execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
 private slots:
   void                                ClickOnOk();
@@ -61,10 +63,11 @@ private:
   void                                Init();
   void                                enterEvent( QEvent* );
   void                                processObject();
+  void                                activateSelection();
   bool                                getParameters( double&, double&, double& );
   
 private:
-  GEOM::GEOM_Object_var               myObj;
+  GEOM::GeomObjPtr                    myObj;
   MeasureGUI_1Sel3LineEdit*           myGrp;
 };
 
index 8d7961412765ad02225d303a9b7aff54f7afb835..1aea50fa09698d2b87b62ff0442558bb82b5fc24 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -26,7 +26,6 @@
 //
 #include "MeasureGUI.h"
 #include "MeasureGUI_CheckCompoundOfBlocksDlg.h"
-#include "MeasureGUI_Widgets.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
@@ -43,6 +42,8 @@
 #include <GEOMBase.h>
 #include <GEOMImpl_Types.hxx>
 
+#include <QListWidget>
+
 #define TEXTEDIT_FONT_FAMILY "Courier"
 #define TEXTEDIT_FONT_SIZE 11
 
 //            true to construct a modal dialog.
 //=================================================================================
 MeasureGUI_CheckCompoundOfBlocksDlg::MeasureGUI_CheckCompoundOfBlocksDlg( GeometryGUI* GUI, QWidget* parent )
-  : GEOMBase_Skeleton( GUI, parent, false )
+  : GEOMBase_Skeleton(GUI, parent, false),
+    myObjectName     (0),
+    mySelButton      (0),
+    myUseC1Check     (0),
+    myTolLbl         (0),
+    mySpinTol        (0),
+    myTextView       (0),
+    myListBox1       (0),
+    myListBox2       (0)
 {
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
   QPixmap image0( aResMgr->loadPixmap( "GEOM", tr( "ICON_DLG_CHECK_COMPOUND_OF_BLOCKS" ) ) );
@@ -70,29 +79,55 @@ MeasureGUI_CheckCompoundOfBlocksDlg::MeasureGUI_CheckCompoundOfBlocksDlg( Geomet
   mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
   mainFrame()->RadioButton3->close();
 
-  myGrp = new MeasureGUI_1Sel1TextView2ListBox( centralWidget() );
-  myGrp->GroupBox1->setTitle( tr( "GEOM_CHECK_INFOS" ) );
-  myGrp->TextLabel1->setText( tr( "GEOM_OBJECT" ) );
-
-  myGrp->TextView1->setReadOnly( true );
-  QFont aFont( TEXTEDIT_FONT_FAMILY, TEXTEDIT_FONT_SIZE );
-  aFont.setStyleHint( QFont::TypeWriter, QFont::PreferAntialias );
-  myGrp->TextView1->setFont( aFont );
-
-  myGrp->PushButton1->setIcon( image1 );
-  myGrp->LineEdit1->setReadOnly( true );
-
-  myGrp->TextLabel2->setText( tr( "GEOM_CHECK_BLOCKS_COMPOUND_ERRORS" ) );
-  myGrp->TextLabel3->setText( tr( "GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES" ) );
-
-  myGrp->ListBox2->setSelectionMode( QAbstractItemView::ExtendedSelection );
+  QGroupBox   *aGrpParams    =
+    new QGroupBox(tr("GEOM_CHECK_INFOS"), centralWidget());
+  QGridLayout *aParamsLayout = new QGridLayout(aGrpParams);
+  QLabel      *anObjLbl      = new QLabel(tr("GEOM_OBJECT"), aGrpParams);
+  QLabel      *anErrorsLbl   =
+    new QLabel(tr("GEOM_CHECK_BLOCKS_COMPOUND_ERRORS"), aGrpParams);
+  QLabel      *aNonBlocksLbl =
+    new QLabel(tr("GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES"), aGrpParams);
+
+  myObjectName = new QLineEdit(aGrpParams);
+  mySelButton  = new QPushButton(aGrpParams);
+  myUseC1Check = new QCheckBox(tr("GEOM_USE_C1_CRITERION"), aGrpParams);
+  myTolLbl     = new QLabel(tr("GEOM_ANGULAR_TOLERANCE"), aGrpParams);
+  mySpinTol    = new SalomeApp_DoubleSpinBox(aGrpParams);
+  myTextView   = new QTextBrowser(aGrpParams);
+  myListBox1   = new QListWidget(aGrpParams);
+  myListBox2   = new QListWidget(aGrpParams);
+
+  myObjectName->setReadOnly(true);
+  mySelButton->setIcon(image1);
+  mySelButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+  myUseC1Check->setText(tr("GEOM_USE_C1_CRITERION"));
+  myUseC1Check->setChecked(true);
+  myTextView->setReadOnly(true);
+  myListBox2->setSelectionMode(QAbstractItemView::ExtendedSelection);
+
+  // Set text view font.
+  QFont aFont(TEXTEDIT_FONT_FAMILY, TEXTEDIT_FONT_SIZE);
+
+  aFont.setStyleHint(QFont::TypeWriter, QFont::PreferAntialias);
+  myTextView->setFont(aFont);
+
+  aParamsLayout->setMargin(9);
+  aParamsLayout->setSpacing(6);
+  aParamsLayout->addWidget(anObjLbl,      0, 0);
+  aParamsLayout->addWidget(mySelButton,   0, 1);
+  aParamsLayout->addWidget(myObjectName,  0, 2);
+  aParamsLayout->addWidget(myUseC1Check,  1, 0, 1, 3);
+  aParamsLayout->addWidget(myTolLbl,      2, 0);
+  aParamsLayout->addWidget(mySpinTol,     2, 1, 1, 2);
+  aParamsLayout->addWidget(myTextView,    3, 0, 1, 3);
+  aParamsLayout->addWidget(anErrorsLbl,   4, 0);
+  aParamsLayout->addWidget(myListBox1,    5, 0, 1, 2);
+  aParamsLayout->addWidget(aNonBlocksLbl, 4, 2);
+  aParamsLayout->addWidget(myListBox2,    5, 2);
 
   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
   layout->setMargin( 0 ); layout->setSpacing( 6 );
-  layout->addWidget( myGrp );
-
-  connect( myGrp->ListBox1, SIGNAL( itemSelectionChanged() ), SLOT( onErrorsListSelectionChanged() ) );
-  connect( myGrp->ListBox2, SIGNAL( itemSelectionChanged() ), SLOT( onSubShapesListSelectionChanged() ) );
+  layout->addWidget( aGrpParams );
 
   /***************************************************************/
 
@@ -116,14 +151,24 @@ MeasureGUI_CheckCompoundOfBlocksDlg::~MeasureGUI_CheckCompoundOfBlocksDlg()
 //=================================================================================
 void MeasureGUI_CheckCompoundOfBlocksDlg::Init()
 {
-  myEditCurrentArgument = myGrp->LineEdit1;
+  /* init variables */
+  double SpecificStep = 0.0001;
+  double aDefaultTol  = Precision::Angular();
+
+  initSpinBox(mySpinTol, aDefaultTol, MAX_NUMBER, SpecificStep, "ang_tol_precision");
+  mySpinTol->setValue(aDefaultTol);
+  myEditCurrentArgument = myObjectName;
 
   // signals and slots connections
   connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
   connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
 
-  connect( myGrp->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
-  connect( myGrp->PushButton1, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
+  connect(myObjectName, SIGNAL(returnPressed()),        this, SLOT(LineEditReturnPressed()));
+  connect(mySelButton,  SIGNAL(clicked()),              this, SLOT(SetEditCurrentArgument()));
+  connect(myListBox1,   SIGNAL(itemSelectionChanged()), this, SLOT(onErrorsListSelectionChanged()));
+  connect(myListBox2,   SIGNAL(itemSelectionChanged()), this, SLOT(onSubShapesListSelectionChanged()));
+  connect(myUseC1Check, SIGNAL(clicked()),              this, SLOT(SetUseC1Tolerance()));
+  connect(mySpinTol,    SIGNAL(valueChanged(double)),   this, SLOT(processObject()));
 
   connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
            this, SLOT( SelectionIntoArgument() ) );
@@ -172,7 +217,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SelectionIntoArgument()
   aSelMgr->selectedObjects(aSelList);
 
   if (aSelList.Extent() != 1) {
-    myGrp->LineEdit1->setText( "" );
+    myObjectName->setText( "" );
     processObject();
     return;
   }
@@ -181,13 +226,13 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SelectionIntoArgument()
     GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
 
   if ( aSelectedObject->_is_nil() ) {
-    myGrp->LineEdit1->setText( "" );
+    myObjectName->setText( "" );
     processObject();
     return;
   }
 
   myObj = aSelectedObject;
-  myGrp->LineEdit1->setText( GEOMBase::GetName( myObj ) );
+  myObjectName->setText( GEOMBase::GetName( myObj ) );
   processObject();
   DISPLAY_PREVIEW_MACRO;
 }
@@ -198,11 +243,22 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SelectionIntoArgument()
 //=================================================================================
 void MeasureGUI_CheckCompoundOfBlocksDlg::SetEditCurrentArgument()
 {
-  myGrp->LineEdit1->setFocus();
-  myEditCurrentArgument = myGrp->LineEdit1;
+  myObjectName->setFocus();
+  myEditCurrentArgument = myObjectName;
   SelectionIntoArgument();
 }
 
+//=================================================================================
+// function : SetUseC1Tolerance()
+// purpose  :
+//=================================================================================
+void MeasureGUI_CheckCompoundOfBlocksDlg::SetUseC1Tolerance()
+{
+  myTolLbl->setEnabled(myUseC1Check->isChecked());
+  mySpinTol->setEnabled(myUseC1Check->isChecked());
+  processObject();
+}
+
 //=================================================================================
 // function : LineEditReturnPressed()
 // purpose  :
@@ -210,8 +266,8 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::SetEditCurrentArgument()
 void MeasureGUI_CheckCompoundOfBlocksDlg::LineEditReturnPressed()
 {
   QLineEdit* send = (QLineEdit*)sender();
-  if ( send == myGrp->LineEdit1 ) {
-    myEditCurrentArgument = myGrp->LineEdit1;
+  if ( send == myObjectName ) {
+    myEditCurrentArgument = myObjectName;
     GEOMBase_Skeleton::LineEditReturnPressed();
   }
 }
@@ -245,7 +301,13 @@ bool MeasureGUI_CheckCompoundOfBlocksDlg::getBCErrors( bool& theIsCompoundOfBloc
     GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow( getOperation() );
     try {
       GEOM::GEOM_IBlocksOperations::BCErrors_var aErrs;
-      theIsCompoundOfBlocks = anOper->CheckCompoundOfBlocks( myObj, aErrs );
+      double aC1Tol = -1.;
+
+      if (myUseC1Check->isChecked()) {
+        aC1Tol = mySpinTol->value();
+      }
+
+      theIsCompoundOfBlocks = anOper->CheckCompoundOfBlocks( myObj, aC1Tol, aErrs );
       if (anOper->IsDone() && aErrs->length() > 0)
       //if (anOper->IsDone() && !aErrs._is_nil())
         theErrors = aErrs;
@@ -270,9 +332,9 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::processObject()
   GEOM::GEOM_IBlocksOperations::BCErrors aErrs;
   if ( !getBCErrors( isCompoundOfBlocks, aErrs ) ) {
     aMsg += tr( "GEOM_CHECK_BLOCKS_COMPOUND_FAILED" );
-    myGrp->TextView1->setText( aMsg );
-    myGrp->ListBox1->clear();
-    myGrp->ListBox2->clear();
+    myTextView->setText( aMsg );
+    myListBox1->clear();
+    myListBox2->clear();
     erasePreview();
     return;
   }
@@ -287,7 +349,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::processObject()
     buttonOk()->setEnabled( true );
     buttonApply()->setEnabled( true );
   }
-  myGrp->TextView1->setText( aMsg );
+  myTextView->setText( aMsg );
 
   QStringList aErrList;
   QString aErrStr( "" );
@@ -321,9 +383,9 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::processObject()
       aErrList.append( aErrStr );
   }
 
-  myGrp->ListBox1->clear();
-  myGrp->ListBox2->clear();
-  myGrp->ListBox1->addItems( aErrList );
+  myListBox1->clear();
+  myListBox2->clear();
+  myListBox1->addItems( aErrList );
 }
 
 //=================================================================================
@@ -342,19 +404,19 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_CheckCompoundOfBlocksDlg::createOperation(
 void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged()
 {
   erasePreview();
-  int aCurItem = myGrp->ListBox1->currentRow();
+  int aCurItem = myListBox1->currentRow();
   if ( aCurItem < 0 )
     return;
   bool isCompoundOfBlocks;
   GEOM::GEOM_IBlocksOperations::BCErrors aErrs;
   if ( !getBCErrors( isCompoundOfBlocks, aErrs ) ) {
-    myGrp->TextView1->setText( "" );
-    myGrp->ListBox1->clear();
-    myGrp->ListBox2->clear();
+    myTextView->setText( "" );
+    myListBox1->clear();
+    myListBox2->clear();
     return;
   }
 
-  myGrp->ListBox2->clear();
+  myListBox2->clear();
 
   if (aCurItem < aErrs.length()) {
     GEOM::GEOM_IBlocksOperations::BCError aErr = aErrs[aCurItem];
@@ -371,7 +433,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged()
           aSubShapeList.append( QString( "%1_%2" ).arg( aType ).arg( aObjLst[i] ) );
       }
     }
-    myGrp->ListBox2->addItems( aSubShapeList );
+    myListBox2->addItems( aSubShapeList );
   }
 }
 
@@ -382,12 +444,12 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onErrorsListSelectionChanged()
 void MeasureGUI_CheckCompoundOfBlocksDlg::onSubShapesListSelectionChanged()
 {
   erasePreview();
-  int aErrCurItem = myGrp->ListBox1->currentRow();
+  int aErrCurItem = myListBox1->currentRow();
   if ( aErrCurItem < 0 )
     return;
   QList<int> aIds;
-  for ( int i = 0, n = myGrp->ListBox2->count(); i < n; i++ ) {
-    if ( myGrp->ListBox2->item( i )->isSelected() )
+  for ( int i = 0, n = myListBox2->count(); i < n; i++ ) {
+    if ( myListBox2->item( i )->isSelected() )
       aIds.append( i );
   }
   if ( aIds.count() < 1 )
@@ -395,9 +457,9 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onSubShapesListSelectionChanged()
   bool isCompoundOfBlocks;
   GEOM::GEOM_IBlocksOperations::BCErrors aErrs;
   if ( !getBCErrors( isCompoundOfBlocks, aErrs ) ) {
-    myGrp->TextView1->setText( "" );
-    myGrp->ListBox1->clear();
-    myGrp->ListBox2->clear();
+    myTextView->setText( "" );
+    myListBox1->clear();
+    myListBox2->clear();
     return;
   }
 
@@ -417,7 +479,7 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onSubShapesListSelectionChanged()
     for ( it = aIds.begin(); it != aIds.end(); ++it ) {
       aSubShape = anIndices.FindKey(aObjLst[(*it)]);
       SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
-      int w = resMgr->integerValue("Geometry", "measures_line_width", 1);
+      int w = resMgr->integerValue("Geometry", "preview_edge_width", 1);
       try {
         getDisplayer()->SetColor( Quantity_NOC_RED );
         getDisplayer()->SetWidth( w );
@@ -433,6 +495,15 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::onSubShapesListSelectionChanged()
   }
 }
 
+//=================================================================================
+// function : onDisplayPreview
+// purpose  : 
+//=================================================================================
+void MeasureGUI_CheckCompoundOfBlocksDlg::onDisplayPreview()
+{
+  DISPLAY_PREVIEW_MACRO;
+}
+
 //=================================================================================
 // function : activateSelection
 // purpose  : activate selection of faces, shells, and solids
@@ -459,9 +530,9 @@ void MeasureGUI_CheckCompoundOfBlocksDlg::enterEvent( QEvent* )
 // function : isValid
 // purpose  :
 //=================================================================================
-bool MeasureGUI_CheckCompoundOfBlocksDlg::isValid( QString)
+bool MeasureGUI_CheckCompoundOfBlocksDlg::isValid( QString &msg)
 {
-  return !myObj->_is_nil();
+  return !myObj->_is_nil() && mySpinTol->isValid(msg, !IsPreview());
 }
 
 //=================================================================================
index e6a93c4f07e124f6144c766b43e4f5ff705687e9..d1229c43072c9ae2562116aabb9b683b1d08cb32 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <GEOMBase_Skeleton.h>
 
-class MeasureGUI_1Sel1TextView2ListBox;
+class QCheckBox;
+class QLabel;
+class QLineEdit;
+class QListWidget;
+class QPushButton;
+class QTextBrowser;
+class SalomeApp_DoubleSpinBox;
 
 //=================================================================================
 // class    : MeasureGUI_CheckCompoundOfBlocksDlg
@@ -47,7 +53,7 @@ public:
 protected:
   // redefined from GEOMBase_Helper and GEOMBase_Skeleton
   virtual GEOM::GEOM_IOperations_ptr  createOperation();
-  virtual bool                        isValid( QString& );
+  virtual bool                        isValid( QString &msg );
   virtual bool                        execute( ObjectList& );
   virtual void                        processObject();
 
@@ -61,6 +67,8 @@ private slots:
   
   void                                onErrorsListSelectionChanged();
   void                                onSubShapesListSelectionChanged();
+  void                                SetUseC1Tolerance();
+  void                                onDisplayPreview();
   
 private:
   void                                Init();
@@ -71,7 +79,14 @@ private:
 
 private:
   GEOM::GEOM_Object_var               myObj;
-  MeasureGUI_1Sel1TextView2ListBox*   myGrp;
+  QLineEdit                          *myObjectName;
+  QPushButton                        *mySelButton;
+  QCheckBox                          *myUseC1Check;
+  QLabel                             *myTolLbl;
+  SalomeApp_DoubleSpinBox            *mySpinTol;
+  QTextBrowser                       *myTextView;
+  QListWidget                        *myListBox1;
+  QListWidget                        *myListBox2;
 };
 
 #endif // MEASUREGUI_CHECKCOMPOUNDOFBLOCKSDLG_H
index de712233dab1132596b4028ef6e5cbbfa7d4d95e..27bebf1812220057758bd8ccd48a390de92e212f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 // File   : MeasureGUI_CheckSelfIntersectionsDlg.cxx
 
 #include "MeasureGUI_CheckSelfIntersectionsDlg.h"
-#include "MeasureGUI_Widgets.h"
+#include "MeasureGUI.h"
 
+#include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <LightApp_SelectionMgr.h>
 
 #include <TopTools_IndexedMapOfShape.hxx>
 #include <TopExp.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
 #include <TColStd_MapOfInteger.hxx>
 
 #include <DlgRef.h>
 #include <GeometryGUI.h>
 #include <GEOMBase.h>
 #include <GEOMImpl_Types.hxx>
+#include <GEOM_GenericObjPtr.h>
+
+#include <QListWidget>
 
 #define TEXTEDIT_FONT_FAMILY "Courier"
 #define TEXTEDIT_FONT_SIZE 11
 //            true to construct a modal dialog.
 //=================================================================================
 MeasureGUI_CheckSelfIntersectionsDlg::MeasureGUI_CheckSelfIntersectionsDlg (GeometryGUI* GUI, QWidget* parent)
-  : MeasureGUI_Skeleton(GUI, parent, false)
+  : GEOMBase_Skeleton (GUI, parent, false),
+    myTextView1       (0),
+    myTextView2       (0),
+    mySelButton1      (0),
+    mySelButton2      (0),
+    myEditObjName1    (0),
+    myEditObjName2    (0),
+    myLevelBox        (0),
+    myComputeButton1  (0),
+    myComputeButton2  (0),
+    myInteList1       (0),
+    myShapeList1      (0),
+    myInteList2       (0),
+    myShapeList2      (0),
+    myCurrConstrId    (-1)
 {
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
   QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_CHECK_SELF_INTERSECTIONS")));
   QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+  QPixmap image2 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FAST_CHECK_INTERSECTIONS")));
 
   setWindowTitle(tr("GEOM_CHECK_SELF_INTERSECTIONS"));
 
   /***************************************************************/
-  mainFrame()->GroupConstructors->setTitle(tr("GEOM_CHECK_SELF_INTERSECTIONS"));
+  mainFrame()->GroupConstructors->setTitle(tr("GEOM_CHECK_INTERSECT_TYPE"));
   mainFrame()->RadioButton1->setIcon(image0);
+  mainFrame()->RadioButton2->setIcon(image2);;
+  mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+  mainFrame()->RadioButton3->close();
 
-  myGrp = new MeasureGUI_1Sel1TextView2ListBox (centralWidget());
-  myGrp->GroupBox1->setTitle(tr("GEOM_CHECK_INFOS"));
-  myGrp->TextLabel1->setText(tr("GEOM_OBJECT"));
+  /***************************************************************/
+  /* SIMPLE SELF-INTERSECTION constructor
+  /***************************************************************/
+  mySimpleGrp             = new QGroupBox(tr("GEOM_CHECK_INFOS"));
+  QLabel    *anObjLbl    = new QLabel(tr("GEOM_OBJECT"));
+  QLabel    *anInteLbl   = new QLabel(tr("GEOM_CHECK_INTE_INTERSECTIONS"));
+  QLabel    *aShapeLbl   = new QLabel(tr("GEOM_CHECK_INTE_SUBSHAPES"));
+  QLabel    *aLevelLbl   = new QLabel(tr("GEOM_CHECK_INTE_CHECK_LEVEL"));
+  QLabel    *aSummaryLbl1 = new QLabel(tr("GEOM_CHECK_INTE_SUMMARY"));
+  QFont      aFont (TEXTEDIT_FONT_FAMILY, TEXTEDIT_FONT_SIZE);
 
-  myGrp->TextView1->setReadOnly(true);
-  QFont aFont (TEXTEDIT_FONT_FAMILY, TEXTEDIT_FONT_SIZE);
   aFont.setStyleHint(QFont::TypeWriter, QFont::PreferAntialias);
-  myGrp->TextView1->setFont(aFont);
+  myTextView1 = new QTextBrowser;
+  myTextView1->setReadOnly(true);
+  myTextView1->setFont(aFont);
+
+  mySelButton1 = new QPushButton;
+  mySelButton1->setIcon(image1);
+  mySelButton1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+
+  myEditObjName1 = new QLineEdit;
+  myEditObjName1->setReadOnly(true);
+
+  myLevelBox = new QComboBox;
+
+  myComputeButton1 = new QPushButton(tr("GEOM_CHECK_INTE_COMPUTE"));
 
-  myGrp->PushButton1->setIcon(image1);
-  myGrp->LineEdit1->setReadOnly(true);
 
-  myGrp->TextLabel2->setText(tr("GEOM_CHECK_BLOCKS_COMPOUND_ERRORS"));
-  myGrp->TextLabel3->setText(tr("GEOM_CHECK_BLOCKS_COMPOUND_SUBSHAPES"));
+  myInteList1  = new QListWidget;
+  myInteList1->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  myShapeList1 = new QListWidget;
+  myShapeList1->setSelectionMode(QAbstractItemView::ExtendedSelection);
 
-  myGrp->ListBox2->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  QGridLayout *aGrpLayout1 = new QGridLayout(mySimpleGrp);
 
-  QVBoxLayout* layout = new QVBoxLayout (centralWidget());
-  layout->setMargin(0); layout->setSpacing(6);
-  layout->addWidget(myGrp);
+  aGrpLayout1->setMargin(9);
+  aGrpLayout1->setSpacing(6);
+  aGrpLayout1->addWidget(anObjLbl,         0, 0);
+  aGrpLayout1->addWidget(mySelButton1,     0, 1);
+  aGrpLayout1->addWidget(myEditObjName1,   0, 2);
+  aGrpLayout1->addWidget(aLevelLbl,        1, 0);
+  aGrpLayout1->addWidget(myLevelBox,       1, 1, 1, 2);
+  aGrpLayout1->addWidget(myComputeButton1, 2, 0, 1, 3);
+  aGrpLayout1->addWidget(aSummaryLbl1,     3, 0);
+  aGrpLayout1->addWidget(myTextView1,      4, 0, 1, 3);
+  aGrpLayout1->addWidget(anInteLbl,        5, 0);
+  aGrpLayout1->addWidget(aShapeLbl,        5, 2);
+  aGrpLayout1->addWidget(myInteList1,      6, 0, 1, 2);
+  aGrpLayout1->addWidget(myShapeList1,     6, 2);
 
   /***************************************************************/
+  /* FAST SELF-INTERSECTION constructor
+  /***************************************************************/
+  
+  myFastGrp               = new QGroupBox(tr("GEOM_CHECK_INFOS"), centralWidget());
+  QLabel    *anObjLbl2    = new QLabel(tr("GEOM_OBJECT"), myFastGrp);
+  QLabel    *aDeflectLbl  = new QLabel(tr("GEOM_CHECK_INT_DEFLECT"), myFastGrp);
+  QLabel    *aSummaryLbl2 = new QLabel(tr("GEOM_CHECK_INTE_SUMMARY"));
+  QLabel    *anInteLbl2   = new QLabel(tr("GEOM_CHECK_INTE_INTERSECTIONS"), myFastGrp);
+  QLabel    *aShapeLbl2   = new QLabel(tr("GEOM_CHECK_INTE_SUBSHAPES"), myFastGrp);
+
+  mySelButton2 = new QPushButton(myFastGrp);
+  mySelButton2->setIcon(image1);
+  mySelButton2->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+
+  myEditObjName2 = new QLineEdit(myFastGrp);
+  myEditObjName2->setReadOnly(true);
+
+  myDeflection = new SalomeApp_DoubleSpinBox(myFastGrp);
+  myDetGaps = new QCheckBox(tr( "GEOM_CHECK_INT_DETECT_GAPS" ));
+  myTolerance = new SalomeApp_DoubleSpinBox(myFastGrp);
+
+  myComputeButton2 = new QPushButton(tr("GEOM_CHECK_INTE_COMPUTE"));
+
+  myTextView2 = new QTextBrowser;
+  myTextView2->setReadOnly(true);
+  myTextView2->setFont(aFont);
+
+  myInteList2  = new QListWidget(myFastGrp);
+  myInteList2->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  myShapeList2 = new QListWidget(myFastGrp);
+  myShapeList2->setSelectionMode(QAbstractItemView::ExtendedSelection);
+
+  QGridLayout *aGrpLayout2 = new QGridLayout(myFastGrp);
+  aGrpLayout2->setMargin(9);
+  aGrpLayout2->setSpacing(6);
+  aGrpLayout2->addWidget(anObjLbl2,        0, 0);
+  aGrpLayout2->addWidget(mySelButton2,     0, 1);
+  aGrpLayout2->addWidget(myEditObjName2,   0, 2);
+  aGrpLayout2->addWidget(aDeflectLbl,      1, 0);
+  aGrpLayout2->addWidget(myDeflection,     1, 1, 1, 2);
+  aGrpLayout2->addWidget(myDetGaps,        2, 0);
+  aGrpLayout2->addWidget(myTolerance,      2, 1, 1, 2);
+  aGrpLayout2->addWidget(myComputeButton2, 3, 0, 1, 3);
+  aGrpLayout2->addWidget(aSummaryLbl2,     4, 0);
+  aGrpLayout2->addWidget(myTextView2,      5, 0, 1, 3);
+  aGrpLayout2->addWidget(anInteLbl2,       6, 0);
+  aGrpLayout2->addWidget(aShapeLbl2,       6, 1, 1, 2);
+  aGrpLayout2->addWidget(myInteList2,      7, 0);
+  aGrpLayout2->addWidget(myShapeList2,     7, 1, 1, 2);
+  
+  /***************************************************************/
+
+  QVBoxLayout* layout2 = new QVBoxLayout (centralWidget());
+  layout2->setMargin(0); layout2->setSpacing(6);
+  layout2->addWidget(mySimpleGrp);
+  layout2->addWidget(myFastGrp);
+
+ /***************************************************************/
 
   myHelpFileName = "check_self_intersections_page.html";
 
@@ -107,111 +218,429 @@ MeasureGUI_CheckSelfIntersectionsDlg::~MeasureGUI_CheckSelfIntersectionsDlg()
 //=================================================================================
 void MeasureGUI_CheckSelfIntersectionsDlg::Init()
 {
-  mySelBtn = myGrp->PushButton1;
-  mySelEdit = myGrp->LineEdit1;
-  MeasureGUI_Skeleton::Init();
+  // Fill in the combo box.
+  myLevelBox->insertItem(GEOM::SI_V_V, tr("GEOM_CHECK_INTE_V_V"));
+  myLevelBox->insertItem(GEOM::SI_V_E, tr("GEOM_CHECK_INTE_V_E"));
+  myLevelBox->insertItem(GEOM::SI_E_E, tr("GEOM_CHECK_INTE_E_E"));
+  myLevelBox->insertItem(GEOM::SI_V_F, tr("GEOM_CHECK_INTE_V_F"));
+  myLevelBox->insertItem(GEOM::SI_E_F, tr("GEOM_CHECK_INTE_E_F"));
+  myLevelBox->insertItem(GEOM::SI_ALL, tr("GEOM_CHECK_INTE_ALL"));
+  myLevelBox->setCurrentIndex(GEOM::SI_ALL);
+  myComputeButton1->setEnabled(false);
+
+  connect(mySelButton1,        SIGNAL(clicked()),
+          this,               SLOT(SetEditCurrentArgument()));
+  connect(myInteList1,         SIGNAL(itemSelectionChanged()),
+          SLOT(onInteListSelectionChanged()));
+  connect(myShapeList1,        SIGNAL(itemSelectionChanged()),
+          SLOT(onSubShapesListSelectionChanged()));
+  connect(myLevelBox,         SIGNAL(currentIndexChanged(int)),
+          this,               SLOT(clear()));
+  connect(myComputeButton1,    SIGNAL(clicked()), this, SLOT(onCompute()));
 
-  connect(myGrp->ListBox1, SIGNAL(itemSelectionChanged()), SLOT(onErrorsListSelectionChanged()));
-  connect(myGrp->ListBox2, SIGNAL(itemSelectionChanged()), SLOT(onSubShapesListSelectionChanged()));
+  /***************************************************************/
+  myObj2.nullify();
+  myEditObjName2->setText("");
+  myEditObjName2->setEnabled(true);
+
+  myDetGaps->setChecked(false);
+  initSpinBox(myTolerance, 0, MAX_NUMBER, 1);
+  myTolerance->setValue(0);
+  myTolerance->setEnabled(false);
+  myComputeButton2->setEnabled(false);
+
+  // Obtain deflection from preferences
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  initSpinBox(myDeflection, 1e-3, 1.0, 1e-3);
+  myDeflection->setValue(qMax(1e-3, resMgr->doubleValue("Geometry", "deflection_coeff", 1e-3)));
+
+  connect( mySelButton2,       SIGNAL(clicked()),
+          this,               SLOT(SetEditCurrentArgument()));
+  connect( myDetGaps,          SIGNAL(toggled(bool)), this, SLOT(OnGaps(bool))); 
+  connect( myTolerance,       SIGNAL(valueChanged(double)), this, SLOT(clear()));
+  connect( myDeflection,      SIGNAL(valueChanged(double)), this, SLOT(clear()));
+  connect( myInteList2,         SIGNAL(itemSelectionChanged()),
+          SLOT(onInteListSelectionChanged()));
+  connect( myShapeList2,       SIGNAL(itemSelectionChanged()),
+          SLOT(onSubShapesListSelectionChanged()));
+  connect( myComputeButton2,    SIGNAL(clicked()), this, SLOT(onCompute()));
+
+  /***************************************************************/
+
+  connect(this,               SIGNAL(constructorsClicked(int)), 
+         this,               SLOT(ConstructorsClicked(int)));
+  connect(myGeomGUI,          SIGNAL(SignalDeactivateActiveDialog()),
+          this,               SLOT(DeactivateActiveDialog()));
+  connect(myGeomGUI,          SIGNAL(SignalCloseAllDialogs()),
+          this,               SLOT(ClickOnCancel()));
+  connect(buttonOk(),         SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+  connect(buttonApply(),      SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+  LightApp_SelectionMgr* aSel = myGeomGUI->getApp()->selectionMgr();
+  connect(aSel,               SIGNAL(currentSelectionChanged()),
+          this,               SLOT(SelectionIntoArgument()));
+
+  initName( tr( "GEOM_SELF_INTERSECTION_NAME") );
+  buttonOk()->setEnabled(false);
+  buttonApply()->setEnabled(false);
+
+  ConstructorsClicked(0);
+
+  activateSelection();
+  SelectionIntoArgument();
 }
 
 //=================================================================================
-// function : processObject
+// function : clear
 // purpose  :
 //=================================================================================
-void MeasureGUI_CheckSelfIntersectionsDlg::processObject()
+void MeasureGUI_CheckSelfIntersectionsDlg::clear()
 {
-  myGrp->ListBox1->clear();
-  myGrp->ListBox2->clear();
+  getTextView()->setText("");
+  getComputeButton()->setEnabled(true);
+
+  getInteList()->blockSignals(true);
+  getShapeList()->blockSignals(true);
+  getInteList()->clear();
+  getShapeList()->clear();
+  getInteList()->blockSignals(false);
+  getShapeList()->blockSignals(false);
+
   erasePreview();
+  buttonOk()->setEnabled(false);
+  buttonApply()->setEnabled(false);
+}
 
-  if (myObj->_is_nil())
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose  : Radio button management
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::ConstructorsClicked(int constructorId)
+{
+  if (myCurrConstrId == constructorId)
     return;
 
-  QString aMsg ("");
-  GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
-  bool isGood = false, isFailed = false;
-  int nbPairs = 0;
-  try {
-    isGood = anOper->CheckSelfIntersections(myObj, myInters);
-    nbPairs = myInters->length()/2;
-    if (nbPairs*2 != myInters->length()) {
-      isFailed = true;
-    }
-  }
-  catch (const SALOME::SALOME_Exception& e) {
-    SalomeApp_Tools::QtCatchCorbaException(e);
-    isFailed = true;
+  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+
+  switch (constructorId) {
+  case 0:
+    mySimpleGrp->show();
+    myFastGrp->hide();
+    break;
+  case 1:
+    mySimpleGrp->hide();
+    myFastGrp->show();
+    break;
   }
 
-  if (!anOper->IsDone() && myInters->length() == 0) {
-    aMsg += tr(anOper->GetErrorCode());
-    myGrp->TextView1->setText(aMsg);
-    return;
-  }
-  else if (isFailed) {
-    aMsg += tr("GEOM_CHECK_SELF_INTERSECTIONS_FAILED");
-    myGrp->TextView1->setText(aMsg);
+  myCurrConstrId = constructorId;
+
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+           this, SLOT(SelectionIntoArgument()));
+
+  qApp->processEvents();
+  updateGeometry();
+  resize(minimumSizeHint());
+
+  processPreview();
+  //updateButtonState();
+  activateSelection();
+  SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : onCompute
+// purpose  :
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::onCompute()
+{
+  bool    hasSelfInte = false;
+  QString anErrMsg("");
+
+  if (!findSelfIntersections(hasSelfInte, anErrMsg)) {
+    getTextView()->setText(anErrMsg);
     return;
   }
 
-  // Status
-  if (isGood) {
-    aMsg += tr("GEOM_NO_SELF_INTERSECTIONS");
-  }
-  else {
+  // Status and apply buttons
+  QString aMsg("");
+
+  if (hasSelfInte) {
     aMsg += tr("GEOM_SELF_INTERSECTIONS_FOUND");
+    buttonOk()->setEnabled(true);
+    buttonApply()->setEnabled(true);
+  } else {
+    aMsg += tr("GEOM_NO_SELF_INTERSECTIONS");
   }
 
-  if (!anOper->IsDone()) {
+  if (!anErrMsg.isEmpty()) {
     aMsg += "\n\n";
-    aMsg += tr("GEOM_CHECK_SELF_INTERSECTIONS_ERRORS");
+    aMsg += anErrMsg;
   }
 
-  myGrp->TextView1->setText(aMsg);
+  getTextView()->setText(aMsg);
 
   // Pairs
-  QStringList aErrList;
-  QString aErrStr ("");
+  QStringList anInteList;
+  QString anInteStr ("");
+  int nbPairs = getInters()->length()/2;
+
   for (int i = 1; i <= nbPairs; i++) {
-    aErrStr = "Intersection # ";
-    aErrStr += QString::number(i);
-    aErrList.append(aErrStr);
+    anInteStr = "Intersection # ";
+    anInteStr += QString::number(i);
+    anInteList.append(anInteStr);
   }
 
-  myGrp->ListBox1->addItems(aErrList);
+  getInteList()->addItems(anInteList);
+  getComputeButton()->setEnabled(false);
 }
 
 //=================================================================================
-// function : onErrorsListSelectionChanged
+// function : ActivateThisDialog
 // purpose  :
 //=================================================================================
-void MeasureGUI_CheckSelfIntersectionsDlg::onErrorsListSelectionChanged()
+void MeasureGUI_CheckSelfIntersectionsDlg::ActivateThisDialog()
 {
-  erasePreview();
-  int aCurItem = myGrp->ListBox1->currentRow();
-  if (aCurItem < 0)
-    return;
+  GEOMBase_Skeleton::ActivateThisDialog();
+
+  LightApp_SelectionMgr* aSel = myGeomGUI->getApp()->selectionMgr();
+  if ( aSel )
+    connect( aSel, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
 
-  //int nbPairs = myInters->length()/2;
+  activateSelection();
+  DISPLAY_PREVIEW_MACRO
+}
+
+//=================================================================================
+// function : DeactivateActiveDialog()
+// purpose  : public slot to deactivate if active
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::DeactivateActiveDialog()
+{
+  GEOMBase_Skeleton::DeactivateActiveDialog();
+}
+
+//=================================================================================
+// function : activateSelection
+// purpose  : 
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::activateSelection()
+{
+  switch (getConstructorId()) {
+  case 0:
+    globalSelection(GEOM_ALLSHAPES);
+    break;
+  case 1:
+    TColStd_MapOfInteger aTypes;
+    aTypes.Add(GEOM_COMPOUND );
+    aTypes.Add(GEOM_SOLID );
+    aTypes.Add(GEOM_SHELL);
+    aTypes.Add(GEOM_FACE);
+    globalSelection(aTypes);
+
+    std::list<int> needTypes;
+    needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
+    localSelection( needTypes );
+    break;
+  }
+}
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose  :
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::ClickOnOk()
+{
+  if ( ClickOnApply() )
+    ClickOnCancel();
+}
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose  :
+//=================================================================================
+bool MeasureGUI_CheckSelfIntersectionsDlg::ClickOnApply()
+{
+  if ( !onAccept() )
+    return false;
+
+  clear();
+  initName();
+
+  ConstructorsClicked(getConstructorId());
+
+  return true;
+}
+
+//=================================================================================
+// function : extractPrefix
+// purpose  :
+//=================================================================================
+bool MeasureGUI_CheckSelfIntersectionsDlg::extractPrefix() const
+{
+  return true;
+}
+
+//=================================================================================
+// function : createOperation
+// purpose  :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr MeasureGUI_CheckSelfIntersectionsDlg::createOperation()
+{
+  return getGeomEngine()->GetIMeasureOperations( getStudyId() );
+}
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool MeasureGUI_CheckSelfIntersectionsDlg::isValid( QString& )
+{
+  return !getObj().isNull();
+}
+
+//=================================================================================
+// function : SetEditCurrentArgument
+// purpose  :
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::SetEditCurrentArgument()
+{
+  getEditObjName()->setFocus();
+  SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : OnGaps()
+// purpose  :
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::OnGaps(bool checked)
+{
+  clear();
+  myTolerance->setEnabled(checked);
+}
+//=================================================================================
+// function : SelectionIntoArgument
+// purpose  :
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::SelectionIntoArgument()
+{
+  QList<TopAbs_ShapeEnum> typesLst;
+
+  if ( getConstructorId() == 0 ) {
+    typesLst << TopAbs_COMPOUND
+            << TopAbs_COMPSOLID
+            << TopAbs_SOLID
+            << TopAbs_SHELL
+            << TopAbs_FACE
+            << TopAbs_WIRE
+            << TopAbs_EDGE
+            << TopAbs_VERTEX
+            << TopAbs_SHAPE;
+  } else {
+    typesLst << TopAbs_FACE
+            << TopAbs_SHELL
+            << TopAbs_SOLID
+            << TopAbs_COMPOUND;
+  }
+
+  // Clear the dialog.
+  clear();
+
+  GEOM::GeomObjPtr aSelectedObject = getSelected( typesLst );
+
+  (getConstructorId() == 0 ? myObj1 :myObj2) = aSelectedObject;
+  getEditObjName()->setText(getObj() ? GEOMBase::GetName(getObj().get()) : "");
+}
+
+//=================================================================================
+// function : enterEvent
+// purpose  :
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::enterEvent(QEvent *)
+{
+  if ( !mainFrame()->GroupConstructors->isEnabled() )
+    ActivateThisDialog();
+}
+
+//=================================================================================
+// function : findSelfIntersections
+// purpose  :
+//=================================================================================
+bool MeasureGUI_CheckSelfIntersectionsDlg::findSelfIntersections
+        (bool &HasSelfInte, QString &theErrMsg)
+{
+  if (getObj()->_is_nil()) {
+    return false;
+  }
+
+  GEOM::GEOM_IMeasureOperations_var anOper =
+    GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
+  bool isOK = true;
+  int  nbPairs  = 0;
+  int aLevel = myLevelBox->currentIndex();
+
+  SUIT_OverrideCursor wc;
+
+  try {
+    if ( getConstructorId() == 0 ) {
+      HasSelfInte = !anOper->CheckSelfIntersections(myObj1.get(), aLevel, myInters1);
+    } else {
+      HasSelfInte = !anOper->CheckSelfIntersectionsFast(myObj2.get(), getDeflection(), getTolerance(), myInters2);
+    }
+    nbPairs = getInters()->length()/2;
+
+    if (nbPairs*2 != getInters()->length()) {
+      isOK = false;
+    }
+  }
+  catch (const SALOME::SALOME_Exception& e) {
+    SalomeApp_Tools::QtCatchCorbaException(e);
+    isOK = false;
+  }
+
+  if (!anOper->IsDone()) {
+    if (getInters()->length() == 0) {
+      theErrMsg = tr(anOper->GetErrorCode());
+      isOK = false;
+    } else {
+      // Valid case. Display all computed self-intersections
+      theErrMsg = tr("GEOM_CHECK_SELF_INTERSECTIONS_ERRORS");
+    }
+  } else if (!isOK) {
+    theErrMsg = tr("GEOM_CHECK_SELF_INTERSECTIONS_FAILED");
+  }
+
+  return isOK;
+}
+
+//=================================================================================
+// function : onInteListSelectionChanged
+// purpose  :
+//=================================================================================
+void MeasureGUI_CheckSelfIntersectionsDlg::onInteListSelectionChanged()
+{
+  erasePreview();
+  getShapeList()->clear();
 
-  QStringList aSubShapeList;
   TopoDS_Shape aSelShape;
-  if (!myObj->_is_nil() && GEOMBase::GetShape(myObj, aSelShape)) {
+  if (!getObj()->_is_nil() && GEOMBase::GetShape(getObj().get(), aSelShape)) {
     TopTools_IndexedMapOfShape anIndices;
     TopExp::MapShapes(aSelShape, anIndices);
 
-    TopoDS_Shape aSubShape = anIndices.FindKey(myInters[aCurItem*2]);
-    QString aType = GEOMBase::GetShapeTypeString(aSubShape);
-    if (!aType.isEmpty())
-      aSubShapeList.append(QString("%1_%2").arg(aType).arg(myInters[aCurItem*2]));
-    aSubShape = anIndices.FindKey(myInters[aCurItem*2 + 1]);
-    aType = GEOMBase::GetShapeTypeString(aSubShape);
-    if (!aType.isEmpty())
-      aSubShapeList.append(QString("%1_%2").arg(aType).arg(myInters[aCurItem*2 + 1]));
+    int nbSelected = getInteList()->selectedItems().size();
+
+    for (int i = 0; i < getInteList()->count(); i++) {
+      if ( getInteList()->item(i)->isSelected() ) {
+        if ( nbSelected > 1 )
+          getShapeList()->addItem(QString("--- #%1 ---").arg(i+1));
+        for (int j = 0; j < 2; j++) {
+          TopoDS_Shape aSubShape = anIndices.FindKey(getInters()[i*2+j]);
+          QString aType = GEOMBase::GetShapeTypeString(aSubShape);
+          getShapeList()->addItem(QString("%1_%2").arg(aType).arg(getInters()[i*2+j]));
+          getShapeList()->item(getShapeList()->count()-1)->setData(Qt::UserRole, getInters()[i*2+j]);
+        }
+      }
+    }
   }
-  myGrp->ListBox2->clear();
-  myGrp->ListBox2->addItems(aSubShapeList);
 }
 
 //=================================================================================
@@ -222,40 +651,166 @@ void MeasureGUI_CheckSelfIntersectionsDlg::onSubShapesListSelectionChanged()
 {
   erasePreview();
 
-  // Current pair
-  int aErrCurItem = myGrp->ListBox1->currentRow();
-  if (aErrCurItem < 0)
-    return;
-
   // Selected IDs
+  QList<QListWidgetItem*> selected = getShapeList()->selectedItems();
   QList<int> aIds;
-  for (int i = 0, n = myGrp->ListBox2->count(); i < n; i++) {
-    if (myGrp->ListBox2->item(i)->isSelected())
-      aIds.append(i);
+  foreach(QListWidgetItem* item, selected) {
+    int idx = item->data(Qt::UserRole).toInt();
+    if (idx > 0 && aIds.indexOf(idx) < 0) aIds.append(idx);
   }
-  if (aIds.count() < 1)
-    return;
+
+  if (aIds.empty()) return;
 
   TopoDS_Shape aSelShape;
   TopoDS_Shape aSubShape;
   TopTools_IndexedMapOfShape anIndices;
-  if (!myObj->_is_nil() && GEOMBase::GetShape(myObj, aSelShape)) {
-    SALOME_Prs* aPrs = 0;
+  if (!getObj()->_is_nil() && GEOMBase::GetShape(getObj().get(), aSelShape)) {
     TopExp::MapShapes(aSelShape, anIndices);
-    QList<int>::iterator it;
-    for (it = aIds.begin(); it != aIds.end(); ++it) {
-      aSubShape = anIndices.FindKey(myInters[aErrCurItem*2 + (*it)]);
+    getDisplayer()->SetColor(Quantity_NOC_RED);
+    getDisplayer()->SetWidth(3);
+    getDisplayer()->SetToActivate(false);
+    foreach(int idx, aIds) {
+      aSubShape = anIndices.FindKey(idx);
       try {
-        getDisplayer()->SetColor(Quantity_NOC_RED);
-        getDisplayer()->SetWidth(3);
-        getDisplayer()->SetToActivate(false);
-        aPrs = !aSubShape.IsNull() ? getDisplayer()->BuildPrs(aSubShape) : 0;
-        if (aPrs)
-          displayPreview(aPrs, true);
+       SALOME_Prs* aPrs = !aSubShape.IsNull() ? getDisplayer()->BuildPrs(aSubShape) : 0;
+       if (aPrs) displayPreview(aPrs, true);
       }
       catch (const SALOME::SALOME_Exception& e) {
-        SalomeApp_Tools::QtCatchCorbaException(e);
+       SalomeApp_Tools::QtCatchCorbaException(e);
       }
     }
   }
 }
+
+//=================================================================================
+// function : execute
+// purpose  :
+//=================================================================================
+bool MeasureGUI_CheckSelfIntersectionsDlg::execute(ObjectList& objects)
+{
+  bool hasSelfInte;
+  QString anErrMsg;
+
+  if (!findSelfIntersections(hasSelfInte, anErrMsg)) {
+    return false;
+  }
+
+  TColStd_IndexedMapOfInteger aMapIndex;
+  QList<int> pairs;
+
+  int nbSelected = getInteList()->selectedItems().size();
+
+  // Collect the map of indices
+  for (int i = 0; i < getInteList()->count(); i++) {
+    if ( nbSelected < 1 || getInteList()->item(i)->isSelected() ) {
+      aMapIndex.Add(getInters()[i*2]);
+      aMapIndex.Add(getInters()[i*2 + 1]);
+      pairs << getInters()[i*2];
+      pairs << getInters()[i*2 + 1];
+    }
+  }
+
+  GEOM::ShapesOpPtr shapesOper = getGeomEngine()->GetIShapesOperations(getStudyId());
+  
+  // Explode sub-shapes
+  GEOM::ListOfLong_var anArray   = new GEOM::ListOfLong;
+  anArray->length(aMapIndex.Extent());
+
+  for (int i = 1; i <= aMapIndex.Extent(); i++)
+    anArray[i-1] = aMapIndex.FindKey(i);
+
+  GEOM::ListOfGO_var aList = shapesOper->MakeSubShapes(getObj().get(), anArray);
+
+  // Make compounds
+  for (int i = 0; i < pairs.count()/2; i++) {
+    GEOM::ListOfGO_var aPair = new GEOM::ListOfGO();
+    aPair->length(2);
+    aPair[0] = aList[ aMapIndex.FindIndex(pairs[i*2]) - 1 ];
+    aPair[1] = aList[ aMapIndex.FindIndex(pairs[i*2+1]) - 1 ];
+    GEOM::GEOM_Object_var aCompound = shapesOper->MakeCompound( aPair );
+    objects.push_back(aCompound._retn());
+  }
+
+  return true;
+}
+
+//=================================================================================
+// function : getDeflection
+// purpose  :
+//=================================================================================
+float MeasureGUI_CheckSelfIntersectionsDlg::getDeflection()
+{
+  return (float)myDeflection->value();
+}
+
+//=================================================================================
+// function : getTolerance
+// purpose  :
+//=================================================================================
+double MeasureGUI_CheckSelfIntersectionsDlg::getTolerance()
+{
+  double aVal = myTolerance->value();
+  if (!myDetGaps->isChecked() || aVal < 0.0)
+    return 0.0;
+  return aVal;
+}
+
+//================================================================
+// Function : getFather
+// Purpose  : Get father object for object to be added in study
+//            (called with addInStudy method)
+//================================================================
+GEOM::GEOM_Object_ptr MeasureGUI_CheckSelfIntersectionsDlg::getFather
+                  (GEOM::GEOM_Object_ptr)
+{
+  return getObj().get();
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> MeasureGUI_CheckSelfIntersectionsDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << getObj();
+  return res;
+}
+
+//=================================================================================
+// GETTERS
+//=================================================================================
+QTextBrowser* MeasureGUI_CheckSelfIntersectionsDlg::getTextView()
+{
+  return ( getConstructorId() == 0 ? myTextView1 : myTextView2 );
+}
+
+QListWidget* MeasureGUI_CheckSelfIntersectionsDlg::getInteList()
+{
+  return ( getConstructorId() == 0 ? myInteList1 : myInteList2 );
+}
+
+QListWidget* MeasureGUI_CheckSelfIntersectionsDlg::getShapeList()
+{
+  return ( getConstructorId() == 0 ? myShapeList1 : myShapeList2 );
+}
+
+QPushButton* MeasureGUI_CheckSelfIntersectionsDlg::getComputeButton()
+{
+  return ( getConstructorId() == 0 ? myComputeButton1 : myComputeButton2 );
+}
+
+QLineEdit* MeasureGUI_CheckSelfIntersectionsDlg::getEditObjName()
+{
+  return ( getConstructorId() == 0 ? myEditObjName1 : myEditObjName2 );
+}
+
+GEOM::GeomObjPtr MeasureGUI_CheckSelfIntersectionsDlg::getObj()
+{
+  return ( getConstructorId() == 0 ? myObj1 : myObj2 );
+}
+
+GEOM::ListOfLong_var MeasureGUI_CheckSelfIntersectionsDlg::getInters()
+{
+  return ( getConstructorId() == 0 ? myInters1 : myInters2 );
+}
index e22346439ebb437bfb700d460ba1ac84fb34428f..ac0f2d935d962d5f11a3a28010de29c70c4d283f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #ifndef MEASUREGUI_CHECKSELFINTERDLG_H
 #define MEASUREGUI_CHECKSELFINTERDLG_H
 
-#include <MeasureGUI_Skeleton.h>
+#include <GEOMBase_Skeleton.h>
+
+class QComboBox;
+class QListWidget;
+class QTextBrowser;
 
-class MeasureGUI_1Sel1TextView2ListBox;
 
 //=================================================================================
 // class    : MeasureGUI_CheckSelfIntersectionsDlg
 // purpose  :
 //=================================================================================
 
-class MeasureGUI_CheckSelfIntersectionsDlg : public MeasureGUI_Skeleton
+class MeasureGUI_CheckSelfIntersectionsDlg : public GEOMBase_Skeleton
 {
   Q_OBJECT
 
 public:
+
   MeasureGUI_CheckSelfIntersectionsDlg(GeometryGUI*, QWidget*);
   ~MeasureGUI_CheckSelfIntersectionsDlg();
 
 protected:
-  // redefined from GEOMBase_Helper and MeasureGUI_Skeleton
-  virtual void                        processObject();
+  // redefined from GEOMBase_Helper
+  virtual GEOM::GEOM_IOperations_ptr  createOperation();
+  virtual bool                        isValid(QString &);
+  virtual bool                        execute(ObjectList &);
+  virtual bool                        extractPrefix() const;
+  virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
 private slots:
-  void                                onErrorsListSelectionChanged();
+
+  void                                onInteListSelectionChanged();
   void                                onSubShapesListSelectionChanged();
+  void                                clear();
+  void                                onCompute();
+  void                                ClickOnOk();
+  bool                                ClickOnApply();
+  void                                ActivateThisDialog();
+  void                                DeactivateActiveDialog();
+  void                                SelectionIntoArgument();
+  void                                SetEditCurrentArgument();
+  void                                ConstructorsClicked (int);
+  void                                OnGaps(bool);
+
 
 private:
+
   void                                Init();
+  void                                activateSelection();
+  void                                enterEvent(QEvent *);
+  bool                                findSelfIntersections
+                                                    (bool    &HasSelfInte,
+                                                     QString &theErrMsg);
+  float                               getDeflection();
+  double                              getTolerance();
+  
+// Getters
+  QTextBrowser*                       getTextView();
+  QListWidget*                        getInteList();
+  QListWidget*                        getShapeList();
+  QPushButton*                        getComputeButton();
+  QLineEdit*                          getEditObjName();
+  GEOM::GeomObjPtr                    getObj();
+  GEOM::ListOfLong_var                getInters();
 
-private:
-  MeasureGUI_1Sel1TextView2ListBox*   myGrp;
 
-  GEOM::ListOfLong_var                myInters;
+private:
+  int                                 myCurrConstrId;
+  // simple
+  QPushButton                        *myComputeButton1;
+  QGroupBox                          *mySimpleGrp;
+  QTextBrowser                       *myTextView1;
+  QPushButton                        *mySelButton1;
+  QLineEdit                          *myEditObjName1;
+  QComboBox                          *myLevelBox;
+  QListWidget                        *myInteList1;
+  QListWidget                        *myShapeList1;
+  GEOM::GeomObjPtr                    myObj1;
+  GEOM::ListOfLong_var                myInters1;
+  // fast
+  QPushButton                        *myComputeButton2;
+  QGroupBox                          *myFastGrp;
+  QTextBrowser                       *myTextView2;
+  QPushButton                        *mySelButton2;
+  QLineEdit                          *myEditObjName2;
+  QCheckBox                          *myDetGaps;
+  SalomeApp_DoubleSpinBox            *myTolerance;
+  SalomeApp_DoubleSpinBox            *myDeflection;
+  QListWidget                        *myInteList2;
+  QListWidget                        *myShapeList2;
+  GEOM::GeomObjPtr                    myObj2;
+  GEOM::ListOfLong_var                myInters2;
+  GEOM::GEOM_IShapesOperations_var    myShapesOper;
 };
 
 #endif // MEASUREGUI_CHECKSELFINTERDLG_H
index 3a4394d63635bd9f42308a3b8cdcdc56cfcb913e..115b58d9a00eb3d5cb96ac824e832a1e1b2719fc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index a2ace0ae2a97417422642b7b3e65a5b45e2e9aad..2af96da0f2ea2c587564f8b5b8ae778445e770b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 13796c0ca4c172260b0f93f32a41162666a5e3bb..45ef0135f56583e60dd216e26ed812e43a135322 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -495,12 +495,13 @@ Handle(AIS_Dimension) MeasureGUI_CreateDimensionDlg::CreateDimension()
 
   QColor  aQColor       = aResMgr->colorValue  ( "Geometry", "dimensions_color", QColor( 0, 255, 0 ) );
   int     aLineWidth    = aResMgr->integerValue( "Geometry", "dimensions_line_width", 1 );
-  double  aFontHeight   = aResMgr->doubleValue ( "Geometry", "dimensions_font_height", 10 );
+  QFont   aFont         = aResMgr->fontValue   ( "Geometry", "dimensions_font", QFont("Y14.5M-2009", 14) );
   double  anArrowLength = aResMgr->doubleValue ( "Geometry", "dimensions_arrow_length", 5 );
   double  aDefFlyout    = aResMgr->doubleValue ( "Geometry", "dimensions_default_flyout", 20 );
   bool    isUnitsShown  = aResMgr->booleanValue( "Geometry", "dimensions_show_units", false );
   QString aUnitsLength  = aResMgr->stringValue ( "Geometry", "dimensions_length_units", "m" );
   QString aUnitsAngle   = aResMgr->stringValue ( "Geometry", "dimensions_angle_units", "deg" );
+  bool    aUseText3d    = aResMgr->booleanValue( "Geometry", "dimensions_use_text3d", false );
 
   OCCViewer_ViewWindow* anActiveView = NULL;
 
@@ -610,10 +611,12 @@ Handle(AIS_Dimension) MeasureGUI_CreateDimensionDlg::CreateDimension()
 
   aStyle->SetCommonColor( aColor );
   aStyle->MakeUnitsDisplayed( (Standard_Boolean) isUnitsShown );
-  aStyle->MakeText3d( Standard_True );
+  aStyle->MakeText3d( aUseText3d );
   aStyle->MakeTextShaded( Standard_True );
-  aStyle->SetExtensionSize( aFontHeight * 0.5 );
-  aStyle->TextAspect()->SetHeight( aFontHeight );
+  int fsize = aFont.pixelSize() != -1 ? aFont.pixelSize() : aFont.pointSize();
+  aStyle->SetExtensionSize( fsize * 0.5 );
+  aStyle->TextAspect()->SetFont( aFont.family().toLatin1().data() );
+  aStyle->TextAspect()->SetHeight( fsize );
   aStyle->ArrowAspect()->SetLength( anArrowLength );
   aStyle->LineAspect()->SetWidth( aLineWidth );
 
index 02e7cd9a65135a98ea9114f3ff3cb40e6947d22a..b982ec2c68cb3255e27183bc659972175b256f36 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index b571b61c776f726e4a190372c7033a7e01ebee3f..b4552d20aa1545f8f6be936a55103660588b45d1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 860713aed50f6224f2b12fbf3f34e5cf87dbad52..2ef1a241d3b3288b19cef6489ab8903bf3fcf6df 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index c9ccc5c62fb7bd5fbe61e92c85fcd264c7986f80..0a4b4911459f08a59cc9957f3bdd1174ae8cb7a1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 7d3902a23075deb92e18e3adf7b0b754e479952e..21ea7b8f3de825eb4a0256c043aa2e5f13b271f4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 536774c0bf268311e66f3ec29f32011583583bc3..ec77e70564937f6efa4d3900be05da208a550585 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -697,15 +697,23 @@ bool MeasureGUI_DimensionInteractor::eventFilter( QObject* theObject, QEvent* th
         return false;
       }
 
+      // commented by mpa 18.03.2015: since OCCT version 6.8.0 it's impossible
+      // to change position of the dimensions presentations (flyout, text),
+      // because anAISContext has 2 detected objects.
+
       // check that there is only one detected entity
-      anAISContext->InitDetected();
-      if ( anAISContext->MoreDetected() )
+      //anAISContext->InitDetected();
+      //if ( anAISContext->MoreDetected() )
+      //{
+      //  return false;
+      //}
+
+      Handle(SelectMgr_EntityOwner) aDetectedOwner = anAISContext->DetectedOwner();
+      if( aDetectedOwner.IsNull() )
       {
         return false;
       }
 
-      Handle(SelectMgr_EntityOwner) aDetectedOwner = anAISContext->DetectedOwner();
-
       myInteractedIO = Handle(AIS_Dimension)::DownCast( aDetectedOwner->Selectable() );
 
       // try to start operation for the detected entity
index d2a2f3acdd87e4897d03e70151e1069664c24ec3..4b6062b5a1c2e542b27ae96fe81008acfdd13d50 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 4fcbc5796127aa454981e4c186f4e60e315fd173..8c7207f9a23d6aa4e94bbbf9adcf82d05e35777d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -47,7 +47,6 @@
 // OCCT Includes
 #include <Geom_Plane.hxx>
 #include <AIS_LengthDimension.hxx>
-#include <AIS_Drawer.hxx>
 #include <Prs3d_LineAspect.hxx>
 #include <BRepBuilderAPI_MakeEdge.hxx>
 #include <BRepBuilderAPI_MakeVertex.hxx>
@@ -128,6 +127,12 @@ void MeasureGUI_DistanceDlg::Init()
   myEditCurrentArgument = myGrp->LineEdit1;
   myDbls = new GEOM::ListOfDouble();
 
+  myGrp->LineEdit1->setEnabled(true);
+  myGrp->LineEdit2->setEnabled(false);
+
+  myObj1.nullify();
+  myObj2.nullify();
+
   // signals and slots connections
   connect(buttonOk(),         SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply(),      SIGNAL(clicked()), this, SLOT(ClickOnApply()));
@@ -140,7 +145,7 @@ void MeasureGUI_DistanceDlg::Init()
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 
-  globalSelection();
+  activateSelection();
   SelectionIntoArgument();
 }
 
@@ -164,6 +169,7 @@ bool MeasureGUI_DistanceDlg::ClickOnApply()
     return false;
 
   initName();
+  activateSelection();
   return true;
 }
 
@@ -178,7 +184,7 @@ void MeasureGUI_DistanceDlg::ActivateThisDialog()
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 
-  globalSelection();
+  activateSelection();
   redisplayPreview();
 }
 
@@ -230,15 +236,9 @@ void MeasureGUI_DistanceDlg::SolutionSelected (int i)
 //=================================================================================
 void MeasureGUI_DistanceDlg::SelectionIntoArgument()
 {
-  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
-  SALOME_ListIO aSelList;
-  aSelMgr->selectedObjects(aSelList);
-
-  GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
-
-  if (aSelList.Extent() > 0) {
-    aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First());
-  }
+  QList<TopAbs_ShapeEnum> aTypes;
+  aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE;
+  GEOM::GeomObjPtr aSelectedObject = getSelected( aTypes );
 
   // clear selection
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
@@ -248,12 +248,12 @@ void MeasureGUI_DistanceDlg::SelectionIntoArgument()
 
   if (myEditCurrentArgument == myGrp->LineEdit1) {
     myObj1 = aSelectedObject;
-    if (!myObj1->_is_nil() && myObj2->_is_nil())
+    if (myObj1 && !myObj2)
       myGrp->PushButton2->click();
   }
   else {
     myObj2 = aSelectedObject;
-    if (!myObj2->_is_nil() && myObj1->_is_nil())
+    if (myObj2 && !myObj1)
       myGrp->PushButton1->click();
   }
 
@@ -297,8 +297,8 @@ void MeasureGUI_DistanceDlg::SetEditCurrentArgument()
 //=================================================================================
 void MeasureGUI_DistanceDlg::processObject()
 {
-  myGrp->LineEdit1->setText(!myObj1->_is_nil() ? GEOMBase::GetName(myObj1) : "");
-  myGrp->LineEdit2->setText(!myObj2->_is_nil() ? GEOMBase::GetName(myObj2) : "");
+  myGrp->LineEdit1->setText(myObj1 ? GEOMBase::GetName(myObj1.get()) : "");
+  myGrp->LineEdit2->setText(myObj2 ? GEOMBase::GetName(myObj2.get()) : "");
 
   myGrp->ComboBox1->clear();
   myDbls->length(0);
@@ -311,7 +311,7 @@ void MeasureGUI_DistanceDlg::processObject()
 
   GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
   try {
-    nbSols = anOper->ClosestPoints(myObj1, myObj2, myDbls);
+    nbSols = anOper->ClosestPoints(myObj1.get(), myObj2.get(), myDbls);
   }
   catch (const SALOME::SALOME_Exception& e) {
     SalomeApp_Tools::QtCatchCorbaException(e);
@@ -340,7 +340,7 @@ SALOME_Prs* MeasureGUI_DistanceDlg::buildPrs()
 
   int currSol = myGrp->ComboBox1->currentIndex();
 
-  if (myObj1->_is_nil() || myObj2->_is_nil() ||
+  if (!myObj1 || !myObj2 ||
       currSol == -1 || (currSol+1)*6 > myDbls->length() ||
       vw->getViewManager()->getType() != OCCViewer_Viewer::Type())
     return 0;
@@ -424,7 +424,7 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_DistanceDlg::createOperation()
 //=================================================================================
 bool MeasureGUI_DistanceDlg::isValid (QString& msg)
 {
-  return !myObj1->_is_nil() && !myObj2->_is_nil();
+  return myObj1 && myObj2;
 }
 
 //=================================================================================
@@ -437,7 +437,7 @@ bool MeasureGUI_DistanceDlg::execute (ObjectList& objects)
   GEOM::GEOM_IBasicOperations_var aBasicOper = getGeomEngine()->GetIBasicOperations(getStudyId());
 
   GEOM::ListOfDouble_var aDbls;
-  int nbSols = anOper->ClosestPoints(myObj1, myObj2, aDbls);
+  int nbSols = anOper->ClosestPoints(myObj1.get(), myObj2.get(), aDbls);
 
   if (anOper->IsDone()) {
     bool doPublishAll = true;
@@ -482,6 +482,16 @@ bool MeasureGUI_DistanceDlg::execute (ObjectList& objects)
   return true;
 }
 
+//=================================================================================
+// function : activateSelection()
+// purpose  :
+//=================================================================================
+void MeasureGUI_DistanceDlg::activateSelection()
+{
+  globalSelection( GEOM_ALLSHAPES );
+  localSelection( TopAbs_SHAPE );
+}
+
 //=================================================================================
 // function : redisplayPreview()
 // purpose  :
@@ -497,7 +507,7 @@ void MeasureGUI_DistanceDlg::redisplayPreview()
   erasePreview(false);
 
   try {
-    SUIT_OverrideCursor();
+    SUIT_OverrideCursor wc;
 
     getDisplayer()->SetColor(Quantity_NOC_VIOLET);
     getDisplayer()->SetToActivate(false);
@@ -517,11 +527,32 @@ void MeasureGUI_DistanceDlg::redisplayPreview()
 QString MeasureGUI_DistanceDlg::getNewObjectName (int currObj) const
 {
   QString aName = tr("GEOM_MINDIST_NAME") + QString("_%1_").arg((currObj+1)/2);
-  aName += GEOMBase::GetName(currObj%2 ? myObj1 : myObj2);
+  aName += GEOMBase::GetName(currObj%2 ? myObj1.get() : myObj2.get());
 
   return aName;
 }
 
+//=================================================================================
+// function : addSubshapeToStudy
+// purpose  : virtual method to add new SubObjects if local selection
+//=================================================================================
+void MeasureGUI_DistanceDlg::addSubshapesToStudy()
+{
+  GEOMBase::PublishSubObject( myObj1.get() );
+  GEOMBase::PublishSubObject( myObj2.get() );
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> MeasureGUI_DistanceDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myObj1 << myObj2;
+  return res;
+}
+
 //=================================================================================
 // function : MeasureGUI_DistanceGroup
 // purpose  :
index 04c9ed8209f27e324edd70c271352126a3cbe8fc..0ce5d2138b43c26c05e096704bfc60fe75ded926 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -99,7 +99,9 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr  createOperation();
   virtual bool                        isValid (QString&);
   virtual bool                        execute (ObjectList&);
+  virtual void                        addSubshapesToStudy();
   virtual QString                     getNewObjectName (int CurrObj = -1) const; 
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
   void                                redisplayPreview();
   virtual void                        processObject();
@@ -108,10 +110,11 @@ protected:
 private:
   void                                Init();
   void                                enterEvent (QEvent*);
+  void                                activateSelection();
 
 private:
-  GEOM::GEOM_Object_var               myObj1;
-  GEOM::GEOM_Object_var               myObj2;
+  GEOM::GeomObjPtr                    myObj1;
+  GEOM::GeomObjPtr                    myObj2;
 
   MeasureGUI_DistanceGroup*           myGrp;
   GEOM::ListOfDouble_var              myDbls;
diff --git a/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx b/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.cxx
new file mode 100644 (file)
index 0000000..ff075bc
--- /dev/null
@@ -0,0 +1,692 @@
+// 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
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : MeasureGUI_FastCheckIntersectionsDlg.cxx
+
+#include "MeasureGUI_FastCheckIntersectionsDlg.h"
+#include "MeasureGUI.h"
+
+#include <SUIT_OverrideCursor.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_MessageBox.h>
+#include <LightApp_SelectionMgr.h>
+#include <SalomeApp_Tools.h>
+#include <SalomeApp_Application.h>
+
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopExp.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TColStd_MapOfInteger.hxx>
+
+#include <DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
+#include <GEOMImpl_Types.hxx>
+
+#include <QListWidget>
+
+#define TEXTEDIT_FONT_FAMILY "Courier"
+#define TEXTEDIT_FONT_SIZE 11
+//=================================================================================
+// class    : MeasureGUI_FastCheckIntersectionsDlg()
+// purpose  : Constructs a MeasureGUI_FastCheckIntersectionsDlg which is a child of 'parent', with the
+//            name 'name' and widget flags set to 'f'.
+//            The dialog will by default be modeless, unless you set 'modal' to
+//            true to construct a modal dialog.
+//=================================================================================
+MeasureGUI_FastCheckIntersectionsDlg::MeasureGUI_FastCheckIntersectionsDlg (GeometryGUI* GUI, QWidget* parent)
+  : GEOMBase_Skeleton (GUI, parent, false)
+{
+  SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+  QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_FAST_CHECK_INTERSECTIONS")));
+  QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+
+  setWindowTitle(tr("GEOM_FAST_CHECK_INTERSECTIONS"));
+
+  /***************************************************************/
+  mainFrame()->GroupConstructors->setTitle(tr("GEOM_FAST_CHECK_INTERSECTIONS"));
+  mainFrame()->RadioButton1->setIcon(image0);
+  mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
+  mainFrame()->RadioButton2->close();
+  mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
+  mainFrame()->RadioButton3->close();
+
+  QGroupBox* aGrp        = new QGroupBox(tr("GEOM_FAST_CHECK_OBJ"), centralWidget());
+  QLabel*    anObjLbl1   = new QLabel(tr("GEOM_OBJECT_I").arg("1"), aGrp);
+  QLabel*    anObjLbl2   = new QLabel(tr("GEOM_OBJECT_I").arg("2"), aGrp);
+  QLabel*    aShapeLbl1  = new QLabel(tr("GEOM_FAST_CHECK_INT_SUBSHAPES").arg("1"), aGrp);
+  QLabel*    aShapeLbl2  = new QLabel(tr("GEOM_FAST_CHECK_INT_SUBSHAPES").arg("2"), aGrp);
+  QLabel*    aDeflectLbl = new QLabel(tr("GEOM_FAST_CHECK_INT_DEFLECT"), aGrp);
+
+  mySelButton1 = new QPushButton(aGrp);
+  mySelButton1->setIcon(image1);
+  mySelButton1->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+  mySelButton2 = new QPushButton(aGrp);
+  mySelButton2->setIcon(image1);
+  mySelButton2->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+
+  myEditObjName1 = new QLineEdit(aGrp);
+  myEditObjName1->setReadOnly(true);
+  myEditObjName2 = new QLineEdit(aGrp);
+  myEditObjName2->setReadOnly(true);
+
+  myDetGaps = new QCheckBox(tr( "GEOM_FAST_CHECK_INT_DETECT_GAPS" ));
+  myTolerance = new SalomeApp_DoubleSpinBox(aGrp);
+  myDeflection = new SalomeApp_DoubleSpinBox(aGrp);
+  myShapeList1  = new QListWidget(aGrp);
+  myShapeList2 = new QListWidget(aGrp);
+  myShapeList1->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  myShapeList2->setSelectionMode(QAbstractItemView::ExtendedSelection);
+
+  myComputeButton = new QPushButton(tr("GEOM_FAST_CHECK_INT_COMPUTE"));
+
+  QGridLayout *aGrpLayout = new QGridLayout(aGrp);
+  aGrpLayout->setMargin(9);
+  aGrpLayout->setSpacing(6);
+  aGrpLayout->addWidget(anObjLbl1,       0, 0);
+  aGrpLayout->addWidget(mySelButton1,    0, 1);
+  aGrpLayout->addWidget(myEditObjName1,  0, 2);
+  aGrpLayout->addWidget(anObjLbl2,       1, 0);
+  aGrpLayout->addWidget(mySelButton2,    1, 1);
+  aGrpLayout->addWidget(myEditObjName2,  1, 2);
+  aGrpLayout->addWidget(aDeflectLbl,     2, 0);
+  aGrpLayout->addWidget(myDeflection,    2, 1, 1, 2);
+  aGrpLayout->addWidget(myDetGaps,       3, 0);
+  aGrpLayout->addWidget(myTolerance,     3, 1, 1, 2);
+  aGrpLayout->addWidget(myComputeButton, 4, 0, 1, 3);
+  
+  QGridLayout *aGrpLayout2 = new QGridLayout();
+  aGrpLayout->addLayout(aGrpLayout2,     5, 0, 1, 3);
+  aGrpLayout2->addWidget(aShapeLbl1,     0, 0);
+  aGrpLayout2->addWidget(aShapeLbl2,     0, 1);
+  aGrpLayout2->addWidget(myShapeList1,   1, 0);
+  aGrpLayout2->addWidget(myShapeList2,   1, 1);
+
+  QVBoxLayout* layout = new QVBoxLayout (centralWidget());
+  layout->setMargin(0); layout->setSpacing(6);
+  layout->addWidget(aGrp);
+
+  /***************************************************************/
+
+  myHelpFileName = "fast_intersection_page.html";
+
+  // Initialisation 
+  Init();
+}
+
+//=================================================================================
+// function : ~MeasureGUI_FastCheckIntersectionsDlg()
+// purpose  : Destroys the object and frees any allocated resources
+//=================================================================================
+MeasureGUI_FastCheckIntersectionsDlg::~MeasureGUI_FastCheckIntersectionsDlg()
+{
+}
+
+//=================================================================================
+// function : Init()
+// purpose  :
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::Init()
+{
+  myObj1.nullify();
+  myObj2.nullify();
+  myEditObjName1->setText("");
+  myEditObjName2->setText("");
+  myEditObjName1->setEnabled(true);
+  myEditObjName2->setEnabled(false);
+
+  myDetGaps->setChecked(false);
+  initSpinBox(myTolerance, 0, MAX_NUMBER, 1);
+  myTolerance->setValue(0);
+  myTolerance->setEnabled(false);
+
+  // Obtain deflection from preferences
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  initSpinBox(myDeflection, 1e-3, 1.0, 1e-3);
+  myDeflection->setValue(qMax(1e-3, resMgr->doubleValue("Geometry", "deflection_coeff", 1e-3)));
+
+  myEditCurrentArgument = myEditObjName1;
+
+  connect(myGeomGUI,          SIGNAL(SignalDeactivateActiveDialog()),
+          this,               SLOT(DeactivateActiveDialog()));
+  connect(myGeomGUI,          SIGNAL(SignalCloseAllDialogs()),
+          this,               SLOT(ClickOnCancel()));
+  connect(buttonOk(),         SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+  connect(buttonApply(),      SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+  connect(mySelButton1,       SIGNAL(clicked()),
+          this,               SLOT(SetEditCurrentArgument()));
+  connect(mySelButton2,       SIGNAL(clicked()),
+          this,               SLOT(SetEditCurrentArgument()));
+  connect(myDetGaps,          SIGNAL(toggled(bool)), this, SLOT(OnGaps(bool))); 
+  connect( myTolerance,       SIGNAL(valueChanged(double)), this, SLOT(clear()));
+  connect( myDeflection,      SIGNAL(valueChanged(double)), this, SLOT(clear()));
+  connect(myShapeList1,       SIGNAL(itemSelectionChanged()),
+          SLOT(onSubShapesListSelectionChanged()));
+  connect(myShapeList2,       SIGNAL(itemSelectionChanged()),
+          SLOT(onSubShapesListSelectionChanged()));
+  connect(myComputeButton,    SIGNAL(clicked()), this, SLOT(onCompute()));
+
+  LightApp_SelectionMgr* aSel = myGeomGUI->getApp()->selectionMgr();
+
+  connect(aSel,               SIGNAL(currentSelectionChanged()),
+          this,               SLOT(SelectionIntoArgument()));
+
+  initName(tr("GEOM_FAST_INTERSECTION_NAME"));
+  buttonOk()->setEnabled(false);
+  buttonApply()->setEnabled(false);
+  myComputeButton->setEnabled(false);
+  activateSelection();
+
+  mySelButton1->click();
+  SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : clear
+// purpose  :
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::clear()
+{
+  disconnect(myShapeList1, SIGNAL(itemSelectionChanged()), this, 0);
+  disconnect(myShapeList2, SIGNAL(itemSelectionChanged()), this, 0);
+  myShapeList1->clear();
+  myShapeList2->clear();
+  connect(myShapeList1,    SIGNAL(itemSelectionChanged()),
+          SLOT(onSubShapesListSelectionChanged()));
+  connect(myShapeList2,    SIGNAL(itemSelectionChanged()),
+          SLOT(onSubShapesListSelectionChanged()));
+  erasePreview();
+  buttonOk()->setEnabled(false);
+  buttonApply()->setEnabled(false);
+  myComputeButton->setEnabled(true);
+}
+
+//=================================================================================
+// function : onCompute
+// purpose  :
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::onCompute()
+{
+  SUIT_OverrideCursor wc;
+
+  myShapeList1->clear();
+  myShapeList2->clear();
+
+  if (!findIntersections()) {
+    myShapeList1->addItem(tr("GEOM_FAST_INTERSECTION_FAILS"));
+    myShapeList1->setEnabled(false);
+    myShapeList2->addItem(tr("GEOM_FAST_INTERSECTION_FAILS"));
+    myShapeList2->setEnabled(false);
+    return;
+  }
+  
+  myShapeList1->setEnabled(true);
+  myShapeList2->setEnabled(true);
+  QStringList aSubShapeList1, aSubShapeList2;
+  TopoDS_Shape aSelShape1, aSelShape2;
+  if (myObj1 && GEOMBase::GetShape(myObj1.get(), aSelShape1) && myObj2
+                     && GEOMBase::GetShape(myObj2.get(), aSelShape2)) {
+    TopTools_IndexedMapOfShape anIndices1, anIndices2;
+    TopExp::MapShapes(aSelShape1, anIndices1);
+    TopExp::MapShapes(aSelShape2, anIndices2);
+
+    //Sub-shapes of 1st Object
+    for (int i = 0; i < myInters1->length(); i++) {
+      TopoDS_Shape aSubShape = anIndices1.FindKey(myInters1[i]);
+      QString aType = GEOMBase::GetShapeTypeString(aSubShape);
+      if (!aType.isEmpty())
+        aSubShapeList1.append(QString("%1_%2").arg(aType).arg(myInters1[i]));
+    }
+    myShapeList1->addItems(aSubShapeList1);
+    myShapeList1->selectAll();
+
+    //Sub-shapes of second Object
+    for (int i = 0; i < myInters2->length(); i++) {
+      TopoDS_Shape aSubShape = anIndices2.FindKey(myInters2[i]);
+      QString aType = GEOMBase::GetShapeTypeString(aSubShape);
+      if (!aType.isEmpty())
+        aSubShapeList2.append(QString("%1_%2").arg(aType).arg(myInters2[i]));
+    }
+    myShapeList2->addItems(aSubShapeList2);
+    myShapeList2->selectAll();
+  }
+
+  buttonOk()->setEnabled(true);
+  buttonApply()->setEnabled(true);
+  myComputeButton->setEnabled(false);
+}
+
+//=================================================================================
+// function : ActivateThisDialog
+// purpose  :
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::ActivateThisDialog()
+{
+  GEOMBase_Skeleton::ActivateThisDialog();
+
+  LightApp_SelectionMgr* aSel = myGeomGUI->getApp()->selectionMgr();
+  if ( aSel )
+    connect( aSel, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
+
+  activateSelection();
+  DISPLAY_PREVIEW_MACRO
+}
+
+//=================================================================================
+// function : DeactivateActiveDialog()
+// purpose  : public slot to deactivate if active
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::DeactivateActiveDialog()
+{
+  GEOMBase_Skeleton::DeactivateActiveDialog();
+}
+
+//=================================================================================
+// function : activateSelection
+// purpose  : 
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::activateSelection()
+{
+  TColStd_MapOfInteger aTypes;
+  aTypes.Add(GEOM_COMPOUND );
+  aTypes.Add(GEOM_SOLID );
+  aTypes.Add(GEOM_SHELL);
+  aTypes.Add(GEOM_FACE);
+  globalSelection(aTypes);
+
+  std::list<int> needTypes;
+  needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
+  localSelection( needTypes );
+
+}
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose  :
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::ClickOnOk()
+{
+  if ( ClickOnApply() )
+    ClickOnCancel();
+}
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose  :
+//=================================================================================
+bool MeasureGUI_FastCheckIntersectionsDlg::ClickOnApply()
+{
+  if ( !onAccept() )
+    return false;
+
+  clear();
+  initName();
+  return true;
+}
+
+//=================================================================================
+// function : extractPrefix
+// purpose  :
+//=================================================================================
+bool MeasureGUI_FastCheckIntersectionsDlg::extractPrefix() const
+{
+  return true;
+}
+
+//=================================================================================
+// function : createOperation
+// purpose  :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr MeasureGUI_FastCheckIntersectionsDlg::createOperation()
+{
+  return getGeomEngine()->GetIMeasureOperations( getStudyId() );
+}
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool MeasureGUI_FastCheckIntersectionsDlg::isValid( QString& )
+{
+  return myObj1 && myObj2;
+}
+
+//=================================================================================
+// function : SetEditCurrentArgument
+// purpose  :
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::SetEditCurrentArgument()
+{
+    QPushButton* send = (QPushButton*)sender();
+
+  if (send == mySelButton1) {
+    myEditCurrentArgument = myEditObjName1;
+
+    mySelButton2->setDown(false);
+    myEditObjName2->setEnabled(false);
+    myObj1.nullify();
+  }
+  else {
+    myEditCurrentArgument = myEditObjName2;
+
+    mySelButton1->setDown(false);
+    myEditObjName1->setEnabled(false);
+    myObj2.nullify();
+  }
+
+  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+  activateSelection();
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+          this, SLOT(SelectionIntoArgument()));
+
+  // enable line edit
+  myEditCurrentArgument->setEnabled(true);
+  myEditCurrentArgument->setFocus();
+  // after setFocus(), because it will be setDown(false) when loses focus
+  send->setDown(true);
+
+  SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : OnGaps()
+// purpose  :
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::OnGaps(bool cheked)
+{
+  clear();
+  myTolerance->setEnabled(cheked);
+}
+//=================================================================================
+// function : SelectionIntoArgument
+// purpose  :
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::SelectionIntoArgument()
+{
+  myEditCurrentArgument->setText("");
+  // Clear the dialog.
+  clear();
+
+  QList<TopAbs_ShapeEnum> typesLst;
+  typesLst << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPOUND;
+  GEOM::GeomObjPtr aSelectedObject = getSelected( typesLst );
+
+  // clear selection
+  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+  myGeomGUI->getApp()->selectionMgr()->clearSelected();
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+          this, SLOT(SelectionIntoArgument()));
+
+  if (myEditCurrentArgument == myEditObjName1) {
+    myObj1 = aSelectedObject;
+    if (myObj1 && !myObj2)
+      mySelButton2->click();
+  }
+  else {
+    myObj2 = aSelectedObject;
+    if (myObj2 && !myObj1)
+      mySelButton1->click();
+  }
+  myEditObjName1->setText(myObj1 ? GEOMBase::GetName(myObj1.get()) : "");
+  myEditObjName2->setText(myObj2 ? GEOMBase::GetName(myObj2.get()) : "");
+}
+
+//=================================================================================
+// function : enterEvent
+// purpose  :
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::enterEvent(QEvent *)
+{
+  if (!mainFrame()->GroupConstructors->isEnabled())
+    ActivateThisDialog();
+}
+
+//=================================================================================
+// function : findIntersections
+// purpose  :
+//=================================================================================
+bool MeasureGUI_FastCheckIntersectionsDlg::findIntersections()
+{
+  if (!myObj1 || !myObj2)
+    return false;
+
+  GEOM::GEOM_IMeasureOperations_var anOper =
+    GEOM::GEOM_IMeasureOperations::_narrow(getOperation());
+  bool isOK = true;
+
+  bool HasInte;
+  try {
+    HasInte = anOper->FastIntersect(myObj1.get(), myObj2.get(), getTolerance(), getDeflection(), myInters1, myInters2);
+  }
+  catch (const SALOME::SALOME_Exception& e) {
+    SalomeApp_Tools::QtCatchCorbaException(e);
+    isOK = false;
+  }
+
+  bool isDone = anOper->IsDone();
+  if (!isDone) {
+    CORBA::String_var aMsg = anOper->GetErrorCode();
+    SUIT_MessageBox::warning(this,
+                             QObject::tr("WRN_WARNING"),
+                             QObject::tr(aMsg.in()));
+  }
+
+  if ( !HasInte || myInters1->length() == 0 || myInters2->length() == 0)
+    isOK = false;
+
+  return isOK;
+}
+
+//=================================================================================
+// function : onSubShapesListSelectionChanged
+// purpose  :
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::onSubShapesListSelectionChanged()
+{
+  erasePreview();
+  previewSubShapesListSelection(myShapeList1);
+  previewSubShapesListSelection(myShapeList2);
+}
+
+//=================================================================================
+// function : previewSubShapesListSelection
+// purpose  :
+//=================================================================================
+void MeasureGUI_FastCheckIntersectionsDlg::previewSubShapesListSelection(QListWidget* theWidget)
+{
+  GEOM::ListOfLong_var anInters;
+  GEOM::GeomObjPtr anObj;
+
+  if (theWidget == myShapeList1) { // Sub-Shapes of Object 1
+    anObj = myObj1;
+    anInters = myInters1;
+  }
+  else {
+    if (theWidget == myShapeList2) { // Sub-Shapes of Object 2
+      anObj = myObj2;
+      anInters = myInters2;
+    }
+    else return;
+  }
+  // Selected IDs
+  QList<int> aIds;
+  for (int i = 0, n = theWidget->count(); i < n; i++) {
+    if (theWidget->item(i)->isSelected())
+      aIds.append(i);
+  }
+  if (aIds.count() < 1)
+    return;
+
+  TopoDS_Shape aSelShape;
+  TopoDS_Shape aSubShape;
+  TopTools_IndexedMapOfShape anIndices;
+  if (anObj && GEOMBase::GetShape(anObj.get(), aSelShape)) {
+    SALOME_Prs* aPrs = 0;
+    TopExp::MapShapes(aSelShape, anIndices);
+    QList<int>::iterator it;
+    getDisplayer()->SetColor(theWidget == myShapeList1 ? Quantity_NOC_RED : Quantity_NOC_GREEN);
+    getDisplayer()->SetWidth(3);
+    getDisplayer()->SetToActivate(false);
+    for (it = aIds.begin(); it != aIds.end(); ++it) {
+      aSubShape = anIndices.FindKey(anInters[(*it)]);
+      try {
+        aPrs = !aSubShape.IsNull() ? getDisplayer()->BuildPrs(aSubShape) : 0;
+        if (aPrs)
+          displayPreview(aPrs, true);
+      }
+      catch (const SALOME::SALOME_Exception& e) {
+        SalomeApp_Tools::QtCatchCorbaException(e);
+      }
+    }
+  }
+}
+
+//=================================================================================
+// function : getLstObjFromListSelection
+// purpose  :
+//=================================================================================
+GEOM::ListOfGO_var MeasureGUI_FastCheckIntersectionsDlg::getLstObjFromListSelection(QListWidget* theWidget)
+{
+  GEOM::ListOfLong_var anInters;
+  GEOM::GeomObjPtr anObj;
+  GEOM::ListOfGO_var anObjLst = new GEOM::ListOfGO();
+
+  if (theWidget == myShapeList1) { // Sub-Shapes of Object 1
+    anObj = myObj1;
+    anInters = myInters1;
+  }
+  else {
+    if (theWidget == myShapeList2) { // Sub-Shapes of Object 2
+      anObj = myObj2;
+      anInters = myInters2;
+    }
+    else
+      return anObjLst;
+  }
+  //Add in study myObj if local selection
+  GEOMBase::PublishSubObject( anObj.get() );
+  // Collect the map of indices and already publised objects
+  TColStd_IndexedMapOfInteger aMapIndex;
+  ObjectList aObjLstExist;
+  for (int i = 0, n = theWidget->count(); i < n; i++) {
+    if (theWidget->item(i)->isSelected()) {
+      GEOM::GEOM_Object_var aTmpObj = GEOMBase_Helper::findObjectInFather(anObj.get(), anInters[i]);
+      if (aTmpObj->_is_nil())
+        aMapIndex.Add(anInters[i]);
+      else
+        aObjLstExist.push_back( GEOM::GEOM_Object::_duplicate(aTmpObj));
+    }
+  }
+
+  if (aMapIndex.IsEmpty() && aObjLstExist.empty())
+    return anObjLst;
+  // Create objects.
+  GEOM::ListOfLong_var anArray   = new GEOM::ListOfLong;
+  const int            aNbShapes = aMapIndex.Extent();
+  anArray->length(aNbShapes);
+  for (int i = 1; i <= aNbShapes; i++) {
+    anArray[i - 1] = aMapIndex.FindKey(i);
+  }
+
+  if (myShapesOper->_is_nil())
+    myShapesOper = getGeomEngine()->GetIShapesOperations(getStudyId());
+
+  GEOM::ListOfGO_var aObjLstCreate = myShapesOper->MakeSubShapes(anObj.get(), anArray);
+
+  //Collect all objects in list
+  anObjLst->length(aObjLstCreate->length() + aObjLstExist.size());
+  
+  ObjectList::iterator anIter;
+  int i;
+  for (i=0, anIter = aObjLstExist.begin(); anIter != aObjLstExist.end(); i++, ++anIter) {
+    anObjLst[i] = *anIter;
+  }
+  for (int j = 0; j < aObjLstCreate->length(); j++) {
+    anObjLst[aObjLstExist.size()+j]=aObjLstCreate[j];
+  }
+  return  anObjLst._retn();
+}
+
+//=================================================================================
+// function : execute
+// purpose  :
+//=================================================================================
+bool MeasureGUI_FastCheckIntersectionsDlg::execute(ObjectList& objects)
+{
+  GEOM::ListOfGO_var aList1 = getLstObjFromListSelection(myShapeList1);
+  GEOM::ListOfGO_var aList2 = getLstObjFromListSelection(myShapeList2);
+  GEOM::ListOfGO_var aCompList = new GEOM::ListOfGO();
+  const int nbObj = aList1->length() + aList2->length();
+  if (nbObj <= 0)
+    return true;
+
+  //Collect general intersection list
+  aCompList->length(nbObj);
+  int i;
+  for (i = 0; i < aList1->length(); i++) {
+    GEOMBase::PublishSubObject( aList1[i] );
+    aCompList[i]=aList1[i];
+  }
+  for (int j = 0; j < aList2->length(); j++) {
+    GEOMBase::PublishSubObject( aList2[j] );
+    aCompList[i+j]=aList2[j];
+  }
+
+  // make compound
+  objects.push_back(myShapesOper->MakeCompound(aCompList));
+  return true; 
+}
+
+//=================================================================================
+// function : getDeflection
+// purpose  :
+//=================================================================================
+float MeasureGUI_FastCheckIntersectionsDlg::getDeflection()
+{
+  return (float)myDeflection->value();
+}
+
+//=================================================================================
+// function : getTolerance
+// purpose  :
+//=================================================================================
+double MeasureGUI_FastCheckIntersectionsDlg::getTolerance()
+{
+  double aVal = myTolerance->value();
+  if (!myDetGaps->isChecked() || aVal < 0.0)
+    return 0.0;
+  return aVal;
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> MeasureGUI_FastCheckIntersectionsDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myObj1 << myObj2;
+  return res;
+}
diff --git a/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.h b/src/MeasureGUI/MeasureGUI_FastCheckIntersectionsDlg.h
new file mode 100644 (file)
index 0000000..b07af28
--- /dev/null
@@ -0,0 +1,99 @@
+// 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
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : MeasureGUI_FastCheckIntersectionsDlg.h
+
+#ifndef MEASUREGUI_FASTCHECKINTERDLG_H
+#define MEASUREGUI_FASTCHECKINTERDLG_H
+
+#include <GEOMBase_Skeleton.h>
+
+class QListWidget;
+
+//=================================================================================
+// class    : MeasureGUI_FastCheckIntersectionsDlg
+// purpose  :
+//=================================================================================
+
+class MeasureGUI_FastCheckIntersectionsDlg : public GEOMBase_Skeleton
+{
+  Q_OBJECT
+
+public:
+
+  MeasureGUI_FastCheckIntersectionsDlg(GeometryGUI*, QWidget*);
+  ~MeasureGUI_FastCheckIntersectionsDlg();
+
+protected:
+  // redefined from GEOMBase_Helper
+  virtual GEOM::GEOM_IOperations_ptr  createOperation();
+  virtual bool                        isValid(QString &);
+  virtual bool                        execute(ObjectList &);
+  virtual bool                        extractPrefix() const;
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
+
+private slots:
+
+  void                                onSubShapesListSelectionChanged();
+  void                                clear();
+  void                                onCompute();
+  void                                ClickOnOk();
+  bool                                ClickOnApply();
+  void                                ActivateThisDialog();
+  void                                DeactivateActiveDialog();  
+  void                                SelectionIntoArgument(); 
+  void                                SetEditCurrentArgument();
+  void                                OnGaps(bool);
+
+private:
+
+  void                                Init();
+  void                                activateSelection();
+  void                                enterEvent(QEvent *);
+  bool                                findIntersections();
+  float                               getDeflection();
+  double                              getTolerance();
+  void                                previewSubShapesListSelection(QListWidget*);
+  GEOM::ListOfGO_var                  getLstObjFromListSelection(QListWidget*);
+
+private:
+
+  QPushButton                        *mySelButton1;
+  QPushButton                        *mySelButton2;
+  QLineEdit                          *myEditObjName1;
+  QLineEdit                          *myEditObjName2;
+  QLineEdit                          *myEditCurrentArgument;
+  QCheckBox                          *myDetGaps;
+  SalomeApp_DoubleSpinBox            *myTolerance;
+  SalomeApp_DoubleSpinBox            *myDeflection;
+  QPushButton                        *myComputeButton;
+  QListWidget                        *myShapeList1;
+  QListWidget                        *myShapeList2;
+  GEOM::GeomObjPtr                    myObj1;
+  GEOM::GeomObjPtr                    myObj2;
+  GEOM::ListOfLong_var                myInters1;
+  GEOM::ListOfLong_var                myInters2;
+  GEOM::GEOM_IShapesOperations_var    myShapesOper;
+};
+
+#endif // MEASUREGUI_FASTCHECKINTERDLG_H
index 5c04f273aa8b766af40fbe653709ce9ac72474d7..8b292cf02091364dc444dca7d59affdabd2af009 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -25,7 +25,6 @@
 
 #include "MeasureGUI_GetNonBlocksDlg.h"
 
-#include <DlgRef.h>
 #include <GEOMBase.h>
 
 #include <GeometryGUI.h>
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
 #include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
 #include <LightApp_SelectionMgr.h>
 #include <SalomeApp_Tools.h>
 
+#include <QCheckBox>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+#include <QVBoxLayout>
+
 //=================================================================================
 // class    : MeasureGUI_GetNonBlocksDlg()
 // purpose  : Constructs a MeasureGUI_GetNonBlocksDlg which is a child of 'parent',
 //            true to construct a modal dialog.
 //=================================================================================
 MeasureGUI_GetNonBlocksDlg::MeasureGUI_GetNonBlocksDlg (GeometryGUI* theGeometryGUI, QWidget* parent)
-  : GEOMBase_Skeleton(theGeometryGUI, parent, false)
+  : GEOMBase_Skeleton(theGeometryGUI, parent, false),
+    myObjectName     (0),
+    mySelButton      (0),
+    myUseC1Check     (0),
+    myTolLbl         (0),
+    mySpinTol        (0)
 {
   QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_GETNONBLOCKS")));
   QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
@@ -58,16 +71,36 @@ MeasureGUI_GetNonBlocksDlg::MeasureGUI_GetNonBlocksDlg (GeometryGUI* theGeometry
   mainFrame()->RadioButton2->close();
   mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
   mainFrame()->RadioButton3->close();
-
-  myGrp = new DlgRef_1Sel (centralWidget());
-  myGrp->GroupBox1->setTitle(tr("GEOM_GETNONBLOCKS"));
-  myGrp->TextLabel1->setText(tr("GEOM_OBJECT"));
-  myGrp->PushButton1->setIcon(image1);
-  myGrp->LineEdit1->setReadOnly(true);
+  
+  QGroupBox   *aGrpParams    =
+    new QGroupBox(tr("GEOM_GETNONBLOCKS"), centralWidget());
+  QGridLayout *aParamsLayout = new QGridLayout(aGrpParams);
+  QLabel      *anObjLbl      = new QLabel(tr("GEOM_OBJECT"), aGrpParams);
+
+  myObjectName = new QLineEdit(aGrpParams);
+  mySelButton  = new QPushButton(aGrpParams);
+  myUseC1Check = new QCheckBox(tr("GEOM_USE_C1_CRITERION"), aGrpParams);
+  myTolLbl     = new QLabel(tr("GEOM_ANGULAR_TOLERANCE"), aGrpParams);
+  mySpinTol    = new SalomeApp_DoubleSpinBox(aGrpParams);
+
+  myObjectName->setReadOnly(true);
+  mySelButton->setIcon(image1);
+  mySelButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+  myUseC1Check->setText(tr("GEOM_USE_C1_CRITERION"));
+  myUseC1Check->setChecked(true);
+
+  aParamsLayout->setMargin(9);
+  aParamsLayout->setSpacing(6);
+  aParamsLayout->addWidget(anObjLbl,     0, 0);
+  aParamsLayout->addWidget(mySelButton,  0, 1);
+  aParamsLayout->addWidget(myObjectName, 0, 2);
+  aParamsLayout->addWidget(myUseC1Check, 1, 0, 1, 3);
+  aParamsLayout->addWidget(myTolLbl,     2, 0);
+  aParamsLayout->addWidget(mySpinTol,    2, 1, 1, 2);
 
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
-  layout->addWidget(myGrp);
+  layout->addWidget(aGrpParams);
 
   /***************************************************************/
 
@@ -94,14 +127,20 @@ void MeasureGUI_GetNonBlocksDlg::Init()
   showOnlyPreviewControl();
 
   /* init variables */
-  myEditCurrentArgument = myGrp->LineEdit1;
+  double SpecificStep = 0.0001;
+  double aDefaultTol  = Precision::Angular();
 
-   /* signals and slots connections */
-  connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
-  connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+  initSpinBox(mySpinTol, aDefaultTol, MAX_NUMBER, SpecificStep, "ang_tol_precision");
+  mySpinTol->setValue(aDefaultTol);
+  myEditCurrentArgument = myObjectName;
 
-  connect(myGrp->LineEdit1,   SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
-  connect(myGrp->PushButton1, SIGNAL(clicked()),       this, SLOT(SetEditCurrentArgument()));
+   /* signals and slots connections */
+  connect(buttonOk(),    SIGNAL(clicked()),            this, SLOT(ClickOnOk()));
+  connect(buttonApply(), SIGNAL(clicked()),            this, SLOT(ClickOnApply()));
+  connect(myUseC1Check,  SIGNAL(clicked()),            this, SLOT(SetUseC1Tolerance()));
+  connect(mySpinTol,     SIGNAL(valueChanged(double)), this, SLOT(processPreview()));
+  connect(myObjectName,  SIGNAL(returnPressed()),      this, SLOT(LineEditReturnPressed()));
+  connect(mySelButton,   SIGNAL(clicked()),            this, SLOT(SetEditCurrentArgument()));
 
   connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
            SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
@@ -171,11 +210,22 @@ void MeasureGUI_GetNonBlocksDlg::SelectionIntoArgument()
 //=================================================================================
 void MeasureGUI_GetNonBlocksDlg::SetEditCurrentArgument()
 {
-  myGrp->LineEdit1->setFocus();
-  myEditCurrentArgument = myGrp->LineEdit1;
+  myObjectName->setFocus();
+  myEditCurrentArgument = myObjectName;
   SelectionIntoArgument();
 }
 
+//=================================================================================
+// function : SetUseC1Tolerance()
+// purpose  :
+//=================================================================================
+void MeasureGUI_GetNonBlocksDlg::SetUseC1Tolerance()
+{
+  myTolLbl->setEnabled(myUseC1Check->isChecked());
+  mySpinTol->setEnabled(myUseC1Check->isChecked());
+  processPreview();
+}
+
 //=================================================================================
 // function : LineEditReturnPressed()
 // purpose  :
@@ -183,8 +233,8 @@ void MeasureGUI_GetNonBlocksDlg::SetEditCurrentArgument()
 void MeasureGUI_GetNonBlocksDlg::LineEditReturnPressed()
 {
   QLineEdit* send = (QLineEdit*)sender();
-  if (send == myGrp->LineEdit1) {
-    myEditCurrentArgument = myGrp->LineEdit1;
+  if (send == myObjectName) {
+    myEditCurrentArgument = myObjectName;
     GEOMBase_Skeleton::LineEditReturnPressed();
   }
 }
@@ -211,10 +261,11 @@ void MeasureGUI_GetNonBlocksDlg::ActivateThisDialog()
 void MeasureGUI_GetNonBlocksDlg::processObject()
 {
   if (myObj->_is_nil()) {
+    myObjectName->setText("");
     erasePreview();
   }
   else {
-    myGrp->LineEdit1->setText(GEOMBase::GetName(myObj));
+    myObjectName->setText(GEOMBase::GetName(myObj));
 
     processPreview();
   }
@@ -243,9 +294,9 @@ GEOM::GEOM_IOperations_ptr MeasureGUI_GetNonBlocksDlg::createOperation()
 // function : isValid
 // purpose  :
 //=================================================================================
-bool MeasureGUI_GetNonBlocksDlg::isValid (QString&)
+bool MeasureGUI_GetNonBlocksDlg::isValid (QString &msg)
 {
-  return !myObj->_is_nil();
+  return !myObj->_is_nil() && mySpinTol->isValid(msg, !IsPreview());
 }
 
 //=================================================================================
@@ -256,7 +307,13 @@ bool MeasureGUI_GetNonBlocksDlg::execute (ObjectList& objects)
 {
   GEOM::GEOM_IBlocksOperations_var anOper = GEOM::GEOM_IBlocksOperations::_narrow(getOperation());
   GEOM::GEOM_Object_var aNonQuads;
-  GEOM::GEOM_Object_var anObj = anOper->GetNonBlocks(myObj, aNonQuads);
+  double aC1Tol = -1.;
+
+  if (myUseC1Check->isChecked()) {
+    aC1Tol = mySpinTol->value();
+  }
+
+  GEOM::GEOM_Object_var anObj = anOper->GetNonBlocks(myObj, aC1Tol, aNonQuads);
   //mainFrame()->ResultName->setText(tr("GEOM_NONBLOCKS"));
 
   if (!anObj->_is_nil())
@@ -276,3 +333,15 @@ GEOM::GEOM_Object_ptr MeasureGUI_GetNonBlocksDlg::getFather (GEOM::GEOM_Object_p
 {
   return myObj;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> MeasureGUI_GetNonBlocksDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObj);
+  res << aGeomObjPtr;
+  return res;
+}
index 5282c8cd6e888180839292c79f47c75c4d619a96..399ab7072b0871d1d6d94ab69df053082b3f61ac 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <GEOMBase_Skeleton.h>
 
-class DlgRef_1Sel;
+class QCheckBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class SalomeApp_DoubleSpinBox;
 
 //=================================================================================
 // class    : MeasureGUI_GetNonBlocksDlg
@@ -45,9 +49,10 @@ public:
 protected:
   // redefined from GEOMBase_Helper
   virtual GEOM::GEOM_IOperations_ptr  createOperation();
-  virtual bool                        isValid (QString&);
+  virtual bool                        isValid (QString &msg);
   virtual bool                        execute (ObjectList&);
   virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
 private slots:
   void                                ClickOnOk();
@@ -56,6 +61,7 @@ private slots:
   void                                LineEditReturnPressed();
   void                                SelectionIntoArgument();
   void                                SetEditCurrentArgument();
+  void                                SetUseC1Tolerance();
   
 private:
   void                                Init();
@@ -64,7 +70,11 @@ private:
 
 private:
   GEOM::GEOM_Object_var               myObj;
-  DlgRef_1Sel*                        myGrp;
+  QLineEdit                          *myObjectName;
+  QPushButton                        *mySelButton;
+  QCheckBox                          *myUseC1Check;
+  QLabel                             *myTolLbl;
+  SalomeApp_DoubleSpinBox            *mySpinTol;
 };
 
 #endif // MEASUREGUI_GETNONBLOCKSDLG_H
index 3a011a5fee16a6ea8e4f2bd6f9544891130b74c8..61dcafdc39f55590de15f85f6cafabf9ef38887e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -122,6 +122,17 @@ void MeasureGUI_InertiaDlg::Init()
   MeasureGUI_Skeleton::Init();
 }
 
+//=================================================================================
+// function : activateSelection()
+// purpose  :
+//=================================================================================
+void MeasureGUI_InertiaDlg::activateSelection()
+{
+  MeasureGUI_Skeleton::activateSelection();
+  localSelection( TopAbs_SHAPE );
+}
+
+
 //=================================================================================
 // function : processObject
 // purpose  :
@@ -176,13 +187,13 @@ void MeasureGUI_InertiaDlg::processObject()
 bool MeasureGUI_InertiaDlg::getParameters( gp_Mat& I,
                                            gp_XYZ& theIXYZ )
 {
-  if ( myObj->_is_nil() )
+  if ( !myObj )
     return false;
   else {
     GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
     try {
       double x, y, z;
-      anOper->GetInertia( myObj,
+      anOper->GetInertia( myObj.get(),
                           I( 1, 1 ), I( 1, 2 ), I( 1, 3 ),
                           I( 2, 1 ), I( 2, 2 ), I( 2, 3 ),
                           I( 3, 1 ), I( 3, 2 ), I( 3, 3 ),
@@ -198,3 +209,22 @@ bool MeasureGUI_InertiaDlg::getParameters( gp_Mat& I,
     return anOper->IsDone();
   }
 }
+
+void MeasureGUI_InertiaDlg::SelectionIntoArgument()
+{
+  myObj.nullify();
+  QList<TopAbs_ShapeEnum> aTypes;
+  aTypes << TopAbs_VERTEX << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE;
+  myObj = getSelected( aTypes );
+  if (!myObj) {
+    mySelEdit->setText("");
+    processObject();
+    erasePreview();
+    return;
+  }
+
+  mySelEdit->setText(GEOMBase::GetName(myObj.get()));
+  processObject();
+  redisplayPreview();
+}
index 48fa73f3ee361b1f2f87ca302f59a72550b6fae7..75d46c07bba60d2dfa0d5edadc512fb7397a047c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,8 @@ public:
 protected:
   // redefined from GEOMBase_Helper and MeasureGUI_Skeleton
   virtual void                        processObject();
+  virtual void                        activateSelection();
+  virtual void                        SelectionIntoArgument();
   
 private:
   void                                Init();
index d60cdbfd6478ce1d9eea27dab5b81f29cfdb5323..4618f9c808b1dce56a0985731f035d63b5020862 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -29,6 +29,7 @@
 #include "MeasureGUI_DimensionFilter.h"
 
 #include <GEOMGUI_DimensionProperty.h>
+#include <GEOMGUI_TextTreeWdg.h>
 #include <GEOMUtils.hxx>
 #include <GEOMGUI_OCCSelector.h>
 #include <GEOM_AISDimension.hxx>
@@ -134,7 +135,7 @@ MeasureGUI_ManageDimensionsDlg::MeasureGUI_ManageDimensionsDlg( GeometryGUI* the
   {
     myObjectSelector->PushButton1->click();
   }
-
+  myIsNeedRedisplay = false;
   setHelpFileName("managing_dimensions_page.html");
 }
 
@@ -771,6 +772,8 @@ bool MeasureGUI_ManageDimensionsDlg::ClickOnApply()
 
   mySavedPropertyState.SaveToAttribute( aStudy, myEditObject->GetStudyEntry() );
 
+  myGeomGUI->emitDimensionsUpdated( QString( myEditObject->GetStudyEntry() ) );
+
   return true;
 }
 
@@ -806,7 +809,11 @@ void MeasureGUI_ManageDimensionsDlg::OnFinish()
                              GEOM::propertyName( GEOM::Dimensions ),
                              QVariant() );
 
-  redisplay( myEditObject.get() );
+  if ( myIsNeedRedisplay ) {
+    redisplay( myEditObject.get() );
+  }
+  
+  myGeomGUI->emitDimensionsUpdated( QString( myEditObject->GetStudyEntry() ) );
 }
 
 //=================================================================================
@@ -889,8 +896,8 @@ void MeasureGUI_ManageDimensionsDlg::SetEditObject( const GEOM::GeomObjPtr& theO
 
   if ( myEditObject.isNull() )
   {
+    myDimensionView->TreeWidget->clear();
     myDimensionView->setEnabled( false );
-
     return;
   }
 
@@ -955,8 +962,6 @@ void MeasureGUI_ManageDimensionsDlg::RestoreState()
                              myEditObject->GetStudyEntry(),
                              GEOM::propertyName( GEOM::Dimensions ),
                              QVariant() );
-
-  RedisplayObject();
 }
 
 //=================================================================================
@@ -1107,8 +1112,8 @@ bool MeasureGUI_ManageDimensionsDlg::AllowedToCancelChanges()
                                             tr( "WRN_MSG_CHANGES_LOST" ),
                                             QMessageBox::Ok,
                                             QMessageBox::Cancel );
-
-  return aResponse == QMessageBox::Ok;
+  myIsNeedRedisplay = ( aResponse == QMessageBox::Ok );
+  return myIsNeedRedisplay;
 }
 
 //=================================================================================
index af5ba2c9fda82d7577ba4bc1746956540d392fee..7fd6f0904e69d33f96f9afcaf3df00bf3a55eff5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -114,7 +114,7 @@ private:
 
 private:
   GEOM::GeomObjPtr                myEditObject;
-
+  bool                            myIsNeedRedisplay;
 private:
   DlgRef_1Sel*                    myObjectSelector;
   MeasureGUI_1TreeWidget_4Button* myDimensionView;
index 74ca035f59234d5577ff071c42cdb9642e97e063..6fd821b71851362db856838fb6ee9a1c8fd694a7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -26,6 +26,7 @@
 //
 #include "MeasureGUI_MaxToleranceDlg.h"
 #include "MeasureGUI_Widgets.h"
+#include <GEOMBase.h>
 #include "DlgRef.h"
 
 #include <SUIT_Session.h>
@@ -163,7 +164,7 @@ bool MeasureGUI_MaxToleranceDlg::getParameters( double& theMinFaceToler,
   else {
     GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
     try {
-      anOper->GetTolerance( myObj, 
+      anOper->GetTolerance( myObj.get()
                             theMinFaceToler, theMaxFaceToler,   theMinEdgeToler,
                             theMaxEdgeToler, theMinVertexToler, theMaxVertexToler );
     }
@@ -175,3 +176,32 @@ bool MeasureGUI_MaxToleranceDlg::getParameters( double& theMinFaceToler,
     return anOper->IsDone();
   }
 }
+
+//=================================================================================
+// function : activateSelection()
+// purpose  :
+//=================================================================================
+void MeasureGUI_MaxToleranceDlg::activateSelection()
+{
+  globalSelection( GEOM_ALLSHAPES );
+  localSelection( TopAbs_SHAPE );
+}
+
+void MeasureGUI_MaxToleranceDlg::SelectionIntoArgument()
+{
+  myObj.nullify();
+  QList<TopAbs_ShapeEnum> aTypes;
+  aTypes << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPSOLID << TopAbs_COMPOUND << TopAbs_SHAPE;
+  myObj = getSelected( aTypes );
+  if (!myObj) {
+    mySelEdit->setText("");
+    processObject();
+    erasePreview();
+    return;
+  }
+
+  mySelEdit->setText(GEOMBase::GetName(myObj.get()));
+  processObject();
+  redisplayPreview();
+}
index c225d6efa3fd7e860dc100f0cfd2a63f31580ad6..ce8cbfe55693a6fb23eadccb4b6139ced40d89e3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -46,9 +46,11 @@ public:
 protected:
   // redefined from GEOMBase_Helper and MeasureGUI_Skeleton
   virtual void                        processObject();
+  virtual void                        SelectionIntoArgument();
 
 private:
   void                                Init();
+  void                                activateSelection();
   bool                                getParameters( double&, double&, double&, 
                                                      double&, double&, double& );
   
index 53a5c31995adcd200de804860bd2c33dda366e8d..f2df1b3d342158de5080729a0833a9b4922be9f9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -267,7 +267,7 @@ void MeasureGUI_NormaleDlg::SetEditCurrentArgument()
     GroupArgs->PushButton2->setDown(false);
     GroupArgs->LineEdit2->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE);
+    localSelection(TopAbs_FACE);
   }
   else if (send == GroupArgs->PushButton2) {
     myEditCurrentArgument = GroupArgs->LineEdit2;
@@ -275,7 +275,7 @@ void MeasureGUI_NormaleDlg::SetEditCurrentArgument()
     GroupArgs->PushButton1->setDown(false);
     GroupArgs->LineEdit1->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -360,3 +360,15 @@ bool MeasureGUI_NormaleDlg::execute (ObjectList& objects)
 
   return true;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> MeasureGUI_NormaleDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr1(myFace), aGeomObjPtr2(myPoint);
+  res << aGeomObjPtr1 << aGeomObjPtr2;
+  return res;
+}
index c7fe1337c94234991167ee875b6dff58561b5e3b..21fc640dcbb0e0733fd931a1b3dd07ccf48a2822 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -45,6 +45,7 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 245bc0a1300cafbb331a992f2fd6ee5fe9727956..d2acb6e3e2cb83391e202b10cddc9d60ad28bb46 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -112,7 +112,7 @@ void MeasureGUI_PointDlg::Init()
 //=================================================================================
 void MeasureGUI_PointDlg::activateSelection()
 {
-  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+  localSelection( TopAbs_VERTEX );
 }
 
 //=================================================================================
@@ -122,7 +122,7 @@ void MeasureGUI_PointDlg::activateSelection()
 void MeasureGUI_PointDlg::SelectionIntoArgument()
 {
   try {
-    myObj = GEOM::GEOM_Object::_nil();
+    myObj.nullify();
     myGrp->LineEdit1->setText( "" );
     myGrp->LineEdit2->setText( "" );
     myGrp->LineEdit3->setText( "" );
@@ -135,23 +135,20 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
     if (aSelList.Extent() < 1)
       return;
 
-    GEOM::GEOM_Object_var aSelectedObject =
-      GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
+    myObj = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
 
-    if ( aSelectedObject->_is_nil() )
+    if ( !myObj )
       return;
 
-    myObj = aSelectedObject;
-
     TColStd_IndexedMapOfInteger anIndexes;
     aSelMgr->GetIndexes(aSelList.First(), anIndexes);
 
     TopoDS_Shape aShape;
-    if ( anIndexes.Extent() > 1 || !GEOMBase::GetShape( myObj, aShape ) || aShape.IsNull() )
+    if ( anIndexes.Extent() > 1 || !GEOMBase::GetShape( myObj.get(), aShape ) || aShape.IsNull() )
       return;
 
     TopoDS_Vertex aPoint;
-    QString aName = GEOMBase::GetName( myObj );
+    QString aName = GEOMBase::GetName( myObj.get() );
     if ( anIndexes.Extent() == 0 ) {
       if ( aShape.ShapeType() == TopAbs_VERTEX )
         aPoint = TopoDS::Vertex( aShape );
@@ -180,7 +177,7 @@ void MeasureGUI_PointDlg::SelectionIntoArgument()
   }
   catch( ... )
   {
-    myObj = GEOM::GEOM_Object::_nil();
+    myObj.nullify();
     myGrp->LineEdit1->setText( "" );
     myGrp->LineEdit2->setText( "" );
     myGrp->LineEdit3->setText( "" );
index 124f03de89a3d15585ebcf38bcfb60ad6bd5bd17..bf4128127d89c2f914987f71267284642e3f9201 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 9b850db9777f9c6a33a0d13c351ea1ab38d21b42..ecaa437ba2fc96d62ad4cead7f738e5455b13bf1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -122,8 +122,30 @@ void MeasureGUI_PropertiesDlg::activateSelection()
   }
 
   globalSelection( aTypes );
+
+  std::list<int> needTypes;
+  needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE ), needTypes.push_back( TopAbs_FACE ), needTypes.push_back( TopAbs_SHELL ), needTypes.push_back( TopAbs_SOLID ), needTypes.push_back( TopAbs_COMPOUND );
+  localSelection( needTypes );
 }
 
+void MeasureGUI_PropertiesDlg::SelectionIntoArgument()
+{
+  myObj.nullify();
+  QList<TopAbs_ShapeEnum> aTypes;
+  aTypes << TopAbs_EDGE << TopAbs_WIRE << TopAbs_FACE << TopAbs_SHELL << TopAbs_SOLID << TopAbs_COMPOUND;
+  myObj = getSelected( aTypes );
+  if (!myObj) {
+    mySelEdit->setText("");
+    processObject();
+    erasePreview();
+    return;
+  }
+
+  mySelEdit->setText(GEOMBase::GetName(myObj.get()));
+  processObject();
+  redisplayPreview();
+}
 //=================================================================================
 // function : processObject
 // purpose  :
@@ -155,12 +177,12 @@ bool MeasureGUI_PropertiesDlg::getParameters( double& theLength,
                                               double& theArea,
                                               double& theVolume )
 {
-  if ( myObj->_is_nil() )
+  if ( !myObj )
     return false;
   else {
     GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
     try {
-      anOper->GetBasicProperties( myObj, theLength, theArea, theVolume );
+      anOper->GetBasicProperties( myObj.get(), theLength, theArea, theVolume );
     }
     catch( const SALOME::SALOME_Exception& e ) {
       SalomeApp_Tools::QtCatchCorbaException( e );
@@ -180,8 +202,8 @@ SALOME_Prs* MeasureGUI_PropertiesDlg::buildPrs()
   SALOME_Prs* prs = 0;
   TopoDS_Shape shape;
 
-  if ( GEOMBase::GetShape( myObj, shape, TopAbs_EDGE ) &&
-       getDisplayer()->IsDisplayed( GEOMBase::GetEntry(myObj) ) ) {
+  if ( GEOMBase::GetShape( myObj.get(), shape, TopAbs_EDGE ) &&
+       getDisplayer()->IsDisplayed( GEOMBase::GetEntry(myObj.get()) ) ) {
     shape = GEOMBase::CreateArrowForLinearEdge( shape );
     if ( !shape.IsNull() )
       prs = getDisplayer()->BuildPrs( shape );
index 4911b4c18bb1536ff4dd536d5f9e4fbd0884c495..27598f9bf24707bc5acf9a13f1d70dcd2b0d213b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -48,6 +48,7 @@ protected:
   // redefined from GEOMBase_Helper and MeasureGUI_Skeleton
   virtual void                        processObject();
   virtual void                        activateSelection();
+  virtual void                        SelectionIntoArgument();
   virtual SALOME_Prs*                 buildPrs();
 
 private:
diff --git a/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.cxx b/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.cxx
new file mode 100644 (file)
index 0000000..681c0ba
--- /dev/null
@@ -0,0 +1,533 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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
+//
+
+// File   : MeasureGUI_ShapeStatisticsDlg.cxx
+// Author : Alexander KOVALEV, OPEN CASCADE S.A.S.
+
+// internal includes
+#include "MeasureGUI_ShapeStatisticsDlg.h"
+
+// GEOM includes
+#include <GEOMBase.h>
+#include <GEOMUtils_ShapeStatistics.hxx>
+#include <GeometryGUI.h>
+#include <DlgRef.h>
+
+// GUI includes
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_ViewWindow.h>
+
+#include <LightApp_SelectionMgr.h>
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_Study.h>
+
+#include <Plot2d_Histogram.h>
+#include <Plot2d_ViewFrame.h>
+#include <Plot2d_ViewModel.h>
+#include <Plot2d_ViewWindow.h>
+
+// Qt includes
+#include <QIcon>
+#include <QGridLayout>
+#include <QPushButton>
+#include <QLabel>
+
+// Qtx includes
+#include <QtxValidator.h>
+
+// OCC includes
+#include <TopoDS_Shape.hxx>
+
+#include <GEOMImpl_Types.hxx>
+
+//===========================================================================
+// class    : MeasureGUI_ShapeStatisticsDlg()
+//===========================================================================
+MeasureGUI_ShapeStatisticsDlg::MeasureGUI_ShapeStatisticsDlg( QWidget* parent, TopoDS_Shape aShape, TopAbs_ShapeEnum aSubShapeType )
+  : GEOMBase_Helper( SUIT_Session::session()->activeApplication()->desktop() ),
+    QDialog( parent ),
+    myHistogram ( 0 )
+{
+  myShapes.push_back( aShape );
+
+  QIcon iconSelect( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+
+  setWindowTitle( tr( "GEOM_SHAPE_STATISTICS" ) );
+  setAttribute( Qt::WA_DeleteOnClose );
+
+  myApp = dynamic_cast< SalomeApp_Application* >( SUIT_Session::session()->activeApplication() );
+
+  QVBoxLayout* topLayout = new QVBoxLayout( this );
+
+  QGridLayout* settingsLayout = new QGridLayout();
+
+  /**********************   Selected Objects    **********************/
+
+  QLabel* objsLabel = new QLabel( tr( "GEOM_SELECTED_OBJECTS" ), this );
+  QPushButton* selBtn = new QPushButton( this );
+  selBtn->setIcon( iconSelect );
+  myEditMainShape = new QLineEdit( this );
+  myEditMainShape->setReadOnly(true);
+
+  settingsLayout->addWidget( objsLabel, 0, 0 );
+  settingsLayout->addWidget( selBtn, 0, 1 );
+  settingsLayout->addWidget( myEditMainShape, 0, 2 );
+
+  if ( !aShape.IsNull() ) {
+    objsLabel->hide();
+    selBtn->hide();
+    myEditMainShape->hide();
+  }
+
+  /**********************   Type    **********************/
+
+  QLabel* typeLabel = new QLabel( tr( "GEOM_SHAPE_STATISTICS_TYPE" ), this );
+  myCBTypes = new QtxComboBox( this );
+  myCBTypes->setCleared( true );
+  if ( aSubShapeType != TopAbs_SHAPE ) {
+    fillTypes( aSubShapeType == TopAbs_EDGE, 
+              aSubShapeType == TopAbs_FACE, 
+              aSubShapeType == TopAbs_SOLID );
+    myCBTypes->setEnabled( false );
+  }
+
+  settingsLayout->addWidget( typeLabel, 1, 0 );
+  settingsLayout->addWidget( myCBTypes, 1, 2 );
+
+  /**********************   Number of intervals    **********************/
+
+  QLabel* nbIntervalsLabel = new QLabel( tr( "GEOM_SHAPE_STATISTICS_NB_INTERVALS" ), this );
+  myNbIntervals = new QtxIntSpinBox( 1, 1000, 1, this );
+  myNbIntervals->setValue( 10 );
+
+  settingsLayout->addWidget( nbIntervalsLabel, 2, 0 );
+  settingsLayout->addWidget( myNbIntervals, 2, 2 );
+
+  /**********************   Scalar Range    **********************/
+
+  myScalarRangeBox = new QGroupBox( tr( "GEOM_SHAPE_STATISTICS_SCALAR_RANGE" ), this );
+  myScalarRangeBox->setCheckable( true );
+  myScalarRangeBox->setChecked( false );
+  QLabel* minLabel = new QLabel( tr( "GEOM_SHAPE_STATISTICS_MIN" ), this );
+  myMin = new QLineEdit( this );
+  QtxDoubleValidator* aValid = new QtxDoubleValidator( this );
+  aValid->setBottom( 0.0 );
+  myMin->setValidator( aValid );
+  QLabel* maxLabel = new QLabel( tr( "GEOM_SHAPE_STATISTICS_MAX" ), this );
+  myMax = new QLineEdit( this );
+  myMax->setValidator( aValid );
+  
+  QPushButton* buttonCompute = new QPushButton( tr( "GEOM_SHAPE_STATISTICS_COMPUTE" ), this );
+  connect( buttonCompute, SIGNAL( clicked() ), this, SLOT( clickOnCompute() ) );
+
+  QGridLayout* scalarRangeLayout = new QGridLayout();
+  scalarRangeLayout->setMargin( 11 ); settingsLayout->setSpacing( 6 );
+
+  scalarRangeLayout->addWidget( minLabel, 0, 0 );
+  scalarRangeLayout->addWidget( myMin,    0, 1 );
+  scalarRangeLayout->addWidget( maxLabel, 1, 0 );
+  scalarRangeLayout->addWidget( myMax,    1, 1 );
+  scalarRangeLayout->addWidget( buttonCompute, 0, 2, 2, 1 );
+
+  myScalarRangeBox->setLayout( scalarRangeLayout );
+
+  /**********************   Buttons    **********************/
+
+  myButtonPlot   = new QPushButton( tr( "GEOM_PLOT_DISTRIBUTION" ), this );
+  myButtonPlot->setDefault( true );
+  myButtonCreateGr = new QPushButton( tr( "GEOM_SHAPE_STATISTICS_CREATE_GROUPS" ), this );
+  QPushButton* buttonClose  = new QPushButton( tr( "GEOM_BUT_CLOSE" ), this );
+  QPushButton* buttonHelp   = new QPushButton( tr( "GEOM_BUT_HELP" ), this );
+
+  QHBoxLayout* buttonsLayout = new QHBoxLayout();
+  buttonsLayout->addWidget( myButtonPlot );
+  buttonsLayout->addWidget( myButtonCreateGr );
+  buttonsLayout->addWidget( buttonClose );
+  buttonsLayout->addWidget( buttonHelp );
+
+  if ( !aShape.IsNull() ) {
+    myButtonCreateGr->hide();
+  }
+  /**********************   Layouting    **********************/
+
+  topLayout->addLayout( settingsLayout );
+  topLayout->addWidget( myScalarRangeBox );
+  topLayout->addLayout( buttonsLayout );
+
+  // Signals and slots connections
+
+  connect( selBtn, SIGNAL( clicked() ), this, SLOT( onEditMainShape() ) );
+
+  connect( myButtonPlot,     SIGNAL( clicked() ), this, SLOT( clickOnPlot() ) );
+  connect( myButtonCreateGr, SIGNAL( clicked() ), this, SLOT( clickOnCreateGroups() ) );
+
+  connect( buttonClose,    SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( buttonHelp,     SIGNAL( clicked() ), this, SLOT( clickOnHelp() ) );
+
+  connect(myApp->selectionMgr(),
+          SIGNAL(currentSelectionChanged()), this, SLOT(onEditMainShape()));
+
+  if ( aShape.IsNull() )
+    onEditMainShape();
+}
+
+//===========================================================================
+// function : ~MeasureGUI_ShapeStatisticsDlg()
+// purpose  : Destroys the object and frees any allocated resources
+//===========================================================================
+MeasureGUI_ShapeStatisticsDlg::~MeasureGUI_ShapeStatisticsDlg()
+{
+}
+
+//=================================================================================
+// function : createOperation
+// purpose  :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr MeasureGUI_ShapeStatisticsDlg::createOperation()
+{
+  return getGeomEngine()->GetIGroupOperations(getStudyId());
+}
+
+#define RETURN_WITH_MSG(a, b) \
+  if (!(a)) { \
+    theMessage += (b); \
+    return false; \
+  }
+
+//================================================================
+// Function : getFather
+// Purpose  : Get father object for object to be added in study
+//            (called with addInStudy method)
+//================================================================
+GEOM::GEOM_Object_ptr MeasureGUI_ShapeStatisticsDlg::getFather(GEOM::GEOM_Object_ptr theObj)
+{
+  GEOM::GEOM_Object_var aFatherObj;
+  if (theObj->GetType() == GEOM_GROUP) {
+    GEOM::GEOM_IGroupOperations_var anOper = GEOM::GEOM_IGroupOperations::_narrow(getOperation());
+    aFatherObj = anOper->GetMainShape(theObj);
+  }
+  return aFatherObj._retn();
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> MeasureGUI_ShapeStatisticsDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myMainObj;
+  return res;
+}
+
+//=================================================================================
+// function : onEditMainShape()
+// purpose  : called when selection button was clicked
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::onEditMainShape()
+{
+  // restore initial parameters for dialog box
+  myEditMainShape->setText("");
+  myEditMainShape->setFocus();
+
+  //get shapes from selection
+  QList<GEOM::GeomObjPtr> selShapes = getSelected( TopAbs_SHAPE, -1 );
+
+  myButtonPlot->setEnabled( !selShapes.isEmpty() );
+  myButtonCreateGr->setEnabled( selShapes.count() == 1 );
+
+  if ( !selShapes.isEmpty() ) {
+    if ( selShapes.count() == 1 )
+      myMainObj = selShapes[0];
+    QString aName = selShapes.count() > 1 ? QString( "%1_objects").arg( selShapes.count() ) : GEOMBase::GetName( myMainObj.get() );
+    myEditMainShape->setText( aName );
+  }
+
+  updateTypes( selShapes );
+}
+
+//=================================================================================
+// function : currentType()
+// purpose  : returns currently selected type of shapes in 'Type' combobox
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::fillTypes( bool hasEdges, bool hasFaces, bool hasSolids )
+{
+  if ( hasEdges )
+    myCBTypes->addItem( tr("GEOM_SHAPE_STATISTICS_LENGTH"), (int)TopAbs_EDGE );
+  if ( hasFaces )
+    myCBTypes->addItem( tr("GEOM_SHAPE_STATISTICS_AREA"), (int)TopAbs_FACE );
+  if ( hasSolids )
+    myCBTypes->addItem( tr("GEOM_SHAPE_STATISTICS_VOLUME"), (int)TopAbs_SOLID );
+
+  myCBTypes->setEnabled( myCBTypes->count() > 0 );
+}
+
+//=================================================================================
+// function : updateTypes()
+// purpose  : update 'Type' combobox with available types
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::updateTypes( QList<GEOM::GeomObjPtr> theShapes )
+{
+  myCBTypes->clear();
+  myCBTypes->setEnabled( false );
+
+  int hasEdges = -1, hasFaces = -1, hasSolids = -1;
+
+  myShapes.clear();
+  // get types of the shapes and its sub-shapes
+  foreach( GEOM::GeomObjPtr aShapePtr, theShapes ) {
+    if ( !aShapePtr )
+      return;
+
+    TopoDS_Shape aShape;
+    if ( !GEOMBase::GetShape( aShapePtr.get(), aShape ) || aShape.IsNull() )
+      return;
+
+    myShapes.push_back( aShape );
+
+    GEOM::ListOfLong_var aSubShapes;
+    GEOM::GEOM_IShapesOperations_var aShOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+    if ( hasEdges != 0 )
+      hasEdges = aShOp->NumberOfSubShapes( aShapePtr.get(), TopAbs_EDGE ) > 0;
+    if ( hasFaces != 0 )
+      hasFaces = aShOp->NumberOfSubShapes( aShapePtr.get(), TopAbs_FACE ) > 0;
+    if ( hasSolids != 0 )
+      hasSolids = aShOp->NumberOfSubShapes( aShapePtr.get(), TopAbs_SOLID ) > 0;
+  }
+  fillTypes( hasEdges, hasFaces, hasSolids );
+}
+
+//=================================================================================
+// function : currentType()
+// purpose  : returns currently selected type of shapes in 'Type' combobox
+//=================================================================================
+TopAbs_ShapeEnum MeasureGUI_ShapeStatisticsDlg::currentType()
+{
+  return (TopAbs_ShapeEnum)( myCBTypes->itemData( myCBTypes->currentIndex() ).toInt() );
+}
+
+//=================================================================================
+// function : clickOnPlot()
+// purpose  : called when Plot button was clicked
+//=================================================================================
+bool MeasureGUI_ShapeStatisticsDlg::isValid(QString& theMessage)
+{
+  if ( myScalarRangeBox->isChecked() ) {
+    RETURN_WITH_MSG( !myMin->text().isEmpty(), tr("GEOM_SHAPE_STATISTICS_MIN_ERROR") )
+    RETURN_WITH_MSG( !myMax->text().isEmpty(), tr("GEOM_SHAPE_STATISTICS_MAX_ERROR") )
+    RETURN_WITH_MSG( myMin->text().toDouble() <= myMax->text().toDouble(), tr("GEOM_SHAPE_STATISTICS_MIN_MAX_ERROR") )
+  }
+  return true;
+}
+//=================================================================================
+// function : clickOnPlot()
+// purpose  : called when Plot button was clicked
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::clickOnPlot()
+{
+  GEOMUtils::Range aRange;
+  if ( myScalarRangeBox->isChecked() ) {
+    QString msg;
+    if ( !isValid( msg ) ) {
+      showError( msg );
+      return;
+    }
+    aRange.min = myMin->text().toDouble();
+    aRange.max = myMax->text().toDouble();
+  } else {
+    aRange.min = -1.0; // flag that range is empty
+    aRange.max = -1.0; // flag that range is empty
+  }
+
+  GEOMUtils::Distribution aShapesDistr = 
+    GEOMUtils::ComputeDistribution( myShapes, currentType(), myNbIntervals->value(), aRange );
+
+  QList<double> xVals, yVals;
+  double width = -1, min = -1;
+  double xmin = 1e+32, xmax = 0.0, ymax = 0.0;
+  int i=0;
+  GEOMUtils::Distribution::const_iterator it;
+  for (it = aShapesDistr.begin(); it != aShapesDistr.end(); it++) {
+    GEOMUtils::Range ran = *it;
+    if ( width < 0 ) width = ran.max - ran.min; // bar width
+    if ( min < 0 ) min = ran.min; // global min
+    xVals << width / 2. + i*width + min; // get a middle of bar
+    yVals << ran.count;
+    // get global boundary max values
+    if ( ran.min < xmin ) xmin = ran.min;
+    if ( ran.max > xmax ) xmax = ran.max;
+    if ( ran.count > ymax ) ymax = ran.count;
+    i++;
+  }
+
+  // plot the computed distribution
+  SUIT_ViewManager* aViewManager = myApp->getViewManager( Plot2d_Viewer::Type(), true ); // create if necessary
+  if( !aViewManager )
+    return;
+  Plot2d_ViewWindow* aViewWnd = dynamic_cast<Plot2d_ViewWindow*>(aViewManager->getActiveView());
+  if( !aViewWnd )
+    return;
+  Plot2d_ViewFrame* aPlot = aViewWnd->getViewFrame();
+  if ( !aPlot )
+    return;
+
+  aPlot->EraseAll();
+
+  // create or reuse histogram
+  if( !myHistogram )
+    myHistogram = new Plot2d_Histogram();
+  else
+    myHistogram->clearAllPoints();
+  // set histogram parameters
+  myHistogram->setData( xVals, yVals );
+  if ( width != 0.0 )
+    myHistogram->setWidth( width );
+  myHistogram->setAutoAssign(true);
+  myHistogram->setName( myEditMainShape->text() );
+  myHistogram->setHorTitle( myCBTypes->currentText() );
+  myHistogram->setVerTitle( tr("GEOM_SHAPE_STATISTICS_DISTRIBUTION_NB_ENT") );
+  myHistogram->setColor( QColor(0, 85, 0) );
+  // display histogram
+  aPlot->displayObject( myHistogram, true );
+  if ( width == 0.0 ) // only one X value
+    aPlot->fitAll();
+  else
+    aPlot->fitData( 0, xmin, xmax, 0.0, ymax );
+}
+
+//=================================================================================
+// function : clickOnCompute()
+// purpose  : called when Compute button was clicked
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::clickOnCompute()
+{
+  GEOMUtils::Range aRange;
+  aRange.min = -1.0; // flag that range is empty
+  aRange.max = -1.0; // flag that range is empty
+  std::map<int,double> measures = GEOMUtils::ComputeMeasures( myShapes, currentType(), aRange );
+  if ( measures.size() != 0 ) {
+    SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+    int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
+    myMin->setText( DlgRef::PrintDoubleValue( aRange.min, aPrecision ) );
+    myMax->setText( DlgRef::PrintDoubleValue( aRange.max, aPrecision ) );
+  }
+}
+
+//=================================================================================
+// function : clickOnCreateGroups()
+// purpose  : called when Create Groups button was clicked
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::clickOnCreateGroups()
+{
+  onAccept(false, false, false);
+}
+
+//=================================================================================
+// function : execute(ObjectList& objects)
+// purpose  : 
+//=================================================================================
+bool MeasureGUI_ShapeStatisticsDlg::execute(ObjectList& objects)
+{
+  if ( myMainObj.isNull() )
+    return false;
+
+  GEOM::GroupOpPtr anOper = GEOM::GEOM_IGroupOperations::_narrow(getOperation());
+
+  GEOMUtils::Range aRange;
+  if ( myScalarRangeBox->isChecked() ) {
+    QString msg;
+    if ( !isValid( msg ) ) {
+      showError( msg );
+      return false;
+    }
+    aRange.min = myMin->text().toDouble();
+    aRange.max = myMax->text().toDouble();
+  } else {
+    aRange.min = -1.0; // flag that range is empty
+    aRange.max = -1.0; // flag that range is empty
+  }
+
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  int aPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
+  QString aTypePrefix = myCBTypes->currentText().replace(' ', '_');
+  QString objIOR, aMin, aMax, aGroupName;
+  SalomeApp_Study* study = getStudy();
+
+  GEOMUtils::Distribution aShapesDistr = 
+    GEOMUtils::ComputeDistribution( myShapes, currentType(), myNbIntervals->value(), aRange );
+
+  int nbGroups = 0;
+
+  GEOMUtils::Distribution::const_iterator it;
+  for (it = aShapesDistr.begin(); it != aShapesDistr.end(); it++) {
+    std::list<long> idList = (*it).indices;
+    int nn = idList.size();
+    if ( nn > 0 ) {
+      GEOM::ListOfLong_var aNewList = new GEOM::ListOfLong;
+      aNewList->length(nn);
+      int ii = 0;
+      std::list<long>::const_iterator id_it;
+      for ( id_it = idList.begin(); id_it != idList.end(); id_it++ ) {
+       aNewList[ii++] = *id_it;
+      }
+
+      // Create an empty group
+      GEOM::GEOM_Object_var aGroup;
+      aGroup = anOper->CreateGroup( myMainObj.get(), currentType() );
+
+      if (CORBA::is_nil(aGroup) || !anOper->IsDone())
+       return false;
+
+      // Add sub-shapes into group
+      anOper->UnionIDs(aGroup, aNewList);
+      if (!anOper->IsDone())
+       return false;
+
+      // publish group
+      aMin = DlgRef::PrintDoubleValue( (*it).min, aPrecision );
+      aMax = DlgRef::PrintDoubleValue( (*it).max, aPrecision );
+      aGroupName =  aTypePrefix + "_" + aMin + "_" + aMax;
+      GEOMBase::PublishSubObject( aGroup, aGroupName );
+
+      // this is needed just to avoid error message
+      objects.push_back(aGroup._retn());
+
+      nbGroups++;
+    }
+  }
+
+  SUIT_MessageBox::information( this, tr( "INF_INFO" ), tr( "GEOM_MSG_GROUPS_CREATED" ).arg( nbGroups ) );
+
+  return true;
+}
+
+//=================================================================================
+// function : clickOnHelp()
+// purpose  : called when Help button was clicked
+//=================================================================================
+void MeasureGUI_ShapeStatisticsDlg::clickOnHelp()
+{
+  GeometryGUI* aGeomGUI = dynamic_cast<GeometryGUI*>( myApp->module( "Geometry" ) );
+  myApp->onHelpContextModule( aGeomGUI ? myApp->moduleName( aGeomGUI->moduleName() ) : QString(""), "shape_statistics_operation_page.html" );
+}
diff --git a/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.h b/src/MeasureGUI/MeasureGUI_ShapeStatisticsDlg.h
new file mode 100644 (file)
index 0000000..8b604a2
--- /dev/null
@@ -0,0 +1,93 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : MeasureGUI_ShapeStatisticsDlg.h
+// Author : Alexander KOVALEV, Open CASCADE (alexander.kovalev@opencascade.com)
+//
+#ifndef MEASUREGUI_SHAPESTATISTICSDLG_H
+#define MEASUREGUI_SHAPESTATISTICSDLG_H
+
+// GEOM includes
+#include <GEOMBase_Helper.h>
+#include "GEOM_GenericObjPtr.h"
+#include "MeasureGUI_definitions.h"
+
+// Qt includes
+#include <QDialog>
+#include <QLineEdit>
+#include <QPointer>
+#include <QGroupBox>
+
+// Qtx includes
+#include <QtxIntSpinBox.h>
+#include <QtxComboBox.h>
+
+class Plot2d_Histogram;
+
+//==========================================================================
+// class    : MeasureGUI_ShapeStatisticsDlg
+// purpose  :
+//==========================================================================
+
+class MEASUREGUI_EXPORT MeasureGUI_ShapeStatisticsDlg : public QDialog, public GEOMBase_Helper
+{
+  Q_OBJECT
+
+public:
+  MeasureGUI_ShapeStatisticsDlg( QWidget*, TopoDS_Shape aShape = TopoDS_Shape(), TopAbs_ShapeEnum aSubShapeType = TopAbs_SHAPE );
+  ~MeasureGUI_ShapeStatisticsDlg();
+  
+protected:
+  // redefined from GEOMBase_Helper
+  virtual GEOM::GEOM_IOperations_ptr  createOperation();
+  virtual bool                        isValid (QString&);
+  virtual bool                        execute (ObjectList&);
+  virtual GEOM::GEOM_Object_ptr       getFather (GEOM::GEOM_Object_ptr);
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
+
+private slots:
+  void                    onEditMainShape();
+  void                    clickOnCompute();
+  void                    clickOnPlot();
+  void                    clickOnCreateGroups();
+  void                    clickOnHelp();
+  
+private:
+  void                    fillTypes( bool, bool, bool );
+  void                    updateTypes( QList<GEOM::GeomObjPtr> theShapes );
+  TopAbs_ShapeEnum        currentType();
+
+private:
+  SalomeApp_Application*     myApp;
+  QLineEdit*                 myEditMainShape;
+  QtxComboBox*               myCBTypes;
+  std::list<TopoDS_Shape>    myShapes;
+  GEOM::GeomObjPtr           myMainObj;
+  QtxIntSpinBox*             myNbIntervals;
+  QGroupBox*                 myScalarRangeBox;
+  QLineEdit*                 myMin;
+  QLineEdit*                 myMax;
+  QPushButton*               myButtonPlot;
+  QPushButton*               myButtonCreateGr;
+  Plot2d_Histogram*          myHistogram;
+
+};
+
+#endif // MEASUREGUI_SHAPESTATISTICSDLG_H
index 1a5943a07aa62489dff95c083986240b3995bc4c..50667f49105a92749ac9589d1f1093b6e73b0d1c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -245,27 +245,24 @@ void MeasureGUI_Skeleton::SetEditCurrentArgument()
 //=================================================================================
 void MeasureGUI_Skeleton::SelectionIntoArgument()
 {
-  myObj = GEOM::GEOM_Object::_nil();
+  myObj.nullify();
 
   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
   SALOME_ListIO aSelList;
   aSelMgr->selectedObjects(aSelList);
 
-  GEOM::GEOM_Object_var aSelectedObject = GEOM::GEOM_Object::_nil();
-
   if (aSelList.Extent() > 0) {
-    aSelectedObject = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
+    myObj = GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
   }
 
-  if (aSelectedObject->_is_nil()) {
+  if ( !myObj ) {
     mySelEdit->setText("");
     processObject();
     erasePreview();
     return;
   }
 
-  myObj = aSelectedObject;
-  mySelEdit->setText(GEOMBase::GetName(myObj));
+  mySelEdit->setText(GEOMBase::GetName(myObj.get()));
   processObject();
   redisplayPreview();
 }
@@ -327,7 +324,7 @@ void MeasureGUI_Skeleton::redisplayPreview()
   erasePreview( false );
 
   try {
-    SUIT_OverrideCursor();
+    SUIT_OverrideCursor wc;
 
     getDisplayer()->SetColor( Quantity_NOC_VIOLET );
     getDisplayer()->SetToActivate( false );
@@ -356,7 +353,7 @@ void MeasureGUI_Skeleton::activateSelection()
 //=================================================================================
 bool MeasureGUI_Skeleton::isValid( QString& )
 {
-  return !myObj->_is_nil();
+  return myObj;
 }
 
 //================================================================
index a12b40bf322b36b938bb0008ec39c33998c3ea9d..5dd720929d4887abf81b808ab63c18b82a4ec4c7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -77,7 +77,7 @@ protected:
 protected:    
   QPushButton*                       mySelBtn;
   QLineEdit*                         mySelEdit;
-  GEOM::GEOM_Object_var              myObj;
+  GEOM::GeomObjPtr                   myObj;
   
   GeometryGUI*                       myGeomGUI;
   GEOM_Displayer*                    myDisplayer;
index 7d7fc2baa12a530455a6adb2e5a1ad730a87ed90..7b331751c49da51cdf31c436f23639743f30e12d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -121,13 +121,9 @@ MeasureGUI_WhatisDlg::MeasureGUI_WhatisDlg( GeometryGUI* GUI, QWidget* parent )
   myGrp->LineEdit1->setReadOnly( true );
 
   myGrp->TextEdit1->setReadOnly( true );
-  // fix height to fit all text
-  myGrp->TextEdit1->setLineWrapMode( QTextEdit::NoWrap );
-  // myGrp->TextEdit1->setTextFormat( Qt::PlainText ); // VSR : TODO
-  QString allLines ("\n\n\n\n\n\n\n\n\n"); // 10 lines
-  myGrp->TextEdit1->setText( allLines );
-  int sbHeight = myGrp->TextEdit1->horizontalScrollBar()->height();
-  myGrp->TextEdit1->setFixedHeight( myGrp->TextEdit1->document()->size().height() + sbHeight );
+  myGrp->TextEdit1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Expanding ) );
+  QFontMetrics fm( myGrp->TextEdit1->font() );
+  myGrp->TextEdit1->setMinimumHeight( fm.height()*20 );
 
   myGrp->TextLabel2->setText( tr( "GEOM_KIND_OF_SHAPE" ) );
   myGrp->LineEdit2->setReadOnly( true );
@@ -191,6 +187,16 @@ void MeasureGUI_WhatisDlg::processObject()
   myParamsDlg->adjustSize();
 }
 
+//=================================================================================
+// function : activateSelection()
+// purpose  :
+//=================================================================================
+void MeasureGUI_WhatisDlg::activateSelection()
+{
+  globalSelection(); // all types of objects
+  localSelection(TopAbs_SHAPE); // all types of sub-shapes
+}
+
 //=================================================================================
 // function : ClickOnProperties()
 // purpose  :
@@ -206,13 +212,13 @@ void MeasureGUI_WhatisDlg::ClickOnProperties()
 //=================================================================================
 bool MeasureGUI_WhatisDlg::getParameters( QString& theText )
 {
-  if ( myObj->_is_nil() )
+  if ( !myObj )
     return false;
 
   GEOM::GEOM_IMeasureOperations_var anOper = GEOM::GEOM_IMeasureOperations::_narrow( getOperation() );
   try
   {
-    theText = anOper->WhatIs( myObj );
+    theText = anOper->WhatIs( myObj.get() );
   }
   catch( const SALOME::SALOME_Exception& e )
   {
@@ -235,7 +241,7 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
   int aLenPrecision = resMgr->integerValue( "Geometry", "length_precision", 6 );
 
-  if ( myObj->_is_nil() )
+  if ( !myObj )
     return aKindStr;
 
   GEOM::GEOM_IKindOfShape::shape_kind aKind;
@@ -246,7 +252,7 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
 
   try
   {
-    aKind = anOper->KindOfShape( myObj, anInts, aDbls );
+    aKind = anOper->KindOfShape( myObj.get(), anInts, aDbls );
   }
   catch( const SALOME::SALOME_Exception& e ) {
     SalomeApp_Tools::QtCatchCorbaException( e );
@@ -256,7 +262,9 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
   if ( !anOper->IsDone() )
     return aKindStr;
 
-#define PRINT_DOUBLE(val, tol) DlgRef::PrintDoubleValue( val, tol )
+#define PRINT_DOUBLE(val, tol) QString(" %1").arg( DlgRef::PrintDoubleValue( val, tol ) )
+#define TITLE(val) QString("<b>%1</b>").arg(tr(val))
+#define TITLE_I(val, i) QString("<b>%1</b>").arg(tr(val).arg(i))
   switch ( aKind )
   {
   case GEOM::GEOM_IKindOfShape::COMPOUND:
@@ -286,85 +294,85 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
   // SOLIDs
   case GEOM::GEOM_IKindOfShape::SPHERE:
     aKindStr = tr( "GEOM_SPHERE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )       + PRINT_DOUBLE( aDbls[3], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[3], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::CYLINDER:
     aKindStr = tr( "GEOM_CYLINDER" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )         +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )       + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_HEIGHT" )       + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )        +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_HEIGHT" )         + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::BOX:
     aKindStr = tr( "GEOM_BOX" );
-    theParameters = tr( "GEOM_CENTER") +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        "Ax :"                    + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        "Ay :"                    + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        "Az :"                    + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + "Ax :"                      + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + "Ay :"                      + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + "Az :"                      + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::ROTATED_BOX:
     aKindStr = tr( "GEOM_BOX" );
-    theParameters = tr( "GEOM_CENTER" )         +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\nZ Axis:"                               +
-      "\n" +        "Zx :"                      + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        "Zy :"                      + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        "Zz :"                      + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\nX Axis:"                               +
-      "\n" +        tr( "GEOM_X_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
-      "\nDimensions along local axes:"          +
-      "\n" +        "Ax :"                      + PRINT_DOUBLE( aDbls[9],  aLenPrecision ) +
-      "\n" +        "Ay :"                      + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
-      "\n" +        "Az :"                      + PRINT_DOUBLE( aDbls[11], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_Z_AXIS")       +
+      "<br>" + tr( "GEOM_Z_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_X_AXIS")       +
+      "<br>" + tr( "GEOM_X_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIM_AXES")     +
+      "<br>" + tr( "GEOM_A_I" ).arg( "x" ) + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
+      "<br>" + tr( "GEOM_A_I" ).arg( "y" ) + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
+      "<br>" + tr( "GEOM_A_I" ).arg( "z" ) + PRINT_DOUBLE( aDbls[11], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::TORUS:
     aKindStr = tr( "GEOM_TORUS" );
-    theParameters = tr( "GEOM_CENTER" )            +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )              +
-      "\n" +        tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )        +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )    +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )           +
+      "<br>" + tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )     +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::CONE:
     aKindStr = tr( "GEOM_CONE" );
-    theParameters = tr( "GEOM_CENTER" )            +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )              +
-      "\n" +        tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )        +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
-      "\n" +        tr( "GEOM_HEIGHT" )            + PRINT_DOUBLE( aDbls[8], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )    +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )           +
+      "<br>" + tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )     +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + tr( "GEOM_HEIGHT" )            + PRINT_DOUBLE( aDbls[8], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::POLYHEDRON:
     aKindStr = tr( "GEOM_POLYHEDRON" );
@@ -375,115 +383,115 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
   // FACEs
   case GEOM::GEOM_IKindOfShape::SPHERE2D:
     aKindStr = tr( "GEOM_SURFSPHERE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )       + PRINT_DOUBLE( aDbls[3], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[3], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::CYLINDER2D:
     aKindStr = tr( "GEOM_SURFCYLINDER" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )         +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )       + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_HEIGHT" )       + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )        +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_HEIGHT" )         + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::TORUS2D:
     aKindStr = tr( "GEOM_SURFTORUS" );
-    theParameters = tr( "GEOM_CENTER" )            +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )              +
-      "\n" +        tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )        +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )    +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )           +
+      "<br>" + tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )     +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::CONE2D:
     aKindStr = tr( "GEOM_SURFCONE" );
-    theParameters = tr( "GEOM_CENTER" )            +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_AXIS" )              +
-      "\n" +        tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )        +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
-      "\n" +        tr( "GEOM_HEIGHT" )            + PRINT_DOUBLE( aDbls[8], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )    +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )      + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_AXIS" )           +
+      "<br>" + tr( "GEOM_DX" )                + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )                + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )                + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )     +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 1 ) + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_I" ).arg( 2 ) + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + tr( "GEOM_HEIGHT" )            + PRINT_DOUBLE( aDbls[8], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::DISK_CIRCLE:
     aKindStr = tr( "GEOM_DISK_CIRCLE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )       +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )      + PRINT_DOUBLE( aDbls[6], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[6], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::DISK_ELLIPSE:
     aKindStr = tr( "GEOM_DISK_ELLIPSE" );
-    theParameters = tr( "GEOM_CENTER" )         +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )         +
-      "\n" +        tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )     +
-      "\n" +        tr( "GEOM_RADIUS_MAJOR" )   + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_MINOR" )   + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS_MAJOR" )   + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_MINOR" )   + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::POLYGON:
     aKindStr = tr( "GEOM_POLYGON" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )       +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::PLANE:
     aKindStr = tr( "GEOM_PLANE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )       +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::PLANAR:
     aKindStr = tr( "GEOM_PLANAR_FACE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )       +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::FACE:
     aKindStr = tr( "GEOM_FACE" );
@@ -491,105 +499,124 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
   // EDGEs
   case GEOM::GEOM_IKindOfShape::CIRCLE:
     aKindStr = tr( "GEOM_CIRCLE" );
-    theParameters = tr( "GEOM_CENTER" )       +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )       +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )   +
-      "\n" +        tr( "GEOM_RADIUS" )       + PRINT_DOUBLE( aDbls[6], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS" )         + PRINT_DOUBLE( aDbls[6], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::ARC_CIRCLE:
     aKindStr = tr( "GEOM_ARC" );
-    theParameters = tr( "GEOM_CENTER" )           +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )           +
-      "\n" +        tr( "GEOM_DX" )               + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )               + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )               + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )       +
-      "\n" +        tr( "GEOM_RADIUS" )           + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_POINT_I" ).arg( 1 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
-      "\n" +        tr( "GEOM_POINT_I" ).arg( 2 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[11], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[12], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )  +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )       +
+      "<br>" + tr( "GEOM_DX" )              + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )              + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )              + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )   +
+      "<br>" + tr( "GEOM_RADIUS" )          + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + TITLE_I( "GEOM_POINT_I", 1 ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
+      "<br>" + TITLE_I( "GEOM_POINT_I", 2 ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[11], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[12], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::ELLIPSE:
     aKindStr = tr( "GEOM_ELLIPSE" );
-    theParameters = tr( "GEOM_CENTER" )         +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )         +
-      "\n" +        tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )     +
-      "\n" +        tr( "GEOM_RADIUS_MAJOR" )   + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_MINOR" )   + PRINT_DOUBLE( aDbls[7], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )   + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )      +
+      "<br>" + tr( "GEOM_DX" )             + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )             + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )             + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )  +
+      "<br>" + tr( "GEOM_RADIUS_MAJOR" )   + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_MINOR" )   + PRINT_DOUBLE( aDbls[7], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::ARC_ELLIPSE:
     aKindStr = tr( "GEOM_ARC_ELLIPSE" );
-    theParameters = tr( "GEOM_CENTER" )           +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_NORMAL" )           +
-      "\n" +        tr( "GEOM_DX" )               + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )               + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )               + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIMENSIONS" )       +
-      "\n" +        tr( "GEOM_RADIUS_MAJOR" )     + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
-      "\n" +        tr( "GEOM_RADIUS_MINOR" )     + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
-      "\n" +        tr( "GEOM_POINT_I" ).arg( 1 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
-      "\n" +        tr( "GEOM_POINT_I" ).arg( 2 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[11], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[12], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[13], aLenPrecision );
+    theParameters = TITLE( "GEOM_CENTER" )  +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )    + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_NORMAL" )       +
+      "<br>" + tr( "GEOM_DX" )              + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )              + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )              + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIMENSIONS" )   +
+      "<br>" + tr( "GEOM_RADIUS_MAJOR" )    + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + tr( "GEOM_RADIUS_MINOR" )    + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + TITLE_I( "GEOM_POINT_I", 1 ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[9], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 1 )    + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
+      "<br>" + TITLE_I( "GEOM_POINT_I", 2 ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[11], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[12], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 2 )    + PRINT_DOUBLE( aDbls[13], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::LINE:
     aKindStr = tr( "GEOM_LINE" );
-    theParameters = tr( "GEOM_POSITION" )     +
-      "\n" +        tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DIRECTION" )    +
-      "\n" +        tr( "GEOM_DX" )           + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DY" )           + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_DZ" )           + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE( "GEOM_POSITION" ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 )     + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_DIRECTION" )     +
+      "<br>" + tr( "GEOM_DX" )               + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DY" )               + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_DZ" )               + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::SEGMENT:
     aKindStr = tr( "GEOM_SEGMENT" );
-    theParameters = tr( "GEOM_POINT_I" ).arg( 1 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 1 )     + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
-      "\n" +        tr( "GEOM_POINT_I" ).arg( 2 ) +
-      "\n" +        tr( "GEOM_X_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z_I" ).arg( 2 )     + PRINT_DOUBLE( aDbls[5], aLenPrecision );
+    theParameters = TITLE_I( "GEOM_POINT_I", 1 ) +
+      "<br>" + tr( "GEOM_X_I" ).arg( 1 )         + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 1 )         + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 1 )         + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE_I( "GEOM_POINT_I", 2 )      +
+      "<br>" + tr( "GEOM_X_I" ).arg( 2 )         + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 2 )         + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 2 )         + PRINT_DOUBLE( aDbls[5], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::EDGE:
     aKindStr = tr( "GEOM_EDGE" );
     break;
   case GEOM::GEOM_IKindOfShape::VERTEX:
     aKindStr = tr( "GEOM_VERTEX" );
-    theParameters = tr( "GEOM_COORDINATES" ) +
-      "\n" +        tr( "GEOM_X" )           + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Y" )           + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
-      "\n" +        tr( "GEOM_Z" )           + PRINT_DOUBLE( aDbls[2], aLenPrecision );
+    theParameters = TITLE( "GEOM_COORDINATES" ) +
+      "<br>" + tr( "GEOM_X" )                   + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y" )                   + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z" )                   + PRINT_DOUBLE( aDbls[2], aLenPrecision );
+    break;
+  case GEOM::GEOM_IKindOfShape::LCS:
+    aKindStr = tr( "GEOM_LCS" );
+    theParameters = TITLE("GEOM_POSITION")    +
+      "<br>" + tr( "GEOM_X_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[0], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Y_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[1], aLenPrecision ) +
+      "<br>" + tr( "GEOM_Z_I" ).arg( 0 ) + PRINT_DOUBLE( aDbls[2], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_X_AXIS")     + 
+      "<br>" + "Xx :"                    + PRINT_DOUBLE( aDbls[3], aLenPrecision ) +
+      "<br>" + "Xy :"                    + PRINT_DOUBLE( aDbls[4], aLenPrecision ) +
+      "<br>" + "Xz :"                    + PRINT_DOUBLE( aDbls[5], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_Y_AXIS")     + 
+      "<br>" + "Yx :"                    + PRINT_DOUBLE( aDbls[6], aLenPrecision ) +
+      "<br>" + "Yy :"                    + PRINT_DOUBLE( aDbls[7], aLenPrecision ) +
+      "<br>" + "Yz :"                    + PRINT_DOUBLE( aDbls[8], aLenPrecision ) +
+      "<br>" + TITLE( "GEOM_Z_AXIS")     + 
+      "<br>" + "Zx :"                    + PRINT_DOUBLE( aDbls[9],  aLenPrecision ) +
+      "<br>" + "Zy :"                    + PRINT_DOUBLE( aDbls[10], aLenPrecision ) +
+      "<br>" + "Zz :"                    + PRINT_DOUBLE( aDbls[11], aLenPrecision );
     break;
   case GEOM::GEOM_IKindOfShape::ADVANCED:
     {
@@ -605,3 +632,20 @@ QString MeasureGUI_WhatisDlg::getKindOfShape( QString& theParameters )
 
   return aKindStr;
 }
+
+void MeasureGUI_WhatisDlg::SelectionIntoArgument()
+{
+  myObj.nullify();
+  myObj = getSelected( TopAbs_SHAPE );
+  if (!myObj) {
+    mySelEdit->setText("");
+    processObject();
+    erasePreview();
+    return;
+  }
+
+  mySelEdit->setText(GEOMBase::GetName(myObj.get()));
+  processObject();
+  redisplayPreview();
+}
index 9c5ca644329cd0510b94c7f0307e572c2b06414c..c9594c7f7e854a5a0e55e9c9c2245d04ece7ae5f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -48,6 +48,8 @@ public:
 protected:
   // redefined from GEOMBase_Helper and MeasureGUI_Skeleton
   virtual void                        processObject();
+  virtual void                        activateSelection();
+  virtual void                        SelectionIntoArgument();
   
 protected slots:
   virtual void                        ClickOnProperties();
index 77cdd68f38d523d5a8fe047e424e830ff53d2b8c..00062827c9fcf3bc70ed125358ffc75e5a7f16f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1f1f388247a51e9108ba461730a77690d7fff363..8a378b1a282e0ba2c13cc7ef146f087a8b80fc64 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
diff --git a/src/MeasureGUI/MeasureGUI_definitions.h b/src/MeasureGUI/MeasureGUI_definitions.h
new file mode 100644 (file)
index 0000000..f617200
--- /dev/null
@@ -0,0 +1,33 @@
+// Copyright (C) 2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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  MEASUREGUI_DEF_HXX
+#define  MEASUREGUI_DEF_HXX
+
+#ifdef WIN32
+# if defined MEASUREGUI_EXPORTS || defined MeasureGUI_EXPORTS
+#  define MEASUREGUI_EXPORT __declspec( dllexport )
+# else
+#  define MEASUREGUI_EXPORT __declspec( dllimport )
+# endif
+#else
+# define MEASUREGUI_EXPORT
+#endif
+
+#endif
\ No newline at end of file
index 1fba59a07f02a05dfcb2a7f2a04b969d6f445d6d..60a7497caaa2ef518d931010770104d63812fc79 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index f0d2133c53c49756b6201df5d8c528b69ac89d1e..8ddbdb09409ae4c8a44d79239e949a2161ddb251 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e7f3def428a84621dad5a7fbb0d299a943261069..ccdbe0fb0df329a55a63acc1a073e763ca9c7e3d 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index a41490235cdac8ce75bb398605b6f587eca0c060..b2a0efa5ca671dbcf3b429e33bed898d6d2887cb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include "GEOM_AISShape.hxx"
 #include "GEOM_AISVector.hxx"
 
+#include <GEOMUtils.hxx>
+
 #include <Basics_OCCTVersion.hxx>
 
 // Open CASCADE Includes
-#include <AIS_Drawer.hxx>
 #include <AIS_InteractiveContext.hxx>
 #include <BRep_Tool.hxx>
 #include <GCPnts_AbscissaPoint.hxx>
@@ -107,10 +108,17 @@ static void getEntityOwners( const Handle(AIS_InteractiveObject)& theObj,
     Handle(SelectMgr_Selection) sel = theObj->Selection( m );
 
     for ( sel->Init(); sel->More(); sel->Next() ) {
+#if OCC_VERSION_LARGE > 0x06080100
+      const Handle(SelectMgr_SensitiveEntity) aHSenEntity = sel->Sensitive();
+      if( aHSenEntity.IsNull() )
+        continue;
+
+      Handle(SelectBasics_SensitiveEntity) entity = aHSenEntity->BaseSensitive();
+#else
       Handle(SelectBasics_SensitiveEntity) entity = sel->Sensitive();
+#endif
       if ( entity.IsNull() )
         continue;
-
       Handle(SelectMgr_EntityOwner) owner =
         Handle(SelectMgr_EntityOwner)::DownCast(entity->OwnerId());
       if ( !owner.IsNull() )
@@ -253,24 +261,21 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent
     }
     case ShadingWithEdges:
     {
-      shadingMode(aPresentationManager, aPrs, Shading);
       myDrawer->SetFaceBoundaryDraw( Standard_True );
-      Handle(Prs3d_LineAspect) aBoundaryAspect =
-        new Prs3d_LineAspect ( myEdgesInShadingColor, Aspect_TOL_SOLID, myOwnWidth );
-      myDrawer->SetFaceBoundaryAspect (aBoundaryAspect);
+      shadingMode(aPresentationManager, aPrs, Shading);
+      if( anIsColorField && myFieldDimension == 1 ) {
+        myDrawer->SetFaceBoundaryDraw( Standard_False );
+        drawField( aPrs );
+      }
       break;
     }
     case TexturedShape:
     {
-      if(!isTopLev)
 #ifdef USE_TEXTURED_SHAPE
        AIS_TexturedShape::Compute(aPresentationManager, aPrs, aMode);
 #else
        AIS_Shape::Compute(aPresentationManager, aPrs, aMode);
 #endif
-      else 
-       shadingMode(aPresentationManager, aPrs, Shading);
-      break;
     }
   }
   if (isShowVectors())
@@ -327,6 +332,9 @@ void GEOM_AISShape::Compute(const Handle(PrsMgr_PresentationManager3d)& aPresent
   if( anIsTextField )
     drawField( aPrs, true );
 
+  if( isShowName() )
+    drawName( aPrs );
+
   //  aPrs->ReCompute(); // for hidden line recomputation if necessary...
 }
 
@@ -340,6 +348,10 @@ void GEOM_AISShape::SetEdgesInShadingColor(const Quantity_Color &aCol)
   myEdgesInShadingColor = aCol;
 }
 
+void GEOM_AISShape::SetLabelColor(const Quantity_Color &aCol) {
+  myLabelColor = aCol;
+}
+
 void GEOM_AISShape::highlightSubShapes(const TColStd_IndexedMapOfInteger& aIndexMap, 
                                        const Standard_Boolean aHighlight )
 {
@@ -381,6 +393,11 @@ void GEOM_AISShape::SetDisplayVertices(bool isDisplayed)
   myDisplayVertices = isDisplayed;
 }
 
+void GEOM_AISShape::SetDisplayName(bool isDisplayed)
+{
+  myDisplayName = isDisplayed;
+}
+
 void GEOM_AISShape::shadingMode(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
                                 const Handle(Prs3d_Presentation)& aPrs,
                                 const Standard_Integer aMode)
@@ -430,10 +447,10 @@ void GEOM_AISShape::setTopLevel(Standard_Boolean f) {
       myPrevDisplayMode = DisplayMode();
     Standard_Integer dm;
     switch(topLevelDisplayMode()) {
-      case TopKeepCurrent :      dm = myPrevDisplayMode; break;
-      case TopWireFrame :        dm = Wireframe;         break;     
+      case TopWireFrame :        dm = Wireframe;         break;
+      case TopShading :          dm = Shading;           break;
       case TopShadingWithEdges : dm = ShadingWithEdges;  break;
-      default :                  dm = Shading;           break;
+      default :                  dm = myPrevDisplayMode; break;
     }
     SetDisplayMode(dm);
   } else {
@@ -560,6 +577,7 @@ void GEOM_AISShape::drawField( const Handle(Prs3d_Presentation)& thePrs,
 
           Handle(Graphic3d_AspectText3d) anAspectText3d = new Graphic3d_AspectText3d();
           anAspectText3d->SetStyle( Aspect_TOST_ANNOTATION );
+          anAspectText3d->SetColor( myLabelColor );
           aGroup->SetPrimitivesAspect( anAspectText3d );
 
           aGroup->Text( aString.toLatin1().constData(), aVertex, 14 );
@@ -608,6 +626,24 @@ void GEOM_AISShape::drawField( const Handle(Prs3d_Presentation)& thePrs,
   }
 }
 
+void GEOM_AISShape::drawName( const Handle(Prs3d_Presentation)& thePrs )
+{
+  Handle(Graphic3d_Group) aGroup = Prs3d_Root::NewGroup( thePrs );
+
+  gp_Ax3 anAx3 = GEOMUtils::GetPosition(myshape);
+  gp_Pnt aCenter = anAx3.Location();
+
+  Graphic3d_Vertex aVertex( aCenter.X(), aCenter.Y(), aCenter.Z() );
+
+  Handle(Graphic3d_AspectText3d) anAspectText3d = new Graphic3d_AspectText3d();
+  anAspectText3d->SetStyle( Aspect_TOST_ANNOTATION );
+  anAspectText3d->SetColor( myLabelColor );
+  aGroup->SetPrimitivesAspect( anAspectText3d );
+
+  const char* aName = getIO()->getName();
+  aGroup->Text( TCollection_ExtendedString( aName ), aVertex, 16 );
+}
+
 Standard_Boolean GEOM_AISShape::computeMassCenter( const TopoDS_Shape& theShape,
                                                    gp_Pnt& theCenter )
 {
index e6f185c8b05e3497f935fe8693e7443a5b5dad8c..f666361265248298247f685965fa671af3ac03df 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -79,8 +79,10 @@ public:
   
   Standard_EXPORT void SetShadingColor(const Quantity_Color &aCol);
   Standard_EXPORT void SetEdgesInShadingColor(const Quantity_Color &aCol);
+  Standard_EXPORT void SetLabelColor(const Quantity_Color &aCol);
   Standard_EXPORT void SetDisplayVectors(bool isShow);
   Standard_EXPORT void SetDisplayVertices(bool isShow);
+  Standard_EXPORT void SetDisplayName(bool isShow);
 
   Standard_EXPORT virtual void Compute(const Handle(PrsMgr_PresentationManager3d)& aPresentationManager,
                                       const Handle(Prs3d_Presentation)& aPresentation,
@@ -88,6 +90,7 @@ public:
   
   Standard_EXPORT virtual bool isShowVectors() { return myDisplayVectors; }
   Standard_EXPORT virtual bool isShowVertices() { return myDisplayVertices; }
+  Standard_EXPORT virtual bool isShowName() { return myDisplayName; }
 
   Standard_EXPORT virtual Standard_Boolean switchTopLevel();
   Standard_EXPORT virtual Standard_Boolean toActivate();
@@ -125,6 +128,9 @@ protected:
                                  const bool theIsText = false,
                                  const bool theIsHighlight = false );
   
+  // Displaying the name of shape
+  Standard_EXPORT void drawName( const Handle(Prs3d_Presentation)& thePrs );
+
   // Auxiliary method to compute a center of mass for the specified shape
   Standard_EXPORT static Standard_Boolean computeMassCenter( const TopoDS_Shape& theShape,
                                                             gp_Pnt& theCenter );
@@ -132,10 +138,12 @@ protected:
 private: 
   Quantity_Color           myShadingColor;
   Quantity_Color           myEdgesInShadingColor;
+  Quantity_Color           myLabelColor;
 
   TCollection_AsciiString  myName;
   bool                     myDisplayVectors;
   bool                     myDisplayVertices;
+  bool                     myDisplayName;
   Standard_Boolean         myTopLevel;
   Standard_Integer         myPrevDisplayMode;
 
index 4bee6ce4de7294f2a5f2ead140ae9dc6e23a79e2..25aa0c17dc5d991bc8ebbde2cbb6e75280e20a85 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 344159d20dac5e1715dd4b35b8f76cf773c00d40..bdfc88e5735c90b512f732cbf24e611b3a0f5283 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 7998a1239fcafb31ab6cbb1ad005a1764fc2c109..edd961f7997058cde58d534b22bbc0609f74b508 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 499c2fbaa08779284c742918484d3cf4520dacd1..b6e53dfa0a93c35c975eb203341fb9ba2c95e226 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1b15c5640c22aff2c3c818de23fec8276ea4c033..bf9d136da5e8292ba24aea5a3ec0cd77c0ad34a5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include "GEOM_WireframeFace.h" 
 #include "GEOM_ShadingFace.h"
 #include "GEOM_PainterPolyDataMapper.h"
+#include "GEOMUtils.hxx" 
 #include "SVTK_Actor.h"
 
 #include <OCC2VTK_Tools.h>
+#include <GEOMUtils.hxx>
 
 #include <vtkObjectFactory.h> 
 #include <vtkRenderer.h> 
+#include <vtkTextActor.h>
+#include <vtkTextProperty.h>
 #include <vtkProperty.h> 
 #include <vtkPointPicker.h>
 #include <vtkCellPicker.h>
@@ -83,6 +87,7 @@ GEOM_Actor::GEOM_Actor():
   myIsSelected(false), 
   myVectorMode(false),
   myVerticesMode(false),
+  myNameMode(false),
 
   myVertexActor(GEOM_DeviceActor::New(),true), 
   myVertexSource(GEOM_VertexSource::New(),true), 
@@ -114,6 +119,8 @@ GEOM_Actor::GEOM_Actor():
   // defined in this class !!!
   myPolyDataMapper(GEOM_PainterPolyDataMapper::New(),true),
 
+  myTextActor( vtkTextActor::New() ),
+
   myHighlightProp(vtkProperty::New()),
   myPreHighlightProp(vtkProperty::New()),
   myShadingFaceProp(vtkProperty::New()),
@@ -201,6 +208,7 @@ GEOM_Actor::GEOM_Actor():
   setDisplayMode(0); // WIRE FRAME
   SetVectorMode(0);  //
   SetVerticesMode(0);  //
+  SetNameMode(0); 
 } 
  
  
@@ -245,6 +253,7 @@ SetModified()
   this->mySharedEdgeSource->Modified(); 
   this->myWireframeFaceSource->Modified(); 
   this->myShadingFaceSource->Modified(); 
+  this->myTextActor->Modified();
 } 
 
 void  
@@ -274,6 +283,8 @@ AddToRender(vtkRenderer* theRenderer)
  
   myVertexActor->AddToRender(theRenderer); 
   myStandaloneVertexActor->AddToRender(theRenderer); 
+
+  theRenderer->AddActor( myTextActor );
 }
  
 void 
@@ -296,6 +307,7 @@ RemoveFromRender(vtkRenderer* theRenderer)
   myVertexActor->RemoveFromRender(theRenderer);
   myStandaloneVertexActor->RemoveFromRender(theRenderer);
 
+  theRenderer->RemoveActor( myTextActor );
   
   SetSelected(false);
   SetVisibility(false);
@@ -326,9 +338,9 @@ setDisplayMode(int theMode)
     myIsolatedEdgeActor->GetProperty()->SetColor(myIsolatedEdgeColor[0],
                                                  myIsolatedEdgeColor[1],
                                                  myIsolatedEdgeColor[2]);
-    mySharedEdgeActor->GetProperty()->SetColor(myIsolatedEdgeColor[0],
-                                               myIsolatedEdgeColor[1],
-                                               myIsolatedEdgeColor[2]);
+    mySharedEdgeActor->GetProperty()->SetColor(mySharedEdgeColor[0],
+                                               mySharedEdgeColor[1],
+                                               mySharedEdgeColor[2]);
     myOneFaceEdgeActor->GetProperty()->SetColor(myOneFaceEdgeColor[0],
                                                myOneFaceEdgeColor[1],
                                                myOneFaceEdgeColor[2]);
@@ -373,6 +385,8 @@ SetVisibility(int theVisibility)
   myVertexActor->SetVisibility(theVisibility && (isOnlyVertex || (myVerticesMode && (!myIsSelected && !myIsPreselected))));// must be added new mode points
 
   myStandaloneVertexActor->SetVisibility(theVisibility);
+
+  myTextActor->SetVisibility( theVisibility && myNameMode );
 }
  
 
@@ -428,22 +442,56 @@ GEOM_Actor
   return myVerticesMode;
 }
 
+void
+GEOM_Actor
+::SetShapeName()
+{
+  if( !getIO() || myShape.IsNull() )
+    return;
+
+  gp_Ax3 anAx3 = GEOMUtils::GetPosition(myShape);
+  double center[3] = { anAx3.Location().X(),
+                       anAx3.Location().Y(),
+                       anAx3.Location().Z() };
+  double* pos = center;
+  myTextActor->GetTextProperty()->SetFontSize( 16 );
+  myTextActor->GetTextProperty()->ShadowOn();
+  myTextActor->GetPositionCoordinate()->SetCoordinateSystemToWorld();
+  myTextActor->GetPositionCoordinate()->SetValue(pos);
+  myTextActor->SetInput( getIO()->getName() );
+}
+
+void
+GEOM_Actor
+::SetNameMode(bool theMode)
+{
+  myNameMode = theMode;
+  myTextActor->SetVisibility(theMode);
+  SetModified();
+}
+
+bool
+GEOM_Actor
+::GetNameMode()
+{
+  return myNameMode;
+}
+
 void  
 GEOM_Actor:: 
-SetDeflection(float theDeflection) 
+SetDeflection(double theDeflection) 
 { 
-  if( myDeflection == theDeflection ) 
-    return;
-    
-  myDeflection = theDeflection; 
-  GEOM::MeshShape(myShape,myDeflection);
-  
-  SetModified(); 
+  double aDeflection = ( theDeflection <= 0 ) ? GEOMUtils::DefaultDeflection() : theDeflection;
+
+  if ( myDeflection != aDeflection ) {
+    myDeflection = aDeflection; 
+    GEOMUtils::MeshShape( myShape, myDeflection );
+    SetModified(); 
+  }
 }
 
 void GEOM_Actor::SetShape (const TopoDS_Shape& theShape,
-                           float theDeflection,
+                           double theDeflection,
                            bool theIsVector)
 {
   myShape = theShape;
@@ -469,13 +517,13 @@ void GEOM_Actor::SetShape (const TopoDS_Shape& theShape,
   TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap;
   TopExp::MapShapesAndAncestors(theShape,TopAbs_EDGE,TopAbs_FACE,anEdgeMap);
   
-  GEOM::SetShape(theShape,anEdgeMap,theIsVector,
-                 myStandaloneVertexSource.Get(),
-                 myIsolatedEdgeSource.Get(),
-                 myOneFaceEdgeSource.Get(),
-                 mySharedEdgeSource.Get(),
-                 myWireframeFaceSource.Get(),
-                 myShadingFaceSource.Get());
+  GEOM::ShapeToVTK(theShape,anEdgeMap,theIsVector,
+                   myStandaloneVertexSource.Get(),
+                   myIsolatedEdgeSource.Get(),
+                   myOneFaceEdgeSource.Get(),
+                   mySharedEdgeSource.Get(),
+                   myWireframeFaceSource.Get(),
+                   myShadingFaceSource.Get());
   isOnlyVertex =  
     myIsolatedEdgeSource->IsEmpty() &&
     myOneFaceEdgeSource->IsEmpty() &&
@@ -490,19 +538,12 @@ void GEOM_Actor::SetShape (const TopoDS_Shape& theShape,
     myHighlightActor->GetDeviceActor()->SetInfinitive(true);
   }
 
+  SetShapeName();
+
   // 0051777: TC7.2.0: Element could not be selected in Hypothesis Construction
   myAppendFilter->Update();
 }
 
-// OLD METHODS
-void GEOM_Actor::setDeflection(double adef) {
-#ifdef MYDEBUG
-  MESSAGE ( "GEOM_Actor::setDeflection" );
-#endif
-  SetDeflection((float)adef);
-}
-
-
 // warning! must be checked!
 // SetHighlightProperty
 // SetWireframeProperty
@@ -689,15 +730,6 @@ void GEOM_Actor::setInputShape(const TopoDS_Shape& ashape, double adef1,
 #endif
 }
 
-double GEOM_Actor::getDeflection()
-{
-#ifdef MYDEBUG
-  MESSAGE ( "GEOM_Actor::getDeflection" );
-#endif
-  return (double) GetDeflection();
-}
-
-
 double GEOM_Actor::isVector()
 {
 #ifdef MYDEBUG
@@ -824,6 +856,15 @@ void GEOM_Actor::SetIsosColor(double r, double g, double b)
   myWireframeFaceActor->GetProperty()->SetColor(r, g, b);
 }
 
+/*!
+  \brief Set color of labels
+  This actor is shown only if 'Show name' is switched-on, see SetVisibility()
+*/
+void GEOM_Actor::SetLabelColor(double r, double g, double b)
+{
+  myTextActor->GetTextProperty()->SetColor(r, g, b);
+}
+
 void GEOM_Actor::SetMaterial(std::vector<vtkProperty*> theProps)
 {
   // we set material properties as back and front material
index 117f1afcb378cfc7424a9a3c8bc935d2f2fcfed1..f0f3621881eb9b22f5dd485b6c8d3a42157797a4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ class GEOM_ShadingFace;
 typedef GEOM_SmartPtr<GEOM_ShadingFace> PSFaceSource;
 
 class vtkRenderer;
+class vtkTextActor;
 
 class vtkAppendPolyData;
 typedef GEOM_SmartPtr<vtkAppendPolyData> PAppendFilter;
@@ -62,11 +63,11 @@ public:
   static GEOM_Actor* New();
 
   void SetShape(const TopoDS_Shape& theShape,
-                float theDeflection,
+                double theDeflection,
                 bool theIsVector = false);
 
-  void SetDeflection(float theDeflection);
-  float GetDeflection() const{ return myDeflection;}
+  void SetDeflection(double theDeflection);
+  double GetDeflection() const{ return myDeflection;}
 
   void AddToRender(vtkRenderer* theRenderer);
   void RemoveFromRender(vtkRenderer* theRenderer);
@@ -93,7 +94,6 @@ public:
   vtkProperty* GetSharedEdgeProperty();
   vtkProperty* GetFaceEdgeProperty();
 
-  void setDeflection(double adef);
   virtual void setDisplayMode(int thenewmode);
 
   // Description:
@@ -108,7 +108,6 @@ public:
   const TopoDS_Shape& getTopo();
   void setInputShape(const TopoDS_Shape& ashape, double adef1,
                      int imode, bool isVector = false);
-  double getDeflection();
   double isVector();
 
   // SubShape
@@ -140,6 +139,8 @@ public:
   void SetEdgesInShadingColor(double r, double g, double b);
   // Color of iso-lines
   void SetIsosColor(double r, double g, double b);
+  // Color of labels
+  void SetLabelColor(double r, double g, double b);
 
 
   // Material
@@ -212,10 +213,20 @@ public:
   bool
   GetVerticesMode();
 
+  //! Name mode management
+  virtual
+  void
+  SetNameMode(const bool theMode);
+
+  virtual
+  bool
+  GetNameMode();
+
 protected:
   void SetModified();
 
   void GetMatrix(vtkCamera* theCam, vtkMatrix4x4 *result);
+  void SetShapeName();
 
   GEOM_Actor();
   ~GEOM_Actor();
@@ -224,13 +235,14 @@ private:
   TopoDS_Shape myShape;
   bool isOnlyVertex;
 
-  float myDeflection;
+  double myDeflection;
   bool myIsForced;
 
   //  EDisplayMode myDisplayMode;
   bool myIsSelected;
   bool myVectorMode;
   bool myVerticesMode;
+  bool myNameMode;
 
   PDeviceActor myVertexActor;
   PVertexSource myVertexSource;
@@ -254,6 +266,9 @@ private:
   PSFaceSource myShadingFaceSource;
 
   PDeviceActor myHighlightActor;
+
+  vtkTextActor* myTextActor;
+
   vtkSmartPointer<vtkProperty>  myHighlightProp;
   vtkSmartPointer<vtkProperty>  myPreHighlightProp;
   vtkSmartPointer<vtkProperty>  myShadingFaceProp;
index 0ccf2ed1ca9ed4fc3912032b7b4db6b7cc2a723a..3293fe3f1a7fdc44683914c136f03bda80d989df 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -71,6 +71,8 @@ namespace GEOM
       "VectorMode",      // VECTOR_MODE_PROP
       // "show vertices" flag
       "VerticesMode",    // VERTICES_MODE_PROP
+      // "show name" flag
+      "NameMode",        // NAME_MODE_PROP
       // deflection coefficient
       "DeflectionCoeff", // DEFLECTION_COEFF_PROP
       // point marker data
index e314735f800ee042eaadafa3d7217d89868bb183..290b643d63436b11b8169b73b266f29b3410fa13 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -40,6 +40,7 @@ namespace GEOM
     Color,
     EdgesDirection,
     Vertices,
+    ShowName,
     Deflection,
     PointMarker,
     Material,
index d421ca9892f23cb0ba711ad31087d94e6bbdda4e..bc85bb36652804fed0a360bc2bef13afc48f603d 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 8a84864b5a78c3f44ed22ef16d7a42afb113145d..901dcfa479da3e3b9af42abffafff4d6ed9bb13c 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index ed6306e67070e4635b5d420502760de2e345cc03..2bd0c29b057becadca82be8a6014d12aa8e08b26 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 2800e8fa8457cd4cb67cc550a63ed77764e174bf..64a6fd3a9160073e6eea71e633c93557a1c9d78b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 53a216a91303abe80011d7e65b616f0ccd943bf9..56a4498d0cad571e1bc71b226a2839c1ad60e9dc 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 61e7208b3c576e1dd1b038b6d7a792681282bf4d..333fe10f5d937ae3164fae5be7210b7e5c415024 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 63b622fb8a4494733d8dc82fbd5814cdaebd1a9e..31129e254689b6bb7534a7f1b4a198f5b5215881 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f42708605b12475aabe112b6d34667b4a32ebfb5..0fa35604502015ec423b1ca36e47e33a52cb87ad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 25c94c557e2dd84b7c0eb38676d8bcc829ef77c0..683ade6ca367fad8b9fe4b5c0f8dff7a05e75dec 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index b5d9fd00002e0ec583637a6b71464562a59eb3af..e8919032207380568eec0411c954b465b64e1621 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 4defd19891c804e6722d7f19f427376c53a11f60..1edb087201dd59596b0107cf98cef2af9444a722 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -39,7 +39,6 @@
 #include <SALOME_InteractiveObject.hxx>
 
 //Open CASCADE includes
-#include <AIS_Drawer.hxx>
 #include <TopoDS_Shape.hxx>
 #include <Prs3d_IsoAspect.hxx>
 
index 1a35990b17d4f1e97ebe6f008b0a41748dea2530..3ae366b8e4bbacd8098fa514afd3ca9787a8c215 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 0706012706fe390ac4004657274a2a3d4b26a328..c1453c9cb0aed729fd06648554e2f17d3bc441b4 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 994c25cde48b5d720f834f738998b1c1c3d78990..3e19435a2bc8713001ff52b5db2def92a12a1836 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 9eb97c21ca5fd8b5a91c03a367396bcba985a29a..54cf54fe2b6ea07889c5e7eb89461eceece8ca92 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -259,6 +259,7 @@ void GEOM_VTKTrihedron::SetSize( double theSize )
   aRes->AddInputConnection( aSrcZ->GetOutputPort() );
   
   myMapper->SetInputConnection( aRes->GetOutputPort() );
+  aRes->Update();
   SALOME_Actor::SetMapper( myMapper );
 
   aSrcX->Delete();
index 66fda08ca91a427b9dccee18155c9dd9b5070dee..b79d3226b35a99c4f12ceb836b3d2b2f459da931 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 02feabe89ea24015106972a695022f37e3856915..e66da770b9a4c3b83897f14b48fb9655e56c93b9 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 2ff7b91c7c4cf5f757f75673024076625c81c4cd..a76c4e86fef27f419b26088cce6e321c3c0e47b8 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -126,11 +126,11 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
         pt2.Transform(edgeTransf);
       }
 
-      float aCoord1[3] = {pt1.X(), pt1.Y(), pt1.Z()};
+      float aCoord1[3] = {(float)pt1.X(), (float)pt1.Y(), (float)pt1.Z()};
       vtkIdType anIds[2];
       anIds[0] = thePts->InsertNextPoint(aCoord1);
 
-      float aCoord2[3] = {pt2.X(), pt2.Y(), pt2.Z()};
+      float aCoord2[3] = {(float)pt2.X(), (float)pt2.Y(), (float)pt2.Z()};
       anIds[1] = thePts->InsertNextPoint(aCoord2);
 
       thePolyData->InsertNextCell(VTK_LINE,2,anIds);
@@ -156,11 +156,11 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
         pt2.Transform(edgeTransf);
       }
       
-      float aCoord1[3] = {pt1.X(), pt1.Y(), pt1.Z()};
+      float aCoord1[3] = {(float)pt1.X(), (float)pt1.Y(), (float)pt1.Z()};
       vtkIdType anIds[2];
       anIds[0] = thePts->InsertNextPoint(aCoord1);
 
-      float aCoord2[3] = {pt2.X(), pt2.Y(), pt2.Z()};
+      float aCoord2[3] = {(float)pt2.X(), (float)pt2.Y(), (float)pt2.Z()};
       anIds[1] = thePts->InsertNextPoint(aCoord2);
 
       thePolyData->InsertNextCell(VTK_LINE,2,anIds);
@@ -226,7 +226,7 @@ void GEOM_EdgeSource::OCC2VTK (const TopoDS_Edge& theEdge,
     // Add points and segments, composing the arrow
     Standard_Real cosinus, sinus, Tg = tan(anAngle);
 
-    float coord[3] = {xo, yo, zo};
+    float coord[3] = {(float)xo, (float)yo, (float)zo};
 
     vtkIdType ptLoc = thePts->InsertNextPoint(coord);
     vtkIdType ptFirst = 0;
index 0c2dbb67a926dcba1fe4f9cf68dd82b28c08126e..23433fb509fcffea5bbaa262d88274eddfab6b3e 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7067a728255018e05cf8cd4beb6fbe2a9461d87e..8b7f32c99b13323f4cae04b33029ee7994fc6e62 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 68d507657a14a697fc82a6a81785433ea699637e..4f1c4732bb26b1e7e6ee4c335e215dad6ef7100c 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 9b56761ee6d4b06a86f1ecb66b4877a1e1ada4ca..7522b70589feaf255cd0f98a02004d98d8d6f357 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index a68560a69404cf951c44a7eef118725f51c90d0e..8599991f03ec599001848b3eb6f526b54cdac238 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e313ff8657dd10df763bb18a3a6e750fe9bff641..6dfcf5f1f96a016ef057adacdd1f744adeae8ae7 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d0ca91e35773f1e37fde88eb8a3f7a9d5ea0e2e5..6b06a34553f87da10413612c574392f9b7460e19 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index f9d31608ee640171aa0abecf2afb9a51425b8e09..46e7085f8bfbf0c4aa2fcca42137dc5623dc3422 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index c4dcbc96b4834de7dc92a3e0bb7181b9a1cbeee7..8cedc026a4f2179e27d4e31caae1f57adc7b6c90 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 51d387e3913caa6e307a049670817f1a7d182381..f79df51745ad61d6b6146f75f693b486379f9ca5 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e9b592035f70bb0d5e05d95d022dc54e8687c536..b67dc829dd37d26a9a6fd20096cd0c6dc5870b16 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -23,6 +23,7 @@
 #include "GEOM_EdgeSource.h" 
 #include "GEOM_WireframeFace.h" 
 #include "GEOM_ShadingFace.h"
+#include "GEOMUtils.hxx"
 
 #include <Bnd_Box.hxx>
 #include <BRep_Tool.hxx>
 #include <TopoDS.hxx>
 #include <TopTools_ListOfShape.hxx>
 
-#define MAX2(X, Y)    (Abs(X) > Abs(Y) ? Abs(X) : Abs(Y))
-#define MAX3(X, Y, Z) (MAX2(MAX2(X,Y), Z))
 
-
-#define DEFAULT_DEFLECTION 0.001
+#include <TopExp.hxx>
+#include <vtkAppendPolyData.h>
+#include <vtkPolyData.h>
+#include <BRepBuilderAPI_Copy.hxx>
 
 namespace GEOM
 {
-  void MeshShape(const TopoDS_Shape theShape,
-                 float& theDeflection,
-                 bool theForced ) {
-    
-    Standard_Real aDeflection = theDeflection <= 0 ? DEFAULT_DEFLECTION : theDeflection;
-    
-    //If deflection <= 0, than return default deflection
-    if(theDeflection <= 0)
-      theDeflection = aDeflection;  
-    
-    // Is shape triangulated?
-    Standard_Boolean alreadymeshed = Standard_True;
-    TopExp_Explorer ex;
-    TopLoc_Location aLoc;
-    for (ex.Init(theShape, TopAbs_FACE); ex.More(); ex.Next()) {
-      const TopoDS_Face& aFace = TopoDS::Face(ex.Current());
-      Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
-      if(aPoly.IsNull()) { 
-        alreadymeshed = Standard_False; 
-        break; 
-      }
-    }
-
-    if(!alreadymeshed || theForced) {
-      Bnd_Box B;
-      BRepBndLib::Add(theShape, B);
-      if ( B.IsVoid() )
-        return; // NPAL15983 (Bug when displaying empty groups) 
-      Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
-      B.Get(aXmin, aYmin, aZmin, aXmax, aYmax, aZmax);
-
-      // This magic line comes from Prs3d_ShadedShape.gxx in OCCT
-      aDeflection = MAX3(aXmax-aXmin, aYmax-aYmin, aZmax-aZmin) * aDeflection * 4;
-      
-      //Clean triangulation before compute incremental mesh
-      BRepTools::Clean(theShape);
-      
-      //Compute triangulation
-      BRepMesh_IncrementalMesh MESH(theShape,aDeflection); 
-    }
-  }
-
-  void SetShape(const TopoDS_Shape& theShape,
-                const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap,
-                bool theIsVector,
-                GEOM_VertexSource* theStandaloneVertexSource,
-                GEOM_EdgeSource* theIsolatedEdgeSource,
-                GEOM_EdgeSource* theOneFaceEdgeSource,
-                GEOM_EdgeSource* theSharedEdgeSource,
-                GEOM_WireframeFace* theWireframeFaceSource,
-                GEOM_ShadingFace* theShadingFaceSource)
+  void ShapeToVTK( const TopoDS_Shape& theShape,
+                   const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap,
+                   bool theIsVector,
+                   GEOM_VertexSource* theStandaloneVertexSource,
+                   GEOM_EdgeSource* theIsolatedEdgeSource,
+                   GEOM_EdgeSource* theOneFaceEdgeSource,
+                   GEOM_EdgeSource* theSharedEdgeSource,
+                   GEOM_WireframeFace* theWireframeFaceSource,
+                   GEOM_ShadingFace* theShadingFaceSource )
   {
     if (theShape.ShapeType() == TopAbs_COMPOUND) {
       TopoDS_Iterator anItr(theShape);
       for (; anItr.More(); anItr.Next()) {
-        SetShape(anItr.Value(),theEdgeMap,theIsVector,
-                 theStandaloneVertexSource,
-                 theIsolatedEdgeSource,
-                 theOneFaceEdgeSource,
-                 theSharedEdgeSource,
-                 theWireframeFaceSource,
-                 theShadingFaceSource);
+        ShapeToVTK( anItr.Value(),theEdgeMap,theIsVector,
+                    theStandaloneVertexSource,
+                    theIsolatedEdgeSource,
+                    theOneFaceEdgeSource,
+                    theSharedEdgeSource,
+                    theWireframeFaceSource,
+                    theShadingFaceSource );
       }
     }
 
@@ -159,4 +118,69 @@ namespace GEOM
       }
     }
   }
+
+  vtkPolyData* GetVTKData( const TopoDS_Shape& theShape, float theDeflection )
+  {
+    vtkPolyData* ret = 0;
+
+    BRepBuilderAPI_Copy aCopy(theShape);
+    if (aCopy.IsDone() ) {
+
+      TopoDS_Shape aShape = aCopy.Shape();
+      
+      try {
+        GEOM_VertexSource* myVertexSource = GEOM_VertexSource::New();
+        GEOM_EdgeSource* myIsolatedEdgeSource = GEOM_EdgeSource::New();
+        GEOM_EdgeSource* myOneFaceEdgeSource = GEOM_EdgeSource::New();
+        GEOM_EdgeSource* mySharedEdgeSource = GEOM_EdgeSource::New();
+        GEOM_WireframeFace* myWireframeFaceSource = GEOM_WireframeFace::New();
+        GEOM_ShadingFace* myShadingFaceSource = GEOM_ShadingFace::New();
+        
+        vtkAppendPolyData* myAppendFilter = vtkAppendPolyData::New();
+        myAppendFilter->AddInputConnection( myVertexSource->GetOutputPort() );
+        myAppendFilter->AddInputConnection( myIsolatedEdgeSource->GetOutputPort() );
+        myAppendFilter->AddInputConnection( myOneFaceEdgeSource->GetOutputPort() );
+        myAppendFilter->AddInputConnection( mySharedEdgeSource->GetOutputPort() );      
+        myAppendFilter->AddInputConnection( myShadingFaceSource->GetOutputPort() );
+        
+        bool anIsVector = false;
+        
+        GEOMUtils::MeshShape( aShape, theDeflection );
+        TopExp_Explorer aVertexExp( aShape, TopAbs_VERTEX );
+        for( ; aVertexExp.More(); aVertexExp.Next() ) {
+          const TopoDS_Vertex& aVertex = TopoDS::Vertex( aVertexExp.Current() );
+          myVertexSource->AddVertex( aVertex );
+        }
+      
+        TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap;
+        TopExp::MapShapesAndAncestors( aShape, TopAbs_EDGE, TopAbs_FACE, anEdgeMap );
+        
+        ShapeToVTK( aShape,
+                    anEdgeMap,
+                    anIsVector,
+                    0,
+                    myIsolatedEdgeSource,
+                    myOneFaceEdgeSource,
+                    mySharedEdgeSource,
+                    myWireframeFaceSource,
+                    myShadingFaceSource );
+        
+        myAppendFilter->Update();
+        
+        myVertexSource->Delete();
+        myIsolatedEdgeSource->Delete();
+        myOneFaceEdgeSource->Delete();
+        mySharedEdgeSource->Delete();
+        myWireframeFaceSource->Delete();
+        myShadingFaceSource->Delete();
+        
+        ret = vtkPolyData::New();
+        ret->ShallowCopy(myAppendFilter->GetOutput());
+        myAppendFilter->Delete();
+      }
+      catch(Standard_Failure) {
+      }
+    }
+    return ret;
+  }
 }
index 523ca14b945ffa3724dc6ad271cc3e7243f4730f..1364cf491163815ef3004632f8ed9b70335a33d8 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -29,24 +29,40 @@ class GEOM_VertexSource;
 class GEOM_EdgeSource;
 class GEOM_WireframeFace;
 class GEOM_ShadingFace;
+class vtkPolyData;
 
 namespace GEOM
 {
-  // moved from GEOM_AssemblyBuilder
-  OCC2VTK_EXPORT void MeshShape(const TopoDS_Shape theShape,
-                                float& theDeflection,
-                                bool theForced = true);
-  
-  // moved from GEOM_Actor
-  OCC2VTK_EXPORT void SetShape(const TopoDS_Shape& theShape,
-                               const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap,
-                               bool theIsVector,
-                               GEOM_VertexSource* theStandaloneVertexSource,
-                               GEOM_EdgeSource* theIsolatedEdgeSource,
-                               GEOM_EdgeSource* theOneFaceEdgeSource,
-                               GEOM_EdgeSource* theSharedEdgeSource,
-                               GEOM_WireframeFace* theWireframeFaceSource,
-                               GEOM_ShadingFace* theShadingFaceSource);
+  /*!
+   * \brief Convert shape to the VTK data sources
+   * \param theShape shape
+   * \param theEdgeMape map that stores face-to-edge relations
+   * \param theIsVector boolen flag, when \c true causes generating additional
+   * dataset for edges orientation vectors
+   * \param theStandaloneVertexSource output standalone vertices data source
+   * \param theIsolatedEdgeSource output standalone edges data source
+   * \param theOneFaceEdgeSource output face edges data source
+   * \param theSharedEdgeSource output face shared edges data source
+   * \param theWireframeFaceSource output wireframe mode faces data source
+   * \param theShadingFaceSource output shading mode faces data source
+   */
+  OCC2VTK_EXPORT void ShapeToVTK( const TopoDS_Shape& theShape,
+                                 const TopTools_IndexedDataMapOfShapeListOfShape& theEdgeMap,
+                                 bool theIsVector,
+                                 GEOM_VertexSource* theStandaloneVertexSource,
+                                 GEOM_EdgeSource* theIsolatedEdgeSource,
+                                 GEOM_EdgeSource* theOneFaceEdgeSource,
+                                 GEOM_EdgeSource* theSharedEdgeSource,
+                                 GEOM_WireframeFace* theWireframeFaceSource,
+                                 GEOM_ShadingFace* theShadingFaceSource );
+
+  /*!
+   * \brief Get VTK mesh data from the shape
+   * \param theShape shape
+   * \param theDeflection requested deflection coefficient
+   * \return VTK data set
+   */
+  OCC2VTK_EXPORT vtkPolyData* GetVTKData( const TopoDS_Shape& theShape, float theDeflection );
 }
 
 #endif // OCC2VTK_TOOLS_H
index 0f8ae114eff9e5a19b7626f3879a1693e94cfa6e..4fa28ace00c1a105ae30669dbfc143dcf7eb7f99 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -76,6 +76,7 @@ SET(OperationGUI_HEADERS
   OperationGUI_GetSharedShapesDlg.h
   OperationGUI_ExtrudedFeatureDlg.h
   OperationGUI_ClippingDlg.h
+  OperationGUI_TransferDataDlg.h
   )
 
 # header files / to be processed by moc
@@ -89,6 +90,7 @@ SET(_moc_HEADERS
   OperationGUI_GetSharedShapesDlg.h
   OperationGUI_ExtrudedFeatureDlg.h
   OperationGUI_ClippingDlg.h
+  OperationGUI_TransferDataDlg.h
   )
 
 # header files / uic wrappings
@@ -110,6 +112,7 @@ SET(OperationGUI_SOURCES
   OperationGUI_ChamferDlg.cxx
   OperationGUI_ExtrudedFeatureDlg.cxx
   OperationGUI_ClippingDlg.cxx
+  OperationGUI_TransferDataDlg.cxx
   ${_moc_SOURCES}
   ${_uic_files}
   )
index a705e0ae2a02f96d0e57cf0c30abc2da149bb174..3288921ab0614df4ad1bad908021825c36de5197 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -39,6 +39,7 @@
 #include "OperationGUI_GetShapesOnShapeDlg.h"
 #include "OperationGUI_GetSharedShapesDlg.h"
 #include "OperationGUI_ExtrudedFeatureDlg.h" // Methods EXTRUDED BOSS / CUT
+#include "OperationGUI_TransferDataDlg.h"
 
 //=======================================================================
 // function : OperationGUI()
@@ -81,6 +82,7 @@ bool OperationGUI::OnGUIEvent (int theCommandID, SUIT_Desktop* parent)
   case GEOMOp::OpExtrudedCut:   (new OperationGUI_ExtrudedFeatureDlg (CUT, getGeometryGUI(), parent))->show(); break;
   case GEOMOp::OpFillet1d:      (new OperationGUI_Fillet1d2dDlg      (getGeometryGUI(), parent, true))->show(); break;
   case GEOMOp::OpFillet2d:      (new OperationGUI_Fillet1d2dDlg      (getGeometryGUI(), parent, false))->show(); break;
+  case GEOMOp::OpTransferData:  (new OperationGUI_TransferDataDlg    (getGeometryGUI(), parent))->show(); break;
   default:
     app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
   }
index 63b8790098d9f26e591e07081d0cd4e372445f8d..b276f550eef5b6848ac29236a6dee845bce6f995 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f83a4c38e8fd8c9ff2fad8e247f6090fab724731..7464b05412d499c8d437c3889f67c9104147d875 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -306,3 +306,15 @@ void OperationGUI_ArchimedeDlg::ValueChangedInSpinBox(double newValue)
 {
   processPreview();
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> OperationGUI_ArchimedeDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myShape);
+  res << aGeomObjPtr;
+  return res;
+}
index 82a7af7bcb6646f808fefa3d064843d1c12e92fa..9e08d32f2768e4998276fb356a2a8aa55337b5fc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -47,7 +47,8 @@ protected:
   // redefined from GEOMBase_Helper
   virtual GEOM::GEOM_IOperations_ptr  createOperation();
   virtual bool                        isValid( QString& );
-  virtual bool                        execute( ObjectList& );    
+  virtual bool                        execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
 private:
   void                                Init();
index 88f8f7d2efbd6d0d54ac0fe8441a54e543aab785..8be967e9af8da8d8438c1da7512e98e6a36364a4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -966,3 +966,15 @@ void OperationGUI_ChamferDlg::RadioButtonPressed()
 
   processPreview();
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> OperationGUI_ChamferDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myShape);
+  res << aGeomObjPtr;
+  return res;
+}
index 5e0712290cd2275b59643baba1db932efdd40fc9..0b3c4b9708b927ce41caa1973d0f088ff54243d6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -66,6 +66,7 @@ protected:
   virtual                             GEOM::GEOM_IOperations_ptr createOperation();
   virtual                             bool isValid( QString& );
   virtual                             bool execute( ObjectList& );    
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
 private slots:
   void                                ClickOnOk();
index 35e9ef526e0cec8ccbd1ebdb17fef58eb6eab38c..62a8b7fbd7adb7b9f936358d0e2a4fa30392e23d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index d0d8067ec0af9873f2dfaa79ffb6b3339db9184c..c84b7f0ac3407f0ac4d65c6d8b1d97ec6468cc9f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3bf9ed58af6d6292ba4d93f0bd6ca4bb2fe26cd3..8812cd5ee0e6d96ebf1fe0c0ab2a9541597ea2dd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -365,14 +365,9 @@ bool OperationGUI_ExtrudedFeatureDlg::execute (ObjectList& objects)
   
   if (myGroup->PushButton3->isChecked())
     angle=myGroup->SpinBox_DY->value();
-  
-  if (myGroup->PushButton4->isChecked())
-  {
-    aHeight = -aHeight;
-    angle   = -angle;
-  }
     
-  bool isProtrusion = (myOperation == OperationGUI::BOSS);  
+  bool isProtrusion = (myOperation == OperationGUI::BOSS);
+  bool isInvert = myGroup->PushButton4->isChecked();
   
   // Hide the initial shape in order to see the modifications on the preview
   erase(myObject1.get(),false); 
@@ -380,9 +375,18 @@ bool OperationGUI_ExtrudedFeatureDlg::execute (ObjectList& objects)
   GEOM::GEOM_Object_var anObj = anOper->MakeDraftPrism(myObject1.get(), myObject2.get(), 
                                                        aHeight,
                                                        angle,
-                                                       isProtrusion);
-  if (!anObj->_is_nil())
+                                                       isProtrusion,
+                                                       isInvert);
+  if (!anObj->_is_nil()) {
+    if (!IsPreview()) {
+      QStringList aParameters;
+      aParameters << myGroup->SpinBox_DX->text();
+      if (myGroup->PushButton3->isChecked())
+        aParameters << myGroup->SpinBox_DY->text();
+      anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+    }
     objects.push_back(anObj._retn());
+  }
 
   return true;
 }
@@ -395,3 +399,14 @@ bool OperationGUI_ExtrudedFeatureDlg::execute (ObjectList& objects)
 // {
 //   GEOMBase::PublishSubObject( myObject2.get() );
 // }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> OperationGUI_ExtrudedFeatureDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myObject1 << myObject2;
+  return res;
+}
index e5d384b269a96fbbd1e039b9da4406cea4a2c91f..fdbd59edd72e0062a32e6eb5360522ac79ae79c0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -62,6 +62,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
 //   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
   
 private:
   void                        Init();
index 5952cd4ce91b9072358ce9b127f5a0fab4be96d7..2de8fbc4004699b89b3f993d5e9131b17bbf046b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -411,8 +411,14 @@ bool OperationGUI_Fillet1d2dDlg::execute (ObjectList& objects)
     anOper->MakeFillet1D(myShape, getRadius(), aListOfIndexes, GroupVertexes->CheckButton1->isChecked()) : 
     anOper->MakeFillet2D(myShape, getRadius(), aListOfIndexes);
 
-  if (!anObj->_is_nil())
+  if (!anObj->_is_nil()) {
+    if (!IsPreview()) {
+      QStringList aParameters;
+      aParameters << GroupVertexes->SpinBox_DX->text();
+      anObj->SetParameters(aParameters.join(":").toUtf8().constData());
+    }
     objects.push_back(anObj._retn());
+  }
 
   return true;
 }
@@ -425,3 +431,15 @@ double OperationGUI_Fillet1d2dDlg::getRadius() const
 {
   return GroupVertexes->SpinBox_DX->value();
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> OperationGUI_Fillet1d2dDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myShape);
+  res << aGeomObjPtr;
+  return res;
+}
index f203671d51d32e24891c0a3c11dca27bbe4727fd..07454eafc0e050b4922464128f854f9d91e31aca 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -47,6 +47,7 @@ protected:
   virtual                             GEOM::GEOM_IOperations_ptr createOperation();
   virtual                             bool isValid( QString& );
   virtual                             bool execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
 private slots:
   void                                ClickOnOk();
index 13de9405b431934c62289dadf504e042b3604a21..c3170d914b3c2e850a7fa6e4431e0d950231b419 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -754,3 +754,15 @@ void OperationGUI_FilletDlg::RadioButtonClicked()
 
   processPreview();
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> OperationGUI_FilletDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myShape);
+  res << aGeomObjPtr;
+  return res;
+}
index edaaa40f7a0ab76b949d8ac6825b8662b0261398..9f1790633b0d31b4b83f47e02ec4e3487c0444a0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual                             GEOM::GEOM_IOperations_ptr createOperation();
   virtual                             bool isValid( QString& );
   virtual                             bool execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>     getSourceObjects();
 
 private slots:
   void                                ClickOnOk();
index dfecdde30b1c9969dc889edf91e76003946d2cb1..f120c3a542c16533497f75f3bf82354a3071f1fe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -353,3 +353,15 @@ void OperationGUI_GetShapesOnShapeDlg::ComboTextChanged()
   //bool IsEnabled = GroupPoints->ComboBox1->currentIndex() < 3;
   processPreview();
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> OperationGUI_GetShapesOnShapeDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr1(myObject1), aGeomObjPtr2(myObject2);
+  res << aGeomObjPtr1 << aGeomObjPtr2;
+  return res;
+}
index 25dac2b6903e2cdbed084f23babf1a127f117f10..e5e57b3f9ac64422b0656f5744d7a4f8d7e0ebdf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -46,6 +46,7 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index c5880d796c46df914b08d444afe6d2e60cc3147f..9ca2d5ab302330a6fc7db4adb45a05151a871a96 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <TopoDS_Iterator.hxx>
 #include <TopoDS_Shape.hxx>
 
+namespace
+{
+  GEOM::shape_type maxShapeType(const GEOM::ListOfGO& objs)
+  {
+    GEOM::shape_type r = GEOM::SHAPE;
+    for ( int i = 0; i < objs.length(); i++ ) {
+      GEOM::shape_type t = objs[i]->GetShapeType();
+      if ( t == GEOM::COMPOUND || t == GEOM::COMPSOLID )
+        t = objs[i]->GetMaxShapeType();
+      else if ( t < GEOM::VERTEX )
+        t = GEOM::shape_type( (int)t+1 );
+      r = qMin( r, t );
+      if ( r <= GEOM::SOLID ) break;
+    }
+    return r;
+  }
+}
+
 //=================================================================================
 // class    : OperationGUI_GetSharedShapesDlg()
 // purpose  : Constructs a OperationGUI_GetSharedShapesDlg which is a child of 'parent', with the
@@ -75,7 +93,7 @@ OperationGUI_GetSharedShapesDlg::OperationGUI_GetSharedShapesDlg
   GroupPoints->LineEdit1->setReadOnly(true);
   GroupPoints->LineEdit2->hide();
   GroupPoints->LineEdit1->setEnabled(true);
-  GroupPoints->CheckButton1->hide();
+  GroupPoints->CheckButton1->setText(tr("GEOM_SHARED_SHAPES_MULTISHARE"));
 
   QVBoxLayout* layout = new QVBoxLayout(centralWidget());
   layout->setMargin(0); layout->setSpacing(6);
@@ -103,15 +121,7 @@ OperationGUI_GetSharedShapesDlg::~OperationGUI_GetSharedShapesDlg()
 //=================================================================================
 void OperationGUI_GetSharedShapesDlg::Init()
 {
-  /* type for sub-shape selection */
-  GroupPoints->ComboBox1->addItem(tr("GEOM_SOLID"));
-  GroupPoints->ComboBox1->addItem(tr("GEOM_SHELL"));
-  GroupPoints->ComboBox1->addItem(tr("GEOM_FACE"));
-  GroupPoints->ComboBox1->addItem(tr("GEOM_WIRE"));
-  GroupPoints->ComboBox1->addItem(tr("GEOM_EDGE"));
-  GroupPoints->ComboBox1->addItem(tr("GEOM_VERTEX"));
-
-  GroupPoints->ComboBox1->setCurrentIndex(0);
+  initTypes();
 
   showOnlyPreviewControl();
 
@@ -127,6 +137,8 @@ void OperationGUI_GetSharedShapesDlg::Init()
 
   connect(GroupPoints->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
 
+  connect(GroupPoints->CheckButton1, SIGNAL(clicked()), this, SLOT(processPreview()));
+
   connect(myGeomGUI->getApp()->selectionMgr(),
            SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
@@ -137,6 +149,35 @@ void OperationGUI_GetSharedShapesDlg::Init()
   GroupPoints->PushButton1->click();
 }
 
+void OperationGUI_GetSharedShapesDlg::initTypes()
+{
+  GEOM::shape_type t = maxShapeType( myListShapes );
+
+  int idx = GroupPoints->ComboBox1->count() > 0 ? 
+    GroupPoints->ComboBox1->itemData( GroupPoints->ComboBox1->currentIndex() ).toInt() : -1;
+
+  GroupPoints->ComboBox1->clear();
+
+  if ( t == GEOM::SHAPE || t <= GEOM::SOLID )
+    GroupPoints->ComboBox1->addItem( tr( "GEOM_SOLID" ), int( GEOM::SOLID ) );
+  if ( t == GEOM::SHAPE || t <= GEOM::SHELL )
+    GroupPoints->ComboBox1->addItem( tr( "GEOM_SHELL" ), int( GEOM::SHELL ) );
+  if ( t == GEOM::SHAPE || t <= GEOM::FACE )
+    GroupPoints->ComboBox1->addItem( tr( "GEOM_FACE" ), int( GEOM::FACE ) );
+  if ( t == GEOM::SHAPE || t <= GEOM::WIRE )
+    GroupPoints->ComboBox1->addItem( tr( "GEOM_WIRE" ), int( GEOM::WIRE ) );
+  if ( t == GEOM::SHAPE || t <= GEOM::EDGE )
+    GroupPoints->ComboBox1->addItem( tr( "GEOM_EDGE" ), int( GEOM::EDGE ) );
+  if ( t == GEOM::SHAPE || t <= GEOM::VERTEX )
+    GroupPoints->ComboBox1->addItem( tr( "GEOM_VERTEX" ), int( GEOM::VERTEX ) );
+
+  idx = GroupPoints->ComboBox1->findData( idx );
+  GroupPoints->ComboBox1->setCurrentIndex( idx >= 0 ? idx : 0 );
+
+  if ( idx < 0 )
+    ComboTextChanged();
+}
+
 //=================================================================================
 // function : ConstructorsClicked()
 // purpose  : Radio button management
@@ -148,7 +189,6 @@ void OperationGUI_GetSharedShapesDlg::ConstructorsClicked (int constructorId)
 
   myListShapes.length(0);
 
-  GroupPoints->ComboBox1->setCurrentIndex(0);
   GroupPoints->PushButton1->setDown(true);
 
   myEditCurrentArgument = GroupPoints->LineEdit1;
@@ -210,6 +250,9 @@ void OperationGUI_GetSharedShapesDlg::SelectionIntoArgument()
   }
 
   GEOMBase::ConvertListOfIOInListOfGO(aSelList, myListShapes, true);
+
+  initTypes();
+
   if (!myListShapes.length())
     return;
 
@@ -278,19 +321,8 @@ void OperationGUI_GetSharedShapesDlg::ComboTextChanged()
 //=================================================================================
 int OperationGUI_GetSharedShapesDlg::GetType() const
 {
-  int aLimit = GroupPoints->ComboBox1->currentIndex();
-
-  switch (aLimit) {
-  case 0:  aLimit = GEOM::SOLID ; break;
-  case 1:  aLimit = GEOM::SHELL ; break;
-  case 2:  aLimit = GEOM::FACE  ; break;
-  case 3:  aLimit = GEOM::WIRE  ; break;
-  case 4:  aLimit = GEOM::EDGE  ; break;
-  case 5:  aLimit = GEOM::VERTEX; break;
-  default: aLimit = GEOM::SHAPE ;
-  }
-
-  return aLimit;
+  return GroupPoints->ComboBox1->count() > 0 ?
+    GroupPoints->ComboBox1->itemData( GroupPoints->ComboBox1->currentIndex() ).toInt() : (int)GEOM::SHAPE;
 }
 
 //=================================================================================
@@ -308,11 +340,13 @@ GEOM::GEOM_IOperations_ptr OperationGUI_GetSharedShapesDlg::createOperation()
 //=================================================================================
 bool OperationGUI_GetSharedShapesDlg::isValid (QString& msg)
 {
-  if (myListShapes.length() < 2) {
+  bool isOK = myListShapes.length() > 1 ||
+    ( myListShapes.length() > 0 && myListShapes[0]->GetShapeType() == GEOM::COMPOUND );
+
+  if ( !isOK )
     msg = tr("MSG_SHARED_SHAPES_TOO_FEW_SHAPES");
-    return false;
-  }
-  return true;
+
+  return isOK;
 }
 
 //=================================================================================
@@ -322,7 +356,7 @@ bool OperationGUI_GetSharedShapesDlg::isValid (QString& msg)
 bool OperationGUI_GetSharedShapesDlg::execute (ObjectList& objects)
 {
   GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
-  GEOM::ListOfGO_var aList = anOper->GetSharedShapesMulti(myListShapes, GetType());
+  GEOM::ListOfGO_var aList = anOper->GetSharedShapesMulti(myListShapes, GetType(), GroupPoints->CheckButton1->isChecked());
 
   if (!aList->length())
     return false;
@@ -357,17 +391,30 @@ QString OperationGUI_GetSharedShapesDlg::getPrefixByType () const
 {
   QString aPref;
 
-  int aLimit = GroupPoints->ComboBox1->currentIndex();
-
-  switch (aLimit) {
-  case 0:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SOLID")) ; break;
-  case 1:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHELL")) ; break;
-  case 2:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_FACE"))  ; break;
-  case 3:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_WIRE"))  ; break;
-  case 4:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_EDGE"))  ; break;
-  case 5:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_VERTEX")); break;
-  default: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHAPE")) ;
+  switch ( GetType() ) {
+  case GEOM::SOLID:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SOLID")) ; break;
+  case GEOM::SHELL:  aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHELL")) ; break;
+  case GEOM::FACE:   aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_FACE"))  ; break;
+  case GEOM::WIRE:   aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_WIRE"))  ; break;
+  case GEOM::EDGE:   aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_EDGE"))  ; break;
+  case GEOM::VERTEX: aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_VERTEX")); break;
+  default:           aPref = tr("GEOM_SHARED_SHAPE").arg(tr("GEOM_SHAPE")) ; break;
   }
 
   return aPref;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> OperationGUI_GetSharedShapesDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::ListOfGO aListPtr(myListShapes);
+  for (int i = 0; i < aListPtr.length(); i++) {
+    GEOM::GeomObjPtr aGeomObjPtr(aListPtr[i]);
+    res << aGeomObjPtr;
+  }
+  return res;
+}
index 37edbcae38996b793c0d6e832882b2fa3c5422bf..c23ea6ba7175115f325f0fcc723e5ed7720af52f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -48,11 +48,13 @@ protected:
   virtual bool                       execute (ObjectList&);
   virtual GEOM::GEOM_Object_ptr      getFather (GEOM::GEOM_Object_ptr);
   QString                            getPrefixByType() const;
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
   void                               enterEvent (QEvent*);
   int                                GetType() const;
+  void                               initTypes();
 
 private:
   GEOM::ListOfGO                     myListShapes;
index 725959399dd8b52f94fafbde1647c65f873c0fb7..a717e7268315c2427a18385914f58636d055753f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 562a5f813842397abf83879493ffd24e99663a04..3b6a0c15a48bf883c91a141128e7cf062995ba75 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 07ea18eb4c6a63f940499f785700b2bc95f96d0d..879682388db068d2fdada77290d2761ea5dbdc03 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -67,6 +67,8 @@ OperationGUI_PartitionDlg::OperationGUI_PartitionDlg( GeometryGUI* theGeometryGU
   mainFrame()->GroupConstructors->setTitle( tr( "GEOM_PARTITION" ) );
   mainFrame()->RadioButton1->setIcon( image0 );
   mainFrame()->RadioButton2->setIcon( image1 );
+  mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
+  mainFrame()->RadioButton2->close();
   mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
   mainFrame()->RadioButton3->close();
 
@@ -551,3 +553,29 @@ int OperationGUI_PartitionDlg::GetLimit() const
 
   return aLimit;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> OperationGUI_PartitionDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  for (int i = 0; i < myListShapes.length(); i++) {
+    GEOM::GeomObjPtr aGeomObjPtr(myListShapes[i]);
+    res << aGeomObjPtr;
+  }
+  for (int i = 0; i < myListTools.length(); i++) {
+    GEOM::GeomObjPtr aGeomObjPtr(myListTools[i]);
+    res << aGeomObjPtr;
+  }
+  for (int i = 0; i < myListRemoveInside.length(); i++) {
+    GEOM::GeomObjPtr aGeomObjPtr(myListRemoveInside[i]);
+    res << aGeomObjPtr;
+  }
+  for (int i = 0; i < myListKeepInside.length(); i++) {
+    GEOM::GeomObjPtr aGeomObjPtr(myListKeepInside[i]);
+    res << aGeomObjPtr;
+  }
+  return res;
+}
index 242eb12a49ed00247fcd12cbf3e091520b7c7cbf..a505165beb55239eded26d236837184d823bcdbb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
diff --git a/src/OperationGUI/OperationGUI_TransferDataDlg.cxx b/src/OperationGUI/OperationGUI_TransferDataDlg.cxx
new file mode 100755 (executable)
index 0000000..6420e28
--- /dev/null
@@ -0,0 +1,342 @@
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 "OperationGUI_TransferDataDlg.h"
+
+#include <DlgRef.h>
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
+
+#include <SUIT_Desktop.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SalomeApp_Application.h>
+#include <LightApp_SelectionMgr.h>
+
+//==============================================================================
+// class    : OperationGUI_TransferDataDlg()
+// purpose  : Constructs a OperationGUI_TransferDataDlg which is a child of
+//            'parent'.
+//=================================================================================
+OperationGUI_TransferDataDlg::OperationGUI_TransferDataDlg (GeometryGUI* theGeometryGUI,
+                                                            QWidget* parent)
+  : GEOMBase_Skeleton(theGeometryGUI, parent, false),
+    myGroup(NULL)
+{
+  SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
+  QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICON_DLG_TRANSFER_DATA")));
+  QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+
+  setWindowTitle(tr("GEOM_TRANSFER_DATA_TITLE"));
+
+  /***************************************************************/
+  mainFrame()->GroupConstructors->setTitle(tr("GEOM_TRANSFER_DATA"));
+  mainFrame()->RadioButton1->setIcon(image0);
+  mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
+  mainFrame()->RadioButton2->close();
+  mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
+  mainFrame()->RadioButton3->close();
+
+  mainFrame()->GroupBoxName->hide();
+
+  myGroup = new DlgRef_2Sel1List(centralWidget());
+  myGroup->GroupBox1->setTitle(tr("GEOM_PARAMETERS"));
+  myGroup->TextLabel1->setText(tr("GEOM_TRANSFER_DATA_FROM"));
+  myGroup->TextLabel2->setText(tr("GEOM_TRANSFER_DATA_TO"));
+  myGroup->TextLabel3->setText(tr("GEOM_TRANSFER_DATA_METHOD"));
+  myGroup->PushButton1->setIcon(image1);
+  myGroup->PushButton2->setIcon(image1);
+  myGroup->LineEdit1->setReadOnly(true);
+  myGroup->LineEdit2->setReadOnly(true);
+
+  QVBoxLayout* layout = new QVBoxLayout(centralWidget());
+  layout->setMargin(0); layout->setSpacing(6);
+  layout->addWidget(myGroup);
+  /***************************************************************/
+
+  setHelpFileName("transfer_data_page.html");
+
+  Init();
+}
+
+//=================================================================================
+// function : ~OperationGUI_TransferDataDlg
+// purpose  : Destroys the object and frees any allocated resources
+//=================================================================================
+OperationGUI_TransferDataDlg::~OperationGUI_TransferDataDlg()
+{
+}
+
+//=================================================================================
+// function : Init()
+// purpose  :
+//=================================================================================
+void OperationGUI_TransferDataDlg::Init()
+{
+  // type for detection
+  myGroup->ComboBox1->addItem(tr("GEOM_TD_METHOD_GETINPLACE"));
+  myGroup->ComboBox1->addItem(tr("GEOM_TD_METHOD_GETINPLACE_OLD"));
+  myGroup->ComboBox1->addItem(tr("GEOM_TD_METHOD_GETINPLACE_HISTORY"));
+
+  myGroup->LineEdit1->clear();
+  myGroup->LineEdit2->clear();
+  myObject1.nullify();
+  myObject2.nullify();
+
+  // signals and slots connections
+  connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+  connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+
+  connect(myGroup->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+  connect(myGroup->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+
+  connect(myGroup->LineEdit1, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+  connect(myGroup->LineEdit2, SIGNAL(returnPressed()), this, SLOT(LineEditReturnPressed()));
+
+  connect(myGroup->ComboBox1, SIGNAL(activated(int)), this, SLOT(ComboTextChanged()));
+
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+          this, SLOT(SelectionIntoArgument()));
+
+  myGroup->TextLabel3->show();
+  myGroup->ComboBox1->show();
+  myGroup->ComboBox1->setCurrentIndex(0);
+
+  globalSelection(GEOM_ALLSHAPES);
+
+  myGroup->PushButton1->click();
+  SelectionIntoArgument();
+  resize(100,100);
+}
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose  :
+//=================================================================================
+void OperationGUI_TransferDataDlg::ClickOnOk()
+{
+  setIsApplyAndClose( true );
+  if (ClickOnApply())
+    ClickOnCancel();
+}
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose  :
+//=================================================================================
+bool OperationGUI_TransferDataDlg::ClickOnApply()
+{
+  if (!onAccept(false))
+    return false;
+  // activate first line edit
+  myGroup->PushButton1->click();
+  return true;
+}
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose  : Called when selection is changed or on dialog initialization or activation
+//=================================================================================
+void OperationGUI_TransferDataDlg::SelectionIntoArgument()
+{
+  GEOM::GeomObjPtr aSelectedObject = getSelected(TopAbs_SHAPE);
+
+  if (aSelectedObject) {
+    myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject.get()));
+
+    if (myEditCurrentArgument == myGroup->LineEdit1) {
+      myObject1 = aSelectedObject;
+
+      if (!myObject2) {
+        myGroup->PushButton2->click();
+      }
+    } else if (myEditCurrentArgument == myGroup->LineEdit2) {
+      myObject2 = aSelectedObject;
+
+      if (!myObject1) {
+        myGroup->PushButton1->click();
+      }
+    }
+  } else {
+    myEditCurrentArgument->setText("");
+
+    if (myEditCurrentArgument == myGroup->LineEdit1) {
+      myObject1.nullify();
+    } else if (myEditCurrentArgument == myGroup->LineEdit2) {
+      myObject2.nullify();
+    }
+  }
+}
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose  :
+//=================================================================================
+void OperationGUI_TransferDataDlg::SetEditCurrentArgument()
+{
+  QPushButton* send = (QPushButton*)sender();
+
+  if      (send == myGroup->PushButton1) {
+    myEditCurrentArgument = myGroup->LineEdit1;
+
+    myGroup->PushButton2->setDown(false);
+    myGroup->LineEdit2->setEnabled(false);
+  }
+  else if (send == myGroup->PushButton2) {
+    myEditCurrentArgument = myGroup->LineEdit2;
+
+    myGroup->PushButton1->setDown(false);
+    myGroup->LineEdit1->setEnabled(false);
+  }
+
+  // enable line edit
+  myEditCurrentArgument->setEnabled(true);
+  myEditCurrentArgument->setFocus();
+  // after setFocus(), because it will be setDown(false) when loses focus
+  send->setDown(true);
+}
+
+//=================================================================================
+// function : LineEditReturnPressed()
+// purpose  :
+//=================================================================================
+void OperationGUI_TransferDataDlg::LineEditReturnPressed()
+{
+  QLineEdit* send = (QLineEdit*)sender();
+  if (send == myGroup->LineEdit1 || send == myGroup->LineEdit2)
+  {
+    myEditCurrentArgument = send;
+    GEOMBase_Skeleton::LineEditReturnPressed();
+  }
+}
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose  :
+//=================================================================================
+void OperationGUI_TransferDataDlg::ActivateThisDialog()
+{
+  GEOMBase_Skeleton::ActivateThisDialog();
+  globalSelection(GEOM_ALLSHAPES);
+  connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+           this, SLOT( SelectionIntoArgument() ) );
+}
+
+//=================================================================================
+// function : enterEvent()
+// purpose  : when mouse enter onto the QWidget
+//=================================================================================
+void OperationGUI_TransferDataDlg::enterEvent (QEvent*)
+{
+  if (!mainFrame()->GroupConstructors->isEnabled())
+    ActivateThisDialog();
+}
+
+//=================================================================================
+// function : createOperation
+// purpose  :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr OperationGUI_TransferDataDlg::createOperation()
+{
+  return getGeomEngine()->GetIInsertOperations(getStudyId());
+}
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool OperationGUI_TransferDataDlg::isValid(QString&)
+{
+  return myObject1 && myObject2;
+}
+
+//=================================================================================
+// function : execute
+// purpose  :
+//=================================================================================
+bool OperationGUI_TransferDataDlg::execute (ObjectList& objects)
+{
+  const int aLimit = myGroup->ComboBox1->currentIndex();
+  GEOM::find_shape_method aMethod;
+
+  switch (aLimit)
+  {
+  case 0:
+    aMethod = GEOM::FSM_GetInPlace;
+    break;
+  case 1:
+    aMethod = GEOM::FSM_GetInPlace_Old;
+    break;
+  case 2:
+  default:
+    aMethod = GEOM::FSM_GetInPlaceByHistory;
+    break;
+  }
+
+  GEOM::GEOM_IInsertOperations_var anOper =
+    GEOM::GEOM_IInsertOperations::_narrow(getOperation());
+  GEOM::GEOM_IInsertOperations::ListOfTransferDatum_var aResult;
+
+  bool isOK = anOper->TransferData
+    (myObject1.get(), myObject2.get(), aMethod, aResult);
+
+  if (isOK) {
+    // Construct info message.
+    QString aMsg;
+    int aNbTypes = aResult->length();
+
+    if (aNbTypes == 0) {
+      aMsg = tr("GEOM_TRANSFER_DATA_NOT_COPIED");
+    } else {
+      aMsg = tr("GEOM_TRANSFER_DATA_COPIED");
+      aMsg += "\n";
+      int i;
+
+      for (i = 0; i < aNbTypes; i++ ) {
+        if (i > 0) {
+          aMsg += "\n";
+        }
+
+        aMsg += tr(aResult[i].myName).
+                  arg(aResult[i].myNumber).arg(aResult[i].myMaxNumber);
+      }
+    }
+
+    // Show info message.
+    SUIT_MessageBox::information
+            (SUIT_Session::session()->activeApplication()->desktop(),
+             tr("GEOM_TRANSFER_DATA_INFO"), aMsg, tr("BUT_OK"));
+
+    objects.push_back(myObject2.copy());
+  }
+
+  return isOK;
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> OperationGUI_TransferDataDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myObject1;
+  return res;
+}
diff --git a/src/OperationGUI/OperationGUI_TransferDataDlg.h b/src/OperationGUI/OperationGUI_TransferDataDlg.h
new file mode 100644 (file)
index 0000000..9247457
--- /dev/null
@@ -0,0 +1,69 @@
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 OPERATIONGUI_TRANSFERDATADLG_H
+#define OPERATIONGUI_TRANSFERDATADLG_H
+
+
+#include <GEOMBase_Skeleton.h>
+
+class DlgRef_2Sel1List;
+
+//=================================================================================
+// class    : OperationGUI_TransferDataDlg
+// purpose  :
+//=================================================================================
+class OperationGUI_TransferDataDlg : public GEOMBase_Skeleton
+{
+  Q_OBJECT
+
+public:
+  OperationGUI_TransferDataDlg
+            ( GeometryGUI* theGeometryGUI, QWidget* parent = 0 );
+  ~OperationGUI_TransferDataDlg();
+
+protected:
+  // redefined from GEOMBase_Helper
+  virtual GEOM::GEOM_IOperations_ptr createOperation();
+  virtual bool                       isValid( QString& );
+  virtual bool                       execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
+
+private:
+  void                               Init();
+  void                               enterEvent( QEvent* );
+
+private:
+  GEOM::GeomObjPtr                   myObject1;
+  GEOM::GeomObjPtr                   myObject2;
+  int                                myShapeType;
+
+  DlgRef_2Sel1List*                  myGroup;
+
+private slots:
+  void                               ClickOnOk();
+  bool                               ClickOnApply();
+  void                               SetEditCurrentArgument();
+  void                               SelectionIntoArgument();
+  void                               LineEditReturnPressed();
+  void                               ActivateThisDialog();
+};
+
+#endif // OPERATIONGUI_GETSHAPESONSHAPEDLG_H
index 59968b1ce7e9fa7d10c08bbc607b42cdc86ad490..e90b50c65780000b8ec98dfe7c05d33a412ffcba 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 97e92d5acc1b30e09c1cd9cc2e819e942ed3ce1e..aa2c8552a28c25c60387368ee47683572ba860ba 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 8c417383422d46808184c6be52510c468186c8c3..4432f0db6cd17c53301622400105b2f22d158f0e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index f4b34d0fcdc31c29bc934a00f07d8fe5432191b7..f18df7940ea3a08a2fca26cb0a0aca1554806974 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -307,7 +307,7 @@ void PrimitiveGUI_BoxDlg::SetEditCurrentArgument()
 
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   globalSelection(); // close local contexts, if any
-  localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+  localSelection(TopAbs_VERTEX);
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 
@@ -323,7 +323,7 @@ void PrimitiveGUI_BoxDlg::ActivateThisDialog()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
   if (getConstructorId() == 0) {
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
     connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
             this, SLOT(SelectionIntoArgument()));
   }
@@ -439,3 +439,14 @@ void PrimitiveGUI_BoxDlg::addSubshapesToStudy()
     GEOMBase::PublishSubObject( myPoint2.get() );
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> PrimitiveGUI_BoxDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint1 << myPoint2;
+  return res;
+}
index 0fd8e4467f5e0f0aa5256e43e15cb24a7ebe022f..df3d1050b22982d47a5c5b890ae47b7eec455d0b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 1e614ef0b6f2536b60a6de039228d99e5a2b9fbd..a69ddf95759af526137324609660a45e091d5ec4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -308,7 +308,7 @@ void PrimitiveGUI_ConeDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
 
     globalSelection(GEOM_POINT); // to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton2) {
     myEditCurrentArgument = GroupPoints->LineEdit2;
@@ -317,7 +317,7 @@ void PrimitiveGUI_ConeDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit1->setEnabled(false);
 
     globalSelection(GEOM_LINE);// to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -498,3 +498,14 @@ void PrimitiveGUI_ConeDlg::addSubshapesToStudy()
     GEOMBase::PublishSubObject( myDir.get() );
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> PrimitiveGUI_ConeDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint << myDir;
+  return res;
+}
index dc094f8b7b09d15bc04d1281bb4cf2cdc6afd23a..6859fa0dbfeb6f84e11ab13bd5baeef47f23ef31 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 66333aa2466c12b9064fe82ffea0c274c04502a6..fce60b91c95ffcd410d4d78eeda1eb4a84f71f59 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -317,7 +317,7 @@ void PrimitiveGUI_CylinderDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
 
     globalSelection(GEOM_POINT); // to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton2) {
     myEditCurrentArgument = GroupPoints->LineEdit2;
@@ -326,7 +326,7 @@ void PrimitiveGUI_CylinderDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit1->setEnabled(false);
 
     globalSelection(GEOM_LINE);  // to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -411,7 +411,7 @@ bool PrimitiveGUI_CylinderDlg::isValid (QString& msg)
   {
     ok = GroupDimensions->SpinBox_DX->isValid( msg, !IsPreview() ) &&
          GroupDimensions->SpinBox_DY->isValid( msg, !IsPreview() ) &&
-         ( GroupDimensions->checkBox->isChecked() || GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() ) );
+         ( !GroupDimensions->checkBox->isChecked() || GroupDimensions->SpinBox_DZ->isValid( msg, !IsPreview() ) );
     if ( GroupDimensions->checkBox->isChecked() &&
         ( GroupDimensions->SpinBox_DZ->value() <= 0. || GroupDimensions->SpinBox_DZ->value() >= 360. ) ) {
       msg += tr("GEOM_CYLINDER_ANGLE_ERR") + "\n";
@@ -550,6 +550,17 @@ void PrimitiveGUI_CylinderDlg::addSubshapesToStudy()
   }
 }
 
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> PrimitiveGUI_CylinderDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint << myDir;
+  return res;
+}
+
 //=================================================================================
 // function :  ActivateAngle()
 // purpose  : enable the 
index 1a5ccc46bd27a8e95025b9d0b2008be7e4231ef2..c257ae901e2819e0a4cbbd62416e87f85142ece0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 502a4a9696d32d9f53ca9b941290fd23b408a535..d558048bf55229326626170aa23a1e7f1c818622 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -397,11 +397,11 @@ void PrimitiveGUI_DiskDlg::SetEditCurrentArgument()
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   if (myEditCurrentArgument == GroupPntVecR->LineEdit2) {
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   else {
     globalSelection(); // close local contexts, if any
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -562,3 +562,14 @@ void PrimitiveGUI_DiskDlg::addSubshapesToStudy()
     break;
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> PrimitiveGUI_DiskDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint << myDir << myPoint1 << myPoint2 << myPoint3;
+  return res;
+}
index b616096df92f7fce5c0d39d6cb6f14973a319bec..2a99edf1bb0eb0911361a54d2e62a73a003546ef 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -49,8 +49,8 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
-  
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
   
 private:
   void                               Init();
index 0869810791378cfc9219e2ccbc816d93c6fa1039..e36fd5fc0b5b5a20e4dc04adcd2f78c7c0c8e048 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -127,7 +127,7 @@ void PrimitiveGUI_FaceDlg::Init()
   myEdge.nullify();
   myFace.nullify();
   globalSelection(); // close local contexts, if any
-  //  localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+  //  localSelection( TopAbs_EDGE );
 
   myOrientationType = 1;
 
@@ -224,12 +224,12 @@ void PrimitiveGUI_FaceDlg::TypeButtonClicked()
 {
   if ( GroupType->RadioButton1->isChecked() ) {
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
     GroupPlane->TextLabel1->setText( tr( "GEOM_EDGE" ) );
   }
   else if ( GroupType->RadioButton2->isChecked() ) {
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+    localSelection( TopAbs_FACE );
     GroupPlane->TextLabel1->setText( tr( "GEOM_FACE" ) );
   }
   myEditCurrentArgument = GroupPlane->LineEdit1;
@@ -288,7 +288,7 @@ void PrimitiveGUI_FaceDlg::ConstructorsClicked( int constructorId )
   case 1:
     {
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+      localSelection( TopAbs_EDGE );
       myEditCurrentArgument = GroupPlane->LineEdit1;
       myEditCurrentArgument->setText("");
       myEdge.nullify();
@@ -362,9 +362,9 @@ void PrimitiveGUI_FaceDlg::SetEditCurrentArgument()
   if ( send == GroupPlane->PushButton1 ) {
     myEditCurrentArgument = GroupPlane->LineEdit1;
     if (GroupType->RadioButton1->isChecked())
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+      localSelection( TopAbs_EDGE );
     else if (GroupType->RadioButton1->isChecked())
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
+      localSelection( TopAbs_FACE );
   }
 
   myEditCurrentArgument->setFocus();
@@ -490,3 +490,14 @@ void PrimitiveGUI_FaceDlg::addSubshapesToStudy()
      GEOMBase::PublishSubObject( myFace.get() );
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> PrimitiveGUI_FaceDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myEdge << myFace;
+  return res;
+}
index bc2c398c0f07cbc7c693cb657ba7d4fd9f6ce0c3..f4cade400a9704090d33c3b9cbde34e6edc6f2ba 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -49,6 +49,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
     
 private:
   void                               Init();
index c8d891d5e6b6c16b700c112448e51e470d492db8..73e2c592fff8931a573283bc4b5673192698b8bb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -165,7 +165,7 @@ void PrimitiveGUI_SphereDlg::ConstructorsClicked( int constructorId )
   case 0:
     {
       globalSelection(); // close local contexts, if any
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+      localSelection( TopAbs_VERTEX );
 
       GroupDimensions->hide();
       GroupPoints->show();
@@ -268,7 +268,7 @@ void PrimitiveGUI_SphereDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit1->setFocus();
     myEditCurrentArgument = GroupPoints->LineEdit1;
     globalSelection(); // close local contexts, if any
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
+    localSelection( TopAbs_VERTEX );
     SelectionIntoArgument();
   }
 }
@@ -415,3 +415,14 @@ void PrimitiveGUI_SphereDlg::addSubshapesToStudy()
     GEOMBase::PublishSubObject( myPoint.get() );
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> PrimitiveGUI_SphereDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint;
+  return res;
+}
index 19611ac23073b328cbb94cebfac0e95f802bbc59..b905e234fa004c28fa9e2f6ffc55e6465f92e5dc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 443460a37a86b3db412d9d4c0a120a60a832077a..979e52412354e56da9d6c0d663443302cbe846eb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -296,7 +296,7 @@ void PrimitiveGUI_TorusDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
 
     globalSelection(GEOM_POINT); // to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton2) {
     myEditCurrentArgument = GroupPoints->LineEdit2;
@@ -305,7 +305,7 @@ void PrimitiveGUI_TorusDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit1->setEnabled(false);
 
     globalSelection(GEOM_LINE);  // to break previous local selection
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -467,3 +467,14 @@ void PrimitiveGUI_TorusDlg::addSubshapesToStudy()
     GEOMBase::PublishSubObject( myDir.get() );
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> PrimitiveGUI_TorusDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myPoint << myDir;
+  return res;
+}
index ed46a68dede9e2d23b00917f7cf2850fe2eeb02d..ff1c66fac536d56cf9f398203a018854ff81eb63 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 9cc1ac4192e15a0418134e38aa3df9255747da74..d9ae6fa297036529162433dab71a0711127fe2bc 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -41,6 +41,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/DlgRef
   ${PROJECT_BINARY_DIR}/src/DlgRef
   ${PROJECT_SOURCE_DIR}/src/GEOMAlgo
+  ${PROJECT_SOURCE_DIR}/src/GEOMUtils
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}
   )
@@ -55,6 +56,7 @@ ADD_DEFINITIONS(
 # libraries to link to
 SET(_link_LIBRARIES
   GEOMBase
+  GEOMUtils
   )
 
 # --- resources ---
@@ -83,6 +85,7 @@ SET(RepairGUI_HEADERS
   RepairGUI_RemoveExtraEdgesDlg.h
   RepairGUI_UnionFacesDlg.h
   RepairGUI_FuseEdgesDlg.h
+  RepairGUI_InspectObjectDlg.h
   )
 
 # header files / to be processed by moc
@@ -103,6 +106,7 @@ SET(_moc_HEADERS
   RepairGUI_RemoveExtraEdgesDlg.h
   RepairGUI_UnionFacesDlg.h
   RepairGUI_FuseEdgesDlg.h
+  RepairGUI_InspectObjectDlg.h
   )
 
 # header files / uic wrappings
@@ -131,6 +135,7 @@ SET(RepairGUI_SOURCES
   RepairGUI_RemoveExtraEdgesDlg.cxx
   RepairGUI_UnionFacesDlg.cxx
   RepairGUI_FuseEdgesDlg.cxx
+  RepairGUI_InspectObjectDlg.cxx
   ${_moc_SOURCES}
   ${_uic_files}
   )
index cb060826078d111a619c74ae01ba538c381283aa..3eadcbe21d4c10477ba42b2e13410002cf991c93 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -29,6 +29,7 @@
 
 #include <SUIT_Desktop.h>
 #include <SUIT_Session.h>
+#include <SUIT_OverrideCursor.h>
 #include <SalomeApp_Application.h>
 
 #include "RepairGUI_SewingDlg.h"        // Method SEWING
@@ -47,6 +48,7 @@
 #include "RepairGUI_RemoveExtraEdgesDlg.h"  // Method REMOVE EXTRA EDGES
 #include "RepairGUI_FuseEdgesDlg.h"         // Method FUSE COLLINEAR EDGES
 #include "RepairGUI_UnionFacesDlg.h"        // Method UNION FACES
+#include "RepairGUI_InspectObjectDlg.h"     // Method INSPECT OBJECT
 
 //=======================================================================
 // function : RepairGUI()
@@ -96,6 +98,7 @@ bool RepairGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   case GEOMOp::OpRemoveExtraEdges: aDlg = new RepairGUI_RemoveExtraEdgesDlg  (getGeometryGUI(), parent); break;
   case GEOMOp::OpFuseEdges:        aDlg = new RepairGUI_FuseEdgesDlg         (getGeometryGUI(), parent); break;
   case GEOMOp::OpUnionFaces:       aDlg = new RepairGUI_UnionFacesDlg        (getGeometryGUI(), parent); break;
+  case GEOMOp::OpInspectObj:       aDlg = new RepairGUI_InspectObjectDlg     (getGeometryGUI(), parent); break;
   default:
     app->putInfo(tr("GEOM_PRP_COMMAND").arg(theCommandID));
     break;
@@ -121,3 +124,100 @@ extern "C"
     return new RepairGUI( parent );
   }
 }
+
+//=====================================================================================
+// Statistics dialog
+//=====================================================================================
+
+#include <QDialog>
+#include <QHBoxLayout>
+#include <QHeaderView>
+#include <QPushButton>
+#include <QString>
+#include <QStringList>
+#include <QTableWidget>
+#include <QTableWidget>
+#include <QTableWidgetItem>
+#include <QVBoxLayout>
+
+namespace
+{
+  class StatsDlg : public QDialog
+  {
+  public:
+    StatsDlg( GEOM::ModifStatistics_var stats, QWidget* parent );
+  };
+
+  StatsDlg::StatsDlg( GEOM::ModifStatistics_var stats, QWidget* parent ): QDialog( parent )
+  {
+    setModal( true );
+    setWindowTitle( tr( "GEOM_HEALING_STATS_TITLE" ) );
+    setMinimumWidth( 500 );
+
+    const int nbRows = stats->length();
+    const int nbCols = 2;
+    QTableWidget* table = new QTableWidget( nbRows, nbCols, this );
+    table->setEditTriggers( QAbstractItemView::NoEditTriggers );
+    table->horizontalHeader()->setResizeMode( 1, QHeaderView::Interactive );
+    table->horizontalHeader()->setStretchLastSection( true );
+
+    QStringList headers;
+    headers << tr( "GEOM_HEALING_STATS_COL_1" );
+    headers << tr( "GEOM_HEALING_STATS_COL_2" );
+    table->setHorizontalHeaderLabels( headers );
+
+    // buttons
+
+    QPushButton* okBtn = new QPushButton( tr( "GEOM_BUT_OK" ), this );
+    okBtn->setAutoDefault( true );
+    okBtn->setDefault( true );
+    okBtn->setFocus();
+    // QPushButton* helpBtn = new QPushButton( tr( "GEOM_BUT_HELP" ), this );
+    // helpBtn->setAutoDefault( true );
+
+    QHBoxLayout* btnLayout = new QHBoxLayout;
+    btnLayout->setMargin( 0 );
+    btnLayout->setSpacing( 6 );
+
+    btnLayout->addStretch();
+    btnLayout->addWidget( okBtn );
+    btnLayout->addStretch();
+    // btnLayout->addWidget( helpBtn );
+
+    QVBoxLayout* aLay = new QVBoxLayout( this );
+    aLay->setMargin( 9 );
+    aLay->setSpacing( 6 );
+    aLay->addWidget( table );
+    aLay->addLayout( btnLayout );
+
+    // fill the table
+    for ( int row = 0; row < nbRows; ++row )
+    {
+      table->setItem( row, 0, new QTableWidgetItem( QString::number( stats[ row ].count )));
+      table->setItem( row, 1, new QTableWidgetItem( tr( stats[ row ].name.in() )));
+    }
+
+    connect( okBtn,       SIGNAL( clicked() ), this, SLOT( reject() ));
+    //connect( helpBtn,     SIGNAL( clicked() ), this, SLOT( help() ));
+  }
+}
+
+//================================================================================
+/*!
+ * \brief Show a dialog providing info on what is done by healing
+ */
+//================================================================================
+
+void RepairGUI::ShowStatistics( GEOM::GEOM_IHealingOperations_var anOper, QWidget* parent )
+{
+  GEOM::ModifStatistics_var stats = anOper->GetStatistics();
+
+  if ( ! &stats.in() || stats->length() == 0 )
+    return;
+
+  SUIT_OverrideCursor wc;
+  wc.suspend();
+
+  StatsDlg dlg( stats, parent );
+  dlg.exec();
+}
index df1eb9c45562469a9e57b3fea9622a03536600b2..40676ef7b7f9ba799322cc242e1d24b0bb9e205f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -29,6 +29,9 @@
 
 #include <GEOMGUI.h>
 
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(GEOM_Gen)
+
 //=================================================================================
 // class    : RepairGUI
 // purpose  :
@@ -40,6 +43,7 @@ public:
   ~RepairGUI();
 
   bool OnGUIEvent( int, SUIT_Desktop* );
-};
 
+  static void ShowStatistics( GEOM::GEOM_IHealingOperations_var anOper, QWidget* parent );
+};
 #endif // REPAIRGUI_H
index 3d395463b4437adf36174864ab20192c9bf861ee..8a038ec3c08616af7846c14dc4952d98d5449a42 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 //
 #include "RepairGUI_ChangeOrientationDlg.h"
 
-#include <DlgRef.h>
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
+#include "DlgRef.h"
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+#include "RepairGUI.h"
 
-#include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
-#include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <SalomeApp_Application.h>
+#include <TopAbs.hxx>
 
-#include <GEOMImpl_Types.hxx>
+#include "GEOMImpl_Types.hxx"
 
-#include <TopAbs.hxx>
 
 //=================================================================================
 // class    : RepairGUI_ChangeOrientationDlg()
@@ -280,7 +281,11 @@ bool RepairGUI_ChangeOrientationDlg::execute( ObjectList& objects )
   }
 
   if ( !anObj->_is_nil() )
+  {
+    if ( !IsPreview() )
+      RepairGUI::ShowStatistics( anOper, this );
     objects.push_back( anObj._retn() );
+  }
 
   return true;
 }
@@ -294,3 +299,17 @@ void RepairGUI_ChangeOrientationDlg::CreateCopyModeChanged( bool isCreateCopy )
 {
   mainFrame()->GroupBoxName->setEnabled( isCreateCopy );
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_ChangeOrientationDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  if ( GroupPoints->CheckButton1->isChecked() ) {
+    GEOM::GeomObjPtr aGeomObjPtr(myObject);
+    res << aGeomObjPtr;
+  }
+  return res;
+}
index 235c0b9e0ba3afd29a5a45488b44dfb5053eb190..2ee96bf4cb29d4825c5c60657751a4f9126d7e14 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -48,6 +48,7 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );    
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
   
 private:
   void                               Init();
index f57ad486800fe727ac20235049b3e9f6730a9f81..19fd78bcc4ec7d9e137786a290d75a54089dfbc2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 //
 #include "RepairGUI_CloseContourDlg.h"
 
-#include <DlgRef.h>
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
+#include "DlgRef.h"
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+#include "RepairGUI.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
@@ -325,8 +326,11 @@ bool RepairGUI_CloseContourDlg::execute (ObjectList& objects)
 
   bool aResult = !anObj->_is_nil();
   if (aResult)
+  {
+    if ( !IsPreview() )
+      RepairGUI::ShowStatistics( anOper, this );
     objects.push_back(anObj._retn());
-
+  }
   return aResult;
 }
 
@@ -365,3 +369,15 @@ void RepairGUI_CloseContourDlg::initSelection()
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_CloseContourDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObject);
+  res << aGeomObjPtr;
+  return res;
+}
index 22d872a611d27e4093c07936e21649304e33247a..7b97f34512a1b0bea1bf72c8ecf5027eb460055d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,7 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
   
 private:
   void                               Init();
index 19e10b070aceaa37075f4e1975e7a56d6c61a49a..673f29d6b7561546db266aecb65b6a05004f3f3c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 //
 #include "RepairGUI_DivideEdgeDlg.h"
 
-#include <DlgRef.h>
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
-#include <SalomeApp_DoubleSpinBox.h>
+#include "DlgRef.h"
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+#include "RepairGUI.h"
 
+#include <SalomeApp_DoubleSpinBox.h>
 #include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 #include <SUIT_Session.h>
 
 #include <GEOMImpl_Types.hxx>
 
-#include <TopAbs.hxx>
+#include <BRepBuilderAPI_MakeVertex.hxx>
+#include <BRep_Builder.hxx>
+#include <BRep_Tool.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
 #include <Geom_Curve.hxx>
-#include <gp_Pnt.hxx>
-#include <TopoDS.hxx>
+#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TopAbs.hxx>
 #include <TopExp.hxx>
-#include <TopoDS_Edge.hxx>
-#include <BRep_Tool.hxx>
+#include <TopExp_Explorer.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
-#include <BRepBuilderAPI_MakeVertex.hxx>
-#include <TColStd_IndexedMapOfInteger.hxx>
+#include <TopTools_MapOfShape.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Compound.hxx>
+#include <TopoDS_Edge.hxx>
+#include <gp_Pnt.hxx>
+
+enum { BY_PARAM, BY_POINT_PROJ };
 
 //=================================================================================
 // class    : RepairGUI_DivideEdgeDlg()
@@ -61,6 +69,7 @@ RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg( GeometryGUI* theGeometryGUI, Q
   : GEOMBase_Skeleton( theGeometryGUI, parent, modal )
 {
   QPixmap image0( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_DIVIDE_EDGE" ) ) );
+  QPixmap image2( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_DLG_DIVIDE_EDGE_BY_PNT" ) ) );
   QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
 
   setWindowTitle( tr( "GEOM_DIVIDE_EDGE_TITLE" ) );
@@ -68,16 +77,18 @@ RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg( GeometryGUI* theGeometryGUI, Q
   /***************************************************************/
   mainFrame()->GroupConstructors->setTitle(tr("GEOM_DIVIDE_EDGE_TITLE"));
   mainFrame()->RadioButton1->setIcon( image0 );
-  mainFrame()->RadioButton2->setAttribute( Qt::WA_DeleteOnClose );
-  mainFrame()->RadioButton2->close();
+  mainFrame()->RadioButton2->setIcon( image2 );
   mainFrame()->RadioButton3->setAttribute( Qt::WA_DeleteOnClose );
   mainFrame()->RadioButton3->close();
 
-  GroupPoints = new DlgRef_1SelExt( centralWidget() );
+  GroupPoints = new DlgRef_2SelExt( centralWidget() );
   GroupPoints->GroupBox1->setTitle( tr( "GEOM_ADD_POINT" ) );
   GroupPoints->TextLabel1->setText( tr( "GEOM_EDGE" ) );
   GroupPoints->PushButton1->setIcon( image1 );
   GroupPoints->LineEdit1->setReadOnly( true );
+  GroupPoints->TextLabel2->setText( tr( "DEVIDE_EDGE_BY_PROJ_POINT" ) );
+  GroupPoints->PushButton2->setIcon( image1 );
+  GroupPoints->LineEdit2->setReadOnly( true );
 
   QRadioButton* rb1 = new QRadioButton( tr( "GEOM_BY_PARAMETER" ), GroupPoints->Box );
   QRadioButton* rb2 = new QRadioButton( tr( "GEOM_BY_LENGTH" ),    GroupPoints->Box );
@@ -90,13 +101,13 @@ RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg( GeometryGUI* theGeometryGUI, Q
   myValEdt = new SalomeApp_DoubleSpinBox( GroupPoints->Box );
   initSpinBox( myValEdt, 0., 1., 0.1, "parametric_precision" );
   myValEdt->setValue( 0.5 );
-  QLabel* aLbl1 = new QLabel( tr( "GEOM_VALUE" ), GroupPoints->Box );
+  myValLbl = new QLabel( tr( "GEOM_VALUE" ), GroupPoints->Box );
 
   QGridLayout* l = new QGridLayout( GroupPoints->Box );
   l->setMargin( 0 ); l->setSpacing( 6 );
   l->addWidget( rb1, 0, 0, 1, 2 );
   l->addWidget( rb2, 1, 0, 1, 2 );
-  l->addWidget( aLbl1, 2, 0 );
+  l->addWidget( myValLbl, 2, 0 );
   l->addWidget( myValEdt, 2, 1 );
 
   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
@@ -110,6 +121,29 @@ RepairGUI_DivideEdgeDlg::RepairGUI_DivideEdgeDlg( GeometryGUI* theGeometryGUI, Q
   Init();
 }
 
+//=======================================================================
+//function : ConstructorsClicked
+//purpose  : hide/show widgets depending on a selected constructor
+//=======================================================================
+void RepairGUI_DivideEdgeDlg::ConstructorsClicked( int constructorId )
+{
+  myIsParameterGr->button( 0 )->setShown( constructorId == BY_PARAM );
+  myIsParameterGr->button( 1 )->setShown( constructorId == BY_PARAM );
+  myValEdt                    ->setShown( constructorId == BY_PARAM );
+  myValLbl                    ->setShown( constructorId == BY_PARAM );
+  GroupPoints->TextLabel2     ->setShown( constructorId == BY_POINT_PROJ );
+  GroupPoints->PushButton2    ->setShown( constructorId == BY_POINT_PROJ );
+  GroupPoints->LineEdit2      ->setShown( constructorId == BY_POINT_PROJ );
+
+  initSelection();
+
+  if ( constructorId == BY_PARAM &&
+       !GroupPoints->PushButton1->isDown() )
+    GroupPoints->PushButton1->click();
+
+  displayPreview();
+}
+
 //=================================================================================
 // function : ~RepairGUI_DivideEdgeDlg()
 // purpose  : Destroys the object and frees any allocated resources
@@ -128,25 +162,31 @@ void RepairGUI_DivideEdgeDlg::Init()
   myEditCurrentArgument = GroupPoints->LineEdit1;
 
   myObject = GEOM::GEOM_Object::_nil();
-  myIndex = -1;
+  myPoints.clear();
+  myIndex  = -1;
+  myProjectionOK = false;
 
   //myGeomGUI->SetState( 0 );
-  initSelection();
 
   /* signals and slots connections */
   connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
   connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
 
+  connect(this,           SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
+
   connect( myValEdt,   SIGNAL( valueChanged( double ) ), this, SLOT( ValueChangedInSpinBox() ) );
 
   connect( GroupPoints->PushButton1, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
   connect( GroupPoints->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
+  connect( GroupPoints->PushButton2, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
+  connect( GroupPoints->LineEdit2,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
 
   connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
 
   initName( tr( "DEVIDE_EDGE_NEW_OBJECT_NAME" ) );
   resize(100,100);
+  ConstructorsClicked( BY_PARAM );
   SelectionIntoArgument();
 }
 
@@ -165,6 +205,7 @@ void RepairGUI_DivideEdgeDlg::ValueChangedInSpinBox()
 //=================================================================================
 void RepairGUI_DivideEdgeDlg::displayPreview()
 {
+  myProjectionOK = false;
   erasePreview();
   if ( myObject->_is_nil() )
     return;
@@ -173,7 +214,7 @@ void RepairGUI_DivideEdgeDlg::displayPreview()
   gp_Pnt aPnt;
   GEOMBase::GetShape( myObject, aShape, TopAbs_SHAPE );
 
-  if ( myIndex != -1) {
+  if ( myIndex != -1 ) {
     TopTools_IndexedMapOfShape aShapes;
     TopExp::MapShapes(aShape, aShapes);
     aShape = aShapes.FindKey(myIndex);
@@ -182,15 +223,54 @@ void RepairGUI_DivideEdgeDlg::displayPreview()
   if (aShape.ShapeType() == TopAbs_EDGE) {
     Standard_Real aFP, aLP, aP;
     Handle(Geom_Curve) aCurve = BRep_Tool::Curve(TopoDS::Edge(aShape), aFP, aLP);
-    aP = aFP + (aLP - aFP) * myValEdt->value();
-    aPnt = aCurve->Value(aP);
-    BRepBuilderAPI_MakeVertex mkVertex (aPnt);
-    aShape = mkVertex.Shape();
+    if ( aCurve.IsNull() ) return;
+
+    if ( getConstructorId() == BY_PARAM )
+    {
+      aP = aFP + (aLP - aFP) * myValEdt->value();
+      aPnt = aCurve->Value(aP);
+      BRepBuilderAPI_MakeVertex mkVertex (aPnt);
+      aShape = mkVertex.Shape();
+    }
+    else if ( getConstructorId() == BY_POINT_PROJ && !myPoints.empty() )
+    {
+      BRep_Builder builder;
+      TopoDS_Compound compoundOfVV;
+      builder.MakeCompound(compoundOfVV);
+      aShape = compoundOfVV;
+
+      GeomAPI_ProjectPointOnCurve aProjector;
+      aProjector.Init( aCurve, aFP, aLP );
+
+      TopTools_MapOfShape vMap;
+      for ( int i = 0; i < myPoints.count(); ++i )
+      {
+        TopoDS_Shape aPoint;
+        GEOMBase::GetShape( myPoints[i].get(), aPoint, TopAbs_VERTEX );
+        if ( !vMap.Add( aPoint )) continue;
+
+        gp_Pnt p = BRep_Tool::Pnt( TopoDS::Vertex( aPoint ));
+        aProjector.Perform( p );
+        if ( aProjector.NbPoints() > 0 )
+        {
+          double u = aProjector.LowerDistanceParameter();
+          if ( Min( u - aFP, aLP - u ) > Precision::Confusion() )
+          {
+            builder.Add( compoundOfVV, BRepBuilderAPI_MakeVertex( aProjector.NearestPoint()));
+            myProjectionOK = true;
+          }
+        }
+      }
+    }
+    else
+    {
+      return;
+    }
     // Build prs
     SALOME_Prs* aPrs = getDisplayer()->BuildPrs( aShape );
     if ( aPrs != 0 && !aPrs->IsNull() )
       GEOMBase_Helper::displayPreview( aPrs, false, true );
-  } 
+  }
 }
 
 //=================================================================================
@@ -216,11 +296,14 @@ bool RepairGUI_DivideEdgeDlg::ClickOnApply()
 
   initName();
 
-  myEditCurrentArgument->setText( "" );
+  GroupPoints->LineEdit1->setText( "" );
+  GroupPoints->LineEdit2->setText( "" );
   myObject = GEOM::GEOM_Object::_nil();
+  myPoints.clear();
   myIndex = -1;
+  myProjectionOK = false;
 
-  initSelection();
+  GroupPoints->PushButton1->click();
 
   return true;
 }
@@ -235,14 +318,24 @@ void RepairGUI_DivideEdgeDlg::SelectionIntoArgument()
 {
   myEditCurrentArgument->setText( "" );
 
-  myObject = GEOM::GEOM_Object::_nil();
-  myIndex = -1;
+  const bool toSelectObject = ( myEditCurrentArgument == GroupPoints->LineEdit1 );
+  if ( toSelectObject )
+  {
+    myObject = GEOM::GEOM_Object::_nil();
+    myIndex = -1;
+    myProjectionOK = false;
+  }
+  else //if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
+  {
+    myPoints.clear();
+    myProjectionOK = false;
+  }
 
   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
   SALOME_ListIO aSelList;
   aSelMgr->selectedObjects(aSelList);
 
-  if ( aSelList.Extent() == 1 ) {
+  if ( toSelectObject && aSelList.Extent() == 1 ) {
     Handle(SALOME_InteractiveObject) anIO = aSelList.First();
     GEOM::GEOM_Object_var aSelectedObj = GEOMBase::ConvertIOinGEOMObject( anIO );
     if ( !CORBA::is_nil( aSelectedObj ) )
@@ -282,6 +375,16 @@ void RepairGUI_DivideEdgeDlg::SelectionIntoArgument()
       }
     }
   }
+  if ( !toSelectObject )
+  {
+    myPoints = getSelected( TopAbs_VERTEX, -1, /*strict=*/true );
+    if ( myPoints.empty() )
+      myEditCurrentArgument->setText( "" );
+    else if ( myPoints.count() == 1 )
+      myEditCurrentArgument->setText( GEOMBase::GetName( myPoints[0].get() ));
+    else
+      myEditCurrentArgument->setText( QObject::tr( "%1_vertices" ).arg( myPoints.count() ));
+  }
 
   displayPreview();
 }
@@ -292,10 +395,29 @@ void RepairGUI_DivideEdgeDlg::SelectionIntoArgument()
 //=================================================================================
 void RepairGUI_DivideEdgeDlg::SetEditCurrentArgument()
 {
-  if ( sender() == GroupPoints->PushButton1 ) {
+  QPushButton* send = (QPushButton*)sender();
+
+  if ( send == GroupPoints->PushButton1 ) {
     GroupPoints->LineEdit1->setFocus();
     myEditCurrentArgument = GroupPoints->LineEdit1;
+
+    GroupPoints->PushButton2->setDown(false);
+    GroupPoints->LineEdit2->setEnabled(false);
+  }
+  if ( send == GroupPoints->PushButton2 ) {
+    GroupPoints->LineEdit2->setFocus();
+    myEditCurrentArgument = GroupPoints->LineEdit2;
+
+    GroupPoints->PushButton1->setDown(false);
+    GroupPoints->LineEdit1->setEnabled(false);
   }
+  // enable line edit
+  myEditCurrentArgument->setEnabled(true);
+  myEditCurrentArgument->setFocus();
+  // after setFocus(), because it will be setDown(false) when loses focus
+  send->setDown(true);
+
+  initSelection();
   SelectionIntoArgument();
 }
 
@@ -310,6 +432,11 @@ void RepairGUI_DivideEdgeDlg::LineEditReturnPressed()
     myEditCurrentArgument = GroupPoints->LineEdit1;
     GEOMBase_Skeleton::LineEditReturnPressed();
   }
+  if ( sender() == GroupPoints->LineEdit2 &&
+       !GroupPoints->LineEdit2->isHidden() ) {
+    myEditCurrentArgument = GroupPoints->LineEdit2;
+    GEOMBase_Skeleton::LineEditReturnPressed();
+  }
 }
 
 
@@ -327,7 +454,7 @@ void RepairGUI_DivideEdgeDlg::ActivateThisDialog()
   myIndex = -1;
 
   //myGeomGUI->SetState( 0 );
-  initSelection();
+  ConstructorsClicked(getConstructorId());
 }
 
 //=================================================================================
@@ -356,7 +483,16 @@ GEOM::GEOM_IOperations_ptr RepairGUI_DivideEdgeDlg::createOperation()
 //=================================================================================
 bool RepairGUI_DivideEdgeDlg::isValid( QString& msg )
 {
-  bool ok = myValEdt->isValid( msg, !IsPreview() );
+  bool ok = false;
+  if ( getConstructorId() == BY_PARAM )
+  {
+    ok = myValEdt->isValid( msg, !IsPreview() );
+  }
+  else if ( getConstructorId() == BY_POINT_PROJ )
+  {
+    if (( ok = myPoints.count() ) && !( ok = myProjectionOK ))
+      msg = tr("DEVIDE_EDGE_BAD_PROJ_MSG");
+  }
   return !myObject->_is_nil() && ok;
 }
 
@@ -367,11 +503,23 @@ bool RepairGUI_DivideEdgeDlg::isValid( QString& msg )
 bool RepairGUI_DivideEdgeDlg::execute( ObjectList& objects )
 {
   GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow( getOperation() );
-  GEOM::GEOM_Object_var anObj = anOper->DivideEdge( myObject, myIndex, myValEdt->value(), getIsByParameter() );
+  GEOM::GEOM_Object_var anObj;
+  if ( getConstructorId() == BY_PARAM )
+  {
+    anObj = anOper->DivideEdge( myObject, myIndex, myValEdt->value(), getIsByParameter() );
+  }
+  else
+  {
+    GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+    objList->length( myPoints.count() );
+    for ( int i = 0; i < myPoints.count(); ++i )
+      objList[i] = myPoints[i].copy();
+    anObj = anOper->DivideEdgeByPoint( myObject, myIndex, objList );
+  }
   bool aResult = !anObj->_is_nil();
   if ( aResult )
   {
-    if ( !IsPreview() )
+    if ( !IsPreview() && ( getConstructorId() == BY_PARAM ))
     {
       QStringList aParameters;
       aParameters << "";
@@ -379,6 +527,8 @@ bool RepairGUI_DivideEdgeDlg::execute( ObjectList& objects )
       aParameters << "";
       anObj->SetParameters(aParameters.join(":").toLatin1().constData());
     }
+    if ( !IsPreview() )
+      RepairGUI::ShowStatistics( anOper, this );
     objects.push_back( anObj._retn() );
   }
 
@@ -400,6 +550,30 @@ bool RepairGUI_DivideEdgeDlg::getIsByParameter() const
 //=================================================================================
 void RepairGUI_DivideEdgeDlg::initSelection()
 {
-  GEOM::GEOM_Object_var aNullGeomObject;
-  localSelection( aNullGeomObject, TopAbs_EDGE ); // load local selection on ALL objects
+  // close local contexts
+  globalSelection();
+  // load local selection on ALL objects
+  localSelection( myEditCurrentArgument == GroupPoints->LineEdit2 ? TopAbs_VERTEX : TopAbs_EDGE );
+}
+
+//=================================================================================
+// function : addSubshapeToStudy
+// purpose  : virtual method to add new SubObjects if local selection
+//=================================================================================
+void RepairGUI_DivideEdgeDlg::addSubshapesToStudy()
+{
+  for ( int i = 0; i < myPoints.count(); ++i )
+    GEOMBase::PublishSubObject( myPoints[i].get() );
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_DivideEdgeDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myPoints);
+  GEOM::GeomObjPtr aGeomObjPtr(myObject);
+  res << aGeomObjPtr;
+  return res;
 }
index 4b1adc3c9df6b8dce7365bb9dca123820d684241..32a62b832b7824175f69db7d508fd193c6f4f68d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -29,7 +29,7 @@
 
 #include <GEOMBase_Skeleton.h>
 
-class DlgRef_1SelExt;
+class DlgRef_2SelExt;
 class SalomeApp_DoubleSpinBox;
 class QButtonGroup;
 
@@ -50,7 +50,9 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
-  
+  virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
+
 private:
   void                               Init();
   void                               enterEvent( QEvent* );
@@ -58,13 +60,16 @@ private:
   
   bool                               getIsByParameter() const;
   int                                myIndex;
-  
+
 private:
   GEOM::GEOM_Object_var              myObject;
-  
-  DlgRef_1SelExt*                    GroupPoints;
+  QList<GEOM::GeomObjPtr>            myPoints;
+  bool                               myProjectionOK;
+
+  DlgRef_2SelExt*                    GroupPoints;
   QButtonGroup*                      myIsParameterGr;
   SalomeApp_DoubleSpinBox*           myValEdt;
+  QLabel*                            myValLbl;
 
 protected slots:
   void                               ClickOnOk();
@@ -76,6 +81,7 @@ protected slots:
   void                               LineEditReturnPressed();
   void                               SelectionIntoArgument();
   void                               SetEditCurrentArgument();
+  void                               ConstructorsClicked( int );
 };
 
 #endif // REPAIRGUI_DIVIDEEDGEDLG_H
index 4bb57553f87a55779f8eeba3454b0efcfe0ba008..4babd1b751df968506aa86892b64a37529d8784a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -261,8 +261,11 @@ bool RepairGUI_FreeBoundDlg::execute (ObjectList& objects)
 {
   GEOM::ListOfGO_var aClosed, anOpen;
 
+  GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+  objList->length(1);
+  objList[0] = myObj;
   GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow(getOperation());
-  bool result = anOper->GetFreeBoundary(myObj, aClosed, anOpen);
+  bool result = anOper->GetFreeBoundary(objList, aClosed, anOpen);
 
   if (result) {
     myNbClosed = aClosed->length();
@@ -304,3 +307,15 @@ GEOM::GEOM_Object_ptr RepairGUI_FreeBoundDlg::getFather (GEOM::GEOM_Object_ptr)
 {
   return myObj;
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_FreeBoundDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObj);
+  res << aGeomObjPtr;
+  return res;
+}
index deb2812f8e002d8225afab9236b6f9d32cb772fa..9261bb0c224e8807e80437f989f4c12ea294b822 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -53,7 +53,8 @@ protected:
   virtual bool                          execute (ObjectList&);
   virtual GEOM::GEOM_Object_ptr         getFather (GEOM::GEOM_Object_ptr);
   virtual QString                       getNewObjectName (int CurrObj = -1) const; 
-                                                                                  
+  virtual QList<GEOM::GeomObjPtr>       getSourceObjects();
+
 private:
   void                                  Init();
   void                                  enterEvent (QEvent*);
index 8fe66a4bdab3586484ae59a2b7f2448d3ed7214a..395bf5301039b266ac3e0825174d262decdd752b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 //
 #include "RepairGUI_FreeFacesDlg.h"
 
+#include <GEOMBase.h>
+#include <GeometryGUI.h>
+#include <GEOMImpl_Types.hxx>
+#include <GEOM_Constants.h>
+
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 #include <SalomeApp_Application.h>
-#include <SalomeApp_Tools.h>
 #include <SalomeApp_Study.h>
-
-#include <SUIT_MessageBox.h>
-#include <SUIT_Session.h>
-#include <SUIT_OverrideCursor.h>
+#include <SalomeApp_Tools.h>
 #include <SUIT_Desktop.h>
+#include <SUIT_OverrideCursor.h>
 #include <SUIT_ResourceMgr.h>
-#include <SUIT_ViewWindow.h>
+#include <SUIT_Session.h>
 #include <SUIT_ViewManager.h>
+#include <SUIT_ViewWindow.h>
 
-#include <GEOMImpl_Types.hxx>
-#include <GEOM_Constants.h>
-
-#include <TopTools_IndexedMapOfShape.hxx>
 #include <TColStd_MapOfInteger.hxx>
 #include <TopExp.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
 
-#include <GEOMBase.h>
-#include <GeometryGUI.h>
-#include <GEOM_Displayer.h>
-
-#include <QLineEdit>
-#include <QLabel>
 #include <QGroupBox>
-#include <QPushButton>
 #include <QHBoxLayout>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
 #include <QVBoxLayout>
-#include <QKeyEvent>
+
 
 #define SPACING 6
 #define MARGIN  9
 //            TRUE to construct a modal dialog.
 //=================================================================================
 RepairGUI_FreeFacesDlg::RepairGUI_FreeFacesDlg( GeometryGUI* GUI, QWidget* parent,
-                                                bool modal )
-  : QDialog( parent, 0 ),
-    GEOMBase_Helper( dynamic_cast<SUIT_Desktop*>( parent ) ),
-    myGeomGUI( GUI ), 
-    myDisplayer( 0 )
+                                                bool modal)
+  : GEOMBase_Skeleton(GUI, parent, modal),
+    myDisplayer      (0),
+    myEdit           (0)
 {
-  setAttribute( Qt::WA_DeleteOnClose );
-
-  setSizeGripEnabled( true );
-
+  QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_FREE_FACES")));
   QPixmap image1( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
 
   setWindowTitle( tr( "GEOM_FREE_FACES_TITLE" ) );
 
   /***************************************************************/
 
+  mainFrame()->GroupConstructors->setTitle(tr("GEOM_FREE_FACES"));
+  mainFrame()->RadioButton1->setIcon(image0);
+  mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
+  mainFrame()->RadioButton2->close();
+  mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
+  mainFrame()->RadioButton3->close();
+
+  mainFrame()->GroupBoxName->hide();
+
   QGroupBox* aMainGrp = new QGroupBox( tr( "GEOM_SELECTED_SHAPE" ), this );
   
   QLabel* lab = new QLabel( tr( "GEOM_OBJECT" ), aMainGrp );
-  mySelBtn = new QPushButton( aMainGrp );
-  mySelBtn->setIcon( image1 );
+  QPushButton *aSelBtn = new QPushButton( aMainGrp );
+  aSelBtn->setIcon( image1 );
   myEdit = new QLineEdit( aMainGrp );
   myEdit->setReadOnly( true );
   myEdit->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
@@ -101,37 +103,19 @@ RepairGUI_FreeFacesDlg::RepairGUI_FreeFacesDlg( GeometryGUI* GUI, QWidget* paren
   aMainLay->setSpacing( SPACING );
   aMainLay->setMargin( MARGIN );
   aMainLay->addWidget( lab );
-  aMainLay->addWidget( mySelBtn );
+  aMainLay->addWidget( aSelBtn );
   aMainLay->addWidget( myEdit );
 
-  QFrame* aFrame = new QFrame( this );
-  aFrame->setFrameStyle( QFrame::Box | QFrame::Sunken );
-  QPushButton* aCloseBtn = new QPushButton( tr( "GEOM_BUT_CLOSE" ), aFrame );
-  QPushButton* aHelpBtn = new QPushButton( tr( "GEOM_BUT_HELP" ), aFrame );
-
-  QHBoxLayout* aBtnLay = new QHBoxLayout( aFrame );
-  aBtnLay->setSpacing( SPACING );
-  aBtnLay->setMargin( MARGIN );
-  aBtnLay->addWidget( aCloseBtn );
-  aBtnLay->addSpacing( SPACING );
-  aBtnLay->addStretch();
-  aBtnLay->addWidget( aHelpBtn );
-
-  QVBoxLayout* aLay = new QVBoxLayout( this );
-  aLay->setSpacing( SPACING );
-  aLay->setMargin( MARGIN );
-  aLay->addWidget( aMainGrp );
-  aLay->addStretch();
-  aLay->addWidget( aFrame );
+  QVBoxLayout* aLay = new QVBoxLayout (centralWidget());
+  aLay->setSpacing(SPACING);
+  aLay->setMargin(MARGIN);
+  aLay->addWidget(aMainGrp);
 
-  myHelpFileName = "free_faces_page.html";
-
-  connect( aCloseBtn, SIGNAL( clicked() ), SLOT( onClose() ) );
-  connect( aHelpBtn,  SIGNAL( clicked() ), SLOT( onHelp() ) );
-  connect( mySelBtn,  SIGNAL( clicked() ),
-           this,      SLOT  ( onSetEditCurrentArgument() ) );
+  resize(minimumSizeHint());
   /***************************************************************/
 
+  myHelpFileName = "free_faces_page.html";
+
   Init();
 }
 
@@ -146,92 +130,82 @@ RepairGUI_FreeFacesDlg::~RepairGUI_FreeFacesDlg()
 
 
 //=================================================================================
-// function : onClose
-// purpose  : SLOT. Called when "close" button pressed. Close dialog
+// function : Init()
+// purpose  :
 //=================================================================================
-void RepairGUI_FreeFacesDlg::onClose()
+void RepairGUI_FreeFacesDlg::Init()
 {
-  globalSelection();
-  disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
-  myGeomGUI->SetActiveDialogBox( 0 );
-  reject();
-  erasePreview();
+  myObj = GEOM::GEOM_Object::_nil();
+  myEditCurrentArgument = myEdit;
+
+  connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+  connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+          this, SLOT(SelectionIntoArgument()));
+
+  initName(tr("GEOM_FREE_FACES_NAME"));
+  buttonOk()->setEnabled(false);
+  buttonApply()->setEnabled(false);
+  activateSelection();
+  SelectionIntoArgument();
 }
 
 //=================================================================================
-// function : onHelp()
+// function : ClickOnOk()
 // purpose  :
 //=================================================================================
-void RepairGUI_FreeFacesDlg::onHelp()
+void RepairGUI_FreeFacesDlg::ClickOnOk()
 {
-  LightApp_Application* app = (LightApp_Application*)( SUIT_Session::session()->activeApplication() );
-  if ( app )
-    app->onHelpContextModule( myGeomGUI ? app->moduleName( myGeomGUI->moduleName() ) : QString(""), myHelpFileName );
-  else {
-    QString platform;
-#ifdef WIN32
-    platform = "winapplication";
-#else
-    platform = "application";
-#endif
-    SUIT_MessageBox::warning( this, 
-                              tr( "WRN_WARNING" ),
-                              tr( "EXTERNAL_BROWSER_CANNOT_SHOW_PAGE" ).
-                              arg( app->resourceMgr()->stringValue( "ExternalBrowser", 
-                                                                    platform ) ).
-                              arg( myHelpFileName ) );
-  }
+  if (ClickOnApply())
+    ClickOnCancel();
 }
 
 //=================================================================================
-// function : onDeactivate
-// purpose  : Deactivate this dialog
+// function : ClickOnApply()
+// purpose  :
 //=================================================================================
-void RepairGUI_FreeFacesDlg::onDeactivate()
+bool RepairGUI_FreeFacesDlg::ClickOnApply()
 {
-  setEnabled( false );
-  globalSelection();
-  disconnect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 0, this, 0 );
-  myGeomGUI->SetActiveDialogBox( 0 );
+  if (!onAccept())
+    return false;
+
+  initName();
+  return true;
 }
 
 //=================================================================================
-// function : onActivate
-// purpose  : Activate this dialog
+// function : ActivateThisDialog()
+// purpose  :
 //=================================================================================
-void RepairGUI_FreeFacesDlg::onActivate()
+void RepairGUI_FreeFacesDlg::ActivateThisDialog()
 {
-  myGeomGUI->EmitSignalDeactivateDialog();
-  setEnabled( true );
-  myGeomGUI->SetActiveDialogBox( this );
-  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 
-           SIGNAL( currentSelectionChanged() ), SLOT( onSelectionDone() ) );
+  GEOMBase_Skeleton::ActivateThisDialog();
+
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+          this, SLOT(SelectionIntoArgument()));
+
   activateSelection();
+  displayPreview(true);
 }
 
 //=================================================================================
-// function : Init()
+// function : enterEvent()
 // purpose  :
 //=================================================================================
-void RepairGUI_FreeFacesDlg::Init()
+void RepairGUI_FreeFacesDlg::enterEvent(QEvent*)
 {
-  myObj = GEOM::GEOM_Object::_nil();
-
-  /* signals and slots connections */
-  connect( myGeomGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT  ( onDeactivate() ) );
-  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(), 
-           SIGNAL( currentSelectionChanged() ), SLOT  ( onSelectionDone() ) );
-
-  activateSelection();
-  onSelectionDone();
+  if (!mainFrame()->GroupConstructors->isEnabled())
+    ActivateThisDialog();
 }
 
 //=================================================================================
-// function : onSelectionDone
+// function : SelectionIntoArgument
 // purpose  : SLOT. Called when selection changed.
 //=================================================================================
-void RepairGUI_FreeFacesDlg::onSelectionDone()
+void RepairGUI_FreeFacesDlg::SelectionIntoArgument()
 {
+  myEditCurrentArgument->setText("");
+  myObj = GEOM::GEOM_Object::_nil();
   erasePreview();
 
   LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
@@ -239,7 +213,8 @@ void RepairGUI_FreeFacesDlg::onSelectionDone()
   aSelMgr->selectedObjects(aSelList);
 
   if ( aSelList.Extent() != 1 ) {
-    myEdit->setText( "" );
+    buttonOk()->setEnabled(false);
+    buttonApply()->setEnabled(false);
     return;
   }
 
@@ -247,27 +222,19 @@ void RepairGUI_FreeFacesDlg::onSelectionDone()
     GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
 
   if ( !GEOMBase::IsShape( anObj ) ) {
-    myEdit->setText( "" );
+    buttonOk()->setEnabled(false);
+    buttonApply()->setEnabled(false);
     return;
-  }
-  else {
+  } else {
     myObj = anObj;
+    myEditCurrentArgument->setText(GEOMBase::GetName(myObj));
     displayPreview( true, false, true, true, 3 );
   }
 }
 
-//=================================================================================
-// function : enterEvent()
-// purpose  : Mouse enter onto the dialog to activate it
-//=================================================================================
-void RepairGUI_FreeFacesDlg::enterEvent( QEvent* )
-{
-  onActivate();
-}
-
 //=================================================================================
 // function : activateSelection
-// purpose  : activate selection of faces, shells, and solids
+// purpose  : activate selection of solids
 //=================================================================================
 void RepairGUI_FreeFacesDlg::activateSelection()
 {
@@ -277,15 +244,6 @@ void RepairGUI_FreeFacesDlg::activateSelection()
   globalSelection( aMap );
 }
 
-//=================================================================================
-// function : closeEvent()
-// purpose  :
-//=================================================================================
-void RepairGUI_FreeFacesDlg::closeEvent( QCloseEvent* )
-{
-  onClose();
-}
-
 //=================================================================================
 // function : createOperation
 // purpose  :
@@ -316,15 +274,19 @@ bool RepairGUI_FreeFacesDlg::execute( ObjectList& objects )
   TopoDS_Shape aSelShape;
   TopoDS_Shape aFace; 
   TopTools_IndexedMapOfShape anIndices;
+  int aNbObj = 0;
+
   if ( !myObj->_is_nil() && GEOMBase::GetShape( myObj, aSelShape ) ) {
     myEdit->setText( GEOMBase::GetName( myObj ) );
     QString aMess;
     if ( !isValid( aMess ) ) {
       erasePreview( true );
+      buttonOk()->setEnabled(false);
+      buttonApply()->setEnabled(false);
       return false;
     }
     
-    SUIT_OverrideCursor();
+    SUIT_OverrideCursor wc;
 
     TopExp::MapShapes( aSelShape, anIndices);
     SALOME_Prs* aPrs = 0;
@@ -349,13 +311,21 @@ bool RepairGUI_FreeFacesDlg::execute( ObjectList& objects )
        }
       }
     }
-    
-    for ( int i = 0, n = aFaceLst->length(); i < n; i++ ) {
+
+    int i;
+    int n = aFaceLst->length();
+
+    for (i = 0; i < n; i++ ) {
       aFace = anIndices.FindKey( aFaceLst[i] );
       try {
         getDisplayer()->SetColor( Quantity_NOC_RED );
-        getDisplayer()->SetToActivate( false );
        getDisplayer()->SetTransparency( transparency );
+       getDisplayer()->SetWidth( 2 );
+       getDisplayer()->SetNbIsos( 1 );
+       getDisplayer()->SetIsosWidth( 1 );
+       getDisplayer()->SetIsosColor( Quantity_NOC_RED );
+       getDisplayer()->SetDisplayMode( 0 );
+        getDisplayer()->SetToActivate( false );
         aPrs = !aFace.IsNull() ? getDisplayer()->BuildPrs( aFace ) : 0;
         if ( aPrs )
           displayPreview( aPrs, true );
@@ -363,9 +333,27 @@ bool RepairGUI_FreeFacesDlg::execute( ObjectList& objects )
       catch( const SALOME::SALOME_Exception& e )
       {
         SalomeApp_Tools::QtCatchCorbaException( e );
+        buttonOk()->setEnabled(false);
+        buttonApply()->setEnabled(false);
+        return false;
       }
     }
+
+    // Create sub-objects
+    GEOM::ListOfGO_var aList = anOper->MakeSubShapes(myObj, aFaceLst);
+
+    aNbObj = aList->length();
+
+    for (i = 0; i < aNbObj; i++) {
+      objects.push_back(GEOM::GEOM_Object::_duplicate(aList[i]));
+    }
+
+    aResult = true;
   }
+
+  buttonOk()->setEnabled(aNbObj > 0);
+  buttonApply()->setEnabled(aNbObj > 0);
+
   return aResult;
 }
 
@@ -380,28 +368,24 @@ GEOM_Displayer* RepairGUI_FreeFacesDlg::getDisplayer()
   return myDisplayer;
 }
 
-//=================================================================================
-// function : SetEditCurrentArgument
-// purpose  :
-//=================================================================================
-void RepairGUI_FreeFacesDlg::onSetEditCurrentArgument()
+//================================================================
+// Function : getFather
+// Purpose  : Get father object for object to be added in study
+//            (called with addInStudy method)
+//================================================================
+GEOM::GEOM_Object_ptr RepairGUI_FreeFacesDlg::getFather (GEOM::GEOM_Object_ptr)
 {
-  myEdit->setFocus();
-  onSelectionDone();
+  return myObj;
 }
 
 //=================================================================================
-// function : keyPressEvent()
-// purpose  :
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
 //=================================================================================
-void RepairGUI_FreeFacesDlg::keyPressEvent( QKeyEvent* e )
+QList<GEOM::GeomObjPtr> RepairGUI_FreeFacesDlg::getSourceObjects()
 {
-  QDialog::keyPressEvent( e );
-  if ( e->isAccepted() )
-    return;
-
-  if ( e->key() == Qt::Key_F1 ) {
-    e->accept();
-    onHelp();
-  }
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObj);
+  res << aGeomObjPtr;
+  return res;
 }
index 160d4bffad692333004e942c3f0049fd25a4d364..06641d041d449886b07f7529d59ebeeebc8972ad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #ifndef REPAIRGUI_FREEFACESDLG_H
 #define REPAIRGUI_FREEFACESDLG_H
 
-#include <QDialog>
-#include <GEOMBase_Helper.h>
+#include <GEOMBase_Skeleton.h>
 
 class GEOM_Displayer;
-class QPushButton;
 class QLineEdit;
 class GeometryGUI;
 
@@ -39,8 +37,7 @@ class GeometryGUI;
 // class    : RepairGUI_FreeFacesDlg
 // purpose  :
 //=================================================================================
-class RepairGUI_FreeFacesDlg : public QDialog,
-                               public GEOMBase_Helper
+class RepairGUI_FreeFacesDlg : public GEOMBase_Skeleton
 {
   Q_OBJECT
 
@@ -53,30 +50,25 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
-  
+  virtual GEOM::GEOM_Object_ptr      getFather (GEOM::GEOM_Object_ptr);
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
+
 private:
   void                               Init();
   void                               enterEvent( QEvent* );
-  void                               closeEvent( QCloseEvent* );
-  void                               keyPressEvent( QKeyEvent* );
   void                               activateSelection();
   GEOM_Displayer*                    getDisplayer();
 
 private slots:
-  void                               onClose();
-  void                               onHelp(); 
-  void                               onDeactivate();
-  void                               onActivate();
-  void                               onSelectionDone();
-  void                               onSetEditCurrentArgument();
+  void                               ClickOnOk();
+  bool                               ClickOnApply();
+  void                               SelectionIntoArgument();
+  void                               ActivateThisDialog();
 
 private:
   GEOM_Displayer*                    myDisplayer;
   GEOM::GEOM_Object_var              myObj;
-  QPushButton*                       mySelBtn;
   QLineEdit*                         myEdit;
-  GeometryGUI*                       myGeomGUI;
-  QString                            myHelpFileName;
 };
 
 #endif // REPAIRGUI_FREEFACESDLG_H
index ba795c130ca1a4c350a42c3fc87938a56a3acfc3..ac1372811e1403a9d09a99955de34f124521d5d6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -346,3 +346,15 @@ void RepairGUI_FuseEdgesDlg::addSubshapesToStudy()
   for (int i = 0; i < myPoints.count(); i++)
     GEOMBase::PublishSubObject(myPoints[i].get());
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_FuseEdgesDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myPoints);
+  GEOM::GeomObjPtr aGeomObjPtr(myShape);
+  res << aGeomObjPtr;
+  return res;
+}
index b7cf9c4d1aff97e8cb2394755a918775beda81f8..2c4bc6496b7c49dced9d4f434f52d75581904b69 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -44,6 +44,7 @@ protected:
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private slots:
   void                               ClickOnOk();
index 55a1bb27ac054381c34b5bf62ecdf0a08f36335a..2c288851b38403a4a4585bc1ce0e6b61f4d2fd9a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -30,6 +30,7 @@
 #include <GeometryGUI.h>
 #include <GEOMBase.h>
 #include <SalomeApp_DoubleSpinBox.h>
+#include "utilities.h"
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_Study.h>
@@ -44,6 +45,7 @@
 #include <SUIT_ViewManager.h>
 #include <OCCViewer_ViewModel.h>
 #include <SALOME_ListIO.hxx>
+#include "utilities.h"
 
 #include <GEOMImpl_Types.hxx>
 
@@ -91,7 +93,7 @@ RepairGUI_GlueDlg::RepairGUI_GlueDlg(GeometryGUI* theGeometryGUI, QWidget* paren
 
   GroupPoints = new DlgRef_1SelExt(centralWidget());
   GroupPoints->GroupBox1->setTitle(tr("GEOM_GLUE"));
-  GroupPoints->TextLabel1->setText(tr("GEOM_SELECTED_SHAPE"));
+  GroupPoints->TextLabel1->setText(tr("GEOM_SELECTED_SHAPES"));
   GroupPoints->PushButton1->setIcon(image0);
   GroupPoints->LineEdit1->setReadOnly(true);
 
@@ -108,7 +110,7 @@ RepairGUI_GlueDlg::RepairGUI_GlueDlg(GeometryGUI* theGeometryGUI, QWidget* paren
 
   GroupPoints2 = new DlgRef_1SelExt(centralWidget());
   GroupPoints2->GroupBox1->setTitle(tr("GEOM_GLUE"));
-  GroupPoints2->TextLabel1->setText(tr("GEOM_SELECTED_SHAPE"));
+  GroupPoints2->TextLabel1->setText(tr("GEOM_SELECTED_SHAPES"));
   GroupPoints2->PushButton1->setIcon(image0);
   GroupPoints2->LineEdit1->setReadOnly(true);
 
@@ -191,7 +193,7 @@ void RepairGUI_GlueDlg::Init()
   /* init variables */
   myEditCurrentArgument = GroupPoints->LineEdit1;
 
-  myObject = GEOM::GEOM_Object::_nil();
+  myObjects.clear();
 
   //myGeomGUI->SetState(0);
   //globalSelection(GEOM_COMPOUND);
@@ -330,17 +332,13 @@ void RepairGUI_GlueDlg::SelectionIntoArgument()
 
   erasePreview();
   myEditCurrentArgument->setText("");
-  myObject = GEOM::GEOM_Object::_nil();
+  myObjects.clear();
 
-  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
-  SALOME_ListIO aSelList;
-  aSelMgr->selectedObjects(aSelList);
+  myObjects = getSelected( TopAbs_SHAPE, -1 );
 
-  if (aSelList.Extent() == 1) {
-    Handle(SALOME_InteractiveObject) anIO = aSelList.First();
-    myObject = GEOMBase::ConvertIOinGEOMObject(anIO);
-    if (!CORBA::is_nil(myObject))
-      myEditCurrentArgument->setText(GEOMBase::GetName(myObject));
+  if ( !myObjects.isEmpty() ) {
+    QString aName = myObjects.count() > 1 ? QString( "%1_objects").arg( myObjects.count() ) : GEOMBase::GetName( myObjects[0].get() );
+    myEditCurrentArgument->setText( aName );
   }
   updateButtonState();
 }
@@ -432,7 +430,7 @@ bool RepairGUI_GlueDlg::isValid(QString& msg)
     ok = myTolEdt2->isValid(msg, !IsPreview());
     break;
   }
-  return !myObject->_is_nil() && (IsPreview() || v > 0.) && ok;
+  return !myObjects.isEmpty() && (IsPreview() || v > 0.) && ok;
 }
 
 //=================================================================================
@@ -444,15 +442,20 @@ bool RepairGUI_GlueDlg::execute(ObjectList& objects)
   bool aResult = false;
   objects.clear();
 
+  GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+  objList->length( myObjects.count() );
+  for ( int i = 0; i < myObjects.count(); ++i )
+    objList[i] = myObjects[i].copy();
+
   GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
   switch (getConstructorId()) {
   case 0:
     {
       GEOM::GEOM_Object_var anObj;
       if (myGlueMode == TopAbs_FACE)
-        anObj = anOper->MakeGlueFaces(myObject, myTolEdt->value(), true);
+        anObj = anOper->MakeGlueFaces( objList, myTolEdt->value(), true);
       else if (myGlueMode == TopAbs_EDGE)
-        anObj = anOper->MakeGlueEdges(myObject, myTolEdt->value());
+        anObj = anOper->MakeGlueEdges( objList, myTolEdt->value());
 
       aResult = !anObj->_is_nil();
       if (aResult && !IsPreview())
@@ -506,11 +509,11 @@ bool RepairGUI_GlueDlg::execute(ObjectList& objects)
       GEOM::GEOM_Object_var anObj;
       if (myGlueMode == TopAbs_FACE) {
         bool doGlueAllEdges = myGlueAllEdgesChk->isChecked();
-        anObj = anOper->MakeGlueFacesByList(myObject, myTolEdt2->value(), aListForGlue.in(),
+        anObj = anOper->MakeGlueFacesByList( objList, myTolEdt2->value(), aListForGlue.in(),
                                             true, doGlueAllEdges);
       }
       else if (myGlueMode == TopAbs_EDGE)
-        anObj = anOper->MakeGlueEdgesByList(myObject, myTolEdt2->value(), aListForGlue.in());
+        anObj = anOper->MakeGlueEdgesByList( objList, myTolEdt2->value(), aListForGlue.in());
 
       aResult = !anObj->_is_nil();
 
@@ -612,8 +615,6 @@ bool RepairGUI_GlueDlg::onAcceptLocal()
     return false;
   }
 
-  erasePreview(false);
-
   try {
     if (openCommand()) {
       SUIT_OverrideCursor wc;
@@ -669,6 +670,8 @@ bool RepairGUI_GlueDlg::onAcceptLocal()
     abortCommand();
   }
 
+  erasePreview(false);
+
   updateViewer();
   activateSelection();
   updateButtonState();
@@ -693,12 +696,17 @@ void RepairGUI_GlueDlg::onDetect()
   buttonApply()->setEnabled(false);
   globalSelection(GEOM_ALLSHAPES);
 
+  GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+  objList->length( myObjects.count() );
+  for ( int i = 0; i < myObjects.count(); ++i )
+    objList[i] = myObjects[i].copy();
+
   GEOM::GEOM_IShapesOperations_var anOper = GEOM::GEOM_IShapesOperations::_narrow(getOperation());
   GEOM::ListOfGO_var aList;
   if (myGlueMode == TopAbs_FACE)
-    aList = anOper->GetGlueFaces(myObject.in(), myTolEdt2->value());
+    aList = anOper->GetGlueFaces( objList, myTolEdt2->value());
   else if (myGlueMode == TopAbs_EDGE)
-    aList = anOper->GetGlueEdges(myObject.in(), myTolEdt2->value());
+    aList = anOper->GetGlueEdges( objList, myTolEdt2->value());
 
   for (int i = 0, n = aList->length(); i < n; i++)
     myTmpObjs << GEOM::GeomObjPtr(aList[i].in());
@@ -719,7 +727,10 @@ void RepairGUI_GlueDlg::onDetect()
 
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument())) ;
-  SUIT_MessageBox::information(this, tr("GEOM_FREE_BOUNDS_TLT"), msg, tr("Close"));
+  if ( myGlueMode == TopAbs_FACE )
+    SUIT_MessageBox::information(this, tr("GEOM_GLUE_FACES_DETECT_TITLE"), msg, tr("Close"));
+  else
+    SUIT_MessageBox::information(this, tr("GEOM_GLUE_EDGES_DETECT_TITLE"), msg, tr("Close"));
   updateButtonState();
   activateSelection();
 }
@@ -739,7 +750,7 @@ void RepairGUI_GlueDlg::activateSelection()
                 this, SLOT(SelectionIntoArgument()));
 
     globalSelection(GEOM_ALLSHAPES);
-    if (myObject->_is_nil())
+    if ( myObjects.isEmpty() )
       SelectionIntoArgument();
 
     connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
@@ -768,7 +779,7 @@ void RepairGUI_GlueDlg::activateSelection()
 void RepairGUI_GlueDlg::updateButtonState()
 {
   int anId = getConstructorId();
-  bool hasMainObj = !myObject->_is_nil();
+  bool hasMainObj = !myObjects.isEmpty();
   if (anId == 0) {
     buttonOk()->setEnabled(hasMainObj);
     buttonApply()->setEnabled(hasMainObj);
@@ -832,3 +843,15 @@ void RepairGUI_GlueDlg::ClickOnCancel()
   clearTemporary();
   GEOMBase_Skeleton::ClickOnCancel();
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_GlueDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myObjects);
+  for (int i = 0; i < myTmpObjs.count(); i++)
+    res << myTmpObjs[i];
+  return res;
+}
index 4b6ccc3afa59d1fbfacc6c3f89918f65c4e9b9a6..e3a4d47ba58633ef9d85c64289eb9f020d01080f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -56,6 +56,7 @@ protected:
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);
   virtual void                       restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
@@ -73,7 +74,7 @@ private:
   void                               selectTmpInViewer();
 
 private:
-  GEOM::GEOM_Object_var              myObject;
+  QList<GEOM::GeomObjPtr>            myObjects;
   QList<GEOM::GeomObjPtr>            myTmpObjs;
 
   DlgRef_1SelExt*                    GroupPoints;
diff --git a/src/RepairGUI/RepairGUI_InspectObjectDlg.cxx b/src/RepairGUI/RepairGUI_InspectObjectDlg.cxx
new file mode 100644 (file)
index 0000000..a66f9c1
--- /dev/null
@@ -0,0 +1,1366 @@
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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
+//
+
+// internal includes
+#include "RepairGUI_InspectObjectDlg.h"
+
+// GEOM includes
+#include <GEOMBase.h>
+#include <GEOM_Constants.h>
+#include <GeometryGUI.h>
+#include <GEOMUtils.hxx>
+
+// GUI includes
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Desktop.h>
+#include <SUIT_ViewManager.h>
+#include <SUIT_ViewWindow.h>
+
+#include <LightApp_SelectionMgr.h>
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SalomeApp_Study.h>
+
+#include <OCCViewer_ViewModel.h>
+#include <SVTK_ViewModel.h>
+
+// OCCT includes
+#include <BRep_Tool.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopoDS.hxx>
+#include <TopoDS_Iterator.hxx>
+#include <TopTools_IndexedMapOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
+
+// Qt includes
+#include <QButtonGroup>
+#include <QComboBox>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QPushButton>
+#include <QHeaderView>
+#include <QItemDelegate>
+#include <QLineEdit>
+#include <QRadioButton>
+#include <QStackedLayout>
+#include <QTreeWidgetItem>
+
+// Shape type definitions (values are equal to corresponding types of TopAbs_ShapeEnum).
+#define TYPE_FACE   4
+#define TYPE_EDGE   6
+#define TYPE_VERTEX 7
+
+// Comparison type definitions
+#define COMPARE_GT 0
+#define COMPARE_GE 1
+#define COMPARE_LT 2
+#define COMPARE_LE 3
+
+// Default tolerance values
+#define DEFAULT_TOLERANCE_VALUE         1.e-07
+
+//=================================================================================
+// class    : RepairGUI_InspectObjectDlg::TreeWidgetItem
+// purpose  : class for "Inspect Object" tree item creation
+//=================================================================================
+class RepairGUI_InspectObjectDlg::TreeWidgetItem : public QTreeWidgetItem
+{
+public:
+  TreeWidgetItem(QTreeWidget*,
+                 const QStringList&,
+                 const TopoDS_Shape&,
+                 const Handle(SALOME_InteractiveObject)&,
+                 double = DEFAULT_TOLERANCE_VALUE,
+                 int = Type);
+
+  TreeWidgetItem(QTreeWidgetItem*,
+                 const QStringList&,
+                 const TopoDS_Shape&,
+                 const QString&,
+                 double = DEFAULT_TOLERANCE_VALUE,
+                 int = Type);
+
+  ~TreeWidgetItem();
+
+  bool                             isVisible();
+  void                             setVisible( bool, QIcon& );
+
+  TopoDS_Shape                     getShape() const;
+  Handle(SALOME_InteractiveObject) getIO() const;
+
+  double                           getTolerance() const;
+  void                             setTolerance(double theTolerance);
+
+private:
+  bool                             myIsVisible;
+  TopoDS_Shape                     myShape;
+  Handle(SALOME_InteractiveObject) myIO;
+  double                           myTolerance;
+
+};
+
+RepairGUI_InspectObjectDlg::TreeWidgetItem::TreeWidgetItem
+                     (QTreeWidget                            *view,
+                      const QStringList                      &strings,
+                      const TopoDS_Shape                     &shape,
+                      const Handle(SALOME_InteractiveObject) &io,
+                      double                                  theTolerance,
+                      int                                     type)
+: QTreeWidgetItem( view, strings, type ),
+  myIsVisible( false ),
+  myShape( shape ),
+  myIO( io ),
+  myTolerance (theTolerance)
+{
+}
+
+RepairGUI_InspectObjectDlg::TreeWidgetItem::TreeWidgetItem
+                     (QTreeWidgetItem    *parent,
+                      const QStringList  &strings,
+                      const TopoDS_Shape &shape,
+                      const QString      &entry,
+                      double              theTolerance,
+                      int                 type)
+: QTreeWidgetItem( parent, strings, type ),
+  myIsVisible( false ),
+  myShape( shape ),
+  myTolerance (theTolerance)
+{
+  myIO = new SALOME_InteractiveObject( entry.toAscii(), "GEOM", "TEMP_IO" );
+  setFlags( flags() | Qt::ItemIsEditable );
+}
+
+RepairGUI_InspectObjectDlg::TreeWidgetItem::~TreeWidgetItem()
+{
+}
+
+bool RepairGUI_InspectObjectDlg::TreeWidgetItem::isVisible()
+{
+  return myIsVisible;
+}
+
+void RepairGUI_InspectObjectDlg::TreeWidgetItem::setVisible( bool isVisible, QIcon& icon )
+{
+  myIsVisible = isVisible;
+  setIcon( 1, icon );
+}
+
+TopoDS_Shape RepairGUI_InspectObjectDlg::TreeWidgetItem::getShape() const
+{
+  return myShape;
+}
+
+Handle(SALOME_InteractiveObject) RepairGUI_InspectObjectDlg::TreeWidgetItem::getIO() const
+{
+  return myIO;
+}
+
+double RepairGUI_InspectObjectDlg::TreeWidgetItem::getTolerance() const
+{
+  return myTolerance;
+}
+
+void RepairGUI_InspectObjectDlg::TreeWidgetItem::setTolerance(double theTolerance)
+{
+  myTolerance = theTolerance;
+}
+
+//=================================================================================
+// class    : RepairGUI_InspectObjectDlg::Delegate
+// purpose  : class for "Inspect Object" tree item editing
+//=================================================================================
+class RepairGUI_InspectObjectDlg::Delegate : public QItemDelegate
+{
+public:
+  Delegate( QObject* = 0 );
+  ~Delegate();
+
+  void   setEditorData( QWidget*, const QModelIndex& ) const;
+  void   setModelData( QWidget*, QAbstractItemModel*, const QModelIndex& ) const;
+  QWidget* createEditor( QWidget*, const QStyleOptionViewItem&, const QModelIndex& ) const;
+};
+
+RepairGUI_InspectObjectDlg::Delegate::Delegate( QObject* parent )
+: QItemDelegate( parent )
+{
+}
+
+RepairGUI_InspectObjectDlg::Delegate::~Delegate()
+{
+}
+
+void RepairGUI_InspectObjectDlg::Delegate::setEditorData( QWidget* editor,
+                                                          const QModelIndex& index ) const
+{
+  QItemDelegate::setEditorData( editor, index );
+  editor->setProperty( "___name___", editor->property( "text" ) );
+}
+
+void RepairGUI_InspectObjectDlg::Delegate::setModelData( QWidget* editor,
+                                                         QAbstractItemModel* model,
+                                                         const QModelIndex& index ) const
+{
+  QString aNewName = editor->property( "text" ).toString();
+  if ( aNewName.trimmed().isEmpty() )
+    editor->setProperty( "text", editor->property( "___name___" ) );
+  QItemDelegate::setModelData( editor, model, index );
+}
+
+QWidget* RepairGUI_InspectObjectDlg::Delegate::createEditor( QWidget* parent,
+                                                             const QStyleOptionViewItem& option,
+                                                             const QModelIndex& index ) const
+{
+  return index.column() == 1 ? 0 : QItemDelegate::createEditor( parent, option, index );
+}
+
+//=================================================================================
+// class    : RepairGUI_InspectObjectDlg()
+// purpose  : Constructs a RepairGUI_InspectObjectDlg which is a child of 'parent'.
+//=================================================================================
+RepairGUI_InspectObjectDlg::RepairGUI_InspectObjectDlg(GeometryGUI *theGeomGUI, SUIT_Desktop* parent )
+: GEOMBase_Helper       (parent),
+  QDialog               (parent),
+  myGeomGUI             (theGeomGUI),
+  myTreeObjects         (0),
+  myFilteredTreeObjects (0),
+  myCurrentTreeObjects  (0),
+  myEditMainShape       (0),
+  myTolFilterGrp        (0),
+  myShapeTypeBtnGrp     (0),
+  myComparisonCompo     (0),
+  myMinTolValLabel      (0),
+  myMaxTolValLabel      (0),
+  myTolEdit             (0),
+  myTreesLayout         (0),
+  myTransparency        (0.0),
+  myIsSelectAll         (false),
+  myMaxTol              (-1.),
+  myMinTol              (-1.)
+{
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  QIcon iconSelect( resMgr->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+  myVisible = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_VISIBLE" ) ) );
+  myInvisible = QIcon( resMgr->loadPixmap( "SUIT", tr( "ICON_DATAOBJ_INVISIBLE" ) ) );
+
+  QPixmap anImageVtx(resMgr->loadPixmap("GEOM", tr("ICON_OBJBROWSER_VERTEX")));
+  QPixmap anImageEdge(resMgr->loadPixmap("GEOM", tr("ICON_OBJBROWSER_EDGE")));
+  QPixmap anImageFace(resMgr->loadPixmap("GEOM", tr("ICON_OBJBROWSER_FACE")));
+
+  setWindowTitle( tr( "GEOM_INSPECT_OBJECT_TITLE" ) );
+  setAttribute( Qt::WA_DeleteOnClose );
+
+  myViewWindow = myGeomGUI->getApp()->desktop()->activeWindow();
+
+  QGridLayout* topLayout = new QGridLayout( this );
+  topLayout->setMargin( 11 ); topLayout->setSpacing( 6 );
+
+  /**********************   Inspected Object    **********************/
+
+  QHBoxLayout* mainShapeLayout = new QHBoxLayout(this);
+
+  QLabel* label = new QLabel( tr( "GEOM_INSPECT_OBJECT_MAIN_SHAPE" ), this );
+  QPushButton* selBtn = new QPushButton(this);
+  selBtn->setIcon( iconSelect );
+  myEditMainShape = new QLineEdit(this);
+  myEditMainShape->setReadOnly(true);
+
+  mainShapeLayout->addWidget( label );
+  mainShapeLayout->addWidget( selBtn );
+  mainShapeLayout->addWidget( myEditMainShape );
+
+  /**********************   Tolerance filter    **********************/
+
+  myTolFilterGrp    = new QGroupBox (tr("GEOM_INSPECT_TOLERANCE_FILTER"), this);
+  myShapeTypeBtnGrp = new QButtonGroup(myTolFilterGrp);
+
+  // Filter on shape type
+  QRadioButton *aVtx   = new QRadioButton(tr("GEOM_VERTEX"), myTolFilterGrp);
+  QRadioButton *anEdge = new QRadioButton(tr("GEOM_EDGE"),   myTolFilterGrp);
+  QRadioButton *aFace  = new QRadioButton(tr("GEOM_FACE"),   myTolFilterGrp);
+
+  aVtx->setIcon(anImageVtx);
+  anEdge->setIcon(anImageEdge);
+  aFace->setIcon(anImageFace);
+  myShapeTypeBtnGrp->addButton(aVtx,   TYPE_VERTEX);
+  myShapeTypeBtnGrp->addButton(anEdge, TYPE_EDGE);
+  myShapeTypeBtnGrp->addButton(aFace,  TYPE_FACE);
+
+  // Filter on sub-shape tolerance
+  QLabel      *aTolLabel     = new QLabel(tr("GEOM_TOLERANCE"), myTolFilterGrp);
+  QLabel      *aMinTolLabel  = new QLabel(tr("GEOM_MIN"), myTolFilterGrp);
+  QLabel      *aMaxTolLabel  = new QLabel(tr("GEOM_MAX"), myTolFilterGrp);
+  QGridLayout *aFilterLayout = new QGridLayout(myTolFilterGrp);
+
+  myMinTolValLabel  = new QLabel(myTolFilterGrp);
+  myMaxTolValLabel  = new QLabel(myTolFilterGrp);
+  myMinTolResetBtn  = new QPushButton(tr("GEOM_INSPECT_RESET_MIN"), myTolFilterGrp);
+  myMaxTolResetBtn  = new QPushButton(tr("GEOM_INSPECT_RESET_MAX"), myTolFilterGrp);
+  myComparisonCompo = new QComboBox(myTolFilterGrp);
+  myTolEdit         = new SalomeApp_DoubleSpinBox(myTolFilterGrp);
+  myTolEdit->setMinimumWidth(120);
+  aFilterLayout->addWidget(aVtx,   0, 0);
+  aFilterLayout->addWidget(anEdge, 0, 1);
+  aFilterLayout->addWidget(aFace,  0, 2);
+  aFilterLayout->addWidget(aMaxTolLabel,      1, 0, Qt::AlignRight);
+  aFilterLayout->addWidget(aTolLabel,         2, 0);
+  aFilterLayout->addWidget(aMinTolLabel,      3, 0, Qt::AlignRight);
+  aFilterLayout->addWidget(myMaxTolValLabel,  1, 1);
+  aFilterLayout->addWidget(myComparisonCompo, 2, 1);
+  aFilterLayout->addWidget(myMinTolValLabel,  3, 1);
+  aFilterLayout->addWidget(myMaxTolResetBtn,  1, 2);
+  aFilterLayout->addWidget(myTolEdit,         2, 2);
+  aFilterLayout->addWidget(myMinTolResetBtn,  3, 2);
+  aFilterLayout->setRowMinimumHeight(0, 30);
+
+  myTolFilterGrp->setCheckable(true);
+
+  /**********************   Sub-objects trees   **********************/
+  createTreeWidget(myTreeObjects);
+  createTreeWidget(myFilteredTreeObjects);
+
+  myTreesLayout = new QStackedLayout(this);
+  myTreesLayout->addWidget(myTreeObjects);
+  myTreesLayout->addWidget(myFilteredTreeObjects);
+
+  /**********************        Buttons        **********************/
+
+  QVBoxLayout* buttonsLayout1 = new QVBoxLayout(this);
+
+  QPushButton* buttonShow = new QPushButton( tr( "GEOM_INSPECT_OBJECT_SHOW" ), this );
+  QPushButton* buttonShowOnly = new QPushButton( tr( "GEOM_INSPECT_OBJECT_SHOW_ONLY" ), this );
+  QPushButton* buttonHide = new QPushButton( tr( "GEOM_INSPECT_OBJECT_HIDE" ), this );
+  QPushButton* buttonPublish = new QPushButton( tr( "GEOM_INSPECT_OBJECT_PUBLISH" ), this );
+  QPushButton* aShowAllBtn = new QPushButton(tr("SHOW_ALL_BTN"), this);
+  QPushButton* aHideAllBtn = new QPushButton(tr("HIDE_ALL_BTN"), this);
+
+
+  buttonsLayout1->addWidget( buttonShow );
+  buttonsLayout1->addWidget( buttonShowOnly );
+  buttonsLayout1->addWidget( buttonHide );
+  buttonsLayout1->addWidget( aShowAllBtn );
+  buttonsLayout1->addWidget( aHideAllBtn );
+  buttonsLayout1->addWidget( buttonPublish );
+  buttonsLayout1->addStretch();
+
+  QHBoxLayout* buttonsLayout2 = new QHBoxLayout(this);
+
+  QPushButton* buttonClose = new QPushButton( tr( "GEOM_BUT_CLOSE" ), this );
+  QPushButton* buttonHelp = new QPushButton( tr( "GEOM_BUT_HELP" ), this );
+
+  buttonsLayout2->addWidget( buttonClose );
+  buttonsLayout2->addStretch();
+  buttonsLayout2->addWidget( buttonHelp );
+
+  topLayout->addLayout( mainShapeLayout, 0, 0 );
+  topLayout->addWidget( myTolFilterGrp, 1, 0);
+  topLayout->addLayout( myTreesLayout, 2, 0 );
+  topLayout->addLayout( buttonsLayout1, 0, 1, 3, 1 );
+  topLayout->addLayout( buttonsLayout2, 3, 0, 1, 2 );
+
+  connect( selBtn, SIGNAL( clicked() ), this, SLOT( onEditMainShape() ) );
+
+  connect( buttonShow,     SIGNAL( clicked() ), this, SLOT( clickOnShow() ) );
+  connect( buttonShowOnly, SIGNAL( clicked() ), this, SLOT( clickOnShowOnly() ) );
+  connect( buttonHide,     SIGNAL( clicked() ), this, SLOT( clickOnHide() ) );
+  connect( buttonPublish,  SIGNAL( clicked() ), this, SLOT( clickOnPublish() ) );
+  connect( buttonClose,    SIGNAL( clicked() ), this, SLOT( reject() ) );
+  connect( buttonHelp,     SIGNAL( clicked() ), this, SLOT( clickOnHelp() ) );
+  connect( aShowAllBtn,   SIGNAL( clicked() ), this, SLOT( clickOnShowAll() ) );
+  connect( aHideAllBtn,   SIGNAL( clicked() ), this, SLOT( clickOnHideAll() ) );
+
+  init();
+}
+
+RepairGUI_InspectObjectDlg::~RepairGUI_InspectObjectDlg()
+{
+  if ( myViewWindow )
+    onEditMainShape();
+  // restore initial parameters for viewer
+  getDisplayer()->UnsetColor();
+  getDisplayer()->UnsetWidth();
+  // no need to delete child widgets, Qt does it all for us
+}
+
+//=================================================================================
+// function : createTreeWidget()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::createTreeWidget(QTreeWidget *&theTreeObjects)
+{
+  theTreeObjects = new QTreeWidget(this);
+  theTreeObjects->setColumnCount(2);
+  QStringList columnNames;
+  columnNames.append(tr("GEOM_INSPECT_OBJECT_NAME"));
+  columnNames.append("");
+  theTreeObjects->setHeaderLabels(columnNames);
+  QTreeWidgetItem* headerItem = new QTreeWidgetItem(columnNames);
+
+  headerItem->setIcon(1, myInvisible);
+  theTreeObjects->setHeaderItem(headerItem);
+  theTreeObjects->header()->moveSection(1, 0);
+  theTreeObjects->header()->setClickable(true);
+  theTreeObjects->header()->setMovable(false);
+  theTreeObjects->header()->setResizeMode( 1, QHeaderView::ResizeToContents);
+  theTreeObjects->setSelectionMode(QAbstractItemView::ExtendedSelection);
+  theTreeObjects->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::EditKeyPressed);
+  // set custom item delegate
+  theTreeObjects->setItemDelegate(new Delegate(theTreeObjects));
+}
+
+//=================================================================================
+// function : init()
+// purpose  : initialize dialog data
+//=================================================================================
+void RepairGUI_InspectObjectDlg::init()
+{
+  myTolFilterGrp->setChecked(false);
+  myComparisonCompo->addItem(">",  GEOMUtils::CC_GT);
+  myComparisonCompo->addItem(">=", GEOMUtils::CC_GE);
+  myComparisonCompo->addItem("<",  GEOMUtils::CC_LT);
+  myComparisonCompo->addItem("<=", GEOMUtils::CC_LE);
+
+  initSpinBox(myTolEdit, 0., 100., DEFAULT_TOLERANCE_VALUE, "len_tol_precision");
+  myTolEdit->setValue(DEFAULT_TOLERANCE_VALUE);
+
+  // Signals and slots connections
+  initTreeWidget(myTreeObjects);
+  initTreeWidget(myFilteredTreeObjects);
+  myCurrentTreeObjects = myTreeObjects;
+  myMaxTolResetBtn->setEnabled(false);
+  myMinTolResetBtn->setEnabled(false);
+
+  connect(myMinTolResetBtn,  SIGNAL(clicked()), this, SLOT(clickOnResetToMin()));
+  connect(myMaxTolResetBtn,  SIGNAL(clicked()), this, SLOT(clickOnResetToMax()));
+  connect(myShapeTypeBtnGrp, SIGNAL(buttonClicked(int)), this, SLOT(onInitFilteredData()));
+  connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+  connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(reject()));
+
+  connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+           this, SLOT( onViewSelectionChanged() ) );
+
+  connect( myGeomGUI->getApp()->desktop(), SIGNAL( windowActivated( SUIT_ViewWindow* ) ),
+           this, SLOT( onWindowActivated( SUIT_ViewWindow* ) ) );
+
+  // Connect signals and slots for filter group box elements.
+  connect(myTolFilterGrp, SIGNAL(toggled(bool)),
+          this, SLOT(onFilterToggled(bool)));
+  connect(myComparisonCompo, SIGNAL(currentIndexChanged(int)),
+          this, SLOT(onFilterData()));
+  connect(myTolEdit, SIGNAL(valueChanged(double)),
+          this, SLOT(onFilterData()));
+
+  if ( myViewWindow )
+    connect( myViewWindow->getViewManager(), SIGNAL( deleteView( SUIT_ViewWindow* ) ),
+             this, SLOT( onCloseView( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
+
+  // Initialize the dialog with current selection.
+  onViewSelectionChanged();
+}
+
+//=================================================================================
+// function : initSpinBox()
+// purpose  : 
+//=================================================================================
+void RepairGUI_InspectObjectDlg::initSpinBox(SalomeApp_DoubleSpinBox* spinBox, 
+                                             double min,  double max, 
+                                             double step, const char* quantity)
+{
+  // Obtain precision from preferences
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  int aPrecision = resMgr->integerValue( "Geometry", quantity, 6 );
+  
+  spinBox->setPrecision( aPrecision );
+  spinBox->setDecimals( qAbs( aPrecision ) ); // it's necessary to set decimals before the range setting,
+                                    // by default Qt rounds boundaries to 2 decimals at setRange
+  spinBox->setRange( min, max );
+  spinBox->setSingleStep( step );
+  
+  // Add a hint for the user saying how to tune precision
+  QString userPropName = QObject::tr( QString( "GEOM_PREF_%1" ).arg( quantity ).toLatin1().constData() );
+  spinBox->setProperty( "validity_tune_hint", 
+                        QVariant( QObject::tr( "GEOM_PRECISION_HINT" ).arg( userPropName ) ) );
+}
+
+//=================================================================================
+// function : initTreeWidget()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::initTreeWidget(QTreeWidget *theTreeObjects)
+{
+  connect(theTreeObjects, SIGNAL(itemClicked (QTreeWidgetItem *, int)),
+          this, SLOT(onItemClicked(QTreeWidgetItem *, int)));
+  connect(theTreeObjects, SIGNAL(itemChanged (QTreeWidgetItem *, int)),
+          this, SLOT(onItemChanged(QTreeWidgetItem *, int)));
+  connect(theTreeObjects, SIGNAL(itemExpanded (QTreeWidgetItem *)),
+          this, SLOT(onItemExpanded(QTreeWidgetItem *)));
+  connect(theTreeObjects, SIGNAL(itemSelectionChanged()),
+          this, SLOT(onItemSelectionChanged()));
+
+  connect(theTreeObjects->header(), SIGNAL(sectionClicked(int)),
+          this, SLOT(onHeaderClicked(int)));
+}
+
+//=================================================================================
+// function : enterEvent()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::enterEvent (QEvent*)
+{
+  if (!myTolFilterGrp->isEnabled())
+    ActivateThisDialog();
+}
+
+//=================================================================================
+// function : checkVisibleIcon()
+// purpose  : set visible or invisible icon in the header of tree
+//=================================================================================
+void RepairGUI_InspectObjectDlg::checkVisibleIcon()
+{
+  bool isInvisible = false;
+  QTreeWidgetItemIterator it( myCurrentTreeObjects );
+  while ( *it ) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
+    if ( !anItem->isHidden() &&  !anItem->isVisible() ) {
+      isInvisible = true;
+      break;
+    }
+    ++it;
+  }
+
+  if ( isInvisible ) {
+    myCurrentTreeObjects->headerItem()->setIcon( 1, myInvisible );
+    myIsSelectAll = false;
+  }
+  else {
+    myCurrentTreeObjects->headerItem()->setIcon( 1, myVisible );
+    myIsSelectAll = true;
+  }
+}
+
+//=================================================================================
+// function : addSubObjects()
+// purpose  : add sub-objects to parent object in the tree
+//=================================================================================
+void RepairGUI_InspectObjectDlg::addSubObjects
+                    (TreeWidgetItem                   *theParentItem,
+                     const TopTools_IndexedMapOfShape &theIndices)
+{
+  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myTreeObjects->topLevelItem(0) );
+  TopoDS_Iterator it( theParentItem->getShape() );
+  for ( ; it.More(); it.Next() ) {
+    TopoDS_Shape aSubShape = it.Value();
+    int anIndex = theIndices.FindIndex(aSubShape);
+    QString anEntry = QString( "TEMP_" ) + aMainItem->getIO()->getEntry() + QString("_%1").arg( anIndex );
+    TreeWidgetItem* anItem = new TreeWidgetItem( theParentItem, QStringList(), aSubShape, anEntry);
+    anItem->setVisible( false, myInvisible );
+    addSubObjects(anItem, theIndices);
+  }
+}
+
+//=================================================================================
+// function : onInitFilteredData()
+// purpose  : add sub-objects to parent object in the filtered tree
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onInitFilteredData()
+{
+  TreeWidgetItem *aMainItem =
+          dynamic_cast<TreeWidgetItem*>(myFilteredTreeObjects->topLevelItem(0));
+
+  if (!aMainItem) {
+    return;
+  }
+
+  // Remove the children.
+  SALOME_ListIO           aListOfIO;
+  QTreeWidgetItemIterator it(aMainItem);
+
+  while (*it) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
+    if (aMainItem != anItem && (anItem->flags() & Qt::ItemIsSelectable) &&
+        anItem->isVisible() && !anItem->isHidden()) {
+      aListOfIO.Append(anItem->getIO());
+    }
+
+    ++it;
+  }
+
+  myFilteredTreeObjects->clearSelection();
+  myFilteredTreeObjects->headerItem()->setIcon(1, myInvisible);
+  getDisplayer()->Erase(aListOfIO);
+  getDisplayer()->UpdateViewer();
+
+  // Delete child items.
+  QList<QTreeWidgetItem *> aListItems = aMainItem->takeChildren();
+
+  foreach (QTreeWidgetItem *anItem, aListItems) {
+    delete anItem;
+  }
+
+  // Initialize the tree with a new list.
+  TopoDS_Shape      aShape     = aMainItem->getShape();
+  TopAbs_ShapeEnum  aShapeType = aShape.ShapeType();
+
+  myShapeTypeBtnGrp->button(TYPE_FACE)->setVisible(aShapeType < TYPE_FACE);
+  myShapeTypeBtnGrp->button(TYPE_EDGE)->setVisible(aShapeType < TYPE_EDGE);
+  myShapeTypeBtnGrp->button(TYPE_VERTEX)->setVisible(aShapeType < TYPE_VERTEX);
+
+  int anId = myShapeTypeBtnGrp->checkedId();
+
+  myMaxTol = -RealLast();
+  myMinTol =  RealLast();
+
+  if (anId != -1 && myShapeTypeBtnGrp->checkedButton()->isVisible()) {
+    // Get sub-shapes
+    TopTools_MapOfShape         aMapFence;
+    TopExp_Explorer             anExp(aShape, (TopAbs_ShapeEnum)anId);
+    TopTools_IndexedMapOfShape  anIndices;
+
+    TopExp::MapShapes(aShape, anIndices);
+
+    for (; anExp.More(); anExp.Next()) {
+      const TopoDS_Shape &aSubShape = anExp.Current();
+
+      if (aMapFence.Add(aSubShape)) {
+        // Compute tolerance
+        Standard_Real aTolerance = -1.;
+
+        switch (aSubShape.ShapeType()) {
+          case TYPE_FACE:
+            aTolerance = BRep_Tool::Tolerance(TopoDS::Face(aSubShape));
+            break;
+          case TYPE_EDGE:
+            aTolerance = BRep_Tool::Tolerance(TopoDS::Edge(aSubShape));
+            break;
+          case TYPE_VERTEX:
+            aTolerance = BRep_Tool::Tolerance(TopoDS::Vertex(aSubShape));
+            break;
+          default:
+            break;
+        }
+
+        if (aTolerance < 0.) {
+          continue;
+        }
+
+        if (aTolerance > myMaxTol) {
+          myMaxTol = aTolerance;
+        }
+
+        if (aTolerance < myMinTol) {
+          myMinTol = aTolerance;
+        }
+
+        int anIndex = anIndices.FindIndex(aSubShape);
+        QString anEntry = QString( "TEMP_" ) +
+                          aMainItem->getIO()->getEntry() +
+                          QString::number(anIndex);
+        TreeWidgetItem* anItem =
+            new TreeWidgetItem(aMainItem, QStringList(),
+                               aSubShape, anEntry, aTolerance);
+        anItem->setVisible( false, myInvisible );
+      }
+    }
+  }
+
+  // Compose names of sub-items if the main item is expanded.
+  if (aMainItem->isExpanded()) {
+    onItemExpanded(aMainItem);
+  }
+
+  myMaxTolResetBtn->setEnabled(myMaxTol >= myMinTol);
+  myMinTolResetBtn->setEnabled(myMaxTol >= myMinTol);
+
+  if (myMaxTol < myMinTol) {
+    myMinTol = DEFAULT_TOLERANCE_VALUE;
+    myMaxTol = DEFAULT_TOLERANCE_VALUE;
+    myMinTolValLabel->setText(QString::number(DEFAULT_TOLERANCE_VALUE));
+    myMaxTolValLabel->setText(QString::number(DEFAULT_TOLERANCE_VALUE));
+    myTolEdit->setValue(DEFAULT_TOLERANCE_VALUE);
+  } else {
+    myMinTolValLabel->setText(QString::number(myMinTol));
+    myMaxTolValLabel->setText(QString::number(myMaxTol));
+
+    if (GEOMUtils::CompareToleranceValues(myMinTol, myTolEdit->value()) == 1) {
+      clickOnResetToMin();
+    } else if (GEOMUtils::CompareToleranceValues
+                                         (myMaxTol, myTolEdit->value()) == -1) {
+      clickOnResetToMax();
+    } else {
+      onFilterData();
+    }
+  }
+}
+
+//=================================================================================
+// function : onFilterData()
+// purpose  : filter objects in the filtered tree
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onFilterData()
+{
+  TreeWidgetItem *aMainItem =
+          dynamic_cast<TreeWidgetItem*>(myFilteredTreeObjects->topLevelItem(0));
+
+  if (!aMainItem) {
+    return;
+  }
+
+  SALOME_ListIO           aListOfIOToHide;
+  QTreeWidgetItemIterator anIt(aMainItem);
+  const int               aCompValue =
+         myComparisonCompo->itemData(myComparisonCompo->currentIndex()).toInt();
+  const double            aTolValue  = myTolEdit->value();
+
+  while (*anIt) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*anIt);
+
+    if (aMainItem != anItem) {
+      const bool isToFilter = !GEOMUtils::IsFitCondition
+        ((GEOMUtils::ComparisonCondition) aCompValue,
+         anItem->getTolerance(), aTolValue);
+
+      if (isToFilter && !anItem->isHidden()) {
+        if (anItem->isVisible()) {
+          aListOfIOToHide.Append(anItem->getIO());
+        }
+
+        anItem->setVisible(false, myInvisible);
+      }
+
+      anItem->setHidden(isToFilter);
+    }
+
+    ++anIt;
+  }
+
+  if (!aListOfIOToHide.IsEmpty()) {
+    getDisplayer()->Erase(aListOfIOToHide);
+    getDisplayer()->UpdateViewer();
+  }
+
+  checkVisibleIcon();
+}
+
+//=================================================================================
+// function : displayItem()
+// purpose  : display sub-object of inspected object according its tree item
+//=================================================================================
+void RepairGUI_InspectObjectDlg::displayItem( TreeWidgetItem* theItem )
+{
+  GEOM_Displayer* aDisplayer = getDisplayer();
+  if ( theItem == myCurrentTreeObjects->topLevelItem(0) ) {
+    aDisplayer->UnsetColor();
+    aDisplayer->UnsetWidth();
+  }
+  else if ( aDisplayer->GetColor() != Quantity_NOC_VIOLET && aDisplayer->GetWidth() != 2.0 ) {
+    aDisplayer->SetColor( Quantity_NOC_VIOLET );
+    aDisplayer->SetWidth( 2.0 );
+  }
+
+  SALOME_Prs* aPrs = aDisplayer->buildSubshapePresentation( theItem->getShape(), theItem->getIO()->getEntry(),
+                                                            GEOM_Displayer::GetActiveView() );
+  if ( aPrs )
+    displayPreview( aPrs, true, false );
+}
+
+//=================================================================================
+// function : setItemDisplayStatus()
+// purpose  : set visible or invisible status for the same items in the tree
+//=================================================================================
+void RepairGUI_InspectObjectDlg::setItemDisplayStatus( TreeWidgetItem* theItem, bool theIsVisible )
+{
+  QTreeWidgetItemIterator it( myCurrentTreeObjects );
+  while (*it) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
+    if ( anItem->getShape().IsSame( theItem->getShape() ) )
+      anItem->setVisible( theIsVisible, theIsVisible ? myVisible : myInvisible );
+    ++it;
+  }
+}
+
+//=================================================================================
+// function : setMainObjectTransparency()
+// purpose  : set transparency for the inspected object
+//=================================================================================
+void RepairGUI_InspectObjectDlg::setMainObjectTransparency( double theTransparency )
+{
+  SUIT_ViewManager* aViewMan = myViewWindow->getViewManager();
+  SALOME_View* aView = dynamic_cast<SALOME_View*>( aViewMan->getViewModel() );
+  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( myGeomGUI->getApp()->activeStudy() );
+
+  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myCurrentTreeObjects->topLevelItem(0) );
+
+  if (!aMainItem) {
+    return;
+  }
+
+  aStudy->setObjectProperty( myViewWindow->getViewManager()->getGlobalId(),
+                             QString( aMainItem->getIO()->getEntry() ),
+                             GEOM::propertyName( GEOM::Transparency ), theTransparency );
+
+  if ( aView->isVisible( aMainItem->getIO() ) )
+    getDisplayer()->Redisplay( aMainItem->getIO(), true, aView );
+}
+
+//=================================================================================
+// function : restoreParam()
+// purpose  : restore initial parameters of the dialog and the viewer
+//=================================================================================
+void RepairGUI_InspectObjectDlg::restoreParam()
+{
+  SUIT_ViewManager* aViewMan = myViewWindow->getViewManager();
+  SALOME_View* aView = dynamic_cast<SALOME_View*>( aViewMan->getViewModel() );
+  GEOM_Displayer* aDisplayer = getDisplayer();
+  // restore initial parameters for viewer
+  aDisplayer->UnsetColor();
+  aDisplayer->UnsetWidth();
+
+  // restore transparency of main object
+  setMainObjectTransparency( myTransparency );
+
+  // erase sub-shapes
+  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myCurrentTreeObjects->topLevelItem(0) );
+  QTreeWidgetItemIterator it( myCurrentTreeObjects );
+  while (*it) {
+    if ( *it != aMainItem ) {
+      TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
+      aDisplayer->Erase( anItem->getIO(), false, false, aView );
+      anItem->setVisible( false, myInvisible );
+    }
+    ++it;
+  }
+}
+
+//=================================================================================
+// function : onEditMainShape()
+// purpose  : called when selection button was clicked
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onEditMainShape()
+{
+  if ( myEditMainShape->text().isEmpty() || !myViewWindow )
+    return;
+
+  restoreParam();
+
+  // restore initial parameters for dialog box
+  myEditMainShape->setEnabled( true );
+  myEditMainShape->setText("");
+  myEditMainShape->setFocus();
+  myTreeObjects->clear();
+  myFilteredTreeObjects->clear();
+}
+
+//=================================================================================
+// function : onItemClicked()
+// purpose  : called when tree item was clicked
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onItemClicked( QTreeWidgetItem* theItem, int theColumn )
+{
+  if ( theColumn!= 1 || !( theItem->flags() & Qt::ItemIsSelectable ) || !myViewWindow )
+    return;
+
+  GEOM_Displayer* aDisplayer = getDisplayer();
+
+  TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>( theItem );
+
+  if ( anItem->isVisible() ) {
+    aDisplayer->Erase( anItem->getIO(), false, true );
+    setItemDisplayStatus( anItem, false );
+  }
+  else {
+    displayItem( anItem );
+    setItemDisplayStatus( anItem, true );
+  }
+  aDisplayer->UpdateViewer();
+  checkVisibleIcon();
+}
+
+//=================================================================================
+// function : onItemChanged()
+// purpose  : called when tree item was changed
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onItemChanged( QTreeWidgetItem* theItem, int theColumn )
+{
+  if ( theColumn!= 0 || !( theItem->flags() & Qt::ItemIsEditable ) )
+    return;
+
+  // rename the same items in the tree
+  QTreeWidgetItemIterator it( myCurrentTreeObjects );
+  while ( *it ) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
+    if ( anItem->getShape().IsSame( dynamic_cast<TreeWidgetItem*>( theItem )->getShape() ) )
+      anItem->setText( 0, theItem->text(0) );
+    ++it;
+  }
+}
+
+//=================================================================================
+// function : onItemExpanded()
+// purpose  : called when tree item was expanded
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onItemExpanded( QTreeWidgetItem* theItem )
+{
+  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myCurrentTreeObjects->topLevelItem(0) );
+  GEOM::GEOM_Object_var aMainObject = GEOMBase::ConvertIOinGEOMObject( aMainItem->getIO() );
+
+  for ( int i = 0; i < theItem->childCount(); i++ ) {
+    TreeWidgetItem* aSubItem = dynamic_cast<TreeWidgetItem*>( theItem->child(i) );
+    int anIndex = GEOMBase::GetIndex( aSubItem->getShape(), aMainItem->getShape() );
+    if ( aSubItem->text(0).isEmpty() ) {
+      char* aName = aMainObject->GetSubShapeName( anIndex );
+      if ( !QString( aName ).isEmpty() )
+        aSubItem->setText( 0, QString( aName ) );
+      else
+        aSubItem->setText( 0, QString("%1_%2").arg( GEOMBase::TypeName( aSubItem->getShape().ShapeType(), true ) ).arg( anIndex ) );
+    }
+  }
+}
+
+//=================================================================================
+// function : onItemSelectionChanged()
+// purpose  : called when tree item was selected
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onItemSelectionChanged()
+{
+  if ( !myViewWindow )
+    return;
+
+  QList<QTreeWidgetItem*> listItem = myCurrentTreeObjects->selectedItems();
+  SALOME_ListIO aSelected;
+  for ( int i = 0; i < listItem.size(); i++ ) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>( listItem.at(i) );
+    aSelected.Append( anItem->getIO() );
+  }
+  myGeomGUI->getApp()->selectionMgr()->setSelectedObjects( aSelected );
+}
+
+//=================================================================================
+// function : onHeaderClicked()
+// purpose  : called when header item of tree was clicked
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onHeaderClicked( int theColumn )
+{
+  if ( theColumn != 1 || !myViewWindow )
+    return;
+
+  GEOM_Displayer* aDisplayer = getDisplayer();
+
+  if ( myIsSelectAll ) {
+    myIsSelectAll = false;
+    myCurrentTreeObjects->headerItem()->setIcon( 1, myInvisible );
+    SALOME_ListIO aListOfIO;
+    QTreeWidgetItemIterator it( myCurrentTreeObjects );
+    while ( *it ) {
+      TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
+      if ( !anItem->isHidden() && ( anItem->flags() & Qt::ItemIsSelectable ) &&
+          anItem->isVisible() ) {
+        aListOfIO.Append( anItem->getIO() );
+        anItem->setVisible( false, myInvisible );
+      }
+      ++it;
+    }
+    aDisplayer->Erase( aListOfIO );
+  }
+  else {
+    myIsSelectAll = true;
+    myCurrentTreeObjects->headerItem()->setIcon( 1, myVisible );
+    QTreeWidgetItemIterator it( myCurrentTreeObjects );
+    while ( *it ) {
+      TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
+      if ( !anItem->isHidden() &&  ( anItem->flags() & Qt::ItemIsSelectable ) &&
+           !anItem->isVisible() ) {
+        displayItem( anItem );
+        anItem->setVisible( true, myVisible );
+      }
+      ++it;
+    }
+  }
+
+  aDisplayer->UpdateViewer();
+}
+
+//=================================================================================
+// function : onViewSelectionChanged()
+// purpose  : called when selection of object browser was changed
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onViewSelectionChanged()
+{
+  if (!myEditMainShape->isEnabled())
+    return;
+
+  //get shape from selection
+  SALOME_ListIO selected;
+  myGeomGUI->getApp()->selectionMgr()->selectedObjects(selected);
+
+  if ( selected.Extent() != 1 )
+    return;
+
+  if ( !myViewWindow ) {
+    SUIT_ViewManager* occVm = myGeomGUI->getApp()->getViewManager( OCCViewer_Viewer::Type(), true );
+    myViewWindow = occVm->getActiveView();
+    connect( occVm, SIGNAL( deleteView( SUIT_ViewWindow* ) ),
+             this, SLOT( onCloseView( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
+  }
+
+  TopoDS_Shape aShape = GEOMBase::GetTopoFromSelection( selected );
+  if ( aShape.IsNull() )
+    return;
+
+  Handle(SALOME_InteractiveObject) anIO = selected.First();
+  GEOM::GEOM_Object_var anObject = GEOMBase::ConvertIOinGEOMObject( anIO );
+  QString aName = anObject->GetName();
+  CORBA::String_var anEntry = anObject->GetStudyEntry();
+
+  myEditMainShape->setText( aName );
+  myEditMainShape->setEnabled( false );
+
+  // remember initial transparency value
+  SalomeApp_Study* aStudy = dynamic_cast<SalomeApp_Study*>( myGeomGUI->getApp()->activeStudy() );
+  QVariant v = aStudy->getObjectProperty( myViewWindow->getViewManager()->getGlobalId(),
+                                          QString( anEntry.in() ),
+                                          GEOM::propertyName( GEOM::Transparency ), myTransparency );
+  if ( v.canConvert( QVariant::Double ) )
+    myTransparency = v.toDouble();
+
+  TreeWidgetItem* anItem         = new TreeWidgetItem
+              (myTreeObjects, QStringList() << aName, aShape, anIO);
+  TreeWidgetItem* anItemFiltered = new TreeWidgetItem
+              (myFilteredTreeObjects, QStringList() << aName, aShape, anIO);
+
+  if ( getDisplayer()->IsDisplayed( anEntry.in() ) ) {
+    anItem->setVisible( true, myVisible );
+    anItemFiltered->setVisible( true, myVisible );
+  } else {
+    anItem->setVisible( false, myInvisible );
+    anItemFiltered->setVisible( false, myInvisible );
+  }
+
+  setMainObjectTransparency( 0.5 );
+
+  // add sub-objects in the tree
+  TopTools_IndexedMapOfShape anIndices;
+
+  TopExp::MapShapes(aShape, anIndices);
+  addSubObjects(anItem, anIndices);
+  onInitFilteredData();
+  updateViewer(false);
+
+  // check icon for tree header
+  checkVisibleIcon();
+}
+
+//=================================================================================
+// function : onWindowActivated()
+// purpose  : called when other window was activated
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onWindowActivated( SUIT_ViewWindow* theViewWindow )
+{
+  if ( myViewWindow )
+    restoreParam();
+
+  connect( theViewWindow->getViewManager(), SIGNAL( deleteView( SUIT_ViewWindow* ) ),
+           this, SLOT( onCloseView( SUIT_ViewWindow* ) ), Qt::UniqueConnection );
+
+  if ( theViewWindow->getViewManager()->getType() != OCCViewer_Viewer::Type() &&
+       theViewWindow->getViewManager()->getType() != SVTK_Viewer::Type() ) {
+    myViewWindow = 0;
+    return;
+  }
+  myViewWindow = theViewWindow;
+
+  if ( myCurrentTreeObjects->topLevelItemCount() > 0 ) {
+    setMainObjectTransparency( 0.5 );
+    TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myCurrentTreeObjects->topLevelItem(0) );
+    if ( getDisplayer()->IsDisplayed( aMainItem->getIO()->getEntry() ) )
+      aMainItem->setVisible( true, myVisible );
+    else
+      aMainItem->setVisible( false, myInvisible );
+  }
+  checkVisibleIcon();
+}
+
+//=================================================================================
+// function : onCloseView()
+// purpose  : called when last view was closed
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onCloseView( SUIT_ViewWindow* )
+{
+  if ( myGeomGUI->getApp()->desktop()->windows().size() == 0 ) {
+    restoreParam();
+    myViewWindow = 0;
+  }
+}
+
+//=================================================================================
+// function : clickOnShow()
+// purpose  : called when "Show selected" button was clicked
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnShow()
+{
+  if ( !myViewWindow )
+    return;
+
+  QList<QTreeWidgetItem*> listItem = myCurrentTreeObjects->selectedItems();
+  for ( int i = 0; i < listItem.size(); i++ ) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>( listItem.at(i) );
+    if ( !anItem->isVisible() ) {
+      displayItem( anItem );
+      setItemDisplayStatus( anItem, true );
+    }
+  }
+  getDisplayer()->UpdateViewer();
+  checkVisibleIcon();
+}
+
+//=================================================================================
+// function : clickOnShowOnly()
+// purpose  : called when "Show only selected" button was clicked
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnShowOnly()
+{
+  if ( !myViewWindow )
+    return;
+
+  SALOME_ListIO aListOfIO;
+  QTreeWidgetItemIterator it( myCurrentTreeObjects );
+  while ( *it ) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
+    if ( !anItem->isHidden() && ( anItem->flags() & Qt::ItemIsSelectable ) &&
+         anItem->isVisible() ) {
+      aListOfIO.Append( anItem->getIO() );
+      anItem->setVisible( false, myInvisible );
+    }
+    ++it;
+  }
+  getDisplayer()->Erase( aListOfIO );
+
+  clickOnShow();
+}
+
+//=================================================================================
+// function : clickOnHide()
+// purpose  : called when "Hide selected" button was clicked
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnHide()
+{
+  if ( !myViewWindow )
+    return;
+
+  QList<QTreeWidgetItem*> listItem = myCurrentTreeObjects->selectedItems();
+  for ( int i = 0; i < listItem.size(); i++ ) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>( listItem.at(i) );
+    if ( anItem->isVisible() ) {
+      getDisplayer()->Erase( anItem->getIO(), false, false );
+      setItemDisplayStatus( anItem, false );
+    }
+  }
+  getDisplayer()->UpdateViewer();
+  checkVisibleIcon();
+}
+
+//=================================================================================
+// function : clickOnPublish()
+// purpose  : called when "Publish selected" button was clicked
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnPublish()
+{
+  _PTR(Study) studyDS = dynamic_cast<SalomeApp_Study*>( myGeomGUI->getApp()->activeStudy() )->studyDS();
+
+  // find main object
+  TreeWidgetItem* aMainItem = dynamic_cast<TreeWidgetItem*>( myCurrentTreeObjects->topLevelItem(0) );
+
+  if (!aMainItem) {
+    return;
+  }
+
+  GEOM::GEOM_Object_var aMainObject = GEOMBase::ConvertIOinGEOMObject( aMainItem->getIO() );
+
+  // find unique indices of selected objects
+  QList<QTreeWidgetItem*> selectedItems = myCurrentTreeObjects->selectedItems();
+  QMap< int, QString > anIndices;
+  GEOM::ListOfLong_var anArray = new GEOM::ListOfLong;
+  anArray->length( selectedItems.size() );
+  int j = 0;
+  for ( int i = 0; i < selectedItems.size(); i++ ) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>( selectedItems.at(i) );
+    int anIndex = GEOMBase::GetIndex( anItem->getShape(), aMainItem->getShape() );
+    if ( anIndices.find( anIndex ) == anIndices.end() &&
+       anItem != aMainItem ) {
+      anIndices[ anIndex ] = anItem->text(0);
+      anArray[j++] = anIndex;
+    }
+  }
+  anArray->length(j);
+
+  // get selected sub-shapes
+  GEOM::GEOM_IShapesOperations_var anOper = getGeomEngine()->GetIShapesOperations( getStudyId() );
+  GEOM::ListOfGO_var aList = anOper->MakeSubShapes( aMainObject, anArray );
+
+  // publish sub-shapes
+  for ( int i = 0; i < aList->length(); i++ )
+    GeometryGUI::GetGeomGen()->AddInStudy( GeometryGUI::ClientStudyToStudy( studyDS ), aList[i],
+                                           anIndices.values().at(i).toStdString().c_str(), aMainObject );
+
+  updateObjBrowser();
+}
+
+//=================================================================================
+// function : clickOnHelp()
+// purpose  : called when Help button was clicked to open a help page
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnHelp()
+{
+  myGeomGUI->getApp()->onHelpContextModule( "GEOM", "inspect_object_operation_page.html" );
+}
+
+//=================================================================================
+// function : clickOnResetToMin()
+// purpose  : called when Reset button was clicked to reset tolerance filter to minimal value.
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnResetToMin()
+{
+  if (myMinTol >= myTolEdit->minimum() && myMinTol <= myTolEdit->maximum()) {
+    myTolEdit->setValue(myMinTol);
+  }
+}
+
+//=================================================================================
+// function : clickOnResetToMax()
+// purpose  : called when Reset button was clicked to reset tolerance filter to maximal value.
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnResetToMax()
+{
+  if (myMaxTol >= myTolEdit->minimum() && myMaxTol <= myTolEdit->maximum()) {
+    myTolEdit->setValue(myMaxTol);
+  }
+}
+
+//=================================================================================
+// function : clickOnShowAll()
+// purpose  : called when Help button was clicked to show all shapes
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnShowAll()
+{
+  myIsSelectAll = false;
+  onHeaderClicked(1);
+}
+
+//=================================================================================
+// function : clickOnHideAll()
+// purpose  : called when Help button was clicked to hide all shapes
+//=================================================================================
+void RepairGUI_InspectObjectDlg::clickOnHideAll()
+{
+  myIsSelectAll = true;
+  onHeaderClicked(1);
+}
+
+//=================================================================================
+// function : DeactivateActiveDialog()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::DeactivateActiveDialog()
+{
+  setEnabled(false);
+  disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+  myGeomGUI->SetActiveDialogBox(0);
+  globalSelection();
+  erasePreview();
+}
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::ActivateThisDialog()
+{
+  /* Emit a signal to deactivate the active dialog */
+  myGeomGUI->EmitSignalDeactivateDialog();
+  setEnabled(true);
+  myGeomGUI->SetActiveDialogBox( (QDialog*)this );
+
+  connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+          this, SLOT(onViewSelectionChanged()));
+
+  updateViewer(false);
+}
+
+//=================================================================================
+// function : onFilterToggled()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::onFilterToggled(bool isOn)
+{
+  if (isOn) {
+    myCurrentTreeObjects = myFilteredTreeObjects;
+    myTreesLayout->setCurrentIndex(1);
+  } else {
+    myCurrentTreeObjects = myTreeObjects;
+    myTreesLayout->setCurrentIndex(0);
+  }
+
+  updateViewer(true);
+}
+
+//=================================================================================
+// function : updateViewer()
+// purpose  :
+//=================================================================================
+void RepairGUI_InspectObjectDlg::updateViewer(const bool theIsHideOtherTree)
+{
+  GEOM_Displayer *aDisplayer  = getDisplayer();
+
+  if (theIsHideOtherTree) {
+    QTreeWidget    *aTreeToHide = myCurrentTreeObjects == myTreeObjects ?
+                                          myFilteredTreeObjects: myTreeObjects;
+
+    // Hide the objects of disappeared tree, do not switch off flags.
+    SALOME_ListIO           aListOfIO;
+    QTreeWidgetItemIterator it(aTreeToHide);
+
+    while (*it) {
+      TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it);
+      if ((anItem->flags() & Qt::ItemIsSelectable) &&
+          anItem->isVisible() && !anItem->isHidden()) {
+        aListOfIO.Append(anItem->getIO());
+      }
+
+      ++it;
+    }
+
+    aDisplayer->Erase(aListOfIO);
+  }
+
+  // Show the objects that are marked as shown in the appeared tree.
+  QTreeWidgetItemIterator it2(myCurrentTreeObjects);
+
+  while (*it2) {
+    TreeWidgetItem* anItem = dynamic_cast<TreeWidgetItem*>(*it2);
+    if ((anItem->flags() & Qt::ItemIsSelectable) &&
+        anItem->isVisible() && !anItem->isHidden()) {
+      displayItem(anItem);
+    }
+
+    ++it2;
+  }
+
+  aDisplayer->UpdateViewer();
+}
diff --git a/src/RepairGUI/RepairGUI_InspectObjectDlg.h b/src/RepairGUI/RepairGUI_InspectObjectDlg.h
new file mode 100644 (file)
index 0000000..d8ffff0
--- /dev/null
@@ -0,0 +1,129 @@
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 RepairGUI_InspectObjectDlg_H
+#define RepairGUI_InspectObjectDlg_H
+
+// GEOM includes
+#include <GEOMBase_Helper.h>
+
+// Qt includes
+#include <QDialog>
+#include <QPointer>
+#include <QIcon>
+
+class GeometryGUI;
+class SalomeApp_DoubleSpinBox;
+
+class QButtonGroup;
+class QComboBox;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QStackedLayout;
+class QTreeWidget;
+class QTreeWidgetItem;
+
+class TopTools_IndexedMapOfShape;
+
+class RepairGUI_InspectObjectDlg : public QDialog, public GEOMBase_Helper
+{ 
+  Q_OBJECT
+
+  class TreeWidgetItem;
+  class Delegate;
+
+public:
+  RepairGUI_InspectObjectDlg(GeometryGUI*, SUIT_Desktop* );
+  ~RepairGUI_InspectObjectDlg();
+
+private slots:
+  void                    onEditMainShape();
+
+  void                    onItemClicked( QTreeWidgetItem*, int );
+  void                    onItemChanged( QTreeWidgetItem*, int );
+  void                    onItemSelectionChanged();
+  void                    onItemExpanded( QTreeWidgetItem* );
+  void                    onHeaderClicked( int );
+
+  void                    onViewSelectionChanged();
+
+  void                    onWindowActivated( SUIT_ViewWindow* );
+  void                    onCloseView( SUIT_ViewWindow* );
+
+  void                    clickOnShow();
+  void                    clickOnShowOnly();
+  void                    clickOnHide();
+  void                    clickOnPublish();
+  void                    clickOnHelp();
+  void                    clickOnResetToMin();
+  void                    clickOnResetToMax();
+  void                    clickOnShowAll();
+  void                    clickOnHideAll();
+  void                    DeactivateActiveDialog();
+  void                    ActivateThisDialog();
+  void                    onFilterToggled(bool);
+  void                    onInitFilteredData();
+  void                    onFilterData();
+
+private:
+  void                    createTreeWidget(QTreeWidget *&theTreeObjects);
+  void                    init();
+  void                    initSpinBox(SalomeApp_DoubleSpinBox* spinBox, 
+                                      double min,  double max, 
+                                      double step, const char* quantity);
+  void                    initTreeWidget(QTreeWidget *theTopLevelItem);
+  void                    enterEvent( QEvent* );
+  void                    checkVisibleIcon();
+  void                    addSubObjects( TreeWidgetItem*, const TopTools_IndexedMapOfShape &);
+
+  void                    displayItem( TreeWidgetItem* );
+  void                    setItemDisplayStatus( TreeWidgetItem* theItem, bool theIsVisible );
+  void                    setMainObjectTransparency( double );
+  void                    restoreParam();
+  void                    updateViewer(const bool theIsHideOtherTree);
+
+  QPointer<SUIT_ViewWindow>  myViewWindow;
+  GeometryGUI*               myGeomGUI;
+
+  QIcon                      myVisible;
+  QIcon                      myInvisible;
+
+  QTreeWidget               *myTreeObjects;
+  QTreeWidget               *myFilteredTreeObjects;
+  QTreeWidget               *myCurrentTreeObjects;
+  QLineEdit                 *myEditMainShape;
+  QGroupBox                 *myTolFilterGrp;
+  QButtonGroup              *myShapeTypeBtnGrp;
+  QComboBox                 *myComparisonCompo;
+  SalomeApp_DoubleSpinBox   *myTolEdit;
+  QLabel                    *myMinTolValLabel;
+  QLabel                    *myMaxTolValLabel;
+  QStackedLayout            *myTreesLayout;
+  QPushButton               *myMinTolResetBtn;
+  QPushButton               *myMaxTolResetBtn;
+  double                     myMaxTol;
+  double                     myMinTol;
+  bool                       myIsSelectAll;
+  double                     myTransparency;
+
+};
+
+#endif
index 69b37b9f6ab49e9bfbcab61bd8abf109344d6519..ae2ea4718e33d5f8720306048aa50af349aa81f2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include "RepairGUI_LimitToleranceDlg.h"
 
-#include <DlgRef.h>
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
-#include <SalomeApp_DoubleSpinBox.h>
+#include "DlgRef.h"
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+#include "RepairGUI.h"
 
+#include <SalomeApp_DoubleSpinBox.h>
 #include <SalomeApp_Application.h>
 #include <LightApp_SelectionMgr.h>
 #include <SalomeApp_Study.h>
@@ -41,6 +42,7 @@
 #include <SUIT_ViewManager.h>
 #include <OCCViewer_ViewModel.h>
 #include <SALOME_ListIO.hxx>
+#include "utilities.h"
 
 #include <GEOMImpl_Types.hxx>
 
@@ -303,6 +305,8 @@ bool RepairGUI_LimitToleranceDlg::execute(ObjectList& objects)
     QStringList aParameters;
     aParameters << myTolEdt->text();
     anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+    if ( !IsPreview() )
+      RepairGUI::ShowStatistics( anOper, this );
     objects.push_back(anObj._retn());
   }
 
@@ -324,7 +328,6 @@ bool RepairGUI_LimitToleranceDlg::onAcceptLocal()
 
   bool aLocked = aStudy->GetProperties()->IsLocked();
   if (aLocked) {
-    MESSAGE("GEOMBase_Helper::onAccept - ActiveStudy is locked");
     SUIT_MessageBox::warning(this, tr("WRN_WARNING"), tr("WRN_STUDY_LOCKED"), tr("BUT_OK"));
     return false;
   }
@@ -440,3 +443,15 @@ void RepairGUI_LimitToleranceDlg::restoreSubShapes(SALOMEDS::Study_ptr   theStud
                                         mainFrame()->CheckBoxAddPrefix->isChecked());
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_LimitToleranceDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObject);
+  res << aGeomObjPtr;
+  return res;
+}
index 4e2af32debd5756a3264bbc25f9b12bf7d7bc227..aff6f62baded902c15f11e851fb75a109df40df6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,7 @@ protected:
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);
   virtual void                       restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 6b200bfd1fc14dcb9687d8da8a6df2ec85ae63bf..a0deeec023331529a0fc759767b3712ed82ec845 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -314,3 +314,15 @@ void RepairGUI_RemoveExtraEdgesDlg::restoreSubShapes( SALOMEDS::Study_ptr   theS
                                          mainFrame()->CheckBoxAddPrefix->isChecked() );
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_RemoveExtraEdgesDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObject);
+  res << aGeomObjPtr;
+  return res;
+}
index 9c638015edcbdfe83a9deef98ca7b19bf02e7175..dd0a0f8b887040add74c48cdc7b185b860697c00 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -46,6 +46,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );    
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 6206da990e50ca9d0c85d74452f42449aad6e1f6..38b1f89340562e2c9f886fc8c338ec18169b0a69 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 //
 #include "RepairGUI_RemoveHolesDlg.h"
 
-#include <DlgRef.h>
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
+#include "DlgRef.h"
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+#include "RepairGUI.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
@@ -330,8 +331,11 @@ bool RepairGUI_RemoveHolesDlg::execute (ObjectList& objects)
     // highlight them (add to objects), display message dialog
     GEOM::ListOfGO_var aClosed, anOpen;
 
+    GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+    objList->length(1);
+    objList[0] = myObject;
     GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow(getOperation());
-    aResult = anOper->GetFreeBoundary(myObject, aClosed, anOpen);
+    aResult = anOper->GetFreeBoundary(objList, aClosed, anOpen);
 
     if (aResult) {
       myClosed = aClosed->length();
@@ -350,7 +354,11 @@ bool RepairGUI_RemoveHolesDlg::execute (ObjectList& objects)
     GEOM::GEOM_Object_var anObj = anOper->FillHoles(myObject, myWiresInd);
     aResult = !anObj->_is_nil();
     if (aResult)
+    {
+      if ( !IsPreview() )
+        RepairGUI::ShowStatistics( anOper, this );
       objects.push_back(anObj._retn());
+    }
   }
 
   return aResult;
@@ -414,3 +422,15 @@ void RepairGUI_RemoveHolesDlg::onDetect()
     msg = tr("GEOM_FREE_BOUNDS_ERROR");
   SUIT_MessageBox::information(this, tr("GEOM_FREE_BOUNDS_TLT"), msg);
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_RemoveHolesDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObject);
+  res << aGeomObjPtr;
+  return res;
+}
index 79483cb365da097c9c98f19dc5c853bef75d0d01..75c02245ea3f3fa6163bc7a0bcac0e3dc70cd31e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,7 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 927656c57fa719874b994bbd5f612d7e0aca7101..f09bd82040d67145c16f6dc272b96fc37ae9d148 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 //
 #include "RepairGUI_RemoveIntWiresDlg.h"
 
-#include <DlgRef.h>
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
+#include "DlgRef.h"
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+#include "RepairGUI.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
@@ -312,8 +313,11 @@ bool RepairGUI_RemoveIntWiresDlg::execute (ObjectList& objects)
 
   bool aResult = !anObj->_is_nil();
   if (aResult)
+  {
+    if ( !IsPreview() )
+      RepairGUI::ShowStatistics( anOper, this );
     objects.push_back(anObj._retn());
-
+  }
   return aResult;
 }
 
@@ -358,3 +362,15 @@ void RepairGUI_RemoveIntWiresDlg::initSelection()
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_RemoveIntWiresDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObject);
+  res << aGeomObjPtr;
+  return res;
+}
index 9648e8b3bdf3ee4e46efd8291831bea20ea1531d..e26484cf15e0c29c0a1529dd66c712fb48039b24 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -48,6 +48,7 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
   
 private:
   void                               Init();
index a0e18671986d72db93edd159fb906e56fd95acc1..72d55a6def3f2720885115ab6a3e1b95a8017ea3 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -63,7 +63,7 @@ RepairGUI_RemoveWebsDlg::RepairGUI_RemoveWebsDlg (GeometryGUI* theGeometryGUI, Q
   GroupPoints = new DlgRef_1Sel( centralWidget() );
 
   GroupPoints->GroupBox1->setTitle( tr( "GEOM_REMOVE_WEBS" ) );
-  GroupPoints->TextLabel1->setText( tr( "GEOM_SELECTED_SHAPE" ) );
+  GroupPoints->TextLabel1->setText( tr( "GEOM_SELECTED_SHAPES" ) );
   GroupPoints->PushButton1->setIcon( image1 );
   GroupPoints->LineEdit1->setReadOnly( true );
 
@@ -141,7 +141,7 @@ bool RepairGUI_RemoveWebsDlg::ClickOnApply()
   initName();
 
   myEditCurrentArgument->setText("");
-  myObject = GEOM::GEOM_Object::_nil();
+  myObjects.clear();
 
   myOkObject = false;
 
@@ -158,33 +158,16 @@ bool RepairGUI_RemoveWebsDlg::ClickOnApply()
 void RepairGUI_RemoveWebsDlg::SelectionIntoArgument()
 {
   myEditCurrentArgument->setText( "" );
-  QString aName;
-
-  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
-  SALOME_ListIO aSelList;
-  aSelMgr->selectedObjects(aSelList);
-
-  if (myEditCurrentArgument == GroupPoints->LineEdit1) {
-    if (aSelList.Extent() != 1) {
-      if (myEditCurrentArgument == GroupPoints->LineEdit1)
-        myOkObject = false;
-      return;
-    }
-  }
-
-  // nbSel == 1
-  GEOM::GEOM_Object_ptr aSelectedObject =
-    GEOMBase::ConvertIOinGEOMObject(aSelList.First());
+  myObjects.clear();
+  myOkObject = false;
 
-  if (CORBA::is_nil(aSelectedObject))
-    return;
+  myObjects = getSelected( TopAbs_SHAPE, -1 );
 
-  if (myEditCurrentArgument == GroupPoints->LineEdit1) {
-    myObject = aSelectedObject;
+  if ( !myObjects.isEmpty() ) {
+    QString aName = myObjects.count() > 1 ? QString( "%1_objects").arg( myObjects.count() ) : GEOMBase::GetName( myObjects[0].get() );
     myOkObject = true;
+    myEditCurrentArgument->setText( aName );
   }
-
-  myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject));
 }
 
 //=================================================================================
@@ -242,7 +225,7 @@ void RepairGUI_RemoveWebsDlg::enterEvent (QEvent* e)
 void RepairGUI_RemoveWebsDlg::activateSelection()
 {
   TColStd_MapOfInteger aTypes;
-  //aTypes.Add( GEOM_SOLID );
+  aTypes.Add( GEOM_SOLID );
   aTypes.Add( GEOM_COMPOUND );
   globalSelection( aTypes );
 }
@@ -271,8 +254,13 @@ bool RepairGUI_RemoveWebsDlg::isValid (QString& msg)
 //=================================================================================
 bool RepairGUI_RemoveWebsDlg::execute (ObjectList& objects)
 {
+  GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+  objList->length( myObjects.count() );
+  for ( int i = 0; i < myObjects.count(); ++i )
+    objList[i] = myObjects[i].copy();
+
   GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow(getOperation());
-  GEOM::GEOM_Object_var anObj = anOper->RemoveInternalFaces(myObject);
+  GEOM::GEOM_Object_var anObj = anOper->RemoveInternalFaces(objList);
 
   if (!anObj->_is_nil())
     objects.push_back(anObj._retn());
@@ -295,3 +283,12 @@ void RepairGUI_RemoveWebsDlg::restoreSubShapes (SALOMEDS::Study_ptr   theStudy,
                                         mainFrame()->CheckBoxAddPrefix->isChecked());
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_RemoveWebsDlg::getSourceObjects()
+{
+  return myObjects;
+}
index 72fd4993706673f9a669f42f2bce72af5258e627..69c9785e1e945909a8dc116cc8a9c71c8a805ebb 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -45,6 +45,7 @@ protected:
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);
   virtual void                       restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
@@ -52,7 +53,7 @@ private:
   void                               activateSelection();
 
 private:
-  GEOM::GEOM_Object_var              myObject;
+  QList<GEOM::GeomObjPtr>            myObjects;
   bool                               myOkObject;
 
   DlgRef_1Sel*                       GroupPoints;
index 34cc7ddb6ab1bc8cd4a5569b78c1b7f94a42bb06..597a1f7076a2cba991ffda7649bb36705e2a2f5a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -70,7 +70,7 @@ RepairGUI_SewingDlg::RepairGUI_SewingDlg( GeometryGUI* theGeometryGUI, QWidget*
 
   GroupPoints = new DlgRef_1SelExt( centralWidget() );
   GroupPoints->GroupBox1->setTitle( tr( "GEOM_SEWING" ) );
-  GroupPoints->TextLabel1->setText( tr( "GEOM_SELECTED_SHAPE" ) );
+  GroupPoints->TextLabel1->setText( tr( "GEOM_SELECTED_SHAPES" ) );
   GroupPoints->PushButton1->setIcon( image1 );
   GroupPoints->LineEdit1->setReadOnly( true );
 
@@ -117,7 +117,7 @@ void RepairGUI_SewingDlg::Init()
   /* init variables */
   myEditCurrentArgument = GroupPoints->LineEdit1;
 
-  myObject = GEOM::GEOM_Object::_nil();
+  myObjects.clear();
 
   //myGeomGUI->SetState( 0 );
   initSelection();
@@ -166,7 +166,7 @@ bool RepairGUI_SewingDlg::ClickOnApply()
   initName();
 
   GroupPoints->LineEdit1->setText( "" );
-  myObject = GEOM::GEOM_Object::_nil();
+  myObjects.clear();
 
   initSelection();
 
@@ -182,17 +182,13 @@ void RepairGUI_SewingDlg::SelectionIntoArgument()
 {
   erasePreview();
   myEditCurrentArgument->setText( "" );
-  myObject = GEOM::GEOM_Object::_nil();
+  myObjects.clear();
 
-  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
-  SALOME_ListIO aSelList;
-  aSelMgr->selectedObjects(aSelList);
+  myObjects = getSelected( TopAbs_SHAPE, -1 );
 
-  if ( aSelList.Extent() == 1 ) {
-    Handle(SALOME_InteractiveObject) anIO = aSelList.First();
-    myObject = GEOMBase::ConvertIOinGEOMObject( anIO );
-    if ( !CORBA::is_nil( myObject ) )
-      myEditCurrentArgument->setText( GEOMBase::GetName( myObject ) );
+  if ( !myObjects.isEmpty() ) {
+    QString aName = myObjects.count() > 1 ? QString( "%1_objects").arg( myObjects.count() ) : GEOMBase::GetName( myObjects[0].get() );
+    myEditCurrentArgument->setText( aName );
   }
 }
 
@@ -235,7 +231,7 @@ void RepairGUI_SewingDlg::ActivateThisDialog()
            SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
 
   GroupPoints->LineEdit1->setText( "" );
-  myObject = GEOM::GEOM_Object::_nil();
+  myObjects.clear();
 
   myClosed = -1;
   myOpen = -1;
@@ -273,7 +269,7 @@ bool RepairGUI_SewingDlg::isValid( QString& msg )
 {
   myClosed = -1;
   bool ok = myTolEdt->isValid( msg, !IsPreview() );
-  return !myObject->_is_nil() && ( IsPreview() || myTolEdt->value() > 0. ) && ok;
+  return !myObjects.isEmpty() && ( IsPreview() || myTolEdt->value() > 0. ) && ok;
 }
 
 //=================================================================================
@@ -285,10 +281,15 @@ bool RepairGUI_SewingDlg::execute( ObjectList& objects )
   bool aResult = false;
   GEOM::GEOM_IHealingOperations_var anOper = GEOM::GEOM_IHealingOperations::_narrow( getOperation() );
 
+  GEOM::ListOfGO_var objList = new GEOM::ListOfGO;
+  objList->length( myObjects.count() );
+  for ( int i = 0; i < myObjects.count(); ++i )
+    objList[i] = myObjects[i].copy();
+
   if ( IsPreview() ) { // called from onDetect(): detect free boundary edges, highlight them (add to objects), display message dialog
     GEOM::ListOfGO_var aClosed, anOpen;
 
-    aResult = anOper->GetFreeBoundary( myObject, aClosed, anOpen );
+    aResult = anOper->GetFreeBoundary( objList, aClosed, anOpen );
 
     if ( aResult ) {
       myClosed = aClosed->length();
@@ -306,9 +307,9 @@ bool RepairGUI_SewingDlg::execute( ObjectList& objects )
     GEOM::GEOM_Object_var anObj;
 
     if (myAllowNonManifoldChk->isChecked()) {
-      anObj = anOper->SewAllowNonManifold( myObject, myTolEdt->value() );
+      anObj = anOper->SewAllowNonManifold( objList, myTolEdt->value() );
     } else {
-      anObj = anOper->Sew( myObject, myTolEdt->value() );
+      anObj = anOper->Sew( objList, myTolEdt->value() );
     }
 
     aResult = !anObj->_is_nil();
@@ -334,6 +335,7 @@ bool RepairGUI_SewingDlg::execute( ObjectList& objects )
 void RepairGUI_SewingDlg::initSelection()
 {
   TColStd_MapOfInteger aTypes;
+  aTypes.Add( GEOM_FACE );
   aTypes.Add( GEOM_SHELL );
   aTypes.Add( GEOM_SOLID );
   aTypes.Add( GEOM_COMPOUND );
@@ -356,3 +358,12 @@ void RepairGUI_SewingDlg::onDetect()
     msg = tr( "GEOM_FREE_BOUNDS_ERROR" );
   SUIT_MessageBox::information( this, tr( "GEOM_FREE_BOUNDS_TLT" ), msg );
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_SewingDlg::getSourceObjects()
+{
+  return myObjects;
+}
index 264a9b6e7e0f4ba42def1d72bb3c9c9d4c0d5070..fd3d6a797b3dcfb5029768edc0bc10598c375d16 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -42,7 +42,7 @@ class RepairGUI_SewingDlg : public GEOMBase_Skeleton
 {
   Q_OBJECT
 
-public:
+  public:
   RepairGUI_SewingDlg( GeometryGUI*, QWidget* = 0, bool = false );
   ~RepairGUI_SewingDlg();
 
@@ -51,33 +51,34 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
-  
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
+
 private:
   void                               Init();
   void                               enterEvent( QEvent* );
   void                               initSelection();
 
 private:
-  GEOM::GEOM_Object_var              myObject;
+  QList<GEOM::GeomObjPtr>            myObjects;
 
   DlgRef_1SelExt*                    GroupPoints;
   QCheckBox*                         myAllowNonManifoldChk;
   SalomeApp_DoubleSpinBox*           myTolEdt;
   QPushButton*                       myFreeBoundBtn;
-  
+
   int                                myClosed; // Number of free closed boundaries detected. Calculated in execute(), used in onDetect().
   int                                myOpen;   // Number of free open   boundaries detected. Calculated in execute(), used in onDetect().
-  
+
 private slots:
   void                               ClickOnOk();
   bool                               ClickOnApply();
-  
+
   void                               ActivateThisDialog();
-  
+
   void                               LineEditReturnPressed();
   void                               SelectionIntoArgument();
   void                               SetEditCurrentArgument();
-  
+
   void                               onDetect();
 };
 
index 926f1eb80514c853f3895b1baafab9dd4cc0fa09..71d3ce0f2cfc476c1eb4772ca4a10b106dff07b8 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include "RepairGUI_ShapeProcessDlg.h"
 
-#include <DlgRef.h>
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
-#include <GEOMImpl_Types.hxx>
+#include "DlgRef.h"
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+#include "GEOMImpl_Types.hxx"
+#include "RepairGUI.h"
 
 #include <SalomeApp_Application.h>
 #include <SalomeApp_DoubleSpinBox.h>
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_MessageBox.h>
 #include <SALOME_ListIO.hxx>
+#include "utilities.h"
 
 #include <Basics_Utils.hxx>
+#include "utilities.h"
 
 #include <TCollection_AsciiString.hxx>
 #include <TColStd_MapOfInteger.hxx>
@@ -82,33 +85,38 @@ void RepairGUI_ShapeProcessDlg::init()
   initParamsValues();
   initSelection();
         
-  setWindowTitle( tr( "GEOM_SHAPEPROCESS_TITLE" ) );
+  setWindowTitle( tr( "GEOM_SHAPEPROCESS_TITLE" ));
 
   mainFrame()->GroupConstructors->hide();
   
   // select widget on the top 
   mySelectWdgt = new DlgRef_1Sel( centralWidget() );
-  mySelectWdgt->GroupBox1->setTitle( tr( "GEOM_SHAPE" ) );
-  mySelectWdgt->TextLabel1->setText( tr( "GEOM_SELECTED_OBJECTS" ) );
-  mySelectWdgt->PushButton1->setIcon( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" ) ) );
+  mySelectWdgt->GroupBox1->setTitle( tr( "GEOM_SHAPE" ));
+  mySelectWdgt->TextLabel1->setText( tr( "GEOM_SELECTED_OBJECTS" ));
+  mySelectWdgt->PushButton1->setIcon( SUIT_Session::session()->resourceMgr()->loadPixmap( "GEOM", tr( "ICON_SELECT" )));
   mySelectWdgt->LineEdit1->setReadOnly( true );
 
   // layout the two group boxes in the middle, add a list of operations
   QGroupBox* anOperGr = new QGroupBox( tr( "GEOM_OPERATIONS" ), centralWidget() );
 
+  // "select all" button
+  mySelectAll = new QCheckBox( tr( "SELECT_ALL" ), anOperGr );
+  mySelectAll->setTristate( true );
+  
   // operations list widget
   myOpList = new QListWidget( anOperGr );
   myOpList->setSortingEnabled( false );
-  myOpList->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ) );
+  myOpList->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Expanding ));
 
   QVBoxLayout* aOperLay = new QVBoxLayout( anOperGr );
   aOperLay->setMargin( 9 );
+  aOperLay->addWidget( mySelectAll );
   aOperLay->addWidget( myOpList );
 
   QGroupBox* aParamsGr = new QGroupBox( tr( "GEOM_PARAMETERS" ), centralWidget() );
 
   // add a widget stack to the parameters group box
-  QStackedLayout* aStack = new QStackedLayout( aParamsGr );
+  myStack = new QStackedLayout( aParamsGr );
 
   // continueties values..
   QStringList aContinueties = QString( "C0,G1,C1,G2,C2,C3,CN" ).split( "," );
@@ -151,6 +159,32 @@ void RepairGUI_ShapeProcessDlg::init()
       aLay->addWidget( myFixFaceSizeTol, 0, 1 );
       aLay->setRowStretch( aLay->rowCount(), 5 );
     }
+    else if ( myOpLst[i] == "DropSmallSolids" ) {
+      // DropSmallSolids
+      w = new QWidget( aParamsGr );
+      QGridLayout* aLay = new QGridLayout( w );
+      aLay->setMargin( 9 ); aLay->setSpacing( 6 );
+
+      myDropSmallSolidsWidChk = new QCheckBox( tr("WIDTH_FACTOR_TOL"), w );
+      myDropSmallSolidsVolChk = new QCheckBox( tr("VOLUME_TOL"), w );
+      myDropSmallSolidsWidTol = new SalomeApp_DoubleSpinBox( w );
+      myDropSmallSolidsVolTol = new SalomeApp_DoubleSpinBox( w );
+      initSpinBox( myDropSmallSolidsWidTol, 0., 1e3, 1., "len_tol_precision" );
+      initSpinBox( myDropSmallSolidsVolTol, 0., 1e9, 1., "len_tol_precision" );
+      myDropSmallSolidsWidTol->setValue( 1 );
+      myDropSmallSolidsVolTol->setValue( 1e3 );
+      myDropSmallSolidsVolChk->setChecked( true );
+      myDropSmallSolidsWidTol->setEnabled( false );
+      myDropSmallSolidsMergeChk = new QCheckBox( tr("TO_MERGE_SOLIDS"), w );
+  
+      aLay->addWidget( myDropSmallSolidsWidChk, 0, 0 );
+      aLay->addWidget( myDropSmallSolidsWidTol, 0, 1 );
+      aLay->addWidget( myDropSmallSolidsVolChk, 1, 0 );
+      aLay->addWidget( myDropSmallSolidsVolTol, 1, 1 );
+      aLay->addWidget( myDropSmallSolidsMergeChk, 2, 0, 1, 2 );
+
+      aLay->setRowStretch( aLay->rowCount(), 5 );
+    }
     else if ( myOpLst[i] == "DropSmallEdges" ) {
       // DropSmallEdges
       w = new QWidget( aParamsGr );
@@ -232,6 +266,7 @@ void RepairGUI_ShapeProcessDlg::init()
 
       myBSplineDegree = new SalomeApp_IntSpinBox( w );
       myBSplineSegments = new SalomeApp_IntSpinBox( w );
+      initSpinBox( myBSplineSegments, 1, 1000, 1);      
       myBSpline2DCont = new QComboBox( w );
       myBSpline2DCont->addItems( aContinueties );
       myBSpline3DCont = new QComboBox( w );
@@ -294,7 +329,7 @@ void RepairGUI_ShapeProcessDlg::init()
     else {
       w = new QWidget( aParamsGr ); // dumb widget
     }
-    aStack->insertWidget( i, w );
+    myStack->insertWidget( i, w );
   }
 
   QGridLayout* layout = new QGridLayout( centralWidget() );
@@ -304,26 +339,33 @@ void RepairGUI_ShapeProcessDlg::init()
   layout->addWidget( aParamsGr,    1, 1 );
 
   // signals and slots connections
-  connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( onOk() ) );
-  connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( onApply() ) );
+  connect( buttonOk(),    SIGNAL( clicked() ), this, SLOT( onOk() ));
+  connect( buttonApply(), SIGNAL( clicked() ), this, SLOT( onApply() ));
 
-  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
-           SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );
+  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ))->selectionMgr(),
+           SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ));
 
-  connect( mySelectWdgt->PushButton1, SIGNAL( clicked() ),       this, SLOT( selectClicked() ) );
-  connect( mySelectWdgt->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( lineEditReturnPressed() ) );
+  connect( mySelectWdgt->PushButton1, SIGNAL( clicked() ),       this, SLOT( selectClicked() ));
+  connect( mySelectWdgt->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( lineEditReturnPressed() ));
 
-  connect( myToBezierSurfModeChk,     SIGNAL( toggled( bool ) ), this, SLOT( advOptionToggled( bool ) ) );
+  connect( myToBezierSurfModeChk,     SIGNAL( toggled( bool )), this, SLOT( advOptionToggled( bool )));
+  connect( myDropSmallSolidsWidChk,   SIGNAL( toggled( bool )), this, SLOT( advOptionToggled( bool )));
+  connect( myDropSmallSolidsVolChk,   SIGNAL( toggled( bool )), this, SLOT( advOptionToggled( bool )));
 
-  connect( myOpList, SIGNAL( currentRowChanged( int ) ), aStack, SLOT( setCurrentIndex( int ) ) );
+  connect( myOpList, SIGNAL( currentRowChanged( int )),      myStack, SLOT( setCurrentIndex( int )));
+  connect( myOpList, SIGNAL( itemChanged( QListWidgetItem* )),  this, SLOT( operatorChecked( QListWidgetItem* )));
+  connect( mySelectAll, SIGNAL( stateChanged( int ) ), this, SLOT( onSelectAll( int )));
 
   adjustSize();
   loadDefaults(); // init dialog fields with values from resource file
   //myOpList->setCurrentRow( myOpList->findItem( 0 );
   reset();
 
-  initName( tr( "PROCESS_SHAPE_NEW_OBJ_NAME" ) );
+  myOpList->setCurrentRow(0);
+
+  initName( tr( "PROCESS_SHAPE_NEW_OBJ_NAME" ));
   selectionChanged();
+  updateSelectAll();
 }
 
 //=================================================================================
@@ -372,14 +414,14 @@ void RepairGUI_ShapeProcessDlg::selectionChanged()
   myObjects->length(aSelList.Extent());
   for (SALOME_ListIteratorOfListIO anIt (aSelList); anIt.More(); anIt.Next()) {
     GEOM::GEOM_Object_var aSelectedObject = GEOMBase::ConvertIOinGEOMObject( anIt.Value() );
-    if ( !CORBA::is_nil( aSelectedObject ) )
+    if ( !CORBA::is_nil( aSelectedObject ))
       myObjects[i++] = aSelectedObject;
   }
   myObjects->length( i );
   if ( i == 1 )
-    mySelectWdgt->LineEdit1->setText( GEOMBase::GetName( myObjects[0] ) );
+    mySelectWdgt->LineEdit1->setText( GEOMBase::GetName( myObjects[0] ));
   else if ( i > 0 )
-    mySelectWdgt->LineEdit1->setText( QString::number( i ) + "_" + tr( "GEOM_OBJECTS" ) );
+    mySelectWdgt->LineEdit1->setText( QString::number( i ) + "_" + tr( "GEOM_OBJECTS" ));
 }
 
 
@@ -412,8 +454,8 @@ void RepairGUI_ShapeProcessDlg::lineEditReturnPressed()
 void RepairGUI_ShapeProcessDlg::activate()
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication( ) ))->selectionMgr(),
-           SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ) );
+  connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication( )))->selectionMgr(),
+           SIGNAL( currentSelectionChanged() ), this, SLOT( selectionChanged() ));
         
   reset();
   //myGeomGUI->SetState( 0 );
@@ -450,7 +492,7 @@ void RepairGUI_ShapeProcessDlg::reset()
 //=================================================================================
 const char* get_convert( const char* theParam, const QString& theValue )
 {
-  if ( !strcmp( theParam, "SplitAngle.Angle" ) ) {
+  if ( !strcmp( theParam, "SplitAngle.Angle" )) {
     double doubleValue = theValue.toDouble() * M_PI / 180.;
     return CORBA::string_dup( QString::number( doubleValue ).toLatin1().constData() );
   }
@@ -463,7 +505,7 @@ const char* get_convert( const char* theParam, const QString& theValue )
 //=================================================================================
 QString set_convert( const char* theParam, const char* theValue )
 {
-  if ( !strcmp( theParam, "SplitAngle.Angle" ) ) {
+  if ( !strcmp( theParam, "SplitAngle.Angle" )) {
     Kernel_Utils::Localizer loc;
     double doubleValue = atof( theValue ) * 180. / M_PI;
     return QString::number( doubleValue );
@@ -501,7 +543,7 @@ void RepairGUI_ShapeProcessDlg::loadDefaults()
 
     for ( int j = 0; j < aParams->length(); j++ ) {
       QWidget* aCtrl = getControl( (const char*)aParams[j] );
-      setValue( aCtrl, set_convert( (const char*)aParams[j], aValues[j] ) );
+      setValue( aCtrl, set_convert( (const char*)aParams[j], aValues[j] ));
     }
   }
 }
@@ -513,13 +555,13 @@ void RepairGUI_ShapeProcessDlg::loadDefaults()
 void RepairGUI_ShapeProcessDlg::setValue( QWidget* theControl, const QString& theValue )
 {
   if ( theControl && !theValue.isNull() ) {
-    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
+    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ))
       qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->setValue( theValue.toDouble() );
-    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
+    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ))
       qobject_cast<SalomeApp_IntSpinBox*>( theControl )->setValue( theValue.toInt() );
-    else if ( qobject_cast<QComboBox*>( theControl ) )
+    else if ( qobject_cast<QComboBox*>( theControl ))
       qobject_cast<QComboBox*>( theControl )->setEditText( theValue );
-    else if ( qobject_cast<QCheckBox*>( theControl ) )
+    else if ( qobject_cast<QCheckBox*>( theControl ))
       qobject_cast<QCheckBox*>( theControl )->setChecked( theValue.toInt() != 0 );
   }
 }
@@ -531,14 +573,23 @@ void RepairGUI_ShapeProcessDlg::setValue( QWidget* theControl, const QString& th
 QString RepairGUI_ShapeProcessDlg::getValue( QWidget* theControl ) const
 {
   if ( theControl ) {
-    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
+    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )) {
+      if ( ( theControl == myDropSmallSolidsWidTol || theControl == myDropSmallSolidsVolTol ) && !theControl->isEnabled() ) {
+        // VSR: stupid workaround about ShapeProcessAPI:
+        // specific processing for optional parameters of DropSmallSolids operator
+        return QString::number( Precision::Infinite() );
+      }
       return QString::number( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->value() );
-    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
+    }
+    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl )) {
       return QString::number( qobject_cast<SalomeApp_IntSpinBox*>( theControl )->value() );
-    else if ( qobject_cast<QComboBox*>( theControl ) )
+    }
+    else if ( qobject_cast<QComboBox*>( theControl )) {
       return qobject_cast<QComboBox*>( theControl )->currentText();
-    else if ( qobject_cast<QCheckBox*>( theControl ) )
+    }
+    else if ( qobject_cast<QCheckBox*>( theControl )) {
       return qobject_cast<QCheckBox*>( theControl )->isChecked() ? "1" : "0";
+    }
   }   
   return 0;
 }
@@ -550,9 +601,9 @@ QString RepairGUI_ShapeProcessDlg::getValue( QWidget* theControl ) const
 QString RepairGUI_ShapeProcessDlg::getText( QWidget* theControl ) const
 {
   if ( theControl ) {
-    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ) )
+    if ( qobject_cast<SalomeApp_DoubleSpinBox*>( theControl ))
       return qobject_cast<SalomeApp_DoubleSpinBox*>( theControl )->text();
-    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ) )
+    else if ( qobject_cast<SalomeApp_IntSpinBox*>( theControl ))
       return qobject_cast<SalomeApp_IntSpinBox*>( theControl )->text();
   }   
   return QString::null;
@@ -582,9 +633,10 @@ bool RepairGUI_ShapeProcessDlg::isValid( QString& msg )
     while( aListIter.hasNext() ) {
       const QString& aParam = aListIter.next();
       QWidget* aControl = getControl( aParam );
-      if ( qobject_cast<SalomeApp_DoubleSpinBox*>( aControl ) )
+      if ( !aControl->isEnabled() ) continue;
+      if ( qobject_cast<SalomeApp_DoubleSpinBox*>( aControl ))
         ok = qobject_cast<SalomeApp_DoubleSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
-      else if ( qobject_cast<SalomeApp_IntSpinBox*>( aControl ) )
+      else if ( qobject_cast<SalomeApp_IntSpinBox*>( aControl ))
         ok = qobject_cast<SalomeApp_IntSpinBox*>( aControl )->isValid( msg, !IsPreview() ) && ok;
     }
   }
@@ -652,6 +704,8 @@ bool RepairGUI_ShapeProcessDlg::execute( ObjectList& objects )
 
         aParameters << getTexts( aParams );
         anObj->SetParameters(aParameters.join(":").toLatin1().constData());
+
+        RepairGUI::ShowStatistics( anOper, this );
       }
       objects.push_back( anObj._retn() );
     }
@@ -670,17 +724,14 @@ bool RepairGUI_ShapeProcessDlg::execute( ObjectList& objects )
 GEOM::string_array* RepairGUI_ShapeProcessDlg::getActiveOperators()
 {
   GEOM::string_array_var anOperators = new GEOM::string_array();
-  QStringList aCheckedList;
 
-  for ( int i = 0; i < myOpList->count(); i++ ) {
+  int j = 0, n = myOpList->count();
+  anOperators->length( n );
+  for ( int i = 0; i < n; i++ ) {
     if ( myOpList->item( i )->checkState() == Qt::Checked )
-      aCheckedList << myOpList->item( i )->text();
+      anOperators[j++] = myOpList->item( i )->text().toLatin1().constData();
   }
-
-  anOperators->length( aCheckedList.count() );
-
-  for ( int i = 0; i < aCheckedList.count(); i++ )
-    anOperators[i] = aCheckedList[i].toLatin1().constData();
+  anOperators->length( j );
 
   return anOperators._retn();
 }
@@ -696,6 +747,9 @@ QWidget* RepairGUI_ShapeProcessDlg::getControl( const QString& theParam )
   else if ( theParam == "SplitClosedFaces.NbSplitPoints" )        return mySplitClosedFacesNum;
   else if ( theParam == "FixFaceSize.Tolerance" )                 return myFixFaceSizeTol;
   else if ( theParam == "DropSmallEdges.Tolerance3d" )            return myDropSmallEdgesTol3D;
+  else if ( theParam == "DropSmallSolids.WidthFactorThreshold" )  return myDropSmallSolidsWidTol;
+  else if ( theParam == "DropSmallSolids.VolumeThreshold" )       return myDropSmallSolidsVolTol;
+  else if ( theParam == "DropSmallSolids.MergeSolids" )           return myDropSmallSolidsMergeChk;
   else if ( theParam == "BSplineRestriction.SurfaceMode" )        return myBSplineSurfModeChk;
   else if ( theParam == "BSplineRestriction.Curve3dMode" )        return myBSpline3DCurveChk;
   else if ( theParam == "BSplineRestriction.Curve2dMode" )        return myBSpline2DCurveChk;
@@ -737,6 +791,11 @@ void RepairGUI_ShapeProcessDlg::initParamsValues()
   myOpLst << "DropSmallEdges";
   myValMap["DropSmallEdges"] << "DropSmallEdges.Tolerance3d";
 
+  myOpLst << "DropSmallSolids";
+  myValMap["DropSmallSolids"] << "DropSmallSolids.WidthFactorThreshold";
+  myValMap["DropSmallSolids"] << "DropSmallSolids.VolumeThreshold";
+  myValMap["DropSmallSolids"] << "DropSmallSolids.MergeSolids";
+
   myOpLst << "SplitAngle";
   myValMap["SplitAngle"] << "SplitAngle.Angle";
   myValMap["SplitAngle"] << "SplitAngle.MaxTolerance";
@@ -781,18 +840,21 @@ GEOM::string_array* RepairGUI_ShapeProcessDlg::getParameters( const GEOM::string
 
   // calculate the length of parameters
   for ( i = 0, j = 0; i < theOperators.length(); i++ )
-    j += myValMap[ QString( theOperators[i] ) ].size();
+    j += myValMap[ QString( theOperators[i].in() ) ].size();
   
   // set the new length of paremeters
   aParams->length( j );
 
   // fill the parameters
   for ( i = 0, j = 0; i < theOperators.length(); i++ ) {
-    QStringList aValLst = myValMap[ QString( theOperators[i] ) ];
-    for ( QStringList::Iterator it = aValLst.begin(); it != aValLst.end(); ++it )
-      aParams[j++] = CORBA::string_dup( (*it).toLatin1().constData() );
+    QStringList aParamLst = myValMap[ QString( theOperators[i].in() ) ];
+    foreach ( QString aParam, aParamLst ) {
+      aParams[j++] = CORBA::string_dup( aParam.toLatin1().constData() );
+    }
   }
 
+  aParams->length( j );
+
   return aParams._retn();
 }
 
@@ -805,13 +867,13 @@ GEOM::string_array* RepairGUI_ShapeProcessDlg::getValues( const GEOM::string_arr
 {
   GEOM::string_array_var aValues = new GEOM::string_array();
   aValues->length( theParams.length() );
-    
+
   for ( int i = 0; i < theParams.length(); i++ ) {
     QWidget* aCtrl = getControl( (const char*)theParams[i] );
     if ( aCtrl )
-      aValues[i] = get_convert( (const char*)theParams[i], getValue( aCtrl ) );
+      aValues[i] = get_convert( (const char*)theParams[i], getValue( aCtrl ));
   }
-    
+
   return aValues._retn();
 }
 
@@ -860,9 +922,87 @@ void RepairGUI_ShapeProcessDlg::initSelection()
 void RepairGUI_ShapeProcessDlg::advOptionToggled( bool on )
 {
   QAbstractButton* btn = (QAbstractButton*)sender();
-  if ( on && btn->isCheckable() &&
-       SUIT_MessageBox::warning( this,
-                                 tr( "GEOM_WRN_WARNING" ), tr( "TIME_CONSUMING" ),
-                                 SUIT_MessageBox::Yes | SUIT_MessageBox::No ) == SUIT_MessageBox::No )
-    btn->toggle();
+  if ( btn == myToBezierSurfModeChk )
+  {
+    if ( on && btn->isCheckable() &&
+         SUIT_MessageBox::warning( this,
+                                   tr( "GEOM_WRN_WARNING" ), tr( "TIME_CONSUMING" ),
+                                   SUIT_MessageBox::Yes | SUIT_MessageBox::No ) == SUIT_MessageBox::No )
+      btn->toggle();
+  }
+
+  // either myDropSmallSolidsWidChk or myDropSmallSolidsVolChk must be checked
+  if ( btn == myDropSmallSolidsWidChk )
+  {
+    myDropSmallSolidsWidTol->setEnabled( on );
+    if ( !on ) {
+      myDropSmallSolidsVolChk->setChecked( true );
+      myDropSmallSolidsVolTol->setEnabled( true );
+    }
+  }
+  if ( btn == myDropSmallSolidsVolChk )
+  {
+    myDropSmallSolidsVolTol->setEnabled( on );
+    if ( !on ) {
+      myDropSmallSolidsWidChk->setChecked( true );
+      myDropSmallSolidsWidTol->setEnabled( true );
+    }
+  }
+}
+
+//=======================================================================
+//function : operatorChecked
+//purpose  : show parameters of a selected operator
+//=======================================================================
+
+void RepairGUI_ShapeProcessDlg::operatorChecked( QListWidgetItem * item )
+{
+  if ( item && item->checkState() == Qt::Checked )
+  {
+    item->setSelected(true);
+    myStack->setCurrentIndex( myOpList->row( item ));
+  }
+  updateSelectAll();
+}
+
+void RepairGUI_ShapeProcessDlg::updateSelectAll()
+{
+  Qt::CheckState state = myOpList->count() > 0 ? myOpList->item(0)->checkState() : Qt::Unchecked;
+  for ( int i = 1; i < myOpList->count(); i++ ) {
+    if ( myOpList->item(i)->checkState() != state ) {
+      state = Qt::PartiallyChecked;
+      break;
+    }
+  }
+  mySelectAll->blockSignals( true );
+  mySelectAll->setCheckState( state );
+  mySelectAll->blockSignals( false );
+}
+
+void RepairGUI_ShapeProcessDlg::onSelectAll( int state )
+{
+  if ( state == Qt::PartiallyChecked ) { 
+    mySelectAll->setCheckState( Qt::Checked );
+    return;
+  }
+  myOpList->blockSignals( true );
+  for ( int i = 0; i < myOpList->count(); i++ ) {
+    myOpList->item(i)->setCheckState( (Qt::CheckState)state  );
+  }
+  myOpList->blockSignals( false );
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_ShapeProcessDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::ListOfGO aListPtr(myObjects);
+  for (int i = 0; i < aListPtr.length(); i++) {
+    GEOM::GeomObjPtr aGeomObjPtr(aListPtr[i]);
+    res << aGeomObjPtr;
+  }
+  return res;
 }
index 4a6480220edf7b37b06093d9be699eeeb8d963b7..7c0409561de5f6596c49e1b5b1a6897e3ea7ba4d 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 class DlgRef_1Sel;
 class SalomeApp_IntSpinBox;
 class SalomeApp_DoubleSpinBox;
-class QComboBox;
 class QCheckBox;
+class QComboBox;
 class QListWidget;
+class QListWidgetItem;
+class QStackedLayout;
 
 //=================================================================================
 // class    : RepairGUI_ShapeProcessDlg
@@ -55,6 +57,7 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList&  );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
   
 private:
   void                               init();
@@ -78,6 +81,7 @@ private:
   //QDict<QString,QWidget*>            myCtrlMap;  // map of controls (values) of parameters
   void                               initParamsValues(); // initialize the data structures
   void                               initSelection();
+  void                               updateSelectAll();
 
 private:
   QStringList                        myOpLst; // list of available Shape Healing Operators
@@ -86,7 +90,9 @@ private:
   GEOM::ListOfGO_var                 myObjects;  // selected objects
   
   DlgRef_1Sel*                       mySelectWdgt;
+  QCheckBox*                         mySelectAll;
   QListWidget*                       myOpList;
+  QStackedLayout*                    myStack;
   
   SalomeApp_DoubleSpinBox*           myFixShapeTol3D;
   SalomeApp_DoubleSpinBox*           myFixShapeMaxTol3D;
@@ -120,7 +126,13 @@ private:
   SalomeApp_DoubleSpinBox*           myToBezierMaxTol;
   
   SalomeApp_DoubleSpinBox*           mySameParameterTol3D;
-  
+
+  QCheckBox*                         myDropSmallSolidsWidChk;
+  QCheckBox*                         myDropSmallSolidsVolChk;
+  SalomeApp_DoubleSpinBox*           myDropSmallSolidsWidTol;
+  SalomeApp_DoubleSpinBox*           myDropSmallSolidsVolTol;
+  QCheckBox*                         myDropSmallSolidsMergeChk;
+
 private slots:
   void                               onOk();
   bool                               onApply();
@@ -131,6 +143,8 @@ private slots:
   void                               selectionChanged();
   void                               selectClicked();
   void                               advOptionToggled( bool );
-};             
+  void                               operatorChecked( QListWidgetItem * item );
+  void                               onSelectAll( int );
+};
 
 #endif // REPAIRGUI_SHAPEPROCESSDLG_H
index 43a0f629eba0ceea275b69078972bc432345d1a7..4326405d3afab7085d35b28e69a48d82f599116a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include "RepairGUI_SuppressFacesDlg.h"
 
-#include <DlgRef.h>
-#include <GeometryGUI.h>
-#include <GEOMBase.h>
+#include "DlgRef.h"
+#include "GeometryGUI.h"
+#include "GEOMBase.h"
+#include "RepairGUI.h"
 
 #include <SUIT_Session.h>
 #include <SUIT_ResourceMgr.h>
@@ -376,8 +377,11 @@ bool RepairGUI_SuppressFacesDlg::execute (ObjectList& objects)
 
   bool aResult = !anObj->_is_nil();
   if (aResult)
+  {
+    if ( !IsPreview() )
+      RepairGUI::ShowStatistics( anOper, this );
     objects.push_back(anObj._retn());
-
+  }
   return aResult;
 }
 
@@ -421,3 +425,15 @@ void RepairGUI_SuppressFacesDlg::restoreSubShapes (SALOMEDS::Study_ptr   theStud
                                         mainFrame()->CheckBoxAddPrefix->isChecked());
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_SuppressFacesDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObject);
+  res << aGeomObjPtr;
+  return res;
+}
index d0fdbef5dced561cecb7e32db1ffca3b323d52a5..e2a494c20a54a2eb8063dfc72627e5c4c2ffa9f0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 16c6970193c9e1737e5d8d8b644a94799c2831c5..96abd26860c6419d30a8f5094a420d58008b6893 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -305,3 +305,15 @@ void RepairGUI_UnionFacesDlg::restoreSubShapes( SALOMEDS::Study_ptr   theStudy,
                                          mainFrame()->CheckBoxAddPrefix->isChecked() );
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> RepairGUI_UnionFacesDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  GEOM::GeomObjPtr aGeomObjPtr(myObject);
+  res << aGeomObjPtr;
+  return res;
+}
index 3290ae3b97cd85889670d7bb20c1693368452561..e45ad5ef8dbfa05291a0db3293a127a257a3673c 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -46,6 +46,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );    
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index ef7e8748005e966c6d7dc52dd57c5700e7ab1ec7..d1ccbd22d214f648a97dfd6cb31ca102cdb45a8e 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 09602cee5b3444a19e8871548b6e76f407290751..e20acdc045846292301a1bd8f4b2be31f23d68fc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1237bfd45602ba4fec4518a943d8fe5587b679d1..6eb31d713184c99a62b282ec86360980c196a208 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 8d36b639b20442dc9282bc1f4fd6e045144b7e79..6c37bdcc7f65eea07e7d95d64fe5452b4e9b0656 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 725a985cf08af16edeff0754d21a1a2c89bab2aa..351de0b98c9cd4e78a96544e139eb7a9549b8398 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -32,7 +32,9 @@
 #include <BRepBuilderAPI_MakeWire.hxx>
 #include <ElSLib.hxx>
 #include <GeomAPI_Interpolate.hxx>
+#include <TColgp_Array1OfVec.hxx>
 #include <TColgp_HArray1OfPnt.hxx>
+#include <TColStd_HArray1OfBoolean.hxx>
 #include <TopoDS_Wire.hxx>
 
 const double POINT_CONFUSION_TOLERANCE = 0.0001;
@@ -98,57 +100,134 @@ TopoDS_Shape Sketcher_Utils::MakePolyline
 }
 
 //=======================================================================
-// function : MakeInterpolation
-// purpose  : 
+// function : constructBSpline
+// purpose  : See function 'constructBSpline' in file 'CurveCreator_Utils.cxx'.
 //=======================================================================
-TopoDS_Shape Sketcher_Utils::MakeInterpolation
-                              (const std::list <double> &theCoords2D,
-                               const Standard_Boolean    IsClosed,
-                               const gp_Ax3             &thePlane)
+static bool constructBSpline(
+  const Handle(TColgp_HArray1OfPnt)& thePoints,
+  const Standard_Boolean theIsClosed,
+  Handle(Geom_BSplineCurve)& theBSpline)
 {
-  std::list <gp_Pnt> aPoints;
-  TopoDS_Shape       aResult;
-
-  To3D(theCoords2D, thePlane, aPoints);
-
-  Standard_Integer aNbPnts = aPoints.size();
-
-  if (aNbPnts > 1) {
-    if (IsClosed &&
-        aPoints.front().IsEqual(aPoints.back(), POINT_CONFUSION_TOLERANCE)) {
-      // The polyline should be closed, first and last points are confused.
-      // Remove the last point.
-      aPoints.pop_back();
-      --aNbPnts;
-    }
+  const int aPointCount = thePoints->Length();
+  if (aPointCount <= 1)
+  {
+    return false;
   }
 
-  if (aNbPnts == 1) {
-    // The result is vertex.
-    aResult = BRepBuilderAPI_MakeVertex(aPoints.front()).Vertex();
-  } else if (aNbPnts > 1) {
-    std::list <gp_Pnt>::const_iterator anIter        = aPoints.begin();
-    Handle(TColgp_HArray1OfPnt)        aHCurvePoints =
-      new TColgp_HArray1OfPnt(1, aNbPnts);
-    Standard_Integer                   i;
-
-    for (i = 1; anIter != aPoints.end(); ++anIter, ++i) {
-      aHCurvePoints->SetValue(i, *anIter);
+  // Calculate the tangents.
+  TColgp_Array1OfVec aTangents(1, aPointCount);
+  Handle(TColStd_HArray1OfBoolean) aTangentFlags =
+    new TColStd_HArray1OfBoolean(1, aPointCount);
+  GeomAPI_Interpolate aInterpolator(thePoints, theIsClosed, 0);
+  if (aPointCount == 2)
+  {
+    aTangentFlags->SetValue(1, Standard_False);
+    aTangentFlags->SetValue(2, Standard_False);
+  }
+  else
+  {
+    for (Standard_Integer aPN = 1; aPN <= aPointCount; ++aPN)
+    {
+      gp_Vec aTangent;
+      if (aPN != 1 || theIsClosed)
+      {
+        const Standard_Integer aPN1 = (aPN != 1) ? (aPN - 1) : aPointCount;
+        aTangent = gp_Vec(thePoints->Value(aPN1),
+          thePoints->Value(aPN)).Normalized();
+      }
+      if (aPN < aPointCount || theIsClosed)
+      {
+        const Standard_Integer aPN2 = (aPN != aPointCount) ? (aPN + 1) : 1;
+        const gp_Vec aTangent2 = aTangent +
+          gp_Vec(thePoints->Value(aPN), thePoints->Value(aPN2)).Normalized();
+        if (aTangent2.SquareMagnitude() >= Precision::SquareConfusion())
+        {
+          aTangent = aTangent2.Normalized();
+        }
+        else
+        {
+          aTangent = -aTangent;
+        }
+      }
+      aTangents.SetValue(aPN, aTangent);
+      aTangentFlags->SetValue(aPN, Standard_True);
     }
+  }
 
-    // Compute BSpline
-    Standard_Real       aTol = Precision::Confusion();
-    GeomAPI_Interpolate aGBC(aHCurvePoints, IsClosed, aTol);
+  // Interpolate.
+  aInterpolator.Load(aTangents, aTangentFlags, Standard_False);
+  aInterpolator.Perform();
+  const bool aResult = (aInterpolator.IsDone() == Standard_True);
+  if (aResult)
+  {
+    theBSpline = aInterpolator.Curve();
+  }
+  return aResult;
+}
 
-    aGBC.Perform();
+//=======================================================================
+// function : MakeInterpolation
+// purpose  : 
+//=======================================================================
+TopoDS_Shape Sketcher_Utils::MakeInterpolation(
+  const std::list<double>& theCoords2D,
+  const Standard_Boolean theIsClosed,
+  const gp_Ax3& thePlane)
+{
+  if (theCoords2D.size() == 0)
+  {
+    return TopoDS_Shape();
+  }
 
-    if (aGBC.IsDone()) {
-      TopoDS_Edge anEdge = BRepBuilderAPI_MakeEdge(aGBC.Curve()).Edge();
-      aResult = BRepBuilderAPI_MakeWire(anEdge).Wire();
+  // Get the different points.
+  std::list<gp_Pnt> aTmpPoints;
+  To3D(theCoords2D, thePlane, aTmpPoints);
+  gp_Pnt aFirstPoint = aTmpPoints.front();
+  gp_Pnt aPoint = aFirstPoint;
+  std::list<gp_Pnt>::iterator aPIt = aTmpPoints.begin();
+  for (++aPIt; aPIt != aTmpPoints.end();)
+  {
+    const gp_Pnt aPoint2 = *aPIt;
+    if (!aPoint.IsEqual(aPoint2, POINT_CONFUSION_TOLERANCE))
+    {
+      aPoint = aPoint2;
+      ++aPIt;
+    }
+    else
+    {
+      aTmpPoints.erase(aPIt);
+    }
+  }
+  if (theIsClosed)
+  {
+    while (--aPIt != aTmpPoints.begin() &&
+      aFirstPoint.IsEqual(*aPIt, POINT_CONFUSION_TOLERANCE))
+    {
+      aTmpPoints.erase(aPIt);
     }
   }
 
-  return aResult;
+  // Process the single point case.
+  const int aPointCount = aTmpPoints.size();
+  if (aPointCount == 1)
+  {
+    return BRepBuilderAPI_MakeVertex(aTmpPoints.front());
+  }
+
+  // Process the other cases.
+  Handle(TColgp_HArray1OfPnt) aPoints =
+    new TColgp_HArray1OfPnt(1, aPointCount);
+  aPIt = aTmpPoints.begin();
+  for (Standard_Integer aPN = 1; aPIt != aTmpPoints.end(); ++aPIt, ++aPN)
+  {
+    aPoints->SetValue(aPN, *aPIt);
+  }
+  Handle(Geom_BSplineCurve) aBSpline;
+  if (constructBSpline(aPoints, theIsClosed, aBSpline))
+  {
+    return BRepBuilderAPI_MakeWire(BRepBuilderAPI_MakeEdge(aBSpline));
+  }
+  return TopoDS_Shape();
 }
 
 //=======================================================================
index 75360111d4d294b8aeadbc7e28e2da09d307c3b2..381e3798e58e715800b60a1c28ac6623ddaa3efb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 4d4db727c9f933a741f2d829adb5c068af243402..52d210920ba3c99563119c727f7385448699c791 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -95,6 +95,7 @@ SET(STEPPluginEngine_HEADERS
   STEPPlugin_IExport.hxx 
   STEPPlugin_IImport.hxx
   STEPPlugin_ImportDriver.hxx 
+  STEPPlugin_ExportDlg.h
   STEPPlugin_ExportDriver.hxx
   STEPPlugin_IECallBack.hxx
   )
@@ -103,6 +104,7 @@ IF(SALOME_BUILD_GUI)
   # header files / to be processed by moc
   SET(_moc_HEADERS
     STEPPlugin_GUI.h
+    STEPPlugin_ExportDlg.h
     )
 ENDIF()
 
@@ -114,6 +116,7 @@ IF(SALOME_BUILD_GUI)
 
   SET(STEPPluginGUI_SOURCES
     STEPPlugin_GUI.cxx
+    STEPPlugin_ExportDlg.cxx
     ${_moc_SOURCES}
     )
 ENDIF()
index c1718744a266049101659ad86e497fd0f8eb11b4..22d1b0d172a69bae5ef0e5d58fd84243100c45c0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 624eb221012a108d909827bad7939d46782792c6..ad46c97c3357dd573c1cd10f1673570a53bca381 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
diff --git a/src/STEPPlugin/STEPPlugin_ExportDlg.cxx b/src/STEPPlugin/STEPPlugin_ExportDlg.cxx
new file mode 100644 (file)
index 0000000..2f8124b
--- /dev/null
@@ -0,0 +1,109 @@
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 "STEPPlugin_ExportDlg.h"
+
+#include <QApplication>
+#include <QLabel>
+#include <QLayout>
+#include <QComboBox>
+
+//=============================================================================
+// Constructor
+//=============================================================================
+STEPPlugin_ExportDlg::STEPPlugin_ExportDlg(QWidget *parent)
+  : SUIT_FileDlg (parent, false, true, true),
+    myUnitCB     (0)
+{
+  QLabel* aUnitLabel = new QLabel(tr("STEP_LENGTH_UNITS"), this);
+
+  myUnitCB = new QComboBox(this);
+  myUnitCB->addItem(tr("STEP_UNITS_KILOMETER"),  GEOM::LU_KILOMETER);
+  myUnitCB->addItem(tr("STEP_UNITS_METER"),      GEOM::LU_METER);
+  myUnitCB->addItem(tr("STEP_UNITS_CENTIMETER"), GEOM::LU_CENTIMETER);
+  myUnitCB->addItem(tr("STEP_UNITS_MILLIMETER"), GEOM::LU_MILLIMETER);
+  myUnitCB->addItem(tr("STEP_UNITS_MICROMETER"), GEOM::LU_MICROMETER);
+  myUnitCB->addItem(tr("STEP_UNITS_MILE"),       GEOM::LU_MILE);
+  myUnitCB->addItem(tr("STEP_UNITS_FOOT"),       GEOM::LU_FOOT);
+  myUnitCB->addItem(tr("STEP_UNITS_INCH"),       GEOM::LU_INCH);
+  myUnitCB->addItem(tr("STEP_UNITS_MILLIINCH"),  GEOM::LU_MILLIINCH);
+  myUnitCB->addItem(tr("STEP_UNITS_MICROINCH"),  GEOM::LU_MICROINCH);
+
+  // Meters by default.
+  myUnitCB->setCurrentIndex(1);
+
+  layout()->addWidget(aUnitLabel);
+  layout()->addWidget(myUnitCB);
+}
+
+//=============================================================================
+// Destructor
+//=============================================================================
+STEPPlugin_ExportDlg::~STEPPlugin_ExportDlg()
+{
+}
+
+//=============================================================================
+// getUnits
+//=============================================================================
+GEOM::length_unit STEPPlugin_ExportDlg::getUnits() const
+{
+  const GEOM::length_unit anUnit =
+    (GEOM::length_unit) myUnitCB->itemData(myUnitCB->currentIndex()).toInt();
+
+  return anUnit;
+}
+
+//=============================================================================
+// getFileName
+//=============================================================================
+QString STEPPlugin_ExportDlg::getFileName(const QString           &theInitial,
+                                          const QString           &theFilters,
+                                                     const QString           &theCaption,
+                                                QWidget           *theParent,
+                                                GEOM::length_unit &theUnits)
+{
+  QStringList aFls         = theFilters.split(";;", QString::SkipEmptyParts);
+  QString     aTmpFileName = theInitial;
+
+  aTmpFileName = aTmpFileName.simplified();
+  aTmpFileName =
+    aTmpFileName.replace(QRegExp("\\*"), "").replace(QRegExp("\\?"), "");
+
+  STEPPlugin_ExportDlg aDlg(theParent);
+
+  aDlg.setFileMode(AnyFile);
+  aDlg.setFilters(aFls);
+  aDlg.setWindowTitle(theCaption);
+
+  if (!aTmpFileName.isEmpty()) {
+    aDlg.processPath(aTmpFileName);
+  }
+
+  QString aFileName;
+
+  if (aDlg.exec() == QDialog::Accepted) {
+    aFileName = aDlg.selectedFile();
+    theUnits  = aDlg.getUnits();
+  }
+
+  QApplication::processEvents();
+
+  return aFileName;
+}
diff --git a/src/STEPPlugin/STEPPlugin_ExportDlg.h b/src/STEPPlugin/STEPPlugin_ExportDlg.h
new file mode 100644 (file)
index 0000000..d310484
--- /dev/null
@@ -0,0 +1,52 @@
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// 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 STEPPlugin_ExportDlg_H
+#define STEPPlugin_ExportDlg_H
+
+#include <SUIT_FileDlg.h>
+#include <SALOMEconfig.h>
+#include CORBA_CLIENT_HEADER(STEPPlugin)
+
+class QComboBox;
+
+class STEPPlugin_ExportDlg: public SUIT_FileDlg
+{
+  Q_OBJECT
+
+public:
+
+  STEPPlugin_ExportDlg(QWidget *parent);
+  ~STEPPlugin_ExportDlg();
+
+  GEOM::length_unit getUnits() const;
+
+  static QString getFileName(const QString           &theInitial,
+                             const QString           &theFilters,
+                                        const QString           &theCaption,
+                                   QWidget           *theParent,
+                                   GEOM::length_unit &theUnits);
+
+private:
+
+  QComboBox *myUnitCB;
+
+};
+
+#endif // STEPPlugin_ExportDlg_H
index ba35ffbe35a8529411c6bce7abbe6e365a68c116..0adef6012efb030daa63b2be55395a85e2a01b17 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -20,6 +20,7 @@
 // internal includes
 #include "STEPPlugin_ExportDriver.hxx"
 #include "STEPPlugin_IExport.hxx"
+#include "STEPPlugin_IOperations.hxx"
 
 // KERNEL includes
 #include <utilities.h>
@@ -74,6 +75,43 @@ Standard_Integer STEPPlugin_ExportDriver::Execute( TFunction_Logbook& log ) cons
   aFunction->SetValue( aShape );
 
   TCollection_AsciiString aFileName = aData.GetFileName();
+  Standard_Integer        anUnit    = aData.GetUnit();
+  TCollection_AsciiString aWriteUnit;
+
+  switch (anUnit) {
+  case STEPPlugin_IOperations::LengthUnit_Inch:
+    aWriteUnit = "INCH";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Millimeter:
+    aWriteUnit = "MM";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Foot:
+    aWriteUnit = "FT";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Mile:
+    aWriteUnit = "MI";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Meter:
+    aWriteUnit = "M";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Kilometer:
+    aWriteUnit = "KM";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Milliinch:
+    aWriteUnit = "MIL";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Micrometer:
+    aWriteUnit = "UM";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Centimeter:
+    aWriteUnit = "CM";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Microinch:
+    aWriteUnit = "UIN";
+    break;
+  default:
+    return 0;
+  }
 
   MESSAGE("Export STEP into file " << aFileName.ToCString());
 
@@ -86,7 +124,7 @@ Standard_Integer STEPPlugin_ExportDriver::Execute( TFunction_Logbook& log ) cons
     //VRV: OCC 4.0 migration
     STEPControl_Writer aWriter;
     Interface_Static::SetCVal("xstep.cascade.unit","M");
-    Interface_Static::SetCVal("write.step.unit", "M");
+    Interface_Static::SetCVal("write.step.unit", aWriteUnit.ToCString());
     Interface_Static::SetIVal("write.step.nonmanifold", 1);
     status = aWriter.Transfer( aShape, STEPControl_AsIs );
     //VRV: OCC 4.0 migration
index bf2acb8739aca82567737941da30f2dd058e5e35..0c6db5162782d13466e6d86144adbbf65cabed27 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 66ebd4cc3c6a3b1c68e081d931ae4c8e0da4a1d9..5543266d7845b41240aee421f25afd0948132210 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include "GEOM_Operation.h"
 #include "GEOMBase.h"
 #include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
+#include "STEPPlugin_ExportDlg.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(STEPPlugin)
 
+typedef GEOM::GenericObjPtr<GEOM::ISTEPOperations> STEPOpPtr;
+
 //=======================================================================
 // function : STEPPlugin_GUI()
 // purpose  : Constructor
@@ -111,8 +115,8 @@ bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STEPPluginEngine" );
-  GEOM::ISTEPOperations_var stepOp = GEOM::ISTEPOperations::_narrow( op );
-  if ( CORBA::is_nil( stepOp ) ) return false;
+  STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op );
+  if ( stepOp.isNull() ) return false;
 
   QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
                                                 tr( "STEP_FILES" ),
@@ -128,7 +132,7 @@ bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent )
     {
       QString fileName = fileNames.at( i );
       SUIT_OverrideCursor wc;
-      GEOM_Operation transaction( app, stepOp.in() );
+      GEOM_Operation transaction( app, stepOp.get() );
       bool ignoreUnits = false;
       
       try
@@ -189,6 +193,7 @@ bool STEPPlugin_GUI::importSTEP( SUIT_Desktop* parent )
          }
          transaction.commit();
          GEOM_Displayer( study ).Display( main.in() );
+          main->UnRegister();
        }
        else
        {
@@ -228,8 +233,8 @@ bool STEPPlugin_GUI::exportSTEP( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STEPPluginEngine" );
-  GEOM::ISTEPOperations_var stepOp = GEOM::ISTEPOperations::_narrow( op );
-  if ( CORBA::is_nil( stepOp ) ) return false;
+  STEPOpPtr stepOp = GEOM::ISTEPOperations::_narrow( op );
+  if ( stepOp.isNull() ) return false;
 
   LightApp_SelectionMgr* sm = app->selectionMgr();
   if ( !sm ) return false;
@@ -246,25 +251,26 @@ bool STEPPlugin_GUI::exportSTEP( SUIT_Desktop* parent )
     
     if ( CORBA::is_nil( obj ) ) continue;
     
-    QString fileName = app->getFileName( false,
-                                        QString( io->getName() ),
+    GEOM::length_unit anUnit;
+    QString fileName = STEPPlugin_ExportDlg::getFileName
+                                       (QString( io->getName() ),
                                         tr( "STEP_FILES" ),
                                         tr( "EXPORT_TITLE" ),
-                                        parent );
+                                        parent, anUnit);
     
     if ( fileName.isEmpty() )
       return false;
     
     SUIT_OverrideCursor wc;
     
-    GEOM_Operation transaction( app, stepOp.in() );
+    GEOM_Operation transaction( app, stepOp.get() );
     
     try
     {
       app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
       transaction.start();
       
-      stepOp->ExportSTEP( obj, fileName.toUtf8().constData() );
+      stepOp->ExportSTEP( obj, fileName.toUtf8().constData(), anUnit);
       
       if ( stepOp->IsDone() )
       {
index 05d9894744f809989458f5b1c8ab8e1d4331711a..4e239a952262b18f590144c15b584f0045e978bb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
old mode 100755 (executable)
new mode 100644 (file)
index 6089df8..ac08697
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -52,7 +52,9 @@ STEPPlugin_IECallBack::Export( int                            theDocId,
                               const TCollection_AsciiString& theFormatName )
 {
   STEPPlugin_IOperations* aPluginOperations = STEPPlugin_OperationsCreator::get( GetEngine(), theDocId );
-  aPluginOperations->ExportSTEP( theOriginal, theFileName );
+  const STEPPlugin_IOperations::LengthUnit aUnit = STEPPlugin_IOperations::LengthUnit_Meter;
+
+  aPluginOperations->ExportSTEP( theOriginal, theFileName, aUnit );
   return true;
 }
 
index 4f6f571c35457b2ba63ddad6bcfc3805cc69ae29..78c218fec110bc8f1ac2f9d951942b4540c5c271 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 70fc5da19b5ff764a543ccbf896fddda8c6017c1..77f01392b3d2808c8bc8449fcdca6eae8ac252f1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -24,6 +24,7 @@
 
 #define EXPORTSTEP_ARG_ORIGINAL   1
 #define EXPORTSTEP_ARG_FILENAME   2
+#define EXPORTSTEP_ARG_UNIT       3
 
 class STEPPlugin_IExport
 {
@@ -40,6 +41,11 @@ public:
     { _func->SetString( EXPORTSTEP_ARG_FILENAME, theFileName ); }
   TCollection_AsciiString GetFileName()
     { return _func->GetString( EXPORTSTEP_ARG_FILENAME ); }
+
+  void SetUnit(const Standard_Integer theUnit)
+  { _func->SetInteger(EXPORTSTEP_ARG_UNIT, theUnit); }
+  Standard_Integer GetUnit()
+  { return _func->GetInteger(EXPORTSTEP_ARG_UNIT); }
   
 private:
   Handle(GEOM_Function) _func;
index 9c2679a0cc8823f2ec519c57966dce8ea6d06650..3b63fdfdc4c185a6cde0822fd137deacf98ebe62 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e2fa9fad29d83346dd59fc73450d2db9103148fc..72064e8e3027fb780a0dd0518e3babec2d149d95 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -54,18 +54,66 @@ STEPPlugin_IOperations::~STEPPlugin_IOperations()
   MESSAGE( "STEPPlugin_IOperations::~STEPPlugin_IOperations" );
 }
 
+//=============================================================================
+/*!
+ *
+ */
+//=============================================================================
+static GEOM::TPythonDump& operator<<
+          (GEOM::TPythonDump                        &theDump,
+           const STEPPlugin_IOperations::LengthUnit  theState)
+{
+  switch (theState) {
+  case STEPPlugin_IOperations::LengthUnit_Inch:
+    theDump << "GEOM.LU_INCH";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Millimeter:
+    theDump << "GEOM.LU_MILLIMETER";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Foot:
+    theDump << "GEOM.LU_FOOT";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Mile:
+    theDump << "GEOM.LU_MILE";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Meter:
+    theDump << "GEOM.LU_METER";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Kilometer:
+    theDump << "GEOM.LU_KILOMETER";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Milliinch:
+    theDump << "GEOM.LU_MILLIINCH";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Micrometer:
+    theDump << "GEOM.LU_MICROMETER";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Centimeter:
+    theDump << "GEOM.LU_CENTIMETER";
+    break;
+  case STEPPlugin_IOperations::LengthUnit_Microinch:
+    theDump << "GEOM.LU_MICROINCH";
+    break;
+  default:
+    break;
+  }
+
+  return theDump;
+}
+
 //=============================================================================
 /*!
  *  ExportSTEP
  *  Export a shape to STEP format
  *  \param theOriginal The shape to export
  *  \param theFileName The name of the file to exported
- *  \param theIsASCII The format of the exported file (ASCII or Binary)
- *  \param theDeflection The deflection of the shape to exported
+ *  \param theUnit the length unit
  */
 //=============================================================================
-void STEPPlugin_IOperations::ExportSTEP( const Handle(GEOM_Object)      theOriginal,
-                                        const TCollection_AsciiString& theFileName )
+void STEPPlugin_IOperations::ExportSTEP
+                    (const Handle(GEOM_Object)      theOriginal,
+                     const TCollection_AsciiString &theFileName,
+                     const LengthUnit               theUnit)
 {
   SetErrorCode(KO);
   if( theOriginal.IsNull() ) return;
@@ -87,6 +135,7 @@ void STEPPlugin_IOperations::ExportSTEP( const Handle(GEOM_Object)      theOrigi
   STEPPlugin_IExport aCI( aFunction );
   aCI.SetOriginal( aRefFunction );
   aCI.SetFileName( theFileName );
+  aCI.SetUnit( theUnit );
 
   //Perform the Export
   try {
@@ -104,7 +153,7 @@ void STEPPlugin_IOperations::ExportSTEP( const Handle(GEOM_Object)      theOrigi
 
   //Make a Python command
   GEOM::TPythonDump(aFunction) << "geompy.ExportSTEP(" << theOriginal << ", \""
-    << theFileName.ToCString() << "\" )";
+    << theFileName.ToCString() << "\", " << theUnit << " )";
 
   SetErrorCode(OK);
 }
index 6d4999815a336eeb526a86c1eb654791b5912552..92b3f160e78430fde83aa5b926f8557f17890de6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 
 class STEPPLUGINENGINE_EXPORT STEPPlugin_IOperations: public GEOMImpl_IBaseIEOperations
 {
+
+public:
+
+  /*!
+   *  \brief Units of length
+   */
+  enum LengthUnit
+  {
+    LengthUnit_Inch,
+    LengthUnit_Millimeter,
+    LengthUnit_Foot,
+    LengthUnit_Mile,
+    LengthUnit_Meter,
+    LengthUnit_Kilometer,
+    LengthUnit_Milliinch,
+    LengthUnit_Micrometer,
+    LengthUnit_Centimeter,
+    LengthUnit_Microinch
+  };
+
+
 public:
   STEPPlugin_IOperations( GEOM_Engine*, int );
   ~STEPPlugin_IOperations();
 
   void ExportSTEP( const Handle(GEOM_Object),
-                  const TCollection_AsciiString& );
+                  const TCollection_AsciiString&, const LengthUnit );
   
   Handle(TColStd_HSequenceOfTransient) ImportSTEP( const TCollection_AsciiString&,
                                                   const bool );
index 1f4ded47ae05c4d0d7e1102f380075d80f678777..fba3ce031e4fd7c2a2ea5d0cf282d4dde8df3daa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -53,10 +53,12 @@ STEPPlugin_IOperations_i::~STEPPlugin_IOperations_i()
  *  Export a shape to STEP format
  *  \param theOriginal The shape to export
  *  \param theFileName The name of the exported file
+ *  \param theUnit the length unit.
  */
 //=============================================================================
-void STEPPlugin_IOperations_i::ExportSTEP( GEOM::GEOM_Object_ptr theOriginal,
-                                          const char*           theFileName )
+void STEPPlugin_IOperations_i::ExportSTEP(GEOM::GEOM_Object_ptr theOriginal,
+                                          const char*           theFileName,
+                                          GEOM::length_unit     theUnit)
 {
   // duplicate the original shape
   GEOM::GEOM_Object_var aGEOMObject = GEOM::GEOM_Object::_duplicate( theOriginal );
@@ -68,8 +70,45 @@ void STEPPlugin_IOperations_i::ExportSTEP( GEOM::GEOM_Object_ptr theOriginal,
   Handle(GEOM_Object) anOriginal = GetObjectImpl( theOriginal );
   if (anOriginal.IsNull()) return;
 
+  STEPPlugin_IOperations::LengthUnit aUnit;
+
+  switch (theUnit) {
+  case GEOM::LU_INCH:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Inch;
+    break;
+  case GEOM::LU_MILLIMETER:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Millimeter;
+    break;
+  case GEOM::LU_FOOT:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Foot;
+    break;
+  case GEOM::LU_MILE:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Mile;
+    break;
+  case GEOM::LU_METER:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Meter;
+    break;
+  case GEOM::LU_KILOMETER:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Kilometer;
+    break;
+  case GEOM::LU_MILLIINCH:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Milliinch;
+    break;
+  case GEOM::LU_MICROMETER:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Micrometer;
+    break;
+  case GEOM::LU_CENTIMETER:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Centimeter;
+    break;
+  case GEOM::LU_MICROINCH:
+    aUnit = STEPPlugin_IOperations::LengthUnit_Microinch;
+    break;
+  default:
+    return;
+  }
+
   //Export the shape to the file
-  GetOperations()->ExportSTEP( anOriginal, theFileName );
+  GetOperations()->ExportSTEP( anOriginal, theFileName, aUnit );
 }
 
 //=============================================================================
index 41833f82273434b3d593bd5131afa63740d547e3..16e000909c8b134ce81573a3bd0640a06e789606 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -43,7 +43,8 @@ public:
                            STEPPlugin_IOperations* theImpl );
   ~STEPPlugin_IOperations_i();
 
-  void            ExportSTEP( GEOM::GEOM_Object_ptr, const char* );
+  void            ExportSTEP( GEOM::GEOM_Object_ptr, const char*,
+                              GEOM::length_unit );
   GEOM::ListOfGO* ImportSTEP( const char*, const bool );
   char*           ReadValue( const char*, const char* );
 
index dc26023bdc032cff82649f5fad94897b6297ef3f..961dd77be42d117980a790b60ce9cea2300b2fbe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx> // CAREFUL ! position of this file is critic : see Lucien PIGNOLONI / OCC
 
-//=============================================================================
-/*!
- *  GetShape()
- */
-//=============================================================================
-
-TopoDS_Shape GetShape(const Handle(Standard_Transient)        &theEnti,
-                     const Handle(Transfer_TransientProcess) &theTP)
+namespace
 {
-  TopoDS_Shape            aResult;
-  Handle(Transfer_Binder) aBinder = theTP->Find(theEnti);
-
-  if (aBinder.IsNull()) {
+  //=============================================================================
+  /*!
+   *  GetShape()
+   */
+  //=============================================================================
+  
+  TopoDS_Shape GetShape(const Handle(Standard_Transient)        &theEnti,
+                        const Handle(Transfer_TransientProcess) &theTP)
+  {
+    TopoDS_Shape            aResult;
+    Handle(Transfer_Binder) aBinder = theTP->Find(theEnti);
+    
+    if (aBinder.IsNull()) {
+      return aResult;
+    }
+    
+    aResult = TransferBRep::ShapeResult(aBinder);
+    
     return aResult;
   }
-
-  aResult = TransferBRep::ShapeResult(aBinder);
-
-  return aResult;
-}
-
-//=============================================================================
-/*!
- *  GetLabel()
- */
-//=============================================================================
-
-TDF_Label GetLabel(const Handle(Standard_Transient) &theEnti,
-                  const TDF_Label                  &theShapeLabel,
-                  const TopoDS_Shape               &aShape)
-{
-  TDF_Label aResult;
-
-  if (theEnti->IsKind
-            (STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
-    // check all named shapes using iterator
-    TDF_ChildIDIterator anIt
-      (theShapeLabel, TDataStd_Name::GetID(), Standard_True);
-
-    for (; anIt.More(); anIt.Next()) {
-      Handle(TDataStd_Name) nameAttr =
-        Handle(TDataStd_Name)::DownCast(anIt.Value());
-
-      if (nameAttr.IsNull()) {
-        continue;
-      }
-
-      TDF_Label aLab = nameAttr->Label();
-      Handle(TNaming_NamedShape) shAttr;
-
-      if (aLab.FindAttribute(TNaming_NamedShape::GetID(), shAttr) &&
-          shAttr->Get().IsEqual(aShape)) {
-        aResult = aLab;
+  
+  //=============================================================================
+  /*!
+   *  GetLabel()
+   */
+  //=============================================================================
+  
+  TDF_Label GetLabel(const Handle(Standard_Transient) &theEnti,
+                     const TDF_Label                  &theShapeLabel,
+                     const TopoDS_Shape               &aShape)
+  {
+    TDF_Label aResult;
+    
+    if (theEnti->IsKind
+        (STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
+      // check all named shapes using iterator
+      TDF_ChildIDIterator anIt
+        (theShapeLabel, TDataStd_Name::GetID(), Standard_True);
+      
+      for (; anIt.More(); anIt.Next()) {
+        Handle(TDataStd_Name) nameAttr =
+          Handle(TDataStd_Name)::DownCast(anIt.Value());
+        
+        if (nameAttr.IsNull()) {
+          continue;
+        }
+        
+        TDF_Label aLab = nameAttr->Label();
+        Handle(TNaming_NamedShape) shAttr;
+        
+        if (aLab.FindAttribute(TNaming_NamedShape::GetID(), shAttr) &&
+            shAttr->Get().IsEqual(aShape)) {
+          aResult = aLab;
+        }
       }
     }
-  }
-
-  // create label and set shape
-  if (aResult.IsNull()) {
-    TDF_TagSource aTag;
-
-    aResult = aTag.NewChild(theShapeLabel);
-
-    TNaming_Builder tnBuild (aResult);
-
-    tnBuild.Generated(aShape);
-  }
-
-  return aResult;
-}
-
-//=============================================================================
-/*!
- *  StoreName()
- */
-//=============================================================================
-
-void StoreName( const Handle(Standard_Transient)        &theEnti,
-                const TopTools_IndexedMapOfShape        &theIndices,
-                const Handle(Transfer_TransientProcess) &theTP,
-                const TDF_Label                         &theShapeLabel)
-{
-  Handle(TCollection_HAsciiString) aName;
-
-  if (theEnti->IsKind(STANDARD_TYPE(StepShape_TopologicalRepresentationItem)) ||
-      theEnti->IsKind(STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
-    aName = Handle(StepRepr_RepresentationItem)::DownCast(theEnti)->Name();
-  } else {
-    Handle(StepBasic_ProductDefinition) PD =
-      Handle(StepBasic_ProductDefinition)::DownCast(theEnti);
-
-    if (PD.IsNull() == Standard_False) {
-      Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct();
-      aName = Prod->Name();
+    
+    // create label and set shape
+    if (aResult.IsNull()) {
+      TDF_TagSource aTag;
+      
+      aResult = aTag.NewChild(theShapeLabel);
+      
+      TNaming_Builder tnBuild (aResult);
+      
+      tnBuild.Generated(aShape);
     }
+    
+    return aResult;
   }
 
-  bool isValidName = false;
-
-  if (aName.IsNull() == Standard_False) {
-    isValidName = true;
-
-    if (aName->UsefullLength() < 1) {
-      isValidName = false;
-    } else if (aName->UsefullLength() == 4 &&
-               toupper (aName->Value(1)) == 'N' &&
-               toupper (aName->Value(2)) == 'O' &&
-               toupper (aName->Value(3)) == 'N' &&
-               toupper (aName->Value(4)) == 'E') {
-      // skip 'N0NE' name
-      isValidName = false;
+  //=============================================================================
+  /*!
+   *  StoreName()
+   */
+  //=============================================================================
+  
+  void StoreName( const Handle(Standard_Transient)        &theEnti,
+                  const TopTools_IndexedMapOfShape        &theIndices,
+                  const Handle(Transfer_TransientProcess) &theTP,
+                  const TDF_Label                         &theShapeLabel)
+  {
+    Handle(TCollection_HAsciiString) aName;
+    
+    if (theEnti->IsKind(STANDARD_TYPE(StepShape_TopologicalRepresentationItem)) ||
+        theEnti->IsKind(STANDARD_TYPE(StepGeom_GeometricRepresentationItem))) {
+      aName = Handle(StepRepr_RepresentationItem)::DownCast(theEnti)->Name();
     } else {
-      // special check to pass names like "Open CASCADE STEP translator 6.3 1"
-      TCollection_AsciiString aSkipName ("Open CASCADE STEP translator");
-
-      if (aName->Length() >= aSkipName.Length()) {
-        if (aName->String().SubString
-                            (1, aSkipName.Length()).IsEqual(aSkipName)) {
-          isValidName = false;
+      Handle(StepBasic_ProductDefinition) PD =
+        Handle(StepBasic_ProductDefinition)::DownCast(theEnti);
+      
+      if (PD.IsNull() == Standard_False) {
+        Handle(StepBasic_Product) Prod = PD->Formation()->OfProduct();
+        aName = Prod->Name();
+      }
+    }
+    
+    bool isValidName = false;
+
+    if (aName.IsNull() == Standard_False) {
+      isValidName = true;
+
+      if (aName->UsefullLength() < 1) {
+        isValidName = false;
+      } else if (aName->UsefullLength() == 4 &&
+                 toupper (aName->Value(1)) == 'N' &&
+                 toupper (aName->Value(2)) == 'O' &&
+                 toupper (aName->Value(3)) == 'N' &&
+                 toupper (aName->Value(4)) == 'E') {
+        // skip 'N0NE' name
+        isValidName = false;
+      } else {
+        // special check to pass names like "Open CASCADE STEP translator 6.3 1"
+        TCollection_AsciiString aSkipName ("Open CASCADE STEP translator");
+
+        if (aName->Length() >= aSkipName.Length()) {
+          if (aName->String().SubString
+              (1, aSkipName.Length()).IsEqual(aSkipName)) {
+            isValidName = false;
+          }
         }
       }
     }
-  }
 
-  if (isValidName) {
-    TCollection_ExtendedString aNameExt (aName->ToCString());
+    if (isValidName) {
+      TCollection_ExtendedString aNameExt (aName->ToCString());
 
-    // find target shape
-    TopoDS_Shape S = GetShape(theEnti, theTP);
+      // find target shape
+      TopoDS_Shape S = GetShape(theEnti, theTP);
 
-    if (S.IsNull()) {
-      return;
-    }
+      if (S.IsNull()) {
+        return;
+      }
 
-    // as PRODUCT can be included in the main shape
-    // several times, we look here for all iclusions.
-    Standard_Integer isub, nbSubs = theIndices.Extent();
+      // as PRODUCT can be included in the main shape
+      // several times, we look here for all iclusions.
+      Standard_Integer isub, nbSubs = theIndices.Extent();
 
-    for (isub = 1; isub <= nbSubs; isub++) {
-      TopoDS_Shape aSub = theIndices.FindKey(isub);
+      for (isub = 1; isub <= nbSubs; isub++) {
+        TopoDS_Shape aSub = theIndices.FindKey(isub);
 
-      if (aSub.IsPartner(S)) {
-        TDF_Label L = GetLabel(theEnti, theShapeLabel, aSub);
+        if (aSub.IsPartner(S)) {
+          TDF_Label L = GetLabel(theEnti, theShapeLabel, aSub);
 
-        // set a name
-        TDataStd_Name::Set(L, aNameExt);
+          // set a name
+          TDataStd_Name::Set(L, aNameExt);
+        }
       }
     }
   }
-}
 
-//=============================================================================
-/*!
- *  StoreMaterial()
- */
-//=============================================================================
+  //=============================================================================
+  /*!
  *  StoreMaterial()
  */
+  //=============================================================================
 
-void StoreMaterial( const Handle(Standard_Transient)        &theEnti,
-                    const TopTools_IndexedMapOfShape        &theIndices,
-                    const Handle(Transfer_TransientProcess) &theTP,
-                    const TDF_Label                         &theShapeLabel )
-{
-  // Treat Product Definition Shape only.
-  Handle(StepRepr_ProductDefinitionShape) aPDS =
+  void StoreMaterial( const Handle(Standard_Transient)        &theEnti,
+                      const TopTools_IndexedMapOfShape        &theIndices,
+                      const Handle(Transfer_TransientProcess) &theTP,
+                      const TDF_Label                         &theShapeLabel )
+  {
+    // Treat Product Definition Shape only.
+    Handle(StepRepr_ProductDefinitionShape) aPDS =
       Handle(StepRepr_ProductDefinitionShape)::DownCast(theEnti);
-  Handle(StepBasic_ProductDefinition)     aProdDef;
+    Handle(StepBasic_ProductDefinition)     aProdDef;
 
-  if(aPDS.IsNull() == Standard_False) {
-    // Product Definition Shape ==> Product Definition
-    aProdDef = aPDS->Definition().ProductDefinition();
-  }
+    if(aPDS.IsNull() == Standard_False) {
+      // Product Definition Shape ==> Product Definition
+      aProdDef = aPDS->Definition().ProductDefinition();
+    }
 
-  if (aProdDef.IsNull() == Standard_False) {
-    // Product Definition ==> Property Definition
-    const Interface_Graph    &aGraph = theTP->Graph();
-    Interface_EntityIterator  aSubs  = aGraph.Sharings(aProdDef);
-    TopoDS_Shape              aShape;
+    if (aProdDef.IsNull() == Standard_False) {
+      // Product Definition ==> Property Definition
+      const Interface_Graph    &aGraph = theTP->Graph();
+      Interface_EntityIterator  aSubs  = aGraph.Sharings(aProdDef);
+      TopoDS_Shape              aShape;
 
-    for(aSubs.Start(); aSubs.More(); aSubs.Next()) {
-      Handle(StepRepr_PropertyDefinition) aPropD =
-        Handle(StepRepr_PropertyDefinition)::DownCast(aSubs.Value());
+      for(aSubs.Start(); aSubs.More(); aSubs.Next()) {
+        Handle(StepRepr_PropertyDefinition) aPropD =
+          Handle(StepRepr_PropertyDefinition)::DownCast(aSubs.Value());
 
-      if(aPropD.IsNull() == Standard_False) {
-        // Property Definition ==> Representation.
-        Interface_EntityIterator aSubs1 = aGraph.Sharings(aPropD);
+        if(aPropD.IsNull() == Standard_False) {
+          // Property Definition ==> Representation.
+          Interface_EntityIterator aSubs1 = aGraph.Sharings(aPropD);
 
-        for(aSubs1.Start(); aSubs1.More(); aSubs1.Next()) {
-          Handle(StepRepr_PropertyDefinitionRepresentation) aPDR =
-            Handle(StepRepr_PropertyDefinitionRepresentation)::
+          for(aSubs1.Start(); aSubs1.More(); aSubs1.Next()) {
+            Handle(StepRepr_PropertyDefinitionRepresentation) aPDR =
+              Handle(StepRepr_PropertyDefinitionRepresentation)::
               DownCast(aSubs1.Value());
 
-          if(aPDR.IsNull() == Standard_False) {
-            // Property Definition ==> Material Name.
-            Handle(StepRepr_Representation) aRepr = aPDR->UsedRepresentation();
+            if(aPDR.IsNull() == Standard_False) {
+              // Property Definition ==> Material Name.
+              Handle(StepRepr_Representation) aRepr = aPDR->UsedRepresentation();
 
-            if(aRepr.IsNull() == Standard_False) {
-              Standard_Integer ir;
+              if(aRepr.IsNull() == Standard_False) {
+                Standard_Integer ir;
 
-              for(ir = 1; ir <= aRepr->NbItems(); ir++) {
-                Handle(StepRepr_RepresentationItem) aRI = aRepr->ItemsValue(ir);
-                Handle(StepRepr_DescriptiveRepresentationItem) aDRI =
-                  Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(aRI);
+                for(ir = 1; ir <= aRepr->NbItems(); ir++) {
+                  Handle(StepRepr_RepresentationItem) aRI = aRepr->ItemsValue(ir);
+                  Handle(StepRepr_DescriptiveRepresentationItem) aDRI =
+                    Handle(StepRepr_DescriptiveRepresentationItem)::DownCast(aRI);
 
-                if(aDRI.IsNull() == Standard_False) {
-                  // Get shape from Product Definition
-                  Handle(TCollection_HAsciiString) aMatName = aDRI->Name();
+                  if(aDRI.IsNull() == Standard_False) {
+                    // Get shape from Product Definition
+                    Handle(TCollection_HAsciiString) aMatName = aDRI->Name();
 
-                  if(aMatName.IsNull() == Standard_False) {
-                    TCollection_ExtendedString
-                                 aMatNameExt (aMatName->ToCString());
-
-                    if (aShape.IsNull()) {
-                      // Get the shape.
-                      aShape = GetShape(aProdDef, theTP);
+                    if(aMatName.IsNull() == Standard_False) {
+                      TCollection_ExtendedString
+                        aMatNameExt (aMatName->ToCString());
 
                       if (aShape.IsNull()) {
-                        return;
+                        // Get the shape.
+                        aShape = GetShape(aProdDef, theTP);
+
+                        if (aShape.IsNull()) {
+                          return;
+                        }
                       }
-                    }
 
-                    // as PRODUCT can be included in the main shape
-                    // several times, we look here for all iclusions.
-                    Standard_Integer isub, nbSubs = theIndices.Extent();
+                      // as PRODUCT can be included in the main shape
+                      // several times, we look here for all iclusions.
+                      Standard_Integer isub, nbSubs = theIndices.Extent();
 
-                    for (isub = 1; isub <= nbSubs; isub++) {
-                      TopoDS_Shape aSub = theIndices.FindKey(isub);
+                      for (isub = 1; isub <= nbSubs; isub++) {
+                        TopoDS_Shape aSub = theIndices.FindKey(isub);
 
-                      if (aSub.IsPartner(aShape)) {
-                        TDF_Label aLabel =
-                          GetLabel(aProdDef, theShapeLabel, aSub);
+                        if (aSub.IsPartner(aShape)) {
+                          TDF_Label aLabel =
+                            GetLabel(aProdDef, theShapeLabel, aSub);
 
-                        // set a name
-                        TDataStd_Comment::Set(aLabel, aMatNameExt);
+                          // set a name
+                          TDataStd_Comment::Set(aLabel, aMatNameExt);
+                        }
                       }
                     }
                   }
@@ -310,7 +313,53 @@ void StoreMaterial( const Handle(Standard_Transient)        &theEnti,
       }
     }
   }
-}
+
+  TCollection_AsciiString ToNamedUnit( const TCollection_AsciiString& unit )
+  {
+    TCollection_AsciiString result = unit;
+    result.LowerCase();
+    if ( result == "mil" ) result = "milliinch";
+    return result;
+  }
+
+  TCollection_AsciiString ToOcctUnit( const TCollection_AsciiString& unit, TCollection_AsciiString& error )
+  {
+    TCollection_AsciiString result = "M", u = ToNamedUnit(unit);
+    u.LowerCase();
+
+    if (u == "inch")
+      result = "INCH";
+    else if (u == "milliinch")
+      result = "MIL";
+    else if (u == "microinch")
+      result = "UIN";
+    else if (u == "foot")
+      result = "FT";
+    else if (u == "mile")
+      result = "MI";
+    else if (u == "metre")
+      result = "M";
+    else if (u == "kilometre")
+      result = "KM";
+    else if (u == "millimetre")
+      result = "MM";
+    else if (u == "centimetre")
+      result = "CM";
+    else if (u == "micrometre")
+      result = "UM";
+    else if (u.IsEmpty())
+      result = "M";
+    else
+      error = "The file contains not supported units";
+      
+    // TODO (for other units)
+    // else
+    //  result = "??"
+
+    return result;
+  }
+
+} // end of namespace
 
 //=======================================================================
 //function : GetID
@@ -377,21 +426,8 @@ Standard_Integer STEPPlugin_ImportDriver::Execute( TFunction_Logbook& log ) cons
         TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
         aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
         if (anUnitLengthNames.Length() > 0) {
-          TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
-          if (aLenUnits == "millimetre")
-            Interface_Static::SetCVal("xstep.cascade.unit", "MM");
-          else if (aLenUnits == "centimetre")
-            Interface_Static::SetCVal("xstep.cascade.unit", "CM");
-          else if (aLenUnits == "metre" || aLenUnits.IsEmpty())
-            Interface_Static::SetCVal("xstep.cascade.unit", "M");
-          else if (aLenUnits == "INCH")
-            Interface_Static::SetCVal("xstep.cascade.unit", "INCH");
-          else {
-            anError = "The file contains not supported units.";
-          }
-          // TODO (for other units than mm, cm, m or inch)
-          // else if (aLenUnits == "")
-          // Interface_Static::SetCVal("xstep.cascade.unit", "???");
+          TCollection_AsciiString aLenUnits = ToOcctUnit(anUnitLengthNames.First(), anError);
+          Interface_Static::SetCVal("xstep.cascade.unit", aLenUnits.ToCString());
         }
       }
       else {
@@ -443,7 +479,7 @@ Standard_Integer STEPPlugin_ImportDriver::Execute( TFunction_Logbook& log ) cons
 
       // Check if any BRep entity has been read, there must be at least a vertex
       if ( !TopExp_Explorer( aResShape, TopAbs_VERTEX ).More() )
-        anError = "No geometrical data in the imported file.";
+        StdFail_NotDone::Raise( "No geometrical data in the imported file." );
 
       // BEGIN: Store names and materials of sub-shapes from file
       TopTools_IndexedMapOfShape anIndices;
@@ -548,10 +584,10 @@ GetCreationInformation( std::string&             theOperationName,
 
 TCollection_AsciiString
 STEPPlugin_ImportDriver::GetValue( const TCollection_AsciiString& theFileName,
-                                     const TCollection_AsciiString& theParameterName,
-                                     TCollection_AsciiString&       theError )
+                                   const TCollection_AsciiString& theParameterName,
+                                   TCollection_AsciiString&       theError )
 {
-  Handle(TCollection_HAsciiString) aValue;
+  TCollection_AsciiString aValue;
 
   if (theParameterName != "LEN_UNITS") {
     theError = theParameterName + " parameter reading is not supported by STEP plugin";
@@ -575,23 +611,8 @@ STEPPlugin_ImportDriver::GetValue( const TCollection_AsciiString& theFileName,
       TColStd_SequenceOfAsciiString anUnitAngleNames;
       TColStd_SequenceOfAsciiString anUnitSolidAngleNames;
       aReader.FileUnits(anUnitLengthNames, anUnitAngleNames, anUnitSolidAngleNames);
-      if (anUnitLengthNames.Length() > 0) {
-        aValue = new TCollection_HAsciiString( anUnitLengthNames.First() );
-        /*
-        TCollection_AsciiString aLenUnits = anUnitLengthNames.First();
-        if (aLenUnits == "millimetre")
-          aValue = new TCollection_HAsciiString ("MM");
-        else if (aLenUnits == "centimetre")
-          aValue = new TCollection_HAsciiString ("CM");
-        else if (aLenUnits == "metre")
-          aValue = new TCollection_HAsciiString ("M");
-        else if (aLenUnits == "INCH")
-          aValue = new TCollection_HAsciiString ("INCH");
-        // TODO (for other units than mm, cm, m or inch)
-        //else if (aLenUnits == "")
-        //  aValue = new TCollection_HAsciiString ("");
-        */
-      }
+      if (anUnitLengthNames.Length() > 0)
+        aValue = ToNamedUnit( anUnitLengthNames.First() );
     }
     else {
       theError = theFileName + " reading failed";
@@ -601,10 +622,7 @@ STEPPlugin_ImportDriver::GetValue( const TCollection_AsciiString& theFileName,
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
     theError = aFail->GetMessageString();
   }
-  if (!aValue.IsNull())
-    return aValue->String();
-  else
-    return TCollection_AsciiString();
+  return aValue;
 }
 
 
index 40bb7b1be985cc6ca6ab488f2414b9fcd0e97f12..b494da939e79d91d01e105bc893f13f3e4965bc1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d3d31a18d4f66fd4d43b2ca04b77b9acd7a3b685..c0eb566fd1b8a5d3e765d97e538f2c044940fadb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 5e3cb95755d2ac95746326c806f5a6ab50daa9e4..37a98e1b9e1422dac77093b8be4f434a9d112aa7 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d24fc901469340d145f11cebcbafc8d7cf471f03..47d15c8f83ad0a3a55948f13613d4afd92fe57c3 100644 (file)
 Ignoring units will cause model scaling (as dimensions are supposed to be specified in meters).</translation>
     </message>
 </context>
+<context>
+    <name>STEPPlugin_ExportDlg</name>
+    <message>
+        <source>STEP_LENGTH_UNITS</source>
+        <translation>Length units</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_INCH</source>
+        <translation>inch</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_MILLIMETER</source>
+        <translation>millimeter</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_FOOT</source>
+        <translation>foot</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_MILE</source>
+        <translation>mile</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_METER</source>
+        <translation>meter</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_KILOMETER</source>
+        <translation>kilometer</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_MILLIINCH</source>
+        <translation>milliinch</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_MICROMETER</source>
+        <translation>micrometer</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_CENTIMETER</source>
+        <translation>centimeter</translation>
+    </message>
+    <message>
+        <source>STEP_UNITS_MICROINCH</source>
+        <translation>microinch</translation>
+    </message>
+</context>
 </TS>
index 459ee3442af0308eaf86778a8520e7a16448b3e2..686db9ad48ba62b2a092955f46685e5c269763ab 100644 (file)
@@ -1,50 +1,50 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
-        <source>MEN_EXPORTSTEP</source>
-        <translation type="unfinished">STEP</translation>
+      <source>MEN_EXPORTSTEP</source>
+      <translation>STEPエクスポート</translation>
     </message>
     <message>
-        <source>TOP_EXPORTSTEP</source>
-        <translation type="unfinished">Export STEP</translation>
+      <source>TOP_EXPORTSTEP</source>
+      <translation>STEPエクスポート</translation>
     </message>
     <message>
-        <source>STB_EXPORTSTEP</source>
-        <translation type="unfinished">Export STEP</translation>
+      <source>STB_EXPORTSTEP</source>
+      <translation>STEPエクスポート</translation>
     </message>
     <message>
-        <source>MEN_IMPORTSTEP</source>
-        <translation type="unfinished">STEP</translation>
+      <source>MEN_IMPORTSTEP</source>
+      <translation>STEPインポート</translation>
     </message>
     <message>
-        <source>TOP_IMPORTSTEP</source>
-        <translation type="unfinished">Import STEP</translation>
+      <source>TOP_IMPORTSTEP</source>
+      <translation>STEPインポート</translation>
     </message>
     <message>
-        <source>STB_IMPORTSTEP</source>
-        <translation type="unfinished">Import STEP</translation>
+      <source>STB_IMPORTSTEP</source>
+      <translation>STEPインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>STEPPlugin_GUI</name>
     <message>
-        <source>STEP_FILES</source>
-        <translation type="unfinished">STEP Files ( *.step *.stp )</translation>
+      <source>STEP_FILES</source>
+      <translation>STEP ファイル ( *.step *.stp )</translation>
     </message>
     <message>
-        <source>EXPORT_TITLE</source>
-        <translation type="unfinished">Export STEP</translation>
+      <source>EXPORT_TITLE</source>
+      <translation>STEPエクスポート</translation>
     </message>
     <message>
-        <source>IMPORT_TITLE</source>
-        <translation type="unfinished">Import STEP</translation>
+      <source>IMPORT_TITLE</source>
+      <translation>STEPインポート</translation>
     </message>
     <message>
-        <source>SCALE_DIMENSIONS</source>
-        <translation>インポートしたファイルの単位をミリメートルからメートルに変換しますか?いいえを選んだ場合、メートル単位として解釈します。</translation>
+      <source>SCALE_DIMENSIONS</source>
+      <translation>インポートしたファイルの単位をミリメートルからメートルに変換しますか?いいえを選んだ場合、メートル単位として解釈します。</translation>
     </message>
-</context>
+  </context>
 </TS>
index b4688f6b1b4eed8c8159c97457cfef8d6162bc16..954610a780e0a1589a9c9c0a67d533d9d37b5700 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 49fb94c80def6f30620c235d2b74cc17a5105fec..9322ec1b0dfc37016669c6626206c7e2b19d0e75 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index df3244fa2c74ae75ce90c7ccfa86e160a5fab572..7121636a3e2c3c1c0ca9258aa840ac17b2a7eab2 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 8d16f234e441e3f3a4e00e1652b9dda89f9a0629..05616e15d330a1d7fd8644f4ff640669cf0c41fe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e79722e1a588fae4a4b3ff3cc8576100b790d14c..a8a16e9d8683f3bc8bf850867fe6f0779f67f759 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index f800a7d0beb730a0e5c2041f9a941bd78218846a..41130de41d2c1ea4cb474c131291d7849d21d384 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -24,6 +24,7 @@
 // KERNEL includes
 #include <utilities.h>
 #include <Basics_Utils.hxx>
+#include <Basics_OCCTVersion.hxx>
 
 // GEOM includes
 #include "GEOM_Function.hxx"
 #include <BRepBuilderAPI_Copy.hxx>
 #include <StlAPI_Writer.hxx>
 #include <TopoDS_Shape.hxx>
+#include <Bnd_Box.hxx>
+#include <BRepBndLib.hxx>
+#include <BRepTools.hxx>
+#include <BRepMesh_IncrementalMesh.hxx>
+
+#define MAX2(X, Y)      ( Abs(X) > Abs(Y) ? Abs(X) : Abs(Y) )
+#define MAX3(X, Y, Z)   ( MAX2 ( MAX2(X, Y) , Z ) )
 
 //=======================================================================
 //function : GetID
@@ -84,15 +92,31 @@ Standard_Integer STLPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const
   try
   {
     StlAPI_Writer aWriter;
+    // copy source shape
+    BRepBuilderAPI_Copy aCopy( aShape, Standard_False );
+    TopoDS_Shape aCopyShape = aCopy.Shape();
+    // ASCII mode
+    aWriter.ASCIIMode() = anIsASCII;
+#if OCC_VERSION_LARGE > 0x06080000
+    if ( anIsRelative ) {
+      Standard_Real aXmin, aYmin, aZmin, aXmax, aYmax, aZmax;
+      Bnd_Box bndBox;
+      BRepBndLib::Add( aShape, bndBox );
+      bndBox.Get( aXmin, aYmin, aZmin, aXmax, aYmax, aZmax );
+      aDeflection = MAX3( aXmax-aXmin, aYmax-aYmin, aZmax-aZmin ) * aDeflection;
+    }
+    //Compute triangulation
+    BRepTools::Clean( aCopyShape );
+    BRepMesh_IncrementalMesh aMesh( aCopyShape, aDeflection );
+#else
     // set relative mode on false for using custom deflection coefficient
     aWriter.RelativeMode( ) = anIsRelative;
-    aWriter.ASCIIMode() = anIsASCII;
     if( anIsRelative )
       aWriter.SetCoefficient( aDeflection );
     else
       aWriter.SetDeflection( aDeflection );
-    BRepBuilderAPI_Copy aCopy( aShape, Standard_False );
-    aWriter.Write( aCopy.Shape(), aFileName.ToCString() );
+#endif
+    aWriter.Write( aCopyShape, aFileName.ToCString() );
     log.SetTouched( Label() );
     return 1;
   }
index 90eef7fb4e89641cf0bc711ae93aba7ce3ec5457..89a0c596f8336b95e328a7eb49c54414c25fd919 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1c97499926468d308cff29fd84486c480269081b..d868adb9720aad1cae434e80cd90d48607beb3c3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include "GEOM_Operation.h"
 #include "GEOMBase.h"
 #include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(STLPlugin)
 
+typedef GEOM::GenericObjPtr<GEOM::ISTLOperations> STLOpPtr;
+
 //=======================================================================
 // function : STLPlugin_GUI()
 // purpose  : Constructor
@@ -109,8 +112,8 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" );
-  GEOM::ISTLOperations_var stlOp = GEOM::ISTLOperations::_narrow( op );
-  if ( CORBA::is_nil( stlOp ) ) return false;
+  STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op );
+  if ( stlOp.isNull() ) return false;
   
   QStringList fileNames = app->getOpenFileNames( SUIT_FileDlg::getLastVisitedPath().isEmpty() ? QDir::currentPath() : QString(""),
                                                 tr( "STL_FILES" ),
@@ -124,7 +127,7 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent )
     foreach( QString fileName, fileNames )
     {
       SUIT_OverrideCursor wc;
-      GEOM_Operation transaction( app, stlOp.in() );
+      GEOM_Operation transaction( app, stlOp.get() );
       
       try
       {
@@ -143,6 +146,7 @@ bool STLPlugin_GUI::importSTL( SUIT_Desktop* parent )
          entryList.append( so->GetID() );
          transaction.commit();
          GEOM_Displayer( study ).Display( main.in() );
+          main->UnRegister();
        }
        else
        {
@@ -181,8 +185,8 @@ bool STLPlugin_GUI::exportSTL( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "STLPluginEngine" );
-  GEOM::ISTLOperations_var stlOp = GEOM::ISTLOperations::_narrow( op );
-  if ( CORBA::is_nil( stlOp ) ) return false;
+  STLOpPtr stlOp = GEOM::ISTLOperations::_narrow( op );
+  if ( stlOp.isNull() ) return false;
 
   LightApp_SelectionMgr* sm = app->selectionMgr();
   if ( !sm ) return false;
@@ -215,7 +219,7 @@ bool STLPlugin_GUI::exportSTL( SUIT_Desktop* parent )
     
     SUIT_OverrideCursor wc;
     
-    GEOM_Operation transaction( app, stlOp.in() );
+    GEOM_Operation transaction( app, stlOp.get() );
     
     try
     {
index 061afb986e7db69e416c141dc6ed5b2fbae250ee..dca4e0713e6579925ec3e68f9bd19076cac69733 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 14d365cc1da220de2c87853a7248e0ce00385654..f05a8cd9a117bfd4367768b5c1b5492a05048276 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index a833ced7f21e55d70bdb7de6b41b6bd9e838f663..b755a0ea2d08c6334710d32c3b89276cc90bb498 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 8c2573d82eff50a7af5314a53246a53e600286ed..bbea7bdb76b4f23113efaf87d6f96d80327a8323 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 247b1be10f454012a4f495e6d07b3942b1e58296..40f4370337d386115560b26e2792171d290ce390 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 512b9251b43aa8d9ba05e7dcd362129af258453e..d90eea8e414dea235be12a3306816d8d22618436 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index c6c39daaa67d56f9a652131175d4478d92d83e4a..3438759cb20898ba627b365b3dfd75af61fedb6c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index ebb81ef068c092e8810b09ef2cfdd754d1546bd3..257b25e346c5954ca5adcf9b0cc6afdaccec5a56 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index f0733e1e04965839ae34564ab82608496ac1c61e..051010952b0e27e1e8cab6d973b34db8cfce0f1f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 40a96a8892991552066c949247564d21e72737d0..5ecca3362e860334fa3ac4972459dad27a3737d7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index fb695b844f78546f73e07e6267637868984e2fa0..cf38c932f4091054b42982ee6e410393dd19e99d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index f2a47a07b9ce04aa58ffad73399f37ecc5dca18e..dd32e583521e3ee77be051681e0160e0ae73e951 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 62314324e731176f5655dd74cf5b239fbc7bdbcf..6111e560d889e722edcdce87615cbb74e65919fa 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e4347f8290724c1c4258d9b2a7a42bdd147976aa..2c7ac4a07b941e65fc34a8a04eba630c4a02bf02 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS version="2.0" language="fr_US">
+<TS version="2.0" language="fr_FR">
 <context>
     <name>@default</name>
     <message>
@@ -47,7 +47,7 @@
     <name>STLPlugin_ExportDlg</name>
     <message>
         <source>ASCII</source>
-        <translation type="unfinished">Save as ASCII</translation>
+        <translation>Sauver au format ASCII</translation>
     </message>
     <message>
         <source>RELATIVE</source>
index 1c10df04fce0994e2f32bf10d2b0da49db785c0a..5054d2f6a31361be5ec1eaa1071b66e9545d81fe 100644 (file)
@@ -1,61 +1,61 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
-        <source>MEN_EXPORTSTL</source>
-        <translation type="unfinished">STL</translation>
+      <source>MEN_EXPORTSTL</source>
+      <translation>STLエクスポート</translation>
     </message>
     <message>
-        <source>TOP_EXPORTSTL</source>
-        <translation type="unfinished">Export STL</translation>
+      <source>TOP_EXPORTSTL</source>
+      <translation>STLエクスポート</translation>
     </message>
     <message>
-        <source>STB_EXPORTSTL</source>
-        <translation type="unfinished">Export STL</translation>
+      <source>STB_EXPORTSTL</source>
+      <translation>STLエクスポート</translation>
     </message>
     <message>
-        <source>MEN_IMPORTSTL</source>
-        <translation type="unfinished">STL</translation>
+      <source>MEN_IMPORTSTL</source>
+      <translation>STLインポート</translation>
     </message>
     <message>
-        <source>TOP_IMPORTSTL</source>
-        <translation type="unfinished">Import STL</translation>
+      <source>TOP_IMPORTSTL</source>
+      <translation>STLインポート</translation>
     </message>
     <message>
-        <source>STB_IMPORTSTL</source>
-        <translation type="unfinished">Import STL</translation>
+      <source>STB_IMPORTSTL</source>
+      <translation>STLインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>STLPlugin_GUI</name>
     <message>
-        <source>STL_FILES</source>
-        <translation type="unfinished">STL files( *.stl )</translation>
+      <source>STL_FILES</source>
+      <translation>STL ファイル( *.stl )</translation>
     </message>
     <message>
-        <source>EXPORT_TITLE</source>
-        <translation type="unfinished">Export STL</translation>
+      <source>EXPORT_TITLE</source>
+      <translation>STLエクスポート</translation>
     </message>
     <message>
-        <source>IMPORT_TITLE</source>
-        <translation type="unfinished">Import STL</translation>
+      <source>IMPORT_TITLE</source>
+      <translation>STLインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>STLPlugin_ExportDlg</name>
     <message>
-        <source>ASCII</source>
-        <translation type="unfinished">Save as ASCII</translation>
+      <source>ASCII</source>
+      <translation>アスキーテキスト</translation>
     </message>
     <message>
-        <source>RELATIVE</source>
-        <translation type="unfinished">Relative</translation>
+      <source>RELATIVE</source>
+      <translation>相対</translation>
     </message>
     <message>
-        <source>DEFLECTION</source>
-        <translation type="unfinished">Deflection</translation>
+      <source>DEFLECTION</source>
+      <translation>たわみ</translation>
     </message>
-</context>
+  </context>
 </TS>
index 8d2d3a2baaaac7a83845bd209e18757f2327163d..fc4bef842f29b312be1d9f50be56a23d63ddc18d 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -52,6 +52,7 @@ SET(ShHealOper_HEADERS
   ShHealOper_SplitCurve3d.hxx
   ShHealOper_ChangeOrientation.hxx
   ShHealOper_Tool.hxx
+  ShHealOper_ModifStats.hxx
   )
 # --- sources ---
 
index e48ba58d53c86af895a8cbb74cfabcf95669d7ba..93aeaade9dac4a9244c7c8e3d6f005d11541f022 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -73,6 +73,7 @@ Standard_Boolean ShHealOper_ChangeOrientation::Perform()
     while (itr.More()) {
       B.Add(myResultShape,itr.Value().Reversed());
       itr.Next();
+      myStatistics.AddModif("Face reversed");
     }
   }
   else if (myInitShape.ShapeType() == TopAbs_FACE)
@@ -82,6 +83,7 @@ Standard_Boolean ShHealOper_ChangeOrientation::Perform()
     while (itr.More()) {
       B.Add(myResultShape,itr.Value());
       itr.Next();
+      myStatistics.AddModif("Wire reversed");
     }
     myResultShape.Reverse();
   }
@@ -105,12 +107,14 @@ Standard_Boolean ShHealOper_ChangeOrientation::Perform()
     if ( myInitShape.ShapeType() == TopAbs_EDGE )
     {
       myResultShape = reversedEdges.First();
+      myStatistics.AddModif("Edge reversed");
     }
     else
     {
       BRepBuilderAPI_MakeWire wire;
       wire.Add( reversedEdges );
       myResultShape = wire;
+      myStatistics.AddModif("Wire reversed");
     }
     // myResultShape = myInitShape.EmptyCopied();
     // TopoDS_Iterator itr (myInitShape);
@@ -132,6 +136,13 @@ Standard_Boolean ShHealOper_ChangeOrientation::Perform()
       myResultShape.Orientation(TopAbs_REVERSED);
     else
       myResultShape.Orientation(TopAbs_FORWARD);
+
+    switch( myResultShape.ShapeType() ) {
+    case TopAbs_SOLID    : myStatistics.AddModif("Solid reversed"); break;
+    case TopAbs_COMPSOLID: myStatistics.AddModif("Compsolid reversed"); break;
+    case TopAbs_COMPOUND : myStatistics.AddModif("Compound reversed"); break;
+    default:;
+    }
   }
 
   return true;
index b59c3d73559568eff9cc5090f7fbf2909b9687af..60765494f757a3c42e8ae50daaf45b4219aa72cb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 67c69b50e5f2425cc67d3f68b9cf23c9acc16760..443642319be14b325c1eeb73e154a460f89dc3b5 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -252,10 +252,14 @@ Standard_Boolean ShHealOper_CloseContour::fixGaps(const Handle(ShapeExtend_WireD
         Standard_Integer ind1 = (ind2 >1 ? ind2 -1 : theWire->NbEdges());
         TopoDS_Edge aE1= theWire->Edge(ind1);
         TopoDS_Edge aE2= theWire->Edge(ind2);
-        if(!myModeVertex)
+        if(!myModeVertex) {
           buildEdge(aE1,aE2,theCommonFaces);
-        else
+          myStatistics.AddModif("An edge added to close a wire");
+        }
+        else {
           myMaxTolerance = RealLast();
+          myStatistics.AddModif("Tolerance of vertex increased to close a wire");
+        }
         if(ind2 == ind1) break;
       }
     }
@@ -268,8 +272,9 @@ Standard_Boolean ShHealOper_CloseContour::fixGaps(const Handle(ShapeExtend_WireD
 //function : checkOneFace
 //purpose  : 
 //=======================================================================
-Standard_Boolean ShHealOper_CloseContour::checkOneFace(const Handle(ShapeExtend_WireData)& theSewd,
-                                                       TopTools_SequenceOfShape& theCommonFaces) const
+Standard_Boolean
+ShHealOper_CloseContour::checkOneFace(const Handle(ShapeExtend_WireData)& theSewd,
+                                      TopTools_SequenceOfShape& theCommonFaces) const
 {
   TopTools_IndexedMapOfShape amapfaces;
   TopoDS_Edge aEdge1 = theSewd->Edge(1);
index 0c47a036bb1fd95c3ccd4a838f6dd38d3bb4423c..e9f0f2d62675fd12f8109b9d87207183019b9a5a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 3a910c55d01925fe395098b572921eb0610be7ab..eb0ae8f2997ca69e1da5f7140785ff7effeceb07 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 // Created:   30.04.04 16:44:47
 // Author:    Galina KULIKOVA
 //
+#include <BRep_Tool.hxx>
+#include <GCPnts_AbscissaPoint.hxx>
+#include <Geom2dAdaptor_Curve.hxx>
+#include <Geom2d_Curve.hxx>
+#include <GeomAPI_ProjectPointOnCurve.hxx>
+#include <GeomAdaptor_Curve.hxx>
+#include <Geom_Curve.hxx>
+#include <Precision.hxx>
 #include <ShHealOper_EdgeDivide.hxx>
-#include <ShapeUpgrade_WireDivide.hxx>
-#include <ShHealOper_SplitCurve3d.hxx>
 #include <ShHealOper_SplitCurve2d.hxx>
-#include <TopTools_ListOfShape.hxx>
-#include <TopTools_ListIteratorOfListOfShape.hxx>
-#include <BRep_Tool.hxx>
-#include <ShapeFix_Edge.hxx>
+#include <ShHealOper_SplitCurve3d.hxx>
 #include <ShapeAnalysis_Edge.hxx>
-#include <GeomAdaptor_Curve.hxx>
-#include <Geom2dAdaptor_Curve.hxx>
+#include <ShapeFix_Edge.hxx>
+#include <ShapeUpgrade_WireDivide.hxx>
+#include <TopExp.hxx>
+#include <TopExp_Explorer.hxx>
+#include <TopTools_ListIteratorOfListOfShape.hxx>
+#include <TopTools_ListOfShape.hxx>
+#include <TopTools_MapOfShape.hxx>
 #include <TopoDS.hxx>
-#include <Geom_Curve.hxx>
 #include <TopoDS_Face.hxx>
-#include <Geom2d_Curve.hxx>
-#include <GCPnts_AbscissaPoint.hxx>
-#include <TopExp.hxx>
-#include <Precision.hxx>
+
 //#include <.hxx>
 //#include <.hxx>
 //=======================================================================
@@ -113,10 +117,67 @@ Standard_Boolean ShHealOper_EdgeDivide::Perform(const TopoDS_Shape& theEdge,
   return myDone;
 }
 //=======================================================================
-//function : build
+//function : Perform
 //purpose  : 
 //=======================================================================
 
+Standard_Boolean ShHealOper_EdgeDivide::Perform(const TopoDS_Shape& theEdge, 
+                                                const TopoDS_Shape& thePoints)
+{
+  myDone = Standard_False;
+  myErrorStatus = ShHealOper_NotError;
+  if(theEdge.ShapeType() != TopAbs_EDGE) {
+    myErrorStatus = ShHealOper_InvalidParameters;
+    return myDone;
+  }
+  myDivideParamMode = true;
+  myEdge = TopoDS::Edge(theEdge);
+  Handle(TColStd_HSequenceOfReal) aSeqValues = new TColStd_HSequenceOfReal;
+
+  double aFirst,aLast;
+  Handle(Geom_Curve) aCurve = BRep_Tool::Curve(myEdge,aFirst,aLast);
+  if ( aCurve.IsNull() ) return false;
+  GeomAPI_ProjectPointOnCurve aProjector;
+  aProjector.Init( aCurve, aFirst, aLast );
+
+  TopTools_MapOfShape vMap;
+  TopExp_Explorer vertex( thePoints, TopAbs_VERTEX );
+  std::set< double > params; // to exclude equal params
+  for ( ; vertex.More(); vertex.Next() )
+  {
+    if ( !vMap.Add( vertex.Current() )) continue;
+    gp_Pnt p = BRep_Tool::Pnt( TopoDS::Vertex( vertex.Current() ));
+    aProjector.Perform( p );
+    if ( aProjector.NbPoints() > 0 )
+    {
+      double     u = double( aProjector.LowerDistanceParameter() );
+      double param = ( u - aFirst ) / ( aLast - aFirst );
+      params.insert( param );
+    }
+  }
+  // remove too close params
+  params.insert( 0 );
+  params.insert( 1 );
+  std::set< double >::iterator p2 = params.begin(), p1 = p2++;
+  while ( p2 != params.end() )
+  {
+    if ( Abs( *p2 - *p1 ) < 1e-3 ) // compare normalized params 
+      params.erase( p1 );
+    p1 = p2++;
+  }
+  p1 = params.begin(); ++p1; // skip aFirst
+  p2 = params.end();   --p2; // skip aLast
+  for ( ; p1 != p2; ++p1 )
+    aSeqValues->Append( *p1 );
+
+  myDone = build(aSeqValues);
+  return myDone;
+}
+//=======================================================================
+//function : build
+//purpose  :
+//=======================================================================
+
 Standard_Boolean ShHealOper_EdgeDivide::build(const Handle(TColStd_HSequenceOfReal)& theValues)
 {
   if(myEdge.IsNull() || !theValues->Length()) {
@@ -124,16 +185,16 @@ Standard_Boolean ShHealOper_EdgeDivide::build(const Handle(TColStd_HSequenceOfRe
     return Standard_False;
   }
 
-  Standard_Boolean has3d = Standard_False, 
-  has2d = Standard_False, 
-  hasPCurves = Standard_False;
-  
+  Standard_Boolean has3d = Standard_False,
+    has2d = Standard_False,
+    hasPCurves = Standard_False;
+
   //computation of the split values in dependance from specified mode and values.
   if(!computeValues(theValues, has3d,has2d,hasPCurves)) {
     myErrorStatus = ShHealOper_InvalidParameters;
     return Standard_False;
   }
-  
+
   //setting split values in the splitting curve tools.
   Handle(ShapeUpgrade_WireDivide) aSplitTool = new ShapeUpgrade_WireDivide;
   aSplitTool->Load(myEdge);
@@ -152,7 +213,7 @@ Standard_Boolean ShHealOper_EdgeDivide::build(const Handle(TColStd_HSequenceOfRe
     myErrorStatus = ShHealOper_InvalidParameters;
     return Standard_False;
   }
-  
+
   //split 3d curve and pcurve for each face reffering to edge.
   Standard_Boolean isDone = Standard_True;
   if(hasPCurves) {
@@ -174,7 +235,10 @@ Standard_Boolean ShHealOper_EdgeDivide::build(const Handle(TColStd_HSequenceOfRe
         myErrorStatus = ShHealOper_ErrorExecution;
   }
   if(isDone)
+  {
     myResultShape = myContext->Apply(myInitShape);
+    myStatistics.AddModif("Vertex added on edge", theValues->Length() );
+  }
   return isDone;
   
 }
index 4fd3ef0d62daea0531fad79204fde3f2a0f3ccd5..811874df03f1051600c6aea541579310553f2e29 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #ifndef ShHealOper_EdgeDivide_HeaderFile
 #define ShHealOper_EdgeDivide_HeaderFile
 
+#include <ShHealOper_Tool.hxx>
 #include <TColStd_HSequenceOfReal.hxx>
+#include <TColStd_SequenceOfReal.hxx>
 #include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
 #include <TopoDS_Edge.hxx>
-#include <TopoDS_Shape.hxx>
-#include <ShHealOper_Tool.hxx>
-#include <TColStd_SequenceOfReal.hxx>
 
 ///  Class ShHealOper_EdgeDivide
 //Intended for spitting edge in accordance to the specified mode and value.
@@ -59,7 +58,7 @@ class ShHealOper_EdgeDivide : public ShHealOper_Tool
   //specified mode and value.
   //If theDivideParamMode is equal to true edge will be splitted by parameter.
   //Else edge will be spliited by length (default true).
-  //theValue is koefficient for splitting from 0 to 1.
+  //theValue is coefficient for splitting from 0 to 1.
 
   Standard_EXPORT Standard_Boolean Perform(const TopoDS_Shape& theEdge, 
                                            const TColStd_SequenceOfReal& theValues,
@@ -67,7 +66,11 @@ class ShHealOper_EdgeDivide : public ShHealOper_Tool
   //Performs spitting of the specified edge in the accoradnce to
   //specified mode and sequence of values the same way as previous.
 
- protected:
+  Standard_EXPORT Standard_Boolean Perform(const TopoDS_Shape& theEdge, 
+                                           const TopoDS_Shape& thePoint);
+  //Performs spitting of the specified edge by projecting a point to it.
+
+protected:
   // ---------- PROTECTED METHODS ----------
 
 
index 114326a8b934a14f0a377ed0fd70319b2132214f..76585172c732b742adc0a8f80b94e5fa2a043b01 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -186,7 +186,10 @@ Standard_Boolean ShHealOper_FillHoles::Fill(const TopTools_SequenceOfShape& theF
       myDone = (addFace(aSurf,aWire,aCurves2d,aOrders,aSenses) || myDone);
   }
   if(myDone)
+  {
     myResultShape = myContext->Apply(myResultShape);
+    myStatistics.AddModif( "Face created to fill hole" , aSeqWires->Length() );
+  }
   return myDone;
 }
 
index a0156cdb6abda9eec1005bc89cc179617d8aecb5..2edb7e2674d9adefe5c8046a2c3acf477230e43f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
diff --git a/src/ShHealOper/ShHealOper_ModifStats.hxx b/src/ShHealOper/ShHealOper_ModifStats.hxx
new file mode 100644 (file)
index 0000000..b3fecf3
--- /dev/null
@@ -0,0 +1,78 @@
+// 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
+//
+
+// File      : ShHealOper_ModifStats.hxx
+// Created   : Mon Dec  1 15:29:48 2014
+
+#ifndef __ShHealOper_ModifStats_HXX__
+#define __ShHealOper_ModifStats_HXX__
+
+#include <string>
+#include <set>
+
+/*!
+ * \brief Structure describing modifications done in a shape
+ */
+class Standard_EXPORT ShHealOper_ModifStats
+{
+ public:
+
+  struct Standard_EXPORT Datum
+  {
+    std::string myModif; // what is done
+    mutable int myCount; // how many times (in how many sub-shapes)
+
+    Datum( const std::string& txt, int cnt=0 ): myModif( txt ), myCount(cnt) {}
+    bool operator< ( const Datum& o ) const { return myModif < o.myModif; }
+  };
+
+  // record a modification
+  void AddModif( const std::string& modifText, int nb=1 )
+  {
+    std::set< Datum >::iterator d = myData.insert( Datum( modifText )).first;
+    d->myCount += nb;
+  }
+
+  // add data from another ShHealOper_ModifStats
+  void Add( const ShHealOper_ModifStats& stats )
+  {
+    if ( myData.empty() ) myData = stats.myData;
+    else {
+      std::set< Datum >::const_iterator d = stats.myData.begin();
+      for ( ; d != stats.myData.end(); ++d )
+        AddModif( d->myModif, d->myCount );
+    }
+  }
+
+  // return all recorder modifications
+  const std::set< Datum >& GetData() const { return myData; }
+
+  // clear all statistics
+  void Clear() { myData.clear(); }
+
+ protected:
+
+  std::set< Datum > myData;
+
+};
+
+#endif
index c8063e57cd815f6090e00b08fe9231a35fad8341..1bdaa13aff0d2c40baca3a8d1597be70e5f8dee7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 1be119033fb8065ee6142e57d83d76d667cb9705..0808a81eb75cf9c321973b793fba33caca1ca55e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 698cedaf9666e03ce7dad72b8cdc978b1cdc713e..18ebd58e881a4a580b495cf9241382af03aebc90 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -137,6 +137,9 @@ Standard_Boolean ShHealOper_RemoveInternalWires::removeWire(const TopoDS_Face& t
       }
     }
   }
+  if ( isremove )
+    myStatistics.AddModif( "Wire removed" );
+
   return isremove;
 }
 //=======================================================================
index 723479b7a341c564409d1333b8e9ae3ebf9a561a..3f74dae8c7bb915fb0da8384ef47019342a16411 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 183b17a4613a4682cac8d40ffac5cd2a9651ce5f..3991dff35f15f94f384e1031048264aae4a98c3b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <TopoDS.hxx>
 #include <TopoDS_Iterator.hxx>
 #include <TopTools_MapOfShape.hxx>
+
+namespace
+{
+  bool cmpNbSubShapes( const TopoDS_Shape& s1, const TopoDS_Shape& s2, TopAbs_ShapeEnum t)
+  {
+    int nbNew = 0, nbOld = 0;
+    TopExp_Explorer exp;
+    TopTools_MapOfShape shMap;
+    for ( exp.Init( s1, t ); exp.More(); exp.Next() ) if ( shMap.Add( exp.Current() ) ) ++nbNew;
+    shMap.Clear();
+    for ( exp.Init( s2, t ); exp.More(); exp.Next() ) if ( shMap.Add( exp.Current() ) ) ++nbOld;
+    return nbNew != nbOld;
+  }
+}
+
 //=======================================================================
 //function : ShHealOper_Sewing()
 //purpose  : Constructor
 //=======================================================================
 
-
 ShHealOper_Sewing::ShHealOper_Sewing (const TopoDS_Shape& theShape,
                                      const Standard_Real theTolerance)
 {
@@ -248,15 +262,11 @@ Standard_Boolean ShHealOper_Sewing::getModifications(const TopoDS_Shape& theShap
 
 Standard_Boolean ShHealOper_Sewing::isSewed(const TopoDS_Shape& theShape) const
 {
-  Standard_Integer nbNewShells =0;
-  Standard_Integer nbOldShells =0;
-  TopExp_Explorer aExpShells(theShape,TopAbs_SHELL);
-  for( ; aExpShells.More(); aExpShells.Next())
-    nbNewShells++;
-  for( aExpShells.Init(myInitShape,TopAbs_SHELL); aExpShells.More(); aExpShells.Next())
-    nbOldShells++;
-  return (nbNewShells != nbOldShells);
+  return cmpNbSubShapes( theShape, myInitShape, TopAbs_SHELL ) ||
+         cmpNbSubShapes( theShape, myInitShape, TopAbs_EDGE )  ||
+         cmpNbSubShapes( theShape, myInitShape, TopAbs_VERTEX );
 }
+
 //=======================================================================
 //function : deleteFreeEdges
 //purpose  : 
index a2e61e7e6d06ce6e5f4ac27d807d87e9f4c3606b..96e9065089fc228adb4fd20e595157ecc2ca286a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index fa516e924777db9356c6957b0815e04c0c603736..b9a8c1d2ccae79b1175ea6012e2693e9f7971c27 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <TopoDS_Iterator.hxx>
 #include <TColStd_IndexedDataMapOfTransientTransient.hxx>
 #include <TNaming_CopyShape.hxx>
+#include <TopTools_DataMapIteratorOfDataMapOfShapeShape.hxx>
+#include <ShapeExtend_MsgRegistrator.hxx>
+#include <ShapeExtend_DataMapOfShapeListOfMsg.hxx>
+#include <ShapeExtend_DataMapIteratorOfDataMapOfShapeListOfMsg.hxx>
+#include <Message_ListOfMsg.hxx>
+#include <Message_ListIteratorOfListOfMsg.hxx>
+#include <Message_Msg.hxx>
 
 //=======================================================================
 //function : ShHealOper_ShapeProcess()
@@ -52,8 +59,9 @@ ShHealOper_ShapeProcess::ShHealOper_ShapeProcess (  ) :
    //myResource = new Resource_Manager("ShHealing");
    myPrefix = "ShapeProcess";
    mySaveHistoryMode = Standard_False;
-   myLevel = TopAbs_FACE;
+   myLevel = TopAbs_EDGE;
    myDone = Standard_False;
+   myOperations.Context()->SetDetalisation ( TopAbs_EDGE );
 }
 
 //=======================================================================
@@ -63,23 +71,22 @@ ShHealOper_ShapeProcess::ShHealOper_ShapeProcess (  ) :
 
 ShHealOper_ShapeProcess::ShHealOper_ShapeProcess (const TCollection_AsciiString& theNameResource,
                                                   const TCollection_AsciiString& thePrefix ) :
-       myOperations(theNameResource.ToCString(),thePrefix.ToCString())
+  myOperations(theNameResource.ToCString(),thePrefix.ToCString())
 {
   //myResource = new Resource_Manager(theNameResource);
   myPrefix = thePrefix;
   mySaveHistoryMode = Standard_False;
-  myLevel = TopAbs_FACE;
+  myLevel = TopAbs_EDGE;
   myDone = Standard_False;
 }
 
 //=======================================================================
 //function : Perform
-//purpose  : 
+//purpose  :
 //=======================================================================
-void ShHealOper_ShapeProcess::Perform(const TopoDS_Shape& theOldShape, 
-                                           TopoDS_Shape& theNewShape)
+void ShHealOper_ShapeProcess::Perform(const TopoDS_Shape& theOldShape,
+                                      TopoDS_Shape&       theNewShape)
 {
-  
   myMapModifications.Clear();
   //ShapeProcessAPI_ApplySequence aOperations(myResource,myPrefix.ToCString());
   //myDone = Standard_False;
@@ -99,12 +106,35 @@ void ShHealOper_ShapeProcess::Perform(const TopoDS_Shape& theOldShape,
   myDone = !anOldShape.IsSame(theNewShape);
   if(!myDone) {
     Standard_Real aendTol =aSatol.Tolerance(theNewShape,0);
-    myDone = (fabs(ainitTol - aendTol) > Precision::Confusion()); 
+    myDone = (fabs(ainitTol - aendTol) > Precision::Confusion());
+    if ( myDone ) {
+      if ( ainitTol > aendTol )
+        myStatistics.AddModif( "Tolerance fixed (decreased)" );
+      else
+        myStatistics.AddModif( "Tolerance fixed (increased)" );
+    }
+  }
+
+  // fill myStatistics with messages
+  Handle(ShapeExtend_MsgRegistrator) msg = myOperations.Context()->Messages();
+  const ShapeExtend_DataMapOfShapeListOfMsg& shape2msg = msg->MapShape();
+  ShapeExtend_DataMapIteratorOfDataMapOfShapeListOfMsg s2msg( shape2msg );
+  for ( ; s2msg.More(); s2msg.Next() )
+  {
+    const Message_ListOfMsg & msgList = s2msg.Value();
+    Message_ListIteratorOfListOfMsg mIt( msgList );
+    for ( ; mIt.More(); mIt.Next() )
+    {
+      Message_Msg& m = mIt.Value();
+      TCollection_AsciiString txt = m.Get();
+      myStatistics.AddModif( txt.ToCString() );
+    }
   }
 }
+
 //=======================================================================
 //function : SetOperators
-//purpose  : 
+//purpose  :
 //=======================================================================
 
 void ShHealOper_ShapeProcess::SetOperators(const TColStd_SequenceOfAsciiString& theSeqOperators)
@@ -127,18 +157,18 @@ void ShHealOper_ShapeProcess::SetOperators(const TColStd_SequenceOfAsciiString&
 //purpose  : 
 //=======================================================================
 
-void  ShHealOper_ShapeProcess::SetParameter(const TCollection_AsciiString& theNameParam,
-                                    const TCollection_AsciiString& theVal)
+void ShHealOper_ShapeProcess::SetParameter(const TCollection_AsciiString& theNameParam,
+                                           const TCollection_AsciiString& theVal)
 {
   TCollection_AsciiString anameParam(myPrefix);
   anameParam += ".";
   anameParam+= theNameParam;
-  if(theVal.IsIntegerValue())
-    myOperations.Context()->ResourceManager()->
-      SetResource(anameParam.ToCString(),theVal.IntegerValue());
-  else if(theVal.IsRealValue())
+  if(theVal.IsRealValue())
     myOperations.Context()->ResourceManager()->
       SetResource(anameParam.ToCString(),theVal.RealValue());
+  else if(theVal.IsIntegerValue())
+    myOperations.Context()->ResourceManager()->
+      SetResource(anameParam.ToCString(),theVal.IntegerValue());
   else
     myOperations.Context()->ResourceManager()->
       SetResource(anameParam.ToCString(),theVal.ToCString());
@@ -171,14 +201,14 @@ Standard_Boolean ShHealOper_ShapeProcess::GetOperators(TColStd_SequenceOfAsciiSt
 //=======================================================================
 
 Standard_Boolean ShHealOper_ShapeProcess::GetParameter(const TCollection_AsciiString& theNameParam,
-                                       TCollection_AsciiString& theVal)
+                                                       TCollection_AsciiString& theVal)
 {
   TCollection_AsciiString namePar(myPrefix);
   namePar += ".";
   namePar += theNameParam;
   if(!myOperations.Context()->ResourceManager()->Find(namePar.ToCString()))
     return Standard_False;
-  
+
   theVal = myOperations.Context()->ResourceManager()->Value(namePar.ToCString());
   return Standard_True;
 }
index f83f6e10ec63acd95c92e015d1a08b767a995ded..77ee79fe8ba54f63dd480395424215cea6dcf98e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #include <ShapeProcessAPI_ApplySequence.hxx>
 #include <ShapeProcess_ShapeContext.hxx>
 
+#include "ShHealOper_Tool.hxx"
+
 ///  Class ShHealOper_ShapeProcess
 //Class for performing Shape healing operations on the shape.
 
-class ShHealOper_ShapeProcess 
+class ShHealOper_ShapeProcess : public ShHealOper_Tool
 {
  public:
   // ---------- PUBLIC METHODS ----------
index 0975834007cb88a60605c6c3b4d13e46cd1a07bf..950966739689a9b05ec0e04a08d6993ecb5e8b2f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 6ba52faa9680350dc8cd6a76d4ce47d503755974..de23ef729fe24ed76679d117589b60c440909b8d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index ccc04f14a1871211235d7d8e930fbb7862fa7c20..52d8437f9a6aa1cf2b294f2c6efdf5e619f2d775 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e1d191cdd6ad737de6cceb072059a73d16da477e..c39d607357c730f0fa6b9d5e9880242fbafd1977 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 9fe7ed9feb582a1d0b2ec880022d9b89a9264e1a..bbf0942ff83efd2b0f1f35a314a463cc92f50de0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index 6fb6133462728c9af9131600e1d4b7d8b221c91e..3b0d3359b2cf8d1365d3781efb3209b5f015f7bf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -59,4 +59,5 @@ void ShHealOper_Tool::Init(const TopoDS_Shape& theShape)
   myErrorStatus =ShHealOper_NotError;
   myInitShape = theShape;
   myContext->Apply(myInitShape);
+  myStatistics.Clear();
 }
index a8bec37bd3eaade9f33bd6a4f98d77403a3c9fae..e9d500737171b559aa810c19ba48e0eab1890a3a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 #ifndef ShHealOper_Tool_HeaderFile
 #define ShHealOper_Tool_HeaderFile
 
-#include <MMgt_TShared.hxx>
 #include <ShapeBuild_ReShape.hxx>
 #include <TopoDS_Shape.hxx>
 
+#include "ShHealOper_ModifStats.hxx"
+
 ///  Class ShHealOper_Tool
 //
 //enumeration for definition of the status of the error if operation failed
@@ -69,12 +70,12 @@ class ShHealOper_Tool
   }
   //Returns modified shape obtained after operation from initial shape.
 
-  inline Standard_Boolean IsDone() const 
+  inline Standard_Boolean IsDone() const
   {
     return myDone;
   }
   //Returns status of the operation.
-  
+
   inline void SetContext(Handle(ShapeBuild_ReShape)& theContext)
   {
     myContext = theContext;
@@ -91,17 +92,31 @@ class ShHealOper_Tool
   {
     return myErrorStatus;
   }
- protected:
+
+  ShHealOper_ModifStats& GetStatistics()
+  {
+    return myStatistics;
+  }
+
+  const ShHealOper_ModifStats& GetStatistics() const
+  {
+    return myStatistics;
+  }
+  // Returns statistics of what is done
+
+protected:
   // ---------- PROTECTED FIELDS ----------
 
   Handle(ShapeBuild_ReShape) myContext;
-  TopoDS_Shape myInitShape;
-  TopoDS_Shape myResultShape;
-  Standard_Boolean myDone;
-  ShHealOper_Error myErrorStatus;
- public:
-// Declaration of CASCADE RTTI
-//DEFINE_STANDARD_RTTI (ShHealOper_Tool)
+  TopoDS_Shape               myInitShape;
+  TopoDS_Shape               myResultShape;
+  Standard_Boolean           myDone;
+  ShHealOper_Error           myErrorStatus;
+  ShHealOper_ModifStats      myStatistics;
+
+public:
+  // Declaration of CASCADE RTTI
+  //DEFINE_STANDARD_RTTI (ShHealOper_Tool)
 };
 
 // Definition of HANDLE object using Standard_DefineHandle.hxx
index d4dcfbcc8a6a31a6523c31bc3ad111c1fb1f71dc..61f4072c682435c3bd92263ddbe4e2c624f2a2f4 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 0369b23f6782f249c7684c55997de27637b4ce96..4d3adaa3b0034b3c2997c5a4bb9cb116216c8664 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index bb0a44ddb088496b491b83466905d08bda24aacb..b3941e6f5858f86f7838564796d77754ead9154e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
index e20407629bbe7dea910038c96b63d9b82f4d376e..2b4b75858891ce0f7f6ce2796e9b77d64e9642e6 100755 (executable)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
@@ -66,6 +66,7 @@ SET(_uic_files
 
 SET(TransformationGUI_HEADERS
   TransformationGUI.h
+  TransformationGUI_ExtensionDlg.h
   TransformationGUI_MultiTranslationDlg.h
   TransformationGUI_MultiRotationDlg.h
   TransformationGUI_TranslationDlg.h
@@ -74,11 +75,13 @@ SET(TransformationGUI_HEADERS
   TransformationGUI_ScaleDlg.h
   TransformationGUI_OffsetDlg.h
   TransformationGUI_ProjectionDlg.h
+  TransformationGUI_ProjectionOnCylDlg.h
   TransformationGUI_PositionDlg.h
   )
 
 # header files / to be processed by moc
 SET(_moc_HEADERS
+  TransformationGUI_ExtensionDlg.h
   TransformationGUI_MultiTranslationDlg.h
   TransformationGUI_MultiRotationDlg.h
   TransformationGUI_TranslationDlg.h
@@ -87,6 +90,7 @@ SET(_moc_HEADERS
   TransformationGUI_ScaleDlg.h
   TransformationGUI_OffsetDlg.h
   TransformationGUI_ProjectionDlg.h
+  TransformationGUI_ProjectionOnCylDlg.h
   TransformationGUI_PositionDlg.h
   )
 
@@ -100,6 +104,7 @@ QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
 
 SET(TransformationGUI_SOURCES
   TransformationGUI.cxx
+  TransformationGUI_ExtensionDlg.cxx
   TransformationGUI_MultiTranslationDlg.cxx
   TransformationGUI_MultiRotationDlg.cxx
   TransformationGUI_TranslationDlg.cxx
@@ -108,6 +113,7 @@ SET(TransformationGUI_SOURCES
   TransformationGUI_ScaleDlg.cxx
   TransformationGUI_OffsetDlg.cxx
   TransformationGUI_ProjectionDlg.cxx
+  TransformationGUI_ProjectionOnCylDlg.cxx
   TransformationGUI_PositionDlg.cxx
   ${_moc_SOURCES}
   ${_uic_files}
index eb62c1f1812ed5887e60e3ad50c2df85b9388208..943e2126b91cc432c41279dd619eacc82afd384a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -39,6 +39,7 @@
 #include <SalomeApp_Study.h>
 #include <SALOME_ListIO.hxx>
 
+#include "TransformationGUI_ExtensionDlg.h"          // Method EXTENSION
 #include "TransformationGUI_MultiTranslationDlg.h"   // Method MULTI TRANSLATION
 #include "TransformationGUI_MultiRotationDlg.h"      // Method MULTI ROTATION
 #include "TransformationGUI_TranslationDlg.h"        // Method TRANSLATION
@@ -48,6 +49,7 @@
 #include "TransformationGUI_OffsetDlg.h"             // Method OFFSET
 #include "TransformationGUI_ProjectionDlg.h"         // Method PROJECTION
 #include "TransformationGUI_PositionDlg.h"           // Method POSITION
+#include "TransformationGUI_ProjectionOnCylDlg.h"    // Method PROJECTION ON CYLINDER
 
 //=======================================================================
 // function : TransformationGUI()
@@ -101,6 +103,9 @@ bool TransformationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
   case GEOMOp::OpProjection:     // PROJECTION
     aDlg = new TransformationGUI_ProjectionDlg( getGeometryGUI(), parent );
     break;
+  case GEOMOp::OpProjOnCyl:      // PROJECTION ON CYLINDER
+    aDlg = new TransformationGUI_ProjectionOnCylDlg( getGeometryGUI(), parent );
+    break;
   case GEOMOp::OpMultiTranslate: // MULTI TRANSLATION
     aDlg = new TransformationGUI_MultiTranslationDlg( getGeometryGUI(), parent );
     break;
@@ -151,6 +156,9 @@ bool TransformationGUI::OnGUIEvent( int theCommandID, SUIT_Desktop* parent )
       } // for (; aSelIt.More(); aSelIt.Next())
     }
     break;
+  case GEOMOp::OpExtension:     // EXTENSION
+    aDlg = new TransformationGUI_ExtensionDlg( getGeometryGUI(), parent );
+    break;
   default:
     app->putInfo( tr( "GEOM_PRP_COMMAND" ).arg( theCommandID ) );
     break;
index 0088a6ff6f6b9b51c56836c20601061198b001fd..0672f850b83b3ab789c91385f4210f535521db8c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
diff --git a/src/TransformationGUI/TransformationGUI_ExtensionDlg.cxx b/src/TransformationGUI/TransformationGUI_ExtensionDlg.cxx
new file mode 100644 (file)
index 0000000..130060b
--- /dev/null
@@ -0,0 +1,438 @@
+// 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
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : TransformationGUI_ExtensionDlg.cxx
+// Author : Sergey KHROMOV, Open CASCADE S.A.S.
+
+#include "TransformationGUI_ExtensionDlg.h"
+#include <GEOMBase.h>
+#include <GeometryGUI.h>
+#include <GEOMImpl_Types.hxx>
+
+#include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+#include <LightApp_SelectionMgr.h>
+
+#include <TColStd_MapOfInteger.hxx>
+
+#include <QApplication>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QLabel>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+
+
+//=================================================================================
+// class    : TransformationGUI_ExtensionDlg
+// purpose  :
+//=================================================================================
+TransformationGUI_ExtensionDlg::TransformationGUI_ExtensionDlg
+                      (GeometryGUI* theGeometryGUI, QWidget* parent,
+                       bool modal, Qt::WindowFlags fl)
+  : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl),
+    myObjLbl         (0),
+    myUMinLbl        (0),
+    myUMaxLbl        (0),
+    myVMinLbl        (0),
+    myVMaxLbl        (0),
+    mySelButton      (0),
+    myEditObjName    (0),
+    myUMinSpinBox    (0),
+    myUMaxSpinBox    (0),
+    myVMinSpinBox    (0),
+    myVMaxSpinBox    (0)
+{
+  QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
+  QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_EXTEND_EDGE")));
+  QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_EXTEND_FACE")));
+
+  setWindowTitle(tr("GEOM_EXTENSION_TITLE"));
+
+  /***************************************************************/
+  mainFrame()->GroupConstructors->setTitle(tr ("GEOM_EXTENSION"));
+  mainFrame()->RadioButton1->setIcon(image1);
+  mainFrame()->RadioButton2->setIcon(image2);
+  mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
+  mainFrame()->RadioButton3->close();
+
+  QGroupBox *aGrp = new QGroupBox(tr("GEOM_ARGUMENTS"));
+
+  myObjLbl        = new QLabel;
+  myUMinLbl       = new QLabel;
+  myUMaxLbl       = new QLabel;
+  myVMinLbl       = new QLabel;
+  myVMaxLbl       = new QLabel;
+  mySelButton     = new QPushButton;
+  myEditObjName   = new QLineEdit;
+  myUMinSpinBox   = new SalomeApp_DoubleSpinBox;
+  myUMaxSpinBox   = new SalomeApp_DoubleSpinBox;
+  myVMinSpinBox   = new SalomeApp_DoubleSpinBox;
+  myVMaxSpinBox   = new SalomeApp_DoubleSpinBox;
+
+  myVMinLbl->setText(tr("GEOM_EXTENSION_MIN_V"));
+  myVMaxLbl->setText(tr("GEOM_EXTENSION_MAX_V"));
+  mySelButton->setIcon(image0);
+
+  QGridLayout *aGrpLayout = new QGridLayout(aGrp);
+
+  aGrpLayout->setMargin(9);
+  aGrpLayout->setSpacing(6);
+  aGrpLayout->addWidget(myObjLbl,      0, 0);
+  aGrpLayout->addWidget(myUMinLbl,     1, 0);
+  aGrpLayout->addWidget(myUMaxLbl,     2, 0);
+  aGrpLayout->addWidget(myVMinLbl,     3, 0);
+  aGrpLayout->addWidget(myVMaxLbl,     4, 0);
+  aGrpLayout->addWidget(mySelButton,   0, 1);
+  aGrpLayout->addWidget(myEditObjName, 0, 2);
+  aGrpLayout->addWidget(myUMinSpinBox, 1, 1, 1, 2);
+  aGrpLayout->addWidget(myUMaxSpinBox, 2, 1, 1, 2);
+  aGrpLayout->addWidget(myVMinSpinBox, 3, 1, 1, 2);
+  aGrpLayout->addWidget(myVMaxSpinBox, 4, 1, 1, 2);
+
+  myVMinLbl->hide();
+  myVMaxLbl->hide();
+  myVMinSpinBox->hide();
+  myVMaxSpinBox->hide();
+
+  QVBoxLayout* layout = new QVBoxLayout(centralWidget());
+  layout->setMargin(0); layout->setSpacing(6);
+  layout->addWidget(aGrp);
+  /***************************************************************/
+
+  setHelpFileName("extension_operation_page.html");
+
+  /* Initialisations */
+  Init();
+}
+
+//=================================================================================
+// function : ~GenerationGUI_FillingDlg()
+// purpose  : Destroys the object and frees any allocated resources
+//=================================================================================
+TransformationGUI_ExtensionDlg::~TransformationGUI_ExtensionDlg()
+{
+  // no need to delete child widgets, Qt does it all for us
+}
+
+//=================================================================================
+// function : Init()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ExtensionDlg::Init()
+{
+  /* init variables */
+  showOnlyPreviewControl();
+  myEditCurrentArgument = myEditObjName;
+
+  double aStep = 0.1;
+  /* min, max, step and decimals for spin boxes & initial values */
+  initSpinBox(myUMinSpinBox, -MAX_NUMBER, MAX_NUMBER, aStep, "parametric_precision");
+  initSpinBox(myUMaxSpinBox, -MAX_NUMBER, MAX_NUMBER, aStep, "parametric_precision");
+  initSpinBox(myVMinSpinBox, -MAX_NUMBER, MAX_NUMBER, aStep, "parametric_precision");
+  initSpinBox(myVMaxSpinBox, -MAX_NUMBER, MAX_NUMBER, aStep, "parametric_precision");
+
+  myUMinSpinBox->setValue(0.);
+  myUMaxSpinBox->setValue(1.);
+  myVMinSpinBox->setValue(0.);
+  myVMaxSpinBox->setValue(1.);
+
+  /* signals and slots connections */
+  connect(myGeomGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
+  connect(myGeomGUI, SIGNAL(SignalCloseAllDialogs()),        this, SLOT(ClickOnCancel()));
+
+  connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
+
+  connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+  connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+  connect(mySelButton,   SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+
+  connect(myUMinSpinBox, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+  connect(myUMaxSpinBox, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+  connect(myVMinSpinBox, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+  connect(myVMaxSpinBox, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+
+  connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
+
+  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+  initName(tr("GEOM_EXTENSION_EDGE_NAME"));
+  resize(100,100);
+
+  ConstructorsClicked(0);
+}
+
+//=================================================================================
+// function : SetDoubleSpinBoxStep()
+// purpose  : Double spin box management
+//=================================================================================
+void TransformationGUI_ExtensionDlg::SetDoubleSpinBoxStep(double step)
+{
+  myUMinSpinBox->setSingleStep(step);
+  myUMaxSpinBox->setSingleStep(step);
+  myVMinSpinBox->setSingleStep(step);
+  myVMaxSpinBox->setSingleStep(step);
+}
+
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose  : Radio button management
+//=================================================================================
+void TransformationGUI_ExtensionDlg::ConstructorsClicked (int constructorId)
+{
+  switch (constructorId) {
+  case 0: // Extend edge
+    {
+      TColStd_MapOfInteger aMap;
+
+      aMap.Add(GEOM_EDGE);
+      globalSelection(aMap);
+
+      myObjLbl->setText(tr("GEOM_EDGE"));
+      myUMinLbl->setText(tr("GEOM_EXTENSION_MIN"));
+      myUMaxLbl->setText(tr("GEOM_EXTENSION_MAX"));
+      myVMinLbl->hide();
+      myVMaxLbl->hide();
+      myVMinSpinBox->hide();
+      myVMaxSpinBox->hide();
+
+      initName(tr("GEOM_EXTENSION_EDGE_NAME"));
+
+      break;
+    }
+  case 1: // Extend face
+    {
+      TColStd_MapOfInteger aMap;
+
+      aMap.Add(GEOM_FACE);
+      globalSelection(aMap);
+
+      myObjLbl->setText(tr("GEOM_FACE"));
+      myUMinLbl->setText(tr("GEOM_EXTENSION_MIN_U"));
+      myUMaxLbl->setText(tr("GEOM_EXTENSION_MAX_U"));
+      myVMinLbl->show();
+      myVMaxLbl->show();
+      myVMinSpinBox->show();
+      myVMaxSpinBox->show();
+
+      initName(tr("GEOM_EXTENSION_FACE_NAME"));
+
+      break;
+    }
+  default:
+    break;
+  }
+
+  myBase.nullify();
+  qApp->processEvents();
+  updateGeometry();
+  resize(minimumSizeHint());
+
+  SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ExtensionDlg::ClickOnOk()
+{
+  setIsApplyAndClose(true);
+  if (ClickOnApply())
+    ClickOnCancel();
+}
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose  :
+//=================================================================================
+bool TransformationGUI_ExtensionDlg::ClickOnApply()
+{
+  if (!onAccept())
+    return false;
+
+  initName();
+
+  return true;
+}
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose  : Called when selection as changed or other case
+//=================================================================================
+void TransformationGUI_ExtensionDlg::SelectionIntoArgument()
+{
+  erasePreview();
+  myEditCurrentArgument->setText("");
+
+  if (myEditCurrentArgument == myEditObjName) {
+    const TopAbs_ShapeEnum aType =
+      getConstructorId() == 0 ? TopAbs_EDGE: TopAbs_FACE;
+    GEOM::GeomObjPtr aSelectedObject = getSelected(aType);
+
+    if (aSelectedObject) {
+      myEditCurrentArgument->setText(GEOMBase::GetName(aSelectedObject.get()));
+      myBase = aSelectedObject;
+    } else {
+      myBase.nullify();
+    }
+  }
+
+  processPreview();
+}
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ExtensionDlg::SetEditCurrentArgument()
+{
+  QPushButton* send = (QPushButton*)sender();
+
+  if (send == mySelButton) {
+    myEditObjName->setFocus();
+    myEditCurrentArgument = myEditObjName;
+    SelectionIntoArgument();
+  }
+}
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ExtensionDlg::ActivateThisDialog()
+{
+  GEOMBase_Skeleton::ActivateThisDialog();
+  connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
+           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+
+  ConstructorsClicked(getConstructorId());
+}
+
+//=================================================================================
+// function : enterEvent()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ExtensionDlg::enterEvent(QEvent*)
+{
+  if (!mainFrame()->GroupConstructors->isEnabled())
+    ActivateThisDialog();
+}
+
+//=================================================================================
+// function : ValueChangedInSpinBox()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ExtensionDlg::ValueChangedInSpinBox(double newValue)
+{
+  processPreview();
+}
+
+//=================================================================================
+// function : createOperation
+// purpose  :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr TransformationGUI_ExtensionDlg::createOperation()
+{
+  return getGeomEngine()->GetIShapesOperations(getStudyId());
+}
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool TransformationGUI_ExtensionDlg::isValid(QString& msg)
+{
+  bool ok = (myUMinSpinBox->isValid(msg, !IsPreview()) &&
+             myUMaxSpinBox->isValid(msg, !IsPreview()) &&
+             myVMinSpinBox->isValid(msg, !IsPreview()) &&
+             myVMaxSpinBox->isValid(msg, !IsPreview()) &&
+             myBase);
+  return ok;
+}
+
+//=================================================================================
+// function : execute
+// purpose  :
+//=================================================================================
+bool TransformationGUI_ExtensionDlg::execute(ObjectList& objects)
+{
+  bool res = false;
+  GEOM::GEOM_IShapesOperations_var anOper =
+    GEOM::GEOM_IShapesOperations::_narrow(getOperation());
+  GEOM::GEOM_Object_var anObj;
+
+  switch (getConstructorId()) {
+  case 0:
+    anObj = anOper->ExtendEdge(myBase.get(), myUMinSpinBox->value(),
+                               myUMaxSpinBox->value());
+    if (!anObj->_is_nil() && !IsPreview())
+    {
+         QStringList aParameters;
+         aParameters << myUMinSpinBox->text();
+         aParameters << myUMaxSpinBox->text();
+         anObj->SetParameters(aParameters.join(":").toUtf8().constData());
+    }
+    res   = true;
+    break;
+  case 1:
+    anObj = anOper->ExtendFace(myBase.get(), myUMinSpinBox->value(),
+                               myUMaxSpinBox->value(),
+                               myVMinSpinBox->value(),
+                               myVMaxSpinBox->value());
+    if (!anObj->_is_nil() && !IsPreview())
+    {
+         QStringList aParameters;
+         aParameters << myUMinSpinBox->text();
+         aParameters << myUMaxSpinBox->text();
+         aParameters << myVMinSpinBox->text();
+         aParameters << myVMaxSpinBox->text();
+         anObj->SetParameters(aParameters.join(":").toUtf8().constData());
+    }
+    res   = true;
+    break;
+  default:
+    break;
+  }
+
+  if (!anObj->_is_nil()) {
+    objects.push_back(anObj._retn());
+  }
+
+  return res;
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> TransformationGUI_ExtensionDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myBase;
+  return res;
+}
diff --git a/src/TransformationGUI/TransformationGUI_ExtensionDlg.h b/src/TransformationGUI/TransformationGUI_ExtensionDlg.h
new file mode 100644 (file)
index 0000000..1884280
--- /dev/null
@@ -0,0 +1,84 @@
+// 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
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : TransformationGUI_ExtensionDlg.h
+// Author : Sergey KHROMOV, Open CASCADE S.A.S.
+//
+#ifndef TRANSFORMATIONGUI_EXTENSIONDLG_H
+#define TRANSFORMATIONGUI_EXTENSIONDLG_H
+
+#include "GEOMBase_Skeleton.h"
+#include "GEOM_GenericObjPtr.h"
+
+class DlgRef_3Sel4Spin2Check;
+
+/**
+ *  This is a dialog for ExtendEdge and ExtendFace functionality
+ */
+class TransformationGUI_ExtensionDlg : public GEOMBase_Skeleton
+{ 
+  Q_OBJECT
+
+public:
+  TransformationGUI_ExtensionDlg(GeometryGUI*, QWidget* = 0,
+                                 bool = false, Qt::WindowFlags = 0);
+  ~TransformationGUI_ExtensionDlg();
+
+protected:
+  // redefined from GEOMBase_Helper
+  virtual GEOM::GEOM_IOperations_ptr createOperation();
+  virtual bool                       isValid( QString& );
+  virtual bool                       execute( ObjectList& );    
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
+
+private:
+  void                               Init();
+  void                               enterEvent(QEvent *);
+
+private:
+
+  QLabel                            *myObjLbl;
+  QLabel                            *myUMinLbl;
+  QLabel                            *myUMaxLbl;
+  QLabel                            *myVMinLbl;
+  QLabel                            *myVMaxLbl;
+  QPushButton                       *mySelButton;
+  QLineEdit                         *myEditObjName;
+  SalomeApp_DoubleSpinBox           *myUMinSpinBox;
+  SalomeApp_DoubleSpinBox           *myUMaxSpinBox;
+  SalomeApp_DoubleSpinBox           *myVMinSpinBox;
+  SalomeApp_DoubleSpinBox           *myVMaxSpinBox;
+  GEOM::GeomObjPtr                   myBase;
+    
+private slots:
+  void                               ClickOnOk();
+  bool                               ClickOnApply();
+  void                               ActivateThisDialog();
+  void                               SelectionIntoArgument();
+  void                               SetEditCurrentArgument();
+  void                               ValueChangedInSpinBox( double );
+  void                               ConstructorsClicked( int );
+  void                               SetDoubleSpinBoxStep( double );
+};
+
+#endif // TRANSFORMATIONGUI_EXTENSIONDLG_H
index a030f689c7e6dbb5d9de8ca9fb4c8062b8f33029..ebc844cc1bb3ccbfc36e9387caacf6a5836f1ef6 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -266,14 +266,14 @@ void TransformationGUI_MirrorDlg::SetEditCurrentArgument()
 
     switch (getConstructorId()) {
     case 0:
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+      localSelection(TopAbs_VERTEX);
       break;
     case 1:
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
       break;
     case 2:
       globalSelection(GEOM_PLANE);
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_FACE);
+      localSelection(TopAbs_FACE);
       break;
     }
 
@@ -454,3 +454,17 @@ void TransformationGUI_MirrorDlg::addSubshapesToStudy()
     }
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> TransformationGUI_MirrorDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  if ( GroupPoints->CheckButton1->isChecked() ) {
+    res.append(myObjects);
+    res << myArgument;
+  }
+  return res;
+}
index e75b583bb58db7e53e8a38dd94f85f202d84e211..4ccae5231972b59f51f8ec16634974871a18fa7d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -52,6 +52,7 @@ protected:
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index ac972f413da2acfb3fef4b38884922f55f4b8f33..f54ee69a396be7a00e17452934e48a0cfaaa9795 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -330,7 +330,7 @@ void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
   else if (send == GroupArgs->PushButton2) {
     myEditCurrentArgument = GroupArgs->LineEdit2;
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
 
     GroupArgs->PushButton1->setDown(false);
     GroupArgs->LineEdit1->setEnabled(false);
@@ -550,6 +550,17 @@ void TransformationGUI_MultiRotationDlg::addSubshapesToStudy()
   }
 }
 
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> TransformationGUI_MultiRotationDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myBase << myVector;
+  return res;
+}
+
 //=================================================================================
 // function : restoreSubShapes
 // purpose  :
index 904c718bffb1c2a6621e0e0c5ec63267c5f75e6d..56b2be2844d6b429d7de3407fa446ef01b8bc180 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -98,6 +98,7 @@ protected:
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index aca92aa5489ea7a870f2c03ce86c5c4384dbfed2..1051b8abf542ae5a5c3816764a7bb167496875cf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -429,7 +429,7 @@ void TransformationGUI_MultiTranslationDlg::SetEditCurrentArgument()
   else if (send == GroupPoints->PushButton2) {
     myEditCurrentArgument = GroupPoints->LineEdit2;
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
 
     GroupPoints->PushButton1->setDown(false);
     GroupPoints->LineEdit1->setEnabled(false);
@@ -445,7 +445,7 @@ void TransformationGUI_MultiTranslationDlg::SetEditCurrentArgument()
   else if (send == GroupDimensions->PushButton2) {
     myEditCurrentArgument = GroupDimensions->LineEdit2;
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
 
     GroupDimensions->PushButton1->setDown(false);
     GroupDimensions->PushButton3->setDown(false);
@@ -455,7 +455,7 @@ void TransformationGUI_MultiTranslationDlg::SetEditCurrentArgument()
   else if (send == GroupDimensions->PushButton3) {
     myEditCurrentArgument = GroupDimensions->LineEdit3;
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+    localSelection(TopAbs_EDGE);
 
     GroupDimensions->PushButton1->setDown(false);
     GroupDimensions->PushButton2->setDown(false);
@@ -713,6 +713,17 @@ void TransformationGUI_MultiTranslationDlg::addSubshapesToStudy()
   }
 }
 
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> TransformationGUI_MultiTranslationDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myBase << myVectorU << myVectorV;
+  return res;
+}
+
 //=================================================================================
 // function : restoreSubShapes
 // purpose  :
index ed7446beff7e2d9dd5cd5d8d87334944967fed83..b0f6bb03d5cfd86926c93652131320295f9f8872 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -53,6 +53,7 @@ protected:
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 3b3ac24138b7c32906b99fb4976cb127da2cfbe3..8affede004e937f53cc28b7d0f968eb14580c8b1 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -328,3 +328,15 @@ void TransformationGUI_OffsetDlg::CreateCopyModeChanged()
 {
   mainFrame()->GroupBoxName->setEnabled( GroupPoints->CheckButton1->isChecked() );
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> TransformationGUI_OffsetDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  if ( GroupPoints->CheckButton1->isChecked() )
+    res.append( myObjects );
+  return res;
+}
index 259a641e94dc588a54854cd4bfbba87e66607ab2..556836696f4c5b90c131ff4c783cb6fa08797bc4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -51,6 +51,7 @@ protected:
   virtual bool                       isValid( QString& );
   virtual bool                       execute( ObjectList& );
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
   
 private:
   void                               Init();
index 4927fd99103049b02df2d59e5b760f82b0928751..fd0283e1407e314f4dd75efd98b715ad7b803a75 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -259,7 +259,7 @@ void TransformationGUI_PositionDlg::ConstructorsClicked (int constructorId)
 void TransformationGUI_PositionDlg::SelectionTypeButtonClicked()
 {
   if ( Group1->CheckButton2->isChecked() ) {
-    localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+    localSelection( TopAbs_EDGE );
   } else {
     TColStd_MapOfInteger aMap;
     aMap.Add(GEOM_WIRE);
@@ -433,7 +433,7 @@ void TransformationGUI_PositionDlg::SetEditCurrentArgument()
     Group1->CheckButton2->setEnabled(true);
 
     if ( Group1->CheckButton2->isChecked() ) {
-      localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
+      localSelection( TopAbs_EDGE );
     } else {
       TColStd_MapOfInteger aMap;
       aMap.Add(GEOM_WIRE);
@@ -608,3 +608,17 @@ void TransformationGUI_PositionDlg::addSubshapesToStudy()
   if ( getConstructorId() == 2 )
     GEOMBase::PublishSubObject( myPath.get() );
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> TransformationGUI_PositionDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  if ( Group1->CheckButton1->isChecked() ) {
+    res.append(myObjects);
+    res << myStartLCS << myEndLCS << myPath;
+  }
+  return res;
+}
index 67d4b3a760a937bbb14a32aefb85ff6601a06a13..fb1c29bc74578ed45545c485742ed655c6b96c34 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -52,6 +52,7 @@ protected:
   virtual bool                       execute( ObjectList& );
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
   virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index be7d741bf43a91aad16303166b3c88ea1ffe066e..186e9e0c827c5d00d10b9c4b198c2c59af97cbd2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
 
 #include <TColStd_MapOfInteger.hxx>
 
+namespace
+{
+  enum EOperationType { PROJ_ON_FACE = 0, PROJ_ON_WIRE, PROJ_ON_EDGE };
+}
+
 //=================================================================================
 // class    : TransformationGUI_ProjectionDlg()
 // purpose  : Constructs a TransformationGUI_ProjectionDlg which is a child of 'parent', with the
@@ -49,23 +54,20 @@ TransformationGUI_ProjectionDlg::TransformationGUI_ProjectionDlg (GeometryGUI* t
                                       QWidget* parent, bool modal, Qt::WindowFlags fl)
   : GEOMBase_Skeleton(theGeometryGUI, parent, modal, fl)
 {
-  QPixmap image0 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_PROJECTION")));
   QPixmap image1 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_SELECT")));
+  QPixmap image2 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_PROJECTION_ON_FACE")));
+  QPixmap image3 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_PROJECTION_ON_WIRE")));
+  QPixmap image4 (SUIT_Session::session()->resourceMgr()->loadPixmap("GEOM", tr("ICON_DLG_PROJECTION_ON_EDGE")));
 
   setWindowTitle(tr("GEOM_PROJECTION_TITLE"));
 
-  mainFrame()->GroupConstructors->setTitle(tr("GEOM_PROJECTION"));
-  mainFrame()->RadioButton1->setIcon(image0);
-  mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
-  mainFrame()->RadioButton2->close();
-  mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
-  mainFrame()->RadioButton3->close();
+  mainFrame()->RadioButton1->setIcon(image2);
+  mainFrame()->RadioButton2->setIcon(image3);
+  mainFrame()->RadioButton3->setIcon(image4);
 
   myGroup = new DlgRef_2Sel (centralWidget());
 
   myGroup->GroupBox1->setTitle(tr("GEOM_ARGUMENTS"));
-  myGroup->TextLabel1->setText(tr("GEOM_SOURCE_OBJECT"));
-  myGroup->TextLabel2->setText(tr("GEOM_TARGET_OBJECT"));
   myGroup->PushButton1->setIcon(image1);
   myGroup->PushButton2->setIcon(image1);
   myGroup->LineEdit1->setReadOnly(true);
@@ -108,6 +110,8 @@ void TransformationGUI_ProjectionDlg::Init()
   showOnlyPreviewControl();
  
   // signals and slots connections
+  connect(this, SIGNAL( constructorsClicked( int )),
+          this, SLOT  ( ConstructorsClicked( int )));
   connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
 
@@ -115,20 +119,17 @@ void TransformationGUI_ProjectionDlg::Init()
   connect(myGroup->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
 
   connect(((SalomeApp_Application*)(SUIT_Session::session()->activeApplication()))->selectionMgr(),
-           SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
+          SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
 
-  initName(mainFrame()->GroupConstructors->title());
+  initName( windowTitle() );
 
   setTabOrder(mainFrame()->GroupConstructors, mainFrame()->GroupBoxName);
   setTabOrder(mainFrame()->GroupBoxName, mainFrame()->GroupMedium);
   setTabOrder(mainFrame()->GroupMedium, mainFrame()->GroupButtons);
 
-  mainFrame()->RadioButton1->setFocus();
+  //mainFrame()->RadioButton1->setFocus();
+  ConstructorsClicked( 0 );
 
-  globalSelection(GEOM_ALLSHAPES);
-
-  myGroup->PushButton1->click();
-  SelectionIntoArgument();
   resize(100,100);
 }
 
@@ -153,8 +154,8 @@ bool TransformationGUI_ProjectionDlg::ClickOnApply()
     return false;
 
   initName();
-  // activate selection and connect selection manager
-  myGroup->PushButton1->click();
+  ConstructorsClicked( getConstructorId() );
+
   return true;
 }
 
@@ -166,9 +167,25 @@ void TransformationGUI_ProjectionDlg::SelectionIntoArgument()
 {
   myEditCurrentArgument->setText("");
 
-  GEOM::GeomObjPtr aSelectedObject = getSelected(TopAbs_SHAPE);
+  GEOM::GeomObjPtr aSelectedObject;
+  if ( myEditCurrentArgument == myGroup->LineEdit1 ) // what to project
+    switch(  getConstructorId() ) {
+    case PROJ_ON_FACE: aSelectedObject = getSelected(TopAbs_SHAPE); break;
+    case PROJ_ON_WIRE:
+    case PROJ_ON_EDGE: aSelectedObject = getSelected(TopAbs_VERTEX); break;
+    default:;
+    }
+  else
+    switch(  getConstructorId() ) { // where to project
+    case PROJ_ON_FACE: aSelectedObject = getSelected(TopAbs_FACE); break;
+    case PROJ_ON_WIRE: aSelectedObject = getSelected(TopAbs_WIRE); break;
+    case PROJ_ON_EDGE: aSelectedObject = getSelected(TopAbs_EDGE); break;
+    default:;
+    }
+
   TopoDS_Shape aShape;
-  if (aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) && !aShape.IsNull()) {
+  if (aSelectedObject && GEOMBase::GetShape(aSelectedObject.get(), aShape) && !aShape.IsNull())
+  {
     QString aName = GEOMBase::GetName(aSelectedObject.get());
     myEditCurrentArgument->setText(aName);
 
@@ -193,6 +210,7 @@ void TransformationGUI_ProjectionDlg::SelectionIntoArgument()
     if      (myEditCurrentArgument == myGroup->LineEdit1) myObject1.nullify();
     else if (myEditCurrentArgument == myGroup->LineEdit2) myObject2.nullify();
   }
+  processPreview();
 }
 
 //=================================================================================
@@ -203,25 +221,48 @@ void TransformationGUI_ProjectionDlg::SetEditCurrentArgument()
 {
   QPushButton* send = (QPushButton*)sender();
 
-  if (send == myGroup->PushButton1) {
+  globalSelection(); // close local contexts, if any
+
+  if (send == myGroup->PushButton1) // what to project
+  {
     myEditCurrentArgument = myGroup->LineEdit1;
 
     myGroup->PushButton2->setDown(false);
     myGroup->LineEdit2->setEnabled(false);
 
-    TColStd_MapOfInteger aMap;
-    aMap.Add( GEOM_POINT );
-    aMap.Add( GEOM_EDGE );
-    aMap.Add( GEOM_WIRE );
-    globalSelection( aMap );
+    switch ( getConstructorId() ) {
+    case PROJ_ON_FACE: {
+      TColStd_MapOfInteger aMap;
+      aMap.Add( GEOM_POINT );
+      aMap.Add( GEOM_EDGE );
+      aMap.Add( GEOM_WIRE );
+      globalSelection( aMap );
+      std::list<int> needTypes;
+      needTypes.push_back( TopAbs_VERTEX ), needTypes.push_back( TopAbs_EDGE ), needTypes.push_back( TopAbs_WIRE );
+      localSelection(needTypes);
+      break;
+    }
+    case PROJ_ON_WIRE:
+    case PROJ_ON_EDGE: {
+      localSelection(TopAbs_VERTEX);
+      break;
+    }
+    default:;
+    }
   }
-  else if (send == myGroup->PushButton2) {
+  else if (send == myGroup->PushButton2) // where to project
+  {
     myEditCurrentArgument = myGroup->LineEdit2;
 
     myGroup->PushButton1->setDown(false);
     myGroup->LineEdit1->setEnabled(false);
 
-    globalSelection( GEOM_FACE );
+    switch ( getConstructorId() ) {
+    case PROJ_ON_FACE: localSelection(TopAbs_FACE); break;
+    case PROJ_ON_WIRE: localSelection(TopAbs_WIRE); break;
+    case PROJ_ON_EDGE: localSelection(TopAbs_EDGE); break;
+    default:;
+    }
   }
 
   // enable line edit
@@ -229,6 +270,8 @@ void TransformationGUI_ProjectionDlg::SetEditCurrentArgument()
   myEditCurrentArgument->setFocus();
   // after setFocus(), because it will be setDown(false) when loses focus
   send->setDown(true);
+
+  SelectionIntoArgument();
 }
 
 //=================================================================================
@@ -281,9 +324,62 @@ bool TransformationGUI_ProjectionDlg::execute (ObjectList& objects)
   GEOM::GEOM_Object_var anObj;
 
   GEOM::GEOM_ITransformOperations_var anOper = GEOM::GEOM_ITransformOperations::_narrow(getOperation());
-  anObj = anOper->ProjectShapeCopy(myObject1.get(), myObject2.get());
+  anObj = anOper->ProjectShapeCopy( myObject1.get(), myObject2.get() );
   if (!anObj->_is_nil())
     objects.push_back(anObj._retn());
 
   return true;
 }
+
+//=================================================================================
+// function : ConstructorsClicked()
+// purpose  : Radio button management
+//=================================================================================
+void TransformationGUI_ProjectionDlg::ConstructorsClicked( int constructorId )
+{
+  myObject1.nullify();
+  myObject2.nullify();
+  myGroup->LineEdit1->setText( "" );
+  myGroup->LineEdit2->setText( "" );
+
+  switch ( constructorId ) {
+  case PROJ_ON_FACE:
+    mainFrame()->GroupConstructors->setTitle(tr("GEOM_PROJECTION_ON_FACE"));
+    myGroup->TextLabel1->setText(tr("GEOM_PROJ_ON_FACE_SOURCE"));
+    myGroup->TextLabel2->setText(tr("GEOM_PROJ_ON_FACE_TARGET"));
+    break;
+  case PROJ_ON_EDGE:
+    mainFrame()->GroupConstructors->setTitle(tr("GEOM_PROJECTION_ON_EDGE"));
+    myGroup->TextLabel1->setText(tr("GEOM_PROJ_ON_EDGE_SOURCE"));
+    myGroup->TextLabel2->setText(tr("GEOM_PROJ_ON_EDGE_TARGET"));
+    break;
+  case PROJ_ON_WIRE:
+    mainFrame()->GroupConstructors->setTitle(tr("GEOM_PROJECTION_ON_WIRE"));
+    myGroup->TextLabel1->setText(tr("GEOM_PROJ_ON_WIRE_SOURCE"));
+    myGroup->TextLabel2->setText(tr("GEOM_PROJ_ON_WIRE_TARGET"));
+    break;
+  default:;
+  }
+  myGroup->PushButton1->click();
+}
+
+//=================================================================================
+// function : addSubshapeToStudy
+// purpose  : virtual method to add new SubObjects if local selection
+//=================================================================================
+void TransformationGUI_ProjectionDlg::addSubshapesToStudy()
+{
+  GEOMBase::PublishSubObject( myObject1.get() );
+  GEOMBase::PublishSubObject( myObject2.get() );
+}
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> TransformationGUI_ProjectionDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  res << myObject1 << myObject2;
+  return res;
+}
index b20e110c8d961ea64d5a78fa68ce5a50d3558e76..505c283966f309ef076dd601d0732fb050409375 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -49,6 +49,8 @@ protected:
   virtual GEOM::GEOM_IOperations_ptr createOperation();
   virtual bool                       isValid (QString&);
   virtual bool                       execute (ObjectList&);
+  virtual void                       addSubshapesToStudy();
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
@@ -66,6 +68,7 @@ private slots:
   void                               SetEditCurrentArgument();
   void                               SelectionIntoArgument();
   void                               ActivateThisDialog();
+  void                               ConstructorsClicked( int constructorId );
 };
 
 #endif // TRANSFORMATIONGUI_PROJECTIONDLG_H
diff --git a/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx b/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.cxx
new file mode 100644 (file)
index 0000000..21125e5
--- /dev/null
@@ -0,0 +1,381 @@
+// Copyright (C) 2007-2014  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
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : TransformationGUI_ProjectionOnCylDlg.cxx
+// Author : Sergey KHROMOV, Open CASCADE S.A.S.
+
+#include "TransformationGUI_ProjectionOnCylDlg.h"
+
+#include <GeometryGUI.h>
+#include <GEOMBase.h>
+#include <GEOMImpl_Types.hxx>
+
+#include <SUIT_Session.h>
+#include <SUIT_ResourceMgr.h>
+#include <SalomeApp_Application.h>
+#include <SalomeApp_DoubleSpinBox.h>
+#include <LightApp_SelectionMgr.h>
+
+#include <QCheckBox>
+#include <QGridLayout>
+#include <QGroupBox>
+#include <QLineEdit>
+#include <QPushButton>
+#include <QRadioButton>
+
+#include <TColStd_MapOfInteger.hxx>
+
+//=================================================================================
+// class    : TransformationGUI_ProjectionOnCylDlg()
+// purpose  : Constructs a TransformationGUI_ProjectionOnCylDlg which is
+//            a child of 'parent', with the name 'name' and widget flags set to
+//            'f'. The dialog will by default be modeless, unless you set
+//            'modal' to TRUE to construct a modal dialog.
+//=================================================================================
+TransformationGUI_ProjectionOnCylDlg::TransformationGUI_ProjectionOnCylDlg
+(GeometryGUI* theGeometryGUI, QWidget* parent, bool modal, Qt::WindowFlags fl)
+  : GEOMBase_Skeleton (theGeometryGUI, parent, modal, fl),
+    myObjectName      (0),
+    mySelButton       (0),
+    myRadiusSpin      (0),
+    myStartAngleSpin  (0),
+    myUseAngleLen     (0),
+    myAngleLenSpin    (0),
+    myAngleRotSpin    (0)
+{
+  SUIT_ResourceMgr* aResMgr = myGeomGUI->getApp()->resourceMgr();
+  QPixmap image0 (aResMgr->loadPixmap("GEOM", tr("ICO_DLG_PROJ_ON_CYL")));
+  QPixmap image1 (aResMgr->loadPixmap("GEOM", tr("ICON_SELECT")));
+
+  setWindowTitle(tr("GEOM_PROJ_ON_CYL_TITLE"));
+
+  /***************************************************************/
+  mainFrame()->GroupConstructors->setTitle(tr("GEOM_PROJECTION_TITLE"));
+  mainFrame()->RadioButton1->setIcon(image0);
+  mainFrame()->RadioButton2->setAttribute(Qt::WA_DeleteOnClose);
+  mainFrame()->RadioButton2->close();
+  mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
+  mainFrame()->RadioButton3->close();
+
+  QGroupBox   *aGrpParams    =
+    new QGroupBox(tr("GEOM_ARGUMENTS"), centralWidget());
+  QGridLayout *aParamsLayout  = new QGridLayout(aGrpParams);
+  QLabel      *anObjLbl       = new QLabel(tr("GEOM_OBJECT"), aGrpParams);
+  QLabel      *aRadiusLbl     = new QLabel(tr("GEOM_RADIUS"), aGrpParams);
+  QLabel      *aStartAngleLbl =
+    new QLabel(tr("GEOM_PROJ_ON_CYL_START_ANGLE"), aGrpParams);
+  QLabel      *anAngleLenLbl  =
+    new QLabel(tr("GEOM_PROJ_ON_CYL_LENGTH_ANGLE"), aGrpParams);
+  QLabel      *anAngleRotLbl  =
+    new QLabel(tr("GEOM_PROJ_ON_CYL_ROTATION_ANGLE"), aGrpParams);
+
+  myObjectName     = new QLineEdit(aGrpParams);
+  mySelButton      = new QPushButton(aGrpParams);
+  myRadiusSpin     = new SalomeApp_DoubleSpinBox(aGrpParams);
+  myStartAngleSpin = new SalomeApp_DoubleSpinBox(aGrpParams);
+  myUseAngleLen    = new QCheckBox(aGrpParams);
+  myAngleLenSpin   = new SalomeApp_DoubleSpinBox(aGrpParams);
+  myAngleRotSpin   = new SalomeApp_DoubleSpinBox(aGrpParams);
+
+  myObjectName->setReadOnly(true);
+  mySelButton->setIcon(image1);
+  mySelButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+  myUseAngleLen->setChecked(false);
+
+  aParamsLayout->setMargin(9);
+  aParamsLayout->setSpacing(6);
+  aParamsLayout->addWidget(anObjLbl,         0, 1);
+  aParamsLayout->addWidget(mySelButton,      0, 2);
+  aParamsLayout->addWidget(myObjectName,     0, 3);
+  aParamsLayout->addWidget(aRadiusLbl,       1, 1);
+  aParamsLayout->addWidget(myRadiusSpin,     1, 2, 1, 2);
+  aParamsLayout->addWidget(aStartAngleLbl,   2, 1);
+  aParamsLayout->addWidget(myStartAngleSpin, 2, 2, 1, 2);
+  aParamsLayout->addWidget(myUseAngleLen,    3, 0);
+  aParamsLayout->addWidget(anAngleLenLbl,    3, 1);
+  aParamsLayout->addWidget(myAngleLenSpin,   3, 2, 1, 2);
+  aParamsLayout->addWidget(anAngleRotLbl,    4, 1);
+  aParamsLayout->addWidget(myAngleRotSpin,   4, 2, 1, 2);
+
+  QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
+  layout->setMargin( 0 ); layout->setSpacing( 6 );
+  layout->addWidget( aGrpParams );
+
+  /***************************************************************/
+
+  setHelpFileName("projection_on_cylinder_operation_page.html");
+
+  Init();
+}
+
+//=================================================================================
+// function : ~TransformationGUI_ProjectionOnCylDlg()
+// purpose  : Destroys the object and frees any allocated resources
+//=================================================================================
+TransformationGUI_ProjectionOnCylDlg::~TransformationGUI_ProjectionOnCylDlg()
+{
+  // no need to delete child widgets, Qt does it all for us
+}
+
+//=================================================================================
+// function : Init()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ProjectionOnCylDlg::Init()
+{
+  showOnlyPreviewControl();
+
+  SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+  double aStep = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
+  double aSpecificStep = 5;
+  double aRadius       = 100.0;
+  double aStartAngle   = 0.;
+  double anAngleLen    = 360.;
+  double aRotAngle     = 0.;
+
+  initSpinBox(myRadiusSpin, 0.00001, COORD_MAX, aStep, "length_precision");
+  initSpinBox(myStartAngleSpin, -180., 180., aSpecificStep, "angle_precision");
+  initSpinBox(myAngleLenSpin, 0.00001, COORD_MAX, aSpecificStep, "angle_precision");
+  initSpinBox(myAngleRotSpin, -180., 180., aSpecificStep, "angle_precision");
+
+  myRadiusSpin->setValue(aRadius);
+  myStartAngleSpin->setValue(aStartAngle);
+  myAngleLenSpin->setValue(anAngleLen);
+  myAngleRotSpin->setValue(aRotAngle);
+
+  myObjectName->setText("");
+  myUseAngleLen->setChecked(true);
+
+  // signals and slots connections
+  connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
+  connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
+
+  connect(mySelButton,      SIGNAL(clicked()),            this, SLOT(SetEditCurrentArgument()));
+  connect(myRadiusSpin,     SIGNAL(valueChanged(double)), this, SLOT(processPreview()));
+  connect(myStartAngleSpin, SIGNAL(valueChanged(double)), this, SLOT(processPreview()));
+  connect(myAngleLenSpin,   SIGNAL(valueChanged(double)), this, SLOT(processPreview()));
+  connect(myAngleRotSpin,   SIGNAL(valueChanged(double)), this, SLOT(processPreview()));
+  connect(myUseAngleLen,    SIGNAL(clicked()),            this, SLOT(SetUseLengthAngle()));
+
+  connect(myGeomGUI->getApp()->selectionMgr(),SIGNAL(currentSelectionChanged()),
+          this, SLOT(SelectionIntoArgument()));
+
+  initName(tr("GEOM_PROJECTION_NAME"));
+
+  buttonOk()->setEnabled(false);
+  buttonApply()->setEnabled(false);
+
+  activateSelection();
+  SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : ClickOnOk()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ProjectionOnCylDlg::ClickOnOk()
+{
+  setIsApplyAndClose( true );
+  if (ClickOnApply())
+    ClickOnCancel();
+}
+
+//=================================================================================
+// function : ClickOnApply()
+// purpose  :
+//=================================================================================
+bool TransformationGUI_ProjectionOnCylDlg::ClickOnApply()
+{
+  if ( !onAccept() )
+    return false;
+
+  initName();
+  return true;
+}
+
+//=================================================================================
+// function : SelectionIntoArgument()
+// purpose  : Called when selection is changed or on dialog initialization or activation
+//=================================================================================
+void TransformationGUI_ProjectionOnCylDlg::SelectionIntoArgument()
+{
+  erasePreview();
+  myObj = GEOM::GEOM_Object::_nil();
+
+  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+  SALOME_ListIO aSelList;
+  aSelMgr->selectedObjects(aSelList);
+
+  if (aSelList.Extent() == 1) {
+    // Single object is selected.
+    GEOM::GEOM_Object_var aSelectedObject =
+      GEOMBase::ConvertIOinGEOMObject( aSelList.First() );
+
+    if (aSelectedObject->_is_nil()) {
+      // Null object.
+      myObjectName->setText("");
+      buttonOk()->setEnabled(false);
+      buttonApply()->setEnabled(false);
+    } else {
+      // Not Null object.
+      myObj = aSelectedObject;
+      myObjectName->setText(GEOMBase::GetName(myObj));
+      buttonOk()->setEnabled(true);
+      buttonApply()->setEnabled(true);
+    }
+  } else {
+    // Not a single object is selected.
+    myObjectName->setText("");
+    buttonOk()->setEnabled(false);
+    buttonApply()->setEnabled(false);
+  }
+
+  processPreview();
+}
+
+//=================================================================================
+// function : SetEditCurrentArgument()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ProjectionOnCylDlg::SetEditCurrentArgument()
+{
+  myObjectName->setFocus();
+  myEditCurrentArgument = myObjectName;
+  SelectionIntoArgument();
+}
+
+//=================================================================================
+// function : SetUseLengthAngle()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ProjectionOnCylDlg::SetUseLengthAngle()
+{
+  myAngleLenSpin->setEnabled(myUseAngleLen->isChecked());
+  processPreview();
+}
+
+//=================================================================================
+// function : activateSelection
+// purpose  : activate selection of wires or faces
+//=================================================================================
+void TransformationGUI_ProjectionOnCylDlg::activateSelection()
+{
+  TColStd_MapOfInteger aMap;
+
+  aMap.Add(GEOM_WIRE);
+  aMap.Add(GEOM_FACE);
+  globalSelection(aMap);
+}
+
+//=================================================================================
+// function : ActivateThisDialog()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ProjectionOnCylDlg::ActivateThisDialog()
+{
+  GEOMBase_Skeleton::ActivateThisDialog();
+  connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+           this, SLOT( SelectionIntoArgument() ) );
+
+  activateSelection();
+}
+
+//=================================================================================
+// function : enterEvent()
+// purpose  :
+//=================================================================================
+void TransformationGUI_ProjectionOnCylDlg::enterEvent (QEvent*)
+{
+  if (!mainFrame()->GroupConstructors->isEnabled())
+    ActivateThisDialog();
+}
+
+//=================================================================================
+// function : createOperation
+// purpose  :
+//=================================================================================
+GEOM::GEOM_IOperations_ptr TransformationGUI_ProjectionOnCylDlg::createOperation()
+{
+  return getGeomEngine()->GetITransformOperations(getStudyId());
+}
+
+//=================================================================================
+// function : isValid
+// purpose  :
+//=================================================================================
+bool TransformationGUI_ProjectionOnCylDlg::isValid (QString &msg)
+{
+  bool isOk = false;
+
+  if (!myObj->_is_nil()                      &&
+       myRadiusSpin->isValid(msg, !IsPreview()) &&
+       myStartAngleSpin->isValid(msg, !IsPreview()) &&
+       myAngleRotSpin->isValid(msg, !IsPreview())) {
+    if (myUseAngleLen->isChecked()) {
+      // Check length angle spin.
+      isOk =  myAngleLenSpin->isValid(msg, !IsPreview());
+    } else {
+      // Don't check length angle spin.
+      isOk = true;
+    }
+  }
+
+  return isOk;
+}
+
+//=================================================================================
+// function : execute
+// purpose  :
+//=================================================================================
+bool TransformationGUI_ProjectionOnCylDlg::execute (ObjectList& objects)
+{
+  GEOM::GEOM_ITransformOperations_var anOper  =
+    GEOM::GEOM_ITransformOperations::_narrow(getOperation());
+
+  double aRadius      = myRadiusSpin->value();
+  double aStartAngle  = myStartAngleSpin->value()*M_PI/180.;
+  double aRotAngle    = myAngleRotSpin->value()*M_PI/180.;
+  double aLengthAngle = -1.;
+
+  if (myUseAngleLen->isChecked()) {
+    aLengthAngle = myAngleLenSpin->value()*M_PI/180.;
+  }
+
+  GEOM::GEOM_Object_var anObj = anOper->MakeProjectionOnCylinder
+    (myObj, aRadius, aStartAngle, aLengthAngle, aRotAngle);
+
+  if (!anObj->_is_nil()) {
+    if (!IsPreview()) {
+      QStringList aParameters;
+      aParameters << myRadiusSpin->text();
+      aParameters << myStartAngleSpin->text();
+      if (myUseAngleLen->isChecked())
+        aParameters << myAngleLenSpin->text();
+      aParameters << myAngleRotSpin->text();
+      anObj->SetParameters(aParameters.join(":").toUtf8().constData());
+    }
+    objects.push_back(anObj._retn());
+  }
+
+  return true;
+}
diff --git a/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.h b/src/TransformationGUI/TransformationGUI_ProjectionOnCylDlg.h
new file mode 100644 (file)
index 0000000..eab7ee3
--- /dev/null
@@ -0,0 +1,79 @@
+// Copyright (C) 2007-2014  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
+//
+
+// GEOM GEOMGUI : GUI for Geometry component
+// File   : TransformationGUI_ProjectionOnCylDlg.h
+// Author : Sergey KHROMOV, Open CASCADE S.A.S.
+//
+#ifndef TRANSFORMATIONGUI_PROJECTIONONCYLDLG_H
+#define TRANSFORMATIONGUI_PROJECTIONONCYLDLG_H
+
+
+#include "GEOMBase_Skeleton.h"
+
+
+//=================================================================================
+// class    : TransformationGUI_ProjectionOnCylDlg
+// purpose  :
+//=================================================================================
+class TransformationGUI_ProjectionOnCylDlg : public GEOMBase_Skeleton
+{ 
+  Q_OBJECT
+
+public:
+  TransformationGUI_ProjectionOnCylDlg(GeometryGUI*, QWidget* = 0,
+                                       bool = false, Qt::WindowFlags = 0);
+  ~TransformationGUI_ProjectionOnCylDlg();
+
+protected:
+  // redefined from GEOMBase_Helper
+  virtual GEOM::GEOM_IOperations_ptr createOperation();
+  virtual bool                       isValid(QString &msg);
+  virtual bool                       execute(ObjectList &);
+
+private:
+  void                               Init();
+  void                               enterEvent( QEvent* );
+  void                               activateSelection();
+  
+private slots:
+  void                               ClickOnOk();
+  bool                               ClickOnApply();
+  void                               ActivateThisDialog();
+  void                               SelectionIntoArgument();
+  void                               SetEditCurrentArgument();
+  void                               SetUseLengthAngle();
+
+private:
+
+  GEOM::GEOM_Object_var              myObj;
+  QLineEdit                         *myObjectName;
+  QPushButton                       *mySelButton;
+  SalomeApp_DoubleSpinBox           *myRadiusSpin;
+  SalomeApp_DoubleSpinBox           *myStartAngleSpin;
+  QCheckBox                         *myUseAngleLen;
+  SalomeApp_DoubleSpinBox           *myAngleLenSpin;
+  SalomeApp_DoubleSpinBox           *myAngleRotSpin;
+
+};
+
+#endif // TRANSFORMATIONGUI_PROJECTIONONCYLDLG_H
index 0b1b133bff818f6f8936614753cb4d4cf82c25fc..7e9617f3d280aab893d2c4bd3f5800af86efe453 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -361,9 +361,9 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit5->setEnabled(false);
 
     if (getConstructorId() == 0)
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
     else
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+      localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton4) {
     myEditCurrentArgument = GroupPoints->LineEdit4;
@@ -375,7 +375,7 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
     GroupPoints->LineEdit5->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   else if (send == GroupPoints->PushButton5) {
     myEditCurrentArgument = GroupPoints->LineEdit5;
@@ -387,7 +387,7 @@ void TransformationGUI_RotationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit2->setEnabled(false);
     GroupPoints->LineEdit4->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -616,3 +616,17 @@ void TransformationGUI_RotationDlg::addSubshapesToStudy()
     }
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> TransformationGUI_RotationDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  if ( GroupPoints->CheckButton1->isChecked() ) {
+    res.append(myObjects);
+    res << myAxis << myCentPoint << myPoint1 << myPoint2;
+  }
+  return res;
+}
index 7811bbf2a2a630214a6d8b40b30d06c5f73bb861..929fa4345686a6cd6113b1ff19c2d55ea6726d69 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -52,6 +52,7 @@ protected:
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index caaaa0a1ca16c67789e7674a234a850428e50613..50e338f1104f49921871f0f7b17f9e2b8f27e377 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -325,7 +325,7 @@ void TransformationGUI_ScaleDlg::SetEditCurrentArgument()
   else if (send == PushButton2) {
     myEditCurrentArgument = LineEdit2;
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
 
     PushButton1->setDown(false);
     LineEdit1->setEnabled(false);
@@ -533,3 +533,15 @@ void TransformationGUI_ScaleDlg::addSubshapesToStudy()
     GEOMBase::PublishSubObject( myPoint.get() );
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> TransformationGUI_ScaleDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res(myObjects);
+  if ( CheckBoxCopy->isChecked() )
+    res << myPoint;
+  return res;
+}
index e69c9e3f16bf2988f56c8cbe51e3fadf8fc0ebcb..ea14f8e479ca546bdbe2e5af333c9f3a42cbf153 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -57,6 +57,7 @@ protected:
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index 20581082adfa3cce71462458f3dd3a7aa6a15033..23bafef69d942b0183e5cfd8d2861c9d6dcddeae 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -385,9 +385,9 @@ void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit3->setEnabled(false);
 
     if (getConstructorId() == 1)
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+      localSelection(TopAbs_VERTEX);
     else
-      localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
+      localSelection(TopAbs_EDGE);
   }
   else if (send == GroupPoints->PushButton3) {
     myEditCurrentArgument = GroupPoints->LineEdit3;
@@ -397,7 +397,7 @@ void TransformationGUI_TranslationDlg::SetEditCurrentArgument()
     GroupPoints->LineEdit1->setEnabled(false);
     GroupPoints->LineEdit2->setEnabled(false);
 
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_VERTEX);
+    localSelection(TopAbs_VERTEX);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -687,3 +687,17 @@ void TransformationGUI_TranslationDlg::createPathPreview ( GEOM::GEOM_Object_ptr
     GEOMBase_Helper::displayPreview( aPrs, false, true );
   }
 }
+
+//=================================================================================
+// function : getSourceObjects
+// purpose  : virtual method to get source objects
+//=================================================================================
+QList<GEOM::GeomObjPtr> TransformationGUI_TranslationDlg::getSourceObjects()
+{
+  QList<GEOM::GeomObjPtr> res;
+  if ( GroupPoints->CheckBox2->isChecked() ) {
+    res.append(myObjects);
+    res << myVector << myPoint1 << myPoint2;
+  }
+  return res;
+}
index c0a0a12233b9acfd19f2ce7526283b4cfcf5456a..4653726e59dfc68e46b1ef940ff8f35f3cc19ae8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// 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
@@ -52,6 +52,7 @@ protected:
   virtual bool                       execute( ObjectList& );
   virtual void                       addSubshapesToStudy();
   virtual void                       restoreSubShapes( SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr );
+  virtual QList<GEOM::GeomObjPtr>    getSourceObjects();
 
 private:
   void                               Init();
index d14424afe52bbc71a81218e7d15463dfb72e3ee3..9f67135eb18e3d0c418b8bac026ee0b3db368869 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 5c0ed2e53fbebe189edd222c4f5485ae9c6f1df8..2184a15b5438023e2bbfa3620aa8db7c46dd49cf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index cd373e1d76867925abf988ebab625db317c1812c..9595dba5b263c34ed7133045b3a5b1e1801ba46e 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 9012215943fb90ef492f392ab0b907ed9556db82..b4af670b54377dce401445a22d1ec0ac019378fe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d8e4095d429c772363dc1880834486c43950fd73..47ed714fcad649eb4dbc7ffa478e868d4c7c1594 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index a77897278cd28b6bd729e184fd0f5ac473b8d308..e6cc92780b77c2541813318f53347e4bf79b5e82 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -91,80 +91,16 @@ Standard_Integer VTKPlugin_ExportDriver::Execute( TFunction_Logbook& log ) const
   MESSAGE( "Export VTK into file " << aFileName );
   try
   {
-    GEOM_VertexSource* myVertexSource = GEOM_VertexSource::New();
-    GEOM_EdgeSource* myIsolatedEdgeSource = GEOM_EdgeSource::New();
-    GEOM_EdgeSource* myOneFaceEdgeSource = GEOM_EdgeSource::New();
-    GEOM_EdgeSource* mySharedEdgeSource = GEOM_EdgeSource::New();
-    GEOM_WireframeFace* myWireframeFaceSource = GEOM_WireframeFace::New();
-    GEOM_ShadingFace* myShadingFaceSource = GEOM_ShadingFace::New();
-
-    vtkAppendPolyData* myAppendFilter = vtkAppendPolyData::New();
-    myAppendFilter->AddInputConnection( myVertexSource->GetOutputPort() );
-    myAppendFilter->AddInputConnection( myIsolatedEdgeSource->GetOutputPort() );
-    myAppendFilter->AddInputConnection( myOneFaceEdgeSource->GetOutputPort() );
-    myAppendFilter->AddInputConnection( mySharedEdgeSource->GetOutputPort() );
-    //myAppendFilter->AddInputConnection( myWireframeFaceSource->GetOutputPort() ); // iso-lines are unnecessary
-    myAppendFilter->AddInputConnection( myShadingFaceSource->GetOutputPort() );
-
-    bool anIsVector = false;
-
-    // Is shape triangulated?
-    bool wasMeshed = true;
-    TopExp_Explorer ex;
-    TopLoc_Location aLoc;
-    for (ex.Init(aShape, TopAbs_FACE); ex.More(); ex.Next()) {
-      const TopoDS_Face& aFace = TopoDS::Face(ex.Current());
-      Handle(Poly_Triangulation) aPoly = BRep_Tool::Triangulation(aFace,aLoc);
-      if(aPoly.IsNull()) {
-        wasMeshed = false;
-        break;
-      }
-    }
-
-    GEOM::MeshShape( aShape, aDeflection );
-
-    TopExp_Explorer aVertexExp( aShape, TopAbs_VERTEX );
-    for( ; aVertexExp.More(); aVertexExp.Next() )
-    {
-      const TopoDS_Vertex& aVertex = TopoDS::Vertex( aVertexExp.Current() );
-      myVertexSource->AddVertex( aVertex );
-    }
-
-    TopTools_IndexedDataMapOfShapeListOfShape anEdgeMap;
-    TopExp::MapShapesAndAncestors( aShape, TopAbs_EDGE, TopAbs_FACE, anEdgeMap );
-
-    GEOM::SetShape( aShape,
-                   anEdgeMap,
-                   anIsVector,
-                   0,
-                   myIsolatedEdgeSource,
-                   myOneFaceEdgeSource,
-                   mySharedEdgeSource,
-                   myWireframeFaceSource,
-                   myShadingFaceSource );
-
-    myAppendFilter->Update();
-
     // Set "C" numeric locale to save numbers correctly
     Kernel_Utils::Localizer loc;
 
-    vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();
-    aWriter->SetInputConnection( myAppendFilter->GetOutputPort() );
+    vtkPolyData* pd = GEOM::GetVTKData( aShape, aDeflection );
+    vtkPolyDataWriter* aWriter = vtkPolyDataWriter::New();    
+    aWriter->SetInputData( pd );
     aWriter->SetFileName( aFileName.ToCString() );
     aWriter->Write();
     aWriter->Delete();
-
-    myVertexSource->Delete();
-    myIsolatedEdgeSource->Delete();
-    myOneFaceEdgeSource->Delete();
-    mySharedEdgeSource->Delete();
-    myWireframeFaceSource->Delete();
-    myShadingFaceSource->Delete();
-
-    myAppendFilter->Delete();
-
-    if(!wasMeshed)
-      BRepTools::Clean(aShape);
+    pd->Delete(); //instanciated by the GEOM::GetData(...) method
 
     return 1;
   }
index b147c97d0a51ed1c8480cb7728994c3ffa0054f9..e257bbf60eecca03cee58b36b0f846978a901466 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index aa2200b11efd222310063280f6d2bb249d2c1216..fbf7dfdc64ec4e7bc5339ebdf6a2c39a32b8bdf9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 #include "GEOM_Operation.h"
 #include "GEOMBase.h"
 #include "GEOM_Displayer.h"
+#include "GEOM_GenericObjPtr.h"
 
 #include <SALOMEconfig.h>
 #include CORBA_SERVER_HEADER(VTKPlugin)
 
+typedef GEOM::GenericObjPtr<GEOM::IVTKOperations> VTKOpPtr;
+
 //=======================================================================
 // function : VTKPlugin_GUI()
 // purpose  : Constructor
@@ -102,8 +105,8 @@ bool VTKPlugin_GUI::exportVTK( SUIT_Desktop* parent )
 
   SALOMEDS::Study_var dsStudy = GeometryGUI::ClientStudyToStudy( study->studyDS() );
   GEOM::GEOM_IOperations_var op = GeometryGUI::GetGeomGen()->GetPluginOperations( dsStudy->StudyId(), "VTKPluginEngine" );
-  GEOM::IVTKOperations_var stlOp = GEOM::IVTKOperations::_narrow( op );
-  if ( CORBA::is_nil( stlOp ) ) return false;
+  VTKOpPtr vtkOp = GEOM::IVTKOperations::_narrow( op );
+  if ( vtkOp.isNull() ) return false;
 
   LightApp_SelectionMgr* sm = app->selectionMgr();
   if ( !sm ) return false;
@@ -132,16 +135,16 @@ bool VTKPlugin_GUI::exportVTK( SUIT_Desktop* parent )
     
     SUIT_OverrideCursor wc;
     
-    GEOM_Operation transaction( app, stlOp.in() );
+    GEOM_Operation transaction( app, vtkOp.get() );
     
     try
     {
       app->putInfo( tr( "GEOM_PRP_EXPORT" ).arg( fileName ) );
       transaction.start();
       
-      stlOp->ExportVTK( obj, fileName.toUtf8().constData(), deflection  );
+      vtkOp->ExportVTK( obj, fileName.toUtf8().constData(), deflection  );
       
-      if ( stlOp->IsDone() )
+      if ( vtkOp->IsDone() )
       {
        transaction.commit();
       }
@@ -150,7 +153,7 @@ bool VTKPlugin_GUI::exportVTK( SUIT_Desktop* parent )
        transaction.abort();
        SUIT_MessageBox::critical( parent,
                                   tr( "GEOM_ERROR" ),
-                                  tr( "GEOM_PRP_ABORT" ) + "\n" + tr( stlOp->GetErrorCode() ) );
+                                  tr( "GEOM_PRP_ABORT" ) + "\n" + tr( vtkOp->GetErrorCode() ) );
        return false;
       }
     }
index a24f5dfdc49f7ae9f29b51dbb99275a6eb8e5971..08a3d6f0b958817ca9fa3b8080303c407ff9cdfe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 25f1658f4d3cc41a1a2055d107ca479b0f520344..3db09cb066b80022d40cbcda19c5f363d65c5954 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index a0e91f4a453705f5e754fab63f2c08792d87f248..f695be45467609f179e1746bc27b66ec0dcb57b8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 5fe83e6466d0e01821fe8af198833a6aed163efb..2cedfacf1bca54a933c759255e00d1d2ec26902f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index cdb6fc8cf5067ca903dd58ffbc4cd54b898b792b..a9f31f6247b9e1a90df11e995289b93745a30f9d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index dc7a6174cdff45e1128d50c0368ed2a78aa4cfa6..8035cca3165644aa9d4b30db57993bc22a3a65be 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index f73c9486b98f3622d0bcb93ca9d04cbe2687b954..42777b8571ab6b518aaaddedfb70eafc9269c8f4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 1a0d0aec66e74cc6e94df4ea897c2fa4e63eaa3c..20329c2dbafde3a6a4d7712425dbb4e232673f04 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index c71ab52ed387357a04ee263c94b3dda82ce74b48..66b0ffd09f58c6dacde2b4024d2438993f9682ef 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 9d9b1aeafc8240842017e615652595bc61d6394d..761aa135f14a4bb2d4c2137640c7be5a4092cb75 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 8b0df3ae870fa1fd8b625a971cc8b6ee3a84edf6..5736f4b5e8a0aaeb0339d12dee057ef15c5a90bd 100644 (file)
@@ -1,49 +1,49 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
-        <source>MEN_EXPORTVTK</source>
-        <translation type="unfinished">VTK</translation>
+      <source>MEN_EXPORTVTK</source>
+      <translation>VTKエクスポート</translation>
     </message>
     <message>
-        <source>TOP_EXPORTVTK</source>
-        <translation type="unfinished">Export VTK</translation>
+      <source>TOP_EXPORTVTK</source>
+      <translation>VTKエクスポート</translation>
     </message>
     <message>
-        <source>STB_EXPORTVTK</source>
-        <translation type="unfinished">Export VTK</translation>
+      <source>STB_EXPORTVTK</source>
+      <translation>VTKエクスポート</translation>
     </message>
     <message>
-        <source>MEN_IMPORTVTK</source>
-        <translation type="unfinished">VTK</translation>
+      <source>MEN_IMPORTVTK</source>
+      <translation>VTKインポート</translation>
     </message>
     <message>
-        <source>TOP_IMPORTVTK</source>
-        <translation type="unfinished">Import VTK</translation>
+      <source>TOP_IMPORTVTK</source>
+      <translation>VTKインポート</translation>
     </message>
     <message>
-        <source>STB_IMPORTVTK</source>
-        <translation type="unfinished">Import VTK</translation>
+      <source>STB_IMPORTVTK</source>
+      <translation>VTKインポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>VTKPlugin_GUI</name>
     <message>
-        <source>VTK_FILES</source>
-        <translation type="unfinished">VTK files( *.vtk )</translation>
+      <source>VTK_FILES</source>
+      <translation>VTKファイル( *.vtk )</translation>
     </message>
     <message>
-        <source>EXPORT_TITLE</source>
-        <translation type="unfinished">Export VTK</translation>
+      <source>EXPORT_TITLE</source>
+      <translation>VTKエクスポート</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>VTKPlugin_ExportDlg</name>
     <message>
-        <source>DEFLECTION</source>
-        <translation type="unfinished">Deflection</translation>
+      <source>DEFLECTION</source>
+      <translation>たわみ</translation>
     </message>
-</context>
+  </context>
 </TS>
index ab3255a2a068fa67ca42332e2fcdf5a213fa9ef2..f1097985fabb923068fd2bad600684d506e01071 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 2485bba55f8afd67f9825488d650d1d267760ecd..e375a04a42d58f81dcfda1bfaecaa5541d1ecc69 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 0f2c2954851635f39782a4d6526db67827be6876..52a1334a571da69e8ab5c596eef48e41110a5078 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index c8c0516725c4cc92dbb619cd2929ce235e1386bb..6a8af9f5673779c433cb44dd572c6ccf50aab110 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index ae32533c0354834bbd35ad5bb59501c6a8642307..4015f5f4795721687011eaba981ce48e87857a91 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index cd51e0e81e6d1e7a3e48c42ac86beaaeea85e82a..90f6278a3930112b4aa86671332dbb63415dbe7a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index aea67b6e66881828dff2a0b4e33e9b27bee2ccf1..d4f902da9a96ed70274419bae14a3b4c9db41ea0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7920e9adcb6ae0507c090760e53de259e1d60d9d..87b95fa54a59e615a6a7d832ced125c373c1619c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 73c0f59d828326e74b543b390166dce41f12ab7a..e49fd57a53b8bda33dae6bd795392763d1f6d45a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d715a3816cdb7eec34fcdb943f26fcba90812dc6..4e7765850984b562b3f4f5f5af7a60f6b3159761 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index cda8b1ccd8057e087d12ef900d37c1d59286483d..d080e86bc75294d658f4829113f672b2b15d27f9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index fdc08fe2d27bbbe5d0606e16641492c558ded0a5..6b30102c03891aab9312ca62c95aab8d897fc05e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index cbc7a06cc9f4f88a1a3098362e6ab9e32f28c24d..9d6da690b13b9d88d54684aca113ab62dfdbe8b8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 39cec9766be2479f6859765e0cc9dfbfb9ce24fb..770bd3305f51278ff2d93951137f6901ac56dcdb 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 79f125b6146fe1cf34873f1a7fd6abc91a70c655..67f32cf6f136c3374d0dca0748b0e2a3b555fdfc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3c9c73a14e0ede17c849ffcc1e75906638520755..1320145623bcba8ec60b929579a6fcad387c6dc2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index b48b2767b45f61ac246e3a26e1b5cffd35a30819..83a5fd780602eb42f66794f0fbcef37b70f52ae0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index b6feb1cdd25b5b12d96b13a48a3ce8f82e766359..275303dd9c46c87f13a6317262d774df15a47454 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 6870c264076c44ac469e2e416bf5dcf7ac400fb7..bb9dec48776e06731fe62f8c3277d627381b0038 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 9927d22a2df1a328928b717b8aa28dec6e242610..87c6f9f882c966a50cae0a7d5aaa0135ab29deaa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d83aaea7a6da2edc01244d28c34f206eeba8670b..4f0115403fba3e29b7badbbbecf2e9ba7f82d9f3 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 84cab4c3d3962061ee47cdd606770537a8b08cfd..208011bb30f534f470c5d93931bf5905594d4365 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 219b130913907fbbadbbd4a997c49124832e303f..cdf44278de398867fb955743d7db475e191f1c79 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 51b60eb6623b2f1a37b6354f0a1dd05f028ebf26..45c6ec6d5465ec451c9e9f8f27f6dbd51ae8aa0b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index ab93d8a81979e0828431f88bc9d5f1f2b19d1ed1..fdbb435c54f32cd402b9eafb44c71ea0ac1b4183 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2e6b7aade98523d413c72c1506212f3e399fd28f..df263bd74f31034a9e8032ea8ecd852aa70380aa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 78f5f37b094d26a395cb27513bbb7ae766845531..87980dd09bf41739bfdda81b591d77e2e843c009 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 6416634e7a05238efcfcbf0996af425c532b346a..8dedb2715104c5beeb19a8e5e1e98046430b6d75 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 9f7a6ce2453e6e705bef21e5449a33f0e0e1e666..61804edd5287cd4dbd8244fb3c607f7b83567a76 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2b6debd004b43b66df4d2cdf2733327e2881584f..9f0f793a7021ecb0746f7c38cd21a834a770686c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7504a07efcb396ab96490a941c446f5c4bedf886..2cf15592be8f96aeb5eee433765cab96c0fde8fa 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e8f0e93105249e71bbcb3f498fb62cd104f63eb9..26266169ed88178e42b8be2595b8db7116659f63 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 40b2a50ad6f6d4d16c4f7f800cebe3e7a4f4ad08..47338f79ab993c3584bb9c7cc10db7caac65939f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index c3114ff671a4c26b21de786d764ba632e62cc2c8..1871e3399d77e66451f237876902270a36fd97c0 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 82dfd6db2f4c4d8e0e506caa32e347eb0ee50b68..7b7228fc7d90efb91e4204264bac668b5970d8fd 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d0ee51cb843a88f82dd9ccae8a4f8db11fccf8d9..8d08cea84d5fd44fe76581113459631f915bd859 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index b760f5ae67e96ed6d4115db99198ccf3d65855f1..92d92ab28d04bd7ee6342fcdac6556576cd8ab18 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 80b519fc96b32be3c8fea4557106ff65ad456476..77e1d1770499d535c1bb30ad77bff2e6418a715b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d8e7de51b13cdddb575be4123dd4a6edc890f1bb..df871d82387d464fd52b83a66fe281961cfd5cff 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 10fb595fc31eae000bbf1f82b2786700eab72a2b..508c84ee20dbbcac3e1a30de4a6fd8e548e50251 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 9b5e5cbb12e95b48a263145ffdc088256b41fa30..4fad427b7cafa68da765ea1850f812b8e9cc8f00 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 71beb4e2483c090c7f4451454ac5e9995ce78477..b93fb3f36cb0167d2651eff295c8858a80d74e2a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 201aa82eb794c8d9ca1481369e593621fb553256..a17a53bd2fe237667652b79aac521d0d2c1b5504 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 678c55fbea9ed3b37267a06ba0eff8046431e940..f15171118e26aa8149da6401f4868b7fac54d35b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 0fba9caf174b21b7b2b99d96172deb94c429bf3d..922def8c180ab01763d1c3feea82716828b0c09e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 34b4e44cbd0690c2976b2fb0241d6df4457bc505..b206c394faeb768ed7bb5d6d59e84428b1d640e4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 7ae0fe5885648e924f957852b5e35e7715a71d41..a7165b8b654bf14a51ff837bb61f949786b07045 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index fb601fd892c1b3a196a5d9053c974b88aba1eda8..e2ebd579c894df0c69807181c4bd240617f38701 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 86b81da366939dc00f13b06c470c0c82d198b632..73979977099d24ffb5a9541678dba382d1404ffe 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index a5e388bf8695a1d7c7502ed94be6232e6f618e23..1661cc0bb777c9e39419486e8aada407a56f0b05 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -40,7 +40,7 @@ namespace XAO
         {
             std::ifstream rstr;
             int length;
-            rstr.open(filePath.c_str());
+            rstr.open(filePath.c_str(), std::ios_base::binary);
             rstr.seekg(0, rstr.end);        // go to the end
             length = rstr.tellg();          // report location (this is the length)
             rstr.seekg(0, rstr.beg);        // go back to the beginning
index 19ff54844f1031a27bff4353e7320db082ba7da1..3a5fb3c8137bd0a1ccf34e35d00ab787a3a14af9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 5976f92fe5b617bd20e376c9a4ec98039a3fc572..391b9867f08deb0b42afb300020148e03b8d0c29 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index e5639c9186f31b62e3d5d1bbd7dc9fa6fa1cd778..8cb66b7f3b93c6d78e5b1bb777fa26b20567ec0b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 07f1dffbf9ecb57b5c3a730fb2848dc9d03512dd..7f0b55028c1a2a8ba682333f2da82c13c292d1d4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 3d24a1d028d3dfdc6dabbd2c50f7c0f85c0a683c..09cd136ca7ab262b813bc494789dc4356f38402c 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index c43ef37da9da905a2ed70c1f16445bc351dc252c..0aaad7bfcfd17828e25e9f61d4e3ca3b40bcbdf9 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/bash
 
-# Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 910c45b9ca2dc75bdcbfbd7f9651448c451f62c4..47d6a2ff307ebe59801cb1138f8521ce6a175c74 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public
index 1c16ae792eec294bdae29b2712a516563e5fc592..607c7b3df3b1f49448601554c3d0d46159be5448 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -100,6 +100,23 @@ Standard_Integer XAOPlugin_Driver::Execute(TFunction_Logbook& log) const
   return 1;
 }
 
-IMPLEMENT_STANDARD_HANDLE (XAOPlugin_Driver, TFunction_Driver);
-IMPLEMENT_STANDARD_RTTIEXT(XAOPlugin_Driver, TFunction_Driver);
+//=======================================================================
+//function : GetCreationInformation
+//purpose  : Returns a name of creation operation and names and values of
+//           creation parameters
+//=======================================================================
+
+bool XAOPlugin_Driver::GetCreationInformation(std::string&             theOperationName,
+                                              std::vector<GEOM_Param>& theParams)
+{
+  if (Label().IsNull()) return false;
+  Handle(GEOM_Function) function = GEOM_Function::GetFunction(Label());
+
+  theOperationName = "ImportXAO";
+  AddParam( theParams, "File name", function->GetString( GetFileNameTag() ));
+  return true;
+}
+
+IMPLEMENT_STANDARD_HANDLE (XAOPlugin_Driver, GEOM_BaseDriver);
+IMPLEMENT_STANDARD_RTTIEXT(XAOPlugin_Driver, GEOM_BaseDriver);
  
index ea821cf3b5f360c29feec39d284a68dcd80b97fb..9a8885e96ad53fc5b54ed3ae01b2c3c148d1767d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-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
 #ifndef _XAOPlugin_Driver_HXX
 #define _XAOPlugin_Driver_HXX
 
-// OCCT includes
-#include <TFunction_Driver.hxx>
+#include "GEOM_BaseDriver.hxx"
 
-DEFINE_STANDARD_HANDLE(XAOPlugin_Driver, TFunction_Driver);
+DEFINE_STANDARD_HANDLE(XAOPlugin_Driver, GEOM_BaseDriver);
 
-class XAOPlugin_Driver: public TFunction_Driver
+class XAOPlugin_Driver: public GEOM_BaseDriver
 {
 public:
   XAOPlugin_Driver();
@@ -39,7 +38,12 @@ public:
   Standard_Boolean MustExecute(const TFunction_Logbook&) const;
   virtual void Validate(TFunction_Logbook&) const {}
 
-DEFINE_STANDARD_RTTI(XAOPlugin_Driver)
+  virtual bool GetCreationInformation(std::string&             theOperationName,
+                                     std::vector<GEOM_Param>& theParams);
+
+  static int GetFileNameTag() { return 1; } // where to store file name in GEOM_Function
+
+  DEFINE_STANDARD_RTTI(XAOPlugin_Driver)
 };
 
 #endif // _XAOPlugin_Driver_HXX
index e78ce5a47a1d96d76affb9185ea3790950b77195..ea8194eecf0f696701cc14d770c57d0344bed05b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 9dd44dce1699acf0bf746b3278a326ee5f4a0ec5..21f92a45c7b5e2237da0a57c16604a5842b6037b 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 01e570f6460b89a0d15ea196c56871aa2357eb62..8540a502ffd45dd130651efbfbce07de2bd40de9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -162,7 +162,7 @@ XAOPlugin_ExportDlg::XAOPlugin_ExportDlg(GeometryGUI* geometryGUI, QWidget* pare
   layout->addWidget(gbxFilter);
 
   // set help
-  setHelpFileName("xao_format_page.html");
+  setHelpFileName("import_export_geom_obj_page.html#io_xao");
 
   Init();
 }
@@ -450,7 +450,7 @@ bool XAOPlugin_ExportDlg::execute()
   // call engine function
   GEOM::IXAOOperations_var aXAOOp = GEOM::IXAOOperations::_narrow( getOperation() );
   res = aXAOOp->ExportXAO(m_mainObj, groups, fields,
-                          author.toStdString().c_str(),
-                          fileName.toStdString().c_str());
+                          author.toUtf8().constData(),
+                          fileName.toUtf8().constData());
   return res;
 }
index a2338e2e5cd256befd013cc7adabbc510f1db83f..cc0bf4f11e1c5140b02173a7b0fa700acef4af86 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 6bb816445acced33193f8c7530afed188b0088c8..570e34bce76db06fddb6314fe7fb4f28893fc1b9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index bbd83db36e2bd9aa12cc59786ffed3d470496323..f91b10b28ba874c42c44c98870d4c3ed9e4c5200 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index f6b19e580ffd806ed1782e91f69aac3de0781583..d823b8af11f369f1be3d9154ff59357db6901b3b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 50168eac95a100b1a275576550a1c4c747f8feef..1712dfdcb72f3907163c9eb064487109ef77f8c7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 4f57275364a694596b02de05b618818efcf64551..7215bac701a987dbb61267f8d0b06321d0727cfc 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 2e0f4d1533021ea6630942909b51aaf1da86ff73..d8c886274f57b19a6f7af9d30444b4f41ad78052 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -258,7 +258,7 @@ void XAOPlugin_IOperations::exportFields( std::list<Handle(GEOM_Field)> fieldLis
 
 void XAOPlugin_IOperations::exportSubshapes( const Handle(GEOM_Object)& shape, XAO::BrepGeometry* geometry )
 {
-  Handle(TColStd_HSequenceOfTransient) subObjects = myShapesOperations->GetExistingSubObjects( shape, false );
+  Handle(TColStd_HSequenceOfTransient) subObjects = myShapesOperations->GetExistingSubObjects( shape, GEOMImpl_IShapesOperations::SubShapes );
   int nbSubObjects = subObjects->Length();
   // set the names of the sub shapes
   for (int i = 1; i <= nbSubObjects; i++)
@@ -470,6 +470,8 @@ bool XAOPlugin_IOperations::ImportXAO( const char* fileName,
   if (function.IsNull()) return false;
   if (function->GetDriverGUID() != XAOPlugin_Driver::GetID()) return false;
 
+  function->SetString( XAOPlugin_Driver::GetFileNameTag(), fileName );
+
   // set the geometry
   if (xaoGeometry->getFormat() == XAO::BREP)
   {
index 34e17b2c5578a384673dc193d9c971ee8f1d69fe..869e3a1c2547b9baa4ff8468193714807717f339 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index cbda713a92f1e90e92627f8ffc5520044ec2ac24..42ac42a5935fadb3f36474e96a47aa5ad5be2bed 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 6e7b89cdac224371431cdb2e1f69f808d319a12b..4e37cad1f077de4aa70a689f9e832cfe597e8eaf 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 6acce2f5e6b9b23b1ffc03e2eeb79a4e06581fa9..2d061210ff07d28321e27cb06c3ea0653d05c17e 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -113,7 +113,7 @@ XAOPlugin_ImportDlg::XAOPlugin_ImportDlg(GeometryGUI* geometryGUI, QWidget* pare
     layout->addWidget(gbxExport);
 
     // set help
-    setHelpFileName("xao_format_page.html");
+    setHelpFileName("import_export_geom_obj_page.html#io_xao");
 
     Init();
 }
@@ -280,13 +280,16 @@ bool XAOPlugin_ImportDlg::execute()
   {
     QStringList anEntryList;
     anEntryList << addInStudy(m_mainShape, m_mainShape->GetName());
+    m_mainShape->UnRegister();
     for (int i = 0; i < subShapes->length(); i++)
     {
       addInStudy(subShapes[i].in(), subShapes[i]->GetName());
+      subShapes[i]->UnRegister();
     }
     for (int i = 0; i < groups->length(); i++)
     {
       addInStudy(groups[i].in(), groups[i]->GetName());
+      groups[i]->UnRegister();
     }
     for (int i = 0; i < fields->length(); i++)
     {
@@ -316,6 +319,7 @@ QString XAOPlugin_ImportDlg::addFieldInStudy( GEOM::GEOM_Field_ptr theField, GEO
 
   SALOMEDS::SObject_var aSO =
     getGeomEngine()->AddInStudy(aStudyDS, theField, theField->GetName(), theFather);
+  theField->UnRegister();
 
   QString anEntry;
   if ( !aSO->_is_nil() ) {
@@ -331,6 +335,7 @@ QString XAOPlugin_ImportDlg::addFieldInStudy( GEOM::GEOM_Field_ptr theField, GEO
     QString stepName = (tr("XAOPLUGIN_STEP") + " %1 %2").arg( step->GetID() ).arg( step->GetStamp() );
     SALOMEDS::SObject_wrap aSOField =
       getGeomEngine()->AddInStudy( aStudyDS, step, stepName.toLatin1().constData(), theField );
+    step->UnRegister();
   }
 
   aSO->UnRegister();
index 2f32db08a12196a464a1b4f3e58357d61417d3c1..48a08be5a01aec45e111bddcfcbf727d3aec38c2 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2013-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 21827c0be95d9ec3ad2cfa530298f77a2d143240..0e6a93528edb3a1e3f4a144d8d8b6d8ddcfb318b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index d90589d5268b2c985b6457914b6b5c6e645abd73..c42a31a70ed8dc80bf60c034c548482533777c65 100755 (executable)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2014-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
index 307f0146b676ad863ce5f2d2944213d1518ffba5..4f340dbddfafc1186ce930923f41bf415a6fbd20 100644 (file)
@@ -1,31 +1,31 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
-<context>
+  <context>
     <name>@default</name>
     <message>
       <source>MEN_EXPORTXAO</source>
-      <translation>エクスポートしました。</translation>
+      <translation>XAOエクスポート</translation>
     </message>
     <message>
-        <source>TOP_EXPORTXAO</source>
-        <translation>エクスポートしました。</translation>
+      <source>TOP_EXPORTXAO</source>
+      <translation>XAOのエクスポート</translation>
     </message>
     <message>
       <source>STB_EXPORTXAO</source>
-      <translation>ソテーした形式でフォームをエクスポートします。</translation>
+      <translation>XAOのエクスポート</translation>
     </message>
     <message>
       <source>MEN_IMPORTXAO</source>
-      <translation>インポートしました。</translation>
+      <translation>XAOインポート</translation>
     </message>
     <message>
       <source>TOP_IMPORTXAO</source>
-      <translation>インポートしました。</translation>
+      <translation>XAOのインポート</translation>
     </message>
     <message>
       <source>STB_IMPORTXAO</source>
-      <translation>ソテーしたフォームをインポートします。</translation>
+      <translation>XAOのインポート</translation>
     </message>
     <message>
       <source>XAOPLUGIN_IMPORT_SELECT</source>
     </message>
     <message>
       <source>XAOPLUGIN_EXPORT_SELECT</source>
-      <translation>エクスポートしました。</translation>
+      <translation>XAOへのエクスポート</translation>
     </message>
     <message>
       <source>XAOPLUGIN_FILES</source>
-      <translation>ファイルした (*.xao)</translation>
+      <translation>XAO ファイル (*.xao)</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>XAOPlugin_ExportDlg</name>
     <message>
       <source>XAOPLUGIN_EXPORT_TITLE</source>
-      <translation>エクスポートしました。</translation>
+      <translation>XAOエクスポート</translation>
     </message>
     <message>
       <source>XAOPLUGIN_EXPORTXAO</source>
-      <translation>エクスポートしました。</translation>
+      <translation>XAOエクスポート</translation>
     </message>
     <message>
       <source>XAOPLUGIN_EXPORT_INGSHAPE</source>
       <source>XAOPLUGIN_EXPORT_LFIELDS</source>
       <translation>フィールド</translation>
     </message>
-</context>
-<context>
+  </context>
+  <context>
     <name>XAOPlugin_ImportDlg</name>
     <message>
       <source>XAOPLUGIN_IMPORT_TITLE</source>
-      <translation>インポートしました。</translation>
+      <translation>XAOインポート</translation>
     </message>
     <message>
       <source>XAOPLUGIN_IMPORTXAO</source>
-      <translation>インポートしました。</translation>
+      <translation>XAOインポート</translation>
     </message>
     <message>
       <source>XAOPLUGIN_IMPORT_INGSHAPE</source>
       <source>XAOPLUGIN_STEP</source>
       <translation>Step</translation>
     </message>
-</context>
-</TS>
\ No newline at end of file
+  </context>
+</TS>
index a4b23973aeb976ac151aa65e801b5303033c3df7..6d26952f9e3083be1e1c97195e7a72f1d324d6bc 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2012-2015  CEA/DEN, EDF R&D, OPEN CASCADE
 #
 # This library is free software; you can redistribute it and/or
 # modify it under the terms of the GNU Lesser General Public