diff --git a/adm_local/unix/config_files/check_qwt.m4 b/adm_local/unix/config_files/check_qwt.m4
index 7fde4754c..736c5b5c8 100644
--- a/adm_local/unix/config_files/check_qwt.m4
+++ b/adm_local/unix/config_files/check_qwt.m4
@@ -44,15 +44,25 @@ AC_ARG_WITH(qwt_inc,
AC_MSG_RESULT("select $withval as path to QWT includes")
])
+libqwt_name=qwt
if test -z $QWTHOME; then
AC_MSG_RESULT(QWTHOME not defined)
+ AC_MSG_NOTICE(Trying native Qwt...)
exist_ok=no
if test "x$exist_ok" = "xno"; then
- for d in /usr/local /usr ; do
- AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/libqwt.so,exist_ok=yes,exist_ok=no)
+ for d in /usr /usr/local ; do
+ for extension in qwt-qt4 qwt; do
+ AC_CHECK_FILE(${d}/lib${LIB_LOCATION_SUFFIX}/lib${extension}.so,exist_ok=yes,exist_ok=no)
+ if test "x$exist_ok" = "xyes"; then
+ QWTHOME=$d
+ AC_MSG_RESULT(lib${extension}.so detected in $d/lib)
+ libqwt_name=${extension}
+ dnl break, libqwt-qt4.so is choosen before libqwt.so since it is surely the Qt4 version.
+ break
+ fi
+ done
if test "x$exist_ok" = "xyes"; then
- QWTHOME=$d
- AC_MSG_RESULT(libqwt.so detected in $d/lib)
+ break
fi
done
fi
@@ -69,7 +79,10 @@ if test -z $QWTHOME; then
fi
if test "x$exist_ok" = "xyes"; then
if test -z $QWT_INCDIR; then
- QWT_INCDIR=$QWTHOME"/include/qwt"
+ QWT_INCDIR=$QWTHOME"/include/qwt-qt4"
+ if test ! -f $QWT_INCDIR/qwt.h ; then
+ QWT_INCDIR=/usr/include/qwt
+ fi
if test ! -f $QWT_INCDIR/qwt.h ; then
QWT_INCDIR=$QWTHOME"/include"
fi
@@ -84,6 +97,7 @@ if test -z $QWTHOME; then
qwt_ok=no
fi
else
+ AC_MSG_NOTICE(Trying Qwt from $QWTHOME ...)
if test -z $QWT_INCDIR; then
QWT_INCDIR="$QWTHOME/include"
fi
@@ -119,9 +133,9 @@ else
LIBS_old=$LIBS
LIBS="$LIBS $QT_LIBS"
if test "x$QWTHOME" = "x/usr" ; then
- LIBS="$LIBS -lqwt"
+ LIBS="$LIBS -l${libqwt_name}"
else
- LIBS="$LIBS -L$QWTHOME/lib -lqwt"
+ LIBS="$LIBS -L$QWTHOME/lib -l${libqwt_name}"
fi
CXXFLAGS_old=$CXXFLAGS
@@ -148,9 +162,9 @@ else
else
AC_MSG_RESULT(yes)
if test "x$QWTHOME" = "x/usr" ; then
- QWT_LIBS=" -lqwt"
+ QWT_LIBS=" -l${libqwt_name}"
else
- QWT_LIBS="-L$QWTHOME/lib -lqwt"
+ QWT_LIBS="-L$QWTHOME/lib -l${libqwt_name}"
fi
fi
diff --git a/bin/smesh_setenv.py b/bin/smesh_setenv.py
index b3240bfa2..a25e5180b 100644
--- a/bin/smesh_setenv.py
+++ b/bin/smesh_setenv.py
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: iso-8859-1 -*-
# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
#
# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
diff --git a/configure.ac b/configure.ac
index 59e035781..7f5e389b6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,7 @@
# Modified by : Alexander BORODIN (OCN) - autotools usage
# Created from configure.in.base
#
-AC_INIT([Salome2 Project SMESH module], [5.1.2], [webmaster.salome@opencascade.com], [SalomeSMESH])
+AC_INIT([Salome2 Project SMESH module], [5.1.3], [webmaster.salome@opencascade.com], [SalomeSMESH])
AC_CONFIG_AUX_DIR(adm_local/unix/config_files)
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
@@ -87,7 +87,7 @@ dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + pour les librairie
echo
echo ---------------------------------------------
-echo Coniguring production
+echo Configuring production
echo ---------------------------------------------
echo
AC_ENABLE_DEBUG(yes)
diff --git a/doc/salome/gui/SMESH/images/2d_from_3d_menu.png b/doc/salome/gui/SMESH/images/2d_from_3d_menu.png
new file mode 100644
index 000000000..ec5117214
Binary files /dev/null and b/doc/salome/gui/SMESH/images/2d_from_3d_menu.png differ
diff --git a/doc/salome/gui/SMESH/images/blsurf_parameters.png b/doc/salome/gui/SMESH/images/blsurf_parameters.png
index cfafbc481..7988a9c85 100644
Binary files a/doc/salome/gui/SMESH/images/blsurf_parameters.png and b/doc/salome/gui/SMESH/images/blsurf_parameters.png differ
diff --git a/doc/salome/gui/SMESH/images/blsurf_parameters_advanced.png b/doc/salome/gui/SMESH/images/blsurf_parameters_advanced.png
index d29ecc497..d317ced16 100644
Binary files a/doc/salome/gui/SMESH/images/blsurf_parameters_advanced.png and b/doc/salome/gui/SMESH/images/blsurf_parameters_advanced.png differ
diff --git a/doc/salome/gui/SMESH/images/blsurf_parameters_enforced_vertices.png b/doc/salome/gui/SMESH/images/blsurf_parameters_enforced_vertices.png
new file mode 100644
index 000000000..e55dec36b
Binary files /dev/null and b/doc/salome/gui/SMESH/images/blsurf_parameters_enforced_vertices.png differ
diff --git a/doc/salome/gui/SMESH/images/blsurf_parameters_sizemap.png b/doc/salome/gui/SMESH/images/blsurf_parameters_sizemap.png
index 0d87e6608..2b3819759 100644
Binary files a/doc/salome/gui/SMESH/images/blsurf_parameters_sizemap.png and b/doc/salome/gui/SMESH/images/blsurf_parameters_sizemap.png differ
diff --git a/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices.png b/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices.png
new file mode 100644
index 000000000..c47174396
Binary files /dev/null and b/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices.png differ
diff --git a/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices_screenshot.png b/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices_screenshot.png
new file mode 100644
index 000000000..fc885700f
Binary files /dev/null and b/doc/salome/gui/SMESH/images/ghs3d_enforced_vertices_screenshot.png differ
diff --git a/doc/salome/gui/SMESH/images/ghs3d_parameters_advanced.png b/doc/salome/gui/SMESH/images/ghs3d_parameters_advanced.png
index 4f36203ba..1d6b7c7a2 100644
Binary files a/doc/salome/gui/SMESH/images/ghs3d_parameters_advanced.png and b/doc/salome/gui/SMESH/images/ghs3d_parameters_advanced.png differ
diff --git a/doc/salome/gui/SMESH/images/ghs3d_parameters_basic.png b/doc/salome/gui/SMESH/images/ghs3d_parameters_basic.png
index 0cce50bb8..cd92b45fc 100644
Binary files a/doc/salome/gui/SMESH/images/ghs3d_parameters_basic.png and b/doc/salome/gui/SMESH/images/ghs3d_parameters_basic.png differ
diff --git a/doc/salome/gui/SMESH/images/hypo_quad_params_2.png b/doc/salome/gui/SMESH/images/hypo_quad_params_2.png
new file mode 100644
index 000000000..9f6fa251e
Binary files /dev/null and b/doc/salome/gui/SMESH/images/hypo_quad_params_2.png differ
diff --git a/doc/salome/gui/SMESH/images/hypo_quad_params_res_2.png b/doc/salome/gui/SMESH/images/hypo_quad_params_res_2.png
new file mode 100644
index 000000000..6dc37e298
Binary files /dev/null and b/doc/salome/gui/SMESH/images/hypo_quad_params_res_2.png differ
diff --git a/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc b/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc
index c61d388a5..aba2b6598 100644
--- a/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc
+++ b/doc/salome/gui/SMESH/input/1d_meshing_hypo.doc
@@ -199,31 +199,27 @@ minimum and maximum value of this parameter.
\anchor fixed_points_1d_anchor
Fixed points 1D hypothesis
-Fixed points 1D hypothesis allows to split edges into segments
-using set of fixed points given by normalized parameters on edge and
-set of numbers of segments for splitting each sub-segment between
-fixed points. Optionally it is possible to set flag
-Same Nb. Segments for all intervals and
-only one value for mentioned number of segments.
+Fixed points 1D hypothesis allows splitting edges through a
+set of points parameterized on the edge (from 1 to 0) and a number of segments for each
+interval limited by the points.
-The direction of the splitting is defined by the orientation of the
+\image html hypo_fixedpnt_dlg.png
+
+It is possible to check in Same Nb. Segments for all intervals
+option and to define one value for all intervals.
+
+The splitting direction is defined by the orientation of the
underlying geometrical edge. "Reverse Edges" list box allows to
specify the edges for which the splitting should be made in the
-direction opposing to their orientation. This list box is enabled only
-if the geometry object is selected for the meshing. In this case the
-user can select edges to be reversed either directly picking them in
-the 3D viewer or by selecting the edges or groups of edges in the
+direction opposite to their orientation. This list box is enabled only
+if the geometrical object is selected for meshing. In this case it is
+possible to select the edges to be reversed either directly picking them in
+the 3D viewer or selecting the edges or groups of edges in the
Object browser.
-Using of this hypothesis for quadrangle face where main mesh is
-created using Quadrangle(Mapping) and NumberOfSegments
-hypothesises. Creation hypothesis FixedPoint_1D for submesh on
-one edge:
+\image html mesh_fixedpnt.png "Example of a submesh on the edge built using Fixed points 1D hypothesis"
-\image html hypo_fixedpnt_dlg.png
-
-Resulting 2D mesh:
-
-\image html mesh_fixedpnt.png
+See Also a sample TUI Script of a
+\ref tui_fixed_points "Defining Fixed Points" hypothesis operation.
*/
diff --git a/doc/salome/gui/SMESH/input/2d_meshing_hypo.doc b/doc/salome/gui/SMESH/input/2d_meshing_hypo.doc
index c912c568f..dd42e9962 100644
--- a/doc/salome/gui/SMESH/input/2d_meshing_hypo.doc
+++ b/doc/salome/gui/SMESH/input/2d_meshing_hypo.doc
@@ -23,6 +23,8 @@ which will compose the mesh of these 2D faces.
\image html a-maxelarea.png
+\n
+
\image html max_el_area.png "In this example, Max. element area is very small compared to the 1D hypothesis"
See Also a sample TUI Script of a
@@ -52,6 +54,18 @@ used as a degenerated edge.
\image html hypo_quad_params_res.png "The resulting mesh"
+This hypothesis can be also used to mesh a segment of a circular face.
+Please, consider that there is a limitation on the selectiion of the degenerated
+vertex for the faces built with the angle > 180 degrees (see the picture).
+
+\image html hypo_quad_params_2.png "3/4 of a circular face"
+
+In this case, selection of a wrong vertex for the Quadrangle parameters
+hypothesis will generate a wrong mesh. The picture below
+shows the good (left) and the bad (right) results of meshing.
+
+\image html hypo_quad_params_res_2.png "The resulting meshes"
+
\anchor quadrangle_preference_anchor
Quadrangle Preference
diff --git a/doc/salome/gui/SMESH/input/about_hypo.doc b/doc/salome/gui/SMESH/input/about_hypo.doc
index 578823bd6..cc8f5fd52 100644
--- a/doc/salome/gui/SMESH/input/about_hypo.doc
+++ b/doc/salome/gui/SMESH/input/about_hypo.doc
@@ -28,6 +28,7 @@ them, you operate numerical values):
- \ref max_element_area_anchor "Max Element Area"
- \ref length_from_edges_anchor "Length from Edges"
+- \ref hypo_quad_params_anchor "Quadrangle Parameters"
- \ref quadrangle_preference_anchor "Quadrangle Preference"
- \ref triangle_preference_anchor "Triangle Preference"
diff --git a/doc/salome/gui/SMESH/input/about_meshes.doc b/doc/salome/gui/SMESH/input/about_meshes.doc
index 84e84cdcf..8a81c7ea0 100644
--- a/doc/salome/gui/SMESH/input/about_meshes.doc
+++ b/doc/salome/gui/SMESH/input/about_meshes.doc
@@ -26,6 +26,7 @@ entities including:
- \b Node — 0D object of a mesh presented by a point with coordinates (x, y, z).
+- \b 0D element — element of a mesh defined by one node.
- \b Edge — 1D element of a mesh defined by two nodes.
- \b Face — 2D element of a mesh defined by three or four edges (closed contour).
- \b Volume — 3D element of a mesh defined by several faces.
diff --git a/doc/salome/gui/SMESH/input/basic_meshing_algos.doc b/doc/salome/gui/SMESH/input/basic_meshing_algos.doc
index 7549a121e..a83a64f9f 100644
--- a/doc/salome/gui/SMESH/input/basic_meshing_algos.doc
+++ b/doc/salome/gui/SMESH/input/basic_meshing_algos.doc
@@ -47,7 +47,7 @@ tetrahedral (pyramidal) elements.
\image html image126.gif "Example of a hexahedral 3D mesh"
-\Note that BLSURF and GHS3D are commercial meshers and require a
+\note BLSURF and GHS3D are commercial meshers and require a
license to be used within the Mesh module.
There is also a number of more specific algorithms:
@@ -56,8 +56,7 @@ There is also a number of more specific algorithms:
\subpage radial_prism_algo_page "for meshing geometrical objects with cavities"
\subpage segments_around_vertex_algo_page "for defining the local size of elements around a certain node"
\subpage prism_3d_algo_page "for meshing prismatic shapes"
-\subpage radial_quadrangle_1D2D_algo_page "for meshing special 2d
-faces (circles and part of circles)"
+\subpage radial_quadrangle_1D2D_algo_page "for meshing special 2d faces (circles and part of circles)"
\ref constructing_meshes_page "Constructing meshes" page describes in
diff --git a/doc/salome/gui/SMESH/input/blsurf_hypo.doc b/doc/salome/gui/SMESH/input/blsurf_hypo.doc
index ecbd5a74f..03c0fc594 100644
--- a/doc/salome/gui/SMESH/input/blsurf_hypo.doc
+++ b/doc/salome/gui/SMESH/input/blsurf_hypo.doc
@@ -5,6 +5,8 @@
\n BLSURF Parameters hypothesis works only with BLSURF 2d
algorithm. This algorithm is a commercial software.
+General parameters
+
\image html blsurf_parameters.png
@@ -53,6 +55,8 @@ two adjacent edges.
edges are not respected and all geometrical faces are meshed as one
hyper-face.
+Advanced parameters
+
\image html blsurf_parameters_advanced.png
- Topology - allows creation of a conform mesh on a shell of
@@ -83,12 +87,12 @@ the diagonal of the bounding box of the geometrical object to mesh.
- topo_eps1 (real) - is the tolerance level inside a CAD
-patch. By default is equal to diag × 10-4. This tolerance is used to
+patch. By default is equal to diag � 10-4. This tolerance is used to
identify nodes to merge within one geometrical face when \b Topology
option is to pre-process. Default is diag/10.0.
- topo_eps2 (real) - is the tolerance level between two CAD
-patches. By default is equal to diag × 10-4. This tolerance is used to
+patches. By default is equal to diag � 10-4. This tolerance is used to
identify nodes to merge over different geometrical faces when
\b Topology option is to pre-process. Default is diag/10.0.
@@ -199,24 +203,37 @@ String variables:
- import_option
+Custom size map
+
\image html blsurf_parameters_sizemap.png
-It is possible to define user sizes on faces, edges or verteces.
+User sizes can be defined on faces, edges or vertices.
-- Those faces, edges and verteces must be sub-shapes (from explode command) of the meshed geometry object.
-- Groups are currently not handled.
-- Multi-selection is possible.
-- The sizes are constant values.
+- The faces, edges and vertices can belong to the meshed geometrical
+object or to its sub-shapes (created using Explode command).
+- Groups of faces, edges and vertices are also handled.
+- It is possible to attribute the same size to several geometries using multi-selection.
+- The sizes are constant values or python functions.
+- In case of a python function, the following rules must be respected:
+
+- The name of the function is f.
+- If geometry is a face or a group of faces, the function is f(u,v).
+- If geometry is an edge or a group of edges, the function is f(t).
+- If geometry is a vertex or a group of vertices, the function is f().
+- The function must return a double.
+
See Also a sample TUI Script of the \ref tui_blsurf "creation of a BLSurf hypothesis", including size map.
\anchor blsurf_sizemap_computation
Computation of the physical size
-Here is the detail on the calculation of the size (from BLSurf documentation).
\n
-The size is obtained by querying sizemap functions associated to the input CAD object for surfaces, curves and points.
-Each function can either return a value h (which is then trimmed between the two bounds hphymin and hphymax), or "no answer" (by not assigning a value to h), thus providing great flexibility in the specification of the sizes. The computation depends whether point P is internal to a surface, internal to a curve, or at the end of several curves:
+The physical size is obtained by querying sizemap functions associated to the input CAD object for surfaces, curves and points.
+Each function can either return a value h (which is then trimmed
+between the two bounds hphymin and hphymax), or "no answer" (by not
+assigning a value to h), thus providing great flexibility in the
+specification of the sizes. The computation depends on whether point P is internal to a surface, internal to a curve, or at the end of several curves:
- If point P is internal to a surface, the CAD surface size function is queried. If no answer is returned, one interpolates with the values at the vertices of the discretized interface curves.
- If point P is internal to a curve, the CAD curve size function is queried first. If no answer is returned, the surface size function is queried for every adjacent surface and the mean value of the returned values is computed. If no answer is returned, sizes h1 and h2 at both ends of the curve are considered (see next item) and the interpolated value is computed.
@@ -225,7 +242,23 @@ Each function can either return a value h (which is then trimmed between the two
In order to compute the mean of several values, the arithmetic mean is used by default, but this can be modified by the parameter \ref blsurf_hmean_flag "hmean flag". In the same way, in order to interpolate two values, a linear interpolation is used by default, but this can be modified by \ref blsurf_hinterpol_flag "hinterpol flag".
-\n
+Custom enforced vertices
+
+\image html blsurf_parameters_enforced_vertices.png
+
+It is possible to define some enforced vertices to BLSurf algorithm
+without creating any vertices by CAD algorithms.
+
+- The enforced vertex is the projection of a point defined by its
+(x,y,z) coordinates on the selected face.
+- It is possible to define several enforced vertices on a face or a group of faces.
+- If the projected point is on the boundary or outside of the face, it will be ignored.
+
+
+
See Also a sample TUI Script of the \ref tui_blsurf "creation of a BLSurf hypothesis", including enforced vertices.
+
+Limitations
+
Currently BLSURF plugin has the following limitations.
- The created mesh will contain inverted elements if it is based on a shape,
diff --git a/doc/salome/gui/SMESH/input/building_compounds.doc b/doc/salome/gui/SMESH/input/building_compounds.doc
index faf636b82..98a20c470 100644
--- a/doc/salome/gui/SMESH/input/building_compounds.doc
+++ b/doc/salome/gui/SMESH/input/building_compounds.doc
@@ -47,4 +47,6 @@ for this operation.
\image html image160.gif "Example of a compound of two meshed cubes"
+See Also a sample
+\ref tui_building_compound "TUI Example of building compounds."
*/
diff --git a/doc/salome/gui/SMESH/input/constructing_meshes.doc b/doc/salome/gui/SMESH/input/constructing_meshes.doc
index be7def6a8..625cff3bd 100644
--- a/doc/salome/gui/SMESH/input/constructing_meshes.doc
+++ b/doc/salome/gui/SMESH/input/constructing_meshes.doc
@@ -126,7 +126,7 @@ visualizing the geometrical entity that causes it.
\image html failed_computation.png "Example of the invalid input mesh"
-\Note Mesh Computation Information box does not appear if you set
+\note Mesh Computation Information box does not appear if you set
"Mesh computation/Show a computation result notification" preference
to the "Never" value. This option gives the possibility to control mesh
computation reporting. There are the following possibilities: always
diff --git a/doc/salome/gui/SMESH/input/convert_to_from_quadratic_mesh.doc b/doc/salome/gui/SMESH/input/convert_to_from_quadratic_mesh.doc
index 072a91f7a..5409f487e 100644
--- a/doc/salome/gui/SMESH/input/convert_to_from_quadratic_mesh.doc
+++ b/doc/salome/gui/SMESH/input/convert_to_from_quadratic_mesh.doc
@@ -37,4 +37,6 @@ The following dialog box will appear:
- Click the \b Apply or \b OK button.
-*/
\ No newline at end of file
+
See Also a sample TUI Script of a \ref tui_quadratic "Convert to/from quadratic" operation.
+
+*/
diff --git a/doc/salome/gui/SMESH/input/editing_groups.doc b/doc/salome/gui/SMESH/input/editing_groups.doc
index b5031468a..6cbe5ceb4 100644
--- a/doc/salome/gui/SMESH/input/editing_groups.doc
+++ b/doc/salome/gui/SMESH/input/editing_groups.doc
@@ -2,7 +2,7 @@
\page editing_groups_page Editing groups
-\n To edit an existing group of elements:
+To edit an existing group of elements:
- Select your group in the Object Browser and in the \b Mesh menu click
the Edit Group item or "Edit Group" button in the toolbar.
@@ -17,11 +17,12 @@ 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
\ref creating_groups_page "Creating Groups" page.
+
- Click the \b Apply or Apply and Close button to confirm modification of the
group.
-\n To convert an existing group on geometry into standalone group
+To convert an existing group on geometry into standalone group
of elements and modify:
- Select your group on geometry in the Object Browser and in the \b Mesh menu click
@@ -31,11 +32,12 @@ the Edit Group as Standalone item.
"Edit Group as Standalone" button
The group on geometry will be converted into standalone group and can
-be modified as group of elements
+be modified as group of elements.
+
- Click the \b Apply or Apply and Close button to confirm modification of the
group.
+
-
See Also a sample TUI Script of an
-\ref tui_edit_group "Edit Group" operation.
+\sa A sample TUI Script of an \ref tui_edit_group "Edit Group" operation.
*/
diff --git a/doc/salome/gui/SMESH/input/free_faces.doc b/doc/salome/gui/SMESH/input/free_faces.doc
index 0c852f32c..d35caa9ac 100644
--- a/doc/salome/gui/SMESH/input/free_faces.doc
+++ b/doc/salome/gui/SMESH/input/free_faces.doc
@@ -2,16 +2,17 @@
\page free_faces_page Free faces
-\n This mesh quality control highlights the faces connected to
+This mesh quality control highlights the faces connected to
less than two mesh volume elements. The free faces are shown with a
color different from the color of shared faces.
\image html free_faces.png
-In this picture some volume mesh elements have been removed, as
+
+In this picture some volume mesh elements have been removed, as
a result some faces became connected only to one
volume. i.e. became free.
-
See Also a sample TUI Script of a
-\ref tui_free_faces "Free Faces quality control" operation.
+\sa A sample TUI Script of a \ref tui_free_faces "Free Faces quality control"
+operation.
*/
diff --git a/doc/salome/gui/SMESH/input/free_nodes.doc b/doc/salome/gui/SMESH/input/free_nodes.doc
index 1caaf9e4b..8a06fe3de 100644
--- a/doc/salome/gui/SMESH/input/free_nodes.doc
+++ b/doc/salome/gui/SMESH/input/free_nodes.doc
@@ -2,14 +2,15 @@
\page free_nodes_page Free nodes
-\n This mesh quality control highlights the nodes which are not connected
+This mesh quality control highlights the nodes which are not connected
to any mesh element.
\image html free_nodes.png
-In this picture some nodes are not connected to any mesh
+
+In this picture some nodes are not connected to any mesh
element after deleting some elements and adding several isolated nodes.
-
See Also a sample TUI Script of a
-\ref tui_free_nodes "Free Nodes quality control" operation.
+\sa A sample TUI Script of a \ref tui_free_nodes "Free Nodes quality control"
+operation.
*/
diff --git a/doc/salome/gui/SMESH/input/ghs3d_hypo.doc b/doc/salome/gui/SMESH/input/ghs3d_hypo.doc
index 414e342fa..eb4b981b6 100644
--- a/doc/salome/gui/SMESH/input/ghs3d_hypo.doc
+++ b/doc/salome/gui/SMESH/input/ghs3d_hypo.doc
@@ -5,6 +5,8 @@
\n GHS3D Parameters hypothesis works only with Tetrahedron (GHS3D)
algorithm. This algorithm is a commercial software.
+General parameters
+
\image html ghs3d_parameters_basic.png
@@ -21,6 +23,8 @@ optimization level: none, light, medium or strong. Higher level of
optimisation provides better mesh, but can be time-consuming.
+Advanced parameters
+
\image html ghs3d_parameters_advanced.png
- Maximum memory size - launches ghs3d software with
@@ -52,6 +56,20 @@ together with the characteristics of the final mesh.
- To create new nodes - if this option is checked off, ghs3d
tries to create tetrahedrons using only the nodes of the 2D mesh.
+- To remove the initial central point TetMesh-GHS3D adds an internal point
+at the gravity centre of the bounding box to speed up and to simplify
+the meshing process. However, it is possible to refrain from creating
+this point by using the command line option -no initial central point. This can be
+particularly useful to generate a volume mesh without internal points at all and in some rare cases
+at the boundary regeneration phase when it is impossible to proceed
+with the standard options
+(for example, when one dimension of the domain is more than 20 times greater than the other two).
+Use this option if the boundary regeneration has failed with the standard parameters and before using
+the recovery version (command line option -C).
+Note: when using this option, the speed of the meshing process may
+decrease, and the quality may change.
+Note: the boundary regeneration may fail with this option, in some rare cases.
+
- To use boundary recovery version - enables using a
boundary recovery module which tries to
create volume meshes starting from very poor quality surface meshes
@@ -61,9 +79,38 @@ resulting volume mesh will however most likely have a very poor
quality (poor aspect ratio of elements, tetrahedra with a very small
positive volume).
-- Option as text - allows input of any text as command line
-for ghs3d. This allows the input of advanced options in a free from.
+- To use FEM correction - Applies finite-element correction by
+replacing overconstrained elements where it is possible. At first the process
+slices the overconstrained edges and at second the overconstrained
+facets. This ensures that there are no edges with two boundary
+vertices and that there are no facets with three boundary vertices. TetMesh-GHS3D gives the initial
+and final overconstrained edges and facets. It also gives the facets
+which have three edges on the boundary.
+Note: when using this option, the speed of the meshing process may
+decrease, quality may change, and the smallest volume may be smaller.
+By default, the FEM correction is not used.
+
+- Option as text - allows to input in the command line any text
+for ghs3d, for example, advanced options.
-*/
\ No newline at end of file
+
+Enforced vertices
+
+\image html ghs3d_enforced_vertices.png
+
+GHS3D algorithm can locally make the mesh finer. It is possible to define enforced vertices in the volume where the mesh will be detailed.
+
+A node will be created at the enforced vertex coordinates. There is no need to create a vertex in CAD.
+
+An enforced vertex is defined by:
+
+- The (x,y,z) cartesian coordinates
+- A constant physical size
+
+
+
See Also a sample TUI Script of the \ref tui_ghs3d "creation of a Ghs3D hypothesis", including enforced vertices.
+
+
+*/
diff --git a/doc/salome/gui/SMESH/input/grouping_elements.doc b/doc/salome/gui/SMESH/input/grouping_elements.doc
index f5c7fed67..638d70112 100644
--- a/doc/salome/gui/SMESH/input/grouping_elements.doc
+++ b/doc/salome/gui/SMESH/input/grouping_elements.doc
@@ -12,19 +12,15 @@ dialog.
by creating a group of elements of the selected type from all
such elements of the chosen geometrical object - Group on
geometry tab of \ref creating_groups_page "Create group" dialog.
-
by creating a group including all types of elements from an
existing geometrical object - using \subpage create_groups_from_geometry_page "Create Groups from Geometry" dialog.
-
by creating several groups of elements (nodes,
edges, faces and volumes) from the chosen submesh - using Mesh -> Construct
Group Menu item. In this case groups of elements are created
automatically.
-
by creating groups of entities from existing groups of superior
dimensions - using \subpage group_of_underlying_elements_page "Create Group of Underlying Elements"
dialog.
-
@@ -32,12 +28,12 @@ The created groups can be later:
- \subpage editing_groups_page "Edited"
-- \subpage using_operations_on_groups_page "Subjected to Boolean operations", or
+- \subpage using_operations_on_groups_page "Subjected to Boolean operations"
- \subpage deleting_groups_page "Deleted"
An important tool, providing filters for creation of \b Standalone
-groups is \subpage selection_filter_library_page.
+groups is \subpage selection_filter_library_page.
*/
diff --git a/doc/salome/gui/SMESH/input/make_2dmesh_from_3d.doc b/doc/salome/gui/SMESH/input/make_2dmesh_from_3d.doc
new file mode 100644
index 000000000..f4b5b2ba5
--- /dev/null
+++ b/doc/salome/gui/SMESH/input/make_2dmesh_from_3d.doc
@@ -0,0 +1,22 @@
+/*!
+
+\page make_2dmesh_from_3d_page Generate the skin elements (2D) of a mesh having 3D elements
+
+\n This functionality allows to generate 2D mesh elements as a skin
+on the existing 3D mesh elements.
+
+To generate 2D mesh:
+
+- From the Modification menu choose "Create 2D mesh from 3D"
+item, or choose from the popup menu.
+
+\image html 2d_from_3d_menu.png
+
+The algorithm detects boundary volume faces without connections to
+other volumes and creates 2D mesh elements on face nodes. If the mesh
+already contains 2D elements on the detected nodes, new elements are not
+created. The the resulting dialog shows mesh information statistics
+about the newly created 2D mesh elements.
+
+
+*/
diff --git a/doc/salome/gui/SMESH/input/mesh_infos.doc b/doc/salome/gui/SMESH/input/mesh_infos.doc
index 75b934c2e..7b855c42c 100644
--- a/doc/salome/gui/SMESH/input/mesh_infos.doc
+++ b/doc/salome/gui/SMESH/input/mesh_infos.doc
@@ -44,11 +44,6 @@ The following information will be displayed:
\image html advanced_mesh_infos.png
-In case you get Mesh Infos via a \ref tui_viewing_mesh_infos "TUI script",
-the information is displayed in Python Console.
-
-\image html b-mesh_infos.png
-
\anchor mesh_element_info_anchor
Mesh Element Info
@@ -61,4 +56,7 @@ the Viewer.
\image html eleminfo2.png
+In case you get Mesh Infos via a TUI script the information is displayed in Python Console.
+See the \ref tui_viewing_mesh_infos "TUI Example",
+
*/
\ No newline at end of file
diff --git a/doc/salome/gui/SMESH/input/modifying_meshes.doc b/doc/salome/gui/SMESH/input/modifying_meshes.doc
index f7a882524..cf63ff5f4 100644
--- a/doc/salome/gui/SMESH/input/modifying_meshes.doc
+++ b/doc/salome/gui/SMESH/input/modifying_meshes.doc
@@ -45,9 +45,11 @@ of the selected node or edge.
Apply \subpage pattern_mapping_page "pattern mapping".
\subpage convert_to_from_quadratic_mesh_page "Convert regular mesh to quadratic",
or vice versa.
+\subpage make_2dmesh_from_3d_page "Create 2D mesh from 3D".
+
\note It is possible to use the variables defined in the SALOME \b NoteBook
to specify the numerical parameters used for modification of any object.
-*/
\ No newline at end of file
+*/
diff --git a/doc/salome/gui/SMESH/input/netgen_2d_3d_hypo.doc b/doc/salome/gui/SMESH/input/netgen_2d_3d_hypo.doc
index 0c872d32b..bbb7c59ff 100644
--- a/doc/salome/gui/SMESH/input/netgen_2d_3d_hypo.doc
+++ b/doc/salome/gui/SMESH/input/netgen_2d_3d_hypo.doc
@@ -2,7 +2,7 @@
\page netgen_2d_3d_hypo_page Netgen 2D and 3D hypotheses
-\n Netgen 2D and Netgen 3D hypotheses work only with Netgen 1D-2D and
+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
@@ -11,68 +11,64 @@ of the meshed object.
\image html netgen2d.png
-
-- 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
+- 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
-\ref adding_quadratic_elements_page "Quadratic".
-- Fineness - ranging from Very Coarse to Very Fine allows to set the
+\ref adding_quadratic_elements_page "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
+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
+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.
-
+not possible.
+- Optimize - if this box is checked in, the algorithm will try to
+create regular (possessing even sides) elements.
\image html netgen3d_simple.png
-Netgen 2D simple parameters and Netgen 3D simple parameters allow defining the size of elements for each dimension.
+Netgen 2D simple parameters and Netgen 3D simple
+parameters allow defining the size of elements for each
+dimension.
\b 1D group allows defining the size of 1D elements in either of two ways:
-
-- Number of Segments has the same sense as \ref
+- Number of Segments has the same sense as \ref
number_of_segments_anchor "Number of segments" hypothesis with
-equidistant distribution.
-- Average Length has the same sense as \ref
-average_length_anchor "Average Length" hypothesis.
-
+equidistant distribution.
+- Average Length has the same sense as \ref
+average_length_anchor "Average Length" hypothesis.
\b 2D group allows defining the size of 2D elements
-
-- Length from edges if checked in, acts like \ref
-length_from_edges_anchor "Length from Edges" hypothesis, else
-- Max. Element Area defines the maximum element area like \ref
-max_element_area_anchor "Max Element Area" hypothesis.
-
+- Length from edges if checked in, acts like \ref
+length_from_edges_anchor "Length from Edges" hypothesis, else
+- Max. Element Area defines the maximum element area like \ref
+max_element_area_anchor "Max Element Area" hypothesis.
\b 3D groups allows defining the size of 3D elements.
-
-- Length from faces if checked in, the area of sides of
-volumic elements will be equal to an average area of 2D elements, else
-- Max. Element Volume defines the maximum element volume like
+- Length from faces if checked in, the area of sides of
+volumic elements will be equal to an average area of 2D elements, else
+- Max. Element Volume defines the maximum element volume like
\ref max_element_volume_hypo_page "Max Element Volume"
-hypothesis.
-
+hypothesis.
-\n Note that Netgen algorithm does not strictly follow the input
-parameters. The actual mesh can be more or less dense than required. There are several factors in it:
-
-- NETGEN does not actually use "NbOfSegments" parameter for discretization of
-edge. This parameter is used only to define the local element size (size at the given point), so local sizes of adjacent edges influence each other.
-- NETGEN additionally restricts the element size according to edge curvature.
-- The local size of edges influences the size of close triangles.
-- The order of elements and their size in the 1D mesh generated by
+\note Netgen algorithm does not strictly follow the input
+parameters. The actual mesh can be more or less dense than
+required. There are several factors in it:
+- NETGEN does not actually use "NbOfSegments" parameter for discretization of
+edge. This parameter is used only to define the local element size
+(size at the given point), so local sizes of adjacent edges influence
+each other.
+- NETGEN additionally restricts the element size according to edge curvature.
+- The local size of edges influences the size of close triangles.
+- The order of elements and their size in the 1D mesh generated by
NETGEN differ from those in the 1D mesh generated by Regular_1D
-algorithm, resulting in different 2D and 3D meshes.
-
-*/
\ No newline at end of file
+algorithm, resulting in different 2D and 3D meshes.
+
+*/
diff --git a/doc/salome/gui/SMESH/input/prism_3d_algo.doc b/doc/salome/gui/SMESH/input/prism_3d_algo.doc
index 837923ac1..5589ba3a7 100644
--- a/doc/salome/gui/SMESH/input/prism_3d_algo.doc
+++ b/doc/salome/gui/SMESH/input/prism_3d_algo.doc
@@ -4,9 +4,9 @@
3D extrusion 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 \ref projection_algos_page "2D Projection"
-algorithm. These two faces should be connected by quadrangle "side"
-faces.
+edges and meshed using, for example, the \ref projection_algos_page
+"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 quadrangles only.
@@ -17,4 +17,8 @@ As you can see, the 3D extrusion algorithm permits to build and to
have in the same 3D mesh such elements as hexahedrons, prisms and
polyhedrons.
-*/
\ No newline at end of file
+\note This algorithm works correctly only if the opposing faces have
+the same (or similar) meshing topography. Otherwise, 3D extrusion
+algorithm can fail to build mesh volumes.
+
+*/
diff --git a/doc/salome/gui/SMESH/input/radial_quadrangle_1D2D_algo.doc b/doc/salome/gui/SMESH/input/radial_quadrangle_1D2D_algo.doc
index 4436e092b..9f54f3eef 100644
--- a/doc/salome/gui/SMESH/input/radial_quadrangle_1D2D_algo.doc
+++ b/doc/salome/gui/SMESH/input/radial_quadrangle_1D2D_algo.doc
@@ -2,27 +2,21 @@
\page radial_quadrangle_1D2D_algo_page Radial Quadrangle 1D2D
-\n This algorithm applies to the meshing of a 2D shapes.
-Required conditions: Face must be a full circle or part of circle
-(i.e. number of edges <= 3 and one of them must be a circle curve).
-The resulting mesh consists of triangles (near center point) and
+\n This algorithm applies to the meshing of 2D shapes under the
+following conditions: the face must be a full circle or a part of circle
+(i.e. the number of edges is less or equal to 3 and one of them is a circle curve).
+The resulting mesh consists of triangles (near the center point) and
quadrangles.
-This algorithm also requires the information concerning the number and
-distribution of mesh layers alond a radius of circle. Distribution of
-layers can be set with any of 1D Hypotheses.
-
-Creation hypothesis:
+This algorithm requires the hypothesis indicating the number
+of mesh layers along the radius. The distribution of layers can be set with any 1D Hypothesis.
\image html hypo_radquad_dlg.png
-Resulting 3D mesh for the cylinder with RadialQuadrangle_1D2D
-hypothesis for top and bottom faces:
+\image html mesh_radquad_01.png "Radial Quadrangle 2D mesh on the top and the bottom faces of a cylinder"
-\image html mesh_radquad_01.png
+\image html mesh_radquad_02.png "Radial Quadrangle 2D mesh on a part of circle"
-Resulting 2D mesh for the part of circle:
-
-\image html mesh_radquad_02.png
+\sa A sample \ref tui_radial_quadrangle "TUI Script".
*/
diff --git a/doc/salome/gui/SMESH/input/smeshpy_interface.doc b/doc/salome/gui/SMESH/input/smeshpy_interface.doc
index efbafc617..e0fe78ec9 100644
--- a/doc/salome/gui/SMESH/input/smeshpy_interface.doc
+++ b/doc/salome/gui/SMESH/input/smeshpy_interface.doc
@@ -2,129 +2,140 @@
\page smeshpy_interface_page Python interface
-\n Python package smesh defines several classes, destined for easy and
+Python package smesh defines several classes, destined for easy and
clear mesh creation and edition.
-\n Documentation for smesh package is available in two forms:
+Documentation for smesh package is available in two forms:
-\n The structured
- documentation for smesh package, where all methods and
- classes are grouped by their functionality, like it is done in the GUI documentation
-\n and the \ref smeshDC "linear documentation for smesh package"
- grouped only by classes, declared in the smesh.py file.
+The structured
+documentation for smesh package, where all methods and
+classes are grouped by their functionality, like it is done in the GUI documentation
+and the \ref smeshDC "linear documentation for smesh package"
+grouped only by classes, declared in the smesh.py file.
-\n The main page of the \ref smeshDC "linear documentation for smesh package"
- contains a list of data structures and a list of
- functions, provided by the package smesh.py. The first item in
- the list of data structures (\ref smeshDC::smeshDC "class smesh")
- also represents documentation for the methods of the package smesh.py itself.
+The main page of the \ref smeshDC "linear documentation for smesh package"
+contains a list of data structures and a list of
+functions, provided by the package smesh.py. The first item in
+the list of data structures (\ref smeshDC::smeshDC "class smesh")
+also represents documentation for the methods of the package smesh.py itself.
-\n The package smesh.py provides an interface to create and handle
- meshes. Use it to create an empty mesh or to import it from the data file.
+The package smesh.py provides an interface to create and handle
+meshes. Use it to create an empty mesh or to import it from the data file.
-\n Once a mesh has been created, it is possible to manage it via its own
- methods, described at \ref smeshDC::Mesh "class Mesh" documentation
- (it is also accessible by the second item "class Mesh" in the list of data structures).
+Once a mesh has been created, it is possible to manage it via its own
+methods, described at \ref smeshDC::Mesh "class Mesh" documentation
+(it is also accessible by the second item "class Mesh" in the list of data structures).
-\n Class Mesh allows assigning algorithms to a mesh.
-\n Please note, that some algorithms,
- included in the standard Salome installation are always available:
- - REGULAR(1D), COMPOSITE(1D), MEFISTO(2D), Quadrangle(2D), Hexa(3D), etc.
+Class \b Mesh allows assigning algorithms to a mesh.
+Please note, that some algorithms, included in the standard SALOME
+distribution are always available:
+- REGULAR (1D)
+- COMPOSITE (1D)
+- MEFISTO (2D)
+- Quadrangle (2D)
+- Hexa(3D)
+- etc...
-\n There are also some algorithms, which can be installed optionally,
-\n some of them are based on open-source meshers:
- - NETGEN(1D-2D,2D,1D-2D-3D,3D),
+There are also some algorithms, which can be installed optionally,
+some of them are based on open-source meshers:
+- NETGEN (1D-2D, 2D, 1D-2D-3D, 3D)
-\n others are based on commercial meshers:
- - GHS3D(3D), BLSURF(2D).
+... and others are based on commercial meshers:
+- GHS3D (3D)
+- BLSURF (2D)
-\n To add hypotheses, use the interfaces, provided by the assigned
+To add hypotheses, use the interfaces, provided by the assigned
algorithms.
-\n Below you can see an example of usage of the package smesh for 3d mesh generation.
+Below you can see an example of usage of the package smesh for 3d mesh generation.
+\anchor example_3d_mesh
Example of 3d mesh generation with NETGEN:
-\n from geompy import *
-\n import smesh
+\code
+from geompy import *
+import smesh
-# Geometry
-\n # an assembly of a box, a cylinder and a truncated cone meshed with tetrahedral.
+###
+# Geometry: an assembly of a box, a cylinder and a truncated cone
+# meshed with tetrahedral
+###
-# Define values
-\n name = "ex21_lamp"
-\n cote = 60
-\n section = 20
-\n size = 200
-\n radius_1 = 80
-\n radius_2 = 40
-\n height = 100
+# Define values
+name = "ex21_lamp"
+cote = 60
+section = 20
+size = 200
+radius_1 = 80
+radius_2 = 40
+height = 100
-# Build a box
-\n box = MakeBox(-cote, -cote, -cote, +cote, +cote, +cote)
+# Build a box
+box = MakeBox(-cote, -cote, -cote, +cote, +cote, +cote)
-# Build a cylinder
-\n pt1 = MakeVertex(0, 0, cote/3)
-\n di1 = MakeVectorDXDYDZ(0, 0, 1)
-\n cyl = MakeCylinder(pt1, di1, section, size)
+# Build a cylinder
+pt1 = MakeVertex(0, 0, cote/3)
+di1 = MakeVectorDXDYDZ(0, 0, 1)
+cyl = MakeCylinder(pt1, di1, section, size)
-# Build a truncated cone
-\n pt2 = MakeVertex(0, 0, size)
-\n cone = MakeCone(pt2, di1, radius_1, radius_2, height)
+# Build a truncated cone
+pt2 = MakeVertex(0, 0, size)
+cone = MakeCone(pt2, di1, radius_1, radius_2, height)
-# Fuse
-\n box_cyl = MakeFuse(box, cyl)
-\n piece = MakeFuse(box_cyl, cone)
+# Fuse
+box_cyl = MakeFuse(box, cyl)
+piece = MakeFuse(box_cyl, cone)
-# Add in study
-\n addToStudy(piece, name)
+# Add to the study
+addToStudy(piece, name)
-# Create a group of faces
-\n group = CreateGroup(piece, ShapeType["FACE"])
-\n group_name = name + "_grp"
-\n addToStudy(group, group_name)
-\n group.SetName(group_name)
+# Create a group of faces
+group = CreateGroup(piece, ShapeType["FACE"])
+group_name = name + "_grp"
+addToStudy(group, group_name)
+group.SetName(group_name)
-# Add faces in the group
-\n faces = SubShapeAllIDs(piece, ShapeType["FACE"])
-\n UnionIDs(group, faces)
+# Add faces to the group
+faces = SubShapeAllIDs(piece, ShapeType["FACE"])
+UnionIDs(group, faces)
-# Create a mesh
+###
+# Create a mesh
+###
-# Define a mesh on a geometry
-\n tetra = smesh.Mesh(piece, name)
+# Define a mesh on a geometry
+tetra = smesh.Mesh(piece, name)
-# Define 1D hypothesis
-\n algo1d = tetra.Segment()
-\n algo1d.LocalLength(10)
+# Define 1D hypothesis
+algo1d = tetra.Segment()
+algo1d.LocalLength(10)
-# Define 2D hypothesis
-\n algo2d = tetra.Triangle()
-\n algo2d.LengthFromEdges()
+# Define 2D hypothesis
+algo2d = tetra.Triangle()
+algo2d.LengthFromEdges()
-# Define 3D hypothesis
-\n algo3d = tetra.Tetrahedron(smesh.NETGEN)
-\n algo3d.MaxElementVolume(100)
+# Define 3D hypothesis
+algo3d = tetra.Tetrahedron(smesh.NETGEN)
+algo3d.MaxElementVolume(100)
-# Compute the mesh
-\n tetra.Compute()
+# Compute the mesh
+tetra.Compute()
-# Create a groupe of faces
-\n tetra.Group(group)
+# Create a groupe of faces
+tetra.Group(group)
-\n Examples of Python scripts for all Mesh operations are available by
+\endcode
+
+Examples of Python scripts for all Mesh operations are available by
the following links:
-
-- \subpage tui_creating_meshes_page
-- \subpage tui_viewing_meshes_page
-- \subpage tui_defining_hypotheses_page
-- \subpage tui_quality_controls_page
-- \subpage tui_grouping_elements_page
-- \subpage tui_modifying_meshes_page
-- \subpage tui_transforming_meshes_page
-- \subpage tui_notebook_smesh_page
-
-
+- \subpage tui_creating_meshes_page
+- \subpage tui_viewing_meshes_page
+- \subpage tui_defining_hypotheses_page
+- \subpage tui_quality_controls_page
+- \subpage tui_grouping_elements_page
+- \subpage tui_modifying_meshes_page
+- \subpage tui_transforming_meshes_page
+- \subpage tui_notebook_smesh_page
*/
diff --git a/doc/salome/gui/SMESH/input/translation.doc b/doc/salome/gui/SMESH/input/translation.doc
index e4589b5a6..2f0f0743e 100644
--- a/doc/salome/gui/SMESH/input/translation.doc
+++ b/doc/salome/gui/SMESH/input/translation.doc
@@ -64,13 +64,9 @@ name in the adjacent box);
-- Click \b Apply or Apply and Close button to confirm the
-operation.
-
+- Click \b Apply or Apply and Close button to confirm the operation.
-
-
See Also a sample TUI Script of a
-\ref tui_translation "Translation" operation.
+
See Also a sample TUI Script of a \ref tui_translation "Translation" operation.
*/
diff --git a/doc/salome/gui/SMESH/input/tui_creating_meshes.doc b/doc/salome/gui/SMESH/input/tui_creating_meshes.doc
index 9048afef1..87f740e98 100644
--- a/doc/salome/gui/SMESH/input/tui_creating_meshes.doc
+++ b/doc/salome/gui/SMESH/input/tui_creating_meshes.doc
@@ -2,7 +2,7 @@
\page tui_creating_meshes_page Creating Meshes
-\n First of all see \ref introduction_to_mesh_python_page "Example of 3d mesh generation",
+\n First of all see \ref example_3d_mesh "Example of 3d mesh generation",
which is an example of good python script style for Mesh module.
diff --git a/doc/salome/gui/SMESH/input/tui_defining_blsurf_hypotheses.doc b/doc/salome/gui/SMESH/input/tui_defining_blsurf_hypotheses.doc
index 346e6781c..3faba3da5 100644
--- a/doc/salome/gui/SMESH/input/tui_defining_blsurf_hypotheses.doc
+++ b/doc/salome/gui/SMESH/input/tui_defining_blsurf_hypotheses.doc
@@ -19,6 +19,11 @@ Face_1 = geompy.SubShapeAllSorted(box, geompy.ShapeType["FACE"])[0]
Edge_1 = geompy.SubShapeAllSorted(box, geompy.ShapeType["EDGE"])[0]
Vertex_1 = geompy.SubShapeAllSorted(box, geompy.ShapeType["VERTEX"])[0]
+# /!\ Geom object with sizemaps on them must be published in study
+geompy.addToStudyInFather(box,Face_1, "Face_1")
+geompy.addToStudyInFather(box,Edge_1, "Edge_1")
+geompy.addToStudyInFather(box,Vertex_1, "Vertex_1")
+
# create a mesh on the box
blsurfMesh = smesh.Mesh(box,"box: BLSurf mesh")
@@ -43,6 +48,39 @@ BLSURF_Parameters.SetSizeMap(Vertex_1, 'def f(): return 2' )
# compute the mesh
blsurfMesh.Compute()
+
+# Add enforced vertex for Face_1 on (50, 50, 50)
+# The projection coordinates will be (50, 50, 0)
+BLSURF_Parameters.SetEnforcedVertex(Face_1, 50, 50, 50)
+
+# Add another enforced vertex on (150, 150, 150)
+BLSURF_Parameters.SetEnforcedVertex(Face_1, 150, 150, 150)
+
+# Retrieve and print the list of enforced vertices defines on Face_1
+enfList = BLSURF_Parameters.GetEnforcedVertices(Face_1)
+print "List of enforced vertices for Face_1: "
+print enfList
+
+# compute the mesh
+blsurfMesh.Compute()
+
+# Remove an enforced vertex and print the list
+BLSURF_Parameters.UnsetEnforcedVertex(Face_1, 50, 50, 50)
+enfList = BLSURF_Parameters.GetEnforcedVertices(Face_1)
+print "List of enforced vertices for Face_1: "
+print enfList
+
+# compute the mesh
+blsurfMesh.Compute()
+
+# Remove all enforced vertices defined on Face_1
+BLSURF_Parameters.UnsetEnforcedVertices(Face_1)
+
+# compute the mesh
+blsurfMesh.Compute()
+
+# End of script
+
\endcode
*/
\ No newline at end of file
diff --git a/doc/salome/gui/SMESH/input/tui_defining_ghs3d_hypotheses.doc b/doc/salome/gui/SMESH/input/tui_defining_ghs3d_hypotheses.doc
new file mode 100644
index 000000000..57a6aaf88
--- /dev/null
+++ b/doc/salome/gui/SMESH/input/tui_defining_ghs3d_hypotheses.doc
@@ -0,0 +1,45 @@
+/*!
+
+\page tui_defining_ghs3d_hypotheses_page Defining Hypotheses for Ghs3D Algorithm
+
+\anchor tui_ghs3d
+Construction of Mesh using Ghs3D algorithm
+
+\code
+import geompy
+import smesh
+import BLSURFPlugin
+import GHS3DPlugin
+
+# create a box
+box = geompy.MakeBoxDXDYDZ(200., 200., 200.)
+geompy.addToStudy(box, "box")
+
+# create a mesh on the box
+ghs3dMesh = smesh.Mesh(box,"box: Ghs3D and BLSurf mesh")
+
+# create a BLSurf algorithm for faces
+BLSURF = ghs3dMesh.Triangle(algo=smesh.BLSURF)
+
+# create a Ghs3D algorithm for volume
+GHS3D = ghs3dMesh.Tetrahedron(algo=smesh.GHS3D)
+
+# get Ghs3D algorithm hypothesis
+GHS3D_Parameters = GHS3D.Parameters()
+
+# define an enforced vertex at (50,50,100) with a physical size of 2
+GHS3D_Parameters.SetEnforcedVertex( 50, 50, 100, 2 )
+
+# define an enforced vertex at (150,150,100) with a physical size of 5
+GHS3D_Parameters.SetEnforcedVertex( 150, 150, 100, 5 )
+
+# compute the mesh
+ghs3dMesh.Compute()
+
+# End of script
+
+\endcode
+
+\image html ghs3d_enforced_vertices_screenshot.png
+
+*/
\ No newline at end of file
diff --git a/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc b/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc
index 8c93ca2e3..04725fdc6 100644
--- a/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc
+++ b/doc/salome/gui/SMESH/input/tui_defining_hypotheses.doc
@@ -468,9 +468,83 @@ src_mesh.TranslateObject( src_mesh, MakeDirStruct( 210, 0, 0 ), Copy=False)
\endcode
+
+
+\anchor tui_fixed_points
+
+1D Mesh with Fixed Points example
+
+\code
+import salome
+import geompy
+import smesh
+import StdMeshers
+
+# Create face and explode it on edges
+face = geompy.MakeFaceHW(100, 100, 1)
+edges = geompy.SubShapeAllSorted(face, geompy.ShapeType["EDGE"])
+geompy.addToStudy( face, "Face" )
+
+# get the first edge from exploded result
+edge1 = geompy.GetSubShapeID(face, edges[0])
+
+# Define Mesh on previously created face
+Mesh_1 = smesh.Mesh(face)
+
+# Create Fixed Point 1D hypothesis and define parameters.
+# Note: values greater than 1.0 and less than 0.0 are not taken into account;
+# duplicated values are removed. Also, if not specified explicitly, values 0.0 and 1.0
+# add added automatically.
+# The number of segments should correspond to the number of points (NbSeg = NbPnt-1);
+# extra values of segments splitting parameter are not taken into account,
+# while missing values are considered to be equal to 1.
+Fixed_points_1D_1 = smesh.CreateHypothesis('FixedPoints1D')
+Fixed_points_1D_1.SetPoints( [ 1.1, 0.9, 0.5, 0.0, 0.5, -0.3 ] )
+Fixed_points_1D_1.SetNbSegments( [ 3, 1, 2 ] )
+Fixed_points_1D_1.SetReversedEdges( [edge1] )
+
+# Add hypothesis to mesh and define 2D parameters
+Mesh_1.AddHypothesis(Fixed_points_1D_1)
+Regular_1D = Mesh_1.Segment()
+Quadrangle_2D = Mesh_1.Quadrangle()
+# Compute mesh
+Mesh_1.Compute()
+\endcode
+
+\anchor tui_radial_quadrangle
+ Radial Quadrangle 1D2D example
+\code
+import salome
+import geompy
+import smesh
+import StdMeshers
+
+# Create face from the wire and add to study
+WirePath = geompy.MakeSketcher("Sketcher:F 0 0:TT 20 0:R 90:C 20 90:WW", [0, 0, 0, 1, 0, 0, 0, 0, 1])
+Face = geompy.MakeFace(WirePath,1)
+geompy.addToStudy(Face,"Face")
+
+# Define geometry for mesh, and 1D parameters
+mesh = smesh.Mesh(Face)
+Wire_discretisation = mesh.Segment()
+Nb_Segments = Wire_discretisation.NumberOfSegments(5)
+Nb_Segments.SetDistrType( 0 )
+
+# Define 2D parameters and Radial Quadrange hypothesis
+Number_of_Layers = smesh.CreateHypothesis('NumberOfLayers2D')
+Number_of_Layers.SetNumberOfLayers( 4 )
+mesh.AddHypothesis(Number_of_Layers)
+RadialQuadrangle_1D2D = smesh.CreateHypothesis('RadialQuadrangle_1D2D')
+mesh.AddHypothesis(RadialQuadrangle_1D2D)
+
+mesh.Compute()
+\endcode
+
+
\n Other meshing algorithms:
- \subpage tui_defining_blsurf_hypotheses_page
+- \subpage tui_defining_ghs3d_hypotheses_page
*/
diff --git a/doc/salome/gui/SMESH/input/tui_grouping_elements.doc b/doc/salome/gui/SMESH/input/tui_grouping_elements.doc
index e03433f1c..b77edd21e 100644
--- a/doc/salome/gui/SMESH/input/tui_grouping_elements.doc
+++ b/doc/salome/gui/SMESH/input/tui_grouping_elements.doc
@@ -1,4 +1,4 @@
-/*!
+ /*!
\page tui_grouping_elements_page Grouping Elements
@@ -318,13 +318,13 @@ salome.sg.updateObjBrowser(1)
\endcode
\image html dimgroup_tui1.png
-Source groups of faces<\center>
+Source groups of faces
\image html dimgroup_tui2.png
-Result groups of edges and nodes<\center>
+Result groups of edges and nodes
-*/
\ No newline at end of file
+*/
diff --git a/doc/salome/gui/SMESH/input/tui_modifying_meshes.doc b/doc/salome/gui/SMESH/input/tui_modifying_meshes.doc
index bc7b78c89..66b6361fa 100644
--- a/doc/salome/gui/SMESH/input/tui_modifying_meshes.doc
+++ b/doc/salome/gui/SMESH/input/tui_modifying_meshes.doc
@@ -815,4 +815,48 @@ isDone = pattern.MakeMesh(Mesh_1.GetMesh(), 0, 0)
if (isDone != 1): print 'MakeMesh :', pattern.GetErrorCode()
\endcode
-*/
\ No newline at end of file
+
+\anchor tui_quadratic
+Convert mesh to/from quadratic
+
+\code
+import geompy
+import smesh
+
+# create sphere of radius 100
+
+Sphere = geompy.MakeSphereR( 100 )
+geompy.addToStudy( Sphere, "Sphere" )
+
+# create simple trihedral mesh
+
+Mesh = smesh.Mesh(Sphere)
+Regular_1D = Mesh.Segment()
+Nb_Segments = Regular_1D.NumberOfSegments(5)
+MEFISTO_2D = Mesh.Triangle()
+Tetrahedron_Netgen = Mesh.Tetrahedron(algo=smesh.NETGEN)
+
+# compute mesh
+
+isDone = Mesh.Compute()
+
+# convert to quadratic
+# theForce3d = 1; this results in the medium node lying at the
+# middle of the line segments connecting start and end node of a mesh
+# element
+
+Mesh.ConvertToQuadratic( theForce3d=1 )
+
+# revert back to the non-quadratic mesh
+
+Mesh.ConvertFromQuadratic()
+
+# convert to quadratic
+# theForce3d = 0; this results in the medium node lying at the
+# geometrical edge from which the mesh element is built
+
+Mesh.ConvertToQuadratic( theForce3d=0 )
+
+\endcode
+
+*/
diff --git a/doc/salome/gui/SMESH/input/tui_viewing_meshes.doc b/doc/salome/gui/SMESH/input/tui_viewing_meshes.doc
index 59681c16b..862cb302e 100644
--- a/doc/salome/gui/SMESH/input/tui_viewing_meshes.doc
+++ b/doc/salome/gui/SMESH/input/tui_viewing_meshes.doc
@@ -9,10 +9,12 @@
\code
import geompy
import smesh
+import SMESH
# create a box
box = geompy.MakeBox(0., 0., 0., 20., 20., 20.)
geompy.addToStudy(box, "box")
+[Face_1,Face_2,Face_3,Face_4,Face_5,Face_5] = geompy.SubShapeAll(box, geompy.ShapeType["FACE"])
# create a mesh
tetra = smesh.Mesh(box, "MeshBox")
@@ -26,10 +28,22 @@ algo2D.MaxElementArea(10.)
algo3D = tetra.Tetrahedron(smesh.NETGEN)
algo3D.MaxElementVolume(900.)
+# Creation of SubMesh
+Regular_1D_1_1 = tetra.Segment(geom=Face_1)
+Nb_Segments_1 = Regular_1D_1_1.NumberOfSegments(5)
+Nb_Segments_1.SetDistrType( 0 )
+Quadrangle_2D = tetra.Quadrangle(geom=Face_1)
+isDone = tetra.Compute()
+submesh = Regular_1D_1_1.GetSubMesh()
+
# compute the mesh
tetra.Compute()
-# print information about the mesh
+# Creation of group
+group = tetra.CreateEmptyGroup( SMESH.FACE, 'Group' )
+nbAdd = group.Add( [ 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76 ] )
+
+# Print information about the mesh
print "Information about mesh:"
print "Number of nodes : ", tetra.NbNodes()
print "Number of edges : ", tetra.NbEdges()
@@ -43,5 +57,30 @@ print " hexahedrons : ", tetra.NbHexas()
print " prisms : ", tetra.NbPrisms()
print " pyramids : ", tetra.NbPyramids()
print " polyhedrons : ", tetra.NbPolyhedrons()
+
+# Get Information About Mesh by GetMeshInfo
+print "\nInformation about mesh by GetMeshInfo:"
+info = smesh.GetMeshInfo(tetra)
+keys = info.keys(); keys.sort()
+for i in keys:
+ print " %s : %d" % ( i, info[i] )
+ pass
+
+# Get Information About Group by GetMeshInfo
+print "\nInformation about group by GetMeshInfo:"
+info = smesh.GetMeshInfo(group)
+keys = info.keys(); keys.sort()
+for i in keys:
+ print " %s : %d" % ( i, info[i] )
+ pass
+
+# Get Information About SubMesh by GetMeshInfo
+print "\nInformation about Submesh by GetMeshInfo:"
+info = smesh.GetMeshInfo(submesh)
+keys = info.keys(); keys.sort()
+for i in keys:
+ print " %s : %d" % ( i, info[i] )
+ pass
\endcode
-*/
\ No newline at end of file
+
+*/
diff --git a/doc/salome/gui/SMESH/input/viewing_meshes_overview.doc b/doc/salome/gui/SMESH/input/viewing_meshes_overview.doc
index 01a272de2..ee4c6dd4a 100644
--- a/doc/salome/gui/SMESH/input/viewing_meshes_overview.doc
+++ b/doc/salome/gui/SMESH/input/viewing_meshes_overview.doc
@@ -38,7 +38,7 @@ meshes.
- \subpage transparency_page "Transparency" - allows to change the
transparency of mesh elements.
- \subpage clipping_page "Clipping" - allows to create cross-sections of the selected objects.
-- \ref about_quality_controls_page "Controls" - graphically
+
- \ref quality_page "Controls" - graphically
presents various information about meshes.
- Hide - allows to hide the selected mesh from the viewer.
- Show Only -allows to display only the selected mesh, hiding all other from the viewer.
diff --git a/idl/SMESH_Mesh.idl b/idl/SMESH_Mesh.idl
index fff0c5120..8a5c37daa 100644
--- a/idl/SMESH_Mesh.idl
+++ b/idl/SMESH_Mesh.idl
@@ -46,7 +46,6 @@ module SMESH
enum log_command
{
ADD_NODE,
- ADD_ELEM0D,
ADD_EDGE,
ADD_TRIANGLE,
ADD_QUADRANGLE,
@@ -69,7 +68,8 @@ module SMESH
ADD_QUADTETRAHEDRON,
ADD_QUADPYRAMID,
ADD_QUADPENTAHEDRON,
- ADD_QUADHEXAHEDRON
+ ADD_QUADHEXAHEDRON,
+ ADD_ELEM0D
};
struct log_block
diff --git a/idl/SMESH_MeshEditor.idl b/idl/SMESH_MeshEditor.idl
index 198275ed8..62623567a 100644
--- a/idl/SMESH_MeshEditor.idl
+++ b/idl/SMESH_MeshEditor.idl
@@ -614,6 +614,18 @@ module SMESH
*/
long MoveClosestNodeToPoint(in double x, in double y, in double z, in long nodeID);
+ /*!
+ * Return ID of node closest to a given point
+ */
+ long FindNodeClosestTo(in double x, in double y, in double z);
+
+ /*!
+ * Return elements of given type where the given point is IN or ON.
+ *
+ * 'ALL' type means elements of any type excluding nodes and 0D elements
+ */
+ long_array FindElementsByPoint(in double x, in double y, in double z, in ElementType type);
+
enum Sew_Error {
SEW_OK,
SEW_BORDER1_NOT_FOUND,
@@ -684,6 +696,49 @@ module SMESH
* not creared - returns empty list
*/
long_array GetLastCreatedElems();
+
+ /*!
+ * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+ * \param theNodes - identifiers of nodes to be doubled
+ * \param theModifiedElems - identifiers of elements to be updated by the new (doubled)
+ * nodes. If list of element identifiers is empty then nodes are doubled but
+ * they not assigned to elements
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
+ * \sa DoubleNode(), DoubleNodeGroup(), DoubleNodeGroups()
+ */
+ boolean DoubleNodes( in long_array theNodes, in long_array theModifiedElems );
+
+ /*!
+ * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+ * This method provided for convenience works as DoubleNodes() described above.
+ * \param theNodeId - identifier of node to be doubled.
+ * \param theModifiedElems - identifiers of elements to be updated.
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
+ * \sa DoubleNodes(), DoubleNodeGroup(), DoubleNodeGroups()
+ */
+ boolean DoubleNode( in long theNodeId, in long_array theModifiedElems );
+
+ /*!
+ * \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+ * This method provided for convenience works as DoubleNodes() described above.
+ * \param theNodes - group of nodes to be doubled.
+ * \param theModifiedElems - group of elements to be updated.
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
+ * \sa DoubleNode(), DoubleNodes(), DoubleNodeGroups()
+ */
+ boolean DoubleNodeGroup( in SMESH_GroupBase theNodes,
+ in SMESH_GroupBase theModifiedElems );
+
+ /*!
+ \brief Creates a hole in a mesh by doubling the nodes of some particular elements
+ This method provided for convenience works as DoubleNodes() described above.
+ \param theNodes - list of groups of nodes to be doubled
+ \param theModifiedElems - list of groups of elements to be updated.
+ \return TRUE if operation has been completed successfully, FALSE otherwise
+ \sa DoubleNode(), DoubleNodeGroup(), DoubleNodes()
+ */
+ boolean DoubleNodeGroups( in ListOfGroups theNodes,
+ in ListOfGroups theModifiedElems );
/*!
* \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -695,9 +750,9 @@ module SMESH
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodeGroup(), DoubleNodeGroups()
*/
- boolean DoubleNodes( in long_array theElems,
- in long_array theNodesNot,
- in long_array theAffectedElems );
+ boolean DoubleNodeElem( in long_array theElems,
+ in long_array theNodesNot,
+ in long_array theAffectedElems );
/*!
* \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -710,9 +765,9 @@ module SMESH
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodeGroupInRegion(), DoubleNodeGroupsInRegion()
*/
- boolean DoubleNodesInRegion( in long_array theElems,
- in long_array theNodesNot,
- in GEOM::GEOM_Object theShape );
+ boolean DoubleNodeElemInRegion( in long_array theElems,
+ in long_array theNodesNot,
+ in GEOM::GEOM_Object theShape );
/*!
* \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -724,9 +779,9 @@ module SMESH
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodes(), DoubleNodeGroups()
*/
- boolean DoubleNodeGroup( in SMESH_GroupBase theElems,
- in SMESH_GroupBase theNodesNot,
- in SMESH_GroupBase theAffectedElems );
+ boolean DoubleNodeElemGroup( in SMESH_GroupBase theElems,
+ in SMESH_GroupBase theNodesNot,
+ in SMESH_GroupBase theAffectedElems );
/*!
* \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -739,7 +794,7 @@ module SMESH
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodesInRegion(), DoubleNodeGroupsInRegion()
*/
- boolean DoubleNodeGroupInRegion( in SMESH_GroupBase theElems,
+ boolean DoubleNodeElemGroupInRegion( in SMESH_GroupBase theElems,
in SMESH_GroupBase theNodesNot,
in GEOM::GEOM_Object theShape );
@@ -753,9 +808,9 @@ module SMESH
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodeGroup(), DoubleNodes()
*/
- boolean DoubleNodeGroups( in ListOfGroups theElems,
- in ListOfGroups theNodesNot,
- in ListOfGroups theAffectedElems );
+ boolean DoubleNodeElemGroups( in ListOfGroups theElems,
+ in ListOfGroups theNodesNot,
+ in ListOfGroups theAffectedElems );
/*!
* \brief Creates a hole in a mesh by doubling the nodes of some particular elements
@@ -768,9 +823,16 @@ module SMESH
* \return TRUE if operation has been completed successfully, FALSE otherwise
* \sa DoubleNodeGroupInRegion(), DoubleNodesInRegion()
*/
- boolean DoubleNodeGroupsInRegion( in ListOfGroups theElems,
- in ListOfGroups theNodesNot,
- in GEOM::GEOM_Object theShape );
+ boolean DoubleNodeElemGroupsInRegion( in ListOfGroups theElems,
+ in ListOfGroups theNodesNot,
+ in GEOM::GEOM_Object theShape );
+
+ /*!
+ * \brief Generated skin mesh (containing 2D cells) from 3D mesh
+ * The created 2D mesh elements based on nodes of free faces of boundary volumes
+ * \return TRUE if operation has been completed successfully, FALSE otherwise
+ */
+ boolean Make2DMeshFrom3D();
};
};
diff --git a/resources/Makefile.am b/resources/Makefile.am
index 2ebd83edf..3fb97d2ae 100644
--- a/resources/Makefile.am
+++ b/resources/Makefile.am
@@ -165,6 +165,7 @@ dist_salomeres_DATA = \
mesh_tree_mesh_partial.png \
mesh_extractGroup.png \
mesh_precompute.png \
+ mesh_2d_from_3d.png \
mesh_free_faces.png
# VSR: little trick to avoid putting if SMESHCatalog.xml to the distribution archive
diff --git a/resources/mesh_2d_from_3d.png b/resources/mesh_2d_from_3d.png
new file mode 100644
index 000000000..b0842d3e7
Binary files /dev/null and b/resources/mesh_2d_from_3d.png differ
diff --git a/src/Controls/SMESH_Controls.cxx b/src/Controls/SMESH_Controls.cxx
index cc390e500..996cb7604 100644
--- a/src/Controls/SMESH_Controls.cxx
+++ b/src/Controls/SMESH_Controls.cxx
@@ -149,21 +149,21 @@ namespace{
// SMDS_ElemIteratorPtr anIter = anEdge->nodesIterator();
// if ( anIter != 0 ) {
// while( anIter->more() ) {
-// const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
-// if ( aNode == 0 )
-// return 0;
-// SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator();
-// while( anElemIter->more() ) {
-// const SMDS_MeshElement* anElem = anElemIter->next();
-// if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) {
-// int anId = anElem->GetID();
+// const SMDS_MeshNode* aNode = (SMDS_MeshNode*)anIter->next();
+// if ( aNode == 0 )
+// return 0;
+// SMDS_ElemIteratorPtr anElemIter = aNode->GetInverseElementIterator();
+// while( anElemIter->more() ) {
+// const SMDS_MeshElement* anElem = anElemIter->next();
+// if ( anElem != 0 && anElem->GetType() != SMDSAbs_Edge ) {
+// int anId = anElem->GetID();
-// if ( anIter->more() ) // i.e. first node
-// aMap.Add( anId );
-// else if ( aMap.Contains( anId ) )
-// aResult++;
-// }
-// }
+// if ( anIter->more() ) // i.e. first node
+// aMap.Add( anId );
+// else if ( aMap.Contains( anId ) )
+// aResult++;
+// }
+// }
// }
// }
@@ -476,9 +476,9 @@ namespace{
inline double getArea(double theHalfPerim, double theTria[3]){
return sqrt(theHalfPerim*
- (theHalfPerim-theTria[0])*
- (theHalfPerim-theTria[1])*
- (theHalfPerim-theTria[2]));
+ (theHalfPerim-theTria[0])*
+ (theHalfPerim-theTria[1])*
+ (theHalfPerim-theTria[2]));
}
inline double getVolume(double theLen[6]){
@@ -1036,160 +1036,160 @@ double Length2D::GetValue( long theElementId)
case SMDSAbs_Node:
case SMDSAbs_Edge:
if (len == 2){
- aVal = getDistance( P( 1 ), P( 2 ) );
+ aVal = getDistance( P( 1 ), P( 2 ) );
break;
}
else if (len == 3){ // quadratic edge
- aVal = getDistance(P( 1 ),P( 3 )) + getDistance(P( 3 ),P( 2 ));
+ aVal = getDistance(P( 1 ),P( 3 )) + getDistance(P( 3 ),P( 2 ));
break;
}
case SMDSAbs_Face:
if (len == 3){ // triangles
- double L1 = getDistance(P( 1 ),P( 2 ));
- double L2 = getDistance(P( 2 ),P( 3 ));
- double L3 = getDistance(P( 3 ),P( 1 ));
- aVal = Max(L1,Max(L2,L3));
- break;
+ double L1 = getDistance(P( 1 ),P( 2 ));
+ double L2 = getDistance(P( 2 ),P( 3 ));
+ double L3 = getDistance(P( 3 ),P( 1 ));
+ aVal = Max(L1,Max(L2,L3));
+ break;
}
else if (len == 4){ // quadrangles
- double L1 = getDistance(P( 1 ),P( 2 ));
- double L2 = getDistance(P( 2 ),P( 3 ));
- double L3 = getDistance(P( 3 ),P( 4 ));
- double L4 = getDistance(P( 4 ),P( 1 ));
- aVal = Max(Max(L1,L2),Max(L3,L4));
- break;
+ double L1 = getDistance(P( 1 ),P( 2 ));
+ double L2 = getDistance(P( 2 ),P( 3 ));
+ double L3 = getDistance(P( 3 ),P( 4 ));
+ double L4 = getDistance(P( 4 ),P( 1 ));
+ aVal = Max(Max(L1,L2),Max(L3,L4));
+ break;
}
if (len == 6){ // quadratic triangles
- double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
- double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
- double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 1 ));
- aVal = Max(L1,Max(L2,L3));
+ double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
+ double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
+ double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 1 ));
+ aVal = Max(L1,Max(L2,L3));
//cout<<"L1="<
+
using namespace std;
Driver_Mesh::Status DriverDAT_R_SMDS_Mesh::Perform()
{
+ Kernel_Utils::Localizer loc;
Status aResult = DRS_OK;
int i, j;
diff --git a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx
index 91b06d6b1..54741eac3 100644
--- a/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx
+++ b/src/DriverDAT/DriverDAT_W_SMDS_Mesh.cxx
@@ -27,10 +27,13 @@
#include "utilities.h"
+#include
+
using namespace std;
Driver_Mesh::Status DriverDAT_W_SMDS_Mesh::Perform()
{
+ Kernel_Utils::Localizer loc;
Status aResult = DRS_OK;
int nbNodes, nbCells;
diff --git a/src/DriverDAT/Makefile.am b/src/DriverDAT/Makefile.am
index e681fa4f0..2a4dead05 100644
--- a/src/DriverDAT/Makefile.am
+++ b/src/DriverDAT/Makefile.am
@@ -66,6 +66,7 @@ libMeshDriverDAT_la_CPPFLAGS = \
libMeshDriverDAT_la_LDFLAGS = \
../Driver/libMeshDriver.la \
+ $(KERNEL_LDFLAGS) -lSALOMEBasics \
$(CAS_KERNEL)
DAT_Test_CPPFLAGS = \
diff --git a/src/DriverMED/DriverMED_Family.cxx b/src/DriverMED/DriverMED_Family.cxx
index 84fbf8937..ca31e7b9c 100644
--- a/src/DriverMED/DriverMED_Family.cxx
+++ b/src/DriverMED/DriverMED_Family.cxx
@@ -28,7 +28,7 @@
#include "DriverMED_Family.h"
#include "MED_Factory.hxx"
-#include
+#include
using namespace std;
@@ -83,7 +83,7 @@ void
DriverMED_Family
::SetType(const SMDSAbs_ElementType theType)
{
- myType = theType;
+ myTypes.insert( myType = theType );
}
SMDSAbs_ElementType
@@ -93,6 +93,13 @@ DriverMED_Family
return myType;
}
+const std::set< SMDSAbs_ElementType >&
+DriverMED_Family
+::GetTypes() const
+{
+ return myTypes;
+}
+
bool
DriverMED_Family
::MemberOf(std::string theGroupName) const
@@ -139,11 +146,11 @@ DriverMED_Family
DriverMED_FamilyPtrList
DriverMED_Family
::MakeFamilies(const SMESHDS_SubMeshPtrMap& theSubMeshes,
- const SMESHDS_GroupBasePtrList& theGroups,
- const bool doGroupOfNodes,
- const bool doGroupOfEdges,
- const bool doGroupOfFaces,
- const bool doGroupOfVolumes)
+ const SMESHDS_GroupBasePtrList& theGroups,
+ const bool doGroupOfNodes,
+ const bool doGroupOfEdges,
+ const bool doGroupOfFaces,
+ const bool doGroupOfVolumes)
{
DriverMED_FamilyPtrList aFamilies;
@@ -189,7 +196,7 @@ DriverMED_Family
aFamilies.erase(aCurrIter);
}
if (aFam2->IsEmpty())
- break;
+ break;
}
}
// The rest elements of family
@@ -218,7 +225,7 @@ DriverMED_Family
aFam1->Split(aFam2, aCommon);
if (!aCommon->IsEmpty())
{
- aCommon->SetGroupAttributVal(0);
+ aCommon->SetGroupAttributVal(0);
aFamilies.push_back(aCommon);
}
if (aFam1->IsEmpty())
@@ -226,7 +233,7 @@ DriverMED_Family
aFamilies.erase(aCurrIter);
}
if (aFam2->IsEmpty())
- break;
+ break;
}
}
// The rest elements of group
@@ -310,7 +317,7 @@ DriverMED_Family
//=============================================================================
MED::PFamilyInfo
DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper,
- const MED::PMeshInfo& theMeshInfo) const
+ const MED::PMeshInfo& theMeshInfo) const
{
ostringstream aStr;
aStr << "FAM_" << myId;
@@ -332,20 +339,20 @@ DriverMED_Family::GetFamilyInfo(const MED::PWrapper& theWrapper,
MED::PFamilyInfo anInfo;
if(myId == 0 || myGroupAttributVal == 0){
anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
- aValue,
- myId,
- myGroupNames);
+ aValue,
+ myId,
+ myGroupNames);
}else{
MED::TStringVector anAttrDescs (1, ""); // 1 attribute with empty description,
MED::TIntVector anAttrIds (1, myId); // Id=0,
MED::TIntVector anAttrVals (1, myGroupAttributVal);
anInfo = theWrapper->CrFamilyInfo(theMeshInfo,
- aValue,
- myId,
- myGroupNames,
- anAttrDescs,
- anAttrIds,
- anAttrVals);
+ aValue,
+ myId,
+ myGroupNames,
+ anAttrDescs,
+ anAttrIds,
+ anAttrVals);
}
// cout << endl;
@@ -413,7 +420,7 @@ void DriverMED_Family::Init (SMESHDS_GroupBase* theGroup)
DriverMED_FamilyPtrList
DriverMED_Family
::SplitByType (SMESHDS_SubMesh* theSubMesh,
- const int theId)
+ const int theId)
{
DriverMED_FamilyPtrList aFamilies;
DriverMED_FamilyPtr aNodesFamily (new DriverMED_Family);
diff --git a/src/DriverMED/DriverMED_Family.h b/src/DriverMED/DriverMED_Family.h
index 6ec769bba..ccc042b96 100644
--- a/src/DriverMED/DriverMED_Family.h
+++ b/src/DriverMED/DriverMED_Family.h
@@ -68,16 +68,16 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
static
DriverMED_FamilyPtrList
MakeFamilies (const SMESHDS_SubMeshPtrMap& theSubMeshes,
- const SMESHDS_GroupBasePtrList& theGroups,
- const bool doGroupOfNodes,
- const bool doGroupOfEdges,
- const bool doGroupOfFaces,
- const bool doGroupOfVolumes);
+ const SMESHDS_GroupBasePtrList& theGroups,
+ const bool doGroupOfNodes,
+ const bool doGroupOfEdges,
+ const bool doGroupOfFaces,
+ const bool doGroupOfVolumes);
//! Create TFamilyInfo for this family
MED::PFamilyInfo
GetFamilyInfo (const MED::PWrapper& theWrapper,
- const MED::PMeshInfo& theMeshInfo) const;
+ const MED::PMeshInfo& theMeshInfo) const;
//! Returns elements of this family
const ElementsSet& GetElements () const;
@@ -99,6 +99,7 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
void SetType(const SMDSAbs_ElementType theType);
SMDSAbs_ElementType GetType();
+ const std::set< SMDSAbs_ElementType >& GetTypes() const;
bool MemberOf(std::string theGroupName) const;
@@ -113,7 +114,7 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
static
DriverMED_FamilyPtrList
SplitByType(SMESHDS_SubMesh* theSubMesh,
- const int theId);
+ const int theId);
/*! Remove from elements, common with ,
@@ -121,7 +122,7 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
Create family from common elements, with combined groups list.
*/
void Split (DriverMED_FamilyPtr by,
- DriverMED_FamilyPtr common);
+ DriverMED_FamilyPtr common);
//! Check, if this family has empty list of elements
bool IsEmpty () const;
@@ -133,6 +134,7 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
ElementsSet myElements;
MED::TStringSet myGroupNames;
int myGroupAttributVal;
+ std::set myTypes; // Issue 0020576
};
#endif
diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
index 145a13c93..af538f52f 100644
--- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
+++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.cxx
@@ -48,10 +48,11 @@ static int MYDEBUG = 0;
#define _EDF_NODE_IDS_
using namespace MED;
+using namespace std;
void
DriverMED_R_SMESHDS_Mesh
-::SetMeshName(std::string theMeshName)
+::SetMeshName(string theMeshName)
{
myMeshName = theMeshName;
}
@@ -60,7 +61,7 @@ static const SMDS_MeshNode*
FindNode(const SMDS_Mesh* theMesh, TInt theId){
const SMDS_MeshNode* aNode = theMesh->FindNode(theId);
if(aNode) return aNode;
- EXCEPTION(std::runtime_error,"SMDS_Mesh::FindNode - cannot find a SMDS_MeshNode for ID = "<GetName());
- if(aMeshName != aMeshInfo->GetName()) continue;
+ if(MYDEBUG) MESSAGE("Perform - aMeshName : "<GetName());
+ if(aMeshName != aMeshInfo->GetName()) continue;
aResult = DRS_OK;
- //TInt aMeshDim = aMeshInfo->GetDim();
-
+ //TInt aMeshDim = aMeshInfo->GetDim();
+
// Reading MED families to the temporary structure
- //------------------------------------------------
- TErr anErr;
- TInt aNbFams = aMed->GetNbFamilies(aMeshInfo);
+ //------------------------------------------------
+ TErr anErr;
+ TInt aNbFams = aMed->GetNbFamilies(aMeshInfo);
if(MYDEBUG) MESSAGE("Read " << aNbFams << " families");
for (TInt iFam = 0; iFam < aNbFams; iFam++) {
- PFamilyInfo aFamilyInfo = aMed->GetPFamilyInfo(aMeshInfo,iFam+1,&anErr);
- if(anErr >= 0){
- TInt aFamId = aFamilyInfo->GetId();
- if(MYDEBUG) MESSAGE("Family " << aFamId << " :");
-
+ PFamilyInfo aFamilyInfo = aMed->GetPFamilyInfo(aMeshInfo,iFam+1,&anErr);
+ if(anErr >= 0){
+ TInt aFamId = aFamilyInfo->GetId();
+ if(MYDEBUG) MESSAGE("Family " << aFamId << " :");
+
DriverMED_FamilyPtr aFamily (new DriverMED_Family);
-
+
TInt aNbGrp = aFamilyInfo->GetNbGroup();
if(MYDEBUG) MESSAGE("belong to " << aNbGrp << " groups");
- bool isAttrOk = false;
- if(aFamilyInfo->GetNbAttr() == aNbGrp)
- isAttrOk = true;
+ bool isAttrOk = false;
+ if(aFamilyInfo->GetNbAttr() == aNbGrp)
+ isAttrOk = true;
for (TInt iGr = 0; iGr < aNbGrp; iGr++) {
- std::string aGroupName = aFamilyInfo->GetGroupName(iGr);
+ string aGroupName = aFamilyInfo->GetGroupName(iGr);
if(isAttrOk){
- TInt anAttrVal = aFamilyInfo->GetAttrVal(iGr);
- aFamily->SetGroupAttributVal(anAttrVal);
- }
-
+ TInt anAttrVal = aFamilyInfo->GetAttrVal(iGr);
+ aFamily->SetGroupAttributVal(anAttrVal);
+ }
+
if(MYDEBUG) MESSAGE(aGroupName);
aFamily->AddGroupName(aGroupName);
-
+
}
aFamily->SetId( aFamId );
myFamilies[aFamId] = aFamily;
- }
+ }
}
- if (aMeshInfo->GetType() == MED::eSTRUCTURE){
- /*bool aRes = */buildMeshGrille(aMed,aMeshInfo);
- continue;
- }
+ if (aMeshInfo->GetType() == MED::eSTRUCTURE){
+ /*bool aRes = */buildMeshGrille(aMed,aMeshInfo);
+ continue;
+ }
// Reading MED nodes to the corresponding SMDS structure
- //------------------------------------------------------
+ //------------------------------------------------------
PNodeInfo aNodeInfo = aMed->GetPNodeInfo(aMeshInfo);
- if (!aNodeInfo) {
+ if (!aNodeInfo) {
aResult = DRS_FAIL;
- continue;
+ continue;
}
- PCoordHelper aCoordHelper = GetCoordHelper(aNodeInfo);
+ PCoordHelper aCoordHelper = GetCoordHelper(aNodeInfo);
- EBooleen anIsNodeNum = aNodeInfo->IsElemNum();
- TInt aNbElems = aNodeInfo->GetNbElem();
- if(MYDEBUG) MESSAGE("Perform - aNodeInfo->GetNbElem() = "<GetNbElem() = "<X()<<", "<Y()<<", "<Z()< TNodeIds;
+ // Reading pre information about all MED cells
+ //--------------------------------------------
+ typedef MED::TVector TNodeIds;
bool takeNumbers = true; // initially we trust the numbers from file
- MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo);
- MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
- for(; anEntityIter != aEntityInfo.end(); anEntityIter++){
- const EEntiteMaillage& anEntity = anEntityIter->first;
- if(anEntity == eNOEUD) continue;
- // Reading MED cells to the corresponding SMDS structure
- //------------------------------------------------------
- const MED::TGeom2Size& aGeom2Size = anEntityIter->second;
- MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
- for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
- const EGeometrieElement& aGeom = aGeom2SizeIter->first;
+ MED::TEntityInfo aEntityInfo = aMed->GetEntityInfo(aMeshInfo);
+ MED::TEntityInfo::iterator anEntityIter = aEntityInfo.begin();
+ for(; anEntityIter != aEntityInfo.end(); anEntityIter++){
+ const EEntiteMaillage& anEntity = anEntityIter->first;
+ if(anEntity == eNOEUD) continue;
+ // Reading MED cells to the corresponding SMDS structure
+ //------------------------------------------------------
+ const MED::TGeom2Size& aGeom2Size = anEntityIter->second;
+ MED::TGeom2Size::const_iterator aGeom2SizeIter = aGeom2Size.begin();
+ for(; aGeom2SizeIter != aGeom2Size.end(); aGeom2SizeIter++){
+ const EGeometrieElement& aGeom = aGeom2SizeIter->first;
- switch(aGeom) {
-// case ePOINT1: ## PAL16410
-// break;
- case ePOLYGONE: {
+ switch(aGeom) {
+// case ePOINT1: ## PAL16410
+// break;
+ case ePOLYGONE: {
PPolygoneInfo aPolygoneInfo = aMed->GetPPolygoneInfo(aMeshInfo,anEntity,aGeom);
EBooleen anIsElemNum = takeNumbers ? aPolygoneInfo->IsElemNum() : eFAUX;
-
- TInt aNbElem = aPolygoneInfo->GetNbElem();
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
- TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
- TNodeIds aNodeIds(aNbConn);
+
+ TInt aNbElem = aPolygoneInfo->GetNbElem();
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ MED::TCConnSlice aConnSlice = aPolygoneInfo->GetConnSlice(iElem);
+ TInt aNbConn = aPolygoneInfo->GetNbConn(iElem);
+ TNodeIds aNodeIds(aNbConn);
#ifdef _EDF_NODE_IDS_
- if(anIsNodeNum)
- for(TInt iConn = 0; iConn < aNbConn; iConn++)
- aNodeIds[iConn] = aNodeInfo->GetElemNum(aConnSlice[iConn] - 1);
- else
- for(TInt iConn = 0; iConn < aNbConn; iConn++)
- aNodeIds[iConn] = aConnSlice[iConn];
+ if(anIsNodeNum)
+ for(TInt iConn = 0; iConn < aNbConn; iConn++)
+ aNodeIds[iConn] = aNodeInfo->GetElemNum(aConnSlice[iConn] - 1);
+ else
+ for(TInt iConn = 0; iConn < aNbConn; iConn++)
+ aNodeIds[iConn] = aConnSlice[iConn];
#else
- for(TInt iConn = 0; iConn < aNbConn; iConn++)
- aNodeIds[iConn] = aConnSlice[iConn];
+ for(TInt iConn = 0; iConn < aNbConn; iConn++)
+ aNodeIds[iConn] = aConnSlice[iConn];
#endif
bool isRenum = false;
SMDS_MeshElement* anElement = NULL;
@@ -221,12 +222,12 @@ DriverMED_R_SMESHDS_Mesh
try{
#endif
if(anIsElemNum){
- TInt anElemId = aPolygoneInfo->GetElemNum(iElem);
+ TInt anElemId = aPolygoneInfo->GetElemNum(iElem);
anElement = myMesh->AddPolygonalFaceWithID(aNodeIds,anElemId);
- }
+ }
if(!anElement){
- std::vector aNodes(aNbConn);
- for(TInt iConn = 0; iConn < aNbConn; iConn++)
+ vector aNodes(aNbConn);
+ for(TInt iConn = 0; iConn < aNbConn; iConn++)
aNodes[iConn] = FindNode(myMesh,aNodeIds[iConn]);
anElement = myMesh->AddPolygonalFace(aNodes);
isRenum = anIsElemNum;
@@ -256,107 +257,107 @@ DriverMED_R_SMESHDS_Mesh
}
}
break;
- }
- case ePOLYEDRE: {
+ }
+ case ePOLYEDRE: {
PPolyedreInfo aPolyedreInfo = aMed->GetPPolyedreInfo(aMeshInfo,anEntity,aGeom);
EBooleen anIsElemNum = takeNumbers ? aPolyedreInfo->IsElemNum() : eFAUX;
- TInt aNbElem = aPolyedreInfo->GetNbElem();
- for(TInt iElem = 0; iElem < aNbElem; iElem++){
- MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
- TInt aNbFaces = aConnSliceArr.size();
+ TInt aNbElem = aPolyedreInfo->GetNbElem();
+ for(TInt iElem = 0; iElem < aNbElem; iElem++){
+ MED::TCConnSliceArr aConnSliceArr = aPolyedreInfo->GetConnSliceArr(iElem);
+ TInt aNbFaces = aConnSliceArr.size();
typedef MED::TVector TQuantities;
- TQuantities aQuantities(aNbFaces);
- TInt aNbNodes = aPolyedreInfo->GetNbNodes(iElem);
- TNodeIds aNodeIds(aNbNodes);
- for(TInt iFace = 0, iNode = 0; iFace < aNbFaces; iFace++){
- MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
- TInt aNbConn = aConnSlice.size();
+ TQuantities aQuantities(aNbFaces);
+ TInt aNbNodes = aPolyedreInfo->GetNbNodes(iElem);
+ TNodeIds aNodeIds(aNbNodes);
+ for(TInt iFace = 0, iNode = 0; iFace < aNbFaces; iFace++){
+ MED::TCConnSlice aConnSlice = aConnSliceArr[iFace];
+ TInt aNbConn = aConnSlice.size();
aQuantities[iFace] = aNbConn;
#ifdef _EDF_NODE_IDS_
- if(anIsNodeNum)
- for(TInt iConn = 0; iConn < aNbConn; iConn++)
- aNodeIds[iNode++] = aNodeInfo->GetElemNum(aConnSlice[iConn] - 1);
- else
- for(TInt iConn = 0; iConn < aNbConn; iConn++)
- aNodeIds[iNode++] = aConnSlice[iConn];
+ if(anIsNodeNum)
+ for(TInt iConn = 0; iConn < aNbConn; iConn++)
+ aNodeIds[iNode++] = aNodeInfo->GetElemNum(aConnSlice[iConn] - 1);
+ else
+ for(TInt iConn = 0; iConn < aNbConn; iConn++)
+ aNodeIds[iNode++] = aConnSlice[iConn];
#else
- for(TInt iConn = 0; iConn < aNbConn; iConn++)
- aNodeIds[iNode++] = aConnSlice[iConn];
-#endif
- }
+ for(TInt iConn = 0; iConn < aNbConn; iConn++)
+ aNodeIds[iNode++] = aConnSlice[iConn];
+#endif
+ }
- bool isRenum = false;
- SMDS_MeshElement* anElement = NULL;
- TInt aFamNum = aPolyedreInfo->GetFamNum(iElem);
-
+ bool isRenum = false;
+ SMDS_MeshElement* anElement = NULL;
+ TInt aFamNum = aPolyedreInfo->GetFamNum(iElem);
+
#ifndef _DEXCEPT_
- try{
+ try{
#endif
- if(anIsElemNum){
- TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
- anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId);
- }
- if(!anElement){
- std::vector aNodes(aNbNodes);
- for(TInt iConn = 0; iConn < aNbNodes; iConn++)
- aNodes[iConn] = FindNode(myMesh,aNodeIds[iConn]);
- anElement = myMesh->AddPolyhedralVolume(aNodes,aQuantities);
- isRenum = anIsElemNum;
- }
+ if(anIsElemNum){
+ TInt anElemId = aPolyedreInfo->GetElemNum(iElem);
+ anElement = myMesh->AddPolyhedralVolumeWithID(aNodeIds,aQuantities,anElemId);
+ }
+ if(!anElement){
+ vector aNodes(aNbNodes);
+ for(TInt iConn = 0; iConn < aNbNodes; iConn++)
+ aNodes[iConn] = FindNode(myMesh,aNodeIds[iConn]);
+ anElement = myMesh->AddPolyhedralVolume(aNodes,aQuantities);
+ isRenum = anIsElemNum;
+ }
#ifndef _DEXCEPT_
- }catch(const std::exception& exc){
- aResult = DRS_FAIL;
- }catch(...){
- aResult = DRS_FAIL;
- }
-#endif
- if(!anElement){
- aResult = DRS_WARN_SKIP_ELEM;
- }else{
- if(isRenum){
- anIsElemNum = eFAUX;
- takeNumbers = false;
- if (aResult < DRS_WARN_RENUMBER)
- aResult = DRS_WARN_RENUMBER;
- }
- if ( checkFamilyID ( aFamily, aFamNum )) {
- // Save reference to this element from its family
- aFamily->AddElement(anElement);
- aFamily->SetType(anElement->GetType());
- }
- }
- }
+ }catch(const std::exception& exc){
+ aResult = DRS_FAIL;
+ }catch(...){
+ aResult = DRS_FAIL;
+ }
+#endif
+ if(!anElement){
+ aResult = DRS_WARN_SKIP_ELEM;
+ }else{
+ if(isRenum){
+ anIsElemNum = eFAUX;
+ takeNumbers = false;
+ if (aResult < DRS_WARN_RENUMBER)
+ aResult = DRS_WARN_RENUMBER;
+ }
+ if ( checkFamilyID ( aFamily, aFamNum )) {
+ // Save reference to this element from its family
+ aFamily->AddElement(anElement);
+ aFamily->SetType(anElement->GetType());
+ }
+ }
+ }
break;
}
- default: {
+ default: {
PCellInfo aCellInfo = aMed->GetPCellInfo(aMeshInfo,anEntity,aGeom);
EBooleen anIsElemNum = takeNumbers ? aCellInfo->IsElemNum() : eFAUX;
TInt aNbElems = aCellInfo->GetNbElem();
if(MYDEBUG) MESSAGE("Perform - anEntity = "< DriverMED_R_SMESHDS_Mesh::GetMeshNames(Status& theStatus)
if (TInt aNbMeshes = aMed->GetNbMeshes()) {
for (int iMesh = 0; iMesh < aNbMeshes; iMesh++) {
- // Reading the MED mesh
- //---------------------
- PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh+1);
- aMeshNames.push_back(aMeshInfo->GetName());
+ // Reading the MED mesh
+ //---------------------
+ PMeshInfo aMeshInfo = aMed->GetPMeshInfo(iMesh+1);
+ aMeshNames.push_back(aMeshInfo->GetName());
}
}
}catch(const std::exception& exc){
@@ -764,26 +765,28 @@ std::list DriverMED_R_SMESHDS_Mesh::GetMeshNames(Status& theStatus)
return aMeshNames;
}
-std::list DriverMED_R_SMESHDS_Mesh::GetGroupNamesAndTypes()
+list DriverMED_R_SMESHDS_Mesh::GetGroupNamesAndTypes()
{
- std::list aResult;
- std::set aResGroupNames;
+ list aResult;
+ set aResGroupNames;
- std::map::iterator aFamsIter = myFamilies.begin();
+ map::iterator aFamsIter = myFamilies.begin();
for (; aFamsIter != myFamilies.end(); aFamsIter++)
{
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
const MED::TStringSet& aGroupNames = aFamily->GetGroupNames();
- std::set::const_iterator aGrNamesIter = aGroupNames.begin();
+ set::const_iterator aGrNamesIter = aGroupNames.begin();
for (; aGrNamesIter != aGroupNames.end(); aGrNamesIter++)
{
- TNameAndType aNameAndType = make_pair( *aGrNamesIter, aFamily->GetType() );
- // Check, if this is a Group or SubMesh name
-//if (aName.substr(0, 5) == string("Group")) {
+ const set< SMDSAbs_ElementType >& types = aFamily->GetTypes();
+ set< SMDSAbs_ElementType >::const_iterator type = types.begin();
+ for ( ; type != types.end(); ++type )
+ {
+ TNameAndType aNameAndType = make_pair( *aGrNamesIter, *type );
if ( aResGroupNames.insert( aNameAndType ).second ) {
aResult.push_back( aNameAndType );
}
-// }
+ }
}
}
@@ -792,28 +795,28 @@ std::list DriverMED_R_SMESHDS_Mesh::GetGroupNamesAndTypes()
void DriverMED_R_SMESHDS_Mesh::GetGroup(SMESHDS_Group* theGroup)
{
- std::string aGroupName (theGroup->GetStoreName());
+ string aGroupName (theGroup->GetStoreName());
if(MYDEBUG) MESSAGE("Get Group " << aGroupName);
- std::map::iterator aFamsIter = myFamilies.begin();
+ map::iterator aFamsIter = myFamilies.begin();
for (; aFamsIter != myFamilies.end(); aFamsIter++)
{
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
- if (aFamily->GetType() == theGroup->GetType() && aFamily->MemberOf(aGroupName))
+ if (aFamily->GetTypes().count( theGroup->GetType() ) && aFamily->MemberOf(aGroupName))
{
- const std::set& anElements = aFamily->GetElements();
- std::set::const_iterator anElemsIter = anElements.begin();
- const SMDS_MeshElement * element = 0;
+ const set& anElements = aFamily->GetElements();
+ set::const_iterator anElemsIter = anElements.begin();
for (; anElemsIter != anElements.end(); anElemsIter++)
{
- element = *anElemsIter;
- theGroup->SMDSGroup().Add(element);
- int aGroupAttrVal = aFamily->GetGroupAttributVal();
- if( aGroupAttrVal != 0)
- theGroup->SetColorGroup(aGroupAttrVal);
+ const SMDS_MeshElement * element = *anElemsIter;
+ if ( element->GetType() == theGroup->GetType() ) // Issue 0020576
+ theGroup->SMDSGroup().Add(element);
}
- if ( element )
- theGroup->SetType( theGroup->SMDSGroup().GetType() );
+ int aGroupAttrVal = aFamily->GetGroupAttributVal();
+ if( aGroupAttrVal != 0)
+ theGroup->SetColorGroup(aGroupAttrVal);
+// if ( element ) -- Issue 0020576
+// theGroup->SetType( theGroup->SMDSGroup().GetType() );
}
}
}
@@ -823,15 +826,15 @@ void DriverMED_R_SMESHDS_Mesh::GetSubMesh (SMESHDS_SubMesh* theSubMesh,
{
char submeshGrpName[ 30 ];
sprintf( submeshGrpName, "SubMesh %d", theId );
- std::string aName (submeshGrpName);
- std::map::iterator aFamsIter = myFamilies.begin();
+ string aName (submeshGrpName);
+ map::iterator aFamsIter = myFamilies.begin();
for (; aFamsIter != myFamilies.end(); aFamsIter++)
{
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
if (aFamily->MemberOf(aName))
{
- const std::set& anElements = aFamily->GetElements();
- std::set::const_iterator anElemsIter = anElements.begin();
+ const set& anElements = aFamily->GetElements();
+ set::const_iterator anElemsIter = anElements.begin();
if (aFamily->GetType() == SMDSAbs_Node)
{
for (; anElemsIter != anElements.end(); anElemsIter++)
@@ -853,21 +856,21 @@ void DriverMED_R_SMESHDS_Mesh::GetSubMesh (SMESHDS_SubMesh* theSubMesh,
void DriverMED_R_SMESHDS_Mesh::CreateAllSubMeshes ()
{
- std::map::iterator aFamsIter = myFamilies.begin();
+ map::iterator aFamsIter = myFamilies.begin();
for (; aFamsIter != myFamilies.end(); aFamsIter++)
{
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
MED::TStringSet aGroupNames = aFamily->GetGroupNames();
- std::set::iterator aGrNamesIter = aGroupNames.begin();
+ set::iterator aGrNamesIter = aGroupNames.begin();
for (; aGrNamesIter != aGroupNames.end(); aGrNamesIter++)
{
- std::string aName = *aGrNamesIter;
+ string aName = *aGrNamesIter;
// Check, if this is a Group or SubMesh name
- if (aName.substr(0, 7) == std::string("SubMesh"))
+ if (aName.substr(0, 7) == string("SubMesh"))
{
- int Id = atoi(std::string(aName).substr(7).c_str());
- std::set anElements = aFamily->GetElements();
- std::set::iterator anElemsIter = anElements.begin();
+ int Id = atoi(string(aName).substr(7).c_str());
+ set anElements = aFamily->GetElements();
+ set::iterator anElemsIter = anElements.begin();
if (aFamily->GetType() == SMDSAbs_Node)
{
for (; anElemsIter != anElements.end(); anElemsIter++)
@@ -909,7 +912,7 @@ void DriverMED_R_SMESHDS_Mesh::CreateAllSubMeshes ()
bool DriverMED_R_SMESHDS_Mesh::checkFamilyID(DriverMED_FamilyPtr & aFamily, int anID) const
{
if ( !aFamily || aFamily->GetId() != anID ) {
- std::map::const_iterator i_fam = myFamilies.find(anID);
+ map::const_iterator i_fam = myFamilies.find(anID);
if ( i_fam == myFamilies.end() )
return false;
aFamily = i_fam->second;
@@ -924,7 +927,7 @@ bool DriverMED_R_SMESHDS_Mesh::checkFamilyID(DriverMED_FamilyPtr & aFamily, int
* \return TRUE, if successfully. Else FALSE
*/
bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
- const MED::PMeshInfo& theMeshInfo)
+ const MED::PMeshInfo& theMeshInfo)
{
bool res = true;
@@ -944,10 +947,10 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
if((aGrilleInfo->myFamNumNode).size() > 0){
TInt aFamNum = aGrilleInfo->GetFamNumNode(iNode);
if ( checkFamilyID ( aFamily, aFamNum ))
- {
- aFamily->AddElement(aNode);
- aFamily->SetType(SMDSAbs_Node);
- }
+ {
+ aFamily->AddElement(aNode);
+ aFamily->SetType(SMDSAbs_Node);
+ }
}
}
@@ -959,38 +962,38 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
switch(aGrilleInfo->GetGeom()){
case MED::eSEG2:
if(aNodeIds.size() != 2){
- res = false;
- EXCEPTION(std::runtime_error,"buildMeshGrille Error. Incorrect size of ids 2!="<AddEdgeWithID(aNodeIds[0],
- aNodeIds[1],
- iCell);
+ aNodeIds[1],
+ iCell);
break;
case MED::eQUAD4:
if(aNodeIds.size() != 4){
- res = false;
- EXCEPTION(std::runtime_error,"buildMeshGrille Error. Incorrect size of ids 4!="<AddFaceWithID(aNodeIds[0],
- aNodeIds[2],
- aNodeIds[3],
- aNodeIds[1],
- iCell);
+ aNodeIds[2],
+ aNodeIds[3],
+ aNodeIds[1],
+ iCell);
break;
case MED::eHEXA8:
if(aNodeIds.size() != 8){
- res = false;
- EXCEPTION(std::runtime_error,"buildMeshGrille Error. Incorrect size of ids 8!="<AddVolumeWithID(aNodeIds[0],
- aNodeIds[2],
- aNodeIds[3],
- aNodeIds[1],
- aNodeIds[4],
- aNodeIds[6],
- aNodeIds[7],
- aNodeIds[5],
- iCell);
+ aNodeIds[2],
+ aNodeIds[3],
+ aNodeIds[1],
+ aNodeIds[4],
+ aNodeIds[6],
+ aNodeIds[7],
+ aNodeIds[5],
+ iCell);
break;
default:
break;
@@ -999,8 +1002,8 @@ bool DriverMED_R_SMESHDS_Mesh::buildMeshGrille(const MED::PWrapper& theWrapper,
if((aGrilleInfo->myFamNum).size() > 0){
TInt aFamNum = aGrilleInfo->GetFamNum(iCell);
if ( checkFamilyID ( aFamily, aFamNum )){
- aFamily->AddElement(anElement);
- aFamily->SetType(anElement->GetType());
+ aFamily->AddElement(anElement);
+ aFamily->SetType(anElement->GetType());
}
}
}
diff --git a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.h b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.h
index 2ccaa3f3d..3f63ff485 100644
--- a/src/DriverMED/DriverMED_R_SMESHDS_Mesh.h
+++ b/src/DriverMED/DriverMED_R_SMESHDS_Mesh.h
@@ -62,7 +62,7 @@ class MESHDRIVERMED_EXPORT DriverMED_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
bool checkFamilyID(DriverMED_FamilyPtr & aFamily, int anID) const;
bool buildMeshGrille(const MED::PWrapper& theWrapper,
- const MED::PMeshInfo& theMeshInfo);
+ const MED::PMeshInfo& theMeshInfo);
private:
std::string myMeshName;
diff --git a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
index 8afbd5659..9c97adb9b 100644
--- a/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
+++ b/src/DriverMED/DriverMED_W_SMESHDS_Mesh.cxx
@@ -54,7 +54,7 @@ DriverMED_W_SMESHDS_Mesh::DriverMED_W_SMESHDS_Mesh():
{}
void DriverMED_W_SMESHDS_Mesh::SetFile(const std::string& theFileName,
- MED::EVersion theId)
+ MED::EVersion theId)
{
myMed = CrWrapper(theFileName,theId);
Driver_SMESHDS_Mesh::SetFile(theFileName);
@@ -189,9 +189,9 @@ namespace{
TUnit* myUnit;
public:
TCoordHelper(const SMDS_NodeIteratorPtr& theNodeIter,
- TGetCoord* theGetCoord,
- TName* theName,
- TUnit* theUnit = aUnit):
+ TGetCoord* theGetCoord,
+ TName* theName,
+ TUnit* theUnit = aUnit):
myNodeIter(theNodeIter),
myGetCoord(theGetCoord),
myName(theName),
@@ -200,7 +200,7 @@ namespace{
virtual ~TCoordHelper(){}
bool Next(){
return myNodeIter->more() &&
- (myCurrentNode = myNodeIter->next());
+ (myCurrentNode = myNodeIter->next());
}
const SMDS_MeshNode* GetNode(){
return myCurrentNode;
@@ -352,33 +352,33 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
bool anIsYDimension = false;
bool anIsZDimension = false;
{
- SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
- double aBounds[6];
- if(aNodesIter->more()){
- const SMDS_MeshNode* aNode = aNodesIter->next();
- aBounds[0] = aBounds[1] = aNode->X();
- aBounds[2] = aBounds[3] = aNode->Y();
- aBounds[4] = aBounds[5] = aNode->Z();
- }
- while(aNodesIter->more()){
- const SMDS_MeshNode* aNode = aNodesIter->next();
- aBounds[0] = min(aBounds[0],aNode->X());
- aBounds[1] = max(aBounds[1],aNode->X());
-
- aBounds[2] = min(aBounds[2],aNode->Y());
- aBounds[3] = max(aBounds[3],aNode->Y());
-
- aBounds[4] = min(aBounds[4],aNode->Z());
- aBounds[5] = max(aBounds[5],aNode->Z());
- }
+ SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
+ double aBounds[6];
+ if(aNodesIter->more()){
+ const SMDS_MeshNode* aNode = aNodesIter->next();
+ aBounds[0] = aBounds[1] = aNode->X();
+ aBounds[2] = aBounds[3] = aNode->Y();
+ aBounds[4] = aBounds[5] = aNode->Z();
+ }
+ while(aNodesIter->more()){
+ const SMDS_MeshNode* aNode = aNodesIter->next();
+ aBounds[0] = min(aBounds[0],aNode->X());
+ aBounds[1] = max(aBounds[1],aNode->X());
+
+ aBounds[2] = min(aBounds[2],aNode->Y());
+ aBounds[3] = max(aBounds[3],aNode->Y());
+
+ aBounds[4] = min(aBounds[4],aNode->Z());
+ aBounds[5] = max(aBounds[5],aNode->Z());
+ }
- double EPS = 1.0E-7;
- anIsXDimension = (aBounds[1] - aBounds[0]) + abs(aBounds[1]) + abs(aBounds[0]) > EPS;
- anIsYDimension = (aBounds[3] - aBounds[2]) + abs(aBounds[3]) + abs(aBounds[2]) > EPS;
- anIsZDimension = (aBounds[5] - aBounds[4]) + abs(aBounds[5]) + abs(aBounds[4]) > EPS;
- aMeshDimension = anIsXDimension + anIsYDimension + anIsZDimension;
- if(!aMeshDimension)
- aMeshDimension = 3;
+ double EPS = 1.0E-7;
+ anIsXDimension = (aBounds[1] - aBounds[0]) + abs(aBounds[1]) + abs(aBounds[0]) > EPS;
+ anIsYDimension = (aBounds[3] - aBounds[2]) + abs(aBounds[3]) + abs(aBounds[2]) > EPS;
+ anIsZDimension = (aBounds[5] - aBounds[4]) + abs(aBounds[5]) + abs(aBounds[4]) > EPS;
+ aMeshDimension = anIsXDimension + anIsYDimension + anIsZDimension;
+ if(!aMeshDimension)
+ aMeshDimension = 3;
// PAL16857(SMESH not conform to the MED convention):
if ( aMeshDimension == 2 && anIsZDimension ) // 2D only if mesh is in XOY plane
aMeshDimension = 3;
@@ -395,24 +395,24 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
SMDS_NodeIteratorPtr aNodesIter = myMesh->nodesIterator();
switch(aMeshDimension){
case 3:
- aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXYZGetCoord,aXYZName));
- break;
+ aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXYZGetCoord,aXYZName));
+ break;
case 2:
- if(anIsXDimension && anIsYDimension)
- aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXYGetCoord,aXYName));
- if(anIsYDimension && anIsZDimension)
- aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aYZGetCoord,aYZName));
- if(anIsXDimension && anIsZDimension)
- aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXZGetCoord,aXZName));
- break;
+ if(anIsXDimension && anIsYDimension)
+ aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXYGetCoord,aXYName));
+ if(anIsYDimension && anIsZDimension)
+ aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aYZGetCoord,aYZName));
+ if(anIsXDimension && anIsZDimension)
+ aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXZGetCoord,aXZName));
+ break;
case 1:
- if(anIsXDimension)
- aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXGetCoord,aXName));
- if(anIsYDimension)
- aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aYGetCoord,aYName));
- if(anIsZDimension)
- aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aZGetCoord,aZName));
- break;
+ if(anIsXDimension)
+ aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aXGetCoord,aXName));
+ if(anIsYDimension)
+ aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aYGetCoord,aYName));
+ if(anIsZDimension)
+ aCoordHelperPtr.reset(new TCoordHelper(aNodesIter,aZGetCoord,aZName));
+ break;
}
}
@@ -495,7 +495,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
// coordinates
TCoordSlice aTCoordSlice = aNodeInfo->GetCoordSlice( iNode );
for(TInt iCoord = 0; iCoord < aMeshDimension; iCoord++){
- aTCoordSlice[iCoord] = aCoordHelperPtr->GetCoord(iCoord);
+ aTCoordSlice[iCoord] = aCoordHelperPtr->GetCoord(iCoord);
}
// node number
int aNodeID = aCoordHelperPtr->GetID();
diff --git a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx
index c438fa334..617cb6dfb 100644
--- a/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx
+++ b/src/DriverUNV/DriverUNV_R_SMDS_Mesh.cxx
@@ -30,6 +30,8 @@
#include "UNV2417_Structure.hxx"
#include "UNV_Utilities.hxx"
+#include
+
using namespace std;
@@ -49,6 +51,7 @@ DriverUNV_R_SMDS_Mesh::~DriverUNV_R_SMDS_Mesh()
Driver_Mesh::Status DriverUNV_R_SMDS_Mesh::Perform()
{
+ Kernel_Utils::Localizer loc;
Status aResult = DRS_OK;
std::ifstream in_stream(myFile.c_str());
try{
diff --git a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx
index 7a4da5e92..7b3a4d22b 100644
--- a/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx
+++ b/src/DriverUNV/DriverUNV_W_SMDS_Mesh.cxx
@@ -36,6 +36,8 @@
#include "UNV2417_Structure.hxx"
#include "UNV_Utilities.hxx"
+#include
+
using namespace std;
using namespace UNV;
@@ -57,6 +59,7 @@ namespace{
Driver_Mesh::Status DriverUNV_W_SMDS_Mesh::Perform()
{
+ Kernel_Utils::Localizer loc;
Status aResult = DRS_OK;
std::ofstream out_stream(myFile.c_str());
try{
diff --git a/src/DriverUNV/Makefile.am b/src/DriverUNV/Makefile.am
index ba6910285..bad160b7f 100644
--- a/src/DriverUNV/Makefile.am
+++ b/src/DriverUNV/Makefile.am
@@ -79,6 +79,7 @@ libMeshDriverUNV_la_CPPFLAGS = \
libMeshDriverUNV_la_LDFLAGS = \
../Driver/libMeshDriver.la \
+ $(KERNEL_LDFLAGS) -lSALOMEBasics \
$(CAS_KERNEL)
UNV_Test_CPPFLAGS = \
diff --git a/src/MEFISTO2/aptrte.cxx b/src/MEFISTO2/aptrte.cxx
index f1579fa3a..9d9e80c5b 100755
--- a/src/MEFISTO2/aptrte.cxx
+++ b/src/MEFISTO2/aptrte.cxx
@@ -36,7 +36,10 @@ extern "C"
MEFISTO2D_EXPORT
R
#ifdef WIN32
+ #ifdef F2C_BUILD
+ #else
__stdcall
+ #endif
#endif
areteideale()//( R3 xyz, R3 direction )
{
@@ -52,8 +55,11 @@ static double cpunew, cpuold=0;
void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
#endif
+#endif
tempscpu_( double & tempsec )
//Retourne le temps CPU utilise en secondes
{
@@ -64,8 +70,11 @@ tempscpu_( double & tempsec )
void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
#endif
+#endif
deltacpu_( R & dtcpu )
//Retourne le temps CPU utilise en secondes depuis le precedent appel
{
@@ -744,7 +753,10 @@ void aptrte( Z nutysu, R aretmx,
}
void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
qualitetrte( R3 *mnpxyd,
Z & mosoar, Z & mxsoar, Z *mnsoar,
diff --git a/src/MEFISTO2/aptrte.h b/src/MEFISTO2/aptrte.h
index 68fb0e63a..a1f11cb80 100755
--- a/src/MEFISTO2/aptrte.h
+++ b/src/MEFISTO2/aptrte.h
@@ -156,7 +156,10 @@ MEFISTO2D_EXPORT
extern "C" { void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
qualitetrte( R3 *mnpxyd,
Z & mosoar, Z & mxsoar, Z *mnsoar,
@@ -193,7 +196,10 @@ extern "C" { void
extern "C" { void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
tempscpu( double & tempsec );
}
@@ -202,7 +208,10 @@ extern "C" { void
extern "C" { void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
deltacpu( R & dtcpu );
}
@@ -212,7 +221,10 @@ extern "C" { void
//initialiser le tableau mnsoar pour le hachage des aretes
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
insoar( Z & mxsomm, Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar );
}
@@ -220,14 +232,20 @@ extern "C" {void
//mettre a zero les nb entiers de tab
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
azeroi( Z & nb, Z * tab );
}
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
fasoar( Z & ns1, Z & ns2, Z & nt1, Z & nt2, Z & nolign,
Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar, Z * mnarst,
@@ -279,7 +297,10 @@ extern "C" {void
//initialisation du tableau letree et ajout dans letree des sommets 1 a nbsomm
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
teajte( Z & mxsomm, Z & nbsomm, R3 * mnpxyd, R3 * comxmi,
R & aretmx, Z & mxtree, Z * letree,
@@ -288,7 +309,10 @@ extern "C" {void
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
tehote( Z & nutysu, Z & nbarpi, Z & mxsomm, Z & nbsomm, R3 * mnpxyd,
R3 * comxmi, R & aretmx,
@@ -300,7 +324,10 @@ extern "C" {void
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
tetrte( R3 * comxmi, R & aretmx, Z & nbarpi, Z & mxsomm, R3 * mnpxyd,
Z & mxqueu, Z * mnqueu, Z * mntree,
@@ -313,7 +340,10 @@ extern "C" {void
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
aisoar( Z & mosoar, Z & mxsoar, Z * mnsoar, Z & na );
}
@@ -321,7 +351,10 @@ extern "C" {void
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
tedela( R3 * mnpxyd, Z * mnarst,
Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar, Z & na,
@@ -332,7 +365,10 @@ extern "C" {void
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
terefr( Z & nbarpi, R3 * mnpxyd,
Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
@@ -346,7 +382,10 @@ extern "C" {void
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
tesuex( Z & nblf, Z * nulftr,
Z & ndtri0, Z & nbsomm, R3 * mnpxyd, Z * mnslig,
@@ -358,7 +397,10 @@ extern "C" {void
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
teamqt( Z & nutysu, R & aretmx, R & airemx,
Z * mnarst, Z & mosoar, Z & mxsoar, Z & n1soar, Z * mnsoar,
@@ -377,7 +419,10 @@ extern "C" {void
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
nusotr( Z & nt, Z & mosoar, Z * mnsoar, Z & moartr, Z * mnartr,Z * nosotr );
}
@@ -385,7 +430,10 @@ extern "C" {void
extern "C" {void
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
qutr2d( R3 & p1, R3 & p2, R3 & p3, R & qualite );
}
@@ -393,7 +441,10 @@ extern "C" {void
extern "C" { R
#ifdef WIN32
+#ifdef F2C_BUILD
+#else
__stdcall
+#endif
#endif
surtd2( R3 & p1, R3 & p2, R3 & p3 );
}
diff --git a/src/OBJECT/Makefile.am b/src/OBJECT/Makefile.am
index 30a2e591a..9a04613b3 100644
--- a/src/OBJECT/Makefile.am
+++ b/src/OBJECT/Makefile.am
@@ -36,7 +36,6 @@ salomeinclude_HEADERS = \
SMESH_DeviceActor.h \
SMESH_PreviewActorsCollection.h \
SMESH_ExtractGeometry.h \
- SMESH_ActorUtils.h \
SMESH_FaceOrientationFilter.h
# Libraries targets
@@ -77,5 +76,6 @@ libSMESHObject_la_LDFLAGS = \
../SMDS/libSMDS.la \
../Controls/libSMESHControls.la \
$(GUI_LDFLAGS) -lSalomeApp -lSalomeObject -lSVTK -lVTKViewer -lqtx -lsuit \
+ $(GEOM_LDFLAGS) -lGEOMObject \
$(CAS_KERNEL) \
$(VTK_LIBS) $(QT_MT_LIBS)
diff --git a/src/OBJECT/SMESH_Actor.cxx b/src/OBJECT/SMESH_Actor.cxx
index 4709f9357..7a37d6541 100644
--- a/src/OBJECT/SMESH_Actor.cxx
+++ b/src/OBJECT/SMESH_Actor.cxx
@@ -72,6 +72,11 @@
#include
#include
+#include
+#if !defined(VTK_XVERSION)
+#define VTK_XVERSION (VTK_MAJOR_VERSION<<16)+(VTK_MINOR_VERSION<<8)+(VTK_BUILD_VERSION)
+#endif
+
#include "utilities.h"
#ifdef _DEBUG_
@@ -90,9 +95,9 @@ SMESH_ActorDef* SMESH_ActorDef::New(){
SMESH_Actor* SMESH_Actor::New(TVisualObjPtr theVisualObj,
- const char* theEntry,
- const char* theName,
- int theIsClear)
+ const char* theEntry,
+ const char* theName,
+ int theIsClear)
{
SMESH_ActorDef* anActor = SMESH_ActorDef::New();
if(!anActor->Init(theVisualObj,theEntry,theName,theIsClear)){
@@ -399,7 +404,11 @@ SMESH_ActorDef::SMESH_ActorDef()
myPtsLabeledDataMapper = vtkLabeledDataMapper::New();
myPtsLabeledDataMapper->SetInput(myPtsSelectVisiblePoints->GetOutput());
+#if (VTK_XVERSION >= 0x050200)
+ myPtsLabeledDataMapper->SetLabelFormat("%d");
+#else
myPtsLabeledDataMapper->SetLabelFormat("%g");
+#endif
myPtsLabeledDataMapper->SetLabelModeToLabelScalars();
vtkTextProperty* aPtsTextProp = vtkTextProperty::New();
@@ -440,7 +449,11 @@ SMESH_ActorDef::SMESH_ActorDef()
myClsLabeledDataMapper = vtkLabeledDataMapper::New();
myClsLabeledDataMapper->SetInput(myClsSelectVisiblePoints->GetOutput());
+#if (VTK_XVERSION >= 0x050200)
+ myClsLabeledDataMapper->SetLabelFormat("%d");
+#else
myClsLabeledDataMapper->SetLabelFormat("%g");
+#endif
myClsLabeledDataMapper->SetLabelModeToLabelScalars();
vtkTextProperty* aClsTextProp = vtkTextProperty::New();
@@ -593,7 +606,7 @@ void SMESH_ActorDef::SetPointsLabeled( bool theIsPointsLabeled )
vtkIntArray *anArray = vtkIntArray::New();
anArray->SetNumberOfValues( aNbElem );
- for ( int anId = 0; anId < aNbElem; anId++ )
+ for ( vtkIdType anId = 0; anId < aNbElem; anId++ )
{
int aSMDSId = myVisualObj->GetNodeObjId( anId );
anArray->SetValue( anId, aSMDSId );
@@ -664,7 +677,7 @@ SetControlMode(eControl theMode)
void
SMESH_ActorDef::
SetControlMode(eControl theMode,
- bool theCheckEntityMode)
+ bool theCheckEntityMode)
{
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
if( !mgr )
@@ -796,41 +809,41 @@ SetControlMode(eControl theMode,
myControlMode = theMode;
switch(myControlMode){
case eFreeNodes:
- myNodeExtActor->SetExtControlMode(aFunctor);
- break;
+ myNodeExtActor->SetExtControlMode(aFunctor);
+ break;
case eFreeEdges:
case eFreeBorders:
- my1DExtActor->SetExtControlMode(aFunctor);
- break;
+ my1DExtActor->SetExtControlMode(aFunctor);
+ break;
case eFreeFaces:
- my2DExtActor->SetExtControlMode(aFunctor);
- break;
+ my2DExtActor->SetExtControlMode(aFunctor);
+ break;
case eLength2D:
case eMultiConnection2D:
- my1DExtActor->SetExtControlMode(aFunctor,myScalarBarActor,myLookupTable);
- break;
+ my1DExtActor->SetExtControlMode(aFunctor,myScalarBarActor,myLookupTable);
+ break;
default:
- myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable);
+ myControlActor->SetControlMode(aFunctor,myScalarBarActor,myLookupTable);
}
}
if(theCheckEntityMode){
if(myControlActor == my1DActor)
- SetEntityMode(eEdges);
+ SetEntityMode(eEdges);
else if(myControlActor == my2DActor){
- switch(myControlMode){
- case eLength2D:
- case eFreeEdges:
- case eFreeFaces:
- case eMultiConnection2D:
- //SetEntityMode(eEdges);
- SetEntityMode(eFaces);
- break;
- default:
- SetEntityMode(eFaces);
- }
+ switch(myControlMode){
+ case eLength2D:
+ case eFreeEdges:
+ case eFreeFaces:
+ case eMultiConnection2D:
+ //SetEntityMode(eEdges);
+ SetEntityMode(eFaces);
+ break;
+ default:
+ SetEntityMode(eFaces);
+ }
}else if(myControlActor == my3DActor)
- SetEntityMode(eVolumes);
+ SetEntityMode(eVolumes);
}
}else if(theCheckEntityMode){
@@ -900,9 +913,9 @@ void SMESH_ActorDef::RemoveFromRender(vtkRenderer* theRenderer){
bool SMESH_ActorDef::Init(TVisualObjPtr theVisualObj,
- const char* theEntry,
- const char* theName,
- int theIsClear)
+ const char* theEntry,
+ const char* theName,
+ int theIsClear)
{
Handle(SALOME_InteractiveObject) anIO = new SALOME_InteractiveObject(theEntry,"SMESH",theName);
setIO(anIO);
@@ -1034,8 +1047,8 @@ bool SMESH_ActorDef::IsInfinitive(){
vtkDataSet *aDataSet = myPickableActor->GetUnstructuredGrid();
aDataSet->Update();
myIsInfinite = aDataSet->GetNumberOfCells() == 0 ||
- aDataSet->GetNumberOfCells() == 1 &&
- aDataSet->GetCell(0)->GetCellType() == VTK_VERTEX;
+ ( aDataSet->GetNumberOfCells() == 1 &&
+ aDataSet->GetCell(0)->GetCellType() == VTK_VERTEX );
return SALOME_Actor::IsInfinitive();
}
@@ -1149,21 +1162,21 @@ void SMESH_ActorDef::SetVisibility(int theMode, bool theIsUpdateRepersentation){
if(myControlMode != eNone){
switch(myControlMode){
case eFreeNodes:
- myNodeExtActor->VisibilityOn();
- break;
+ myNodeExtActor->VisibilityOn();
+ break;
case eFreeEdges:
case eFreeBorders:
- my1DExtActor->VisibilityOn();
- break;
+ my1DExtActor->VisibilityOn();
+ break;
case eFreeFaces:
- my2DExtActor->VisibilityOn();
- break;
+ my2DExtActor->VisibilityOn();
+ break;
case eLength2D:
case eMultiConnection2D:
- my1DExtActor->VisibilityOn();
+ my1DExtActor->VisibilityOn();
default:
- if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
- myScalarBarActor->VisibilityOn();
+ if(myControlActor->GetUnstructuredGrid()->GetNumberOfCells())
+ myScalarBarActor->VisibilityOn();
}
}
@@ -1250,7 +1263,11 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
VTKViewer_ExtractUnstructuredGrid* aHightFilter = myHighlitableActor->GetExtractUnstructuredGrid();
aHightFilter->ClearRegisteredCellsWithType();
- aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
+
+ // The following row has been commented (initially added in 1.28.2.3.1 revision)
+ // Reason: seems to be unnecessary, this filter should always have default (ePassAll) mode of changing
+ // In addition, it leads to exception (see bug IPAL21372)
+ //aHightFilter->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
if (myEntityMode & e0DElements) {
if (MYDEBUG) MESSAGE("0D ELEMENTS");
@@ -1458,12 +1475,12 @@ void SMESH_ActorDef::UpdateHighlight(){
myHighlitableActor->SetHighlited(anIsVisible);
myHighlitableActor->SetVisibility(anIsVisible);
myHighlitableActor->GetExtractUnstructuredGrid()->
- SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells);
+ SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::eCells);
myHighlitableActor->SetRepresentation(SMESH_DeviceActor::eWireframe);
}else if(myRepresentation == ePoint || GetPointRepresentation()){
myHighlitableActor->SetHighlited(anIsVisible);
myHighlitableActor->GetExtractUnstructuredGrid()->
- SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
+ SetModeOfExtraction(VTKViewer_ExtractUnstructuredGrid::ePoints);
myHighlitableActor->SetVisibility(anIsVisible);
myHighlitableActor->SetRepresentation(SMESH_DeviceActor::ePoint);
}
@@ -1581,7 +1598,7 @@ void SMESH_ActorDef::SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType
mySurfaceProp->SetColor(r,g,b);
if( SMESH_GroupObj* aGroupObj = dynamic_cast( myVisualObj.get() ) )
if( aGroupObj->GetElementType() == SMDSAbs_Face ||
- aGroupObj->GetElementType() == SMDSAbs_Volume )
+ aGroupObj->GetElementType() == SMDSAbs_Volume )
myNameActor->SetBackgroundColor(r,g,b);
Modified();
}
@@ -1754,8 +1771,8 @@ GetClippingPlane(vtkIdType theID)
static void ComputeBoundsParam(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3], vtkFloatingPointType theMinPnt[3],
- vtkFloatingPointType& theMaxBoundPrj, vtkFloatingPointType& theMinBoundPrj)
+ vtkFloatingPointType theDirection[3], vtkFloatingPointType theMinPnt[3],
+ vtkFloatingPointType& theMaxBoundPrj, vtkFloatingPointType& theMinBoundPrj)
{
vtkFloatingPointType aBounds[6];
theDataSet->GetBounds(aBounds);
@@ -1769,13 +1786,13 @@ static void ComputeBoundsParam(vtkDataSet* theDataSet,
}
vtkFloatingPointType aBoundPoints[8][3] = { {aBounds[0],aBounds[2],aBounds[4]},
- {aBounds[1],aBounds[2],aBounds[4]},
- {aBounds[0],aBounds[3],aBounds[4]},
- {aBounds[1],aBounds[3],aBounds[4]},
- {aBounds[0],aBounds[2],aBounds[5]},
- {aBounds[1],aBounds[2],aBounds[5]},
- {aBounds[0],aBounds[3],aBounds[5]},
- {aBounds[1],aBounds[3],aBounds[5]}};
+ {aBounds[1],aBounds[2],aBounds[4]},
+ {aBounds[0],aBounds[3],aBounds[4]},
+ {aBounds[1],aBounds[3],aBounds[4]},
+ {aBounds[0],aBounds[2],aBounds[5]},
+ {aBounds[1],aBounds[2],aBounds[5]},
+ {aBounds[0],aBounds[3],aBounds[5]},
+ {aBounds[1],aBounds[3],aBounds[5]}};
int aMaxId = 0, aMinId = aMaxId;
theMaxBoundPrj = vtkMath::Dot(theDirection,aBoundPoints[aMaxId]);
@@ -1799,7 +1816,7 @@ static void ComputeBoundsParam(vtkDataSet* theDataSet,
static void DistanceToPosition(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3], vtkFloatingPointType theDist, vtkFloatingPointType thePos[3])
+ vtkFloatingPointType theDirection[3], vtkFloatingPointType theDist, vtkFloatingPointType thePos[3])
{
vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj);
@@ -1811,7 +1828,7 @@ static void DistanceToPosition(vtkDataSet* theDataSet,
static void PositionToDistance(vtkDataSet* theDataSet,
- vtkFloatingPointType theDirection[3], vtkFloatingPointType thePos[3], vtkFloatingPointType& theDist)
+ vtkFloatingPointType theDirection[3], vtkFloatingPointType thePos[3], vtkFloatingPointType& theDist)
{
vtkFloatingPointType aMaxBoundPrj, aMinBoundPrj, aMinPnt[3];
ComputeBoundsParam(theDataSet,theDirection,aMinPnt,aMaxBoundPrj,aMinBoundPrj);
diff --git a/src/OBJECT/SMESH_Actor.h b/src/OBJECT/SMESH_Actor.h
index 99005dcf1..89f4fc51a 100644
--- a/src/OBJECT/SMESH_Actor.h
+++ b/src/OBJECT/SMESH_Actor.h
@@ -44,9 +44,9 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
public:
vtkTypeMacro(SMESH_Actor,SALOME_Actor);
static SMESH_Actor* New(TVisualObjPtr theVisualObj,
- const char* theEntry,
- const char* theName,
- int theIsClear);
+ const char* theEntry,
+ const char* theName,
+ int theIsClear);
virtual void SetSufaceColor(vtkFloatingPointType r,vtkFloatingPointType g,vtkFloatingPointType b) = 0;
virtual void GetSufaceColor(vtkFloatingPointType& r,vtkFloatingPointType& g,vtkFloatingPointType& b) = 0;
@@ -102,7 +102,7 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
enum eControl{eNone, eLength, eLength2D, eFreeBorders, eFreeEdges, eFreeNodes,
eFreeFaces, eMultiConnection, eArea, eTaper, eAspectRatio,
- eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D};
+ eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D};
virtual void SetControlMode(eControl theMode) = 0;
virtual eControl GetControlMode() = 0;
diff --git a/src/OBJECT/SMESH_ActorDef.h b/src/OBJECT/SMESH_ActorDef.h
index dbbe0a5bb..98f87fd04 100644
--- a/src/OBJECT/SMESH_ActorDef.h
+++ b/src/OBJECT/SMESH_ActorDef.h
@@ -272,9 +272,9 @@ class SMESH_ActorDef : public SMESH_Actor
~SMESH_ActorDef();
bool Init(TVisualObjPtr theVisualObj,
- const char* theEntry,
- const char* theName,
- int theIsClear);
+ const char* theEntry,
+ const char* theName,
+ int theIsClear);
void SetIsShrunkable(bool theShrunkable);
void UpdateHighlight();
diff --git a/src/OBJECT/SMESH_ActorUtils.cxx b/src/OBJECT/SMESH_ActorUtils.cxx
index c8fcbfe24..872a30acd 100644
--- a/src/OBJECT/SMESH_ActorUtils.cxx
+++ b/src/OBJECT/SMESH_ActorUtils.cxx
@@ -41,7 +41,7 @@ namespace SMESH
vtkFloatingPointType
GetFloat( const QString& theValue,
- vtkFloatingPointType theDefault )
+ vtkFloatingPointType theDefault )
{
int pos = theValue.indexOf( ":" );
vtkFloatingPointType val = theDefault;
@@ -50,15 +50,15 @@ namespace SMESH
QString name = theValue.right( theValue.length()-pos-1 ),
sect = theValue.left( pos );
if( !name.isEmpty() && !sect.isEmpty() )
- val = GetFloat( name, sect, theDefault );
+ val = GetFloat( name, sect, theDefault );
}
return val;
}
vtkFloatingPointType
GetFloat( const QString& theValue,
- const QString& theSection,
- vtkFloatingPointType theDefault )
+ const QString& theSection,
+ vtkFloatingPointType theDefault )
{
vtkFloatingPointType val = theDefault;
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
@@ -70,7 +70,7 @@ namespace SMESH
void
WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid,
- const char* theFileName)
+ const char* theFileName)
{
vtkUnstructuredGridWriter* aWriter = vtkUnstructuredGridWriter::New();
aWriter->SetFileName(theFileName);
@@ -83,8 +83,8 @@ namespace SMESH
QColor
GetColor( const QString& theSect,
- const QString& theName,
- const QColor& def )
+ const QString& theName,
+ const QColor& def )
{
QColor c = def;
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
@@ -95,11 +95,11 @@ namespace SMESH
void
GetColor( const QString& theSect,
- const QString& theName,
- int& r,
- int& g,
- int& b,
- const QColor& def )
+ const QString& theName,
+ int& r,
+ int& g,
+ int& b,
+ const QColor& def )
{
QColor c = def;
SUIT_ResourceMgr* mgr = SUIT_Session::session()->resourceMgr();
@@ -111,11 +111,11 @@ namespace SMESH
void
GetColor( const QString& theSect,
- const QString& theName,
- vtkFloatingPointType& r,
- vtkFloatingPointType& g,
- vtkFloatingPointType& b,
- const QColor& def )
+ const QString& theName,
+ vtkFloatingPointType& r,
+ vtkFloatingPointType& g,
+ vtkFloatingPointType& b,
+ const QColor& def )
{
int ir( 0 ), ig( 0 ), ib( 0 );
GetColor( theSect, theName, ir, ig, ib, def );
diff --git a/src/OBJECT/SMESH_ActorUtils.h b/src/OBJECT/SMESH_ActorUtils.h
index a494f743b..69451fcac 100644
--- a/src/OBJECT/SMESH_ActorUtils.h
+++ b/src/OBJECT/SMESH_ActorUtils.h
@@ -33,42 +33,42 @@ namespace SMESH
SMESHOBJECT_EXPORT
vtkFloatingPointType
GetFloat( const QString& theValue,
- vtkFloatingPointType theDefault = 0 );
+ vtkFloatingPointType theDefault = 0 );
SMESHOBJECT_EXPORT
vtkFloatingPointType
GetFloat( const QString& theName,
- const QString& theSection,
- vtkFloatingPointType theDefault = 0 );
+ const QString& theSection,
+ vtkFloatingPointType theDefault = 0 );
SMESHOBJECT_EXPORT
QColor
GetColor( const QString& theSect,
- const QString& theName,
- const QColor& = QColor() );
+ const QString& theName,
+ const QColor& = QColor() );
SMESHOBJECT_EXPORT
void
GetColor( const QString& theSect,
- const QString& theName,
- int&,
- int&,
- int&,
- const QColor& = QColor() );
+ const QString& theName,
+ int&,
+ int&,
+ int&,
+ const QColor& = QColor() );
SMESHOBJECT_EXPORT
void
GetColor( const QString& theSect,
- const QString& theName,
- vtkFloatingPointType&,
- vtkFloatingPointType&,
- vtkFloatingPointType&,
- const QColor& = QColor() );
+ const QString& theName,
+ vtkFloatingPointType&,
+ vtkFloatingPointType&,
+ vtkFloatingPointType&,
+ const QColor& = QColor() );
SMESHOBJECT_EXPORT
void
WriteUnstructuredGrid(vtkUnstructuredGrid* theGrid,
- const char* theFileName);
+ const char* theFileName);
}
diff --git a/src/OBJECT/SMESH_DeviceActor.cxx b/src/OBJECT/SMESH_DeviceActor.cxx
index 2a657eb34..4d0626902 100644
--- a/src/OBJECT/SMESH_DeviceActor.cxx
+++ b/src/OBJECT/SMESH_DeviceActor.cxx
@@ -91,7 +91,7 @@ SMESH_DeviceActor
myMapper = vtkPolyDataMapper::New();
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
- myPolygonOffsetUnits);
+ myPolygonOffsetUnits);
myMapper->UseLookupTableScalarRangeOn();
myMapper->SetColorModeToMapScalars();
@@ -281,8 +281,8 @@ SMESH_DeviceActor
void
SMESH_DeviceActor
::SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
- vtkScalarBarActor* theScalarBarActor,
- vtkLookupTable* theLookupTable)
+ vtkScalarBarActor* theScalarBarActor,
+ vtkLookupTable* theLookupTable)
{
bool anIsInitialized = theFunctor;
if(anIsInitialized){
@@ -304,23 +304,23 @@ SMESH_DeviceActor
using namespace SMESH::Controls;
if(NumericalFunctor* aNumericalFunctor = dynamic_cast(theFunctor.get())){
for(vtkIdType i = 0; i < aNbCells; i++){
- vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
- vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
- double aValue = aNumericalFunctor->GetValue(anObjId);
- aScalars->SetValue(i,aValue);
+ vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
+ vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
+ double aValue = aNumericalFunctor->GetValue(anObjId);
+ aScalars->SetValue(i,aValue);
}
}else if(Predicate* aPredicate = dynamic_cast(theFunctor.get())){
for(vtkIdType i = 0; i < aNbCells; i++){
- vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
- vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
- bool aValue = aPredicate->IsSatisfy(anObjId);
- aScalars->SetValue(i,aValue);
+ vtkIdType anId = myExtractUnstructuredGrid->GetInputId(i);
+ vtkIdType anObjId = myVisualObj->GetElemObjId(anId);
+ bool aValue = aPredicate->IsSatisfy(anObjId);
+ aScalars->SetValue(i,aValue);
}
}
aDataSet->GetCellData()->SetScalars(aScalars);
aScalars->Delete();
-
+
theLookupTable->SetRange(aScalars->GetRange());
theLookupTable->SetNumberOfTableValues(theScalarBarActor->GetMaximumNumberOfColors());
theLookupTable->Build();
@@ -335,8 +335,8 @@ SMESH_DeviceActor
void
SMESH_DeviceActor
::SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
- vtkScalarBarActor* theScalarBarActor,
- vtkLookupTable* theLookupTable)
+ vtkScalarBarActor* theScalarBarActor,
+ vtkLookupTable* theLookupTable)
{
bool anIsInitialized = theFunctor;
myExtractUnstructuredGrid->ClearRegisteredCells();
@@ -374,18 +374,18 @@ SMESH_DeviceActor
Length2D::TValues::const_iterator anIter = aValues.begin();
for(vtkIdType aVtkId = 0; anIter != aValues.end(); anIter++,aVtkId++){
- const Length2D::Value& aValue = *anIter;
- int aNode[2] = {
- myVisualObj->GetNodeVTKId(aValue.myPntId[0]),
- myVisualObj->GetNodeVTKId(aValue.myPntId[1])
- };
- if(aNode[0] >= 0 && aNode[1] >= 0){
- anIdList->SetId( 0, aNode[0] );
- anIdList->SetId( 1, aNode[1] );
- aConnectivity->InsertNextCell( anIdList );
- aCellTypesArray->InsertNextValue( VTK_LINE );
- aScalars->SetValue(aVtkId,aValue.myLength);
- }
+ const Length2D::Value& aValue = *anIter;
+ int aNode[2] = {
+ myVisualObj->GetNodeVTKId(aValue.myPntId[0]),
+ myVisualObj->GetNodeVTKId(aValue.myPntId[1])
+ };
+ if(aNode[0] >= 0 && aNode[1] >= 0){
+ anIdList->SetId( 0, aNode[0] );
+ anIdList->SetId( 1, aNode[1] );
+ aConnectivity->InsertNextCell( anIdList );
+ aCellTypesArray->InsertNextValue( VTK_LINE );
+ aScalars->SetValue(aVtkId,aValue.myLength);
+ }
}
VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
@@ -394,7 +394,7 @@ SMESH_DeviceActor
aConnectivity->InitTraversal();
for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
- aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
+ aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
aDataSet->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
SetUnstructuredGrid(aDataSet);
@@ -434,18 +434,18 @@ SMESH_DeviceActor
MultiConnection2D::MValues::const_iterator anIter = aValues.begin();
for(vtkIdType aVtkId = 0; anIter != aValues.end(); anIter++,aVtkId++){
- const MultiConnection2D::Value& aValue = (*anIter).first;
- int aNode[2] = {
- myVisualObj->GetNodeVTKId(aValue.myPntId[0]),
- myVisualObj->GetNodeVTKId(aValue.myPntId[1])
- };
- if(aNode[0] >= 0 && aNode[1] >= 0){
- anIdList->SetId( 0, aNode[0] );
- anIdList->SetId( 1, aNode[1] );
- aConnectivity->InsertNextCell( anIdList );
- aCellTypesArray->InsertNextValue( VTK_LINE );
- aScalars->SetValue(aVtkId,(*anIter).second);
- }
+ const MultiConnection2D::Value& aValue = (*anIter).first;
+ int aNode[2] = {
+ myVisualObj->GetNodeVTKId(aValue.myPntId[0]),
+ myVisualObj->GetNodeVTKId(aValue.myPntId[1])
+ };
+ if(aNode[0] >= 0 && aNode[1] >= 0){
+ anIdList->SetId( 0, aNode[0] );
+ anIdList->SetId( 1, aNode[1] );
+ aConnectivity->InsertNextCell( anIdList );
+ aCellTypesArray->InsertNextValue( VTK_LINE );
+ aScalars->SetValue(aVtkId,(*anIter).second);
+ }
}
VTKViewer_CellLocationsArray* aCellLocationsArray = VTKViewer_CellLocationsArray::New();
@@ -454,7 +454,7 @@ SMESH_DeviceActor
aConnectivity->InitTraversal();
for( vtkIdType idType = 0, *pts, npts; aConnectivity->GetNextCell( npts, pts ); idType++ )
- aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
+ aCellLocationsArray->SetValue( idType, aConnectivity->GetTraversalLocation( npts ) );
aDataSet->SetCells( aCellTypesArray, aCellLocationsArray,aConnectivity );
SetUnstructuredGrid(aDataSet);
@@ -492,7 +492,7 @@ SMESH_DeviceActor
for( vtkIdType i = 0; i < aNbCells; i++ ){
vtkIdType anObjId = myVisualObj->GetElemObjId(i);
if(aFreePredicate->IsSatisfy(anObjId))
- myExtractUnstructuredGrid->RegisterCell(i);
+ myExtractUnstructuredGrid->RegisterCell(i);
}
if(!myExtractUnstructuredGrid->IsCellsRegistered())
myExtractUnstructuredGrid->RegisterCell(-1);
@@ -520,15 +520,15 @@ SMESH_DeviceActor
for(; anIter != aBorders.end(); anIter++){
const FreeEdges::Border& aBorder = *anIter;
int aNode[2] = {
- myVisualObj->GetNodeVTKId(aBorder.myPntId[0]),
- myVisualObj->GetNodeVTKId(aBorder.myPntId[1])
+ myVisualObj->GetNodeVTKId(aBorder.myPntId[0]),
+ myVisualObj->GetNodeVTKId(aBorder.myPntId[1])
};
//cout<<"aNode = "<= 0 && aNode[1] >= 0){
- anIdList->SetId( 0, aNode[0] );
- anIdList->SetId( 1, aNode[1] );
- aConnectivity->InsertNextCell( anIdList );
- aCellTypesArray->InsertNextValue( VTK_LINE );
+ anIdList->SetId( 0, aNode[0] );
+ anIdList->SetId( 1, aNode[1] );
+ aConnectivity->InsertNextCell( anIdList );
+ aCellTypesArray->InsertNextValue( VTK_LINE );
}
}
@@ -546,12 +546,11 @@ SMESH_DeviceActor
aDataSet->Delete();
}else if(FreeNodes* aFreeNodes = dynamic_cast(theFunctor.get())){
myExtractUnstructuredGrid->SetModeOfChanging(VTKViewer_ExtractUnstructuredGrid::eAdding);
- vtkUnstructuredGrid* aGrid = myVisualObj->GetUnstructuredGrid();
vtkIdType aNbNodes = myVisualObj->GetNbEntities(SMDSAbs_Node);
for( vtkIdType i = 0; i < aNbNodes; i++ ){
vtkIdType anObjId = myVisualObj->GetNodeObjId(i);
if(aFreeNodes->IsSatisfy(anObjId))
- myExtractUnstructuredGrid->RegisterCell(i);
+ myExtractUnstructuredGrid->RegisterCell(i);
}
if(!myExtractUnstructuredGrid->IsCellsRegistered())
myExtractUnstructuredGrid->RegisterCell(-1);
@@ -828,7 +827,7 @@ SMESH_DeviceActor
void
SMESH_DeviceActor
::SetPolygonOffsetParameters(vtkFloatingPointType factor,
- vtkFloatingPointType units)
+ vtkFloatingPointType units)
{
myPolygonOffsetFactor = factor;
myPolygonOffsetUnits = units;
diff --git a/src/OBJECT/SMESH_DeviceActor.h b/src/OBJECT/SMESH_DeviceActor.h
index 218050160..0b9acb48f 100644
--- a/src/OBJECT/SMESH_DeviceActor.h
+++ b/src/OBJECT/SMESH_DeviceActor.h
@@ -109,11 +109,11 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
vtkUnstructuredGrid* GetUnstructuredGrid();
void SetControlMode(SMESH::Controls::FunctorPtr theFunctor,
- vtkScalarBarActor* theScalarBarActor,
- vtkLookupTable* theLookupTable);
+ vtkScalarBarActor* theScalarBarActor,
+ vtkLookupTable* theLookupTable);
void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor,
- vtkScalarBarActor* theScalarBarActor,
- vtkLookupTable* theLookupTable);
+ vtkScalarBarActor* theScalarBarActor,
+ vtkLookupTable* theLookupTable);
void SetExtControlMode(SMESH::Controls::FunctorPtr theFunctor);
bool IsHighlited() { return myIsHighlited;}
@@ -161,11 +161,11 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
void
SetPolygonOffsetParameters(vtkFloatingPointType factor,
- vtkFloatingPointType units);
+ vtkFloatingPointType units);
void
GetPolygonOffsetParameters(vtkFloatingPointType& factor,
- vtkFloatingPointType& units)
+ vtkFloatingPointType& units)
{
factor = myPolygonOffsetFactor;
units = myPolygonOffsetUnits;
diff --git a/src/OBJECT/SMESH_ExtractGeometry.cxx b/src/OBJECT/SMESH_ExtractGeometry.cxx
index 0376aba38..c7c63af36 100644
--- a/src/OBJECT/SMESH_ExtractGeometry.cxx
+++ b/src/OBJECT/SMESH_ExtractGeometry.cxx
@@ -152,7 +152,7 @@ int SMESH_ExtractGeometry::RequestData(
{
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- myNodeVTK2ObjIds.push_back(ptId);
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
}
@@ -175,7 +175,7 @@ int SMESH_ExtractGeometry::RequestData(
{
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- myNodeVTK2ObjIds.push_back(ptId);
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
}
@@ -228,7 +228,7 @@ int SMESH_ExtractGeometry::RequestData(
x = input->GetPoint(ptId);
newId = newPts->InsertNextPoint(x);
pointMap[ptId] = newId;
- myNodeVTK2ObjIds.push_back(ptId);
+ myNodeVTK2ObjIds.push_back(ptId);
outputPD->CopyData(pd,ptId,newId);
}
newCellPts->InsertId(i,pointMap[ptId]);
diff --git a/src/OBJECT/SMESH_FaceOrientationFilter.cxx b/src/OBJECT/SMESH_FaceOrientationFilter.cxx
index a7f5d1d94..cf09779d0 100644
--- a/src/OBJECT/SMESH_FaceOrientationFilter.cxx
+++ b/src/OBJECT/SMESH_FaceOrientationFilter.cxx
@@ -209,8 +209,8 @@ void GetFaceParams( vtkCell* theFace, double theNormal[3], double& theSize )
double* aBounds = theFace->GetBounds();
theSize = pow( pow( aBounds[1] - aBounds[0], 2 ) +
- pow( aBounds[3] - aBounds[2], 2 ) +
- pow( aBounds[5] - aBounds[4], 2 ), 0.5 );
+ pow( aBounds[3] - aBounds[2], 2 ) +
+ pow( aBounds[5] - aBounds[4], 2 ), 0.5 );
}
/*!
@@ -268,7 +268,7 @@ int SMESH_FaceOrientationFilter::RequestData(
input->GetCellNeighbors( aCellId, aFace->PointIds, aNeighborIds );
if( aNeighborIds->GetNumberOfIds() > 0 )
- continue;
+ continue;
double aSize, aNormal[3];
GetFaceParams( aFace, aNormal, aSize );
diff --git a/src/OBJECT/SMESH_Object.cxx b/src/OBJECT/SMESH_Object.cxx
index 5f12330ef..e7ef139a4 100644
--- a/src/OBJECT/SMESH_Object.cxx
+++ b/src/OBJECT/SMESH_Object.cxx
@@ -46,7 +46,7 @@
#include
#include
-#include
+#include
#include
#include
@@ -81,7 +81,7 @@ static int MYDEBUGWITHFILES = 0;
// purpose : Get type of VTK cell
//=================================================================================
static inline vtkIdType getCellType( const SMDSAbs_ElementType theType,
- const bool thePoly,
+ const bool thePoly,
const int theNbNodes )
{
switch( theType )
@@ -263,7 +263,7 @@ namespace{
typedef std::vector TConnect;
int GetConnect(const SMDS_ElemIteratorPtr& theNodesIter,
- TConnect& theConnect)
+ TConnect& theConnect)
{
theConnect.clear();
for(; theNodesIter->more();)
@@ -273,10 +273,10 @@ namespace{
inline
void SetId(vtkIdList *theIdList,
- const SMESH_VisualObjDef::TMapOfIds& theSMDS2VTKNodes,
- const TConnect& theConnect,
- int thePosition,
- int theId)
+ const SMESH_VisualObjDef::TMapOfIds& theSMDS2VTKNodes,
+ const TConnect& theConnect,
+ int thePosition,
+ int theId)
{
theIdList->SetId(thePosition,theSMDS2VTKNodes.find(theConnect[theId]->GetID())->second);
}
@@ -372,12 +372,12 @@ void SMESH_VisualObjDef::buildElemPrs()
myVTK2SMDSElems.insert( TMapOfIds::value_type( iElem, anId ) );
SMDS_ElemIteratorPtr aNodesIter = anElem->nodesIterator();
- switch (aType) {
- case SMDSAbs_Volume:{
+ switch (aType) {
+ case SMDSAbs_Volume:{
aConnect.clear();
- std::vector aConnectivities;
- // Convertions connectivities from SMDS to VTK
- if (anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE
+ std::vector aConnectivities;
+ // Convertions connectivities from SMDS to VTK
+ if (anElem->IsPoly() && aNbNodes > 3) { // POLYEDRE
if ( const SMDS_PolyhedralVolumeOfNodes* ph =
dynamic_cast (anElem))
@@ -385,67 +385,67 @@ void SMESH_VisualObjDef::buildElemPrs()
aNbNodes = GetConnect(ph->uniqueNodesIterator(),aConnect);
anIdList->SetNumberOfIds( aNbNodes );
}
- for (int k = 0; k < aNbNodes; k++)
- aConnectivities.push_back(k);
+ for (int k = 0; k < aNbNodes; k++)
+ aConnectivities.push_back(k);
} else if (aNbNodes == 4) {
- static int anIds[] = {0,2,1,3};
- for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+ static int anIds[] = {0,2,1,3};
+ for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
- } else if (aNbNodes == 5) {
- static int anIds[] = {0,3,2,1,4};
- for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+ } else if (aNbNodes == 5) {
+ static int anIds[] = {0,3,2,1,4};
+ for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
- } else if (aNbNodes == 6) {
- static int anIds[] = {0,1,2,3,4,5};
- for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+ } else if (aNbNodes == 6) {
+ static int anIds[] = {0,1,2,3,4,5};
+ for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
- }
+ }
else if (aNbNodes == 8) {
- static int anIds[] = {0,3,2,1,4,7,6,5};
- for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+ static int anIds[] = {0,3,2,1,4,7,6,5};
+ for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
- }
+ }
else if (aNbNodes == 10) {
- static int anIds[] = {0,2,1,3,6,5,4,7,9,8};
- for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
- }
+ static int anIds[] = {0,2,1,3,6,5,4,7,9,8};
+ for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+ }
else if (aNbNodes == 13) {
- static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10};
- for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
- }
+ static int anIds[] = {0,3,2,1,4,8,7,6,5,9,12,11,10};
+ for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+ }
else if (aNbNodes == 15) {
//static int anIds[] = {0,2,1,3,5,4,8,7,6,11,10,9,12,14,13};
static int anIds[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};
- for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
- //for (int k = 0; k < aNbNodes; k++) {
+ for (int k = 0; k < aNbNodes; k++) aConnectivities.push_back(anIds[k]);
+ //for (int k = 0; k < aNbNodes; k++) {
// int nn = aConnectivities[k];
// const SMDS_MeshNode* N = static_cast (aConnect[nn]);
// cout<<"k="<X()<<","<Y()<<","<Z()<<")"< 0) {
- for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++)
- SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]);
- }
- break;
- }
- default:
- for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){
- const SMDS_MeshElement* aNode = aNodesIter->next();
- anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] );
- }
- }
+ if (aConnectivities.size() > 0) {
+ for (vtkIdType aNodeId = 0; aNodeId < aNbNodes; aNodeId++)
+ SetId(anIdList,mySMDS2VTKNodes,aConnect,aNodeId,aConnectivities[aNodeId]);
+ }
+ break;
+ }
+ default:
+ for( vtkIdType aNodeId = 0; aNodesIter->more(); aNodeId++ ){
+ const SMDS_MeshElement* aNode = aNodesIter->next();
+ anIdList->SetId( aNodeId, mySMDS2VTKNodes[aNode->GetID()] );
+ }
+ }
aConnectivity->InsertNextCell( anIdList );
aCellTypesArray->InsertNextValue( getCellType( aType, anElem->IsPoly(), aNbNodes ) );
@@ -483,9 +483,9 @@ void SMESH_VisualObjDef::buildElemPrs()
// purpose : Retrieve ids of nodes from edge of elements ( edge is numbered from 1 )
//=================================================================================
bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
- const int theEdgeNum,
- int& theNodeId1,
- int& theNodeId2 ) const
+ const int theEdgeNum,
+ int& theNodeId1,
+ int& theNodeId2 ) const
{
const SMDS_Mesh* aMesh = GetMesh();
if ( aMesh == 0 )
@@ -520,6 +520,19 @@ bool SMESH_VisualObjDef::GetEdgeNodes( const int theElemId,
return true;
}
+//=================================================================================
+// function : IsValid
+// purpose : Return true if there are some entities
+//=================================================================================
+bool SMESH_VisualObjDef::IsValid() const
+{
+ return GetNbEntities(SMDSAbs_Node) > 0 ||
+ GetNbEntities(SMDSAbs_0DElement) > 0 ||
+ GetNbEntities(SMDSAbs_Edge) > 0 ||
+ GetNbEntities(SMDSAbs_Face) > 0 ||
+ GetNbEntities(SMDSAbs_Volume) > 0 ;
+}
+
/*
Class : SMESH_MeshObj
Description : Class for visualisation of mesh
@@ -678,7 +691,7 @@ void SMESH_MeshObj::UpdateFunctor( const SMESH::Controls::FunctorPtr& theFunctor
//=================================================================================
bool SMESH_MeshObj::IsNodePrs() const
{
- return myClient->NbEdges() == 0 &&myClient->NbFaces() == 0 && myClient->NbVolumes() == 0 ;
+ return myClient->Nb0DElements() == 0 && myClient->NbEdges() == 0 && myClient->NbFaces() == 0 && myClient->NbVolumes() == 0 ;
}
@@ -905,7 +918,7 @@ int SMESH_subMeshObj::GetNbEntities( const SMDSAbs_ElementType theType) const
case SMDSAbs_Volume:
{
SMESH::long_array_var anIds =
- mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
+ mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
return anIds->length();
}
default:
@@ -942,7 +955,7 @@ int SMESH_subMeshObj::GetEntities( const SMDSAbs_ElementType theType, TEntityLis
else
{
SMESH::long_array_var anIds =
- mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
+ mySubMeshServer->GetElementsByType( SMESH::ElementType(theType) );
return getPointers( theType, anIds, aMesh, theResList );
}
}
diff --git a/src/OBJECT/SMESH_Object.h b/src/OBJECT/SMESH_Object.h
index 3d4dbbf8b..3bc178eca 100644
--- a/src/OBJECT/SMESH_Object.h
+++ b/src/OBJECT/SMESH_Object.h
@@ -62,9 +62,10 @@ public:
virtual SMDS_Mesh* GetMesh() const = 0;
virtual bool GetEdgeNodes( const int theElemId,
- const int theEdgeNum,
- int& theNodeId1,
- int& theNodeId2 ) const = 0;
+ const int theEdgeNum,
+ int& theNodeId1,
+ int& theNodeId2 ) const = 0;
+ virtual bool IsValid() const = 0;
virtual vtkUnstructuredGrid* GetUnstructuredGrid() = 0;
diff --git a/src/OBJECT/SMESH_ObjectDef.h b/src/OBJECT/SMESH_ObjectDef.h
index 094504f33..82f540913 100644
--- a/src/OBJECT/SMESH_ObjectDef.h
+++ b/src/OBJECT/SMESH_ObjectDef.h
@@ -69,6 +69,8 @@ public:
virtual bool IsNodePrs() const = 0;
virtual SMDS_Mesh* GetMesh() const = 0;
+ virtual bool IsValid() const;
+
virtual bool GetEdgeNodes( const int theElemId,
const int theEdgeNum,
int& theNodeId1,
diff --git a/src/OBJECT/SMESH_PreviewActorsCollection.cxx b/src/OBJECT/SMESH_PreviewActorsCollection.cxx
index d07e33b71..e565701da 100644
--- a/src/OBJECT/SMESH_PreviewActorsCollection.cxx
+++ b/src/OBJECT/SMESH_PreviewActorsCollection.cxx
@@ -137,25 +137,25 @@ GEOM_Actor* SMESH_PreviewActorsCollection::createActor(const TopoDS_Shape& shape
actor->SetShape(shape,0,0);
//Color Properties
- /*
- vtkProperty* aProp = vtkProperty::New();
- vtkProperty* aHLProp = vtkProperty::New();
- vtkProperty* aPHLProp = vtkProperty::New();
-
- aProp->SetColor( 255, 0, 0);
- actor->SetProperty(aProp);
+ /*
+ vtkProperty* aProp = vtkProperty::New();
+ vtkProperty* aHLProp = vtkProperty::New();
+ vtkProperty* aPHLProp = vtkProperty::New();
+
+ aProp->SetColor( 255, 0, 0);
+ actor->SetProperty(aProp);
- aHLProp->SetColor( 255, 255, 255);
- actor->SetHighlightProperty(aHLProp);
+ aHLProp->SetColor( 255, 255, 255);
+ actor->SetHighlightProperty(aHLProp);
- aPHLProp->SetColor( 155, 155, 155);
- aPHLProp->SetLineWidth ( 3 );
- aPHLProp->SetOpacity ( 0.75 );
- actor->SetPreHighlightProperty(aPHLProp);
+ aPHLProp->SetColor( 155, 155, 155);
+ aPHLProp->SetLineWidth ( 3 );
+ aPHLProp->SetOpacity ( 0.75 );
+ actor->SetPreHighlightProperty(aPHLProp);
- aProp->Delete();
- aHLProp->Delete();
- aPHLProp->Delete();
+ aProp->Delete();
+ aHLProp->Delete();
+ aPHLProp->Delete();
*/
return actor;
diff --git a/src/SMDS/SMDS_EdgePosition.cxx b/src/SMDS/SMDS_EdgePosition.cxx
index 1317d2b75..ae5bf5ccd 100644
--- a/src/SMDS/SMDS_EdgePosition.cxx
+++ b/src/SMDS/SMDS_EdgePosition.cxx
@@ -36,7 +36,7 @@ using namespace std;
//=======================================================================
SMDS_EdgePosition::SMDS_EdgePosition(const int aEdgeId,
- const double aUParam):SMDS_Position(aEdgeId), myUParameter(aUParam)
+ const double aUParam):SMDS_Position(aEdgeId), myUParameter(aUParam)
{
}
@@ -47,21 +47,21 @@ SMDS_EdgePosition::SMDS_EdgePosition(const int aEdgeId,
const double *SMDS_EdgePosition::Coords() const
{
- static double origin[]={0,0,0};
- MESSAGE("SMDS_EdgePosition::Coords not implemented");
- return origin;
+ static double origin[]={0,0,0};
+ MESSAGE("SMDS_EdgePosition::Coords not implemented");
+ return origin;
}
/**
*/
SMDS_TypeOfPosition SMDS_EdgePosition::GetTypeOfPosition() const
{
- return SMDS_TOP_EDGE;
+ return SMDS_TOP_EDGE;
}
void SMDS_EdgePosition::SetUParameter(double aUparam)
{
- myUParameter = aUparam;
+ myUParameter = aUparam;
}
//=======================================================================
@@ -71,5 +71,5 @@ void SMDS_EdgePosition::SetUParameter(double aUparam)
double SMDS_EdgePosition::GetUParameter() const
{
- return myUParameter;
+ return myUParameter;
}
diff --git a/src/SMDS/SMDS_Mesh.hxx b/src/SMDS/SMDS_Mesh.hxx
index 8a68e9a1e..db64ab782 100644
--- a/src/SMDS/SMDS_Mesh.hxx
+++ b/src/SMDS/SMDS_Mesh.hxx
@@ -75,40 +75,40 @@ public:
virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int ID);
virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- int ID);
+ const SMDS_MeshNode * n2,
+ int ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2);
+ const SMDS_MeshNode * n2);
// 2d order edge with 3 nodes: n12 - node between n1 and n2
virtual SMDS_MeshEdge* AddEdgeWithID(int n1, int n2, int n12, int ID);
virtual SMDS_MeshEdge* AddEdgeWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n12,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n12,
+ int ID);
virtual SMDS_MeshEdge* AddEdge(const SMDS_MeshNode * n1,
const SMDS_MeshNode * n2,
const SMDS_MeshNode * n12);
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ int ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3);
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ int ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshEdge * e1,
const SMDS_MeshEdge * e2,
@@ -130,100 +130,100 @@ public:
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3,
int n12,int n23,int n31, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n12,
- const SMDS_MeshNode * n23,
- const SMDS_MeshNode * n31,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n31,
+ int ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
const SMDS_MeshNode * n12,
- const SMDS_MeshNode * n23,
- const SMDS_MeshNode * n31);
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n31);
// 2d order quadrangle
virtual SMDS_MeshFace* AddFaceWithID(int n1, int n2, int n3, int n4,
int n12,int n23,int n34,int n41, int ID);
virtual SMDS_MeshFace* AddFaceWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n12,
- const SMDS_MeshNode * n23,
- const SMDS_MeshNode * n34,
- const SMDS_MeshNode * n41,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41,
+ int ID);
virtual SMDS_MeshFace* AddFace(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
const SMDS_MeshNode * n12,
- const SMDS_MeshNode * n23,
- const SMDS_MeshNode * n34,
- const SMDS_MeshNode * n41);
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
int n5, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
int n5, int n6, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
- const SMDS_MeshNode * n6,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
- const SMDS_MeshNode * n6);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6);
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
int n5, int n6, int n7, int n8, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
- const SMDS_MeshNode * n6,
- const SMDS_MeshNode * n7,
- const SMDS_MeshNode * n8,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
+ int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
- const SMDS_MeshNode * n6,
- const SMDS_MeshNode * n7,
- const SMDS_MeshNode * n8);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshFace * f1,
const SMDS_MeshFace * f2,
@@ -263,20 +263,20 @@ public:
int n12,int n23,int n31,
int n14,int n24,int n34, int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n12,
- const SMDS_MeshNode * n23,
- const SMDS_MeshNode * n31,
- const SMDS_MeshNode * n14,
- const SMDS_MeshNode * n24,
- const SMDS_MeshNode * n34,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n31,
+ const SMDS_MeshNode * n14,
+ const SMDS_MeshNode * n24,
+ const SMDS_MeshNode * n34,
+ int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
@@ -290,24 +290,24 @@ public:
int n15,int n25,int n35,int n45,
int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
- const SMDS_MeshNode * n12,
- const SMDS_MeshNode * n23,
- const SMDS_MeshNode * n34,
- const SMDS_MeshNode * n41,
- const SMDS_MeshNode * n15,
- const SMDS_MeshNode * n25,
- const SMDS_MeshNode * n35,
- const SMDS_MeshNode * n45,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41,
+ const SMDS_MeshNode * n15,
+ const SMDS_MeshNode * n25,
+ const SMDS_MeshNode * n35,
+ const SMDS_MeshNode * n45,
+ int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
@@ -325,27 +325,27 @@ public:
int n14,int n25,int n36,
int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
- const SMDS_MeshNode * n6,
- const SMDS_MeshNode * n12,
- const SMDS_MeshNode * n23,
- const SMDS_MeshNode * n31,
- const SMDS_MeshNode * n45,
- const SMDS_MeshNode * n56,
- const SMDS_MeshNode * n64,
- const SMDS_MeshNode * n14,
- const SMDS_MeshNode * n25,
- const SMDS_MeshNode * n36,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n31,
+ const SMDS_MeshNode * n45,
+ const SMDS_MeshNode * n56,
+ const SMDS_MeshNode * n64,
+ const SMDS_MeshNode * n14,
+ const SMDS_MeshNode * n25,
+ const SMDS_MeshNode * n36,
+ int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
- const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n31,
@@ -364,34 +364,34 @@ public:
int n15,int n26,int n37,int n48,
int ID);
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
- const SMDS_MeshNode * n6,
- const SMDS_MeshNode * n7,
- const SMDS_MeshNode * n8,
- const SMDS_MeshNode * n12,
- const SMDS_MeshNode * n23,
- const SMDS_MeshNode * n34,
- const SMDS_MeshNode * n41,
- const SMDS_MeshNode * n56,
- const SMDS_MeshNode * n67,
- const SMDS_MeshNode * n78,
- const SMDS_MeshNode * n85,
- const SMDS_MeshNode * n15,
- const SMDS_MeshNode * n26,
- const SMDS_MeshNode * n37,
- const SMDS_MeshNode * n48,
- int ID);
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
+ const SMDS_MeshNode * n12,
+ const SMDS_MeshNode * n23,
+ const SMDS_MeshNode * n34,
+ const SMDS_MeshNode * n41,
+ const SMDS_MeshNode * n56,
+ const SMDS_MeshNode * n67,
+ const SMDS_MeshNode * n78,
+ const SMDS_MeshNode * n85,
+ const SMDS_MeshNode * n15,
+ const SMDS_MeshNode * n26,
+ const SMDS_MeshNode * n37,
+ const SMDS_MeshNode * n48,
+ int ID);
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2,
- const SMDS_MeshNode * n3,
- const SMDS_MeshNode * n4,
- const SMDS_MeshNode * n5,
- const SMDS_MeshNode * n6,
- const SMDS_MeshNode * n7,
- const SMDS_MeshNode * n8,
+ const SMDS_MeshNode * n2,
+ const SMDS_MeshNode * n3,
+ const SMDS_MeshNode * n4,
+ const SMDS_MeshNode * n5,
+ const SMDS_MeshNode * n6,
+ const SMDS_MeshNode * n7,
+ const SMDS_MeshNode * n8,
const SMDS_MeshNode * n12,
const SMDS_MeshNode * n23,
const SMDS_MeshNode * n34,
@@ -559,29 +559,29 @@ private:
SMDS_Mesh(SMDS_Mesh * parent);
SMDS_MeshFace * createTriangle(const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3);
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3);
SMDS_MeshFace * createQuadrangle(const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4,
int ID);
// SMDS_Mesh0DElement* Find0DElementOrCreate(const SMDS_MeshNode * n);
SMDS_MeshEdge* FindEdgeOrCreate(const SMDS_MeshNode * n1,
- const SMDS_MeshNode * n2);
+ const SMDS_MeshNode * n2);
SMDS_MeshFace* FindFaceOrCreate(const SMDS_MeshNode *n1,
- const SMDS_MeshNode *n2,
- const SMDS_MeshNode *n3);
+ const SMDS_MeshNode *n2,
+ const SMDS_MeshNode *n3);
SMDS_MeshFace* FindFaceOrCreate(const SMDS_MeshNode *n1,
- const SMDS_MeshNode *n2,
- const SMDS_MeshNode *n3,
- const SMDS_MeshNode *n4);
+ const SMDS_MeshNode *n2,
+ const SMDS_MeshNode *n3,
+ const SMDS_MeshNode *n4);
bool registerElement(int ID, SMDS_MeshElement * element);
void addChildrenWithNodes(std::set& setOfChildren,
- const SMDS_MeshElement * element,
- std::set& nodes);
+ const SMDS_MeshElement * element,
+ std::set& nodes);
inline void adjustmyCellsCapacity(int ID)
{
diff --git a/src/SMDS/SMDS_VolumeOfNodes.cxx b/src/SMDS/SMDS_VolumeOfNodes.cxx
index 02e2661a3..73b61ca3f 100644
--- a/src/SMDS/SMDS_VolumeOfNodes.cxx
+++ b/src/SMDS/SMDS_VolumeOfNodes.cxx
@@ -40,73 +40,73 @@ using namespace std;
/// 5,1 and 7,3 are an edges.
///////////////////////////////////////////////////////////////////////////////
SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4,
- const SMDS_MeshNode * node5,
- const SMDS_MeshNode * node6,
- const SMDS_MeshNode * node7,
- const SMDS_MeshNode * node8)
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4,
+ const SMDS_MeshNode * node5,
+ const SMDS_MeshNode * node6,
+ const SMDS_MeshNode * node7,
+ const SMDS_MeshNode * node8)
{
- myNbNodes = 8;
- myNodes = new const SMDS_MeshNode* [myNbNodes];
- myNodes[0]=node1;
- myNodes[1]=node2;
- myNodes[2]=node3;
- myNodes[3]=node4;
- myNodes[4]=node5;
- myNodes[5]=node6;
- myNodes[6]=node7;
- myNodes[7]=node8;
+ myNbNodes = 8;
+ myNodes = new const SMDS_MeshNode* [myNbNodes];
+ myNodes[0]=node1;
+ myNodes[1]=node2;
+ myNodes[2]=node3;
+ myNodes[3]=node4;
+ myNodes[4]=node5;
+ myNodes[5]=node6;
+ myNodes[6]=node7;
+ myNodes[7]=node8;
}
SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4)
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4)
{
- myNbNodes = 4;
- myNodes = new const SMDS_MeshNode* [myNbNodes];
- myNodes[0]=node1;
- myNodes[1]=node2;
- myNodes[2]=node3;
- myNodes[3]=node4;
+ myNbNodes = 4;
+ myNodes = new const SMDS_MeshNode* [myNbNodes];
+ myNodes[0]=node1;
+ myNodes[1]=node2;
+ myNodes[2]=node3;
+ myNodes[3]=node4;
}
SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4,
- const SMDS_MeshNode * node5)
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4,
+ const SMDS_MeshNode * node5)
{
- myNbNodes = 5;
- myNodes = new const SMDS_MeshNode* [myNbNodes];
- myNodes[0]=node1;
- myNodes[1]=node2;
- myNodes[2]=node3;
- myNodes[3]=node4;
- myNodes[4]=node5;
+ myNbNodes = 5;
+ myNodes = new const SMDS_MeshNode* [myNbNodes];
+ myNodes[0]=node1;
+ myNodes[1]=node2;
+ myNodes[2]=node3;
+ myNodes[3]=node4;
+ myNodes[4]=node5;
}
SMDS_VolumeOfNodes::SMDS_VolumeOfNodes(
- const SMDS_MeshNode * node1,
- const SMDS_MeshNode * node2,
- const SMDS_MeshNode * node3,
- const SMDS_MeshNode * node4,
- const SMDS_MeshNode * node5,
- const SMDS_MeshNode * node6)
+ const SMDS_MeshNode * node1,
+ const SMDS_MeshNode * node2,
+ const SMDS_MeshNode * node3,
+ const SMDS_MeshNode * node4,
+ const SMDS_MeshNode * node5,
+ const SMDS_MeshNode * node6)
{
- myNbNodes = 6;
- myNodes = new const SMDS_MeshNode* [myNbNodes];
- myNodes[0]=node1;
- myNodes[1]=node2;
- myNodes[2]=node3;
- myNodes[3]=node4;
- myNodes[4]=node5;
- myNodes[5]=node6;
+ myNbNodes = 6;
+ myNodes = new const SMDS_MeshNode* [myNbNodes];
+ myNodes[0]=node1;
+ myNodes[1]=node2;
+ myNodes[2]=node3;
+ myNodes[3]=node4;
+ myNodes[4]=node5;
+ myNodes[5]=node6;
}
bool SMDS_VolumeOfNodes::ChangeNodes(const SMDS_MeshNode* nodes[],
@@ -139,40 +139,40 @@ SMDS_VolumeOfNodes::~SMDS_VolumeOfNodes()
void SMDS_VolumeOfNodes::Print(ostream & OS) const
{
- OS << "volume <" << GetID() << "> : ";
- int i;
- for (i = 0; i < NbNodes()-1; ++i) OS << myNodes[i] << ",";
- OS << myNodes[NbNodes()-1]<< ") " << endl;
+ OS << "volume <" << GetID() << "> : ";
+ int i;
+ for (i = 0; i < NbNodes()-1; ++i) OS << myNodes[i] << ",";
+ OS << myNodes[NbNodes()-1]<< ") " << endl;
}
int SMDS_VolumeOfNodes::NbFaces() const
{
- switch(NbNodes())
- {
- case 4: return 4;
- case 5: return 5;
- case 6: return 5;
- case 8: return 6;
- default: MESSAGE("invalid number of nodes");
- }
+ switch(NbNodes())
+ {
+ case 4: return 4;
+ case 5: return 5;
+ case 6: return 5;
+ case 8: return 6;
+ default: MESSAGE("invalid number of nodes");
+ }
return 0;
}
int SMDS_VolumeOfNodes::NbNodes() const
{
- return myNbNodes;
+ return myNbNodes;
}
int SMDS_VolumeOfNodes::NbEdges() const
{
- switch(NbNodes())
- {
- case 4: return 6;
- case 5: return 8;
- case 6: return 9;
- case 8: return 12;
- default: MESSAGE("invalid number of nodes");
- }
+ switch(NbNodes())
+ {
+ case 4: return 6;
+ case 5: return 8;
+ case 6: return 9;
+ case 8: return 12;
+ default: MESSAGE("invalid number of nodes");
+ }
return 0;
}
@@ -234,7 +234,7 @@ SMDS_ElemIteratorPtr SMDS_VolumeOfNodes::elementsIterator(SMDSAbs_ElementType ty
SMDSAbs_ElementType SMDS_VolumeOfNodes::GetType() const
{
- return SMDSAbs_Volume;
+ return SMDSAbs_Volume;
}
/*!
diff --git a/src/SMDS/SMDS_VolumeTool.cxx b/src/SMDS/SMDS_VolumeTool.cxx
index 0984cb505..24509b255 100644
--- a/src/SMDS/SMDS_VolumeTool.cxx
+++ b/src/SMDS/SMDS_VolumeTool.cxx
@@ -368,6 +368,8 @@ static int QuadHexa_nbN [] = { 8, 8, 8, 8, 8, 8 };
// ========================================================
// to perform some calculations without linkage to CASCADE
// ========================================================
+namespace
+{
struct XYZ {
double x;
double y;
@@ -376,25 +378,26 @@ struct XYZ {
XYZ( double X, double Y, double Z ) { x = X; y = Y; z = Z; }
XYZ( const XYZ& other ) { x = other.x; y = other.y; z = other.z; }
XYZ( const SMDS_MeshNode* n ) { x = n->X(); y = n->Y(); z = n->Z(); }
- XYZ operator-( const XYZ& other );
- XYZ Crossed( const XYZ& other );
- double Dot( const XYZ& other );
- double Magnitude();
+ inline XYZ operator-( const XYZ& other );
+ inline XYZ Crossed( const XYZ& other );
+ inline double Dot( const XYZ& other );
+ inline double Magnitude();
};
-XYZ XYZ::operator-( const XYZ& Right ) {
+inline XYZ XYZ::operator-( const XYZ& Right ) {
return XYZ(x - Right.x, y - Right.y, z - Right.z);
}
-XYZ XYZ::Crossed( const XYZ& Right ) {
+inline XYZ XYZ::Crossed( const XYZ& Right ) {
return XYZ (y * Right.z - z * Right.y,
z * Right.x - x * Right.z,
x * Right.y - y * Right.x);
}
-double XYZ::Dot( const XYZ& Other ) {
+inline double XYZ::Dot( const XYZ& Other ) {
return(x * Other.x + y * Other.y + z * Other.z);
}
-double XYZ::Magnitude() {
+inline double XYZ::Magnitude() {
return sqrt (x * x + y * y + z * z);
}
+}
//=======================================================================
//function : SMDS_VolumeTool
@@ -837,6 +840,32 @@ bool SMDS_VolumeTool::GetBaryCenter(double & X, double & Y, double & Z) const
return true;
}
+//================================================================================
+/*!
+ * \brief Classify a point
+ * \param tol - thickness of faces
+ */
+//================================================================================
+
+bool SMDS_VolumeTool::IsOut(double X, double Y, double Z, double tol)
+{
+ // LIMITATION: for convex volumes only
+ XYZ p( X,Y,Z );
+ for ( int iF = 0; iF < myNbFaces; ++iF )
+ {
+ XYZ faceNormal;
+ if ( !GetFaceNormal( iF, faceNormal.x, faceNormal.y, faceNormal.z ))
+ continue;
+ if ( !IsFaceExternal( iF ))
+ faceNormal = XYZ() - faceNormal; // reverse
+
+ XYZ face2p( p - XYZ( myFaceNodes[0] ));
+ if ( face2p.Dot( faceNormal ) > tol )
+ return true;
+ }
+ return false;
+}
+
//=======================================================================
//function : SetExternalNormal
//purpose : Node order will be so that faces normals are external
diff --git a/src/SMDS/SMDS_VolumeTool.hxx b/src/SMDS/SMDS_VolumeTool.hxx
index b95bc8a62..3b637c839 100644
--- a/src/SMDS/SMDS_VolumeTool.hxx
+++ b/src/SMDS/SMDS_VolumeTool.hxx
@@ -93,6 +93,8 @@ class SMDS_EXPORT SMDS_VolumeTool
bool GetBaryCenter (double & X, double & Y, double & Z) const;
+ bool IsOut(double X, double Y, double Z, double tol);
+ // Classify a point
// -----------------------
// info on node connection
diff --git a/src/SMESH/SMESH_Block.cxx b/src/SMESH/SMESH_Block.cxx
index 59971bfee..821d8fa9f 100644
--- a/src/SMESH/SMESH_Block.cxx
+++ b/src/SMESH/SMESH_Block.cxx
@@ -996,7 +996,8 @@ int SMESH_Block::GetOrderedEdges (const TopoDS_Face& theFace,
for ( iE = 0; wExp.More(); wExp.Next(), iE++ )
{
TopoDS_Edge edge = wExp.Current();
- edge = TopoDS::Edge( edge.Oriented( wExp.Orientation() ));
+ // commented for issue 0020557, other related ones: 0020526, PAL19080
+ // edge = TopoDS::Edge( edge.Oriented( wExp.Orientation() ));
theEdges.push_back( edge );
}
theNbVertexInWires.push_back( iE );
diff --git a/src/SMESH/SMESH_Gen.cxx b/src/SMESH/SMESH_Gen.cxx
index 4a998052c..92f5b3f6b 100644
--- a/src/SMESH/SMESH_Gen.cxx
+++ b/src/SMESH/SMESH_Gen.cxx
@@ -53,9 +53,9 @@ using namespace std;
SMESH_Gen::SMESH_Gen()
{
- MESSAGE("SMESH_Gen::SMESH_Gen");
- _localId = 0;
- _hypId = 0;
+ MESSAGE("SMESH_Gen::SMESH_Gen");
+ _localId = 0;
+ _hypId = 0;
_segmentation = 10;
SMDS_Mesh::_meshList.clear();
MESSAGE(SMDS_Mesh::_meshList.size());
@@ -69,7 +69,7 @@ SMESH_Gen::SMESH_Gen()
SMESH_Gen::~SMESH_Gen()
{
- MESSAGE("SMESH_Gen::~SMESH_Gen");
+ MESSAGE("SMESH_Gen::~SMESH_Gen");
}
//=============================================================================
@@ -79,26 +79,26 @@ SMESH_Gen::~SMESH_Gen()
//=============================================================================
/*SMESH_Hypothesis *SMESH_Gen::CreateHypothesis(const char *anHyp, int studyId)
- throw(SALOME_Exception)
+ throw(SALOME_Exception)
{
- MESSAGE("CreateHypothesis("<GetID();
- myStudyContext->mapHypothesis[hypId] = myHypothesis;
- SCRUTE(studyId);
- SCRUTE(hypId);
+ SMESH_Hypothesis *myHypothesis = _hypothesisFactory.Create(anHyp, studyId);
+ int hypId = myHypothesis->GetID();
+ myStudyContext->mapHypothesis[hypId] = myHypothesis;
+ SCRUTE(studyId);
+ SCRUTE(hypId);
- // store hypothesis in SMESHDS document
+ // store hypothesis in SMESHDS document
- myStudyContext->myDocument->AddHypothesis(myHypothesis);
- return myHypothesis;
+ myStudyContext->myDocument->AddHypothesis(myHypothesis);
+ return myHypothesis;
}*/
//=============================================================================
@@ -118,10 +118,10 @@ SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
// create a new SMESH_mesh object
SMESH_Mesh *aMesh = new SMESH_Mesh(_localId++,
- theStudyId,
- this,
- theIsEmbeddedMode,
- aStudyContext->myDocument);
+ theStudyId,
+ this,
+ theIsEmbeddedMode,
+ aStudyContext->myDocument);
aStudyContext->mapMesh[_localId] = aMesh;
return aMesh;
@@ -136,8 +136,8 @@ SMESH_Mesh* SMESH_Gen::CreateMesh(int theStudyId, bool theIsEmbeddedMode)
bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
const bool anUpward,
- const ::MeshDimension aDim,
- TSetOfInt* aShapesId)
+ const ::MeshDimension aDim,
+ TSetOfInt* aShapesId)
{
MESSAGE("SMESH_Gen::Compute");
MEMOSTAT;
@@ -172,7 +172,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
// clear compute state to not show previous compute errors
// if preview invoked less dimension less than previous
smToCompute->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
- continue;
+ continue;
}
if (smToCompute->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
@@ -182,7 +182,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
if (smToCompute->GetComputeState() == SMESH_subMesh::FAILED_TO_COMPUTE)
ret = false;
else if ( aShapesId )
- aShapesId->insert( smToCompute->GetId() );
+ aShapesId->insert( smToCompute->GetId() );
}
return ret;
}
@@ -207,7 +207,7 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
// check for preview dimension limitations
if ( aShapesId && aShapeDim > (int)aDim )
- continue;
+ continue;
SMESH_Algo* algo = GetAlgo( aMesh, aSubShape );
if ( algo && !algo->NeedDescretBoundary() )
@@ -215,11 +215,11 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
if ( algo->SupportSubmeshes() )
smWithAlgoSupportingSubmeshes.push_back( smToCompute );
else
- {
+ {
smToCompute->ComputeStateEngine( SMESH_subMesh::COMPUTE );
- if ( aShapesId )
- aShapesId->insert( smToCompute->GetId() );
- }
+ if ( aShapesId )
+ aShapesId->insert( smToCompute->GetId() );
+ }
}
}
// ------------------------------------------------------------
@@ -246,14 +246,14 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
SMESH_subMesh* smToCompute = smIt->next();
const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
- const int aShapeDim = GetShapeDim( aSubShape );
+ const int aShapeDim = GetShapeDim( aSubShape );
//if ( aSubShape.ShapeType() == TopAbs_VERTEX ) continue;
- if ( aShapeDim < 1 ) continue;
+ if ( aShapeDim < 1 ) continue;
- // check for preview dimension limitations
- if ( aShapesId && GetShapeDim( aSubShape.ShapeType() ) > (int)aDim )
- continue;
-
+ // check for preview dimension limitations
+ if ( aShapesId && GetShapeDim( aSubShape.ShapeType() ) > (int)aDim )
+ continue;
+
SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
filter
.And( SMESH_HypoFilter::IsApplicableTo( aSubShape ))
@@ -271,18 +271,20 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
// apply the algos that do not require descretized boundaries
// ----------------------------------------------------------
for ( subIt = smWithAlgoSupportingSubmeshes.rbegin(); subIt != subEnd; ++subIt )
+ {
+ sm = *subIt;
if ( sm->GetComputeState() == SMESH_subMesh::READY_TO_COMPUTE)
{
- const TopAbs_ShapeEnum aShType = sm->GetSubShape().ShapeType();
- // check for preview dimension limitations
- if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
- continue;
+ const TopAbs_ShapeEnum aShType = sm->GetSubShape().ShapeType();
+ // check for preview dimension limitations
+ if ( aShapesId && GetShapeDim( aShType ) > (int)aDim )
+ continue;
sm->ComputeStateEngine( SMESH_subMesh::COMPUTE );
- if ( aShapesId )
- aShapesId->insert( sm->GetId() );
+ if ( aShapesId )
+ aShapesId->insert( sm->GetId() );
}
-
+ }
// -----------------------------------------------
// mesh the rest subshapes starting from vertices
// -----------------------------------------------
@@ -304,8 +306,8 @@ bool SMESH_Gen::Compute(SMESH_Mesh & aMesh,
bool SMESH_Gen::Evaluate(SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
MapShapeNbElems& aResMap,
- const bool anUpward,
- TSetOfInt* aShapesId)
+ const bool anUpward,
+ TSetOfInt* aShapesId)
{
MESSAGE("SMESH_Gen::Evaluate");
@@ -330,14 +332,14 @@ bool SMESH_Gen::Evaluate(SMESH_Mesh & aMesh,
//if ( !aMesh.HasShapeToMesh() && aShType == TopAbs_VERTEX )
// continue;
if ( !aMesh.HasShapeToMesh() ) {
- if( aShType == TopAbs_VERTEX || aShType == TopAbs_WIRE ||
- aShType == TopAbs_SHELL )
- continue;
+ if( aShType == TopAbs_VERTEX || aShType == TopAbs_WIRE ||
+ aShType == TopAbs_SHELL )
+ continue;
}
smToCompute->Evaluate(aResMap);
if( aShapesId )
- aShapesId->insert( smToCompute->GetId() );
+ aShapesId->insert( smToCompute->GetId() );
}
return ret;
}
@@ -359,12 +361,12 @@ bool SMESH_Gen::Evaluate(SMESH_Mesh & aMesh,
if ( algo && !algo->NeedDescretBoundary() ) {
if ( algo->SupportSubmeshes() ) {
smWithAlgoSupportingSubmeshes.push_back( smToCompute );
- }
+ }
else {
smToCompute->Evaluate(aResMap);
- if ( aShapesId )
- aShapesId->insert( smToCompute->GetId() );
- }
+ if ( aShapesId )
+ aShapesId->insert( smToCompute->GetId() );
+ }
}
}
// ------------------------------------------------------------
@@ -389,10 +391,10 @@ bool SMESH_Gen::Evaluate(SMESH_Mesh & aMesh,
SMESH_subMesh* smToCompute = smIt->next();
const TopoDS_Shape& aSubShape = smToCompute->GetSubShape();
- const int aShapeDim = GetShapeDim( aSubShape );
- if ( aShapeDim < 1 ) continue;
+ const int aShapeDim = GetShapeDim( aSubShape );
+ if ( aShapeDim < 1 ) continue;
- //const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();
+ //const TopAbs_ShapeEnum aShType = smToCompute->GetSubShape().ShapeType();
SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
filter
@@ -410,10 +412,12 @@ bool SMESH_Gen::Evaluate(SMESH_Mesh & aMesh,
// ----------------------------------------------------------
// apply the algos that do not require descretized boundaries
// ----------------------------------------------------------
- for ( subIt = smWithAlgoSupportingSubmeshes.rbegin(); subIt != subEnd; ++subIt ) {
+ for ( subIt = smWithAlgoSupportingSubmeshes.rbegin(); subIt != subEnd; ++subIt )
+ {
+ sm = *subIt;
sm->Evaluate(aResMap);
if ( aShapesId )
- aShapesId->insert( sm->GetId() );
+ aShapesId->insert( sm->GetId() );
}
// -----------------------------------------------
@@ -437,7 +441,7 @@ static bool checkConformIgnoredAlgos(SMESH_Mesh& aMesh,
const SMESH_Algo* aGlobIgnoAlgo,
const SMESH_Algo* aLocIgnoAlgo,
bool & checkConform,
- map& aCheckedMap,
+ set& aCheckedMap,
list< SMESH_Gen::TAlgoStateError > & theErrors)
{
ASSERT( aSubMesh );
@@ -492,19 +496,15 @@ static bool checkConformIgnoredAlgos(SMESH_Mesh& aMesh,
}
// sub-algos will be hidden by a local
- const map& smMap = aSubMesh->DependsOn();
- map::const_reverse_iterator revItSub;
+ SMESH_subMeshIteratorPtr revItSub =
+ aSubMesh->getDependsOnIterator( /*includeSelf=*/false, /*complexShapeFirst=*/true);
bool checkConform2 = false;
- for ( revItSub = smMap.rbegin(); revItSub != smMap.rend(); revItSub++)
+ while ( revItSub->more() )
{
- checkConformIgnoredAlgos (aMesh, (*revItSub).second, aGlobIgnoAlgo,
+ SMESH_subMesh* sm = revItSub->next();
+ checkConformIgnoredAlgos (aMesh, sm, aGlobIgnoAlgo,
algo, checkConform2, aCheckedMap, theErrors);
- int key = (*revItSub).first;
- SMESH_subMesh* sm = (*revItSub).second;
- if ( aCheckedMap.find( key ) == aCheckedMap.end() )
- {
- aCheckedMap[ key ] = sm;
- }
+ aCheckedMap.insert( sm );
}
}
}
@@ -525,7 +525,7 @@ static bool checkMissing(SMESH_Gen* aGen,
const int aTopAlgoDim,
bool* globalChecked,
const bool checkNoAlgo,
- map& aCheckedMap,
+ set& aCheckedMap,
list< SMESH_Gen::TAlgoStateError > & theErrors)
{
if ( aSubMesh->GetSubShape().ShapeType() == TopAbs_VERTEX)
@@ -598,15 +598,13 @@ static bool checkMissing(SMESH_Gen* aGen,
if (!algo->NeedDescretBoundary() || isTopLocalAlgo)
{
bool checkNoAlgo2 = ( algo->NeedDescretBoundary() );
- const map& subMeshes = aSubMesh->DependsOn();
- map::const_iterator itsub;
- for (itsub = subMeshes.begin(); itsub != subMeshes.end(); itsub++)
+ SMESH_subMeshIteratorPtr itsub = aSubMesh->getDependsOnIterator( /*includeSelf=*/false,
+ /*complexShapeFirst=*/false);
+ while ( itsub->more() )
{
// sub-meshes should not be checked further more
- int key = (*itsub).first;
- SMESH_subMesh* sm = (*itsub).second;
- if ( aCheckedMap.find( key ) == aCheckedMap.end() )
- aCheckedMap[ key ] = sm;
+ SMESH_subMesh* sm = itsub->next();
+ aCheckedMap.insert( sm );
if (isTopLocalAlgo)
{
@@ -700,39 +698,25 @@ bool SMESH_Gen::GetAlgoState(SMESH_Mesh& theMesh,
}
}
- const map& smMap = sm->DependsOn();
- map::const_reverse_iterator revItSub = smMap.rbegin();
- map aCheckedMap;
+ set aCheckedSubs;
bool checkConform = ( !theMesh.IsNotConformAllowed() );
- int aKey = 1;
- SMESH_subMesh* smToCheck = sm;
// loop on theShape and its sub-shapes
- while ( smToCheck )
+ SMESH_subMeshIteratorPtr revItSub = sm->getDependsOnIterator( /*includeSelf=*/true,
+ /*complexShapeFirst=*/true);
+ while ( revItSub->more() )
{
+ SMESH_subMesh* smToCheck = revItSub->next();
if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
break;
- if ( aCheckedMap.find( aKey ) == aCheckedMap.end() )
+ if ( aCheckedSubs.insert( smToCheck ).second ) // not yet checked
if (!checkConformIgnoredAlgos (theMesh, smToCheck, aGlobIgnoAlgo,
- 0, checkConform, aCheckedMap, theErrors))
+ 0, checkConform, aCheckedSubs, theErrors))
ret = false;
if ( smToCheck->GetAlgoState() != SMESH_subMesh::NO_ALGO )
hasAlgo = true;
-
- // next subMesh
- if (revItSub != smMap.rend())
- {
- aKey = (*revItSub).first;
- smToCheck = (*revItSub).second;
- revItSub++;
- }
- else
- {
- smToCheck = 0;
- }
-
}
// ----------------------------------------------------------------
@@ -752,36 +736,26 @@ bool SMESH_Gen::GetAlgoState(SMESH_Mesh& theMesh,
break;
}
}
- aCheckedMap.clear();
- smToCheck = sm;
- revItSub = smMap.rbegin();
bool checkNoAlgo = theMesh.HasShapeToMesh() ? bool( aTopAlgoDim ) : false;
bool globalChecked[] = { false, false, false, false };
// loop on theShape and its sub-shapes
- while ( smToCheck )
+ aCheckedSubs.clear();
+ revItSub = sm->getDependsOnIterator( /*includeSelf=*/true, /*complexShapeFirst=*/true);
+ while ( revItSub->more() )
{
+ SMESH_subMesh* smToCheck = revItSub->next();
if ( smToCheck->GetSubShape().ShapeType() == TopAbs_VERTEX)
break;
- if ( aCheckedMap.find( aKey ) == aCheckedMap.end() )
+ if ( aCheckedSubs.insert( smToCheck ).second ) // not yet checked
if (!checkMissing (this, theMesh, smToCheck, aTopAlgoDim,
- globalChecked, checkNoAlgo, aCheckedMap, theErrors))
+ globalChecked, checkNoAlgo, aCheckedSubs, theErrors))
{
ret = false;
if (smToCheck->GetAlgoState() == SMESH_subMesh::NO_ALGO )
checkNoAlgo = false;
}
-
- // next subMesh
- if (revItSub != smMap.rend())
- {
- aKey = (*revItSub).first;
- smToCheck = (*revItSub).second;
- revItSub++;
- }
- else
- smToCheck = 0;
}
if ( !hasAlgo ) {
@@ -830,16 +804,16 @@ SMESH_Algo *SMESH_Gen::GetAlgo(SMESH_Mesh & aMesh,
StudyContextStruct *SMESH_Gen::GetStudyContext(int studyId)
{
- // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
+ // Get studyContext, create it if it does'nt exist, with a SMESHDS_Document
- if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
- {
- _mapStudyContext[studyId] = new StudyContextStruct;
- _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
- }
- StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
+ if (_mapStudyContext.find(studyId) == _mapStudyContext.end())
+ {
+ _mapStudyContext[studyId] = new StudyContextStruct;
+ _mapStudyContext[studyId]->myDocument = new SMESHDS_Document(studyId);
+ }
+ StudyContextStruct *myStudyContext = _mapStudyContext[studyId];
// ASSERT(_mapStudyContext.find(studyId) != _mapStudyContext.end());
- return myStudyContext;
+ return myStudyContext;
}
// //=============================================================================
@@ -904,6 +878,6 @@ int SMESH_Gen::GetShapeDim(const TopAbs_ShapeEnum & aShapeType)
int SMESH_Gen::GetANewId()
{
- //MESSAGE("SMESH_Gen::GetANewId");
- return _hypId++;
+ //MESSAGE("SMESH_Gen::GetANewId");
+ return _hypId++;
}
diff --git a/src/SMESH/SMESH_Gen.hxx b/src/SMESH/SMESH_Gen.hxx
index 57a5af6eb..ab610a00a 100644
--- a/src/SMESH/SMESH_Gen.hxx
+++ b/src/SMESH/SMESH_Gen.hxx
@@ -61,7 +61,7 @@ typedef std::set TSetOfInt;
class SMESH_EXPORT SMESH_Gen
{
- public:
+public:
SMESH_Gen();
~SMESH_Gen();
@@ -78,8 +78,8 @@ class SMESH_EXPORT SMESH_Gen
bool Compute(::SMESH_Mesh & aMesh,
const TopoDS_Shape & aShape,
const bool anUpward=false,
- const ::MeshDimension aDim=::MeshDim_3D,
- TSetOfInt* aShapesId=0);
+ const ::MeshDimension aDim=::MeshDim_3D,
+ TSetOfInt* aShapesId=0);
/*!
* \brief evaluates size of prospective mesh on a shape
@@ -89,8 +89,8 @@ class SMESH_EXPORT SMESH_Gen
* \retval bool - is a success
*/
bool Evaluate(::SMESH_Mesh & aMesh,
- const TopoDS_Shape & aShape,
- MapShapeNbElems& aResMap,
+ const TopoDS_Shape & aShape,
+ MapShapeNbElems& aResMap,
const bool anUpward=false,
TSetOfInt* aShapesId=0);
@@ -109,7 +109,7 @@ class SMESH_EXPORT SMESH_Gen
*/
void SetDefaultNbSegments(int nb) { _nbSegments = nb; }
int GetDefaultNbSegments() const { return _nbSegments; }
-
+
struct TAlgoStateError
{
TAlgoStateErrorName _name;
@@ -138,16 +138,6 @@ class SMESH_EXPORT SMESH_Gen
SMESH_Algo* GetAlgo(SMESH_Mesh & aMesh, const TopoDS_Shape & aShape, TopoDS_Shape* assignedTo=0);
static bool IsGlobalHypothesis(const SMESH_Hypothesis* theHyp, SMESH_Mesh& aMesh);
- // inherited methods from SALOMEDS::Driver
-
-// void Save(int studyId, const char *aUrlOfFile);
-// void Load(int studyId, const char *aUrlOfFile);
-// void Close(int studyId);
-// const char *ComponentDataType();
-
-// const char *IORToLocalPersistentID(const char *IORString, bool & IsAFile);
-// const char *LocalPersistentIDToIOR(const char *aLocalPersistentID);
-
int GetANewId();
std::map < int, SMESH_Algo * >_mapAlgo;
@@ -156,9 +146,9 @@ class SMESH_EXPORT SMESH_Gen
std::map < int, SMESH_2D_Algo * >_map2D_Algo;
std::map < int, SMESH_3D_Algo * >_map3D_Algo;
- private:
+private:
- int _localId; // unique Id of created objects, within SMESH_Gen entity
+ int _localId; // unique Id of created objects, within SMESH_Gen entity
std::map < int, StudyContextStruct * >_mapStudyContext;
// hypotheses managing
diff --git a/src/SMESH/SMESH_Hypothesis.cxx b/src/SMESH/SMESH_Hypothesis.cxx
index 4b288a0d9..0fec4925c 100644
--- a/src/SMESH/SMESH_Hypothesis.cxx
+++ b/src/SMESH/SMESH_Hypothesis.cxx
@@ -39,8 +39,8 @@ using namespace std;
//=============================================================================
SMESH_Hypothesis::SMESH_Hypothesis(int hypId,
- int studyId,
- SMESH_Gen* gen) : SMESHDS_Hypothesis(hypId)
+ int studyId,
+ SMESH_Gen* gen) : SMESHDS_Hypothesis(hypId)
{
//MESSAGE("SMESH_Hypothesis::SMESH_Hypothesis");
_gen = gen;
diff --git a/src/SMESH/SMESH_Mesh.cxx b/src/SMESH/SMESH_Mesh.cxx
index 1281522d9..67d78b4e6 100644
--- a/src/SMESH/SMESH_Mesh.cxx
+++ b/src/SMESH/SMESH_Mesh.cxx
@@ -81,10 +81,10 @@ typedef SMESH_HypoFilter THypType;
//=============================================================================
SMESH_Mesh::SMESH_Mesh(int theLocalId,
- int theStudyId,
- SMESH_Gen* theGen,
- bool theIsEmbeddedMode,
- SMESHDS_Document* theDocument):
+ int theStudyId,
+ SMESH_Gen* theGen,
+ bool theIsEmbeddedMode,
+ SMESHDS_Document* theDocument):
_groupId( 0 ), _nbSubShapes( 0 )
{
MESSAGE("SMESH_Mesh::SMESH_Mesh(int localId)");
@@ -325,14 +325,14 @@ void SMESH_Mesh::ClearSubMesh(const int theShapeId)
if ( SMESH_subMesh *sm = GetSubMeshContaining( theShapeId ) )
{
SMESH_subMeshIteratorPtr smIt = sm->getDependsOnIterator(/*includeSelf=*/true,
- /*complexShapeFirst=*/false);
+ /*complexShapeFirst=*/false);
while ( smIt->more() )
{
sm = smIt->next();
TopAbs_ShapeEnum shapeType = sm->GetSubShape().ShapeType();
if ( shapeType == TopAbs_VERTEX || shapeType < TopAbs_SOLID )
- // all other shapes depends on vertices so they are already cleaned
- sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
+ // all other shapes depends on vertices so they are already cleaned
+ sm->ComputeStateEngine( SMESH_subMesh::CLEAN );
// to recompute even if failed
sm->ComputeStateEngine( SMESH_subMesh::CHECK_COMPUTE_STATE );
}
@@ -373,21 +373,21 @@ int SMESH_Mesh::UNVToMesh(const char* theFileName)
SMESH_Group* aSMESHGroup = AddGroup( aSubGroup->GetType(), aName.c_str(), aId );
if ( aSMESHGroup ) {
- if(MYDEBUG) MESSAGE("UNVToMesh - group added: "<( aSMESHGroup->GetGroupDS() );
- if ( aGroupDS ) {
- aGroupDS->SetStoreName(aName.c_str());
- aSubGroup->InitIterator();
- const SMDS_MeshElement* aElement = 0;
- while (aSubGroup->More()) {
- aElement = aSubGroup->Next();
- if (aElement) {
- aGroupDS->SMDSGroup().Add(aElement);
- }
- }
- if (aElement)
- aGroupDS->SetType(aElement->GetType());
- }
+ if(MYDEBUG) MESSAGE("UNVToMesh - group added: "<( aSMESHGroup->GetGroupDS() );
+ if ( aGroupDS ) {
+ aGroupDS->SetStoreName(aName.c_str());
+ aSubGroup->InitIterator();
+ const SMDS_MeshElement* aElement = 0;
+ while (aSubGroup->More()) {
+ aElement = aSubGroup->Next();
+ if (aElement) {
+ aGroupDS->SMDSGroup().Add(aElement);
+ }
+ }
+ if (aElement)
+ aGroupDS->SetType(aElement->GetType());
+ }
}
}
}
@@ -1086,9 +1086,9 @@ bool SMESH_Mesh::HasDuplicatedGroupNamesMED()
}
void SMESH_Mesh::ExportMED(const char *file,
- const char* theMeshName,
- bool theAutoGroups,
- int theVersion)
+ const char* theMeshName,
+ bool theAutoGroups,
+ int theVersion)
throw(SALOME_Exception)
{
Unexpect aCatch(SalomeException);
@@ -1376,7 +1376,7 @@ bool SMESH_Mesh::IsMainShape(const TopoDS_Shape& theShape) const
SMESH_Group* SMESH_Mesh::AddGroup (const SMDSAbs_ElementType theType,
const char* theName,
- int& theId,
+ int& theId,
const TopoDS_Shape& theShape)
{
if (_mapGroup.find(_groupId) != _mapGroup.end())
diff --git a/src/SMESH/SMESH_Mesh.hxx b/src/SMESH/SMESH_Mesh.hxx
index 284bf89a7..26339eb09 100644
--- a/src/SMESH/SMESH_Mesh.hxx
+++ b/src/SMESH/SMESH_Mesh.hxx
@@ -55,10 +55,10 @@ class SMESH_EXPORT SMESH_Mesh
{
public:
SMESH_Mesh(int theLocalId,
- int theStudyId,
- SMESH_Gen* theGen,
- bool theIsEmbeddedMode,
- SMESHDS_Document* theDocument);
+ int theStudyId,
+ SMESH_Gen* theGen,
+ bool theIsEmbeddedMode,
+ SMESHDS_Document* theDocument);
virtual ~SMESH_Mesh();
@@ -162,7 +162,7 @@ public:
* \brief Return True if anHyp is used to mesh aSubShape
*/
bool IsUsedHypothesis(SMESHDS_Hypothesis * anHyp,
- const SMESH_subMesh * aSubMesh);
+ const SMESH_subMesh * aSubMesh);
/*!
* \brief check if a hypothesis alowing notconform mesh is present
*/
@@ -191,9 +191,9 @@ public:
bool HasDuplicatedGroupNamesMED();
void ExportMED(const char *file,
- const char* theMeshName = NULL,
- bool theAutoGroups = true,
- int theVersion = 0)
+ const char* theMeshName = NULL,
+ bool theAutoGroups = true,
+ int theVersion = 0)
throw(SALOME_Exception);
void ExportDAT(const char *file) throw(SALOME_Exception);
@@ -231,8 +231,8 @@ public:
int NbGroup() const { return _mapGroup.size(); }
SMESH_Group* AddGroup (const SMDSAbs_ElementType theType,
- const char* theName,
- int& theId,
+ const char* theName,
+ int& theId,
const TopoDS_Shape& theShape=TopoDS_Shape());
typedef boost::shared_ptr< SMDS_Iterator > GroupIteratorPtr;
diff --git a/src/SMESH/SMESH_MeshEditor.cxx b/src/SMESH/SMESH_MeshEditor.cxx
index d347a7157..32dcba796 100644
--- a/src/SMESH/SMESH_MeshEditor.cxx
+++ b/src/SMESH/SMESH_MeshEditor.cxx
@@ -78,6 +78,8 @@
#include