From 83b0c984cc12946923dc2640d68ba3a2700faa28 Mon Sep 17 00:00:00 2001 From: eap Date: Wed, 24 Aug 2016 17:04:22 +0300 Subject: [PATCH] 53539: 0D Element 1) Extract SMESHUtils/SMESH_ControlPnt.* from Hexotic 2) Minor doc changes 3) fix 53539: 0D Element (SMDS_MeshCell.hxx, SMESHGUI_AddMeshElementDlg.cxx) 4) Regressions - bugs_06/G9 ( SMESH_DumpPython.cxx, SMESH_PythonDump.hxx ) - bugs_13/N8 ( StdMeshers_Regular_1D.cxx ) --- doc/salome/examples/modifying_meshes_ex01.py | 6 - doc/salome/examples/modifying_meshes_ex02.py | 6 - doc/salome/examples/modifying_meshes_ex03.py | 3 +- doc/salome/examples/modifying_meshes_ex09.py | 4 - doc/salome/examples/modifying_meshes_ex10.py | 36 +- doc/salome/examples/modifying_meshes_ex15.py | 7 +- doc/salome/gui/SMESH/input/display_mode.doc | 5 +- .../input/importing_exporting_meshes.doc | 15 +- .../gui/SMESH/input/mesh_preferences.doc | 52 ++- .../gui/SMESH/input/tui_modifying_meshes.doc | 4 - .../SMESH/input/viewing_meshes_overview.doc | 8 +- src/DriverGMF/DriverGMF_Write.cxx | 29 +- src/DriverGMF/DriverGMF_Write.hxx | 23 +- src/SMDS/SMDS_MeshCell.hxx | 4 +- src/SMESHGUI/SMESHGUI_AddMeshElementDlg.cxx | 2 +- src/SMESHUtils/CMakeLists.txt | 2 + src/SMESHUtils/SMESH_ControlPnt.cxx | 414 ++++++++++++++++++ src/SMESHUtils/SMESH_ControlPnt.hxx | 76 ++++ src/SMESH_I/SMESH_DumpPython.cxx | 10 +- src/SMESH_I/SMESH_PythonDump.hxx | 1 + src/SMESH_SWIG/smeshBuilder.py | 2 +- src/StdMeshers/StdMeshers_MEFISTO_2D.cxx | 8 - .../StdMeshers_RadialQuadrangle_1D2D.cxx | 18 + src/StdMeshers/StdMeshers_Regular_1D.cxx | 6 +- 24 files changed, 598 insertions(+), 143 deletions(-) create mode 100644 src/SMESHUtils/SMESH_ControlPnt.cxx create mode 100644 src/SMESHUtils/SMESH_ControlPnt.hxx diff --git a/doc/salome/examples/modifying_meshes_ex01.py b/doc/salome/examples/modifying_meshes_ex01.py index 434cc1a7e..0ef07aa7a 100644 --- a/doc/salome/examples/modifying_meshes_ex01.py +++ b/doc/salome/examples/modifying_meshes_ex01.py @@ -1,16 +1,10 @@ # Add Node - import salome salome.salome_init() -import GEOM -from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) -import SMESH, SALOMEDS from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) -import salome_notebook mesh = smesh.Mesh() diff --git a/doc/salome/examples/modifying_meshes_ex02.py b/doc/salome/examples/modifying_meshes_ex02.py index 563295c54..7948ed3dc 100644 --- a/doc/salome/examples/modifying_meshes_ex02.py +++ b/doc/salome/examples/modifying_meshes_ex02.py @@ -1,16 +1,10 @@ # Add 0D Element - import salome salome.salome_init() -import GEOM -from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) -import SMESH, SALOMEDS from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) -import salome_notebook mesh = smesh.Mesh() diff --git a/doc/salome/examples/modifying_meshes_ex03.py b/doc/salome/examples/modifying_meshes_ex03.py index beefe20ce..0c6bc61dd 100644 --- a/doc/salome/examples/modifying_meshes_ex03.py +++ b/doc/salome/examples/modifying_meshes_ex03.py @@ -3,14 +3,13 @@ import salome salome.salome_init() -import GEOM + from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) import SMESH, SALOMEDS from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) -import salome_notebook # create a geometry diff --git a/doc/salome/examples/modifying_meshes_ex09.py b/doc/salome/examples/modifying_meshes_ex09.py index 476ebbbdc..cba753e51 100644 --- a/doc/salome/examples/modifying_meshes_ex09.py +++ b/doc/salome/examples/modifying_meshes_ex09.py @@ -4,14 +4,10 @@ import math import salome salome.salome_init() -import GEOM -from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) import SMESH, SALOMEDS from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) -import salome_notebook # create an empty mesh structure diff --git a/doc/salome/examples/modifying_meshes_ex10.py b/doc/salome/examples/modifying_meshes_ex10.py index 894fe9d4c..26607e740 100644 --- a/doc/salome/examples/modifying_meshes_ex10.py +++ b/doc/salome/examples/modifying_meshes_ex10.py @@ -3,14 +3,9 @@ import salome salome.salome_init() -import GEOM -from salome.geom import geomBuilder -geompy = geomBuilder.New(salome.myStudy) -import SMESH, SALOMEDS from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) -import salome_notebook import math @@ -50,18 +45,19 @@ for i in range(5): pass # Create a polyhedral volume (12-hedron with pentagonal faces) -mesh.GetMeshEditor().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) +mesh.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]) + +if salome.sg.hasDesktop(): + salome.sg.updateObjBrowser(1) diff --git a/doc/salome/examples/modifying_meshes_ex15.py b/doc/salome/examples/modifying_meshes_ex15.py index ae6d5eae7..5985c0844 100644 --- a/doc/salome/examples/modifying_meshes_ex15.py +++ b/doc/salome/examples/modifying_meshes_ex15.py @@ -3,14 +3,13 @@ import salome salome.salome_init() -import GEOM + from salome.geom import geomBuilder geompy = geomBuilder.New(salome.myStudy) import SMESH, SALOMEDS from salome.smesh import smeshBuilder smesh = smeshBuilder.New(salome.myStudy) -import salome_notebook box = geompy.MakeBoxDXDYDZ(200, 200, 200) @@ -20,7 +19,7 @@ mesh.Segment().AutomaticLength(0.1) mesh.Quadrangle() mesh.Compute() -# find node at (0,0,0) +# find node at (0,0,0) which is located on a geom vertex node000 = None for vId in geompy.SubShapeAllIDs( box, geompy.ShapeType["VERTEX"]): if node000: break @@ -36,7 +35,7 @@ for vId in geompy.SubShapeAllIDs( box, geompy.ShapeType["VERTEX"]): if not node000: raise "node000 not found" -# find node000 using the tested function +# find node000 using a dedicated function n = mesh.FindNodeClosestTo( -1,-1,-1 ) if not n == node000: raise "FindNodeClosestTo() returns " + str( n ) + " != " + str( node000 ) diff --git a/doc/salome/gui/SMESH/input/display_mode.doc b/doc/salome/gui/SMESH/input/display_mode.doc index 6817d29f9..7e748d603 100644 --- a/doc/salome/gui/SMESH/input/display_mode.doc +++ b/doc/salome/gui/SMESH/input/display_mode.doc @@ -2,7 +2,8 @@ \page display_mode_page Display Mode -\n By default your objects are represented as set in \b Preferences. +\n By default your objects are represented as set in +\ref mesh_preferences_page "Preferences". \n However, right-clicking on the mesh in the Object Browser, and selecting Display Mode, you can display your mesh as: @@ -19,4 +20,4 @@ and selecting Display Mode, you can display your mesh as: \image html image55.gif Shrink -*/ \ No newline at end of file +*/ diff --git a/doc/salome/gui/SMESH/input/importing_exporting_meshes.doc b/doc/salome/gui/SMESH/input/importing_exporting_meshes.doc index 0cfb6d058..a4a8d3ca2 100644 --- a/doc/salome/gui/SMESH/input/importing_exporting_meshes.doc +++ b/doc/salome/gui/SMESH/input/importing_exporting_meshes.doc @@ -41,17 +41,20 @@ group as a whole mesh. If you try to export a group, the warning will be shown: \image html meshexportgroupwarning.png There are additional parameters available at export to MED and SAUV format files.