From 9d11375af40826e967ab2c3bcb77d1f9d439c90c Mon Sep 17 00:00:00 2001 From: abd Date: Wed, 7 Feb 2007 12:14:23 +0000 Subject: [PATCH] Merging with WPdev --- doc/salome/gui/SMESH/about_viewing_meshes.htm | 338 +- .../adding_quadratic_nodes_and_elements.htm | 248 +- doc/salome/gui/SMESH/aspect_ratio_3d.htm | 406 +- .../gui/SMESH/borders_at_multi-connection.htm | 242 +- .../SMESH/borders_at_multiconnection_2d.htm | 230 +- doc/salome/gui/SMESH/clipping.htm | 280 +- doc/salome/gui/SMESH/constructing_meshes.htm | 896 +- doc/salome/gui/SMESH/cshdat_robohelp.htm | 516 +- doc/salome/gui/SMESH/cshdat_webhelp.htm | 502 +- doc/salome/gui/SMESH/default.css | 202 +- doc/salome/gui/SMESH/default_ns.css | 236 +- .../gui/SMESH/defining_hypotheses_tui.htm | 1765 +-- doc/salome/gui/SMESH/deleting_groups.htm | 238 +- doc/salome/gui/SMESH/display_entity.htm | 202 +- doc/salome/gui/SMESH/ehelp.xml | 18 +- doc/salome/gui/SMESH/ehlpdhtm.js | 8476 +++++----- doc/salome/gui/SMESH/extrusion.htm | 328 +- .../gui/SMESH/files/about_hypotheses.htm | 426 +- doc/salome/gui/SMESH/files/about_meshes.htm | 500 +- .../SMESH/files/about_meshing_algorithms.htm | 470 +- .../SMESH/files/about_quality_controls.htm | 350 +- .../SMESH/files/adding_nodes_and_elements.htm | 606 +- .../gui/SMESH/files/area_of_elements.htm | 276 +- doc/salome/gui/SMESH/files/arithmetic_1d.htm | 660 +- doc/salome/gui/SMESH/files/aspect_ratio.htm | 424 +- .../changing_orientation_of_elements.htm | 318 +- ...nstructing_groups_of_specific_elements.htm | 206 +- .../gui/SMESH/files/constructing_meshes.htm | 418 +- .../SMESH/files/constructing_submeshes.htm | 370 +- .../gui/SMESH/files/creating_groups.htm | 562 +- .../gui/SMESH/files/cutting_quadrangles.htm | 416 +- .../files/diagonal_iversion_of_elements.htm | 298 +- .../gui/SMESH/files/displacing_nodes.htm | 340 +- .../SMESH/files/displaying_nodes_numbers.htm | 318 +- doc/salome/gui/SMESH/files/editing_groups.htm | 268 +- .../files/importing_and_exporting_meshes.htm | 314 +- .../gui/SMESH/files/length_of_edges.htm | 274 +- .../files/max._element_area_hypothesis.htm | 344 +- .../files/max._element_volume_hypothsis.htm | 244 +- doc/salome/gui/SMESH/files/merging_nodes.htm | 262 +- doc/salome/gui/SMESH/files/minimum_angle.htm | 268 +- .../non_conform_mesh_allowed_hypothesis.htm | 284 +- .../reassigning_hypotheses_and_algorithms.htm | 294 +- .../files/removing_nodes_and_elements.htm | 492 +- .../files/renumbering_nodes_and_elements.htm | 352 +- doc/salome/gui/SMESH/files/rotation.htm | 284 +- .../gui/SMESH/files/running_smesh_module.htm | 222 +- doc/salome/gui/SMESH/files/sewing_meshes.htm | 684 +- doc/salome/gui/SMESH/files/skew.htm | 282 +- doc/salome/gui/SMESH/files/smoothing.htm | 392 +- doc/salome/gui/SMESH/files/symmetry.htm | 294 +- doc/salome/gui/SMESH/files/taper.htm | 282 +- doc/salome/gui/SMESH/files/translation.htm | 274 +- .../files/uniting_a_set_of_triangles.htm | 366 +- .../gui/SMESH/files/uniting_two_triangles.htm | 302 +- .../files/using_operations_on_groups.htm | 630 +- .../gui/SMESH/files/viewing_mesh_info.htm | 368 +- doc/salome/gui/SMESH/files/vtk_3d_viewer.htm | 494 +- doc/salome/gui/SMESH/files/warp.htm | 312 +- doc/salome/gui/SMESH/free_borders.htm | 240 +- doc/salome/gui/SMESH/free_edges.htm | 244 +- doc/salome/gui/SMESH/grouping_elements.htm | 1511 +- doc/salome/gui/SMESH/image10.jpg | Bin 16039 -> 16038 bytes doc/salome/gui/SMESH/image131.gif | Bin 2632 -> 2631 bytes doc/salome/gui/SMESH/image157.gif | Bin 0 -> 5307 bytes doc/salome/gui/SMESH/image37.gif | Bin 1001 -> 1000 bytes doc/salome/gui/SMESH/image7.jpg | Bin 66668 -> 66667 bytes doc/salome/gui/SMESH/image71.jpg | Bin 11550 -> 11549 bytes doc/salome/gui/SMESH/image74.gif | Bin 987 -> 986 bytes doc/salome/gui/SMESH/index.htm | 360 +- doc/salome/gui/SMESH/index_csh.htm | 210 +- doc/salome/gui/SMESH/index_rhc.htm | 210 +- doc/salome/gui/SMESH/length.htm | 236 +- doc/salome/gui/SMESH/merge_elements.htm | 202 +- doc/salome/gui/SMESH/mesh.htm | 432 +- doc/salome/gui/SMESH/modifying_meshes.htm | 3774 +++-- .../gui/SMESH/netgen_2d_and_3d_hypotheses.htm | 146 + doc/salome/gui/SMESH/pattern_mapping.htm | 622 +- .../gui/SMESH/pics/distribution_of_layers.png | Bin 0 -> 12502 bytes doc/salome/gui/SMESH/pics/image157.gif | Bin 0 -> 2858 bytes doc/salome/gui/SMESH/pics/netgen2d.png | Bin 0 -> 21454 bytes .../gui/SMESH/pics/number_of_layers.png | Bin 0 -> 11539 bytes doc/salome/gui/SMESH/pics/projection_1d.png | Bin 0 -> 14401 bytes doc/salome/gui/SMESH/pics/projection_2d.png | Bin 0 -> 17347 bytes doc/salome/gui/SMESH/pics/projection_3d.png | Bin 0 -> 17967 bytes .../SMESH/pics/set_rotation_point_dialog1.png | Bin 0 -> 11693 bytes .../SMESH/pics/set_rotation_point_dialog2.png | Bin 0 -> 11232 bytes .../gui/SMESH/pics/view_rotation_point.png | Bin 0 -> 293 bytes doc/salome/gui/SMESH/presentation.htm | 276 +- doc/salome/gui/SMESH/prism_3d_algorithm.htm | 116 + .../gui/SMESH/projection_algorithms.htm | 179 + doc/salome/gui/SMESH/quality_controls.htm | 2943 ++-- doc/salome/gui/SMESH/radial_prism.htm | 124 + doc/salome/gui/SMESH/revolution.htm | 312 +- .../gui/SMESH/selection_filter_library.htm | 318 +- doc/salome/gui/SMESH/smesh.log | 1060 +- .../SMESH/smeshpy_doc/classsmesh_1_1Mesh.html | 12786 ++++++++++++++-- .../classsmesh_1_1Mesh__Algorithm.html | 1253 +- .../classsmesh_1_1Mesh__Hexahedron.html | 1335 +- ...sh_1_1Mesh__Hexahedron__inherit__graph.jpg | Bin 5526 -> 5525 bytes .../classsmesh_1_1Mesh__Netgen.html | 1535 +- .../classsmesh_1_1Mesh__Quadrangle.html | 1409 +- .../classsmesh_1_1Mesh__Segment.html | 2227 ++- .../classsmesh_1_1Mesh__Segment__Python.html | 2358 ++- .../classsmesh_1_1Mesh__Tetrahedron.html | 2052 ++- .../classsmesh_1_1Mesh__Triangle.html | 2302 ++- .../gui/SMESH/smeshpy_doc/namespacesmesh.html | 2348 ++- doc/salome/gui/SMESH/transforming_meshes.htm | 1641 +- doc/salome/gui/SMESH/transparency.htm | 196 +- doc/salome/gui/SMESH/viewing_meshes.htm | 375 +- doc/salome/gui/SMESH/volume.htm | 246 +- doc/salome/gui/SMESH/webhelp.jar | Bin 134517 -> 134515 bytes doc/salome/gui/SMESH/whcsh_home.htm | 1200 +- doc/salome/gui/SMESH/whcshdata.htm | 174 +- doc/salome/gui/SMESH/whd_dpns.htm | 84 +- doc/salome/gui/SMESH/whd_nvp10.htm | 30 +- doc/salome/gui/SMESH/whd_nvp20.htm | 668 +- doc/salome/gui/SMESH/whd_tabs.htm | 1064 +- doc/salome/gui/SMESH/whd_toc4.gif | Bin 953 -> 952 bytes doc/salome/gui/SMESH/whd_topic.xml | 170 +- doc/salome/gui/SMESH/whdata/whftdata.js | 48 +- doc/salome/gui/SMESH/whdata/whftdata0.htm | 187 +- doc/salome/gui/SMESH/whdata/whfts.htm | 36 +- doc/salome/gui/SMESH/whdata/whfts.js | 80 +- doc/salome/gui/SMESH/whdata/whfwdata.js | 72 +- doc/salome/gui/SMESH/whdata/whfwdata0.htm | 2813 ++-- doc/salome/gui/SMESH/whdata/whgdata.js | 50 +- doc/salome/gui/SMESH/whdata/whgdata0.htm | 66 +- doc/salome/gui/SMESH/whdata/whglo.htm | 30 +- doc/salome/gui/SMESH/whdata/whglo.js | 68 +- doc/salome/gui/SMESH/whdata/whidata.js | 176 +- doc/salome/gui/SMESH/whdata/whidx.htm | 28 +- doc/salome/gui/SMESH/whdata/whidx.js | 68 +- doc/salome/gui/SMESH/whdata/whtdata.js | 126 +- doc/salome/gui/SMESH/whdata/whtdata0.htm | 200 +- doc/salome/gui/SMESH/whdata/whtoc.htm | 30 +- doc/salome/gui/SMESH/whdata/whtoc.js | 60 +- doc/salome/gui/SMESH/whfbody.htm | 74 +- doc/salome/gui/SMESH/whfdhtml.htm | 60 +- doc/salome/gui/SMESH/whfform.htm | 272 +- doc/salome/gui/SMESH/whfhost.js | 1888 +-- doc/salome/gui/SMESH/whform.js | 430 +- doc/salome/gui/SMESH/whframes.js | 156 +- doc/salome/gui/SMESH/whgbody.htm | 70 +- doc/salome/gui/SMESH/whgdata/whlstf0.htm | 88 +- doc/salome/gui/SMESH/whgdata/whlstf1.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstf10.htm | 86 +- doc/salome/gui/SMESH/whgdata/whlstf11.htm | 86 +- doc/salome/gui/SMESH/whgdata/whlstf12.htm | 94 +- doc/salome/gui/SMESH/whgdata/whlstf13.htm | 92 +- doc/salome/gui/SMESH/whgdata/whlstf2.htm | 82 +- doc/salome/gui/SMESH/whgdata/whlstf3.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstf4.htm | 86 +- doc/salome/gui/SMESH/whgdata/whlstf5.htm | 94 +- doc/salome/gui/SMESH/whgdata/whlstf6.htm | 98 +- doc/salome/gui/SMESH/whgdata/whlstf7.htm | 86 +- doc/salome/gui/SMESH/whgdata/whlstf8.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstf9.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl0.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl1.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl10.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl11.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl12.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl13.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl14.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl15.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl16.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl17.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl18.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl19.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl2.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl20.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl21.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl22.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl23.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl24.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl25.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl3.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl4.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl5.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl6.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl7.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl8.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstfl9.htm | 90 +- doc/salome/gui/SMESH/whgdata/whlstg0.htm | 150 +- doc/salome/gui/SMESH/whgdata/whlsti0.htm | 78 +- doc/salome/gui/SMESH/whgdata/whlstt0.htm | 102 +- doc/salome/gui/SMESH/whgdata/whlstt1.htm | 118 +- doc/salome/gui/SMESH/whgdata/whlstt2.htm | 132 +- doc/salome/gui/SMESH/whgdata/whlstt3.htm | 142 +- doc/salome/gui/SMESH/whgdata/whlstt4.htm | 134 +- doc/salome/gui/SMESH/whgdata/whlstt5.htm | 148 +- doc/salome/gui/SMESH/whgdata/whlstt6.htm | 130 +- doc/salome/gui/SMESH/whgdata/whlstt7.htm | 152 +- doc/salome/gui/SMESH/whgdata/whlstt8.htm | 162 +- doc/salome/gui/SMESH/whgdata/whlstt9.htm | 134 +- doc/salome/gui/SMESH/whgdata/whnvf30.htm | 26 +- doc/salome/gui/SMESH/whgdata/whnvf31.htm | 30 +- doc/salome/gui/SMESH/whgdata/whnvf32.htm | 30 +- doc/salome/gui/SMESH/whgdata/whnvf33.htm | 30 +- doc/salome/gui/SMESH/whgdata/whnvl31.htm | 86 +- doc/salome/gui/SMESH/whgdata/whnvl32.htm | 144 +- doc/salome/gui/SMESH/whgdata/whnvl33.htm | 144 +- doc/salome/gui/SMESH/whgdata/whnvp30.htm | 30 +- doc/salome/gui/SMESH/whgdata/whnvp31.htm | 30 +- doc/salome/gui/SMESH/whgdata/whnvp32.htm | 30 +- doc/salome/gui/SMESH/whgdata/whnvp33.htm | 30 +- doc/salome/gui/SMESH/whgdata/whnvt30.htm | 94 +- doc/salome/gui/SMESH/whgdata/whnvt31.htm | 90 +- doc/salome/gui/SMESH/whgdata/whnvt32.htm | 90 +- doc/salome/gui/SMESH/whgdata/whnvt33.htm | 90 +- doc/salome/gui/SMESH/whgdef.htm | 196 +- doc/salome/gui/SMESH/whgdhtml.htm | 300 +- doc/salome/gui/SMESH/whghost.js | 494 +- doc/salome/gui/SMESH/whhost.js | 2608 ++-- doc/salome/gui/SMESH/whibody.htm | 568 +- doc/salome/gui/SMESH/whidhtml.htm | 60 +- doc/salome/gui/SMESH/whiform.htm | 182 +- doc/salome/gui/SMESH/whihost.js | 848 +- doc/salome/gui/SMESH/whlang.js | 904 +- doc/salome/gui/SMESH/whmozemu.js | 132 +- doc/salome/gui/SMESH/whmsg.js | 136 +- doc/salome/gui/SMESH/whnjs.htm | 50 +- doc/salome/gui/SMESH/whphost.js | 1162 +- doc/salome/gui/SMESH/whproj.htm | 46 +- doc/salome/gui/SMESH/whproj.js | 168 +- doc/salome/gui/SMESH/whproj.xml | 6 +- doc/salome/gui/SMESH/whproxy.js | 148 +- doc/salome/gui/SMESH/whres.xml | 512 +- doc/salome/gui/SMESH/whskin_blank.htm | 20 +- doc/salome/gui/SMESH/whskin_homepage.htm | 360 +- doc/salome/gui/SMESH/whskin_info.htm | 40 +- doc/salome/gui/SMESH/whskin_pickup.htm | 458 +- doc/salome/gui/SMESH/whskin_tw.htm | 124 +- doc/salome/gui/SMESH/whstart.js | 864 +- doc/salome/gui/SMESH/whstub.js | 316 +- doc/salome/gui/SMESH/whtdhtml.htm | 98 +- doc/salome/gui/SMESH/whthost.js | 3006 ++-- doc/salome/gui/SMESH/whtopic.js | 1450 +- doc/salome/gui/SMESH/whutils.js | 1052 +- doc/salome/gui/SMESH/whver.js | 204 +- doc/salome/gui/SMESH/whxdata/whftdata0.xml | 159 +- doc/salome/gui/SMESH/whxdata/whfts.xml | 14 +- doc/salome/gui/SMESH/whxdata/whfwdata0.xml | 2785 ++-- doc/salome/gui/SMESH/whxdata/whgdata0.xml | 44 +- doc/salome/gui/SMESH/whxdata/whglo.xml | 8 +- doc/salome/gui/SMESH/whxdata/whidx.xml | 8 +- doc/salome/gui/SMESH/whxdata/whtdata0.xml | 197 +- doc/salome/gui/SMESH/whxdata/whtoc.xml | 8 +- .../tui/SMESH/sources/Application-About.png | Bin 19226 -> 19225 bytes doc/salome/tui/SMESH/sources/bg_salome.gif | Bin 17294 -> 17293 bytes idl/SMESH_BasicHypothesis.idl | 241 + idl/SMESH_Gen.idl | 14 +- idl/SMESH_Mesh.idl | 44 +- resources/SalomeApp.xml | 10 +- resources/StdMeshers.xml | 66 +- resources/mesh_hypo_layer_distribution.png | Bin 0 -> 868 bytes resources/mesh_hypo_source_3d.png | Bin 0 -> 781 bytes resources/mesh_hypo_source_edge.png | Bin 0 -> 837 bytes resources/mesh_hypo_source_face.png | Bin 0 -> 888 bytes resources/mesh_tree_algo_projection_2d.png | Bin 0 -> 278 bytes resources/mesh_tree_algo_projection_3d.png | Bin 0 -> 600 bytes resources/mesh_tree_algo_radial_prism.png | Bin 0 -> 608 bytes .../mesh_tree_hypo_layers_distribution.png | Bin 0 -> 540 bytes resources/mesh_tree_hypo_projection_2d.png | Bin 0 -> 455 bytes resources/mesh_tree_hypo_projection_3d.png | Bin 0 -> 576 bytes resources/mesh_tree_hypo_source_3d_shape.png | Bin 0 -> 505 bytes resources/mesh_tree_hypo_source_edge.png | Bin 0 -> 316 bytes resources/mesh_tree_hypo_source_face.png | Bin 0 -> 715 bytes src/Controls/SMESH_Controls.cxx | 47 +- src/Controls/SMESH_ControlsDef.hxx | 73 +- src/Driver/Driver_Document.h | 4 +- src/Driver/Driver_Mesh.h | 12 +- src/Driver/Driver_SMDS_Mesh.h | 2 +- src/Driver/Driver_SMESHDS_Mesh.h | 9 +- src/DriverDAT/DriverDAT_R_SMDS_Mesh.h | 4 +- src/DriverDAT/DriverDAT_R_SMESHDS_Document.h | 4 +- src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.h | 4 +- src/DriverDAT/DriverDAT_W_SMDS_Mesh.h | 4 +- src/DriverDAT/DriverDAT_W_SMESHDS_Document.h | 4 +- src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.h | 4 +- src/DriverDAT/Makefile.in | 2 +- src/DriverDAT/SMESH_DriverDAT.hxx | 39 + src/DriverMED/DriverMED_Family.cxx | 5 +- src/DriverMED/DriverMED_Family.h | 4 +- src/DriverMED/DriverMED_R_SMDS_Mesh.h | 4 +- src/DriverMED/DriverMED_R_SMESHDS_Document.h | 4 +- src/DriverMED/DriverMED_R_SMESHDS_Mesh.h | 4 +- src/DriverMED/DriverMED_W_SMDS_Mesh.h | 4 +- src/DriverMED/DriverMED_W_SMESHDS_Document.h | 4 +- src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx | 2 + src/DriverMED/DriverMED_W_SMESHDS_Mesh.h | 4 +- src/DriverMED/Makefile.in | 2 +- src/DriverMED/SMESH_DriverMED.hxx | 39 + src/DriverSTL/DriverSTL_R_SMDS_Mesh.h | 4 +- src/DriverSTL/DriverSTL_W_SMDS_Mesh.h | 4 +- src/DriverSTL/Makefile.in | 2 +- src/DriverSTL/SMESH_DriverSTL.hxx | 39 + src/DriverUNV/DriverUNV_R_SMDS_Mesh.h | 7 +- src/DriverUNV/DriverUNV_R_SMESHDS_Document.h | 4 +- src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.h | 4 +- src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx | 8 + src/DriverUNV/DriverUNV_W_SMDS_Mesh.h | 4 +- src/DriverUNV/DriverUNV_W_SMESHDS_Document.h | 4 +- src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.h | 4 +- src/DriverUNV/Makefile.in | 3 +- src/DriverUNV/SMESH_DriverUNV.hxx | 39 + src/DriverUNV/UNV2411_Structure.hxx | 10 +- src/DriverUNV/UNV2412_Structure.hxx | 19 +- src/DriverUNV/UNV_Utilities.hxx | 23 +- src/MEFISTO2/Rn.h | 10 +- src/MEFISTO2/aptrte.cxx | 49 +- src/MEFISTO2/aptrte.h | 244 +- src/MEFISTO2/trte.f | 3 +- src/OBJECT/Makefile.in | 1 + src/OBJECT/SMESH_Actor.cxx | 4 + src/OBJECT/SMESH_Actor.h | 2 +- src/OBJECT/SMESH_ActorUtils.h | 9 +- src/OBJECT/SMESH_DeviceActor.h | 2 +- src/OBJECT/SMESH_ExtractGeometry.h | 5 +- src/OBJECT/SMESH_Object.cxx | 2 +- src/OBJECT/SMESH_Object.h | 12 +- src/OBJECT/SMESH_ObjectDef.h | 10 +- src/SMDS/Makefile.in | 3 +- src/SMDS/SMDS_EdgePosition.hxx | 16 +- src/SMDS/SMDS_FaceOfEdges.hxx | 4 +- src/SMDS/SMDS_FaceOfNodes.hxx | 4 +- src/SMDS/SMDS_FacePosition.hxx | 16 +- src/SMDS/SMDS_Iterator.hxx | 4 +- src/SMDS/SMDS_IteratorOfElements.hxx | 4 +- src/SMDS/SMDS_Mesh.hxx | 15 +- src/SMDS/SMDS_MeshEdge.hxx | 4 +- src/SMDS/SMDS_MeshElement.hxx | 20 +- src/SMDS/SMDS_MeshElementIDFactory.hxx | 4 +- src/SMDS/SMDS_MeshFace.hxx | 4 +- src/SMDS/SMDS_MeshGroup.hxx | 16 +- src/SMDS/SMDS_MeshIDFactory.hxx | 4 +- src/SMDS/SMDS_MeshNode.hxx | 16 +- src/SMDS/SMDS_MeshObject.hxx | 15 +- src/SMDS/SMDS_MeshVolume.hxx | 4 +- src/SMDS/SMDS_PolygonalFaceOfNodes.hxx | 4 +- src/SMDS/SMDS_PolyhedralVolumeOfNodes.hxx | 9 +- src/SMDS/SMDS_Position.hxx | 17 +- src/SMDS/SMDS_QuadraticEdge.hxx | 4 +- src/SMDS/SMDS_QuadraticFaceOfNodes.hxx | 4 +- src/SMDS/SMDS_QuadraticVolumeOfNodes.hxx | 4 +- src/SMDS/SMDS_SpacePosition.hxx | 16 +- src/SMDS/SMDS_VertexPosition.hxx | 16 +- src/SMDS/SMDS_VolumeOfFaces.hxx | 4 +- src/SMDS/SMDS_VolumeOfNodes.hxx | 5 +- src/SMDS/SMDS_VolumeTool.cxx | 27 +- src/SMDS/SMDS_VolumeTool.hxx | 21 +- src/SMDS/SMESH_SMDS.hxx | 39 + src/SMESH/Makefile.in | 4 +- src/SMESH/SMESH_1D_Algo.cxx | 3 +- src/SMESH/SMESH_1D_Algo.hxx | 4 +- src/SMESH/SMESH_2D_Algo.cxx | 3 +- src/SMESH/SMESH_2D_Algo.hxx | 4 +- src/SMESH/SMESH_3D_Algo.cxx | 3 +- src/SMESH/SMESH_3D_Algo.hxx | 4 +- src/SMESH/SMESH_Algo.cxx | 26 +- src/SMESH/SMESH_Algo.hxx | 213 +- src/SMESH/SMESH_Block.cxx | 553 +- src/SMESH/SMESH_Block.hxx | 168 +- ...MESH_DataMapOfElemPtrSequenceOfElemPtr.hxx | 4 + src/SMESH/SMESH_Gen.cxx | 25 +- src/SMESH/SMESH_Gen.hxx | 10 +- src/SMESH/SMESH_Group.hxx | 4 +- src/SMESH/SMESH_HypoFilter.hxx | 6 +- src/SMESH/SMESH_Hypothesis.cxx | 4 +- src/SMESH/SMESH_Hypothesis.hxx | 7 +- ...IndexedDataMapOfShapeIndexedMapOfShape.hxx | 10 +- src/SMESH/SMESH_Mesh.cxx | 74 +- src/SMESH/SMESH_Mesh.hxx | 4 +- src/SMESH/SMESH_MeshEditor.cxx | 302 +- src/SMESH/SMESH_MeshEditor.hxx | 48 +- src/SMESH/SMESH_MesherHelper.cxx | 351 +- src/SMESH/SMESH_MesherHelper.hxx | 123 +- src/SMESH/SMESH_Pattern.cxx | 292 +- src/SMESH/SMESH_Pattern.hxx | 21 +- src/SMESH/SMESH_SMESH.hxx | 39 + src/SMESH/SMESH_SequenceOfElemPtr.hxx | 2 + src/SMESH/SMESH_SequenceOfNode.hxx | 2 + src/SMESH/SMESH_subMesh.cxx | 273 +- src/SMESH/SMESH_subMesh.hxx | 92 +- src/SMESH/SMESH_subMeshEventListener.hxx | 106 + src/SMESHClient/SMESH_Client.cxx | 4 +- src/SMESHClient/SMESH_Client.hxx | 12 +- src/SMESHDS/Makefile.in | 4 +- src/SMESHDS/SMESHDS_Command.hxx | 4 +- src/SMESHDS/SMESHDS_DataMapOfShape.hxx | 43 + src/SMESHDS/SMESHDS_Document.hxx | 4 +- src/SMESHDS/SMESHDS_Group.hxx | 8 +- src/SMESHDS/SMESHDS_GroupBase.cxx | 2 +- src/SMESHDS/SMESHDS_GroupBase.hxx | 4 +- src/SMESHDS/SMESHDS_GroupOnGeom.hxx | 4 +- src/SMESHDS/SMESHDS_Hypothesis.hxx | 4 +- src/SMESHDS/SMESHDS_Mesh.cxx | 38 +- src/SMESHDS/SMESHDS_Mesh.hxx | 77 +- src/SMESHDS/SMESHDS_Script.hxx | 4 +- src/SMESHDS/SMESHDS_SubMesh.hxx | 10 +- src/SMESHDS/SMESH_SMESHDS.hxx | 39 + .../SMESH_LogicalFilter.hxx | 4 +- .../SMESH_NumberFilter.cxx | 38 +- .../SMESH_NumberFilter.hxx | 8 +- src/SMESHFiltersSelection/SMESH_Type.h | 10 + .../SMESH_TypeFilter.hxx | 2 +- src/SMESHGUI/Makefile.in | 5 +- src/SMESHGUI/SMESHGUI.cxx | 76 +- src/SMESHGUI/SMESHGUI.h | 4 +- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h | 4 +- .../SMESHGUI_AddQuadraticElementDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_ClippingDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_ClippingDlg.h | 4 +- src/SMESHGUI/SMESHGUI_CreateHypothesesDlg.h | 96 + src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx | 1496 +- src/SMESHGUI/SMESHGUI_CreatePatternDlg.h | 4 +- .../SMESHGUI_CreatePolyhedralVolumeDlg.cxx | 8 +- .../SMESHGUI_CreatePolyhedralVolumeDlg.h | 4 +- src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h | 4 +- src/SMESHGUI/SMESHGUI_Dialog.h | 4 +- src/SMESHGUI/SMESHGUI_Displayer.h | 4 +- src/SMESHGUI/SMESHGUI_EditHypothesesDlg.h | 153 + src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_EditMeshDlg.h | 4 +- .../SMESHGUI_ExtrusionAlongPathDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h | 4 +- src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_ExtrusionDlg.h | 4 +- src/SMESHGUI/SMESHGUI_Filter.h | 2 + src/SMESHGUI/SMESHGUI_FilterDlg.cxx | 10 +- src/SMESHGUI/SMESHGUI_FilterDlg.h | 4 +- src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h | 4 +- src/SMESHGUI/SMESHGUI_FilterUtils.h | 4 +- src/SMESHGUI/SMESHGUI_GEOMGenUtils.h | 8 +- src/SMESHGUI/SMESHGUI_GroupDlg.cxx | 421 +- src/SMESHGUI/SMESHGUI_GroupDlg.h | 23 +- src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_GroupOpDlg.h | 4 +- src/SMESHGUI/SMESHGUI_GroupUtils.h | 3 + src/SMESHGUI/SMESHGUI_Hypotheses.cxx | 66 +- src/SMESHGUI/SMESHGUI_Hypotheses.h | 11 +- src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx | 36 +- src/SMESHGUI/SMESHGUI_HypothesesUtils.h | 17 +- src/SMESHGUI/SMESHGUI_IdValidator.h | 4 +- src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_MergeNodesDlg.h | 4 +- src/SMESHGUI/SMESHGUI_MeshDlg.h | 6 +- src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_MeshInfosDlg.h | 4 +- src/SMESHGUI/SMESHGUI_MeshOp.cxx | 326 +- src/SMESHGUI/SMESHGUI_MeshOp.h | 4 +- src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_MeshPatternDlg.h | 4 +- src/SMESHGUI/SMESHGUI_MeshUtils.h | 3 + src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_MoveNodesDlg.h | 4 +- src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_MultiEditDlg.h | 4 +- src/SMESHGUI/SMESHGUI_NodesDlg.cxx | 10 +- src/SMESHGUI/SMESHGUI_NodesDlg.h | 4 +- src/SMESHGUI/SMESHGUI_Operation.cxx | 8 +- src/SMESHGUI/SMESHGUI_Operation.h | 4 +- src/SMESHGUI/SMESHGUI_PatternUtils.h | 3 + src/SMESHGUI/SMESHGUI_PatternWidget.h | 4 +- src/SMESHGUI/SMESHGUI_PrecisionDlg.h | 99 + src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h | 4 +- .../SMESHGUI_Preferences_ScalarBarDlg.h | 4 +- .../SMESHGUI_Preferences_SelectionDlg.h | 8 +- src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h | 4 +- src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h | 4 +- src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_RenumberingDlg.h | 4 +- src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_RevolutionDlg.h | 4 +- src/SMESHGUI/SMESHGUI_RotationDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_RotationDlg.h | 4 +- src/SMESHGUI/SMESHGUI_Selection.h | 4 +- src/SMESHGUI/SMESHGUI_SelectionOp.h | 4 +- src/SMESHGUI/SMESHGUI_SewingDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_SewingDlg.h | 4 +- src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx | 114 +- src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.h | 11 +- src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_SingleEditDlg.h | 4 +- src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_SmoothingDlg.h | 4 +- src/SMESHGUI/SMESHGUI_SpinBox.h | 4 +- .../SMESHGUI_StandardMeshInfosDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.h | 4 +- src/SMESHGUI/SMESHGUI_Swig.cxx | 24 + src/SMESHGUI/SMESHGUI_Swig.hxx | 4 +- src/SMESHGUI/SMESHGUI_Swig.i | 2 + src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_SymmetryDlg.h | 4 +- src/SMESHGUI/SMESHGUI_TranslationDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_TranslationDlg.h | 4 +- src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx | 8 +- src/SMESHGUI/SMESHGUI_TransparencyDlg.h | 4 +- src/SMESHGUI/SMESHGUI_Utils.h | 24 +- src/SMESHGUI/SMESHGUI_VTKUtils.cxx | 1 + src/SMESHGUI/SMESHGUI_VTKUtils.h | 45 +- src/SMESHGUI/SMESHGUI_XmlHandler.cxx | 15 + src/SMESHGUI/SMESHGUI_XmlHandler.h | 4 +- src/SMESHGUI/SMESH_SMESHGUI.hxx | 39 + src/SMESHGUI/SMESH_msg_en.po | 14 +- src/SMESH_I/SMESH.hxx | 14 +- src/SMESH_I/SMESH_1D_Algo_i.cxx | 3 +- src/SMESH_I/SMESH_1D_Algo_i.hxx | 4 +- src/SMESH_I/SMESH_2D_Algo_i.cxx | 3 +- src/SMESH_I/SMESH_2D_Algo_i.hxx | 4 +- src/SMESH_I/SMESH_2smeshpy.cxx | 391 +- src/SMESH_I/SMESH_2smeshpy.hxx | 51 +- src/SMESH_I/SMESH_3D_Algo_i.cxx | 3 +- src/SMESH_I/SMESH_3D_Algo_i.hxx | 2 +- src/SMESH_I/SMESH_Algo_i.cxx | 3 +- src/SMESH_I/SMESH_Algo_i.hxx | 4 +- src/SMESH_I/SMESH_Filter_i.cxx | 23 +- src/SMESH_I/SMESH_Filter_i.hxx | 80 +- src/SMESH_I/SMESH_Gen_i.cxx | 2564 ++-- src/SMESH_I/SMESH_Gen_i.hxx | 37 +- src/SMESH_I/SMESH_Gen_i_1.cxx | 9 +- src/SMESH_I/SMESH_Group_i.hxx | 8 +- src/SMESH_I/SMESH_Hypothesis_i.cxx | 18 +- src/SMESH_I/SMESH_Hypothesis_i.hxx | 13 +- src/SMESH_I/SMESH_MEDFamily_i.cxx | 3 +- src/SMESH_I/SMESH_MEDFamily_i.hxx | 4 +- src/SMESH_I/SMESH_MEDMesh_i.cxx | 16 +- src/SMESH_I/SMESH_MEDMesh_i.hxx | 4 +- src/SMESH_I/SMESH_MEDSupport_i.cxx | 15 +- src/SMESH_I/SMESH_MEDSupport_i.hxx | 11 +- src/SMESH_I/SMESH_MeshEditor_i.cxx | 7 +- src/SMESH_I/SMESH_MeshEditor_i.hxx | 4 +- src/SMESH_I/SMESH_Mesh_i.cxx | 53 +- src/SMESH_I/SMESH_Mesh_i.hxx | 52 +- src/SMESH_I/SMESH_Pattern_i.hxx | 13 +- src/SMESH_I/SMESH_PythonDump.hxx | 4 +- src/SMESH_I/SMESH_subMesh_i.cxx | 4 +- src/SMESH_I/SMESH_subMesh_i.hxx | 9 +- src/SMESH_SWIG/Makefile.in | 1 + src/SMESH_SWIG/PAL_MESH_041_mesh.py | 66 +- src/SMESH_SWIG/PAL_MESH_043_2D.py | 54 +- src/SMESH_SWIG/PAL_MESH_043_3D.py | 64 +- src/SMESH_SWIG/SMESH_AdvancedEditor.py | 92 +- src/SMESH_SWIG/SMESH_BelongToGeom.py | 28 +- src/SMESH_SWIG/SMESH_GroupFromGeom.py | 7 +- src/SMESH_SWIG/SMESH_GroupFromGeom2.py | 12 +- src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py | 13 +- src/SMESH_SWIG/SMESH_Nut.py | 79 +- src/SMESH_SWIG/SMESH_Partition1_tetra.py | 77 +- src/SMESH_SWIG/SMESH_blocks.py | 6 +- src/SMESH_SWIG/SMESH_box.py | 54 +- src/SMESH_SWIG/SMESH_box2_tetra.py | 77 +- src/SMESH_SWIG/SMESH_box3_tetra.py | 78 +- src/SMESH_SWIG/SMESH_box_tetra.py | 78 +- src/SMESH_SWIG/SMESH_controls.py | 143 +- src/SMESH_SWIG/SMESH_demo_hexa2_upd.py | 85 +- src/SMESH_SWIG/SMESH_fixation_hexa.py | 56 +- src/SMESH_SWIG/SMESH_fixation_netgen.py | 13 +- src/SMESH_SWIG/SMESH_fixation_tetra.py | 86 +- src/SMESH_SWIG/SMESH_flight_skin.py | 60 +- src/SMESH_SWIG/SMESH_freebord.py | 114 +- src/SMESH_SWIG/SMESH_hexaedre.py | 95 +- src/SMESH_SWIG/SMESH_mechanic.py | 120 +- src/SMESH_SWIG/SMESH_mechanic_editor.py | 170 +- src/SMESH_SWIG/SMESH_mechanic_netgen.py | 29 +- src/SMESH_SWIG/SMESH_mechanic_tetra.py | 89 +- src/SMESH_SWIG/SMESH_reg.py | 164 +- src/SMESH_SWIG/SMESH_test.py | 116 +- src/SMESH_SWIG/SMESH_test0.py | 1 - src/SMESH_SWIG/SMESH_test1.py | 109 +- src/SMESH_SWIG/SMESH_test1_AndDisplay.py | 111 + src/SMESH_SWIG/SMESH_test2.py | 33 +- src/SMESH_SWIG/SMESH_test4.py | 50 +- src/SMESH_SWIG/SMESH_test5.py | 21 +- src/SMESH_SWIG/batchmode_mefisto.py | 54 +- src/SMESH_SWIG/ex19_sphereINcube.py | 46 +- src/SMESH_SWIG/smesh.py | 1890 ++- src/StdMeshers/Makefile.in | 27 +- src/StdMeshers/SMESH_StdMeshers.hxx | 41 + src/StdMeshers/StdMeshers_Arithmetic1D.hxx | 4 +- src/StdMeshers/StdMeshers_AutomaticLength.hxx | 4 +- src/StdMeshers/StdMeshers_Deflection1D.cxx | 4 +- src/StdMeshers/StdMeshers_Deflection1D.hxx | 4 +- src/StdMeshers/StdMeshers_Distribution.cxx | 4 +- src/StdMeshers/StdMeshers_Distribution.hxx | 15 +- src/StdMeshers/StdMeshers_Hexa_3D.cxx | 3 +- src/StdMeshers/StdMeshers_Hexa_3D.hxx | 4 +- .../StdMeshers_LayerDistribution.cxx | 148 + .../StdMeshers_LayerDistribution.hxx | 93 + src/StdMeshers/StdMeshers_LengthFromEdges.hxx | 4 +- src/StdMeshers/StdMeshers_LocalLength.hxx | 4 +- src/StdMeshers/StdMeshers_MEFISTO_2D.cxx | 1 - src/StdMeshers/StdMeshers_MEFISTO_2D.hxx | 4 +- src/StdMeshers/StdMeshers_MaxElementArea.hxx | 4 +- .../StdMeshers_MaxElementVolume.cxx | 4 +- .../StdMeshers_MaxElementVolume.hxx | 4 +- .../StdMeshers_NotConformAllowed.cxx | 3 +- .../StdMeshers_NotConformAllowed.hxx | 4 +- src/StdMeshers/StdMeshers_NumberOfLayers.cxx | 162 + src/StdMeshers/StdMeshers_NumberOfLayers.hxx | 83 + .../StdMeshers_NumberOfSegments.hxx | 4 +- src/StdMeshers/StdMeshers_Penta_3D.cxx | 186 +- src/StdMeshers/StdMeshers_Penta_3D.hxx | 8 +- src/StdMeshers/StdMeshers_Prism_3D.cxx | 1785 +++ src/StdMeshers/StdMeshers_Prism_3D.hxx | 426 + .../StdMeshers_ProjectionSource1D.cxx | 232 + .../StdMeshers_ProjectionSource1D.hxx | 144 + .../StdMeshers_ProjectionSource2D.cxx | 300 + .../StdMeshers_ProjectionSource2D.hxx | 157 + .../StdMeshers_ProjectionSource3D.cxx | 299 + .../StdMeshers_ProjectionSource3D.hxx | 155 + src/StdMeshers/StdMeshers_ProjectionUtils.cxx | 1241 ++ src/StdMeshers/StdMeshers_ProjectionUtils.hxx | 200 + src/StdMeshers/StdMeshers_Projection_1D.cxx | 375 + src/StdMeshers/StdMeshers_Projection_1D.hxx | 67 + src/StdMeshers/StdMeshers_Projection_2D.cxx | 642 + src/StdMeshers/StdMeshers_Projection_2D.hxx | 65 + src/StdMeshers/StdMeshers_Projection_3D.cxx | 438 + src/StdMeshers/StdMeshers_Projection_3D.hxx | 63 + src/StdMeshers/StdMeshers_Propagation.hxx | 4 +- .../StdMeshers_QuadranglePreference.hxx | 4 +- src/StdMeshers/StdMeshers_Quadrangle_2D.cxx | 4 +- src/StdMeshers/StdMeshers_Quadrangle_2D.hxx | 6 +- src/StdMeshers/StdMeshers_QuadraticMesh.hxx | 4 +- src/StdMeshers/StdMeshers_RadialPrism_3D.cxx | 372 + src/StdMeshers/StdMeshers_RadialPrism_3D.hxx | 72 + src/StdMeshers/StdMeshers_Regular_1D.cxx | 2 - src/StdMeshers/StdMeshers_Regular_1D.hxx | 4 +- src/StdMeshers/StdMeshers_StartEndLength.hxx | 4 +- src/StdMeshersGUI/Makefile.in | 8 +- src/StdMeshersGUI/SMESH_StdMeshersGUI.hxx | 40 + src/StdMeshersGUI/StdMeshersGUI.cxx | 2 + .../StdMeshersGUI_DistrPreview.h | 4 +- src/StdMeshersGUI/StdMeshersGUI_DistrTable.h | 6 +- ...tdMeshersGUI_LayerDistributionParamWdg.cxx | 213 + .../StdMeshersGUI_LayerDistributionParamWdg.h | 85 + .../StdMeshersGUI_NbSegmentsCreator.h | 4 +- .../StdMeshersGUI_ObjectReferenceParamWdg.cxx | 206 + .../StdMeshersGUI_ObjectReferenceParamWdg.h | 111 + .../StdMeshersGUI_StdHypothesisCreator.cxx | 592 +- .../StdMeshersGUI_StdHypothesisCreator.h | 20 +- src/StdMeshersGUI/StdMeshers_images.po | 69 +- src/StdMeshersGUI/StdMeshers_msg_en.po | 83 +- src/StdMeshers_I/Makefile.in | 23 +- src/StdMeshers_I/SMESH_StdMeshers_I.hxx | 41 + .../StdMeshers_Arithmetic1D_i.cxx | 3 +- .../StdMeshers_Arithmetic1D_i.hxx | 4 +- .../StdMeshers_AutomaticLength_i.cxx | 3 +- .../StdMeshers_AutomaticLength_i.hxx | 4 +- .../StdMeshers_Deflection1D_i.cxx | 3 +- .../StdMeshers_Deflection1D_i.hxx | 4 +- src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx | 3 +- src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx | 4 +- .../StdMeshers_LayerDistribution_i.cxx | 216 + .../StdMeshers_LayerDistribution_i.hxx | 88 + .../StdMeshers_LengthFromEdges_i.cxx | 3 +- .../StdMeshers_LengthFromEdges_i.hxx | 4 +- src/StdMeshers_I/StdMeshers_LocalLength_i.cxx | 3 +- src/StdMeshers_I/StdMeshers_LocalLength_i.hxx | 4 +- src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx | 3 +- src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx | 4 +- .../StdMeshers_MaxElementArea_i.cxx | 3 +- .../StdMeshers_MaxElementArea_i.hxx | 4 +- .../StdMeshers_MaxElementVolume_i.cxx | 3 +- .../StdMeshers_MaxElementVolume_i.hxx | 4 +- .../StdMeshers_NotConformAllowed_i.cxx | 4 +- .../StdMeshers_NotConformAllowed_i.hxx | 4 +- .../StdMeshers_NumberOfLayers_i.cxx | 136 + .../StdMeshers_NumberOfLayers_i.hxx | 75 + .../StdMeshers_NumberOfSegments_i.cxx | 3 +- .../StdMeshers_NumberOfSegments_i.hxx | 4 +- src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx | 106 + src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx | 114 + src/StdMeshers_I/StdMeshers_Prism_3D_i.cxx | 104 + src/StdMeshers_I/StdMeshers_Prism_3D_i.hxx | 83 + .../StdMeshers_ProjectionSource1D_i.cxx | 288 + .../StdMeshers_ProjectionSource1D_i.hxx | 118 + .../StdMeshers_ProjectionSource2D_i.cxx | 300 + .../StdMeshers_ProjectionSource2D_i.hxx | 122 + .../StdMeshers_ProjectionSource3D_i.cxx | 299 + .../StdMeshers_ProjectionSource3D_i.hxx | 122 + .../StdMeshers_Projection_1D_2D_3D_i.cxx | 140 + .../StdMeshers_Projection_1D_2D_3D_i.hxx | 109 + src/StdMeshers_I/StdMeshers_Propagation_i.cxx | 3 +- src/StdMeshers_I/StdMeshers_Propagation_i.hxx | 4 +- .../StdMeshers_QuadranglePreference_i.cxx | 3 +- .../StdMeshers_QuadranglePreference_i.hxx | 4 +- .../StdMeshers_Quadrangle_2D_i.cxx | 3 +- .../StdMeshers_Quadrangle_2D_i.hxx | 4 +- .../StdMeshers_QuadraticMesh_i.hxx | 4 +- src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx | 3 +- src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx | 4 +- .../StdMeshers_StartEndLength_i.cxx | 3 +- .../StdMeshers_StartEndLength_i.hxx | 4 +- src/StdMeshers_I/StdMeshers_i.cxx | 34 +- 701 files changed, 87448 insertions(+), 53188 deletions(-) create mode 100644 doc/salome/gui/SMESH/image157.gif create mode 100644 doc/salome/gui/SMESH/netgen_2d_and_3d_hypotheses.htm create mode 100644 doc/salome/gui/SMESH/pics/distribution_of_layers.png create mode 100644 doc/salome/gui/SMESH/pics/image157.gif create mode 100644 doc/salome/gui/SMESH/pics/netgen2d.png create mode 100644 doc/salome/gui/SMESH/pics/number_of_layers.png create mode 100644 doc/salome/gui/SMESH/pics/projection_1d.png create mode 100644 doc/salome/gui/SMESH/pics/projection_2d.png create mode 100644 doc/salome/gui/SMESH/pics/projection_3d.png create mode 100644 doc/salome/gui/SMESH/pics/set_rotation_point_dialog1.png create mode 100644 doc/salome/gui/SMESH/pics/set_rotation_point_dialog2.png create mode 100644 doc/salome/gui/SMESH/pics/view_rotation_point.png create mode 100644 doc/salome/gui/SMESH/prism_3d_algorithm.htm create mode 100644 doc/salome/gui/SMESH/projection_algorithms.htm create mode 100644 doc/salome/gui/SMESH/radial_prism.htm create mode 100644 resources/mesh_hypo_layer_distribution.png create mode 100644 resources/mesh_hypo_source_3d.png create mode 100644 resources/mesh_hypo_source_edge.png create mode 100644 resources/mesh_hypo_source_face.png create mode 100644 resources/mesh_tree_algo_projection_2d.png create mode 100644 resources/mesh_tree_algo_projection_3d.png create mode 100644 resources/mesh_tree_algo_radial_prism.png create mode 100644 resources/mesh_tree_hypo_layers_distribution.png create mode 100644 resources/mesh_tree_hypo_projection_2d.png create mode 100644 resources/mesh_tree_hypo_projection_3d.png create mode 100644 resources/mesh_tree_hypo_source_3d_shape.png create mode 100644 resources/mesh_tree_hypo_source_edge.png create mode 100644 resources/mesh_tree_hypo_source_face.png create mode 100755 src/DriverDAT/SMESH_DriverDAT.hxx create mode 100755 src/DriverMED/SMESH_DriverMED.hxx create mode 100755 src/DriverSTL/SMESH_DriverSTL.hxx create mode 100755 src/DriverUNV/SMESH_DriverUNV.hxx create mode 100755 src/SMDS/SMESH_SMDS.hxx create mode 100755 src/SMESH/SMESH_SMESH.hxx create mode 100644 src/SMESH/SMESH_subMeshEventListener.hxx create mode 100755 src/SMESHDS/SMESHDS_DataMapOfShape.hxx create mode 100755 src/SMESHDS/SMESH_SMESHDS.hxx create mode 100644 src/SMESHGUI/SMESHGUI_CreateHypothesesDlg.h create mode 100644 src/SMESHGUI/SMESHGUI_EditHypothesesDlg.h create mode 100755 src/SMESHGUI/SMESHGUI_PrecisionDlg.h create mode 100755 src/SMESHGUI/SMESH_SMESHGUI.hxx create mode 100644 src/SMESH_SWIG/SMESH_test1_AndDisplay.py create mode 100755 src/StdMeshers/SMESH_StdMeshers.hxx create mode 100644 src/StdMeshers/StdMeshers_LayerDistribution.cxx create mode 100644 src/StdMeshers/StdMeshers_LayerDistribution.hxx create mode 100644 src/StdMeshers/StdMeshers_NumberOfLayers.cxx create mode 100644 src/StdMeshers/StdMeshers_NumberOfLayers.hxx create mode 100644 src/StdMeshers/StdMeshers_Prism_3D.cxx create mode 100644 src/StdMeshers/StdMeshers_Prism_3D.hxx create mode 100644 src/StdMeshers/StdMeshers_ProjectionSource1D.cxx create mode 100644 src/StdMeshers/StdMeshers_ProjectionSource1D.hxx create mode 100644 src/StdMeshers/StdMeshers_ProjectionSource2D.cxx create mode 100644 src/StdMeshers/StdMeshers_ProjectionSource2D.hxx create mode 100644 src/StdMeshers/StdMeshers_ProjectionSource3D.cxx create mode 100644 src/StdMeshers/StdMeshers_ProjectionSource3D.hxx create mode 100644 src/StdMeshers/StdMeshers_ProjectionUtils.cxx create mode 100644 src/StdMeshers/StdMeshers_ProjectionUtils.hxx create mode 100644 src/StdMeshers/StdMeshers_Projection_1D.cxx create mode 100644 src/StdMeshers/StdMeshers_Projection_1D.hxx create mode 100644 src/StdMeshers/StdMeshers_Projection_2D.cxx create mode 100644 src/StdMeshers/StdMeshers_Projection_2D.hxx create mode 100644 src/StdMeshers/StdMeshers_Projection_3D.cxx create mode 100644 src/StdMeshers/StdMeshers_Projection_3D.hxx create mode 100644 src/StdMeshers/StdMeshers_RadialPrism_3D.cxx create mode 100644 src/StdMeshers/StdMeshers_RadialPrism_3D.hxx create mode 100755 src/StdMeshersGUI/SMESH_StdMeshersGUI.hxx create mode 100644 src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx create mode 100644 src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.h create mode 100644 src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.cxx create mode 100644 src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.h create mode 100755 src/StdMeshers_I/SMESH_StdMeshers_I.hxx create mode 100644 src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx create mode 100644 src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx create mode 100644 src/StdMeshers_I/StdMeshers_NumberOfLayers_i.cxx create mode 100644 src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx create mode 100644 src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx create mode 100644 src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx create mode 100644 src/StdMeshers_I/StdMeshers_Prism_3D_i.cxx create mode 100644 src/StdMeshers_I/StdMeshers_Prism_3D_i.hxx create mode 100644 src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx create mode 100644 src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx create mode 100644 src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx create mode 100644 src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx create mode 100644 src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx create mode 100644 src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx create mode 100644 src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.cxx create mode 100644 src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.hxx diff --git a/doc/salome/gui/SMESH/about_viewing_meshes.htm b/doc/salome/gui/SMESH/about_viewing_meshes.htm index f7af36140..d47aa94f8 100755 --- a/doc/salome/gui/SMESH/about_viewing_meshes.htm +++ b/doc/salome/gui/SMESH/about_viewing_meshes.htm @@ -1,169 +1,169 @@ - - - - - -About viewing meshes - - - - - - - - - - - - -

Viewing meshes

- -

After definition of algorithms and hypotheses a new mesh is listed in - the Object Browser. Right-click on it and select Compute - the mesh will be automatically - displayed in the VTK - 3D Viewer. Alternatively click - Display only to hide all other objects at the same time.

- -

 

- -

After the mesh has appeared in the Viewer, you can select it with left - mouse click and  get - information about it, change its presentation parameters and access to - other useful options by right-clicking on the selected mesh.

- -

  

- -

- -

 

- - - -

 

- - - - + + + + + +About viewing meshes + + + + + + + + + + + + +

Viewing meshes

+ +

After definition of algorithms and hypotheses a new mesh is listed in + the Object Browser. Right-click on it and select Compute - the mesh will be automatically + displayed in the VTK + 3D Viewer. Alternatively click + Display only to hide all other objects at the same time.

+ +

 

+ +

After the mesh has appeared in the Viewer, you can select it with left + mouse click and  get + information about it, change its presentation parameters and access to + other useful options by right-clicking on the selected mesh.

+ +

  

+ +

+ +

 

+ + + +

 

+ + + + diff --git a/doc/salome/gui/SMESH/adding_quadratic_nodes_and_elements.htm b/doc/salome/gui/SMESH/adding_quadratic_nodes_and_elements.htm index 86db2586e..b4d5067d2 100755 --- a/doc/salome/gui/SMESH/adding_quadratic_nodes_and_elements.htm +++ b/doc/salome/gui/SMESH/adding_quadratic_nodes_and_elements.htm @@ -1,124 +1,124 @@ - - - - - -Adding Quadratic Nodes and Elements - - - - - - - - - - -

Adding Quadratic Elements

- -

MESH modules allows you to work with Quadratic - Elements.

- -

Quadratic Edge in not a straight but a broken line and can be defined - by three points: first, middle and last. All more complex Quadratic - Elements differ from ordinary ones in that they consist of Quadratic - Edges.

- -

To - add a quadratic element to your mesh:

- -

1. Select your mesh in the Object Browser - or in the 3D viewer.

- -

2. From the Modification - menu choose the Add item - and select one of the following:

- -

- -

To create any Quadratic - Element specify the nodes which will form your triangle by selecting - them in the 3D viewer with pressed Shift button. Their numbers will appear - in the dialog box as Corner Nodes - (alternatively you can just input numbers in this field without selection).The - edges formed by the corner nodes will appear in the table. To define the - middle nodes for each edge double-click on the respective field and input - the number of the node. All edges and the object formed by them will be - displayed in the Object browser. When all edges are defined you will be - able to click OK or Apply - button to add the element to the mesh.

- -

 

- -

Reverse - button for Quadratic Edges switches the first and the last nodes. For all other elements it reverses the element. -

- -

 

- - - - + + + + + +Adding Quadratic Nodes and Elements + + + + + + + + + + +

Adding Quadratic Elements

+ +

MESH modules allows you to work with Quadratic + Elements.

+ +

Quadratic Edge in not a straight but a broken line and can be defined + by three points: first, middle and last. All more complex Quadratic + Elements differ from ordinary ones in that they consist of Quadratic + Edges.

+ +

To + add a quadratic element to your mesh:

+ +

1. Select your mesh in the Object Browser + or in the 3D viewer.

+ +

2. From the Modification + menu choose the Add item + and select one of the following:

+ +

+ +

To create any Quadratic + Element specify the nodes which will form your triangle by selecting + them in the 3D viewer with pressed Shift button. Their numbers will appear + in the dialog box as Corner Nodes + (alternatively you can just input numbers in this field without selection).The + edges formed by the corner nodes will appear in the table. To define the + middle nodes for each edge double-click on the respective field and input + the number of the node. All edges and the object formed by them will be + displayed in the Object browser. When all edges are defined you will be + able to click OK or Apply + button to add the element to the mesh.

+ +

 

+ +

Reverse + button for Quadratic Edges switches the first and the last nodes. For all other elements it reverses the element. +

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/aspect_ratio_3d.htm b/doc/salome/gui/SMESH/aspect_ratio_3d.htm index 9b9e5bd0d..bd1d7ddfc 100755 --- a/doc/salome/gui/SMESH/aspect_ratio_3d.htm +++ b/doc/salome/gui/SMESH/aspect_ratio_3d.htm @@ -1,203 +1,203 @@ - - - - - -Aspect ratio 3D - - - - - - - - - - - - - -

Aspect ratio 3D

- -

- -

 

- -

The Aspect Ratio 3D mesh quality criterion calculates - the same parameter as the Aspect ratio - criterion, but it is applied to 3D mesh elements: tetrahedrons, pentahedrons, - hexahedrons, etc.  

- -

 

- - - -

 

- -

 

- -

,

- -

 

- -

where SK is the sum of surfaces of the faces - of К and VK is the volume of К :

- -

 

- -

T

- -

 

- - - -

, where Qi represents the value of Qk for all possible simplexes (of the - same dimension as the element) that compose the element.

- -

For example, a hexahedron is split in 6 tetrahedrons, the Aspect - ratio 3D is calculated for each of them, then the greatest Qk is considered to be the  Aspect ratio 3D - criterion for the whole  hexahedron.

- -

- -

 

- -

To apply the Aspect Ratio 3D quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Aspect Ratio 3D or click button of the toolbar. - Your mesh will be displayed in the viewer with its elements colored according - to the applied mesh quality control criterion:

- -

 

- -

See Also - a sample TUI Script of an Aspect - Ratio 3D quality control operation.  

- -

 

- -

 

- -

 

- -

 

- - - - + + + + + +Aspect ratio 3D + + + + + + + + + + + + + +

Aspect ratio 3D

+ +

+ +

 

+ +

The Aspect Ratio 3D mesh quality criterion calculates + the same parameter as the Aspect ratio + criterion, but it is applied to 3D mesh elements: tetrahedrons, pentahedrons, + hexahedrons, etc.  

+ +

 

+ + + +

 

+ +

 

+ +

,

+ +

 

+ +

where SK is the sum of surfaces of the faces + of К and VK is the volume of К :

+ +

 

+ +

T

+ +

 

+ + + +

, where Qi represents the value of Qk for all possible simplexes (of the + same dimension as the element) that compose the element.

+ +

For example, a hexahedron is split in 6 tetrahedrons, the Aspect + ratio 3D is calculated for each of them, then the greatest Qk is considered to be the  Aspect ratio 3D + criterion for the whole  hexahedron.

+ +

+ +

 

+ +

To apply the Aspect Ratio 3D quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Aspect Ratio 3D or click button of the toolbar. + Your mesh will be displayed in the viewer with its elements colored according + to the applied mesh quality control criterion:

+ +

 

+ +

See Also + a sample TUI Script of an Aspect + Ratio 3D quality control operation.  

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/borders_at_multi-connection.htm b/doc/salome/gui/SMESH/borders_at_multi-connection.htm index cf5d3a9ca..8ad86b523 100755 --- a/doc/salome/gui/SMESH/borders_at_multi-connection.htm +++ b/doc/salome/gui/SMESH/borders_at_multi-connection.htm @@ -1,121 +1,121 @@ - - - - - -Borders at multi-connection - - - - - - - - - - - - - -

Borders at multi-connection

- -

This mesh quality control highlights borders of faces - consisting of edges belonging to several faces. The amount of faces is - specified by user.

- -

 

- -

- -

 

- -

In this picture the borders at multi-connection are displayed in blue.

- -

 

- -

See Also - a sample TUI Script of a Borders - at Multi-Connection quality control operation.  

- -

 

- - - - + + + + + +Borders at multi-connection + + + + + + + + + + + + + +

Borders at multi-connection

+ +

This mesh quality control highlights borders of faces + consisting of edges belonging to several faces. The amount of faces is + specified by user.

+ +

 

+ +

+ +

 

+ +

In this picture the borders at multi-connection are displayed in blue.

+ +

 

+ +

See Also + a sample TUI Script of a Borders + at Multi-Connection quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/borders_at_multiconnection_2d.htm b/doc/salome/gui/SMESH/borders_at_multiconnection_2d.htm index 3cb8e549d..2e9e180c0 100755 --- a/doc/salome/gui/SMESH/borders_at_multiconnection_2d.htm +++ b/doc/salome/gui/SMESH/borders_at_multiconnection_2d.htm @@ -1,115 +1,115 @@ - - - - - -Borders at multiconnection 2D - - - - - - - - - - - - - -

Borders at multi-connection 2D

- -

This mesh quality control highlights borders of elements - of mesh, consisting of edges belonging to several elements of mesh.

- -

 

- -

        

- -

 

- -

See Also - a sample TUI Script of a Borders - at Multi-Connection quality control operation.  

- -

 

- - - - + + + + + +Borders at multiconnection 2D + + + + + + + + + + + + + +

Borders at multi-connection 2D

+ +

This mesh quality control highlights borders of elements + of mesh, consisting of edges belonging to several elements of mesh.

+ +

 

+ +

        

+ +

 

+ +

See Also + a sample TUI Script of a Borders + at Multi-Connection quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/clipping.htm b/doc/salome/gui/SMESH/clipping.htm index 9cfba3b64..dec479c99 100755 --- a/doc/salome/gui/SMESH/clipping.htm +++ b/doc/salome/gui/SMESH/clipping.htm @@ -1,140 +1,140 @@ - - - - - -Clipping - - - - - - - - - - - - -

Clipping

- -

Using this menu you can create cross-section views (clipping planes) - of your mesh.

- -

 

- -

To start, click on the New button.

- -

 

- -

- -

 

- -

Now you can define the parameters of your cross-section: Orientation -  (X-Y, X-Z - or Y-Z); Distance between the - opposite extremities of the object, if - it is set to 0.5 the object is split in two halves; and Rotation - (in angle degrees) around X (Y to Z) - and around Y (X to Z). - If the Show preview button is - on, you can see the clipping plane in the Object - window.

- -

 

- -

- -

 

- -

If the - Auto Apply button is on, you can preview - the cross-section in the Object window

- -

 

- -

- -

 

- -

To get - a new object from Clipping, click - Ok.

- -

 

- -

 

- - - - + + + + + +Clipping + + + + + + + + + + + + +

Clipping

+ +

Using this menu you can create cross-section views (clipping planes) + of your mesh.

+ +

 

+ +

To start, click on the New button.

+ +

 

+ +

+ +

 

+ +

Now you can define the parameters of your cross-section: Orientation +  (X-Y, X-Z + or Y-Z); Distance between the + opposite extremities of the object, if + it is set to 0.5 the object is split in two halves; and Rotation + (in angle degrees) around X (Y to Z) + and around Y (X to Z). + If the Show preview button is + on, you can see the clipping plane in the Object + window.

+ +

 

+ +

+ +

 

+ +

If the + Auto Apply button is on, you can preview + the cross-section in the Object window

+ +

 

+ +

+ +

 

+ +

To get + a new object from Clipping, click + Ok.

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/constructing_meshes.htm b/doc/salome/gui/SMESH/constructing_meshes.htm index 02059fa6b..a643f436f 100755 --- a/doc/salome/gui/SMESH/constructing_meshes.htm +++ b/doc/salome/gui/SMESH/constructing_meshes.htm @@ -1,448 +1,448 @@ - - - - - -Constructing Meshes - - - - - - - - - - - -

Creating Meshes

- -

First of all see Example - of 3d mesh generation, which is an example of good python script style - for Mesh module.

- -

Other examples of python - scripts will be also updated soon to use smesh package instead of direct - usage of idl interface.

- -

Construction of a Mesh

- -

import - geompy

- -

import smesh

- -

 

- -

# create a box

- -

box = geompy.MakeBox(0., - 0., 0., 100., 200., 300.)

- -

idbox = geompy.addToStudy(box, - "box")

- -

 

- -

# create a mesh

- -

tetra = smesh.Mesh(box, - "MeshBox")

- -

 

- -

algo1D = tetra.Segment()

- -

algo1D.NumberOfSegments(7)

- -

 

- -

algo2D = tetra.Triangle()

- -

algo2D.MaxElementArea(800.)

- -

 

- -

algo3D = tetra.Tetrahedron(smesh.NETGEN)

- -

algo3D.MaxElementVolume(900.)

- -

 

- -

# compute the mesh

- -

ret = tetra.Compute()

- -

if ret == 0:

- -

    print - "problem when computing the mesh"

- -

else:

- -

    print - "mesh computed"

- -

    pass -

- -

 

- -

 

- -

Construction of a Submesh

- -

from - geompy import *

- -

import smesh

- -

 

- -

# create a box

- -

box = MakeBoxDXDYDZ(10., 10., 10.)

- -

addToStudy(box, "Box")

- -

 

- -

# select one edge of - the box for definition of a local hypothesis

- -

p5 = MakeVertex(5., 0., 0.)

- -

EdgeX = GetEdgeNearPoint(box, p5)

- -

addToStudyInFather(box, EdgeX, "Edge - [0,0,0 - 10,0,0]")

- -

 

- -

# create a hexahedral - mesh on the box

- -

quadra = smesh.Mesh(box, "Box : quadrangle - 2D mesh")

- -

 

- -

# create a regular - 1D algorithm for the faces

- -

algo1D = quadra.Segment()

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut

- -

# all the edges in - a fixed number of segments

- -

algo1D.NumberOfSegments(4)

- -

 

- -

# create a quadrangle - 2D algorithm for the faces

- -

quadra.Quadrangle()

- -

 

- -

# construct a submesh - on the edge with a local hypothesis

- -

algo_local = quadra.Segment(EdgeX)

- -

 

- -

# define "Arithmetic1D" - hypothesis to cut the edge - in several segments with increasing arithmetic length

- -

algo_local.Arithmetic1D(1, 4)

- -

 

- -

# define "Propagation" - hypothesis that propagates all other hypotheses

- -

# on all edges of the - opposite side in case of quadrangular faces

- -

algo_local.Propagation()

- -

 

- -

# compute the mesh

- -

quadra.Compute()

- -

 

- -

Editing of a mesh

- -

import - geompy

- -

import smesh

- -

 

- -

def PrintMeshInfo(theMesh):

- -

    aMesh - = theMesh.GetMesh()

- -

    print - "Information about mesh:"

- -

    print - "Number of nodes       : - ", aMesh.NbNodes()

- -

    print - "Number of edges       : - ", aMesh.NbEdges()

- -

    print - "Number of faces       : - ", aMesh.NbFaces()

- -

    print - "Number of volumes     : - ", aMesh.NbVolumes()

- -

    pass

- -

 

- -

# create a box

- -

box = geompy.MakeBox(0., 0., 0., 20., - 20., 20.)

- -

geompy.addToStudy(box, "box")

- -

 

- -

# select one edge of - the box for definition of a local hypothesis

- -

subShapeList = geompy.SubShapeAll(box, - geompy.ShapeType["EDGE"])

- -

edge = subShapeList[0]

- -

name = geompy.SubShapeName(edge, box)

- -

geompy.addToStudyInFather(box, edge, name)

- -

 

- -

# create a mesh

- -

tria = smesh.Mesh(box, "Mesh 2D")

- -

algo1D = tria.Segment()

- -

hyp1 = algo1D.NumberOfSegments(3)

- -

algo2D = tria.Triangle()

- -

hyp2 = algo2D.MaxElementArea(10.)

- -

 

- -

# create a sub-mesh

- -

algo_local = tria.Segment(edge)

- -

hyp3 = algo_local.Arithmetic1D(1, 6)

- -

hyp4 = algo_local.Propagation()

- -

 

- -

# compute the mesh

- -

tria.Compute()

- -

PrintMeshInfo(tria)

- -

 

- -

# remove a local hypothesis

- -

mesh = tria.GetMesh()

- -

mesh.RemoveHypothesis(edge, hyp4)

- -

 

- -

# compute the mesh

- -

tria.Compute()

- -

PrintMeshInfo(tria)

- -

 

- -

# change the value - of the 2D hypothesis

- -

hyp2.SetMaxElementArea(2.)

- -

 

- -

# compute the mesh

- -

tria.Compute()

- -

PrintMeshInfo(tria)

- -

 

- -

Export of a Mesh

- -

import geompy

- -

import smesh

- -

 

- -

# create a box

- -

box = geompy.MakeBox(0., - 0., 0., 100., 200., 300.)

- -

idbox = geompy.addToStudy(box, - "box")

- -

 

- -

# create a mesh

- -

tetra = smesh.Mesh(box, - "MeshBox")

- -

 

- -

algo1D = tetra.Segment()

- -

algo1D.NumberOfSegments(7)

- -

 

- -

algo2D = tetra.Triangle()

- -

algo2D.MaxElementArea(800.)

- -

 

- -

algo3D = tetra.Tetrahedron(smesh.NETGEN)

- -

algo3D.MaxElementVolume(900.)

- -

 

- -

# compute the mesh

- -

tetra.Compute()

- -

 

- -

# export the mesh in a - MED file

- -

tetra.ExportMED("/tmp/meshMED.med", - 0)

- - - - + + + + + +Constructing Meshes + + + + + + + + + + + +

Creating Meshes

+ +

First of all see Example + of 3d mesh generation, which is an example of good python script style + for Mesh module.

+ +

Other examples of python + scripts will be also updated soon to use smesh package instead of direct + usage of idl interface.

+ +

Construction of a Mesh

+ +

import + geompy

+ +

import smesh

+ +

 

+ +

# create a box

+ +

box = geompy.MakeBox(0., + 0., 0., 100., 200., 300.)

+ +

idbox = geompy.addToStudy(box, + "box")

+ +

 

+ +

# create a mesh

+ +

tetra = smesh.Mesh(box, + "MeshBox")

+ +

 

+ +

algo1D = tetra.Segment()

+ +

algo1D.NumberOfSegments(7)

+ +

 

+ +

algo2D = tetra.Triangle()

+ +

algo2D.MaxElementArea(800.)

+ +

 

+ +

algo3D = tetra.Tetrahedron(smesh.NETGEN)

+ +

algo3D.MaxElementVolume(900.)

+ +

 

+ +

# compute the mesh

+ +

ret = tetra.Compute()

+ +

if ret == 0:

+ +

    print + "problem when computing the mesh"

+ +

else:

+ +

    print + "mesh computed"

+ +

    pass +

+ +

 

+ +

 

+ +

Construction of a Submesh

+ +

from + geompy import *

+ +

import smesh

+ +

 

+ +

# create a box

+ +

box = MakeBoxDXDYDZ(10., 10., 10.)

+ +

addToStudy(box, "Box")

+ +

 

+ +

# select one edge of + the box for definition of a local hypothesis

+ +

p5 = MakeVertex(5., 0., 0.)

+ +

EdgeX = GetEdgeNearPoint(box, p5)

+ +

addToStudyInFather(box, EdgeX, "Edge + [0,0,0 - 10,0,0]")

+ +

 

+ +

# create a hexahedral + mesh on the box

+ +

quadra = smesh.Mesh(box, "Box : quadrangle + 2D mesh")

+ +

 

+ +

# create a regular + 1D algorithm for the faces

+ +

algo1D = quadra.Segment()

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut

+ +

# all the edges in + a fixed number of segments

+ +

algo1D.NumberOfSegments(4)

+ +

 

+ +

# create a quadrangle + 2D algorithm for the faces

+ +

quadra.Quadrangle()

+ +

 

+ +

# construct a submesh + on the edge with a local hypothesis

+ +

algo_local = quadra.Segment(EdgeX)

+ +

 

+ +

# define "Arithmetic1D" + hypothesis to cut the edge + in several segments with increasing arithmetic length

+ +

algo_local.Arithmetic1D(1, 4)

+ +

 

+ +

# define "Propagation" + hypothesis that propagates all other hypotheses

+ +

# on all edges of the + opposite side in case of quadrangular faces

+ +

algo_local.Propagation()

+ +

 

+ +

# compute the mesh

+ +

quadra.Compute()

+ +

 

+ +

Editing of a mesh

+ +

import + geompy

+ +

import smesh

+ +

 

+ +

def PrintMeshInfo(theMesh):

+ +

    aMesh + = theMesh.GetMesh()

+ +

    print + "Information about mesh:"

+ +

    print + "Number of nodes       : + ", aMesh.NbNodes()

+ +

    print + "Number of edges       : + ", aMesh.NbEdges()

+ +

    print + "Number of faces       : + ", aMesh.NbFaces()

+ +

    print + "Number of volumes     : + ", aMesh.NbVolumes()

+ +

    pass

+ +

 

+ +

# create a box

+ +

box = geompy.MakeBox(0., 0., 0., 20., + 20., 20.)

+ +

geompy.addToStudy(box, "box")

+ +

 

+ +

# select one edge of + the box for definition of a local hypothesis

+ +

subShapeList = geompy.SubShapeAll(box, + geompy.ShapeType["EDGE"])

+ +

edge = subShapeList[0]

+ +

name = geompy.SubShapeName(edge, box)

+ +

geompy.addToStudyInFather(box, edge, name)

+ +

 

+ +

# create a mesh

+ +

tria = smesh.Mesh(box, "Mesh 2D")

+ +

algo1D = tria.Segment()

+ +

hyp1 = algo1D.NumberOfSegments(3)

+ +

algo2D = tria.Triangle()

+ +

hyp2 = algo2D.MaxElementArea(10.)

+ +

 

+ +

# create a sub-mesh

+ +

algo_local = tria.Segment(edge)

+ +

hyp3 = algo_local.Arithmetic1D(1, 6)

+ +

hyp4 = algo_local.Propagation()

+ +

 

+ +

# compute the mesh

+ +

tria.Compute()

+ +

PrintMeshInfo(tria)

+ +

 

+ +

# remove a local hypothesis

+ +

mesh = tria.GetMesh()

+ +

mesh.RemoveHypothesis(edge, hyp4)

+ +

 

+ +

# compute the mesh

+ +

tria.Compute()

+ +

PrintMeshInfo(tria)

+ +

 

+ +

# change the value + of the 2D hypothesis

+ +

hyp2.SetMaxElementArea(2.)

+ +

 

+ +

# compute the mesh

+ +

tria.Compute()

+ +

PrintMeshInfo(tria)

+ +

 

+ +

Export of a Mesh

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create a box

+ +

box = geompy.MakeBox(0., + 0., 0., 100., 200., 300.)

+ +

idbox = geompy.addToStudy(box, + "box")

+ +

 

+ +

# create a mesh

+ +

tetra = smesh.Mesh(box, + "MeshBox")

+ +

 

+ +

algo1D = tetra.Segment()

+ +

algo1D.NumberOfSegments(7)

+ +

 

+ +

algo2D = tetra.Triangle()

+ +

algo2D.MaxElementArea(800.)

+ +

 

+ +

algo3D = tetra.Tetrahedron(smesh.NETGEN)

+ +

algo3D.MaxElementVolume(900.)

+ +

 

+ +

# compute the mesh

+ +

tetra.Compute()

+ +

 

+ +

# export the mesh in a + MED file

+ +

tetra.ExportMED("/tmp/meshMED.med", + 0)

+ + + + diff --git a/doc/salome/gui/SMESH/cshdat_robohelp.htm b/doc/salome/gui/SMESH/cshdat_robohelp.htm index dae507e12..4a4ee57e1 100755 --- a/doc/salome/gui/SMESH/cshdat_robohelp.htm +++ b/doc/salome/gui/SMESH/cshdat_robohelp.htm @@ -1,258 +1,258 @@ - - -Mesh Module Reference Manual - - - - - - - - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/cshdat_webhelp.htm b/doc/salome/gui/SMESH/cshdat_webhelp.htm index 6d79e6f4f..db3b49a38 100755 --- a/doc/salome/gui/SMESH/cshdat_webhelp.htm +++ b/doc/salome/gui/SMESH/cshdat_webhelp.htm @@ -1,251 +1,251 @@ - - -Mesh Module Reference Manual - - - - - - - - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/default.css b/doc/salome/gui/SMESH/default.css index de2e5d955..1f8d6d772 100755 --- a/doc/salome/gui/SMESH/default.css +++ b/doc/salome/gui/SMESH/default.css @@ -1,101 +1,101 @@ -BODY { - background-color:#ffffff; - font-family:"Times New Roman" , serif; } -H1 { - font-weight:bold; - font-size:24.0pt; } -LI.kadov-H1 { - font-weight:bold; - font-size:24.0pt; } -H2 { - font-weight:bold; - font-size:18.0pt; } -LI.kadov-H2 { - font-weight:bold; - font-size:18.0pt; } -H3 { - font-weight:bold; - font-size:14.0pt; } -LI.kadov-H3 { - font-weight:bold; - font-size:14.0pt; } -H4 { - font-weight:bold; - font-size:12.0pt; } -LI.kadov-H4 { - font-weight:bold; - font-size:12.0pt; } -H5 { - font-weight:bold; - font-size:10.0pt; } -LI.kadov-H5 { - font-weight:bold; - font-size:10.0pt; } -H6 { - font-weight:bold; - font-size:8.0pt; } -LI.kadov-H6 { - font-weight:bold; - font-size:8.0pt; } -P { - font-size:12.0pt; - margin-top:0pt; - margin-bottom:0pt; } -LI.kadov-P { - font-size:12.0pt; } -A.expandspot { - color:#008000; - cursor:hand; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -SPAN.expandtext { - font-style:italic; - font-weight:normal; - color:#ff0000; } -A.dropspot { - cursor:hand; - color:#008000; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -A.glossterm { - color:#800000; - cursor:hand; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -SPAN.glosstext { - font-style:italic; - font-weight:normal; - color:#0000ff; } -OL { - margin-top:0px; - margin-bottom:0px; } -UL { - margin-top:0px; - margin-bottom:0px; } -A:active { } -A:hover { - x-text-underline:Off; - text-decoration:none; } -A:link { - x-text-underline:Off; - text-decoration:none; } -A:visited { - x-text-underline:Off; - text-decoration:none; } -P.TODO { - font-weight:normal; - font-style:italic; - font-family:"Arial Black" , sans-serif; } -LI.kadov-P-CTODO { - font-weight:normal; - font-style:italic; - font-family:"Arial Black" , sans-serif; } +BODY { + background-color:#ffffff; + font-family:"Times New Roman" , serif; } +H1 { + font-weight:bold; + font-size:24.0pt; } +LI.kadov-H1 { + font-weight:bold; + font-size:24.0pt; } +H2 { + font-weight:bold; + font-size:18.0pt; } +LI.kadov-H2 { + font-weight:bold; + font-size:18.0pt; } +H3 { + font-weight:bold; + font-size:14.0pt; } +LI.kadov-H3 { + font-weight:bold; + font-size:14.0pt; } +H4 { + font-weight:bold; + font-size:12.0pt; } +LI.kadov-H4 { + font-weight:bold; + font-size:12.0pt; } +H5 { + font-weight:bold; + font-size:10.0pt; } +LI.kadov-H5 { + font-weight:bold; + font-size:10.0pt; } +H6 { + font-weight:bold; + font-size:8.0pt; } +LI.kadov-H6 { + font-weight:bold; + font-size:8.0pt; } +P { + font-size:12.0pt; + margin-top:0pt; + margin-bottom:0pt; } +LI.kadov-P { + font-size:12.0pt; } +A.expandspot { + color:#008000; + cursor:hand; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +SPAN.expandtext { + font-style:italic; + font-weight:normal; + color:#ff0000; } +A.dropspot { + cursor:hand; + color:#008000; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +A.glossterm { + color:#800000; + cursor:hand; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +SPAN.glosstext { + font-style:italic; + font-weight:normal; + color:#0000ff; } +OL { + margin-top:0px; + margin-bottom:0px; } +UL { + margin-top:0px; + margin-bottom:0px; } +A:active { } +A:hover { + x-text-underline:Off; + text-decoration:none; } +A:link { + x-text-underline:Off; + text-decoration:none; } +A:visited { + x-text-underline:Off; + text-decoration:none; } +P.TODO { + font-weight:normal; + font-style:italic; + font-family:"Arial Black" , sans-serif; } +LI.kadov-P-CTODO { + font-weight:normal; + font-style:italic; + font-family:"Arial Black" , sans-serif; } diff --git a/doc/salome/gui/SMESH/default_ns.css b/doc/salome/gui/SMESH/default_ns.css index 3eeb3c496..46e8b0018 100755 --- a/doc/salome/gui/SMESH/default_ns.css +++ b/doc/salome/gui/SMESH/default_ns.css @@ -1,118 +1,118 @@ -BODY { - background-color:#ffffff; - font-family:"Times New Roman" , serif; } -H1 { - font-weight:bold; - font-size:24.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H1 { - font-weight:bold; - font-size:24.0pt; } -H2 { - font-weight:bold; - font-size:18.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H2 { - font-weight:bold; - font-size:18.0pt; } -H3 { - font-weight:bold; - font-size:14.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H3 { - font-weight:bold; - font-size:14.0pt; } -H4 { - font-weight:bold; - font-size:12.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H4 { - font-weight:bold; - font-size:12.0pt; } -H5 { - font-weight:bold; - font-size:10.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H5 { - font-weight:bold; - font-size:10.0pt; } -H6 { - font-weight:bold; - font-size:8.0pt; - font-family:"Times New Roman" , serif; } -LI.kadov-H6 { - font-weight:bold; - font-size:8.0pt; } -P { - font-size:12.0pt; - margin-top:1pt; - margin-bottom:1pt; - font-family:"Times New Roman" , serif; } -LI.kadov-P { - font-size:12.0pt; } -A.expandspot { - color:#008000; - cursor:hand; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -SPAN.expandtext { - font-style:italic; - font-weight:normal; - color:#ff0000; } -A.dropspot { - cursor:hand; - color:#008000; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -A.glossterm { - color:#800000; - cursor:hand; - font-style:italic; - x-text-underline:off; - x-text-overline:off; - x-text-line-through:off; - text-decoration:none none none; } -SPAN.glosstext { - font-style:italic; - font-weight:normal; - color:#0000ff; } -OL { - margin-top:0px; - margin-bottom:0px; - font-family:"Times New Roman" , serif; } -UL { - margin-top:0px; - margin-bottom:0px; - font-family:"Times New Roman" , serif; } -A:active { } -A:hover { - x-text-underline:Off; - text-decoration:none; } -A:link { - x-text-underline:Off; - text-decoration:none; } -A:visited { - x-text-underline:Off; - text-decoration:none; } -P.TODO { - font-weight:normal; - font-style:italic; - font-family:"Arial Black" , sans-serif; } -LI.kadov-P-CTODO { - font-weight:normal; - font-style:italic; - font-family:"Arial Black" , sans-serif; } -ol ol { - margin-top:1px; } -ol ul { - margin-top:1px; } -ul ul { - margin-top:1px; } -ul ol { - margin-top:1px; } +BODY { + background-color:#ffffff; + font-family:"Times New Roman" , serif; } +H1 { + font-weight:bold; + font-size:24.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H1 { + font-weight:bold; + font-size:24.0pt; } +H2 { + font-weight:bold; + font-size:18.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H2 { + font-weight:bold; + font-size:18.0pt; } +H3 { + font-weight:bold; + font-size:14.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H3 { + font-weight:bold; + font-size:14.0pt; } +H4 { + font-weight:bold; + font-size:12.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H4 { + font-weight:bold; + font-size:12.0pt; } +H5 { + font-weight:bold; + font-size:10.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H5 { + font-weight:bold; + font-size:10.0pt; } +H6 { + font-weight:bold; + font-size:8.0pt; + font-family:"Times New Roman" , serif; } +LI.kadov-H6 { + font-weight:bold; + font-size:8.0pt; } +P { + font-size:12.0pt; + margin-top:1pt; + margin-bottom:1pt; + font-family:"Times New Roman" , serif; } +LI.kadov-P { + font-size:12.0pt; } +A.expandspot { + color:#008000; + cursor:hand; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +SPAN.expandtext { + font-style:italic; + font-weight:normal; + color:#ff0000; } +A.dropspot { + cursor:hand; + color:#008000; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +A.glossterm { + color:#800000; + cursor:hand; + font-style:italic; + x-text-underline:off; + x-text-overline:off; + x-text-line-through:off; + text-decoration:none none none; } +SPAN.glosstext { + font-style:italic; + font-weight:normal; + color:#0000ff; } +OL { + margin-top:0px; + margin-bottom:0px; + font-family:"Times New Roman" , serif; } +UL { + margin-top:0px; + margin-bottom:0px; + font-family:"Times New Roman" , serif; } +A:active { } +A:hover { + x-text-underline:Off; + text-decoration:none; } +A:link { + x-text-underline:Off; + text-decoration:none; } +A:visited { + x-text-underline:Off; + text-decoration:none; } +P.TODO { + font-weight:normal; + font-style:italic; + font-family:"Arial Black" , sans-serif; } +LI.kadov-P-CTODO { + font-weight:normal; + font-style:italic; + font-family:"Arial Black" , sans-serif; } +ol ol { + margin-top:1px; } +ol ul { + margin-top:1px; } +ul ul { + margin-top:1px; } +ul ol { + margin-top:1px; } diff --git a/doc/salome/gui/SMESH/defining_hypotheses_tui.htm b/doc/salome/gui/SMESH/defining_hypotheses_tui.htm index 144d56530..420dc0a8b 100755 --- a/doc/salome/gui/SMESH/defining_hypotheses_tui.htm +++ b/doc/salome/gui/SMESH/defining_hypotheses_tui.htm @@ -1,882 +1,883 @@ - - - - - -Defining hypotheses TUI - - - - - - - - - - - -

Defining Hypotheses and Algorithms

- -

Defining 1D Hypotheses

- -

1D Arithmetic

- -

 

- -

import - geompy

- -

import smesh

- -

 

- -

# create a box

- -

box = geompy.MakeBoxDXDYDZ(10., - 10., 10.)

- -

geompy.addToStudy(box, - "Box")

- -

 

- -

# create a hexahedral - mesh on the box

- -

hexa = smesh.Mesh(box, - "Box : hexahedrical mesh")

- -

 

- -

# create a Regular 1D - algorithm for edges

- -

algo1D = hexa.Segment()

- -

 

- -

# define "Arithmetic1D" - hypothesis to cut all edges in several segments with increasing arithmetic - length

- -

algo1D.Arithmetic1D(1, - 4)

- -

 

- -

# create a quadrangle - 2D algorithm for faces

- -

hexa.Quadrangle()

- -

 

- -

# create a hexahedron - 3D algorithm for solids

- -

hexa.Hexahedron()

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

 

- -

Deflection 1D and Number of Segments

- -

import - geompy

- -

import smesh

- -

 

- -

# create a face from - arc and straight segment

- -

px = geompy.MakeVertex(100., - 0.  , 0. -  )

- -

py = geompy.MakeVertex(0. -  , 100., - 0.  )

- -

pz = geompy.MakeVertex(0. -  , 0.  , - 100.)

- -

 

- -

exy = geompy.MakeEdge(px, - py)

- -

arc = geompy.MakeArc(py, - pz, px)

- -

 

- -

wire = geompy.MakeWire([exy, - arc])

- -

 

- -

isPlanarFace = 1

- -

face1 = geompy.MakeFace(wire, - isPlanarFace)

- -

geompy.addToStudy(face1,"Face1")

- -

 

- -

# get edges from the - face

- -

e_straight,e_arc = - geompy.SubShapeAll(face1, geompy.ShapeType["EDGE"])

- -

geompy.addToStudyInFather(face1, - e_arc, "Arc Edge")

- -

 

- -

# create hexahedral mesh

- -

hexa = smesh.Mesh(face1, - "Face : triangle mesh")

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut a straight edge in a fixed number of segments

- -

algo1D = hexa.Segment()

- -

algo1D.NumberOfSegments(6)

- -

 

- -

# define "MaxElementArea" - hypothesis

- -

algo2D = hexa.Triangle()

- -

algo2D.MaxElementArea(70.0)

- -

 

- -

# define a local "Deflection1D" - hypothesis on the arc

- -

algo_local = hexa.Segment(e_arc)

- -

algo_local.Deflection1D(1.0)

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

Start and End Length

- -

from - geompy import *

- -

import smesh

- -

 

- -

# create a box

- -

box = MakeBoxDXDYDZ(10., - 10., 10.)

- -

addToStudy(box, "Box")

- -

 

- -

# get one edge of the - box to put local hypothesis on

- -

p5 = MakeVertex(5., - 0., 0.)

- -

EdgeX = GetEdgeNearPoint(box, - p5)

- -

addToStudyInFather(box, - EdgeX, "Edge [0,0,0 - 10,0,0]")

- -

 

- -

# create a hexahedral - mesh on the box

- -

hexa = smesh.Mesh(box, - "Box : hexahedrical mesh")

- -

 

- -

# set algorithms

- -

algo1D = hexa.Segment()

- -

hexa.Quadrangle()

- -

hexa.Hexahedron()

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut an edge in a fixed number of segments

- -

algo1D.NumberOfSegments(4)

- -

 

- -

# create a local hypothesis

- -

algo_local = hexa.Segment(EdgeX)

- -

 

- -

# define "StartEndLength" - hypothesis to cut an edge in several segments with increasing geometric - length

- -

algo_local.StartEndLength(1, - 6)

- -

 

- -

# define "Propagation" - hypothesis that propagates all other hypothesis

- -

# on all edges on the - opposite side in case of quadrangular faces

- -

algo_local.Propagation()

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

Average Length

- -

from - geompy import *

- -

import smesh

- -

 

- -

# create a box

- -

box = MakeBoxDXDYDZ(10., - 10., 10.)

- -

addToStudy(box, "Box")

- -

 

- -

# get one edge of the - box to put local hypothesis on

- -

p5 = MakeVertex(5., - 0., 0.)

- -

EdgeX = GetEdgeNearPoint(box, - p5)

- -

addToStudyInFather(box, - EdgeX, "Edge [0,0,0 - 10,0,0]")

- -

 

- -

# create a hexahedral - mesh on the box

- -

hexa = smesh.Mesh(box, - "Box : hexahedrical mesh")

- -

 

- -

# set algorithms

- -

algo1D = hexa.Segment()

- -

hexa.Quadrangle()

- -

hexa.Hexahedron()

- -

 

- -

# define "NumberOfSegments" - hypothesis to cut all edges in a fixed number of segments

- -

algo1D.NumberOfSegments(4)

- -

 

- -

# create a sub-mesh

- -

algo_local = hexa.Segment(EdgeX)

- -

 

- -

# define "LocalLength" - hypothesis to cut an edge in several segments with the same length

- -

algo_local.LocalLength(2.)

- -

 

- -

# define "Propagation" - hypothesis that propagates all other hypothesis

- -

# on all edges on the - opposite side in case of quadrangular faces

- -

algo_local.Propagation()

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

Defining 2D and 3D hypotheses

- -

Maximum Element Area

- -

import - smesh

- -

import salome

- -

 

- -

# create a face

- -

px   = - geompy.MakeVertex(100., 0.  , - 0.  )

- -

py   = - geompy.MakeVertex(0.  , - 100., 0.  )

- -

pz   = - geompy.MakeVertex(0.  , - 0.  , 100.)

- -

 

- -

vxy = geompy.MakeVector(px, - py)

- -

arc = geompy.MakeArc(py, - pz, px)

- -

wire = geompy.MakeWire([vxy, - arc])

- -

 

- -

isPlanarFace = 1

- -

face = geompy.MakeFace(wire, - isPlanarFace)

- -

 

- -

# add the face in the - study

- -

id_face = geompy.addToStudy(face, - "Face to be meshed")

- -

 

- -

# create a mesh

- -

tria_mesh = smesh.Mesh(face, - "Face : triangulation")

- -

 

- -

# define 1D meshing:

- -

algo = tria_mesh.Segment()

- -

algo.NumberOfSegments(20)

- -

 

- -

# define 2D meshing:

- -

 

- -

# assign triangulation - algorithm

- -

algo = tria_mesh.Triangle()

- -

 

- -

# apply "Max Element - Area" hypothesis to each triangle

- -

algo.MaxElementArea(100)

- -

 

- -

# compute the mesh

- -

tria_mesh.Compute() -  

- -

 

- -

Maximum Element Volume

- -

import - geompy

- -

import smesh

- -

 

- -

# create a cylinder

- -

cyl = geompy.MakeCylinderRH(30., - 50.)

- -

geompy.addToStudy(cyl, - "cyl")

- -

 

- -

# create a mesh on - the cylinder

- -

tetra = smesh.Mesh(cyl, - "Cylinder : tetrahedrical mesh")

- -

 

- -

# assign algorithms

- -

algo1D = tetra.Segment()

- -

algo2D = tetra.Triangle()

- -

algo3D = tetra.Tetrahedron(smesh.NETGEN)

- -

 

- -

# assign 1D and 2D - hypotheses

- -

algo1D.NumberOfSegments(7)

- -

algo2D.MaxElementArea(150.)

- -

 

- -

# assign Max Element - Volume hypothesis

- -

algo3D.MaxElementVolume(200.)

- -

 

- -

# compute the mesh

- -

ret = tetra.Compute()

- -

if ret == 0:

- -

    print - "probleme when computing the mesh"

- -

else:

- -

    print - "Computation succeded"

- -

Length from Edges

- -

import - geompy

- -

import smesh

- -

 

- -

# create sketchers

- -

sketcher1 = geompy.MakeSketcher("Sketcher:F - 0 0:TT 70 0:TT 70 70:TT 0 70:WW")

- -

sketcher2 = geompy.MakeSketcher("Sketcher:F - 20 20:TT 50 20:TT 50 50:TT 20 50:WW")

- -

 

- -

# create a face from - two wires

- -

isPlanarFace = 1

- -

face1 = geompy.MakeFaces([sketcher1, - sketcher2], isPlanarFace)

- -

geompy.addToStudy(face1, - "Face1")

- -

 

- -

# create a mesh

- -

tria = smesh.Mesh(face1, - "Face : triangle 2D mesh")

- -

 

- -

# Define 1D meshing

- -

algo1D = tria.Segment()

- -

algo1D.NumberOfSegments(2)

- -

 

- -

# create and assign the - algorithm for 2D meshing with triangles

- -

algo2D = tria.Triangle()

- -

 

- -

# create and assign "LengthFromEdges" - hypothesis to build triangles - based on the length of the edges taken from the wire

- -

algo2D.LengthFromEdges()

- -

 

- -

# compute the mesh

- -

tria.Compute()

- -

 

- -

Defining Additional Hypotheses

- -

Propagation

- -

from geompy import - *

- -

import smesh

- -

 

- -

# create a box

- -

box = MakeBoxDXDYDZ(10., - 10., 10.)

- -

addToStudy(box, "Box")

- -

 

- -

# get one edge of the - box to put local hypothesis on

- -

p5 = MakeVertex(5., - 0., 0.)

- -

EdgeX = GetEdgeNearPoint(box, - p5)

- -

addToStudyInFather(box, - EdgeX, "Edge [0,0,0 - 10,0,0]")

- -

 

- -

# create a hexahedral - mesh on the box

- -

hexa = smesh.Mesh(box, - "Box : hexahedrical mesh")

- -

 

- -

# set global algorithms - and hypotheses

- -

algo1D = hexa.Segment()

- -

hexa.Quadrangle()

- -

hexa.Hexahedron()

- -

algo1D.NumberOfSegments(4)

- -

 

- -

# create a sub-mesh with - local 1D hypothesis and propagation

- -

algo_local = hexa.Segment(EdgeX)

- -

 

- -

# define "Arithmetic1D" - hypothesis to cut an edge in several segments with increasing length

- -

algo_local.Arithmetic1D(1, - 4)

- -

 

- -

# define "Propagation" - hypothesis that propagates all other 1D hypotheses

- -

# from all edges on the - opposite side of a face in case of quadrangular faces

- -

algo_local.Propagation()

- -

 

- -

# compute the mesh

- -

hexa.Compute() -

- -

Defining Meshing Algorithms

- -

import geompy

- -

import smesh

- -

 

- -

# create a box

- -

box = geompy.MakeBoxDXDYDZ(10., - 10., 10.)

- -

geompy.addToStudy(box, - "Box")

- -

 

- -

# 1. Create a hexahedral - mesh on the box

- -

hexa = smesh.Mesh(box, - "Box : hexahedrical mesh")

- -

 

- -

# create a Regular 1D algorithm - for edges

- -

algo1D = hexa.Segment()

- -

 

- -

# create a quadrangle 2D - algorithm for faces

- -

algo2D = hexa.Quadrangle()

- -

 

- -

# create a hexahedron 3D - algorithm for solids

- -

algo3D = hexa.Hexahedron()

- -

 

- -

# define hypotheses

- -

algo1D.Arithmetic1D(1, - 4)

- -

 

- -

# compute the mesh

- -

hexa.Compute()

- -

 

- -

# 2. Create a tetrahedral - mesh on the box

- -

tetra = smesh.Mesh(box, - "Box : tetrahedrical mesh")

- -

 

- -

# create a Regular 1D algorithm - for edges

- -

algo1D = tetra.Segment()

- -

 

- -

# create a Mefisto 2D algorithm - for faces

- -

algo2D = tetra.Triangle()

- -

 

- -

# create a Netgen 3D algorithm - for solids

- -

algo3D = tetra.Tetrahedron(smesh.NETGEN)

- -

 

- -

# define hypotheses

- -

algo1D.Arithmetic1D(1, - 4)

- -

algo2D.LengthFromEdges()

- -

 

- -

# compute the mesh

- -

tetra.Compute()

- -

 

- -

# 3. Create a tetrahedral - mesh on the box with NETGEN_2D3D algorithm

- -

tetraN = smesh.Mesh(box, - "Box : tetrahedrical mesh by NETGEN_2D3D")

- -

 

- -

# create a Netgen_2D3D - algorithm for solids

- -

is3D = 1

- -

algo3D = tetraN.Netgen(is3D)

- -

 

- -

# define hypotheses

- -

n23_params = algo3D.Parameters()

- -

 

- -

# compute the mesh

- -

tetraN.Compute() -

- - - - + + + + + +Defining hypotheses TUI + + + + + + + + + + + +

Defining Hypotheses and Algorithms

+ +

Defining 1D Hypotheses

+ +

1D Arithmetic

+ +

 

+ +

import + geompy

+ +

import smesh

+ +

 

+ +

# create a box

+ +

box = geompy.MakeBoxDXDYDZ(10., + 10., 10.)

+ +

geompy.addToStudy(box, + "Box")

+ +

 

+ +

# create a hexahedral + mesh on the box

+ +

hexa = smesh.Mesh(box, + "Box : hexahedrical mesh")

+ +

 

+ +

# create a Regular 1D + algorithm for edges

+ +

algo1D = hexa.Segment()

+ +

 

+ +

# define "Arithmetic1D" + hypothesis to cut all edges in several segments with increasing arithmetic + length

+ +

algo1D.Arithmetic1D(1, + 4)

+ +

 

+ +

# create a quadrangle + 2D algorithm for faces

+ +

hexa.Quadrangle()

+ +

 

+ +

# create a hexahedron + 3D algorithm for solids

+ +

hexa.Hexahedron()

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute()

+ +

 

+ +

Deflection 1D and Number of Segments

+ +

import + geompy

+ +

import smesh

+ +

 

+ +

# create a face from + arc and straight segment

+ +

px = geompy.MakeVertex(100., + 0.  , 0. +  )

+ +

py = geompy.MakeVertex(0. +  , 100., + 0.  )

+ +

pz = geompy.MakeVertex(0. +  , 0.  , + 100.)

+ +

 

+ +

exy = geompy.MakeEdge(px, + py)

+ +

arc = geompy.MakeArc(py, + pz, px)

+ +

 

+ +

wire = geompy.MakeWire([exy, + arc])

+ +

 

+ +

isPlanarFace = 1

+ +

face1 = geompy.MakeFace(wire, + isPlanarFace)

+ +

geompy.addToStudy(face1,"Face1")

+ +

 

+ +

# get edges from the + face

+ +

e_straight,e_arc = + geompy.SubShapeAll(face1, geompy.ShapeType["EDGE"])

+ +

geompy.addToStudyInFather(face1, + e_arc, "Arc Edge")

+ +

 

+ +

# create hexahedral mesh

+ +

hexa = smesh.Mesh(face1, + "Face : triangle mesh")

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut a straight edge in a fixed number of segments

+ +

algo1D = hexa.Segment()

+ +

algo1D.NumberOfSegments(6)

+ +

 

+ +

# define "MaxElementArea" + hypothesis

+ +

algo2D = hexa.Triangle()

+ +

algo2D.MaxElementArea(70.0)

+ +

 

+ +

# define a local "Deflection1D" + hypothesis on the arc

+ +

algo_local = hexa.Segment(e_arc)

+ +

algo_local.Deflection1D(1.0)

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute()

+ +

Start and End Length

+ +

from + geompy import *

+ +

import smesh

+ +

 

+ +

# create a box

+ +

box = MakeBoxDXDYDZ(10., + 10., 10.)

+ +

addToStudy(box, "Box")

+ +

 

+ +

# get one edge of the + box to put local hypothesis on

+ +

p5 = MakeVertex(5., + 0., 0.)

+ +

EdgeX = GetEdgeNearPoint(box, + p5)

+ +

addToStudyInFather(box, + EdgeX, "Edge [0,0,0 - 10,0,0]")

+ +

 

+ +

# create a hexahedral + mesh on the box

+ +

hexa = smesh.Mesh(box, + "Box : hexahedrical mesh")

+ +

 

+ +

# set algorithms

+ +

algo1D = hexa.Segment()

+ +

hexa.Quadrangle()

+ +

hexa.Hexahedron()

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut an edge in a fixed number of segments

+ +

algo1D.NumberOfSegments(4)

+ +

 

+ +

# create a local hypothesis

+ +

algo_local = hexa.Segment(EdgeX)

+ +

 

+ +

# define "StartEndLength" + hypothesis to cut an edge in several segments with increasing geometric + length

+ +

algo_local.StartEndLength(1, + 6)

+ +

 

+ +

# define "Propagation" + hypothesis that propagates all other hypothesis

+ +

# on all edges on the + opposite side in case of quadrangular faces

+ +

algo_local.Propagation()

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute()

+ +

Average Length

+ +

from + geompy import *

+ +

import smesh

+ +

 

+ +

# create a box

+ +

box = MakeBoxDXDYDZ(10., + 10., 10.)

+ +

addToStudy(box, "Box")

+ +

 

+ +

# get one edge of the + box to put local hypothesis on

+ +

p5 = MakeVertex(5., + 0., 0.)

+ +

EdgeX = GetEdgeNearPoint(box, + p5)

+ +

addToStudyInFather(box, + EdgeX, "Edge [0,0,0 - 10,0,0]")

+ +

 

+ +

# create a hexahedral + mesh on the box

+ +

hexa = smesh.Mesh(box, + "Box : hexahedrical mesh")

+ +

 

+ +

# set algorithms

+ +

algo1D = hexa.Segment()

+ +

hexa.Quadrangle()

+ +

hexa.Hexahedron()

+ +

 

+ +

# define "NumberOfSegments" + hypothesis to cut all edges in a fixed number of segments

+ +

algo1D.NumberOfSegments(4)

+ +

 

+ +

# create a sub-mesh

+ +

algo_local = hexa.Segment(EdgeX)

+ +

 

+ +

# define "LocalLength" + hypothesis to cut an edge in several segments with the same length

+ +

algo_local.LocalLength(2.)

+ +

 

+ +

# define "Propagation" + hypothesis that propagates all other hypothesis

+ +

# on all edges on the + opposite side in case of quadrangular faces

+ +

algo_local.Propagation()

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute()

+ +

Defining 2D and 3D hypotheses

+ +

Maximum Element Area

+ +

import + geompy

+ +

import smesh

+ +

import salome

+ +

 

+ +

# create a face

+ +

px   = + geompy.MakeVertex(100., 0.  , + 0.  )

+ +

py   = + geompy.MakeVertex(0.  , + 100., 0.  )

+ +

pz   = + geompy.MakeVertex(0.  , + 0.  , 100.)

+ +

 

+ +

vxy = geompy.MakeVector(px, + py)

+ +

arc = geompy.MakeArc(py, + pz, px)

+ +

wire = geompy.MakeWire([vxy, + arc])

+ +

 

+ +

isPlanarFace = 1

+ +

face = geompy.MakeFace(wire, + isPlanarFace)

+ +

 

+ +

# add the face in the + study

+ +

id_face = geompy.addToStudy(face, + "Face to be meshed")

+ +

 

+ +

# create a mesh

+ +

tria_mesh = smesh.Mesh(face, + "Face : triangulation")

+ +

 

+ +

# define 1D meshing:

+ +

algo = tria_mesh.Segment()

+ +

algo.NumberOfSegments(20)

+ +

 

+ +

# define 2D meshing:

+ +

 

+ +

# assign triangulation + algorithm

+ +

algo = tria_mesh.Triangle()

+ +

 

+ +

# apply "Max Element + Area" hypothesis to each triangle

+ +

algo.MaxElementArea(100)

+ +

 

+ +

# compute the mesh

+ +

tria_mesh.Compute() +  

+ +

 

+ +

Maximum Element Volume

+ +

import + geompy

+ +

import smesh

+ +

 

+ +

# create a cylinder

+ +

cyl = geompy.MakeCylinderRH(30., + 50.)

+ +

geompy.addToStudy(cyl, + "cyl")

+ +

 

+ +

# create a mesh on + the cylinder

+ +

tetra = smesh.Mesh(cyl, + "Cylinder : tetrahedrical mesh")

+ +

 

+ +

# assign algorithms

+ +

algo1D = tetra.Segment()

+ +

algo2D = tetra.Triangle()

+ +

algo3D = tetra.Tetrahedron(smesh.NETGEN)

+ +

 

+ +

# assign 1D and 2D + hypotheses

+ +

algo1D.NumberOfSegments(7)

+ +

algo2D.MaxElementArea(150.)

+ +

 

+ +

# assign Max Element + Volume hypothesis

+ +

algo3D.MaxElementVolume(200.)

+ +

 

+ +

# compute the mesh

+ +

ret = tetra.Compute()

+ +

if ret == 0:

+ +

    print + "probleme when computing the mesh"

+ +

else:

+ +

    print + "Computation succeded"

+ +

Length from Edges

+ +

import + geompy

+ +

import smesh

+ +

 

+ +

# create sketchers

+ +

sketcher1 = geompy.MakeSketcher("Sketcher:F + 0 0:TT 70 0:TT 70 70:TT 0 70:WW")

+ +

sketcher2 = geompy.MakeSketcher("Sketcher:F + 20 20:TT 50 20:TT 50 50:TT 20 50:WW")

+ +

 

+ +

# create a face from + two wires

+ +

isPlanarFace = 1

+ +

face1 = geompy.MakeFaces([sketcher1, + sketcher2], isPlanarFace)

+ +

geompy.addToStudy(face1, + "Face1")

+ +

 

+ +

# create a mesh

+ +

tria = smesh.Mesh(face1, + "Face : triangle 2D mesh")

+ +

 

+ +

# Define 1D meshing

+ +

algo1D = tria.Segment()

+ +

algo1D.NumberOfSegments(2)

+ +

 

+ +

# create and assign the + algorithm for 2D meshing with triangles

+ +

algo2D = tria.Triangle()

+ +

 

+ +

# create and assign "LengthFromEdges" + hypothesis to build triangles + based on the length of the edges taken from the wire

+ +

algo2D.LengthFromEdges()

+ +

 

+ +

# compute the mesh

+ +

tria.Compute()

+ +

 

+ +

Defining Additional Hypotheses

+ +

Propagation

+ +

from geompy import + *

+ +

import smesh

+ +

 

+ +

# create a box

+ +

box = MakeBoxDXDYDZ(10., + 10., 10.)

+ +

addToStudy(box, "Box")

+ +

 

+ +

# get one edge of the + box to put local hypothesis on

+ +

p5 = MakeVertex(5., + 0., 0.)

+ +

EdgeX = GetEdgeNearPoint(box, + p5)

+ +

addToStudyInFather(box, + EdgeX, "Edge [0,0,0 - 10,0,0]")

+ +

 

+ +

# create a hexahedral + mesh on the box

+ +

hexa = smesh.Mesh(box, + "Box : hexahedrical mesh")

+ +

 

+ +

# set global algorithms + and hypotheses

+ +

algo1D = hexa.Segment()

+ +

hexa.Quadrangle()

+ +

hexa.Hexahedron()

+ +

algo1D.NumberOfSegments(4)

+ +

 

+ +

# create a sub-mesh with + local 1D hypothesis and propagation

+ +

algo_local = hexa.Segment(EdgeX)

+ +

 

+ +

# define "Arithmetic1D" + hypothesis to cut an edge in several segments with increasing length

+ +

algo_local.Arithmetic1D(1, + 4)

+ +

 

+ +

# define "Propagation" + hypothesis that propagates all other 1D hypotheses

+ +

# from all edges on the + opposite side of a face in case of quadrangular faces

+ +

algo_local.Propagation()

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute() +

+ +

Defining Meshing Algorithms

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create a box

+ +

box = geompy.MakeBoxDXDYDZ(10., + 10., 10.)

+ +

geompy.addToStudy(box, + "Box")

+ +

 

+ +

# 1. Create a hexahedral + mesh on the box

+ +

hexa = smesh.Mesh(box, + "Box : hexahedrical mesh")

+ +

 

+ +

# create a Regular 1D algorithm + for edges

+ +

algo1D = hexa.Segment()

+ +

 

+ +

# create a quadrangle 2D + algorithm for faces

+ +

algo2D = hexa.Quadrangle()

+ +

 

+ +

# create a hexahedron 3D + algorithm for solids

+ +

algo3D = hexa.Hexahedron()

+ +

 

+ +

# define hypotheses

+ +

algo1D.Arithmetic1D(1, + 4)

+ +

 

+ +

# compute the mesh

+ +

hexa.Compute()

+ +

 

+ +

# 2. Create a tetrahedral + mesh on the box

+ +

tetra = smesh.Mesh(box, + "Box : tetrahedrical mesh")

+ +

 

+ +

# create a Regular 1D algorithm + for edges

+ +

algo1D = tetra.Segment()

+ +

 

+ +

# create a Mefisto 2D algorithm + for faces

+ +

algo2D = tetra.Triangle()

+ +

 

+ +

# create a Netgen 3D algorithm + for solids

+ +

algo3D = tetra.Tetrahedron(smesh.NETGEN)

+ +

 

+ +

# define hypotheses

+ +

algo1D.Arithmetic1D(1, + 4)

+ +

algo2D.LengthFromEdges()

+ +

 

+ +

# compute the mesh

+ +

tetra.Compute()

+ +

 

+ +

# 3. Create a tetrahedral + mesh on the box with NETGEN_2D3D algorithm

+ +

tetraN = smesh.Mesh(box, + "Box : tetrahedrical mesh by NETGEN_2D3D")

+ +

 

+ +

# create a Netgen_2D3D + algorithm for solids

+ +

algo3D = tetraN.Tetrahedron(smesh.FULL_NETGEN) +

+ +

 

+ +

# define hypotheses

+ +

n23_params = algo3D.Parameters()

+ +

 

+ +

# compute the mesh

+ +

tetraN.Compute() +

+ + + + diff --git a/doc/salome/gui/SMESH/deleting_groups.htm b/doc/salome/gui/SMESH/deleting_groups.htm index 7c7675e7f..02a7b47e2 100755 --- a/doc/salome/gui/SMESH/deleting_groups.htm +++ b/doc/salome/gui/SMESH/deleting_groups.htm @@ -1,119 +1,119 @@ - - - - - -Deleting Groups - - - - - - - - - - - -

Deleting Groups

- -

To delete a group in the - Main Menu select Mesh - -> Delete Groups and select one or several - groups you wish to delete in the 3D viewer or in the Object Browser.

- -

The selected groups will - be listed in Delete groups with contents - menu. Then click Ok button to remove the selected groups and close the - menu or Apply button to remove them and proceed with the selection.

- -

 

- -

- -

    

- -

 

- -

Please, note that this - operation removes groups with their elements. - To delete a group and leave its elements intact, right-click on the group - in the Object Browser and select Delete - in the pop-up menu or select the group and choose Edit - -> Delete in the Main Menu. -   

- - - - + + + + + +Deleting Groups + + + + + + + + + + + +

Deleting Groups

+ +

To delete a group in the + Main Menu select Mesh + -> Delete Groups and select one or several + groups you wish to delete in the 3D viewer or in the Object Browser.

+ +

The selected groups will + be listed in Delete groups with contents + menu. Then click Ok button to remove the selected groups and close the + menu or Apply button to remove them and proceed with the selection.

+ +

 

+ +

+ +

    

+ +

 

+ +

Please, note that this + operation removes groups with their elements. + To delete a group and leave its elements intact, right-click on the group + in the Object Browser and select Delete + in the pop-up menu or select the group and choose Edit + -> Delete in the Main Menu. +   

+ + + + diff --git a/doc/salome/gui/SMESH/display_entity.htm b/doc/salome/gui/SMESH/display_entity.htm index 90ae19e3b..51d7d6604 100755 --- a/doc/salome/gui/SMESH/display_entity.htm +++ b/doc/salome/gui/SMESH/display_entity.htm @@ -1,101 +1,101 @@ - - - - - -Display Entity - - - - - - - - - - - - -

Display Entity

- -

In this submenu you can choose to display only volumes, faces or edges - or combine them.

- -

 

- -

Only Faces                                                  Only - Edges

- -

 

- -

 

- - - - + + + + + +Display Entity + + + + + + + + + + + + +

Display Entity

+ +

In this submenu you can choose to display only volumes, faces or edges + or combine them.

+ +

 

+ +

Only Faces                                                  Only + Edges

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/ehelp.xml b/doc/salome/gui/SMESH/ehelp.xml index be729a46c..8d61adcdc 100755 --- a/doc/salome/gui/SMESH/ehelp.xml +++ b/doc/salome/gui/SMESH/ehelp.xml @@ -1,10 +1,10 @@ - - - - - - - - WebSearch - + + + + + + + + WebSearch + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/ehlpdhtm.js b/doc/salome/gui/SMESH/ehlpdhtm.js index 6cfd2e463..7bcb24993 100755 --- a/doc/salome/gui/SMESH/ehlpdhtm.js +++ b/doc/salome/gui/SMESH/ehlpdhtm.js @@ -1,4239 +1,4239 @@ -// eHelp® Corporation Dynamic HTML JavaScript -// Copyright© 1998-2003 eHelp® Corporation.All rights reserved. -// Version=4.82 - -// Warning:Do not modify this file.It is generated by RoboHELP® and changes will be overwritten. - -//// Segment Begin -- (JavaScript 1.0) - -/// Section Begin - General and relative topics(JavaScript 1.0) - -//{{HH_SYMBOL_SECTION -var HH_ChmFilename = ""; -var HH_WindowName = ""; -var HH_GlossaryFont = ""; -var HH_Glossary = ""; -var HH_Avenue = ""; -var HH_ActiveX = false; -//}}HH_SYMBOL_SECTION - -//Begin to support previous generic parameters -//Get the information about the browser. -var gstrBsAgent = navigator.userAgent.toLowerCase(); -var gnBsVer = parseInt(navigator.appVersion); - -var gbBsOpera = (gstrBsAgent.indexOf('opera') != -1); -var gbBsKonqueror = (gstrBsAgent.indexOf('konqueror') != -1); -var gbBsSafari = (gstrBsAgent.indexOf('safari') != -1); -var gbBsIE = (gstrBsAgent.indexOf('msie') != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari; -var gbBsNS = (gstrBsAgent.indexOf('mozilla') != -1) && ((gstrBsAgent.indexOf('spoofer') == -1) && (gstrBsAgent.indexOf('compatible') == -1)) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari; - -var gbBsMac = (gstrBsAgent.indexOf('mac') != -1); -var gbBsWindows = ((gstrBsAgent.indexOf('win') != -1) || (gstrBsAgent.indexOf('16bit') != -1)); -var gbBsSunOS = (gstrBsAgent.indexOf("sunos") != -1); - -var gbBsIE3Before = ((gbBsIE) && (gnBsVer <= 2)); -var gbBsNS3Before = ((gbBsNS) && (gnBsVer <= 3)); - -var gbBsNS2 = ((gbBsNS) && (gnBsVer <= 2)); -var gbBsNS3 = ((gbBsNS) && (gnBsVer == 3)); -var gbBsIE300301 = ((gbBsIE) && (gnBsVer == 2) && ((gstrBsAgent.indexOf("3.00") != -1)||(gstrBsAgent.indexOf("3.0a") != -1)||(gstrBsAgent.indexOf("3.0b")!=-1)||(gstrBsAgent.indexOf("3.01")!=-1))); -var gbBsIE302 = ((gbBsIE) && (gnBsVer == 2) && (gstrBsAgent.indexOf("3.02") != -1)); - -var gbBsNS4 = ((gbBsNS) && (gnBsVer >= 4)); -var gbBsNS6 = ((gbBsNS) && (gnBsVer >= 5)); -var gbBsNS7 = false; - -var gbBsIE4 = ((gbBsIE) && (gnBsVer >= 4)); -var gbBsIE5 = false; -var gbBsIE55 = false; - -var gbBsOpera6 = false; -var gbBsOpera7 = false; - -var gbBsKonqueror3 = false; - - - -gbBsIE = (navigator.appName.indexOf("Microsoft") != -1) && !gbBsOpera && !gbBsKonqueror && !gbBsSafari;; -if (gbBsIE) -{ - if (parseInt(navigator.appVersion) >= 4) { - gbBsIE4 = true; - if (gbBsIE4) { - var nPos = gstrBsAgent.indexOf("msie"); - var strIEversion = gstrBsAgent.substring(nPos + 5); - var nVersion = parseFloat(strIEversion); - if (nVersion >= 5) - gbBsIE5 = true; - if (nVersion >= 5.5) - gbBsIE55 = true; - } - } -} -if (gbBsNS6) -{ - var nPos=gstrBsAgent.indexOf("gecko"); - if(nPos!=-1) - { - var nPos2=gstrBsAgent.indexOf("/", nPos); - if(nPos2!=-1) - { - var nVersion=parseFloat(gstrBsAgent.substring(nPos2+1)); - if (nVersion>=20020823) - gbBsNS7=true; - } - } -} -if (gbBsOpera) -{ - var nPos = gstrBsAgent.indexOf("opera"); - if(nPos!=-1) - { - var nVersion = parseFloat(gstrBsAgent.substring(nPos+6)); - if (nVersion >= 6) - { - gbBsOpera6=true; - if (nVersion >=7) - gbBsOpera7=true; - } - } -} -if (gbBsKonqueror) -{ - var nPos = gstrBsAgent.indexOf("konqueror"); - if(nPos!=-1) - { - var nVersion = parseFloat(gstrBsAgent.substring(nPos+10)); - if (nVersion >= 3) - { - gbBsKonqueror3=true; - } - } -} - -function insertAdjacentHTML(obj, where, htmlStr) -{ - if (gbBsIE || gbBsOpera7) - { - obj.insertAdjacentHTML(where, htmlStr); - } - else if (gbBsNS6 || gbBsSafari) - { - var r = obj.ownerDocument.createRange(); - r.setStartBefore(obj); - var parsedHTML = r.createContextualFragment(htmlStr); - - switch (where){ - case 'beforeBegin': - obj.parentNode.insertBefore(parsedHTML,obj); - break; - case 'afterBegin': - obj.insertBefore(parsedHTML,obj.firstChild); - break; - case 'beforeEnd': - obj.appendChild(parsedHTML); - break; - case 'afterEnd': - if (obj.nextSibling){ - obj.parentNode.insertBefore(parsedHTML,obj.nextSibling); - } else { - obj.parentNode.appendChild(parsedHTML); - } - break; - } - } -} - -// Utilities functions. -function BsscHasExtJs() -{ - if( gbBsIE3Before || gbBsNS3Before) - return false; - return true; -} - -// Register event handler -var gBsOnLoads = new Array(); // An array holds all the onload event handler. -var gBsOnClicks = new Array(); // An array holds all the onClick event handler. -var gBsOnUnLoads = new Array(); // An array holds all the OnUnLoad event handler. -var gBsOnMouseOvers = new Array(); // An array holds all the OnMouseOver event handler. -var gBsOnMouseOuts = new Array(); // An array holds all the OnMouseOut event handler. - -var gbOrignalOnMouseDown = null; - -function BsscRegisterOnLoad(funcHandler) -{ - var nLength = gBsOnLoads.length; - gBsOnLoads[nLength] = funcHandler; -} - -function BsscRegisterOnClick(funcHandler) -{ - var nLength = gBsOnClicks.length; - gBsOnClicks[nLength] = funcHandler; -} - -function BsscRegisterOnUnLoad(funcHandler) -{ - var nLength = gBsOnUnLoads.length; - gBsOnUnLoads[nLength] = funcHandler; -} - -function BsscRegisterOnMouseOver(funcHandler) -{ - var nLength = gBsOnMouseOvers.length; - gBsOnMouseOvers[nLength] = funcHandler; -} - -function BsscRegisterOnMouseOut(funcHandler) -{ - var nLength = gBsOnMouseOuts.length; - gBsOnMouseOuts[nLength] = funcHandler; -} - -function BsGeneralOnLoad() -{ - if (!gbBsIE4 && !gbBsNS4) - return; - - // Make everything visible in navigator - if (gbBsNS4 && !gbBsNS6) { - // Make some special effects items visible - for (var iLayer = 0; iLayer < document.layers.length; iLayer++) { - document.layers[iLayer].visibility = "show"; - document.layers[iLayer].left = 0; - } - } -} - -// If resize the netscape browser, need to reload it. -function BsReDo() -{ - if (innerWidth != origWidth || innerHeight != origHeight) - location.reload(); -} -// End of the local functions. - -// The following functions are used by the html files. -function BSSCOnLoad() -{ - if( !BsscHasExtJs() ) - return; - for (var nElement = gBsOnLoads.length - 1; nElement >= 0; nElement--) - gBsOnLoads[nElement](); -} - -function BSSCOnClick() -{ - if (!BsscHasExtJs()) return; - - for (var nElement = gBsOnClicks.length - 1; nElement >= 0; nElement--) - gBsOnClicks[nElement](); -} - -function BSSCOnUnload() -{ - if (!BsscHasExtJs()) return; - for (var nElement = gBsOnUnLoads.length - 1; nElement >= 0; nElement--) - gBsOnUnLoads[nElement](); -} - -function BSSCOnMouseOver() -{ - if (!BsscHasExtJs()) return; - for (var nElement = gBsOnMouseOvers.length - 1; nElement >= 0; nElement--) - gBsOnMouseOvers[nElement](); -} - -function BSSCOnMouseOut() -{ - if (!BsscHasExtJs()) return; - for (var nElement = gBsOnMouseOuts.length - 1; nElement >= 0; nElement--) - { - gBsOnMouseOuts[nElement](); - } -} -// End of invocation of the event handle functions. - -// Add the GereralOnLoad to the onload array. -if (typeof(BsscRegisterOnLoad) != "undefined") -{ - BsscRegisterOnLoad(BsGeneralOnLoad); -} -if (gbBsNS4&&!gbBsNS6) { - origWidth = innerWidth; - origHeight = innerHeight; - onresize = BsReDo; -} -//End to support previous generic parameters - -//Begin to support previous HHActiveX invoking -function BsHHActivateComponents() -{ - if( HH_ActiveX && (HH_ChmFilename != "") && ((self == top) || (self == top.frames[0]))) - { - var objBody = getElementsByTag(document,"BODY")[0]; - if( typeof(objBody) == "object" ) - { - insertAdjacentHTML(objBody, "beforeEnd", ''); - if (HHComponentActivator.object) - HHComponentActivator.Activate(HH_ChmFilename, HH_WindowName, HH_GlossaryFont, HH_Glossary, HH_Avenue); - } - } -} - -function BsHHActivXOnLoad() -{ - if( gbBsIE4 ) - BsHHActivateComponents(); -} - -if( typeof(BsscRegisterOnLoad) != "undefined" ) -{ - BsscRegisterOnLoad(BsHHActivXOnLoad); -} -//End to support previous HHActiveX invoking - -//Begin to support previous relative topics -//If webHelp needs Related Topics DHTMLcode, it's supposed to add it here -var gbPopupMenuTimeoutExpired = false; -var gbInPopupMenu = false; -var gbPopupMenuTopicList = null; -var gOlddocumentClick = null; - -////////////////////////////////////////////////////////////////////////////////////////// -// -// Popup Menu code -// -////////////////////////////////////////////////////////////////////////////////////////// - -var g_bIsPopupMenuInit = false; -function _WritePopupMenuLayer() -{ - if (!g_bIsPopupMenuInit) - { - if (gbBsNS4&&!gbBsNS6) { -//Do not try to write ininle styles for NS! NS can not handle it and will not stop downloading the html page... - document.write("
"); - } else{ - document.write(""); - if (!(gbBsNS4&&!gbBsNS6)) { - document.write(""); - } - } - g_bIsPopupMenuInit = true; - } -} - -//Seek for the bsscright frame -function _SeekFrameByName( cRoot, strName ) -{ - if( cRoot == null ) return null; - if( cRoot.frames == null ) return null; - if( cRoot.frames[strName] != null ) return cRoot.frames[strName]; - for (var i=0; i'; - } else { - strMenu += '' + gbPopupMenuTopicList[fn_arguments[i]].strTitle + ''; - } - strMenu += ''; - - if (isNaN(fn_arguments[i]) || (gbPopupMenuTopicList == null)) { - i += 2; - } else { - i += 1; - } - } - strMenu += ""; - - if (gbBsMac) { - // totally hack. because ie5 in mac need something. is one of them. mac is mad. - strMenu +="
"; - } - - var layerPopup = null; - var stylePopup = null; - var nEventX = 0; - var nEventY = 0; - var nWindowWidth = 0; - if (gbBsIE4 || gbBsOpera7) { - - layerPopup = getElement("PopupMenu"); - layerPopup.innerHTML = strMenu; - stylePopup = layerPopup.style; - - _BSPSGetClientSize(); - - // Get the position of the item causing the event (relative to its parent) - nEventX = window.event.clientX; - nEventY = window.event.clientY; - - if (nEventY + layerPopup.scrollHeight + 10 < gBsClientHeight) { - nEventY += document.body.scrollTop + 10; - } else { - nEventY = (document.body.scrollTop + gBsClientHeight) - layerPopup.scrollHeight - 20; - } - stylePopup.top = nEventY; - - var nPopupWidth = layerPopup.scrollWidth; - if (gbBsMac) { - nPopupWidth = 80; // we have no idea how to get the dynamic width of the popup. - } - if (nEventX + nPopupWidth + 20 > gBsClientWidth) { - if (gBsClientWidth - nPopupWidth < 5) { - stylePopup.left = 5; - } else { - stylePopup.left = gBsClientWidth - nPopupWidth - 5; - } - } else { - stylePopup.left = nEventX + document.body.scrollLeft + 20; - } - - stylePopup.visibility = "visible"; - if (!gOlddocumentClick && document.onclick) - gOlddocumentClick = document.onclick; - document.onclick = PopupMenu_HandleClick; - - } else if (gbBsNS6 || gbBsKonqueror3||gbBsSafari) { - layerPopup = getElement("PopupMenu"); - layerPopup.style.visibility = "hidden"; - - if (gbBsNS6) - { - var e = fn_arguments[0]; - nEventX = e.pageX; - nEventY = e.pageY; - } - else - { - nEventX = window.event.clientX; - nEventY = window.event.clientY; - } - _BSPSGetClientSize(); - layerPopup.innerHTML = strMenu; - - if (nEventY + layerPopup.offsetHeight + 20 < window.pageYOffset + gBsClientHeight) { - nEventY += 20; - } else { - nEventY = gBsClientHeight + window.pageYOffset - layerPopup.offsetHeight - 20; - } - - if (nEventX + layerPopup.offsetWidth + 20 > gBsClientWidth + window.pageXOffset) { - if (gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth < 20) { - nEventX = 5; - } else { - nEventX = gBsClientWidth + window.pageXOffset - layerPopup.offsetWidth - 20; - } - } else { - nEventX += 20; - } - layerPopup.style.top = nEventY; - layerPopup.style.left = nEventX; - // set again to avoid the stupid frash in netscape 6. - layerPopup.innerHTML = strMenu; - layerPopup.style.visibility = "visible"; - //window.captureEvents(Event.MOUSEDOWN); - if (!gOlddocumentClick && document.onclick) - gOlddocumentClick = document.onclick; - window.onclick = PopupMenu_HandleClick; - } - else if (gbBsNS4) { - layerPopup = document.layers.PopupMenu; - layerPopup.visibility = "hide"; - stylePopup = layerPopup.document; - stylePopup.write(strMenu); - stylePopup.close(); - var e = fn_arguments[0]; - nEventX = e.pageX; - nEventY = e.pageY; - _BSPSGetClientSize(); - if (nEventY + layerPopup.clip.height + 20 < window.pageYOffset + gBsClientHeight) { - nEventY += 20; - } else { - nEventY = gBsClientHeight + window.pageYOffset- layerPopup.clip.height - 20; - } - layerPopup.top = nEventY; - - if (nEventX + layerPopup.clip.width + 20 > gBsClientWidth + window.pageXOffset) { - if (gBsClientWidth + window.pageXOffset - layerPopup.clip.width < 20) { - nEventX = 5; - } else { - nEventX = gBsClientWidth + window.pageXOffset - layerPopup.clip.width - 20; - } - } else { - nEventX += 20; - } - - layerPopup.left = nEventX; - - layerPopup.visibility = "show"; - - window.captureEvents(Event.MOUSEDOWN); - if (!gOlddocumentClick && document.onmousedown) - gOlddocumentClick = document.onmousedown; - window.onmousedown = PopupMenu_HandleClick; - } - - window.gbInPopupMenu = true; - window.gbPopupMenuTimeoutExpired = false; - setTimeout("PopupMenu_Timeout();", 100); - return false; -} - -function PopupMenu_Timeout() -{ - window.gbPopupMenuTimeoutExpired = true; -} - -function PopupMenu_Over(e) -{ - if (gbBsIE4||gbBsOpera7) - e.srcElement.className = "PopupOver"; - else if (gbBsNS6) - e.target.parentNode.className = "PopupOver"; - return; -} - -function PopupMenu_Out(e) -{ - if (gbBsIE4||gbBsOpera7) - e.srcElement.className = "PopupNotOver"; - else if (gbBsNS6) - e.target.parentNode.className = "PopupNotOver"; - return; -} - -function PopupMenu_HandleClick(e) -{ - if (window.gbPopupMenuTimeoutExpired) { - window.gbInPopupMenu = false; - if (gbBsNS4 && !gbBsNS6) { - window.releaseEvents(Event.MOUSEDOWN); - } - - var layerPopup = null; - if (gbBsNS4&&!gbBsNS6) { - layerPopup = document.layers.PopupMenu; - layerPopup.visibility = "hide"; - } else { - layerPopup = getElement("PopupMenu"); - layerPopup.style.visibility = "hidden"; - } - - if (gOlddocumentClick) - { - if (gbBsNS4 && !gbBsNS6) - document.onmousedown = gOlddocumentClick; - else - document.onclick = gOlddocumentClick; - } - } - return; -} - -function BSSCPopup_ClickMac() -{ - if ((!DHTMLPopupSupport()) && (gbBsIE4 || gbBsOpera7)) - { - var bClickOnAnchor = false; - var el; - if ((window.event != null) && - (window.event.srcElement != null)) - { - el = window.event.srcElement; - while (el != null) - { - if ((el.tagName == "A") || (el.tagName == "AREA")) { - bClickOnAnchor = true; - break; - } - if (el.tagName == "BODY") { - break; - } - el = getParentNode(el); - } - } - if (BSSCPopup_IsPopup()) - { - if (!bClickOnAnchor) { - parent.window.gPopupWindow = null; - self.close(); - } - } - else - { - bClosePopupWindow = true; - if ((bClickOnAnchor) && - (el.href) && - ((el.href.indexOf("javascript:BSSCPopup") != -1) || (el.href.indexOf("javascript:null") != -1) || (el.href.indexOf("javascript:void(0)") != -1))) - { - bClosePopupWindow = false; - } - if (bClosePopupWindow) - { - if (window.gPopupWindow != null && !window.gPopupWindow.closed ) - { - window.gPopupWindow.close(); - } - } - } - } -} - -function BsPopupOnClick() -{ - if (!gbBsIE4 && !gbBsOpera7) - return; - - BSSCPopup_ClickMac(); -} - -function _BSSCOnError(message) -{ - if(-1 != message.indexOf("denied") - || -1 != message.indexOf("Object required")) - return true; -} - -//End to support previous relative topics - -/// Section End - General and relative topics (JavaScript 1.0) - -/// Section Begin - Popup (JavaScript 1.0) -//Begin to support previous popup functions - -//variables used to isolate the browser type -var gBsStyVisShow = null; -var gBsStyVisHide = null; -var gBsClientWidth = 640; -var gBsClientHeight = 480; - -// here is the varible for judge popup windows size. these parameter is for IE5.0, it may need adjust for others. -var gBRateH_W = 0.618; // 1.618 Golden cut. -var gBMaxXOfParent = 0.8; -var gBMaxYOfParent = 0.8; -var gBscrollHeight = 16; -var gBscrollWidth = 16; -var gBpermitXDelta = 3; -var gBpermitYDelta = 3; - - -var arrayPopupURL = new Array(); -var arrayAbsPopupURL = new Array(); - -var arrayDirty = new Array(); - -function setAbsPopupURL(nIndex, strURL) -{ - arrayAbsPopupURL[nIndex] = strURL; -} - -function getAbsPopupURL(nIndex) -{ - if (nIndex == -1 || arrayAbsPopupURL.length <= nIndex) return null; - else - return arrayAbsPopupURL[nIndex]; -} - -function getPopupURL(nIndex) -{ - if (nIndex == -1 || arrayPopupURL.length <= nIndex) return null; - else - return arrayPopupURL[nIndex]; -} - -function getPopupID(nIndex) -{ - return gstrPopupID + nIndex; -} - -function getPopupShadowID(nIndex) -{ - return gstrPopupShadowID + nIndex; -} - -function getPopupTopicID(nIndex) -{ - return gstrPopupTopicID + nIndex; -} - -function getPopupIFrameID(nIndex) -{ - return gstrPopupIFrameID + nIndex; -} - -function getPopupIFrameName(nIndex) -{ - return gstrPopupIFrameName + nIndex; -} - - -function getPopupTopicStyle(nIndex) -{ - return getElement(getPopupTopicID(nIndex)).style; -} - -function getPopupShadowStyle(nIndex) -{ - return getElement(getPopupShadowID(nIndex)).style; -} - -function getPopupIFrame(nIndex) -{ - if (gbBsNS6) - return eval("window.frames['" + getPopupIFrameName(nIndex) + "']"); - else - return eval("document.frames['" + getPopupIFrameName(nIndex) + "']"); -} - -function getPopupDivStyle(nIndex) -{ - return getElement(getPopupID(nIndex)).style; -} - -function getPopupIFrameStyle(nIndex) -{ - return getElement(getPopupIFrameID(nIndex)).style; -} - - -function findDiv(strURL) -{ - for (var i = 0; i < arrayPopupURL.length; i ++ ) { - if (arrayPopupURL[i] == strURL) { - return i; - } - } - return -1; -} - -var gnToken = -1; -function takeToken() -{ - gnToken ++; - if (gnToken > 10000) gnToken = 0; - return gnToken; -} - -function IsValidToken(nToken) -{ - return (gnToken == nToken); -} - -function addDiv(strURL) -{ - for (var i = 0; i < arrayPopupURL.length; i ++) { - if (arrayPopupURL[i] == null) { - arrayPopupURL[i] = strURL; - return i; - } - } - arrayPopupURL[i] = strURL; - arrayDirty[i] = true; - return i; -} - -function setDirty() -{ - for (var i = 0; i < arrayPopupURL.length; i ++ ) - arrayDirty[i] = true; -} - -function IsDirty(nIndex) -{ - if (nIndex == -1) - return true; - else - if (arrayDirty.length > nIndex) - return arrayDirty[nIndex]; - else - return true; -} - -function hideAll() -{ - for (var i = 0; i < arrayPopupURL.length; i ++ ) - { - getPopupDivStyle(i).visibility = gBsStyVisHide; - getPopupIFrameStyle(i).visibility = gBsStyVisHide; - } -} - -function getCurrentPopupIFrame() -{ - for (var i = 0; i < arrayPopupURL.length; i ++) - if (getPopupDivStyle(i).visibility == gBsStyVisShow) - return getPopupIFrame(i); - return null; -} - -function setClear(nIndex) -{ - if (nIndex != -1) - arrayDirty[nIndex] = false; -} - -function _BSSCCreatePopupDiv(strURL) -{ - var nIndex = findDiv(strURL); - if (nIndex == -1 ) { - nIndex = addDiv(strURL); - BsPopup_CreateDiv(nIndex); - } - else { - if (IsDirty(nIndex)) { - if("object" == typeof(getPopupIFrame(nIndex).document)) - getPopupIFrame(nIndex).document.location.href = strURL; - } - } - return nIndex; -} - -//Here is the browser type -function _BSPSGetBrowserInfo() -{ - if (gbBsNS4&&!gbBsNS6) - { - gBsStyVisShow = "show"; - gBsStyVisHide = "hide"; - } - else - { - gBsStyVisShow = "visible"; - gBsStyVisHide = "hidden"; - } -} - -_BSPSGetBrowserInfo(); - -//Get client size info -function _BSPSGetClientSize() -{ - if (gbBsNS4||gbBsKonqueror3||gbBsSafari) - { - gBsClientWidth = innerWidth; - gBsClientHeight = innerHeight; - } - else if (gbBsIE4 || gbBsOpera7) - { - gBsClientWidth = document.body.clientWidth; - gBsClientHeight = document.body.clientHeight; - } -} - -var gstrPopupID = 'BSSCPopup'; -var gstrPopupShadowID = 'BSSCPopupShadow'; -var gstrPopupTopicID = 'BSSCPopupTopic'; -var gstrPopupIFrameID = 'BSSCPopupIFrame'; -var gstrPopupIFrameName = 'BSSCPopupIFrameName'; - -var gstrPopupSecondWindowName = 'BSSCPopup'; - -var gPopupWindow = null; -var gnPopupClickX = 0; -var gnPopupClickY = 0; - -var gnPopupScreenClickX = 0; -var gnPopupScreenClickY = 0; - -var gbPopupTimeoutExpired = false; - -function DHTMLPopupSupport() -{ - if (((gbBsIE4) && (!gbBsMac))||gbBsOpera7|| gbBsNS7) { - return true; - } - return false; -} - -function BSSCPopup_IsPopup() -{ - if (DHTMLPopupSupport() && (this.name.indexOf(gstrPopupIFrameName) != -1)) { - return true; - } else if ((gbBsNS4 || gbBsIE4 || gbBsOpera7) && (this.name.indexOf(gstrPopupID) != -1)) { - return true; - } else { - return false; - } -} - -// If there is a hyperlink in a popup window, display the hyperlink in -// the original window. (bsscright) -if (BSSCPopup_IsPopup() && !gbBsIE4 && !gbBsOpera7) { - document.write(""); -} - -// Local functions. -function BsPopup_CreateDiv(nIndex) -{ - if(!DHTMLPopupSupport()) - return; - // DO NOT SET Width and height for the div, otherwize it will make IE4 popup do not work when view the topic alone. - var strPopupDiv = ""; - - var objBody = getElementsByTag(document, "BODY")[0]; - if( typeof(objBody) != "object" ) - return; - - insertAdjacentHTML(objBody, "beforeEnd", strPopupDiv); -} - -function handleLoadNS() -{ - if (this.id) - { - var nIndex = parseInt(this.id.substring(gstrPopupIFrameID.length)); - BSSCPopup_PostWork(nIndex); - } -} - -function BSSCPopup_PostWork(nIndex) -{ - getPopupDivStyle(nIndex).visibility = gBsStyVisShow; - getPopupIFrameStyle(nIndex).visibility =gBsStyVisShow; - - setClear(nIndex); - window.gbPopupTimeoutExpired = true; - - BSSCPopup_ChangeTargettoParent(getPopupIFrame(nIndex).document); - if (gbBsNS6) - getPopupIFrame(nIndex).document.body.addEventListener("click",BSSCPopupClicked,false); - else - getPopupIFrame(nIndex).document.body.onclick = BSSCPopupClicked; - - if (!gbOrignalOnMouseDown && document.onmousedown) - gbOrignalOnMouseDown = document.onmousedown; - - if (gbBsNS6) - document.addEventListener("mousedown", BSSCPopupParentClicked,false); - else - document.onmousedown = BSSCPopupParentClicked; -} - -function BSSCPopup_Timeout(nIndex, nToken) -{ - if (!IsValidToken(nToken)) return; - - if (gbBsNS6||((getPopupIFrame(nIndex).document.readyState == "complete") && - (getPopupIFrame(nIndex).document.body != null))) { - BSSCPopup_PostWork(nIndex); - } else { - setTimeout("BSSCPopup_Timeout(" + nIndex + "," + nToken + ")", 100); - } -} - -// VH 08/10/00 -// do not change target to parent if the href is using javascript -function BSSCPopup_ChangeTargettoParent(tagsObject) -{ - var collA = getElementsByTag(tagsObject, "A"); - BSSCPopup_ChangeTargettoParent2(collA); - - var collIMG = getElementsByTag(tagsObject,"IMG"); - BSSCPopup_ChangeTargettoParent2(collIMG); -} - -function BSSCPopup_ChangeTargettoParent2(colls) -{ - if (colls != null) { - for (var j = 0; j < colls.length; j ++ ) - { - var strtemp = colls[j].href; - if (strtemp) - { - strtemp = strtemp.toLowerCase(); - if (strtemp.indexOf("javascript:") == -1) - if (colls[j].target == "") - colls[j].target = "_parent"; - } - } - } -} - -function BSPSPopupTopicWinHelp(strURL) -{ - _BSSCPopup(strURL); - return; -} - -function _BSSCPopup(strURL, width, height) -{ - var cuswidth = 0; - var cusheight = 0; - if ("undefined" != typeof(width) && "undefined" != typeof(height)) { - cuswidth = width; - cusheight= height; - } - - if (DHTMLPopupSupport()) { - var nToken = takeToken(); // take token first. - var nIndex = _BSSCCreatePopupDiv(strURL); - window.gbPopupTimeoutExpired = false; - var ntWidth = gBsClientWidth; - var ntHeight = gBsClientHeight; - _BSPSGetClientSize(); - if (ntWidth != gBsClientWidth || ntHeight != gBsClientHeight) { - setDirty(); - } - - if (IsDirty(nIndex)) { - if (gbBsMac) { - setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight +")", 400); - } else { - setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 100); - } - } - else { - MoveDivAndShow(nIndex ,nToken, cuswidth, cusheight); - } - } else { - _BSSCPopup2(strURL, cuswidth, cusheight); - } - return; -} - -if (gbBsIE55) -{ - var ehlpdhtm_fOldBefureUnload = window.onbeforeunload; - var gnBsUnload=0; - window.onbeforeunload = window_BUnload; -} - -function window_BUnload() -{ - gnBsUnload++; - if (gnBsUnload>1) - return; - for (var i = 0; i < arrayPopupURL.length; i ++) - removeThis(document.all(getPopupID(i))); - arrayPopupURL.length = 0; - if (ehlpdhtm_fOldBefureUnload) - ehlpdhtm_fOldBefureUnload(); -} - -function _BSSCPopup2(strURL, width, height) -{ - if (gbBsOpera6&&gbBsMac) - { - var wmTemp = window.open(document.location.href, gstrPopupSecondWindowName); - wmTemp.close(); - setTimeout("_BSSCPopup3(\""+strURL+"\","+width+","+height+");",100); - } - else - _BSSCPopup3(strURL, width, height); -} - -function _BSSCPopup3(strURL, width, height) -{ - if (window.name == gstrPopupSecondWindowName) { - window.location = strURL; - } else { - if (!gbBsMac || !gbBsNS4) { - BSSCHidePopupWindow(); - } - var nX = 0; - var nY = 0; - var nHeight = 300; - var nWidth = 400; - if (width > 0 && height > 0) { - nHeight = height; - nWidth = width; - } - _BSPSGetClientSize(); - - nX = window.gnPopupScreenClickX; - nY = window.gnPopupScreenClickY; - - if (nY + nHeight + 40 > screen.availHeight) { - nY = screen.availHeight - nHeight - 40; - } - if (nX + nWidth + 40 > screen.availWidth) { - nX = screen.availWidth - nWidth - 40; - } - - // Launch a separate window - var strParam="titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes"; - if (gbBsNS) { - if (gbBsNS6) { - strParam += ",Height=" + nHeight + ",Width=" + nWidth; - strParam += ",screenX=" + nX + ",screenY=" + nY; - strParam += ",dependent=yes"; - } - else { - strParam += ",OuterHeight=" + nHeight + ",OuterWidth=" + nWidth; - strParam += ",screenX=" + nX + ",screenY=" + nY; - strParam += ",dependent=yes"; - } - } - else { - strParam += ",height=" + nHeight + ",width=" + nWidth; - strParam += ",left=" + nX + ",top=" + nY; - } - if (gbBsSafari) - { - if (window.gPopupWindow) - window.gPopupWindow.close(); - window.gPopupWindow = window.open(strURL, "", strParam); - window.gPopupWindow.name = gstrPopupSecondWindowName; - window.gPopupWindow.moveTo(nX, nY); - widnow.gPopupWindow.document.location.reload(); - } - else - { - var wmTemp=null; - if (gbBsKonqueror3) - { - if (window.gPopupWindow) - window.gPopupWindow.close(); - } - if (gbBsOpera&&gbBsMac) - { - wmTemp= window.open(document.location.href, "Temp", strParam); - } - window.gPopupWindow = window.open(strURL, gstrPopupSecondWindowName, strParam); - if (!gbBsIE) - window.gPopupWindow.focus(); - - if (wmTemp) - wmTemp.close(); - } - - if (gbBsNS4) - setEventHandle(); - else if (gbBsIE4 || gbBsOpera7||gbBsKonqueror3) - setTimeout("setPopupFocus();", 100); - } - return; -} - -function setEventHandle() -{ - window.gPopupWindow.captureEvents(Event.CLICK | Event.BLUR); - window.gPopupWindow.onclick = NonIEPopup_HandleClick; - window.gPopupWindow.onblur = NonIEPopup_HandleBlur; -} - -function setPopupFocus() -{ - window.gPopupWindow.focus(); -} - -function NonIEPopup_HandleBlur(e) -{ - window.gPopupWindow.focus(); -} - -function NonIEPopup_HandleClick(e) -{ - // Because navigator will give the event to the handler before the hyperlink, let's - // first route the event to see if we are clicking on a Popup menu in a popup. - document.routeEvent(e); - - // If a popup menu is active then don't do anything with the click - if (window.gPopupWindow.gbInPopupMenu) { - window.gPopupWindow.captureEvents(Event.CLICK); - window.gPopupWindow.onclick = NonIEPopup_HandleClick; - return false; - } - - // Close the popup window - if(e.target.href) - { - if(e.target.href.indexOf("javascript:")==-1) - { - if (e.target.target=="") - window.location.href = e.target.href; - else - window.open(e.target.href, e.target.target); - this.close(); - } - } - else - this.close(); - return false; -} - -function BSSCPopup_AfterLoad(nIndex, nToken, cuswidth, cusheight) -{ - if (!window.getPopupIFrame(nIndex).document) { - _BSSCPopup2(getPopupURL(nIndex), cuswidth, cusheight); - return; - } - - if (!IsValidToken(nToken)) return; - - if (gbBsNS6) - { - setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url. - BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight); - return; - } - - if ((window.getPopupIFrame(nIndex).document.readyState == "complete") && - (window.getPopupIFrame(nIndex).document.body != null)) { - if (window.getPopupIFrame(nIndex).document.location.href.indexOf("about:blank") != -1) { // add this check. IE will use about:blank" as the default vaule for Iframe. - window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex); - setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200); - } - else - { - setAbsPopupURL(nIndex, window.getPopupIFrame(nIndex).document.location.href); // change URL to abs url. - BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight); - } - } else { - setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200); - } -} - -function BSSCPopup_ResizeAfterLoad(nIndex, nToken, cuswidth, cusheight) -{ - if (window.gbPopupTimeoutExpired) return; - - if (!IsValidToken(nToken)) return; - - getPopupDivStyle(nIndex).visibility = gBsStyVisHide; - getPopupIFrameStyle(nIndex).visibility = gBsStyVisHide; - - // Determine the width and height for the window - _BSPSGetClientSize(); - - var size = new BSSCSize(0, 0); - - if (cuswidth <= 0 || cusheight <= 0) - BSSCGetContentSize(window.getPopupIFrame(nIndex), size); - else { - size.x = cuswidth; - size.y = cusheight; - } - - // Determine the width and height for the window - var nWidth = size.x; - var nHeight = size.y; - - // for small popup size, we should allow any size. - // The popup size should be ok if bigger than 0 - if (nWidth < 0 || nHeight < 0) return; // there must be something terribly wrong. - - getPopupDivStyle(nIndex).width = nWidth; - getPopupDivStyle(nIndex).height = nHeight; - - getPopupShadowStyle(nIndex).width = nWidth; - getPopupShadowStyle(nIndex).height = nHeight; - getPopupTopicStyle(nIndex).width = nWidth; - getPopupTopicStyle(nIndex).height = nHeight; - if (gbBsIE55) - { - getPopupShadowStyle(nIndex).width = nWidth + 2; - getPopupShadowStyle(nIndex).height = nHeight + 2; - getPopupTopicStyle(nIndex).width = nWidth + 2; - getPopupTopicStyle(nIndex).height = nHeight + 2; - } - - getPopupIFrameStyle(nIndex).width = nWidth; - getPopupIFrameStyle(nIndex).height = nHeight; - if (gbBsIE55 || gbBsNS6) - { - getPopupIFrameStyle(nIndex).top = 0; - getPopupIFrameStyle(nIndex).left = 0; - } - - var strURL = getPopupURL(nIndex); - if (strURL.indexOf("#") != -1&&gbBsNS6) - getPopupIFrame(nIndex).location.reload(); - else if (strURL.indexOf("#") != -1||gbBsNS6) - getPopupIFrame(nIndex).location.href = strURL; // reload again, this will fix the bookmark misunderstand in IE5. - - MoveDivAndShow(nIndex, nToken, cuswidth, cusheight); -} - -function getScrollLeft() -{ - if (document.body.scrollLeft) - return document.body.scrollLeft; - else if (window.pageXOffset) - return window.pageXOffset; - else - return 0; -} - -function getScrollTop() -{ - if (document.body.scrollTop) - return document.body.scrollTop; - else if (window.pageYOffset) - return window.pageYOffset; - else - return 0; -} - - -function MoveDivAndShow(nIndex, nToken, cuswidth, cusheight) -{ - if (window.getPopupIFrame(nIndex).document.location.href != getAbsPopupURL(nIndex)) { // if redirect, reload again. - window.getPopupIFrame(nIndex).document.location = getPopupURL(nIndex); - setTimeout("BSSCPopup_AfterLoad(" + nIndex + "," + nToken + "," + cuswidth + "," + cusheight + ")", 200); - return; - } - - // Determine the position of the window - var nClickX = window.gnPopupClickX; - var nClickY = window.gnPopupClickY; - var nTop = 0; - var nLeft = 0; - - var nWidth = parseInt(getPopupDivStyle(nIndex).width); - var nHeight = parseInt(getPopupDivStyle(nIndex).height); - - if (nClickY + nHeight + 20 < gBsClientHeight + getScrollTop()) { - nTop = nClickY + 10; - } else { - nTop = (getScrollTop() + gBsClientHeight) - nHeight - 20; - } - if (nClickX + nWidth < gBsClientWidth + getScrollLeft()) { - nLeft = nClickX; - } else { - nLeft = (getScrollLeft() + gBsClientWidth) - nWidth - 8; - } - - if (nTop < getScrollTop()) nTop = getScrollTop() + 1; - if (nLeft< getScrollLeft()) nLeft = getScrollLeft() + 1; - - getPopupDivStyle(nIndex).left = nLeft; - getPopupDivStyle(nIndex).top = nTop; - - // Set the location of the background blocks - getPopupShadowStyle(nIndex).left = 6; - getPopupShadowStyle(nIndex).top = 6; - if (gbBsIE55) - { - getPopupShadowStyle(nIndex).left = 4; - getPopupShadowStyle(nIndex).top = 4; - } - - if (gbBsMac&&gbBsIE4) { - // Total hack on the iMac to get the IFrame to position properly - getPopupIFrameStyle(nIndex).pixelLeft = 100; - getPopupIFrameStyle(nIndex).pixelLeft = 0; - // Explicitly call BSSCOnLoad because the Mac doesn't seem to do it - getPopupIFrame(nIndex).window.BSSCOnLoad(); - } - - if (gbBsNS6&&IsDirty(nIndex)) - getElement(getPopupIFrameID(nIndex)).addEventListener("load", handleLoadNS, false); - else - BSSCPopup_Timeout(nIndex , nToken ); - return; -} - -function BSSCSize(x, y) -{ - this.x = x; - this.y = y; -} - -function BSSCGetContentSize(thisWindow, size) -{ - if (!gbBsIE4 && !gbBsOpera7 && !gbBsNS4) - return; - - if ((gbBsMac&&gbBsIE4)||gbBsNS4||gbBsOpera7) { - size.x = 320; - size.y = 180; - return; - } - - // Resize the width until it is wide enough to handle the content - // The trick is to start wide and determine when the scrollHeight changes - // because then we know a scrollbar is necessary. We can then go back - // to the next widest size (for no scrollbar) - - var ClientRate = gBsClientHeight / gBsClientWidth; - - - var GoldenSize = new BSSCSize(0,0); - GoldenSize.x = gBsClientWidth * gBMaxXOfParent; - GoldenSize.y = gBsClientHeight *gBMaxYOfParent ; - - if (ClientRate > gBRateH_W) { - GoldenSize.y = GoldenSize.x * gBRateH_W; - } - else { - GoldenSize.x = GoldenSize.y / gBRateH_W; - } - - // Try to using parent specified max x. - var x = 0; - var maxgoldx = GoldenSize.x; - var maxx = gBsClientWidth * gBMaxXOfParent; - - // This double resize causes the document to re-render (and we need it to) - if (!gbBsIE5) - thisWindow.moveTo(10000,10000); // this is used to fix the flash on IE4. - - thisWindow.resizeTo(1, 1); - thisWindow.resizeTo(1, 1); - thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight); - thisWindow.resizeTo(maxgoldx, thisWindow.document.body.scrollHeight + gBscrollHeight); - - var miny = thisWindow.document.body.scrollHeight + gBscrollHeight; - - if (miny > GoldenSize.y) // the popup does not fix in the parent wanted golden area. so try to expand itself as large as it can - { - thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight); - thisWindow.resizeTo(maxx , thisWindow.document.body.scrollHeight + gBscrollHeight); - - miny = thisWindow.document.body.scrollHeight + gBscrollHeight; - maxy = gBsClientHeight * gBMaxYOfParent; - - if (miny > maxy) { // the popup must have a scroll, OK let it be. - miny = maxy; - size.x = maxx; - size.y = maxy; - thisWindow.document.body.scroll = 'yes'; // At this time we do want to show scroll any more. so it will looks better a little. - } - else { // popup still can fit in the parent area by someway. now we choose the same h/w rate as parent. - size.y = miny; - - // downsize from maxx , now I try to using binary divide. - x = maxx; - deltax = -maxx/2; - //j = 0; - while (true) { - x = x + deltax; - thisWindow.resizeTo(x, miny); - thisWindow.resizeTo(x, miny); - diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * ClientRate; - if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter - deltax = Math.abs(deltax) /2; - else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter - deltax = -Math.abs(deltax) /2; - else - // the y is close enough to wanted. - break; - if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore. - break; - } - size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth; - size.y = thisWindow.document.body.scrollHeight;// + gBscrollHeight; - thisWindow.document.body.scroll = 'no'; - } - } - else { - if (thisWindow.document.body.scrollWidth > maxgoldx) { - size.x = maxx; - size.y = miny; - thisWindow.document.body.scroll = 'yes'; - } - else { - // downsize from maxgoldx , now I try to using binary divide. - x = maxgoldx; - deltax = -maxgoldx/2; - while (true) { - x = x + deltax; - thisWindow.resizeTo(x, miny); - thisWindow.resizeTo(x, miny); - diffy = thisWindow.document.body.scrollHeight + gBscrollHeight - x * gBRateH_W; - if (diffy > gBpermitYDelta ) // it is higher than wanted, so x need to be wide a little bitter - deltax = Math.abs(deltax) /2; - else if (diffy < -gBpermitYDelta) // it is shorter than wanted, so x need to be narrow a little bitter - deltax = -Math.abs(deltax) /2; - else - // the y is close enough to wanted. - break; - if (Math.abs(deltax) < gBpermitXDelta) // the next change is too slight and it can be ignore. - break; - } - size.x = thisWindow.document.body.scrollWidth; //+ gBscrollWidth; - size.y = thisWindow.document.body.scrollHeight ; - thisWindow.document.body.scroll = 'no'; // At this time we do not want to show scroll any more. so it will looks better a little. - thisWindow.resizeTo(size.x, size.y); - if (thisWindow.document.body.scrollWidth > size.x) - { - size.x = thisWindow.document.body.scrollWidth; - } - if (thisWindow.document.body.scrollHeight > size.y) - { - size.y = thisWindow.document.body.scrollHeight; - } - } - } - thisWindow.resizeTo(size.x, size.y); - thisWindow.resizeTo(size.x, size.y); - return; -} - -function BSSCPopupParentClicked() -{ - if (!window.gbPopupTimeoutExpired) { - return false; - } - - document.onmousedown = gbOrignalOnMouseDown; - - // Simply hide the popup - hideAll(); - - window.gbPopupTimeoutExpired = false; - - return true; -} - -function isInsideHyperLink(obj) -{ - if (obj&&obj!=getParentNode(obj)) - { - if (obj.tagName=="A"||obj.tagName=="IMG") - return true; - else - return isInsideHyperLink(getParentNode(obj)); - } - else - return false; -} - -function BSSCPopupClicked(e) -{ - if (!window.gbPopupTimeoutExpired) { - return false; - } - - var popupIFrame = getCurrentPopupIFrame(); - if (popupIFrame == null) { - return true; - } - - if (gbBsIE4 && (!((popupIFrame.window.event != null) && - (popupIFrame.window.event.srcElement != null) && - isInsideHyperLink(popupIFrame.window.event.srcElement)))) { - document.onmousedown = gbOrignalOnMouseDown; - - // Simply hide the popup - hideAll(); - window.gbPopupTimeoutExpired = false; - return true; - } - else if (gbBsNS6 && (!((e != null) && - (e.target!= null) && isInsideHyperLink(e.target)))) - { - document.addEventListener("mousedown", gbOrignalOnMouseDown,false); - // Simply hide the popup - hideAll(); - window.gbPopupTimeoutExpired = false; - return true; - } -} - -//trace the mouse over's position for hotspot -function BSPSPopupOnMouseOver(event) -{ - if (gbBsIE4 || gbBsOpera7||gbBsKonqueror3) { - window.gnPopupClickX = event.clientX + getScrollLeft(); - window.gnPopupClickY = event.clientY + getScrollTop(); - window.gnPopupScreenClickX = event.screenX; - window.gnPopupScreenClickY = event.screenY; - } else if (gbBsSafari) { - window.gnPopupClickX = event.clientX + getScrollLeft(); - window.gnPopupClickY = event.clientY + getScrollTop(); - window.gnPopupScreenClickX = event.screenX + window.screenX; - window.gnPopupScreenClickY = event.screenY + window.screenY; - } else if (gbBsNS4) { - window.gnPopupClickX = event.pageX - window.pageXOffset; - window.gnPopupClickY = event.pageY - window.pageYOffset; - window.gnPopupScreenClickX = event.screenX - window.pageXOffset; - window.gnPopupScreenClickY = event.screenY - window.pageYOffset; - } -} - -function BSSCHidePopupWindow() -{ - if (window.gPopupWindow != null) { - if (gbBsNS4) { - if ((typeof window.gPopupWindow != "undefined") && (!window.gPopupWindow.closed)) { - window.gPopupWindow.close(); - window.gPopupWindow = null; - } - } - } - return; -} - -// Add the PopupOnClick to the onclick array. -if (typeof(BsscRegisterOnClick) != "undefined") -{ - BsscRegisterOnClick(BsPopupOnClick); -} -//End to support previous popup functions - -/// Section End - Popup (JavaScript 1.0) - -/// Section Begin - Embedded Stub (JavaScript 1.0) - -function BSSCCreatePopupDiv() -{ - return; -} - -function WritePopupMenuLayer() -{ - if (BsscHasExtJs()) {_WritePopupMenuLayer();} -} - -function BSSCPopup(strURL, width, height) -{ - var re = new RegExp("'", 'g'); - strURL = strURL.replace(re, "%27"); - - if (BsscHasExtJs()) { - _BSSCPopup(strURL, width, height); - }else{ - //Create a temporary window first to ensure the real popup comes up on top - var wndTemp = null; - if (!gbBsNS3) { - wndTemp = window.open("", "temp", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=3,width=4"); - } - // Create the real popup window - var wndPopup = window.open(strURL, "BSSCPopup", "titlebar=no,toolbar=no,status=no,location=no,menubar=no,resizable=yes,scrollbars=yes,height=300,width=400"); - // Close the temporary - if (!gbBsNS3) { - wndTemp.close(); - } else { - wndPopup.focus(); - } - } -} - -var gbWndTemp = null, gbWndPopupLinks = null; -var gbstrParaTotal = ""; - -function PopupMenu_Invoke() -{ - if (typeof(wfRelatedTopic) == 'function' && typeof(IsFlashSupported) == 'function') - { - if (Number(gsSkinVersion) > 2 && IsFlashSupported()) - { - return wfRelatedTopic(PopupMenu_Invoke.arguments); - } - } - if (BsscHasExtJs()) { - return _PopupMenu_Invoke(PopupMenu_Invoke.arguments); - } - if (gbBsNS3Before || gbBsIE3Before ) { - var argLen = PopupMenu_Invoke.arguments.length; - if (argLen < 5) { - window.document.location.href = PopupMenu_Invoke.arguments[3]; - return false; - } - gbWndTemp = null; - gbWndPopupLinks = null; - gbstrParaTotal = ""; - for (var i = 0; i < (argLen - 2) / 2; i++) { - var strParaLine = ""; - if (gbBsNS2){ - strParaLine += "" - strParaLine += PopupMenu_Invoke.arguments[2 * i + 2]; - strParaLine += ""; - } else { - strParaLine += ""); - if (gbBsNS2) { - gbWndPopupLinks.document.write(""); - } else { - //YJ: IE301,302 and NS3.x works fine - gbWndPopupLinks.document.write("<"); - gbWndPopupLinks.document.write("script>"); - gbWndPopupLinks.document.write("function gotoUrl(aUrl) {opener.window.location=aUrl; close();}"); - gbWndPopupLinks.document.write("<"); - gbWndPopupLinks.document.write("/script>"); - } - gbWndPopupLinks.document.write(""); - gbWndPopupLinks.document.write(gbstrParaTotal); - gbWndPopupLinks.document.write(""); - gbWndPopupLinks.document.close(); - - // Close the temporary - if (!gbBsNS3 && gbWndTemp != null) { - gbWndTemp.close(); - }else { - gbWndPopupLinks.focus(); - } - - return true; - } - return false; -} - -/// Section End - Embedded Stub (JavaScript 1.0) - -//// Segment End -- (JavaScript 1.0) - -//// Segment Begin -- (JavaScript 1.2) -/// Section Begin - kadov DHTM (JavaScript 1.2) - -//Begin to support extended and dropdown text effects. -function kadovIsParagraph(el) -{ - return( el.tagName == "P" || el.tagName.indexOf("H") == 0 ) ? true : false; -} - -function kadovInitEachChild(el) -{ - for(var i=0; i "") ) - child.style.setAttribute( "x-on-pageload", "" ); - } - - var href = child.getAttribute("href") - if( href != null && href > "" && href.indexOf( "BSSCPopup" ) >= 0 ) - kadovFilePopupInit(child.id); // Init for Popup - else if( child.className == "dropspot" || child.className == "expandspot" || - child.className == "glossterm" ) - kadovTextPopupInit(child.id);// Init for Expanding/Glossary or DropDown text - else if( child.className == "trigger") - kadovInitTrigger(child.id);// Init for Trigger - else - { - kadovInitEffects(child.id);// Init for DHTML effects - CEngine.SetOneTargetInitialState( child.id ); - } - } - - if( (child.tagName == "IMG") && (child.getAttribute("dynsrc") > "") ) - child.start = "mouseover";// to start a AVI file. fileopen doesn't work - - kadovInitEachChild(child); - } -} - -function kadovRetrieveTextInner(el) -{ - var x = ""; - if( (!el) || (el.tagName == "!") || (el.tagName == "SCRIPT" )) - return x; - - if( kadovIsParagraph(el) ) - { - var strNewID = " "; - if( el.id != "" ) - strNewID += "id=" + el.id + "_NewSpan "; - x = "" + el.innerHTML + ""; - } - else - { - for(var i=0; i 0 ) - if( (nTagClose - nTagOpen) != nDistance ) - return strRawHTML; - - var strCleanOnce = strRawHTML.substring(0, nTagOpen) + strRawHTML.substr(nTagClose + strTagClose.length) ; - return kadovRetrieveCleanHTML( strCleanOnce, strTagOpen, strTagClose ); -} - -function kadovAdjustObjectTag(strRawHTML, nStartPos) -{// adjust object tag for related topics HTML control, because innerHTML misses out the item settings - - //Is there any DTC? - var strDTCTagOpen = ''; - var nDTCTagOpen = strRawHTML.indexOf( strDTCTagOpen, nStartPos ); - if( nDTCTagOpen < 0 ) - return strRawHTML; - var nDTCTagClose = strRawHTML.indexOf( strDTCTagClose, nDTCTagOpen ); - if( nDTCTagClose < nDTCTagOpen) - return strRawHTML; // no Design Time Controls; - - //Is the DTC HTML Help Control? - var strRTObjTagOpen = 'classid=clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11'; - var strRTObjTagClose = ''; - var nRTObjTagOpen = strRawHTML.indexOf( strRTObjTagOpen, nDTCTagOpen ); - if( nRTObjTagOpen < nDTCTagOpen ) - return strRawHTML; - var nRTObjTagClose = strRawHTML.indexOf( strRTObjTagClose, nRTObjTagOpen ); - if( nRTObjTagClose < nRTObjTagOpen ) - return strRawHTML; // is not a HTML help control - - // Is it a related Topics html help control? - var strRTObjLabel = ''; - } - - // to insert the reconstructed item params into runtime object tag - var strAdjustedHTML = strRawHTML.substring(0,nRTObjTagClose) + strRunTimeItemParam + strRawHTML.substring(nRTObjTagClose, strRawHTML.length); - return kadovAdjustObjectTag(strAdjustedHTML, nDTCTagClose + strDTCTagClose.length); -} - -function kadovTextPopupOnLoad( el ) -{ - if( typeof(el) == "string" ) - el = getElement(el); - - var src = el.getAttribute( "x-use-popup" ); - var bNeedMove=true; - if(!src&&el.id) - { - for (var i=0;i"); - strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, ""); - - //work around the bug in HH.exe that highlight the phrases when use Search tab - //this approach is just removing the tag inserted by Microsoft in the runtime - strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, "", 52); - - var strStyle = " style='display:none; position:relative;"; - var newDiv = "
" + strCleanHTML + "
"; - - removeThis(srcDiv); // empty the original DIV tag - var elParentPra = kadovFindParentParagraph(el); - if( elParentPra ) - insertAdjacentHTML(elParentPra, "afterEnd", newDiv ); - } - else if( type == "expanding" ) - { - var inner = kadovRetrieveTextInner(srcDiv); - if( inner == "" ) - inner = srcDiv.innerHTML; - var strAdjust = kadovAdjustObjectTag(inner,0); - var strCleanHTML = kadovRetrieveCleanHTML(strAdjust, ""); - strCleanHTML = kadovRetrieveCleanHTML(strCleanHTML, ""); - var strClassName = (el.className == "glossterm") ? "glosstext" : "expandtext"; - var newSpan = ""; - removeThis(srcDiv); // empty the original DIV tag - insertAdjacentHTML(el, "afterEnd", newSpan ); - } - } - } - else - { - srcDiv.style.display = "none"; - } - return 0; -} - -function getElementsByTag(obj,sTagName) -{ - if(obj.getElementsByTagName) - return obj.getElementsByTagName(sTagName); - else if(obj.all) - return obj.all.tags(sTagName); - return null; -} - -function getElement(sID) -{ - if(document.getElementById) - return document.getElementById(sID); - else if(document.all) - return document.all(sID); - return null; -} - -function getParentNode(obj) -{ - if(obj.parentNode) - return obj.parentNode; - else if(obj.parentElement) - return obj.parentElement; - return null; -} - -function getChildNodes(obj) -{ - if(obj.childNodes) - { - var children = new Array(); - for (var i = 0; i < obj.childNodes.length; i++) - { - if (obj.childNodes[i].nodeType == 1) - children[children.length] = obj.childNodes[i]; - } - return children; - } - else if(obj.children) - return obj.children; - return null; -} - -function removeThis(obj) -{ - if(obj.parentNode) - obj.parentNode.removeChild(obj); - else - obj.outerHTML=""; -} - -function kadovTextPopup( el ) -{ - if (!gbBsIE4 && !gbBsOpera7 && !gbBsSafari && !gbBsNS6 && !gbBsKonqueror3 ) - return; - - var bNeedMove=true; - - if (window.event) - window.event.cancelBubble = true; - - if( typeof(el) == "string" ) - el = getElement(el); - - if (!el||el==window) - return; - - var src = el.getAttribute( "x-use-popup" ); - if(!src&&el.id) - { - for (var i=0;i= 0 && nNext < values.length ) - { - functions[nIdx] = values.substr( nStart, nNext-nStart+1); - nStart = nNext + 1; - nIdx++; - nNext = values.indexOf( "\)", nStart); - } - - for( var i=0; i= 0 ) - { - nPageClick = arrForClickCount[j].indexOf("="); - if( nPageClick > 0 ) - { - nClickTimes = arrForClickCount[j].substring( nPageClick + 1, arrForClickCount[j].length) * 1; - break; - } - } - } - var args = srcargs; - if( j < arrForClickCount.length ) - {// to strip out the "clicks=99" from the arguments string - args = ""; - for( var k = 0; k < arrForClickCount.length; k ++ ) - { - if( k != j ) - { - args += arrForClickCount[k]; - if( k < arrForClickCount.length - 1 ) - args += ","; - } - } - } - bsscFXInit( null, id, translatedProp, fnname, args, nClickTimes ); - } -} - -function kadovTranslateProp( prop ) -{ - switch( prop ) - { - case "x-on-hover" : return "bsschover"; - case "x-on-pageclick" : return "bsscpageclick"; - case "x-on-pageload" : return "bsscpageload"; - case "x-on-trigger-1" : return "bssctrigger1"; - case "x-on-trigger-2" : return "bssctrigger2"; - } - return null; -} -//End to convert iWrite format to RoboEditor Format for DHTML effects - -//Begin the definition of one entry to DHTML effects -function bsscFXInit( trigger_ID, target_ID, event_type, - action_type, action_setting, event_addional ) -{ - if( (!gbBsWindows && !gbBsSunOS && !(gbBsMac&&gbBsIE5)) || typeof(target_ID) != "string" )//MUST have a target_ID - return; // we don't support Navigator yet - - if( typeof(event_type) == "string" ) - event_type = event_type.toLowerCase(); - if( typeof(action_type) == "string" ) - action_type = action_type.toLowerCase(); - if( typeof(action_setting) == "string" ) - action_setting = action_setting.toLowerCase(); - - // to get the target element then add it to the target list - var eleTarget = CCSSP.GetObject( target_ID ); - if( (eleTarget != null) && (event_type != null) && (action_type != null) ) - { - CEngine.AddOneTarget( target_ID, eleTarget ); - CEngine.BuildTargetObject(target_ID, event_type, action_type, action_setting, event_addional); - } - - // to validate the trigger_ID parameter - if( typeof(trigger_ID) == "string" && trigger_ID != "" ) - CEngine.BuildTriggerObject( trigger_ID, target_ID ); -} -//End the definition of one entry to DHTML effects - -/// Section End - kadov DHTM (JavaScript 1.2) - -/// Section Begin - CCSSP DHTM (JavaScript 1.2) - -//Begin JavaScript libary for cross-platform positioning object. -function CCSSP(){} // constructor of CCSSP class - -CCSSP.GetObject = function( obj ) -{//convert object name string or reference into a valid object reference - if( typeof(obj) == "object" ) - return obj; - else if( typeof(obj) == "string" && obj != "") - { - if( gbBsNS4 ) - return eval("document." + obj); - else - return eval("document.all(\"" + obj + "\")"); - } - else - return null; -} - -CCSSP.MoveObjectTo = function(obj, x, y) -{//positioning an object at a specific pixel coordinate - if( gbBsNS4 ) - obj.moveTo(x,y); - else - { - obj.style.pixelLeft = x; - obj.style.pixelTop = y; - } -} - -CCSSP.MoveObjectBy = function(obj, dx, dy) -{//moveing a object by x and/or y pixel - if( gbBsNS4 ) - obj.moveBy(dx,dy); - else - { - obj.style.pixelLeft += dx; - obj.style.pixelTop += dy; - } -} - -CCSSP.SetObjectBGColor = function(obj, color) -{//set the background color of an object - if( gbBsNS4 ) - obj.bgColor = color; - else - obj.style.backgroundColor = color; -} - -CCSSP.ShowObject = function(obj, bShow) -{// set the object to be visible or invisible - if( gbBsNS4 ) - obj.visibility = (bShow == true) ? 'show' : 'hide'; - else - obj.style.visibility = (bShow == true) ? 'visible' : 'hidden';// when hidden, it still occupy some space. -} - -CCSSP.GetObjectLeft = function(obj) -{// retrieve the x coordinate of a posionable object - if( gbBsNS4 ) - return obj.left; - else - return obj.style.pixelLeft; -} - -CCSSP.GetObjectTop = function(obj) -{// retrieve the y coordinate of a posionable object - if( gbBsNS4 ) - return obj.top; - else - return obj.style.pixelTop; -} - -CCSSP.GetObjectContainLeft = function(obj) -{// retrieve the x coordinate of a posionable object relative to it's parent element - if( gbBsNS4 ) - return obj.pageX; - else - { - if( obj == document.body ) - return obj.clientLeft; - else - return obj.offsetLeft; - } -} - -CCSSP.GetObjectWindowLeft = function(obj) -{// retrieve the x coordinate of a posionable object relative to browser window - if( gbBsNS4 ) - return obj.pageX; - else - { - var nOffsetWindowLeft = 0; - for(var element = obj; element; element = element.offsetParent) - nOffsetWindowLeft += CCSSP.GetObjectContainLeft(element); - return nOffsetWindowLeft; - } -} - -CCSSP.GetObjectContainTop = function(obj) -{// retrieve the y coordinate of a posionable object relative to it's parent element - if( gbBsNS4 ) - return obj.pageY; - else - { - if( obj == document.body ) - return obj.clientTop; - else - return obj.offsetTop; - } -} - -CCSSP.GetObjectWindowTop = function(obj) -{// retrieve the y coordinate of a posionable object relative to browser window - if( gbBsNS4 ) - return obj.pageY; - else - { - var nOffsetWindowTop = 0; - for(var element = obj; element; element = element.offsetParent) - nOffsetWindowTop += CCSSP.GetObjectContainTop(element); - return nOffsetWindowTop; - } -} - -CCSSP.GetObjectHeight = function(obj) -{// retrieve the height of a posionable object - if( gbBsNS4 ) - return obj.clip.height; - else - return obj.offsetHeight; -} - -CCSSP.GetObjectWidth = function(obj) -{// retrieve the width of a posionable object - if( gbBsNS4 ) - return obj.clip.width; - else - return obj.offsetWidth; -} - -CCSSP.RegisterEventHandler = function( srcObj, rawEventName, funcHandler ) -{ // to add the "funcHandler" as the "rawEventName" 's handler to the "srcObj" object,the original event handler will be combined - if (gbBsNS4 && !gbBsNS6) - return ; - - var oldHandler = ""; - - if (gbBsMac &&gbBsIE4&&!gbBsIE5) - { - if (typeof(srcObj[rawEventName.toLowerCase()])=="unknown") - { //search for - - - - - - - - - -

Extrusion

- -

Extrusion is a type of surface meshing by generation from discretized - lines. It is used to build mesh elements of plus one dimension than the - swept ones. Each swept 1D element produces one or more quadrangles (or - triangles if one node of a rotated element lays on the revolution axis).

- -

 

- -

To use extrusion:

- -

 

- -

1. From the Modification - menu choose the Extrusion item - or click button in the toolbar. The following dialog box - will appear:

- -

 

- -

 

- -

 

- -

2. In this dialog box you should select

- -
    - -
  • the type of elements - which will be extruded (1D or 2D),

  • - -
  • specify the IDs of - the elements which will be extruded by selecting them in the 3D viewer - or select the whole mesh or submesh,

  • - -
  • specify the vector - along which the elements will be extruded,

  • - -
  • number of steps

  • -
- -

 

- -

3. Click the Apply - or OK button.

- -

 

- -

 

- - --- - - - -
-

-

- -

 

- -
- -

 

- - - - + + + + + +Extrusion + + + + + + + + + + + + +

Extrusion

+ +

Extrusion is a type of surface meshing by generation from discretized + lines. It is used to build mesh elements of plus one dimension than the + swept ones. Each swept 1D element produces one or more quadrangles (or + triangles if one node of a rotated element lays on the revolution axis).

+ +

 

+ +

To use extrusion:

+ +

 

+ +

1. From the Modification + menu choose the Extrusion item + or click button in the toolbar. The following dialog box + will appear:

+ +

 

+ +

 

+ +

 

+ +

2. In this dialog box you should select

+ +
    + +
  • the type of elements + which will be extruded (1D or 2D),

  • + +
  • specify the IDs of + the elements which will be extruded by selecting them in the 3D viewer + or select the whole mesh or submesh,

  • + +
  • specify the vector + along which the elements will be extruded,

  • + +
  • number of steps

  • +
+ +

 

+ +

3. Click the Apply + or OK button.

+ +

 

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

 See + Also a sample TUI Script of an Extrusion + operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/about_hypotheses.htm b/doc/salome/gui/SMESH/files/about_hypotheses.htm index 0811bc586..449308c20 100755 --- a/doc/salome/gui/SMESH/files/about_hypotheses.htm +++ b/doc/salome/gui/SMESH/files/about_hypotheses.htm @@ -1,213 +1,213 @@ - - - - - -About hypotheses - - - - - - - - - - - - - -

About hypotheses

- -

Hypotheses represent - boundary conditions which will be taken into account at calculations of - meshes or submeshes basing on geometrical objects. These hypotheses allow - you to manage the level of detail of the resulting meshes or submeshes: - when applying different hypotheses with different parameters you can preset - the quantity of meshing elements which will compose your mesh. So, it - will be possible to generate a rough or a more refined mesh or submesh. -

- -

 

- -

In MESH there are the following - Basic Hypotheses (to introduce them, you operate numerical values):

- - - -
    - - -
- - - -

 

- -

There also exist some Additional - Hypotheses

- -
    - -
      - -
    • Propagation of 1D Hypothesis on opposite edges

    • - -
    • Non conform mesh allowed

    • - -
    • Quadratic mesh

    • -
    -
- -

 

- -

The choice of a hypothesis depends on:

- -
    - -
  • the geometrical object (shape) which will be meshed

  • - -
  • the algorithm, which will be selected for meshing - of this geometrical object (shape)

  • -
- -

 

- -

 

- - - - + + + + + +About hypotheses + + + + + + + + + + + + + +

About hypotheses

+ +

Hypotheses represent + boundary conditions which will be taken into account at calculations of + meshes or submeshes basing on geometrical objects. These hypotheses allow + you to manage the level of detail of the resulting meshes or submeshes: + when applying different hypotheses with different parameters you can preset + the quantity of meshing elements which will compose your mesh. So, it + will be possible to generate a rough or a more refined mesh or submesh. +

+ +

 

+ +

In MESH there are the following + Basic Hypotheses (to introduce them, you operate numerical values):

+ + + +
    + + +
+ + + +

 

+ +

There also exist some Additional + Hypotheses

+ +
    + +
      + +
    • Propagation of 1D Hypothesis on opposite edges

    • + +
    • Non conform mesh allowed

    • + +
    • Quadratic mesh

    • +
    +
+ +

 

+ +

The choice of a hypothesis depends on:

+ +
    + +
  • the geometrical object (shape) which will be meshed

  • + +
  • the algorithm, which will be selected for meshing + of this geometrical object (shape)

  • +
+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/about_meshes.htm b/doc/salome/gui/SMESH/files/about_meshes.htm index 1b91ca434..353b6a7a8 100755 --- a/doc/salome/gui/SMESH/files/about_meshes.htm +++ b/doc/salome/gui/SMESH/files/about_meshes.htm @@ -1,250 +1,250 @@ - - - - - -About meshes - - - - - - - - - - - - -

About meshes

- -

MESH represents - a discretization of a geometrical CAD model into a set of entities with - a simple topology. In MESH there are two options of creation of meshes, - you can:

- -

 

- -
    - -
  • generate meshes on the basis of geometrical shapes - produced in the GEOM module,

  • - -
  • create your own meshes using the MESH functions - destined for modification of generated meshes.

  • -
- -

 

- -

The topology of a mesh is described by the relationships between its - entities including:

- -

 

- -
    - -
  • Node - – 0D element of a mesh presented by a point with coordinates (x, y, z).

  • - -
  • Edge - – 1D element of a mesh defined by two nodes.

  • - -
  • Face - – 2D element of a mesh defined by three or four edges (closed contour).

  • - -
  • Volume - – 3D element of a mesh defined by several faces.

  • -
- -

 

- -

These entities are considered as topological - entities and they don't imply any geometric representation. Only Nodes reference  geometric - representations of points with definite coordinates. The - node entity will contain  additional - information about its position in the space and its relations with the - meshed CAD model. Its position could be described in the following way:

- -

 

- -
    - -
  • 2D - position. It is a free position defined by only two coordinates - x,y.

  • - -
  • 3D - position. It is a free position defined by three coordinates x,y - and z.

  • - -
  • Surface - position. It characterizes the position of a node on a geometric - surface and is defined by the u,v position in the parametric space of - the corresponding surface.

  • - -
  • Line - position. It characterizes the position of a node on a geometric - curve and is defined by the u parameter and the corresponding curve.

  • - -
  • Vertex - position. It characterizes the position of a node on a geometric - point of the meshed CAD model and is defined by the x,y,z coordinates - of the corresponding vertex.

  • -
- -

 

- -

 

- -

Connections

- -

Each mesh entity bounds 0 or more mesh entities - of higher dimension. In the same way each mesh entity is bounded by 0 - or more mesh entities of lower dimension:

- -

 

- -
    - -
  • A node bounds edges, - faces and volumes

  • - -
  • An edge bounds faces, - and volumes

  • - -
  • A face bounds volumes

  • - -
  • A volume is bounded - by faces, edges and nodes

  • - -
  • A face is bounded by - edges, and nodes

  • - -
  • An edge is bounded by - nodes

  • -
- -

 

- -

You can notice that there are two types of - connections: inverse and direct connections.

- -

 

- -

Inverse connections

- -

 

- -

This relationship has a particularity that - the order of bounded entities has not a direct meaning. Also the number - of bounded entities is not fixed.

- -

 

- -

The edges surrounding a node. - The 3rd edge has no more sense that the 5th one.

- -

 

- -

Direct connections

- -

 

- -

This relationship has a particularity that - the order of bounding entities is meaningful. The number of bounding entities - is fixed and depends on the type of the entity (hexahedron, tetrahedron,Â…).

- -

 

- -

An edge is composed of two - nodes. A face is composed of 3 or 4 edges depending if we are dealing - with triangles or quadrangles.

- -

 

- -

The connections are not only restricted to - entities of one dimension higher or lower. For example some algorithms - may be interested to retrieve all the faces surrounding a node.

- -

 

- -

 

- -

 

- - - - + + + + + +About meshes + + + + + + + + + + + + +

About meshes

+ +

MESH represents + a discretization of a geometrical CAD model into a set of entities with + a simple topology. In MESH there are two options of creation of meshes, + you can:

+ +

 

+ +
    + +
  • generate meshes on the basis of geometrical shapes + produced in the GEOM module,

  • + +
  • create your own meshes using the MESH functions + destined for modification of generated meshes.

  • +
+ +

 

+ +

The topology of a mesh is described by the relationships between its + entities including:

+ +

 

+ +
    + +
  • Node + – 0D element of a mesh presented by a point with coordinates (x, y, z).

  • + +
  • Edge + – 1D element of a mesh defined by two nodes.

  • + +
  • Face + – 2D element of a mesh defined by three or four edges (closed contour).

  • + +
  • Volume + – 3D element of a mesh defined by several faces.

  • +
+ +

 

+ +

These entities are considered as topological + entities and they don't imply any geometric representation. Only Nodes reference  geometric + representations of points with definite coordinates. The + node entity will contain  additional + information about its position in the space and its relations with the + meshed CAD model. Its position could be described in the following way:

+ +

 

+ +
    + +
  • 2D + position. It is a free position defined by only two coordinates + x,y.

  • + +
  • 3D + position. It is a free position defined by three coordinates x,y + and z.

  • + +
  • Surface + position. It characterizes the position of a node on a geometric + surface and is defined by the u,v position in the parametric space of + the corresponding surface.

  • + +
  • Line + position. It characterizes the position of a node on a geometric + curve and is defined by the u parameter and the corresponding curve.

  • + +
  • Vertex + position. It characterizes the position of a node on a geometric + point of the meshed CAD model and is defined by the x,y,z coordinates + of the corresponding vertex.

  • +
+ +

 

+ +

 

+ +

Connections

+ +

Each mesh entity bounds 0 or more mesh entities + of higher dimension. In the same way each mesh entity is bounded by 0 + or more mesh entities of lower dimension:

+ +

 

+ +
    + +
  • A node bounds edges, + faces and volumes

  • + +
  • An edge bounds faces, + and volumes

  • + +
  • A face bounds volumes

  • + +
  • A volume is bounded + by faces, edges and nodes

  • + +
  • A face is bounded by + edges, and nodes

  • + +
  • An edge is bounded by + nodes

  • +
+ +

 

+ +

You can notice that there are two types of + connections: inverse and direct connections.

+ +

 

+ +

Inverse connections

+ +

 

+ +

This relationship has a particularity that + the order of bounded entities has not a direct meaning. Also the number + of bounded entities is not fixed.

+ +

 

+ +

The edges surrounding a node. + The 3rd edge has no more sense that the 5th one.

+ +

 

+ +

Direct connections

+ +

 

+ +

This relationship has a particularity that + the order of bounding entities is meaningful. The number of bounding entities + is fixed and depends on the type of the entity (hexahedron, tetrahedron,Â…).

+ +

 

+ +

An edge is composed of two + nodes. A face is composed of 3 or 4 edges depending if we are dealing + with triangles or quadrangles.

+ +

 

+ +

The connections are not only restricted to + entities of one dimension higher or lower. For example some algorithms + may be interested to retrieve all the faces surrounding a node.

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/about_meshing_algorithms.htm b/doc/salome/gui/SMESH/files/about_meshing_algorithms.htm index 213fa1f13..5444163bc 100755 --- a/doc/salome/gui/SMESH/files/about_meshing_algorithms.htm +++ b/doc/salome/gui/SMESH/files/about_meshing_algorithms.htm @@ -1,227 +1,243 @@ - - - - - -About meshing algorithms - - - - - - - - - - - - - -

Defining meshing algorithms

- -

The MESH module contains a set of meshing algorithms, - which are used for meshing entities (1D, 2D, 3D) composing geometrical - objects. They are as follows:

- -

 

- -
    - -
  • For meshing of 1D entities (edges):

  • -
- -

 

- -
    - -
      - -
    • Wire Discretization meshing algorithm

    • -
    -
- -

 

- -
    - -
  • For meshing of 2D entities (faces):

  • -
- -

 

- -
    - -
      - -
    • Triangle meshing algorithm - Faces are split - into triangular elements.

    • - -
    • Quadrangle meshing algorithm - Faces are split - into quadrangular elements.

    • -
    -
- -

 

- - --- - - - -
-

-

- -

 

- -

 

- -
    - -
  • For meshing of 3D entities (volume - objects):

  • -
- -

 

- -
    - -
      - -
    • Hexahedron meshing algorithm - Volumes are - split into hexahedral (cubic) elements.

    • - -
    • Tetrahedron (Netgen) meshing algorithm - Volumes - are split into tetrahedral (pyramidal) elements.

    • -
    -
- -

 

- - --- - - - -
-

-

- -

 

- -

To apply a meshing algorithm:

- -

Select this algorithm in the Create Mesh dialog box.

- -

 

- -

See Also - a sample TUI Script of a Define - Meshing Algorithm operation.  

- -

 

- - - - + + + + + +About meshing algorithms + + + + + + + + + + + + + +

Basic meshing algorithms

+ +

The MESH module contains a set of meshing algorithms, + which are used for meshing entities (1D, 2D, 3D) composing geometrical + objects.

+ +

 

+ +
    + +
  • For meshing of 1D entities (edges):

  • +
+ +

 

+ +
    + +
      + +
    • Wire Discretization meshing algorithm

    • +
    +
+ +

 

+ +
    + +
  • For meshing of 2D entities (faces):

  • +
+ +

 

+ +
    + +
      + +
    • Triangle meshing algorithms (Mefisto and Netgen + 1D-2D ) - Faces are split into triangular elements.

    • + +
    • Quadrangle meshing algorithm (Mapping) - Faces + are split into quadrangular elements.

    • +
    +
+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

 

+ +
    + +
  • For meshing of 3D entities (volume + objects):

  • +
+ +

 

+ +
    + +
      + +
    • Hexahedron meshing algorithm (i,j,k) - Volumes + are split into hexahedral (cubic) elements.

    • + +
    • Tetrahedron (Netgen) meshing algorithm - Volumes + are split into tetrahedral (pyramidal) elements.

    • +
    +
+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

 

+ +

There also is a number of more specific algorithms:

+ + + +

Constructing + meshes page describes in detail + how to apply meshing algorithms. +

+ +

See Also + a sample TUI Script of a Define + Meshing Algorithm operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/about_quality_controls.htm b/doc/salome/gui/SMESH/files/about_quality_controls.htm index 0bf3d0bf7..e8bd41667 100755 --- a/doc/salome/gui/SMESH/files/about_quality_controls.htm +++ b/doc/salome/gui/SMESH/files/about_quality_controls.htm @@ -1,175 +1,175 @@ - - - - - -About quality controls - - - - - - - - - - - - -

About quality controls

- -

Mesh - quality control in MESH is destined for visual control of the generated - mesh.

- -

Application of a definite quality control - consists of usage of the corresponding algorithm, which calculates a value - of a definite geometric characteristic (Area, Length of edges, etc) for - all meshing elements, composing your mesh. Then all meshing elements are - colored according the calculated values. The reference between the coloring - of the meshing elements and these calculated values is shown with the - help of a scalar bar, which is displayed near the presentation of your - mesh.      

- -

 

- -

There are 1D, 2D and 3D quality controls. -

- -

  

- -

1D mesh quality controls:

- -

 

- - - -

 

- -

2D mesh quality controls:

- -

 

- - - - - -

 

- -

3D mesh quality controls:

- -

 

- - - -

 

- - - - + + + + + +About quality controls + + + + + + + + + + + + +

About quality controls

+ +

Mesh + quality control in MESH is destined for visual control of the generated + mesh.

+ +

Application of a definite quality control + consists of usage of the corresponding algorithm, which calculates a value + of a definite geometric characteristic (Area, Length of edges, etc) for + all meshing elements, composing your mesh. Then all meshing elements are + colored according the calculated values. The reference between the coloring + of the meshing elements and these calculated values is shown with the + help of a scalar bar, which is displayed near the presentation of your + mesh.      

+ +

 

+ +

There are 1D, 2D and 3D quality controls. +

+ +

  

+ +

1D mesh quality controls:

+ +

 

+ + + +

 

+ +

2D mesh quality controls:

+ +

 

+ + + + + +

 

+ +

3D mesh quality controls:

+ +

 

+ + + +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/adding_nodes_and_elements.htm b/doc/salome/gui/SMESH/files/adding_nodes_and_elements.htm index 88826e3c8..014d6120d 100755 --- a/doc/salome/gui/SMESH/files/adding_nodes_and_elements.htm +++ b/doc/salome/gui/SMESH/files/adding_nodes_and_elements.htm @@ -1,303 +1,303 @@ - - - - - -Adding nodes and elements - - - - - - - - - - - - -

Adding nodes and elements

- -

In MESH you can add to your mesh different elements such as:

- -

 

- - - -

 

- -

To add a node or an element to your mesh:

- -

 

- -

1. Select your mesh in the Object Browser - or in the 3D viewer.

- -

 

- -

2. From the Modification - menu choose the Add item, - the following associated submenu will appear:

- -

 

- -

- -

 

- -

From this submenu select the type of element - which you would like to add to your mesh.

- -

 

- -

  See - Also sample TUI Scripts of  Adding - Nodes and Elements operations. -  

- -

 

- -

Adding nodes

- -

    

- -

 

- -

 

- -

 

- -

In this dialog box set coordinates for your - node in the Coordinates set of - fields and click the Apply or - OK button. Your node will be created:

- -

 

- -

Adding edges

- -

 

- -

      

- -

 

- -

In this dialog box specify the nodes which - will form your edge by selecting them in the 3D viewer with pressed Shift - button and click the Apply or - OK button. Your edge will be created:

- -

 

- -

Adding triangles

- -

 

- -

        

- -

 

- -

In this dialog box specify the nodes which - will form your triangle by selecting them in the 3D viewer with pressed - Shift button and click the Apply or - OK button. Your triangle will - be created:

- -

 

- -

Adding quadrangles

- -

        

- -

In this dialog box specify the nodes which - will form your quadrangle by selecting them in the 3D viewer with pressed - Shift button and click the Apply or - OK button. Your quadrangle will - be created:

- -

 

- -

Adding polygons -

- -

          

- -

In this dialog box specify the nodes which - will form your polygon by selecting them in the 3D viewer with pressed - Shift button and click the Apply or - OK button.

- -

 

- -

Adding tetrahedrons

- -

- -

 

- -

In this dialog box specify the nodes which - will form your tetrahedron by selecting them in the 3D viewer with pressed - Shift button and click the Apply or - OK button. Your tetrahedron will - be created:

- -

 

- -

- -

Adding hexahedrons

- -

- -

 

- -

In this dialog box specify the nodes which - will form your hexahedron by selecting them in the 3D viewer with pressed - Shift button and click the Apply or - OK button. Your hexahedron will - be created:

- -

 

- -

 

- -

- -

 

- -

Adding polyhedrons

- -

        

- -

 

- -

There are two different ways to add polyhedral - volumes.

- -

If you select Node - as Elements Type you will specify - the nodes which will form the faces of your polyhedron by selecting the - nodes in the 3D viewer with pressed Shift button and clicking the Add button to add the face in the list - of Faces by Nodes, which will form your polyhedron. Note, that it could - be very useful to toggle Polyhedron Preview checkbox to see the results - of your selection.

- -

The second way is somewhat simpler, however, - there are cases when it does not provide you with the necessary level - of precision. If you select Face - as Elements Type, you will be - able to select the faces  which - will form your polyhedron in the 3D viewer with pressed Shift button. - If you've managed to

- -

obtain the necessary result, click the Apply or OK - button. Your hexahedron will be - created.

- -

 

- -

 

- -

 

- - - - + + + + + +Adding nodes and elements + + + + + + + + + + + + +

Adding nodes and elements

+ +

In MESH you can add to your mesh different elements such as:

+ +

 

+ + + +

 

+ +

To add a node or an element to your mesh:

+ +

 

+ +

1. Select your mesh in the Object Browser + or in the 3D viewer.

+ +

 

+ +

2. From the Modification + menu choose the Add item, + the following associated submenu will appear:

+ +

 

+ +

+ +

 

+ +

From this submenu select the type of element + which you would like to add to your mesh.

+ +

 

+ +

  See + Also sample TUI Scripts of  Adding + Nodes and Elements operations. +  

+ +

 

+ +

Adding nodes

+ +

    

+ +

 

+ +

 

+ +

 

+ +

In this dialog box set coordinates for your + node in the Coordinates set of + fields and click the Apply or + OK button. Your node will be created:

+ +

 

+ +

Adding edges

+ +

 

+ +

      

+ +

 

+ +

In this dialog box specify the nodes which + will form your edge by selecting them in the 3D viewer with pressed Shift + button and click the Apply or + OK button. Your edge will be created:

+ +

 

+ +

Adding triangles

+ +

 

+ +

        

+ +

 

+ +

In this dialog box specify the nodes which + will form your triangle by selecting them in the 3D viewer with pressed + Shift button and click the Apply or + OK button. Your triangle will + be created:

+ +

 

+ +

Adding quadrangles

+ +

        

+ +

In this dialog box specify the nodes which + will form your quadrangle by selecting them in the 3D viewer with pressed + Shift button and click the Apply or + OK button. Your quadrangle will + be created:

+ +

 

+ +

Adding polygons +

+ +

          

+ +

In this dialog box specify the nodes which + will form your polygon by selecting them in the 3D viewer with pressed + Shift button and click the Apply or + OK button.

+ +

 

+ +

Adding tetrahedrons

+ +

+ +

 

+ +

In this dialog box specify the nodes which + will form your tetrahedron by selecting them in the 3D viewer with pressed + Shift button and click the Apply or + OK button. Your tetrahedron will + be created:

+ +

 

+ +

+ +

Adding hexahedrons

+ +

+ +

 

+ +

In this dialog box specify the nodes which + will form your hexahedron by selecting them in the 3D viewer with pressed + Shift button and click the Apply or + OK button. Your hexahedron will + be created:

+ +

 

+ +

 

+ +

+ +

 

+ +

Adding polyhedrons

+ +

        

+ +

 

+ +

There are two different ways to add polyhedral + volumes.

+ +

If you select Node + as Elements Type you will specify + the nodes which will form the faces of your polyhedron by selecting the + nodes in the 3D viewer with pressed Shift button and clicking the Add button to add the face in the list + of Faces by Nodes, which will form your polyhedron. Note, that it could + be very useful to toggle Polyhedron Preview checkbox to see the results + of your selection.

+ +

The second way is somewhat simpler, however, + there are cases when it does not provide you with the necessary level + of precision. If you select Face + as Elements Type, you will be + able to select the faces  which + will form your polyhedron in the 3D viewer with pressed Shift button. + If you've managed to

+ +

obtain the necessary result, click the Apply or OK + button. Your hexahedron will be + created.

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/area_of_elements.htm b/doc/salome/gui/SMESH/files/area_of_elements.htm index 78cbd6cdd..5947a248c 100755 --- a/doc/salome/gui/SMESH/files/area_of_elements.htm +++ b/doc/salome/gui/SMESH/files/area_of_elements.htm @@ -1,138 +1,138 @@ - - - - - -Area of elements - - - - - - - - - - - - - -

Area

- -

Area mesh quality - control is based on the algorithm of area calculation of  meshing - elements. It can be applied to meshes consisting of 2D meshing elements - with 3 and 4 nodes (triangles and quadrangles).    

- -

 

- -

To apply the Area quality control to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Area or click button. Your mesh will be displayed - in the viewer with its elements colored according to the applied mesh - quality control criterion:

- -

 

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of an Area - quality control operation.  

- -

 

- -

 

- - - - + + + + + +Area of elements + + + + + + + + + + + + + +

Area

+ +

Area mesh quality + control is based on the algorithm of area calculation of  meshing + elements. It can be applied to meshes consisting of 2D meshing elements + with 3 and 4 nodes (triangles and quadrangles).    

+ +

 

+ +

To apply the Area quality control to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Area or click button. Your mesh will be displayed + in the viewer with its elements colored according to the applied mesh + quality control criterion:

+ +

 

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of an Area + quality control operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/arithmetic_1d.htm b/doc/salome/gui/SMESH/files/arithmetic_1d.htm index d421cd913..e6cac0059 100755 --- a/doc/salome/gui/SMESH/files/arithmetic_1d.htm +++ b/doc/salome/gui/SMESH/files/arithmetic_1d.htm @@ -1,330 +1,330 @@ - - - - - -Arithmetic 1D - - - - - - - - - - - - - -

1D Meshing Hypotheses

- - - -

Arithmetic 1D hypothesis

- -

Arithmetic 1D hypothesis allows - to split edges into segments with a length that changes in arithmetic - progression (Lk = Lk-1 + d) beginning from a given starting length and - up to a given end length.

- -

 

- -

     

- -

 

- -

See Also - a sample TUI Script of a Defining - Arithmetic 1D hypothesis operation.  

- -

Deflection 1D hypothesis

- -

Deflection ID hypothesis can - be applied for meshing curvilinear edges composing your geometrical object. - It uses only one parameter: the value of deflection.  

- -

A geometrical edge is divided into equal segments. The maximum distance - between a point on the edge within a segment and the line connecting the - ends of the segment should not exceed the specified value of deflection - . Then mesh nodes are constructed at end segment locations and 1D mesh - elements are constructed on segments.

- -

 

- -

      

- -

 

- -

See Also - a sample TUI Script of a Defining - Deflection 1D hypothesis operation.  

- -

 

- -

- -

Average Length hypothesis

- -

Average Length hypothesis can - be applied for meshing of edges composing your geometrical object. Definition - of this hypothesis consists of setting the length - of segments, which will split these edges. The points on the edges generated - by these segments will represent nodes of your mesh. Later these nodes - will be used for meshing of the faces abutting to these edges.

- -

 

- -

       

- -

 

- -

See Also - a sample TUI Script of a Defining - Average Length hypothesis operation.  

- -

 

- -

- -

Number of segments hypothesis

- -

Number of segments hypothesis - can be applied for meshing of edges composing your geometrical object. - Definition of this hypothesis consists of setting the number - of segments, which will split these edges. In other words your edges will - be split into a definite number of segments with approximately the same - length. The points on the edges generated by these segments will represent - nodes of your mesh. Later these nodes will be used for meshing of the - faces abutting to these edges.

- -

 

- -

You can set the type of distribution for this - hypothesis in the Hypothesis Construction - dialog bog :

- -

 

- -

Equidistant - Distribution - all segments will have the same length, you define - only the Number of Segments.

- -

 

- -

         

- -

 

- -

Scale Distribution - each - next segment differs from the previous according to the formula: - Ai+1 = Ai - * k, where k is - a Scale Factor.

- -

\

- -

 

- -

Distribution with Table Density - you - input a number of pairs t - F(t), - where t ranges from 0 to 1, -  and - the module computes the formula, which will rule the change of length - of segments and shows the curve in the plot. You can select the Conversion - mode from Exponent - and Cut negative.

- -

 

- -

- -

 

- -

Distribution with Analytic Density - you input the formula, which will rule the - change of length of segments and the module shows the curve in the plot.

- -

- -

See Also - a sample TUI Script of a Defining - Number of Segments hypothesis operation.  

- -

 

- -

Start and End Length hypothesis.

- -

Start and End Length hypothesis - allows to divide a geometrical edge into segments so that the first and - the last segments have a specified length. The length of each but the - first segment differs from length of the previous one by a constant factor. - Then mesh nodes are constructed at segment ends location and 1D mesh elements - are constructed on them.

- -

 

- -

      

- -

 

- -

See Also - a sample TUI Script of a Defining - Start and End Length  hypothesis - operation.  

- -

 

- -

Automatic Length

- -

This hypothesis is automatically applied when you select Assign - a set of hypotheses option in Create Mesh menu.

- -

 

- -

- -

 

- -

The dialog box prompts you to define the quality of the future mesh - by only one parameter, which is Fineness, - ranging from 0 (coarse mesh, low number of elements) to 1 (extremely fine - mesh, great number of elements). Compare one and the same object (sphere) - meshed with minimum and maximum value of this parameter.

- -

 

- -

   

- -

 

- -

 

- -

 

- -

 

- - - - + + + + + +Arithmetic 1D + + + + + + + + + + + + + +

1D Meshing Hypotheses

+ + + +

Arithmetic 1D hypothesis

+ +

Arithmetic 1D hypothesis allows + to split edges into segments with a length that changes in arithmetic + progression (Lk = Lk-1 + d) beginning from a given starting length and + up to a given end length.

+ +

 

+ +

     

+ +

 

+ +

See Also + a sample TUI Script of a Defining + Arithmetic 1D hypothesis operation.  

+ +

Deflection 1D hypothesis

+ +

Deflection ID hypothesis can + be applied for meshing curvilinear edges composing your geometrical object. + It uses only one parameter: the value of deflection.  

+ +

A geometrical edge is divided into equal segments. The maximum distance + between a point on the edge within a segment and the line connecting the + ends of the segment should not exceed the specified value of deflection + . Then mesh nodes are constructed at end segment locations and 1D mesh + elements are constructed on segments.

+ +

 

+ +

      

+ +

 

+ +

See Also + a sample TUI Script of a Defining + Deflection 1D hypothesis operation.  

+ +

 

+ +

+ +

Average Length hypothesis

+ +

Average Length hypothesis can + be applied for meshing of edges composing your geometrical object. Definition + of this hypothesis consists of setting the length + of segments, which will split these edges. The points on the edges generated + by these segments will represent nodes of your mesh. Later these nodes + will be used for meshing of the faces abutting to these edges.

+ +

 

+ +

       

+ +

 

+ +

See Also + a sample TUI Script of a Defining + Average Length hypothesis operation.  

+ +

 

+ +

+ +

Number of segments hypothesis

+ +

Number of segments hypothesis + can be applied for meshing of edges composing your geometrical object. + Definition of this hypothesis consists of setting the number + of segments, which will split these edges. In other words your edges will + be split into a definite number of segments with approximately the same + length. The points on the edges generated by these segments will represent + nodes of your mesh. Later these nodes will be used for meshing of the + faces abutting to these edges.

+ +

 

+ +

You can set the type of distribution for this + hypothesis in the Hypothesis Construction + dialog bog :

+ +

 

+ +

Equidistant + Distribution - all segments will have the same length, you define + only the Number of Segments.

+ +

 

+ +

         

+ +

 

+ +

Scale Distribution - each + next segment differs from the previous according to the formula: + Ai+1 = Ai + * k, where k is + a Scale Factor.

+ +

\

+ +

 

+ +

Distribution with Table Density - you + input a number of pairs t - F(t), + where t ranges from 0 to 1, +  and + the module computes the formula, which will rule the change of length + of segments and shows the curve in the plot. You can select the Conversion + mode from Exponent + and Cut negative.

+ +

 

+ +

+ +

 

+ +

Distribution with Analytic Density - you input the formula, which will rule the + change of length of segments and the module shows the curve in the plot.

+ +

+ +

See Also + a sample TUI Script of a Defining + Number of Segments hypothesis operation.  

+ +

 

+ +

Start and End Length hypothesis.

+ +

Start and End Length hypothesis + allows to divide a geometrical edge into segments so that the first and + the last segments have a specified length. The length of each but the + first segment differs from length of the previous one by a constant factor. + Then mesh nodes are constructed at segment ends location and 1D mesh elements + are constructed on them.

+ +

 

+ +

      

+ +

 

+ +

See Also + a sample TUI Script of a Defining + Start and End Length  hypothesis + operation.  

+ +

 

+ +

Automatic Length

+ +

This hypothesis is automatically applied when you select Assign + a set of hypotheses option in Create Mesh menu.

+ +

 

+ +

+ +

 

+ +

The dialog box prompts you to define the quality of the future mesh + by only one parameter, which is Fineness, + ranging from 0 (coarse mesh, low number of elements) to 1 (extremely fine + mesh, great number of elements). Compare one and the same object (sphere) + meshed with minimum and maximum value of this parameter.

+ +

 

+ +

   

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/aspect_ratio.htm b/doc/salome/gui/SMESH/files/aspect_ratio.htm index 52b40c9a1..d10a24b01 100755 --- a/doc/salome/gui/SMESH/files/aspect_ratio.htm +++ b/doc/salome/gui/SMESH/files/aspect_ratio.htm @@ -1,212 +1,212 @@ - - - - - -Aspect Ratio - - - - - - - - - - - - - -

Aspect Ratio

- -

The Aspect Ratio - quality criterion for mesh elements reveals the degree of conformity of - a mesh element to the regular element of its type (with all edges having - the same length).  The - criterion can be defined as

- -

where К - is the considered element of the mesh, hmax is the diameter of the element - К (i.e. the length of the longest edge), рк is the radius of the sphere - inscribed in the element K, and a - is a normalisation value chosen so that QK = 1 when К is an equilateral - simplex.

- -

 

- -

The value of QK varies between 1 and +oo and the - closer it is to 1, the better the element К is.

- -
    - -
  • The Aspect Ratio - of a triangle 2D element consisting - of 3 nodes is calculated by the formula:

  • -
- -

 

- -

- -

,

- -

 

- -

where рк is the half perimeter of the - element K and SK is its surface.

- -

 

- -

- -

 

- -
    - -
  • The Aspect - Ratio of a quadrangle 2D - element consisting of 4 nodes is the worst (i.e. the greatest) value from - all triangles which can be built taking three nodes of the quadrangle. - There are four triangles to consider:

  • -
- -

- -

Note, that the Aspect Ratio criterion is - applicable to 2D mesh elements only. For 3D elements we use the Aspect - Ratio 3D criterion.   

- -

 

- -

To apply the Aspect Ratio quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Aspect Ratio or click button in the toolbar. - Your mesh will be displayed in the viewer with its elements colored according - to the applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of an Aspect - Ratio quality control operation.  

- -

 

- - - - + + + + + +Aspect Ratio + + + + + + + + + + + + + +

Aspect Ratio

+ +

The Aspect Ratio + quality criterion for mesh elements reveals the degree of conformity of + a mesh element to the regular element of its type (with all edges having + the same length).  The + criterion can be defined as

+ +

where К + is the considered element of the mesh, hmax is the diameter of the element + К (i.e. the length of the longest edge), рк is the radius of the sphere + inscribed in the element K, and a + is a normalisation value chosen so that QK = 1 when К is an equilateral + simplex.

+ +

 

+ +

The value of QK varies between 1 and +oo and the + closer it is to 1, the better the element К is.

+ +
    + +
  • The Aspect Ratio + of a triangle 2D element consisting + of 3 nodes is calculated by the formula:

  • +
+ +

 

+ +

+ +

,

+ +

 

+ +

where рк is the half perimeter of the + element K and SK is its surface.

+ +

 

+ +

+ +

 

+ +
    + +
  • The Aspect + Ratio of a quadrangle 2D + element consisting of 4 nodes is the worst (i.e. the greatest) value from + all triangles which can be built taking three nodes of the quadrangle. + There are four triangles to consider:

  • +
+ +

+ +

Note, that the Aspect Ratio criterion is + applicable to 2D mesh elements only. For 3D elements we use the Aspect + Ratio 3D criterion.   

+ +

 

+ +

To apply the Aspect Ratio quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Aspect Ratio or click button in the toolbar. + Your mesh will be displayed in the viewer with its elements colored according + to the applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of an Aspect + Ratio quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/changing_orientation_of_elements.htm b/doc/salome/gui/SMESH/files/changing_orientation_of_elements.htm index 7a1c6e64d..c282fe13b 100755 --- a/doc/salome/gui/SMESH/files/changing_orientation_of_elements.htm +++ b/doc/salome/gui/SMESH/files/changing_orientation_of_elements.htm @@ -1,159 +1,159 @@ - - - - - -Changing orientation of elements - - - - - - - - - - - - -

Changing orientation of elements

- -

Orientation of an element is changed by reverting the order of nodes - of the selected elements.

- -

 

- -

To change orientation of elements:

- -

 

- -

1. Display a mesh or a submesh in the 3D - viewer.

- -

 

- -

2. In the Modification - menu select the Orientation item - or click button in the toolbar. The following dialog box - will appear:

- -

 

- -

 

- -

- -

 

- -

 

- -
    - -
  • The main list shall contain the - elements which will be reoriented. You can click on an element - in the 3D viewer and it will be highlighted. After that click the Add button and the ID of this element - will be added to the list. To remove a selected element or elements from - the list click the Remove button. - The Sort button allows to sort - the list of elements IDs. The Set filter - button allows to apply a definite filter to selection of elements - of your group.

  • - -
  • Apply to all radio button allows - to modify the orientation of all elements of the currently displayed mesh - or submesh.

  • - -
  • Select from set of fields allows to - choose a submesh or an existing group whose elements will be automatically - added to the list.

  • -
- -

 

- -

3. Click the Apply - or OK button to confirm - the operation.

- -

 

- -

  See - Also a sample TUI Script of a Change - Orientation operation.  

- -

 

- - - - + + + + + +Changing orientation of elements + + + + + + + + + + + + +

Changing orientation of elements

+ +

Orientation of an element is changed by reverting the order of nodes + of the selected elements.

+ +

 

+ +

To change orientation of elements:

+ +

 

+ +

1. Display a mesh or a submesh in the 3D + viewer.

+ +

 

+ +

2. In the Modification + menu select the Orientation item + or click button in the toolbar. The following dialog box + will appear:

+ +

 

+ +

 

+ +

+ +

 

+ +

 

+ +
    + +
  • The main list shall contain the + elements which will be reoriented. You can click on an element + in the 3D viewer and it will be highlighted. After that click the Add button and the ID of this element + will be added to the list. To remove a selected element or elements from + the list click the Remove button. + The Sort button allows to sort + the list of elements IDs. The Set filter + button allows to apply a definite filter to selection of elements + of your group.

  • + +
  • Apply to all radio button allows + to modify the orientation of all elements of the currently displayed mesh + or submesh.

  • + +
  • Select from set of fields allows to + choose a submesh or an existing group whose elements will be automatically + added to the list.

  • +
+ +

 

+ +

3. Click the Apply + or OK button to confirm + the operation.

+ +

 

+ +

  See + Also a sample TUI Script of a Change + Orientation operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/constructing_groups_of_specific_elements.htm b/doc/salome/gui/SMESH/files/constructing_groups_of_specific_elements.htm index 749449fdf..0b8e2f5e6 100755 --- a/doc/salome/gui/SMESH/files/constructing_groups_of_specific_elements.htm +++ b/doc/salome/gui/SMESH/files/constructing_groups_of_specific_elements.htm @@ -1,103 +1,103 @@ - - - - - -Constructing groups of specific elements - - - - - - - - - - - - -

Constructing groups of specific elements

- -

In MESH you can easily construct groups of specific elements (nodes, - edges, faces or volumes) which will be taken from a definite submesh.

- -

 

- -

To construct a group of specific elements:

- -

 

- -

Right-click on a submesh in the Object Browser - and choose the Construct Group item - or select your submesh in the Object Browser and in the Mesh - menu choose the Construct Group - item. MESH will construct several groups consisting of elements - of the definite type: nodes, edges, faces or volumes.

- - - - + + + + + +Constructing groups of specific elements + + + + + + + + + + + + +

Constructing groups of specific elements

+ +

In MESH you can easily construct groups of specific elements (nodes, + edges, faces or volumes) which will be taken from a definite submesh.

+ +

 

+ +

To construct a group of specific elements:

+ +

 

+ +

Right-click on a submesh in the Object Browser + and choose the Construct Group item + or select your submesh in the Object Browser and in the Mesh + menu choose the Construct Group + item. MESH will construct several groups consisting of elements + of the definite type: nodes, edges, faces or volumes.

+ + + + diff --git a/doc/salome/gui/SMESH/files/constructing_meshes.htm b/doc/salome/gui/SMESH/files/constructing_meshes.htm index 9005df312..1098a35d5 100755 --- a/doc/salome/gui/SMESH/files/constructing_meshes.htm +++ b/doc/salome/gui/SMESH/files/constructing_meshes.htm @@ -1,209 +1,209 @@ - - - - - -Constructing meshes - - - - - - - - - - - - - -

Constructing meshes

- -

Construction of a mesh consists of:

- -

 

- -
    - -
  • Selecting a geometrical - object for meshing

  • - -
  • Applying meshing - algorithms and hypotheses which - will be used at computation of this mesh.

  • -
- -

 

- -

To construct a mesh:

- -

1. In the Mesh - menu select Create Mesh or - click button in the toolbar. The following dialog box will - appear:

- -

 

- -

- -

 

- -

2. For example, you need to mesh a 3d object. -

- -

First, type the name for your mesh in the - "Name" box, by default, it is "Mesh_1". Then select - the object you wish to mesh in the Object Browser and click - the "Add" button.

- -

Now you can define 1d Algorithm and 1d Hypotheses, - which will be applied to the edges of your object. (Note that any object - has edges, even if their existence is not apparent, for example, a sphere - has 4 edges). Click the   button to add a hypothesis. Click the button - to define values for the current hypothesis. The use of additional hypotheses - is optional (i.e. you may leave "None" in this box).   

- -

 

- -

Proceed in the same way with 2d and 3d Algorithms - and Hypotheses, note that the choice of hypotheses depends on the algorithm. - There must be one Algorithm and one or several Hypotheses for each dimension - of your object, otherwise you will not get any mesh at all. Of course, - if you wish to mesh a face, which is a 2d object, you don't need to define - 3d Algorithm and Hypotheses.

- -

In the Object - Browser the structure of the new mesh will be displayed as follows:

- -

It contains:

- -
    - -
  • a reference to the - geometrical object on the basis of which the mesh has been constructed;

  • - -
  • Applied - hypotheses folder containing the references to the hypotheses applied - to the construction of the mesh;

  • - -
  • Applied - algorithms folder containing the references to the algorithms applied - to the construction of the mesh.

  • -
- -

 

- -

There is an alternative way to create a mesh - on an object simply by clicking Assign - a set of hypotheses button and selecting between Automatic Tetrahedralization - or Hexahedralization.  The - program will automatically generate a 3D mesh with the most appropriate - settings. In the same way you can apply this functionality for meshing - 2D objects, in which case 3D algorithms are not applied.

- -

 

- -

3. Now, when everything is ready, select - your mesh in the Object Browser. -  From the - Mesh menu select - Compute or click button of the toolbar.

- -

 

- -

Consider trying a sample script for construction - of a mesh from our TUI Scripts - section.

- -

 

- -

 

- - - - + + + + + +Constructing meshes + + + + + + + + + + + + + +

Constructing meshes

+ +

Construction of a mesh consists of:

+ +

 

+ +
    + +
  • Selecting a geometrical + object for meshing

  • + +
  • Applying meshing + algorithms and hypotheses which + will be used at computation of this mesh.

  • +
+ +

 

+ +

To construct a mesh:

+ +

1. In the Mesh + menu select Create Mesh or + click button in the toolbar. The following dialog box will + appear:

+ +

 

+ +

+ +

 

+ +

2. For example, you need to mesh a 3d object. +

+ +

First, type the name for your mesh in the + "Name" box, by default, it is "Mesh_1". Then select + the object you wish to mesh in the Object Browser and click + the "Add" button.

+ +

Now you can define 1d Algorithm and 1d Hypotheses, + which will be applied to the edges of your object. (Note that any object + has edges, even if their existence is not apparent, for example, a sphere + has 4 edges). Click the   button to add a hypothesis. Click the button + to define values for the current hypothesis. The use of additional hypotheses + is optional (i.e. you may leave "None" in this box).   

+ +

 

+ +

Proceed in the same way with 2d and 3d Algorithms + and Hypotheses, note that the choice of hypotheses depends on the algorithm. + There must be one Algorithm and one or several Hypotheses for each dimension + of your object, otherwise you will not get any mesh at all. Of course, + if you wish to mesh a face, which is a 2d object, you don't need to define + 3d Algorithm and Hypotheses.

+ +

In the Object + Browser the structure of the new mesh will be displayed as follows:

+ +

It contains:

+ +
    + +
  • a reference to the + geometrical object on the basis of which the mesh has been constructed;

  • + +
  • Applied + hypotheses folder containing the references to the hypotheses applied + to the construction of the mesh;

  • + +
  • Applied + algorithms folder containing the references to the algorithms applied + to the construction of the mesh.

  • +
+ +

 

+ +

There is an alternative way to create a mesh + on an object simply by clicking Assign + a set of hypotheses button and selecting between Automatic Tetrahedralization + or Hexahedralization.  The + program will automatically generate a 3D mesh with the most appropriate + settings. In the same way you can apply this functionality for meshing + 2D objects, in which case 3D algorithms are not applied.

+ +

 

+ +

3. Now, when everything is ready, select + your mesh in the Object Browser. +  From the + Mesh menu select + Compute or click button of the toolbar.

+ +

 

+ +

Consider trying a sample script for construction + of a mesh from our TUI Scripts + section.

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/constructing_submeshes.htm b/doc/salome/gui/SMESH/files/constructing_submeshes.htm index 07dd8dfec..9e0adf408 100755 --- a/doc/salome/gui/SMESH/files/constructing_submeshes.htm +++ b/doc/salome/gui/SMESH/files/constructing_submeshes.htm @@ -1,185 +1,185 @@ - - - - - -Constructing submeshes - - - - - - - - - - - - - -

Constructing submeshes

- -

Construction of a submesh consists of:

- -

 

- -
    - -
  • Selecting a mesh which - will encapsulate your submesh

  • - -
  • Selecting a geometrical - object for meshing

  • - -
  • Applying one or several - previously hypotheses and meshing - algorithms which will be used at computation of this submesh.

  • -
- -

 

- -

To construct a submesh:

- -

 

- -

From the Mesh - menu select Local Hyp. or - click button in the toolbar. The following dialog box will - appear:

- -

 

- -

- -

 

- -

It allows to define the Name, - the parent Mesh and the Geometry (e.g. a face if the parent - mesh has been built on box) of the submesh. You can define algorithms - and hypotheses in the same way as in Create - mesh menu.  

- -

 

- -

In the Object Browser the structure of the - new submesh will be displayed as follows:

- -

 

- -

- -

 

- -

It contains:

- -

 

- -
    - -
  • a reference to the - geometrical object on the basis of which the submesh has been constructed;

  • - -
  • Applied - hypotheses folder containing the references to the hypotheses applied - to the construction of the submesh;

  • - -
  • Applied - algorithms folder containing the references to the algorithms applied - to the construction of the submesh.

  • -
- -

 

- -

 

- -

See Also - a sample TUI Script of a Construct - Submesh operation.  

- -

 

- - - - + + + + + +Constructing submeshes + + + + + + + + + + + + + +

Constructing submeshes

+ +

Construction of a submesh consists of:

+ +

 

+ +
    + +
  • Selecting a mesh which + will encapsulate your submesh

  • + +
  • Selecting a geometrical + object for meshing

  • + +
  • Applying one or several + previously hypotheses and meshing + algorithms which will be used at computation of this submesh.

  • +
+ +

 

+ +

To construct a submesh:

+ +

 

+ +

From the Mesh + menu select Local Hyp. or + click button in the toolbar. The following dialog box will + appear:

+ +

 

+ +

+ +

 

+ +

It allows to define the Name, + the parent Mesh and the Geometry (e.g. a face if the parent + mesh has been built on box) of the submesh. You can define algorithms + and hypotheses in the same way as in Create + mesh menu.  

+ +

 

+ +

In the Object Browser the structure of the + new submesh will be displayed as follows:

+ +

 

+ +

+ +

 

+ +

It contains:

+ +

 

+ +
    + +
  • a reference to the + geometrical object on the basis of which the submesh has been constructed;

  • + +
  • Applied + hypotheses folder containing the references to the hypotheses applied + to the construction of the submesh;

  • + +
  • Applied + algorithms folder containing the references to the algorithms applied + to the construction of the submesh.

  • +
+ +

 

+ +

 

+ +

See Also + a sample TUI Script of a Construct + Submesh operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/creating_groups.htm b/doc/salome/gui/SMESH/files/creating_groups.htm index dbc19538e..1200e5969 100755 --- a/doc/salome/gui/SMESH/files/creating_groups.htm +++ b/doc/salome/gui/SMESH/files/creating_groups.htm @@ -1,281 +1,281 @@ - - - - - -Creating groups - - - - - - - - - - - - - -

Creating groups

- -

  In MESH you - can create groups of elements of different types. To create a group of - elements - in the Mesh - menu select Create Group. -

- -

To create any group - you should define the following:   

- -
    - -
  • Mesh: - the name of the mesh whose elements - will form your group. You can select your mesh in the Objet Browser or - in the 3D viewer.

  • - -
  • Elements Type - set of radio buttons allows to select the type of elements which will - form your group:

  • - -
      - -
    • Nodes

    • - -
    • Edges -

    • - -
    • Faces

    • - -
    • Volumes

    • -
    - -
  • Name field allows to enter the name - of your new group.

  • -
- -

SALOME Platform distinguishes - between the two Group types: Standalone - Group and Group on Geometry. -  

- -

Standalone Group

- -

Standalone - Group consists of mesh elements, which you can define in two possible - ways.

- -
    - -
  • Choosing them manually - with the mouse in the 3D Viewer. You can click on an element in the 3D - viewer and it will be highlighted. After that click the Add - button and the ID of this element will be added to the list.

  • - -
  • Applying Filters. The - Set filter button allows to apply - a definite filter to selection of the elements of your group. See more - about filters on the Selection - filter library page.   

  • -
- -

To remove a selected element or elements - from the list click the Remove button. - The Sort List button allows to - sort the list of IDs of mesh elements.

- -

Select from - set of fields allows to choose a submesh or an existing group whose - elements of the previously defined type will be added to the list of elements - which will form your group.

- -

Color Number - (integer only, ranging from 0 to 9999) - allows to assign to the group - a certain index, for example, defining boundary conditions. This feature - introduces a useful element of preprocessing in Mesh module. Note that - Color number attribute has nothing - to do with the colors used for the display of the elements of the group.

- -

 

- - --- - - - -
-

-

  

-

 

-

 

-

 

-

 

-

 

-

In this picture the brown cells belong to - a group defined manually.

-

 

-

  In this picture the brown cells belong to the group defined - by the criterion
-Taper > 0.

-

 

-

 

- -

 

- -

   See - Also a sample TUI Script of a Create - a Standalone Group operation.  

- -

Group on Geometry

- -

To create a group on - geometry check Group on geometry - in the Group type field. Group on geometry contains the elements - of a certain type belonging to the selected - geometrical object. To define a group select in the Objet Browser - or in the 3D viewer a geometrical object from which the elements will - be taken. After confirmation of the operation a new group of mesh elements - will be created.

- -

 

- - --- - - - -
-

-

In this picture the cells which belong to a certain face - are selected in green.

- -

 

- -

   See - Also a sample TUI Script of a Create - a Group on Geometry operation. -  

- -

 

- -

 

- -

 

- -

 

- -

 

- - - - + + + + + +Creating groups + + + + + + + + + + + + + +

Creating groups

+ +

  In MESH you + can create groups of elements of different types. To create a group of + elements + in the Mesh + menu select Create Group. +

+ +

To create any group + you should define the following:   

+ +
    + +
  • Mesh: + the name of the mesh whose elements + will form your group. You can select your mesh in the Objet Browser or + in the 3D viewer.

  • + +
  • Elements Type + set of radio buttons allows to select the type of elements which will + form your group:

  • + +
      + +
    • Nodes

    • + +
    • Edges +

    • + +
    • Faces

    • + +
    • Volumes

    • +
    + +
  • Name field allows to enter the name + of your new group.

  • +
+ +

SALOME Platform distinguishes + between the two Group types: Standalone + Group and Group on Geometry. +  

+ +

Standalone Group

+ +

Standalone + Group consists of mesh elements, which you can define in two possible + ways.

+ +
    + +
  • Choosing them manually + with the mouse in the 3D Viewer. You can click on an element in the 3D + viewer and it will be highlighted. After that click the Add + button and the ID of this element will be added to the list.

  • + +
  • Applying Filters. The + Set filter button allows to apply + a definite filter to selection of the elements of your group. See more + about filters on the Selection + filter library page.   

  • +
+ +

To remove a selected element or elements + from the list click the Remove button. + The Sort List button allows to + sort the list of IDs of mesh elements.

+ +

Select from + set of fields allows to choose a submesh or an existing group whose + elements of the previously defined type will be added to the list of elements + which will form your group.

+ +

Color Number + (integer only, ranging from 0 to 9999) - allows to assign to the group + a certain index, for example, defining boundary conditions. This feature + introduces a useful element of preprocessing in Mesh module. Note that + Color number attribute has nothing + to do with the colors used for the display of the elements of the group.

+ +

 

+ + +++ + + + +
+

+

  

+

 

+

 

+

 

+

 

+

 

+

In this picture the brown cells belong to + a group defined manually.

+

 

+

  In this picture the brown cells belong to the group defined + by the criterion
+Taper > 0.

+

 

+

 

+ +

 

+ +

   See + Also a sample TUI Script of a Create + a Standalone Group operation.  

+ +

Group on Geometry

+ +

To create a group on + geometry check Group on geometry + in the Group type field. Group on geometry contains the elements + of a certain type belonging to the selected + geometrical object. To define a group select in the Objet Browser + or in the 3D viewer a geometrical object from which the elements will + be taken. After confirmation of the operation a new group of mesh elements + will be created.

+ +

 

+ + +++ + + + +
+

+

In this picture the cells which belong to a certain face + are selected in green.

+ +

 

+ +

   See + Also a sample TUI Script of a Create + a Group on Geometry operation. +  

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/cutting_quadrangles.htm b/doc/salome/gui/SMESH/files/cutting_quadrangles.htm index f8c7a43bf..3ffa9a6ae 100755 --- a/doc/salome/gui/SMESH/files/cutting_quadrangles.htm +++ b/doc/salome/gui/SMESH/files/cutting_quadrangles.htm @@ -1,208 +1,208 @@ - - - - - -Cutting quadrangles - - - - - - - - - - - - - -

Cutting quadrangles

- -

This operation allows to cut one or several quadrangle - elements by addition of a supplementary edge which will connect two opposite - corners.

- -

 

- -

To cut quadrangles:

- -

 

- -

1. Display a mesh or a submesh in the 3D - viewer.

- -

2. In the Modification - menu select the Cutting of quadrangles - item or click button in the toolbar. The following - dialog box will appear:

- -

 

- -

- -

 

- -
    - -
  • The - main list contains the list of - quadrangles. You can click on an quadrangle in the 3D viewer and it will - be highlighted (lock Shift keyboard button to select several quadrangles). - Click Add button and the ID of this quadrangle will be - added to the list. To remove a selected element or elements from the list - click Remove - button. Sort - list button allows to sort the - list of IDs. Filter - button allows to apply a definite - filter to the selection of quadrangles.

  • - -
  • Apply to all radio button allows to - modify the orientation of all quadrangles of the currently displayed mesh - or submesh.

  • - -
  • Preview - - provides a preview of cutting in - the viewer.

  • - -
  • Criterion

  • - -
  • Use diagonal 1-3 and - Use diagonal 2-4  allows - to specify the opposite corners which will be connected by the cutting - edge.

  • - -
  • Use - numeric factor -  allows - to apply the operation only to those objects which meet the chosen criterion - (from the list of Quality Controls, i.e. Skew, Warping, Minimum Angle, - etc.)

  • - -
  • Select - from - allows to choose a submesh or an existing group whose quadrangle - elements will be automatically added to the list.

  • -
- -

 

- -

3. Click the Apply - or OK button to confirm - the operation.

- -

 

- - --- - - - -
-

-

- -

 

- -

  See - Also a sample TUI Script of a Cutting - Quadrangles operation.  

- -

 

- - - - + + + + + +Cutting quadrangles + + + + + + + + + + + + + +

Cutting quadrangles

+ +

This operation allows to cut one or several quadrangle + elements by addition of a supplementary edge which will connect two opposite + corners.

+ +

 

+ +

To cut quadrangles:

+ +

 

+ +

1. Display a mesh or a submesh in the 3D + viewer.

+ +

2. In the Modification + menu select the Cutting of quadrangles + item or click button in the toolbar. The following + dialog box will appear:

+ +

 

+ +

+ +

 

+ +
    + +
  • The + main list contains the list of + quadrangles. You can click on an quadrangle in the 3D viewer and it will + be highlighted (lock Shift keyboard button to select several quadrangles). + Click Add button and the ID of this quadrangle will be + added to the list. To remove a selected element or elements from the list + click Remove + button. Sort + list button allows to sort the + list of IDs. Filter + button allows to apply a definite + filter to the selection of quadrangles.

  • + +
  • Apply to all radio button allows to + modify the orientation of all quadrangles of the currently displayed mesh + or submesh.

  • + +
  • Preview + - provides a preview of cutting in + the viewer.

  • + +
  • Criterion

  • + +
  • Use diagonal 1-3 and + Use diagonal 2-4  allows + to specify the opposite corners which will be connected by the cutting + edge.

  • + +
  • Use + numeric factor -  allows + to apply the operation only to those objects which meet the chosen criterion + (from the list of Quality Controls, i.e. Skew, Warping, Minimum Angle, + etc.)

  • + +
  • Select + from - allows to choose a submesh or an existing group whose quadrangle + elements will be automatically added to the list.

  • +
+ +

 

+ +

3. Click the Apply + or OK button to confirm + the operation.

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

  See + Also a sample TUI Script of a Cutting + Quadrangles operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/diagonal_iversion_of_elements.htm b/doc/salome/gui/SMESH/files/diagonal_iversion_of_elements.htm index 0217776c5..3976832f6 100755 --- a/doc/salome/gui/SMESH/files/diagonal_iversion_of_elements.htm +++ b/doc/salome/gui/SMESH/files/diagonal_iversion_of_elements.htm @@ -1,149 +1,149 @@ - - - - - -Diagonal iversion of elements - - - - - - - - - - - - -

Diagonal inversion of elements

- -

 In MESH - you can inverse the diagonal (edge) of a pseudo-quadrangle formed by two - neighboring triangles with one common edge.

- -

 

- -

To inverse the diagonal:

- -

 

- -

1. From the Modification - menu choose the Diagonal inversion - item or click button in the toolbar. The following - dialog box shall appear:

- -

 

- -

- -

 

- -

2. Enter the ID of the required edge in the - Edge  field - or select this edge in the 3D viewer.

- -

 

- -

3. Click the Apply - or OK button.

- -

 

- -

 

- - --- - - - -
-

-

- -

 

- -

  See - Also a sample TUI Script of a Diagonal - Inversion of Elements operation.  

- -

 

- - - - + + + + + +Diagonal iversion of elements + + + + + + + + + + + + +

Diagonal inversion of elements

+ +

 In MESH + you can inverse the diagonal (edge) of a pseudo-quadrangle formed by two + neighboring triangles with one common edge.

+ +

 

+ +

To inverse the diagonal:

+ +

 

+ +

1. From the Modification + menu choose the Diagonal inversion + item or click button in the toolbar. The following + dialog box shall appear:

+ +

 

+ +

+ +

 

+ +

2. Enter the ID of the required edge in the + Edge  field + or select this edge in the 3D viewer.

+ +

 

+ +

3. Click the Apply + or OK button.

+ +

 

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

  See + Also a sample TUI Script of a Diagonal + Inversion of Elements operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/displacing_nodes.htm b/doc/salome/gui/SMESH/files/displacing_nodes.htm index 17b20adb3..14898fac2 100755 --- a/doc/salome/gui/SMESH/files/displacing_nodes.htm +++ b/doc/salome/gui/SMESH/files/displacing_nodes.htm @@ -1,170 +1,170 @@ - - - - - -Displacing nodes - - - - - - - - - - - - - -

Moving nodes

- -

In MESH you can change the location of any node of your mesh. In this - case all adjacent elements (edges) will be also transformed right after - the displaced node.

- -

 

- -

To displace a node:

- -

 

- -

1. From the Modification - menu choose the Move node item - or click button in the toolbar. The following dialog box - shall appear:

- -

 

- -

- -

 

- -

2. Enter the ID of the required node in the - Node ID  field - or select this node in the 3D viewer. The coordinates of your node will - be automatically displayed in the Coordinates - set of fields.

- -

 

- -

3. Set new coordinates for your node in the - Coordinates set of fields.

- -

 

- -

4. Click the Apply - or OK button.

- -

 

- - --- - - - -
-

-

- -

 

- -

  See - Also a sample TUI Script of a Moving - Nodes operation.  

- -

 

- -

 

- - - - + + + + + +Displacing nodes + + + + + + + + + + + + + +

Moving nodes

+ +

In MESH you can change the location of any node of your mesh. In this + case all adjacent elements (edges) will be also transformed right after + the displaced node.

+ +

 

+ +

To displace a node:

+ +

 

+ +

1. From the Modification + menu choose the Move node item + or click button in the toolbar. The following dialog box + shall appear:

+ +

 

+ +

+ +

 

+ +

2. Enter the ID of the required node in the + Node ID  field + or select this node in the 3D viewer. The coordinates of your node will + be automatically displayed in the Coordinates + set of fields.

+ +

 

+ +

3. Set new coordinates for your node in the + Coordinates set of fields.

+ +

 

+ +

4. Click the Apply + or OK button.

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

  See + Also a sample TUI Script of a Moving + Nodes operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/displaying_nodes_numbers.htm b/doc/salome/gui/SMESH/files/displaying_nodes_numbers.htm index 8f2bc264a..94a2d5425 100755 --- a/doc/salome/gui/SMESH/files/displaying_nodes_numbers.htm +++ b/doc/salome/gui/SMESH/files/displaying_nodes_numbers.htm @@ -1,159 +1,159 @@ - - - - - -Displaying nodes numbers - - - - - - - - - - - - - -

Displaying nodes numbers

- -

In MESH you can display the ID numbers of all nodes of your mesh in - the viewer.

- -

 

- -

To display ID numbers of nodes:

- -

 

- -

1. Display your mesh in the viewer

- -

 

- -

2. Right-click on the mesh in the 3D viewer - and from the associated pop-up menu choose Numbering - > Display Nodes #.

- -

 

- -

It will look like as follows:

- -

 

- -

- -

 

- -

Displaying elements numbers

- -

In MESH you can display the ID numbers of all meshing elements composing - your mesh in the viewer.

- -

 

- -

To display ID numbers of elements:

- -

 

- -

1. Display your mesh in the viewer

- -

 

- -

2. Right-click on the mesh in the 3D viewer - and from the associated pop-up menu choose Numbering - > Display Elements #.

- -

 

- -

It will look like as follows:

- -

 

- -

- -

 

- -

 

- - - - + + + + + +Displaying nodes numbers + + + + + + + + + + + + + +

Displaying nodes numbers

+ +

In MESH you can display the ID numbers of all nodes of your mesh in + the viewer.

+ +

 

+ +

To display ID numbers of nodes:

+ +

 

+ +

1. Display your mesh in the viewer

+ +

 

+ +

2. Right-click on the mesh in the 3D viewer + and from the associated pop-up menu choose Numbering + > Display Nodes #.

+ +

 

+ +

It will look like as follows:

+ +

 

+ +

+ +

 

+ +

Displaying elements numbers

+ +

In MESH you can display the ID numbers of all meshing elements composing + your mesh in the viewer.

+ +

 

+ +

To display ID numbers of elements:

+ +

 

+ +

1. Display your mesh in the viewer

+ +

 

+ +

2. Right-click on the mesh in the 3D viewer + and from the associated pop-up menu choose Numbering + > Display Elements #.

+ +

 

+ +

It will look like as follows:

+ +

 

+ +

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/editing_groups.htm b/doc/salome/gui/SMESH/files/editing_groups.htm index 0c5b3974c..adf5054d3 100755 --- a/doc/salome/gui/SMESH/files/editing_groups.htm +++ b/doc/salome/gui/SMESH/files/editing_groups.htm @@ -1,134 +1,134 @@ - - - - - -Editing groups - - - - - - - - - - - - - -

Editing groups

- -

To edit an existing group of elements:

- -

 

- -

1. Select your group in the Object Browser - and in the Mesh menu click the - Edit Group item or icon in the toolbar. The following dialog box will appear:

- -

 

- -

- -

 

- -

In this dialog box you can modify the name of your group and add or remove the - elements forming it. For more information see - Creating Groups page.

- -

2. Click the OK - or  Apply - button to confirm modification of the group.

- -

 

- -

See Also - a sample TUI Script of an Edit - Group operation.  

- -

 

- - - - + + + + + +Editing groups + + + + + + + + + + + + + +

Editing groups

+ +

To edit an existing group of elements:

+ +

 

+ +

1. Select your group in the Object Browser + and in the Mesh menu click the + Edit Group item or icon in the toolbar. The following dialog box will appear:

+ +

 

+ +

+ +

 

+ +

In this dialog box you can modify the name of your group and add or remove the + elements forming it. For more information see + Creating Groups page.

+ +

2. Click the OK + or  Apply + button to confirm modification of the group.

+ +

 

+ +

See Also + a sample TUI Script of an Edit + Group operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/importing_and_exporting_meshes.htm b/doc/salome/gui/SMESH/files/importing_and_exporting_meshes.htm index 26f27486f..5cfa16047 100755 --- a/doc/salome/gui/SMESH/files/importing_and_exporting_meshes.htm +++ b/doc/salome/gui/SMESH/files/importing_and_exporting_meshes.htm @@ -1,157 +1,157 @@ - - - - - -Importing and exporting meshes - - - - - - - - - - - - - -

Importing and exporting meshes

- -

In MESH there is a functionality allowing importation/exportation - of meshes from MED, UNV - format files.

- -

 

- -

To import a mesh:

- -

 

- -

1. From the File - menu choose the Import item, from - its sub-menu select the corresponding format (MED,  UNV) - of the file containing your mesh.

- -

2. In the standard Search - File dialog box find the file for importation.

- -

3. Click the OK - button.

- -

 

- -

- -

 

- -

To export a mesh:

- -

 

- -

1. Select the object you wish to export.

- -

2. From the File - menu choose the Export item, from - its sub-menu select the format (MED, UNV) of the file which will contain - your exported mesh..

- -

3. In the standard Search - File select a location for the exported file and enter its - name.

- -

4. Click the OK - button.

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of an Export - Mesh operation.  

- - - - + + + + + +Importing and exporting meshes + + + + + + + + + + + + + +

Importing and exporting meshes

+ +

In MESH there is a functionality allowing importation/exportation + of meshes from MED and UNV + (I-DEAS 10) format files.

+ +

 

+ +

To import a mesh:

+ +

 

+ +

1. From the File + menu choose the Import item, from + its sub-menu select the corresponding format (MED,  UNV) + of the file containing your mesh.

+ +

2. In the standard Search + File dialog box find the file for importation.

+ +

3. Click the OK + button.

+ +

 

+ +

+ +

 

+ +

To export a mesh:

+ +

 

+ +

1. Select the object you wish to export.

+ +

2. From the File + menu choose the Export item, from + its sub-menu select the format (MED, UNV) of the file which will contain + your exported mesh..

+ +

3. In the standard Search + File select a location for the exported file and enter its + name.

+ +

4. Click the OK + button.

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of an Export + Mesh operation.  

+ + + + diff --git a/doc/salome/gui/SMESH/files/length_of_edges.htm b/doc/salome/gui/SMESH/files/length_of_edges.htm index 259d204da..54cf22553 100755 --- a/doc/salome/gui/SMESH/files/length_of_edges.htm +++ b/doc/salome/gui/SMESH/files/length_of_edges.htm @@ -1,137 +1,137 @@ - - - - - -Length of edges - - - - - - - - - - - - - -

Length 2D

- -

This quality control criterion consists of calculation - of length of the edges combining the meshing elements (triangles and quadrangles) - of your mesh.

- -

   

- -

To apply the Length 2D quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Length 2D or click button in the toolbar. Your - mesh will be displayed in the viewer with its elements colored according - to the applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a  Length - 2D quality control operation.  

- -

 

- -

 

- -

 

- - - - + + + + + +Length of edges + + + + + + + + + + + + + +

Length 2D

+ +

This quality control criterion consists of calculation + of length of the edges combining the meshing elements (triangles and quadrangles) + of your mesh.

+ +

   

+ +

To apply the Length 2D quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Length 2D or click button in the toolbar. Your + mesh will be displayed in the viewer with its elements colored according + to the applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a  Length + 2D quality control operation.  

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/max._element_area_hypothesis.htm b/doc/salome/gui/SMESH/files/max._element_area_hypothesis.htm index d52787ce3..213603d7b 100755 --- a/doc/salome/gui/SMESH/files/max._element_area_hypothesis.htm +++ b/doc/salome/gui/SMESH/files/max._element_area_hypothesis.htm @@ -1,172 +1,172 @@ - - - - - -Length from edges - - - - - - - - - - - - - -

2D Meshing Hypotheses

- - - -

Max Element Area

- -

Max Element Area hypothesis - is applied for meshing of 2D faces composing your geometrical object. - Definition of this hypothesis consists of setting the maximum - area of meshing elements (depending on the chosen meshing algorithm - it can be triangles or quadrangles), - which will compose the mesh of these 2D faces.

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Maximum - Element Area hypothesis operation.  

- -

 

- -

- -

 

- -

 

- -

Length from Edges

- -

Length from edges hypothesis - builds 2D mesh segments having a length calculated as an average edge - length for a given wire.

- -

 

- -

See Also - a sample TUI Script of a Length - from Edges hypothesis operation.  

- -

 

- -

Quadrangle Preference

- -

This algorithm can be used only together with Quadrangle (Mapping) algorithm. - It allows to build quadrangular meshes even if the number of nodes at - the opposite edges of a meshed face is not equal, otherwise this mesh - will contain some triangular elements.

- -

 

- -

 

- - - - + + + + + +Length from edges + + + + + + + + + + + + + +

2D Meshing Hypotheses

+ + + +

Max Element Area

+ +

Max Element Area hypothesis + is applied for meshing of 2D faces composing your geometrical object. + Definition of this hypothesis consists of setting the maximum + area of meshing elements (depending on the chosen meshing algorithm + it can be triangles or quadrangles), + which will compose the mesh of these 2D faces.

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Maximum + Element Area hypothesis operation.  

+ +

 

+ +

+ +

 

+ +

 

+ +

Length from Edges

+ +

Length from edges hypothesis + builds 2D mesh segments having a length calculated as an average edge + length for a given wire.

+ +

 

+ +

See Also + a sample TUI Script of a Length + from Edges hypothesis operation.  

+ +

 

+ +

Quadrangle Preference

+ +

This algorithm can be used only together with Quadrangle (Mapping) algorithm. + It allows to build quadrangular meshes even if the number of nodes at + the opposite edges of a meshed face is not equal, otherwise this mesh + will contain some triangular elements.

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/max._element_volume_hypothsis.htm b/doc/salome/gui/SMESH/files/max._element_volume_hypothsis.htm index 8876409e2..b9be27030 100755 --- a/doc/salome/gui/SMESH/files/max._element_volume_hypothsis.htm +++ b/doc/salome/gui/SMESH/files/max._element_volume_hypothsis.htm @@ -1,122 +1,122 @@ - - - - - -Non conform mesh allowed hypothesis - - - - - - - - - - - - - -

Max Element Volume hypothesis

- -

Max - Element Area hypothesis is applied for meshing of 3D objects composing - your geometrical object. Definition of this hypothesis consists of setting - the maximum volume of 3D meshing - elements (depending on the chosen meshing algorithm it can be hexahedrons - or tetrahedrons), which - will compose the mesh of these 3D objects.

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Maximum - Element Volume hypothesis operation.  

- -

 

- - - - + + + + + +Non conform mesh allowed hypothesis + + + + + + + + + + + + + +

Max Element Volume hypothesis

+ +

Max + Element Area hypothesis is applied for meshing of 3D objects composing + your geometrical object. Definition of this hypothesis consists of setting + the maximum volume of 3D meshing + elements (depending on the chosen meshing algorithm it can be hexahedrons + or tetrahedrons), which + will compose the mesh of these 3D objects.

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Maximum + Element Volume hypothesis operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/merging_nodes.htm b/doc/salome/gui/SMESH/files/merging_nodes.htm index ec83b7549..b762170ce 100755 --- a/doc/salome/gui/SMESH/files/merging_nodes.htm +++ b/doc/salome/gui/SMESH/files/merging_nodes.htm @@ -1,131 +1,131 @@ - - - - - -Merging nodes - - - - - - - - - - - - -

Merging nodes

- -

This functionality allows user to detect groups of coincident - nodes with desirable tolerance, edit these groups and merge.

- -

 

- -

To merge nodes of your mesh:

- -

 

- -

1. From the Modification - choose Transformation and -  from its - sub-menu select the Merge nodes item. - The following dialog box shall appear:

- -

 

- -

- -

 

- -

This dialog box allows to create groups of - coincident nodes and to merge them.

- -

 

- -

            

- -

 

- -

 

- -

 

- -

  See - Also a sample TUI Script of a Merge - Nodes operation.  

- -

 

- - - - + + + + + +Merging nodes + + + + + + + + + + + + +

Merging nodes

+ +

This functionality allows user to detect groups of coincident + nodes with desirable tolerance, edit these groups and merge.

+ +

 

+ +

To merge nodes of your mesh:

+ +

 

+ +

1. From the Modification + choose Transformation and +  from its + sub-menu select the Merge nodes item. + The following dialog box shall appear:

+ +

 

+ +

+ +

 

+ +

This dialog box allows to create groups of + coincident nodes and to merge them.

+ +

 

+ +

            

+ +

 

+ +

 

+ +

 

+ +

  See + Also a sample TUI Script of a Merge + Nodes operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/minimum_angle.htm b/doc/salome/gui/SMESH/files/minimum_angle.htm index 202ab024e..edf891759 100755 --- a/doc/salome/gui/SMESH/files/minimum_angle.htm +++ b/doc/salome/gui/SMESH/files/minimum_angle.htm @@ -1,134 +1,134 @@ - - - - - -Minimum angle - - - - - - - - - - - - - -

Minimum angle

- -

Minimum angle - mesh quality criterion consists of calculation of the minimum value of - angle between two adjacent sides of a 2D meshing element (triangle or - quadrangle).

- -

 

- -

To apply the Minimum angle quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Minimum angle or click button. Your mesh will - be displayed in the viewer with its elements colored according to the - applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Minimum - Angle quality control operation.  

- -

 

- - - - + + + + + +Minimum angle + + + + + + + + + + + + + +

Minimum angle

+ +

Minimum angle + mesh quality criterion consists of calculation of the minimum value of + angle between two adjacent sides of a 2D meshing element (triangle or + quadrangle).

+ +

 

+ +

To apply the Minimum angle quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Minimum angle or click button. Your mesh will + be displayed in the viewer with its elements colored according to the + applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Minimum + Angle quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/non_conform_mesh_allowed_hypothesis.htm b/doc/salome/gui/SMESH/files/non_conform_mesh_allowed_hypothesis.htm index 1083820b9..f79a74bc2 100755 --- a/doc/salome/gui/SMESH/files/non_conform_mesh_allowed_hypothesis.htm +++ b/doc/salome/gui/SMESH/files/non_conform_mesh_allowed_hypothesis.htm @@ -1,142 +1,142 @@ - - - - - -Non conform mesh allowed hypothesis - - - - - - - - - - - - - -

Additional Hypotheses

- -

Additional Hypotheses can be - applied as a supplement to the main hypotheses, introducing additional - concepts to mesh creation.

- -

 

- -

To define an Additional Hypothesis - simply select it in Create Mesh - menu. These hypotheses are actually changes in the rules of mesh creation - and as such don't possess adjustable values.

- -

Non Conform mesh allowed hypothesis

- -

Non Conform mesh allowed hypothesis - allows to generate non-conform meshes (that is, meshes having some edges - ending on an edge or face of adjacent elements).

- -

Quadratic Mesh

- -

Quadratic Mesh hypothesis allows to build a quadratic mesh (whose edges - are not straight but broken lines and can be defined by three points: - first, middle and last) instead of an ordinary one.  

- -

Propagation of 1D Hypothesis on opposite edges

- -

Propagation of 1D Hypothesis on opposite - edges allows to propagate a hypothesis onto an opposite edge. If - a local hypothesis and propagation are defined on an edge of a quadrangular - face, the opposite edge will have the same hypothesis, unless another - hypothesis has been locally defined on the opposite edge.

- -

 

- -

See Also - a sample TUI Script of a Propagation - hypothesis operation.  

- -

 

- -

 

- -

 

- - - - + + + + + +Non conform mesh allowed hypothesis + + + + + + + + + + + + + +

Additional Hypotheses

+ +

Additional Hypotheses can be + applied as a supplement to the main hypotheses, introducing additional + concepts to mesh creation.

+ +

 

+ +

To define an Additional Hypothesis + simply select it in Create Mesh + menu. These hypotheses are actually changes in the rules of mesh creation + and as such don't possess adjustable values.

+ +

Non Conform mesh allowed hypothesis

+ +

Non Conform mesh allowed hypothesis + allows to generate non-conform meshes (that is, meshes having some edges + ending on an edge or face of adjacent elements).

+ +

Quadratic Mesh

+ +

Quadratic Mesh hypothesis allows to build a quadratic mesh (whose edges + are not straight but broken lines and can be defined by three points: + first, middle and last) instead of an ordinary one.  

+ +

Propagation of 1D Hypothesis on opposite edges

+ +

Propagation of 1D Hypothesis on opposite + edges allows to propagate a hypothesis onto an opposite edge. If + a local hypothesis and propagation are defined on an edge of a quadrangular + face, the opposite edge will have the same hypothesis, unless another + hypothesis has been locally defined on the opposite edge.

+ +

 

+ +

See Also + a sample TUI Script of a Propagation + hypothesis operation.  

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/reassigning_hypotheses_and_algorithms.htm b/doc/salome/gui/SMESH/files/reassigning_hypotheses_and_algorithms.htm index 5244eead1..c0b0d06bc 100755 --- a/doc/salome/gui/SMESH/files/reassigning_hypotheses_and_algorithms.htm +++ b/doc/salome/gui/SMESH/files/reassigning_hypotheses_and_algorithms.htm @@ -1,147 +1,147 @@ - - - - - -Reassigning hypotheses and algorithms - - - - - - - - - - - - - -

Editing Meshes

- -

After you have created a mesh or submesh with definite applied hypotheses - and algorithms you can edit your mesh by assigning - new hypotheses and algorithms or unassigning - the applied hypotheses and algorithms. The editing proceeds in - the same way as Mesh Creation. -

- -

 

- -

- -

You can also change values for the current hypothesis by clicking the - button.

- -

 

- -

See how a mesh constructed on one and the same geometrical object changes - if we apply different algorithms to it.

- -

 

- -

 

- -

 

- -

- -

 

- -

 

- -

See Also - a sample TUI Script of an Edit - Mesh operation.  

- -

 

- -

 

- -

 

- - - - + + + + + +Reassigning hypotheses and algorithms + + + + + + + + + + + + + +

Editing Meshes

+ +

After you have created a mesh or submesh with definite applied hypotheses + and algorithms you can edit your mesh by assigning + new hypotheses and algorithms or unassigning + the applied hypotheses and algorithms. The editing proceeds in + the same way as Mesh Creation. +

+ +

 

+ +

+ +

You can also change values for the current hypothesis by clicking the + button.

+ +

 

+ +

See how a mesh constructed on one and the same geometrical object changes + if we apply different algorithms to it.

+ +

 

+ +

 

+ +

 

+ +

+ +

 

+ +

 

+ +

See Also + a sample TUI Script of an Edit + Mesh operation.  

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/removing_nodes_and_elements.htm b/doc/salome/gui/SMESH/files/removing_nodes_and_elements.htm index 7137d89e6..9b720e967 100755 --- a/doc/salome/gui/SMESH/files/removing_nodes_and_elements.htm +++ b/doc/salome/gui/SMESH/files/removing_nodes_and_elements.htm @@ -1,246 +1,246 @@ - - - - - -Removing nodes and elements - - - - - - - - - - - - - -

Removing nodes and elements

- -

In MESH you can remove nodes and all types of cells of your mesh.

- -

 

- - - -

 

- -

To remove a node:

- -

 

- -

1. Select your mesh in the Object Browser - or in the 3D viewer.

- -

 

- -

2. From the Modification - menu choose Remove and - from the associated submenu select the Remove - nodes, or just click icon in the toolbar. The - following dialog box will appear:

- -

 

- -

- -

 

- -

In this dialog box you can specify one or - several nodes (with pressed Shift button) by choosing them in the 3D viewer.

- -

 

- -

3. Click OK - or Apply  to - confirm deletion of the specified nodes.

- -

 

- -

Be careful while removing - nodes because if you remove a definite node of your mesh all adjacent - elements will be also deleted.

- -

 

- - --- - - - -
-

-

- -

 

- -

 

- -

To remove an element:

- -

 

- -

1. Select your mesh in the Object Browser - or in the 3D viewer.

- -

 

- -

2. From the Modification - menu choose Remove and - from the associated submenu select the Remove - elements, or just click icon in the toolbar. The - following dialog box will appear:

- -

 

- -

- -

 

- -

In this dialog box you can specify one or - several elements of your mesh (with pressed Shift button) by choosing - them in the 3D viewer.

- -

 

- -

3. Click OK - or Apply  to - confirm deletion of the specified elements.

- -

 

- - --- - - - -
-

-

- -

 

- -

 

- -

  See - Also a sample TUI Script of a Removing - Nodes and Elements operation.  

- -

 

- - - - + + + + + +Removing nodes and elements + + + + + + + + + + + + + +

Removing nodes and elements

+ +

In MESH you can remove nodes and all types of cells of your mesh.

+ +

 

+ + + +

 

+ +

To remove a node:

+ +

 

+ +

1. Select your mesh in the Object Browser + or in the 3D viewer.

+ +

 

+ +

2. From the Modification + menu choose Remove and + from the associated submenu select the Remove + nodes, or just click icon in the toolbar. The + following dialog box will appear:

+ +

 

+ +

+ +

 

+ +

In this dialog box you can specify one or + several nodes (with pressed Shift button) by choosing them in the 3D viewer.

+ +

 

+ +

3. Click OK + or Apply  to + confirm deletion of the specified nodes.

+ +

 

+ +

Be careful while removing + nodes because if you remove a definite node of your mesh all adjacent + elements will be also deleted.

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

 

+ +

To remove an element:

+ +

 

+ +

1. Select your mesh in the Object Browser + or in the 3D viewer.

+ +

 

+ +

2. From the Modification + menu choose Remove and + from the associated submenu select the Remove + elements, or just click icon in the toolbar. The + following dialog box will appear:

+ +

 

+ +

+ +

 

+ +

In this dialog box you can specify one or + several elements of your mesh (with pressed Shift button) by choosing + them in the 3D viewer.

+ +

 

+ +

3. Click OK + or Apply  to + confirm deletion of the specified elements.

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

 

+ +

  See + Also a sample TUI Script of a Removing + Nodes and Elements operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/renumbering_nodes_and_elements.htm b/doc/salome/gui/SMESH/files/renumbering_nodes_and_elements.htm index c329d1566..577cd3356 100755 --- a/doc/salome/gui/SMESH/files/renumbering_nodes_and_elements.htm +++ b/doc/salome/gui/SMESH/files/renumbering_nodes_and_elements.htm @@ -1,176 +1,176 @@ - - - - - -Renumbering nodes and elements - - - - - - - - - - - - -

Renumbering nodes and elements

- -

In MESH you can renumber the nodes and elements of your mesh.

- -

 

- - - -

 

- -

To renumber the nodes of your mesh:

- -

 

- -

1. In the Modification - menu select Renumbering submenu - and choose the Nodes item or click - button in the toolbar. The following dialog box will - appear:

- -

 

- -

- -

 

- -

2. Fill the Mesh - field by selecting your mesh in the Object Browser or in the 3D - viewer.

- -

 

- -

3. Click the Apply - or OK button - to perform the operation.

- -

 

- -

 

- -

To renumber the elements of your - mesh:

- -

 

- -

1. In the Modification - menu select Renumbering submenu - and choose the Elements item or - click button in the toolbar. The following dialog box will - appear:

- -

 

- -

- -

 

- -

2. Fill the Mesh - field by selecting your mesh in the Object Browser or in the 3D - viewer.

- -

 

- -

3. Click the Apply - or OK button - to perform the operation.

- -

 

- -

  See - Also a sample TUI Script of a Renumbering - Nodes and Elements operation. -  

- -

 

- -

 

- - - - + + + + + +Renumbering nodes and elements + + + + + + + + + + + + +

Renumbering nodes and elements

+ +

In MESH you can renumber the nodes and elements of your mesh.

+ +

 

+ + + +

 

+ +

To renumber the nodes of your mesh:

+ +

 

+ +

1. In the Modification + menu select Renumbering submenu + and choose the Nodes item or click + button in the toolbar. The following dialog box will + appear:

+ +

 

+ +

+ +

 

+ +

2. Fill the Mesh + field by selecting your mesh in the Object Browser or in the 3D + viewer.

+ +

 

+ +

3. Click the Apply + or OK button + to perform the operation.

+ +

 

+ +

 

+ +

To renumber the elements of your + mesh:

+ +

 

+ +

1. In the Modification + menu select Renumbering submenu + and choose the Elements item or + click button in the toolbar. The following dialog box will + appear:

+ +

 

+ +

+ +

 

+ +

2. Fill the Mesh + field by selecting your mesh in the Object Browser or in the 3D + viewer.

+ +

 

+ +

3. Click the Apply + or OK button + to perform the operation.

+ +

 

+ +

  See + Also a sample TUI Script of a Renumbering + Nodes and Elements operation. +  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/rotation.htm b/doc/salome/gui/SMESH/files/rotation.htm index 55b13144e..2e825820b 100755 --- a/doc/salome/gui/SMESH/files/rotation.htm +++ b/doc/salome/gui/SMESH/files/rotation.htm @@ -1,142 +1,142 @@ - - - - - -Rotation - - - - - - - - - - - - -

Rotation

- -

This geometrical operation allows to rotate in space your mesh or some - of its elements.

- -

 

- -

 To - rotate your mesh:

- -

 

- -

From the Modification - choose Transformation and -  from its - sub-menu select the Rotation item. - The following dialog box shall appear:

- -

 

- -

- -

 

- -

In this dialog box you can specify the elements - which should be rotated and the rotation parameters:

- -
    - -
  • Axis: - point and vector

  • - -
  • Angle - of rotation

  • -
- -

 

- -

Create a - copy radio button allows to copy the rotated object.

- -

 

- -

  See - Also a sample TUI Script of a Rotation - operation.  

- -

 

- -

  

- -

 

- - - - + + + + + +Rotation + + + + + + + + + + + + +

Rotation

+ +

This geometrical operation allows to rotate in space your mesh or some + of its elements.

+ +

 

+ +

 To + rotate your mesh:

+ +

 

+ +

From the Modification + choose Transformation and +  from its + sub-menu select the Rotation item. + The following dialog box shall appear:

+ +

 

+ +

+ +

 

+ +

In this dialog box you can specify the elements + which should be rotated and the rotation parameters:

+ +
    + +
  • Axis: + point and vector

  • + +
  • Angle + of rotation

  • +
+ +

 

+ +

Create a + copy radio button allows to copy the rotated object.

+ +

 

+ +

  See + Also a sample TUI Script of a Rotation + operation.  

+ +

 

+ +

  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/running_smesh_module.htm b/doc/salome/gui/SMESH/files/running_smesh_module.htm index a7422b23d..a00aac946 100755 --- a/doc/salome/gui/SMESH/files/running_smesh_module.htm +++ b/doc/salome/gui/SMESH/files/running_smesh_module.htm @@ -1,111 +1,111 @@ - - - - - -Running SMESH module - - - - - - - - - - - - -

Running MESH module

- -

To start MESH module in SALOME click icon in the - bottom toolbar or select MESH -  from the - Choose box:                      

- -

 

- -

The desktop of the SALOME - platform will be updated with additional toolbars and menus related to - the MESH component .

- -

 

- -

- -

 

- - - - + + + + + +Running SMESH module + + + + + + + + + + + + +

Running MESH module

+ +

To start MESH module in SALOME click icon in the + bottom toolbar or select MESH +  from the + Choose box:                      

+ +

 

+ +

The desktop of the SALOME + platform will be updated with additional toolbars and menus related to + the MESH component .

+ +

 

+ +

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/sewing_meshes.htm b/doc/salome/gui/SMESH/files/sewing_meshes.htm index 3a71c8db9..3a461cf25 100755 --- a/doc/salome/gui/SMESH/files/sewing_meshes.htm +++ b/doc/salome/gui/SMESH/files/sewing_meshes.htm @@ -1,342 +1,342 @@ - - - - - -Sewing meshes - - - - - - - - - - - - - -

Sewing meshes

- -

In SMESH you can sew elements of  different - meshes. The current functionality allows you to sew:

- -

 

- - - -

 

- -

To sew elements of different meshes:

- -

 

- -

1. From the Modification - menu choose the Transformation - item and  from - its sub-menu select the Sewing item. -

- -

2. Check in the dialog box one of the radio - buttons corresponding to the type of sewing operation you would like to - perform.

- -

3. Fill the other fields available in the - dialog box

- -

4. Click the OK - or Apply button - to perform the operation of sewing.

- -

Sew free borders

- -

This functionality allows you to unite two free borders of a 2D mesh.

- -

 

- -

For sewing free borders you should define three points on each border: - first, second and the last node:

- -

 

- -
    - -
  •  the - first node specifies beginning of the border ;

  • - -
  •  the - second node specifies the part of the border which should be considered - (as far as the free border usually forms a closed contour);

  • - -
  •  the - last node specifies the end of the border.

  • -
- -

 

- -

You can select these nodes in the 3D viewer or define by its id.

- -

 

- -

The first and the second nodes should belong to the same link of a face. - The second and the last nodes of a border can be the same. The first and - the last nodes of two borders can be the same. The corresponding end nodes - of two borders will be merged. Intermediate nodes of two borders will - be either merged or inserted into faces of the opposite border.

- -

 

- -

The sewing algorithm is as follows:

- -

 

- -

1. The parameter (U) of each node within - a border is computed. So that the first node has U=0.0, the last node - has U=1.0, for the rest nodes 0.0 < U < 1.0;

- -

2. Compare node parameters of the two borders. - If two nodes of the opposite borders have close parameters, they are merged, - i.e. a node of the first border is replaced in all elements by a node - of the second border. If a node has no node with a close parameter in - the opposite border, it is inserted into an edge of element of the opposite - border, an element is split. Two nodes are considered close enough to - merge, if difference of their parameters is less than one fifth of minimum - length of adjacent face edges on the borders.

- -

 

- -

- -

 

- -

  See - Also a sample TUI Script of a Sew - Free Borders operation.  

- -

 

- -

 

- -

Sew conform free borders

- -

This functionality can be used to unite two free borders of a 2D mesh. -

- -

 

- -

The borders of meshes for sewing are defined as for "Sew free borders" - except that the second free border is not limited and can be defined by - the first and the second nodes only. The first nodes of two borders can - be the same.

- -

 

- -

The algorithm is following: counting nodes starting at the first ones, - the n-th node of the first border is merged with the n-th node of the - other border, until the end of either of borders. Nodes of the first border - are replaced in all elements with corresponding nodes of the second border.

- -

For sewing conform free borders you should define three points on the - first border and two points on the second one. User can select these nodes - in 3D viewer or define node by its id.

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

 

- -

  See - Also a sample TUI Script of a Sew - Conform Free Borders operation.  

- -

 

- -

 

- -

Sew border to side

- -

"Sew border to side" is intended to sew a free border to a - mesh surface.

- -

The free border is defined as for "Sewing of free borders". - The place where to sew the border is defined by two nodes, between which - the border faces are placed, so that the first border node is merged with - the first node on the side and the last node of the border is merged with - the second specified node on the side.

- -

 

- -

 

- -

The algorithm is following.

- -

1. Find a sequence of linked nodes on the side such that the found links - to be most co-directed with the links of the free border.

- -

2. Sew two sequences of nodes using algorithm of "Sewing of free - berders".

- -

For sewing border to side you should define three points on the border - and two points on the side. User can select these nodes in 3D viewer or - define node by its id.

- -

- -

  See - Also a sample TUI Script of a Sew - Border to Side operation.  

- -

 

- -

 

- -

Sew side elements

- -

This operation is intended to unite two mesh - surfaces.

- -

 

- -

Surfaces may be defined by either 2d or 3d elements. The number of given - elements of the sides must be the same. The sets of given elements must - be topologically equal, i.e. each node of one element set must have a - corresponding node in the other element set and corresponding nodes must - be equally linked. If there are 3d elements in a set, only their free - faces must obey to that rule.

- -

Two corresponding nodes on each side must be specified. They must belong - to one element and must be located on an element set boundary.

- -

 

- -

Sewing algorithm finds and merges the corresponding nodes starting from - the specified ones.

- -

- -

- -

For sewing side elements you should define elements for sewing and two - nodes for merging on the each side. User can select these elements and - nodes in 3D viewer or define them by its id.

- -

 

- -

See Also a sample TUI Script - of a Sew Side Elements - operation.  

- -

 

- -

 

- - - - + + + + + +Sewing meshes + + + + + + + + + + + + + +

Sewing meshes

+ +

In SMESH you can sew elements of  different + meshes. The current functionality allows you to sew:

+ +

 

+ + + +

 

+ +

To sew elements of different meshes:

+ +

 

+ +

1. From the Modification + menu choose the Transformation + item and  from + its sub-menu select the Sewing item. +

+ +

2. Check in the dialog box one of the radio + buttons corresponding to the type of sewing operation you would like to + perform.

+ +

3. Fill the other fields available in the + dialog box

+ +

4. Click the OK + or Apply button + to perform the operation of sewing.

+ +

Sew free borders

+ +

This functionality allows you to unite two free borders of a 2D mesh.

+ +

 

+ +

For sewing free borders you should define three points on each border: + first, second and the last node:

+ +

 

+ +
    + +
  •  the + first node specifies beginning of the border ;

  • + +
  •  the + second node specifies the part of the border which should be considered + (as far as the free border usually forms a closed contour);

  • + +
  •  the + last node specifies the end of the border.

  • +
+ +

 

+ +

You can select these nodes in the 3D viewer or define by its id.

+ +

 

+ +

The first and the second nodes should belong to the same link of a face. + The second and the last nodes of a border can be the same. The first and + the last nodes of two borders can be the same. The corresponding end nodes + of two borders will be merged. Intermediate nodes of two borders will + be either merged or inserted into faces of the opposite border.

+ +

 

+ +

The sewing algorithm is as follows:

+ +

 

+ +

1. The parameter (U) of each node within + a border is computed. So that the first node has U=0.0, the last node + has U=1.0, for the rest nodes 0.0 < U < 1.0;

+ +

2. Compare node parameters of the two borders. + If two nodes of the opposite borders have close parameters, they are merged, + i.e. a node of the first border is replaced in all elements by a node + of the second border. If a node has no node with a close parameter in + the opposite border, it is inserted into an edge of element of the opposite + border, an element is split. Two nodes are considered close enough to + merge, if difference of their parameters is less than one fifth of minimum + length of adjacent face edges on the borders.

+ +

 

+ +

+ +

 

+ +

  See + Also a sample TUI Script of a Sew + Free Borders operation.  

+ +

 

+ +

 

+ +

Sew conform free borders

+ +

This functionality can be used to unite two free borders of a 2D mesh. +

+ +

 

+ +

The borders of meshes for sewing are defined as for "Sew free borders" + except that the second free border is not limited and can be defined by + the first and the second nodes only. The first nodes of two borders can + be the same.

+ +

 

+ +

The algorithm is following: counting nodes starting at the first ones, + the n-th node of the first border is merged with the n-th node of the + other border, until the end of either of borders. Nodes of the first border + are replaced in all elements with corresponding nodes of the second border.

+ +

For sewing conform free borders you should define three points on the + first border and two points on the second one. User can select these nodes + in 3D viewer or define node by its id.

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ +

  See + Also a sample TUI Script of a Sew + Conform Free Borders operation.  

+ +

 

+ +

 

+ +

Sew border to side

+ +

"Sew border to side" is intended to sew a free border to a + mesh surface.

+ +

The free border is defined as for "Sewing of free borders". + The place where to sew the border is defined by two nodes, between which + the border faces are placed, so that the first border node is merged with + the first node on the side and the last node of the border is merged with + the second specified node on the side.

+ +

 

+ +

 

+ +

The algorithm is following.

+ +

1. Find a sequence of linked nodes on the side such that the found links + to be most co-directed with the links of the free border.

+ +

2. Sew two sequences of nodes using algorithm of "Sewing of free + berders".

+ +

For sewing border to side you should define three points on the border + and two points on the side. User can select these nodes in 3D viewer or + define node by its id.

+ +

+ +

  See + Also a sample TUI Script of a Sew + Border to Side operation.  

+ +

 

+ +

 

+ +

Sew side elements

+ +

This operation is intended to unite two mesh + surfaces.

+ +

 

+ +

Surfaces may be defined by either 2d or 3d elements. The number of given + elements of the sides must be the same. The sets of given elements must + be topologically equal, i.e. each node of one element set must have a + corresponding node in the other element set and corresponding nodes must + be equally linked. If there are 3d elements in a set, only their free + faces must obey to that rule.

+ +

Two corresponding nodes on each side must be specified. They must belong + to one element and must be located on an element set boundary.

+ +

 

+ +

Sewing algorithm finds and merges the corresponding nodes starting from + the specified ones.

+ +

+ +

+ +

For sewing side elements you should define elements for sewing and two + nodes for merging on the each side. User can select these elements and + nodes in 3D viewer or define them by its id.

+ +

 

+ +

See Also a sample TUI Script + of a Sew Side Elements + operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/skew.htm b/doc/salome/gui/SMESH/files/skew.htm index 2a39312ab..cfeac0793 100755 --- a/doc/salome/gui/SMESH/files/skew.htm +++ b/doc/salome/gui/SMESH/files/skew.htm @@ -1,141 +1,141 @@ - - - - - -Skew - - - - - - - - - - - - - -

Skew

- -

Skew mesh quality - criterion reflects the angle between the lines that join opposite sides - of the element. SKEW  is - a maximum value of all skew angles. This - mesh quality criterion can be applied to elements composed of 4 and 3 - nodes (quadrangles and triangles)

- -

 

- -

- -

 

- -

To apply the Skew quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Skew or click button of the toolbar. Your mesh - will be displayed in the viewer with its elements colored according to - the applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Skew - quality control operation.  

- -

 

- - - - + + + + + +Skew + + + + + + + + + + + + + +

Skew

+ +

Skew mesh quality + criterion reflects the angle between the lines that join opposite sides + of the element. SKEW  is + a maximum value of all skew angles. This + mesh quality criterion can be applied to elements composed of 4 and 3 + nodes (quadrangles and triangles)

+ +

 

+ +

+ +

 

+ +

To apply the Skew quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Skew or click button of the toolbar. Your mesh + will be displayed in the viewer with its elements colored according to + the applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Skew + quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/smoothing.htm b/doc/salome/gui/SMESH/files/smoothing.htm index 7ceadedc9..5b34249e0 100755 --- a/doc/salome/gui/SMESH/files/smoothing.htm +++ b/doc/salome/gui/SMESH/files/smoothing.htm @@ -1,196 +1,196 @@ - - - - - -Smoothing - - - - - - - - - - - - -

Smoothing

- -

Smoothing is used to adjust the locations of element - corners (nodes) to reduce distortions in these elements.

- -

 

- -

To apply smoothing to the elements of your mesh:

- -

 

- -

1. Display a mesh or a submesh in the 3D - viewer.

- -

2. In the Modification - menu select the Smoothing item - or click button in the toolbar. The dialog - box contains the following fields which should be specified:

- -

 

- -

       

- -
    - -
  • Id Elements field allows to specify - the elements which should be smoothed by selecting them in the 3D viewer - (lock Shift button to select several - elements).

  • - -
      - -
    • Select whole mesh, - submesh or group - smoothing is applied - to the whole mesh or its part.

    • - -
    • Fixed nodes - ids: some nodes keep their location during smoothing. If a mesh - is built on a geometry shape, the nodes built on geometrical edges are - always fixed. If smoothing is applied to a part of a mesh then the boundary - nodes of an elements set are also fixed. Any other nodes may be additionally - fixed.

    • - -
    • Smoothing - Method:

    • - -
        - -
      • Laplacian - smoothing pulls a node toward the center of surrounding nodes directly - connected to that node along an element edge. Centroidal smoothing pulls - a node toward the element-area-weighted centroid of the surrounding elements. - Typically, the Laplacian method will produce the mesh with the least element - distortion. It is also the faster method.

      • - -
      • Centroidal - smoothing usually produces a mesh that has more uniform element sizes. - Both methods produce good results with "free" meshes.

      • -
      -
    -
- -

 

- -

- -
    - -
  • Iteration limit: both of the smoothing - methods use an iterative procedure to converge toward a smoothed mesh. - All nodes are smoothed according to one of the techniques shown above. - Then the smoothing is reevaluated with the updated nodal locations. This - process continues until the maximum number of iterations has been exceeded, - or all elements has aspect ratio less or equal than the specified one.

  • - -
  • Max. aspect ratio.

  • -
- -

 

- -

3. Click the Apply - or OK button to confirm - the operation.

- -

 

- -

        

- -

 

- -

  See - Also a sample TUI Script of a Smoothing - operation.  

- -

 

- -

 

- - - - + + + + + +Smoothing + + + + + + + + + + + + +

Smoothing

+ +

Smoothing is used to adjust the locations of element + corners (nodes) to reduce distortions in these elements.

+ +

 

+ +

To apply smoothing to the elements of your mesh:

+ +

 

+ +

1. Display a mesh or a submesh in the 3D + viewer.

+ +

2. In the Modification + menu select the Smoothing item + or click button in the toolbar. The dialog + box contains the following fields which should be specified:

+ +

 

+ +

       

+ +
    + +
  • Id Elements field allows to specify + the elements which should be smoothed by selecting them in the 3D viewer + (lock Shift button to select several + elements).

  • + +
      + +
    • Select whole mesh, + submesh or group - smoothing is applied + to the whole mesh or its part.

    • + +
    • Fixed nodes + ids: some nodes keep their location during smoothing. If a mesh + is built on a geometry shape, the nodes built on geometrical edges are + always fixed. If smoothing is applied to a part of a mesh then the boundary + nodes of an elements set are also fixed. Any other nodes may be additionally + fixed.

    • + +
    • Smoothing + Method:

    • + +
        + +
      • Laplacian + smoothing pulls a node toward the center of surrounding nodes directly + connected to that node along an element edge. Centroidal smoothing pulls + a node toward the element-area-weighted centroid of the surrounding elements. + Typically, the Laplacian method will produce the mesh with the least element + distortion. It is also the faster method.

      • + +
      • Centroidal + smoothing usually produces a mesh that has more uniform element sizes. + Both methods produce good results with "free" meshes.

      • +
      +
    +
+ +

 

+ +

+ +
    + +
  • Iteration limit: both of the smoothing + methods use an iterative procedure to converge toward a smoothed mesh. + All nodes are smoothed according to one of the techniques shown above. + Then the smoothing is reevaluated with the updated nodal locations. This + process continues until the maximum number of iterations has been exceeded, + or all elements has aspect ratio less or equal than the specified one.

  • + +
  • Max. aspect ratio.

  • +
+ +

 

+ +

3. Click the Apply + or OK button to confirm + the operation.

+ +

 

+ +

        

+ +

 

+ +

  See + Also a sample TUI Script of a Smoothing + operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/symmetry.htm b/doc/salome/gui/SMESH/files/symmetry.htm index bc13e22f5..b8e622996 100755 --- a/doc/salome/gui/SMESH/files/symmetry.htm +++ b/doc/salome/gui/SMESH/files/symmetry.htm @@ -1,147 +1,147 @@ - - - - - -Symmetry - - - - - - - - - - - - -

Symmetry

- -

This geometrical operation allows to perform a symmetrical copy of your - mesh or some of its elements.

- -

 

- -

 To - apply symmetry to your mesh:

- -

 

- -

From the Modification - choose Transformation and -  from its - sub-menu select the Symmetry item. - The following dialog box shall appear:

- -

 

- -

- -

 

- -

- -

 

- -

- -

 

- -

This operation has three options, you can - symmetrically copy your mesh or some of its elements specifying:

- -
    - -
  • one point

  • - -
  • one axis (point and - vector)

  • - -
  • one plane (point and - normal)

  • -
- -

 

- -

Create a - copy radio button allows to keep the initial elements or mesh.

- -

 

- -

  See - Also a sample TUI Script of a Symmetry - operation.  

- -

 

- - - - + + + + + +Symmetry + + + + + + + + + + + + +

Symmetry

+ +

This geometrical operation allows to perform a symmetrical copy of your + mesh or some of its elements.

+ +

 

+ +

 To + apply symmetry to your mesh:

+ +

 

+ +

From the Modification + choose Transformation and +  from its + sub-menu select the Symmetry item. + The following dialog box shall appear:

+ +

 

+ +

+ +

 

+ +

+ +

 

+ +

+ +

 

+ +

This operation has three options, you can + symmetrically copy your mesh or some of its elements specifying:

+ +
    + +
  • one point

  • + +
  • one axis (point and + vector)

  • + +
  • one plane (point and + normal)

  • +
+ +

 

+ +

Create a + copy radio button allows to keep the initial elements or mesh.

+ +

 

+ +

  See + Also a sample TUI Script of a Symmetry + operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/taper.htm b/doc/salome/gui/SMESH/files/taper.htm index 4e635c4e3..9ea8a26a7 100755 --- a/doc/salome/gui/SMESH/files/taper.htm +++ b/doc/salome/gui/SMESH/files/taper.htm @@ -1,141 +1,141 @@ - - - - - -Taper - - - - - - - - - - - - - -

Taper

- -

Taper mesh quality - criterion represents the ratio of the areas of two triangles separated - by a diagonal. So it can be calculated only for elements consisting of - 4 nodes.

- -

 

- -

- -

 

- -

 

- -

To apply the Taper quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Taper or click button in the toolbar. Your mesh - will be displayed in the viewer with its elements colored according to - the applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Taper - quality control operation.  

- -

 

- - - - + + + + + +Taper + + + + + + + + + + + + + +

Taper

+ +

Taper mesh quality + criterion represents the ratio of the areas of two triangles separated + by a diagonal. So it can be calculated only for elements consisting of + 4 nodes.

+ +

 

+ +

+ +

 

+ +

 

+ +

To apply the Taper quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Taper or click button in the toolbar. Your mesh + will be displayed in the viewer with its elements colored according to + the applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Taper + quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/translation.htm b/doc/salome/gui/SMESH/files/translation.htm index 8102d759d..82be5851d 100755 --- a/doc/salome/gui/SMESH/files/translation.htm +++ b/doc/salome/gui/SMESH/files/translation.htm @@ -1,137 +1,137 @@ - - - - - -Translation - - - - - - - - - - - - -

Translation

- -

This geometrical operation allows to translate in space your mesh or - some of its elements.

- -

 

- -

 To - translate your mesh:

- -

 

- -

From the Modification - choose Transformation and -  from its - sub-menu select the Translation item. - The following dialog box shall appear:

- -

 

- -

  

- -

 

- -

This operation has two options, you can translate - in space your mesh or some of its elements specifying:

- -
    - -
  • two points (starting - and ending)

  • - -
  • one vector

  • -
- -

Toggle the corresponding checkbox to Select whole mesh, submesh or group.

- -

Create a - copy button allows to copy the translated object.

- -

 

- -

  See - Also a sample TUI Script of a Translation - operation.  

- -

 

- - - - + + + + + +Translation + + + + + + + + + + + + +

Translation

+ +

This geometrical operation allows to translate in space your mesh or + some of its elements.

+ +

 

+ +

 To + translate your mesh:

+ +

 

+ +

From the Modification + choose Transformation and +  from its + sub-menu select the Translation item. + The following dialog box shall appear:

+ +

 

+ +

  

+ +

 

+ +

This operation has two options, you can translate + in space your mesh or some of its elements specifying:

+ +
    + +
  • two points (starting + and ending)

  • + +
  • one vector

  • +
+ +

Toggle the corresponding checkbox to Select whole mesh, submesh or group.

+ +

Create a + copy button allows to copy the translated object.

+ +

 

+ +

  See + Also a sample TUI Script of a Translation + operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/uniting_a_set_of_triangles.htm b/doc/salome/gui/SMESH/files/uniting_a_set_of_triangles.htm index 514f50a76..69e6ea13b 100755 --- a/doc/salome/gui/SMESH/files/uniting_a_set_of_triangles.htm +++ b/doc/salome/gui/SMESH/files/uniting_a_set_of_triangles.htm @@ -1,183 +1,183 @@ - - - - - -Uniting a set of triangles - - - - - - - - - - - - - -

Uniting a set of triangles

- -

In contrast to the - previous operation this one allows to unite at once many triangles - if they have adjacent edges.

- -

 

- -

To union several triangles:

- -

 

- -

- -

 

- -

1. Display a mesh or a submesh in the 3D - viewer.

- -

2. In the Modification - menu select the Union of triangles - item or click button in the toolbar. The following - dialog box will appear:

- -

 

- -
    - -
  • The main list shall contain the triangles - which will be united. You can click on an triangle in the 3D viewer and - it will be highlighted. After that click the Add - button and the ID of this triangle will be added to the list. To - remove a selected element or elements from the list click the Remove - button. The Sort button - allows to sort the list of IDs. The Set - filter button allows to apply a definite filter to selection of - triangles.

  • - -
  • Apply to all radio button allows to - modify the orientation of all triangles of the currently displayed mesh - or submesh.

  • - -
  • Criterion menu allows to apply the operation - only to those object which meet the chosen criterion (from the list of - Quality Controls, i.e. Skew, Warping, Minimum Angle, etc.)

  • - -
  • Select from set of fields allows to - choose a submesh or an existing group whose triangle elements will be - automatically added to the list.

  • -
- -

 

- -

3. Click the Apply - or OK button to confirm - the operation.

- -

 

- -

If some selected triangle - elements have no adjacent edges with one of the others, the operation - on these elements shall take no effect.

- -

 

- -

   

- -

 

- -

 See - Also a sample TUI Script of a Uniting - a Set of Triangles operation.  

- -

 

- - - - + + + + + +Uniting a set of triangles + + + + + + + + + + + + + +

Uniting a set of triangles

+ +

In contrast to the + previous operation this one allows to unite at once many triangles + if they have adjacent edges.

+ +

 

+ +

To union several triangles:

+ +

 

+ +

+ +

 

+ +

1. Display a mesh or a submesh in the 3D + viewer.

+ +

2. In the Modification + menu select the Union of triangles + item or click button in the toolbar. The following + dialog box will appear:

+ +

 

+ +
    + +
  • The main list shall contain the triangles + which will be united. You can click on an triangle in the 3D viewer and + it will be highlighted. After that click the Add + button and the ID of this triangle will be added to the list. To + remove a selected element or elements from the list click the Remove + button. The Sort button + allows to sort the list of IDs. The Set + filter button allows to apply a definite filter to selection of + triangles.

  • + +
  • Apply to all radio button allows to + modify the orientation of all triangles of the currently displayed mesh + or submesh.

  • + +
  • Criterion menu allows to apply the operation + only to those object which meet the chosen criterion (from the list of + Quality Controls, i.e. Skew, Warping, Minimum Angle, etc.)

  • + +
  • Select from set of fields allows to + choose a submesh or an existing group whose triangle elements will be + automatically added to the list.

  • +
+ +

 

+ +

3. Click the Apply + or OK button to confirm + the operation.

+ +

 

+ +

If some selected triangle + elements have no adjacent edges with one of the others, the operation + on these elements shall take no effect.

+ +

 

+ +

   

+ +

 

+ +

 See + Also a sample TUI Script of a Uniting + a Set of Triangles operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/uniting_two_triangles.htm b/doc/salome/gui/SMESH/files/uniting_two_triangles.htm index 61ad185fd..738ef90f0 100755 --- a/doc/salome/gui/SMESH/files/uniting_two_triangles.htm +++ b/doc/salome/gui/SMESH/files/uniting_two_triangles.htm @@ -1,151 +1,151 @@ - - - - - -Uniting two triangles - - - - - - - - - - - - -

Uniting two triangles

- -

 In MESH - you can union two neighboring triangles (cells) by deletion of the common - edge.

- -

 

- -

To unite two triangles:

- -

 

- -

1. From the Modification - menu choose the Union of two triangles - item or click button in the toolbar. The following - dialog box shall appear:

- -

 

- -

- -

 

- -

2. Enter the ID of the required edge in the - Edge  field - or select this edge in the 3D viewer.

- -

 

- -

3. Click the Apply - or OK button.

- -

 

- -

 

- - --- - - - -
-

-

- -

 

- -

  See - Also a sample TUI Script of a Uniting - Two Triangles operation.  

- -

 

- - - - + + + + + +Uniting two triangles + + + + + + + + + + + + +

Uniting two triangles

+ +

 In MESH + you can union two neighboring triangles (cells) by deletion of the common + edge.

+ +

 

+ +

To unite two triangles:

+ +

 

+ +

1. From the Modification + menu choose the Union of two triangles + item or click button in the toolbar. The following + dialog box shall appear:

+ +

 

+ +

+ +

 

+ +

2. Enter the ID of the required edge in the + Edge  field + or select this edge in the 3D viewer.

+ +

 

+ +

3. Click the Apply + or OK button.

+ +

 

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

  See + Also a sample TUI Script of a Uniting + Two Triangles operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/using_operations_on_groups.htm b/doc/salome/gui/SMESH/files/using_operations_on_groups.htm index b24231f23..4cd9fa069 100755 --- a/doc/salome/gui/SMESH/files/using_operations_on_groups.htm +++ b/doc/salome/gui/SMESH/files/using_operations_on_groups.htm @@ -1,315 +1,315 @@ - - - - - -Using operations on groups - - - - - - - - - - - - - -

Using operations on groups

- -

In MESH you can - perform some Boolean operations on groups, which belong to one and the - same mesh.

- -

 

- - - -

 

- -

Union of two groups

- -

This operation allows to create a new group in such a way that all mesh - elements that are present in the initial groups will be added to the new - one.

- -

 

- -

To union two groups:

- -

 

- -

1. In the Mesh - menu select the Union Groups item. - The following dialog box will appear:

- -

 

- - --- - - - -
-

-

       

-

            Group1 -                         Group2 -                          Group12

-

 

-

For example, we have two groups Group1 and Group2.

-

The result of their Union will - be Group12   

- -

  

- -

 In - this dialog box you should specify the name - of the resulting group and two - groups which will be united.

- -

 

- -

2. Click the Ok - or  Apply - button to confirm creation of the group.

- -

 

- -

See Also - a sample TUI Script of a Union - of two Groups operation.  

- -

 

- -

 

- -

 

- -

Intersection of two groups

- -

This operation allows to create a new group in such a way that all mesh - elements that are present in both initial groups are added to the new - one.

- -

 

- -

To intersect two groups:

- -

 

- -

1. In the Mesh - menu select the Intersect Groups - item. The following dialog box will appear:

- -

 

- - --- - - - -
-

-

 

-

            Group1 -                         Group2 -                    Group12a

-

 

-

For example, we have two groups Group1 and Group2.

-

The result of their Intersection - will be Group12a   

- -

 

- -

In this dialog box you should specify the - name of the resulting group and - two groups which will be intersected.

- -

 

- -

2. Click the Ok - or  Apply - button to confirm creation of the group.

- -

 

- -

 See - Also a sample TUI Script of an  Intersection - of two Groups operation.  

- -

 

- -

Cut of two groups

- -

This operation allows to create a new group in such a way that all mesh - elements that are present in the main group but are absent in the tool - group are added to the new one.

- -

 

- -

To cut two groups:

- -

 

- -

1. In the Mesh - menu select the Cut Groups item. - The following dialog box will appear:

- -

 

- - --- - - - -
-

-

    

-

           Group1 -                          Group2 -                        Group12b

-

 

-

For example, we have two groups Group1 and Group2.

-

The result of their Cut will - be Group12b   

- -

 

- -

In this dialog box you should specify the - name of the resulting group and - two groups which will be cut.

- -

 

- -

2. Click the Ok - or  Apply - button to confirm creation of the group.  

- -

 

- -

  See - Also a sample TUI Script of a  Cut - of two Groups operation.  

- -

 

- -

 

- - - - + + + + + +Using operations on groups + + + + + + + + + + + + + +

Using operations on groups

+ +

In MESH you can + perform some Boolean operations on groups, which belong to one and the + same mesh.

+ +

 

+ + + +

 

+ +

Union of two groups

+ +

This operation allows to create a new group in such a way that all mesh + elements that are present in the initial groups will be added to the new + one.

+ +

 

+ +

To union two groups:

+ +

 

+ +

1. In the Mesh + menu select the Union Groups item. + The following dialog box will appear:

+ +

 

+ + +++ + + + +
+

+

       

+

            Group1 +                         Group2 +                          Group12

+

 

+

For example, we have two groups Group1 and Group2.

+

The result of their Union will + be Group12   

+ +

  

+ +

 In + this dialog box you should specify the name + of the resulting group and two + groups which will be united.

+ +

 

+ +

2. Click the Ok + or  Apply + button to confirm creation of the group.

+ +

 

+ +

See Also + a sample TUI Script of a Union + of two Groups operation.  

+ +

 

+ +

 

+ +

 

+ +

Intersection of two groups

+ +

This operation allows to create a new group in such a way that all mesh + elements that are present in both initial groups are added to the new + one.

+ +

 

+ +

To intersect two groups:

+ +

 

+ +

1. In the Mesh + menu select the Intersect Groups + item. The following dialog box will appear:

+ +

 

+ + +++ + + + +
+

+

 

+

            Group1 +                         Group2 +                    Group12a

+

 

+

For example, we have two groups Group1 and Group2.

+

The result of their Intersection + will be Group12a   

+ +

 

+ +

In this dialog box you should specify the + name of the resulting group and + two groups which will be intersected.

+ +

 

+ +

2. Click the Ok + or  Apply + button to confirm creation of the group.

+ +

 

+ +

 See + Also a sample TUI Script of an  Intersection + of two Groups operation.  

+ +

 

+ +

Cut of two groups

+ +

This operation allows to create a new group in such a way that all mesh + elements that are present in the main group but are absent in the tool + group are added to the new one.

+ +

 

+ +

To cut two groups:

+ +

 

+ +

1. In the Mesh + menu select the Cut Groups item. + The following dialog box will appear:

+ +

 

+ + +++ + + + +
+

+

    

+

           Group1 +                          Group2 +                        Group12b

+

 

+

For example, we have two groups Group1 and Group2.

+

The result of their Cut will + be Group12b   

+ +

 

+ +

In this dialog box you should specify the + name of the resulting group and + two groups which will be cut.

+ +

 

+ +

2. Click the Ok + or  Apply + button to confirm creation of the group.  

+ +

 

+ +

  See + Also a sample TUI Script of a  Cut + of two Groups operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/viewing_mesh_info.htm b/doc/salome/gui/SMESH/files/viewing_mesh_info.htm index 267ac4529..e6a9ffb21 100755 --- a/doc/salome/gui/SMESH/files/viewing_mesh_info.htm +++ b/doc/salome/gui/SMESH/files/viewing_mesh_info.htm @@ -1,184 +1,184 @@ - - - - - -Viewing mesh info - - - - - - - - - - - - - -

Mesh infos

- -

There are two types of information boxes: Standard - Mesh Infos and Advanced - Mesh Infos.

- -

 

- - - -

 

- -

Standard Mesh Infos

- -

The Standard - Mesh Infos box gives only the information on the number of elements - of maximum dimension and the number of nodes in the mesh. However, from - this Info you can learn about groups selected on this mesh.

- -

To view the Standard - Mesh Infos, select your mesh or submesh in the Object - Browser and select Standard Mesh Infos from - the Mesh menu or click - button in the toolbar. The following information will - be displayed:

- -

 

- -

- -

 

- -

Advanced Mesh Infos

- -

The Advanced Mesh - Infos gives more information about the mesh, including the total - number of faces and volumes and their geometrical types.

- -

To view the Advanced Mesh Infos, select - your mesh or submesh in the Object Browser - and select Advanced - Mesh Infos from the Mesh menu or click button - in the toolbar. The following information will be displayed:

- -

 

- -

- -

 

- -

 

- -

In case you get Mesh Infos via a TUI - script, the information is displayed in Python Console.

- -

 

- -

- -

 

- -

 

- -

 

- -

 

- -

 

- - - - + + + + + +Viewing mesh info + + + + + + + + + + + + + +

Mesh infos

+ +

There are two types of information boxes: Standard + Mesh Infos and Advanced + Mesh Infos.

+ +

 

+ + + +

 

+ +

Standard Mesh Infos

+ +

The Standard + Mesh Infos box gives only the information on the number of elements + of maximum dimension and the number of nodes in the mesh. However, from + this Info you can learn about groups selected on this mesh.

+ +

To view the Standard + Mesh Infos, select your mesh or submesh in the Object + Browser and select Standard Mesh Infos from + the Mesh menu or click + button in the toolbar. The following information will + be displayed:

+ +

 

+ +

+ +

 

+ +

Advanced Mesh Infos

+ +

The Advanced Mesh + Infos gives more information about the mesh, including the total + number of faces and volumes and their geometrical types.

+ +

To view the Advanced Mesh Infos, select + your mesh or submesh in the Object Browser + and select Advanced + Mesh Infos from the Mesh menu or click button + in the toolbar. The following information will be displayed:

+ +

 

+ +

+ +

 

+ +

 

+ +

In case you get Mesh Infos via a TUI + script, the information is displayed in Python Console.

+ +

 

+ +

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/files/vtk_3d_viewer.htm b/doc/salome/gui/SMESH/files/vtk_3d_viewer.htm index e8ce5413c..6979fe96a 100755 --- a/doc/salome/gui/SMESH/files/vtk_3d_viewer.htm +++ b/doc/salome/gui/SMESH/files/vtk_3d_viewer.htm @@ -1,229 +1,265 @@ - - - - - -VTK 3D Viewer - - - - - - - - - - - -

VTK 3D Viewer

- -

VTK - 3D viewer is the default viewer for Mesh Module, allowing to visualize - meshes. It is also used in Post-Pro module for all 3D presentations except - for Gauss Points.

- -

 

- -

The functionalities of - VTK viewer are available via its Viewer Toolbar. Buttons marked with small - downward triangles have extended functionality which can be accessed by - locking on them with left mouse button.  

- -

 

- -

- -
    - -
  • Dump View - exports - an object from the viewer in bmp, png, jpg or jpeg image format.

  • - -
  • Show/Hide Trihedron - - shows or hides coordinate axes.

  • - -
  •  Fit - all - allows to select a point to be the center of a scene representing - all displayed objects in the visible area. -

  • - -
  •   Fit area - resizes - the view to place in the visible area only the contents of a frame drawn - with pressed left mouse button.

  • - -
  • Zoom -  allows - to zoom in and out.

  • - -
  • Panning - if the - represented objects are greater that the visible area and you don't wish - to use Fit all functionality, - click on this button and you'll be able to drag the scene to see its remote - parts.

  • - -
  • Global panning - - represents all displayed objects in the visible area.

  • - -
  • Rotation - allows - to rotate the selected object using the mouse.

  • - -
  • These buttons orientate the scene strictly about coordinate - axes.

  • - -
  • Reset - restores - the default position (isometric) of objects in the scene.

  • - -
  • Scaling - represents - objects deformed (stretched or stuffed) along the axes of coordinates

  • - -
  •  Graduated axes - allows - to define parameters of axes and graduate them.

  • -
- -

 

- -

- -
    - -
  • Axis name

  • - -
  • Is visible - if checked the axis name is displayed in - the viewer.

  • - -
  • Name - - allows to redefine the name of the axis.

  • - -
  • Font - - allows to define color and properties of the font of axis name.

  • - -
  • Labels -

  • - -
  • Is visible - if checked the labels are displayed in the - viewer.

  • - -
  • Number - - allows to define the number of labels.

  • - -
  • Offset - - allows to define the distance between labels.

  • - -
  • Font - - allows to define color and properties of the font of labels names.

  • - -
  • Tick marks

  • - -
  • Is visible - if checked the tick marks are displayed in - the viewer.

  • - -
  • Length - - allows to define the length of tick marks

  • - -
  • Is visible if - checked the axis is displayed in the viewer.

  • -
- - - - + + + + + +VTK 3D Viewer + + + + + + + + + + + +

VTK 3D Viewer

+ +

VTK + 3D viewer is the default viewer for Mesh Module, allowing to visualize + meshes. It is also used in Post-Pro module for all 3D presentations except + for Gauss Points.

+ +

 

+ +

The functionalities of + VTK viewer are available via its Viewer Toolbar. Buttons marked with small + downward triangles have extended functionality which can be accessed by + locking on them with left mouse button.  

+ +

 

+ +

+ +
    + +
  • Dump View - exports + an object from the viewer in bmp, png, jpg or jpeg image format.

  • + +
  • Show/Hide Trihedron + - shows or hides coordinate axes.

  • + +
  •  Fit + all - allows to select a point to be the center of a scene representing + all displayed objects in the visible area. +

  • + +
  •   Fit area - resizes + the view to place in the visible area only the contents of a frame drawn + with pressed left mouse button.

  • + +
  • Zoom -  allows + to zoom in and out.

  • + +
  • Panning - if the + represented objects are greater that the visible area and you don't wish + to use Fit all functionality, + click on this button and you'll be able to drag the scene to see its remote + parts.

  • + +
  • Global panning - + represents all displayed objects in the visible area.

  • + +
  • Change rotation point + - allows to to choose the point around which the rotation is performed

  • +
+ +

+ +

 

+ +

By default the rotation point is located + in the Center of the bounding box of an object.

+ +

 

+ +

+ +

 

+ +

Unchecking Use + Bounding Box Center box allows you to define the coordinates of + the rotation point manually.

+ +

 

+ +

Set to + Origin button restores the default rotation point coordinates.

+ +

Select + Point from View button allows to select the rotation point in the + 3D Viewer

+ +
    + +
  • Rotation - allows + to rotate the selected object using the mouse.

  • + +
  • These buttons orientate the scene strictly about coordinate + axes.

  • + +
  • Reset - restores + the default position (isometric) of objects in the scene.

  • + +
  • Scaling - represents + objects deformed (stretched or stuffed) along the axes of coordinates

  • + +
  •  Graduated axes - allows + to define parameters of axes and graduate them.

  • +
+ +

 

+ +

+ +
    + +
  • Axis name

  • + +
  • Is visible - if checked the axis name is displayed in + the viewer.

  • + +
  • Name + - allows to redefine the name of the axis.

  • + +
  • Font + - allows to define color and properties of the font of axis name.

  • + +
  • Labels +

  • + +
  • Is visible - if checked the labels are displayed in the + viewer.

  • + +
  • Number + - allows to define the number of labels.

  • + +
  • Offset + - allows to define the distance between labels.

  • + +
  • Font + - allows to define color and properties of the font of labels names.

  • + +
  • Tick marks

  • + +
  • Is visible - if checked the tick marks are displayed in + the viewer.

  • + +
  • Length + - allows to define the length of tick marks

  • + +
  • Is visible if + checked the axis is displayed in the viewer.

  • +
+ + + + diff --git a/doc/salome/gui/SMESH/files/warp.htm b/doc/salome/gui/SMESH/files/warp.htm index b5191bdbf..a67d0e2f3 100755 --- a/doc/salome/gui/SMESH/files/warp.htm +++ b/doc/salome/gui/SMESH/files/warp.htm @@ -1,156 +1,156 @@ - - - - - -Warp - - - - - - - - - - - - - -

Warping

- -

Warping indicates - that a face is not planar and is applied only to 2D elements with 4 nodes. - This quality control criterion is based on a projection plane created - by:

- -

1. bisecting the four element edges,

- -

2. creating a point on the plane at the vector - average of the corners, where the x-axis extends from the point to the - bisector on edge 2.

- -

The plane normal is in the direction of the - cross product of the x-axis and the vector from the origin to the bisector - of edge 3. Every corner of the quad will then be a distance “h” from the - plane. The length of each half edge is measured and the shortest length - is assigned “l”. The warp angle is the arcsine of the ratio of the projection - height “h” to the half edge length “l”.

- -

 

- -

- -

 

- -

 

- -

To apply the Warping quality criterion to your mesh:

- -

 

- -

1. Display your mesh in the viewer.

- -

 

- -

2. Choose Controls - > Warp or click button of the toolbar. Your mesh - will be displayed in the viewer with its elements colored according to - the applied mesh quality control criterion:

- -

 

- -

- -

 

- -

See Also - a sample TUI Script of a Warping - quality control operation.  

- -

 

- -

 

- - - - + + + + + +Warp + + + + + + + + + + + + + +

Warping

+ +

Warping indicates + that a face is not planar and is applied only to 2D elements with 4 nodes. + This quality control criterion is based on a projection plane created + by:

+ +

1. bisecting the four element edges,

+ +

2. creating a point on the plane at the vector + average of the corners, where the x-axis extends from the point to the + bisector on edge 2.

+ +

The plane normal is in the direction of the + cross product of the x-axis and the vector from the origin to the bisector + of edge 3. Every corner of the quad will then be a distance “h” from the + plane. The length of each half edge is measured and the shortest length + is assigned “l”. The warp angle is the arcsine of the ratio of the projection + height “h” to the half edge length “l”.

+ +

 

+ +

+ +

 

+ +

 

+ +

To apply the Warping quality criterion to your mesh:

+ +

 

+ +

1. Display your mesh in the viewer.

+ +

 

+ +

2. Choose Controls + > Warp or click button of the toolbar. Your mesh + will be displayed in the viewer with its elements colored according to + the applied mesh quality control criterion:

+ +

 

+ +

+ +

 

+ +

See Also + a sample TUI Script of a Warping + quality control operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/free_borders.htm b/doc/salome/gui/SMESH/free_borders.htm index abe1d0fa3..b262c9cd3 100755 --- a/doc/salome/gui/SMESH/free_borders.htm +++ b/doc/salome/gui/SMESH/free_borders.htm @@ -1,120 +1,120 @@ - - - - - -Free borders - - - - - - - - - - - - - -

Free borders

- -

This mesh quality control highlights borders of faces - consisting of edges belonging to one face only.

- -

 

- -

 

- -

 

- -

In this picture the free borders are displayed in white.

- -

 

- -

See Also - a sample TUI Script of a Free - Borders quality control operation.  

- -

 

- - - - + + + + + +Free borders + + + + + + + + + + + + + +

Free borders

+ +

This mesh quality control highlights borders of faces + consisting of edges belonging to one face only.

+ +

 

+ +

 

+ +

 

+ +

In this picture the free borders are displayed in white.

+ +

 

+ +

See Also + a sample TUI Script of a Free + Borders quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/free_edges.htm b/doc/salome/gui/SMESH/free_edges.htm index 52ea7f54a..fe7146d12 100755 --- a/doc/salome/gui/SMESH/free_edges.htm +++ b/doc/salome/gui/SMESH/free_edges.htm @@ -1,122 +1,122 @@ - - - - - -Free_edges - - - - - - - - - - - - - -

Free edges

- -

  This - mesh quality control highlights borders of  elements - of mesh consisting of edges belonging to one element of mesh only.

- -

 

- -

- -

 

- -

In this picture some elements of mesh have - been deleted and the "holes" are outlined in red.

- -

 

- -

See Also - a sample TUI Script of a Free - Edges quality control operation.  

- -

 

- - - - + + + + + +Free_edges + + + + + + + + + + + + + +

Free edges

+ +

  This + mesh quality control highlights borders of  elements + of mesh consisting of edges belonging to one element of mesh only.

+ +

 

+ +

+ +

 

+ +

In this picture some elements of mesh have + been deleted and the "holes" are outlined in red.

+ +

 

+ +

See Also + a sample TUI Script of a Free + Edges quality control operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/grouping_elements.htm b/doc/salome/gui/SMESH/grouping_elements.htm index 173e22108..0231e5df7 100755 --- a/doc/salome/gui/SMESH/grouping_elements.htm +++ b/doc/salome/gui/SMESH/grouping_elements.htm @@ -1,849 +1,662 @@ - - - - - -Grouping Elements - - - - - - - - - - - -

Grouping Elements

- -

Create a Standalone Group

- -

# Attention! This script has been written - using the old approach basing on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to create a standalone group.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# Get ids of all faces - with area > 100

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateArea()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor( - aFunctor )

- -

aPredicate.SetMargin( - 100 )

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate( - aPredicate )

- -

 

- -

anIds = aFilter.GetElementsId( - mesh )

- -

 

- -

 

- -

# create a group consisting - of faces with area > 100

- -

aGroup = mesh.CreateGroup( - SMESH.FACE, "Area > 100" )

- -

aGroup.Add( anIds - )

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

- -

Create a Group on Geometry

- -

import salome

- -

import geompy

- -

import smesh

- -

 

- -

# create a box

- -

box = geompy.MakeBox(0., - 0., 0., 100., 100., 100.)

- -

geompy.addToStudy(box, - "box")

- -

 

- -

# add the first face - of the box to the study

- -

subShapeList = geompy.SubShapeAll(box, - geompy.ShapeType["FACE"])

- -

face = subShapeList[0]

- -

geompy.addToStudyInFather(box, - face, "face 1")

- -

 

- -

# create group of edges - on the face

- -

aGeomGroupE = geompy.CreateGroup(face, - geompy.ShapeType["EDGE"])

- -

geompy.AddObject(aGeomGroupE, - 3)

- -

geompy.AddObject(aGeomGroupE, - 6)

- -

geompy.AddObject(aGeomGroupE, - 8)

- -

geompy.AddObject(aGeomGroupE, - 10)

- -

geompy.addToStudyInFather(face, - aGeomGroupE, "Group of Edges")

- -

 

- -

# create quadrangle - 2D mesh on the box

- -

quadra = smesh.Mesh(box, - "Box : quadrangle 2D mesh")

- -

algo1D = quadra.Segment()

- -

quadra.Quadrangle()

- -

algo1D.NumberOfSegments(7)

- -

 

- -

# compute the mesh

- -

quadra.Compute()

- -

 

- -

# create SMESH group - on the face with name "SMESHGroup1"

- -

aSmeshGroup1 = quadra.Group(face, - "SMESHGroup1")

- -

 

- -

# create SMESH group - on <aGeomGroupE> with default name

- -

aSmeshGroup2 = quadra.Group(aGeomGroupE)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

Edit a Group

- -

# Attention! This script has been written - using the old approach basing on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't - provide methods to edit a group.

- -

# In the next SALOME version the scripts - will be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# Get ids of all faces - with area > 35

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateArea()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(35.)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

print "Criterion: - Area > 35, Nb = ", len(anIds)

- -

 

- -

# create a group by - adding elements with area > 35

- -

aGroup = mesh.CreateGroup(SMESH.FACE, - "Area > 35")

- -

aGroup.Add(anIds)

- -

 

- -

# Get ids of all faces - with area > 40

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(40.)

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

anIds = aFilter.GetElementsId(mesh)

- -

print "Criterion: - Area > 40, Nb = ", len(anIds)

- -

 

- -

# create a group of - elements with area [35; 40] by removing elements with area > 40 from - group aGroup

- -

aGroup.Remove(anIds)

- -

 

- -

# print the result

- -

aGroupElemIDs = - aGroup.GetListOfID()

- -

print "Criterion: - 35 < Area < 40, Nb = ", len(aGroupElemIDs)

- -

j = 1

- -

for i in range(len(aGroupElemIDs)):

- -

  if - j > 20: j = 1; print ""

- -

  print - aGroupElemIDs[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

 

- -

Union of two groups

- -

# Attention! This script has been written - using the old approach basing on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to create a union of two groups.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import - SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : AREA - > 20

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(20.)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

print "Criterion: - Area > 20, Nb = ", len( anIds )

- -

 

- -

# create a group by - adding elements with area > 20

- -

aGroup1 = mesh.CreateGroup(SMESH.FACE, - "Area > 20")

- -

aGroup1.Add(anIds)

- -

 

- -

# Criterion : AREA - = 20

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateEqualTo()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(20.)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

print "Criterion: - Area = 20, Nb = ", len( anIds )

- -

 

- -

# create a group by - adding elements with area = 20

- -

aGroup2 = mesh.CreateGroup( - SMESH.FACE, "Area = 20" )

- -

aGroup2.Add(anIds)

- -

 

- -

# create union group - : area >= 20

- -

aGroup3 = mesh.UnionGroups(aGroup1, - aGroup2, "Area >= 20")

- -

print "Criterion: - Area >= 20, Nb = ", len(aGroup3.GetListOfID())

- -

 

- -

# Criterion : AREA - < 20

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateLessThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(20.)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

print "Criterion: - Area < 20, Nb = ", len(anIds)

- -

 

- -

# create a group by - adding elements with area < 20

- -

aGroup4 = mesh.CreateGroup(SMESH.FACE, - "Area < 20")

- -

aGroup4.Add(anIds)

- -

 

- -

# create union group - : area >= 20 and area < 20

- -

aGroup5 = mesh.UnionGroups(aGroup3, - aGroup4, "Any Area")

- -

print "Criterion: - Any Area, Nb = ", len(aGroup5.GetListOfID())

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

- -

 

- -

- -

 

- -

Intersection of two groups

- -

# Attention! This script has been written - using the old approach basing on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't - provide methods to create an intersection of two groups.

- -

# In the next SALOME version the scripts - will be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : AREA - > 20

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(20.)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

print "Criterion: - Area > 20, Nb = ", len(anIds)

- -

 

- -

# create a group by - adding elements with area > 20

- -

aGroup1 = mesh.CreateGroup(SMESH.FACE, - "Area > 20")

- -

aGroup1.Add(anIds)

- -

 

- -

# Criterion : AREA - < 60

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateLessThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(60)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

print "Criterion: - Area < 60, Nb = ", len(anIds)

- -

 

- -

# create a group by - adding elements with area < 60

- -

aGroup2 = mesh.CreateGroup(SMESH.FACE, - "Area < 60")

- -

aGroup2.Add(anIds)

- -

 

- -

# create an intersection - of groups : 20 < area < 60

- -

aGroup3 = mesh.IntersectGroups(aGroup1, - aGroup2, "20 < Area < 60")

- -

print "Criterion: - 20 < Area < 60, Nb = ", len(aGroup3.GetListOfID())

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

   

- -

Cut of two groups

- -

# Attention! This script has been written - using the old approach basing on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to create a cut of two groups.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Criterion : AREA - > 20

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(20.)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

print "Criterion: - Area > 20, Nb = ", len(anIds)

- -

 

- -

# create a group by - adding elements with area > 20

- -

aGroupMain = mesh.CreateGroup(SMESH.FACE, - "Area > 20")

- -

aGroupMain.Add(anIds)

- -

 

- -

# Criterion : AREA - < 60

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateLessThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(60.)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

print "Criterion: - Area < 60, Nb = ", len(anIds)

- -

 

- -

# create a group by - adding elements with area < 60

- -

aGroupTool = mesh.CreateGroup(SMESH.FACE, - "Area < 60")

- -

aGroupTool.Add(anIds)

- -

 

- -

# create a cut of groups - : area >= 60

- -

aGroupRes = mesh.CutGroups(aGroupMain, - aGroupTool, "Area >= 60")

- -

print "Criterion: - Area >= 60, Nb = ", len(aGroupRes.GetListOfID())

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

   

- - - - + + + + + +Grouping Elements + + + + + + + + + + + +

Grouping Elements

+ +

Create a Standalone Group

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# Get ids of all faces + with area > 100

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Area, smesh.FT_MoreThan, 100.)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter) +

+ +

 

+ +

# create a group consisting + of faces with area > 100

+ +

 

+ +

aGroup = mesh.MakeGroupByIds("Area + > 100", smesh.FACE, anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

+ +

Create a Group on Geometry

+ +

import salome

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create a box

+ +

box = geompy.MakeBox(0., + 0., 0., 100., 100., 100.)

+ +

geompy.addToStudy(box, + "box")

+ +

 

+ +

# add the first face + of the box to the study

+ +

subShapeList + = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])

+ +

face = subShapeList[0]

+ +

geompy.addToStudyInFather(box, + face, "face 1")

+ +

 

+ +

# create group of edges + on the face

+ +

aGeomGroupE + = geompy.CreateGroup(face, geompy.ShapeType["EDGE"])

+ +

geompy.AddObject(aGeomGroupE, + 3)

+ +

geompy.AddObject(aGeomGroupE, + 6)

+ +

geompy.AddObject(aGeomGroupE, + 8)

+ +

geompy.AddObject(aGeomGroupE, + 10)

+ +

geompy.addToStudyInFather(face, + aGeomGroupE, "Group of Edges")

+ +

 

+ +

# create quadrangle + 2D mesh on the box

+ +

quadra + = smesh.Mesh(box, "Box : quadrangle 2D mesh")

+ +

algo1D = quadra.Segment()

+ +

quadra.Quadrangle()

+ +

algo1D.NumberOfSegments(7) +

+ +

 

+ +

# compute the mesh

+ +

quadra.Compute()

+ +

 

+ +

# create SMESH group + on the face with name "SMESHGroup1"

+ +

aSmeshGroup1 + = quadra.GroupOnGeom(face, "SMESHGroup1")

+ +

 

+ +

# create SMESH group + on <aGeomGroupE> with default name

+ +

aSmeshGroup2 = quadra.GroupOnGeom(aGeomGroupE) +

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

Edit a Group

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# Get ids of all faces + with area > 35

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Area, smesh.FT_MoreThan, 35.)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter) +

+ +

 

+ +

print "Criterion: + Area > 35, Nb = ", len(anIds)

+ +

 

+ +

# create a group by + adding elements with area > 35

+ +

aGroup + = mesh.CreateEmptyGroup(smesh.FACE, "Area > 35")

+ +

aGroup.Add(anIds) +

+ +

 

+ +

# Get ids of all faces + with area > 40

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Area, smesh.FT_MoreThan, 40.)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

print "Criterion: + Area > 40, Nb = ", len(anIds)

+ +

 

+ +

# create a group of + elements with area [35; 40] by removing elements with area > 40 from + group aGroup

+ +

aGroup.Remove(anIds) +

+ +

 

+ +

# print the result

+ +

aGroupElemIDs = + aGroup.GetListOfID()

+ +

 

+ +

print "Criterion: + 35 < Area < 40, Nb = ", len(aGroupElemIDs)

+ +

j = 1

+ +

for i in range(len(aGroupElemIDs)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + aGroupElemIDs[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

 

+ +

Union of two groups

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# Criterion : AREA + > 20

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Area, smesh.FT_MoreThan, 20.)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

print "Criterion: + Area > 20, Nb = ", len( anIds )

+ +

 

+ +

# create a group by + adding elements with area > 20

+ +

aGroup1 = mesh.CreateEmptyGroup(SMESH.FACE, + "Area > 20")

+ +

aGroup1.Add(anIds)

+ +

 

+ +

# Criterion : AREA + = 20

+ +

aFilter + = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_EqualTo, 20.)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

print "Criterion: + Area = 20, Nb = ", len( anIds )

+ +

 

+ +

# create a group by + adding elements with area = 20

+ +

aGroup2 = mesh.CreateEmptyGroup( + smesh.FACE, "Area = 20" )

+ +

 

+ +

aGroup2.Add(anIds)

+ +

 

+ +

# create union group + : area >= 20

+ +

aGroup3 + = mesh.UnionGroups(aGroup1, aGroup2, "Area >= 20")

+ +

print "Criterion: + Area >= 20, Nb = ", len(aGroup3.GetListOfID())

+ +

 

+ +

# Criterion : AREA + < 20

+ +

aFilter + = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_LessThan, 20.)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

print "Criterion: + Area < 20, Nb = ", len(anIds)

+ +

 

+ +

# create a group by + adding elements with area < 20

+ +

aGroup4 + = mesh.CreateEmptyGroup(smesh.FACE, "Area < 20")

+ +

aGroup4.Add(anIds)

+ +

 

+ +

# create union group + : area >= 20 and area < 20

+ +

aGroup5 + = mesh.UnionGroups(aGroup3, aGroup4, "Any Area")

+ +

print "Criterion: + Any Area, Nb = ", len(aGroup5.GetListOfID())

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

+ +

 

+ +

+ +

 

+ +

Intersection of two groups

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# Criterion : AREA + > 20

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Area, smesh.FT_MoreThan, 20.)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

print "Criterion: + Area > 20, Nb = ", len(anIds)

+ +

 

+ +

# create a group by + adding elements with area > 20

+ +

aGroup1 = mesh.CreateEmptyGroup(SMESH.FACE, + "Area > 20")

+ +

aGroup1.Add(anIds)

+ +

 

+ +

# Criterion : AREA + < 60

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Area, smesh.FT_LessThan, 60.)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

print "Criterion: + Area < 60, Nb = ", len(anIds)

+ +

 

+ +

# create a group by + adding elements with area < 60

+ +

aGroup2 = mesh.CreateEmptyGroup(SMESH.FACE, + "Area < 60")

+ +

aGroup2.Add(anIds)

+ +

 

+ +

# create an intersection + of groups : 20 < area < 60

+ +

aGroup3 + = mesh.IntersectGroups(aGroup1, aGroup2, "20 < Area < 60")

+ +

print "Criterion: + 20 < Area < 60, Nb = ", len(aGroup3.GetListOfID())

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

   

+ +

Cut of two groups

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# Criterion : AREA + > 20

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Area, smesh.FT_MoreThan, 20.)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

print "Criterion: + Area > 20, Nb = ", len(anIds)

+ +

 

+ +

# create a group by + adding elements with area > 20

+ +

aGroupMain + = mesh.MakeGroupByIds("Area > 20", smesh.FACE, anIds)

+ +

 

+ +

# Criterion : AREA + < 60

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Area, smesh.FT_LessThan, 60.)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

print "Criterion: + Area < 60, Nb = ", len(anIds)

+ +

 

+ +

# create a group by + adding elements with area < 60

+ +

aGroupTool + = mesh.MakeGroupByIds("Area < 60", smesh.FACE, anIds)

+ +

 

+ +

# create a cut of groups + : area >= 60

+ +

aGroupRes + = mesh.CutGroups(aGroupMain, aGroupTool, "Area >= 60")

+ +

print "Criterion: + Area >= 60, Nb = ", len(aGroupRes.GetListOfID())

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

   

+ + + + diff --git a/doc/salome/gui/SMESH/image10.jpg b/doc/salome/gui/SMESH/image10.jpg index 5a15643bb019c662e2a22ef3c50db01b49ec66cb..14cea86187fe4e395d55cc30cf1ddb90bdd5b932 100755 GIT binary patch delta 12 UcmZ2pyR3G@XTHr}_%`bU04=8mkN^Mx delta 14 WcmZ2hyS#S8XFf*W&7b);>jMBa=mwnt diff --git a/doc/salome/gui/SMESH/image131.gif b/doc/salome/gui/SMESH/image131.gif index 8ca3453fdac083655fb3c9950eee1cad985b5c0d..dc6433146575445d3777b8a69c1077d533ed35b4 100755 GIT binary patch delta 12 UcmX>ha$ID?MCQ$tn76S303(eB00000 delta 14 WcmX>uazbRoL}o_b%@diou>k-n)CCOy diff --git a/doc/salome/gui/SMESH/image157.gif b/doc/salome/gui/SMESH/image157.gif new file mode 100644 index 0000000000000000000000000000000000000000..4592151720a9a42622a3c816b941054771ac6f7b GIT binary patch literal 5307 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 literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/image37.gif b/doc/salome/gui/SMESH/image37.gif index edd5263d85a207447082330eed7c63e2e33d233d..43592da643f1dcc10d026e35f1bdf971eec1f97c 100755 GIT binary patch delta 11 ScmaFK{(^l&F7xC(=4t>QI0SzH delta 13 UcmaFC{*rw|E;A$V<@i~s-t diff --git a/doc/salome/gui/SMESH/image7.jpg b/doc/salome/gui/SMESH/image7.jpg index cbd6170ee9f9fdd1078ce15363a6eee1ed9dc86d..ded3ae99a35200597497fb8f0a1ad3803ce276c0 100755 GIT binary patch delta 14 VcmaFU!ScF;WrL>MW-T|TeE>2U1~LEu delta 16 XcmaFe!SbeqWrL<0BkyKSH>Z67I)w&5 diff --git a/doc/salome/gui/SMESH/image71.jpg b/doc/salome/gui/SMESH/image71.jpg index cb1223d3895bfeb700592dfd27b64d20f6ef772b..bdb07ea6bab04466f5aa3a92191cff1485b68014 100755 GIT binary patch delta 12 TcmbOiH8*NQlGNs8sog>VBuNDs delta 14 VcmbOmH7{yIk`yEF<|L`zLI5hz1ttIh diff --git a/doc/salome/gui/SMESH/image74.gif b/doc/salome/gui/SMESH/image74.gif index c66029e7484cd22dcbdfddd29e9592812a56b299..db8a4c8cd10fe3f3e33103f3bddfb74954d58a32 100755 GIT binary patch delta 11 Scmcc3ev5sBGV^2==IsC)!UPKd delta 13 Ucmcb`ew%%RGBYFZWM$^<03bL77ytkO diff --git a/doc/salome/gui/SMESH/index.htm b/doc/salome/gui/SMESH/index.htm index 767e2b766..3163eee1b 100755 --- a/doc/salome/gui/SMESH/index.htm +++ b/doc/salome/gui/SMESH/index.htm @@ -1,180 +1,180 @@ - - -Mesh Module Reference Manual - - - - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/index_csh.htm b/doc/salome/gui/SMESH/index_csh.htm index 2bd1f6387..867d877c9 100755 --- a/doc/salome/gui/SMESH/index_csh.htm +++ b/doc/salome/gui/SMESH/index_csh.htm @@ -1,106 +1,106 @@ - - -Mesh Module Reference Manual - - - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/index_rhc.htm b/doc/salome/gui/SMESH/index_rhc.htm index 4e8723907..b751bd4c8 100755 --- a/doc/salome/gui/SMESH/index_rhc.htm +++ b/doc/salome/gui/SMESH/index_rhc.htm @@ -1,106 +1,106 @@ - - -Mesh Module Reference Manual - - - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/length.htm b/doc/salome/gui/SMESH/length.htm index d318cbe4a..db7b0ae0f 100755 --- a/doc/salome/gui/SMESH/length.htm +++ b/doc/salome/gui/SMESH/length.htm @@ -1,118 +1,118 @@ - - - - - -Length - - - - - - - - - - - - - -

Length

- -

The Length quality control criterion returns a value - of length of edge.

- -

 

- -

- -

 

- -

 

- -

See Also - a sample TUI Script of a  Length - quality control operation.  

- -

.

- - - - + + + + + +Length + + + + + + + + + + + + + +

Length

+ +

The Length quality control criterion returns a value + of length of edge.

+ +

 

+ +

+ +

 

+ +

 

+ +

See Also + a sample TUI Script of a  Length + quality control operation.  

+ +

.

+ + + + diff --git a/doc/salome/gui/SMESH/merge_elements.htm b/doc/salome/gui/SMESH/merge_elements.htm index 32b5ebfb8..f210b6af8 100755 --- a/doc/salome/gui/SMESH/merge_elements.htm +++ b/doc/salome/gui/SMESH/merge_elements.htm @@ -1,101 +1,101 @@ - - - - - -Merge Elements - - - - - - - - - - -

Merging Elements

- -

This functionality allows to merge coincident elements - of a mesh selectable in the dialog box.

- -

- -

In this picture you see a triangle which coincides with one of the elements - of the mesh. After we apply Merge Elements - functionality, the triangle will be completely merged with the mesh.

- -

- -

  See - Also a sample TUI Script of a Merge - Elements operation.  

- -

 

- -

 

- - - - + + + + + +Merge Elements + + + + + + + + + + +

Merging Elements

+ +

This functionality allows to merge coincident elements + of a mesh selectable in the dialog box.

+ +

+ +

In this picture you see a triangle which coincides with one of the elements + of the mesh. After we apply Merge Elements + functionality, the triangle will be completely merged with the mesh.

+ +

+ +

  See + Also a sample TUI Script of a Merge + Elements operation.  

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/mesh.htm b/doc/salome/gui/SMESH/mesh.htm index be7069d51..f849df81a 100755 --- a/doc/salome/gui/SMESH/mesh.htm +++ b/doc/salome/gui/SMESH/mesh.htm @@ -1,216 +1,216 @@ - - - - - -mesh - - - - - - - - - - - -

Introduction to MESH

- -

 

- -

MESH - module of SALOME is destined for:

- - - -

- -

for edges:

- -
    - - -
- -

for faces:

- -
    - - -
- -

for solids:

- -
    - - -
- -

.

- - - - + + + + + +mesh + + + + + + + + + + + +

Introduction to MESH

+ +

 

+ +

MESH + module of SALOME is destined for:

+ + + +

+ +

for edges:

+ +
    + + +
+ +

for faces:

+ +
    + + +
+ +

for solids:

+ +
    + + +
+ +

.

+ + + + diff --git a/doc/salome/gui/SMESH/modifying_meshes.htm b/doc/salome/gui/SMESH/modifying_meshes.htm index 7338481cc..7ed7089df 100755 --- a/doc/salome/gui/SMESH/modifying_meshes.htm +++ b/doc/salome/gui/SMESH/modifying_meshes.htm @@ -1,2022 +1,1752 @@ - - - - - -Modifying Meshes - - - - - - - - - - - -

Modifying Meshes

- -

Adding Nodes and Elements

- -

# Attention! The scripts for Adding nodes - and Elements  have - been written using the old approach basing on direct usage of SMESH idl - interface.

- -

# For the moment smesh package doesn't provide - methods to add nodes and elements.

- -

# - In the next SALOME version the scripts will be updated to use only the - commands from smesh package.

- -

Add Node

- -

import - SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

aMeshEditor = mesh.GetMeshEditor()

- -

 

- -

# add node

- -

new_id = aMeshEditor.AddNode(50, - 10, 0)

- -

print ""

- -

if new_id == 0: - print "KO node addition."

- -

else:           print - "New Node has been added with ID ", new_id

- -

 

- -

Add Edge

- -

import - SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

aMeshEditor = mesh.GetMeshEditor()

- -

print ""

- -

 

- -

# add node

- -

n1 = aMeshEditor.AddNode(50, - 10, 0)

- -

if n1 == 0: print - "KO node addition."

- -

 

- -

# add edge

- -

e1 = aMeshEditor.AddEdge([n1, - 38])

- -

if e1 == 0: print - "KO edge addition."

- -

else:       print - "New Edge has been added with ID ", e1

- -

 

- -

Add Triangle

- -

import - SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

aMeshEditor = mesh.GetMeshEditor()

- -

print ""

- -

 

- -

# add node

- -

n1 = aMeshEditor.AddNode(50, - 10, 0)

- -

if n1 == 0: print - "KO node addition."

- -

 

- -

# add triangle

- -

t1 = aMeshEditor.AddFace([n1, - 38, 39])

- -

if t1 == 0: print - "KO triangle addition."

- -

else:       print - "New Triangle has been added with ID ", t1

- -

Add Quadrangle

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

aMeshEditor = mesh.GetMeshEditor()

- -

print ""

- -

 

- -

# add node

- -

n1 = aMeshEditor.AddNode(50, - 10, 0)

- -

if n1 == 0: print - "KO node addition."

- -

 

- -

n2 = aMeshEditor.AddNode(40, - 20, 0)

- -

if n2 == 0: print - "KO node addition."

- -

 

- -

# add quadrangle

- -

q1 = aMeshEditor.AddFace([n2, - n1, 38, 39])

- -

if q1 == 0: print - "KO quadrangle addition."

- -

else: -       print - "New Quadrangle has been added with ID ", q1

- -

Add Tetrahedron

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

aMeshEditor = mesh.GetMeshEditor()

- -

print ""

- -

 

- -

# add node

- -

n1 = aMeshEditor.AddNode(50, - 10, 0)

- -

if n1 == 0: print - "KO node addition."

- -

 

- -

# add tetrahedron

- -

t1 = aMeshEditor.AddVolume([n1, - 38, 39, 246])

- -

if t1 == 0: print - "KO tetrahedron addition."

- -

else: -       print - "New Tetrahedron has been added with ID ", t1

- -

Add Hexahedron

- -

import - SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

aMeshEditor = mesh.GetMeshEditor()

- -

print ""

- -

 

- -

# add nodes

- -

nId1 = aMeshEditor.AddNode(50, - 10, 0)

- -

nId2 = aMeshEditor.AddNode(47, - 12, 0)

- -

nId3 = aMeshEditor.AddNode(50, - 10, 10)

- -

nId4 = aMeshEditor.AddNode(47, - 12, 10)

- -

 

- -

if nId1 == 0 or - nId2 == 0 or nId3 == 0 or nId4 == 0: print "KO node addition."

- -

 

- -

# add hexahedron

- -

vId = aMeshEditor.AddVolume([nId2, - nId1, 38, 39, nId4, nId3, 245, 246])

- -

if vId == 0: print - "KO Hexahedron addition."

- -

else:        print - "New Hexahedron has been added with ID ", vId

- -

 

- -

Add Polygon

- -

import - math

- -

import salome

- -

import smesh

- -

 

- -

# create an empty mesh - structure

- -

gen = smesh.smesh

- -

mesh = gen.CreateEmptyMesh()

- -

MeshEditor = mesh.GetMeshEditor()

- -

 

- -

# a method to build - a polygonal mesh element with <nb_vert> angles:

- -

def MakePolygon - (a_mesh, x0, y0, z0, radius, nb_vert):

- -

    al - = 2.0 * math.pi / nb_vert

- -

    node_ids - = []

- -

 

- -

          # - Create nodes for a polygon

- -

    for - ii in range(nb_vert):

- -

        nid - = MeshEditor.AddNode(x0 + radius * math.cos(ii*al),

- -

                                 y0 - + radius * math.sin(ii*al),

- -

                                 z0)

- -

        node_ids.append(nid)

- -

        pass

- -

 

- -

          # - Create a polygon

- -

    return - MeshEditor.AddPolygonalFace(node_ids)

- -

 

- -

# Create three polygons

- -

f1 = MakePolygon(mesh, - 0, 0,  0, - 30, 13)

- -

f2 = MakePolygon(mesh, - 0, 0, 10, 21,  9)

- -

f3 = MakePolygon(mesh, - 0, 0, 20, 13,  6)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

Add Polyhedron

- -

import - salome

- -

import math

- -

import smesh

- -

 

- -

# create an empty mesh - structure

- -

gen = smesh.smesh

- -

mesh = gen.CreateEmptyMesh()

- -

MeshEditor = mesh.GetMeshEditor()

- -

 

- -

# Create nodes for - 12-hedron with pentagonal faces

- -

al = 2 * math.pi - / 5.0

- -

cosal = math.cos(al)

- -

aa = 13

- -

rr = aa / (2.0 * - math.sin(al/2.0))

- -

dr = 2.0 * rr * - cosal

- -

r1 = rr + dr

- -

dh = rr * math.sqrt(2.0 - * (1.0 - cosal * (1.0 + 2.0 * cosal)))

- -

hh = 2.0 * dh - - dr * (rr*(cosal - 1) + (rr + dr)*(math.cos(al/2) - 1)) / dh

- -

 

- -

dd = [] # - top

- -

cc = [] # - below top

- -

bb = [] # - above bottom

- -

aa = [] # - bottom

- -

 

- -

for i in range(5):

- -

    cos_bot - = math.cos(i*al)

- -

    sin_bot - = math.sin(i*al)

- -

 

- -

    cos_top - = math.cos(i*al + al/2.0)

- -

    sin_top - = math.sin(i*al + al/2.0)

- -

 

- -

    nd - = MeshEditor.AddNode(rr * cos_top, rr * sin_top, hh     ) - # top

- -

    nc - = MeshEditor.AddNode(r1 * cos_top, r1 * sin_top, hh - dh) # - below top

- -

    nb - = MeshEditor.AddNode(r1 * cos_bot, r1 * sin_bot,      dh) - # above bottom

- -

    na - = MeshEditor.AddNode(rr * cos_bot, rr * sin_bot,       0) - # bottom

- -

    dd.append(nd) - # top

- -

    cc.append(nc) - # below top

- -

    bb.append(nb) - # above bottom

- -

    aa.append(na) - # bottom

- -

 

- -

    pass

- -

 

- -

# Create a polyhedral - volume (12-hedron with pentagonal faces)

- -

MeshEditor.AddPolyhedralVolume([dd[0], - dd[1], dd[2], dd[3], dd[4],  # - top

- -

                                dd[0], - cc[0], bb[1], cc[1], dd[1],  # - -

- -

                                dd[1], - cc[1], bb[2], cc[2], dd[2],  # - -

- -

                                dd[2], - cc[2], bb[3], cc[3], dd[3],  # - - below top

- -

                                dd[3], - cc[3], bb[4], cc[4], dd[4],  # - -

- -

                                dd[4], - cc[4], bb[0], cc[0], dd[0],  # - -

- -

                                aa[4], - bb[4], cc[4], bb[0], aa[0],  # - .

- -

                                aa[3], - bb[3], cc[3], bb[4], aa[4],  # - .

- -

                                aa[2], - bb[2], cc[2], bb[3], aa[3],  # - . above bottom

- -

                                aa[1], - bb[1], cc[1], bb[2], aa[2],  # - .

- -

                                aa[0], - bb[0], cc[0], bb[1], aa[1],  # - .

- -

                                aa[0], - aa[1], aa[2], aa[3], aa[4]], # - bottom

- -

                               [5,5,5,5,5,5,5,5,5,5,5,5])

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Removing Nodes and Elements

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to remove nodes and elements.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

Removing Nodes

- -

 

- -

import - SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

aMeshEditor = mesh.GetMeshEditor()

- -

 

- -

# remove nodes #246 - and #255

- -

res = aMeshEditor.RemoveNodes([246, - 255])

- -

if res == 1: print - "Nodes removing is OK!"

- -

else:        print - "KO nodes removing."

- -

 

- -

Removing Elements

- -

import - SMESH_mechanic

- -

mesh = SMESH_mechanic.mesh

- -

 

- -

anEditor = mesh.GetMeshEditor()

- -

 

- -

# remove three elements: - #850, #859 and #814

- -

res = anEditor.RemoveElements([850, - 859, 814])

- -

if res == 1: print - "Elements removing is OK!"

- -

else:        print - "KO Elements removing."  

- -

 

- -

Renumbering Nodes and Elements

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to renumber nodes and elements.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

anEditor = mesh.GetMeshEditor()

- -

 

- -

anEditor.RenumberNodes() -

- -

Moving Nodes

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to move nodes.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

aMeshEditor = mesh.GetMeshEditor()

- -

 

- -

# move node #38

- -

aMeshEditor.MoveNode(38, - 20., 10., 0.)

- -

 

- -

Diagonal Inversion

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to produce a diagonal inversion.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import smesh

- -

 

- -

# create an empty mesh - structure

- -

gen = smesh.smesh

- -

mesh = gen.CreateEmptyMesh()

- -

aMeshEditor = mesh.GetMeshEditor()

- -

 

- -

# create the following - mesh:

- -

# .----.----.----.

- -

# |   /| -   /| -   /|

- -

# |  / - |  / |  / - |

- -

# | /  | - /  | /  |

- -

# |/   |/ -   |/ -   |

- -

# .----.----.----.

- -

 

- -

bb = [0, 0, 0, 0]

- -

tt = [0, 0, 0, 0]

- -

ff = [0, 0, 0, 0, - 0, 0]

- -

 

- -

bb[0] = aMeshEditor.AddNode( - 0., 0., 0.)

- -

bb[1] = aMeshEditor.AddNode(10., - 0., 0.)

- -

bb[2] = aMeshEditor.AddNode(20., - 0., 0.)

- -

bb[3] = aMeshEditor.AddNode(30., - 0., 0.)

- -

 

- -

tt[0] = aMeshEditor.AddNode( - 0., 15., 0.)

- -

tt[1] = aMeshEditor.AddNode(10., - 15., 0.)

- -

tt[2] = aMeshEditor.AddNode(20., - 15., 0.)

- -

tt[3] = aMeshEditor.AddNode(30., - 15., 0.)

- -

 

- -

ff[0] = aMeshEditor.AddFace([bb[0], - bb[1], tt[1]])

- -

ff[1] = aMeshEditor.AddFace([bb[0], - tt[1], tt[0]])

- -

ff[2] = aMeshEditor.AddFace([bb[1], - bb[2], tt[2]])

- -

ff[3] = aMeshEditor.AddFace([bb[1], - tt[2], tt[1]])

- -

ff[4] = aMeshEditor.AddFace([bb[2], - bb[3], tt[3]])

- -

ff[5] = aMeshEditor.AddFace([bb[2], - tt[3], tt[2]])

- -

 

- -

# inverse the diagonal - bb[1] - tt[2]

- -

print "\nDiagonal - inversion ... ",

- -

res = aMeshEditor.InverseDiag(bb[1], - tt[2])

- -

if not res: print - "failed!"

- -

else:       print - "done."

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

Uniting two Triangles

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to unite two triangles.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import smesh

- -

 

- -

# create an empty mesh structure

- -

gen = smesh.smesh

- -

mesh = gen.CreateEmptyMesh()

- -

aMeshEditor = mesh.GetMeshEditor()

- -

 

- -

# create the following mesh:

- -

# .----.----.----.

- -

# |   /| -   /| -   /|

- -

# |  / - |  / |  / - |

- -

# | /  | - /  | /  |

- -

# |/   |/ -   |/ -   |

- -

# .----.----.----.

- -

 

- -

bb = [0, 0, 0, 0]

- -

tt = [0, 0, 0, 0]

- -

ff = [0, 0, 0, 0, - 0, 0]

- -

 

- -

bb[0] = aMeshEditor.AddNode( - 0., 0., 0.)

- -

bb[1] = aMeshEditor.AddNode(10., - 0., 0.)

- -

bb[2] = aMeshEditor.AddNode(20., - 0., 0.)

- -

bb[3] = aMeshEditor.AddNode(30., - 0., 0.)

- -

 

- -

tt[0] = aMeshEditor.AddNode( - 0., 15., 0.)

- -

tt[1] = aMeshEditor.AddNode(10., - 15., 0.)

- -

tt[2] = aMeshEditor.AddNode(20., - 15., 0.)

- -

tt[3] = aMeshEditor.AddNode(30., - 15., 0.)

- -

 

- -

ff[0] = aMeshEditor.AddFace([bb[0], - bb[1], tt[1]])

- -

ff[1] = aMeshEditor.AddFace([bb[0], - tt[1], tt[0]])

- -

ff[2] = aMeshEditor.AddFace([bb[1], - bb[2], tt[2]])

- -

ff[3] = aMeshEditor.AddFace([bb[1], - tt[2], tt[1]])

- -

ff[4] = aMeshEditor.AddFace([bb[2], - bb[3], tt[3]])

- -

ff[5] = aMeshEditor.AddFace([bb[2], - tt[3], tt[2]])

- -

 

- -

# delete the diagonal bb[1] - tt[2]

- -

print "\nUnite - two triangles ... ",

- -

res = aMeshEditor.DeleteDiag(bb[1], - tt[2])

- -

if not res: print - "failed!"

- -

else:       print - "done."

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

Uniting a Set of Triangles

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to unite a set of triangles.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import smesh

- -

 

- -

# create an empty mesh - structure

- -

gen = smesh.smesh

- -

mesh = gen.CreateEmptyMesh()

- -

aMeshEditor = mesh.GetMeshEditor()

- -

 

- -

# create the following - mesh:

- -

# .----.----.----.

- -

# |   /| -   /| -   /|

- -

# |  / - |  / |  / - |

- -

# | /  | - /  | /  |

- -

# |/   |/ -   |/ -   |

- -

# .----.----.----.

- -

 

- -

bb = [0, 0, 0, 0]

- -

tt = [0, 0, 0, 0]

- -

ff = [0, 0, 0, 0, - 0, 0]

- -

 

- -

bb[0] = aMeshEditor.AddNode( - 0., 0., 0.)

- -

bb[1] = aMeshEditor.AddNode(10., - 0., 0.)

- -

bb[2] = aMeshEditor.AddNode(20., - 0., 0.)

- -

bb[3] = aMeshEditor.AddNode(30., - 0., 0.)

- -

 

- -

tt[0] = aMeshEditor.AddNode( - 0., 15., 0.)

- -

tt[1] = aMeshEditor.AddNode(10., - 15., 0.)

- -

tt[2] = aMeshEditor.AddNode(20., - 15., 0.)

- -

tt[3] = aMeshEditor.AddNode(30., - 15., 0.)

- -

 

- -

ff[0] = aMeshEditor.AddFace([bb[0], - bb[1], tt[1]])

- -

ff[1] = aMeshEditor.AddFace([bb[0], - tt[1], tt[0]])

- -

ff[2] = aMeshEditor.AddFace([bb[1], - bb[2], tt[2]])

- -

ff[3] = aMeshEditor.AddFace([bb[1], - tt[2], tt[1]])

- -

ff[4] = aMeshEditor.AddFace([bb[2], - bb[3], tt[3]])

- -

ff[5] = aMeshEditor.AddFace([bb[2], - tt[3], tt[2]])

- -

 

- -

# unite a set of triangles

- -

aFilterMgr = smesh.smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateMinimumAngle()

- -

print "\nUnite - a set of triangles ... ",

- -

res = aMeshEditor.TriToQuad([ff[2], - ff[3], ff[4], ff[5]], aFunctor, 60.)

- -

if not res: print - "failed!"

- -

else:       print - "done."

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

Orientation

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to change orientation.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import smesh

- -

 

- -

# SMESH module

- -

gen = smesh.smesh

- -

mesh = gen.CreateEmptyMesh()

- -

MeshEditor = mesh.GetMeshEditor()

- -

 

- -

# build five quadrangles:

- -

dx = 10

- -

dy = 20

- -

 

- -

n1  = - MeshEditor.AddNode(0.0 * dx, 0, 0)

- -

n2  = - MeshEditor.AddNode(1.0 * dx, 0, 0)

- -

n3  = - MeshEditor.AddNode(2.0 * dx, 0, 0)

- -

n4  = - MeshEditor.AddNode(3.0 * dx, 0, 0)

- -

n5  = - MeshEditor.AddNode(4.0 * dx, 0, 0)

- -

n6  = - MeshEditor.AddNode(5.0 * dx, 0, 0)

- -

n7  = - MeshEditor.AddNode(0.0 * dx, dy, 0)

- -

n8  = - MeshEditor.AddNode(1.0 * dx, dy, 0)

- -

n9  = - MeshEditor.AddNode(2.0 * dx, dy, 0)

- -

n10 = MeshEditor.AddNode(3.0 - * dx, dy, 0)

- -

n11 = MeshEditor.AddNode(4.0 - * dx, dy, 0)

- -

n12 = MeshEditor.AddNode(5.0 - * dx, dy, 0)

- -

 

- -

f1 = MeshEditor.AddFace([n1, - n2, n8 , n7 ])

- -

f2 = MeshEditor.AddFace([n2, - n3, n9 , n8 ])

- -

f3 = MeshEditor.AddFace([n3, - n4, n10, n9 ])

- -

f4 = MeshEditor.AddFace([n4, - n5, n11, n10])

- -

f5 = MeshEditor.AddFace([n5, - n6, n12, n11])

- -

 

- -

# Change the orientation - of the second and the fourth faces.

- -

MeshEditor.Reorient([2, - 4])

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Cutting Quadrangles

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to cut quadrangles.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh = SMESH_mechanic.smesh

- -

mesh  = - SMESH_mechanic.mesh

- -

 

- -

# cut two quadrangles: - 405 and 406

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateMinimumAngle()

- -

 

- -

aMeshEditor = mesh.GetMeshEditor()

- -

aMeshEditor.QuadToTri([405, - 406], aFunctor)

- -

 

- -

Smoothing

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to perform smoothing.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import geompy

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

aMeshEditor = mesh.GetMeshEditor()

- -

 

- -

# select the top face

- -

faces = geompy.SubShapeAllSorted(SMESH_mechanic.shape_mesh, - geompy.ShapeType["FACE"])

- -

face = faces[3]

- -

geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, - face, "face planar with hole")

- -

 

- -

# create a group of faces - to be smoothed

- -

GroupSmooth = mesh.CreateGroupFromGEOM(SMESH.FACE, - "Group of faces (smooth)", face)

- -

 

- -

# perform smoothing

- -

# boolean SmoothObject(Object, - IDsOfFixedNodes, MaxNbOfIterations, MaxAspectRatio, Method)

- -

res = aMeshEditor.SmoothObject(GroupSmooth, - [], 20, 2., SMESH.SMESH_MeshEditor.CENTROIDAL_SMOOTH)

- -

 

- -

print "\nSmoothing - ... ",

- -

if not res: print - "failed!"

- -

else:       print - "done."

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Extrusion

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to perform extrusion.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import geompy

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

aMeshEditor = mesh.GetMeshEditor()

- -

 

- -

# select the top face

- -

faces = geompy.SubShapeAllSorted(SMESH_mechanic.shape_mesh, - geompy.ShapeType["FACE"])

- -

face = faces[7]

- -

geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, - face, "face circular top")

- -

 

- -

# create a vector for - extrusion

- -

point = SMESH.PointStruct(0., - 0., 5.)

- -

vector = SMESH.DirStruct(point)

- -

 

- -

# create a group to be - extruded

- -

GroupTri = mesh.CreateGroupFromGEOM(SMESH.FACE, - "Group of faces (extrusion)", face)

- -

 

- -

# perform extrusion of - the group

- -

aMeshEditor.ExtrusionSweepObject(GroupTri, - vector, 5)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

Extrusion along a Path

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to perform extrusion along a path.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import math

- -

import salome

- -

 

- -

# Geometry

- -

import geompy

- -

 

- -

# 1. Create points

- -

points = [[0, 0], - [50, 30], [50, 110], [0, 150], [-80, 150], [-130, 70], [-130, -20]]

- -

 

- -

iv = 1

- -

vertices = []

- -

for point in points:

- -

vert - = geompy.MakeVertex(point[0], point[1], 0)

- -

geompy.addToStudy(vert, - "Vertex_" + `iv`)

- -

vertices.append(vert)

- -

iv - += 1

- -

pass

- -

 

- -

# 2. Create edges and - wires

- -

Edge_straight = geompy.MakeEdge(vertices[0], - vertices[4])

- -

Edge_bezierrr = geompy.MakeBezier(vertices)

- -

Wire_polyline = geompy.MakePolyline(vertices)

- -

Edge_Circle   = - geompy.MakeCircleThreePnt(vertices[0], vertices[1], vertices[2])

- -

 

- -

geompy.addToStudy(Edge_straight, - "Edge_straight")

- -

geompy.addToStudy(Edge_bezierrr, - "Edge_bezierrr")

- -

geompy.addToStudy(Wire_polyline, - "Wire_polyline")

- -

geompy.addToStudy(Edge_Circle -  , "Edge_Circle")

- -

 

- -

# 3. Explode wire on - edges, as they will be used for mesh extrusion

- -

Wire_polyline_edges - = geompy.SubShapeAll(Wire_polyline, geompy.ShapeType["EDGE"])

- -

for ii in range(len(Wire_polyline_edges)):

- -

geompy.addToStudyInFather(Wire_polyline, - Wire_polyline_edges[ii], "Edge_" + `ii + 1`)

- -

pass

- -

 

- -

# Mesh

- -

import smesh

- -

import SMESH

- -

 

- -

gen = smesh.smesh

- -

 

- -

smeshgui = salome.ImportComponentGUI("SMESH")

- -

smeshgui.Init(salome.myStudyId)

- -

 

- -

# 1D algorithm and three - 1D hypotheses

- -

Wire_discretisation - = gen.CreateHypothesis('Regular_1D', 'libStdMeshersEngine.so')

- -

 

- -

Nb_Segments_3 = gen.CreateHypothesis('NumberOfSegments', - 'libStdMeshersEngine.so')

- -

Nb_Segments_7 = gen.CreateHypothesis('NumberOfSegments', - 'libStdMeshersEngine.so')

- -

Nb_Segments_8 = gen.CreateHypothesis('NumberOfSegments', - 'libStdMeshersEngine.so')

- -

 

- -

Nb_Segments_3.SetNumberOfSegments(3)

- -

Nb_Segments_7.SetNumberOfSegments(7)

- -

Nb_Segments_8.SetNumberOfSegments(8)

- -

 

- -

# Mesh given shape with - given 1d hypothesis

- -

def Mesh1D(shape1d, - hyp1d, name):

- -

mesh1d_tool - = smesh.Mesh(shape1d)

- -

mesh1d - = mesh1d_tool.GetMesh()

- -

status - = mesh1d.AddHypothesis(shape1d, hyp1d)

- -

status - = mesh1d.AddHypothesis(shape1d, Wire_discretisation)

- -

isDone - = mesh1d_tool.Compute()

- -

if - not isDone: print 'Mesh ', name, ': computation failed'

- -

return - mesh1d

- -

 

- -

# Create a mesh with - six nodes, seven edges and two quadrangle faces

- -

def MakeQuadMesh2(mesh_name):

- -

quad_1 - = gen.CreateEmptyMesh()

- -

smeshgui.SetName(salome.ObjectToID(quad_1), - mesh_name)

- -

editor_1 - = quad_1.GetMeshEditor()

- -

 

- -

# six nodes

- -

n1 - = editor_1.AddNode(0, 20, 10)

- -

n2 - = editor_1.AddNode(0, 40, 10)

- -

n3 - = editor_1.AddNode(0, 40, 30)

- -

n4 - = editor_1.AddNode(0, 20, 30)

- -

n5 - = editor_1.AddNode(0,  0, - 30)

- -

n6 - = editor_1.AddNode(0,  0, - 10)

- -

 

- -

# seven edges

- -

editor_1.AddEdge([n1, - n2]) # 1

- -

editor_1.AddEdge([n2, - n3]) # 2

- -

editor_1.AddEdge([n3, - n4]) # 3

- -

editor_1.AddEdge([n4, - n1]) # 4

- -

editor_1.AddEdge([n4, - n5]) # 5

- -

editor_1.AddEdge([n5, - n6]) # 6

- -

editor_1.AddEdge([n6, - n1]) # 7

- -

 

- -

# two quadrangle faces

- -

editor_1.AddFace([n1, - n2, n3, n4]) # 8

- -

editor_1.AddFace([n1, - n4, n5, n6]) # 9

- -

return - [quad_1, editor_1, [1,2,3,4,5,6,7], [8,9]]

- -

 

- -

# Path meshes

- -

Edge_straight_mesh - = Mesh1D(Edge_straight, Nb_Segments_7, "Edge_straight")

- -

Edge_bezierrr_mesh - = Mesh1D(Edge_bezierrr, Nb_Segments_7, "Edge_bezierrr")

- -

Wire_polyline_mesh - = Mesh1D(Wire_polyline, Nb_Segments_3, "Wire_polyline")

- -

Edge_Circle_mesh   = - Mesh1D(Edge_Circle  , - Nb_Segments_8, "Edge_Circle")

- -

 

- -

# Initial meshes (to - be extruded)

- -

[quad_1, editor_1, - ee_1, ff_1] = MakeQuadMesh2("quad_1")

- -

[quad_2, editor_2, - ee_2, ff_2] = MakeQuadMesh2("quad_2")

- -

[quad_3, editor_3, - ee_3, ff_3] = MakeQuadMesh2("quad_3")

- -

[quad_4, editor_4, - ee_4, ff_4] = MakeQuadMesh2("quad_4")

- -

[quad_5, editor_5, - ee_5, ff_5] = MakeQuadMesh2("quad_5")

- -

[quad_6, editor_6, - ee_6, ff_6] = MakeQuadMesh2("quad_6")

- -

[quad_7, editor_7, - ee_7, ff_7] = MakeQuadMesh2("quad_7")

- -

 

- -

# ExtrusionAlongPath

- -

# IDsOfElements, PathMesh, - PathShape, NodeStart,

- -

# HasAngles, Angles, - HasRefPoint, RefPoint

- -

 

- -

refPoint = SMESH.PointStruct(0, - 0, 0)

- -

 

- -

a10 = 10.0*math.pi/180.0

- -

a45 = 45.0*math.pi/180.0

- -

 

- -

# 1. Extrusion of two - mesh edges along a straight path

- -

error = editor_1.ExtrusionAlongPath([1,2], - Edge_straight_mesh, Edge_straight, 1,

- -

    0, - [], 0, refPoint)

- -

 

- -

# 2. Extrusion of one - mesh edge along a curved path

- -

error = editor_2.ExtrusionAlongPath([2], - Edge_bezierrr_mesh, Edge_bezierrr, 1,

- -

    0, - [], 0, refPoint)

- -

 

- -

# 3. Extrusion of one - mesh edge along a curved path with usage of angles

- -

error = editor_3.ExtrusionAlongPath([2], - Edge_bezierrr_mesh, Edge_bezierrr, 1,

- -

    1, - [a45, a45, a45, 0, -a45, -a45, -a45], 0, refPoint)

- -

 

- -

# 4. Extrusion of one - mesh edge along the path, which is a part of a meshed wire

- -

error = editor_4.ExtrusionAlongPath([4], - Wire_polyline_mesh, Wire_polyline_edges[0], 1,

- -

    1, - [a10, a10, a10], 0, refPoint)

- -

 

- -

# 5. Extrusion of two - mesh faces along the path, which is a part of a meshed wire

- -

error = editor_5.ExtrusionAlongPath(ff_5 - , Wire_polyline_mesh, Wire_polyline_edges[2], 4,

- -

    0, - [], 0, refPoint)

- -

 

- -

# 6. Extrusion of two - mesh faces along a closed path

- -

error = editor_6.ExtrusionAlongPath(ff_6 - , Edge_Circle_mesh, Edge_Circle, 1,

- -

    0, - [], 0, refPoint)

- -

 

- -

# 7. Extrusion of two - mesh faces along a closed path with usage of angles

- -

error = editor_7.ExtrusionAlongPath(ff_7, - Edge_Circle_mesh, Edge_Circle, 1,

- -

    1, - [a45, -a45, a45, -a45, a45, -a45, a45, -a45], 0, refPoint

- -

 

- -

salome.sg.updateObjBrowser(1)

- -

Revolution

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to perform revolution.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import math

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

aMeshEditor = mesh.GetMeshEditor()

- -

 

- -

# create a group of faces - to be revolved

- -

FacesRotate = [492, - 493, 502, 503]

- -

GroupRotate = mesh.CreateGroup(SMESH.FACE,"Group - of faces (rotate)")

- -

GroupRotate.Add(FacesRotate)

- -

 

- -

# define revolution angle - and axis

- -

angle45 = 45 * math.pi - / 180

- -

axisXYZ = SMESH.AxisStruct(-38.3128, - -73.3658, -23.321, -13.3402, -13.3265, 6.66632)

- -

 

- -

# perform revolution - of an object

- -

aMeshEditor.RotationSweepObject(GroupRotate, - axisXYZ, angle45, 4, 1e-5)

- -

 

- -

Pattern Mapping

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to perform pattern mapping.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import geompy

- -

import smesh

- -

 

- -

# define the geometry

- -

Box_1 = geompy.MakeBoxDXDYDZ(200., - 200., 200.)

- -

geompy.addToStudy(Box_1, - "Box_1")

- -

 

- -

faces = geompy.SubShapeAll(Box_1, - geompy.ShapeType["FACE"])

- -

Face_1 = faces[0]

- -

Face_2 = faces[1]

- -

geompy.addToStudyInFather(Box_1, - Face_1, "Face_1")

- -

geompy.addToStudyInFather(Box_1, - Face_2, "Face_2")

- -

 

- -

# build a quadrangle - mesh 3x3 on Face_1

- -

Mesh_1 = smesh.Mesh(Face_1)

- -

algo1D = Mesh_1.Segment()

- -

algo1D.NumberOfSegments(3)

- -

Mesh_1.Quadrangle()

- -

 

- -

isDone = Mesh_1.Compute()

- -

if not isDone: print - 'Mesh Mesh_1 : computation failed'

- -

 

- -

# build a triangle mesh - on Face_2

- -

Mesh_2 = smesh.Mesh(Face_2)

- -

algo1D = Mesh_2.Segment()

- -

algo1D.NumberOfSegments(1)

- -

algo2D = Mesh_2.Triangle()

- -

algo2D.MaxElementArea(240)

- -

isDone = Mesh_2.Compute()

- -

if not isDone: print - 'Mesh Mesh_2 : computation failed'

- -

 

- -

# create a pattern

- -

pattern = smesh.smesh.GetPattern()

- -

isDone = pattern.LoadFromFace(Mesh_2.GetMesh(), - Face_2, 0)

- -

if (isDone != 1): - print 'LoadFromFace :', pattern.GetErrorCode()

- -

 

- -

# apply the pattern to - a face of the first mesh

- -

pattern.ApplyToMeshFaces(Mesh_1.GetMesh(), - [17], 0, 0)

- -

isDone = pattern.MakeMesh(Mesh_1.GetMesh(), - 0, 0)

- -

if (isDone != 1): - print 'MakeMesh :', pattern.GetErrorCode()

- -

 

- -

 

- - - - + + + + + +Modifying Meshes + + + + + + + + + + + +

Modifying Meshes

+ +

Adding Nodes and Elements

+ +

Add Node

+ +

import SMESH_mechanic

+ +

 

+ +

mesh = SMESH_mechanic.mesh

+ +

 

+ +

# add node

+ +

new_id + = mesh.AddNode(50, 10, 0)

+ +

print ""

+ +

if new_id == 0: + print "KO node addition."

+ +

else:           print + "New Node has been added with ID ", new_id  

+ +

 

+ +

Add Edge

+ +

import SMESH_mechanic

+ +

 

+ +

mesh = SMESH_mechanic.mesh

+ +

print ""

+ +

 

+ +

# add node

+ +

n1 + = mesh.AddNode(50, 10, 0)

+ +

if n1 == 0: print + "KO node addition."

+ +

 

+ +

# add edge

+ +

e1 + = mesh.AddEdge([n1, 38])

+ +

if e1 == 0: print + "KO edge addition."

+ +

else:       print + "New Edge has been added with ID ", e1

+ +

Add Triangle

+ +

import SMESH_mechanic

+ +

 

+ +

mesh = SMESH_mechanic.mesh

+ +

print ""

+ +

 

+ +

# add node

+ +

n1 = mesh.AddNode(50, + 10, 0)

+ +

if n1 == 0: print + "KO node addition."

+ +

 

+ +

# add triangle

+ +

t1 = mesh.AddFace([n1, + 38, 39])

+ +

if t1 == 0: print + "KO triangle addition."

+ +

else:       print + "New Triangle has been added with ID ", t1

+ +

Add Quadrangle

+ +

import SMESH_mechanic

+ +

 

+ +

mesh = SMESH_mechanic.mesh

+ +

print ""

+ +

 

+ +

# add node

+ +

n1 = mesh.AddNode(50, + 10, 0)

+ +

if n1 == 0: print + "KO node addition."

+ +

 

+ +

n2 = mesh.AddNode(40, + 20, 0)

+ +

if n2 == 0: print + "KO node addition."

+ +

 

+ +

# add quadrangle

+ +

q1 = mesh.AddFace([n2, + n1, 38, 39])

+ +

if q1 == 0: print + "KO quadrangle addition."

+ +

else: +       print + "New Quadrangle has been added with ID ", q1

+ +

Add Tetrahedron

+ +

import SMESH_mechanic

+ +

 

+ +

mesh = SMESH_mechanic.mesh

+ +

print ""

+ +

 

+ +

# add node

+ +

n1 = mesh.AddNode(50, + 10, 0)

+ +

if n1 == 0: print + "KO node addition."

+ +

 

+ +

# add tetrahedron

+ +

t1 = mesh.AddVolume([n1, + 38, 39, 246])

+ +

if t1 == 0: print + "KO tetrahedron addition."

+ +

else: +       print + "New Tetrahedron has been added with ID ", t1

+ +

Add Hexahedron

+ +

import SMESH_mechanic

+ +

 

+ +

mesh = SMESH_mechanic.mesh

+ +

print ""

+ +

 

+ +

# add nodes

+ +

nId1 = mesh.AddNode(50, + 10, 0)

+ +

nId2 = mesh.AddNode(47, + 12, 0)

+ +

nId3 = mesh.AddNode(50, + 10, 10)

+ +

nId4 = mesh.AddNode(47, + 12, 10)

+ +

 

+ +

if nId1 == 0 or + nId2 == 0 or nId3 == 0 or nId4 == 0: print "KO node addition."

+ +

 

+ +

# add hexahedron

+ +

vId = mesh.AddVolume([nId2, + nId1, 38, 39, nId4, nId3, 245, 246])

+ +

if vId == 0: print + "KO Hexahedron addition."

+ +

else:        print + "New Hexahedron has been added with ID ", vId

+ +

 

+ +

Add Polygon

+ +

import + math

+ +

import salome

+ +

 

+ +

import smesh

+ +

 

+ +

# create an empty mesh + structure

+ +

mesh = smesh.Mesh() +

+ +

 

+ +

# a method to build + a polygonal mesh element with <nb_vert> angles:

+ +

def MakePolygon + (a_mesh, x0, y0, z0, radius, nb_vert):

+ +

    al + = 2.0 * math.pi / nb_vert

+ +

    node_ids + = []

+ +

 

+ +

          # + Create nodes for a polygon

+ +

    for + ii in range(nb_vert):

+ +

        nid + = mesh.AddNode(x0 + radius * math.cos(ii*al),

+ +

                                 y0 + + radius * math.sin(ii*al),

+ +

                                 z0)

+ +

        node_ids.append(nid)

+ +

        pass

+ +

 

+ +

          # + Create a polygon

+ +

    return + mesh.AddPolygonalFace(node_ids)

+ +

 

+ +

# Create three polygons

+ +

f1 = MakePolygon(mesh, + 0, 0,  0, + 30, 13)

+ +

f2 = MakePolygon(mesh, + 0, 0, 10, 21,  9)

+ +

f3 = MakePolygon(mesh, + 0, 0, 20, 13,  6)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

Add Polyhedron

+ +

import + salome

+ +

import math

+ +

 

+ +

# create an empty mesh + structure

+ +

mesh = smesh.Mesh() +  

+ +

 

+ +

# Create nodes for + 12-hedron with pentagonal faces

+ +

al = 2 * math.pi + / 5.0

+ +

cosal = math.cos(al)

+ +

aa = 13

+ +

rr = aa / (2.0 * + math.sin(al/2.0))

+ +

dr = 2.0 * rr * + cosal

+ +

r1 = rr + dr

+ +

dh = rr * math.sqrt(2.0 + * (1.0 - cosal * (1.0 + 2.0 * cosal)))

+ +

hh = 2.0 * dh - + dr * (rr*(cosal - 1) + (rr + dr)*(math.cos(al/2) - 1)) / dh

+ +

 

+ +

dd = [] # + top

+ +

cc = [] # + below top

+ +

bb = [] # + above bottom

+ +

aa = [] # + bottom

+ +

 

+ +

for i in range(5):

+ +

    cos_bot + = math.cos(i*al)

+ +

    sin_bot + = math.sin(i*al)

+ +

 

+ +

    cos_top + = math.cos(i*al + al/2.0)

+ +

    sin_top + = math.sin(i*al + al/2.0)

+ +

 

+ +

    nd + = mesh.AddNode(rr * cos_top, rr * sin_top, hh     ) + # top

+ +

    nc + = mesh.AddNode(r1 * cos_top, r1 * sin_top, hh - dh) # + below top

+ +

    nb + = mesh.AddNode(r1 * cos_bot, r1 * sin_bot,      dh) + # above bottom

+ +

    na + = mesh.AddNode(rr * cos_bot, rr * sin_bot,       0) + # bottom

+ +

    dd.append(nd) + # top

+ +

    cc.append(nc) + # below top

+ +

    bb.append(nb) + # above bottom

+ +

    aa.append(na) + # bottom

+ +

 

+ +

    pass

+ +

 

+ +

# Create a polyhedral + volume (12-hedron with pentagonal faces)

+ +

MeshEditor.AddPolyhedralVolume([dd[0], + dd[1], dd[2], dd[3], dd[4],  # + top

+ +

                                dd[0], + cc[0], bb[1], cc[1], dd[1],  # + -

+ +

                                dd[1], + cc[1], bb[2], cc[2], dd[2],  # + -

+ +

                                dd[2], + cc[2], bb[3], cc[3], dd[3],  # + - below top

+ +

                                dd[3], + cc[3], bb[4], cc[4], dd[4],  # + -

+ +

                                dd[4], + cc[4], bb[0], cc[0], dd[0],  # + -

+ +

                                aa[4], + bb[4], cc[4], bb[0], aa[0],  # + .

+ +

                                aa[3], + bb[3], cc[3], bb[4], aa[4],  # + .

+ +

                                aa[2], + bb[2], cc[2], bb[3], aa[3],  # + . above bottom

+ +

                                aa[1], + bb[1], cc[1], bb[2], aa[2],  # + .

+ +

                                aa[0], + bb[0], cc[0], bb[1], aa[1],  # + .

+ +

                                aa[0], + aa[1], aa[2], aa[3], aa[4]], # + bottom

+ +

                               [5,5,5,5,5,5,5,5,5,5,5,5])

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Removing Nodes and Elements

+ +

Removing Nodes

+ +

 

+ +

import + SMESH_mechanic

+ +

 

+ +

mesh = SMESH_mechanic.mesh

+ +

 

+ +

# remove nodes #246 + and #255

+ +

res = mesh.RemoveNodes([246, + 255])

+ +

if res == 1: print + "Nodes removing is OK!"

+ +

else:        print + "KO nodes removing."

+ +

 

+ +

Removing Elements

+ +

import SMESH_mechanic

+ +

 

+ +

mesh = SMESH_mechanic.mesh

+ +

 

+ +

# remove three elements: + #850, #859 and #814

+ +

res = mesh.RemoveElements([850, + 859, 814])

+ +

if res == 1: print + "Elements removing is OK!"

+ +

else:        print + "KO Elements removing."  

+ +

 

+ +

Renumbering Nodes and Elements

+ +

import SMESH_mechanic

+ +

 

+ +

mesh = SMESH_mechanic.mesh

+ +

 

+ +

mesh.RenumberNodes() +

+ +

Moving Nodes

+ +

import SMESH_mechanic

+ +

 

+ +

mesh = SMESH_mechanic.mesh

+ +

 

+ +

# move node #38

+ +

mesh.MoveNode(38, + 20., 10., 0.)

+ +

 

+ +

Diagonal Inversion

+ +

import salome

+ +

import smesh

+ +

 

+ +

# create an empty mesh + structure

+ +

mesh = smesh.Mesh() +

+ +

 

+ +

# create the following + mesh:

+ +

# .----.----.----.

+ +

# |   /| +   /| +   /|

+ +

# |  / + |  / |  / + |

+ +

# | /  | + /  | /  |

+ +

# |/   |/ +   |/ +   |

+ +

# .----.----.----.

+ +

 

+ +

bb = [0, 0, 0, 0]

+ +

tt = [0, 0, 0, 0]

+ +

ff = [0, 0, 0, 0, + 0, 0]

+ +

 

+ +

bb[0] = mesh.AddNode( + 0., 0., 0.)

+ +

bb[1] = mesh.AddNode(10., + 0., 0.)

+ +

bb[2] = mesh.AddNode(20., + 0., 0.)

+ +

bb[3] = mesh.AddNode(30., + 0., 0.)

+ +

 

+ +

tt[0] = mesh.AddNode( + 0., 15., 0.)

+ +

tt[1] = mesh.AddNode(10., + 15., 0.)

+ +

tt[2] = mesh.AddNode(20., + 15., 0.)

+ +

tt[3] = mesh.AddNode(30., + 15., 0.)

+ +

 

+ +

ff[0] = mesh.AddFace([bb[0], + bb[1], tt[1]])

+ +

ff[1] = mesh.AddFace([bb[0], + tt[1], tt[0]])

+ +

ff[2] = mesh.AddFace([bb[1], + bb[2], tt[2]])

+ +

ff[3] = mesh.AddFace([bb[1], + tt[2], tt[1]])

+ +

ff[4] = mesh.AddFace([bb[2], + bb[3], tt[3]])

+ +

ff[5] = mesh.AddFace([bb[2], + tt[3], tt[2]])

+ +

 

+ +

# inverse the diagonal + bb[1] - tt[2]

+ +

print "\nDiagonal + inversion ... ",

+ +

res = mesh.InverseDiag(bb[1], + tt[2])

+ +

if not res: print + "failed!"

+ +

else:       print + "done."

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

Uniting two Triangles

+ +

import salome

+ +

import smesh

+ +

 

+ +

# create an empty mesh structure

+ +

mesh = smesh.Mesh() +

+ +

 

+ +

# create the following mesh:

+ +

# .----.----.----.

+ +

# |   /| +   /| +   /|

+ +

# |  / + |  / |  / + |

+ +

# | /  | + /  | /  |

+ +

# |/   |/ +   |/ +   |

+ +

# .----.----.----.

+ +

 

+ +

bb = [0, 0, 0, 0]

+ +

tt = [0, 0, 0, 0]

+ +

ff = [0, 0, 0, 0, + 0, 0]

+ +

 

+ +

bb[0] + = mesh.AddNode( 0., 0., 0.)

+ +

bb[1] = mesh.AddNode(10., + 0., 0.)

+ +

bb[2] = mesh.AddNode(20., + 0., 0.)

+ +

bb[3] = mesh.AddNode(30., + 0., 0.)

+ +

 

+ +

tt[0] = mesh.AddNode( + 0., 15., 0.)

+ +

tt[1] = mesh.AddNode(10., + 15., 0.)

+ +

tt[2] = mesh.AddNode(20., + 15., 0.)

+ +

tt[3] = mesh.AddNode(30., + 15., 0.)

+ +

 

+ +

ff[0] = mesh.AddFace([bb[0], + bb[1], tt[1]])

+ +

ff[1] = mesh.AddFace([bb[0], + tt[1], tt[0]])

+ +

ff[2] = mesh.AddFace([bb[1], + bb[2], tt[2]])

+ +

ff[3] = mesh.AddFace([bb[1], + tt[2], tt[1]])

+ +

ff[4] = mesh.AddFace([bb[2], + bb[3], tt[3]])

+ +

ff[5] = mesh.AddFace([bb[2], + tt[3], tt[2]])

+ +

 

+ +

# delete the diagonal bb[1] - tt[2]

+ +

print "\nUnite + two triangles ... ",

+ +

res = mesh.DeleteDiag(bb[1], + tt[2])

+ +

if not res: print + "failed!"

+ +

else:       print + "done."

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

Uniting a Set of Triangles

+ +

import salome

+ +

import smesh

+ +

 

+ +

# create an empty mesh + structure

+ +

mesh = smesh.Mesh() +

+ +

 

+ +

# create the following + mesh:

+ +

# .----.----.----.

+ +

# |   /| +   /| +   /|

+ +

# |  / + |  / |  / + |

+ +

# | /  | + /  | /  |

+ +

# |/   |/ +   |/ +   |

+ +

# .----.----.----.

+ +

 

+ +

bb = [0, 0, 0, 0]

+ +

tt = [0, 0, 0, 0]

+ +

ff = [0, 0, 0, 0, + 0, 0]

+ +

 

+ +

bb[0] + = mesh.AddNode( 0., 0., 0.)

+ +

bb[1] = mesh.AddNode(10., + 0., 0.)

+ +

bb[2] = mesh.AddNode(20., + 0., 0.)

+ +

bb[3] = mesh.AddNode(30., + 0., 0.)

+ +

 

+ +

tt[0] = mesh.AddNode( + 0., 15., 0.)

+ +

tt[1] = mesh.AddNode(10., + 15., 0.)

+ +

tt[2] = mesh.AddNode(20., + 15., 0.)

+ +

tt[3] = mesh.AddNode(30., + 15., 0.)

+ +

 

+ +

ff[0] = mesh.AddFace([bb[0], + bb[1], tt[1]])

+ +

ff[1] = mesh.AddFace([bb[0], + tt[1], tt[0]])

+ +

ff[2] = mesh.AddFace([bb[1], + bb[2], tt[2]])

+ +

ff[3] = mesh.AddFace([bb[1], + tt[2], tt[1]])

+ +

ff[4] = mesh.AddFace([bb[2], + bb[3], tt[3]])

+ +

ff[5] = mesh.AddFace([bb[2], + tt[3], tt[2]])

+ +

 

+ +

# unite a set of triangles

+ +

print + "\nUnite a set of triangles ... ",

+ +

res = mesh.TriToQuad([ff[2], + ff[3], ff[4], ff[5]], smesh.FT_MinimumAngle, 60.)

+ +

if not res: print + "failed!"

+ +

else:       print + "done."

+ +

 

+ +

salome.sg.updateObjBrowser(1) +  

+ +

Orientation

+ +

import salome

+ +

import smesh

+ +

 

+ +

# create an empty mesh structure

+ +

mesh = smesh.Mesh() +

+ +

 

+ +

# build five quadrangles:

+ +

dx = 10

+ +

dy = 20

+ +

 

+ +

n1 +  = mesh.AddNode(0.0 + * dx, 0, 0)

+ +

n2  = + mesh.AddNode(1.0 * dx, 0, 0)

+ +

n3  = + mesh.AddNode(2.0 * dx, 0, 0)

+ +

n4  = + mesh.AddNode(3.0 * dx, 0, 0)

+ +

n5  = + mesh.AddNode(4.0 * dx, 0, 0)

+ +

n6  = + mesh.AddNode(5.0 * dx, 0, 0)

+ +

n7  = + mesh.AddNode(0.0 * dx, dy, 0)

+ +

n8  = + mesh.AddNode(1.0 * dx, dy, 0)

+ +

n9  = + mesh.AddNode(2.0 * dx, dy, 0)

+ +

n10 = mesh.AddNode(3.0 + * dx, dy, 0)

+ +

n11 = mesh.AddNode(4.0 + * dx, dy, 0)

+ +

n12 = mesh.AddNode(5.0 + * dx, dy, 0)

+ +

 

+ +

f1 = mesh.AddFace([n1, + n2, n8 , n7 ])

+ +

f2 = mesh.AddFace([n2, + n3, n9 , n8 ])

+ +

f3 = mesh.AddFace([n3, + n4, n10, n9 ])

+ +

f4 = mesh.AddFace([n4, + n5, n11, n10])

+ +

f5 = mesh.AddFace([n5, + n6, n12, n11])

+ +

 

+ +

# Change the orientation + of the second and the fourth faces.

+ +

mesh.Reorient([2, + 4])

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Cutting Quadrangles

+ +

import SMESH_mechanic

+ +

 

+ +

smesh = SMESH_mechanic.smesh

+ +

mesh  = + SMESH_mechanic.mesh

+ +

 

+ +

# cut two quadrangles: + 405 and 406

+ +

mesh.QuadToTri([405, + 406], smesh.FT_MinimumAngle)  

+ +

 

+ +

Smoothing

+ +

import salome

+ +

import geompy

+ +

 

+ +

import SMESH_mechanic

+ +

 

+ +

smesh + = SMESH_mechanic.smesh

+ +

mesh = SMESH_mechanic.mesh

+ +

 

+ +

# select the top face

+ +

faces + = geompy.SubShapeAllSorted(SMESH_mechanic.shape_mesh, geompy.ShapeType["FACE"])

+ +

face = faces[3]

+ +

geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, + face, "face planar with hole")

+ +

 

+ +

# create a group of + faces to be smoothed

+ +

GroupSmooth = mesh.GroupOnGeom(face, + "Group of faces (smooth)", smesh.FACE)

+ +

 

+ +

# perform smoothing

+ +

 

+ +

# boolean SmoothObject(Object, + IDsOfFixedNodes, MaxNbOfIterations, MaxAspectRatio, Method)

+ +

res = mesh.SmoothObject(GroupSmooth, + [], 20, 2., smesh.CENTROIDAL_SMOOTH)

+ +

print "\nSmoothing + ... ",

+ +

if not res: print + "failed!"

+ +

else:       print + "done."

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Extrusion

+ +

import salome

+ +

import geompy

+ +

 

+ +

import SMESH_mechanic

+ +

 

+ +

smesh + = SMESH_mechanic.smesh

+ +

mesh = SMESH_mechanic.mesh +

+ +

 

+ +

# select the top face

+ +

faces = geompy.SubShapeAllSorted(SMESH_mechanic.shape_mesh, + geompy.ShapeType["FACE"])

+ +

face = faces[7]

+ +

geompy.addToStudyInFather(SMESH_mechanic.shape_mesh, + face, "face circular top")

+ +

 

+ +

# create a vector + for extrusion

+ +

point = smesh.PointStruct(0., + 0., 5.)

+ +

vector = smesh.DirStruct(point)

+ +

 

+ +

# create a group to + be extruded

+ +

GroupTri = mesh.GroupOnGeom(face, + "Group of faces (extrusion)", smesh.FACE)

+ +

 

+ +

# perform extrusion + of the group

+ +

mesh.ExtrusionSweepObject(GroupTri, + vector, 5)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

Extrusion along a Path

+ +

import math

+ +

import salome

+ +

 

+ +

# Geometry

+ +

import geompy

+ +

 

+ +

# 1. Create points

+ +

points = [[0, 0], + [50, 30], [50, 110], [0, 150], [-80, 150], [-130, 70], [-130, -20]]

+ +

 

+ +

iv = 1

+ +

vertices = []

+ +

for point in points:

+ +

vert + = geompy.MakeVertex(point[0], point[1], 0)

+ +

geompy.addToStudy(vert, + "Vertex_" + `iv`)

+ +

vertices.append(vert)

+ +

iv + += 1

+ +

pass

+ +

 

+ +

# 2. Create edges and + wires

+ +

Edge_straight = geompy.MakeEdge(vertices[0], + vertices[4])

+ +

Edge_bezierrr = geompy.MakeBezier(vertices)

+ +

Wire_polyline = geompy.MakePolyline(vertices)

+ +

Edge_Circle   = + geompy.MakeCircleThreePnt(vertices[0], vertices[1], vertices[2])

+ +

 

+ +

geompy.addToStudy(Edge_straight, + "Edge_straight")

+ +

geompy.addToStudy(Edge_bezierrr, + "Edge_bezierrr")

+ +

geompy.addToStudy(Wire_polyline, + "Wire_polyline")

+ +

geompy.addToStudy(Edge_Circle +  , "Edge_Circle")

+ +

 

+ +

# 3. Explode wire on + edges, as they will be used for mesh extrusion

+ +

Wire_polyline_edges + = geompy.SubShapeAll(Wire_polyline, geompy.ShapeType["EDGE"])

+ +

for ii in range(len(Wire_polyline_edges)):

+ +

geompy.addToStudyInFather(Wire_polyline, + Wire_polyline_edges[ii], "Edge_" + `ii + 1`)

+ +

pass

+ +

 

+ +

# Mesh

+ +

import smesh

+ +

 

+ +

# Mesh + the given shape with the given 1d hypothesis

+ +

def + Mesh1D(shape1d, nbSeg, name):

+ +

  mesh1d_tool + = smesh.Mesh(shape1d, name)

+ +

  algo + = mesh1d_tool.Segment()

+ +

  hyp +  = algo.NumberOfSegments(nbSeg)

+ +

  isDone + = mesh1d_tool.Compute()

+ +

  if + not isDone: print 'Mesh ', name, ': computation failed'

+ +

  return + mesh1d_tool

+ +

# Create + a mesh with six nodes, seven edges and two quadrangle faces

+ +

def + MakeQuadMesh2(mesh_name):

+ +

  quad_1 + = smesh.Mesh(name = mesh_name)

+ +

  

+ +

  # + six nodes

+ +

  n1 + = quad_1.AddNode(0, 20, 10)

+ +

  n2 + = quad_1.AddNode(0, 40, 10)

+ +

  n3 + = quad_1.AddNode(0, 40, 30)

+ +

  n4 + = quad_1.AddNode(0, 20, 30)

+ +

  n5 + = quad_1.AddNode(0,  0, + 30)

+ +

  n6 + = quad_1.AddNode(0,  0, + 10)

+ +

  

+ +

  # + seven edges

+ +

  quad_1.AddEdge([n1, + n2]) # 1

+ +

  quad_1.AddEdge([n2, + n3]) # 2

+ +

  quad_1.AddEdge([n3, + n4]) # 3

+ +

  quad_1.AddEdge([n4, + n1]) # 4

+ +

  quad_1.AddEdge([n4, + n5]) # 5

+ +

  quad_1.AddEdge([n5, + n6]) # 6

+ +

  quad_1.AddEdge([n6, + n1]) # 7

+ +

 

+ +

  # + two quadrangle faces

+ +

  quad_1.AddFace([n1, + n2, n3, n4]) # 8

+ +

  quad_1.AddFace([n1, + n4, n5, n6]) # 9

+ +

  return + [quad_1, [1,2,3,4,5,6,7], [8,9]]

+ +

 

+ +

# Path + meshes

+ +

Edge_straight_mesh + = Mesh1D(Edge_straight, 7, "Edge_straight")

+ +

Edge_bezierrr_mesh + = Mesh1D(Edge_bezierrr, 7, "Edge_bezierrr")

+ +

Wire_polyline_mesh + = Mesh1D(Wire_polyline, 3, "Wire_polyline")

+ +

Edge_Circle_mesh +   = + Mesh1D(Edge_Circle  , + 8, "Edge_Circle")

+ +

 

+ +

# Initial + meshes (to be extruded)

+ +

[quad_1, + ee_1, ff_1] = MakeQuadMesh2("quad_1")

+ +

[quad_2, + ee_2, ff_2] = MakeQuadMesh2("quad_2")

+ +

[quad_3, + ee_3, ff_3] = MakeQuadMesh2("quad_3")

+ +

[quad_4, + ee_4, ff_4] = MakeQuadMesh2("quad_4")

+ +

[quad_5, + ee_5, ff_5] = MakeQuadMesh2("quad_5")

+ +

[quad_6, + ee_6, ff_6] = MakeQuadMesh2("quad_6")

+ +

[quad_7, + ee_7, ff_7] = MakeQuadMesh2("quad_7")

+ +

 

+ +

# ExtrusionAlongPath

+ +

# IDsOfElements, + PathMesh, PathShape, NodeStart,

+ +

# HasAngles, + Angles, HasRefPoint, RefPoint

+ +

refPoint + = smesh.PointStruct(0, 0, 0)

+ +

a10 + = 10.0*math.pi/180.0

+ +

a45 + = 45.0*math.pi/180.0

+ +

 

+ +

# 1. + Extrusion of two mesh edges along a straight path

+ +

error + = quad_1.ExtrusionAlongPath([1,2], Edge_straight_mesh, Edge_straight, + 1,

+ +

                                  0, + [], 0, refPoint)

+ +

 

+ +

# 2. + Extrusion of one mesh edge along a curved path

+ +

error + = quad_2.ExtrusionAlongPath([2], Edge_bezierrr_mesh, Edge_bezierrr, 1,

+ +

                                  0, + [], 0, refPoint)

+ +

 

+ +

# 3. + Extrusion of one mesh edge along a curved path with usage of angles

+ +

error + = quad_3.ExtrusionAlongPath([2], Edge_bezierrr_mesh, Edge_bezierrr, 1,

+ +

                                  1, + [a45, a45, a45, 0, -a45, -a45, -a45], 0, refPoint)

+ +

 

+ +

# 4. + Extrusion of one mesh edge along the path, which is a part of a meshed + wire

+ +

error + = quad_4.ExtrusionAlongPath([4], Wire_polyline_mesh, Wire_polyline_edges[0], + 1,

+ +

                                  1, + [a10, a10, a10], 0, refPoint)

+ +

 

+ +

# 5. + Extrusion of two mesh faces along the path, which is a part of a meshed + wire

+ +

error + = quad_5.ExtrusionAlongPath(ff_5 , Wire_polyline_mesh, Wire_polyline_edges[2], + 4,

+ +

                                  0, + [], 0, refPoint)

+ +

 

+ +

# 6. + Extrusion of two mesh faces along a closed path

+ +

error + = quad_6.ExtrusionAlongPath(ff_6 , Edge_Circle_mesh, Edge_Circle, 1,

+ +

                                  0, + [], 0, refPoint)

+ +

 

+ +

# 7. + Extrusion of two mesh faces along a closed path with usage of angles

+ +

error + = quad_7.ExtrusionAlongPath(ff_7, Edge_Circle_mesh, Edge_Circle, 1,

+ +

                                  1, + [a45, -a45, a45, -a45, a45, -a45, a45, -a45], 0, refPoint)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

Revolution

+ +

import math

+ +

 

+ +

import SMESH_mechanic

+ +

 

+ +

mesh +  = SMESH_mechanic.mesh

+ +

smesh = SMESH_mechanic.smesh

+ +

 

+ +

# create a group of faces + to be revolved

+ +

FacesRotate = [492, + 493, 502, 503]

+ +

GroupRotate = mesh.CreateGroup(SMESH.FACE,"Group + of faces (rotate)")

+ +

GroupRotate.Add(FacesRotate)

+ +

 

+ +

# define revolution angle + and axis

+ +

angle45 = 45 * math.pi + / 180

+ +

axisXYZ = SMESH.AxisStruct(-38.3128, + -73.3658, -23.321, -13.3402, -13.3265, 6.66632)

+ +

 

+ +

# perform revolution + of an object

+ +

mesh.RotationSweepObject(GroupRotate, + axisXYZ, angle45, 4, 1e-5)

+ +

 

+ +

Pattern Mapping

+ +

import geompy

+ +

 

+ +

import smesh

+ +

 

+ +

# define the geometry

+ +

Box_1 = geompy.MakeBoxDXDYDZ(200., + 200., 200.)

+ +

geompy.addToStudy(Box_1, + "Box_1")

+ +

 

+ +

faces = geompy.SubShapeAll(Box_1, + geompy.ShapeType["FACE"])

+ +

Face_1 = faces[0]

+ +

Face_2 = faces[1]

+ +

 

+ +

geompy.addToStudyInFather(Box_1, + Face_1, "Face_1")

+ +

geompy.addToStudyInFather(Box_1, + Face_2, "Face_2")

+ +

 

+ +

# build a quadrangle + mesh 3x3 on Face_1

+ +

Mesh_1 = smesh.Mesh(Face_1)

+ +

algo1D = Mesh_1.Segment()

+ +

algo1D.NumberOfSegments(3)

+ +

Mesh_1.Quadrangle()

+ +

 

+ +

isDone = Mesh_1.Compute()

+ +

if not isDone: print + 'Mesh Mesh_1 : computation failed'

+ +

 

+ +

# build a triangle + mesh on Face_2

+ +

Mesh_2 = smesh.Mesh(Face_2)

+ +

 

+ +

algo1D = Mesh_2.Segment()

+ +

algo1D.NumberOfSegments(1)

+ +

algo2D = Mesh_2.Triangle()

+ +

algo2D.MaxElementArea(240)

+ +

 

+ +

isDone = Mesh_2.Compute()

+ +

if not isDone: print + 'Mesh Mesh_2 : computation failed'

+ +

 

+ +

# create a pattern

+ +

pattern = smesh.GetPattern()

+ +

 

+ +

isDone = pattern.LoadFromFace(Mesh_2.GetMesh(), + Face_2, 0)

+ +

if (isDone != 1): print + 'LoadFromFace :', pattern.GetErrorCode()

+ +

 

+ +

# apply the pattern + to a face of the first mesh

+ +

pattern.ApplyToMeshFaces(Mesh_1.GetMesh(), + [17], 0, 0)

+ +

 

+ +

isDone = pattern.MakeMesh(Mesh_1.GetMesh(), + 0, 0)

+ +

if (isDone != 1): print + 'MakeMesh :', pattern.GetErrorCode()  

+ + + + diff --git a/doc/salome/gui/SMESH/netgen_2d_and_3d_hypotheses.htm b/doc/salome/gui/SMESH/netgen_2d_and_3d_hypotheses.htm new file mode 100644 index 000000000..1413f3baf --- /dev/null +++ b/doc/salome/gui/SMESH/netgen_2d_and_3d_hypotheses.htm @@ -0,0 +1,146 @@ + + + + + +Netgen 2D and 3D hypotheses + + + + + + + + + + + +

Netgen 2D and 3D hypotheses

+ +

Netgen 2D and Netgen + 3D hypotheses work only with Netgen 1D-2D and Netgen + 1D-2D-3D algorithms. These algorithms + do not require definition of lower-level  hypotheses + and algorithms (2D and 1D for meshing 3D objects and 1D for meshing 2D + objects). They prove to be useful if lower-level meshing is homogeneous + for all wires and faces of the meshed object.

+ +

+ +
    + +
  • Name + - allows to define the name for the algorithm (Netgen 2D (or 3D) Parameters + by default)

  • + +
  • Max + Size - maximum linear dimensions for mesh cells.

  • + +
  • Second + Order - if this box is checked in, the algorithm will create second + order nodes on the mesh, which actually will become Quadratic. +   

  • + +
  • Fineness + - ranging from Very Coarse to Very Fine allows to set the level of meshing + detalization using the three parameters below. You can select Custom to + define them manually.

  • + +
  • Growth + rate - allows to define how much the linear dimensions of two adjacent + cells can differ (i.e. 0.3 means 30%).

  • + +
  • Nb. + Segs per Edge and Nb Segs per + Radius - allows to define the minimum number of mesh segments in + which edges and radiuses will be split.

  • + +
  • Allow + Quadrangles - allows to use quadrangle elements in a triangle 2D + mesh. This checkbox is not present in Netgen 3D parameters because currently + building a tetrahedral mesh with quadrangle faces is not possible.

  • + +
  • Optimize + - if this box is checked in, the algorithm will try to create regular + (possessing even sides) elements.

  • +
+ + + + diff --git a/doc/salome/gui/SMESH/pattern_mapping.htm b/doc/salome/gui/SMESH/pattern_mapping.htm index 2e1bccf29..87685f026 100755 --- a/doc/salome/gui/SMESH/pattern_mapping.htm +++ b/doc/salome/gui/SMESH/pattern_mapping.htm @@ -1,311 +1,311 @@ - - - - - -Pattern mapping - - - - - - - - - - - - - -

Pattern mapping

- -

About patterns

- -

The pattern describes a mesh to generate: positions of - nodes within a geometrical domain and nodal connectivity of elements. - As well, a pattern specifies the so-called key-points, i.e. nodes that - will be located at geometrical vertices. Pattern description is stored - in <pattern_name>.smp file.

- -

 

- -

The smp file contains 4 sections:

- -

 

- -

1. The first line holds the number of nodes - (N).

- -

 

- -

2. The next N lines describe nodes coordinates. - Each line holds 2 coordinates of a node.

- -

 

- -

3. A key-points line: indices of nodes to - be mapped on geometrical vertices. An index n refers to a node described - on an n-th line of section 2. The first node index is zero.

- -

 

- -

4. The rest lines describe nodal connectivity - of elements, one line for an element. A line holds indices of nodes forming - an element. An index n refers to a node described on an n-th line of the - section 2. The first node index is zero. There must be 3 or 4 indices - on a line: only 2d elements are allowed.

- -

 

- -

The 2D pattern must contain at least one element and at least one key-point. - All key-points must lay on boundaries.

- -

 

- -

An example of a simple smp file and a preview of a pattern described - in this file:

- -

 

- -

- -

 

- -

 

- -

Application of pattern mapping

- -

To apply pattern mapping to a geometrical object:

- -

 

- -

1. From the Modification - menu choose the Pattern Mapping - item or click button in the toolbar. The following - dialog box shall appear:

- -

 

- - --- - - - -
-

-

- -

 

- -

To apply a pattern to a geometrical object, you should specify:

- -

- a face having the number of vertices equal - to the number of key-points in the pattern; the number of key-points on - internal boundaries of a pattern must also be equal to the number of vertices - on internal boundaries of a face;

- -

- a vertex to which the first key-point should - be mapped,

- -

- reverse or not the order of key-points. - (The order of vertices of a face is counterclockwise looking from outside).

- -

 

- -

Then you either load a .smp pattern file previously created manually - by clicking on the button, or click on the New - button for automatic generation.

- -

For an automatic generation you just specify a geometrical face having - a mesh built on it. Mesh nodes lying on face vertices become key-points. - Additionally, you may choose the way of getting nodes coordinates by projecting nodes on the face instead - of using "positions on face" generated by mesher (if there is - any). Faces having a seam edge canÂ’t be used for automatic pattern creation.

- -

 

- -

When creating a pattern from an existing mesh, there are two possible - cases:

- -

 

- -

1. A sub-mesh on face is selected. A pattern is created from the 2d - elements bound to a face by mesher. Node coordinates are either "positions - on face" computed by mesher, or coordinates got by node projection - on a geometrical surface, according to your choice.

- -

2. A mesh where the main shape is a face, is selected. A pattern is - created from all the 2d elements in a mesh. If all mesh elements are build - by mesher, the user can select the way of getting nodes coordinates, else - all nodes are projected on a face surface.

- - --- - - - -
-

-

- -

 

- -

Mapping algorithm:

- -

The mapping algorithm is as follows:

- -

 

- -

1. Key-points are set in the order that they - are encountered when walking along a pattern boundary so that elements - are on the left. The first key-point is preserved.

- -

2. Find geometrical vertices corresponding - to key-points by vertices order in a face boundary; here, "Reverse - order of key-points" flag is taken into account.

- -

 

- -

- -

 

- -

3. Boundary nodes of a pattern are mapped - onto edges of a face: a node located between certain key-points on a pattern - boundary is mapped on a geometrical edge limited by corresponding geometrical - vertices. Node position on an edge reflects its distance from two key-points.

- -

 

- -

- -

 

- -

4. Coordinates of a non-boundary node in - a parametric space of a face are defined as following. In a parametric - space of a pattern, a node lays at the intersection of two iso-lines, - each of which intersects a pattern boundary at least at two points. Knowing - mapped positions of boundary nodes, we find where isoline-boundary intersection - points are mapped to, and hence we can find mapped isolines direction - and then, two node positions on two mapped isolines. The eventual mapped - position of a node is found as an average of positions on mapped isolines.

- -

 

- -

- -

 

- -

 See - Also a sample TUI Script of a Pattern - Mapping operation.  

- -

 

- - - - + + + + + +Pattern mapping + + + + + + + + + + + + + +

Pattern mapping

+ +

About patterns

+ +

The pattern describes a mesh to generate: positions of + nodes within a geometrical domain and nodal connectivity of elements. + As well, a pattern specifies the so-called key-points, i.e. nodes that + will be located at geometrical vertices. Pattern description is stored + in <pattern_name>.smp file.

+ +

 

+ +

The smp file contains 4 sections:

+ +

 

+ +

1. The first line holds the number of nodes + (N).

+ +

 

+ +

2. The next N lines describe nodes coordinates. + Each line holds 2 coordinates of a node.

+ +

 

+ +

3. A key-points line: indices of nodes to + be mapped on geometrical vertices. An index n refers to a node described + on an n-th line of section 2. The first node index is zero.

+ +

 

+ +

4. The rest lines describe nodal connectivity + of elements, one line for an element. A line holds indices of nodes forming + an element. An index n refers to a node described on an n-th line of the + section 2. The first node index is zero. There must be 3 or 4 indices + on a line: only 2d elements are allowed.

+ +

 

+ +

The 2D pattern must contain at least one element and at least one key-point. + All key-points must lay on boundaries.

+ +

 

+ +

An example of a simple smp file and a preview of a pattern described + in this file:

+ +

 

+ +

+ +

 

+ +

 

+ +

Application of pattern mapping

+ +

To apply pattern mapping to a geometrical object:

+ +

 

+ +

1. From the Modification + menu choose the Pattern Mapping + item or click button in the toolbar. The following + dialog box shall appear:

+ +

 

+ + +++ + + + +
+

+

+ +

 

+ +

To apply a pattern to a geometrical object, you should specify:

+ +

- a face having the number of vertices equal + to the number of key-points in the pattern; the number of key-points on + internal boundaries of a pattern must also be equal to the number of vertices + on internal boundaries of a face;

+ +

- a vertex to which the first key-point should + be mapped,

+ +

- reverse or not the order of key-points. + (The order of vertices of a face is counterclockwise looking from outside).

+ +

 

+ +

Then you either load a .smp pattern file previously created manually + by clicking on the button, or click on the New + button for automatic generation.

+ +

For an automatic generation you just specify a geometrical face having + a mesh built on it. Mesh nodes lying on face vertices become key-points. + Additionally, you may choose the way of getting nodes coordinates by projecting nodes on the face instead + of using "positions on face" generated by mesher (if there is + any). Faces having a seam edge canÂ’t be used for automatic pattern creation.

+ +

 

+ +

When creating a pattern from an existing mesh, there are two possible + cases:

+ +

 

+ +

1. A sub-mesh on face is selected. A pattern is created from the 2d + elements bound to a face by mesher. Node coordinates are either "positions + on face" computed by mesher, or coordinates got by node projection + on a geometrical surface, according to your choice.

+ +

2. A mesh where the main shape is a face, is selected. A pattern is + created from all the 2d elements in a mesh. If all mesh elements are build + by mesher, the user can select the way of getting nodes coordinates, else + all nodes are projected on a face surface.

+ + +++ + + + +
+

+

+ +

 

+ +

Mapping algorithm:

+ +

The mapping algorithm is as follows:

+ +

 

+ +

1. Key-points are set in the order that they + are encountered when walking along a pattern boundary so that elements + are on the left. The first key-point is preserved.

+ +

2. Find geometrical vertices corresponding + to key-points by vertices order in a face boundary; here, "Reverse + order of key-points" flag is taken into account.

+ +

 

+ +

+ +

 

+ +

3. Boundary nodes of a pattern are mapped + onto edges of a face: a node located between certain key-points on a pattern + boundary is mapped on a geometrical edge limited by corresponding geometrical + vertices. Node position on an edge reflects its distance from two key-points.

+ +

 

+ +

+ +

 

+ +

4. Coordinates of a non-boundary node in + a parametric space of a face are defined as following. In a parametric + space of a pattern, a node lays at the intersection of two iso-lines, + each of which intersects a pattern boundary at least at two points. Knowing + mapped positions of boundary nodes, we find where isoline-boundary intersection + points are mapped to, and hence we can find mapped isolines direction + and then, two node positions on two mapped isolines. The eventual mapped + position of a node is found as an average of positions on mapped isolines.

+ +

 

+ +

+ +

 

+ +

 See + Also a sample TUI Script of a Pattern + Mapping operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/pics/distribution_of_layers.png b/doc/salome/gui/SMESH/pics/distribution_of_layers.png new file mode 100644 index 0000000000000000000000000000000000000000..3d01d66f4bd837a239c05aa28dc0a5eadaf27a40 GIT binary patch literal 12502 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 literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/pics/image157.gif b/doc/salome/gui/SMESH/pics/image157.gif new file mode 100644 index 0000000000000000000000000000000000000000..2f66e05e73040b6a088a806ee589b374ac215555 GIT binary patch literal 2858 zcmeIzk3Z9i9|!P{Uo*>?QRc@nKf*@NOqh;i3$yZT^P`+Pv+^?%aWUVT-yOwuBWC&~n z|F;d`0YCx+E3BYk3Mf2`1cOD$U=kSu216haW-ytV0*P)WW24N>PzpFQiky#8z|(LF z5p-N)7aoVhE6^n*h0+x=nH-_OmD5ltT0{hmMoUDY5;2&>#KbfVCM_+EPN(PR=a=Ge zrKP1T7K@F?v&m#Oo6Y5NTU%SZ*tD*$uED`U5gsoRi6nTuL?W5N<7Z|hGcz+%5=kmb zlS-v4c<>5~wW1(fk-=ax5=kb3$z+O=Z7ayPT@7F%OjKC($kKgBvT}2W~jQu+6CMs+w z&5;wG+($PY^g&D%yu`oI`QG7QGM^M&zU&?c*>p{dE=3S@rIz5DcuMY(FP8aKLhaM~ zuT7Wro^jNtoA>sYd||{ge_Xs5a7ErF}^v&vVA+hQ-xZo$j%c$2H;SZ|7WSm=p%bM^Lcm;8w;r$^HHy&$B~bQ+jYA?z}Wq zzAp;1Sb*rBQZ6*k=vAd*g|VabjkyJCk-xisttQ4PbhOwQ1Y%I_TZ#~+aJQx0 zA|Mj1R=Sejby%B_RbWwgD*g1GI9s8^Xt{3KtR8*l{wx)44=m>D9-RjSYWmrpBkCZ= z0v>Miys$di)B_B_iN?W7tR&Ghiy~#zy_GwAKfGQ-|S z1!}W{uFYJXi`6R^A(yLArG9uwbTaxw`@v3^*Bw|UJpsz0MjX4~j*Mw;$kRBqs_8o5 z8`^6B2_k5E^5-v!P)8^3``)arCzR!6H`8(-}Z-3vm^kO})VYS$;V;Hm-Q1Vu5 zKfBF&zeU^J{x5g^_bA1foOs@hqNOtIW2#m4h=PtCWtQul)5#Xw7r!YexM_q zw}8_b;(h#F`!c%GcM|BmTlRo~Uoy%Duv)?MZwK)_KgW|Ru_JEt+%Vydhu=L5{eeslNz8CRf6osxd%)2WvHQQO;_TdHb9 zD5~0awArh#2*X`D?MaqKrs`u$dIoP2|3gnThR6?3<=PysQQ6?VQe7MCn-?slz1%Sc zuBPxf@0%D6NA%v+ST%v_0WhkOp=y1hGs0lGFjd#6QDRZWKjBL@Tc5}>CR7>%NRUVH z3m|xmUp%}PXZlUVg|MkX=+0_k5bR1UE5wIIZSnSa`}|RK3C(b&-n+)YE6%QWxDZNJ zZmSLXNGrtz!X^d z1^oz4u~MGXn@aMDcbgIh1$x;qJhqQ3zT#S1U`J_0tKl&lI1`f#5^!Don0RvKS#qVh z(QzlR^C{;F%v7TEOP$$nj|98QS9MiLcglEJ(neSfD!$GmMz;?d<85^Njb}sOhoq~tu3P@#r@EkuPn!yr>a4&iuSWjh8&}#yIo!b_>U#&NlMz=8#czy7OJ!)1-=$`%(9t zx-YsnIlab4_DQC#rcT&X41#jBev1Ob!Aj~TDFAS$M#WZeCdM0woCl)(`^;b`l^h~| zzO}^~fH_bKS+_4f6*@|f*OLgO$bAVnEI)u&>4 z%nO>ZJB@u|=;SEyx~As-+b+6t>ZVpkJ!a{xujvm@x40c0Ty{8g-(S2h_t*0mA@OlV zab=HBet?~K$P0atrH1{K9C^+`lIqeRh`wa4@X+oe>}s#jI^YlHo>O4NV^>je%^zj--PcI% hzH#4x_3x{9-`Hpe_KCwK>(~2tm+Y?MJptg*e*p-eHLCys literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/pics/netgen2d.png b/doc/salome/gui/SMESH/pics/netgen2d.png new file mode 100644 index 0000000000000000000000000000000000000000..b2a9f25ed6fffcb3814ffb5befb1f191187e7d0c GIT binary patch literal 21454 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 literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/pics/number_of_layers.png b/doc/salome/gui/SMESH/pics/number_of_layers.png new file mode 100644 index 0000000000000000000000000000000000000000..846fa2c3efb7cdcc61742c72d6fe30cdae130c36 GIT binary patch literal 11539 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 C#P#d| literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/pics/projection_1d.png b/doc/salome/gui/SMESH/pics/projection_1d.png new file mode 100644 index 0000000000000000000000000000000000000000..1560acaeea5ed9298d667ff006aaad2a6509bba5 GIT binary patch literal 14401 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

wBfJ>BmS9}6@HxOM+4QMXmj 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 Yp@q;r)&+j>)j){2h>UQdpsx4-1#gU+V*mgE literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/pics/projection_2d.png b/doc/salome/gui/SMESH/pics/projection_2d.png new file mode 100644 index 0000000000000000000000000000000000000000..91d446b5c89ef390eec41565793764ffa91deaf1 GIT binary patch literal 17347 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 ZOc(p9!-*IQz(41JhzrXI6$|Qq{6BsoSxo={ literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/pics/projection_3d.png b/doc/salome/gui/SMESH/pics/projection_3d.png new file mode 100644 index 0000000000000000000000000000000000000000..aeffc7a48ef713648990f2b2ea58269374db37b4 GIT binary patch literal 17967 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 Z{Ip{^n%89nzX%2*DkLRXD4^x_zW@bJ)Mfwx literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/pics/set_rotation_point_dialog1.png b/doc/salome/gui/SMESH/pics/set_rotation_point_dialog1.png new file mode 100644 index 0000000000000000000000000000000000000000..bdab73b7d27db6ae050080a7272dc68381abc665 GIT binary patch literal 11693 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 D+KM@S literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/pics/set_rotation_point_dialog2.png b/doc/salome/gui/SMESH/pics/set_rotation_point_dialog2.png new file mode 100644 index 0000000000000000000000000000000000000000..7f3696a56b58ae68df8131cb877dbc716bf601f6 GIT binary patch literal 11232 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 literal 0 HcmV?d00001 diff --git a/doc/salome/gui/SMESH/presentation.htm b/doc/salome/gui/SMESH/presentation.htm index 497621cae..21c5ae4cc 100755 --- a/doc/salome/gui/SMESH/presentation.htm +++ b/doc/salome/gui/SMESH/presentation.htm @@ -1,138 +1,138 @@ - - - - - -Presentation - - - - - - - - - - - - -

Display Mode

- -

By default your objects are represented as set in Preferences.

- -

However, right-clicking on the mesh in the Object - Browser, and selecting Display - Mode, you can display your mesh as: -

- -

 

- -

Wireframe -

- -

- -

 

- -

Shading

- -

- -

 

- -

or - Nodes.

- -

- -

 

- -

Wireframe can - combine with Nodes and - Shading.

- -

 

- -

Shading - and Wireframe modes can combine - with Shrink, however - Nodes can't.

- -

- -

 

- - - - + + + + + +Presentation + + + + + + + + + + + + +

Display Mode

+ +

By default your objects are represented as set in Preferences.

+ +

However, right-clicking on the mesh in the Object + Browser, and selecting Display + Mode, you can display your mesh as: +

+ +

 

+ +

Wireframe +

+ +

+ +

 

+ +

Shading

+ +

+ +

 

+ +

or + Nodes.

+ +

+ +

 

+ +

Wireframe can + combine with Nodes and + Shading.

+ +

 

+ +

Shading + and Wireframe modes can combine + with Shrink, however + Nodes can't.

+ +

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/prism_3d_algorithm.htm b/doc/salome/gui/SMESH/prism_3d_algorithm.htm new file mode 100644 index 000000000..da64656c0 --- /dev/null +++ b/doc/salome/gui/SMESH/prism_3d_algorithm.htm @@ -0,0 +1,116 @@ + + + + + +Prism 3D Algorithm + + + + + + + + + + + +

Prism 3D Algorithm

+ +

Prism 3D algorithm can be used for meshing prisms, i.e. 3D + Shapes defined by two opposing + faces having the same number of vertices and edges and meshed using the + 2D Projection algorithm. These + two faces should be connected by quadrangle "side" faces.

+ +

The opposing faces can be meshed with + either quadrangles or triangles, while the side faces should be meshed + with quadranglees only.

+ +

+ +

 

+ +

As you can see, the Prism3D + algorithm permits to build and to have in the same 3D mesh such elements + as hexahedrons, prisms and polyhedrons.

+ + + + diff --git a/doc/salome/gui/SMESH/projection_algorithms.htm b/doc/salome/gui/SMESH/projection_algorithms.htm new file mode 100644 index 000000000..3e1059b6b --- /dev/null +++ b/doc/salome/gui/SMESH/projection_algorithms.htm @@ -0,0 +1,179 @@ + + + + + +Projection Algorithms + + + + + + + + + + + +

Projection Algorithms

+ +

Projection algorithms allow + to define the mesh of a geometrical object by the projection of another + already meshed geometrical object.

+ +

 

+ +

Projection + 1D algorithm permits to define the mesh of an edge by the projection + of another already meshed edge.

+ +

To apply this algorithm + select the edge to be meshed (indicated in the field Geometry + of Create mesh dialog box), Projection 1D in the list of 1D algorithms + and click the button. The following dialog box will appear: +

+ +

+ +

In this menu you can define the Name + of the algorithm, the algeady meshed source Edge + and the Mesh (optional, use it + if there are several different meshes on the same edge). It could also + be necessary to define the orientation of edges, which is done by indicating + the Source Vertex being the first + point of the Source Edge and the Target + Vertex being the first point of the created Edge.

+ +

Projection 2D algorithm permits to define the mesh of a face + by the projection of another already meshed face. This algorithm works + only if all edges of the target + face have been meshed as 1D Projections of the edges of the source face.

+ +

To apply this algorithm select the face to be meshed (indicated in the + field Geometry of + Create mesh dialog box), Projection + 2D in the list of 2D algorithms and click the button. + The following dialog box will appear:

+ +

+ +

In this menu you can define the Name + of the algorithm, the algeady meshed source Face + and the Mesh (optional, use it + if there are several different meshes on the same face). It could also + be necessary to define the orientation of mesh on the face, which is done + by indicating two Source Vertices, which + belong to the same edge of the source + face, and two Target Vertices, + which belong to the same edge of the created + Face.

+ +

Projection 3D algorithm permits + to define the mesh of a shape by the projection of another already meshed + shape.  This + algorithm works only if all faces and edges of the + target face have been meshed as 1D Projections of the faces and + edges of the source face. Another limitation is that this algorithm currently + works only on boxes.

+ +

To apply this algorithm select the solid to be meshed (indicated in + the field Geometry of + Create mesh dialog box), Projection + 3D in the list of 3D algorithms and click the button. + The following dialog box will appear:

+ +

+ +

In this menu you can define the Name + of the algorithm, the algeady meshed source 3D + shape and the Mesh (optional, + use it if there are several different meshes on the same shape). It could + also be necessary to define the orientation of mesh on the shape, which + is done by indicating two Source Vertices, + which belong to the same edge of the + source 3D Shape, and two Target Vertices, which belong to the + same edge of the source 3D Shape.

+ + + + diff --git a/doc/salome/gui/SMESH/quality_controls.htm b/doc/salome/gui/SMESH/quality_controls.htm index bc5dd720b..064d7b9eb 100755 --- a/doc/salome/gui/SMESH/quality_controls.htm +++ b/doc/salome/gui/SMESH/quality_controls.htm @@ -1,1673 +1,1270 @@ - - - - - -Quality Controls - - - - - - - - - - - -

Quality Controls

- -

Free Borders

- -

# Attention! This script has been written - using the old approach basing on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to check free borders.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import geompy

- -

 

- -

import smesh

- -

import SMESH

- -

 

- -

# create open shell: a - box without one plane

- -

box = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

FaceList = geompy.SubShapeAll(box, - geompy.ShapeType["FACE"])

- -

FaceList.remove(FaceList[5])

- -

box = geompy.MakeShell(FaceList)

- -

idbox = geompy.addToStudy(box, - "box")

- -

 

- -

# create a mesh

- -

tria = smesh.Mesh(box, - "Mesh_free_borders")

- -

algo = tria.Segment()

- -

algo.NumberOfSegments(5)

- -

algo = tria.Triangle()

- -

algo.MaxElementArea(20.)

- -

tria.Compute()

- -

 

- -

mesh = tria.GetMesh()

- -

gen = smesh.smesh

- -

 

- -

# criterion : free borders

- -

aFilterMgr = gen.CreateFilterManager()

- -

aPredicate = aFilterMgr.CreateFreeBorders()

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Free borders Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.EDGE, - "Free borders")

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

Borders at Multiconnection

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to check borders at multiconnection.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import geompy

- -

 

- -

import smesh

- -

import SMESH

- -

 

- -

# create open shell: - a box without one plane

- -

box = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

FaceList = geompy.SubShapeAll(box, - geompy.ShapeType["FACE"])

- -

FaceList.remove(FaceList[5])

- -

box = geompy.MakeShell(FaceList)

- -

idbox = geompy.addToStudy(box, - "box")

- -

 

- -

# create a mesh

- -

tria = smesh.Mesh(box, - "Mesh_borders_at_multi-connections")

- -

algo = tria.Segment()

- -

algo.NumberOfSegments(5)

- -

algo = tria.Triangle()

- -

algo.MaxElementArea(20.)

- -

tria.Compute()

- -

mesh = tria.GetMesh()

- -

gen = smesh.smesh

- -

 

- -

# Criterion : Borders - at multi-connection

- -

nb_conn = 2

- -

 

- -

aFilterMgr = gen.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateMultiConnection()

- -

 

- -

aPredicate = aFilterMgr.CreateEqualTo()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(nb_conn)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Borders at multi-connections Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.EDGE, - "Borders at multi-connections")

- -

aGroup.Add(anIds)

- -

salome.sg.updateObjBrowser(1) -

- -

Length 1D

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to check length 1D.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import geompy

- -

 

- -

import smesh

- -

import SMESH

- -

 

- -

# create open shell: a - box without one plane

- -

box = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

FaceList = geompy.SubShapeAll(box, - geompy.ShapeType["FACE"])

- -

FaceList.remove(FaceList[5])

- -

box = geompy.MakeShell(FaceList)

- -

idbox = geompy.addToStudy(box, - "box")

- -

 

- -

# create a mesh

- -

tria = smesh.Mesh(box, - "Mesh_Length_1D")

- -

algo = tria.Segment()

- -

algo.NumberOfSegments(5)

- -

algo = tria.Triangle()

- -

algo.MaxElementArea(20.)

- -

tria.Compute()

- -

mesh = tria.GetMesh()

- -

gen = smesh.smesh

- -

 

- -

# Criterion : Length > - 3.

- -

length_margin = - 3.

- -

 

- -

aFilterMgr = gen.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateLength()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(length_margin)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Edges length > ", length_margin, " Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.EDGE, - "Edges with length > " + `length_margin`)

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

Free Edges

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to check free edges.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

 

- -

# Remove some elements - to obtain free edges

- -

# Criterion : AREA - > 95.

- -

area_margin = 95.

- -

 

- -

aFunctor = aFilterMgr.CreateArea()

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(area_margin)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

anEditor = mesh.GetMeshEditor()

- -

anEditor.RemoveElements(anIds)

- -

 

- -

# Criterion : Free - Edges

- -

aPredicate = aFilterMgr.CreateFreeEdges()

- -

aPredicate.SetMesh(mesh)

- -

aBorders = aPredicate.GetBorders()

- -

 

- -

# create groups

- -

aGroupF = mesh.CreateGroup(SMESH.FACE, - "Faces with free edges")

- -

aGroupN = mesh.CreateGroup(SMESH.NODE, - "Nodes on free edges")

- -

 

- -

# fill groups with - elements, corresponding to the criterion

- -

print ""

- -

print "Criterion: - Free edges Nb = ", len(aBorders)

- -

for i in range(len(aBorders)):

- -

  aBorder - = aBorders[i]

- -

  print - "Face # ", aBorder.myElemId, " : Edge between nodes (",

- -

  print - aBorder.myPnt1, ", ", aBorder.myPnt2, ")"

- -

 

- -

  aGroupF.Add([aBorder.myElemId])

- -

  aGroupN.Add([aBorder.myPnt1, - aBorder.myPnt2])

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Length 2D

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to check length 2D.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import geompy

- -

 

- -

import smesh

- -

import SMESH

- -

 

- -

# create open shell: - a box without one plane

- -

box = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

FaceList = geompy.SubShapeAll(box, - geompy.ShapeType["FACE"])

- -

FaceList.remove(FaceList[5])

- -

box = geompy.MakeShell(FaceList)

- -

idbox = geompy.addToStudy(box, - "box")

- -

 

- -

# create a mesh

- -

tria = smesh.Mesh(box, - "Mesh_Length_2D")

- -

algo = tria.Segment()

- -

algo.NumberOfSegments(5)

- -

algo = tria.Triangle()

- -

algo.MaxElementArea(20.)

- -

tria.Compute()

- -

 

- -

mesh = tria.GetMesh()

- -

gen = smesh.smesh

- -

 

- -

# Criterion : Length - 2D > 5.7

- -

length_margin = - 5.7

- -

 

- -

aFilterMgr = gen.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateLength2D()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(length_margin)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Edges length 2D > ", length_margin, " Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.FACE, - "Faces with length 2D > " + `length_margin`)

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Borders at Multiconnection 2D

- -

# Attention! This script has - been written using the old approach basing on direct usage of SMESH idl - interface.

- -

# For the moment smesh package doesn't provide - methods to check borders at multiconnection 2D.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import geompy

- -

 

- -

import smesh

- -

import SMESH

- -

 

- -

# create a compound - of two glued boxes

- -

box1 = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

box2 = geompy.MakeTranslation(box1, - 0., 20., 0)

- -

comp = geompy.MakeCompound([box1, - box2])

- -

box = geompy.MakeGlueFaces(comp, - 0.000001)

- -

idbox = geompy.addToStudy(box, - "box")

- -

 

- -

# create a mesh

- -

tria = smesh.Mesh(box, - "Box compound : 2D triangle mesh")

- -

algo = tria.Segment()

- -

algo.NumberOfSegments(5)

- -

algo = tria.Triangle()

- -

algo.MaxElementArea(20.)

- -

tria.Compute()

- -

 

- -

mesh = tria.GetMesh()

- -

gen = smesh.smesh

- -

 

- -

# Criterion : MULTI-CONNECTION - 2D = 3

- -

nb_conn = 3

- -

 

- -

aFilterMgr = gen.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateMultiConnection2D()

- -

 

- -

aPredicate = aFilterMgr.CreateEqualTo()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(nb_conn)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Borders at multi-connection 2D = ", nb_conn, " Nb = ", - len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.FACE, - "Borders at multi-connection 2D = " + `nb_conn`)

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Area

- -

# Attention! This script has - been written using the old approach basing on direct usage of SMESH idl - interface.

- -

# For the moment smesh package doesn't provide - methods to check area.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# Criterion : AREA > - 100.

- -

area_margin = 100.

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateArea()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(area_margin)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Area > ", area_margin, " Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.FACE, - "Area > " + `area_margin`)

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

Taper

- -

# Attention! This script has - been written using the old approach basing on direct usage of SMESH idl - interface.

- -

# For the moment smesh package doesn't provide - methods to check taper.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# Criterion : Taper - > 3e-20

- -

taper_margin = 3e-20

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateTaper()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(taper_margin)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Taper > ", taper_margin, " Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.FACE, - "Taper > " + `taper_margin`)

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

Aspect Ratio

- -

# Attention! This script has - been written using the old approach basing on direct usage of SMESH idl - interface.

- -

# For the moment smesh package doesn't provide - methods to check aspect ratio.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# Criterion : ASPECT - RATIO > 1.8

- -

ar_margin = 1.8

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateAspectRatio()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(ar_margin)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Aspect Ratio > ", ar_margin, " Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.FACE, - "Aspect Ratio > " + `ar_margin`)

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Minimum Angle

- -

# Attention! This script has - been written using the old approach basing on direct usage of SMESH idl - interface.

- -

# For the moment smesh package doesn't provide - methods to check minimum angle.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# Criterion : MINIMUM - ANGLE < 35.

- -

min_angle = 35.

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateMinimumAngle()

- -

 

- -

aPredicate = aFilterMgr.CreateLessThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(min_angle)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Minimum Angle < ", min_angle, " Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.FACE, - "Minimum Angle < " + `min_angle`)

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Warping

- -

# Attention! This script has - been written using the old approach basing on direct usage of SMESH idl - interface.

- -

# For the moment smesh package doesn't provide - methods to check warping.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# Criterion : WARP - ANGLE > 1e-15

- -

wa_margin = 1e-15

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateWarping()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(wa_margin)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Warp > ", wa_margin, " Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.FACE, - "Warp > " + `wa_margin`)

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Skew

- -

# Attention! This script has - been written using the old approach basing on direct usage of SMESH idl - interface.

- -

# For the moment smesh package doesn't provide - methods to check skew.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

smesh  = - SMESH_mechanic.smesh

- -

mesh   = - SMESH_mechanic.mesh

- -

salome = SMESH_mechanic.salome

- -

 

- -

# Criterion : Skew - > 38.

- -

skew_margin = 38.

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateSkew()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(skew_margin)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Skew > ", skew_margin, " Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.FACE, - "Skew > " + `skew_margin`)

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Aspect Ratio 3D

- -

# Attention! This script has - been written using the old approach basing on direct usage of SMESH idl - interface.

- -

# For the moment smesh package doesn't provide - methods to check aspect ratio 3D.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic_tetra

- -

 

- -

smesh  = - SMESH_mechanic_tetra.smesh

- -

mesh   = - SMESH_mechanic_tetra.mesh

- -

salome = SMESH_mechanic_tetra.salome

- -

 

- -

# Criterion : ASPECT - RATIO 3D > 4.5

- -

ar_margin = 4.5

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateAspectRatio3D()

- -

 

- -

aPredicate = aFilterMgr.CreateMoreThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(ar_margin)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print "Criterion: - Aspect Ratio 3D > ", ar_margin, " Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.VOLUME, - "Aspect Ratio 3D > " + `ar_margin`)

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

Volume

- -

# Attention! This script has - been written using the old approach basing on direct usage of SMESH idl - interface.

- -

# For the moment smesh package doesn't provide - methods to check volume.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic_tetra

- -

 

- -

smesh  = - SMESH_mechanic_tetra.smesh

- -

mesh   = - SMESH_mechanic_tetra.mesh

- -

salome = SMESH_mechanic_tetra.salome

- -

 

- -

# Criterion : VOLUME < - 7.

- -

volume_margin = - 7.

- -

 

- -

aFilterMgr = smesh.CreateFilterManager()

- -

aFunctor = aFilterMgr.CreateVolume3D()

- -

 

- -

aPredicate = aFilterMgr.CreateLessThan()

- -

aPredicate.SetNumFunctor(aFunctor)

- -

aPredicate.SetMargin(volume_margin)

- -

 

- -

aFilter = aFilterMgr.CreateFilter()

- -

aFilter.SetPredicate(aPredicate)

- -

 

- -

anIds = aFilter.GetElementsId(mesh)

- -

 

- -

# print the result

- -

print ""

- -

print "Criterion: - Volume < ", volume_margin, " Nb = ", len(anIds)

- -

j = 1

- -

for i in range(len(anIds)):

- -

  if - j > 20: j = 1; print ""

- -

  print - anIds[i],

- -

  j - = j + 1

- -

  pass

- -

print ""

- -

 

- -

# create a group

- -

aGroup = mesh.CreateGroup(SMESH.VOLUME, - "Volume < " + `volume_margin`)

- -

aGroup.Add(anIds)

- -

 

- -

salome.sg.updateObjBrowser(1) -

- - - - + + + + + +Quality Controls + + + + + + + + + + + +

Quality Controls

+ +

Free Borders

+ +

import salome

+ +

import geompy

+ +

 

+ +

import smesh

+ +

 

+ +

# create open shell: a + box without one plane

+ +

box + = geompy.MakeBox(0., 0., 0., 20., 20., 15.)

+ +

FaceList = geompy.SubShapeAll(box, + geompy.ShapeType["FACE"])

+ +

FaceList.remove(FaceList[5])

+ +

box = geompy.MakeShell(FaceList)

+ +

idbox = geompy.addToStudy(box, + "box")

+ +

 

+ +

# create a mesh

+ +

mesh + = smesh.Mesh(box, "Mesh_free_borders")

+ +

algo = mesh.Segment()

+ +

algo.NumberOfSegments(5)

+ +

algo = mesh.Triangle()

+ +

algo.MaxElementArea(20.)

+ +

mesh.Compute()

+ +

 

+ +

# criterion : free borders

+ +

aFilter + = smesh.GetFilter(smesh.EDGE, smesh.FT_FreeBorders)

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

 

+ +

# print the result

+ +

print "Criterion: + Free borders Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup(SMESH.EDGE, + "Free borders")

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

Borders at Multiconnection

+ +

import salome

+ +

import geompy

+ +

 

+ +

import smesh

+ +

import SMESH

+ +

 

+ +

# create open shell: + a box without one plane

+ +

box = geompy.MakeBox(0., + 0., 0., 20., 20., 15.)

+ +

FaceList = geompy.SubShapeAll(box, + geompy.ShapeType["FACE"])

+ +

FaceList.remove(FaceList[5])

+ +

box = geompy.MakeShell(FaceList)

+ +

idbox = geompy.addToStudy(box, + "box")

+ +

 

+ +

# create a mesh

+ +

mesh + = smesh.Mesh(box, "Mesh_borders_at_multi-connections")

+ +

algo = mesh.Segment()

+ +

algo.NumberOfSegments(5)

+ +

algo = mesh.Triangle()

+ +

algo.MaxElementArea(20.)

+ +

mesh.Compute()

+ +

 

+ +

# Criterion : Borders + at multi-connection

+ +

nb_conn = 2

+ +

 

+ +

aFilter + = smesh.GetFilter(smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, + nb_conn)

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

 

+ +

# print the result

+ +

print "Criterion: + Borders at multi-connections Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup(SMESH.EDGE, + "Borders at multi-connections")

+ +

aGroup.Add(anIds)

+ +

salome.sg.updateObjBrowser(1) +

+ +

Length 1D

+ +

import salome

+ +

import geompy

+ +

 

+ +

import smesh

+ +

 

+ +

# create open shell: a + box without one plane

+ +

box = geompy.MakeBox(0., + 0., 0., 20., 20., 15.)

+ +

FaceList = geompy.SubShapeAll(box, + geompy.ShapeType["FACE"])

+ +

FaceList.remove(FaceList[5])

+ +

box = geompy.MakeShell(FaceList)

+ +

idbox = geompy.addToStudy(box, + "box")

+ +

 

+ +

# create a mesh

+ +

mesh + = smesh.Mesh(box, "Mesh_Length_1D")

+ +

algo = mesh.Segment()

+ +

algo.NumberOfSegments(5)

+ +

algo = mesh.Triangle()

+ +

algo.MaxElementArea(20.)

+ +

mesh.Compute()

+ +

 

+ +

# Criterion : Length > + 3.

+ +

length_margin = + 3.

+ +

 

+ +

aFilter + = smesh.GetFilter(smesh.EDGE, smesh.FT_Length, smesh.FT_MoreThan, length_margin)

+ +

anIds = mesh.GetIdsFromFilter(aFilter) +

+ +

 

+ +

# print the result

+ +

print "Criterion: + Edges length > ", length_margin, " Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateGroup(SMESH.EDGE, + "Edges with length > " + `length_margin`)

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

Free Edges

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

aFilterMgr = smesh.CreateFilterManager()

+ +

 

+ +

# Remove some elements + to obtain free edges

+ +

# Criterion : AREA + > 95.

+ +

area_margin = 95.

+ +

 

+ +

aFilter + = smesh.GetFilter(smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, area_margin)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

mesh.RemoveElements(anIds)

+ +

 

+ +

# Criterion : Free + Edges

+ +

aBorders = mesh.GetFreeBorders() +

+ +

 

+ +

# create groups

+ +

aGroupF = mesh.CreateGroup(SMESH.FACE, + "Faces with free edges")

+ +

aGroupN = mesh.CreateGroup(SMESH.NODE, + "Nodes on free edges")

+ +

 

+ +

# fill groups with + elements, corresponding to the criterion

+ +

print ""

+ +

print "Criterion: + Free edges Nb = ", len(aBorders)

+ +

for i in range(len(aBorders)):

+ +

  aBorder + = aBorders[i]

+ +

  print + "Face # ", aBorder.myElemId, " : Edge between nodes (",

+ +

  print + aBorder.myPnt1, ", ", aBorder.myPnt2, ")"

+ +

 

+ +

  aGroupF.Add([aBorder.myElemId])

+ +

  aGroupN.Add([aBorder.myPnt1, + aBorder.myPnt2])

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Length 2D

+ +

import salome

+ +

import geompy

+ +

 

+ +

import smesh

+ +

 

+ +

# create open shell: + a box without one plane

+ +

box = geompy.MakeBox(0., + 0., 0., 20., 20., 15.)

+ +

FaceList = geompy.SubShapeAll(box, + geompy.ShapeType["FACE"])

+ +

FaceList.remove(FaceList[5])

+ +

box = geompy.MakeShell(FaceList)

+ +

idbox = geompy.addToStudy(box, + "box")

+ +

 

+ +

# create a mesh

+ +

mesh + = smesh.Mesh(box, "Mesh_Length_2D")

+ +

algo = mesh.Segment()

+ +

algo.NumberOfSegments(5)

+ +

algo = mesh.Triangle()

+ +

algo.MaxElementArea(20.)

+ +

mesh.Compute()

+ +

 

+ +

# Criterion : Length + 2D > 5.7

+ +

length_margin = + 5.7

+ +

 

+ +

aFilter + = smesh.GetFilter(smesh.FACE, smesh.FT_Length2D, smesh.FT_MoreThan, length_margin)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

# print the result

+ +

print "Criterion: + Edges length 2D > ", length_margin, " Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup + = mesh.CreateEmptyGroup(smesh.FACE, "Faces with length 2D > " + + `length_margin`)

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Borders at Multiconnection 2D

+ +

import salome

+ +

import geompy

+ +

 

+ +

import smesh

+ +

 

+ +

# create a compound + of two glued boxes

+ +

box1 = geompy.MakeBox(0., + 0., 0., 20., 20., 15.)

+ +

box2 = geompy.MakeTranslation(box1, + 0., 20., 0)

+ +

comp = geompy.MakeCompound([box1, + box2])

+ +

box = geompy.MakeGlueFaces(comp, + 0.000001)

+ +

idbox = geompy.addToStudy(box, + "box")

+ +

 

+ +

# create a mesh

+ +

mesh + = smesh.Mesh(box, "Box compound : 2D triangle mesh")

+ +

algo = mesh.Segment()

+ +

algo.NumberOfSegments(5)

+ +

algo = mesh.Triangle()

+ +

algo.MaxElementArea(20.)

+ +

mesh.Compute()

+ +

 

+ +

# Criterion : MULTI-CONNECTION + 2D = 3

+ +

nb_conn = 3

+ +

 

+ +

aFilter + = smesh.GetFilter(smesh.FACE, smesh.FT_MultiConnection2D, smesh.FT_EqualTo, + nb_conn)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter) +

+ +

 

+ +

# print the result

+ +

print "Criterion: + Borders at multi-connection 2D = ", nb_conn, " Nb = ", + len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup + = mesh.CreateEmptyGroup(smesh.FACE, "Borders at multi-connection + 2D = " + `nb_conn`)

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Area

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# Criterion : AREA > + 100.

+ +

area_margin = 100.

+ +

 

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Area, smesh.FT_MoreThan, area_margin)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter) +

+ +

 

+ +

# print the result

+ +

print "Criterion: + Area > ", area_margin, " Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateEmptyGroup(smesh.FACE, + "Area > " + `area_margin`)

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +  

+ +

Taper

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# Criterion : Taper + > 3e-20

+ +

taper_margin = 3e-20

+ +

 

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Taper, smesh.FT_MoreThan, taper_margin)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter) +

+ +

 

+ +

# print the result

+ +

print "Criterion: + Taper > ", taper_margin, " Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup + = mesh.CreateEmptyGroup(smesh.FACE, "Taper > " + `taper_margin`)

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +  

+ +

Aspect Ratio

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# Criterion : ASPECT + RATIO > 1.8

+ +

ar_margin = 1.8

+ +

 

+ +

aFilter + = smesh.GetFilter(smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, + ar_margin)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter) +

+ +

 

+ +

# print the result

+ +

print "Criterion: + Aspect Ratio > ", ar_margin, " Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup + = mesh.CreateEmptyGroup(smesh.FACE, "Aspect Ratio > " + `ar_margin`)

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Minimum Angle

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# Criterion : MINIMUM + ANGLE < 35.

+ +

min_angle = 35.

+ +

 

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_MinimumAngle, smesh.FT_LessThan, min_angle)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter) +

+ +

 

+ +

# print the result

+ +

print "Criterion: + Minimum Angle < ", min_angle, " Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup + = mesh.CreateEmptyGroup(smesh.FACE, "Minimum Angle < " + + `min_angle`)

+ +

 

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Warping

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# Criterion : WARP + ANGLE > 1e-15

+ +

wa_margin = 1e-15

+ +

 

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Warping, smesh.FT_MoreThan, wa_margin)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter) +

+ +

 

+ +

# print the result

+ +

print "Criterion: + Warp > ", wa_margin, " Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateEmptyGroup(smesh.FACE, + "Warp > " + `wa_margin`)

+ +

 

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Skew

+ +

import SMESH_mechanic

+ +

 

+ +

smesh  = + SMESH_mechanic.smesh

+ +

mesh   = + SMESH_mechanic.mesh

+ +

salome = SMESH_mechanic.salome

+ +

 

+ +

# Criterion : Skew + > 38.

+ +

skew_margin = 38.

+ +

 

+ +

aFilter = smesh.GetFilter(smesh.FACE, + smesh.FT_Skew, smesh.FT_MoreThan, skew_margin)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter)

+ +

 

+ +

# print the result

+ +

print "Criterion: + Skew > ", skew_margin, " Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup + = mesh.CreateEmptyGroup(smesh.FACE, "Skew > " + `skew_margin`)

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Aspect Ratio 3D

+ +

import SMESH_mechanic_tetra +

+ +

 

+ +

smesh  = + SMESH_mechanic_tetra.smesh

+ +

mesh   = + SMESH_mechanic_tetra.mesh

+ +

salome = SMESH_mechanic_tetra.salome

+ +

 

+ +

# Criterion : ASPECT + RATIO 3D > 4.5

+ +

ar_margin = 4.5

+ +

 

+ +

aFilter = smesh.GetFilter(smesh.VOLUME, + smesh.FT_AspectRatio3D, smesh.FT_MoreThan, ar_margin)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter) +

+ +

 

+ +

# print the result

+ +

print "Criterion: + Aspect Ratio 3D > ", ar_margin, " Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, + "Aspect Ratio 3D > " + `ar_margin`)

+ +

 

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

Volume

+ +

import SMESH_mechanic_tetra

+ +

 

+ +

smesh  = + SMESH_mechanic_tetra.smesh

+ +

mesh   = + SMESH_mechanic_tetra.mesh

+ +

salome = SMESH_mechanic_tetra.salome

+ +

 

+ +

# Criterion : VOLUME < + 7.

+ +

volume_margin = + 7.

+ +

 

+ +

aFilter = smesh.GetFilter(smesh.VOLUME, + smesh.FT_Volume3D, smesh.FT_LessThan, volume_margin)

+ +

 

+ +

anIds = mesh.GetIdsFromFilter(aFilter) +

+ +

 

+ +

# print the result

+ +

print ""

+ +

print "Criterion: + Volume < ", volume_margin, " Nb = ", len(anIds)

+ +

j = 1

+ +

for i in range(len(anIds)):

+ +

  if + j > 20: j = 1; print ""

+ +

  print + anIds[i],

+ +

  j + = j + 1

+ +

  pass

+ +

print ""

+ +

 

+ +

# create a group

+ +

aGroup = mesh.CreateEmptyGroup(smesh.VOLUME, + "Volume < " + `volume_margin`)

+ +

 

+ +

aGroup.Add(anIds)

+ +

 

+ +

salome.sg.updateObjBrowser(1) +  

+ + + + diff --git a/doc/salome/gui/SMESH/radial_prism.htm b/doc/salome/gui/SMESH/radial_prism.htm new file mode 100644 index 000000000..3ca448560 --- /dev/null +++ b/doc/salome/gui/SMESH/radial_prism.htm @@ -0,0 +1,124 @@ + + + + + +Radial Prism + + + + + + + + + + + +

Radial Prism

+ +

This algorithm applies to the meshing of a hollow 3D shape, i.e. such + shape should be composed of two meshed shells: an outer shell and an internal + shell without intersection with the outer shell. One of the shells should + be a 2D Projection of the other shell. The meshes of the shells can consist + both of triangles and quadrangles.

+ +

The Radial Prism algorithm would fill the + space between the two shells with meshes.

+ +

This algorithm also needs the information + concerning the number and distribution of mesh layers between the inner + and the outer shapes.

+ +

 

+ +

Distribution of layers can be set with any + of 1D Hypotheses.

+ +

+ +

 

+ +

 

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/revolution.htm b/doc/salome/gui/SMESH/revolution.htm index 177ed997c..b5d7a667d 100755 --- a/doc/salome/gui/SMESH/revolution.htm +++ b/doc/salome/gui/SMESH/revolution.htm @@ -1,156 +1,156 @@ - - - - - -Revolution - - - - - - - - - - - - -

Revolution

- -

Revolution is a type of surface meshing by generation from discretized - lines. It is used to build mesh elements of plus one dimension than the - swept ones. Each swept 1D element produces one or more quadrangles (or - triangles if one node of a rotated element lays on the revolution axis).

- -

 

- -

To apply revolution:

- -

 

- -

1. From the Modification - menu choose the Revolution item - or click button in the toolbar. The following dialog box - shall appear:

- -

 

- -

- -

 

- -

- -

 

- -

2. In this dialog box you should specify:

- -
    - -
  • the type of elements - which will be extruded (1D or 2D),

  • - -
  • specify the IDs of - the elements which will be revolved by selecting them in the 3D viewer - or select the whole mesh or submesh,

  • - -
  • specify the axis (point - and vector) around which the elements will be revolved,

  • - -
  • angle of rotation,

  • - -
  • number of steps,

  • - -
  • tolerance of rotation

  • -
- -

 

- -

3. Click the Apply - or OK button.

- -

 

- -

- -

 

- -

 See - Also a sample TUI Script of a  Revolution - operation.  

- -

 

- - - - + + + + + +Revolution + + + + + + + + + + + + +

Revolution

+ +

Revolution is a type of surface meshing by generation from discretized + lines. It is used to build mesh elements of plus one dimension than the + swept ones. Each swept 1D element produces one or more quadrangles (or + triangles if one node of a rotated element lays on the revolution axis).

+ +

 

+ +

To apply revolution:

+ +

 

+ +

1. From the Modification + menu choose the Revolution item + or click button in the toolbar. The following dialog box + shall appear:

+ +

 

+ +

+ +

 

+ +

+ +

 

+ +

2. In this dialog box you should specify:

+ +
    + +
  • the type of elements + which will be extruded (1D or 2D),

  • + +
  • specify the IDs of + the elements which will be revolved by selecting them in the 3D viewer + or select the whole mesh or submesh,

  • + +
  • specify the axis (point + and vector) around which the elements will be revolved,

  • + +
  • angle of rotation,

  • + +
  • number of steps,

  • + +
  • tolerance of rotation

  • +
+ +

 

+ +

3. Click the Apply + or OK button.

+ +

 

+ +

+ +

 

+ +

 See + Also a sample TUI Script of a  Revolution + operation.  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/selection_filter_library.htm b/doc/salome/gui/SMESH/selection_filter_library.htm index 93ed142e9..2a2cb8d78 100755 --- a/doc/salome/gui/SMESH/selection_filter_library.htm +++ b/doc/salome/gui/SMESH/selection_filter_library.htm @@ -1,159 +1,159 @@ - - - - - -Selection filter library - - - - - - - - - - - - -

Selection filter library

- -

Selection filter library is a powerful tool enabling to create filters - to be used on meshes. You can access to it from the Main Menu via Tools / Selection filter library.

- -

 

- -

- -

 

- -

Library file name shows - the path and the file name where your filters will be stored. By clicking - the browse button - you can load an existing filter library.

- -

Names of filters lists the filters - created or uploaded for the current study. You can Add - or Delete filters.  

- -

In Filter name box you can specify - the name for your filter. By default it is prefixed with the corresponding - entity type.

- -

Each filter can be applicable to Nodes, - Edges, Faces or Volumes. - You can combine many criteria in one filter, but they all must be of the - same Entity type.

- -

The Add button creates a new - criterion at the end of the list of criteria. The Insert - button creates a new criterion before the selected criterion. The Remove button deletes the selected criterion. - The Clear button deletes all criteria. -  

- -

Each Entity type has its specific - list of criteria, however all filters have common syntax. For each criterion - you should specify the Threshold Value - and whether we search for the elements that should be More, - Less or Equal to this Value. - You should also specify if the criterion is Unary - or Binary.   

- -

Some criteria should have the additional parameter of Tolerance.

- -

 

- -

When we create a Standalone Group - using filters (for this click Set Filters - button in the Create Group menu), - the menu for setting filters looks a bit differently. Toggling Insert - filter in viewer checkbox enables to preview the group selected - with your current filter in the viewer.

- -

In the Source field you choose - if the filter will be applied to the whole Mesh, - the Initial Selection or the Current Group.

- -

Copy from... button gives you - a possibility to load an existing filter from Selection - filter library and Add to... - button gives you a possibility to save your current filter in the Library. -  

- -

 

- -

- - - - + + + + + +Selection filter library + + + + + + + + + + + + +

Selection filter library

+ +

Selection filter library is a powerful tool enabling to create filters + to be used on meshes. You can access to it from the Main Menu via Tools / Selection filter library.

+ +

 

+ +

+ +

 

+ +

Library file name shows + the path and the file name where your filters will be stored. By clicking + the browse button + you can load an existing filter library.

+ +

Names of filters lists the filters + created or uploaded for the current study. You can Add + or Delete filters.  

+ +

In Filter name box you can specify + the name for your filter. By default it is prefixed with the corresponding + entity type.

+ +

Each filter can be applicable to Nodes, + Edges, Faces or Volumes. + You can combine many criteria in one filter, but they all must be of the + same Entity type.

+ +

The Add button creates a new + criterion at the end of the list of criteria. The Insert + button creates a new criterion before the selected criterion. The Remove button deletes the selected criterion. + The Clear button deletes all criteria. +  

+ +

Each Entity type has its specific + list of criteria, however all filters have common syntax. For each criterion + you should specify the Threshold Value + and whether we search for the elements that should be More, + Less or Equal to this Value. + You should also specify if the criterion is Unary + or Binary.   

+ +

Some criteria should have the additional parameter of Tolerance.

+ +

 

+ +

When we create a Standalone Group + using filters (for this click Set Filters + button in the Create Group menu), + the menu for setting filters looks a bit differently. Toggling Insert + filter in viewer checkbox enables to preview the group selected + with your current filter in the viewer.

+ +

In the Source field you choose + if the filter will be applied to the whole Mesh, + the Initial Selection or the Current Group.

+ +

Copy from... button gives you + a possibility to load an existing filter from Selection + filter library and Add to... + button gives you a possibility to save your current filter in the Library. +  

+ +

 

+ +

+ + + + diff --git a/doc/salome/gui/SMESH/smesh.log b/doc/salome/gui/SMESH/smesh.log index 91e81418c..08ce66a7c 100755 --- a/doc/salome/gui/SMESH/smesh.log +++ b/doc/salome/gui/SMESH/smesh.log @@ -1,530 +1,530 @@ -|SourceProjectName:SMESH.hpr -|DestinationProjectName:index.htm -whhost.js -whmsg.js -whmozemu.js -whproxy.js -whstub.js -whutils.js -whver.js -whform.js -whphost.js -whstart.js -whtopic.js -whframes.js -whlang.js -whskin_info.htm -whskin_blank.htm -whskin_pickup.htm -whskin_homepage.htm -whskin_tw.htm -whnjs.htm -whthost.js -whtdhtml.htm -whihost.js -whibody.htm -whiform.htm -whfhost.js -whfbody.htm -whfform.htm -whghost.js -whgbody.htm -whgdhtml.htm -whgdef.htm -whproj.js -whproj.xml -whproj.htm -whxdata\whtoc.xml -whxdata\whidx.xml -whxdata\whfts.xml -whxdata\whglo.xml -whdata\whtoc.js -whdata\whtoc.htm -whdata\whtdata.js -whdata\whidx.js -whdata\whidx.htm -whdata\whidata.js -whdata\whfts.js -whdata\whfts.htm -whdata\whglo.js -whdata\whglo.htm -whdata\whgdata.js -whdata\whftdata.js -whdata\whfwdata.js -whres.xml -webhelp.jar -webhelp.cab -whgdata\whnvp30.htm -whgdata\whnvp31.htm -whgdata\whnvp32.htm -whgdata\whnvp33.htm -whgdata\whnvt30.htm -whgdata\whnvt31.htm -whgdata\whnvt32.htm -whgdata\whnvt33.htm -whgdata\whnvf30.htm -whgdata\whnvf31.htm -whgdata\whnvf32.htm -whgdata\whnvf33.htm -whgdata\whnvl31.htm -whgdata\whnvl32.htm -whgdata\whnvl33.htm -whgdata\whexpbar.gif -cshdat_webhelp.htm -whcsh_home.htm -whcshdata.htm -cshdat_robohelp.htm -whd_topic.xml -whd_nvp10.htm -whd_nvp20.htm -whd_tabs.htm -whd_dpns.htm -whd_tab0.gif -whd_tab1.gif -whd_tab2.gif -whd_tab3.gif -whd_tab4.gif -whd_tab5.gif -whd_tab6.gif -whd_tab7.gif -whd_tab8.gif -whd_toc1.gif -whd_toc2.gif -whd_toc3.gif -whd_toc4.gif -whd_show0.gif -whd_show1.gif -whd_show2.gif -whd_hide0.gif -whd_hide1.gif -whd_hide2.gif -whd_sync0.gif -whd_sync1.gif -whd_sync2.gif -whd_prev0.gif -whd_prev1.gif -whd_prev2.gif -whd_next0.gif -whd_next1.gif -whd_next2.gif -whd_wbsh0.gif -whd_wbsh1.gif -whd_wbsh2.gif -whidhtml.htm -whfdhtml.htm -index_hha.hhk -index.hhc -index.hhk -about_viewing_meshes.htm -adding_quadratic_nodes_and_elements.htm -aspect_ratio_3d.htm -borders_at_multi-connection.htm -borders_at_multiconnection_2d.htm -clipping.htm -constructing_meshes.htm -convert_to_from_quadratic_mesh.htm -defining_hypotheses_tui.htm -deleting_groups.htm -display_entity.htm -extrusion.htm -extrusion_along_a_path.htm -files\about_hypotheses.htm -files\about_meshes.htm -files\about_meshing_algorithms.htm -files\about_quality_controls.htm -files\adding_nodes_and_elements.htm -files\area_of_elements.htm -files\arithmetic_1d.htm -files\aspect_ratio.htm -files\changing_orientation_of_elements.htm -files\constructing_groups_of_specific_elements.htm -files\constructing_meshes.htm -files\constructing_submeshes.htm -files\creating_groups.htm -files\cutting_quadrangles.htm -files\diagonal_iversion_of_elements.htm -files\displacing_nodes.htm -files\displaying_nodes_numbers.htm -files\editing_groups.htm -files\importing_and_exporting_meshes.htm -files\length_of_edges.htm -files\max._element_area_hypothesis.htm -files\max._element_volume_hypothsis.htm -files\merging_nodes.htm -files\minimum_angle.htm -files\non_conform_mesh_allowed_hypothesis.htm -files\reassigning_hypotheses_and_algorithms.htm -files\removing_nodes_and_elements.htm -files\renumbering_nodes_and_elements.htm -files\rotation.htm -files\running_smesh_module.htm -files\sewing_meshes.htm -files\skew.htm -files\smoothing.htm -files\symmetry.htm -files\taper.htm -files\translation.htm -files\uniting_a_set_of_triangles.htm -files\uniting_two_triangles.htm -files\using_operations_on_groups.htm -files\viewing_mesh_info.htm -files\vtk_3d_viewer.htm -files\warp.htm -free_borders.htm -free_edges.htm -grouping_elements.htm -length.htm -merge_elements.htm -mesh.htm -modifying_meshes.htm -namespacesmesh.html -netgen_2d_and_3d_hypotheses.htm -pattern_mapping.htm -presentation.htm -quality_controls.htm -revolution.htm -selection_filter_library.htm -smesh.py_introduction.htm -transforming_meshes.htm -transparency.htm -viewing_meshes.htm -volume.htm -ehelp.xml -texture_horiz_ltbluebubbles.jpg -index.glo -default.css -pics\add_node.png -pics\remove_nodes2.png -pics\merging_nodes2.png -pics\moving_nodes2.png -pics\smoothing2.png -pics\b-mberofsegments.png -pics\b-flection1d.png -pics\a-cuttingofquadrangles.png -pics\addquadrangle.png -pics\intersectgroups.png -pics\editgroup.png -image95.jpg -pics\sewing1.png -image92.gif -image51.jpg -image70.gif -pics\netgen2d.png -pics\circle_simple_after.png -pics\curvi_simple_after.png -pics\image138.gif -pics\create_group.png -pics\edit_mesh_change_value_hyp.png -pics\free_borders1.png -pics\add_triangle.png -pics\b-art_end_length.png -pics\a-creategroup.png -pics\a-clipping2.png -pics\a-transparency.png -pics\diagonalinversion.png -pics\translation1.png -image96.jpg -pics\sewing2.png -image119.gif -image108.gif -image52.jpg -image82.gif -image71.gif -image30.jpg -pics\extrusion1.png -pics\distributionwithanalyticdensity.png -pics\image139.gif -pics\rotation1.png -pics\a-createpolyhedralvolume.png -pics\a-patterntype.png -pics\orientaation1.png -pics\translation2.png -pics\cutgroups.png -image97.jpg -pics\sewing3.png -image86.jpg -image50.gif -image94.gif -image83.gif -image31.jpg -pics\circle_angles_after.png -pics\circle_simple_before.png -pics\curvi_angles_after.png -pics\graduatedaxes1.png -pics\image107.gif -pics\automaticlength.png -pics\image27.gif -pics\add_polyhedron.png -pics\add_edge.png -pics\rotation2.png -pics\b-ithmetic1d.png -image10.jpg -pics\a-maxelarea.png -pics\addhexahedron.png -pics\addtetrahedron.png -image5.jpg -pics\sewing4.png -image95.gif -image76.jpg -image84.gif -image32.jpg -image40.gif -pics\curvi_simple_before.png -pics\image108.gif -pics\aqt.png -pics\distributionwithtabledensity.png -pics\smoothing.png -image88.jpg -image30.gif -image96.gif -image77.jpg -image74.gif -image63.gif -image22.jpg -image41.gif -pics\edge_wire_3d_before.png -pics\image109.gif -pics\meshimportmesh.png -pics\deletegroups.png -pics\editing_groups1.png -pics\uniting_two_triangles1.png -image7.jpg -pics\a-averagelength.png -pics\a-patterntype1.png -pics\extrusionalongaline1.png -pics\movenodes.png -pics\rotation.png -image56.jpg -image53.gif -image20.gif -image97.gif -image78.jpg -image64.gif -image23.jpg -pics\edge_wire_after.png -pics\edge_wire_before.png -image151.gif -pics\cut_groups1.png -pics\editing_groups2.png -pics\uniting_two_triangles2.png -pics\a-unionoftriangles.png -pics\a-arithmetic1d.png -pics\extrusionalongaline2.png -image79.jpg -image98.gif -image32.gif -pics\image91.gif -image152.gif -pics\cut_groups2.png -image130.gif -pics\max_el_area.png -pics\a-viewgeneral.png -pics\revolution1.png -pics\addtriangle.png -image99.gif -image55.gif -image88.gif -image36.jpg -image33.gif -image25.jpg -i_blue.jpg -image153.gif -image15.jpg -image142.gif -pics\cut_groups3.png -image131.gif -pics\add_quadrangle.png -pics\uniting_a_set_of_triangles1.png -pics\a-deflection1d.png -pics\revolution2.png -pics\unionoftwotriangles.png -pics\addnode.png -image120.gif -image56.gif -image37.jpg -image67.gif -image34.gif -pics\convert.png -image154.gif -image143.gif -image132.gif -pics\edit_mesh1.png -pics\remove_elements1.png -pics\uniting_a_set_of_triangles2.png -pics\mergenodes.png -pics\symmetry1.png -image121.gif -image79.gif -image38.jpg -image46.gif -image35.gif -image27.jpg -image24.gif -image155.gif -pics\mesh_for_extr_along_path.png -pics\createmesh-inv2.png -image144.gif -pics\intersect_groups1.png -image133.gif -pics\add_polygone.png -pics\remove_elements2.png -pics\a-maxelvolume.png -pics\symmetry2.png -image122.gif -image58.gif -image36.gif -image25.gif -note1.gif -image156.gif -pics\edge_wire_3d_after.png -pics\createmesh-inv3.png -image145.gif -pics\intersect_groups2.png -image134.gif -pics\b-mesh_infos.png -pics\symmetry3.png -pics\addedge.png -image123.gif -image101.gif -image37.gif -pics\straight_after.png -pics\image96.gif -image146.gif -pics\intersect_groups3.png -image135.gif -pics\b-erage_length.png -pics\a-standmeshinfo.png -pics\a-nbsegments1.png -pics\patternmapping1.png -image90.jpg -image124.gif -image49.gif -image38.gif -pics\image100.gif -pics\image97.gif -pics\length-crit.png -image147.gif -image136.gif -pics\a-nbsegments2.png -pics\a-startendlength.png -pics\patternmapping2.png -pics\removeelements.png -pics\removenodes.png -pics\uniongroups.png -image125.gif -image103.gif -pics\exemple.gif -image39.gif -image28.gif -pics\advanced_mesh_infos.png -pics\image98.gif -image148.gif -pics\meshexportmesh.png -pics\image21.gif -pics\union_groups1.png -image137.gif -pics\free_edges.png -pics\creategroup.png -image92.jpg -image126.gif -image18.gif -image70.jpg -pics\straight_before.png -pics\createmesh-inv.png -pics\image102.gif -pics\image99.gif -pics\image77.gif -pics\meshtrianglemergeelem1.png -pics\mergeelems.png -pics\union_groups2.png -pics\length2d.png -pics\renumbernodes.png -image127.gif -image93.jpg -image105.gif -image19.gif -image71.jpg -pics\image89.gif -pics\image78.gif -pics\image23.gif -pics\selectionfilterlibrary.png -pics\union_groups3.png -pics\edit_mesh_remove_hyp.png -pics\remove_nodes1.png -pics\merging_nodes1.png -pics\moving_nodes1.png -pics\smoothing1.png -pics\a-filteronedges.png -pics\renumberelements.png -pics\addpolygon.png -image94.jpg -image106.gif -image91.gif -image80.gif -index.ppf -ehlpdhtm.js -default_ns.css -whxdata\whtdata0.xml -whxdata\whftdata0.xml -whxdata\whfwdata0.xml -whxdata\whgdata0.xml -whdata\whtdata0.htm -whdata\whftdata0.htm -whdata\whfwdata0.htm -whdata\whgdata0.htm -whgdata\whlstt0.htm -whgdata\whlstt1.htm -whgdata\whlstt2.htm -whgdata\whlstt3.htm -whgdata\whlstt4.htm -whgdata\whlstt5.htm -whgdata\whlstt6.htm -whgdata\whlstt7.htm -whgdata\whlstt8.htm -whgdata\whlstt9.htm -whgdata\whlsti0.htm -whgdata\whlstfl0.htm -whgdata\whlstfl1.htm -whgdata\whlstfl2.htm -whgdata\whlstfl3.htm -whgdata\whlstfl4.htm -whgdata\whlstfl5.htm -whgdata\whlstfl6.htm -whgdata\whlstfl7.htm -whgdata\whlstfl8.htm -whgdata\whlstfl9.htm -whgdata\whlstfl10.htm -whgdata\whlstfl11.htm -whgdata\whlstfl12.htm -whgdata\whlstfl13.htm -whgdata\whlstfl14.htm -whgdata\whlstfl15.htm -whgdata\whlstfl16.htm -whgdata\whlstfl17.htm -whgdata\whlstfl18.htm -whgdata\whlstfl19.htm -whgdata\whlstfl20.htm -whgdata\whlstfl21.htm -whgdata\whlstfl22.htm -whgdata\whlstfl23.htm -whgdata\whlstfl24.htm -whgdata\whlstfl25.htm -whgdata\whlstf0.htm -whgdata\whlstf1.htm -whgdata\whlstf2.htm -whgdata\whlstf3.htm -whgdata\whlstf4.htm -whgdata\whlstf5.htm -whgdata\whlstf6.htm -whgdata\whlstf7.htm -whgdata\whlstf8.htm -whgdata\whlstf9.htm -whgdata\whlstf10.htm -whgdata\whlstf11.htm -whgdata\whlstf12.htm -whgdata\whlstf13.htm -whgdata\whlstf14.htm -whgdata\whlstg0.htm -index.htm -index_csh.htm -index_rhc.htm +|SourceProjectName:SMESH.hpr +|DestinationProjectName:index.htm +whhost.js +whmsg.js +whmozemu.js +whproxy.js +whstub.js +whutils.js +whver.js +whform.js +whphost.js +whstart.js +whtopic.js +whframes.js +whlang.js +whskin_info.htm +whskin_blank.htm +whskin_pickup.htm +whskin_homepage.htm +whskin_tw.htm +whnjs.htm +whthost.js +whtdhtml.htm +whihost.js +whibody.htm +whiform.htm +whfhost.js +whfbody.htm +whfform.htm +whghost.js +whgbody.htm +whgdhtml.htm +whgdef.htm +whproj.js +whproj.xml +whproj.htm +whxdata\whtoc.xml +whxdata\whidx.xml +whxdata\whfts.xml +whxdata\whglo.xml +whdata\whtoc.js +whdata\whtoc.htm +whdata\whtdata.js +whdata\whidx.js +whdata\whidx.htm +whdata\whidata.js +whdata\whfts.js +whdata\whfts.htm +whdata\whglo.js +whdata\whglo.htm +whdata\whgdata.js +whdata\whftdata.js +whdata\whfwdata.js +whres.xml +webhelp.jar +webhelp.cab +whgdata\whnvp30.htm +whgdata\whnvp31.htm +whgdata\whnvp32.htm +whgdata\whnvp33.htm +whgdata\whnvt30.htm +whgdata\whnvt31.htm +whgdata\whnvt32.htm +whgdata\whnvt33.htm +whgdata\whnvf30.htm +whgdata\whnvf31.htm +whgdata\whnvf32.htm +whgdata\whnvf33.htm +whgdata\whnvl31.htm +whgdata\whnvl32.htm +whgdata\whnvl33.htm +whgdata\whexpbar.gif +cshdat_webhelp.htm +whcsh_home.htm +whcshdata.htm +cshdat_robohelp.htm +whd_topic.xml +whd_nvp10.htm +whd_nvp20.htm +whd_tabs.htm +whd_dpns.htm +whd_tab0.gif +whd_tab1.gif +whd_tab2.gif +whd_tab3.gif +whd_tab4.gif +whd_tab5.gif +whd_tab6.gif +whd_tab7.gif +whd_tab8.gif +whd_toc1.gif +whd_toc2.gif +whd_toc3.gif +whd_toc4.gif +whd_show0.gif +whd_show1.gif +whd_show2.gif +whd_hide0.gif +whd_hide1.gif +whd_hide2.gif +whd_sync0.gif +whd_sync1.gif +whd_sync2.gif +whd_prev0.gif +whd_prev1.gif +whd_prev2.gif +whd_next0.gif +whd_next1.gif +whd_next2.gif +whd_wbsh0.gif +whd_wbsh1.gif +whd_wbsh2.gif +whidhtml.htm +whfdhtml.htm +index_hha.hhk +index.hhc +index.hhk +about_viewing_meshes.htm +adding_quadratic_nodes_and_elements.htm +aspect_ratio_3d.htm +borders_at_multi-connection.htm +borders_at_multiconnection_2d.htm +clipping.htm +constructing_meshes.htm +convert_to_from_quadratic_mesh.htm +defining_hypotheses_tui.htm +deleting_groups.htm +display_entity.htm +extrusion.htm +extrusion_along_a_path.htm +files\about_hypotheses.htm +files\about_meshes.htm +files\about_meshing_algorithms.htm +files\about_quality_controls.htm +files\adding_nodes_and_elements.htm +files\area_of_elements.htm +files\arithmetic_1d.htm +files\aspect_ratio.htm +files\changing_orientation_of_elements.htm +files\constructing_groups_of_specific_elements.htm +files\constructing_meshes.htm +files\constructing_submeshes.htm +files\creating_groups.htm +files\cutting_quadrangles.htm +files\diagonal_iversion_of_elements.htm +files\displacing_nodes.htm +files\displaying_nodes_numbers.htm +files\editing_groups.htm +files\importing_and_exporting_meshes.htm +files\length_of_edges.htm +files\max._element_area_hypothesis.htm +files\max._element_volume_hypothsis.htm +files\merging_nodes.htm +files\minimum_angle.htm +files\non_conform_mesh_allowed_hypothesis.htm +files\reassigning_hypotheses_and_algorithms.htm +files\removing_nodes_and_elements.htm +files\renumbering_nodes_and_elements.htm +files\rotation.htm +files\running_smesh_module.htm +files\sewing_meshes.htm +files\skew.htm +files\smoothing.htm +files\symmetry.htm +files\taper.htm +files\translation.htm +files\uniting_a_set_of_triangles.htm +files\uniting_two_triangles.htm +files\using_operations_on_groups.htm +files\viewing_mesh_info.htm +files\vtk_3d_viewer.htm +files\warp.htm +free_borders.htm +free_edges.htm +grouping_elements.htm +length.htm +merge_elements.htm +mesh.htm +modifying_meshes.htm +namespacesmesh.html +netgen_2d_and_3d_hypotheses.htm +pattern_mapping.htm +presentation.htm +quality_controls.htm +revolution.htm +selection_filter_library.htm +smesh.py_introduction.htm +transforming_meshes.htm +transparency.htm +viewing_meshes.htm +volume.htm +ehelp.xml +texture_horiz_ltbluebubbles.jpg +index.glo +default.css +pics\add_node.png +pics\remove_nodes2.png +pics\merging_nodes2.png +pics\moving_nodes2.png +pics\smoothing2.png +pics\b-mberofsegments.png +pics\b-flection1d.png +pics\a-cuttingofquadrangles.png +pics\addquadrangle.png +pics\intersectgroups.png +pics\editgroup.png +image95.jpg +pics\sewing1.png +image92.gif +image51.jpg +image70.gif +pics\netgen2d.png +pics\circle_simple_after.png +pics\curvi_simple_after.png +pics\image138.gif +pics\create_group.png +pics\edit_mesh_change_value_hyp.png +pics\free_borders1.png +pics\add_triangle.png +pics\b-art_end_length.png +pics\a-creategroup.png +pics\a-clipping2.png +pics\a-transparency.png +pics\diagonalinversion.png +pics\translation1.png +image96.jpg +pics\sewing2.png +image119.gif +image108.gif +image52.jpg +image82.gif +image71.gif +image30.jpg +pics\extrusion1.png +pics\distributionwithanalyticdensity.png +pics\image139.gif +pics\rotation1.png +pics\a-createpolyhedralvolume.png +pics\a-patterntype.png +pics\orientaation1.png +pics\translation2.png +pics\cutgroups.png +image97.jpg +pics\sewing3.png +image86.jpg +image50.gif +image94.gif +image83.gif +image31.jpg +pics\circle_angles_after.png +pics\circle_simple_before.png +pics\curvi_angles_after.png +pics\graduatedaxes1.png +pics\image107.gif +pics\automaticlength.png +pics\image27.gif +pics\add_polyhedron.png +pics\add_edge.png +pics\rotation2.png +pics\b-ithmetic1d.png +image10.jpg +pics\a-maxelarea.png +pics\addhexahedron.png +pics\addtetrahedron.png +image5.jpg +pics\sewing4.png +image95.gif +image76.jpg +image84.gif +image32.jpg +image40.gif +pics\curvi_simple_before.png +pics\image108.gif +pics\aqt.png +pics\distributionwithtabledensity.png +pics\smoothing.png +image88.jpg +image30.gif +image96.gif +image77.jpg +image74.gif +image63.gif +image22.jpg +image41.gif +pics\edge_wire_3d_before.png +pics\image109.gif +pics\meshimportmesh.png +pics\deletegroups.png +pics\editing_groups1.png +pics\uniting_two_triangles1.png +image7.jpg +pics\a-averagelength.png +pics\a-patterntype1.png +pics\extrusionalongaline1.png +pics\movenodes.png +pics\rotation.png +image56.jpg +image53.gif +image20.gif +image97.gif +image78.jpg +image64.gif +image23.jpg +pics\edge_wire_after.png +pics\edge_wire_before.png +image151.gif +pics\cut_groups1.png +pics\editing_groups2.png +pics\uniting_two_triangles2.png +pics\a-unionoftriangles.png +pics\a-arithmetic1d.png +pics\extrusionalongaline2.png +image79.jpg +image98.gif +image32.gif +pics\image91.gif +image152.gif +pics\cut_groups2.png +image130.gif +pics\max_el_area.png +pics\a-viewgeneral.png +pics\revolution1.png +pics\addtriangle.png +image99.gif +image55.gif +image88.gif +image36.jpg +image33.gif +image25.jpg +i_blue.jpg +image153.gif +image15.jpg +image142.gif +pics\cut_groups3.png +image131.gif +pics\add_quadrangle.png +pics\uniting_a_set_of_triangles1.png +pics\a-deflection1d.png +pics\revolution2.png +pics\unionoftwotriangles.png +pics\addnode.png +image120.gif +image56.gif +image37.jpg +image67.gif +image34.gif +pics\convert.png +image154.gif +image143.gif +image132.gif +pics\edit_mesh1.png +pics\remove_elements1.png +pics\uniting_a_set_of_triangles2.png +pics\mergenodes.png +pics\symmetry1.png +image121.gif +image79.gif +image38.jpg +image46.gif +image35.gif +image27.jpg +image24.gif +image155.gif +pics\mesh_for_extr_along_path.png +pics\createmesh-inv2.png +image144.gif +pics\intersect_groups1.png +image133.gif +pics\add_polygone.png +pics\remove_elements2.png +pics\a-maxelvolume.png +pics\symmetry2.png +image122.gif +image58.gif +image36.gif +image25.gif +note1.gif +image156.gif +pics\edge_wire_3d_after.png +pics\createmesh-inv3.png +image145.gif +pics\intersect_groups2.png +image134.gif +pics\b-mesh_infos.png +pics\symmetry3.png +pics\addedge.png +image123.gif +image101.gif +image37.gif +pics\straight_after.png +pics\image96.gif +image146.gif +pics\intersect_groups3.png +image135.gif +pics\b-erage_length.png +pics\a-standmeshinfo.png +pics\a-nbsegments1.png +pics\patternmapping1.png +image90.jpg +image124.gif +image49.gif +image38.gif +pics\image100.gif +pics\image97.gif +pics\length-crit.png +image147.gif +image136.gif +pics\a-nbsegments2.png +pics\a-startendlength.png +pics\patternmapping2.png +pics\removeelements.png +pics\removenodes.png +pics\uniongroups.png +image125.gif +image103.gif +pics\exemple.gif +image39.gif +image28.gif +pics\advanced_mesh_infos.png +pics\image98.gif +image148.gif +pics\meshexportmesh.png +pics\image21.gif +pics\union_groups1.png +image137.gif +pics\free_edges.png +pics\creategroup.png +image92.jpg +image126.gif +image18.gif +image70.jpg +pics\straight_before.png +pics\createmesh-inv.png +pics\image102.gif +pics\image99.gif +pics\image77.gif +pics\meshtrianglemergeelem1.png +pics\mergeelems.png +pics\union_groups2.png +pics\length2d.png +pics\renumbernodes.png +image127.gif +image93.jpg +image105.gif +image19.gif +image71.jpg +pics\image89.gif +pics\image78.gif +pics\image23.gif +pics\selectionfilterlibrary.png +pics\union_groups3.png +pics\edit_mesh_remove_hyp.png +pics\remove_nodes1.png +pics\merging_nodes1.png +pics\moving_nodes1.png +pics\smoothing1.png +pics\a-filteronedges.png +pics\renumberelements.png +pics\addpolygon.png +image94.jpg +image106.gif +image91.gif +image80.gif +index.ppf +ehlpdhtm.js +default_ns.css +whxdata\whtdata0.xml +whxdata\whftdata0.xml +whxdata\whfwdata0.xml +whxdata\whgdata0.xml +whdata\whtdata0.htm +whdata\whftdata0.htm +whdata\whfwdata0.htm +whdata\whgdata0.htm +whgdata\whlstt0.htm +whgdata\whlstt1.htm +whgdata\whlstt2.htm +whgdata\whlstt3.htm +whgdata\whlstt4.htm +whgdata\whlstt5.htm +whgdata\whlstt6.htm +whgdata\whlstt7.htm +whgdata\whlstt8.htm +whgdata\whlstt9.htm +whgdata\whlsti0.htm +whgdata\whlstfl0.htm +whgdata\whlstfl1.htm +whgdata\whlstfl2.htm +whgdata\whlstfl3.htm +whgdata\whlstfl4.htm +whgdata\whlstfl5.htm +whgdata\whlstfl6.htm +whgdata\whlstfl7.htm +whgdata\whlstfl8.htm +whgdata\whlstfl9.htm +whgdata\whlstfl10.htm +whgdata\whlstfl11.htm +whgdata\whlstfl12.htm +whgdata\whlstfl13.htm +whgdata\whlstfl14.htm +whgdata\whlstfl15.htm +whgdata\whlstfl16.htm +whgdata\whlstfl17.htm +whgdata\whlstfl18.htm +whgdata\whlstfl19.htm +whgdata\whlstfl20.htm +whgdata\whlstfl21.htm +whgdata\whlstfl22.htm +whgdata\whlstfl23.htm +whgdata\whlstfl24.htm +whgdata\whlstfl25.htm +whgdata\whlstf0.htm +whgdata\whlstf1.htm +whgdata\whlstf2.htm +whgdata\whlstf3.htm +whgdata\whlstf4.htm +whgdata\whlstf5.htm +whgdata\whlstf6.htm +whgdata\whlstf7.htm +whgdata\whlstf8.htm +whgdata\whlstf9.htm +whgdata\whlstf10.htm +whgdata\whlstf11.htm +whgdata\whlstf12.htm +whgdata\whlstf13.htm +whgdata\whlstf14.htm +whgdata\whlstg0.htm +index.htm +index_csh.htm +index_rhc.htm diff --git a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh.html b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh.html index b99783934..4206a80ba 100644 --- a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh.html +++ b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh.html @@ -1,1004 +1,11792 @@ - - -SALOME - SMESH - v.version: smesh.Mesh Class Reference - - - - -

smesh.Mesh Class Reference

Class to define a mesh. -More... + + + + + + Main Page + + + + +
+

smesh.Mesh Class Reference +

+
+
+Class to define a mesh. More...

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

def __init__
 Constructor.
def GetMesh
 Method that returns the mesh.
def GetShape
 Method that returns the shape associated to the mesh.
def MeshDimension
 Returns mesh dimension depending on shape one.
def Segment
 Creates a segment discretization 1D algorithm.
def Triangle
 Creates a triangle 2D algorithm for faces.
def Quadrangle
 Creates a quadrangle 2D algorithm for faces.
def Tetrahedron
 Creates a tetrahedron 3D algorithm for solids.
def Hexahedron
 Creates a hexahedron 3D algorithm for solids.
def Netgen
 Creates a NETGEN-based 2D or 3D independent algorithm (i.e.
def Compute
 Compute the mesh and return the status of the computation.
def AutomaticTetrahedralization
 Compute tetrahedral mesh using AutomaticLength + MEFISTO + NETGEN The parameter fineness [0.
def AutomaticHexahedralization
 Compute hexahedral mesh using AutomaticLength + Quadrangle + Hexahedron The parameter fineness [0.
def RemoveGlobalHypotheses
 Removes all global hypotheses.
def Group
 Create a mesh group based on geometric object grp and give a name, if this parameter is not defined the name is the same as the geometric group name.
def ExportToMED
 Export the mesh in a file with the MED format and choice the version of MED format.
def ExportMED
 Export the mesh in a file with the MED format.
def ExportDAT
 Export the mesh in a file with the DAT format.
def ExportUNV
 Export the mesh in a file with the UNV format.
def ExportSTL
 Export the mesh in a file with the STL format.

Data Fields

 geom
 mesh

Static Public Attributes

int geom = 0
int mesh = 0
-


Detailed Description

-More details. -

-


Member Function Documentation

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh.__init__   self,
  geom,
  name = 0
-
- - - - - -
-   - - -

-Creates mesh on the shape geom, sets GUI name of this mesh to name.

Parameters:
- - - -
geom Shape to be meshed
name Study name of the mesh
-
-
-

- - - - -
- - - - - - - - - -
def smesh.Mesh.GetMesh   self  ) 
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - - - - - - -
def smesh.Mesh.GetShape   self  ) 
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - - - - - - -
def smesh.Mesh.MeshDimension   self  ) 
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh.Segment   self,
  algo = REGULAR,
  geom = 0
-
- - - - - -
-   - - -

-If the optional algo parameter is not sets, this algorithm is REGULAR. If the optional geom parameter is not sets, this algorithm is global. Otherwise, this algorithm define a submesh based on geom subshape.

Parameters:
- - - -
algo values are smesh.REGULAR or smesh.PYTHON for discretization via python function
geom If defined, subshape to be meshed
-
-
-

- - - - -
- - - - - - - - - - - - - - - - - - -
def smesh.Mesh.Triangle   self,
  geom = 0
-
- - - - - -
-   - - -

-If the optional geom parameter is not sets, this algorithm is global. Otherwise, this algorithm define a submesh based on geom subshape.

Parameters:
- - -
geom If defined, subshape to be meshed
-
-
-

- - - - -
- - - - - - - - - - - - - - - - - - -
def smesh.Mesh.Quadrangle   self,
  geom = 0
-
- - - - - -
-   - - -

-If the optional geom parameter is not sets, this algorithm is global. Otherwise, this algorithm define a submesh based on geom subshape.

Parameters:
- - -
geom If defined, subshape to be meshed
-
-
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh.Tetrahedron   self,
  algo,
  geom = 0
-
- - - - - -
-   - - -

-The parameter algo permits to choice the algorithm: NETGEN or GHS3D If the optional geom parameter is not sets, this algorithm is global. Otherwise, this algorithm define a submesh based on geom subshape.

Parameters:
- - - -
algo values are: smesh.NETGEN, smesh.GHS3D
geom If defined, subshape to be meshed
-
-
-

- - - - -
- - - - - - - - - - - - - - - - - - -
def smesh.Mesh.Hexahedron   self,
  geom = 0
-
- - - - - -
-   - - -

-If the optional geom parameter is not sets, this algorithm is global. Otherwise, this algorithm define a submesh based on geom subshape.

Parameters:
- - -
geom If defined, subshape to be meshed
-
-
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh.Netgen   self,
  is3D,
  geom = 0
-
- - - - - -
-   - - -

-needs no discrete boundary). If the optional geom parameter is not sets, this algorithm is global. Otherwise, this algorithm defines a submesh based on geom subshape.

Parameters:
- - - -
is3D If 0 then algorithm is 2D, otherwise 3D
geom If defined, subshape to be meshed
-
-
-

- - - - -
- - - - - - - - - -
def smesh.Mesh.Compute   self  ) 
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - - - - - - - - - - - - - - - -
def smesh.Mesh.AutomaticTetrahedralization   self,
  fineness = 0
-
- - - - - -
-   - - -

--1.] defines mesh fineness

-

- - - - -
- - - - - - - - - - - - - - - - - - -
def smesh.Mesh.AutomaticHexahedralization   self,
  fineness = 0
-
- - - - - -
-   - - -

--1.] defines mesh fineness

-

- - - - -
- - - - - - - - - -
def smesh.Mesh.RemoveGlobalHypotheses   self  ) 
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh.Group   self,
  grp,
  name = ""
-
- - - - - -
-   - - -

-

Parameters:
- - - -
grp is a geometric group, a vertex, an edge, a face or a solid
name is the name of the mesh group
-
-
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh.ExportToMED   self,
  f,
  version,
  opt = 0
-
- - - - - -
-   - - -

-

Parameters:
- - - -
f is the file name
version values are SMESH.MED_V2_1, SMESH.MED_V2_2
-
-
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh.ExportMED   self,
  f,
  opt = 0
-
- - - - - -
-   - - -

-

Parameters:
- - -
f is the file name
-
-
-

- - - - -
- - - - - - - - - - - - - - - - - - -
def smesh.Mesh.ExportDAT   self,
  f
-
- - - - - -
-   - - -

-

Parameters:
- - -
f is the file name
-
-
-

- - - - -
- - - - - - - - - - - - - - - - - - -
def smesh.Mesh.ExportUNV   self,
  f
-
- - - - - -
-   - - -

-

Parameters:
- - -
f is the file name
-
-
-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh.ExportSTL   self,
  f,
  ascii = 1
-
- - - - - -
-   - - -

-

Parameters:
- - - -
f is the file name
ascii defined the kind of file contents
-
-
-


Field Documentation

-

- - - - -
- - - - -
int smesh.Mesh.geom = 0 [static]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
int smesh.Mesh.mesh = 0 [static]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
smesh.Mesh.geom
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
smesh.Mesh.mesh
-
- - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-   - - -

-


+
+

Public Member Functions

+
def __init__
 Constructor.
+
def SetMesh
 Method that inits the Mesh object from SMESH_Mesh +interface.
+
def GetMesh
 Method that returns the mesh.
+
def GetName
 Get mesh name.
+
def SetName
 Set name to mesh.
+
def GetSubMesh
 Get the subMesh object associated to a +subShape.
+
def GetShape
 Method that returns the shape associated +to the mesh.
+
def SetShape
 Method that associates given shape to the +mesh(entails the mesh recreation).
+
def IsReadyToCompute
 Return true if hypotheses are defined +well.
+
def GetAlgoState
 Return errors of hypotheses definintion +error list is empty if everything is OK.
+
def GetGeometryByMeshElement
 Return geometrical object the given +element is built on.
+
def MeshDimension
 Returns mesh dimension depending on shape +one.
+
def Segment
 Creates a segment discretization 1D +algorithm.
+
def Triangle
 Creates a triangle 2D algorithm for faces. +
+
def Quadrangle
 Creates a quadrangle 2D algorithm for +faces.
+
def Tetrahedron
 Creates a tetrahedron 3D algorithm for +solids.
+
def Hexahedron
 Creates a hexahedron 3D algorithm for +solids.
+
def Netgen
 Deprecated, only for compatibility!
+
def Compute
 Compute the mesh and return the status of +the computation.
+
def AutomaticTetrahedralization
 Compute tetrahedral mesh using +AutomaticLength + MEFISTO + NETGEN The parameter fineness +[0,-1] defines mesh fineness.
+
def AutomaticHexahedralization
 Compute hexahedral mesh using +AutomaticLength + Quadrangle + Hexahedron The parameter fineness +[0,-1] defines mesh fineness.
+
def GetHypothesisList
 Get the list of hypothesis added on a +geom.
+
def RemoveGlobalHypotheses
 Removes all global hypotheses.
+
def Group
 Create a mesh group based on geometric +object grp and give a name,
+if this parameter is not defined the name is the same as the geometric +group name
+Note: Works like GroupOnGeom(). +
+
def ExportToMED
 Deprecated, only for compatibility! +Please, use ExportMED() +method instead.
+
def ExportMED
 Export the mesh in a file with the MED +format.
+
def ExportDAT
 Export the mesh in a file with the DAT +format.
+
def ExportUNV
 Export the mesh in a file with the UNV +format.
+
def ExportSTL
 Export the mesh in a file with the STL +format.
+
def CreateEmptyGroup
 Creates an empty mesh group.
+
def GroupOnGeom
 Creates a mesh group based on geometric +object grp and give a name,
+if this parameter is not defined the name is the same as the geometric +group name.
+
def MakeGroupByIds
 Create a mesh group by the given ids of +elements.
+
def MakeGroup
 Create a mesh group by the given +conditions.
+
def MakeGroupByCriterion
 Create a mesh group by the given +criterion.
+
def MakeGroupByCriteria
 Create a mesh group by the given +criteria(list of criterions).
+
def MakeGroupByFilter
 Create a mesh group by the given filter.
+
def GetIdsFromFilter
 Pass mesh elements through the given +filter and return ids.
+
def GetFreeBorders
 Verify whether 2D mesh element has free +edges(edges connected to one face only)
+Returns list of special structures(borders).
+
def RemoveGroup
 Remove a group.
+
def RemoveGroupWithContents
 Remove group with its contents.
+
def GetGroups
 Get the list of groups existing in the +mesh.
+
def GetGroupNames
 Get the list of names of groups existing +in the mesh.
+
def UnionGroups
 Union of two groups New group is created.
+
def IntersectGroups
 Intersection of two groups New group is +created.
+
def CutGroups
 Cut of two groups New group is created.
+
def GetLog
 Get the log of nodes and elements added or +removed since previous clear of the log.
+
def ClearLog
 Clear the log of nodes and elements added +or removed since previous clear.
+
def GetId
 Get the internal Id.
+
def GetStudyId
 Get the study Id.
+
def HasDuplicatedGroupNamesMED
 Check group names for duplications.
+
def GetMeshEditor
 Obtain instance of SMESH_MeshEditor.
+
def GetMEDMesh
 Get MED Mesh.
+
def NbNodes
 Returns number of nodes in mesh.
+
def NbElements
 Returns number of elements in mesh.
+
def NbEdges
 Returns number of edges in mesh.
+
def NbEdgesOfOrder
 Returns number of edges with given order +in mesh.
+
def NbFaces
 Returns number of faces in mesh.
+
def NbFacesOfOrder
 Returns number of faces with given order +in mesh.
+
def NbTriangles
 Returns number of triangles in mesh.
+
def NbTrianglesOfOrder
 Returns number of triangles with given +order in mesh.
+
def NbQuadrangles
 Returns number of quadrangles in mesh.
+
def NbQuadranglesOfOrder
 Returns number of quadrangles with given +order in mesh.
+
def NbPolygons
 Returns number of polygons in mesh.
+
def NbVolumes
 Returns number of volumes in mesh.
+
def NbVolumesOfOrder
 Returns number of volumes with given order +in mesh.
+
def NbTetras
 Returns number of tetrahedrons in mesh.
+
def NbTetrasOfOrder
 Returns number of tetrahedrons with given +order in mesh.
+
def NbHexas
 Returns number of hexahedrons in mesh.
+
def NbHexasOfOrder
 Returns number of hexahedrons with given +order in mesh.
+
def NbPyramids
 Returns number of pyramids in mesh.
+
def NbPyramidsOfOrder
 Returns number of pyramids with given +order in mesh.
+
def NbPrisms
 Returns number of prisms in mesh.
+
def NbPrismsOfOrder
 Returns number of prisms with given order +in mesh.
+
def NbPolyhedrons
 Returns number of polyhedrons in mesh.
+
def NbSubMesh
 Returns number of submeshes in mesh.
+
def GetElementsId
 Returns list of mesh elements ids.
+
def GetElementsByType
 Returns list of ids of mesh elements with +given type.
+
def GetNodesId
 Returns list of mesh nodes ids.
+
def GetElementType
 Returns type of mesh element.
+
def GetSubMeshElementsId
 Returns list of submesh elements ids.
+
def GetSubMeshNodesId
 Returns list of submesh nodes ids.
+
def GetSubMeshElementType
 Returns list of ids of submesh elements +with given type.
+
def Dump
 Get mesh description.
+
def GetNodeXYZ
 Get XYZ coordinates of node as list of +double
+If there is not node for given ID - returns empty list.
+
def GetNodeInverseElements
 For given node returns list of IDs of +inverse elements
+If there is not node for given ID - returns empty list.
+
def GetShapeID
 If given element is node returns IDs of +shape from position
+If there is not node for given ID - returns -1.
+
def GetShapeIDForElem
 For given element returns ID of result +shape after FindShape() from SMESH_MeshEditor
+If there is not element for given ID - returns -1.
+
def GetElemNbNodes
 Returns number of nodes for given element
+If there is not element for given ID - returns -1.
+
def GetElemNode
 Returns ID of node by given index for +given element
+If there is not element for given ID - returns -1
+If there is not node for given index - returns -2.
+
def IsMediumNode
 Returns true if given node is medium node +in given quadratic element.
+
def IsMediumNodeOfAnyElem
 Returns true if given node is medium node +in one of quadratic elements.
+
def ElemNbEdges
 Returns number of edges for given element. +
+
def ElemNbFaces
 Returns number of faces for given element. +
+
def IsPoly
 Returns true if given element is polygon.
+
def IsQuadratic
 Returns true if given element is +quadratic.
+
def BaryCenter
 Returns XYZ coordinates of bary center for +given element as list of double
+If there is not element for given ID - returns empty list.
+
def RemoveElements
 Removes elements from mesh by ids.
+
def RemoveNodes
 Removes nodes from mesh by ids.
+
def AddNode
 Add node to mesh by coordinates.
+
def AddEdge
 Create edge both similar and quadratic +(this is determed by number of given nodes).
+
def AddFace
 Create face both similar and quadratic +(this is determed by number of given nodes).
+
def AddPolygonalFace
 Add polygonal face to mesh by list of +nodes ids.
+
def AddVolume
 Create volume both similar and quadratic +(this is determed by number of given nodes).
+
def AddPolyhedralVolume
 Create volume of many faces, giving nodes +for each face.
+
def AddPolyhedralVolumeByFaces
 Create volume of many faces, giving IDs of +existing faces.
+
def MoveNode
 Move node with given id.
+
def InverseDiag
 Replace two neighbour triangles sharing +Node1-Node2 link with ones built on the same 4 nodes but having other +common link.
+
def DeleteDiag
 Replace two neighbour triangles sharing +Node1-Node2 link with a quadrangle built on the same 4 nodes.
+
def Reorient
 Reorient elements by ids.
+
def ReorientObject
 Reorient all elements of the object.
+
def TriToQuad
 Fuse neighbour triangles into quadrangles. +
+
def TriToQuadObject
 Fuse neighbour triangles of the object +into quadrangles.
+
def QuadToTri
 Split quadrangles into triangles.
+
def QuadToTriObject
 Split quadrangles into triangles.
+
def SplitQuad
 Split quadrangles into triangles.
+
def SplitQuadObject
 Split quadrangles into triangles.
+
def BestSplit
 Find better splitting of the given +quadrangle.
+
def Smooth
 Smooth elements.
+
def SmoothObject
 Smooth elements belong to given object.
+
def SmoothParametric
 Parametric smooth the given elements.
+
def SmoothParametricObject
 Parametric smooth elements belong to given +object.
+
def ConvertToQuadratic
 Converts all mesh to quadratic one, +deletes old elements, replacing them with quadratic ones with the same +id.
+
def ConvertFromQuadratic
 Converts all mesh from quadratic to +ordinary ones, deletes old quadratic elements,
+replacing them with ordinary mesh elements with the same id.
+
def RenumberNodes
 Renumber mesh nodes.
+
def RenumberElements
 Renumber mesh elements.
+
def RotationSweep
 Generate new elements by rotation of the +elements around the axis.
+
def RotationSweepObject
 Generate new elements by rotation of the +elements of object around the axis.
+
def ExtrusionSweep
 Generate new elements by extrusion of the +elements with given ids.
+
def AdvancedExtrusion
 Generate new elements by extrusion of the +elements with given ids.
+
def ExtrusionSweepObject
 Generate new elements by extrusion of the +elements belong to object.
+
def ExtrusionSweepObject1D
 Generate new elements by extrusion of the +elements belong to object.
+
def ExtrusionSweepObject2D
 Generate new elements by extrusion of the +elements belong to object.
+
def ExtrusionAlongPath
 Generate new elements by extrusion of the +given elements A path of extrusion must be a meshed edge.
+
def ExtrusionAlongPathObject
 Generate new elements by extrusion of the +elements belong to object A path of extrusion must be a meshed edge.
+
def Mirror
 Symmetrical copy of mesh elements.
+
def MirrorObject
 Symmetrical copy of object.
+
def Translate
 Translates the elements.
+
def TranslateObject
 Translates the object.
+
def Rotate
 Rotates the elements.
+
def RotateObject
 Rotates the object.
+
def FindCoincidentNodes
 Find group of nodes close to each other +within Tolerance.
+
def MergeNodes
 Merge nodes.
+
def MergeEqualElements
 Remove all but one of elements built on +the same nodes.
+
def SewFreeBorders
 Sew free borders.
+
def SewConformFreeBorders
 Sew conform free borders.
+
def SewBorderToSide
 Sew border to side.
+
def SewSideElements
 Sew two sides of a mesh.
+
def ChangeElemNodes
 Set new nodes for given element.
+
def GetLastCreatedNodes
 If during last operation of MeshEditor +some nodes were created this method returns list of it's IDs,
+if new nodes not created - returns empty list.
+
def GetLastCreatedElems
 If during last operation of MeshEditor +some elements were created this method returns list of it's IDs,
+if new elements not creared - returns empty list.
+

+

Data Fields

+
 geom
 mesh
 editor

+

Static Public Attributes

+
int geom += 0
int mesh += 0
int editor += 0
+

+
+

Detailed Description

+The class contains mesh shape, SMESH_Mesh, SMESH_MeshEditor More +details. +

+
+

Member Function Documentation

+ +

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.__init__   self,

+

+
  obj = 0, +

+

+
  name = 0

+

+
+
+ + + + + + + +
  +

Creates mesh on the shape geom(or the empty mesh if geom +equal to 0), sets GUI name of this mesh to name.

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
obj Shape to be meshed or SMESH_Mesh object

+
name Study name of the mesh
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SetMesh   self,

+

+
  theMesh

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
theMesh is SMESH_Mesh object
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetMesh   self +  ) 
+
+
+ + + + + + + +
  +

+
+
Returns:
+
SMESH_Mesh object
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetName   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SetName   self,

+

+
  name

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetSubMesh   self,

+

+
  theSubObject, +

+

+
  name

+

+
+
+ + + + + + + +
  +

The subMesh object gives access to nodes and elements IDs.
+SubMesh will be used instead of SubShape in a next idl version to +adress a specific subMesh...

+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetShape   self +  ) 
+
+
+ + + + + + + +
  +

+
+
Returns:
+
GEOM_Object
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SetShape   self,

+

+
  geom

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
geom shape to be meshed(GEOM_Object)
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.IsReadyToCompute   self,

+

+
  theSubObject

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
theMesh is an instance of Mesh class

+
theSubObject subshape of a mesh shape
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetAlgoState   self,

+

+
  theSubObject

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
theMesh is an instance of Mesh class

+
theSubObject subshape of a mesh shape
+
+
+
+
Returns:
+
a list of errors
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetGeometryByMeshElement   self,

+

+
  theElementID, +

+

+
  theGeomName

+

+
+
+ + + + + + + +
  +

The returned geometrical object, if not nil, is either found +in the study or is published by this method with the given name

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
theMesh is an instance of Mesh class

+
theElementID an id of the mesh element

+
theGeomName user defined name of geometrical object
+
+
+
+
Returns:
+
GEOM.GEOM_Object instance
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.MeshDimension   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Segment   self,

+

+
  algo = REGULAR, +

+

+
  geom = 0

+

+
+
+ + + + + + + +
  +

If the optional algo parameter is not sets, this +algorithm is REGULAR. If the optional geom parameter is not +sets, this algorithm is global.
+Otherwise, this algorithm define a submesh based on geom +subshape.

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
algo values are smesh.REGULAR +or smesh.PYTHON +for discretization via python function

+
geom If defined, subshape to be meshed
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Triangle   self,

+

+
  algo = MEFISTO, +

+

+
  geom = 0

+

+
+
+ + + + + + + +
  +

If the optional geom parameter is not sets, this +algorithm is global.
+Otherwise, this algorithm define a submesh based on geom +subshape.

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
algo values are: smesh.MEFISTO +or smesh.NETGEN +

+
geom If defined, subshape to be meshed
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Quadrangle   self,

+

+
  geom = 0

+

+
+
+ + + + + + + +
  +

If the optional geom parameter is not sets, this +algorithm is global.
+Otherwise, this algorithm define a submesh based on geom +subshape.

+
+
Parameters:
+
+ + + + + + + + +

+
geom If defined, subshape to be meshed
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Tetrahedron   self,

+

+
  algo = NETGEN, +

+

+
  geom = 0

+

+
+
+ + + + + + + +
  +

The parameter algo permits to choice the algorithm: +NETGEN or GHS3D If the optional geom parameter is not sets, +this algorithm is global.
+Otherwise, this algorithm define a submesh based on geom +subshape.

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
algo values are: smesh.NETGEN, + smesh.GHS3D, + smesh.FULL_NETGEN +

+
geom If defined, subshape to be meshed
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Hexahedron   self,

+

+
  geom = 0

+

+
+
+ + + + + + + +
  +

If the optional geom parameter is not sets, this +algorithm is global.
+Otherwise, this algorithm define a submesh based on geom +subshape.

+
+
Parameters:
+
+ + + + + + + + +

+
geom If defined, subshape to be meshed
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Netgen   self,

+

+
  is3D,

+

+
  geom = 0

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Compute   self,

+

+
  geom = 0

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.AutomaticTetrahedralization   self,

+

+
  fineness = 0

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.AutomaticHexahedralization   self,

+

+
  fineness = 0

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetHypothesisList   self,

+

+
  geom

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
geom is subhape of mesh geometry
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.RemoveGlobalHypotheses   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Group   self,

+

+
  grp,

+

+
  name = ""

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
grp is a geometric group, a vertex, an edge, a face or +a solid

+
name is the name of the mesh group
+
+
+
+
Returns:
+
SMESH_GroupOnGeom
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ExportToMED   self,

+

+
  f,

+

+
  version,

+

+
  opt = 0

+

+
+
+ + + + + + + +
  +

Export the mesh in a file with the MED format and choice the version +of MED format

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
f is the file name

+
version values are SMESH.MED_V2_1, SMESH.MED_V2_2
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ExportMED   self,

+

+
  f,

+

+
  auto_groups = + 0,

+

+
  version = MED_V2_2

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
f is the file name

+
auto_groups boolean parameter for creating/not creating the +groups Group_On_All_Nodes, Group_On_All_Faces, ... ; the typical use is +auto_groups=false.

+
version MED format version(MED_V2_1 or MED_V2_2)
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ExportDAT   self,

+

+
  f

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
f is the file name
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ExportUNV   self,

+

+
  f

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
f is the file name
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ExportSTL   self,

+

+
  f,

+

+
  ascii = 1

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
f is the file name

+
ascii defined the kind of file contents
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.CreateEmptyGroup   self,

+

+
  elementType,

+

+
  name

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
elementType is the type of elements in the group

+
name is the name of the mesh group
+
+
+
+
Returns:
+
SMESH_Group
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GroupOnGeom   self,

+

+
  grp,

+

+
  name = "", +

+

+
  type = None

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
grp is a geometric group, a vertex, an edge, a face or +a solid

+
name is the name of the mesh group
+
+
+
+
Returns:
+
SMESH_GroupOnGeom
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.MakeGroupByIds   self,

+

+
  groupName,

+

+
  elementType,

+

+
  elemIDs

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
groupName is the name of the mesh group

+
elementType is the type of elements in the group

+
elemIDs is the list of ids
+
+
+
+
Returns:
+
SMESH_Group
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.MakeGroup   self,

+

+
  groupName,

+

+
  elementType,

+

+
  CritType = FT_Undefined, +

+

+
  Compare = FT_EqualTo, +

+

+
  Treshold = "", +

+

+
  UnaryOp = FT_Undefined

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
groupName is the name of the mesh group

+
elementType is the type of elements in the group

+
CritType is type of criterion( FT_Taper, FT_Area, +FT_RangeOfIds, FT_LyingOnGeom etc. )

+
Compare belong to {FT_LessThan, FT_MoreThan, FT_EqualTo}

+
Treshold is threshold value (range of id ids as string, +shape, numeric)

+
UnaryOp is FT_LogicalNOT or FT_Undefined
+
+
+
+
Returns:
+
SMESH_Group
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.MakeGroupByCriterion   self,

+

+
  groupName,

+

+
  Criterion

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
groupName is the name of the mesh group

+
Criterion is the instance of Criterion class
+
+
+
+
Returns:
+
SMESH_Group
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.MakeGroupByCriteria   self,

+

+
  groupName,

+

+
  theCriteria

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
groupName is the name of the mesh group

+
Criteria is the list of criterions
+
+
+
+
Returns:
+
SMESH_Group
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.MakeGroupByFilter   self,

+

+
  groupName,

+

+
  theFilter

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
groupName is the name of the mesh group

+
Criterion is the instance of Filter class
+
+
+
+
Returns:
+
SMESH_Group
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetIdsFromFilter   self,

+

+
  theFilter

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
theFilter is SMESH_Filter
+
+
+
+
Returns:
+
list of ids
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetFreeBorders   self +  ) 
+
+
+ + + + + + + +
  +

+
+
Returns:
+
list of SMESH.FreeEdges.Border structure: edge id and two +its nodes ids.
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.RemoveGroup   self,

+

+
  group

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.RemoveGroupWithContents   self,

+

+
  group

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetGroups   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetGroupNames   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.UnionGroups   self,

+

+
  group1,

+

+
  group2,

+

+
  name

+

+
+
+ + + + + + + +
  +

All mesh elements that are present in initial groups are added +to the new one

+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.IntersectGroups   self,

+

+
  group1,

+

+
  group2,

+

+
  name

+

+
+
+ + + + + + + +
  +

All mesh elements that are present in both initial groups are +added to the new one.

+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.CutGroups   self,

+

+
  mainGroup,

+

+
  toolGroup,

+

+
  name

+

+
+
+ + + + + + + +
  +

All mesh elements that are present in main group but do not +present in tool group are added to the new one

+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetLog   self,

+

+
  clearAfterGet

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
clearAfterGet log is emptied after Get (safe if concurrents +access)
+
+
+
+
Returns:
+
list of log_block structures: commandType number coords +indexes
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.ClearLog   self +  ) 
+
+
+ + + + + + + +
  +

Must be used immediately after GetLog if clearAfterGet is +false.

+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetId   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetStudyId   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.HasDuplicatedGroupNamesMED   self +  ) 
+
+
+ + + + + + + +
  +

Consider maximum group name length stored in MED file.

+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetMeshEditor   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetMEDMesh   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbNodes   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbElements   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbEdges   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.NbEdgesOfOrder   self,

+

+
  elementOrder

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
elementOrder is order of elements: ORDER_ANY, ORDER_LINEAR or +ORDER_QUADRATIC
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbFaces   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.NbFacesOfOrder   self,

+

+
  elementOrder

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
elementOrder is order of elements: ORDER_ANY, ORDER_LINEAR or +ORDER_QUADRATIC
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbTriangles   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.NbTrianglesOfOrder   self,

+

+
  elementOrder

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
elementOrder is order of elements: ORDER_ANY, ORDER_LINEAR or +ORDER_QUADRATIC
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbQuadrangles   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.NbQuadranglesOfOrder   self,

+

+
  elementOrder

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
elementOrder is order of elements: ORDER_ANY, ORDER_LINEAR or +ORDER_QUADRATIC
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbPolygons   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbVolumes   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.NbVolumesOfOrder   self,

+

+
  elementOrder

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
elementOrder is order of elements: ORDER_ANY, ORDER_LINEAR or +ORDER_QUADRATIC
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbTetras   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.NbTetrasOfOrder   self,

+

+
  elementOrder

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
elementOrder is order of elements: ORDER_ANY, ORDER_LINEAR or +ORDER_QUADRATIC
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbHexas   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.NbHexasOfOrder   self,

+

+
  elementOrder

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
elementOrder is order of elements: ORDER_ANY, ORDER_LINEAR or +ORDER_QUADRATIC
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbPyramids   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.NbPyramidsOfOrder   self,

+

+
  elementOrder

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
elementOrder is order of elements: ORDER_ANY, ORDER_LINEAR or +ORDER_QUADRATIC
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbPrisms   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.NbPrismsOfOrder   self,

+

+
  elementOrder

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
elementOrder is order of elements: ORDER_ANY, ORDER_LINEAR or +ORDER_QUADRATIC
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbPolyhedrons   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.NbSubMesh   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetElementsId   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetElementsByType   self,

+

+
  elementType

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
elementType is required type of elements
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetNodesId   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetElementType   self,

+

+
  id,

+

+
  iselem

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetSubMeshElementsId   self,

+

+
  shapeID

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
shapeID is geom object(subshape) IOR
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetSubMeshNodesId   self,

+

+
  shapeID,

+

+
  all

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
shapeID is geom object(subshape) IOR
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetSubMeshElementType   self,

+

+
  shapeID

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
shapeID is geom object(subshape) IOR
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.Dump   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetNodeXYZ   self,

+

+
  id

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetNodeInverseElements   self,

+

+
  id

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetShapeID   self,

+

+
  id

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetShapeIDForElem   id +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetElemNbNodes   self,

+

+
  id

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.GetElemNode   self,

+

+
  id,

+

+
  index

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.IsMediumNode   self,

+

+
  elementID,

+

+
  nodeID

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.IsMediumNodeOfAnyElem   self,

+

+
  nodeID,

+

+
  elementType

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ElemNbEdges   self,

+

+
  id

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ElemNbFaces   self,

+

+
  id

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.IsPoly   self,

+

+
  id

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.IsQuadratic   self,

+

+
  id

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.BaryCenter   self,

+

+
  id

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.RemoveElements   self,

+

+
  IDsOfElements

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
IDsOfElements is list of ids of elements to remove
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.RemoveNodes   self,

+

+
  IDsOfNodes

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
IDsOfNodes is list of ids of nodes to remove
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.AddNode   self,

+

+
  x,

+

+
  y,

+

+
  z

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.AddEdge   self,

+

+
  IDsOfNodes

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
IdsOfNodes List of node IDs for creation of element. Needed +order of nodes in this list corresponds to description of MED.
+This description is located by the following link: http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. +
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.AddFace   self,

+

+
  IDsOfNodes

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
IdsOfNodes List of node IDs for creation of element. Needed +order of nodes in this list corresponds to description of MED.
+This description is located by the following link: http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. +
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.AddPolygonalFace   self,

+

+
  IdsOfNodes

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.AddVolume   self,

+

+
  IDsOfNodes

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
IdsOfNodes List of node IDs for creation of element. Needed +order of nodes in this list corresponds to description of MED.
+This description is located by the following link: http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. +
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.AddPolyhedralVolume   self,

+

+
  IdsOfNodes,

+

+
  Quantities

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
IdsOfNodes List of node IDs for volume creation face by face.

+
Quantities List of integer values, Quantities[i] gives +quantity of nodes in face number i.
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.AddPolyhedralVolumeByFaces   self,

+

+
  IdsOfFaces

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
IdsOfFaces List of face IDs for volume creation.
+
+
+Note: The created volume will refer only to nodes of the given faces, +not to the faces itself.
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.MoveNode   self,

+

+
  NodeID,

+

+
  x,

+

+
  y,

+

+
  z

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+
NodeID id of the node

+
x displacing along the X axis

+
y displacing along the Y axis

+
z displacing along the Z axis
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.InverseDiag   self,

+

+
  NodeID1,

+

+
  NodeID2

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
NodeID1 first node id

+
NodeID2 second node id
+
+
+
+
Returns:
+
false if proper faces not found
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.DeleteDiag   self,

+

+
  NodeID1,

+

+
  NodeID2

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
NodeID1 first node id

+
NodeID2 second node id
+
+
+
+
Returns:
+
false if proper faces not found
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Reorient   self,

+

+
  IDsOfElements += None

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
IDsOfElements if undefined reorient all mesh elements
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ReorientObject   self,

+

+
  theObject

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
theObject is mesh, submesh or group
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.TriToQuad   self,

+

+
  IDsOfElements, +

+

+
  theCriterion, +

+

+
  MaxAngle

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
IDsOfElements The triangles to be fused,

+
theCriterion is FT_...; used to choose a neighbour to fuse with. +

+
MaxAngle is a max angle between element normals at which +fusion is still performed; theMaxAngle is mesured in radians.
+
+
+
+
Returns:
+
TRUE in case of success, FALSE otherwise.
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.TriToQuadObject   self,

+

+
  theObject,

+

+
  theCriterion, +

+

+
  MaxAngle

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
theObject is mesh, submesh or group

+
theCriterion is FT_...; used to choose a neighbour to fuse with. +

+
MaxAngle is a max angle between element normals at which +fusion is still performed; theMaxAngle is mesured in radians.
+
+
+
+
Returns:
+
TRUE in case of success, FALSE otherwise.
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.QuadToTri   self,

+

+
  IDsOfElements, +

+

+
  theCriterion

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
IDsOfElements the faces to be splitted.

+
theCriterion is FT_...; used to choose a diagonal for splitting. +

+
 TRUE in case of success, FALSE otherwise.
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.QuadToTriObject   self,

+

+
  theObject,

+

+
  theCriterion

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
theObject object to taking list of elements from, is mesh, +submesh or group

+
theCriterion is FT_...; used to choose a diagonal for splitting. +
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SplitQuad   self,

+

+
  IDsOfElements, +

+

+
  Diag13

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
theElems The faces to be splitted

+
the13Diag is used to choose a diagonal for splitting.
+
+
+
+
Returns:
+
TRUE in case of success, FALSE otherwise.
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SplitQuadObject   self,

+

+
  theObject,

+

+
  Diag13

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
theObject is object to taking list of elements from, is mesh, +submesh or group
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.BestSplit   self,

+

+
  IDOfQuad,

+

+
  theCriterion

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
IDOfQuad ID of the quadrangle to be splitted.

+
theCriterion is FT_...; a criterion to choose a diagonal for +splitting.
+
+
+
+
Returns:
+
1 if 1-3 diagonal is better, 2 if 2-4 diagonal is better, 0 +if error occurs.
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Smooth   self,

+

+
  IDsOfElements, +

+

+
  IDsOfFixedNodes, +

+

+
  MaxNbOfIterations, +

+

+
  MaxAspectRatio, +

+

+
  Method

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
IDsOfElements list if ids of elements to smooth

+
IDsOfFixedNodes list of ids of fixed nodes. Note that nodes built +on edges and boundary nodes are always fixed.

+
MaxNbOfIterations maximum number of iterations

+
MaxAspectRatio varies in range [1.0, inf]

+
Method is Laplacian(LAPLACIAN_SMOOTH) or +Centroidal(CENTROIDAL_SMOOTH)
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SmoothObject   self,

+

+
  theObject,

+

+
  IDsOfFixedNodes, +

+

+
  MaxNbOfIterations, +

+

+
  MaxxAspectRatio, +

+

+
  Method

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
theObject object to smooth

+
IDsOfFixedNodes list of ids of fixed nodes. Note that nodes built +on edges and boundary nodes are always fixed.

+
MaxNbOfIterations maximum number of iterations

+
MaxAspectRatio varies in range [1.0, inf]

+
Method is Laplacian(LAPLACIAN_SMOOTH) or +Centroidal(CENTROIDAL_SMOOTH)
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SmoothParametric   IDsOfElements, +

+

+
  IDsOfFixedNodes, +

+

+
  MaxNbOfIterations, +

+

+
  MaxAspectRatio, +

+

+
  Method

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
IDsOfElements list if ids of elements to smooth

+
IDsOfFixedNodes list of ids of fixed nodes. Note that nodes built +on edges and boundary nodes are always fixed.

+
MaxNbOfIterations maximum number of iterations

+
MaxAspectRatio varies in range [1.0, inf]

+
Method is Laplacian(LAPLACIAN_SMOOTH) or +Centroidal(CENTROIDAL_SMOOTH)
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SmoothParametricObject   self,

+

+
  theObject,

+

+
  IDsOfFixedNodes, +

+

+
  MaxNbOfIterations, +

+

+
  MaxAspectRatio, +

+

+
  Method

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
theObject object to smooth

+
IDsOfFixedNodes list of ids of fixed nodes. Note that nodes built +on edges and boundary nodes are always fixed.

+
MaxNbOfIterations maximum number of iterations

+
MaxAspectRatio varies in range [1.0, inf]

+
Method is Laplacian(LAPLACIAN_SMOOTH) or +Centroidal(CENTROIDAL_SMOOTH)
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ConvertToQuadratic   self,

+

+
  theForce3d

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.ConvertFromQuadratic   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.RenumberNodes   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.RenumberElements   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.RotationSweep   self,

+

+
  IDsOfElements, +

+

+
  Axix,

+

+
  AngleInRadians, +

+

+
  NbOfSteps,

+

+
  Tolerance

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
IDsOfElements list of ids of elements to sweep

+
Axix axis of rotation, AxisStruct or line(geom object)

+
AngleInRadians angle of Rotation

+
NbOfSteps number of steps

+
Tolerance tolerance
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.RotationSweepObject   self,

+

+
  theObject,

+

+
  Axix,

+

+
  AngleInRadians, +

+

+
  NbOfSteps,

+

+
  Tolerance

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
theObject object wich elements should be sweeped

+
Axix axis of rotation, AxisStruct or line(geom object)

+
AngleInRadians angle of Rotation

+
NbOfSteps number of steps

+
Tolerance tolerance
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ExtrusionSweep   self,

+

+
  IDsOfElements, +

+

+
  StepVector,

+

+
  NbOfSteps

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
IDsOfElements list of elements ids for extrusion

+
StepVector vector, defining the direction and value of +extrusion

+
NbOfSteps the number of steps
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.AdvancedExtrusion   self,

+

+
  IDsOfElements, +

+

+
  StepVector,

+

+
  NbOfSteps,

+

+
  ExtrFlags,

+

+
  SewTolerance

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
IDsOfElements is ids of elements

+
StepVector vector, defining the direction and value of +extrusion

+
NbOfSteps the number of steps

+
ExtrFlags set flags for performing extrusion

+
SewTolerance uses for comparing locations of nodes if flag +EXTRUSION_FLAG_SEW is set
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ExtrusionSweepObject   self,

+

+
  theObject,

+

+
  StepVector,

+

+
  NbOfSteps

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
theObject object wich elements should be processed

+
StepVector vector, defining the direction and value of +extrusion

+
NbOfSteps the number of steps
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ExtrusionSweepObject1D   self,

+

+
  theObject,

+

+
  StepVector,

+

+
  NbOfSteps

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
theObject object wich elements should be processed

+
StepVector vector, defining the direction and value of +extrusion

+
NbOfSteps the number of steps
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ExtrusionSweepObject2D   self,

+

+
  theObject,

+

+
  StepVector,

+

+
  NbOfSteps

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
theObject object wich elements should be processed

+
StepVector vector, defining the direction and value of +extrusion

+
NbOfSteps the number of steps
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ExtrusionAlongPath   self,

+

+
  IDsOfElements, +

+

+
  PathMesh,

+

+
  PathShape,

+

+
  NodeStart,

+

+
  HasAngles,

+

+
  Angles,

+

+
  HasRefPoint,

+

+
  RefPoint

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
IDsOfElements is ids of elements

+
PathMesh mesh containing a 1D sub-mesh on the edge, along +which proceeds the extrusion

+
PathShape is shape(edge); as the mesh can be complex, the +edge is used to define the sub-mesh for the path

+
NodeStart the first or the last node on the edge. It is used +to define the direction of extrusion

+
HasAngles allows the shape to be rotated around the path to +get the resulting mesh in a helical fashion

+
Angles list of angles

+
HasRefPoint allows to use base point

+
RefPoint point around which the shape is rotated(the mass +center of the shape by default). User can specify any point as the Base +Point and the shape will be rotated with respect to this point.
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ExtrusionAlongPathObject   self,

+

+
  theObject,

+

+
  PathMesh,

+

+
  PathShape,

+

+
  NodeStart,

+

+
  HasAngles,

+

+
  Angles,

+

+
  HasRefPoint,

+

+
  RefPoint

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
IDsOfElements is ids of elements

+
PathMesh mesh containing a 1D sub-mesh on the edge, along +which proceeds the extrusion

+
PathShape is shape(edge); as the mesh can be complex, the +edge is used to define the sub-mesh for the path

+
NodeStart the first or the last node on the edge. It is used +to define the direction of extrusion

+
HasAngles allows the shape to be rotated around the path to +get the resulting mesh in a helical fashion

+
Angles list of angles

+
HasRefPoint allows to use base point

+
RefPoint point around which the shape is rotated(the mass +center of the shape by default). User can specify any point as the Base +Point and the shape will be rotated with respect to this point.
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Mirror   self,

+

+
  IDsOfElements, +

+

+
  Mirror,

+

+
  theMirrorType, +

+

+
  Copy = 0

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+
IDsOfElements list of elements ids

+
Mirror is AxisStruct or geom object(point, line, plane)

+
theMirrorType is POINT, AXIS or PLANE If the Mirror is geom +object this parameter is unnecessary

+
Copy allows to copy element(Copy is 1) or to replace +with its mirroring(Copy is 0)
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.MirrorObject   self,

+

+
  theObject,

+

+
  Mirror,

+

+
  theMirrorType, +

+

+
  Copy = 0

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+
theObject mesh, submesh or group

+
Mirror is AxisStruct or geom object(point, line, plane)

+
theMirrorType is POINT, AXIS or PLANE If the Mirror is geom +object this parameter is unnecessary

+
Copy allows to copy element(Copy is 1) or to replace +with its mirroring(Copy is 0)
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Translate   self,

+

+
  IDsOfElements, +

+

+
  Vector,

+

+
  Copy

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
IDsOfElements list of elements ids

+
Vector direction of translation(DirStruct or vector)

+
Copy allows to copy the translated elements
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.TranslateObject   self,

+

+
  theObject,

+

+
  Vector,

+

+
  Copy

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + +

+
theObject object to translate(mesh, submesh, or group)

+
Vector direction of translation(DirStruct or geom vector)

+
Copy allows to copy the translated elements
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.Rotate   self,

+

+
  IDsOfElements, +

+

+
  Axis,

+

+
  AngleInRadians, +

+

+
  Copy

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+
IDsOfElements list of elements ids

+
Axis axis of rotation(AxisStruct or geom line)

+
AngleInRadians angle of rotation(in radians)

+
Copy allows to copy the rotated elements
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.RotateObject   self,

+

+
  theObject,

+

+
  Axis,

+

+
  AngleInRadians, +

+

+
  Copy

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+
theObject object to rotate(mesh, submesh, or group)

+
Axis axis of rotation(AxisStruct or geom line)

+
AngleInRadians angle of rotation(in radians)

+
Copy allows to copy the rotated elements
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.FindCoincidentNodes   self,

+

+
  Tolerance

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
Tolerance tolerance value

+
list of group of nodes
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.MergeNodes   self,

+

+
  GroupsOfNodes

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
list of group of nodes
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.MergeEqualElements   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SewFreeBorders   self,

+

+
  FirstNodeID1, +

+

+
  SecondNodeID1, +

+

+
  LastNodeID1,

+

+
  FirstNodeID2, +

+

+
  SecondNodeID2, +

+

+
  LastNodeID2,

+

+
  CreatePolygons, +

+

+
  CreatePolyedrs

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SewConformFreeBorders   self,

+

+
  FirstNodeID1, +

+

+
  SecondNodeID1, +

+

+
  LastNodeID1,

+

+
  FirstNodeID2, +

+

+
  SecondNodeID2

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SewBorderToSide   self,

+

+
  FirstNodeIDOnFreeBorder, +

+

+
  SecondNodeIDOnFreeBorder, +

+

+
  LastNodeIDOnFreeBorder, +

+

+
  FirstNodeIDOnSide, +

+

+
  LastNodeIDOnSide, +

+

+
  CreatePolygons, +

+

+
  CreatePolyedrs

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.SewSideElements   self,

+

+
  IDsOfSide1Elements, +

+

+
  IDsOfSide2Elements, +

+

+
  NodeID1OfSide1ToMerge, +

+

+
  NodeID1OfSide2ToMerge, +

+

+
  NodeID2OfSide1ToMerge, +

+

+
  NodeID2OfSide2ToMerge

+

+
+
+ + + + + + + +
  +

Nodes belonging to Side1 are merged with nodes of elements of +Side2. Number of elements in theSide1 and in theSide2 must be equal and +they should have similar node connectivity. The nodes to merge should +belong to sides borders and the first node should be linked to the +second.

+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh.ChangeElemNodes   self,

+

+
  ide,

+

+
  newIDs

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
ide the element id

+
newIDs nodes ids
+
+
+
+
Returns:
+
If number of nodes is not corresponded to type of element - +returns false
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetLastCreatedNodes   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh.GetLastCreatedElems   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+
+

Field Documentation

+ +

+ + + + + + +
+ + + + + + +
int smesh.Mesh.geom += 0 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.Mesh.mesh += 0 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.Mesh.editor += 0 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.Mesh.geom +
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.Mesh.mesh +
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.Mesh.editor +
+
+ + + + + + + +
  +

+
+
+

+ diff --git a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Algorithm.html b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Algorithm.html index 97d0e0ef7..eab86f41c 100644 --- a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Algorithm.html +++ b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Algorithm.html @@ -1,461 +1,892 @@ - - -SALOME - SMESH - v.version: smesh.Mesh_Algorithm Class Reference - - - + + + + + + Main Page + + + + -

smesh.Mesh_Algorithm Class Reference

Mother class to define algorithm, recommended to don't use directly. -More... -

-Inheritance diagram for smesh.Mesh_Algorithm:

Inheritance graph
+

smesh.Mesh_Algorithm Class Reference

+
+Mother class to define algorithm, recommended to don't use directly. More... +

Inheritance diagram for smesh.Mesh_Algorithm:
+
+

+

+
Inheritance graph
- - - - - - + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

def GetSubMesh
def GetAlgorithm
 Return the wrapped mesher.
def TreatHypoStatus
 Private method.
def Create
 Private method.
def Hypothesis
 Private method.

Data Fields

 mesh
 geom
 subm
 algo

Static Public Attributes

int mesh = 0
int geom = 0
int subm = 0
int algo = 0
-

Detailed Description

-More details. + + +
+ + + +
+

Public Member Functions

+ + + + def  + GetSubMesh + + +   + If the algorithm is global, return 0;
+else return the submesh associated to this algorithm.
+ + + + def  + GetAlgorithm + + +   + Return the wrapped mesher.
+ + + + def  + GetCompatibleHypothesis + + +   + Get list of hypothesis that can be used +with this algorithm.
+ + + + def  + GetName + + +   + Get name of algo.
+ + + + def  + SetName + + +   + Set name to algo.
+ + + + def  + GetId + + +   + Get id of algo.
+ + + + def  + TreatHypoStatus + + +   + Private method.
+ + + + def  + Create + + +   + Private method.
+ + + + def  + Hypothesis + + +   + Private method.
+ + + +
+

Data Fields

+ + + +   + mesh + + +   + geom + + +   + subm + + +   + algo + + +
+

Static Public Attributes

+ + + + int  + mesh += 0 + + + int  + geom += 0 + + + int  + subm += 0 + + + int  + algo += 0 + + + +
+

Detailed Description

+More details. +

+
+

Member Function Documentation

+

-


Member Function Documentation

-

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetSubMesh   self  ) 
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetSubMesh   self +  ) 
+
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetAlgorithm   self  ) 
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetAlgorithm   self +  ) 
+
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.TreatHypoStatus   self,
  status,
  hypName,
  geomName,
  isAlgo
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetCompatibleHypothesis   self +  ) 
+
-
- - - - - + + + +
-   - - -

-Print error message if a hypothesis was not assigned.

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Create   self,
  mesh,
  geom,
  hypo,
  so = "libStdMeshersEngine.so"
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetName   self +  ) 
+
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Hypothesis   self,
  hyp,
  args = [],
  so = "libStdMeshersEngine.so"
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.SetName   self,

+

+
  name

+

+
-
- - - - - + + +
-   - - -

-

-

Field Documentation

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - + + + - -
int smesh.Mesh_Algorithm.mesh = 0 [static]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetId   self +  ) 
+
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - + + + - -
int smesh.Mesh_Algorithm.geom = 0 [static]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.TreatHypoStatus   self,

+

+
  status,

+

+
  hypName,

+

+
  geomName,

+

+
  isAlgo

+

+
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

Print error message if a hypothesis was not assigned.

+
-

+

+

- -
- - - - + + + - -
int smesh.Mesh_Algorithm.subm = 0 [static]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Create   self,

+

+
  mesh,

+

+
  geom,

+

+
  hypo,

+

+
  so = "libStdMeshersEngine.so"

+

+
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - + + + - -
int smesh.Mesh_Algorithm.algo = 0 [static]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Hypothesis   self,

+

+
  hyp,

+

+
  args = [], +

+

+
  so = "libStdMeshersEngine.so"

+

+
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+
+

Field Documentation

+ +

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.mesh
+ + + + + +
int smesh.Mesh_Algorithm.mesh += 0 [static]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + +
+ + + + + + +
int smesh.Mesh_Algorithm.geom += 0 [static]
+
-

+ + + + + + + +
  +

+
+
+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.geom
+ + + + + +
int smesh.Mesh_Algorithm.subm += 0 [static]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + +
+ + + + + + +
int smesh.Mesh_Algorithm.algo += 0 [static]
+
-

+ + + + + + + +
  +

+
+
+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.subm
+ + + + + +
smesh.Mesh_Algorithm.mesh +
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.geom +
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.algo
+ + + + + +
smesh.Mesh_Algorithm.subm +
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.algo +
+
+ + + + + + +
  +

+
+

diff --git a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Hexahedron.html b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Hexahedron.html index d177efa43..7b13d15ca 100644 --- a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Hexahedron.html +++ b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Hexahedron.html @@ -1,502 +1,939 @@ - - -SALOME - SMESH - v.version: smesh.Mesh_Hexahedron Class Reference - - - + + + + + + Main Page + + + + -

smesh.Mesh_Hexahedron Class Reference

Class to define a hexahedron 3D algorithm. -More... -

-Inheritance diagram for smesh.Mesh_Hexahedron:

Inheritance graph
+

smesh.Mesh_Hexahedron Class Reference

+ +
+Class to define a hexahedron 3D algorithm. More... +

Inheritance diagram for smesh.Mesh_Hexahedron:
+
+

+

+
Inheritance graph
- + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

def __init__
 Private constructor.
def GetSubMesh
def GetAlgorithm
 Return the wrapped mesher.
def TreatHypoStatus
 Private method.
def Create
 Private method.
def Hypothesis
 Private method.

Data Fields

 mesh
 geom
 subm
 algo

Static Public Attributes

int mesh = 0
int geom = 0
int subm = 0
int algo = 0
-

Detailed Description

-More details. +

+

+

Public Member Functions

+
def __init__
 Private constructor.
+
def GetSubMesh
 If the algorithm is global, return 0;
+else return the submesh associated to this algorithm.
+
def GetAlgorithm
 Return the wrapped mesher.
+
def GetCompatibleHypothesis
 Get list of hypothesis that can be used +with this algorithm.
+
def GetName
 Get name of algo.
+
def SetName
 Set name to algo.
+
def GetId
 Get id of algo.
+
def TreatHypoStatus
 Private method.
+
def Create
 Private method.
+
def Hypothesis
 Private method.
+

+

Data Fields

+
 mesh
 geom
 subm
 algo

+

Static Public Attributes

+
int mesh += 0
int geom += 0
int subm += 0
int algo += 0
+


+

Detailed Description

+More details. +

+
+

Member Function Documentation

+

-


Member Function Documentation

-

- -
- - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Hexahedron.__init__   self,
  mesh,
  geom = 0
+ + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Hexahedron.__init__   self,

+

+
  mesh,

+

+
  geom = 0

+

+
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetSubMesh   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetSubMesh   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetAlgorithm   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetAlgorithm   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.TreatHypoStatus   self,
  status,
  hypName,
  geomName,
  isAlgo
[inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetCompatibleHypothesis   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-Print error message if a hypothesis was not assigned.

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Create   self,
  mesh,
  geom,
  hypo,
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetName   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Hypothesis   self,
  hyp,
  args = [],
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.SetName   self,

+

+
  name

+
[inherited]
-
- - - - - + + +
-   - - -

-

-

Field Documentation

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - + + + - -
int smesh.Mesh_Algorithm.mesh = 0 [static, inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetId   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - + + + - -
smesh.Mesh_Algorithm.mesh [inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.TreatHypoStatus   self,

+

+
  status,

+

+
  hypName,

+

+
  geomName,

+

+
  isAlgo

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

Print error message if a hypothesis was not assigned.

+
-

+

+

- -
- - - - + + + - -
int smesh.Mesh_Algorithm.geom = 0 [static, inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Create   self,

+

+
  mesh,

+

+
  geom,

+

+
  hypo,

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - + + + - -
smesh.Mesh_Algorithm.geom [inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Hypothesis   self,

+

+
  hyp,

+

+
  args = [], +

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+
+

Field Documentation

+ +

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.subm = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.mesh += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.mesh +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.subm [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.geom += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + +
+ + + + + + +
smesh.Mesh_Algorithm.geom +[inherited]
+
-

+ + + + + + + +
  +

+
+
+

+

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.algo = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.subm += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.subm +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.algo [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.algo += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.algo +[inherited]
+
+ + + + + + +
  +

+
+

diff --git a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Hexahedron__inherit__graph.jpg b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Hexahedron__inherit__graph.jpg index 4d1e65ac6675d7b7cda598fd0e834ded872a02fb..08777ef7c519b924ce2444fca9653111096af116 100644 GIT binary patch delta 11 TcmbQHJym - -SALOME - SMESH - v.version: smesh.Mesh_Netgen Class Reference - - - + + + + + + Main Page + + + + -

smesh.Mesh_Netgen Class Reference

Class to define a NETGEN-based 2D or 3D algorithm that need no discrete boundary (i.e. -More... -

-Inheritance diagram for smesh.Mesh_Netgen:

Inheritance graph
+

smesh.Mesh_Netgen Class Reference

+ +Class to define a NETGEN-based 2D or 3D algorithm that need no discrete +boundary (i.e. More... +

Inheritance diagram for smesh.Mesh_Netgen:
+
+

+

+
Inheritance graph
- + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

def __init__
 Private constructor.
def Parameters
 Define hypothesis containing parameters of the algorithm.
def GetSubMesh
def GetAlgorithm
 Return the wrapped mesher.
def TreatHypoStatus
 Private method.
def Create
 Private method.
def Hypothesis
 Private method.

Data Fields

 is3D
 mesh
 geom
 subm
 algo

Static Public Attributes

int is3D = 0
int mesh = 0
int geom = 0
int subm = 0
int algo = 0
-

Detailed Description

-independent)

-More details. +


+

+

Public Member Functions

+
def __init__
 Private constructor.
+
def Parameters
 Define hypothesis containing parameters of +the algorithm.
+
def GetSubMesh
 If the algorithm is global, return 0;
+else return the submesh associated to this algorithm.
+
def GetAlgorithm
 Return the wrapped mesher.
+
def GetCompatibleHypothesis
 Get list of hypothesis that can be used +with this algorithm.
+
def GetName
 Get name of algo.
+
def SetName
 Set name to algo.
+
def GetId
 Get id of algo.
+
def TreatHypoStatus
 Private method.
+
def Create
 Private method.
+
def Hypothesis
 Private method.
+

+

Data Fields

+
 is3D
 mesh
 geom
 subm
 algo

+

Static Public Attributes

+
int is3D += 0
int mesh += 0
int geom += 0
int subm += 0
int algo += 0
+


+

Detailed Description

+independent) +

This class is deprecated, only for compatibility!

+

More details.

+

+
+

Member Function Documentation

+

-


Member Function Documentation

-

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Netgen.__init__   self,
  mesh,
  is3D,
  geom = 0
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Netgen.__init__   self,

+

+
  mesh,

+

+
  is3D,

+

+
  geom = 0

+

+
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Netgen.Parameters   self  ) 
+ + + + + + + + + + +
def +smesh.Mesh_Netgen.Parameters   self +  ) 
+
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetSubMesh   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetSubMesh   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetAlgorithm   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetAlgorithm   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.TreatHypoStatus   self,
  status,
  hypName,
  geomName,
  isAlgo
[inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetCompatibleHypothesis   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-Print error message if a hypothesis was not assigned.

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Create   self,
  mesh,
  geom,
  hypo,
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetName   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Hypothesis   self,
  hyp,
  args = [],
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.SetName   self,

+

+
  name

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

Field Documentation

-

+

+

- -
- - - - + + + - -
int smesh.Mesh_Netgen.is3D = 0 [static]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetId   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - + + + - -
smesh.Mesh_Netgen.is3D
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.TreatHypoStatus   self,

+

+
  status,

+

+
  hypName,

+

+
  geomName,

+

+
  isAlgo

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

Print error message if a hypothesis was not assigned.

+
-

+

+

- -
- - - - + + + - -
int smesh.Mesh_Algorithm.mesh = 0 [static, inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Create   self,

+

+
  mesh,

+

+
  geom,

+

+
  hypo,

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - + + + - -
smesh.Mesh_Algorithm.mesh [inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Hypothesis   self,

+

+
  hyp,

+

+
  args = [], +

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+
+

Field Documentation

+ +

- -
- - - - + + + - -
int smesh.Mesh_Algorithm.geom = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Netgen.is3D += 0 [static]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - + + + - -
smesh.Mesh_Algorithm.geom [inherited]
+ + + + + +
smesh.Mesh_Netgen.is3D +
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.subm = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.mesh += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.mesh +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.subm [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.geom += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.geom +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.algo = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.subm += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.subm +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.algo [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.algo += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.algo +[inherited]
+
+ + + + + + +
  +

+
+
+

diff --git a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Quadrangle.html b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Quadrangle.html index 8febcc801..b17a070c4 100644 --- a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Quadrangle.html +++ b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Quadrangle.html @@ -1,533 +1,988 @@ - - -SALOME - SMESH - v.version: smesh.Mesh_Quadrangle Class Reference - - - + + + + + + Main Page + + + + -

smesh.Mesh_Quadrangle Class Reference

Class to define a quadrangle 2D algorithm. -More... -

-Inheritance diagram for smesh.Mesh_Quadrangle:

Inheritance graph
+

smesh.Mesh_Quadrangle Class Reference

+ +
+Class to define a quadrangle 2D algorithm. More... +

Inheritance diagram for smesh.Mesh_Quadrangle:
+
+

+

+
Inheritance graph
- + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

def __init__
 Private constructor.
def QuadranglePreference
 Define "QuadranglePreference" hypothesis, forcing construction of quadrangles if the number of nodes on opposite edges is not the same in the case where the global number of nodes on edges is even.
def GetSubMesh
def GetAlgorithm
 Return the wrapped mesher.
def TreatHypoStatus
 Private method.
def Create
 Private method.
def Hypothesis
 Private method.

Data Fields

 mesh
 geom
 subm
 algo

Static Public Attributes

int mesh = 0
int geom = 0
int subm = 0
int algo = 0
-

Detailed Description

-More details. +

+

+

Public Member Functions

+
def __init__
 Private constructor.
+
def QuadranglePreference
 Define "QuadranglePreference" hypothesis, +forcing construction of quadrangles if the number of nodes on opposite +edges is not the same in the case where the global number of nodes on +edges is even.
+
def GetSubMesh
 If the algorithm is global, return 0;
+else return the submesh associated to this algorithm.
+
def GetAlgorithm
 Return the wrapped mesher.
+
def GetCompatibleHypothesis
 Get list of hypothesis that can be used +with this algorithm.
+
def GetName
 Get name of algo.
+
def SetName
 Set name to algo.
+
def GetId
 Get id of algo.
+
def TreatHypoStatus
 Private method.
+
def Create
 Private method.
+
def Hypothesis
 Private method.
+

+

Data Fields

+
 mesh
 geom
 subm
 algo

+

Static Public Attributes

+
int mesh += 0
int geom += 0
int subm += 0
int algo += 0
+


+

Detailed Description

+More details. +

+
+

Member Function Documentation

+

-


Member Function Documentation

-

- -
- - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Quadrangle.__init__   self,
  mesh,
  geom = 0
+ + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Quadrangle.__init__   self,

+

+
  mesh,

+

+
  geom = 0

+

+
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Quadrangle.QuadranglePreference   self  ) 
+ + + + + + + + + + +
def +smesh.Mesh_Quadrangle.QuadranglePreference   self +  ) 
+
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetSubMesh   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetSubMesh   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetAlgorithm   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetAlgorithm   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.TreatHypoStatus   self,
  status,
  hypName,
  geomName,
  isAlgo
[inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetCompatibleHypothesis   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-Print error message if a hypothesis was not assigned.

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Create   self,
  mesh,
  geom,
  hypo,
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetName   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Hypothesis   self,
  hyp,
  args = [],
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.SetName   self,

+

+
  name

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

Field Documentation

-

+

+

- -
- - - - + + + - -
int smesh.Mesh_Algorithm.mesh = 0 [static, inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetId   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - + + + - -
smesh.Mesh_Algorithm.mesh [inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.TreatHypoStatus   self,

+

+
  status,

+

+
  hypName,

+

+
  geomName,

+

+
  isAlgo

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

Print error message if a hypothesis was not assigned.

+
-

+

+

- -
- - - - + + + - -
int smesh.Mesh_Algorithm.geom = 0 [static, inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Create   self,

+

+
  mesh,

+

+
  geom,

+

+
  hypo,

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - + + + - -
smesh.Mesh_Algorithm.geom [inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Hypothesis   self,

+

+
  hyp,

+

+
  args = [], +

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+
+

Field Documentation

+ +

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.subm = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.mesh += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + +
+ + + + + + +
smesh.Mesh_Algorithm.mesh +[inherited]
+
-

+ + + + + + + +
  +

+
+
+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.subm [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.geom += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.geom +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.algo = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.subm += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + +
+ + + + + + +
smesh.Mesh_Algorithm.subm +[inherited]
+
-

+ + + + + + + +
  +

+
+
+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.algo [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.algo += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.algo +[inherited]
+
+ + + + + + +
  +

+
+

diff --git a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Segment.html b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Segment.html index 53ca6c993..e39e7de34 100644 --- a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Segment.html +++ b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Segment.html @@ -1,858 +1,1523 @@ - - -SALOME - SMESH - v.version: smesh.Mesh_Segment Class Reference - - - + + + + + + Main Page + + + + -

smesh.Mesh_Segment Class Reference

Class to define a segment 1D algorithm for discretization. -More... -

-Inheritance diagram for smesh.Mesh_Segment:

Inheritance graph
+

smesh.Mesh_Segment Class Reference

+ +
+Class to define a segment 1D algorithm for discretization. More... +

Inheritance diagram for smesh.Mesh_Segment:
+
+

+

+
Inheritance graph
- - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

def __init__
 Private constructor.
def LocalLength
 Define "LocalLength" hypothesis to cut an edge in several segments with the same length.
def NumberOfSegments
 Define "NumberOfSegments" hypothesis to cut an edge in several fixed number of segments.
def Arithmetic1D
 Define "Arithmetic1D" hypothesis to cut an edge in several segments with arithmetic length increasing.
def StartEndLength
 Define "StartEndLength" hypothesis to cut an edge in several segments with geometric length increasing.
def Deflection1D
 Define "Deflection1D" hypothesis.
def Propagation
 Define "Propagation" hypothesis that propagate all other hypothesis on all others edges that are in the opposite side in the case of quadrangular faces.
def AutomaticLength
 Define "AutomaticLength" hypothesis.
def QuadraticMesh
 Define "QuadraticMesh" hypothesis, forcing construction of quadratic edges.
def GetSubMesh
def GetAlgorithm
 Return the wrapped mesher.
def TreatHypoStatus
 Private method.
def Create
 Private method.
def Hypothesis
 Private method.

Data Fields

 mesh
 geom
 subm
 algo

Static Public Attributes

int mesh = 0
int geom = 0
int subm = 0
int algo = 0
-

Detailed Description

-More details. +

+

+

Public Member Functions

+
def __init__
 Private constructor.
+
def LocalLength
 Define "LocalLength" hypothesis to cut an +edge in several segments with the same length.
+
def NumberOfSegments
 Define "NumberOfSegments" hypothesis to +cut an edge in several fixed number of segments.
+
def Arithmetic1D
 Define "Arithmetic1D" hypothesis to cut an +edge in several segments with arithmetic length increasing.
+
def StartEndLength
 Define "StartEndLength" hypothesis to cut +an edge in several segments with geometric length increasing.
+
def Deflection1D
 Define "Deflection1D" hypothesis.
+
def Propagation
 Define "Propagation" hypothesis that +propagate all other hypothesis on all others edges that are in the +opposite side in the case of quadrangular faces.
+
def AutomaticLength
 Define "AutomaticLength" hypothesis.
+
def QuadraticMesh
 Define "QuadraticMesh" hypothesis, forcing +construction of quadratic edges.
+
def GetSubMesh
 If the algorithm is global, return 0;
+else return the submesh associated to this algorithm.
+
def GetAlgorithm
 Return the wrapped mesher.
+
def GetCompatibleHypothesis
 Get list of hypothesis that can be used +with this algorithm.
+
def GetName
 Get name of algo.
+
def SetName
 Set name to algo.
+
def GetId
 Get id of algo.
+
def TreatHypoStatus
 Private method.
+
def Create
 Private method.
+
def Hypothesis
 Private method.
+

+

Data Fields

+
 mesh
 geom
 subm
 algo

+

Static Public Attributes

+
int mesh += 0
int geom += 0
int subm += 0
int algo += 0
+


+

Detailed Description

+More details. +

+
+

Member Function Documentation

+

-


Member Function Documentation

-

- -
- - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.__init__   self,
  mesh,
  geom = 0
+ + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.__init__   self,

+

+
  mesh,

+

+
  geom = 0

+

+
-
- - - - - + + + +
-   - - -

- -

-Reimplemented in smesh.Mesh_Segment_Python.

+ + + + + + +
  +

+

Reimplemented in smesh.Mesh_Segment_Python. +

+
-

+

+

- - - -
- - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.LocalLength   self,
  l
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.LocalLength   self,

+

+
  l

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
l for the length of segments that cut an edge
+
+
+
+

-

Parameters:
- - -
l for the length of segments that cut an edge
-
-
-

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.NumberOfSegments   self,
  n,
  s = []
+ + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.NumberOfSegments   self,

+

+
  n,

+

+
  s = []

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
n for the number of segments that cut an edge

+
s for the scale factor (optional)
+
+
+
+

-

Parameters:
- - - -
n for the number of segments that cut an edge
s for the scale factor (optional)
-
-
-

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.Arithmetic1D   self,
  start,
  end
+ + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.Arithmetic1D   self,

+

+
  start,

+

+
  end

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
start for the length of the first segment

+
end for the length of the last segment
+
+
+
+

-

Parameters:
- - - -
start for the length of the first segment
end for the length of the last segment
-
-
-

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.StartEndLength   self,
  start,
  end
+ + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.StartEndLength   self,

+

+
  start,

+

+
  end

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
start for the length of the first segment

+
end for the length of the last segment
+
+
+
+

-

Parameters:
- - - -
start for the length of the first segment
end for the length of the last segment
-
-
-

- - - -
- - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.Deflection1D   self,
  d
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.Deflection1D   self,

+

+
  d

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
d for the deflection
+
+
+
+

-

Parameters:
- - -
d for the deflection
-
-
-

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Segment.Propagation   self  ) 
+ + + + + + + + + + +
def +smesh.Mesh_Segment.Propagation   self +  ) 
+
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- - - -
- - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.AutomaticLength   self,
  fineness = 0
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.AutomaticLength   self,

+

+
  fineness = 0

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
fineness for the fineness [0-1]
+
+
+
+

-

Parameters:
- - -
fineness for the fineness [0-1]
-
-
-

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Segment.QuadraticMesh   self  ) 
+ + + + + + + + + + +
def +smesh.Mesh_Segment.QuadraticMesh   self +  ) 
+
-
- - - - - + + +
-   - - -

-If the 2D mesher sees that all boundary edges are quadratic ones, it generates quadratic faces, else it generates linear faces using medium nodes as if they were vertex ones. The 3D mesher generates quadratic volumes only if all boundary faces are quadratic ones, else it fails.

-

+ + + + + + + +
  +

If the 2D mesher sees that all boundary edges are quadratic +ones, it generates quadratic faces, else it generates linear faces +using medium nodes as if they were vertex ones. The 3D mesher generates +quadratic volumes only if all boundary faces are quadratic ones, else +it fails.

+
+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetSubMesh   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetSubMesh   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetAlgorithm   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetAlgorithm   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.TreatHypoStatus   self,
  status,
  hypName,
  geomName,
  isAlgo
[inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetCompatibleHypothesis   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-Print error message if a hypothesis was not assigned.

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Create   self,
  mesh,
  geom,
  hypo,
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetName   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Hypothesis   self,
  hyp,
  args = [],
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.SetName   self,

+

+
  name

+
[inherited]
-
- - - - - + + +
-   - - -

-

-

Field Documentation

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - + + + - -
int smesh.Mesh_Algorithm.mesh = 0 [static, inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetId   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - + + + - -
smesh.Mesh_Algorithm.mesh [inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.TreatHypoStatus   self,

+

+
  status,

+

+
  hypName,

+

+
  geomName,

+

+
  isAlgo

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

Print error message if a hypothesis was not assigned.

+
-

+

+

- -
- - - - + + + - -
int smesh.Mesh_Algorithm.geom = 0 [static, inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Create   self,

+

+
  mesh,

+

+
  geom,

+

+
  hypo,

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - + + + - -
smesh.Mesh_Algorithm.geom [inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Hypothesis   self,

+

+
  hyp,

+

+
  args = [], +

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+
+

Field Documentation

+ +

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.subm = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.mesh += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.mesh +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.subm [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.geom += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + +
+ + + + + + +
smesh.Mesh_Algorithm.geom +[inherited]
+
-

+ + + + + + + +
  +

+
+
+

+

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.algo = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.subm += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.subm +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.algo [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.algo += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.algo +[inherited]
+
+ + + + + + +
  +

+
+
+

diff --git a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Segment__Python.html b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Segment__Python.html index 230c9c259..8dae93e69 100644 --- a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Segment__Python.html +++ b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Segment__Python.html @@ -1,910 +1,1608 @@ - - -SALOME - SMESH - v.version: smesh.Mesh_Segment_Python Class Reference - - - + + + + + + Main Page + + + + -

smesh.Mesh_Segment_Python Class Reference

Class to define a segment 1D algorithm for discretization with python function. -More... -

-Inheritance diagram for smesh.Mesh_Segment_Python:

Inheritance graph
+

smesh.Mesh_Segment_Python Class Reference

+ +
+Class to define a segment 1D algorithm for discretization with python +function. More... +

Inheritance diagram for smesh.Mesh_Segment_Python:
+
+

+

+
Inheritance graph
- - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

def __init__
 Private constructor.
def PythonSplit1D
 Define "PythonSplit1D" hypothesis based on the Erwan Adam patch, awaiting equivalent SALOME functionality.
def LocalLength
 Define "LocalLength" hypothesis to cut an edge in several segments with the same length.
def NumberOfSegments
 Define "NumberOfSegments" hypothesis to cut an edge in several fixed number of segments.
def Arithmetic1D
 Define "Arithmetic1D" hypothesis to cut an edge in several segments with arithmetic length increasing.
def StartEndLength
 Define "StartEndLength" hypothesis to cut an edge in several segments with geometric length increasing.
def Deflection1D
 Define "Deflection1D" hypothesis.
def Propagation
 Define "Propagation" hypothesis that propagate all other hypothesis on all others edges that are in the opposite side in the case of quadrangular faces.
def AutomaticLength
 Define "AutomaticLength" hypothesis.
def QuadraticMesh
 Define "QuadraticMesh" hypothesis, forcing construction of quadratic edges.
def GetSubMesh
def GetAlgorithm
 Return the wrapped mesher.
def TreatHypoStatus
 Private method.
def Create
 Private method.
def Hypothesis
 Private method.

Data Fields

 mesh
 geom
 subm
 algo

Static Public Attributes

int mesh = 0
int geom = 0
int subm = 0
int algo = 0
-

Detailed Description

-More details. +

+

+

Public Member Functions

+
def __init__
 Private constructor.
+
def PythonSplit1D
 Define "PythonSplit1D" hypothesis based on +the Erwan Adam patch, awaiting equivalent SALOME functionality.
+
def LocalLength
 Define "LocalLength" hypothesis to cut an +edge in several segments with the same length.
+
def NumberOfSegments
 Define "NumberOfSegments" hypothesis to +cut an edge in several fixed number of segments.
+
def Arithmetic1D
 Define "Arithmetic1D" hypothesis to cut an +edge in several segments with arithmetic length increasing.
+
def StartEndLength
 Define "StartEndLength" hypothesis to cut +an edge in several segments with geometric length increasing.
+
def Deflection1D
 Define "Deflection1D" hypothesis.
+
def Propagation
 Define "Propagation" hypothesis that +propagate all other hypothesis on all others edges that are in the +opposite side in the case of quadrangular faces.
+
def AutomaticLength
 Define "AutomaticLength" hypothesis.
+
def QuadraticMesh
 Define "QuadraticMesh" hypothesis, forcing +construction of quadratic edges.
+
def GetSubMesh
 If the algorithm is global, return 0;
+else return the submesh associated to this algorithm.
+
def GetAlgorithm
 Return the wrapped mesher.
+
def GetCompatibleHypothesis
 Get list of hypothesis that can be used +with this algorithm.
+
def GetName
 Get name of algo.
+
def SetName
 Set name to algo.
+
def GetId
 Get id of algo.
+
def TreatHypoStatus
 Private method.
+
def Create
 Private method.
+
def Hypothesis
 Private method.
+

+

Data Fields

+
 mesh
 geom
 subm
 algo

+

Static Public Attributes

+
int mesh += 0
int geom += 0
int subm += 0
int algo += 0
+


+

Detailed Description

+More details. +

+
+

Member Function Documentation

+

-


Member Function Documentation

-

- -
- - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment_Python.__init__   self,
  mesh,
  geom = 0
+ + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment_Python.__init__   self,

+

+
  mesh,

+

+
  geom = 0

+

+
-
- - - - - + + + +
-   - - -

- -

-Reimplemented from smesh.Mesh_Segment.

+ + + + + + +
  +

+

Reimplemented from smesh.Mesh_Segment. +

+
-

+

+

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment_Python.PythonSplit1D   self,
  n,
  func
+ + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment_Python.PythonSplit1D   self,

+

+
  n,

+

+
  func

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
n for the number of segments that cut an edge

+
func for the python function that calculate the length +of all segments
+
+
+
+

-

Parameters:
- - - -
n for the number of segments that cut an edge
func for the python function that calculate the length of all segments
-
-
-

- - - -
- - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.LocalLength   self,
  l
[inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.LocalLength   self,

+

+
  l

+
[inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
l for the length of segments that cut an edge
+
+
+
+

-

Parameters:
- - -
l for the length of segments that cut an edge
-
-
-

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.NumberOfSegments   self,
  n,
  s = []
[inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.NumberOfSegments   self,

+

+
  n,

+

+
  s = []

+
[inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
n for the number of segments that cut an edge

+
s for the scale factor (optional)
+
+
+
+

-

Parameters:
- - - -
n for the number of segments that cut an edge
s for the scale factor (optional)
-
-
-

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.Arithmetic1D   self,
  start,
  end
[inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.Arithmetic1D   self,

+

+
  start,

+

+
  end

+
[inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
start for the length of the first segment

+
end for the length of the last segment
+
+
+
+

-

Parameters:
- - - -
start for the length of the first segment
end for the length of the last segment
-
-
-

- - - -
- - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.StartEndLength   self,
  start,
  end
[inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.StartEndLength   self,

+

+
  start,

+

+
  end

+
[inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + + + + + + +

+
start for the length of the first segment

+
end for the length of the last segment
+
+
+
+

-

Parameters:
- - - -
start for the length of the first segment
end for the length of the last segment
-
-
-

- - - -
- - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.Deflection1D   self,
  d
[inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.Deflection1D   self,

+

+
  d

+
[inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
d for the deflection
+
+
+
+

-

Parameters:
- - -
d for the deflection
-
-
-

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Segment.Propagation   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Segment.Propagation   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- - - -
- - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Segment.AutomaticLength   self,
  fineness = 0
[inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Segment.AutomaticLength   self,

+

+
  fineness = 0

+
[inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
fineness for the fineness [0-1]
+
+
+
+

-

Parameters:
- - -
fineness for the fineness [0-1]
-
-
-

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Segment.QuadraticMesh   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Segment.QuadraticMesh   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-If the 2D mesher sees that all boundary edges are quadratic ones, it generates quadratic faces, else it generates linear faces using medium nodes as if they were vertex ones. The 3D mesher generates quadratic volumes only if all boundary faces are quadratic ones, else it fails.

-

+ + + + + + + +
  +

If the 2D mesher sees that all boundary edges are quadratic +ones, it generates quadratic faces, else it generates linear faces +using medium nodes as if they were vertex ones. The 3D mesher generates +quadratic volumes only if all boundary faces are quadratic ones, else +it fails.

+
+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetSubMesh   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetSubMesh   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetAlgorithm   self  )  [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetAlgorithm   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.TreatHypoStatus   self,
  status,
  hypName,
  geomName,
  isAlgo
[inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetCompatibleHypothesis   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-Print error message if a hypothesis was not assigned.

+ + + + + + +
  +

+
+
-

+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Create   self,
  mesh,
  geom,
  hypo,
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetName   self +  )  [inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Hypothesis   self,
  hyp,
  args = [],
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.SetName   self,

+

+
  name

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

Field Documentation

-

+

+

- - "; + return sHTML; +} + +function showHidePane(bShow) +{ + var oMsg=null; + if(bShow) + oMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null); + else + oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null); + SendMessage(oMsg); +} + +function isShowHideEnable() +{ + if(gbIE4) + return true; + else + return false; +} + + +function PickupDialog_Invoke() +{ + if(!gbIE4||gbMac) + { + if(typeof(_PopupMenu_Invoke)=="function") + return _PopupMenu_Invoke(PickupDialog_Invoke.arguments); + } + else + { + if(PickupDialog_Invoke.arguments.length>2) + { + var sPickup="whskin_pickup.htm"; + var sPickupPath=gsPPath+sPickup; + if(gbIE4) + { + var sFrame=PickupDialog_Invoke.arguments[1]; + var aTopics=new Array(); + for(var i=2;i1) + { + var nWidth=300; + var nHeight=180; + var nScreenWidth=screen.width; + var nScreenHeight=screen.height; + var nLeft=(nScreenWidth-nWidth)/2; + var nTop=(nScreenHeight-nHeight)/2; + if(gbIE4) + { + var vRet=window.showModalDialog(sPickupPath,aTopics,"dialogHeight:"+nHeight+"px;dialogWidth:"+nWidth+"px;resizable:yes;status:no;scroll:no;help:no;center:yes;"); + if(vRet) + { + var sURL=vRet.m_url; + if(sFrame) + window.open(sURL,sFrame); + else + window.open(sURL,"_self"); + } + } + } + else if(aTopics.length==1) + { + var sURL=aTopics[0].m_sURL + if(sFrame) + window.open(sURL,sFrame); + else + window.open(sURL,"_self"); + } + } + } + } +} + +if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy) +{ + RegisterListener("bsscright",WH_MSG_GETAVIAVENUES); + RegisterListener("bsscright",WH_MSG_GETTOCPATHS); + RegisterListener("bsscright",WH_MSG_NEXT); + RegisterListener("bsscright",WH_MSG_PREV); + RegisterListener("bsscright",WH_MSG_WEBSEARCH); + if(gbMac&&gbIE4) + { + if(typeof(window.onunload)!="unknown") + if(window.onunload.toString!=unRegisterListener.toString) + whtopic_foldUnload=window.onunload; + } + else + { + if(window.onunload) + if(window.onunload.toString!=unRegisterListener.toString) + whtopic_foldUnload=window.onunload; + } + window.onunload=unRegisterListener; + setButtonFont("show","","","","","",""); +setButtonFont("hide","","","","","",""); + + gbWhTopic=true; +} +else + document.location.reload(); diff --git a/doc/salome/gui/SMESH/whutils.js b/doc/salome/gui/SMESH/whutils.js index 85fae7e05..5026b24a3 100755 --- a/doc/salome/gui/SMESH/whutils.js +++ b/doc/salome/gui/SMESH/whutils.js @@ -1,527 +1,527 @@ -// WebHelp 5.10.004 -var gsFileName=""; -var gsDivName=""; -var xmlDoc=null; -var sdocPath=null; -var gsInsertBeforeEndHTML=""; -var sReplaceStringsSrc=new Array(); -var gsDivName="dataDiv"; -var gnLoadDivNum=0; -sReplaceStringsSrc[0]="&"; -sReplaceStringsSrc[1]=">"; -sReplaceStringsSrc[2]="<"; -sReplaceStringsSrc[3]="""; -sReplaceStringsSrc[4]=String.fromCharCode(8364); -sReplaceStringsSrc[5]=" "; - -var sReplaceStringsDst=new Array(); -sReplaceStringsDst[0]="&"; -sReplaceStringsDst[1]=">"; -sReplaceStringsDst[2]="<"; -sReplaceStringsDst[3]="\""; -sReplaceStringsDst[4]=String.fromCharCode(128); -sReplaceStringsDst[5]=" "; -var goHighLighted=null; - -function _getRelativePath(strParentPath,strCurrentPath) -{ - if(_isAbsPath(strCurrentPath)) return _getPath(strCurrentPath); - strParentPath=_replaceSlash(strParentPath); - strParentPath=_getPath(strParentPath); - strCurrentPath=_replaceSlash(strCurrentPath); - strCurrentPath=_getPath(strCurrentPath); - for(var i=0;i0) - { - var nPosx=sPath.indexOf("/",nPos+2); - if(nPosx>0) - return sPath.substring(0,nPosx); - else - return sPath; - } - return sPath; -} - -function _getFullPath(sPath,sRelPath) -{ - if(_isAbsPath(sRelPath)) - return sRelPath; - else if(_isAbsPathToHost(sRelPath)) - return _getHost(sPath)+sRelPath; - else - { - var sFullPath=sPath; - var nPathPos=0; - while(nPathPos!=-1) - { - var nPathPos=sRelPath.indexOf("../"); - if(nPathPos!=-1) - { - sRelPath=sRelPath.substring(nPathPos+3); - sFullPath=sFullPath.substring(0,sFullPath.length-1); - var nPos2=sFullPath.lastIndexOf("/"); - if(nPos2!=-1) - sFullPath=sFullPath.substring(0,nPos2+1); - else - break; - } - } - sFullPath+=sRelPath; - return sFullPath; - } -} - -function _isAbsPath(strPath) -{ - var strUpper=strPath.toUpperCase(); - return (strUpper.indexOf(":")!=-1||strUpper.indexOf("\\\\")==0); -} - -function _replaceSlash(strURL) -{ - var re=new RegExp("\\\\","g"); - var strReplacedURL=strURL.replace(re,"/"); - return strReplacedURL; -} - -function _getPath(strURL) -{ - pathpos=strURL.lastIndexOf("/"); - if(pathpos>0) - return strURL.substring(0,pathpos+1); - else - return ""; -} - -function removeItemFromArray(oArray,i) -{ - if(oArray.length&&i>=0&&i=0&&i<=oArray.length) - { - var len=oArray.length; - for(var s=len;s>i;s--) - oArray[s]=oArray[s-1]; - oArray[i]=obj; - } -} - -function loadData(sFileName) -{ - var i=gnLoadDivNum; - var sName=gsDivName+gnLoadDivNum++; - loadData_2(sFileName,sName); -} - -function loadData_2(sFileName,sDivName) -{ - if(!getElement(sDivName)) - { - if(!insertDataDiv(sDivName)) - { - gsFileName=sFileName; - gsDivName=sDivName; - return; - } - } - var sHTML=""; - if(gbMac) - sHTML+=""; - else - sHTML+=""; - - var oDivCon=getElement(sDivName); - if(oDivCon) - { - if(gbNav6) - { - if(oDivCon.getElementsByTagName&&oDivCon.getElementsByTagName("iFrame").length>0) - { - oDivCon.getElementsByTagName("iFrame")[0].src=sFileName; - } - else - oDivCon.innerHTML=sHTML; - } - else - oDivCon.innerHTML=sHTML; - } -} - -function loadDataXML(sFileName) -{ - var sCurrentDocPath=_getPath(document.location.href); - sdocPath=_getFullPath(sCurrentDocPath,sFileName); - if(gbIE5) - { - xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); - xmlDoc.async=true; - xmlDoc.onreadystatechange=checkState; - if(document.body!=null) - xmlDoc.load(sdocPath); - } - else if(gbNav6) - { - xmlDoc=document.implementation.createDocument("","",null); - xmlDoc.addEventListener("load",initializeData,false); - xmlDoc.load(sdocPath,"text/xml"); - } -} - -function initializeData() -{ - if(xmlDoc!=null) - putDataXML(xmlDoc,sdocPath); -} - -function checkState() -{ - if(xmlDoc!=null) - { - var state=xmlDoc.readyState; - if(state==4) - { - var err=xmlDoc.parseError; - if(err.errorCode==0) - putDataXML(xmlDoc,sdocPath); - else - onLoadXMLError(); - } - } -} - -function insertDataDiv(sName) -{ - var sHTML=""; - if(gbMac) - sHTML+="
"; - else - sHTML+="
"; - if((gbIE5||gbNav6)&&document.body) - document.body.insertAdjacentHTML("beforeEnd",sHTML); - else - { - gsInsertBeforeEndHTML=sHTML; - setTimeout("insertWhenBodyReady();",100); - return false; - } - return true; -} - -function insertWhenBodyReady() -{ - if(gsInsertBeforeEndHTML=="") return; - if(document.body) - { - document.body.insertAdjacentHTML("beforeEnd",gsInsertBeforeEndHTML); - gsInsertBeforeEndHTML=""; - loadData_2(gsFileName,gsDivName); - } - else - { - setTimeout("insertWhenBodyReady();",100); - } -} - -function window_BUnload() -{ - for(var i=0;i='0'&&sBStr.charAt(i)<='9') - { - sNum+=sBStr.charAt(i++); - } - if(sNum!=""){ - var nNum=parseInt(sNum,16); - sText+=String.fromCharCode(nNum); - sBStr=sBStr.substring(i); - } - nPos=sBStr.indexOf('%'); - } - sText+=sBStr; - return sText; -} - -function excapeSingleQuotandSlash(str) -{ - if(str==null) return null; - var nPos=0; - var sRes=""; - var nPosNew=str.indexOf("\\",nPos); - while(nPosNew!=-1){ - sRes+=str.substring(nPos,nPosNew+1)+"\\"; - nPos=nPosNew+1; - nPosNew=str.indexOf("\\",nPos); - } - if(nPos0) + { + var nPosx=sPath.indexOf("/",nPos+2); + if(nPosx>0) + return sPath.substring(0,nPosx); + else + return sPath; + } + return sPath; +} + +function _getFullPath(sPath,sRelPath) +{ + if(_isAbsPath(sRelPath)) + return sRelPath; + else if(_isAbsPathToHost(sRelPath)) + return _getHost(sPath)+sRelPath; + else + { + var sFullPath=sPath; + var nPathPos=0; + while(nPathPos!=-1) + { + var nPathPos=sRelPath.indexOf("../"); + if(nPathPos!=-1) + { + sRelPath=sRelPath.substring(nPathPos+3); + sFullPath=sFullPath.substring(0,sFullPath.length-1); + var nPos2=sFullPath.lastIndexOf("/"); + if(nPos2!=-1) + sFullPath=sFullPath.substring(0,nPos2+1); + else + break; + } + } + sFullPath+=sRelPath; + return sFullPath; + } +} + +function _isAbsPath(strPath) +{ + var strUpper=strPath.toUpperCase(); + return (strUpper.indexOf(":")!=-1||strUpper.indexOf("\\\\")==0); +} + +function _replaceSlash(strURL) +{ + var re=new RegExp("\\\\","g"); + var strReplacedURL=strURL.replace(re,"/"); + return strReplacedURL; +} + +function _getPath(strURL) +{ + pathpos=strURL.lastIndexOf("/"); + if(pathpos>0) + return strURL.substring(0,pathpos+1); + else + return ""; +} + +function removeItemFromArray(oArray,i) +{ + if(oArray.length&&i>=0&&i=0&&i<=oArray.length) + { + var len=oArray.length; + for(var s=len;s>i;s--) + oArray[s]=oArray[s-1]; + oArray[i]=obj; + } +} + +function loadData(sFileName) +{ + var i=gnLoadDivNum; + var sName=gsDivName+gnLoadDivNum++; + loadData_2(sFileName,sName); +} + +function loadData_2(sFileName,sDivName) +{ + if(!getElement(sDivName)) + { + if(!insertDataDiv(sDivName)) + { + gsFileName=sFileName; + gsDivName=sDivName; + return; + } + } + var sHTML=""; + if(gbMac) + sHTML+=""; + else + sHTML+=""; + + var oDivCon=getElement(sDivName); + if(oDivCon) + { + if(gbNav6) + { + if(oDivCon.getElementsByTagName&&oDivCon.getElementsByTagName("iFrame").length>0) + { + oDivCon.getElementsByTagName("iFrame")[0].src=sFileName; + } + else + oDivCon.innerHTML=sHTML; + } + else + oDivCon.innerHTML=sHTML; + } +} + +function loadDataXML(sFileName) +{ + var sCurrentDocPath=_getPath(document.location.href); + sdocPath=_getFullPath(sCurrentDocPath,sFileName); + if(gbIE5) + { + xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); + xmlDoc.async=true; + xmlDoc.onreadystatechange=checkState; + if(document.body!=null) + xmlDoc.load(sdocPath); + } + else if(gbNav6) + { + xmlDoc=document.implementation.createDocument("","",null); + xmlDoc.addEventListener("load",initializeData,false); + xmlDoc.load(sdocPath,"text/xml"); + } +} + +function initializeData() +{ + if(xmlDoc!=null) + putDataXML(xmlDoc,sdocPath); +} + +function checkState() +{ + if(xmlDoc!=null) + { + var state=xmlDoc.readyState; + if(state==4) + { + var err=xmlDoc.parseError; + if(err.errorCode==0) + putDataXML(xmlDoc,sdocPath); + else + onLoadXMLError(); + } + } +} + +function insertDataDiv(sName) +{ + var sHTML=""; + if(gbMac) + sHTML+="
"; + else + sHTML+="
"; + if((gbIE5||gbNav6)&&document.body) + document.body.insertAdjacentHTML("beforeEnd",sHTML); + else + { + gsInsertBeforeEndHTML=sHTML; + setTimeout("insertWhenBodyReady();",100); + return false; + } + return true; +} + +function insertWhenBodyReady() +{ + if(gsInsertBeforeEndHTML=="") return; + if(document.body) + { + document.body.insertAdjacentHTML("beforeEnd",gsInsertBeforeEndHTML); + gsInsertBeforeEndHTML=""; + loadData_2(gsFileName,gsDivName); + } + else + { + setTimeout("insertWhenBodyReady();",100); + } +} + +function window_BUnload() +{ + for(var i=0;i='0'&&sBStr.charAt(i)<='9') + { + sNum+=sBStr.charAt(i++); + } + if(sNum!=""){ + var nNum=parseInt(sNum,16); + sText+=String.fromCharCode(nNum); + sBStr=sBStr.substring(i); + } + nPos=sBStr.indexOf('%'); + } + sText+=sBStr; + return sText; +} + +function excapeSingleQuotandSlash(str) +{ + if(str==null) return null; + var nPos=0; + var sRes=""; + var nPosNew=str.indexOf("\\",nPos); + while(nPosNew!=-1){ + sRes+=str.substring(nPos,nPosNew+1)+"\\"; + nPos=nPosNew+1; + nPosNew=str.indexOf("\\",nPos); + } + if(nPos=4) - { - if(navigator.appName=="Netscape") - { - gbNav4=true; - if(gnVerMajor>=5) - gbNav6=true; - } - gbIE4=(navigator.appName.indexOf("Microsoft")!=-1); - } - if(gbNav6) - { - var nPos=gAgent.indexOf("gecko"); - if(nPos!=-1) - { - var nPos2=gAgent.indexOf("/", nPos); - if(nPos2!=-1) - { - var nVersion=parseFloat(gAgent.substring(nPos2+1)); - if(nVersion>=20010726) - { - gbNav61=true; - if (nVersion>=20020823) - gbNav7=true; - } - } - } - }else if(gbIE4) - { - var nPos=gAgent.indexOf("msie"); - if(nPos!=-1) - { - var nVersion=parseFloat(gAgent.substring(nPos+5)); - if(nVersion>=5) - { - gbIE5=true; - if(nVersion>=5.5) - gbIE55=true; - } - } - } -} -else if (gbOpera) -{ - var nPos = gAgent.indexOf("opera"); - if(nPos!=-1) - { - var nVersion=parseFloat(gAgent.substring(nPos+6)); - if(nVersion>=6) - { - gbOpera6=true; - if(nVersion>=7) - gbOpera7=true; - } - } -} -else if (gbKonqueror) -{ - var nPos = gAgent.indexOf("konqueror"); - if(nPos!=-1) - { - var nVersion = parseFloat(gAgent.substring(nPos+10)); - if (nVersion >= 3) - { - gbKonqueror3=true; - } - } -} - +// WebHelp 5.10.006 +var gbNav=false; +var gbNav6=false; +var gbNav61=false; +var gbNav7=false; +var gbNav4=false; +var gbIE4=false; +var gbIE=false; +var gbIE5=false; +var gbIE55=false; +var gbOpera6=false; +var gbOpera7=false; +var gbKonqueror3=false; + +var gAgent=navigator.userAgent.toLowerCase(); +var gbMac=(gAgent.indexOf("mac")!=-1); +var gbSunOS=(gAgent.indexOf("sunos")!=-1); +var gbOpera=(gAgent.indexOf("opera")!=-1); +var gbKonqueror=(gAgent.indexOf("konqueror")!= -1); +var gbSafari=(gAgent.indexOf("safari")!= -1); +var gbWindows=((gAgent.indexOf('win')!= -1)||(gAgent.indexOf('16bit')!= -1)); +var gbMozilla=((gAgent.indexOf('gecko')!=-1) && (gAgent.indexOf('netscape')==-1)); + + +var gVersion=navigator.appVersion.toLowerCase(); + +var gnVerMajor=parseInt(gVersion); +var gnVerMinor=parseFloat(gVersion); + +if(!gbOpera&&!gbKonqueror&&!gbSafari) // opera can mimic IE or Netscape by settings. +{ + gbIE=(navigator.appName.indexOf("Microsoft")!=-1); + gbNav=(gAgent.indexOf('mozilla')!=-1) && ((gAgent.indexOf('spoofer')==-1) && (gAgent.indexOf('compatible')==-1)); + if(gnVerMajor>=4) + { + if(navigator.appName=="Netscape") + { + gbNav4=true; + if(gnVerMajor>=5) + gbNav6=true; + } + gbIE4=(navigator.appName.indexOf("Microsoft")!=-1); + } + if(gbNav6) + { + var nPos=gAgent.indexOf("gecko"); + if(nPos!=-1) + { + var nPos2=gAgent.indexOf("/", nPos); + if(nPos2!=-1) + { + var nVersion=parseFloat(gAgent.substring(nPos2+1)); + if(nVersion>=20010726) + { + gbNav61=true; + if (nVersion>=20020823) + gbNav7=true; + } + } + } + }else if(gbIE4) + { + var nPos=gAgent.indexOf("msie"); + if(nPos!=-1) + { + var nVersion=parseFloat(gAgent.substring(nPos+5)); + if(nVersion>=5) + { + gbIE5=true; + if(nVersion>=5.5) + gbIE55=true; + } + } + } +} +else if (gbOpera) +{ + var nPos = gAgent.indexOf("opera"); + if(nPos!=-1) + { + var nVersion=parseFloat(gAgent.substring(nPos+6)); + if(nVersion>=6) + { + gbOpera6=true; + if(nVersion>=7) + gbOpera7=true; + } + } +} +else if (gbKonqueror) +{ + var nPos = gAgent.indexOf("konqueror"); + if(nPos!=-1) + { + var nVersion = parseFloat(gAgent.substring(nPos+10)); + if (nVersion >= 3) + { + gbKonqueror3=true; + } + } +} + var gbWhVer=true; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whxdata/whftdata0.xml b/doc/salome/gui/SMESH/whxdata/whftdata0.xml index 404df9493..22791bb27 100755 --- a/doc/salome/gui/SMESH/whxdata/whftdata0.xml +++ b/doc/salome/gui/SMESH/whxdata/whftdata0.xml @@ -1,78 +1,81 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whxdata/whfts.xml b/doc/salome/gui/SMESH/whxdata/whfts.xml index c965ac8ff..89269fc27 100755 --- a/doc/salome/gui/SMESH/whxdata/whfts.xml +++ b/doc/salome/gui/SMESH/whxdata/whfts.xml @@ -1,7 +1,7 @@ - - - - - - - + + + + + + + diff --git a/doc/salome/gui/SMESH/whxdata/whfwdata0.xml b/doc/salome/gui/SMESH/whxdata/whfwdata0.xml index 110993df5..7d7a59573 100755 --- a/doc/salome/gui/SMESH/whxdata/whfwdata0.xml +++ b/doc/salome/gui/SMESH/whxdata/whfwdata0.xml @@ -1,1406 +1,1379 @@ - - - 69, - 14,19,5,6,25,8,12,57,61,63,66,43,69,70,72, - 66, - 70, - 14, - 17,1,18,19,20,2,21,23,6,7,26,8,27,28,29,30,11,12,57,31,32,35,36,61,64,66,39,40,67,62,43,44,69,45,47,70,49,50,51,73,54, - 6,8,12,57,61,69,70,72, - 6,8,57,66,69,70, - 70, - 61, - 70, - 61,70, - 61, - 61, - 61,66,70, - 8,61,70, - 61, - 61, - 13,14,15,16,19,23,6,8,11,12,60,61,63,37,66,67,69, - 61,66, - 17,1,18,20,2,21,23,6,7,26,8,27,28,29,30,11,12,31,32,36,61,64,66,39,40,67,62,43,44,45,47,70,49,50,51,73,54, - 6,8,57,61,66,69,70,72, - 6,8,61,69, - 61,70, - 61,70, - 70, - 61, - 61, - 61, - 70, - 61, - 13,14,15,16,18,20,4,23,6,8,11,12,57,33,32,60,36,63,64,66,67,43,69,70,54, - 14,18,20,21,23,6,7,26,8,27,28,11,12,57,31,61,63,64,66,39,40,67,62,43,44,69,45,70,49,50,72,54, - 8,61,63,70, - 6, - 61, - 61, - 61, - 61, - 57,66, - 61, - 61,66,70, - 61, - 13,14,15,16,0,17,1,20,2,21,23,6,25,26,8,9,27,28,29,11,12,60,63,34,66,39,40,67,43,69,45,49,50,73,53, - 66, - 14, - 61, - 14,18,20,23,6,26,8,28,12,31,61,64,66,62,43,44,47,70,54, - 57,61,69, - 61, - 61, - 12,61,70, - 61, - 61, - 61, - 5,6,8,61,66,70, - 8,61,70, - 61, - 61, - 70, - 14, - 2,6,8,57,61,70, - 57,61,69, - 61, - 70, - 6,8,57,61,66, - 8,61,70, - 70, - 70, - 61, - 57,61,66,70, - 61,69, - 6, - 61, - 61, - 61, - 70, - 61,70, - 70, - 6,72, - 70, - 70, - 66, - 25, - 61, - 61, - 61, - 61, - 17,1,53, - 66, - 66, - 61,45, - 51, - 71, - 19, - 0,68,53, - 16,18,19,20,2,32,36,64,44,45,47,73,54, - 13,64, - 70, - 63,37, - 17,1,21,7,25,26,57,61,49,51, - 17,1,21,23,25,26,8,30,12,57,61,66,68,69,49, - 61, - 61, - 61, - 26,60,61, - 13,14,23,8,37,64,42,68,45, - 61, - 57, - 61, - 61, - 6,8,57,61,66,69,70,72, - 6,8,57,61, - 61, - 28,36,63,37,39,43,49, - 45, - 37, - 0,52, - 57,66, - 57,61,66, - 57,61,66, - 57, - 57,66, - 57, - 57, - 57, - 57, - 57, - 57, - 66, - 57, - 66, - 57, - 57, - 19, - 61, - 8,66,70, - 6,8,70, - 6,8,57,61,69,70,72, - 6,8,61,69,70,72, - 6,8,69,72, - 13,14,15,16,0,18,23,6,24,8,12,33,60,61,63,34,64,38,43, - 13,0,1,19,21,24,7,25,26,31,33,59,35,60,63,37,64,41,43,45,46,48,49,51,53, - 11,12,61,64,45,53, - 23, - 0,1, - 45, - 6, - 61,70, - 3, - 19, - 61,66,70, - 16,5,26,12,60,36,61,66,67,41,44,70,49,54, - 70, - 61, - 12, - 57,66, - 37, - 14,1,23,25,28,12,57,64,45, - 15,17,1,18,20,2,21,5,23,7,25,26,8,9,27,28,30,11,12,32,59,60,36,61,64,38,39,40,67,43,44,45,46,47,49,50,51,73,54, - 69, - 23, - 0,17,1,21,23,24,7,26,27,28,30,11,12,35,64,39,40,67,41,46,48,49,50,51, - 61, - 18,19,20,2,23,24,33,32,36,37,34,38,68,44,45,47,73,54, - 20,68, - 16,64, - 13,0,23,24,25, - 61, - 57,61,66,70, - 23, - 19, - 57,66, - 66, - 8,70, - 54, - 13,16,18,8,57,33,60,34,66,45,47,53, - 66, - 13,19,6,8,60, - 6,8,70, - 5,12,67, - 70, - 57, - 57, - 16,20,2,60,66,45, - 69, - 19,23,25,8,38,54, - 17,29,39, - 57,61,66,70, - 25, - 5, - 13,19,23,60,64, - 0,19,21,23,26,28,49, - 43,53, - 13,19,8,33,60,64,54, - 53, - 11,61,67,41,46,70,53,54, - 61,70, - 61,70, - 0, - 16, - 13,18,8,12,57,60,61,66,70,54, - 14,23,24, - 13,0, - 61, - 63,64, - 68,70, - 19,43, - 3,4,25,55,56,43,51, - 61,63,69, - 43, - 20, - 68, - 54, - 54, - 68, - 0, - 3, - 0,53, - 19, - 61,51, - 43,70, - 16,3,4,55,56,60,66,43,70, - 0,12,45,51, - 61,42, - 14,64, - 64, - 13,25,64,43,45, - 17,1,19,21,23,6,24,7,26,8,27,28,30,11,12,57,31,59,35,63,64,66,39,40,67,41,42,68,43,69,45,46,70,48,49,50,51,52,72, - 61, - 69, - 66,70, - 66,70, - 1,37, - 25, - 0,17,1,22,23,24,25,9,30,65,39,40,68,52, - 8,11,33,61,63,37,64,67,69, - 20,24,12,64,45, - 17,1,18,20,2,21,5,23,24,7,25,26,9,27,28,30,11,12,31,32,36,64,38,39,40,67,41,68,43,44,45,46,47,48,49,50,51,52,73,53,54, - 14, - 64, - 16,20,2,33,47, - 13,18,32,36, - 39, - 17,23,6,8,28,12,64,52, - 61, - 25,63,39,50, - 12,45,53, - 12, - 45, - 45, - 61, - 25,64, - 0,19,21,6,28,61,37,38, - 16, - 14, - 25,63,66,43,53, - 17,63,68,48, - 13,23,64, - 17,1,18,20,2,21,22,7,25,26,9,27,28,10,29,11,12,31,32,35,36,64,39,40,67,41,42,68,43,44,46,47,48,49,50,73,54, - 20,26,33,34,49, - 12,70, - 70, - 61, - 62, - 62,68, - 0,17,1,18,20,2,21,5,22,23,24,7,25,26,9,27,28,29,30,11,12,31,32,36,64,65,38,39,40,67,42,68,43,44,45,47,49,50,51,52,73,53,54, - 0,5, - 14,20,9,12,61,43, - 61,43, - 19,7,63, - 59, - 12,59,35, - 16,0,18,20,2,25,32,36,44,47,73,53,54, - 10,32,65,68, - 57,61,66,70, - 27,68,50, - 66, - 19,43, - 59, - 1,12, - 60,42, - 13,14,15,16,0,19,2,29,33,34,44, - 66, - 0,19,23,6,8,57,61,64,66,43,69,70,72, - 23,24,8,61, - 69, - 37, - 13,25, - 21,26,30,39,45,49,51, - 25, - 13,37,43,70, - 20, - 19,26,45, - 14,16,3,4,60,66, - 64, - 20,23, - 14,20,2,43, - 16,1,18,19,20,3,4,22,23,24,25,12,55,56,57,33,32,36,34,47, - 52, - 19, - 15,19,22,23,6,24,38, - 19,23,6,24, - 14,15,21,23,24,25,26,12,31,33,64,45,49, - 9,53, - 45, - 14,43, - 49, - 16,0,18,20,2,3,4,26,55,56,58,32,60,36,66,44,47,49,73,54, - 45, - 19,7, - 7, - 14,17,28,64,53, - 70, - 41,68,46,70,48, - 1,54, - 26,12,45,54, - 14,16,31,64,66,68,43,48, - 61, - 61, - 61, - 69, - 14,17, - 43, - 64, - 23, - 12, - 14,0,17,1,19,5,23,6,24,25,8,30,57,35,60,61,63,37,64,66,38,41,68,69,46,70,48,51,72,54, - 57,66, - 66, - 66, - 61, - 57,66, - 57,66, - 57,61,66, - 66, - 66, - 57,61,66,69, - 61, - 61, - 66, - 66, - 57,66, - 61,66, - 57,66, - 66, - 66, - 70, - 70, - 66, - 66, - 66, - 66, - 14,37,64,38,62,69,51, - 60,68, - 18,20,2,25,26,57,58,32,36,66,68,44,47,49,73,54, - 0,5,54, - 15, - 21,23,26,63,38,68,43,49, - 14,19,12,61, - 19,12, - 63, - 19,6,26,8,57,61,51, - 57, - 8,69, - 8,69, - 19, - 62, - 61, - 14, - 6,61,62, - 0,23,12,57,63,65,68,71,53, - 14,15,1,19,20,5,23,6,24,25,8,12,61,63,37,64,62,43,69,70,53, - 14,16,19,21,22,25,26,60,38,39,49, - 0,19,6,12,33,63,34, - 13,19,8,60, - 8, - 53, - 20,5, - 9,56,61,39,68, - 61, - 39,50, - 19, - 13,14,23,33,34, - 14,15,64, - 64, - 35, - 42, - 14,16,60,62, - 13,15,0, - 63, - 35, - 61, - 69, - 26,27,61,47, - 17,1,19,21,23,24,7,26,27,28,30,11,12,31,59,35,64,39,40,67,41,43,45,46,48,49,50,51, - 20, - 1,63, - 19, - 12,43, - 13,17,25,12,38,68,43, - 12, - 14,2,23,11,63,67,52, - 14,6,57,61,66,43,45,70, - 12,64,54, - 61,70, - 11,67, - 14,15, - 28, - 16,0,1,18,20,2,3,21,23,24,25,26,28,10,29,55,32,36,65,44,45,47,49,52,73,53,54, - 19,5,64,53,54, - 25, - 45, - 19, - 19, - 17, - 70, - 62, - 57,61,66,70, - 64, - 14,23,12,61,37,53, - 1, - 53, - 61, - 53, - 53, - 0,53, - 12, - 61, - 61, - 20,23,24,26,12,63,64,43,49, - 8, - 8, - 61, - 22, - 62, - 13,14,15,16,0,17,1,19,20,3,4,22,23,6,25,26,8,27,28,10,12,55,56,57,58,33,32,60,61,63,37,64,66,68,43,45,70,49,50,72,54, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 70, - 70, - 6,8, - 6,9,30,57,35,38, - 62,69, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 49, - 64,43, - 13,14,15,16,0,17,1,18,19,20,2,4,21,22,7,25,26,8,9,27,28,29,30,11,12,56,57,33,32,59,60,36,61,63,37,34,64,66,39,40,67,41,68,43,44,45,46,47,70,48,49,51,52,73,54, - 6,8,61,64, - 61, - 68, - 24, - 64, - 13,19,8,60,37,68,43,48, - 43, - 25,27,28,31,50, - 14,15, - 14,0,10,68, - 19,33,64,68,43,45, - 19, - 20, - 0, - 61, - 16,2,26,49, - 23,33,63, - 64, - 54, - 23, - 69, - 12, - 14,2,23,6,25,12,64,62,69,51, - 19, - 45, - 43,53, - 13,21,25,26,30,64,68,49, - 23, - 61, - 19, - 0,6,31,60,53, - 31, - 6, - 53,54, - 12, - 19, - 5, - 11,12,61,67, - 11,12,61,70, - 61, - 70, - 61, - 8, - 19,8, - 61, - 61, - 61, - 61, - 61, - 13,14,15,0,17,19,2,3,22,23,6,24,25,8,10,12,55,57,33,60,61,63,37,64,66,68,43,69,70,52,72,54, - 61, - 61, - 8,70, - 70, - 66, - 70, - 70, - 61, - 19,26, - 62, - 61, - 43, - 12, - 45, - 25, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 17,1,21,25,27,28,40,68,43,45,49,50, - 43, - 6,31,64,68, - 66,40,43, - 21,25,26,68,49, - 25,68, - 19,63, - 31,64,43, - 70, - 62, - 19,63, - 1,19,23,6,12,57,61,37,64,43, - 70, - 70, - 70, - 70, - 53, - 61, - 14,6,8,45, - 64, - 23,24, - 13,14,15,17,1,2,21,23,24,7,25,26,27,28,29,30,11,12,35,61,64,39,40,67,41,43,45,46,48,49,50,51,52, - 53, - 1,27,30,64,43, - 0,31,60,53, - 19,20,2, - 14,20,54, - 61, - 53, - 14,16,55,56,60,66,43,45,70, - 14,62, - 53, - 23,7,31,59,35,43,53, - 69, - 19, - 24, - 53, - 61,66, - 13,14,16,19,23,60,37,64, - 6,11,64,67,69, - 14,60, - 14,16,8, - 13,14,15,19,23,24,25,33,60,34,64,38,41,45,46,48,52, - 24,7,25,57,61,69,45, - 6,8,57,61,66,69,70,72, - 0,5,23,8,12,57,64,52, - 66, - 6,8, - 57,66, - 61, - 57, - 6,61,66,70,72, - 61,66,70, - 62, - 61, - 62, - 68,52, - 19,33,61,43, - 8,53, - 66, - 6,45, - 64, - 53, - 0, - 19,53, - 20,2, - 25,12, - 21,22,25,26,9,30,12,57,35,60,61,66,68,69,45,48,49,51,52, - 69, - 51, - 51, - 51, - 51, - 51, - 61, - 61, - 70, - 61, - 63, - 54, - 20,54, - 5, - 61, - 61, - 20,33,37,64, - 61, - 69,54, - 12, - 16, - 64, - 64, - 8, - 15,6,8, - 23, - 8, - 14,15,17,2,8,61,34,72, - 61, - 0,53, - 14, - 3,4,21,25,26,55,56,49, - 20, - 56,61, - 64, - 63, - 15,12,63,38, - 24, - 6, - 61, - 6, - 6, - 6, - 13,0,19,23,6,24,8,33,60,61,63,37,38, - 13,19,23,6,8,33,61,37,34,38,69, - 15,20,23,26,12,57,61,63,64,66,43,49, - 30,39,42, - 0,19,21,25,26,27,28,29,11,12,57,61,67,43,45,49,50, - 70, - 8, - 70, - 6,66, - 12, - 6,57,61,66,70, - 61, - 61, - 70, - 70, - 14,17,5,23,6,24,7,8,11,12,57,33,61,63,37,64,66,38,39,67,68,43,45,49,53, - 61, - 0,12,53, - 14, - 6,8,57,31,60,61,66,69,70,72, - 31, - 61, - 14,52, - 6,8, - 25,64, - 64, - 54, - 0,52,72, - 14,0,6,7,30,52,72, - 61, - 12,61,68,46,51, - 1,19, - 20, - 68,43, - 6,37,64, - 62, - 9, - 25, - 43, - 14, - 6,57,61,66,69,70, - 43, - 64, - 64,51, - 57, - 57,64,51, - 13,25,37, - 60,69, - 14,27,61, - 61, - 27,61, - 71, - 8, - 61, - 64, - 64, - 53, - 8,70, - 17,1,21,22,7,26,27,28,30,11,12,31,35,64,40,67,41,43,45,46,48,49,50,51, - 12,45, - 45, - 61, - 15,57,66, - 44, - 0,53, - 0,53, - 1,64,39, - 15,19,20, - 12,45,46, - 64, - 26, - 64, - 61, - 54, - 53, - 45, - 1,19,12,37,43, - 70, - 70, - 70, - 70, - 11,64,67, - 62, - 52, - 64,45, - 23,9, - 0,12,64,53, - 57,61,66, - 13,16,19,20,6,8,58,33,32,60,66,43,53,54, - 66, - 8,69,70, - 68,43,45, - 13,17,63, - 25,68, - 61, - 17,2,29,43, - 64,43,45, - 14,1,19,11,37,64,67,44, - 12,63, - 43, - 0,17,21,25,26,9,12,68,49, - 19, - 53, - 64,68, - 61, - 6,24,8,60,37, - 8,69, - 64,43, - 19,28,31,45, - 26,45,53, - 20, - 29,12,64,68, - 14,19,63, - 64, - 21,26,9,12,37,64,68,49,51, - 8,70, - 61, - 6,57,66,69,70,72, - 6,8,61, - 61,70, - 66,70, - 69, - 69, - 8, - 8,61, - 8,70, - 69, - 66, - 61, - 61, - 61, - 61, - 66, - 8, - 66, - 8,70, - 69, - 6,8,61,69,70, - 8,70, - 13,17, - 25,63,64, - 15,33,61,64, - 53, - 12, - 61,70, - 13,8,33,60,63,34,45, - 61, - 6,8,61,66,72, - 6,8,69,72, - 19,8,33,63,34,44,45,52, - 61, - 14,63, - 14, - 54, - 7, - 26,49, - 15,8, - 17,1,19,21,5,22,23,24,7,25,26,9,27,28,29,30,11,12,31,35,37,64,39,40,67,41,42,68,43,45,46,48,49,50,51,52, - 59,35,43,70, - 70, - 70, - 13,14,15,16,0,17,1,18,19,20,2,3,4,21,5,22,23,6,24,7,25,26,8,9,27,28,29,30,11,12,55,56,57,31,33,32,59,35,60,36,61,63,37,34,64,65,66,38,39,40,67,41,42,62,68,43,44,69,45,46,47,70,48,49,50,51,52,72,73,53,54, - 23,61, - 61, - 66, - 66, - 66, - 66, - 61, - 61, - 61, - 6,72, - 61, - 6, - 57,61,66,45,70, - 1,12,37, - 66, - 16,19,26,60,36,63,66,43,49, - 70, - 70, - 0,19,65, - 14,60, - 14,17,1,21,7,26,27,28,30,11,12,35,60,64,39,40,67,41,43,45,46,48,49,50, - 21,26,30,61,49, - 14,15,1,19,6,25,60,61,42,69,53, - 57,61,66,70, - 0,25,53, - 28,61, - 61, - 63, - 16,3,4,60,66, - 66, - 23,12,64,68,43, - 66, - 66, - 66, - 61, - 64,43, - 61, - 61, - 61, - 61, - 61, - 8, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 23,6,24,25,30,57,31,61,63,62,68,69,51,53, - 57,61,63,66, - 66, - 61, - 61, - 61, - 61, - 6,70,72, - 6,72, - 72, - 6,70,72, - 72, - 72, - 72, - 72, - 70,72, - 72, - 70,72, - 6,70,72, - 61, - 61, - 61, - 23, - 17, - 19, - 27,50, - 15,6,8,63,62,69,72, - 8, - 0,5,23,24,25,28,61,64,38,68,51, - 61, - 19,57,61,64,66,70, - 61, - 61, - 61, - 61, - 61, - 62, - 14,0,17,1,18,19,20,21,22,6,7,25,28,29,11,12,33,35,60,61,63,64,65,66,39,40,67,68,43,44,45,47,70,52,72,54, - 64,45, - 61, - 70, - 70, - 70, - 70, - 61, - 23, - 62, - 46,54, - 20, - 17,20,23,25,9,12, - 25, - 14, - 5,23, - 61, - 13,14,1,19,6,25,8,11,33,60,63,64,67,43,45,70,52,72,53, - 0,1,29,12, - 6,8,57,61,66,70,72, - 26, - 13, - 61, - 43, - 62, - 13,15,0,17,1,19,5,22,23,24,7,25,26,9,30,31,33,61,63,34,64,65,38,39,40,41,48,49,52,73,53, - 61, - 25, - 17,66, - 53, - 17,1,21,5,7,26,9,27,28,30,11,12,31,61,39,40,67,43,45,49,50,51, - 57,61,66,70, - 14,1,19,23,6,24,26,8,9,27,11,12,55,56,59,61,37,64,66,38,39,67,68,43,45,46,48,49,51, - 49, - 37,64, - 20, - 71, - 66, - 13, - 15,17,18,19,20,2,3,4,21,24,25,26,9,27,28,30,11,12,55,56,31,58,33,32,59,35,60,36,37,34,64,38,39,40,67,41,43,44,45,46,47,48,49,50,51,73,54, - 13,5,6,26,8,33,37,43,44, - 63, - 14,0,19,46,48, - 23,12, - 14,21,63,64, - 1,37, - 53, - 21,5,26,61,49, - 54, - 49, - 23,33, - 23, - 53, - 56, - 64, - 14, - 6,8, - 6,57,61,66,62,69,70, - 15,25,30, - 19, - 53, - 14,19,2,68,43, - 13,0,5,8,12,63,41,43,53, - 14,64, - 24, - 61,43,45,53, - 14, - 6,57,61,66, - 12,61,68,70, - 61, - 61, - 61,64, - 64, - 61, - 2, - 63, - 60,61,40,43,46,51, - 20, - 61,70, - 3,25,12,55,56,59, - 69, - 7,43,53, - 5,66,46,54, - 61,54, - 25,42, - 9,12, - 19, - 11,67, - 0,53, - 14,1,19,12,61,37,64,67,41,43,46,70,48,53,54, - 61,70, - 17,61,72, - 61, - 17,61, - 17,61,72, - 12, - 9,29, - 14,64,53, - 63,37, - 68, - 13,2,25,63,64, - 53, - 68, - 17, - 13,33,60,65, - 68, - 25, - 17,1,12,39,53, - 14,0,63,51, - 16,0,53, - 64, - 13, - 17,5,26,64,68, - 19,12,49, - 24,25,60,64, - 12, - 6,8,57,61,66,70,72, - 6, - 72, - 53, - 6,8, - 23,9, - 45, - 12,38, - 45, - 14,7,11,61,67,45, - 54, - 23, - 19, - 64, - 64,54, - 19, - 6,8,37, - 13,6,8,37,70, - 53, - 63, - 0,17,26,57,61,66,69,70, - 27, - 69, - 69, - 45, - 8, - 8,70, - 70, - 8,70, - 70, - 72, - 15, - 6,62,69,52, - 8,70, - 70, - 61, - 2, - 20,2, - 54, - 61, - 61, - 61, - 61, - 61, - 61, - 61, - 6,57, - 13,14,15,17,18,20,2,6,26,8,27,11,12,57,33,32,60,36,61,63,67,44,70,72, - 15,6,8,33,37, - 13,1,7,63,37, - 61, - 16,0,18,19,20,2,3,4,26,55,56,58,32,60,36,66,44,47,49,73,54, - 13, - 61, - 21,25,26,41,43,46,49, - 20,61,63, - 63, - 69, - 69, - 19,25,57,61,63,66, - 63, - 16,20,2,60,66,45,47,54, - 23, - 0, - 56, - 0,53, - 45, - 45, - 64, - 14,16,23,24, - 13, - 64,44,73, - 61, - 0, - 20,6,8,63,62, - 61, - 42, - 14, - 14, - 53, - 21,6,25,26,9,30,12,57,61,66,39,68,49, - 60, - 61,66, - 6, - 61, - 61,40, - 61,40, - 61, - 21,61, - 43, - 13,14,19,2,65,47,53, - 14, - 27,28,63,50, - 61, - 53, - 53, - 12, - 1, - 64,43, - 53, - 14, - 13,17,12,57,66,45,51, - 6,8, - 14, - 58,61, - 20, - 1,64, - 21, - 11,61,67, - 61,67, - 0,22,9,28,29,12,65, - 11,12,61,67,41,70,53, - 70, - 5,67,41,70,53, - 61, - 13, - 61, - 19,37,43, - 42, - 25,8,57,60,61,66,42,62,70, - 14,0,19,20,2,23,24,8,12,37,38,68,43,51, - 15,17,18,19,20,2,3,4,21,23,24,25,26,27,28,30,11,12,55,56,31,58,33,32,59,35,36,37,34,64,38,39,40,67,41,43,44,45,46,47,48,49,50,51,73,54, - 68, - 19,53, - 16, - 53, - 15,17,18,19,20,2,3,4,21,23,6,24,25,26,27,28,30,11,12,55,56,57,31,58,33,32,59,35,36,61,37,34,64,66,38,39,40,67,41,43,44,45,46,47,70,48,49,50,51,52,73,54, - 15,17,18,19,20,2,3,4,21,5,6,24,7,25,26,27,28,30,11,12,55,56,31,58,33,32,59,35,36,37,34,64,38,39,40,67,41,43,44,69,45,46,47,48,49,50,51,73,53,54, - 64, - 31,68, - 17,61,63,43, - 70, - 70, - 70, - 0,5,23,64,69, - 63, - 13,19,6,8,57,33,60,61,63,66,69,70,72, - 13,0,17,1,19,21,22,23,6,24,7,25,26,9,27,28,30,11,12,31,35,61,63,37,64,65,39,40,67,41,42,68,43,45,46,48,49,50,51,52,53, - 59, - 17,1,21,25,26,9,68,49, - 14, - 47, - 43, - 14,15,17,19,21,5,23,25,8,28,12,33,60,61,63,34,64,65,68,43,45,71,49, - 57,66, - 6, - 66, - 61,62,69, - 61, - 57,66, - 57,66, - 23, - 12,61, - 12,43,70, - 70, - 70, - 70, - 70, - 57,61,66,70, - 0,65,71, - 21,27,28,35,64,67,41,46,48,49,50, - 13,14,12,61,64,45, - 61, - 61, - 6,8,57,61,66,69,70, - 66, - 17,1,26,39,45, - 54, - 19,7,25,11,12,64,67,41,68,43,45,51, - 19,5,12,68,53, - 16,45, - 65, - 6,8,36,63,43,44,70, - 23,37, - 14,17,12,64, - 20,2, - 61, - 61, - 61, - 12,61, - 0,63,69,45, - 20,2, - 8, - 8, - 8, - 8, - 16,26,60,66,44,49, - 66, - 71, - 53, - 6,8,57,61,66,62,43,69,70,72, - 57,61,66,70, - 66, - 61,70, - 57, - 61, - 61,45, - 61, - 64, - 13,19,20,12,61,64,43,47, - 8,60, - 17, - 6, - 21,25,26,49, - 68, - 14,64,41,48, - 19,3,64,39,43,45, - 22,68, - 17,1,26,11,12,64,39,67,41,68,45,46,48,51, - 19,20,23, - 15,19,2,5,63,43, - 61, - 25,57,68, - 0,7,31,69,52, - 13,19,5,8,12,60,42,43,48, - 8, - 62, - 61, - 11,67, - 64,68, - 62, - 1,8,12,61,37, - 53, - 53, - 23,24,61,62, - 8,57,68,69, - 53, - 6, - 6,8,12,31,35,64,41,43,46,48, - 17,10,39,40, - 13,21,22,6,24,25,26,11,12,38,67,45,48,49,52, - 6,8,57,61,66,70, - 69, - 61, - 6,57, - 6, - 8, - 2, - 37, - 26, - 14,20,2,11,12,64,67,43, - 14,45, - 11,67, - 1, - 46,70, - 46,70, - 68, - 14,19,2,23,57,61,37,64,65,66,70,53, - 61, - 1,19, - 20,49, - 13,22,25,8,64, - 16,25,60,66,47, - 66, - 45, - 6,8,69,72, - 15,8,63,69, - 23, - 8, - 14,15,17,2,6,8,61,34,69,72, - 8, - 64,43, - 13,17,1,19,2,25,9,10,11,12,35,63,39,67,43,45,53, - 6, - 12, - 26,49, - 14,1,20,61,63,37,43,46, - 68, - 53, - 0, - 6, - 33, - 17,68,48, - 35,67,68,70, - 68,51, - 20,2,21,23,24,7,26,27,28,30,11,12,32,64,39,40,67,42,44,45,47,49,50,52,73,53,54, - 61, - 14,43, - 14, - 7, - 52, - 45, - 28,70, - 35,41,43,46,48, - 70,48, - 70, - 70,48, - 0,71, - 71, - 7, - 70, - 6,8,66,70, - 8, - 14,15,17,1,18,20,6,8,27,11,33,32,59,36,61,63,66,67,44,69,47,70,49,50,72,53, - 15,33, - 8, - 53, - 61, - 69, - 23,63, - 8,61, - 15,17,18,19,20,2,3,4,21,23,24,25,26,27,28,30,11,12,55,56,31,58,33,32,59,35,36,37,34,64,38,39,40,67,41,43,44,45,46,47,48,49,50,51,52,73,54, - 62, - 14,17,5,25,26,8,27,12,57,36,61,63,64,66,43,47,70,48,50,51,52, - 14,17,19,20,2,22,23,25,11,12,39,67,68,43,52, - 45, - 14,43, - 68, - 38, - 45, - 57,49,50,51, - 57, - 69, - 61,43,49,50,51, - 37, - 31, - 19,9,29, - 0,6,57,61,66,42,45,70, - 57,61,66,70, - 68, - 14,15,19,3,5,23,24,25,11,12,57,33,35,61,63,64,66,67,68,43,45,70,71,51,53, - 16,6,57,61,66,69,70, - 0,17,25,12,63, - 43,45, - 14, - 13,16,19,20,2,23,6,12,58,36,37,38,68,44,69, - 20, - 62, - 0, - 17, - 11,12,61,67,41,46,70,48,54, - 7, - 57,61,66,70, - 61, - 14,64, - 61, - 61,64, - 17,12,63, - 68,52,53, - 7, - 61, - 0,17,1,18,20,2,21,5,25,26,9,27,28,29,11,12,32,36,39,40,67,68,43,44,45,47,49,50,52,72,73,53,54, - 53, - 16, - 53, - 2, - 13,14,15,16,17,2,22,6,25,8,10,12,60,61,34,66,68,70,52,72,73, - 66, - 0,53, - 8,70, - 66, - 64, - 16,26,60,66,49,54, - 14,17,23,24,25,12,64,38,51, - 45, - 64, - 68, - 39, - 12,55, - 2,11,12,67,68,45,48, - 21,25,26,37,49, - 13,14,0,17,1,18,19,20,2,21,22,23,6,24,7,25,26,9,28,29,30,11,12,57,31,33,32,59,36,61,63,37,34,64,66,39,40,67,42,68,43,44,45,47,70,71,49,51,52,73,54, - 5, - 15,8,12,33,61,63,70, - 61, - 61, - 61, - 61, - 0,65, - 23,7,9,31,53, - 19,64,43, - 1,12,66, - 19, - 1,12,63, - 20, - 17,43, - 57,61,66,70, - 8, - 14,5,54, - 61, - 14,5, - 61, - 13,14,16,0,17,1,18,19,20,2,21,5,22,23,24,25,28,29,30,31,33,32,35,36,34,64,65,38,39,40,41,68,44,45,46,47,48,52,73,54, - 14,5, - 61, - 64, - 53, - - + + + 72, + 14,19,5,6,25,8,12,57,61,63,68,43,72,73,75, + 68, + 73, + 14, + 17,1,18,19,20,2,21,23,6,7,26,8,27,28,29,30,11,12,57,31,32,35,36,61,64,68,39,40,70,62,43,44,72,45,47,73,49,50,51,76,54, + 6,8,12,57,31,61,72,73,75, + 6,8,57,68,72,73, + 73, + 61, + 73, + 61,73, + 61, + 61, + 61,68,73, + 8,61,73, + 61, + 61, + 13,14,15,16,19,23,6,8,11,12,60,61,63,37,67,68,69,70,72, + 61,68, + 17,1,18,20,2,21,23,6,7,26,8,27,28,29,30,11,12,31,32,36,61,64,68,39,40,70,62,43,44,45,47,73,49,50,51,76,54, + 6,8,57,61,68,72,73,75, + 6,8,61,72, + 61,73, + 61,73, + 73, + 61, + 61, + 61, + 73, + 61, + 13,14,15,16,18,20,4,23,6,8,11,12,57,33,32,60,36,63,64,66,67,68,69,70,43,72,73,54, + 14,18,20,21,23,6,7,26,8,27,28,11,12,57,31,61,63,64,68,39,40,70,62,43,44,72,45,73,49,50,75,54, + 8,61,63,73, + 6, + 61, + 61, + 61, + 61, + 57,68, + 61, + 61,68,73, + 61, + 13,14,15,16,0,17,1,20,2,21,23,6,25,26,8,9,27,28,29,11,12,60,63,34,66,67,68,69,39,40,70,43,72,45,49,50,76,53, + 68, + 14, + 61, + 14,18,20,23,6,26,8,28,12,31,61,64,68,62,43,44,47,73,54, + 57,61,72, + 61, + 61, + 12,61,73, + 61, + 61, + 61, + 5,6,8,61,68,73, + 8,61,73, + 61, + 61, + 73, + 14, + 2,6,8,57,61,73, + 57,61,72, + 61, + 73, + 6,8,57,61,68, + 8,61,73, + 73, + 73, + 61, + 57,61,68,73, + 61,72, + 6, + 61, + 61, + 61, + 73, + 61,73, + 73, + 6,75, + 73, + 73, + 68, + 25, + 61, + 61, + 61, + 61, + 17,1,53, + 68, + 68, + 61,45, + 51, + 74, + 19, + 0,71,53, + 16,18,19,20,2,32,36,64,44,45,47,76,54, + 13,64, + 73, + 63,37, + 17,1,21,7,25,26,57,61,49,51, + 17,1,21,23,25,26,8,30,12,57,61,68,71,72,49, + 61, + 61, + 26,60,61, + 13,14,23,8,37,64,42,71,45, + 61, + 57, + 61, + 61, + 6,8,57,61,68,72,73,75, + 6,8,57,61, + 61, + 28,36,63,37,39,43,49, + 45, + 37, + 0,52, + 57,68, + 68, + 57, + 57,68, + 57, + 57, + 57, + 57, + 57, + 57, + 68, + 57, + 68, + 57, + 57, + 19, + 61, + 67, + 8,61,68,73, + 6,8,73, + 6,8,57,61,72,73,75, + 6,8,61,72,73,75, + 6,8,72,75, + 13,14,15,16,0,18,23,6,24,8,12,33,60,63,34,64,66,67,69,38,43, + 13,0,1,19,21,24,7,25,26,31,33,59,35,60,63,37,64,67,41,43,45,46,48,49,51,53, + 11,12,61,64,45,53, + 67, + 23, + 0,1, + 45, + 6, + 3, + 19, + 16,5,26,12,60,36,61,68,70,41,44,73,49,54, + 73, + 61, + 12, + 57,68, + 15,37,67, + 14,1,23,25,28,12,57,64,69,45, + 15,17,1,18,20,2,21,5,23,7,25,26,8,9,27,28,30,11,12,32,59,60,36,61,64,67,38,39,40,70,43,44,45,46,47,49,50,51,76,54, + 72, + 23, + 0,17,1,21,23,24,7,26,27,28,30,11,12,35,64,67,39,40,70,41,46,48,49,50,51, + 61, + 18,19,20,2,23,24,33,32,36,34,37,69,38,71,44,45,47,76,54, + 20,71, + 16,64, + 13,0,23,24,25, + 61, + 23, + 19, + 68, + 8,73, + 54, + 13,16,18,8,57,33,60,34,68,45,47,53, + 68, + 13,19,6,8,60, + 6,8,73, + 5,12,70,53, + 73, + 57, + 57, + 16,20,2,60,68,45, + 72, + 19,23,25,8,38,54, + 17,29,39, + 25, + 5, + 13,19,23,60,64, + 0,19,21,23,26,28,49, + 43,53, + 13,19,8,33,60,64,54, + 53, + 11,61,70,41,46,73,53,54, + 61,73, + 61,73, + 0, + 16, + 13,18,8,12,60,54, + 14,23,24, + 13,15,0, + 61, + 67, + 63,64, + 71,73, + 19,43, + 3,4,25,55,56,67,43,51, + 61,63,72, + 43, + 20, + 71, + 54, + 54, + 71, + 0, + 3, + 0,53, + 19, + 61,51, + 43,73, + 16,3,4,55,56,60,68,43,73, + 0,12,69,45,51, + 61,42, + 14,64,53, + 64, + 13,25,64,43,45, + 17,1,19,21,23,6,24,7,26,8,27,28,30,11,12,57,31,59,35,63,64,67,68,39,40,70,41,42,71,43,72,45,46,73,48,49,50,51,52,75,53, + 61, + 72, + 68,73, + 68,73, + 1,37, + 25, + 0,17,1,22,23,24,25,9,30,65,39,40,71,52, + 8,11,33,61,63,37,64,66,70,72, + 20,24,12,64,45, + 17,1,18,20,2,21,5,23,24,7,25,26,9,27,28,30,11,12,31,32,36,64,67,38,39,40,70,41,71,43,44,45,46,47,48,49,50,51,52,76,53,54, + 14, + 64, + 16,20,2,33,47, + 13,18,32,36, + 39, + 17,23,6,8,28,12,64,52, + 15, + 61, + 25,63,39,50, + 12,45,53, + 12, + 45, + 45, + 61, + 25,64, + 0,19,21,6,28,61,37,38,53, + 16, + 14, + 25,63,43,53, + 17,63,71,48, + 13,23,64, + 17,1,18,20,2,21,22,7,25,26,9,27,28,10,29,11,12,31,32,35,36,64,39,40,70,41,42,71,43,44,46,47,48,49,50,76,53,54, + 20,26,33,34,49, + 12,73, + 73, + 61, + 62, + 62,71, + 0,17,1,18,20,2,21,5,22,23,24,7,25,26,9,27,28,29,30,11,12,31,32,36,64,65,67,38,39,40,70,42,71,43,44,45,47,49,50,51,52,76,53,54, + 0,5, + 14,20,9,12,61,43, + 61,43, + 19,7,63, + 59, + 12,59,35, + 16,0,18,20,2,25,32,36,44,47,76,53,54, + 10,32,65,71, + 27,71,50, + 68, + 19,43, + 59, + 1,12, + 60,42, + 13,14,15,16,0,19,2,29,33,34,69,44, + 68, + 0,19,23,6,8,57,61,64,68,43,72,73,75, + 23,24,8,61, + 72, + 37, + 69, + 13,25, + 21,26,30,39,45,49,51, + 25, + 13,37,43,73, + 20, + 19,26,66,45, + 14,16,3,4,60,68, + 64, + 20,23, + 14,20,2,43, + 16,1,18,19,20,3,4,22,23,24,25,12,55,56,57,33,32,36,34,69,47, + 52, + 19, + 15,19,22,23,6,24,38, + 19,23,6,24, + 14,15,21,23,24,25,26,12,31,33,64,45,49, + 9,53, + 45, + 14,43, + 49, + 16,0,18,20,2,3,4,26,55,56,58,32,60,36,68,44,47,49,76,54, + 45, + 19,7, + 7, + 14,17,28,64,53, + 41,71,46,73,48, + 1,54, + 26,12,45,54, + 14,16,31,64,68,71,43,48, + 61, + 61, + 61, + 72, + 14,17,67, + 43, + 64, + 23, + 12, + 14,0,17,1,19,5,23,6,24,25,8,30,57,35,60,61,63,37,64,67,68,38,41,71,72,46,73,48,51,75,54, + 57,68, + 68, + 57,61,68,72, + 73, + 73, + 14,37,64,38,62,72,51, + 60,71, + 18,20,2,25,26,57,58,32,36,68,71,44,47,49,76,54, + 0,5,54, + 15, + 21,23,26,63,67,38,71,43,49, + 14,19,12,61, + 19,12, + 63, + 19,6,26,8,57,61,51, + 57, + 8,72, + 8,72, + 19, + 62, + 61, + 31, + 14, + 6,61,62, + 0,23,12,57,63,65,71,74,53, + 14,15,1,19,20,5,23,6,24,25,8,12,61,63,37,64,66,67,62,43,72,73,53, + 14,16,19,21,22,25,26,60,38,39,49, + 0,19,6,12,33,63,34, + 13,19,8,60, + 8, + 53, + 20,5, + 9,56,61,39,71, + 61, + 39,50, + 19, + 13,14,23,33,34, + 14,15,64, + 64, + 35, + 42, + 14,16,60,62, + 13,15,0, + 63, + 35, + 61, + 72, + 26,27,61,47, + 17,1,19,21,23,24,7,26,27,28,30,11,12,31,59,35,64,67,39,40,70,41,43,45,46,48,49,50,51, + 20, + 1,63, + 19, + 12,43, + 13,17,25,12,67,38,71,43, + 12, + 14,2,23,11,63,70,52, + 14,6,43,45, + 12,64,54, + 61,73, + 11,70, + 14,15, + 28, + 16,0,1,18,20,2,3,21,23,24,25,26,28,10,29,55,32,36,65,44,45,47,49,52,76,53,54, + 19,5,64,53,54, + 25, + 45, + 19,69, + 19, + 17, + 73, + 62, + 64, + 14,23,12,61,37,67,53, + 1, + 53, + 61, + 53, + 53, + 0,53, + 12, + 61, + 61, + 20,23,24,26,12,63,64,66,69,43,49, + 8, + 8, + 61, + 22, + 62, + 13,14,15,16,0,17,1,19,20,3,4,22,23,6,25,26,8,27,28,10,12,55,56,57,58,33,32,60,61,63,37,64,66,67,68,71,43,45,73,49,50,75,54, + 61, + 61, + 61, + 61, + 61, + 61, + 61, + 73, + 73, + 6,8, + 6,9,30,57,35,38, + 62,72, + 61, + 61, + 61, + 61, + 61, + 61, + 61, + 49, + 64,66,43, + 13,14,15,16,0,17,1,18,19,20,2,4,21,22,7,25,26,8,9,27,28,29,30,11,12,56,57,33,32,59,60,36,61,63,34,37,64,66,68,39,40,70,41,71,43,44,45,46,47,73,48,49,51,52,76,54, + 6,8,61,64, + 61, + 71, + 24, + 64, + 13,19,8,60,37,71,43,48, + 43, + 25,27,28,31,50, + 14,15, + 14,0,10,71, + 19,33,64,71,43,45, + 19, + 20, + 0, + 61, + 16,2,26,49, + 23,33,63, + 64, + 54, + 23, + 72, + 12, + 14,2,23,6,25,12,64,62,72,51, + 19, + 45, + 43,53, + 13,21,25,26,30,64,71,49, + 23, + 61, + 19, + 0,6,31,60,53, + 31, + 6, + 53,54, + 12, + 19, + 5, + 11,12,61,70, + 11,12,61,73, + 61,73, + 61, + 8, + 19,8, + 61, + 61, + 61, + 61, + 61, + 13,14,15,0,17,19,2,3,22,23,6,24,25,8,10,12,55,57,33,60,61,63,37,64,66,67,68,71,43,72,73,52,75,54, + 61, + 61, + 8,73, + 73, + 68, + 73, + 73, + 61, + 19,26, + 62, + 61, + 43, + 12, + 45, + 25, + 61, + 61, + 61, + 61, + 61, + 61, + 61, + 61, + 17,1,21,25,27,28,67,40,71,43,45,49,50, + 43, + 6,31,64,71, + 68,69,40,43, + 21,25,26,71,49, + 25,71, + 19,63, + 31,64,43, + 73, + 62, + 19,63, + 1,19,23,6,12,57,61,37,64,67,43, + 73, + 73, + 73, + 73, + 53, + 61, + 14,6,8,45, + 64, + 23,24, + 13,14,17,1,2,21,23,24,7,25,26,27,28,29,30,11,12,35,61,64,67,39,40,70,41,43,45,46,48,49,50,51,52, + 53, + 1,27,30,64,43, + 0,31,60,53, + 19,20,2, + 14,20,54, + 61, + 53, + 14,16,55,56,60,68,43,45,73, + 57,68, + 68, + 68, + 57,68, + 68, + 68, + 68, + 57,68, + 61,68, + 57,68, + 68, + 68, + 68, + 68, + 68, + 68, + 8, + 14,62, + 53, + 23,7,31,59,35,43,53, + 72, + 19, + 24, + 53, + 13,14,16,19,23,60,37,64, + 6,11,64,70,72, + 14,60, + 14,16,8, + 13,14,15,19,23,24,25,33,60,34,64,67,38,41,45,46,48,52, + 24,7,25,57,61,67,72,45, + 6,8,57,61,68,72,73,75, + 0,5,23,8,12,57,64,52, + 6,8, + 61, + 57,68, + 68, + 57,68, + 57, + 6,61, + 62, + 61, + 62, + 71,52, + 19,33,61,43, + 8,53, + 68, + 6,45, + 64, + 53, + 0, + 19,53, + 20,2, + 25,12, + 21,22,25,26,9,30,12,57,35,60,61,68,71,72,45,48,49,51,52, + 72, + 51, + 51, + 51, + 51, + 51, + 57,61, + 61, + 61, + 73, + 61, + 63, + 54, + 20,54, + 5, + 61, + 61, + 20,33,37,64,66, + 61, + 72,54, + 12, + 16, + 64, + 64, + 8, + 15,6,8, + 23, + 8, + 14,15,17,2,8,61,34,66,75, + 61, + 0,53, + 14, + 3,4,21,25,26,55,56,49, + 20, + 56,61, + 64, + 69, + 63, + 15,12,63,38, + 24,61, + 6, + 6, + 6, + 6, + 13,0,19,23,6,24,8,33,60,63,37,69,38, + 13,19,23,6,8,33,61,34,37,38,72, + 15,20,23,26,12,57,31,61,63,64,66,68,69,43,49, + 30,39,42, + 0,19,21,25,26,27,28,29,11,12,57,61,70,43,45,49,50, + 73, + 8, + 73, + 6,68, + 12, + 6, + 61, + 61, + 73, + 73, + 14,17,5,23,6,24,7,8,11,12,57,33,61,63,37,64,67,68,38,39,70,71,43,45,49,53, + 61, + 0,12,53, + 14, + 6,8,57,31,60,61,68,72,73,75, + 31, + 69, + 14,52, + 6,8, + 25,64, + 64, + 67,54, + 0,52,75, + 14,0,6,7,30,69,52,75, + 12,61,71,46,51, + 1,19, + 20, + 71,43, + 6,37,64, + 62, + 9, + 25, + 43, + 14, + 6,72, + 43, + 64,69, + 64,51, + 57, + 57,64,69,51, + 13,25,37, + 60,72, + 14,27,61, + 61, + 27,61, + 74, + 61, + 64, + 64, + 53, + 8,73, + 17,1,21,22,7,26,27,28,30,11,12,31,35,64,40,70,41,43,45,46,48,49,50,51, + 12,45, + 45, + 61, + 15,57,68, + 44, + 0,53, + 0,53, + 1,64,39, + 15,19,20, + 12,45,46, + 64, + 26, + 64, + 61, + 54, + 53, + 45, + 1,19,12,37,43, + 73, + 73, + 73, + 73, + 11,64,70, + 69, + 62, + 52, + 64,45, + 23,9, + 0,12,64,53, + 57,61,68, + 13,16,19,20,6,8,58,33,32,60,68,43,53,54, + 68, + 8,72,73, + 71,43,45, + 13,17,63, + 25,71, + 17,2,29,43, + 64,43,45, + 67, + 14,1,19,11,37,64,70,44, + 12,63, + 43, + 0,17,21,25,26,9,12,67,71,49, + 19, + 53, + 64,71, + 61, + 6,24,8,60,37, + 8,72, + 64,43,53, + 19,28,31,45, + 26,45,53, + 20, + 29,12,64,71, + 14,19,63, + 64, + 21,26,9,12,37,64,71,49,51, + 8,73, + 61, + 6,57,68,72,73,75, + 6,8,61, + 61,73, + 68,73, + 72, + 72, + 8, + 8,61, + 8,73, + 72, + 68, + 57, + 61, + 61, + 61, + 61, + 68, + 8, + 68, + 8,73, + 72, + 6,8,61,72,73, + 8,73, + 13,17, + 25,63,64,53, + 15,33,61,64, + 53, + 12, + 61,73, + 13,8,33,60,63,34,45, + 61, + 6,8,61,68,75, + 6,8,72,75, + 19,8,33,63,34,44,45,52, + 61, + 14,63, + 14, + 54, + 7, + 26,49, + 15,8, + 17,1,19,21,5,22,23,24,7,25,26,9,27,28,29,30,11,12,31,35,37,64,67,39,40,70,41,42,71,43,45,46,48,49,50,51,52, + 59,35,43,73, + 73, + 73, + 13,14,15,16,0,17,1,18,19,20,2,3,4,21,5,22,23,6,24,7,25,26,8,9,27,28,29,30,11,12,55,56,57,31,33,32,59,35,60,36,61,63,34,37,64,65,66,67,68,69,38,39,40,70,41,42,62,71,43,44,72,45,46,47,73,48,49,50,51,52,75,76,53,54, + 23,61, + 61, + 68, + 68, + 68, + 68, + 61, + 61, + 61, + 6,75, + 61, + 6, + 61,45, + 1,12,37, + 68, + 16,19,26,60,36,63,68,43,49, + 73, + 0,19,65, + 14,60, + 14,17,1,21,7,26,27,28,30,11,12,35,60,64,39,40,70,41,43,45,46,48,49,50, + 21,26,30,61,49, + 14,15,1,19,6,25,60,42,72,53, + 0,25,53, + 28,61, + 61, + 63, + 16,3,4,60,68, + 68, + 23,12,64,71,43, + 68, + 68, + 68, + 64,43, + 61, + 61, + 61, + 61, + 61, + 8, + 61, + 61, + 61, + 61, + 61, + 61, + 61, + 61, + 23,6,24,25,30,57,31,61,63,67,62,71,72,51,53, + 57,61,63,68, + 68, + 61, + 6,73,75, + 6,75, + 75, + 6,73,75, + 75, + 75, + 75, + 75, + 73,75, + 61, + 75, + 73,75, + 6,73,75, + 61, + 61, + 61, + 23, + 17,67, + 69, + 19, + 27,50, + 15,6,8,63,62,72,75, + 8, + 0,5,23,24,25,28,61,64,38,71,51, + 61, + 19,64, + 61, + 61, + 61, + 61, + 61, + 62, + 14,0,17,1,18,19,20,21,22,6,7,25,28,29,11,12,33,35,60,61,63,64,65,68,39,40,70,71,43,44,45,47,73,52,75,54, + 64,45, + 61, + 73, + 73, + 73, + 73, + 61, + 23, + 62, + 46,54, + 20, + 17,20,23,25,9,12, + 25, + 14, + 5,23, + 61, + 13,14,15,1,19,6,25,8,11,33,60,63,64,66,69,70,43,45,73,52,75,53, + 0,1,29,12, + 6,8,57,61,68,73,75, + 26, + 13, + 61, + 43, + 62, + 13,15,0,17,1,19,5,22,23,24,7,25,26,9,30,31,33,61,63,34,64,65,67,38,39,40,41,48,49,52,76,53, + 25, + 17,68, + 53, + 17,1,21,5,7,26,9,27,28,30,11,12,31,61,39,40,70,43,45,49,50,51, + 14,1,19,23,6,24,26,8,9,27,11,12,55,56,59,61,37,64,68,69,38,39,70,71,43,45,46,48,49,51, + 49, + 37,64, + 20, + 74, + 68, + 13, + 15,17,18,19,20,2,3,4,21,24,25,26,9,27,28,30,11,12,55,56,31,58,33,32,59,35,60,36,34,37,64,38,39,40,70,41,43,44,45,46,47,48,49,50,51,76,54, + 66, + 13,5,6,26,8,33,37,43,44, + 63, + 14,0,19,46,48, + 23,12,67, + 14,21,63,64, + 1,37, + 53, + 21,5,26,61,67,49, + 53,54, + 49, + 23,33, + 23, + 69,53, + 56, + 64, + 14, + 6,8, + 6,62,72, + 15,25,30, + 19, + 53, + 14,19,2,71,43, + 13,0,5,8,12,63,41,43,53, + 14,64, + 24, + 61,43,45,53, + 14, + 6,57,61,68, + 12,61,71,73, + 61, + 61, + 61,64, + 64, + 61, + 2, + 63, + 60,61,40,43,46,51,53, + 20, + 66,67, + 61,73, + 3,25,12,55,56,59, + 72, + 7,43,53, + 5,68,46,54, + 61,54, + 25,42, + 9,12, + 19, + 11,70, + 0,53, + 14,1,19,12,61,37,64,67,70,41,43,46,73,48,53,54, + 61,73, + 17,61,75, + 61, + 17,61, + 17,61,66,75, + 12, + 9,29, + 14,64,53, + 63,37, + 71, + 13,2,25,63,64, + 53, + 71, + 17, + 13,33,60,65, + 71, + 25, + 17,1,12,39,53, + 14,0,63,51, + 16,0,53, + 64, + 13, + 17,5,26,64,71, + 19,12,49, + 24,25,60,64, + 12, + 6,8,57,61,68,73,75, + 6, + 66,69,75, + 66, + 15, + 53, + 6,8, + 23,9, + 45, + 12,38, + 45, + 14,7,11,70,45, + 54, + 23, + 19, + 64, + 15,64,66,67,69,54, + 19, + 6,8,37, + 13,6,8,37,73, + 53, + 63, + 0,17,26,72, + 27, + 72, + 72, + 45, + 8, + 8,73, + 73, + 8,73, + 73, + 75, + 15, + 6,62,72,52, + 8,73, + 73, + 61, + 2, + 20,2, + 54, + 61, + 61, + 61, + 61, + 61, + 61, + 61, + 6,57, + 13,14,15,17,18,20,2,6,26,8,27,11,12,57,33,32,60,36,61,63,66,69,70,44,73,75, + 66, + 15,6,8,33,37, + 13,1,7,63,37, + 61, + 16,0,18,19,20,2,3,4,26,55,56,58,32,60,36,68,44,47,49,76,54, + 13, + 61, + 69, + 21,25,26,41,43,46,49, + 20,61,63, + 63, + 72, + 72, + 19,25,57,61,63,68, + 63, + 16,20,2,60,68,45,47,54, + 23, + 0, + 56, + 0,53, + 45, + 45, + 64, + 14,16,23,24, + 13, + 64,44,76, + 61, + 0, + 20,6,8,63,62, + 42, + 14, + 14, + 53, + 21,6,25,26,9,30,12,57,61,68,39,71,49, + 60, + 61,68, + 6, + 61, + 40, + 61,40, + 61, + 21,61, + 43, + 13,14,19,2,65,47,53, + 14, + 27,28,63,50, + 61, + 53, + 53, + 12, + 1, + 64,43, + 53, + 14, + 13,17,12,57,68,45,51, + 6,8, + 14, + 58,61, + 20, + 1,64, + 21, + 11,61,70, + 61,70, + 0,22,9,28,29,12,65, + 11,12,61,70,41,73,53, + 5,70,41,73,53, + 61, + 13, + 61, + 19,37,43, + 42, + 25,8,57,60,61,68,42,62,73, + 14,0,19,20,2,23,24,8,12,37,66,67,38,71,43,51, + 15,17,18,19,20,2,3,4,21,23,24,25,26,27,28,30,11,12,55,56,31,58,33,32,59,35,36,34,37,64,38,39,40,70,41,43,44,45,46,47,48,49,50,51,76,54, + 71, + 19,53, + 16, + 53, + 15,17,18,19,20,2,3,4,21,23,6,24,25,26,27,28,30,11,12,55,56,31,58,33,32,59,35,36,34,37,64,38,39,40,70,41,43,44,45,46,47,48,49,50,51,52,76,54, + 15,17,18,19,20,2,3,4,21,5,6,24,7,25,26,27,28,30,11,12,55,56,31,58,33,32,59,35,36,34,37,64,66,38,39,40,70,41,43,44,72,45,46,47,48,49,50,51,76,53,54, + 64, + 31,71, + 17,61,63,43, + 73, + 73, + 73, + 0,5,23,64,72, + 63, + 13,19,6,8,57,33,60,61,63,68,72,73,75, + 13,0,17,1,19,21,22,23,6,24,7,25,26,9,27,28,30,11,12,31,35,61,63,37,64,65,67,39,40,70,41,42,71,43,45,46,48,49,50,51,52,53, + 59, + 17,1,21,25,26,9,71,49, + 14, + 47, + 43, + 14,15,17,19,21,5,23,25,8,28,12,33,60,61,63,34,64,65,69,71,43,45,74,49,53, + 6, + 62,72, + 23, + 12,61, + 12,43,73, + 73, + 73, + 73, + 73, + 57,61,68,73, + 0,65,74, + 21,27,28,35,64,70,41,46,48,49,50, + 13,14,15,12,61,64,66,67,69,45, + 61, + 61, + 6,8,57,61,68,72,73, + 69, + 68,69, + 17,1,26,39,45, + 54, + 19,7,25,11,12,64,66,69,70,41,71,43,45,51, + 19,5,12,71,53, + 16,45, + 65, + 6,8,36,63,66,43,44,73, + 23,37, + 14,17,12,64, + 20,2, + 61, + 61, + 61, + 12,61, + 0,63,72,45, + 20,2, + 8, + 8, + 8, + 8, + 16,26,60,68,44,49, + 68, + 74, + 53, + 6,8,57,61,68,62,43,72,73,75, + 57,61,68,73, + 68, + 57, + 61,45, + 61, + 64, + 13,19,20,12,64,43,47, + 8,60,67, + 17, + 6, + 21,25,26,49, + 67,71, + 14,64,69,41,48, + 19,3,64,39,43,45, + 15,22,71, + 17,1,26,11,12,64,39,70,41,71,45,46,48,51, + 19,20,23, + 15,19,2,5,63,43, + 61, + 25,57,71, + 0,7,31,72,52, + 13,19,5,8,12,60,42,43,48, + 8, + 62, + 11,70, + 64,71, + 62, + 1,8,12,61,37, + 53, + 53, + 23,24,61,62, + 8,57,71,72, + 53, + 6, + 6,8,12,31,35,64,41,43,46,48, + 17,10,39,40, + 13,21,22,6,24,25,26,11,12,38,70,45,48,49,52, + 6,8,57,61,68,73, + 72, + 61, + 6,57, + 6, + 8, + 2, + 37, + 26, + 14,20,2,11,12,64,70,43, + 14,45, + 11,70, + 1, + 46,73, + 46,73, + 71, + 14,19,2,23,37,64,65,53, + 61, + 1,19, + 20,49, + 13,22,25,8,64, + 16,25,60,68,47, + 68, + 67, + 45, + 6,8,72,75, + 15,8,63,72, + 23, + 8, + 14,15,17,2,6,8,61,34,72,75, + 8, + 64,43, + 13,17,1,19,2,25,9,10,11,12,35,63,39,70,43,45,53, + 6, + 12, + 26,49, + 14,1,20,61,63,37,43,46, + 71, + 53, + 0, + 6, + 33, + 17,71,48, + 35,70,71,73, + 71,51, + 20,2,21,23,24,7,26,27,28,30,11,12,32,64,39,40,70,42,44,45,47,49,50,52,76,53,54, + 61, + 14,43, + 14, + 7, + 52, + 45, + 28,73, + 35,41,43,46,48, + 73,48, + 73,48, + 0,74, + 74, + 7, + 6,8,73, + 8, + 14,15,17,1,18,20,6,8,27,11,33,32,59,36,61,63,66,68,69,70,44,72,47,73,49,50,75,53, + 15,33, + 8, + 53, + 61, + 72, + 23,63, + 8,61, + 15,17,18,19,20,2,3,4,21,23,24,25,26,27,28,30,11,12,55,56,31,58,33,32,59,35,36,34,37,64,38,39,40,70,41,43,44,45,46,47,48,49,50,51,52,76,54, + 62, + 14,17,5,25,26,8,27,12,57,36,61,63,64,66,67,68,69,43,47,73,48,50,51,52, + 14,17,19,20,2,22,23,25,11,12,39,70,71,43,52, + 45, + 14,43, + 71, + 38, + 53, + 45, + 57,49,50,51, + 57, + 72, + 61,43,49,50,51, + 37, + 31, + 19,9,29, + 0,6,42,45, + 57,61,68,73, + 71, + 14,15,19,3,5,23,24,25,11,12,33,35,61,63,64,66,70,71,43,45,74,51,53, + 16,6,61,72, + 0,17,25,12,63, + 43,45, + 14, + 13,16,19,20,2,23,6,12,58,36,37,38,71,44,72, + 20, + 62, + 0, + 17, + 11,12,61,70,41,46,73,48,54, + 7, + 61, + 14,64,67, + 61, + 61,64,66,67, + 17,12,63, + 71,52,53, + 7, + 61, + 0,17,1,18,20,2,21,5,25,26,9,27,28,29,11,12,32,36,39,40,70,71,43,44,45,47,49,50,52,75,76,53,54, + 53, + 16, + 53, + 2, + 13,14,15,16,17,2,22,6,25,8,10,12,60,61,34,68,71,73,52,75,76, + 68, + 0,53, + 8,73, + 68, + 64, + 16,26,60,68,49,54, + 14,17,23,24,25,12,64,38,51, + 45, + 64, + 71, + 66,39, + 12,55, + 2,11,12,70,71,45,48, + 21,25,26,37,49, + 13,14,0,17,1,18,19,20,2,21,22,23,6,24,7,25,26,9,28,29,30,11,12,31,33,32,59,36,61,63,34,37,64,67,39,40,70,42,71,43,44,45,47,74,49,51,52,76,54, + 5, + 15,8,12,33,61,63,73, + 61, + 61, + 61, + 0,65, + 23,7,9,31,53, + 19,64,43, + 1,12,68,69, + 19, + 1,12,63,67, + 20, + 17,69,43, + 8, + 14,5,54, + 61, + 14,5, + 61, + 13,14,16,0,17,1,18,19,20,2,21,5,22,23,24,25,28,29,30,31,33,32,35,36,34,64,65,38,39,40,41,71,44,45,46,47,48,52,76,54, + 14,5, + 61, + 64, + 53, + + diff --git a/doc/salome/gui/SMESH/whxdata/whgdata0.xml b/doc/salome/gui/SMESH/whxdata/whgdata0.xml index 0075ff8d5..b0993a043 100755 --- a/doc/salome/gui/SMESH/whxdata/whgdata0.xml +++ b/doc/salome/gui/SMESH/whxdata/whgdata0.xml @@ -1,22 +1,22 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whxdata/whglo.xml b/doc/salome/gui/SMESH/whxdata/whglo.xml index 0f1cd68e5..ac67056d3 100755 --- a/doc/salome/gui/SMESH/whxdata/whglo.xml +++ b/doc/salome/gui/SMESH/whxdata/whglo.xml @@ -1,5 +1,5 @@ - - - - + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whxdata/whidx.xml b/doc/salome/gui/SMESH/whxdata/whidx.xml index ac66bb966..44f05e5be 100755 --- a/doc/salome/gui/SMESH/whxdata/whidx.xml +++ b/doc/salome/gui/SMESH/whxdata/whidx.xml @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/doc/salome/gui/SMESH/whxdata/whtdata0.xml b/doc/salome/gui/SMESH/whxdata/whtdata0.xml index 64e838ed1..f81db8e9f 100755 --- a/doc/salome/gui/SMESH/whxdata/whtdata0.xml +++ b/doc/salome/gui/SMESH/whxdata/whtdata0.xml @@ -1,96 +1,101 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whxdata/whtoc.xml b/doc/salome/gui/SMESH/whxdata/whtoc.xml index a271ba7cc..871ec25b9 100755 --- a/doc/salome/gui/SMESH/whxdata/whtoc.xml +++ b/doc/salome/gui/SMESH/whxdata/whtoc.xml @@ -1,4 +1,4 @@ - - - - + + + + diff --git a/doc/salome/tui/SMESH/sources/Application-About.png b/doc/salome/tui/SMESH/sources/Application-About.png index 7b58330d50856e28562e8f9ed80dae72d6e6dda3..df0d5a187398c59271c45249950a92cd9cec68bb 100755 GIT binary patch delta 15 WcmbO=jdA8QMwZS1KlhESqTT>383gJ8 delta 16 XcmbO^jd9jAM%K;%KX=}ZETY~3Ffs)9 diff --git a/doc/salome/tui/SMESH/sources/bg_salome.gif b/doc/salome/tui/SMESH/sources/bg_salome.gif index 677b70468f798fe4fbc20fac3d706e61179ff12b..429489c691d274d2af69108c574491a022e78824 100755 GIT binary patch delta 32 ocmeBcXY6ff+)(Z;#^r5uI_1tvyIQN1T^GMNFW*$b%EDj`0NO?kApigX delta 33 pcmeBeXY6Zd+)(Z;&dcR(b2{bDO1oOClwB9UI4|E+!OFs54FKOV4KDxy diff --git a/idl/SMESH_BasicHypothesis.idl b/idl/SMESH_BasicHypothesis.idl index 2479147db..8ae1235e7 100644 --- a/idl/SMESH_BasicHypothesis.idl +++ b/idl/SMESH_BasicHypothesis.idl @@ -301,6 +301,212 @@ module StdMeshers }; + /*! + * StdMeshers_NumberOfLayers: interface of "Nb. Layers" hypothesis. + * This hypothesis is used by "Radial prism" algorithm. + * It specifies number of segments between the internal + * and the external surfaces. + */ + interface StdMeshers_NumberOfLayers : SMESH::SMESH_Hypothesis + { + /*! + * Sets parameter value + */ + void SetNumberOfLayers(in long numberOfLayers) + raises (SALOME::SALOME_Exception); + + /*! + * Returns parameter value + */ + long GetNumberOfLayers(); + + }; + + /*! + * StdMeshers_LayerDistribution: interface of "Distribution of Layers" hypothesis. + * This hypothesis is used by "Radial prism" algorithm. + * It specifies 1D hypothesis defining distribution of segments between the internal + * and the external surfaces. + */ + interface StdMeshers_LayerDistribution : SMESH::SMESH_Hypothesis + { + /*! + * Sets 1D hypothesis specifying distribution of layers + */ + void SetLayerDistribution(in SMESH::SMESH_Hypothesis distributionHyp) + raises (SALOME::SALOME_Exception); + + /*! + * Returns 1D hypothesis specifying distribution of layers + */ + SMESH::SMESH_Hypothesis GetLayerDistribution(); + + }; + + /*! + * interface of "ProjectionSource1D" hypothesis. + * This hypothesis specifies a meshed edge to take a mesh pattern from + * and optionally association of vertices between the source edge and a + * target one (where a hipothesis is assigned to) + */ + interface StdMeshers_ProjectionSource1D : SMESH::SMESH_Hypothesis + { + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceEdge(in GEOM::GEOM_Object edge) + raises (SALOME::SALOME_Exception); + + /*! + * Returns the source edge + */ + GEOM::GEOM_Object GetSourceEdge(); + + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceMesh(in SMESH::SMESH_Mesh mesh); + + /*! + * Return source mesh + */ + SMESH::SMESH_Mesh GetSourceMesh(); + + /*! + * Sets vertex association between the source edge and the target one. + * This parameter is optional + */ + void SetVertexAssociation(in GEOM::GEOM_Object sourceVertex, + in GEOM::GEOM_Object targetVertex) + raises (SALOME::SALOME_Exception); + + /*! + * Returns the vertex associated with the target vertex. + * Result may be nil if association not set + */ + GEOM::GEOM_Object GetSourceVertex(); + + /*! + * Returns the vertex associated with the source vertex. + * Result may be nil if association not set + */ + GEOM::GEOM_Object GetTargetVertex(); + }; + + /*! + * interface of "ProjectionSource2D" hypothesis. + * This hypothesis specifies a meshed face to take a mesh pattern from + * and optionally association of vertices between the source face and a + * target one (where a hipothesis is assigned to) + */ + interface StdMeshers_ProjectionSource2D : SMESH::SMESH_Hypothesis + { + /*! + * Sets a source to take a mesh pattern from + */ + void SetSourceFace(in GEOM::GEOM_Object face) + raises (SALOME::SALOME_Exception); + + /*! + * Returns the source face + */ + GEOM::GEOM_Object GetSourceFace(); + + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceMesh(in SMESH::SMESH_Mesh mesh); + + /*! + * Return source mesh + */ + SMESH::SMESH_Mesh GetSourceMesh(); + + /*! + * Sets vertex association between the source face and the target one. + * This parameter is optional. + * Two vertices must belong to one edge of a face + */ + void SetVertexAssociation(in GEOM::GEOM_Object sourceVertex1, + in GEOM::GEOM_Object sourceVertex2, + in GEOM::GEOM_Object targetVertex1, + in GEOM::GEOM_Object targetVertex2) + raises (SALOME::SALOME_Exception); + + /*! + * Returns the -th source vertex associated with the -th target vertex. + * Result may be nil if association not set. + * Valid indices are 1 and 2 + */ + GEOM::GEOM_Object GetSourceVertex(in long i) + raises (SALOME::SALOME_Exception); + + /*! + * Returns the -th target vertex associated with the -th source vertex. + * Result may be nil if association not set. + * Valid indices are 1 and 2 + */ + GEOM::GEOM_Object GetTargetVertex(in long i) + raises (SALOME::SALOME_Exception); + }; + + /*! + * interface of "ProjectionSource3D" hypothesis. + * This hypothesis specifies a meshed shell or solid to take a mesh pattern from + * and optionally association of vertices between the source shape and a + * target one (where a hipothesis is assigned to) + */ + interface StdMeshers_ProjectionSource3D : SMESH::SMESH_Hypothesis + { + /*! + * Sets a source to take a mesh pattern from + */ + void SetSource3DShape(in GEOM::GEOM_Object shape) + raises (SALOME::SALOME_Exception); + + /*! + * Returns the source shape + */ + GEOM::GEOM_Object GetSource3DShape(); + + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceMesh(in SMESH::SMESH_Mesh mesh); + + /*! + * Return source mesh + */ + SMESH::SMESH_Mesh GetSourceMesh(); + + /*! + * Sets vertex association between the source shape and the target one. + * This parameter is optional. + * Two vertices must belong to one edge of a shape + */ + void SetVertexAssociation(in GEOM::GEOM_Object sourceVertex1, + in GEOM::GEOM_Object sourceVertex2, + in GEOM::GEOM_Object targetVertex1, + in GEOM::GEOM_Object targetVertex2) + raises (SALOME::SALOME_Exception); + + /*! + * Returns the -th source vertex associated with the -th target vertex. + * Result may be nil if association not set. + * Valid indices are 1 and 2 + */ + GEOM::GEOM_Object GetSourceVertex(in long i) + raises (SALOME::SALOME_Exception); + + /*! + * Returns the -th target vertex associated with the -th source vertex. + * Result may be nil if association not set. + * Valid indices are 1 and 2 + */ + GEOM::GEOM_Object GetTargetVertex(in long i) + raises (SALOME::SALOME_Exception); + }; + /*! * StdMeshers_Regular_1D: interface of "Wire discretisation" algorithm */ @@ -329,6 +535,41 @@ module StdMeshers { }; + /*! + * StdMeshers_Prism_3D: interface of "Prism 3D" algorithm + */ + interface StdMeshers_Prism_3D : SMESH::SMESH_3D_Algo + { + }; + + /*! + * StdMeshers_RadialPrism_3D: interface of "Radial Prism" algorithm + */ + interface StdMeshers_RadialPrism_3D : SMESH::SMESH_3D_Algo + { + }; + + /*! + * StdMeshers_Projection_3D: interface of "Projection 3D" algorithm + */ + interface StdMeshers_Projection_3D : SMESH::SMESH_3D_Algo + { + }; + + /*! + * StdMeshers_Projection_2D: interface of "Projection 2D" algorithm + */ + interface StdMeshers_Projection_2D : SMESH::SMESH_2D_Algo + { + }; + + /*! + * StdMeshers_Projection_1D: interface of "Projection 1D" algorithm + */ + interface StdMeshers_Projection_1D : SMESH::SMESH_1D_Algo + { + }; + }; #endif diff --git a/idl/SMESH_Gen.idl b/idl/SMESH_Gen.idl index 2f608b954..475d0253a 100644 --- a/idl/SMESH_Gen.idl +++ b/idl/SMESH_Gen.idl @@ -43,7 +43,7 @@ module SMESH interface FilterManager; interface SMESH_Pattern; - enum AlgoStateErrorName { MISSING_ALGO, MISSING_HYPO, NOT_CONFORM_MESH }; + enum AlgoStateErrorName { MISSING_ALGO, MISSING_HYPO, NOT_CONFORM_MESH, BAD_PARAM_VALUE }; struct AlgoStateError { AlgoStateErrorName name; string algoName; @@ -121,6 +121,7 @@ module SMESH /*! * Create Mesh object importing data from given UNV file + * (UNV supported version is I-DEAS 10) */ SMESH_Mesh CreateMeshesFromUNV( in string theFileName ) raises ( SALOME::SALOME_Exception ); @@ -169,7 +170,8 @@ module SMESH raises ( SALOME::SALOME_Exception ); /*! - * + * Return indeces of faces, edges and vertices of given subshapes + * within theMainObject */ long_array GetSubShapesId( in GEOM::GEOM_Object theMainObject, in object_array theListOfSubObjects ) @@ -185,6 +187,14 @@ module SMESH in string theGeomName) raises ( SALOME::SALOME_Exception ); + /*! + * Return geometrical object the given element is built on. + * The returned geometrical object not published in study by this method. + */ + GEOM::GEOM_Object FindGeometryByMeshElement( in SMESH_Mesh theMesh, + in long theElementID) + raises ( SALOME::SALOME_Exception ); + }; }; diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl index 5134fe24b..bd524b800 100644 --- a/idl/SMESH_Mesh.idl +++ b/idl/SMESH_Mesh.idl @@ -127,7 +127,8 @@ module SMESH HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis HYP_ALREADY_EXIST,// such hypothesis already exist HYP_BAD_DIM, // bad dimension - HYP_BAD_SUBSHAPE // shape is neither the main one, nor its subshape, nor a group + HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its subshape, nor a group + HYP_BAD_GEOMETRY // geometry mismatches algorithm's expectation }; /*! @@ -374,6 +375,7 @@ module SMESH /*! * Export Mesh to DAT, UNV and STL Formats + * (UNV supported version is I-DEAS 10) */ void ExportDAT( in string file ) raises (SALOME::SALOME_Exception); @@ -508,18 +510,28 @@ module SMESH /*! * If given element is node returns IDs of shape from position - * else - return ID of result shape after ::FindShape() - * from SMESH_MeshEditor - * If there is not element for given ID - returns -1 + * If there is not node for given ID - returns -1 */ long GetShapeID(in long id); + /*! + * For given element returns ID of result shape after + * ::FindShape() from SMESH_MeshEditor + * If there is not element for given ID - returns -1 + */ + long GetShapeIDForElem(in long id); + /*! * Returns number of nodes for given element * If there is not element for given ID - returns -1 */ long GetElemNbNodes(in long id); + /*! + * Returns IDs of nodes of given element + */ + long_array GetElemNodes(in long id); + /*! * Returns ID of node by given index for given element * If there is not element for given ID - returns -1 @@ -642,12 +654,36 @@ module SMESH long AddNode(in double x, in double y, in double z); + /*! + * Create edge, either linear and quadratic (this is determed + * by number of given nodes). + * \param IdsOfNodes List of node IDs for creation of element. + * Needed order of nodes in this list corresponds to description + * of MED. This description is located by the following link: + * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. + */ long AddEdge(in long_array IDsOfNodes); + /*! + * Create face, either linear and quadratic (this is determed + * by number of given nodes). + * \param IdsOfNodes List of node IDs for creation of element. + * Needed order of nodes in this list corresponds to description + * of MED. This description is located by the following link: + * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. + */ long AddFace(in long_array IDsOfNodes); long AddPolygonalFace(in long_array IdsOfNodes); + /*! + * Create volume, either linear and quadratic (this is determed + * by number of given nodes). + * \param IdsOfNodes List of node IDs for creation of element. + * Needed order of nodes in this list corresponds to description + * of MED. This description is located by the following link: + * http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. + */ long AddVolume(in long_array IDsOfNodes); /*! diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index 4125b6ca2..0c4b44de6 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -41,7 +41,13 @@
- - + + + + + + + +
diff --git a/resources/StdMeshers.xml b/resources/StdMeshers.xml index 853f8ea2b..3a69b96cf 100644 --- a/resources/StdMeshers.xml +++ b/resources/StdMeshers.xml @@ -7,8 +7,8 @@ + server-lib="StdMeshersEngine" + gui-lib="StdMeshersGUI"> + + + + + + + + + + @@ -87,6 +112,7 @@ icon-id="mesh_algo_regular.png" hypos="LocalLength,Arithmetic1D,StartEndLength,NumberOfSegments,Deflection1D,AutomaticLength" opt-hypos="Propagation,QuadraticMesh" + input="VERTEX" output="EDGE" dim="1"/> @@ -111,6 +137,42 @@ icon-id="mesh_algo_hexa.png" input="QUAD" dim="3"/> + + + + + + + + + + + diff --git a/resources/mesh_hypo_layer_distribution.png b/resources/mesh_hypo_layer_distribution.png new file mode 100644 index 0000000000000000000000000000000000000000..3166fccbb3d8b33b05208c12b259f02d97c19533 GIT binary patch literal 868 zcmV-q1DpJbP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;+DSw~RCwBAWcbfO5R{abfK~N$_b_6U{|_~U5eNYS zhyl#TgG)+E{@=U*{QtG%&;Nti$a4Sx|A*5sHb4L|p}Pd;8f3r;#2=o2$8cF`X(?Pi z#B~e|00G2;Y*V1U3u=z=jn- z3nR|$?!aVHaIrH5%CM6`O6ak(`-|;_gd6O$?uZ|9~3!6YgbX01!Y-NJR!C zFvT+fa|tNdfQ6pLOksEu+Rt#?ACf#khJF0?4Q}91ECvDu5EFVDd~y9dgQ1isSnS`o zpA27qerNdb3z9BB01f*Dbz#Jj84OWJW-_epyM~hN00M{wTWUZ5Y&+aVpMHObhuaTe zM1Twehg)9@gC;{1Fm8XK=miKMaLB<5NN}kE3uHzdMK4mm#a8eF1Q136iH>{v=KMdm u@A?0&efKa5SZo*|fEcM!1t0@}00RKVDZ8dQ%ztM90000WdP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;gGod|RCwBAWcbfO5R{abfK~N$_b_6U{|_~U5eNYS zhyl#TgG)+E{@=U*{QtG%&;Nti$a4Sx|A*5sHb4L|p}Pd;8f3r;#2=o2$8cF`X(?Pi z#B~e|00D&RlJn31KfjOU5`ylBU}TpA1Q3b~IRzLP-hW_V$Vx5-S^588RTaa(@^Y}; zztU2Me?>(Qc2*X{zmycL;SCT#nBjH(`F~y0rWo2LtX6NPo z|CgBwVW+14{}&$*SN%CK5W_%#0Kzbg82m3Z6jcm~2M|C^=&}2+qJrUHaWN#U^77ze z1#}t1zlaDh`}3baVEVC-4@T+$2p|>^BP+WYoHTlRdKehKeq~_z@dFaRA3riMeESAr z1L<#n|ALwP>(_(nA5eafRTeZIG5iMzAQrI1eFlaXA0X+BY4T)vd@(Ith+wZ?4QIdh z_h%5@xRF71`*tw@`2(;iU^YMiv4FEvDIx=cya{q4)2vwx|B{lxE@oP}lHp%i7{lk^ zzrn8i4t3d8cXtNuojVzhKbyt?%bEZI#DbDXdw>QbdGp7I4-D^thJe7!@820dLBmdN z%N8&VGZ;CK0|XFRv3%Oa1#1k0FhBq?p{H|DOajvvnElGnkKwkbCzyQ`NCOQ5v;Y2w z*uHn(JqGl=4-i01=tb09px2&$heXf=pw}Nky$=$5^YbT|ZLxPR(6HwWoE!`cmQqP5 zh5`f-3%UzIu?GWYd-lNDP6rMk2NUD@{<;4(8KN+9GC%;KlxLv4j9%vT^iBDHY~8*8 zd;9KT$YE0t5I`s{#9ktEFmMQPGQ4NNEDy1%2M8cWYE%Kp03g5sxGbRa22W4p00000 LNkvXXu0mjfZ30C& literal 0 HcmV?d00001 diff --git a/resources/mesh_hypo_source_edge.png b/resources/mesh_hypo_source_edge.png new file mode 100644 index 0000000000000000000000000000000000000000..3c6790dffafa82239ad608390b66570657e185c4 GIT binary patch literal 837 zcmV-L1G@Z)P)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;yGcYrRCwBAWcbfO5R{abfK~N$_b_6U{|_~U5eNYS zhyl#TgG)+E{@=U*{QtG%&;Nti$a4Sx|A*5sHb4L|p}Pd;8f3r;#2=o2$8cF`X(?Pi z#B~e|00D&RlJn31KfjM~35fp9%Zq`bJ_PGTRu94e0mOph5&;H=_a7J-vXYA#dKi2D z_b~J@6yJZ&@csn@0|&=K39=Y&20#E|hS&AyU>;Dz z|IW@%oS_Sn3l9(f504Wl1_&S&7lLE46yhO}?dQ&&1B+if|D1v0$9HIGLV%W~B+Nl5 zF%J+xjL69b6u`yV#S9{PY7DHOKZC{g&b!C(;lm4tA3(ODr6OGI51`kdKlskD|K2o| z$~ z3H2TW*kvHYy1Tm>VaWs(VIS^;c;6W~IT#p%w6Yi&1Yqfi;XgnCfnE3msNlti@8H;U zgQq+Ous1Q%B+!r-K*Kno{O>?TA08l70|XEYazuat#6XA(L16~+Cdg$VJ}7)a$%^9# zMEiH31GWRh5IIr-0*D1Uk7COuAOP|v$Vu;Cd!(6Z!IsgbDl=2Lem%$|mEN24Ap1vvnkFC4+ ze{bJCjPek!9!U%!fLO3bN;gV=0Okl_xG`Xshu9(!Ab=RDQ3W6afB*vk8ZnHi^Hg>X P00000NkvXXu0mjfl6Fq) literal 0 HcmV?d00001 diff --git a/resources/mesh_hypo_source_face.png b/resources/mesh_hypo_source_face.png new file mode 100644 index 0000000000000000000000000000000000000000..fbd319220f4197da0c29f920c2822250d9a8b711 GIT binary patch literal 888 zcmV-;1Bd*HP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;?ny*JRCwBAWcbfO5R{abfK~N$_b?Jt3lKmIU<2{s zl9H1D_wGOcf9?45{~$IY^#B3Hi0ncXmq2AKEG)osCr+GzIe-zL%K-ui#U*R|uEFhk zP*?XKXxRVLCr|!gv}h5S{iwYiE)RD3_2>W3?L&1rKmf5I`#!ixi{VLcFT=lIzZm}i z_yHEXe)A^7l`B`kY({2ghDR+e41d3VWl(HyXNdADW_W+$J4y%w1Q5c@Ko-cb|9}57 z{0AEN@8?ejh2~}yFFytv^7s39hJRnaF#P%anL%y#Y>>}TybKUPC@%c}`!~b?KYt)D z1kxa|(!+y+k%fgp4rn0AlK(&qHWcau^q2<-AczZriEoJx*5I}Gjg2LnvDE#08|G?e^ zI}XVH3N-Kw)J0!`>V5$6U#R@^2Ots>rT_uN1Pjz3K-YZ-+NigDIm6}1NQQqv#s7c? z{RWDG3Vh}K1wF+;RIX`Ab{X5M9vY{qoctt z1BDaFYhR$@2jc$(^5+86A+ma801!a%oMK^V0cOomPyl-wp_??PHLhIP>?0v z(btiIVPjv-@4(4GzCyA`kS_y6l_~>6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx&hVpc)B=-RNPAX^Z&m+vnqo^!wd-x76wL_jf_y@2*;5KW=09K9tQ`51_q`MR+pT- zJv~Y3U5sZ#wkaSv;$iR5SBQuSOL!s+1&{hpI289C*mu_nOyPH1yJJ4MWp00i_>zopr E0O+nvvj6}9 literal 0 HcmV?d00001 diff --git a/resources/mesh_tree_algo_projection_3d.png b/resources/mesh_tree_algo_projection_3d.png new file mode 100644 index 0000000000000000000000000000000000000000..e877c8bab9eb8c35029cb0b987d7a9c1ddef12b8 GIT binary patch literal 600 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 literal 0 HcmV?d00001 diff --git a/resources/mesh_tree_hypo_projection_3d.png b/resources/mesh_tree_hypo_projection_3d.png new file mode 100644 index 0000000000000000000000000000000000000000..80f05f468d48bd16c1ba9acfb4daee19f66532e9 GIT binary patch literal 576 zcmV-G0>Axz@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ-wn;=mRCwBA{Qv(y10?_;fS4F41ONdk-9#0bPV z{Q&eHBM{*ABR~Mb4fx;O4AKD+tgC}7m_HvP_U8`+!>?Zq3_pKDaAhSUSR5dLz+QM& zQ^UYmTg$-k_b*uU*}OckmV&JM zeOWDg$3etpu-rxeq~^I_wGN# z+O@1ev9Cb<5v&d%fWQX)|MG?5AIP0R@cYvzF#QoI&j|G9@81w_eE!V9@csKMu-wm| zuYiVr0kZ)D2;u^u@xP%q{{pE5f;VsegTwUKuYU~x{(S=)^d1-vFCdouehUf|-;eWwwfB*s;@DZr#3smDr zs7tp_??PHLhIP>?0v z(btiIVPjv-@4(4GzCyA`kS_y6l_~>6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx-l>?=6kw0hE&{2`t$$4J+mrNu(9^Su5iNjjE`(eBnSDPaPBa2ZdqZHr&&V%(%PXC-`7%s94IQSIIK7C5U zK_VwQPVVsjGd>*Frc)or*Vx=S^uGT8A`75h9ov4!XJ~NAKVxcOVA}m4-j((6{zpkI zZv*x><@^&DWK667_nFi_@% literal 0 HcmV?d00001 diff --git a/resources/mesh_tree_hypo_source_edge.png b/resources/mesh_tree_hypo_source_edge.png new file mode 100644 index 0000000000000000000000000000000000000000..7e7202089d53dfb0a21205669e52239466a5be9d GIT binary patch literal 316 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9G6>p_??PHLhIP>?0v z(btiIVPjv-@4(4GzCyA`kS_y6l_~>6Lo)-z&;LOBB?CjL0RzLU1O^7H84L{K`IF+0 zx&hU0@^op4-hKK@BpNZ3t8(2Pn=A%4?N{cv20*qGJH_6X^xD?CwrHF z_RNM73Jni>+>{spzaXI)Wz50MA|TA%3baeZ43m(U_?c;6NC!6qivah&6t5me2F4>T l`ZI-?8JIef^ch$r7@o>6=`3+HSOj!EgQu&X%Q~loCICwZT%`a2 literal 0 HcmV?d00001 diff --git a/resources/mesh_tree_hypo_source_face.png b/resources/mesh_tree_hypo_source_face.png new file mode 100644 index 0000000000000000000000000000000000000000..46e5b880b83d45e40ca884593360a60d0dd20158 GIT binary patch literal 715 zcmV;+0yO=JP)z@;j(q!3lK=n!AY({UO#lFTB>(_`g8%^e{{R4h=>PzA zFaQARU;qF*m;eA5Z<1fdMgRZ;K}keGRCwBA{Qv(y13F-2WCROZSXhAhCr+FI(?GS1 z=xPB1hy|O*2X%D}5xaIVOrAKA;rh*+V7XQP{&0C@g8%}E1zGcx-d=`(zkV_N|M3GX z2GV@x$`yz_Gc&`ZmKKJ;U%!IY!VCcjAQoiJ|Ns7FU;yI(|Ng<94fg`j1z^K}{$#k7 znhG}rAb{X5`2YJi!~Z{jAc}xA2(0w*U|?inVUPnF@DHdFr1|gn?+pK-E(8I900KGV z|HH;cu6-U*ErH_zczj4Wt$b00M{!MEn67@b}|K zutBObXENM~jb-@z?Hj}2FJHi7zdn3mI1v)UV6b8Z!)u@y-T}Sv31|=q00a=&1t35D z0r?;1F`z48>Ekbu{S|227pRS2f$Dw$@n5JsKmdVV@B?Vtcc3%%mM>?x92v>*4=DK$ zsPQ*Y45S&P34|B9xG==--p%j>DE=GjRe%5jyCCD?LwKnEg8CO^14z*~phl4GAiu+0 zu@vfj5C8}u7Ep3UPI1PoRx#iM=;{Fihy^{xU5}0i+YIt2$f;kT{s-}Y0{L@+frzXg zAb>#0iNVs+5*#8k6coT-0680sVVaTr%nD2w3!n+<`0?Y600G2^oEu@8Wuvz@IGR8K x2r}poRCC#}V;H#-Ab=S0WoLANEjt4Q7yy3ohK6Uv*oy!F002ovPDHLkV1l+CE(`zw literal 0 HcmV?d00001 diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx index a6ae0af99..82eaa6726 100644 --- a/src/Controls/SMESH_Controls.cxx +++ b/src/Controls/SMESH_Controls.cxx @@ -564,7 +564,8 @@ double AspectRatio3D::GetValue( const TSequenceOfXYZ& P ) //double aVolume = getVolume(aLen); double aHeight = getMaxHeight(aLen); static double aCoeff = sqrt(2.0)/12.0; - aQuality = aCoeff*aHeight*aSumArea/aVolume; + if ( aVolume > DBL_MIN ) + aQuality = aCoeff*aHeight*aSumArea/aVolume; break; } case 5:{ @@ -790,7 +791,7 @@ double Warping::GetValue( const TSequenceOfXYZ& P ) if ( P.size() != 4 ) return 0; - gp_XYZ G = ( P( 1 ) + P( 2 ) + P( 3 ) + P( 4 ) ) / 4; + gp_XYZ G = ( P( 1 ) + P( 2 ) + P( 3 ) + P( 4 ) ) / 4.; double A1 = ComputeA( P( 1 ), P( 2 ), P( 3 ), G ); double A2 = ComputeA( P( 2 ), P( 3 ), P( 4 ), G ); @@ -821,7 +822,7 @@ double Warping::ComputeA( const gp_XYZ& thePnt1, N.Normalize(); double H = ( thePnt2 - theG ).Dot( N ); - return asin( fabs( H / L ) ) * 180 / PI; + return asin( fabs( H / L ) ) * 180. / PI; } double Warping::GetBadRate( double Value, int /*nbNodes*/ ) const @@ -845,13 +846,13 @@ SMDSAbs_ElementType Warping::GetType() const double Taper::GetValue( const TSequenceOfXYZ& P ) { if ( P.size() != 4 ) - return 0; + return 0.; // Compute taper - double J1 = getArea( P( 4 ), P( 1 ), P( 2 ) ) / 2; - double J2 = getArea( P( 3 ), P( 1 ), P( 2 ) ) / 2; - double J3 = getArea( P( 2 ), P( 3 ), P( 4 ) ) / 2; - double J4 = getArea( P( 3 ), P( 4 ), P( 1 ) ) / 2; + double J1 = getArea( P( 4 ), P( 1 ), P( 2 ) ) / 2.; + double J2 = getArea( P( 3 ), P( 1 ), P( 2 ) ) / 2.; + double J3 = getArea( P( 2 ), P( 3 ), P( 4 ) ) / 2.; + double J4 = getArea( P( 3 ), P( 4 ), P( 1 ) ) / 2.; double JA = 0.25 * ( J1 + J2 + J3 + J4 ); if ( JA <= Precision::Confusion() ) @@ -885,42 +886,46 @@ SMDSAbs_ElementType Taper::GetType() const */ static inline double skewAngle( const gp_XYZ& p1, const gp_XYZ& p2, const gp_XYZ& p3 ) { - gp_XYZ p12 = ( p2 + p1 ) / 2; - gp_XYZ p23 = ( p3 + p2 ) / 2; - gp_XYZ p31 = ( p3 + p1 ) / 2; + gp_XYZ p12 = ( p2 + p1 ) / 2.; + gp_XYZ p23 = ( p3 + p2 ) / 2.; + gp_XYZ p31 = ( p3 + p1 ) / 2.; gp_Vec v1( p31 - p2 ), v2( p12 - p23 ); - return v1.Magnitude() < gp::Resolution() || v2.Magnitude() < gp::Resolution() ? 0 : v1.Angle( v2 ); + return v1.Magnitude() < gp::Resolution() || v2.Magnitude() < gp::Resolution() ? 0. : v1.Angle( v2 ); } double Skew::GetValue( const TSequenceOfXYZ& P ) { if ( P.size() != 3 && P.size() != 4 ) - return 0; + return 0.; // Compute skew - static double PI2 = PI / 2; + static double PI2 = PI / 2.; if ( P.size() == 3 ) { double A0 = fabs( PI2 - skewAngle( P( 3 ), P( 1 ), P( 2 ) ) ); double A1 = fabs( PI2 - skewAngle( P( 1 ), P( 2 ), P( 3 ) ) ); double A2 = fabs( PI2 - skewAngle( P( 2 ), P( 3 ), P( 1 ) ) ); - return Max( A0, Max( A1, A2 ) ) * 180 / PI; + return Max( A0, Max( A1, A2 ) ) * 180. / PI; } else { - gp_XYZ p12 = ( P( 1 ) + P( 2 ) ) / 2; - gp_XYZ p23 = ( P( 2 ) + P( 3 ) ) / 2; - gp_XYZ p34 = ( P( 3 ) + P( 4 ) ) / 2; - gp_XYZ p41 = ( P( 4 ) + P( 1 ) ) / 2; + gp_XYZ p12 = ( P( 1 ) + P( 2 ) ) / 2.; + gp_XYZ p23 = ( P( 2 ) + P( 3 ) ) / 2.; + gp_XYZ p34 = ( P( 3 ) + P( 4 ) ) / 2.; + gp_XYZ p41 = ( P( 4 ) + P( 1 ) ) / 2.; gp_Vec v1( p34 - p12 ), v2( p23 - p41 ); double A = v1.Magnitude() <= gp::Resolution() || v2.Magnitude() <= gp::Resolution() - ? 0 : fabs( PI2 - v1.Angle( v2 ) ); + ? 0. : fabs( PI2 - v1.Angle( v2 ) ); + + //BUG SWP12743 + if ( A < Precision::Angular() ) + return 0.; - return A * 180 / PI; + return A * 180. / PI; } } diff --git a/src/Controls/SMESH_ControlsDef.hxx b/src/Controls/SMESH_ControlsDef.hxx index 32cd281f5..c9b4dc0b9 100644 --- a/src/Controls/SMESH_ControlsDef.hxx +++ b/src/Controls/SMESH_ControlsDef.hxx @@ -35,6 +35,16 @@ #include "SMESH_Controls.hxx" +#ifdef WNT + #if defined SMESHCONTROLS_EXPORTS + #define SMESHCONTROLS_EXPORT __declspec( dllexport ) + #else + #define SMESHCONTROLS_EXPORT __declspec( dllimport ) + #endif +#else + #define SMESHCONTROLS_EXPORT +#endif + class SMDS_MeshElement; class SMDS_MeshFace; class SMDS_MeshNode; @@ -46,11 +56,10 @@ class SMESHDS_SubMesh; class gp_Pnt; class TopoDS_Shape; - namespace SMESH{ namespace Controls{ - class TSequenceOfXYZ: public std::vector + class SMESHCONTROLS_EXPORT TSequenceOfXYZ: public std::vector { public: typedef std::vector TSuperClass; @@ -97,7 +106,7 @@ namespace SMESH{ Class : Functor Description : Root of all Functors */ - class Functor + class SMESHCONTROLS_EXPORT Functor { public: ~Functor(){} @@ -109,7 +118,7 @@ namespace SMESH{ Class : NumericalFunctor Description : Root of all Functors returning numeric value */ - class NumericalFunctor: public virtual Functor{ + class SMESHCONTROLS_EXPORT NumericalFunctor: public virtual Functor{ public: NumericalFunctor(); virtual void SetMesh( const SMDS_Mesh* theMesh ); @@ -135,7 +144,7 @@ namespace SMESH{ Class : Volume Description : Functor calculating volume of 3D mesh element */ - class Volume: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT Volume: public virtual NumericalFunctor{ public: virtual double GetValue( long theElementId ); //virtual double GetValue( const TSequenceOfXYZ& thePoints ); @@ -148,7 +157,7 @@ namespace SMESH{ Class : SMESH_MinimumAngle Description : Functor for calculation of minimum angle */ - class MinimumAngle: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT MinimumAngle: public virtual NumericalFunctor{ public: virtual double GetValue( const TSequenceOfXYZ& thePoints ); virtual double GetBadRate( double Value, int nbNodes ) const; @@ -160,7 +169,7 @@ namespace SMESH{ Class : AspectRatio Description : Functor for calculating aspect ratio */ - class AspectRatio: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT AspectRatio: public virtual NumericalFunctor{ public: virtual double GetValue( const TSequenceOfXYZ& thePoints ); virtual double GetBadRate( double Value, int nbNodes ) const; @@ -172,7 +181,7 @@ namespace SMESH{ Class : AspectRatio3D Description : Functor for calculating aspect ratio of 3D elems. */ - class AspectRatio3D: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT AspectRatio3D: public virtual NumericalFunctor{ public: virtual double GetValue( const TSequenceOfXYZ& thePoints ); virtual double GetBadRate( double Value, int nbNodes ) const; @@ -184,7 +193,7 @@ namespace SMESH{ Class : Warping Description : Functor for calculating warping */ - class Warping: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT Warping: public virtual NumericalFunctor{ public: virtual double GetValue( const TSequenceOfXYZ& thePoints ); virtual double GetBadRate( double Value, int nbNodes ) const; @@ -199,7 +208,7 @@ namespace SMESH{ Class : Taper Description : Functor for calculating taper */ - class Taper: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT Taper: public virtual NumericalFunctor{ public: virtual double GetValue( const TSequenceOfXYZ& thePoints ); virtual double GetBadRate( double Value, int nbNodes ) const; @@ -211,7 +220,7 @@ namespace SMESH{ Class : Skew Description : Functor for calculating skew in degrees */ - class Skew: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT Skew: public virtual NumericalFunctor{ public: virtual double GetValue( const TSequenceOfXYZ& thePoints ); virtual double GetBadRate( double Value, int nbNodes ) const; @@ -223,7 +232,7 @@ namespace SMESH{ Class : Area Description : Functor for calculating area */ - class Area: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT Area: public virtual NumericalFunctor{ public: virtual double GetValue( const TSequenceOfXYZ& thePoints ); virtual double GetBadRate( double Value, int nbNodes ) const; @@ -235,7 +244,7 @@ namespace SMESH{ Class : Length Description : Functor for calculating length of edge */ - class Length: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT Length: public virtual NumericalFunctor{ public: virtual double GetValue( const TSequenceOfXYZ& thePoints ); virtual double GetBadRate( double Value, int nbNodes ) const; @@ -246,7 +255,7 @@ namespace SMESH{ Class : Length2D Description : Functor for calculating length of edge */ - class Length2D: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{ public: virtual double GetValue( long theElementId ); virtual double GetBadRate( double Value, int nbNodes ) const; @@ -267,7 +276,7 @@ namespace SMESH{ Class : MultiConnection Description : Functor for calculating number of faces conneted to the edge */ - class MultiConnection: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT MultiConnection: public virtual NumericalFunctor{ public: virtual double GetValue( long theElementId ); virtual double GetValue( const TSequenceOfXYZ& thePoints ); @@ -279,7 +288,7 @@ namespace SMESH{ Class : MultiConnection2D Description : Functor for calculating number of faces conneted to the edge */ - class MultiConnection2D: public virtual NumericalFunctor{ + class SMESHCONTROLS_EXPORT MultiConnection2D: public virtual NumericalFunctor{ public: virtual double GetValue( long theElementId ); virtual double GetValue( const TSequenceOfXYZ& thePoints ); @@ -302,7 +311,7 @@ namespace SMESH{ Class : Predicate Description : Base class for all predicates */ - class Predicate: public virtual Functor{ + class SMESHCONTROLS_EXPORT Predicate: public virtual Functor{ public: virtual bool IsSatisfy( long theElementId ) = 0; virtual SMDSAbs_ElementType GetType() const = 0; @@ -314,7 +323,7 @@ namespace SMESH{ Class : FreeBorders Description : Predicate for free borders */ - class FreeBorders: public virtual Predicate{ + class SMESHCONTROLS_EXPORT FreeBorders: public virtual Predicate{ public: FreeBorders(); virtual void SetMesh( const SMDS_Mesh* theMesh ); @@ -330,7 +339,7 @@ namespace SMESH{ Class : BadOrientedVolume Description : Predicate bad oriented volumes */ - class BadOrientedVolume: public virtual Predicate{ + class SMESHCONTROLS_EXPORT BadOrientedVolume: public virtual Predicate{ public: BadOrientedVolume(); virtual void SetMesh( const SMDS_Mesh* theMesh ); @@ -346,7 +355,7 @@ namespace SMESH{ Class : FreeEdges Description : Predicate for free Edges */ - class FreeEdges: public virtual Predicate{ + class SMESHCONTROLS_EXPORT FreeEdges: public virtual Predicate{ public: FreeEdges(); virtual void SetMesh( const SMDS_Mesh* theMesh ); @@ -377,7 +386,7 @@ namespace SMESH{ 2. With SetRangeStr method. Parameter of this method is a string like as "1,2,3,50-60,63,67,70-" */ - class RangeOfIds: public virtual Predicate + class SMESHCONTROLS_EXPORT RangeOfIds: public virtual Predicate { public: RangeOfIds(); @@ -407,7 +416,7 @@ namespace SMESH{ Class : Comparator Description : Base class for comparators */ - class Comparator: public virtual Predicate{ + class SMESHCONTROLS_EXPORT Comparator: public virtual Predicate{ public: Comparator(); virtual ~Comparator(); @@ -429,7 +438,7 @@ namespace SMESH{ Class : LessThan Description : Comparator "<" */ - class LessThan: public virtual Comparator{ + class SMESHCONTROLS_EXPORT LessThan: public virtual Comparator{ public: virtual bool IsSatisfy( long theElementId ); }; @@ -439,7 +448,7 @@ namespace SMESH{ Class : MoreThan Description : Comparator ">" */ - class MoreThan: public virtual Comparator{ + class SMESHCONTROLS_EXPORT MoreThan: public virtual Comparator{ public: virtual bool IsSatisfy( long theElementId ); }; @@ -449,7 +458,7 @@ namespace SMESH{ Class : EqualTo Description : Comparator "=" */ - class EqualTo: public virtual Comparator{ + class SMESHCONTROLS_EXPORT EqualTo: public virtual Comparator{ public: EqualTo(); virtual bool IsSatisfy( long theElementId ); @@ -466,7 +475,7 @@ namespace SMESH{ Class : LogicalNOT Description : Logical NOT predicate */ - class LogicalNOT: public virtual Predicate{ + class SMESHCONTROLS_EXPORT LogicalNOT: public virtual Predicate{ public: LogicalNOT(); virtual ~LogicalNOT(); @@ -485,7 +494,7 @@ namespace SMESH{ Class : LogicalBinary Description : Base class for binary logical predicate */ - class LogicalBinary: public virtual Predicate{ + class SMESHCONTROLS_EXPORT LogicalBinary: public virtual Predicate{ public: LogicalBinary(); virtual ~LogicalBinary(); @@ -505,7 +514,7 @@ namespace SMESH{ Class : LogicalAND Description : Logical AND */ - class LogicalAND: public virtual LogicalBinary{ + class SMESHCONTROLS_EXPORT LogicalAND: public virtual LogicalBinary{ public: virtual bool IsSatisfy( long theElementId ); }; @@ -515,7 +524,7 @@ namespace SMESH{ Class : LogicalOR Description : Logical OR */ - class LogicalOR: public virtual LogicalBinary{ + class SMESHCONTROLS_EXPORT LogicalOR: public virtual LogicalBinary{ public: virtual bool IsSatisfy( long theElementId ); }; @@ -525,7 +534,7 @@ namespace SMESH{ Class : ManifoldPart Description : Predicate for manifold part of mesh */ - class ManifoldPart: public virtual Predicate{ + class SMESHCONTROLS_EXPORT ManifoldPart: public virtual Predicate{ public: /* internal class for algorithm uses */ @@ -600,7 +609,7 @@ namespace SMESH{ Description : Predicate elements that lying on indicated surface (plane or cylinder) */ - class ElementsOnSurface : public virtual Predicate { + class SMESHCONTROLS_EXPORT ElementsOnSurface : public virtual Predicate { public: ElementsOnSurface(); ~ElementsOnSurface(); @@ -632,7 +641,7 @@ namespace SMESH{ /* FILTER */ - class Filter{ + class SMESHCONTROLS_EXPORT Filter{ public: Filter(); virtual ~Filter(); diff --git a/src/Driver/Driver_Document.h b/src/Driver/Driver_Document.h index 502a8f385..4c3f0b8d0 100644 --- a/src/Driver/Driver_Document.h +++ b/src/Driver/Driver_Document.h @@ -20,11 +20,13 @@ #ifndef _INCLUDE_DRIVER_DOCUMENT #define _INCLUDE_DRIVER_DOCUMENT +#include "Driver_Mesh.h" + #include class SMESHDS_Document; -class Driver_Document +class MESHDRIVER_EXPORT Driver_Document { public: Driver_Document(); diff --git a/src/Driver/Driver_Mesh.h b/src/Driver/Driver_Mesh.h index 4ce90c074..50a4a59b4 100644 --- a/src/Driver/Driver_Mesh.h +++ b/src/Driver/Driver_Mesh.h @@ -29,13 +29,17 @@ #include -#if defined WNT && defined WIN32 && defined DRIVER_EXPORTS -#define DRIVER_WNT_EXPORT __declspec( dllexport ) +#ifdef WNT + #if defined MESHDRIVER_EXPORTS + #define MESHDRIVER_EXPORT __declspec( dllexport ) + #else + #define MESHDRIVER_EXPORT __declspec( dllimport ) + #endif #else -#define DRIVER_WNT_EXPORT + #define MESHDRIVER_EXPORT #endif -class DRIVER_WNT_EXPORT Driver_Mesh +class MESHDRIVER_EXPORT Driver_Mesh { public: Driver_Mesh(); diff --git a/src/Driver/Driver_SMDS_Mesh.h b/src/Driver/Driver_SMDS_Mesh.h index d0dac6250..fa0ca8275 100644 --- a/src/Driver/Driver_SMDS_Mesh.h +++ b/src/Driver/Driver_SMDS_Mesh.h @@ -24,7 +24,7 @@ class SMDS_Mesh; -class Driver_SMDS_Mesh: public Driver_Mesh +class MESHDRIVER_EXPORT Driver_SMDS_Mesh: public Driver_Mesh { public: Driver_SMDS_Mesh(); diff --git a/src/Driver/Driver_SMESHDS_Mesh.h b/src/Driver/Driver_SMESHDS_Mesh.h index 43faa44e4..0013e86cc 100644 --- a/src/Driver/Driver_SMESHDS_Mesh.h +++ b/src/Driver/Driver_SMESHDS_Mesh.h @@ -24,13 +24,7 @@ class SMESHDS_Mesh; -#if defined WNT && defined WIN32 && defined DRIVER_EXPORTS -#define DRIVER_WNT_EXPORT __declspec( dllexport ) -#else -#define DRIVER_WNT_EXPORT -#endif - -class DRIVER_WNT_EXPORT Driver_SMESHDS_Mesh: public Driver_Mesh +class MESHDRIVER_EXPORT Driver_SMESHDS_Mesh: public Driver_Mesh { public: Driver_SMESHDS_Mesh(); @@ -38,7 +32,6 @@ class DRIVER_WNT_EXPORT Driver_SMESHDS_Mesh: public Driver_Mesh protected: SMESHDS_Mesh *myMesh; - }; #endif diff --git a/src/DriverDAT/DriverDAT_R_SMDS_Mesh.h b/src/DriverDAT/DriverDAT_R_SMDS_Mesh.h index 80b71697f..4186b8d13 100644 --- a/src/DriverDAT/DriverDAT_R_SMDS_Mesh.h +++ b/src/DriverDAT/DriverDAT_R_SMDS_Mesh.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERDAT_R_SMDS_MESH #define _INCLUDE_DRIVERDAT_R_SMDS_MESH +#include "SMESH_DriverDAT.hxx" + #include "Driver_SMDS_Mesh.h" -class DriverDAT_R_SMDS_Mesh: public Driver_SMDS_Mesh +class MESHDRIVERDAT_EXPORT DriverDAT_R_SMDS_Mesh: public Driver_SMDS_Mesh { public: virtual Status Perform(); diff --git a/src/DriverDAT/DriverDAT_R_SMESHDS_Document.h b/src/DriverDAT/DriverDAT_R_SMESHDS_Document.h index 359529e6b..c26ca913e 100644 --- a/src/DriverDAT/DriverDAT_R_SMESHDS_Document.h +++ b/src/DriverDAT/DriverDAT_R_SMESHDS_Document.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERDAT_R_SMESHDS_DOCUMENT #define _INCLUDE_DRIVERDAT_R_SMESHDS_DOCUMENT +#include "SMESH_DriverDAT.hxx" + #include "Driver_Document.h" -class DriverDAT_R_SMESHDS_Document : public Driver_Document +class MESHDRIVERDAT_EXPORT DriverDAT_R_SMESHDS_Document : public Driver_Document {}; #endif diff --git a/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.h b/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.h index e3ae20393..0147ce4a5 100644 --- a/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.h +++ b/src/DriverDAT/DriverDAT_R_SMESHDS_Mesh.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERDAT_R_SMESHDS_MESH #define _INCLUDE_DRIVERDAT_R_SMESHDS_MESH +#include "SMESH_DriverDAT.hxx" + #include "Driver_SMESHDS_Mesh.h" -class DriverDAT_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh +class MESHDRIVERDAT_EXPORT DriverDAT_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh {}; #endif diff --git a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.h b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.h index 1739cfe5b..ce013c5b9 100644 --- a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.h +++ b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.h @@ -27,9 +27,11 @@ #ifndef _INCLUDE_DRIVERDAT_W_SMDS_MESH #define _INCLUDE_DRIVERDAT_W_SMDS_MESH +#include "SMESH_DriverDAT.hxx" + #include "Driver_SMDS_Mesh.h" -class DriverDAT_W_SMDS_Mesh: public Driver_SMDS_Mesh +class MESHDRIVERDAT_EXPORT DriverDAT_W_SMDS_Mesh: public Driver_SMDS_Mesh { public: virtual Status Perform(); diff --git a/src/DriverDAT/DriverDAT_W_SMESHDS_Document.h b/src/DriverDAT/DriverDAT_W_SMESHDS_Document.h index 624f960de..802a2dee7 100644 --- a/src/DriverDAT/DriverDAT_W_SMESHDS_Document.h +++ b/src/DriverDAT/DriverDAT_W_SMESHDS_Document.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERDAT_W_SMESHDS_DOCUMENT #define _INCLUDE_DRIVERDAT_W_SMESHDS_DOCUMENT +#include "SMESH_DriverDAT.hxx" + #include "Driver_Document.h" -class DriverDAT_W_SMESHDS_Document: public Driver_Document +class MESHDRIVERDAT_EXPORT DriverDAT_W_SMESHDS_Document: public Driver_Document {}; #endif diff --git a/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.h b/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.h index 39a63233f..3d18b5907 100644 --- a/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.h +++ b/src/DriverDAT/DriverDAT_W_SMESHDS_Mesh.h @@ -27,9 +27,11 @@ #ifndef _INCLUDE_DRIVERDAT_W_SMESHDS_MESH #define _INCLUDE_DRIVERDAT_W_SMESHDS_MESH +#include "SMESH_DriverDAT.hxx" + #include "Driver_SMESHDS_Mesh.h" -class DriverDAT_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh +class MESHDRIVERDAT_EXPORT DriverDAT_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh {}; #endif diff --git a/src/DriverDAT/Makefile.in b/src/DriverDAT/Makefile.in index 198d419db..59c7d3355 100644 --- a/src/DriverDAT/Makefile.in +++ b/src/DriverDAT/Makefile.in @@ -35,7 +35,7 @@ VPATH=.:@srcdir@ @COMMENCE@ # header files -EXPORT_HEADERS= DriverDAT_R_SMDS_Mesh.h DriverDAT_R_SMESHDS_Mesh.h DriverDAT_R_SMESHDS_Document.h DriverDAT_W_SMDS_Mesh.h DriverDAT_W_SMESHDS_Mesh.h DriverDAT_W_SMESHDS_Document.h +EXPORT_HEADERS= DriverDAT_R_SMDS_Mesh.h DriverDAT_R_SMESHDS_Mesh.h DriverDAT_R_SMESHDS_Document.h DriverDAT_W_SMDS_Mesh.h DriverDAT_W_SMESHDS_Mesh.h DriverDAT_W_SMESHDS_Document.h SMESH_DriverDAT.hxx # Libraries targets LIB = libMeshDriverDAT.la diff --git a/src/DriverDAT/SMESH_DriverDAT.hxx b/src/DriverDAT/SMESH_DriverDAT.hxx new file mode 100755 index 000000000..d651ee86b --- /dev/null +++ b/src/DriverDAT/SMESH_DriverDAT.hxx @@ -0,0 +1,39 @@ +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESH_DriverDAT.hxx +// Author : Alexander A. BORODIN +// Module : SMESH + +#ifndef _SMESH_DriverDAT_HXX_ +#define _SMESH_DriverDAT_HXX_ + +#ifdef WNT + #if defined MESHDRIVERDAT_EXPORTS + #define MESHDRIVERDAT_EXPORT __declspec( dllexport ) + #else + #define MESHDRIVERDAT_EXPORT __declspec( dllimport ) + #endif +#else + #define MESHDRIVERDAT_EXPORT +#endif + +#endif diff --git a/src/DriverMED/DriverMED_Family.cxx b/src/DriverMED/DriverMED_Family.cxx index ebd21783d..45438ee6d 100644 --- a/src/DriverMED/DriverMED_Family.cxx +++ b/src/DriverMED/DriverMED_Family.cxx @@ -321,7 +321,7 @@ DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper, MED::PFamilyInfo anInfo; string aValue = aStr.str(); - if(myId == 0){ + if(myId == 0 || myGroupAttributVal == 0){ anInfo = theWrapper->CrFamilyInfo(theMeshInfo, aValue, myId, @@ -329,8 +329,7 @@ DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper, }else{ MED::TStringVector anAttrDescs (1, ""); // 1 attribute with empty description, MED::TIntVector anAttrIds (1, myId); // Id=0, - MED::TIntVector anAttrVals (1); - anAttrVals[0] = myGroupAttributVal != 0? myGroupAttributVal: myId; + MED::TIntVector anAttrVals (1, myGroupAttributVal); anInfo = theWrapper->CrFamilyInfo(theMeshInfo, aValue, myId, diff --git a/src/DriverMED/DriverMED_Family.h b/src/DriverMED/DriverMED_Family.h index 907cd8ea6..64ad65a56 100644 --- a/src/DriverMED/DriverMED_Family.h +++ b/src/DriverMED/DriverMED_Family.h @@ -28,6 +28,8 @@ #ifndef _INCLUDE_DRIVERMED_FAMILY #define _INCLUDE_DRIVERMED_FAMILY +#include "SMESH_DriverMED.hxx" + #include "SMDS_Mesh.hxx" #include "SMESHDS_GroupBase.hxx" #include "SMESHDS_SubMesh.hxx" @@ -50,7 +52,7 @@ typedef std::map SMESHDS_SubMeshPtrMap; typedef std::list SMESHDS_GroupBasePtrList; typedef std::set ElementsSet; -class DriverMED_Family +class MESHDRIVERMED_EXPORT DriverMED_Family { public: diff --git a/src/DriverMED/DriverMED_R_SMDS_Mesh.h b/src/DriverMED/DriverMED_R_SMDS_Mesh.h index dc92dd864..6d488bed5 100644 --- a/src/DriverMED/DriverMED_R_SMDS_Mesh.h +++ b/src/DriverMED/DriverMED_R_SMDS_Mesh.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERMED_R_SMDS_MESH #define _INCLUDE_DRIVERMED_R_SMDS_MESH +#include "SMESH_DriverMED.hxx" + #include "Driver_SMDS_Mesh.h" -class DriverMED_R_SMDS_Mesh: public Driver_SMDS_Mesh +class MESHDRIVERMED_EXPORT DriverMED_R_SMDS_Mesh: public Driver_SMDS_Mesh {}; #endif diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Document.h b/src/DriverMED/DriverMED_R_SMESHDS_Document.h index 82b97f5a5..0672ebf37 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Document.h +++ b/src/DriverMED/DriverMED_R_SMESHDS_Document.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERMED_R_SMESHDS_DOCUMENT #define _INCLUDE_DRIVERMED_R_SMESHDS_DOCUMENT +#include "SMESH_DriverMED.hxx" + #include "Driver_Document.h" -class DriverMED_R_SMESHDS_Document : public Driver_Document +class MESHDRIVERMED_EXPORT DriverMED_R_SMESHDS_Document : public Driver_Document {}; #endif diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.h b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.h index ac3d0b130..4bd85556e 100644 --- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.h +++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.h @@ -27,6 +27,8 @@ #ifndef _INCLUDE_DRIVERMED_R_SMESHDS_MESH #define _INCLUDE_DRIVERMED_R_SMESHDS_MESH +#include "SMESH_DriverMED.hxx" + #include "Driver_SMESHDS_Mesh.h" #include "DriverMED_Family.h" @@ -38,7 +40,7 @@ class SMESHDS_SubMesh; typedef std::pair< std::string, SMDSAbs_ElementType > TNameAndType; -class DriverMED_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh +class MESHDRIVERMED_EXPORT DriverMED_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh { public: virtual Status Perform(); diff --git a/src/DriverMED/DriverMED_W_SMDS_Mesh.h b/src/DriverMED/DriverMED_W_SMDS_Mesh.h index f21becd9d..b36b663e9 100644 --- a/src/DriverMED/DriverMED_W_SMDS_Mesh.h +++ b/src/DriverMED/DriverMED_W_SMDS_Mesh.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERMED_W_SMDS_MESH #define _INCLUDE_DRIVERMED_W_SMDS_MESH +#include "SMESH_DriverMED.hxx" + #include "Driver_SMDS_Mesh.h" -class DriverMED_W_SMDS_Mesh: public Driver_SMDS_Mesh +class MESHDRIVERMED_EXPORT DriverMED_W_SMDS_Mesh: public Driver_SMDS_Mesh {}; #endif diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Document.h b/src/DriverMED/DriverMED_W_SMESHDS_Document.h index 0a0a77e1e..681a99ae4 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Document.h +++ b/src/DriverMED/DriverMED_W_SMESHDS_Document.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERMED_W_SMESHDS_DOCUMENT #define _INCLUDE_DRIVERMED_W_SMESHDS_DOCUMENT +#include "SMESH_DriverMED.hxx" + #include "Driver_Document.h" -class DriverMED_W_SMESHDS_Document : public Driver_Document +class MESHDRIVERMED_EXPORT DriverMED_W_SMESHDS_Document : public Driver_Document {}; #endif diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx index f6cf1ff78..aa02b4022 100644 --- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx +++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx @@ -987,9 +987,11 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform() } catch(const std::exception& exc) { INFOS("Follow exception was cought:\n\t"< -class DriverSTL_R_SMDS_Mesh: public Driver_SMDS_Mesh +class MESHDRIVERSTL_EXPORT DriverSTL_R_SMDS_Mesh: public Driver_SMDS_Mesh { public: DriverSTL_R_SMDS_Mesh(); diff --git a/src/DriverSTL/DriverSTL_W_SMDS_Mesh.h b/src/DriverSTL/DriverSTL_W_SMDS_Mesh.h index facfa2ea3..e320415ff 100644 --- a/src/DriverSTL/DriverSTL_W_SMDS_Mesh.h +++ b/src/DriverSTL/DriverSTL_W_SMDS_Mesh.h @@ -27,10 +27,12 @@ #ifndef _INCLUDE_DRIVERSTL_W_SMDS_MESH #define _INCLUDE_DRIVERSTL_W_SMDS_MESH +#include "SMESH_DriverSTL.hxx" + #include "Driver_SMDS_Mesh.h" #include -class DriverSTL_W_SMDS_Mesh: public Driver_SMDS_Mesh +class MESHDRIVERSTL_EXPORT DriverSTL_W_SMDS_Mesh: public Driver_SMDS_Mesh { public: diff --git a/src/DriverSTL/Makefile.in b/src/DriverSTL/Makefile.in index bf0653e1b..76c594f62 100644 --- a/src/DriverSTL/Makefile.in +++ b/src/DriverSTL/Makefile.in @@ -35,7 +35,7 @@ VPATH=.:@srcdir@ @COMMENCE@ # header files -EXPORT_HEADERS= DriverSTL_R_SMDS_Mesh.h DriverSTL_W_SMDS_Mesh.h +EXPORT_HEADERS= DriverSTL_R_SMDS_Mesh.h DriverSTL_W_SMDS_Mesh.h SMESH_DriverSTL.hxx # Libraries targets LIB = libMeshDriverSTL.la diff --git a/src/DriverSTL/SMESH_DriverSTL.hxx b/src/DriverSTL/SMESH_DriverSTL.hxx new file mode 100755 index 000000000..2204a4a05 --- /dev/null +++ b/src/DriverSTL/SMESH_DriverSTL.hxx @@ -0,0 +1,39 @@ +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESH_DriverSTL.hxx +// Author : Alexander A. BORODIN +// Module : SMESH + +#ifndef _SMESH_DriverSTL_HXX_ +#define _SMESH_DriverSTL_HXX_ + +#ifdef WNT + #if defined MESHDRIVERSTL_EXPORTS + #define MESHDRIVERSTL_EXPORT __declspec( dllexport ) + #else + #define MESHDRIVERSTL_EXPORT __declspec( dllimport ) + #endif +#else + #define MESHDRIVERSTL_EXPORT +#endif + +#endif diff --git a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.h b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.h index 474f3713a..d08b98f55 100644 --- a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.h +++ b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.h @@ -20,6 +20,8 @@ #ifndef _INCLUDE_DRIVERUNV_R_SMDS_MESH #define _INCLUDE_DRIVERUNV_R_SMDS_MESH +#include "SMESH_DriverUNV.hxx" + #include "Driver_SMDS_Mesh.h" #include #include @@ -32,7 +34,10 @@ class SMDS_MeshGroup; typedef std::map TGroupNamesMap; typedef std::map TGroupIdMap; -class DriverUNV_R_SMDS_Mesh: public Driver_SMDS_Mesh +typedef std::map TGroupNamesMap; +typedef std::map TGroupIdMap; + +class MESHDRIVERUNV_EXPORT DriverUNV_R_SMDS_Mesh: public Driver_SMDS_Mesh { public: DriverUNV_R_SMDS_Mesh():Driver_SMDS_Mesh(),myGroup(0) {}; diff --git a/src/DriverUNV/DriverUNV_R_SMESHDS_Document.h b/src/DriverUNV/DriverUNV_R_SMESHDS_Document.h index cbd3891c5..d99847660 100644 --- a/src/DriverUNV/DriverUNV_R_SMESHDS_Document.h +++ b/src/DriverUNV/DriverUNV_R_SMESHDS_Document.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERUNV_R_SMESHDS_DOCUMENT #define _INCLUDE_DRIVERUNV_R_SMESHDS_DOCUMENT +#include "SMESH_DriverUNV.hxx" + #include "Driver_Document.h" -class DriverUNV_R_SMESHDS_Document: public Driver_Document +class MESHDRIVERUNV_EXPORT DriverUNV_R_SMESHDS_Document: public Driver_Document {}; #endif diff --git a/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.h b/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.h index dfb4d92da..6381ddd08 100644 --- a/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.h +++ b/src/DriverUNV/DriverUNV_R_SMESHDS_Mesh.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERUNV_R_SMESHDS_MESH #define _INCLUDE_DRIVERUNV_R_SMESHDS_MESH +#include "SMESH_DriverUNV.hxx" + #include "Driver_SMESHDS_Mesh.h" -class DriverUNV_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh +class MESHDRIVERUNV_EXPORT DriverUNV_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh {}; #endif diff --git a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx index eeb2ff4b8..b9554e306 100644 --- a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx +++ b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx @@ -35,6 +35,7 @@ #include "UNV_Utilities.hxx" using namespace std; +using namespace UNV; namespace{ typedef std::vector TConnect; @@ -292,12 +293,19 @@ Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform() } UNV2417::Write(out_stream,aDataSet2417); }*/ + + out_stream.flush(); + out_stream.close(); + if (!check_file(myFile)) + EXCEPTION(runtime_error,"ERROR: Output file not good."); } catch(const std::exception& exc){ INFOS("Follow exception was cought:\n\t"< @@ -27,7 +29,7 @@ typedef std::list TGroupList; -class DriverUNV_W_SMDS_Mesh: public Driver_SMDS_Mesh +class MESHDRIVERUNV_EXPORT DriverUNV_W_SMDS_Mesh: public Driver_SMDS_Mesh { public: virtual Status Perform(); diff --git a/src/DriverUNV/DriverUNV_W_SMESHDS_Document.h b/src/DriverUNV/DriverUNV_W_SMESHDS_Document.h index eb138f1ee..10575d3a8 100644 --- a/src/DriverUNV/DriverUNV_W_SMESHDS_Document.h +++ b/src/DriverUNV/DriverUNV_W_SMESHDS_Document.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERUNV_W_SMESHDS_DOCUMENT #define _INCLUDE_DRIVERUNV_W_SMESHDS_DOCUMENT +#include "SMESH_DriverUNV.hxx" + #include "Driver_Document.h" -class DriverUNV_W_SMESHDS_Document : public Driver_Document +class MESHDRIVERUNV_EXPORT DriverUNV_W_SMESHDS_Document : public Driver_Document {}; #endif diff --git a/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.h b/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.h index 9cf94b48b..fc1f5e650 100644 --- a/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.h +++ b/src/DriverUNV/DriverUNV_W_SMESHDS_Mesh.h @@ -20,9 +20,11 @@ #ifndef _INCLUDE_DRIVERUNV_W_SMESHDS_MESH #define _INCLUDE_DRIVERUNV_W_SMESHDS_MESH +#include "SMESH_DriverUNV.hxx" + #include "Driver_SMESHDS_Mesh.h" -class DriverUNV_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh +class MESHDRIVERUNV_EXPORT DriverUNV_W_SMESHDS_Mesh: public Driver_SMESHDS_Mesh {}; #endif diff --git a/src/DriverUNV/Makefile.in b/src/DriverUNV/Makefile.in index 688764a12..58fddc89c 100644 --- a/src/DriverUNV/Makefile.in +++ b/src/DriverUNV/Makefile.in @@ -40,7 +40,8 @@ EXPORT_HEADERS= DriverUNV_R_SMDS_Mesh.h \ DriverUNV_R_SMESHDS_Document.h \ DriverUNV_W_SMDS_Mesh.h \ DriverUNV_W_SMESHDS_Mesh.h \ - DriverUNV_W_SMESHDS_Document.h + DriverUNV_W_SMESHDS_Document.h \ + SMESH_DriverUNV.hxx # Libraries targets LIB = libMeshDriverUNV.la diff --git a/src/DriverUNV/SMESH_DriverUNV.hxx b/src/DriverUNV/SMESH_DriverUNV.hxx new file mode 100755 index 000000000..32f04a12d --- /dev/null +++ b/src/DriverUNV/SMESH_DriverUNV.hxx @@ -0,0 +1,39 @@ +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESH_DriverUNV.hxx +// Author : Alexander A. BORODIN +// Module : SMESH + +#ifndef _SMESH_DriverUNV_HXX_ +#define _SMESH_DriverUNV_HXX_ + +#ifdef WNT + #if defined MESHDRIVERUNV_EXPORTS + #define MESHDRIVERUNV_EXPORT __declspec( dllexport ) + #else + #define MESHDRIVERUNV_EXPORT __declspec( dllimport ) + #endif +#else + #define MESHDRIVERUNV_EXPORT +#endif + +#endif diff --git a/src/DriverUNV/UNV2411_Structure.hxx b/src/DriverUNV/UNV2411_Structure.hxx index c3347b3ae..8503e6446 100644 --- a/src/DriverUNV/UNV2411_Structure.hxx +++ b/src/DriverUNV/UNV2411_Structure.hxx @@ -20,12 +20,14 @@ #ifndef UNV2411_Structure_HeaderFile #define UNV2411_Structure_HeaderFile +#include "SMESH_DriverUNV.hxx" + #include #include namespace UNV2411{ - struct TRecord{ + struct MESHDRIVERUNV_EXPORT TRecord{ TRecord(); int exp_coord_sys_num; // export coordinate system number int disp_coord_sys_num; // displacement coordinate system number @@ -36,9 +38,11 @@ namespace UNV2411{ typedef int TNodeLab; // type of node label typedef std::map TDataSet; - void Read(std::ifstream& in_stream, TDataSet& theDataSet); + MESHDRIVERUNV_EXPORT void + Read(std::ifstream& in_stream, TDataSet& theDataSet); - void Write(std::ofstream& out_stream, const TDataSet& theDataSet); + MESHDRIVERUNV_EXPORT void + Write(std::ofstream& out_stream, const TDataSet& theDataSet); }; diff --git a/src/DriverUNV/UNV2412_Structure.hxx b/src/DriverUNV/UNV2412_Structure.hxx index 7b36a1d91..8e1d50f48 100644 --- a/src/DriverUNV/UNV2412_Structure.hxx +++ b/src/DriverUNV/UNV2412_Structure.hxx @@ -20,6 +20,8 @@ #ifndef UNV2412_Structure_HeaderFile #define UNV2412_Structure_HeaderFile +#include "SMESH_DriverUNV.hxx" + #include #include #include @@ -29,7 +31,7 @@ namespace UNV2412{ typedef std::vector TNodeLabels; // Nodal connectivities - struct TRecord{ + struct MESHDRIVERUNV_EXPORT TRecord{ TRecord(); int fe_descriptor_id; // FE descriptor id @@ -47,13 +49,18 @@ namespace UNV2412{ typedef int TElementLab; // type of element label typedef std::map TDataSet; - void Read(std::ifstream& in_stream, TDataSet& theDataSet); + MESHDRIVERUNV_EXPORT void + Read(std::ifstream& in_stream, TDataSet& theDataSet); - void Write(std::ofstream& out_stream, const TDataSet& theDataSet); + MESHDRIVERUNV_EXPORT void + Write(std::ofstream& out_stream, const TDataSet& theDataSet); - bool IsBeam(int theFeDescriptorId); - bool IsFace(int theFeDescriptorId); - bool IsVolume(int theFeDescriptorId); + MESHDRIVERUNV_EXPORT bool + IsBeam(int theFeDescriptorId); + MESHDRIVERUNV_EXPORT bool + IsFace(int theFeDescriptorId); + MESHDRIVERUNV_EXPORT bool + IsVolume(int theFeDescriptorId); }; diff --git a/src/DriverUNV/UNV_Utilities.hxx b/src/DriverUNV/UNV_Utilities.hxx index 6f8598341..cb6135351 100644 --- a/src/DriverUNV/UNV_Utilities.hxx +++ b/src/DriverUNV/UNV_Utilities.hxx @@ -20,8 +20,11 @@ #ifndef MED_Utilities_HeaderFile #define MED_Utilities_HeaderFile +#include "SMESH_DriverUNV.hxx" + #include #include +#include #include #include #include @@ -29,7 +32,7 @@ namespace UNV{ using namespace std; - class PrefixPrinter{ + class MESHDRIVERUNV_EXPORT PrefixPrinter{ static int myCounter; public: PrefixPrinter(); @@ -87,6 +90,24 @@ namespace UNV{ } return atof (number.c_str()); } + + /** + * @returns \p false when file is incorrect, \p true otherwise. + * Check file with name \p theFileName for correct terminate + * string, i.e. the next to the last line is equal to " -1", + */ + inline bool check_file(const std::string theFileName) + { + std::ifstream in_stream(theFileName.c_str()); + if (!in_stream) + return false; + std::string olds, news; + while (!in_stream.eof()){ + olds = news; + std::getline(in_stream, news, '\n'); + } + return (olds == " -1"); + } }; diff --git a/src/MEFISTO2/Rn.h b/src/MEFISTO2/Rn.h index 9aafe707b..aa69c4aaa 100755 --- a/src/MEFISTO2/Rn.h +++ b/src/MEFISTO2/Rn.h @@ -66,7 +66,15 @@ typedef unsigned long int N; //le type Z des nombres entiers relatifs //========= -typedef long int Z; +// 64-bit porting: "long" replaced with "int". +// On 64-bit, C++ long type is 8 byte long. MEFISTO2D C code calls several Fortran subroutines passing +// arguments of this type, however Fortran knows nothing about changed size of arguments, +// therefore stack gets corrupted. With "int" used instead of "long", Fortran calls from C do no harm to the stack +// After this modification, behavior on 32-bit platforms does not change: on all platforms supported by +// SALOME 3, "int" and "long" have the same size of 4 bytes. +//======== +//typedef long int Z; +typedef int Z; //le type R des nombres "reels" //========= diff --git a/src/MEFISTO2/aptrte.cxx b/src/MEFISTO2/aptrte.cxx index 46429ead7..9f4723322 100755 --- a/src/MEFISTO2/aptrte.cxx +++ b/src/MEFISTO2/aptrte.cxx @@ -32,7 +32,12 @@ using namespace std; extern "C" { R aretemaxface_; - R areteideale_( R3 xyz, R3 direction ) + MEFISTO2D_EXPORT + R + #ifdef WIN32 + __stdcall + #endif + areteideale()//( R3 xyz, R3 direction ) { return aretemaxface_; } @@ -187,14 +192,14 @@ void aptrte( Z nutysu, R aretmx, mnsoar = new Z[mosoar*mxsoar]; if( mnsoar==NULL ) goto ERREUR; //initialiser le tableau mnsoar pour le hachage des aretes - insoar_( mxsomm, mosoar, mxsoar, n1soar, mnsoar ); + insoar( mxsomm, mosoar, mxsoar, n1soar, mnsoar ); // mnarst( mxsomm ) numero mnsoar d'une arete pour chacun des sommets if( mnarst!=NULL ) delete [] mnarst; mnarst = new Z[1+mxsomm]; if( mnarst==NULL ) goto ERREUR; n = 1+mxsomm; - azeroi_( n, mnarst ); + azeroi( n, mnarst ); // mnslig( mxsomm ) no de sommet dans sa ligne pour chaque sommet frontalier // ou no du point si interne forc'e par l'utilisateur @@ -202,7 +207,7 @@ void aptrte( Z nutysu, R aretmx, if( mnslig!=NULL ) delete [] mnslig; mnslig = new Z[mxsomm]; if( mnslig==NULL ) goto ERREUR; - azeroi_( mxsomm, mnslig ); + azeroi( mxsomm, mnslig ); // initialisation des aretes frontalieres de la triangulation future // renumerotation des sommets des aretes des lignes pour la triangulation @@ -222,7 +227,7 @@ void aptrte( Z nutysu, R aretmx, ns0 = nudslf[n-1]; mnpxyd[ns0].x = uvslf[ns0].x; mnpxyd[ns0].y = uvslf[ns0].y; - mnpxyd[ns0].z = areteideale_( mnpxyd[ns0], direction ); + mnpxyd[ns0].z = areteideale();//( mnpxyd[ns0], direction ); // MESSAGE("Sommet " << ns0 << ": " << mnpxyd[ns0].x // << " " << mnpxyd[ns0].y << " longueur arete=" << mnpxyd[ns0].z); @@ -244,7 +249,7 @@ void aptrte( Z nutysu, R aretmx, //le numero n de la ligne du sommet et son numero ns1 dans la ligne mnslig[ns0-1] = 1000000 * n + ns1-nudslf[n-1]; - fasoar_( ns1, ns2, moins1, moins1, n, + fasoar( ns1, ns2, moins1, moins1, n, mosoar, mxsoar, n1soar, mnsoar, mnarst, noar0, ierr ); //pas de test sur ierr car pas de saturation possible a ce niveau @@ -274,7 +279,7 @@ void aptrte( Z nutysu, R aretmx, ns = ns1 - 1; mnpxyd[ns].x = uvslf[ns].x; mnpxyd[ns].y = uvslf[ns].y; - mnpxyd[ns].z = areteideale_( mnpxyd[ns], direction ); + mnpxyd[ns].z = areteideale();//( mnpxyd[ns], direction ); // MESSAGE("Sommet " << ns << ": " << mnpxyd[ns].x // << " " << mnpxyd[ns].y << " longueur arete=" << mnpxyd[ns].z); @@ -288,7 +293,7 @@ void aptrte( Z nutysu, R aretmx, mnslig[ns] = 1000000 * n + ns1-nudslf[n-1]; //ajout de l'arete dans la liste - fasoar_( ns1, ns2, moins1, moins1, n, + fasoar( ns1, ns2, moins1, moins1, n, mosoar, mxsoar, n1soar, mnsoar, mnarst, noar, ierr ); //pas de test sur ierr car pas de saturation possible a ce niveau @@ -333,7 +338,7 @@ void aptrte( Z nutysu, R aretmx, //les 2 coordonnees du point i de sommet nbs mnpxyd[ns1].x = uvpti[i].x; mnpxyd[ns1].y = uvpti[i].y; - mnpxyd[ns1].z = areteideale_( mnpxyd[ns1], direction ); + mnpxyd[ns1].z = areteideale();//( mnpxyd[ns1], direction ); //le numero i du point interne mnslig[ns1] = i+1; ns1++; @@ -356,7 +361,7 @@ void aptrte( Z nutysu, R aretmx, if( mntree==NULL ) goto ERREUR; //initialisation du tableau letree et ajout dans letree des sommets 1 a nbsomm - teajte_( mxsomm, nbsomm, mnpxyd, comxmi, aretmx, mxtree, mntree, ierr ); + teajte( mxsomm, nbsomm, mnpxyd, comxmi, aretmx, mxtree, mntree, ierr ); comxmi[0].z=0; comxmi[1].z=0; @@ -384,7 +389,7 @@ void aptrte( Z nutysu, R aretmx, mnqueu = new Z[mxqueu]; if( mnqueu==NULL) goto ERREUR; - tehote_( nutysu, nbarpi, mxsomm, nbsomm, mnpxyd, + tehote( nutysu, nbarpi, mxsomm, nbsomm, mnpxyd, comxmi, aretmx, mntree, mxqueu, mnqueu, ierr ); @@ -411,7 +416,7 @@ void aptrte( Z nutysu, R aretmx, // trianguler les triangles equilateraux feuilles a partir de leurs 3 sommets // et des points de la frontiere, des points internes imposes interieurs // ========================================================================== - tetrte_( comxmi, aretmx, nbarpi, mxsomm, mnpxyd, + tetrte( comxmi, aretmx, nbarpi, mxsomm, mnpxyd, mxqueu, mnqueu, mntree, mosoar, mxsoar, n1soar, mnsoar, moartr, mxartr, n1artr, mnartr, mnarst, ierr ); @@ -440,8 +445,8 @@ void aptrte( Z nutysu, R aretmx, // avec echange des 2 diagonales afin de rendre la triangulation delaunay // ====================================================================== // formation du chainage 6 des aretes internes a echanger eventuellement - aisoar_( mosoar, mxsoar, mnsoar, na ); - tedela_( mnpxyd, mnarst, + aisoar( mosoar, mxsoar, mnsoar, na ); + tedela( mnpxyd, mnarst, mosoar, mxsoar, n1soar, mnsoar, na, moartr, mxartr, n1artr, mnartr, n ); @@ -472,7 +477,7 @@ void aptrte( Z nutysu, R aretmx, mnarcf2 = new Z[mxarcf]; if( mnarcf2 == NULL ) goto ERREUR; - terefr_( nbarpi, mnpxyd, + terefr( nbarpi, mnpxyd, mosoar, mxsoar, n1soar, mnsoar, moartr, n1artr, mnartr, mnarst, mxarcf, mn1arcf, mnarcf, mnarcf1, mnarcf2, @@ -513,7 +518,7 @@ void aptrte( Z nutysu, R aretmx, for (n=0; nSetVisibility(false); myScalarBarActor->SetLookupTable(myLookupTable); + //Fix for Bug 13314: + //Incorrect "Min value" in Scalar Bar in Mesh: + myScalarBarActor->SetLabelFormat("%.4g"); + mgr = SUIT_Session::session()->resourceMgr(); if( !mgr ) return; diff --git a/src/OBJECT/SMESH_Actor.h b/src/OBJECT/SMESH_Actor.h index ca273d3f3..04dd4cead 100644 --- a/src/OBJECT/SMESH_Actor.h +++ b/src/OBJECT/SMESH_Actor.h @@ -39,7 +39,7 @@ class vtkScalarBarActor; class vtkPlane; class vtkImplicitBoolean; -class SMESH_Actor: public SALOME_Actor +class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor { static SMESH_Actor* New() { return NULL;} diff --git a/src/OBJECT/SMESH_ActorUtils.h b/src/OBJECT/SMESH_ActorUtils.h index 438b0e9b6..0370d60e1 100644 --- a/src/OBJECT/SMESH_ActorUtils.h +++ b/src/OBJECT/SMESH_ActorUtils.h @@ -20,6 +20,8 @@ #ifndef SMESH_ACTORUTILS_H #define SMESH_ACTORUTILS_H +#include "SMESH_Object.h" + #include #include @@ -29,21 +31,24 @@ class vtkUnstructuredGrid; namespace SMESH { - +SMESHOBJECT_EXPORT vtkFloatingPointType GetFloat( const QString& theValue, vtkFloatingPointType theDefault = 0 ); +SMESHOBJECT_EXPORT vtkFloatingPointType GetFloat( const QString& theName, const QString& theSection, vtkFloatingPointType theDefault = 0 ); +SMESHOBJECT_EXPORT QColor GetColor( const QString& theSect, const QString& theName, const QColor&t = QColor() ); +SMESHOBJECT_EXPORT void GetColor( const QString& theSect, const QString& theName, @@ -52,6 +57,7 @@ namespace SMESH int&, const QColor&t = QColor() ); +SMESHOBJECT_EXPORT void GetColor( const QString& theSect, const QString& theName, @@ -60,6 +66,7 @@ namespace SMESH vtkFloatingPointType&, const QColor&t = QColor() ); +SMESHOBJECT_EXPORT void WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid, const char* theFileName); diff --git a/src/OBJECT/SMESH_DeviceActor.h b/src/OBJECT/SMESH_DeviceActor.h index a5e0b1656..16664fe0c 100644 --- a/src/OBJECT/SMESH_DeviceActor.h +++ b/src/OBJECT/SMESH_DeviceActor.h @@ -54,7 +54,7 @@ class VTKViewer_ExtractUnstructuredGrid; class SMESH_ExtractGeometry; -class SMESH_DeviceActor: public vtkLODActor{ +class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{ friend class SMESH_ActorDef; public: diff --git a/src/OBJECT/SMESH_ExtractGeometry.h b/src/OBJECT/SMESH_ExtractGeometry.h index f1bcbaca0..97435e05e 100644 --- a/src/OBJECT/SMESH_ExtractGeometry.h +++ b/src/OBJECT/SMESH_ExtractGeometry.h @@ -20,13 +20,14 @@ #ifndef SALOME_ExtractGeometry_HeaderFile #define SALOME_ExtractGeometry_HeaderFile +#include "SMESH_Object.h" + #include #include #include "VTKViewer.h" -class SMESH_ExtractGeometry : public vtkExtractGeometry -{ +class SMESHOBJECT_EXPORT SMESH_ExtractGeometry : public vtkExtractGeometry{ public: vtkTypeMacro(SMESH_ExtractGeometry,vtkExtractGeometry); diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx index 1e52ccb01..4fdbcf0e6 100644 --- a/src/OBJECT/SMESH_Object.cxx +++ b/src/OBJECT/SMESH_Object.cxx @@ -456,7 +456,7 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId, if ( theEdgeNum < 0 || theEdgeNum > 3 || nbNodes != 3 && nbNodes != 4 || theEdgeNum > nbNodes ) return false; - int anIds[ nbNodes ]; + vector anIds( nbNodes ); SMDS_ElemIteratorPtr anIter = anElem->nodesIterator(); int i = 0; while( anIter->more() ) diff --git a/src/OBJECT/SMESH_Object.h b/src/OBJECT/SMESH_Object.h index 44b737ba5..9e2f49dcf 100644 --- a/src/OBJECT/SMESH_Object.h +++ b/src/OBJECT/SMESH_Object.h @@ -29,6 +29,16 @@ #ifndef SMESH_OBJECT_H #define SMESH_OBJECT_H +#ifdef WNT + #if defined SMESHOBJECT_EXPORTS + #define SMESHOBJECT_EXPORT __declspec( dllexport ) + #else + #define SMESHOBJECT_EXPORT __declspec( dllimport ) + #endif +#else + #define SMESHOBJECT_EXPORT +#endif + #include #include @@ -42,7 +52,7 @@ class vtkUnstructuredGrid; Class : SMESH_VisualObj Description : Base class for all mesh objects to be visuilised */ -class SMESH_VisualObj +class SMESHOBJECT_EXPORT SMESH_VisualObj { public: virtual void Update( int theIsClear = true ) = 0; diff --git a/src/OBJECT/SMESH_ObjectDef.h b/src/OBJECT/SMESH_ObjectDef.h index fff2f819d..327664867 100644 --- a/src/OBJECT/SMESH_ObjectDef.h +++ b/src/OBJECT/SMESH_ObjectDef.h @@ -52,7 +52,7 @@ class SMDS_MeshElement; Class : SMESH_VisualObj Description : Base class for all mesh objects to be visuilised */ -class SMESH_VisualObjDef: public SMESH_VisualObj +class SMESHOBJECT_EXPORT SMESH_VisualObjDef: public SMESH_VisualObj { public: typedef std::list TEntityList; @@ -105,7 +105,7 @@ private: Description : Class for visualisation of mesh */ -class SMESH_MeshObj: public SMESH_VisualObjDef +class SMESHOBJECT_EXPORT SMESH_MeshObj: public SMESH_VisualObjDef { public: @@ -135,7 +135,7 @@ protected: Description : Base class for visualisation of submeshes and groups */ -class SMESH_SubMeshObj: public SMESH_VisualObjDef +class SMESHOBJECT_EXPORT SMESH_SubMeshObj: public SMESH_VisualObjDef { public: @@ -159,7 +159,7 @@ protected: Description : Class for visualisation of groups */ -class SMESH_GroupObj: public SMESH_SubMeshObj +class SMESHOBJECT_EXPORT SMESH_GroupObj: public SMESH_SubMeshObj { public: SMESH_GroupObj( SMESH::SMESH_GroupBase_ptr, SMESH_MeshObj* ); @@ -180,7 +180,7 @@ private: Description : Class for visualisation of submeshes */ -class SMESH_subMeshObj : public SMESH_SubMeshObj +class SMESHOBJECT_EXPORT SMESH_subMeshObj : public SMESH_SubMeshObj { public: diff --git a/src/SMDS/Makefile.in b/src/SMDS/Makefile.in index bfb94b798..01df90ab4 100644 --- a/src/SMDS/Makefile.in +++ b/src/SMDS/Makefile.in @@ -107,7 +107,8 @@ EXPORT_HEADERS= \ SMDS_QuadraticEdge.hxx \ SMDS_QuadraticFaceOfNodes.hxx \ SMDS_QuadraticVolumeOfNodes.hxx \ - SMDS_SetIterator.hxx + SMDS_SetIterator.hxx \ + SMESH_SMDS.hxx # additionnal information to compil and link file CPPFLAGS += $(KERNEL_CXXFLAGS) $(OCC_INCLUDES) $(BOOST_CPPFLAGS) diff --git a/src/SMDS/SMDS_EdgePosition.hxx b/src/SMDS/SMDS_EdgePosition.hxx index 597fedba3..a89e77400 100644 --- a/src/SMDS/SMDS_EdgePosition.hxx +++ b/src/SMDS/SMDS_EdgePosition.hxx @@ -27,21 +27,11 @@ #ifndef _SMDS_EdgePosition_HeaderFile #define _SMDS_EdgePosition_HeaderFile -#include "SMDS_Position.hxx" - -//#ifdef WNT -//#include -//#else -//#define SALOME_WNT_EXPORT -//#endif +#include "SMESH_SMDS.hxx" -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif +#include "SMDS_Position.hxx" -class SMDS_WNT_EXPORT SMDS_EdgePosition:public SMDS_Position +class SMDS_EXPORT SMDS_EdgePosition:public SMDS_Position { public: diff --git a/src/SMDS/SMDS_FaceOfEdges.hxx b/src/SMDS/SMDS_FaceOfEdges.hxx index 10523ec6c..4a0a8850c 100644 --- a/src/SMDS/SMDS_FaceOfEdges.hxx +++ b/src/SMDS/SMDS_FaceOfEdges.hxx @@ -22,6 +22,8 @@ #ifndef _SMDS_FaceOfEdges_HeaderFile #define _SMDS_FaceOfEdges_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshFace.hxx" #include "SMDS_MeshEdge.hxx" #include "SMDS_Iterator.hxx" @@ -29,7 +31,7 @@ #include -class SMDS_FaceOfEdges:public SMDS_MeshFace +class SMDS_EXPORT SMDS_FaceOfEdges:public SMDS_MeshFace { public: void Print(std::ostream & OS) const; diff --git a/src/SMDS/SMDS_FaceOfNodes.hxx b/src/SMDS/SMDS_FaceOfNodes.hxx index f1a3010b8..7779c6ffd 100644 --- a/src/SMDS/SMDS_FaceOfNodes.hxx +++ b/src/SMDS/SMDS_FaceOfNodes.hxx @@ -22,13 +22,15 @@ #ifndef _SMDS_FaceOfNodes_HeaderFile #define _SMDS_FaceOfNodes_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshFace.hxx" #include "SMDS_MeshNode.hxx" #include "SMDS_Iterator.hxx" #include -class SMDS_FaceOfNodes:public SMDS_MeshFace +class SMDS_EXPORT SMDS_FaceOfNodes:public SMDS_MeshFace { public: void Print(std::ostream & OS) const; diff --git a/src/SMDS/SMDS_FacePosition.hxx b/src/SMDS/SMDS_FacePosition.hxx index f7032531b..d928efe58 100644 --- a/src/SMDS/SMDS_FacePosition.hxx +++ b/src/SMDS/SMDS_FacePosition.hxx @@ -27,21 +27,11 @@ #ifndef _SMDS_FacePosition_HeaderFile #define _SMDS_FacePosition_HeaderFile -#include "SMDS_Position.hxx" - -//#ifdef WNT -//#include -//#else -//#define SALOME_WNT_EXPORT -//#endif +#include "SMESH_SMDS.hxx" -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif +#include "SMDS_Position.hxx" -class SMDS_WNT_EXPORT SMDS_FacePosition:public SMDS_Position +class SMDS_EXPORT SMDS_FacePosition:public SMDS_Position { public: diff --git a/src/SMDS/SMDS_Iterator.hxx b/src/SMDS/SMDS_Iterator.hxx index 371bc0e1a..5d17b6fa2 100644 --- a/src/SMDS/SMDS_Iterator.hxx +++ b/src/SMDS/SMDS_Iterator.hxx @@ -22,11 +22,13 @@ #ifndef _SMDS_Iterator_HeaderFile #define _SMDS_Iterator_HeaderFile +#include "SMESH_SMDS.hxx" + /////////////////////////////////////////////////////////////////////////////// ///Abstract class for iterators ///@author Jerome Robert /////////////////////////////////////////////////////////////////////////////// -template class SMDS_Iterator +template class SMDS_EXPORT SMDS_Iterator { public: /// Return true if and only if there are other object in this iterator diff --git a/src/SMDS/SMDS_IteratorOfElements.hxx b/src/SMDS/SMDS_IteratorOfElements.hxx index de64f67c3..02569d81a 100644 --- a/src/SMDS/SMDS_IteratorOfElements.hxx +++ b/src/SMDS/SMDS_IteratorOfElements.hxx @@ -19,12 +19,14 @@ // // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +#include "SMESH_SMDS.hxx" + #include "SMDS_Iterator.hxx" #include "SMDS_MeshElement.hxx" #include -class SMDS_IteratorOfElements:public SMDS_ElemIterator +class SMDS_EXPORT SMDS_IteratorOfElements:public SMDS_ElemIterator { public: ///////////////////////////////////////////////////////////////////////////// diff --git a/src/SMDS/SMDS_Mesh.hxx b/src/SMDS/SMDS_Mesh.hxx index 130e05d44..2cdf3749b 100644 --- a/src/SMDS/SMDS_Mesh.hxx +++ b/src/SMDS/SMDS_Mesh.hxx @@ -27,6 +27,8 @@ #ifndef _SMDS_Mesh_HeaderFile #define _SMDS_Mesh_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshNode.hxx" #include "SMDS_MeshEdge.hxx" #include "SMDS_MeshFace.hxx" @@ -35,22 +37,11 @@ #include "SMDS_ElemIterator.hxx" #include -//#ifdef WNT -//#include -//#else -//#define SALOME_WNT_EXPORT -//#endif -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif - #include #include #include -class SMDS_WNT_EXPORT SMDS_Mesh:public SMDS_MeshObject{ +class SMDS_EXPORT SMDS_Mesh:public SMDS_MeshObject{ public: SMDS_Mesh(); diff --git a/src/SMDS/SMDS_MeshEdge.hxx b/src/SMDS/SMDS_MeshEdge.hxx index 75ff74e74..10a1f66d8 100644 --- a/src/SMDS/SMDS_MeshEdge.hxx +++ b/src/SMDS/SMDS_MeshEdge.hxx @@ -27,10 +27,12 @@ #ifndef _SMDS_MeshEdge_HeaderFile #define _SMDS_MeshEdge_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshElement.hxx" #include -class SMDS_MeshEdge:public SMDS_MeshElement +class SMDS_EXPORT SMDS_MeshEdge:public SMDS_MeshElement { public: diff --git a/src/SMDS/SMDS_MeshElement.hxx b/src/SMDS/SMDS_MeshElement.hxx index 54f506772..71eb869a1 100644 --- a/src/SMDS/SMDS_MeshElement.hxx +++ b/src/SMDS/SMDS_MeshElement.hxx @@ -26,24 +26,14 @@ #ifndef _SMDS_MeshElement_HeaderFile #define _SMDS_MeshElement_HeaderFile + +#include "SMESH_SMDS.hxx" #include "SMDSAbs_ElementType.hxx" #include "SMDS_MeshObject.hxx" #include "SMDS_ElemIterator.hxx" #include "SMDS_MeshElementIDFactory.hxx" -//#ifdef WNT -//#include -//#else -//#define SALOME_WNT_EXPORT -//#endif - -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif - #include #include @@ -54,7 +44,7 @@ class SMDS_MeshFace; /////////////////////////////////////////////////////////////////////////////// /// Base class for elements /////////////////////////////////////////////////////////////////////////////// -class SMDS_WNT_EXPORT SMDS_MeshElement:public SMDS_MeshObject +class SMDS_EXPORT SMDS_MeshElement:public SMDS_MeshObject { public: @@ -75,8 +65,8 @@ public: virtual bool IsMediumNode(const SMDS_MeshNode* node) const; - friend std::ostream & operator <<(std::ostream & OS, const SMDS_MeshElement *); - friend bool SMDS_MeshElementIDFactory::BindID(int ID,SMDS_MeshElement*elem); + friend SMDS_EXPORT std::ostream & operator <<(std::ostream & OS, const SMDS_MeshElement *); + friend SMDS_EXPORT bool SMDS_MeshElementIDFactory::BindID(int ID,SMDS_MeshElement*elem); // =========================== // Access to nodes by index diff --git a/src/SMDS/SMDS_MeshElementIDFactory.hxx b/src/SMDS/SMDS_MeshElementIDFactory.hxx index edab00727..b78358f30 100644 --- a/src/SMDS/SMDS_MeshElementIDFactory.hxx +++ b/src/SMDS/SMDS_MeshElementIDFactory.hxx @@ -27,6 +27,8 @@ #ifndef _SMDS_MeshElementIDFactory_HeaderFile #define _SMDS_MeshElementIDFactory_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshIDFactory.hxx" #include "SMDS_ElemIterator.hxx" @@ -36,7 +38,7 @@ class SMDS_MeshElement; typedef NCollection_DataMap SMDS_IdElementMap; -class SMDS_MeshElementIDFactory:public SMDS_MeshIDFactory +class SMDS_EXPORT SMDS_MeshElementIDFactory:public SMDS_MeshIDFactory { public: SMDS_MeshElementIDFactory(); diff --git a/src/SMDS/SMDS_MeshFace.hxx b/src/SMDS/SMDS_MeshFace.hxx index 326a54bec..dbc5698e8 100644 --- a/src/SMDS/SMDS_MeshFace.hxx +++ b/src/SMDS/SMDS_MeshFace.hxx @@ -27,9 +27,11 @@ #ifndef _SMDS_MeshFace_HeaderFile #define _SMDS_MeshFace_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshElement.hxx" -class SMDS_MeshFace:public SMDS_MeshElement +class SMDS_EXPORT SMDS_MeshFace:public SMDS_MeshElement { public: SMDSAbs_ElementType GetType() const; diff --git a/src/SMDS/SMDS_MeshGroup.hxx b/src/SMDS/SMDS_MeshGroup.hxx index 90e6722af..f23b601b7 100644 --- a/src/SMDS/SMDS_MeshGroup.hxx +++ b/src/SMDS/SMDS_MeshGroup.hxx @@ -26,22 +26,12 @@ #ifndef _SMDS_MeshGroup_HeaderFile #define _SMDS_MeshGroup_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_Mesh.hxx" #include -//#ifdef WNT -//#include -//#else -//#define SALOME_WNT_EXPORT -//#endif - -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif - -class SMDS_WNT_EXPORT SMDS_MeshGroup:public SMDS_MeshObject +class SMDS_EXPORT SMDS_MeshGroup:public SMDS_MeshObject { public: SMDS_MeshGroup(const SMDS_Mesh * theMesh, diff --git a/src/SMDS/SMDS_MeshIDFactory.hxx b/src/SMDS/SMDS_MeshIDFactory.hxx index fa37a2814..8e57247da 100644 --- a/src/SMDS/SMDS_MeshIDFactory.hxx +++ b/src/SMDS/SMDS_MeshIDFactory.hxx @@ -27,11 +27,13 @@ #ifndef _SMDS_MeshIDFactory_HeaderFile #define _SMDS_MeshIDFactory_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshObject.hxx" #include -class SMDS_MeshIDFactory:public SMDS_MeshObject +class SMDS_EXPORT SMDS_MeshIDFactory:public SMDS_MeshObject { public: virtual int GetFreeID(); diff --git a/src/SMDS/SMDS_MeshNode.hxx b/src/SMDS/SMDS_MeshNode.hxx index 884e1280d..86a032efd 100644 --- a/src/SMDS/SMDS_MeshNode.hxx +++ b/src/SMDS/SMDS_MeshNode.hxx @@ -27,23 +27,13 @@ #ifndef _SMDS_MeshNode_HeaderFile #define _SMDS_MeshNode_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshElement.hxx" #include "SMDS_Position.hxx" #include -//#ifdef WNT -//#include -//#else -//#define SALOME_WNT_EXPORT -//#endif - -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif - -class SMDS_WNT_EXPORT SMDS_MeshNode:public SMDS_MeshElement +class SMDS_EXPORT SMDS_MeshNode:public SMDS_MeshElement { public: diff --git a/src/SMDS/SMDS_MeshObject.hxx b/src/SMDS/SMDS_MeshObject.hxx index b6c97ee3d..50af0db8f 100644 --- a/src/SMDS/SMDS_MeshObject.hxx +++ b/src/SMDS/SMDS_MeshObject.hxx @@ -27,20 +27,9 @@ #ifndef _SMDS_MeshObject_HeaderFile #define _SMDS_MeshObject_HeaderFile +#include "SMESH_SMDS.hxx" -//#ifdef WNT -//#include -//#else -//#define SALOME_WNT_EXPORT -//#endif - -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif - -class SMDS_WNT_EXPORT SMDS_MeshObject +class SMDS_EXPORT SMDS_MeshObject { public: virtual ~SMDS_MeshObject() {} diff --git a/src/SMDS/SMDS_MeshVolume.hxx b/src/SMDS/SMDS_MeshVolume.hxx index 3ad37801c..33bc8c48b 100644 --- a/src/SMDS/SMDS_MeshVolume.hxx +++ b/src/SMDS/SMDS_MeshVolume.hxx @@ -27,9 +27,11 @@ #ifndef _SMDS_MeshVolume_HeaderFile #define _SMDS_MeshVolume_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshElement.hxx" -class SMDS_MeshVolume:public SMDS_MeshElement +class SMDS_EXPORT SMDS_MeshVolume:public SMDS_MeshElement { public: diff --git a/src/SMDS/SMDS_PolygonalFaceOfNodes.hxx b/src/SMDS/SMDS_PolygonalFaceOfNodes.hxx index 973fb433c..13c1536b7 100644 --- a/src/SMDS/SMDS_PolygonalFaceOfNodes.hxx +++ b/src/SMDS/SMDS_PolygonalFaceOfNodes.hxx @@ -22,6 +22,8 @@ #ifndef _SMDS_PolygonalFaceOfNodes_HeaderFile #define _SMDS_PolygonalFaceOfNodes_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshFace.hxx" //#include "SMDS_FaceOfNodes.hxx" #include "SMDS_MeshNode.hxx" @@ -30,7 +32,7 @@ #include //class SMDS_PolygonalFaceOfNodes:public SMDS_FaceOfNodes -class SMDS_PolygonalFaceOfNodes:public SMDS_MeshFace +class SMDS_EXPORT SMDS_PolygonalFaceOfNodes:public SMDS_MeshFace { public: SMDS_PolygonalFaceOfNodes (std::vector nodes); diff --git a/src/SMDS/SMDS_PolyhedralVolumeOfNodes.hxx b/src/SMDS/SMDS_PolyhedralVolumeOfNodes.hxx index 27caf5db8..ddac4c659 100644 --- a/src/SMDS/SMDS_PolyhedralVolumeOfNodes.hxx +++ b/src/SMDS/SMDS_PolyhedralVolumeOfNodes.hxx @@ -27,14 +27,11 @@ #ifndef _SMDS_PolyhedralVolumeOfNodes_HeaderFile #define _SMDS_PolyhedralVolumeOfNodes_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_VolumeOfNodes.hxx" -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif -class SMDS_WNT_EXPORT SMDS_PolyhedralVolumeOfNodes:public SMDS_VolumeOfNodes +class SMDS_EXPORT SMDS_PolyhedralVolumeOfNodes:public SMDS_VolumeOfNodes { public: SMDS_PolyhedralVolumeOfNodes (std::vector nodes, diff --git a/src/SMDS/SMDS_Position.hxx b/src/SMDS/SMDS_Position.hxx index 18b84c6be..742bde4c3 100644 --- a/src/SMDS/SMDS_Position.hxx +++ b/src/SMDS/SMDS_Position.hxx @@ -27,26 +27,15 @@ #ifndef _SMDS_Position_HeaderFile #define _SMDS_Position_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_TypeOfPosition.hxx" #include -//#ifdef WNT -//#include -//#else -//#define SALOME_WNT_EXPORT -//#endif - -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif - class SMDS_Position; typedef boost::shared_ptr SMDS_PositionPtr; - -class SMDS_WNT_EXPORT SMDS_Position +class SMDS_EXPORT SMDS_Position { public: diff --git a/src/SMDS/SMDS_QuadraticEdge.hxx b/src/SMDS/SMDS_QuadraticEdge.hxx index 6c6099602..ab6e2dbf8 100644 --- a/src/SMDS/SMDS_QuadraticEdge.hxx +++ b/src/SMDS/SMDS_QuadraticEdge.hxx @@ -27,10 +27,12 @@ #ifndef _SMDS_QuadraticEdge_HeaderFile #define _SMDS_QuadraticEdge_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshEdge.hxx" #include -class SMDS_WNT_EXPORT SMDS_QuadraticEdge: public SMDS_MeshEdge +class SMDS_EXPORT SMDS_QuadraticEdge: public SMDS_MeshEdge { public: diff --git a/src/SMDS/SMDS_QuadraticFaceOfNodes.hxx b/src/SMDS/SMDS_QuadraticFaceOfNodes.hxx index d174e813e..9328f9844 100644 --- a/src/SMDS/SMDS_QuadraticFaceOfNodes.hxx +++ b/src/SMDS/SMDS_QuadraticFaceOfNodes.hxx @@ -27,9 +27,11 @@ #ifndef _SMDS_QuadraticFaceOfNodes_HeaderFile #define _SMDS_QuadraticFaceOfNodes_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshFace.hxx" -class SMDS_WNT_EXPORT SMDS_QuadraticFaceOfNodes:public SMDS_MeshFace +class SMDS_EXPORT SMDS_QuadraticFaceOfNodes:public SMDS_MeshFace { public: SMDS_QuadraticFaceOfNodes (const SMDS_MeshNode * n1, diff --git a/src/SMDS/SMDS_QuadraticVolumeOfNodes.hxx b/src/SMDS/SMDS_QuadraticVolumeOfNodes.hxx index 23f4369d3..c03735fee 100644 --- a/src/SMDS/SMDS_QuadraticVolumeOfNodes.hxx +++ b/src/SMDS/SMDS_QuadraticVolumeOfNodes.hxx @@ -27,9 +27,11 @@ #ifndef _SMDS_QuadraticVolumeOfNodes_HeaderFile #define _SMDS_QuadraticVolumeOfNodes_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshVolume.hxx" -class SMDS_WNT_EXPORT SMDS_QuadraticVolumeOfNodes: public SMDS_MeshVolume +class SMDS_EXPORT SMDS_QuadraticVolumeOfNodes: public SMDS_MeshVolume { public: // tetrahedron of 10 nodes diff --git a/src/SMDS/SMDS_SpacePosition.hxx b/src/SMDS/SMDS_SpacePosition.hxx index 3ca394f45..560cab094 100644 --- a/src/SMDS/SMDS_SpacePosition.hxx +++ b/src/SMDS/SMDS_SpacePosition.hxx @@ -27,21 +27,11 @@ #ifndef _SMDS_SpacePosition_HeaderFile #define _SMDS_SpacePosition_HeaderFile -#include "SMDS_Position.hxx" - -//#ifdef WNT -//#include -//#else -//#define SALOME_WNT_EXPORT -//#endif +#include "SMESH_SMDS.hxx" -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif +#include "SMDS_Position.hxx" -class SMDS_WNT_EXPORT SMDS_SpacePosition:public SMDS_Position +class SMDS_EXPORT SMDS_SpacePosition:public SMDS_Position { public: diff --git a/src/SMDS/SMDS_VertexPosition.hxx b/src/SMDS/SMDS_VertexPosition.hxx index 6dfe3714b..f06ba302c 100644 --- a/src/SMDS/SMDS_VertexPosition.hxx +++ b/src/SMDS/SMDS_VertexPosition.hxx @@ -27,21 +27,11 @@ #ifndef _SMDS_VertexPosition_HeaderFile #define _SMDS_VertexPosition_HeaderFile -#include "SMDS_Position.hxx" - -//#ifdef WNT -//#include -//#else -//#define SALOME_WNT_EXPORT -//#endif +#include "SMESH_SMDS.hxx" -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif +#include "SMDS_Position.hxx" -class SMDS_WNT_EXPORT SMDS_VertexPosition:public SMDS_Position +class SMDS_EXPORT SMDS_VertexPosition:public SMDS_Position { public: diff --git a/src/SMDS/SMDS_VolumeOfFaces.hxx b/src/SMDS/SMDS_VolumeOfFaces.hxx index 9938443df..2bf783ab3 100644 --- a/src/SMDS/SMDS_VolumeOfFaces.hxx +++ b/src/SMDS/SMDS_VolumeOfFaces.hxx @@ -27,13 +27,15 @@ #ifndef _SMDS_VolumeOfFaces_HeaderFile #define _SMDS_VolumeOfFaces_HeaderFile +#include "SMESH_SMDS.hxx" + #include "SMDS_MeshVolume.hxx" #include "SMDS_MeshFace.hxx" #include "SMDS_Iterator.hxx" #include -class SMDS_VolumeOfFaces:public SMDS_MeshVolume +class SMDS_EXPORT SMDS_VolumeOfFaces:public SMDS_MeshVolume { public: diff --git a/src/SMDS/SMDS_VolumeOfNodes.hxx b/src/SMDS/SMDS_VolumeOfNodes.hxx index 83628bd93..6c18c170f 100644 --- a/src/SMDS/SMDS_VolumeOfNodes.hxx +++ b/src/SMDS/SMDS_VolumeOfNodes.hxx @@ -27,10 +27,11 @@ #ifndef _SMDS_VolumeOfNodes_HeaderFile #define _SMDS_VolumeOfNodes_HeaderFile -#include "SMDS_MeshVolume.hxx" +#include "SMESH_SMDS.hxx" +#include "SMDS_MeshVolume.hxx" -class SMDS_VolumeOfNodes:public SMDS_MeshVolume +class SMDS_EXPORT SMDS_VolumeOfNodes:public SMDS_MeshVolume { public: diff --git a/src/SMDS/SMDS_VolumeTool.cxx b/src/SMDS/SMDS_VolumeTool.cxx index 7ee1f81f2..c55fff9ea 100644 --- a/src/SMDS/SMDS_VolumeTool.cxx +++ b/src/SMDS/SMDS_VolumeTool.cxx @@ -1266,7 +1266,7 @@ bool SMDS_VolumeTool::IsFreeFace( int faceIndex ) if ( IsFaceExternal( faceIndex )) intNormal = XYZ( -intNormal.x, -intNormal.y, -intNormal.z ); XYZ p0 ( nodes[0] ), baryCenter; - for ( vNbIt = volNbShared.begin(); vNbIt != volNbShared.end(); vNbIt++ ) { + for ( vNbIt = volNbShared.begin(); vNbIt != volNbShared.end();vNbIt++ ) { int nbShared = (*vNbIt).second; if ( nbShared >= 3 ) { SMDS_VolumeTool volume( (*vNbIt).first ); @@ -1518,6 +1518,31 @@ int SMDS_VolumeTool::NbFaces( VolumeType type ) } } +//================================================================================ +/*! + * \brief Useful to know nb of corner nodes of a quadratic volume + * \param type - volume type + * \retval int - nb of corner nodes + */ +//================================================================================ + +int SMDS_VolumeTool::NbCornerNodes(VolumeType type) +{ + switch ( type ) { + case TETRA : + case QUAD_TETRA: return 4; + case PYRAM : + case QUAD_PYRAM: return 5; + case PENTA : + case QUAD_PENTA: return 6; + case HEXA : + case QUAD_HEXA : return 8; + default: return 0; + } + return 0; +} + // + //======================================================================= //function : GetFaceNodesIndices //purpose : Return the array of face nodes indices diff --git a/src/SMDS/SMDS_VolumeTool.hxx b/src/SMDS/SMDS_VolumeTool.hxx index 4c0e1a911..cbff9a6ee 100644 --- a/src/SMDS/SMDS_VolumeTool.hxx +++ b/src/SMDS/SMDS_VolumeTool.hxx @@ -30,6 +30,8 @@ #ifndef SMDS_VolumeTool_HeaderFile #define SMDS_VolumeTool_HeaderFile +#include "SMESH_SMDS.hxx" + class SMDS_MeshElement; class SMDS_MeshNode; class SMDS_PolyhedralVolumeOfNodes; @@ -37,18 +39,6 @@ class SMDS_PolyhedralVolumeOfNodes; #include #include -//#ifdef WNT -//#include -//#else -//#define SALOME_WNT_EXPORT -//#endif - -#if defined WNT && defined WIN32 && defined SMDS_EXPORTS -#define SMDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMDS_WNT_EXPORT -#endif - // ========================================================================= // // Class providing topological and other information about SMDS_MeshVolume: @@ -57,7 +47,7 @@ class SMDS_PolyhedralVolumeOfNodes; // // ========================================================================= -class SMDS_WNT_EXPORT SMDS_VolumeTool +class SMDS_EXPORT SMDS_VolumeTool { public: @@ -193,7 +183,10 @@ class SMDS_WNT_EXPORT SMDS_VolumeTool int faceIndex ); // Return number of nodes in the array of face nodes - private: + static int NbCornerNodes(VolumeType type); + // Useful to know nb of corner nodes of a quadratic volume + +private: bool setFace( int faceIndex ); diff --git a/src/SMDS/SMESH_SMDS.hxx b/src/SMDS/SMESH_SMDS.hxx new file mode 100755 index 000000000..207cf7210 --- /dev/null +++ b/src/SMDS/SMESH_SMDS.hxx @@ -0,0 +1,39 @@ +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESH_SMDS.hxx +// Author : Alexander A. BORODIN +// Module : SMESH + +#ifndef _SMESH_SMDS_HXX_ +#define _SMESH_SMDS_HXX_ + +#ifdef WNT + #if defined SMDS_EXPORTS + #define SMDS_EXPORT __declspec( dllexport ) + #else + #define SMDS_EXPORT __declspec( dllimport ) + #endif +#else + #define SMDS_EXPORT +#endif + +#endif \ No newline at end of file diff --git a/src/SMESH/Makefile.in b/src/SMESH/Makefile.in index f9154dca4..b643a6d68 100644 --- a/src/SMESH/Makefile.in +++ b/src/SMESH/Makefile.in @@ -38,6 +38,7 @@ EXPORT_HEADERS= \ SMESH_Gen.hxx \ SMESH_Mesh.hxx \ SMESH_subMesh.hxx \ + SMESH_subMeshEventListener.hxx \ SMESH_Hypothesis.hxx \ SMESH_HypoFilter.hxx \ SMESH_Algo.hxx \ @@ -52,7 +53,8 @@ EXPORT_HEADERS= \ SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx \ SMESH_SequenceOfElemPtr.hxx \ SMESH_SequenceOfNode.hxx \ - SMESH_MesherHelper.hxx + SMESH_MesherHelper.hxx \ + SMESH_SMESH.hxx EXPORT_PYSCRIPTS = diff --git a/src/SMESH/SMESH_1D_Algo.cxx b/src/SMESH/SMESH_1D_Algo.cxx index a8524eb88..122419379 100644 --- a/src/SMESH/SMESH_1D_Algo.cxx +++ b/src/SMESH/SMESH_1D_Algo.cxx @@ -26,11 +26,12 @@ // Module : SMESH // $Header$ -using namespace std; #include "SMESH_1D_Algo.hxx" #include "SMESH_Gen.hxx" #include "SMESH_subMesh.hxx" +using namespace std; + //============================================================================= /*! * diff --git a/src/SMESH/SMESH_1D_Algo.hxx b/src/SMESH/SMESH_1D_Algo.hxx index 4b433eef5..c7582b1b4 100644 --- a/src/SMESH/SMESH_1D_Algo.hxx +++ b/src/SMESH/SMESH_1D_Algo.hxx @@ -29,9 +29,11 @@ #ifndef _SMESH_1D_ALGO_HXX_ #define _SMESH_1D_ALGO_HXX_ +#include "SMESH_SMESH.hxx" + #include "SMESH_Algo.hxx" -class SMESH_1D_Algo: +class SMESH_EXPORT SMESH_1D_Algo: public SMESH_Algo { public: diff --git a/src/SMESH/SMESH_2D_Algo.cxx b/src/SMESH/SMESH_2D_Algo.cxx index a2a18202a..84d0db491 100644 --- a/src/SMESH/SMESH_2D_Algo.cxx +++ b/src/SMESH/SMESH_2D_Algo.cxx @@ -26,13 +26,14 @@ // Module : SMESH // $Header$ -using namespace std; #include "SMESH_2D_Algo.hxx" #include "SMESH_Gen.hxx" #include #include "utilities.h" +using namespace std; + //============================================================================= /*! * diff --git a/src/SMESH/SMESH_2D_Algo.hxx b/src/SMESH/SMESH_2D_Algo.hxx index d16e34b3d..1156854e7 100644 --- a/src/SMESH/SMESH_2D_Algo.hxx +++ b/src/SMESH/SMESH_2D_Algo.hxx @@ -29,11 +29,13 @@ #ifndef _SMESH_2D_ALGO_HXX_ #define _SMESH_2D_ALGO_HXX_ +#include "SMESH_SMESH.hxx" + #include "SMESH_Algo.hxx" #include "SMESH_subMesh.hxx" #include "TopoDS_Wire.hxx" -class SMESH_2D_Algo: +class SMESH_EXPORT SMESH_2D_Algo: public SMESH_Algo { public: diff --git a/src/SMESH/SMESH_3D_Algo.cxx b/src/SMESH/SMESH_3D_Algo.cxx index ccf4d9a20..ed3004ff0 100644 --- a/src/SMESH/SMESH_3D_Algo.cxx +++ b/src/SMESH/SMESH_3D_Algo.cxx @@ -26,12 +26,13 @@ // Module : SMESH // $Header$ -using namespace std; #include "SMESH_3D_Algo.hxx" #include "SMESH_Gen.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * diff --git a/src/SMESH/SMESH_3D_Algo.hxx b/src/SMESH/SMESH_3D_Algo.hxx index d17416bc0..2939c27b3 100644 --- a/src/SMESH/SMESH_3D_Algo.hxx +++ b/src/SMESH/SMESH_3D_Algo.hxx @@ -29,9 +29,11 @@ #ifndef _SMESH_3D_ALGO_HXX_ #define _SMESH_3D_ALGO_HXX_ +#include "SMESH_SMESH.hxx" + #include "SMESH_Algo.hxx" -class SMESH_3D_Algo: +class SMESH_EXPORT SMESH_3D_Algo: public SMESH_Algo { public: diff --git a/src/SMESH/SMESH_Algo.cxx b/src/SMESH/SMESH_Algo.cxx index 45e0e234a..a4b2c18f7 100644 --- a/src/SMESH/SMESH_Algo.cxx +++ b/src/SMESH/SMESH_Algo.cxx @@ -26,7 +26,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "SMESH_Algo.hxx" #include "SMESH_Gen.hxx" #include "SMESH_Mesh.hxx" @@ -55,6 +54,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * @@ -82,6 +83,15 @@ SMESH_Algo::~SMESH_Algo() { } +//============================================================================= +/*! + * Usually an algoritm has nothing to save + */ +//============================================================================= + +ostream & SMESH_Algo::SaveTo(ostream & save) { return save; } +istream & SMESH_Algo::LoadFrom(istream & load) { return load; } + //============================================================================= /*! * @@ -367,3 +377,17 @@ bool SMESH_Algo::InitCompatibleHypoFilter( SMESH_HypoFilter & theFilter, } return false; } + +//================================================================================ +/*! + * \brief Sets event listener to submeshes if necessary + * \param subMesh - submesh where algo is set + * + * After being set, event listener is notified on each event of a submesh. + * By default non listener is set + */ +//================================================================================ + +void SMESH_Algo::SetEventListener(SMESH_subMesh* /*subMesh*/) +{ +} diff --git a/src/SMESH/SMESH_Algo.hxx b/src/SMESH/SMESH_Algo.hxx index 218c5cad9..97d1117e5 100644 --- a/src/SMESH/SMESH_Algo.hxx +++ b/src/SMESH/SMESH_Algo.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_ALGO_HXX_ #define _SMESH_ALGO_HXX_ +#include "SMESH_SMESH.hxx" + #include "SMESH_Hypothesis.hxx" #include @@ -47,55 +49,162 @@ class TopoDS_Face; class TopoDS_Shape; class SMESHDS_Mesh; class SMDS_MeshNode; +class SMESH_subMesh; -class SMESH_Algo:public SMESH_Hypothesis +class SMESH_EXPORT SMESH_Algo:public SMESH_Hypothesis { - public: - SMESH_Algo(int hypId, int studyId, SMESH_Gen * gen); - virtual ~ SMESH_Algo(); - - const std::vector < std::string > &GetCompatibleHypothesis(); - virtual bool CheckHypothesis(SMESH_Mesh& aMesh, - const TopoDS_Shape& aShape, - SMESH_Hypothesis::Hypothesis_Status& aStatus) = 0; +public: + /*! + * \brief Creates algorithm + * \param hypId - algorithm ID + * \param studyId - study ID + * \param gen - SMESH_Gen + */ + SMESH_Algo(int hypId, int studyId, SMESH_Gen * gen); - virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) = 0; + /*! + * \brief Destructor + */ + virtual ~ SMESH_Algo(); - virtual const std::list & - GetUsedHypothesis(SMESH_Mesh & aMesh, - const TopoDS_Shape & aShape, - const bool ignoreAuxiliary=true); + /*! + * \brief Saves nothing in a stream + * \param save - the stream + * \retval virtual std::ostream & - the stream + */ + virtual std::ostream & SaveTo(std::ostream & save); - const list & - GetAppliedHypothesis(SMESH_Mesh & aMesh, - const TopoDS_Shape & aShape, - const bool ignoreAuxiliary=true); + /*! + * \brief Loads nothing from a stream + * \param load - the stream + * \retval virtual std::ostream & - the stream + */ + virtual std::istream & LoadFrom(std::istream & load); - static double EdgeLength(const TopoDS_Edge & E); + /*! + * \brief Returns all types of compatible hypotheses + */ + const std::vector < std::string > & GetCompatibleHypothesis(); + /*! + * \brief Check hypothesis definition to mesh a shape + * \param aMesh - the mesh + * \param aShape - the shape + * \param aStatus - check result + * \retval bool - true if hypothesis is well defined + */ + virtual bool CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus) = 0; + /*! + * \brief Computes mesh on a shape + * \param aMesh - the mesh + * \param aShape - the shape + * \retval bool - is a success + */ + virtual bool Compute(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) = 0; /*! - * \brief Make filter recognize only compatible hypotheses - * \param theFilter - the filter to initialize - * \param ignoreAuxiliary - make filter ignore compatible auxiliary hypotheses - * \retval bool - true if the algo has compatible hypotheses + * \brief Returns a list of compatible hypotheses used to mesh a shape + * \param aMesh - the mesh + * \param aShape - the shape + * \param ignoreAuxiliary - do not include auxiliary hypotheses in the list + * \retval const std::list - hypotheses list + * + * List the hypothesis used by the algorithm associated to the shape. + * Hypothesis associated to father shape -are- taken into account (see + * GetAppliedHypothesis). Relevant hypothesis have a name (type) listed in + * the algorithm. This method could be surcharged by specific algorithms, in + * case of several hypothesis simultaneously applicable. + */ + virtual const std::list & + GetUsedHypothesis(SMESH_Mesh & aMesh, + const TopoDS_Shape & aShape, + const bool ignoreAuxiliary=true); + /*! + * \brief Returns a list of compatible hypotheses assigned to a shape in a mesh + * \param aMesh - the mesh + * \param aShape - the shape + * \param ignoreAuxiliary - do not include auxiliary hypotheses in the list + * \retval const std::list - hypotheses list + * + * List the relevant hypothesis associated to the shape. Relevant hypothesis + * have a name (type) listed in the algorithm. Hypothesis associated to + * father shape -are not- taken into account (see GetUsedHypothesis) + */ + const list & + GetAppliedHypothesis(SMESH_Mesh & aMesh, + const TopoDS_Shape & aShape, + const bool ignoreAuxiliary=true); + /*! + * \brief Make the filter recognize only compatible hypotheses + * \param theFilter - the filter to initialize + * \param ignoreAuxiliary - make filter ignore compatible auxiliary hypotheses + * \retval bool - true if the algo has compatible hypotheses */ bool InitCompatibleHypoFilter( SMESH_HypoFilter & theFilter, const bool ignoreAuxiliary) const; + /*! + * \brief Initialize my parameter values by the mesh built on the geometry + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if parameter values have been successfully defined + * + * Just return false as the algorithm does not hold parameters values + */ + virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, + const TopoDS_Shape& theShape); + + +public: + // ================================================================== + // Algo features influencing how Compute() is called: + // in what turn and with what input shape + // ================================================================== + + // SMESH_Hypothesis::GetDim(); + // 1 - dimention of target mesh + + bool OnlyUnaryInput() const { return _onlyUnaryInput; } + // 2 - is collection of tesselatable shapes inacceptable as input; + // "collection" means a shape containing shapes of dim equal + // to GetDim(). + // Algo which can process a collection shape should expect + // an input temporary shape that is neither MainShape nor + // its child. + + bool NeedDescretBoundary() const { return _requireDescretBoundary; } + // 3 - is a Dim-1 mesh prerequisite +public: + // ================================================================== + // Methods to track non hierarchical dependencies between submeshes + // ================================================================== + + /*! + * \brief Sets event listener to submeshes if necessary + * \param subMesh - submesh where algo is set + * + * This method is called when a submesh gets HYP_OK algo_state. + * After being set, event listener is notified on each event of a submesh. + * By default non listener is set + */ + virtual void SetEventListener(SMESH_subMesh* subMesh); + +public: + // ================================================================== + // Common algo utilities + // ================================================================== /*! * \brief Fill vector of node parameters on geometrical edge, including vertex nodes - * \param theMesh - The mesh containing nodes - * \param theEdge - The geometrical edge of interest - * \param theParams - The resulting vector of sorted node parameters - * \retval bool - false if not all parameters are OK + * \param theMesh - The mesh containing nodes + * \param theEdge - The geometrical edge of interest + * \param theParams - The resulting vector of sorted node parameters + * \retval bool - false if not all parameters are OK */ static bool GetNodeParamOnEdge(const SMESHDS_Mesh* theMesh, const TopoDS_Edge& theEdge, std::vector< double > & theParams); - - //static bool GetSegmentLengths(); - /*! * \brief Find out elements orientation on a geometrical face * \param theFace - The face correctly oriented in the shape being meshed @@ -105,40 +214,20 @@ class SMESH_Algo:public SMESH_Hypothesis */ static bool IsReversedSubMesh (const TopoDS_Face& theFace, SMESHDS_Mesh* theMeshDS); - /*! - * \brief Initialize my parameter values by the mesh built on the geometry - * \param theMesh - the built mesh - * \param theShape - the geometry of interest - * \retval bool - true if parameter values have been successfully defined - * - * Just return false as the algorithm does not hold parameters values + * \brief Compute length of an edge + * \param E - the edge + * \retval double - the length */ - virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); - - public: - // algo features - - // SMESH_Hypothesis::GetDim(); - // 1 - dimention of target mesh - - bool OnlyUnaryInput() const { return _onlyUnaryInput; } - // 2 - is collection of tesselatable shapes inacceptable as input; - // "collection" means a shape containing shapes of dim equal - // to GetDim(). - // Algo which can process a collection shape should expect - // an input temporary shape that is neither MainShape nor - // its child. - - bool NeedDescretBoundary() const { return _requireDescretBoundary; } - // 3 - is a Dim-1 mesh prerequisite - - protected: - bool _onlyUnaryInput; - bool _requireDescretBoundary; - std::vector _compatibleHypothesis; - std::list _appliedHypList; - std::list _usedHypList; + static double EdgeLength(const TopoDS_Edge & E); + + +protected: + bool _onlyUnaryInput; + bool _requireDescretBoundary; + std::vector _compatibleHypothesis; + std::list _appliedHypList; + std::list _usedHypList; // quadratic mesh creation required bool _quadraticMesh; diff --git a/src/SMESH/SMESH_Block.cxx b/src/SMESH/SMESH_Block.cxx index 3a0868330..fa7fc282f 100644 --- a/src/SMESH/SMESH_Block.cxx +++ b/src/SMESH/SMESH_Block.cxx @@ -23,19 +23,22 @@ #include "SMESH_Block.hxx" +#include +#include +#include #include #include +#include #include #include #include -#include -#include +#include #include -#include #include #include #include #include +#include #include #include #include @@ -52,7 +55,46 @@ using namespace std; -#define SQRT_FUNC 1 +#define SQRT_FUNC 0 + +//================================================================================ +/*! + * \brief Set edge data + * \param edgeID - block subshape ID + * \param curve - edge geometry + * \param isForward - is curve orientation coincides with edge orientation in the block + */ +//================================================================================ + +void SMESH_Block::TEdge::Set( const int edgeID, Adaptor3d_Curve* curve, const bool isForward ) +{ + myCoordInd = SMESH_Block::GetCoordIndOnEdge( edgeID ); + if ( myC3d ) delete myC3d; + myC3d = curve; + myFirst = curve->FirstParameter(); + myLast = curve->LastParameter(); + if ( !isForward ) + std::swap( myFirst, myLast ); +} + +//================================================================================ +/*! + * \brief Set coordinates of nodes at edge ends to work with mesh block + * \param edgeID - block subshape ID + * \param node1 - coordinates of node with lower ID + * \param node2 - coordinates of node with upper ID + */ +//================================================================================ + +void SMESH_Block::TEdge::Set( const int edgeID, const gp_XYZ& node1, const gp_XYZ& node2 ) +{ + myCoordInd = SMESH_Block::GetCoordIndOnEdge( edgeID ); + myNodes[ 0 ] = node1; + myNodes[ 1 ] = node2; + + if ( myC3d ) delete myC3d; + myC3d = 0; +} //======================================================================= //function : SMESH_Block::TEdge::GetU @@ -62,7 +104,7 @@ using namespace std; double SMESH_Block::TEdge::GetU( const gp_XYZ& theParams ) const { double u = theParams.Coord( myCoordInd ); - if ( myC3d.IsNull() ) // if mesh block + if ( !myC3d ) // if mesh block return u; return ( 1 - u ) * myFirst + u * myLast; } @@ -75,14 +117,95 @@ double SMESH_Block::TEdge::GetU( const gp_XYZ& theParams ) const gp_XYZ SMESH_Block::TEdge::Point( const gp_XYZ& theParams ) const { double u = GetU( theParams ); + if ( myC3d ) return myC3d->Value( u ).XYZ(); + // mesh block + return myNodes[0] * ( 1 - u ) + myNodes[1] * u; +} - if ( myC3d.IsNull() ) // if mesh block - return myNodes[0] * ( 1 - u ) + myNodes[1] * u; +//================================================================================ +/*! + * \brief Destructor + */ +//================================================================================ - gp_XYZ p = myC3d->Value( u ).XYZ(); - if ( myTrsf.Form() != gp_Identity ) - myTrsf.Transforms( p ); - return p; +SMESH_Block::TEdge::~TEdge() +{ + if ( myC3d ) delete myC3d; +} + +//================================================================================ +/*! + * \brief Set face data + * \param faceID - block subshape ID + * \param S - face surface geometry + * \param c2d - 4 pcurves in the order as returned by GetFaceEdgesIDs(faceID) + * \param isForward - orientation of pcurves comparing with block edge direction + */ +//================================================================================ + +void SMESH_Block::TFace::Set( const int faceID, + Adaptor3d_Surface* S, + Adaptor2d_Curve2d* c2D[4], + const bool isForward[4] ) +{ + if ( myS ) delete myS; + myS = S; + // pcurves + vector< int > edgeIdVec; + GetFaceEdgesIDs( faceID, edgeIdVec ); + for ( int iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges + { + myCoordInd[ iE ] = GetCoordIndOnEdge( edgeIdVec[ iE ] ); + if ( myC2d[ iE ]) delete myC2d[ iE ]; + myC2d[ iE ] = c2D[ iE ]; + myFirst[ iE ] = myC2d[ iE ]->FirstParameter(); + myLast [ iE ] = myC2d[ iE ]->LastParameter(); + if ( !isForward[ iE ]) + std::swap( myFirst[ iE ], myLast[ iE ] ); + } + // 2d corners + myCorner[ 0 ] = myC2d[ 0 ]->Value( myFirst[0] ).XY(); + myCorner[ 1 ] = myC2d[ 0 ]->Value( myLast[0] ).XY(); + myCorner[ 2 ] = myC2d[ 1 ]->Value( myLast[1] ).XY(); + myCorner[ 3 ] = myC2d[ 1 ]->Value( myFirst[1] ).XY(); +} + +//================================================================================ +/*! + * \brief Set face data to work with mesh block + * \param faceID - block subshape ID + * \param edgeU0 - filled data of edge u0 = GetFaceEdgesIDs(faceID)[ 0 ] + * \param edgeU1 - filled data of edge u1 = GetFaceEdgesIDs(faceID)[ 1 ] + */ +//================================================================================ + +void SMESH_Block::TFace::Set( const int faceID, const TEdge& edgeU0, const TEdge& edgeU1 ) +{ + vector< int > edgeIdVec; + GetFaceEdgesIDs( faceID, edgeIdVec ); + myNodes[ 0 ] = edgeU0.NodeXYZ( 1 ); + myNodes[ 1 ] = edgeU0.NodeXYZ( 0 ); + myNodes[ 2 ] = edgeU1.NodeXYZ( 0 ); + myNodes[ 3 ] = edgeU1.NodeXYZ( 1 ); + myCoordInd[ 0 ] = GetCoordIndOnEdge( edgeIdVec[ 0 ] ); + myCoordInd[ 1 ] = GetCoordIndOnEdge( edgeIdVec[ 1 ] ); + myCoordInd[ 2 ] = GetCoordIndOnEdge( edgeIdVec[ 2 ] ); + myCoordInd[ 3 ] = GetCoordIndOnEdge( edgeIdVec[ 3 ] ); + if ( myS ) delete myS; + myS = 0; +} + +//================================================================================ +/*! + * \brief Destructor + */ +//================================================================================ + +SMESH_Block::TFace::~TFace() +{ + if ( myS ) delete myS; + for ( int i = 0 ; i < 4; ++i ) + if ( myC2d[ i ]) delete myC2d[ i ]; } //======================================================================= @@ -144,7 +267,7 @@ gp_XY SMESH_Block::TFace::GetUV( const gp_XYZ& theParams ) const gp_XYZ SMESH_Block::TFace::Point( const gp_XYZ& theParams ) const { gp_XYZ p(0.,0.,0.); - if ( myS.IsNull() ) // if mesh block + if ( !myS ) // if mesh block { for ( int iE = 0; iE < 4; iE++ ) // loop on 4 edges { @@ -168,8 +291,6 @@ gp_XYZ SMESH_Block::TFace::Point( const gp_XYZ& theParams ) const { gp_XY uv = GetUV( theParams ); p = myS->Value( uv.X(), uv.Y() ).XYZ(); - if ( myTrsf.Form() != gp_Identity ) - myTrsf.Transforms( p ); } return p; } @@ -224,17 +345,20 @@ bool SMESH_Block::ShellPoint( const gp_XYZ& theParams, gp_XYZ& thePoint ) const k *= theParams.Coord( iCoef + 1 ); } } - // point on a shape - gp_XYZ Ps; - if ( shapeID < ID_Ex00 ) // vertex - VertexPoint( shapeID, Ps ); - else if ( shapeID < ID_Fxy0 ) { // edge - EdgePoint( shapeID, theParams, Ps ); - k = -k; - } else // face - FacePoint( shapeID, theParams, Ps ); - - thePoint += k * Ps; + // add point on a shape + if ( fabs( k ) > DBL_MIN ) + { + gp_XYZ Ps; + if ( shapeID < ID_Ex00 ) // vertex + VertexPoint( shapeID, Ps ); + else if ( shapeID < ID_Fxy0 ) { // edge + EdgePoint( shapeID, theParams, Ps ); + k = -k; + } else // face + FacePoint( shapeID, theParams, Ps ); + + thePoint += k * Ps; + } } return true; } @@ -331,6 +455,8 @@ Standard_Boolean SMESH_Block::Derivatives(const math_Vector& XYZ,math_Matrix& Df //purpose : //======================================================================= +//#define DEBUG_PARAM_COMPUTE + Standard_Boolean SMESH_Block::Values(const math_Vector& theXYZ, math_Vector& theFxyz, math_Matrix& theDf) @@ -345,11 +471,13 @@ Standard_Boolean SMESH_Block::Values(const math_Vector& theXYZ, theDf( 1,3 ) = myValues[ 3 ]; return true; } - +#ifdef DEBUG_PARAM_COMPUTE + cout << "PARAM GUESS: " << params.X() << " "<< params.Y() << " "<< params.X() << endl; +#endif ShellPoint( params, P ); //myNbIterations++; // how many time call ShellPoint() - gp_Vec dP( P - myPoint ); + gp_Vec dP( myPoint, P ); theFxyz(1) = SQRT_FUNC ? dP.SquareMagnitude() : dP.Magnitude(); if ( theFxyz(1) < 1e-6 ) { myParam = params; @@ -363,36 +491,48 @@ Standard_Boolean SMESH_Block::Values(const math_Vector& theXYZ, if ( theFxyz(1) < myValues[0] ) // a better guess { // 3 partial derivatives - gp_Vec drv[ 3 ]; + gp_Vec drv[ 3 ]; // where we move with a small step in each direction for ( int iP = 1; iP <= 3; iP++ ) { + if ( iP - 1 == myFaceIndex ) { + drv[ iP - 1 ] = gp_Vec(0,0,0); + continue; + } gp_XYZ Pi; - params.SetCoord( iP, theXYZ( iP ) + 0.001 ); + bool onEdge = ( theXYZ( iP ) + 0.001 > 1. ); + if ( onEdge ) + params.SetCoord( iP, theXYZ( iP ) - 0.001 ); + else + params.SetCoord( iP, theXYZ( iP ) + 0.001 ); ShellPoint( params, Pi ); params.SetCoord( iP, theXYZ( iP ) ); // restore params gp_Vec dPi ( P, Pi ); + if ( onEdge ) dPi *= -1.; double mag = dPi.Magnitude(); if ( mag > DBL_MIN ) dPi /= mag; drv[ iP - 1 ] = dPi; } for ( int iP = 0; iP < 3; iP++ ) { - if ( iP == myFaceIndex ) - theDf( 1, iP + 1 ) = myFaceParam; - else { + theDf( 1, iP + 1 ) = dP * drv[iP]; + // Distance from P to plane passing through myPoint and defined + // by the 2 other derivative directions: // like IntAna_IntConicQuad::Perform (const gp_Lin& L, const gp_Pln& P) // where L is (P -> myPoint), P is defined by the 2 other derivative direction - int iPrev = ( iP ? iP - 1 : 2 ); - int iNext = ( iP == 2 ? 0 : iP + 1 ); - gp_Vec plnNorm = drv[ iPrev ].Crossed( drv [ iNext ] ); - double Direc = plnNorm * drv[ iP ]; - if ( Abs(Direc) <= DBL_MIN ) - theDf( 1, iP + 1 ) = dP * drv[ iP ]; - else { - double Dis = plnNorm * P - plnNorm * myPoint; - theDf( 1, iP + 1 ) = Dis/Direc; - } - } +// int iPrev = ( iP ? iP - 1 : 2 ); +// int iNext = ( iP == 2 ? 0 : iP + 1 ); +// gp_Vec plnNorm = drv[ iPrev ].Crossed( drv [ iNext ] ); +// double Direc = plnNorm * drv[ iP ]; +// if ( Abs(Direc) <= DBL_MIN ) +// theDf( 1, iP + 1 ) = dP * drv[ iP ]; +// else { +// double Dis = plnNorm * P - plnNorm * myPoint; +// theDf( 1, iP + 1 ) = Dis/Direc; +// } } +#ifdef DEBUG_PARAM_COMPUTE + cout << "F = " << theFxyz(1) << + " DRV: " << theDf(1,1) << " " << theDf(1,2) << " " << theDf(1,3) << endl; +#endif //myNbIterations +=3; // how many time call ShellPoint() // store better values @@ -424,10 +564,9 @@ bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint, return true; if ( IsEdgeID( theShapeID )) { - TEdge& e = myEdge[ theShapeID - ID_Ex00 ]; - GeomAdaptor_Curve curve( e.myC3d ); - double f = Min( e.myFirst, e.myLast ), l = Max( e.myFirst, e.myLast ); - Extrema_ExtPC anExtPC( thePoint, curve, f, l ); + TEdge& e = myEdge[ theShapeID - ID_FirstE ]; + Adaptor3d_Curve* curve = e.GetCurve(); + Extrema_ExtPC anExtPC( thePoint, *curve, curve->FirstParameter(), curve->LastParameter() ); int i, nb = anExtPC.IsDone() ? anExtPC.NbExt() : 0; for ( i = 1; i <= nb; i++ ) { if ( anExtPC.IsMin( i )) @@ -469,7 +608,7 @@ bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint, double par = 0; if ( len2 > zero ) { par = v0P.Dot( v01 ) / len2; - if ( par < 0 || par > 1 ) { + if ( par < 0 || par > 1 ) { // projection falls out of line ends => needGrid needGrid = true; break; } @@ -507,7 +646,7 @@ bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint, start( 3 ) = bestParam->Z(); } - int myFaceIndex = -1; + myFaceIndex = -1; if ( isOnFace ) { // put a point on the face for ( int iCoord = 0; iCoord < 3; iCoord++ ) @@ -522,9 +661,14 @@ bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint, math_Vector tol ( 1, 3, 1e-4 ); math_FunctionSetRoot paramSearch( *this, tol ); +#ifdef DEBUG_PARAM_COMPUTE + cout << " #### POINT " < 1e-1 && nbLoops++ < 10 ) { - paramSearch.Perform ( *this, start, low, up ); + paramSearch.Perform ( *static_cast(this), + start, low, up ); if ( !paramSearch.IsDone() ) { //MESSAGE( " !paramSearch.IsDone() " ); } @@ -536,11 +680,18 @@ bool SMESH_Block::ComputeParameters(const gp_Pnt& thePoint, start( 3 ) = myParam.Z(); //MESSAGE( "Distance: " << ( SQRT_FUNC ? sqrt(myValues[0]) : myValues[0] )); } +#ifdef DEBUG_PARAM_COMPUTE + cout << "-------SOLUTION-------: " << endl + << myParam.X() << " " << myParam.Y() << " " << myParam.Z() << endl + << " ------ DIST :" << myValues[0] << endl; +#endif // MESSAGE( endl << myParam.X() << " " << myParam.Y() << " " << myParam.Z() << endl); // mySumDist += myValues[0]; // MESSAGE( " TOTAL NB ITERATIONS: " << myNbIterations << // " DIST: " << ( SQRT_FUNC ? sqrt(mySumDist) : mySumDist )); + if ( myFaceIndex >= 0 ) + myParam.SetCoord( myFaceIndex + 1, myFaceParam ); theParams = myParam; @@ -576,8 +727,8 @@ bool SMESH_Block::EdgeParameters(const int theEdgeID, const double theU, gp_XYZ& GetEdgeVertexIDs( theEdgeID, vertexVec ); VertexParameters( vertexVec[0], theParams ); TEdge& e = myEdge[ theEdgeID - ID_Ex00 ]; - double param = ( theU - e.myFirst ) / ( e.myLast - e.myFirst ); - theParams.SetCoord( e.myCoordInd, param ); + double param = ( theU - e.EndParam(0) ) / ( e.EndParam(1) - e.EndParam(0) ); + theParams.SetCoord( e.CoordInd(), param ); return true; } return false; @@ -685,16 +836,15 @@ int SMESH_Block::GetShapeIDByParams ( const gp_XYZ& theCoord ) return id + 1; // shape ids start at 1 } - //======================================================================= -//function : getOrderedEdges +//function : GetOrderedEdges //purpose : return nb wires and a list of oredered edges //======================================================================= -static int getOrderedEdges (const TopoDS_Face& theFace, - const TopoDS_Vertex& theFirstVertex, - list< TopoDS_Edge >& theEdges, - list< int > & theNbVertexInWires) +int SMESH_Block::GetOrderedEdges (const TopoDS_Face& theFace, + TopoDS_Vertex theFirstVertex, + list< TopoDS_Edge >& theEdges, + list< int > & theNbVertexInWires) { // put wires in a list, so that an outer wire comes first list aWireList; @@ -740,22 +890,60 @@ static int getOrderedEdges (const TopoDS_Face& theFace, isFirst = ( p2.SquareDistance( pf ) < p2.SquareDistance( pl )); if ( isNext ? isFirst : !isFirst ) edge.Reverse(); + // to make a seam go first + if ( theFirstVertex.IsNull() ) + theFirstVertex = TopExp::FirstVertex( edge, true ); } } // rotate theEdges until it begins from theFirstVertex - if ( ! theFirstVertex.IsNull() ) - while ( !theFirstVertex.IsSame( TopExp::FirstVertex( theEdges.front(), true ))) + if ( ! theFirstVertex.IsNull() ) { + TopoDS_Vertex vv[2]; + TopExp::Vertices( theEdges.front(), vv[0], vv[1], true ); + // on closed face, make seam edge the first in the list + while ( !vv[0].IsSame( theFirstVertex ) || vv[0].IsSame( vv[1] )) { theEdges.splice(theEdges.end(), theEdges, - theEdges.begin(), ++ theEdges.begin()); - if ( iE++ > theNbVertexInWires.back() ) + theEdges.begin(), ++theEdges.begin()); + TopExp::Vertices( theEdges.front(), vv[0], vv[1], true ); + if ( iE++ > theNbVertexInWires.back() ) { +#ifdef _DEBUG_ + gp_Pnt p = BRep_Tool::Pnt( theFirstVertex ); + cout << " : Warning : vertex "<< theFirstVertex.TShape().operator->() + << " ( " << p.X() << " " << p.Y() << " " << p.Z() << " )" + << " not found in outer wire of face "<< theFace.TShape().operator->() + << " with vertices: " << endl; + wExp.Init( *wlIt, theFace ); + for ( int i = 0; wExp.More(); wExp.Next(), i++ ) + { + TopoDS_Edge edge = wExp.Current(); + edge = TopoDS::Edge( edge.Oriented( wExp.Orientation() )); + TopoDS_Vertex v = TopExp::FirstVertex( edge, true ); + gp_Pnt p = BRep_Tool::Pnt( v ); + cout << i << " " << v.TShape().operator->() << " " + << p.X() << " " << p.Y() << " " << p.Z() << " " << endl; + } +#endif break; // break infinite loop + } } - } + } + } // end outer wire } return aWireList.size(); } +//================================================================================ +/*! + * \brief Call it after geometry initialisation + */ +//================================================================================ + +void SMESH_Block::init() +{ + myNbIterations = 0; + mySumDist = 0; + myGridComputed = false; +} //======================================================================= //function : LoadMeshBlock @@ -770,10 +958,7 @@ bool SMESH_Block::LoadMeshBlock(const SMDS_MeshVolume* theVolume, vector& theOrderedNodes) { MESSAGE(" ::LoadMeshBlock()"); - - myNbIterations = 0; - mySumDist = 0; - myGridComputed = false; + init(); SMDS_VolumeTool vTool; if (!vTool.Set( theVolume ) || vTool.NbNodes() != 8 || @@ -868,59 +1053,21 @@ bool SMESH_Block::LoadMeshBlock(const SMDS_MeshVolume* theVolume, theOrderedNodes[ 7 ] = nn[ V111 ]; // fill edges - myEdge[ ID_Ex00 - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V000 - 1 ]; - myEdge[ ID_Ex00 - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V100 - 1 ]; - - myEdge[ ID_Ex10 - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V010 - 1 ]; - myEdge[ ID_Ex10 - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V110 - 1 ]; - - myEdge[ ID_Ex01 - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V001 - 1 ]; - myEdge[ ID_Ex01 - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V101 - 1 ]; - - myEdge[ ID_Ex11 - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V011 - 1 ]; - myEdge[ ID_Ex11 - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V111 - 1 ]; - - myEdge[ ID_E0y0 - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V000 - 1 ]; - myEdge[ ID_E0y0 - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V010 - 1 ]; - - myEdge[ ID_E1y0 - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V100 - 1 ]; - myEdge[ ID_E1y0 - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V110 - 1 ]; - - myEdge[ ID_E0y1 - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V001 - 1 ]; - myEdge[ ID_E0y1 - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V011 - 1 ]; - - myEdge[ ID_E1y1 - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V101 - 1 ]; - myEdge[ ID_E1y1 - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V111 - 1 ]; - - myEdge[ ID_E00z - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V000 - 1 ]; - myEdge[ ID_E00z - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V001 - 1 ]; - - myEdge[ ID_E10z - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V100 - 1 ]; - myEdge[ ID_E10z - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V101 - 1 ]; - - myEdge[ ID_E01z - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V010 - 1 ]; - myEdge[ ID_E01z - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V011 - 1 ]; - - myEdge[ ID_E11z - ID_Ex00 ].myNodes[ 0 ] = myPnt[ ID_V110 - 1 ]; - myEdge[ ID_E11z - ID_Ex00 ].myNodes[ 1 ] = myPnt[ ID_V111 - 1 ]; - - for ( iE = ID_Ex00; iE <= ID_E11z; ++iE ) - myEdge[ iE - ID_Ex00 ].myCoordInd = GetCoordIndOnEdge( iE ); + vector< int > vertexVec; + for ( iE = 0; iE < NbEdges(); ++iE ) { + GetEdgeVertexIDs(( iE + ID_FirstE ), vertexVec ); + myEdge[ iE ].Set(( iE + ID_FirstE ), + myPnt[ vertexVec[0] - 1 ], + myPnt[ vertexVec[1] - 1 ]); + } - // fill faces corners + // fill faces' corners for ( iF = ID_Fxy0; iF < ID_Shell; ++iF ) { - TFace& tFace = myFace[ iF - ID_Fxy0 ]; + TFace& tFace = myFace[ iF - ID_FirstF ]; vector< int > edgeIdVec(4, -1); GetFaceEdgesIDs( iF, edgeIdVec ); - tFace.myNodes[ 0 ] = myEdge[ edgeIdVec [ 0 ] - ID_Ex00 ].myNodes[ 1 ]; - tFace.myNodes[ 1 ] = myEdge[ edgeIdVec [ 0 ] - ID_Ex00 ].myNodes[ 0 ]; - tFace.myNodes[ 2 ] = myEdge[ edgeIdVec [ 1 ] - ID_Ex00 ].myNodes[ 0 ]; - tFace.myNodes[ 3 ] = myEdge[ edgeIdVec [ 1 ] - ID_Ex00 ].myNodes[ 1 ]; - tFace.myCoordInd[ 0 ] = GetCoordIndOnEdge( edgeIdVec[ 0 ] ); - tFace.myCoordInd[ 1 ] = GetCoordIndOnEdge( edgeIdVec[ 1 ] ); - tFace.myCoordInd[ 2 ] = GetCoordIndOnEdge( edgeIdVec[ 2 ] ); - tFace.myCoordInd[ 3 ] = GetCoordIndOnEdge( edgeIdVec[ 3 ] ); + tFace.Set( iF, myEdge[ edgeIdVec [ 0 ]], myEdge[ edgeIdVec [ 1 ]]); } return true; @@ -928,7 +1075,8 @@ bool SMESH_Block::LoadMeshBlock(const SMDS_MeshVolume* theVolume, //======================================================================= //function : LoadBlockShapes -//purpose : add sub-shapes of theBlock to theShapeIDMap so that they get +//purpose : Initialize block geometry with theShell, +// add sub-shapes of theBlock to theShapeIDMap so that they get // IDs acoording to enum TShapeID //======================================================================= @@ -938,11 +1086,22 @@ bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell, TopTools_IndexedMapOfOrientedShape& theShapeIDMap ) { MESSAGE(" ::LoadBlockShapes()"); + return ( FindBlockShapes( theShell, theVertex000, theVertex001, theShapeIDMap ) && + LoadBlockShapes( theShapeIDMap )); +} - myShell = theShell; - myNbIterations = 0; - mySumDist = 0; - myGridComputed = false; +//======================================================================= +//function : LoadBlockShapes +//purpose : add sub-shapes of theBlock to theShapeIDMap so that they get +// IDs acoording to enum TShapeID +//======================================================================= + +bool SMESH_Block::FindBlockShapes(const TopoDS_Shell& theShell, + const TopoDS_Vertex& theVertex000, + const TopoDS_Vertex& theVertex001, + TopTools_IndexedMapOfOrientedShape& theShapeIDMap ) +{ + MESSAGE(" ::FindBlockShapes()"); // 8 vertices TopoDS_Shape V000, V100, V010, V110, V001, V101, V011, V111; @@ -958,7 +1117,7 @@ bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell, const int NB_FACES_BY_VERTEX = 6; TopTools_IndexedDataMapOfShapeListOfShape vfMap; - TopExp::MapShapesAndAncestors( myShell, TopAbs_VERTEX, TopAbs_FACE, vfMap ); + TopExp::MapShapesAndAncestors( theShell, TopAbs_VERTEX, TopAbs_FACE, vfMap ); if ( vfMap.Extent() != 8 ) { MESSAGE(" Wrong nb of vertices in the block: " << vfMap.Extent() ); return false; @@ -982,7 +1141,7 @@ bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell, } // find vertex 001 - the one on the most vertical edge passing through V000 TopTools_IndexedDataMapOfShapeListOfShape veMap; - TopExp::MapShapesAndAncestors( myShell, TopAbs_VERTEX, TopAbs_EDGE, veMap ); + TopExp::MapShapesAndAncestors( theShell, TopAbs_VERTEX, TopAbs_EDGE, veMap ); gp_Vec dir001 = gp::DZ(); gp_Pnt p000 = BRep_Tool::Pnt( TopoDS::Vertex( V000 )); double maxVal = -DBL_MAX; @@ -1051,7 +1210,7 @@ bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell, // find bottom edges and veritices list< TopoDS_Edge > eList; list< int > nbVertexInWires; - getOrderedEdges( TopoDS::Face( Fxy0 ), TopoDS::Vertex( V000 ), eList, nbVertexInWires ); + GetOrderedEdges( TopoDS::Face( Fxy0 ), TopoDS::Vertex( V000 ), eList, nbVertexInWires ); if ( nbVertexInWires.size() != 1 || nbVertexInWires.front() != 4 ) { MESSAGE(" LoadBlockShapes() error "); return false; @@ -1073,7 +1232,7 @@ bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell, // find top edges and veritices eList.clear(); - getOrderedEdges( TopoDS::Face( Fxy1 ), TopoDS::Vertex( V001 ), eList, nbVertexInWires ); + GetOrderedEdges( TopoDS::Face( Fxy1 ), TopoDS::Vertex( V001 ), eList, nbVertexInWires ); if ( nbVertexInWires.size() != 1 || nbVertexInWires.front() != 4 ) { MESSAGE(" LoadBlockShapes() error "); return false; @@ -1097,7 +1256,7 @@ bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell, if ( V101.IsSame( exp.Current() ) || V100.IsSame( exp.Current() )) break; // V101 or V100 found if ( !exp.More() ) { // not found - TopoDS_Shape f = Fx0z; Fx0z = F0yz; F0yz = f; + std::swap( Fx0z, F0yz); } // find Fx1z and F1yz faces @@ -1132,7 +1291,7 @@ bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell, if ( V010.IsSame( exp.Current() ) || V011.IsSame( exp.Current() )) break; if ( !exp.More() ) { - TopoDS_Shape f = Fx1z; Fx1z = F1yz; F1yz = f; + std::swap( Fx1z, F1yz); } // find vertical edges @@ -1196,12 +1355,22 @@ bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell, theShapeIDMap.Add(F0yz); theShapeIDMap.Add(F1yz); - theShapeIDMap.Add(myShell); + theShapeIDMap.Add(theShell); - if ( theShapeIDMap.Extent() != 27 ) { - MESSAGE("LoadBlockShapes() " << theShapeIDMap.Extent() ); - return false; - } + return true; +} + +//================================================================================ +/*! + * \brief Initialize block geometry with shapes from theShapeIDMap + * \param theShapeIDMap - map of block subshapes + * \retval bool - is a success + */ +//================================================================================ + +bool SMESH_Block::LoadBlockShapes(const TopTools_IndexedMapOfOrientedShape& theShapeIDMap) +{ + init(); // store shapes geometry for ( int shapeID = 1; shapeID < theShapeIDMap.Extent(); shapeID++ ) @@ -1211,59 +1380,24 @@ bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell, { case TopAbs_VERTEX: { - if ( shapeID > ID_V111 ) { - MESSAGE(" shapeID =" << shapeID ); - return false; - } - myPnt[ shapeID - ID_V000 ] = - BRep_Tool::Pnt( TopoDS::Vertex( S )).XYZ(); + if ( !IsVertexID( ID_V111 )) return false; + myPnt[ shapeID - ID_V000 ] = BRep_Tool::Pnt( TopoDS::Vertex( S )).XYZ(); break; } case TopAbs_EDGE: { + if ( !IsEdgeID( shapeID )) return false; const TopoDS_Edge& edge = TopoDS::Edge( S ); - if ( shapeID < ID_Ex00 || shapeID > ID_E11z || edge.IsNull() ) { - MESSAGE(" shapeID =" << shapeID ); - return false; - } - TEdge& tEdge = myEdge[ shapeID - ID_Ex00 ]; - tEdge.myCoordInd = GetCoordIndOnEdge( shapeID ); - TopLoc_Location loc; - tEdge.myC3d = BRep_Tool::Curve( edge, loc, tEdge.myFirst, tEdge.myLast ); - if ( !IsForwardEdge( edge, theShapeIDMap )) - Swap( tEdge.myFirst, tEdge.myLast ); - tEdge.myTrsf = loc; + TEdge& tEdge = myEdge[ shapeID - ID_FirstE ]; + tEdge.Set( shapeID, + new BRepAdaptor_Curve( edge ), + IsForwardEdge( edge, theShapeIDMap )); break; } case TopAbs_FACE: { - const TopoDS_Face& face = TopoDS::Face( S ); - if ( shapeID < ID_Fxy0 || shapeID > ID_F1yz || face.IsNull() ) { - MESSAGE(" shapeID =" << shapeID ); + if ( !LoadFace( TopoDS::Face( S ), shapeID, theShapeIDMap )) return false; - } - TFace& tFace = myFace[ shapeID - ID_Fxy0 ]; - // pcurves - vector< int > edgeIdVec(4, -1); - GetFaceEdgesIDs( shapeID, edgeIdVec ); - for ( int iE = 0; iE < 4; iE++ ) // loop on 4 edges - { - const TopoDS_Edge& edge = TopoDS::Edge( theShapeIDMap( edgeIdVec[ iE ])); - tFace.myCoordInd[ iE ] = GetCoordIndOnEdge( edgeIdVec[ iE ] ); - tFace.myC2d[ iE ] = - BRep_Tool::CurveOnSurface( edge, face, tFace.myFirst[iE], tFace.myLast[iE] ); - if ( !IsForwardEdge( edge, theShapeIDMap )) - Swap( tFace.myFirst[ iE ], tFace.myLast[ iE ] ); - } - // 2d corners - tFace.myCorner[ 0 ] = tFace.myC2d[ 0 ]->Value( tFace.myFirst[0] ).XY(); - tFace.myCorner[ 1 ] = tFace.myC2d[ 0 ]->Value( tFace.myLast[0] ).XY(); - tFace.myCorner[ 2 ] = tFace.myC2d[ 1 ]->Value( tFace.myLast[1] ).XY(); - tFace.myCorner[ 3 ] = tFace.myC2d[ 1 ]->Value( tFace.myFirst[1] ).XY(); - // sufrace - TopLoc_Location loc; - tFace.myS = BRep_Tool::Surface( face, loc ); - tFace.myTrsf = loc; break; } default: break; @@ -1273,6 +1407,76 @@ bool SMESH_Block::LoadBlockShapes(const TopoDS_Shell& theShell, return true; } +//================================================================================ +/*! + * \brief Load face geometry + * \param theFace - face + * \param theFaceID - face in-block ID + * \param theShapeIDMap - map of block subshapes + * \retval bool - is a success + * + * It is enough to compute params or coordinates on the face. + * Face subshapes must be loaded into theShapeIDMap before + */ +//================================================================================ + +bool SMESH_Block::LoadFace(const TopoDS_Face& theFace, + const int theFaceID, + const TopTools_IndexedMapOfOrientedShape& theShapeIDMap) +{ + if ( !IsFaceID( theFaceID ) ) return false; + // pcurves + Adaptor2d_Curve2d* c2d[4]; + bool isForward[4]; + vector< int > edgeIdVec; + GetFaceEdgesIDs( theFaceID, edgeIdVec ); + for ( int iE = 0; iE < edgeIdVec.size(); iE++ ) // loop on 4 edges + { + if ( edgeIdVec[ iE ] > theShapeIDMap.Extent() ) + return false; + const TopoDS_Edge& edge = TopoDS::Edge( theShapeIDMap( edgeIdVec[ iE ])); + c2d[ iE ] = new BRepAdaptor_Curve2d( edge, theFace ); + isForward[ iE ] = IsForwardEdge( edge, theShapeIDMap ); + } + TFace& tFace = myFace[ theFaceID - ID_FirstF ]; + tFace.Set( theFaceID, new BRepAdaptor_Surface( theFace ), c2d, isForward ); + return true; +} + +//================================================================================ +/*! + * \brief/ Insert theShape into theShapeIDMap with theShapeID + * \param theShape - shape to insert + * \param theShapeID - shape in-block ID + * \param theShapeIDMap - map of block subshapes + */ +//================================================================================ + +bool SMESH_Block::Insert(const TopoDS_Shape& theShape, + const int theShapeID, + TopTools_IndexedMapOfOrientedShape& theShapeIDMap) +{ + if ( !theShape.IsNull() && theShapeID > 0 ) + { + if ( theShapeIDMap.Contains( theShape )) + return ( theShapeIDMap.FindIndex( theShape ) == theShapeID ); + + if ( theShapeID <= theShapeIDMap.Extent() ) { + theShapeIDMap.Substitute( theShapeID, theShape ); + } + else { + while ( theShapeIDMap.Extent() < theShapeID - 1 ) { + TopoDS_Compound comp; + BRep_Builder().MakeCompound( comp ); + theShapeIDMap.Add( comp ); + } + theShapeIDMap.Add( theShape ); + } + return true; + } + return false; +} + //======================================================================= //function : GetFaceEdgesIDs //purpose : return edges IDs in the order u0, u1, 0v, 1v @@ -1385,6 +1589,7 @@ void SMESH_Block::GetEdgeVertexIDs (const int edgeID, vector< int >& vertexVec ) vertexVec[ 1 ] = ID_V111; break; default: + vertexVec.resize(0); MESSAGE(" GetEdgeVertexIDs(), wrong edge ID: " << edgeID ); } } diff --git a/src/SMESH/SMESH_Block.hxx b/src/SMESH/SMESH_Block.hxx index 3a347a0f5..fd9ff01e3 100644 --- a/src/SMESH/SMESH_Block.hxx +++ b/src/SMESH/SMESH_Block.hxx @@ -25,12 +25,15 @@ #ifndef SMESH_Block_HeaderFile #define SMESH_Block_HeaderFile +#include "SMESH_SMESH.hxx" + #include #include #include #include #include #include +#include #include #include #include @@ -43,19 +46,26 @@ #include #include +#include class SMDS_MeshVolume; class SMDS_MeshNode; +class Adaptor3d_Surface; +class Adaptor2d_Curve2d; +class Adaptor3d_Curve; // ========================================================= // class calculating coordinates of 3D points by normalized // parameters inside the block and vice versa // ========================================================= -class SMESH_Block: public math_FunctionSetWithDerivatives +class SMESH_EXPORT SMESH_Block: public math_FunctionSetWithDerivatives { public: - enum TShapeID { // ids of the block sub-shapes + enum TShapeID { + // ---------------------------- + // Ids of the block sub-shapes + // ---------------------------- ID_NONE = 0, ID_V000 = 1, ID_V100, ID_V010, ID_V110, ID_V001, ID_V101, ID_V011, ID_V111, @@ -68,9 +78,17 @@ class SMESH_Block: public math_FunctionSetWithDerivatives ID_Shell }; + enum { // to use TShapeID for indexing certain type subshapes + + ID_FirstV = ID_V000, ID_FirstE = ID_Ex00, ID_FirstF = ID_Fxy0 + }; - public: // methods about ids of the block sub-shapes + + public: + // ------------------------------------------------- + // Block topology in terms of block sub-shapes' ids + // ------------------------------------------------- static int NbVertices() { return 8; } static int NbEdges() { return 12; } @@ -124,7 +142,10 @@ class SMESH_Block: public math_FunctionSetWithDerivatives // DEBUG: dump an id of a block sub-shape - public: // initialization + public: + // --------------- + // Initialization + // --------------- SMESH_Block (): myNbIterations(0), mySumDist(0.) {} @@ -132,49 +153,92 @@ class SMESH_Block: public math_FunctionSetWithDerivatives const TopoDS_Vertex& theVertex000, const TopoDS_Vertex& theVertex001, TopTools_IndexedMapOfOrientedShape& theShapeIDMap ); + // Initialize block geometry with theShell, // add sub-shapes of theBlock to theShapeIDMap so that they get // IDs acoording to enum TShapeID + bool LoadBlockShapes(const TopTools_IndexedMapOfOrientedShape& theShapeIDMap); + // Initialize block geometry with shapes from theShapeIDMap + bool LoadMeshBlock(const SMDS_MeshVolume* theVolume, const int theNode000Index, const int theNode001Index, vector& theOrderedNodes); // prepare to work with theVolume and - // return nodes in the order of TShapeID enum - + // return nodes in theVolume corners in the order of TShapeID enum + + bool LoadFace(const TopoDS_Face& theFace, + const int theFaceID, + const TopTools_IndexedMapOfOrientedShape& theShapeIDMap); + // Load face geometry. + // It is enough to compute params or coordinates on the face. + // Face subshapes must be loaded into theShapeIDMap before + + static bool Insert(const TopoDS_Shape& theShape, + const int theShapeID, + TopTools_IndexedMapOfOrientedShape& theShapeIDMap); + // Insert theShape into theShapeIDMap with theShapeID, + // Not yet set shapes preceding theShapeID are filled with compounds + // Return true if theShape was successfully bound to theShapeID + + static bool FindBlockShapes(const TopoDS_Shell& theShell, + const TopoDS_Vertex& theVertex000, + const TopoDS_Vertex& theVertex001, + TopTools_IndexedMapOfOrientedShape& theShapeIDMap ); + // add sub-shapes of theBlock to theShapeIDMap so that they get + // IDs acoording to enum TShapeID - public: // define coordinates by parameters +public: + // --------------------------------- + // Define coordinates by parameters + // --------------------------------- bool VertexPoint( const int theVertexID, gp_XYZ& thePoint ) const { if ( !IsVertexID( theVertexID )) return false; - thePoint = myPnt[ theVertexID - ID_V000 ]; return true; + thePoint = myPnt[ theVertexID - ID_FirstV ]; return true; } // return vertex coordinates, parameters are defined by theVertexID bool EdgePoint( const int theEdgeID, const gp_XYZ& theParams, gp_XYZ& thePoint ) const { if ( !IsEdgeID( theEdgeID )) return false; - thePoint = myEdge[ theEdgeID - ID_Ex00 ].Point( theParams ); return true; + thePoint = myEdge[ theEdgeID - ID_FirstE ].Point( theParams ); return true; } // return coordinates of a point on edge + bool EdgeU( const int theEdgeID, const gp_XYZ& theParams, double& theU ) const { + if ( !IsEdgeID( theEdgeID )) return false; + theU = myEdge[ theEdgeID - ID_FirstE ].GetU( theParams ); return true; + } + // return parameter on edge by in-block parameters + bool FacePoint( const int theFaceID, const gp_XYZ& theParams, gp_XYZ& thePoint ) const { if ( !IsFaceID ( theFaceID )) return false; - thePoint = myFace[ theFaceID - ID_Fxy0 ].Point( theParams ); return true; + thePoint = myFace[ theFaceID - ID_FirstF ].Point( theParams ); return true; } // return coordinates of a point on face + bool FaceUV( const int theFaceID, const gp_XYZ& theParams, gp_XY& theUV ) const { + if ( !IsFaceID ( theFaceID )) return false; + theUV = myFace[ theFaceID - ID_FirstF ].GetUV( theParams ); return true; + } + // return UV coordinates on a face by in-block parameters + bool ShellPoint( const gp_XYZ& theParams, gp_XYZ& thePoint ) const; // return coordinates of a point in shell static bool ShellPoint(const gp_XYZ& theParams, const vector& thePointOnShape, gp_XYZ& thePoint ); - // computes coordinates of a point in shell by points on sub-shapes; + // computes coordinates of a point in shell by points on sub-shapes + // and point parameters. // thePointOnShape[ subShapeID ] must be a point on a subShape; // thePointOnShape.size() == ID_Shell, thePointOnShape[0] not used - public: // define parameters by coordinates + public: + // --------------------------------- + // Define parameters by coordinates + // --------------------------------- bool ComputeParameters (const gp_Pnt& thePoint, gp_XYZ& theParams, @@ -189,22 +253,40 @@ class SMESH_Block: public math_FunctionSetWithDerivatives // return parameters of a point given by theU on edge - public: // services + public: + // --------------- + // Block geomerty + // --------------- - static bool IsForwardEdge (const TopoDS_Edge & theEdge, - TopTools_IndexedMapOfOrientedShape& theShapeIDMap) { + + + public: + // --------- + // Services + // --------- + + static bool IsForwardEdge (const TopoDS_Edge & theEdge, + const TopTools_IndexedMapOfOrientedShape& theShapeIDMap) { int v1ID = theShapeIDMap.FindIndex( TopExp::FirstVertex( theEdge ).Oriented( TopAbs_FORWARD )); int v2ID = theShapeIDMap.FindIndex( TopExp::LastVertex( theEdge ).Oriented( TopAbs_FORWARD )); return ( v1ID < v2ID ); } // Return true if an in-block parameter increases along theEdge curve - static void Swap(double& a, double& b) { double tmp = a; a = b; b = tmp; } - + static int GetOrderedEdges (const TopoDS_Face& theFace, + TopoDS_Vertex theFirstVertex, + std::list< TopoDS_Edge >& theEdges, + std::list< int > & theNbVertexInWires); + // Return nb wires and a list of oredered edges. + // It is used to assign indices to subshapes. + // theFirstVertex may be NULL. + // Always try to set a seam edge first public: - // methods of math_FunctionSetWithDerivatives used internally + // ----------------------------------------------------------- + // Methods of math_FunctionSetWithDerivatives used internally // to define parameters by coordinates + // ----------------------------------------------------------- Standard_Integer NbVariables() const; Standard_Integer NbEquations() const; Standard_Boolean Value(const math_Vector& X,math_Vector& F) ; @@ -212,41 +294,61 @@ class SMESH_Block: public math_FunctionSetWithDerivatives Standard_Boolean Values(const math_Vector& X,math_Vector& F,math_Matrix& D) ; Standard_Integer GetStateNumber (); - private: + protected: + + /*! + * \brief Call it after geometry initialisation + */ + void init(); - struct TEdge { + // Note: to compute params of a point on a face, it is enough to set + // TFace, TEdge's and points for that face only + + class SMESH_EXPORT TEdge { int myCoordInd; double myFirst; double myLast; - Handle(Geom_Curve) myC3d; - gp_Trsf myTrsf; - double GetU( const gp_XYZ& theParams ) const; - gp_XYZ Point( const gp_XYZ& theParams ) const; + Adaptor3d_Curve* myC3d; // if mesh volume gp_XYZ myNodes[2]; + public: + void Set( const int edgeID, Adaptor3d_Curve* curve, const bool isForward ); + void Set( const int edgeID, const gp_XYZ& node1, const gp_XYZ& node2 ); + Adaptor3d_Curve* GetCurve() const { return myC3d; } + double EndParam(int i) const { return i ? myLast : myFirst; } + int CoordInd() const { return myCoordInd; } + const gp_XYZ& NodeXYZ(int i) const { return i ? myNodes[1] : myNodes[0]; } + gp_XYZ Point( const gp_XYZ& theParams ) const; // Return coord by params + double GetU( const gp_XYZ& theParams ) const; // Return U by params + TEdge(): myC3d(0) {} + ~TEdge(); }; - struct TFace { + class SMESH_EXPORT TFace { // 4 edges in the order u0, u1, 0v, 1v int myCoordInd[ 4 ]; double myFirst [ 4 ]; double myLast [ 4 ]; - Handle(Geom2d_Curve) myC2d [ 4 ]; + Adaptor2d_Curve2d* myC2d [ 4 ]; // 4 corner points in the order 00, 10, 11, 01 gp_XY myCorner [ 4 ]; // surface - Handle(Geom_Surface) myS; - gp_Trsf myTrsf; + Adaptor3d_Surface* myS; + // if mesh volume + gp_XYZ myNodes[4]; + public: + void Set( const int faceID, Adaptor3d_Surface* S, // must be in GetFaceEdgesIDs() order: + Adaptor2d_Curve2d* c2d[4], const bool isForward[4] ); + void Set( const int faceID, const TEdge& edgeU0, const TEdge& edgeU1 ); gp_XY GetUV( const gp_XYZ& theParams ) const; gp_XYZ Point( const gp_XYZ& theParams ) const; int GetUInd() const { return myCoordInd[ 0 ]; } int GetVInd() const { return myCoordInd[ 2 ]; } void GetCoefs( int i, const gp_XYZ& theParams, double& eCoef, double& vCoef ) const; - // if mesh volume - gp_XYZ myNodes[4]; + TFace(): myS(0) { myC2d[0]=myC2d[1]=myC2d[2]=myC2d[3]=0; } + ~TFace(); }; - TopoDS_Shell myShell; // geometry in the order as in TShapeID: // 8 vertices gp_XYZ myPnt[ 8 ]; @@ -264,10 +366,10 @@ class SMESH_Block: public math_FunctionSetWithDerivatives gp_XYZ myPoint; // the given point gp_XYZ myParam; // the best parameters guess - double myValues[ 4 ]; // values computed at myParam + double myValues[ 4 ]; // values computed at myParam: function value and 3 derivatives typedef pair TxyzPair; - TxyzPair my3x3x3GridNodes[ 27 ]; + TxyzPair my3x3x3GridNodes[ 27 ]; // to compute the first param guess bool myGridComputed; }; diff --git a/src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx b/src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx index 16a847baa..1fee866c6 100644 --- a/src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx +++ b/src/SMESH/SMESH_DataMapOfElemPtrSequenceOfElemPtr.hxx @@ -26,10 +26,13 @@ #ifndef SMESH_DataMapOfElemPtrSequenceOfElemPtr_HeaderFile #define SMESH_DataMapOfElemPtrSequenceOfElemPtr_HeaderFile +#include "SMESH_SMESH.hxx" + #include #include +SMESH_EXPORT inline Standard_Integer HashCode(SMDS_MeshElementPtr theElem, const Standard_Integer theUpper) { @@ -37,6 +40,7 @@ inline Standard_Integer HashCode(SMDS_MeshElementPtr theElem, return HashCode(anElem,theUpper); } +SMESH_EXPORT inline Standard_Boolean IsEqual(SMDS_MeshElementPtr theOne, SMDS_MeshElementPtr theTwo) { diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx index 1febbb03a..9fa10ca3e 100644 --- a/src/SMESH/SMESH_Gen.cxx +++ b/src/SMESH/SMESH_Gen.cxx @@ -373,12 +373,21 @@ static bool checkMissing(SMESH_Gen* aGen, bool IsGlobalHypothesis = aGen->IsGlobalHypothesis( algo, aMesh ); if (!IsGlobalHypothesis || !globalChecked[ algo->GetDim() ]) { - INFOS( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ") - << "<" << algo->GetName() << "> misses some hypothesis"); + SMESH_Gen::TAlgoStateErrorName errName = SMESH_Gen::MISSING_HYPO; + SMESH_Hypothesis::Hypothesis_Status status; + algo->CheckHypothesis( aMesh, aSubMesh->GetSubShape(), status ); + if ( status == SMESH_Hypothesis::HYP_BAD_PARAMETER ) { + INFOS( "ERROR: hypothesis of " << (IsGlobalHypothesis ? "Global " : "Local ") + << "<" << algo->GetName() << "> has a bad parameter value"); + errName = SMESH_Gen::BAD_PARAM_VALUE; + } else { + INFOS( "ERROR: " << (IsGlobalHypothesis ? "Global " : "Local ") + << "<" << algo->GetName() << "> misses some hypothesis"); + } if (IsGlobalHypothesis) globalChecked[ algo->GetDim() ] = true; theErrors.push_back( SMESH_Gen::TAlgoStateError() ); - theErrors.back().Set( SMESH_Gen::MISSING_HYPO, algo, IsGlobalHypothesis ); + theErrors.back().Set( errName, algo, IsGlobalHypothesis ); } ret = false; break; @@ -613,7 +622,6 @@ bool SMESH_Gen::IsGlobalHypothesis(const SMESH_Hypothesis* theHyp, SMESH_Mesh& a SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) { -// MESSAGE("SMESH_Gen::GetAlgo"); SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() ); filter.And( filter.IsApplicableTo( aShape )); @@ -624,15 +632,6 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape) if ( algoList.empty() ) return NULL; - // Now it is checked in SMESH_Mesh::GetHypotheses() -// if (algoList.size() > 1 ) { // check if there is one algo several times -// list ::iterator algo = algoList.begin(); -// for ( ; algo != algoList.end(); ++algo ) -// if ( (*algo) != algoList.front() && -// (*algo)->GetName() != algoList.front()->GetName() ) -// return NULL; -// } - return const_cast ( static_cast( algoList.front() )); } diff --git a/src/SMESH/SMESH_Gen.hxx b/src/SMESH/SMESH_Gen.hxx index f2887c044..b7e8639d8 100644 --- a/src/SMESH/SMESH_Gen.hxx +++ b/src/SMESH/SMESH_Gen.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_GEN_HXX_ #define _SMESH_GEN_HXX_ +#include "SMESH_SMESH.hxx" + #include "Utils_SALOME_Exception.hxx" #include "SMESH_Hypothesis.hxx" @@ -52,7 +54,7 @@ typedef struct studyContextStruct SMESHDS_Document * myDocument; } StudyContextStruct; -class SMESH_Gen +class SMESH_EXPORT SMESH_Gen { public: SMESH_Gen(); @@ -69,7 +71,11 @@ class SMESH_Gen // if Compute() would fail because of some algo bad state - enum TAlgoStateErrorName { NONE=0, MISSING_ALGO, MISSING_HYPO, NOT_CONFORM_MESH }; + enum TAlgoStateErrorName { NONE=0, + MISSING_ALGO, + MISSING_HYPO, + NOT_CONFORM_MESH, + BAD_PARAM_VALUE }; struct TAlgoStateError { TAlgoStateErrorName _name; diff --git a/src/SMESH/SMESH_Group.hxx b/src/SMESH/SMESH_Group.hxx index 72ee80a79..1b13bc578 100644 --- a/src/SMESH/SMESH_Group.hxx +++ b/src/SMESH/SMESH_Group.hxx @@ -28,6 +28,8 @@ #ifndef _SMESH_Group_HeaderFile #define _SMESH_Group_HeaderFile +#include "SMESH_SMESH.hxx" + #include #include #include @@ -36,7 +38,7 @@ class SMESHDS_GroupBase; class SMESH_Mesh; -class SMESH_Group +class SMESH_EXPORT SMESH_Group { public: diff --git a/src/SMESH/SMESH_HypoFilter.hxx b/src/SMESH/SMESH_HypoFilter.hxx index a56d7d0f7..ca883167e 100644 --- a/src/SMESH/SMESH_HypoFilter.hxx +++ b/src/SMESH/SMESH_HypoFilter.hxx @@ -29,6 +29,8 @@ #ifndef SMESH_HypoFilter_HeaderFile #define SMESH_HypoFilter_HeaderFile +#include "SMESH_SMESH.hxx" + // =========================== // Filter of SMESH_Hypothesis // =========================== @@ -40,7 +42,7 @@ class SMESH_HypoFilter; class SMESH_Hypothesis; -class SMESH_HypoPredicate { +class SMESH_EXPORT SMESH_HypoPredicate { public: virtual bool IsOk(const SMESH_Hypothesis* aHyp, const TopoDS_Shape& aShape) const = 0; @@ -51,7 +53,7 @@ class SMESH_HypoPredicate { friend class SMESH_HypoFilter; }; -class SMESH_HypoFilter: public SMESH_HypoPredicate +class SMESH_EXPORT SMESH_HypoFilter: public SMESH_HypoPredicate { public: // Create and add predicates. diff --git a/src/SMESH/SMESH_Hypothesis.cxx b/src/SMESH/SMESH_Hypothesis.cxx index cc179d31c..36564d322 100644 --- a/src/SMESH/SMESH_Hypothesis.cxx +++ b/src/SMESH/SMESH_Hypothesis.cxx @@ -26,13 +26,13 @@ // Module : SMESH // $Header$ -using namespace std; -using namespace std; #include "SMESH_Hypothesis.hxx" #include "SMESH_Gen.hxx" #include "SMESH_subMesh.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * diff --git a/src/SMESH/SMESH_Hypothesis.hxx b/src/SMESH/SMESH_Hypothesis.hxx index 3a8c3d2e6..f4a4d18d2 100644 --- a/src/SMESH/SMESH_Hypothesis.hxx +++ b/src/SMESH/SMESH_Hypothesis.hxx @@ -29,13 +29,15 @@ #ifndef _SMESH_HYPOTHESIS_HXX_ #define _SMESH_HYPOTHESIS_HXX_ +#include "SMESH_SMESH.hxx" + #include "SMESHDS_Hypothesis.hxx" class SMESH_Gen; class TopoDS_Shape; class SMESH_Mesh; -class SMESH_Hypothesis: public SMESHDS_Hypothesis +class SMESH_EXPORT SMESH_Hypothesis: public SMESHDS_Hypothesis { public: enum Hypothesis_Status // in the order of severity @@ -50,7 +52,8 @@ public: HYP_NOTCONFORM, // not conform mesh is produced appling a hypothesis HYP_ALREADY_EXIST,// such hypothesis already exist HYP_BAD_DIM, // bad dimension - HYP_BAD_SUBSHAPE // shape is neither the main one, nor its subshape, nor a group + HYP_BAD_SUBSHAPE, // shape is neither the main one, nor its subshape, nor a group + HYP_BAD_GEOMETRY // shape geometry mismatches algorithm's expectation }; static bool IsStatusFatal(Hypothesis_Status theStatus) { return theStatus >= HYP_UNKNOWN_FATAL; } diff --git a/src/SMESH/SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx b/src/SMESH/SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx index 952bb972d..678e995c9 100644 --- a/src/SMESH/SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx +++ b/src/SMESH/SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx @@ -26,16 +26,14 @@ #ifndef SMESH_IndexedMapOfShape_HeaderFile #define SMESH_IndexedMapOfShape_HeaderFile +#include "SMESH_SMESH.hxx" + +#include "SMESHDS_DataMapOfShape.hxx" + #include #include -inline Standard_Boolean IsEqual(const TopoDS_Shape& S1, - const TopoDS_Shape& S2) -{ - return S1.IsSame(S2); -} - /// Class SMESH_IndexedMapOfShape DEFINE_BASECOLLECTION (SMESH_BaseCollectionShape, TopoDS_Shape) diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx index a56b7a826..8181e062b 100644 --- a/src/SMESH/SMESH_Mesh.cxx +++ b/src/SMESH/SMESH_Mesh.cxx @@ -72,6 +72,7 @@ static int MYDEBUG = 0; static int MYDEBUG = 0; #endif +#define cSMESH_Hyp(h) static_cast(h) //============================================================================= /*! @@ -359,21 +360,17 @@ SMESH_Hypothesis::Hypothesis_Status // shape - int event; - if (anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO) - event = SMESH_subMesh::ADD_HYP; - else - event = SMESH_subMesh::ADD_ALGO; + bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO ); + int event = isAlgo ? SMESH_subMesh::ADD_ALGO : SMESH_subMesh::ADD_HYP; + SMESH_Hypothesis::Hypothesis_Status ret = subMesh->AlgoStateEngine(event, anHyp); // subShapes if (!SMESH_Hypothesis::IsStatusFatal(ret) && - !subMesh->IsApplicableHypotesis( anHyp )) // is added on father + anHyp->GetDim() <= SMESH_Gen::GetShapeDim(aSubShape)) // is added on father { - if (anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO) - event = SMESH_subMesh::ADD_FATHER_HYP; - else - event = SMESH_subMesh::ADD_FATHER_ALGO; + event = isAlgo ? SMESH_subMesh::ADD_FATHER_ALGO : SMESH_subMesh::ADD_FATHER_HYP; + SMESH_Hypothesis::Hypothesis_Status ret2 = subMesh->SubMeshesAlgoStateEngine(event, anHyp); if (ret2 > ret) @@ -444,14 +441,12 @@ SMESH_Hypothesis::Hypothesis_Status SMESH_Hypothesis *anHyp = sc->mapHypothesis[anHypId]; int hypType = anHyp->GetType(); if(MYDEBUG) SCRUTE(hypType); - int event; // shape - if (anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO) - event = SMESH_subMesh::REMOVE_HYP; - else - event = SMESH_subMesh::REMOVE_ALGO; + bool isAlgo = ( !anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO ); + int event = isAlgo ? SMESH_subMesh::REMOVE_ALGO : SMESH_subMesh::REMOVE_HYP; + SMESH_Hypothesis::Hypothesis_Status ret = subMesh->AlgoStateEngine(event, anHyp); // there may appear concurrent hyps that were covered by the removed hyp @@ -462,12 +457,10 @@ SMESH_Hypothesis::Hypothesis_Status // subShapes if (!SMESH_Hypothesis::IsStatusFatal(ret) && - !subMesh->IsApplicableHypotesis( anHyp )) // is removed from father + anHyp->GetDim() <= SMESH_Gen::GetShapeDim(aSubShape)) // is removed from father { - if (anHyp->GetType() == SMESHDS_Hypothesis::PARAM_ALGO) - event = SMESH_subMesh::REMOVE_FATHER_HYP; - else - event = SMESH_subMesh::REMOVE_FATHER_ALGO; + event = isAlgo ? SMESH_subMesh::REMOVE_FATHER_ALGO : SMESH_subMesh::REMOVE_FATHER_HYP; + SMESH_Hypothesis::Hypothesis_Status ret2 = subMesh->SubMeshesAlgoStateEngine(event, anHyp); if (ret2 > ret) // more severe @@ -521,8 +514,13 @@ SMESH_Mesh::GetHypothesisList(const TopoDS_Shape & aSubShape) const } //======================================================================= -//function : GetHypothesis -//purpose : +/*! + * \brief Return the hypothesis assigned to the shape + * \param aSubShape - the shape to check + * \param aFilter - the hypothesis filter + * \param andAncestors - flag to check hypos assigned to ancestors of the shape + * \retval SMESH_Hypothesis* - the first hypo passed through aFilter + */ //======================================================================= const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape & aSubShape, @@ -533,7 +531,7 @@ const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape & aSubS const list& hypList = _myMeshDS->GetHypothesis(aSubShape); list::const_iterator hyp = hypList.begin(); for ( ; hyp != hypList.end(); hyp++ ) { - const SMESH_Hypothesis * h = static_cast( *hyp ); + const SMESH_Hypothesis * h = cSMESH_Hyp( *hyp ); if ( aFilter.IsOk( h, aSubShape)) return h; } @@ -546,7 +544,7 @@ const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape & aSubS const list& hypList = _myMeshDS->GetHypothesis(it.Value()); list::const_iterator hyp = hypList.begin(); for ( ; hyp != hypList.end(); hyp++ ) { - const SMESH_Hypothesis * h = static_cast( *hyp ); + const SMESH_Hypothesis * h = cSMESH_Hyp( *hyp ); if (aFilter.IsOk( h, it.Value() )) return h; } @@ -555,11 +553,6 @@ const SMESH_Hypothesis * SMESH_Mesh::GetHypothesis(const TopoDS_Shape & aSubS return 0; } -//======================================================================= -//function : GetHypotheses -//purpose : -//======================================================================= - //================================================================================ /*! * \brief Return hypothesis assigned to the shape @@ -579,21 +572,30 @@ int SMESH_Mesh::GetHypotheses(const TopoDS_Shape & aSubShape, set hypTypes; // to exclude same type hypos from the result list int nbHyps = 0; + // only one main hypothesis is allowed + bool mainHypFound = false; + // fill in hypTypes list::const_iterator hyp; - for ( hyp = aHypList.begin(); hyp != aHypList.end(); hyp++ ) + for ( hyp = aHypList.begin(); hyp != aHypList.end(); hyp++ ) { if ( hypTypes.insert( (*hyp)->GetName() ).second ) nbHyps++; + if ( !cSMESH_Hyp(*hyp)->IsAuxiliary() ) + mainHypFound = true; + } // get hypos from aSubShape { const list& hypList = _myMeshDS->GetHypothesis(aSubShape); for ( hyp = hypList.begin(); hyp != hypList.end(); hyp++ ) - if ( aFilter.IsOk (static_cast( *hyp ), aSubShape) && + if ( aFilter.IsOk (cSMESH_Hyp( *hyp ), aSubShape) && + ( cSMESH_Hyp(*hyp)->IsAuxiliary() || !mainHypFound ) && hypTypes.insert( (*hyp)->GetName() ).second ) { aHypList.push_back( *hyp ); nbHyps++; + if ( !cSMESH_Hyp(*hyp)->IsAuxiliary() ) + mainHypFound = true; } } @@ -608,10 +610,14 @@ int SMESH_Mesh::GetHypotheses(const TopoDS_Shape & aSubShape, continue; const list& hypList = _myMeshDS->GetHypothesis(it.Value()); for ( hyp = hypList.begin(); hyp != hypList.end(); hyp++ ) - if (aFilter.IsOk( static_cast( *hyp ), it.Value() ) && - hypTypes.insert( (*hyp)->GetName() ).second ) { + if (aFilter.IsOk( cSMESH_Hyp( *hyp ), it.Value() ) && + ( cSMESH_Hyp(*hyp)->IsAuxiliary() || !mainHypFound ) && + hypTypes.insert( (*hyp)->GetName() ).second ) + { aHypList.push_back( *hyp ); nbHyps++; + if ( !cSMESH_Hyp(*hyp)->IsAuxiliary() ) + mainHypFound = true; } } } @@ -812,7 +818,7 @@ void SMESH_Mesh::NotifySubMeshesHypothesisModification(const SMESH_Hypothesis* t { Unexpect aCatch(SalomeException); - const SMESH_Hypothesis* hyp = static_cast(theChangedHyp); + const SMESH_Hypothesis* hyp = cSMESH_Hyp(theChangedHyp); const SMESH_Algo *foundAlgo = 0; SMESH_HypoFilter algoKind( SMESH_HypoFilter::IsAlgo() ); diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx index 0e6e1aabe..35bd13d50 100644 --- a/src/SMESH/SMESH_Mesh.hxx +++ b/src/SMESH/SMESH_Mesh.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_MESH_HXX_ #define _SMESH_MESH_HXX_ +#include "SMESH_SMESH.hxx" + #include "SMESH_Hypothesis.hxx" //#include "SMESH_subMesh.hxx" @@ -74,7 +76,7 @@ class SMESH_HypoFilter; //typedef NMTTools_IndexedDataMapOfShapeIndexedMapOfShape IndexedMapOfChain; typedef SMESH_IndexedDataMapOfShapeIndexedMapOfShape IndexedMapOfChain; -class SMESH_Mesh +class SMESH_EXPORT SMESH_Mesh { SMESH_Mesh(); SMESH_Mesh(const SMESH_Mesh&); diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx index c0a3b2771..3ace850f3 100644 --- a/src/SMESH/SMESH_MeshEditor.cxx +++ b/src/SMESH/SMESH_MeshEditor.cxx @@ -73,7 +73,6 @@ using namespace std; using namespace SMESH::Controls; -typedef map TNodeNodeMap; typedef map > TElemOfNodeListMap; typedef map > TElemOfElemListMap; typedef map > TNodeOfNodeListMap; @@ -83,7 +82,7 @@ typedef TNodeOfNodeListMap::iterator TNodeOfNode typedef map > TElemOfVecOfNnlmiMap; //typedef map > TElemOfVecOfMapNodesMap; -typedef pair NLink; +typedef pair< const SMDS_MeshNode*, const SMDS_MeshNode* > NLink; //======================================================================= //function : SMESH_MeshEditor @@ -874,7 +873,7 @@ bool SMESH_MeshEditor::QuadToTri (map & theElems, } else { - // split qudratic quadrangle + // split quadratic quadrangle // get surface elem is on if ( aShapeId != helper.GetSubShapeID() ) { @@ -945,7 +944,7 @@ bool SMESH_MeshEditor::QuadToTri (map & theElems, } aMesh->ChangeElementNodes( elem, N, 6 ); - } // qudratic case + } // quadratic case // care of a new element @@ -2579,8 +2578,8 @@ void SMESH_MeshEditor::Smooth (map & theElems, // iNotSame is where prevNodes and nextNodes are different //======================================================================= -static bool isReverse(const SMDS_MeshNode* prevNodes[], - const SMDS_MeshNode* nextNodes[], +static bool isReverse(vector prevNodes, + vector nextNodes, const int nbNodes, const int iNotSame) { @@ -2617,12 +2616,18 @@ static void sweepElement(SMESHDS_Mesh* aMesh, // Loop on elem nodes: // find new nodes and detect same nodes indices int nbNodes = elem->NbNodes(); - list::const_iterator itNN[ nbNodes ]; - const SMDS_MeshNode* prevNod[ nbNodes ], *nextNod[ nbNodes ], *midlNod[ nbNodes ]; + //list::const_iterator itNN[ nbNodes ]; + vector::const_iterator> itNN( nbNodes ); + //const SMDS_MeshNode* prevNod[ nbNodes ], *nextNod[ nbNodes ]; + vector prevNod( nbNodes ); + vector nextNod( nbNodes ); + vector midlNod( nbNodes ); + int iNode, nbSame = 0, iNotSameNode = 0, iSameNode = 0; vector sames(nbNodes); - bool issimple[nbNodes]; + //bool issimple[nbNodes]; + vector issimple(nbNodes); for ( iNode = 0; iNode < nbNodes; iNode++ ) { TNodeOfNodeListMapItr nnIt = newNodesItVec[ iNode ]; @@ -4274,7 +4279,8 @@ int SMESH_MeshEditor::SimplifyFace (const vector faceNode set nodeSet; // get simple seq of nodes - const SMDS_MeshNode* simpleNodes[ nbNodes ]; + //const SMDS_MeshNode* simpleNodes[ nbNodes ]; + vector simpleNodes( nbNodes ); int iSimple = 0, nbUnique = 0; simpleNodes[iSimple++] = faceNodes[0]; @@ -4364,7 +4370,7 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) list& nodes = *grIt; list::iterator nIt = nodes.begin(); const SMDS_MeshNode* nToKeep = *nIt; - for ( ; nIt != nodes.end(); nIt++ ) { + for ( ++nIt; nIt != nodes.end(); nIt++ ) { const SMDS_MeshNode* nToRemove = *nIt; nodeNodeMap.insert( TNodeNodeMap::value_type( nToRemove, nToKeep )); if ( nToRemove != nToKeep ) { @@ -4388,8 +4394,12 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) int aShapeId = FindShape( elem ); set nodeSet; - const SMDS_MeshNode* curNodes[ nbNodes ], *uniqueNodes[ nbNodes ]; - int iUnique = 0, iCur = 0, nbRepl = 0, iRepl [ nbNodes ]; + //const SMDS_MeshNode* curNodes[ nbNodes ], *uniqueNodes[ nbNodes ]; + const SMDS_MeshNode** curNodes = new const SMDS_MeshNode*[ nbNodes ]; + const SMDS_MeshNode** uniqueNodes = new const SMDS_MeshNode*[ nbNodes ]; + + int iUnique = 0, iCur = 0, nbRepl = 0; + vector iRepl( nbNodes ); // get new seq of nodes SMDS_ElemIteratorPtr itN = elem->nodesIterator(); @@ -4873,13 +4883,14 @@ void SMESH_MeshEditor::MergeNodes (TListOfListOfNodes & theGroupsOfNodes) rmElemIds.push_back( elem->GetID() ); } + delete curNodes; + delete uniqueNodes; } // loop on elements // Remove equal nodes and bad elements Remove( rmNodeIds, true ); Remove( rmElemIds, false ); - } @@ -4989,7 +5000,9 @@ const SMDS_MeshElement* continue; // get face nodes and find index of n1 int i1, nbN = elem->NbNodes(), iNode = 0; - const SMDS_MeshNode* faceNodes[ nbN ], *n; + //const SMDS_MeshNode* faceNodes[ nbN ], *n; + vector faceNodes( nbN ); + const SMDS_MeshNode* n; SMDS_ElemIteratorPtr nIt = elem->nodesIterator(); while ( nIt->more() ) { faceNodes[ iNode ] = static_cast( nIt->next() ); @@ -5064,17 +5077,17 @@ static const SMDS_MeshElement* findAdjacentFace(const SMDS_MeshNode* n1, } //======================================================================= -//function : findFreeBorder +//function : FindFreeBorder //purpose : //======================================================================= #define ControlFreeBorder SMESH::Controls::FreeEdges::IsFreeEdge -static bool findFreeBorder (const SMDS_MeshNode* theFirstNode, - const SMDS_MeshNode* theSecondNode, - const SMDS_MeshNode* theLastNode, - list< const SMDS_MeshNode* > & theNodes, - list< const SMDS_MeshElement* > & theFaces) +bool SMESH_MeshEditor::FindFreeBorder (const SMDS_MeshNode* theFirstNode, + const SMDS_MeshNode* theSecondNode, + const SMDS_MeshNode* theLastNode, + list< const SMDS_MeshNode* > & theNodes, + list< const SMDS_MeshElement* >& theFaces) { if ( !theFirstNode || !theSecondNode ) return false; @@ -5106,7 +5119,9 @@ static bool findFreeBorder (const SMDS_MeshNode* theFirstNode, if ( e == curElem || foundElems.insert( e ).second ) { // get nodes int iNode = 0, nbNodes = e->NbNodes(); - const SMDS_MeshNode* nodes[nbNodes+1]; + //const SMDS_MeshNode* nodes[nbNodes+1]; + vector nodes(nbNodes+1); + if(e->IsQuadratic()) { const SMDS_QuadraticFaceOfNodes* F = static_cast(e); @@ -5173,7 +5188,7 @@ static bool findFreeBorder (const SMDS_MeshNode* theFirstNode, cNL = & contNodes[ contNodes[0].empty() ? 0 : 1 ]; cFL = & contFaces[ contFaces[0].empty() ? 0 : 1 ]; // find one more free border - if ( ! findFreeBorder( nIgnore, nStart, theLastNode, *cNL, *cFL )) { + if ( ! FindFreeBorder( nStart, *nStartIt, theLastNode, *cNL, *cFL )) { cNL->clear(); cFL->clear(); } @@ -5217,7 +5232,7 @@ bool SMESH_MeshEditor::CheckFreeBorderNodes(const SMDS_MeshNode* theNode1, { list< const SMDS_MeshNode* > nodes; list< const SMDS_MeshElement* > faces; - return findFreeBorder( theNode1, theNode2, theNode3, nodes, faces); + return FindFreeBorder( theNode1, theNode2, theNode3, nodes, faces); } //======================================================================= @@ -5253,7 +5268,7 @@ SMESH_MeshEditor::Sew_Error // Free border 1 // -------------- - if (!findFreeBorder(theBordFirstNode,theBordSecondNode,theBordLastNode, + if (!FindFreeBorder(theBordFirstNode,theBordSecondNode,theBordLastNode, nSide[0], eSide[0])) { MESSAGE(" Free Border 1 not found " ); aResult = SEW_BORDER1_NOT_FOUND; @@ -5261,7 +5276,7 @@ SMESH_MeshEditor::Sew_Error if (theSideIsFreeBorder) { // Free border 2 // -------------- - if (!findFreeBorder(theSideFirstNode, theSideSecondNode, theSideThirdNode, + if (!FindFreeBorder(theSideFirstNode, theSideSecondNode, theSideThirdNode, nSide[1], eSide[1])) { MESSAGE(" Free Border 2 not found " ); aResult = ( aResult != SEW_OK ? SEW_BOTH_BORDERS_NOT_FOUND : SEW_BORDER2_NOT_FOUND ); @@ -5366,13 +5381,15 @@ SMESH_MeshEditor::Sew_Error checkedLinkIDs.clear(); gp_XYZ prevXYZ( prevSideNode->X(), prevSideNode->Y(), prevSideNode->Z() ); - SMDS_ElemIteratorPtr invElemIt - = prevSideNode->GetInverseElementIterator(); - while ( invElemIt->more() ) { // loop on inverse elements on the Side 2 + // loop on inverse elements of current node (prevSideNode) on the Side 2 + SMDS_ElemIteratorPtr invElemIt = prevSideNode->GetInverseElementIterator(); + while ( invElemIt->more() ) + { const SMDS_MeshElement* elem = invElemIt->next(); - // prepare data for a loop on links, of a face or a volume + // prepare data for a loop on links coming to prevSideNode, of a face or a volume int iPrevNode, iNode = 0, nbNodes = elem->NbNodes(); - const SMDS_MeshNode* faceNodes[ nbNodes ]; + //const SMDS_MeshNode* faceNodes[ nbNodes ]; + const SMDS_MeshNode** faceNodes = new const SMDS_MeshNode*[ nbNodes ]; bool isVolume = volume.Set( elem ); const SMDS_MeshNode** nodes = isVolume ? volume.GetNodes() : faceNodes; if ( isVolume ) // --volume @@ -5421,11 +5438,12 @@ SMESH_MeshEditor::Sew_Error long iLink = aLinkID_Gen.GetLinkID( prevSideNode, n ); bool isJustChecked = !checkedLinkIDs.insert( iLink ).second; if (!isJustChecked && - foundSideLinkIDs.find( iLink ) == foundSideLinkIDs.end() ) { + foundSideLinkIDs.find( iLink ) == foundSideLinkIDs.end() ) + { // test a link geometrically gp_XYZ nextXYZ ( n->X(), n->Y(), n->Z() ); bool linkIsBetter = false; - double dot, dist; + double dot = 0.0, dist = 0.0; if ( searchByDir ) { // choose most co-directed link dot = bordDir * ( nextXYZ - prevXYZ ).Normalized(); linkIsBetter = ( dot > maxDot ); @@ -5443,6 +5461,7 @@ SMESH_MeshEditor::Sew_Error } } } + delete faceNodes; } // loop on inverse elements of prevSideNode if ( !sideNode ) { @@ -5460,6 +5479,7 @@ SMESH_MeshEditor::Sew_Error // find the next border link to compare with gp_XYZ sidePos( sideNode->X(), sideNode->Y(), sideNode->Z() ); searchByDir = ( bordDir * ( sidePos - bordPos ) <= 0 ); + // move to next border node if sideNode is before forward border node (bordPos) while ( *nBordIt != theBordLastNode && !searchByDir ) { prevBordNode = *nBordIt; nBordIt++; @@ -5504,7 +5524,10 @@ SMESH_MeshEditor::Sew_Error // insert new nodes into the border and the side to get equal nb of segments // get normalized parameters of nodes on the borders - double param[ 2 ][ maxNbNodes ]; + //double param[ 2 ][ maxNbNodes ]; + double* param[ 2 ]; + param[0] = new double [ maxNbNodes ]; + param[1] = new double [ maxNbNodes ]; int iNode, iBord; for ( iBord = 0; iBord < 2; iBord++ ) { // loop on 2 borders list< const SMDS_MeshNode* >& nodes = nSide[ iBord ]; @@ -5665,6 +5688,8 @@ SMESH_MeshEditor::Sew_Error } } + delete param[0]; + delete param[1]; } // end: insert new nodes MergeNodes ( nodeGroupsToMerge ); @@ -5689,7 +5714,8 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theFace, // find indices of 2 link nodes and of the rest nodes int iNode = 0, il1, il2, i3, i4; il1 = il2 = i3 = i4 = -1; - const SMDS_MeshNode* nodes[ theFace->NbNodes() ]; + //const SMDS_MeshNode* nodes[ theFace->NbNodes() ]; + vector nodes( theFace->NbNodes() ); if(theFace->IsQuadratic()) { const SMDS_QuadraticFaceOfNodes* F = @@ -5818,7 +5844,8 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theFace, // put aNodesToInsert between theBetweenNode1 and theBetweenNode2 int nbLinkNodes = 2 + aNodesToInsert.size(); - const SMDS_MeshNode* linkNodes[ nbLinkNodes ]; + //const SMDS_MeshNode* linkNodes[ nbLinkNodes ]; + vector linkNodes( nbLinkNodes ); linkNodes[ 0 ] = nodes[ il1 ]; linkNodes[ nbLinkNodes - 1 ] = nodes[ il2 ]; list::iterator nIt = aNodesToInsert.begin(); @@ -5985,7 +6012,8 @@ void SMESH_MeshEditor::InsertNodesIntoLink(const SMDS_MeshElement* theFace, } // create needed triangles using n1,n2,n3 and inserted nodes int nbn = 2 + aNodesToInsert.size(); - const SMDS_MeshNode* aNodes[nbn]; + //const SMDS_MeshNode* aNodes[nbn]; + vector aNodes(nbn); aNodes[0] = nodes[n1]; aNodes[nbn-1] = nodes[n2]; list::iterator nIt = aNodesToInsert.begin(); @@ -6731,15 +6759,15 @@ SMESH_MeshEditor::Sew_Error set< long > linkIdSet; // links to process linkIdSet.insert( aLinkID_Gen.GetLinkID( theFirstNode1, theSecondNode1 )); - typedef pair< const SMDS_MeshNode*, const SMDS_MeshNode* > TPairOfNodes; - list< TPairOfNodes > linkList[2]; - linkList[0].push_back( TPairOfNodes( theFirstNode1, theSecondNode1 )); - linkList[1].push_back( TPairOfNodes( theFirstNode2, theSecondNode2 )); + typedef pair< const SMDS_MeshNode*, const SMDS_MeshNode* > NLink; + list< NLink > linkList[2]; + linkList[0].push_back( NLink( theFirstNode1, theSecondNode1 )); + linkList[1].push_back( NLink( theFirstNode2, theSecondNode2 )); // loop on links in linkList; find faces by links and append links // of the found faces to linkList - list< TPairOfNodes >::iterator linkIt[] = { linkList[0].begin(), linkList[1].begin() } ; + list< NLink >::iterator linkIt[] = { linkList[0].begin(), linkList[1].begin() } ; for ( ; linkIt[0] != linkList[0].end(); linkIt[0]++, linkIt[1]++ ) { - TPairOfNodes link[] = { *linkIt[0], *linkIt[1] }; + NLink link[] = { *linkIt[0], *linkIt[1] }; long linkID = aLinkID_Gen.GetLinkID( link[0].first, link[0].second ); if ( linkIdSet.find( linkID ) == linkIdSet.end() ) continue; @@ -6946,8 +6974,8 @@ SMESH_MeshEditor::Sew_Error //const SMDS_MeshNode* n2 = nodes[ iNode + 1]; const SMDS_MeshNode* n1 = fnodes1[ iNode ]; const SMDS_MeshNode* n2 = fnodes1[ iNode + 1]; - linkList[0].push_back ( TPairOfNodes( n1, n2 )); - linkList[1].push_back ( TPairOfNodes( nReplaceMap[n1], nReplaceMap[n2] )); + linkList[0].push_back ( NLink( n1, n2 )); + linkList[1].push_back ( NLink( nReplaceMap[n1], nReplaceMap[n2] )); } } } // 2 faces found @@ -7010,3 +7038,187 @@ SMESH_MeshEditor::Sew_Error return aResult; } + +/*! + * \brief A sorted pair of nodes + */ +struct TLink: public NLink +{ + TLink(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2 ):NLink( n1, n2 ) + { if ( n1 < n2 ) std::swap( first, second ); } + TLink(const NLink& link ):NLink( link ) + { if ( first < second ) std::swap( first, second ); } +}; + +//================================================================================ + /*! + * \brief Find corresponding nodes in two sets of faces + * \param theSide1 - first face set + * \param theSide2 - second first face + * \param theFirstNode1 - a boundary node of set 1 + * \param theFirstNode2 - a node of set 2 corresponding to theFirstNode1 + * \param theSecondNode1 - a boundary node of set 1 linked with theFirstNode1 + * \param theSecondNode2 - a node of set 2 corresponding to theSecondNode1 + * \param nReplaceMap - output map of corresponding nodes + * \retval bool - is a success or not + */ +//================================================================================ + +//#define DEBUG_MATCHING_NODES + +SMESH_MeshEditor::Sew_Error +SMESH_MeshEditor::FindMatchingNodes(set& theSide1, + set& theSide2, + const SMDS_MeshNode* theFirstNode1, + const SMDS_MeshNode* theFirstNode2, + const SMDS_MeshNode* theSecondNode1, + const SMDS_MeshNode* theSecondNode2, + TNodeNodeMap & nReplaceMap) +{ + set * faceSetPtr[] = { &theSide1, &theSide2 }; + + nReplaceMap.clear(); + if ( theFirstNode1 != theFirstNode2 ) + nReplaceMap.insert( make_pair( theFirstNode1, theFirstNode2 )); + if ( theSecondNode1 != theSecondNode2 ) + nReplaceMap.insert( make_pair( theSecondNode1, theSecondNode2 )); + + set< TLink > linkSet; // set of nodes where order of nodes is ignored + linkSet.insert( TLink( theFirstNode1, theSecondNode1 )); + + list< NLink > linkList[2]; + linkList[0].push_back( NLink( theFirstNode1, theSecondNode1 )); + linkList[1].push_back( NLink( theFirstNode2, theSecondNode2 )); + + // loop on links in linkList; find faces by links and append links + // of the found faces to linkList + list< NLink >::iterator linkIt[] = { linkList[0].begin(), linkList[1].begin() } ; + for ( ; linkIt[0] != linkList[0].end(); linkIt[0]++, linkIt[1]++ ) { + NLink link[] = { *linkIt[0], *linkIt[1] }; + if ( linkSet.find( link[0] ) == linkSet.end() ) + continue; + + // by links, find faces in the face sets, + // and find indices of link nodes in the found faces; + // in a face set, there is only one or no face sharing a link + // --------------------------------------------------------------- + + const SMDS_MeshElement* face[] = { 0, 0 }; + list notLinkNodes[2]; + //bool reverse[] = { false, false }; // order of notLinkNodes + int nbNodes[2]; + for ( int iSide = 0; iSide < 2; iSide++ ) // loop on 2 sides + { + const SMDS_MeshNode* n1 = link[iSide].first; + const SMDS_MeshNode* n2 = link[iSide].second; + set * faceSet = faceSetPtr[ iSide ]; + set< const SMDS_MeshElement* > facesOfNode1; + for ( int iNode = 0; iNode < 2; iNode++ ) // loop on 2 nodes of a link + { + // during a loop of the first node, we find all faces around n1, + // during a loop of the second node, we find one face sharing both n1 and n2 + const SMDS_MeshNode* n = iNode ? n1 : n2; // a node of a link + SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator(); + while ( fIt->more() ) { // loop on faces sharing a node + const SMDS_MeshElement* f = fIt->next(); + if (f->GetType() == SMDSAbs_Face && + faceSet->find( f ) != faceSet->end() && // f is in face set + ! facesOfNode1.insert( f ).second ) // f encounters twice + { + if ( face[ iSide ] ) { + MESSAGE( "2 faces per link " ); + return ( iSide ? SEW_BAD_SIDE2_NODES : SEW_BAD_SIDE1_NODES ); + } + face[ iSide ] = f; + faceSet->erase( f ); + + // get not link nodes + int nbN = f->NbNodes(); + if ( f->IsQuadratic() ) + nbN /= 2; + nbNodes[ iSide ] = nbN; + list< const SMDS_MeshNode* > & nodes = notLinkNodes[ iSide ]; + int i1 = f->GetNodeIndex( n1 ); + int i2 = f->GetNodeIndex( n2 ); + int iEnd = nbN, iBeg = -1, iDelta = 1; + bool reverse = ( Abs( i1 - i2 ) == 1 ? i1 > i2 : i2 > i1 ); + if ( reverse ) { + std::swap( iEnd, iBeg ); iDelta = -1; + } + int i = i2; + while ( true ) { + i += iDelta; + if ( i == iEnd ) i = iBeg + iDelta; + if ( i == i1 ) break; + nodes.push_back ( f->GetNode( i ) ); + } + } + } + } + } + // check similarity of elements of the sides + if (( face[0] && !face[1] ) || ( !face[0] && face[1] )) { + MESSAGE("Correspondent face not found on side " << ( face[0] ? 1 : 0 )); + if ( nReplaceMap.size() == 2 ) { // faces on input nodes not found + return ( face[0] ? SEW_BAD_SIDE2_NODES : SEW_BAD_SIDE1_NODES ); + } + else { + return SEW_TOPO_DIFF_SETS_OF_ELEMENTS; + } + } + + // set nodes to merge + // ------------------- + + if ( face[0] && face[1] ) { + if ( nbNodes[0] != nbNodes[1] ) { + MESSAGE("Diff nb of face nodes"); + return SEW_TOPO_DIFF_SETS_OF_ELEMENTS; + } +#ifdef DEBUG_MATCHING_NODES + cout << " Link 1: " << link[0].first->GetID() <<" "<< link[0].second->GetID() + << " F 1: " << face[0]; + cout << "| Link 2: " << link[1].first->GetID() <<" "<< link[1].second->GetID() + << " F 2: " << face[1] << " | Bind: "<::iterator n1 = notLinkNodes[0].begin(); + list::iterator n2 = notLinkNodes[1].begin(); + for ( int i = 0 ; i < nbN - 2; ++i ) { +#ifdef DEBUG_MATCHING_NODES + cout << (*n1)->GetID() << " to " << (*n2)->GetID() << endl; +#endif + nReplaceMap.insert( make_pair( *(n1++), *(n2++) )); + } + } + + // add other links of the face 1 to linkList + // ----------------------------------------- + + const SMDS_MeshElement* f0 = face[0]; + const SMDS_MeshNode* n1 = f0->GetNode( nbN - 1 ); + for ( int i = 0; i < nbN; i++ ) + { + const SMDS_MeshNode* n2 = f0->GetNode( i ); + pair< set< TLink >::iterator, bool > iter_isnew = + linkSet.insert( TLink( n1, n2 )); + if ( !iter_isnew.second ) { // already in a set: no need to process + linkSet.erase( iter_isnew.first ); + } + else // new in set == encountered for the first time: add + { +#ifdef DEBUG_MATCHING_NODES + cout << "Add link 1: " << n1->GetID() << " " << n2->GetID() << " "; + cout << " | link 2: " << nReplaceMap[n1]->GetID() << " " << nReplaceMap[n2]->GetID() << " " << endl; +#endif + linkList[0].push_back ( NLink( n1, n2 )); + linkList[1].push_back ( NLink( nReplaceMap[n1], nReplaceMap[n2] )); + } + n1 = n2; + } + } // 2 faces found + } // loop on link lists + + return SEW_OK; +} diff --git a/src/SMESH/SMESH_MeshEditor.hxx b/src/SMESH/SMESH_MeshEditor.hxx index 3c891d1a3..d7a79328e 100644 --- a/src/SMESH/SMESH_MeshEditor.hxx +++ b/src/SMESH/SMESH_MeshEditor.hxx @@ -30,6 +30,8 @@ #ifndef SMESH_MeshEditor_HeaderFile #define SMESH_MeshEditor_HeaderFile +#include "SMESH_SMESH.hxx" + #include "SMESH_Mesh.hxx" #include "SMESH_Controls.hxx" #include "SMESH_SequenceOfNode.hxx" @@ -37,24 +39,25 @@ #include "gp_Dir.hxx" #include "TColStd_HSequenceOfReal.hxx" #include "SMESH_MesherHelper.hxx" +#include "SMDS_MeshElement.hxx" #include #include typedef map > TElemOfElemListMap; +typedef map TNodeNodeMap; -typedef map RemoveQuadNodeMap; +typedef map RemoveQuadNodeMap; typedef map::iterator ItRemoveQuadNodeMap; -class SMDS_MeshElement; class SMDS_MeshFace; class SMDS_MeshNode; class gp_Ax1; class gp_Vec; class gp_Pnt; -class SMESH_MeshEditor { +class SMESH_EXPORT SMESH_MeshEditor { public: // define a set of elements sorted by ID, to be used to assure @@ -64,6 +67,16 @@ public: { return e1->GetID() < e2->GetID(); } }; typedef set< const SMDS_MeshElement*, TIDCompare > TIDSortedElemSet; + + /*! + * \brief Insert element in a map of elements sorted by ID + * \param elem - element to insert + * \param elemMap - the map to fill in + */ + static void Insert(const SMDS_MeshElement* elem, + std::map & elemMap) { + elemMap.insert( make_pair( elem->GetID(), elem )); + } public: @@ -282,6 +295,13 @@ public: const SMDS_MeshNode* theNode3 = 0); // Return true if the three nodes are on a free border + static bool FindFreeBorder (const SMDS_MeshNode* theFirstNode, + const SMDS_MeshNode* theSecondNode, + const SMDS_MeshNode* theLastNode, + std::list< const SMDS_MeshNode* > & theNodes, + std::list< const SMDS_MeshElement* >& theFaces); + // Return nodes and faces of a free border if found + enum Sew_Error { SEW_OK, // for SewFreeBorder() @@ -294,7 +314,8 @@ public: SEW_DIFF_NB_OF_ELEMENTS, SEW_TOPO_DIFF_SETS_OF_ELEMENTS, SEW_BAD_SIDE1_NODES, - SEW_BAD_SIDE2_NODES + SEW_BAD_SIDE2_NODES, + SEW_INTERNAL_ERROR }; @@ -392,6 +413,25 @@ public: // - not in avoidSet, // - in elemSet provided that !elemSet.empty() + /*! + * \brief Find corresponding nodes in two sets of faces + * \param theSide1 - first face set + * \param theSide2 - second first face + * \param theFirstNode1 - a boundary node of set 1 + * \param theFirstNode2 - a node of set 2 corresponding to theFirstNode1 + * \param theSecondNode1 - a boundary node of set 1 linked with theFirstNode1 + * \param theSecondNode2 - a node of set 2 corresponding to theSecondNode1 + * \param nReplaceMap - output map of corresponding nodes + * \retval Sew_Error - is a success or not + */ + static Sew_Error FindMatchingNodes(set& theSide1, + set& theSide2, + const SMDS_MeshNode* theFirstNode1, + const SMDS_MeshNode* theFirstNode2, + const SMDS_MeshNode* theSecondNode1, + const SMDS_MeshNode* theSecondNode2, + TNodeNodeMap & nReplaceMap); + /*! * \brief Returns true if given node is medium * \param n - node to check diff --git a/src/SMESH/SMESH_MesherHelper.cxx b/src/SMESH/SMESH_MesherHelper.cxx index fd0a0dcfb..c3e420317 100644 --- a/src/SMESH/SMESH_MesherHelper.cxx +++ b/src/SMESH/SMESH_MesherHelper.cxx @@ -40,6 +40,10 @@ #include #include +#include + +#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; } + //======================================================================= //function : CheckShape //purpose : @@ -47,7 +51,7 @@ bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh) { - SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS(); + SMESHDS_Mesh* meshDS = GetMeshDS(); // we can create quadratic elements only if all elements // created on subshapes of given shape are quadratic // also we have to fill myNLinkNodeMap @@ -94,9 +98,8 @@ bool SMESH_MesherHelper::IsQuadraticSubMesh(const TopoDS_Shape& aSh) if(!myCreateQuadratic) { myNLinkNodeMap.clear(); } - else { - SetSubShape( aSh ); - } + SetSubShape( aSh ); + return myCreateQuadratic; } @@ -126,7 +129,7 @@ void SMESH_MesherHelper::SetSubShape(const int aShID) void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh) { - if ( !myShape.IsNull() && !aSh.IsNull() && myShape.IsSame( aSh )) + if ( myShape.IsSame( aSh )) return; myShape = aSh; @@ -136,13 +139,13 @@ void SMESH_MesherHelper::SetSubShape(const TopoDS_Shape& aSh) myShapeID = -1; return; } - SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS(); + SMESHDS_Mesh* meshDS = GetMeshDS(); myShapeID = meshDS->ShapeToIndex(aSh); // treatment of periodic faces - if ( aSh.ShapeType() == TopAbs_FACE ) + for ( TopExp_Explorer eF( aSh, TopAbs_FACE ); eF.More(); eF.Next() ) { - const TopoDS_Face& face = TopoDS::Face( aSh ); + const TopoDS_Face& face = TopoDS::Face( eF.Current() ); BRepAdaptor_Surface surface( face ); if ( surface.IsUPeriodic() || surface.IsVPeriodic() ) { @@ -261,17 +264,19 @@ gp_Pnt2d SMESH_MesherHelper::GetUVOnSeam( const gp_Pnt2d& uv1, const gp_Pnt2d& u gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F, const SMDS_MeshNode* n, - const SMDS_MeshNode* n2) + const SMDS_MeshNode* n2) const { - gp_Pnt2d uv; + gp_Pnt2d uv( 1e100, 1e100 ); const SMDS_PositionPtr Pos = n->GetPosition(); - if(Pos->GetTypeOfPosition()==SMDS_TOP_FACE) { + if(Pos->GetTypeOfPosition()==SMDS_TOP_FACE) + { // node has position on face const SMDS_FacePosition* fpos = static_cast(n->GetPosition().get()); uv = gp_Pnt2d(fpos->GetUParameter(),fpos->GetVParameter()); } - else if(Pos->GetTypeOfPosition()==SMDS_TOP_EDGE) { + else if(Pos->GetTypeOfPosition()==SMDS_TOP_EDGE) + { // node has position on edge => it is needed to find // corresponding edge from face, get pcurve for this // edge and recieve value from this pcurve @@ -288,10 +293,10 @@ gp_XY SMESH_MesherHelper::GetNodeUV(const TopoDS_Face& F, if ( n2 && mySeamShapeIds.find( edgeID ) != mySeamShapeIds.end() ) uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 )); } - else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX) { - SMESHDS_Mesh * meshDS = GetMesh()->GetMeshDS(); + else if(Pos->GetTypeOfPosition()==SMDS_TOP_VERTEX) + { int vertexID = n->GetPosition()->GetShapeId(); - const TopoDS_Vertex& V = TopoDS::Vertex(meshDS->IndexToShape(vertexID)); + const TopoDS_Vertex& V = TopoDS::Vertex(GetMeshDS()->IndexToShape(vertexID)); uv = BRep_Tool::Parameters( V, F ); if ( n2 && mySeamShapeIds.find( vertexID ) != mySeamShapeIds.end() ) uv = GetUVOnSeam( uv, GetNodeUV( F, n2, 0 )); @@ -350,7 +355,7 @@ const SMDS_MeshNode* SMESH_MesherHelper::GetMediumNode(const SMDS_MeshNode* n1, else { // create medium node SMDS_MeshNode* n12; - SMESHDS_Mesh* meshDS = GetMesh()->GetMeshDS(); + SMESHDS_Mesh* meshDS = GetMeshDS(); int faceID = -1, edgeID = -1; const SMDS_PositionPtr Pos1 = n1->GetPosition(); const SMDS_PositionPtr Pos2 = n2->GetPosition(); @@ -606,14 +611,12 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, n12, n23, n31, n45, n56, n64, n14, n25, n36); } - -//======================================================================= -//function : AddVolume -//purpose : //======================================================================= /*! * Special function for creation quadratic volume */ +//======================================================================= + SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, const SMDS_MeshNode* n3, @@ -643,14 +646,54 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, return meshDS->AddVolume(n1, n2, n3, n4, n12, n23, n31, n14, n24, n34); } - //======================================================================= -//function : AddVolume -//purpose : +/*! + * Special function for creation quadratic pyramid + */ +//======================================================================= + +SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, + const SMDS_MeshNode* n2, + const SMDS_MeshNode* n3, + const SMDS_MeshNode* n4, + const SMDS_MeshNode* n5, + const int id, + const bool force3d) +{ + if(!myCreateQuadratic) { + if(id) + return GetMeshDS()->AddVolumeWithID(n1, n2, n3, n4, n5, id); + else + return GetMeshDS()->AddVolume(n1, n2, n3, n4, n5); + } + + const SMDS_MeshNode* n12 = GetMediumNode(n1,n2,force3d); + const SMDS_MeshNode* n23 = GetMediumNode(n2,n3,force3d); + const SMDS_MeshNode* n34 = GetMediumNode(n3,n4,force3d); + const SMDS_MeshNode* n41 = GetMediumNode(n4,n1,force3d); + + const SMDS_MeshNode* n15 = GetMediumNode(n1,n5,force3d); + const SMDS_MeshNode* n25 = GetMediumNode(n2,n5,force3d); + const SMDS_MeshNode* n35 = GetMediumNode(n3,n5,force3d); + const SMDS_MeshNode* n45 = GetMediumNode(n4,n5,force3d); + + if(id) + return GetMeshDS()->AddVolumeWithID ( n1, n2, n3, n4, n5, + n12, n23, n34, n41, + n15, n25, n35, n45, + id); + else + return GetMeshDS()->AddVolume( n1, n2, n3, n4, n5, + n12, n23, n34, n41, + n15, n25, n35, n45); +} + //======================================================================= /*! - * Special function for creation quadratic volume + * Special function for creation of quadratic hexahedron */ +//======================================================================= + SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, const SMDS_MeshNode* n2, const SMDS_MeshNode* n3, @@ -695,4 +738,264 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1, n78, n85, n15, n26, n37, n48); } +//======================================================================= + /*! + * \brief Load nodes bound to face into a map of node columns + * \param theParam2ColumnMap - map of node columns to fill + * \param theFace - the face on which nodes are searched for + * \param theBaseEdge - the edge nodes of which are columns' bases + * \param theMesh - the mesh containing nodes + * \retval bool - false if something is wrong + * + * The key of the map is a normalized parameter of each + * base node on theBaseEdge. + * This method works in supposition that nodes on the face + * forms a rectangular grid and elements can be quardrangles or triangles + */ +//======================================================================= + +bool SMESH_MesherHelper::LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap, + const TopoDS_Face& theFace, + const TopoDS_Edge& theBaseEdge, + SMESHDS_Mesh* theMesh) +{ + // get vertices of theBaseEdge + TopoDS_Vertex vfb, vlb, vft; // first and last, bottom and top vertices + TopoDS_Edge eFrw = TopoDS::Edge( theBaseEdge.Oriented( TopAbs_FORWARD )); + TopExp::Vertices( eFrw, vfb, vlb ); + + // find the other edges of theFace and orientation of e1 + TopoDS_Edge e1, e2, eTop; + bool rev1, CumOri = false; + TopExp_Explorer exp( theFace, TopAbs_EDGE ); + int nbEdges = 0; + for ( ; exp.More(); exp.Next() ) { + if ( ++nbEdges > 4 ) { + return false; // more than 4 edges in theFace + } + TopoDS_Edge e = TopoDS::Edge( exp.Current() ); + if ( theBaseEdge.IsSame( e )) + continue; + TopoDS_Vertex vCommon; + if ( !TopExp::CommonVertex( theBaseEdge, e, vCommon )) + eTop = e; + else if ( vCommon.IsSame( vfb )) { + e1 = e; + vft = TopExp::LastVertex( e1, CumOri ); + rev1 = vfb.IsSame( vft ); + if ( rev1 ) + vft = TopExp::FirstVertex( e1, CumOri ); + } + else + e2 = e; + } + if ( nbEdges < 4 ) { + return false; // less than 4 edges in theFace + } + if ( e2.IsNull() && vfb.IsSame( vlb )) + e2 = e1; + + // submeshes corresponding to shapes + SMESHDS_SubMesh* smFace = theMesh->MeshElements( theFace ); + SMESHDS_SubMesh* smb = theMesh->MeshElements( theBaseEdge ); + SMESHDS_SubMesh* smt = theMesh->MeshElements( eTop ); + SMESHDS_SubMesh* sm1 = theMesh->MeshElements( e1 ); + SMESHDS_SubMesh* sm2 = theMesh->MeshElements( e2 ); + SMESHDS_SubMesh* smVfb = theMesh->MeshElements( vfb ); + SMESHDS_SubMesh* smVlb = theMesh->MeshElements( vlb ); + SMESHDS_SubMesh* smVft = theMesh->MeshElements( vft ); + if (!smFace || !smb || !smt || !sm1 || !sm2 || !smVfb || !smVlb || !smVft ) { + RETURN_BAD_RESULT( "NULL submesh " <NbNodes() != smt->NbNodes() || sm1->NbNodes() != sm2->NbNodes() ) { + RETURN_BAD_RESULT(" Diff nb of nodes on opposite edges" ); + } + if (smVfb->NbNodes() != 1 || smVlb->NbNodes() != 1 || smVft->NbNodes() != 1) { + RETURN_BAD_RESULT("Empty submesh of vertex"); + } + // define whether mesh is quadratic + bool isQuadraticMesh = false; + SMDS_ElemIteratorPtr eIt = smFace->GetElements(); + if ( !eIt->more() ) { + RETURN_BAD_RESULT("No elements on the face"); + } + const SMDS_MeshElement* e = eIt->next(); + isQuadraticMesh = e->IsQuadratic(); + + if ( sm1->NbNodes() * smb->NbNodes() != smFace->NbNodes() ) { + // check quadratic case + if ( isQuadraticMesh ) { + // what if there are quadrangles and triangles mixed? +// int n1 = sm1->NbNodes()/2; +// int n2 = smb->NbNodes()/2; +// int n3 = sm1->NbNodes() - n1; +// int n4 = smb->NbNodes() - n2; +// int nf = sm1->NbNodes()*smb->NbNodes() - n3*n4; +// if( nf != smFace->NbNodes() ) { +// MESSAGE( "Wrong nb face nodes: " << +// sm1->NbNodes()<<" "<NbNodes()<<" "<NbNodes()); +// return false; +// } + } + else { + RETURN_BAD_RESULT( "Wrong nb face nodes: " << + sm1->NbNodes()<<" "<NbNodes()<<" "<NbNodes()); + } + } + // IJ size + int vsize = sm1->NbNodes() + 2; + int hsize = smb->NbNodes() + 2; + if(isQuadraticMesh) { + vsize = vsize - sm1->NbNodes()/2 -1; + hsize = hsize - smb->NbNodes()/2 -1; + } + + // load nodes from theBaseEdge + + set loadedNodes; + const SMDS_MeshNode* nullNode = 0; + + vector & nVecf = theParam2ColumnMap[ 0.]; + nVecf.resize( vsize, nullNode ); + loadedNodes.insert( nVecf[ 0 ] = smVfb->GetNodes()->next() ); + + vector & nVecl = theParam2ColumnMap[ 1.]; + nVecl.resize( vsize, nullNode ); + loadedNodes.insert( nVecl[ 0 ] = smVlb->GetNodes()->next() ); + + double f, l; + BRep_Tool::Range( eFrw, f, l ); + double range = l - f; + SMDS_NodeIteratorPtr nIt = smb->GetNodes(); + const SMDS_MeshNode* node; + while ( nIt->more() ) { + node = nIt->next(); + if(IsMedium(node)) + continue; + const SMDS_EdgePosition* pos = + dynamic_cast( node->GetPosition().get() ); + if ( !pos ) { + return false; + } + double u = ( pos->GetUParameter() - f ) / range; + vector & nVec = theParam2ColumnMap[ u ]; + nVec.resize( vsize, nullNode ); + loadedNodes.insert( nVec[ 0 ] = node ); + } + if ( theParam2ColumnMap.size() != hsize ) { + RETURN_BAD_RESULT( "Wrong node positions on theBaseEdge" ); + } + + // load nodes from e1 + + map< double, const SMDS_MeshNode*> sortedNodes; // sort by param on edge + nIt = sm1->GetNodes(); + while ( nIt->more() ) { + node = nIt->next(); + if(IsMedium(node)) + continue; + const SMDS_EdgePosition* pos = + dynamic_cast( node->GetPosition().get() ); + if ( !pos ) { + return false; + } + sortedNodes.insert( make_pair( pos->GetUParameter(), node )); + } + loadedNodes.insert( nVecf[ vsize - 1 ] = smVft->GetNodes()->next() ); + map< double, const SMDS_MeshNode*>::iterator u_n = sortedNodes.begin(); + int row = rev1 ? vsize - 1 : 0; + int dRow = rev1 ? -1 : +1; + for ( ; u_n != sortedNodes.end(); u_n++ ) { + row += dRow; + loadedNodes.insert( nVecf[ row ] = u_n->second ); + } + + // try to load the rest nodes + + // get all faces from theFace + map allFaces, foundFaces; + eIt = smFace->GetElements(); + while ( eIt->more() ) { + const SMDS_MeshElement* e = eIt->next(); + if ( e->GetType() == SMDSAbs_Face ) + allFaces.insert( make_pair(e->GetID(),e) ); + } + // Starting from 2 neighbour nodes on theBaseEdge, look for a face + // the nodes belong to, and between the nodes of the found face, + // look for a not loaded node considering this node to be the next + // in a column of the starting second node. Repeat, starting + // from nodes next to the previous starting nodes in their columns, + // and so on while a face can be found. Then go the the next pair + // of nodes on theBaseEdge. + TParam2ColumnMap::iterator par_nVec_1 = theParam2ColumnMap.begin(); + TParam2ColumnMap::iterator par_nVec_2 = par_nVec_1; + // loop on columns + int col = 0; + for ( par_nVec_2++; par_nVec_2 != theParam2ColumnMap.end(); par_nVec_1++, par_nVec_2++ ) { + col++; + row = 0; + const SMDS_MeshNode* n1 = par_nVec_1->second[ row ]; + const SMDS_MeshNode* n2 = par_nVec_2->second[ row ]; + const SMDS_MeshElement* face = 0; + bool lastColOnClosedFace = ( nVecf[ row ] == n2 ); + do { + // look for a face by 2 nodes + face = SMESH_MeshEditor::FindFaceInSet( n1, n2, allFaces, foundFaces ); + if ( face ) { + int nbFaceNodes = face->NbNodes(); + if ( face->IsQuadratic() ) + nbFaceNodes /= 2; + if ( nbFaceNodes>4 ) { + RETURN_BAD_RESULT(" Too many nodes in a face: " << nbFaceNodes ); + } + // look for a not loaded node of the + bool found = false; + const SMDS_MeshNode* n3 = 0; // a node defferent from n1 and n2 + for ( int i = 0; i < nbFaceNodes && !found; ++i ) { + node = face->GetNode( i ); + found = loadedNodes.insert( node ).second; + if ( !found && node != n1 && node != n2 ) + n3 = node; + } + if ( lastColOnClosedFace && row + 1 < vsize ) { + node = nVecf[ row + 1 ]; + found = ( face->GetNodeIndex( node ) >= 0 ); + } + if ( found ) { + if ( ++row > vsize - 1 ) { + RETURN_BAD_RESULT( "Too many nodes in column "<< col <<": "<< row+1); + } + par_nVec_2->second[ row ] = node; + foundFaces.insert( make_pair(face->GetID(),face) ); + n2 = node; + if ( nbFaceNodes==4 ) { + n1 = par_nVec_1->second[ row ]; + } + } + else if ( nbFaceNodes==3 && n3 == par_nVec_1->second[ row + 1 ] ) { + n1 = n3; + } + else { + RETURN_BAD_RESULT( "Not quad mesh, column "<< col ); + } + } + } + while ( face && n1 && n2 ); + + if ( row < vsize - 1 ) { + MESSAGE( "Too few nodes in column "<< col <<": "<< row+1); + MESSAGE( "Base node 1: "<< par_nVec_1->second[0]); + MESSAGE( "Base node 2: "<< par_nVec_2->second[0]); + if ( n1 ) { MESSAGE( "Current node 1: "<< n1); } + else { MESSAGE( "Current node 1: NULL"); } + if ( n2 ) { MESSAGE( "Current node 2: "<< n2); } + else { MESSAGE( "Current node 2: NULL"); } + MESSAGE( "first base node: "<< theParam2ColumnMap.begin()->second[0]); + MESSAGE( "last base node: "<< theParam2ColumnMap.rbegin()->second[0]); + return false; + } + } // loop on columns + return true; +} diff --git a/src/SMESH/SMESH_MesherHelper.hxx b/src/SMESH/SMESH_MesherHelper.hxx index 4ae2101ec..ae366be6b 100644 --- a/src/SMESH/SMESH_MesherHelper.hxx +++ b/src/SMESH/SMESH_MesherHelper.hxx @@ -20,12 +20,13 @@ // File: SMESH_MesherHelper.hxx // Created: 15.02.06 14:48:09 // Author: Sergey KUUL -// Copyright: Open CASCADE 2006 #ifndef SMESH_MesherHelper_HeaderFile #define SMESH_MesherHelper_HeaderFile +#include "SMESH_SMESH.hxx" + #include #include #include @@ -48,17 +49,63 @@ typedef map::iterator ItNLinkNode; * is called. */ -class SMESH_MesherHelper +typedef std::vector TNodeColumn; +typedef std::map< double, TNodeColumn > TParam2ColumnMap; + +class SMESH_EXPORT SMESH_MesherHelper { - public: +public: + // ---------- PUBLIC UTILITIES ---------- + + /*! + * \brief Load nodes bound to face into a map of node columns + * \param theParam2ColumnMap - map of node columns to fill + * \param theFace - the face on which nodes are searched for + * \param theBaseEdge - the edge nodes of which are columns' bases + * \param theMesh - the mesh containing nodes + * \retval bool - false if something is wrong + * + * The key of the map is a normalized parameter of each + * base node on theBaseEdge. + * This method works in supposition that nodes on the face + * forms a rectangular grid and elements can be quardrangles or triangles + */ + static bool LoadNodeColumns(TParam2ColumnMap & theParam2ColumnMap, + const TopoDS_Face& theFace, + const TopoDS_Edge& theBaseEdge, + SMESHDS_Mesh* theMesh); + /*! + * \brief Return support shape of a node + * \param node - the node + * \param meshDS - mesh DS + * \retval TopoDS_Shape - found support shape + */ + static const TopoDS_Shape& GetSubShapeByNode(const SMDS_MeshNode* node, + SMESHDS_Mesh* meshDS) + { return meshDS->IndexToShape( node->GetPosition()->GetShapeId() ); } + + /*! + * \brief Return a valid node index, fixing the given one if necessary + * \param ind - node index + * \param nbNodes - total nb of nodes + * \retval int - valid node index + */ + static int WrapIndex(const int ind, const int nbNodes) { + if ( ind < 0 ) return nbNodes + ind % nbNodes; + if ( ind >= nbNodes ) return ind % nbNodes; + return ind; + } + +public: // ---------- PUBLIC METHODS ---------- /// Empty constructor SMESH_MesherHelper(SMESH_Mesh& theMesh) { myMesh=(void *)&theMesh; myCreateQuadratic = false; myShapeID=-1;} - SMESH_Mesh* GetMesh() const - { return (SMESH_Mesh*)myMesh; } + SMESH_Mesh* GetMesh() const { return (SMESH_Mesh*)myMesh; } + + SMESHDS_Mesh* GetMeshDS() const { return GetMesh()->GetMeshDS(); } /// Copy constructor //Standard_EXPORT SMESH_MesherHelper (const SMESH_MesherHelper& theOther); @@ -113,7 +160,7 @@ class SMESH_MesherHelper */ gp_XY GetNodeUV(const TopoDS_Face& F, const SMDS_MeshNode* n, - const SMDS_MeshNode* inFaceNode=0); + const SMDS_MeshNode* inFaceNode=0) const; /*! * \brief Check if inFaceNode argument is necessary for call GetNodeUV(F,..) @@ -181,6 +228,18 @@ class SMESH_MesherHelper const int id = 0, const bool force3d = true); + + /** + * Special function for creation quadratic pyramid + */ + SMDS_MeshVolume* AddVolume(const SMDS_MeshNode* n1, + const SMDS_MeshNode* n2, + const SMDS_MeshNode* n3, + const SMDS_MeshNode* n4, + const SMDS_MeshNode* n5, + const int id = 0, + const bool force3d = true); + /** * Special function for creation quadratic pentahedron */ @@ -218,6 +277,12 @@ class SMESH_MesherHelper void SetKeyIsQuadratic(const bool theBuildQuadratic) { myCreateQuadratic = theBuildQuadratic; } + /*! + * \brief Return myCreateQuadratic flag + * \retval bool - myCreateQuadratic value + */ + bool GetIsQuadratic() const { return myCreateQuadratic; } + /*! * \brief Set shape to make elements on * \param subShape, subShapeID - shape or its ID (==SMESHDS_Mesh::ShapeToIndex(shape)) @@ -227,10 +292,50 @@ class SMESH_MesherHelper /*! * \brief Return shape or its ID, on which created elements are added - * \retval TopoDS_Shape, int - shape or its ID + * \retval int - shape index in SMESHDS + * + * Shape is set by calling either IsQuadraticSubMesh() or SetSubShape() + */ + int GetSubShapeID() const { return myShapeID; } + /*! + * \brief Return shape or its ID, on which created elements are added + * \retval TopoDS_Shape - shape + * + * Shape is set by calling either IsQuadraticSubMesh() or SetSubShape() + */ + TopoDS_Shape GetSubShape() const { return myShape; } + + /*! + * \brief Check if shape is a seam edge or it's vertex + * \param subShape - edge or vertex index in SMESHDS + * \retval bool - true if subShape is a seam shape + * + * It works only if IsQuadraticSubMesh() or SetSubShape() has been called + */ + bool IsSeamShape(const int subShape) const + { return mySeamShapeIds.find( subShape ) != mySeamShapeIds.end(); } + /*! + * \brief Check if shape is a seam edge or it's vertex + * \param subShape - edge or vertex + * \retval bool - true if subShape is a seam shape + * + * It works only if IsQuadraticSubMesh() or SetSubShape() has been called + */ + bool IsSeamShape(const TopoDS_Shape& subShape) const + { return IsSeamShape( GetMeshDS()->ShapeToIndex( subShape )); } + + /*! + * \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape() + * has a seam edge + * \retval bool - true if it has + */ + bool HasSeam() const { return !mySeamShapeIds.empty(); } + + /*! + * \brief Return index of periodic parametric direction of a closed face + * \retval int - 1 for U, 2 for V direction */ - int GetSubShapeID() { return myShapeID; } - TopoDS_Shape GetSubShape() { return myShape; } + int GetPeriodicIndex() const { return myParIndex; } protected: diff --git a/src/SMESH/SMESH_Pattern.cxx b/src/SMESH/SMESH_Pattern.cxx index 61b0fa841..03bce5e4e 100644 --- a/src/SMESH/SMESH_Pattern.cxx +++ b/src/SMESH/SMESH_Pattern.cxx @@ -23,6 +23,7 @@ #include "SMESH_Pattern.hxx" +#include #include #include #include @@ -74,6 +75,8 @@ using namespace std; typedef map< const SMDS_MeshElement*, int > TNodePointIDMap; +#define smdsNode( elem ) static_cast( elem ) + //======================================================================= //function : SMESH_Pattern //purpose : @@ -414,77 +417,6 @@ template void sortBySize( list< list < T > > & theListOfList ) } } -//======================================================================= -//function : getOrderedEdges -//purpose : return nb wires and a list of oredered edges -//======================================================================= - -static int getOrderedEdges (const TopoDS_Face& theFace, - const TopoDS_Vertex& theFirstVertex, - list< TopoDS_Edge >& theEdges, - list< int > & theNbVertexInWires) -{ - // put wires in a list, so that an outer wire comes first - list aWireList; - TopoDS_Wire anOuterWire = BRepTools::OuterWire( theFace ); - aWireList.push_back( anOuterWire ); - for ( TopoDS_Iterator wIt (theFace); wIt.More(); wIt.Next() ) - if ( !anOuterWire.IsSame( wIt.Value() )) - aWireList.push_back( TopoDS::Wire( wIt.Value() )); - - // loop on edges of wires - theNbVertexInWires.clear(); - list::iterator wlIt = aWireList.begin(); - for ( ; wlIt != aWireList.end(); wlIt++ ) - { - int iE; - BRepTools_WireExplorer wExp( *wlIt, theFace ); - for ( iE = 0; wExp.More(); wExp.Next(), iE++ ) - { - TopoDS_Edge edge = wExp.Current(); - edge = TopoDS::Edge( edge.Oriented( wExp.Orientation() )); - theEdges.push_back( edge ); - } - theNbVertexInWires.push_back( iE ); - iE = 0; - if ( wlIt == aWireList.begin() && theEdges.size() > 1 ) { // the outer wire - // orient closed edges - list< TopoDS_Edge >::iterator eIt, eIt2; - for ( eIt = theEdges.begin(); eIt != theEdges.end(); eIt++ ) - { - TopoDS_Edge& edge = *eIt; - if ( TopExp::FirstVertex( edge ).IsSame( TopExp::LastVertex( edge ) )) - { - eIt2 = eIt; - bool isNext = ( eIt2 == theEdges.begin() ); - TopoDS_Edge edge2 = isNext ? *(++eIt2) : *(--eIt2); - double f1,l1,f2,l2; - Handle(Geom2d_Curve) c1 = BRep_Tool::CurveOnSurface( edge, theFace, f1,l1 ); - Handle(Geom2d_Curve) c2 = BRep_Tool::CurveOnSurface( edge2, theFace, f2,l2 ); - gp_Pnt2d pf = c1->Value( edge.Orientation() == TopAbs_FORWARD ? f1 : l1 ); - gp_Pnt2d pl = c1->Value( edge.Orientation() == TopAbs_FORWARD ? l1 : f1 ); - bool isFirst = ( edge2.Orientation() == TopAbs_FORWARD ? isNext : !isNext ); - gp_Pnt2d p2 = c2->Value( isFirst ? f2 : l2 ); - isFirst = ( p2.SquareDistance( pf ) < p2.SquareDistance( pl )); - if ( isNext ? isFirst : !isFirst ) - edge.Reverse(); - } - } - // rotate theEdges until it begins from theFirstVertex - if ( ! theFirstVertex.IsNull() ) - while ( !theFirstVertex.IsSame( TopExp::FirstVertex( theEdges.front(), true ))) - { - theEdges.splice(theEdges.end(), theEdges, - theEdges.begin(), ++ theEdges.begin()); - if ( iE++ > theNbVertexInWires.back() ) - break; // break infinite loop - } - } - } - - return aWireList.size(); -} - //======================================================================= //function : project //purpose : @@ -520,7 +452,7 @@ template bool areNodesBound( TFaceIterator & faceItr ) SMDS_ElemIteratorPtr nIt = faceItr->next()->nodesIterator(); while ( nIt->more() ) { - const SMDS_MeshNode* node = static_cast( nIt->next() ); + const SMDS_MeshNode* node = smdsNode( nIt->next() ); SMDS_PositionPtr pos = node->GetPosition(); if ( !pos || !pos->GetShapeId() ) { return false; @@ -573,6 +505,8 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, SMESHDS_Mesh * aMeshDS = theMesh->GetMeshDS(); SMESHDS_SubMesh * fSubMesh = aMeshDS->MeshElements( theFace ); + SMESH_MesherHelper helper( *theMesh ); + helper.SetSubShape( theFace ); int nbNodes = ( !fSubMesh ? 0 : fSubMesh->NbNodes() ); int nbElems = ( !fSubMesh ? 0 : fSubMesh->NbElements() ); @@ -585,18 +519,18 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, TopoDS_Face face = TopoDS::Face( theFace.Oriented( TopAbs_FORWARD )); // check that face is not closed + bool isClosed = helper.HasSeam(); TopoDS_Vertex bidon; list eList; - getOrderedEdges( face, bidon, eList, myNbKeyPntInBoundary ); - list::iterator elIt = eList.begin(); - for ( ; elIt != eList.end() ; elIt++ ) - if ( BRep_Tool::IsClosed( *elIt , face )) - return setErrorCode( ERR_LOADF_CLOSED_FACE ); + list::iterator elIt; + SMESH_Block::GetOrderedEdges( face, bidon, eList, myNbKeyPntInBoundary ); // check that requested or needed projection is possible bool isMainShape = theMesh->IsMainShape( face ); bool needProject = !isMeshBoundToShape( aMeshDS, fSubMesh, isMainShape ); bool canProject = ( nbElems ? true : isMainShape ); + if ( isClosed ) + canProject = false; // so far if ( ( theProject || needProject ) && !canProject ) return setErrorCode( ERR_LOADF_CANT_PROJECT ); @@ -608,6 +542,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, int iPoint = 0; TNodePointIDMap nodePointIDMap; + TNodePointIDMap closeNodePointIDMap; // for nodes on seam edges if ( needProject ) { @@ -658,8 +593,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, TNodePointIDMap::iterator nIdIt = nodePointIDMap.begin(); for ( ; nIdIt != nodePointIDMap.end(); nIdIt++ ) { - const SMDS_MeshNode* node = - static_cast( (*nIdIt).first ); + const SMDS_MeshNode* node = smdsNode( (*nIdIt).first ); TPoint * p = & myPoints[ (*nIdIt).second ]; p->myInitUV = project( node, projector ); p->myInitXYZ.SetCoord( p->myInitUV.X(), p->myInitUV.Y(), 0 ); @@ -697,6 +631,8 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, // vertices for ( elIt = eList.begin(); elIt != eList.end(); elIt++ ) { myShapeIDMap.Add( TopExp::FirstVertex( *elIt, true )); + if ( BRep_Tool::IsClosed( *elIt, theFace ) ) + myShapeIDMap.Add( TopExp::LastVertex( *elIt, true )); SMESHDS_SubMesh * eSubMesh = aMeshDS->MeshElements( *elIt ); if ( eSubMesh ) nbNodes += eSubMesh->NbNodes() + 1; @@ -721,20 +657,55 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, C2d = BRep_Tool::CurveOnSurface( edge, face, f, l ); bool isForward = ( edge.Orientation() == TopAbs_FORWARD ); + TopoDS_Shape v1 = TopExp::FirstVertex( edge, true ); // always FORWARD + TopoDS_Shape v2 = TopExp::LastVertex( edge, true ); // always REVERSED + // to make adjacent edges share key-point, we make v2 FORWARD too + // (as we have different points for same shape with different orienation) + v2.Reverse(); + + // on closed face we must have REVERSED some of seam vertices + bool isSeam = helper.IsSeamShape( edge ); + if ( isClosed ) { + if ( isSeam ) { // reverse on reversed SEAM edge + if ( !isForward ) { + v1.Reverse(); + v2.Reverse(); + } + } + else { // on CLOSED edge + for ( int is2 = 0; is2 < 2; ++is2 ) { + TopoDS_Shape & v = is2 ? v2 : v1; + if ( helper.IsSeamShape( v ) ) { + // reverse or not depending on orientation of adjacent seam + TopoDS_Edge seam; + list::iterator eIt2 = elIt; + if ( is2 ) + seam = ( ++eIt2 == eList.end() ? eList.front() : *eIt2 ); + else + seam = ( eIt2 == eList.begin() ? eList.back() : *(--eIt2) ); + if ( seam.Orientation() == TopAbs_REVERSED ) + v.Reverse(); + } + } + } + } + // the forward key-point - TopoDS_Shape v = TopExp::FirstVertex( edge, true ); - list< TPoint* > & vPoint = getShapePoints( v ); - if ( vPoint.empty() ) + list< TPoint* > * vPoint = & getShapePoints( v1 ); + if ( vPoint->empty() ) { - SMESHDS_SubMesh * vSubMesh = aMeshDS->MeshElements( v ); + SMESHDS_SubMesh * vSubMesh = aMeshDS->MeshElements( v1 ); if ( vSubMesh && vSubMesh->NbNodes() ) { myKeyPointIDs.push_back( iPoint ); SMDS_NodeIteratorPtr nIt = vSubMesh->GetNodes(); const SMDS_MeshNode* node = nIt->next(); - nodePointIDMap.insert( make_pair( node, iPoint )); + if ( v1.Orientation() == TopAbs_REVERSED ) + closeNodePointIDMap.insert( make_pair( node, iPoint )); + else + nodePointIDMap.insert( make_pair( node, iPoint )); TPoint* keyPoint = &myPoints[ iPoint++ ]; - vPoint.push_back( keyPoint ); + vPoint->push_back( keyPoint ); if ( theProject ) keyPoint->myInitUV = project( node, projector ); else @@ -742,8 +713,8 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, keyPoint->myInitXYZ.SetCoord (keyPoint->myInitUV.X(), keyPoint->myInitUV.Y(), 0); } } - if ( !vPoint.empty() ) - ePoints.push_back( vPoint.front() ); + if ( !vPoint->empty() ) + ePoints.push_back( vPoint->front() ); // on-edge points SMESHDS_SubMesh * eSubMesh = aMeshDS->MeshElements( edge ); @@ -755,8 +726,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, SMDS_NodeIteratorPtr nIt = eSubMesh->GetNodes(); while ( nIt->more() ) { - const SMDS_MeshNode* node = - static_cast( nIt->next() ); + const SMDS_MeshNode* node = smdsNode( nIt->next() ); const SMDS_EdgePosition* epos = static_cast(node->GetPosition().get()); double u = epos->GetUParameter(); @@ -771,7 +741,10 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, TPoint* p = & myPoints[ iPoint ]; ePoints.push_back( p ); const SMDS_MeshNode* node = isForward ? (*unIt).second : (*unRIt).second; - nodePointIDMap.insert ( make_pair( node, iPoint )); + if ( isSeam && !isForward ) + closeNodePointIDMap.insert( make_pair( node, iPoint )); + else + nodePointIDMap.insert ( make_pair( node, iPoint )); if ( theProject ) p->myInitUV = project( node, projector ); @@ -786,19 +759,21 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, } } // the reverse key-point - v = TopExp::LastVertex( edge, true ).Reversed(); - list< TPoint* > & vPoint2 = getShapePoints( v ); - if ( vPoint2.empty() ) + vPoint = & getShapePoints( v2 ); + if ( vPoint->empty() ) { - SMESHDS_SubMesh * vSubMesh = aMeshDS->MeshElements( v ); + SMESHDS_SubMesh * vSubMesh = aMeshDS->MeshElements( v2 ); if ( vSubMesh && vSubMesh->NbNodes() ) { myKeyPointIDs.push_back( iPoint ); SMDS_NodeIteratorPtr nIt = vSubMesh->GetNodes(); const SMDS_MeshNode* node = nIt->next(); - nodePointIDMap.insert( make_pair( node, iPoint )); + if ( v2.Orientation() == TopAbs_REVERSED ) + closeNodePointIDMap.insert( make_pair( node, iPoint )); + else + nodePointIDMap.insert( make_pair( node, iPoint )); TPoint* keyPoint = &myPoints[ iPoint++ ]; - vPoint2.push_back( keyPoint ); + vPoint->push_back( keyPoint ); if ( theProject ) keyPoint->myInitUV = project( node, projector ); else @@ -806,8 +781,8 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, keyPoint->myInitXYZ.SetCoord( keyPoint->myInitUV.X(), keyPoint->myInitUV.Y(), 0 ); } } - if ( !vPoint2.empty() ) - ePoints.push_back( vPoint2.front() ); + if ( !vPoint->empty() ) + ePoints.push_back( vPoint->front() ); // compute U of edge-points if ( theProject ) @@ -838,8 +813,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, SMDS_NodeIteratorPtr nIt = fSubMesh->GetNodes(); while ( nIt->more() ) { - const SMDS_MeshNode* node = - static_cast( nIt->next() ); + const SMDS_MeshNode* node = smdsNode( nIt->next() ); nodePointIDMap.insert( make_pair( node, iPoint )); TPoint* p = &myPoints[ iPoint++ ]; fPoints.push_back( p ); @@ -854,12 +828,42 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, } // load elements SMDS_ElemIteratorPtr elemIt = fSubMesh->GetElements(); - while ( elemIt->more() ) { - SMDS_ElemIteratorPtr nIt = elemIt->next()->nodesIterator(); + while ( elemIt->more() ) + { + const SMDS_MeshElement* elem = elemIt->next(); + SMDS_ElemIteratorPtr nIt = elem->nodesIterator(); myElemPointIDs.push_back( TElemDef() ); TElemDef& elemPoints = myElemPointIDs.back(); + // find point indices corresponding to element nodes while ( nIt->more() ) - elemPoints.push_back( nodePointIDMap[ nIt->next() ]); + { + const SMDS_MeshNode* node = smdsNode( nIt->next() ); + iPoint = nodePointIDMap[ node ]; // point index of interest + // for a node on a seam edge there are two points + TNodePointIDMap::iterator n_id = closeNodePointIDMap.end(); + if ( helper.IsSeamShape( node->GetPosition()->GetShapeId() )) + n_id = closeNodePointIDMap.find( node ); + if ( n_id != closeNodePointIDMap.end() ) + { + TPoint & p1 = myPoints[ iPoint ]; + TPoint & p2 = myPoints[ n_id->second ]; + // Select point closest to the rest nodes of element in UV space + SMDS_ElemIteratorPtr nIt2 = elem->nodesIterator(); + const SMDS_MeshNode* notSeamNode = 0; + // find node not on a seam edge + while ( nIt2->more() && !notSeamNode ) { + const SMDS_MeshNode* n = smdsNode( nIt2->next() ); + if ( !helper.IsSeamShape( n->GetPosition()->GetShapeId() )) + notSeamNode = n; + } + gp_Pnt2d uv = helper.GetNodeUV( theFace, node, notSeamNode ); + double dist1 = uv.SquareDistance( p1.myInitUV ); + double dist2 = uv.SquareDistance( p2.myInitUV ); + if ( dist2 < dist1 ) + iPoint = n_id->second; + } + elemPoints.push_back( iPoint ); + } } } @@ -1380,6 +1384,7 @@ bool SMESH_Pattern:: compUVByElasticIsolines(const list< list< TPoint* > >& theBndPoints, const list< TPoint* >& thePntToCompute) { + //return false; //cout << "============================== KEY POINTS =============================="<::iterator kpIt = myKeyPointIDs.begin(); // for ( ; kpIt != myKeyPointIDs.end(); kpIt++ ) { @@ -1607,6 +1612,11 @@ bool SMESH_Pattern:: // " dir0: "<myDir[0].X()<<" "<myDir[0].Y() << // " dir1: "<myDir[1].X()<<" "<myDir[1].Y() << endl; } + else { + /// WHAT IN THIS CASE ????????????? MAY BE THIS, I AM NOT SURE :( + node->SetBoundaryNode( 0, iDir, 0 ); + node->SetBoundaryNode( 0, iDir, 1 ); + } } nIt++; nPrevIt++; if ( nNextIt != isoLine.end() ) nNextIt++; @@ -1856,6 +1866,10 @@ bool SMESH_Pattern:: // dir = node->myDir[ 1 - iDir ].XY() * ( isEnd ? -1. : 1. ); //cout << "__________"<myInitUV.X()<<" "<myInitUV.Y()<GetBoundaryNode( iDir, isEnd ); + if ( !bndNode ) { + MESSAGE("Why we are here?"); + continue; + } gp_XY tgt( bndNode->myDir[0].XY() + bndNode->myDir[1].XY() ); dir.SetCoord( 1, tgt.Y() * ( reversed ? 1 : -1 )); dir.SetCoord( 2, tgt.X() * ( reversed ? -1 : 1 )); @@ -1885,6 +1899,7 @@ bool SMESH_Pattern:: nbComp++; } } + if ( !nbComp ) continue; newUV /= nbComp; node->myUV = newUV; //cout << "NODE: "<myInitUV.X()<<" "<myInitUV.Y()<myDir[ iDir ] ); } // define ratio + bool ok = true; // <- stupid fix TO AVOID PB OF NODES WITH NULL BND NODES double locR[2] = { 0, 0 }; for ( iDir = 0; iDir < 2; iDir++ ) { const int iCoord = 2 - iDir; // coord changing along an isoline TIsoNode* bndNode1 = node->GetBoundaryNode( iDir, 0 ); TIsoNode* bndNode2 = node->GetBoundaryNode( iDir, 1 ); + if ( !bndNode1 || !bndNode2 ) { + ok = false; break; + } double par1 = bndNode1->myInitUV.Coord( iCoord ); double par2 = node->myInitUV.Coord( iCoord ); double par3 = bndNode2->myInitUV.Coord( iCoord ); @@ -1957,7 +1976,7 @@ bool SMESH_Pattern:: //locR[0] = locR[1] = 0.25; // intersect the 2 lines and move a node //IntAna2d_AnaIntersection inter( line[0], line[1] ); - if ( /*inter.IsDone() && inter.NbPoints() ==*/ 1 ) + if ( ok /*inter.IsDone() && inter.NbPoints() ==*/ ) { // double intR = 1 - locR[0] - locR[1]; // gp_XY newUV = inter.Point(1).Value().XY(); @@ -2281,7 +2300,7 @@ bool SMESH_Pattern::Apply (const TopoDS_Face& theFace, list< TopoDS_Edge > eList; list< int > nbVertexInWires; - int nbWires = getOrderedEdges( face, theVertexOnKeyPoint1, eList, nbVertexInWires); + int nbWires = SMESH_Block::GetOrderedEdges( face, theVertexOnKeyPoint1, eList, nbVertexInWires); if ( !theVertexOnKeyPoint1.IsSame( TopExp::FirstVertex( eList.front(), true ))) { MESSAGE( " theVertexOnKeyPoint1 not found in the outer wire "); @@ -2450,17 +2469,13 @@ bool SMESH_Pattern::Apply (const TopoDS_Face& theFace, TopLoc_Location loc; for ( iE = nbVertices + 1, elIt = eList.begin(); elIt != eList.end(); elIt++ ) { - double f,l; - Handle(Geom_Curve) C3d = BRep_Tool::Curve( *elIt, loc, f, l ); - const gp_Trsf & aTrsf = loc.Transformation(); + BRepAdaptor_Curve C3d( *elIt ); list< TPoint* > & ePoints = getShapePoints( iE++ ); pIt = ePoints.begin(); for ( pIt++; pIt != ePoints.end(); pIt++ ) { TPoint* point = *pIt; - point->myXYZ = C3d->Value( point->myU ); - if ( !loc.IsIdentity() ) - aTrsf.Transforms( point->myXYZ.ChangeCoord() ); + point->myXYZ = C3d.Value( point->myU ); } } @@ -2541,7 +2556,7 @@ bool SMESH_Pattern::Apply (const SMDS_MeshFace* theFace, SMDS_ElemIteratorPtr noIt = theFace->nodesIterator(); int iSub = 0; while ( noIt->more() ) { - const SMDS_MeshNode* node = static_cast( noIt->next() ); + const SMDS_MeshNode* node = smdsNode( noIt->next() ); nodes.push_back( node ); if ( iSub++ == theNodeIndexOnKeyPoint1 ) n = --nodes.end(); @@ -2927,7 +2942,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, // store a node and a point while ( nIt->more() ) { - const SMDS_MeshNode* node = static_cast( nIt->next() ); + const SMDS_MeshNode* node = smdsNode( nIt->next() ); nodePointIDMap.insert( make_pair( node, iPoint )); if ( block.IsVertexID( shapeID )) myKeyPointIDs.push_back( iPoint ); @@ -2962,8 +2977,7 @@ bool SMESH_Pattern::Load (SMESH_Mesh* theMesh, nIt = aSubMesh->GetNodes(); for ( ; nIt->more(); pIt++ ) { - const SMDS_MeshNode* node = - static_cast( nIt->next() ); + const SMDS_MeshNode* node = smdsNode( nIt->next() ); const SMDS_EdgePosition* epos = static_cast(node->GetPosition().get()); double u = ( epos->GetUParameter() - f ) / ( l - f ); @@ -3291,7 +3305,7 @@ void SMESH_Pattern:: int i = 0, nbNodes = face->NbNodes(); vector nodes( nbNodes + 1 ); while ( nIt->more() ) - nodes[ i++ ] = static_cast( nIt->next() ); + nodes[ i++ ] = smdsNode( nIt->next() ); nodes[ i ] = nodes[ 0 ]; for ( i = 0; i < nbNodes; ++i ) { @@ -3394,7 +3408,7 @@ void SMESH_Pattern:: // loop on nodes of refinedElem SMDS_ElemIteratorPtr nIt = (*refinedElem)->nodesIterator(); while ( nIt->more() ) { - const SMDS_MeshNode* node = static_cast( nIt->next() ); + const SMDS_MeshNode* node = smdsNode( nIt->next() ); // loop on inverse elements of node SMDS_ElemIteratorPtr eIt = node->GetInverseElementIterator(); while ( eIt->more() ) @@ -3580,7 +3594,7 @@ static bool clearSubMesh( SMESH_Mesh* theMesh, SMDS_NodeIteratorPtr nIt = aSubMeshDS->GetNodes(); removed = removed || nIt->more(); while ( nIt->more() ) - aMeshDS->RemoveNode( static_cast( nIt->next() )); + aMeshDS->RemoveNode( smdsNode( nIt->next() )); } } return removed; @@ -3610,6 +3624,9 @@ void SMESH_Pattern::clearMesh(SMESH_Mesh* theMesh) const //function : MakeMesh //purpose : Create nodes and elements in using nodes // coordinates computed by either of Apply...() methods +// WARNING : StdMeshers_Projection_... relies on MakeMesh() behavior: that +// it does not care of nodes and elements already existing on +// subshapes. DO NOT MERGE them or modify also StdMeshers_Projection_.. //======================================================================= bool SMESH_Pattern::MakeMesh(SMESH_Mesh* theMesh, @@ -3660,10 +3677,10 @@ bool SMESH_Pattern::MakeMesh(SMESH_Mesh* theMesh, for ( ; idPointIt != myShapeIDToPointsMap.end(); idPointIt++ ) { TopoDS_Shape S; - SMESHDS_SubMesh * subMeshDS = 0; + //SMESHDS_SubMesh * subMeshDS = 0; if ( !myShapeIDMap.IsEmpty() ) { S = myShapeIDMap( idPointIt->first ); - subMeshDS = aMeshDS->MeshElements( S ); + //subMeshDS = aMeshDS->MeshElements( S ); } list< TPoint* > & points = idPointIt->second; list< TPoint* >::iterator pIt = points.begin(); @@ -3678,26 +3695,18 @@ bool SMESH_Pattern::MakeMesh(SMESH_Mesh* theMesh, point->myXYZ.Z()); nodesVector [ pIndex ] = node; - if ( subMeshDS ) { + if ( true /*subMeshDS*/ ) { + // !!!!! do not merge new nodes with ones existing on submeshes (see method comment) switch ( S.ShapeType() ) { case TopAbs_VERTEX: { - aMeshDS->SetNodeOnVertex( node, TopoDS::Vertex( S )); - break; + aMeshDS->SetNodeOnVertex( node, TopoDS::Vertex( S )); break; } case TopAbs_EDGE: { - aMeshDS->SetNodeOnEdge( node, TopoDS::Edge( S )); - SMDS_EdgePosition* epos = - dynamic_cast(node->GetPosition().get()); - epos->SetUParameter( point->myU ); - break; + aMeshDS->SetNodeOnEdge( node, TopoDS::Edge( S ), point->myU ); break; } case TopAbs_FACE: { - aMeshDS->SetNodeOnFace( node, TopoDS::Face( S )); - SMDS_FacePosition* pos = - dynamic_cast(node->GetPosition().get()); - pos->SetUParameter( point->myUV.X() ); - pos->SetVParameter( point->myUV.Y() ); - break; + aMeshDS->SetNodeOnFace( node, TopoDS::Face( S ), + point->myUV.X(), point->myUV.Y() ); break; } default: aMeshDS->SetNodeInVolume( node, TopoDS::Shell( S )); @@ -3824,6 +3833,16 @@ void SMESH_Pattern::createElements(SMESH_Mesh* theMes elem = aMeshDS->AddFace( nodes[0], nodes[1], nodes[2] ); break; case 4: elem = aMeshDS->AddFace( nodes[0], nodes[1], nodes[2], nodes[3] ); break; + case 6: + if ( !onMeshElements ) {// create a quadratic face + elem = aMeshDS->AddFace (nodes[0], nodes[1], nodes[2], nodes[3], + nodes[4], nodes[5] ); break; + } // else do not break but create a polygon + case 8: + if ( !onMeshElements ) {// create a quadratic face + elem = aMeshDS->AddFace (nodes[0], nodes[1], nodes[2], nodes[3], + nodes[4], nodes[5], nodes[6], nodes[7] ); break; + } // else do not break but create a polygon default: elem = aMeshDS->AddPolygonalFace( nodes ); } @@ -3860,8 +3879,7 @@ void SMESH_Pattern::createElements(SMESH_Mesh* theMes } SMDS_ElemIteratorPtr noIt = elem->nodesIterator(); while ( noIt->more() ) { - SMDS_MeshNode* node = const_cast - ( static_cast( noIt->next() )); + SMDS_MeshNode* node = const_cast(smdsNode( noIt->next() )); if (!node->GetPosition()->GetShapeId() && shellNodes.find( node ) == shellNodes.end() ) { if ( S.ShapeType() == TopAbs_FACE ) @@ -4330,7 +4348,7 @@ bool SMESH_Pattern::setShapeToMesh(const TopoDS_Shape& theShape) TopTools_IndexedMapOfShape vMap; TopExp::MapShapes( theShape, TopAbs_VERTEX, vMap ); if ( vMap.Extent() + nbNodeOnSeamEdge != myKeyPointIDs.size() ) { - MESSAGE( myKeyPointIDs.size() << " != " << vMap.Extent() ); + MESSAGE( myKeyPointIDs.size() + nbNodeOnSeamEdge << " != " << vMap.Extent() ); return setErrorCode( ERR_APPL_BAD_NB_VERTICES ); } diff --git a/src/SMESH/SMESH_Pattern.hxx b/src/SMESH/SMESH_Pattern.hxx index 3a487277b..9699064ad 100644 --- a/src/SMESH/SMESH_Pattern.hxx +++ b/src/SMESH/SMESH_Pattern.hxx @@ -24,6 +24,8 @@ #ifndef SMESH_Pattern_HeaderFile #define SMESH_Pattern_HeaderFile +#include "SMESH_SMESH.hxx" + #include #include #include @@ -53,7 +55,7 @@ class TopoDS_Edge; // of 6 faces. // -class SMESH_Pattern { +class SMESH_EXPORT SMESH_Pattern { public: SMESH_Pattern (); @@ -66,7 +68,7 @@ class SMESH_Pattern { bool Load (SMESH_Mesh* theMesh, const TopoDS_Face& theFace, - bool theProject); + bool theProject = false); // Create a pattern from the mesh built on . // ==true makes override nodes positions // on computed by mesher @@ -135,8 +137,9 @@ class SMESH_Pattern { // Create nodes and elements in using nodes // coordinates computed by either of Apply...() methods - + // ---------- // Inquiries + // ---------- enum ErrorCode { ERR_OK, @@ -201,8 +204,18 @@ class SMESH_Pattern { void DumpPoints() const; // Debug + // ----------------------------- + // Utilities for advanced usage + // ----------------------------- - private: + TopoDS_Shape GetSubShape( const int i ) const { + if ( i < 1 || i > myShapeIDMap.Extent() ) return TopoDS_Shape(); + return myShapeIDMap( i ); + } + // Return a shape from myShapeIDMap where shapes are indexed so that first go + // ordered vertices, then ordered edge, then faces and maybe a shell + +private: // private methods struct TPoint { diff --git a/src/SMESH/SMESH_SMESH.hxx b/src/SMESH/SMESH_SMESH.hxx new file mode 100755 index 000000000..32433cde3 --- /dev/null +++ b/src/SMESH/SMESH_SMESH.hxx @@ -0,0 +1,39 @@ +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESH_SMESH.hxx +// Author : Alexander A. BORODIN +// Module : SMESH + +#ifndef _SMESH_SMESH_HXX_ +#define _SMESH_SMESH_HXX_ + +#ifdef WNT + #if defined SMESH_EXPORTS + #define SMESH_EXPORT __declspec( dllexport ) + #else + #define SMESH_EXPORT __declspec( dllimport ) + #endif +#else + #define SMESH_EXPORT +#endif + +#endif diff --git a/src/SMESH/SMESH_SequenceOfElemPtr.hxx b/src/SMESH/SMESH_SequenceOfElemPtr.hxx index d46d52ce3..64978e395 100644 --- a/src/SMESH/SMESH_SequenceOfElemPtr.hxx +++ b/src/SMESH/SMESH_SequenceOfElemPtr.hxx @@ -25,6 +25,8 @@ #ifndef SMESH_SequenceOfElemPtr_HeaderFile #define SMESH_SequenceOfElemPtr_HeaderFile +#include "SMESH_SMESH.hxx" + #include #include diff --git a/src/SMESH/SMESH_SequenceOfNode.hxx b/src/SMESH/SMESH_SequenceOfNode.hxx index 8d8f7d5f5..d4edf9502 100644 --- a/src/SMESH/SMESH_SequenceOfNode.hxx +++ b/src/SMESH/SMESH_SequenceOfNode.hxx @@ -26,6 +26,8 @@ #ifndef SMESH_SequenceOfNode_HeaderFile #define SMESH_SequenceOfNode_HeaderFile +#include "SMESH_SMESH.hxx" + #include typedef const SMDS_MeshNode* SMDS_MeshNodePtr; diff --git a/src/SMESH/SMESH_subMesh.cxx b/src/SMESH/SMESH_subMesh.cxx index 6413b8031..7c290171f 100644 --- a/src/SMESH/SMESH_subMesh.cxx +++ b/src/SMESH/SMESH_subMesh.cxx @@ -26,8 +26,9 @@ // Module : SMESH // $Header$ -using namespace std; #include "SMESH_subMesh.hxx" + +#include "SMESH_subMeshEventListener.hxx" #include "SMESH_Gen.hxx" #include "SMESH_Mesh.hxx" #include "SMESH_Hypothesis.hxx" @@ -468,7 +469,7 @@ bool SMESH_subMesh::CanAddHypothesis(const SMESH_Hypothesis* theHypothesis) cons //======================================================================= //function : IsApplicableHypotesis -//purpose : +//purpose : //======================================================================= bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis, @@ -480,11 +481,20 @@ bool SMESH_subMesh::IsApplicableHypotesis(const SMESH_Hypothesis* theHypothesis, // hypothesis switch ( theShapeType ) { - case TopAbs_EDGE: - case TopAbs_FACE: - case TopAbs_SHELL: + case TopAbs_EDGE: + case TopAbs_FACE: case TopAbs_SOLID: return SMESH_Gen::GetShapeDim( theShapeType ) == theHypothesis->GetDim(); + + case TopAbs_SHELL: + // Special case for algorithms, building 2D mesh on a whole shell. + // Before this fix there was a problem after restoring from study, + // because in that case algorithm is assigned before hypothesis + // (on shell in problem case) and hypothesis is checked on faces + // (because it is 2D), where we have NO_ALGO state. + // Now 2D hypothesis is also applicable to shells. + return (theHypothesis->GetDim() == 2 || theHypothesis->GetDim() == 3); + // case TopAbs_WIRE: // case TopAbs_COMPSOLID: // case TopAbs_COMPOUND: @@ -523,8 +533,8 @@ SMESH_Hypothesis::Hypothesis_Status return SMESH_Hypothesis::HYP_OK; } - SMESH_Gen* gen =_father->GetGen(); -// bool ret = false; + SMESH_Gen* gen =_father->GetGen(); + SMESH_Algo* algo = 0; int oldAlgoState = _algoState; bool modifiedHyp = false; // if set to true, force event MODIF_ALGO_STATE // in ComputeStateEngine @@ -644,7 +654,7 @@ SMESH_Hypothesis::Hypothesis_Status } // Serve Propagation of 1D hypothesis else // event == REMOVE_ALGO { - SMESH_Algo* algo = dynamic_cast (anHyp); + algo = dynamic_cast (anHyp); if (!algo->NeedDescretBoundary()) { // clean all mesh in the tree of the current submesh; @@ -673,10 +683,14 @@ SMESH_Hypothesis::Hypothesis_Status case ADD_HYP: break; case ADD_ALGO: { - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); ASSERT(algo); if (algo->CheckHypothesis((*_father),_subShape, aux_ret)) SetAlgoState(HYP_OK); + else if ( algo->IsStatusFatal( aux_ret )) { + _meshDS->RemoveHypothesis(_subShape, anHyp); + ret = aux_ret; + } else SetAlgoState(MISSING_HYP); break; @@ -688,7 +702,7 @@ SMESH_Hypothesis::Hypothesis_Status case ADD_FATHER_HYP: break; case ADD_FATHER_ALGO: { // Algo just added in father - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); ASSERT(algo); if ( algo == anHyp ) { if ( algo->CheckHypothesis((*_father),_subShape, aux_ret)) @@ -701,7 +715,7 @@ SMESH_Hypothesis::Hypothesis_Status case REMOVE_FATHER_HYP: break; case REMOVE_FATHER_ALGO: { - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); if (algo) { if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) @@ -723,7 +737,7 @@ SMESH_Hypothesis::Hypothesis_Status switch (event) { case ADD_HYP: { - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); ASSERT(algo); if ( algo->CheckHypothesis((*_father),_subShape, ret )) SetAlgoState(HYP_OK); @@ -737,10 +751,14 @@ SMESH_Hypothesis::Hypothesis_Status break; } case ADD_ALGO: { //already existing algo : on father ? - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); ASSERT(algo); if ( algo->CheckHypothesis((*_father),_subShape, aux_ret ))// ignore hyp status SetAlgoState(HYP_OK); + else if ( algo->IsStatusFatal( aux_ret )) { + _meshDS->RemoveHypothesis(_subShape, anHyp); + ret = aux_ret; + } else SetAlgoState(MISSING_HYP); break; @@ -748,7 +766,7 @@ SMESH_Hypothesis::Hypothesis_Status case REMOVE_HYP: break; case REMOVE_ALGO: { // perhaps a father algo applies ? - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); if (algo == NULL) // no more algo applying on subShape... { SetAlgoState(NO_ALGO); @@ -763,16 +781,16 @@ SMESH_Hypothesis::Hypothesis_Status break; } case ADD_FATHER_HYP: { - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); ASSERT(algo); if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) SetAlgoState(HYP_OK); else SetAlgoState(MISSING_HYP); - } break; + } case ADD_FATHER_ALGO: { // new father algo - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); ASSERT( algo ); if ( algo == anHyp ) { if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) @@ -785,7 +803,7 @@ SMESH_Hypothesis::Hypothesis_Status case REMOVE_FATHER_HYP: // nothing to do break; case REMOVE_FATHER_ALGO: { - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); if (algo == NULL) // no more applying algo on father { SetAlgoState(NO_ALGO); @@ -811,7 +829,7 @@ SMESH_Hypothesis::Hypothesis_Status switch (event) { case ADD_HYP: { - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); ASSERT(algo); if (!algo->CheckHypothesis((*_father),_subShape, ret )) { @@ -834,7 +852,7 @@ SMESH_Hypothesis::Hypothesis_Status break; } case ADD_ALGO: { //already existing algo : on father ? - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) { // check if algo changes SMESH_HypoFilter f; @@ -842,7 +860,7 @@ SMESH_Hypothesis::Hypothesis_Status f.And( SMESH_HypoFilter::IsApplicableTo( _subShape )); f.AndNot( SMESH_HypoFilter::Is( algo )); const SMESH_Hypothesis * prevAlgo = _father->GetHypothesis( _subShape, f, true ); - if (prevAlgo && + if (prevAlgo && string(algo->GetName()) != string(prevAlgo->GetName()) ) modifiedHyp = true; } @@ -851,7 +869,7 @@ SMESH_Hypothesis::Hypothesis_Status break; } case REMOVE_HYP: { - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); ASSERT(algo); if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) SetAlgoState(HYP_OK); @@ -861,7 +879,7 @@ SMESH_Hypothesis::Hypothesis_Status break; } case REMOVE_ALGO: { // perhaps a father algo applies ? - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); if (algo == NULL) // no more algo applying on subShape... { SetAlgoState(NO_ALGO); @@ -879,7 +897,7 @@ SMESH_Hypothesis::Hypothesis_Status break; } case ADD_FATHER_HYP: { // new father hypothesis ? - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); ASSERT(algo); if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) { @@ -891,7 +909,7 @@ SMESH_Hypothesis::Hypothesis_Status break; } case ADD_FATHER_ALGO: { - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); if ( algo == anHyp ) { // a new algo on father if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) { // check if algo changes @@ -900,7 +918,7 @@ SMESH_Hypothesis::Hypothesis_Status f.And( SMESH_HypoFilter::IsApplicableTo( _subShape )); f.AndNot( SMESH_HypoFilter::Is( algo )); const SMESH_Hypothesis* prevAlgo = _father->GetHypothesis( _subShape, f, true ); - if (prevAlgo && + if (prevAlgo && string(algo->GetName()) != string(prevAlgo->GetName()) ) modifiedHyp = true; } @@ -910,7 +928,7 @@ SMESH_Hypothesis::Hypothesis_Status break; } case REMOVE_FATHER_HYP: { - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); ASSERT(algo); if ( algo->CheckHypothesis((*_father),_subShape, aux_ret )) { // is there the same local hyp or maybe a new father algo applied? @@ -922,7 +940,7 @@ SMESH_Hypothesis::Hypothesis_Status break; } case REMOVE_FATHER_ALGO: { - SMESH_Algo* algo = gen->GetAlgo((*_father), _subShape); + algo = gen->GetAlgo((*_father), _subShape); if (algo == NULL) // no more applying algo on father { SetAlgoState(NO_ALGO); @@ -952,7 +970,16 @@ SMESH_Hypothesis::Hypothesis_Status break; } - if ((_algoState != oldAlgoState) || modifiedHyp) + if ( _algoState != oldAlgoState ) + { + if (_algoState == HYP_OK ) + algo->SetEventListener( this ); + if ( oldAlgoState == HYP_OK ) + DeleteOwnListeners(); + } + NotifyListenersOnEvent( event, ALGO_EVENT, anHyp ); + + if (_algoState != oldAlgoState || modifiedHyp) ComputeStateEngine(MODIF_ALGO_STATE); return ret; @@ -1178,6 +1205,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event) SMESH_Algo *algo = 0; bool ret = true; SMESH_Hypothesis::Hypothesis_Status hyp_status; + algo_state oldAlgoState = (algo_state) GetAlgoState(); switch (_computeState) { @@ -1192,10 +1220,16 @@ bool SMESH_subMesh::ComputeStateEngine(int event) algo = gen->GetAlgo((*_father), _subShape); if (algo && !algo->NeedDescretBoundary()) CleanDependsOn(); // clean sub-meshes with event CLEAN - if (event == MODIF_ALGO_STATE && _algoState == HYP_OK) + if (algo) { - _computeState = READY_TO_COMPUTE; + ret = algo->CheckHypothesis((*_father), _subShape, hyp_status); + if (ret) + _computeState = READY_TO_COMPUTE; } + if ( _computeState == READY_TO_COMPUTE ) + SetAlgoState(HYP_OK); + else + SetAlgoState(MISSING_HYP); break; case COMPUTE: // nothing to do break; @@ -1230,14 +1264,16 @@ bool SMESH_subMesh::ComputeStateEngine(int event) algo = gen->GetAlgo((*_father), _subShape); if (algo && !algo->NeedDescretBoundary()) CleanDependsOn(); // clean sub-meshes with event CLEAN - if (event == MODIF_HYP) - break; // nothing else to do when MODIF_HYP _computeState = NOT_READY; if (algo) { ret = algo->CheckHypothesis((*_father), _subShape, hyp_status); - if (ret) + if (ret) { + SetAlgoState(HYP_OK); // it might be KO if BAD_PARAM_VALUE _computeState = READY_TO_COMPUTE; + } + else + SetAlgoState(MISSING_HYP); } break; case COMPUTE: @@ -1249,6 +1285,7 @@ bool SMESH_subMesh::ComputeStateEngine(int event) { MESSAGE("***** verify compute state *****"); _computeState = NOT_READY; + SetAlgoState(MISSING_HYP); break; } // check submeshes needed @@ -1281,6 +1318,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event) if (!ret) { MESSAGE("problem in algo execution: failed to compute"); + // release ALGO from responsibilty of partially built mesh + RemoveSubMeshElementsAndNodes(); _computeState = FAILED_TO_COMPUTE; if (!algo->NeedDescretBoundary()) UpdateSubMeshState( FAILED_TO_COMPUTE ); @@ -1316,6 +1355,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event) ret = algo->CheckHypothesis((*_father), _subShape, hyp_status); if (ret) _computeState = READY_TO_COMPUTE; + else + SetAlgoState(MISSING_HYP); } break; case SUBMESH_COMPUTED: // nothing to do @@ -1362,6 +1403,8 @@ bool SMESH_subMesh::ComputeStateEngine(int event) ret = algo->CheckHypothesis((*_father), _subShape, hyp_status); if (ret) _computeState = READY_TO_COMPUTE; + else + SetAlgoState(MISSING_HYP); } break; case SUBMESH_COMPUTED: // nothing to do @@ -1447,6 +1490,15 @@ bool SMESH_subMesh::ComputeStateEngine(int event) break; } + if ( _algoState != oldAlgoState || event == MODIF_HYP ) + { + if ( oldAlgoState == HYP_OK ) + DeleteOwnListeners(); + if (_algoState == HYP_OK && algo ) + algo->SetEventListener( this ); + } + NotifyListenersOnEvent( event, COMPUTE_EVENT ); + //SCRUTE(_computeState); return ret; } @@ -1615,11 +1667,9 @@ bool SMESH_subMesh::IsMeshComputed() const TopExp_Explorer exp( _subShape, (TopAbs_ShapeEnum) type ); for ( ; exp.More(); exp.Next() ) { - SMESHDS_SubMesh * subMeshDS = _meshDS->MeshElements( exp.Current() ); - if ( subMeshDS != NULL && - (subMeshDS->GetElements()->more() || subMeshDS->GetNodes()->more())) { + SMESHDS_SubMesh * smDS = _meshDS->MeshElements( exp.Current() ); + if ( smDS && ( smDS->NbElements() || smDS->NbNodes())) return true; - } } } else @@ -1742,3 +1792,150 @@ SMESH_Hypothesis::Hypothesis_Status } return SMESH_Hypothesis::HYP_OK; } + +//================================================================================ +/*! + * \brief Sets an event listener and its data to a submesh + * \param listener - the listener to store + * \param data - the listener data to store + * \param where - the submesh to store the listener and it's data + * \param deleteListener - if true then the listener will be deleted as + * it is removed from where submesh + * + * It remembers the submesh where it puts the listener in order to delete + * them when HYP_OK algo_state is lost + * After being set, event listener is notified on each event of where submesh. + */ +//================================================================================ + +void SMESH_subMesh::SetEventListener(EventListener* listener, + EventListenerData* data, + SMESH_subMesh* where) +{ + if ( listener && where ) { + where->SetEventListener( listener, data ); + myOwnListeners.push_back( make_pair( where, listener )); + } +} + +//================================================================================ +/*! + * \brief Sets an event listener and its data to a submesh + * \param listener - the listener to store + * \param data - the listener data to store + * + * After being set, event listener is notified on each event of a submesh. + */ +//================================================================================ + +void SMESH_subMesh::SetEventListener(EventListener* listener, EventListenerData* data) +{ + myEventListeners.insert( make_pair( listener, data )); +} + +//================================================================================ +/*! + * \brief Return an event listener data + * \param listener - the listener whose data is + * \retval EventListenerData* - found data, maybe NULL + */ +//================================================================================ + +EventListenerData* SMESH_subMesh::GetEventListenerData(EventListener* listener) const +{ + map< EventListener*, EventListenerData* >::const_iterator l_d = + myEventListeners.find( listener ); + if ( l_d != myEventListeners.end() ) + return l_d->second; + return 0; +} + +//================================================================================ +/*! + * \brief Notify stored event listeners on the occured event + * \param event - algo_event or compute_event itself + * \param eventType - algo_event or compute_event + * \param subMesh - the submesh where the event occures + * \param data - listener data stored in the subMesh + * \param hyp - hypothesis, if eventType is algo_event + */ +//================================================================================ + +void SMESH_subMesh::NotifyListenersOnEvent( const int event, + const event_type eventType, + SMESH_Hypothesis* hyp) +{ + map< EventListener*, EventListenerData* >::iterator l_d = myEventListeners.begin(); + for ( ; l_d != myEventListeners.end(); ++l_d ) + l_d->first->ProcessEvent( event, eventType, this, l_d->second, hyp ); +} + +//================================================================================ +/*! + * \brief Unregister the listener and delete listener's data + * \param listener - the event listener + */ +//================================================================================ + +void SMESH_subMesh::DeleteEventListener(EventListener* listener) +{ + map< EventListener*, EventListenerData* >::iterator l_d = + myEventListeners.find( listener ); + if ( l_d != myEventListeners.end() ) { + if ( l_d->first->IsDeletable() ) delete l_d->first; + if ( l_d->second->IsDeletable() ) delete l_d->second; + myEventListeners.erase( l_d ); + } +} + +//================================================================================ +/*! + * \brief Delete event listeners depending on algo of this submesh + */ +//================================================================================ + +void SMESH_subMesh::DeleteOwnListeners() +{ + list< pair< SMESH_subMesh*, EventListener* > >::iterator sm_l; + for ( sm_l = myOwnListeners.begin(); sm_l != myOwnListeners.end(); ++sm_l) + sm_l->first->DeleteEventListener( sm_l->second ); + myOwnListeners.clear(); +} + +//================================================================================ +/*! + * \brief Do something on a certain event + * \param event - algo_event or compute_event itself + * \param eventType - algo_event or compute_event + * \param subMesh - the submesh where the event occures + * \param data - listener data stored in the subMesh + * \param hyp - hypothesis, if eventType is algo_event + * + * The base implementation translates CLEAN event to the subMesh + * stored in listener data. Also it sends SUBMESH_COMPUTED event in case of + * successful COMPUTE event. + */ +//================================================================================ + +void SMESH_subMeshEventListener::ProcessEvent(const int event, + const int eventType, + SMESH_subMesh* subMesh, + EventListenerData* data, + SMESH_Hypothesis* /*hyp*/) +{ + if ( data && !data->mySubMeshes.empty() && + eventType == SMESH_subMesh::COMPUTE_EVENT) + { + ASSERT( data->mySubMeshes.front() != subMesh ); + switch ( event ) { + case SMESH_subMesh::CLEAN: + data->mySubMeshes.front()->ComputeStateEngine( event ); + break; + case SMESH_subMesh::COMPUTE: + if ( subMesh->GetComputeState() == SMESH_subMesh::COMPUTE_OK ) + data->mySubMeshes.front()->ComputeStateEngine( SMESH_subMesh::SUBMESH_COMPUTED ); + break; + default:; + } + } +} diff --git a/src/SMESH/SMESH_subMesh.hxx b/src/SMESH/SMESH_subMesh.hxx index e8f117575..8e09b5c6f 100644 --- a/src/SMESH/SMESH_subMesh.hxx +++ b/src/SMESH/SMESH_subMesh.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_SUBMESH_HXX_ #define _SMESH_SUBMESH_HXX_ +#include "SMESH_SMESH.hxx" + #include "SMESHDS_Mesh.hxx" #include "SMESHDS_SubMesh.hxx" #include "SMESH_Hypothesis.hxx" @@ -45,8 +47,13 @@ class SMESH_Mesh; class SMESH_Hypothesis; class SMESH_Algo; class SMESH_Gen; +class SMESH_subMeshEventListener; +class SMESH_subMeshEventListenerData; + +typedef SMESH_subMeshEventListener EventListener; +typedef SMESH_subMeshEventListenerData EventListenerData; -class SMESH_subMesh +class SMESH_EXPORT SMESH_subMesh { public: SMESH_subMesh(int Id, SMESH_Mesh * father, SMESHDS_Mesh * meshDS, @@ -72,8 +79,6 @@ class SMESH_subMesh const TopoDS_Shape & GetSubShape() const; -// bool _vertexSet; // only for vertex subMesh, set to false for dim > 0 - enum compute_state { NOT_READY, READY_TO_COMPUTE, @@ -96,6 +101,78 @@ class SMESH_subMesh CLEAN, SUBMESH_COMPUTED, SUBMESH_RESTORED, MESH_ENTITY_REMOVED, CHECK_COMPUTE_STATE }; + enum event_type + { + ALGO_EVENT, COMPUTE_EVENT + }; + + // ================================================================== + // Members to track non hierarchical dependencies between submeshes + // ================================================================== + + /*! + * \brief Sets an event listener and its data to a submesh + * \param listener - the listener to store + * \param data - the listener data to store + * \param where - the submesh to store the listener and it's data + * \param deleteListener - if true then the listener will be deleted as + * it is removed from where submesh + * + * It remembers the submesh where it puts the listener in order to delete + * them when HYP_OK algo_state is lost + * After being set, event listener is notified on each event of where submesh. + */ + void SetEventListener(EventListener* listener, + EventListenerData* data, + SMESH_subMesh* where); + + /*! + * \brief Return an event listener data + * \param listener - the listener whose data is + * \retval EventListenerData* - found data, maybe NULL + */ + EventListenerData* GetEventListenerData(EventListener* listener) const; + + /*! + * \brief Unregister the listener and delete it and it's data + * \param listener - the event listener to delete + */ + void DeleteEventListener(EventListener* listener); + +protected: + + //!< event listeners to notify + std::map< EventListener*, EventListenerData* > myEventListeners; + //!< event listeners to delete when HYP_OK algo_state is lost + std::list< std::pair< SMESH_subMesh*, EventListener* > > myOwnListeners; + + /*! + * \brief Sets an event listener and its data to a submesh + * \param listener - the listener to store + * \param data - the listener data to store + * + * After being set, event listener is notified on each event of a submesh. + */ + void SetEventListener(EventListener* listener, EventListenerData* data); + + /*! + * \brief Notify stored event listeners on the occured event + * \param event - algo_event or compute_event itself + * \param eventType - algo_event or compute_event + * \param hyp - hypothesis, if eventType is algo_event + */ + void NotifyListenersOnEvent( const int event, + const event_type eventType, + SMESH_Hypothesis* hyp = 0); + + /*! + * \brief Delete event listeners depending on algo of this submesh + */ + void DeleteOwnListeners(); + + // ================================================================== + +public: SMESH_Hypothesis::Hypothesis_Status AlgoStateEngine(int event, SMESH_Hypothesis * anHyp); @@ -128,7 +205,11 @@ class SMESH_subMesh SMESH_Hypothesis::Hypothesis_Status CheckConcurentHypothesis (const int theHypType); // check if there are several applicable hypothesis on fathers - protected: + bool IsMeshComputed() const; + // check if _subMeshDS contains mesh elements + +protected: + // ================================================================== void InsertDependence(const TopoDS_Shape aSubShape); bool SubMeshesComputed(); @@ -143,9 +224,6 @@ class SMESH_subMesh void CleanDependsOn(); void SetAlgoState(int state); - bool IsMeshComputed() const; - // check if _subMeshDS contains mesh elements - TopoDS_Shape GetCollection(SMESH_Gen * theGen, SMESH_Algo* theAlgo); // return a shape containing all sub-shapes of the MainShape that can be // meshed at once along with _subShape diff --git a/src/SMESH/SMESH_subMeshEventListener.hxx b/src/SMESH/SMESH_subMeshEventListener.hxx new file mode 100644 index 000000000..7f538c34e --- /dev/null +++ b/src/SMESH/SMESH_subMeshEventListener.hxx @@ -0,0 +1,106 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : SMESH_subMeshEventListener.hxx +// Created : Mon Nov 13 10:45:49 2006 +// Author : Edward AGAPOV (eap) + + +#ifndef SMESH_subMeshEventListener_HeaderFile +#define SMESH_subMeshEventListener_HeaderFile + +#include "SMESH_SMESH.hxx" + +#include + +class SMESH_subMesh; +class SMESH_Hypothesis; +struct SMESH_subMeshEventListenerData; + +// ------------------------------------------------------------------ +/*! + * \brief A base for objects reacting on submesh events + */ +// ------------------------------------------------------------------ + +class SMESH_EXPORT SMESH_subMeshEventListener { + bool myIsDeletable; //!< if true, it will be deleted by SMESH_subMesh +public: + SMESH_subMeshEventListener(bool isDeletable):myIsDeletable(isDeletable) {} + bool IsDeletable() const { return myIsDeletable; } + /*! + * \brief Do something on a certain event + * \param event - algo_event or compute_event itself (of SMESH_subMesh) + * \param eventType - ALGO_EVENT or COMPUTE_EVENT (of SMESH_subMesh) + * \param subMesh - the submesh where the event occures + * \param data - listener data stored in the subMesh + * \param hyp - hypothesis, if eventType is algo_event + * + * The base implementation translates CLEAN event to the subMesh stored + * in the listener data. Also it sends SUBMESH_COMPUTED event in case of + * successful COMPUTE event. + */ + virtual void ProcessEvent(const int event, + const int eventType, + SMESH_subMesh* subMesh, + SMESH_subMeshEventListenerData* data, + SMESH_Hypothesis* hyp = 0); +}; + +// ------------------------------------------------------------------ +/*! + * \brief Data specific for EventListener and to be stored in a submesh + */ +// ------------------------------------------------------------------ + +struct SMESH_subMeshEventListenerData +{ + bool myIsDeletable; //!< if true, it will be deleted by SMESH_subMesh + int myType; //!< to recognize data type + std::list mySubMeshes; //!< generally: submeshes depending + // on the one storing this data +public: + SMESH_subMeshEventListenerData(bool isDeletable):myIsDeletable(isDeletable) {} + bool IsDeletable() const { return myIsDeletable; } + + /*! + * \brief Create a default listener data. + * \param dependentSM - subMesh to store + * \param type - data type + * \retval SMESH_subMeshEventListenerData* - a new listener data + * + * See SMESH_subMeshEventListener::ProcessEvent() to know how the default + * listener uses it (implementation is in SMESH_subMesh.cxx) + */ + static SMESH_subMeshEventListenerData* MakeData(SMESH_subMesh* dependentSM, + const int type = 0) + { + SMESH_subMeshEventListenerData* data = new SMESH_subMeshEventListenerData(true); + data->mySubMeshes.push_back( dependentSM ); + data->myType = type; + return data; + } +}; + + +#endif diff --git a/src/SMESHClient/SMESH_Client.cxx b/src/SMESHClient/SMESH_Client.cxx index bd52bc042..135b0fa85 100644 --- a/src/SMESHClient/SMESH_Client.cxx +++ b/src/SMESHClient/SMESH_Client.cxx @@ -749,11 +749,11 @@ SMESH_Client::Update(bool theIsClear) int nbNodes = anIndexes[i++]; // nodes //ASSERT( nbNodes < 9 ); - const SMDS_MeshNode* aNodes[ nbNodes ]; + vector aNodes( nbNodes ); for ( int iNode = 0; iNode < nbNodes; iNode++ ) aNodes[ iNode ] = FindNode( mySMDSMesh, anIndexes[i++] ); // change - mySMDSMesh->ChangeElementNodes( elem, aNodes, nbNodes ); + mySMDSMesh->ChangeElementNodes( elem, &aNodes[0], nbNodes ); } break; diff --git a/src/SMESHClient/SMESH_Client.hxx b/src/SMESHClient/SMESH_Client.hxx index cc17cf88c..298e8eff0 100644 --- a/src/SMESHClient/SMESH_Client.hxx +++ b/src/SMESHClient/SMESH_Client.hxx @@ -32,10 +32,14 @@ #include CORBA_SERVER_HEADER(SMESH_Gen) #include CORBA_SERVER_HEADER(SMESH_Mesh) -#if defined WNT && defined WIN32 && defined SALOME_WNT_EXPORTS -#define SMESHCLIENT_WNT_EXPORT __declspec( dllexport ) +#ifdef WNT +# ifdef SMESHCLIENT_EXPORTS +# define SMESHCLIENT_EXPORT __declspec( dllexport ) +# else +# define SMESHCLIENT_EXPORT __declspec( dllimport ) +# endif #else -#define SMESHCLIENT_WNT_EXPORT +# define SMESHCLIENT_EXPORT #endif class SMESHDS_Mesh; @@ -45,7 +49,7 @@ class SMDS_Mesh; //===================================================================== // SMESH_Client : class definition //===================================================================== -class SMESHCLIENT_WNT_EXPORT SMESH_Client +class SMESHCLIENT_EXPORT SMESH_Client { public: static diff --git a/src/SMESHDS/Makefile.in b/src/SMESHDS/Makefile.in index a182eaa83..c1584c8e5 100644 --- a/src/SMESHDS/Makefile.in +++ b/src/SMESHDS/Makefile.in @@ -67,7 +67,9 @@ EXPORT_HEADERS= \ SMESHDS_SubMesh.hxx \ SMESHDS_GroupBase.hxx \ SMESHDS_Group.hxx \ - SMESHDS_GroupOnGeom.hxx + SMESHDS_GroupOnGeom.hxx \ + SMESH_SMESHDS.hxx \ + SMESHDS_DataMapOfShape.hxx # additionnal information to compil and link file CPPFLAGS += $(OCC_INCLUDES) $(KERNEL_CXXFLAGS) $(BOOST_CPPFLAGS) diff --git a/src/SMESHDS/SMESHDS_Command.hxx b/src/SMESHDS/SMESHDS_Command.hxx index 91d81d452..a48bc6fed 100644 --- a/src/SMESHDS/SMESHDS_Command.hxx +++ b/src/SMESHDS/SMESHDS_Command.hxx @@ -27,11 +27,13 @@ #ifndef _SMESHDS_Command_HeaderFile #define _SMESHDS_Command_HeaderFile +#include "SMESH_SMESHDS.hxx" + #include "SMESHDS_CommandType.hxx" #include #include -class SMESHDS_Command +class SMESHDS_EXPORT SMESHDS_Command { public: diff --git a/src/SMESHDS/SMESHDS_DataMapOfShape.hxx b/src/SMESHDS/SMESHDS_DataMapOfShape.hxx new file mode 100755 index 000000000..27fd08582 --- /dev/null +++ b/src/SMESHDS/SMESHDS_DataMapOfShape.hxx @@ -0,0 +1,43 @@ +// Copyright (C) 2005 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. +// +// 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/ +// +// File: SMESHDS_DataMapOfShape.hxx +// Created: 20.09.05 09:51:12 +// Author: Alexander BORODIN +// Copyright: Open CASCADE 2006 + + +#ifndef SMESHDS_DataMapOfShape_HeaderFile +#define SMESHDS_DataMapOfShape_HeaderFile + +#include + +/* + * This method needed for instance NCollection_DataMap with TopoDS_Shape as key + */ + +inline Standard_Boolean IsEqual(const TopoDS_Shape& S1, + const TopoDS_Shape& S2) +{ + return S1.IsSame(S2); +} + + + +#endif diff --git a/src/SMESHDS/SMESHDS_Document.hxx b/src/SMESHDS/SMESHDS_Document.hxx index 8a195db44..67894d3dd 100644 --- a/src/SMESHDS/SMESHDS_Document.hxx +++ b/src/SMESHDS/SMESHDS_Document.hxx @@ -27,12 +27,14 @@ #ifndef _SMESHDS_Document_HeaderFile #define _SMESHDS_Document_HeaderFile +#include "SMESH_SMESHDS.hxx" + #include "SMESHDS_Mesh.hxx" #include "SMESHDS_Hypothesis.hxx" #include -class SMESHDS_Document +class SMESHDS_EXPORT SMESHDS_Document { public: SMESHDS_Document(int UserID); diff --git a/src/SMESHDS/SMESHDS_Group.hxx b/src/SMESHDS/SMESHDS_Group.hxx index c4ec5ec78..2d41756a5 100644 --- a/src/SMESHDS/SMESHDS_Group.hxx +++ b/src/SMESHDS/SMESHDS_Group.hxx @@ -27,13 +27,15 @@ #ifndef _SMESHDS_Group_HeaderFile #define _SMESHDS_Group_HeaderFile +#include "SMESH_SMESHDS.hxx" + #include #include "SMESHDS_GroupBase.hxx" #include "SMDS_MeshGroup.hxx" class SMESHDS_Mesh; -class SMESHDS_Group : public SMESHDS_GroupBase +class SMESHDS_EXPORT SMESHDS_Group : public SMESHDS_GroupBase { public: @@ -51,9 +53,9 @@ class SMESHDS_Group : public SMESHDS_GroupBase virtual SMDS_ElemIteratorPtr GetElements(); - bool SMESHDS_Group::Add (const int theID); + bool Add (const int theID); - bool SMESHDS_Group::Remove (const int theID); + bool Remove (const int theID); void Clear(); diff --git a/src/SMESHDS/SMESHDS_GroupBase.cxx b/src/SMESHDS/SMESHDS_GroupBase.cxx index 52b21e168..e374b723b 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.cxx +++ b/src/SMESHDS/SMESHDS_GroupBase.cxx @@ -41,7 +41,7 @@ SMESHDS_GroupBase::SMESHDS_GroupBase (const int theID, const SMESHDS_Mesh* theMesh, const SMDSAbs_ElementType theType): myID(theID), myMesh(theMesh), myType(theType), myStoreName(""), - myCurIndex(0), myCurID(-1) + myCurIndex(0), myCurID(-1), myColorGroup(0) { } diff --git a/src/SMESHDS/SMESHDS_GroupBase.hxx b/src/SMESHDS/SMESHDS_GroupBase.hxx index d0095dec6..2bba90532 100644 --- a/src/SMESHDS/SMESHDS_GroupBase.hxx +++ b/src/SMESHDS/SMESHDS_GroupBase.hxx @@ -27,13 +27,15 @@ #ifndef _SMESHDS_GroupBase_HeaderFile #define _SMESHDS_GroupBase_HeaderFile +#include "SMESH_SMESHDS.hxx" + #include #include "SMDSAbs_ElementType.hxx" #include "SMDS_MeshElement.hxx" class SMESHDS_Mesh; -class SMESHDS_GroupBase +class SMESHDS_EXPORT SMESHDS_GroupBase { public: diff --git a/src/SMESHDS/SMESHDS_GroupOnGeom.hxx b/src/SMESHDS/SMESHDS_GroupOnGeom.hxx index bbf2cd35a..eaee815f8 100644 --- a/src/SMESHDS/SMESHDS_GroupOnGeom.hxx +++ b/src/SMESHDS/SMESHDS_GroupOnGeom.hxx @@ -27,12 +27,14 @@ #ifndef _SMESHDS_GroupOnGeom_HeaderFile #define _SMESHDS_GroupOnGeom_HeaderFile +#include "SMESH_SMESHDS.hxx" + #include "SMESHDS_GroupBase.hxx" #include class SMESHDS_SubMesh; -class SMESHDS_GroupOnGeom: public SMESHDS_GroupBase +class SMESHDS_EXPORT SMESHDS_GroupOnGeom: public SMESHDS_GroupBase { public: diff --git a/src/SMESHDS/SMESHDS_Hypothesis.hxx b/src/SMESHDS/SMESHDS_Hypothesis.hxx index 51c5ef486..904ee1ec9 100644 --- a/src/SMESHDS/SMESHDS_Hypothesis.hxx +++ b/src/SMESHDS/SMESHDS_Hypothesis.hxx @@ -29,10 +29,12 @@ #ifndef _SMESHDS_HYPOTHESIS_HXX_ #define _SMESHDS_HYPOTHESIS_HXX_ +#include "SMESH_SMESHDS.hxx" + #include #include -class SMESHDS_Hypothesis +class SMESHDS_EXPORT SMESHDS_Hypothesis { public: SMESHDS_Hypothesis(int hypId); diff --git a/src/SMESHDS/SMESHDS_Mesh.cxx b/src/SMESHDS/SMESHDS_Mesh.cxx index d8a1d5942..36e185f8a 100644 --- a/src/SMESHDS/SMESHDS_Mesh.cxx +++ b/src/SMESHDS/SMESHDS_Mesh.cxx @@ -41,6 +41,11 @@ using namespace std; +/*Standard_Boolean IsEqual( const TopoDS_Shape& S1, const TopoDS_Shape& S2 ) + { + return S1.IsSame( S2 ); + }*/ + //======================================================================= //function : Create //purpose : @@ -70,7 +75,7 @@ void SMESHDS_Mesh::ShapeToMesh(const TopoDS_Shape & S) { // removal of a shape to mesh, delete ... // - hypotheses - myShapeToHypothesis.clear(); + myShapeToHypothesis.Clear(); // - shape indices in SMDS_Position of nodes map::iterator i_sub = myShapeIndexToSubMesh.begin(); for ( ; i_sub != myShapeIndexToSubMesh.end(); i_sub++ ) { @@ -107,7 +112,14 @@ void SMESHDS_Mesh::ShapeToMesh(const TopoDS_Shape & S) bool SMESHDS_Mesh::AddHypothesis(const TopoDS_Shape & SS, const SMESHDS_Hypothesis * H) { - list& alist=myShapeToHypothesis[SS]; + //list& alist=myShapeToHypothesis[SS]; + + if ( !myShapeToHypothesis.IsBound( SS ) ) + myShapeToHypothesis.Bind( SS, list() ); + + list& alist = myShapeToHypothesis.ChangeFind( SS ); + + //Check if the Hypothesis is still present list::iterator ith=alist.begin(); @@ -127,7 +139,7 @@ bool SMESHDS_Mesh::AddHypothesis(const TopoDS_Shape & SS, bool SMESHDS_Mesh::RemoveHypothesis(const TopoDS_Shape & S, const SMESHDS_Hypothesis * H) { - ShapeToHypothesis::iterator its=myShapeToHypothesis.find(S); + /*ShapeToHypothesis::iterator its=myShapeToHypothesis.find(S); if(its!=myShapeToHypothesis.end()) { list::iterator ith=(*its).second.begin(); @@ -138,7 +150,19 @@ bool SMESHDS_Mesh::RemoveHypothesis(const TopoDS_Shape & S, (*its).second.erase(ith); return true; } - } + }*/ + if ( myShapeToHypothesis.IsBound( S ) ) + { + list& alist = myShapeToHypothesis.ChangeFind( S ); + list::iterator ith = alist.begin(); + + for (; ith != alist.end(); ith++) + if (H == *ith) + { + alist.erase(ith); + return true; + } + } return false; } @@ -1018,8 +1042,8 @@ list SMESHDS_Mesh::SubMeshIndices() const list& SMESHDS_Mesh::GetHypothesis( const TopoDS_Shape & S) const { - if (myShapeToHypothesis.find(S)!=myShapeToHypothesis.end()) - return myShapeToHypothesis.find(S)->second; + if ( myShapeToHypothesis.IsBound(S) ) + return myShapeToHypothesis.Find(S); static list empty; return empty; @@ -1060,7 +1084,7 @@ bool SMESHDS_Mesh::HasMeshElements(const TopoDS_Shape & S) //======================================================================= bool SMESHDS_Mesh::HasHypothesis(const TopoDS_Shape & S) { - return myShapeToHypothesis.find(S)!=myShapeToHypothesis.end(); + return myShapeToHypothesis.IsBound(S); } //======================================================================= diff --git a/src/SMESHDS/SMESHDS_Mesh.hxx b/src/SMESHDS/SMESHDS_Mesh.hxx index d2b2257de..967e21a67 100644 --- a/src/SMESHDS/SMESHDS_Mesh.hxx +++ b/src/SMESHDS/SMESHDS_Mesh.hxx @@ -27,6 +27,8 @@ #ifndef _SMESHDS_Mesh_HeaderFile #define _SMESHDS_Mesh_HeaderFile +#include "SMESH_SMESHDS.hxx" + #include "SMDS_Mesh.hxx" #include "SMDS_MeshNode.hxx" #include "SMDS_MeshEdge.hxx" @@ -43,40 +45,18 @@ #include #include #include -#include -#ifdef WNT -#include -#endif - -//Not portable see http://gcc.gnu.org/onlinedocs/libstdc++/faq/index.html#5_4 to know more. -#ifdef __GNUC__ - #if __GNUC__ < 3 - #include - namespace gstd { using ::hash_map; }; // inherit globals - #elif __GNUC__ == 3 - #include - #if __GNUC_MINOR__ == 0 - namespace gstd = std; // GCC 3.0 - #else - namespace gstd = ::__gnu_cxx; // GCC 3.1 and later - #endif - #else // GCC 4.0 and later - #include - namespace gstd = ::__gnu_cxx; - #endif -#else // ... there are other compilers, right? - namespace gstd = std; -#endif -#if defined WNT && defined WIN32 && defined SMESHDS_EXPORTS -#define SMESHDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMESHDS_WNT_EXPORT -#endif +#include +#include +/* + * Using of native haah_map isn't portable and don't work on WIN32 platform. + * So this functionality implement on new NCollection_DataMap technology + */ +#include "SMESHDS_DataMapOfShape.hxx" class SMESHDS_GroupBase; -class SMESHDS_WNT_EXPORT SMESHDS_Mesh:public SMDS_Mesh{ +class SMESHDS_EXPORT SMESHDS_Mesh:public SMDS_Mesh{ public: SMESHDS_Mesh(int theMeshID, bool theIsEmbeddedMode); bool IsEmbeddedMode(); @@ -455,38 +435,23 @@ public: ~SMESHDS_Mesh(); private: -#ifndef WNT - struct HashTopoDS_Shape{ - size_t operator()(const TopoDS_Shape& S) const { - return S.HashCode(2147483647); + void addNodeToSubmesh( const SMDS_MeshNode* aNode, int Index ) + { + //Update or build submesh + map::iterator it = myShapeIndexToSubMesh.find( Index ); + if ( it == myShapeIndexToSubMesh.end() ) + it = myShapeIndexToSubMesh.insert( make_pair(Index, new SMESHDS_SubMesh() )).first; + it->second->AddNode( aNode ); // add aNode to submesh } - }; -#else - typedef gstd::hash_compare< TopoDS_Shape, less > HashTopoDS; - - class HashTopoDS_Shape : public HashTopoDS { - public: - size_t operator()(const TopoDS_Shape& S) const { + /*int HashCode( const TopoDS_Shape& S, const Standard_Integer theUpper ) const + { return S.HashCode(2147483647); - } - - bool operator()(const TopoDS_Shape& S1,const TopoDS_Shape& S2) const { - return S1==S2; - } - }; - - - -#endif + }*/ typedef std::list THypList; -#ifndef WNT - typedef gstd::hash_map ShapeToHypothesis; -#else - typedef gstd::hash_map ShapeToHypothesis; -#endif + typedef NCollection_DataMap< TopoDS_Shape, THypList > ShapeToHypothesis; ShapeToHypothesis myShapeToHypothesis; diff --git a/src/SMESHDS/SMESHDS_Script.hxx b/src/SMESHDS/SMESHDS_Script.hxx index 01108d3b8..781fc9910 100644 --- a/src/SMESHDS/SMESHDS_Script.hxx +++ b/src/SMESHDS/SMESHDS_Script.hxx @@ -27,13 +27,15 @@ #ifndef _SMESHDS_Script_HeaderFile #define _SMESHDS_Script_HeaderFile +#include "SMESH_SMESHDS.hxx" + #include "SMESHDS_Command.hxx" #include #include -class SMESHDS_Script +class SMESHDS_EXPORT SMESHDS_Script { public: SMESHDS_Script(bool theIsEmbeddedMode); diff --git a/src/SMESHDS/SMESHDS_SubMesh.hxx b/src/SMESHDS/SMESHDS_SubMesh.hxx index 36617577e..1231c490c 100644 --- a/src/SMESHDS/SMESHDS_SubMesh.hxx +++ b/src/SMESHDS/SMESHDS_SubMesh.hxx @@ -27,16 +27,12 @@ #ifndef _SMESHDS_SubMesh_HeaderFile #define _SMESHDS_SubMesh_HeaderFile +#include "SMESH_SMESHDS.hxx" + #include "SMDS_Mesh.hxx" #include -#if defined WNT && defined WIN32 && defined SMESHDS_EXPORTS -#define SMESHDS_WNT_EXPORT __declspec( dllexport ) -#else -#define SMESHDS_WNT_EXPORT -#endif - -class SMESHDS_WNT_EXPORT SMESHDS_SubMesh +class SMESHDS_EXPORT SMESHDS_SubMesh { public: diff --git a/src/SMESHDS/SMESH_SMESHDS.hxx b/src/SMESHDS/SMESH_SMESHDS.hxx new file mode 100755 index 000000000..fdef18da9 --- /dev/null +++ b/src/SMESHDS/SMESH_SMESHDS.hxx @@ -0,0 +1,39 @@ +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESH_SMESHDS.hxx +// Author : Alexander A. BORODIN +// Module : SMESH + +#ifndef _SMESH_SMESHDS_HXX_ +#define _SMESH_SMESHDS_HXX_ + +#ifdef WNT + #if defined SMESHDS_EXPORTS + #define SMESHDS_EXPORT __declspec( dllexport ) + #else + #define SMESHDS_EXPORT __declspec( dllimport ) + #endif +#else + #define SMESHDS_EXPORT +#endif + +#endif \ No newline at end of file diff --git a/src/SMESHFiltersSelection/SMESH_LogicalFilter.hxx b/src/SMESHFiltersSelection/SMESH_LogicalFilter.hxx index b5f62c9f7..a6197ab82 100644 --- a/src/SMESHFiltersSelection/SMESH_LogicalFilter.hxx +++ b/src/SMESHFiltersSelection/SMESH_LogicalFilter.hxx @@ -23,11 +23,13 @@ #ifndef _SMESH_LogicalFilter_HeaderFile #define _SMESH_LogicalFilter_HeaderFile +#include "SMESH_Type.h" + #include #include -class SMESH_LogicalFilter : public SUIT_SelectionFilter +class SMESHFILTERSSELECTION_EXPORT SMESH_LogicalFilter : public SUIT_SelectionFilter { public: enum { LO_OR, LO_AND, LO_NOT, LO_UNDEFINED }; diff --git a/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx b/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx index 929401562..61162a581 100644 --- a/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx +++ b/src/SMESHFiltersSelection/SMESH_NumberFilter.cxx @@ -176,24 +176,26 @@ GEOM::GEOM_Object_ptr SMESH_NumberFilter::getGeom return anObj._retn(); // Get geom object corresponding to the mesh - _PTR(ChildIterator) anIter = study->NewChildIterator(aSO); - for (; anIter->More(); anIter->Next()) { - _PTR(SObject) aSO = anIter->Value(); - if (!aSO) - continue; - _PTR(SObject) aRefSO; - _PTR(SObject) anObj; - if (aSO->ReferencedObject(aRefSO)) - anObj = aRefSO; - - if (!anObj) - anObj = aSO; - - anObject = _CAST(SObject,anObj)->GetObject(); - GEOM::GEOM_Object_var aMeshShape = GEOM::GEOM_Object::_narrow(anObject); - - if (!aMeshShape->_is_nil()) - return aMeshShape._retn(); + if ( myKind == "SMESH" ) { + _PTR(ChildIterator) anIter = study->NewChildIterator(aSO); + for (; anIter->More(); anIter->Next()) { + _PTR(SObject) aSO = anIter->Value(); + if (!aSO) + continue; + _PTR(SObject) aRefSO; + _PTR(SObject) anObj; + if (aSO->ReferencedObject(aRefSO)) + anObj = aRefSO; + + if (!anObj) + anObj = aSO; + + anObject = _CAST(SObject,anObj)->GetObject(); + GEOM::GEOM_Object_var aMeshShape = GEOM::GEOM_Object::_narrow(anObject); + + if (!aMeshShape->_is_nil()) + return aMeshShape._retn(); + } } return GEOM::GEOM_Object::_nil(); diff --git a/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx b/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx index c4d3d8418..badf44006 100644 --- a/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx +++ b/src/SMESHFiltersSelection/SMESH_NumberFilter.hxx @@ -23,6 +23,8 @@ #ifndef _SMESH_NumberFilter_HeaderFile #define _SMESH_NumberFilter_HeaderFile +#include "SMESH_Type.h" + #include "SUIT_SelectionFilter.h" #include @@ -31,6 +33,8 @@ #include #include CORBA_SERVER_HEADER(GEOM_Gen) +#include + class SUIT_DataOwner; /*! @@ -45,7 +49,7 @@ class SUIT_DataOwner; * * theMainObject - Sub-shapes of this object is selected only * * theIsClosedOnly - Closed shapes is selected if this parameter is true */ -class SMESH_NumberFilter : public SUIT_SelectionFilter +class SMESHFILTERSSELECTION_EXPORT SMESH_NumberFilter : public SUIT_SelectionFilter { public: SMESH_NumberFilter (const char* theKind, @@ -77,7 +81,7 @@ class SMESH_NumberFilter : public SUIT_SelectionFilter GEOM::GEOM_Object_ptr getGeom (const SUIT_DataOwner*, const bool extractReference = true ) const; private: - char* myKind; + std::string myKind; TopAbs_ShapeEnum mySubShapeType; int myNumber; bool myIsClosedOnly; diff --git a/src/SMESHFiltersSelection/SMESH_Type.h b/src/SMESHFiltersSelection/SMESH_Type.h index 03d63d19d..6b765a3fa 100644 --- a/src/SMESHFiltersSelection/SMESH_Type.h +++ b/src/SMESHFiltersSelection/SMESH_Type.h @@ -29,6 +29,16 @@ #ifndef SMESH_TYPE_HEADER #define SMESH_TYPE_HEADER +#ifdef WNT + #if defined SMESHFILTERSSELECTION_EXPORTS + #define SMESHFILTERSSELECTION_EXPORT __declspec( dllexport ) + #else + #define SMESHFILTERSSELECTION_EXPORT __declspec( dllimport ) + #endif +#else + #define SMESHFILTERSSELECTION_EXPORT +#endif + enum MeshObjectType { HYPOTHESIS, ALGORITHM, diff --git a/src/SMESHFiltersSelection/SMESH_TypeFilter.hxx b/src/SMESHFiltersSelection/SMESH_TypeFilter.hxx index c31cc577b..da5ada02e 100644 --- a/src/SMESHFiltersSelection/SMESH_TypeFilter.hxx +++ b/src/SMESHFiltersSelection/SMESH_TypeFilter.hxx @@ -28,7 +28,7 @@ class SUIT_DataOwner; -class SMESH_TypeFilter : public SUIT_SelectionFilter +class SMESHFILTERSSELECTION_EXPORT SMESH_TypeFilter : public SUIT_SelectionFilter { public: SMESH_TypeFilter (MeshObjectType theType); diff --git a/src/SMESHGUI/Makefile.in b/src/SMESHGUI/Makefile.in index 6871db105..87a8ed0fb 100644 --- a/src/SMESHGUI/Makefile.in +++ b/src/SMESHGUI/Makefile.in @@ -42,7 +42,10 @@ EXPORT_HEADERS= SMESHGUI_Swig.hxx \ SMESHGUI_Hypotheses.h \ SMESHGUI_HypothesesUtils.h \ SMESHGUI_SpinBox.h \ - SMESHGUI_Selection.h + SMESHGUI_Selection.h \ + SMESHGUI_VTKUtils.h \ + SMESH_SMESHGUI.hxx + # .po files to transform in .qm PO_FILES = \ diff --git a/src/SMESHGUI/SMESHGUI.cxx b/src/SMESHGUI/SMESHGUI.cxx index 8fb5c12c2..e570b199d 100644 --- a/src/SMESHGUI/SMESHGUI.cxx +++ b/src/SMESHGUI/SMESHGUI.cxx @@ -145,7 +145,7 @@ using namespace std; -namespace{ +//namespace{ // Declarations //============================================================= void ImportMeshesFromFile(SMESH::SMESH_Gen_ptr theComponentMesh, @@ -330,7 +330,7 @@ namespace{ aFormat = aFilterMap[fd->selectedFilter()]; is_ok = true; if ( !aFilename.isEmpty() - && (aMesh->NbPolygons()>0 or aMesh->NbPolyhedrons()>0) + && (aMesh->NbPolygons()>0 || aMesh->NbPolyhedrons()>0) && aFormat==SMESH::MED_V2_1) { int aRet = SUIT_MessageBox::warn2(SMESHGUI::desktop(), QObject::tr("SMESH_WRN_WARNING"), @@ -352,21 +352,32 @@ namespace{ if ( aFile.exists() ) aFile.remove(); SUIT_OverrideCursor wc; - switch ( theCommandID ) { - case 125: - case 122: - aMesh->ExportToMED( aFilename.latin1(), toCreateGroups, aFormat ); - break; - case 124: - case 121: - aMesh->ExportDAT( aFilename.latin1() ); - break; - case 126: - case 123: - aMesh->ExportUNV( aFilename.latin1() ); - break; - default: - break; + + try { + switch ( theCommandID ) { + case 125: + case 122: + aMesh->ExportToMED( aFilename.latin1(), toCreateGroups, aFormat ); + break; + case 124: + case 121: + aMesh->ExportDAT( aFilename.latin1() ); + break; + case 126: + case 123: + aMesh->ExportUNV( aFilename.latin1() ); + break; + default: + break; + } + } + catch (const SALOME::SALOME_Exception& S_ex){ + wc.suspend(); + SUIT_MessageBox::warn1(SMESHGUI::desktop(), + QObject::tr("SMESH_WRN_WARNING"), + QObject::tr("SMESH_EXPORT_FAILED"), + QObject::tr("SMESH_BUT_OK")); + wc.resume(); } } } @@ -815,10 +826,10 @@ namespace{ SMESHGUI::GetSMESHGUI()->updateObjBrowser(); } -} +//} extern "C" { - Standard_EXPORT CAM_Module* createModule() + SMESHGUI_EXPORT CAM_Module* createModule() { return new SMESHGUI(); } @@ -1217,6 +1228,11 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } } } + + // PAL13338 --> + if ( ( theCommandID==301 || theCommandID==302 ) && !checkLock(aStudy) && !automaticUpdate() ) + SMESH::UpdateView(); + // PAL13338 <-- if (anAction == SMESH::eErase) { SALOME_ListIO l1; @@ -1224,6 +1240,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) } else aSel->setSelectedObjects( to_process ); + break; } @@ -2155,12 +2172,14 @@ bool SMESHGUI::OnGUIEvent( int theCommandID ) LightApp_SelectionMgr* mgr = selectionMgr(); SALOME_ListIO selected; mgr->selectedObjects( selected ); - if (selected.Extent() == 1) { - Handle(SALOME_InteractiveObject) anIObject = selected.First(); - if(anIObject->hasEntry()) + SALOME_ListIteratorOfListIO it(selected); + for(; it.More(); it.Next()) { + Handle(SALOME_InteractiveObject) anIObject = it.Value(); + if(anIObject->hasEntry()) { if(SMESH_Actor *anActor = SMESH::FindActorByEntry(anIObject->getEntry())){ anActor->SetPointsLabeled( !anActor->GetPointsLabeled() ); } + } } break; } @@ -2930,7 +2949,7 @@ QString SMESHGUI::engineIOR() const { CORBA::ORB_var anORB = getApp()->orb(); CORBA::String_var anIOR = anORB->object_to_string(GetSMESHGen()); - return anIOR.in(); + return QString( anIOR.in() ); } void SMESHGUI::contextMenuPopup( const QString& client, QPopupMenu* menu, QString& /*title*/ ) @@ -3139,8 +3158,6 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_width", sbW); if(sbX1+sbW > aTol){ aWarning = "Origin and Size Vertical: X+Width > 1\n"; - sbX1=0.01; - sbW=0.05; aResourceMgr->setValue("SMESH", "scalar_bar_vertical_x", sbX1); aResourceMgr->setValue("SMESH", "scalar_bar_vertical_width", sbW); } @@ -3150,8 +3167,6 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) sbH = aResourceMgr->doubleValue("SMESH", "scalar_bar_vertical_height",sbH); if(sbY1+sbH > aTol){ aWarning = "Origin and Size Vertical: Y+Height > 1\n"; - sbY1=0.01; - sbH=0.5; aResourceMgr->setValue("SMESH", "scalar_bar_vertical_y", sbY1); aResourceMgr->setValue("SMESH", "scalar_bar_vertical_height",sbH); } @@ -3161,8 +3176,8 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) sbW = aResourceMgr->doubleValue("SMESH", "scalar_bar_horizontal_width", sbW); if(sbX1+sbW > aTol){ aWarning = "Origin and Size Horizontal: X+Width > 1\n"; - sbX1=0.2; - sbW=0.6; + sbX1=0.01; + sbW=0.05; aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_x", sbX1); aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_width", sbW); } @@ -3173,7 +3188,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name ) if(sbY1+sbH > aTol){ aWarning = "Origin and Size Horizontal: Y+Height > 1\n"; sbY1=0.01; - sbH=0.12; + sbH=0.05; aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_y", sbY1); aResourceMgr->setValue("SMESH", "scalar_bar_horizontal_height",sbH); } @@ -3293,3 +3308,4 @@ LightApp_Displayer* SMESHGUI::displayer() myDisplayer = new SMESHGUI_Displayer( getApp() ); return myDisplayer; } + diff --git a/src/SMESHGUI/SMESHGUI.h b/src/SMESHGUI/SMESHGUI.h index 72f756e46..7dbab6471 100644 --- a/src/SMESHGUI/SMESHGUI.h +++ b/src/SMESHGUI/SMESHGUI.h @@ -29,6 +29,8 @@ #ifndef SMESHGUI_HeaderFile #define SMESHGUI_HeaderFile +#include "SMESH_SMESHGUI.hxx" + // SALOME Includes #include #include @@ -55,7 +57,7 @@ class SMESHGUI_FilterLibraryDlg; // class : SMESHGUI // purpose : //================================================================================= -class SMESHGUI : public SalomeApp_Module +class SMESHGUI_EXPORT SMESHGUI : public SalomeApp_Module { Q_OBJECT; diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx index 18dc86e26..3d51f663a 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx @@ -535,9 +535,15 @@ void SMESHGUI_AddMeshElementDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h index f09295421..3f4722315 100644 --- a/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h +++ b/src/SMESHGUI/SMESHGUI_AddMeshElementDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_ADD_FACE_H #define DIALOGBOX_ADD_FACE_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" #include "SMDSAbs_ElementType.hxx" @@ -66,7 +68,7 @@ namespace SMESH{ // class : SMESHGUI_AddMeshElementDlg // purpose : //================================================================================= -class SMESHGUI_AddMeshElementDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_AddMeshElementDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx index ca7d886e3..19ac2836e 100644 --- a/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_AddQuadraticElementDlg.cxx @@ -694,9 +694,15 @@ void SMESHGUI_AddQuadraticElementDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx index 6ec0c63bb..2558e6567 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.cxx @@ -443,9 +443,15 @@ void SMESHGUI_ClippingDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_ClippingDlg.h b/src/SMESHGUI/SMESHGUI_ClippingDlg.h index 2fe681851..a0f221bda 100644 --- a/src/SMESHGUI/SMESHGUI_ClippingDlg.h +++ b/src/SMESHGUI/SMESHGUI_ClippingDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_CLIPPING_H #define DIALOGBOX_CLIPPING_H +#include "SMESH_SMESHGUI.hxx" + #include #include @@ -68,7 +70,7 @@ namespace SMESH { // class : SMESHGUI_ClippingDlg // purpose : //================================================================================= -class SMESHGUI_ClippingDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_ClippingDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_CreateHypothesesDlg.h b/src/SMESHGUI/SMESHGUI_CreateHypothesesDlg.h new file mode 100644 index 000000000..3219dd56c --- /dev/null +++ b/src/SMESHGUI/SMESHGUI_CreateHypothesesDlg.h @@ -0,0 +1,96 @@ +// SMESH SMESHGUI : GUI for SMESH component +// +// Copyright (C) 2003 CEA +// +// 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. +// +// 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.org +// +// +// +// File : SMESHGUI_CreateHypothesesDlg.h +// Author : Julia DOROVSKIKH +// Module : SMESH +// $Header$ + +#ifndef DIALOGBOX_CREATE_HYPOTHESES_H +#define DIALOGBOX_CREATE_HYPOTHESES_H + +#include "SMESH_SMESHGUI.hxx" + +// QT Includes +#include +#include +#include + +// IDL Headers +#include +#include CORBA_SERVER_HEADER(GEOM_Gen) +#include CORBA_SERVER_HEADER(SMESH_Mesh) + +#include +#include + +class QButtonGroup; +class QGroupBox; +class QPushButton; +class QListView; +class QListViewItem; +class SMESHGUI; + +//================================================================================= +// class : SMESHGUI_CreateHypothesesDlg +// purpose : +//================================================================================= +class SMESHGUI_EXPORT SMESHGUI_CreateHypothesesDlg : public QDialog +{ + Q_OBJECT + +public: + SMESHGUI_CreateHypothesesDlg (SMESHGUI*, + const char* name = 0, + bool modal = FALSE, + bool isAlgo = FALSE); + ~SMESHGUI_CreateHypothesesDlg (); + +private: + + void Init() ; + void closeEvent( QCloseEvent* e ) ; + void enterEvent ( QEvent * ) ; + + void InitAlgoDefinition(); + + SMESHGUI* mySMESHGUI; + bool myIsAlgo; + + QGroupBox* GroupButtons; + QPushButton* buttonCancel; + QPushButton* buttonApply; + + QGroupBox* GroupAlgorithms; + QListView* ListAlgoDefinition; + +private slots: + + void ClickOnCancel(); + void ClickOnApply(); + void ActivateThisDialog() ; + + void onSelectionChanged(); + void onDoubleClicked(QListViewItem*); +}; + +#endif // DIALOGBOX_CREATE_HYPOTHESES_H diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx index 85579d9f1..655415bdd 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.cxx @@ -1,749 +1,755 @@ -// SMESH SMESHGUI : GUI for SMESH component -// -// Copyright (C) 2003 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. -// -// 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 -// +// SMESH SMESHGUI : GUI for SMESH component +// +// Copyright (C) 2003 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. +// +// 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 : SMESHGUI_CreatePatternDlg.cxx -// Author : Sergey LITONIN -// Module : SMESH - -#include "SMESHGUI_CreatePatternDlg.h" - -#include "SMESHGUI.h" -#include "SMESHGUI_SpinBox.h" -#include "SMESHGUI_PatternWidget.h" -#include "SMESHGUI_Utils.h" -#include "SMESHGUI_VTKUtils.h" -#include "SMESHGUI_PatternUtils.h" -#include "SMESHGUI_GEOMGenUtils.h" - -#include "SMESH_NumberFilter.hxx" - -#include "SUIT_ResourceMgr.h" -#include "SUIT_Desktop.h" -#include "SUIT_FileDlg.h" -#include "SUIT_Session.h" -#include "SUIT_MessageBox.h" - -#include "SalomeApp_Study.h" -#include "LightApp_Application.h" -#include "LightApp_DataOwner.h" -#include "LightApp_SelectionMgr.h" -#include "SalomeApp_Tools.h" - -#include "SALOMEDS_SObject.hxx" - -#include "SALOME_ListIO.hxx" -#include "SVTK_ViewModel.h" -#include "SVTK_ViewWindow.h" -#include "SVTK_Selector.h" -#include "SVTK_Selection.h" - -// OCCT Includes -#include - -// QT Includes -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define SPACING 5 -#define MARGIN 10 - -/*! - * Class : SMESHGUI_CreatePatternDlg - * Description : Dialog to specify filters for VTK viewer - */ - -//======================================================================= -// function : SMESHGUI_CreatePatternDlg() -// purpose : Constructor -//======================================================================= -SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI* theModule, - const int theType, - const char* theName) - : QDialog( SMESH::GetDesktop( theModule ), theName, false, - WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), - mySMESHGUI( theModule ), - mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) -{ - setCaption(tr("CAPTION")); - - QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING); - - QFrame* aMainFrame = createMainFrame (this); - QFrame* aBtnFrame = createButtonFrame(this); - - aDlgLay->addWidget(aMainFrame); - aDlgLay->addWidget(aBtnFrame); - - aDlgLay->setStretchFactor(aMainFrame, 1); - - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - mySelector = aViewWindow->GetSelector(); - - myHelpFileName = "pattern_mapping.htm"; - - Init(theType); -} - -//======================================================================= -// function : createMainFrame() -// purpose : Create frame containing dialog's input fields -//======================================================================= -QFrame* SMESHGUI_CreatePatternDlg::createMainFrame (QWidget* theParent) -{ - QPixmap iconSlct (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); - QPixmap icon2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_2d"))); - QPixmap icon3d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_3d"))); - QPixmap iconSample2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_2D"))); - - QGroupBox* aMainGrp = new QGroupBox(1, Qt::Horizontal, theParent); - aMainGrp->setFrameStyle(QFrame::NoFrame); - aMainGrp->setInsideMargin(0); - - // Pattern type group - - myTypeGrp = new QButtonGroup (1, Qt::Vertical, tr("PATTERN_TYPE"), aMainGrp); - mySwitch2d = new QRadioButton (myTypeGrp); - mySwitch3d = new QRadioButton (myTypeGrp); - mySwitch2d->setPixmap(icon2d); - mySwitch3d->setPixmap(icon3d); - myTypeGrp->insert(mySwitch2d, Type_2d); - myTypeGrp->insert(mySwitch3d, Type_3d); - - QGroupBox* aPatternGrp = new QGroupBox(1, Qt::Horizontal, tr("PATTERN"), aMainGrp); - - // Mesh and pattern name group - - QGroupBox* aMeshGrp = new QGroupBox(1, Qt::Vertical, aPatternGrp); - aMeshGrp->setFrameStyle(QFrame::NoFrame); - aMeshGrp->setInsideMargin(0); - - new QLabel(tr("MESH_OR_SUBMESH"), aMeshGrp); - - QPushButton* aSelBtn = new QPushButton(aMeshGrp); - aSelBtn->setPixmap(iconSlct); - myMeshEdit = new QLineEdit(aMeshGrp); - myMeshEdit->setReadOnly(true); - - QGroupBox* aPattGrp = new QGroupBox(1, Qt::Vertical, aPatternGrp); - aPattGrp->setFrameStyle(QFrame::NoFrame); - aPattGrp->setInsideMargin(0); - - new QLabel(tr("PATTERN_NAME"), aPattGrp); - myName = new QLineEdit(aPattGrp); - - // Picture 2d - - myPicture2d = new SMESHGUI_PatternWidget(aPatternGrp), - myPicture2d->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); - - // Project check box - - myProjectChk = new QCheckBox(tr("PROJECT"), aPatternGrp); - - // Connect signals and slots - - connect(myTypeGrp, SIGNAL(clicked(int) ), SLOT(onTypeChanged(int))); - connect(myProjectChk, SIGNAL(toggled(bool)), SLOT(onProject(bool) )); - connect(aSelBtn, SIGNAL(clicked() ), SLOT(onSelBtnClicked())); - - return aMainGrp; -} - -//======================================================================= -// function : createButtonFrame() -// purpose : Create frame containing buttons -//======================================================================= -QFrame* SMESHGUI_CreatePatternDlg::createButtonFrame (QWidget* theParent) -{ - QFrame* aFrame = new QFrame(theParent); - aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken); - - myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); - mySaveBtn = new QPushButton(tr("SAVE" ), aFrame); - myCloseBtn = new QPushButton(tr("SMESH_BUT_CANCEL"), aFrame); - myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame); - - QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); - - QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING); - - aLay->addWidget(myOkBtn); - aLay->addWidget(mySaveBtn); - aLay->addItem(aSpacer); - aLay->addWidget(myCloseBtn); - aLay->addWidget(myHelpBtn); - - connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); - connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); - connect(mySaveBtn, SIGNAL(clicked()), SLOT(onSave())); - connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); - - return aFrame; -} - -//======================================================================= -// function : ~SMESHGUI_CreatePatternDlg() -// purpose : Destructor -//======================================================================= -SMESHGUI_CreatePatternDlg::~SMESHGUI_CreatePatternDlg() -{ - // no need to delete child widgets, Qt does it all for us -} - -//======================================================================= -// function : onProject() -// purpose : SLOT. Called when state of "Project nodes on ther face" -// checkbox is changed -//======================================================================= -void SMESHGUI_CreatePatternDlg::onProject (bool) -{ - loadFromObject(false); - displayPreview(); -} - -//======================================================================= -// function : Init() -// purpose : Init dialog fields, connect signals and slots, show dialog -//======================================================================= -void SMESHGUI_CreatePatternDlg::Init( const int theType ) -{ - myIsLoaded = false; - myType = -1; - myNbPoints = -1; - mySubMesh = SMESH::SMESH_subMesh::_nil(); - myMesh = SMESH::SMESH_Mesh::_nil(); - myGeomObj = GEOM::GEOM_Object::_nil(); - myPattern = SMESH::SMESH_Pattern::_nil(); - - erasePreview(); - - mySMESHGUI->SetActiveDialogBox((QDialog*)this); - - // selection and SMESHGUI - connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); - connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); - connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); - - mySwitch2d->setEnabled(theType == Type_2d); - mySwitch3d->setEnabled(theType == Type_3d); - - if (theType == Type_2d) - myProjectChk->show(); - else - myProjectChk->hide(); - - myTypeGrp->setButton(theType); - onTypeChanged(theType); - - myName->setText(getDefaultName()); - myMeshEdit->setText(""); - - setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); - qApp->processEvents(); - updateGeometry(); - myPicture2d->updateGeometry(); - adjustSize(); - resize(minimumSize()); - - activateSelection(); - onSelectionDone(); - - this->show(); -} - -//======================================================================= -// function : SetMesh() -// purpose : Set mesh to dialog -//======================================================================= -void SMESHGUI_CreatePatternDlg::SetMesh (SMESH::SMESH_Mesh_ptr thePtr) -{ - myMesh = SMESH::SMESH_Mesh::_duplicate(thePtr); - mySubMesh = SMESH::SMESH_subMesh::_nil(); - - bool isValidMesh = false; - if (!myMesh->_is_nil()) - { - _PTR(SObject) aSobj = SMESH::FindSObject(myMesh.in()); - //Handle(SALOME_InteractiveObject) anIObj = - // new SALOME_InteractiveObject(aSobj->GetID().c_str(), "SMESH"); - SUIT_DataOwnerPtr anIObj (new LightApp_DataOwner(aSobj->GetID().c_str())); - - isValidMesh = mySelectionMgr->isOk(anIObj); - } - - if (isValidMesh) { - _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in()); - myMeshEdit->setText(aSO->GetName().c_str()); - myGeomObj = SMESH::GetGeom(aSO); - } else { - myMeshEdit->setText(""); - myGeomObj = GEOM::GEOM_Object::_nil(); - } - - if (myType == Type_2d) { - loadFromObject(false); - displayPreview(); - } -} - -//======================================================================= -// function : isValid() -// purpose : Verify validity of entry data -//======================================================================= -bool SMESHGUI_CreatePatternDlg::isValid() -{ - if (myGeomObj->_is_nil()) { - QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), - tr("SMESH_INSUFFICIENT_DATA"), - tr("SMESHGUI_INVALID_PARAMETERS"), - QMessageBox::Ok); - return false; - } - else - return true; -} - -//======================================================================= -// function : getDefaultName() -// purpose : Get default pattern name -//======================================================================= -QString SMESHGUI_CreatePatternDlg::getDefaultName() const -{ - return myType == Type_2d ? tr("DEFAULT_2D") : tr("DEFAULT_3D"); -} - -//======================================================================= -// function : onSave() -// purpose : SLOT called when "Save" button pressed. Build pattern and -// save it to disk -//======================================================================= -void SMESHGUI_CreatePatternDlg::onSave() -{ - try { - if (!isValid()) - return; - - if (!myIsLoaded) - loadFromObject(true); - - // Load pattern from object - if (!myIsLoaded) - return; - - /////////////////////////////////////////////////////// - SUIT_FileDlg* aDlg = new SUIT_FileDlg (this, false); - aDlg->setCaption(tr("SAVE_PATTERN")); - aDlg->setMode(QFileDialog::AnyFile); - aDlg->setFilters(tr("PATTERN_FILT")); - if (myName->text() != "") - aDlg->setSelection(myName->text()); - - if (aDlg->exec() != Accepted) - return; - - QString fName = aDlg->selectedFile(); - if (fName.isEmpty()) - return; - - if (QFileInfo(fName).extension().isEmpty()) - fName = autoExtension(fName); - - fName = QDir::convertSeparators(fName); - - QString aData (myPattern->GetString()); - long aLen = aData.length(); - - QFile aFile (fName); - aFile.open(IO_WriteOnly); - long aWritten = aFile.writeBlock(aData, aLen); - aFile.close(); - - if (aWritten != aLen) { - QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), tr("SMESH_ERROR"), - tr("ERROR_OF_SAVING"), QMessageBox::Ok); - } else { - //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - disconnect(mySelectionMgr, 0, this, 0); - disconnect(mySMESHGUI, 0, this, 0); - mySMESHGUI->ResetState(); - accept(); - emit NewPattern(); - } - } catch (const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } catch (...) { - } -} - -//======================================================================= -// function : GetPatternName() -// purpose : Get name of pattern -//======================================================================= -QString SMESHGUI_CreatePatternDlg::GetPatternName() const -{ - return myName->text(); -} - -//======================================================================= -// function : GetPattern() -// purpose : Get result pattern -//======================================================================= -SMESH::SMESH_Pattern_ptr SMESHGUI_CreatePatternDlg::GetPattern() -{ - return myPattern.in(); -} - -//======================================================================= -// function : onOk() -// purpose : SLOT called when "Ok" button pressed. -//======================================================================= -void SMESHGUI_CreatePatternDlg::onOk() -{ - try { - if (!isValid()) - return; - - if (!myIsLoaded) - loadFromObject(true); - - // Load pattern from object - if (!myIsLoaded) { - return; - } else { - //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - disconnect(mySelectionMgr, 0, this, 0); - disconnect(mySMESHGUI, 0, this, 0); - mySMESHGUI->ResetState(); - accept(); - emit NewPattern(); - } - } catch (const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } catch (...) { - } -} - -//======================================================================= -// function : onClose() -// purpose : SLOT called when "Close" button pressed. Close dialog -//======================================================================= -void SMESHGUI_CreatePatternDlg::onClose() -{ - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - disconnect(mySelectionMgr, 0, this, 0); - disconnect(mySMESHGUI, 0, this, 0); - mySMESHGUI->ResetState(); - reject(); - emit Close(); -} - -//================================================================================= -// function : onHelp() -// purpose : -//================================================================================= -void SMESHGUI_CreatePatternDlg::onHelp() -{ - LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); - if (app) - app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); - else { - SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), - QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), - QObject::tr("BUT_OK")); - } -} - -//======================================================================= -// function : loadFromObject() -// purpose : Load pattern from geom object corresponding to the mesh/submesh -//======================================================================= -bool SMESHGUI_CreatePatternDlg::loadFromObject (const bool theMess) -{ - try { - myIsLoaded = false; - - if (myPattern->_is_nil()) - myPattern = SMESH::GetPattern(); - - if (myMesh->_is_nil() && mySubMesh->_is_nil() || myGeomObj->_is_nil()) - return false; - - SMESH::SMESH_Mesh_ptr aMesh = mySubMesh->_is_nil() ? myMesh.in() : mySubMesh->GetFather(); - - myIsLoaded = myType == Type_2d - ? myPattern->LoadFromFace(aMesh, myGeomObj, myProjectChk->isChecked()) - : myPattern->LoadFrom3DBlock(aMesh, myGeomObj); - - if (!myIsLoaded && theMess) { - QString aMess; - SMESH::SMESH_Pattern::ErrorCode aCode = myPattern->GetErrorCode(); - - if (aCode == SMESH::SMESH_Pattern::ERR_LOAD_EMPTY_SUBMESH ) aMess = tr("ERR_LOAD_EMPTY_SUBMESH"); - else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_NARROW_FACE ) aMess = tr("ERR_LOADF_NARROW_FACE"); - else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_CLOSED_FACE ) aMess = tr("ERR_LOADF_CLOSED_FACE"); - else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_CANT_PROJECT ) aMess = tr("ERR_LOADF_CANT_PROJECT"); - else if (aCode == SMESH::SMESH_Pattern::ERR_LOADV_BAD_SHAPE ) aMess = tr("ERR_LOADV_BAD_SHAPE"); - else if (aCode == SMESH::SMESH_Pattern::ERR_LOADV_COMPUTE_PARAMS) aMess = tr("ERR_LOADV_COMPUTE_PARAMS"); - else aMess = tr("ERROR_OF_CREATION"); - - QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), - tr("SMESH_ERROR"), aMess, QMessageBox::Ok); - } - } catch (const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } - - return myIsLoaded; -} - -//======================================================================= -// function : onSelectionDone() -// purpose : SLOT called when selection changed -//======================================================================= -void SMESHGUI_CreatePatternDlg::onSelectionDone() -{ - try { - SALOME_ListIO aList; - mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type()); - if (aList.Extent() != 1) - return; - - // Get mesh or sub-mesh from selection - Handle(SALOME_InteractiveObject) anIO = aList.First(); - SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface(anIO); - SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface(anIO); - if (aMesh->_is_nil() && aSubMesh->_is_nil()) - return; - - // Get geom object corresponding to the mesh - _PTR(SObject) aSO; - if (!aMesh->_is_nil()) - aSO = SMESH::FindSObject(aMesh.in()); - else - aSO = SMESH::FindSObject(aSubMesh.in()); - - GEOM::GEOM_Object_var aGeomObj = SMESH::GetGeom(aSO); - if (aGeomObj->_is_nil()) - return; - - myGeomObj = aGeomObj; - - // init class fields - if (!aMesh->_is_nil()) { - myMesh = aMesh; - mySubMesh = SMESH::SMESH_subMesh::_nil(); - } else { - mySubMesh = aSubMesh; - myMesh = SMESH::SMESH_Mesh::_nil(); - } - - QString aName; - SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aName); - myMeshEdit->setText(aName); - - if (myType == Type_2d) { - loadFromObject(true); - displayPreview(); - } - } catch (...) { - myMesh = SMESH::SMESH_Mesh::_nil(); - mySubMesh = SMESH::SMESH_subMesh::_nil(); - myGeomObj = GEOM::GEOM_Object::_nil(); - erasePreview(); - } -} - -//======================================================================= -// function : onDeactivate() -// purpose : SLOT called when dialog must be deativated -//======================================================================= -void SMESHGUI_CreatePatternDlg::onDeactivate() -{ - disconnect(mySelectionMgr, 0, this, 0); - setEnabled(false); -} - -//======================================================================= -// function : enterEvent() -// purpose : Event filter -//======================================================================= -void SMESHGUI_CreatePatternDlg::enterEvent (QEvent*) -{ - // there is a stange problem that enterEvent() comes after onSave() - if ( isVisible () ) { - mySMESHGUI->EmitSignalDeactivateDialog(); - setEnabled(true); - activateSelection(); - connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); - } -} - -//================================================================================= -// function : closeEvent() -// purpose : Close dialog box -//================================================================================= -void SMESHGUI_CreatePatternDlg::closeEvent (QCloseEvent*) -{ - onClose(); -} - -//======================================================================= -// function : onSelBtnClicked() -// purpose : SLOT. Called when -> button clicked. -//======================================================================= -void SMESHGUI_CreatePatternDlg::onSelBtnClicked() -{ - onSelectionDone(); -} - -//================================================================ -// function : autoExtension() -// purpose : Append extension to the file name -//================================================================ -QString SMESHGUI_CreatePatternDlg::autoExtension (const QString& theFileName) const -{ - QString anExt = theFileName.section('.', -1); - return anExt != "smp" && anExt != "SMP" ? theFileName + ".smp" : theFileName; -} - -//======================================================================= -// function : displayPreview() -// purpose : Display preview -//======================================================================= -void SMESHGUI_CreatePatternDlg::displayPreview() -{ - // Redisplay preview in dialog - try { - if (!myIsLoaded) { - erasePreview(); - } else { - SMESH::point_array_var pnts = myPattern->GetPoints(); - SMESH::long_array_var keyPoints = myPattern->GetKeyPoints(); - SMESH::array_of_long_array_var elemPoints = myPattern->GetElementPoints(false); - - if (pnts->length() == 0 || - keyPoints->length() == 0 || - elemPoints->length() == 0) { - myIsLoaded = false; - erasePreview(); - return; - } - - PointVector aPoints (pnts->length()); - QValueVector aKeyPoints (keyPoints->length()); - ConnectivityVector anElemPoints (elemPoints->length()); - - for (int i = 0, n = pnts->length(); i < n; i++) - aPoints[ i ] = pnts[ i ]; - - for (int i2 = 0, n2 = keyPoints->length(); i2 < n2; i2++) - aKeyPoints[ i2 ] = keyPoints[ i2 ]; - - for (int i3 = 0, n3 = elemPoints->length(); i3 < n3; i3++) { - QValueVector aVec (elemPoints[ i3 ].length()); - for (int i4 = 0, n4 = elemPoints[ i3 ].length(); i4 < n4; i4++) - aVec[ i4 ] = elemPoints[ i3 ][ i4 ]; - - anElemPoints[ i3 ] = aVec; - } - - myPicture2d->SetPoints(aPoints, aKeyPoints, anElemPoints); - } - - return; - - } catch (const SALOME::SALOME_Exception& S_ex) { - SalomeApp_Tools::QtCatchCorbaException(S_ex); - } catch (...) { - } - erasePreview(); -} - -//======================================================================= -// function : erasePreview() -// purpose : Erase preview -//======================================================================= -void SMESHGUI_CreatePatternDlg::erasePreview() -{ - // Erase preview in 2D viewer - myPicture2d->SetPoints(PointVector(), QValueVector(), ConnectivityVector()); -} - -//======================================================================= -// function : activateSelection() -// purpose : Activate selection in accordance with current pattern type -//======================================================================= -void SMESHGUI_CreatePatternDlg::activateSelection() -{ - mySelectionMgr->clearFilters(); - //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) - aViewWindow->SetSelectionMode(ActorSelection); - - if (myType == Type_2d) { - mySelectionMgr->installFilter(new SMESH_NumberFilter - ("SMESH", TopAbs_SHAPE, -1, TopAbs_FACE)); - } else { - TColStd_MapOfInteger aTypes; - aTypes.Add(TopAbs_SHELL); - aTypes.Add(TopAbs_SOLID); - mySelectionMgr->installFilter(new SMESH_NumberFilter - ("SMESH", TopAbs_FACE, 6, aTypes, GEOM::GEOM_Object::_nil(), true)); - } -} - -//======================================================================= -// function : onTypeChanged() -// purpose : SLOT. Called when pattern type changed. -// Change dialog's look and feel -//======================================================================= -void SMESHGUI_CreatePatternDlg::onTypeChanged (int theType) -{ - if (myType == theType) - return; - - myType = theType; - - if (theType == Type_2d) - myPicture2d->show(); - else - myPicture2d->hide(); -} +// +// +// +// File : SMESHGUI_CreatePatternDlg.cxx +// Author : Sergey LITONIN +// Module : SMESH + +#include "SMESHGUI_CreatePatternDlg.h" + +#include "SMESHGUI.h" +#include "SMESHGUI_SpinBox.h" +#include "SMESHGUI_PatternWidget.h" +#include "SMESHGUI_Utils.h" +#include "SMESHGUI_VTKUtils.h" +#include "SMESHGUI_PatternUtils.h" +#include "SMESHGUI_GEOMGenUtils.h" + +#include "SMESH_NumberFilter.hxx" + +#include "SUIT_ResourceMgr.h" +#include "SUIT_Desktop.h" +#include "SUIT_FileDlg.h" +#include "SUIT_Session.h" +#include "SUIT_MessageBox.h" + +#include "SalomeApp_Study.h" +#include "LightApp_Application.h" +#include "LightApp_DataOwner.h" +#include "LightApp_SelectionMgr.h" +#include "SalomeApp_Tools.h" + +#include "SALOMEDS_SObject.hxx" + +#include "SALOME_ListIO.hxx" +#include "SVTK_ViewModel.h" +#include "SVTK_ViewWindow.h" +#include "SVTK_Selector.h" +#include "SVTK_Selection.h" + +// OCCT Includes +#include + +// QT Includes +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define SPACING 5 +#define MARGIN 10 + +/*! + * Class : SMESHGUI_CreatePatternDlg + * Description : Dialog to specify filters for VTK viewer + */ + +//======================================================================= +// function : SMESHGUI_CreatePatternDlg() +// purpose : Constructor +//======================================================================= +SMESHGUI_CreatePatternDlg::SMESHGUI_CreatePatternDlg( SMESHGUI* theModule, + const int theType, + const char* theName) + : QDialog( SMESH::GetDesktop( theModule ), theName, false, + WStyle_Customize | WStyle_NormalBorder | WStyle_Title | WStyle_SysMenu), + mySMESHGUI( theModule ), + mySelectionMgr( SMESH::GetSelectionMgr( theModule ) ) +{ + setCaption(tr("CAPTION")); + + QVBoxLayout* aDlgLay = new QVBoxLayout (this, MARGIN, SPACING); + + QFrame* aMainFrame = createMainFrame (this); + QFrame* aBtnFrame = createButtonFrame(this); + + aDlgLay->addWidget(aMainFrame); + aDlgLay->addWidget(aBtnFrame); + + aDlgLay->setStretchFactor(aMainFrame, 1); + + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + mySelector = aViewWindow->GetSelector(); + + myHelpFileName = "pattern_mapping.htm"; + + Init(theType); +} + +//======================================================================= +// function : createMainFrame() +// purpose : Create frame containing dialog's input fields +//======================================================================= +QFrame* SMESHGUI_CreatePatternDlg::createMainFrame (QWidget* theParent) +{ + QPixmap iconSlct (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); + QPixmap icon2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_2d"))); + QPixmap icon3d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_3d"))); + QPixmap iconSample2d (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_PATTERN_SAMPLE_2D"))); + + QGroupBox* aMainGrp = new QGroupBox(1, Qt::Horizontal, theParent); + aMainGrp->setFrameStyle(QFrame::NoFrame); + aMainGrp->setInsideMargin(0); + + // Pattern type group + + myTypeGrp = new QButtonGroup (1, Qt::Vertical, tr("PATTERN_TYPE"), aMainGrp); + mySwitch2d = new QRadioButton (myTypeGrp); + mySwitch3d = new QRadioButton (myTypeGrp); + mySwitch2d->setPixmap(icon2d); + mySwitch3d->setPixmap(icon3d); + myTypeGrp->insert(mySwitch2d, Type_2d); + myTypeGrp->insert(mySwitch3d, Type_3d); + + QGroupBox* aPatternGrp = new QGroupBox(1, Qt::Horizontal, tr("PATTERN"), aMainGrp); + + // Mesh and pattern name group + + QGroupBox* aMeshGrp = new QGroupBox(1, Qt::Vertical, aPatternGrp); + aMeshGrp->setFrameStyle(QFrame::NoFrame); + aMeshGrp->setInsideMargin(0); + + new QLabel(tr("MESH_OR_SUBMESH"), aMeshGrp); + + QPushButton* aSelBtn = new QPushButton(aMeshGrp); + aSelBtn->setPixmap(iconSlct); + myMeshEdit = new QLineEdit(aMeshGrp); + myMeshEdit->setReadOnly(true); + + QGroupBox* aPattGrp = new QGroupBox(1, Qt::Vertical, aPatternGrp); + aPattGrp->setFrameStyle(QFrame::NoFrame); + aPattGrp->setInsideMargin(0); + + new QLabel(tr("PATTERN_NAME"), aPattGrp); + myName = new QLineEdit(aPattGrp); + + // Picture 2d + + myPicture2d = new SMESHGUI_PatternWidget(aPatternGrp), + myPicture2d->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding)); + + // Project check box + + myProjectChk = new QCheckBox(tr("PROJECT"), aPatternGrp); + + // Connect signals and slots + + connect(myTypeGrp, SIGNAL(clicked(int) ), SLOT(onTypeChanged(int))); + connect(myProjectChk, SIGNAL(toggled(bool)), SLOT(onProject(bool) )); + connect(aSelBtn, SIGNAL(clicked() ), SLOT(onSelBtnClicked())); + + return aMainGrp; +} + +//======================================================================= +// function : createButtonFrame() +// purpose : Create frame containing buttons +//======================================================================= +QFrame* SMESHGUI_CreatePatternDlg::createButtonFrame (QWidget* theParent) +{ + QFrame* aFrame = new QFrame(theParent); + aFrame->setFrameStyle(QFrame::Box | QFrame::Sunken); + + myOkBtn = new QPushButton(tr("SMESH_BUT_OK" ), aFrame); + mySaveBtn = new QPushButton(tr("SAVE" ), aFrame); + myCloseBtn = new QPushButton(tr("SMESH_BUT_CANCEL"), aFrame); + myHelpBtn = new QPushButton(tr("SMESH_BUT_HELP"), aFrame); + + QSpacerItem* aSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); + + QHBoxLayout* aLay = new QHBoxLayout(aFrame, MARGIN, SPACING); + + aLay->addWidget(myOkBtn); + aLay->addWidget(mySaveBtn); + aLay->addItem(aSpacer); + aLay->addWidget(myCloseBtn); + aLay->addWidget(myHelpBtn); + + connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk())); + connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose())); + connect(mySaveBtn, SIGNAL(clicked()), SLOT(onSave())); + connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp())); + + return aFrame; +} + +//======================================================================= +// function : ~SMESHGUI_CreatePatternDlg() +// purpose : Destructor +//======================================================================= +SMESHGUI_CreatePatternDlg::~SMESHGUI_CreatePatternDlg() +{ + // no need to delete child widgets, Qt does it all for us +} + +//======================================================================= +// function : onProject() +// purpose : SLOT. Called when state of "Project nodes on ther face" +// checkbox is changed +//======================================================================= +void SMESHGUI_CreatePatternDlg::onProject (bool) +{ + loadFromObject(false); + displayPreview(); +} + +//======================================================================= +// function : Init() +// purpose : Init dialog fields, connect signals and slots, show dialog +//======================================================================= +void SMESHGUI_CreatePatternDlg::Init( const int theType ) +{ + myIsLoaded = false; + myType = -1; + myNbPoints = -1; + mySubMesh = SMESH::SMESH_subMesh::_nil(); + myMesh = SMESH::SMESH_Mesh::_nil(); + myGeomObj = GEOM::GEOM_Object::_nil(); + myPattern = SMESH::SMESH_Pattern::_nil(); + + erasePreview(); + + mySMESHGUI->SetActiveDialogBox((QDialog*)this); + + // selection and SMESHGUI + connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); + connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate())); + connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose())); + + mySwitch2d->setEnabled(theType == Type_2d); + mySwitch3d->setEnabled(theType == Type_3d); + + if (theType == Type_2d) + myProjectChk->show(); + else + myProjectChk->hide(); + + myTypeGrp->setButton(theType); + onTypeChanged(theType); + + myName->setText(getDefaultName()); + myMeshEdit->setText(""); + + setSizePolicy(QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding)); + qApp->processEvents(); + updateGeometry(); + myPicture2d->updateGeometry(); + adjustSize(); + resize(minimumSize()); + + activateSelection(); + onSelectionDone(); + + this->show(); +} + +//======================================================================= +// function : SetMesh() +// purpose : Set mesh to dialog +//======================================================================= +void SMESHGUI_CreatePatternDlg::SetMesh (SMESH::SMESH_Mesh_ptr thePtr) +{ + myMesh = SMESH::SMESH_Mesh::_duplicate(thePtr); + mySubMesh = SMESH::SMESH_subMesh::_nil(); + + bool isValidMesh = false; + if (!myMesh->_is_nil()) + { + _PTR(SObject) aSobj = SMESH::FindSObject(myMesh.in()); + //Handle(SALOME_InteractiveObject) anIObj = + // new SALOME_InteractiveObject(aSobj->GetID().c_str(), "SMESH"); + SUIT_DataOwnerPtr anIObj (new LightApp_DataOwner(aSobj->GetID().c_str())); + + isValidMesh = mySelectionMgr->isOk(anIObj); + } + + if (isValidMesh) { + _PTR(SObject) aSO = SMESH::FindSObject(myMesh.in()); + myMeshEdit->setText(aSO->GetName().c_str()); + myGeomObj = SMESH::GetGeom(aSO); + } else { + myMeshEdit->setText(""); + myGeomObj = GEOM::GEOM_Object::_nil(); + } + + if (myType == Type_2d) { + loadFromObject(false); + displayPreview(); + } +} + +//======================================================================= +// function : isValid() +// purpose : Verify validity of entry data +//======================================================================= +bool SMESHGUI_CreatePatternDlg::isValid() +{ + if (myGeomObj->_is_nil()) { + QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), + tr("SMESH_INSUFFICIENT_DATA"), + tr("SMESHGUI_INVALID_PARAMETERS"), + QMessageBox::Ok); + return false; + } + else + return true; +} + +//======================================================================= +// function : getDefaultName() +// purpose : Get default pattern name +//======================================================================= +QString SMESHGUI_CreatePatternDlg::getDefaultName() const +{ + return myType == Type_2d ? tr("DEFAULT_2D") : tr("DEFAULT_3D"); +} + +//======================================================================= +// function : onSave() +// purpose : SLOT called when "Save" button pressed. Build pattern and +// save it to disk +//======================================================================= +void SMESHGUI_CreatePatternDlg::onSave() +{ + try { + if (!isValid()) + return; + + if (!myIsLoaded) + loadFromObject(true); + + // Load pattern from object + if (!myIsLoaded) + return; + + /////////////////////////////////////////////////////// + SUIT_FileDlg* aDlg = new SUIT_FileDlg (this, false); + aDlg->setCaption(tr("SAVE_PATTERN")); + aDlg->setMode(QFileDialog::AnyFile); + aDlg->setFilters(tr("PATTERN_FILT")); + if (myName->text() != "") + aDlg->setSelection(myName->text()); + + if (aDlg->exec() != Accepted) + return; + + QString fName = aDlg->selectedFile(); + if (fName.isEmpty()) + return; + + if (QFileInfo(fName).extension().isEmpty()) + fName = autoExtension(fName); + + fName = QDir::convertSeparators(fName); + + QString aData (myPattern->GetString()); + long aLen = aData.length(); + + QFile aFile (fName); + aFile.open(IO_WriteOnly); + long aWritten = aFile.writeBlock(aData, aLen); + aFile.close(); + + if (aWritten != aLen) { + QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), tr("SMESH_ERROR"), + tr("ERROR_OF_SAVING"), QMessageBox::Ok); + } else { + //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + disconnect(mySelectionMgr, 0, this, 0); + disconnect(mySMESHGUI, 0, this, 0); + mySMESHGUI->ResetState(); + accept(); + emit NewPattern(); + } + } catch (const SALOME::SALOME_Exception& S_ex) { + SalomeApp_Tools::QtCatchCorbaException(S_ex); + } catch (...) { + } +} + +//======================================================================= +// function : GetPatternName() +// purpose : Get name of pattern +//======================================================================= +QString SMESHGUI_CreatePatternDlg::GetPatternName() const +{ + return myName->text(); +} + +//======================================================================= +// function : GetPattern() +// purpose : Get result pattern +//======================================================================= +SMESH::SMESH_Pattern_ptr SMESHGUI_CreatePatternDlg::GetPattern() +{ + return myPattern.in(); +} + +//======================================================================= +// function : onOk() +// purpose : SLOT called when "Ok" button pressed. +//======================================================================= +void SMESHGUI_CreatePatternDlg::onOk() +{ + try { + if (!isValid()) + return; + + if (!myIsLoaded) + loadFromObject(true); + + // Load pattern from object + if (!myIsLoaded) { + return; + } else { + //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + disconnect(mySelectionMgr, 0, this, 0); + disconnect(mySMESHGUI, 0, this, 0); + mySMESHGUI->ResetState(); + accept(); + emit NewPattern(); + } + } catch (const SALOME::SALOME_Exception& S_ex) { + SalomeApp_Tools::QtCatchCorbaException(S_ex); + } catch (...) { + } +} + +//======================================================================= +// function : onClose() +// purpose : SLOT called when "Close" button pressed. Close dialog +//======================================================================= +void SMESHGUI_CreatePatternDlg::onClose() +{ + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + disconnect(mySelectionMgr, 0, this, 0); + disconnect(mySMESHGUI, 0, this, 0); + mySMESHGUI->ResetState(); + reject(); + emit Close(); +} + +//================================================================================= +// function : onHelp() +// purpose : +//================================================================================= +void SMESHGUI_CreatePatternDlg::onHelp() +{ + LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication()); + if (app) + app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); + else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif + SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), + QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), + QObject::tr("BUT_OK")); + } +} + +//======================================================================= +// function : loadFromObject() +// purpose : Load pattern from geom object corresponding to the mesh/submesh +//======================================================================= +bool SMESHGUI_CreatePatternDlg::loadFromObject (const bool theMess) +{ + try { + myIsLoaded = false; + + if (myPattern->_is_nil()) + myPattern = SMESH::GetPattern(); + + if (myMesh->_is_nil() && mySubMesh->_is_nil() || myGeomObj->_is_nil()) + return false; + + SMESH::SMESH_Mesh_ptr aMesh = mySubMesh->_is_nil() ? myMesh.in() : mySubMesh->GetFather(); + + myIsLoaded = myType == Type_2d + ? myPattern->LoadFromFace(aMesh, myGeomObj, myProjectChk->isChecked()) + : myPattern->LoadFrom3DBlock(aMesh, myGeomObj); + + if (!myIsLoaded && theMess) { + QString aMess; + SMESH::SMESH_Pattern::ErrorCode aCode = myPattern->GetErrorCode(); + + if (aCode == SMESH::SMESH_Pattern::ERR_LOAD_EMPTY_SUBMESH ) aMess = tr("ERR_LOAD_EMPTY_SUBMESH"); + else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_NARROW_FACE ) aMess = tr("ERR_LOADF_NARROW_FACE"); + else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_CLOSED_FACE ) aMess = tr("ERR_LOADF_CLOSED_FACE"); + else if (aCode == SMESH::SMESH_Pattern::ERR_LOADF_CANT_PROJECT ) aMess = tr("ERR_LOADF_CANT_PROJECT"); + else if (aCode == SMESH::SMESH_Pattern::ERR_LOADV_BAD_SHAPE ) aMess = tr("ERR_LOADV_BAD_SHAPE"); + else if (aCode == SMESH::SMESH_Pattern::ERR_LOADV_COMPUTE_PARAMS) aMess = tr("ERR_LOADV_COMPUTE_PARAMS"); + else aMess = tr("ERROR_OF_CREATION"); + + QMessageBox::information(SMESH::GetDesktop( mySMESHGUI ), + tr("SMESH_ERROR"), aMess, QMessageBox::Ok); + } + } catch (const SALOME::SALOME_Exception& S_ex) { + SalomeApp_Tools::QtCatchCorbaException(S_ex); + } + + return myIsLoaded; +} + +//======================================================================= +// function : onSelectionDone() +// purpose : SLOT called when selection changed +//======================================================================= +void SMESHGUI_CreatePatternDlg::onSelectionDone() +{ + try { + SALOME_ListIO aList; + mySelectionMgr->selectedObjects(aList, SVTK_Viewer::Type()); + if (aList.Extent() != 1) + return; + + // Get mesh or sub-mesh from selection + Handle(SALOME_InteractiveObject) anIO = aList.First(); + SMESH::SMESH_Mesh_var aMesh = SMESH::IObjectToInterface(anIO); + SMESH::SMESH_subMesh_var aSubMesh = SMESH::IObjectToInterface(anIO); + if (aMesh->_is_nil() && aSubMesh->_is_nil()) + return; + + // Get geom object corresponding to the mesh + _PTR(SObject) aSO; + if (!aMesh->_is_nil()) + aSO = SMESH::FindSObject(aMesh.in()); + else + aSO = SMESH::FindSObject(aSubMesh.in()); + + GEOM::GEOM_Object_var aGeomObj = SMESH::GetGeom(aSO); + if (aGeomObj->_is_nil()) + return; + + myGeomObj = aGeomObj; + + // init class fields + if (!aMesh->_is_nil()) { + myMesh = aMesh; + mySubMesh = SMESH::SMESH_subMesh::_nil(); + } else { + mySubMesh = aSubMesh; + myMesh = SMESH::SMESH_Mesh::_nil(); + } + + QString aName; + SMESH::GetNameOfSelectedIObjects(mySelectionMgr, aName); + myMeshEdit->setText(aName); + + if (myType == Type_2d) { + loadFromObject(true); + displayPreview(); + } + } catch (...) { + myMesh = SMESH::SMESH_Mesh::_nil(); + mySubMesh = SMESH::SMESH_subMesh::_nil(); + myGeomObj = GEOM::GEOM_Object::_nil(); + erasePreview(); + } +} + +//======================================================================= +// function : onDeactivate() +// purpose : SLOT called when dialog must be deativated +//======================================================================= +void SMESHGUI_CreatePatternDlg::onDeactivate() +{ + disconnect(mySelectionMgr, 0, this, 0); + setEnabled(false); +} + +//======================================================================= +// function : enterEvent() +// purpose : Event filter +//======================================================================= +void SMESHGUI_CreatePatternDlg::enterEvent (QEvent*) +{ + // there is a stange problem that enterEvent() comes after onSave() + if ( isVisible () ) { + mySMESHGUI->EmitSignalDeactivateDialog(); + setEnabled(true); + activateSelection(); + connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); + } +} + +//================================================================================= +// function : closeEvent() +// purpose : Close dialog box +//================================================================================= +void SMESHGUI_CreatePatternDlg::closeEvent (QCloseEvent*) +{ + onClose(); +} + +//======================================================================= +// function : onSelBtnClicked() +// purpose : SLOT. Called when -> button clicked. +//======================================================================= +void SMESHGUI_CreatePatternDlg::onSelBtnClicked() +{ + onSelectionDone(); +} + +//================================================================ +// function : autoExtension() +// purpose : Append extension to the file name +//================================================================ +QString SMESHGUI_CreatePatternDlg::autoExtension (const QString& theFileName) const +{ + QString anExt = theFileName.section('.', -1); + return anExt != "smp" && anExt != "SMP" ? theFileName + ".smp" : theFileName; +} + +//======================================================================= +// function : displayPreview() +// purpose : Display preview +//======================================================================= +void SMESHGUI_CreatePatternDlg::displayPreview() +{ + // Redisplay preview in dialog + try { + if (!myIsLoaded) { + erasePreview(); + } else { + SMESH::point_array_var pnts = myPattern->GetPoints(); + SMESH::long_array_var keyPoints = myPattern->GetKeyPoints(); + SMESH::array_of_long_array_var elemPoints = myPattern->GetElementPoints(false); + + if (pnts->length() == 0 || + keyPoints->length() == 0 || + elemPoints->length() == 0) { + myIsLoaded = false; + erasePreview(); + return; + } + + PointVector aPoints (pnts->length()); + QValueVector aKeyPoints (keyPoints->length()); + ConnectivityVector anElemPoints (elemPoints->length()); + + for (int i = 0, n = pnts->length(); i < n; i++) + aPoints[ i ] = pnts[ i ]; + + for (int i2 = 0, n2 = keyPoints->length(); i2 < n2; i2++) + aKeyPoints[ i2 ] = keyPoints[ i2 ]; + + for (int i3 = 0, n3 = elemPoints->length(); i3 < n3; i3++) { + QValueVector aVec (elemPoints[ i3 ].length()); + for (int i4 = 0, n4 = elemPoints[ i3 ].length(); i4 < n4; i4++) + aVec[ i4 ] = elemPoints[ i3 ][ i4 ]; + + anElemPoints[ i3 ] = aVec; + } + + myPicture2d->SetPoints(aPoints, aKeyPoints, anElemPoints); + } + + return; + + } catch (const SALOME::SALOME_Exception& S_ex) { + SalomeApp_Tools::QtCatchCorbaException(S_ex); + } catch (...) { + } + erasePreview(); +} + +//======================================================================= +// function : erasePreview() +// purpose : Erase preview +//======================================================================= +void SMESHGUI_CreatePatternDlg::erasePreview() +{ + // Erase preview in 2D viewer + myPicture2d->SetPoints(PointVector(), QValueVector(), ConnectivityVector()); +} + +//======================================================================= +// function : activateSelection() +// purpose : Activate selection in accordance with current pattern type +//======================================================================= +void SMESHGUI_CreatePatternDlg::activateSelection() +{ + mySelectionMgr->clearFilters(); + //SUIT_Application::getDesktop()->setSelectionModes(ActorSelection); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + + if (myType == Type_2d) { + mySelectionMgr->installFilter(new SMESH_NumberFilter + ("SMESH", TopAbs_SHAPE, -1, TopAbs_FACE)); + } else { + TColStd_MapOfInteger aTypes; + aTypes.Add(TopAbs_SHELL); + aTypes.Add(TopAbs_SOLID); + mySelectionMgr->installFilter(new SMESH_NumberFilter + ("SMESH", TopAbs_FACE, 6, aTypes, GEOM::GEOM_Object::_nil(), true)); + } +} + +//======================================================================= +// function : onTypeChanged() +// purpose : SLOT. Called when pattern type changed. +// Change dialog's look and feel +//======================================================================= +void SMESHGUI_CreatePatternDlg::onTypeChanged (int theType) +{ + if (myType == theType) + return; + + myType = theType; + + if (theType == Type_2d) + myPicture2d->show(); + else + myPicture2d->hide(); +} //================================================================================= // function : keyPressEvent() diff --git a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h index 314d96a0a..130ad7e0d 100755 --- a/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h +++ b/src/SMESHGUI/SMESHGUI_CreatePatternDlg.h @@ -27,6 +27,8 @@ #ifndef SMESHGUI_CreatePatternDlg_H #define SMESHGUI_CreatePatternDlg_H +#include "SMESH_SMESHGUI.hxx" + #include // IDL Headers @@ -57,7 +59,7 @@ class SMESHGUI; * Description : Dialog to specify filters for VTK viewer */ -class SMESHGUI_CreatePatternDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_CreatePatternDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx index 9d570cde4..c4600fcc4 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.cxx @@ -581,9 +581,15 @@ void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h index 49859d92a..4cba1e9a0 100644 --- a/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h +++ b/src/SMESHGUI/SMESHGUI_CreatePolyhedralVolumeDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_CREATEPOLYHEDRAL_H #define DIALOGBOX_CREATEPOLYHEDRAL_H +#include "SMESH_SMESHGUI.hxx" + // QT Includes #include @@ -59,7 +61,7 @@ namespace SMESH{ // class : SMESHGUI_CreatePolyhedralVolumeDlg // purpose : //================================================================================= -class SMESHGUI_CreatePolyhedralVolumeDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_CreatePolyhedralVolumeDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx index ecbf3234e..f298ef6c2 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.cxx @@ -259,9 +259,15 @@ void SMESHGUI_DeleteGroupDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h index 789c888ed..c972ce75d 100644 --- a/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h +++ b/src/SMESHGUI/SMESHGUI_DeleteGroupDlg.h @@ -27,6 +27,8 @@ #ifndef SMESHGUI_DELETEGROUPDLG_H #define SMESHGUI_DELETEGROUPDLG_H +#include "SMESH_SMESHGUI.hxx" + #include #include @@ -47,7 +49,7 @@ class LightApp_SelectionMgr; * Description : Delete groups and their contents */ -class SMESHGUI_DeleteGroupDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_DeleteGroupDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_Dialog.h b/src/SMESHGUI/SMESHGUI_Dialog.h index 211860a54..676b601a4 100644 --- a/src/SMESHGUI/SMESHGUI_Dialog.h +++ b/src/SMESHGUI/SMESHGUI_Dialog.h @@ -30,6 +30,8 @@ #ifndef SMESHGUI_DIALOG_H #define SMESHGUI_DIALOG_H +#include "SMESH_SMESHGUI.hxx" + #include class SUIT_Desktop; @@ -39,7 +41,7 @@ class SUIT_ResourceMgr; // class : SMESHGUI_Dialog // purpose : Base dialog for all SMESHGUI dialogs //================================================================================= -class SMESHGUI_Dialog : public LightApp_Dialog +class SMESHGUI_EXPORT SMESHGUI_Dialog : public LightApp_Dialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_Displayer.h b/src/SMESHGUI/SMESHGUI_Displayer.h index 815c5e1c4..dc2df5f8b 100644 --- a/src/SMESHGUI/SMESHGUI_Displayer.h +++ b/src/SMESHGUI/SMESHGUI_Displayer.h @@ -29,12 +29,14 @@ #ifndef SMESHGUI_DISPLAYER_HEADER #define SMESHGUI_DISPLAYER_HEADER +#include "SMESH_SMESHGUI.hxx" + #include class SalomeApp_Application; class SalomeApp_Study; -class SMESHGUI_Displayer : public LightApp_Displayer +class SMESHGUI_EXPORT SMESHGUI_Displayer : public LightApp_Displayer { public: SMESHGUI_Displayer( SalomeApp_Application* ); diff --git a/src/SMESHGUI/SMESHGUI_EditHypothesesDlg.h b/src/SMESHGUI/SMESHGUI_EditHypothesesDlg.h new file mode 100644 index 000000000..7385dcb9f --- /dev/null +++ b/src/SMESHGUI/SMESHGUI_EditHypothesesDlg.h @@ -0,0 +1,153 @@ +// SMESH SMESHGUI : GUI for SMESH component +// +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESHGUI_EditHypothesesDlg.h +// Author : Nicolas REJNERI +// Module : SMESH +// $Header$ + +#ifndef DIALOGBOX_EDIT_HYPOTHESES_H +#define DIALOGBOX_EDIT_HYPOTHESES_H + +#include "SMESH_SMESHGUI.hxx" + +//#include "SMESH_TypeFilter.hxx" +#include "SUIT_SelectionFilter.h" +#include "LightApp_SelectionMgr.h" + +// QT Includes +#include + +// IDL Headers +#include +#include CORBA_SERVER_HEADER(GEOM_Gen) +#include CORBA_SERVER_HEADER(SMESH_Mesh) + +#include +#include + +class QGroupBox; +class QLabel; +class QLineEdit; +class QPushButton; +class QListBox; +class QListBoxItem; +class SMESHGUI; + +typedef map MapIOR; + +//================================================================================= +// class : SMESHGUI_EditHypothesesDlg +// purpose : +//================================================================================= +class SMESHGUI_EXPORT SMESHGUI_EditHypothesesDlg : public QDialog +{ + Q_OBJECT + +public: + SMESHGUI_EditHypothesesDlg (SMESHGUI*, + const char* name = 0, + bool modal = FALSE, + WFlags fl = 0); + ~SMESHGUI_EditHypothesesDlg(); + +protected: + virtual void closeEvent (QCloseEvent*); + virtual void enterEvent (QEvent*); + +private: + void Init(); + + void InitHypDefinition(); + void InitAlgoDefinition(); + void InitHypAssignation(); + void InitAlgoAssignation(); + + void InitGeom(); + + void UpdateControlState(); + + bool StoreMesh(); + bool StoreSubMesh(); + + bool IsOld(QListBoxItem* hypItem); + +private: + SMESHGUI* mySMESHGUI; + LightApp_SelectionMgr* mySelectionMgr; + + GEOM::GEOM_Object_var myGeomShape; + QLineEdit* myEditCurrentArgument; + + SMESH::SMESH_Mesh_var myMesh; + SMESH::SMESH_subMesh_var mySubMesh; + + //Handle(SALOME_TypeFilter) myGeomFilter; + //Handle(SMESH_TypeFilter) myMeshOrSubMeshFilter; + SUIT_SelectionFilter* myGeomFilter; + SUIT_SelectionFilter* myMeshOrSubMeshFilter; + + MapIOR myMapOldHypos, myMapOldAlgos; + int myNbModification; + + bool myImportedMesh; + + QGroupBox* GroupButtons; + QPushButton* buttonOk; + QPushButton* buttonApply; + QPushButton* buttonCancel; + + QGroupBox* GroupC1; + QLabel* TextLabelC1A1; + QPushButton* SelectButtonC1A1; + QLineEdit* LineEditC1A1; + QLabel* TextLabelC1A2; + QPushButton* SelectButtonC1A2; + QLineEdit* LineEditC1A2; + + QGroupBox* GroupHypotheses; + QLabel* TextHypDefinition; + QListBox* ListHypDefinition; + QLabel* TextHypAssignation; + QListBox* ListHypAssignation; + + QGroupBox* GroupAlgorithms; + QLabel* TextAlgoDefinition; + QListBox* ListAlgoDefinition; + QLabel* TextAlgoAssignation; + QListBox* ListAlgoAssignation; + +private slots: + void ClickOnOk(); + bool ClickOnApply(); + void ClickOnCancel(); + void SetEditCurrentArgument(); + void SelectionIntoArgument(); + void DeactivateActiveDialog(); + void ActivateThisDialog(); + + void removeItem(QListBoxItem*); + void addItem(QListBoxItem*); +}; + +#endif // DIALOGBOX_EDIT_HYPOTHESES_H diff --git a/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx index 19b29d15e..d19484cf5 100644 --- a/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_EditMeshDlg.cxx @@ -262,9 +262,15 @@ void SMESHGUI_EditMeshDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_EditMeshDlg.h b/src/SMESHGUI/SMESHGUI_EditMeshDlg.h index 3c5b918ea..71a11b743 100644 --- a/src/SMESHGUI/SMESHGUI_EditMeshDlg.h +++ b/src/SMESHGUI/SMESHGUI_EditMeshDlg.h @@ -21,6 +21,8 @@ #ifndef DIALOGBOX_GETMESH_H #define DIALOGBOX_GETMESH_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" #include "SUIT_SelectionFilter.h" @@ -46,7 +48,7 @@ class SMESHGUI; // class : SMESHGUI_EditMeshDlg // purpose : //================================================================================= -class SMESHGUI_EditMeshDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_EditMeshDlg : public QDialog { Q_OBJECT; diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx index 22236aad8..2ee720b87 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.cxx @@ -674,9 +674,15 @@ void SMESHGUI_ExtrusionAlongPathDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h index f52f8cab5..d29f6f7f7 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h +++ b/src/SMESHGUI/SMESHGUI_ExtrusionAlongPathDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_EXTRUSION_PATH_H #define DIALOGBOX_EXTRUSION_PATH_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" #include "SUIT_SelectionFilter.h" @@ -60,7 +62,7 @@ class SVTK_Selector; // class : SMESHGUI_ExtrusionAlongPathDlg // purpose : //================================================================================= -class SMESHGUI_ExtrusionAlongPathDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_ExtrusionAlongPathDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx index 50c439f30..5bf8c5558 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.cxx @@ -458,9 +458,15 @@ void SMESHGUI_ExtrusionDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h index 841565f44..d1fe0f2b7 100644 --- a/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h +++ b/src/SMESHGUI/SMESHGUI_ExtrusionDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_EXTRUSION_H #define DIALOGBOX_EXTRUSION_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" #include "SUIT_SelectionFilter.h" @@ -59,7 +61,7 @@ class SVTK_Selector; // class : SMESHGUI_ExtrusionDlg // purpose : //================================================================================= -class SMESHGUI_ExtrusionDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_ExtrusionDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_Filter.h b/src/SMESHGUI/SMESHGUI_Filter.h index c78cfe5ee..4f912cdb8 100755 --- a/src/SMESHGUI/SMESHGUI_Filter.h +++ b/src/SMESHGUI/SMESHGUI_Filter.h @@ -28,6 +28,8 @@ #ifndef SMESHGUI_Filter_HeaderFile #define SMESHGUI_Filter_HeaderFile +#include "SMESH_SMESHGUI.hxx" + #include "VTKViewer_Filter.h" #include diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx index b4b23b381..9fdc3f719 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.cxx @@ -963,7 +963,7 @@ void SMESHGUI_FilterTable::onRemoveBtn() if (aTable->isRowSelected(i)) { aRows.resize(aRows.size() + 1); - aRows[ aRows.size() - 1 ] = i; + aRows[ (int)(aRows.size() - 1) ] = i; removeAdditionalWidget(aTable, i); } } @@ -1958,9 +1958,15 @@ void SMESHGUI_FilterDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_FilterDlg.h b/src/SMESHGUI/SMESHGUI_FilterDlg.h index 5e9e33984..2cc71d94a 100755 --- a/src/SMESHGUI/SMESHGUI_FilterDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterDlg.h @@ -29,6 +29,8 @@ #ifndef SMESHGUI_FilterDlg_H #define SMESHGUI_FilterDlg_H +#include "SMESH_SMESHGUI.hxx" + #include #include #include @@ -70,7 +72,7 @@ class SVTK_ViewWindow; * - Buttons for editing table */ -class SMESHGUI_FilterTable : public QFrame +class SMESHGUI_EXPORT SMESHGUI_FilterTable : public QFrame { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx index 08447f424..f284afb39 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.cxx @@ -478,9 +478,15 @@ void SMESHGUI_FilterLibraryDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h index fd078d356..cbc8111de 100644 --- a/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h +++ b/src/SMESHGUI/SMESHGUI_FilterLibraryDlg.h @@ -29,6 +29,8 @@ #ifndef SMESHGUI_FilterLibraryDlg_H #define SMESHGUI_FilterLibraryDlg_H +#include "SMESH_SMESHGUI.hxx" + #include #include @@ -48,7 +50,7 @@ class QGroupBox; Description : Dialog to specify filters for VTK viewer */ -class SMESHGUI_FilterLibraryDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_FilterLibraryDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_FilterUtils.h b/src/SMESHGUI/SMESHGUI_FilterUtils.h index aec43960c..22d65870e 100644 --- a/src/SMESHGUI/SMESHGUI_FilterUtils.h +++ b/src/SMESHGUI/SMESHGUI_FilterUtils.h @@ -20,13 +20,15 @@ #ifndef SMESHGUI_FilterUtils_HeaderFile #define SMESHGUI_FilterUtils_HeaderFile +#include "SMESH_SMESHGUI.hxx" + #include "SALOMEconfig.h" #include CORBA_SERVER_HEADER(SMESH_Filter) namespace SMESH{ - SMESH::FilterManager_var& GetFilterManager(); + SMESHGUI_EXPORT SMESH::FilterManager_var& GetFilterManager(); } diff --git a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h index 76ff62407..9e0762d13 100644 --- a/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h +++ b/src/SMESHGUI/SMESHGUI_GEOMGenUtils.h @@ -20,6 +20,8 @@ #ifndef SMESHGUI_GEOMGenUtils_HeaderFile #define SMESHGUI_GEOMGenUtils_HeaderFile +#include "SMESH_SMESHGUI.hxx" + #include "SALOMEconfig.h" #include CORBA_SERVER_HEADER(GEOM_Gen) @@ -29,11 +31,11 @@ class SALOMEDSClient_SObject; namespace SMESH { - GEOM::GEOM_Gen_var GetGEOMGen(); + SMESHGUI_EXPORT GEOM::GEOM_Gen_var GetGEOMGen(); - GEOM::GEOM_Object_var GetShapeOnMeshOrSubMesh (_PTR(SObject) theSObject); + SMESHGUI_EXPORT GEOM::GEOM_Object_var GetShapeOnMeshOrSubMesh (_PTR(SObject) theSObject); - GEOM::GEOM_Object_ptr GetGeom (_PTR(SObject) theSO); + SMESHGUI_EXPORT GEOM::GEOM_Object_ptr GetGeom (_PTR(SObject) theSO); } #endif diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx index 5c473f329..c43cf1335 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.cxx @@ -28,6 +28,7 @@ #include "SMESHGUI_GroupDlg.h" #include "SMESHGUI_FilterDlg.h" +#include "SMESHGUI_ShapeByMeshDlg.h" #include "SMESHGUI.h" #include "SMESHGUI_Utils.h" @@ -39,7 +40,9 @@ #include "SMESH_TypeFilter.hxx" #include "SMESH_Actor.h" + #include "GEOMBase.h" +#include "GEOM_SelectionFilter.h" #include "SUIT_Desktop.h" #include "SUIT_ResourceMgr.h" @@ -47,6 +50,8 @@ #include "SUIT_MessageBox.h" #include "SalomeApp_Tools.h" +#include "SalomeApp_Application.h" +#include "SalomeApp_Study.h" #include "LightApp_Application.h" #include "SALOMEDSClient_Study.hxx" #include "SALOME_ListIO.hxx" @@ -62,11 +67,13 @@ // QT Includes #include +#include #include #include #include #include #include +#include #include #include #include @@ -147,6 +154,11 @@ void SMESHGUI_GroupDlg::initDialog(bool create) myCreate = create; myCurrentLineEdit = 0; + myShapeByMeshOp = 0; + myGeomPopup = 0; + myGeomObjects = new GEOM::ListOfGO(); + myGeomObjects->length(0); + QPixmap image0 (SMESH::GetResourceMgr( mySMESHGUI )->loadPixmap("SMESH", tr("ICON_SELECT"))); if (create) { @@ -278,19 +290,19 @@ void SMESHGUI_GroupDlg::initDialog(bool create) /***************************************************************/ QLabel* geomObject = new QLabel(wg2, "geometry object label"); geomObject->setText(tr("SMESH_OBJECT_GEOM")); - myGeomGroupBtn = new QPushButton(wg2, "geometry group button"); - myGeomGroupBtn->setText(""); - myGeomGroupBtn->setPixmap(image0); + myGeomGroupBtn = new QToolButton(wg2, "geometry group button"); + myGeomGroupBtn->setIconSet( QIconSet(image0) ); + myGeomGroupBtn->setToggleButton(true); myGeomGroupLine = new QLineEdit(wg2, "geometry group line"); myGeomGroupLine->setReadOnly(true); //VSR ??? onSelectGeomGroup(false); - + if (!create) { myGeomGroupBtn->setEnabled(false); myGeomGroupLine->setEnabled(false); } - + /***************************************************************/ QGridLayout* wg2Layout = new QGridLayout( wg2, 2, 3, 0, 6 ); wg2Layout->addWidget(geomObject, 0, 0); @@ -378,7 +390,7 @@ void SMESHGUI_GroupDlg::initDialog(bool create) connect(mySelectGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectGroup(bool))); connect(mySubMeshBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); connect(myGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); - connect(myGeomGroupBtn, SIGNAL(clicked()), this, SLOT(setCurrentSelection())); + connect(myGeomGroupBtn, SIGNAL(toggled(bool)), this, SLOT(onGeomSelectionButton(bool))); connect(mySelectColorGroup, SIGNAL(toggled(bool)), this, SLOT(onSelectColorGroup(bool))); connect(myColorSpinBox, SIGNAL(valueChanged(const QString&)), this, SLOT(onNbColorsChanged(const QString&))); @@ -395,7 +407,9 @@ void SMESHGUI_GroupDlg::initDialog(bool create) myMeshFilter = new SMESH_TypeFilter(MESH); mySubMeshFilter = new SMESH_TypeFilter(SUBMESH); myGroupFilter = new SMESH_TypeFilter(GROUP); - + SalomeApp_Study* aStudy = dynamic_cast( mySMESHGUI->application()->activeStudy() ); + myGeomFilter = new GEOM_SelectionFilter( aStudy, true ); + connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate())); connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(onClose())); connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged())); @@ -482,13 +496,13 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup) if ( !myGroup->_is_nil() ) { - myGrpTypeGroup->setButton(0); - onGrpTypeChanged(0); - myActor = SMESH::FindActorByObject(myMesh); if ( !myActor ) myActor = SMESH::FindActorByObject(myGroup); SMESH::SetPickable(myActor); + + myGrpTypeGroup->setButton(0); + onGrpTypeChanged(0); myCurrentLineEdit = 0; myElements->clear(); @@ -512,13 +526,13 @@ void SMESHGUI_GroupDlg::init (SMESH::SMESH_GroupBase_ptr theGroup) if ( !myGroupOnGeom->_is_nil() ) { - myGrpTypeGroup->setButton(1); - onGrpTypeChanged(1); - myActor = SMESH::FindActorByObject(myMesh); if ( !myActor ) myActor = SMESH::FindActorByObject(myGroup); SMESH::SetPickable(myActor); + + myGrpTypeGroup->setButton(1); + onGrpTypeChanged(1); QString aShapeName(""); _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); @@ -546,7 +560,7 @@ void SMESHGUI_GroupDlg::updateButtons() else if (myGrpTypeId == 1) { bool isEditMode = !CORBA::is_nil( myGroupOnGeom ); - enable = !myName->text().stripWhiteSpace().isEmpty() && (!CORBA::is_nil( myGeomGroup ) || isEditMode); + enable = !myName->text().stripWhiteSpace().isEmpty() && (myGeomObjects->length() > 0 || isEditMode); } QPushButton* aBtn; aBtn = (QPushButton*) child("ok", "QPushButton"); @@ -609,19 +623,21 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode) // PAL7314 if (myMesh->_is_nil()) return; - if (mySelectionMode != theMode) { // [PAL10408] mySelectionMgr->clearSelected(); mySelectionMgr->clearFilters(); - SMESH::SetPointRepresentation(false); + if (myActor) + myActor->SetPointRepresentation(false); + else + SMESH::SetPointRepresentation(false); if (theMode < 4) { switch (theMode) { case 0: if (myActor) - myActor->SetPointRepresentation(true); - else - SMESH::SetPointRepresentation(true); - if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + myActor->SetPointRepresentation(true); + else + SMESH::SetPointRepresentation(true); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(NodeSelection); break; case 1: @@ -643,11 +659,14 @@ void SMESHGUI_GroupDlg::setSelectionMode (int theMode) mySelectionMgr->installFilter(myGroupFilter); else if (theMode == 6) mySelectionMgr->installFilter(myMeshFilter); + else if (theMode == 7) + mySelectionMgr->installFilter(myGeomFilter); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) aViewWindow->SetSelectionMode(ActorSelection); } mySelectionMode = theMode; - } + } } //================================================================================= @@ -742,7 +761,7 @@ bool SMESHGUI_GroupDlg::onApply() return true; } else if (myGrpTypeId == 1 && !myName->text().stripWhiteSpace().isEmpty() && - (!CORBA::is_nil(myGeomGroup) || !CORBA::is_nil(myGroupOnGeom))) + (myGeomObjects->length() > 0 || !CORBA::is_nil(myGroupOnGeom))) { if (myGroupOnGeom->_is_nil()) { SMESH::ElementType aType = SMESH::ALL; @@ -757,7 +776,55 @@ bool SMESHGUI_GroupDlg::onApply() GEOM::GEOM_IGroupOperations_var aGroupOp = SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId()); - myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, myName->text(),myGeomGroup); + if (myGeomObjects->length() == 1) + myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, myName->text(),myGeomObjects[0]); + else + { + SMESH::SMESH_Gen_var aSMESHGen = SMESHGUI::GetSMESHGen(); + if ( aSMESHGen->_is_nil() ) + return false; + + // create a geometry group + GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen(); + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + + if (geomGen->_is_nil() || !aStudy) + return false; + + GEOM::GEOM_IGroupOperations_var op = + geomGen->GetIGroupOperations(aStudy->StudyId()); + if (op->_is_nil()) + return false; + + // check and add all selected GEOM objects: they must be + // a sub-shapes of the main GEOM and must be of one type + TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE; + for ( int i =0; i < myGeomObjects->length(); i++) + { + TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)myGeomObjects[i]->GetShapeType(); + if (i == 0) + aGroupType = aSubShapeType; + else if (aSubShapeType != aGroupType) + { + aGroupType = TopAbs_SHAPE; + break; + } + } + + GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh(); + GEOM::GEOM_Object_var aGroupVar = op->CreateGroup(aMeshShape, aGroupType); + op->UnionList(aGroupVar, myGeomObjects); + + if (op->IsDone()) { + // publish the GEOM group in study + QString aNewGeomGroupName ("Auto_group_for_"); + aNewGeomGroupName += myName->text(); + SALOMEDS::SObject_var aNewGroupSO = + geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGroupVar, aNewGeomGroupName, aMeshShape); + } + + myGroupOnGeom = myMesh->CreateGroupFromGEOM(aType, myName->text(), aGroupVar); + } int aColorNumber = myColorSpinBox->value(); myGroupOnGeom->SetColorNumber(aColorNumber); @@ -834,7 +901,9 @@ void SMESHGUI_GroupDlg::onListSelectionChanged() void SMESHGUI_GroupDlg::onObjectSelectionChanged() { if ( myIsBusy || !isEnabled()) return; - myIsBusy = true; + if (myCurrentLineEdit == myGeomGroupLine && !myGeomGroupBtn->isOn()) return; + + myIsBusy = true; SALOME_ListIO aList; mySelectionMgr->selectedObjects( aList ); @@ -855,6 +924,8 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() myGeomGroupBtn->setEnabled(false); myGeomGroupLine->setEnabled(false); myGeomGroupLine->setText(""); + if (myGeomGroupBtn->isOn()) + myGeomGroupBtn->setOn(false); if (!myCreate) myName->setText(""); @@ -864,6 +935,7 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() myGroup = SMESH::SMESH_Group::_nil(); myGroupOnGeom = SMESH::SMESH_GroupOnGeom::_nil(); myMesh = SMESH::SMESH_Mesh::_nil(); + updateGeomPopup(); myIsBusy = false; return; } @@ -871,10 +943,11 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() if (myCreate) { myMesh = SMESH::IObjectToInterface(IO); + updateGeomPopup(); if (myMesh->_is_nil()) { myIsBusy = false; - return; + return; } myGroup = SMESH::SMESH_Group::_nil(); @@ -913,86 +986,107 @@ void SMESHGUI_GroupDlg::onObjectSelectionChanged() if (!myCreate) return; - if (myTypeId == -1) - onTypeChanged(0); - else { - myElements->clear(); - setSelectionMode(myTypeId); - } + if (myGrpTypeId == 0) + { + if (myTypeId == -1) + onTypeChanged(0); + else + { + myElements->clear(); + setSelectionMode(myTypeId); + } + } myIsBusy = false; return; } else if (myCurrentLineEdit == myGeomGroupLine) { - if (aNbSel != 1) { - myGeomGroup = GEOM::GEOM_Object::_nil(); - myIsBusy = false; - return; - } + + myGeomObjects = new GEOM::ListOfGO(); + + // The mesh SObject + _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh); + + if (aNbSel == 0 || !aMeshSO) + { + myGeomObjects->length(0); + myIsBusy = false; + return; + } + + myGeomObjects->length(aNbSel); - Standard_Boolean testResult = Standard_False; - myGeomGroup = GEOMBase::ConvertIOinGEOMObject(aList.First(), testResult); + GEOM::GEOM_Object_var aGeomGroup; + Standard_Boolean testResult; + int i = 0; + + SALOME_ListIteratorOfListIO anIt (aList); + for (; anIt.More(); anIt.Next()) { + + testResult = Standard_False; + aGeomGroup = GEOMBase::ConvertIOinGEOMObject(anIt.Value(), testResult); - // Check if the object is a geometry group - if (!testResult || CORBA::is_nil(myGeomGroup)) { - myGeomGroup = GEOM::GEOM_Object::_nil(); - myIsBusy = false; - return; - } - // Check if group constructed on the same shape as a mesh or on its child - _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); - GEOM::GEOM_IGroupOperations_var anOp = - SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId()); + // Check if the object is a geometry group + if (!testResult || CORBA::is_nil(aGeomGroup)) + continue; + - // The main shape of the group - GEOM::GEOM_Object_var aGroupMainShape; - if (myGeomGroup->GetType() == 37) - aGroupMainShape = anOp->GetMainShape(myGeomGroup); - else - aGroupMainShape = GEOM::GEOM_Object::_duplicate(myGeomGroup); - _PTR(SObject) aGroupMainShapeSO = - //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape)); - aStudy->FindObjectID(aGroupMainShape->GetStudyEntry()); + // Check if group constructed on the same shape as a mesh or on its child + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + GEOM::GEOM_IGroupOperations_var anOp = + SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId()); - // The mesh SObject - _PTR(SObject) aMeshSO = SMESH::FindSObject(myMesh); - if (!aMeshSO) { - myGeomGroup = GEOM::GEOM_Object::_nil(); - myIsBusy = false; - return; - } - _PTR(SObject) anObj, aRef; - bool isRefOrSubShape = false; - if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) { - //if (strcmp(aRef->GetID(), aGroupMainShapeSO->GetID()) == 0) { - if (aRef->GetID() == aGroupMainShapeSO->GetID()) { - isRefOrSubShape = true; - } else { - _PTR(SObject) aFather = aGroupMainShapeSO->GetFather(); - _PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent(); - //while (!isRefOrSubShape && strcmp(aFather->GetID(), aComponent->GetID()) != 0) { - while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) { - //if (strcmp(aRef->GetID(), aFather->GetID()) == 0) - if (aRef->GetID() == aFather->GetID()) - isRefOrSubShape = true; - else - aFather = aFather->GetFather(); - } + // The main shape of the group + GEOM::GEOM_Object_var aGroupMainShape; + if (aGeomGroup->GetType() == 37) + aGroupMainShape = anOp->GetMainShape(aGeomGroup); + else + aGroupMainShape = GEOM::GEOM_Object::_duplicate(aGeomGroup); + _PTR(SObject) aGroupMainShapeSO = + //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(aGroupMainShape)); + aStudy->FindObjectID(aGroupMainShape->GetStudyEntry()); + + _PTR(SObject) anObj, aRef; + bool isRefOrSubShape = false; + if (aMeshSO->FindSubObject(1, anObj) && anObj->ReferencedObject(aRef)) { + //if (strcmp(aRef->GetID(), aGroupMainShapeSO->GetID()) == 0) { + if (aRef->GetID() == aGroupMainShapeSO->GetID()) { + isRefOrSubShape = true; + } else { + _PTR(SObject) aFather = aGroupMainShapeSO->GetFather(); + _PTR(SComponent) aComponent = aGroupMainShapeSO->GetFatherComponent(); + //while (!isRefOrSubShape && strcmp(aFather->GetID(), aComponent->GetID()) != 0) { + while (!isRefOrSubShape && aFather->GetID() != aComponent->GetID()) { + //if (strcmp(aRef->GetID(), aFather->GetID()) == 0) + if (aRef->GetID() == aFather->GetID()) + isRefOrSubShape = true; + else + aFather = aFather->GetFather(); + } + } } + if (isRefOrSubShape) + myGeomObjects[i++] = aGeomGroup; } - if (!isRefOrSubShape) { - myGeomGroup = GEOM::GEOM_Object::_nil(); - myIsBusy = false; - return; - } + + myGeomObjects->length(i); + if ( i == 0 ) + { + myIsBusy = false; + return; + } + + aNbSel = i; } if(aNbSel >= 1) { if(aNbSel > 1) { if(myCurrentLineEdit == mySubMeshLine) aString = tr("SMESH_SUBMESH_SELECTED").arg(aNbSel); - else if(myCurrentLineEdit == myGroupLine || myCurrentLineEdit == myGeomGroupLine) + else if(myCurrentLineEdit == myGroupLine) aString = tr("SMESH_GROUP_SELECTED").arg(aNbSel); + else if(myCurrentLineEdit == myGeomGroupLine) + aString = tr("%1 Objects").arg(aNbSel); } else { aString = aList.First()->getName(); } @@ -1100,9 +1194,12 @@ void SMESHGUI_GroupDlg::onSelectGeomGroup(bool on) mySelectGroup->setChecked(false); } myCurrentLineEdit = myGeomGroupLine; - setSelectionMode(7); + updateGeomPopup(); + setSelectionMode(8); } else { + myGeomGroupBtn->setOn(false); + myGeomObjects->length(0); myGeomGroupLine->setText(""); myCurrentLineEdit = 0; if (myTypeId != -1) @@ -1146,11 +1243,6 @@ void SMESHGUI_GroupDlg::setCurrentSelection() myCurrentLineEdit = myGroupLine; onObjectSelectionChanged(); } - else if (send == myGeomGroupBtn) { - myCurrentLineEdit = myGeomGroupLine; - setSelectionMode(7); - onObjectSelectionChanged(); - } } @@ -1328,13 +1420,13 @@ void SMESHGUI_GroupDlg::onAdd() myIsBusy = false; onListSelectionChanged(); - } else if (myCurrentLineEdit == myGeomGroupLine && !CORBA::is_nil(myGeomGroup)) { + } else if (myCurrentLineEdit == myGeomGroupLine && myGeomObjects->length() == 1) { _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); GEOM::GEOM_IGroupOperations_var aGroupOp = SMESH::GetGEOMGen()->GetIGroupOperations(aStudy->StudyId()); SMESH::ElementType aGroupType = SMESH::ALL; - switch(aGroupOp->GetType(myGeomGroup)) { + switch(aGroupOp->GetType(myGeomObjects[0])) { case 7: aGroupType = SMESH::NODE; break; case 6: aGroupType = SMESH::EDGE; break; case 4: aGroupType = SMESH::FACE; break; @@ -1345,12 +1437,12 @@ void SMESHGUI_GroupDlg::onAdd() if (aGroupType == aType) { _PTR(SObject) aGroupSO = //aStudy->FindObjectIOR(aStudy->ConvertObjectToIOR(myGeomGroup)); - aStudy->FindObjectID(myGeomGroup->GetStudyEntry()); + aStudy->FindObjectID(myGeomObjects[0]->GetStudyEntry()); // Construct filter SMESH::FilterManager_var aFilterMgr = SMESH::GetFilterManager(); SMESH::Filter_var aFilter = aFilterMgr->CreateFilter(); SMESH::BelongToGeom_var aBelongToGeom = aFilterMgr->CreateBelongToGeom();; - aBelongToGeom->SetGeom(myGeomGroup); + aBelongToGeom->SetGeom(myGeomObjects[0]); aBelongToGeom->SetShapeName(aGroupSO->GetName().c_str()); aBelongToGeom->SetElementType(aType); aFilter->SetPredicate(aBelongToGeom); @@ -1556,9 +1648,15 @@ void SMESHGUI_GroupDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } @@ -1596,7 +1694,7 @@ void SMESHGUI_GroupDlg::enterEvent (QEvent*) //================================================================================= void SMESHGUI_GroupDlg::hideEvent (QHideEvent*) { - if (!isMinimized()) + if (!isMinimized() && !myIsBusy) onClose(); } @@ -1616,3 +1714,128 @@ void SMESHGUI_GroupDlg::keyPressEvent( QKeyEvent* e ) onHelp(); } } + +//================================================================================ +/*! + * \brief Enable showing of the popup when Geometry selection btn is clicked + * \param enable - true to enable + */ +//================================================================================ + +enum { DIRECT_GEOM_INDEX = 0, GEOM_BY_MESH_INDEX }; + +void SMESHGUI_GroupDlg::updateGeomPopup() +{ + bool enable = false; + + if ( !myMesh->_is_nil() ) + enable = myMesh->NbEdges() > 0; + + if ( myGeomGroupBtn ) + { + disconnect( myGeomGroupBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) )); + if ( enable ) { + if ( !myGeomPopup ) { + myGeomPopup = new QPopupMenu(); + myGeomPopup->insertItem( tr("DIRECT_GEOM_SELECTION"), DIRECT_GEOM_INDEX ); + myGeomPopup->insertItem( tr("GEOM_BY_MESH_ELEM_SELECTION"), GEOM_BY_MESH_INDEX ); + connect( myGeomPopup, SIGNAL( activated( int ) ), SLOT( onGeomPopup( int ) ) ); + } + connect( myGeomGroupBtn, SIGNAL( toggled(bool) ), this, SLOT( onGeomSelectionButton(bool) )); + } + } +} + + +//================================================================================= +// function : onGeomSelectionButton() +// purpose : +//================================================================================= +void SMESHGUI_GroupDlg::onGeomSelectionButton(bool isBtnOn) +{ + if ( myGeomPopup && isBtnOn ) + { + myCurrentLineEdit = myGeomGroupLine; + int id = myGeomPopup->exec( QCursor::pos() ); + if (id == DIRECT_GEOM_INDEX || id == -1) + setSelectionMode(7); + } + else if (!isBtnOn) + { + myCurrentLineEdit = 0; + setSelectionMode(8); + } +} + +//================================================================================= +// function : onGeomPopup() +// purpose : +//================================================================================= +void SMESHGUI_GroupDlg::onGeomPopup( int index ) +{ + if ( index == GEOM_BY_MESH_INDEX ) + { + mySelectionMode = -1; + if ( !myShapeByMeshOp ) { + myShapeByMeshOp = new SMESHGUI_ShapeByMeshOp(true); + connect(myShapeByMeshOp, SIGNAL(committed(SUIT_Operation*)), + SLOT(onPublishShapeByMeshDlg(SUIT_Operation*))); + connect(myShapeByMeshOp, SIGNAL(aborted(SUIT_Operation*)), + SLOT(onCloseShapeByMeshDlg(SUIT_Operation*))); + } + // set mesh object to SMESHGUI_ShapeByMeshOp and start it + if ( !myMesh->_is_nil() ) { + myIsBusy = true; + hide(); // stop processing selection + myIsBusy = false; + myShapeByMeshOp->setModule( mySMESHGUI ); + myShapeByMeshOp->setStudy( 0 ); // it's really necessary + myShapeByMeshOp->SetMesh( myMesh ); + myShapeByMeshOp->start(); + } + } +} + +//================================================================================ +/*! + * \brief SLOT. Is called when Ok is pressed in SMESHGUI_ShapeByMeshDlg + */ +//================================================================================ + +void SMESHGUI_GroupDlg::onPublishShapeByMeshDlg(SUIT_Operation* op) +{ + if ( myShapeByMeshOp == op ) { + mySMESHGUI->getApp()->updateObjectBrowser(); + show(); + // Select a found geometry object + GEOM::GEOM_Object_var aGeomVar = myShapeByMeshOp->GetShape(); + if ( !aGeomVar->_is_nil() ) + { + QString ID = aGeomVar->GetStudyEntry(); + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + if ( _PTR(SObject) aGeomSO = aStudy->FindObjectID( ID.latin1() )) { + SALOME_ListIO anIOList; + Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject + ( aGeomSO->GetID().c_str(), "SMESH", aGeomSO->GetName().c_str() ); + anIOList.Append( anIO ); + mySelectionMgr->setSelectedObjects( anIOList, false ); + onObjectSelectionChanged(); + } + } + } +} + +//================================================================================ +/*! + * \brief SLOT. Is called when Close is pressed in SMESHGUI_ShapeByMeshDlg + */ +//================================================================================ + +void SMESHGUI_GroupDlg::onCloseShapeByMeshDlg(SUIT_Operation* op) +{ + if ( myShapeByMeshOp == op ) + { + show(); + setSelectionMode(7); + } +} diff --git a/src/SMESHGUI/SMESHGUI_GroupDlg.h b/src/SMESHGUI/SMESHGUI_GroupDlg.h index 303c38223..be6f5ebdd 100644 --- a/src/SMESHGUI/SMESHGUI_GroupDlg.h +++ b/src/SMESHGUI/SMESHGUI_GroupDlg.h @@ -28,6 +28,8 @@ #ifndef DIALOGBOX_GROUP_H #define DIALOGBOX_GROUP_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" //#include "SMESH_TypeFilter.hxx" #include "SUIT_SelectionFilter.h" @@ -45,13 +47,17 @@ class QLineEdit; class QButtonGroup; class QGroupBox; class QListBox; +class QPopupMenu; class QPushButton; +class QToolButton; class QCheckBox; class QWidgetStack; class QtxIntSpinBox; class SMESHGUI; class SMESH_Actor; class SMESHGUI_FilterDlg; +class SMESHGUI_ShapeByMeshOp; +class SUIT_Operation; class SVTK_Selector; class SVTK_ViewWindow; @@ -59,7 +65,7 @@ class SVTK_ViewWindow; // class : SMESHGUI_GroupDlg // purpose : //================================================================================= -class SMESHGUI_GroupDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_GroupDlg : public QDialog { Q_OBJECT @@ -107,6 +113,12 @@ private slots: void onNbColorsChanged(const QString& text); void onFilterAccepted(); + void onGeomPopup( int ); + void onGeomSelectionButton( bool ); + + void onPublishShapeByMeshDlg(SUIT_Operation*); + void onCloseShapeByMeshDlg(SUIT_Operation*); + private: void initDialog(bool create); void init(SMESH::SMESH_Mesh_ptr theMesh); @@ -117,6 +129,7 @@ private: void keyPressEvent(QKeyEvent*); void setSelectionMode(int theMode); void updateButtons(); + void updateGeomPopup(); SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */ LightApp_SelectionMgr* mySelectionMgr; /* User shape selection */ @@ -150,14 +163,17 @@ private: QtxIntSpinBox* myColorSpinBox; QCheckBox* mySelectGeomGroup; - QPushButton* myGeomGroupBtn; + QToolButton* myGeomGroupBtn; QLineEdit* myGeomGroupLine; + QPopupMenu* myGeomPopup; + + SMESHGUI_ShapeByMeshOp* myShapeByMeshOp; SMESH::SMESH_Mesh_var myMesh; SMESH::SMESH_Group_var myGroup; SMESH::SMESH_GroupOnGeom_var myGroupOnGeom; QValueList myIdList; - GEOM::GEOM_Object_var myGeomGroup; + GEOM::ListOfGO_var myGeomObjects; int mySelectionMode; //Handle(SMESH_TypeFilter) myMeshFilter; @@ -166,6 +182,7 @@ private: SUIT_SelectionFilter* myMeshFilter; SUIT_SelectionFilter* mySubMeshFilter; SUIT_SelectionFilter* myGroupFilter; + SUIT_SelectionFilter* myGeomFilter; SMESHGUI_FilterDlg* myFilterDlg; diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx index 52f6d0fc4..670d2f16e 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.cxx @@ -317,9 +317,15 @@ void SMESHGUI_GroupOpDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h index 5b22977ad..2dfce3bb5 100644 --- a/src/SMESHGUI/SMESHGUI_GroupOpDlg.h +++ b/src/SMESHGUI/SMESHGUI_GroupOpDlg.h @@ -27,6 +27,8 @@ #ifndef SMESHGUI_GroupOpDlg_H #define SMESHGUI_GroupOpDlg_H +#include "SMESH_SMESHGUI.hxx" + #include #include @@ -47,7 +49,7 @@ class SVTK_Selector; Description : Perform boolean operations on groups */ -class SMESHGUI_GroupOpDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_GroupOpDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_GroupUtils.h b/src/SMESHGUI/SMESHGUI_GroupUtils.h index 207593d3f..f6ceabef6 100644 --- a/src/SMESHGUI/SMESHGUI_GroupUtils.h +++ b/src/SMESHGUI/SMESHGUI_GroupUtils.h @@ -20,6 +20,8 @@ #ifndef SMESHGUI_GroupUtils_HeaderFile #define SMESHGUI_GroupUtils_HeaderFile +#include "SMESH_SMESHGUI.hxx" + #include "SALOMEconfig.h" #include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_Group) @@ -27,6 +29,7 @@ namespace SMESH{ +SMESHGUI_EXPORT SMESH::SMESH_Group_var AddGroup(SMESH::SMESH_Mesh_ptr theMesh, SMESH::ElementType theType, const char* theGroupName); diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx index 6e90a7093..c58be37f5 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.cxx +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.cxx @@ -43,9 +43,10 @@ #include #include +#include + SMESHGUI_GenericHypothesisCreator::SMESHGUI_GenericHypothesisCreator( const QString& aHypType ) -: myHypType( aHypType ), - myIsCreate( false ) + : myHypType( aHypType ), myIsCreate( false ), myDlg( 0 ) { } @@ -131,17 +132,22 @@ bool SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_ bool res = true; myHypo = SMESH::SMESH_Hypothesis::_duplicate( h ); + SMESHGUI_HypothesisDlg* Dlg = + new SMESHGUI_HypothesisDlg( const_cast( this ), parent ); + myDlg = Dlg; QFrame* fr = buildFrame(); if( fr ) { - SMESHGUI_HypothesisDlg* dlg = - new SMESHGUI_HypothesisDlg( const_cast( this ), parent ); - dlg->setCustomFrame( fr ); - dlg->setCaption( caption() ); - dlg->setHIcon( icon() ); - dlg->setType( type() ); + Dlg->setCustomFrame( fr ); + Dlg->setCaption( caption() ); + Dlg->setHIcon( icon() ); + Dlg->setType( type() ); retrieveParams(); - res = dlg->exec()==QDialog::Accepted; + Dlg->show(); + //connect(myDlg, SIGNAL( closed() ), this, SLOT( onDlgClosed() )); + qApp->enter_loop(); // make myDlg not modal +// res = myDlg->exec()==QDialog::Accepted; + res = myDlg->result(); if( res ) { QString paramValues = storeParams(); if ( !paramValues.isEmpty() ) { @@ -149,14 +155,14 @@ bool SMESHGUI_GenericHypothesisCreator::editHypothesis( SMESH::SMESH_Hypothesis_ SMESH::SetValue( SHyp, paramValues ); } } - delete dlg; } + delete Dlg; myDlg = 0; changeWidgets().clear(); myHypo = SMESH::SMESH_Hypothesis::_nil(); myInitParamsHypo = SMESH::SMESH_Hypothesis::_nil(); return res; } - + QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame() { if( CORBA::is_nil( hypothesis() ) ) @@ -187,7 +193,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame() QLabel* lab = new QLabel( (*anIt).myName, GroupC1 ); GroupC1Layout->addWidget( lab, i, 0 ); - QWidget* w = getCustomWidget( *anIt, GroupC1 ); + QWidget* w = getCustomWidget( *anIt, GroupC1, i ); if ( !w ) switch( (*anIt).myValue.type() ) { @@ -283,10 +289,13 @@ QString SMESHGUI_GenericHypothesisCreator::stdParamValues( const ListOfStdParams { QString valueStr = ""; ListOfStdParams::const_iterator param = params.begin(), aLast = params.end(); + uint len0 = 0; for( int i=0; param!=aLast; param++, i++ ) { - if ( i > 0 ) + if ( valueStr.length() > len0 ) { valueStr += "; "; + len0 = valueStr.length(); + } switch( (*param).myValue.type() ) { case QVariant::Int: @@ -357,7 +366,8 @@ QString SMESHGUI_GenericHypothesisCreator::type() const return QString(); } QWidget* SMESHGUI_GenericHypothesisCreator::getCustomWidget( const StdParam & /*param*/, - QWidget* /*parent*/) const + QWidget* /*parent*/, + const int /*index*/) const { return 0; } @@ -366,11 +376,15 @@ bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam& , QW return false; } +void SMESHGUI_GenericHypothesisCreator::onReject() +{ +} + SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreator* creator, QWidget* parent ) -: QtxDialog( parent, "", true, true ), +: QtxDialog( parent, "", false, true ), myCreator( creator ) { setMinimumSize( 300, height() ); @@ -414,7 +428,6 @@ SMESHGUI_HypothesisDlg::SMESHGUI_HypothesisDlg( SMESHGUI_GenericHypothesisCreato myHelpFileName = ""; connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) ); - } SMESHGUI_HypothesisDlg::~SMESHGUI_HypothesisDlg() @@ -432,8 +445,17 @@ void SMESHGUI_HypothesisDlg::setCustomFrame( QFrame* f ) void SMESHGUI_HypothesisDlg::accept() { - if( !myCreator || myCreator->checkParams() ) - QtxDialog::accept(); + if ( myCreator && !myCreator->checkParams() ) + return; + QtxDialog::accept(); + qApp->exit_loop(); +} + +void SMESHGUI_HypothesisDlg::reject() +{ + if ( myCreator ) myCreator->onReject(); + QtxDialog::reject(); + qApp->exit_loop(); } void SMESHGUI_HypothesisDlg::onHelp() @@ -444,9 +466,15 @@ void SMESHGUI_HypothesisDlg::onHelp() app->onHelpContextModule(aSMESHGUI ? app->moduleName(aSMESHGUI->moduleName()) : QString(""), myHelpFileName); } else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_Hypotheses.h b/src/SMESHGUI/SMESHGUI_Hypotheses.h index 43ad6734c..c76e409e1 100644 --- a/src/SMESHGUI/SMESHGUI_Hypotheses.h +++ b/src/SMESHGUI/SMESHGUI_Hypotheses.h @@ -28,6 +28,8 @@ #ifndef SMESHGUI_Hypotheses_HeaderFile #define SMESHGUI_Hypotheses_HeaderFile +#include "SMESH_SMESHGUI.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Hypothesis) @@ -40,7 +42,7 @@ class QPixmap; /*! * \brief Auxiliary class for creation of hypotheses */ -class SMESHGUI_GenericHypothesisCreator : public QObject +class SMESHGUI_EXPORT SMESHGUI_GenericHypothesisCreator : public QObject { Q_OBJECT @@ -51,7 +53,9 @@ public: void create( const bool isAlgo, QWidget* ); void edit( SMESH::SMESH_Hypothesis_ptr, QWidget* ); void create( SMESH::SMESH_Hypothesis_ptr, QWidget* ); + virtual bool checkParams() const = 0; + virtual void onReject(); QString hypType() const; bool isCreation() const; @@ -71,6 +75,7 @@ protected: SMESH::SMESH_Hypothesis_var initParamsHypothesis() const; const ListOfWidgets& widgets() const; ListOfWidgets& changeWidgets(); + QtxDialog* dlg() const { return myDlg; } virtual QFrame* buildFrame () = 0; QFrame* buildStdFrame (); @@ -80,7 +85,7 @@ protected: bool getStdParamFromDlg( ListOfStdParams& ) const; static QString stdParamValues( const ListOfStdParams& ); virtual void attuneStdWidget( QWidget*, const int ) const; - virtual QWidget* getCustomWidget( const StdParam &, QWidget* ) const; + virtual QWidget* getCustomWidget( const StdParam &, QWidget*, const int ) const; virtual bool getParamFromCustomWidget( StdParam& , QWidget* ) const; virtual QString caption() const; virtual QPixmap icon() const; @@ -97,6 +102,7 @@ private: QString myHypType; ListOfWidgets myParamWidgets; bool myIsCreate; + QtxDialog* myDlg; }; class SMESHGUI_HypothesisDlg : public QtxDialog @@ -113,6 +119,7 @@ public: protected slots: virtual void accept(); + virtual void reject(); void onHelp(); private: diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx index 9772724e6..ebb1ca333 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.cxx @@ -47,7 +47,23 @@ #include #include -#include +#ifdef WNT + #include +#else + #include +#endif + +#ifdef WNT + #define LibHandle HMODULE + #define LoadLib( name ) LoadLibrary( name ) + #define GetProc GetProcAddress + #define UnLoadLib( handle ) FreeLibrary( handle ); +#else + #define LibHandle void* + #define LoadLib( name ) dlopen( name, RTLD_LAZY ) + #define GetProc dlsym + #define UnLoadLib( handle ) dlclose( handle ); +#endif #ifdef _DEBUG_ static int MYDEBUG = 0; @@ -320,11 +336,18 @@ namespace SMESH{ try { // load plugin library if(MYDEBUG) MESSAGE("Loading client meshers plugin library ..."); - void* libHandle = dlopen (aClientLibName, RTLD_LAZY); + LibHandle libHandle = LoadLib( aClientLibName ); if (!libHandle) { // report any error, if occured - const char* anError = dlerror(); - if(MYDEBUG) MESSAGE(anError); + if ( MYDEBUG ) + { +#ifdef WIN32 + const char* anError = "Can't load client meshers plugin library"; +#else + const char* anError = dlerror(); +#endif + MESSAGE(anError); + } } else { // get method, returning hypothesis creator @@ -332,10 +355,10 @@ namespace SMESH{ typedef SMESHGUI_GenericHypothesisCreator* (*GetHypothesisCreator) \ ( const QString& ); GetHypothesisCreator procHandle = - (GetHypothesisCreator)dlsym(libHandle, "GetHypothesisCreator"); + (GetHypothesisCreator)GetProc(libHandle, "GetHypothesisCreator"); if (!procHandle) { if(MYDEBUG) MESSAGE("bad hypothesis client plugin library"); - dlclose(libHandle); + UnLoadLib(libHandle); } else { // get hypothesis creator @@ -594,6 +617,7 @@ namespace SMESH{ CASE2MESSAGE( MISSING_ALGO ); CASE2MESSAGE( MISSING_HYPO ); CASE2MESSAGE( NOT_CONFORM_MESH ); + CASE2MESSAGE( BAD_PARAM_VALUE ); default: continue; } // apply args to message: diff --git a/src/SMESHGUI/SMESHGUI_HypothesesUtils.h b/src/SMESHGUI/SMESHGUI_HypothesesUtils.h index b8ea3f846..f62b14da2 100644 --- a/src/SMESHGUI/SMESHGUI_HypothesesUtils.h +++ b/src/SMESHGUI/SMESHGUI_HypothesesUtils.h @@ -28,6 +28,8 @@ #ifndef SMESHGUI_HypothesesUtils_HeaderFile #define SMESHGUI_HypothesesUtils_HeaderFile +#include "SMESH_SMESHGUI.hxx" + #include #include @@ -49,43 +51,56 @@ class algo_error_array; namespace SMESH{ + SMESHGUI_EXPORT void InitAvailableHypotheses(); + SMESHGUI_EXPORT QStringList GetAvailableHypotheses( const bool isAlgo, const int theDim = -1, const bool isAux = false); - + SMESHGUI_EXPORT QStringList GetHypothesesSets(); + SMESHGUI_EXPORT HypothesesSet* GetHypothesesSet(const QString theSetName); + SMESHGUI_EXPORT HypothesisData* GetHypothesisData(const char* aHypType); + SMESHGUI_EXPORT bool IsAvailableHypothesis(const HypothesisData* algoData, const QString& hypType, bool& isOptional); + SMESHGUI_EXPORT bool IsCompatibleAlgorithm(const HypothesisData* algo1Data, const HypothesisData* algo2Data); + SMESHGUI_EXPORT SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator(const char* aHypType); + SMESHGUI_EXPORT SMESH::SMESH_Hypothesis_ptr CreateHypothesis(const char* aHypType, const char* aHypName, const bool isAlgo = false); + SMESHGUI_EXPORT bool AddHypothesisOnMesh(SMESH::SMESH_Mesh_ptr aMesh, SMESH::SMESH_Hypothesis_ptr aHyp); + SMESHGUI_EXPORT bool AddHypothesisOnSubMesh(SMESH::SMESH_subMesh_ptr aSubMesh, SMESH::SMESH_Hypothesis_ptr aHyp); + SMESHGUI_EXPORT bool RemoveHypothesisOrAlgorithmOnMesh(const Handle(SALOME_InteractiveObject)& IObject); + SMESHGUI_EXPORT bool RemoveHypothesisOrAlgorithmOnMesh(_PTR(SObject) MorSM, SMESH::SMESH_Hypothesis_ptr anHyp); typedef std::vector<_PTR(SObject)> SObjectList; SObjectList GetMeshesUsingAlgoOrHypothesis(SMESH::SMESH_Hypothesis_ptr AlgoOrHyp ) ; + SMESHGUI_EXPORT QString GetMessageOnAlgoStateErrors(const algo_error_array& errors); } diff --git a/src/SMESHGUI/SMESHGUI_IdValidator.h b/src/SMESHGUI/SMESHGUI_IdValidator.h index 32004bc40..d5c5c8060 100644 --- a/src/SMESHGUI/SMESHGUI_IdValidator.h +++ b/src/SMESHGUI/SMESHGUI_IdValidator.h @@ -28,11 +28,13 @@ #ifndef SMESHGUI_IdValidator_HeaderFile #define SMESHGUI_IdValidator_HeaderFile +#include "SMESH_SMESHGUI.hxx" + #include // validator for manual input of Ids -class SMESHGUI_IdValidator: public QValidator +class SMESHGUI_EXPORT SMESHGUI_IdValidator: public QValidator { public: diff --git a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx index c16fab197..475f2161c 100644 --- a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.cxx @@ -385,9 +385,15 @@ void SMESHGUI_MergeNodesDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.h b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.h index eda961e8c..174f87290 100644 --- a/src/SMESHGUI/SMESHGUI_MergeNodesDlg.h +++ b/src/SMESHGUI/SMESHGUI_MergeNodesDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_MERGENODES_H #define DIALOGBOX_MERGENODES_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" //#include "SMESH_TypeFilter.hxx" #include "SUIT_SelectionFilter.h" @@ -63,7 +65,7 @@ class SVTK_Selector; // class : SMESHGUI_MergeNodesDlg // purpose : //================================================================================= -class SMESHGUI_MergeNodesDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_MergeNodesDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_MeshDlg.h b/src/SMESHGUI/SMESHGUI_MeshDlg.h index 84ca7a229..0429403a4 100644 --- a/src/SMESHGUI/SMESHGUI_MeshDlg.h +++ b/src/SMESHGUI/SMESHGUI_MeshDlg.h @@ -33,6 +33,8 @@ #ifndef SMESHGUI_MeshDlg_H #define SMESHGUI_MeshDlg_H +#include "SMESH_SMESHGUI.hxx" + #include "SMESHGUI_Dialog.h" #include #include @@ -51,7 +53,7 @@ class QPopupMenu; * * This dialog is used for mech creation or editing. */ -class SMESHGUI_MeshDlg : public SMESHGUI_Dialog +class SMESHGUI_EXPORT SMESHGUI_MeshDlg : public SMESHGUI_Dialog { Q_OBJECT @@ -98,7 +100,7 @@ private: * algorithms and hypotheses */ -class SMESHGUI_MeshTab : public QFrame +class SMESHGUI_EXPORT SMESHGUI_MeshTab : public QFrame { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx index 713e01625..4bcb125b1 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.cxx @@ -632,9 +632,15 @@ void SMESHGUI_MeshInfosDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h index 51bf242c5..d8925c5d8 100644 --- a/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h +++ b/src/SMESHGUI/SMESHGUI_MeshInfosDlg.h @@ -29,6 +29,8 @@ #ifndef SMESHGUI_MESHINFOSDLG_H #define SMESHGUI_MESHINFOSDLG_H +#include "SMESH_SMESHGUI.hxx" + // QT Includes #include @@ -40,7 +42,7 @@ class QWidgetStack; class LightApp_SelectionMgr; class SMESHGUI; -class SMESHGUI_MeshInfosDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_MeshInfosDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.cxx b/src/SMESHGUI/SMESHGUI_MeshOp.cxx index 111c5944f..0e13c26e5 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshOp.cxx @@ -1,18 +1,18 @@ // Copyright (C) 2005 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 +// License as published by the Free Software Foundation; either // version 2.1 of the License. -// -// 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 +// +// 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 +// 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 @@ -49,6 +49,7 @@ #include "GeometryGUI.h" #include "SalomeApp_Tools.h" +#include "SalomeApp_Application.h" #include "SALOMEDSClient_Study.hxx" #include "SALOMEDSClient_AttributeIOR.hxx" #include "SALOMEDSClient_AttributeName.hxx" @@ -81,7 +82,7 @@ enum { GLOBAL_ALGO_TAG =3, SUBMESH_ON_SHELL_TAG =8, SUBMESH_ON_SOLID_TAG =9, SUBMESH_ON_COMPOUND_TAG=10 }; - + //================================================================================ /*! * \brief Constructor @@ -212,7 +213,7 @@ void SMESHGUI_MeshOp::startOperation() connect( myDlg, SIGNAL( hypoSet( const QString& )), SLOT( onHypoSet( const QString& ))); connect( myDlg, SIGNAL( geomSelectionByMesh( bool )), SLOT( onGeomSelectionByMesh( bool ))); - if ( myToCreate ) + if ( myToCreate ) if ( myIsMesh ) myHelpFileName = "/files/constructing_meshes.htm"; else myHelpFileName = "/files/constructing_submeshes.htm"; else myHelpFileName = "files/reassigning_hypotheses_and_algorithms.htm"; @@ -294,42 +295,49 @@ bool SMESHGUI_MeshOp::isSubshapeOk() const if ( !myToCreate || myIsMesh ) // not submesh creation return false; + // mesh QString aMeshEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Mesh ); - QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() ); - _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.latin1() ); - if ( pMesh && pGeom ) { - SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface( pMesh ); - if ( !mesh->_is_nil() ) { - GEOM::GEOM_Object_var mainGeom, subGeom; - mainGeom = mesh->GetShapeToMesh(); - subGeom = SMESH::SObjectToInterface( pGeom ); - if ( !mainGeom->_is_nil() && !subGeom->_is_nil() ) { - TopoDS_Shape mainShape, subShape; - if ( GEOMBase::GetShape( mainGeom, mainShape ) && - GEOMBase::GetShape( subGeom, subShape ) ) - { - int index = GEOMBase::GetIndex( subShape, mainShape, 0 ); - if ( index > 0 ) { - // 1 is index of mainShape itself - return index > 1; // it is a subshape - } - // is it a group? - GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen(); - _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); - if ( !geomGen->_is_nil() && aStudy ) { - GEOM::GEOM_IGroupOperations_var op = - geomGen->GetIGroupOperations( aStudy->StudyId() ); - if ( ! op->_is_nil() ) { - GEOM::GEOM_Object_var mainObj = op->GetMainShape( subGeom ); - if ( !mainObj->_is_nil() ) - return ( string( mainObj->GetEntry() ) == string( mainGeom->GetEntry() )); - } - } - } - } + if (!pMesh) return false; + + SMESH::SMESH_Mesh_var mesh = SMESH::SObjectToInterface( pMesh ); + if (mesh->_is_nil()) return false; + + // main shape of the mesh + GEOM::GEOM_Object_var mainGeom = mesh->GetShapeToMesh(); + if (mainGeom->_is_nil()) return false; + + // geometry + QStringList aGEOMs; + myDlg->selectedObject(SMESHGUI_MeshDlg::Geom, aGEOMs); + + if (aGEOMs.count() > 0) { + GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen(); + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + if (geomGen->_is_nil() || !aStudy) return false; + + GEOM::GEOM_IGroupOperations_var op = + geomGen->GetIGroupOperations(aStudy->StudyId()); + if (op->_is_nil()) return false; + + // check all selected shapes + QStringList::const_iterator aSubShapesIter = aGEOMs.begin(); + for (; aSubShapesIter != aGEOMs.end(); aSubShapesIter++) { + QString aSubGeomEntry = (*aSubShapesIter); + _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.latin1()); + if (!pSubGeom) return false; + + GEOM::GEOM_Object_var aSubGeomVar = + GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject()); + if (aSubGeomVar->_is_nil()) return false; + + GEOM::GEOM_Object_var mainObj = op->GetMainShape(aSubGeomVar); + if (mainObj->_is_nil() || + string(mainObj->GetEntry()) != string(mainGeom->GetEntry())) return false; } + return true; } + return false; } @@ -379,7 +387,7 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const } } } - } + } } return _PTR(SObject)(); } @@ -393,7 +401,7 @@ _PTR(SObject) SMESHGUI_MeshOp::getSubmeshByGeom() const //================================================================================ void SMESHGUI_MeshOp::selectionDone() { - if ( !dlg()->isShown() ) + if ( !dlg()->isShown() || !myDlg->isEnabled() ) return; SMESHGUI_SelectionOp::selectionDone(); @@ -404,38 +412,57 @@ void SMESHGUI_MeshOp::selectionDone() int shapeDim = 3; - GEOM::GEOM_Object_var aGeomVar; - QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); - _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.latin1() ); - if ( pGeom ) { - aGeomVar = GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() ); - } - else { + QStringList aGEOMs; + myDlg->selectedObject(SMESHGUI_MeshDlg::Geom, aGEOMs); + GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO; + + if (aGEOMs.count() > 0) { + // one or more GEOM shape selected + aSeq->length(aGEOMs.count()); + QStringList::const_iterator aSubShapesIter = aGEOMs.begin(); + int iSubSh = 0; + for (; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) { + QString aSubGeomEntry = (*aSubShapesIter); + _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.latin1()); + GEOM::GEOM_Object_var aSubGeomVar = + GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject()); + aSeq[iSubSh] = aSubGeomVar; + } + } else { + // get geometry by selected sub-mesh QString anObjEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ); _PTR(SObject) pObj = studyDS()->FindObjectID( anObjEntry.latin1() ); - aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); + GEOM::GEOM_Object_var aGeomVar = SMESH::GetShapeOnMeshOrSubMesh( pObj ); + if (!aGeomVar->_is_nil()) { + aSeq->length(1); + aSeq[0] = aGeomVar; + } } - if ( !aGeomVar->_is_nil() ) { + + if (aSeq->length() > 0) { shapeDim = 0; - switch ( aGeomVar->GetShapeType() ) { - case GEOM::SOLID: - case GEOM::SHELL: shapeDim = 3; break; - case GEOM::FACE: shapeDim = 2; break; - case GEOM::WIRE: - case GEOM::EDGE: shapeDim = 1; break; - case GEOM::VERTEX: shapeDim = 0; break; - default: - TopoDS_Shape aShape; - if ( GEOMBase::GetShape(aGeomVar, aShape)) { - TopExp_Explorer exp( aShape, TopAbs_SHELL ); - if ( exp.More() ) - shapeDim = 3; - else if ( exp.Init( aShape, TopAbs_FACE ), exp.More() ) - shapeDim = 2; - else if ( exp.Init( aShape, TopAbs_EDGE ), exp.More() ) - shapeDim = 1; - else - shapeDim = 0; + for (int iss = 0; iss < aSeq->length() && shapeDim < 3; iss++) { + GEOM::GEOM_Object_var aGeomVar = aSeq[iss]; + switch ( aGeomVar->GetShapeType() ) { + case GEOM::SOLID: + case GEOM::SHELL: shapeDim = 3; break; + case GEOM::FACE: shapeDim = (shapeDim < 2) ? 2 : shapeDim; break; + case GEOM::WIRE: + case GEOM::EDGE: shapeDim = (shapeDim < 1) ? 1 : shapeDim; break; + case GEOM::VERTEX: break; + default: + TopoDS_Shape aShape; + if ( GEOMBase::GetShape(aGeomVar, aShape)) { + TopExp_Explorer exp( aShape, TopAbs_SHELL ); + if ( exp.More() ) + shapeDim = 3; + else if ( exp.Init( aShape, TopAbs_FACE ), exp.More() ) + shapeDim = (shapeDim < 2) ? 2 : shapeDim; + else if ( exp.Init( aShape, TopAbs_EDGE ), exp.More() ) + shapeDim = (shapeDim < 1) ? 1 : shapeDim; + else + ;//shapeDim = 0; + } } } } @@ -464,7 +491,7 @@ void SMESHGUI_MeshOp::selectionDone() { // if a submesh on the selected shape already exist, pass to submesh edition mode if ( _PTR(SObject) pSubmesh = getSubmeshByGeom() ) { - SMESH::SMESH_subMesh_var sm = + SMESH::SMESH_subMesh_var sm = SMESH::SObjectToInterface( pSubmesh ); bool editSubmesh = ( !sm->_is_nil() && SUIT_MessageBox::question2( myDlg, tr( "SMESH_WARNING" ), @@ -586,7 +613,7 @@ bool SMESHGUI_MeshOp::isValid( QString& theMess ) const } } } - + return true; } @@ -756,7 +783,7 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType, const int nbColonsInMeshEntry = 3; bool isSubMesh = myToCreate ? !myIsMesh : - myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ).contains(':') > nbColonsInMeshEntry; + myDlg->selectedObject( SMESHGUI_MeshDlg::Obj ).contains(':') > nbColonsInMeshEntry; if ( isSubMesh ) { @@ -797,7 +824,7 @@ SMESHGUI_MeshOp::getInitParamsHypothesis( const QString& aHypType, //================================================================================ /*! - * \Brief Returns tab dimention + * \Brief Returns tab dimention * \param tab - the tab in the dlg * \param dlg - my dialogue * \retval int - dimention @@ -852,6 +879,10 @@ void SMESHGUI_MeshOp::createHypothesis (const int theDim, const int theType, const QString& theTypeName) { + // During a hypothesis creation we might need to select some objects. + // Main dialog must not update it's own selected objects in this case. + dlg()->deactivateAll(); + HypothesisData* aData = SMESH::GetHypothesisData(theTypeName.latin1()); if (!aData) return; @@ -873,7 +904,9 @@ void SMESHGUI_MeshOp::createHypothesis (const int theDim, // with values used to mesh a subshape SMESH::SMESH_Hypothesis_var initParamHyp = getInitParamsHypothesis(theTypeName, aData->ServerLibName); + myDlg->setEnabled( false ); aCreator->create(initParamHyp, myDlg); + myDlg->setEnabled( true ); } else { SMESH::CreateHypothesis(theTypeName, aData->Label, false); } @@ -916,13 +949,16 @@ void SMESHGUI_MeshOp::onEditHyp( const int theHypType, const int theIndex ) char* aTypeName = aHyp->GetName(); SMESHGUI_GenericHypothesisCreator* aCreator = SMESH::GetHypothesisCreator( aTypeName ); - if ( aCreator ) + if ( aCreator ) { + myDlg->setEnabled( false ); aCreator->edit( aHyp.in(), dlg() ); + myDlg->setEnabled( true ); + } } //================================================================================ /*! - * \brief access to hypothesis data + * \brief access to hypothesis data * \param theDim - hyp dimension * \param theHypType - hyp type (Algo,MainHyp or AddHyp) * \param theIndex - index in the list @@ -1105,7 +1141,7 @@ void SMESHGUI_MeshOp::onAlgoSelected( const int theIndex, //================================================================================ /*! - * \brief Creates and selects hypothesis of hypotheses set + * \brief Creates and selects hypothesis of hypotheses set * \param theSetName - The name of hypotheses set */ //================================================================================ @@ -1201,7 +1237,7 @@ bool SMESHGUI_MeshOp::createMesh( QString& theMess ) for ( int aDim = SMESH::DIM_1D; aDim <= SMESH::DIM_3D; aDim++ ) { if ( !isAccessibleDim( aDim )) continue; - + // assign hypotheses for ( int aHypType = MainHyp; aHypType <= AddHyp; aHypType++ ) { int aHypIndex = currentHyp( aDim, aHypType ); @@ -1243,17 +1279,80 @@ bool SMESHGUI_MeshOp::createSubMesh( QString& theMess ) _PTR(SObject) pMesh = studyDS()->FindObjectID( aMeshEntry.latin1() ); SMESH::SMESH_Mesh_var aMeshVar = SMESH::SMESH_Mesh::_narrow( _CAST( SObject,pMesh )->GetObject() ); + if (aMeshVar->_is_nil()) + return false; + + // GEOM shape of the main mesh + GEOM::GEOM_Object_var mainGeom = aMeshVar->GetShapeToMesh(); + + // Name for the new sub-mesh + QString aName = myDlg->objectText(SMESHGUI_MeshDlg::Obj); // get geom object - QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); - _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.latin1() ); - GEOM::GEOM_Object_var aGeomVar = - GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() ); + GEOM::GEOM_Object_var aGeomVar; + QStringList aGEOMs; + myDlg->selectedObject(SMESHGUI_MeshDlg::Geom, aGEOMs); + if (aGEOMs.count() == 1) + { + //QString aGeomEntry = myDlg->selectedObject( SMESHGUI_MeshDlg::Geom ); + QString aGeomEntry = aGEOMs.first(); + _PTR(SObject) pGeom = studyDS()->FindObjectID( aGeomEntry.latin1() ); + aGeomVar = GEOM::GEOM_Object::_narrow( _CAST( SObject,pGeom )->GetObject() ); + } + else if (aGEOMs.count() > 1) + { + // create a GEOM group + GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen(); + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + if (!geomGen->_is_nil() && aStudy) { + GEOM::GEOM_IGroupOperations_var op = + geomGen->GetIGroupOperations(aStudy->StudyId()); + if (!op->_is_nil()) { + // check and add all selected GEOM objects: they must be + // a sub-shapes of the main GEOM and must be of one type + int iSubSh = 0; + TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE; + GEOM::ListOfGO_var aSeq = new GEOM::ListOfGO; + aSeq->length(aGEOMs.count()); + QStringList::const_iterator aSubShapesIter = aGEOMs.begin(); + for (; aSubShapesIter != aGEOMs.end(); aSubShapesIter++, iSubSh++) { + QString aSubGeomEntry = (*aSubShapesIter); + _PTR(SObject) pSubGeom = studyDS()->FindObjectID(aSubGeomEntry.latin1()); + GEOM::GEOM_Object_var aSubGeomVar = + GEOM::GEOM_Object::_narrow(_CAST(SObject,pSubGeom)->GetObject()); + TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aSubGeomVar->GetShapeType(); + if (iSubSh == 0) { + aGroupType = aSubShapeType; + } else { + if (aSubShapeType != aGroupType) + aGroupType = TopAbs_SHAPE; + } + aSeq[iSubSh] = aSubGeomVar; + } + // create a group + GEOM::GEOM_Object_var aGroupVar = op->CreateGroup(mainGeom, aGroupType); + op->UnionList(aGroupVar, aSeq); + + if (op->IsDone()) { + aGeomVar = aGroupVar; + + // publish the GEOM group in study + QString aNewGeomGroupName ("Auto_group_for_"); + aNewGeomGroupName += aName; + SALOMEDS::SObject_var aNewGroupSO = + geomGen->AddInStudy(aSMESHGen->GetCurrentStudy(), aGeomVar, aNewGeomGroupName, mainGeom); + } + } + } + } + else { + } + if (aGeomVar->_is_nil()) + return false; SUIT_OverrideCursor aWaitCursor; // create sub-mesh - QString aName = myDlg->objectText( SMESHGUI_MeshDlg::Obj ); SMESH::SMESH_subMesh_var aSubMeshVar = aMeshVar->GetSubMesh( aGeomVar, aName.latin1() ); for ( int aDim = SMESH::DIM_1D; aDim <= SMESH::DIM_3D; aDim++ ) @@ -1662,42 +1761,44 @@ bool SMESHGUI_MeshOp::editMeshOrSubMesh( QString& theMess ) { int aNewHypIndex = currentHyp( dim, hypType ); int anOldHypIndex = -1; + + // remove old hypotheses if ( myObjHyps[ dim ][ hypType ].count() > 0 ) + { anOldHypIndex = find( myObjHyps[ dim ][ hypType ].first(), myExistingHyps[ dim ][ hypType ] ); - if ( aNewHypIndex != anOldHypIndex ) - { - // remove old hypotheses - if ( anOldHypIndex >= 0 ) { - SMESH::RemoveHypothesisOrAlgorithmOnMesh( - pObj, myExistingHyps[ dim ][ hypType ][ anOldHypIndex ] ); + if ( aNewHypIndex != anOldHypIndex || // different hyps + anOldHypIndex == -1 ) // hyps of different algos + { + SMESH::RemoveHypothesisOrAlgorithmOnMesh + ( pObj, myObjHyps[ dim ][ hypType ].first() ); myObjHyps[ dim ][ hypType ].clear(); } + } - // assign new hypotheses - if ( aNewHypIndex != -1 ) + // assign new hypotheses + if ( aNewHypIndex != anOldHypIndex && aNewHypIndex != -1 ) + { + SMESH::SMESH_Mesh_var aMeshVar = + SMESH::SMESH_Mesh::_narrow( _CAST(SObject,pObj)->GetObject() ); + bool isMesh = !aMeshVar->_is_nil(); + if ( isMesh ) { - SMESH::SMESH_Mesh_var aMeshVar = - SMESH::SMESH_Mesh::_narrow( _CAST(SObject,pObj)->GetObject() ); - bool isMesh = !aMeshVar->_is_nil(); - if ( isMesh ) - { - SMESH::AddHypothesisOnMesh( - aMeshVar, myExistingHyps[ dim ][ hypType ][ aNewHypIndex ] ); - } - else - { - SMESH::SMESH_subMesh_var aVar = - SMESH::SMESH_subMesh::_narrow( _CAST(SObject,pObj)->GetObject() ); - if ( !aVar->_is_nil() ) - SMESH::AddHypothesisOnSubMesh( - aVar, myExistingHyps[ dim ][ hypType ][ aNewHypIndex ] ); - } + SMESH::AddHypothesisOnMesh + (aMeshVar, myExistingHyps[ dim ][ hypType ][ aNewHypIndex ] ); + } + else + { + SMESH::SMESH_subMesh_var aVar = + SMESH::SMESH_subMesh::_narrow( _CAST(SObject,pObj)->GetObject() ); + if ( !aVar->_is_nil() ) + SMESH::AddHypothesisOnSubMesh + ( aVar, myExistingHyps[ dim ][ hypType ][ aNewHypIndex ] ); } - // reread all hypotheses of mesh if necessary - QStringList anExisting; - existingHyps( dim, hypType, pObj, anExisting, myObjHyps[ dim ][ hypType ] ); } + // reread all hypotheses of mesh if necessary + QStringList anExisting; + existingHyps( dim, hypType, pObj, anExisting, myObjHyps[ dim ][ hypType ] ); } } @@ -1763,6 +1864,7 @@ void SMESHGUI_MeshOp::onGeomSelectionByMesh( bool theByMesh ) void SMESHGUI_MeshOp::onPublishShapeByMeshDlg(SUIT_Operation* op) { if ( myShapeByMeshOp == op ) { + SMESHGUI::GetSMESHGUI()->getApp()->updateObjectBrowser(); //MZN: 24.11.2006 IPAL13980 - Object Browser update added myDlg->show(); // Select a found geometry object GEOM::GEOM_Object_var aGeomVar = myShapeByMeshOp->GetShape(); diff --git a/src/SMESHGUI/SMESHGUI_MeshOp.h b/src/SMESHGUI/SMESHGUI_MeshOp.h index cc7bae75c..3155a52cc 100644 --- a/src/SMESHGUI/SMESHGUI_MeshOp.h +++ b/src/SMESHGUI/SMESHGUI_MeshOp.h @@ -32,6 +32,8 @@ #ifndef SMESHGUI_MeshOp_H #define SMESHGUI_MeshOp_H +#include "SMESH_SMESHGUI.hxx" + #include "SMESHGUI_SelectionOp.h" #include @@ -48,7 +50,7 @@ class HypothesisData; * * This operation is used for mech creation or editing. */ -class SMESHGUI_MeshOp : public SMESHGUI_SelectionOp +class SMESHGUI_EXPORT SMESHGUI_MeshOp : public SMESHGUI_SelectionOp { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx index 9184f68b5..8d72e0ede 100755 --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.cxx @@ -498,9 +498,15 @@ void SMESHGUI_MeshPatternDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h index 080be328c..d0eab7c59 100755 --- a/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h +++ b/src/SMESHGUI/SMESHGUI_MeshPatternDlg.h @@ -27,6 +27,8 @@ #ifndef SMESHGUI_MeshPatternDlg_H #define SMESHGUI_MeshPatternDlg_H +#include "SMESH_SMESHGUI.hxx" + #include // IDL Headers @@ -60,7 +62,7 @@ class SMESHGUI; Description : Dialog to specify filters for VTK viewer */ -class SMESHGUI_MeshPatternDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_MeshPatternDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_MeshUtils.h b/src/SMESHGUI/SMESHGUI_MeshUtils.h index 15a2b5472..81cdb67c1 100644 --- a/src/SMESHGUI/SMESHGUI_MeshUtils.h +++ b/src/SMESHGUI/SMESHGUI_MeshUtils.h @@ -20,6 +20,8 @@ #ifndef SMESHGUI_MeshUtils_HeaderFile #define SMESHGUI_MeshUtils_HeaderFile +#include "SMESH_SMESHGUI.hxx" + #include "SALOME_InteractiveObject.hxx" #include "SALOMEconfig.h" @@ -28,6 +30,7 @@ namespace SMESH{ +SMESHGUI_EXPORT SMESH_Mesh_var GetMeshByIO(const Handle(SALOME_InteractiveObject)& theIO); } diff --git a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx index 4fc7e997b..46c575dd2 100644 --- a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.cxx @@ -349,9 +349,15 @@ void SMESHGUI_MoveNodesDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.h b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.h index 67430a579..ffb43e939 100644 --- a/src/SMESHGUI/SMESHGUI_MoveNodesDlg.h +++ b/src/SMESHGUI/SMESHGUI_MoveNodesDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_MOVE_NODES_H #define DIALOGBOX_MOVE_NODES_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" #include @@ -49,7 +51,7 @@ class SVTK_ViewWindow; // class : SMESHGUI_MoveNodesDlg // purpose : //================================================================================= -class SMESHGUI_MoveNodesDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_MoveNodesDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx index cb631f0be..8ef34e62a 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.cxx @@ -490,9 +490,15 @@ void SMESHGUI_MultiEditDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h index 8bcf3928a..4842e4c7b 100755 --- a/src/SMESHGUI/SMESHGUI_MultiEditDlg.h +++ b/src/SMESHGUI/SMESHGUI_MultiEditDlg.h @@ -27,6 +27,8 @@ #ifndef SMESHGUI_MultiEditDlg_H #define SMESHGUI_MultiEditDlg_H +#include "SMESH_SMESHGUI.hxx" + #include #include "SUIT_SelectionFilter.h" @@ -64,7 +66,7 @@ class QButtonGroup; * union of two neighboring triangles */ -class SMESHGUI_MultiEditDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_MultiEditDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx index 8a1a13e23..c76153065 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.cxx @@ -153,7 +153,7 @@ namespace SMESH { aCellLocationsArray->SetNumberOfTuples(1); aCells->InitTraversal(); - vtkIdType npts; + vtkIdType npts = 0; aCellLocationsArray->SetValue(0, aCells->GetTraversalLocation(npts)); aGrid->SetCells(aCellTypesArray, aCellLocationsArray, aCells); @@ -493,9 +493,15 @@ void SMESHGUI_NodesDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_NodesDlg.h b/src/SMESHGUI/SMESHGUI_NodesDlg.h index 5375da62e..13e62a793 100644 --- a/src/SMESHGUI/SMESHGUI_NodesDlg.h +++ b/src/SMESHGUI/SMESHGUI_NodesDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_NODES_H #define DIALOGBOX_NODES_H +#include "SMESH_SMESHGUI.hxx" + #include #include @@ -61,7 +63,7 @@ namespace SMESH{ // class : SMESHGUI_NodesDlg // purpose : //================================================================================= -class SMESHGUI_NodesDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_NodesDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_Operation.cxx b/src/SMESHGUI/SMESHGUI_Operation.cxx index 8b62c6323..95c3c5ce1 100755 --- a/src/SMESHGUI/SMESHGUI_Operation.cxx +++ b/src/SMESHGUI/SMESHGUI_Operation.cxx @@ -187,9 +187,15 @@ void SMESHGUI_Operation::onHelp() if (app) app->onHelpContextModule(getSMESHGUI() ? app->moduleName(getSMESHGUI()->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_Operation.h b/src/SMESHGUI/SMESHGUI_Operation.h index 398f1f8d0..4b3aeaf96 100755 --- a/src/SMESHGUI/SMESHGUI_Operation.h +++ b/src/SMESHGUI/SMESHGUI_Operation.h @@ -26,6 +26,8 @@ #ifndef SMESHGUI_Operation_H #define SMESHGUI_Operation_H +#include "SMESH_SMESHGUI.hxx" + #include #include @@ -36,7 +38,7 @@ class SMESHGUI; Description : Base class for all SMESH operations */ -class SMESHGUI_Operation : public LightApp_Operation +class SMESHGUI_EXPORT SMESHGUI_Operation : public LightApp_Operation { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_PatternUtils.h b/src/SMESHGUI/SMESHGUI_PatternUtils.h index 1dae6288a..b466a4b47 100644 --- a/src/SMESHGUI/SMESHGUI_PatternUtils.h +++ b/src/SMESHGUI/SMESHGUI_PatternUtils.h @@ -20,12 +20,15 @@ #ifndef SMESHGUI_PatternUtils_HeaderFile #define SMESHGUI_PatternUtils_HeaderFile +#include "SMESH_SMESHGUI.hxx" + #include "SALOMEconfig.h" #include CORBA_SERVER_HEADER(SMESH_Pattern) namespace SMESH{ +SMESHGUI_EXPORT SMESH::SMESH_Pattern_var GetPattern(); } diff --git a/src/SMESHGUI/SMESHGUI_PatternWidget.h b/src/SMESHGUI/SMESHGUI_PatternWidget.h index 784a16260..69e66917b 100644 --- a/src/SMESHGUI/SMESHGUI_PatternWidget.h +++ b/src/SMESHGUI/SMESHGUI_PatternWidget.h @@ -29,6 +29,8 @@ #ifndef WIDGET_PATTERN_H #define WIDGET_PATTERN_H +#include "SMESH_SMESHGUI.hxx" + #include #include @@ -45,7 +47,7 @@ class QPoint; // class : SMESHGUI_PatternWidget // purpose : //================================================================================= -class SMESHGUI_PatternWidget : public QFrame +class SMESHGUI_EXPORT SMESHGUI_PatternWidget : public QFrame { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_PrecisionDlg.h b/src/SMESHGUI/SMESHGUI_PrecisionDlg.h new file mode 100755 index 000000000..e033ec438 --- /dev/null +++ b/src/SMESHGUI/SMESHGUI_PrecisionDlg.h @@ -0,0 +1,99 @@ +// SMESH SMESHGUI : GUI for SMESH component +// +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESHGUI_PrecisionDlg.h +// Author : Sergey LITONIN +// Module : SMESH + + +#ifndef SMESHGUI_PrecisionDlg_H +#define SMESHGUI_PrecisionDlg_H + +#include "SMESH_SMESHGUI.hxx" + +#include + +class QSpinBox; +class QPushButton; +class QCheckBox; +class QFrame; +class SMESHGUI; + +/* + Class : SMESHGUI_PrecisionDlg + Description : Dialog to specify precision of mesh quality controls +*/ + +class SMESHGUI_EXPORT SMESHGUI_PrecisionDlg : public QDialog +{ + Q_OBJECT + +public: + SMESHGUI_PrecisionDlg( SMESHGUI* ); + + virtual ~SMESHGUI_PrecisionDlg(); + + void Init(); + +private slots: + + void onOk(); + void onClose(); + void onNotUse(); + +private: + + QFrame* createButtonFrame( QWidget* ); + QFrame* createMainFrame( QWidget* ); + void closeEvent( QCloseEvent* ); + +private: + SMESHGUI* mySMESHGUI; + QSpinBox* mySpinBox; + QPushButton* myOKBtn; + QPushButton* myCancelBtn; + QCheckBox* myNotUseChk; + +}; + +#endif + + + + + + + + + + + + + + + + + + + + diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h b/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h index 83d2dbaa6..850dde89a 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h +++ b/src/SMESHGUI/SMESHGUI_Preferences_ColorDlg.h @@ -29,6 +29,8 @@ #ifndef SMESHGUI_PREFERENCES_COLORDLG_H #define SMESHGUI_PREFERENCES_COLORDLG_H +#include "SMESH_SMESHGUI.hxx" + // SALOME Includes //#include "SUIT_Config.h" //#include "SUIT_Settings.h" @@ -48,7 +50,7 @@ class QSpinBox; class QColor; class SMESHGUI; -class SMESHGUI_Preferences_ColorDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_Preferences_ColorDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h index 1e4c8cbe2..78950f7cd 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h +++ b/src/SMESHGUI/SMESHGUI_Preferences_ScalarBarDlg.h @@ -29,6 +29,8 @@ #ifndef SMESHGUI_PREFERENCES_SCALARBARDLG_H #define SMESHGUI_PREFERENCES_SCALARBARDLG_H +#include "SMESH_SMESHGUI.hxx" + #include class QButtonGroup; @@ -49,7 +51,7 @@ class LightApp_SelectionMgr; class SMESH_Actor; -class SMESHGUI_Preferences_ScalarBarDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_Preferences_ScalarBarDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.h b/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.h index b3326bfa4..96715d782 100644 --- a/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.h +++ b/src/SMESHGUI/SMESHGUI_Preferences_SelectionDlg.h @@ -29,6 +29,8 @@ #ifndef SMESHGUI_PREFERENCES_SELECTIONDLG_H #define SMESHGUI_PREFERENCES_SELECTIONDLG_H +#include "SMESH_SMESHGUI.hxx" + // QT Includes #include @@ -40,7 +42,7 @@ class QSpinBox; class QColor; class SMESHGUI; -class SMESHGUI_LineEdit : public QLineEdit +class SMESHGUI_EXPORT SMESHGUI_LineEdit : public QLineEdit { Q_OBJECT @@ -54,7 +56,7 @@ class SMESHGUI_LineEdit : public QLineEdit void focusOutEvent(QFocusEvent* e); }; -class SMESHGUI_DoubleValidator : public QDoubleValidator +class SMESHGUI_EXPORT SMESHGUI_DoubleValidator : public QDoubleValidator { Q_OBJECT @@ -68,7 +70,7 @@ class SMESHGUI_DoubleValidator : public QDoubleValidator void fixup(QString& text) const; }; -class SMESHGUI_Preferences_SelectionDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_Preferences_SelectionDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx index 0df620a02..a54ac738d 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.cxx @@ -316,9 +316,15 @@ void SMESHGUI_RemoveElementsDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h index e6a48a7be..d4f2a90ed 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h +++ b/src/SMESHGUI/SMESHGUI_RemoveElementsDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_REMOVE_ELEMENTS_H #define DIALOGBOX_REMOVE_ELEMENTS_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" // QT Includes @@ -58,7 +60,7 @@ class SVTK_ViewWindow; // class : SMESHGUI_RemoveElementsDlg // purpose : //================================================================================= -class SMESHGUI_RemoveElementsDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_RemoveElementsDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx index 8625125dd..c34fed723 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.cxx @@ -315,9 +315,15 @@ void SMESHGUI_RemoveNodesDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h index 7f8c243e0..add873a3a 100644 --- a/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h +++ b/src/SMESHGUI/SMESHGUI_RemoveNodesDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_REMOVE_NODES_H #define DIALOGBOX_REMOVE_NODES_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" // QT Includes @@ -61,7 +63,7 @@ class SVTK_ViewWindow; // class : SMESHGUI_RemoveNodesDlg // purpose : //================================================================================= -class SMESHGUI_RemoveNodesDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_RemoveNodesDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx index 9992b49fc..cc8c5013c 100644 --- a/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RenumberingDlg.cxx @@ -320,9 +320,15 @@ void SMESHGUI_RenumberingDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_RenumberingDlg.h b/src/SMESHGUI/SMESHGUI_RenumberingDlg.h index af4f836c2..80338c6bc 100644 --- a/src/SMESHGUI/SMESHGUI_RenumberingDlg.h +++ b/src/SMESHGUI/SMESHGUI_RenumberingDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_RENUMBERING_H #define DIALOGBOX_RENUMBERING_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" //#include "SMESH_TypeFilter.hxx" #include "SUIT_SelectionFilter.h" @@ -55,7 +57,7 @@ class SMESHGUI; // class : SMESHGUI_RenumberingDlg // purpose : If the unit == 0 nodes will be renumbered, if the unit == 1 the elements will. //================================================================================= -class SMESHGUI_RenumberingDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_RenumberingDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx index c5c546ade..53af86b9c 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.cxx @@ -520,9 +520,15 @@ void SMESHGUI_RevolutionDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_RevolutionDlg.h b/src/SMESHGUI/SMESHGUI_RevolutionDlg.h index 49b391e3c..9db7f4859 100644 --- a/src/SMESHGUI/SMESHGUI_RevolutionDlg.h +++ b/src/SMESHGUI/SMESHGUI_RevolutionDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_REVOLUTION_H #define DIALOGBOX_REVOLUTION_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" #include "SMESH_LogicalFilter.hxx" @@ -62,7 +64,7 @@ class SVTK_Selector; // class : SMESHGUI_RevolutionDlg // purpose : //================================================================================= -class SMESHGUI_RevolutionDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_RevolutionDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx index 7daf9f583..50fc56bce 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.cxx @@ -472,9 +472,15 @@ void SMESHGUI_RotationDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_RotationDlg.h b/src/SMESHGUI/SMESHGUI_RotationDlg.h index 921202ead..86075d763 100644 --- a/src/SMESHGUI/SMESHGUI_RotationDlg.h +++ b/src/SMESHGUI/SMESHGUI_RotationDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_ROTATION_H #define DIALOGBOX_ROTATION_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" #include "SMESH_LogicalFilter.hxx" @@ -61,7 +63,7 @@ class SVTK_Selector; // class : SMESHGUI_RotationDlg // purpose : //================================================================================= -class SMESHGUI_RotationDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_RotationDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_Selection.h b/src/SMESHGUI/SMESHGUI_Selection.h index 08d37c979..6dd5bc271 100644 --- a/src/SMESHGUI/SMESHGUI_Selection.h +++ b/src/SMESHGUI/SMESHGUI_Selection.h @@ -29,6 +29,8 @@ #ifndef SMESHGUI_SELECTION_HeaderFile #define SMESHGUI_SELECTION_HeaderFile +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_Selection.h" #include "SALOMEDSClient_definitions.hxx" @@ -37,7 +39,7 @@ class SALOMEDSClient_Study; class LightApp_DataOwner; class SMESH_Actor; -class SMESHGUI_Selection : public LightApp_Selection +class SMESHGUI_EXPORT SMESHGUI_Selection : public LightApp_Selection { public: SMESHGUI_Selection(); diff --git a/src/SMESHGUI/SMESHGUI_SelectionOp.h b/src/SMESHGUI/SMESHGUI_SelectionOp.h index c10ba7bb6..2165d14f7 100644 --- a/src/SMESHGUI/SMESHGUI_SelectionOp.h +++ b/src/SMESHGUI/SMESHGUI_SelectionOp.h @@ -27,6 +27,8 @@ #ifndef SMESHGUI_SelectionOp_H #define SMESHGUI_SelectionOp_H +#include "SMESH_SMESHGUI.hxx" + #include #include #include @@ -47,7 +49,7 @@ class SMESH_Actor; Description : Base operation for all operations using object selection in viewer or objectbrowser through common widgets created by LightApp_Dialog::createObject */ -class SMESHGUI_SelectionOp : public SMESHGUI_Operation +class SMESHGUI_EXPORT SMESHGUI_SelectionOp : public SMESHGUI_Operation { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx index 957a5c449..db218de9a 100644 --- a/src/SMESHGUI/SMESHGUI_SewingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.cxx @@ -621,9 +621,15 @@ void SMESHGUI_SewingDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_SewingDlg.h b/src/SMESHGUI/SMESHGUI_SewingDlg.h index f3ad4f808..4e96dd40d 100644 --- a/src/SMESHGUI/SMESHGUI_SewingDlg.h +++ b/src/SMESHGUI/SMESHGUI_SewingDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_SEWING_H #define DIALOGBOX_SEWING_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" // QT Includes @@ -56,7 +58,7 @@ class SVTK_Selector; // class : SMESHGUI_SewingDlg // purpose : //================================================================================= -class SMESHGUI_SewingDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_SewingDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx index ba0778195..bc0f78779 100644 --- a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.cxx @@ -70,6 +70,7 @@ #define SPACING 5 #define MARGIN 10 + enum { EDGE = 0, FACE, VOLUME }; /*! @@ -114,7 +115,10 @@ QFrame* SMESHGUI_ShapeByMeshDlg::createMainFrame (QWidget* theParent) QLabel* anIdLabel = new QLabel( aMainGrp, "element id label"); anIdLabel->setText( tr("ELEMENT_ID") ); myElementId = new QLineEdit( aMainGrp, "element id"); - myElementId->setValidator( new SMESHGUI_IdValidator( theParent, "id validator", 1 )); + if (!myIsMultipleAllowed) + myElementId->setValidator( new SMESHGUI_IdValidator( theParent, "id validator", 1 )); + else + myElementId->setValidator( new SMESHGUI_IdValidator( theParent, "id validator" )); // shape name QLabel* aNameLabel = new QLabel( aMainGrp, "geom name label"); @@ -148,12 +152,14 @@ SMESHGUI_ShapeByMeshDlg::~SMESHGUI_ShapeByMeshDlg() * Initialize operation */ //================================================================================ -SMESHGUI_ShapeByMeshOp::SMESHGUI_ShapeByMeshOp() +SMESHGUI_ShapeByMeshOp::SMESHGUI_ShapeByMeshOp(bool isMultipleAllowed): + myIsMultipleAllowed(isMultipleAllowed) { if ( GeometryGUI::GetGeomGen()->_is_nil() )// check that GEOM_Gen exists GeometryGUI::InitGeomGen(); myDlg = new SMESHGUI_ShapeByMeshDlg; + myDlg->setMultipleAllowed(myIsMultipleAllowed); connect(myDlg->myElemTypeGroup, SIGNAL(clicked(int)), SLOT(onTypeChanged(int))); connect(myDlg->myElementId, SIGNAL(textChanged(const QString&)), SLOT(onElemIdChanged(const QString&))); @@ -282,9 +288,85 @@ void SMESHGUI_ShapeByMeshOp::commitOperation() { SMESHGUI_SelectionOp::commitOperation(); try { - int elemID = myDlg->myElementId->text().toInt(); - myGeomObj = SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement - ( myMesh.in(), elemID, myDlg->myGeomName->text().latin1()); + QStringList aListId = QStringList::split( " ", myDlg->myElementId->text(), false); + if (aListId.count() == 1) + { + int elemID = (aListId.first()).toInt(); + myGeomObj = SMESHGUI::GetSMESHGen()->GetGeometryByMeshElement + ( myMesh.in(), elemID, myDlg->myGeomName->text().latin1()); + } + else + { + GEOM::GEOM_Gen_var geomGen = SMESH::GetGEOMGen(); + _PTR(Study) aStudy = SMESH::GetActiveStudyDocument(); + + if (geomGen->_is_nil() || !aStudy) + return; + + GEOM::GEOM_IShapesOperations_var aShapesOp = + geomGen->GetIShapesOperations(aStudy->StudyId()); + if (aShapesOp->_is_nil() ) + return; + + TopAbs_ShapeEnum aGroupType = TopAbs_SHAPE; + + std::map aGeomObjectsMap; + GEOM::GEOM_Object_var aGeomObject; + + GEOM::GEOM_Object_var aMeshShape = myMesh->GetShapeToMesh(); + + for ( int i = 0; i < aListId.count(); i++ ) + { + aGeomObject = + SMESHGUI::GetSMESHGen()->FindGeometryByMeshElement(myMesh.in(), aListId[i].toInt()); + + if (aGeomObject->_is_nil()) continue; + + double anId = aShapesOp->GetSubShapeIndex(aMeshShape, aGeomObject); + if (aShapesOp->IsDone() && aGeomObjectsMap.find(anId) == aGeomObjectsMap.end()) + { + aGeomObjectsMap[anId] = aGeomObject; + + TopAbs_ShapeEnum aSubShapeType = (TopAbs_ShapeEnum)aGeomObject->GetShapeType(); + if (i == 0) + aGroupType = aSubShapeType; + else if (aSubShapeType != aGroupType) + aGroupType = TopAbs_SHAPE; + } + } + + int aNumberOfGO = aGeomObjectsMap.size(); + if (aNumberOfGO == 1) + myGeomObj = (*aGeomObjectsMap.begin()).second; + else if (aNumberOfGO > 1) + { + GEOM::GEOM_IGroupOperations_var aGroupOp = + geomGen->GetIGroupOperations(aStudy->StudyId()); + if(aGroupOp->_is_nil()) + return; + + GEOM::ListOfGO_var aGeomObjects = new GEOM::ListOfGO(); + aGeomObjects->length( aNumberOfGO ); + + int i = 0; + std::map::iterator anIter; + for (anIter = aGeomObjectsMap.begin(); anIter!=aGeomObjectsMap.end(); anIter++) + aGeomObjects[i++] = (*anIter).second; + + //create geometry group + myGeomObj = aGroupOp->CreateGroup(aMeshShape, aGroupType); + aGroupOp->UnionList(myGeomObj, aGeomObjects); + + if (!aGroupOp->IsDone()) + return; + } + + // publish the GEOM object in study + QString aNewGeomGroupName ( myDlg->myGeomName->text().latin1() ); + + SALOMEDS::SObject_var aNewGroupSO = + geomGen->AddInStudy(SMESHGUI::GetSMESHGen()->GetCurrentStudy(), myGeomObj, aNewGeomGroupName, aMeshShape); + } } catch (const SALOME::SALOME_Exception& S_ex) { SalomeApp_Tools::QtCatchCorbaException(S_ex); @@ -306,7 +388,7 @@ void SMESHGUI_ShapeByMeshOp::onSelectionDone() try { SALOME_ListIO aList; selectionMgr()->selectedObjects(aList, SVTK_Viewer::Type()); - if (aList.Extent() != 1) + if (!myIsMultipleAllowed && aList.Extent() != 1) return; SMESH::SMESH_Mesh_var aMesh = SMESH::GetMeshByIO(aList.First()); @@ -316,7 +398,9 @@ void SMESHGUI_ShapeByMeshOp::onSelectionDone() QString aString; int nbElems = SMESH::GetNameOfSelectedElements(selector(),//myViewWindow->GetSelector(), aList.First(), aString); - if ( nbElems == 1 ) { + if (nbElems > 0) { + if (!myIsMultipleAllowed && nbElems != 1 ) + return; setElementID( aString ); myDlg->setButtonEnabled( true, QtxDialog::OK ); } @@ -392,12 +476,16 @@ void SMESHGUI_ShapeByMeshOp::onElemIdChanged(const QString& theNewText) newIndices.Add( e->GetID() ); } - if ( !newIndices.IsEmpty() && newIndices.Extent() == 1 ) - if ( SVTK_Selector* s = selector() ) { - s->AddOrRemoveIndex( actor->getIO(), newIndices, false ); - viewWindow()->highlight( actor->getIO(), true, true ); - myDlg->setButtonEnabled( true, QtxDialog::OK ); - } + if ( !newIndices.IsEmpty() ) + { + if (!myIsMultipleAllowed && newIndices.Extent() != 1) + return; + if ( SVTK_Selector* s = selector() ) { + s->AddOrRemoveIndex( actor->getIO(), newIndices, false ); + viewWindow()->highlight( actor->getIO(), true, true ); + myDlg->setButtonEnabled( true, QtxDialog::OK ); + } + } } } diff --git a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.h b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.h index cb093ff02..69d8dafc0 100644 --- a/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.h +++ b/src/SMESHGUI/SMESHGUI_ShapeByMeshDlg.h @@ -27,6 +27,8 @@ #ifndef SMESHGUI_ShapeByMeshDlg_H #define SMESHGUI_ShapeByMeshDlg_H +#include "SMESH_SMESHGUI.hxx" + #include "SMESHGUI_Dialog.h" #include "SMESHGUI_SelectionOp.h" @@ -49,7 +51,7 @@ class SMESHGUI; * by selecting mesh elements */ -class SMESHGUI_ShapeByMeshDlg : public SMESHGUI_Dialog +class SMESHGUI_EXPORT SMESHGUI_ShapeByMeshDlg : public SMESHGUI_Dialog { Q_OBJECT @@ -74,6 +76,10 @@ private: QLineEdit* myElementId; QLineEdit* myGeomName; +private: + bool myIsMultipleAllowed; + void setMultipleAllowed(bool isAllowed) {myIsMultipleAllowed = isAllowed;}; + // QPushButton* myOkBtn; // QPushButton* myCloseBtn; @@ -89,7 +95,7 @@ class SMESHGUI_ShapeByMeshOp: public SMESHGUI_SelectionOp Q_OBJECT public: - SMESHGUI_ShapeByMeshOp(); + SMESHGUI_ShapeByMeshOp(bool isMultipleAllowed = false); virtual ~SMESHGUI_ShapeByMeshOp(); virtual LightApp_Dialog* dlg() const; @@ -144,6 +150,7 @@ private: bool myIsManualIdEnter; bool myHasSolids; + bool myIsMultipleAllowed; }; #endif diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx index 2e83ac35c..ce21c9c17 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.cxx @@ -283,9 +283,15 @@ void SMESHGUI_SingleEditDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_SingleEditDlg.h b/src/SMESHGUI/SMESHGUI_SingleEditDlg.h index 853b138ce..6fa5058ad 100755 --- a/src/SMESHGUI/SMESHGUI_SingleEditDlg.h +++ b/src/SMESHGUI/SMESHGUI_SingleEditDlg.h @@ -27,6 +27,8 @@ #ifndef SMESHGUI_SingleEditDlg_H #define SMESHGUI_SingleEditDlg_H +#include "SMESH_SMESHGUI.hxx" + #include #include @@ -49,7 +51,7 @@ class LightApp_SelectionMgr; * Description : Base class for dialogs of diagonal inversion and * union of two neighboring triangles */ -class SMESHGUI_SingleEditDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_SingleEditDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx index 7ad48a6b0..6f5dc5fdc 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.cxx @@ -447,9 +447,15 @@ void SMESHGUI_SmoothingDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_SmoothingDlg.h b/src/SMESHGUI/SMESHGUI_SmoothingDlg.h index 4bf341efe..c201dfffe 100644 --- a/src/SMESHGUI/SMESHGUI_SmoothingDlg.h +++ b/src/SMESHGUI/SMESHGUI_SmoothingDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_SMOOTHING_H #define DIALOGBOX_SMOOTHING_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" #include "SMESH_LogicalFilter.hxx" @@ -62,7 +64,7 @@ class SVTK_Selector; // class : SMESHGUI_SmoothingDlg // purpose : //================================================================================= -class SMESHGUI_SmoothingDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_SmoothingDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_SpinBox.h b/src/SMESHGUI/SMESHGUI_SpinBox.h index 576db9221..cc5c99689 100644 --- a/src/SMESHGUI/SMESHGUI_SpinBox.h +++ b/src/SMESHGUI/SMESHGUI_SpinBox.h @@ -29,6 +29,8 @@ #ifndef SMESH_SPINBOX_H #define SMESH_SPINBOX_H +#include "SMESH_SMESHGUI.hxx" + #include // like in GEOM_SRC/src/DlgRef/DlgRef_SpinBox.h @@ -39,7 +41,7 @@ // class : SMESHGUI_SpinBox // purpose : Derivated from QtxDblSpinBox class //================================================================================= -class SMESHGUI_SpinBox : public QtxDblSpinBox +class SMESHGUI_EXPORT SMESHGUI_SpinBox : public QtxDblSpinBox { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx index 89155d209..5fffc787e 100644 --- a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.cxx @@ -461,9 +461,15 @@ void SMESHGUI_StandardMeshInfosDlg::onHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.h b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.h index 204fe0133..586593d4d 100644 --- a/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.h +++ b/src/SMESHGUI/SMESHGUI_StandardMeshInfosDlg.h @@ -29,6 +29,8 @@ #ifndef SMESHGUI_STANDARDMESHINFOSDLG_H #define SMESHGUI_STANDARDMESHINFOSDLG_H +#include "SMESH_SMESHGUI.hxx" + //#include "SMESH_TypeFilter.hxx" #include "SUIT_SelectionFilter.h" @@ -44,7 +46,7 @@ class LightApp_SelectionMgr; class SMESHGUI; -class SMESHGUI_StandardMeshInfosDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_StandardMeshInfosDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_Swig.cxx b/src/SMESHGUI/SMESHGUI_Swig.cxx index ed71b6d43..c1912cab2 100644 --- a/src/SMESHGUI/SMESHGUI_Swig.cxx +++ b/src/SMESHGUI/SMESHGUI_Swig.cxx @@ -34,10 +34,13 @@ #include "SMESHGUI.h" #include "SMESHGUI_Utils.h" #include "SMESHGUI_GEOMGenUtils.h" +#include "SMESHGUI_Displayer.h" // SALOME Includes #include "SUIT_ResourceMgr.h" #include "SUIT_Session.h" +#include "SUIT_ViewModel.h" +#include "VTKViewer_ViewModel.h" #include "SALOME_Event.hxx" #include "SALOME_NamingService.hxx" @@ -584,6 +587,27 @@ SMESH_Swig::AddSubMeshOnShape(const char* theMeshEntry, void SMESH_Swig::CreateAndDisplayActor( const char* Mesh_Entry ) { // SMESH_Actor* Mesh = smeshGUI->ReadScript(aM); + class TEvent: public SALOME_Event + { + private: + const char* _entry; + public: + TEvent(const char* Mesh_Entry) { + _entry = Mesh_Entry; + } + virtual void Execute() { + //SMESH::UpdateView(SMESH::eDisplay, _entry); + SUIT_Session* aSession = SUIT_Session::session(); + SUIT_Application* anApplication = aSession->activeApplication(); + SalomeApp_Application* anApp = dynamic_cast(anApplication); + SUIT_ViewManager* vman = anApp->getViewManager(VTKViewer_Viewer::Type(),true); + SMESHGUI_Displayer* aDisp = new SMESHGUI_Displayer(anApp); + aDisp->Display(_entry,1); + } + }; + + ProcessVoidEvent(new TEvent(Mesh_Entry)); + } void diff --git a/src/SMESHGUI/SMESHGUI_Swig.hxx b/src/SMESHGUI/SMESHGUI_Swig.hxx index 433f3c862..3b7e69e73 100644 --- a/src/SMESHGUI/SMESHGUI_Swig.hxx +++ b/src/SMESHGUI/SMESHGUI_Swig.hxx @@ -29,12 +29,14 @@ #ifndef _SMESHGUI_SWIG_HXX_ #define _SMESHGUI_SWIG_HXX_ +#include "SMESH_SMESHGUI.hxx" + // IDL Headers #include #include CORBA_SERVER_HEADER(SALOMEDS) #include CORBA_SERVER_HEADER(SALOMEDS_Attributes) -class SMESH_Swig +class SMESHGUI_EXPORT SMESH_Swig { public: SMESH_Swig(); diff --git a/src/SMESHGUI/SMESHGUI_Swig.i b/src/SMESHGUI/SMESHGUI_Swig.i index 8172991a8..1a7c393fa 100644 --- a/src/SMESHGUI/SMESHGUI_Swig.i +++ b/src/SMESHGUI/SMESHGUI_Swig.i @@ -74,4 +74,6 @@ class SMESH_Swig void SetName(const char* Entry, const char* Name); void SetMeshIcon(const char* Mesh_Entry, const bool isComputed); + + void CreateAndDisplayActor( const char* Mesh_Entry ); }; diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx index 07aa3d4bc..920fb06a9 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.cxx @@ -536,9 +536,15 @@ void SMESHGUI_SymmetryDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_SymmetryDlg.h b/src/SMESHGUI/SMESHGUI_SymmetryDlg.h index 07a54ffd2..a4c00e3b6 100644 --- a/src/SMESHGUI/SMESHGUI_SymmetryDlg.h +++ b/src/SMESHGUI/SMESHGUI_SymmetryDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_SYMMETRY_H #define DIALOGBOX_SYMMETRY_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" #include "SMESH_LogicalFilter.hxx" @@ -60,7 +62,7 @@ class SVTK_Selector; // class : SMESHGUI_SymmetryDlg // purpose : //================================================================================= -class SMESHGUI_SymmetryDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_SymmetryDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx index 499f43ff5..efaaa78fb 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.cxx @@ -498,9 +498,15 @@ void SMESHGUI_TranslationDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_TranslationDlg.h b/src/SMESHGUI/SMESHGUI_TranslationDlg.h index 66330d4b7..a70f780ae 100644 --- a/src/SMESHGUI/SMESHGUI_TranslationDlg.h +++ b/src/SMESHGUI/SMESHGUI_TranslationDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_TRANSLATION_H #define DIALOGBOX_TRANSLATION_H +#include "SMESH_SMESHGUI.hxx" + #include "LightApp_SelectionMgr.h" #include "SMESH_LogicalFilter.hxx" @@ -59,7 +61,7 @@ class SVTK_Selector; // class : SMESHGUI_TranslationDlg // purpose : //================================================================================= -class SMESHGUI_TranslationDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_TranslationDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx b/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx index 6dc08f4d2..d5c684d39 100644 --- a/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx +++ b/src/SMESHGUI/SMESHGUI_TransparencyDlg.cxx @@ -189,9 +189,15 @@ void SMESHGUI_TransparencyDlg::ClickOnHelp() if (app) app->onHelpContextModule(mySMESHGUI ? app->moduleName(mySMESHGUI->moduleName()) : QString(""), myHelpFileName); else { + QString platform; +#ifdef WIN32 + platform = "winapplication"; +#else + platform = "application"; +#endif SUIT_MessageBox::warn1(0, QObject::tr("WRN_WARNING"), QObject::tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE"). - arg(app->resourceMgr()->stringValue("ExternalBrowser", "application")).arg(myHelpFileName), + arg(app->resourceMgr()->stringValue("ExternalBrowser", platform)).arg(myHelpFileName), QObject::tr("BUT_OK")); } } diff --git a/src/SMESHGUI/SMESHGUI_TransparencyDlg.h b/src/SMESHGUI/SMESHGUI_TransparencyDlg.h index e7e8b5f5a..0968e062b 100644 --- a/src/SMESHGUI/SMESHGUI_TransparencyDlg.h +++ b/src/SMESHGUI/SMESHGUI_TransparencyDlg.h @@ -29,6 +29,8 @@ #ifndef DIALOGBOX_TRANSPARENCYDLG_H #define DIALOGBOX_TRANSPARENCYDLG_H +#include "SMESH_SMESHGUI.hxx" + // QT Includes #include @@ -44,7 +46,7 @@ class SMESHGUI; // class : SMESHGUI_TransparencyDlg // purpose : //================================================================================= -class SMESHGUI_TransparencyDlg : public QDialog +class SMESHGUI_EXPORT SMESHGUI_TransparencyDlg : public QDialog { Q_OBJECT diff --git a/src/SMESHGUI/SMESHGUI_Utils.h b/src/SMESHGUI/SMESHGUI_Utils.h index 12704ef19..d4c973f14 100644 --- a/src/SMESHGUI/SMESHGUI_Utils.h +++ b/src/SMESHGUI/SMESHGUI_Utils.h @@ -20,7 +20,9 @@ #ifndef SMESHGUI_Utils_HeaderFile #define SMESHGUI_Utils_HeaderFile -#include +#include "SMESH_SMESHGUI.hxx" + +#include #include "SALOMEDSClient_definitions.hxx" #include "SALOME_InteractiveObject.hxx" @@ -44,21 +46,27 @@ class LightApp_SelectionMgr; namespace SMESH { +SMESHGUI_EXPORT SUIT_Desktop* GetDesktop(const CAM_Module* theModule); +SMESHGUI_EXPORT LightApp_SelectionMgr* GetSelectionMgr(const SalomeApp_Module* theModule); +SMESHGUI_EXPORT SalomeApp_Study* GetAppStudy(const CAM_Module* theModule); +SMESHGUI_EXPORT SUIT_ResourceMgr* GetResourceMgr( const SalomeApp_Module* ); +SMESHGUI_EXPORT _PTR(Study) GetCStudy(const SalomeApp_Study* theStudy); +SMESHGUI_EXPORT CORBA::Object_var DataOwnerToObject(const LightApp_DataOwnerPtr& theOwner); template typename TInterface::_var_type @@ -71,22 +79,31 @@ namespace SMESH { } +SMESHGUI_EXPORT SUIT_Study* GetActiveStudy(); +SMESHGUI_EXPORT SUIT_ViewWindow* GetActiveWindow(); +SMESHGUI_EXPORT _PTR(Study) GetActiveStudyDocument(); +SMESHGUI_EXPORT _PTR(SObject) FindSObject(CORBA::Object_ptr theObject); +SMESHGUI_EXPORT void SetName (_PTR(SObject) theSObject, const char* theName); + +SMESHGUI_EXPORT void SetValue (_PTR(SObject) theSObject, const char* theValue); void setFileType (_PTR(SObject) theSObject, const char* theValue); void setFileName (_PTR(SObject) theSObject, const char* theValue); +SMESHGUI_EXPORT CORBA::Object_var SObjectToObject (_PTR(SObject) theSObject, _PTR(Study) theStudy); +SMESHGUI_EXPORT CORBA::Object_var SObjectToObject(_PTR(SObject) theSObject); template typename TInterface::_var_type @@ -98,6 +115,7 @@ namespace SMESH { return TInterface::_nil(); } +SMESHGUI_EXPORT CORBA::Object_var IObjectToObject(const Handle(SALOME_InteractiveObject)& theIO); template typename TInterface::_var_type @@ -109,6 +127,7 @@ namespace SMESH { return TInterface::_nil(); } +SMESHGUI_EXPORT CORBA::Object_var IORToObject(const char* theIOR); template typename TInterface::_var_type @@ -120,10 +139,13 @@ namespace SMESH { return TInterface::_nil(); } +SMESHGUI_EXPORT int GetNameOfSelectedIObjects (LightApp_SelectionMgr*, QString& theName); +SMESHGUI_EXPORT _PTR(SObject) GetMeshOrSubmesh (_PTR(SObject) theSObject); +SMESHGUI_EXPORT void ModifiedMesh (_PTR(SObject) theSObject, bool theIsRight); // void UpdateObjBrowser (bool); diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx index 4e5c883c1..16eecc696 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.cxx +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.cxx @@ -336,6 +336,7 @@ namespace SMESH{ case eDisplay: case eDisplayOnly: anActor->SetVisibility(true); + if (theAction == eDisplayOnly) aRenderer->ResetCameraClippingRange(); break; case eErase: anActor->SetVisibility(false); diff --git a/src/SMESHGUI/SMESHGUI_VTKUtils.h b/src/SMESHGUI/SMESHGUI_VTKUtils.h index db98b5674..74b383c71 100644 --- a/src/SMESHGUI/SMESHGUI_VTKUtils.h +++ b/src/SMESHGUI/SMESHGUI_VTKUtils.h @@ -20,6 +20,8 @@ #ifndef SMESHGUI_VTKUtils_HeaderFile #define SMESHGUI_VTKUtils_HeaderFile +#include "SMESH_SMESHGUI.hxx" + class QString; class vtkRenderer; class TColStd_IndexedMapOfInteger; @@ -40,7 +42,7 @@ class SVTK_Selector; class LightApp_SelectionMgr; class SMESHGUI; -#include +#include #include "SALOMEconfig.h" #include CORBA_CLIENT_HEADER(SALOMEDS) @@ -58,121 +60,162 @@ namespace SMESH{ //---------------------------------------------------------------------------- typedef pair TKeyOfVisualObj; +SMESHGUI_EXPORT TVisualObjPtr GetVisualObj(int theStudyId, const char* theEntry); //---------------------------------------------------------------------------- +SMESHGUI_EXPORT SVTK_ViewWindow* GetViewWindow(const SalomeApp_Module* theModule); +SMESHGUI_EXPORT SUIT_ViewWindow* GetActiveWindow(); +SMESHGUI_EXPORT SVTK_ViewWindow* FindVtkViewWindow( SUIT_ViewManager*, SUIT_ViewWindow* ); +SMESHGUI_EXPORT SVTK_ViewWindow* GetVtkViewWindow( SUIT_ViewWindow* ); +SMESHGUI_EXPORT SVTK_ViewWindow* GetCurrentVtkView(); +SMESHGUI_EXPORT void RepaintViewWindow(SVTK_ViewWindow*); +SMESHGUI_EXPORT void RenderViewWindow(SVTK_ViewWindow*); //---------------------------------------------------------------------------- +SMESHGUI_EXPORT SMESH_Actor* FindActorByEntry (SUIT_ViewWindow*, const char* theEntry); +SMESHGUI_EXPORT SMESH_Actor* FindActorByEntry (const char* theEntry); +SMESHGUI_EXPORT SMESH_Actor* FindActorByObject (CORBA::Object_ptr theObject); //---------------------------------------------------------------------------- +SMESHGUI_EXPORT SMESH_Actor* CreateActor (_PTR(Study), const char*, int = false); +SMESHGUI_EXPORT void DisplayActor (SUIT_ViewWindow*, SMESH_Actor* theActor); +SMESHGUI_EXPORT void RemoveActor (SUIT_ViewWindow*, SMESH_Actor* theActor); //---------------------------------------------------------------------------- enum EDisplaing {eDisplayAll, eDisplay, eDisplayOnly, eErase, eEraseAll}; +SMESHGUI_EXPORT void UpdateView (SUIT_ViewWindow*, EDisplaing theAction, const char* theEntry = ""); +SMESHGUI_EXPORT void UpdateView (EDisplaing theAction, const char* theEntry = ""); +SMESHGUI_EXPORT void UpdateView(); +SMESHGUI_EXPORT void Update(const Handle(SALOME_InteractiveObject)& theIO, bool theDisplay); //---------------------------------------------------------------------------- +SMESHGUI_EXPORT void FitAll(); +SMESHGUI_EXPORT void RepaintCurrentView(); +SMESHGUI_EXPORT vtkRenderer* GetCurrentRenderer(); //---------------------------------------------------------------------------- +SMESHGUI_EXPORT void SetPointRepresentation(bool theIsVisible); +SMESHGUI_EXPORT void SetPickable(SMESH_Actor* theActor = NULL); +SMESHGUI_EXPORT void UpdateSelectionProp( SMESHGUI* ); //---------------------------------------------------------------------------- +SMESHGUI_EXPORT SVTK_Selector* GetSelector(SUIT_ViewWindow* = GetActiveWindow()); +SMESHGUI_EXPORT void SetFilter (const Handle(VTKViewer_Filter)& theFilter, SVTK_Selector* theSelector = GetSelector()); +SMESHGUI_EXPORT Handle(VTKViewer_Filter) GetFilter (int theId, SVTK_Selector* theSelector = GetSelector()); +SMESHGUI_EXPORT bool IsFilterPresent (int theId, SVTK_Selector* theSelector = GetSelector()); +SMESHGUI_EXPORT void RemoveFilter (int theId, SVTK_Selector* theSelector = GetSelector()); +SMESHGUI_EXPORT void RemoveFilters (SVTK_Selector* theSelector = GetSelector()); +SMESHGUI_EXPORT bool IsValid (SALOME_Actor* theActor, int theCellId, SVTK_Selector* theSelector = GetSelector()); //---------------------------------------------------------------------------- +SMESHGUI_EXPORT int GetNameOfSelectedNodes(SVTK_Selector* theSelector, const Handle(SALOME_InteractiveObject)& theIO, QString& theName); +SMESHGUI_EXPORT int GetNameOfSelectedElements(SVTK_Selector* theSelector, const Handle(SALOME_InteractiveObject)& theIO, QString& theName); +SMESHGUI_EXPORT int GetEdgeNodes(SVTK_Selector* theSelector, const TVisualObjPtr& theVisualObj, int& theId1, int& theId2); //---------------------------------------------------------------------------- +SMESHGUI_EXPORT int GetNameOfSelectedNodes (LightApp_SelectionMgr*, const Handle(SALOME_InteractiveObject)& theIO, QString& theName); +SMESHGUI_EXPORT int GetNameOfSelectedNodes (LightApp_SelectionMgr*, QString& aName); +SMESHGUI_EXPORT int GetNameOfSelectedElements (LightApp_SelectionMgr*, const Handle(SALOME_InteractiveObject)& theIO, QString& theName); +SMESHGUI_EXPORT int GetNameOfSelectedElements (LightApp_SelectionMgr*, QString& aName); +SMESHGUI_EXPORT int GetSelected (LightApp_SelectionMgr*, TColStd_IndexedMapOfInteger& theMap, const bool theIsElement = true ); +SMESHGUI_EXPORT int GetEdgeNodes (LightApp_SelectionMgr*, int& theId1, int& theId2); +SMESHGUI_EXPORT void SetControlsPrecision (const long theVal); }; diff --git a/src/SMESHGUI/SMESHGUI_XmlHandler.cxx b/src/SMESHGUI/SMESHGUI_XmlHandler.cxx index e1e4d0dc7..2c6065cee 100644 --- a/src/SMESHGUI/SMESHGUI_XmlHandler.cxx +++ b/src/SMESHGUI/SMESHGUI_XmlHandler.cxx @@ -90,6 +90,21 @@ bool SMESHGUI_XmlHandler::startElement (const QString&, const QString&, myPluginName = atts.value("name"); myServerLib = atts.value("server-lib"); myClientLib = atts.value("gui-lib"); +/* It's Need to tranlate lib name for WIN32 or X platform + * (only client lib, because server lib translates in SMESH_Gen_i::createHypothesis + * for normal work of *.py files ) + */ + if( !myClientLib.isEmpty() ) + { +#ifdef WNT + //myServerLib += ".dll"; + myClientLib += ".dll"; +#else + //myServerLib = "lib" + myServerLib + ".so"; + myClientLib = "lib" + myClientLib + ".so"; +#endif + } + QString aResName = atts.value("resources"); if (aResName != "") diff --git a/src/SMESHGUI/SMESHGUI_XmlHandler.h b/src/SMESHGUI/SMESHGUI_XmlHandler.h index 79ad43b38..b71f59e58 100644 --- a/src/SMESHGUI/SMESHGUI_XmlHandler.h +++ b/src/SMESHGUI/SMESHGUI_XmlHandler.h @@ -28,13 +28,15 @@ #ifndef SMESHGUI_XmlHandler_HeaderFile #define SMESHGUI_XmlHandler_HeaderFile +#include "SMESH_SMESHGUI.hxx" + #include "SMESHGUI_Hypotheses.h" #include #include #include -class SMESHGUI_XmlHandler : public QXmlDefaultHandler +class SMESHGUI_EXPORT SMESHGUI_XmlHandler : public QXmlDefaultHandler { public: SMESHGUI_XmlHandler(); diff --git a/src/SMESHGUI/SMESH_SMESHGUI.hxx b/src/SMESHGUI/SMESH_SMESHGUI.hxx new file mode 100755 index 000000000..29a4e6e95 --- /dev/null +++ b/src/SMESHGUI/SMESH_SMESHGUI.hxx @@ -0,0 +1,39 @@ +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESH_SMESHGUI.hxx +// Author : Alexander A. BORODIN +// Module : SMESH + +#ifndef _SMESH_SMESHGUI_HXX_ +#define _SMESH_SMESHGUI_HXX_ + +#ifdef WNT + #if defined SMESHGUI_EXPORTS + #define SMESHGUI_EXPORT __declspec( dllexport ) + #else + #define SMESHGUI_EXPORT __declspec( dllimport ) + #endif +#else + #define SMESHGUI_EXPORT +#endif + +#endif diff --git a/src/SMESHGUI/SMESH_msg_en.po b/src/SMESHGUI/SMESH_msg_en.po index b8e73b45b..8aecfe085 100644 --- a/src/SMESHGUI/SMESH_msg_en.po +++ b/src/SMESHGUI/SMESH_msg_en.po @@ -36,8 +36,8 @@ msgstr "" msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:46:48 AM CEST\n" -"PO-Revision-Date: 2004-10-20 17:25+0400\n" +"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" +"PO-Revision-Date: 2005-06-07 10:51+0400\n" "Last-Translator: FULLNAME \n" "Content-Type: text/plain; charset=iso-8859-1\n" @@ -173,6 +173,10 @@ msgstr "No available data in selection" msgid "SMESH_POLYEDRE_CREATE_ERROR" msgstr "Polyedron creation error" +#Export mesh +msgid "SMESH_EXPORT_FAILED" +msgstr "Mesh export failed.\nProbably, there is not enough space on disk." + #------------------------------------------------------------------------- # MEN #------------------------------------------------------------------------- @@ -1269,12 +1273,18 @@ msgstr "Hypothesis and submesh dimensions mismatch" msgid "SMESH_HYP_9" msgstr "Shape is neither the main one, nor its subshape, nor a valid group" +msgid "SMESH_HYP_10" +msgstr "Geomerty mismatches algorithm's expectation" + msgid "MISSING_ALGO" msgstr "%3 %2D algorithm is missing" msgid "MISSING_HYPO" msgstr "%3 %2D algorithm \"%1\" misses %4D hypothesis" +msgid "BAD_PARAM_VALUE" +msgstr "Hypothesis of %3 %2D algorithm \"%1\" has a bad parameter value" + msgid "NOT_CONFORM_MESH" msgstr "%3 %2D algorithm \"%1\" would produce not conform mesh: global \"Not Conform Mesh Allowed\" hypotesis is missing" diff --git a/src/SMESH_I/SMESH.hxx b/src/SMESH_I/SMESH.hxx index 80b70ee21..3025f693b 100644 --- a/src/SMESH_I/SMESH.hxx +++ b/src/SMESH_I/SMESH.hxx @@ -26,8 +26,18 @@ // Module : SMESH // $Header: -#ifndef _SMESH_SMESH_HXX_ -#define _SMESH_SMESH_HXX_ +#ifndef _SMESH_I_SMESH_HXX_ +#define _SMESH_I_SMESH_HXX_ + +#ifdef WNT + #if defined SMESH_I_EXPORTS + #define SMESH_I_EXPORT __declspec( dllexport ) + #else + #define SMESH_I_EXPORT __declspec( dllimport ) + #endif +#else + #define SMESH_I_EXPORT +#endif // Tags definition enum { diff --git a/src/SMESH_I/SMESH_1D_Algo_i.cxx b/src/SMESH_I/SMESH_1D_Algo_i.cxx index 3c13663e6..56cb13fa9 100644 --- a/src/SMESH_I/SMESH_1D_Algo_i.cxx +++ b/src/SMESH_I/SMESH_1D_Algo_i.cxx @@ -26,11 +26,12 @@ // Module : SMESH // $Header$ -using namespace std; #include "SMESH_1D_Algo_i.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * SMESH_1D_Algo_i::SMESH_1D_Algo_i diff --git a/src/SMESH_I/SMESH_1D_Algo_i.hxx b/src/SMESH_I/SMESH_1D_Algo_i.hxx index 86800d315..14bc77ca5 100644 --- a/src/SMESH_I/SMESH_1D_Algo_i.hxx +++ b/src/SMESH_I/SMESH_1D_Algo_i.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_1D_ALGO_I_HXX_ #define _SMESH_1D_ALGO_I_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Hypothesis) @@ -37,7 +39,7 @@ // ====================================================== // Generic 1D algorithm // ====================================================== -class SMESH_1D_Algo_i: +class SMESH_I_EXPORT SMESH_1D_Algo_i: public virtual POA_SMESH::SMESH_1D_Algo, public virtual SMESH_Algo_i { diff --git a/src/SMESH_I/SMESH_2D_Algo_i.cxx b/src/SMESH_I/SMESH_2D_Algo_i.cxx index 1fce7356f..8c10ffa17 100644 --- a/src/SMESH_I/SMESH_2D_Algo_i.cxx +++ b/src/SMESH_I/SMESH_2D_Algo_i.cxx @@ -26,11 +26,12 @@ // Module : SMESH // $Header$ -using namespace std; #include "SMESH_2D_Algo_i.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * SMESH_2D_Algo_i::SMESH_2D_Algo_i diff --git a/src/SMESH_I/SMESH_2D_Algo_i.hxx b/src/SMESH_I/SMESH_2D_Algo_i.hxx index 839cb5faa..b0e535bfa 100644 --- a/src/SMESH_I/SMESH_2D_Algo_i.hxx +++ b/src/SMESH_I/SMESH_2D_Algo_i.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_2D_ALGO_I_HXX_ #define _SMESH_2D_ALGO_I_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Hypothesis) @@ -37,7 +39,7 @@ // ====================================================== // Generic 2D algorithm // ====================================================== -class SMESH_2D_Algo_i: +class SMESH_I_EXPORT SMESH_2D_Algo_i: public virtual POA_SMESH::SMESH_2D_Algo, public virtual SMESH_Algo_i { diff --git a/src/SMESH_I/SMESH_2smeshpy.cxx b/src/SMESH_I/SMESH_2smeshpy.cxx index 3171cbca2..ccf636240 100644 --- a/src/SMESH_I/SMESH_2smeshpy.cxx +++ b/src/SMESH_I/SMESH_2smeshpy.cxx @@ -32,11 +32,16 @@ #include "SMESH_2smeshpy.hxx" -#include "SMESH_Gen_i.hxx" #include "utilities.h" #include "SMESH_PythonDump.hxx" #include "Resource_DataMapOfAsciiStringAsciiString.hxx" +#include "SMESH_Gen_i.hxx" +/* SALOME headers that include CORBA headers that include windows.h + * that defines GetObject symbol as GetObjectA should stand before SALOME headers + * that declare methods named GetObject - to apply the same rules of GetObject renaming + * and thus to avoid mess with GetObject symbol on Windows */ + IMPLEMENT_STANDARD_HANDLE (_pyObject ,Standard_Transient); IMPLEMENT_STANDARD_HANDLE (_pyCommand ,Standard_Transient); IMPLEMENT_STANDARD_HANDLE (_pyGen ,_pyObject); @@ -54,6 +59,7 @@ IMPLEMENT_STANDARD_RTTIEXT(_pyHypothesis ,_pyObject); IMPLEMENT_STANDARD_RTTIEXT(_pyAlgorithm ,_pyHypothesis); IMPLEMENT_STANDARD_RTTIEXT(_pyComplexParamHypo,_pyHypothesis); IMPLEMENT_STANDARD_RTTIEXT(_pyNumberOfSegmentsHyp,_pyHypothesis); +IMPLEMENT_STANDARD_RTTIEXT(_pyLayerDistributionHypo,_pyHypothesis); using namespace std; using SMESH::TPythonDump; @@ -187,17 +193,10 @@ void _pyGen::AddCommand( const TCollection_AsciiString& theCommand) } // Add access to a wrapped mesh - for ( id_mesh = myMeshes.begin(); id_mesh != myMeshes.end(); ++id_mesh ) { - if ( aCommand->AddAccessorMethod( id_mesh->first, id_mesh->second->AccessorMethod() )) - break; - } + AddMeshAccessorMethod( aCommand ); // Add access to a wrapped algorithm - for ( hyp = myHypos.begin(); hyp != myHypos.end(); ++hyp ) { - if ( (*hyp)->IsAlgo() && - aCommand->AddAccessorMethod( (*hyp)->GetID(), (*hyp)->AccessorMethod() )) - break; - } + AddAlgoAccessorMethod( aCommand ); // PAL12227. PythonDump was not updated at proper time; result is // aCriteria.append(SMESH.Filter.Criterion(17,26,0,'L1',26,25,1e-07,SMESH.EDGE,-1)) @@ -296,6 +295,43 @@ void _pyGen::Flush() } } +//================================================================================ +/*! + * \brief Add access method to mesh that is object or arg + * \param theCmd - command to add access method + * \retval bool - true if added + */ +//================================================================================ + +bool _pyGen::AddMeshAccessorMethod( Handle(_pyCommand) theCmd ) const +{ + map< _pyID, Handle(_pyMesh) >::const_iterator id_mesh = myMeshes.begin(); + for ( ; id_mesh != myMeshes.end(); ++id_mesh ) { + if ( theCmd->AddAccessorMethod( id_mesh->first, id_mesh->second->AccessorMethod() )) + return true; + } + return false; +} + +//================================================================================ +/*! + * \brief Add access method to algo that is object or arg + * \param theCmd - command to add access method + * \retval bool - true if added + */ +//================================================================================ + +bool _pyGen::AddAlgoAccessorMethod( Handle(_pyCommand) theCmd ) const +{ + list< Handle(_pyHypothesis) >::const_iterator hyp = myHypos.begin(); + for ( ; hyp != myHypos.end(); ++hyp ) { + if ( (*hyp)->IsAlgo() && + theCmd->AddAccessorMethod( (*hyp)->GetID(), (*hyp)->AccessorMethod() )) + return true; + } + return false; +} + //================================================================================ /*! * \brief Find hypothesis by ID (entry) @@ -706,127 +742,139 @@ Handle(_pyHypothesis) _pyHypothesis::NewHypothesis( const Handle(_pyCommand)& th Handle(_pyHypothesis) hyp, algo; // "theHypType" - const TCollection_AsciiString & hypTypeWithQuotes = theCreationCmd->GetArg( 1 ); - if ( hypTypeWithQuotes.IsEmpty() ) + const TCollection_AsciiString & hypTypeQuoted = theCreationCmd->GetArg( 1 ); + if ( hypTypeQuoted.IsEmpty() ) return hyp; // theHypType TCollection_AsciiString hypType = - hypTypeWithQuotes.SubString( 2, hypTypeWithQuotes.Length() - 1 ); + hypTypeQuoted.SubString( 2, hypTypeQuoted.Length() - 1 ); algo = new _pyAlgorithm( theCreationCmd ); hyp = new _pyHypothesis( theCreationCmd ); // 1D Regular_1D ---------- if ( hypType == "Regular_1D" ) { - algo->myDim = 1; - algo->myCreationMethod = "Segment"; + algo->SetDimMethodType( 1, "Segment"); } else if ( hypType == "LocalLength" ) { - hyp->myDim = 1; - hyp->myCreationMethod = "LocalLength"; - hyp->myType = "Regular_1D"; - hyp->myArgMethods.Append( "SetLength" ); + hyp->SetDimMethodType( 1, "LocalLength", "Regular_1D"); + hyp->AddArgMethod( "SetLength" ); } else if ( hypType == "NumberOfSegments" ) { hyp = new _pyNumberOfSegmentsHyp( theCreationCmd ); - hyp->myDim = 1; - hyp->myCreationMethod = "NumberOfSegments"; - hyp->myType = "Regular_1D"; - hyp->myArgMethods.Append( "SetNumberOfSegments" ); - hyp->myArgMethods.Append( "SetScaleFactor" ); + hyp->SetDimMethodType( 1, "NumberOfSegments", "Regular_1D"); + hyp->AddArgMethod( "SetNumberOfSegments" ); + hyp->AddArgMethod( "SetScaleFactor" ); } else if ( hypType == "Arithmetic1D" ) { hyp = new _pyComplexParamHypo( theCreationCmd ); - hyp->myDim = 1; - hyp->myCreationMethod = "Arithmetic1D"; - hyp->myType = "Regular_1D"; + hyp->SetDimMethodType( 1, "Arithmetic1D", "Regular_1D"); } else if ( hypType == "StartEndLength" ) { hyp = new _pyComplexParamHypo( theCreationCmd ); - hyp->myDim = 1; - hyp->myCreationMethod = "StartEndLength"; - hyp->myType = "Regular_1D"; + hyp->SetDimMethodType( 1, "StartEndLength", "Regular_1D"); } else if ( hypType == "Deflection1D" ) { - hyp->myDim = 1; - hyp->myCreationMethod = "Deflection1D"; - hyp->myArgMethods.Append( "SetDeflection" ); - hyp->myType = "Regular_1D"; + hyp->SetDimMethodType( 1, "Deflection1D", "Regular_1D"); + hyp->AddArgMethod( "SetDeflection" ); } else if ( hypType == "Propagation" ) { - hyp->myDim = 1; - hyp->myCreationMethod = "Propagation"; - hyp->myType = "Regular_1D"; + hyp->SetDimMethodType( 1, "Propagation", "Regular_1D"); } else if ( hypType == "QuadraticMesh" ) { - hyp->myDim = 1; - hyp->myCreationMethod = "QuadraticMesh"; - hyp->myType = "Regular_1D"; + hyp->SetDimMethodType( 1, "QuadraticMesh", "Regular_1D"); } else if ( hypType == "AutomaticLength" ) { - hyp->myDim = 1; - hyp->myCreationMethod = "AutomaticLength"; - hyp->myType = "Regular_1D"; - hyp->myArgMethods.Append( "SetFineness"); + hyp->SetDimMethodType( 1, "AutomaticLength", "Regular_1D"); + hyp->AddArgMethod( "SetFineness"); } // 1D Python_1D ---------- else if ( hypType == "Python_1D" ) { - algo->myDim = 1; - algo->myCreationMethod = "Segment"; + algo->SetDimMethodType( 1, "Segment"); algo->myArgs.Append( "algo=smesh.PYTHON"); } else if ( hypType == "PythonSplit1D" ) { - hyp->myDim = 1; - hyp->myCreationMethod = "PythonSplit1D"; - hyp->myType = "Python_1D"; - hyp->myArgMethods.Append( "SetNumberOfSegments"); - hyp->myArgMethods.Append( "SetPythonLog10RatioFunction"); + hyp->SetDimMethodType( 1, "PythonSplit1D", "Python_1D"); + hyp->AddArgMethod( "SetNumberOfSegments"); + hyp->AddArgMethod( "SetPythonLog10RatioFunction"); } // 2D ---------- else if ( hypType == "MEFISTO_2D" ) { - algo->myDim = 2; - algo->myCreationMethod = "Triangle"; + algo->SetDimMethodType( 2, "Triangle"); } else if ( hypType == "MaxElementArea" ) { - hyp->myDim = 2; - hyp->myCreationMethod = "MaxElementArea"; - hyp->myType = "MEFISTO_2D"; - hyp->myArgMethods.Append( "SetMaxElementArea"); + hyp->SetDimMethodType( 2, "MaxElementArea", "MEFISTO_2D"); + hyp->AddArgMethod( "SetMaxElementArea"); } else if ( hypType == "LengthFromEdges" ) { - hyp->myDim = 2; - hyp->myCreationMethod = "LengthFromEdges"; - hyp->myType = "MEFISTO_2D"; + hyp->SetDimMethodType( 2, "LengthFromEdges", "MEFISTO_2D"); } else if ( hypType == "Quadrangle_2D" ) { - algo->myDim = 2; - algo->myCreationMethod = "Quadrangle"; + algo->SetDimMethodType( 2, "Quadrangle" ); } else if ( hypType == "QuadranglePreference" ) { - hyp->myDim = 2; - hyp->myCreationMethod = "QuadranglePreference"; - hyp->myType = "Quadrangle_2D"; + hyp->SetDimMethodType( 2, "QuadranglePreference", "Quadrangle_2D"); } // 3D ---------- else if ( hypType == "NETGEN_3D") { - algo->myDim = 3; - algo->myCreationMethod = "Tetrahedron"; + algo->SetDimMethodType( 3, "Tetrahedron" ); algo->myArgs.Append( "algo=smesh.NETGEN" ); } else if ( hypType == "MaxElementVolume") { - hyp->myDim = 3; - hyp->myCreationMethod = "MaxElementVolume"; - hyp->myType = "NETGEN_3D"; - hyp->myArgMethods.Append( "SetMaxElementVolume" ); + hyp->SetDimMethodType( 3, "MaxElementVolume", "NETGEN_3D"); + hyp->AddArgMethod( "SetMaxElementVolume" ); } else if ( hypType == "GHS3D_3D" ) { - algo->myDim = 3; - algo->myCreationMethod = "Tetrahedron"; + algo->SetDimMethodType( 3, "Tetrahedron"); algo->myArgs.Append( "algo=smesh.GHS3D" ); } else if ( hypType == "Hexa_3D" ) { - algo->myDim = 3; - algo->myCreationMethod = "Hexahedron"; + algo->SetDimMethodType( 3, "Hexahedron"); + } + // Repetitive --------- + else if ( hypType == "Projection_1D" ) { + algo->SetDimMethodType( 1, "Projection1D"); + } + else if ( hypType == "ProjectionSource1D" ) { + hyp->SetDimMethodType( 1, "SourceEdge", "Projection_1D"); + hyp->AddArgMethod( "SetSourceEdge"); + hyp->AddArgMethod( "SetSourceMesh"); + hyp->AddArgMethod( "SetVertexAssociation", 2 ); + } + else if ( hypType == "Projection_2D" ) { + algo->SetDimMethodType( 2, "Projection2D"); + } + else if ( hypType == "ProjectionSource2D" ) { + hyp->SetDimMethodType( 2, "SourceFace", "Projection_2D"); + hyp->AddArgMethod( "SetSourceFace"); + hyp->AddArgMethod( "SetSourceMesh"); + hyp->AddArgMethod( "SetVertexAssociation", 4 ); + } + else if ( hypType == "Projection_3D" ) { + algo->SetDimMethodType( 3, "Projection3D"); + } + else if ( hypType == "ProjectionSource3D" ) { + hyp->SetDimMethodType( 3, "SourceShape3D", "Projection_3D"); + hyp->AddArgMethod( "SetSource3DShape"); + hyp->AddArgMethod( "SetSourceMesh"); + hyp->AddArgMethod( "SetVertexAssociation", 4 ); + } + else if ( hypType == "Prism_3D" ) { + algo->SetDimMethodType( 3, "Prism"); + } + else if ( hypType == "RadialPrism_3D" ) { + algo->SetDimMethodType( 3, "Prism"); + } + else if ( hypType == "NumberOfLayers" ) { + hyp->SetDimMethodType( 3, "NumberOfLayers", "RadialPrism_3D"); + hyp->AddArgMethod( "SetNumberOfLayers" ); + } + else if ( hypType == "LayerDistribution" ) { + hyp = new _pyLayerDistributionHypo( theCreationCmd ); + hyp->SetDimMethodType( 3, "LayerDistribution", "RadialPrism_3D"); +// hyp->AddArgMethod( "SetSource3DShape"); +// hyp->AddArgMethod( "SetSourceMesh"); +// hyp->AddArgMethod( "SetVertexAssociation", 4 ); } if ( algo->GetDim() ) { @@ -908,14 +956,17 @@ void _pyHypothesis::Process( const Handle(_pyCommand)& theCommand) { ASSERT( !myIsAlgo ); // set args + int nbArgs = 0; for ( int i = 1; i <= myArgMethods.Length(); ++i ) { if ( myArgMethods( i ) == theCommand->GetMethod() ) { - while ( myArgs.Length() < i ) + while ( myArgs.Length() < nbArgs + myNbArgsByMethod( i )) myArgs.Append( "[]" ); - myArgs( i ) = theCommand->GetArg( 1 ); // arg value + for ( int iArg = 1; iArg <= myNbArgsByMethod( i ); ++iArg ) + myArgs( nbArgs + iArg ) = theCommand->GetArg( iArg ); // arg value myArgCommands.push_back( theCommand ); return; } + nbArgs += myNbArgsByMethod( i ); } myUnknownCommands.push_back( theCommand ); } @@ -929,10 +980,43 @@ void _pyHypothesis::Process( const Handle(_pyCommand)& theCommand) void _pyHypothesis::Flush() { if ( IsWrapped() ) { - // forget previous hypothesis modifications - myArgCommands.clear(); - myUnknownCommands.clear(); } + else { + list < Handle(_pyCommand) >::iterator cmd = myArgCommands.begin(); + for ( ; cmd != myArgCommands.end(); ++cmd ) { + // Add access to a wrapped mesh + theGen->AddMeshAccessorMethod( *cmd ); + // Add access to a wrapped algorithm + theGen->AddAlgoAccessorMethod( *cmd ); + } + cmd = myUnknownCommands.begin(); + for ( ; cmd != myUnknownCommands.end(); ++cmd ) { + // Add access to a wrapped mesh + theGen->AddMeshAccessorMethod( *cmd ); + // Add access to a wrapped algorithm + theGen->AddAlgoAccessorMethod( *cmd ); + } + } + // forget previous hypothesis modifications + myArgCommands.clear(); + myUnknownCommands.clear(); +} + +//================================================================================ +/*! + * \brief clear creation, arg and unkown commands + */ +//================================================================================ + +void _pyHypothesis::ClearAllCommands() +{ + GetCreationCmd()->Clear(); + list::iterator cmd = myArgCommands.begin(); + for ( ; cmd != myArgCommands.end(); ++cmd ) + ( *cmd )->Clear(); + cmd = myUnknownCommands.begin(); + for ( ; cmd != myUnknownCommands.end(); ++cmd ) + ( *cmd )->Clear(); } //================================================================================ @@ -955,6 +1039,127 @@ void _pyComplexParamHypo::Process( const Handle(_pyCommand)& theCommand) myArgCommands.push_back( theCommand ); } +//================================================================================ +/*! + * \brief Convert methods of 1D hypotheses to my own methods + * \param theCommand - The called hypothesis method + */ +//================================================================================ + +void _pyLayerDistributionHypo::Process( const Handle(_pyCommand)& theCommand) +{ + if ( theCommand->GetMethod() != "SetLayerDistribution" ) + return; + + _pyID newName; // name for 1D hyp = "HypType" + "_Distribution" + + const _pyID& hyp1dID = theCommand->GetArg( 1 ); + Handle(_pyHypothesis) hyp1d = theGen->FindHyp( hyp1dID ); + if ( hyp1d.IsNull() ) // apparently hypId changed at study restoration + hyp1d = my1dHyp; + else if ( !my1dHyp.IsNull() && hyp1dID != my1dHyp->GetID() ) { + // 1D hypo is already set, so distribution changes and the old + // 1D hypo is thrown away + my1dHyp->ClearAllCommands(); + } + my1dHyp = hyp1d; + if ( my1dHyp.IsNull() ) + return; // something wrong :( + + // make a new name for 1D hyp = "HypType" + "_Distribution" + if ( my1dHyp->GetCreationCmd()->GetMethod() == "CreateHypothesis" ) { + // not yet converted creation cmd + TCollection_AsciiString hypTypeQuoted = my1dHyp->GetCreationCmd()->GetArg(1); + TCollection_AsciiString hypType = hypTypeQuoted.SubString( 2, hypTypeQuoted.Length() - 1 ); + newName = hypType + "_Distribution"; + my1dHyp->GetCreationCmd()->SetResultValue( newName ); + } + else { + // already converted creation cmd + newName = my1dHyp->GetCreationCmd()->GetResultValue(); + } + + // as creation of 1D hyp was written later then it's edition, + // we need to find all it's edition calls and process them + list< Handle(_pyCommand) >& cmds = theGen->GetCommands(); + list< Handle(_pyCommand) >::iterator cmdIt = cmds.begin(); + for ( ; cmdIt != cmds.end(); ++cmdIt ) { + const _pyID& objID = (*cmdIt)->GetObject(); + if ( objID == hyp1dID ) { + my1dHyp->Process( *cmdIt ); + my1dHyp->GetCreationCmd()->AddDependantCmd( *cmdIt ); + ( *cmdIt )->SetObject( newName ); + } + } + if ( !myArgCommands.empty() ) + myArgCommands.front()->Clear(); + theCommand->SetArg( 1, newName ); + myArgCommands.push_back( theCommand ); + // copy hyp1d's creation method and args +// myCreationMethod = hyp1d->GetCreationMethod(); +// myArgs = hyp1d->GetArgs(); +// // make them cleared at conversion +// myArgCommands = hyp1d->GetArgCommands(); + +// // to be cleared at convertion only +// myArgCommands.push_back( theCommand ); +} + +//================================================================================ +/*! + * \brief + * \param theAdditionCmd - + * \param theMesh - + * \retval bool - + */ +//================================================================================ + +bool _pyLayerDistributionHypo::Addition2Creation( const Handle(_pyCommand)& theAdditionCmd, + const _pyID& theMesh) +{ + myIsWrapped = false; + + if ( my1dHyp.IsNull() ) + return false; + + // set "SetLayerDistribution()" after addition cmd + theAdditionCmd->AddDependantCmd( myArgCommands.front() ); + + _pyID geom = theAdditionCmd->GetArg( 1 ); + + my1dHyp->SetMesh( theMesh ); + if ( !my1dHyp->Addition2Creation( theAdditionCmd, theMesh )) + return false; + + // clear "SetLayerDistribution()" cmd + myArgCommands.front()->Clear(); + + // Convert my creation => me = RadialPrismAlgo.Get3DHypothesis() + + // find RadialPrism algo created on for theMesh + Handle(_pyHypothesis) algo = theGen->FindAlgo( geom, theMesh, this->GetType() ); + if ( !algo.IsNull() ) { + GetCreationCmd()->SetObject( algo->GetID() ); + GetCreationCmd()->SetMethod( "Get3DHypothesis" ); + GetCreationCmd()->RemoveArgs(); + theAdditionCmd->AddDependantCmd( GetCreationCmd() ); + myIsWrapped = true; + } + return myIsWrapped; +} + +//================================================================================ +/*! + * \brief + */ +//================================================================================ + +void _pyLayerDistributionHypo::Flush() +{ + //my1dHyp.Nullify(); + //_pyHypothesis::Flush(); +} + //================================================================================ /*! * \brief additionally to Addition2Creation, clears SetDistrType() command @@ -996,15 +1201,27 @@ bool _pyNumberOfSegmentsHyp::Addition2Creation( const Handle(_pyCommand)& theCmd void _pyNumberOfSegmentsHyp::Flush() { - const int nbCmdLists = 2; - list * cmds[nbCmdLists] = { &myArgCommands, &myUnknownCommands }; - for ( int i = 0; i < nbCmdLists; ++i ) { + // find number of the last SetDistrType() command + list::reverse_iterator cmd = myUnknownCommands.rbegin(); + int distrTypeNb = 0; + for ( ; !distrTypeNb && cmd != myUnknownCommands.rend(); ++cmd ) + if ( (*cmd)->GetMethod() == "SetDistrType" ) + distrTypeNb = (*cmd)->GetOrderNb(); + + // clear commands before the last SetDistrType() + list * cmds[2] = { &myArgCommands, &myUnknownCommands }; + for ( int i = 0; i < 2; ++i ) { set uniqueMethods; list & cmdList = *cmds[i]; - list::reverse_iterator cmd = cmdList.rbegin(); - for ( ; cmd != cmdList.rend(); ++cmd ) { - bool isNewInSet = uniqueMethods.insert( (*cmd)->GetMethod() ).second; - if ( ! isNewInSet ) + for ( cmd = cmdList.rbegin(); cmd != cmdList.rend(); ++cmd ) + { + bool clear = ( (*cmd)->GetOrderNb() < distrTypeNb ); + const TCollection_AsciiString& method = (*cmd)->GetMethod(); + if ( !clear || method == "SetNumberOfSegments" ) { + bool isNewInSet = uniqueMethods.insert( method ).second; + clear = !isNewInSet; + } + if ( clear ) (*cmd)->Clear(); } cmdList.clear(); diff --git a/src/SMESH_I/SMESH_2smeshpy.hxx b/src/SMESH_I/SMESH_2smeshpy.hxx index 5319af279..f5717cd2a 100644 --- a/src/SMESH_I/SMESH_2smeshpy.hxx +++ b/src/SMESH_I/SMESH_2smeshpy.hxx @@ -34,6 +34,7 @@ #include #include +// =========================================================================================== /*! * \brief Tool converting SMESH engine calls into commands defined in smesh.py * @@ -49,6 +50,7 @@ * * See comments to _pyHypothesis class to know how to assure convertion of a new hypothesis */ +// =========================================================================================== class Resource_DataMapOfAsciiStringAsciiString; @@ -74,9 +76,11 @@ public: static char* GenName() { return "smesh.smesh"; } }; +// =========================================================================================== // ===================== // INTERNAL STUFF // ===================== +// =========================================================================================== class _pyCommand; class _pyObject; @@ -154,9 +158,11 @@ public: DEFINE_STANDARD_RTTI (_pyCommand) }; +// ------------------------------------------------------------------------------------- /*! * \brief Root of all objects */ +// ------------------------------------------------------------------------------------- class _pyObject: public Standard_Transient { @@ -174,10 +180,12 @@ public: DEFINE_STANDARD_RTTI (_pyObject) }; +// ------------------------------------------------------------------------------------- /*! * \brief Class corresponding to SMESH_Gen. It holds info on existing * meshes and hypotheses */ +// ------------------------------------------------------------------------------------- class _pyGen: public _pyObject { public: @@ -193,6 +201,8 @@ public: void SetCommandAfter( Handle(_pyCommand) theCmd, Handle(_pyCommand) theAfterCmd ); std::list< Handle(_pyCommand) >& GetCommands() { return myCommands; } void SetAccessorMethod(const _pyID& theID, const char* theMethod ); + bool AddMeshAccessorMethod( Handle(_pyCommand) theCmd ) const; + bool AddAlgoAccessorMethod( Handle(_pyCommand) theCmd ) const; const char* AccessorMethod() const { return SMESH_2smeshpy::GenName(); } private: std::map< _pyID, Handle(_pyMesh) > myMeshes; @@ -205,9 +215,11 @@ private: DEFINE_STANDARD_RTTI (_pyGen) }; +// ------------------------------------------------------------------------------------- /*! * \brief Contains commands concerning mesh substructures */ +// ------------------------------------------------------------------------------------- #define _pyMesh_ACCESS_METHOD "GetMesh()" class _pyMesh: public _pyObject { @@ -229,6 +241,7 @@ private: }; #undef _pyMesh_ACCESS_METHOD +// ------------------------------------------------------------------------------------- /*! * \brief Root class for hypothesis * @@ -245,19 +258,29 @@ private: * to derive a specific class from _pyHypothesis that would redefine Process(), * see _pyComplexParamHypo for example */ +// ------------------------------------------------------------------------------------- class _pyHypothesis: public _pyObject { protected: bool myIsAlgo, /*myIsLocal, */myIsWrapped, myIsConverted; - int myDim, myAdditionCmdNb; + int myDim/*, myAdditionCmdNb*/; _pyID myGeom, myMesh; TCollection_AsciiString myCreationMethod, myType; TColStd_SequenceOfAsciiString myArgs; TColStd_SequenceOfAsciiString myArgMethods; + TColStd_SequenceOfInteger myNbArgsByMethod; std::list myArgCommands; std::list myUnknownCommands; public: _pyHypothesis(const Handle(_pyCommand)& theCreationCmd); + void SetDimMethodType(const int dim, const char* creationMethod, const char* type=0) + { myDim = dim; myCreationMethod = (char*)creationMethod; if ( type ) myType = (char*)type; } + void AddArgMethod(const char* method, const int nbArgs = 1) + { myArgMethods.Append( (char*)method ); myNbArgsByMethod.Append( nbArgs ); } + const TColStd_SequenceOfAsciiString& GetArgs() const { return myArgs; } + const TCollection_AsciiString& GetCreationMethod() const { return myCreationMethod; } + const std::list& GetArgCommands() const { return myArgCommands; } + void ClearAllCommands(); virtual bool IsAlgo() const { return myIsAlgo; } bool IsWrapped() const { return myIsWrapped; } bool & IsConverted() { return myIsConverted; } @@ -278,9 +301,11 @@ public: DEFINE_STANDARD_RTTI (_pyHypothesis) }; +// ------------------------------------------------------------------------------------- /*! * \brief Class for hypotheses having several parameters modified by one method */ +// ------------------------------------------------------------------------------------- class _pyComplexParamHypo: public _pyHypothesis { public: @@ -291,10 +316,32 @@ public: }; DEFINE_STANDARD_HANDLE (_pyComplexParamHypo, _pyHypothesis); +// ------------------------------------------------------------------------------------- +/*! + * \brief Class for LayerDistribution hypothesis conversion + */ +// ------------------------------------------------------------------------------------- +class _pyLayerDistributionHypo: public _pyHypothesis +{ + Handle(_pyHypothesis) my1dHyp; +public: + _pyLayerDistributionHypo(const Handle(_pyCommand)& theCreationCmd): + _pyHypothesis(theCreationCmd) {} + void Process( const Handle(_pyCommand)& theCommand); + void Flush(); + bool Addition2Creation( const Handle(_pyCommand)& theAdditionCmd, + const _pyID& theMesh); + + DEFINE_STANDARD_RTTI (_pyLayerDistributionHypo) +}; +DEFINE_STANDARD_HANDLE (_pyLayerDistributionHypo, _pyHypothesis); + +// ------------------------------------------------------------------------------------- /*! * \brief Class representing NumberOfSegments hypothesis */ +// ------------------------------------------------------------------------------------- class _pyNumberOfSegmentsHyp: public _pyHypothesis { public: @@ -307,9 +354,11 @@ public: }; DEFINE_STANDARD_HANDLE (_pyNumberOfSegmentsHyp, _pyHypothesis); +// ------------------------------------------------------------------------------------- /*! * \brief Class representing smesh.Mesh_Algorithm */ +// ------------------------------------------------------------------------------------- class _pyAlgorithm: public _pyHypothesis { public: diff --git a/src/SMESH_I/SMESH_3D_Algo_i.cxx b/src/SMESH_I/SMESH_3D_Algo_i.cxx index a59ef15b7..6cd59106c 100644 --- a/src/SMESH_I/SMESH_3D_Algo_i.cxx +++ b/src/SMESH_I/SMESH_3D_Algo_i.cxx @@ -26,11 +26,12 @@ // Module : SMESH // $Header$ -using namespace std; #include "SMESH_3D_Algo_i.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * SMESH_3D_Algo_i::SMESH_3D_Algo_i diff --git a/src/SMESH_I/SMESH_3D_Algo_i.hxx b/src/SMESH_I/SMESH_3D_Algo_i.hxx index 2fce5a766..30a708a1c 100644 --- a/src/SMESH_I/SMESH_3D_Algo_i.hxx +++ b/src/SMESH_I/SMESH_3D_Algo_i.hxx @@ -37,7 +37,7 @@ // ====================================================== // Generic 3D algorithm // ====================================================== -class SMESH_3D_Algo_i: +class SMESH_I_EXPORT SMESH_3D_Algo_i: public virtual POA_SMESH::SMESH_3D_Algo, public virtual SMESH_Algo_i { diff --git a/src/SMESH_I/SMESH_Algo_i.cxx b/src/SMESH_I/SMESH_Algo_i.cxx index a0e8b9aa0..cfa8dc555 100644 --- a/src/SMESH_I/SMESH_Algo_i.cxx +++ b/src/SMESH_I/SMESH_Algo_i.cxx @@ -26,7 +26,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "SMESH_Algo_i.hxx" #include "SMESH_Algo.hxx" @@ -35,6 +34,8 @@ using namespace std; #include #include +using namespace std; + //============================================================================= /*! * SMESH_Algo_i::SMESH_Algo_i diff --git a/src/SMESH_I/SMESH_Algo_i.hxx b/src/SMESH_I/SMESH_Algo_i.hxx index eee44fc09..2ee94ae9d 100644 --- a/src/SMESH_I/SMESH_Algo_i.hxx +++ b/src/SMESH_I/SMESH_Algo_i.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_ALGO_I_HXX_ #define _SMESH_ALGO_I_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Hypothesis) @@ -37,7 +39,7 @@ // ====================================================== // Generic algorithm // ====================================================== -class SMESH_Algo_i: +class SMESH_I_EXPORT SMESH_Algo_i: public virtual POA_SMESH::SMESH_Algo, public virtual SMESH_Hypothesis_i { diff --git a/src/SMESH_I/SMESH_Filter_i.cxx b/src/SMESH_I/SMESH_Filter_i.cxx index 917732d62..e653aa172 100644 --- a/src/SMESH_I/SMESH_Filter_i.cxx +++ b/src/SMESH_I/SMESH_Filter_i.cxx @@ -452,8 +452,9 @@ static char* getShapeNameByID ( const char* theID ) Functor_i::Functor_i(): SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() ) { - PortableServer::ObjectId_var anObjectId = - SMESH_Gen_i::GetPOA()->activate_object( this ); + //Base class Salome_GenericObject do it inmplicitly by overriding PortableServer::POA_ptr _default_POA() method + //PortableServer::ObjectId_var anObjectId = + // SMESH_Gen_i::GetPOA()->activate_object( this ); } Functor_i::~Functor_i() @@ -1417,8 +1418,9 @@ FunctorType LogicalOR_i::GetFunctorType() FilterManager_i::FilterManager_i() : SALOME::GenericObj_i( SMESH_Gen_i::GetPOA() ) { - PortableServer::ObjectId_var anObjectId = - SMESH_Gen_i::GetPOA()->activate_object( this ); + //Base class Salome_GenericObject do it inmplicitly by overriding PortableServer::POA_ptr _default_POA() method + //PortableServer::ObjectId_var anObjectId = + // SMESH_Gen_i::GetPOA()->activate_object( this ); } @@ -1784,7 +1786,8 @@ GetElementsId( Predicate_i* thePredicate, const SMDS_Mesh* theMesh, Controls::Filter::TIdSequence& theSequence ) { - Controls::Filter::GetElementsId(theMesh,thePredicate->GetPredicate(),theSequence); + if (thePredicate) + Controls::Filter::GetElementsId(theMesh,thePredicate->GetPredicate(),theSequence); } void @@ -1793,8 +1796,9 @@ GetElementsId( Predicate_i* thePredicate, SMESH_Mesh_ptr theMesh, Controls::Filter::TIdSequence& theSequence ) { - if(const SMDS_Mesh* aMesh = MeshPtr2SMDSMesh(theMesh)) - Controls::Filter::GetElementsId(aMesh,thePredicate->GetPredicate(),theSequence); + if (thePredicate) + if(const SMDS_Mesh* aMesh = MeshPtr2SMDSMesh(theMesh)) + Controls::Filter::GetElementsId(aMesh,thePredicate->GetPredicate(),theSequence); } SMESH::long_array* @@ -1802,7 +1806,7 @@ Filter_i:: GetElementsId( SMESH_Mesh_ptr theMesh ) { SMESH::long_array_var anArray = new SMESH::long_array; - if(!CORBA::is_nil(theMesh)){ + if(!CORBA::is_nil(theMesh) && myPredicate){ Controls::Filter::TIdSequence aSequence; GetElementsId(myPredicate,theMesh,aSequence); long i = 0, iEnd = aSequence.size(); @@ -2073,11 +2077,12 @@ CORBA::Boolean Filter_i::SetCriteria( const SMESH::Filter::Criteria& theCriteria case SMESH::FT_BelongToPlane: case SMESH::FT_BelongToCylinder: { - SMESH::BelongToSurface_ptr tmpPred; + SMESH::BelongToSurface_ptr tmpPred; if ( aCriterion == SMESH::FT_BelongToPlane ) tmpPred = aFilterMgr->CreateBelongToPlane(); else tmpPred = aFilterMgr->CreateBelongToCylinder(); + tmpPred->SetShape( aThresholdID, aThresholdStr, aTypeOfElem ); tmpPred->SetTolerance( aTolerance ); aPredicate = tmpPred; diff --git a/src/SMESH_I/SMESH_Filter_i.hxx b/src/SMESH_I/SMESH_Filter_i.hxx index 51ad5893b..524ab3ca4 100644 --- a/src/SMESH_I/SMESH_Filter_i.hxx +++ b/src/SMESH_I/SMESH_Filter_i.hxx @@ -28,6 +28,8 @@ #ifndef _SMESH_FILTER_I_HXX_ #define _SMESH_FILTER_I_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Filter) @@ -50,7 +52,7 @@ namespace SMESH Description : Predicate for verifying whether entiy belong to specified geometrical support */ - class BelongToGeom: public virtual Predicate + class SMESH_I_EXPORT BelongToGeom: public virtual Predicate { public: BelongToGeom(); @@ -78,7 +80,7 @@ namespace SMESH Description : Predicate for verifying whether entiy lying or partially lying on specified geometrical support */ - class LyingOnGeom: public virtual Predicate + class SMESH_I_EXPORT LyingOnGeom: public virtual Predicate { public: LyingOnGeom(); @@ -115,7 +117,7 @@ namespace SMESH Class : Functor_i Description : An abstact class for all functors */ - class Functor_i: public virtual POA_SMESH::Functor, + class SMESH_I_EXPORT Functor_i: public virtual POA_SMESH::Functor, public virtual SALOME::GenericObj_i { public: @@ -134,7 +136,7 @@ namespace SMESH Class : NumericalFunctor_i Description : Base class for numerical functors */ - class NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor, + class SMESH_I_EXPORT NumericalFunctor_i: public virtual POA_SMESH::NumericalFunctor, public virtual Functor_i { public: @@ -152,7 +154,7 @@ namespace SMESH Class : SMESH_MinimumAngleFunct Description : Functor for calculation of minimum angle */ - class MinimumAngle_i: public virtual POA_SMESH::MinimumAngle, + class SMESH_I_EXPORT MinimumAngle_i: public virtual POA_SMESH::MinimumAngle, public virtual NumericalFunctor_i { public: @@ -165,7 +167,7 @@ namespace SMESH Class : AspectRatio_i Description : Functor for calculating aspect ratio */ - class AspectRatio_i: public virtual POA_SMESH::AspectRatio, + class SMESH_I_EXPORT AspectRatio_i: public virtual POA_SMESH::AspectRatio, public virtual NumericalFunctor_i { public: @@ -178,7 +180,7 @@ namespace SMESH Class : AspectRatio3D_i Description : Functor for calculating aspect ratio for 3D */ - class AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D, + class SMESH_I_EXPORT AspectRatio3D_i: public virtual POA_SMESH::AspectRatio3D, public virtual NumericalFunctor_i { public: @@ -191,7 +193,7 @@ namespace SMESH Class : Warping_i Description : Functor for calculating warping */ - class Warping_i: public virtual POA_SMESH::Warping, + class SMESH_I_EXPORT Warping_i: public virtual POA_SMESH::Warping, public virtual NumericalFunctor_i { public: @@ -204,7 +206,7 @@ namespace SMESH Class : Taper_i Description : Functor for calculating taper */ - class Taper_i: public virtual POA_SMESH::Taper, + class SMESH_I_EXPORT Taper_i: public virtual POA_SMESH::Taper, public virtual NumericalFunctor_i { public: @@ -217,7 +219,7 @@ namespace SMESH Class : Skew_i Description : Functor for calculating skew in degrees */ - class Skew_i: public virtual POA_SMESH::Skew, + class SMESH_I_EXPORT Skew_i: public virtual POA_SMESH::Skew, public virtual NumericalFunctor_i { public: @@ -230,7 +232,7 @@ namespace SMESH Class : Area_i Description : Functor for calculating area */ - class Area_i: public virtual POA_SMESH::Area, + class SMESH_I_EXPORT Area_i: public virtual POA_SMESH::Area, public virtual NumericalFunctor_i { public: @@ -243,7 +245,7 @@ namespace SMESH Class : Volume3D_i Description : Functor for calculating volume of 3D element */ - class Volume3D_i: public virtual POA_SMESH::Volume3D, + class SMESH_I_EXPORT Volume3D_i: public virtual POA_SMESH::Volume3D, public virtual NumericalFunctor_i { public: @@ -256,7 +258,7 @@ namespace SMESH Class : Length_i Description : Functor for calculating length of edge */ - class Length_i: public virtual POA_SMESH::Length, + class SMESH_I_EXPORT Length_i: public virtual POA_SMESH::Length, public virtual NumericalFunctor_i { public: @@ -268,7 +270,7 @@ namespace SMESH Class : Length2D_i Description : Functor for calculating length of edge */ - class Length2D_i: public virtual POA_SMESH::Length2D, + class SMESH_I_EXPORT Length2D_i: public virtual POA_SMESH::Length2D, public virtual NumericalFunctor_i { public: @@ -285,7 +287,7 @@ namespace SMESH Class : MultiConnection_i Description : Functor for calculating number of faces conneted to the edge */ - class MultiConnection_i: public virtual POA_SMESH::MultiConnection, + class SMESH_I_EXPORT MultiConnection_i: public virtual POA_SMESH::MultiConnection, public virtual NumericalFunctor_i { public: @@ -297,7 +299,7 @@ namespace SMESH Class : MultiConnection2D_i Description : Functor for calculating number of faces conneted to the edge */ - class MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D, + class SMESH_I_EXPORT MultiConnection2D_i: public virtual POA_SMESH::MultiConnection2D, public virtual NumericalFunctor_i { public: @@ -317,7 +319,7 @@ namespace SMESH Class : Predicate_i Description : Base class for all predicates */ - class Predicate_i: public virtual POA_SMESH::Predicate, + class SMESH_I_EXPORT Predicate_i: public virtual POA_SMESH::Predicate, public virtual Functor_i { public: @@ -334,7 +336,7 @@ namespace SMESH Description : Verify whether a mesh volume is incorrectly oriented from the point of view of MED convention */ - class BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume, + class SMESH_I_EXPORT BadOrientedVolume_i: public virtual POA_SMESH::BadOrientedVolume, public virtual Predicate_i { public: @@ -346,7 +348,7 @@ namespace SMESH Class : BelongToGeom_i Description : Predicate for selection on geometrical support */ - class BelongToGeom_i: public virtual POA_SMESH::BelongToGeom, + class SMESH_I_EXPORT BelongToGeom_i: public virtual POA_SMESH::BelongToGeom, public virtual Predicate_i { public: @@ -374,7 +376,7 @@ namespace SMESH Class : BelongToSurface_i Description : Verify whether mesh element lie in pointed Geom planar object */ - class BelongToSurface_i: public virtual POA_SMESH::BelongToSurface, + class SMESH_I_EXPORT BelongToSurface_i: public virtual POA_SMESH::BelongToSurface, public virtual Predicate_i { public: @@ -390,7 +392,7 @@ namespace SMESH void SetTolerance( CORBA::Double ); CORBA::Double GetTolerance(); - + protected: Controls::ElementsOnSurfacePtr myElementsOnSurfacePtr; char* myShapeName; @@ -402,7 +404,7 @@ namespace SMESH Class : BelongToPlane_i Description : Verify whether mesh element lie in pointed Geom planar object */ - class BelongToPlane_i: public virtual POA_SMESH::BelongToPlane, + class SMESH_I_EXPORT BelongToPlane_i: public virtual POA_SMESH::BelongToPlane, public virtual BelongToSurface_i { public: @@ -415,7 +417,7 @@ namespace SMESH Class : BelongToCylinder_i Description : Verify whether mesh element lie in pointed Geom cylindrical object */ - class BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder, + class SMESH_I_EXPORT BelongToCylinder_i: public virtual POA_SMESH::BelongToCylinder, public virtual BelongToSurface_i { public: @@ -423,12 +425,12 @@ namespace SMESH void SetCylinder( GEOM::GEOM_Object_ptr theGeom, ElementType theType ); FunctorType GetFunctorType(); }; - + /* Class : LyingOnGeom_i Description : Predicate for selection on geometrical support(lying or partially lying) */ - class LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom, + class SMESH_I_EXPORT LyingOnGeom_i: public virtual POA_SMESH::LyingOnGeom, public virtual Predicate_i { public: @@ -456,7 +458,7 @@ namespace SMESH Class : FreeBorders_i Description : Predicate for free borders */ - class FreeBorders_i: public virtual POA_SMESH::FreeBorders, + class SMESH_I_EXPORT FreeBorders_i: public virtual POA_SMESH::FreeBorders, public virtual Predicate_i { public: @@ -469,7 +471,7 @@ namespace SMESH Class : FreeEdges_i Description : Predicate for free edges */ - class FreeEdges_i: public virtual POA_SMESH::FreeEdges, + class SMESH_I_EXPORT FreeEdges_i: public virtual POA_SMESH::FreeEdges, public virtual Predicate_i { public: @@ -486,7 +488,7 @@ namespace SMESH Class : RangeOfIds_i Description : Predicate for Range of Ids */ - class RangeOfIds_i: public virtual POA_SMESH::RangeOfIds, + class SMESH_I_EXPORT RangeOfIds_i: public virtual POA_SMESH::RangeOfIds, public virtual Predicate_i { public: @@ -506,7 +508,7 @@ namespace SMESH Class : Comparator_i Description : Base class for comparators */ - class Comparator_i: public virtual POA_SMESH::Comparator, + class SMESH_I_EXPORT Comparator_i: public virtual POA_SMESH::Comparator, public virtual Predicate_i { public: @@ -531,7 +533,7 @@ namespace SMESH Class : LessThan_i Description : Comparator "<" */ - class LessThan_i: public virtual POA_SMESH::LessThan, + class SMESH_I_EXPORT LessThan_i: public virtual POA_SMESH::LessThan, public virtual Comparator_i { public: @@ -544,7 +546,7 @@ namespace SMESH Class : MoreThan_i Description : Comparator ">" */ - class MoreThan_i: public virtual POA_SMESH::MoreThan, + class SMESH_I_EXPORT MoreThan_i: public virtual POA_SMESH::MoreThan, public virtual Comparator_i { public: @@ -557,7 +559,7 @@ namespace SMESH Class : EqualTo_i Description : Comparator "=" */ - class EqualTo_i: public virtual POA_SMESH::EqualTo, + class SMESH_I_EXPORT EqualTo_i: public virtual POA_SMESH::EqualTo, public virtual Comparator_i { public: @@ -575,7 +577,7 @@ namespace SMESH Class : LogicalNOT_i Description : Logical NOT predicate */ - class LogicalNOT_i: public virtual POA_SMESH::LogicalNOT, + class SMESH_I_EXPORT LogicalNOT_i: public virtual POA_SMESH::LogicalNOT, public virtual Predicate_i { public: @@ -596,7 +598,7 @@ namespace SMESH Class : LogicalBinary_i Description : Base class for binary logical predicate */ - class LogicalBinary_i: public virtual POA_SMESH::LogicalBinary, + class SMESH_I_EXPORT LogicalBinary_i: public virtual POA_SMESH::LogicalBinary, public virtual Predicate_i { public: @@ -622,7 +624,7 @@ namespace SMESH Class : LogicalAND_i Description : Logical AND */ - class LogicalAND_i: public virtual POA_SMESH::LogicalAND, + class SMESH_I_EXPORT LogicalAND_i: public virtual POA_SMESH::LogicalAND, public virtual LogicalBinary_i { public: @@ -635,7 +637,7 @@ namespace SMESH Class : LogicalOR_i Description : Logical OR */ - class LogicalOR_i: public virtual POA_SMESH::LogicalOR, + class SMESH_I_EXPORT LogicalOR_i: public virtual POA_SMESH::LogicalOR, public virtual LogicalBinary_i { public: @@ -647,7 +649,7 @@ namespace SMESH /* FILTER */ - class Filter_i: public virtual POA_SMESH::Filter, + class SMESH_I_EXPORT Filter_i: public virtual POA_SMESH::Filter, public virtual SALOME::GenericObj_i { public: @@ -709,7 +711,7 @@ namespace SMESH /* FILTER LIBRARY */ - class FilterLibrary_i: public virtual POA_SMESH::FilterLibrary, + class SMESH_I_EXPORT FilterLibrary_i: public virtual POA_SMESH::FilterLibrary, public virtual SALOME::GenericObj_i { public: @@ -747,7 +749,7 @@ namespace SMESH FILTER MANAGER */ - class FilterManager_i: public virtual POA_SMESH::FilterManager, + class SMESH_I_EXPORT FilterManager_i: public virtual POA_SMESH::FilterManager, public virtual SALOME::GenericObj_i { public: diff --git a/src/SMESH_I/SMESH_Gen_i.cxx b/src/SMESH_I/SMESH_Gen_i.cxx index 9ba8783a3..31ad919b6 100644 --- a/src/SMESH_I/SMESH_Gen_i.cxx +++ b/src/SMESH_I/SMESH_Gen_i.cxx @@ -53,7 +53,24 @@ #include "utilities.h" #include #include -#include + +#ifdef WNT + #include +#else + #include +#endif + +#ifdef WNT + #define LibHandle HMODULE + #define LoadLib( name ) LoadLibrary( name ) + #define GetProc GetProcAddress + #define UnLoadLib( handle ) FreeLibrary( handle ); +#else + #define LibHandle void* + #define LoadLib( name ) dlopen( name, RTLD_LAZY ) + #define GetProc dlsym + #define UnLoadLib( handle ) dlclose( handle ); +#endif #include @@ -102,7 +119,7 @@ using SMESH::TPythonDump; #define NUM_TMP_FILES 2 #ifdef _DEBUG_ -static int MYDEBUG = 1; +static int MYDEBUG = 0; #else static int MYDEBUG = 0; #endif @@ -296,8 +313,51 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName const char* theLibName) throw (SALOME::SALOME_Exception) { + /* It's Need to tranlate lib name for WIN32 or X platform */ + char* aPlatformLibName = 0; + if ( theLibName && theLibName[0] != '\0' ) + { + int libNameLen = strlen(theLibName); + //check for old format "libXXXXXXX.so" + if( libNameLen > 7 && !strncmp( theLibName, "lib", 3 ) && !strcmp( theLibName+libNameLen-3, ".so" ) ) + { + //the old format +#ifdef WNT + aPlatformLibName = new char[libNameLen - 1]; + aPlatformLibName[0] = '\0'; + aPlatformLibName = strncat( aPlatformLibName, theLibName+3, libNameLen-6 ); + aPlatformLibName = strcat( aPlatformLibName, ".dll" ); + aPlatformLibName[libNameLen - 2] = '\0'; +#else + aPlatformLibName = new char[ libNameLen + 1]; + aPlatformLibName[0] = '\0'; + aPlatformLibName = strcat( aPlatformLibName, theLibName ); + aPlatformLibName[libNameLen] = '\0'; +#endif + + } + else + { + //try to use new format +#ifdef WNT + aPlatformLibName = new char[ libNameLen + 5 ]; + aPlatformLibName[0] = '\0'; + aPlatformLibName = strcat( aPlatformLibName, theLibName ); + aPlatformLibName = strcat( aPlatformLibName, ".dll" ); +#else + aPlatformLibName = new char[ libNameLen + 7 ]; + aPlatformLibName[0] = '\0'; + aPlatformLibName = strcat( aPlatformLibName, "lib" ); + aPlatformLibName = strcat( aPlatformLibName, theLibName ); + aPlatformLibName = strcat( aPlatformLibName, ".so" ); +#endif + } + } + + + Unexpect aCatch(SALOME_SalomeException); - if(MYDEBUG) MESSAGE( "Create Hypothesis <" << theHypName << "> from " << theLibName); + if(MYDEBUG) MESSAGE( "Create Hypothesis <" << theHypName << "> from " << aPlatformLibName/*theLibName*/); // create a new hypothesis object servant SMESH_Hypothesis_i* myHypothesis_i = 0; @@ -310,23 +370,27 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName { // load plugin library if(MYDEBUG) MESSAGE("Loading server meshers plugin library ..."); - void* libHandle = dlopen (theLibName, RTLD_LAZY); + LibHandle libHandle = LoadLib( aPlatformLibName/*theLibName*/ ); if (!libHandle) { // report any error, if occured +#ifndef WNT const char* anError = dlerror(); throw(SALOME_Exception(anError)); +#else + throw(SALOME_Exception(LOCALIZED( "Can't load server meshers plugin library" ))); +#endif } // get method, returning hypothesis creator if(MYDEBUG) MESSAGE("Find GetHypothesisCreator() method ..."); typedef GenericHypothesisCreator_i* (*GetHypothesisCreator)(const char* theHypName); GetHypothesisCreator procHandle = - (GetHypothesisCreator)dlsym( libHandle, "GetHypothesisCreator" ); + (GetHypothesisCreator)GetProc( libHandle, "GetHypothesisCreator" ); if (!procHandle) { throw(SALOME_Exception(LOCALIZED("bad hypothesis plugin library"))); - dlclose(libHandle); + UnLoadLib(libHandle); } // get hypothesis creator @@ -345,22 +409,23 @@ SMESH::SMESH_Hypothesis_ptr SMESH_Gen_i::createHypothesis(const char* theHypName if(MYDEBUG) MESSAGE("Create Hypothesis " << theHypName); myHypothesis_i = myHypCreatorMap[string(theHypName)]->Create (myPoa, GetCurrentStudyID(), &myGen); - // _CS_gbo Explicit activation (no longer made in the constructor). - myHypothesis_i->Activate(); - myHypothesis_i->SetLibName(theLibName); // for persistency assurance + myHypothesis_i->SetLibName(aPlatformLibName/*theLibName*/); // for persistency assurance } catch (SALOME_Exception& S_ex) { THROW_SALOME_CORBA_EXCEPTION(S_ex.what(), SALOME::BAD_PARAM); } + if ( aPlatformLibName ) + delete[] aPlatformLibName; + if (!myHypothesis_i) return hypothesis_i._retn(); // activate the CORBA servant of hypothesis hypothesis_i = SMESH::SMESH_Hypothesis::_narrow( myHypothesis_i->_this() ); int nextId = RegisterObject( hypothesis_i ); - if(MYDEBUG) MESSAGE( "Add hypo to map with id = "<< nextId ); + if(MYDEBUG) MESSAGE( "Add hypo to map with id = "<< nextId ); return hypothesis_i._retn(); } @@ -426,18 +491,23 @@ void SMESH_Gen_i::SetEmbeddedMode( CORBA::Boolean theMode ) myIsEmbeddedMode = theMode; if ( !myIsEmbeddedMode ) { - bool raiseFPE; + //PAL10867: disable signals catching with "noexcepthandler" option + char* envNoCatchSignals = getenv("NOT_INTERCEPT_SIGNALS"); + if (!envNoCatchSignals || !atoi(envNoCatchSignals)) + { + bool raiseFPE; #ifdef _DEBUG_ - raiseFPE = true; - char* envDisableFPE = getenv("DISABLE_FPE"); - if (envDisableFPE && atoi(envDisableFPE)) - raiseFPE = false; + raiseFPE = true; + char* envDisableFPE = getenv("DISABLE_FPE"); + if (envDisableFPE && atoi(envDisableFPE)) + raiseFPE = false; #else - raiseFPE = false; + raiseFPE = false; #endif - OSD::SetSignal( raiseFPE ); + OSD::SetSignal( raiseFPE ); + } + // else OSD::SetSignal() is called in GUI } - // else OSD::SetSignal() is called in GUI } //============================================================================= @@ -929,6 +999,7 @@ SMESH::algo_error_array* SMESH_Gen_i::GetAlgoState( SMESH::SMESH_Mesh_ptr theMes case ::SMESH_Gen::MISSING_ALGO: errName = SMESH::MISSING_ALGO; break; case ::SMESH_Gen::MISSING_HYPO: errName = SMESH::MISSING_HYPO; break; case ::SMESH_Gen::NOT_CONFORM_MESH: errName = SMESH::NOT_CONFORM_MESH; break; + case ::SMESH_Gen::BAD_PARAM_VALUE: errName = SMESH::BAD_PARAM_VALUE; break; default: THROW_SALOME_CORBA_EXCEPTION( "bad error name",SALOME::BAD_PARAM ); } @@ -1081,7 +1152,7 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, // Update Python script TPythonDump() << "isDone = " << this << ".Compute( " << theMesh << ", " << theShapeObject << ")"; - TPythonDump() << "if not isDone: print 'Mesh " << theMesh << " : computation failed'"; + TPythonDump() << "if not isDone: print 'Mesh', " << theMesh << ", ': computation failed'"; try { // get mesh servant @@ -1095,6 +1166,10 @@ CORBA::Boolean SMESH_Gen_i::Compute( SMESH::SMESH_Mesh_ptr theMesh, return myGen.Compute( myLocMesh, myLocShape); } } + catch ( std::bad_alloc& exc ) { + THROW_SALOME_CORBA_EXCEPTION( "Memory allocation problem", + SALOME::INTERNAL_ERROR ); + } catch ( SALOME_Exception& S_ex ) { INFOS( "Compute(): catch exception "<< S_ex.what() ); } @@ -1121,6 +1196,41 @@ SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh, throw ( SALOME::SALOME_Exception ) { Unexpect aCatch(SALOME_SalomeException); + + GEOM::GEOM_Object_var geom = FindGeometryByMeshElement(theMesh, theElementID); + if ( !geom->_is_nil() ) { + GEOM::GEOM_Object_var mainShape = theMesh->GetShapeToMesh(); + GEOM::GEOM_Gen_var geomGen = GetGeomEngine(); + + // try to find the corresponding SObject + GeomObjectToShape( geom ); // geom client remembers the found shape + SALOMEDS::SObject_var SObj = ObjectToSObject( myCurrentStudy, geom.in() ); + if ( SObj->_is_nil() ) + // publish a new subshape + SObj = geomGen->AddInStudy( myCurrentStudy, geom, theGeomName, mainShape ); + // return only published geometry + if ( !SObj->_is_nil() ) + return geom._retn(); + } + return GEOM::GEOM_Object::_nil(); +} + + +//================================================================================ +/*! + * \brief Return geometrical object the given element is built on. + * \param theMesh - the mesh the element is in + * \param theElementID - the element ID + * \retval GEOM::GEOM_Object_ptr - the found geom object + */ +//================================================================================ + +GEOM::GEOM_Object_ptr +SMESH_Gen_i::FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh, + CORBA::Long theElementID) + throw ( SALOME::SALOME_Exception ) +{ + Unexpect aCatch(SALOME_SalomeException); if ( CORBA::is_nil( theMesh ) ) THROW_SALOME_CORBA_EXCEPTION( "bad Mesh reference", SALOME::BAD_PARAM ); @@ -1145,17 +1255,8 @@ SMESH_Gen_i::GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh, if ( !op->_is_nil() ) geom = op->GetSubShape( mainShape, shapeID ); } - if ( !geom->_is_nil() ) { - // try to find the corresponding SObject - GeomObjectToShape( geom ); // geom client remembers the found shape - SALOMEDS::SObject_var SObj = ObjectToSObject( myCurrentStudy, geom.in() ); - if ( SObj->_is_nil() ) - // publish a new subshape - SObj = geomGen->AddInStudy( myCurrentStudy, geom, theGeomName, mainShape ); - // return only published geometry - if ( !SObj->_is_nil() ) - return geom._retn(); - } + if ( !geom->_is_nil() ) + return geom._retn(); } } return GEOM::GEOM_Object::_nil(); @@ -1174,21 +1275,21 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, { INFOS( "SMESH_Gen_i::Save" ); -// ASSERT( theComponent->GetStudy()->StudyId() == myCurrentStudy->StudyId() ) + // ASSERT( theComponent->GetStudy()->StudyId() == myCurrentStudy->StudyId() ) // san -- in case differs from theComponent's study, // use that of the component if ( myCurrentStudy->_is_nil() || - theComponent->GetStudy()->StudyId() != myCurrentStudy->StudyId() ) + theComponent->GetStudy()->StudyId() != myCurrentStudy->StudyId() ) SetCurrentStudy( theComponent->GetStudy() ); // Store study contents as a set of python commands SavePython(myCurrentStudy); StudyContext* myStudyContext = GetCurrentStudyContext(); - + // Declare a byte stream SALOMEDS::TMPFile_var aStreamFile; - + // Obtain a temporary dir TCollection_AsciiString tmpDir = ( isMultiFile ) ? TCollection_AsciiString( ( char* )theURL ) : ( char* )SALOMEDS_Tool::GetTmpDir().c_str(); @@ -1221,7 +1322,12 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, //Remove the files if they exist: BugID: 11225 +#ifndef WNT /* unix functionality */ TCollection_AsciiString cmd("rm -f \""); +#else /* windows */ + TCollection_AsciiString cmd("del /F \""); +#endif + cmd+=filename; cmd+="\" \""; cmd+=meshfile; @@ -1252,45 +1358,57 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( gotBranch ); for ( ; it->More(); it->Next() ) { SALOMEDS::SObject_var mySObject = it->Value(); - CORBA::Object_var anObject = SObjectToObject( mySObject ); - if ( !CORBA::is_nil( anObject ) ) { + CORBA::Object_var anObject = SObjectToObject( mySObject ); + if ( !CORBA::is_nil( anObject ) ) { SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow( anObject ); if ( !myHyp->_is_nil() ) { - SMESH_Hypothesis_i* myImpl = dynamic_cast( GetServant( myHyp ).in() ); - if ( myImpl ) { - string hypname = string( myHyp->GetName() ); - string libname = string( myHyp->GetLibName() ); - int id = myStudyContext->findId( string( GetORB()->object_to_string( anObject ) ) ); - string hypdata = string( myImpl->SaveTo() ); - - // for each hypothesis create HDF group basing on its id - char hypGrpName[30]; - sprintf( hypGrpName, "Hypothesis %d", id ); - aGroup = new HDFgroup( hypGrpName, aTopGroup ); - aGroup->CreateOnDisk(); - // --> type name of hypothesis - aSize[ 0 ] = hypname.length() + 1; - aDataset = new HDFdataset( "Name", aGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( ( char* )( hypname.c_str() ) ); - aDataset->CloseOnDisk(); - // --> server plugin library name of hypothesis - aSize[ 0 ] = libname.length() + 1; - aDataset = new HDFdataset( "LibName", aGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( ( char* )( libname.c_str() ) ); - aDataset->CloseOnDisk(); - // --> persistent data of hypothesis - aSize[ 0 ] = hypdata.length() + 1; - aDataset = new HDFdataset( "Data", aGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( ( char* )( hypdata.c_str() ) ); - aDataset->CloseOnDisk(); - // close hypothesis HDF group - aGroup->CloseOnDisk(); - } - } - } + SMESH_Hypothesis_i* myImpl = dynamic_cast( GetServant( myHyp ).in() ); + if ( myImpl ) { + string hypname = string( myHyp->GetName() ); + string libname = string( myHyp->GetLibName() ); + // BUG SWP13062 + // Needs for save crossplatform libname, i.e. parth of name ( ".dll" for + // WNT and ".so" for X-system) must be deleted + int libname_len = libname.length(); +#ifdef WNT + if( libname_len > 4 ) + libname.resize( libname_len - 4 ); +#else + if( libname_len > 3 ) + libname.resize( libname_len - 3 ); +#endif + CORBA::String_var objStr = GetORB()->object_to_string( anObject ); + int id = myStudyContext->findId( string( objStr.in() ) ); + string hypdata = string( myImpl->SaveTo() ); + + // for each hypothesis create HDF group basing on its id + char hypGrpName[30]; + sprintf( hypGrpName, "Hypothesis %d", id ); + aGroup = new HDFgroup( hypGrpName, aTopGroup ); + aGroup->CreateOnDisk(); + // --> type name of hypothesis + aSize[ 0 ] = hypname.length() + 1; + aDataset = new HDFdataset( "Name", aGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( ( char* )( hypname.c_str() ) ); + aDataset->CloseOnDisk(); + // --> server plugin library name of hypothesis + aSize[ 0 ] = libname.length() + 1; + aDataset = new HDFdataset( "LibName", aGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( ( char* )( libname.c_str() ) ); + aDataset->CloseOnDisk(); + // --> persistent data of hypothesis + aSize[ 0 ] = hypdata.length() + 1; + aDataset = new HDFdataset( "Data", aGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( ( char* )( hypdata.c_str() ) ); + aDataset->CloseOnDisk(); + // close hypothesis HDF group + aGroup->CloseOnDisk(); + } + } + } } // close hypotheses root HDF group aTopGroup->CloseOnDisk(); @@ -1305,45 +1423,57 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( gotBranch ); for ( ; it->More(); it->Next() ) { SALOMEDS::SObject_var mySObject = it->Value(); - CORBA::Object_var anObject = SObjectToObject( mySObject ); - if ( !CORBA::is_nil( anObject ) ) { + CORBA::Object_var anObject = SObjectToObject( mySObject ); + if ( !CORBA::is_nil( anObject ) ) { SMESH::SMESH_Hypothesis_var myHyp = SMESH::SMESH_Hypothesis::_narrow( anObject ); if ( !myHyp->_is_nil() ) { - SMESH_Hypothesis_i* myImpl = dynamic_cast( GetServant( myHyp ).in() ); - if ( myImpl ) { - string hypname = string( myHyp->GetName() ); - string libname = string( myHyp->GetLibName() ); - int id = myStudyContext->findId( string( GetORB()->object_to_string( anObject ) ) ); - string hypdata = string( myImpl->SaveTo() ); - - // for each algorithm create HDF group basing on its id - char hypGrpName[30]; - sprintf( hypGrpName, "Algorithm %d", id ); - aGroup = new HDFgroup( hypGrpName, aTopGroup ); - aGroup->CreateOnDisk(); - // --> type name of algorithm - aSize[0] = hypname.length() + 1; - aDataset = new HDFdataset( "Name", aGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( ( char* )( hypname.c_str() ) ); - aDataset->CloseOnDisk(); - // --> server plugin library name of hypothesis - aSize[0] = libname.length() + 1; - aDataset = new HDFdataset( "LibName", aGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( ( char* )( libname.c_str() ) ); - aDataset->CloseOnDisk(); - // --> persistent data of algorithm - aSize[0] = hypdata.length() + 1; - aDataset = new HDFdataset( "Data", aGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( ( char* )( hypdata.c_str() ) ); - aDataset->CloseOnDisk(); - // close algorithm HDF group - aGroup->CloseOnDisk(); - } - } - } + SMESH_Hypothesis_i* myImpl = dynamic_cast( GetServant( myHyp ).in() ); + if ( myImpl ) { + string hypname = string( myHyp->GetName() ); + string libname = string( myHyp->GetLibName() ); + // BUG SWP13062 + // Needs for save crossplatform libname, i.e. parth of name ( ".dll" for + // WNT and ".so" for X-system) must be deleted + int libname_len = libname.length(); +#ifdef WNT + if( libname_len > 4 ) + libname.resize( libname_len - 4 ); +#else + if( libname_len > 3 ) + libname.resize( libname_len - 3 ); +#endif + CORBA::String_var objStr = GetORB()->object_to_string( anObject ); + int id = myStudyContext->findId( string( objStr.in() ) ); + string hypdata = string( myImpl->SaveTo() ); + + // for each algorithm create HDF group basing on its id + char hypGrpName[30]; + sprintf( hypGrpName, "Algorithm %d", id ); + aGroup = new HDFgroup( hypGrpName, aTopGroup ); + aGroup->CreateOnDisk(); + // --> type name of algorithm + aSize[0] = hypname.length() + 1; + aDataset = new HDFdataset( "Name", aGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( ( char* )( hypname.c_str() ) ); + aDataset->CloseOnDisk(); + // --> server plugin library name of hypothesis + aSize[0] = libname.length() + 1; + aDataset = new HDFdataset( "LibName", aGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( ( char* )( libname.c_str() ) ); + aDataset->CloseOnDisk(); + // --> persistent data of algorithm + aSize[0] = hypdata.length() + 1; + aDataset = new HDFdataset( "Data", aGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( ( char* )( hypdata.c_str() ) ); + aDataset->CloseOnDisk(); + // close algorithm HDF group + aGroup->CloseOnDisk(); + } + } + } } // close algorithms root HDF group aTopGroup->CloseOnDisk(); @@ -1352,152 +1482,155 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, else if ( gotBranch->Tag() > GetAlgorithmsRootTag() ) { CORBA::Object_var anObject = SObjectToObject( gotBranch ); if ( !CORBA::is_nil( anObject ) ) { - SMESH::SMESH_Mesh_var myMesh = SMESH::SMESH_Mesh::_narrow( anObject ) ; + SMESH::SMESH_Mesh_var myMesh = SMESH::SMESH_Mesh::_narrow( anObject ) ; if ( !myMesh->_is_nil() ) { - SMESH_Mesh_i* myImpl = dynamic_cast( GetServant( myMesh ).in() ); - if ( myImpl ) { - int id = myStudyContext->findId( string( GetORB()->object_to_string( anObject ) ) ); - ::SMESH_Mesh& myLocMesh = myImpl->GetImpl(); - SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS(); - - // for each mesh open the HDF group basing on its id - char meshGrpName[ 30 ]; - sprintf( meshGrpName, "Mesh %d", id ); - aTopGroup = new HDFgroup( meshGrpName, aFile ); - aTopGroup->CreateOnDisk(); - - // --> put dataset to hdf file which is a flag that mesh has data - string strHasData = "0"; - // check if the mesh is not empty - if ( mySMESHDSMesh->NbNodes() > 0 ) { - // write mesh data to med file - myWriter.SetMesh( mySMESHDSMesh ); - myWriter.SetMeshId( id ); - strHasData = "1"; - } - aSize[ 0 ] = strHasData.length() + 1; - aDataset = new HDFdataset( "Has data", aTopGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( ( char* )( strHasData.c_str() ) ); - aDataset->CloseOnDisk(); - - // write reference on a shape if exists - SALOMEDS::SObject_var myRef; + SMESH_Mesh_i* myImpl = dynamic_cast( GetServant( myMesh ).in() ); + if ( myImpl ) { + CORBA::String_var objStr = GetORB()->object_to_string( anObject ); + int id = myStudyContext->findId( string( objStr.in() ) ); + ::SMESH_Mesh& myLocMesh = myImpl->GetImpl(); + SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS(); + + // for each mesh open the HDF group basing on its id + char meshGrpName[ 30 ]; + sprintf( meshGrpName, "Mesh %d", id ); + aTopGroup = new HDFgroup( meshGrpName, aFile ); + aTopGroup->CreateOnDisk(); + + // --> put dataset to hdf file which is a flag that mesh has data + string strHasData = "0"; + // check if the mesh is not empty + if ( mySMESHDSMesh->NbNodes() > 0 ) { + // write mesh data to med file + myWriter.SetMesh( mySMESHDSMesh ); + myWriter.SetMeshId( id ); + strHasData = "1"; + } + aSize[ 0 ] = strHasData.length() + 1; + aDataset = new HDFdataset( "Has data", aTopGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( ( char* )( strHasData.c_str() ) ); + aDataset->CloseOnDisk(); + + // write reference on a shape if exists + SALOMEDS::SObject_var myRef; bool shapeRefFound = false; - bool found = gotBranch->FindSubObject( GetRefOnShapeTag(), myRef ); - if ( found ) { - SALOMEDS::SObject_var myShape; - bool ok = myRef->ReferencedObject( myShape ); - if ( ok ) { + bool found = gotBranch->FindSubObject( GetRefOnShapeTag(), myRef ); + if ( found ) { + SALOMEDS::SObject_var myShape; + bool ok = myRef->ReferencedObject( myShape ); + if ( ok ) { shapeRefFound = (! CORBA::is_nil( myShape->GetObject() )); - string myRefOnObject = myShape->GetID(); - if ( shapeRefFound && myRefOnObject.length() > 0 ) { - aSize[ 0 ] = myRefOnObject.length() + 1; - aDataset = new HDFdataset( "Ref on shape", aTopGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); - aDataset->CloseOnDisk(); - } - } - } + string myRefOnObject = myShape->GetID(); + if ( shapeRefFound && myRefOnObject.length() > 0 ) { + aSize[ 0 ] = myRefOnObject.length() + 1; + aDataset = new HDFdataset( "Ref on shape", aTopGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); + aDataset->CloseOnDisk(); + } + } + } - // write applied hypotheses if exist - SALOMEDS::SObject_var myHypBranch; - found = gotBranch->FindSubObject( GetRefOnAppliedHypothesisTag(), myHypBranch ); - if ( found && !shapeRefFound ) { // remove applied hyps + // write applied hypotheses if exist + SALOMEDS::SObject_var myHypBranch; + found = gotBranch->FindSubObject( GetRefOnAppliedHypothesisTag(), myHypBranch ); + if ( found && !shapeRefFound ) { // remove applied hyps myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( myHypBranch ); } - if ( found && shapeRefFound ) { - aGroup = new HDFgroup( "Applied Hypotheses", aTopGroup ); - aGroup->CreateOnDisk(); - - SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( myHypBranch ); - int hypNb = 0; - for ( ; it->More(); it->Next() ) { - SALOMEDS::SObject_var mySObject = it->Value(); - SALOMEDS::SObject_var myRefOnHyp; - bool ok = mySObject->ReferencedObject( myRefOnHyp ); - if ( ok ) { - // san - it is impossible to recover applied hypotheses + if ( found && shapeRefFound ) { + aGroup = new HDFgroup( "Applied Hypotheses", aTopGroup ); + aGroup->CreateOnDisk(); + + SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( myHypBranch ); + int hypNb = 0; + for ( ; it->More(); it->Next() ) { + SALOMEDS::SObject_var mySObject = it->Value(); + SALOMEDS::SObject_var myRefOnHyp; + bool ok = mySObject->ReferencedObject( myRefOnHyp ); + if ( ok ) { + // san - it is impossible to recover applied hypotheses // using their entries within Load() method, - // for there are no AttributeIORs in the study when Load() is working. - // Hence, it is better to store persistent IDs of hypotheses as references to them - - //string myRefOnObject = myRefOnHyp->GetID(); - CORBA::Object_var anObject = SObjectToObject( myRefOnHyp ); - int id = myStudyContext->findId( string( GetORB()->object_to_string( anObject ) ) ); - //if ( myRefOnObject.length() > 0 ) { - //aSize[ 0 ] = myRefOnObject.length() + 1; - char hypName[ 30 ], hypId[ 30 ]; - sprintf( hypName, "Hyp %d", ++hypNb ); - sprintf( hypId, "%d", id ); - aSize[ 0 ] = strlen( hypId ) + 1; - aDataset = new HDFdataset( hypName, aGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - //aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); - aDataset->WriteOnDisk( hypId ); - aDataset->CloseOnDisk(); - //} - } - } - aGroup->CloseOnDisk(); - } + // for there are no AttributeIORs in the study when Load() is working. + // Hence, it is better to store persistent IDs of hypotheses as references to them + + //string myRefOnObject = myRefOnHyp->GetID(); + CORBA::Object_var anObject = SObjectToObject( myRefOnHyp ); + CORBA::String_var objStr = GetORB()->object_to_string( anObject ); + int id = myStudyContext->findId( string( objStr.in() ) ); + //if ( myRefOnObject.length() > 0 ) { + //aSize[ 0 ] = myRefOnObject.length() + 1; + char hypName[ 30 ], hypId[ 30 ]; + sprintf( hypName, "Hyp %d", ++hypNb ); + sprintf( hypId, "%d", id ); + aSize[ 0 ] = strlen( hypId ) + 1; + aDataset = new HDFdataset( hypName, aGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + //aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); + aDataset->WriteOnDisk( hypId ); + aDataset->CloseOnDisk(); + //} + } + } + aGroup->CloseOnDisk(); + } - // write applied algorithms if exist - SALOMEDS::SObject_var myAlgoBranch; - found = gotBranch->FindSubObject( GetRefOnAppliedAlgorithmsTag(), myAlgoBranch ); - if ( found && !shapeRefFound ) { // remove applied algos + // write applied algorithms if exist + SALOMEDS::SObject_var myAlgoBranch; + found = gotBranch->FindSubObject( GetRefOnAppliedAlgorithmsTag(), myAlgoBranch ); + if ( found && !shapeRefFound ) { // remove applied algos myCurrentStudy->NewBuilder()->RemoveObjectWithChildren( myAlgoBranch ); } - if ( found && shapeRefFound ) { - aGroup = new HDFgroup( "Applied Algorithms", aTopGroup ); - aGroup->CreateOnDisk(); - - SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( myAlgoBranch ); - int algoNb = 0; - for ( ; it->More(); it->Next() ) { - SALOMEDS::SObject_var mySObject = it->Value(); - SALOMEDS::SObject_var myRefOnAlgo; - bool ok = mySObject->ReferencedObject( myRefOnAlgo ); - if ( ok ) { - // san - it is impossible to recover applied algorithms + if ( found && shapeRefFound ) { + aGroup = new HDFgroup( "Applied Algorithms", aTopGroup ); + aGroup->CreateOnDisk(); + + SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( myAlgoBranch ); + int algoNb = 0; + for ( ; it->More(); it->Next() ) { + SALOMEDS::SObject_var mySObject = it->Value(); + SALOMEDS::SObject_var myRefOnAlgo; + bool ok = mySObject->ReferencedObject( myRefOnAlgo ); + if ( ok ) { + // san - it is impossible to recover applied algorithms // using their entries within Load() method, - // for there are no AttributeIORs in the study when Load() is working. - // Hence, it is better to store persistent IDs of algorithms as references to them - - //string myRefOnObject = myRefOnAlgo->GetID(); - CORBA::Object_var anObject = SObjectToObject( myRefOnAlgo ); - int id = myStudyContext->findId( string( GetORB()->object_to_string( anObject ) ) ); - //if ( myRefOnObject.length() > 0 ) { - //aSize[ 0 ] = myRefOnObject.length() + 1; - char algoName[ 30 ], algoId[ 30 ]; - sprintf( algoName, "Algo %d", ++algoNb ); - sprintf( algoId, "%d", id ); - aSize[ 0 ] = strlen( algoId ) + 1; - aDataset = new HDFdataset( algoName, aGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - //aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); - aDataset->WriteOnDisk( algoId ); - aDataset->CloseOnDisk(); - //} - } - } - aGroup->CloseOnDisk(); - } + // for there are no AttributeIORs in the study when Load() is working. + // Hence, it is better to store persistent IDs of algorithms as references to them + + //string myRefOnObject = myRefOnAlgo->GetID(); + CORBA::Object_var anObject = SObjectToObject( myRefOnAlgo ); + CORBA::String_var objStr = GetORB()->object_to_string( anObject ); + int id = myStudyContext->findId( string( objStr.in() ) ); + //if ( myRefOnObject.length() > 0 ) { + //aSize[ 0 ] = myRefOnObject.length() + 1; + char algoName[ 30 ], algoId[ 30 ]; + sprintf( algoName, "Algo %d", ++algoNb ); + sprintf( algoId, "%d", id ); + aSize[ 0 ] = strlen( algoId ) + 1; + aDataset = new HDFdataset( algoName, aGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + //aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); + aDataset->WriteOnDisk( algoId ); + aDataset->CloseOnDisk(); + //} + } + } + aGroup->CloseOnDisk(); + } - // --> submesh objects sub-branches + // --> submesh objects sub-branches - for ( int i = GetSubMeshOnVertexTag(); i <= GetSubMeshOnCompoundTag(); i++ ) { - SALOMEDS::SObject_var mySubmeshBranch; - found = gotBranch->FindSubObject( i, mySubmeshBranch ); + for ( int i = GetSubMeshOnVertexTag(); i <= GetSubMeshOnCompoundTag(); i++ ) { + SALOMEDS::SObject_var mySubmeshBranch; + found = gotBranch->FindSubObject( i, mySubmeshBranch ); if ( found ) // check if there is shape reference in submeshes { bool hasShapeRef = false; - SALOMEDS::ChildIterator_var itSM = + SALOMEDS::ChildIterator_var itSM = myCurrentStudy->NewChildIterator( mySubmeshBranch ); - for ( ; itSM->More(); itSM->Next() ) { - SALOMEDS::SObject_var mySubRef, myShape, mySObject = itSM->Value(); + for ( ; itSM->More(); itSM->Next() ) { + SALOMEDS::SObject_var mySubRef, myShape, mySObject = itSM->Value(); if ( mySObject->FindSubObject( GetRefOnShapeTag(), mySubRef )) mySubRef->ReferencedObject( myShape ); if ( !CORBA::is_nil( myShape ) && !CORBA::is_nil( myShape->GetObject() )) @@ -1528,44 +1661,45 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, found = false; } } // end check if there is shape reference in submeshes - if ( found ) { - char name_meshgroup[ 30 ]; - if ( i == GetSubMeshOnVertexTag() ) - strcpy( name_meshgroup, "SubMeshes On Vertex" ); - else if ( i == GetSubMeshOnEdgeTag() ) - strcpy( name_meshgroup, "SubMeshes On Edge" ); - else if ( i == GetSubMeshOnWireTag() ) - strcpy( name_meshgroup, "SubMeshes On Wire" ); - else if ( i == GetSubMeshOnFaceTag() ) - strcpy( name_meshgroup, "SubMeshes On Face" ); - else if ( i == GetSubMeshOnShellTag() ) - strcpy( name_meshgroup, "SubMeshes On Shell" ); - else if ( i == GetSubMeshOnSolidTag() ) - strcpy( name_meshgroup, "SubMeshes On Solid" ); - else if ( i == GetSubMeshOnCompoundTag() ) - strcpy( name_meshgroup, "SubMeshes On Compound" ); - - // for each type of submeshes create container HDF group - aGroup = new HDFgroup( name_meshgroup, aTopGroup ); - aGroup->CreateOnDisk(); - - // iterator for all submeshes of given type - SALOMEDS::ChildIterator_var itSM = myCurrentStudy->NewChildIterator( mySubmeshBranch ); - for ( ; itSM->More(); itSM->Next() ) { - SALOMEDS::SObject_var mySObject = itSM->Value(); - CORBA::Object_var anSubObject = SObjectToObject( mySObject ); - if ( !CORBA::is_nil( anSubObject )) + if ( found ) { + char name_meshgroup[ 30 ]; + if ( i == GetSubMeshOnVertexTag() ) + strcpy( name_meshgroup, "SubMeshes On Vertex" ); + else if ( i == GetSubMeshOnEdgeTag() ) + strcpy( name_meshgroup, "SubMeshes On Edge" ); + else if ( i == GetSubMeshOnWireTag() ) + strcpy( name_meshgroup, "SubMeshes On Wire" ); + else if ( i == GetSubMeshOnFaceTag() ) + strcpy( name_meshgroup, "SubMeshes On Face" ); + else if ( i == GetSubMeshOnShellTag() ) + strcpy( name_meshgroup, "SubMeshes On Shell" ); + else if ( i == GetSubMeshOnSolidTag() ) + strcpy( name_meshgroup, "SubMeshes On Solid" ); + else if ( i == GetSubMeshOnCompoundTag() ) + strcpy( name_meshgroup, "SubMeshes On Compound" ); + + // for each type of submeshes create container HDF group + aGroup = new HDFgroup( name_meshgroup, aTopGroup ); + aGroup->CreateOnDisk(); + + // iterator for all submeshes of given type + SALOMEDS::ChildIterator_var itSM = myCurrentStudy->NewChildIterator( mySubmeshBranch ); + for ( ; itSM->More(); itSM->Next() ) { + SALOMEDS::SObject_var mySObject = itSM->Value(); + CORBA::Object_var anSubObject = SObjectToObject( mySObject ); + if ( !CORBA::is_nil( anSubObject )) { - SMESH::SMESH_subMesh_var mySubMesh = SMESH::SMESH_subMesh::_narrow( anSubObject ) ; - int subid = myStudyContext->findId( string( GetORB()->object_to_string( anSubObject ) ) ); - - // for each mesh open the HDF group basing on its id - char submeshGrpName[ 30 ]; - sprintf( submeshGrpName, "SubMesh %d", subid ); - aSubGroup = new HDFgroup( submeshGrpName, aGroup ); - aSubGroup->CreateOnDisk(); + SMESH::SMESH_subMesh_var mySubMesh = SMESH::SMESH_subMesh::_narrow( anSubObject ) ; + CORBA::String_var objStr = GetORB()->object_to_string( anSubObject ); + int subid = myStudyContext->findId( string( objStr.in() ) ); + + // for each mesh open the HDF group basing on its id + char submeshGrpName[ 30 ]; + sprintf( submeshGrpName, "SubMesh %d", subid ); + aSubGroup = new HDFgroup( submeshGrpName, aGroup ); + aSubGroup->CreateOnDisk(); - // write reference on a shape, already checked if it exists + // write reference on a shape, already checked if it exists SALOMEDS::SObject_var mySubRef, myShape; if ( mySObject->FindSubObject( GetRefOnShapeTag(), mySubRef )) mySubRef->ReferencedObject( myShape ); @@ -1578,81 +1712,83 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, aDataset->CloseOnDisk(); } - // write applied hypotheses if exist - SALOMEDS::SObject_var mySubHypBranch; - found = mySObject->FindSubObject( GetRefOnAppliedHypothesisTag(), mySubHypBranch ); - if ( found ) { - aSubSubGroup = new HDFgroup( "Applied Hypotheses", aSubGroup ); - aSubSubGroup->CreateOnDisk(); - - SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( mySubHypBranch ); - int hypNb = 0; - for ( ; it->More(); it->Next() ) { - SALOMEDS::SObject_var mySubSObject = it->Value(); - SALOMEDS::SObject_var myRefOnHyp; - bool ok = mySubSObject->ReferencedObject( myRefOnHyp ); - if ( ok ) { - //string myRefOnObject = myRefOnHyp->GetID(); - CORBA::Object_var anObject = SObjectToObject( myRefOnHyp ); - int id = myStudyContext->findId( string( GetORB()->object_to_string( anObject ) ) ); - //if ( myRefOnObject.length() > 0 ) { - //aSize[ 0 ] = myRefOnObject.length() + 1; - char hypName[ 30 ], hypId[ 30 ]; - sprintf( hypName, "Hyp %d", ++hypNb ); - sprintf( hypId, "%d", id ); - aSize[ 0 ] = strlen( hypId ) + 1; - aDataset = new HDFdataset( hypName, aSubSubGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - //aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); - aDataset->WriteOnDisk( hypId ); - aDataset->CloseOnDisk(); - //} - } - } - aSubSubGroup->CloseOnDisk(); - } - - // write applied algorithms if exist - SALOMEDS::SObject_var mySubAlgoBranch; - found = mySObject->FindSubObject( GetRefOnAppliedAlgorithmsTag(), mySubAlgoBranch ); - if ( found ) { - aSubSubGroup = new HDFgroup( "Applied Algorithms", aSubGroup ); - aSubSubGroup->CreateOnDisk(); - - SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( mySubAlgoBranch ); - int algoNb = 0; - for ( ; it->More(); it->Next() ) { - SALOMEDS::SObject_var mySubSObject = it->Value(); - SALOMEDS::SObject_var myRefOnAlgo; - bool ok = mySubSObject->ReferencedObject( myRefOnAlgo ); - if ( ok ) { - //string myRefOnObject = myRefOnAlgo->GetID(); - CORBA::Object_var anObject = SObjectToObject( myRefOnAlgo ); - int id = myStudyContext->findId( string( GetORB()->object_to_string( anObject ) ) ); - //if ( myRefOnObject.length() > 0 ) { - //aSize[ 0 ] = myRefOnObject.length() + 1; - char algoName[ 30 ], algoId[ 30 ]; - sprintf( algoName, "Algo %d", ++algoNb ); - sprintf( algoId, "%d", id ); - aSize[ 0 ] = strlen( algoId ) + 1; - aDataset = new HDFdataset( algoName, aSubSubGroup, HDF_STRING, aSize, 1 ); - aDataset->CreateOnDisk(); - //aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); - aDataset->WriteOnDisk( algoId ); - aDataset->CloseOnDisk(); - //} - } - } - aSubSubGroup->CloseOnDisk(); - } - // close submesh HDF group - aSubGroup->CloseOnDisk(); - } - } - // close container of submeshes by type HDF group - aGroup->CloseOnDisk(); - } - } + // write applied hypotheses if exist + SALOMEDS::SObject_var mySubHypBranch; + found = mySObject->FindSubObject( GetRefOnAppliedHypothesisTag(), mySubHypBranch ); + if ( found ) { + aSubSubGroup = new HDFgroup( "Applied Hypotheses", aSubGroup ); + aSubSubGroup->CreateOnDisk(); + + SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( mySubHypBranch ); + int hypNb = 0; + for ( ; it->More(); it->Next() ) { + SALOMEDS::SObject_var mySubSObject = it->Value(); + SALOMEDS::SObject_var myRefOnHyp; + bool ok = mySubSObject->ReferencedObject( myRefOnHyp ); + if ( ok ) { + //string myRefOnObject = myRefOnHyp->GetID(); + CORBA::Object_var anObject = SObjectToObject( myRefOnHyp ); + CORBA::String_var objStr = GetORB()->object_to_string( anObject ); + int id = myStudyContext->findId( string( objStr.in() ) ); + //if ( myRefOnObject.length() > 0 ) { + //aSize[ 0 ] = myRefOnObject.length() + 1; + char hypName[ 30 ], hypId[ 30 ]; + sprintf( hypName, "Hyp %d", ++hypNb ); + sprintf( hypId, "%d", id ); + aSize[ 0 ] = strlen( hypId ) + 1; + aDataset = new HDFdataset( hypName, aSubSubGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + //aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); + aDataset->WriteOnDisk( hypId ); + aDataset->CloseOnDisk(); + //} + } + } + aSubSubGroup->CloseOnDisk(); + } + + // write applied algorithms if exist + SALOMEDS::SObject_var mySubAlgoBranch; + found = mySObject->FindSubObject( GetRefOnAppliedAlgorithmsTag(), mySubAlgoBranch ); + if ( found ) { + aSubSubGroup = new HDFgroup( "Applied Algorithms", aSubGroup ); + aSubSubGroup->CreateOnDisk(); + + SALOMEDS::ChildIterator_var it = myCurrentStudy->NewChildIterator( mySubAlgoBranch ); + int algoNb = 0; + for ( ; it->More(); it->Next() ) { + SALOMEDS::SObject_var mySubSObject = it->Value(); + SALOMEDS::SObject_var myRefOnAlgo; + bool ok = mySubSObject->ReferencedObject( myRefOnAlgo ); + if ( ok ) { + //string myRefOnObject = myRefOnAlgo->GetID(); + CORBA::Object_var anObject = SObjectToObject( myRefOnAlgo ); + CORBA::String_var objStr = GetORB()->object_to_string( anObject ); + int id = myStudyContext->findId( string( objStr.in() ) ); + //if ( myRefOnObject.length() > 0 ) { + //aSize[ 0 ] = myRefOnObject.length() + 1; + char algoName[ 30 ], algoId[ 30 ]; + sprintf( algoName, "Algo %d", ++algoNb ); + sprintf( algoId, "%d", id ); + aSize[ 0 ] = strlen( algoId ) + 1; + aDataset = new HDFdataset( algoName, aSubSubGroup, HDF_STRING, aSize, 1 ); + aDataset->CreateOnDisk(); + //aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); + aDataset->WriteOnDisk( algoId ); + aDataset->CloseOnDisk(); + //} + } + } + aSubSubGroup->CloseOnDisk(); + } + // close submesh HDF group + aSubGroup->CloseOnDisk(); + } + } + // close container of submeshes by type HDF group + aGroup->CloseOnDisk(); + } + } // All sub-meshes will be stored in MED file // .. will NOT (PAL 12992) //if ( shapeRefFound ) @@ -1682,19 +1818,20 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, CORBA::Object_var aSubObject = SObjectToObject( mySObject ); if ( !CORBA::is_nil( aSubObject ) ) { SMESH_GroupBase_i* myGroupImpl = - dynamic_cast( GetServant( aSubObject ).in() ); + dynamic_cast( GetServant( aSubObject ).in() ); if ( !myGroupImpl ) continue; - - int anId = myStudyContext->findId( string( GetORB()->object_to_string( aSubObject ) ) ); + + CORBA::String_var objStr = GetORB()->object_to_string( aSubObject ); + int anId = myStudyContext->findId( string( objStr.in() ) ); // For each group, create a dataset named "Group " - // and store the group's user name into it + // and store the group's user name into it char grpName[ 30 ]; sprintf( grpName, "Group %d", anId ); char* aUserName = myGroupImpl->GetName(); aSize[ 0 ] = strlen( aUserName ) + 1; - + aDataset = new HDFdataset( grpName, aGroup, HDF_STRING, aSize, 1 ); aDataset->CreateOnDisk(); aDataset->WriteOnDisk( aUserName ); @@ -1702,263 +1839,263 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, // Store the group contents into MED file if ( myLocMesh.GetGroup( myGroupImpl->GetLocalID() ) ) { - + if(MYDEBUG) MESSAGE( "VSR - SMESH_Gen_i::Save(): saving group with StoreName = " - << grpName << " to MED file" ); + << grpName << " to MED file" ); SMESHDS_GroupBase* aGrpBaseDS = - myLocMesh.GetGroup( myGroupImpl->GetLocalID() )->GetGroupDS(); + myLocMesh.GetGroup( myGroupImpl->GetLocalID() )->GetGroupDS(); aGrpBaseDS->SetStoreName( grpName ); // Pass SMESHDS_Group to MED writer SMESHDS_Group* aGrpDS = dynamic_cast( aGrpBaseDS ); - if ( aGrpDS ) - myWriter.AddGroup( aGrpDS ); - - // write reference on a shape if exists - SMESHDS_GroupOnGeom* aGeomGrp = - dynamic_cast( aGrpBaseDS ); - if ( aGeomGrp ) { - SALOMEDS::SObject_var mySubRef, myShape; - if (mySObject->FindSubObject( GetRefOnShapeTag(), mySubRef ) && - mySubRef->ReferencedObject( myShape ) && - !CORBA::is_nil( myShape->GetObject() )) - { - string myRefOnObject = myShape->GetID(); - if ( myRefOnObject.length() > 0 ) { - char aRefName[ 30 ]; - sprintf( aRefName, "Ref on shape %d", anId); - aSize[ 0 ] = myRefOnObject.length() + 1; - aDataset = new HDFdataset(aRefName, aGroup, HDF_STRING, aSize, 1); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); - aDataset->CloseOnDisk(); - } - } - else // shape ref is invalid: - { - // save a group on geometry as ordinary group - myWriter.AddGroup( aGeomGrp ); - } - } + if ( aGrpDS ) + myWriter.AddGroup( aGrpDS ); + + // write reference on a shape if exists + SMESHDS_GroupOnGeom* aGeomGrp = + dynamic_cast( aGrpBaseDS ); + if ( aGeomGrp ) { + SALOMEDS::SObject_var mySubRef, myShape; + if (mySObject->FindSubObject( GetRefOnShapeTag(), mySubRef ) && + mySubRef->ReferencedObject( myShape ) && + !CORBA::is_nil( myShape->GetObject() )) + { + string myRefOnObject = myShape->GetID(); + if ( myRefOnObject.length() > 0 ) { + char aRefName[ 30 ]; + sprintf( aRefName, "Ref on shape %d", anId); + aSize[ 0 ] = myRefOnObject.length() + 1; + aDataset = new HDFdataset(aRefName, aGroup, HDF_STRING, aSize, 1); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( ( char* )( myRefOnObject.c_str() ) ); + aDataset->CloseOnDisk(); + } + } + else // shape ref is invalid: + { + // save a group on geometry as ordinary group + myWriter.AddGroup( aGeomGrp ); + } + } } } } aGroup->CloseOnDisk(); } } // loop on groups - + if ( strcmp( strHasData.c_str(), "1" ) == 0 ) - { - // Flush current mesh information into MED file + { + // Flush current mesh information into MED file myWriter.Perform(); - - // maybe a shape was deleted in the study - if ( !shapeRefFound && !mySMESHDSMesh->ShapeToMesh().IsNull() ) { - TopoDS_Shape nullShape; - myLocMesh.ShapeToMesh( nullShape ); // remove shape referring data - } - - if ( !mySMESHDSMesh->SubMeshes().empty() ) - { - // Store submeshes - // ---------------- - aGroup = new HDFgroup( "Submeshes", aTopGroup ); - aGroup->CreateOnDisk(); - - // each element belongs to one or none submesh, - // so for each node/element, we store a submesh ID - - // Make maps of submesh IDs of elements sorted by element IDs - typedef int TElemID; - typedef int TSubMID; - map< TElemID, TSubMID > eId2smId, nId2smId; - map< TElemID, TSubMID >::iterator hint; // insertion to map is done before hint - const map& aSubMeshes = mySMESHDSMesh->SubMeshes(); - map::const_iterator itSubM ( aSubMeshes.begin() ); - SMDS_NodeIteratorPtr itNode; - SMDS_ElemIteratorPtr itElem; - for ( itSubM = aSubMeshes.begin(); itSubM != aSubMeshes.end() ; itSubM++ ) - { - TSubMID aSubMeID = itSubM->first; - SMESHDS_SubMesh* aSubMesh = itSubM->second; - if ( aSubMesh->IsComplexSubmesh() ) - continue; // submesh containing other submeshs - // nodes - hint = nId2smId.begin(); // optimize insertion basing on increasing order of elem Ids in submesh - for ( itNode = aSubMesh->GetNodes(); itNode->more(); ++hint) - hint = nId2smId.insert( hint, make_pair( itNode->next()->GetID(), aSubMeID )); + + // maybe a shape was deleted in the study + if ( !shapeRefFound && !mySMESHDSMesh->ShapeToMesh().IsNull() ) { + TopoDS_Shape nullShape; + myLocMesh.ShapeToMesh( nullShape ); // remove shape referring data + } + + if ( !mySMESHDSMesh->SubMeshes().empty() ) + { + // Store submeshes + // ---------------- + aGroup = new HDFgroup( "Submeshes", aTopGroup ); + aGroup->CreateOnDisk(); + + // each element belongs to one or none submesh, + // so for each node/element, we store a submesh ID + + // Make maps of submesh IDs of elements sorted by element IDs + typedef int TElemID; + typedef int TSubMID; + map< TElemID, TSubMID > eId2smId, nId2smId; + map< TElemID, TSubMID >::iterator hint; // insertion to map is done before hint + const map& aSubMeshes = mySMESHDSMesh->SubMeshes(); + map::const_iterator itSubM ( aSubMeshes.begin() ); + SMDS_NodeIteratorPtr itNode; + SMDS_ElemIteratorPtr itElem; + for ( itSubM = aSubMeshes.begin(); itSubM != aSubMeshes.end() ; itSubM++ ) + { + TSubMID aSubMeID = itSubM->first; + SMESHDS_SubMesh* aSubMesh = itSubM->second; + if ( aSubMesh->IsComplexSubmesh() ) + continue; // submesh containing other submeshs + // nodes + hint = nId2smId.begin(); // optimize insertion basing on increasing order of elem Ids in submesh + for ( itNode = aSubMesh->GetNodes(); itNode->more(); ++hint) + hint = nId2smId.insert( hint, make_pair( itNode->next()->GetID(), aSubMeID )); // elements - hint = eId2smId.begin(); - for ( itElem = aSubMesh->GetElements(); itElem->more(); ++hint) - hint = eId2smId.insert( hint, make_pair( itElem->next()->GetID(), aSubMeID )); - } - - // Care of elements that are not on submeshes - if ( mySMESHDSMesh->NbNodes() != nId2smId.size() ) { - for ( itNode = mySMESHDSMesh->nodesIterator(); itNode->more(); ) - /* --- stl_map.h says : */ - /* A %map relies on unique keys and thus a %pair is only inserted if its */ - /* first element (the key) is not already present in the %map. */ - nId2smId.insert( make_pair( itNode->next()->GetID(), 0 )); - } - int nbElems = mySMESHDSMesh->NbEdges() + mySMESHDSMesh->NbFaces() + mySMESHDSMesh->NbVolumes(); - if ( nbElems != eId2smId.size() ) { - for ( itElem = mySMESHDSMesh->elementsIterator(); itElem->more(); ) - eId2smId.insert( make_pair( itElem->next()->GetID(), 0 )); - } - - // Store submesh IDs - for ( int isNode = 0; isNode < 2; ++isNode ) - { - map< TElemID, TSubMID >& id2smId = isNode ? nId2smId : eId2smId; - if ( id2smId.empty() ) continue; - map< TElemID, TSubMID >::const_iterator id_smId = id2smId.begin(); - // make and fill array of submesh IDs - int* smIDs = new int [ id2smId.size() ]; - for ( int i = 0; id_smId != id2smId.end(); ++id_smId, ++i ) - smIDs[ i ] = id_smId->second; - // write HDF group - aSize[ 0 ] = id2smId.size(); - string aDSName( isNode ? "Node Submeshes" : "Element Submeshes"); - aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_INT32, aSize, 1 ); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( smIDs ); - aDataset->CloseOnDisk(); - // - delete smIDs; - } + hint = eId2smId.begin(); + for ( itElem = aSubMesh->GetElements(); itElem->more(); ++hint) + hint = eId2smId.insert( hint, make_pair( itElem->next()->GetID(), aSubMeID )); + } + + // Care of elements that are not on submeshes + if ( mySMESHDSMesh->NbNodes() != nId2smId.size() ) { + for ( itNode = mySMESHDSMesh->nodesIterator(); itNode->more(); ) + /* --- stl_map.h says : */ + /* A %map relies on unique keys and thus a %pair is only inserted if its */ + /* first element (the key) is not already present in the %map. */ + nId2smId.insert( make_pair( itNode->next()->GetID(), 0 )); + } + int nbElems = mySMESHDSMesh->NbEdges() + mySMESHDSMesh->NbFaces() + mySMESHDSMesh->NbVolumes(); + if ( nbElems != eId2smId.size() ) { + for ( itElem = mySMESHDSMesh->elementsIterator(); itElem->more(); ) + eId2smId.insert( make_pair( itElem->next()->GetID(), 0 )); + } + + // Store submesh IDs + for ( int isNode = 0; isNode < 2; ++isNode ) + { + map< TElemID, TSubMID >& id2smId = isNode ? nId2smId : eId2smId; + if ( id2smId.empty() ) continue; + map< TElemID, TSubMID >::const_iterator id_smId = id2smId.begin(); + // make and fill array of submesh IDs + int* smIDs = new int [ id2smId.size() ]; + for ( int i = 0; id_smId != id2smId.end(); ++id_smId, ++i ) + smIDs[ i ] = id_smId->second; + // write HDF group + aSize[ 0 ] = id2smId.size(); + string aDSName( isNode ? "Node Submeshes" : "Element Submeshes"); + aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_INT32, aSize, 1 ); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( smIDs ); + aDataset->CloseOnDisk(); + // + delete smIDs; + } - // Store node positions on sub-shapes (SMDS_Position): - // ---------------------------------------------------- - - aGroup = new HDFgroup( "Node Positions", aTopGroup ); - aGroup->CreateOnDisk(); - - // in aGroup, create 5 datasets to contain: - // "Nodes on Edges" - ID of node on edge - // "Edge positions" - U parameter on node on edge - // "Nodes on Faces" - ID of node on face - // "Face U positions" - U parameter of node on face - // "Face V positions" - V parameter of node on face - - // Find out nb of nodes on edges and faces - // Collect corresponing sub-meshes - int nbEdgeNodes = 0, nbFaceNodes = 0; - list aEdgeSM, aFaceSM; - // loop on SMESHDS_SubMesh'es - for ( itSubM = aSubMeshes.begin(); itSubM != aSubMeshes.end() ; itSubM++ ) - { - SMESHDS_SubMesh* aSubMesh = (*itSubM).second; - if ( aSubMesh->IsComplexSubmesh() ) - continue; // submesh containing other submeshs - int nbNodes = aSubMesh->NbNodes(); - if ( nbNodes == 0 ) continue; - - int aShapeID = (*itSubM).first; - int aShapeType = mySMESHDSMesh->IndexToShape( aShapeID ).ShapeType(); - // write only SMDS_FacePosition and SMDS_EdgePosition - switch ( aShapeType ) { - case TopAbs_FACE: - nbFaceNodes += nbNodes; - aFaceSM.push_back( aSubMesh ); - break; - case TopAbs_EDGE: - nbEdgeNodes += nbNodes; - aEdgeSM.push_back( aSubMesh ); - break; - default: - continue; - } - } - // Treat positions on edges or faces - for ( int onFace = 0; onFace < 2; onFace++ ) - { - // Create arrays to store in datasets - int iNode = 0, nbNodes = ( onFace ? nbFaceNodes : nbEdgeNodes ); - if (!nbNodes) continue; - int* aNodeIDs = new int [ nbNodes ]; - double* aUPos = new double [ nbNodes ]; - double* aVPos = ( onFace ? new double[ nbNodes ] : 0 ); - - // Fill arrays - // loop on sub-meshes - list * pListSM = ( onFace ? &aFaceSM : &aEdgeSM ); - list::iterator itSM = pListSM->begin(); - for ( ; itSM != pListSM->end(); itSM++ ) - { - SMESHDS_SubMesh* aSubMesh = (*itSM); - - SMDS_NodeIteratorPtr itNode = aSubMesh->GetNodes(); - // loop on nodes in aSubMesh - while ( itNode->more() ) - { - //node ID - const SMDS_MeshNode* node = itNode->next(); - aNodeIDs [ iNode ] = node->GetID(); - - // Position - const SMDS_PositionPtr pos = node->GetPosition(); - if ( onFace ) { // on FACE - const SMDS_FacePosition* fPos = - dynamic_cast( pos.get() ); - if ( fPos ) { - aUPos[ iNode ] = fPos->GetUParameter(); - aVPos[ iNode ] = fPos->GetVParameter(); - iNode++; - } - else - nbNodes--; - } - else { // on EDGE - const SMDS_EdgePosition* ePos = - dynamic_cast( pos.get() ); - if ( ePos ) { - aUPos[ iNode ] = ePos->GetUParameter(); - iNode++; - } - else - nbNodes--; - } - } // loop on nodes in aSubMesh - } // loop on sub-meshes - - // Write datasets - if ( nbNodes ) - { - aSize[ 0 ] = nbNodes; - // IDS - string aDSName( onFace ? "Nodes on Faces" : "Nodes on Edges"); - aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_INT32, aSize, 1 ); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( aNodeIDs ); - aDataset->CloseOnDisk(); - - // U Positions - aDSName = ( onFace ? "Face U positions" : "Edge positions"); - aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_FLOAT64, aSize, 1); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( aUPos ); - aDataset->CloseOnDisk(); - // V Positions - if ( onFace ) { - aDataset = new HDFdataset( "Face V positions", aGroup, HDF_FLOAT64, aSize, 1); - aDataset->CreateOnDisk(); - aDataset->WriteOnDisk( aVPos ); - aDataset->CloseOnDisk(); - } - } - delete [] aNodeIDs; - delete [] aUPos; - if ( aVPos ) delete [] aVPos; - - } // treat positions on edges or faces - - // close "Node Positions" group - aGroup->CloseOnDisk(); - - } // if ( there are submeshes in SMESHDS_Mesh ) - } // if ( hasData ) - + // Store node positions on sub-shapes (SMDS_Position): + // ---------------------------------------------------- + + aGroup = new HDFgroup( "Node Positions", aTopGroup ); + aGroup->CreateOnDisk(); + + // in aGroup, create 5 datasets to contain: + // "Nodes on Edges" - ID of node on edge + // "Edge positions" - U parameter on node on edge + // "Nodes on Faces" - ID of node on face + // "Face U positions" - U parameter of node on face + // "Face V positions" - V parameter of node on face + + // Find out nb of nodes on edges and faces + // Collect corresponing sub-meshes + int nbEdgeNodes = 0, nbFaceNodes = 0; + list aEdgeSM, aFaceSM; + // loop on SMESHDS_SubMesh'es + for ( itSubM = aSubMeshes.begin(); itSubM != aSubMeshes.end() ; itSubM++ ) + { + SMESHDS_SubMesh* aSubMesh = (*itSubM).second; + if ( aSubMesh->IsComplexSubmesh() ) + continue; // submesh containing other submeshs + int nbNodes = aSubMesh->NbNodes(); + if ( nbNodes == 0 ) continue; + + int aShapeID = (*itSubM).first; + int aShapeType = mySMESHDSMesh->IndexToShape( aShapeID ).ShapeType(); + // write only SMDS_FacePosition and SMDS_EdgePosition + switch ( aShapeType ) { + case TopAbs_FACE: + nbFaceNodes += nbNodes; + aFaceSM.push_back( aSubMesh ); + break; + case TopAbs_EDGE: + nbEdgeNodes += nbNodes; + aEdgeSM.push_back( aSubMesh ); + break; + default: + continue; + } + } + // Treat positions on edges or faces + for ( int onFace = 0; onFace < 2; onFace++ ) + { + // Create arrays to store in datasets + int iNode = 0, nbNodes = ( onFace ? nbFaceNodes : nbEdgeNodes ); + if (!nbNodes) continue; + int* aNodeIDs = new int [ nbNodes ]; + double* aUPos = new double [ nbNodes ]; + double* aVPos = ( onFace ? new double[ nbNodes ] : 0 ); + + // Fill arrays + // loop on sub-meshes + list * pListSM = ( onFace ? &aFaceSM : &aEdgeSM ); + list::iterator itSM = pListSM->begin(); + for ( ; itSM != pListSM->end(); itSM++ ) + { + SMESHDS_SubMesh* aSubMesh = (*itSM); + + SMDS_NodeIteratorPtr itNode = aSubMesh->GetNodes(); + // loop on nodes in aSubMesh + while ( itNode->more() ) + { + //node ID + const SMDS_MeshNode* node = itNode->next(); + aNodeIDs [ iNode ] = node->GetID(); + + // Position + const SMDS_PositionPtr pos = node->GetPosition(); + if ( onFace ) { // on FACE + const SMDS_FacePosition* fPos = + dynamic_cast( pos.get() ); + if ( fPos ) { + aUPos[ iNode ] = fPos->GetUParameter(); + aVPos[ iNode ] = fPos->GetVParameter(); + iNode++; + } + else + nbNodes--; + } + else { // on EDGE + const SMDS_EdgePosition* ePos = + dynamic_cast( pos.get() ); + if ( ePos ) { + aUPos[ iNode ] = ePos->GetUParameter(); + iNode++; + } + else + nbNodes--; + } + } // loop on nodes in aSubMesh + } // loop on sub-meshes + + // Write datasets + if ( nbNodes ) + { + aSize[ 0 ] = nbNodes; + // IDS + string aDSName( onFace ? "Nodes on Faces" : "Nodes on Edges"); + aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_INT32, aSize, 1 ); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( aNodeIDs ); + aDataset->CloseOnDisk(); + + // U Positions + aDSName = ( onFace ? "Face U positions" : "Edge positions"); + aDataset = new HDFdataset( (char*)aDSName.c_str(), aGroup, HDF_FLOAT64, aSize, 1); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( aUPos ); + aDataset->CloseOnDisk(); + // V Positions + if ( onFace ) { + aDataset = new HDFdataset( "Face V positions", aGroup, HDF_FLOAT64, aSize, 1); + aDataset->CreateOnDisk(); + aDataset->WriteOnDisk( aVPos ); + aDataset->CloseOnDisk(); + } + } + delete [] aNodeIDs; + delete [] aUPos; + if ( aVPos ) delete [] aVPos; + + } // treat positions on edges or faces + + // close "Node Positions" group + aGroup->CloseOnDisk(); + + } // if ( there are submeshes in SMESHDS_Mesh ) + } // if ( hasData ) + // close mesh HDF group aTopGroup->CloseOnDisk(); } @@ -1966,7 +2103,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, } } } - + // close HDF file aFile->CloseOnDisk(); delete aFile; @@ -1986,7 +2123,7 @@ SALOMEDS::TMPFile* SMESH_Gen_i::Save( SALOMEDS::SComponent_ptr theComponent, /*! * SMESH_Gen_i::SaveASCII * - * Save SMESH module's data in ASCII format (not implemented yet) + * Save SMESH module's data in ASCII format */ //============================================================================= @@ -1995,7 +2132,19 @@ SALOMEDS::TMPFile* SMESH_Gen_i::SaveASCII( SALOMEDS::SComponent_ptr theComponent bool isMultiFile ) { if(MYDEBUG) MESSAGE( "SMESH_Gen_i::SaveASCII" ); SALOMEDS::TMPFile_var aStreamFile = Save( theComponent, theURL, isMultiFile ); - return aStreamFile._retn(); + + //after usual saving needs to encipher binary to text string + //Any binary symbol will be represent as "|xx" () hexadecimal format number + int size = aStreamFile.in().length(); + _CORBA_Octet* buffer = new _CORBA_Octet[size*3+1]; + for ( int i = 0; i < size; i++ ) + sprintf( (char*)&(buffer[i*3]), "|%02x", (char*)(aStreamFile[i]) ); + + buffer[size * 3] = '\0'; + + SALOMEDS::TMPFile_var anAsciiStreamFile = new SALOMEDS::TMPFile(size*3, size*3, buffer, 1); + + return anAsciiStreamFile._retn(); } //============================================================================= @@ -2063,15 +2212,15 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, theComponent->GetStudy()->StudyId() != myCurrentStudy->StudyId() ) SetCurrentStudy( theComponent->GetStudy() ); -/* if( !theComponent->_is_nil() ) - { - //SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow( theComponent->GetStudy() ); - if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() ) + /* if( !theComponent->_is_nil() ) + { + //SALOMEDS::Study_var aStudy = SALOMEDS::Study::_narrow( theComponent->GetStudy() ); + if( !myCurrentStudy->FindComponent( "GEOM" )->_is_nil() ) loadGeomData( myCurrentStudy->FindComponent( "GEOM" ) ); - }*/ + }*/ StudyContext* myStudyContext = GetCurrentStudyContext(); - + // Get temporary files location TCollection_AsciiString tmpDir = isMultiFile ? TCollection_AsciiString( ( char* )theURL ) : ( char* )SALOMEDS_Tool::GetTmpDir().c_str(); @@ -2110,6 +2259,19 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, DriverMED_R_SMESHDS_Mesh myReader; myReader.SetFile( meshfile.ToCString() ); + // For PAL13473 ("Repetitive mesh") implementation. + // New dependencies between SMESH objects are established: + // now hypotheses can refer to meshes, shapes and other hypotheses. + // To keep data consistent, the following order of data restoration + // imposed: + // 1. Create hypotheses + // 2. Create all meshes + // 3. Load hypotheses' data + // 4. All the rest + + list< pair< SMESH_Hypothesis_i*, string > > hypDataList; + list< pair< SMESH_Mesh_i*, HDFgroup* > > meshGroupList; + // get total number of top-level groups int aNbGroups = aFile->nInternalObjects(); if ( aNbGroups > 0 ) { @@ -2184,9 +2346,9 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, // --> restore hypothesis from data if ( id > 0 && !hypname.empty()/* && !hypdata.empty()*/ ) { // VSR : persistent data can be empty if(MYDEBUG) MESSAGE("VSR - load hypothesis : id = " << id << - ", name = " << hypname.c_str() << ", persistent string = " << hypdata.c_str()); + ", name = " << hypname.c_str() << ", persistent string = " << hypdata.c_str()); SMESH::SMESH_Hypothesis_var myHyp; - + try { // protect persistence mechanism against exceptions myHyp = this->createHypothesis( hypname.c_str(), libname.c_str() ); } @@ -2196,7 +2358,8 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, SMESH_Hypothesis_i* myImpl = dynamic_cast( GetServant( myHyp ).in() ); if ( myImpl ) { - myImpl->LoadFrom( hypdata.c_str() ); + // myImpl->LoadFrom( hypdata.c_str() ); + hypDataList.push_back( make_pair( myImpl, hypdata )); string iorString = GetORB()->object_to_string( myHyp ); int newId = myStudyContext->findId( iorString ); myStudyContext->mapOldToNew( id, newId ); @@ -2278,23 +2441,24 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, } // close algorithm HDF group aGroup->CloseOnDisk(); - + // --> restore algorithm from data if ( id > 0 && !hypname.empty()/* && !hypdata.empty()*/ ) { // VSR : persistent data can be empty if(MYDEBUG) MESSAGE("VSR - load algo : id = " << id << - ", name = " << hypname.c_str() << ", persistent string = " << hypdata.c_str()); + ", name = " << hypname.c_str() << ", persistent string = " << hypdata.c_str()); SMESH::SMESH_Hypothesis_var myHyp; - + try { // protect persistence mechanism against exceptions myHyp = this->createHypothesis( hypname.c_str(), libname.c_str() ); } catch (...) { INFOS( "Exception during hypothesis creation" ); } - + SMESH_Hypothesis_i* myImpl = dynamic_cast( GetServant( myHyp ).in() ); if ( myImpl ) { - myImpl->LoadFrom( hypdata.c_str() ); + //myImpl->LoadFrom( hypdata.c_str() ); + hypDataList.push_back( make_pair( myImpl, hypdata )); string iorString = GetORB()->object_to_string( myHyp ); int newId = myStudyContext->findId( iorString ); myStudyContext->mapOldToNew( id, newId ); @@ -2320,8 +2484,6 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, if ( id <= 0 ) continue; - bool hasData = false; - // open mesh HDF group aTopGroup = new HDFgroup( meshName, aFile ); aTopGroup->OpenOnDisk(); @@ -2335,591 +2497,621 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, SMESH_Mesh_i* myNewMeshImpl = dynamic_cast( GetServant( myNewMesh ).in() ); if ( !myNewMeshImpl ) continue; + meshGroupList.push_back( make_pair( myNewMeshImpl, aTopGroup )); + string iorString = GetORB()->object_to_string( myNewMesh ); int newId = myStudyContext->findId( iorString ); myStudyContext->mapOldToNew( id, newId ); - - ::SMESH_Mesh& myLocMesh = myNewMeshImpl->GetImpl(); - SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS(); - - // try to find mesh data dataset - if ( aTopGroup->ExistInternalObject( "Has data" ) ) { - // load mesh "has data" flag - aDataset = new HDFdataset( "Has data", aTopGroup ); - aDataset->OpenOnDisk(); - size = aDataset->GetSize(); - char* strHasData = new char[ size ]; - aDataset->ReadFromDisk( strHasData ); - aDataset->CloseOnDisk(); - if ( strcmp( strHasData, "1") == 0 ) { - // read mesh data from MED file - myReader.SetMesh( mySMESHDSMesh ); - myReader.SetMeshId( id ); - myReader.Perform(); - hasData = true; - } - } - // try to read and set reference to shape - GEOM::GEOM_Object_var aShapeObject; - if ( aTopGroup->ExistInternalObject( "Ref on shape" ) ) { - // load mesh "Ref on shape" - it's an entry to SObject - aDataset = new HDFdataset( "Ref on shape", aTopGroup ); - aDataset->OpenOnDisk(); - size = aDataset->GetSize(); - char* refFromFile = new char[ size ]; - aDataset->ReadFromDisk( refFromFile ); - aDataset->CloseOnDisk(); - if ( strlen( refFromFile ) > 0 ) { - SALOMEDS::SObject_var shapeSO = myCurrentStudy->FindObjectID( refFromFile ); - - // Make sure GEOM data are loaded first - //loadGeomData( shapeSO->GetFatherComponent() ); - - CORBA::Object_var shapeObject = SObjectToObject( shapeSO ); - if ( !CORBA::is_nil( shapeObject ) ) { - aShapeObject = GEOM::GEOM_Object::_narrow( shapeObject ); - if ( !aShapeObject->_is_nil() ) - myNewMeshImpl->SetShape( aShapeObject ); - } - } - } + // try to read and set reference to shape + GEOM::GEOM_Object_var aShapeObject; + if ( aTopGroup->ExistInternalObject( "Ref on shape" ) ) { + // load mesh "Ref on shape" - it's an entry to SObject + aDataset = new HDFdataset( "Ref on shape", aTopGroup ); + aDataset->OpenOnDisk(); + size = aDataset->GetSize(); + char* refFromFile = new char[ size ]; + aDataset->ReadFromDisk( refFromFile ); + aDataset->CloseOnDisk(); + if ( strlen( refFromFile ) > 0 ) { + SALOMEDS::SObject_var shapeSO = myCurrentStudy->FindObjectID( refFromFile ); + + // Make sure GEOM data are loaded first + //loadGeomData( shapeSO->GetFatherComponent() ); + + CORBA::Object_var shapeObject = SObjectToObject( shapeSO ); + if ( !CORBA::is_nil( shapeObject ) ) { + aShapeObject = GEOM::GEOM_Object::_narrow( shapeObject ); + if ( !aShapeObject->_is_nil() ) + myNewMeshImpl->SetShape( aShapeObject ); + } + } + } - // try to get applied algorithms - if ( aTopGroup->ExistInternalObject( "Applied Algorithms" ) ) { - aGroup = new HDFgroup( "Applied Algorithms", aTopGroup ); - aGroup->OpenOnDisk(); - // get number of applied algorithms - int aNbSubObjects = aGroup->nInternalObjects(); - if(MYDEBUG) MESSAGE( "VSR - number of applied algos " << aNbSubObjects ); - for ( int j = 0; j < aNbSubObjects; j++ ) { - char name_dataset[ HDF_NAME_MAX_LEN+1 ]; - aGroup->InternalObjectIndentify( j, name_dataset ); - // check if it is an algorithm - if ( string( name_dataset ).substr( 0, 4 ) == string( "Algo" ) ) { - aDataset = new HDFdataset( name_dataset, aGroup ); - aDataset->OpenOnDisk(); - size = aDataset->GetSize(); - char* refFromFile = new char[ size ]; - aDataset->ReadFromDisk( refFromFile ); - aDataset->CloseOnDisk(); - - // san - it is impossible to recover applied algorithms using their entries within Load() method - - //SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile ); - //CORBA::Object_var hypObject = SObjectToObject( hypSO ); - int id = atoi( refFromFile ); - string anIOR = myStudyContext->getIORbyOldId( id ); - if ( !anIOR.empty() ) { - CORBA::Object_var hypObject = GetORB()->string_to_object( anIOR.c_str() ); - if ( !CORBA::is_nil( hypObject ) ) { - SMESH::SMESH_Hypothesis_var anHyp = SMESH::SMESH_Hypothesis::_narrow( hypObject ); - if ( !anHyp->_is_nil() && !aShapeObject->_is_nil() ) - myNewMeshImpl->addHypothesis( aShapeObject, anHyp ); - } - } - } - } - aGroup->CloseOnDisk(); - } + } + } + } - // try to get applied hypotheses - if ( aTopGroup->ExistInternalObject( "Applied Hypotheses" ) ) { - aGroup = new HDFgroup( "Applied Hypotheses", aTopGroup ); - aGroup->OpenOnDisk(); - // get number of applied hypotheses - int aNbSubObjects = aGroup->nInternalObjects(); - for ( int j = 0; j < aNbSubObjects; j++ ) { - char name_dataset[ HDF_NAME_MAX_LEN+1 ]; - aGroup->InternalObjectIndentify( j, name_dataset ); - // check if it is a hypothesis - if ( string( name_dataset ).substr( 0, 3 ) == string( "Hyp" ) ) { - aDataset = new HDFdataset( name_dataset, aGroup ); - aDataset->OpenOnDisk(); - size = aDataset->GetSize(); - char* refFromFile = new char[ size ]; - aDataset->ReadFromDisk( refFromFile ); - aDataset->CloseOnDisk(); - - // san - it is impossible to recover applied hypotheses using their entries within Load() method - - //SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile ); - //CORBA::Object_var hypObject = SObjectToObject( hypSO ); - int id = atoi( refFromFile ); - string anIOR = myStudyContext->getIORbyOldId( id ); - if ( !anIOR.empty() ) { - CORBA::Object_var hypObject = GetORB()->string_to_object( anIOR.c_str() ); - if ( !CORBA::is_nil( hypObject ) ) { - SMESH::SMESH_Hypothesis_var anHyp = SMESH::SMESH_Hypothesis::_narrow( hypObject ); - if ( !anHyp->_is_nil() && !aShapeObject->_is_nil() ) - myNewMeshImpl->addHypothesis( aShapeObject, anHyp ); - } - } - } - } - aGroup->CloseOnDisk(); - } + // As all object that can be referred by hypothesis are created, + // we can restore hypothesis data - // --> try to find submeshes containers for each type of submesh - for ( int j = GetSubMeshOnVertexTag(); j <= GetSubMeshOnCompoundTag(); j++ ) { - char name_meshgroup[ 30 ]; - if ( j == GetSubMeshOnVertexTag() ) - strcpy( name_meshgroup, "SubMeshes On Vertex" ); - else if ( j == GetSubMeshOnEdgeTag() ) - strcpy( name_meshgroup, "SubMeshes On Edge" ); - else if ( j == GetSubMeshOnWireTag() ) - strcpy( name_meshgroup, "SubMeshes On Wire" ); - else if ( j == GetSubMeshOnFaceTag() ) - strcpy( name_meshgroup, "SubMeshes On Face" ); - else if ( j == GetSubMeshOnShellTag() ) - strcpy( name_meshgroup, "SubMeshes On Shell" ); - else if ( j == GetSubMeshOnSolidTag() ) - strcpy( name_meshgroup, "SubMeshes On Solid" ); - else if ( j == GetSubMeshOnCompoundTag() ) - strcpy( name_meshgroup, "SubMeshes On Compound" ); - - // try to get submeshes container HDF group - if ( aTopGroup->ExistInternalObject( name_meshgroup ) ) { - // open submeshes containers HDF group - aGroup = new HDFgroup( name_meshgroup, aTopGroup ); - aGroup->OpenOnDisk(); - - // get number of submeshes - int aNbSubMeshes = aGroup->nInternalObjects(); - for ( int k = 0; k < aNbSubMeshes; k++ ) { - // identify submesh - char name_submeshgroup[ HDF_NAME_MAX_LEN+1 ]; - aGroup->InternalObjectIndentify( k, name_submeshgroup ); - if ( string( name_submeshgroup ).substr( 0, 7 ) == string( "SubMesh" ) ) { - // --> get submesh id - int subid = atoi( string( name_submeshgroup ).substr( 7 ).c_str() ); - if ( subid <= 0 ) - continue; - // open submesh HDF group - aSubGroup = new HDFgroup( name_submeshgroup, aGroup ); - aSubGroup->OpenOnDisk(); - - // try to read and set reference to subshape - GEOM::GEOM_Object_var aSubShapeObject; - SMESH::SMESH_subMesh_var aSubMesh; - - if ( aSubGroup->ExistInternalObject( "Ref on shape" ) ) { - // load submesh "Ref on shape" - it's an entry to SObject - aDataset = new HDFdataset( "Ref on shape", aSubGroup ); - aDataset->OpenOnDisk(); - size = aDataset->GetSize(); - char* refFromFile = new char[ size ]; - aDataset->ReadFromDisk( refFromFile ); - aDataset->CloseOnDisk(); - if ( strlen( refFromFile ) > 0 ) { - SALOMEDS::SObject_var subShapeSO = myCurrentStudy->FindObjectID( refFromFile ); - CORBA::Object_var subShapeObject = SObjectToObject( subShapeSO ); - if ( !CORBA::is_nil( subShapeObject ) ) { - aSubShapeObject = GEOM::GEOM_Object::_narrow( subShapeObject ); - if ( !aSubShapeObject->_is_nil() ) - aSubMesh = SMESH::SMESH_subMesh::_duplicate - ( myNewMeshImpl->createSubMesh( aSubShapeObject ) ); - if ( aSubMesh->_is_nil() ) - continue; - string iorSubString = GetORB()->object_to_string( aSubMesh ); - int newSubId = myStudyContext->findId( iorSubString ); - myStudyContext->mapOldToNew( subid, newSubId ); - } - } - } - - if ( aSubMesh->_is_nil() ) - continue; + list< pair< SMESH_Hypothesis_i*, string > >::iterator hyp_data; + for ( hyp_data = hypDataList.begin(); hyp_data != hypDataList.end(); ++hyp_data ) + { + SMESH_Hypothesis_i* hyp = hyp_data->first; + string & data = hyp_data->second; + hyp->LoadFrom( data.c_str() ); + } - // VSR: Get submesh data from MED convertor -// int anInternalSubmeshId = aSubMesh->GetId(); // this is not a persistent ID, it's an internal one computed from sub-shape -// if (myNewMeshImpl->_mapSubMesh.find(anInternalSubmeshId) != myNewMeshImpl->_mapSubMesh.end()) { -// if(MYDEBUG) MESSAGE("VSR - SMESH_Gen_i::Load(): loading from MED file submesh with ID = " << -// subid << " for subshape # " << anInternalSubmeshId); -// SMESHDS_SubMesh* aSubMeshDS = -// myNewMeshImpl->_mapSubMesh[anInternalSubmeshId]->CreateSubMeshDS(); -// if ( !aSubMeshDS ) { -// if(MYDEBUG) MESSAGE("VSR - SMESH_Gen_i::Load(): FAILED to create a submesh for subshape # " << -// anInternalSubmeshId << " in current mesh!"); -// } -// else -// myReader.GetSubMesh( aSubMeshDS, subid ); -// } - - // try to get applied algorithms - if ( aSubGroup->ExistInternalObject( "Applied Algorithms" ) ) { - // open "applied algorithms" HDF group - aSubSubGroup = new HDFgroup( "Applied Algorithms", aSubGroup ); - aSubSubGroup->OpenOnDisk(); - // get number of applied algorithms - int aNbSubObjects = aSubSubGroup->nInternalObjects(); - for ( int l = 0; l < aNbSubObjects; l++ ) { - char name_dataset[ HDF_NAME_MAX_LEN+1 ]; - aSubSubGroup->InternalObjectIndentify( l, name_dataset ); - // check if it is an algorithm - if ( string( name_dataset ).substr( 0, 4 ) == string( "Algo" ) ) { - aDataset = new HDFdataset( name_dataset, aSubSubGroup ); - aDataset->OpenOnDisk(); - size = aDataset->GetSize(); - char* refFromFile = new char[ size ]; - aDataset->ReadFromDisk( refFromFile ); - aDataset->CloseOnDisk(); - - //SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile ); - //CORBA::Object_var hypObject = SObjectToObject( hypSO ); - int id = atoi( refFromFile ); - string anIOR = myStudyContext->getIORbyOldId( id ); - if ( !anIOR.empty() ) { - CORBA::Object_var hypObject = GetORB()->string_to_object( anIOR.c_str() ); - if ( !CORBA::is_nil( hypObject ) ) { - SMESH::SMESH_Hypothesis_var anHyp = SMESH::SMESH_Hypothesis::_narrow( hypObject ); - if ( !anHyp->_is_nil() && !aShapeObject->_is_nil() ) - myNewMeshImpl->addHypothesis( aSubShapeObject, anHyp ); - } - } - } - } - // close "applied algorithms" HDF group - aSubSubGroup->CloseOnDisk(); - } - - // try to get applied hypotheses - if ( aSubGroup->ExistInternalObject( "Applied Hypotheses" ) ) { - // open "applied hypotheses" HDF group - aSubSubGroup = new HDFgroup( "Applied Hypotheses", aSubGroup ); - aSubSubGroup->OpenOnDisk(); - // get number of applied hypotheses - int aNbSubObjects = aSubSubGroup->nInternalObjects(); - for ( int l = 0; l < aNbSubObjects; l++ ) { - char name_dataset[ HDF_NAME_MAX_LEN+1 ]; - aSubSubGroup->InternalObjectIndentify( l, name_dataset ); - // check if it is a hypothesis - if ( string( name_dataset ).substr( 0, 3 ) == string( "Hyp" ) ) { - aDataset = new HDFdataset( name_dataset, aSubSubGroup ); - aDataset->OpenOnDisk(); - size = aDataset->GetSize(); - char* refFromFile = new char[ size ]; - aDataset->ReadFromDisk( refFromFile ); - aDataset->CloseOnDisk(); - - //SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile ); - //CORBA::Object_var hypObject = SObjectToObject( hypSO ); - int id = atoi( refFromFile ); - string anIOR = myStudyContext->getIORbyOldId( id ); - if ( !anIOR.empty() ) { - CORBA::Object_var hypObject = GetORB()->string_to_object( anIOR.c_str() ); - if ( !CORBA::is_nil( hypObject ) ) { - SMESH::SMESH_Hypothesis_var anHyp = SMESH::SMESH_Hypothesis::_narrow( hypObject ); - if ( !anHyp->_is_nil() && !aShapeObject->_is_nil() ) - myNewMeshImpl->addHypothesis( aSubShapeObject, anHyp ); - } - } - } - } - // close "applied hypotheses" HDF group - aSubSubGroup->CloseOnDisk(); - } + // Restore the rest mesh data - // close submesh HDF group - aSubGroup->CloseOnDisk(); - } - } - // close submeshes containers HDF group - aGroup->CloseOnDisk(); - } - } + list< pair< SMESH_Mesh_i*, HDFgroup* > >::iterator meshi_group; + for ( meshi_group = meshGroupList.begin(); meshi_group != meshGroupList.end(); ++meshi_group ) + { + aTopGroup = meshi_group->second; + SMESH_Mesh_i* myNewMeshImpl = meshi_group->first; + ::SMESH_Mesh& myLocMesh = myNewMeshImpl->GetImpl(); + SMESHDS_Mesh* mySMESHDSMesh = myLocMesh.GetMeshDS(); + + GEOM::GEOM_Object_var aShapeObject = myNewMeshImpl->GetShapeToMesh(); + bool hasData = false; + + // get mesh old id + string iorString = GetORB()->object_to_string( myNewMeshImpl->_this() ); + int newId = myStudyContext->findId( iorString ); + int id = myStudyContext->getOldId( newId ); + + // try to find mesh data dataset + if ( aTopGroup->ExistInternalObject( "Has data" ) ) { + // load mesh "has data" flag + aDataset = new HDFdataset( "Has data", aTopGroup ); + aDataset->OpenOnDisk(); + size = aDataset->GetSize(); + char* strHasData = new char[ size ]; + aDataset->ReadFromDisk( strHasData ); + aDataset->CloseOnDisk(); + if ( strcmp( strHasData, "1") == 0 ) { + // read mesh data from MED file + myReader.SetMesh( mySMESHDSMesh ); + myReader.SetMeshId( id ); + myReader.Perform(); + hasData = true; + } + } - if(hasData) { - - // Read sub-meshes from MED - // ------------------------- - if(MYDEBUG) MESSAGE("Create all sub-meshes"); - bool submeshesInFamilies = ( ! aTopGroup->ExistInternalObject( "Submeshes" )); - if ( submeshesInFamilies ) - { - // old way working before fix of PAL 12992 - myReader.CreateAllSubMeshes(); + // try to get applied algorithms + if ( aTopGroup->ExistInternalObject( "Applied Algorithms" ) ) { + aGroup = new HDFgroup( "Applied Algorithms", aTopGroup ); + aGroup->OpenOnDisk(); + // get number of applied algorithms + int aNbSubObjects = aGroup->nInternalObjects(); + if(MYDEBUG) MESSAGE( "VSR - number of applied algos " << aNbSubObjects ); + for ( int j = 0; j < aNbSubObjects; j++ ) { + char name_dataset[ HDF_NAME_MAX_LEN+1 ]; + aGroup->InternalObjectIndentify( j, name_dataset ); + // check if it is an algorithm + if ( string( name_dataset ).substr( 0, 4 ) == string( "Algo" ) ) { + aDataset = new HDFdataset( name_dataset, aGroup ); + aDataset->OpenOnDisk(); + size = aDataset->GetSize(); + char* refFromFile = new char[ size ]; + aDataset->ReadFromDisk( refFromFile ); + aDataset->CloseOnDisk(); + + // san - it is impossible to recover applied algorithms using their entries within Load() method + + //SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile ); + //CORBA::Object_var hypObject = SObjectToObject( hypSO ); + int id = atoi( refFromFile ); + string anIOR = myStudyContext->getIORbyOldId( id ); + if ( !anIOR.empty() ) { + CORBA::Object_var hypObject = GetORB()->string_to_object( anIOR.c_str() ); + if ( !CORBA::is_nil( hypObject ) ) { + SMESH::SMESH_Hypothesis_var anHyp = SMESH::SMESH_Hypothesis::_narrow( hypObject ); + if ( !anHyp->_is_nil() && !aShapeObject->_is_nil() ) + myNewMeshImpl->addHypothesis( aShapeObject, anHyp ); + } } - else - { - // open a group - aGroup = new HDFgroup( "Submeshes", aTopGroup ); - aGroup->OpenOnDisk(); - - int maxID = mySMESHDSMesh->MaxShapeIndex(); - vector< SMESHDS_SubMesh * > subMeshes( maxID + 1, (SMESHDS_SubMesh*) 0 ); - vector< TopAbs_ShapeEnum > smType ( maxID + 1, TopAbs_SHAPE ); - - PositionCreator aPositionCreator; - - SMDS_NodeIteratorPtr nIt = mySMESHDSMesh->nodesIterator(); - SMDS_ElemIteratorPtr eIt = mySMESHDSMesh->elementsIterator(); - for ( int isNode = 0; isNode < 2; ++isNode ) - { - string aDSName( isNode ? "Node Submeshes" : "Element Submeshes"); - if ( aGroup->ExistInternalObject( (char*) aDSName.c_str() )) - { - aDataset = new HDFdataset( (char*) aDSName.c_str(), aGroup ); - aDataset->OpenOnDisk(); - // read submesh IDs for all elements sorted by ID - int nbElems = aDataset->GetSize(); - int* smIDs = new int [ nbElems ]; - aDataset->ReadFromDisk( smIDs ); - aDataset->CloseOnDisk(); - - // get elements sorted by ID - ::SMESH_MeshEditor::TIDSortedElemSet elemSet; - if ( isNode ) - while ( nIt->more() ) elemSet.insert( nIt->next() ); - else - while ( eIt->more() ) elemSet.insert( eIt->next() ); - ASSERT( elemSet.size() == nbElems ); + } + } + aGroup->CloseOnDisk(); + } - // add elements to submeshes - ::SMESH_MeshEditor::TIDSortedElemSet::iterator iE = elemSet.begin(); - for ( int i = 0; i < nbElems; ++i, ++iE ) - { - int smID = smIDs[ i ]; - if ( smID == 0 ) continue; - ASSERT( smID <= maxID ); - const SMDS_MeshElement* elem = *iE; - // get or create submesh - SMESHDS_SubMesh* & sm = subMeshes[ smID ]; - if ( ! sm ) { - sm = mySMESHDSMesh->NewSubMesh( smID ); - smType[ smID ] = mySMESHDSMesh->IndexToShape( smID ).ShapeType(); - } - // add - if ( isNode ) { - SMDS_PositionPtr pos = aPositionCreator.MakePosition( smType[ smID ]); - pos->SetShapeId( smID ); - SMDS_MeshNode* node = const_cast( static_cast( elem )); - node->SetPosition( pos ); - sm->AddNode( node ); - } else { - sm->AddElement( elem ); - } - } - delete smIDs; - } + // try to get applied hypotheses + if ( aTopGroup->ExistInternalObject( "Applied Hypotheses" ) ) { + aGroup = new HDFgroup( "Applied Hypotheses", aTopGroup ); + aGroup->OpenOnDisk(); + // get number of applied hypotheses + int aNbSubObjects = aGroup->nInternalObjects(); + for ( int j = 0; j < aNbSubObjects; j++ ) { + char name_dataset[ HDF_NAME_MAX_LEN+1 ]; + aGroup->InternalObjectIndentify( j, name_dataset ); + // check if it is a hypothesis + if ( string( name_dataset ).substr( 0, 3 ) == string( "Hyp" ) ) { + aDataset = new HDFdataset( name_dataset, aGroup ); + aDataset->OpenOnDisk(); + size = aDataset->GetSize(); + char* refFromFile = new char[ size ]; + aDataset->ReadFromDisk( refFromFile ); + aDataset->CloseOnDisk(); + + // san - it is impossible to recover applied hypotheses using their entries within Load() method + + //SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile ); + //CORBA::Object_var hypObject = SObjectToObject( hypSO ); + int id = atoi( refFromFile ); + string anIOR = myStudyContext->getIORbyOldId( id ); + if ( !anIOR.empty() ) { + CORBA::Object_var hypObject = GetORB()->string_to_object( anIOR.c_str() ); + if ( !CORBA::is_nil( hypObject ) ) { + SMESH::SMESH_Hypothesis_var anHyp = SMESH::SMESH_Hypothesis::_narrow( hypObject ); + if ( !anHyp->_is_nil() && !aShapeObject->_is_nil() ) + myNewMeshImpl->addHypothesis( aShapeObject, anHyp ); } - } // end reading submeshes - - // Read node positions on sub-shapes (SMDS_Position) + } + } + } + aGroup->CloseOnDisk(); + } - if ( aTopGroup->ExistInternalObject( "Node Positions" )) - { - // There are 5 datasets to read: - // "Nodes on Edges" - ID of node on edge - // "Edge positions" - U parameter on node on edge - // "Nodes on Faces" - ID of node on face - // "Face U positions" - U parameter of node on face - // "Face V positions" - V parameter of node on face - char* aEid_DSName = "Nodes on Edges"; - char* aEu_DSName = "Edge positions"; - char* aFu_DSName = "Face U positions"; - //char* aFid_DSName = "Nodes on Faces"; - //char* aFv_DSName = "Face V positions"; - - // data to retrieve - int nbEids = 0, nbFids = 0; - int *aEids = 0, *aFids = 0; - double *aEpos = 0, *aFupos = 0, *aFvpos = 0; - - // open a group - aGroup = new HDFgroup( "Node Positions", aTopGroup ); - aGroup->OpenOnDisk(); - - // loop on 5 data sets - int aNbObjects = aGroup->nInternalObjects(); - for ( int i = 0; i < aNbObjects; i++ ) - { - // identify dataset - char aDSName[ HDF_NAME_MAX_LEN+1 ]; - aGroup->InternalObjectIndentify( i, aDSName ); - // read data - aDataset = new HDFdataset( aDSName, aGroup ); + // --> try to find submeshes containers for each type of submesh + for ( int j = GetSubMeshOnVertexTag(); j <= GetSubMeshOnCompoundTag(); j++ ) { + char name_meshgroup[ 30 ]; + if ( j == GetSubMeshOnVertexTag() ) + strcpy( name_meshgroup, "SubMeshes On Vertex" ); + else if ( j == GetSubMeshOnEdgeTag() ) + strcpy( name_meshgroup, "SubMeshes On Edge" ); + else if ( j == GetSubMeshOnWireTag() ) + strcpy( name_meshgroup, "SubMeshes On Wire" ); + else if ( j == GetSubMeshOnFaceTag() ) + strcpy( name_meshgroup, "SubMeshes On Face" ); + else if ( j == GetSubMeshOnShellTag() ) + strcpy( name_meshgroup, "SubMeshes On Shell" ); + else if ( j == GetSubMeshOnSolidTag() ) + strcpy( name_meshgroup, "SubMeshes On Solid" ); + else if ( j == GetSubMeshOnCompoundTag() ) + strcpy( name_meshgroup, "SubMeshes On Compound" ); + + // try to get submeshes container HDF group + if ( aTopGroup->ExistInternalObject( name_meshgroup ) ) { + // open submeshes containers HDF group + aGroup = new HDFgroup( name_meshgroup, aTopGroup ); + aGroup->OpenOnDisk(); + + // get number of submeshes + int aNbSubMeshes = aGroup->nInternalObjects(); + for ( int k = 0; k < aNbSubMeshes; k++ ) { + // identify submesh + char name_submeshgroup[ HDF_NAME_MAX_LEN+1 ]; + aGroup->InternalObjectIndentify( k, name_submeshgroup ); + if ( string( name_submeshgroup ).substr( 0, 7 ) == string( "SubMesh" ) ) { + // --> get submesh id + int subid = atoi( string( name_submeshgroup ).substr( 7 ).c_str() ); + if ( subid <= 0 ) + continue; + // open submesh HDF group + aSubGroup = new HDFgroup( name_submeshgroup, aGroup ); + aSubGroup->OpenOnDisk(); + + // try to read and set reference to subshape + GEOM::GEOM_Object_var aSubShapeObject; + SMESH::SMESH_subMesh_var aSubMesh; + + if ( aSubGroup->ExistInternalObject( "Ref on shape" ) ) { + // load submesh "Ref on shape" - it's an entry to SObject + aDataset = new HDFdataset( "Ref on shape", aSubGroup ); aDataset->OpenOnDisk(); - if ( aDataset->GetType() == HDF_FLOAT64 ) // Positions - { - double* pos = new double [ aDataset->GetSize() ]; - aDataset->ReadFromDisk( pos ); - // which one? - if ( strncmp( aDSName, aEu_DSName, strlen( aEu_DSName )) == 0 ) - aEpos = pos; - else if ( strncmp( aDSName, aFu_DSName, strlen( aFu_DSName )) == 0 ) - aFupos = pos; - else - aFvpos = pos; - } - else // NODE IDS - { - int aSize = aDataset->GetSize(); - - // for reading files, created from 18.07.2005 till 10.10.2005 - if (aDataset->GetType() == HDF_STRING) - aSize /= sizeof(int); - - int* ids = new int [aSize]; - aDataset->ReadFromDisk( ids ); - // on face or nodes? - if ( strncmp( aDSName, aEid_DSName, strlen( aEid_DSName )) == 0 ) { - aEids = ids; - nbEids = aSize; - } - else { - aFids = ids; - nbFids = aSize; - } - } + size = aDataset->GetSize(); + char* refFromFile = new char[ size ]; + aDataset->ReadFromDisk( refFromFile ); aDataset->CloseOnDisk(); - } // loop on 5 datasets - - // Set node positions on edges or faces - for ( int onFace = 0; onFace < 2; onFace++ ) - { - int nbNodes = ( onFace ? nbFids : nbEids ); - if ( nbNodes == 0 ) continue; - int* aNodeIDs = ( onFace ? aFids : aEids ); - double* aUPos = ( onFace ? aFupos : aEpos ); - double* aVPos = ( onFace ? aFvpos : 0 ); - // loop on node IDs - for ( int iNode = 0; iNode < nbNodes; iNode++ ) - { - const SMDS_MeshNode* node = mySMESHDSMesh->FindNode( aNodeIDs[ iNode ]); - ASSERT( node ); - SMDS_PositionPtr aPos = node->GetPosition(); - ASSERT( aPos ) - if ( onFace ) { - ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_FACE ); - SMDS_FacePosition* fPos = const_cast - ( static_cast( aPos.get() )); - fPos->SetUParameter( aUPos[ iNode ]); - fPos->SetVParameter( aVPos[ iNode ]); - } - else { - ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE ); - SMDS_EdgePosition* fPos = const_cast - ( static_cast( aPos.get() )); - fPos->SetUParameter( aUPos[ iNode ]); + if ( strlen( refFromFile ) > 0 ) { + SALOMEDS::SObject_var subShapeSO = myCurrentStudy->FindObjectID( refFromFile ); + CORBA::Object_var subShapeObject = SObjectToObject( subShapeSO ); + if ( !CORBA::is_nil( subShapeObject ) ) { + aSubShapeObject = GEOM::GEOM_Object::_narrow( subShapeObject ); + if ( !aSubShapeObject->_is_nil() ) + aSubMesh = SMESH::SMESH_subMesh::_duplicate + ( myNewMeshImpl->createSubMesh( aSubShapeObject ) ); + if ( aSubMesh->_is_nil() ) + continue; + string iorSubString = GetORB()->object_to_string( aSubMesh ); + int newSubId = myStudyContext->findId( iorSubString ); + myStudyContext->mapOldToNew( subid, newSubId ); } } } - if ( aEids ) delete [] aEids; - if ( aFids ) delete [] aFids; - if ( aEpos ) delete [] aEpos; - if ( aFupos ) delete [] aFupos; - if ( aFvpos ) delete [] aFvpos; - - aGroup->CloseOnDisk(); - - } // if ( aTopGroup->ExistInternalObject( "Node Positions" ) ) - } // if ( hasData ) - // Recompute State (as computed sub-meshes are restored from MED) - if ( !aShapeObject->_is_nil() ) { - MESSAGE("Compute State Engine ..."); - TopoDS_Shape myLocShape = GeomObjectToShape( aShapeObject ); - myNewMeshImpl->GetImpl().GetSubMesh(myLocShape)->ComputeStateEngine - (SMESH_subMesh::SUBMESH_RESTORED); - MESSAGE("Compute State Engine finished"); - } - - // try to get groups - for ( int ii = GetNodeGroupsTag(); ii <= GetVolumeGroupsTag(); ii++ ) { - char name_group[ 30 ]; - if ( ii == GetNodeGroupsTag() ) - strcpy( name_group, "Groups of Nodes" ); - else if ( ii == GetEdgeGroupsTag() ) - strcpy( name_group, "Groups of Edges" ); - else if ( ii == GetFaceGroupsTag() ) - strcpy( name_group, "Groups of Faces" ); - else if ( ii == GetVolumeGroupsTag() ) - strcpy( name_group, "Groups of Volumes" ); - - if ( aTopGroup->ExistInternalObject( name_group ) ) { - aGroup = new HDFgroup( name_group, aTopGroup ); - aGroup->OpenOnDisk(); - // get number of groups - int aNbSubObjects = aGroup->nInternalObjects(); - for ( int j = 0; j < aNbSubObjects; j++ ) { - char name_dataset[ HDF_NAME_MAX_LEN+1 ]; - aGroup->InternalObjectIndentify( j, name_dataset ); - // check if it is an group - if ( string( name_dataset ).substr( 0, 5 ) == string( "Group" ) ) { - // --> get group id - int subid = atoi( string( name_dataset ).substr( 5 ).c_str() ); - if ( subid <= 0 ) - continue; - aDataset = new HDFdataset( name_dataset, aGroup ); - aDataset->OpenOnDisk(); + if ( aSubMesh->_is_nil() ) + continue; + + // VSR: Get submesh data from MED convertor + // int anInternalSubmeshId = aSubMesh->GetId(); // this is not a persistent ID, it's an internal one computed from sub-shape + // if (myNewMeshImpl->_mapSubMesh.find(anInternalSubmeshId) != myNewMeshImpl->_mapSubMesh.end()) { + // if(MYDEBUG) MESSAGE("VSR - SMESH_Gen_i::Load(): loading from MED file submesh with ID = " << + // subid << " for subshape # " << anInternalSubmeshId); + // SMESHDS_SubMesh* aSubMeshDS = + // myNewMeshImpl->_mapSubMesh[anInternalSubmeshId]->CreateSubMeshDS(); + // if ( !aSubMeshDS ) { + // if(MYDEBUG) MESSAGE("VSR - SMESH_Gen_i::Load(): FAILED to create a submesh for subshape # " << + // anInternalSubmeshId << " in current mesh!"); + // } + // else + // myReader.GetSubMesh( aSubMeshDS, subid ); + // } + + // try to get applied algorithms + if ( aSubGroup->ExistInternalObject( "Applied Algorithms" ) ) { + // open "applied algorithms" HDF group + aSubSubGroup = new HDFgroup( "Applied Algorithms", aSubGroup ); + aSubSubGroup->OpenOnDisk(); + // get number of applied algorithms + int aNbSubObjects = aSubSubGroup->nInternalObjects(); + for ( int l = 0; l < aNbSubObjects; l++ ) { + char name_dataset[ HDF_NAME_MAX_LEN+1 ]; + aSubSubGroup->InternalObjectIndentify( l, name_dataset ); + // check if it is an algorithm + if ( string( name_dataset ).substr( 0, 4 ) == string( "Algo" ) ) { + aDataset = new HDFdataset( name_dataset, aSubSubGroup ); + aDataset->OpenOnDisk(); + size = aDataset->GetSize(); + char* refFromFile = new char[ size ]; + aDataset->ReadFromDisk( refFromFile ); + aDataset->CloseOnDisk(); - // Retrieve actual group name - size = aDataset->GetSize(); - char* nameFromFile = new char[ size ]; - aDataset->ReadFromDisk( nameFromFile ); - aDataset->CloseOnDisk(); + //SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile ); + //CORBA::Object_var hypObject = SObjectToObject( hypSO ); + int id = atoi( refFromFile ); + string anIOR = myStudyContext->getIORbyOldId( id ); + if ( !anIOR.empty() ) { + CORBA::Object_var hypObject = GetORB()->string_to_object( anIOR.c_str() ); + if ( !CORBA::is_nil( hypObject ) ) { + SMESH::SMESH_Hypothesis_var anHyp = SMESH::SMESH_Hypothesis::_narrow( hypObject ); + if ( !anHyp->_is_nil() && !aShapeObject->_is_nil() ) + myNewMeshImpl->addHypothesis( aSubShapeObject, anHyp ); + } + } + } + } + // close "applied algorithms" HDF group + aSubSubGroup->CloseOnDisk(); + } - // Try to find a shape reference - TopoDS_Shape aShape; - char aRefName[ 30 ]; - sprintf( aRefName, "Ref on shape %d", subid); - if ( aGroup->ExistInternalObject( aRefName ) ) { - // load mesh "Ref on shape" - it's an entry to SObject - aDataset = new HDFdataset( aRefName, aGroup ); + // try to get applied hypotheses + if ( aSubGroup->ExistInternalObject( "Applied Hypotheses" ) ) { + // open "applied hypotheses" HDF group + aSubSubGroup = new HDFgroup( "Applied Hypotheses", aSubGroup ); + aSubSubGroup->OpenOnDisk(); + // get number of applied hypotheses + int aNbSubObjects = aSubSubGroup->nInternalObjects(); + for ( int l = 0; l < aNbSubObjects; l++ ) { + char name_dataset[ HDF_NAME_MAX_LEN+1 ]; + aSubSubGroup->InternalObjectIndentify( l, name_dataset ); + // check if it is a hypothesis + if ( string( name_dataset ).substr( 0, 3 ) == string( "Hyp" ) ) { + aDataset = new HDFdataset( name_dataset, aSubSubGroup ); aDataset->OpenOnDisk(); size = aDataset->GetSize(); char* refFromFile = new char[ size ]; aDataset->ReadFromDisk( refFromFile ); aDataset->CloseOnDisk(); - if ( strlen( refFromFile ) > 0 ) { - SALOMEDS::SObject_var shapeSO = myCurrentStudy->FindObjectID( refFromFile ); - CORBA::Object_var shapeObject = SObjectToObject( shapeSO ); - if ( !CORBA::is_nil( shapeObject ) ) { - aShapeObject = GEOM::GEOM_Object::_narrow( shapeObject ); - if ( !aShapeObject->_is_nil() ) - aShape = GeomObjectToShape( aShapeObject ); + + //SALOMEDS::SObject_var hypSO = myCurrentStudy->FindObjectID( refFromFile ); + //CORBA::Object_var hypObject = SObjectToObject( hypSO ); + int id = atoi( refFromFile ); + string anIOR = myStudyContext->getIORbyOldId( id ); + if ( !anIOR.empty() ) { + CORBA::Object_var hypObject = GetORB()->string_to_object( anIOR.c_str() ); + if ( !CORBA::is_nil( hypObject ) ) { + SMESH::SMESH_Hypothesis_var anHyp = SMESH::SMESH_Hypothesis::_narrow( hypObject ); + if ( !anHyp->_is_nil() && !aShapeObject->_is_nil() ) + myNewMeshImpl->addHypothesis( aSubShapeObject, anHyp ); } } } - // Create group servant - SMESH::ElementType type = (SMESH::ElementType)(ii - GetNodeGroupsTag() + 1); - SMESH::SMESH_GroupBase_var aNewGroup = SMESH::SMESH_GroupBase::_duplicate - ( myNewMeshImpl->createGroup( type, nameFromFile, aShape ) ); - // Obtain a SMESHDS_Group object - if ( aNewGroup->_is_nil() ) - continue; - - string iorSubString = GetORB()->object_to_string( aNewGroup ); - int newSubId = myStudyContext->findId( iorSubString ); - myStudyContext->mapOldToNew( subid, newSubId ); + } + // close "applied hypotheses" HDF group + aSubSubGroup->CloseOnDisk(); + } - SMESH_GroupBase_i* aGroupImpl = - dynamic_cast( GetServant( aNewGroup ).in() ); - if ( !aGroupImpl ) - continue; + // close submesh HDF group + aSubGroup->CloseOnDisk(); + } + } + // close submeshes containers HDF group + aGroup->CloseOnDisk(); + } + } - SMESH_Group* aLocalGroup = myLocMesh.GetGroup( aGroupImpl->GetLocalID() ); - if ( !aLocalGroup ) - continue; + if(hasData) { - SMESHDS_GroupBase* aGroupBaseDS = aLocalGroup->GetGroupDS(); - aGroupBaseDS->SetStoreName( name_dataset ); + // Read sub-meshes from MED + // ------------------------- + if(MYDEBUG) MESSAGE("Create all sub-meshes"); + bool submeshesInFamilies = ( ! aTopGroup->ExistInternalObject( "Submeshes" )); + if ( submeshesInFamilies ) + { + // old way working before fix of PAL 12992 + myReader.CreateAllSubMeshes(); + } + else + { + // open a group + aGroup = new HDFgroup( "Submeshes", aTopGroup ); + aGroup->OpenOnDisk(); + + int maxID = mySMESHDSMesh->MaxShapeIndex(); + vector< SMESHDS_SubMesh * > subMeshes( maxID + 1, (SMESHDS_SubMesh*) 0 ); + vector< TopAbs_ShapeEnum > smType ( maxID + 1, TopAbs_SHAPE ); + + PositionCreator aPositionCreator; + + SMDS_NodeIteratorPtr nIt = mySMESHDSMesh->nodesIterator(); + SMDS_ElemIteratorPtr eIt = mySMESHDSMesh->elementsIterator(); + for ( int isNode = 0; isNode < 2; ++isNode ) + { + string aDSName( isNode ? "Node Submeshes" : "Element Submeshes"); + if ( aGroup->ExistInternalObject( (char*) aDSName.c_str() )) + { + aDataset = new HDFdataset( (char*) aDSName.c_str(), aGroup ); + aDataset->OpenOnDisk(); + // read submesh IDs for all elements sorted by ID + int nbElems = aDataset->GetSize(); + int* smIDs = new int [ nbElems ]; + aDataset->ReadFromDisk( smIDs ); + aDataset->CloseOnDisk(); + + // get elements sorted by ID + ::SMESH_MeshEditor::TIDSortedElemSet elemSet; + if ( isNode ) + while ( nIt->more() ) elemSet.insert( nIt->next() ); + else + while ( eIt->more() ) elemSet.insert( eIt->next() ); + ASSERT( elemSet.size() == nbElems ); + + // add elements to submeshes + ::SMESH_MeshEditor::TIDSortedElemSet::iterator iE = elemSet.begin(); + for ( int i = 0; i < nbElems; ++i, ++iE ) + { + int smID = smIDs[ i ]; + if ( smID == 0 ) continue; + ASSERT( smID <= maxID ); + const SMDS_MeshElement* elem = *iE; + // get or create submesh + SMESHDS_SubMesh* & sm = subMeshes[ smID ]; + if ( ! sm ) { + sm = mySMESHDSMesh->NewSubMesh( smID ); + smType[ smID ] = mySMESHDSMesh->IndexToShape( smID ).ShapeType(); + } + // add + if ( isNode ) { + SMDS_PositionPtr pos = aPositionCreator.MakePosition( smType[ smID ]); + pos->SetShapeId( smID ); + SMDS_MeshNode* node = const_cast( static_cast( elem )); + node->SetPosition( pos ); + sm->AddNode( node ); + } else { + sm->AddElement( elem ); + } + } + delete smIDs; + } + } + } // end reading submeshes + + // Read node positions on sub-shapes (SMDS_Position) + + if ( aTopGroup->ExistInternalObject( "Node Positions" )) + { + // There are 5 datasets to read: + // "Nodes on Edges" - ID of node on edge + // "Edge positions" - U parameter on node on edge + // "Nodes on Faces" - ID of node on face + // "Face U positions" - U parameter of node on face + // "Face V positions" - V parameter of node on face + char* aEid_DSName = "Nodes on Edges"; + char* aEu_DSName = "Edge positions"; + char* aFu_DSName = "Face U positions"; + //char* aFid_DSName = "Nodes on Faces"; + //char* aFv_DSName = "Face V positions"; + + // data to retrieve + int nbEids = 0, nbFids = 0; + int *aEids = 0, *aFids = 0; + double *aEpos = 0, *aFupos = 0, *aFvpos = 0; + + // open a group + aGroup = new HDFgroup( "Node Positions", aTopGroup ); + aGroup->OpenOnDisk(); + + // loop on 5 data sets + int aNbObjects = aGroup->nInternalObjects(); + for ( int i = 0; i < aNbObjects; i++ ) + { + // identify dataset + char aDSName[ HDF_NAME_MAX_LEN+1 ]; + aGroup->InternalObjectIndentify( i, aDSName ); + // read data + aDataset = new HDFdataset( aDSName, aGroup ); + aDataset->OpenOnDisk(); + if ( aDataset->GetType() == HDF_FLOAT64 ) // Positions + { + double* pos = new double [ aDataset->GetSize() ]; + aDataset->ReadFromDisk( pos ); + // which one? + if ( strncmp( aDSName, aEu_DSName, strlen( aEu_DSName )) == 0 ) + aEpos = pos; + else if ( strncmp( aDSName, aFu_DSName, strlen( aFu_DSName )) == 0 ) + aFupos = pos; + else + aFvpos = pos; + } + else // NODE IDS + { + int aSize = aDataset->GetSize(); + + // for reading files, created from 18.07.2005 till 10.10.2005 + if (aDataset->GetType() == HDF_STRING) + aSize /= sizeof(int); + + int* ids = new int [aSize]; + aDataset->ReadFromDisk( ids ); + // on face or nodes? + if ( strncmp( aDSName, aEid_DSName, strlen( aEid_DSName )) == 0 ) { + aEids = ids; + nbEids = aSize; + } + else { + aFids = ids; + nbFids = aSize; + } + } + aDataset->CloseOnDisk(); + } // loop on 5 datasets + + // Set node positions on edges or faces + for ( int onFace = 0; onFace < 2; onFace++ ) + { + int nbNodes = ( onFace ? nbFids : nbEids ); + if ( nbNodes == 0 ) continue; + int* aNodeIDs = ( onFace ? aFids : aEids ); + double* aUPos = ( onFace ? aFupos : aEpos ); + double* aVPos = ( onFace ? aFvpos : 0 ); + // loop on node IDs + for ( int iNode = 0; iNode < nbNodes; iNode++ ) + { + const SMDS_MeshNode* node = mySMESHDSMesh->FindNode( aNodeIDs[ iNode ]); + ASSERT( node ); + SMDS_PositionPtr aPos = node->GetPosition(); + ASSERT( aPos ) + if ( onFace ) { + ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_FACE ); + SMDS_FacePosition* fPos = const_cast + ( static_cast( aPos.get() )); + fPos->SetUParameter( aUPos[ iNode ]); + fPos->SetVParameter( aVPos[ iNode ]); + } + else { + ASSERT( aPos->GetTypeOfPosition() == SMDS_TOP_EDGE ); + SMDS_EdgePosition* fPos = const_cast + ( static_cast( aPos.get() )); + fPos->SetUParameter( aUPos[ iNode ]); + } + } + } + if ( aEids ) delete [] aEids; + if ( aFids ) delete [] aFids; + if ( aEpos ) delete [] aEpos; + if ( aFupos ) delete [] aFupos; + if ( aFvpos ) delete [] aFvpos; + + aGroup->CloseOnDisk(); + + } // if ( aTopGroup->ExistInternalObject( "Node Positions" ) ) + } // if ( hasData ) + + // Recompute State (as computed sub-meshes are restored from MED) + if ( !aShapeObject->_is_nil() ) { + MESSAGE("Compute State Engine ..."); + TopoDS_Shape myLocShape = GeomObjectToShape( aShapeObject ); + myNewMeshImpl->GetImpl().GetSubMesh(myLocShape)->ComputeStateEngine + (SMESH_subMesh::SUBMESH_RESTORED); + MESSAGE("Compute State Engine finished"); + } - // Fill group with contents from MED file - SMESHDS_Group* aGrp = dynamic_cast( aGroupBaseDS ); - if ( aGrp ) - myReader.GetGroup( aGrp ); - } - } - aGroup->CloseOnDisk(); - } - } - } - // close mesh group - aTopGroup->CloseOnDisk(); + // try to get groups + for ( int ii = GetNodeGroupsTag(); ii <= GetVolumeGroupsTag(); ii++ ) { + char name_group[ 30 ]; + if ( ii == GetNodeGroupsTag() ) + strcpy( name_group, "Groups of Nodes" ); + else if ( ii == GetEdgeGroupsTag() ) + strcpy( name_group, "Groups of Edges" ); + else if ( ii == GetFaceGroupsTag() ) + strcpy( name_group, "Groups of Faces" ); + else if ( ii == GetVolumeGroupsTag() ) + strcpy( name_group, "Groups of Volumes" ); + + if ( aTopGroup->ExistInternalObject( name_group ) ) { + aGroup = new HDFgroup( name_group, aTopGroup ); + aGroup->OpenOnDisk(); + // get number of groups + int aNbSubObjects = aGroup->nInternalObjects(); + for ( int j = 0; j < aNbSubObjects; j++ ) { + char name_dataset[ HDF_NAME_MAX_LEN+1 ]; + aGroup->InternalObjectIndentify( j, name_dataset ); + // check if it is an group + if ( string( name_dataset ).substr( 0, 5 ) == string( "Group" ) ) { + // --> get group id + int subid = atoi( string( name_dataset ).substr( 5 ).c_str() ); + if ( subid <= 0 ) + continue; + aDataset = new HDFdataset( name_dataset, aGroup ); + aDataset->OpenOnDisk(); + + // Retrieve actual group name + size = aDataset->GetSize(); + char* nameFromFile = new char[ size ]; + aDataset->ReadFromDisk( nameFromFile ); + aDataset->CloseOnDisk(); + + // Try to find a shape reference + TopoDS_Shape aShape; + char aRefName[ 30 ]; + sprintf( aRefName, "Ref on shape %d", subid); + if ( aGroup->ExistInternalObject( aRefName ) ) { + // load mesh "Ref on shape" - it's an entry to SObject + aDataset = new HDFdataset( aRefName, aGroup ); + aDataset->OpenOnDisk(); + size = aDataset->GetSize(); + char* refFromFile = new char[ size ]; + aDataset->ReadFromDisk( refFromFile ); + aDataset->CloseOnDisk(); + if ( strlen( refFromFile ) > 0 ) { + SALOMEDS::SObject_var shapeSO = myCurrentStudy->FindObjectID( refFromFile ); + CORBA::Object_var shapeObject = SObjectToObject( shapeSO ); + if ( !CORBA::is_nil( shapeObject ) ) { + aShapeObject = GEOM::GEOM_Object::_narrow( shapeObject ); + if ( !aShapeObject->_is_nil() ) + aShape = GeomObjectToShape( aShapeObject ); + } + } + } + // Create group servant + SMESH::ElementType type = (SMESH::ElementType)(ii - GetNodeGroupsTag() + 1); + SMESH::SMESH_GroupBase_var aNewGroup = SMESH::SMESH_GroupBase::_duplicate + ( myNewMeshImpl->createGroup( type, nameFromFile, aShape ) ); + // Obtain a SMESHDS_Group object + if ( aNewGroup->_is_nil() ) + continue; + + string iorSubString = GetORB()->object_to_string( aNewGroup ); + int newSubId = myStudyContext->findId( iorSubString ); + myStudyContext->mapOldToNew( subid, newSubId ); + + SMESH_GroupBase_i* aGroupImpl = + dynamic_cast( GetServant( aNewGroup ).in() ); + if ( !aGroupImpl ) + continue; + + SMESH_Group* aLocalGroup = myLocMesh.GetGroup( aGroupImpl->GetLocalID() ); + if ( !aLocalGroup ) + continue; + + SMESHDS_GroupBase* aGroupBaseDS = aLocalGroup->GetGroupDS(); + aGroupBaseDS->SetStoreName( name_dataset ); + + // Fill group with contents from MED file + SMESHDS_Group* aGrp = dynamic_cast( aGroupBaseDS ); + if ( aGrp ) + myReader.GetGroup( aGrp ); + } + } + aGroup->CloseOnDisk(); + } } } + // close mesh group + aTopGroup->CloseOnDisk(); } // close HDF file aFile->CloseOnDisk(); @@ -2937,7 +3129,7 @@ bool SMESH_Gen_i::Load( SALOMEDS::SComponent_ptr theComponent, /*! * SMESH_Gen_i::LoadASCII * - * Load SMESH module's data in ASCII format (not implemented yet) + * Load SMESH module's data in ASCII format */ //============================================================================= @@ -2946,7 +3138,29 @@ bool SMESH_Gen_i::LoadASCII( SALOMEDS::SComponent_ptr theComponent, const char* theURL, bool isMultiFile ) { if(MYDEBUG) MESSAGE( "SMESH_Gen_i::LoadASCII" ); - return Load( theComponent, theStream, theURL, isMultiFile ); + + //before call main ::Load method it's need for decipher text format to + //binary ( "|xx" => x' ) + int size = theStream.length(); + if ( int((size / 3 )*3) != size ) //error size of buffer + return false; + + int real_size = int(size / 3); + + _CORBA_Octet* buffer = new _CORBA_Octet[real_size]; + char tmp[3]; + tmp[2]='\0'; + int c = -1; + for ( int i = 0; i < real_size; i++ ) + { + memcpy( &(tmp[0]), &(theStream[i*3+1]), 2 ); + sscanf( tmp, "%x", &c ); + sprintf( (char*)&(buffer[i]), "%c", (char)c ); + } + + SALOMEDS::TMPFile_var aRealStreamFile = new SALOMEDS::TMPFile(real_size, real_size, buffer, 1); + + return Load( theComponent, *(aRealStreamFile._retn()), theURL, isMultiFile ); } //============================================================================= @@ -3042,15 +3256,33 @@ char* SMESH_Gen_i::LocalPersistentIDToIOR( SALOMEDS::SObject_ptr /*theSObject*/, //======================================================================= int SMESH_Gen_i::RegisterObject(CORBA::Object_ptr theObject) +{ + StudyContext* myStudyContext = GetCurrentStudyContext(); + if ( myStudyContext && !CORBA::is_nil( theObject )) { + CORBA::String_var iorString = GetORB()->object_to_string( theObject ); + return myStudyContext->addObject( string( iorString.in() ) ); + } + return 0; +} + +//================================================================================ +/*! + * \brief Return id of registered object + * \param theObject - the Object + * \retval int - Object id + */ +//================================================================================ + +int SMESH_Gen_i::GetObjectId(CORBA::Object_ptr theObject) { StudyContext* myStudyContext = GetCurrentStudyContext(); if ( myStudyContext && !CORBA::is_nil( theObject )) { string iorString = GetORB()->object_to_string( theObject ); - return myStudyContext->addObject( iorString ); + return myStudyContext->findId( iorString ); } return 0; } - + //============================================================================= /*! * SMESHEngine_factory @@ -3060,7 +3292,7 @@ int SMESH_Gen_i::RegisterObject(CORBA::Object_ptr theObject) //============================================================================= extern "C" -{ +{ SMESH_I_EXPORT PortableServer::ObjectId* SMESHEngine_factory( CORBA::ORB_ptr orb, PortableServer::POA_ptr poa, PortableServer::ObjectId* contId, diff --git a/src/SMESH_I/SMESH_Gen_i.hxx b/src/SMESH_I/SMESH_Gen_i.hxx index 86ee7f1b8..4a1088f96 100644 --- a/src/SMESH_I/SMESH_Gen_i.hxx +++ b/src/SMESH_I/SMESH_Gen_i.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_GEN_I_HXX_ #define _SMESH_GEN_I_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Gen) #include CORBA_SERVER_HEADER(SMESH_Mesh) @@ -58,7 +60,7 @@ class SALOME_LifeCycleCORBA; // =========================================================== // Study context - stores study-connected objects references // ========================================================== -class StudyContext +class SMESH_I_EXPORT StudyContext { public: // constructor @@ -104,6 +106,15 @@ public: void mapOldToNew( const int oldId, const int newId ) { mapIdToId[ oldId ] = newId; } + // get old id by a new one + int getOldId( const int newId ) { + map::iterator imap; + for ( imap = mapIdToId.begin(); imap != mapIdToId.end(); ++imap ) { + if ( imap->second == newId ) + return imap->first; + } + return 0; + } private: // get next free object identifier @@ -122,7 +133,7 @@ private: // =========================================================== // SMESH module's engine // ========================================================== -class SMESH_Gen_i: +class SMESH_I_EXPORT SMESH_Gen_i: public virtual POA_SMESH::SMESH_Gen, public virtual Engines_Component_i { @@ -229,12 +240,17 @@ public: const SMESH::object_array& theListOfSubShape ) throw ( SALOME::SALOME_Exception ); - // Return geometrical object the given element is built on + // Return geometrical object the given element is built on. Publish it in study. GEOM::GEOM_Object_ptr GetGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh, CORBA::Long theElementID, const char* theGeomName) throw ( SALOME::SALOME_Exception ); + // Return geometrical object the given element is built on. Don't publish it in study. + GEOM::GEOM_Object_ptr FindGeometryByMeshElement( SMESH::SMESH_Mesh_ptr theMesh, + CORBA::Long theElementID) + throw ( SALOME::SALOME_Exception ); + // **************************************************** // Interface inherited methods (from SALOMEDS::Driver) // **************************************************** @@ -394,6 +410,21 @@ public: // Register an object in a StudyContext; return object id int RegisterObject(CORBA::Object_ptr theObject); + // Return id of registered object + int GetObjectId(CORBA::Object_ptr theObject); + + // Return an object that previously had an oldID + template + typename TInterface::_var_type GetObjectByOldId( const int oldID ) + { + if ( StudyContext* myStudyContext = GetCurrentStudyContext() ) { + string ior = myStudyContext->getIORbyOldId( oldID ); + if ( !ior.empty() ) + return TInterface::_narrow(GetORB()->string_to_object( ior.c_str() )); + } + return TInterface::_nil(); + } + // Get current study ID int GetCurrentStudyID() { return myCurrentStudy->_is_nil() ? -1 : myCurrentStudy->StudyId(); } diff --git a/src/SMESH_I/SMESH_Gen_i_1.cxx b/src/SMESH_I/SMESH_Gen_i_1.cxx index 2021f22e2..2ff4d8874 100644 --- a/src/SMESH_I/SMESH_Gen_i_1.cxx +++ b/src/SMESH_I/SMESH_Gen_i_1.cxx @@ -180,7 +180,10 @@ SALOMEDS::SObject_ptr SMESH_Gen_i::ObjectToSObject(SALOMEDS::Study_ptr theStudy, { SALOMEDS::SObject_var aSO; if ( !CORBA::is_nil( theStudy ) && !CORBA::is_nil( theObject )) - aSO = theStudy->FindObjectIOR( SMESH_Gen_i::GetORB()->object_to_string( theObject ) ); + { + CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theObject ); + aSO = theStudy->FindObjectIOR( objStr.in() ); + } return aSO._retn(); } @@ -253,8 +256,8 @@ static SALOMEDS::SObject_ptr publish(SALOMEDS::Study_ptr theStudy, SALOMEDS::GenericAttribute_var anAttr; if ( !CORBA::is_nil( theIOR )) { anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributeIOR" ); - SALOMEDS::AttributeIOR::_narrow(anAttr)->SetValue - ( SMESH_Gen_i::GetORB()->object_to_string( theIOR ) ); + CORBA::String_var objStr = SMESH_Gen_i::GetORB()->object_to_string( theIOR ); + SALOMEDS::AttributeIOR::_narrow(anAttr)->SetValue( objStr.in() ); } if ( thePixMap ) { anAttr = aStudyBuilder->FindOrCreateAttribute( SO, "AttributePixMap" ); diff --git a/src/SMESH_I/SMESH_Group_i.hxx b/src/SMESH_I/SMESH_Group_i.hxx index b02f3d896..e6b181377 100644 --- a/src/SMESH_I/SMESH_Group_i.hxx +++ b/src/SMESH_I/SMESH_Group_i.hxx @@ -29,6 +29,8 @@ #ifndef SMESH_Group_i_HeaderFile #define SMESH_Group_i_HeaderFile +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Group) #include CORBA_SERVER_HEADER(SMESH_Mesh) @@ -43,7 +45,7 @@ class SMESHDS_GroupBase; // =========== // Group Base // =========== -class SMESH_GroupBase_i: +class SMESH_I_EXPORT SMESH_GroupBase_i: public virtual POA_SMESH::SMESH_GroupBase, public virtual SALOME::GenericObj_i { @@ -85,7 +87,7 @@ private: // Group // ====== -class SMESH_Group_i: +class SMESH_I_EXPORT SMESH_Group_i: public virtual POA_SMESH::SMESH_Group, public SMESH_GroupBase_i { @@ -105,7 +107,7 @@ class SMESH_Group_i: // Group linked to geometry // ========================= -class SMESH_GroupOnGeom_i: +class SMESH_I_EXPORT SMESH_GroupOnGeom_i: public virtual POA_SMESH::SMESH_GroupOnGeom, public SMESH_GroupBase_i { diff --git a/src/SMESH_I/SMESH_Hypothesis_i.cxx b/src/SMESH_I/SMESH_Hypothesis_i.cxx index 4f9a90d25..fedc07722 100644 --- a/src/SMESH_I/SMESH_Hypothesis_i.cxx +++ b/src/SMESH_I/SMESH_Hypothesis_i.cxx @@ -26,12 +26,13 @@ // Module : SMESH // $Header$ -using namespace std; #include #include #include "SMESH_Hypothesis_i.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * SMESH_Hypothesis_i::SMESH_Hypothesis_i @@ -45,25 +46,10 @@ SMESH_Hypothesis_i::SMESH_Hypothesis_i( PortableServer::POA_ptr thePOA ) { MESSAGE( "SMESH_Hypothesis_i::SMESH_Hypothesis_i / Début" ); myBaseImpl = 0; - // _CS_gbo This instruction fails - // thePOA->activate_object( this ); - // _CS_gbo I keep the POA reference to activate the object in the future. - myPOA = thePOA; MESSAGE( "SMESH_Hypothesis_i::SMESH_Hypothesis_i / Fin" ); }; -//============================================================================= -/*! - * SMESH_Hypothesis_i::Activate() - * - * Activation of the object - */ -//============================================================================= -void SMESH_Hypothesis_i::Activate() { - myPOA->activate_object( this ); -} - //============================================================================= /*! * SMESH_Hypothesis_i::~SMESH_Hypothesis_i diff --git a/src/SMESH_I/SMESH_Hypothesis_i.hxx b/src/SMESH_I/SMESH_Hypothesis_i.hxx index 344444af6..634e245c6 100644 --- a/src/SMESH_I/SMESH_Hypothesis_i.hxx +++ b/src/SMESH_I/SMESH_Hypothesis_i.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_HYPOTHESIS_I_HXX_ #define _SMESH_HYPOTHESIS_I_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Hypothesis) @@ -40,7 +42,7 @@ // ====================================================== // Generic hypothesis // ====================================================== -class SMESH_Hypothesis_i: +class SMESH_I_EXPORT SMESH_Hypothesis_i: public virtual POA_SMESH::SMESH_Hypothesis, public virtual SALOME::GenericObj_i { @@ -67,25 +69,18 @@ public: // Get implementation ::SMESH_Hypothesis* GetImpl(); - // _CS_gbo_ Activate the object using the POA - void Activate(); - // Persistence virtual char* SaveTo(); virtual void LoadFrom( const char* theStream ); protected: ::SMESH_Hypothesis* myBaseImpl; // base hypothesis implementation - - // _CS_gbo_070505 To keep the reference and delayed the activation - // in the methode Activate(). - PortableServer::POA_ptr myPOA; }; // ====================================================== // Generic hypothesis creator // ====================================================== -class GenericHypothesisCreator_i +class SMESH_I_EXPORT GenericHypothesisCreator_i { public: // Create a hypothesis diff --git a/src/SMESH_I/SMESH_MEDFamily_i.cxx b/src/SMESH_I/SMESH_MEDFamily_i.cxx index bb2fd8fab..94b63e575 100644 --- a/src/SMESH_I/SMESH_MEDFamily_i.cxx +++ b/src/SMESH_I/SMESH_MEDFamily_i.cxx @@ -24,11 +24,12 @@ // File : SMESH_MEDFamily_i.cxx // Module : SMESH -using namespace std; #include "SMESH_MEDFamily_i.hxx" #include "utilities.h" #include "Utils_CorbaException.hxx" +using namespace std; + //============================================================================= /*! * Default constructor diff --git a/src/SMESH_I/SMESH_MEDFamily_i.hxx b/src/SMESH_I/SMESH_MEDFamily_i.hxx index b2ea28e32..4dd63f3a1 100644 --- a/src/SMESH_I/SMESH_MEDFamily_i.hxx +++ b/src/SMESH_I/SMESH_MEDFamily_i.hxx @@ -27,11 +27,13 @@ #ifndef SMESH_MED_FAMILY_I_HXX_ #define SMESH_MED_FAMILY_I_HXX_ +#include "SMESH.hxx" + #include "SMESH_MEDSupport_i.hxx" #include -class SMESH_MEDFamily_i: +class SMESH_I_EXPORT SMESH_MEDFamily_i: public virtual POA_SALOME_MED::FAMILY, public virtual SMESH_MEDSupport_i { diff --git a/src/SMESH_I/SMESH_MEDMesh_i.cxx b/src/SMESH_I/SMESH_MEDMesh_i.cxx index 05ffe6701..b7f15cf17 100644 --- a/src/SMESH_I/SMESH_MEDMesh_i.cxx +++ b/src/SMESH_I/SMESH_MEDMesh_i.cxx @@ -863,8 +863,8 @@ void SMESH_MEDMesh_i::addInStudy(SALOMEDS::Study_ptr myStudy, * ORB_INIT &init = *SINGLETON_::Instance() ; * ASSERT(SINGLETON_::IsAlreadyExisting()) ; * CORBA::ORB_var &orb = init(0,0); - * string iorStr = orb->object_to_string(myIor); - * //myBuilder->AddAttribute(newObj,SALOMEDS::IOR,iorStr.c_str()); + * CORBA::String_var iorStr = orb->object_to_string(myIor); + * //myBuilder->AddAttribute(newObj,SALOMEDS::IOR,iorStr.in()); * SALOMEDS::AttributeIOR_var aIOR = SALOMEDS::AttributeIOR::_narrow( * myBuilder->FindOrCreateAttribute(newObj, "AttributeIOR")); * aIOR->SetValue(iorStr.c_str()); @@ -1137,9 +1137,15 @@ void SMESH_MEDMesh_i::createFamilies() throw(SALOME::SALOME_Exception) SMESH_MEDFamily_i *famservant = new SMESH_MEDFamily_i(famIdent, submesh_i, famName, famDes, SALOME_MED::MED_NODE); - SALOME_MED::FAMILY_ptr famille = - SALOME_MED::FAMILY::_narrow(famservant-> - POA_SALOME_MED::FAMILY::_this()); +#ifdef WNT + SALOME_MED::FAMILY_ptr famille = SALOME_MED::FAMILY::_nil(); + POA_SALOME_MED::FAMILY* servantbase = dynamic_cast(famservant); + if ( servantbase ) + famille = SALOME_MED::FAMILY::_narrow( servantbase->_this() ); +#else + SALOME_MED::FAMILY_ptr famille = + SALOME_MED::FAMILY::_narrow( famservant->POA_SALOME_MED::FAMILY::_this() ); +#endif _families.push_back(famille); } } diff --git a/src/SMESH_I/SMESH_MEDMesh_i.hxx b/src/SMESH_I/SMESH_MEDMesh_i.hxx index 3fd6e7103..05fe0727d 100644 --- a/src/SMESH_I/SMESH_MEDMesh_i.hxx +++ b/src/SMESH_I/SMESH_MEDMesh_i.hxx @@ -27,6 +27,8 @@ #ifndef _MED_SMESH_MESH_I_HXX_ #define _MED_SMESH_MESH_I_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(MED) #include @@ -44,7 +46,7 @@ class SMESH_Mesh_i; -class SMESH_MEDMesh_i: +class SMESH_I_EXPORT SMESH_MEDMesh_i: public virtual POA_SALOME_MED::MESH, public virtual SALOME::GenericObj_i { diff --git a/src/SMESH_I/SMESH_MEDSupport_i.cxx b/src/SMESH_I/SMESH_MEDSupport_i.cxx index 27d8cf0df..e9b45e009 100644 --- a/src/SMESH_I/SMESH_MEDSupport_i.cxx +++ b/src/SMESH_I/SMESH_MEDSupport_i.cxx @@ -24,7 +24,6 @@ // File : SMESH_MEDSupport_i.cxx // Module : SMESH -using namespace std; #include "SMESH_MEDSupport_i.hxx" #include "utilities.h" #include "Utils_CorbaException.hxx" @@ -37,6 +36,8 @@ using namespace std; #include "SMESH_Mesh_i.hxx" #include "SMESH_subMesh_i.hxx" +using namespace std; + //============================================================================= /*! @@ -325,6 +326,18 @@ SALOME_MED::long_array * SMESH_MEDSupport_i::getNumber( } +//============================================================================= +/*! + * CORBA: get Nodes from file + */ +//============================================================================= + +SALOME_MED::long_array * SMESH_MEDSupport_i::getNumberFromFile( + SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception) +{ + return getNumber(geomElement); +} + //============================================================================= /*! * CORBA: Global Nodes Index (optionnaly designed by the user) diff --git a/src/SMESH_I/SMESH_MEDSupport_i.hxx b/src/SMESH_I/SMESH_MEDSupport_i.hxx index 68fb7fe41..3a1d164e2 100644 --- a/src/SMESH_I/SMESH_MEDSupport_i.hxx +++ b/src/SMESH_I/SMESH_MEDSupport_i.hxx @@ -27,6 +27,8 @@ #ifndef _MED_SMESH_MEDSUPPORT_I_HXX_ #define _MED_SMESH_MEDSUPPORT_I_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(MED) #include @@ -40,7 +42,7 @@ #include "SALOME_GenericObj_i.hh" class SMESH_subMesh_i; -class SMESH_MEDSupport_i: +class SMESH_I_EXPORT SMESH_MEDSupport_i: public virtual POA_SALOME_MED::SUPPORT, public virtual SALOME::GenericObj_i { public: @@ -66,6 +68,13 @@ class SMESH_MEDSupport_i: getNumber(SALOME_MED::medGeometryElement geomElement) throw(SALOME::SALOME_Exception); + /*! + * Same function as getNumber. + */ + SALOME_MED::long_array * + getNumberFromFile(SALOME_MED::medGeometryElement geomElement) + throw(SALOME::SALOME_Exception); + SALOME_MED::long_array * getNumberIndex() throw(SALOME::SALOME_Exception); diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 55fc2330d..1a87b258f 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -37,6 +37,7 @@ #include "SMESH_Gen_i.hxx" #include "SMESH_Filter_i.hxx" #include "SMESH_PythonDump.hxx" +#include "CASCatch.hxx" #include "utilities.h" @@ -1604,7 +1605,7 @@ void SMESH_MeshEditor_i::FindCoincidentNodes (CORBA::Double Tol for ( CORBA::Long i = 0; llIt != aListOfListOfNodes.end(); llIt++, i++ ) { list< const SMDS_MeshNode* >& aListOfNodes = *llIt; list< const SMDS_MeshNode* >::iterator lIt = aListOfNodes.begin();; - SMESH::long_array& aGroup = GroupsOfNodes[ i ]; + SMESH::long_array& aGroup = (*GroupsOfNodes)[i]; aGroup.length( aListOfNodes.size() ); for ( int j = 0; lIt != aListOfNodes.end(); lIt++, j++ ) aGroup[ j ] = (*lIt)->GetID(); @@ -1955,7 +1956,7 @@ CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(CORBA::Long ide, int nbn = newIDs.length(); int i=0; - const SMDS_MeshNode* aNodes [nbn]; + vector aNodes (nbn); int nbn1=-1; for(; iFindNode(newIDs[i]); @@ -1971,7 +1972,7 @@ CORBA::Boolean SMESH_MeshEditor_i::ChangeElemNodes(CORBA::Long ide, TPythonDump() << "print 'ChangeElemNodes: ', isDone"; #endif - return GetMeshDS()->ChangeElementNodes( elem, aNodes, nbn1+1 ); + return GetMeshDS()->ChangeElementNodes( elem, &aNodes[0], nbn1+1 ); } //================================================================================ diff --git a/src/SMESH_I/SMESH_MeshEditor_i.hxx b/src/SMESH_I/SMESH_MeshEditor_i.hxx index cd7538c62..6433d9162 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.hxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_MESHEDITOR_I_HXX_ #define _SMESH_MESHEDIOTR_I_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Mesh) @@ -36,7 +38,7 @@ class SMESH_MeshEditor; -class SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor +class SMESH_I_EXPORT SMESH_MeshEditor_i: public POA_SMESH::SMESH_MeshEditor { public: SMESH_MeshEditor_i(SMESH_Mesh * theMesh); diff --git a/src/SMESH_I/SMESH_Mesh_i.cxx b/src/SMESH_I/SMESH_Mesh_i.cxx index 367eda450..cdcb326bb 100644 --- a/src/SMESH_I/SMESH_Mesh_i.cxx +++ b/src/SMESH_I/SMESH_Mesh_i.cxx @@ -49,6 +49,7 @@ //#include "SMDS_ElemIterator.hxx" #include "SMDS_VolumeTool.hxx" #include "SMESH_MesherHelper.hxx" +#include "SMESH_MeshEditor.hxx" // OCCT Includes #include @@ -94,7 +95,6 @@ SMESH_Mesh_i::SMESH_Mesh_i( PortableServer::POA_ptr thePOA, _gen_i = gen_i; _id = myIdGenerator++; _studyId = studyId; - thePOA->activate_object( this ); } //============================================================================= @@ -318,6 +318,8 @@ static SMESH::Hypothesis_Status ConvertHypothesisStatus res = SMESH::HYP_BAD_DIM; break; case SMESH_Hypothesis::HYP_BAD_SUBSHAPE: res = SMESH::HYP_BAD_SUBSHAPE; break; + case SMESH_Hypothesis::HYP_BAD_GEOMETRY: + res = SMESH::HYP_BAD_GEOMETRY; break; default: res = SMESH::HYP_UNKNOWN_FATAL; } @@ -1857,9 +1859,7 @@ SMESH::long_array* SMESH_Mesh_i::GetNodeInverseElements(const CORBA::Long id) //============================================================================= /*! * If given element is node returns IDs of shape from position - * else - return ID of result shape after ::FindShape() - * from SMESH_MeshEditor - * If there is not element for given ID - returns -1 + * If there is not node for given ID - returns -1 */ //============================================================================= @@ -1879,12 +1879,35 @@ CORBA::Long SMESH_Mesh_i::GetShapeID(const CORBA::Long id) return pos->GetShapeId(); } + return -1; +} + + +//============================================================================= +/*! + * For given element returns ID of result shape after + * ::FindShape() from SMESH_MeshEditor + * If there is not element for given ID - returns -1 + */ +//============================================================================= + +CORBA::Long SMESH_Mesh_i::GetShapeIDForElem(const CORBA::Long id) +{ + SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS(); + if ( aSMESHDS_Mesh == NULL ) + return -1; + // try to find element const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id); if(!elem) return -1; - // need implementation??????????????????????????????????????????????? + //SMESH::SMESH_MeshEditor_var aMeshEditor = SMESH_Mesh_i::GetMeshEditor(); + ::SMESH_MeshEditor aMeshEditor(_impl); + int index = aMeshEditor.FindShape( elem ); + if(index>0) + return index; + return -1; } @@ -1925,6 +1948,26 @@ CORBA::Long SMESH_Mesh_i::GetElemNode(const CORBA::Long id, const CORBA::Long in return elem->GetNode(index)->GetID(); } +//============================================================================= +/*! + * Returns IDs of nodes of given element + */ +//============================================================================= + +SMESH::long_array* SMESH_Mesh_i::GetElemNodes(const CORBA::Long id) +{ + SMESH::long_array_var aResult = new SMESH::long_array(); + if ( SMESHDS_Mesh* aSMESHDS_Mesh = _impl->GetMeshDS() ) + { + if ( const SMDS_MeshElement* elem = aSMESHDS_Mesh->FindElement(id) ) + { + aResult->length( elem->NbNodes() ); + for ( int i = 0; i < elem->NbNodes(); ++i ) + aResult[ i ] = elem->GetNode( i )->GetID(); + } + } + return aResult._retn(); +} //============================================================================= /*! diff --git a/src/SMESH_I/SMESH_Mesh_i.hxx b/src/SMESH_I/SMESH_Mesh_i.hxx index d7c37b1de..92e431e4f 100644 --- a/src/SMESH_I/SMESH_Mesh_i.hxx +++ b/src/SMESH_I/SMESH_Mesh_i.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_MESH_I_HXX_ #define _SMESH_MESH_I_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_Group) @@ -48,7 +50,7 @@ class SMESH_GroupBase_i; #include -class SMESH_Mesh_i: +class SMESH_I_EXPORT SMESH_Mesh_i: public virtual POA_SMESH::SMESH_Mesh, public virtual SALOME::GenericObj_i { @@ -166,7 +168,7 @@ public: throw (SALOME::SALOME_Exception); void ExportUNV( const char* file ) throw (SALOME::SALOME_Exception); - void ExportSTL( const char* file, const bool isascii ) + void ExportSTL( const char* file, bool isascii ) throw (SALOME::SALOME_Exception); SALOME_MED::MESH_ptr GetMEDMesh() @@ -250,13 +252,13 @@ public: SMESH::long_array* GetNodesId() throw (SALOME::SALOME_Exception); - SMESH::ElementType GetElementType( const CORBA::Long id, const bool iselem ) + SMESH::ElementType GetElementType( CORBA::Long id, bool iselem ) throw (SALOME::SALOME_Exception); /*! * Returns ID of elements for given submesh */ - SMESH::long_array* GetSubMeshElementsId(const CORBA::Long ShapeID) + SMESH::long_array* GetSubMeshElementsId(CORBA::Long ShapeID) throw (SALOME::SALOME_Exception); /*! @@ -264,13 +266,13 @@ public: * If param all==true - returns all nodes, else - * returns only nodes on shapes. */ - SMESH::long_array* GetSubMeshNodesId(const CORBA::Long ShapeID, CORBA::Boolean all) + SMESH::long_array* GetSubMeshNodesId(CORBA::Long ShapeID, CORBA::Boolean all) throw (SALOME::SALOME_Exception); /*! * Returns type of elements for given submesh */ - SMESH::ElementType GetSubMeshElementType(const CORBA::Long ShapeID) + SMESH::ElementType GetSubMeshElementType(CORBA::Long ShapeID) throw (SALOME::SALOME_Exception); char* Dump(); @@ -311,72 +313,82 @@ public: * Get XYZ coordinates of node as list of double * If there is not node for given ID - returns empty list */ - SMESH::double_array* GetNodeXYZ(const CORBA::Long id); + SMESH::double_array* GetNodeXYZ(CORBA::Long id); /*! * For given node returns list of IDs of inverse elements * If there is not node for given ID - returns empty list */ - SMESH::long_array* GetNodeInverseElements(const CORBA::Long id); + SMESH::long_array* GetNodeInverseElements(CORBA::Long id); /*! * If given element is node returns IDs of shape from position - * else - return ID of result shape after ::FindShape() - * from SMESH_MeshEditor + * If there is not node for given ID - returns -1 + */ + CORBA::Long GetShapeID(CORBA::Long id); + + /*! + * For given element returns ID of result shape after + * ::FindShape() from SMESH_MeshEditor * If there is not element for given ID - returns -1 */ - CORBA::Long GetShapeID(const CORBA::Long id); + CORBA::Long GetShapeIDForElem(CORBA::Long id); /*! * Returns number of nodes for given element * If there is not element for given ID - returns -1 */ - CORBA::Long GetElemNbNodes(const CORBA::Long id); + CORBA::Long GetElemNbNodes(CORBA::Long id); + + /*! + * Returns IDs of nodes of given element + */ + SMESH::long_array* GetElemNodes(CORBA::Long id); /*! * Returns ID of node by given index for given element * If there is not element for given ID - returns -1 * If there is not node for given index - returns -2 */ - CORBA::Long GetElemNode(const CORBA::Long id, const CORBA::Long index); + CORBA::Long GetElemNode(CORBA::Long id, CORBA::Long index); /*! * Returns true if given node is medium node * in given quadratic element */ - CORBA::Boolean IsMediumNode(const CORBA::Long ide, const CORBA::Long idn); + CORBA::Boolean IsMediumNode(CORBA::Long ide, CORBA::Long idn); /*! * Returns true if given node is medium node * in one of quadratic elements */ - CORBA::Boolean IsMediumNodeOfAnyElem(const CORBA::Long idn, + CORBA::Boolean IsMediumNodeOfAnyElem(CORBA::Long idn, SMESH::ElementType theElemType); /*! * Returns number of edges for given element */ - CORBA::Long ElemNbEdges(const CORBA::Long id); + CORBA::Long ElemNbEdges(CORBA::Long id); /*! * Returns number of faces for given element */ - CORBA::Long ElemNbFaces(const CORBA::Long id); + CORBA::Long ElemNbFaces(CORBA::Long id); /*! * Returns true if given element is polygon */ - CORBA::Boolean IsPoly(const CORBA::Long id); + CORBA::Boolean IsPoly(CORBA::Long id); /*! * Returns true if given element is quadratic */ - CORBA::Boolean IsQuadratic(const CORBA::Long id); + CORBA::Boolean IsQuadratic(CORBA::Long id); /*! * Returns bary center for given element */ - SMESH::double_array* BaryCenter(const CORBA::Long id); + SMESH::double_array* BaryCenter(CORBA::Long id); map _mapSubMesh_i; //NRI diff --git a/src/SMESH_I/SMESH_Pattern_i.hxx b/src/SMESH_I/SMESH_Pattern_i.hxx index b1458636e..7a5a92cbf 100644 --- a/src/SMESH_I/SMESH_Pattern_i.hxx +++ b/src/SMESH_I/SMESH_Pattern_i.hxx @@ -30,6 +30,8 @@ #ifndef SMESH_Pattern_I_HeaderFile #define SMESH_Pattern_I_HeaderFile +#include "SMESH.hxx" + #include "SALOMEconfig.h" #include CORBA_SERVER_HEADER(SMESH_Pattern) #include CORBA_SERVER_HEADER(SMESH_Mesh) @@ -41,7 +43,7 @@ class SMESH_Gen_i; class SMESH_Mesh; -class SMESH_Pattern_i: +class SMESH_I_EXPORT SMESH_Pattern_i: public virtual POA_SMESH::SMESH_Pattern { public: @@ -75,9 +77,14 @@ class SMESH_Pattern_i: CORBA::Long theNode000Index, CORBA::Long theNode001Index); - CORBA::Boolean MakeMesh (SMESH::SMESH_Mesh_ptr theMesh, + //for omniORB conflict compilation + /*CORBA::Boolean MakeMesh (SMESH::SMESH_Mesh_ptr theMesh, const CORBA::Boolean CreatePolygons, - const CORBA::Boolean CreatePolyedrs); + const CORBA::Boolean CreatePolyedrs);*/ + + CORBA::Boolean MakeMesh (SMESH::SMESH_Mesh_ptr theMesh, + CORBA::Boolean CreatePolygons, + CORBA::Boolean CreatePolyedrs); SMESH::SMESH_Pattern::ErrorCode GetErrorCode(); diff --git a/src/SMESH_I/SMESH_PythonDump.hxx b/src/SMESH_I/SMESH_PythonDump.hxx index 3e9fd96d7..6e65a3d41 100644 --- a/src/SMESH_I/SMESH_PythonDump.hxx +++ b/src/SMESH_I/SMESH_PythonDump.hxx @@ -20,6 +20,8 @@ #ifndef _SMESH_PYTHONDUMP_HXX_ #define _SMESH_PYTHONDUMP_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SALOMEDS) @@ -37,7 +39,7 @@ namespace SMESH class Filter_i; class Functor_i; - class TPythonDump + class SMESH_I_EXPORT TPythonDump { std::ostringstream myStream; static size_t myCounter; diff --git a/src/SMESH_I/SMESH_subMesh_i.cxx b/src/SMESH_I/SMESH_subMesh_i.cxx index c7b876c5c..a073dfd7a 100644 --- a/src/SMESH_I/SMESH_subMesh_i.cxx +++ b/src/SMESH_I/SMESH_subMesh_i.cxx @@ -26,7 +26,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "SMESH_subMesh_i.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Mesh_i.hxx" @@ -40,6 +39,8 @@ using namespace std; #include #include +using namespace std; + //============================================================================= /*! * @@ -69,7 +70,6 @@ SMESH_subMesh_i::SMESH_subMesh_i( PortableServer::POA_ptr thePOA, _gen_i = gen_i; _mesh_i = mesh_i; _localId = localId; - thePOA->activate_object( this ); // **** } //============================================================================= diff --git a/src/SMESH_I/SMESH_subMesh_i.hxx b/src/SMESH_I/SMESH_subMesh_i.hxx index 3fca4373c..808b07cb6 100644 --- a/src/SMESH_I/SMESH_subMesh_i.hxx +++ b/src/SMESH_I/SMESH_subMesh_i.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_SUBMESH_I_HXX_ #define _SMESH_SUBMESH_I_HXX_ +#include "SMESH.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_Hypothesis) @@ -40,7 +42,7 @@ class SMESH_Gen_i; class SMESH_Mesh_i; -class SMESH_subMesh_i: +class SMESH_I_EXPORT SMESH_subMesh_i: public virtual POA_SMESH::SMESH_subMesh, public virtual SALOME::GenericObj_i { @@ -64,7 +66,10 @@ public: SMESH::long_array* GetElementsByType( SMESH::ElementType theElemType ) throw (SALOME::SALOME_Exception); - SMESH::ElementType GetElementType( const CORBA::Long id, const bool iselem ) + //for omniORB conflict compilation + /*SMESH::ElementType GetElementType( const CORBA::Long id, const bool iselem ) + throw (SALOME::SALOME_Exception);*/ + SMESH::ElementType GetElementType( CORBA::Long id, bool iselem ) throw (SALOME::SALOME_Exception); SMESH::long_array* GetNodesId() diff --git a/src/SMESH_SWIG/Makefile.in b/src/SMESH_SWIG/Makefile.in index f55e19c54..80ba78e72 100644 --- a/src/SMESH_SWIG/Makefile.in +++ b/src/SMESH_SWIG/Makefile.in @@ -66,6 +66,7 @@ EXPORT_PYSCRIPTS = libSMESH_Swig.py \ SMESH_test.py\ SMESH_test0.py\ SMESH_test1.py \ + SMESH_test1_AndDisplay.py \ SMESH_test2.py \ SMESH_test3.py \ SMESH_test4.py \ diff --git a/src/SMESH_SWIG/PAL_MESH_041_mesh.py b/src/SMESH_SWIG/PAL_MESH_041_mesh.py index 9e3b16a61..a3242150a 100755 --- a/src/SMESH_SWIG/PAL_MESH_041_mesh.py +++ b/src/SMESH_SWIG/PAL_MESH_041_mesh.py @@ -17,10 +17,10 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -import geompy import salome +import geompy +import smesh -import StdMeshers #-----------------------------GEOM---------------------------------------- @@ -51,72 +51,48 @@ Id_face1 = geompy.addToStudy(face1,"Face1") #-----------------------------SMESH------------------------------------------- -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") - -# -- Init -- -plane_mesh = salome.IDToObject( Id_face1) -smesh.SetCurrentStudy(salome.myStudy) - -mesh = smesh.CreateMesh(plane_mesh) - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) -id_mesh = salome.ObjectToID(mesh) -smeshgui.SetName( id_mesh, "Mesh_1") +# -- Init mesh -- +plane_mesh = salome.IDToObject( Id_face1) -print"---------------------Hypothesis" +mesh = smesh.Mesh(plane_mesh, "Mesh_1") +print"---------------------Hypothesis and Algorithms" #---------------- NumberOfSegments + numberOfSegment = 9 -hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" ) -hypNbSeg.SetNumberOfSegments( numberOfSegment ) +algoWireDes = mesh.Segment() +listHyp = algoWireDes.GetCompatibleHypothesis() +print algoWireDes.GetName() +algoWireDes.SetName("Ware descritisation") +hypNbSeg = algoWireDes.NumberOfSegments(numberOfSegment) print hypNbSeg.GetName() print hypNbSeg.GetNumberOfSegments() -smeshgui.SetName(salome.ObjectToID(hypNbSeg), "Nb. Segments") +smesh.SetName(hypNbSeg, "Nb. Segments") #--------------------------Max. Element Area maxElementArea = 200 -hypArea200 = smesh.CreateHypothesis("MaxElementArea","libStdMeshersEngine.so") -hypArea200.SetMaxElementArea( maxElementArea ) -print hypArea200.GetName() -print hypArea200.GetMaxElementArea() - -smeshgui.SetName(salome.ObjectToID(hypArea200), "Max. Element Area") - -print"---------------------Algorithms" - -#----------------------------Wire discretisation -algoWireDes = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" ) -listHyp = algoWireDes.GetCompatibleHypothesis() - -print algoWireDes.GetName() -smeshgui.SetName(salome.ObjectToID(algoWireDes), "Ware descritisation") - -#----------------------------Triangle (Mefisto) -algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" ) +algoMef = mesh.Triangle() listHyp = algoMef.GetCompatibleHypothesis() - print algoMef.GetName() +algoMef.SetName("Triangle (Mefisto)") -#----------------------------Add hipothesis to the plane -mesh.AddHypothesis( plane_mesh, hypNbSeg ) # nb segments -mesh.AddHypothesis( plane_mesh, hypArea200 ) # max area - -mesh.AddHypothesis( plane_mesh, algoWireDes ) # Regular 1D/wire discretisation -mesh.AddHypothesis( plane_mesh, algoMef ) # MEFISTO 2D +hypArea200 = algoMef.MaxElementArea(maxElementArea) +print hypArea200.GetName() +print hypArea200.GetMaxElementArea() +smesh.SetName(hypArea200, "Max. Element Area") -smeshgui.SetName(salome.ObjectToID(algoMef), "Triangle (Mefisto)") print "---------------------Compute the mesh" -smesh.Compute(mesh, plane_mesh) +ret = mesh.Compute() +print ret salome.sg.updateObjBrowser(1) diff --git a/src/SMESH_SWIG/PAL_MESH_043_2D.py b/src/SMESH_SWIG/PAL_MESH_043_2D.py index 5af684bd5..8c6d456a4 100755 --- a/src/SMESH_SWIG/PAL_MESH_043_2D.py +++ b/src/SMESH_SWIG/PAL_MESH_043_2D.py @@ -25,8 +25,8 @@ import salome import geompy -import SMESH -import StdMeshers +import smesh + #----------------------------------GEOM @@ -51,51 +51,25 @@ id_ellipse2 = geompy.addToStudy(ellipse2, "Ellips 2") #---------------------------------SMESH -# get smesh engine -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) - -# get SMESH GUI -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) - -# create hypoteses -hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg1.SetNumberOfSegments(18) -id_hypNbSeg1 = salome.ObjectToID(hypNbSeg1) -smeshgui.SetName(id_hypNbSeg1, "NumberOfSegments 1"); - -hypNbSeg2 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg2.SetNumberOfSegments(34) -id_hypNbSeg2 = salome.ObjectToID(hypNbSeg2) -smeshgui.SetName(id_hypNbSeg2, "NumberOfSegments 2"); - -# create algorithmes -algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -id_algoReg = salome.ObjectToID(algoReg) -smeshgui.SetName(id_algoReg, "Regular_1D"); # create the path mesh -mesh1 = smesh.CreateMesh(ellipse1) -id_mesh1 = salome.ObjectToID(mesh1) -smeshgui.SetName(id_mesh1, "Path Mesh"); +mesh1 = smesh.Mesh(ellipse1, "Path Mesh") -# set hypotheses and algos -mesh1.AddHypothesis(ellipse1,algoReg) -mesh1.AddHypothesis(ellipse1,hypNbSeg1) +algoReg1 = mesh1.Segment() +algoReg1.SetName("Regular_1D") +hypNbSeg1 = algoReg1.NumberOfSegments(18) +smesh.SetName(hypNbSeg1, "NumberOfSegments 1") # create the tool mesh -mesh2 = smesh.CreateMesh(ellipse2) -id_mesh2 = salome.ObjectToID(mesh2) -smeshgui.SetName(id_mesh2, "Tool Mesh"); - -# set hypotheses and algos -mesh2.AddHypothesis(ellipse2,algoReg) -mesh2.AddHypothesis(ellipse2,hypNbSeg2) +mesh2 = smesh.Mesh(ellipse2, "Tool Mesh") +algoReg2 = mesh2.Segment() +algoReg2.SetName("Regular_1D") +hypNbSeg2 = algoReg2.NumberOfSegments(34) +smesh.SetName(hypNbSeg2, "NumberOfSegments 2") # compute meshes -smesh.Compute(mesh1,ellipse1) -smesh.Compute(mesh2,ellipse2) +mesh1.Compute() +mesh2.Compute() # ---- udate object browser diff --git a/src/SMESH_SWIG/PAL_MESH_043_3D.py b/src/SMESH_SWIG/PAL_MESH_043_3D.py index 6d0993ba6..a79bb8951 100755 --- a/src/SMESH_SWIG/PAL_MESH_043_3D.py +++ b/src/SMESH_SWIG/PAL_MESH_043_3D.py @@ -25,12 +25,8 @@ import salome import geompy -import SMESH -import StdMeshers +import smesh -# get smesh engine -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) # create points to build two circles p1 = geompy.MakeVertex(0, 100, 0) @@ -52,53 +48,39 @@ face = geompy.MakeFace(wire, 1) idcircle = geompy.addToStudy(circle, "Circle") idface = geompy.addToStudy(face, "Circular face") -# get SMESH GUI -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) -# create hypoteses -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg.SetNumberOfSegments(12) -idseg = salome.ObjectToID(hypNbSeg) -smeshgui.SetName(idseg, "NumberOfSegments_10"); -hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hypArea.SetMaxElementArea(30) -idarea = salome.ObjectToID(hypArea) -smeshgui.SetName(idarea, "MaxElementArea_20"); +# init a Mesh with the circular face +mesh1 = smesh.Mesh(face, "Mesh on circular face") -# create algorithmes -algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -idreg = salome.ObjectToID(algoReg) -smeshgui.SetName(idreg, "Regular_1D"); +# set hypotheses and algos to the first mesh +numberOfSegments1 = 12 +algoReg1 = mesh1.Segment() +algoReg1.SetName("Regular_1D") +hypNbSeg1 = algoReg1.NumberOfSegments(numberOfSegments1) +smesh.SetName(hypNbSeg1, "NumberOfSegments_" + str(numberOfSegments1)) -algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") -idmef = salome.ObjectToID(algoMef) -smeshgui.SetName(idmef, "MEFISTO_2D"); +maxElementArea = 30 -# init a Mesh with the circular face -mesh1 = smesh.CreateMesh(face) -idmesh1 = salome.ObjectToID(mesh1) -smeshgui.SetName(idmesh1, "Mesh on circular face"); +algoMef = mesh1.Triangle() +algoMef.SetName("MEFISTO_2D") +hypArea = algoMef.MaxElementArea(maxElementArea) +smesh.SetName(hypArea, "MaxElementArea_" + str(maxElementArea)) -# set hypotheses and algos -mesh1.AddHypothesis(face,algoReg) -mesh1.AddHypothesis(face,hypNbSeg) -mesh1.AddHypothesis(face,algoMef) -mesh1.AddHypothesis(face,hypArea) # init a Mesh with the second circle -mesh2 = smesh.CreateMesh(circle) -idmesh2 = salome.ObjectToID(mesh2) -smeshgui.SetName(idmesh2, "Mesh on circular edge"); +mesh2 = smesh.Mesh(circle, "Mesh on circular edge") + +numberOfSegments2 = 12 +algoReg2 = mesh2.Segment() +algoReg2.SetName("Regular_1D") +hypNbSeg2 = algoReg2.NumberOfSegments(numberOfSegments2) +smesh.SetName(hypNbSeg2, "NumberOfSegments_" + str(numberOfSegments2)) -# set hypotheses and algos -mesh2.AddHypothesis(circle,algoReg) -mesh2.AddHypothesis(circle,hypNbSeg) # compute meshes -smesh.Compute(mesh1,face) -smesh.Compute(mesh2,circle) +mesh1.Compute() +mesh2.Compute() # ---- udate object browser salome.sg.updateObjBrowser(1); diff --git a/src/SMESH_SWIG/SMESH_AdvancedEditor.py b/src/SMESH_SWIG/SMESH_AdvancedEditor.py index 914cd7931..94a8bf9a4 100644 --- a/src/SMESH_SWIG/SMESH_AdvancedEditor.py +++ b/src/SMESH_SWIG/SMESH_AdvancedEditor.py @@ -18,7 +18,6 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # import smesh -import SMESH import math def GetNewNodes(mesh,Elems,OldNodes): @@ -51,45 +50,44 @@ def GetNewNodes(mesh,Elems,OldNodes): # create empty mesh -mesh = smesh.smesh.CreateEmptyMesh() +mesh = smesh.Mesh() -ed = mesh.GetMeshEditor() tol = 0.001 # create a cross from quadrangle faces # 1. create first edge and make extrusion along 0x -n1 = ed.AddNode(55,-5,0) -n2 = ed.AddNode(55,5,0) -e1 = ed.AddEdge([n1,n2]) -dir1 = SMESH.DirStruct(SMESH.PointStruct(-10,0,0)) -ed.ExtrusionSweep([e1],dir1,11) +n1 = mesh.AddNode(55,-5,0) +n2 = mesh.AddNode(55,5,0) +e1 = mesh.AddEdge([n1,n2]) +dir1 = smesh.DirStruct(smesh.PointStruct(-10,0,0)) +mesh.ExtrusionSweep([e1],dir1,11) # 2. create second edge and make extrusion along 0y -n3 = ed.AddNode(-5,-55,0) -n4 = ed.AddNode(5,-55,0) -e2 = ed.AddEdge([n3,n4]) -dir2 = SMESH.DirStruct(SMESH.PointStruct(0,10,0)) -ed.ExtrusionSweep([e2],dir2,11) +n3 = mesh.AddNode(-5,-55,0) +n4 = mesh.AddNode(5,-55,0) +e2 = mesh.AddEdge([n3,n4]) +dir2 = smesh.DirStruct(smesh.PointStruct(0,10,0)) +mesh.ExtrusionSweep([e2],dir2,11) # since result has coincident nodes and faces # we have to make merge -nodes = ed.FindCoincidentNodes(0.001) -ed.MergeNodes(nodes) -ed.MergeEqualElements() +nodes = mesh.FindCoincidentNodes(0.001) +mesh.MergeNodes(nodes) +mesh.MergeEqualElements() # make extrusion faces along 0z -faces = mesh.GetElementsByType(SMESH.FACE) +faces = mesh.GetElementsByType(smesh.FACE) nbf = len(faces) maxang = 2.0 zstep = 5 nbzsteps = 50 -dir3 = SMESH.DirStruct(SMESH.PointStruct(0,0,zstep)) +dir3 = smesh.DirStruct(smesh.PointStruct(0,0,zstep)) newfaces = [] # list for keeping created top faces # during extrusion for i in range(0,nbzsteps): - ed.ExtrusionSweep(faces,dir3,1) + mesh.ExtrusionSweep(faces,dir3,1) # find top faces after each extrusion and keep them - res = ed.GetLastCreatedElems() + res = mesh.GetLastCreatedElems() nbr = len(res) nfaces = [] for j in res: @@ -115,23 +113,23 @@ for i in range(0,nbzsteps): pass # rotate faces from newfaces -axisr1 = SMESH.AxisStruct(0,0,0,0,0,1) +axisr1 = smesh.AxisStruct(0,0,0,0,0,1) for i in range(0,nbzsteps): ang = maxang*(1-math.cos((i+1)*math.pi/nbzsteps)) - ed.Rotate(newfaces[i],axisr1,ang,0) + mesh.Rotate(newfaces[i],axisr1,ang,0) # create circles # create two edges and rotate them for creation # full circle -n5 = ed.AddNode(65,0,0) -n6 = ed.AddNode(67.5,0,0) -n7 = ed.AddNode(70,0,0) -e56 = ed.AddEdge([n5,n6]) -e67 = ed.AddEdge([n6,n7]) -axisr2 = SMESH.AxisStruct(65,0,0,0,1,0) -ed.RotationSweep([e56,e67],axisr2, math.pi/6, 12, tol) -res = ed.GetLastCreatedElems() +n5 = mesh.AddNode(65,0,0) +n6 = mesh.AddNode(67.5,0,0) +n7 = mesh.AddNode(70,0,0) +e56 = mesh.AddEdge([n5,n6]) +e67 = mesh.AddEdge([n6,n7]) +axisr2 = smesh.AxisStruct(65,0,0,0,1,0) +mesh.RotationSweep([e56,e67],axisr2, math.pi/6, 12, tol) +res = mesh.GetLastCreatedElems() faces1 = [] for i in res: nbn = mesh.GetElemNbNodes(i) @@ -141,14 +139,14 @@ nbf1 = len(faces1) # create other two edges and rotate them for creation # other full circle -n8 = ed.AddNode(-65,0,0) -n9 = ed.AddNode(-67.5,0,0) -n10 = ed.AddNode(-70,0,0) -e8 = ed.AddEdge([n8,n9]) -e9 = ed.AddEdge([n9,n10]) -axisr3 = SMESH.AxisStruct(-65,0,0,0,-1,0) -ed.RotationSweep([e8,e9],axisr3, math.pi/6, 12, tol) -res = ed.GetLastCreatedElems() +n8 = mesh.AddNode(-65,0,0) +n9 = mesh.AddNode(-67.5,0,0) +n10 = mesh.AddNode(-70,0,0) +e8 = mesh.AddEdge([n8,n9]) +e9 = mesh.AddEdge([n9,n10]) +axisr3 = smesh.AxisStruct(-65,0,0,0,-1,0) +mesh.RotationSweep([e8,e9],axisr3, math.pi/6, 12, tol) +res = mesh.GetLastCreatedElems() faces2 = [] for i in res: nbn = mesh.GetElemNbNodes(i) @@ -158,8 +156,8 @@ nbf2 = len(faces2) # there are coincident nodes after rotation # therefore we have to merge nodes -nodes = ed.FindCoincidentNodes(0.001) -ed.MergeNodes(nodes) +nodes = mesh.FindCoincidentNodes(0.001) +mesh.MergeNodes(nodes) nbcircs = 2 nbrsteps = 24 @@ -172,8 +170,8 @@ newnodes = GetNewNodes(mesh,faces1,oldnodes) oldnodes = newnodes nodes = [] -ed.RotationSweep(faces1,axisr1, math.pi*2/nbrsteps, nbrs, tol) -res = ed.GetLastCreatedElems() +mesh.RotationSweep(faces1,axisr1, math.pi*2/nbrsteps, nbrs, tol) +res = mesh.GetLastCreatedElems() for i in range(0,nbrs): volumes = [] @@ -181,7 +179,7 @@ for i in range(0,nbrs): newnodes = GetNewNodes(mesh,volumes,oldnodes) for j in newnodes: xyz = mesh.GetNodeXYZ(j) - ed.MoveNode(j,xyz[0],xyz[1],xyz[2]+dz*(i+1)) + mesh.MoveNode(j,xyz[0],xyz[1],xyz[2]+dz*(i+1)) pass oldnodes = newnodes pass @@ -192,8 +190,8 @@ newnodes = GetNewNodes(mesh,faces2,oldnodes) oldnodes = newnodes nodes = [] -ed.RotationSweep(faces2,axisr1, math.pi*2/nbrsteps, nbrs, tol) -res = ed.GetLastCreatedElems() +mesh.RotationSweep(faces2,axisr1, math.pi*2/nbrsteps, nbrs, tol) +res = mesh.GetLastCreatedElems() for i in range(0,nbrs): volumes = [] @@ -201,9 +199,9 @@ for i in range(0,nbrs): newnodes = GetNewNodes(mesh,volumes,oldnodes) for j in newnodes: xyz = mesh.GetNodeXYZ(j) - ed.MoveNode(j,xyz[0],xyz[1],xyz[2]+dz*(i+1)) + mesh.MoveNode(j,xyz[0],xyz[1],xyz[2]+dz*(i+1)) pass oldnodes = newnodes pass - +smesh.salome.sg.updateObjBrowser(1) diff --git a/src/SMESH_SWIG/SMESH_BelongToGeom.py b/src/SMESH_SWIG/SMESH_BelongToGeom.py index 482bd3b56..83bcb6c6f 100644 --- a/src/SMESH_SWIG/SMESH_BelongToGeom.py +++ b/src/SMESH_SWIG/SMESH_BelongToGeom.py @@ -17,10 +17,11 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -import SMESH + from SMESH_test1 import * -def CheckBelongToGeomFilter(theMeshGen, theMesh, theShape, theSubShape, theElemType): +## Old style +def CheckBelongToGeomFilterOld(theMeshGen, theMesh, theShape, theSubShape, theElemType): import geompy if theShape != theSubShape: aName = str(theSubShape) @@ -38,10 +39,27 @@ def CheckBelongToGeomFilter(theMeshGen, theMesh, theShape, theSubShape, theElemT aFilter.SetPredicate(aBelongToGeom) return aFilter.GetElementsId(theMesh) -anElemType = SMESH.ALL; +## Current style +def CheckBelongToGeomFilter(theMesh, theShape, theSubShape, theElemType): + import geompy + import smesh + if theShape != theSubShape: + aName = str(theSubShape) + geompy.addToStudyInFather(theShape,theSubShape,aName) + + theMesh.Compute() + aFilter = smesh.GetFilter(theElemType, smesh.FT_BelongToGeom, theSubShape) + return aFilter.GetElementsId(theMesh.GetMesh()) + + +anElemType = smesh.FACE; print "anElemType =", anElemType -#anIds = CheckBelongToGeomFilter(smesh,mesh,box,subShapeList[1],SMESH.FACE) -anIds = CheckBelongToGeomFilter(smesh,mesh,box,box,SMESH.FACE) +#anIds = CheckBelongToGeomFilter(mesh,box,subShapeList[1],anElemType) +anIds = CheckBelongToGeomFilter(mesh,box,box,anElemType) +print "Number of ids = ", len(anIds) print "anIds = ", anIds +## Check old version +#anIds = CheckBelongToGeomFilterOld(smesh.smesh,mesh.GetMesh(),box,box,anElemType) +#print "anIds = ", anIds salome.sg.updateObjBrowser(1); diff --git a/src/SMESH_SWIG/SMESH_GroupFromGeom.py b/src/SMESH_SWIG/SMESH_GroupFromGeom.py index 0faad0ab0..c387d4469 100644 --- a/src/SMESH_SWIG/SMESH_GroupFromGeom.py +++ b/src/SMESH_SWIG/SMESH_GroupFromGeom.py @@ -23,11 +23,10 @@ # Module : SMESH from SMESH_test1 import * -import SMESH # Compute the mesh created in SMESH_test1 -smesh.Compute(mesh, box) +mesh.Compute() # Create geometry groups on plane: aGeomGroup1 = geompy.CreateGroup(face , geompy.ShapeType["FACE"]) @@ -43,7 +42,7 @@ geompy.AddObject(aGeomGroup2, 10) geompy.addToStudy(aGeomGroup1, "Group on Faces") geompy.addToStudy(aGeomGroup2, "Group on Edges") -aSmeshGroup1 = mesh.CreateGroupFromGEOM(SMESH.FACE, "SMESHGroup1", aGeomGroup1) -aSmeshGroup2 = mesh.CreateGroupFromGEOM(SMESH.EDGE, "SMESHGroup2", aGeomGroup2) +aSmeshGroup1 = mesh.GroupOnGeom(aGeomGroup1, "SMESHGroup1", smesh.FACE) +aSmeshGroup2 = mesh.GroupOnGeom(aGeomGroup2, "SMESHGroup2", smesh.EDGE) salome.sg.updateObjBrowser(1); diff --git a/src/SMESH_SWIG/SMESH_GroupFromGeom2.py b/src/SMESH_SWIG/SMESH_GroupFromGeom2.py index 5364365e3..0e2636149 100755 --- a/src/SMESH_SWIG/SMESH_GroupFromGeom2.py +++ b/src/SMESH_SWIG/SMESH_GroupFromGeom2.py @@ -25,11 +25,11 @@ # Project : PAL/SALOME #============================================================================== from SMESH_test1 import * -import SMESH + # Compute the mesh created in SMESH_test1 -smesh.Compute(mesh, box) +mesh.Compute() # Create geometry groups on plane: aGeomGroup1 = geompy.CreateGroup(face , geompy.ShapeType["FACE"]) @@ -45,11 +45,11 @@ geompy.AddObject(aGeomGroup2, 10) geompy.addToStudy(aGeomGroup1, "Group on Faces") geompy.addToStudy(aGeomGroup2, "Group on Edges") -aSmeshGroup1 = mesh.CreateGroupFromGEOM(SMESH.FACE, "SMESHGroup1", aGeomGroup1) -aSmeshGroup2 = mesh.CreateGroupFromGEOM(SMESH.EDGE, "SMESHGroup2", aGeomGroup2) +aSmeshGroup1 = mesh.GroupOnGeom(aGeomGroup1, "SMESHGroup1", smesh.FACE) +aSmeshGroup2 = mesh.GroupOnGeom(aGeomGroup2, "SMESHGroup2", smesh.EDGE) print "Create aGroupOnShell - a group linked to a shell" -aGroupOnShell = mesh.CreateGroupFromGEOM(SMESH.EDGE, "GroupOnShell", shell) +aGroupOnShell = mesh.GroupOnGeom(shell, "GroupOnShell", smesh.EDGE) print "aGroupOnShell type =", aGroupOnShell.GetType() print "aGroupOnShell size =", aGroupOnShell.Size() print "aGroupOnShell ids :", aGroupOnShell.GetListOfID() @@ -65,7 +65,7 @@ print "aGroupOnShell ids :", aGroupOnShell.GetListOfID() print " " print "Re-compute mesh, contents of aGroupOnShell changes again:" -smesh.Compute(mesh, box) +mesh.Compute() print "aGroupOnShell size =", aGroupOnShell.Size() print "aGroupOnShell ids :", aGroupOnShell.GetListOfID() diff --git a/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py b/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py index a3cf9298c..6f930fa13 100644 --- a/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py +++ b/src/SMESH_SWIG/SMESH_GroupLyingOnGeom.py @@ -17,10 +17,10 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -from smesh import * +import smesh def BuildGroupLyingOn(theMesh, theElemType, theName, theShape): - aFilterMgr = smesh.CreateFilterManager() + aFilterMgr = smesh.smesh.CreateFilterManager() aFilter = aFilterMgr.CreateFilter() aLyingOnGeom = aFilterMgr.CreateLyingOnGeom() @@ -36,7 +36,12 @@ def BuildGroupLyingOn(theMesh, theElemType, theName, theShape): #Example from SMESH_test1 import * -smesh.Compute(mesh, box) -BuildGroupLyingOn(mesh, SMESH.FACE, "Group of faces lying on edge", edge ) +mesh.Compute() + +# First way +BuildGroupLyingOn(mesh.GetMesh(), smesh.FACE, "Group of faces lying on edge #1", edge ) + +# Second way +mesh.MakeGroup("Group of faces lying on edge #2", smesh.FACE, smesh.FT_LyingOnGeom, edge) salome.sg.updateObjBrowser(1); diff --git a/src/SMESH_SWIG/SMESH_Nut.py b/src/SMESH_SWIG/SMESH_Nut.py index 66bbe08bf..f27bfcaf6 100755 --- a/src/SMESH_SWIG/SMESH_Nut.py +++ b/src/SMESH_SWIG/SMESH_Nut.py @@ -24,10 +24,9 @@ import geompy import salome +import smesh import os import math -import StdMeshers -import SMESH #Sketcher_1 creation print "Sketcher creation..." @@ -94,79 +93,43 @@ Cut_1 = geompy.MakeBoolean(Chamfer_2, theShapeForCut, 2) Cut_1_ID = geompy.addToStudy(Cut_1, "Cut_1") #Mesh creation -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") # -- Init -- shape_mesh = salome.IDToObject( Cut_1_ID ) -smesh.SetCurrentStudy(salome.myStudy) -mesh = smesh.CreateMesh(shape_mesh) -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) -idmesh = salome.ObjectToID(mesh) -smeshgui.SetName( idmesh, "Nut" ) + +mesh = smesh.Mesh(shape_mesh, "Nut") #HYPOTHESIS CREATION print "-------------------------- Average length" theAverageLength = 5 -hAvLength = smesh.CreateHypothesis( "LocalLength", "libStdMeshersEngine.so" ) -hAvLength.SetLength( theAverageLength ) +algoReg1D = mesh.Segment() +hAvLength = algoReg1D.LocalLength(theAverageLength) print hAvLength.GetName() print hAvLength.GetId() -smeshgui.SetName(salome.ObjectToID(hAvLength), "AverageLength_5") +print hAvLength.GetLength() +smesh.SetName(hAvLength, "AverageLength_"+str(theAverageLength)) print "-------------------------- MaxElementArea" theMaxElementArea = 20 -hArea20 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) -hArea20.SetMaxElementArea( theMaxElementArea ) -print hArea20.GetName() -print hArea20.GetId() -print hArea20.GetMaxElementArea() -smeshgui.SetName(salome.ObjectToID(hArea20), "MaxElementArea_20") +algoMef = mesh.Triangle(smesh.MEFISTO) +hArea = algoMef.MaxElementArea( theMaxElementArea ) +print hArea.GetName() +print hArea.GetId() +print hArea.GetMaxElementArea() +smesh.SetName(hArea, "MaxElementArea_"+str(theMaxElementArea)) print "-------------------------- MaxElementVolume" theMaxElementVolume = 150 -hVolume150 = smesh.CreateHypothesis( "MaxElementVolume", "libStdMeshersEngine.so" ) -hVolume150.SetMaxElementVolume( theMaxElementVolume ) -print hVolume150.GetName() -print hVolume150.GetId() -print hVolume150.GetMaxElementVolume() -smeshgui.SetName(salome.ObjectToID(hVolume150), "MaxElementVolume_150") - -mesh.AddHypothesis(shape_mesh, hAvLength) -mesh.AddHypothesis(shape_mesh, hArea20) -mesh.AddHypothesis(shape_mesh, hVolume150) - -print "-------------------------- Regular_1D" - -algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" ) -listHyp = algoReg1D.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoReg1D.GetName() -print algoReg1D.GetId() -smeshgui.SetName(salome.ObjectToID(algoReg1D), "Wire discretisation") - -print "-------------------------- MEFISTO_2D" -algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" ) -listHyp = algoMef.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoMef.GetName() -print algoMef.GetId() -smeshgui.SetName(salome.ObjectToID(algoMef), "Triangle (Mefisto)") - -print "-------------------------- NETGEN_3D" - -algoNg = smesh.CreateHypothesis( "NETGEN_3D", "libNETGENEngine.so" ) -print algoNg.GetName() -print algoNg.GetId() -smeshgui.SetName(salome.ObjectToID(algoNg), "Tetrahedron (NETGEN)") -mesh.AddHypothesis(shape_mesh, algoReg1D) -mesh.AddHypothesis(shape_mesh, algoMef) -mesh.AddHypothesis(shape_mesh, algoNg) +algoNg = mesh.Tetrahedron(smesh.NETGEN) +hVolume = algoNg.MaxElementVolume( theMaxElementVolume ) +print hVolume.GetName() +print hVolume.GetId() +print hVolume.GetMaxElementVolume() +smesh.SetName(hVolume, "MaxElementVolume_"+str(theMaxElementVolume)) + print "-------------------------- compute the mesh of the mechanic piece" -smesh.Compute(mesh,shape_mesh) +mesh.Compute() print "Information about the Nut:" print "Number of nodes : ", mesh.NbNodes() diff --git a/src/SMESH_SWIG/SMESH_Partition1_tetra.py b/src/SMESH_SWIG/SMESH_Partition1_tetra.py index 332ca934f..e0f284a96 100644 --- a/src/SMESH_SWIG/SMESH_Partition1_tetra.py +++ b/src/SMESH_SWIG/SMESH_Partition1_tetra.py @@ -26,16 +26,9 @@ import salome import geompy +import smesh from math import sqrt -import StdMeshers -import NETGENPlugin - -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) #--------------------------------------------------------------- @@ -78,7 +71,9 @@ colis_cc_multi = geompy.MultiRotate1D(colis_cc, vz, 4) # -- -alveole = geompy.MakePartition([colis_cc_multi, barier]) +Compound1 = geompy.MakeCompound([colis_cc_multi, barier]) +SubShape_theShape = geompy.SubShapeAll(Compound1,geompy.ShapeType["SOLID"]) +alveole = geompy.MakePartition(SubShape_theShape) print "Analysis of the geometry to mesh (right after the Partition) :" @@ -125,82 +120,48 @@ print " check status ", status # ---- launch SMESH +# ---- init a Mesh with the alveole +shape_mesh = salome.IDToObject( idalveole ) + +mesh = smesh.Mesh(shape_mesh, "MeshAlveole") + print "-------------------------- create Hypothesis (In this case global hypothesis are used)" print "-------------------------- NumberOfSegments" numberOfSegments = 10 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg.SetNumberOfSegments(numberOfSegments) +regular1D = mesh.Segment() +hypNbSeg = regular1D.NumberOfSegments(numberOfSegments) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() - -smeshgui.SetName(salome.ObjectToID(hypNbSeg), "NumberOfSegments_10") +smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegments)) print "-------------------------- MaxElementArea" maxElementArea = 0.1 -hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hypArea.SetMaxElementArea(maxElementArea) +mefisto2D = mesh.Triangle() +hypArea = mefisto2D.MaxElementArea(maxElementArea) print hypArea.GetName() print hypArea.GetId() print hypArea.GetMaxElementArea() - -smeshgui.SetName(salome.ObjectToID(hypArea), "MaxElementArea_0.1") +smesh.SetName(hypArea, "MaxElementArea_" + str(maxElementArea)) print "-------------------------- MaxElementVolume" maxElementVolume = 0.5 -hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so") -hypVolume.SetMaxElementVolume(maxElementVolume) +netgen3D = mesh.Tetrahedron(smesh.NETGEN) +hypVolume = netgen3D.MaxElementVolume(maxElementVolume) print hypVolume.GetName() print hypVolume.GetId() print hypVolume.GetMaxElementVolume() - -smeshgui.SetName(salome.ObjectToID(hypVolume), "MaxElementVolume_0.5") - -print "-------------------------- create Algorithms" - -print "-------------------------- Regular_1D" - -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") - -print "-------------------------- MEFISTO_2D" - -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") - -print "-------------------------- NETGEN_3D" - -netgen3D = smesh.CreateHypothesis("NETGEN_3D", "libNETGENEngine.so") -smeshgui.SetName(salome.ObjectToID(netgen3D), "NETGEN_3D") - -# ---- init a Mesh with the alveole -shape_mesh = salome.IDToObject( idalveole ) - -mesh = smesh.CreateMesh(shape_mesh) -smeshgui.SetName(salome.ObjectToID(mesh), "MeshAlveole") - -# ---- add hypothesis to alveole - -print "-------------------------- add hypothesis to alveole" - -mesh.AddHypothesis(shape_mesh,regular1D) -mesh.AddHypothesis(shape_mesh,hypNbSeg) - -mesh.AddHypothesis(shape_mesh,mefisto2D) -mesh.AddHypothesis(shape_mesh,hypArea) - -mesh.AddHypothesis(shape_mesh,netgen3D) -mesh.AddHypothesis(shape_mesh,hypVolume) +smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume)) print "-------------------------- compute the mesh of alveole " -ret = smesh.Compute(mesh,shape_mesh) +ret = mesh.Compute() if ret != 0: log=mesh.GetLog(0) # no erase trace diff --git a/src/SMESH_SWIG/SMESH_blocks.py b/src/SMESH_SWIG/SMESH_blocks.py index 0b8d46cc2..3160b6cd5 100644 --- a/src/SMESH_SWIG/SMESH_blocks.py +++ b/src/SMESH_SWIG/SMESH_blocks.py @@ -28,16 +28,14 @@ import salome import geompy import math +import smesh import GEOM_Spanner isBlocksTest = 0 # False isMeshTest = 1 # True -hasGUI = 1 # True -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) -GEOM_Spanner.MakeSpanner(salome, geompy, math, isBlocksTest, isMeshTest, smesh, hasGUI) +GEOM_Spanner.MakeSpanner(geompy, math, isBlocksTest, isMeshTest, smesh) salome.sg.updateObjBrowser(1); diff --git a/src/SMESH_SWIG/SMESH_box.py b/src/SMESH_SWIG/SMESH_box.py index d0f490ee9..36af33e29 100755 --- a/src/SMESH_SWIG/SMESH_box.py +++ b/src/SMESH_SWIG/SMESH_box.py @@ -30,63 +30,41 @@ import salome from salome import sg import geompy +import smesh -import StdMeshers # ---- launch GEOM geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM") -meshgenerator = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") ###geom.GetCurrentStudy(salome.myStudy._get_StudyId()) -meshgenerator.SetCurrentStudy(salome.myStudy) # Plate box = geompy.MakeBox(0.,0.,0.,1.,1.,1.) boxId = geompy.addToStudy(box,"box") -# ---- launch SMESH +# ---- SMESH -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) -# meshgenerator=smeshpy.smeshpy() - - -# Hypothesis - -hypL1=meshgenerator.CreateHypothesis("LocalLength","libStdMeshersEngine.so") -hypL1.SetLength(0.25) -hypL1Id = salome.ObjectToID(hypL1) -smeshgui.SetName(hypL1Id, "LocalLength") - -# Algorithm - -alg1D=meshgenerator.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -alg1DId = salome.ObjectToID(alg1D) -smeshgui.SetName(alg1DId, "algo1D") +# ---- init a Mesh -alg2D=meshgenerator.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so") -alg2DId = salome.ObjectToID(alg2D) -smeshgui.SetName(alg2DId, "algo2D") +box_mesh=smesh.Mesh(box, "box_mesh") -alg3D=meshgenerator.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so") -alg3DId = salome.ObjectToID(alg3D) -smeshgui.SetName(alg3DId, "algo3D") - -# ---- init a Mesh +# set Hypothesis and Algorithm -box_mesh=meshgenerator.CreateMesh(box) -box_meshId = salome.ObjectToID(box_mesh) -smeshgui.SetName(box_meshId, "box_mesh") +alg1D = box_mesh.Segment() +alg1D.SetName("algo1D") +hypL1 = alg1D.LocalLength(0.25) +smesh.SetName(hypL1, "LocalLength") + +alg2D = box_mesh.Quadrangle() +alg2D.SetName("algo2D") -# ---- set Hypothesis & Algorithm +alg3D = box_mesh.Hexahedron() +alg3D.SetName("algo3D") -box_mesh.AddHypothesis(box,alg1D) -box_mesh.AddHypothesis(box,alg2D) -box_mesh.AddHypothesis(box,alg3D) -box_mesh.AddHypothesis(box,hypL1) +# compute mesh -meshgenerator.Compute(box_mesh,box) +box_mesh.Compute() sg.updateObjBrowser(1) diff --git a/src/SMESH_SWIG/SMESH_box2_tetra.py b/src/SMESH_SWIG/SMESH_box2_tetra.py index 55a032e4c..e31d0228a 100644 --- a/src/SMESH_SWIG/SMESH_box2_tetra.py +++ b/src/SMESH_SWIG/SMESH_box2_tetra.py @@ -24,14 +24,8 @@ import salome import geompy +import smesh -import StdMeshers -import NETGENPlugin - -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId); # ---- define 2 boxes box1 and box2 @@ -79,90 +73,51 @@ print "number of Edges in shell : ", len(subEdgeList) ### ---------------------------- SMESH -------------------------------------- -# ---- create Hypothesis +# ---- init a Mesh with the shell + +mesh = smesh.Mesh(shell, "MeshBox2") -print "-------------------------- create Hypothesis" + +# ---- set Hypothesis and Algorithm print "-------------------------- NumberOfSegments" numberOfSegments = 10 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg.SetNumberOfSegments(numberOfSegments) - +regular1D = mesh.Segment() +hypNbSeg = regular1D.NumberOfSegments(numberOfSegments) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() - -smeshgui.SetName(salome.ObjectToID(hypNbSeg), "NumberOfSegments_10") +smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegments)) print "-------------------------- MaxElementArea" maxElementArea = 500 -hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hypArea.SetMaxElementArea(maxElementArea) - +mefisto2D = mesh.Triangle() +hypArea = mefisto2D.MaxElementArea(maxElementArea) print hypArea.GetName() print hypArea.GetId() print hypArea.GetMaxElementArea() - -smeshgui.SetName(salome.ObjectToID(hypArea), "MaxElementArea_500") +smesh.SetName(hypArea, "MaxElementArea_" + str(maxElementArea)) print "-------------------------- MaxElementVolume" maxElementVolume = 500 -hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so") -hypVolume.SetMaxElementVolume(maxElementVolume) - +netgen3D = mesh.Tetrahedron(smesh.NETGEN) +hypVolume = netgen3D.MaxElementVolume(maxElementVolume) print hypVolume.GetName() print hypVolume.GetId() print hypVolume.GetMaxElementVolume() +smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume)) -smeshgui.SetName(salome.ObjectToID(hypVolume), "MaxElementVolume_500") - -# ---- create Algorithms - -print "-------------------------- create Algorithms" - -print "-------------------------- Regular_1D" - -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") - -print "-------------------------- MEFISTO_2D" - -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") - -print "-------------------------- NETGEN_3D" - -netgen3D = smesh.CreateHypothesis("NETGEN_3D", "libNETGENEngine.so") -smeshgui.SetName(salome.ObjectToID(netgen3D), "NETGEN_3D") - -# ---- init a Mesh with the shell - -mesh = smesh.CreateMesh(shell) -smeshgui.SetName(salome.ObjectToID(mesh), "MeshBox2") - -# ---- add hypothesis to shell - -print "-------------------------- add hypothesis to shell" - -mesh.AddHypothesis(shell,regular1D) -mesh.AddHypothesis(shell,hypNbSeg) - -mesh.AddHypothesis(shell,mefisto2D) -mesh.AddHypothesis(shell,hypArea) - -mesh.AddHypothesis(shell,netgen3D) -mesh.AddHypothesis(shell,hypVolume) salome.sg.updateObjBrowser(1) print "-------------------------- compute shell" -ret = smesh.Compute(mesh,shell) +ret = mesh.Compute() print ret if ret != 0: log = mesh.GetLog(0) # no erase trace diff --git a/src/SMESH_SWIG/SMESH_box3_tetra.py b/src/SMESH_SWIG/SMESH_box3_tetra.py index 64ea53615..20067045d 100644 --- a/src/SMESH_SWIG/SMESH_box3_tetra.py +++ b/src/SMESH_SWIG/SMESH_box3_tetra.py @@ -25,14 +25,8 @@ import salome import geompy +import smesh -import StdMeshers -import NETGENPlugin - -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId); # ---- define 3 boxes box1, box2 and box3 @@ -90,90 +84,52 @@ print "number of Edges in shell : ", len(subEdgeList) ### ---------------------------- SMESH -------------------------------------- -# ---- create Hypothesis -print "-------------------------- create Hypothesis" +# ---- init a Mesh with the shell + +mesh = smesh.Mesh(shell, "MeshBox3") + + +# ---- set Hypothesis and Algorithm print "-------------------------- NumberOfSegments" numberOfSegments = 10 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg.SetNumberOfSegments(numberOfSegments) - +regular1D = mesh.Segment() +hypNbSeg = regular1D.NumberOfSegments(numberOfSegments) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() - -smeshgui.SetName(salome.ObjectToID(hypNbSeg), "NumberOfSegments_10") +smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegments)) print "-------------------------- MaxElementArea" maxElementArea = 500 -hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hypArea.SetMaxElementArea(maxElementArea) - +mefisto2D = mesh.Triangle() +hypArea = mefisto2D.MaxElementArea(maxElementArea) print hypArea.GetName() print hypArea.GetId() print hypArea.GetMaxElementArea() - -smeshgui.SetName(salome.ObjectToID(hypArea), "MaxElementArea_500") +smesh.SetName(hypArea, "MaxElementArea_" + str(maxElementArea)) print "-------------------------- MaxElementVolume" maxElementVolume = 500 -hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so") -hypVolume.SetMaxElementVolume(maxElementVolume) - +netgen3D = mesh.Tetrahedron(smesh.NETGEN) +hypVolume = netgen3D.MaxElementVolume(maxElementVolume) print hypVolume.GetName() print hypVolume.GetId() print hypVolume.GetMaxElementVolume() +smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume)) -smeshgui.SetName(salome.ObjectToID(hypVolume), "MaxElementVolume_500") - -# ---- create Algorithms - -print "-------------------------- create Algorithms" - -print "-------------------------- Regular_1D" - -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") - -print "-------------------------- MEFISTO_2D" - -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") - -print "-------------------------- NETGEN_3D" - -netgen3D = smesh.CreateHypothesis("NETGEN_3D", "libNETGENEngine.so") -smeshgui.SetName(salome.ObjectToID(netgen3D), "NETGEN_3D") - -# ---- init a Mesh with the shell - -mesh = smesh.CreateMesh(shell) -smeshgui.SetName(salome.ObjectToID(mesh), "MeshBox3") - -# ---- add hypothesis to shell - -print "-------------------------- add hypothesis to shell" - -mesh.AddHypothesis(shell,regular1D) -mesh.AddHypothesis(shell,hypNbSeg) - -mesh.AddHypothesis(shell,mefisto2D) -mesh.AddHypothesis(shell,hypArea) - -mesh.AddHypothesis(shell,netgen3D) -mesh.AddHypothesis(shell,hypVolume) salome.sg.updateObjBrowser(1) print "-------------------------- compute shell" -ret = smesh.Compute(mesh,shell) +ret = mesh.Compute() print ret if ret != 0: log = mesh.GetLog(0) # no erase trace diff --git a/src/SMESH_SWIG/SMESH_box_tetra.py b/src/SMESH_SWIG/SMESH_box_tetra.py index 7a5bc0364..e0354903f 100644 --- a/src/SMESH_SWIG/SMESH_box_tetra.py +++ b/src/SMESH_SWIG/SMESH_box_tetra.py @@ -24,14 +24,8 @@ import salome import geompy +import smesh -import StdMeshers -import NETGENPlugin - -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId); # ---- define a boxe @@ -51,90 +45,48 @@ print "number of Edges in box : ", len(subEdgeList) ### ---------------------------- SMESH -------------------------------------- -# ---- create Hypothesis +# ---- init a Mesh with the boxe -print "-------------------------- create Hypothesis" +mesh = smesh.Mesh(box, "MeshBox") -print "-------------------------- NumberOfSegments" +# ---- set Hypothesis and Algorithm +print "-------------------------- NumberOfSegments" numberOfSegments = 10 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg.SetNumberOfSegments(numberOfSegments) - +regular1D = mesh.Segment() +hypNbSeg = regular1D.NumberOfSegments(numberOfSegments) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() - -smeshgui.SetName(salome.ObjectToID(hypNbSeg), "NumberOfSegments_10") +smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegments)) print "-------------------------- MaxElementArea" maxElementArea = 500 -hypArea = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hypArea.SetMaxElementArea(maxElementArea) - +mefisto2D = mesh.Triangle() +hypArea = mefisto2D.MaxElementArea(maxElementArea) print hypArea.GetName() print hypArea.GetId() print hypArea.GetMaxElementArea() - -smeshgui.SetName(salome.ObjectToID(hypArea), "MaxElementArea_500") +smesh.SetName(hypArea, "MaxElementArea_" + str(maxElementArea)) print "-------------------------- MaxElementVolume" maxElementVolume = 500 -hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so") -hypVolume.SetMaxElementVolume(maxElementVolume) - +netgen3D = mesh.Tetrahedron(smesh.NETGEN) +hypVolume = netgen3D.MaxElementVolume(maxElementVolume) print hypVolume.GetName() print hypVolume.GetId() print hypVolume.GetMaxElementVolume() - -smeshgui.SetName(salome.ObjectToID(hypVolume), "MaxElementVolume_500") - -# ---- create Algorithms - -print "-------------------------- create Algorithms" - -print "-------------------------- Regular_1D" - -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") - -print "-------------------------- MEFISTO_2D" - -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") - -print "-------------------------- NETGEN_3D" - -netgen3D = smesh.CreateHypothesis("NETGEN_3D", "libNETGENEngine.so") -smeshgui.SetName(salome.ObjectToID(netgen3D), "NETGEN_3D") - -# ---- init a Mesh with the boxe - -mesh = smesh.CreateMesh(box) -smeshgui.SetName(salome.ObjectToID(mesh), "MeshBox") - -# ---- add hypothesis to the boxe - -print "-------------------------- add hypothesis to the box" - -mesh.AddHypothesis(box,regular1D) -mesh.AddHypothesis(box,hypNbSeg) - -mesh.AddHypothesis(box,mefisto2D) -mesh.AddHypothesis(box,hypArea) - -mesh.AddHypothesis(box,netgen3D) -mesh.AddHypothesis(box,hypVolume) +smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume)) salome.sg.updateObjBrowser(1) print "-------------------------- compute the mesh of the boxe" -ret = smesh.Compute(mesh,box) +ret = mesh.Compute() print ret if ret != 0: log = mesh.GetLog(0) # no erase trace diff --git a/src/SMESH_SWIG/SMESH_controls.py b/src/SMESH_SWIG/SMESH_controls.py index 9266516c9..065434172 100644 --- a/src/SMESH_SWIG/SMESH_controls.py +++ b/src/SMESH_SWIG/SMESH_controls.py @@ -24,186 +24,107 @@ # Module : SMESH -import SMESH +import smesh import SMESH_mechanic -smesh = SMESH_mechanic.smesh +salome = smesh.salome mesh = SMESH_mechanic.mesh -salome = SMESH_mechanic.salome -aFilterMgr = smesh.CreateFilterManager() +# ---- Criterion : AREA > 100 -# Criterion : AREA > 100 - -aFunctor = aFilterMgr.CreateArea() -aPredicate = aFilterMgr.CreateMoreThan() -aPredicate.SetNumFunctor( aFunctor ) -aPredicate.SetMargin( 100 ) - -aFilter = aFilterMgr.CreateFilter() -aFilter.SetPredicate( aPredicate ) - -anIds = aFilter.GetElementsId( mesh ) +# create group +aGroup = mesh.MakeGroup("Area > 100", smesh.FACE, smesh.FT_Area, smesh.FT_MoreThan, 100) # print result +anIds = aGroup.GetIDs() print "Criterion: Area > 100 Nb = ", len( anIds ) #for i in range( len( anIds ) ): #print anIds[ i ] -# create group -aGroup = mesh.CreateGroup( SMESH.FACE, "Area > 100" ) -aGroup.Add( anIds ) - - -# Criterion : Taper > 3e-15 - -aFunctor = aFilterMgr.CreateTaper() -aPredicate = aFilterMgr.CreateMoreThan() -aPredicate.SetNumFunctor( aFunctor ) -aPredicate.SetMargin( 3e-15 ) -aFilter = aFilterMgr.CreateFilter() -aFilter.SetPredicate( aPredicate ) +# ---- Criterion : Taper > 3e-15 -anIds = aFilter.GetElementsId( mesh ) +# create group +aGroup = mesh.MakeGroup("Taper > 3e-15", smesh.FACE, smesh.FT_Taper, smesh.FT_MoreThan, 3e-15) # print result +anIds = aGroup.GetIDs() print "Criterion: Taper > 3e-15 Nb = ", len( anIds ) #for i in range( len( anIds ) ): #print anIds[ i ] -# create group -aGroup = mesh.CreateGroup( SMESH.FACE, "Taper > 3e-15" ) -aGroup.Add( anIds ) +# ---- Criterion : ASPECT RATIO > 1.3 -# Criterion : ASPECT RATIO > 1.3 - -aFunctor = aFilterMgr.CreateAspectRatio() -aPredicate = aFilterMgr.CreateMoreThan() -aPredicate.SetNumFunctor( aFunctor ) -aPredicate.SetMargin( 1.3 ) - -aFilter = aFilterMgr.CreateFilter() -aFilter.SetPredicate( aPredicate ) - -anIds = aFilter.GetElementsId( mesh ) +# create group +aGroup = mesh.MakeGroup("Aspect Ratio > 1.3", smesh.FACE, smesh.FT_AspectRatio, smesh.FT_MoreThan, 1.3) # print result +anIds = aGroup.GetIDs() print "Criterion: Aspect Ratio > 1.3 Nb = ", len( anIds ) #for i in range( len( anIds ) ): #print anIds[ i ] -# create group -aGroup = mesh.CreateGroup( SMESH.FACE, "Aspect Ratio > 1.3" ) -aGroup.Add( anIds ) +# ---- Criterion : MINIMUM ANGLE < 30 -# Criterion : MINIMUM ANGLE < 30 - -aFunctor = aFilterMgr.CreateMinimumAngle() -aPredicate = aFilterMgr.CreateLessThan() -aPredicate.SetNumFunctor( aFunctor ) -aPredicate.SetMargin( 30 ) - -aFilter = aFilterMgr.CreateFilter() -aFilter.SetPredicate( aPredicate ) - -anIds = aFilter.GetElementsId( mesh ) +# create group +aGroup = mesh.MakeGroup("Minimum Angle < 30", smesh.FACE, smesh.FT_MinimumAngle, smesh.FT_LessThan, 30) # print result +anIds = aGroup.GetIDs() print "Criterion: Minimum Angle < 30 Nb = ", len( anIds ) #for i in range( len( anIds ) ): #print anIds[ i ] -# create group -aGroup = mesh.CreateGroup( SMESH.FACE, "Minimum Angle < 30" ) -aGroup.Add( anIds ) - -# Criterion : Warp > 2e-13 - -aFunctor = aFilterMgr.CreateWarping() -aPredicate = aFilterMgr.CreateMoreThan() -aPredicate.SetNumFunctor( aFunctor ) -aPredicate.SetMargin( 2e-13 ) -aFilter = aFilterMgr.CreateFilter() -aFilter.SetPredicate( aPredicate ) +# ---- Criterion : Warp > 2e-13 -anIds = aFilter.GetElementsId( mesh ) +# create group +aGroup = mesh.MakeGroup("Warp > 2e-13", smesh.FACE, smesh.FT_Warping, smesh.FT_MoreThan, 2e-13 ) # print result +anIds = aGroup.GetIDs() print "Criterion: Warp > 2e-13 Nb = ", len( anIds ) #for i in range( len( anIds ) ): #print anIds[ i ] -# create group -aGroup = mesh.CreateGroup( SMESH.FACE, "Warp > 2e-13" ) -aGroup.Add( anIds ) -# Criterion : Skew > 18 +# ---- Criterion : Skew > 18 -aFunctor = aFilterMgr.CreateSkew() -aPredicate = aFilterMgr.CreateMoreThan() -aPredicate.SetNumFunctor( aFunctor ) -aPredicate.SetMargin( 18 ) - -aFilter = aFilterMgr.CreateFilter() -aFilter.SetPredicate( aPredicate ) - -anIds = aFilter.GetElementsId( mesh ) +# create group +aGroup = mesh.MakeGroup("Skew > 18", smesh.FACE, smesh.FT_Skew, smesh.FT_MoreThan, 18 ) # print result +anIds = aGroup.GetIDs() print "Criterion: Skew > 18 Nb = ", len( anIds ) #for i in range( len( anIds ) ): #print anIds[ i ] -# create group -aGroup = mesh.CreateGroup( SMESH.FACE, "Skew > 18" ) -aGroup.Add( anIds ) # Criterion : Length > 10 -aFunctor = aFilterMgr.CreateLength() -aPredicate = aFilterMgr.CreateMoreThan() -aPredicate.SetNumFunctor( aFunctor ) -aPredicate.SetMargin( 10 ) - -aFilter = aFilterMgr.CreateFilter() -aFilter.SetPredicate( aPredicate ) - -anIds = aFilter.GetElementsId( mesh ) +# create group +aGroup = mesh.MakeGroup("Length > 10", smesh.FACE, smesh.FT_Length, smesh.FT_MoreThan, 10 ) # print result +anIds = aGroup.GetIDs() print "Criterion: Length > 10 Nb = ", len( anIds ) #for i in range( len( anIds ) ): #print anIds[ i ] -# create group -aGroup = mesh.CreateGroup( SMESH.EDGE, "Length > 10" ) -aGroup.Add( anIds ) # Criterion : Borders at multi-connections = 2 -aFunctor = aFilterMgr.CreateMultiConnection() -aPredicate = aFilterMgr.CreateEqualTo() -aPredicate.SetNumFunctor( aFunctor ) -aPredicate.SetMargin( 2 ) - -aFilter = aFilterMgr.CreateFilter() -aFilter.SetPredicate( aPredicate ) - -anIds = aFilter.GetElementsId( mesh ) +# create group +aGroup = mesh.MakeGroup("Borders at multi-connections = 2", smesh.EDGE, smesh.FT_MultiConnection, smesh.FT_EqualTo, 2) # print result +anIds = aGroup.GetIDs() print "Criterion: Borders at multi-connections = 2 Nb = ", len( anIds ) #for i in range( len( anIds ) ): #print anIds[ i ] -# create group -aGroup = mesh.CreateGroup( SMESH.EDGE, "Borders at multi-connections = 2" ) -aGroup.Add( anIds ) - salome.sg.updateObjBrowser(1) diff --git a/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py b/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py index 2ef0ba6c7..c985eb703 100755 --- a/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py +++ b/src/SMESH_SWIG/SMESH_demo_hexa2_upd.py @@ -31,18 +31,11 @@ import salome import geompy - -import StdMeshers -import NETGENPlugin - -geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM") -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId); +import smesh import math + # ----------------------------------------------------------------------------- ShapeTypeShell = 3 @@ -130,86 +123,54 @@ for i in range(8): ### ---------------------------- SMESH -------------------------------------- -# ---- create Hypothesis +# ---- init a Mesh with the volume + +mesh = smesh.Mesh(vol, "meshVolume") -print "-------------------------- create Hypothesis" +# ---- set Hypothesis and Algorithm to main shape print "-------------------------- NumberOfSegments the global one" numberOfSegments = 10 -hypNbSeg=smesh.CreateHypothesis("NumberOfSegments","libStdMeshersEngine.so") -hypNbSeg.SetNumberOfSegments(numberOfSegments) -hypNbSegID = hypNbSeg.GetId() +regular1D = mesh.Segment() +regular1D.SetName("Wire Discretisation") +hypNbSeg = regular1D.NumberOfSegments(numberOfSegments) print hypNbSeg.GetName() -print hypNbSegID +print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() +smesh.SetName(hypNbSeg, "NumberOfSegments") -smeshgui.SetName(salome.ObjectToID(hypNbSeg), "NumberOfSegments") - -print "-------------------------- NumberOfSegments in the Z direction" - -numberOfSegmentsZ = 40 - -hypNbSegZ=smesh.CreateHypothesis("NumberOfSegments","libStdMeshersEngine.so") -hypNbSegZ.SetNumberOfSegments(numberOfSegmentsZ) -hypNbSegZID = hypNbSegZ.GetId() -print hypNbSegZ.GetName() -print hypNbSegZID -print hypNbSegZ.GetNumberOfSegments() - -smeshgui.SetName(salome.ObjectToID(hypNbSegZ), "NumberOfSegmentsZ") - -# ---- create Algorithms - -print "-------------------------- create Algorithms" - -print "-------------------------- Regular_1D" - -regular1D=smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") print "-------------------------- Quadrangle_2D" -quad2D=smesh.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(quad2D), "Quadrangle_2D") +quad2D=mesh.Quadrangle() +quad2D.SetName("Quadrangle_2D") print "-------------------------- Hexa_3D" -hexa3D=smesh.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(hexa3D), "Hexa_3D") +hexa3D=mesh.Hexahedron() +hexa3D.SetName("Hexa_3D") -# ---- init a Mesh with the volume -mesh = smesh.CreateMesh(vol) -smeshgui.SetName(salome.ObjectToID(mesh), "meshVolume") - -# ---- add hypothesis to the volume - -print "-------------------------- add hypothesis to the volume" +print "-------------------------- NumberOfSegments in the Z direction" -ret=mesh.AddHypothesis(vol,regular1D) -print ret -ret=mesh.AddHypothesis(vol,hypNbSeg) -print ret -ret=mesh.AddHypothesis(vol,quad2D) -print ret -ret=mesh.AddHypothesis(vol,hexa3D) -print ret +numberOfSegmentsZ = 40 for i in range(8): print "-------------------------- add hypothesis to edge in the Z directions", (i+1) - subMeshEdgeZ = mesh.GetSubMesh(edgeZ[i],"SubMeshEdgeZ_"+str(i+1)) - - retZ = mesh.AddHypothesis(edgeZ[i],hypNbSegZ) - print " add hyp Z ", retZ + algo = mesh.Segment(edgeZ[i]) + hyp = algo.NumberOfSegments(numberOfSegmentsZ) + smesh.SetName(hyp, "NumberOfSegmentsZ") + smesh.SetName(algo.GetSubMesh(), "SubMeshEdgeZ_"+str(i+1)) + salome.sg.updateObjBrowser(1) print "-------------------------- compute the mesh of the volume" -ret=smesh.Compute(mesh,vol) +ret=mesh.Compute() print ret if ret != 0: diff --git a/src/SMESH_SWIG/SMESH_fixation_hexa.py b/src/SMESH_SWIG/SMESH_fixation_hexa.py index 6514f5054..bc5ff8f86 100644 --- a/src/SMESH_SWIG/SMESH_fixation_hexa.py +++ b/src/SMESH_SWIG/SMESH_fixation_hexa.py @@ -24,8 +24,7 @@ # import SMESH_fixation - -import StdMeshers +import smesh compshell = SMESH_fixation.compshell idcomp = SMESH_fixation.idcomp @@ -45,65 +44,42 @@ status = geompy.CheckShape(compshell) print " check status ", status ### ---------------------------- SMESH -------------------------------------- -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) +# ---- init a Mesh with the compshell +shape_mesh = salome.IDToObject( idcomp ) + +mesh = smesh.Mesh(shape_mesh, "MeshCompShell") + -print "-------------------------- create Hypothesis" +# ---- set Hypothesis and Algorithm print "-------------------------- NumberOfSegments" numberOfSegments = 5 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg.SetNumberOfSegments(numberOfSegments) - +regular1D = mesh.Segment() +regular1D.SetName("Wire Discretisation") +hypNbSeg = regular1D.NumberOfSegments(numberOfSegments) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() - -smeshgui.SetName(salome.ObjectToID(hypNbSeg), "NumberOfSegments_5") - -print "-------------------------- create Algorithms" - -print "-------------------------- Regular_1D" - -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") - -smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") +smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegments)) print "-------------------------- Quadrangle_2D" -quad2D = smesh.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so") - -smeshgui.SetName(salome.ObjectToID(quad2D), "Quadrangle_2D") +quad2D = mesh.Quadrangle() +quad2D.SetName("Quadrangle_2D") print "-------------------------- Hexa_3D" -hexa3D = smesh.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so") - -smeshgui.SetName(salome.ObjectToID(hexa3D), "Hexa_3D") - -# ---- init a Mesh with the compshell -shape_mesh = salome.IDToObject( idcomp ) - -mesh = smesh.CreateMesh(shape_mesh) -smeshgui.SetName(salome.ObjectToID(mesh), "MeshCompShell") - - -print "-------------------------- add hypothesis to compshell" - -mesh.AddHypothesis(shape_mesh,regular1D) -mesh.AddHypothesis(shape_mesh,hypNbSeg) +hexa3D = mesh.Hexahedron() +hexa3D.SetName("Hexa_3D") -mesh.AddHypothesis(shape_mesh,quad2D) -mesh.AddHypothesis(shape_mesh,hexa3D) salome.sg.updateObjBrowser(1) print "-------------------------- compute compshell" -ret = smesh.Compute(mesh, shape_mesh) +ret = mesh.Compute() print ret if ret != 0: log = mesh.GetLog(0) # no erase trace diff --git a/src/SMESH_SWIG/SMESH_fixation_netgen.py b/src/SMESH_SWIG/SMESH_fixation_netgen.py index 31114905c..585f431d2 100644 --- a/src/SMESH_SWIG/SMESH_fixation_netgen.py +++ b/src/SMESH_SWIG/SMESH_fixation_netgen.py @@ -23,8 +23,6 @@ # The new Netgen algorithm is used that discretizes baoundaries itself # -import StdMeshers -import NETGENPlugin import SMESH_fixation import smesh @@ -50,12 +48,11 @@ print " check status ", status print "-------------------------- create Mesh, algorithm, hypothesis" mesh = smesh.Mesh(compshell, "MeshcompShel"); -netgen = mesh.Netgen(1) -hyp = netgen.Parameters() -hyp.SetMaxSize( 50 ) -#hyp.SetSecondOrder( 0 ) -hyp.SetFineness( 3 ) -#hyp.SetOptimize( 1 ) +netgen = mesh.Tetrahedron(smesh.FULL_NETGEN) +netgen.SetMaxSize( 50 ) +#netgen.SetSecondOrder( 0 ) +netgen.SetFineness( smesh.Fine ) +#netgen.SetOptimize( 1 ) salome.sg.updateObjBrowser(1) diff --git a/src/SMESH_SWIG/SMESH_fixation_tetra.py b/src/SMESH_SWIG/SMESH_fixation_tetra.py index 712c908e2..2c794d90e 100644 --- a/src/SMESH_SWIG/SMESH_fixation_tetra.py +++ b/src/SMESH_SWIG/SMESH_fixation_tetra.py @@ -23,9 +23,8 @@ # Hypothesis and algorithms for the mesh generation are global # -import StdMeshers -import NETGENPlugin import SMESH_fixation +import smesh compshell = SMESH_fixation.compshell idcomp = SMESH_fixation.idcomp @@ -45,94 +44,65 @@ status = geompy.CheckShape(compshell) print " check status ", status ### ---------------------------- SMESH -------------------------------------- -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) +# ---- init a Mesh with the compshell + +mesh = smesh.Mesh(compshell, "MeshcompShell") + -print "-------------------------- create Hypothesis" +# ---- set Hypothesis and Algorithm print "-------------------------- NumberOfSegments" numberOfSegments = 5 -hypNbSeg = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg.SetNumberOfSegments(numberOfSegments) - +regular1D = mesh.Segment() +regular1D.SetName("Wire Discretisation") +hypNbSeg = regular1D.NumberOfSegments(numberOfSegments) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() +smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegments)) -smeshgui.SetName(salome.ObjectToID(hypNbSeg), "NumberOfSegments_5") - -print "-------------------------- MaxElementArea" +## print "-------------------------- MaxElementArea" ## maxElementArea = 80 -## hypArea=smesh.CreateHypothesis("MaxElementArea") -## hypArea.SetMaxElementArea(maxElementArea) +## mefisto2D = mesh.Triangle() +## mefisto2D.SetName("MEFISTO_2D") +## hypArea = mefisto2D.MaxElementArea(maxElementArea) ## print hypArea.GetName() ## print hypArea.GetId() ## print hypArea.GetMaxElementArea() -## smeshgui.SetName(salome.ObjectToID(hypArea), "MaxElementArea_160") +## smesh.SetName(hypArea, "MaxElementArea_" + str(maxElementArea)) + +print "-------------------------- LengthFromEdges" -hypLengthFromEdges = smesh.CreateHypothesis("LengthFromEdges", "libStdMeshersEngine.so") -smeshgui.SetName(salome.ObjectToID(hypLengthFromEdges), "LengthFromEdges") +mefisto2D = mesh.Triangle() +mefisto2D.SetName("MEFISTO_2D") +hypLengthFromEdges = mefisto2D.LengthFromEdges() +print hypLengthFromEdges.GetName() +print hypLengthFromEdges.GetId() +smesh.SetName(hypLengthFromEdges, "LengthFromEdges") print "-------------------------- MaxElementVolume" maxElementVolume = 1000 -hypVolume = smesh.CreateHypothesis("MaxElementVolume", "libStdMeshersEngine.so") -hypVolume.SetMaxElementVolume(maxElementVolume) - +netgen3D = mesh.Tetrahedron(smesh.NETGEN) +netgen3D.SetName("NETGEN_3D") +hypVolume = netgen3D.MaxElementVolume(maxElementVolume) print hypVolume.GetName() print hypVolume.GetId() print hypVolume.GetMaxElementVolume() +smesh.SetName(hypVolume, "MaxElementVolume_" + str(maxElementVolume)) -smeshgui.SetName(salome.ObjectToID(hypVolume), "MaxElementVolume_1000") - -print "-------------------------- create Algorithms" - -print "-------------------------- Regular_1D" - -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") - -smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") - -print "-------------------------- MEFISTO_2D" - -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") - -smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") - -print "-------------------------- NETGEN_3D" - -netgen3D = smesh.CreateHypothesis("NETGEN_3D", "libNETGENEngine.so") - -smeshgui.SetName(salome.ObjectToID(netgen3D), "NETGEN_3D") - -# ---- init a Mesh with the compshell - -mesh = smesh.CreateMesh(compshell) -smeshgui.SetName(salome.ObjectToID(mesh), "MeshcompShel") - -print "-------------------------- add hypothesis to compshell" - -mesh.AddHypothesis(compshell,regular1D) -mesh.AddHypothesis(compshell,hypNbSeg) - -mesh.AddHypothesis(compshell,mefisto2D) -mesh.AddHypothesis(compshell,hypLengthFromEdges) - -mesh.AddHypothesis(compshell,netgen3D) -mesh.AddHypothesis(compshell,hypVolume) salome.sg.updateObjBrowser(1) print "-------------------------- compute compshell" -ret = smesh.Compute(mesh,compshell) +ret = mesh.Compute(mesh) print ret if ret != 0: log = mesh.GetLog(0) # no erase trace diff --git a/src/SMESH_SWIG/SMESH_flight_skin.py b/src/SMESH_SWIG/SMESH_flight_skin.py index 9bcb944a4..e56dd45fe 100644 --- a/src/SMESH_SWIG/SMESH_flight_skin.py +++ b/src/SMESH_SWIG/SMESH_flight_skin.py @@ -26,12 +26,7 @@ import os import salome import geompy -import StdMeshers - -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) +import smesh # ---------------------------- GEOM -------------------------------------- @@ -61,64 +56,39 @@ print "number of Edges in flight : ", len(subEdgeList) ### ---------------------------- SMESH -------------------------------------- -print "-------------------------- create Hypothesis" +# ---- init a Mesh with the shell +shape_mesh = salome.IDToObject( idShape ) + +mesh = smesh.Mesh(shape_mesh, "MeshFlight") + + +# ---- set Hypothesis and Algorithm print "-------------------------- LocalLength" lengthOfSegments = 0.3 -hypLength = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so") -hypLength.SetLength(lengthOfSegments) - +regular1D = mesh.Segment() +hypLength = regular1D.LocalLength(lengthOfSegments) print hypLength.GetName() print hypLength.GetId() print hypLength.GetLength() - -smeshgui.SetName(salome.ObjectToID(hypLength), "LocalLength_0.3") +smesh.SetName(hypLength, "LocalLength_" + str(lengthOfSegments)) print "-------------------------- LengthFromEdges" -hypLengthFromEdge = smesh.CreateHypothesis("LengthFromEdges", "libStdMeshersEngine.so") - +mefisto2D = mesh.Triangle() +hypLengthFromEdge = mefisto2D.LengthFromEdges() print hypLengthFromEdge.GetName() print hypLengthFromEdge.GetId() +smesh.SetName(hypLengthFromEdge,"LengthFromEdge") -smeshgui.SetName(salome.ObjectToID(hypLengthFromEdge), "LengthFromEdge") - -print "-------------------------- create Algorithms" - -print "-------------------------- Regular_1D" - -regular1D = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") - -smeshgui.SetName(salome.ObjectToID(regular1D), "Wire Discretisation") - -print "-------------------------- MEFISTO_2D" - -mefisto2D = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") - -smeshgui.SetName(salome.ObjectToID(mefisto2D), "MEFISTO_2D") - -# ---- init a Mesh with the shell -shape_mesh = salome.IDToObject( idShape ) - -mesh = smesh.CreateMesh(shape_mesh) -smeshgui.SetName(salome.ObjectToID(mesh), "MeshFlight") - -# ---- add hypothesis to flight - -print "-------------------------- add hypothesis to flight" - -mesh.AddHypothesis(shape_mesh,regular1D) -mesh.AddHypothesis(shape_mesh,hypLength) -mesh.AddHypothesis(shape_mesh,mefisto2D) -mesh.AddHypothesis(shape_mesh,hypLengthFromEdge) salome.sg.updateObjBrowser(1) print "-------------------------- compute the skin flight" -ret = smesh.Compute(mesh,shape_mesh) +ret = mesh.Compute() print ret if ret != 0: log = mesh.GetLog(0) # no erase trace diff --git a/src/SMESH_SWIG/SMESH_freebord.py b/src/SMESH_SWIG/SMESH_freebord.py index 373ba58e0..081910cfa 100644 --- a/src/SMESH_SWIG/SMESH_freebord.py +++ b/src/SMESH_SWIG/SMESH_freebord.py @@ -17,69 +17,51 @@ # # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -import salome -import geompy -import SMESH -import StdMeshers - -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) - -# Create box without one plane - -box = geompy.MakeBox(0., 0., 0., 10., 20., 30.) -subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"]) - -FaceList = [] -for i in range( 5 ): - FaceList.append( subShapeList[ i ] ) - -aComp = geompy.MakeCompound( FaceList ) -aBox = geompy.Sew( aComp, 1. ) -idbox = geompy.addToStudy( aBox, "box" ) - -aBox = salome.IDToObject( idbox ) - -# Create mesh - -hyp1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hyp1.SetNumberOfSegments(5) -hyp2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hyp2.SetMaxElementArea(20) -hyp3 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hyp3.SetMaxElementArea(50) - -algo1 = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -algo2 = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") - -mesh = smesh.CreateMesh(aBox) -mesh.AddHypothesis(aBox,hyp1) -mesh.AddHypothesis(aBox,hyp2) -mesh.AddHypothesis(aBox,algo1) -mesh.AddHypothesis(aBox,algo2) - -smesh.Compute(mesh,aBox) - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId); -smeshgui.SetName( salome.ObjectToID( mesh ), "Mesh_freebord" ); - -# Criterion : Free edges -aFilterMgr = smesh.CreateFilterManager() -aPredicate = aFilterMgr.CreateFreeBorders() -aFilter = aFilterMgr.CreateFilter() -aFilter.SetPredicate( aPredicate ) - -anIds = aFilter.GetElementsId( mesh ) - -# print result -print "Criterion: Free edges Nb = ", len( anIds ) -for i in range( len( anIds ) ): - print anIds[ i ] - -# create group -aGroup = mesh.CreateGroup( SMESH.EDGE, "Free edges" ) -aGroup.Add( anIds ) - - -salome.sg.updateObjBrowser(1) +import salome +import geompy +import smesh + + +# Create box without one plane + +box = geompy.MakeBox(0., 0., 0., 10., 20., 30.) +subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"]) + +FaceList = [] +for i in range( 5 ): + FaceList.append( subShapeList[ i ] ) + +aComp = geompy.MakeCompound( FaceList ) +aBox = geompy.Sew( aComp, 1. ) +idbox = geompy.addToStudy( aBox, "box" ) + +aBox = salome.IDToObject( idbox ) + +# Create mesh + +mesh = smesh.Mesh(aBox, "Mesh_freebord") + +algoReg = mesh.Segment() +hypNbSeg = algoReg.NumberOfSegments(5) + +algoMef = mesh.Triangle() +hypArea = algoMef.MaxElementArea(20) + + +mesh.Compute() + + +# Criterion : Free edges. Create group. + +aCriterion = smesh.GetCriterion(smesh.EDGE, smesh.FT_FreeEdges) + +aGroup = mesh.MakeGroupByCriterion("Free edges", aCriterion) + +anIds = aGroup.GetIDs() + +# print result +print "Criterion: Free edges Nb = ", len( anIds ) +for i in range( len( anIds ) ): + print anIds[ i ] + +salome.sg.updateObjBrowser(1) diff --git a/src/SMESH_SWIG/SMESH_hexaedre.py b/src/SMESH_SWIG/SMESH_hexaedre.py index 0a058a2a0..cef7a6bc6 100755 --- a/src/SMESH_SWIG/SMESH_hexaedre.py +++ b/src/SMESH_SWIG/SMESH_hexaedre.py @@ -26,9 +26,8 @@ #============================================================================== import salome -from salome import sg - import geompy +import smesh import math @@ -37,7 +36,6 @@ import math geom = salome.lcc.FindOrLoadComponent("FactoryServer", "GEOM") myBuilder = salome.myStudy.NewBuilder() gg = salome.ImportComponentGUI("GEOM") -from salome import sg ShapeTypeCompSolid = 1 ShapeTypeSolid = 2 @@ -95,72 +93,67 @@ salome.sg.updateObjBrowser(1) print "-------------------------- mesh" -import SMESH -import StdMeshers -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) - -# ---- create Hypothesis -print "-------------------------- create Hypothesis" -numberOfSegments = 4 -hypNbSegA=smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSegA.SetNumberOfSegments(numberOfSegments) -numberOfSegments = 10 -hypNbSegB=smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSegB.SetNumberOfSegments(numberOfSegments) -numberOfSegments = 15 -hypNbSegC=smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSegC.SetNumberOfSegments(numberOfSegments) - -# ---- create Algorithms -print "-------------------------- create Algorithms" -regular1D=smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -quad2D=smesh.CreateHypothesis("Quadrangle_2D", "libStdMeshersEngine.so") -hexa3D=smesh.CreateHypothesis("Hexa_3D", "libStdMeshersEngine.so") - # ---- init a Mesh with the geom shape shape_mesh = blob -myMesh=smesh.CreateMesh(shape_mesh) +mesh=smesh.Mesh(shape_mesh, "MeshBlob") # ---- add hypothesis and algorithms to mesh print "-------------------------- add hypothesis to mesh" -myMesh.AddHypothesis(shape_mesh,regular1D) -myMesh.AddHypothesis(shape_mesh,quad2D) -myMesh.AddHypothesis(shape_mesh,hexa3D) +algo1 = mesh.Segment() +algo2 = mesh.Quadrangle() +algo3 = mesh.Hexahedron() + +numberOfSegmentsA = 4 + +algo = mesh.Segment(aretes[0]) +algo.NumberOfSegments(numberOfSegmentsA) +algo = mesh.Segment(aretes[2]) +algo.NumberOfSegments(numberOfSegmentsA) +algo = mesh.Segment(aretes[8]) +algo.NumberOfSegments(numberOfSegmentsA) +algo = mesh.Segment(aretes[10]) +algo.NumberOfSegments(numberOfSegmentsA) + + +numberOfSegmentsC = 15 -#myMesh.AddHypothesis(shape_mesh,hypNbSeg) +algo = mesh.Segment(aretes[1]) +algo.NumberOfSegments(numberOfSegmentsC) +algo = mesh.Segment(aretes[3]) +algo.NumberOfSegments(numberOfSegmentsC) +algo = mesh.Segment(aretes[9]) +algo.NumberOfSegments(numberOfSegmentsC) +algo = mesh.Segment(aretes[11]) +algo.NumberOfSegments(numberOfSegmentsC) -myMesh.AddHypothesis(aretes[0],hypNbSegA) -myMesh.AddHypothesis(aretes[2],hypNbSegA) -myMesh.AddHypothesis(aretes[8],hypNbSegA) -myMesh.AddHypothesis(aretes[10],hypNbSegA) -myMesh.AddHypothesis(aretes[1],hypNbSegC) -myMesh.AddHypothesis(aretes[3],hypNbSegC) -myMesh.AddHypothesis(aretes[9],hypNbSegC) -myMesh.AddHypothesis(aretes[11],hypNbSegC) +numberOfSegmentsB = 10 +algo = mesh.Segment(aretes[4]) +algo.NumberOfSegments(numberOfSegmentsB) +algo = mesh.Segment(aretes[5]) +algo.NumberOfSegments(numberOfSegmentsB) +algo = mesh.Segment(aretes[6]) +algo.NumberOfSegments(numberOfSegmentsB) +algo = mesh.Segment(aretes[7]) +algo.NumberOfSegments(numberOfSegmentsB) -myMesh.AddHypothesis(aretes[4],hypNbSegB) -myMesh.AddHypothesis(aretes[5],hypNbSegB) -myMesh.AddHypothesis(aretes[6],hypNbSegB) -myMesh.AddHypothesis(aretes[7],hypNbSegB) # ---- compute mesh print "-------------------------- compute mesh" -ret=smesh.Compute(myMesh, shape_mesh) +ret=mesh.Compute() print ret if ret != 0: - #log=myMesh.GetLog(0) # no erase trace + #log=mesh.GetLog(0) # no erase trace #for linelog in log: # print linelog print "Information about the Mesh:" - print "Number of nodes : ", myMesh.NbNodes() - print "Number of edges : ", myMesh.NbEdges() - print "Number of faces : ", myMesh.NbFaces() - print "Number of quadrangles : ", myMesh.NbQuadrangles() - print "Number of volumes : ", myMesh.NbVolumes() - print "Number of hexahedrons : ", myMesh.NbHexas() + print "Number of nodes : ", mesh.NbNodes() + print "Number of edges : ", mesh.NbEdges() + print "Number of faces : ", mesh.NbFaces() + print "Number of quadrangles : ", mesh.NbQuadrangles() + print "Number of volumes : ", mesh.NbVolumes() + print "Number of hexahedrons : ", mesh.NbHexas() else: print "problem when Computing the mesh" diff --git a/src/SMESH_SWIG/SMESH_mechanic.py b/src/SMESH_SWIG/SMESH_mechanic.py index 6170b51ff..4891f5652 100644 --- a/src/SMESH_SWIG/SMESH_mechanic.py +++ b/src/SMESH_SWIG/SMESH_mechanic.py @@ -28,6 +28,7 @@ import salome import geompy +import smesh import StdMeshers @@ -120,130 +121,55 @@ Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name ) # ---------------------------- SMESH -------------------------------------- -# ---- launch SMESH, init a Mesh with shape 'mechanic' - -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") - # -- Init -- shape_mesh = salome.IDToObject( Id_mechanic ) -smesh.SetCurrentStudy(salome.myStudy) - -mesh = smesh.CreateMesh(shape_mesh) - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) -idmesh = salome.ObjectToID(mesh) -smeshgui.SetName( idmesh, "Mesh_mechanic" ) +mesh = smesh.Mesh(shape_mesh, "Mesh_mechanic") print "-------------------------- NumberOfSegments" numberOfSegment = 10 -hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" ) -hypNbSeg.SetNumberOfSegments( numberOfSegment ) +algo = mesh.Segment() +hypNbSeg = algo.NumberOfSegments(numberOfSegment) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() - -smeshgui.SetName(salome.ObjectToID(hypNbSeg), "NumberOfSegments_10") +smesh.SetName(hypNbSeg, "NumberOfSegments_10") print "-------------------------- MaxElementArea" maxElementArea = 25 -hypArea25 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) -hypArea25.SetMaxElementArea( maxElementArea ) +algo = mesh.Triangle() +hypArea25 = algo.MaxElementArea(maxElementArea) print hypArea25.GetName() print hypArea25.GetId() print hypArea25.GetMaxElementArea() +smesh.SetName(hypArea25, "MaxElementArea_25") -smeshgui.SetName(salome.ObjectToID(hypArea25), "MaxElementArea_25") - -print "-------------------------- MaxElementArea" - -maxElementArea = 35 - -hypArea35 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) -hypArea35.SetMaxElementArea( maxElementArea ) -print hypArea35.GetName() -print hypArea35.GetId() -print hypArea35.GetMaxElementArea() - -smeshgui.SetName(salome.ObjectToID(hypArea35), "MaxElementArea_35") - -print "-------------------------- Regular_1D" - -algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" ) -listHyp = algoReg1D.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoReg1D.GetName() -print algoReg1D.GetId() - -smeshgui.SetName(salome.ObjectToID(algoReg1D), "Regular_1D") - -print "-------------------------- MEFISTO_2D" - -algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" ) -listHyp = algoMef.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoMef.GetName() -print algoMef.GetId() - -smeshgui.SetName(salome.ObjectToID(algoMef), "MEFISTO_2D") - -print "-------------------------- SMESH_Quadrangle_2D" - -algoQuad = smesh.CreateHypothesis( "Quadrangle_2D", "libStdMeshersEngine.so" ) -listHyp = algoQuad.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoQuad.GetName() -print algoQuad.GetId() - -smeshgui.SetName(salome.ObjectToID(algoQuad), "SMESH_Quadrangle_2D") - -print "-------------------------- add hypothesis to main shape" - -mesh.AddHypothesis( shape_mesh, hypNbSeg ) # nb segments -mesh.AddHypothesis( shape_mesh, hypArea25 ) # max area - -mesh.AddHypothesis( shape_mesh, algoReg1D ) # Regular 1D/wire discretisation -mesh.AddHypothesis( shape_mesh, algoMef ) # MEFISTO 2D - -print "-------------------------- add hypothesis and algorithm to sub face 1" - -submesh = mesh.GetSubMesh(sub_face1, "SubMeshFace1") - -mesh.AddHypothesis( sub_face1, algoQuad ) # Quadrangle 2D -mesh.AddHypothesis( sub_face1, hypArea35 ) # max area - -print "-------------------------- add hypothesis and algorithm to sub face 2" - -submesh = mesh.GetSubMesh(sub_face2, "SubMeshFace2") - -mesh.AddHypothesis( sub_face2, algoQuad ) # Quadrangle 2D -mesh.AddHypothesis( sub_face2, hypArea35 ) # max area - -print "-------------------------- add hypothesis and algorith to sub face 3" - -submesh = mesh.GetSubMesh(sub_face3, "SubMeshFace3") +# Create submesh on sub_face1 - sub_face4 +# --------------------------------------- -mesh.AddHypothesis( sub_face3, algoQuad ) # Quadrangle 2D -mesh.AddHypothesis( sub_face3, hypArea35 ) # max area +# Set 2D algorithm to submesh on sub_face1 +algo = mesh.Quadrangle(sub_face1) +smesh.SetName(algo.GetSubMesh(), "SubMeshFace1") -print "-------------------------- add hypothesis and algorith to sub face 4" +# Set 2D algorithm to submesh on sub_face2 +algo = mesh.Quadrangle(sub_face2) +smesh.SetName(algo.GetSubMesh(), "SubMeshFace2") -submesh = mesh.GetSubMesh(sub_face4, "SubMeshFace4") +# Set 2D algorithm to submesh on sub_face3 +algo = mesh.Quadrangle(sub_face3) +smesh.SetName(algo.GetSubMesh(), "SubMeshFace3") -mesh.AddHypothesis( sub_face4, algoQuad ) # Quadrangle 2D -mesh.AddHypothesis( sub_face4, hypArea35 ) # max area +# Set 2D algorithm to submesh on sub_face4 +algo = mesh.Quadrangle(sub_face4) +smesh.SetName(algo.GetSubMesh(), "SubMeshFace4") print "-------------------------- compute the mesh of the mechanic piece" -smesh.Compute(mesh, shape_mesh) +mesh.Compute() print "Information about the Mesh_mechanic:" print "Number of nodes : ", mesh.NbNodes() diff --git a/src/SMESH_SWIG/SMESH_mechanic_editor.py b/src/SMESH_SWIG/SMESH_mechanic_editor.py index 0eed6bbd6..0eb159d59 100644 --- a/src/SMESH_SWIG/SMESH_mechanic_editor.py +++ b/src/SMESH_SWIG/SMESH_mechanic_editor.py @@ -28,10 +28,7 @@ import salome import geompy - -import StdMeshers - -import SMESH +import smesh # ---------------------------- GEOM -------------------------------------- @@ -122,130 +119,62 @@ Id_SubFace4 = geompy.addToStudyInFather( mechanic, sub_face4, name ) # ---------------------------- SMESH -------------------------------------- -# ---- launch SMESH, init a Mesh with shape 'mechanic' - -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") - # -- Init -- shape_mesh = salome.IDToObject( Id_mechanic ) -smesh.SetCurrentStudy(salome.myStudy) -mesh = smesh.CreateMesh(shape_mesh) - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) - -idmesh = salome.ObjectToID(mesh) -smeshgui.SetName( idmesh, "Mesh_mechanic" ) +mesh = smesh.Mesh(shape_mesh, "Mesh_mechanic") print "-------------------------- NumberOfSegments" numberOfSegment = 10 -hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" ) -hypNbSeg.SetNumberOfSegments( numberOfSegment ) +algo = mesh.Segment() +hypNbSeg = algo.NumberOfSegments(numberOfSegment) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() +smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegment)) -smeshgui.SetName(salome.ObjectToID(hypNbSeg), "NumberOfSegments_10") print "-------------------------- MaxElementArea" maxElementArea = 25 -hypArea25 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) -hypArea25.SetMaxElementArea( maxElementArea ) +algo = mesh.Triangle() +hypArea25 = algo.MaxElementArea(maxElementArea) print hypArea25.GetName() print hypArea25.GetId() print hypArea25.GetMaxElementArea() +smesh.SetName(hypArea25, "MaxElementArea_" + str(maxElementArea)) -smeshgui.SetName(salome.ObjectToID(hypArea25), "MaxElementArea_25") - -print "-------------------------- MaxElementArea" - -maxElementArea = 35 - -hypArea35 = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) -hypArea35.SetMaxElementArea( maxElementArea ) -print hypArea35.GetName() -print hypArea35.GetId() -print hypArea35.GetMaxElementArea() - -smeshgui.SetName(salome.ObjectToID(hypArea35), "MaxElementArea_35") - -print "-------------------------- Regular_1D" - -algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" ) -listHyp = algoReg1D.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoReg1D.GetName() -print algoReg1D.GetId() - -smeshgui.SetName(salome.ObjectToID(algoReg1D), "Regular_1D") - -print "-------------------------- MEFISTO_2D" -algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" ) -listHyp = algoMef.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoMef.GetName() -print algoMef.GetId() +# Create submesh on sub_face1 - sub_face4 +# --------------------------------------- -smeshgui.SetName(salome.ObjectToID(algoMef), "MEFISTO_2D") +# Set 2D algorithm to submesh on sub_face1 +algo = mesh.Quadrangle(sub_face1) +smesh.SetName(algo.GetSubMesh(), "SubMeshFace1") +submesh1 = algo.GetSubMesh() -print "-------------------------- SMESH_Quadrangle_2D" +# Set 2D algorithm to submesh on sub_face2 +algo = mesh.Quadrangle(sub_face2) +smesh.SetName(algo.GetSubMesh(), "SubMeshFace2") +submesh2 = algo.GetSubMesh() -algoQuad = smesh.CreateHypothesis( "Quadrangle_2D", "libStdMeshersEngine.so" ) -listHyp = algoQuad.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoQuad.GetName() -print algoQuad.GetId() +# Set 2D algorithm to submesh on sub_face3 +algo = mesh.Quadrangle(sub_face3) +smesh.SetName(algo.GetSubMesh(), "SubMeshFace3") +submesh3 = algo.GetSubMesh() -smeshgui.SetName(salome.ObjectToID(algoQuad), "SMESH_Quadrangle_2D") +# Set 2D algorithm to submesh on sub_face4 +algo = mesh.Quadrangle(sub_face4) +smesh.SetName(algo.GetSubMesh(), "SubMeshFace4") +submesh4 = algo.GetSubMesh() -print "-------------------------- add hypothesis to main shape" - -mesh.AddHypothesis( shape_mesh, hypNbSeg ) # nb segments -mesh.AddHypothesis( shape_mesh, hypArea25 ) # max area - -mesh.AddHypothesis( shape_mesh, algoReg1D ) # Regular 1D/wire discretisation -mesh.AddHypothesis( shape_mesh, algoMef ) # MEFISTO 2D - -print "-------------------------- add hypothesis and algorithm to sub face 1" - -submesh = mesh.GetSubMesh(sub_face1, "SubMeshFace1") - -mesh.AddHypothesis( sub_face1, algoQuad ) # Quadrangle 2D -mesh.AddHypothesis( sub_face1, hypArea35 ) # max area - -print "-------------------------- add hypothesis and algorithm to sub face 2" - -submesh = mesh.GetSubMesh(sub_face2, "SubMeshFace2") - -mesh.AddHypothesis( sub_face2, algoQuad ) # Quadrangle 2D -mesh.AddHypothesis( sub_face2, hypArea35 ) # max area - -print "-------------------------- add hypothesis and algorith to sub face 3" - -submesh = mesh.GetSubMesh(sub_face3, "SubMeshFace3") - -mesh.AddHypothesis( sub_face3, algoQuad ) # Quadrangle 2D -mesh.AddHypothesis( sub_face3, hypArea35 ) # max area - -print "-------------------------- add hypothesis and algorith to sub face 4" - -submesh = mesh.GetSubMesh(sub_face4, "SubMeshFace4") - -mesh.AddHypothesis( sub_face4, algoQuad ) # Quadrangle 2D -mesh.AddHypothesis( sub_face4, hypArea35 ) # max area print "-------------------------- compute the mesh of the mechanic piece" -smesh.Compute(mesh, shape_mesh) +mesh.Compute() print "Information about the Mesh_mechanic:" print "Number of nodes : ", mesh.NbNodes() @@ -257,52 +186,45 @@ print "Number of volumes : ", mesh.NbVolumes() print "Number of tetrahedrons: ", mesh.NbTetras() -MeshEditor = mesh.GetMeshEditor() - #1 cutting of quadrangles of the 'SubMeshFace2' submesh -submesh = mesh.GetSubMesh(sub_face2, "SubMeshFace2") -MeshEditor.SplitQuadObject(submesh, 1) +mesh.SplitQuadObject(submesh2, 1) #2 cutting of triangles of the group FacesTriToQuad = [2381, 2382, 2383, 2384, 2385, 2386, 2387, 2388, 2389, 2390, 2391, 2392, 2393, 2394, 2395, 2396, 2397, 2398, 2399, 2400, 2401, 2402, 2403, 2404, 2405, 2406, 2407, 2408, 2409, 2410, 2411, 2412, 2413, 2414, 2415, 2416, 2417, 2418, 2419, 2420, 2421, 2422] -GroupTriToQuad = mesh.CreateGroup(SMESH.FACE,"Group of faces (quad)") -GroupTriToQuad.Add(FacesTriToQuad) -MeshEditor.TriToQuadObject(GroupTriToQuad, None , 1.57) +GroupTriToQuad = mesh.MakeGroupByIds("Group of faces (quad)", smesh.FACE, FacesTriToQuad) +mesh.TriToQuadObject(GroupTriToQuad, None , 1.57) #3 extrusion of the group -point = SMESH.PointStruct(0, 0, 5) -vector = SMESH.DirStruct(point) -MeshEditor.ExtrusionSweepObject(GroupTriToQuad, vector, 5) +point = smesh.PointStruct(0, 0, 5) +vector = smesh.DirStruct(point) +mesh.ExtrusionSweepObject(GroupTriToQuad, vector, 5) #4 mirror object -MeshEditor.MirrorObject(mesh, SMESH.AxisStruct(0, 0, 0, 0, 0, 0), SMESH.SMESH_MeshEditor.POINT, 0) +mesh.Mirror([], smesh.AxisStruct(0, 0, 0, 0, 0, 0), smesh.POINT, 0) #5 mesh translation -point = SMESH.PointStruct(10, 10, 10) -vector = SMESH.DirStruct(point) -MeshEditor.TranslateObject(mesh, vector, 0) +point = smesh.PointStruct(10, 10, 10) +vector = smesh.DirStruct(point) +mesh.Translate([], vector, 0) #6 mesh rotation -axisXYZ = SMESH.AxisStruct(0, 0, 0, 10, 10, 10) +axisXYZ = smesh.AxisStruct(0, 0, 0, 10, 10, 10) angle180 = 180*3.141/180 -MeshEditor.RotateObject(mesh, axisXYZ, angle180, 0) +mesh.Rotate([], axisXYZ, angle180, 0) #7 group smoothing FacesSmooth = [864, 933, 941, 950, 1005, 1013] -GroupSmooth = mesh.CreateGroup(SMESH.FACE,"Group of faces (smooth)") -GroupSmooth.Add(FacesSmooth) -MeshEditor.SmoothObject(GroupSmooth, [], 20, 2, SMESH.SMESH_MeshEditor.CENTROIDAL_SMOOTH) +GroupSmooth = mesh.MakeGroupByIds("Group of faces (smooth)", smesh.FACE, FacesSmooth) +mesh.SmoothObject(GroupSmooth, [], 20, 2, smesh.CENTROIDAL_SMOOTH) #8 rotation sweep object FacesRotate = [492, 493, 502, 503] -GroupRotate = mesh.CreateGroup(SMESH.FACE,"Group of faces (rotate)") -GroupRotate.Add(FacesRotate) +GroupRotate = mesh.MakeGroupByIds("Group of faces (rotate)", smesh.FACE, FacesRotate) angle45 = 45*3.141/180 -axisXYZ = SMESH.AxisStruct(-38.3128, -73.3658, -133.321, -13.3402, -13.3265, 6.66632) -MeshEditor.RotationSweepObject(GroupRotate, axisXYZ, angle45, 4, 1e-5) +axisXYZ = smesh.AxisStruct(-38.3128, -73.3658, -133.321, -13.3402, -13.3265, 6.66632) +mesh.RotationSweepObject(GroupRotate, axisXYZ, angle45, 4, 1e-5) -#9 reorientation of the whole mesh -submesh = mesh.GetSubMesh(sub_face1, "SubMeshFace1") -MeshEditor.ReorientObject(submesh) +#9 reorientation of the submesh1 +mesh.ReorientObject(submesh1) salome.sg.updateObjBrowser(1) diff --git a/src/SMESH_SWIG/SMESH_mechanic_netgen.py b/src/SMESH_SWIG/SMESH_mechanic_netgen.py index b3a0ea2a7..4b9f70897 100644 --- a/src/SMESH_SWIG/SMESH_mechanic_netgen.py +++ b/src/SMESH_SWIG/SMESH_mechanic_netgen.py @@ -28,8 +28,6 @@ import geompy geom = geompy.geom -import StdMeshers -import NETGENPlugin import smesh # ---------------------------- GEOM -------------------------------------- @@ -109,13 +107,12 @@ print "number of Edges in mechanic : ",len(subEdgeList) print "-------------------------- create Mesh, algorithm, hypothesis" mesh = smesh.Mesh(mechanic, "Mesh_mechanic"); -netgen = mesh.Netgen(0) -hyp = netgen.Parameters() -hyp.SetMaxSize( 50 ) -#hyp.SetSecondOrder( 0 ) -hyp.SetFineness( 3 ) -hyp.SetQuadAllowed( 1 ) -#hyp.SetOptimize( 1 ) +netgen = mesh.Triangle(smesh.NETGEN) +netgen.SetMaxSize( 50 ) +#netgen.SetSecondOrder( 0 ) +netgen.SetFineness( smesh.Fine ) +netgen.SetQuadAllowed( 1 ) +#netgen.SetOptimize( 1 ) salome.sg.updateObjBrowser(1) @@ -124,13 +121,13 @@ ret = mesh.Compute() print ret if ret != 0: print "Information about the MeshcompShel:" - print "Number of nodes : ", mesh.GetMesh().NbNodes() - print "Number of edges : ", mesh.GetMesh().NbEdges() - print "Number of faces : ", mesh.GetMesh().NbFaces() - print "Number of triangles : ", mesh.GetMesh().NbTriangles() - print "Number of quadrangles : ", mesh.GetMesh().NbQuadrangles() - print "Number of volumes : ", mesh.GetMesh().NbVolumes() - print "Number of tetrahedrons : ", mesh.GetMesh().NbTetras() + print "Number of nodes : ", mesh.NbNodes() + print "Number of edges : ", mesh.NbEdges() + print "Number of faces : ", mesh.NbFaces() + print "Number of triangles : ", mesh.NbTriangles() + print "Number of quadrangles : ", mesh.NbQuadrangles() + print "Number of volumes : ", mesh.NbVolumes() + print "Number of tetrahedrons : ", mesh.NbTetras() else: print "problem when computing the mesh" diff --git a/src/SMESH_SWIG/SMESH_mechanic_tetra.py b/src/SMESH_SWIG/SMESH_mechanic_tetra.py index f5f56d4bc..d4c4dd92e 100644 --- a/src/SMESH_SWIG/SMESH_mechanic_tetra.py +++ b/src/SMESH_SWIG/SMESH_mechanic_tetra.py @@ -26,16 +26,9 @@ import salome import geompy +import smesh geom = geompy.geom -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) - -import StdMeshers -import NETGENPlugin # ---------------------------- GEOM -------------------------------------- @@ -111,94 +104,44 @@ print "number of Edges in mechanic : ",len(subEdgeList) ### ---------------------------- SMESH -------------------------------------- -print "-------------------------- NumberOfSegments" +shape_mesh = salome.IDToObject( Id_mechanic ) + +mesh = smesh.Mesh(shape_mesh, "Mesh_mechanic_tetra") + +print "-------------------------- add hypothesis to main mechanic" numberOfSegment = 10 -hypNbSeg = smesh.CreateHypothesis( "NumberOfSegments", "libStdMeshersEngine.so" ) -hypNbSeg.SetNumberOfSegments( numberOfSegment ) +algo1 = mesh.Segment() +hypNbSeg = algo1.NumberOfSegments(numberOfSegment) print hypNbSeg.GetName() print hypNbSeg.GetId() print hypNbSeg.GetNumberOfSegments() +smesh.SetName(hypNbSeg, "NumberOfSegments_" + str(numberOfSegment)) -smeshgui.SetName(salome.ObjectToID(hypNbSeg), "NumberOfSegments_10") - -print "-------------------------- MaxElementArea" maxElementArea = 20 -hypArea = smesh.CreateHypothesis( "MaxElementArea", "libStdMeshersEngine.so" ) -hypArea.SetMaxElementArea( maxElementArea ) +algo2 = mesh.Triangle(smesh.MEFISTO) +hypArea = algo2.MaxElementArea(maxElementArea) print hypArea.GetName() print hypArea.GetId() print hypArea.GetMaxElementArea() +smesh.SetName(hypArea, "MaxElementArea_" + str(maxElementArea)) -smeshgui.SetName(salome.ObjectToID(hypArea), "MaxElementArea_20") - -print "-------------------------- MaxElementVolume" maxElementVolume = 20 -hypVolume = smesh.CreateHypothesis( "MaxElementVolume", "libStdMeshersEngine.so" ) -hypVolume.SetMaxElementVolume( maxElementVolume ) +algo3 = mesh.Tetrahedron(smesh.NETGEN) +hypVolume = algo3.MaxElementVolume(maxElementVolume) print hypVolume.GetName() print hypVolume.GetId() print hypVolume.GetMaxElementVolume() +smesh.SetName(hypVolume, "maxElementVolume_" + str(maxElementVolume)) -smeshgui.SetName(salome.ObjectToID(hypVolume), "MaxElementVolume_20") - -print "-------------------------- Regular_1D" - -algoReg1D = smesh.CreateHypothesis( "Regular_1D", "libStdMeshersEngine.so" ) -listHyp =algoReg1D.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoReg1D.GetName() -print algoReg1D.GetId() - -smeshgui.SetName(salome.ObjectToID(algoReg1D), "Regular_1D") - -print "-------------------------- MEFISTO_2D" - -algoMef = smesh.CreateHypothesis( "MEFISTO_2D", "libStdMeshersEngine.so" ) -listHyp = algoMef.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoMef.GetName() -print algoMef.GetId() - -smeshgui.SetName(salome.ObjectToID(algoMef), "MEFISTO_2D") - -print "-------------------------- NETGEN_3D" - -algoNg = smesh.CreateHypothesis( "NETGEN_3D", "libNETGENEngine.so" ) -listHyp = algoNg.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoNg.GetName() -print algoNg.GetId() - -smeshgui.SetName(salome.ObjectToID(algoNg), "NETGEN_3D") - -print "-------------------------- add hypothesis to main mechanic" - -shape_mesh = salome.IDToObject( Id_mechanic ) - -mesh = smesh.CreateMesh(shape_mesh) - -idmesh = salome.ObjectToID(mesh) -smeshgui.SetName( idmesh, "Mesh_mechanic_tetra" ) - -mesh.AddHypothesis( shape_mesh, hypNbSeg ) # nb segments -mesh.AddHypothesis( shape_mesh, hypArea ) # max area -mesh.AddHypothesis( shape_mesh, hypVolume ) # max volume - -mesh.AddHypothesis( shape_mesh, algoReg1D ) # Regular 1D/wire discretisation -mesh.AddHypothesis( shape_mesh, algoMef ) # MEFISTO 2D -mesh.AddHypothesis( shape_mesh, algoNg ) # NETGEN 3D print "-------------------------- compute the mesh of the mechanic piece" -smesh.Compute(mesh,shape_mesh) +mesh.Compute() print "Information about the Mesh_mechanic_tetra:" print "Number of nodes : ", mesh.NbNodes() diff --git a/src/SMESH_SWIG/SMESH_reg.py b/src/SMESH_SWIG/SMESH_reg.py index 2e3a8c534..bf71f6d56 100644 --- a/src/SMESH_SWIG/SMESH_reg.py +++ b/src/SMESH_SWIG/SMESH_reg.py @@ -24,11 +24,10 @@ import salome import geompy +import smesh import StdMeshers -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) # ---- define a box print "Define box" @@ -60,124 +59,53 @@ smeshgui = salome.ImportComponentGUI("SMESH") smeshgui.Init(salome.myStudyId) -print "-------------------------- create Hypothesis" - -print "-------------------------- LocalLength" -hypLen1 = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so") -hypLen1.SetLength(100) -print hypLen1.GetName() -print hypLen1.GetId() -print hypLen1.GetLength() - -idlength = salome.ObjectToID(hypLen1) -smeshgui.SetName(idlength, "Local_Length_100"); - -hypNbSeg = [] -print "-------------------------- NumberOfSegments" -hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg1.SetDistrType(0) -hypNbSeg1.SetNumberOfSegments(7) -print hypNbSeg1.GetName() -print hypNbSeg1.GetId() -print hypNbSeg1.GetNumberOfSegments() -idseg1 = salome.ObjectToID(hypNbSeg1) -smeshgui.SetName(idseg1, "NumberOfSegmentsReg"); -hypNbSeg.append(hypNbSeg1) - -hypNbSeg2 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg2.SetDistrType(1) -hypNbSeg2.SetNumberOfSegments(7) -hypNbSeg2.SetScaleFactor(2) -print hypNbSeg2.GetName() -print hypNbSeg2.GetId() -print hypNbSeg2.GetNumberOfSegments() -idseg2 = salome.ObjectToID(hypNbSeg2) -smeshgui.SetName(idseg2, "NumberOfSegmentsScale"); -hypNbSeg.append(hypNbSeg2) - -hypNbSeg3 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg3.SetDistrType(2) -hypNbSeg3.SetNumberOfSegments(7) -hypNbSeg3.SetTableFunction( [0, 0.1, 0.5, 1.0, 1.0, 0.1] ) -hypNbSeg3.SetConversionMode(0) -print hypNbSeg3.GetName() -print hypNbSeg3.GetId() -print hypNbSeg3.GetNumberOfSegments() -idseg3 = salome.ObjectToID(hypNbSeg3) -smeshgui.SetName(idseg3, "NumberOfSegmentsTable"); -hypNbSeg.append(hypNbSeg3) - -hypNbSeg4 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg4.SetDistrType(3) -hypNbSeg4.SetNumberOfSegments(10) -hypNbSeg4.SetExpressionFunction("sin(3*t)") -hypNbSeg4.SetConversionMode(1) -print hypNbSeg4.GetName() -print hypNbSeg4.GetId() -print hypNbSeg4.GetNumberOfSegments() -idseg4 = salome.ObjectToID(hypNbSeg4) -smeshgui.SetName(idseg4, "NumberOfSegmentsExpr"); -hypNbSeg.append(hypNbSeg4) - -print "-------------------------- MaxElementArea" -hypArea1 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hypArea1.SetMaxElementArea(2500) -print hypArea1.GetName() -print hypArea1.GetId() -print hypArea1.GetMaxElementArea() - -idarea1 = salome.ObjectToID(hypArea1) -smeshgui.SetName(idarea1, "MaxElementArea_2500"); - -print "-------------------------- MaxElementArea" -hypArea2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hypArea2.SetMaxElementArea(500) -print hypArea2.GetName() -print hypArea2.GetId() -print hypArea2.GetMaxElementArea() - -idarea2 = salome.ObjectToID(hypArea2) -smeshgui.SetName(idarea2, "MaxElementArea_500"); - -print "-------------------------- Regular_1D" -algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -listHyp = algoReg.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoReg.GetName() -print algoReg.GetId() - -idreg = salome.ObjectToID(algoReg) -smeshgui.SetName(idreg, "Regular_1D"); - -print "-------------------------- MEFISTO_2D" -algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") -listHyp = algoMef.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoMef.GetName() -print algoMef.GetId() - -idmef = salome.ObjectToID(algoMef) -smeshgui.SetName(idmef, "MEFISTO_2D"); - -salome.sg.updateObjBrowser(1); - -# ---- Init a Mesh with the box +# ---- Creating meshes box = salome.IDToObject(idbox) -names = [ "MeshBoxReg", "MeshBoxScale", "MeshBoxTable", "MeshBoxExpr" ]; -j = 0 -for i in range(4): - mesh = smesh.CreateMesh(box) - idmesh = salome.ObjectToID(mesh) - smeshgui.SetName(idmesh, names[j]); - print "-------------------------- add hypothesis to box" - mesh.AddHypothesis(box,algoReg) - mesh.AddHypothesis(box,hypNbSeg[j]) - mesh.AddHypothesis(box,algoMef) - mesh.AddHypothesis(box,hypArea1) - j=j+1 +names = [ "MeshBoxReg", "MeshBoxScale", "MeshBoxTable", "MeshBoxExpr" ] + + +print "-------------------------- Create ", names[0], " mesh" +mesh = smesh.Mesh(box, names[0]) +algo = mesh.Segment() +hyp = algo.NumberOfSegments(7) +hyp.SetDistrType(0) +smesh.SetName(hyp, "NumberOfSegmentsReg") +algo = mesh.Triangle() +algo.MaxElementArea(2500) + +print "-------------------------- Create ", names[1], " mesh" +mesh = smesh.Mesh(box, names[1]) +algo = mesh.Segment() +hyp = algo.NumberOfSegments(7) +hyp.SetDistrType(1) +hyp.SetScaleFactor(2) +smesh.SetName(hyp, "NumberOfSegmentsScale") +algo = mesh.Triangle() +algo.MaxElementArea(2500) + +print "-------------------------- Create ", names[2], " mesh" +mesh = smesh.Mesh(box,names[2]) +algo = mesh.Segment() +hyp = algo.NumberOfSegments(7) +hyp.SetDistrType(2) +hyp.SetTableFunction( [0, 0.1, 0.5, 1.0, 1.0, 0.1] ) +hyp.SetConversionMode(0) +smesh.SetName(hyp, "NumberOfSegmentsTable") +algo = mesh.Triangle() +algo.MaxElementArea(2500) + +print "-------------------------- Create ", names[3], " mesh" +mesh = smesh.Mesh(box, names[3]) +algo = mesh.Segment() +hyp = algo.NumberOfSegments(10) +hyp.SetDistrType(3) +hyp.SetExpressionFunction("sin(3*t)") +hyp.SetConversionMode(1) +smesh.SetName(hyp, "NumberOfSegmentsExpr") +algo = mesh.Triangle() +algo.MaxElementArea(2500) + salome.sg.updateObjBrowser(1); diff --git a/src/SMESH_SWIG/SMESH_test.py b/src/SMESH_SWIG/SMESH_test.py index 1424181d1..23f065401 100644 --- a/src/SMESH_SWIG/SMESH_test.py +++ b/src/SMESH_SWIG/SMESH_test.py @@ -26,10 +26,7 @@ import salome import geompy -import smeshpy - -import SMESH -import StdMeshers +import smesh # ---- define a box @@ -57,94 +54,46 @@ edge = edgeList[0]; name = geompy.SubShapeName(edge, face) ide = geompy.addToStudyInFather(face, edge, name) -# ---- launch SMESH, init a Mesh with the box - -gen = smeshpy.smeshpy() -mesh = gen.CreateMesh(idb) - -print "-------------------------- create Hypothesis" - -print "-------------------------- LocalLength" - -hypo1 = gen.CreateHypothesis("LocalLength", "libStdMeshersEngine.so") -print hypo1.GetName() -print hypo1.GetId() -print hypo1.GetLength() -hypo1.SetLength(100) -print hypo1.GetLength() - -print "-------------------------- bidon" +# ---- SMESH -hyp3 = gen.CreateHypothesis("bidon", "") - -print "-------------------------- NumberOfSegments" - -hypo3 = gen.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypo3.SetNumberOfSegments(7) -print hypo3.GetName() -print hypo3.GetNumberOfSegments() -print hypo3.GetId() - -print "-------------------------- MaxElementArea" +box = salome.IDToObject(idb) +mesh = smesh.Mesh(box, "Meshbox") -hypo4 = gen.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hypo4.SetMaxElementArea(5000) -print hypo4.GetName() -print hypo4.GetMaxElementArea() -print hypo4.GetId() +print "-------------------------- add hypothesis to box" -print "-------------------------- Regular_1D" +algo_1 = mesh.Segment(box) +hyp = algo_1.LocalLength(100) +print hyp.GetName() +print hyp.GetId() +print hyp.GetLength() -algo_1 = gen.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -print algo_1.GetName() -print algo_1.GetId() -listHyp = algo_1.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algo_1.GetId() +algo_2 = mesh.Triangle(smesh.MEFISTO, box) +hyp = algo_2.MaxElementArea(5000) +print hyp.GetName() +print hyp.GetId() +print hyp.GetMaxElementArea() -print "-------------------------- MEFISTO_2D" +smesh.SetName(algo_2.GetSubMesh(), "SubMeshBox") -algo_2 = gen.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") -print algo_2.GetName() -print algo_2.GetId() -listHyp = algo_2.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algo_2.GetId() print "-------------------------- add hypothesis to edge" edge = salome.IDToObject(ide) -submesh = mesh.GetSubMesh(edge, "SubMeshEdge") -ret = mesh.AddHypothesis(edge,algo_1) -print ret -ret = mesh.AddHypothesis(edge,hypo1) -print ret -##print "-------------------------- compute edge" -##ret=gen.Compute(mesh,ide) -##print ret -##log=mesh.GetLog(1); -##for a in log: -## print a +algo_3 = mesh.Segment(edge) +hyp = algo_3.LocalLength(100) +print hyp.GetName() +print hyp.GetId() +print hyp.GetLength() -print "-------------------------- add hypothesis to box" +smesh.SetName(algo_3.GetSubMesh(), "SubMeshEdge") -box = salome.IDToObject(idb) -submesh = mesh.GetSubMesh(box, "SubMeshBox") -ret = mesh.AddHypothesis(box,algo_1) -print ret -ret = mesh.AddHypothesis(box,hypo1) -print ret -ret = mesh.AddHypothesis(box,algo_2) -print ret -ret = mesh.AddHypothesis(box,hypo4) -print ret print "-------------------------- compute face" -ret = gen.Compute(mesh,idf) +face = salome.IDToObject(idf) + +ret = mesh.Compute(face) print ret log = mesh.GetLog(0) # 0 - GetLog without ClearLog after, else if 1 - ClearLog after for a in log: @@ -183,18 +132,3 @@ for a in log: i3 = a.indexes[ii] ii = ii+1 print "AddTriangle %i - %i %i %i" % (ind, i1, i2, i3) - -##print "-------------------------- compute box" -##ret=gen.Compute(mesh,idb) -##print ret -##log=mesh.GetLog(1); -##print log - -##shell=salome.IDToObject(ids) -##submesh=mesh.GetElementsOnShape(shell) -##ret=mesh.AddHypothesis(shell,algo_1) -##print ret -##ret=mesh.AddHypothesis(shell,hypo1) -##print ret -##ret=gen.Compute(mesh,ids) -##print ret diff --git a/src/SMESH_SWIG/SMESH_test0.py b/src/SMESH_SWIG/SMESH_test0.py index 64794e623..7a81b0dfd 100644 --- a/src/SMESH_SWIG/SMESH_test0.py +++ b/src/SMESH_SWIG/SMESH_test0.py @@ -26,7 +26,6 @@ import salome import geompy from geompy import geom -import SMESH myBuilder = salome.myStudy.NewBuilder() diff --git a/src/SMESH_SWIG/SMESH_test1.py b/src/SMESH_SWIG/SMESH_test1.py index 1943a9611..786160b3e 100644 --- a/src/SMESH_SWIG/SMESH_test1.py +++ b/src/SMESH_SWIG/SMESH_test1.py @@ -24,11 +24,8 @@ import salome import geompy +import smesh -import StdMeshers - -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) # ---- define a box @@ -59,99 +56,51 @@ name = geompy.SubShapeName(edge, face) print name idedge = geompy.addToStudyInFather(face, edge, name) -# ---- launch SMESH - -smeshgui = salome.ImportComponentGUI("SMESH") -smeshgui.Init(salome.myStudyId) -print "-------------------------- create Hypothesis" +# ---- SMESH -print "-------------------------- LocalLength" -hypLen1 = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so") -hypLen1.SetLength(100) -print hypLen1.GetName() -print hypLen1.GetId() -print hypLen1.GetLength() +# ---- Init a Mesh with the box -idlength = salome.ObjectToID(hypLen1) -smeshgui.SetName(idlength, "Local_Length_100"); +mesh = smesh.Mesh(box, "Meshbox") -print "-------------------------- NumberOfSegments" -hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hypNbSeg1.SetNumberOfSegments(7) +print "-------------------------- add hypothesis to box" +algoReg1 = mesh.Segment() +hypNbSeg1 = algoReg1.NumberOfSegments(7) print hypNbSeg1.GetName() print hypNbSeg1.GetId() print hypNbSeg1.GetNumberOfSegments() +smesh.SetName(hypNbSeg1, "NumberOfSegments_7") -idseg = salome.ObjectToID(hypNbSeg1) -smeshgui.SetName(idseg, "NumberOfSegments_7"); - -print "-------------------------- MaxElementArea" -hypArea1 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hypArea1.SetMaxElementArea(2500) +algoMef1 = mesh.Triangle() +hypArea1 = algoMef1.MaxElementArea(2500) print hypArea1.GetName() print hypArea1.GetId() print hypArea1.GetMaxElementArea() - -idarea1 = salome.ObjectToID(hypArea1) -smeshgui.SetName(idarea1, "MaxElementArea_2500"); - -print "-------------------------- MaxElementArea" -hypArea2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hypArea2.SetMaxElementArea(500) -print hypArea2.GetName() -print hypArea2.GetId() -print hypArea2.GetMaxElementArea() - -idarea2 = salome.ObjectToID(hypArea2) -smeshgui.SetName(idarea2, "MaxElementArea_500"); - -print "-------------------------- Regular_1D" -algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -listHyp = algoReg.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoReg.GetName() -print algoReg.GetId() - -idreg = salome.ObjectToID(algoReg) -smeshgui.SetName(idreg, "Regular_1D"); - -print "-------------------------- MEFISTO_2D" -algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") -listHyp = algoMef.GetCompatibleHypothesis() -for hyp in listHyp: - print hyp -print algoMef.GetName() -print algoMef.GetId() - -idmef = salome.ObjectToID(algoMef) -smeshgui.SetName(idmef, "MEFISTO_2D"); - -# ---- Init a Mesh with the box - -box = salome.IDToObject(idbox) -mesh = smesh.CreateMesh(box) -idmesh = salome.ObjectToID(mesh) -smeshgui.SetName(idmesh, "Meshbox"); - -print "-------------------------- add hypothesis to box" -mesh.AddHypothesis(box,algoReg) -mesh.AddHypothesis(box,hypNbSeg1) -mesh.AddHypothesis(box,algoMef) -mesh.AddHypothesis(box,hypArea1) +smesh.SetName(hypArea1, "MaxElementArea_2500") # ---- add hypothesis to edge - print "-------------------------- add hypothesis to edge" edge = salome.IDToObject(idedge) -submesh = mesh.GetSubMesh(edge, "SubMeshEdge") -mesh.AddHypothesis(edge, algoReg) -mesh.AddHypothesis(edge, hypLen1) +algoReg2 = mesh.Segment(edge) +hypLen1 = algoReg2.LocalLength(100) +smesh.SetName(algoReg2.GetSubMesh(), "SubMeshEdge") +print hypLen1.GetName() +print hypLen1.GetId() +print hypLen1.GetLength() +smesh.SetName(hypLen1, "Local_Length_100") + +# ---- add hypothesis to face print "-------------------------- add hypothesis to face" face = salome.IDToObject(idface) -submesh = mesh.GetSubMesh(face, "SubMeshFace") -mesh.AddHypothesis(face, hypArea2) + +algoMef2 = mesh.Triangle(face) +hypArea2 = algoMef2.MaxElementArea(500) +smesh.SetName(algoMef2.GetSubMesh(), "SubMeshFace") +print hypArea2.GetName() +print hypArea2.GetId() +print hypArea2.GetMaxElementArea() +smesh.SetName(hypArea2, "MaxElementArea_500") + salome.sg.updateObjBrowser(1); diff --git a/src/SMESH_SWIG/SMESH_test1_AndDisplay.py b/src/SMESH_SWIG/SMESH_test1_AndDisplay.py new file mode 100644 index 000000000..e1a5e01d2 --- /dev/null +++ b/src/SMESH_SWIG/SMESH_test1_AndDisplay.py @@ -0,0 +1,111 @@ +# Copyright (C) 2003 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. +# +# 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 : SMESH_test1.py +# Module : SMESH + +import salome +import geompy +import smesh + + +# ---- define a box + +box = geompy.MakeBox(0., 0., 0., 100., 200., 300.) +idbox = geompy.addToStudy(box, "box") + +# ---- add first face of box in study + +subShapeList = geompy.SubShapeAll(box, geompy.ShapeType["FACE"]) +face = subShapeList[0] +name = geompy.SubShapeName(face, box) +print name +idface = geompy.addToStudyInFather(box, face, name) + +# ---- add shell from box in study + +subShellList = geompy.SubShapeAll(box, geompy.ShapeType["SHELL"]) +shell = subShellList[0] +name = geompy.SubShapeName(shell, box) +print name +idshell = geompy.addToStudyInFather(box, shell, name) + +# ---- add first edge of face in study + +edgeList = geompy.SubShapeAll(face, geompy.ShapeType["EDGE"]) +edge = edgeList[0] +name = geompy.SubShapeName(edge, face) +print name +idedge = geompy.addToStudyInFather(face, edge, name) + + +# ---- SMESH + +# ---- Init a Mesh with the box + +mesh = smesh.Mesh(box, "Meshbox") + +print "-------------------------- add hypothesis to box" +algoReg1 = mesh.Segment() +hypNbSeg1 = algoReg1.NumberOfSegments(7) +print hypNbSeg1.GetName() +print hypNbSeg1.GetId() +print hypNbSeg1.GetNumberOfSegments() +smesh.SetName(hypNbSeg1, "NumberOfSegments_7") + +algoMef1 = mesh.Triangle() +hypArea1 = algoMef1.MaxElementArea(2500) +print hypArea1.GetName() +print hypArea1.GetId() +print hypArea1.GetMaxElementArea() +smesh.SetName(hypArea1, "MaxElementArea_2500") + +# ---- add hypothesis to edge +print "-------------------------- add hypothesis to edge" +edge = salome.IDToObject(idedge) + +algoReg2 = mesh.Segment(edge) +hypLen1 = algoReg2.LocalLength(100) +smesh.SetName(algoReg2.GetSubMesh(), "SubMeshEdge") +print hypLen1.GetName() +print hypLen1.GetId() +print hypLen1.GetLength() +smesh.SetName(hypLen1, "Local_Length_100") + +# ---- add hypothesis to face +print "-------------------------- add hypothesis to face" +face = salome.IDToObject(idface) + +algoMef2 = mesh.Triangle(face) +hypArea2 = algoMef2.MaxElementArea(500) +smesh.SetName(algoMef2.GetSubMesh(), "SubMeshFace") +print hypArea2.GetName() +print hypArea2.GetId() +print hypArea2.GetMaxElementArea() +smesh.SetName(hypArea2, "MaxElementArea_500") + +mesh.Compute() + +salome.sg.updateObjBrowser(1); + +sg = salome.ImportComponentGUI('SMESH') +if type(sg) != type(salome.salome_ComponentGUI): + sg.CreateAndDisplayActor('0:1:2:3') diff --git a/src/SMESH_SWIG/SMESH_test2.py b/src/SMESH_SWIG/SMESH_test2.py index 622f84a77..5203c3255 100644 --- a/src/SMESH_SWIG/SMESH_test2.py +++ b/src/SMESH_SWIG/SMESH_test2.py @@ -27,39 +27,10 @@ from SMESH_test1 import * # ---- compute box print "-------------------------- compute box" -ret = smesh.Compute(mesh,box) +ret = mesh.Compute() print ret log = mesh.GetLog(0); # no erase trace for linelog in log: print linelog -salome.sg.updateObjBrowser(1); - -# ---- compute edge - -##print "-------------------------- compute edge" -##ret=gen.Compute(mesh,idedge) -##print ret -##log=mesh.GetLog(1); -##for a in log: -## print a - -# ---- add hypothesis to face - -# ---- compute face - -#print "-------------------------- compute face" -#ret=gen.Compute(mesh,idface) -#print ret -#log=mesh.GetLog(1); -#for a in log: -# print a - -##shell=salome.IDToObject(ids) -##submesh=mesh.GetElementsOnShape(shell) -##ret=mesh.AddHypothesis(shell,algoReg) -##print ret -##ret=mesh.AddHypothesis(shell,hypLen1) -##print ret -##ret=gen.Compute(mesh,ids) -##print ret +salome.sg.updateObjBrowser(1) diff --git a/src/SMESH_SWIG/SMESH_test4.py b/src/SMESH_SWIG/SMESH_test4.py index d69f455af..18cf85332 100755 --- a/src/SMESH_SWIG/SMESH_test4.py +++ b/src/SMESH_SWIG/SMESH_test4.py @@ -19,11 +19,10 @@ # import salome import geompy -import SMESH -import StdMeshers +import smesh -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) + +# ---- GEOM box = geompy.MakeBox(0., 0., 0., 100., 200., 300.) idbox = geompy.addToStudy(box, "box") @@ -36,35 +35,34 @@ idface = geompy.addToStudyInFather(box, face, name) box = salome.IDToObject(idbox) face = salome.IDToObject(idface) -hyp1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") -hyp1.SetNumberOfSegments(10) -hyp2 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hyp2.SetMaxElementArea(10) -hyp3 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") -hyp3.SetMaxElementArea(100) +# ---- SMESH + +mesh = smesh.Mesh(box, "Meshbox") + +# Set 1D algorithm/hypotheses to mesh +algo1 = mesh.Segment() +algo1.NumberOfSegments(10) -algo1 = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") -algo2 = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") +# Set 2D algorithm/hypotheses to mesh +algo2 = mesh.Triangle(smesh.MEFISTO) +algo2.MaxElementArea(10) -mesh = smesh.CreateMesh(box) -mesh.AddHypothesis(box,hyp1) -mesh.AddHypothesis(box,hyp2) -mesh.AddHypothesis(box,algo1) -mesh.AddHypothesis(box,algo2) +# Create submesh on face +algo3 = mesh.Segment(face) +algo3.NumberOfSegments(10) +algo4 = mesh.Triangle(smesh.MEFISTO, face) +algo4.MaxElementArea(100) +submesh = algo4.GetSubMesh() +smesh.SetName(submesh, "SubMeshFace") -submesh = mesh.GetSubMesh(face, "SubMeshFace") -mesh.AddHypothesis(face,hyp1) -mesh.AddHypothesis(face,hyp3) -mesh.AddHypothesis(face,algo1) -mesh.AddHypothesis(face,algo2) -smesh.Compute(mesh,box) +mesh.Compute() -faces = submesh.GetElementsByType(SMESH.FACE) +faces = submesh.GetElementsByType(smesh.FACE) if len(faces) > 1: print len(faces), len(faces)/2 - group1 = mesh.CreateGroup(SMESH.FACE,"Group of faces") - group2 = mesh.CreateGroup(SMESH.FACE,"Another group of faces") + group1 = mesh.CreateEmptyGroup(smesh.FACE,"Group of faces") + group2 = mesh.CreateEmptyGroup(smesh.FACE,"Another group of faces") group1.Add(faces[:int(len(faces)/2)]) group2.Add(faces[int(len(faces)/2):]) diff --git a/src/SMESH_SWIG/SMESH_test5.py b/src/SMESH_SWIG/SMESH_test5.py index 74a28c6ba..b71a2a58a 100644 --- a/src/SMESH_SWIG/SMESH_test5.py +++ b/src/SMESH_SWIG/SMESH_test5.py @@ -19,11 +19,11 @@ # # # -# File : SMESH_test1.py +# File : SMESH_test5.py # Module : SMESH import salome -import SMESH +import smesh import SALOMEDS import CORBA import os @@ -43,26 +43,21 @@ def ConvertMED2UNV(thePath,theFile) : for iMesh in range(len(aMeshes)) : aMesh = aMeshes[iMesh] - anSObj = salome.ObjectToSObject(aMesh) - print anSObj.GetName(), + print aMesh.GetName(), aFileName = anInitFileName aFileName = os.path.basename(aFileName) - SetSObjName(anSObj,aFileName) - print anSObj.GetName() + aMesh.SetName(aFileName) + print aMesh.GetName() aOutPath = '/tmp/' aFileName = aOutPath + theFile + "." + str(iMesh) + ".unv" aMesh.ExportUNV(aFileName) aMesh = smesh.CreateMeshesFromUNV(aFileName) - anSObj = salome.ObjectToSObject(aMesh) - print anSObj.GetName(), + print aMesh.GetName(), os.remove(aFileName) aFileName = os.path.basename(aFileName) - SetSObjName(anSObj,aFileName) - print anSObj.GetName() - -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) + aMesh.SetName(aFileName) + print aMesh.GetName() aPath = os.getenv('DATA_DIR') + '/MedFiles/' aListDir = os.listdir(aPath) diff --git a/src/SMESH_SWIG/batchmode_mefisto.py b/src/SMESH_SWIG/batchmode_mefisto.py index 58ca97b8c..71a58db8a 100644 --- a/src/SMESH_SWIG/batchmode_mefisto.py +++ b/src/SMESH_SWIG/batchmode_mefisto.py @@ -49,44 +49,44 @@ def CreateMesh (theFileName, area, len = None, nbseg = None): # ---- SMESH + print "-------------------------- create mesh" + mesh = smesh.Mesh(shape_mesh) print "-------------------------- create Hypothesis" if (len is not None): print "-------------------------- LocalLength" - hypLength1 = smesh.CreateHypothesis("LocalLength", "libStdMeshersEngine.so") - hypLength1.SetLength(len) + algoReg = mesh.Segment() + hypLength1 = algoReg.LocalLength(len) print "Hypothesis type : ", hypLength1.GetName() print "Hypothesis ID : ", hypLength1.GetId() print "Hypothesis Value: ", hypLength1.GetLength() if (nbseg is not None): print "-------------------------- NumberOfSegments" - hypNbSeg1 = smesh.CreateHypothesis("NumberOfSegments", "libStdMeshersEngine.so") - hypNbSeg1.SetNumberOfSegments(nbseg) + algoReg = mesh.Segment() + hypNbSeg1 = algoReg.NumberOfSegments(nbseg) print "Hypothesis type : ", hypNbSeg1.GetName() print "Hypothesis ID : ", hypNbSeg1.GetId() print "Hypothesis Value: ", hypNbSeg1.GetNumberOfSegments() if (area == "LengthFromEdges"): print "-------------------------- LengthFromEdges" - hypLengthFromEdges = smesh.CreateHypothesis("LengthFromEdges", "libStdMeshersEngine.so") - hypLengthFromEdges.SetMode(1) + algoMef = mesh.Triangle() + hypLengthFromEdges = algoMef.LengthFromEdges(1) print "Hypothesis type : ", hypLengthFromEdges.GetName() print "Hypothesis ID : ", hypLengthFromEdges.GetId() print "LengthFromEdges Mode: ", hypLengthFromEdges.GetMode() else: print "-------------------------- MaxElementArea" - hypArea1 = smesh.CreateHypothesis("MaxElementArea", "libStdMeshersEngine.so") - hypArea1.SetMaxElementArea(area) + algoMef = mesh.Triangle() + hypArea1 = algoMef.MaxElementArea(area) print "Hypothesis type : ", hypArea1.GetName() print "Hypothesis ID : ", hypArea1.GetId() print "Hypothesis Value: ", hypArea1.GetMaxElementArea() print "-------------------------- Regular_1D" - algoReg = smesh.CreateHypothesis("Regular_1D", "libStdMeshersEngine.so") - listHyp = algoReg.GetCompatibleHypothesis() for hyp in listHyp: print hyp @@ -95,8 +95,6 @@ def CreateMesh (theFileName, area, len = None, nbseg = None): print "Algo ID : ", algoReg.GetId() print "-------------------------- MEFISTO_2D" - algoMef = smesh.CreateHypothesis("MEFISTO_2D", "libStdMeshersEngine.so") - listHyp = algoMef.GetCompatibleHypothesis() for hyp in listHyp: print hyp @@ -107,38 +105,8 @@ def CreateMesh (theFileName, area, len = None, nbseg = None): # ---- add hypothesis to shape - print "-------------------------- add hypothesis to shape" - mesh = smesh.CreateMesh(shape_mesh) - - ret = mesh.AddHypothesis(shape_mesh, algoReg) - print "Add Regular_1D algo .... ", - print ret - - if (nbseg is not None): - ret = mesh.AddHypothesis(shape_mesh, hypNbSeg1) - print "Add Number Of Segements algo .... ", - print ret - - if (len is not None): - ret = mesh.AddHypothesis(shape_mesh,hypLength1) - print "Add Local Length algo .... ", - print ret - - ret = mesh.AddHypothesis(shape_mesh, algoMef) - print "Add MEFISTO_2D algo....", - print ret - - if (area == "LengthFromEdges"): - ret = mesh.AddHypothesis( shape_mesh, hypLengthFromEdges) # length from edge - print "Add Length From Edges algo .... ", - print ret - else: - ret = mesh.AddHypothesis(shape_mesh, hypArea1) - print "Add Max Triangle Area algo .... ", - print ret - print "-------------------------- compute mesh" - ret = smesh.Compute(mesh,shape_mesh) + ret = mesh.Compute() print "Compute Mesh .... ", print ret log = mesh.GetLog(0); # no erase trace diff --git a/src/SMESH_SWIG/ex19_sphereINcube.py b/src/SMESH_SWIG/ex19_sphereINcube.py index 02357b0f4..ec5f5d398 100644 --- a/src/SMESH_SWIG/ex19_sphereINcube.py +++ b/src/SMESH_SWIG/ex19_sphereINcube.py @@ -23,6 +23,7 @@ from geompy import * import smesh +import geompy # Geometrie # ========= @@ -59,13 +60,30 @@ blocs = [boite] sphere_troue = MakeCut(sphere_pleine, boite) -sphere_outils = [] -sphere_outils.append(MakePlane(sphere_centre, MakeVectorDXDYDZ( 1, 0, 1), plan_trim)) -sphere_outils.append(MakePlane(sphere_centre, MakeVectorDXDYDZ( 1, 0, -1), plan_trim)) -sphere_outils.append(MakePlane(sphere_centre, MakeVectorDXDYDZ( 1, 1, 0), plan_trim)) -sphere_outils.append(MakePlane(sphere_centre, MakeVectorDXDYDZ(-1, 1, 0), plan_trim)) +#sphere_outils = [] +#sphere_outils.append(MakePlane(sphere_centre, MakeVectorDXDYDZ( 1, 0, 1), plan_trim)) +#sphere_outils.append(MakePlane(sphere_centre, MakeVectorDXDYDZ( 1, 0, -1), plan_trim)) +#sphere_outils.append(MakePlane(sphere_centre, MakeVectorDXDYDZ( 1, 1, 0), plan_trim)) +#sphere_outils.append(MakePlane(sphere_centre, MakeVectorDXDYDZ(-1, 1, 0), plan_trim)) -sphere_decoupee = MakePartition([sphere_troue], sphere_outils, [], [], ShapeType["SOLID"]) +f1 = MakePlane(sphere_centre, MakeVectorDXDYDZ( 1, 0, 1), plan_trim) +f2 = MakePlane(sphere_centre, MakeVectorDXDYDZ(-1, 1, 0), plan_trim) +f3 = MakePlane(sphere_centre, MakeVectorDXDYDZ( 1, 1, 0), plan_trim) +f4 = MakePlane(sphere_centre, MakeVectorDXDYDZ( 1, 0, -1), plan_trim) + + +#sphere_decoupee = MakePartition(solids, sphere_outils, [], [], ShapeType["SOLID"]) +solids = geompy.SubShapeAll(sphere_troue,geompy.ShapeType["SOLID"]) +sphere_decoupee = MakePartition(solids, [f1], [], [], ShapeType["SOLID"]) +solids = geompy.SubShapeAll(sphere_decoupee,geompy.ShapeType["SOLID"]) +sphere_decoupee = MakePartition(solids, [f2], [], [], ShapeType["SOLID"]) +solids = geompy.SubShapeAll(sphere_decoupee,geompy.ShapeType["SOLID"]) +sphere_decoupee = MakePartition(solids, [f3], [], [], ShapeType["SOLID"]) +solids = geompy.SubShapeAll(sphere_decoupee,geompy.ShapeType["SOLID"]) +sphere_decoupee = MakePartition(solids, [f4], [], [], ShapeType["SOLID"]) +solids = geompy.SubShapeAll(sphere_decoupee,geompy.ShapeType["SOLID"]) + +sphere_partie = geompy.MakeCompound(solids) sphere_partie = GetBlockNearPoint(sphere_decoupee, MakeVertex(-sphere_rayon, 0, 0)) sphere_bloc = RemoveExtraEdges(sphere_partie) @@ -90,7 +108,21 @@ blocs.append(MakeMirrorByPoint(sphere_bloc, sphere_centre)) cube_plein = MakeBox(-cube_cote, -cube_cote, -cube_cote, +cube_cote, +cube_cote, +cube_cote) cube_trou = MakeCut(cube_plein, sphere_pleine) -cube_decoupe = MakePartition([cube_trou], sphere_outils, [], [], ShapeType["SOLID"]) +#cube_decoupe = MakePartition([cube_trou], sphere_outils, [], [], ShapeType["SOLID"]) + +solids = geompy.SubShapeAll(cube_trou,geompy.ShapeType["SOLID"]) +cube_decoupe = MakePartition(solids, [f1], [], [], ShapeType["SOLID"]) +solids = geompy.SubShapeAll(cube_decoupe,geompy.ShapeType["SOLID"]) +cube_decoupe = MakePartition(solids, [f2], [], [], ShapeType["SOLID"]) +solids = geompy.SubShapeAll(cube_decoupe,geompy.ShapeType["SOLID"]) +cube_decoupe = MakePartition(solids, [f3], [], [], ShapeType["SOLID"]) +solids = geompy.SubShapeAll(cube_decoupe,geompy.ShapeType["SOLID"]) +cube_decoupe = MakePartition(solids, [f4], [], [], ShapeType["SOLID"]) +solids = geompy.SubShapeAll(cube_decoupe,geompy.ShapeType["SOLID"]) + +cube_decoupe = geompy.MakeCompound(solids) + + cube_partie = GetBlockNearPoint(cube_decoupe, MakeVertex(-cube_cote, 0, 0)) cube_bloc = RemoveExtraEdges(cube_partie) diff --git a/src/SMESH_SWIG/smesh.py b/src/SMESH_SWIG/smesh.py index 82d0750e5..a0b09b3da 100644 --- a/src/SMESH_SWIG/smesh.py +++ b/src/SMESH_SWIG/smesh.py @@ -28,22 +28,56 @@ import salome import geompy -import StdMeshers + import SMESH +from SMESH import * +import StdMeshers +# import NETGENPlugin module if possible +noNETGENPlugin = 0 +try: + import NETGENPlugin +except ImportError: + noNETGENPlugin = 1 + pass + +# Types of algo REGULAR = 1 PYTHON = 2 -NETGEN = 3 -GHS3D = 4 +MEFISTO = 3 +NETGEN = 4 +GHS3D = 5 +FULL_NETGEN = 6 -smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") -smesh.SetCurrentStudy(salome.myStudy) +# MirrorType enumeration +POINT = SMESH_MeshEditor.POINT +AXIS = SMESH_MeshEditor.AXIS +PLANE = SMESH_MeshEditor.PLANE + +# Smooth_Method enumeration +LAPLACIAN_SMOOTH = SMESH_MeshEditor.LAPLACIAN_SMOOTH +CENTROIDAL_SMOOTH = SMESH_MeshEditor.CENTROIDAL_SMOOTH + +# Fineness enumeration(for NETGEN) +VeryCoarse = 0 +Coarse = 1 +Moderate = 2 +Fine = 3 +VeryFine = 4 +Custom = 5 NO_NAME = "NoName" + +smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") +smesh.SetCurrentStudy(salome.myStudy) + +# Global functions + +## Gets object name def GetName(obj): ior = salome.orb.object_to_string(obj) sobj = salome.myStudy.FindObjectIOR(ior) @@ -53,13 +87,264 @@ def GetName(obj): attr = sobj.FindAttribute("AttributeName")[1] return attr.Value() +## Sets name to object def SetName(obj, name): ior = salome.orb.object_to_string(obj) sobj = salome.myStudy.FindObjectIOR(ior) if not sobj is None: attr = sobj.FindAttribute("AttributeName")[1] attr.SetValue(name) + +## Returns long value from enumeration +# Uses for SMESH.FunctorType enumeration +def EnumToLong(theItem): + return theItem._v + +## Get PointStruct from vertex +# @param theVertex is GEOM object(vertex) +# @return SMESH.PointStruct +def GetPointStruct(theVertex): + [x, y, z] = geompy.PointCoordinates(theVertex) + return PointStruct(x,y,z) + +## Get DirStruct from vector +# @param theVector is GEOM object(vector) +# @return SMESH.DirStruct +def GetDirStruct(theVector): + vertices = geompy.SubShapeAll( theVector, geompy.ShapeType["VERTEX"] ) + if(len(vertices) != 2): + print "Error: vector object is incorrect." + return None + p1 = geompy.PointCoordinates(vertices[0]) + p2 = geompy.PointCoordinates(vertices[1]) + pnt = PointStruct(p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]) + dir = DirStruct(pnt) + return dir + +## Get AxisStruct from object +# @param theObj is GEOM object(line or plane) +# @return SMESH.AxisStruct +def GetAxisStruct(theObj): + edges = geompy.SubShapeAll( theObj, geompy.ShapeType["EDGE"] ) + if len(edges) > 1: + vertex1, vertex2 = geompy.SubShapeAll( edges[0], geompy.ShapeType["VERTEX"] ) + vertex3, vertex4 = geompy.SubShapeAll( edges[1], geompy.ShapeType["VERTEX"] ) + vertex1 = geompy.PointCoordinates(vertex1) + vertex2 = geompy.PointCoordinates(vertex2) + vertex3 = geompy.PointCoordinates(vertex3) + vertex4 = geompy.PointCoordinates(vertex4) + v1 = [vertex2[0]-vertex1[0], vertex2[1]-vertex1[1], vertex2[2]-vertex1[2]] + v2 = [vertex4[0]-vertex3[0], vertex4[1]-vertex3[1], vertex4[2]-vertex3[2]] + normal = [ v1[1]*v2[2]-v2[1]*v1[2], v1[2]*v2[0]-v2[2]*v1[0], v1[0]*v2[1]-v2[0]*v1[1] ] + axis = AxisStruct(vertex1[0], vertex1[1], vertex1[2], normal[0], normal[1], normal[2]) + return axis + elif len(edges) == 1: + vertex1, vertex2 = geompy.SubShapeAll( edges[0], geompy.ShapeType["VERTEX"] ) + p1 = geompy.PointCoordinates( vertex1 ) + p2 = geompy.PointCoordinates( vertex2 ) + axis = AxisStruct(p1[0], p1[1], p1[2], p2[0]-p1[0], p2[1]-p1[1], p2[2]-p1[2]) + return axis + return None + +# From SMESH_Gen interface: +# ------------------------ + +## Set the current mode +def SetEmbeddedMode( theMode ): + smesh.SetEmbeddedMode(theMode) + +## Get the current mode +def IsEmbeddedMode(): + return smesh.IsEmbeddedMode() + +## Set the current study +def SetCurrentStudy( theStudy ): + smesh.SetCurrentStudy(theStudy) + +## Get the current study +def GetCurrentStudy(): + return smesh.GetCurrentStudy() + +## Create Mesh object importing data from given UNV file +# @return an instance of Mesh class +def CreateMeshesFromUNV( theFileName ): + aSmeshMesh = smesh.CreateMeshesFromUNV(theFileName) + aMesh = Mesh(aSmeshMesh) + return aMesh + +## Create Mesh object(s) importing data from given MED file +# @return a list of Mesh class instances +def CreateMeshesFromMED( theFileName ): + aSmeshMeshes, aStatus = smesh.CreateMeshesFromMED(theFileName) + aMeshes = [] + for iMesh in range(len(aSmeshMeshes)) : + aMesh = Mesh(aSmeshMeshes[iMesh]) + aMeshes.append(aMesh) + return aMeshes, aStatus + +## Create Mesh object importing data from given STL file +# @return an instance of Mesh class +def CreateMeshesFromSTL( theFileName ): + aSmeshMesh = smesh.CreateMeshesFromSTL(theFileName) + aMesh = Mesh(aSmeshMesh) + return aMesh + +## From SMESH_Gen interface +def GetSubShapesId( theMainObject, theListOfSubObjects ): + return smesh.GetSubShapesId(theMainObject, theListOfSubObjects) + +## From SMESH_Gen interface. Creates pattern +def GetPattern(): + return smesh.GetPattern() + + + +# Filtering. Auxiliary functions: +# ------------------------------ + +## Creates an empty criterion +# @return SMESH.Filter.Criterion +def GetEmptyCriterion(): + Type = EnumToLong(FT_Undefined) + Compare = EnumToLong(FT_Undefined) + Threshold = 0 + ThresholdStr = "" + ThresholdID = "" + UnaryOp = EnumToLong(FT_Undefined) + BinaryOp = EnumToLong(FT_Undefined) + Tolerance = 1e-07 + TypeOfElement = ALL + Precision = -1 ##@1e-07 + return Filter.Criterion(Type, Compare, Threshold, ThresholdStr, ThresholdID, + UnaryOp, BinaryOp, Tolerance, TypeOfElement, Precision) + +## Creates a criterion by given parameters +# @param elementType is the type of elements(NODE, EDGE, FACE, VOLUME) +# @param CritType is type of criterion( FT_Taper, FT_Area, FT_RangeOfIds, FT_LyingOnGeom etc. ) +# @param Compare belong to {FT_LessThan, FT_MoreThan, FT_EqualTo} +# @param Treshold is threshold value (range of ids as string, shape, numeric) +# @param UnaryOp is FT_LogicalNOT or FT_Undefined +# @param BinaryOp is binary logical operation FT_LogicalAND, FT_LogicalOR or +# FT_Undefined(must be for the last criterion in criteria) +# @return SMESH.Filter.Criterion +def GetCriterion(elementType, + CritType, + Compare = FT_EqualTo, + Treshold="", + UnaryOp=FT_Undefined, + BinaryOp=FT_Undefined): + aCriterion = GetEmptyCriterion() + aCriterion.TypeOfElement = elementType + aCriterion.Type = EnumToLong(CritType) + + aTreshold = Treshold + + if Compare in [FT_LessThan, FT_MoreThan, FT_EqualTo]: + aCriterion.Compare = EnumToLong(Compare) + else: + aCriterion.Compare = EnumToLong(FT_EqualTo) + aTreshold = Compare + + if CritType in [FT_BelongToGeom, FT_BelongToPlane, + FT_BelongToCylinder, FT_LyingOnGeom]: + # Check treshold + if isinstance(aTreshold, geompy.GEOM._objref_GEOM_Object): + aCriterion.ThresholdStr = GetName(aTreshold) + aCriterion.ThresholdID = salome.ObjectToID(aTreshold) + else: + print "Error: Treshold should be a shape." + return None + elif CritType == FT_RangeOfIds: + # Check treshold + if isinstance(aTreshold, str): + aCriterion.ThresholdStr = aTreshold + else: + print "Error: Treshold should be a string." + return None + elif CritType in [FT_FreeBorders, FT_FreeEdges, FT_BadOrientedVolume]: + # Here we don't need treshold + if aTreshold == FT_LogicalNOT: + aCriterion.UnaryOp = EnumToLong(FT_LogicalNOT) + elif aTreshold in [FT_LogicalAND, FT_LogicalOR]: + aCriterion.BinaryOp = aTreshold + else: + # Check treshold + try: + aTreshold = float(aTreshold) + aCriterion.Threshold = aTreshold + except: + print "Error: Treshold should be a number." + return None + + if Treshold == FT_LogicalNOT or UnaryOp == FT_LogicalNOT: + aCriterion.UnaryOp = EnumToLong(FT_LogicalNOT) + + if Treshold in [FT_LogicalAND, FT_LogicalOR]: + aCriterion.BinaryOp = EnumToLong(Treshold) + + if UnaryOp in [FT_LogicalAND, FT_LogicalOR]: + aCriterion.BinaryOp = EnumToLong(UnaryOp) + + if BinaryOp in [FT_LogicalAND, FT_LogicalOR]: + aCriterion.BinaryOp = EnumToLong(BinaryOp) + + return aCriterion + +## Creates filter by given parameters of criterion +# @param elementType is the type of elements in the group +# @param CritType is type of criterion( FT_Taper, FT_Area, FT_RangeOfIds, FT_LyingOnGeom etc. ) +# @param Compare belong to {FT_LessThan, FT_MoreThan, FT_EqualTo} +# @param Treshold is threshold value (range of id ids as string, shape, numeric) +# @param UnaryOp is FT_LogicalNOT or FT_Undefined +# @return SMESH_Filter +def GetFilter(elementType, + CritType=FT_Undefined, + Compare=FT_EqualTo, + Treshold="", + UnaryOp=FT_Undefined): + aCriterion = GetCriterion(elementType, CritType, Compare, Treshold, UnaryOp, FT_Undefined) + aFilterMgr = smesh.CreateFilterManager() + aFilter = aFilterMgr.CreateFilter() + aCriteria = [] + aCriteria.append(aCriterion) + aFilter.SetCriteria(aCriteria) + return aFilter + +## Creates numerical functor by its type +# @param theCrierion is FT_...; functor type +# @return SMESH_NumericalFunctor +def GetFunctor(theCriterion): + aFilterMgr = smesh.CreateFilterManager() + if theCriterion == FT_AspectRatio: + return aFilterMgr.CreateAspectRatio() + elif theCriterion == FT_AspectRatio3D: + return aFilterMgr.CreateAspectRatio3D() + elif theCriterion == FT_Warping: + return aFilterMgr.CreateWarping() + elif theCriterion == FT_MinimumAngle: + return aFilterMgr.CreateMinimumAngle() + elif theCriterion == FT_Taper: + return aFilterMgr.CreateTaper() + elif theCriterion == FT_Skew: + return aFilterMgr.CreateSkew() + elif theCriterion == FT_Area: + return aFilterMgr.CreateArea() + elif theCriterion == FT_Volume3D: + return aFilterMgr.CreateVolume3D() + elif theCriterion == FT_MultiConnection: + return aFilterMgr.CreateMultiConnection() + elif theCriterion == FT_MultiConnection2D: + return aFilterMgr.CreateMultiConnection2D() + elif theCriterion == FT_Length: + return aFilterMgr.CreateLength() + elif theCriterion == FT_Length2D: + return aFilterMgr.CreateLength2D() + else: + print "Error: given parameter is not numerucal functor type." + + + ## Mother class to define algorithm, recommended to don't use directly. # # More details. @@ -72,10 +357,8 @@ class Mesh_Algorithm: subm = 0 algo = 0 - ## If the algorithm is global, return 0 - # \fn else return the submesh associated to this algorithm. - # - # More details. + ## If the algorithm is global, return 0; \n + # else return the submesh associated to this algorithm. def GetSubMesh(self): return self.subm @@ -83,36 +366,57 @@ class Mesh_Algorithm: def GetAlgorithm(self): return self.algo + ## Get list of hypothesis that can be used with this algorithm + def GetCompatibleHypothesis(self): + list = [] + if self.algo: + list = self.algo.GetCompatibleHypothesis() + return list + + ## Get name of algo + def GetName(self): + GetName(self.algo) + + ## Set name to algo + def SetName(self, name): + SetName(self.algo, name) + + ## Get id of algo + def GetId(self): + return self.algo.GetId() + ## Private method. Print error message if a hypothesis was not assigned. def TreatHypoStatus(self, status, hypName, geomName, isAlgo): if isAlgo: hypType = "algorithm" else: hypType = "hypothesis" - if status == SMESH.HYP_UNKNOWN_FATAL : + if status == HYP_UNKNOWN_FATAL : reason = "for unknown reason" - elif status == SMESH.HYP_INCOMPATIBLE : + elif status == HYP_INCOMPATIBLE : reason = "this hypothesis mismatches algorithm" - elif status == SMESH.HYP_NOTCONFORM : + elif status == HYP_NOTCONFORM : reason = "not conform mesh would be built" - elif status == SMESH.HYP_ALREADY_EXIST : + elif status == HYP_ALREADY_EXIST : reason = hypType + " of the same dimension already assigned to this shape" - elif status == SMESH.HYP_BAD_DIM : + elif status == HYP_BAD_DIM : reason = hypType + " mismatches shape" - elif status == SMESH.HYP_CONCURENT : + elif status == HYP_CONCURENT : reason = "there are concurrent hypotheses on sub-shapes" - elif status == SMESH.HYP_BAD_SUBSHAPE : + elif status == HYP_BAD_SUBSHAPE : reason = "shape is neither the main one, nor its subshape, nor a valid group" + elif status == HYP_BAD_GEOMETRY: + reason = "geometry mismatches algorithm's expectation" else: return hypName = '"' + hypName + '"' geomName= '"' + geomName+ '"' - if status < SMESH.HYP_UNKNOWN_FATAL: + if status < HYP_UNKNOWN_FATAL: print hypName, "was assigned to", geomName,"but", reason else: print hypName, "was not assigned to",geomName,":", reason pass - + ## Private method. def Create(self, mesh, geom, hypo, so="libStdMeshersEngine.so"): if geom is None: @@ -134,7 +438,7 @@ class Mesh_Algorithm: SetName(self.algo, name + "/" + hypo) status = mesh.mesh.AddHypothesis(self.geom, self.algo) self.TreatHypoStatus( status, hypo, name, 1 ) - + ## Private method def Hypothesis(self, hyp, args=[], so="libStdMeshersEngine.so"): hypo = smesh.CreateHypothesis(hyp, so) @@ -152,6 +456,7 @@ class Mesh_Algorithm: self.TreatHypoStatus( status, hyp, name, 0 ) return hypo + # Public class: Mesh_Segment # -------------------------- @@ -163,14 +468,14 @@ class Mesh_Segment(Mesh_Algorithm): ## Private constructor. def __init__(self, mesh, geom=0): self.Create(mesh, geom, "Regular_1D") - + ## Define "LocalLength" hypothesis to cut an edge in several segments with the same length # @param l for the length of segments that cut an edge def LocalLength(self, l): hyp = self.Hypothesis("LocalLength", [l]) hyp.SetLength(l) return hyp - + ## Define "NumberOfSegments" hypothesis to cut an edge in several fixed number of segments # @param n for the number of segments that cut an edge # @param s for the scale factor (optional) @@ -183,7 +488,7 @@ class Mesh_Segment(Mesh_Algorithm): hyp.SetScaleFactor(s) hyp.SetNumberOfSegments(n) return hyp - + ## Define "Arithmetic1D" hypothesis to cut an edge in several segments with arithmetic length increasing # @param start for the length of the first segment # @param end for the length of the last segment @@ -192,7 +497,7 @@ class Mesh_Segment(Mesh_Algorithm): hyp.SetLength(start, 1) hyp.SetLength(end , 0) return hyp - + ## Define "StartEndLength" hypothesis to cut an edge in several segments with geometric length increasing # @param start for the length of the first segment # @param end for the length of the last segment @@ -201,14 +506,14 @@ class Mesh_Segment(Mesh_Algorithm): hyp.SetLength(start, 1) hyp.SetLength(end , 0) return hyp - + ## Define "Deflection1D" hypothesis # @param d for the deflection def Deflection1D(self, d): hyp = self.Hypothesis("Deflection1D", [d]) hyp.SetDeflection(d) return hyp - + ## Define "Propagation" hypothesis that propagate all other hypothesis on all others edges that are in # the opposite side in the case of quadrangular faces def Propagation(self): @@ -243,7 +548,7 @@ class Mesh_Segment_Python(Mesh_Segment): def __init__(self, mesh, geom=0): import Python1dPlugin self.Create(mesh, geom, "Python_1D", "libPython1dEngine.so") - + ## Define "PythonSplit1D" hypothesis based on the Erwan Adam patch, awaiting equivalent SALOME functionality # @param n for the number of segments that cut an edge # @param func for the python function that calculate the length of all segments @@ -252,7 +557,7 @@ class Mesh_Segment_Python(Mesh_Segment): hyp.SetNumberOfSegments(n) hyp.SetPythonLog10RatioFunction(func) return hyp - + # Public class: Mesh_Triangle # --------------------------- @@ -261,21 +566,99 @@ class Mesh_Segment_Python(Mesh_Segment): # More details. class Mesh_Triangle(Mesh_Algorithm): + algoType = 0 + params = 0 + ## Private constructor. - def __init__(self, mesh, geom=0): - self.Create(mesh, geom, "MEFISTO_2D") + def __init__(self, mesh, algoType, geom=0): + if algoType == MEFISTO: + self.Create(mesh, geom, "MEFISTO_2D") + elif algoType == NETGEN: + if noNETGENPlugin: + print "Warning: NETGENPlugin module has not been imported." + self.Create(mesh, geom, "NETGEN_2D", "libNETGENEngine.so") + self.algoType = algoType ## Define "MaxElementArea" hypothesis to give the maximun area of each triangles # @param area for the maximum area of each triangles def MaxElementArea(self, area): - hyp = self.Hypothesis("MaxElementArea", [area]) - hyp.SetMaxElementArea(area) - return hyp - + if self.algoType == MEFISTO: + hyp = self.Hypothesis("MaxElementArea", [area]) + hyp.SetMaxElementArea(area) + return hyp + elif self.algoType == NETGEN: + print "Netgen 1D-2D algo doesn't support this hypothesis" + return None + ## Define "LengthFromEdges" hypothesis to build triangles based on the length of the edges taken from the wire def LengthFromEdges(self): - return self.Hypothesis("LengthFromEdges") - + if self.algoType == MEFISTO: + hyp = self.Hypothesis("LengthFromEdges") + return hyp + elif self.algoType == NETGEN: + print "Netgen 1D-2D algo doesn't support this hypothesis" + return None + + ## Define "Netgen 2D Parameters" hypothesis + def Parameters(self): + if self.algoType == NETGEN: + self.params = self.Hypothesis("NETGEN_Parameters_2D", [], "libNETGENEngine.so") + return self.params + elif self.algoType == MEFISTO: + print "Mefisto algo doesn't support this hypothesis" + return None + + ## Set MaxSize + def SetMaxSize(self, theSize): + if self.params == 0: + self.Parameters() + self.params.SetMaxSize(theSize) + + ## Set SecondOrder flag + def SetSecondOrder(seld, theVal): + if self.params == 0: + self.Parameters() + self.params.SetSecondOrder(theVal) + + ## Set Optimize flag + def SetOptimize(self, theVal): + if self.params == 0: + self.Parameters() + self.params.SetOptimize(theVal) + + ## Set Fineness + # @param theFineness is: + # VeryCoarse, Coarse, Moderate, Fine, VeryFine or Custom + def SetFineness(self, theFineness): + if self.params == 0: + self.Parameters() + self.params.SetFineness(theFineness) + + ## Set GrowthRate + def SetGrowthRate(self, theRate): + if self.params == 0: + self.Parameters() + self.params.SetGrowthRate(theRate) + + ## Set NbSegPerEdge + def SetNbSegPerEdge(self, theVal): + if self.params == 0: + self.Parameters() + self.params.SetNbSegPerEdge(theVal) + + ## Set NbSegPerRadius + def SetNbSegPerRadius(self, theVal): + if self.params == 0: + self.Parameters() + self.params.SetNbSegPerRadius(theVal) + + ## Set QuadAllowed flag + def SetQuadAllowed(self, toAllow): + if self.params == 0: + self.Parameters() + self.params.SetQuadAllowed(toAllow) + + # Public class: Mesh_Quadrangle # ----------------------------- @@ -287,14 +670,14 @@ class Mesh_Quadrangle(Mesh_Algorithm): ## Private constructor. def __init__(self, mesh, geom=0): self.Create(mesh, geom, "Quadrangle_2D") - + ## Define "QuadranglePreference" hypothesis, forcing construction # of quadrangles if the number of nodes on opposite edges is not the same # in the case where the global number of nodes on edges is even def QuadranglePreference(self): hyp = self.Hypothesis("QuadranglePreference") return hyp - + # Public class: Mesh_Tetrahedron # ------------------------------ @@ -303,13 +686,21 @@ class Mesh_Quadrangle(Mesh_Algorithm): # More details. class Mesh_Tetrahedron(Mesh_Algorithm): + params = 0 + algoType = 0 + ## Private constructor. - def __init__(self, mesh, algo, geom=0): - if algo == NETGEN: + def __init__(self, mesh, algoType, geom=0): + if algoType == NETGEN: self.Create(mesh, geom, "NETGEN_3D", "libNETGENEngine.so") - elif algo == GHS3D: + elif algoType == GHS3D: import GHS3DPlugin self.Create(mesh, geom, "GHS3D_3D" , "libGHS3DEngine.so") + elif algoType == FULL_NETGEN: + if noNETGENPlugin: + print "Warning: NETGENPlugin module has not been imported." + self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so") + self.algoType = algoType ## Define "MaxElementVolume" hypothesis to give the maximun volume of each tetrahedral # @param vol for the maximum volume of each tetrahedral @@ -318,6 +709,59 @@ class Mesh_Tetrahedron(Mesh_Algorithm): hyp.SetMaxElementVolume(vol) return hyp + ## Define "Netgen 3D Parameters" hypothesis + def Parameters(self): + if (self.algoType == FULL_NETGEN): + self.params = self.Hypothesis("NETGEN_Parameters", [], "libNETGENEngine.so") + return self.params + else: + print "Algo doesn't support this hypothesis" + return None + + ## Set MaxSize + def SetMaxSize(self, theSize): + if self.params == 0: + self.Parameters() + self.params.SetMaxSize(theSize) + + ## Set SecondOrder flag + def SetSecondOrder(self, theVal): + if self.params == 0: + self.Parameters() + self.params.SetSecondOrder(theVal) + + ## Set Optimize flag + def SetOptimize(self, theVal): + if self.params == 0: + self.Parameters() + self.params.SetOptimize(theVal) + + ## Set Fineness + # @param theFineness is: + # VeryCoarse, Coarse, Moderate, Fine, VeryFine or Custom + def SetFineness(self, theFineness): + if self.params == 0: + self.Parameters() + self.params.SetFineness(theFineness) + + ## Set GrowthRate + def SetGrowthRate(self, theRate): + if self.params == 0: + self.Parameters() + self.params.SetGrowthRate(theRate) + + ## Set NbSegPerEdge + def SetNbSegPerEdge(self, theVal): + if self.params == 0: + self.Parameters() + self.params.SetNbSegPerEdge(theVal) + + ## Set NbSegPerRadius + def SetNbSegPerRadius(self, theVal): + if self.params == 0: + self.Parameters() + self.params.SetNbSegPerRadius(theVal) + # Public class: Mesh_Hexahedron # ------------------------------ @@ -330,12 +774,15 @@ class Mesh_Hexahedron(Mesh_Algorithm): def __init__(self, mesh, geom=0): self.Create(mesh, geom, "Hexa_3D") +# Deprecated, only for compatibility! # Public class: Mesh_Netgen # ------------------------------ ## Class to define a NETGEN-based 2D or 3D algorithm # that need no discrete boundary (i.e. independent) # +# This class is deprecated, only for compatibility! +# # More details. class Mesh_Netgen(Mesh_Algorithm): @@ -343,6 +790,9 @@ class Mesh_Netgen(Mesh_Algorithm): ## Private constructor. def __init__(self, mesh, is3D, geom=0): + if noNETGENPlugin: + print "Warning: NETGENPlugin module has not been imported." + self.is3D = is3D if is3D: self.Create(mesh, geom, "NETGEN_2D3D", "libNETGENEngine.so") @@ -357,39 +807,305 @@ class Mesh_Netgen(Mesh_Algorithm): hyp = self.Hypothesis("NETGEN_Parameters_2D", [], "libNETGENEngine.so") return hyp +# Public class: Mesh_Projection1D +# ------------------------------ + +## Class to define a projection 1D algorithm +# +# More details. +class Mesh_Projection1D(Mesh_Algorithm): + + ## Private constructor. + def __init__(self, mesh, geom=0): + self.Create(mesh, geom, "Projection_1D") + + ## Define "Source Edge" hypothesis, specifying a meshed edge to + # take a mesh pattern from, and optionally association of vertices + # between the source edge and a target one (where a hipothesis is assigned to) + # @param edge to take nodes distribution from + # @param mesh to take nodes distribution from (optional) + # @param srcV is vertex of \a edge to associate with \a tgtV (optional) + # @param tgtV is vertex of \a the edge where the algorithm is assigned, + # to associate with \a srcV (optional) + def SourceEdge(self, edge, mesh=None, srcV=None, tgtV=None): + hyp = self.Hypothesis("ProjectionSource1D") + hyp.SetSourceEdge( edge ) + if not mesh is None and isinstance(mesh, Mesh): + mesh = mesh.GetMesh() + hyp.SetSourceMesh( mesh ) + hyp.SetVertexAssociation( srcV, tgtV ) + return hyp + + +# Public class: Mesh_Projection2D +# ------------------------------ + +## Class to define a projection 2D algorithm +# +# More details. +class Mesh_Projection2D(Mesh_Algorithm): + + ## Private constructor. + def __init__(self, mesh, geom=0): + self.Create(mesh, geom, "Projection_2D") + + ## Define "Source Face" hypothesis, specifying a meshed face to + # take a mesh pattern from, and optionally association of vertices + # between the source face and a target one (where a hipothesis is assigned to) + # @param face to take mesh pattern from + # @param mesh to take mesh pattern from (optional) + # @param srcV1 is vertex of \a face to associate with \a tgtV1 (optional) + # @param tgtV1 is vertex of \a the face where the algorithm is assigned, + # to associate with \a srcV1 (optional) + # @param srcV2 is vertex of \a face to associate with \a tgtV1 (optional) + # @param tgtV2 is vertex of \a the face where the algorithm is assigned, + # to associate with \a srcV2 (optional) + # + # Note: association vertices must belong to one edge of a face + def SourceFace(self, face, mesh=None, srcV1=None, tgtV1=None, srcV2=None, tgtV2=None): + hyp = self.Hypothesis("ProjectionSource2D") + hyp.SetSourceFace( face ) + if not mesh is None and isinstance(mesh, Mesh): + mesh = mesh.GetMesh() + hyp.SetSourceMesh( mesh ) + hyp.SetVertexAssociation( srcV1, srcV2, tgtV1, tgtV2 ) + return hyp + +# Public class: Mesh_Projection3D +# ------------------------------ + +## Class to define a projection 3D algorithm +# +# More details. +class Mesh_Projection3D(Mesh_Algorithm): + + ## Private constructor. + def __init__(self, mesh, geom=0): + self.Create(mesh, geom, "Projection_3D") + + ## Define "Source Shape 3D" hypothesis, specifying a meshed solid to + # take a mesh pattern from, and optionally association of vertices + # between the source solid and a target one (where a hipothesis is assigned to) + # @param solid to take mesh pattern from + # @param mesh to take mesh pattern from (optional) + # @param srcV1 is vertex of \a solid to associate with \a tgtV1 (optional) + # @param tgtV1 is vertex of \a the solid where the algorithm is assigned, + # to associate with \a srcV1 (optional) + # @param srcV2 is vertex of \a solid to associate with \a tgtV1 (optional) + # @param tgtV2 is vertex of \a the solid where the algorithm is assigned, + # to associate with \a srcV2 (optional) + # + # Note: association vertices must belong to one edge of a solid + def SourceShape3D(self, solid, mesh=0, srcV1=0, tgtV1=0, srcV2=0, tgtV2=0): + hyp = self.Hypothesis("ProjectionSource3D") + hyp.SetSource3DShape( solid ) + if not mesh is None and isinstance(mesh, Mesh): + mesh = mesh.GetMesh() + hyp.SetSourceMesh( mesh ) + hyp.SetVertexAssociation( srcV1, srcV2, tgtV1, tgtV2 ) + return hyp + + +# Public class: Mesh_Prism +# ------------------------ + +## Class to define a Prism 3D algorithm +# +# More details. +class Mesh_Prism3D(Mesh_Algorithm): + + ## Private constructor. + def __init__(self, mesh, geom=0): + self.Create(mesh, geom, "Prism_3D") + +# Public class: Mesh_RadialPrism +# ------------------------------- + +## Class to define a Radial Prism 3D algorithm +# +# More details. +class Mesh_RadialPrism3D(Mesh_Algorithm): + + ## Private constructor. + def __init__(self, mesh, geom=0): + self.Create(mesh, geom, "RadialPrism_3D") + self.distribHyp = self.Hypothesis( "LayerDistribution" ) + self.nbLayers = None + + ## Return 3D hypothesis holding the 1D one + def Get3DHypothesis(self): + return self.distribHyp + + ## Private method creating 1D hypothes and storing it in the LayerDistribution + # hypothes. Returns the created hypothes + def OwnHypothesis(self, hypType, args=[], so="libStdMeshersEngine.so"): + if not self.nbLayers is None: + self.mesh.GetMesh().RemoveHypothesis( self.geom, self.nbLayers ) + self.mesh.GetMesh().AddHypothesis( self.geom, self.distribHyp ) + study = GetCurrentStudy() # prevent publishing of own 1D hypothesis + hyp = smesh.CreateHypothesis(hypType, so) + SetCurrentStudy( study ) # anable publishing + self.distribHyp.SetLayerDistribution( hyp ) + return hyp + + ## Define "NumberOfLayers" hypothesis, specifying a number of layers of + # prisms to build between the inner and outer shells + def NumberOfLayers(self, n ): + self.mesh.GetMesh().RemoveHypothesis( self.geom, self.distribHyp ) + self.nbLayers = self.Hypothesis("NumberOfLayers") + self.nbLayers.SetNumberOfLayers( n ) + return self.nbLayers + + ## Define "LocalLength" hypothesis, specifying segment length + # to build between the inner and outer shells + # @param l for the length of segments + def LocalLength(self, l): + hyp = self.OwnHypothesis("LocalLength", [l]) + hyp.SetLength(l) + return hyp + + ## Define "NumberOfSegments" hypothesis, specifying a number of layers of + # prisms to build between the inner and outer shells + # @param n for the number of segments + # @param s for the scale factor (optional) + def NumberOfSegments(self, n, s=[]): + if s == []: + hyp = self.OwnHypothesis("NumberOfSegments", [n]) + else: + hyp = self.OwnHypothesis("NumberOfSegments", [n,s]) + hyp.SetDistrType( 1 ) + hyp.SetScaleFactor(s) + hyp.SetNumberOfSegments(n) + return hyp + + ## Define "Arithmetic1D" hypothesis, specifying distribution of segments + # to build between the inner and outer shells as arithmetic length increasing + # @param start for the length of the first segment + # @param end for the length of the last segment + def Arithmetic1D(self, start, end): + hyp = self.OwnHypothesis("Arithmetic1D", [start, end]) + hyp.SetLength(start, 1) + hyp.SetLength(end , 0) + return hyp + + ## Define "StartEndLength" hypothesis, specifying distribution of segments + # to build between the inner and outer shells as geometric length increasing + # @param start for the length of the first segment + # @param end for the length of the last segment + def StartEndLength(self, start, end): + hyp = self.OwnHypothesis("StartEndLength", [start, end]) + hyp.SetLength(start, 1) + hyp.SetLength(end , 0) + return hyp + + ## Define "AutomaticLength" hypothesis, specifying number of segments + # to build between the inner and outer shells + # @param fineness for the fineness [0-1] + def AutomaticLength(self, fineness=0): + hyp = self.OwnHypothesis("AutomaticLength") + hyp.SetFineness( fineness ) + return hyp + + # Public class: Mesh # ================== ## Class to define a mesh # +# The class contains mesh shape, SMESH_Mesh, SMESH_MeshEditor # More details. class Mesh: geom = 0 mesh = 0 + editor = 0 ## Constructor # - # Creates mesh on the shape \a geom, + # Creates mesh on the shape \a geom(or the empty mesh if geom equal to 0), # sets GUI name of this mesh to \a name. - # @param geom Shape to be meshed + # @param obj Shape to be meshed or SMESH_Mesh object # @param name Study name of the mesh - def __init__(self, geom, name=0): - self.geom = geom - self.mesh = smesh.CreateMesh(geom) - if name == 0: - SetName(self.mesh, GetName(geom)) + def __init__(self, obj=0, name=0): + if obj is None: + obj = 0 + if obj != 0: + if isinstance(obj, geompy.GEOM._objref_GEOM_Object): + self.geom = obj + self.mesh = smesh.CreateMesh(self.geom) + elif isinstance(obj, SMESH._objref_SMESH_Mesh): + self.SetMesh(obj) else: + self.mesh = smesh.CreateEmptyMesh() + if name != 0: SetName(self.mesh, name) + elif obj != 0: + SetName(self.mesh, GetName(obj)) + + self.editor = self.mesh.GetMeshEditor() + ## Method that inits the Mesh object from SMESH_Mesh interface + # @param theMesh is SMESH_Mesh object + def SetMesh(self, theMesh): + self.mesh = theMesh + self.geom = self.mesh.GetShapeToMesh() + ## Method that returns the mesh + # @return SMESH_Mesh object def GetMesh(self): return self.mesh + ## Get mesh name + def GetName(self): + name = GetName(self.GetMesh()) + return name + + ## Set name to mesh + def SetName(self, name): + SetName(self.GetMesh(), name) + + ## Get the subMesh object associated to a subShape. The subMesh object + # gives access to nodes and elements IDs. + # \n SubMesh will be used instead of SubShape in a next idl version to + # adress a specific subMesh... + def GetSubMesh(self, theSubObject, name): + submesh = self.mesh.GetSubMesh(theSubObject, name) + return submesh + ## Method that returns the shape associated to the mesh + # @return GEOM_Object def GetShape(self): return self.geom + ## Method that associates given shape to the mesh(entails the mesh recreation) + # @param geom shape to be meshed(GEOM_Object) + def SetShape(self, geom): + self.mesh = smesh.CreateMesh(geom) + + ## Return true if hypotheses are defined well + # @param theMesh is an instance of Mesh class + # @param theSubObject subshape of a mesh shape + def IsReadyToCompute(self, theSubObject): + return smesh.IsReadyToCompute(self.mesh, theSubObject) + + ## Return errors of hypotheses definintion + # error list is empty if everything is OK + # @param theMesh is an instance of Mesh class + # @param theSubObject subshape of a mesh shape + # @return a list of errors + def GetAlgoState(self, theSubObject): + return smesh.GetAlgoState(self.mesh, theSubObject) + + ## Return geometrical object the given element is built on. + # The returned geometrical object, if not nil, is either found in the + # study or is published by this method with the given name + # @param theMesh is an instance of Mesh class + # @param theElementID an id of the mesh element + # @param theGeomName user defined name of geometrical object + # @return GEOM::GEOM_Object instance + def GetGeometryByMeshElement(self, theElementID, theGeomName): + return smesh.GetGeometryByMeshElement( self.mesh, theElementID, theGeomName ) + ## Returns mesh dimension depending on shape one def MeshDimension(self): shells = geompy.SubShapeAllIDs( self.geom, geompy.ShapeType["SHELL"] ) @@ -402,11 +1118,11 @@ class Mesh: else: return 0; pass - + ## Creates a segment discretization 1D algorithm. # If the optional \a algo parameter is not sets, this algorithm is REGULAR. # If the optional \a geom parameter is not sets, this algorithm is global. - # Otherwise, this algorithm define a submesh based on \a geom subshape. + # \n Otherwise, this algorithm define a submesh based on \a geom subshape. # @param algo values are smesh.REGULAR or smesh.PYTHON for discretization via python function # @param geom If defined, subshape to be meshed def Segment(self, algo=REGULAR, geom=0): @@ -420,17 +1136,23 @@ class Mesh: return Mesh_Segment_Python(self, geom) else: return Mesh_Segment(self, geom) - + ## Creates a triangle 2D algorithm for faces. # If the optional \a geom parameter is not sets, this algorithm is global. - # Otherwise, this algorithm define a submesh based on \a geom subshape. + # \n Otherwise, this algorithm define a submesh based on \a geom subshape. + # @param algo values are: smesh.MEFISTO or smesh.NETGEN # @param geom If defined, subshape to be meshed - def Triangle(self, geom=0): - return Mesh_Triangle(self, geom) - + def Triangle(self, algo=MEFISTO, geom=0): + ## if Triangle(geom) is called by mistake + if ( isinstance( algo, geompy.GEOM._objref_GEOM_Object)): + geom = algo + algo = MEFISTO + + return Mesh_Triangle(self, algo, geom) + ## Creates a quadrangle 2D algorithm for faces. # If the optional \a geom parameter is not sets, this algorithm is global. - # Otherwise, this algorithm define a submesh based on \a geom subshape. + # \n Otherwise, this algorithm define a submesh based on \a geom subshape. # @param geom If defined, subshape to be meshed def Quadrangle(self, geom=0): return Mesh_Quadrangle(self, geom) @@ -438,37 +1160,73 @@ class Mesh: ## Creates a tetrahedron 3D algorithm for solids. # The parameter \a algo permits to choice the algorithm: NETGEN or GHS3D # If the optional \a geom parameter is not sets, this algorithm is global. - # Otherwise, this algorithm define a submesh based on \a geom subshape. - # @param algo values are: smesh.NETGEN, smesh.GHS3D + # \n Otherwise, this algorithm define a submesh based on \a geom subshape. + # @param algo values are: smesh.NETGEN, smesh.GHS3D, smesh.FULL_NETGEN # @param geom If defined, subshape to be meshed - def Tetrahedron(self, algo, geom=0): + def Tetrahedron(self, algo=NETGEN, geom=0): ## if Tetrahedron(geom) is called by mistake if ( isinstance( algo, geompy.GEOM._objref_GEOM_Object)): algo, geom = geom, algo pass return Mesh_Tetrahedron(self, algo, geom) - + ## Creates a hexahedron 3D algorithm for solids. # If the optional \a geom parameter is not sets, this algorithm is global. - # Otherwise, this algorithm define a submesh based on \a geom subshape. + # \n Otherwise, this algorithm define a submesh based on \a geom subshape. # @param geom If defined, subshape to be meshed def Hexahedron(self, geom=0): return Mesh_Hexahedron(self, geom) - ## Creates a NETGEN-based 2D or 3D independent algorithm (i.e. needs no - # discrete boundary). - # If the optional \a geom parameter is not sets, this algorithm is global. - # Otherwise, this algorithm defines a submesh based on \a geom subshape. - # @param is3D If 0 then algorithm is 2D, otherwise 3D - # @param geom If defined, subshape to be meshed + ## Deprecated, only for compatibility! def Netgen(self, is3D, geom=0): return Mesh_Netgen(self, is3D, geom) + ## Creates a projection 1D algorithm for edges. + # If the optional \a geom parameter is not sets, this algorithm is global. + # Otherwise, this algorithm define a submesh based on \a geom subshape. + # @param geom If defined, subshape to be meshed + def Projection1D(self, geom=0): + return Mesh_Projection1D(self, geom) + + ## Creates a projection 2D algorithm for faces. + # If the optional \a geom parameter is not sets, this algorithm is global. + # Otherwise, this algorithm define a submesh based on \a geom subshape. + # @param geom If defined, subshape to be meshed + def Projection2D(self, geom=0): + return Mesh_Projection2D(self, geom) + + ## Creates a projection 3D algorithm for solids. + # If the optional \a geom parameter is not sets, this algorithm is global. + # Otherwise, this algorithm define a submesh based on \a geom subshape. + # @param geom If defined, subshape to be meshed + def Projection3D(self, geom=0): + return Mesh_Projection3D(self, geom) + + ## Creates a Prism 3D or RadialPrism 3D algorithm for solids. + # If the optional \a geom parameter is not sets, this algorithm is global. + # Otherwise, this algorithm define a submesh based on \a geom subshape. + # @param geom If defined, subshape to be meshed + def Prism(self, geom=0): + shape = geom + if shape==0: + shape = self.geom + nbSolids = len( geompy.SubShapeAll( shape, geompy.ShapeType["SOLID"] )) + nbShells = len( geompy.SubShapeAll( shape, geompy.ShapeType["SHELL"] )) + if nbSolids == 0 or nbSolids == nbShells: + return Mesh_Prism3D(self, geom) + return Mesh_RadialPrism3D(self, geom) + ## Compute the mesh and return the status of the computation - def Compute(self): - ok = smesh.Compute(self.mesh, self.geom) + def Compute(self, geom=0): + if geom == 0 or not isinstance(geom, geompy.GEOM._objref_GEOM_Object): + if self.geom == 0: + print "Compute impossible: mesh is not constructed on geom shape." + return 0 + else: + geom = self.geom + ok = smesh.Compute(self.mesh, geom) if not ok: - errors = smesh.GetAlgoState( self.mesh, self.geom ) + errors = smesh.GetAlgoState( self.mesh, geom ) allReasons = "" for err in errors: if err.isGlobalAlgo: @@ -477,13 +1235,20 @@ class Mesh: glob = " local " pass dim = str(err.algoDim) - if err.name == SMESH.MISSING_ALGO: + if err.name == MISSING_ALGO: reason = glob + dim + "D algorithm is missing" - elif err.name == SMESH.MISSING_HYPO: + elif err.name == MISSING_HYPO: name = '"' + err.algoName + '"' reason = glob + dim + "D algorithm " + name + " misses " + dim + "D hypothesis" - else: + elif err.name == NOT_CONFORM_MESH: reason = "Global \"Not Conform mesh allowed\" hypothesis is missing" + elif err.name == BAD_PARAM_VALUE: + name = '"' + err.algoName + '"' + reason = "Hypothesis of" + glob + dim + "D algorithm " + name +\ + " has a bad parameter value" + else: + reason = "For unknown reason."+\ + " Revise Mesh.Compute() implementation in smesh.py!" pass if allReasons != "": allReasons += "\n" @@ -504,7 +1269,7 @@ class Mesh: return ok ## Compute tetrahedral mesh using AutomaticLength + MEFISTO + NETGEN - # The parameter \a fineness [0.-1.] defines mesh fineness + # The parameter \a fineness [0,-1] defines mesh fineness def AutomaticTetrahedralization(self, fineness=0): dim = self.MeshDimension() # assign hypotheses @@ -517,9 +1282,9 @@ class Mesh: self.Tetrahedron(NETGEN) pass return self.Compute() - + ## Compute hexahedral mesh using AutomaticLength + Quadrangle + Hexahedron - # The parameter \a fineness [0.-1.] defines mesh fineness + # The parameter \a fineness [0,-1] defines mesh fineness def AutomaticHexahedralization(self, fineness=0): dim = self.MeshDimension() # assign hypotheses @@ -532,7 +1297,12 @@ class Mesh: self.Hexahedron() pass return self.Compute() - + + ## Get the list of hypothesis added on a geom + # @param geom is subhape of mesh geometry + def GetHypothesisList(self, geom): + return self.mesh.GetHypothesisList( geom ) + ## Removes all global hypotheses def RemoveGlobalHypotheses(self): current_hyps = self.mesh.GetHypothesisList( self.geom ) @@ -540,71 +1310,949 @@ class Mesh: self.mesh.RemoveHypothesis( self.geom, hyp ) pass pass - + ## Create a mesh group based on geometric object \a grp - # and give a \a name, if this parameter is not defined - # the name is the same as the geometric group name + # and give a \a name, \n if this parameter is not defined + # the name is the same as the geometric group name \n + # Note: Works like GroupOnGeom(). # @param grp is a geometric group, a vertex, an edge, a face or a solid # @param name is the name of the mesh group + # @return SMESH_GroupOnGeom def Group(self, grp, name=""): - if name == "": - name = grp.GetName() - - type = [] - tgeo = str(grp.GetShapeType()) - if tgeo == "VERTEX": - type = SMESH.NODE - elif tgeo == "EDGE": - type = SMESH.EDGE - elif tgeo == "FACE": - type = SMESH.FACE - elif tgeo == "SOLID": - type = SMESH.VOLUME - elif tgeo == "SHELL": - type = SMESH.VOLUME - elif tgeo == "COMPOUND": - if len( geompy.GetObjectIDs( grp )) == 0: - print "Mesh.Group: empty geometric group", GetName( grp ) - return 0 - tgeo = geompy.GetType(grp) - if tgeo == geompy.ShapeType["VERTEX"]: - type = SMESH.NODE - elif tgeo == geompy.ShapeType["EDGE"]: - type = SMESH.EDGE - elif tgeo == geompy.ShapeType["FACE"]: - type = SMESH.FACE - elif tgeo == geompy.ShapeType["SOLID"]: - type = SMESH.VOLUME - - if type == []: - print "Mesh.Group: bad first argument: expected a group, a vertex, an edge, a face or a solid" - return 0 - else: - return self.mesh.CreateGroupFromGEOM(type, name, grp) - - ## Export the mesh in a file with the MED format and choice the \a version of MED format + return self.GroupOnGeom(grp, name) + + ## Deprecated, only for compatibility! Please, use ExportMED() method instead. + # Export the mesh in a file with the MED format and choice the \a version of MED format # @param f is the file name # @param version values are SMESH.MED_V2_1, SMESH.MED_V2_2 def ExportToMED(self, f, version, opt=0): self.mesh.ExportToMED(f, opt, version) - + ## Export the mesh in a file with the MED format # @param f is the file name - def ExportMED(self, f, opt=0): - self.mesh.ExportMED(f, opt) - + # @param auto_groups boolean parameter for creating/not creating + # the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; + # the typical use is auto_groups=false. + # @param version MED format version(MED_V2_1 or MED_V2_2) + def ExportMED(self, f, auto_groups=0, version=MED_V2_2): + self.mesh.ExportToMED(f, auto_groups, version) + ## Export the mesh in a file with the DAT format # @param f is the file name def ExportDAT(self, f): self.mesh.ExportDAT(f) - + ## Export the mesh in a file with the UNV format # @param f is the file name def ExportUNV(self, f): self.mesh.ExportUNV(f) - + ## Export the mesh in a file with the STL format # @param f is the file name # @param ascii defined the kind of file contents def ExportSTL(self, f, ascii=1): self.mesh.ExportSTL(f, ascii) + + + # Operations with groups: + # ---------------------- + + ## Creates an empty mesh group + # @param elementType is the type of elements in the group + # @param name is the name of the mesh group + # @return SMESH_Group + def CreateEmptyGroup(self, elementType, name): + return self.mesh.CreateGroup(elementType, name) + + ## Creates a mesh group based on geometric object \a grp + # and give a \a name, \n if this parameter is not defined + # the name is the same as the geometric group name + # @param grp is a geometric group, a vertex, an edge, a face or a solid + # @param name is the name of the mesh group + # @return SMESH_GroupOnGeom + def GroupOnGeom(self, grp, name="", type=None): + if name == "": + name = grp.GetName() + + if type == None: + tgeo = str(grp.GetShapeType()) + if tgeo == "VERTEX": + type = NODE + elif tgeo == "EDGE": + type = EDGE + elif tgeo == "FACE": + type = FACE + elif tgeo == "SOLID": + type = VOLUME + elif tgeo == "SHELL": + type = VOLUME + elif tgeo == "COMPOUND": + if len( geompy.GetObjectIDs( grp )) == 0: + print "Mesh.Group: empty geometric group", GetName( grp ) + return 0 + tgeo = geompy.GetType(grp) + if tgeo == geompy.ShapeType["VERTEX"]: + type = NODE + elif tgeo == geompy.ShapeType["EDGE"]: + type = EDGE + elif tgeo == geompy.ShapeType["FACE"]: + type = FACE + elif tgeo == geompy.ShapeType["SOLID"]: + type = VOLUME + + if type == None: + print "Mesh.Group: bad first argument: expected a group, a vertex, an edge, a face or a solid" + return 0 + else: + return self.mesh.CreateGroupFromGEOM(type, name, grp) + + ## Create a mesh group by the given ids of elements + # @param groupName is the name of the mesh group + # @param elementType is the type of elements in the group + # @param elemIDs is the list of ids + # @return SMESH_Group + def MakeGroupByIds(self, groupName, elementType, elemIDs): + group = self.mesh.CreateGroup(elementType, groupName) + group.Add(elemIDs) + return group + + ## Create a mesh group by the given conditions + # @param groupName is the name of the mesh group + # @param elementType is the type of elements in the group + # @param CritType is type of criterion( FT_Taper, FT_Area, FT_RangeOfIds, FT_LyingOnGeom etc. ) + # @param Compare belong to {FT_LessThan, FT_MoreThan, FT_EqualTo} + # @param Treshold is threshold value (range of id ids as string, shape, numeric) + # @param UnaryOp is FT_LogicalNOT or FT_Undefined + # @return SMESH_Group + def MakeGroup(self, + groupName, + elementType, + CritType=FT_Undefined, + Compare=FT_EqualTo, + Treshold="", + UnaryOp=FT_Undefined): + aCriterion = GetCriterion(elementType, CritType, Compare, Treshold, UnaryOp, FT_Undefined) + group = self.MakeGroupByCriterion(groupName, aCriterion) + return group + + ## Create a mesh group by the given criterion + # @param groupName is the name of the mesh group + # @param Criterion is the instance of Criterion class + # @return SMESH_Group + def MakeGroupByCriterion(self, groupName, Criterion): + aFilterMgr = smesh.CreateFilterManager() + aFilter = aFilterMgr.CreateFilter() + aCriteria = [] + aCriteria.append(Criterion) + aFilter.SetCriteria(aCriteria) + group = self.MakeGroupByFilter(groupName, aFilter) + return group + + ## Create a mesh group by the given criteria(list of criterions) + # @param groupName is the name of the mesh group + # @param Criteria is the list of criterions + # @return SMESH_Group + def MakeGroupByCriteria(self, groupName, theCriteria): + aFilterMgr = smesh.CreateFilterManager() + aFilter = aFilterMgr.CreateFilter() + aFilter.SetCriteria(theCriteria) + group = self.MakeGroupByFilter(groupName, aFilter) + return group + + ## Create a mesh group by the given filter + # @param groupName is the name of the mesh group + # @param Criterion is the instance of Filter class + # @return SMESH_Group + def MakeGroupByFilter(self, groupName, theFilter): + anIds = theFilter.GetElementsId(self.mesh) + anElemType = theFilter.GetElementType() + group = self.MakeGroupByIds(groupName, anElemType, anIds) + return group + + ## Pass mesh elements through the given filter and return ids + # @param theFilter is SMESH_Filter + # @return list of ids + def GetIdsFromFilter(self, theFilter): + return theFilter.GetElementsId(self.mesh) + + ## Verify whether 2D mesh element has free edges(edges connected to one face only)\n + # Returns list of special structures(borders). + # @return list of SMESH.FreeEdges.Border structure: edge id and two its nodes ids. + def GetFreeBorders(self): + aFilterMgr = smesh.CreateFilterManager() + aPredicate = aFilterMgr.CreateFreeEdges() + aPredicate.SetMesh(self.mesh) + aBorders = aPredicate.GetBorders() + return aBorders + + ## Remove a group + def RemoveGroup(self, group): + self.mesh.RemoveGroup(group) + + ## Remove group with its contents + def RemoveGroupWithContents(self, group): + self.mesh.RemoveGroupWithContents(group) + + ## Get the list of groups existing in the mesh + def GetGroups(self): + return self.mesh.GetGroups() + + ## Get the list of names of groups existing in the mesh + def GetGroupNames(self): + groups = self.GetGroups() + names = [] + for group in groups: + names.append(group.GetName()) + return names + + ## Union of two groups + # New group is created. All mesh elements that are + # present in initial groups are added to the new one + def UnionGroups(self, group1, group2, name): + return self.mesh.UnionGroups(group1, group2, name) + + ## Intersection of two groups + # New group is created. All mesh elements that are + # present in both initial groups are added to the new one. + def IntersectGroups(self, group1, group2, name): + return self.mesh.IntersectGroups(group1, group2, name) + + ## Cut of two groups + # New group is created. All mesh elements that are present in + # main group but do not present in tool group are added to the new one + def CutGroups(self, mainGroup, toolGroup, name): + return self.mesh.CutGroups(mainGroup, toolGroup, name) + + + # Get some info about mesh: + # ------------------------ + + ## Get the log of nodes and elements added or removed since previous + # clear of the log. + # @param clearAfterGet log is emptied after Get (safe if concurrents access) + # @return list of log_block structures: + # commandType + # number + # coords + # indexes + def GetLog(self, clearAfterGet): + return self.mesh.GetLog(clearAfterGet) + + ## Clear the log of nodes and elements added or removed since previous + # clear. Must be used immediately after GetLog if clearAfterGet is false. + def ClearLog(self): + self.mesh.ClearLog() + + ## Get the internal Id + def GetId(self): + return self.mesh.GetId() + + ## Get the study Id + def GetStudyId(self): + return self.mesh.GetStudyId() + + ## Check group names for duplications. + # Consider maximum group name length stored in MED file. + def HasDuplicatedGroupNamesMED(self): + return self.mesh.GetStudyId() + + ## Obtain instance of SMESH_MeshEditor + def GetMeshEditor(self): + return self.mesh.GetMeshEditor() + + ## Get MED Mesh + def GetMEDMesh(self): + return self.mesh.GetMEDMesh() + + + # Get informations about mesh contents: + # ------------------------------------ + + ## Returns number of nodes in mesh + def NbNodes(self): + return self.mesh.NbNodes() + + ## Returns number of elements in mesh + def NbElements(self): + return self.mesh.NbElements() + + ## Returns number of edges in mesh + def NbEdges(self): + return self.mesh.NbEdges() + + ## Returns number of edges with given order in mesh + # @param elementOrder is order of elements: + # ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC + def NbEdgesOfOrder(self, elementOrder): + return self.mesh.NbEdgesOfOrder(elementOrder) + + ## Returns number of faces in mesh + def NbFaces(self): + return self.mesh.NbFaces() + + ## Returns number of faces with given order in mesh + # @param elementOrder is order of elements: + # ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC + def NbFacesOfOrder(self, elementOrder): + return self.mesh.NbFacesOfOrder(elementOrder) + + ## Returns number of triangles in mesh + def NbTriangles(self): + return self.mesh.NbTriangles() + + ## Returns number of triangles with given order in mesh + # @param elementOrder is order of elements: + # ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC + def NbTrianglesOfOrder(self, elementOrder): + return self.mesh.NbTrianglesOfOrder(elementOrder) + + ## Returns number of quadrangles in mesh + def NbQuadrangles(self): + return self.mesh.NbQuadrangles() + + ## Returns number of quadrangles with given order in mesh + # @param elementOrder is order of elements: + # ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC + def NbQuadranglesOfOrder(self, elementOrder): + return self.mesh.NbQuadranglesOfOrder(elementOrder) + + ## Returns number of polygons in mesh + def NbPolygons(self): + return self.mesh.NbPolygons() + + ## Returns number of volumes in mesh + def NbVolumes(self): + return self.mesh.NbVolumes() + + ## Returns number of volumes with given order in mesh + # @param elementOrder is order of elements: + # ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC + def NbVolumesOfOrder(self, elementOrder): + return self.mesh.NbVolumesOfOrder(elementOrder) + + ## Returns number of tetrahedrons in mesh + def NbTetras(self): + return self.mesh.NbTetras() + + ## Returns number of tetrahedrons with given order in mesh + # @param elementOrder is order of elements: + # ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC + def NbTetrasOfOrder(self, elementOrder): + return self.mesh.NbTetrasOfOrder(elementOrder) + + ## Returns number of hexahedrons in mesh + def NbHexas(self): + return self.mesh.NbHexas() + + ## Returns number of hexahedrons with given order in mesh + # @param elementOrder is order of elements: + # ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC + def NbHexasOfOrder(self, elementOrder): + return self.mesh.NbHexasOfOrder(elementOrder) + + ## Returns number of pyramids in mesh + def NbPyramids(self): + return self.mesh.NbPyramids() + + ## Returns number of pyramids with given order in mesh + # @param elementOrder is order of elements: + # ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC + def NbPyramidsOfOrder(self, elementOrder): + return self.mesh.NbPyramidsOfOrder(elementOrder) + + ## Returns number of prisms in mesh + def NbPrisms(self): + return self.mesh.NbPrisms() + + ## Returns number of prisms with given order in mesh + # @param elementOrder is order of elements: + # ORDER_ANY, ORDER_LINEAR or ORDER_QUADRATIC + def NbPrismsOfOrder(self, elementOrder): + return self.mesh.NbPrismsOfOrder(elementOrder) + + ## Returns number of polyhedrons in mesh + def NbPolyhedrons(self): + return self.mesh.NbPolyhedrons() + + ## Returns number of submeshes in mesh + def NbSubMesh(self): + return self.mesh.NbSubMesh() + + ## Returns list of mesh elements ids + def GetElementsId(self): + return self.mesh.GetElementsId() + + ## Returns list of ids of mesh elements with given type + # @param elementType is required type of elements + def GetElementsByType(self, elementType): + return self.mesh.GetElementsByType(elementType) + + ## Returns list of mesh nodes ids + def GetNodesId(self): + return self.mesh.GetNodesId() + + # Get informations about mesh elements: + # ------------------------------------ + + ## Returns type of mesh element + def GetElementType(self, id, iselem): + return self.mesh.GetElementType(id, iselem) + + ## Returns list of submesh elements ids + # @param shapeID is geom object(subshape) IOR + def GetSubMeshElementsId(self, shapeID): + return self.mesh.GetSubMeshElementsId(shapeID) + + ## Returns list of submesh nodes ids + # @param shapeID is geom object(subshape) IOR + def GetSubMeshNodesId(self, shapeID, all): + return self.mesh.GetSubMeshNodesId(shapeID, all) + + ## Returns list of ids of submesh elements with given type + # @param shapeID is geom object(subshape) IOR + def GetSubMeshElementType(self, shapeID): + return self.mesh.GetSubMeshElementType(shapeID) + + ## Get mesh description + def Dump(self): + return self.mesh.Dump() + + + # Get information about nodes and elements of mesh by its ids: + # ----------------------------------------------------------- + + ## Get XYZ coordinates of node as list of double + # \n If there is not node for given ID - returns empty list + def GetNodeXYZ(self, id): + return self.mesh.GetNodeXYZ(id) + + ## For given node returns list of IDs of inverse elements + # \n If there is not node for given ID - returns empty list + def GetNodeInverseElements(self, id): + return self.mesh.GetNodeInverseElements(id) + + ## If given element is node returns IDs of shape from position + # \n If there is not node for given ID - returns -1 + def GetShapeID(self, id): + return self.mesh.GetShapeID(id) + + ## For given element returns ID of result shape after + # FindShape() from SMESH_MeshEditor + # \n If there is not element for given ID - returns -1 + def GetShapeIDForElem(id): + return self.mesh.GetShapeIDForElem(id) + + ## Returns number of nodes for given element + # \n If there is not element for given ID - returns -1 + def GetElemNbNodes(self, id): + return self.mesh.GetElemNbNodes(id) + + ## Returns ID of node by given index for given element + # \n If there is not element for given ID - returns -1 + # \n If there is not node for given index - returns -2 + def GetElemNode(self, id, index): + return self.mesh.GetElemNode(id, index) + + ## Returns true if given node is medium node + # in given quadratic element + def IsMediumNode(self, elementID, nodeID): + return self.mesh.IsMediumNode(elementID, nodeID) + + ## Returns true if given node is medium node + # in one of quadratic elements + def IsMediumNodeOfAnyElem(self, nodeID, elementType): + return self.mesh.IsMediumNodeOfAnyElem(nodeID, elementType) + + ## Returns number of edges for given element + def ElemNbEdges(self, id): + return self.mesh.ElemNbEdges(id) + + ## Returns number of faces for given element + def ElemNbFaces(self, id): + return self.mesh.ElemNbFaces(id) + + ## Returns true if given element is polygon + def IsPoly(self, id): + return self.mesh.IsPoly(id) + + ## Returns true if given element is quadratic + def IsQuadratic(self, id): + return self.mesh.IsQuadratic(id) + + ## Returns XYZ coordinates of bary center for given element + # as list of double + # \n If there is not element for given ID - returns empty list + def BaryCenter(self, id): + return self.mesh.BaryCenter(id) + + + # Mesh edition (SMESH_MeshEditor functionality): + # --------------------------------------------- + + ## Removes elements from mesh by ids + # @param IDsOfElements is list of ids of elements to remove + def RemoveElements(self, IDsOfElements): + return self.editor.RemoveElements(IDsOfElements) + + ## Removes nodes from mesh by ids + # @param IDsOfNodes is list of ids of nodes to remove + def RemoveNodes(self, IDsOfNodes): + return self.editor.RemoveNodes(IDsOfNodes) + + ## Add node to mesh by coordinates + def AddNode(self, x, y, z): + return self.editor.AddNode( x, y, z) + + + ## Create edge both similar and quadratic (this is determed + # by number of given nodes). + # @param IdsOfNodes List of node IDs for creation of element. + # Needed order of nodes in this list corresponds to description + # of MED. \n This description is located by the following link: + # http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. + def AddEdge(self, IDsOfNodes): + return self.editor.AddEdge(IDsOfNodes) + + ## Create face both similar and quadratic (this is determed + # by number of given nodes). + # @param IdsOfNodes List of node IDs for creation of element. + # Needed order of nodes in this list corresponds to description + # of MED. \n This description is located by the following link: + # http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. + def AddFace(self, IDsOfNodes): + return self.editor.AddFace(IDsOfNodes) + + ## Add polygonal face to mesh by list of nodes ids + def AddPolygonalFace(self, IdsOfNodes): + return self.editor.AddPolygonalFace(IdsOfNodes) + + ## Create volume both similar and quadratic (this is determed + # by number of given nodes). + # @param IdsOfNodes List of node IDs for creation of element. + # Needed order of nodes in this list corresponds to description + # of MED. \n This description is located by the following link: + # http://www.salome-platform.org/salome2/web_med_internet/logiciels/medV2.2.2_doc_html/html/modele_de_donnees.html#3. + def AddVolume(self, IDsOfNodes): + return self.editor.AddVolume(IDsOfNodes) + + ## Create volume of many faces, giving nodes for each face. + # @param IdsOfNodes List of node IDs for volume creation face by face. + # @param Quantities List of integer values, Quantities[i] + # gives quantity of nodes in face number i. + def AddPolyhedralVolume (self, IdsOfNodes, Quantities): + return self.editor.AddPolyhedralVolume(IdsOfNodes, Quantities) + + ## Create volume of many faces, giving IDs of existing faces. + # @param IdsOfFaces List of face IDs for volume creation. + # + # Note: The created volume will refer only to nodes + # of the given faces, not to the faces itself. + def AddPolyhedralVolumeByFaces (self, IdsOfFaces): + return self.editor.AddPolyhedralVolumeByFaces(IdsOfFaces) + + ## Move node with given id + # @param NodeID id of the node + # @param x displacing along the X axis + # @param y displacing along the Y axis + # @param z displacing along the Z axis + def MoveNode(self, NodeID, x, y, z): + return self.editor.MoveNode(NodeID, x, y, z) + + ## Replace two neighbour triangles sharing Node1-Node2 link + # with ones built on the same 4 nodes but having other common link. + # @param NodeID1 first node id + # @param NodeID2 second node id + # @return false if proper faces not found + def InverseDiag(self, NodeID1, NodeID2): + return self.editor.InverseDiag(NodeID1, NodeID2) + + ## Replace two neighbour triangles sharing Node1-Node2 link + # with a quadrangle built on the same 4 nodes. + # @param NodeID1 first node id + # @param NodeID2 second node id + # @return false if proper faces not found + def DeleteDiag(self, NodeID1, NodeID2): + return self.editor.DeleteDiag(NodeID1, NodeID2) + + ## Reorient elements by ids + # @param IDsOfElements if undefined reorient all mesh elements + def Reorient(self, IDsOfElements=None): + if IDsOfElements == None: + IDsOfElements = self.GetElementsId() + return self.editor.Reorient(IDsOfElements) + + ## Reorient all elements of the object + # @param theObject is mesh, submesh or group + def ReorientObject(self, theObject): + return self.editor.ReorientObject(theObject) + + ## Fuse neighbour triangles into quadrangles. + # @param IDsOfElements The triangles to be fused, + # @param theCriterion is FT_...; used to choose a neighbour to fuse with. + # @param MaxAngle is a max angle between element normals at which fusion + # is still performed; theMaxAngle is mesured in radians. + # @return TRUE in case of success, FALSE otherwise. + def TriToQuad(self, IDsOfElements, theCriterion, MaxAngle): + if IDsOfElements == []: + IDsOfElements = self.GetElementsId() + return self.editor.TriToQuad(IDsOfElements, GetFunctor(theCriterion), MaxAngle) + + ## Fuse neighbour triangles of the object into quadrangles + # @param theObject is mesh, submesh or group + # @param theCriterion is FT_...; used to choose a neighbour to fuse with. + # @param MaxAngle is a max angle between element normals at which fusion + # is still performed; theMaxAngle is mesured in radians. + # @return TRUE in case of success, FALSE otherwise. + def TriToQuadObject (self, theObject, theCriterion, MaxAngle): + return self.editor.TriToQuadObject(theObject, GetFunctor(theCriterion), MaxAngle) + + ## Split quadrangles into triangles. + # @param IDsOfElements the faces to be splitted. + # @param theCriterion is FT_...; used to choose a diagonal for splitting. + # @param @return TRUE in case of success, FALSE otherwise. + def QuadToTri (self, IDsOfElements, theCriterion): + if IDsOfElements == []: + IDsOfElements = self.GetElementsId() + return self.editor.QuadToTri(IDsOfElements, GetFunctor(theCriterion)) + + ## Split quadrangles into triangles. + # @param theObject object to taking list of elements from, is mesh, submesh or group + # @param theCriterion is FT_...; used to choose a diagonal for splitting. + def QuadToTriObject (self, theObject, theCriterion): + return self.editor.QuadToTriObject(theObject, GetFunctor(theCriterion)) + + ## Split quadrangles into triangles. + # @param theElems The faces to be splitted + # @param the13Diag is used to choose a diagonal for splitting. + # @return TRUE in case of success, FALSE otherwise. + def SplitQuad (self, IDsOfElements, Diag13): + if IDsOfElements == []: + IDsOfElements = self.GetElementsId() + return self.editor.SplitQuad(IDsOfElements, Diag13) + + ## Split quadrangles into triangles. + # @param theObject is object to taking list of elements from, is mesh, submesh or group + def SplitQuadObject (self, theObject, Diag13): + return self.editor.SplitQuadObject(theObject, Diag13) + + ## Find better splitting of the given quadrangle. + # @param IDOfQuad ID of the quadrangle to be splitted. + # @param theCriterion is FT_...; a criterion to choose a diagonal for splitting. + # @return 1 if 1-3 diagonal is better, 2 if 2-4 + # diagonal is better, 0 if error occurs. + def BestSplit (self, IDOfQuad, theCriterion): + return self.editor.BestSplit(IDOfQuad, GetFunctor(theCriterion)) + + ## Smooth elements + # @param IDsOfElements list if ids of elements to smooth + # @param IDsOfFixedNodes list of ids of fixed nodes. + # Note that nodes built on edges and boundary nodes are always fixed. + # @param MaxNbOfIterations maximum number of iterations + # @param MaxAspectRatio varies in range [1.0, inf] + # @param Method is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH) + def Smooth(self, IDsOfElements, IDsOfFixedNodes, + MaxNbOfIterations, MaxAspectRatio, Method): + if IDsOfElements == []: + IDsOfElements = self.GetElementsId() + return self.editor.Smooth(IDsOfElements, IDsOfFixedNodes, + MaxNbOfIterations, MaxAspectRatio, Method) + + ## Smooth elements belong to given object + # @param theObject object to smooth + # @param IDsOfFixedNodes list of ids of fixed nodes. + # Note that nodes built on edges and boundary nodes are always fixed. + # @param MaxNbOfIterations maximum number of iterations + # @param MaxAspectRatio varies in range [1.0, inf] + # @param Method is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH) + def SmoothObject(self, theObject, IDsOfFixedNodes, + MaxNbOfIterations, MaxxAspectRatio, Method): + return self.editor.SmoothObject(theObject, IDsOfFixedNodes, + MaxNbOfIterations, MaxxAspectRatio, Method) + + ## Parametric smooth the given elements + # @param IDsOfElements list if ids of elements to smooth + # @param IDsOfFixedNodes list of ids of fixed nodes. + # Note that nodes built on edges and boundary nodes are always fixed. + # @param MaxNbOfIterations maximum number of iterations + # @param MaxAspectRatio varies in range [1.0, inf] + # @param Method is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH) + def SmoothParametric(IDsOfElements, IDsOfFixedNodes, + MaxNbOfIterations, MaxAspectRatio, Method): + if IDsOfElements == []: + IDsOfElements = self.GetElementsId() + return self.editor.SmoothParametric(IDsOfElements, IDsOfFixedNodes, + MaxNbOfIterations, MaxAspectRatio, Method) + + ## Parametric smooth elements belong to given object + # @param theObject object to smooth + # @param IDsOfFixedNodes list of ids of fixed nodes. + # Note that nodes built on edges and boundary nodes are always fixed. + # @param MaxNbOfIterations maximum number of iterations + # @param MaxAspectRatio varies in range [1.0, inf] + # @param Method is Laplacian(LAPLACIAN_SMOOTH) or Centroidal(CENTROIDAL_SMOOTH) + def SmoothParametricObject(self, theObject, IDsOfFixedNodes, + MaxNbOfIterations, MaxAspectRatio, Method): + return self.editor.SmoothParametricObject(theObject, IDsOfFixedNodes, + MaxNbOfIterations, MaxAspectRatio, Method) + + ## Converts all mesh to quadratic one, deletes old elements, replacing + # them with quadratic ones with the same id. + def ConvertToQuadratic(self, theForce3d): + self.editor.ConvertToQuadratic(theForce3d) + + ## Converts all mesh from quadratic to ordinary ones, + # deletes old quadratic elements, \n replacing + # them with ordinary mesh elements with the same id. + def ConvertFromQuadratic(self): + return self.editor.ConvertFromQuadratic() + + ## Renumber mesh nodes + def RenumberNodes(self): + self.editor.RenumberNodes() + + ## Renumber mesh elements + def RenumberElements(self): + self.editor.RenumberElements() + + ## Generate new elements by rotation of the elements around the axis + # @param IDsOfElements list of ids of elements to sweep + # @param Axix axis of rotation, AxisStruct or line(geom object) + # @param AngleInRadians angle of Rotation + # @param NbOfSteps number of steps + # @param Tolerance tolerance + def RotationSweep(self, IDsOfElements, Axix, AngleInRadians, NbOfSteps, Tolerance): + if IDsOfElements == []: + IDsOfElements = self.GetElementsId() + if ( isinstance( Axix, geompy.GEOM._objref_GEOM_Object)): + Axix = GetAxisStruct(Axix) + self.editor.RotationSweep(IDsOfElements, Axix, AngleInRadians, NbOfSteps, Tolerance) + + ## Generate new elements by rotation of the elements of object around the axis + # @param theObject object wich elements should be sweeped + # @param Axix axis of rotation, AxisStruct or line(geom object) + # @param AngleInRadians angle of Rotation + # @param NbOfSteps number of steps + # @param Tolerance tolerance + def RotationSweepObject(self, theObject, Axix, AngleInRadians, NbOfSteps, Tolerance): + if ( isinstance( Axix, geompy.GEOM._objref_GEOM_Object)): + Axix = GetAxisStruct(Axix) + self.editor.RotationSweepObject(theObject, Axix, AngleInRadians, NbOfSteps, Tolerance) + + ## Generate new elements by extrusion of the elements with given ids + # @param IDsOfElements list of elements ids for extrusion + # @param StepVector vector, defining the direction and value of extrusion + # @param NbOfSteps the number of steps + def ExtrusionSweep(self, IDsOfElements, StepVector, NbOfSteps): + if IDsOfElements == []: + IDsOfElements = self.GetElementsId() + if ( isinstance( StepVector, geompy.GEOM._objref_GEOM_Object)): + StepVector = GetDirStruct(StepVector) + self.editor.ExtrusionSweep(IDsOfElements, StepVector, NbOfSteps) + + ## Generate new elements by extrusion of the elements with given ids + # @param IDsOfElements is ids of elements + # @param StepVector vector, defining the direction and value of extrusion + # @param NbOfSteps the number of steps + # @param ExtrFlags set flags for performing extrusion + # @param SewTolerance uses for comparing locations of nodes if flag + # EXTRUSION_FLAG_SEW is set + def AdvancedExtrusion(self, IDsOfElements, StepVector, NbOfSteps, ExtrFlags, SewTolerance): + if ( isinstance( StepVector, geompy.GEOM._objref_GEOM_Object)): + StepVector = GetDirStruct(StepVector) + self.editor.AdvancedExtrusion(IDsOfElements, StepVector, NbOfSteps, ExtrFlags, SewTolerance) + + ## Generate new elements by extrusion of the elements belong to object + # @param theObject object wich elements should be processed + # @param StepVector vector, defining the direction and value of extrusion + # @param NbOfSteps the number of steps + def ExtrusionSweepObject(self, theObject, StepVector, NbOfSteps): + if ( isinstance( StepVector, geompy.GEOM._objref_GEOM_Object)): + StepVector = GetDirStruct(StepVector) + self.editor.ExtrusionSweepObject(theObject, StepVector, NbOfSteps) + + ## Generate new elements by extrusion of the elements belong to object + # @param theObject object wich elements should be processed + # @param StepVector vector, defining the direction and value of extrusion + # @param NbOfSteps the number of steps + def ExtrusionSweepObject1D(self, theObject, StepVector, NbOfSteps): + if ( isinstance( StepVector, geompy.GEOM._objref_GEOM_Object)): + StepVector = GetDirStruct(StepVector) + self.editor.ExtrusionSweepObject1D(theObject, StepVector, NbOfSteps) + + ## Generate new elements by extrusion of the elements belong to object + # @param theObject object wich elements should be processed + # @param StepVector vector, defining the direction and value of extrusion + # @param NbOfSteps the number of steps + def ExtrusionSweepObject2D(self, theObject, StepVector, NbOfSteps): + if ( isinstance( StepVector, geompy.GEOM._objref_GEOM_Object)): + StepVector = GetDirStruct(StepVector) + self.editor.ExtrusionSweepObject2D(theObject, StepVector, NbOfSteps) + + ## Generate new elements by extrusion of the given elements + # A path of extrusion must be a meshed edge. + # @param IDsOfElements is ids of elements + # @param PathMesh mesh containing a 1D sub-mesh on the edge, along which proceeds the extrusion + # @param PathShape is shape(edge); as the mesh can be complex, the edge is used to define the sub-mesh for the path + # @param NodeStart the first or the last node on the edge. It is used to define the direction of extrusion + # @param HasAngles allows the shape to be rotated around the path to get the resulting mesh in a helical fashion + # @param Angles list of angles + # @param HasRefPoint allows to use base point + # @param RefPoint point around which the shape is rotated(the mass center of the shape by default). + # User can specify any point as the Base Point and the shape will be rotated with respect to this point. + def ExtrusionAlongPath(self, IDsOfElements, PathMesh, PathShape, NodeStart, + HasAngles, Angles, HasRefPoint, RefPoint): + if IDsOfElements == []: + IDsOfElements = self.GetElementsId() + if ( isinstance( RefPoint, geompy.GEOM._objref_GEOM_Object)): + RefPoint = GetPointStruct(RefPoint) + return self.editor.ExtrusionAlongPath(IDsOfElements, PathMesh.GetMesh(), PathShape, NodeStart, + HasAngles, Angles, HasRefPoint, RefPoint) + + ## Generate new elements by extrusion of the elements belong to object + # A path of extrusion must be a meshed edge. + # @param IDsOfElements is ids of elements + # @param PathMesh mesh containing a 1D sub-mesh on the edge, along which proceeds the extrusion + # @param PathShape is shape(edge); as the mesh can be complex, the edge is used to define the sub-mesh for the path + # @param NodeStart the first or the last node on the edge. It is used to define the direction of extrusion + # @param HasAngles allows the shape to be rotated around the path to get the resulting mesh in a helical fashion + # @param Angles list of angles + # @param HasRefPoint allows to use base point + # @param RefPoint point around which the shape is rotated(the mass center of the shape by default). + # User can specify any point as the Base Point and the shape will be rotated with respect to this point. + def ExtrusionAlongPathObject(self, theObject, PathMesh, PathShape, NodeStart, + HasAngles, Angles, HasRefPoint, RefPoint): + if ( isinstance( RefPoint, geompy.GEOM._objref_GEOM_Object)): + RefPoint = GetPointStruct(RefPoint) + return self.editor.ExtrusionAlongPathObject(theObject, PathMesh.GetMesh(), PathShape, NodeStart, + HasAngles, Angles, HasRefPoint, RefPoint) + + ## Symmetrical copy of mesh elements + # @param IDsOfElements list of elements ids + # @param Mirror is AxisStruct or geom object(point, line, plane) + # @param theMirrorType is POINT, AXIS or PLANE + # If the Mirror is geom object this parameter is unnecessary + # @param Copy allows to copy element(Copy is 1) or to replace with its mirroring(Copy is 0) + def Mirror(self, IDsOfElements, Mirror, theMirrorType, Copy=0): + if IDsOfElements == []: + IDsOfElements = self.GetElementsId() + if ( isinstance( Mirror, geompy.GEOM._objref_GEOM_Object)): + Mirror = GetAxisStruct(Mirror) + self.editor.Mirror(IDsOfElements, Mirror, theMirrorType, Copy) + + ## Symmetrical copy of object + # @param theObject mesh, submesh or group + # @param Mirror is AxisStruct or geom object(point, line, plane) + # @param theMirrorType is POINT, AXIS or PLANE + # If the Mirror is geom object this parameter is unnecessary + # @param Copy allows to copy element(Copy is 1) or to replace with its mirroring(Copy is 0) + def MirrorObject (self, theObject, Mirror, theMirrorType, Copy=0): + if ( isinstance( Mirror, geompy.GEOM._objref_GEOM_Object)): + Mirror = GetAxisStruct(Mirror) + self.editor.MirrorObject(theObject, Mirror, theMirrorType, Copy) + + ## Translates the elements + # @param IDsOfElements list of elements ids + # @param Vector direction of translation(DirStruct or vector) + # @param Copy allows to copy the translated elements + def Translate(self, IDsOfElements, Vector, Copy): + if IDsOfElements == []: + IDsOfElements = self.GetElementsId() + if ( isinstance( Vector, geompy.GEOM._objref_GEOM_Object)): + Vector = GetDirStruct(Vector) + self.editor.Translate(IDsOfElements, Vector, Copy) + + ## Translates the object + # @param theObject object to translate(mesh, submesh, or group) + # @param Vector direction of translation(DirStruct or geom vector) + # @param Copy allows to copy the translated elements + def TranslateObject(self, theObject, Vector, Copy): + if ( isinstance( Vector, geompy.GEOM._objref_GEOM_Object)): + Vector = GetDirStruct(Vector) + self.editor.TranslateObject(theObject, Vector, Copy) + + ## Rotates the elements + # @param IDsOfElements list of elements ids + # @param Axis axis of rotation(AxisStruct or geom line) + # @param AngleInRadians angle of rotation(in radians) + # @param Copy allows to copy the rotated elements + def Rotate (self, IDsOfElements, Axis, AngleInRadians, Copy): + if IDsOfElements == []: + IDsOfElements = self.GetElementsId() + if ( isinstance( Axis, geompy.GEOM._objref_GEOM_Object)): + Axis = GetAxisStruct(Axis) + self.editor.Rotate(IDsOfElements, Axis, AngleInRadians, Copy) + + ## Rotates the object + # @param theObject object to rotate(mesh, submesh, or group) + # @param Axis axis of rotation(AxisStruct or geom line) + # @param AngleInRadians angle of rotation(in radians) + # @param Copy allows to copy the rotated elements + def RotateObject (self, theObject, Axis, AngleInRadians, Copy): + self.editor.RotateObject(theObject, Axis, AngleInRadians, Copy) + + ## Find group of nodes close to each other within Tolerance. + # @param Tolerance tolerance value + # @param list of group of nodes + def FindCoincidentNodes (self, Tolerance): + return self.editor.FindCoincidentNodes(Tolerance) + + ## Merge nodes + # @param list of group of nodes + def MergeNodes (self, GroupsOfNodes): + self.editor.MergeNodes(GroupsOfNodes) + + ## Remove all but one of elements built on the same nodes. + def MergeEqualElements(self): + self.editor.MergeEqualElements() + + ## Sew free borders + def SewFreeBorders (self, FirstNodeID1, SecondNodeID1, LastNodeID1, + FirstNodeID2, SecondNodeID2, LastNodeID2, + CreatePolygons, CreatePolyedrs): + return self.editor.SewFreeBorders(FirstNodeID1, SecondNodeID1, LastNodeID1, + FirstNodeID2, SecondNodeID2, LastNodeID2, + CreatePolygons, CreatePolyedrs) + + ## Sew conform free borders + def SewConformFreeBorders (self, FirstNodeID1, SecondNodeID1, LastNodeID1, + FirstNodeID2, SecondNodeID2): + return self.editor.SewConformFreeBorders(FirstNodeID1, SecondNodeID1, LastNodeID1, + FirstNodeID2, SecondNodeID2) + + ## Sew border to side + def SewBorderToSide (self, FirstNodeIDOnFreeBorder, SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder, + FirstNodeIDOnSide, LastNodeIDOnSide, CreatePolygons, CreatePolyedrs): + return self.editor.SewBorderToSide(FirstNodeIDOnFreeBorder, SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder, + FirstNodeIDOnSide, LastNodeIDOnSide, CreatePolygons, CreatePolyedrs) + + ## Sew two sides of a mesh. Nodes belonging to Side1 are + # merged with nodes of elements of Side2. + # Number of elements in theSide1 and in theSide2 must be + # equal and they should have similar node connectivity. + # The nodes to merge should belong to sides borders and + # the first node should be linked to the second. + def SewSideElements (self, IDsOfSide1Elements, IDsOfSide2Elements, + NodeID1OfSide1ToMerge, NodeID1OfSide2ToMerge, + NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge): + return self.editor.SewSideElements(IDsOfSide1Elements, IDsOfSide2Elements, + NodeID1OfSide1ToMerge, NodeID1OfSide2ToMerge, + NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge) + + ## Set new nodes for given element. + # @param ide the element id + # @param newIDs nodes ids + # @return If number of nodes is not corresponded to type of element - returns false + def ChangeElemNodes(self, ide, newIDs): + return self.editor.ChangeElemNodes(ide, newIDs) + + ## If during last operation of MeshEditor some nodes were + # created this method returns list of it's IDs, \n + # if new nodes not created - returns empty list + def GetLastCreatedNodes(self): + return self.editor.GetLastCreatedNodes() + + ## If during last operation of MeshEditor some elements were + # created this method returns list of it's IDs, \n + # if new elements not creared - returns empty list + def GetLastCreatedElems(self): + return self.editor.GetLastCreatedElems() diff --git a/src/StdMeshers/Makefile.in b/src/StdMeshers/Makefile.in index b2a3fa7ff..87f327472 100644 --- a/src/StdMeshers/Makefile.in +++ b/src/StdMeshers/Makefile.in @@ -51,7 +51,19 @@ EXPORT_HEADERS = \ StdMeshers_AutomaticLength.hxx \ StdMeshers_Distribution.hxx \ StdMeshers_QuadranglePreference.hxx \ - StdMeshers_QuadraticMesh.hxx + StdMeshers_QuadraticMesh.hxx \ + StdMeshers_NumberOfLayers.hxx \ + StdMeshers_Prism_3D.hxx \ + StdMeshers_ProjectionSource1D.hxx \ + StdMeshers_ProjectionSource2D.hxx \ + StdMeshers_ProjectionSource3D.hxx \ + StdMeshers_Projection_1D.hxx \ + StdMeshers_Projection_2D.hxx \ + StdMeshers_Projection_3D.hxx \ + StdMeshers_RadialPrism_3D.hxx \ + StdMeshers_ProjectionUtils.hxx \ + StdMeshers_LayerDistribution.hxx \ + SMESH_StdMeshers.hxx EXPORT_PYSCRIPTS = @@ -78,7 +90,18 @@ LIB_SRC = \ StdMeshers_AutomaticLength.cxx \ StdMeshers_Distribution.cxx \ StdMeshers_QuadranglePreference.cxx \ - StdMeshers_QuadraticMesh.cxx + StdMeshers_QuadraticMesh.cxx \ + StdMeshers_NumberOfLayers.cxx \ + StdMeshers_Prism_3D.cxx \ + StdMeshers_ProjectionSource1D.cxx \ + StdMeshers_ProjectionSource2D.cxx \ + StdMeshers_ProjectionSource3D.cxx \ + StdMeshers_Projection_1D.cxx \ + StdMeshers_Projection_2D.cxx \ + StdMeshers_Projection_3D.cxx \ + StdMeshers_RadialPrism_3D.cxx \ + StdMeshers_ProjectionUtils.cxx \ + StdMeshers_LayerDistribution.cxx LIB_SERVER_IDL = diff --git a/src/StdMeshers/SMESH_StdMeshers.hxx b/src/StdMeshers/SMESH_StdMeshers.hxx new file mode 100755 index 000000000..669ca6739 --- /dev/null +++ b/src/StdMeshers/SMESH_StdMeshers.hxx @@ -0,0 +1,41 @@ +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESH_StdMeshers.hxx +// Author : Alexander BORODIN +// Module : SMESH +// $Header: + +#ifndef _SMESH_StdMeshers_HXX_ +#define _SMESH_StdMeshers_HXX_ + +#ifdef WNT + #if defined STDMESHERS_EXPORTS + #define STDMESHERS_EXPORT __declspec( dllexport ) + #else + #define STDMESHERS_EXPORT __declspec( dllimport ) + #endif +#else + #define STDMESHERS_EXPORT +#endif + +#endif + diff --git a/src/StdMeshers/StdMeshers_Arithmetic1D.hxx b/src/StdMeshers/StdMeshers_Arithmetic1D.hxx index aa132d9fe..09b7edd15 100644 --- a/src/StdMeshers/StdMeshers_Arithmetic1D.hxx +++ b/src/StdMeshers/StdMeshers_Arithmetic1D.hxx @@ -29,10 +29,12 @@ #ifndef _SMESH_ARITHMETIC1D_HXX_ #define _SMESH_ARITHMETIC1D_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" -class StdMeshers_Arithmetic1D: +class STDMESHERS_EXPORT StdMeshers_Arithmetic1D: public SMESH_Hypothesis { public: diff --git a/src/StdMeshers/StdMeshers_AutomaticLength.hxx b/src/StdMeshers/StdMeshers_AutomaticLength.hxx index c1049345b..a9194dce7 100644 --- a/src/StdMeshers/StdMeshers_AutomaticLength.hxx +++ b/src/StdMeshers/StdMeshers_AutomaticLength.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_AutomaticLength_HXX_ #define _SMESH_AutomaticLength_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" @@ -45,7 +47,7 @@ class TopoDS_TShape; * S = S0 * f(L/Lmin) where f(x) = 1 + (2/Pi * 7 * atan(x/5) ) */ -class StdMeshers_AutomaticLength:public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_AutomaticLength:public SMESH_Hypothesis { public: StdMeshers_AutomaticLength(int hypId, int studyId, SMESH_Gen * gen); diff --git a/src/StdMeshers/StdMeshers_Deflection1D.cxx b/src/StdMeshers/StdMeshers_Deflection1D.cxx index 9e0e69171..de3d52778 100644 --- a/src/StdMeshers/StdMeshers_Deflection1D.cxx +++ b/src/StdMeshers/StdMeshers_Deflection1D.cxx @@ -25,8 +25,6 @@ // Module : SMESH // $Header$ -using namespace std; - #include "StdMeshers_Deflection1D.hxx" #include "utilities.h" @@ -44,6 +42,8 @@ using namespace std; #include #include +using namespace std; + //============================================================================= /*! * diff --git a/src/StdMeshers/StdMeshers_Deflection1D.hxx b/src/StdMeshers/StdMeshers_Deflection1D.hxx index d1418ad5a..f321c83d5 100644 --- a/src/StdMeshers/StdMeshers_Deflection1D.hxx +++ b/src/StdMeshers/StdMeshers_Deflection1D.hxx @@ -28,10 +28,12 @@ #ifndef _StdMeshers_Deflection1D_HXX_ #define _StdMeshers_Deflection1D_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" -class StdMeshers_Deflection1D:public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_Deflection1D:public SMESH_Hypothesis { public: StdMeshers_Deflection1D(int hypId, int studyId, SMESH_Gen * gen); diff --git a/src/StdMeshers/StdMeshers_Distribution.cxx b/src/StdMeshers/StdMeshers_Distribution.cxx index 989fcf3ce..6cfb75597 100644 --- a/src/StdMeshers/StdMeshers_Distribution.cxx +++ b/src/StdMeshers/StdMeshers_Distribution.cxx @@ -62,7 +62,7 @@ bool Function::value( const double, double& f ) const #else CASCatch_TRY { #endif - f = pow( 10, f ); + f = pow( 10., f ); #ifdef NO_CAS_CATCH } catch(Standard_Failure) { #else @@ -213,7 +213,7 @@ FunctionExpr::~FunctionExpr() { } -Standard_Boolean FunctionExpr::Value( Standard_Real T, Standard_Real& F ) +Standard_Boolean FunctionExpr::Value( const Standard_Real T, Standard_Real& F ) { double f; Standard_Boolean res = value( T, f ); diff --git a/src/StdMeshers/StdMeshers_Distribution.hxx b/src/StdMeshers/StdMeshers_Distribution.hxx index 3f9cfd574..2dafda44b 100644 --- a/src/StdMeshers/StdMeshers_Distribution.hxx +++ b/src/StdMeshers/StdMeshers_Distribution.hxx @@ -29,6 +29,8 @@ #ifndef _STD_MESHERS_DISTRIBUTION_HXX_ #define _STD_MESHERS_DISTRIBUTION_HXX_ +#include "SMESH_StdMeshers.hxx" + #include #include #include @@ -36,7 +38,7 @@ #include -class Function +class STDMESHERS_EXPORT Function { public: Function( const int ); @@ -48,7 +50,7 @@ private: int myConv; }; -class FunctionIntegral : public Function +class STDMESHERS_EXPORT FunctionIntegral : public Function { public: FunctionIntegral( const Function*, const double ); @@ -61,7 +63,7 @@ private: double myStart; }; -class FunctionTable : public Function +class STDMESHERS_EXPORT FunctionTable : public Function { public: FunctionTable( const std::vector&, const int ); @@ -84,12 +86,12 @@ private: std::vector myData; }; -class FunctionExpr : public Function, public math_Function +class STDMESHERS_EXPORT FunctionExpr : public Function, public math_Function { public: FunctionExpr( const char*, const int ); virtual ~FunctionExpr(); - virtual Standard_Boolean Value( Standard_Real, Standard_Real& ); + virtual Standard_Boolean Value( const Standard_Real, Standard_Real& ); virtual bool value( const double, double& ) const; virtual double integral( const double, const double ) const; @@ -99,14 +101,17 @@ private: TColStd_Array1OfReal myValues; }; +STDMESHERS_EXPORT bool buildDistribution( const Function& f, const double start, const double end, const int nbSeg, vector& data, const double eps ); +STDMESHERS_EXPORT bool buildDistribution( const TCollection_AsciiString& f, const int conv, const double start, const double end, const int nbSeg, vector& data, const double eps ); +STDMESHERS_EXPORT bool buildDistribution( const std::vector& f, const int conv, const double start, const double end, const int nbSeg, vector& data, const double eps ); diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.cxx b/src/StdMeshers/StdMeshers_Hexa_3D.cxx index 1a2e15e1e..ccb6c4a5a 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.cxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.cxx @@ -27,7 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_Hexa_3D.hxx" #include "StdMeshers_Quadrangle_2D.hxx" #include "SMESH_Gen.hxx" @@ -61,6 +60,8 @@ using namespace std; //modified by NIZNHY-PKV Wed Nov 17 15:31:58 2004 f #include "StdMeshers_Penta_3D.hxx" +using namespace std; + static bool ComputePentahedralMesh(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape); //modified by NIZNHY-PKV Wed Nov 17 15:32:00 2004 t diff --git a/src/StdMeshers/StdMeshers_Hexa_3D.hxx b/src/StdMeshers/StdMeshers_Hexa_3D.hxx index 98a727b09..4fa9311c7 100644 --- a/src/StdMeshers/StdMeshers_Hexa_3D.hxx +++ b/src/StdMeshers/StdMeshers_Hexa_3D.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_HEXA_3D_HXX_ #define _SMESH_HEXA_3D_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_3D_Algo.hxx" #include "SMESH_Mesh.hxx" #include "StdMeshers_Quadrangle_2D.hxx" @@ -59,7 +61,7 @@ typedef struct conv2dstruct int jc; } Conv2DStruct; -class StdMeshers_Hexa_3D: +class STDMESHERS_EXPORT StdMeshers_Hexa_3D: public SMESH_3D_Algo { public: diff --git a/src/StdMeshers/StdMeshers_LayerDistribution.cxx b/src/StdMeshers/StdMeshers_LayerDistribution.cxx new file mode 100644 index 000000000..42d99c8ed --- /dev/null +++ b/src/StdMeshers/StdMeshers_LayerDistribution.cxx @@ -0,0 +1,148 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's classes +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_LayerDistribution.cxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#include "StdMeshers_LayerDistribution.hxx" + +#include "utilities.h" + +using namespace std; + + +//============================================================================= +/*! + * StdMeshers_LayerDistribution::StdMeshers_LayerDistribution + * + * Constructor + */ +//============================================================================= + +StdMeshers_LayerDistribution::StdMeshers_LayerDistribution(int hypId, int studyId, + SMESH_Gen * gen) + : SMESH_Hypothesis(hypId, studyId, gen) +{ + _name = "LayerDistribution"; // used by RadialPrism_3D + _param_algo_dim = 3; // 3D + myHyp = 0; +} + +//============================================================================= +/*! + * StdMeshers_LayerDistribution::~StdMeshers_LayerDistribution + * + * Destructor + */ +//============================================================================= + +StdMeshers_LayerDistribution::~StdMeshers_LayerDistribution() +{ + MESSAGE( "StdMeshers_LayerDistribution::~StdMeshers_LayerDistribution" ); +} + +//============================================================================= + /*! + * \brief Sets 1D hypothesis specifying distribution of layers + * \param hyp1D - 1D hypothesis + */ +//============================================================================= + +void StdMeshers_LayerDistribution::SetLayerDistribution(SMESH_Hypothesis* hyp1D) + throw ( SALOME_Exception ) +{ + if ( myHyp != hyp1D ) { + if ( myHyp && hyp1D->GetDim() != 1 ) + throw SALOME_Exception(LOCALIZED("1D hypothesis is expected")); + myHyp = hyp1D; + } + std::ostringstream os; + if ( myHyp ) + myHyp->SaveTo( os ); + + if ( mySavedHyp != os.str() ) + NotifySubMeshesHypothesisModification(); + + mySavedHyp = os.str(); +} + +//============================================================================= +/*! + * Servant saves and loads my hypothesis + */ +//============================================================================= + +ostream & StdMeshers_LayerDistribution::SaveTo(ostream & save) +{ + return save; +} + +//============================================================================= +/*! + * Servant saves and loads my hypothesis + */ +//============================================================================= + +istream & StdMeshers_LayerDistribution::LoadFrom(istream & load) +{ + return load; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +ostream & operator <<(ostream & save, StdMeshers_LayerDistribution & hyp) +{ + return hyp.SaveTo( save ); +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +istream & operator >>(istream & load, StdMeshers_LayerDistribution & hyp) +{ + return hyp.LoadFrom( load ); +} + +//================================================================================ +/*! + * \brief Initialize start and end length by the mesh built on the geometry + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if parameter values have been successfully defined + */ +//================================================================================ + +bool StdMeshers_LayerDistribution::SetParametersByMesh(const SMESH_Mesh* , + const TopoDS_Shape& ) +{ + return false; +} diff --git a/src/StdMeshers/StdMeshers_LayerDistribution.hxx b/src/StdMeshers/StdMeshers_LayerDistribution.hxx new file mode 100644 index 000000000..93c16c873 --- /dev/null +++ b/src/StdMeshers/StdMeshers_LayerDistribution.hxx @@ -0,0 +1,93 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_LayerDistribution.hxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#ifndef _SMESH_LayerDistribution_HXX_ +#define _SMESH_LayerDistribution_HXX_ + +#include "SMESH_StdMeshers.hxx" + +#include "SMESH_Hypothesis.hxx" +#include "Utils_SALOME_Exception.hxx" + +#include + +class SMESH_Gen; + +// ========================================================= +// ========================================================= +/*! + * This hypothesis is used by "Radial prism" algorithm. + * It specifies 1D hypothesis defining distribution of segments between the internal + * and the external surfaces. + */ +// ========================================================= +// ========================================================= + +class STDMESHERS_EXPORT StdMeshers_LayerDistribution: public SMESH_Hypothesis +{ +public: + // Constructor + StdMeshers_LayerDistribution( int hypId, int studyId, SMESH_Gen * gen ); + // Destructor + virtual ~StdMeshers_LayerDistribution(); + + /*! + * \brief Sets 1D hypothesis specifying distribution of layers + * \param hyp1D - 1D hypothesis + */ + void SetLayerDistribution(SMESH_Hypothesis* hyp1D) + throw ( SALOME_Exception ); + + /*! + * \brief Returns 1D hypothesis specifying distribution of layers + * \retval SMESH::SMESH_Hypothesis_ptr - 1D hypothesis + */ + SMESH_Hypothesis* GetLayerDistribution() const { return myHyp; } + + virtual std::ostream & SaveTo(std::ostream & save); + virtual std::istream & LoadFrom(std::istream & load); + friend std::ostream & operator <<(std::ostream & save, StdMeshers_LayerDistribution & hyp); + friend std::istream & operator >>(std::istream & load, StdMeshers_LayerDistribution & hyp); + + /*! + * \brief Initialize parameters by the mesh built on the geometry + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if parameter values have been successfully defined + * + * Implementation does noting + */ + virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + +protected: + SMESH_Hypothesis* myHyp; + std::string mySavedHyp; +}; + +#endif + diff --git a/src/StdMeshers/StdMeshers_LengthFromEdges.hxx b/src/StdMeshers/StdMeshers_LengthFromEdges.hxx index 27f5b8bc0..7fa99ee5e 100644 --- a/src/StdMeshers/StdMeshers_LengthFromEdges.hxx +++ b/src/StdMeshers/StdMeshers_LengthFromEdges.hxx @@ -30,10 +30,12 @@ #ifndef _SMESH_LENGTHFROMEDGES_HXX_ #define _SMESH_LENGTHFROMEDGES_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" -class StdMeshers_LengthFromEdges: +class STDMESHERS_EXPORT StdMeshers_LengthFromEdges: public SMESH_Hypothesis { public: diff --git a/src/StdMeshers/StdMeshers_LocalLength.hxx b/src/StdMeshers/StdMeshers_LocalLength.hxx index c283be121..79a85df7f 100644 --- a/src/StdMeshers/StdMeshers_LocalLength.hxx +++ b/src/StdMeshers/StdMeshers_LocalLength.hxx @@ -30,10 +30,12 @@ #ifndef _SMESH_LOCALLENGTH_HXX_ #define _SMESH_LOCALLENGTH_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" -class StdMeshers_LocalLength:public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_LocalLength:public SMESH_Hypothesis { public: StdMeshers_LocalLength(int hypId, int studyId, SMESH_Gen * gen); diff --git a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx index ca7405ba2..49ac4365d 100644 --- a/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx +++ b/src/StdMeshers/StdMeshers_MEFISTO_2D.cxx @@ -27,7 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_MEFISTO_2D.hxx" #include "SMESH_Gen.hxx" #include "SMESH_Mesh.hxx" diff --git a/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx b/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx index 5b27addcc..f9601490f 100644 --- a/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx +++ b/src/StdMeshers/StdMeshers_MEFISTO_2D.hxx @@ -30,6 +30,8 @@ #ifndef _StdMeshers_MEFISTO_2D_HXX_ #define _StdMeshers_MEFISTO_2D_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_2D_Algo.hxx" #include @@ -47,7 +49,7 @@ class SMDS_MeshNode; #include #include "Rn.h" -class StdMeshers_MEFISTO_2D: +class STDMESHERS_EXPORT StdMeshers_MEFISTO_2D: public SMESH_2D_Algo { public: diff --git a/src/StdMeshers/StdMeshers_MaxElementArea.hxx b/src/StdMeshers/StdMeshers_MaxElementArea.hxx index 303ce22d0..e8e33aa1a 100644 --- a/src/StdMeshers/StdMeshers_MaxElementArea.hxx +++ b/src/StdMeshers/StdMeshers_MaxElementArea.hxx @@ -30,10 +30,12 @@ #ifndef _SMESH_MAXELEMENTAREA_HXX_ #define _SMESH_MAXELEMENTAREA_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" -class StdMeshers_MaxElementArea:public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_MaxElementArea:public SMESH_Hypothesis { public: StdMeshers_MaxElementArea(int hypId, int studyId, SMESH_Gen * gen); diff --git a/src/StdMeshers/StdMeshers_MaxElementVolume.cxx b/src/StdMeshers/StdMeshers_MaxElementVolume.cxx index c2e64b426..42b8b469e 100644 --- a/src/StdMeshers/StdMeshers_MaxElementVolume.cxx +++ b/src/StdMeshers/StdMeshers_MaxElementVolume.cxx @@ -27,8 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; - #include "StdMeshers_MaxElementVolume.hxx" #include "SMDS_MeshElement.hxx" @@ -42,6 +40,8 @@ using namespace std; #include #include +using namespace std; + //============================================================================= /*! * diff --git a/src/StdMeshers/StdMeshers_MaxElementVolume.hxx b/src/StdMeshers/StdMeshers_MaxElementVolume.hxx index e8545d9ff..16dc5a604 100644 --- a/src/StdMeshers/StdMeshers_MaxElementVolume.hxx +++ b/src/StdMeshers/StdMeshers_MaxElementVolume.hxx @@ -30,10 +30,12 @@ #ifndef _SMESH_MAXELEMENTVOLUME_HXX_ #define _SMESH_MAXELEMENTVOLUME_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" -class StdMeshers_MaxElementVolume: +class STDMESHERS_EXPORT StdMeshers_MaxElementVolume: public SMESH_Hypothesis { public: diff --git a/src/StdMeshers/StdMeshers_NotConformAllowed.cxx b/src/StdMeshers/StdMeshers_NotConformAllowed.cxx index 3e509cbd9..7e0bd11cb 100644 --- a/src/StdMeshers/StdMeshers_NotConformAllowed.cxx +++ b/src/StdMeshers/StdMeshers_NotConformAllowed.cxx @@ -26,10 +26,11 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_NotConformAllowed.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * diff --git a/src/StdMeshers/StdMeshers_NotConformAllowed.hxx b/src/StdMeshers/StdMeshers_NotConformAllowed.hxx index 33da8ddd6..5cbbb4265 100644 --- a/src/StdMeshers/StdMeshers_NotConformAllowed.hxx +++ b/src/StdMeshers/StdMeshers_NotConformAllowed.hxx @@ -29,10 +29,12 @@ #ifndef _StdMeshers_NotConformAllowed_HXX_ #define _StdMeshers_NotConformAllowed_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" -class StdMeshers_NotConformAllowed: +class STDMESHERS_EXPORT StdMeshers_NotConformAllowed: public SMESH_Hypothesis { public: diff --git a/src/StdMeshers/StdMeshers_NumberOfLayers.cxx b/src/StdMeshers/StdMeshers_NumberOfLayers.cxx new file mode 100644 index 000000000..c1bab0f62 --- /dev/null +++ b/src/StdMeshers/StdMeshers_NumberOfLayers.cxx @@ -0,0 +1,162 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's classes +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_NumberOfLayers.cxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#include "StdMeshers_NumberOfLayers.hxx" + + +#include "utilities.h" + +using namespace std; + + +//============================================================================= +/*! + * StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers + * + * Constructor + */ +//============================================================================= + +StdMeshers_NumberOfLayers::StdMeshers_NumberOfLayers(int hypId, int studyId, + SMESH_Gen * gen) + : SMESH_Hypothesis(hypId, studyId, gen) +{ + _name = "NumberOfLayers"; // used by RadialPrism_3D + _param_algo_dim = 3; // 3D + _nbLayers = 1; +} + +//============================================================================= +/*! + * StdMeshers_NumberOfLayers::~StdMeshers_NumberOfLayers + * + * Destructor + */ +//============================================================================= + +StdMeshers_NumberOfLayers::~StdMeshers_NumberOfLayers() +{ + MESSAGE( "StdMeshers_NumberOfLayers::~StdMeshers_NumberOfLayers" ); +} + +//============================================================================= +/*! + * StdMeshers_NumberOfLayers::SetNumberOfLayers + * + * Sets parameter value + */ +//============================================================================= + +void StdMeshers_NumberOfLayers::SetNumberOfLayers(int numberOfLayers) + throw ( SALOME_Exception ) +{ + if ( _nbLayers != numberOfLayers ) { + if ( numberOfLayers <= 0 ) + throw SALOME_Exception(LOCALIZED("numberOfLayers must be positive")); + _nbLayers = numberOfLayers; + + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * StdMeshers_NumberOfLayers::GetNumberOfLayers + * + * Returns parameter value + */ +//============================================================================= + +int StdMeshers_NumberOfLayers::GetNumberOfLayers() const +{ + return _nbLayers; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +ostream & StdMeshers_NumberOfLayers::SaveTo(ostream & save) +{ + save << _nbLayers; + return save; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +istream & StdMeshers_NumberOfLayers::LoadFrom(istream & load) +{ + bool isOK = true; + isOK = (load >> _nbLayers); + if (!isOK) + load.clear(ios::badbit | load.rdstate()); + return load; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +ostream & operator <<(ostream & save, StdMeshers_NumberOfLayers & hyp) +{ + return hyp.SaveTo( save ); +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +istream & operator >>(istream & load, StdMeshers_NumberOfLayers & hyp) +{ + return hyp.LoadFrom( load ); +} + +//================================================================================ +/*! + * \brief Initialize start and end length by the mesh built on the geometry + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if parameter values have been successfully defined + */ +//================================================================================ + +bool StdMeshers_NumberOfLayers::SetParametersByMesh(const SMESH_Mesh* , + const TopoDS_Shape& ) +{ + return false; +} diff --git a/src/StdMeshers/StdMeshers_NumberOfLayers.hxx b/src/StdMeshers/StdMeshers_NumberOfLayers.hxx new file mode 100644 index 000000000..c0b5a6b1b --- /dev/null +++ b/src/StdMeshers/StdMeshers_NumberOfLayers.hxx @@ -0,0 +1,83 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_NumberOfLayers.hxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#ifndef _SMESH_NumberOfLayers_HXX_ +#define _SMESH_NumberOfLayers_HXX_ + +#include "SMESH_StdMeshers.hxx" + +#include "SMESH_Hypothesis.hxx" +#include "Utils_SALOME_Exception.hxx" + +class SMESH_Gen; + +// ========================================================= +// ========================================================= +/*! + * This hypothesis is used by "Radial prism" algorithm. + * It specifies number of segments between the internal + * and the external surfaces. + */ +// ========================================================= +// ========================================================= + +class STDMESHERS_EXPORT StdMeshers_NumberOfLayers: public SMESH_Hypothesis +{ +public: + // Constructor + StdMeshers_NumberOfLayers( int hypId, int studyId, SMESH_Gen * gen ); + // Destructor + virtual ~StdMeshers_NumberOfLayers(); + + // Sets parameter value + void SetNumberOfLayers(int numberOfLayers) throw ( SALOME_Exception ); + + // Returns parameter value + int GetNumberOfLayers() const; + + virtual std::ostream & SaveTo(std::ostream & save); + virtual std::istream & LoadFrom(std::istream & load); + friend std::ostream & operator <<(std::ostream & save, StdMeshers_NumberOfLayers & hyp); + friend std::istream & operator >>(std::istream & load, StdMeshers_NumberOfLayers & hyp); + + /*! + * \brief Initialize parameters by the mesh built on the geometry + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if parameter values have been successfully defined + * + * Implementation does noting + */ + virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + +protected: + int _nbLayers; +}; + +#endif + diff --git a/src/StdMeshers/StdMeshers_NumberOfSegments.hxx b/src/StdMeshers/StdMeshers_NumberOfSegments.hxx index 05faf2ed3..b967dc933 100644 --- a/src/StdMeshers/StdMeshers_NumberOfSegments.hxx +++ b/src/StdMeshers/StdMeshers_NumberOfSegments.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_NUMBEROFSEGMENTS_HXX_ #define _SMESH_NUMBEROFSEGMENTS_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" #include @@ -40,7 +42,7 @@ * It provides parameters for subdivision an edge by various * distribution types, considering the given number of resulting segments */ -class StdMeshers_NumberOfSegments: +class STDMESHERS_EXPORT StdMeshers_NumberOfSegments: public SMESH_Hypothesis { public: diff --git a/src/StdMeshers/StdMeshers_Penta_3D.cxx b/src/StdMeshers/StdMeshers_Penta_3D.cxx index ec2755317..353afb871 100644 --- a/src/StdMeshers/StdMeshers_Penta_3D.cxx +++ b/src/StdMeshers/StdMeshers_Penta_3D.cxx @@ -35,9 +35,12 @@ #include "SMDS_VolumeTool.hxx" #include "SMESHDS_SubMesh.hxx" #include "SMESH_Mesh.hxx" -#include "SMESH_subMesh.hxx" #include "SMESH_MeshEditor.hxx" +#include "SMESH_subMesh.hxx" +#include "SMESH_subMeshEventListener.hxx" +#include +#include #include #include #include @@ -46,6 +49,7 @@ #include #include #include +#include #include #include #include @@ -63,6 +67,8 @@ using namespace std; typedef map < int, int, less >::iterator \ StdMeshers_IteratorOfDataMapOfIntegerInteger; +enum { NB_WALL_FACES = 4 }; + //======================================================================= //function : StdMeshers_Penta_3D //purpose : @@ -264,81 +270,17 @@ void StdMeshers_Penta_3D::MakeNodes() ++j; } } - /* - //DEB - { - int iShapeSupportID, iBaseNodeID; - // - //printf("\n\n*** Base Face\n"); - i=0; - for (j=0; j aZL(myISize); -// vector::iterator aItZL1, aItZL2 ; -// // -// const TopoDS_Shape& aE00z=myBlock.Shape(SMESH_Block::ID_E00z); -// SMDS_NodeIteratorPtr aItaE00z = -// pMesh->GetSubMeshContaining(aE00z)->GetSubMeshDS()->GetNodes(); -// // -// aZL[0]=0.; -// i=1; -// while (aItaE00z->more()) { -// const SMDS_MeshNode* aNode=aItaE00z->next(); -// const SMDS_EdgePosition* epos = -// static_cast(aNode->GetPosition().get()); -// myBlock.ComputeParameters( epos->GetUParameter(), aE00z, aCoords ); -// iErr=myBlock.ErrorStatus(); -// if (iErr) { -// MESSAGE("StdMeshers_Penta_3D::MakeNodes()," << -// "SMESHBlock: ComputeParameters operation failed"); -// myErrorStatus=101; // SMESHBlock: ComputeParameters operation failed -// return; -// } -// aZL[i]=aCoords.Z(); -// ++i; -// } -// aZL[i]=1.; -// // -// aItZL1=aZL.begin(); -// aItZL2=aZL.end(); -// // -// // Sorting the layers -// sort(aItZL1, aItZL2); - //DEB - /* - printf("** \n\n Layers begin\n"); - for(i=0, aItZL=aItZL1; aItZL!=aItZL2; ++aItZL, ++i) { - printf(" #%d : %lf\n", i, *aItZL); - } - printf("** Layers end\n"); - */ - //DEB - // - // // 3.1 Fill maps of wall nodes - SMESH_Block::TShapeID wallFaceID[4] = { + SMESH_Block::TShapeID wallFaceID[ NB_WALL_FACES ] = { SMESH_Block::ID_Fx0z, SMESH_Block::ID_Fx1z, SMESH_Block::ID_F0yz, SMESH_Block::ID_F1yz }; - SMESH_Block::TShapeID baseEdgeID[4] = { + SMESH_Block::TShapeID baseEdgeID[ NB_WALL_FACES ] = { SMESH_Block::ID_Ex00, SMESH_Block::ID_Ex10, SMESH_Block::ID_E0y0, SMESH_Block::ID_E1y0 }; - for ( i = 0; i < 4; ++i ) { + for ( i = 0; i < NB_WALL_FACES ; ++i ) { int fIndex = SMESH_Block::ShapeIndex( wallFaceID[ i ]); bool ok = LoadIJNodes (myWallNodesMaps[ fIndex ], TopoDS::Face( myBlock.Shape( wallFaceID[ i ] )), @@ -352,9 +294,9 @@ void StdMeshers_Penta_3D::MakeNodes() } // 3.2 find node columns for vertical edges and edge IDs - vector * verticEdgeNodes[ 4 ]; - SMESH_Block::TShapeID verticEdgeID [ 4 ]; - for ( i = 0; i < 4; ++i ) { // 4 first base nodes are nodes on vertices + vector * verticEdgeNodes[ NB_WALL_FACES ]; + SMESH_Block::TShapeID verticEdgeID [ NB_WALL_FACES ]; + for ( i = 0; i < NB_WALL_FACES ; ++i ) { // 4 first base nodes are nodes on vertices // edge ID SMESH_Block::TShapeID eID, vID = aSIDs[ i ]; ShapeSupportID(false, vID, eID); @@ -362,7 +304,7 @@ void StdMeshers_Penta_3D::MakeNodes() // column nodes StdMeshers_TNode& aTNode = myTNodes[ i ]; verticEdgeNodes[ i ] = 0; - for ( j = 0; j < 4; ++j ) { // loop on 4 wall faces + for ( j = 0; j < NB_WALL_FACES ; ++j ) { // loop on 4 wall faces int fIndex = SMESH_Block::ShapeIndex( wallFaceID[ j ]); StdMeshers_IJNodeMap & ijNodes= myWallNodesMaps[ fIndex ]; if ( ijNodes.begin()->second[0] == aTNode.Node() ) @@ -416,20 +358,20 @@ void StdMeshers_Penta_3D::MakeNodes() N = itn->next(); gp_XY UV111 = myTool->GetNodeUV(TopFace,N); - for (j=0; j* nColumns[8]; - double ratio[4]; // base node position between columns [0.-1.] + double ratio[ NB_WALL_FACES ]; // base node position between columns [0.-1.] if ( createNode ) { - for ( k = 0; k < 4; ++k ) { + for ( k = 0; k < NB_WALL_FACES ; ++k ) { ratio[ k ] = SetHorizEdgeXYZ (aBNXYZ, wallFaceID[ k ], nColumns[k*2], nColumns[k*2+1]); } @@ -441,27 +383,31 @@ void StdMeshers_Penta_3D::MakeNodes() myShapeXYZ[ SMESH_Block::ID_Fxy1 ].SetCoord( 0., 0., 0. ); // // first create or find a top node, then the rest ones in a column - for (i=myISize-1; i>0; --i) { + for (i=myISize-1; i>0; --i) // vertical loop, from top to bottom + { bIsUpperLayer = (i==(myISize-1)); gp_XY UV_Ex01, UV_Ex11, UV_E0y1, UV_E1y1; - if ( createNode ) { + if ( createNode ) // a base node is inside a top face + { // set XYZ on vertical edges and faces - for ( k = 0; k < 4; ++k ) { + for ( k = 0; k < NB_WALL_FACES ; ++k ) { + // XYZ on a vertical edge const SMDS_MeshNode* n = (*verticEdgeNodes[ k ]) [ i ]; myShapeXYZ[ verticEdgeID[ k ] ].SetCoord( n->X(), n->Y(), n->Z() ); - // + // XYZ on a face (part 1 from one column) n = (*nColumns[k*2]) [ i ]; + gp_XYZ xyz( n->X(), n->Y(), n->Z() ); + myShapeXYZ[ wallFaceID[ k ]] = ( 1. - ratio[ k ]) * xyz; gp_XY tmp1; - if( i==myISize-1 ) { + if( bIsUpperLayer ) { tmp1 = myTool->GetNodeUV(TopFace,n); tmp1 = ( 1. - ratio[ k ]) * tmp1; } - gp_XYZ xyz( n->X(), n->Y(), n->Z() ); - myShapeXYZ[ wallFaceID[ k ]] = ( 1. - ratio[ k ]) * xyz; + // XYZ on a face (part 2 from other column) n = (*nColumns[k*2+1]) [ i ]; xyz.SetCoord( n->X(), n->Y(), n->Z() ); myShapeXYZ[ wallFaceID[ k ]] += ratio[ k ] * xyz; - if( i==myISize-1 ) { + if( bIsUpperLayer ) { gp_XY tmp2 = myTool->GetNodeUV(TopFace,n); tmp1 += ratio[ k ] * tmp2; if( k==0 ) @@ -662,12 +608,15 @@ double StdMeshers_Penta_3D::SetHorizEdgeXYZ(const gp_XYZ& aBase vector*& aCol2) { // find base and top edges of the face + enum { BASE = 0, TOP }; vector< int > edgeVec; // 0-base, 1-top SMESH_Block::GetFaceEdgesIDs( aFaceID, edgeVec ); // - int coord = SMESH_Block::GetCoordIndOnEdge( edgeVec[ 0 ] ); + int coord = SMESH_Block::GetCoordIndOnEdge( edgeVec[ BASE ] ); + bool isForward = myBlock.IsForwadEdge( edgeVec[ BASE ] ); + double param = aBaseNodeParams.Coord( coord ); - if ( !myBlock.IsForwadEdge( edgeVec[ 0 ] )) + if ( !isForward) param = 1. - param; // // look for columns around param @@ -686,19 +635,34 @@ double StdMeshers_Penta_3D::SetHorizEdgeXYZ(const gp_XYZ& aBase aCol1 = & par_nVec_1->second; aCol2 = & par_nVec_2->second; - // base edge - const SMDS_MeshNode* n1 = aCol1->front(); - const SMDS_MeshNode* n2 = aCol2->front(); - gp_XYZ xyz1( n1->X(), n1->Y(), n1->Z() ), xyz2( n2->X(), n2->Y(), n2->Z() ); - myShapeXYZ[ edgeVec[ 0 ] ] = ( 1. - r ) * xyz1 + r * xyz2; - // top edge - n1 = aCol1->back(); - n2 = aCol2->back(); - xyz1.SetCoord( n1->X(), n1->Y(), n1->Z() ); - xyz2.SetCoord( n2->X(), n2->Y(), n2->Z() ); - myShapeXYZ[ edgeVec[ 1 ] ] = ( 1. - r ) * xyz1 + r * xyz2; + if (1) { + // this variant is better for cases with curved edges and + // different nodes distribution on top and base edges + const SMDS_MeshNode* n1 = aCol1->back(); + const SMDS_MeshNode* n2 = aCol2->back(); + gp_XYZ xyz1( n1->X(), n1->Y(), n1->Z() ); + gp_XYZ xyz2( n2->X(), n2->Y(), n2->Z() ); + myShapeXYZ[ edgeVec[ 1 ] ] = ( 1. - r ) * xyz1 + r * xyz2; + } + else { + // this variant is better for other cases +// SMESH_MesherHelper helper( *GetMesh() ); +// const TopoDS_Edge & edge = TopoDS::Edge( myBlock.Shape( edgeVec[ TOP ])); +// double u1 = helper.GetNodeU( edge, n1 ); +// double u2 = helper.GetNodeU( edge, n2 ); +// double u = ( 1. - r ) * u1 + r * u2; +// gp_XYZ topNodeParams; +// myBlock.Block().EdgeParameters( edgeVec[ TOP ], u, topNodeParams ); +// myBlock.Block().EdgePoint( edgeVec[ TOP ], +// topNodeParams, +// myShapeXYZ[ edgeVec[ TOP ]]); + } + // base edge + myBlock.Block().EdgePoint( edgeVec[ BASE ], + aBaseNodeParams, + myShapeXYZ[ edgeVec[ BASE ]]); return r; } @@ -862,10 +826,13 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1() TopoDS::Face(myBlock.Shape(SMESH_Block::ID_Fxy0)); const TopoDS_Face& aFxy1= TopoDS::Face(myBlock.Shape(SMESH_Block::ID_Fxy1)); + SMESH_MesherHelper faceHelper( *GetMesh() ); + faceHelper.IsQuadraticSubMesh(aFxy1); // SMESH_Mesh* pMesh = GetMesh(); SMESHDS_Mesh * meshDS = pMesh->GetMeshDS(); // + SMESH_subMesh *aSubMesh1 = pMesh->GetSubMeshContaining(aFxy1); SMESH_subMesh *aSubMesh0 = pMesh->GetSubMeshContaining(aFxy0); SMESHDS_SubMesh *aSM0 = aSubMesh0->GetSubMeshDS(); // @@ -889,9 +856,6 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1() aNbNodes = pE0->NbNodes(); if(myCreateQuadratic) aNbNodes = aNbNodes/2; -// if (aNbNodes!=3) { -// continue; -// } if ( aNodes1.size() < aNbNodes ) aNodes1.resize( aNbNodes ); // @@ -919,18 +883,26 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1() SMDS_MeshFace * face = 0; switch ( aNbNodes ) { case 3: - //face = meshDS->AddFace(aNodes1[0], aNodes1[1], aNodes1[2]); - face = myTool->AddFace(aNodes1[0], aNodes1[1], aNodes1[2]); + face = faceHelper.AddFace(aNodes1[0], aNodes1[1], aNodes1[2]); break; case 4: - //face = meshDS->AddFace(aNodes1[0], aNodes1[1], aNodes1[2], aNodes1[3]); - face = myTool->AddFace(aNodes1[0], aNodes1[1], aNodes1[2], aNodes1[3]); + face = faceHelper.AddFace(aNodes1[0], aNodes1[1], aNodes1[2], aNodes1[3]); break; default: continue; } meshDS->SetMeshElementOnShape(face, aFxy1); } + + // update compute state of top face submesh + aSubMesh1->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE ); + + // assure that mesh on the top face will be cleaned when it is cleaned + // on the bottom face + SMESH_subMesh* volSM = pMesh->GetSubMesh( myTool->GetSubShape() ); + volSM->SetEventListener( new SMESH_subMeshEventListener(true), + SMESH_subMeshEventListenerData::MakeData( aSubMesh1 ), + aSubMesh0 ); // translate CLEAN event of aSubMesh0 to aSubMesh1 } //======================================================================= @@ -1307,7 +1279,7 @@ void StdMeshers_Penta_3D::MakeBlock() // // 1.1 Base vertex V000 iNbE = aME.Extent(); - if (iNbE!=4){ + if (iNbE!= NB_WALL_FACES ){ MESSAGE("StdMeshers_Penta_3D::MakeBlock() "); myErrorStatus=7; // too few edges are in base face aFTr return; @@ -1448,7 +1420,7 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, TopExp_Explorer exp( theFace, TopAbs_EDGE ); int nbEdges = 0; for ( ; exp.More(); exp.Next() ) { - if ( ++nbEdges > 4 ) { + if ( ++nbEdges > NB_WALL_FACES ) { return false; // more than 4 edges in theFace } TopoDS_Edge e = TopoDS::Edge( exp.Current() ); @@ -1467,7 +1439,7 @@ bool StdMeshers_Penta_3D::LoadIJNodes(StdMeshers_IJNodeMap & theIJNodes, else e2 = e; } - if ( nbEdges < 4 ) { + if ( nbEdges < NB_WALL_FACES ) { return false; // less than 4 edges in theFace } diff --git a/src/StdMeshers/StdMeshers_Penta_3D.hxx b/src/StdMeshers/StdMeshers_Penta_3D.hxx index df5aaae0f..18787686c 100644 --- a/src/StdMeshers/StdMeshers_Penta_3D.hxx +++ b/src/StdMeshers/StdMeshers_Penta_3D.hxx @@ -27,6 +27,8 @@ #ifndef StdMeshers_Penta_3D_HeaderFile #define StdMeshers_Penta_3D_HeaderFile +#include "SMESH_StdMeshers.hxx" + #include //////////////////////////////////////////////////////////////////////// @@ -47,7 +49,7 @@ typedef std::map< double, std::vector > StdMeshers_IJNodeMap; -class StdMeshers_SMESHBlock { +class STDMESHERS_EXPORT StdMeshers_SMESHBlock { public: // @@ -105,7 +107,7 @@ protected: //////////////////////////////////////////////////////////////////////// #include "SMDS_MeshNode.hxx" -class StdMeshers_TNode { +class STDMESHERS_EXPORT StdMeshers_TNode { public: @@ -163,7 +165,7 @@ private: #include "SMESH_Mesh.hxx" #include // -class StdMeshers_Penta_3D { +class STDMESHERS_EXPORT StdMeshers_Penta_3D { // public: // methods StdMeshers_Penta_3D(); diff --git a/src/StdMeshers/StdMeshers_Prism_3D.cxx b/src/StdMeshers/StdMeshers_Prism_3D.cxx new file mode 100644 index 000000000..db1e08259 --- /dev/null +++ b/src/StdMeshers/StdMeshers_Prism_3D.cxx @@ -0,0 +1,1785 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Prism_3D.cxx +// Module : SMESH +// Created : Fri Oct 20 11:37:07 2006 +// Author : Edward AGAPOV (eap) + + +#include "StdMeshers_Prism_3D.hxx" + +#include "StdMeshers_ProjectionUtils.hxx" +#include "SMESH_MeshEditor.hxx" +#include "SMDS_VolumeTool.hxx" +#include "SMDS_VolumeOfNodes.hxx" +#include "SMDS_EdgePosition.hxx" + +#include "utilities.h" + +#include +#include +#include +#include +#include +#include +#include + +using namespace std; + +#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; } +#define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z()) +#define SHOWYXZ(msg, xyz) // {\ +// gp_Pnt p (xyz); \ +// cout << msg << " ("<< p.X() << "; " <upper_bound( parameter ); + if ( u_col != columnsMap->begin() ) + --u_col; + return u_col; // return left column + } + + //================================================================================ + /*! + * \brief Return nodes around given parameter and a ratio + * \param column - node column + * \param param - parameter + * \param node1 - lower node + * \param node2 - upper node + * \retval double - ratio + */ + //================================================================================ + + double getRAndNodes( const TNodeColumn* column, + const double param, + const SMDS_MeshNode* & node1, + const SMDS_MeshNode* & node2) + { + if ( param == 1.0 || column->size() == 1) { + node1 = node2 = column->back(); + return 0; + } + + int i = int( param * ( column->size() - 1 )); + double u0 = double( i )/ double( column->size() - 1 ); + double r = ( param - u0 ) * ( column->size() - 1 ); + + node1 = (*column)[ i ]; + node2 = (*column)[ i + 1]; + return r; + } + + //================================================================================ + /*! + * \brief Compute boundary parameters of face parts + * \param nbParts - nb of parts to split columns into + * \param columnsMap - node columns of the face to split + * \param params - computed parameters + */ + //================================================================================ + + void splitParams( const int nbParts, + const TParam2ColumnMap* columnsMap, + vector< double > & params) + { + params.clear(); + params.reserve( nbParts + 1 ); + TParam2ColumnIt last_par_col = --columnsMap->end(); + double par = columnsMap->begin()->first; // 0. + double parLast = last_par_col->first; + params.push_back( par ); + for ( int i = 0; i < nbParts - 1; ++ i ) + { + double partSize = ( parLast - par ) / double ( nbParts - i ); + TParam2ColumnIt par_col = getColumn( columnsMap, par + partSize ); + if ( par_col->first == par ) { + ++par_col; + if ( par_col == last_par_col ) { + while ( i < nbParts - 1 ) + params.push_back( par + partSize * i++ ); + break; + } + } + par = par_col->first; + params.push_back( par ); + } + params.push_back( parLast ); // 1. + } +} + +//======================================================================= +//function : StdMeshers_Prism_3D +//purpose : +//======================================================================= + +StdMeshers_Prism_3D::StdMeshers_Prism_3D(int hypId, int studyId, SMESH_Gen* gen) + :SMESH_3D_Algo(hypId, studyId, gen) +{ + _name = "Prism_3D"; + _shapeType = (1 << TopAbs_SHELL) | (1 << TopAbs_SOLID); // 1 bit per shape type + myProjectTriangles = false; +} + +//================================================================================ +/*! + * \brief Destructor + */ +//================================================================================ + +StdMeshers_Prism_3D::~StdMeshers_Prism_3D() +{} + +//======================================================================= +//function : CheckHypothesis +//purpose : +//======================================================================= + +bool StdMeshers_Prism_3D::CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus) +{ + // Check shape geometry + + aStatus = SMESH_Hypothesis::HYP_BAD_GEOMETRY; + + // find not quadrangle faces + list< TopoDS_Shape > notQuadFaces; + int nbEdge, nbWire, nbFace = 0; + TopExp_Explorer exp( aShape, TopAbs_FACE ); + for ( ; exp.More(); exp.Next() ) { + ++nbFace; + const TopoDS_Shape& face = exp.Current(); + nbEdge = TAssocTool::Count( face, TopAbs_EDGE, 0 ); + nbWire = TAssocTool::Count( face, TopAbs_WIRE, 0 ); + if ( nbEdge!= 4 || nbWire!= 1 ) { + if ( !notQuadFaces.empty() ) { + if ( TAssocTool::Count( notQuadFaces.back(), TopAbs_EDGE, 0 ) != nbEdge || + TAssocTool::Count( notQuadFaces.back(), TopAbs_WIRE, 0 ) != nbWire ) + RETURN_BAD_RESULT("Different not quad faces"); + } + notQuadFaces.push_back( face ); + } + } + if ( !notQuadFaces.empty() ) + { + if ( notQuadFaces.size() != 2 ) + RETURN_BAD_RESULT("Bad nb not quad faces: " << notQuadFaces.size()); + + // check total nb faces + nbEdge = TAssocTool::Count( notQuadFaces.back(), TopAbs_EDGE, 0 ); + if ( nbFace != nbEdge + 2 ) + RETURN_BAD_RESULT("Bad nb of faces: " << nbFace << " but must be " << nbEdge + 2); + } + + // no hypothesis + aStatus = SMESH_Hypothesis::HYP_OK; + return true; +} + +//======================================================================= +//function : Compute +//purpose : +//======================================================================= + +bool StdMeshers_Prism_3D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theShape) +{ + myHelper = new SMESH_MesherHelper( theMesh ); + // to delete helper at exit from Compute() + std::auto_ptr helperDeleter( myHelper ); + + myHelper->IsQuadraticSubMesh( theShape ); + + // Analyse mesh and geomerty to find block subshapes and submeshes + if ( !myBlock.Init( myHelper, theShape )) + return false; + + SMESHDS_Mesh* meshDS = theMesh.GetMeshDS(); + + int volumeID = meshDS->ShapeToIndex( theShape ); + + + // To compute coordinates of a node inside a block, it is necessary to know + // 1. normalized parameters of the node by which + // 2. coordinates of node projections on all block sub-shapes are computed + + // So we fill projections on vertices at once as they are same for all nodes + myShapeXYZ.resize( myBlock.NbSubShapes() ); + for ( int iV = SMESH_Block::ID_FirstV; iV < SMESH_Block::ID_FirstE; ++iV ) { + myBlock.VertexPoint( iV, myShapeXYZ[ iV ]); + SHOWYXZ("V point " <first; // bottom TNode + if ( tBotNode.GetPositionType() != SMDS_TOP_FACE ) + continue; // node is not inside face + + // column nodes; middle part of the column are zero pointers + TNodeColumn& column = bot_column->second; + + // bottom node parameters and coords + gp_XYZ botParams = tBotNode.GetParams(); + myShapeXYZ[ ID_BOT_FACE ] = tBotNode.GetCoords(); + + // compute top node parameters + gp_XYZ topParams; + myShapeXYZ[ ID_TOP_FACE ] = gpXYZ( column.back() ); + gp_Pnt topCoords = myShapeXYZ[ ID_TOP_FACE ]; + if ( !myBlock.ComputeParameters( topCoords, topParams, ID_TOP_FACE )) + RETURN_BAD_RESULT("ComputeParameters() on the top face failed"); + + // vertical loop + TNodeColumn::iterator columnNodes = column.begin(); + for ( int z = 0; columnNodes != column.end(); ++columnNodes, ++z) + { + const SMDS_MeshNode* & node = *columnNodes; + if ( node ) continue; // skip bottom or top node + + // params of a node to create + double rz = (double) z / (double) ( column.size() - 1 ); + gp_XYZ params = botParams * ( 1 - rz ) + topParams * rz; + + // set coords on all faces and nodes + const int nbSideFaces = 4; + int sideFaceIDs[nbSideFaces] = { SMESH_Block::ID_Fx0z, + SMESH_Block::ID_Fx1z, + SMESH_Block::ID_F0yz, + SMESH_Block::ID_F1yz }; + for ( int iF = 0; iF < nbSideFaces; ++iF ) + if ( !setFaceAndEdgesXYZ( sideFaceIDs[ iF ], params, z )) + return false; + + // compute coords for a new node + gp_XYZ coords; + if ( !SMESH_Block::ShellPoint( params, myShapeXYZ, coords )) + RETURN_BAD_RESULT("SMESH_Block::ShellPoint() failed"); + + // create a node + node = meshDS->AddNode( coords.X(), coords.Y(), coords.Z() ); + meshDS->SetNodeInVolume( node, volumeID ); + } + } // loop on bottom nodes + + + // Create volumes + + SMESHDS_SubMesh* smDS = myBlock.SubMeshDS( ID_BOT_FACE ); + if ( !smDS ) RETURN_BAD_RESULT("Null submesh"); + + // loop on bottom mesh faces + SMDS_ElemIteratorPtr faceIt = smDS->GetElements(); + while ( faceIt->more() ) + { + const SMDS_MeshElement* face = faceIt->next(); + if ( !face || face->GetType() != SMDSAbs_Face ) + continue; + int nbNodes = face->NbNodes(); + if ( face->IsQuadratic() ) + nbNodes /= 2; + + // find node columns for each node + vector< const TNodeColumn* > columns( nbNodes ); + for ( int i = 0; i < nbNodes; ++i ) + { + const SMDS_MeshNode* n = face->GetNode( i ); + if ( n->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) { + bot_column = myBotToColumnMap.find( n ); + if ( bot_column == myBotToColumnMap.end() ) + RETURN_BAD_RESULT(" node column for a node not found"); + columns[ i ] = & bot_column->second; + } + else { + columns[ i ] = myBlock.GetNodeColumn( n ); + if ( !columns[ i ] ) + RETURN_BAD_RESULT(" node column not found for a node " << n->GetID() ); + } + } + // create prisms + AddPrisms( columns, myHelper ); + + } // loop on bottom mesh faces + + return true; +} + +//================================================================================ +/*! + * \brief Create prisms + * \param columns - columns of nodes generated from nodes of a mesh face + * \param helper - helper initialized by mesh and shape to add prisms to + */ +//================================================================================ + +void StdMeshers_Prism_3D::AddPrisms( vector & columns, + SMESH_MesherHelper* helper) +{ + SMESHDS_Mesh * meshDS = helper->GetMeshDS(); + int shapeID = helper->GetSubShapeID(); + + int nbNodes = columns.size(); + + // vertical loop on columns + for ( int z = 1; z < columns[0]->size(); ++z) + { + SMDS_MeshElement* vol = 0; + SMDS_VolumeTool vTool; + switch ( nbNodes ) { + + case 3: { + const SMDS_MeshNode* botNodes[3] = { (*columns[0])[z-1], + (*columns[1])[z-1], + (*columns[2])[z-1] }; + const SMDS_MeshNode* topNodes[3] = { (*columns[0])[z], + (*columns[1])[z], + (*columns[2])[z] }; + // assure good orientation + SMDS_VolumeOfNodes tmpVol ( botNodes[0], botNodes[1], botNodes[2], + topNodes[0], topNodes[1], topNodes[2]); + vTool.Set( &tmpVol ); + if ( vTool.IsForward() ) + vol = helper->AddVolume( botNodes[0], botNodes[1], botNodes[2], + topNodes[0], topNodes[1], topNodes[2]); + else + vol = helper->AddVolume( topNodes[0], topNodes[1], topNodes[2], + botNodes[0], botNodes[1], botNodes[2]); + break; + } + case 4: { + const SMDS_MeshNode* botNodes[4] = { (*columns[0])[z-1], (*columns[1])[z-1], + (*columns[2])[z-1], (*columns[3])[z-1] }; + const SMDS_MeshNode* topNodes[4] = { (*columns[0])[z], (*columns[1])[z], + (*columns[2])[z], (*columns[3])[z] }; + // assure good orientation + SMDS_VolumeOfNodes tmpVol ( botNodes[0], botNodes[1], botNodes[2], botNodes[3], + topNodes[0], topNodes[1], topNodes[2], topNodes[3]); + vTool.Set( &tmpVol ); + if ( vTool.IsForward() ) + vol = helper->AddVolume( botNodes[0], botNodes[1], botNodes[2], botNodes[3], + topNodes[0], topNodes[1], topNodes[2], topNodes[3]); + else + vol = helper->AddVolume( topNodes[0], topNodes[1], topNodes[2], topNodes[3], + botNodes[0], botNodes[1], botNodes[2], botNodes[3]); + break; + } + default: + // polyhedron + vector nodes( 2*nbNodes + 4*nbNodes); + vector quantities( 2 + nbNodes, 4 ); + quantities[0] = quantities[1] = nbNodes; + columns.resize( nbNodes + 1 ); + columns[ nbNodes ] = columns[ 0 ]; + for ( int i = 0; i < nbNodes; ++i ) { + nodes[ i ] = (*columns[ i ])[z-1]; // bottom + nodes[ i+nbNodes ] = (*columns[ i ])[z ]; // top + // side + int di = 2*nbNodes + 4*i - 1; + nodes[ di ] = (*columns[i ])[z-1]; + nodes[ di+1 ] = (*columns[i+1])[z-1]; + nodes[ di+2 ] = (*columns[i+1])[z ]; + nodes[ di+3 ] = (*columns[i ])[z ]; + } + vol = meshDS->AddPolyhedralVolume( nodes, quantities ); + } + if ( vol && shapeID > 0 ) + meshDS->SetMeshElementOnShape( vol, shapeID ); + } +} + +//================================================================================ +/*! + * \brief Find correspondence between bottom and top nodes + * If elements on the bottom and top faces are topologically different, + * and projection is possible and allowed, perform the projection + * \retval bool - is a success or not + */ +//================================================================================ + +bool StdMeshers_Prism_3D::assocOrProjBottom2Top() +{ + SMESH_subMesh * botSM = myBlock.SubMesh( ID_BOT_FACE ); + SMESH_subMesh * topSM = myBlock.SubMesh( ID_TOP_FACE ); + + SMESHDS_SubMesh * botSMDS = botSM->GetSubMeshDS(); + SMESHDS_SubMesh * topSMDS = topSM->GetSubMeshDS(); + + if ( !botSMDS || botSMDS->NbElements() == 0 ) + RETURN_BAD_RESULT("Empty horiz submesh"); + + bool needProject = false; + if ( !topSMDS || + botSMDS->NbElements() != topSMDS->NbElements() || + botSMDS->NbNodes() != topSMDS->NbNodes()) + { + if ( myBlock.HasNotQuadElemOnTop() ) + RETURN_BAD_RESULT("Different triangles on 2 sides"); + needProject = true; + } + + if ( 0/*needProject && !myProjectTriangles*/ ) + RETURN_BAD_RESULT("Need to project but not allowed"); + + if ( needProject ) + { + return projectBottomToTop(); + } + + TopoDS_Face botFace = TopoDS::Face( myBlock.Shape( ID_BOT_FACE )); + TopoDS_Face topFace = TopoDS::Face( myBlock.Shape( ID_TOP_FACE )); + // associate top and bottom faces + TAssocTool::TShapeShapeMap shape2ShapeMap; + if ( !TAssocTool::FindSubShapeAssociation( botFace, myBlock.Mesh(), + topFace, myBlock.Mesh(), + shape2ShapeMap) ) + RETURN_BAD_RESULT("FindSubShapeAssociation failed"); + + // Find matching nodes of in and out faces + TNodeNodeMap n2nMap; + if ( ! TAssocTool::FindMatchingNodesOnFaces( botFace, myBlock.Mesh(), + topFace, myBlock.Mesh(), + shape2ShapeMap, n2nMap )) + RETURN_BAD_RESULT("Different mesh on top and bottom faces"); + + // Fill myBotToColumnMap + + int zSize = myBlock.VerticalSize(); + TNodeNodeMap::iterator bN_tN = n2nMap.begin(); + for ( ; bN_tN != n2nMap.end(); ++bN_tN ) + { + const SMDS_MeshNode* botNode = bN_tN->first; + const SMDS_MeshNode* topNode = bN_tN->second; + if ( botNode->GetPosition()->GetTypeOfPosition() != SMDS_TOP_FACE ) + continue; // wall columns are contained in myBlock + // compute bottom node params + TNode bN( botNode ); + if ( !myBlock.ComputeParameters( bN.GetCoords(), bN.ChangeParams(), ID_BOT_FACE )) + RETURN_BAD_RESULT("ComputeParameters() on the bottom face failed"); + // create node column + TNode2ColumnMap::iterator bN_col = + myBotToColumnMap.insert( make_pair ( bN, TNodeColumn() )).first; + TNodeColumn & column = bN_col->second; + column.resize( zSize ); + column.front() = botNode; + column.back() = topNode; + } + return true; +} + +//================================================================================ +/*! + * \brief Remove quadrangles from the top face and + * create triangles there by projection from the bottom + * \retval bool - a success or not + */ +//================================================================================ + +bool StdMeshers_Prism_3D::projectBottomToTop() +{ + SMESH_subMesh * botSM = myBlock.SubMesh( ID_BOT_FACE ); + SMESH_subMesh * topSM = myBlock.SubMesh( ID_TOP_FACE ); + + SMESHDS_SubMesh * botSMDS = botSM->GetSubMeshDS(); + SMESHDS_SubMesh * topSMDS = topSM->GetSubMeshDS(); + + if ( topSMDS ) + topSM->ComputeStateEngine( SMESH_subMesh::CLEAN ); + + SMESHDS_Mesh* meshDS = myBlock.MeshDS(); + int shapeID = myHelper->GetSubShapeID(); + int topFaceID = meshDS->ShapeToIndex( topSM->GetSubShape() ); + + // Fill myBotToColumnMap + + int zSize = myBlock.VerticalSize(); + SMDS_NodeIteratorPtr nIt = botSMDS->GetNodes(); + while ( nIt->more() ) + { + const SMDS_MeshNode* botNode = nIt->next(); + if ( botNode->GetPosition()->GetTypeOfPosition() != SMDS_TOP_FACE ) + continue; // strange + // compute bottom node params + TNode bN( botNode ); + if ( !myBlock.ComputeParameters( bN.GetCoords(), bN.ChangeParams(), ID_BOT_FACE )) + RETURN_BAD_RESULT("ComputeParameters() on the bottom face failed"); + // compute top node coords + gp_XYZ topXYZ; gp_XY topUV; + if ( !myBlock.FacePoint( ID_TOP_FACE, bN.GetParams(), topXYZ ) || + !myBlock.FaceUV ( ID_TOP_FACE, bN.GetParams(), topUV )) + RETURN_BAD_RESULT("SMESH_Block::FacePoint() on the top face failed"); + SMDS_MeshNode * topNode = meshDS->AddNode( topXYZ.X(),topXYZ.Y(),topXYZ.Z() ); + meshDS->SetNodeOnFace( topNode, topFaceID, topUV.X(), topUV.Y() ); + // create node column + TNode2ColumnMap::iterator bN_col = + myBotToColumnMap.insert( make_pair ( bN, TNodeColumn() )).first; + TNodeColumn & column = bN_col->second; + column.resize( zSize ); + column.front() = botNode; + column.back() = topNode; + } + + // Create top faces + + // loop on bottom mesh faces + SMDS_ElemIteratorPtr faceIt = botSMDS->GetElements(); + while ( faceIt->more() ) + { + const SMDS_MeshElement* face = faceIt->next(); + if ( !face || face->GetType() != SMDSAbs_Face ) + continue; + int nbNodes = face->NbNodes(); + if ( face->IsQuadratic() ) + nbNodes /= 2; + + // find top node in columns for each bottom node + vector< const SMDS_MeshNode* > nodes( nbNodes ); + for ( int i = 0; i < nbNodes; ++i ) + { + const SMDS_MeshNode* n = face->GetNode( nbNodes - i - 1 ); + if ( n->GetPosition()->GetTypeOfPosition() == SMDS_TOP_FACE ) { + TNode2ColumnMap::iterator bot_column = myBotToColumnMap.find( n ); + if ( bot_column == myBotToColumnMap.end() ) + RETURN_BAD_RESULT(" node column for a node not found"); + nodes[ i ] = bot_column->second.back(); + } + else { + const TNodeColumn* column = myBlock.GetNodeColumn( n ); + if ( !column ) + RETURN_BAD_RESULT(" node column not found for a node " << n->GetID() ); + nodes[ i ] = column->back(); + } + } + // create a face, with reversed orientation + SMDS_MeshElement* newFace = 0; + switch ( nbNodes ) { + + case 3: { + newFace = myHelper->AddFace(nodes[0], nodes[1], nodes[2]); + break; + } + case 4: { + newFace = myHelper->AddFace( nodes[0], nodes[1], nodes[2], nodes[3] ); + break; + } + default: + newFace = meshDS->AddPolygonalFace( nodes ); + } + if ( newFace && shapeID > 0 ) + meshDS->SetMeshElementOnShape( newFace, shapeID ); + } + + return true; +} + +//================================================================================ +/*! + * \brief Set projection coordinates of a node to a face and it's subshapes + * \param faceID - the face given by in-block ID + * \param params - node normalized parameters + * \retval bool - is a success + */ +//================================================================================ + +bool StdMeshers_Prism_3D::setFaceAndEdgesXYZ( const int faceID, const gp_XYZ& params, int z ) +{ + // find base and top edges of the face + enum { BASE = 0, TOP, LEFT, RIGHT }; + vector< int > edgeVec; // 0-base, 1-top + SMESH_Block::GetFaceEdgesIDs( faceID, edgeVec ); + + myBlock.EdgePoint( edgeVec[ BASE ], params, myShapeXYZ[ edgeVec[ BASE ]]); + myBlock.EdgePoint( edgeVec[ TOP ], params, myShapeXYZ[ edgeVec[ TOP ]]); + + SHOWYXZ("\nparams ", params); + SHOWYXZ("TOP is "< sideFaces( NB_WALL_FACES, 0 ); + vector< pair< double, double> > params ( NB_WALL_FACES ); + mySide = new TSideFace( sideFaces, params ); + + myHelper = helper; + SMESHDS_Mesh* meshDS = myHelper->GetMesh()->GetMeshDS(); + + SMESH_Block::init(); + myShapeIDMap.Clear(); + myShapeIndex2ColumnMap.clear(); + + int wallFaceIds[ NB_WALL_FACES ] = { // to walk around a block + SMESH_Block::ID_Fx0z, SMESH_Block::ID_F1yz, + SMESH_Block::ID_Fx1z, SMESH_Block::ID_F0yz + }; + + // ------------------------------------------------------------- + // Look for top and bottom faces: not quadrangle ones or meshed + // with not quadrangle elements + // ------------------------------------------------------------- + + list< SMESH_subMesh* > notQuadGeomSubMesh; + list< SMESH_subMesh* > notQuadElemSubMesh; + int nbFaces = 0; + // + SMESH_subMesh* mainSubMesh = myHelper->GetMesh()->GetSubMeshContaining( shape3D ); + if ( !mainSubMesh ) RETURN_BAD_RESULT("Null submesh of shape3D"); + // + const map< int, SMESH_subMesh * >& subSM = mainSubMesh->DependsOn(); + map< int, SMESH_subMesh * >::const_iterator i_subSM = subSM.begin(); + for ( ; i_subSM != subSM.end(); ++i_subSM ) + { + SMESH_subMesh* sm = i_subSM->second; + const TopoDS_Shape& face = sm->GetSubShape(); + if ( face.ShapeType() != TopAbs_FACE ) + continue; + nbFaces++; + + // is quadrangle face? + if ( TAssocTool::Count( face, TopAbs_EDGE, 0 ) != 4 || + TAssocTool::Count( face, TopAbs_WIRE, 0 ) != 1 ) + notQuadGeomSubMesh.push_back( sm ); + + // count not quadrangle mesh elements + if ( SMESHDS_SubMesh* smDS = sm->GetSubMeshDS() ) { + SMDS_ElemIteratorPtr eIt = smDS->GetElements(); + bool hasNotQuad = false; + while ( eIt->more() && !hasNotQuad ) { + const SMDS_MeshElement* elem = eIt->next(); + if ( elem->GetType() == SMDSAbs_Face ) { + int nbNodes = elem->NbNodes(); + if ( elem->IsQuadratic() ) + nbNodes /= 2; + hasNotQuad = ( nbNodes != 4 ); + } + } + if ( hasNotQuad ) + notQuadElemSubMesh.push_back( sm ); + } + else { + RETURN_BAD_RESULT("not meshed face"); + } + } + + // ---------------------------------------------------------------------- + // Analyse faces mesh and topology: choose the bottom submesh. + // If there are not quadrangle geom faces, they are top and bottom ones. + // Not quadrangle geom faces must be only on top and bottom. + // ---------------------------------------------------------------------- + + SMESH_subMesh * botSM = 0; + SMESH_subMesh * topSM = 0; + + int nbNotQuad = notQuadGeomSubMesh.size(); + int nbNotQuadMeshed = notQuadElemSubMesh.size(); + bool hasNotQuad = ( nbNotQuad || nbNotQuadMeshed ); + + // detect bad cases + if ( nbNotQuad > 0 && nbNotQuad != 2 ) + RETURN_BAD_RESULT("Wrong shape geometry"); + if ( nbNotQuadMeshed > 2 ) + RETURN_BAD_RESULT("More then 2 faces meshed with not quadrangle elements"); + + // get found submeshes + if ( hasNotQuad ) + { + if ( nbNotQuadMeshed > 0 ) botSM = notQuadElemSubMesh.front(); + else botSM = notQuadGeomSubMesh.front(); + if ( nbNotQuadMeshed > 1 ) topSM = notQuadElemSubMesh.back(); + else if ( nbNotQuad > 1 ) topSM = notQuadGeomSubMesh.back(); + } + // detect other bad cases + if ( nbNotQuad == 2 && nbNotQuadMeshed > 0 ) { + bool ok = false; + if ( nbNotQuadMeshed == 1 ) + ok = ( find( notQuadGeomSubMesh.begin(), + notQuadGeomSubMesh.end(), botSM ) != notQuadGeomSubMesh.end() ); + else + ok = ( notQuadGeomSubMesh == notQuadElemSubMesh ); + if ( !ok ) + RETURN_BAD_RESULT("Side face meshed with not quadrangle elements"); + } + + myNotQuadOnTop = ( nbNotQuadMeshed > 1 ); + + // ---------------------------------------------------------- + + if ( nbNotQuad == 0 ) // Standard block of 6 quadrangle faces ? + { + // SMESH_Block will perform geometry analysis, we need just to find 2 + // connected vertices on top and bottom + + TopoDS_Vertex Vbot, Vtop; + if ( nbNotQuadMeshed > 0 ) // Look for vertices + { + TopTools_IndexedMapOfShape edgeMap; + TopExp::MapShapes( botSM->GetSubShape(), TopAbs_EDGE, edgeMap ); + // vertex 1 is any vertex of the bottom face + Vbot = TopExp::FirstVertex( TopoDS::Edge( edgeMap( 1 ))); + // vertex 2 is end vertex of edge sharing Vbot and not belonging to the bottom face + TopTools_ListIteratorOfListOfShape ancestIt = Mesh()->GetAncestors( Vbot ); + for ( ; Vtop.IsNull() && ancestIt.More(); ancestIt.Next() ) + { + const TopoDS_Shape & ancestor = ancestIt.Value(); + if ( ancestor.ShapeType() == TopAbs_EDGE && !edgeMap.FindIndex( ancestor )) + { + Vtop = TopExp::LastVertex( TopoDS::Edge( ancestor )); + if ( Vbot.IsSame ( Vtop )) + Vtop = TopExp::FirstVertex( TopoDS::Edge( ancestor )); + } + } + } + // get shell from shape3D + TopoDS_Shell shell; + TopExp_Explorer exp( shape3D, TopAbs_SHELL ); + int nbShell = 0; + for ( ; exp.More(); exp.Next(), ++nbShell ) + shell = TopoDS::Shell( exp.Current() ); +// if ( nbShell != 1 ) +// RETURN_BAD_RESULT("There must be 1 shell in the block"); + + // Load geometry in SMESH_Block + if ( !SMESH_Block::FindBlockShapes( shell, Vbot, Vtop, myShapeIDMap )) { + if ( !hasNotQuad ) + RETURN_BAD_RESULT("Can not detect top and bottom"); + } + else { + if ( !botSM ) botSM = Mesh()->GetSubMeshContaining( myShapeIDMap( ID_BOT_FACE )); + if ( !topSM ) topSM = Mesh()->GetSubMeshContaining( myShapeIDMap( ID_TOP_FACE )); + } + + } // end Standard block of 6 quadrangle faces + // -------------------------------------------------------- + + // Here the top and bottom faces are found + if ( nbNotQuadMeshed == 2 ) // roughly check correspondence of horiz meshes + { +// SMESHDS_SubMesh* topSMDS = topSM->GetSubMeshDS(); +// SMESHDS_SubMesh* botSMDS = botSM->GetSubMeshDS(); +// if ( topSMDS->NbNodes() != botSMDS->NbNodes() || +// topSMDS->NbElements() != botSMDS->NbElements() ) +// RETURN_BAD_RESULT("Top mesh doesn't correspond to bottom one"); + } + + // --------------------------------------------------------- + // If there are not quadrangle geom faces, we emulate + // a block of 6 quadrangle faces. + // Load SMESH_Block with faces and edges geometry + // --------------------------------------------------------- + + + // find vertex 000 - the one with smallest coordinates (for easy DEBUG :-) + TopoDS_Vertex V000; + double minVal = DBL_MAX, minX, val; + for ( TopExp_Explorer exp( botSM->GetSubShape(), TopAbs_VERTEX ); + exp.More(); exp.Next() ) + { + const TopoDS_Vertex& v = TopoDS::Vertex( exp.Current() ); + gp_Pnt P = BRep_Tool::Pnt( v ); + val = P.X() + P.Y() + P.Z(); + if ( val < minVal || ( val == minVal && P.X() < minX )) { + V000 = v; + minVal = val; + minX = P.X(); + } + } + + // Get ordered bottom edges + list< TopoDS_Edge > orderedEdges; + list< int > nbVertexInWires; + SMESH_Block::GetOrderedEdges( TopoDS::Face( botSM->GetSubShape().Reversed() ), + V000, orderedEdges, nbVertexInWires ); +// if ( nbVertexInWires.size() != 1 ) +// RETURN_BAD_RESULT("Wrong prism geometry"); + + // Get Wall faces corresponding to the ordered bottom edges + list< TopoDS_Face > wallFaces; + if ( !GetWallFaces( Mesh(), shape3D, botSM->GetSubShape(), orderedEdges, wallFaces)) + RETURN_BAD_RESULT("GetWallFaces() failed"); + + // Find columns of wall nodes and calculate edges' lengths + // -------------------------------------------------------- + + myParam2ColumnMaps.clear(); + myParam2ColumnMaps.resize( orderedEdges.size() ); // total nb edges + + int iE, nbEdges = nbVertexInWires.front(); // nb outer edges + vector< double > edgeLength( nbEdges ); + map< double, int > len2edgeMap; + + list< TopoDS_Edge >::iterator edgeIt = orderedEdges.begin(); + list< TopoDS_Face >::iterator faceIt = wallFaces.begin(); + for ( iE = 0; iE < nbEdges; ++edgeIt, ++faceIt ) + { + TParam2ColumnMap & faceColumns = myParam2ColumnMaps[ iE ]; + if ( !myHelper->LoadNodeColumns( faceColumns, *faceIt, *edgeIt, meshDS )) + RETURN_BAD_RESULT("SMESH_MesherHelper::LoadNodeColumns() failed"); + + SHOWYXZ("\np1 F "<second.front() )); + SHOWYXZ("p2 F "<second.front() )); + SHOWYXZ("V First "<MeshElements( *edgeIt); + if ( !smDS ) + RETURN_BAD_RESULT("Null submesh on a bottom edge"); + // assure length uniqueness + edgeLength[ iE ] *= smDS->NbNodes() + edgeLength[ iE ] / ( 1000 + iE ); + len2edgeMap[ edgeLength[ iE ]] = iE; + } + ++iE; + } + // Load columns of internal edges (forming holes) + // and fill map ShapeIndex to TParam2ColumnMap for them + for ( ; edgeIt != orderedEdges.end() ; ++edgeIt, ++faceIt ) + { + TParam2ColumnMap & faceColumns = myParam2ColumnMaps[ iE ]; + if ( !myHelper->LoadNodeColumns( faceColumns, *faceIt, *edgeIt, meshDS )) + RETURN_BAD_RESULT("SMESH_MesherHelper::LoadNodeColumns() failed"); + // edge columns + int id = MeshDS()->ShapeToIndex( *edgeIt ); + bool isForward = true; // meaningless for intenal wires + myShapeIndex2ColumnMap[ id ] = make_pair( & faceColumns, isForward ); + // columns for vertices + // 1 + const SMDS_MeshNode* n0 = faceColumns.begin()->second.front(); + id = n0->GetPosition()->GetShapeId(); + myShapeIndex2ColumnMap[ id ] = make_pair( & faceColumns, isForward ); + // 2 + const SMDS_MeshNode* n1 = faceColumns.rbegin()->second.front(); + id = n1->GetPosition()->GetShapeId(); + myShapeIndex2ColumnMap[ id ] = make_pair( & faceColumns, isForward ); +// SHOWYXZ("\np1 F "<second.front() )); +// SHOWYXZ("p2 F "<second.front() )); +// SHOWYXZ("V First "< iE2nbSplit; + if ( nbEdges != NB_WALL_FACES ) // define how to split + { + if ( len2edgeMap.size() != nbEdges ) + RETURN_BAD_RESULT("Uniqueness of edge lengths not assured"); + map< double, int >::reverse_iterator maxLen_i = len2edgeMap.rbegin(); + map< double, int >::reverse_iterator midLen_i = ++len2edgeMap.rbegin(); + double maxLen = maxLen_i->first; + double midLen = ( len2edgeMap.size() == 1 ) ? 0 : midLen_i->first; + switch ( nbEdges ) { + case 1: // 0-th edge is split into 4 parts + iE2nbSplit.insert( make_pair( 0, 4 )); break; + case 2: // either the longest edge is split into 3 parts, or both edges into halves + if ( maxLen / 3 > midLen / 2 ) { + iE2nbSplit.insert( make_pair( maxLen_i->second, 3 )); + } + else { + iE2nbSplit.insert( make_pair( maxLen_i->second, 2 )); + iE2nbSplit.insert( make_pair( midLen_i->second, 2 )); + } + break; + case 3: + // split longest into halves + iE2nbSplit.insert( make_pair( maxLen_i->second, 2 )); + } + } + // Create TSideFace's + faceIt = wallFaces.begin(); + edgeIt = orderedEdges.begin(); + int iSide = 0; + for ( iE = 0; iE < nbEdges; ++edgeIt, ++faceIt ) + { + // split? + map< int, int >::iterator i_nb = iE2nbSplit.find( iE ); + if ( i_nb != iE2nbSplit.end() ) { + // split! + int nbSplit = i_nb->second; + vector< double > params; + splitParams( nbSplit, &myParam2ColumnMaps[ iE ], params ); + bool isForward = ( edgeIt->Orientation() == TopAbs_FORWARD ); + for ( int i = 0; i < nbSplit; ++i ) { + double f = ( isForward ? params[ i ] : params[ nbSplit - i-1 ]); + double l = ( isForward ? params[ i+1 ] : params[ nbSplit - i ]); + TSideFace* comp = new TSideFace( myHelper, wallFaceIds[ iSide ], + *faceIt, *edgeIt, + &myParam2ColumnMaps[ iE ], f, l ); + mySide->SetComponent( iSide++, comp ); + } + } + else { + TSideFace* comp = new TSideFace( myHelper, wallFaceIds[ iSide ], + *faceIt, *edgeIt, + &myParam2ColumnMaps[ iE ]); + mySide->SetComponent( iSide++, comp ); + } + ++iE; + } + } + else { // **************************** Unite faces + + // unite first faces + int nbExraFaces = nbEdges - 3; + int iSide = 0, iE; + double u0 = 0, sumLen = 0; + for ( iE = 0; iE < nbExraFaces; ++iE ) + sumLen += edgeLength[ iE ]; + + vector< TSideFace* > components( nbExraFaces ); + vector< pair< double, double> > params( nbExraFaces ); + faceIt = wallFaces.begin(); + edgeIt = orderedEdges.begin(); + for ( iE = 0; iE < nbExraFaces; ++edgeIt, ++faceIt ) + { + components[ iE ] = new TSideFace( myHelper, wallFaceIds[ iSide ], + *faceIt, *edgeIt, + &myParam2ColumnMaps[ iE ]); + double u1 = u0 + edgeLength[ iE ] / sumLen; + params[ iE ] = make_pair( u0 , u1 ); + u0 = u1; + ++iE; + } + mySide->SetComponent( iSide++, new TSideFace( components, params )); + + // fill the rest faces + for ( ; iE < nbEdges; ++faceIt, ++edgeIt ) + { + TSideFace* comp = new TSideFace( myHelper, wallFaceIds[ iSide ], + *faceIt, *edgeIt, + &myParam2ColumnMaps[ iE ]); + mySide->SetComponent( iSide++, comp ); + ++iE; + } + } + + + // Fill geometry fields of SMESH_Block + // ------------------------------------ + + TopoDS_Face botF = TopoDS::Face( botSM->GetSubShape() ); + TopoDS_Face topF = TopoDS::Face( topSM->GetSubShape() ); + + vector< int > botEdgeIdVec; + SMESH_Block::GetFaceEdgesIDs( ID_BOT_FACE, botEdgeIdVec ); + + bool isForward[NB_WALL_FACES] = { true, true, true, true }; + Adaptor2d_Curve2d* botPcurves[NB_WALL_FACES]; + Adaptor2d_Curve2d* topPcurves[NB_WALL_FACES]; + + for ( int iF = 0; iF < NB_WALL_FACES; ++iF ) + { + TSideFace * sideFace = mySide->GetComponent( iF ); + if ( !sideFace ) + RETURN_BAD_RESULT("NULL TSideFace"); + int fID = sideFace->FaceID(); + + // fill myShapeIDMap + if ( sideFace->InsertSubShapes( myShapeIDMap ) != 8 && + !sideFace->IsComplex()) + MESSAGE( ": Warning : InsertSubShapes() < 8 on side " << iF ); + + // side faces geometry + Adaptor2d_Curve2d* pcurves[NB_WALL_FACES]; + if ( !sideFace->GetPCurves( pcurves )) + RETURN_BAD_RESULT("TSideFace::GetPCurves() failed"); + + SMESH_Block::TFace& tFace = myFace[ fID - ID_FirstF ]; + tFace.Set( fID, sideFace->Surface(), pcurves, isForward ); + + SHOWYXZ( endl<<"F "<< iF << " id " << fID << " FRW " << sideFace->IsForward(), ); + // edges 3D geometry + vector< int > edgeIdVec; + SMESH_Block::GetFaceEdgesIDs( fID, edgeIdVec ); + for ( int isMax = 0; isMax < 2; ++isMax ) { + { + int eID = edgeIdVec[ isMax ]; + SMESH_Block::TEdge& tEdge = myEdge[ eID - ID_FirstE ]; + tEdge.Set( eID, sideFace->HorizCurve(isMax), true); + SHOWYXZ(eID<<" HOR"<HorizCurve(isMax)->Value(0)); + SHOWYXZ(eID<<" HOR"<HorizCurve(isMax)->Value(1)); + } + { + int eID = edgeIdVec[ isMax+2 ]; + SMESH_Block::TEdge& tEdge = myEdge[ eID - ID_FirstE ]; + tEdge.Set( eID, sideFace->VertiCurve(isMax), true); + SHOWYXZ(eID<<" VER"<VertiCurve(isMax)->Value(0)); + SHOWYXZ(eID<<" VER"<VertiCurve(isMax)->Value(1)); + + // corner points + vector< int > vertexIdVec; + SMESH_Block::GetEdgeVertexIDs( eID, vertexIdVec ); + myPnt[ vertexIdVec[0] - ID_FirstV ] = tEdge.GetCurve()->Value(0).XYZ(); + myPnt[ vertexIdVec[1] - ID_FirstV ] = tEdge.GetCurve()->Value(1).XYZ(); + } + } + // pcurves on horizontal faces + for ( iE = 0; iE < NB_WALL_FACES; ++iE ) { + if ( edgeIdVec[ BOTTOM_EDGE ] == botEdgeIdVec[ iE ] ) { + botPcurves[ iE ] = sideFace->HorizPCurve( false, botF ); + topPcurves[ iE ] = sideFace->HorizPCurve( true, topF ); + break; + } + } + } + // horizontal faces geometry + { + SMESH_Block::TFace& tFace = myFace[ ID_BOT_FACE - ID_FirstF ]; + tFace.Set( ID_BOT_FACE, new BRepAdaptor_Surface( botF ), botPcurves, isForward ); + SMESH_Block::Insert( botF, ID_BOT_FACE, myShapeIDMap ); + } + { + SMESH_Block::TFace& tFace = myFace[ ID_TOP_FACE - ID_FirstF ]; + tFace.Set( ID_TOP_FACE, new BRepAdaptor_Surface( topF ), topPcurves, isForward ); + SMESH_Block::Insert( topF, ID_TOP_FACE, myShapeIDMap ); + } + + // Fill map ShapeIndex to TParam2ColumnMap + // ---------------------------------------- + + list< TSideFace* > fList; + list< TSideFace* >::iterator fListIt; + fList.push_back( mySide ); + for ( fListIt = fList.begin(); fListIt != fList.end(); ++fListIt) + { + int nb = (*fListIt)->NbComponents(); + for ( int i = 0; i < nb; ++i ) { + if ( TSideFace* comp = (*fListIt)->GetComponent( i )) + fList.push_back( comp ); + } + if ( TParam2ColumnMap* cols = (*fListIt)->GetColumns()) { + // columns for a base edge + int id = MeshDS()->ShapeToIndex( (*fListIt)->BaseEdge() ); + bool isForward = (*fListIt)->IsForward(); + myShapeIndex2ColumnMap[ id ] = make_pair( cols, isForward ); + + // columns for vertices + const SMDS_MeshNode* n0 = cols->begin()->second.front(); + id = n0->GetPosition()->GetShapeId(); + myShapeIndex2ColumnMap[ id ] = make_pair( cols, isForward ); + + const SMDS_MeshNode* n1 = cols->rbegin()->second.front(); + id = n1->GetPosition()->GetShapeId(); + myShapeIndex2ColumnMap[ id ] = make_pair( cols, !isForward ); + } + } + +// gp_XYZ testPar(0.25, 0.25, 0), testCoord; +// if ( !FacePoint( ID_BOT_FACE, testPar, testCoord )) +// RETURN_BAD_RESULT("TEST FacePoint() FAILED"); +// SHOWYXZ("IN TEST PARAM" , testPar); +// SHOWYXZ("OUT TEST CORD" , testCoord); +// if ( !ComputeParameters( testCoord, testPar , ID_BOT_FACE)) +// RETURN_BAD_RESULT("TEST ComputeParameters() FAILED"); +// SHOWYXZ("OUT TEST PARAM" , testPar); + + return true; +} + +//================================================================================ +/*! + * \brief Return pointer to column of nodes + * \param node - bottom node from which the returned column goes up + * \retval const TNodeColumn* - the found column + */ +//================================================================================ + +const TNodeColumn* StdMeshers_PrismAsBlock::GetNodeColumn(const SMDS_MeshNode* node) const +{ + int sID = node->GetPosition()->GetShapeId(); + + map >::const_iterator col_frw = + myShapeIndex2ColumnMap.find( sID ); + if ( col_frw != myShapeIndex2ColumnMap.end() ) { + const TParam2ColumnMap* cols = col_frw->second.first; + TParam2ColumnIt u_col = cols->begin(); + for ( ; u_col != cols->end(); ++u_col ) + if ( u_col->second[ 0 ] == node ) + return & u_col->second; + } + return 0; +} + +//================================================================================ +/*! + * \brief Check curve orientation of a bootom edge + * \param meshDS - mesh DS + * \param columnsMap - node columns map of side face + * \param bottomEdge - the bootom edge + * \param sideFaceID - side face in-block ID + * \retval bool - true if orientation coinside with in-block froward orientation + */ +//================================================================================ + +bool StdMeshers_PrismAsBlock::IsForwardEdge(SMESHDS_Mesh* meshDS, + const TParam2ColumnMap& columnsMap, + const TopoDS_Edge & bottomEdge, + const int sideFaceID) +{ + bool isForward = false; + if ( TAssocTool::IsClosedEdge( bottomEdge )) + { + isForward = ( bottomEdge.Orientation() == TopAbs_FORWARD ); + } + else + { + const TNodeColumn& firstCol = columnsMap.begin()->second; + const SMDS_MeshNode* bottomNode = firstCol[0]; + TopoDS_Shape firstVertex = SMESH_MesherHelper::GetSubShapeByNode( bottomNode, meshDS ); + isForward = ( firstVertex.IsSame( TopExp::FirstVertex( bottomEdge, true ))); + } + // on 2 of 4 sides first vertex is end + if ( sideFaceID == ID_Fx1z || sideFaceID == ID_F0yz ) + isForward = !isForward; + return isForward; +} + +//================================================================================ + /*! + * \brief Find wall faces by bottom edges + * \param mesh - the mesh + * \param mainShape - the prism + * \param bottomFace - the bottom face + * \param bottomEdges - edges bounding the bottom face + * \param wallFaces - faces list to fill in + */ +//================================================================================ + +bool StdMeshers_PrismAsBlock::GetWallFaces( SMESH_Mesh* mesh, + const TopoDS_Shape & mainShape, + const TopoDS_Shape & bottomFace, + const std::list< TopoDS_Edge >& bottomEdges, + std::list< TopoDS_Face >& wallFaces) +{ + wallFaces.clear(); + + TopTools_IndexedMapOfShape faceMap; + TopExp::MapShapes( mainShape, TopAbs_FACE, faceMap ); + + list< TopoDS_Edge >::const_iterator edge = bottomEdges.begin(); + for ( ; edge != bottomEdges.end(); ++edge ) + { + TopTools_ListIteratorOfListOfShape ancestIt = mesh->GetAncestors( *edge ); + for ( ; ancestIt.More(); ancestIt.Next() ) + { + const TopoDS_Shape& ancestor = ancestIt.Value(); + if ( ancestor.ShapeType() == TopAbs_FACE && // face + !bottomFace.IsSame( ancestor ) && // not bottom + faceMap.FindIndex( ancestor )) // belongs to the prism + { + wallFaces.push_back( TopoDS::Face( ancestor )); + break; + } + } + } + return ( wallFaces.size() == bottomEdges.size() ); +} + +//================================================================================ +/*! + * \brief Constructor + * \param faceID - in-block ID + * \param face - geom face + * \param columnsMap - map of node columns + * \param first - first normalized param + * \param last - last normalized param + */ +//================================================================================ + +StdMeshers_PrismAsBlock::TSideFace::TSideFace(SMESH_MesherHelper* helper, + const int faceID, + const TopoDS_Face& face, + const TopoDS_Edge& baseEdge, + TParam2ColumnMap* columnsMap, + const double first, + const double last): + myID( faceID ), + myParamToColumnMap( columnsMap ), + myBaseEdge( baseEdge ), + myHelper( helper ) +{ + mySurface.Initialize( face ); + myParams.resize( 1 ); + myParams[ 0 ] = make_pair( first, last ); + myIsForward = StdMeshers_PrismAsBlock::IsForwardEdge( myHelper->GetMeshDS(), + *myParamToColumnMap, + myBaseEdge, myID ); +} + +//================================================================================ +/*! + * \brief Constructor of complex side face + */ +//================================================================================ + +StdMeshers_PrismAsBlock::TSideFace:: +TSideFace(const vector< TSideFace* >& components, + const vector< pair< double, double> > & params) + :myID( components[0] ? components[0]->myID : 0 ), + myParamToColumnMap( 0 ), + myParams( params ), + myIsForward( true ), + myComponents( components ), + myHelper( components[0] ? components[0]->myHelper : 0 ) +{} +//================================================================================ +/*! + * \brief Copy constructor + * \param other - other side + */ +//================================================================================ + +StdMeshers_PrismAsBlock::TSideFace::TSideFace( const TSideFace& other ) +{ + myID = other.myID; + mySurface = other.mySurface; + myBaseEdge = other.myBaseEdge; + myParams = other.myParams; + myIsForward = other.myIsForward; + myHelper = other.myHelper; + myParamToColumnMap = other.myParamToColumnMap; + + myComponents.resize( other.myComponents.size()); + for (int i = 0 ; i < myComponents.size(); ++i ) + myComponents[ i ] = new TSideFace( *other.myComponents[ i ]); +} + +//================================================================================ +/*! + * \brief Deletes myComponents + */ +//================================================================================ + +StdMeshers_PrismAsBlock::TSideFace::~TSideFace() +{ + for (int i = 0 ; i < myComponents.size(); ++i ) + if ( myComponents[ i ] ) + delete myComponents[ i ]; +} + +//================================================================================ +/*! + * \brief Return geometry of the vertical curve + * \param isMax - true means curve located closer to (1,1,1) block point + * \retval Adaptor3d_Curve* - curve adaptor + */ +//================================================================================ + +Adaptor3d_Curve* StdMeshers_PrismAsBlock::TSideFace::VertiCurve(const bool isMax) const +{ + if ( !myComponents.empty() ) { + if ( isMax ) + return myComponents.back()->VertiCurve(isMax); + else + return myComponents.front()->VertiCurve(isMax); + } + double f = myParams[0].first, l = myParams[0].second; + if ( !myIsForward ) std::swap( f, l ); + return new TVerticalEdgeAdaptor( myParamToColumnMap, isMax ? l : f ); +} + +//================================================================================ +/*! + * \brief Return geometry of the top or bottom curve + * \param isTop - + * \retval Adaptor3d_Curve* - + */ +//================================================================================ + +Adaptor3d_Curve* StdMeshers_PrismAsBlock::TSideFace::HorizCurve(const bool isTop) const +{ + return new THorizontalEdgeAdaptor( this, isTop ); +} + +//================================================================================ +/*! + * \brief Return pcurves + * \param pcurv - array of 4 pcurves + * \retval bool - is a success + */ +//================================================================================ + +bool StdMeshers_PrismAsBlock::TSideFace::GetPCurves(Adaptor2d_Curve2d* pcurv[4]) const +{ + int iEdge[ 4 ] = { BOTTOM_EDGE, TOP_EDGE, V0_EDGE, V1_EDGE }; + + for ( int i = 0 ; i < 4 ; ++i ) { + Handle(Geom2d_Line) line; + switch ( iEdge[ i ] ) { + case TOP_EDGE: + line = new Geom2d_Line( gp_Pnt2d( 0, 1 ), gp::DX2d() ); break; + case BOTTOM_EDGE: + line = new Geom2d_Line( gp::Origin2d(), gp::DX2d() ); break; + case V0_EDGE: + line = new Geom2d_Line( gp::Origin2d(), gp::DY2d() ); break; + case V1_EDGE: + line = new Geom2d_Line( gp_Pnt2d( 1, 0 ), gp::DY2d() ); break; + } + pcurv[ i ] = new Geom2dAdaptor_Curve( line, 0, 1 ); + } + return true; +} + +//================================================================================ +/*! + * \brief Returns geometry of pcurve on a horizontal face + * \param isTop - is top or bottom face + * \param horFace - a horizontal face + * \retval Adaptor2d_Curve2d* - curve adaptor + */ +//================================================================================ + +Adaptor2d_Curve2d* +StdMeshers_PrismAsBlock::TSideFace::HorizPCurve(const bool isTop, + const TopoDS_Face& horFace) const +{ + return new TPCurveOnHorFaceAdaptor( this, isTop, horFace ); +} + +//================================================================================ +/*! + * \brief Return a component corresponding to parameter + * \param U - parameter along a horizontal size + * \param localU - parameter along a horizontal size of a component + * \retval TSideFace* - found component + */ +//================================================================================ + +StdMeshers_PrismAsBlock::TSideFace* +StdMeshers_PrismAsBlock::TSideFace::GetComponent(const double U,double & localU) const +{ + localU = U; + if ( myComponents.empty() ) + return const_cast( this ); + + int i; + for ( i = 0; i < myComponents.size(); ++i ) + if ( U < myParams[ i ].second ) + break; + if ( i >= myComponents.size() ) + i = myComponents.size() - 1; + + double f = myParams[ i ].first, l = myParams[ i ].second; + localU = ( U - f ) / ( l - f ); + return myComponents[ i ]; +} + +//================================================================================ +/*! + * \brief Find node columns for a parameter + * \param U - parameter along a horizontal edge + * \param col1 - the 1st found column + * \param col2 - the 2nd found column + * \retval r - normalized position of U between the found columns + */ +//================================================================================ + +double StdMeshers_PrismAsBlock::TSideFace::GetColumns(const double U, + TParam2ColumnIt & col1, + TParam2ColumnIt & col2) const +{ + double u = U, r = 0; + if ( !myComponents.empty() ) { + TSideFace * comp = GetComponent(U,u); + return comp->GetColumns( u, col1, col2 ); + } + + if ( !myIsForward ) + u = 1 - u; + double f = myParams[0].first, l = myParams[0].second; + u = f + u * ( l - f ); + + col1 = col2 = getColumn( myParamToColumnMap, u ); + if ( ++col2 == myParamToColumnMap->end() ) { + --col2; + r = 0.5; + } + else { +// if ( !myIsForward ) +// std::swap( col1, col2 ); + double uf = col1->first; + double ul = col2->first; + r = ( u - uf ) / ( ul - uf ); + } + return r; +} + +//================================================================================ +/*! + * \brief Return coordinates by normalized params + * \param U - horizontal param + * \param V - vertical param + * \retval gp_Pnt - result point + */ +//================================================================================ + +gp_Pnt StdMeshers_PrismAsBlock::TSideFace::Value(const Standard_Real U, + const Standard_Real V) const +{ + double u; + if ( !myComponents.empty() ) { + TSideFace * comp = GetComponent(U,u); + return comp->Value( u, V ); + } + + TParam2ColumnIt u_col1, u_col2; + double vR, hR = GetColumns( U, u_col1, u_col2 ); + + const SMDS_MeshNode* n1 = 0; + const SMDS_MeshNode* n2 = 0; + const SMDS_MeshNode* n3 = 0; + const SMDS_MeshNode* n4 = 0; + gp_XYZ pnt; + + vR = getRAndNodes( & u_col1->second, V, n1, n2 ); + vR = getRAndNodes( & u_col2->second, V, n3, n4 ); + + gp_XY uv1 = myHelper->GetNodeUV( mySurface.Face(), n1, n4); + gp_XY uv2 = myHelper->GetNodeUV( mySurface.Face(), n2, n3); + gp_XY uv12 = uv1 * ( 1 - vR ) + uv2 * vR; + + gp_XY uv3 = myHelper->GetNodeUV( mySurface.Face(), n3, n2); + gp_XY uv4 = myHelper->GetNodeUV( mySurface.Face(), n4, n1); + gp_XY uv34 = uv3 * ( 1 - vR ) + uv4 * vR; + + gp_XY uv = uv12 * ( 1 - hR ) + uv34 * hR; + + return mySurface.Value( uv.X(), uv.Y() ); +} + + +//================================================================================ +/*! + * \brief Return boundary edge + * \param edge - edge index + * \retval TopoDS_Edge - found edge + */ +//================================================================================ + +TopoDS_Edge StdMeshers_PrismAsBlock::TSideFace::GetEdge(const int iEdge) const +{ + if ( !myComponents.empty() ) { + switch ( iEdge ) { + case V0_EDGE : return myComponents.front()->GetEdge( iEdge ); + case V1_EDGE : return myComponents.back() ->GetEdge( iEdge ); + default: return TopoDS_Edge(); + } + } + TopoDS_Shape edge; + const SMDS_MeshNode* node = 0; + SMESHDS_Mesh * meshDS = myHelper->GetMesh()->GetMeshDS(); + TNodeColumn* column; + + switch ( iEdge ) { + case TOP_EDGE: + case BOTTOM_EDGE: + column = & (( ++myParamToColumnMap->begin())->second ); + node = ( iEdge == TOP_EDGE ) ? column->back() : column->front(); + edge = myHelper->GetSubShapeByNode ( node, meshDS ); + if ( edge.ShapeType() == TopAbs_VERTEX ) { + column = & ( myParamToColumnMap->begin()->second ); + node = ( iEdge == TOP_EDGE ) ? column->back() : column->front(); + } + break; + case V0_EDGE: + case V1_EDGE: { + bool back = ( iEdge == V1_EDGE ); + if ( !myIsForward ) back = !back; + if ( back ) + column = & ( myParamToColumnMap->rbegin()->second ); + else + column = & ( myParamToColumnMap->begin()->second ); + if ( column->size() > 0 ) + edge = myHelper->GetSubShapeByNode( (*column)[ 1 ], meshDS ); + if ( edge.IsNull() || edge.ShapeType() == TopAbs_VERTEX ) + node = column->front(); + break; + } + default:; + } + if ( !edge.IsNull() || edge.ShapeType() == TopAbs_EDGE ) + return TopoDS::Edge( edge ); + + // find edge by 2 vertices + TopoDS_Shape V1 = edge; + TopoDS_Shape V2 = myHelper->GetSubShapeByNode( node, meshDS ); + if ( V2.ShapeType() == TopAbs_VERTEX && !V2.IsSame( V1 )) + { + TopTools_ListIteratorOfListOfShape ancestIt = + myHelper->GetMesh()->GetAncestors( V1 ); + for ( ; ancestIt.More(); ancestIt.Next() ) + { + const TopoDS_Shape & ancestor = ancestIt.Value(); + if ( ancestor.ShapeType() == TopAbs_EDGE ) + for ( TopExp_Explorer e( ancestor, TopAbs_VERTEX ); e.More(); e.Next() ) + if ( V2.IsSame( e.Current() )) + return TopoDS::Edge( ancestor ); + } + } + return TopoDS_Edge(); +} + +//================================================================================ +/*! + * \brief Fill block subshapes + * \param shapeMap - map to fill in + * \retval int - nb inserted subshapes + */ +//================================================================================ + +int StdMeshers_PrismAsBlock::TSideFace::InsertSubShapes(TBlockShapes& shapeMap) const +{ + int nbInserted = 0; + + // Insert edges + vector< int > edgeIdVec; + SMESH_Block::GetFaceEdgesIDs( myID, edgeIdVec ); + + for ( int i = BOTTOM_EDGE; i <=V1_EDGE ; ++i ) { + TopoDS_Edge e = GetEdge( i ); + if ( !e.IsNull() ) { + nbInserted += SMESH_Block::Insert( e, edgeIdVec[ i ], shapeMap); + } + } + + // Insert corner vertices + + TParam2ColumnIt col1, col2 ; + vector< int > vertIdVec; + + // from V0 column + SMESH_Block::GetEdgeVertexIDs( edgeIdVec[ V0_EDGE ], vertIdVec); + GetColumns(0, col1, col2 ); + const SMDS_MeshNode* node0 = col1->second.front(); + const SMDS_MeshNode* node1 = col1->second.back(); + TopoDS_Shape v0 = myHelper->GetSubShapeByNode( node0, myHelper->GetMeshDS()); + TopoDS_Shape v1 = myHelper->GetSubShapeByNode( node1, myHelper->GetMeshDS()); + if ( v0.ShapeType() == TopAbs_VERTEX ) { + nbInserted += SMESH_Block::Insert( v0, vertIdVec[ 0 ], shapeMap); + } + if ( v1.ShapeType() == TopAbs_VERTEX ) { + nbInserted += SMESH_Block::Insert( v1, vertIdVec[ 1 ], shapeMap); + } + + // from V1 column + SMESH_Block::GetEdgeVertexIDs( edgeIdVec[ V1_EDGE ], vertIdVec); + GetColumns(1, col1, col2 ); + node0 = col2->second.front(); + node1 = col2->second.back(); + v0 = myHelper->GetSubShapeByNode( node0, myHelper->GetMeshDS()); + v1 = myHelper->GetSubShapeByNode( node1, myHelper->GetMeshDS()); + if ( v0.ShapeType() == TopAbs_VERTEX ) { + nbInserted += SMESH_Block::Insert( v0, vertIdVec[ 0 ], shapeMap); + } + if ( v1.ShapeType() == TopAbs_VERTEX ) { + nbInserted += SMESH_Block::Insert( v1, vertIdVec[ 1 ], shapeMap); + } + +// TopoDS_Vertex V0, V1, Vcom; +// TopExp::Vertices( myBaseEdge, V0, V1, true ); +// if ( !myIsForward ) std::swap( V0, V1 ); + +// // bottom vertex IDs +// SMESH_Block::GetEdgeVertexIDs( edgeIdVec[ _u0 ], vertIdVec); +// SMESH_Block::Insert( V0, vertIdVec[ 0 ], shapeMap); +// SMESH_Block::Insert( V1, vertIdVec[ 1 ], shapeMap); + +// TopoDS_Edge sideEdge = GetEdge( V0_EDGE ); +// if ( sideEdge.IsNull() || !TopExp::CommonVertex( botEdge, sideEdge, Vcom )) +// return false; + +// // insert one side edge +// int edgeID; +// if ( Vcom.IsSame( V0 )) edgeID = edgeIdVec[ _v0 ]; +// else edgeID = edgeIdVec[ _v1 ]; +// SMESH_Block::Insert( sideEdge, edgeID, shapeMap); + +// // top vertex of the side edge +// SMESH_Block::GetEdgeVertexIDs( edgeID, vertIdVec); +// TopoDS_Vertex Vtop = TopExp::FirstVertex( sideEdge ); +// if ( Vcom.IsSame( Vtop )) +// Vtop = TopExp::LastVertex( sideEdge ); +// SMESH_Block::Insert( Vtop, vertIdVec[ 1 ], shapeMap); + +// // other side edge +// sideEdge = GetEdge( V1_EDGE ); +// if ( sideEdge.IsNull() ) +// return false; +// if ( edgeID = edgeIdVec[ _v1 ]) edgeID = edgeIdVec[ _v0 ]; +// else edgeID = edgeIdVec[ _v1 ]; +// SMESH_Block::Insert( sideEdge, edgeID, shapeMap); + +// // top edge +// TopoDS_Edge topEdge = GetEdge( TOP_EDGE ); +// SMESH_Block::Insert( topEdge, edgeIdVec[ _u1 ], shapeMap); + +// // top vertex of the other side edge +// if ( !TopExp::CommonVertex( topEdge, sideEdge, Vcom )) +// return false; +// SMESH_Block::GetEdgeVertexIDs( edgeID, vertIdVec ); +// SMESH_Block::Insert( Vcom, vertIdVec[ 1 ], shapeMap); + + return nbInserted; +} + +//================================================================================ +/*! + * \brief Creates TVerticalEdgeAdaptor + * \param columnsMap - node column map + * \param parameter - normalized parameter + */ +//================================================================================ + +StdMeshers_PrismAsBlock::TVerticalEdgeAdaptor:: +TVerticalEdgeAdaptor( const TParam2ColumnMap* columnsMap, const double parameter) +{ + myNodeColumn = & getColumn( columnsMap, parameter )->second; +} + +//================================================================================ +/*! + * \brief Return coordinates for the given normalized parameter + * \param U - normalized parameter + * \retval gp_Pnt - coordinates + */ +//================================================================================ + +gp_Pnt StdMeshers_PrismAsBlock::TVerticalEdgeAdaptor::Value(const Standard_Real U) const +{ + const SMDS_MeshNode* n1; + const SMDS_MeshNode* n2; + double r = getRAndNodes( myNodeColumn, U, n1, n2 ); + return gpXYZ(n1) * ( 1 - r ) + gpXYZ(n2) * r; +} + +//================================================================================ +/*! + * \brief Return coordinates for the given normalized parameter + * \param U - normalized parameter + * \retval gp_Pnt - coordinates + */ +//================================================================================ + +gp_Pnt StdMeshers_PrismAsBlock::THorizontalEdgeAdaptor::Value(const Standard_Real U) const +{ + return mySide->TSideFace::Value( U, myV ); +} + +//================================================================================ +/*! + * \brief Return UV on pcurve for the given normalized parameter + * \param U - normalized parameter + * \retval gp_Pnt - coordinates + */ +//================================================================================ + +gp_Pnt2d StdMeshers_PrismAsBlock::TPCurveOnHorFaceAdaptor::Value(const Standard_Real U) const +{ + TParam2ColumnIt u_col1, u_col2; + double r = mySide->GetColumns( U, u_col1, u_col2 ); + gp_XY uv1 = mySide->GetNodeUV( myFace, u_col1->second[ myZ ]); + gp_XY uv2 = mySide->GetNodeUV( myFace, u_col2->second[ myZ ]); + return uv1 * ( 1 - r ) + uv2 * r; +} diff --git a/src/StdMeshers/StdMeshers_Prism_3D.hxx b/src/StdMeshers/StdMeshers_Prism_3D.hxx new file mode 100644 index 000000000..82fe08f02 --- /dev/null +++ b/src/StdMeshers/StdMeshers_Prism_3D.hxx @@ -0,0 +1,426 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Prism_3D.hxx +// Module : SMESH + +#ifndef _SMESH_Prism_3D_HXX_ +#define _SMESH_Prism_3D_HXX_ + +#include "SMESH_StdMeshers.hxx" + +#include "SMESH_3D_Algo.hxx" +#include "SMDS_TypeOfPosition.hxx" +#include "SMDS_MeshNode.hxx" +#include "SMESH_Block.hxx" +#include "SMESH_Mesh.hxx" +#include "SMESHDS_Mesh.hxx" +#include "SMESH_subMesh.hxx" +#include "SMESH_MesherHelper.hxx" + +#include + +#include +#include +#include +#include +#include +#include + + +class SMESHDS_SubMesh; +class TopoDS_Edge; +class TopoDS_Faces; +struct TNode; + +//typedef std::map TNodeNodeMap; +typedef std::vector TNodeColumn; + +// map of bottom nodes to the column of nodes above them +// (the column includes the bottom nodes) +typedef std::map< TNode, TNodeColumn > TNode2ColumnMap; +typedef std::map< double, TNodeColumn > TParam2ColumnMap; +typedef std::map< double, TNodeColumn >::const_iterator TParam2ColumnIt; + +typedef TopTools_IndexedMapOfOrientedShape TBlockShapes; + +// =============================================== +/*! + * \brief Structure containing node relative data + */ +// =============================================== + +struct TNode +{ + const SMDS_MeshNode* myNode; + gp_XYZ myParams; + + gp_XYZ GetCoords() const { return gp_XYZ( myNode->X(), myNode->Y(), myNode->Z() ); } + gp_XYZ GetParams() const { return myParams; } + gp_XYZ& ChangeParams() { return myParams; } + SMDS_TypeOfPosition GetPositionType() const + { return myNode ? myNode->GetPosition()->GetTypeOfPosition() : SMDS_TOP_UNSPEC; } + + TNode(const SMDS_MeshNode* node = 0): myNode(node) {} + bool operator < (const TNode& other) const { return myNode < other.myNode; } +}; + +// =============================================================== +/*! + * \brief Tool analyzing and giving access to a prism geometry + * treating it like a block, i.e. the four side faces are + * emulated by division/uniting of missing/excess faces. + * It also manage associations between block subshapes and a mesh. + */ +// =============================================================== + +class STDMESHERS_EXPORT StdMeshers_PrismAsBlock: public SMESH_Block +{ +public: + /*! + * \brief Constructor. Initialization is needed + */ + StdMeshers_PrismAsBlock(); + + ~StdMeshers_PrismAsBlock(); + + /*! + * \brief Initialization. + * \param helper - helper loaded with mesh and 3D shape + * \param shape3D - a closed shell or solid + * \retval bool - false if a mesh or a shape are KO + * + * Analyse shape geometry and mesh. + * If there are triangles on one of faces, it becomes 'bottom' + */ + bool Init(SMESH_MesherHelper* helper, const TopoDS_Shape& shape3D); + + /*! + * \brief Return number of nodes on every vertical edge + * \retval int - number of nodes including end nodes + */ + int VerticalSize() const { return myParam2ColumnMaps[0].begin()->second.size(); } + + bool HasNotQuadElemOnTop() const { return myNotQuadOnTop; } + + /*! + * \brief Return pointer to column of nodes + * \param node - bottom node from which the returned column goes up + * \retval const TNodeColumn* - the found column + */ + const TNodeColumn* GetNodeColumn(const SMDS_MeshNode* node) const; + + /*! + * \brief Return TParam2ColumnMap for a base edge + * \param baseEdgeID - base edge SMESHDS Index + * \param isReverse - columns in-block orientation + * \retval const TParam2ColumnMap& - map + */ + const TParam2ColumnMap& GetParam2ColumnMap(const int baseEdgeID, + bool & isReverse) + { + std::pair< TParam2ColumnMap*, bool > & col_frw = + myShapeIndex2ColumnMap[ baseEdgeID ]; + isReverse = !col_frw.second; + return * col_frw.first; + } + + /*! + * \brief Return pointer to mesh + * \retval SMESH_Mesh - mesh + */ + SMESH_Mesh* Mesh() const { return myHelper->GetMesh(); } + + /*! + * \brief Return pointer to mesh DS + * \retval SMESHDS_Mesh - mesh DS + */ + SMESHDS_Mesh* MeshDS() const { return Mesh()->GetMeshDS(); } + + /*! + * \brief Return submesh of a shape + * \param shapeID - shape given by in-block index + * \retval SMESH_subMesh* - found submesh + */ + SMESH_subMesh* SubMesh(const int shapeID) const + { return Mesh()->GetSubMesh( Shape( shapeID )); } + + /*! + * \brief Return submesh DS of a shape + * \param shapeID - shape given by in-block index + * \retval SMESHDS_SubMesh* - found submesh DS + */ + SMESHDS_SubMesh* SubMeshDS(const int shapeID) const + { return SubMesh(shapeID)->GetSubMeshDS(); } + + /*! + * \brief Return a in-block shape + * \param shapeID - shape given by in-block index + * \retval SMESHDS_SubMesh* - found submesh + */ + const TopoDS_Shape& Shape(const int shapeID) const + { return myShapeIDMap( shapeID ); } + + /*! + * \brief Return in-block ID of a shape + * \param shape - block subshape + * \retval int - ID or zero if the shape has no ID + */ + int ShapeID(const TopoDS_Shape& shape) const + { return myShapeIDMap.FindIndex( shape ); } + + /*! + * \brief Check curve orientation of a bootom edge + * \param meshDS - mesh DS + * \param columnsMap - node columns map of side face + * \param bottomEdge - the bootom edge + * \param sideFaceID - side face in-block ID + * \retval bool - true if orienation coinside with in-block froward orienation + */ + static bool IsForwardEdge(SMESHDS_Mesh* meshDS, + const TParam2ColumnMap& columnsMap, + const TopoDS_Edge & bottomEdge, + const int sideFaceID); + /*! + * \brief Find wall faces by bottom edges + * \param mesh - the mesh + * \param mainShape - the prism + * \param bottomFace - the bottom face + * \param bottomEdges - edges bounding the bottom face + * \param wallFaces - faces list to fill in + */ + static bool GetWallFaces( SMESH_Mesh* mesh, + const TopoDS_Shape & mainShape, + const TopoDS_Shape & bottomFace, + const std::list< TopoDS_Edge >& bottomEdges, + std::list< TopoDS_Face >& wallFaces); + +private: + + // -------------------------------------------------------------------- + /*! + * \brief Class representing a part of a geom face or + * a union of seleral faces. Or just an ordinary geom face + * + * It's parametrization is within [0,1] range. + * It redefines Adaptor3d_Surface::Value(U,V) where U and V are within [0,1] + */ + // -------------------------------------------------------------------- + class TSideFace: public Adaptor3d_Surface + { + int myID; //!< in-block ID + // map used to find out real UV by it's normalized UV + TParam2ColumnMap* myParamToColumnMap; + BRepAdaptor_Surface mySurface; + TopoDS_Edge myBaseEdge; + // first and last normalized params and orientaion for each component or it-self + vector< pair< double, double> > myParams; + bool myIsForward; + vector< TSideFace* > myComponents; + SMESH_MesherHelper * myHelper; + public: + TSideFace( SMESH_MesherHelper* helper, + const int faceID, + const TopoDS_Face& face, + const TopoDS_Edge& baseEdge, + TParam2ColumnMap* columnsMap, + const double first = 0.0, + const double last = 1.0); + TSideFace( const std::vector< TSideFace* >& components, + const std::vector< pair< double, double> > & params); + TSideFace( const TSideFace& other ); + ~TSideFace(); + bool IsComplex() const + { return ( NbComponents() > 0 || myParams[0].first != 0. || myParams[0].second != 1. ); } + int FaceID() const { return myID; } + TParam2ColumnMap* GetColumns() const { return myParamToColumnMap; } + gp_XY GetNodeUV(const TopoDS_Face& F, const SMDS_MeshNode* n) const + { return myHelper->GetNodeUV( F, n ); } + const TopoDS_Edge & BaseEdge() const { return myBaseEdge; } + int ColumnHeight() const { + if ( NbComponents() ) return GetComponent(0)->GetColumns()->begin()->second.size(); + else return GetColumns()->begin()->second.size(); } + double GetColumns(const double U, TParam2ColumnIt & col1, TParam2ColumnIt& col2 ) const; + int NbComponents() const { return myComponents.size(); } + TSideFace* GetComponent(const int i) const { return myComponents.at( i ); } + void SetComponent(const int i, TSideFace* c) + { if ( myComponents[i] ) delete myComponents[i]; myComponents[i]=c; } + TSideFace* GetComponent(const double U, double& localU) const; + bool IsForward() const { return myIsForward; } + // boundary geometry for a face + Adaptor3d_Surface* Surface() const { return new TSideFace( *this ); } + bool GetPCurves(Adaptor2d_Curve2d* pcurv[4]) const; + Adaptor2d_Curve2d* HorizPCurve(const bool isTop, const TopoDS_Face& horFace) const; + Adaptor3d_Curve* HorizCurve(const bool isTop) const; + Adaptor3d_Curve* VertiCurve(const bool isMax) const; + TopoDS_Edge GetEdge( const int edge ) const; + int InsertSubShapes( TBlockShapes& shapeMap ) const; + // redefine Adaptor methods + gp_Pnt Value(const Standard_Real U,const Standard_Real V) const; + }; + + // -------------------------------------------------------------------- + /*! + * \brief Class emulating geometry of a vertical edge + */ + // -------------------------------------------------------------------- + class STDMESHERS_EXPORT TVerticalEdgeAdaptor: public Adaptor3d_Curve + { + const TNodeColumn* myNodeColumn; + public: + TVerticalEdgeAdaptor( const TParam2ColumnMap* columnsMap, const double parameter ); + gp_Pnt Value(const Standard_Real U) const; + Standard_Real FirstParameter() const { return 0; } + Standard_Real LastParameter() const { return 1; } + }; + + // -------------------------------------------------------------------- + /*! + * \brief Class emulating geometry of a hirizontal edge + */ + // -------------------------------------------------------------------- + class STDMESHERS_EXPORT THorizontalEdgeAdaptor: public Adaptor3d_Curve + { + const TSideFace* mySide; + double myV; + public: + THorizontalEdgeAdaptor( const TSideFace* sideFace, const bool isTop) + :mySide(sideFace), myV( isTop ? 1.0 : 0.0 ) {} + gp_Pnt Value(const Standard_Real U) const; + Standard_Real FirstParameter() const { return 0; } + Standard_Real LastParameter() const { return 1; } + }; + + // -------------------------------------------------------------------- + /*! + * \brief Class emulating pcurve on a hirizontal face + */ + // -------------------------------------------------------------------- + class STDMESHERS_EXPORT TPCurveOnHorFaceAdaptor: public Adaptor2d_Curve2d + { + const TSideFace* mySide; + int myZ; + TopoDS_Face myFace; + public: + TPCurveOnHorFaceAdaptor( const TSideFace* sideFace, + const bool isTop, + const TopoDS_Face& horFace) + : mySide(sideFace), myFace(horFace), myZ(isTop ? mySide->ColumnHeight() - 1 : 0 ) {} + gp_Pnt2d Value(const Standard_Real U) const; + Standard_Real FirstParameter() const { return 0; } + Standard_Real LastParameter() const { return 1; } + }; + // -------------------------------------------------------------------- + + bool myNotQuadOnTop; + SMESH_MesherHelper* myHelper; + TBlockShapes myShapeIDMap; + + // container of 4 side faces + TSideFace* mySide; + // node columns for each base edge + vector< TParam2ColumnMap > myParam2ColumnMaps; + // to find a column for a node by edge SMESHDS Index + map< int, pair< TParam2ColumnMap*, bool > > myShapeIndex2ColumnMap; + + + //vector< SMESH_subMesh* > mySubMeshesVec; // submesh by in-block id +}; + +// ============================================= +/*! + * \brief Algo building prisms on a prism shape + */ +// ============================================= + +class STDMESHERS_EXPORT StdMeshers_Prism_3D: public SMESH_3D_Algo +{ +public: + StdMeshers_Prism_3D(int hypId, int studyId, SMESH_Gen* gen); + virtual ~StdMeshers_Prism_3D(); + + virtual bool CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus); + + virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); + + /*! + * \brief Enable removal of quadrangles from the bottom face and + * triangles creation there by projection from the top + * (sole face meshed with triangles is considered to be a bottom one). + * If there are two faces with triangles, triangles must + * be of the same topology, else the algo fails. + * The method must be called before Compute() + */ + void ProjectTriangles() { myProjectTriangles = true; } + + /*! + * \brief Create prisms + * \param nodeColumns - columns of nodes generated from nodes of a mesh face + * \param helper - helper initialized by mesh and shape to add prisms to + */ + static void AddPrisms( vector & nodeColumns, + SMESH_MesherHelper* helper); + +private: + + /*! + * \brief Find correspondence between bottom and top nodes. + * If elements on the bottom and top faces are topologically different, + * and projection is possible and allowed, perform the projection + * \retval bool - is a success or not + */ + bool assocOrProjBottom2Top(); + + /*! + * \brief Remove quadrangles from the top face and + * create triangles there by projection from the bottom + * \retval bool - a success or not + */ + bool projectBottomToTop(); + + /*! + * \brief Set projection coordinates of a node to a face and it's subshapes + * \param faceID - the face given by in-block ID + * \param params - node normalized parameters + * \retval bool - is a success + */ + bool setFaceAndEdgesXYZ( const int faceID, const gp_XYZ& params, int z ); + +private: + + bool myProjectTriangles; + + StdMeshers_PrismAsBlock myBlock; + SMESH_MesherHelper* myHelper; + + vector myShapeXYZ; // point on each sub-shape + + // map of bottom nodes to the column of nodes above them + // (the column includes the bottom node) + typedef std::map< TNode, TNodeColumn > TNode2ColumnMap; + TNode2ColumnMap myBotToColumnMap; +}; + +#endif diff --git a/src/StdMeshers/StdMeshers_ProjectionSource1D.cxx b/src/StdMeshers/StdMeshers_ProjectionSource1D.cxx new file mode 100644 index 000000000..48121a6b7 --- /dev/null +++ b/src/StdMeshers/StdMeshers_ProjectionSource1D.cxx @@ -0,0 +1,232 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's classes +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource1D.cxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#include "StdMeshers_ProjectionSource1D.hxx" + +#include "SMESH_Mesh.hxx" + +#include "utilities.h" + +#include + +using namespace std; + + +//============================================================================= +/*! + * StdMeshers_ProjectionSource1D::StdMeshers_ProjectionSource1D + * + * Constructor + */ +//============================================================================= + +StdMeshers_ProjectionSource1D::StdMeshers_ProjectionSource1D(int hypId, int studyId, + SMESH_Gen * gen) + : SMESH_Hypothesis(hypId, studyId, gen) +{ + _name = "ProjectionSource1D"; // used by Projection_1D + _param_algo_dim = 1; // 1D + _sourceMesh = 0; +} + +//============================================================================= +/*! + * StdMeshers_ProjectionSource1D::~StdMeshers_ProjectionSource1D + * + * Destructor + */ +//============================================================================= + +StdMeshers_ProjectionSource1D::~StdMeshers_ProjectionSource1D() +{ + MESSAGE( "StdMeshers_ProjectionSource1D::~StdMeshers_ProjectionSource1D" ); +} + +//============================================================================= + /*! + * Sets source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource1D::SetSourceEdge(const TopoDS_Shape& edge) + throw ( SALOME_Exception ) +{ + if ( edge.IsNull() ) + throw SALOME_Exception(LOCALIZED("Null edge is not allowed")); + + if ( edge.ShapeType() != TopAbs_EDGE ) + throw SALOME_Exception(LOCALIZED("Wrong shape type")); + + if ( !_sourceEdge.IsSame( edge ) ) + { + _sourceEdge = TopoDS::Edge( edge ); + + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * Sets vertex association between the source edge and the target one. + * This parameter is optional + */ +//============================================================================= + +void StdMeshers_ProjectionSource1D::SetVertexAssociation(const TopoDS_Shape& sourceVertex, + const TopoDS_Shape& targetVertex) + throw ( SALOME_Exception ) +{ + if ( sourceVertex.IsNull() != targetVertex.IsNull() ) + throw SALOME_Exception(LOCALIZED("Two or none vertices must be provided")); + + if ( !sourceVertex.IsNull() ) { + if ( sourceVertex.ShapeType() != TopAbs_VERTEX || + targetVertex.ShapeType() != TopAbs_VERTEX ) + throw SALOME_Exception(LOCALIZED("Wrong shape type")); + } + + if ( !_sourceVertex.IsSame( sourceVertex ) || + !_targetVertex.IsSame( targetVertex ) ) + { + _sourceVertex = TopoDS::Vertex( sourceVertex ); + _targetVertex = TopoDS::Vertex( targetVertex ); + + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * Sets source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource1D::SetSourceMesh(SMESH_Mesh* mesh) +{ + if ( _sourceMesh != mesh ) + NotifySubMeshesHypothesisModification(); + _sourceMesh = mesh; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +ostream & StdMeshers_ProjectionSource1D::SaveTo(ostream & save) +{ + // we store it in order to be able to detect that hypo is really modified + save << " " << _sourceEdge.TShape().operator->() ; + save << " " << _sourceVertex.TShape().operator->(); + save << " " << _targetVertex.TShape().operator->(); + save << " " << ( _sourceMesh ? _sourceMesh->GetId() : -1 ); + return save; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +istream & StdMeshers_ProjectionSource1D::LoadFrom(istream & load) +{ + // impossible to restore w/o any context + return load; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +ostream & operator <<(ostream & save, StdMeshers_ProjectionSource1D & hyp) +{ + return hyp.SaveTo( save ); +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +istream & operator >>(istream & load, StdMeshers_ProjectionSource1D & hyp) +{ + return hyp.LoadFrom( load ); +} + +//================================================================================ +/*! + * \brief Initialize start and end length by the mesh built on the geometry + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if parameter values have been successfully defined + */ +//================================================================================ + +bool StdMeshers_ProjectionSource1D::SetParametersByMesh(const SMESH_Mesh* , + const TopoDS_Shape& ) +{ + return false; +} + +//================================================================================ +/*! + * \brief Return all parameters + */ +//================================================================================ + +void StdMeshers_ProjectionSource1D::GetStoreParams(TopoDS_Shape& s1, + TopoDS_Shape& s2, + TopoDS_Shape& s3) const +{ + s1 = _sourceEdge; + s2 = _sourceVertex; + s3 = _targetVertex; +} + +//================================================================================ +/*! + * \brief Set all parameters without notifying on modification + */ +//================================================================================ + +void StdMeshers_ProjectionSource1D::RestoreParams(const TopoDS_Shape& s1, + const TopoDS_Shape& s2, + const TopoDS_Shape& s3, + SMESH_Mesh* mesh) +{ + _sourceEdge = TopoDS::Edge( s1 ); + _sourceVertex = TopoDS::Vertex( s2 ); + _targetVertex = TopoDS::Vertex( s3 ); + _sourceMesh = mesh; +} + diff --git a/src/StdMeshers/StdMeshers_ProjectionSource1D.hxx b/src/StdMeshers/StdMeshers_ProjectionSource1D.hxx new file mode 100644 index 000000000..1431ba22d --- /dev/null +++ b/src/StdMeshers/StdMeshers_ProjectionSource1D.hxx @@ -0,0 +1,144 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource1D.hxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#ifndef _SMESH_ProjectionSource1D_HXX_ +#define _SMESH_ProjectionSource1D_HXX_ + +#include "SMESH_StdMeshers.hxx" + +#include "SMESH_Hypothesis.hxx" +#include "Utils_SALOME_Exception.hxx" + +#include +#include + +class SMESH_Gen; + +// ========================================================= + /*! + * This hypothesis specifies a meshed edge to take a mesh pattern from + * and optionally association of vertices between the source edge and a + * target one (where a hipothesis is assigned to) + */ +// ========================================================= + +class STDMESHERS_EXPORT StdMeshers_ProjectionSource1D: public SMESH_Hypothesis +{ +public: + // Constructor + StdMeshers_ProjectionSource1D( int hypId, int studyId, SMESH_Gen * gen ); + // Destructor + virtual ~StdMeshers_ProjectionSource1D(); + + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceEdge(const TopoDS_Shape& edge) + throw ( SALOME_Exception ); + + /*! + * Returns the source edge + */ + TopoDS_Edge GetSourceEdge() const { return _sourceEdge; } + + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceMesh(SMESH_Mesh* mesh); + + /*! + * Return source mesh + */ + SMESH_Mesh* GetSourceMesh() const { return _sourceMesh; } + + /*! + * Sets vertex association between the source edge and the target one. + * This parameter is optional + */ + void SetVertexAssociation(const TopoDS_Shape& sourceVertex, + const TopoDS_Shape& targetVertex) + throw ( SALOME_Exception ); + + /*! + * Returns the vertex associated with the target vertex. + * Result may be nil if association not set + */ + TopoDS_Vertex GetSourceVertex() const { return _sourceVertex; } + + /*! + * Returns the vertex associated with the source vertex. + * Result may be nil if association not set + */ + TopoDS_Vertex GetTargetVertex() const { return _targetVertex; } + + /*! + * \brief Test if vertex association defined + * \retval bool - test result + */ + bool HasVertexAssociation() const + { return ( !_sourceVertex.IsNull() && !_targetVertex.IsNull() ); } + + /*! + * \brief Return all parameters + */ + void GetStoreParams(TopoDS_Shape& s1, + TopoDS_Shape& s2, + TopoDS_Shape& s3) const; + + /*! + * \brief Set all parameters without notifying on modification + */ + void RestoreParams(const TopoDS_Shape& s1, + const TopoDS_Shape& s2, + const TopoDS_Shape& s3, + SMESH_Mesh* mesh); + + virtual std::ostream & SaveTo(std::ostream & save); + virtual std::istream & LoadFrom(std::istream & load); + friend std::ostream & operator <<(std::ostream & save, StdMeshers_ProjectionSource1D & hyp); + friend std::istream & operator >>(std::istream & load, StdMeshers_ProjectionSource1D & hyp); + + /*! + * \brief Initialize parameters by the mesh built on the geometry + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if parameter values have been successfully defined + * + * Implementation does noting + */ + virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + +protected: + + TopoDS_Edge _sourceEdge; + SMESH_Mesh* _sourceMesh; + TopoDS_Vertex _sourceVertex; + TopoDS_Vertex _targetVertex; +}; + +#endif diff --git a/src/StdMeshers/StdMeshers_ProjectionSource2D.cxx b/src/StdMeshers/StdMeshers_ProjectionSource2D.cxx new file mode 100644 index 000000000..2b9c54232 --- /dev/null +++ b/src/StdMeshers/StdMeshers_ProjectionSource2D.cxx @@ -0,0 +1,300 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's classes +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource2D.cxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + + +#include "StdMeshers_ProjectionSource2D.hxx" + +#include "SMESH_Mesh.hxx" + +#include "utilities.h" + +#include + +using namespace std; + +//============================================================================= +/*! + * StdMeshers_ProjectionSource2D::StdMeshers_ProjectionSource2D + * + * Constructor + */ +//============================================================================= + +StdMeshers_ProjectionSource2D::StdMeshers_ProjectionSource2D(int hypId, int studyId, + SMESH_Gen * gen) + : SMESH_Hypothesis(hypId, studyId, gen) +{ + _name = "ProjectionSource2D"; // used by Projection_2D + _param_algo_dim = 2; // 2D + _sourceMesh = 0; +} + +//============================================================================= +/*! + * StdMeshers_ProjectionSource2D::~StdMeshers_ProjectionSource2D + * + * Destructor + */ +//============================================================================= + +StdMeshers_ProjectionSource2D::~StdMeshers_ProjectionSource2D() +{ + MESSAGE( "StdMeshers_ProjectionSource2D::~StdMeshers_ProjectionSource2D" ); +} + +//============================================================================= + /*! + * Sets a source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource2D::SetSourceFace(const TopoDS_Shape& Face) + throw ( SALOME_Exception ) +{ + if ( Face.IsNull() ) + throw SALOME_Exception(LOCALIZED("Null Face is not allowed")); + + if ( Face.ShapeType() != TopAbs_FACE ) + throw SALOME_Exception(LOCALIZED("Wrong shape type")); + + if ( !_sourceFace.IsSame( Face ) ) + { + _sourceFace = TopoDS::Face( Face ); + + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * Sets vertex association between the source face and the target one. + * This parameter is optional. + * Two vertices must belong to one edge of a face + */ +//============================================================================= + +void StdMeshers_ProjectionSource2D::SetVertexAssociation(const TopoDS_Shape& sourceVertex1, + const TopoDS_Shape& sourceVertex2, + const TopoDS_Shape& targetVertex1, + const TopoDS_Shape& targetVertex2) + throw ( SALOME_Exception ) +{ + if ( sourceVertex1.IsNull() != targetVertex1.IsNull() || + sourceVertex2.IsNull() != targetVertex2.IsNull() || + sourceVertex1.IsNull() != targetVertex2.IsNull() ) + throw SALOME_Exception(LOCALIZED("Two or none pairs of vertices must be provided")); + + if ( !sourceVertex1.IsNull() ) { + if ( sourceVertex1.ShapeType() != TopAbs_VERTEX || + sourceVertex2.ShapeType() != TopAbs_VERTEX || + targetVertex1.ShapeType() != TopAbs_VERTEX || + targetVertex2.ShapeType() != TopAbs_VERTEX ) + throw SALOME_Exception(LOCALIZED("Wrong shape type")); + } + + if ( !_sourceVertex1.IsSame( sourceVertex1 ) || + !_sourceVertex2.IsSame( sourceVertex2 ) || + !_targetVertex1.IsSame( targetVertex1 ) || + !_targetVertex2.IsSame( targetVertex2 ) ) + { + _sourceVertex1 = TopoDS::Vertex( sourceVertex1 ); + _sourceVertex2 = TopoDS::Vertex( sourceVertex2 ); + _targetVertex1 = TopoDS::Vertex( targetVertex1 ); + _targetVertex2 = TopoDS::Vertex( targetVertex2 ); + + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * Sets source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource2D::SetSourceMesh(SMESH_Mesh* mesh) +{ + if ( _sourceMesh != mesh ) + NotifySubMeshesHypothesisModification(); + _sourceMesh = mesh; +} + +//============================================================================= +/*! + * Returns the source face + */ +//============================================================================= + +TopoDS_Face StdMeshers_ProjectionSource2D::GetSourceFace() const +{ + return _sourceFace; +} + +//============================================================================= +/*! + * Returns the vertex associated with the target vertex. + * Result may be nil if association not set + */ +//============================================================================= + +TopoDS_Vertex StdMeshers_ProjectionSource2D::GetSourceVertex(int i) const + throw ( SALOME_Exception ) +{ + if ( i == 1 ) + return _sourceVertex1; + else if ( i == 2 ) + return _sourceVertex2; + else + throw SALOME_Exception(LOCALIZED("Wrong vertex index")); +} + +//============================================================================= +/*! + * Returns the -th target vertex associated with the -th source vertex. + * Result may be nil if association not set. + */ +//============================================================================= + +TopoDS_Vertex StdMeshers_ProjectionSource2D::GetTargetVertex(int i) const + throw ( SALOME_Exception ) +{ + if ( i == 1 ) + return _targetVertex1; + else if ( i == 2 ) + return _targetVertex2; + else + throw SALOME_Exception(LOCALIZED("Wrong vertex index")); +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +ostream & StdMeshers_ProjectionSource2D::SaveTo(ostream & save) +{ + // we store it in order to be able to detect that hypo is really modified + save << " " << _sourceFace.TShape().operator->() ; + save << " " << _sourceVertex1.TShape().operator->(); + save << " " << _targetVertex1.TShape().operator->(); + save << " " << _sourceVertex2.TShape().operator->(); + save << " " << _targetVertex2.TShape().operator->(); + save << " " << ( _sourceMesh ? _sourceMesh->GetId() : -1 ); + return save; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +istream & StdMeshers_ProjectionSource2D::LoadFrom(istream & load) +{ + // impossible to restore w/o any context + // It is done by servant + return load; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +ostream & operator <<(ostream & save, StdMeshers_ProjectionSource2D & hyp) +{ + return hyp.SaveTo( save ); +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +istream & operator >>(istream & load, StdMeshers_ProjectionSource2D & hyp) +{ + return hyp.LoadFrom( load ); +} + +//================================================================================ +/*! + * \brief Initialize start and end length by the mesh built on the geometry + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if parameter values have been successfully defined + */ +//================================================================================ + +bool StdMeshers_ProjectionSource2D::SetParametersByMesh(const SMESH_Mesh* , + const TopoDS_Shape& ) +{ + return false; +} + +//================================================================================ +/*! + * \brief Return all parameters + */ +//================================================================================ + +void StdMeshers_ProjectionSource2D::GetStoreParams(TopoDS_Shape& s1, + TopoDS_Shape& s2, + TopoDS_Shape& s3, + TopoDS_Shape& s4, + TopoDS_Shape& s5) const +{ + s1 = _sourceFace; + s2 = _sourceVertex1; + s3 = _sourceVertex2; + s4 = _targetVertex1; + s5 = _targetVertex2; +} + +//================================================================================ +/*! + * \brief Set all parameters without notifying on modification + */ +//================================================================================ + +void StdMeshers_ProjectionSource2D::RestoreParams(const TopoDS_Shape& s1, + const TopoDS_Shape& s2, + const TopoDS_Shape& s3, + const TopoDS_Shape& s4, + const TopoDS_Shape& s5, + SMESH_Mesh* mesh) +{ + _sourceFace = TopoDS::Face( s1 ); + _sourceVertex1 = TopoDS::Vertex( s2 ); + _sourceVertex2 = TopoDS::Vertex( s3 ); + _targetVertex1 = TopoDS::Vertex( s4 ); + _targetVertex2 = TopoDS::Vertex( s5 ); + _sourceMesh = mesh; +} diff --git a/src/StdMeshers/StdMeshers_ProjectionSource2D.hxx b/src/StdMeshers/StdMeshers_ProjectionSource2D.hxx new file mode 100644 index 000000000..28c44aedb --- /dev/null +++ b/src/StdMeshers/StdMeshers_ProjectionSource2D.hxx @@ -0,0 +1,157 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource2D.hxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#ifndef _SMESH_ProjectionSource2D_HXX_ +#define _SMESH_ProjectionSource2D_HXX_ + +#include "SMESH_StdMeshers.hxx" + +#include "SMESH_Hypothesis.hxx" +#include "Utils_SALOME_Exception.hxx" + +#include +#include + +class SMESH_Gen; + +// ========================================================= +/*! + * This hypothesis specifies a meshed face to take a mesh pattern from + * and optionally association of vertices between the source face and a + * target one (where a hipothesis is assigned to) + */ +// ========================================================= + +class STDMESHERS_EXPORT StdMeshers_ProjectionSource2D: public SMESH_Hypothesis +{ +public: + // Constructor + StdMeshers_ProjectionSource2D( int hypId, int studyId, SMESH_Gen * gen ); + // Destructor + virtual ~StdMeshers_ProjectionSource2D(); + + /*! + * Sets a source to take a mesh pattern from + */ + void SetSourceFace(const TopoDS_Shape& face) + throw ( SALOME_Exception ); + + /*! + * Returns the source face + */ + TopoDS_Face GetSourceFace() const; + + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceMesh(SMESH_Mesh* mesh); + + /*! + * Return source mesh + */ + SMESH_Mesh* GetSourceMesh() const { return _sourceMesh; } + + /*! + * Sets vertex association between the source face and the target one. + * This parameter is optional. + * Two vertices must belong to one edge of a face + */ + void SetVertexAssociation(const TopoDS_Shape& sourceVertex1, + const TopoDS_Shape& sourceVertex2, + const TopoDS_Shape& targetVertex1, + const TopoDS_Shape& targetVertex2) + throw ( SALOME_Exception ); + + /*! + * Returns the -th source vertex associated with the -th target vertex. + * Result may be nil if association not set. + * Valid indices are 1 and 2 + */ + TopoDS_Vertex GetSourceVertex(int i) const throw ( SALOME_Exception ); + + /*! + * Returns the -th target vertex associated with the -th source vertex. + * Result may be nil if association not set. + * Valid indices are 1 and 2 + */ + TopoDS_Vertex GetTargetVertex(int i) const throw ( SALOME_Exception ); + + /*! + * \brief Test if vertex association defined + * \retval bool - test result + */ + bool HasVertexAssociation() const + { return ( !_sourceVertex1.IsNull() && !_targetVertex1.IsNull() && + !_sourceVertex2.IsNull() && !_targetVertex2.IsNull()); } + + /*! + * \brief Return all parameters + */ + void GetStoreParams(TopoDS_Shape& s1, + TopoDS_Shape& s2, + TopoDS_Shape& s3, + TopoDS_Shape& s4, + TopoDS_Shape& s5) const; + + /*! + * \brief Set all parameters without notifying on modification + */ + void RestoreParams(const TopoDS_Shape& s1, + const TopoDS_Shape& s2, + const TopoDS_Shape& s3, + const TopoDS_Shape& s4, + const TopoDS_Shape& s5, + SMESH_Mesh* mesh); + + virtual std::ostream & SaveTo(std::ostream & save); + virtual std::istream & LoadFrom(std::istream & load); + friend std::ostream & operator <<(std::ostream & save, StdMeshers_ProjectionSource2D & hyp); + friend std::istream & operator >>(std::istream & load, StdMeshers_ProjectionSource2D & hyp); + + /*! + * \brief Initialize parameters by the mesh built on the geometry + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if parameter values have been successfully defined + * + * Implementation does noting + */ + virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + +protected: + + TopoDS_Face _sourceFace; + SMESH_Mesh* _sourceMesh; + TopoDS_Vertex _sourceVertex1; + TopoDS_Vertex _sourceVertex2; + TopoDS_Vertex _targetVertex1; + TopoDS_Vertex _targetVertex2; +}; + +#endif + diff --git a/src/StdMeshers/StdMeshers_ProjectionSource3D.cxx b/src/StdMeshers/StdMeshers_ProjectionSource3D.cxx new file mode 100644 index 000000000..00a889160 --- /dev/null +++ b/src/StdMeshers/StdMeshers_ProjectionSource3D.cxx @@ -0,0 +1,299 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's classes +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource3D.cxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#include "StdMeshers_ProjectionSource3D.hxx" + +#include "utilities.h" +#include "SMESH_Gen.hxx" + +#include + +using namespace std; + +//============================================================================= +/*! + * StdMeshers_ProjectionSource3D::StdMeshers_ProjectionSource3D + * + * Constructor + */ +//============================================================================= + +StdMeshers_ProjectionSource3D::StdMeshers_ProjectionSource3D(int hypId, int studyId, + SMESH_Gen * gen) + : SMESH_Hypothesis(hypId, studyId, gen) +{ + _name = "ProjectionSource3D"; // used by Projection_3D + _param_algo_dim = 3; // 3D + _sourceMesh = 0; +} + +//============================================================================= +/*! + * StdMeshers_ProjectionSource3D::~StdMeshers_ProjectionSource3D + * + * Destructor + */ +//============================================================================= + +StdMeshers_ProjectionSource3D::~StdMeshers_ProjectionSource3D() +{ + MESSAGE( "StdMeshers_ProjectionSource3D::~StdMeshers_ProjectionSource3D" ); +} + +//============================================================================= + /*! + * Sets a source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource3D::SetSource3DShape(const TopoDS_Shape& Shape) + throw ( SALOME_Exception ) +{ + if ( Shape.IsNull() ) + throw SALOME_Exception(LOCALIZED("Null Shape is not allowed")); + + if ( SMESH_Gen::GetShapeDim( Shape ) != 3 ) + throw SALOME_Exception(LOCALIZED("Wrong shape type")); + + if ( !_sourceShape.IsSame( Shape ) ) + { + _sourceShape = Shape; + + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * Sets vertex association between the source shape and the target one. + * This parameter is optional. + * Two vertices must belong to one edge of a shape + */ +//============================================================================= + +void StdMeshers_ProjectionSource3D::SetVertexAssociation(const TopoDS_Shape& sourceVertex1, + const TopoDS_Shape& sourceVertex2, + const TopoDS_Shape& targetVertex1, + const TopoDS_Shape& targetVertex2) + throw ( SALOME_Exception ) +{ + if ( sourceVertex1.IsNull() != targetVertex1.IsNull() || + sourceVertex2.IsNull() != targetVertex2.IsNull() || + sourceVertex1.IsNull() != targetVertex2.IsNull() ) + throw SALOME_Exception(LOCALIZED("Two or none pairs of vertices must be provided")); + + if ( !sourceVertex1.IsNull() ) { + if ( sourceVertex1.ShapeType() != TopAbs_VERTEX || + sourceVertex2.ShapeType() != TopAbs_VERTEX || + targetVertex1.ShapeType() != TopAbs_VERTEX || + targetVertex2.ShapeType() != TopAbs_VERTEX ) + throw SALOME_Exception(LOCALIZED("Wrong shape type")); + } + + if ( !_sourceVertex1.IsSame( sourceVertex1 ) || + !_sourceVertex2.IsSame( sourceVertex2 ) || + !_targetVertex1.IsSame( targetVertex1 ) || + !_targetVertex2.IsSame( targetVertex2 ) ) + { + _sourceVertex1 = TopoDS::Vertex( sourceVertex1 ); + _sourceVertex2 = TopoDS::Vertex( sourceVertex2 ); + _targetVertex1 = TopoDS::Vertex( targetVertex1 ); + _targetVertex2 = TopoDS::Vertex( targetVertex2 ); + + NotifySubMeshesHypothesisModification(); + } +} + +//============================================================================= +/*! + * Sets source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource3D::SetSourceMesh(SMESH_Mesh* mesh) +{ + if ( _sourceMesh != mesh ) + NotifySubMeshesHypothesisModification(); + _sourceMesh = mesh; +} + +//============================================================================= +/*! + * Returns the source face + */ +//============================================================================= + +TopoDS_Shape StdMeshers_ProjectionSource3D::GetSource3DShape() const +{ + return _sourceShape; +} + +//============================================================================= +/*! + * Returns the vertex associated with the target vertex. + * Result may be nil if association not set + */ +//============================================================================= + +TopoDS_Vertex StdMeshers_ProjectionSource3D::GetSourceVertex(int i) const + throw ( SALOME_Exception ) +{ + if ( i == 1 ) + return _sourceVertex1; + else if ( i == 2 ) + return _sourceVertex2; + else + throw SALOME_Exception(LOCALIZED("Wrong vertex index")); +} + +//============================================================================= +/*! + * Returns the -th target vertex associated with the -th source vertex. + * Result may be nil if association not set. + */ +//============================================================================= + +TopoDS_Vertex StdMeshers_ProjectionSource3D::GetTargetVertex(int i) const + throw ( SALOME_Exception ) +{ + if ( i == 1 ) + return _targetVertex1; + else if ( i == 2 ) + return _targetVertex2; + else + throw SALOME_Exception(LOCALIZED("Wrong vertex index")); +} + + +//============================================================================= +/*! + * + */ +//============================================================================= + +ostream & StdMeshers_ProjectionSource3D::SaveTo(ostream & save) +{ + // we store it in order to be able to detect that hypo is really modified + save << " " << _sourceShape.TShape().operator->() ; + save << " " << _sourceVertex1.TShape().operator->(); + save << " " << _targetVertex1.TShape().operator->(); + save << " " << _sourceVertex2.TShape().operator->(); + save << " " << _targetVertex2.TShape().operator->(); + save << " " << ( _sourceMesh ? _sourceMesh->GetId() : -1 ); + return save; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +istream & StdMeshers_ProjectionSource3D::LoadFrom(istream & load) +{ + // impossible to restore w/o any context + // It is done by servant + return load; +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +ostream & operator <<(ostream & save, StdMeshers_ProjectionSource3D & hyp) +{ + return hyp.SaveTo( save ); +} + +//============================================================================= +/*! + * + */ +//============================================================================= + +istream & operator >>(istream & load, StdMeshers_ProjectionSource3D & hyp) +{ + return hyp.LoadFrom( load ); +} + +//================================================================================ +/*! + * \brief Initialize start and end length by the mesh built on the geometry + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if parameter values have been successfully defined + */ +//================================================================================ + +bool StdMeshers_ProjectionSource3D::SetParametersByMesh(const SMESH_Mesh* , + const TopoDS_Shape& ) +{ + return false; +} + +//================================================================================ +/*! + * \brief Return all parameters + */ +//================================================================================ + +void StdMeshers_ProjectionSource3D::GetStoreParams(TopoDS_Shape& s1, + TopoDS_Shape& s2, + TopoDS_Shape& s3, + TopoDS_Shape& s4, + TopoDS_Shape& s5) const +{ + s1 = _sourceShape; + s2 = _sourceVertex1; + s3 = _sourceVertex2; + s4 = _targetVertex1; + s5 = _targetVertex2; +} + +//================================================================================ +/*! + * \brief Set all parameters without notifying on modification + */ +//================================================================================ + +void StdMeshers_ProjectionSource3D::RestoreParams(const TopoDS_Shape& s1, + const TopoDS_Shape& s2, + const TopoDS_Shape& s3, + const TopoDS_Shape& s4, + const TopoDS_Shape& s5, + SMESH_Mesh* mesh) +{ + _sourceShape = s1; + _sourceVertex1 = TopoDS::Vertex( s2 ); + _sourceVertex2 = TopoDS::Vertex( s3 ); + _targetVertex1 = TopoDS::Vertex( s4 ); + _targetVertex2 = TopoDS::Vertex( s5 ); + _sourceMesh = mesh; +} diff --git a/src/StdMeshers/StdMeshers_ProjectionSource3D.hxx b/src/StdMeshers/StdMeshers_ProjectionSource3D.hxx new file mode 100644 index 000000000..7dfeca6f0 --- /dev/null +++ b/src/StdMeshers/StdMeshers_ProjectionSource3D.hxx @@ -0,0 +1,155 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource3D.hxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#ifndef _SMESH_ProjectionSource3D_HXX_ +#define _SMESH_ProjectionSource3D_HXX_ + +#include "SMESH_StdMeshers.hxx" + +#include "SMESH_Hypothesis.hxx" +#include "Utils_SALOME_Exception.hxx" + +#include + +class SMESH_Gen; + +// ========================================================= +/*! + * This hypothesis specifies a meshed shell or solid to take a mesh pattern from + * and optionally association of vertices between the source shape and a + * target one (where a hipothesis is assigned to) + */ +// ========================================================= + +class STDMESHERS_EXPORT StdMeshers_ProjectionSource3D: public SMESH_Hypothesis +{ +public: + // Constructor + StdMeshers_ProjectionSource3D( int hypId, int studyId, SMESH_Gen * gen ); + // Destructor + virtual ~StdMeshers_ProjectionSource3D(); + + /*! + * Sets a source to take a mesh pattern from + */ + void SetSource3DShape(const TopoDS_Shape& shape) + throw ( SALOME_Exception ); + + /*! + * Returns the source shape + */ + TopoDS_Shape GetSource3DShape() const; + + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceMesh(SMESH_Mesh* mesh); + + /*! + * Return source mesh + */ + SMESH_Mesh* GetSourceMesh() const { return _sourceMesh; } + + /*! + * Sets vertex association between the source shape and the target one. + * This parameter is optional. + * Two vertices must belong to one edge of a shape + */ + void SetVertexAssociation(const TopoDS_Shape& sourceVertex1, + const TopoDS_Shape& sourceVertex2, + const TopoDS_Shape& targetVertex1, + const TopoDS_Shape& targetVertex2) + throw ( SALOME_Exception ); + + /*! + * Returns the -th source vertex associated with the -th target vertex. + * Result may be nil if association not set. + */ + TopoDS_Vertex GetSourceVertex(int i) const throw ( SALOME_Exception ); + + /*! + * Returns the -th target vertex associated with the -th source vertex. + * Result may be nil if association not set. + */ + TopoDS_Vertex GetTargetVertex(int i) const throw ( SALOME_Exception ); + + /*! + * \brief Test if vertex association defined + * \retval bool - test result + */ + bool HasVertexAssociation() const + { return ( !_sourceVertex1.IsNull() && !_targetVertex1.IsNull() && + !_sourceVertex2.IsNull() && !_targetVertex2.IsNull()); } + + /*! + * \brief Return all parameters + */ + void GetStoreParams(TopoDS_Shape& s1, + TopoDS_Shape& s2, + TopoDS_Shape& s3, + TopoDS_Shape& s4, + TopoDS_Shape& s5) const; + + /*! + * \brief Set all parameters without notifying on modification + */ + void RestoreParams(const TopoDS_Shape& s1, + const TopoDS_Shape& s2, + const TopoDS_Shape& s3, + const TopoDS_Shape& s4, + const TopoDS_Shape& s5, + SMESH_Mesh* mesh); + + virtual std::ostream & SaveTo(std::ostream & save); + virtual std::istream & LoadFrom(std::istream & load); + friend std::ostream & operator <<(std::ostream & save, StdMeshers_ProjectionSource3D & hyp); + friend std::istream & operator >>(std::istream & load, StdMeshers_ProjectionSource3D & hyp); + + /*! + * \brief Initialize parameters by the mesh built on the geometry + * \param theMesh - the built mesh + * \param theShape - the geometry of interest + * \retval bool - true if parameter values have been successfully defined + * + * Implementation does noting + */ + virtual bool SetParametersByMesh(const SMESH_Mesh* theMesh, const TopoDS_Shape& theShape); + +protected: + + TopoDS_Shape _sourceShape; + SMESH_Mesh* _sourceMesh; + TopoDS_Vertex _sourceVertex1; + TopoDS_Vertex _sourceVertex2; + TopoDS_Vertex _targetVertex1; + TopoDS_Vertex _targetVertex2; + +}; + +#endif + diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx new file mode 100644 index 000000000..2afedd4ce --- /dev/null +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -0,0 +1,1241 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionUtils.cxx +// Created : Fri Oct 27 10:24:28 2006 +// Author : Edward AGAPOV (eap) + + +#include "StdMeshers_ProjectionUtils.hxx" + +#include "StdMeshers_ProjectionSource1D.hxx" +#include "StdMeshers_ProjectionSource2D.hxx" +#include "StdMeshers_ProjectionSource3D.hxx" + +#include "SMESH_Algo.hxx" +#include "SMESH_Block.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_Hypothesis.hxx" +#include "SMESH_IndexedDataMapOfShapeIndexedMapOfShape.hxx" +#include "SMESH_Mesh.hxx" +#include "SMESH_MeshEditor.hxx" +#include "SMESH_subMesh.hxx" +#include "SMDS_EdgePosition.hxx" + +#include "utilities.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; } +#define SHOW_VERTEX(v,msg) // { \ +// if ( v.IsNull() ) cout << msg << " NULL SHAPE" << endl; \ +// else if (v.ShapeType() == TopAbs_VERTEX) {\ +// gp_Pnt p = BRep_Tool::Pnt( TopoDS::Vertex( v ));\ +// cout << msg << (v).TShape().operator->()<<" ( " <()<::const_iterator e = l.begin();\ +// for ( int i = 0; e != l.end(); ++e, ++i ) {\ +// cout << i << "V (" << TopExp::FirstVertex( *e, true ).TShape().operator->() << ") "\ +// << i << "E (" << e->TShape().operator->() << "); "; }\ +// cout << endl;\ +// } + +namespace { + //================================================================================ + /*! + * \brief Reverse order of edges in a list and their orientation + * \param edges - list of edges to reverse + * \param nbEdges - number of edges to reverse + */ + //================================================================================ + + void Reverse( list< TopoDS_Edge > & edges, const int nbEdges ) + { + SHOW_LIST("BEFORE REVERSE", edges); + + list< TopoDS_Edge >::iterator eIt = edges.begin(); + if ( edges.size() == nbEdges ) + { + edges.reverse(); + } + else // reverse only the given nb of edges + { + // look for the last edge to be reversed + list< TopoDS_Edge >::iterator eBackIt = edges.begin(); + for ( int i = 1; i < nbEdges; ++i ) + ++eBackIt; + // reverse + while ( eIt != eBackIt ) { + std::swap( *eIt, *eBackIt ); + SHOW_LIST("# AFTER SWAP", edges) + if ( (++eIt) != eBackIt ) + --eBackIt; + } + } + for ( eIt = edges.begin(); eIt != edges.end(); ++eIt ) + eIt->Reverse(); + SHOW_LIST("ATFER REVERSE", edges) + } + + //================================================================================ + /*! + * \brief Check if propagation is possible + * \param theMesh1 - source mesh + * \param theMesh2 - target mesh + * \retval bool - true if possible + */ + //================================================================================ + + bool IsPropagationPossible( SMESH_Mesh* theMesh1, SMESH_Mesh* theMesh2 ) + { + if ( theMesh1 != theMesh2 ) { + TopoDS_Shape mainShape1 = theMesh1->GetMeshDS()->ShapeToMesh(); + TopoDS_Shape mainShape2 = theMesh2->GetMeshDS()->ShapeToMesh(); + return mainShape1.IsSame( mainShape2 ); + } + return true; + } + + //================================================================================ + /*! + * \brief Fix up association of edges in faces by possible propagation + * \param nbEdges - nb of edges in an outer wire + * \param edges1 - edges of one face + * \param edges2 - matching edges of another face + * \param theMesh1 - mesh 1 + * \param theMesh2 - mesh 2 + */ + //================================================================================ + + void FixAssocByPropagation( const int nbEdges, + list< TopoDS_Edge > & edges1, + list< TopoDS_Edge > & edges2, + SMESH_Mesh* theMesh1, + SMESH_Mesh* theMesh2) + { + if ( nbEdges == 2 && IsPropagationPossible( theMesh1, theMesh2 ) ) + { + list< TopoDS_Edge >::iterator eIt2 = ++edges2.begin(); // 2nd edge of the 2nd face + TopoDS_Edge edge2 = + StdMeshers_ProjectionUtils::GetPropagationEdge( theMesh1, *eIt2, edges1.front() ); + if ( !edge2.IsNull() ) // propagation found for the second edge + Reverse( edges2, nbEdges ); + } + } +} + +//======================================================================= +/*! + * \brief Looks for association of all subshapes of two shapes + * \param theShape1 - shape 1 + * \param theMesh1 - mesh built on shape 1 + * \param theShape2 - shape 2 + * \param theMesh2 - mesh built on shape 2 + * \param theAssociation - association map to be filled that may + * contain association of one or two pairs of vertices + * \retval bool - true if association found + */ +//======================================================================= + +bool StdMeshers_ProjectionUtils::FindSubShapeAssociation(const TopoDS_Shape& theShape1, + SMESH_Mesh* theMesh1, + const TopoDS_Shape& theShape2, + SMESH_Mesh* theMesh2, + TShapeShapeMap & theMap) +{ + if ( theShape1.ShapeType() != theShape2.ShapeType() ) + RETURN_BAD_RESULT("Different shape types"); + + bool bidirect = ( !theShape1.IsSame( theShape2 )); + if ( !theMap.IsEmpty()) + { + switch ( theShape1.ShapeType() ) { + + case TopAbs_EDGE: { + // ---------------------------------------------------------------------- + if ( theMap.Extent() != 2 ) + RETURN_BAD_RESULT("Wrong map extent " << theMap.Extent() ); + TopoDS_Edge edge1 = TopoDS::Edge( theShape1 ); + TopoDS_Edge edge2 = TopoDS::Edge( theShape2 ); + TopoDS_Vertex VV1[2], VV2[2]; + TopExp::Vertices( edge1, VV1[0], VV1[1] ); + TopExp::Vertices( edge2, VV2[0], VV2[1] ); + int i1 = 0, i2 = 0; + if ( theMap.IsBound( VV1[ i1 ] )) i1 = 1; + if ( theMap.IsBound( VV2[ i2 ] )) i2 = 1; + InsertAssociation( VV1[ i1 ], VV2[ i2 ], theMap, bidirect); + return true; + } + + case TopAbs_FACE: { + // ---------------------------------------------------------------------- + TopoDS_Face face1 = TopoDS::Face( theShape1 ); + TopoDS_Face face2 = TopoDS::Face( theShape2 ); + + TopoDS_Vertex VV1[2], VV2[2]; + // find a not closed edge of face1 both vertices of which are associated + int nbEdges = 0; + TopExp_Explorer exp ( face1, TopAbs_EDGE ); + for ( ; VV2[ 1 ].IsNull() && exp.More(); exp.Next(), ++nbEdges ) { + TopExp::Vertices( TopoDS::Edge( exp.Current() ), VV1[0], VV1[1] ); + if ( theMap.IsBound( VV1[0] ) ) { + VV2[ 0 ] = TopoDS::Vertex( theMap( VV1[0] )); + if ( theMap.IsBound( VV1[1] ) && !VV1[0].IsSame( VV1[1] )) + VV2[ 1 ] = TopoDS::Vertex( theMap( VV1[1] )); + } + } + if ( VV2[ 1 ].IsNull() ) { // 2 bound vertices not found + if ( nbEdges > 1 ) { + RETURN_BAD_RESULT("2 bound vertices not found" ); + } else { + VV2[ 1 ] = VV2[ 0 ]; + } + } + list< TopoDS_Edge > edges1, edges2; + int nbE = FindFaceAssociation( face1, VV1, face2, VV2, edges1, edges2 ); + if ( !nbE ) RETURN_BAD_RESULT("FindFaceAssociation() failed"); + FixAssocByPropagation( nbE, edges1, edges2, theMesh1, theMesh2 ); + + list< TopoDS_Edge >::iterator eIt1 = edges1.begin(); + list< TopoDS_Edge >::iterator eIt2 = edges2.begin(); + for ( ; eIt1 != edges1.end(); ++eIt1, ++eIt2 ) + { + InsertAssociation( *eIt1, *eIt2, theMap, bidirect); + VV1[0] = TopExp::FirstVertex( *eIt1, true ); + VV2[0] = TopExp::FirstVertex( *eIt2, true ); + InsertAssociation( VV1[0], VV2[0], theMap, bidirect); + } + return true; + } + + case TopAbs_SHELL: + case TopAbs_SOLID: { + // ---------------------------------------------------------------------- + TopoDS_Vertex VV1[2], VV2[2]; + // find a not closed edge of shape1 both vertices of which are associated + TopoDS_Edge edge1; + TopExp_Explorer exp ( theShape1, TopAbs_EDGE ); + for ( ; VV2[ 1 ].IsNull() && exp.More(); exp.Next() ) { + edge1 = TopoDS::Edge( exp.Current() ); + TopExp::Vertices( edge1 , VV1[0], VV1[1] ); + if ( theMap.IsBound( VV1[0] )) { + VV2[ 0 ] = TopoDS::Vertex( theMap( VV1[0] )); + if ( theMap.IsBound( VV1[1] ) && !VV1[0].IsSame( VV1[1] )) + VV2[ 1 ] = TopoDS::Vertex( theMap( VV1[1] )); + } + } + if ( VV2[ 1 ].IsNull() ) // 2 bound vertices not found + RETURN_BAD_RESULT("2 bound vertices not found" ); + TopoDS_Edge edge2 = GetEdgeByVertices( theMesh2, VV2[ 0 ], VV2[ 1 ]); + if ( edge2.IsNull() ) + RETURN_BAD_RESULT("GetEdgeByVertices() failed"); + + // get a face sharing edge1 + TopoDS_Shape F1, F2, FF2[2]; + TopTools_ListIteratorOfListOfShape ancestIt = theMesh1->GetAncestors( edge1 ); + for ( ; F1.IsNull() && ancestIt.More(); ancestIt.Next() ) + if ( ancestIt.Value().ShapeType() == TopAbs_FACE ) + F1 = ancestIt.Value().Oriented( TopAbs_FORWARD ); + if ( F1.IsNull() ) + RETURN_BAD_RESULT(" Face1 not found"); + + // get 2 faces sharing edge2 + ancestIt = theMesh2->GetAncestors( edge2 ); + for ( int i = 0; FF2[1].IsNull() && ancestIt.More(); ancestIt.Next() ) + if ( ancestIt.Value().ShapeType() == TopAbs_FACE ) + FF2[ i++ ] = ancestIt.Value().Oriented( TopAbs_FORWARD ); + if ( FF2[1].IsNull() ) + RETURN_BAD_RESULT("2 faces not found"); + + // get oriented edge1 and edge2 from F1 and FF2[0] + for ( exp.Init( F1, TopAbs_EDGE ); exp.More(); exp.Next() ) + if ( edge1.IsSame( exp.Current() )) { + edge1 = TopoDS::Edge( exp.Current() ); + break; + } + + for ( exp.Init( FF2[ 0 ], TopAbs_EDGE ); exp.More(); exp.Next() ) + if ( edge2.IsSame( exp.Current() )) { + edge2 = TopoDS::Edge( exp.Current() ); + break; + } + + // compare first vertices of edge1 and edge2 + TopExp::Vertices( edge1, VV1[0], VV1[1], true ); + TopExp::Vertices( edge2, VV2[0], VV2[1], true ); + F2 = FF2[ 0 ]; + if ( !VV1[ 0 ].IsSame( theMap( VV2[ 0 ]))) { + F2 = FF2[ 1 ]; + edge2.Reverse(); + } + + TopTools_MapOfShape boundEdges; + + // association of face subshapes and neighbour faces + list< pair < TopoDS_Face, TopoDS_Edge > > FE1, FE2; + list< pair < TopoDS_Face, TopoDS_Edge > >::iterator fe1, fe2; + FE1.push_back( make_pair( TopoDS::Face( F1 ), edge1 )); + FE2.push_back( make_pair( TopoDS::Face( F2 ), edge2 )); + for ( fe1 = FE1.begin(), fe2 = FE2.begin(); fe1 != FE1.end(); ++fe1, ++fe2 ) + { + const TopoDS_Face& face1 = fe1->first; + if ( theMap.IsBound( face1 ) ) continue; + const TopoDS_Face& face2 = fe2->first; + edge1 = fe1->second; + edge2 = fe2->second; + TopExp::Vertices( edge1, VV1[0], VV1[1], true ); + TopExp::Vertices( edge2, VV2[0], VV2[1], true ); + list< TopoDS_Edge > edges1, edges2; + int nbE = FindFaceAssociation( face1, VV1, face2, VV2, edges1, edges2 ); + if ( !nbE ) RETURN_BAD_RESULT("FindFaceAssociation() failed"); + FixAssocByPropagation( nbE, edges1, edges2, theMesh1, theMesh2 ); + + InsertAssociation( face1, face2, theMap, bidirect); // assoc faces + list< TopoDS_Edge >::iterator eIt1 = edges1.begin(); + list< TopoDS_Edge >::iterator eIt2 = edges2.begin(); + for ( ; eIt1 != edges1.end(); ++eIt1, ++eIt2 ) + { + if ( !boundEdges.Add( *eIt1 )) continue; // already associated + InsertAssociation( *eIt1, *eIt2, theMap, bidirect); // assoc edges + VV1[0] = TopExp::FirstVertex( *eIt1, true ); + VV2[0] = TopExp::FirstVertex( *eIt2, true ); + InsertAssociation( VV1[0], VV2[0], theMap, bidirect); // assoc vertices + + // add adjacent faces to process + TopoDS_Face nextFace1 = GetNextFace( theMesh1, *eIt1, face1 ); + TopoDS_Face nextFace2 = GetNextFace( theMesh2, *eIt2, face2 ); + if ( !nextFace1.IsNull() && !nextFace2.IsNull() ) { + FE1.push_back( make_pair( nextFace1, *eIt1 )); + FE2.push_back( make_pair( nextFace2, *eIt2 )); + } + } + } + return true; + } + default: + RETURN_BAD_RESULT("Unexpected shape type"); + + } // end switch by shape type + } // end case of available initial vertex association + + //---------------------------------------------------------------------- + // NO INITIAL VERTEX ASSOCIATION + //---------------------------------------------------------------------- + + switch ( theShape1.ShapeType() ) { + + case TopAbs_EDGE: { + // ---------------------------------------------------------------------- + TopoDS_Edge edge1 = TopoDS::Edge( theShape1 ); + TopoDS_Edge edge2 = TopoDS::Edge( theShape2 ); + if ( IsPropagationPossible( theMesh1, theMesh2 )) + { + TopoDS_Edge prpEdge = GetPropagationEdge( theMesh1, edge2, edge1 ); + if ( !prpEdge.IsNull() ) + { + TopoDS_Vertex VV1[2], VV2[2]; + TopExp::Vertices( edge1, VV1[0], VV1[1], true ); + TopExp::Vertices( prpEdge, VV2[0], VV2[1], true ); + InsertAssociation( VV1[ 0 ], VV2[ 0 ], theMap, bidirect); + InsertAssociation( VV1[ 1 ], VV2[ 1 ], theMap, bidirect); + if ( VV1[0].IsSame( VV1[1] ) || // one of edges is closed + VV2[0].IsSame( VV2[1] ) ) + { + InsertAssociation( edge1, prpEdge, theMap, bidirect); // insert with a proper orientation + } + return true; // done + } + } + if ( IsClosedEdge( edge1 ) && IsClosedEdge( edge2 )) + { + // TODO: find out a proper orientation (is it possible?) + InsertAssociation( edge1, edge2, theMap, bidirect); // insert with a proper orientation + InsertAssociation( TopExp::FirstVertex(edge1), TopExp::FirstVertex(edge2), + theMap, bidirect); + return true; // done + } + break; // try by vertex closeness + } + + case TopAbs_FACE: { + // ---------------------------------------------------------------------- + if ( IsPropagationPossible( theMesh1, theMesh2 )) // try by propagation in one mesh + { + TopoDS_Face face1 = TopoDS::Face(theShape1); + TopoDS_Face face2 = TopoDS::Face(theShape2); + // get outer edge of theShape1 + TopoDS_Edge edge1 = TopoDS::Edge( OuterShape( face1, TopAbs_EDGE )); + // find out if any edge of face2 is a propagation edge of outer edge1 + for ( TopExp_Explorer exp( face2, TopAbs_EDGE ); exp.More(); exp.Next() ) { + TopoDS_Edge edge2 = TopoDS::Edge( exp.Current() ); + edge2 = GetPropagationEdge( theMesh1, edge2, edge1 ); + if ( !edge2.IsNull() ) // propagation found + { + TopoDS_Vertex VV1[2], VV2[2]; + TopExp::Vertices( edge1, VV1[0], VV1[1], true ); + TopExp::Vertices( edge2, VV2[0], VV2[1], true ); + list< TopoDS_Edge > edges1, edges2; + int nbE = FindFaceAssociation( face1, VV1, face2, VV2, edges1, edges2 ); + if ( !nbE ) RETURN_BAD_RESULT("FindFaceAssociation() failed"); + if ( nbE == 2 ) // only 2 edges + { + // take care of proper association of propagated edges + bool same1 = edge1.IsSame( edges1.front() ); + bool same2 = edge2.IsSame( edges2.front() ); + if ( same1 != same2 ) + Reverse(edges2, nbE); + } + // store association + list< TopoDS_Edge >::iterator eIt1 = edges1.begin(); + list< TopoDS_Edge >::iterator eIt2 = edges2.begin(); + for ( ; eIt1 != edges1.end(); ++eIt1, ++eIt2 ) + { + InsertAssociation( *eIt1, *eIt2, theMap, bidirect); + VV1[0] = TopExp::FirstVertex( *eIt1, true ); + VV2[0] = TopExp::FirstVertex( *eIt2, true ); + InsertAssociation( VV1[0], VV2[0], theMap, bidirect); + } + return true; + } + } + } + break; // try by vertex closeness + } + default:; + } + + // Find association by closeness of vertices + // ------------------------------------------ + + TopTools_IndexedMapOfShape vMap1, vMap2; + TopExp::MapShapes( theShape1, TopAbs_VERTEX, vMap1 ); + TopExp::MapShapes( theShape2, TopAbs_VERTEX, vMap2 ); + + if ( vMap1.Extent() != vMap2.Extent() ) + RETURN_BAD_RESULT("Different nb of vertices"); + + if ( vMap1.Extent() == 1 ) { + InsertAssociation( vMap1(1), vMap2(1), theMap, bidirect); + if ( theShape1.ShapeType() == TopAbs_EDGE ) + return true; + return FindSubShapeAssociation( theShape1, theMesh1, theShape2, theMesh2, theMap); + } + + // Find transformation to make the shapes be of similar size at same location + + Bnd_Box box[2]; + for ( int i = 1; i <= vMap1.Extent(); ++i ) { + box[ 0 ].Add( BRep_Tool::Pnt ( TopoDS::Vertex( vMap1( i )))); + box[ 1 ].Add( BRep_Tool::Pnt ( TopoDS::Vertex( vMap2( i )))); + } + + gp_Pnt gc[2]; // box center + double x0,y0,z0, x1,y1,z1; + box[0].Get( x0,y0,z0, x1,y1,z1 ); + gc[0] = 0.5 * ( gp_XYZ( x0,y0,z0 ) + gp_XYZ( x1,y1,z1 )); + box[1].Get( x0,y0,z0, x1,y1,z1 ); + gc[1] = 0.5 * ( gp_XYZ( x0,y0,z0 ) + gp_XYZ( x1,y1,z1 )); + + // 1 -> 2 + gp_Vec vec01( gc[0], gc[1] ); + double scale = sqrt( box[1].SquareExtent() / box[0].SquareExtent() ); + + // Find 2 closest vertices + + TopoDS_Vertex VV1[2], VV2[2]; + // get 2 linked vertices of shape 1 not belonging to an inner wire of a face + TopoDS_Shape edge = theShape1; + TopExp_Explorer expF( theShape1, TopAbs_FACE ), expE; + for ( ; expF.More(); expF.Next() ) { + edge.Nullify(); + TopoDS_Shape wire = OuterShape( TopoDS::Face( expF.Current() ), TopAbs_WIRE ); + for ( expE.Init( wire, TopAbs_EDGE ); edge.IsNull() && expE.More(); expE.Next() ) + if ( !IsClosedEdge( TopoDS::Edge( expE.Current() ))) + edge = expE.Current(); + if ( !edge.IsNull() ) + break; + } + if ( edge.IsNull() || edge.ShapeType() != TopAbs_EDGE ) + RETURN_BAD_RESULT("Edge not found"); + + TopExp::Vertices( TopoDS::Edge( edge ), VV1[0], VV1[1]); + if ( VV1[0].IsSame( VV1[1] )) + RETURN_BAD_RESULT("Only closed edges"); + + // find vertices closest to 2 linked vertices of shape 1 + for ( int i1 = 0; i1 < 2; ++i1 ) + { + double dist2 = DBL_MAX; + gp_Pnt p1 = BRep_Tool::Pnt( VV1[ i1 ]); + p1.Translate( vec01 ); + p1.Scale( gc[1], scale ); + for ( int i2 = 1; i2 <= vMap2.Extent(); ++i2 ) + { + TopoDS_Vertex V2 = TopoDS::Vertex( vMap2( i2 )); + gp_Pnt p2 = BRep_Tool::Pnt ( V2 ); + double d2 = p1.SquareDistance( p2 ); + if ( d2 < dist2 && !V2.IsSame( VV2[ 0 ])) { + VV2[ i1 ] = V2; dist2 = d2; + } + } + } + + InsertAssociation( VV1[ 0 ], VV2 [ 0 ], theMap, bidirect); + InsertAssociation( VV1[ 1 ], VV2 [ 1 ], theMap, bidirect); + if ( theShape1.ShapeType() == TopAbs_EDGE ) + return true; + + return FindSubShapeAssociation( theShape1, theMesh1, theShape2, theMesh2, theMap ); +} + +//================================================================================ +/*! + * \brief Find association of edges of faces + * \param face1 - face 1 + * \param VV1 - vertices of face 1 + * \param face2 - face 2 + * \param VV2 - vertices of face 2 associated with oned of face 1 + * \param edges1 - out list of edges of face 1 + * \param edges2 - out list of edges of face 2 + * \retval int - nb of edges in an outer wire in a success case, else zero + */ +//================================================================================ + +int StdMeshers_ProjectionUtils::FindFaceAssociation(const TopoDS_Face& face1, + TopoDS_Vertex VV1[2], + const TopoDS_Face& face2, + TopoDS_Vertex VV2[2], + list< TopoDS_Edge > & edges1, + list< TopoDS_Edge > & edges2) +{ + edges1.clear(); + edges2.clear(); + + list< int > nbVInW1, nbVInW2; + if ( SMESH_Block::GetOrderedEdges( face1, VV1[0], edges1, nbVInW1) != + SMESH_Block::GetOrderedEdges( face2, VV2[0], edges2, nbVInW2) ) + RETURN_BAD_RESULT("Different number of wires in faces "); + + if ( nbVInW1.front() != nbVInW2.front() ) + RETURN_BAD_RESULT("Different number of edges in faces: " << + nbVInW1.front() << " != " << nbVInW2.front()); + + // Define if we need to reverse one of wires to make edges in lists match each other + + bool reverse = false; + + list< TopoDS_Edge >::iterator eBackIt; + if ( !VV1[1].IsSame( TopExp::LastVertex( edges1.front(), true ))) { + eBackIt = --edges1.end(); + // check if the second vertex belongs to the first or last edge in the wire + if ( !VV1[1].IsSame( TopExp::FirstVertex( *eBackIt, true ))) { + bool KO = true; // belongs to none + if ( nbVInW1.size() > 1 ) { // several wires + eBackIt = edges1.begin(); + for ( int i = 1; i < nbVInW1.front(); ++i ) ++eBackIt; + KO = !VV1[1].IsSame( TopExp::FirstVertex( *eBackIt, true )); + } + if ( KO ) + RETURN_BAD_RESULT("GetOrderedEdges() failed"); + } + reverse = true; + } + eBackIt = --edges2.end(); + if ( !VV2[1].IsSame( TopExp::LastVertex( edges2.front(), true ))) { + // check if the second vertex belongs to the first or last edge in the wire + if ( !VV2[1].IsSame( TopExp::FirstVertex( *eBackIt, true ))) { + bool KO = true; // belongs to none + if ( nbVInW2.size() > 1 ) { // several wires + eBackIt = edges2.begin(); + for ( int i = 1; i < nbVInW2.front(); ++i ) ++eBackIt; + KO = !VV2[1].IsSame( TopExp::FirstVertex( *eBackIt, true )); + } + if ( KO ) + RETURN_BAD_RESULT("GetOrderedEdges() failed"); + } + reverse = !reverse; + } + if ( reverse ) + { + Reverse( edges2 , nbVInW2.front()); + if (( VV1[1].IsSame( TopExp::LastVertex( edges1.front(), true ))) != + ( VV2[1].IsSame( TopExp::LastVertex( edges2.front(), true )))) + RETURN_BAD_RESULT("GetOrderedEdges() failed"); + } + return nbVInW2.front(); +} + +//======================================================================= +//function : InitVertexAssociation +//purpose : +//======================================================================= + +void StdMeshers_ProjectionUtils::InitVertexAssociation( const SMESH_Hypothesis* theHyp, + TShapeShapeMap & theAssociationMap) +{ + string hypName = theHyp->GetName(); + if ( hypName == "ProjectionSource1D" ) { + const StdMeshers_ProjectionSource1D * hyp = + static_cast( theHyp ); + if ( hyp->HasVertexAssociation() ) { + InsertAssociation( hyp->GetSourceVertex(),hyp->GetTargetVertex(),theAssociationMap); + } + } + else if ( hypName == "ProjectionSource2D" ) { + const StdMeshers_ProjectionSource2D * hyp = + static_cast( theHyp ); + if ( hyp->HasVertexAssociation() ) { + InsertAssociation( hyp->GetSourceVertex(1),hyp->GetTargetVertex(1),theAssociationMap); + InsertAssociation( hyp->GetSourceVertex(2),hyp->GetTargetVertex(2),theAssociationMap); + } + } + else if ( hypName == "ProjectionSource3D" ) { + const StdMeshers_ProjectionSource3D * hyp = + static_cast( theHyp ); + if ( hyp->HasVertexAssociation() ) { + InsertAssociation( hyp->GetSourceVertex(1),hyp->GetTargetVertex(1),theAssociationMap); + InsertAssociation( hyp->GetSourceVertex(2),hyp->GetTargetVertex(2),theAssociationMap); + } + } +} + +//======================================================================= +/*! + * \brief Inserts association theShape1 <-> theShape2 to TShapeShapeMap + * \param theShape1 - shape 1 + * \param theShape2 - shape 2 + * \param theAssociationMap - association map + * \retval bool - true if there was no association for these shapes before + */ +//======================================================================= + +bool StdMeshers_ProjectionUtils::InsertAssociation( const TopoDS_Shape& theShape1, + const TopoDS_Shape& theShape2, + TShapeShapeMap & theAssociationMap, + const bool theBidirectional) +{ + if ( !theShape1.IsNull() && !theShape2.IsNull() ) { + SHOW_VERTEX(theShape1,"Assoc "); + SHOW_VERTEX(theShape2," to "); + bool isNew = ( theAssociationMap.Bind( theShape1, theShape2 )); + if ( theBidirectional ) + theAssociationMap.Bind( theShape2, theShape1 ); + return isNew; + } + return false; +} + +//======================================================================= +//function : IsSubShape +//purpose : +//======================================================================= + +bool StdMeshers_ProjectionUtils::IsSubShape( const TopoDS_Shape& shape, + SMESH_Mesh* aMesh ) +{ + if ( shape.IsNull() || !aMesh ) + return false; + return aMesh->GetMeshDS()->ShapeToIndex( shape ); +} + +//======================================================================= +//function : IsSubShape +//purpose : +//======================================================================= + +bool StdMeshers_ProjectionUtils::IsSubShape( const TopoDS_Shape& shape, + const TopoDS_Shape& mainShape ) +{ + if ( !shape.IsNull() && !mainShape.IsNull() ) + { + for ( TopExp_Explorer exp( mainShape, shape.ShapeType()); + exp.More(); + exp.Next() ) + if ( shape.IsSame( exp.Current() )) + return true; + } + SCRUTE((shape.IsNull())); + SCRUTE((mainShape.IsNull())); + return false; +} + + +//======================================================================= +/*! + * \brief Finds an edge by its vertices in a main shape of the mesh + * \param aMesh - the mesh + * \param V1 - vertex 1 + * \param V2 - vertex 2 + * \retval TopoDS_Edge - found edge + */ +//======================================================================= + +TopoDS_Edge StdMeshers_ProjectionUtils::GetEdgeByVertices( SMESH_Mesh* theMesh, + const TopoDS_Vertex& theV1, + const TopoDS_Vertex& theV2) +{ + if ( theMesh && !theV1.IsNull() && !theV2.IsNull() ) + { + TopTools_ListIteratorOfListOfShape ancestorIt( theMesh->GetAncestors( theV1 )); + for ( ; ancestorIt.More(); ancestorIt.Next() ) + if ( ancestorIt.Value().ShapeType() == TopAbs_EDGE ) + for ( TopExp_Explorer expV ( ancestorIt.Value(), TopAbs_VERTEX ); + expV.More(); + expV.Next() ) + if ( theV2.IsSame( expV.Current() )) + return TopoDS::Edge( ancestorIt.Value() ); + } + return TopoDS_Edge(); +} + +//================================================================================ +/*! + * \brief Return another face sharing an edge + * \param aMesh - mesh + * \param edge - edge + * \param face - face + * \retval TopoDS_Face - found face + */ +//================================================================================ + +TopoDS_Face StdMeshers_ProjectionUtils::GetNextFace( SMESH_Mesh* mesh, + const TopoDS_Edge& edge, + const TopoDS_Face& face) +{ + if ( mesh && !edge.IsNull() && !face.IsNull() ) + { + TopTools_ListIteratorOfListOfShape ancestorIt( mesh->GetAncestors( edge )); + for ( ; ancestorIt.More(); ancestorIt.Next() ) + if ( ancestorIt.Value().ShapeType() == TopAbs_FACE && + !face.IsSame( ancestorIt.Value() )) + return TopoDS::Face( ancestorIt.Value() ); + } + return TopoDS_Face(); + +} + +//================================================================================ +/*! + * \brief Return a propagation edge + * \param aMesh - mesh + * \param theEdge - edge to find by propagation + * \param fromEdge - start edge for propagation + * \retval TopoDS_Edge - found edge + */ +//================================================================================ + +TopoDS_Edge StdMeshers_ProjectionUtils::GetPropagationEdge( SMESH_Mesh* aMesh, + const TopoDS_Edge& theEdge, + const TopoDS_Edge& fromEdge) +{ + SMESH_IndexedMapOfShape aChain; + //aChain.Add(fromEdge); + + // List of edges, added to chain on the previous cycle pass + TopTools_ListOfShape listPrevEdges; + listPrevEdges.Append(fromEdge/*.Oriented( TopAbs_FORWARD )*/); + + // Collect all edges pass by pass + while (listPrevEdges.Extent() > 0) { + // List of edges, added to chain on this cycle pass + TopTools_ListOfShape listCurEdges; + + // Find the next portion of edges + TopTools_ListIteratorOfListOfShape itE (listPrevEdges); + for (; itE.More(); itE.Next()) { + TopoDS_Shape anE = itE.Value(); + + // Iterate on faces, having edge + TopTools_ListIteratorOfListOfShape itA (aMesh->GetAncestors(anE)); + for (; itA.More(); itA.Next()) { + TopoDS_Shape aW = itA.Value(); + + // There are objects of different type among the ancestors of edge + if (aW.ShapeType() == TopAbs_WIRE) { + TopoDS_Shape anOppE; + + BRepTools_WireExplorer aWE (TopoDS::Wire(aW)); + Standard_Integer nb = 1, found = 0; + TopTools_Array1OfShape anEdges (1,4); + for (; aWE.More(); aWE.Next(), nb++) { + if (nb > 4) { + found = 0; + break; + } + anEdges(nb) = aWE.Current(); + if (anEdges(nb).IsSame(anE)) found = nb; + } + + if (nb == 5 && found > 0) { + // Quadrangle face found, get an opposite edge + Standard_Integer opp = found + 2; + if (opp > 4) opp -= 4; + anOppE = anEdges(opp); + + // add anOppE to aChain if ... + if (!aChain.Contains(anOppE)) { // ... anOppE is not in aChain + // Add found edge to the chain oriented so that to + // have it co-directed with a forward MainEdge + TopAbs_Orientation ori = anE.Orientation(); + if ( anEdges(opp).Orientation() == anEdges(found).Orientation() ) + ori = TopAbs::Reverse( ori ); + anOppE.Orientation( ori ); + if ( anOppE.IsSame( theEdge )) + return TopoDS::Edge( anOppE ); + aChain.Add(anOppE); + listCurEdges.Append(anOppE); + } + } // if (nb == 5 && found > 0) + } // if (aF.ShapeType() == TopAbs_WIRE) + } // for (; itF.More(); itF.Next()) + } // for (; itE.More(); itE.Next()) + + listPrevEdges = listCurEdges; + } // while (listPrevEdges.Extent() > 0) + + return TopoDS_Edge(); +} + +//================================================================================ + /*! + * \brief Find corresponding nodes on two faces + * \param face1 - the first face + * \param mesh1 - mesh containing elements on the first face + * \param face2 - the second face + * \param mesh2 - mesh containing elements on the second face + * \param assocMap - map associating subshapes of the faces + * \param node1To2Map - map containing found matching nodes + * \retval bool - is a success + */ +//================================================================================ + +bool StdMeshers_ProjectionUtils:: +FindMatchingNodesOnFaces( const TopoDS_Face& face1, + SMESH_Mesh* mesh1, + const TopoDS_Face& face2, + SMESH_Mesh* mesh2, + const TShapeShapeMap & assocMap, + TNodeNodeMap & node1To2Map) +{ + SMESHDS_Mesh* meshDS1 = mesh1->GetMeshDS(); + SMESHDS_Mesh* meshDS2 = mesh2->GetMeshDS(); + + SMESH_MesherHelper helper1( *mesh1 ); + SMESH_MesherHelper helper2( *mesh2 ); + + // Get corresponding submeshes and roughly check match of meshes + + SMESHDS_SubMesh * SM2 = meshDS2->MeshElements( face2 ); + SMESHDS_SubMesh * SM1 = meshDS1->MeshElements( face1 ); + if ( !SM2 || !SM1 ) + RETURN_BAD_RESULT("Empty submeshes"); + if ( SM2->NbNodes() != SM1->NbNodes() || + SM2->NbElements() != SM1->NbElements() ) + RETURN_BAD_RESULT("Different meshes on corresponding faces " + << meshDS1->ShapeToIndex( face1 ) << " and " + << meshDS2->ShapeToIndex( face2 )); + if ( SM2->NbElements() == 0 ) + RETURN_BAD_RESULT("Empty submeshes"); + + helper1.SetSubShape( face1 ); + helper2.SetSubShape( face2 ); + if ( helper1.HasSeam() != helper2.HasSeam() ) + RETURN_BAD_RESULT("Different faces' geometry"); + + // Data to call SMESH_MeshEditor::FindMatchingNodes(): + + // 1. Nodes of corresponding links: + + // get 2 matching edges, not seam ones + TopoDS_Edge edge1, edge2; + TopExp_Explorer eE( OuterShape( face2, TopAbs_WIRE ), TopAbs_EDGE ); + do { + edge2 = TopoDS::Edge( eE.Current() ); + eE.Next(); + } while ( BRep_Tool::IsClosed( edge2, face2 ) && eE.More()); + if ( !assocMap.IsBound( edge2 )) + RETURN_BAD_RESULT("Association not found for edge " << meshDS2->ShapeToIndex( edge2 )); + edge1 = TopoDS::Edge( assocMap( edge2 )); + if ( !IsSubShape( edge1, face1 )) + RETURN_BAD_RESULT("Wrong association, edge " << meshDS1->ShapeToIndex( edge1 ) << + " isn't a subshape of face " << meshDS1->ShapeToIndex( face1 )); + + // get 2 matching vertices + TopoDS_Shape V2 = TopExp::FirstVertex( TopoDS::Edge( edge2 )); + if ( !assocMap.IsBound( V2 )) + RETURN_BAD_RESULT("Association not found for vertex " << meshDS2->ShapeToIndex( V2 )); + TopoDS_Shape V1 = assocMap( V2 ); + + // nodes on vertices + SMESHDS_SubMesh * vSM1 = meshDS1->MeshElements( V1 ); + SMESHDS_SubMesh * vSM2 = meshDS2->MeshElements( V2 ); + if ( !vSM1 || !vSM2 || vSM1->NbNodes() != 1 || vSM2->NbNodes() != 1 ) + RETURN_BAD_RESULT("Bad node submesh"); + const SMDS_MeshNode* vNode1 = vSM1->GetNodes()->next(); + const SMDS_MeshNode* vNode2 = vSM2->GetNodes()->next(); + + // nodes on edges linked with nodes on vertices + const SMDS_MeshNode* nullNode = 0; + vector< const SMDS_MeshNode*> eNode1( 2, nullNode ); + vector< const SMDS_MeshNode*> eNode2( 2, nullNode ); + int nbNodeToGet = 1; + if ( IsClosedEdge( edge1 ) || IsClosedEdge( edge2 ) ) + nbNodeToGet = 2; + for ( int is2 = 0; is2 < 2; ++is2 ) + { + TopoDS_Edge & edge = is2 ? edge2 : edge1; + SMESHDS_Mesh * smDS = is2 ? meshDS2 : meshDS1; + SMESHDS_SubMesh* edgeSM = smDS->MeshElements( edge ); + // nodes linked with ones on vertices + const SMDS_MeshNode* vNode = is2 ? vNode2 : vNode1; + vector< const SMDS_MeshNode*>& eNode = is2 ? eNode2 : eNode1; + int nbGotNode = 0; + SMDS_ElemIteratorPtr vElem = vNode->GetInverseElementIterator(); + while ( vElem->more() && nbGotNode != nbNodeToGet ) { + const SMDS_MeshElement* elem = vElem->next(); + if ( elem->GetType() == SMDSAbs_Edge && edgeSM->Contains( elem )) + eNode[ nbGotNode++ ] = + ( elem->GetNode(0) == vNode ) ? elem->GetNode(1) : elem->GetNode(0); + } + if ( nbGotNode > 1 ) // sort found nodes by param on edge + { + SMESH_MesherHelper* helper = is2 ? &helper2 : &helper1; + double u0 = helper->GetNodeU( edge, eNode[ 0 ]); + double u1 = helper->GetNodeU( edge, eNode[ 1 ]); + if ( u0 > u1 ) std::swap( eNode[ 0 ], eNode[ 1 ]); + } + if ( nbGotNode == 0 ) + RETURN_BAD_RESULT("Found no nodes on edge " << smDS->ShapeToIndex( edge ) << + " linked to " << vNode ); + } + + // 2. face sets + + set Elems1, Elems2; + for ( int is2 = 0; is2 < 2; ++is2 ) + { + set & elems = is2 ? Elems2 : Elems1; + SMESHDS_SubMesh* sm = is2 ? SM2 : SM1; + SMESH_MesherHelper* helper = is2 ? &helper2 : &helper1; + const TopoDS_Face & face = is2 ? face2 : face1; + SMDS_ElemIteratorPtr eIt = sm->GetElements(); + + if ( !helper->IsSeamShape( is2 ? edge2 : edge1 )) + { + while ( eIt->more() ) elems.insert( eIt->next() ); + } + else + { + // there is only seam edge in a face, i.e. it is a sphere. + // FindMatchingNodes() will not know which way to go from any edge. + // So we ignore all faces having nodes on edges or vertices except + // one of faces sharing current start nodes + + // find a face to keep + const SMDS_MeshElement* faceToKeep = 0; + const SMDS_MeshNode* vNode = is2 ? vNode2 : vNode1; + const SMDS_MeshNode* eNode = is2 ? eNode2[0] : eNode1[0]; + std::map inSet, notInSet; + + const SMDS_MeshElement* f1 = + SMESH_MeshEditor::FindFaceInSet( vNode, eNode, inSet, notInSet ); + if ( !f1 ) RETURN_BAD_RESULT("The first face on seam not found"); + SMESH_MeshEditor::Insert( f1, notInSet ); + + const SMDS_MeshElement* f2 = + SMESH_MeshEditor::FindFaceInSet( vNode, eNode, inSet, notInSet ); + if ( !f2 ) RETURN_BAD_RESULT("The second face on seam not found"); + + // select a face with less UV of vNode + const SMDS_MeshNode* notSeamNode[2] = {0, 0}; + for ( int iF = 0; iF < 2; ++iF ) { + const SMDS_MeshElement* f = ( iF ? f2 : f1 ); + for ( int i = 0; !notSeamNode[ iF ] && i < f->NbNodes(); ++i ) { + const SMDS_MeshNode* node = f->GetNode( i ); + if ( !helper->IsSeamShape( node->GetPosition()->GetShapeId() )) + notSeamNode[ iF ] = node; + } + } + gp_Pnt2d uv1 = helper->GetNodeUV( face, vNode, notSeamNode[0] ); + gp_Pnt2d uv2 = helper->GetNodeUV( face, vNode, notSeamNode[1] ); + if ( uv1.X() + uv1.Y() > uv2.X() + uv2.Y() ) + faceToKeep = f2; + else + faceToKeep = f1; + + // fill elem set + elems.insert( faceToKeep ); + while ( eIt->more() ) { + const SMDS_MeshElement* f = eIt->next(); + int nbNodes = f->NbNodes(); + if ( f->IsQuadratic() ) + nbNodes /= 2; + bool onBnd = false; + for ( int i = 0; !onBnd && i < nbNodes; ++i ) { + const SMDS_MeshNode* node = f->GetNode( i ); + onBnd = ( node->GetPosition()->GetTypeOfPosition() != SMDS_TOP_FACE); + } + if ( !onBnd ) + elems.insert( f ); + } + } // case on a sphere + } // loop on 2 faces + + node1To2Map.clear(); + int res = SMESH_MeshEditor::FindMatchingNodes( Elems1, Elems2, + vNode1, vNode2, + eNode1[0], eNode2[0], + node1To2Map); + if ( res != SMESH_MeshEditor::SEW_OK ) + RETURN_BAD_RESULT("FindMatchingNodes() result " << res ); + + + // On a sphere, add matching nodes on the edge + + if ( helper1.IsSeamShape( edge1 )) + { + // sort nodes on edges by param on edge + map< double, const SMDS_MeshNode* > u2nodesMaps[2]; + for ( int is2 = 0; is2 < 2; ++is2 ) + { + TopoDS_Edge & edge = is2 ? edge2 : edge1; + SMESHDS_Mesh * smDS = is2 ? meshDS2 : meshDS1; + SMESHDS_SubMesh* edgeSM = smDS->MeshElements( edge ); + map< double, const SMDS_MeshNode* > & pos2nodes = u2nodesMaps[ is2 ]; + + SMDS_NodeIteratorPtr nIt = edgeSM->GetNodes(); + while ( nIt->more() ) { + const SMDS_MeshNode* node = nIt->next(); + const SMDS_EdgePosition* pos = + static_cast(node->GetPosition().get()); + pos2nodes.insert( make_pair( pos->GetUParameter(), node )); + } + if ( pos2nodes.size() != edgeSM->NbNodes() ) + RETURN_BAD_RESULT("Equal params of nodes on edge " + << smDS->ShapeToIndex( edge ) << " of face " << is2 ); + } + if ( u2nodesMaps[0].size() != u2nodesMaps[1].size() ) + RETURN_BAD_RESULT("Different nb of new nodes on edges or wrong params"); + + // compare edge orientation + double u1 = helper1.GetNodeU( edge1, vNode1 ); + double u2 = helper2.GetNodeU( edge2, vNode2 ); + bool isFirst1 = ( u1 < u2nodesMaps[0].begin()->first ); + bool isFirst2 = ( u2 < u2nodesMaps[1].begin()->first ); + bool reverse ( isFirst1 != isFirst2 ); + + // associate matching nodes + map< double, const SMDS_MeshNode* >::iterator u_Node1, u_Node2, end1; + map< double, const SMDS_MeshNode* >::reverse_iterator uR_Node2; + u_Node1 = u2nodesMaps[0].begin(); + u_Node2 = u2nodesMaps[1].begin(); + uR_Node2 = u2nodesMaps[1].rbegin(); + end1 = u2nodesMaps[0].end(); + for ( ; u_Node1 != end1; ++u_Node1 ) { + const SMDS_MeshNode* n1 = u_Node1->second; + const SMDS_MeshNode* n2 = ( reverse ? (uR_Node2++)->second : (u_Node2++)->second ); + node1To2Map.insert( make_pair( n1, n2 )); + } + + // associate matching nodes on the last vertices + V2 = TopExp::LastVertex( TopoDS::Edge( edge2 )); + if ( !assocMap.IsBound( V2 )) + RETURN_BAD_RESULT("Association not found for vertex " << meshDS2->ShapeToIndex( V2 )); + V1 = assocMap( V2 ); + vSM1 = meshDS1->MeshElements( V1 ); + vSM2 = meshDS2->MeshElements( V2 ); + if ( !vSM1 || !vSM2 || vSM1->NbNodes() != 1 || vSM2->NbNodes() != 1 ) + RETURN_BAD_RESULT("Bad node submesh"); + vNode1 = vSM1->GetNodes()->next(); + vNode2 = vSM2->GetNodes()->next(); + node1To2Map.insert( make_pair( vNode1, vNode2 )); + } + + return true; +} + +//================================================================================ +/*! + * \brief Check if the first and last vertices of an edge are the same + * \param anEdge - the edge to check + * \retval bool - true if same + */ +//================================================================================ + +bool StdMeshers_ProjectionUtils::IsClosedEdge( const TopoDS_Edge& anEdge ) +{ + return TopExp::FirstVertex( anEdge ).IsSame( TopExp::LastVertex( anEdge )); +} + +//================================================================================ + /*! + * \brief Return any subshape of a face belonging to the outer wire + * \param face - the face + * \param type - type of subshape to return + * \retval TopoDS_Shape - the found subshape + */ +//================================================================================ + +TopoDS_Shape StdMeshers_ProjectionUtils::OuterShape( const TopoDS_Face& face, + TopAbs_ShapeEnum type) +{ + TopExp_Explorer exp( BRepTools::OuterWire( face ), type ); + if ( exp.More() ) + return exp.Current(); + return TopoDS_Shape(); +} + +//================================================================================ + /*! + * \brief Check that submeshis is computed and try to compute it if is not + * \param sm - submesh to compute + * \param iterationNb - int used to stop infinite recursive call + * \retval bool - true if computed + */ +//================================================================================ + +bool StdMeshers_ProjectionUtils::MakeComputed(SMESH_subMesh * sm, const int iterationNb) +{ + if ( iterationNb > 10 ) + RETURN_BAD_RESULT("Infinite recursive projection"); + if ( !sm ) + RETURN_BAD_RESULT("NULL submesh"); + if ( sm->IsMeshComputed() ) + return true; + + SMESH_Mesh* mesh = sm->GetFather(); + SMESH_Gen* gen = mesh->GetGen(); + SMESH_Algo* algo = gen->GetAlgo( *mesh, sm->GetSubShape() ); + if ( !algo ) + RETURN_BAD_RESULT("No algo assigned to submesh " << sm->GetId()); + + string algoType = algo->GetName(); + if ( algoType.substr(0, 11) != "Projection_") + return gen->Compute( *mesh, sm->GetSubShape() ); + + // try to compute source mesh + + const list & hyps = + algo->GetUsedHypothesis( *mesh, sm->GetSubShape() ); + + TopoDS_Shape srcShape; + SMESH_Mesh* srcMesh = 0; + list ::const_iterator hIt = hyps.begin(); + for ( ; srcShape.IsNull() && hIt != hyps.end(); ++hIt ) { + string hypName = (*hIt)->GetName(); + if ( hypName == "ProjectionSource1D" ) { + const StdMeshers_ProjectionSource1D * hyp = + static_cast( *hIt ); + srcShape = hyp->GetSourceEdge(); + srcMesh = hyp->GetSourceMesh(); + } + else if ( hypName == "ProjectionSource2D" ) { + const StdMeshers_ProjectionSource2D * hyp = + static_cast( *hIt ); + srcShape = hyp->GetSourceFace(); + srcMesh = hyp->GetSourceMesh(); + } + else if ( hypName == "ProjectionSource3D" ) { + const StdMeshers_ProjectionSource3D * hyp = + static_cast( *hIt ); + srcShape = hyp->GetSource3DShape(); + srcMesh = hyp->GetSourceMesh(); + } + } + if ( srcShape.IsNull() ) // no projection source defined + return gen->Compute( *mesh, sm->GetSubShape() ); + + if ( srcShape.IsSame( sm->GetSubShape() )) + RETURN_BAD_RESULT("Projection from self"); + + if ( !srcMesh ) + srcMesh = mesh; + + return MakeComputed( srcMesh->GetSubMesh( srcShape ), iterationNb + 1 ); +} + +//================================================================================ + /*! + * \brief Count nb of subshapes + * \param shape - the shape + * \param type - the type of subshapes to count + * \retval int - the calculated number + */ +//================================================================================ + +int StdMeshers_ProjectionUtils::Count(const TopoDS_Shape& shape, + const TopAbs_ShapeEnum type, + const bool ignoreSame) +{ + if ( ignoreSame ) { + TopTools_IndexedMapOfShape map; + TopExp::MapShapes( shape, type, map ); + return map.Extent(); + } + else { + int nb = 0; + for ( TopExp_Explorer exp( shape, type ); exp.More(); exp.Next() ) + ++nb; + return nb; + } +} + + // bull shit +// Standard_Real f1,l1, f2,l2; +// BRep_Tool::Range( edge1, f1,l1 ); +// BRep_Tool::Range( edge2, f2,l2 ); +// BRepAdaptor_Curve e1( edge1 ), e2( edge2 ); +// gp_Pnt pf1, pf2; +// gp_Vec dirX1, dirX2; // 1st derivatives +// e1.D1( f1, pf1, dirX1 ); +// e2.D1( f2, pf2, dirX2 ); +// gp_Pnt pm1 = e1.Value( 0.5 * ( f1 + l1 )); +// gp_Pnt pm2 = e2.Value( 0.5 * ( f2 + l2 )); +// gp_Vec dirZ1( pf1, pm1 ), dirZ2( pf2, pm2 ); +// gp_Trsf trsf; +// gp_Ax3 fromSys( pf1, dirZ1, dirX1 ), toSys( pf2, dirZ2, dirX2 ); +// trsf.SetTransformation( fromSys, toSys ); +// dirX1.Transform( trsf ); +// bool reverse = ( dirX1 * dirX2 < 0 ); +// if ( reverse ) edge2.Reverse(); diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.hxx b/src/StdMeshers/StdMeshers_ProjectionUtils.hxx new file mode 100644 index 000000000..ea7ed73d7 --- /dev/null +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.hxx @@ -0,0 +1,200 @@ +// SMESH SMESH : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionUtils.hxx +// Created : Thu Oct 26 15:37:24 2006 +// Author : Edward AGAPOV (eap) + + +#ifndef StdMeshers_ProjectionUtils_HeaderFile +#define StdMeshers_ProjectionUtils_HeaderFile + +#include "SMESH_StdMeshers.hxx" + +#include +#include +#include +#include + +#include +#include + +class TopoDS_Shape; +class SMDS_MeshNode; +class SMESH_Mesh; +class SMESH_Hypothesis; +class SMESH_subMesh; + +/*! + * \brief Class encapsulating methods common to Projection algorithms + */ +class STDMESHERS_EXPORT StdMeshers_ProjectionUtils +{ + public: + + typedef TopTools_DataMapOfShapeShape TShapeShapeMap; + typedef std::map TNodeNodeMap; + + /*! + * \brief Looks for association of all subshapes of two shapes + * \param theShape1 - shape 1 + * \param theMesh1 - mesh built on shape 1 + * \param theShape2 - shape 2 + * \param theMesh2 - mesh built on shape 2 + * \param theAssociation - association map to be filled that may + * contain association of one or two pairs of vertices + * \retval bool - true if association found + */ + static bool FindSubShapeAssociation(const TopoDS_Shape& theShape1, + SMESH_Mesh* theMesh1, + const TopoDS_Shape& theShape2, + SMESH_Mesh* theMesh2, + TShapeShapeMap & theAssociationMap); + + /*! + * \brief Find association of edges of faces + * \param face1 - face 1 + * \param VV1 - vertices of face 1 + * \param face2 - face 2 + * \param VV2 - vertices of face 2 associated with oned of face 1 + * \param edges1 - out list of edges of face 1 + * \param edges2 - out list of edges of face 2 + * \retval int - nb of edges in an outer wire in a success case, else zero + */ + static int FindFaceAssociation(const TopoDS_Face& face1, + TopoDS_Vertex VV1[2], + const TopoDS_Face& face2, + TopoDS_Vertex VV2[2], + list< TopoDS_Edge > & edges1, + list< TopoDS_Edge > & edges2); + + /*! + * \brief Insert vertex association defined by a hypothesis into a map + * \param theHyp - hypothesis + * \param theAssociationMap - association map + */ + static void InitVertexAssociation( const SMESH_Hypothesis* theHyp, + TShapeShapeMap & theAssociationMap); + + /*! + * \brief Inserts association theShape1 <-> theShape2 to TShapeShapeMap + * \param theShape1 - shape 1 + * \param theShape2 - shape 2 + * \param theAssociationMap - association map + * \param theBidirectional - if false, inserts theShape1 -> theShape2 association + * \retval bool - true if there was no association for these shapes before + */ + static bool InsertAssociation( const TopoDS_Shape& theShape1, + const TopoDS_Shape& theShape2, + TShapeShapeMap & theAssociationMap, + const bool theBidirectional=true); + + static bool IsSubShape( const TopoDS_Shape& shape, SMESH_Mesh* aMesh ); + + static bool IsSubShape( const TopoDS_Shape& shape, const TopoDS_Shape& mainShape ); + + /*! + * \brief Finds an edge by its vertices in a main shape of the mesh + * \param aMesh - the mesh + * \param V1 - vertex 1 + * \param V2 - vertex 2 + * \retval TopoDS_Edge - found edge + */ + static TopoDS_Edge GetEdgeByVertices( SMESH_Mesh* aMesh, + const TopoDS_Vertex& V1, + const TopoDS_Vertex& V2); + + /*! + * \brief Return another face sharing an edge + * \param aMesh - mesh + * \param edge - edge + * \param face - face + * \retval TopoDS_Face - found face + */ + static TopoDS_Face GetNextFace( SMESH_Mesh* aMesh, + const TopoDS_Edge& edge, + const TopoDS_Face& face); + + /*! + * \brief Return an oriented propagation edge + * \param aMesh - mesh + * \param fromEdge - start edge for propagation + * \retval TopoDS_Edge - found edge + */ + static TopoDS_Edge GetPropagationEdge( SMESH_Mesh* aMesh, + const TopoDS_Edge& anEdge, + const TopoDS_Edge& fromEdge); + + /*! + * \brief Find corresponding nodes on two faces + * \param face1 - the first face + * \param mesh1 - mesh containing elements on the first face + * \param face2 - the second face + * \param mesh2 - mesh containing elements on the second face + * \param assocMap - map associating subshapes of the faces + * \param nodeIn2OutMap - map containing found matching nodes + * \retval bool - is a success + */ + static bool FindMatchingNodesOnFaces( const TopoDS_Face& face1, + SMESH_Mesh* mesh1, + const TopoDS_Face& face2, + SMESH_Mesh* mesh2, + const TShapeShapeMap & assocMap, + TNodeNodeMap & nodeIn2OutMap); + /*! + * \brief Check if the first and last vertices of an edge are the same + * \param anEdge - the edge to check + * \retval bool - true if same + */ + static bool IsClosedEdge( const TopoDS_Edge& anEdge ); + + /*! + * \brief Return any subshape of a face belonging to the outer wire + * \param face - the face + * \param type - type of subshape to return + * \retval TopoDS_Shape - the found subshape + */ + static TopoDS_Shape OuterShape( const TopoDS_Face& face, + TopAbs_ShapeEnum type); + + /*! + * \brief Check that submeshis is computed and try to compute it if is not + * \param sm - submesh to compute + * \param iterationNb - int used to stop infinite recursive call + * \retval bool - true if computed + */ + static bool MakeComputed(SMESH_subMesh * sm, const int iterationNb = 0); + + /*! + * \brief Count nb of subshapes + * \param shape - the shape + * \param type - the type of subshapes to count + * \param ignoreSame - if true, use map not to count same shapes, esle use explorer + * \retval int - the calculated number + */ + static int Count(const TopoDS_Shape& shape, + const TopAbs_ShapeEnum type, + const bool ignoreSame); +}; + +#endif diff --git a/src/StdMeshers/StdMeshers_Projection_1D.cxx b/src/StdMeshers/StdMeshers_Projection_1D.cxx new file mode 100644 index 000000000..f487d8392 --- /dev/null +++ b/src/StdMeshers/StdMeshers_Projection_1D.cxx @@ -0,0 +1,375 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Projection_1D.cxx +// Module : SMESH +// Created : Fri Oct 20 11:37:07 2006 +// Author : Edward AGAPOV (eap) + + +#include "StdMeshers_Projection_1D.hxx" + +#include "StdMeshers_ProjectionSource1D.hxx" +#include "StdMeshers_ProjectionUtils.hxx" + +#include "SMDS_MeshNode.hxx" +#include "SMDS_MeshElement.hxx" +#include "SMESHDS_Mesh.hxx" +#include "SMESHDS_SubMesh.hxx" +#include "SMESH_Mesh.hxx" +#include "SMESH_MesherHelper.hxx" +#include "SMESH_subMesh.hxx" +#include "SMESH_subMeshEventListener.hxx" +#include "SMESH_Gen.hxx" + +#include +#include +#include +#include +#include + +#include "utilities.h" + + +using namespace std; + +#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; } + +typedef StdMeshers_ProjectionUtils TAssocTool; + +//======================================================================= +//function : StdMeshers_Projection_1D +//purpose : +//======================================================================= + +StdMeshers_Projection_1D::StdMeshers_Projection_1D(int hypId, int studyId, SMESH_Gen* gen) + :SMESH_1D_Algo(hypId, studyId, gen) +{ + _name = "Projection_1D"; + _shapeType = (1 << TopAbs_EDGE); // 1 bit per shape type + + _compatibleHypothesis.push_back("ProjectionSource1D"); + _sourceHypo = 0; +} + +//================================================================================ +/*! + * \brief Destructor + */ +//================================================================================ + +StdMeshers_Projection_1D::~StdMeshers_Projection_1D() +{} + +//======================================================================= +//function : CheckHypothesis +//purpose : +//======================================================================= + +bool StdMeshers_Projection_1D::CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus) +{ + _sourceHypo = 0; + list ::const_iterator itl; + + const list &hyps = GetUsedHypothesis(aMesh, aShape); + if ( hyps.size() == 0 ) + { + aStatus = SMESH_Hypothesis::HYP_MISSING; + return false; // can't work with no hypothesis + } + + if ( hyps.size() > 1 ) + { + aStatus = SMESH_Hypothesis::HYP_ALREADY_EXIST; + return false; + } + + const SMESHDS_Hypothesis *theHyp = hyps.front(); + + string hypName = theHyp->GetName(); + + aStatus = SMESH_Hypothesis::HYP_OK; + + if (hypName == "ProjectionSource1D") + { + _sourceHypo = static_cast(theHyp); + + // Check hypo parameters + + SMESH_Mesh* srcMesh = _sourceHypo->GetSourceMesh(); + SMESH_Mesh* tgtMesh = & aMesh; + if ( !srcMesh ) + srcMesh = tgtMesh; + + // check vertices + if ( _sourceHypo->HasVertexAssociation() ) + { + // source and target vertices + if ( !TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh ) || + !TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh ) || + !TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), aShape ) || + !TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(), + _sourceHypo->GetSourceEdge() )) + { + aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER; + SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(), srcMesh ))); + SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), tgtMesh ))); + SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetTargetVertex(), aShape ) )); + SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceVertex(), + _sourceHypo->GetSourceEdge() ))); + } + } + // check source edge + if ( !TAssocTool::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh ) || + ( srcMesh == tgtMesh && aShape == _sourceHypo->GetSourceEdge() )) + { + aStatus = HYP_BAD_PARAMETER; + SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceEdge(), srcMesh ))); + SCRUTE((srcMesh == tgtMesh)); + SCRUTE(( aShape == _sourceHypo->GetSourceEdge() )); + } + } + else + { + aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE; + } + return ( aStatus == HYP_OK ); +} + +//======================================================================= +//function : Compute +//purpose : +//======================================================================= + +bool StdMeshers_Projection_1D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theShape) +{ + if ( !_sourceHypo ) + return false; + + TopoDS_Edge tgtEdge = TopoDS::Edge( theShape.Oriented(TopAbs_FORWARD)); + TopoDS_Edge srcEdge = TopoDS::Edge( _sourceHypo->GetSourceEdge().Oriented(TopAbs_FORWARD)); + + TopoDS_Vertex tgtV[2], srcV[2]; + TopExp::Vertices( tgtEdge, tgtV[0], tgtV[1] ); + TopExp::Vertices( srcEdge, srcV[0], srcV[1] ); + + SMESH_Mesh * srcMesh = _sourceHypo->GetSourceMesh(); + SMESH_Mesh * tgtMesh = & theMesh; + if ( !srcMesh ) + srcMesh = tgtMesh; + + SMESHDS_Mesh * meshDS = theMesh.GetMeshDS(); + + // --------------------------- + // Make subshapes association + // --------------------------- + + TAssocTool::TShapeShapeMap shape2ShapeMap; + TAssocTool::InitVertexAssociation( _sourceHypo, shape2ShapeMap ); + if ( !TAssocTool::FindSubShapeAssociation( tgtEdge, tgtMesh, srcEdge, srcMesh, + shape2ShapeMap) ) + RETURN_BAD_RESULT("FindSubShapeAssociation failed"); + + // ---------------------------------------------- + // Assure that mesh on a source edge is computed + // ---------------------------------------------- + + SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcEdge ); + //SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( tgtEdge ); + + if ( tgtMesh == srcMesh ) { + if ( !TAssocTool::MakeComputed( srcSubMesh )) + RETURN_BAD_RESULT("Impossible to compute the source mesh"); + } + else { + if ( !srcSubMesh->IsMeshComputed() ) + RETURN_BAD_RESULT("Source mesh is not computed"); + } + // ----------------------------------------------- + // Find out nodes distribution on the source edge + // ----------------------------------------------- + + double srcLength = EdgeLength( srcEdge ); + double tgtLength = EdgeLength( tgtEdge ); + + vector< double > params; // sorted parameters of nodes on the source edge + if ( !SMESH_Algo::GetNodeParamOnEdge( srcMesh->GetMeshDS(), srcEdge, params )) + RETURN_BAD_RESULT("Bad node params on the source edge"); + + int i, nbNodes = params.size(); + + vector< double > lengths( nbNodes - 1 ); // lengths of segments of the source edge + if ( srcLength > 0 ) + { + BRepAdaptor_Curve curveAdaptor( srcEdge ); + for ( i = 1; i < nbNodes; ++i ) + lengths[ i-1 ] = GCPnts_AbscissaPoint::Length( curveAdaptor, params[i-1], params[i]); + } + else // degenerated source edge + { + for ( i = 1; i < nbNodes; ++i ) + lengths[ i-1 ] = params[i] - params[i-1]; + srcLength = params.back() - params[0]; + } + + bool reverse = ( srcV[0].IsSame( shape2ShapeMap( tgtV[1] ))); + if ( shape2ShapeMap.IsBound( tgtEdge )) // case of closed edge + reverse = ( shape2ShapeMap( tgtEdge ).Orientation() == TopAbs_REVERSED ); + if ( reverse ) // reverse lengths of segments + std::reverse( lengths.begin(), lengths.end() ); + + // ---------- + // Make mesh + // ---------- + + // vector of target nodes + vector< const SMDS_MeshNode* > nodes ( nbNodes ); + + // Get the first and last nodes + // ----------------------------- + + SMESHDS_SubMesh* smV0 = meshDS->MeshElements( tgtV[0] ); + SMESHDS_SubMesh* smV1 = meshDS->MeshElements( tgtV[1] ); + if ( !smV0 || !smV1 ) + RETURN_BAD_RESULT("No submeshes on vertices"); + + SMDS_NodeIteratorPtr nItV0 = smV0->GetNodes(); + SMDS_NodeIteratorPtr nItV1 = smV1->GetNodes(); + if ( !nItV0->more() || !nItV1->more() ) + RETURN_BAD_RESULT("No nodes on vertices"); + + nodes.front() = nItV0->next(); + nodes.back() = nItV1->next(); + + // Compute parameters on the target edge and make internal nodes + // -------------------------------------------------------------- + + vector< double > tgtParams( nbNodes ); + + BRep_Tool::Range( tgtEdge, tgtParams.front(), tgtParams.back() ); + if ( tgtLength <= 0 ) + tgtLength = tgtParams.back() - tgtParams.front(); + double dl = tgtLength / srcLength; + + if ( tgtLength > 0 ) + { + BRepAdaptor_Curve curveAdaptor( tgtEdge ); + + // compute params on internal nodes + for ( i = 1; i < nbNodes - 1; ++i ) + { + // computes a point on a at the given distance + // from the point at given parameter. + GCPnts_AbscissaPoint Discret( curveAdaptor, dl * lengths[ i-1 ], tgtParams[ i-1 ] ); + if ( !Discret.IsDone() ) + RETURN_BAD_RESULT(" GCPnts_AbscissaPoint failed"); + tgtParams[ i ] = Discret.Parameter(); + } + // make internal nodes + for ( i = 1; i < nbNodes - 1; ++i ) + { + gp_Pnt P = curveAdaptor.Value( tgtParams[ i ]); + SMDS_MeshNode* node = meshDS->AddNode(P.X(), P.Y(), P.Z()); + meshDS->SetNodeOnEdge( node, tgtEdge, tgtParams[ i ]); + nodes[ i ] = node; + } + } + else // degenerated target edge + { + // compute params and make internal nodes + gp_Pnt P = BRep_Tool::Pnt( tgtV[0] ); + + for ( i = 1; i < nbNodes - 1; ++i ) + { + SMDS_MeshNode* node = meshDS->AddNode(P.X(), P.Y(), P.Z()); + tgtParams[ i ] = tgtParams[ i-1 ] + dl * lengths[ i-1 ]; + meshDS->SetNodeOnEdge( node, tgtEdge, tgtParams[ i ]); + nodes[ i ] = node; + } + } + + // Quadratic mesh? + // ---------------- + + bool quadratic = false; + SMDS_ElemIteratorPtr elemIt = srcSubMesh->GetSubMeshDS()->GetElements(); + if ( elemIt->more() ) + quadratic = elemIt->next()->IsQuadratic(); + else { + SMDS_NodeIteratorPtr nodeIt = srcSubMesh->GetSubMeshDS()->GetNodes(); + while ( nodeIt->more() && !quadratic ) + quadratic = SMESH_MesherHelper::IsMedium( nodeIt->next() ); + } + // enough nodes to make all edges quadratic? + if ( quadratic && ( nbNodes < 3 || ( nbNodes % 2 != 1 ))) + RETURN_BAD_RESULT("Wrong nb nodes to make quadratic mesh"); + + // Create edges + // ------------- + + SMDS_MeshElement* edge = 0; + int di = quadratic ? 2 : 1; + for ( i = di; i < nbNodes; i += di) + { + if ( quadratic ) + edge = meshDS->AddEdge( nodes[i-2], nodes[i], nodes[i-1] ); + else + edge = meshDS->AddEdge( nodes[i-1], nodes[i] ); + meshDS->SetMeshElementOnShape(edge, tgtEdge ); + } + + return true; +} + +//============================================================================= +/*! + * \brief Sets a default event listener to submesh of the source edge + * \param subMesh - submesh where algo is set + * + * This method is called when a submesh gets HYP_OK algo_state. + * After being set, event listener is notified on each event of a submesh. + * Arranges that CLEAN event is translated from source submesh to + * the submesh + */ +//============================================================================= + +void StdMeshers_Projection_1D::SetEventListener(SMESH_subMesh* subMesh) +{ + if ( _sourceHypo && ! _sourceHypo->GetSourceEdge().IsNull() ) + { + SMESH_Mesh* srcMesh = _sourceHypo->GetSourceMesh(); + if ( !srcMesh ) + srcMesh = subMesh->GetFather(); + + SMESH_subMesh* srcEdgeSM = + srcMesh->GetSubMesh( _sourceHypo->GetSourceEdge() ); + + if ( srcEdgeSM != subMesh ) + subMesh->SetEventListener( new SMESH_subMeshEventListener(true), + SMESH_subMeshEventListenerData::MakeData( subMesh ), + srcEdgeSM ); + } +} + diff --git a/src/StdMeshers/StdMeshers_Projection_1D.hxx b/src/StdMeshers/StdMeshers_Projection_1D.hxx new file mode 100644 index 000000000..58b3d1cae --- /dev/null +++ b/src/StdMeshers/StdMeshers_Projection_1D.hxx @@ -0,0 +1,67 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Projection_1D.hxx +// Module : SMESH + +#ifndef _SMESH_Projection_1D_HXX_ +#define _SMESH_Projection_1D_HXX_ + +#include "SMESH_StdMeshers.hxx" + + +#include "SMESH_1D_Algo.hxx" + + +class StdMeshers_ProjectionSource1D; + +class STDMESHERS_EXPORT StdMeshers_Projection_1D: public SMESH_1D_Algo +{ +public: + StdMeshers_Projection_1D(int hypId, int studyId, SMESH_Gen* gen); + virtual ~StdMeshers_Projection_1D(); + + virtual bool CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus); + + virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); + + /*! + * \brief Sets a default event listener to submesh of the source edge + * \param whenSetToSubMesh - submesh where algo is set + * + * After being set, event listener is notified on each event of a submesh. + * This method is called when a submesh gets HYP_OK algo_state. + * Arranges that CLEAN event is translated from source submesh to + * the whenSetToSubMesh submesh. + */ + virtual void SetEventListener(SMESH_subMesh* whenSetToSubMesh); + +protected: + + const StdMeshers_ProjectionSource1D* _sourceHypo; + +}; + +#endif diff --git a/src/StdMeshers/StdMeshers_Projection_2D.cxx b/src/StdMeshers/StdMeshers_Projection_2D.cxx new file mode 100644 index 000000000..b7b3ff3e6 --- /dev/null +++ b/src/StdMeshers/StdMeshers_Projection_2D.cxx @@ -0,0 +1,642 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Projection_2D.cxx +// Module : SMESH +// Created : Fri Oct 20 11:37:07 2006 +// Author : Edward AGAPOV (eap) + + +#include "StdMeshers_Projection_2D.hxx" + +#include "StdMeshers_ProjectionSource2D.hxx" +#include "StdMeshers_ProjectionUtils.hxx" + +#include "SMESHDS_Hypothesis.hxx" +#include "SMESHDS_SubMesh.hxx" +#include "SMESH_Block.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_Mesh.hxx" +#include "SMESH_MeshEditor.hxx" +#include "SMESH_Pattern.hxx" +#include "SMESH_subMesh.hxx" +#include "SMESH_subMeshEventListener.hxx" +#include "SMDS_EdgePosition.hxx" + +#include "utilities.h" + +#include +#include +#include +#include + + + +using namespace std; + +#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; } + +typedef StdMeshers_ProjectionUtils TAssocTool; + +//======================================================================= +//function : StdMeshers_Projection_2D +//purpose : +//======================================================================= + +StdMeshers_Projection_2D::StdMeshers_Projection_2D(int hypId, int studyId, SMESH_Gen* gen) + :SMESH_2D_Algo(hypId, studyId, gen) +{ + _name = "Projection_2D"; + _shapeType = (1 << TopAbs_FACE); // 1 bit per shape type + + _compatibleHypothesis.push_back("ProjectionSource2D"); + _sourceHypo = 0; +} + +//================================================================================ +/*! + * \brief Destructor + */ +//================================================================================ + +StdMeshers_Projection_2D::~StdMeshers_Projection_2D() +{} + +//======================================================================= +//function : CheckHypothesis +//purpose : +//======================================================================= + +bool StdMeshers_Projection_2D::CheckHypothesis(SMESH_Mesh& theMesh, + const TopoDS_Shape& theShape, + SMESH_Hypothesis::Hypothesis_Status& theStatus) +{ + list ::const_iterator itl; + + const list &hyps = GetUsedHypothesis(theMesh, theShape); + if ( hyps.size() == 0 ) + { + theStatus = HYP_MISSING; + return false; // can't work with no hypothesis + } + + if ( hyps.size() > 1 ) + { + theStatus = HYP_ALREADY_EXIST; + return false; + } + + const SMESHDS_Hypothesis *theHyp = hyps.front(); + + string hypName = theHyp->GetName(); + + theStatus = HYP_OK; + + if (hypName == "ProjectionSource2D") + { + _sourceHypo = static_cast(theHyp); + + // Check hypo parameters + + SMESH_Mesh* srcMesh = _sourceHypo->GetSourceMesh(); + SMESH_Mesh* tgtMesh = & theMesh; + if ( !srcMesh ) + srcMesh = tgtMesh; + + // check vertices + if ( _sourceHypo->HasVertexAssociation() ) + { + // source vertices + TopoDS_Shape edge = TAssocTool::GetEdgeByVertices + ( srcMesh, _sourceHypo->GetSourceVertex(1), _sourceHypo->GetSourceVertex(2) ); + if ( edge.IsNull() || + !TAssocTool::IsSubShape( edge, srcMesh ) || + !TAssocTool::IsSubShape( edge, _sourceHypo->GetSourceFace() )) + { + theStatus = HYP_BAD_PARAMETER; + SCRUTE((edge.IsNull())); + SCRUTE((TAssocTool::IsSubShape( edge, srcMesh ))); + SCRUTE((TAssocTool::IsSubShape( edge, _sourceHypo->GetSourceFace() ))); + } + else + { + // target vertices + edge = TAssocTool::GetEdgeByVertices + ( tgtMesh, _sourceHypo->GetTargetVertex(1), _sourceHypo->GetTargetVertex(2) ); + if ( edge.IsNull() || + !TAssocTool::IsSubShape( edge, tgtMesh ) || + !TAssocTool::IsSubShape( edge, theShape )) + { + theStatus = HYP_BAD_PARAMETER; + SCRUTE((edge.IsNull())); + SCRUTE((TAssocTool::IsSubShape( edge, tgtMesh ))); + SCRUTE((TAssocTool::IsSubShape( edge, theShape ))); + } + } + } + // check a source face + if ( !TAssocTool::IsSubShape( _sourceHypo->GetSourceFace(), srcMesh ) || + ( srcMesh == tgtMesh && theShape == _sourceHypo->GetSourceFace() )) + { + theStatus = HYP_BAD_PARAMETER; + SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSourceFace(), srcMesh ))); + SCRUTE((srcMesh == tgtMesh)); + SCRUTE(( theShape == _sourceHypo->GetSourceFace() )); + } + } + else + { + theStatus = HYP_INCOMPATIBLE; + } + return ( theStatus == HYP_OK ); +} + +namespace { + + + //================================================================================ + /*! + * \brief define if a node is new or old + * \param node - node to check + * \retval bool - true if the node existed before Compute() is called + */ + //================================================================================ + + bool isOldNode( const SMDS_MeshNode* node ) + { + // old nodes are shared by edges and new ones are shared + // only by faces created by mapper + bool isOld = false; + SMDS_ElemIteratorPtr invElem = node->GetInverseElementIterator(); + while ( !isOld && invElem->more() ) + isOld = ( invElem->next()->GetType() == SMDSAbs_Edge ); + return isOld; + } + + //================================================================================ + /*! + * \brief Class to remove mesh built by pattern mapper on edges + * and vertices in the case of failure of projection algo. + * It does it's job at destruction + */ + //================================================================================ + + class MeshCleaner { + SMESH_subMesh* sm; + public: + MeshCleaner( SMESH_subMesh* faceSubMesh ): sm(faceSubMesh) {} + ~MeshCleaner() { Clean(sm); } + void Release() { sm = 0; } // mesh will not be removed + static void Clean( SMESH_subMesh* sm ) + { + if ( !sm ) return; + switch ( sm->GetSubShape().ShapeType() ) { + case TopAbs_VERTEX: + case TopAbs_EDGE: { + SMDS_NodeIteratorPtr nIt = sm->GetSubMeshDS()->GetNodes(); + SMESHDS_Mesh* mesh = sm->GetFather()->GetMeshDS(); + while ( nIt->more() ) { + const SMDS_MeshNode* node = nIt->next(); + if ( !isOldNode( node ) ) + mesh->RemoveNode( node ); + } + // do not break but iterate over DependsOn() + } + default: + const map< int, SMESH_subMesh * >& subSM = sm->DependsOn(); + map< int, SMESH_subMesh * >::const_iterator i_sm = subSM.begin(); + for ( ; i_sm != subSM.end(); ++i_sm ) + Clean( i_sm->second ); + } + } + }; + + //================================================================================ + /*! + * \brief find new nodes belonging to one free border of mesh on face + * \param sm - submesh on edge or vertex containg nodes to choose from + * \param face - the face bound the submesh + * \param u2nodes - map to fill with nodes + * \param seamNodes - set of found nodes + * \retval bool - is a success + */ + //================================================================================ + + bool getBoundaryNodes ( SMESH_subMesh* sm, + const TopoDS_Face& face, + map< double, const SMDS_MeshNode* > & u2nodes, + set< const SMDS_MeshNode* > & seamNodes) + { + u2nodes.clear(); + seamNodes.clear(); + if ( !sm || !sm->GetSubMeshDS() ) + RETURN_BAD_RESULT("Null submesh"); + + SMDS_NodeIteratorPtr nIt = sm->GetSubMeshDS()->GetNodes(); + switch ( sm->GetSubShape().ShapeType() ) { + + case TopAbs_VERTEX: { + while ( nIt->more() ) { + const SMDS_MeshNode* node = nIt->next(); + if ( isOldNode( node ) ) continue; + u2nodes.insert( make_pair( 0., node )); + seamNodes.insert( node ); + return true; + } + break; + } + case TopAbs_EDGE: { + + // Get submeshes of sub-vertices + const map< int, SMESH_subMesh * >& subSM = sm->DependsOn(); + if ( subSM.size() != 2 ) + RETURN_BAD_RESULT("there must be 2 submeshes of sub-vertices" + " but we have " << subSM.size()); + SMESH_subMesh* smV1 = subSM.begin()->second; + SMESH_subMesh* smV2 = subSM.rbegin()->second; + if ( !smV1->IsMeshComputed() || !smV2->IsMeshComputed() ) + RETURN_BAD_RESULT("Empty vertex submeshes"); + + // Look for a new node on V1 + nIt = smV1->GetSubMeshDS()->GetNodes(); + const SMDS_MeshNode* nV1 = 0; + while ( nIt->more() && !nV1 ) { + const SMDS_MeshNode* node = nIt->next(); + if ( !isOldNode( node ) ) nV1 = node; + } + if ( !nV1 ) + RETURN_BAD_RESULT("No new node found on V1"); + + // Find a new node connected to nV1 and belonging to edge submesh; + const SMDS_MeshNode* nE = 0; + SMESHDS_SubMesh* smDS = sm->GetSubMeshDS(); + SMDS_ElemIteratorPtr vElems = nV1->GetInverseElementIterator(); + while ( vElems->more() && !nE ) { + const SMDS_MeshElement* elem = vElems->next(); + if ( elem->GetType() != SMDSAbs_Face ) + continue; // new nodes are shared by faces + int nbNodes = elem->NbNodes(); + if ( elem->IsQuadratic() ) + nbNodes /= 2; + int iV1 = elem->GetNodeIndex( nV1 ); + // try next aftre nV1 + int iE = SMESH_MesherHelper::WrapIndex( iV1 + 1, nbNodes ); + if ( smDS->Contains( elem->GetNode( iE ) )) + nE = elem->GetNode( iE ); + if ( !nE ) { + // try node before nV1 + iE = SMESH_MesherHelper::WrapIndex( iV1 - 1, nbNodes ); + if ( smDS->Contains( elem->GetNode( iE ))) + nE = elem->GetNode( iE ); + } + if ( nE && elem->IsQuadratic() ) { // find medium node between nV1 and nE + if ( Abs( iV1 - iE ) == 1 ) + nE = elem->GetNode( Min ( iV1, iE ) + nbNodes ); + else + nE = elem->GetNode( elem->NbNodes() - 1 ); + } + } + if ( !nE ) + RETURN_BAD_RESULT("new node on edge not found"); + + // Get the whole free border of a face + list< const SMDS_MeshNode* > bordNodes; + list< const SMDS_MeshElement* > bordFaces; + if ( !SMESH_MeshEditor::FindFreeBorder (nV1, nE, nV1, bordNodes, bordFaces )) + RETURN_BAD_RESULT("free border of a face not found by nodes " << + nV1->GetID() << " " << nE->GetID() ); + + // Insert nodes of the free border to the map until node on V2 encountered + SMESHDS_SubMesh* v2smDS = smV2->GetSubMeshDS(); + list< const SMDS_MeshNode* >::iterator bordIt = bordNodes.begin(); + bordIt++; // skip nV1 + for ( ; bordIt != bordNodes.end(); ++bordIt ) { + const SMDS_MeshNode* node = *bordIt; + if ( v2smDS->Contains( node )) + break; + if ( node->GetPosition()->GetTypeOfPosition() != SMDS_TOP_EDGE ) + RETURN_BAD_RESULT("Bad node position type: node " << node->GetID() << + " pos type " << node->GetPosition()->GetTypeOfPosition()); + const SMDS_EdgePosition* pos = + static_cast(node->GetPosition().get()); + u2nodes.insert( make_pair( pos->GetUParameter(), node )); + seamNodes.insert( node ); + } + if ( u2nodes.size() != seamNodes.size() ) + RETURN_BAD_RESULT("Bad node params on edge " << sm->GetId() << + ", " << u2nodes.size() << " != " << seamNodes.size() ); + return true; + } + default:; + } + RETURN_BAD_RESULT ("Unexpected submesh type"); + + } // bool getBoundaryNodes() + +} // namespace + +//======================================================================= +//function : Compute +//purpose : +//======================================================================= + +bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape& theShape) +{ + if ( !_sourceHypo ) + return false; + + TopoDS_Face tgtFace = TopoDS::Face( theShape.Oriented(TopAbs_FORWARD)); + TopoDS_Face srcFace = TopoDS::Face( _sourceHypo->GetSourceFace().Oriented(TopAbs_FORWARD)); + + SMESH_Mesh * srcMesh = _sourceHypo->GetSourceMesh(); + SMESH_Mesh * tgtMesh = & theMesh; + if ( !srcMesh ) + srcMesh = tgtMesh; + + SMESHDS_Mesh * meshDS = theMesh.GetMeshDS(); + + SMESH_MesherHelper helper( theMesh ); + helper.SetSubShape( tgtFace ); + + // --------------------------- + // Make subshapes association + // --------------------------- + + TAssocTool::TShapeShapeMap shape2ShapeMap; + TAssocTool::InitVertexAssociation( _sourceHypo, shape2ShapeMap ); + if ( !TAssocTool::FindSubShapeAssociation( tgtFace, tgtMesh, srcFace, srcMesh, + shape2ShapeMap) ) + RETURN_BAD_RESULT("FindSubShapeAssociation failed"); + + // ---------------------------------------------- + // Assure that mesh on a source Face is computed + // ---------------------------------------------- + + SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcFace ); + SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( tgtFace ); + + if ( tgtMesh == srcMesh ) { + if ( !TAssocTool::MakeComputed( srcSubMesh )) + RETURN_BAD_RESULT("Impossible to compute the source mesh"); + } + else { + if ( !srcSubMesh->IsMeshComputed() ) + RETURN_BAD_RESULT("Source mesh is not computed"); + } + + // -------------------- + // Prepare to mapping + // -------------------- + + // Load pattern from the source face + SMESH_Pattern mapper; + mapper.Load( srcMesh, srcFace ); + if ( mapper.GetErrorCode() != SMESH_Pattern::ERR_OK ) + RETURN_BAD_RESULT("SMESH_Pattern::Load() failed"); + + // Find the first target vertex corresponding to first vertex of the + // and flag needed to call mapper.Apply() + + TopoDS_Vertex srcV1 = TopoDS::Vertex( mapper.GetSubShape( 1 )); + if ( srcV1.IsNull() ) + RETURN_BAD_RESULT("Mesh is not bound to the face"); + if ( !shape2ShapeMap.IsBound( srcV1 )) + RETURN_BAD_RESULT("Not associated vertices, srcV1 " << srcV1.TShape().operator->() ); + TopoDS_Vertex tgtV1 = TopoDS::Vertex( shape2ShapeMap( srcV1 )); + + if ( !TAssocTool::IsSubShape( srcV1, srcFace )) + RETURN_BAD_RESULT("Wrong srcV1 " << srcV1.TShape().operator->()); + if ( !TAssocTool::IsSubShape( tgtV1, tgtFace )) + RETURN_BAD_RESULT("Wrong tgtV1 " << tgtV1.TShape().operator->()); + + // try to find out orientation by order of edges + bool reverse = false; + list< TopoDS_Edge > tgtEdges, srcEdges; + list< int > nbEdgesInWires; + SMESH_Block::GetOrderedEdges( tgtFace, tgtV1, tgtEdges, nbEdgesInWires); + SMESH_Block::GetOrderedEdges( srcFace, srcV1, srcEdges, nbEdgesInWires); + if ( nbEdgesInWires.front() > 1 ) // possible to find out + { + TopoDS_Edge srcE1 = srcEdges.front(), tgtE1 = tgtEdges.front(); + reverse = ( ! srcE1.IsSame( shape2ShapeMap( tgtE1 ))); + if ( BRep_Tool::IsClosed( tgtE1, tgtFace )) { + reverse = ( srcE1.Orientation() == tgtE1.Orientation() ); + if ( _sourceHypo->GetSourceFace().Orientation() != theShape.Orientation() ) + reverse = !reverse; + } + } + else if ( nbEdgesInWires.front() == 1 ) + { + // TODO::Compare orientation of curves in a sole edge + //RETURN_BAD_RESULT("Not implemented case"); + } + else + { + RETURN_BAD_RESULT("Bad result from SMESH_Block::GetOrderedEdges()"); + } + + // -------------------- + // Perform 2D mapping + // -------------------- + + // Compute mesh on a target face + + mapper.Apply( tgtFace, tgtV1, reverse ); + if ( mapper.GetErrorCode() != SMESH_Pattern::ERR_OK ) + RETURN_BAD_RESULT("SMESH_Pattern::Apply() failed"); + + // Create the mesh + + const bool toCreatePolygons = false, toCreatePolyedrs = false; + mapper.MakeMesh( tgtMesh, toCreatePolygons, toCreatePolyedrs ); + if ( mapper.GetErrorCode() != SMESH_Pattern::ERR_OK ) + RETURN_BAD_RESULT("SMESH_Pattern::MakeMesh() failed"); + + // it will remove mesh built by pattern mapper on edges and vertices + // in failure case + MeshCleaner cleaner( tgtSubMesh ); + + // ------------------------------------------------------------------------- + // mapper doesn't take care of nodes already existing on edges and vertices, + // so we must merge nodes created by it with existing ones + // ------------------------------------------------------------------------- + + SMESH_MeshEditor editor( tgtMesh ); + SMESH_MeshEditor::TListOfListOfNodes groupsOfNodes; + + // Make groups of nodes to merge + + // loop on edge and vertex submeshes of a target face + const map< int, SMESH_subMesh * >& subSM = tgtSubMesh->DependsOn(); + map< int, SMESH_subMesh * >::const_iterator i_subSM = subSM.begin(); + for ( ; i_subSM != subSM.end(); ++i_subSM ) + { + SMESH_subMesh* sm = i_subSM->second; + SMESHDS_SubMesh* smDS = sm->GetSubMeshDS(); + + // Sort new and old nodes of a submesh separately + + bool isSeam = helper.IsSeamShape( sm->GetId() ); + + enum { NEW_NODES, OLD_NODES }; + map< double, const SMDS_MeshNode* > u2nodesMaps[2], u2nodesOnSeam; + map< double, const SMDS_MeshNode* >::iterator u_oldNode, u_newNode, u_newOnSeam, newEnd; + set< const SMDS_MeshNode* > seamNodes; + + // mapper puts on a seam edge nodes from 2 edges + if ( isSeam && ! getBoundaryNodes ( sm, tgtFace, u2nodesOnSeam, seamNodes )) + RETURN_BAD_RESULT("getBoundaryNodes() failed"); + + SMDS_NodeIteratorPtr nIt = smDS->GetNodes(); + while ( nIt->more() ) + { + const SMDS_MeshNode* node = nIt->next(); + bool isOld = isOldNode( node ); + + if ( !isOld && isSeam ) { // new node on a seam edge + if ( seamNodes.find( node ) != seamNodes.end()) + continue; // node is already in the map + } + + // sort nodes on edges by its position + map< double, const SMDS_MeshNode* > & pos2nodes = u2nodesMaps[ isOld ]; + switch ( node->GetPosition()->GetTypeOfPosition() ) + { + case SMDS_TOP_VERTEX: { + pos2nodes.insert( make_pair( 0, node )); + break; + } + case SMDS_TOP_EDGE: { + const SMDS_EdgePosition* pos = + static_cast(node->GetPosition().get()); + pos2nodes.insert( make_pair( pos->GetUParameter(), node )); + break; + } + default: + RETURN_BAD_RESULT("Wrong node position type: "<< + node->GetPosition()->GetTypeOfPosition()); + } + } + if ( u2nodesMaps[ OLD_NODES ].size() != u2nodesMaps[ NEW_NODES ].size() ) + RETURN_BAD_RESULT("Different nb of old and new nodes " << + u2nodesMaps[ OLD_NODES ].size() << " != " << + u2nodesMaps[ NEW_NODES ].size()); + if ( isSeam && u2nodesMaps[ OLD_NODES ].size() != u2nodesOnSeam.size() ) + RETURN_BAD_RESULT("Different nb of old and seam nodes " << + u2nodesMaps[ OLD_NODES ].size() << " != " << u2nodesOnSeam.size()); + + // Make groups of nodes to merge + u_oldNode = u2nodesMaps[ OLD_NODES ].begin(); + u_newNode = u2nodesMaps[ NEW_NODES ].begin(); + newEnd = u2nodesMaps[ NEW_NODES ].end(); + u_newOnSeam = u2nodesOnSeam.begin(); + for ( ; u_newNode != newEnd; ++u_newNode, ++u_oldNode ) { + groupsOfNodes.push_back( list< const SMDS_MeshNode* >() ); + groupsOfNodes.back().push_back( u_oldNode->second ); + groupsOfNodes.back().push_back( u_newNode->second ); + if ( isSeam ) + groupsOfNodes.back().push_back( (u_newOnSeam++)->second ); + } + } + + // Merge + + editor.MergeNodes( groupsOfNodes ); + + // --------------------------- + // Check elements orientation + // --------------------------- + + TopoDS_Face face = tgtFace; + if ( !theMesh.IsMainShape( tgtFace )) + { + // find the main shape + TopoDS_Shape mainShape = meshDS->ShapeToMesh(); + switch ( mainShape.ShapeType() ) { + case TopAbs_SHELL: + case TopAbs_SOLID: break; + default: + TopTools_ListIteratorOfListOfShape ancestIt = theMesh.GetAncestors( face ); + for ( ; ancestIt.More(); ancestIt.Next() ) { + TopAbs_ShapeEnum type = ancestIt.Value().ShapeType(); + if ( type == TopAbs_SOLID ) { + mainShape = ancestIt.Value(); + break; + } else if ( type == TopAbs_SHELL ) { + mainShape = ancestIt.Value(); + } + } + } + // find tgtFace in the main solid or shell to know it's true orientation. + TopExp_Explorer exp( mainShape, TopAbs_FACE ); + for ( ; exp.More(); exp.Next() ) { + if ( tgtFace.IsSame( exp.Current() )) { + face = TopoDS::Face( exp.Current() ); + break; + } + } + } + // Fix orientation + if ( SMESH_Algo::IsReversedSubMesh( face, meshDS )) + { + SMDS_ElemIteratorPtr eIt = meshDS->MeshElements( face )->GetElements(); + while ( eIt->more() ) { + const SMDS_MeshElement* e = eIt->next(); + if ( e->GetType() == SMDSAbs_Face && !editor.Reorient( e )) + RETURN_BAD_RESULT("Pb of SMESH_MeshEditor::Reorient()"); + } + } + + cleaner.Release(); // do not remove mesh + + return true; +} + +//============================================================================= +/*! + * \brief Sets a default event listener to submesh of the source face + * \param subMesh - submesh where algo is set + * + * This method is called when a submesh gets HYP_OK algo_state. + * After being set, event listener is notified on each event of a submesh. + * Arranges that CLEAN event is translated from source submesh to + * the submesh + */ +//============================================================================= + +void StdMeshers_Projection_2D::SetEventListener(SMESH_subMesh* subMesh) +{ + if ( _sourceHypo && ! _sourceHypo->GetSourceFace().IsNull() ) + { + SMESH_Mesh* srcMesh = _sourceHypo->GetSourceMesh(); + if ( !srcMesh ) + srcMesh = subMesh->GetFather(); + + SMESH_subMesh* srcFaceSM = + srcMesh->GetSubMesh( _sourceHypo->GetSourceFace() ); + + subMesh->SetEventListener( new SMESH_subMeshEventListener(true), + SMESH_subMeshEventListenerData::MakeData( subMesh ), + srcFaceSM ); + } +} diff --git a/src/StdMeshers/StdMeshers_Projection_2D.hxx b/src/StdMeshers/StdMeshers_Projection_2D.hxx new file mode 100644 index 000000000..ec59cb505 --- /dev/null +++ b/src/StdMeshers/StdMeshers_Projection_2D.hxx @@ -0,0 +1,65 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Projection_2D.hxx +// Module : SMESH + +#ifndef _SMESH_Projection_2D_HXX_ +#define _SMESH_Projection_2D_HXX_ + +#include "SMESH_StdMeshers.hxx" + +#include "SMESH_2D_Algo.hxx" + +class StdMeshers_ProjectionSource2D; + +class STDMESHERS_EXPORT StdMeshers_Projection_2D: public SMESH_2D_Algo +{ +public: + StdMeshers_Projection_2D(int hypId, int studyId, SMESH_Gen* gen); + virtual ~StdMeshers_Projection_2D(); + + virtual bool CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus); + + virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); + + /*! + * \brief Sets a default event listener to submesh of the source face + * \param whenSetToSubMesh - submesh where algo is set + * + * After being set, event listener is notified on each event of a submesh. + * This method is called when a submesh gets HYP_OK algo_state. + * Arranges that CLEAN event is translated from source submesh to + * the whenSetToSubMesh submesh. + */ + virtual void SetEventListener(SMESH_subMesh* whenSetToSubMesh); + +protected: + + const StdMeshers_ProjectionSource2D* _sourceHypo; + +}; + +#endif diff --git a/src/StdMeshers/StdMeshers_Projection_3D.cxx b/src/StdMeshers/StdMeshers_Projection_3D.cxx new file mode 100644 index 000000000..241ff7670 --- /dev/null +++ b/src/StdMeshers/StdMeshers_Projection_3D.cxx @@ -0,0 +1,438 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Projection_3D.cxx +// Module : SMESH +// Created : Fri Oct 20 11:37:07 2006 +// Author : Edward AGAPOV (eap) + + +#include "StdMeshers_Projection_3D.hxx" +#include "StdMeshers_ProjectionSource3D.hxx" + +#include "StdMeshers_ProjectionUtils.hxx" + +#include "SMESHDS_Hypothesis.hxx" +#include "SMESHDS_SubMesh.hxx" +#include "SMESH_Block.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_Mesh.hxx" +#include "SMESH_MeshEditor.hxx" +#include "SMESH_Pattern.hxx" +#include "SMESH_subMesh.hxx" +#include "SMESH_subMeshEventListener.hxx" +#include "SMESH_MesherHelper.hxx" +#include "SMDS_VolumeTool.hxx" +#include "SMDS_PolyhedralVolumeOfNodes.hxx" + +#include "utilities.h" + +#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; } +#define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z()) +#define SHOWYXZ(msg, xyz) // {\ +// gp_Pnt p (xyz); \ +// cout << msg << " ("<< p.X() << "; " <::const_iterator itl; + + const list &hyps = GetUsedHypothesis(aMesh, aShape); + if ( hyps.size() == 0 ) + { + aStatus = SMESH_Hypothesis::HYP_MISSING; + return false; // can't work with no hypothesis + } + + if ( hyps.size() > 1 ) + { + aStatus = SMESH_Hypothesis::HYP_ALREADY_EXIST; + return false; + } + + const SMESHDS_Hypothesis *theHyp = hyps.front(); + + string hypName = theHyp->GetName(); + + aStatus = SMESH_Hypothesis::HYP_OK; + + if (hypName == "ProjectionSource3D") + { + _sourceHypo = static_cast(theHyp); + // Check hypo parameters + + SMESH_Mesh* srcMesh = _sourceHypo->GetSourceMesh(); + SMESH_Mesh* tgtMesh = & aMesh; + if ( !srcMesh ) + srcMesh = tgtMesh; + + // check vertices + if ( _sourceHypo->HasVertexAssociation() ) + { + // source vertices + TopoDS_Shape edge = TAssocTool::GetEdgeByVertices + ( srcMesh, _sourceHypo->GetSourceVertex(1), _sourceHypo->GetSourceVertex(2) ); + if ( edge.IsNull() || + !TAssocTool::IsSubShape( edge, srcMesh ) || + !TAssocTool::IsSubShape( edge, _sourceHypo->GetSource3DShape() )) + { + SCRUTE((edge.IsNull())); + SCRUTE((TAssocTool::IsSubShape( edge, srcMesh ))); + SCRUTE((TAssocTool::IsSubShape( edge, _sourceHypo->GetSource3DShape() ))); + aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER; + } + else + { + // target vertices + edge = TAssocTool::GetEdgeByVertices + ( tgtMesh, _sourceHypo->GetTargetVertex(1), _sourceHypo->GetTargetVertex(2) ); + if ( edge.IsNull() || + !TAssocTool::IsSubShape( edge, tgtMesh ) || + !TAssocTool::IsSubShape( edge, aShape )) + { + SCRUTE((edge.IsNull())); + SCRUTE((TAssocTool::IsSubShape( edge, tgtMesh ))); + SCRUTE((TAssocTool::IsSubShape( edge, aShape ))); + aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER; + } + } + } + // check a source shape + if ( !TAssocTool::IsSubShape( _sourceHypo->GetSource3DShape(), srcMesh ) || + ( srcMesh == tgtMesh && aShape == _sourceHypo->GetSource3DShape())) + { + SCRUTE((TAssocTool::IsSubShape( _sourceHypo->GetSource3DShape(), srcMesh))); + SCRUTE((srcMesh == tgtMesh)); + SCRUTE((aShape == _sourceHypo->GetSource3DShape())); + aStatus = SMESH_Hypothesis::HYP_BAD_PARAMETER; + } + } + else + { + aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE; + } + return ( aStatus == HYP_OK ); +} + +//======================================================================= +//function : Compute +//purpose : +//======================================================================= + +bool StdMeshers_Projection_3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) +{ + if ( !_sourceHypo ) + return false; + + SMESH_Mesh * srcMesh = _sourceHypo->GetSourceMesh(); + SMESH_Mesh * tgtMesh = & aMesh; + if ( !srcMesh ) + srcMesh = tgtMesh; + + SMESHDS_Mesh * srcMeshDS = srcMesh->GetMeshDS(); + SMESHDS_Mesh * tgtMeshDS = tgtMesh->GetMeshDS(); + + // get shell from shape3D + TopoDS_Shell srcShell, tgtShell; + TopExp_Explorer exp( _sourceHypo->GetSource3DShape(), TopAbs_SHELL ); + int nbShell; + for ( nbShell = 0; exp.More(); exp.Next(), ++nbShell ) + srcShell = TopoDS::Shell( exp.Current() ); + if ( nbShell != 1 ) + RETURN_BAD_RESULT("There must be 1 shell in the source shape"); + + exp.Init( aShape, TopAbs_SHELL ); + for ( nbShell = 0; exp.More(); exp.Next(), ++nbShell ) + tgtShell = TopoDS::Shell( exp.Current() ); + if ( nbShell != 1 ) + RETURN_BAD_RESULT("There must be 1 shell in the target shape"); + + // Assure that mesh on a source shape is computed + + SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( _sourceHypo->GetSource3DShape() ); + //SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( aShape ); + + if ( tgtMesh == srcMesh && !aShape.IsSame( _sourceHypo->GetSource3DShape() )) { + if ( !TAssocTool::MakeComputed( srcSubMesh )) + RETURN_BAD_RESULT("Impossible to compute the source mesh"); + } + else { + if ( !srcSubMesh->IsMeshComputed() ) + RETURN_BAD_RESULT("Source mesh is not computed"); + } + + // Find 2 pairs of corresponding vertices + + TopoDS_Vertex tgtV000, tgtV100, srcV000, srcV100; + TAssocTool::TShapeShapeMap shape2ShapeMap; + + if ( _sourceHypo->HasVertexAssociation() ) + { + tgtV000 = _sourceHypo->GetTargetVertex(1); + tgtV100 = _sourceHypo->GetTargetVertex(2); + srcV000 = _sourceHypo->GetSourceVertex(1); + srcV100 = _sourceHypo->GetSourceVertex(2); + } + else + { + if ( !TAssocTool::FindSubShapeAssociation( tgtShell, tgtMesh, srcShell, srcMesh, + shape2ShapeMap) ) + RETURN_BAD_RESULT("FindSubShapeAssociation() failed"); + + exp.Init( tgtShell, TopAbs_EDGE ); + TopExp::Vertices( TopoDS::Edge( exp.Current() ), tgtV000, tgtV100 ); + + if ( !shape2ShapeMap.IsBound( tgtV000 ) || !shape2ShapeMap.IsBound( tgtV100 )) + RETURN_BAD_RESULT("Shape associating not done"); + srcV000 = TopoDS::Vertex( shape2ShapeMap( tgtV000 )); + srcV100 = TopoDS::Vertex( shape2ShapeMap( tgtV100 )); + if ( !TAssocTool::IsSubShape( srcV000, srcShell ) || + !TAssocTool::IsSubShape( srcV100, srcShell )) + RETURN_BAD_RESULT("Wrong target vertices"); + } + + // Load 2 SMESH_Block's with src and tgt shells + + SMESH_Block srcBlock, tgtBlock; + TopTools_IndexedMapOfOrientedShape scrShapes, tgtShapes; + if ( !tgtBlock.LoadBlockShapes( tgtShell, tgtV000, tgtV100, tgtShapes )) + RETURN_BAD_RESULT("SMESH_Block::LoadBlockShapes(tgtShell) failed"); + + if ( !srcBlock.LoadBlockShapes( srcShell, srcV000, srcV100, scrShapes )) + RETURN_BAD_RESULT("SMESH_Block::LoadBlockShapes(srcShell) failed"); + + // Find matching nodes of src and tgt shells + + TNodeNodeMap src2tgtNodeMap; + for ( int fId = SMESH_Block::ID_FirstF; fId < SMESH_Block::ID_Shell; ++fId ) + { + // Corresponding subshapes + TopoDS_Face srcFace = TopoDS::Face( scrShapes( fId )); + TopoDS_Face tgtFace = TopoDS::Face( tgtShapes( fId )); + if ( _sourceHypo->HasVertexAssociation() ) { // associate face subshapes + shape2ShapeMap.Clear(); + vector< int > edgeIdVec; + SMESH_Block::GetFaceEdgesIDs( fId, edgeIdVec ); + for ( int i = 0; i < edgeIdVec.size(); ++i ) { + int eID = edgeIdVec[ i ]; + shape2ShapeMap.Bind( tgtShapes( eID ), scrShapes( eID )); + if ( i < 2 ) { + vector< int > vertexIdVec; + SMESH_Block::GetEdgeVertexIDs( eID, vertexIdVec ); + shape2ShapeMap.Bind( tgtShapes( vertexIdVec[0] ), scrShapes( vertexIdVec[0] )); + shape2ShapeMap.Bind( tgtShapes( vertexIdVec[1] ), scrShapes( vertexIdVec[1] )); + } + } + } + // Find matching nodes of tgt and src faces + TNodeNodeMap faceMatchingNodes; + if ( ! TAssocTool::FindMatchingNodesOnFaces( srcFace, srcMesh, tgtFace, tgtMesh, + shape2ShapeMap, faceMatchingNodes )) + RETURN_BAD_RESULT("Different mesh on corresponding src and tgt faces: " + << srcMeshDS->ShapeToIndex( srcFace ) << " and " + << tgtMeshDS->ShapeToIndex( tgtFace )); + + // put found matching nodes of 2 faces to the global map + src2tgtNodeMap.insert( faceMatchingNodes.begin(), faceMatchingNodes.end() ); + } + + // ------------------ + // Make mesh + // ------------------ + + SMDS_VolumeTool volTool; + SMESH_MesherHelper helper( *tgtMesh ); + helper.IsQuadraticSubMesh( aShape ); + + SMESHDS_SubMesh* srcSMDS = srcSubMesh->GetSubMeshDS(); + SMDS_ElemIteratorPtr volIt = srcSMDS->GetElements(); + while ( volIt->more() ) // loop on source volumes + { + const SMDS_MeshElement* srcVol = volIt->next(); + if ( !srcVol || srcVol->GetType() != SMDSAbs_Volume ) + continue; + int nbNodes = srcVol->NbNodes(); + SMDS_VolumeTool::VolumeType volType = volTool.GetType( nbNodes ); + if ( srcVol->IsQuadratic() ) + nbNodes = volTool.NbCornerNodes( volType ); + + // Find or create a new tgt node for each node of a src volume + + vector< const SMDS_MeshNode* > nodes( nbNodes ); + for ( int i = 0; i < nbNodes; ++i ) + { + const SMDS_MeshNode* srcNode = srcVol->GetNode( i ); + const SMDS_MeshNode* tgtNode = 0; + TNodeNodeMap::iterator sN_tN = src2tgtNodeMap.find( srcNode ); + if ( sN_tN != src2tgtNodeMap.end() ) // found + { + tgtNode = sN_tN->second; + } + else // Create a new tgt node + { + // compute normalized parameters of source node in srcBlock + gp_Pnt srcCoord = gpXYZ( srcNode ); + gp_XYZ srcParam; + if ( !srcBlock.ComputeParameters( srcCoord, srcParam )) + RETURN_BAD_RESULT("srcBlock.ComputeParameters() failed"); + // compute coordinates of target node by srcParam + gp_XYZ tgtXYZ; + if ( !tgtBlock.ShellPoint( srcParam, tgtXYZ )) + RETURN_BAD_RESULT("tgtBlock.ShellPoint() failed"); + // add node + SMDS_MeshNode* newNode = tgtMeshDS->AddNode( tgtXYZ.X(), tgtXYZ.Y(), tgtXYZ.Z() ); + tgtMeshDS->SetNodeInVolume( newNode, helper.GetSubShapeID() ); + tgtNode = newNode; + src2tgtNodeMap.insert( make_pair( srcNode, tgtNode )); + } + nodes[ i ] = tgtNode; + } + + // Create a new volume + + SMDS_MeshVolume * tgtVol = 0; + switch ( volType ) { + case SMDS_VolumeTool::TETRA : + case SMDS_VolumeTool::QUAD_TETRA: + tgtVol = helper.AddVolume( nodes[0], + nodes[1], + nodes[2], + nodes[3]); break; + case SMDS_VolumeTool::PYRAM : + case SMDS_VolumeTool::QUAD_PYRAM: + tgtVol = helper.AddVolume( nodes[0], + nodes[1], + nodes[2], + nodes[3], + nodes[4]); break; + case SMDS_VolumeTool::PENTA : + case SMDS_VolumeTool::QUAD_PENTA: + tgtVol = helper.AddVolume( nodes[0], + nodes[1], + nodes[2], + nodes[3], + nodes[4], + nodes[5]); break; + case SMDS_VolumeTool::HEXA : + case SMDS_VolumeTool::QUAD_HEXA : + tgtVol = helper.AddVolume( nodes[0], + nodes[1], + nodes[2], + nodes[3], + nodes[4], + nodes[5], + nodes[6], + nodes[7]); break; + default: // polyhedron + const SMDS_PolyhedralVolumeOfNodes * poly = + dynamic_cast( srcVol ); + if ( !poly ) + RETURN_BAD_RESULT("Unexpected volume type"); + vector quantities( poly->NbFaces(), 0 ); + for ( int i = 0; i < quantities.size(); ++i ) + quantities[ i ] = poly->NbFaceNodes( i + 1 ); + tgtVol = tgtMeshDS->AddPolyhedralVolume( nodes, quantities ); + } + if ( tgtVol ) { + tgtMeshDS->SetMeshElementOnShape( tgtVol, helper.GetSubShapeID() ); + } + } // loop on volumes of src shell + + return true; +} + +//============================================================================= +/*! + * \brief Sets a default event listener to submesh of the source shape + * \param subMesh - submesh where algo is set + * + * This method is called when a submesh gets HYP_OK algo_state. + * After being set, event listener is notified on each event of a submesh. + * Arranges that CLEAN event is translated from source submesh to + * the submesh + */ +//============================================================================= + +void StdMeshers_Projection_3D::SetEventListener(SMESH_subMesh* subMesh) +{ + if ( _sourceHypo && ! _sourceHypo->GetSource3DShape().IsNull() ) + { + SMESH_Mesh* srcMesh = _sourceHypo->GetSourceMesh(); + if ( !srcMesh ) + srcMesh = subMesh->GetFather(); + + SMESH_subMesh* srcShapeSM = + srcMesh->GetSubMesh( _sourceHypo->GetSource3DShape() ); + + if ( srcShapeSM != subMesh ) + subMesh->SetEventListener( new SMESH_subMeshEventListener(true), + SMESH_subMeshEventListenerData::MakeData( subMesh ), + srcShapeSM ); + } +} + diff --git a/src/StdMeshers/StdMeshers_Projection_3D.hxx b/src/StdMeshers/StdMeshers_Projection_3D.hxx new file mode 100644 index 000000000..8aa1f5eed --- /dev/null +++ b/src/StdMeshers/StdMeshers_Projection_3D.hxx @@ -0,0 +1,63 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Projection_3D.hxx +// Module : SMESH + +#ifndef _SMESH_Projection_3D_HXX_ +#define _SMESH_Projection_3D_HXX_ + +#include "SMESH_StdMeshers.hxx" + +#include "SMESH_3D_Algo.hxx" + +class StdMeshers_ProjectionSource3D; + +class STDMESHERS_EXPORT StdMeshers_Projection_3D: public SMESH_3D_Algo +{ +public: + StdMeshers_Projection_3D(int hypId, int studyId, SMESH_Gen* gen); + virtual ~StdMeshers_Projection_3D(); + + virtual bool CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus); + + virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); + + /*! + * \brief Sets a default event listener to submesh of the source shape + * \param whenSetToSubMesh - submesh where algo is set + * + * Arranges that CLEAN event is translated from source submesh to + * the whenSetToSubMesh submesh. + */ + virtual void SetEventListener(SMESH_subMesh* whenSetToSubMesh); + +protected: + + const StdMeshers_ProjectionSource3D* _sourceHypo; + +}; + +#endif diff --git a/src/StdMeshers/StdMeshers_Propagation.hxx b/src/StdMeshers/StdMeshers_Propagation.hxx index 40bbdff2d..3f6fb714a 100644 --- a/src/StdMeshers/StdMeshers_Propagation.hxx +++ b/src/StdMeshers/StdMeshers_Propagation.hxx @@ -27,10 +27,12 @@ #ifndef _SMESH_PROPAGATION_HXX_ #define _SMESH_PROPAGATION_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" -class StdMeshers_Propagation:public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_Propagation:public SMESH_Hypothesis { public: StdMeshers_Propagation(int hypId, int studyId, SMESH_Gen * gen); diff --git a/src/StdMeshers/StdMeshers_QuadranglePreference.hxx b/src/StdMeshers/StdMeshers_QuadranglePreference.hxx index 553dd756c..3d00d7acd 100644 --- a/src/StdMeshers/StdMeshers_QuadranglePreference.hxx +++ b/src/StdMeshers/StdMeshers_QuadranglePreference.hxx @@ -28,6 +28,8 @@ #ifndef _StdMeshers_QuadranglePreference_HXX_ #define _StdMeshers_QuadranglePreference_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" @@ -37,7 +39,7 @@ * GIBI can do it if the global number of nodes is even (DALL operator). * See PAL10467 */ -class StdMeshers_QuadranglePreference:public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_QuadranglePreference:public SMESH_Hypothesis { public: StdMeshers_QuadranglePreference(int hypId, int studyId, SMESH_Gen * gen); diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx index e20b1500e..15dcdb435 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.cxx @@ -27,7 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_Quadrangle_2D.hxx" #include "SMESH_Gen.hxx" #include "SMESH_Mesh.hxx" @@ -67,6 +66,7 @@ DEFINE_ARRAY2(StdMeshers_Array2OfNode, StdMeshers_BaseCollectionNodePtr, SMDS_MeshNodePtr) #endif +using namespace std; //============================================================================= /*! @@ -667,7 +667,7 @@ void StdMeshers_Quadrangle_2D::QuadDelete (FaceQuadStruct * quad) void StdMeshers_Quadrangle_2D::SetNormalizedGrid (SMESH_Mesh & aMesh, const TopoDS_Shape& aShape, - FaceQuadStruct* quad) throw (SALOME_Exception) + FaceQuadStruct* & quad) throw (SALOME_Exception) { Unexpect aCatch(SalomeException); // Algorithme décrit dans "Génération automatique de maillages" diff --git a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx index da1a677cd..9b1b0b6f3 100644 --- a/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx +++ b/src/StdMeshers/StdMeshers_Quadrangle_2D.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_QUADRANGLE_2D_HXX_ #define _SMESH_QUADRANGLE_2D_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_2D_Algo.hxx" #include "SMESH_Mesh.hxx" #include "Utils_SALOME_Exception.hxx" @@ -63,7 +65,7 @@ typedef struct faceQuadStruct UVPtStruct* uv_grid; } FaceQuadStruct; -class StdMeshers_Quadrangle_2D: +class STDMESHERS_EXPORT StdMeshers_Quadrangle_2D: public SMESH_2D_Algo { public: @@ -103,7 +105,7 @@ protected: void SetNormalizedGrid(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape, - FaceQuadStruct* quad) + FaceQuadStruct*& quad) throw (SALOME_Exception); /** diff --git a/src/StdMeshers/StdMeshers_QuadraticMesh.hxx b/src/StdMeshers/StdMeshers_QuadraticMesh.hxx index db601eec8..f6146f8b6 100644 --- a/src/StdMeshers/StdMeshers_QuadraticMesh.hxx +++ b/src/StdMeshers/StdMeshers_QuadraticMesh.hxx @@ -28,6 +28,8 @@ #ifndef _StdMeshers_QuadraticMesh_HXX_ #define _StdMeshers_QuadraticMesh_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" @@ -39,7 +41,7 @@ * The 3D mesher generates quadratic volumes only if all boundary faces * are quadratic ones, else it fails. */ -class StdMeshers_QuadraticMesh:public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_QuadraticMesh:public SMESH_Hypothesis { public: StdMeshers_QuadraticMesh(int hypId, int studyId, SMESH_Gen * gen); diff --git a/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx new file mode 100644 index 000000000..456400032 --- /dev/null +++ b/src/StdMeshers/StdMeshers_RadialPrism_3D.cxx @@ -0,0 +1,372 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_RadialPrism_3D.cxx +// Module : SMESH +// Created : Fri Oct 20 11:37:07 2006 +// Author : Edward AGAPOV (eap) + + +#include "StdMeshers_RadialPrism_3D.hxx" + +#include "StdMeshers_ProjectionUtils.hxx" +#include "StdMeshers_NumberOfLayers.hxx" +#include "StdMeshers_LayerDistribution.hxx" +#include "StdMeshers_Prism_3D.hxx" +#include "StdMeshers_Regular_1D.hxx" + +#include "SMDS_MeshNode.hxx" +#include "SMESHDS_SubMesh.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_Mesh.hxx" +#include "SMESH_MeshEditor.hxx" +#include "SMESH_MesherHelper.hxx" +#include "SMESH_subMesh.hxx" + +#include "utilities.h" + +#include +#include +#include +#include +#include +#include +#include + + +using namespace std; + +#define RETURN_BAD_RESULT(msg) { MESSAGE(msg); return false; } +#define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z()) + +typedef StdMeshers_ProjectionUtils TAssocTool; + +//======================================================================= +//function : StdMeshers_RadialPrism_3D +//purpose : +//======================================================================= + +StdMeshers_RadialPrism_3D::StdMeshers_RadialPrism_3D(int hypId, int studyId, SMESH_Gen* gen) + :SMESH_3D_Algo(hypId, studyId, gen) +{ + _name = "RadialPrism_3D"; + _shapeType = (1 << TopAbs_SOLID); // 1 bit per shape type + + _compatibleHypothesis.push_back("LayerDistribution"); + _compatibleHypothesis.push_back("NumberOfLayers"); + myNbLayerHypo = 0; + myDistributionHypo = 0; +} + +//================================================================================ +/*! + * \brief Destructor + */ +//================================================================================ + +StdMeshers_RadialPrism_3D::~StdMeshers_RadialPrism_3D() +{} + +//======================================================================= +//function : CheckHypothesis +//purpose : +//======================================================================= + +bool StdMeshers_RadialPrism_3D::CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus) +{ + // check aShape that must have 2 shells + if ( TAssocTool::Count( aShape, TopAbs_SOLID, 0 ) != 1 || + TAssocTool::Count( aShape, TopAbs_SHELL, 0 ) != 2 ) + { + aStatus = HYP_BAD_GEOMETRY; + return false; + } + + myNbLayerHypo = 0; + myDistributionHypo = 0; + + list ::const_iterator itl; + + const list &hyps = GetUsedHypothesis(aMesh, aShape); + if ( hyps.size() == 0 ) + { + aStatus = SMESH_Hypothesis::HYP_MISSING; + return false; // can't work with no hypothesis + } + + if ( hyps.size() > 1 ) + { + aStatus = SMESH_Hypothesis::HYP_ALREADY_EXIST; + return false; + } + + const SMESHDS_Hypothesis *theHyp = hyps.front(); + + string hypName = theHyp->GetName(); + + if (hypName == "NumberOfLayers") + { + myNbLayerHypo = static_cast(theHyp); + aStatus = SMESH_Hypothesis::HYP_OK; + return true; + } + if (hypName == "LayerDistribution") + { + myDistributionHypo = static_cast(theHyp); + aStatus = SMESH_Hypothesis::HYP_OK; + return true; + } + aStatus = SMESH_Hypothesis::HYP_INCOMPATIBLE; + return true; +} + +//======================================================================= +//function : Compute +//purpose : +//======================================================================= + +bool StdMeshers_RadialPrism_3D::Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape) +{ + TopExp_Explorer exp; + SMESHDS_Mesh * meshDS = aMesh.GetMeshDS(); + + myHelper = new SMESH_MesherHelper( aMesh ); + myHelper->IsQuadraticSubMesh( aShape ); + // to delete helper at exit from Compute() + std::auto_ptr helperDeleter( myHelper ); + + // get 2 shells + TopoDS_Solid solid = TopoDS::Solid( aShape ); + TopoDS_Shell outerShell = BRepTools::OuterShell( solid ); + TopoDS_Shape innerShell; + int nbShells = 0; + for ( TopoDS_Iterator It (solid); It.More(); It.Next(), ++nbShells ) + if ( !outerShell.IsSame( It.Value() )) + innerShell = It.Value(); + if ( nbShells != 2 ) + RETURN_BAD_RESULT("Must be 2 shells"); + + // ---------------------------------- + // Associate subshapes of the shells + // ---------------------------------- + + TAssocTool::TShapeShapeMap shape2ShapeMap; + if ( !TAssocTool::FindSubShapeAssociation( outerShell, &aMesh, + innerShell, &aMesh, + shape2ShapeMap) ) + RETURN_BAD_RESULT("FindSubShapeAssociation failed"); + + // ------------------ + // Make mesh + // ------------------ + + TNode2ColumnMap node2columnMap; + myLayerPositions.clear(); + + for ( exp.Init( outerShell, TopAbs_FACE ); exp.More(); exp.Next() ) + { + // Corresponding subshapes + TopoDS_Face outFace = TopoDS::Face( exp.Current() ); + TopoDS_Face inFace; + if ( !shape2ShapeMap.IsBound( outFace )) { + RETURN_BAD_RESULT("Association not found for face " << meshDS->ShapeToIndex( outFace )); + } else { + inFace = TopoDS::Face( shape2ShapeMap( outFace )); + } + + // Find matching nodes of in and out faces + TNodeNodeMap nodeIn2OutMap; + if ( ! TAssocTool::FindMatchingNodesOnFaces( inFace, &aMesh, outFace, &aMesh, + shape2ShapeMap, nodeIn2OutMap )) + RETURN_BAD_RESULT("Different mesh on corresponding out and in faces: " + << meshDS->ShapeToIndex( outFace ) << " and " + << meshDS->ShapeToIndex( inFace )); + // Create volumes + + SMDS_ElemIteratorPtr faceIt = meshDS->MeshElements( inFace )->GetElements(); + while ( faceIt->more() ) // loop on faces on inFace + { + const SMDS_MeshElement* face = faceIt->next(); + if ( !face || face->GetType() != SMDSAbs_Face ) + continue; + int nbNodes = face->NbNodes(); + if ( face->IsQuadratic() ) + nbNodes /= 2; + + // find node columns for each node + vector< const TNodeColumn* > columns( nbNodes ); + for ( int i = 0; i < nbNodes; ++i ) + { + const SMDS_MeshNode* n = face->GetNode( i ); + TNode2ColumnMap::iterator n_col = node2columnMap.find( n ); + if ( n_col != node2columnMap.end() ) + columns[ i ] = & n_col->second; + else + columns[ i ] = makeNodeColumn( node2columnMap, n, nodeIn2OutMap[ n ] ); + } + + StdMeshers_Prism_3D::AddPrisms( columns, myHelper ); + } + } // loop on faces of out shell + + return true; +} + +//================================================================================ +/*! + * \brief Create a column of nodes from outNode to inNode + * \param n2ColMap - map of node columns to add a created column + * \param outNode - botton node of a column + * \param inNode - top node of a column + * \retval const TNodeColumn* - a new column pointer + */ +//================================================================================ + +TNodeColumn* StdMeshers_RadialPrism_3D::makeNodeColumn( TNode2ColumnMap& n2ColMap, + const SMDS_MeshNode* outNode, + const SMDS_MeshNode* inNode) +{ + SMESHDS_Mesh * meshDS = myHelper->GetMeshDS(); + int shapeID = myHelper->GetSubShapeID(); + + if ( myLayerPositions.empty() ) + computeLayerPositions( gpXYZ( inNode ), gpXYZ( outNode )); + + int nbSegments = myLayerPositions.size() + 1; + + TNode2ColumnMap::iterator n_col = + n2ColMap.insert( make_pair( outNode, TNodeColumn() )).first; + TNodeColumn & column = n_col->second; + column.resize( nbSegments + 1 ); + column.front() = outNode; + column.back() = inNode; + + gp_XYZ p1 = gpXYZ( outNode ); + gp_XYZ p2 = gpXYZ( inNode ); + for ( int z = 1; z < nbSegments; ++z ) + { + double r = myLayerPositions[ z - 1 ]; + gp_XYZ p = ( 1 - r ) * p1 + r * p2; + SMDS_MeshNode* n = meshDS->AddNode( p.X(), p.Y(), p.Z() ); + meshDS->SetNodeInVolume( n, shapeID ); + column[ z ] = n; + } + + return & column; +} + +//================================================================================ +//================================================================================ +/*! + * \brief Class computing layers distribution using data of + * StdMeshers_LayerDistribution hypothesis + */ +//================================================================================ +//================================================================================ + +class TNodeDistributor: private StdMeshers_Regular_1D +{ + list myUsedHyps; +public: + // ----------------------------------------------------------------------------- + static TNodeDistributor* GetDistributor(SMESH_Mesh& aMesh) + { + const int myID = -1000; + map < int, SMESH_1D_Algo * > & algoMap = aMesh.GetGen()->_map1D_Algo; + map < int, SMESH_1D_Algo * >::iterator id_algo = algoMap.find( myID ); + if ( id_algo == algoMap.end() ) + return new TNodeDistributor( myID, 0, aMesh.GetGen() ); + return static_cast< TNodeDistributor* >( id_algo->second ); + } + // ----------------------------------------------------------------------------- + bool Compute( vector< double > & positions, + gp_Pnt pIn, + gp_Pnt pOut, + SMESH_Mesh& aMesh, + const StdMeshers_LayerDistribution* hyp) + { + double len = pIn.Distance( pOut ); + if ( len <= DBL_MIN ) RETURN_BAD_RESULT("Bad points"); + + if ( !hyp || !hyp->GetLayerDistribution() ) + RETURN_BAD_RESULT("Bad StdMeshers_LayerDistribution hypothesis"); + myUsedHyps.clear(); + myUsedHyps.push_back( hyp->GetLayerDistribution() ); + + TopoDS_Edge edge = BRepBuilderAPI_MakeEdge( pIn, pOut ); + + SMESH_Hypothesis::Hypothesis_Status aStatus; + if ( !StdMeshers_Regular_1D::CheckHypothesis( aMesh, edge, aStatus )) + RETURN_BAD_RESULT("StdMeshers_Regular_1D::CheckHypothesis() failed with status "< params; + if ( !StdMeshers_Regular_1D::computeInternalParameters( edge, params, false )) + RETURN_BAD_RESULT("StdMeshers_Regular_1D::computeInternalParameters() failed"); + + positions.clear(); + positions.reserve( params.size() ); + for (list::iterator itU = params.begin(); itU != params.end(); itU++) + positions.push_back( *itU / len ); + return true; + } +protected: + // ----------------------------------------------------------------------------- + TNodeDistributor( int hypId, int studyId, SMESH_Gen* gen) + : StdMeshers_Regular_1D( hypId, studyId, gen) + { + } + // ----------------------------------------------------------------------------- + virtual const list & + GetUsedHypothesis(SMESH_Mesh &, const TopoDS_Shape &, const bool) + { + return myUsedHyps; + } + // ----------------------------------------------------------------------------- +}; + +//================================================================================ +/*! + * \brief Compute positions of nodes between the internal and the external surfaces + * \retval bool - is a success + */ +//================================================================================ + +bool StdMeshers_RadialPrism_3D::computeLayerPositions(gp_Pnt pIn, gp_Pnt pOut) +{ + if ( myNbLayerHypo ) + { + int nbSegments = myNbLayerHypo->GetNumberOfLayers(); + myLayerPositions.resize( nbSegments - 1 ); + for ( int z = 1; z < nbSegments; ++z ) + myLayerPositions[ z - 1 ] = double( z )/ double( nbSegments ); + return true; + } + if ( myDistributionHypo ) { + SMESH_Mesh * mesh = myHelper->GetMesh(); + return TNodeDistributor::GetDistributor(*mesh)->Compute( myLayerPositions, pIn, pOut, + *mesh, myDistributionHypo ); + } + RETURN_BAD_RESULT("Bad hypothesis"); +} diff --git a/src/StdMeshers/StdMeshers_RadialPrism_3D.hxx b/src/StdMeshers/StdMeshers_RadialPrism_3D.hxx new file mode 100644 index 000000000..1fb6e8fdf --- /dev/null +++ b/src/StdMeshers/StdMeshers_RadialPrism_3D.hxx @@ -0,0 +1,72 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_RadialPrism_3D.hxx +// Module : SMESH + +#ifndef _SMESH_RadialPrism_3D_HXX_ +#define _SMESH_RadialPrism_3D_HXX_ + +#include "SMESH_StdMeshers.hxx" + +#include "SMESH_3D_Algo.hxx" +#include "SMDS_MeshNode.hxx" + +#include +#include + +class StdMeshers_NumberOfLayers; +class StdMeshers_LayerDistribution; +class SMESH_MesherHelper; + +class STDMESHERS_EXPORT StdMeshers_RadialPrism_3D: public SMESH_3D_Algo +{ +public: + StdMeshers_RadialPrism_3D(int hypId, int studyId, SMESH_Gen* gen); + virtual ~StdMeshers_RadialPrism_3D(); + + virtual bool CheckHypothesis(SMESH_Mesh& aMesh, + const TopoDS_Shape& aShape, + SMESH_Hypothesis::Hypothesis_Status& aStatus); + + virtual bool Compute(SMESH_Mesh& aMesh, const TopoDS_Shape& aShape); + +protected: + + typedef vector TNodeColumn; + typedef map< const SMDS_MeshNode*, TNodeColumn > TNode2ColumnMap; + + TNodeColumn* makeNodeColumn( TNode2ColumnMap& n2ColMap, + const SMDS_MeshNode* outNode, + const SMDS_MeshNode* inNode); + + bool computeLayerPositions(gp_Pnt pIn, gp_Pnt pOut); + + + const StdMeshers_NumberOfLayers* myNbLayerHypo; + const StdMeshers_LayerDistribution* myDistributionHypo; + SMESH_MesherHelper* myHelper; + vector< double > myLayerPositions; +}; + +#endif diff --git a/src/StdMeshers/StdMeshers_Regular_1D.cxx b/src/StdMeshers/StdMeshers_Regular_1D.cxx index d933aebbf..e7f45cd66 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.cxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.cxx @@ -27,8 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; - #include "StdMeshers_Regular_1D.hxx" #include "StdMeshers_Distribution.hxx" diff --git a/src/StdMeshers/StdMeshers_Regular_1D.hxx b/src/StdMeshers/StdMeshers_Regular_1D.hxx index b820df11b..c8a856d0b 100644 --- a/src/StdMeshers/StdMeshers_Regular_1D.hxx +++ b/src/StdMeshers/StdMeshers_Regular_1D.hxx @@ -30,11 +30,13 @@ #ifndef _SMESH_REGULAR_1D_HXX_ #define _SMESH_REGULAR_1D_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_1D_Algo.hxx" class TopoDS_Edge; -class StdMeshers_Regular_1D: +class STDMESHERS_EXPORT StdMeshers_Regular_1D: public SMESH_1D_Algo { public: diff --git a/src/StdMeshers/StdMeshers_StartEndLength.hxx b/src/StdMeshers/StdMeshers_StartEndLength.hxx index ea83724bc..c680b9802 100644 --- a/src/StdMeshers/StdMeshers_StartEndLength.hxx +++ b/src/StdMeshers/StdMeshers_StartEndLength.hxx @@ -28,10 +28,12 @@ #ifndef _STDMESHERS_STARTENDLENGTH_HXX_ #define _STDMESHERS_STARTENDLENGTH_HXX_ +#include "SMESH_StdMeshers.hxx" + #include "SMESH_Hypothesis.hxx" #include "Utils_SALOME_Exception.hxx" -class StdMeshers_StartEndLength:public SMESH_Hypothesis +class STDMESHERS_EXPORT StdMeshers_StartEndLength:public SMESH_Hypothesis { public: StdMeshers_StartEndLength(int hypId, int studyId, SMESH_Gen * gen); diff --git a/src/StdMeshersGUI/Makefile.in b/src/StdMeshersGUI/Makefile.in index 5d7689351..d84f17c24 100644 --- a/src/StdMeshersGUI/Makefile.in +++ b/src/StdMeshersGUI/Makefile.in @@ -44,13 +44,17 @@ LIB_SRC = \ StdMeshersGUI_StdHypothesisCreator.cxx \ StdMeshersGUI_DistrPreview.cxx \ StdMeshersGUI_DistrTable.cxx \ - StdMeshersGUI_NbSegmentsCreator.cxx + StdMeshersGUI_NbSegmentsCreator.cxx \ + StdMeshersGUI_ObjectReferenceParamWdg.cxx \ + StdMeshersGUI_LayerDistributionParamWdg.cxx LIB_MOC = \ StdMeshersGUI_StdHypothesisCreator.h \ StdMeshersGUI_DistrPreview.h \ StdMeshersGUI_DistrTable.h \ - StdMeshersGUI_NbSegmentsCreator.h + StdMeshersGUI_NbSegmentsCreator.h \ + StdMeshersGUI_ObjectReferenceParamWdg.h \ + StdMeshersGUI_LayerDistributionParamWdg.h EXPORT_HEADERS = StdMeshersGUI_StdHypothesisCreator.h diff --git a/src/StdMeshersGUI/SMESH_StdMeshersGUI.hxx b/src/StdMeshersGUI/SMESH_StdMeshersGUI.hxx new file mode 100755 index 000000000..67b4638c6 --- /dev/null +++ b/src/StdMeshersGUI/SMESH_StdMeshersGUI.hxx @@ -0,0 +1,40 @@ +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESH_StdMeshersGUI.hxx +// Author : Alexander BORODIN +// Module : SMESH +// $Header: + +#ifndef _SMESH_StdMeshersGUI_HXX_ +#define _SMESH_StdMeshersGUI_HXX_ + +#ifdef WNT + #if defined STDMESHERSGUI_EXPORTS + #define STDMESHERSGUI_EXPORT __declspec( dllexport ) + #else + #define STDMESHERSGUI_EXPORT __declspec( dllimport ) + #endif +#else + #define STDMESHERSGUI_EXPORT +#endif + +#endif \ No newline at end of file diff --git a/src/StdMeshersGUI/StdMeshersGUI.cxx b/src/StdMeshersGUI/StdMeshersGUI.cxx index 8de790658..589a487df 100644 --- a/src/StdMeshersGUI/StdMeshersGUI.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI.cxx @@ -28,6 +28,7 @@ #include "StdMeshersGUI_StdHypothesisCreator.h" #include "StdMeshersGUI_NbSegmentsCreator.h" + //============================================================================= /*! GetHypothesisCreator * @@ -35,6 +36,7 @@ //============================================================================= extern "C" { + STDMESHERSGUI_EXPORT SMESHGUI_GenericHypothesisCreator* GetHypothesisCreator( const QString& aHypType ) { if( aHypType=="NumberOfSegments" ) diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.h b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.h index b1401ba86..ef230ccb3 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.h +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrPreview.h @@ -21,6 +21,8 @@ #ifndef STD_MESHERS_GUI_DISTR_PREVIEW_HEADER #define STD_MESHERS_GUI_DISTR_PREVIEW_HEADER +#include "SMESH_StdMeshersGUI.hxx" + #include #include #include CORBA_SERVER_HEADER(SMESH_Mesh) @@ -29,7 +31,7 @@ #include #include -class StdMeshersGUI_DistrPreview : public QwtPlot +class STDMESHERSGUI_EXPORT StdMeshersGUI_DistrPreview : public QwtPlot { Q_OBJECT diff --git a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h index 39cb7448f..a61db1577 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h +++ b/src/StdMeshersGUI/StdMeshersGUI_DistrTable.h @@ -28,6 +28,8 @@ #ifndef StdMesherGUI_DistrTable_Header #define StdMesherGUI_DistrTable_Header +#include "SMESH_StdMeshersGUI.hxx" + #include #include @@ -45,7 +47,7 @@ typedef enum { INSERT_ROW, REMOVE_ROW } TableButton; * \brief This class represents custom table. It has only double values and editor for every cell has validator */ -class StdMeshersGUI_DistrTable : public QTable +class STDMESHERSGUI_EXPORT StdMeshersGUI_DistrTable : public QTable { Q_OBJECT @@ -86,7 +88,7 @@ private: /*! * \brief This class represents frame for table and buttons */ -class StdMeshersGUI_DistrTableFrame : public QFrame +class STDMESHERSGUI_EXPORT StdMeshersGUI_DistrTableFrame : public QFrame { Q_OBJECT diff --git a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx new file mode 100644 index 000000000..7537e621b --- /dev/null +++ b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.cxx @@ -0,0 +1,213 @@ +// SMESH StdMeshersGUI +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshersGUI_LayerDistributionParamWdg.cxx +// Module : SMESH + +#include "StdMeshersGUI_LayerDistributionParamWdg.h" + +#include +#include +#include +#include + +#include "SMESHGUI.h" +#include "SMESHGUI_Utils.h" +#include "SMESHGUI_HypothesesUtils.h" +#include "SMESHGUI_Hypotheses.h" +// #include "SUIT_ResourceMgr.h" +// #include "LightApp_SelectionMgr.h" +#include "SALOMEDSClient_SObject.hxx" +#include "SALOMEDS_Study.hxx" +#include "SalomeApp_Tools.h" + +//================================================================================ +/*! + * \brief Constructor initialized by filter + * \param f - object filter + */ +//================================================================================ + +StdMeshersGUI_LayerDistributionParamWdg::StdMeshersGUI_LayerDistributionParamWdg +( SMESH::SMESH_Hypothesis_ptr hyp, + QDialog* dlg ): QHGroupBox(), myDlg( dlg ) +{ + init(); + set( hyp ); +// if ( IsOk() ) +// onEdit(); +} + +//================================================================================ +/*! + * \brief initialize fields with hypothesis + * \param hyp - hypothesis + */ +//================================================================================ + +void StdMeshersGUI_LayerDistributionParamWdg::set(SMESH::SMESH_Hypothesis_ptr hyp) +{ + myHyp = SMESH::SMESH_Hypothesis::_nil(); + if ( !CORBA::is_nil( hyp )) { + myHyp = SMESH::SMESH_Hypothesis::_duplicate( hyp ); + myEditButton->setEnabled( true ); + myCreateButton->setText( tr("CHANGE_TYPE")); + myParamValue = hyp->GetName(); + } + else { + myEditButton->setEnabled( false ); + myCreateButton->setText( tr("CREATE")); + myParamValue = ""; + } +} + +//================================================================================ +/*! + * \brief Destructor + */ +//================================================================================ + +StdMeshersGUI_LayerDistributionParamWdg::~StdMeshersGUI_LayerDistributionParamWdg() +{ + if ( myHypTypePopup ) + delete myHypTypePopup; +} + +//================================================================================ +/*! + * \brief Create a leayout, initialize fields + */ +//================================================================================ + +void StdMeshersGUI_LayerDistributionParamWdg::init() +{ + setFrameStyle(QFrame::NoFrame); + setInsideMargin(0); + + mySMESHGUI = SMESHGUI::GetSMESHGUI(); + + myCreateButton = new QPushButton( this, "createBut"); + myEditButton = new QPushButton( tr("EDIT"), this, "createBut"); + +// SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); +// QPixmap iconSlct ( mgr->loadPixmap("SMESH", tr("ICON_SELECT"))); +// mySelButton->setPixmap(iconSlct); +// mySelButton->setToggleButton( true ); + + myHypTypePopup = new QPopupMenu(); + + // Add to pop-up hypotheses of "Regular_1D" algo + myHypTypePopup->clear(); + HypothesisData* algoData = SMESH::GetHypothesisData( "Regular_1D" ); + myHypTypes = SMESH::GetAvailableHypotheses( false, 0 ); + QStringList::const_iterator anIter = myHypTypes.begin(); + for ( ; anIter != myHypTypes.end(); ++anIter ) + { + HypothesisData* hypData = SMESH::GetHypothesisData( *anIter ); + bool bidon; + if ( SMESH::IsAvailableHypothesis( algoData, hypData->TypeName, bidon )) + myHypTypePopup->insertItem( hypData->Label ); + } + + connect( myCreateButton, SIGNAL(clicked()), SLOT(onCreate())); + connect( myEditButton, SIGNAL(clicked()), SLOT(onEdit())); + connect( myHypTypePopup, SIGNAL( activated( int ) ), SLOT( onHypTypePopup( int ) ) ); +} + +//================================================================================ +/*! + * \brief Create a new hyp of selected type + * \param int - selected type index + */ +//================================================================================ + +void StdMeshersGUI_LayerDistributionParamWdg::onHypTypePopup( int theIndex ) +{ + SMESH::SMESH_Gen_var gen = mySMESHGUI->GetSMESHGen(); + + // avoid publishing a new 1D hyp + gen->SetCurrentStudy( SALOMEDS::Study::_nil() ); + + // create a hyp + HypothesisData* aHypData = 0; + QStringList::const_iterator anIter = myHypTypes.begin(); + for ( ; !aHypData && anIter != myHypTypes.end(); ++anIter ) + { + HypothesisData* hypData = SMESH::GetHypothesisData( *anIter ); + if ( myHypTypePopup->text( theIndex ) == hypData->Label ) + aHypData = hypData; + } + QString aServLib = aHypData->ServerLibName; + QString aHypType = aHypData->TypeName; + try { + set( gen->CreateHypothesis(aHypType, aServLib)); + } + catch (const SALOME::SALOME_Exception & S_ex) { + SalomeApp_Tools::QtCatchCorbaException(S_ex); + } + + // restore current study + mySMESHGUI->GetSMESHGen(); + + onEdit(); +} + +//================================================================================ +/*! + * \brief Show popup with available types + */ +//================================================================================ + +void StdMeshersGUI_LayerDistributionParamWdg::onCreate() +{ + myHypTypePopup->exec( QCursor::pos() ); +} + +//================================================================================ +/*! + * \brief Edit hypothesis + */ +//================================================================================ + +void StdMeshersGUI_LayerDistributionParamWdg::onEdit() +{ + if ( myHyp->_is_nil() ) + return; + + CORBA::String_var hypType = myHyp->GetName(); + SMESHGUI_GenericHypothesisCreator* + editor = SMESH::GetHypothesisCreator( hypType.in() ); + if ( !editor ) return; + + if ( myDlg ) myDlg->hide(); + + try { + QWidget* parent = this; + if ( myDlg ) parent = myDlg->parentWidget(); + editor->edit( myHyp, parent ); + } + catch(...) { + } + + if ( myDlg ) myDlg->show(); +} diff --git a/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.h b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.h new file mode 100644 index 000000000..cc8d7d801 --- /dev/null +++ b/src/StdMeshersGUI/StdMeshersGUI_LayerDistributionParamWdg.h @@ -0,0 +1,85 @@ +// SMESH StdMeshersGUI +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshersGUI_LayerDistributionParamWdg.h +// Module : SMESH +// $Header$ + +#ifndef StdMeshersGUI_LayerDistributionParamWdg_Header +#define StdMeshersGUI_LayerDistributionParamWdg_Header + +#include "SMESH_StdMeshersGUI.hxx" + +#include +#include + +#include +#include CORBA_SERVER_HEADER(SMESH_Hypothesis) + +class SMESHGUI; +class QPushButton; +class QPopupMenu; +class QDialog; + +/*! + * \brief Widget controlling hypothesis parameter that is another hypothesis + */ +class STDMESHERSGUI_EXPORT StdMeshersGUI_LayerDistributionParamWdg : public QHGroupBox +{ + Q_OBJECT + +public: + StdMeshersGUI_LayerDistributionParamWdg(SMESH::SMESH_Hypothesis_ptr hyp, + QDialog* dlg); + ~StdMeshersGUI_LayerDistributionParamWdg(); + + SMESH::SMESH_Hypothesis_var GetHypothesis() { return myHyp; } + + QString GetValue() const { return myParamValue; } + + bool IsOk() const { return !myHyp->_is_nil(); } + +private slots: + void onCreate(); + void onEdit(); + void onHypTypePopup( int ); + +private: + void init(); + void set(SMESH::SMESH_Hypothesis_ptr hyp); + +private: + SMESH::SMESH_Hypothesis_var myHyp; + SMESHGUI* mySMESHGUI; + + QPushButton* myCreateButton; + QPushButton* myEditButton; + QPopupMenu* myHypTypePopup; + QDialog* myDlg; + QString myParamValue; + + QStringList myHypTypes; +}; + +#endif + diff --git a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h index f1ec2298c..7002e032e 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h +++ b/src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h @@ -21,6 +21,8 @@ #ifndef NB_SEGMENTS_CREATOR_HEADER #define NB_SEGMENTS_CREATOR_HEADER +#include "SMESH_StdMeshersGUI.hxx" + #include "StdMeshersGUI_StdHypothesisCreator.h" #include @@ -45,7 +47,7 @@ typedef struct } NbSegmentsHypothesisData; -class StdMeshersGUI_NbSegmentsCreator : public StdMeshersGUI_StdHypothesisCreator +class STDMESHERSGUI_EXPORT StdMeshersGUI_NbSegmentsCreator : public StdMeshersGUI_StdHypothesisCreator { Q_OBJECT diff --git a/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.cxx b/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.cxx new file mode 100644 index 000000000..85ec4d6b4 --- /dev/null +++ b/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.cxx @@ -0,0 +1,206 @@ +// SMESH StdMeshersGUI +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshersGUI_ObjectReferenceParamWdg.cxx +// Module : SMESH + +#include "StdMeshersGUI_ObjectReferenceParamWdg.h" + +#include +#include +#include + +#include "SMESHGUI.h" +#include "SMESHGUI_Utils.h" +#include "SMESHGUI_VTKUtils.h" +#include "SMESH_TypeFilter.hxx" +#include "SUIT_ResourceMgr.h" +#include "LightApp_SelectionMgr.h" +#include "SVTK_ViewWindow.h" +#include "SALOME_ListIO.hxx" +#include "SALOMEDSClient_SObject.hxx" + +//================================================================================ +/*! + * \brief Constructor initialized by filter + * \param f - object filter + */ +//================================================================================ + +StdMeshersGUI_ObjectReferenceParamWdg::StdMeshersGUI_ObjectReferenceParamWdg +( SUIT_SelectionFilter* f, QWidget* parent) + : QHGroupBox( parent ) +{ + myFilter = f; + init(); +} + +//================================================================================ +/*! + * \brief Constructor initialized by object type + * \param MeshObjectType - type of object to select + */ +//================================================================================ + +StdMeshersGUI_ObjectReferenceParamWdg::StdMeshersGUI_ObjectReferenceParamWdg +( MeshObjectType objType, QWidget* parent ) + : QHGroupBox( parent ) +{ + myFilter = new SMESH_TypeFilter( objType ); + init(); +} +//================================================================================ +/*! + * \brief Destructor + */ +//================================================================================ + +StdMeshersGUI_ObjectReferenceParamWdg::~StdMeshersGUI_ObjectReferenceParamWdg() +{ + if ( myFilter ) + delete myFilter; +} + + +//================================================================================ +/*! + * \brief Create a leayout, initialize fields + */ +//================================================================================ + +void StdMeshersGUI_ObjectReferenceParamWdg::init() +{ + setFrameStyle(QFrame::NoFrame); + setInsideMargin(0); + + mySMESHGUI = SMESHGUI::GetSMESHGUI(); + mySelectionMgr = SMESH::GetSelectionMgr( mySMESHGUI ); + mySelectionActivated = false; + myParamValue = ""; + + SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); + QPixmap iconSlct ( mgr->loadPixmap("SMESH", tr("ICON_SELECT"))); + + mySelButton = new QPushButton(this); + mySelButton->setPixmap(iconSlct); + mySelButton->setToggleButton( true ); + + myObjNameLineEdit = new QLineEdit(this); + myObjNameLineEdit->setReadOnly(true); + + connect( mySelButton, SIGNAL(clicked()), SLOT(activateSelection())); +} + +//================================================================================ +/*! + * \brief SLOT: Installs selection filter that is not done automatically + */ +//================================================================================ + +void StdMeshersGUI_ObjectReferenceParamWdg::activateSelection() +{ + if ( !mySelectionActivated && mySelectionMgr ) + { + mySelectionActivated = true; + mySelectionMgr->clearFilters(); + if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI )) + aViewWindow->SetSelectionMode(ActorSelection); + if ( myFilter ) + mySelectionMgr->installFilter( myFilter ); + connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone())); + } + emit selectionActivated(); + + mySelButton->setOn( mySelectionActivated ); +} + +//================================================================================ +/*! + * \brief SLOT: stop treating selection changes + */ +//================================================================================ + +void StdMeshersGUI_ObjectReferenceParamWdg::deactivateSelection() +{ + mySelectionActivated = false; + disconnect(mySelectionMgr, 0, this, 0 ); + mySelectionMgr->removeFilter( myFilter ); + + mySelButton->setOn( mySelectionActivated ); +} + +//================================================================================ +/*! + * \brief Connect selection slots + * \param other - another StdMeshersGUI_ObjectReferenceParamWdg + */ +//================================================================================ + +void StdMeshersGUI_ObjectReferenceParamWdg::AvoidSimultaneousSelection + ( StdMeshersGUI_ObjectReferenceParamWdg* other) +{ + connect(other, SIGNAL(selectionActivated()), this, SLOT(deactivateSelection())); + connect(this, SIGNAL(selectionActivated()), other, SLOT(deactivateSelection())); +} + +//================================================================================ +/*! + * \brief Initialize selected object name + * \param obj - the current object + */ +//================================================================================ + +void StdMeshersGUI_ObjectReferenceParamWdg::SetObject(CORBA::Object_ptr obj) +{ + myObject = CORBA::Object::_nil(); + myObjNameLineEdit->setText( "" ); + myParamValue = ""; + + _PTR(SObject) sobj; + if ( !CORBA::is_nil( obj )) + sobj = SMESH::FindSObject (obj); + if ( sobj ) { + string name = sobj->GetName(); + myObjNameLineEdit->setText( name.c_str() ); + myObject = CORBA::Object::_duplicate( obj ); + myParamValue = sobj->GetID(); + } +} + +//================================================================================ +/*! + * \brief Takes selected object + */ +//================================================================================ + +void StdMeshersGUI_ObjectReferenceParamWdg::onSelectionDone() +{ + if ( mySelectionActivated ) { + CORBA::Object_var obj; + SALOME_ListIO aList; + mySelectionMgr->selectedObjects(aList); + if (aList.Extent() == 1) + obj = SMESH::IObjectToObject( aList.First() ); + SetObject( obj.in() ); + } +} diff --git a/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.h b/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.h new file mode 100644 index 000000000..e2b892f79 --- /dev/null +++ b/src/StdMeshersGUI/StdMeshersGUI_ObjectReferenceParamWdg.h @@ -0,0 +1,111 @@ +// SMESH StdMeshersGUI +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshersGUI_ObjectReferenceParamWdg.h +// Module : SMESH +// $Header$ + +#ifndef StdMeshersGUI_ObjectReferenceParamWdg_Header +#define StdMeshersGUI_ObjectReferenceParamWdg_Header + +#include "SMESH_StdMeshersGUI.hxx" + +#include "SMESH_Type.h" +#include "qhgroupbox.h" + +#include + +class SUIT_SelectionFilter; +class SMESHGUI; +class LightApp_SelectionMgr; +class QLineEdit; +class QPushButton; + +/*! + * \brief Widget controlling hypothesis parameter that is an object reference + */ +class STDMESHERSGUI_EXPORT StdMeshersGUI_ObjectReferenceParamWdg : public QHGroupBox +{ + Q_OBJECT + +public: + StdMeshersGUI_ObjectReferenceParamWdg( SUIT_SelectionFilter* filter, + QWidget* parent); + StdMeshersGUI_ObjectReferenceParamWdg( MeshObjectType objType, + QWidget* parent); + ~StdMeshersGUI_ObjectReferenceParamWdg(); + + void SetObject(CORBA::Object_ptr obj); + + template + typename TInterface::_var_type GetObject() const { + if ( IsObjectSelected() ) return TInterface::_narrow(myObject); + return TInterface::_nil(); + } + + QString GetValue() const { return myParamValue; } + + bool IsObjectSelected() const { return !CORBA::is_nil(myObject); } + + void AvoidSimultaneousSelection( StdMeshersGUI_ObjectReferenceParamWdg* other); + +public slots: + /*! + * \brief Activates selection (if not yet done), emits selectionActivated() + * + * Useful to deactivate one Object Reference param widget when an other + * one is activated + */ + void activateSelection(); + void deactivateSelection(); + +signals: + /*! + * \brief Emitted when selection is activated + * + * Useful to deactivate one Object Reference param widget when an other + * one is activated + */ + void selectionActivated(); + +private slots: + void onSelectionDone(); + +private: + void init(); + +private: + CORBA::Object_var myObject; + SUIT_SelectionFilter* myFilter; + bool mySelectionActivated; + + SMESHGUI* mySMESHGUI; + LightApp_SelectionMgr* mySelectionMgr; + + QLineEdit* myObjNameLineEdit; + QPushButton* mySelButton; + QString myParamValue; +}; + +#endif + diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx index e90634cf7..76a946c65 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx @@ -27,12 +27,16 @@ #include "StdMeshersGUI_StdHypothesisCreator.h" -#include -#include -#include -#include +#include "SMESHGUI.h" +#include "SMESHGUI_SpinBox.h" +#include "SMESHGUI_HypothesesUtils.h" +#include "SMESHGUI_Utils.h" +#include "SMESH_TypeFilter.hxx" +#include "SMESH_NumberFilter.hxx" +#include "StdMeshersGUI_ObjectReferenceParamWdg.h" +#include "StdMeshersGUI_LayerDistributionParamWdg.h" -#include +#include "SUIT_ResourceMgr.h" #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -51,30 +55,311 @@ const double VALUE_MAX = 1.0e+15, // COORD_MAX VALUE_SMALL_2 = VALUE_SMALL * VALUE_SMALL, VALUE_SMALL_3 = VALUE_SMALL_2 * VALUE_SMALL; +//================================================================================ +/*! + * \brief Constructor + * \param type - hypothesis type + */ +//================================================================================ + StdMeshersGUI_StdHypothesisCreator::StdMeshersGUI_StdHypothesisCreator( const QString& type ) : SMESHGUI_GenericHypothesisCreator( type ) { } +//================================================================================ +/*! + * \brief Destructor + */ +//================================================================================ + StdMeshersGUI_StdHypothesisCreator::~StdMeshersGUI_StdHypothesisCreator() { } +//================================================================================ +/*! + * \brief Return widget for i-th hypothesis parameter (got from myParamWidgets) + * \param i - index of hypothesis parameter + * \retval QWidget* - found widget + */ +//================================================================================ + +QWidget* StdMeshersGUI_StdHypothesisCreator::getWidgetForParam( int i ) const +{ + QWidget* w = 0; + if ( isCreation() ) ++i; // skip widget of 'name' parameter + + if ( i < myCustomWidgets.count() ) { + QPtrList::const_iterator anIt = myCustomWidgets.begin(); + QPtrList::const_iterator aLast = myCustomWidgets.end(); + for ( int j = 0 ; !w && anIt != aLast; ++anIt ) + if ( i == j ) + w = *anIt; + } + if ( !w ) { + // list has no at() const, so we iterate + QPtrList::const_iterator anIt = widgets().begin(); + QPtrList::const_iterator aLast = widgets().end(); + for( int j = 0; !w && anIt!=aLast; anIt++, ++j ) { + if ( i == j ) + w = *anIt; + } + } + return w; +} + +//================================================================================ +/*! + * \brief Allow modifing myCustomWidgets in const methods + * \retval ListOfWidgets* - non-const pointer to myCustomWidgets + */ +//================================================================================ + +StdMeshersGUI_StdHypothesisCreator::ListOfWidgets* +StdMeshersGUI_StdHypothesisCreator::customWidgets() const +{ + return const_cast< ListOfWidgets* >( & myCustomWidgets ); +} + +//================================================================================ +/*! + * \brief Builds dlg layout + * \retval QFrame* - the built widget + */ +//================================================================================ + QFrame* StdMeshersGUI_StdHypothesisCreator::buildFrame() { return buildStdFrame(); } -bool StdMeshersGUI_StdHypothesisCreator::checkParams() const +//================================================================================ +/*! + * \brief Initialise parameter values in controls + */ +//================================================================================ + +void StdMeshersGUI_StdHypothesisCreator::retrieveParams() const { - return true; + // buildStdFrame() sets values itself calling stdParams() + + if ( hypType().startsWith("ProjectionSource" )) + { + // we use this method to connect depending custom widgets + StdMeshersGUI_ObjectReferenceParamWdg* widgetToActivate = 0; + ListOfWidgets::const_iterator anIt = myCustomWidgets.begin(); + for ( ; anIt != myCustomWidgets.end(); anIt++) + { + if ( *anIt && (*anIt)->inherits("StdMeshersGUI_ObjectReferenceParamWdg")) + { + StdMeshersGUI_ObjectReferenceParamWdg * w1 = + ( StdMeshersGUI_ObjectReferenceParamWdg* ) ( *anIt ); + ListOfWidgets::const_iterator anIt2 = anIt; + for ( ++anIt2; anIt2 != myCustomWidgets.end(); anIt2++) + if ( *anIt2 && (*anIt2)->inherits("StdMeshersGUI_ObjectReferenceParamWdg")) + { + StdMeshersGUI_ObjectReferenceParamWdg * w2 = + ( StdMeshersGUI_ObjectReferenceParamWdg* ) ( *anIt2 ); + w1->AvoidSimultaneousSelection( w2 ); + } + if ( !widgetToActivate ) + widgetToActivate = w1; + } + } + if ( widgetToActivate ) + widgetToActivate->activateSelection(); + } } -void StdMeshersGUI_StdHypothesisCreator::retrieveParams() const +//================================================================================ +/*! + * \brief Widget: slider with left and right labels + */ +//================================================================================ + +class TDoubleSliderWith2Lables: public QHBox +{ +public: + TDoubleSliderWith2Lables( const QString& leftLabel, const QString& rightLabel, + const double initValue, const double bottom, + const double top , const double precision, + QWidget * parent=0 , const char * name=0 ) + :QHBox(parent,name), _bottom(bottom), _precision(precision) + { + if ( !leftLabel.isEmpty() ) (new QLabel( this ))->setText( leftLabel ); + _slider = new QSlider( Horizontal, this ); + _slider->setRange( 0, toInt( top )); + _slider->setValue( toInt( initValue )); + if ( !rightLabel.isEmpty() ) (new QLabel( this ))->setText( rightLabel ); + } + double value() const { return _bottom + _slider->value() * _precision; } + QSlider * getSlider() const { return _slider; } + int toInt( double val ) const { return (int) ceil(( val - _bottom ) / _precision ); } +private: + double _bottom, _precision; + QSlider * _slider; +}; + +namespace { + + //================================================================================ + /*! + * \brief Retrieve GEOM_Object held by widget + */ + //================================================================================ + + inline GEOM::GEOM_Object_var geomFromWdg(const QWidget* wdg) + { + const StdMeshersGUI_ObjectReferenceParamWdg * objRefWdg = + dynamic_cast( wdg ); + if ( objRefWdg ) + return objRefWdg->GetObject< GEOM::GEOM_Object >(); + + return GEOM::GEOM_Object::_nil(); + } + //================================================================================ + /*! + * \brief Retrieve SMESH_Mesh held by widget + */ + //================================================================================ + + inline SMESH::SMESH_Mesh_var meshFromWdg(const QWidget* wdg) + { + const StdMeshersGUI_ObjectReferenceParamWdg * objRefWdg = + dynamic_cast( wdg ); + if ( objRefWdg ) + return objRefWdg->GetObject< SMESH::SMESH_Mesh >(); + + return SMESH::SMESH_Mesh::_nil(); + } + //================================================================================ + /*! + * \brief creates a filter for selection of shapes of given dimension + * \param dim - dimension + * \param subShapeType - required type of subshapes, number of which must be \a nbSubShapes + * \param nbSubShapes - number of subshapes of given type + * \param closed - required closeness flag of a shape + * \retval SUIT_SelectionFilter* - created filter + */ + //================================================================================ + + SUIT_SelectionFilter* filterForShapeOfDim(const int dim, + const int nbSubShapes = 0, + const TopAbs_ShapeEnum subShapeType = TopAbs_SHAPE, + const bool closed = false) + { + TColStd_MapOfInteger shapeTypes; + switch ( dim ) { + case 0: shapeTypes.Add( TopAbs_VERTEX ); break; + case 1: shapeTypes.Add( TopAbs_EDGE ); break; + case 2: shapeTypes.Add( TopAbs_FACE ); break; + case 3: + shapeTypes.Add( TopAbs_SHELL ); + shapeTypes.Add( TopAbs_SOLID ); + shapeTypes.Add( TopAbs_COMPSOLID ); + shapeTypes.Add( TopAbs_COMPOUND ); + break; + } + return new SMESH_NumberFilter("GEOM", subShapeType, nbSubShapes, + shapeTypes, GEOM::GEOM_Object::_nil(), closed); + } + + //================================================================================ + /*! + * \brief Create a widget for object selection + * \param object - initial object + * \param filter - selection filter + * \retval QWidget* - created widget + */ + //================================================================================ + + QWidget* newObjRefParamWdg( SUIT_SelectionFilter* filter, + CORBA::Object_var object) + { + StdMeshersGUI_ObjectReferenceParamWdg* w = + new StdMeshersGUI_ObjectReferenceParamWdg( filter, 0); + w->SetObject( object.in() ); + return w; + } + + //================================================================================ + /*! + * \brief calls deactivateSelection() for StdMeshersGUI_ObjectReferenceParamWdg + * \param widgetList - list of widgets + */ + //================================================================================ + + void deactivateObjRefParamWdg( QPtrList* widgetList ) + { + StdMeshersGUI_ObjectReferenceParamWdg* w = 0; + QPtrList::iterator anIt = widgetList->begin(); + QPtrList::iterator aLast = widgetList->end(); + for ( ; anIt != aLast; anIt++ ) { + if ( (*anIt) && (*anIt)->inherits( "StdMeshersGUI_ObjectReferenceParamWdg" )) + { + w = (StdMeshersGUI_ObjectReferenceParamWdg* )( *anIt ); + w->deactivateSelection(); + } + } + } +} + +//================================================================================ +/*! + * \brief Check parameter values before accept() + * \retval bool - true if OK + */ +//================================================================================ + +bool StdMeshersGUI_StdHypothesisCreator::checkParams() const { - //here this method must be empty because buildStdParam sets values itself + // check if object reference parameter is set, as it has no default value + bool ok = true; + if ( hypType().startsWith("ProjectionSource" )) + { + StdMeshersGUI_ObjectReferenceParamWdg* w = + widget< StdMeshersGUI_ObjectReferenceParamWdg >( 0 ); + ok = ( w->IsObjectSelected() ); + if ( !ok ) w->SetObject( CORBA::Object::_nil() ); + int nbAssocVert = ( hypType() == "ProjectionSource1D" ? 1 : 2 ); + for ( int i = 0; ok && i < nbAssocVert; i += 2) + { + QString srcV, tgtV; + StdMeshersGUI_ObjectReferenceParamWdg* w1 = + widget< StdMeshersGUI_ObjectReferenceParamWdg >( i+2 ); + StdMeshersGUI_ObjectReferenceParamWdg* w2 = + widget< StdMeshersGUI_ObjectReferenceParamWdg >( i+3 ); + srcV = w1->GetValue(); + tgtV = w2->GetValue(); + ok = (( srcV.isEmpty() && tgtV.isEmpty() ) || + ( !srcV.isEmpty() && !tgtV.isEmpty() && srcV != tgtV )); + if ( !ok ) { + w1->SetObject( CORBA::Object::_nil() ); + w2->SetObject( CORBA::Object::_nil() ); + } + } + + // Uninstall filters of StdMeshersGUI_ObjectReferenceParamWdg + if ( ok ) + deactivateObjRefParamWdg( customWidgets() ); + } + else if ( hypType() == "LayerDistribution" ) + { + StdMeshersGUI_LayerDistributionParamWdg* w = + widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 ); + ok = ( w && w->IsOk() ); + } + return ok; } +//================================================================================ +/*! + * \brief Store params from GUI controls to a hypothesis + * \retval QString - text representation of parameters + */ +//================================================================================ + QString StdMeshersGUI_StdHypothesisCreator::storeParams() const { ListOfStdParams params; @@ -140,22 +425,89 @@ QString StdMeshersGUI_StdHypothesisCreator::storeParams() const h->SetFineness( params[0].myValue.toDouble() ); } + else if( hypType()=="NumberOfLayers" ) + { + StdMeshers::StdMeshers_NumberOfLayers_var h = + StdMeshers::StdMeshers_NumberOfLayers::_narrow( hypothesis() ); + + h->SetNumberOfLayers( params[0].myValue.toInt() ); + } + else if( hypType()=="LayerDistribution" ) + { + StdMeshers::StdMeshers_LayerDistribution_var h = + StdMeshers::StdMeshers_LayerDistribution::_narrow( hypothesis() ); + StdMeshersGUI_LayerDistributionParamWdg* w = + widget< StdMeshersGUI_LayerDistributionParamWdg >( 0 ); + + h->SetLayerDistribution( w->GetHypothesis() ); + } + else if( hypType()=="ProjectionSource1D" ) + { + StdMeshers::StdMeshers_ProjectionSource1D_var h = + StdMeshers::StdMeshers_ProjectionSource1D::_narrow( hypothesis() ); + + h->SetSourceEdge ( geomFromWdg ( getWidgetForParam( 0 ))); + h->SetSourceMesh ( meshFromWdg ( getWidgetForParam( 1 ))); + h->SetVertexAssociation( geomFromWdg ( getWidgetForParam( 2 )), + geomFromWdg ( getWidgetForParam( 3 ))); + } + else if( hypType()=="ProjectionSource2D" ) + { + StdMeshers::StdMeshers_ProjectionSource2D_var h = + StdMeshers::StdMeshers_ProjectionSource2D::_narrow( hypothesis() ); + + h->SetSourceFace ( geomFromWdg ( getWidgetForParam( 0 ))); + h->SetSourceMesh ( meshFromWdg ( getWidgetForParam( 1 ))); + h->SetVertexAssociation( geomFromWdg ( getWidgetForParam( 2 )), // src1 + geomFromWdg ( getWidgetForParam( 4 )), // src2 + geomFromWdg ( getWidgetForParam( 3 )), // tgt1 + geomFromWdg ( getWidgetForParam( 5 ))); // tgt2 + } + else if( hypType()=="ProjectionSource3D" ) + { + StdMeshers::StdMeshers_ProjectionSource3D_var h = + StdMeshers::StdMeshers_ProjectionSource3D::_narrow( hypothesis() ); + + h->SetSource3DShape ( geomFromWdg ( getWidgetForParam( 0 ))); + h->SetSourceMesh ( meshFromWdg ( getWidgetForParam( 1 ))); + h->SetVertexAssociation( geomFromWdg ( getWidgetForParam( 2 )), // src1 + geomFromWdg ( getWidgetForParam( 4 )), // src2 + geomFromWdg ( getWidgetForParam( 3 )), // tgt1 + geomFromWdg ( getWidgetForParam( 5 ))); // tgt2 + } } return valueStr; } +//================================================================================ +/*! + * \brief Return parameter values as SMESHGUI_GenericHypothesisCreator::StdParam + * \param p - list of parameters + * \retval bool - success flag + * + * Is called from SMESHGUI_GenericHypothesisCreator::buildStdFrame(). + * Parameters will be shown using "standard" controls: + * Int by QtxIntSpinBox + * Double by SMESHGUI_SpinBox + * String by QLineEdit + * getCustomWidget() allows to redefine control for a parameter + */ +//================================================================================ + bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const { bool res = true; SMESHGUI_GenericHypothesisCreator::StdParam item; p.clear(); + customWidgets()->clear(); if( isCreation() ) { HypothesisData* data = SMESH::GetHypothesisData( hypType() ); item.myName = tr( "SMESH_NAME" ); item.myValue = data ? data->Label : QString(); p.append( item ); + customWidgets()->append(0); } SMESH::SMESH_Hypothesis_var hyp = initParamsHypothesis(); @@ -226,14 +578,108 @@ bool StdMeshersGUI_StdHypothesisCreator::stdParams( ListOfStdParams& p ) const StdMeshers::StdMeshers_AutomaticLength::_narrow( hyp ); item.myName = tr( "SMESH_FINENESS_PARAM" ); - item.myValue = h->GetFineness(); + //item.myValue = h->GetFineness(); p.append( item ); + customWidgets()->append + ( new TDoubleSliderWith2Lables( "0 ", " 1", h->GetFineness(), 0, 1, 0.01, 0 )); + } + else if( hypType()=="NumberOfLayers" ) + { + StdMeshers::StdMeshers_NumberOfLayers_var h = + StdMeshers::StdMeshers_NumberOfLayers::_narrow( hyp ); + + item.myName = tr( "SMESH_NUMBER_OF_LAYERS" ); + item.myValue = (int) h->GetNumberOfLayers(); + p.append( item ); + } + else if( hypType()=="LayerDistribution" ) + { + StdMeshers::StdMeshers_LayerDistribution_var h = + StdMeshers::StdMeshers_LayerDistribution::_narrow( hyp ); + + item.myName = tr( "SMESH_LAYERS_DISTRIBUTION" ); p.append( item ); + customWidgets()->append + ( new StdMeshersGUI_LayerDistributionParamWdg( h->GetLayerDistribution(), dlg())); + } + else if( hypType()=="ProjectionSource1D" ) + { + StdMeshers::StdMeshers_ProjectionSource1D_var h = + StdMeshers::StdMeshers_ProjectionSource1D::_narrow( hyp ); + + item.myName = tr( "SMESH_SOURCE_EDGE" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 1 ), + h->GetSourceEdge())); + item.myName = tr( "SMESH_SOURCE_MESH" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( new SMESH_TypeFilter( MESH ), + h->GetSourceMesh())); + item.myName = tr( "SMESH_SOURCE_VERTEX" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ), + h->GetSourceVertex())); + item.myName = tr( "SMESH_TARGET_VERTEX" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ), + h->GetTargetVertex())); + } + else if( hypType()=="ProjectionSource2D" ) + { + StdMeshers::StdMeshers_ProjectionSource2D_var h = + StdMeshers::StdMeshers_ProjectionSource2D::_narrow( hyp ); + + item.myName = tr( "SMESH_SOURCE_FACE" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 2 ), + h->GetSourceFace())); + item.myName = tr( "SMESH_SOURCE_MESH" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( new SMESH_TypeFilter( MESH ), + h->GetSourceMesh())); + item.myName = tr( "SMESH_SOURCE_VERTEX1" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ), + h->GetSourceVertex( 1 ))); + item.myName = tr( "SMESH_TARGET_VERTEX1" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ), + h->GetTargetVertex( 1 ))); + item.myName = tr( "SMESH_SOURCE_VERTEX2" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ), + h->GetSourceVertex( 2 ))); + item.myName = tr( "SMESH_TARGET_VERTEX2" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ), + h->GetTargetVertex( 2 ))); + } + else if( hypType()=="ProjectionSource3D" ) + { + StdMeshers::StdMeshers_ProjectionSource3D_var h = + StdMeshers::StdMeshers_ProjectionSource3D::_narrow( hyp ); + + item.myName = tr( "SMESH_SOURCE_3DSHAPE" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 3 , 6, TopAbs_FACE, true ), + h->GetSource3DShape())); + item.myName = tr( "SMESH_SOURCE_MESH" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( new SMESH_TypeFilter( MESH ), + h->GetSourceMesh())); + item.myName = tr( "SMESH_SOURCE_VERTEX1" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ), + h->GetSourceVertex( 1 ))); + item.myName = tr( "SMESH_TARGET_VERTEX1" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ), + h->GetTargetVertex( 1 ))); + item.myName = tr( "SMESH_SOURCE_VERTEX2" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ), + h->GetSourceVertex( 2 ))); + item.myName = tr( "SMESH_TARGET_VERTEX2" ); p.append( item ); + customWidgets()->append( newObjRefParamWdg( filterForShapeOfDim( 0 ), + h->GetTargetVertex( 2 ))); } else res = false; return res; } +//================================================================================ +/*! + * \brief tune "standard" control + * \param w - control widget + * \param int - parameter index + */ +//================================================================================ + void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget( QWidget* w, const int ) const { SMESHGUI_SpinBox* sb = w->inherits( "SMESHGUI_SpinBox" ) ? ( SMESHGUI_SpinBox* )w : 0; @@ -267,22 +713,52 @@ void StdMeshersGUI_StdHypothesisCreator::attuneStdWidget( QWidget* w, const int } } +//================================================================================ +/*! + * \brief Return dlg title + * \retval QString - title string + */ +//================================================================================ + QString StdMeshersGUI_StdHypothesisCreator::caption() const { return tr( QString( "SMESH_%1_TITLE" ).arg( hypTypeName( hypType() ) ) ); } +//================================================================================ +/*! + * \brief return pixmap for dlg icon + * \retval QPixmap - + */ +//================================================================================ + QPixmap StdMeshersGUI_StdHypothesisCreator::icon() const { QString hypIconName = tr( QString( "ICON_DLG_%1" ).arg( hypTypeName( hypType() ) ) ); return SMESHGUI::resourceMgr()->loadPixmap( "SMESH", hypIconName ); } +//================================================================================ +/*! + * \brief Return hypothesis type name to show in dlg + * \retval QString - + */ +//================================================================================ + QString StdMeshersGUI_StdHypothesisCreator::type() const { return tr( QString( "SMESH_%1_HYPOTHESIS" ).arg( hypTypeName( hypType() ) ) ); } +//================================================================================ +/*! + * \brief String to insert in "SMESH_%1_HYPOTHESIS" to get hypothesis type name + * from message resouce file + * \param t - hypothesis type + * \retval QString - result string + */ +//================================================================================ + QString StdMeshersGUI_StdHypothesisCreator::hypTypeName( const QString& t ) const { static QMap types; @@ -296,6 +772,11 @@ QString StdMeshersGUI_StdHypothesisCreator::hypTypeName( const QString& t ) cons types.insert( "Deflection1D", "DEFLECTION1D" ); types.insert( "Arithmetic1D", "ARITHMETIC_1D" ); types.insert( "AutomaticLength", "AUTOMATIC_LENGTH" ); + types.insert( "ProjectionSource1D", "PROJECTION_SOURCE_1D" ); + types.insert( "ProjectionSource2D", "PROJECTION_SOURCE_2D" ); + types.insert( "ProjectionSource3D", "PROJECTION_SOURCE_3D" ); + types.insert( "NumberOfLayers", "NUMBER_OF_LAYERS" ); + types.insert( "LayerDistribution", "LAYER_DISTRIBUTION" ); } QString res; @@ -305,54 +786,35 @@ QString StdMeshersGUI_StdHypothesisCreator::hypTypeName( const QString& t ) cons return res; } -//================================================================================ -/*! - * \brief Widget: slider with left and right labels - */ -//================================================================================ - -class TDoubleSliderWith2Lables: public QHBox -{ -public: - TDoubleSliderWith2Lables( const QString& leftLabel, const QString& rightLabel, - const double initValue, const double bottom, - const double top , const double precision, - QWidget * parent=0 , const char * name=0 ) - :QHBox(parent,name), _bottom(bottom), _precision(precision) - { - if ( !leftLabel.isEmpty() ) (new QLabel( this ))->setText( leftLabel ); - _slider = new QSlider( Horizontal, this ); - _slider->setRange( 0, toInt( top )); - _slider->setValue( toInt( initValue )); - if ( !rightLabel.isEmpty() ) (new QLabel( this ))->setText( rightLabel ); - } - double value() const { return _bottom + _slider->value() * _precision; } - QSlider * getSlider() const { return _slider; } - int toInt( double val ) const { return (int) ceil(( val - _bottom ) / _precision ); } -private: - double _bottom, _precision; - QSlider * _slider; -}; //======================================================================= //function : getCustomWidget -//purpose : +//purpose : is called from buildStdFrame() //======================================================================= QWidget* StdMeshersGUI_StdHypothesisCreator::getCustomWidget( const StdParam & param, - QWidget* parent) const + QWidget* parent, + const int index) const { - if ( hypType()=="AutomaticLength" && param.myValue.type() == QVariant::Double ) - return new TDoubleSliderWith2Lables( "0 ", " 1", param.myValue.toDouble(), - 0, 1, 0.01, parent ); - - return 0; + QWidget* w = 0; + if ( index < customWidgets()->count() ) { + w = customWidgets()->at( index ); + if ( w ) + w->reparent( parent, QPoint( 0, 0 )); + } + return w; } -//======================================================================= -//function : getParamFromCustomWidget -//purpose : -//======================================================================= +//================================================================================ +/*! + * \brief Set param value taken from a custom widget + * \param param - SMESHGUI_GenericHypothesisCreator::StdParam structure + * \param widget - widget presenting param + * \retval bool - success flag + * + * this method is called from getStdParamFromDlg() + */ +//================================================================================ bool StdMeshersGUI_StdHypothesisCreator::getParamFromCustomWidget( StdParam & param, QWidget* widget) const @@ -364,5 +826,37 @@ bool StdMeshersGUI_StdHypothesisCreator::getParamFromCustomWidget( StdParam & pa return true; } } + if ( widget->inherits( "StdMeshersGUI_ObjectReferenceParamWdg" )) + { + // show only 1st reference value + if ( true /*widget == getWidgetForParam( 0 )*/) { + const StdMeshersGUI_ObjectReferenceParamWdg * w = + static_cast( widget ); + param.myValue = w->GetValue(); + } + return true; + } + if ( widget->inherits( "StdMeshersGUI_LayerDistributionParamWdg" )) + { + const StdMeshersGUI_LayerDistributionParamWdg * w = + static_cast( widget ); + param.myValue = w->GetValue(); + return true; + } return false; } + +//================================================================================ +/*! + * \brief called when operation cancelled + */ +//================================================================================ + +void StdMeshersGUI_StdHypothesisCreator::onReject() +{ + if ( hypType().startsWith("ProjectionSource" )) + { + // Uninstall filters of StdMeshersGUI_ObjectReferenceParamWdg + deactivateObjRefParamWdg( customWidgets() ); + } +} diff --git a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h index c5c2c8db0..29ed2e2ac 100644 --- a/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h +++ b/src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h @@ -28,12 +28,14 @@ #ifndef STDMESHERSGUI_StdHypothesisCreator_HeaderFile #define STDMESHERSGUI_StdHypothesisCreator_HeaderFile +#include "SMESH_StdMeshersGUI.hxx" + #include /*! - * \brief Class for creation of simple hypotheses (only set of parameters without dependencies) + * \brief Class for creation of standard hypotheses */ -class StdMeshersGUI_StdHypothesisCreator : public SMESHGUI_GenericHypothesisCreator +class STDMESHERSGUI_EXPORT StdMeshersGUI_StdHypothesisCreator : public SMESHGUI_GenericHypothesisCreator { Q_OBJECT @@ -52,10 +54,20 @@ protected: virtual QString caption() const; virtual QPixmap icon() const; virtual QString type() const; - virtual QWidget* getCustomWidget( const StdParam&, QWidget* ) const; + virtual QWidget* getCustomWidget( const StdParam&, QWidget*, const int ) const; virtual bool getParamFromCustomWidget( StdParam& , QWidget* ) const; - virtual QString hypTypeName( const QString& ) const; + virtual QString hypTypeName( const QString& ) const; + virtual QWidget* getWidgetForParam( int paramIndex ) const; + virtual ListOfWidgets* customWidgets() const; + virtual void onReject(); + + template + T* widget(int i) const { + return dynamic_cast< T* >( getWidgetForParam( i )); + } + + ListOfWidgets myCustomWidgets; }; #endif diff --git a/src/StdMeshersGUI/StdMeshers_images.po b/src/StdMeshersGUI/StdMeshers_images.po index c7397e2e1..5fd2cf40c 100644 --- a/src/StdMeshersGUI/StdMeshers_images.po +++ b/src/StdMeshersGUI/StdMeshers_images.po @@ -38,64 +38,65 @@ msgstr "select1.png" # Hypothesis creation, see StdMeshersGUI_CreateStdHypothesisDlg() #----------------------------------------------------------------- -#Hypo Local Length msgid "ICON_DLG_LOCAL_LENGTH" msgstr "mesh_hypo_length.png" -#Hypo Nb Segments msgid "ICON_DLG_NB_SEGMENTS" msgstr "mesh_hypo_segment.png" -#Hypo Max Area msgid "ICON_DLG_MAX_ELEMENT_AREA" msgstr "mesh_hypo_area.png" -#Hypo Max Volume msgid "ICON_DLG_MAX_ELEMENT_VOLUME" msgstr "mesh_hypo_volume.png" -#Hypo Start End Length msgid "ICON_DLG_START_END_LENGTH" msgstr "mesh_hypo_length.png" -#Hypo deflection 1D msgid "ICON_DLG_DEFLECTION1D" msgstr "mesh_hypo_length.png" -#Hypo Geometric 1D msgid "ICON_DLG_GEOMETRIC_1D" msgstr "mesh_hypo_length.png" -#Hypo Arithmetic 1D msgid "ICON_DLG_ARITHMETIC_1D" msgstr "mesh_hypo_length.png" -#Hypo AutomaticLength msgid "ICON_DLG_AUTOMATIC_LENGTH" msgstr "mesh_hypo_length.png" +msgid "ICON_DLG_NUMBER_OF_LAYERS" +msgstr "mesh_hypo_layer_distribution.png" + +msgid "ICON_DLG_LAYER_DISTRIBUTION" +msgstr "mesh_hypo_layer_distribution.png" + +msgid "ICON_DLG_PROJECTION_SOURCE_1D" +msgstr "mesh_hypo_source_edge.png" + +msgid "ICON_DLG_PROJECTION_SOURCE_2D" +msgstr "mesh_hypo_source_face.png" + +msgid "ICON_DLG_PROJECTION_SOURCE_3D" +msgstr "mesh_hypo_source_3d.png" + #----------------------------------------------------------- # ObjectBrowser #----------------------------------------------------------- -#mesh_tree_algo_regular msgid "ICON_SMESH_TREE_ALGO_Regular_1D" msgstr "mesh_tree_algo_regular.png" -#mesh_tree_algo_hexa msgid "ICON_SMESH_TREE_ALGO_Hexa_3D" msgstr "mesh_tree_algo_hexa.png" -#mesh_tree_algo_mefisto msgid "ICON_SMESH_TREE_ALGO_MEFISTO_2D" msgstr "mesh_tree_algo_mefisto.png" -#mesh_tree_algo_quad msgid "ICON_SMESH_TREE_ALGO_Quadrangle_2D" msgstr "mesh_tree_algo_quad.png" -#mesh_tree_hypo_area msgid "ICON_SMESH_TREE_HYPO_MaxElementArea" msgstr "mesh_tree_hypo_area.png" @@ -111,38 +112,60 @@ msgstr "mesh_tree_hypo_length.png" msgid "ICON_SMESH_TREE_HYPO_LocalLength" msgstr "mesh_tree_hypo_length.png" -#mesh_tree_hypo_segment msgid "ICON_SMESH_TREE_HYPO_NumberOfSegments" msgstr "mesh_tree_hypo_segment.png" -#mesh_tree_hypo_volume msgid "ICON_SMESH_TREE_HYPO_MaxElementVolume" msgstr "mesh_tree_hypo_volume.png" -#mesh_tree_hypo_length msgid "ICON_SMESH_TREE_HYPO_LengthFromEdges" msgstr "mesh_tree_hypo_area.png" -#mesh_tree_hypo_nonconform msgid "ICON_SMESH_TREE_HYPO_NotConformAllowed" msgstr "mesh_tree_hypo_length.png" -#mesh_tree_hypo_start_end_length msgid "ICON_SMESH_TREE_HYPO_StartEndLength" msgstr "mesh_tree_hypo_length.png" -#mesh_tree_hypo_deflection1d msgid "ICON_SMESH_TREE_HYPO_Deflection1D" msgstr "mesh_tree_hypo_length.png" -#mesh_tree_hypo_Arithmetic1d msgid "ICON_SMESH_TREE_HYPO_Arithmetic1D" msgstr "mesh_tree_hypo_length.png" -#mesh_tree_hypo_AutomaticLength msgid "ICON_SMESH_TREE_HYPO_AutomaticLength" msgstr "mesh_tree_hypo_length.png" -#mesh_tree_hypo_propagation msgid "ICON_SMESH_TREE_HYPO_Propagation" msgstr "mesh_tree_hypo_length.png" + + +msgid "ICON_SMESH_TREE_ALGO_RadialPrism_3D" +msgstr "mesh_tree_algo_radial_prism.png" + +msgid "ICON_SMESH_TREE_ALGO_Prism_3D" +msgstr "mesh_tree_algo_projection_3d.png" + +msgid "ICON_SMESH_TREE_ALGO_Projection_3D" +msgstr "mesh_tree_hypo_projection_3d.png" + +msgid "ICON_SMESH_TREE_ALGO_Projection_2D" +msgstr "mesh_tree_algo_projection_2d.png" + +msgid "ICON_SMESH_TREE_ALGO_Projection_1D" +msgstr "mesh_tree_algo_regular.png" + +msgid "ICON_SMESH_TREE_HYPO_NumberOfLayers" +msgstr "mesh_tree_hypo_layers_distribution.png" + +msgid "ICON_SMESH_TREE_HYPO_LayerDistribution" +msgstr "mesh_tree_hypo_layers_distribution.png" + +msgid "ICON_SMESH_TREE_HYPO_ProjectionSource1D" +msgstr "mesh_tree_hypo_source_edge.png" + +msgid "ICON_SMESH_TREE_HYPO_ProjectionSource2D" +msgstr "mesh_tree_hypo_source_face.png" + +msgid "ICON_SMESH_TREE_HYPO_ProjectionSource3D" +msgstr "mesh_tree_hypo_source_3d_shape.png" diff --git a/src/StdMeshersGUI/StdMeshers_msg_en.po b/src/StdMeshersGUI/StdMeshers_msg_en.po index b7d2616da..b1842159e 100644 --- a/src/StdMeshersGUI/StdMeshers_msg_en.po +++ b/src/StdMeshersGUI/StdMeshers_msg_en.po @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: PROJECT VERSION\n" "POT-Creation-Date: 2002-05-28 10:46:48 AM CEST\n" -"PO-Revision-Date: YYYY-MM-DD\n" +"PO-Revision-Date: 2006-11-14 16:17+0300\n" "Last-Translator: FULLNAME \n" "Content-Type: text/plain; charset=iso-8859-1\n" @@ -175,3 +175,84 @@ msgstr "Fineness" msgid "SMESH_AUTOMATIC_LENGTH_TITLE" msgstr "Hypothesis Construction" + + +# -------------- PROJECTION_SOURCE_... -------------- + +msgid "SMESH_PROJECTION_SOURCE_1D_HYPOTHESIS" +msgstr "Projection Source 1D" +msgid "SMESH_PROJECTION_SOURCE_2D_HYPOTHESIS" +msgstr "Projection Source 2D" +msgid "SMESH_PROJECTION_SOURCE_3D_HYPOTHESIS" +msgstr "Projection Source 3D" + +msgid "SMESH_PROJECTION_SOURCE_1D_TITLE" +msgstr "Hypothesis Construction" +msgid "SMESH_PROJECTION_SOURCE_2D_TITLE" +msgstr "Hypothesis Construction" +msgid "SMESH_PROJECTION_SOURCE_3D_TITLE" +msgstr "Hypothesis Construction" + +msgid "SMESH_SOURCE_MESH" +msgstr "Mesh" + +msgid "SMESH_SOURCE_EDGE" +msgstr "Edge" + +msgid "SMESH_SOURCE_FACE" +msgstr "Face" + +msgid "SMESH_SOURCE_3DSHAPE" +msgstr "3D shape" + +msgid "SMESH_SOURCE_VERTEX" +msgstr "Source Vertex" + +msgid "SMESH_TARGET_VERTEX" +msgstr "Target Vertex" + +msgid "SMESH_SOURCE_VERTEX1" +msgstr "Source Vertex 1" + +msgid "SMESH_TARGET_VERTEX1" +msgstr "Target Vertex 1" + +msgid "SMESH_SOURCE_VERTEX2" +msgstr "Source Vertex 2" + +msgid "SMESH_TARGET_VERTEX2" +msgstr "Target Vertex 2" + + +# ---------------- NUMBER_OF_LAYERS ---------------- + +msgid "SMESH_NUMBER_OF_LAYERS_HYPOTHESIS" +msgstr "Radial Prism Parameter" + +msgid "SMESH_NUMBER_OF_LAYERS" +msgstr "Number of Layers" + +msgid "SMESH_NUMBER_OF_LAYERS_TITLE" +msgstr "Hypothesis Construction" + + +# ---------------- LAYER_DISTRIBUTION ---------------- + +msgid "SMESH_LAYER_DISTRIBUTION_HYPOTHESIS" +msgstr "Distribution of Layers" + +msgid "SMESH_LAYERS_DISTRIBUTION" +msgstr "1D Hypothesis" + +msgid "SMESH_LAYER_DISTRIBUTION_TITLE" +msgstr "Hypothesis Construction" + +msgid "StdMeshersGUI_LayerDistributionParamWdg::CHANGE_TYPE" +msgstr "Change Type" + +msgid "StdMeshersGUI_LayerDistributionParamWdg::CREATE" +msgstr "Create" + +msgid "StdMeshersGUI_LayerDistributionParamWdg::EDIT" +msgstr "Edit" + diff --git a/src/StdMeshers_I/Makefile.in b/src/StdMeshers_I/Makefile.in index 2954f9b5e..cc278a74d 100644 --- a/src/StdMeshers_I/Makefile.in +++ b/src/StdMeshers_I/Makefile.in @@ -53,7 +53,16 @@ EXPORT_HEADERS = \ StdMeshers_Hexa_3D_i.hxx \ StdMeshers_AutomaticLength_i.hxx \ StdMeshers_QuadranglePreference_i.hxx \ - StdMeshers_QuadraticMesh_i.hxx + StdMeshers_QuadraticMesh_i.hxx \ + StdMeshers_NumberOfLayers_i.hxx \ + StdMeshers_Prism_3D_i.hxx \ + StdMeshers_ProjectionSource1D_i.hxx \ + StdMeshers_ProjectionSource2D_i.hxx \ + StdMeshers_ProjectionSource3D_i.hxx \ + StdMeshers_Projection_1D_2D_3D_i.hxx \ + StdMeshers_ObjRefUlils.hxx \ + StdMeshers_LayerDistribution_i.hxx \ + SMESH_StdMeshers_I.hxx # Libraries targets @@ -77,7 +86,15 @@ LIB_SRC = \ StdMeshers_Hexa_3D_i.cxx \ StdMeshers_AutomaticLength_i.cxx \ StdMeshers_QuadranglePreference_i.cxx \ - StdMeshers_QuadraticMesh_i.cxx + StdMeshers_QuadraticMesh_i.cxx \ + StdMeshers_NumberOfLayers_i.cxx \ + StdMeshers_Prism_3D_i.cxx \ + StdMeshers_ProjectionSource1D_i.cxx \ + StdMeshers_ProjectionSource2D_i.cxx \ + StdMeshers_ProjectionSource3D_i.cxx \ + StdMeshers_Projection_1D_2D_3D_i.cxx \ + StdMeshers_ObjRefUlils.cxx \ + StdMeshers_LayerDistribution_i.cxx LIB_SERVER_IDL = SMESH_BasicHypothesis.idl @@ -85,7 +102,7 @@ LIB_CLIENT_IDL = \ SALOMEDS.idl SALOME_Exception.idl \ GEOM_Gen.idl MED.idl SALOMEDS_Attributes.idl \ SMESH_Gen.idl SMESH_Hypothesis.idl SMESH_Group.idl \ - SALOME_Comm.idl + SALOME_Comm.idl SALOME_Component.idl SALOME_GenericObj.idl SMESH_Mesh.idl # Executables targets BIN = diff --git a/src/StdMeshers_I/SMESH_StdMeshers_I.hxx b/src/StdMeshers_I/SMESH_StdMeshers_I.hxx new file mode 100755 index 000000000..6aa730601 --- /dev/null +++ b/src/StdMeshers_I/SMESH_StdMeshers_I.hxx @@ -0,0 +1,41 @@ +// Copyright (C) 2003 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. +// +// 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org +// +// +// +// File : SMESH_StdMeshers_I.hxx +// Author : Alexander BORODIN +// Module : SMESH +// $Header: + +#ifndef _SMESH_StdMeshers_I_HXX_ +#define _SMESH_StdMeshers_I_HXX_ + +#ifdef WNT + #if defined STDMESHERS_I_EXPORTS + #define STDMESHERS_I_EXPORT __declspec( dllexport ) + #else + #define STDMESHERS_I_EXPORT __declspec( dllimport ) + #endif +#else + #define STDMESHERS_I_EXPORT +#endif + +#endif + diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx index a0cbc938d..ef47c3f0a 100644 --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.cxx @@ -26,7 +26,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_Arithmetic1D_i.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Gen.hxx" @@ -37,6 +36,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * StdMeshers_Arithmetic1D_i::StdMeshers_Arithmetic1D_i diff --git a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx index ede31ba10..8c6ad55cd 100644 --- a/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Arithmetic1D_i.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_ARITHMETIC1D_I_HXX_ #define _SMESH_ARITHMETIC1D_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -38,7 +40,7 @@ // ====================================================== // Arithmetic 1D hypothesis // ====================================================== -class StdMeshers_Arithmetic1D_i: +class STDMESHERS_I_EXPORT StdMeshers_Arithmetic1D_i: public virtual POA_StdMeshers::StdMeshers_Arithmetic1D, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx index a8605651f..278a70efa 100644 --- a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.cxx @@ -26,7 +26,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_AutomaticLength_i.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Gen.hxx" @@ -37,6 +36,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * StdMeshers_AutomaticLength_i::StdMeshers_AutomaticLength_i diff --git a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx index 8733b7835..b378a1eb5 100644 --- a/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx +++ b/src/StdMeshers_I/StdMeshers_AutomaticLength_i.hxx @@ -29,6 +29,8 @@ #ifndef _SMESH_AutomaticLength_I_HXX_ #define _SMESH_AutomaticLength_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -41,7 +43,7 @@ class SMESH_Gen; // 1D Hypothesis to compute segment length free of thinking // ========================================================= -class StdMeshers_AutomaticLength_i: +class STDMESHERS_I_EXPORT StdMeshers_AutomaticLength_i: public virtual POA_StdMeshers::StdMeshers_AutomaticLength, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx b/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx index cc4ed5ffc..b5b3cff5b 100644 --- a/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Deflection1D_i.cxx @@ -27,7 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_Deflection1D_i.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Gen.hxx" @@ -38,6 +37,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * StdMeshers_Deflection1D_i::StdMeshers_Deflection1D_i diff --git a/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx b/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx index aab9255bd..2274345db 100644 --- a/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Deflection1D_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_Deflection1D_I_HXX_ #define _SMESH_Deflection1D_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -41,7 +43,7 @@ class SMESH_Gen; // ====================================================== // Local Length hypothesis // ====================================================== -class StdMeshers_Deflection1D_i: +class STDMESHERS_I_EXPORT StdMeshers_Deflection1D_i: public virtual POA_StdMeshers::StdMeshers_Deflection1D, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx index 1c3049518..8f98cd6e1 100644 --- a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.cxx @@ -27,13 +27,14 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_Hexa_3D_i.hxx" #include "SMESH_Gen.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * StdMeshers_Hexa_3D_i::StdMeshers_Hexa_3D_i diff --git a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx index a2d40a0fe..1910da3b1 100644 --- a/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Hexa_3D_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_HEXA_3D_I_HXX_ #define _SMESH_HEXA_3D_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -41,7 +43,7 @@ class SMESH_Gen; // ====================================================== // Hexaedron 3d algorithm // ====================================================== -class StdMeshers_Hexa_3D_i: +class STDMESHERS_I_EXPORT StdMeshers_Hexa_3D_i: public virtual POA_StdMeshers::StdMeshers_Hexa_3D, public virtual SMESH_3D_Algo_i { diff --git a/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx new file mode 100644 index 000000000..5c3b41315 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.cxx @@ -0,0 +1,216 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_LayerDistribution_i.cxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#include "StdMeshers_LayerDistribution_i.hxx" +#include "SMESH_Gen_i.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_PythonDump.hxx" + +#include "Utils_CorbaException.hxx" +#include "utilities.h" + +#include + +using namespace std; + +//============================================================================= +/*! + * StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i + * + * Constructor + */ +//============================================================================= + +StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ) +{ + MESSAGE( "StdMeshers_LayerDistribution_i::StdMeshers_LayerDistribution_i" ); + myBaseImpl = new ::StdMeshers_LayerDistribution( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} + +//============================================================================= +/*! + * StdMeshers_LayerDistribution_i::~StdMeshers_LayerDistribution_i + * + * Destructor + */ +//============================================================================= + +StdMeshers_LayerDistribution_i::~StdMeshers_LayerDistribution_i() +{ + MESSAGE( "StdMeshers_LayerDistribution_i::~StdMeshers_LayerDistribution_i" ); +} + +//============================================================================= +/*! + * StdMeshers_LayerDistribution_i::SetLayerDistribution + * + + */ +//============================================================================= + +void StdMeshers_LayerDistribution_i::SetLayerDistribution(SMESH::SMESH_Hypothesis_ptr hyp1D) + throw ( SALOME::SALOME_Exception ) +{ + ASSERT( myBaseImpl ); + try { + SMESH_Hypothesis_i * hyp_i = SMESH::DownCast< SMESH_Hypothesis_i*>( hyp1D ); + bool isNewHyp = ( hyp_i->GetImpl() != this->GetImpl()->GetLayerDistribution() ); + this->GetImpl()->SetLayerDistribution( hyp_i->GetImpl() ); + myHyp = SMESH::SMESH_Hypothesis::_duplicate( hyp1D ); + // Remove SO of 1D hypothesis if it was published + if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) { + SALOMEDS::Study_var study = gen->GetCurrentStudy(); + SALOMEDS::SObject_var SO = gen->ObjectToSObject( study, hyp1D ); + if ( ! SO->_is_nil() ) + study->NewBuilder()->RemoveObjectWithChildren( SO ); + } + // Update Python script: write creation of 1D hyp as it is not published and + // for this, SMESH_Gen does not write it's creation + if ( isNewHyp ) + SMESH::TPythonDump() << hyp1D << " = " + << SMESH_Gen_i::GetSMESHGen() << ".CreateHypothesis('" + << hyp_i->GetName() << "', '" << hyp_i->GetLibName() << "')"; + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + // Update Python script + SMESH::TPythonDump() << _this() << ".SetLayerDistribution( " << hyp1D << " )"; +} + +//============================================================================= +/*! + * StdMeshers_LayerDistribution_i::GetLayerDistribution + * + * Returns parameter value + */ +//============================================================================= + +SMESH::SMESH_Hypothesis_ptr StdMeshers_LayerDistribution_i::GetLayerDistribution() +{ + SMESH::SMESH_Hypothesis_var hyp = myHyp; + return hyp._retn(); +} + +//============================================================================= +/*! + * StdMeshers_LayerDistribution_i::GetImpl + * + * Get implementation + */ +//============================================================================= + +::StdMeshers_LayerDistribution* StdMeshers_LayerDistribution_i::GetImpl() +{ + return ( ::StdMeshers_LayerDistribution* )myBaseImpl; +} + +//================================================================================ +/*! + * \brief Verify whether hypothesis supports given entity type + * \param type - dimension (see SMESH::Dimension enumeration) + * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise + * + * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) + */ +//================================================================================ +CORBA::Boolean StdMeshers_LayerDistribution_i::IsDimSupported( SMESH::Dimension type ) +{ + return type == SMESH::DIM_3D; +} + +//================================================================================ +/*! + * \brief Write parameters in a string + * \retval char* - resulting string + */ +//================================================================================ + +char* StdMeshers_LayerDistribution_i::SaveTo() +{ + ASSERT( myBaseImpl ); + std::ostringstream os; + + ::SMESH_Hypothesis* hyp1D = GetImpl()->GetLayerDistribution(); + SMESH_Hypothesis_i* hyp1D_i = SMESH::DownCast< SMESH_Hypothesis_i*>( myHyp ); + if ( !hyp1D || !hyp1D_i ) + os << "NULL_HYPO "; + else { + os << hyp1D->GetName() << " " + << hyp1D->GetLibName() << " " + << hyp1D_i->SaveTo(); + } + //myBaseImpl->SaveTo( os ); + + return CORBA::string_dup( os.str().c_str() ); +} + +//================================================================================ +/*! + * \brief Retrieve parameters from the string + * \param theStream - the input string + */ +//================================================================================ + +void StdMeshers_LayerDistribution_i::LoadFrom( const char* theStream ) +{ + ASSERT( myBaseImpl ); + std::istringstream is( theStream ); + + string typeName, libName; + if ( is >> typeName && + is >> libName ) + { + SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen(); + SALOMEDS::Study_var curStudy = gen->GetCurrentStudy(); + gen->SetCurrentStudy( SALOMEDS::Study::_nil() ); // prevent hypo publishing + + try { + SMESH::SMESH_Hypothesis_var hyp1D = + gen->CreateHypothesis( typeName.c_str(), libName.c_str() ); + SMESH_Hypothesis_i* hyp1D_i = SMESH::DownCast< SMESH_Hypothesis_i*>( hyp1D ); + if ( hyp1D_i ) { + hyp1D_i->LoadFrom( & theStream[ is.tellg() ]); + this->GetImpl()->SetLayerDistribution( hyp1D_i->GetImpl() ); + myHyp = hyp1D; + // as hyp1D is not published, its ID changes + //SMESH::TPythonDump() << _this() << ".SetLayerDistribution( " << hyp1D << " )"; + } + } + catch (...) { + } + gen->SetCurrentStudy( curStudy ); // enable hypo publishing + } +} + diff --git a/src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx new file mode 100644 index 000000000..7112d84c5 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_LayerDistribution_i.hxx @@ -0,0 +1,88 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_LayerDistribution_i.hxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#ifndef _SMESH_LayerDistribution_I_HXX_ +#define _SMESH_LayerDistribution_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) + +#include "SMESH_Hypothesis_i.hxx" +#include "StdMeshers_LayerDistribution.hxx" + +class SMESH_Gen; + +// ========================================================= +/*! + * This hypothesis is used by "Radial prism" algorithm. + * It specifies 1D hypothesis defining distribution of segments between the internal + * and the external surfaces. + */ +// ========================================================= + +class StdMeshers_LayerDistribution_i: + public virtual POA_StdMeshers::StdMeshers_LayerDistribution, + public virtual SMESH_Hypothesis_i +{ +public: + // Constructor + StdMeshers_LayerDistribution_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + // Destructor + virtual ~StdMeshers_LayerDistribution_i(); + + /*! + * \brief Sets 1D hypothesis specifying distribution of layers + * \param hyp1D - 1D hypothesis + */ + void SetLayerDistribution(SMESH::SMESH_Hypothesis_ptr hyp1D) + throw ( SALOME::SALOME_Exception ); + + /*! + * \brief Returns 1D hypothesis specifying distribution of layers + * \retval SMESH::SMESH_Hypothesis_ptr - 1D hypothesis + */ + SMESH::SMESH_Hypothesis_ptr GetLayerDistribution(); + + // Get implementation + ::StdMeshers_LayerDistribution* GetImpl(); + + // Verify whether hypothesis supports given entity type + CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + // Redefined Persistence + virtual char* SaveTo(); + virtual void LoadFrom( const char* theStream ); + +private: + SMESH::SMESH_Hypothesis_var myHyp; +}; + +#endif + diff --git a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx index c40f33aba..d96af29ef 100644 --- a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx +++ b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.cxx @@ -27,13 +27,14 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_LengthFromEdges_i.hxx" #include "SMESH_Gen.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * StdMeshers_LengthFromEdges_i::StdMeshers_LengthFromEdges_i diff --git a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx index f09e63217..c7ebd3322 100644 --- a/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx +++ b/src/StdMeshers_I/StdMeshers_LengthFromEdges_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_LENGTHFROMEDGES_I_HXX_ #define _SMESH_LENGTHFROMEDGES_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -39,7 +41,7 @@ // ====================================================== // Length from edges hypothesis // ====================================================== -class StdMeshers_LengthFromEdges_i: +class STDMESHERS_I_EXPORT StdMeshers_LengthFromEdges_i: public virtual POA_StdMeshers::StdMeshers_LengthFromEdges, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx b/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx index 8fea4bee9..4190c1b8c 100644 --- a/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_LocalLength_i.cxx @@ -27,7 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_LocalLength_i.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Gen.hxx" @@ -38,6 +37,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * StdMeshers_LocalLength_i::StdMeshers_LocalLength_i diff --git a/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx b/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx index e8210ef7d..62c73cbc8 100644 --- a/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx +++ b/src/StdMeshers_I/StdMeshers_LocalLength_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_LOCALLENGTH_I_HXX_ #define _SMESH_LOCALLENGTH_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -41,7 +43,7 @@ class SMESH_Gen; // ====================================================== // Local Length hypothesis // ====================================================== -class StdMeshers_LocalLength_i: +class STDMESHERS_I_EXPORT StdMeshers_LocalLength_i: public virtual POA_StdMeshers::StdMeshers_LocalLength, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx index 4f29d8d56..316ea8d8e 100644 --- a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.cxx @@ -27,13 +27,14 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_MEFISTO_2D_i.hxx" #include "SMESH_Gen.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * StdMeshers_MEFISTO_2D_i::StdMeshers_MEFISTO_2D_i diff --git a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx index 1a486c825..5f7d7ca83 100644 --- a/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_MEFISTO_2D_i.hxx @@ -30,6 +30,8 @@ #ifndef _StdMeshers_MEFISTO_2D_I_HXX_ #define _StdMeshers_MEFISTO_2D_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -41,7 +43,7 @@ class SMESH_Gen; // ====================================================== // Triangle (MEFISTO) 2d algorithm // ====================================================== -class StdMeshers_MEFISTO_2D_i: +class STDMESHERS_I_EXPORT StdMeshers_MEFISTO_2D_i: public virtual POA_StdMeshers::StdMeshers_MEFISTO_2D, public virtual SMESH_2D_Algo_i { diff --git a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx index 223e8769a..a9e7f9f52 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.cxx @@ -27,7 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_MaxElementArea_i.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Gen.hxx" @@ -38,6 +37,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * StdMeshers_MaxElementArea_i::StdMeshers_MaxElementArea_i diff --git a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx index 45486800c..f9201c74f 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementArea_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_MAXELEMENTAREA_I_HXX_ #define _SMESH_MAXELEMENTAREA_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -39,7 +41,7 @@ // ====================================================== // Maximum Element Area hypothesis // ====================================================== -class StdMeshers_MaxElementArea_i: +class STDMESHERS_I_EXPORT StdMeshers_MaxElementArea_i: public virtual POA_StdMeshers::StdMeshers_MaxElementArea, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx index eb8322b07..c85a005f5 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.cxx @@ -27,7 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_MaxElementVolume_i.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Gen.hxx" @@ -38,6 +37,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * StdMeshers_MaxElementVolume_i::StdMeshers_MaxElementVolume_i diff --git a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx index a497c9b01..f5429359b 100644 --- a/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx +++ b/src/StdMeshers_I/StdMeshers_MaxElementVolume_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_MAXELEMENTVOLUME_I_HXX_ #define _SMESH_MAXELEMENTVOLUME_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -39,7 +41,7 @@ // ====================================================== // Maximum Element Volume hypothesis // ====================================================== -class StdMeshers_MaxElementVolume_i: +class STDMESHERS_I_EXPORT StdMeshers_MaxElementVolume_i: public virtual POA_StdMeshers::StdMeshers_MaxElementVolume, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx index 47b87d76a..92775c5ff 100644 --- a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.cxx @@ -26,13 +26,13 @@ // Module : SMESH // $Header$ -using namespace std; -using namespace std; #include "StdMeshers_NotConformAllowed_i.hxx" #include "SMESH_Gen.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * Constructor: diff --git a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx index dc2867ec9..ef0b1e327 100644 --- a/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx +++ b/src/StdMeshers_I/StdMeshers_NotConformAllowed_i.hxx @@ -29,6 +29,8 @@ #ifndef _StdMeshers_NotConformAllowed_I_HXX_ #define _StdMeshers_NotConformAllowed_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -36,7 +38,7 @@ #include "StdMeshers_NotConformAllowed.hxx" -class StdMeshers_NotConformAllowed_i: +class STDMESHERS_I_EXPORT StdMeshers_NotConformAllowed_i: public POA_StdMeshers::StdMeshers_NotConformAllowed, public SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.cxx new file mode 100644 index 000000000..314d00308 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.cxx @@ -0,0 +1,136 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_NumberOfLayers_i.cxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#include "StdMeshers_NumberOfLayers_i.hxx" +#include "SMESH_Gen_i.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_PythonDump.hxx" + +#include "Utils_CorbaException.hxx" +#include "utilities.h" + +#include + +using namespace std; + +//============================================================================= +/*! + * StdMeshers_NumberOfLayers_i::StdMeshers_NumberOfLayers_i + * + * Constructor + */ +//============================================================================= + +StdMeshers_NumberOfLayers_i::StdMeshers_NumberOfLayers_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ) +{ + MESSAGE( "StdMeshers_NumberOfLayers_i::StdMeshers_NumberOfLayers_i" ); + myBaseImpl = new ::StdMeshers_NumberOfLayers( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} + +//============================================================================= +/*! + * StdMeshers_NumberOfLayers_i::~StdMeshers_NumberOfLayers_i + * + * Destructor + */ +//============================================================================= + +StdMeshers_NumberOfLayers_i::~StdMeshers_NumberOfLayers_i() +{ + MESSAGE( "StdMeshers_NumberOfLayers_i::~StdMeshers_NumberOfLayers_i" ); +} + +//============================================================================= +/*! + * StdMeshers_NumberOfLayers_i::SetNumberOfLayers + * + * Sets parameter value + */ +//============================================================================= + +void StdMeshers_NumberOfLayers_i::SetNumberOfLayers(CORBA::Long numberOfLayers) + throw ( SALOME::SALOME_Exception ) +{ + ASSERT( myBaseImpl ); + try { + this->GetImpl()->SetNumberOfLayers( numberOfLayers ); + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + // Update Python script + SMESH::TPythonDump() << _this() << ".SetNumberOfLayers( " << numberOfLayers << " )"; +} + +//============================================================================= +/*! + * StdMeshers_NumberOfLayers_i::GetNumberOfLayers + * + * Returns parameter value + */ +//============================================================================= + +CORBA::Long StdMeshers_NumberOfLayers_i::GetNumberOfLayers() +{ + ASSERT( myBaseImpl ); + return this->GetImpl()->GetNumberOfLayers(); +} + +//============================================================================= +/*! + * StdMeshers_NumberOfLayers_i::GetImpl + * + * Get implementation + */ +//============================================================================= + +::StdMeshers_NumberOfLayers* StdMeshers_NumberOfLayers_i::GetImpl() +{ + return ( ::StdMeshers_NumberOfLayers* )myBaseImpl; +} + +//================================================================================ +/*! + * \brief Verify whether hypothesis supports given entity type + * \param type - dimension (see SMESH::Dimension enumeration) + * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise + * + * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) + */ +//================================================================================ +CORBA::Boolean StdMeshers_NumberOfLayers_i::IsDimSupported( SMESH::Dimension type ) +{ + return type == SMESH::DIM_3D; +} + diff --git a/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx b/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx new file mode 100644 index 000000000..e738b88a7 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_NumberOfLayers_i.hxx @@ -0,0 +1,75 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_NumberOfLayers_i.hxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#ifndef _SMESH_NumberOfLayers_I_HXX_ +#define _SMESH_NumberOfLayers_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) + +#include "SMESH_Hypothesis_i.hxx" +#include "StdMeshers_NumberOfLayers.hxx" + +class SMESH_Gen; + +// ========================================================= +/*! + * This hypothesis is used by "Radial prism" algorithm. + * It specifies number of segments between the internal + * and the external surfaces. + */ +// ========================================================= + +class StdMeshers_NumberOfLayers_i: + public virtual POA_StdMeshers::StdMeshers_NumberOfLayers, + public virtual SMESH_Hypothesis_i +{ +public: + // Constructor + StdMeshers_NumberOfLayers_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + // Destructor + virtual ~StdMeshers_NumberOfLayers_i(); + + // Sets parameter value + void SetNumberOfLayers(CORBA::Long numberOfLayers) + throw ( SALOME::SALOME_Exception ); + + // Returns parameter value + CORBA::Long GetNumberOfLayers(); + + // Get implementation + ::StdMeshers_NumberOfLayers* GetImpl(); + + // Verify whether hypothesis supports given entity type + CORBA::Boolean IsDimSupported( SMESH::Dimension type ); +}; + +#endif + diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx index d36154613..7f164a290 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.cxx @@ -27,7 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_NumberOfSegments_i.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Gen.hxx" @@ -38,6 +37,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * StdMeshers_NumberOfSegments_i::StdMeshers_NumberOfSegments_i diff --git a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx index a0d02bf9c..a1dda71e4 100644 --- a/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx +++ b/src/StdMeshers_I/StdMeshers_NumberOfSegments_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_NUMBEROFSEGMENTS_I_HXX_ #define _SMESH_NUMBEROFSEGMENTS_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_Mesh) #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -40,7 +42,7 @@ // ====================================================== // Number of segments hypothesis // ====================================================== -class StdMeshers_NumberOfSegments_i: +class STDMESHERS_I_EXPORT StdMeshers_NumberOfSegments_i: public virtual POA_StdMeshers::StdMeshers_NumberOfSegments, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx b/src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx new file mode 100644 index 000000000..da8fa8921 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_ObjRefUlils.cxx @@ -0,0 +1,106 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ObjRefUlils.cxx +// Created : Wed Oct 18 15:38:22 2006 +// Author : Edward AGAPOV (eap) + +#include "StdMeshers_ObjRefUlils.hxx" + +#include + +using namespace std; + +//================================================================================ + /*! + * \brief Store the shape in the stream + * \param theShape - shape to store + * \param stream - the stream + */ +//================================================================================ + +void StdMeshers_ObjRefUlils::SaveToStream( const TopoDS_Shape& theShape, ostream & stream) +{ + bool ok = false; + if ( !theShape.IsNull() ) { + if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) { + GEOM::GEOM_Object_var geom = gen->ShapeToGeomObject( theShape ); + if ( ! geom->_is_nil() ) { + SALOMEDS::SObject_var sobj = gen->ObjectToSObject( gen->GetCurrentStudy(), geom ); + if ( !sobj->_is_nil() ) { + stream << " " << sobj->GetID(); + ok = true; + } + } + } + } + if ( ! ok ) + stream << " NULL_SHAPE "; +} + +//================================================================================ + /*! + * \brief Retrieve a shape from the stream + * \param stream - the stream + * \retval TopoDS_Shape - resulting shape + */ +//================================================================================ + +TopoDS_Shape StdMeshers_ObjRefUlils::LoadFromStream( istream & stream) +{ + if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) { + SALOMEDS::Study_var study = gen->GetCurrentStudy(); + if ( ! study->_is_nil() ) { + string str; + if (stream >> str) { + SALOMEDS::SObject_var sobj= study->FindObjectID( str.c_str() ); + CORBA::Object_var obj = gen->SObjectToObject( sobj ); + GEOM::GEOM_Object_var geom = GEOM::GEOM_Object::_narrow( obj ); + return gen->GeomObjectToShape( geom.in() ); + } + } + } + return TopoDS_Shape(); +} + +//================================================================================ + /*! + * \brief Store the CORBA object in the stream + * \param obj - object to store + * \param stream - the stream + */ +//================================================================================ + +void StdMeshers_ObjRefUlils::SaveToStream( CORBA::Object_ptr obj, + std::ostream & stream) +{ + bool ok = false; + if ( !CORBA::is_nil( obj ) ) { + if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) { + stream << " " << gen->GetObjectId( obj ); + ok = true; + } + } + if ( ! ok ) + stream << " NULL_OBJECT "; +} diff --git a/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx b/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx new file mode 100644 index 000000000..994f39594 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_ObjRefUlils.hxx @@ -0,0 +1,114 @@ +// SMESH SMESH : implementaion of SMESH idl descriptions +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ObjRefUlils.hxx +// Created : Wed Oct 18 15:15:27 2006 +// Author : Edward AGAPOV (eap) +// Copyright : Open CASCADE + + +#ifndef StdMeshers_ObjRefUlils_HeaderFile +#define StdMeshers_ObjRefUlils_HeaderFile + +#include "SMESH_Gen_i.hxx" + +/*! + * \brief Class encapsulates methods + * - converting internal objects to CORBA objects and backward and + * - persistence methods for such objects + * + * These methods are useful for hypotheses referring to other objects + * like meshes, geom objects, other hypotheses, etc. + */ +class StdMeshers_ObjRefUlils +{ +public: + /*! + * \brief Return GEOM Object correspoding to TopoDS_Shape + * \param theShape - input TopoDS_Shape + * \retval GEOM::GEOM_Object_ptr - result object + */ + static GEOM::GEOM_Object_ptr ShapeToGeomObject (const TopoDS_Shape& theShape ) { + if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) + return gen->ShapeToGeomObject( theShape ); + else + return GEOM::GEOM_Object::_nil(); + } + + /*! + * \brief Return TopoDS_Shape correspoding to GEOM_Object + * \param theGeomObject - input object + * \retval TopoDS_Shape - result TopoDS_Shape + */ + static TopoDS_Shape GeomObjectToShape(GEOM::GEOM_Object_ptr theGeomObject) { + if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) + return gen->GeomObjectToShape( theGeomObject ); + else + return TopoDS_Shape(); + } + + /*! + * \brief Store the shape in the stream + * \param theShape - shape to store + * \param stream - the stream + */ + static void SaveToStream( const TopoDS_Shape& theShape, std::ostream & stream); + + /*! + * \brief Retrieve a shape from the stream + * \param stream - the stream + * \retval TopoDS_Shape - resulting shape + */ + static TopoDS_Shape LoadFromStream( std::istream & stream); + + /*! + * \brief Store the CORBA object in the stream + * \param obj - object to store + * \param stream - the stream + */ + static void SaveToStream( CORBA::Object_ptr obj, std::ostream & stream); + + /*! + * \brief Retrieve a CORBA object from the stream + * \param stream - the stream + * \retval CORBA::Object_ptr - result object + */ + template + static + typename TInterface::_var_type LoadObjectFromStream( std::istream & stream ) + { + if (SMESH_Gen_i* gen = SMESH_Gen_i::GetSMESHGen()) { + std::string str; + if (stream >> str) { + if ( StudyContext* myStudyContext = gen->GetCurrentStudyContext() ) { + string ior = myStudyContext->getIORbyOldId( atoi( str.c_str() )); + if ( !ior.empty() ) + return TInterface::_narrow(gen->GetORB()->string_to_object( ior.c_str() )); + } + } + } + return TInterface::_nil(); + } +}; + +#endif diff --git a/src/StdMeshers_I/StdMeshers_Prism_3D_i.cxx b/src/StdMeshers_I/StdMeshers_Prism_3D_i.cxx new file mode 100644 index 000000000..67736fd88 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_Prism_3D_i.cxx @@ -0,0 +1,104 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Prism_3D_i.cxx +// Moved here from SMESH_Prism_3D_i.cxx +// Author : Paul RASCLE, EDF +// Module : SMESH +// $Header$ + +#include "StdMeshers_Prism_3D_i.hxx" +#include "SMESH_Gen.hxx" + +#include "Utils_CorbaException.hxx" +#include "utilities.h" + +using namespace std; + +//============================================================================= +/*! + * StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i + */ +//============================================================================= + +StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ), + SMESH_Algo_i( thePOA ), + SMESH_3D_Algo_i( thePOA ) +{ + MESSAGE( "StdMeshers_Prism_3D_i::StdMeshers_Prism_3D_i" ); + myBaseImpl = new ::StdMeshers_Prism_3D( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} +//----------------------------------------------------------------------------- + +StdMeshers_Prism_3D_i::~StdMeshers_Prism_3D_i() +{ + MESSAGE( "StdMeshers_Prism_3D_i::~StdMeshers_Prism_3D_i" ); +} +//----------------------------------------------------------------------------- + +::StdMeshers_Prism_3D* StdMeshers_Prism_3D_i::GetImpl() +{ + MESSAGE( "StdMeshers_Prism_3D_i::GetImpl" ); + return ( ::StdMeshers_Prism_3D* )myBaseImpl; +} + + +//============================================================================= +/*! + * StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i + */ +//============================================================================= + +StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ), + SMESH_Algo_i( thePOA ), + SMESH_3D_Algo_i( thePOA ) +{ + MESSAGE( "StdMeshers_RadialPrism_3D_i::StdMeshers_RadialPrism_3D_i" ); + myBaseImpl = new ::StdMeshers_RadialPrism_3D( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} +//----------------------------------------------------------------------------- + +StdMeshers_RadialPrism_3D_i::~StdMeshers_RadialPrism_3D_i() +{ + MESSAGE( "StdMeshers_RadialPrism_3D_i::~StdMeshers_RadialPrism_3D_i" ); +} +//----------------------------------------------------------------------------- + +::StdMeshers_RadialPrism_3D* StdMeshers_RadialPrism_3D_i::GetImpl() +{ + MESSAGE( "StdMeshers_RadialPrism_3D_i::GetImpl" ); + return ( ::StdMeshers_RadialPrism_3D* )myBaseImpl; +} + diff --git a/src/StdMeshers_I/StdMeshers_Prism_3D_i.hxx b/src/StdMeshers_I/StdMeshers_Prism_3D_i.hxx new file mode 100644 index 000000000..5d4a7b7d1 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_Prism_3D_i.hxx @@ -0,0 +1,83 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Prism_3D_i.hxx +// Moved here from SMESH_Prism_3D_i.hxx +// Author : Paul RASCLE, EDF +// Module : SMESH +// $Header$ + +#ifndef _SMESH_Prism_3D_I_HXX_ +#define _SMESH_Prism_3D_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) + +#include "SMESH_3D_Algo_i.hxx" +#include "StdMeshers_Prism_3D.hxx" +#include "StdMeshers_RadialPrism_3D.hxx" + +class SMESH_Gen; + +// ====================================================== +// Prism 3d algorithm +// ====================================================== +class StdMeshers_Prism_3D_i: + public virtual POA_StdMeshers::StdMeshers_Prism_3D, + public virtual SMESH_3D_Algo_i +{ +public: + // Constructor + StdMeshers_Prism_3D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + + // Destructor + virtual ~StdMeshers_Prism_3D_i(); + + // Get implementation + ::StdMeshers_Prism_3D* GetImpl(); +}; + +// ====================================================== +// Radial Prism 3d algorithm +// ====================================================== +class StdMeshers_RadialPrism_3D_i: + public virtual POA_StdMeshers::StdMeshers_RadialPrism_3D, + public virtual SMESH_3D_Algo_i +{ +public: + // Constructor + StdMeshers_RadialPrism_3D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + + // Destructor + virtual ~StdMeshers_RadialPrism_3D_i(); + + // Get implementation + ::StdMeshers_RadialPrism_3D* GetImpl(); +}; + + +#endif diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx new file mode 100644 index 000000000..2b3055a6c --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.cxx @@ -0,0 +1,288 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource1D_i.cxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#include "StdMeshers_ProjectionSource1D_i.hxx" + +#include "SMESH_Gen_i.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_PythonDump.hxx" + +#include "Utils_CorbaException.hxx" +#include "utilities.h" + +#include "StdMeshers_ObjRefUlils.hxx" + +using namespace std; + +//============================================================================= +/*! + * StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i + * + * Constructor + */ +//============================================================================= + +StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i +( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ) +{ + MESSAGE( "StdMeshers_ProjectionSource1D_i::StdMeshers_ProjectionSource1D_i" ); + myBaseImpl = new ::StdMeshers_ProjectionSource1D( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} + +//============================================================================= +/*! + * StdMeshers_ProjectionSource1D_i::~StdMeshers_ProjectionSource1D_i + * + * Destructor + */ +//============================================================================= + +StdMeshers_ProjectionSource1D_i::~StdMeshers_ProjectionSource1D_i() +{ + MESSAGE( "StdMeshers_ProjectionSource1D_i::~StdMeshers_ProjectionSource1D_i" ); +} + +//============================================================================= + /*! + * Sets source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource1D_i::SetSourceEdge(GEOM::GEOM_Object_ptr edge) + throw ( SALOME::SALOME_Exception ) +{ + ASSERT( myBaseImpl ); + try { + this->GetImpl()->SetSourceEdge( StdMeshers_ObjRefUlils::GeomObjectToShape( edge )); + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + // Update Python script + SMESH::TPythonDump() << _this() << ".SetSourceEdge( " << edge << " )"; +} + +//============================================================================= +/*! + * Sets vertex association between the source edge and the target one. + * This parameter is optional + */ +//============================================================================= + +void StdMeshers_ProjectionSource1D_i::SetVertexAssociation(GEOM::GEOM_Object_ptr sourceVertex, + GEOM::GEOM_Object_ptr targetVertex) + throw ( SALOME::SALOME_Exception ) +{ + ASSERT( myBaseImpl ); + try { + TopoDS_Shape v1 = StdMeshers_ObjRefUlils::GeomObjectToShape( sourceVertex ); + TopoDS_Shape v2 = StdMeshers_ObjRefUlils::GeomObjectToShape( targetVertex ); + this->GetImpl()->SetVertexAssociation( v1, v2 ); + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + // Update Python script + SMESH::TPythonDump() << _this() << ".SetVertexAssociation( " + << sourceVertex << ", " << targetVertex << " )"; +} + +//============================================================================= +/*! + * Sets source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource1D_i::SetSourceMesh(SMESH::SMESH_Mesh_ptr theMesh) + throw ( SALOME::SALOME_Exception ) +{ + ASSERT( myBaseImpl ); + + ::SMESH_Mesh* mesh = 0; + + if ( !CORBA::is_nil( theMesh )) + { + SMESH_Mesh_i* mesh_i = SMESH::DownCast< SMESH_Mesh_i* >( theMesh ); + if ( !mesh_i ) + THROW_SALOME_CORBA_EXCEPTION( "bad mesh", SALOME::BAD_PARAM ); + mesh = &mesh_i->GetImpl(); + } + + try { + this->GetImpl()->SetSourceMesh ( mesh ); + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + + myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( theMesh ); + + // Update Python script + SMESH::TPythonDump() << _this() << ".SetSourceMesh( " << theMesh << " )"; +} + +//============================================================================= +/*! + * Return source mesh + */ +//============================================================================= + +SMESH::SMESH_Mesh_ptr StdMeshers_ProjectionSource1D_i::GetSourceMesh() +{ + SMESH::SMESH_Mesh_var mesh = myCorbaMesh; + return mesh._retn(); +} + +//============================================================================= +/*! + * Returns the source edge + */ +//============================================================================= + +GEOM::GEOM_Object_ptr StdMeshers_ProjectionSource1D_i::GetSourceEdge() +{ + ASSERT( myBaseImpl ); + return StdMeshers_ObjRefUlils::ShapeToGeomObject( this->GetImpl()->GetSourceEdge() ); +} + +//============================================================================= +/*! + * Returns the vertex associated with the target vertex. + * Result may be nil if association not set + */ +//============================================================================= + +GEOM::GEOM_Object_ptr StdMeshers_ProjectionSource1D_i::GetSourceVertex() +{ + ASSERT( myBaseImpl ); + return StdMeshers_ObjRefUlils::ShapeToGeomObject( this->GetImpl()->GetSourceVertex() ); +} + +//============================================================================= +/*! + * Returns the vertex associated with the source vertex. + * Result may be nil if association not set + */ +//============================================================================= + +GEOM::GEOM_Object_ptr StdMeshers_ProjectionSource1D_i::GetTargetVertex() +{ + ASSERT( myBaseImpl ); + return StdMeshers_ObjRefUlils::ShapeToGeomObject( this->GetImpl()->GetTargetVertex() ); +} + +//============================================================================= +/*! + * StdMeshers_ProjectionSource1D_i::GetImpl + * + * Get implementation + */ +//============================================================================= + +::StdMeshers_ProjectionSource1D* StdMeshers_ProjectionSource1D_i::GetImpl() +{ + return ( ::StdMeshers_ProjectionSource1D* )myBaseImpl; +} + +//================================================================================ +/*! + * \brief Verify whether hypothesis supports given entity type + * \param type - dimension (see SMESH::Dimension enumeration) + * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise + * + * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) + */ +//================================================================================ +CORBA::Boolean StdMeshers_ProjectionSource1D_i::IsDimSupported( SMESH::Dimension type ) +{ + return type == SMESH::DIM_1D; +} + +//================================================================================ +/*! + * \brief Write parameters in a string + * \retval char* - resulting string + */ +//================================================================================ + +char* StdMeshers_ProjectionSource1D_i::SaveTo() +{ + ASSERT( myBaseImpl ); + std::ostringstream os; + + TopoDS_Shape s1, s2, s3; + GetImpl()->GetStoreParams( s1, s2, s3 ); + + StdMeshers_ObjRefUlils::SaveToStream( s1, os ); + StdMeshers_ObjRefUlils::SaveToStream( s2, os ); + StdMeshers_ObjRefUlils::SaveToStream( s3, os ); + StdMeshers_ObjRefUlils::SaveToStream( GetSourceMesh(), os ); + + myBaseImpl->SaveTo( os ); + + return CORBA::string_dup( os.str().c_str() ); +} + +//================================================================================ +/*! + * \brief Retrieve parameters from the string + * \param theStream - the input string + */ +//================================================================================ + +void StdMeshers_ProjectionSource1D_i::LoadFrom( const char* theStream ) +{ + ASSERT( myBaseImpl ); + std::istringstream is( theStream ); + + TopoDS_Shape s1 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + TopoDS_Shape s2 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + TopoDS_Shape s3 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + SMESH::SMESH_Mesh_var mesh = + StdMeshers_ObjRefUlils::LoadObjectFromStream< SMESH::SMESH_Mesh >( is ); + + ::SMESH_Mesh* meshImpl = 0; + + if ( !CORBA::is_nil( mesh )) + { + SMESH_Mesh_i* mesh_i = SMESH::DownCast< SMESH_Mesh_i* >( mesh ); + if ( mesh_i ) + meshImpl = &mesh_i->GetImpl(); + } + + myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( mesh ); + GetImpl()->RestoreParams( s1, s2, s3, meshImpl ); + + myBaseImpl->LoadFrom( is ); +} + diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx new file mode 100644 index 000000000..0284ba09b --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource1D_i.hxx @@ -0,0 +1,118 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource1D_i.hxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#ifndef _SMESH_ProjectionSource1D_I_HXX_ +#define _SMESH_ProjectionSource1D_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) +#include CORBA_SERVER_HEADER(SMESH_Mesh) + +#include "SMESH_Hypothesis_i.hxx" +#include "StdMeshers_ProjectionSource1D.hxx" + +class SMESH_Gen; + +// ========================================================= +/*! + * This hypothesis specifies a meshed edge to take a mesh pattern from + * and optionally association of vertices between the source edge and a + * target one (where a hipothesis is assigned to) + */ +// ========================================================= + +class StdMeshers_ProjectionSource1D_i: + public virtual POA_StdMeshers::StdMeshers_ProjectionSource1D, + public virtual SMESH_Hypothesis_i +{ +public: + // Constructor + StdMeshers_ProjectionSource1D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + // Destructor + virtual ~StdMeshers_ProjectionSource1D_i(); + + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceEdge(GEOM::GEOM_Object_ptr edge) + throw ( SALOME::SALOME_Exception ); + + /*! + * Returns the source edge + */ + GEOM::GEOM_Object_ptr GetSourceEdge(); + + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceMesh(SMESH::SMESH_Mesh_ptr mesh) + throw ( SALOME::SALOME_Exception ); + + /*! + * Return source mesh + */ + SMESH::SMESH_Mesh_ptr GetSourceMesh(); + + /*! + * Sets vertex association between the source edge and the target one. + * This parameter is optional + */ + void SetVertexAssociation(GEOM::GEOM_Object_ptr sourceVertex, + GEOM::GEOM_Object_ptr targetVertex) + throw ( SALOME::SALOME_Exception ); + + /*! + * Returns the vertex associated with the target vertex. + * Result may be nil if association not set + */ + GEOM::GEOM_Object_ptr GetSourceVertex(); + + /*! + * Returns the vertex associated with the source vertex. + * Result may be nil if association not set + */ + GEOM::GEOM_Object_ptr GetTargetVertex(); + + // Get implementation + ::StdMeshers_ProjectionSource1D* GetImpl(); + + // Verify whether hypothesis supports given entity type + CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Redefined Persistence + virtual char* SaveTo(); + virtual void LoadFrom( const char* theStream ); + +private: + SMESH::SMESH_Mesh_var myCorbaMesh; +}; + +#endif diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx new file mode 100644 index 000000000..c1a4e2913 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.cxx @@ -0,0 +1,300 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource2D_i.cxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#include "StdMeshers_ProjectionSource2D_i.hxx" + +#include "SMESH_Gen_i.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_PythonDump.hxx" + +#include "Utils_CorbaException.hxx" +#include "utilities.h" + +#include "StdMeshers_ObjRefUlils.hxx" + +using namespace std; + +//============================================================================= +/*! + * StdMeshers_ProjectionSource2D_i::StdMeshers_ProjectionSource2D_i + * + * Constructor + */ +//============================================================================= + +StdMeshers_ProjectionSource2D_i::StdMeshers_ProjectionSource2D_i +( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ) +{ + MESSAGE( "StdMeshers_ProjectionSource2D_i::StdMeshers_ProjectionSource2D_i" ); + myBaseImpl = new ::StdMeshers_ProjectionSource2D( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} + +//============================================================================= +/*! + * StdMeshers_ProjectionSource2D_i::~StdMeshers_ProjectionSource2D_i + * + * Destructor + */ +//============================================================================= + +StdMeshers_ProjectionSource2D_i::~StdMeshers_ProjectionSource2D_i() +{ + MESSAGE( "StdMeshers_ProjectionSource2D_i::~StdMeshers_ProjectionSource2D_i" ); +} + +//============================================================================= + /*! + * Sets a source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource2D_i::SetSourceFace(GEOM::GEOM_Object_ptr face) + throw ( SALOME::SALOME_Exception ) +{ + ASSERT( myBaseImpl ); + try { + this->GetImpl()->SetSourceFace( StdMeshers_ObjRefUlils::GeomObjectToShape( face )); + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + // Update Python script + SMESH::TPythonDump() << _this() << ".SetSourceFace( " << face << " )"; +} + +//============================================================================= +/*! + * Sets source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource2D_i::SetSourceMesh(SMESH::SMESH_Mesh_ptr theMesh) + throw ( SALOME::SALOME_Exception ) +{ + ASSERT( myBaseImpl ); + + ::SMESH_Mesh* mesh = 0; + + if ( !CORBA::is_nil( theMesh )) + { + SMESH_Mesh_i* mesh_i = SMESH::DownCast< SMESH_Mesh_i* >( theMesh ); + if ( !mesh_i ) + THROW_SALOME_CORBA_EXCEPTION( "bad mesh", SALOME::BAD_PARAM ); + mesh = &mesh_i->GetImpl(); + } + + try { + this->GetImpl()->SetSourceMesh ( mesh ); + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + + myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( theMesh ); + + // Update Python script + SMESH::TPythonDump() << _this() << ".SetSourceMesh( " << theMesh << " )"; +} + +//============================================================================= +/*! + * Return source mesh + */ +//============================================================================= + +SMESH::SMESH_Mesh_ptr StdMeshers_ProjectionSource2D_i::GetSourceMesh() +{ + SMESH::SMESH_Mesh_var mesh = myCorbaMesh; + return mesh._retn(); +} + +//============================================================================= +/*! + * Sets vertex association between the source face and the target one. + * This parameter is optional. + * Two vertices must belong to one edge of a face + */ +//============================================================================= + +void StdMeshers_ProjectionSource2D_i::SetVertexAssociation(GEOM::GEOM_Object_ptr sourceVertex1, + GEOM::GEOM_Object_ptr sourceVertex2, + GEOM::GEOM_Object_ptr targetVertex1, + GEOM::GEOM_Object_ptr targetVertex2) + throw ( SALOME::SALOME_Exception ) +{ + ASSERT( myBaseImpl ); + try { + TopoDS_Shape v1 = StdMeshers_ObjRefUlils::GeomObjectToShape( sourceVertex1 ); + TopoDS_Shape v2 = StdMeshers_ObjRefUlils::GeomObjectToShape( sourceVertex2 ); + TopoDS_Shape v3 = StdMeshers_ObjRefUlils::GeomObjectToShape( targetVertex1 ); + TopoDS_Shape v4 = StdMeshers_ObjRefUlils::GeomObjectToShape( targetVertex2 ); + this->GetImpl()->SetVertexAssociation( v1, v2, v3, v4 ); + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + // Update Python script + SMESH::TPythonDump() << _this() << ".SetVertexAssociation( " + << sourceVertex1 << ", " + << sourceVertex2 << ", " + << targetVertex1 << ", " + << targetVertex2 << " )"; +} + +//============================================================================= +/*! + * Returns the source face + */ +//============================================================================= + +GEOM::GEOM_Object_ptr StdMeshers_ProjectionSource2D_i::GetSourceFace() +{ + ASSERT( myBaseImpl ); + return StdMeshers_ObjRefUlils::ShapeToGeomObject( this->GetImpl()->GetSourceFace() ); +} + +//============================================================================= +/*! + * Returns the vertex associated with the target vertex. + * Result may be nil if association not set + */ +//============================================================================= + +GEOM::GEOM_Object_ptr StdMeshers_ProjectionSource2D_i::GetSourceVertex(CORBA::Long i) +{ + ASSERT( myBaseImpl ); + return StdMeshers_ObjRefUlils::ShapeToGeomObject( this->GetImpl()->GetSourceVertex((int) i )); +} + +//============================================================================= +/*! + * Returns the -th target vertex associated with the -th source vertex. + * Result may be nil if association not set. + */ +//============================================================================= + +GEOM::GEOM_Object_ptr StdMeshers_ProjectionSource2D_i::GetTargetVertex(CORBA::Long i) +{ + ASSERT( myBaseImpl ); + return StdMeshers_ObjRefUlils::ShapeToGeomObject( this->GetImpl()->GetTargetVertex( (int)i )); +} + +//============================================================================= +/*! + * StdMeshers_ProjectionSource2D_i::GetImpl + * + * Get implementation + */ +//============================================================================= + +::StdMeshers_ProjectionSource2D* StdMeshers_ProjectionSource2D_i::GetImpl() +{ + return ( ::StdMeshers_ProjectionSource2D* )myBaseImpl; +} + +//================================================================================ +/*! + * \brief Verify whether hypothesis supports given entity type + * \param type - dimension (see SMESH::Dimension enumeration) + * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise + * + * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) + */ +//================================================================================ +CORBA::Boolean StdMeshers_ProjectionSource2D_i::IsDimSupported( SMESH::Dimension type ) +{ + return type == SMESH::DIM_2D; +} + +//================================================================================ +/*! + * \brief Write parameters in a string + * \retval char* - resulting string + */ +//================================================================================ + +char* StdMeshers_ProjectionSource2D_i::SaveTo() +{ + ASSERT( myBaseImpl ); + std::ostringstream os; + + TopoDS_Shape s1, s2, s3, s4, s5; + GetImpl()->GetStoreParams( s1, s2, s3, s4, s5 ); + + StdMeshers_ObjRefUlils::SaveToStream( s1, os ); + StdMeshers_ObjRefUlils::SaveToStream( s2, os ); + StdMeshers_ObjRefUlils::SaveToStream( s3, os ); + StdMeshers_ObjRefUlils::SaveToStream( s4, os ); + StdMeshers_ObjRefUlils::SaveToStream( s5, os ); + StdMeshers_ObjRefUlils::SaveToStream( GetSourceMesh(), os ); + + myBaseImpl->SaveTo( os ); + + return CORBA::string_dup( os.str().c_str() ); +} + +//================================================================================ +/*! + * \brief Retrieve parameters from the string + * \param theStream - the input string + */ +//================================================================================ + +void StdMeshers_ProjectionSource2D_i::LoadFrom( const char* theStream ) +{ + ASSERT( myBaseImpl ); + std::istringstream is( theStream ); + + TopoDS_Shape s1 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + TopoDS_Shape s2 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + TopoDS_Shape s3 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + TopoDS_Shape s4 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + TopoDS_Shape s5 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + SMESH::SMESH_Mesh_var mesh = + StdMeshers_ObjRefUlils::LoadObjectFromStream< SMESH::SMESH_Mesh >( is ); + + ::SMESH_Mesh* meshImpl = 0; + + if ( !CORBA::is_nil( mesh )) + { + SMESH_Mesh_i* mesh_i = SMESH::DownCast< SMESH_Mesh_i* >( mesh ); + if ( mesh_i ) + meshImpl = &mesh_i->GetImpl(); + } + + myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( mesh ); + GetImpl()->RestoreParams( s1, s2, s3, s4, s5, meshImpl ); + + myBaseImpl->LoadFrom( is ); +} + diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx new file mode 100644 index 000000000..836edfc23 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource2D_i.hxx @@ -0,0 +1,122 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource2D_i.hxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#ifndef _SMESH_ProjectionSource2D_I_HXX_ +#define _SMESH_ProjectionSource2D_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) +#include CORBA_SERVER_HEADER(SMESH_Mesh) + +#include "SMESH_Hypothesis_i.hxx" +#include "StdMeshers_ProjectionSource2D.hxx" + +class SMESH_Gen; + +// ========================================================= +/*! + * This hypothesis specifies a meshed face to take a mesh pattern from + * and optionally association of vertices between the source face and a + * target one (where a hipothesis is assigned to) + */ +// ========================================================= + +class StdMeshers_ProjectionSource2D_i: + public virtual POA_StdMeshers::StdMeshers_ProjectionSource2D, + public virtual SMESH_Hypothesis_i +{ +public: + // Constructor + StdMeshers_ProjectionSource2D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + // Destructor + virtual ~StdMeshers_ProjectionSource2D_i(); + + /*! + * Sets a source to take a mesh pattern from + */ + void SetSourceFace(GEOM::GEOM_Object_ptr face) + throw ( SALOME::SALOME_Exception ); + + /*! + * Returns the source face + */ + GEOM::GEOM_Object_ptr GetSourceFace(); + + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceMesh(SMESH::SMESH_Mesh_ptr mesh) + throw ( SALOME::SALOME_Exception ); + + /*! + * Return source mesh + */ + SMESH::SMESH_Mesh_ptr GetSourceMesh(); + + /*! + * Sets vertex association between the source face and the target one. + * This parameter is optional. + * Two vertices must belong to one edge of a face + */ + void SetVertexAssociation(GEOM::GEOM_Object_ptr sourceVertex1, + GEOM::GEOM_Object_ptr sourceVertex2, + GEOM::GEOM_Object_ptr targetVertex1, + GEOM::GEOM_Object_ptr targetVertex2) + throw ( SALOME::SALOME_Exception ); + + /*! + * Returns the -th source vertex associated with the -th target vertex. + * Result may be nil if association not set. + */ + GEOM::GEOM_Object_ptr GetSourceVertex(CORBA::Long i); + + /*! + * Returns the -th target vertex associated with the -th source vertex. + * Result may be nil if association not set. + */ + GEOM::GEOM_Object_ptr GetTargetVertex(CORBA::Long i); + + // Get implementation + ::StdMeshers_ProjectionSource2D* GetImpl(); + + // Verify whether hypothesis supports given entity type + CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Redefined Persistence + virtual char* SaveTo(); + virtual void LoadFrom( const char* theStream ); + +private: + SMESH::SMESH_Mesh_var myCorbaMesh; +}; + +#endif + diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx new file mode 100644 index 000000000..c0c4f4f66 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.cxx @@ -0,0 +1,299 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's classes +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource3D_i.cxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#include "StdMeshers_ProjectionSource3D_i.hxx" + +#include "SMESH_Gen_i.hxx" +#include "SMESH_Gen.hxx" +#include "SMESH_PythonDump.hxx" + +#include "Utils_CorbaException.hxx" +#include "utilities.h" + +#include "StdMeshers_ObjRefUlils.hxx" + +using namespace std; + +//============================================================================= +/*! + * StdMeshers_ProjectionSource3D_i::StdMeshers_ProjectionSource3D_i + * + * Constructor + */ +//============================================================================= + +StdMeshers_ProjectionSource3D_i::StdMeshers_ProjectionSource3D_i +( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ) +{ + MESSAGE( "StdMeshers_ProjectionSource3D_i::StdMeshers_ProjectionSource3D_i" ); + myBaseImpl = new ::StdMeshers_ProjectionSource3D( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} + +//============================================================================= +/*! + * StdMeshers_ProjectionSource3D_i::~StdMeshers_ProjectionSource3D_i + * + * Destructor + */ +//============================================================================= + +StdMeshers_ProjectionSource3D_i::~StdMeshers_ProjectionSource3D_i() +{ + MESSAGE( "StdMeshers_ProjectionSource3D_i::~StdMeshers_ProjectionSource3D_i" ); +} + +//============================================================================= + /*! + * Sets a source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource3D_i::SetSource3DShape(GEOM::GEOM_Object_ptr shape) + throw ( SALOME::SALOME_Exception ) +{ + ASSERT( myBaseImpl ); + try { + this->GetImpl()->SetSource3DShape( StdMeshers_ObjRefUlils::GeomObjectToShape( shape )); + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + // Update Python script + SMESH::TPythonDump() << _this() << ".SetSource3DShape( " << shape << " )"; +} + +//============================================================================= +/*! + * Sets source to take a mesh pattern from + */ +//============================================================================= + +void StdMeshers_ProjectionSource3D_i::SetSourceMesh(SMESH::SMESH_Mesh_ptr theMesh) + throw ( SALOME::SALOME_Exception ) +{ + ASSERT( myBaseImpl ); + + ::SMESH_Mesh* mesh = 0; + + if ( !CORBA::is_nil( theMesh )) + { + SMESH_Mesh_i* mesh_i = SMESH::DownCast< SMESH_Mesh_i* >( theMesh ); + if ( !mesh_i ) + THROW_SALOME_CORBA_EXCEPTION( "bad mesh", SALOME::BAD_PARAM ); + mesh = &mesh_i->GetImpl(); + } + + try { + this->GetImpl()->SetSourceMesh ( mesh ); + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + + myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( theMesh ); + + // Update Python script + SMESH::TPythonDump() << _this() << ".SetSourceMesh( " << theMesh << " )"; +} + +//============================================================================= +/*! + * Return source mesh + */ +//============================================================================= + +SMESH::SMESH_Mesh_ptr StdMeshers_ProjectionSource3D_i::GetSourceMesh() +{ + SMESH::SMESH_Mesh_var mesh = myCorbaMesh; + return mesh._retn(); +} + +//============================================================================= +/*! + * Sets vertex association between the source shape and the target one. + * This parameter is optional. + * Two vertices must belong to one edge of a shape + */ +//============================================================================= + +void StdMeshers_ProjectionSource3D_i::SetVertexAssociation(GEOM::GEOM_Object_ptr sourceVertex1, + GEOM::GEOM_Object_ptr sourceVertex2, + GEOM::GEOM_Object_ptr targetVertex1, + GEOM::GEOM_Object_ptr targetVertex2) + throw ( SALOME::SALOME_Exception ) +{ + ASSERT( myBaseImpl ); + try { + TopoDS_Shape v1 = StdMeshers_ObjRefUlils::GeomObjectToShape( sourceVertex1 ); + TopoDS_Shape v2 = StdMeshers_ObjRefUlils::GeomObjectToShape( sourceVertex2 ); + TopoDS_Shape v3 = StdMeshers_ObjRefUlils::GeomObjectToShape( targetVertex1 ); + TopoDS_Shape v4 = StdMeshers_ObjRefUlils::GeomObjectToShape( targetVertex2 ); + this->GetImpl()->SetVertexAssociation( v1, v2, v3, v4 ); + } + catch ( SALOME_Exception& S_ex ) { + THROW_SALOME_CORBA_EXCEPTION( S_ex.what(), SALOME::BAD_PARAM ); + } + // Update Python script + SMESH::TPythonDump() << _this() << ".SetVertexAssociation( " + << sourceVertex1 << ", " + << sourceVertex2 << ", " + << targetVertex1 << ", " + << targetVertex2 << " )"; +} + +//============================================================================= +/*! + * Returns the source face + */ +//============================================================================= + +GEOM::GEOM_Object_ptr StdMeshers_ProjectionSource3D_i::GetSource3DShape() +{ + ASSERT( myBaseImpl ); + return StdMeshers_ObjRefUlils::ShapeToGeomObject( this->GetImpl()->GetSource3DShape() ); +} + +//============================================================================= +/*! + * Returns the vertex associated with the target vertex. + * Result may be nil if association not set + */ +//============================================================================= + +GEOM::GEOM_Object_ptr StdMeshers_ProjectionSource3D_i::GetSourceVertex(CORBA::Long i) +{ + ASSERT( myBaseImpl ); + return StdMeshers_ObjRefUlils::ShapeToGeomObject( this->GetImpl()->GetSourceVertex((int) i )); +} + +//============================================================================= +/*! + * Returns the -th target vertex associated with the -th source vertex. + * Result may be nil if association not set. + */ +//============================================================================= + +GEOM::GEOM_Object_ptr StdMeshers_ProjectionSource3D_i::GetTargetVertex(CORBA::Long i) +{ + ASSERT( myBaseImpl ); + return StdMeshers_ObjRefUlils::ShapeToGeomObject( this->GetImpl()->GetTargetVertex( (int)i )); +} + +//============================================================================= +/*! + * StdMeshers_ProjectionSource3D_i::GetImpl + * + * Get implementation + */ +//============================================================================= + +::StdMeshers_ProjectionSource3D* StdMeshers_ProjectionSource3D_i::GetImpl() +{ + return ( ::StdMeshers_ProjectionSource3D* )myBaseImpl; +} + +//================================================================================ +/*! + * \brief Verify whether hypothesis supports given entity type + * \param type - dimension (see SMESH::Dimension enumeration) + * \retval CORBA::Boolean - TRUE if dimension is supported, FALSE otherwise + * + * Verify whether hypothesis supports given entity type (see SMESH::Dimension enumeration) + */ +//================================================================================ +CORBA::Boolean StdMeshers_ProjectionSource3D_i::IsDimSupported( SMESH::Dimension type ) +{ + return type == SMESH::DIM_3D; +} + +//================================================================================ +/*! + * \brief Write parameters in a string + * \retval char* - resulting string + */ +//================================================================================ + +char* StdMeshers_ProjectionSource3D_i::SaveTo() +{ + ASSERT( myBaseImpl ); + std::ostringstream os; + + TopoDS_Shape s1, s2, s3, s4, s5; + GetImpl()->GetStoreParams( s1, s2, s3, s4, s5 ); + + StdMeshers_ObjRefUlils::SaveToStream( s1, os ); + StdMeshers_ObjRefUlils::SaveToStream( s2, os ); + StdMeshers_ObjRefUlils::SaveToStream( s3, os ); + StdMeshers_ObjRefUlils::SaveToStream( s4, os ); + StdMeshers_ObjRefUlils::SaveToStream( s5, os ); + StdMeshers_ObjRefUlils::SaveToStream( GetSourceMesh(), os ); + + myBaseImpl->SaveTo( os ); + + return CORBA::string_dup( os.str().c_str() ); +} + +//================================================================================ +/*! + * \brief Retrieve parameters from the string + * \param theStream - the input string + */ +//================================================================================ + +void StdMeshers_ProjectionSource3D_i::LoadFrom( const char* theStream ) +{ + ASSERT( myBaseImpl ); + std::istringstream is( theStream ); + + TopoDS_Shape s1 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + TopoDS_Shape s2 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + TopoDS_Shape s3 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + TopoDS_Shape s4 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + TopoDS_Shape s5 = StdMeshers_ObjRefUlils::LoadFromStream( is ); + SMESH::SMESH_Mesh_var mesh = + StdMeshers_ObjRefUlils::LoadObjectFromStream< SMESH::SMESH_Mesh >( is ); + + ::SMESH_Mesh* meshImpl = 0; + + if ( !CORBA::is_nil( mesh )) + { + SMESH_Mesh_i* mesh_i = SMESH::DownCast< SMESH_Mesh_i* >( mesh ); + if ( mesh_i ) + meshImpl = &mesh_i->GetImpl(); + } + + myCorbaMesh = SMESH::SMESH_Mesh::_duplicate( mesh ); + GetImpl()->RestoreParams( s1, s2, s3, s4, s5, meshImpl ); + myBaseImpl->LoadFrom( is ); +} + diff --git a/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx new file mode 100644 index 000000000..753331488 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_ProjectionSource3D_i.hxx @@ -0,0 +1,122 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_ProjectionSource3D_i.hxx +// Author : Edward AGAPOV +// Module : SMESH +// $Header$ + +#ifndef _SMESH_ProjectionSource3D_I_HXX_ +#define _SMESH_ProjectionSource3D_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) +#include CORBA_SERVER_HEADER(SMESH_Mesh) + +#include "SMESH_Hypothesis_i.hxx" +#include "StdMeshers_ProjectionSource3D.hxx" + +class SMESH_Gen; + +// ========================================================= +/*! + * This hypothesis specifies a meshed shell or solid to take a mesh pattern from + * and optionally association of vertices between the source shape and a + * target one (where a hipothesis is assigned to) + */ +// ========================================================= + +class StdMeshers_ProjectionSource3D_i: + public virtual POA_StdMeshers::StdMeshers_ProjectionSource3D, + public virtual SMESH_Hypothesis_i +{ +public: + // Constructor + StdMeshers_ProjectionSource3D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + // Destructor + virtual ~StdMeshers_ProjectionSource3D_i(); + + /*! + * Sets a source to take a mesh pattern from + */ + void SetSource3DShape(GEOM::GEOM_Object_ptr shape) + throw ( SALOME::SALOME_Exception ); + + /*! + * Returns the source shape + */ + GEOM::GEOM_Object_ptr GetSource3DShape(); + + /*! + * Sets source to take a mesh pattern from + */ + void SetSourceMesh(SMESH::SMESH_Mesh_ptr mesh) + throw ( SALOME::SALOME_Exception ); + + /*! + * Return source mesh + */ + SMESH::SMESH_Mesh_ptr GetSourceMesh(); + + /*! + * Sets vertex association between the source shape and the target one. + * This parameter is optional. + * Two vertices must belong to one edge of a shape + */ + void SetVertexAssociation(GEOM::GEOM_Object_ptr sourceVertex1, + GEOM::GEOM_Object_ptr sourceVertex2, + GEOM::GEOM_Object_ptr targetVertex1, + GEOM::GEOM_Object_ptr targetVertex2) + throw ( SALOME::SALOME_Exception ); + + /*! + * Returns the -th source vertex associated with the -th target vertex. + * Result may be nil if association not set. + */ + GEOM::GEOM_Object_ptr GetSourceVertex(CORBA::Long i); + + /*! + * Returns the -th target vertex associated with the -th source vertex. + * Result may be nil if association not set. + */ + GEOM::GEOM_Object_ptr GetTargetVertex(CORBA::Long i); + + // Get implementation + ::StdMeshers_ProjectionSource3D* GetImpl(); + + // Verify whether hypothesis supports given entity type + CORBA::Boolean IsDimSupported( SMESH::Dimension type ); + + + // Redefined Persistence + virtual char* SaveTo(); + virtual void LoadFrom( const char* theStream ); + +private: + SMESH::SMESH_Mesh_var myCorbaMesh; +}; + +#endif + diff --git a/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.cxx b/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.cxx new file mode 100644 index 000000000..e1037523e --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.cxx @@ -0,0 +1,140 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Projection_3D_i.cxx +// Moved here from SMESH_Projection_3D_i.cxx +// Author : Paul RASCLE, EDF +// Module : SMESH +// $Header$ + +#include "StdMeshers_Projection_1D_2D_3D_i.hxx" + +#include "SMESH_Gen.hxx" + +#include "Utils_CorbaException.hxx" +#include "utilities.h" + +#include "StdMeshers_ObjRefUlils.hxx" + +using namespace std; + +//============================================================================= +/*! + * StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i + */ +//============================================================================= + +StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ), + SMESH_Algo_i( thePOA ), + SMESH_3D_Algo_i( thePOA ) +{ + MESSAGE( "StdMeshers_Projection_3D_i::StdMeshers_Projection_3D_i" ); + myBaseImpl = new ::StdMeshers_Projection_3D( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} +//----------------------------------------------------------------------------- + +StdMeshers_Projection_3D_i::~StdMeshers_Projection_3D_i() +{ + MESSAGE( "StdMeshers_Projection_3D_i::~StdMeshers_Projection_3D_i" ); +} +//----------------------------------------------------------------------------- + +::StdMeshers_Projection_3D* StdMeshers_Projection_3D_i::GetImpl() +{ + MESSAGE( "StdMeshers_Projection_3D_i::GetImpl" ); + return ( ::StdMeshers_Projection_3D* )myBaseImpl; +} + + +//============================================================================= +/*! + * StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i + */ +//============================================================================= + +StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ), + SMESH_Algo_i( thePOA ), + SMESH_2D_Algo_i( thePOA ) +{ + MESSAGE( "StdMeshers_Projection_2D_i::StdMeshers_Projection_2D_i" ); + myBaseImpl = new ::StdMeshers_Projection_2D( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} +//----------------------------------------------------------------------------- + +StdMeshers_Projection_2D_i::~StdMeshers_Projection_2D_i() +{ + MESSAGE( "StdMeshers_Projection_2D_i::~StdMeshers_Projection_2D_i" ); +} +//----------------------------------------------------------------------------- + +::StdMeshers_Projection_2D* StdMeshers_Projection_2D_i::GetImpl() +{ + MESSAGE( "StdMeshers_Projection_2D_i::GetImpl" ); + return ( ::StdMeshers_Projection_2D* )myBaseImpl; +} + + +//============================================================================= +/*! + * StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i + */ +//============================================================================= + +StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ) + : SALOME::GenericObj_i( thePOA ), + SMESH_Hypothesis_i( thePOA ), + SMESH_Algo_i( thePOA ), + SMESH_1D_Algo_i( thePOA ) +{ + MESSAGE( "StdMeshers_Projection_1D_i::StdMeshers_Projection_1D_i" ); + myBaseImpl = new ::StdMeshers_Projection_1D( theGenImpl->GetANewId(), + theStudyId, + theGenImpl ); +} +//----------------------------------------------------------------------------- + +StdMeshers_Projection_1D_i::~StdMeshers_Projection_1D_i() +{ + MESSAGE( "StdMeshers_Projection_1D_i::~StdMeshers_Projection_1D_i" ); +} +//----------------------------------------------------------------------------- + +::StdMeshers_Projection_1D* StdMeshers_Projection_1D_i::GetImpl() +{ + MESSAGE( "StdMeshers_Projection_1D_i::GetImpl" ); + return ( ::StdMeshers_Projection_1D* )myBaseImpl; +} diff --git a/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.hxx b/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.hxx new file mode 100644 index 000000000..d55280a96 --- /dev/null +++ b/src/StdMeshers_I/StdMeshers_Projection_1D_2D_3D_i.hxx @@ -0,0 +1,109 @@ +// SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses +// +// Copyright (C) 2003 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. +// +// 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 : StdMeshers_Hexa_3D_i.hxx +// Moved here from SMESH_Hexa_3D_i.hxx +// Author : Paul RASCLE, EDF +// Module : SMESH +// $Header$ + +#ifndef _SMESH_Projection_3D_I_HXX_ +#define _SMESH_Projection_3D_I_HXX_ + +#include +#include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) + +#include "SMESH_1D_Algo_i.hxx" +#include "SMESH_2D_Algo_i.hxx" +#include "SMESH_3D_Algo_i.hxx" +#include "StdMeshers_Projection_1D.hxx" +#include "StdMeshers_Projection_2D.hxx" +#include "StdMeshers_Projection_3D.hxx" + +class SMESH_Gen; + +// ====================================================== +// Projection 3D algorithm +// ====================================================== + +class StdMeshers_Projection_3D_i: + public virtual POA_StdMeshers::StdMeshers_Projection_3D, + public virtual SMESH_3D_Algo_i +{ +public: + // Constructor + StdMeshers_Projection_3D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + + // Destructor + virtual ~StdMeshers_Projection_3D_i(); + + // Get implementation + ::StdMeshers_Projection_3D* GetImpl(); +}; + +// ====================================================== +// Projection 3D algorithm +// ====================================================== + +class StdMeshers_Projection_2D_i: + public virtual POA_StdMeshers::StdMeshers_Projection_2D, + public virtual SMESH_2D_Algo_i +{ +public: + // Constructor + StdMeshers_Projection_2D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + + // Destructor + virtual ~StdMeshers_Projection_2D_i(); + + // Get implementation + ::StdMeshers_Projection_2D* GetImpl(); +}; + +// ====================================================== +// Projection 3D algorithm +// ====================================================== + +class StdMeshers_Projection_1D_i: + public virtual POA_StdMeshers::StdMeshers_Projection_1D, + public virtual SMESH_1D_Algo_i +{ +public: + // Constructor + StdMeshers_Projection_1D_i( PortableServer::POA_ptr thePOA, + int theStudyId, + ::SMESH_Gen* theGenImpl ); + + // Destructor + virtual ~StdMeshers_Projection_1D_i(); + + // Get implementation + ::StdMeshers_Projection_1D* GetImpl(); +}; + + +#endif diff --git a/src/StdMeshers_I/StdMeshers_Propagation_i.cxx b/src/StdMeshers_I/StdMeshers_Propagation_i.cxx index 72295061c..f80085017 100644 --- a/src/StdMeshers_I/StdMeshers_Propagation_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Propagation_i.cxx @@ -24,13 +24,14 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_Propagation_i.hxx" #include "SMESH_Gen.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * StdMeshers_Propagation_i::StdMeshers_Propagation_i diff --git a/src/StdMeshers_I/StdMeshers_Propagation_i.hxx b/src/StdMeshers_I/StdMeshers_Propagation_i.hxx index 4f127b684..188b64810 100644 --- a/src/StdMeshers_I/StdMeshers_Propagation_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Propagation_i.hxx @@ -27,6 +27,8 @@ #ifndef _SMESH_PROPAGATION_I_HXX_ #define _SMESH_PROPAGATION_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -38,7 +40,7 @@ class SMESH_Gen; // ====================================================== // Propagation hypothesis // ====================================================== -class StdMeshers_Propagation_i: +class STDMESHERS_I_EXPORT StdMeshers_Propagation_i: public virtual POA_StdMeshers::StdMeshers_Propagation, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx index 77241e490..dc2eb803d 100644 --- a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx +++ b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.cxx @@ -27,7 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_QuadranglePreference_i.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Gen.hxx" @@ -37,6 +36,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * StdMeshers_QuadranglePreference_i::StdMeshers_QuadranglePreference_i diff --git a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx index 2b0776ef9..f4897d680 100644 --- a/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx +++ b/src/StdMeshers_I/StdMeshers_QuadranglePreference_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_QuadranglePreference_I_HXX_ #define _SMESH_QuadranglePreference_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -41,7 +43,7 @@ class SMESH_Gen; // ====================================================== // Local Length hypothesis // ====================================================== -class StdMeshers_QuadranglePreference_i: +class STDMESHERS_I_EXPORT StdMeshers_QuadranglePreference_i: public virtual POA_StdMeshers::StdMeshers_QuadranglePreference, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx index 65f084e6d..8031a92de 100644 --- a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.cxx @@ -27,13 +27,14 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_Quadrangle_2D_i.hxx" #include "SMESH_Gen.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * StdMeshers_Quadrangle_2D_i::StdMeshers_Quadrangle_2D_i diff --git a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx index 739baa48c..3c3054433 100644 --- a/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Quadrangle_2D_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_QUADRANGLE_2D_I_HXX_ #define _SMESH_QUADRANGLE_2D_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -41,7 +43,7 @@ class SMESH_Gen; // ====================================================== // Quadrangle (Mapping) 2d algorithm // ====================================================== -class StdMeshers_Quadrangle_2D_i: +class STDMESHERS_I_EXPORT StdMeshers_Quadrangle_2D_i: public virtual POA_StdMeshers::StdMeshers_Quadrangle_2D, public virtual SMESH_2D_Algo_i { diff --git a/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx b/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx index 90c74e3d9..fc901f4e7 100644 --- a/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx +++ b/src/StdMeshers_I/StdMeshers_QuadraticMesh_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_QuadraticMesh_I_HXX_ #define _SMESH_QuadraticMesh_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -41,7 +43,7 @@ class SMESH_Gen; // ====================================================== // Local Length hypothesis // ====================================================== -class StdMeshers_QuadraticMesh_i: +class STDMESHERS_I_EXPORT StdMeshers_QuadraticMesh_i: public virtual POA_StdMeshers::StdMeshers_QuadraticMesh, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx b/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx index 3aca858e4..5ecf5c443 100644 --- a/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx +++ b/src/StdMeshers_I/StdMeshers_Regular_1D_i.cxx @@ -27,13 +27,14 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_Regular_1D_i.hxx" #include "SMESH_Gen.hxx" #include "Utils_CorbaException.hxx" #include "utilities.h" +using namespace std; + //============================================================================= /*! * StdMeshers_Regular_1D_i::StdMeshers_Regular_1D_i diff --git a/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx b/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx index b372444bd..5ecf97ef4 100644 --- a/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx +++ b/src/StdMeshers_I/StdMeshers_Regular_1D_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_REGULAR_1D_I_HXX_ #define _SMESH_REGULAR_1D_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -39,7 +41,7 @@ // ====================================================== // Wire Discretization 1d algorithm // ====================================================== -class StdMeshers_Regular_1D_i: +class STDMESHERS_I_EXPORT StdMeshers_Regular_1D_i: public virtual POA_StdMeshers::StdMeshers_Regular_1D, public virtual SMESH_1D_Algo_i { diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx index 449db3e86..298f82891 100644 --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.cxx @@ -27,7 +27,6 @@ // Module : SMESH // $Header$ -using namespace std; #include "StdMeshers_StartEndLength_i.hxx" #include "SMESH_Gen_i.hxx" #include "SMESH_Gen.hxx" @@ -38,6 +37,8 @@ using namespace std; #include +using namespace std; + //============================================================================= /*! * StdMeshers_StartEndLength_i::StdMeshers_StartEndLength_i diff --git a/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx b/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx index 45c74af27..506bb912c 100644 --- a/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx +++ b/src/StdMeshers_I/StdMeshers_StartEndLength_i.hxx @@ -30,6 +30,8 @@ #ifndef _SMESH_StartEndLength_I_HXX_ #define _SMESH_StartEndLength_I_HXX_ +#include "SMESH_StdMeshers_I.hxx" + #include #include CORBA_SERVER_HEADER(SMESH_BasicHypothesis) @@ -41,7 +43,7 @@ class SMESH_Gen; // ====================================================== // Local Length hypothesis // ====================================================== -class StdMeshers_StartEndLength_i: +class STDMESHERS_I_EXPORT StdMeshers_StartEndLength_i: public virtual POA_StdMeshers::StdMeshers_StartEndLength, public virtual SMESH_Hypothesis_i { diff --git a/src/StdMeshers_I/StdMeshers_i.cxx b/src/StdMeshers_I/StdMeshers_i.cxx index 42f4c68fd..20e120ea5 100644 --- a/src/StdMeshers_I/StdMeshers_i.cxx +++ b/src/StdMeshers_I/StdMeshers_i.cxx @@ -25,7 +25,8 @@ // Module : SMESH // $Header$ -using namespace std; +#include "SMESH_StdMeshers_I.hxx" + #include "SMESH_Gen_i.hxx" #include "utilities.h" @@ -44,11 +45,21 @@ using namespace std; #include "StdMeshers_MaxElementVolume_i.hxx" #include "StdMeshers_NotConformAllowed_i.hxx" +#include "StdMeshers_ProjectionSource3D_i.hxx" +#include "StdMeshers_ProjectionSource2D_i.hxx" +#include "StdMeshers_ProjectionSource1D_i.hxx" +#include "StdMeshers_NumberOfLayers_i.hxx" +#include "StdMeshers_LayerDistribution_i.hxx" + #include "StdMeshers_Regular_1D_i.hxx" #include "StdMeshers_MEFISTO_2D_i.hxx" #include "StdMeshers_Quadrangle_2D_i.hxx" #include "StdMeshers_Hexa_3D_i.hxx" +#include "StdMeshers_Projection_1D_2D_3D_i.hxx" +#include "StdMeshers_Prism_3D_i.hxx" + + template class StdHypothesisCreator_i:public HypothesisCreator_i { // as we have 'module StdMeshers' in SMESH_BasicHypothesis.idl @@ -63,6 +74,7 @@ template class StdHypothesisCreator_i:public HypothesisCreator_i extern "C" { +STDMESHERS_I_EXPORT GenericHypothesisCreator_i* GetHypothesisCreator (const char* aHypName) { MESSAGE("Get HypothesisCreator for " << aHypName); @@ -96,6 +108,16 @@ extern "C" aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "QuadraticMesh") == 0) aCreator = new StdHypothesisCreator_i; + else if (strcmp(aHypName, "ProjectionSource3D") == 0) + aCreator = new StdHypothesisCreator_i; + else if (strcmp(aHypName, "ProjectionSource2D") == 0) + aCreator = new StdHypothesisCreator_i; + else if (strcmp(aHypName, "ProjectionSource1D") == 0) + aCreator = new StdHypothesisCreator_i; + else if (strcmp(aHypName, "NumberOfLayers") == 0) + aCreator = new StdHypothesisCreator_i; + else if (strcmp(aHypName, "LayerDistribution") == 0) + aCreator = new StdHypothesisCreator_i; // Algorithms else if (strcmp(aHypName, "Regular_1D") == 0) @@ -106,6 +128,16 @@ extern "C" aCreator = new StdHypothesisCreator_i; else if (strcmp(aHypName, "Hexa_3D") == 0) aCreator = new StdHypothesisCreator_i; + else if (strcmp(aHypName, "Projection_1D") == 0) + aCreator = new StdHypothesisCreator_i; + else if (strcmp(aHypName, "Projection_2D") == 0) + aCreator = new StdHypothesisCreator_i; + else if (strcmp(aHypName, "Projection_3D") == 0) + aCreator = new StdHypothesisCreator_i; + else if (strcmp(aHypName, "Prism_3D") == 0) + aCreator = new StdHypothesisCreator_i; + else if (strcmp(aHypName, "RadialPrism_3D") == 0) + aCreator = new StdHypothesisCreator_i; else ; return aCreator; -- 2.30.2
- - - - + + + - -
int smesh.Mesh_Algorithm.mesh = 0 [static, inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetId   self +  )  [inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

+
+
-

+

+

- - "; - return sHTML; -} - -function showHidePane(bShow) -{ - var oMsg=null; - if(bShow) - oMsg=new whMessage(WH_MSG_SHOWPANE,this,1,null); - else - oMsg=new whMessage(WH_MSG_HIDEPANE,this,1,null); - SendMessage(oMsg); -} - -function isShowHideEnable() -{ - if(gbIE4) - return true; - else - return false; -} - - -function PickupDialog_Invoke() -{ - if(!gbIE4||gbMac) - { - if(typeof(_PopupMenu_Invoke)=="function") - return _PopupMenu_Invoke(PickupDialog_Invoke.arguments); - } - else - { - if(PickupDialog_Invoke.arguments.length>2) - { - var sPickup="whskin_pickup.htm"; - var sPickupPath=gsPPath+sPickup; - if(gbIE4) - { - var sFrame=PickupDialog_Invoke.arguments[1]; - var aTopics=new Array(); - for(var i=2;i1) - { - var nWidth=300; - var nHeight=180; - var nScreenWidth=screen.width; - var nScreenHeight=screen.height; - var nLeft=(nScreenWidth-nWidth)/2; - var nTop=(nScreenHeight-nHeight)/2; - if(gbIE4) - { - var vRet=window.showModalDialog(sPickupPath,aTopics,"dialogHeight:"+nHeight+"px;dialogWidth:"+nWidth+"px;resizable:yes;status:no;scroll:no;help:no;center:yes;"); - if(vRet) - { - var sURL=vRet.m_url; - if(sFrame) - window.open(sURL,sFrame); - else - window.open(sURL,"_self"); - } - } - } - else if(aTopics.length==1) - { - var sURL=aTopics[0].m_sURL - if(sFrame) - window.open(sURL,sFrame); - else - window.open(sURL,"_self"); - } - } - } - } -} - -if(window.gbWhUtil&&window.gbWhMsg&&window.gbWhVer&&window.gbWhProxy) -{ - RegisterListener("bsscright",WH_MSG_GETAVIAVENUES); - RegisterListener("bsscright",WH_MSG_GETTOCPATHS); - RegisterListener("bsscright",WH_MSG_NEXT); - RegisterListener("bsscright",WH_MSG_PREV); - RegisterListener("bsscright",WH_MSG_WEBSEARCH); - if(gbMac&&gbIE4) - { - if(typeof(window.onunload)!="unknown") - if(window.onunload.toString!=unRegisterListener.toString) - whtopic_foldUnload=window.onunload; - } - else - { - if(window.onunload) - if(window.onunload.toString!=unRegisterListener.toString) - whtopic_foldUnload=window.onunload; - } - window.onunload=unRegisterListener; - setButtonFont("show","","","","","",""); -setButtonFont("hide","","","","","",""); - - gbWhTopic=true; -} -else - document.location.reload(); \ No newline at end of file +// WebHelp 5.10.005 +var gsPPath=""; +var gaPaths=new Array(); +var gaAvenues=new Array(); + +var goFrame=null; +var gsStartPage=""; +var gsRelCurPagePath=""; +var gsSearchFormHref=""; +var gnTopicOnly=-1; +var gnOutmostTopic=-1; + +var BTN_TEXT=1; +var BTN_IMG=2; + +var goSync=null; + +var goShow=null; +var goHide=null; + +var goPrev=null; +var goNext=null; +var gnForm=0; +var goShowNav=null; +var goHideNav=null; + +var goWebSearch=null; + +var gsBtnStyle=""; +var gaButtons=new Array(); +var gaTypes=new Array(); +var whtopic_foldUnload=null; +var gbWhTopic=false; +var gbCheckSync=false; +var gbSyncEnabled=false; + +function setButtonFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration) +{ + var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration); + gsBtnStyle+=".whtbtn"+sType+"{"+getFontStyle(vFont)+"}"; +} + +function writeBtnStyle() +{ + if(gaButtons.length>0) + { + if(gsBtnStyle.length>0) + { + var sStyle=""; + document.write(sStyle); + } + } +} + +function button(sText,nWidth,nHeight) +{ + this.sText=sText; + this.nWidth=nWidth; + this.nHeight=nHeight; + + this.aImgs=new Array(); + var i=0; + while(button.arguments.length>i+3) + { + this.aImgs[i]=button.arguments[3+i]; + i++; + } +} + +//project info +function setRelStartPage(sPath) +{ + if(gsPPath.length==0) + { + gsPPath=_getFullPath(_getPath(document.location.href),_getPath(sPath)); + gsStartPage=_getFullPath(_getPath(document.location.href),sPath); + gsRelCurPagePath=_getRelativeFileName(gsStartPage,document.location.href); + } +} + +function getImage(oImage,sType) +{ + var sImg=""; + if(oImage&&oImage.aImgs&&(oImage.aImgs.length>0)) + { + sImg+="\""+sType+"\"0) + sImg+=" width="+oImage.nWidth; + if(oImage.nHeight>0) + sImg+=" height="+oImage.nHeight; + sImg+=" border=0>"; + } + return sImg; +} + +function addTocInfo(sTocPath) +{ + gaPaths[gaPaths.length]=sTocPath; +} + +function addAvenueInfo(sName,sPrev,sNext) +{ + gaAvenues[gaAvenues.length]=new avenueInfo(sName,sPrev,sNext); +} + +function addButton(sType,nStyle,sText,sHref,sOnClick,sOnMouseOver,sOnLoad,nWidth,nHeight,sImg1,sImg2,sImg3) +{ + var sButton=""; + var nBtn=gaButtons.length; + if(sType=="prev") + { + if(canGo(false)) + { + var sTitle="Previous Topic"; + goPrev=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goPrev.sText; + else + sButton+=getImage(goPrev,sTitle); + sButton+=""; + } + } + else if(sType=="next") + { + if(canGo(true)) + { + var sTitle="Next Topic"; + goNext=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goNext.sText; + else + sButton+=getImage(goNext,sTitle); + sButton+=""; + } + } + else if(sType=="show") + { + if(isTopicOnly()&&(!gbOpera6||gbOpera7)) + { + var sTitle="Show Navigation Component"; + goShow=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goShow.sText; + else + sButton+=getImage(goShow,sTitle); + sButton+=""; + } + } + else if(sType=="hide") + { + if(!isTopicOnly()&&!gbOpera6) + { + var sTitle="Hide Navigation Component"; + goHide=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goHide.sText; + else + sButton+=getImage(goHide,sTitle); + sButton+=""; + } + } + else if(sType=="shownav") + { + if(isShowHideEnable()) + { + var sTitle="Show Navigation Component"; + goShowNav=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goShowNav.sText; + else + sButton+=getImage(goShowNav,sTitle); + sButton+=""; + } + } + else if(sType=="hidenav") + { + if(isShowHideEnable()) + { + var sTitle="Hide Navigation Component"; + goHideNav=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goHideNav.sText; + else + sButton+=getImage(goHideNav,sTitle); + sButton+=""; + } + } + else if(sType=="synctoc") + { + if(gaPaths.length>0) + { + var sTitle="Sync TOC"; + goSync=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goSync.sText; + else + sButton+=getImage(goSync,sTitle); + sButton+=""; + } + } + else if(sType=="websearch") + { + if(gsSearchFormHref.length>0) + { + var sTitle="WebSearch"; + goWebSearch=new button(sText,nWidth,nHeight,sImg1,sImg2,sImg3); + sButton=""; + if(nStyle==BTN_TEXT) + sButton+=goWebSearch.sText; + else + sButton+=getImage(goWebSearch,sTitle); + sButton+=""; + } + } + else if(sType=="searchform") + { + gaButtons[nBtn]="NeedSearchForm"; + gaTypes[nBtn]=sType; + } + if(sButton.length!=0) + { + if(nStyle==BTN_TEXT) + sButton+=" "; + gaButtons[nBtn]=""; + gaTypes[nBtn]=sType; + } +} + +function isSyncEnabled() +{ + if(!gbCheckSync) + { + var oMsg=new whMessage(WH_MSG_ISSYNCSSUPPORT,this,1,null); + if(SendMessage(oMsg)) + { + gbSyncEnabled=oMsg.oParam; + } + gbCheckSync=true; + } + return gbSyncEnabled; +} + +function isInPopup() +{ + return (window.name.indexOf("BSSCPopup")!=-1); +} + +function getIntopicBar(sAlign) +{ + var sHTML=""; + if(gaButtons.length>0) + { + sHTML+="
"; + + sHTML+="
- - - - + + + - -
smesh.Mesh_Algorithm.mesh [inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.TreatHypoStatus   self,

+

+
  status,

+

+
  hypName,

+

+
  geomName,

+

+
  isAlgo

+
[inherited]
-
- - - - - + + + +
-   - - -

-

+ + + + + + +
  +

Print error message if a hypothesis was not assigned.

+
-

+

+

- - "; - gaTypes[nBtn]=sType; - } -} - -function isSyncEnabled() -{ - if(!gbCheckSync) - { - var oMsg=new whMessage(WH_MSG_ISSYNCSSUPPORT,this,1,null); - if(SendMessage(oMsg)) - { - gbSyncEnabled=oMsg.oParam; - } - gbCheckSync=true; - } - return gbSyncEnabled; -} - -function isInPopup() -{ - return (window.name.indexOf("BSSCPopup")!=-1); -} - -function getIntopicBar(sAlign) -{ - var sHTML=""; - if(gaButtons.length>0) - { - sHTML+="
"; - - sHTML+="
- - - - + + + - -
int smesh.Mesh_Algorithm.geom = 0 [static, inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Create   self,

+

+
  mesh,

+

+
  geom,

+

+
  hypo,

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+

- - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
- - - - + + + - -
smesh.Mesh_Algorithm.geom [inherited]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Hypothesis   self,

+

+
  hyp,

+

+
  args = [], +

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
-
- - - - - + + +
-   - - -

-

-

+ + + + + + + +
  +

+
+
+

+
+

Field Documentation

+ +

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.subm = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.mesh += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + +
+ + + + + + +
smesh.Mesh_Algorithm.mesh +[inherited]
+
-

+ + + + + + + +
  +

+
+
+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.subm [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.geom += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.geom +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.algo = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.subm += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.subm +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.algo [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.algo += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.algo +[inherited]
+
+ + + + + + +
  +

+
+
+

+ diff --git a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Tetrahedron.html b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Tetrahedron.html index e0064eea3..f1f31ddf6 100644 --- a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Tetrahedron.html +++ b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Tetrahedron.html @@ -1,553 +1,1631 @@ - - -SALOME - SMESH - v.version: smesh.Mesh_Tetrahedron Class Reference - - - + + + + + + Main Page + + + + -

smesh.Mesh_Tetrahedron Class Reference

Class to define a tetrahedron 3D algorithm. -More... -

-Inheritance diagram for smesh.Mesh_Tetrahedron:

Inheritance graph
+

smesh.Mesh_Tetrahedron Class Reference

+
+Class to define a tetrahedron 3D algorithm. More... +

Inheritance diagram for smesh.Mesh_Tetrahedron:
+
+

+

+
Inheritance graph
- + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

def __init__
 Private constructor.
def MaxElementVolume
 Define "MaxElementVolume" hypothesis to give the maximun volume of each tetrahedral.
def GetSubMesh
def GetAlgorithm
 Return the wrapped mesher.
def TreatHypoStatus
 Private method.
def Create
 Private method.
def Hypothesis
 Private method.

Data Fields

 mesh
 geom
 subm
 algo

Static Public Attributes

int mesh = 0
int geom = 0
int subm = 0
int algo = 0
-

Detailed Description

-More details. +

+

+

Public Member Functions

+
def __init__
 Private constructor.
+
def MaxElementVolume
 Define "MaxElementVolume" hypothesis to +give the maximun volume of each tetrahedral.
+
def Parameters
 Define "Netgen 3D Parameters" hypothesis.
+
def SetMaxSize
 Set MaxSize.
+
def SetSecondOrder
 Set SecondOrder flag.
+
def SetOptimize
 Set Optimize flag.
+
def SetFineness
 Set Fineness.
+
def SetGrowthRate
 Set GrowthRate.
+
def SetNbSegPerEdge
 Set NbSegPerEdge.
+
def SetNbSegPerRadius
 Set NbSegPerRadius.
+
def GetSubMesh
 If the algorithm is global, return 0;
+else return the submesh associated to this algorithm.
+
def GetAlgorithm
 Return the wrapped mesher.
+
def GetCompatibleHypothesis
 Get list of hypothesis that can be used +with this algorithm.
+
def GetName
 Get name of algo.
+
def SetName
 Set name to algo.
+
def GetId
 Get id of algo.
+
def TreatHypoStatus
 Private method.
+
def Create
 Private method.
+
def Hypothesis
 Private method.
+

+

Data Fields

+
 algoType
 params
 mesh
 geom
 subm
 algo

+

Static Public Attributes

+
int params += 0
int algoType += 0
int mesh += 0
int geom += 0
int subm += 0
int algo += 0
+


+

Detailed Description

+More details. +

+
+

Member Function Documentation

+

-


Member Function Documentation

-

- - - +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Tetrahedron.__init__   self,
  mesh,
  algo,
  geom = 0
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Tetrahedron.__init__   self,

+

+
  mesh,

+

+
  algoType,

+

+
  geom = 0

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Tetrahedron.MaxElementVolume   self,

+

+
  vol

+

+
+
+ + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
vol for the maximum volume of each tetrahedral
+
+
+
-

+

+

- - - -
- - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Tetrahedron.MaxElementVolume   self,
  vol
+ + + + + + + + + + +
def +smesh.Mesh_Tetrahedron.Parameters   self +  ) 
+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

Parameters:
- - -
vol for the maximum volume of each tetrahedral
-
-
-

- - - +
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetSubMesh   self  )  [inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Tetrahedron.SetMaxSize   self,

+

+
  theSize

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Tetrahedron.SetSecondOrder   self,

+

+
  theVal

+

+
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.GetAlgorithm   self  )  [inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Tetrahedron.SetOptimize   self,

+

+
  theVal

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Tetrahedron.SetFineness   self,

+

+
  theFineness

+

+
+
+ + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
theFineness is: VeryCoarse, Coarse, Moderate, Fine, VeryFine or +Custom
+
+
+
-

+

+

- - - +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.TreatHypoStatus   self,
  status,
  hypName,
  geomName,
  isAlgo
[inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Tetrahedron.SetGrowthRate   self,

+

+
  theRate

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-Print error message if a hypothesis was not assigned.

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Tetrahedron.SetNbSegPerEdge   self,

+

+
  theVal

+

+
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Create   self,
  mesh,
  geom,
  hypo,
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Tetrahedron.SetNbSegPerRadius   self,

+

+
  theVal

+

+
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetSubMesh   self +  )  [inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - -
def smesh.Mesh_Algorithm.Hypothesis   self,
  hyp,
  args = [],
  so = "libStdMeshersEngine.so"
[inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetAlgorithm   self +  )  [inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetCompatibleHypothesis   self +  )  [inherited]
+
+ + + + + + +
  +

+
+
-


Field Documentation

-

+

+

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.mesh = 0 [static, inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetName   self +  )  [inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.SetName   self,

+

+
  name

+
[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.mesh [inherited]
+ + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetId   self +  )  [inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.TreatHypoStatus   self,

+

+
  status,

+

+
  hypName,

+

+
  geomName,

+

+
  isAlgo

+
[inherited]
+
+ + + + + + + +
  +

Print error message if a hypothesis was not assigned.

+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Create   self,

+

+
  mesh,

+

+
  geom,

+

+
  hypo,

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Hypothesis   self,

+

+
  hyp,

+

+
  args = [], +

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
+
+ + + + + + +
  +

+
+
-

+

+
+

Field Documentation

+ +

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.geom = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Tetrahedron.params += 0 [static]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
int smesh.Mesh_Tetrahedron.algoType += 0 [static]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.geom [inherited]
+ + + + + +
smesh.Mesh_Tetrahedron.algoType +
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Tetrahedron.params +
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.subm = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.mesh += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.mesh +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.subm [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.geom += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.geom +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
int smesh.Mesh_Algorithm.algo = 0 [static, inherited]
+ + + + + +
int smesh.Mesh_Algorithm.subm += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.subm +[inherited]
+
+ + + + + + +
  +

+
+
-

+

+

- - - +
- - - - + + + - -
smesh.Mesh_Algorithm.algo [inherited]
+ + + + + +
int smesh.Mesh_Algorithm.algo += 0 [static, inherited]
-
- - - - + + +
-   - - +
+ + + + + + + +
  +

+
+
+

-

+ + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.algo +[inherited]
+
+ + + + + + +
  +

+
+

diff --git a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Triangle.html b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Triangle.html index 718cfc3de..6ce21c2a9 100644 --- a/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Triangle.html +++ b/doc/salome/gui/SMESH/smeshpy_doc/classsmesh_1_1Mesh__Triangle.html @@ -1,578 +1,1736 @@ - - -SALOME - SMESH - v.version: smesh.Mesh_Triangle Class Reference - - - - -

smesh.Mesh_Triangle Class Reference

Class to define a triangle 2D algorithm. -More... -

-Inheritance diagram for smesh.Mesh_Triangle:

Inheritance graph
+ + + + + + Main Page + + + + +

smesh.Mesh_Triangle Class Reference

+
+Class to define a triangle 2D algorithm. More...
+
+Inheritance diagram for smesh.Mesh_Triangle:
+
+

+
Inheritance graph
- + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Public Member Functions

def __init__
 Private constructor.
def MaxElementArea
 Define "MaxElementArea" hypothesis to give the maximun area of each triangles.
def LengthFromEdges
 Define "LengthFromEdges" hypothesis to build triangles based on the length of the edges taken from the wire.
def GetSubMesh
def GetAlgorithm
 Return the wrapped mesher.
def TreatHypoStatus
 Private method.
def Create
 Private method.
def Hypothesis
 Private method.

Data Fields

 mesh
 geom
 subm
 algo

Static Public Attributes

int mesh = 0
int geom = 0
int subm = 0
int algo = 0
-

Detailed Description

-More details. -

-


Member Function Documentation

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh_Triangle.__init__   self,
  mesh,
  geom = 0
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - - - - - - - - - - - - - - - -
def smesh.Mesh_Triangle.MaxElementArea   self,
  area
-
- - - - - -
-   - - -

-

Parameters:
- - -
area for the maximum area of each triangles
-
-
-

- - - - -
- - - - - - - - - -
def smesh.Mesh_Triangle.LengthFromEdges   self  ) 
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - - - - - - -
def smesh.Mesh_Algorithm.GetSubMesh   self  )  [inherited]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - - - - - - -
def smesh.Mesh_Algorithm.GetAlgorithm   self  )  [inherited]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh_Algorithm.TreatHypoStatus   self,
  status,
  hypName,
  geomName,
  isAlgo
[inherited]
-
- - - - - -
-   - - -

-Print error message if a hypothesis was not assigned.

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh_Algorithm.Create   self,
  mesh,
  geom,
  hypo,
  so = "libStdMeshersEngine.so"
[inherited]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def smesh.Mesh_Algorithm.Hypothesis   self,
  hyp,
  args = [],
  so = "libStdMeshersEngine.so"
[inherited]
-
- - - - - -
-   - - -

-

-


Field Documentation

-

- - - - -
- - - - -
int smesh.Mesh_Algorithm.mesh = 0 [static, inherited]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
smesh.Mesh_Algorithm.mesh [inherited]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
int smesh.Mesh_Algorithm.geom = 0 [static, inherited]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
smesh.Mesh_Algorithm.geom [inherited]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
int smesh.Mesh_Algorithm.subm = 0 [static, inherited]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
smesh.Mesh_Algorithm.subm [inherited]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
int smesh.Mesh_Algorithm.algo = 0 [static, inherited]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
smesh.Mesh_Algorithm.algo [inherited]
-
- - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-   - - -

-


+

+

Public Member Functions

+
def __init__
 Private constructor.
+
def MaxElementArea
 Define "MaxElementArea" hypothesis to give +the maximun area of each triangles.
+
def LengthFromEdges
 Define "LengthFromEdges" hypothesis to +build triangles based on the length of the edges taken from the wire.
+
def Parameters
 Define "Netgen 2D Parameters" hypothesis.
+
def SetMaxSize
 Set MaxSize.
+
def SetSecondOrder
 Set SecondOrder flag.
+
def SetOptimize
 Set Optimize flag.
+
def SetFineness
 Set Fineness.
+
def SetGrowthRate
 Set GrowthRate.
+
def SetNbSegPerEdge
 Set NbSegPerEdge.
+
def SetNbSegPerRadius
 Set NbSegPerRadius.
+
def SetQuadAllowed
 Set QuadAllowed flag.
+
def GetSubMesh
 If the algorithm is global, return 0;
+else return the submesh associated to this algorithm.
+
def GetAlgorithm
 Return the wrapped mesher.
+
def GetCompatibleHypothesis
 Get list of hypothesis that can be used +with this algorithm.
+
def GetName
 Get name of algo.
+
def SetName
 Set name to algo.
+
def GetId
 Get id of algo.
+
def TreatHypoStatus
 Private method.
+
def Create
 Private method.
+
def Hypothesis
 Private method.
+

+

Data Fields

+
 algoType
 params
 mesh
 geom
 subm
 algo

+

Static Public Attributes

+
int algoType += 0
int params += 0
int mesh += 0
int geom += 0
int subm += 0
int algo += 0
+


+

Detailed Description

+More details. +

+
+

Member Function Documentation

+ +

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Triangle.__init__   self,

+

+
  mesh,

+

+
  algoType,

+

+
  geom = 0

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Triangle.MaxElementArea   self,

+

+
  area

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
area for the maximum area of each triangles
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh_Triangle.LengthFromEdges   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh_Triangle.Parameters   self +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Triangle.SetMaxSize   self,

+

+
  theSize

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Triangle.SetSecondOrder   seld,

+

+
  theVal

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Triangle.SetOptimize   self,

+

+
  theVal

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Triangle.SetFineness   self,

+

+
  theFineness

+

+
+
+ + + + + + + +
  +

+
+
Parameters:
+
+ + + + + + + + +

+
theFineness is: VeryCoarse, Coarse, Moderate, Fine, VeryFine or +Custom
+
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Triangle.SetGrowthRate   self,

+

+
  theRate

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Triangle.SetNbSegPerEdge   self,

+

+
  theVal

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Triangle.SetNbSegPerRadius   self,

+

+
  theVal

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Triangle.SetQuadAllowed   self,

+

+
  toAllow

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetSubMesh   self +  )  [inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetAlgorithm   self +  )  [inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetCompatibleHypothesis   self +  )  [inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetName   self +  )  [inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.SetName   self,

+

+
  name

+
[inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.Mesh_Algorithm.GetId   self +  )  [inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.TreatHypoStatus   self,

+

+
  status,

+

+
  hypName,

+

+
  geomName,

+

+
  isAlgo

+
[inherited]
+
+ + + + + + + +
  +

Print error message if a hypothesis was not assigned.

+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Create   self,

+

+
  mesh,

+

+
  geom,

+

+
  hypo,

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.Mesh_Algorithm.Hypothesis   self,

+

+
  hyp,

+

+
  args = [], +

+

+
  so = "libStdMeshersEngine.so"

+
[inherited]
+
+ + + + + + + +
  +

+
+
+

+
+

Field Documentation

+ +

+ + + + + + +
+ + + + + + +
int smesh.Mesh_Triangle.algoType += 0 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.Mesh_Triangle.params += 0 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.Mesh_Triangle.algoType +
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.Mesh_Triangle.params +
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.Mesh_Algorithm.mesh += 0 [static, inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.mesh +[inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.Mesh_Algorithm.geom += 0 [static, inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.geom +[inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.Mesh_Algorithm.subm += 0 [static, inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.subm +[inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.Mesh_Algorithm.algo += 0 [static, inherited]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.Mesh_Algorithm.algo +[inherited]
+
+ + + + + + + +
  +

+
+

diff --git a/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html b/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html index 6a1ccc527..1834acd9e 100644 --- a/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html +++ b/doc/salome/gui/SMESH/smeshpy_doc/namespacesmesh.html @@ -1,268 +1,2092 @@ - - -SALOME - SMESH - v.version: Package smesh - - - - + + + + + + Main Page + + + +

Package smesh

-

-Python package smesh defines several classes, destined for easy and clear mesh creation and edition. -

Example.

+Python package smesh defines several classes, destined for easy and +clear mesh creation and edition. +

Example.
+
+

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Data Structures

class  Mesh_Algorithm
 Mother class to define algorithm, recommended to don't use directly. More...
class  Mesh_Segment
 Class to define a segment 1D algorithm for discretization. More...
class  Mesh_Segment_Python
 Class to define a segment 1D algorithm for discretization with python function. More...
class  Mesh_Triangle
 Class to define a triangle 2D algorithm. More...
class  Mesh_Quadrangle
 Class to define a quadrangle 2D algorithm. More...
class  Mesh_Tetrahedron
 Class to define a tetrahedron 3D algorithm. More...
class  Mesh_Hexahedron
 Class to define a hexahedron 3D algorithm. More...
class  Mesh_Netgen
 Class to define a NETGEN-based 2D or 3D algorithm that need no discrete boundary (i.e. More...
class  Mesh
 Class to define a mesh. More...

Functions

def GetName
def SetName

Variables

int REGULAR = 1
int PYTHON = 2
int NETGEN = 3
int GHS3D = 4
tuple smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH")
string NO_NAME = "NoName"
-


Function Documentation

-

- - - - -
- - - - - - - - - -
def smesh.GetName   obj  ) 
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - - - - - - - - - - - - - - - -
def smesh.SetName   obj,
  name
-
- - - - - -
-   - - -

-

-


Variable Documentation

-

- - - - -
- - - - -
int smesh.REGULAR = 1 [static]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
int smesh.PYTHON = 2 [static]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
int smesh.NETGEN = 3 [static]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
int smesh.GHS3D = 4 [static]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
tuple smesh.smesh = salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") [static]
-
- - - - - -
-   - - -

-

-

- - - - -
- - - - -
string smesh.NO_NAME = "NoName" [static]
-
- - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-   - - -

-


+
+

Data Structures

+
class + Mesh_Algorithm
 Mother class to define algorithm, +recommended to don't use directly. More...
+
class + Mesh_Segment
 Class to define a segment 1D algorithm for +discretization. More...
+
class + Mesh_Segment_Python
 Class to define a segment 1D algorithm for +discretization with python function. More...
+
class + Mesh_Triangle
 Class to define a triangle 2D algorithm. More...
+
class + Mesh_Quadrangle
 Class to define a quadrangle 2D algorithm. + More...
+
class + Mesh_Tetrahedron
 Class to define a tetrahedron 3D +algorithm. More...
+
class + Mesh_Hexahedron
 Class to define a hexahedron 3D algorithm. + More...
+
class + Mesh_Netgen
 Class to define a NETGEN-based 2D or 3D +algorithm that need no discrete boundary (i.e. More...
+
class + Mesh
 Class to define a mesh. More...
+

+

Functions

+
def GetName
 Gets object name.
+
def SetName
 Sets name to object.
+
def EnumToLong
 Returns long value from enumeration Uses +for SMESH.FunctorType enumeration.
+
def GetPointStruct
 Get PointStruct from vertex.
+
def GetDirStruct
 Get DirStruct from vector.
+
def GetAxisStruct
 Get AxisStruct from object.
+
def SetEmbeddedMode
 Set the current mode.
+
def IsEmbeddedMode
 Get the current mode.
+
def SetCurrentStudy
 Set the current study.
+
def GetCurrentStudy
 Get the current study.
+
def CreateMeshesFromUNV
 Create Mesh object importing data from +given UNV file.
+
def CreateMeshesFromMED
 Create Mesh object(s) importing data from +given MED file.
+
def CreateMeshesFromSTL
 Create Mesh object importing data from +given STL file.
+
def GetSubShapesId
 From SMESH_Gen interface.
+
def GetPattern
 From SMESH_Gen interface.
+
def GetEmptyCriterion
 Creates an empty criterion.
+
def GetCriterion
 Creates a criterion by given parameters.
+
def GetFilter
 Creates filter by given parameters of +criterion.
+
def GetFunctor
 Creates numerical functor by its type.
+

+

Variables

+
int noNETGENPlugin += 0
int noNETGENPlugin += 1
int REGULAR += 1
int PYTHON += 2
int MEFISTO += 3
int NETGEN += 4
int GHS3D += 5
int FULL_NETGEN += 6
 POINT += SMESH_MeshEditor.POINT
 AXIS = + SMESH_MeshEditor.AXIS
 PLANE += SMESH_MeshEditor.PLANE
 LAPLACIAN_SMOOTH += SMESH_MeshEditor.LAPLACIAN_SMOOTH
 CENTROIDAL_SMOOTH += SMESH_MeshEditor.CENTROIDAL_SMOOTH
int VeryCoarse += 0
int Coarse += 1
int Moderate += 2
int Fine = +3
int VeryFine += 4
int Custom += 5
string NO_NAME += "NoName"
tuple smesh += salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH")
+

+
+

Function Documentation

+ +

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.GetName   obj +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.SetName   obj,

+

+
  name

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.EnumToLong   theItem +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.GetPointStruct   theVertex +  ) 
+
+
+ + + + + + + +
  +
+
Parameters:
+
+ + + + + + + + +

+
theVertex is GEOM object(vertex)
+
+
+
+
Returns:
+
SMESH.PointStruct
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.GetDirStruct   theVector +  ) 
+
+
+ + + + + + + +
  +
+
Parameters:
+
+ + + + + + + + +

+
theVector is GEOM object(vector)
+
+
+
+
Returns:
+
SMESH.DirStruct
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.GetAxisStruct   theObj +  ) 
+
+
+ + + + + + + +
  +
+
Parameters:
+
+ + + + + + + + +

+
theObj is GEOM object(line or plane)
+
+
+
+
Returns:
+
SMESH.AxisStruct
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.SetEmbeddedMode   theMode +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + +
def +smesh.IsEmbeddedMode
+
 ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.SetCurrentStudy   theStudy +  ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + +
def +smesh.GetCurrentStudy
+
 ) 
+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.CreateMeshesFromUNV   theFileName +  ) 
+
+
+ + + + + + + +
  +
+
Returns:
+
an instance of Mesh +class
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.CreateMeshesFromMED   theFileName +  ) 
+
+
+ + + + + + + +
  +
+
Returns:
+
a list of Mesh +class instances
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.CreateMeshesFromSTL   theFileName +  ) 
+
+
+ + + + + + + +
  +
+
Returns:
+
an instance of Mesh +class
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + +
def +smesh.GetSubShapesId   theMainObject, +

+

+
  theListOfSubObjects

+

+
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + + + + + +
def +smesh.GetPattern
+
 ) 
+
+
+ + + + + + + +
  +

Creates pattern

+
+

+

+ + + + + + +
+ + + + + + + + + + +
def +smesh.GetEmptyCriterion
+
 ) 
+
+
+ + + + + + + +
  +
+
Returns:
+
SMESH.Filter.Criterion
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.GetCriterion   elementType,

+

+
  CritType,

+

+
  Compare = FT_EqualTo, +

+

+
  Treshold = "", +

+

+
  UnaryOp = FT_Undefined, +

+

+
  BinaryOp = FT_Undefined

+

+
+
+ + + + + + + +
  +
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
elementType is the type of elements(NODE, EDGE, FACE, VOLUME)

+
CritType is type of criterion( FT_Taper, FT_Area, +FT_RangeOfIds, FT_LyingOnGeom etc. )

+
Compare belong to {FT_LessThan, FT_MoreThan, FT_EqualTo}

+
Treshold is threshold value (range of ids as string, shape, +numeric)

+
UnaryOp is FT_LogicalNOT or FT_Undefined

+
BinaryOp is binary logical operation FT_LogicalAND, +FT_LogicalOR or FT_Undefined(must be for the last criterion in +criteria)
+
+
+
+
Returns:
+
SMESH.Filter.Criterion
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
def +smesh.GetFilter   elementType,

+

+
  CritType = FT_Undefined, +

+

+
  Compare = FT_EqualTo, +

+

+
  Treshold = "", +

+

+
  UnaryOp = FT_Undefined

+

+
+
+ + + + + + + +
  +
+
Parameters:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+
elementType is the type of elements in the group

+
CritType is type of criterion( FT_Taper, FT_Area, +FT_RangeOfIds, FT_LyingOnGeom etc. )

+
Compare belong to {FT_LessThan, FT_MoreThan, FT_EqualTo}

+
Treshold is threshold value (range of id ids as string, +shape, numeric)

+
UnaryOp is FT_LogicalNOT or FT_Undefined
+
+
+
+
Returns:
+
SMESH_Filter
+
+
+

+

+ + + + + + +
+ + + + + + + + + + + +
def +smesh.GetFunctor   theCriterion +  ) 
+
+
+ + + + + + + +
  +
+
Parameters:
+
+ + + + + + + + +

+
theCrierion is FT_...; functor type
+
+
+
+
Returns:
+
SMESH_NumericalFunctor
+
+
+

+
+

Variable Documentation

+ +

+ + + + + + +
+ + + + + + +
int smesh.noNETGENPlugin += 0 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.noNETGENPlugin += 1 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.REGULAR += 1 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.PYTHON += 2 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.MEFISTO += 3 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.NETGEN += 4 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.GHS3D += 5 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.FULL_NETGEN += 6 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.POINT += SMESH_MeshEditor.POINT +[static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.AXIS += SMESH_MeshEditor.AXIS +[static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.PLANE += SMESH_MeshEditor.PLANE +[static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.LAPLACIAN_SMOOTH += SMESH_MeshEditor.LAPLACIAN_SMOOTH +[static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
smesh.CENTROIDAL_SMOOTH += SMESH_MeshEditor.CENTROIDAL_SMOOTH +[static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.VeryCoarse += 0 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.Coarse += 1 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.Moderate += 2 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.Fine += 3 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.VeryFine += 4 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
int smesh.Custom += 5 [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
string smesh.NO_NAME += "NoName" [static]
+
+ + + + + + + +
  +

+
+
+

+

+ + + + + + +
+ + + + + + +
tuple smesh.smesh += salome.lcc.FindOrLoadComponent("FactoryServer", "SMESH") +[static]
+
+ + + + + + +
  +

+
+
+

diff --git a/doc/salome/gui/SMESH/transforming_meshes.htm b/doc/salome/gui/SMESH/transforming_meshes.htm index f70f20b44..4f740bb60 100755 --- a/doc/salome/gui/SMESH/transforming_meshes.htm +++ b/doc/salome/gui/SMESH/transforming_meshes.htm @@ -1,883 +1,758 @@ - - - - - -Transforming Meshes - - - - - - - - - - - -

Transforming Meshes

- -

Transforming Meshes

- -

 

- -

Translation

- -

 

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to translate meshes.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

anEditor = mesh.GetMeshEditor()

- -

 

- -

# define translation - vector

- -

point = SMESH.PointStruct(-150., - -150., 0.)

- -

vector = SMESH.DirStruct(point)

- -

 

- -

# translate a mesh

- -

doCopy = 1

- -

anEditor.TranslateObject(mesh, - vector, doCopy)

- -

 

- -

Rotation

- -

 

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to rotate meshes.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import math

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

anEditor = mesh.GetMeshEditor()

- -

 

- -

# define rotation axis - and angle

- -

axisXYZ = SMESH.AxisStruct(0., 0., 0., - 5., 5., 20.)

- -

angle270 = 1.5 * math.pi

- -

 

- -

# rotate a mesh

- -

anEditor.RotateObject(mesh, axisXYZ, angle270, - 1)

- -

 

- -

Symmetry

- -

 

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to create symmetrical copies of meshes.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import math

- -

import SMESH

- -

import SMESH_mechanic

- -

 

- -

mesh = SMESH_mechanic.mesh

- -

anEditor = mesh.GetMeshEditor()

- -

 

- -

# create a symmetrical - copy of the mesh mirrored through a point

- -

axis = SMESH.AxisStruct(0, 0, 0, 0, 0, - 0)

- -

anEditor.MirrorObject(mesh, axis, SMESH.SMESH_MeshEditor.POINT, - 1)

- -

 

- -

Merging - Nodes

- -

 

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to merge nodes.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import SMESH_mechanic

- -

mesh = SMESH_mechanic.mesh

- -

 

- -

aMeshEditor = mesh.GetMeshEditor()

- -

 

- -

# merge nodes

- -

Tolerance = 25.0

- -

 

- -

GroupsOfNodes = - aMeshEditor.FindCoincidentNodes(Tolerance)

- -

aMeshEditor.MergeNodes(GroupsOfNodes) -

- -

 

- -

Merging Elements

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to merge elements.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import salome

- -

import geompy

- -

import smesh

- -

import SMESH

- -

 

- -

# create a face to - be meshed

- -

px = geompy.MakeVertex(100., - 0.  , 0. -  )

- -

py = geompy.MakeVertex(0. -  , 100., - 0.  )

- -

pz = geompy.MakeVertex(0. -  , 0.  , - 100.)

- -

 

- -

vxy = geompy.MakeVector(px, - py)

- -

arc = geompy.MakeArc(py, - pz, px)

- -

 

- -

wire = geompy.MakeWire([vxy, - arc])

- -

isPlanarFace = 1

- -

 

- -

face1 = geompy.MakeFace(wire, - isPlanarFace)

- -

id_face1 = geompy.addToStudy(face1, - "Face1")

- -

 

- -

# create a circle to - be an extrusion path

- -

px1 = geompy.MakeVertex( - 100.,  100., -  0.)

- -

py1 = geompy.MakeVertex(-100., - -100.,  0.)

- -

pz1 = geompy.MakeVertex( -   0., -    0., - 50.)

- -

 

- -

circle = geompy.MakeCircleThreePnt(py1, - pz1, px1)

- -

id_circle = geompy.addToStudy(circle, - "Path")

- -

 

- -

# create a 2D mesh - on the face

- -

trias = smesh.Mesh(face1, - "Face : 2D mesh")

- -

 

- -

algo1D = trias.Segment()

- -

algo1D.NumberOfSegments(6)

- -

algo2D = trias.Triangle()

- -

algo2D.LengthFromEdges()

- -

 

- -

trias.Compute()

- -

tri_mesh = trias.GetMesh()

- -

 

- -

# create a path mesh

- -

circlemesh = smesh.Mesh(circle, - "Path mesh")

- -

algo = circlemesh.Segment()

- -

algo.NumberOfSegments(10)

- -

circlemesh.Compute()

- -

 

- -

# extrusion of the - mesh

- -

aMeshEditor = tri_mesh.GetMeshEditor()

- -

aMeshEditor.ExtrusionAlongPathObject(tri_mesh, - circlemesh.GetMesh(), circle,

- -

                                     1, - 0, [], 0, SMESH.PointStruct(0, 0, 0))

- -

# merge nodes

- -

print "Number - of nodes before MergeNodes:", tri_mesh.NbNodes()

- -

 

- -

tolerance = 0.001

- -

array_of_nodes_groups - = aMeshEditor.FindCoincidentNodes(tolerance)

- -

aMeshEditor.MergeNodes(array_of_nodes_groups)

- -

 

- -

print "Number - of nodes after MergeNodes:", tri_mesh.NbNodes()

- -

print ""

- -

print "Number - of elements before MergeEqualElements:"

- -

print "Edges -      : - ", tri_mesh.NbEdges()

- -

print "Triangles -  : ", - tri_mesh.NbTriangles()

- -

print "Quadrangles: - ", tri_mesh.NbQuadrangles()

- -

print "Volumes -    : - ", tri_mesh.NbVolumes()

- -

 

- -

# merge elements

- -

aMeshEditor.MergeEqualElements()

- -

 

- -

print "Number - of elements after MergeEqualElements:"

- -

print "Edges -      : - ", tri_mesh.NbEdges()

- -

print "Triangles -  : ", - tri_mesh.NbTriangles()

- -

print "Quadrangles: - ", tri_mesh.NbQuadrangles()

- -

print "Volumes -    : - ", tri_mesh.NbVolumes()

- -

 

- -

salome.sg.updateObjBrowser(1) -

- -

 

- -

Sewing Meshes

- -

Sew Meshes Border to Border

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to sew meshes border to border.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import geompy

- -

import smesh

- -

 

- -

# create two faces - of a box

- -

box1 = geompy.MakeBox(0., - 0., -10., 30., 20., 25.)

- -

facesList1 = geompy.SubShapeAll(box1, - geompy.ShapeType["FACE"])

- -

face1 = facesList1[2]

- -

 

- -

box2 = geompy.MakeBox(0., - 5., 0., 20., 20., 15.)

- -

facesList2 = geompy.SubShapeAll(box2, - geompy.ShapeType["FACE"])

- -

face2 = facesList2[1]

- -

 

- -

edgesList = geompy.SubShapeAll(face2, - geompy.ShapeType["EDGE"])

- -

edge1 = edgesList[2]

- -

 

- -

aComp = geompy.MakeCompound([face1, - face2])

- -

geompy.addToStudy(aComp, - "Two faces")

- -

 

- -

# create a mesh on - two faces

- -

mesh = smesh.Mesh(aComp, - "Two faces : quadrangle mesh")

- -

 

- -

algo1D = mesh.Segment()

- -

algo1D.NumberOfSegments(9)

- -

algo2D = mesh.Quadrangle()

- -

 

- -

algo_local = mesh.Segment(edge1)

- -

algo_local.Arithmetic1D(1, - 4)

- -

algo_local.Propagation()

- -

 

- -

mesh.Compute()

- -

 

- -

anEditor = mesh.GetMesh().GetMeshEditor()

- -

 

- -

# sew border to side

- -

# FirstNodeIDOnFreeBorder, - SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder,

- -

# FirstNodeIDOnSide, - LastNodeIDOnSide,

- -

# CreatePolygons, CreatePolyedrs

- -

anEditor.SewBorderToSide(5, - 45, 6, 113, 109, 0, 0)

- -

Sew Conform Free Borders

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to sew conform free borders.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import geompy

- -

import smesh

- -

 

- -

# create two faces - of the box

- -

box1 = geompy.MakeBox(0., - 0., -10., 20., 20., 15.)

- -

facesList1 = geompy.SubShapeAll(box1, - geompy.ShapeType["FACE"])

- -

face1 = facesList1[2]

- -

 

- -

box2 = geompy.MakeBox(0., - 5., 0., 20., 20., 15.)

- -

facesList2 = geompy.SubShapeAll(box2, - geompy.ShapeType["FACE"])

- -

face2 = facesList2[1]

- -

 

- -

edgesList = geompy.SubShapeAll(face2, - geompy.ShapeType["EDGE"])

- -

edge1 = edgesList[2]

- -

 

- -

aComp = geompy.MakeCompound([face1, - face2])

- -

geompy.addToStudy(aComp, - "Two faces")

- -

 

- -

# create a mesh on - two faces

- -

mesh = smesh.Mesh(aComp, - "Two faces : quadrangle mesh")

- -

 

- -

algo1D = mesh.Segment()

- -

algo1D.NumberOfSegments(9)

- -

algo2D = mesh.Quadrangle()

- -

 

- -

algo_local = mesh.Segment(edge1)

- -

algo_local.Arithmetic1D(1, - 4)

- -

algo_local.Propagation()

- -

 

- -

mesh.Compute()

- -

 

- -

anEditor = mesh.GetMesh().GetMeshEditor()

- -

 

- -

# sew conform free - borders

- -

# FirstNodeID1, SecondNodeID1, - LastNodeID1, FirstNodeID2, SecondNodeID2

- -

anEditor.SewConformFreeBorders(5, - 45, 6, 3, 24)

- -

Sew Free Borders

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to sew free borders.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

 

- -

import geompy

- -

import smesh

- -

 

- -

# create two faces - of the box

- -

box1 = geompy.MakeBox(0., - 0., 0., 20., 20., 15.)

- -

facesList1 = geompy.SubShapeAll(box1, - geompy.ShapeType["FACE"])

- -

face1 = facesList1[2]

- -

 

- -

box2 = geompy.MakeBox(0., - 5., 0., 20., 20., 15.)

- -

facesList2 = geompy.SubShapeAll(box2, - geompy.ShapeType["FACE"])

- -

face2 = facesList2[1]

- -

 

- -

edgesList = geompy.SubShapeAll(face2, - geompy.ShapeType["EDGE"])

- -

edge1 = edgesList[2]

- -

 

- -

aComp = geompy.MakeCompound([face1, - face2])

- -

geompy.addToStudy(aComp, - "Two faces")

- -

 

- -

# create a mesh on - two faces

- -

mesh = smesh.Mesh(aComp, - "Two faces : quadrangle mesh")

- -

 

- -

algo1D = mesh.Segment()

- -

algo1D.NumberOfSegments(4)

- -

algo2D = mesh.Quadrangle()

- -

 

- -

algo_local = mesh.Segment(edge1)

- -

algo_local.Arithmetic1D(1, - 4)

- -

algo_local.Propagation()

- -

 

- -

mesh.Compute()

- -

 

- -

# sew free borders

- -

# FirstNodeID1, SecondNodeID1, - LastNodeID1,

- -

# FirstNodeID2, SecondNodeID2, - LastNodeID2, CreatePolygons, CreatePolyedrs

- -

anEditor = mesh.GetMesh().GetMeshEditor()

- -

anEditor.SewFreeBorders(6, - 21, 5, 1, 12, 3, 0, 0)

- -

Sew Side Elements

- -

# - Attention! This script has been written using the old approach basing - on direct usage of SMESH idl interface.

- -

# For the moment smesh package doesn't provide - methods to sew side elements.

- -

# In the next SALOME version the scripts will - be updated to use only the commands from smesh package.

- -

import geompy

- -

import smesh

- -

 

- -

# create two boxes

- -

box1 = geompy.MakeBox(0., -  0., 0., - 10., 10., 10.)

- -

box2 = geompy.MakeBox(0., - 15., 0., 20., 25., 10.)

- -

 

- -

EdgesList = geompy.SubShapeAll(box2, - geompy.ShapeType["EDGE"])

- -

 

- -

aComp = geompy.MakeCompound([box1, - box2])

- -

geompy.addToStudy(aComp, - "Two boxes")

- -

 

- -

# create a mesh on - two boxes

- -

mesh = smesh.Mesh(aComp, - "Two faces : quadrangle mesh")

- -

 

- -

algo1D = mesh.Segment()

- -

algo1D.NumberOfSegments(2)

- -

algo2D = mesh.Quadrangle()

- -

 

- -

algo_local = mesh.Segment(EdgesList[8])

- -

algo_local.NumberOfSegments(4)

- -

algo_local.Propagation()

- -

 

- -

mesh.Compute()

- -

 

- -

anEditor = mesh.GetMesh().GetMeshEditor()

- -

 

- -

# sew side elements

- -

# IDsOfSide1Elements, - IDsOfSide2Elements,

- -

# NodeID1OfSide1ToMerge, - NodeID1OfSide2ToMerge, NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge

- -

anEditor.SewSideElements([69, - 70, 71, 72], [91, 92, 89, 90], 8, 38, 23, 58)

- - - - + + + + + +Transforming Meshes + + + + + + + + + + + +

Transforming Meshes

+ +

Transforming Meshes

+ +

 

+ +

Translation

+ +

 

+ +

import SMESH_mechanic

+ +

 

+ +

smesh + = SMESH_mechanic.smesh

+ +

mesh = SMESH_mechanic.mesh +

+ +

 

+ +

# define translation + vector

+ +

point + = smesh.PointStruct(-150., -150., 0.)

+ +

vector =smesh.DirStruct(point) +

+ +

 

+ +

# translate a mesh

+ +

doCopy = 1

+ +

 

+ +

mesh.Translate([], + vector, doCopy)  

+ +

 

+ +

Rotation

+ +

 

+ +

import math

+ +

import SMESH_mechanic

+ +

 

+ +

smesh + = SMESH_mechanic.smesh

+ +

mesh = SMESH_mechanic.mesh

+ +

 

+ +

# define rotation axis + and angle

+ +

axisXYZ = smesh.AxisStruct(0., 0., 0., + 5., 5., 20.)

+ +

angle270 = 1.5 * math.pi

+ +

 

+ +

# rotate a mesh

+ +

mesh.Rotate([], + axisXYZ, angle270, 1)  

+ +

 

+ +

Symmetry

+ +

 

+ +

import math

+ +

 

+ +

import SMESH_mechanic

+ +

 

+ +

smesh + = SMESH_mechanic.smesh

+ +

mesh = SMESH_mechanic.mesh

+ +

 

+ +

# create a symmetrical + copy of the mesh mirrored through a point

+ +

axis = SMESH.AxisStruct(0, 0, 0, 0, 0, + 0)

+ +

 

+ +

mesh.Mirror([], axis, smesh.POINT, 1) +

+ +

 

+ +

Merging + Nodes

+ +

 

+ +

import SMESH_mechanic

+ +

mesh = SMESH_mechanic.mesh

+ +

 

+ +

# merge nodes

+ +

Tolerance = 25.0

+ +

 

+ +

GroupsOfNodes = +  mesh.FindCoincidentNodes(Tolerance)

+ +

mesh.MergeNodes(GroupsOfNodes) +  

+ +

 

+ +

Merging Elements

+ +

import salome

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create a face to + be meshed

+ +

px = geompy.MakeVertex(100., + 0.  , 0. +  )

+ +

py = geompy.MakeVertex(0. +  , 100., + 0.  )

+ +

pz = geompy.MakeVertex(0. +  , 0.  , + 100.)

+ +

 

+ +

vxy = geompy.MakeVector(px, + py)

+ +

arc = geompy.MakeArc(py, + pz, px)

+ +

 

+ +

wire = geompy.MakeWire([vxy, + arc])

+ +

isPlanarFace = 1

+ +

 

+ +

face1 = geompy.MakeFace(wire, + isPlanarFace)

+ +

id_face1 = geompy.addToStudy(face1, + "Face1")

+ +

 

+ +

# create a circle to + be an extrusion path

+ +

px1 = geompy.MakeVertex( + 100.,  100., +  0.)

+ +

py1 = geompy.MakeVertex(-100., + -100.,  0.)

+ +

pz1 = geompy.MakeVertex( +   0., +    0., + 50.)

+ +

 

+ +

circle = geompy.MakeCircleThreePnt(py1, + pz1, px1)

+ +

id_circle = geompy.addToStudy(circle, + "Path")

+ +

 

+ +

# create a 2D mesh + on the face

+ +

trias = smesh.Mesh(face1, + "Face : 2D mesh")

+ +

 

+ +

algo1D = trias.Segment()

+ +

algo1D.NumberOfSegments(6)

+ +

algo2D = trias.Triangle()

+ +

algo2D.LengthFromEdges()

+ +

 

+ +

trias.Compute()

+ +

 

+ +

# create a path mesh

+ +

circlemesh = smesh.Mesh(circle, + "Path mesh")

+ +

algo = circlemesh.Segment()

+ +

algo.NumberOfSegments(10)

+ +

circlemesh.Compute()

+ +

 

+ +

# extrusion of the + mesh

+ +

trias.ExtrusionAlongPath([], + circlemesh, circle,

+ +

                         1, + 0, [], 0, smesh.PointStruct(0, 0, 0))

+ +

 

+ +

# merge nodes

+ +

print "Number + of nodes before MergeNodes:",

+ +

trias.NbNodes()

+ +

tolerance = 0.001

+ +

array_of_nodes_groups + = trias.FindCoincidentNodes(tolerance)

+ +

 

+ +

trias.MergeNodes(array_of_nodes_groups)

+ +

 

+ +

print "Number + of nodes after MergeNodes:", trias.NbNodes()

+ +

print ""

+ +

print "Number + of elements before MergeEqualElements:"

+ +

print "Edges +      : + ", trias.NbEdges()

+ +

print "Triangles +  : ", + trias.NbTriangles()

+ +

print "Quadrangles: + ", trias.NbQuadrangles()

+ +

print "Volumes +    : + ", trias.NbVolumes()

+ +

 

+ +

# merge elements

+ +

trias.MergeEqualElements()

+ +

print "Number + of elements after MergeEqualElements:"

+ +

print "Edges +      : + ", trias.NbEdges()

+ +

print "Triangles +  : ", + trias.NbTriangles()

+ +

print "Quadrangles: + ", trias.NbQuadrangles()

+ +

print "Volumes +    : + ", trias.NbVolumes()

+ +

 

+ +

salome.sg.updateObjBrowser(1) +

+ +

 

+ +

Sewing Meshes

+ +

Sew Meshes Border to Border

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create two faces + of a box

+ +

box1 = geompy.MakeBox(0., + 0., -10., 30., 20., 25.)

+ +

facesList1 = geompy.SubShapeAll(box1, + geompy.ShapeType["FACE"])

+ +

face1 = facesList1[2]

+ +

 

+ +

box2 = geompy.MakeBox(0., + 5., 0., 20., 20., 15.)

+ +

facesList2 = geompy.SubShapeAll(box2, + geompy.ShapeType["FACE"])

+ +

face2 = facesList2[1]

+ +

 

+ +

edgesList = geompy.SubShapeAll(face2, + geompy.ShapeType["EDGE"])

+ +

edge1 = edgesList[2]

+ +

 

+ +

aComp = geompy.MakeCompound([face1, + face2])

+ +

geompy.addToStudy(aComp, + "Two faces")

+ +

 

+ +

# create a mesh on + two faces

+ +

mesh = smesh.Mesh(aComp, + "Two faces : quadrangle mesh")

+ +

 

+ +

algo1D = mesh.Segment()

+ +

algo1D.NumberOfSegments(9)

+ +

algo2D = mesh.Quadrangle()

+ +

 

+ +

algo_local = mesh.Segment(edge1)

+ +

algo_local.Arithmetic1D(1, + 4)

+ +

algo_local.Propagation()

+ +

 

+ +

mesh.Compute()

+ +

 

+ +

# sew border to side

+ +

# FirstNodeIDOnFreeBorder, + SecondNodeIDOnFreeBorder, LastNodeIDOnFreeBorder,

+ +

# FirstNodeIDOnSide, + LastNodeIDOnSide,

+ +

# CreatePolygons, CreatePolyedrs

+ +

mesh.SewBorderToSide(5, + 45, 6, 113, 109, 0, 0)

+ +

Sew Conform Free Borders

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create two faces + of the box

+ +

box1 = geompy.MakeBox(0., + 0., -10., 20., 20., 15.)

+ +

facesList1 = geompy.SubShapeAll(box1, + geompy.ShapeType["FACE"])

+ +

face1 = facesList1[2]

+ +

 

+ +

box2 = geompy.MakeBox(0., + 5., 0., 20., 20., 15.)

+ +

facesList2 = geompy.SubShapeAll(box2, + geompy.ShapeType["FACE"])

+ +

face2 = facesList2[1]

+ +

 

+ +

edgesList = geompy.SubShapeAll(face2, + geompy.ShapeType["EDGE"])

+ +

edge1 = edgesList[2]

+ +

 

+ +

aComp = geompy.MakeCompound([face1, + face2])

+ +

geompy.addToStudy(aComp, + "Two faces")

+ +

 

+ +

# create a mesh on + two faces

+ +

mesh = smesh.Mesh(aComp, + "Two faces : quadrangle mesh")

+ +

 

+ +

algo1D = mesh.Segment()

+ +

algo1D.NumberOfSegments(9)

+ +

algo2D = mesh.Quadrangle()

+ +

 

+ +

algo_local = mesh.Segment(edge1)

+ +

algo_local.Arithmetic1D(1, + 4)

+ +

algo_local.Propagation()

+ +

 

+ +

mesh.Compute()

+ +

 

+ +

# sew conform free + borders

+ +

# FirstNodeID1, SecondNodeID1, + LastNodeID1, FirstNodeID2, SecondNodeID2

+ +

mesh.SewConformFreeBorders(5, + 45, 6, 3, 24)  

+ +

Sew Free Borders

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create two faces + of the box

+ +

box1 = geompy.MakeBox(0., + 0., 0., 20., 20., 15.)

+ +

facesList1 = geompy.SubShapeAll(box1, + geompy.ShapeType["FACE"])

+ +

face1 = facesList1[2]

+ +

 

+ +

box2 = geompy.MakeBox(0., + 5., 0., 20., 20., 15.)

+ +

facesList2 = geompy.SubShapeAll(box2, + geompy.ShapeType["FACE"])

+ +

face2 = facesList2[1]

+ +

 

+ +

edgesList = geompy.SubShapeAll(face2, + geompy.ShapeType["EDGE"])

+ +

edge1 = edgesList[2]

+ +

 

+ +

aComp = geompy.MakeCompound([face1, + face2])

+ +

geompy.addToStudy(aComp, + "Two faces")

+ +

 

+ +

# create a mesh on + two faces

+ +

mesh = smesh.Mesh(aComp, + "Two faces : quadrangle mesh")

+ +

 

+ +

algo1D = mesh.Segment()

+ +

algo1D.NumberOfSegments(4)

+ +

algo2D = mesh.Quadrangle()

+ +

 

+ +

algo_local = mesh.Segment(edge1)

+ +

algo_local.Arithmetic1D(1, + 4)

+ +

algo_local.Propagation()

+ +

 

+ +

mesh.Compute()

+ +

 

+ +

# sew free borders

+ +

# FirstNodeID1, SecondNodeID1, + LastNodeID1,

+ +

# FirstNodeID2, SecondNodeID2, + LastNodeID2, CreatePolygons, CreatePolyedrs

+ +

mesh.SewFreeBorders(6, + 21, 5, 1, 12, 3, 0, 0)

+ +

Sew Side Elements

+ +

import geompy

+ +

import smesh

+ +

 

+ +

# create two boxes

+ +

box1 = geompy.MakeBox(0., +  0., 0., + 10., 10., 10.)

+ +

box2 = geompy.MakeBox(0., + 15., 0., 20., 25., 10.)

+ +

 

+ +

EdgesList = geompy.SubShapeAll(box2, + geompy.ShapeType["EDGE"])

+ +

 

+ +

aComp = geompy.MakeCompound([box1, + box2])

+ +

geompy.addToStudy(aComp, + "Two boxes")

+ +

 

+ +

# create a mesh on + two boxes

+ +

mesh = smesh.Mesh(aComp, + "Two faces : quadrangle mesh")

+ +

 

+ +

algo1D = mesh.Segment()

+ +

algo1D.NumberOfSegments(2)

+ +

algo2D = mesh.Quadrangle()

+ +

 

+ +

algo_local = mesh.Segment(EdgesList[8])

+ +

algo_local.NumberOfSegments(4)

+ +

algo_local.Propagation()

+ +

 

+ +

mesh.Compute()

+ +

 

+ +

# sew side elements

+ +

# IDsOfSide1Elements, + IDsOfSide2Elements,

+ +

# NodeID1OfSide1ToMerge, + NodeID1OfSide2ToMerge, NodeID2OfSide1ToMerge, NodeID2OfSide2ToMerge

+ +

mesh.SewSideElements([69, + 70, 71, 72], [91, 92, 89, 90], 8, 38, 23, 58)

+ + + + diff --git a/doc/salome/gui/SMESH/transparency.htm b/doc/salome/gui/SMESH/transparency.htm index 9f9244643..ab7df8c56 100755 --- a/doc/salome/gui/SMESH/transparency.htm +++ b/doc/salome/gui/SMESH/transparency.htm @@ -1,98 +1,98 @@ - - - - - -Transparency - - - - - - - - - - - - -

Transparency

- -

- -

 

- -

Using this slider you can set the transparency of shading. Absolutely - transparent shading will be invisible. By default it is absolutely opaque. -  

- -

 

- - - - + + + + + +Transparency + + + + + + + + + + + + +

Transparency

+ +

+ +

 

+ +

Using this slider you can set the transparency of shading. Absolutely + transparent shading will be invisible. By default it is absolutely opaque. +  

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/viewing_meshes.htm b/doc/salome/gui/SMESH/viewing_meshes.htm index 27b788e30..f2eca5e99 100755 --- a/doc/salome/gui/SMESH/viewing_meshes.htm +++ b/doc/salome/gui/SMESH/viewing_meshes.htm @@ -1,188 +1,187 @@ - - - - - -Viewing Meshes - - - - - - - - - - - -

Viewing Meshes

- -

Viewing Mesh Infos

- -

import - geompy

- -

import smesh

- -

 

- -

# create a box

- -

box = geompy.MakeBox(0., 0., 0., 20., - 20., 20.)

- -

geompy.addToStudy(box, "box")

- -

 

- -

# create a mesh

- -

tetra = smesh.Mesh(box, "MeshBox")

- -

 

- -

algo1D = tetra.Segment()

- -

algo1D.NumberOfSegments(3)

- -

 

- -

algo2D = tetra.Triangle()

- -

algo2D.MaxElementArea(10.)

- -

 

- -

algo3D = tetra.Tetrahedron(smesh.NETGEN)

- -

algo3D.MaxElementVolume(900.)

- -

 

- -

# compute the mesh

- -

tetra.Compute()

- -

 

- -

# print informations - about the mesh

- -

mesh = tetra.GetMesh()

- -

print "Information about mesh:"

- -

print "Number of nodes       : - ", mesh.NbNodes()

- -

print "Number of edges       : - ", mesh.NbEdges()

- -

print "Number of faces       : - ", mesh.NbFaces()

- -

print "          triangles -   : - ", mesh.NbTriangles()

- -

print "          quadrangles - : ", mesh.NbQuadrangles()

- -

print "          polygons -    : - ", mesh.NbPolygons()

- -

print "Number of volumes     : - ", mesh.NbVolumes()

- -

print "          tetrahedrons: - ", mesh.NbTetras()

- -

print "          hexahedrons - : ", mesh.NbHexas()

- -

print "          prisms -      : - ", mesh.NbPrisms()

- -

print "          pyramids -    : - ", mesh.NbPyramids()

- -

print "          polyhedrons - : ", mesh.NbPolyhedrons()

- - - - + + + + + +Viewing Meshes + + + + + + + + + + + +

Viewing Meshes

+ +

Viewing Mesh Infos

+ +

import + geompy

+ +

import smesh

+ +

 

+ +

# create a box

+ +

box = geompy.MakeBox(0., 0., 0., 20., + 20., 20.)

+ +

geompy.addToStudy(box, "box")

+ +

 

+ +

# create a mesh

+ +

tetra = smesh.Mesh(box, "MeshBox")

+ +

 

+ +

algo1D = tetra.Segment()

+ +

algo1D.NumberOfSegments(3)

+ +

 

+ +

algo2D = tetra.Triangle()

+ +

algo2D.MaxElementArea(10.)

+ +

 

+ +

algo3D = tetra.Tetrahedron(smesh.NETGEN)

+ +

algo3D.MaxElementVolume(900.)

+ +

 

+ +

# compute the mesh

+ +

tetra.Compute()

+ +

 

+ +

# print information + about the mesh

+ +

print "Information about mesh:" +

+ +

print "Number of nodes       : + ", tetra.NbNodes()

+ +

print "Number of edges       : + ", tetra.NbEdges()

+ +

print "Number of faces       : + ", tetra.NbFaces()

+ +

print "          triangles +   : + ", tetra.NbTriangles()

+ +

print "          quadrangles + : ", tetra.NbQuadrangles()

+ +

print "          polygons +    : + ", tetra.NbPolygons()

+ +

print "Number of volumes     : + ", tetra.NbVolumes()

+ +

print "          tetrahedrons: + ", tetra.NbTetras()

+ +

print "          hexahedrons + : ", tetra.NbHexas()

+ +

print "          prisms +      : + ", tetra.NbPrisms()

+ +

print "          pyramids +    : + ", tetra.NbPyramids()

+ +

print "          polyhedrons + : ", tetra.NbPolyhedrons()  

+ + + + diff --git a/doc/salome/gui/SMESH/volume.htm b/doc/salome/gui/SMESH/volume.htm index f55993eaf..bb675f1e0 100755 --- a/doc/salome/gui/SMESH/volume.htm +++ b/doc/salome/gui/SMESH/volume.htm @@ -1,123 +1,123 @@ - - - - - -Volume - - - - - - - - - - - -

Volume

- -

Volume mesh quality - criterion reflects the volume of meshes of a 3D object.

- -

- -

To - apply the Volume quality criterion to your mesh:

- -

1. Display your mesh in the viewer.

- -

2. Choose Controls - > Volume or click button in the toolbar. Your - mesh will be displayed in the viewer with its elements colored according - to the applied mesh quality control criterion:

- -

See Also - a sample TUI Script of a Volume quality control operation. -  

- -

 

- -

 

- -

 

- - - - + + + + + +Volume + + + + + + + + + + + +

Volume

+ +

Volume mesh quality + criterion reflects the volume of meshes of a 3D object.

+ +

+ +

To + apply the Volume quality criterion to your mesh:

+ +

1. Display your mesh in the viewer.

+ +

2. Choose Controls + > Volume or click button in the toolbar. Your + mesh will be displayed in the viewer with its elements colored according + to the applied mesh quality control criterion:

+ +

See Also + a sample TUI Script of a Volume quality control operation. +  

+ +

 

+ +

 

+ +

 

+ + + + diff --git a/doc/salome/gui/SMESH/webhelp.jar b/doc/salome/gui/SMESH/webhelp.jar index 53b2666365f925aa3d03937608babf0aef95f661..1d1697e7646e8c22cada468b8813c461258493fa 100755 GIT binary patch delta 23 fcmex5i{tYwj)pCai4xnBBp5#)-5zp}QBfZNfz=89 delta 27 gcmex7i{tAoj)pCai4u&w+kwQ#qd+?79;2c@0Guic761SM diff --git a/doc/salome/gui/SMESH/whcsh_home.htm b/doc/salome/gui/SMESH/whcsh_home.htm index 5a486ba28..bc99598c0 100755 --- a/doc/salome/gui/SMESH/whcsh_home.htm +++ b/doc/salome/gui/SMESH/whcsh_home.htm @@ -1,600 +1,600 @@ - - - - - - \ No newline at end of file + + + + + + diff --git a/doc/salome/gui/SMESH/whcshdata.htm b/doc/salome/gui/SMESH/whcshdata.htm index 14d55202c..a21983910 100755 --- a/doc/salome/gui/SMESH/whcshdata.htm +++ b/doc/salome/gui/SMESH/whcshdata.htm @@ -1,87 +1,87 @@ - - -Mesh Module Reference Manual - - - - - - - - - - + + +Mesh Module Reference Manual + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whd_dpns.htm b/doc/salome/gui/SMESH/whd_dpns.htm index 1bca23603..3983ccbdd 100755 --- a/doc/salome/gui/SMESH/whd_dpns.htm +++ b/doc/salome/gui/SMESH/whd_dpns.htm @@ -1,43 +1,43 @@ - - -Navigator Pane - - - - - - - - - - - - - + + +Navigator Pane + + + + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whd_nvp10.htm b/doc/salome/gui/SMESH/whd_nvp10.htm index a57fe1e49..05b5f908c 100755 --- a/doc/salome/gui/SMESH/whd_nvp10.htm +++ b/doc/salome/gui/SMESH/whd_nvp10.htm @@ -1,15 +1,15 @@ - - -Navigation Pane - - - - - - - - - - - - + + +Navigation Pane + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whd_nvp20.htm b/doc/salome/gui/SMESH/whd_nvp20.htm index c5754bc41..23c23dc4f 100755 --- a/doc/salome/gui/SMESH/whd_nvp20.htm +++ b/doc/salome/gui/SMESH/whd_nvp20.htm @@ -1,334 +1,334 @@ - - -navigation pane - - - - - - - - - - - - - - - - - + + +navigation pane + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whd_tabs.htm b/doc/salome/gui/SMESH/whd_tabs.htm index 1568f573d..e8c498c88 100755 --- a/doc/salome/gui/SMESH/whd_tabs.htm +++ b/doc/salome/gui/SMESH/whd_tabs.htm @@ -1,533 +1,533 @@ - - -WebHelp Tabs Frame in Navigation Pane - - - - - - - - - - + + +WebHelp Tabs Frame in Navigation Pane + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whd_toc4.gif b/doc/salome/gui/SMESH/whd_toc4.gif index 3f9a036867847517b1eab4503a4bd378178c0bd5..354aa6ece3d858dddee0810e042bebb83e857b0a 100755 GIT binary patch delta 14 VcmdnVzJq - - - - - - - - - -"]]> - - - - -"]]> - - - - -"; -OutputInTopicNavBarDataWebSearch.form();]]> - - - - - - - - - - -"]]> - - - + + + + + + + + + + +"]]> + + + + +"]]> + + + + +"; +OutputInTopicNavBarDataWebSearch.form();]]> + + + + + + + + + + +"]]> + + + diff --git a/doc/salome/gui/SMESH/whdata/whftdata.js b/doc/salome/gui/SMESH/whdata/whftdata.js index 071ae6fc7..addf26223 100755 --- a/doc/salome/gui/SMESH/whdata/whftdata.js +++ b/doc/salome/gui/SMESH/whdata/whftdata.js @@ -1,25 +1,25 @@ -// WebHelp 5.10.001 -var gTEA = new Array(); -function aTE(sTopicTitle, sTopicURL) -{ - var len = gTEA.length; - gTEA[len] = new topicEntry(sTopicTitle, sTopicURL); -} - -function topicEntry(sTopicTitle, sTopicURL) -{ - this.sTopicTitle = sTopicTitle; - this.sTopicURL = sTopicURL; -} - -function window_OnLoad() -{ - if (parent && parent != this) { - if (parent.putFtsTData) - { - parent.putFtsTData(gTEA); - } - } -} - +// WebHelp 5.10.001 +var gTEA = new Array(); +function aTE(sTopicTitle, sTopicURL) +{ + var len = gTEA.length; + gTEA[len] = new topicEntry(sTopicTitle, sTopicURL); +} + +function topicEntry(sTopicTitle, sTopicURL) +{ + this.sTopicTitle = sTopicTitle; + this.sTopicURL = sTopicURL; +} + +function window_OnLoad() +{ + if (parent && parent != this) { + if (parent.putFtsTData) + { + parent.putFtsTData(gTEA); + } + } +} + window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whftdata0.htm b/doc/salome/gui/SMESH/whdata/whftdata0.htm index 140af1130..78532ffdc 100755 --- a/doc/salome/gui/SMESH/whdata/whftdata0.htm +++ b/doc/salome/gui/SMESH/whdata/whftdata0.htm @@ -1,92 +1,95 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whdata/whfts.htm b/doc/salome/gui/SMESH/whdata/whfts.htm index 15e5cf489..6e7f89e4d 100755 --- a/doc/salome/gui/SMESH/whdata/whfts.htm +++ b/doc/salome/gui/SMESH/whdata/whfts.htm @@ -1,18 +1,18 @@ - - - - - - - - - - - \ No newline at end of file + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whdata/whfts.js b/doc/salome/gui/SMESH/whdata/whfts.js index 2b6678690..54246f693 100755 --- a/doc/salome/gui/SMESH/whdata/whfts.js +++ b/doc/salome/gui/SMESH/whdata/whfts.js @@ -1,40 +1,40 @@ -// WebHelp 5.10.001 -var gaFileMapping = new Array(); -var gaFileTopicMapping = new Array(); - -function fileMapping(sStartKey, sEndKey, sFileName) -{ - this.sStartKey = sStartKey; - this.sEndKey = sEndKey; - this.sFileName = sFileName; - this.aFtsKeys = null; -} - -function fileTopicMapping(nIdBegin, nIdEnd, sFileName) -{ - this.nBegin = nIdBegin; - this.nEnd = nIdEnd; - this.sFileName = sFileName; - this.aTopics = null; -} - - -function iWM(sStartKey, sEndKey, sFileName) -{ - gaFileMapping[gaFileMapping.length] = new fileMapping(sStartKey, sEndKey, sFileName); -} - -function window_OnLoad() -{ - if (parent && parent != this && parent.ftsReady) - { - parent.ftsReady(gaFileMapping, gaFileTopicMapping); - } -} - -function iTM(nIdBegin, nIdEnd, sFileName) -{ - gaFileTopicMapping[gaFileTopicMapping.length] = new fileTopicMapping(nIdBegin, nIdEnd, sFileName); -} - -window.onload = window_OnLoad; +// WebHelp 5.10.001 +var gaFileMapping = new Array(); +var gaFileTopicMapping = new Array(); + +function fileMapping(sStartKey, sEndKey, sFileName) +{ + this.sStartKey = sStartKey; + this.sEndKey = sEndKey; + this.sFileName = sFileName; + this.aFtsKeys = null; +} + +function fileTopicMapping(nIdBegin, nIdEnd, sFileName) +{ + this.nBegin = nIdBegin; + this.nEnd = nIdEnd; + this.sFileName = sFileName; + this.aTopics = null; +} + + +function iWM(sStartKey, sEndKey, sFileName) +{ + gaFileMapping[gaFileMapping.length] = new fileMapping(sStartKey, sEndKey, sFileName); +} + +function window_OnLoad() +{ + if (parent && parent != this && parent.ftsReady) + { + parent.ftsReady(gaFileMapping, gaFileTopicMapping); + } +} + +function iTM(nIdBegin, nIdEnd, sFileName) +{ + gaFileTopicMapping[gaFileTopicMapping.length] = new fileTopicMapping(nIdBegin, nIdEnd, sFileName); +} + +window.onload = window_OnLoad; diff --git a/doc/salome/gui/SMESH/whdata/whfwdata.js b/doc/salome/gui/SMESH/whdata/whfwdata.js index e9e8bc6c1..8340b59d5 100755 --- a/doc/salome/gui/SMESH/whdata/whfwdata.js +++ b/doc/salome/gui/SMESH/whdata/whfwdata.js @@ -1,37 +1,37 @@ -// WebHelp 5.10.001 -var gWEA = new Array(); -function aWE() -{ - var len = gWEA.length; - gWEA[len] = new ftsEntry(aWE.arguments); -} - -function ftsEntry(fn_arguments) -{ - if (fn_arguments.length && fn_arguments.length >= 1) - { - this.sItemName = fn_arguments[0]; - this.aTopics = null; - var nLen = fn_arguments.length; - if (nLen > 1) - { - this.aTopics = new Array(); - for (var i = 0; i < nLen - 1; i ++ ) - { - this.aTopics[i] = fn_arguments[i + 1]; - } - } - } -} - -function window_OnLoad() -{ - if (parent && parent != this) { - if (parent.putFtsWData) - { - parent.putFtsWData(gWEA); - } - } -} - +// WebHelp 5.10.001 +var gWEA = new Array(); +function aWE() +{ + var len = gWEA.length; + gWEA[len] = new ftsEntry(aWE.arguments); +} + +function ftsEntry(fn_arguments) +{ + if (fn_arguments.length && fn_arguments.length >= 1) + { + this.sItemName = fn_arguments[0]; + this.aTopics = null; + var nLen = fn_arguments.length; + if (nLen > 1) + { + this.aTopics = new Array(); + for (var i = 0; i < nLen - 1; i ++ ) + { + this.aTopics[i] = fn_arguments[i + 1]; + } + } + } +} + +function window_OnLoad() +{ + if (parent && parent != this) { + if (parent.putFtsWData) + { + parent.putFtsWData(gWEA); + } + } +} + window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whfwdata0.htm b/doc/salome/gui/SMESH/whdata/whfwdata0.htm index dd65b784d..b9fdacc03 100755 --- a/doc/salome/gui/SMESH/whdata/whfwdata0.htm +++ b/doc/salome/gui/SMESH/whdata/whfwdata0.htm @@ -1,1420 +1,1393 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whdata/whgdata.js b/doc/salome/gui/SMESH/whdata/whgdata.js index 77e0107f3..e38a107b5 100755 --- a/doc/salome/gui/SMESH/whdata/whgdata.js +++ b/doc/salome/gui/SMESH/whdata/whgdata.js @@ -1,26 +1,26 @@ -// WebHelp 5.10.001 -var gIEA = new Array(); -function aGE(sName, sDef) -{ - var len = gIEA.length; - gIEA[len] = new gloEntry(sName, sDef); -} - -function gloEntry(sName, sDef) -{ - this.sName = sName; - this.sDef = sDef; - this.nNKOff = 0; -} - -function window_OnLoad() -{ - if (parent && parent != this) { - if (parent.putData) - { - parent.putData(gIEA); - } - } -} - +// WebHelp 5.10.001 +var gIEA = new Array(); +function aGE(sName, sDef) +{ + var len = gIEA.length; + gIEA[len] = new gloEntry(sName, sDef); +} + +function gloEntry(sName, sDef) +{ + this.sName = sName; + this.sDef = sDef; + this.nNKOff = 0; +} + +function window_OnLoad() +{ + if (parent && parent != this) { + if (parent.putData) + { + parent.putData(gIEA); + } + } +} + window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whgdata0.htm b/doc/salome/gui/SMESH/whdata/whgdata0.htm index 9d256b1a8..3865725f4 100755 --- a/doc/salome/gui/SMESH/whdata/whgdata0.htm +++ b/doc/salome/gui/SMESH/whdata/whgdata0.htm @@ -1,33 +1,33 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whdata/whglo.htm b/doc/salome/gui/SMESH/whdata/whglo.htm index dc5a67786..9d7ac79f1 100755 --- a/doc/salome/gui/SMESH/whdata/whglo.htm +++ b/doc/salome/gui/SMESH/whdata/whglo.htm @@ -1,16 +1,16 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whglo.js b/doc/salome/gui/SMESH/whdata/whglo.js index e0519afcb..c34fb24b2 100755 --- a/doc/salome/gui/SMESH/whdata/whglo.js +++ b/doc/salome/gui/SMESH/whdata/whglo.js @@ -1,34 +1,34 @@ -// WebHelp 5.10.001 -var gaFileMapping = new Array(); -function fileMapping(sBK, sEK, sFileName, nNum) -{ - this.sBK = sBK; - this.sEK = sEK; - this.sFileName = sFileName; - this.aKs = null; - this.nNum = nNum; - this.oUsedItems = null; -} - - -function iFM(sBK, sEK, sFileName, nNum) -{ - var i = gaFileMapping.length; - gaFileMapping[i] = new fileMapping(sBK, sEK, sFileName, nNum); - if (i == 0) { - gaFileMapping[i].nTotal = nNum; - } - else { - gaFileMapping[i].nTotal = nNum + gaFileMapping[i - 1].nTotal; - } -} - -function window_OnLoad() -{ - if (parent && parent != this && parent.projReady) - { - parent.projReady(gaFileMapping); - } -} - -window.onload = window_OnLoad; +// WebHelp 5.10.001 +var gaFileMapping = new Array(); +function fileMapping(sBK, sEK, sFileName, nNum) +{ + this.sBK = sBK; + this.sEK = sEK; + this.sFileName = sFileName; + this.aKs = null; + this.nNum = nNum; + this.oUsedItems = null; +} + + +function iFM(sBK, sEK, sFileName, nNum) +{ + var i = gaFileMapping.length; + gaFileMapping[i] = new fileMapping(sBK, sEK, sFileName, nNum); + if (i == 0) { + gaFileMapping[i].nTotal = nNum; + } + else { + gaFileMapping[i].nTotal = nNum + gaFileMapping[i - 1].nTotal; + } +} + +function window_OnLoad() +{ + if (parent && parent != this && parent.projReady) + { + parent.projReady(gaFileMapping); + } +} + +window.onload = window_OnLoad; diff --git a/doc/salome/gui/SMESH/whdata/whidata.js b/doc/salome/gui/SMESH/whdata/whidata.js index 9f0eb15ed..a92184730 100755 --- a/doc/salome/gui/SMESH/whdata/whidata.js +++ b/doc/salome/gui/SMESH/whdata/whidata.js @@ -1,89 +1,89 @@ -// WebHelp 5.10.001 -// const strings -var gIEA = new Array(); -function aIE() -{ - var len = gIEA.length; - gIEA[len] = new indexEntry(aIE.arguments); -} - -function topic(sName, sURL) -{ - this.sName = sName; - this.sURL = sURL; -} - -function indexEntry(fn_arguments) -{ - if (fn_arguments.length && fn_arguments.length >= 3) - { - this.nType = fn_arguments[0]; - this.nPKOff = 0; - this.nNKOff = fn_arguments[1]; - this.sName = fn_arguments[2]; - this.aTopics = null; - var nLen = fn_arguments.length; - if (Math.floor(nLen / 2) * 2 == nLen) - { - this.sTarget = fn_arguments[3]; - if (nLen > 5) - { - this.aTopics = new Array(); - for (var i = 0; i < (nLen - 5)/2; i++) - { - this.aTopics[i] = new topic(fn_arguments[i * 2 + 4], fn_arguments[i * 2 + 5]); - } - } - - } - else - { - if (nLen > 4) - { - this.aTopics = new Array(); - for (var i = 0; i < (nLen - 4)/2; i++) - { - this.aTopics[i] = new topic(fn_arguments[i * 2 + 3], fn_arguments[i * 2 + 4]); - } - } - } - } -} - -function getIndexTopicMappingList(nItemIndex) -{ - var sTopics = ""; - if (gIEA.length > nItemIndex) - { - if (gIEA[nItemIndex].aTopics) - { - var i = 0; - var nLen = gIEA[nItemIndex].aTopics.length; - for (i = 0; i < nLen; i ++) - { - sTopics += "," + gIEA[nItemIndex].aTopics[i]; - } - } - } - return sTopics; -} - -function window_OnLoad() -{ - if (parent && parent != this) { - if (parent.putData) - { - for (var i = 0; i < gIEA.length; i ++ ) - { - if (gIEA[i].nNKOff != 0 && i + gIEA[i].nNKOff + 1 < gIEA.length) - { - - gIEA[i + gIEA[i].nNKOff + 1].nPKOff = gIEA[i].nNKOff; - } - } - parent.putData(gIEA); - } - } -} - +// WebHelp 5.10.001 +// const strings +var gIEA = new Array(); +function aIE() +{ + var len = gIEA.length; + gIEA[len] = new indexEntry(aIE.arguments); +} + +function topic(sName, sURL) +{ + this.sName = sName; + this.sURL = sURL; +} + +function indexEntry(fn_arguments) +{ + if (fn_arguments.length && fn_arguments.length >= 3) + { + this.nType = fn_arguments[0]; + this.nPKOff = 0; + this.nNKOff = fn_arguments[1]; + this.sName = fn_arguments[2]; + this.aTopics = null; + var nLen = fn_arguments.length; + if (Math.floor(nLen / 2) * 2 == nLen) + { + this.sTarget = fn_arguments[3]; + if (nLen > 5) + { + this.aTopics = new Array(); + for (var i = 0; i < (nLen - 5)/2; i++) + { + this.aTopics[i] = new topic(fn_arguments[i * 2 + 4], fn_arguments[i * 2 + 5]); + } + } + + } + else + { + if (nLen > 4) + { + this.aTopics = new Array(); + for (var i = 0; i < (nLen - 4)/2; i++) + { + this.aTopics[i] = new topic(fn_arguments[i * 2 + 3], fn_arguments[i * 2 + 4]); + } + } + } + } +} + +function getIndexTopicMappingList(nItemIndex) +{ + var sTopics = ""; + if (gIEA.length > nItemIndex) + { + if (gIEA[nItemIndex].aTopics) + { + var i = 0; + var nLen = gIEA[nItemIndex].aTopics.length; + for (i = 0; i < nLen; i ++) + { + sTopics += "," + gIEA[nItemIndex].aTopics[i]; + } + } + } + return sTopics; +} + +function window_OnLoad() +{ + if (parent && parent != this) { + if (parent.putData) + { + for (var i = 0; i < gIEA.length; i ++ ) + { + if (gIEA[i].nNKOff != 0 && i + gIEA[i].nNKOff + 1 < gIEA.length) + { + + gIEA[i + gIEA[i].nNKOff + 1].nPKOff = gIEA[i].nNKOff; + } + } + parent.putData(gIEA); + } + } +} + window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whidx.htm b/doc/salome/gui/SMESH/whdata/whidx.htm index 0a0deedd0..a049a96f9 100755 --- a/doc/salome/gui/SMESH/whdata/whidx.htm +++ b/doc/salome/gui/SMESH/whdata/whidx.htm @@ -1,15 +1,15 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whidx.js b/doc/salome/gui/SMESH/whdata/whidx.js index e0519afcb..c34fb24b2 100755 --- a/doc/salome/gui/SMESH/whdata/whidx.js +++ b/doc/salome/gui/SMESH/whdata/whidx.js @@ -1,34 +1,34 @@ -// WebHelp 5.10.001 -var gaFileMapping = new Array(); -function fileMapping(sBK, sEK, sFileName, nNum) -{ - this.sBK = sBK; - this.sEK = sEK; - this.sFileName = sFileName; - this.aKs = null; - this.nNum = nNum; - this.oUsedItems = null; -} - - -function iFM(sBK, sEK, sFileName, nNum) -{ - var i = gaFileMapping.length; - gaFileMapping[i] = new fileMapping(sBK, sEK, sFileName, nNum); - if (i == 0) { - gaFileMapping[i].nTotal = nNum; - } - else { - gaFileMapping[i].nTotal = nNum + gaFileMapping[i - 1].nTotal; - } -} - -function window_OnLoad() -{ - if (parent && parent != this && parent.projReady) - { - parent.projReady(gaFileMapping); - } -} - -window.onload = window_OnLoad; +// WebHelp 5.10.001 +var gaFileMapping = new Array(); +function fileMapping(sBK, sEK, sFileName, nNum) +{ + this.sBK = sBK; + this.sEK = sEK; + this.sFileName = sFileName; + this.aKs = null; + this.nNum = nNum; + this.oUsedItems = null; +} + + +function iFM(sBK, sEK, sFileName, nNum) +{ + var i = gaFileMapping.length; + gaFileMapping[i] = new fileMapping(sBK, sEK, sFileName, nNum); + if (i == 0) { + gaFileMapping[i].nTotal = nNum; + } + else { + gaFileMapping[i].nTotal = nNum + gaFileMapping[i - 1].nTotal; + } +} + +function window_OnLoad() +{ + if (parent && parent != this && parent.projReady) + { + parent.projReady(gaFileMapping); + } +} + +window.onload = window_OnLoad; diff --git a/doc/salome/gui/SMESH/whdata/whtdata.js b/doc/salome/gui/SMESH/whdata/whtdata.js index d5428a7de..0558e198c 100755 --- a/doc/salome/gui/SMESH/whdata/whtdata.js +++ b/doc/salome/gui/SMESH/whdata/whtdata.js @@ -1,64 +1,64 @@ -// WebHelp 5.10.001 -var gTEA = new Array(); -function aTE() -{ - gTEA[gTEA.length] = new tocEntry(aTE.arguments); -} - -function tocEntry(fn_arguments) -{ - if (fn_arguments.length < 3) - { - alert ("data format wrong!!!"); - return; - } - - this.nType = fn_arguments[0]; - this.nContents = fn_arguments[1]; - this.sItemName = fn_arguments[2]; - - if (this.nType == 1 || this.nType == 2 || this.nType == 16) - { - if (fn_arguments.length > 3) - { - this.sItemURL = fn_arguments[3]; - if (fn_arguments.length > 4) - { - this.sTarget = fn_arguments[4]; - if (fn_arguments.length > 5) - this.sIconRef = fn_arguments[5]; - } - } - } - if (this.nType == 4 || this.nType == 8) - { - if (fn_arguments.length > 3) - { - this.sRefURL = fn_arguments[3]; - if (this.nType == 4) - { - if(this.sRefURL.lastIndexOf("/")!=this.sRefURL.length-1) - this.sRefURL+="/"; - } - if (fn_arguments.length > 4) - { - this.sItemURL = fn_arguments[4]; - if (fn_arguments.length > 5) - { - this.sTarget = fn_arguments[5]; - if (fn_arguments.length > 6) - this.sIconRef = fn_arguments[6]; - } - } - } - } -} - - -function window_OnLoad() -{ - if (parent && parent != this && parent.putData) { - parent.putData(gTEA); - } -} +// WebHelp 5.10.001 +var gTEA = new Array(); +function aTE() +{ + gTEA[gTEA.length] = new tocEntry(aTE.arguments); +} + +function tocEntry(fn_arguments) +{ + if (fn_arguments.length < 3) + { + alert ("data format wrong!!!"); + return; + } + + this.nType = fn_arguments[0]; + this.nContents = fn_arguments[1]; + this.sItemName = fn_arguments[2]; + + if (this.nType == 1 || this.nType == 2 || this.nType == 16) + { + if (fn_arguments.length > 3) + { + this.sItemURL = fn_arguments[3]; + if (fn_arguments.length > 4) + { + this.sTarget = fn_arguments[4]; + if (fn_arguments.length > 5) + this.sIconRef = fn_arguments[5]; + } + } + } + if (this.nType == 4 || this.nType == 8) + { + if (fn_arguments.length > 3) + { + this.sRefURL = fn_arguments[3]; + if (this.nType == 4) + { + if(this.sRefURL.lastIndexOf("/")!=this.sRefURL.length-1) + this.sRefURL+="/"; + } + if (fn_arguments.length > 4) + { + this.sItemURL = fn_arguments[4]; + if (fn_arguments.length > 5) + { + this.sTarget = fn_arguments[5]; + if (fn_arguments.length > 6) + this.sIconRef = fn_arguments[6]; + } + } + } + } +} + + +function window_OnLoad() +{ + if (parent && parent != this && parent.putData) { + parent.putData(gTEA); + } +} window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whtdata0.htm b/doc/salome/gui/SMESH/whdata/whtdata0.htm index 30cfea696..8861e1214 100755 --- a/doc/salome/gui/SMESH/whdata/whtdata0.htm +++ b/doc/salome/gui/SMESH/whdata/whtdata0.htm @@ -1,98 +1,102 @@ - - - - - - - - - - - + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whdata/whtoc.htm b/doc/salome/gui/SMESH/whdata/whtoc.htm index 54e0cbf26..459c3e311 100755 --- a/doc/salome/gui/SMESH/whdata/whtoc.htm +++ b/doc/salome/gui/SMESH/whdata/whtoc.htm @@ -1,16 +1,16 @@ - - - - - - - - - - + + + + + + + + + + \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whdata/whtoc.js b/doc/salome/gui/SMESH/whdata/whtoc.js index 163d8cc9f..62de5a132 100755 --- a/doc/salome/gui/SMESH/whdata/whtoc.js +++ b/doc/salome/gui/SMESH/whdata/whtoc.js @@ -1,31 +1,31 @@ -// WebHelp 5.10.001 -// const strings -var gaProj = new Array(); -var gsRoot = ""; - -function setRoot(sRoot) -{ - gsRoot = sRoot -} - -function aPE(sProjPath, sRootPath) -{ - gaProj[gaProj.length] = new tocProjEntry(sProjPath, sRootPath); -} - -function tocProjEntry(sProjPath, sRootPath) -{ - if(sProjPath.lastIndexOf("/")!=sProjPath.length-1) - sProjPath+="/"; - this.sPPath = sProjPath; - this.sRPath = sRootPath; -} - - -function window_OnLoad() -{ - if (parent && parent != this && parent.projReady) { - parent.projReady(gsRoot, gaProj); - } -} +// WebHelp 5.10.001 +// const strings +var gaProj = new Array(); +var gsRoot = ""; + +function setRoot(sRoot) +{ + gsRoot = sRoot +} + +function aPE(sProjPath, sRootPath) +{ + gaProj[gaProj.length] = new tocProjEntry(sProjPath, sRootPath); +} + +function tocProjEntry(sProjPath, sRootPath) +{ + if(sProjPath.lastIndexOf("/")!=sProjPath.length-1) + sProjPath+="/"; + this.sPPath = sProjPath; + this.sRPath = sRootPath; +} + + +function window_OnLoad() +{ + if (parent && parent != this && parent.projReady) { + parent.projReady(gsRoot, gaProj); + } +} window.onload = window_OnLoad; \ No newline at end of file diff --git a/doc/salome/gui/SMESH/whfbody.htm b/doc/salome/gui/SMESH/whfbody.htm index 5666e1b55..ea648e4b3 100755 --- a/doc/salome/gui/SMESH/whfbody.htm +++ b/doc/salome/gui/SMESH/whfbody.htm @@ -1,37 +1,37 @@ - - -Search Result - - - - - - - - - - - - - - - - - + + +Search Result + + + + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whfdhtml.htm b/doc/salome/gui/SMESH/whfdhtml.htm index 37429607b..c2e65bea1 100755 --- a/doc/salome/gui/SMESH/whfdhtml.htm +++ b/doc/salome/gui/SMESH/whfdhtml.htm @@ -1,30 +1,30 @@ - - -Search Frame - - - - - - - - - + + +Search Frame + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whfform.htm b/doc/salome/gui/SMESH/whfform.htm index 87d754ec4..0f8f90ab6 100755 --- a/doc/salome/gui/SMESH/whfform.htm +++ b/doc/salome/gui/SMESH/whfform.htm @@ -1,136 +1,136 @@ - - -Search Form - - - - - - - - - - - - - - \ No newline at end of file + + +Search Form + + + + + + + + + + + + + + diff --git a/doc/salome/gui/SMESH/whfhost.js b/doc/salome/gui/SMESH/whfhost.js index 167acc459..c3c7144fa 100755 --- a/doc/salome/gui/SMESH/whfhost.js +++ b/doc/salome/gui/SMESH/whfhost.js @@ -1,945 +1,945 @@ -// WebHelp 5.10.003 -var gsSK2=null; -var gsSK=null; -var gsFtsBreakChars="\t\r\n\"\\ .,!@#$%^&*()~'`:;<>?/{}[]|+-=\x85\x92\x93\x94\x95\x96\x97\x99\xA9\xAE\xB7"; -var gnCLF=0; -var gsHelpCannotSearch="Cannot search for that phrase."; -var gsNoTopics="No Topics Found."; -var gsLoadingDivID="LoadingDiv"; -var gsLoadingMsg="Loading data, please wait..."; -var gsSearchMsg="Searching..."; -var gsResultDivID="ResultDiv"; -var gaaFCD=new Array(); -var gaaFTCD=new Array(); -var goCF=null; -var goCTF=null; -var gaTI=null; -var gnCurrentOp=0; -var gbNot=false; -var gbReady=false; -var gnLoadFts=1; -var gnCacheLimits=5; -var gaCCD=new Array(); -var gbXML=false; -var gaData=new Array(); -var gsBgColor="#ffffff"; -var gsBgImage=""; -var gsMargin="0pt"; -var gsIndent="0pt"; -var gsCheckKey=null; -var gnIndexNum=0; -var gaFtsContentsCon=null; -var gaTopicCheckInfo=null; -var gnTopicCheck=0; -var goFont=null; -var goErrFont=null; -var goHoverFont=null; -var gsABgColor="#cccccc"; -var gbWhFHost=false; -var gbFirst=false; - -function setBackground(sBgImage) -{ - gsBgImage=sBgImage; -} - -function setBackgroundcolor(sBgColor) -{ - gsBgColor=sBgColor; -} - -function setFont(sType,sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration) -{ - var vFont=new whFont(sFontName,sFontSize,sFontColor,sFontStyle,sFontWeight,sFontDecoration); - if(sType=="Normal") - goFont=vFont; - else if(sType=="Error") - goErrFont=vFont; - else if(sType=="Hover") - goHoverFont=vFont; -} - -function setActiveBgColor(sBgColor) -{ - gsABgColor=sBgColor; -} - -function setMargin(sMargin) -{ - gsMargin=sMargin; -} - -function setIndent(sIndent) -{ - gsIndent=sIndent; -} - -function updateCache(oCF) -{ - var len=gaCCD.length; - if(len0&&sURL) - { - var topic=new Object(); - topic.sTopicTitle=name; - topic.sTopicURL=sURL; - aTopics[aTopics.length]=topic; - } - } - oChild=oChild.nextSibling; - } - putFtsTData(aTopics); - } - } - else if(gnLoadFts==2) - { - var node=xmlDoc.lastChild; - if(node) - { - var oChild=node.firstChild; - var aFtsContents=new Array(); - while(oChild) - { - if(oChild.nodeName=="key") - { - var name=oChild.getAttribute("name"); - if(name&&name.length>0) - { - var item=new Object(); - item.sItemName=name; - aFtsContents[aFtsContents.length]=item; - var oChildChild=oChild.firstChild; - while(oChildChild) - { - if(oChildChild.nodeName=="#text") - { - var sIDs=oChildChild.nodeValue; - if(sIDs) - { - var nBPos=0; - do - { - var nPos=sIDs.indexOf(",",nBPos); - var sID=null; - if(nPos!=-1) - sID=sIDs.substring(nBPos,nPos); - else - sID=sIDs.substring(nBPos); - - if(sID) - { - var id=parseInt(sID); - if(!isNaN(id)) - { - if(!item.aTopics) - item.aTopics=new Array(); - item.aTopics[item.aTopics.length]=id; - } - } - nBPos=nPos+1; - }while(nBPos!=0&&nBPos0) - { - document.body.background=gsBgImage; - } - if(gsBgColor&&gsBgColor.length>0) - { - document.body.bgColor=gsBgColor; - } - writeResultDiv(); - loadFts(); - var oMsg=new whMessage(WH_MSG_SHOWFTS,this,1,null) - SendMessage(oMsg); -} - -function writeResultDiv() -{ - var sHTML="
"; - document.body.insertAdjacentHTML("beforeEnd",sHTML); -} - -function loadFts() -{ - if(!gbReady) - { - var oResMsg=new whMessage(WH_MSG_GETPROJINFO,this,1,null); - if(SendMessage(oResMsg)&&oResMsg.oParam) - { - gbReady=true; - var oProj=oResMsg.oParam; - var aProj=oProj.aProj; - gbXML=oProj.bXML; - if(aProj.length>0) - { - var sLangId=aProj[0].sLangId; - for(var i=0;i=0)&&(gsFtsBreakChars.charAt(nSep)=="|"))){ - gnCurrentOp=0; - gbNot=false; - }else if((sCW=="and")||((nSep>=0)&&(gsFtsBreakChars.charAt(nSep)=="&"))){ - gnCurrentOp=1; - gbNot=false; - }else if((sCW=="not")|| - ((nSep>=0)&&(gsFtsBreakChars.charAt(nSep)=="~"))){ - gbNot=!gbNot; - }else if(sCW!=""&&!IsStopWord(sCW,gaFtsStop)){ - var sCurrentStem=GetStem(sCW); - gsCW=sCurrentStem; - ftsFindKeyword(); - return; - } - findOneKey(); - } - else{ - displayTopics(); - checkAgain(); - } -} - -function checkAgain() -{ - gsCheckKey = ""; - gnIndexNum = 0; - gsSK=gsSK2; - gsSK2=null; - if(gsSK!=null) - setTimeout("findFTSKey();",1); -} - -function displayTopics() -{ - var sHTML=""; - var sLine=""; - for(var i=0;i"+_textToHtml(gaTI[i].sTopicTitle)+""; - if(i>>4<<4==i) - { - sHTML+=sLine; - sLine=""; - } - } - if(sLine.length>0) - sHTML+=sLine; - - if(sHTML.length==0) - sHTML="

"+gsNoTopics+"

" - else - sHTML="
"+sHTML+"
"; - - var resultDiv=getElement(gsResultDivID); - if(resultDiv) - resultDiv.innerHTML=sHTML; -} - -function displayMsg(sErrorMsg) -{ - var sHTML="

"+sErrorMsg+"

"; - - var resultDiv=getElement(gsResultDivID); - if(resultDiv) - resultDiv.innerHTML=sHTML; -} - -function ftsFindKeyword() -{ - var sKey=gsCW; - var bNeedLoad=false; - var aFtsContentsCon=null; - var s=0; - if(sKey==null) return; - if(!gsCheckKey||sKey!=gsCheckKey||gnIndexNum==0) - { - aFtsContentsCon=new Array(); - gnCheck=0; - gsCheckKey=sKey; - gnTopicCheck=0; - gaTopicCheckInfo=null; - } - else{ - s=gnIndexNum; - aFtsContentsCon=gaFtsContentsCon; - } - for(var i=gnCheck;i=aTI.length) - { - aLS=gaTI; - aSS=aTI; - } - else - { - aLS=aTI; - aSS=gaTI; - } - var s=0; - for(var i=0;i=0) - { - var nM; - var bFound=false; - do{ - nM=(nB+nE)>>1; - if(compare(aTI[nM].sTopicTitle,oTI.sTopicTitle)>0) - nE=nM-1; - else if(compare(aTI[nM].sTopicTitle,oTI.sTopicTitle)<0) - nB=nM+1; - else - { - bFound=true; - break; - } - }while(nB<=nE); - if(bFound) - insertItemIntoArray(aTI,nM,oTI); - else - { - if(compare(aTI[nM].sTopicTitle,oTI.sTopicTitle)<0) - insertItemIntoArray(aTI,nM+1,oTI); - else - insertItemIntoArray(aTI,nM,oTI); - } - } - else - aTI[0]=oTI; -} - -function mergeTopics(aTI1,aTI2) -{ - var i1=0; - var i2=0; - var len1=aTI1.length; - var len2=aTI2.length; - var aTopicNew=new Array(); - var i=0; - while(i1>1; - if(compare(keys[nM].sItemName,sKey)>0) - nE=nM-1; - else if(compare(keys[nM].sItemName,sKey)<0) - nB=nM+1; - else{ - bFound=true; - break; - } - }while(nB<=nE); - if(bFound) - { - if(keys[nM].aTopics) - { - for(var i=0;i>1; - if(aFTCD[nM].nBegin>nTopicId) - nE=nM-1; - else if(aFTCD[nM].nEnd
"+sButton+"
"; - for(var i=0;i0) - { - var sHTML=""; - if(nAligns!=0) - { - sHTML+="
" - if(nAligns&1) - sHTML+=""; - if(nAligns&2) - sHTML+=""; - if(nAligns&4) - sHTML+=""; - sHTML+="
"+getIntopicBar("left")+""+getIntopicBar("center")+""+getIntopicBar("right")+"
"; - document.write(sHTML); - } - } -} - -function sendAveInfoOut() -{ - if(!isInPopup()) - setTimeout("sendAveInfo();",100); -} - -function sendAveInfo() -{ - var oMsg=new whMessage(WH_MSG_AVENUEINFO,this,1,gaAvenues); - SendMessage(oMsg); -} - - -function onNext() -{ - var oMsg=new whMessage(WH_MSG_NEXT,this,1,null); - SendMessage(oMsg); -} - -function onPrev() -{ - var oMsg=new whMessage(WH_MSG_PREV,this,1,null); - SendMessage(oMsg); -} - -function createSyncInfo() -{ - var oParam=new Object(); - if(gsPPath.length==0) - gsPPath=_getPath(document.location.href); - oParam.sPPath=gsPPath; - oParam.sTPath=document.location.href; - oParam.aPaths=gaPaths; - return oParam; -} - -function syncWithShow() -{ - if(isTopicOnly()) - show(); - else - { - sync(); - showTocPane(); - } -} - -function showTocPane() -{ - var oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null); - SendMessage(oMsg); -} - -function sendSyncInfo() -{ - if(!isInPopup()) - { - var oParam=null; - if(gaPaths.length>0) - { - oParam=createSyncInfo(); - } - var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,oParam); - SendMessage(oMsg); - } -} - -function sendInvalidSyncInfo() -{ - if(!isInPopup()) - { - var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,null); - SendMessage(oMsg); - } -} - -function enableWebSearch(bEnable) -{ - if(!isInPopup()) - { - var oMsg=new whMessage(WH_MSG_ENABLEWEBSEARCH,this,1,bEnable); - SendMessage(oMsg); - } -} - -function autoSync(nSync) -{ - if(nSync==0) return; - if(isInPopup()) return; - if(isOutMostTopic()) - sync(); -} - -function isOutMostTopic() -{ - if(gnOutmostTopic==-1) - { - var oMessage=new whMessage(WH_MSG_ISINFRAMESET,this,1,null); - if(SendMessage(oMessage)) - gnOutmostTopic=0; - else - gnOutmostTopic=1; - } - return (gnOutmostTopic==1); -} - -function sync() -{ - if(gaPaths.length>0) - { - var oParam=createSyncInfo(); - var oMessage=new whMessage(WH_MSG_SYNCTOC,this,1,oParam); - SendMessage(oMessage); - } -} - - -function avenueInfo(sName,sPrev,sNext) -{ - this.sName=sName; - this.sPrev=sPrev; - this.sNext=sNext; -} - -function getCurrentAvenue() -{ - var oParam=new Object(); - oParam.sAvenue=null; - var oMessage=new whMessage(WH_MSG_GETCURRENTAVENUE,this,1,oParam); - SendMessage(oMessage); - return oParam.sAvenue; -} - -function unRegisterListener() -{ - sendInvalidSyncInfo(); - enableWebSearch(false); - if(whtopic_foldUnload) - whtopic_foldUnload(); -} - -function onSendMessage(oMsg) -{ - var nMsgId=oMsg.nMessageId; - if(nMsgId==WH_MSG_GETAVIAVENUES) - { - oMsg.oParam.aAvenues=gaAvenues; - return false; - } - else if(nMsgId==WH_MSG_GETTOCPATHS) - { - if(isOutMostTopic()) - { - oMsg.oParam.oTocInfo=createSyncInfo(); - return false; - } - else - return true; - } - else if(nMsgId==WH_MSG_NEXT) - { - goAvenue(true); - } - else if(nMsgId==WH_MSG_PREV) - { - goAvenue(false); - } - else if(nMsgId==WH_MSG_WEBSEARCH) - { - websearch(); - } - return true; -} - -function goAvenue(bNext) -{ - var sTopic=null; - var sAvenue=getCurrentAvenue(); - var nAvenue=-1; - if(sAvenue!=null&&sAvenue!="") - { - for(var i=0;i0&&bNext) - { - sTopic=gaAvenues[i].sNext; - break; - } - else if(gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext) - { - sTopic=gaAvenues[i].sPrev; - break; - } - } - } - - if(sTopic!=null&&sTopic!="") - { - if(gsPPath!=null&&gsPPath!="") - { - sFullTopicPath=_getFullPath(gsPPath,sTopic); - document.location=sFullTopicPath; - } - } -} - -function canGo(bNext) -{ - for(var i=0;i0&&bNext)|| - (gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext)) - return true; - } - return false; -} - -function show() -{ - if(gsStartPage!="") - window.location=gsStartPage+"#"+gsRelCurPagePath; -} - -function hide() -{ - if(goFrame!=null) - { - goFrame.location=window.location; - } -} - -function isTopicOnly() -{ - if(gnTopicOnly==-1) - { - var oParam=new Object(); - oParam.oFrame=null; - var oMsg=new whMessage(WH_MSG_GETSTARTFRAME,this,1,oParam); - if(SendMessage(oMsg)) - { - goFrame=oParam.oFrame; - gnTopicOnly=0; - } - else - gnTopicOnly=1; - } - if(gnTopicOnly==1) - return true; - else - return false; -} - -function websearch() -{ - if(gbNav4) - { - if(document.ehelpform) - document.ehelpform.submit(); - } - else - { - if(window.ehelpform) - window.ehelpform.submit(); - } -} - -function addSearchFormHref(sHref) -{ - gsSearchFormHref=sHref; - enableWebSearch(true); -} - -function searchB(nForm) -{ - var sValue=eval("document.searchForm"+nForm+".searchString.value"); - var oMsg=new whMessage(WH_MSG_SEARCHTHIS,this,1,sValue); - SendMessage(oMsg); -} - -function getSearchFormHTML() -{ - var sHTML=""; - gnForm++; - var sFormName="searchForm"+gnForm; - var sButton="" - sButton+=""; - if(""=="text") - { - sButton+=""; - } - else if(""=="image") - { - sButton+="" - sButton+=""; - } - sButton+=""; - sHTML="

"+sButton+""+sButton+"
"; + for(var i=0;i0) + { + var sHTML=""; + if(nAligns!=0) + { + sHTML+="
" + if(nAligns&1) + sHTML+=""; + if(nAligns&2) + sHTML+=""; + if(nAligns&4) + sHTML+=""; + sHTML+="
"+getIntopicBar("left")+""+getIntopicBar("center")+""+getIntopicBar("right")+"
"; + document.write(sHTML); + } + } +} + +function sendAveInfoOut() +{ + if(!isInPopup()) + setTimeout("sendAveInfo();",100); +} + +function sendAveInfo() +{ + var oMsg=new whMessage(WH_MSG_AVENUEINFO,this,1,gaAvenues); + SendMessage(oMsg); +} + + +function onNext() +{ + var oMsg=new whMessage(WH_MSG_NEXT,this,1,null); + SendMessage(oMsg); +} + +function onPrev() +{ + var oMsg=new whMessage(WH_MSG_PREV,this,1,null); + SendMessage(oMsg); +} + +function createSyncInfo() +{ + var oParam=new Object(); + if(gsPPath.length==0) + gsPPath=_getPath(document.location.href); + oParam.sPPath=gsPPath; + oParam.sTPath=document.location.href; + oParam.aPaths=gaPaths; + return oParam; +} + +function syncWithShow() +{ + if(isTopicOnly()) + show(); + else + { + sync(); + showTocPane(); + } +} + +function showTocPane() +{ + var oMsg=new whMessage(WH_MSG_SHOWTOC,this,1,null); + SendMessage(oMsg); +} + +function sendSyncInfo() +{ + if(!isInPopup()) + { + var oParam=null; + if(gaPaths.length>0) + { + oParam=createSyncInfo(); + } + var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,oParam); + SendMessage(oMsg); + } +} + +function sendInvalidSyncInfo() +{ + if(!isInPopup()) + { + var oMsg=new whMessage(WH_MSG_SYNCINFO,this,1,null); + SendMessage(oMsg); + } +} + +function enableWebSearch(bEnable) +{ + if(!isInPopup()) + { + var oMsg=new whMessage(WH_MSG_ENABLEWEBSEARCH,this,1,bEnable); + SendMessage(oMsg); + } +} + +function autoSync(nSync) +{ + if(nSync==0) return; + if(isInPopup()) return; + if(isOutMostTopic()) + sync(); +} + +function isOutMostTopic() +{ + if(gnOutmostTopic==-1) + { + var oMessage=new whMessage(WH_MSG_ISINFRAMESET,this,1,null); + if(SendMessage(oMessage)) + gnOutmostTopic=0; + else + gnOutmostTopic=1; + } + return (gnOutmostTopic==1); +} + +function sync() +{ + if(gaPaths.length>0) + { + var oParam=createSyncInfo(); + var oMessage=new whMessage(WH_MSG_SYNCTOC,this,1,oParam); + SendMessage(oMessage); + } +} + + +function avenueInfo(sName,sPrev,sNext) +{ + this.sName=sName; + this.sPrev=sPrev; + this.sNext=sNext; +} + +function getCurrentAvenue() +{ + var oParam=new Object(); + oParam.sAvenue=null; + var oMessage=new whMessage(WH_MSG_GETCURRENTAVENUE,this,1,oParam); + SendMessage(oMessage); + return oParam.sAvenue; +} + +function unRegisterListener() +{ + sendInvalidSyncInfo(); + enableWebSearch(false); + if(whtopic_foldUnload) + whtopic_foldUnload(); +} + +function onSendMessage(oMsg) +{ + var nMsgId=oMsg.nMessageId; + if(nMsgId==WH_MSG_GETAVIAVENUES) + { + oMsg.oParam.aAvenues=gaAvenues; + return false; + } + else if(nMsgId==WH_MSG_GETTOCPATHS) + { + if(isOutMostTopic()) + { + oMsg.oParam.oTocInfo=createSyncInfo(); + return false; + } + else + return true; + } + else if(nMsgId==WH_MSG_NEXT) + { + goAvenue(true); + } + else if(nMsgId==WH_MSG_PREV) + { + goAvenue(false); + } + else if(nMsgId==WH_MSG_WEBSEARCH) + { + websearch(); + } + return true; +} + +function goAvenue(bNext) +{ + var sTopic=null; + var sAvenue=getCurrentAvenue(); + var nAvenue=-1; + if(sAvenue!=null&&sAvenue!="") + { + for(var i=0;i0&&bNext) + { + sTopic=gaAvenues[i].sNext; + break; + } + else if(gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext) + { + sTopic=gaAvenues[i].sPrev; + break; + } + } + } + + if(sTopic!=null&&sTopic!="") + { + if(gsPPath!=null&&gsPPath!="") + { + sFullTopicPath=_getFullPath(gsPPath,sTopic); + document.location=sFullTopicPath; + } + } +} + +function canGo(bNext) +{ + for(var i=0;i0&&bNext)|| + (gaAvenues[i].sPrev!=null&&gaAvenues[i].sPrev.length>0&&!bNext)) + return true; + } + return false; +} + +function show() +{ + if(gsStartPage!="") + window.location=gsStartPage+"#"+gsRelCurPagePath; +} + +function hide() +{ + if(goFrame!=null) + { + goFrame.location=window.location; + } +} + +function isTopicOnly() +{ + if(gnTopicOnly==-1) + { + var oParam=new Object(); + oParam.oFrame=null; + var oMsg=new whMessage(WH_MSG_GETSTARTFRAME,this,1,oParam); + if(SendMessage(oMsg)) + { + goFrame=oParam.oFrame; + gnTopicOnly=0; + } + else + gnTopicOnly=1; + } + if(gnTopicOnly==1) + return true; + else + return false; +} + +function websearch() +{ + if(gbNav4) + { + if(document.ehelpform) + document.ehelpform.submit(); + } + else + { + if(window.ehelpform) + window.ehelpform.submit(); + } +} + +function addSearchFormHref(sHref) +{ + gsSearchFormHref=sHref; + enableWebSearch(true); +} + +function searchB(nForm) +{ + var sValue=eval("document.searchForm"+nForm+".searchString.value"); + var oMsg=new whMessage(WH_MSG_SEARCHTHIS,this,1,sValue); + SendMessage(oMsg); +} + +function getSearchFormHTML() +{ + var sHTML=""; + gnForm++; + var sFormName="searchForm"+gnForm; + var sButton="

" + sButton+=""; + if(""=="text") + { + sButton+=""; + } + else if(""=="image") + { + sButton+="" + sButton+=""; + } + sButton+="
"; + sHTML="
"+sButton+"

 See - Also a sample TUI Script of an Extrusion - operation.