CURRENT_DIR=`pwd`
CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"`
cd ${CONF_DIR}
-python $KERNEL_ROOT_DIR/salome_adm/cmake_files/am2cmake.py --smesh
+python $KERNEL_ROOT_DIR/salome_adm/cmake_files/deprecated/am2cmake.py --smesh
status=$?
cd ${CURRENT_DIR}
exit $status
@REM See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
@REM
-%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\am2cmake.py --smesh\r
+%PYTHONBIN% %KERNEL_ROOT_DIR%\salome_adm\cmake_files\deprecated\am2cmake.py --smesh\r
pyexamplesdir = $(docdir)/examples/SMESH
-BAD_TESTS =
+BAD_TESTS = \
+ 3dmesh.py \
+ creating_meshes_ex01.py \
+ creating_meshes_ex03.py \
+ creating_meshes_ex05.py \
+ defining_hypotheses_ex06.py \
+ defining_hypotheses_ex09.py \
+ defining_hypotheses_ex17.py \
+ filters_ex02.py \
+ filters_ex08.py \
+ filters_ex23.py \
+ filters_ex24.py \
+ filters_ex25.py \
+ filters_ex32.py \
+ filters_ex35.py \
+ generate_flat_elements.py \
+ modifying_meshes_ex26.py \
+ notebook_smesh.py \
+ quality_controls_ex06.py \
+ quality_controls_ex20.py \
+ quality_controls_ex21.py \
+ quality_controls_ex22.py \
+ viewing_meshes_ex01.py
GOOD_TESTS = \
- 3dmesh.py \
cartesian_algo.py \
- creating_meshes_ex01.py \
creating_meshes_ex02.py \
- creating_meshes_ex03.py \
creating_meshes_ex04.py \
- creating_meshes_ex05.py \
creating_meshes_ex06.py \
creating_meshes_ex07.py \
creating_meshes_ex08.py \
defining_hypotheses_ex03.py \
defining_hypotheses_ex04.py \
defining_hypotheses_ex05.py \
- defining_hypotheses_ex06.py \
defining_hypotheses_ex07.py \
defining_hypotheses_ex08.py \
- defining_hypotheses_ex09.py \
defining_hypotheses_ex10.py \
defining_hypotheses_ex11.py \
defining_hypotheses_ex12.py \
defining_hypotheses_ex14.py \
defining_hypotheses_ex15.py \
defining_hypotheses_ex16.py \
- defining_hypotheses_ex17.py \
filters_ex01.py \
- filters_ex02.py \
filters_ex03.py \
filters_ex04.py \
filters_ex05.py \
filters_ex06.py \
filters_ex07.py \
- filters_ex08.py \
filters_ex09.py \
filters_ex10.py \
filters_ex11.py \
filters_ex20.py \
filters_ex21.py \
filters_ex22.py \
- filters_ex23.py \
- filters_ex24.py \
- filters_ex25.py \
filters_ex26.py \
filters_ex27.py \
filters_ex28.py \
filters_ex29.py \
filters_ex30.py \
filters_ex31.py \
- filters_ex32.py \
filters_ex33.py \
filters_ex34.py \
- filters_ex35.py \
filters_ex36.py \
- generate_flat_elements.py \
grouping_elements_ex01.py \
grouping_elements_ex02.py \
grouping_elements_ex03.py \
modifying_meshes_ex23.py \
modifying_meshes_ex24.py \
modifying_meshes_ex25.py \
- modifying_meshes_ex26.py \
- notebook_smesh.py \
prism_3d_algo.py \
quality_controls_ex01.py \
quality_controls_ex02.py \
quality_controls_ex03.py \
quality_controls_ex04.py \
quality_controls_ex05.py \
- quality_controls_ex06.py \
quality_controls_ex07.py \
quality_controls_ex08.py \
quality_controls_ex09.py \
quality_controls_ex17.py \
quality_controls_ex18.py \
quality_controls_ex19.py \
- quality_controls_ex20.py \
- quality_controls_ex21.py \
- quality_controls_ex22.py \
transforming_meshes_ex01.py \
transforming_meshes_ex02.py \
transforming_meshes_ex03.py \
transforming_meshes_ex12.py \
transforming_meshes_ex13.py \
use_existing_faces.py \
- viewing_meshes_ex01.py \
viewing_meshes_ex02.py
pyexamples_SCRIPTS = $(BAD_TESTS) $(GOOD_TESTS)
EXTRA_DIST += $(pyexamples_SCRIPTS) testme.py
-check-local:
+installcheck-local:
@for f in $(GOOD_TESTS) ; do \
- python $(top_srcdir)/doc/salome/examples/testme.py $(top_srcdir)/doc/salome/examples/$$f || exit 1; \
+ env SMESH_ROOT_DIR=$(prefix) python -B $(top_srcdir)/doc/salome/examples/testme.py $(top_srcdir)/doc/salome/examples/$$f || exit 1; \
done
# create mesh
from SMESH_mechanic import *
# remove some faces to have faces with bare borders
-mesh.RemoveElements( mesh.GetElementsByType(FACE)[0:5] )
+mesh.RemoveElements( mesh.GetElementsByType(smesh.FACE)[0:5] )
# get all faces bare borders
filter = smesh.GetFilter(smesh.FACE, smesh.FT_BareBorderFace)
ids = mesh.GetIdsFromFilter(filter)
# create mesh
from SMESH_mechanic import *
-faceID = mesh.GetElementsByType(FACE)[0]
+faceID = mesh.GetElementsByType(smesh.FACE)[0]
# get all faces co-planar to the first face with tolerance 5 degrees
filter = smesh.GetFilter(smesh.FACE, smesh.FT_CoplanarFaces,faceID,Tolerance=5.0)
ids = mesh.GetIdsFromFilter(filter)
# create mesh
from SMESH_mechanic import *
# get nodes with identifiers [5-10] and [15-30]
-criterion1 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Treshold="5-10",\
+criterion1 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Threshold="5-10",\
BinaryOp=smesh.FT_LogicalOR)
-criterion2 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Treshold="15-30")
+criterion2 = smesh.GetCriterion(smesh.NODE, smesh.FT_RangeOfIds, Threshold="15-30")
filter = smesh.CreateFilterManager().CreateFilter()
filter.SetCriteria([criterion1,criterion2])
ids = mesh.GetIdsFromFilter(filter)
# Add Polyhedron
import salome
+import smesh
import math
# create an empty mesh structure
pass
# Create a polyhedral volume (12-hedron with pentagonal faces)
-MeshEditor.AddPolyhedralVolume([dd[0], dd[1], dd[2], dd[3], dd[4], # top
- dd[0], cc[0], bb[1], cc[1], dd[1], # -
- dd[1], cc[1], bb[2], cc[2], dd[2], # -
- dd[2], cc[2], bb[3], cc[3], dd[3], # - below top
- dd[3], cc[3], bb[4], cc[4], dd[4], # -
- dd[4], cc[4], bb[0], cc[0], dd[0], # -
- aa[4], bb[4], cc[4], bb[0], aa[0], # .
- aa[3], bb[3], cc[3], bb[4], aa[4], # .
- aa[2], bb[2], cc[2], bb[3], aa[3], # . above bottom
- aa[1], bb[1], cc[1], bb[2], aa[2], # .
- aa[0], bb[0], cc[0], bb[1], aa[1], # .
- aa[0], aa[1], aa[2], aa[3], aa[4]], # bottom
- [5,5,5,5,5,5,5,5,5,5,5,5])
+mesh.GetMeshEditor().AddPolyhedralVolume([dd[0], dd[1], dd[2], dd[3], dd[4], # top
+ dd[0], cc[0], bb[1], cc[1], dd[1], # -
+ dd[1], cc[1], bb[2], cc[2], dd[2], # -
+ dd[2], cc[2], bb[3], cc[3], dd[3], # - below top
+ dd[3], cc[3], bb[4], cc[4], dd[4], # -
+ dd[4], cc[4], bb[0], cc[0], dd[0], # -
+ aa[4], bb[4], cc[4], bb[0], aa[0], # .
+ aa[3], bb[3], cc[3], bb[4], aa[4], # .
+ aa[2], bb[2], cc[2], bb[3], aa[3], # . above bottom
+ aa[1], bb[1], cc[1], bb[2], aa[2], # .
+ aa[0], bb[0], cc[0], bb[1], aa[1], # .
+ aa[0], aa[1], aa[2], aa[3], aa[4]], # bottom
+ [5,5,5,5,5,5,5,5,5,5,5,5])
salome.sg.updateObjBrowser(1)
print ""
# create a group
-aGroup = mesh.CreateGroup(SMESH.EDGE, "Free borders")
+aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Free borders")
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
print ""
# create a group
-aGroup = mesh.CreateGroup(SMESH.EDGE, "Borders at multi-connections")
+aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Borders at multi-connections")
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
print ""
# create a group
-aGroup = mesh.CreateGroup(SMESH.EDGE, "Edges with length > " + `length_margin`)
+aGroup = mesh.GetMesh().CreateGroup(smesh.EDGE, "Edges with length > " + `length_margin`)
aGroup.Add(anIds)
salome.sg.updateObjBrowser(1)
#!/usr/bin/env python
-import unittest, sys
+import unittest, sys, os
class SalomeSession(object):
def __init__(self, script):
sys.argv += ["--modules=GEOM,MED,SMESH"]
sys.argv += ["--execute=%s" % script]
clt, d = runSalome.main()
- self.port = d['port']
return
def __del__(self):
- port = self.port
+ port = os.getenv('NSPORT')
import killSalomeWithPort
killSalomeWithPort.killMyPort(port)
return
mesh = SMESH_mechanic.mesh
# create a symmetrical copy of the mesh mirrored through a point
-axis = SMESH.AxisStruct(0, 0, 0, 0, 0, 0)
+axis = smesh.AxisStruct(0, 0, 0, 0, 0, 0)
mesh.Mirror([], axis, smesh.POINT, 1)
# Duplicate nodes
import salome
+import geompy
import smesh
-import SMESH_test1
-mesh = SMESH_test1.mesh
+# Create a box
+
+box = geompy.MakeBox(0., 0., 0., 100., 200., 300.)
+
+# Define hexa mesh on a box
+mesh = smesh.Mesh(box, "Mesh")
+mesh.Segment().NumberOfSegments(7)
+mesh.Quadrangle()
+mesh.Hexahedron()
# Compute mesh
mesh.Compute()
# Nodes to duplicate
nodes1 = mesh.CreateEmptyGroup( smesh.NODE, 'nodes1' )
-nodes1.Add( [ 289, 278, 302, 285 ] )
+nodes1.Add( [ 119, 125, 131, 137 ] )
# Group of faces to replace nodes with new ones
faces1 = mesh.CreateEmptyGroup( smesh.FACE, 'faces1' )
-faces1.Add( [ 519, 556, 557 ] )
+faces1.Add( [ 144, 151, 158 ] )
# Duplicate nodes
print "\nMesh before the first nodes duplication:"
-print "Nodes : ", mesh.NbNodes()
-print "Edges : ", mesh.NbEdges()
-print "Triangles : ", mesh.NbTriangles()
+print "Nodes : ", mesh.NbNodes()
+print "Edges : ", mesh.NbEdges()
+print "Quadrangles : ", mesh.NbQuadrangles()
groupOfCreatedNodes = mesh.DoubleNodeGroup(nodes1, faces1, theMakeGroup=True)
print "New nodes:", groupOfCreatedNodes.GetIDs()
print "\nMesh after the first nodes duplication:"
-print "Nodes : ", mesh.NbNodes()
-print "Edges : ", mesh.NbEdges()
-print "Triangles : ", mesh.NbTriangles()
+print "Nodes : ", mesh.NbNodes()
+print "Edges : ", mesh.NbEdges()
+print "Quadrangles : ", mesh.NbQuadrangles()
# With the duplication of border elements
# Edges to duplicate
edges = mesh.CreateEmptyGroup( smesh.EDGE, 'edges' )
-edges.Add( [ 29, 30, 31 ] )
+edges.Add( [ 32, 33, 34 ] )
# Nodes not to duplicate
nodes2 = mesh.CreateEmptyGroup( smesh.NODE, 'nodes2' )
-nodes2.Add( [ 32, 5 ] )
+nodes2.Add( [ 35, 38 ] )
# Group of faces to replace nodes with new ones
faces2 = mesh.CreateEmptyGroup( smesh.FACE, 'faces2' )
-faces2.Add( [ 576, 578, 580 ] )
+faces2.Add( [ 141, 148, 155 ] )
# Duplicate nodes
print "\nMesh before the second nodes duplication:"
-print "Nodes : ", mesh.NbNodes()
-print "Edges : ", mesh.NbEdges()
-print "Triangles : ", mesh.NbTriangles()
+print "Nodes : ", mesh.NbNodes()
+print "Edges : ", mesh.NbEdges()
+print "Quadrangles : ", mesh.NbQuadrangles()
groupOfNewEdges = mesh.DoubleNodeElemGroup( edges, nodes2, faces2, theMakeGroup=True )
print "New edges:", groupOfNewEdges.GetIDs()
print "\nMesh after the second nodes duplication:"
-print "Nodes : ", mesh.NbNodes()
-print "Edges : ", mesh.NbEdges()
-print "Triangles : ", mesh.NbTriangles()
+print "Nodes : ", mesh.NbNodes()
+print "Edges : ", mesh.NbEdges()
+print "Quadrangles : ", mesh.NbQuadrangles()
# Update object browser
if salome.sg.hasDesktop():
box = geompy.MakeBoxDXDYDZ(100,100,100)
# Create a mesh
-mesh = Mesh(box,"Mesh")
+mesh = smesh.Mesh(box,"Mesh")
mesh.AutomaticHexahedralization()
mesh.Compute()
FILE_PATTERNS = *.doc
EXCLUDE =
IMAGE_PATH = @srcdir@/images @top_srcdir@/src/Tools/padder/doc/images
-EXAMPLE_PATH = @top_srcdir@/src/SMESH_SWIG @top_srcdir@/doc/salome/examples
+EXAMPLE_PATH = @top_srcdir@/doc/salome/examples @top_srcdir@/src/SMESH_SWIG
#---------------------------------------------------------------------------
#HTML related options
TAGFILES = smeshpy_doc.tag=../SMESH/smeshpy_doc #rnv: 07.04.2011 Workaround for the doxygen 1.7.3:
#because it wrongly defines location of the html files for search.
SEARCHENGINE = YES
+
+#---------------------------------------------------------------------------
+#Custom commands
+#---------------------------------------------------------------------------
+ALIASES += tui_script{1}="\include \1 <a href=\"../../examples/SMESH/\1\">Download this script</a>"
\anchor example_3d_mesh
<h2>Example of 3d mesh generation:</h2>
-\include 3dmesh.py
-<a href="../../examples/SMESH/3dmesh.py">Download this script</a>
+\tui_script{3dmesh.py}
Examples of Python scripts for Mesh operations are available by
the following links:
/*!
\page tui_cartesian_algo Usage of Body Fitting algorithm
-\include cartesian_algo.py
-<a href="../../examples/SMESH/cartesian_algo.py">Download this script</a>
+\tui_script{cartesian_algo.py}
*/
<br>
<h2>Construction of a Mesh</h2>
-\include creating_meshes_ex01.py
-<a href="../../examples/SMESH/creating_meshes_ex01.py">Download this script</a>
+\tui_script{creating_meshes_ex01.py}
<br>
\anchor tui_construction_submesh
<h2>Construction of a Submesh</h2>
-\include creating_meshes_ex02.py
-<a href="../../examples/SMESH/creating_meshes_ex02.py">Download this script</a>
+\tui_script{creating_meshes_ex02.py}
<br>
<h2>Change priority of submeshes in Mesh</h2>
-\include creating_meshes_ex03.py
-<a href="../../examples/SMESH/creating_meshes_ex03.py">Download this script</a>
+\tui_script{creating_meshes_ex03.py}
<br>
\anchor tui_editing_mesh
<h2>Editing of a mesh</h2>
-\include creating_meshes_ex04.py
-<a href="../../examples/SMESH/creating_meshes_ex04.py">Download this script</a>
+\tui_script{creating_meshes_ex04.py}
<br>
\anchor tui_export_mesh
<h2>Export of a Mesh</h2>
-\include creating_meshes_ex05.py
-<a href="../../examples/SMESH/creating_meshes_ex05.py">Download this script</a>
+\tui_script{creating_meshes_ex05.py}
<br>
<h2>How to mesh a cylinder with hexahedrons?</h2>
Here you can see an example of python script, creating a hexahedral
mesh on a cylinder. And a picture below the source code of the script,
demonstrating the resulting mesh.
-\include creating_meshes_ex06.py
-<a href="../../examples/SMESH/creating_meshes_ex06.py">Download this script</a>
+\tui_script{creating_meshes_ex06.py}
\image html mesh_cylinder_hexa.png
<br>
\anchor tui_building_compound
<h2>Building a compound of meshes</h2>
-\include creating_meshes_ex07.py
-<a href="../../examples/SMESH/creating_meshes_ex07.py">Download this script</a>
+\tui_script{creating_meshes_ex07.py}
<br>
\anchor tui_copy_mesh
<h2>Mesh Copying</h2>
-\include creating_meshes_ex08.py
-<a href="../../examples/SMESH/creating_meshes_ex08.py">Download this script</a>
+\tui_script{creating_meshes_ex08.py}
*/
<br>
\anchor tui_1d_arithmetic
<h3>Arithmetic 1D</h3>
-\include defining_hypotheses_ex01.py
-<a href="../../examples/SMESH/defining_hypotheses_ex01.py">Download this script</a>
+\tui_script{defining_hypotheses_ex01.py}
<br>
\anchor tui_deflection_1d
<h3>Deflection 1D and Number of Segments</h3>
-\include defining_hypotheses_ex02.py
-<a href="../../examples/SMESH/defining_hypotheses_ex02.py">Download this script</a>
+\tui_script{defining_hypotheses_ex02.py}
<br>
\anchor tui_start_and_end_length
<h3>Start and End Length</h3>
-\include defining_hypotheses_ex03.py
-<a href="../../examples/SMESH/defining_hypotheses_ex03.py">Download this script</a>
+\tui_script{defining_hypotheses_ex03.py}
<br>
\anchor tui_average_length
<h3>Local Length</h3>
-\include defining_hypotheses_ex04.py
-<a href="../../examples/SMESH/defining_hypotheses_ex04.py">Download this script</a>
+\tui_script{defining_hypotheses_ex04.py}
<br><h2>Defining 2D and 3D hypotheses</h2>
<br>
\anchor tui_max_element_area
<h3>Maximum Element Area</h3>
-\include defining_hypotheses_ex05.py
-<a href="../../examples/SMESH/defining_hypotheses_ex05.py">Download this script</a>
+\tui_script{defining_hypotheses_ex05.py}
<br>
\anchor tui_max_element_volume
<h3>Maximum Element Volume</h3>
-\include defining_hypotheses_ex06.py
-<a href="../../examples/SMESH/defining_hypotheses_ex06.py">Download this script</a>
+\tui_script{defining_hypotheses_ex06.py}
<br>
\anchor tui_length_from_edges
<h3>Length from Edges</h3>
-\include defining_hypotheses_ex07.py
-<a href="../../examples/SMESH/defining_hypotheses_ex07.py">Download this script</a>
+\tui_script{defining_hypotheses_ex07.py}
<br><h2>Defining Additional Hypotheses</h2>
<br>
\anchor tui_propagation
<h3>Propagation</h3>
-\include defining_hypotheses_ex08.py
-<a href="../../examples/SMESH/defining_hypotheses_ex08.py">Download this script</a>
+\tui_script{defining_hypotheses_ex08.py}
<br>
\anchor tui_defining_meshing_algos
<h2>Defining Meshing Algorithms</h2>
-\include defining_hypotheses_ex09.py
-<a href="../../examples/SMESH/defining_hypotheses_ex09.py">Download this script</a>
+\tui_script{defining_hypotheses_ex09.py}
<br>
\anchor tui_projection
<h3>Projection Algorithms</h3>
-\include defining_hypotheses_ex10.py
-<a href="../../examples/SMESH/defining_hypotheses_ex10.py">Download this script</a>
+\tui_script{defining_hypotheses_ex10.py}
<h3>Projection 1D2D</h3>
-\include defining_hypotheses_ex11.py
-<a href="../../examples/SMESH/defining_hypotheses_ex11.py">Download this script</a>
+\tui_script{defining_hypotheses_ex11.py}
<br>
\anchor tui_fixed_points
<h2>1D Mesh with Fixed Points example</h2>
-\include defining_hypotheses_ex12.py
-<a href="../../examples/SMESH/defining_hypotheses_ex12.py">Download this script</a>
+\tui_script{defining_hypotheses_ex12.py}
\anchor tui_radial_quadrangle
<h2> Radial Quadrangle 1D2D example </h2>
-\include defining_hypotheses_ex13.py
-<a href="../../examples/SMESH/defining_hypotheses_ex13.py">Download this script</a>
+\tui_script{defining_hypotheses_ex13.py}
\anchor tui_quadrangle_parameters
<h2>Quadrangle Parameters example 1 (meshing a face with 3 edges) </h2>
-\include defining_hypotheses_ex14.py
-<a href="../../examples/SMESH/defining_hypotheses_ex14.py">Download this script</a>
+\tui_script{defining_hypotheses_ex14.py}
<h2>Quadrangle Parameters example 2 (using different types) </h2>
-\include defining_hypotheses_ex15.py
-<a href="../../examples/SMESH/defining_hypotheses_ex15.py">Download this script</a>
+\tui_script{defining_hypotheses_ex15.py}
\anchor tui_import
<h2>"Use Existing Elements" example </h2>
-\include defining_hypotheses_ex16.py
-<a href="../../examples/SMESH/defining_hypotheses_ex16.py">Download this script</a>
+\tui_script{defining_hypotheses_ex16.py}
\anchor tui_viscous_layers
<h2>Viscous layers construction</h2>
-
-\include defining_hypotheses_ex17.py
-<a href="../../examples/SMESH/defining_hypotheses_ex17.py">Download this script</a>
+\tui_script{defining_hypotheses_ex17.py}
*/
- functor type should be \a smesh.FT_AspectRatio
- threshold is floating point value (aspect ratio)
-\include filters_ex01.py
-<a href="../../examples/SMESH/filters_ex01.py">Download this script</a>
+\tui_script{filters_ex01.py}
\sa \ref tui_aspect_ratio
- functor type is \a smesh.FT_AspectRatio3D
- threshold is floating point value (aspect ratio)
-\include filters_ex02.py
-<a href="../../examples/SMESH/filters_ex02.py">Download this script</a>
+\tui_script{filters_ex02.py}
\sa \ref tui_aspect_ratio_3d
- functor type is \a smesh.FT_Warping
- threshold is floating point value (warping angle)
-\include filters_ex03.py
-<a href="../../examples/SMESH/filters_ex03.py">Download this script</a>
+\tui_script{filters_ex03.py}
\sa \ref tui_warping
- functor type is \a smesh.FT_MinimumAngle
- threshold is floating point value (minimum angle)
-\include filters_ex04.py
-<a href="../../examples/SMESH/filters_ex04.py">Download this script</a>
+\tui_script{filters_ex04.py}
\sa \ref tui_minimum_angle
- functor type is \a smesh.FT_Taper
- threshold is floating point value (taper)
-\include filters_ex05.py
-<a href="../../examples/SMESH/filters_ex05.py">Download this script</a>
+\tui_script{filters_ex05.py}
\sa \ref tui_taper
- functor type is \a smesh.FT_Skew
- threshold is floating point value (skew)
-\include filters_ex06.py
-<a href="../../examples/SMESH/filters_ex06.py">Download this script</a>
+\tui_script{filters_ex06.py}
\sa \ref tui_skew
- functor type is \a smesh.FT_Area
- threshold is floating point value (area)
-\include filters_ex07.py
-<a href="../../examples/SMESH/filters_ex07.py">Download this script</a>
+\tui_script{filters_ex07.py}
\sa \ref tui_area
- functor type is \a smesh.FT_Volume3D
- threshold is floating point value (volume)
-\include filters_ex08.py
-<a href="../../examples/SMESH/filters_ex08.py">Download this script</a>
+\tui_script{filters_ex08.py}
\sa \ref tui_volume
- functor type is \a smesh.FT_FreeBorders
- threshold value is not required
-\include filters_ex09.py
-<a href="../../examples/SMESH/filters_ex09.py">Download this script</a>
+\tui_script{filters_ex09.py}
\sa \ref tui_free_borders
- functor type is \a smesh.FT_FreeEdges
- threshold value is not required
-\include filters_ex10.py
-<a href="../../examples/SMESH/filters_ex10.py">Download this script</a>
+\tui_script{filters_ex10.py}
\sa \ref tui_free_edges
- functor type is \a smesh.FT_FreeNodes
- threshold value is not required
-\include filters_ex11.py
-<a href="../../examples/SMESH/filters_ex11.py">Download this script</a>
+\tui_script{filters_ex11.py}
\sa \ref tui_free_nodes
- functor type is \a smesh.FT_FreeFaces
- threshold value is not required
-\include filters_ex12.py
-<a href="../../examples/SMESH/filters_ex12.py">Download this script</a>
+\tui_script{filters_ex12.py}
\sa \ref tui_free_faces
- functor type is \a smesh.FT_BareBorderFace
- threshold value is not required
-\include filters_ex13.py
-<a href="../../examples/SMESH/filters_ex13.py">Download this script</a>
+\tui_script{filters_ex13.py}
\sa \ref tui_bare_border_faces
- threshold value is the face ID
- tolerance is in degrees
-\include filters_ex14.py
-<a href="../../examples/SMESH/filters_ex14.py">Download this script</a>
+\tui_script{filters_ex14.py}
\section filter_over_constrained_faces Over-constrained faces
- functor type is \a smesh.FT_OverConstrainedFace
- threshold value is not required
-\include filters_ex15.py
-<a href="../../examples/SMESH/filters_ex15.py">Download this script</a>
+\tui_script{filters_ex15.py}
\sa \ref tui_over_constrained_faces
smesh.FT_EqualFaces or \a smesh.FT_EqualVolumes,
- threshold value is not required
-\include filters_ex16.py
-<a href="../../examples/SMESH/filters_ex16.py">Download this script</a>
+\tui_script{filters_ex16.py}
\section tui_double_nodes_control Double nodes
- threshold value is not required
- default tolerance is 1.0e-7
-\include filters_ex17.py
-<a href="../../examples/SMESH/filters_ex17.py">Download this script</a>
+\tui_script{filters_ex17.py}
\section filter_borders_multiconnection Borders at multi-connection
- functor type is \a smesh.FT_MultiConnection
- threshold is integer value (number of connections)
-\include filters_ex18.py
-<a href="../../examples/SMESH/filters_ex18.py">Download this script</a>
+\tui_script{filters_ex18.py}
\sa \ref tui_borders_at_multiconnection
- functor type is \a smesh.FT_MultiConnection2D
- threshold is integer value (number of connections)
-\include filters_ex19.py
-<a href="../../examples/SMESH/filters_ex19.py">Download this script</a>
+\tui_script{filters_ex19.py}
\sa \ref tui_borders_at_multiconnection_2d
- functor type should be \a smesh.FT_Length
- threshold is floating point value (length)
-\include filters_ex20.py
-<a href="../../examples/SMESH/filters_ex20.py">Download this script</a>
+\tui_script{filters_ex20.py}
\sa \ref tui_length_1d
- functor type should be \a smesh.FT_Length2D
- threshold is floating point value (edge length)
-\include filters_ex21.py
-<a href="../../examples/SMESH/filters_ex21.py">Download this script</a>
+\tui_script{filters_ex21.py}
\sa \ref tui_length_2d
- functor type should be \a smesh.FT_MaxElementLength2D
- threshold is floating point value (edge/diagonal length)
-\include filters_ex22.py
-<a href="../../examples/SMESH/filters_ex22.py">Download this script</a>
+\tui_script{filters_ex22.py}
\sa \ref tui_max_element_length_2d
- functor type should be \a smesh.FT_MaxElementLength3D
- threshold is floating point value (edge/diagonal length)
-\include filters_ex23.py
-<a href="../../examples/SMESH/filters_ex23.py">Download this script</a>
+\tui_script{filters_ex23.py}
\sa \ref tui_max_element_length_3d
- functor type is \a smesh.FT_BareBorderVolume
- threshold value is not required
-\include filters_ex24.py
-<a href="../../examples/SMESH/filters_ex24.py">Download this script</a>
+\tui_script{filters_ex24.py}
\sa \ref tui_bare_border_volumes
- functor type is \a smesh.FT_OverConstrainedVolume
- threshold value is not required
-\include filters_ex25.py
-<a href="../../examples/SMESH/filters_ex25.py">Download this script</a>
+\tui_script{filters_ex25.py}
\sa \ref tui_over_constrained_faces
- functor type should be \a smesh.FT_BelongToGeom
- threshold is geometrical object
-\include filters_ex26.py
-<a href="../../examples/SMESH/filters_ex26.py">Download this script</a>
+\tui_script{filters_ex26.py}
\section filter_lying_on_geom Lying on Geom
- functor type should be \a smesh.FT_LyingOnGeom
- threshold is geometrical object
-\include filters_ex27.py
-<a href="../../examples/SMESH/filters_ex27.py">Download this script</a>
+\tui_script{filters_ex27.py}
\section filter_belong_to_plane Belong to Plane
- threshold is geometrical object (plane)
- default tolerance is 1.0e-7
-\include filters_ex28.py
-<a href="../../examples/SMESH/filters_ex28.py">Download this script</a>
+\tui_script{filters_ex28.py}
\section filter_belong_to_cylinder Belong to Cylinder
- threshold is geometrical object (cylindrical face)
- default tolerance is 1.0e-7
-\include filters_ex29.py
-<a href="../../examples/SMESH/filters_ex29.py">Download this script</a>
+\tui_script{filters_ex29.py}
\section filter_belong_to_surface Belong to Surface
- threshold is geometrical object (arbitrary surface)
- default tolerance is 1.0e-7
-\include filters_ex30.py
-<a href="../../examples/SMESH/filters_ex30.py">Download this script</a>
+\tui_script{filters_ex30.py}
\section filter_range_of_ids Range of IDs
- functor type is \a smesh.FT_RangeOfIds
- threshold is string listing required IDs and/or ranges of IDs, e.g."1,2,3,50-60,63,67,70-78"
-\include filters_ex31.py
-<a href="../../examples/SMESH/filters_ex31.py">Download this script</a>
+\tui_script{filters_ex31.py}
\section filter_bad_oriented_volume Badly oriented volume
- functor type is \a smesh.FT_BadOrientedVolume
- threshold is not required
-\include filters_ex32.py
-<a href="../../examples/SMESH/filters_ex32.py">Download this script</a>
+\tui_script{filters_ex32.py}
\section filter_linear_or_quadratic Linear / quadratic
- if unary operator is set to smesh.FT_LogicalNOT, the quadratic
elements are selected, otherwise (by default) linear elements are selected
-\include filters_ex33.py
-<a href="../../examples/SMESH/filters_ex33.py">Download this script</a>
+\tui_script{filters_ex33.py}
\section filter_group_color Group color
- functor type is \a smesh.FT_GroupColor
- threshold should be of SALOMEDS.Color type
-\include filters_ex34.py
-<a href="../../examples/SMESH/filters_ex34.py">Download this script</a>
+\tui_script{filters_ex34.py}
\section filter_geom_type Geometry type
- functor type should be \a smesh.FT_ElemGeomType
- threshold is of smesh.GeometryType value
-\include filters_ex35.py
-<a href="../../examples/SMESH/filters_ex35.py">Download this script</a>
+\tui_script{filters_ex35.py}
\section combining_filters How to combine filters with Criterion structures?
Example :
-\include filters_ex36.py
-<a href="../../examples/SMESH/filters_ex36.py">Download this script</a>
+\tui_script{filters_ex36.py}
*/
\n This example represents an iron cable (a thin cylinder) in a concrete bloc (a big cylinder).
The big cylinder is defined by two geometric volumes.
-\include generate_flat_elements.py
-<a href="../../examples/SMESH/generate_flat_elements.py">Download this script</a>
+\tui_script{generate_flat_elements.py}
\n Here, the 4 groups of volumes [Solid_1_1, Solid_2_1, Solid_3_1, Solid_4_1] constitute a partition of the mesh.
The flat elements on group boundaries and on faces are built with the
<br>
\anchor tui_create_standalone_group
<h2>Create a Standalone Group</h2>
-\include grouping_elements_ex01.py
-<a href="../../examples/SMESH/grouping_elements_ex01.py">Download this script</a>
+\tui_script{grouping_elements_ex01.py}
\image html create_group.png
<br>
\anchor tui_create_group_on_geometry
<h2>Create a Group on Geometry</h2>
-\include grouping_elements_ex02.py
-<a href="../../examples/SMESH/grouping_elements_ex02.py">Download this script</a>
+\tui_script{grouping_elements_ex02.py}
<br>
\anchor tui_create_group_on_filter
<h2>Create a Group on Filter</h2>
-\include grouping_elements_ex03.py
-<a href="../../examples/SMESH/grouping_elements_ex03.py">Download this script</a>
+\tui_script{grouping_elements_ex03.py}
<br>
\anchor tui_edit_group
<h2>Edit a Group</h2>
-\include grouping_elements_ex04.py
-<a href="../../examples/SMESH/grouping_elements_ex04.py">Download this script</a>
+\tui_script{grouping_elements_ex04.py}
\image html editing_groups1.png
<br>
\anchor tui_union_of_groups
<h2>Union of groups</h2>
-\include grouping_elements_ex05.py
-<a href="../../examples/SMESH/grouping_elements_ex05.py">Download this script</a>
+\tui_script{grouping_elements_ex05.py}
\image html union_groups1.png
<br>
\anchor tui_intersection_of_groups
<h2>Intersection of groups</h2>
-\include grouping_elements_ex06.py
-<a href="../../examples/SMESH/grouping_elements_ex06.py">Download this script</a>
+\tui_script{grouping_elements_ex06.py}
\image html intersect_groups1.png
<br>
\anchor tui_cut_of_groups
<h2>Cut of groups</h2>
-\include grouping_elements_ex07.py
-<a href="../../examples/SMESH/grouping_elements_ex07.py">Download this script</a>
+\tui_script{grouping_elements_ex07.py}
\image html cut_groups1.png
<br>
\anchor tui_create_dim_group
<h2>Creating groups of entities from existing groups of superior dimensions</h2>
-\include grouping_elements_ex08.py
-<a href="../../examples/SMESH/grouping_elements_ex08.py">Download this script</a>
+\tui_script{grouping_elements_ex08.py}
\image html dimgroup_tui1.png
<center>Source groups of faces</center>
\page tui_measurements_page Measurements
\section tui_min_distance Minimum Distance
-\include measurements_ex01.py
-<a href="../../examples/SMESH/measurements_ex01.py">Download this script</a>
+\tui_script{measurements_ex01.py}
\section tui_bounding_box Bounding Box
-\include measurements_ex02.py
-<a href="../../examples/SMESH/measurements_ex02.py">Download this script</a>
+\tui_script{measurements_ex02.py}
*/
<br>
\anchor tui_add_node
<h3>Add Node</h3>
-\include modifying_meshes_ex01.py
-<a href="../../examples/SMESH/modifying_meshes_ex01.py">Download this script</a>
+\tui_script{modifying_meshes_ex01.py}
<br>
\anchor tui_add_0DElement
<h3>Add 0D Element</h3>
-\include modifying_meshes_ex02.py
-<a href="../../examples/SMESH/modifying_meshes_ex02.py">Download this script</a>
+\tui_script{modifying_meshes_ex02.py}
<br>
\anchor tui_add_0DElement_on_all_nodes
<h3>Add 0D Element on Element Nodes</h3>
-\include modifying_meshes_ex03.py
-<a href="../../examples/SMESH/modifying_meshes_ex03.py">Download this script</a>
+\tui_script{modifying_meshes_ex03.py}
<br>
\anchor tui_add_edge
<h3>Add Edge</h3>
-\include modifying_meshes_ex04.py
-<a href="../../examples/SMESH/modifying_meshes_ex04.py">Download this script</a>
+\tui_script{modifying_meshes_ex04.py}
<br>
\anchor tui_add_triangle
<h3>Add Triangle</h3>
-\include modifying_meshes_ex05.py
-<a href="../../examples/SMESH/modifying_meshes_ex05.py">Download this script</a>
+\tui_script{modifying_meshes_ex05.py}
<br>
\anchor tui_add_quadrangle
<h3>Add Quadrangle</h3>
-\include modifying_meshes_ex06.py
-<a href="../../examples/SMESH/modifying_meshes_ex06.py">Download this script</a>
+\tui_script{modifying_meshes_ex06.py}
<br>
\anchor tui_add_tetrahedron
<h3>Add Tetrahedron</h3>
-\include modifying_meshes_ex07.py
-<a href="../../examples/SMESH/modifying_meshes_ex07.py">Download this script</a>
+\tui_script{modifying_meshes_ex07.py}
<br>
\anchor tui_add_hexahedron
<h3>Add Hexahedron</h3>
-\include modifying_meshes_ex08.py
-<a href="../../examples/SMESH/modifying_meshes_ex08.py">Download this script</a>
+\tui_script{modifying_meshes_ex08.py}
<br>
\anchor tui_add_polygon
<h3>Add Polygon</h3>
-\include modifying_meshes_ex09.py
-<a href="../../examples/SMESH/modifying_meshes_ex09.py">Download this script</a>
+\tui_script{modifying_meshes_ex09.py}
<br>
\anchor tui_add_polyhedron
<h3>Add Polyhedron</h3>
-\include modifying_meshes_ex10.py
-<a href="../../examples/SMESH/modifying_meshes_ex10.py">Download this script</a>
+\tui_script{modifying_meshes_ex10.py}
<br>
\anchor tui_removing_nodes_and_elements
<br>
\anchor tui_removing_nodes
<h3>Removing Nodes</h3>
-\include modifying_meshes_ex11.py
-<a href="../../examples/SMESH/modifying_meshes_ex11.py">Download this script</a>
+\tui_script{modifying_meshes_ex11.py}
<br>
\anchor tui_removing_elements
<h3>Removing Elements</h3>
-\include modifying_meshes_ex12.py
-<a href="../../examples/SMESH/modifying_meshes_ex12.py">Download this script</a>
+\tui_script{modifying_meshes_ex12.py}
<br>
\anchor tui_removing_orphan_nodes
<h3>Removing Orphan Nodes</h3>
-\include modifying_meshes_ex13.py
-<a href="../../examples/SMESH/modifying_meshes_ex13.py">Download this script</a>
+\tui_script{modifying_meshes_ex13.py}
<br>
\anchor tui_renumbering_nodes_and_elements
<h2>Renumbering Nodes and Elements</h2>
-\include modifying_meshes_ex14.py
-<a href="../../examples/SMESH/modifying_meshes_ex14.py">Download this script</a>
+\tui_script{modifying_meshes_ex14.py}
<br>
\anchor tui_moving_nodes
<h2>Moving Nodes</h2>
-\include modifying_meshes_ex15.py
-<a href="../../examples/SMESH/modifying_meshes_ex15.py">Download this script</a>
+\tui_script{modifying_meshes_ex15.py}
<br>
\anchor tui_diagonal_inversion
<h2>Diagonal Inversion</h2>
-\include modifying_meshes_ex16.py
-<a href="../../examples/SMESH/modifying_meshes_ex16.py">Download this script</a>
+\tui_script{modifying_meshes_ex16.py}
<br>
\anchor tui_uniting_two_triangles
<h2>Uniting two Triangles</h2>
-\include modifying_meshes_ex17.py
-<a href="../../examples/SMESH/modifying_meshes_ex17.py">Download this script</a>
+\tui_script{modifying_meshes_ex17.py}
<br>
\anchor tui_uniting_set_of_triangles
<h2>Uniting a Set of Triangles</h2>
-\include modifying_meshes_ex18.py
-<a href="../../examples/SMESH/modifying_meshes_ex18.py">Download this script</a>
+\tui_script{modifying_meshes_ex18.py}
<br>
\anchor tui_orientation
<h2>Orientation</h2>
-\include modifying_meshes_ex19.py
-<a href="../../examples/SMESH/modifying_meshes_ex19.py">Download this script</a>
+\tui_script{modifying_meshes_ex19.py}
<br>
\anchor tui_cutting_quadrangles
<h2>Cutting Quadrangles</h2>
-\include modifying_meshes_ex20.py
-<a href="../../examples/SMESH/modifying_meshes_ex20.py">Download this script</a>
+\tui_script{modifying_meshes_ex20.py}
<br>
\anchor tui_smoothing
<h2>Smoothing</h2>
-\include modifying_meshes_ex21.py
-<a href="../../examples/SMESH/modifying_meshes_ex21.py">Download this script</a>
+\tui_script{modifying_meshes_ex21.py}
<br>
\anchor tui_extrusion
<h2>Extrusion</h2>
-\include modifying_meshes_ex22.py
-<a href="../../examples/SMESH/modifying_meshes_ex22.py">Download this script</a>
+\tui_script{modifying_meshes_ex22.py}
<br>
\anchor tui_extrusion_along_path
<h2>Extrusion along a Path</h2>
-\include modifying_meshes_ex23.py
-<a href="../../examples/SMESH/modifying_meshes_ex23.py">Download this script</a>
+\tui_script{modifying_meshes_ex23.py}
<br>
\anchor tui_revolution
<h2>Revolution</h2>
-\include modifying_meshes_ex24.py
-<a href="../../examples/SMESH/modifying_meshes_ex24.py">Download this script</a>
+\tui_script{modifying_meshes_ex24.py}
<br>
\anchor tui_pattern_mapping
<h2>Pattern Mapping</h2>
-\include modifying_meshes_ex25.py
-<a href="../../examples/SMESH/modifying_meshes_ex25.py">Download this script</a>
+\tui_script{modifying_meshes_ex25.py}
<br>
\anchor tui_quadratic
<h2>Convert mesh to/from quadratic</h2>
-\include modifying_meshes_ex26.py
-<a href="../../examples/SMESH/modifying_meshes_ex26.py">Download this script</a>
+\tui_script{modifying_meshes_ex26.py}
*/
\page tui_notebook_smesh_page Using SALOME NoteBook
\anchor tui_notebook_smesh
-\include notebook_smesh.py
-<a href="../../examples/SMESH/notebook_smesh.py">Download this script</a>
+\tui_script{notebook_smesh.py}
*/
/*!
\page tui_prism_3d_algo Use 3D extrusion meshing algorithm
-\include prism_3d_algo.py
-<a href="../../examples/SMESH/prism_3d_algo.py">Download this script</a>
+\tui_script{prism_3d_algo.py}
The result geometry and mesh is shown below
\image html prism_tui_sample.png
\page tui_quality_controls_page Quality Controls
\section tui_free_borders Free Borders
-\include quality_controls_ex01.py
-<a href="../../examples/SMESH/quality_controls_ex01.py">Download this script</a>
+\tui_script{quality_controls_ex01.py}
\section tui_borders_at_multiconnection Borders at Multiconnection
-\include quality_controls_ex02.py
-<a href="../../examples/SMESH/quality_controls_ex02.py">Download this script</a>
+\tui_script{quality_controls_ex02.py}
\section tui_length_1d Length 1D
-\include quality_controls_ex03.py
-<a href="../../examples/SMESH/quality_controls_ex03.py">Download this script</a>
+\tui_script{quality_controls_ex03.py}
\section tui_free_edges Free Edges
-\include quality_controls_ex04.py
-<a href="../../examples/SMESH/quality_controls_ex04.py">Download this script</a>
+\tui_script{quality_controls_ex04.py}
\section tui_free_nodes Free Nodes
-\include quality_controls_ex05.py
-<a href="../../examples/SMESH/quality_controls_ex05.py">Download this script</a>
+\tui_script{quality_controls_ex05.py}
\section tui_free_faces Free Faces
-\include quality_controls_ex06.py
-<a href="../../examples/SMESH/quality_controls_ex06.py">Download this script</a>
+\tui_script{quality_controls_ex06.py}
\section tui_bare_border_faces Bare border faces
-\include quality_controls_ex07.py
-<a href="../../examples/SMESH/quality_controls_ex07.py">Download this script</a>
+\tui_script{quality_controls_ex07.py}
\section tui_bare_border_volumes Bare border volumes
-\include quality_controls_ex08.py
-<a href="../../examples/SMESH/quality_controls_ex08.py">Download this script</a>
+\tui_script{quality_controls_ex08.py}
\section tui_over_constrained_faces Over-constrained faces
-\include quality_controls_ex09.py
-<a href="../../examples/SMESH/quality_controls_ex09.py">Download this script</a>
+\tui_script{quality_controls_ex09.py}
\section tui_over_constrained_volumes Over-constrained volumes
-\include quality_controls_ex10.py
-<a href="../../examples/SMESH/quality_controls_ex10.py">Download this script</a>
+\tui_script{quality_controls_ex10.py}
\section tui_length_2d Length 2D
-\include quality_controls_ex11.py
-<a href="../../examples/SMESH/quality_controls_ex11.py">Download this script</a>
+\tui_script{quality_controls_ex11.py}
\section tui_borders_at_multiconnection_2d Borders at Multiconnection 2D
-\include quality_controls_ex12.py
-<a href="../../examples/SMESH/quality_controls_ex12.py">Download this script</a>
+\tui_script{quality_controls_ex12.py}
\section tui_area Area
-\include quality_controls_ex13.py
-<a href="../../examples/SMESH/quality_controls_ex13.py">Download this script</a>
+\tui_script{quality_controls_ex13.py}
\section tui_taper Taper
-\include quality_controls_ex14.py
-<a href="../../examples/SMESH/quality_controls_ex14.py">Download this script</a>
+\tui_script{quality_controls_ex14.py}
\section tui_aspect_ratio Aspect Ratio
-\include quality_controls_ex15.py
-<a href="../../examples/SMESH/quality_controls_ex15.py">Download this script</a>
+\tui_script{quality_controls_ex15.py}
\section tui_minimum_angle Minimum Angle
-\include quality_controls_ex16.py
-<a href="../../examples/SMESH/quality_controls_ex16.py">Download this script</a>
+\tui_script{quality_controls_ex16.py}
\section tui_warping Warping
-\include quality_controls_ex17.py
-<a href="../../examples/SMESH/quality_controls_ex17.py">Download this script</a>
+\tui_script{quality_controls_ex17.py}
\section tui_skew Skew
-\include quality_controls_ex18.py
-<a href="../../examples/SMESH/quality_controls_ex18.py">Download this script</a>
+\tui_script{quality_controls_ex18.py}
\section tui_max_element_length_2d Element Diameter 2D
-\include quality_controls_ex19.py
-<a href="../../examples/SMESH/quality_controls_ex19.py">Download this script</a>
+\tui_script{quality_controls_ex19.py}
\section tui_aspect_ratio_3d Aspect Ratio 3D
-\include quality_controls_ex20.py
-<a href="../../examples/SMESH/quality_controls_ex20.py">Download this script</a>
+\tui_script{quality_controls_ex20.py}
\section tui_volume Volume
-\include quality_controls_ex21.py
-<a href="../../examples/SMESH/quality_controls_ex21.py">Download this script</a>
+\tui_script{quality_controls_ex21.py}
\section tui_max_element_length_3d Element Diameter 3D
-\include quality_controls_ex22.py
-<a href="../../examples/SMESH/quality_controls_ex22.py">Download this script</a>
+\tui_script{quality_controls_ex22.py}
*/
<br>
\anchor tui_translation
<h3>Translation</h3>
-\include transforming_meshes_ex01.py
-<a href="../../examples/SMESH/transforming_meshes_ex01.py">Download this script</a>
+\tui_script{transforming_meshes_ex01.py}
<br>
\anchor tui_rotation
<h3>Rotation</h3>
-\include transforming_meshes_ex02.py
-<a href="../../examples/SMESH/transforming_meshes_ex02.py">Download this script</a>
+\tui_script{transforming_meshes_ex02.py}
<br>
\anchor tui_scale
<h3>Scale</h3>
-\include transforming_meshes_ex03.py
-<a href="../../examples/SMESH/transforming_meshes_ex03.py">Download this script</a>
+\tui_script{transforming_meshes_ex03.py}
<br>
\anchor tui_symmetry
<h3>Symmetry</h3>
-\include transforming_meshes_ex04.py
-<a href="../../examples/SMESH/transforming_meshes_ex04.py">Download this script</a>
+\tui_script{transforming_meshes_ex04.py}
<br>
\anchor tui_merging_nodes
<h3>Merging Nodes</h3>
-\include transforming_meshes_ex05.py
-<a href="../../examples/SMESH/transforming_meshes_ex05.py">Download this script</a>
+\tui_script{transforming_meshes_ex05.py}
<br>
\anchor tui_merging_elements
<h3>Merging Elements</h3>
-\include transforming_meshes_ex06.py
-<a href="../../examples/SMESH/transforming_meshes_ex06.py">Download this script</a>
+\tui_script{transforming_meshes_ex06.py}
<br><h2>Sewing Meshes</h2>
<br>
\anchor tui_sew_meshes_border_to_side
<h3>Sew Meshes Border to Side</h3>
-\include transforming_meshes_ex07.py
-<a href="../../examples/SMESH/transforming_meshes_ex07.py">Download this script</a>
+\tui_script{transforming_meshes_ex07.py}
<br>
\anchor tui_sew_conform_free_borders
<h3>Sew Conform Free Borders</h3>
-\include transforming_meshes_ex08.py
-<a href="../../examples/SMESH/transforming_meshes_ex08.py">Download this script</a>
+\tui_script{transforming_meshes_ex08.py}
<br>
\anchor tui_sew_free_borders
<h3>Sew Free Borders</h3>
-\include transforming_meshes_ex09.py
-<a href="../../examples/SMESH/transforming_meshes_ex09.py">Download this script</a>
+\tui_script{transforming_meshes_ex09.py}
<br>
\anchor tui_sew_side_elements
<h3>Sew Side Elements</h3>
-\include transforming_meshes_ex10.py
-<a href="../../examples/SMESH/transforming_meshes_ex10.py">Download this script</a>
+\tui_script{transforming_meshes_ex10.py}
<br>
\anchor tui_duplicate_nodes
<h3>Duplicate nodes</h3>
-\include transforming_meshes_ex11.py
-<a href="../../examples/SMESH/transforming_meshes_ex11.py">Download this script</a>
+\tui_script{transforming_meshes_ex11.py}
<br>
\anchor tui_make_2dmesh_from_3d
<h3>Create boundary elements</h3>
-\include transforming_meshes_ex12.py
-<a href="../../examples/SMESH/transforming_meshes_ex12.py">Download this script</a>
+\tui_script{transforming_meshes_ex12.py}
<br>
\anchor tui_reorient_faces
<h3>Reorient faces by vector</h3>
-\include transforming_meshes_ex13.py
-<a href="../../examples/SMESH/transforming_meshes_ex13.py">Download this script</a>
+\tui_script{transforming_meshes_ex13.py}
*/
which is actulally just a stub allowing to use your own 2D algoritm
implemented in Python.
-\include use_existing_faces.py
-<a href="../../examples/SMESH/use_existing_faces.py">Download this script</a>
+\tui_script{use_existing_faces.py}
Resulting mesh:
\image html use_existing_face_sample_mesh.png
<br>
\anchor tui_viewing_mesh_infos
<h2>Viewing Mesh Infos</h2>
-\include viewing_meshes_ex01.py
-<a href="../../examples/SMESH/viewing_meshes_ex01.py">Download this script</a>
+\tui_script{viewing_meshes_ex01.py}
<br>
\anchor tui_find_element_by_point
<h2>Find Element by Point</h2>
-\include viewing_meshes_ex02.py
-<a href="../../examples/SMESH/viewing_meshes_ex02.py">Download this script</a>
+\tui_script{viewing_meshes_ex02.py}
*/
// Read elements
- int iN[28];
+ int iN[28]; // 28 - nb nodes in HEX27 (+ 1 for safety :)
+
+ /* Read extra vertices for quadratic edges */
+ std::vector<int> quadNodesAtEdges;
+ int nbQuadEdges = 0;
+ if ( (nbQuadEdges = GmfStatKwd(meshID, GmfExtraVerticesAtEdges)) )
+ {
+ quadNodesAtEdges.reserve( nbQuadEdges );
+ GmfGotoKwd(meshID, GmfExtraVerticesAtEdges);
+ for ( int i = 1; i <= nbQuadEdges; ++i )
+ {
+ GmfGetLin(meshID, GmfExtraVerticesAtEdges, &iN[0], &iN[1], &iN[2]);
+ quadNodesAtEdges.push_back(iN[2]);
+ }
+ }
/* Read edges */
const int edgeIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbEdges = GmfStatKwd(meshID, GmfEdges))
{
+ const bool readQuadNodes = ( nbQuadEdges == nbEdges );
GmfGotoKwd(meshID, GmfEdges);
for ( int i = 1; i <= nbEdges; ++i )
{
GmfGetLin(meshID, GmfEdges, &iN[0], &iN[1], &ref);
- if ( !myMesh->AddEdgeWithID( iN[0], iN[1], edgeIDShift + i ))
- status = storeBadNodeIds( "GmfEdges",i, 2, iN[0], iN[1] );
+ if ( readQuadNodes )
+ {
+ const int midN = quadNodesAtEdges[i-1];
+ if ( !myMesh->AddEdgeWithID( iN[0], iN[1], midN, edgeIDShift + i ))
+ status = storeBadNodeIds( "GmfEdges + GmfExtraVerticesAtEdges",i, 3, iN[0],iN[1],midN);
+ }
+ else
+ {
+ if ( !myMesh->AddEdgeWithID( iN[0], iN[1], edgeIDShift + i ))
+ status = storeBadNodeIds( "GmfEdges",i, 2, iN[0], iN[1] );
+ }
}
}
- /* Read quadratic edges */
- const int edge2IDShift = myMesh->GetMeshInfo().NbElements();
- if ( int nbEdges = GmfStatKwd(meshID, GmfEdgesP2))
+ // the vector of extra vertices at edges won't be used anymore so it is cleared
+ quadNodesAtEdges.clear();
+
+ /* Read extra vertices for quadratic triangles */
+ std::vector< std::vector<int> > quadNodesAtTriangles;
+ int nbQuadTria = 0;
+ if ( (nbQuadTria = GmfStatKwd(meshID, GmfExtraVerticesAtTriangles)) )
{
- GmfGotoKwd(meshID, GmfEdgesP2);
- for ( int i = 1; i <= nbEdges; ++i )
+ GmfGotoKwd(meshID, GmfExtraVerticesAtTriangles);
+ quadNodesAtTriangles.reserve( nbQuadTria );
+ std::vector<int> nodes(4);
+ for ( int i = 1; i <= nbQuadTria; ++i )
{
- GmfGetLin(meshID, GmfEdgesP2, &iN[0], &iN[1], &iN[2], &ref);
- if ( !myMesh->AddEdgeWithID( iN[0], iN[1], iN[2], edge2IDShift + i ))
- status = storeBadNodeIds( "GmfEdgesP2",i, 3, iN[0], iN[1], iN[2] );
+ GmfGetLin(meshID, GmfExtraVerticesAtTriangles,
+ &iN[0], &iN[1], &iN[2], &iN[3], &iN[4],
+ &iN[5]); // iN[5] - preview TRIA7
+ nodes.clear();
+ nodes.push_back(iN[2]);
+ nodes.push_back(iN[3]);
+ nodes.push_back(iN[4]);
+ nodes.push_back(iN[5]);
+ nodes.resize( iN[1] );
+
+ quadNodesAtTriangles.push_back(nodes);
}
}
+
/* Read triangles */
const int triaIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbTria = GmfStatKwd(meshID, GmfTriangles))
{
+ const bool readQuadNodes = (nbQuadTria == nbTria);
GmfGotoKwd(meshID, GmfTriangles);
for ( int i = 1; i <= nbTria; ++i )
{
GmfGetLin(meshID, GmfTriangles, &iN[0], &iN[1], &iN[2], &ref);
- if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], triaIDShift + i ))
- status = storeBadNodeIds( "GmfTriangles",i, 3, iN[0], iN[1], iN[2] );
+ if ( readQuadNodes )
+ {
+ const std::vector<int>& midN = quadNodesAtTriangles[ i-1 ];
+ if ( !myMesh->AddFaceWithID( iN[0],iN[1],iN[2], midN[0],midN[1],midN[2], triaIDShift + i ))
+ status = storeBadNodeIds( "GmfTriangles + GmfExtraVerticesAtTriangles",i, 6,
+ iN[0],iN[1],iN[2], midN[0],midN[1],midN[2] );
+ }
+ else
+ {
+ if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], triaIDShift + i ))
+ status = storeBadNodeIds( "GmfTriangles",i, 3, iN[0], iN[1], iN[2] );
+ }
}
}
- /* Read quadratic triangles */
- const int tria2IDShift = myMesh->GetMeshInfo().NbElements();
- if ( int nbTria = GmfStatKwd(meshID, GmfTrianglesP2))
+ // the vector of extra vertices at triangles won't be used anymore so it is cleared
+ quadNodesAtTriangles.clear();
+
+ /* Read extra vertices for quadratic quadrangles */
+ std::vector< std::vector<int> > quadNodesAtQuadrilaterals;
+ int nbQuadQuad = 0;
+ if ( (nbQuadQuad = GmfStatKwd(meshID, GmfExtraVerticesAtQuadrilaterals)) )
{
- GmfGotoKwd(meshID, GmfTrianglesP2);
- for ( int i = 1; i <= nbTria; ++i )
+ GmfGotoKwd(meshID, GmfExtraVerticesAtQuadrilaterals);
+ quadNodesAtQuadrilaterals.reserve( nbQuadQuad );
+ std::vector<int> nodes( 5 );
+ for ( int i = 1; i <= nbQuadQuad; ++i )
{
- GmfGetLin(meshID, GmfTrianglesP2,
- &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &ref);
- if ( !myMesh->AddFaceWithID( iN[0],iN[1],iN[2],iN[3],iN[4],iN[5],
- tria2IDShift + i ))
- status = storeBadNodeIds( "GmfTrianglesP2",i, 6, iN[0],iN[1],iN[2],iN[3],iN[4],iN[5] );
+ GmfGetLin(meshID, GmfExtraVerticesAtQuadrilaterals,
+ &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &iN[6]);
+ nodes.clear();
+ nodes.push_back(iN[2]);
+ nodes.push_back(iN[3]);
+ nodes.push_back(iN[4]);
+ nodes.push_back(iN[5]);
+ nodes.push_back(iN[6]);
+ nodes.resize( iN[1] );
+
+ quadNodesAtQuadrilaterals.push_back(nodes);
}
}
- /* Read quadrangles */
+
+ /* Read quadrangles */
const int quadIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbQuad = GmfStatKwd(meshID, GmfQuadrilaterals))
{
+ const bool readQuadNodes = (nbQuadQuad == nbQuad);
GmfGotoKwd(meshID, GmfQuadrilaterals);
for ( int i = 1; i <= nbQuad; ++i )
{
GmfGetLin(meshID, GmfQuadrilaterals, &iN[0], &iN[1], &iN[2], &iN[3], &ref);
- if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], iN[3], quadIDShift + i ))
- status = storeBadNodeIds( "GmfQuadrilaterals",i, 4, iN[0], iN[1],iN[2], iN[3] );
+ if ( readQuadNodes )
+ {
+ const std::vector<int>& midN = quadNodesAtQuadrilaterals[ i-1 ];
+ if ( midN.size() == 4 )
+ {
+ if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], iN[3],
+ midN[0], midN[1], midN[2], midN[3],
+ quadIDShift + i ))
+ status = storeBadNodeIds( "GmfQuadrilaterals + GmfExtraVerticesAtQuadrilaterals",i, 8,
+ iN[0], iN[1],iN[2], iN[3],
+ midN[0], midN[1], midN[2], midN[3]);
+ }
+ else
+ {
+ if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], iN[3],
+ midN[0], midN[1], midN[2], midN[3], midN[4],
+ quadIDShift + i ))
+ status = storeBadNodeIds( "GmfQuadrilaterals + GmfExtraVerticesAtQuadrilaterals",i, 9,
+ iN[0], iN[1],iN[2], iN[3],
+ midN[0], midN[1], midN[2], midN[3], midN[4]);
+ }
+ }
+ else
+ {
+ if ( !myMesh->AddFaceWithID( iN[0], iN[1], iN[2], iN[3], quadIDShift + i ))
+ status = storeBadNodeIds( "GmfQuadrilaterals",i, 4, iN[0], iN[1],iN[2], iN[3] );
+ }
}
}
- /* Read bi-quadratic quadrangles */
- const int quad2IDShift = myMesh->GetMeshInfo().NbElements();
- if ( int nbQuad = GmfStatKwd(meshID, GmfQuadrilateralsQ2))
+ // the vector of extra vertices at quadrilaterals won't be used anymore so it is cleared
+ quadNodesAtQuadrilaterals.clear();
+
+ /* Read extra vertices for quadratic tetrahedra */
+ std::vector< std::vector<int> > quadNodesAtTetrahedra;
+ int nbQuadTetra = 0;
+ if ( (nbQuadTetra = GmfStatKwd(meshID, GmfExtraVerticesAtTetrahedra)) )
{
- GmfGotoKwd(meshID, GmfQuadrilateralsQ2);
- for ( int i = 1; i <= nbQuad; ++i )
+ GmfGotoKwd(meshID, GmfExtraVerticesAtTetrahedra);
+ quadNodesAtTetrahedra.reserve( nbQuadTetra );
+ std::vector<int> nodes( 6 );
+ for ( int i = 1; i <= nbQuadTetra; ++i )
{
- GmfGetLin(meshID, GmfQuadrilateralsQ2,
- &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &iN[6], &iN[7], &iN[8], &ref);
- if ( !myMesh->AddFaceWithID( iN[0],iN[1],iN[2],iN[3],iN[4],iN[5],iN[6],iN[7],iN[8],
- quad2IDShift + i ))
- status = storeBadNodeIds( "GmfQuadrilateralsQ2",i,
- 9, iN[0],iN[1],iN[2],iN[3],iN[4],iN[5],iN[6],iN[7],iN[8] );
+ GmfGetLin(meshID, GmfExtraVerticesAtTetrahedra,
+ &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &iN[6], &iN[7]);
+ nodes.clear();
+ nodes.push_back(iN[2]);
+ nodes.push_back(iN[3]);
+ nodes.push_back(iN[4]);
+ nodes.push_back(iN[5]);
+ nodes.push_back(iN[6]);
+ nodes.push_back(iN[7]);
+ nodes.resize( iN[1] );
+
+ quadNodesAtTetrahedra.push_back(nodes);
}
}
+
/* Read terahedra */
const int tetIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbTet = GmfStatKwd(meshID, GmfTetrahedra))
{
+ const bool readQuadNodes = (nbQuadTetra == nbTet);
GmfGotoKwd(meshID, GmfTetrahedra);
for ( int i = 1; i <= nbTet; ++i )
{
GmfGetLin(meshID, GmfTetrahedra, &iN[0], &iN[1], &iN[2], &iN[3], &ref);
- if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3], tetIDShift + i ))
- status = storeBadNodeIds( "GmfTetrahedra",i, 4, iN[0], iN[1],iN[2], iN[3] );
- }
- }
- /* Read quadratic terahedra */
- const int tet2IDShift = myMesh->GetMeshInfo().NbElements();
- if ( int nbTet = GmfStatKwd(meshID, GmfTetrahedraP2))
- {
- GmfGotoKwd(meshID, GmfTetrahedraP2);
- for ( int i = 1; i <= nbTet; ++i )
- {
- GmfGetLin(meshID, GmfTetrahedraP2, &iN[0], &iN[1], &iN[2],
- &iN[3], &iN[4], &iN[5], &iN[6], &iN[7], &iN[8], &iN[9], &ref);
- if ( !myMesh->AddVolumeWithID( iN[0],iN[2],iN[1],iN[3],
- iN[6],iN[5],iN[4],
- iN[7],iN[9],iN[8], tet2IDShift + i ))
- status = storeBadNodeIds( "GmfTetrahedraP2",i, 10, iN[0],iN[1],iN[2],iN[3],
- iN[4],iN[5],iN[6],iN[7],iN[8],iN[9] );
+ if ( readQuadNodes )
+ {
+ const std::vector<int>& midN = quadNodesAtTetrahedra[ i-1 ];
+ if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3],
+ midN[2], midN[1], midN[0], midN[3], midN[5], midN[4], tetIDShift + i ))
+ status = storeBadNodeIds( "GmfTetrahedra + GmfExtraVerticesAtTetrahedra",i, 10, iN[0], iN[2], iN[1], iN[3],
+ midN[2], midN[1], midN[0], midN[3], midN[5], midN[4] );
+ }
+ else
+ {
+ if ( !myMesh->AddVolumeWithID( iN[0], iN[2], iN[1], iN[3], tetIDShift + i ) )
+ status = storeBadNodeIds( "GmfTetrahedra" ,i, 4, iN[0], iN[2], iN[1], iN[3] );
+ }
}
}
+ // the vector of extra vertices at tetrahedra won't be used anymore so it is cleared
+ quadNodesAtTetrahedra.clear();
+
/* Read pyramids */
const int pyrIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbPyr = GmfStatKwd(meshID, GmfPyramids))
status = storeBadNodeIds( "GmfPyramids",i, 5, iN[0], iN[1],iN[2], iN[3], iN[4] );
}
}
- /* Read hexahedra */
- const int hexIDShift = myMesh->GetMeshInfo().NbElements();
- if ( int nbHex = GmfStatKwd(meshID, GmfHexahedra))
+
+ /* Read extra vertices for quadratic hexahedra */
+ std::vector< std::vector<int> > quadNodesAtHexahedra;
+ int nbQuadHexa = 0;
+ if ( (nbQuadHexa = GmfStatKwd(meshID, GmfExtraVerticesAtHexahedra)) )
{
- GmfGotoKwd(meshID, GmfHexahedra);
- for ( int i = 1; i <= nbHex; ++i )
+ GmfGotoKwd(meshID, GmfExtraVerticesAtHexahedra);
+ quadNodesAtHexahedra.reserve( nbQuadHexa );
+ std::vector<int> nodes( 19 );
+ for ( int i = 1; i <= nbQuadHexa; ++i )
{
- GmfGetLin(meshID, GmfHexahedra,
- &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5], &iN[6], &iN[7], &ref);
- if ( !myMesh->AddVolumeWithID( iN[0], iN[3], iN[2], iN[1], iN[4], iN[7], iN[6], iN[5],
- hexIDShift + i))
- status = storeBadNodeIds( "GmfHexahedra",i,
- 8, iN[0], iN[1],iN[2], iN[3], iN[4], iN[7], iN[6], iN[5] );
+ GmfGetLin(meshID, GmfExtraVerticesAtHexahedra, &iN[0], &iN[1], // Hexa Id, Nb of extra vertices
+ &iN[2], &iN[3], &iN[4], &iN[5],
+ &iN[6], &iN[7], &iN[8], &iN[9],
+ &iN[10], &iN[11], &iN[12], &iN[13], // HEXA20
+ &iN[14],
+ &iN[15], &iN[16], &iN[17], &iN[18],
+ &iN[19],
+ &iN[20]); // HEXA27
+ nodes.clear();
+ nodes.push_back(iN[2]);
+ nodes.push_back(iN[3]);
+ nodes.push_back(iN[4]);
+ nodes.push_back(iN[5]);
+ nodes.push_back(iN[6]);
+ nodes.push_back(iN[7]);
+ nodes.push_back(iN[8]);
+ nodes.push_back(iN[9]);
+ nodes.push_back(iN[10]);
+ nodes.push_back(iN[11]);
+ nodes.push_back(iN[12]);
+ nodes.push_back(iN[13]);
+ nodes.push_back(iN[14]);
+ nodes.push_back(iN[15]);
+ nodes.push_back(iN[16]);
+ nodes.push_back(iN[17]);
+ nodes.push_back(iN[18]);
+ nodes.push_back(iN[19]);
+ nodes.push_back(iN[20]);
+ nodes.resize( iN[1] );
+
+ quadNodesAtHexahedra.push_back(nodes);
}
}
- /* Read tri-quadratic hexahedra */
- const int hex2IDShift = myMesh->GetMeshInfo().NbElements();
- if ( int nbHex = GmfStatKwd(meshID, GmfHexahedraQ2))
+
+ /* Read hexahedra */
+ const int hexIDShift = myMesh->GetMeshInfo().NbElements();
+ if ( int nbHex = GmfStatKwd(meshID, GmfHexahedra))
{
- GmfGotoKwd(meshID, GmfHexahedraQ2);
+ const bool readQuadNodes = (nbQuadHexa == nbHex);
+ GmfGotoKwd(meshID, GmfHexahedra);
for ( int i = 1; i <= nbHex; ++i )
{
- GmfGetLin(meshID, GmfHexahedraQ2, &iN[0], &iN[1], &iN[2], &iN[3], &iN[4], &iN[5],
- &iN[6], &iN[7], &iN[8],&iN[9],&iN[10],&iN[11],&iN[12],&iN[13],&iN[14],
- &iN[15],&iN[16],&iN[17],&iN[18],&iN[19],&iN[20],&iN[21],&iN[22],&iN[23],
- &iN[24],&iN[25],&iN[26], &ref);
- if ( !myMesh->AddVolumeWithID( iN[0],iN[3],iN[2],iN[1],iN[4],iN[7],iN[6],iN[5],iN[11],iN[10],
- iN[9],iN[8],iN[12],iN[15],iN[14], iN[13],iN[19],iN[18],iN[17],
- iN[16],iN[20],iN[24],iN[23],iN[22],iN[21], iN[25],iN[26],
- hex2IDShift + i ))
- status = storeBadNodeIds( "GmfHexahedraQ2",i, 27,
- iN[0],iN[3],iN[2],iN[1],iN[4], iN[7],iN[6],iN[5],iN[11],iN[10],
- iN[9],iN[8],iN[12],iN[15],iN[14], iN[13],iN[19],iN[18],iN[17],
- iN[16],iN[20],iN[24],iN[23],iN[22],iN[21], iN[25],iN[26]);
+ GmfGetLin(meshID, GmfHexahedra, &iN[0], &iN[1], &iN[2], &iN[3],
+ &iN[4], &iN[5], &iN[6], &iN[7],&ref);
+ if ( readQuadNodes )
+ {
+ const std::vector<int>& midN = quadNodesAtHexahedra[ i-1 ];
+ if ( midN.size() == 12 ) // HEXA20
+ {
+ if ( !myMesh->AddVolumeWithID( iN[0], iN[3], iN[2], iN[1],
+ iN[4], iN[7], iN[6], iN[5],
+ midN[3], midN[2], midN[1], midN[0],
+ midN[7], midN[6], midN[5], midN[4],
+ midN[8], midN[11], midN[10], midN[9],
+ tetIDShift + i ))
+ status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 20,
+ iN[0], iN[3], iN[2], iN[1],
+ iN[4], iN[7], iN[6], iN[5],
+ midN[3], midN[2], midN[1], midN[0],
+ midN[7], midN[6], midN[5], midN[4],
+ midN[8], midN[11], midN[10], midN[9]);
+ }
+ else // HEXA27
+ {
+ if ( !myMesh->AddVolumeWithID( iN[0], iN[3], iN[2], iN[1],
+ iN[4], iN[7], iN[6], iN[5],
+ midN[3], midN[2], midN[1], midN[0],
+ midN[7], midN[6], midN[5], midN[4],
+ midN[8], midN[11], midN[10], midN[9],
+ midN[12],
+ midN[16], midN[15], midN[14], midN[13],
+ midN[17],
+ midN[18],
+ tetIDShift + i ))
+ status = storeBadNodeIds( "GmfHexahedra + GmfExtraVerticesAtHexahedra",i, 27,
+ iN[0], iN[3], iN[2], iN[1],
+ iN[4], iN[7], iN[6], iN[5],
+ midN[3], midN[2], midN[1], midN[0],
+ midN[7], midN[6], midN[5], midN[4],
+ midN[8], midN[11], midN[10], midN[9],
+ midN[12],
+ midN[16], midN[15], midN[14], midN[13],
+ midN[17],
+ midN[18]);
+ }
+ }
+ else
+ {
+ if ( !myMesh->AddVolumeWithID( iN[0], iN[3], iN[2], iN[1],
+ iN[4], iN[7], iN[6], iN[5], hexIDShift + i ) )
+ status = storeBadNodeIds( "GmfHexahedra" ,i, 8, iN[0], iN[3], iN[2], iN[1],
+ iN[4], iN[7], iN[6], iN[5] );
+ }
}
}
+ // the vector of extra vertices at tetrahedra won't be used anymore so it is cleared
+ quadNodesAtHexahedra.clear();
+
/* Read prism */
const int prismIDShift = myMesh->GetMeshInfo().NbElements();
if ( int nbPrism = GmfStatKwd(meshID, GmfPrisms))
const SMDS_MeshElement* elem = elemIt->next(); \
GmfSetLin(meshID, GmfKwd,
+#define BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity, GmfKwd, elem, nbVertices ) \
+ elemIt = myMesh->elementEntityIterator( SMDSEntity ); \
+ if ( elemIt->more() ) \
+ { \
+ GmfSetKwd(meshID, GmfKwd, myMesh->GetMeshInfo().NbEntities( SMDSEntity )); \
+ for ( int gmfID = 1; elemIt->more(); ++gmfID ) \
+ { \
+ const SMDS_MeshElement* elem = elemIt->next(); \
+ GmfSetLin(meshID, GmfKwd, gmfID, nbVertices,
+
#define END_ELEM_WRITE( elem ) \
elem->getshapeId() ); \
}} \
e2id.insert( e2id.end(), make_pair( elem, gmfID )); \
}} \
+#define END_EXTRA_VERTICES_WRITE() \
+ ); \
+ }} \
+
DriverGMF_Write::DriverGMF_Write():
Driver_SMESHDS_Mesh(), _exportRequiredGroups( true )
{
}
+//================================================================================
+/*!
+ * \brief Reads a GMF file
+ */
+//================================================================================
+
Driver_Mesh::Status DriverGMF_Write::Perform()
{
Kernel_Utils::Localizer loc;
node2IdMap[ edge->GetNode( 0 )],
node2IdMap[ edge->GetNode( 1 )],
END_ELEM_WRITE_ADD_TO_MAP( edge, edge2IDMap );
-
+
// quadratic edges
- BEGIN_ELEM_WRITE( SMDSEntity_Quad_Edge, GmfEdgesP2, edge )
+ BEGIN_ELEM_WRITE( SMDSEntity_Quad_Edge, GmfEdges, edge )
node2IdMap[ edge->GetNode( 0 )],
node2IdMap[ edge->GetNode( 1 )],
- node2IdMap[ edge->GetNode( 2 )],
END_ELEM_WRITE( edge );
-
+
+ BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_Quad_Edge, GmfExtraVerticesAtEdges, edge, 1 )
+ node2IdMap[ edge->GetNode( 2 )]
+ END_EXTRA_VERTICES_WRITE();
+
// triangles
TElem2IDMap tria2IDMap;
BEGIN_ELEM_WRITE( SMDSEntity_Triangle, GmfTriangles, tria )
node2IdMap[ tria->GetNode( 1 )],
node2IdMap[ tria->GetNode( 2 )],
END_ELEM_WRITE_ADD_TO_MAP( tria, tria2IDMap );
-
+
// quadratic triangles
- BEGIN_ELEM_WRITE( SMDSEntity_Quad_Triangle, GmfTrianglesP2, tria )
+ BEGIN_ELEM_WRITE( SMDSEntity_Quad_Triangle, GmfTriangles, tria )
node2IdMap[ tria->GetNode( 0 )],
node2IdMap[ tria->GetNode( 1 )],
node2IdMap[ tria->GetNode( 2 )],
+ END_ELEM_WRITE( tria );
+
+ BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_Quad_Triangle, GmfExtraVerticesAtTriangles, tria, 3 )
node2IdMap[ tria->GetNode( 3 )],
node2IdMap[ tria->GetNode( 4 )],
- node2IdMap[ tria->GetNode( 5 )],
- END_ELEM_WRITE( tria );
-
+ node2IdMap[ tria->GetNode( 5 )]
+ END_EXTRA_VERTICES_WRITE();
+
// quadrangles
TElem2IDMap quad2IDMap;
BEGIN_ELEM_WRITE( SMDSEntity_Quadrangle, GmfQuadrilaterals, quad )
node2IdMap[ quad->GetNode( 3 )],
END_ELEM_WRITE_ADD_TO_MAP( quad, quad2IDMap );
- // bi-quadratic quadrangles
- BEGIN_ELEM_WRITE( SMDSEntity_BiQuad_Quadrangle, GmfQuadrilateralsQ2, quad )
+ // quadratic quadrangles
+ BEGIN_ELEM_WRITE( SMDSEntity_Quad_Quadrangle, GmfQuadrilaterals, quad )
node2IdMap[ quad->GetNode( 0 )],
- node2IdMap[ quad->GetNode( 3 )],
- node2IdMap[ quad->GetNode( 2 )],
node2IdMap[ quad->GetNode( 1 )],
- node2IdMap[ quad->GetNode( 7 )],
- node2IdMap[ quad->GetNode( 6 )],
- node2IdMap[ quad->GetNode( 5 )],
+ node2IdMap[ quad->GetNode( 2 )],
+ node2IdMap[ quad->GetNode( 3 )],
+ END_ELEM_WRITE( quad );
+
+ BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_Quad_Quadrangle, GmfExtraVerticesAtQuadrilaterals, quad, 4 )
node2IdMap[ quad->GetNode( 4 )],
- node2IdMap[ quad->GetNode( 8 )],
+ node2IdMap[ quad->GetNode( 5 )],
+ node2IdMap[ quad->GetNode( 6 )],
+ node2IdMap[ quad->GetNode( 7 )]
+ END_EXTRA_VERTICES_WRITE();
+
+ // bi-quadratic quadrangles
+ BEGIN_ELEM_WRITE( SMDSEntity_BiQuad_Quadrangle, GmfQuadrilaterals, quad )
+ node2IdMap[ quad->GetNode( 0 )],
+ node2IdMap[ quad->GetNode( 1 )],
+ node2IdMap[ quad->GetNode( 2 )],
+ node2IdMap[ quad->GetNode( 3 )],
END_ELEM_WRITE( quad );
-
+
+ BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_BiQuad_Quadrangle, GmfExtraVerticesAtQuadrilaterals, quad, 5 )
+ node2IdMap[ quad->GetNode( 4 )],
+ node2IdMap[ quad->GetNode( 5 )],
+ node2IdMap[ quad->GetNode( 6 )],
+ node2IdMap[ quad->GetNode( 7 )],
+ node2IdMap[ quad->GetNode( 8 )]
+ END_EXTRA_VERTICES_WRITE();
+
// terahedra
BEGIN_ELEM_WRITE( SMDSEntity_Tetra, GmfTetrahedra, tetra )
node2IdMap[ tetra->GetNode( 0 )],
node2IdMap[ tetra->GetNode( 1 )],
node2IdMap[ tetra->GetNode( 3 )],
END_ELEM_WRITE( tetra );
-
+
// quadratic terahedra
- BEGIN_ELEM_WRITE( SMDSEntity_Quad_Tetra, GmfTetrahedraP2, tetra )
+ BEGIN_ELEM_WRITE( SMDSEntity_Quad_Tetra, GmfTetrahedra, tetra )
node2IdMap[ tetra->GetNode( 0 )],
node2IdMap[ tetra->GetNode( 2 )],
node2IdMap[ tetra->GetNode( 1 )],
node2IdMap[ tetra->GetNode( 3 )],
+ END_ELEM_WRITE( tetra );
+
+ BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_Quad_Tetra, GmfExtraVerticesAtTetrahedra, tetra, 6 )
node2IdMap[ tetra->GetNode( 6 )],
node2IdMap[ tetra->GetNode( 5 )],
node2IdMap[ tetra->GetNode( 4 )],
node2IdMap[ tetra->GetNode( 7 )],
node2IdMap[ tetra->GetNode( 9 )],
- node2IdMap[ tetra->GetNode( 8 )],
- END_ELEM_WRITE( tetra );
+ node2IdMap[ tetra->GetNode( 8 )]
+ END_EXTRA_VERTICES_WRITE();
// pyramids
BEGIN_ELEM_WRITE( SMDSEntity_Pyramid, GmfPyramids, pyra )
node2IdMap[ hexa->GetNode( 5 )],
END_ELEM_WRITE( hexa );
- // tri-quadratic hexahedra
- BEGIN_ELEM_WRITE( SMDSEntity_TriQuad_Hexa, GmfHexahedraQ2, hexa )
+ // quadratic hexahedra
+ BEGIN_ELEM_WRITE( SMDSEntity_Quad_Hexa, GmfHexahedra, hexa )
node2IdMap[ hexa->GetNode( 0 )],
node2IdMap[ hexa->GetNode( 3 )],
node2IdMap[ hexa->GetNode( 2 )],
node2IdMap[ hexa->GetNode( 7 )],
node2IdMap[ hexa->GetNode( 6 )],
node2IdMap[ hexa->GetNode( 5 )],
+ END_ELEM_WRITE( hexa );
+
+ BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_Quad_Hexa, GmfExtraVerticesAtHexahedra, hexa, 12 )
node2IdMap[ hexa->GetNode( 11 )],
node2IdMap[ hexa->GetNode( 10 )],
node2IdMap[ hexa->GetNode( 9 )],
node2IdMap[ hexa->GetNode( 8 )],
+ node2IdMap[ hexa->GetNode( 15 )],
+ node2IdMap[ hexa->GetNode( 14 )],
+ node2IdMap[ hexa->GetNode( 13 )],
node2IdMap[ hexa->GetNode( 12 )],
+ node2IdMap[ hexa->GetNode( 16 )],
+ node2IdMap[ hexa->GetNode( 19 )],
+ node2IdMap[ hexa->GetNode( 18 )],
+ node2IdMap[ hexa->GetNode( 17 )]
+ END_EXTRA_VERTICES_WRITE();
+
+ // tri-quadratic hexahedra
+ BEGIN_ELEM_WRITE( SMDSEntity_TriQuad_Hexa, GmfHexahedra, hexa )
+ node2IdMap[ hexa->GetNode( 0 )],
+ node2IdMap[ hexa->GetNode( 3 )],
+ node2IdMap[ hexa->GetNode( 2 )],
+ node2IdMap[ hexa->GetNode( 1 )],
+ node2IdMap[ hexa->GetNode( 4 )],
+ node2IdMap[ hexa->GetNode( 7 )],
+ node2IdMap[ hexa->GetNode( 6 )],
+ node2IdMap[ hexa->GetNode( 5 )],
+ END_ELEM_WRITE( hexa );
+
+ BEGIN_EXTRA_VERTICES_WRITE( SMDSEntity_TriQuad_Hexa, GmfExtraVerticesAtHexahedra, hexa, 19 )
+ node2IdMap[ hexa->GetNode( 11 )],
+ node2IdMap[ hexa->GetNode( 10 )],
+ node2IdMap[ hexa->GetNode( 9 )],
+ node2IdMap[ hexa->GetNode( 8 )],
node2IdMap[ hexa->GetNode( 15 )],
node2IdMap[ hexa->GetNode( 14 )],
node2IdMap[ hexa->GetNode( 13 )],
+ node2IdMap[ hexa->GetNode( 12 )],
+ node2IdMap[ hexa->GetNode( 16 )],
node2IdMap[ hexa->GetNode( 19 )],
node2IdMap[ hexa->GetNode( 18 )],
node2IdMap[ hexa->GetNode( 17 )],
- node2IdMap[ hexa->GetNode( 16 )],
node2IdMap[ hexa->GetNode( 20 )],
node2IdMap[ hexa->GetNode( 24 )],
node2IdMap[ hexa->GetNode( 23 )],
node2IdMap[ hexa->GetNode( 22 )],
node2IdMap[ hexa->GetNode( 21 )],
node2IdMap[ hexa->GetNode( 25 )],
- node2IdMap[ hexa->GetNode( 26 )],
- END_ELEM_WRITE( hexa );
+ node2IdMap[ hexa->GetNode( 26 )]
+ END_EXTRA_VERTICES_WRITE();
// prism
BEGIN_ELEM_WRITE( SMDSEntity_Penta, GmfPrisms, prism )
set<int> tofind;
int ids[16] = { 0, 1, 2, 3, 0, 3, 4, 3, 2, 4, 2, 1, 4, 1, 0, 4 };
+ // Quadrangular face
tofind.clear();
for (int i = 0; i < 4; i++)
tofind.insert(nodes[ids[i]]);
orderedNodes[i] = nodes[ids[i]];
return;
}
+ // Triangular faces
for (int k = 0; k < 4; k++)
{
tofind.clear();
void SMDS_DownQuadPyramid::getOrderedNodesOfFace(int cellId, std::vector<vtkIdType>& orderedNodes)
{
+// MESSAGE("SMDS_DownQuadPyramid::getOrderedNodesOfFace cellId = " << cellId);
set<int> setNodes;
setNodes.clear();
for (int i = 0; i < orderedNodes.size(); i++)
int ids[32] = { 0, 1, 2, 3, 5, 6, 7, 8,
0, 3, 4, 8, 12, 9, 3, 2, 4, 7 , 11, 12, 2, 1, 4, 6, 10, 11, 1, 0, 4, 5, 9, 10 };
+ // Quadrangular face
tofind.clear();
- for (int i = 0; i < 4; i++)
+ for (int i = 0; i < 8; i++)
tofind.insert(nodes[ids[i]]);
if (setNodes == tofind)
{
orderedNodes[i] = nodes[ids[i]];
return;
}
+ // Triangular faces
for (int k = 0; k < 4; k++)
{
tofind.clear();
}
}
MESSAGE("=== Problem volume " << _vtkCellIds[cellId] << " " << _grid->_mesh->fromVtkToSmds(_vtkCellIds[cellId]));
- MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2]);
+ MESSAGE(orderedNodes[0] << " " << orderedNodes[1] << " " << orderedNodes[2] << " " << orderedNodes[3]);
MESSAGE(nodes[0] << " " << nodes[1] << " " << nodes[2] << " " << nodes[3]);
}
//int ids[18] = { 0, 2, 1, 3, 4, 5, 0, 1, 4, 3, 1, 2, 5, 4, 2, 0, 3, 5 };
int ids[18] = { 0, 1, 2, 3, 5, 4, 0, 3, 4, 1, 1, 4, 5, 2, 2, 5, 3, 0 };
+ // Triangular faces
for (int k = 0; k < 2; k++)
{
tofind.clear();
return;
}
}
+ // Quadrangular faces
for (int k = 0; k < 3; k++)
{
tofind.clear();
int ids[36] = { 0, 1, 2, 6, 7, 8, 3, 5, 4, 11, 10, 9,
0, 3, 4, 1, 12, 9, 13, 6, 1, 4, 5, 2, 13, 10, 14, 7, 2, 5, 3, 0, 14, 11, 12, 8 };
+ // Triangular faces
for (int k = 0; k < 2; k++)
{
tofind.clear();
return;
}
}
+ // Quadrangular faces
for (int k = 0; k < 3; k++)
{
tofind.clear();
#include <GCPnts_AbscissaPoint.hxx>
#include <GeomAdaptor_Curve.hxx>
#include <Geom_Surface.hxx>
+#include <LDOMParser.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
#include <TopLoc_Location.hxx>
using namespace std;
+//================================================================================
+/*!
+ * \brief Returns \a true if two algorithms (described by \a this and the given
+ * algo data) are compatible by their output and input types of elements.
+ */
+//================================================================================
+
+bool SMESH_Algo::Features::IsCompatible( const SMESH_Algo::Features& algo2 ) const
+{
+ if ( _dim > algo2._dim ) return algo2.IsCompatible( *this );
+ // algo2 is of highter dimension
+ if ( _outElemTypes.empty() || algo2._inElemTypes.empty() )
+ return false;
+ bool compatible = true;
+ set<SMDSAbs_GeometryType>::const_iterator myOutType = _outElemTypes.begin();
+ for ( ; myOutType != _outElemTypes.end() && compatible; ++myOutType )
+ compatible = algo2._inElemTypes.count( *myOutType );
+ return compatible;
+}
+
+//================================================================================
+/*!
+ * \brief Return Data of the algorithm
+ */
+//================================================================================
+
+const SMESH_Algo::Features& SMESH_Algo::GetFeatures( const std::string& algoType )
+{
+ static map< string, SMESH_Algo::Features > theFeaturesByName;
+ if ( theFeaturesByName.empty() )
+ {
+ // Read Plugin.xml files
+ vector< string > xmlPaths = SMESH_Gen::GetPluginXMLPaths();
+ LDOMParser xmlParser;
+ for ( size_t iXML = 0; iXML < xmlPaths.size(); ++iXML )
+ {
+ bool error = xmlParser.parse( xmlPaths[iXML].c_str() );
+ if ( error )
+ {
+ TCollection_AsciiString data;
+ INFOS( xmlParser.GetError(data) );
+ continue;
+ }
+ // <algorithm type="Regular_1D"
+ // ...
+ // input="EDGE"
+ // output="QUAD,TRIA">
+ //
+ LDOM_Document xmlDoc = xmlParser.getDocument();
+ LDOM_NodeList algoNodeList = xmlDoc.getElementsByTagName( "algorithm" );
+ for ( int i = 0; i < algoNodeList.getLength(); ++i )
+ {
+ LDOM_Node algoNode = algoNodeList.item( i );
+ LDOM_Element& algoElem = (LDOM_Element&) algoNode;
+ TCollection_AsciiString algoType = algoElem.getAttribute("type");
+ TCollection_AsciiString input = algoElem.getAttribute("input");
+ TCollection_AsciiString output = algoElem.getAttribute("output");
+ TCollection_AsciiString dim = algoElem.getAttribute("dim");
+ TCollection_AsciiString label = algoElem.getAttribute("label-id");
+ if ( algoType.IsEmpty() ) continue;
+
+ Features & data = theFeaturesByName[ algoType.ToCString() ];
+ data._dim = dim.IntegerValue();
+ data._label = label.ToCString();
+ for ( int isInput = 0; isInput < 2; ++isInput )
+ {
+ TCollection_AsciiString& typeStr = isInput ? input : output;
+ set<SMDSAbs_GeometryType>& typeSet = isInput ? data._inElemTypes : data._outElemTypes;
+ int beg = 1, end;
+ while ( beg <= typeStr.Length() )
+ {
+ while ( beg < typeStr.Length() && !isalpha( typeStr.Value( beg ) ))
+ ++beg;
+ end = beg;
+ while ( end < typeStr.Length() && isalpha( typeStr.Value( end + 1 ) ))
+ ++end;
+ if ( end > beg )
+ {
+ TCollection_AsciiString typeName = typeStr.SubString( beg, end );
+ if ( typeName == "EDGE" ) typeSet.insert( SMDSGeom_EDGE );
+ else if ( typeName == "TRIA" ) typeSet.insert( SMDSGeom_TRIANGLE );
+ else if ( typeName == "QUAD" ) typeSet.insert( SMDSGeom_QUADRANGLE );
+ }
+ beg = end + 1;
+ }
+ }
+ }
+ }
+ }
+ return theFeaturesByName[ algoType ];
+}
+
//=============================================================================
/*!
*
return ok;
}
-//================================================================================
-/*!
- * \brief Find out elements orientation on a geometrical face
- * \param theFace - The face correctly oriented in the shape being meshed
- * \param theMeshDS - The mesh data structure
- * \retval bool - true if the face normal and the normal of first element
- * in the correspoding submesh point in different directions
+/*
+ * Moved to SMESH_MesherHelper
*/
-//================================================================================
-
-bool SMESH_Algo::IsReversedSubMesh (const TopoDS_Face& theFace,
- SMESHDS_Mesh* theMeshDS)
-{
- if ( theFace.IsNull() || !theMeshDS )
- return false;
-
- // find out orientation of a meshed face
- int faceID = theMeshDS->ShapeToIndex( theFace );
- TopoDS_Shape aMeshedFace = theMeshDS->IndexToShape( faceID );
- bool isReversed = ( theFace.Orientation() != aMeshedFace.Orientation() );
-
- const SMESHDS_SubMesh * aSubMeshDSFace = theMeshDS->MeshElements( faceID );
- if ( !aSubMeshDSFace )
- return isReversed;
-
- // find element with node located on face and get its normal
- const SMDS_FacePosition* facePos = 0;
- int vertexID = 0;
- gp_Pnt nPnt[3];
- gp_Vec Ne;
- bool normalOK = false;
- SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
- while ( iteratorElem->more() ) // loop on elements on theFace
- {
- const SMDS_MeshElement* elem = iteratorElem->next();
- if ( elem && elem->NbNodes() > 2 ) {
- SMDS_ElemIteratorPtr nodesIt = elem->nodesIterator();
- const SMDS_FacePosition* fPos = 0;
- int i = 0, vID = 0;
- while ( nodesIt->more() ) { // loop on nodes
- const SMDS_MeshNode* node
- = static_cast<const SMDS_MeshNode *>(nodesIt->next());
- if ( i == 3 ) i = 2;
- nPnt[ i++ ].SetCoord( node->X(), node->Y(), node->Z() );
- // check position
- const SMDS_PositionPtr& pos = node->GetPosition();
- if ( !pos ) continue;
- if ( pos->GetTypeOfPosition() == SMDS_TOP_FACE ) {
- fPos = dynamic_cast< const SMDS_FacePosition* >( pos );
- }
- else if ( pos->GetTypeOfPosition() == SMDS_TOP_VERTEX ) {
- vID = node->getshapeId();
- }
- }
- if ( fPos || ( !normalOK && vID )) {
- // compute normal
- gp_Vec v01( nPnt[0], nPnt[1] ), v02( nPnt[0], nPnt[2] );
- if ( v01.SquareMagnitude() > RealSmall() &&
- v02.SquareMagnitude() > RealSmall() )
- {
- Ne = v01 ^ v02;
- normalOK = ( Ne.SquareMagnitude() > RealSmall() );
- }
- // we need position on theFace or at least on vertex
- if ( normalOK ) {
- vertexID = vID;
- if ((facePos = fPos))
- break;
- }
- }
- }
- }
- if ( !normalOK )
- return isReversed;
-
- // node position on face
- double u,v;
- if ( facePos ) {
- u = facePos->GetUParameter();
- v = facePos->GetVParameter();
- }
- else if ( vertexID ) {
- TopoDS_Shape V = theMeshDS->IndexToShape( vertexID );
- if ( V.IsNull() || V.ShapeType() != TopAbs_VERTEX )
- return isReversed;
- gp_Pnt2d uv = BRep_Tool::Parameters( TopoDS::Vertex( V ), theFace );
- u = uv.X();
- v = uv.Y();
- }
- else
- {
- return isReversed;
- }
-
- // face normal at node position
- TopLoc_Location loc;
- Handle(Geom_Surface) surf = BRep_Tool::Surface( theFace, loc );
- // if ( surf.IsNull() || surf->Continuity() < GeomAbs_C1 )
- // some surfaces not detected as GeomAbs_C1 are nevertheless correct for meshing
- if ( surf.IsNull() || surf->Continuity() < GeomAbs_C0 )
- {
- if (!surf.IsNull())
- MESSAGE("surf->Continuity() < GeomAbs_C1 " << (surf->Continuity() < GeomAbs_C1));
- return isReversed;
- }
- gp_Vec d1u, d1v;
- surf->D1( u, v, nPnt[0], d1u, d1v );
- gp_Vec Nf = (d1u ^ d1v).Transformed( loc );
-
- if ( theFace.Orientation() == TopAbs_REVERSED )
- Nf.Reverse();
-
- return Ne * Nf < 0.;
-}
+// bool SMESH_Algo::IsReversedSubMesh (const TopoDS_Face& theFace,
+// SMESHDS_Mesh* theMeshDS)
+// {
+// }
//================================================================================
/*!
#include "SMESH_SMESH.hxx"
-#include "SMESH_Hypothesis.hxx"
-#include "SMESH_ComputeError.hxx"
+#include "SMDSAbs_ElementType.hxx"
#include "SMESH_Comment.hxx"
+#include "SMESH_ComputeError.hxx"
+#include "SMESH_Hypothesis.hxx"
#include <TopoDS_Shape.hxx>
#include <TopoDS_Edge.hxx>
#include <vector>
#include <list>
#include <map>
+#include <set>
class SMDS_MeshNode;
class SMESHDS_Mesh;
typedef std::map< SMESH_subMesh*, std::vector<int> > MapShapeNbElems;
typedef std::map< SMESH_subMesh*, std::vector<int> >::iterator MapShapeNbElemsItr;
+// ==================================================================================
/*!
* \brief Root of all algorithms
*
* - methods related to dependencies between sub-meshes imposed by the algorith
* - static utilities, like EdgeLength()
*/
-class SMESH_EXPORT SMESH_Algo:public SMESH_Hypothesis
+// ==================================================================================
+
+class SMESH_EXPORT SMESH_Algo : public SMESH_Hypothesis
{
-public:
+ public:
+ //==================================================================================
+ /*!
+ * \brief Structure describing algorithm features
+ */
+ // --------------------------------------------------------------------------------
+ struct Features
+ {
+ int _dim;
+ std::set<SMDSAbs_GeometryType> _inElemTypes; // acceptable types of input mesh element
+ std::set<SMDSAbs_GeometryType> _outElemTypes; // produced types of mesh elements
+ std::string _label; // GUI type name
+
+ bool IsCompatible( const Features& algo2 ) const;
+ };
+ /*!
+ * \brief Returns a structure describing algorithm features
+ */
+ static const Features& GetFeatures( const std::string& algoType );
+ const Features& GetFeatures() const { return GetFeatures( _name ); }
+
+ public:
+ //==================================================================================
/*!
* \brief Creates algorithm
* \param hypId - algorithm ID
const bool ignoreMediumNodes,
std::map< double, const SMDS_MeshNode* > & theNodes);
/*!
- * \brief Find out elements orientation on a geometrical face
- * \param theFace - The face correctly oriented in the shape being meshed
- * \param theMeshDS - The mesh data structure
- * \retval bool - true if the face normal and the normal of first element
- * in the correspoding submesh point in different directions
+ * Moved to SMESH_MesherHelper
*/
- static bool IsReversedSubMesh (const TopoDS_Face& theFace,
- SMESHDS_Mesh* theMeshDS);
+ // static bool IsReversedSubMesh (const TopoDS_Face& theFace,
+ // SMESHDS_Mesh* theMeshDS);
/*!
* \brief Compute length of an edge
* \param E - the edge
#include "Utils_ExceptHandlers.hxx"
#include <TopoDS_Iterator.hxx>
-#include <LDOMParser.hxx>
#include "memoire.h"
#ifdef WNT
#include <windows.h>
-#endif\r
+#endif
using namespace std;
.And( SMESH_HypoFilter::IsMoreLocalThan( algoShape, aMesh ));
if ( SMESH_Algo* subAlgo = (SMESH_Algo*) aMesh.GetHypothesis( aSubShape, filter, true )) {
+ if ( ! subAlgo->NeedDiscreteBoundary() ) continue;
SMESH_Hypothesis::Hypothesis_Status status;
if ( subAlgo->CheckHypothesis( aMesh, aSubShape, status ))
// mesh a lower smToCompute starting from vertices
return xmlPaths;
}
-//=======================================================================
-namespace // Access to type of input and output of an algorithm
-//=======================================================================
-{
- struct AlgoData
- {
- int _dim;
- set<SMDSAbs_GeometryType> _inElemTypes; // acceptable types of input mesh element
- set<SMDSAbs_GeometryType> _outElemTypes; // produced types of mesh elements
-
- bool IsCompatible( const AlgoData& algo2 ) const
- {
- if ( _dim > algo2._dim ) return algo2.IsCompatible( *this );
- // algo2 is of highter dimension
- if ( _outElemTypes.empty() || algo2._inElemTypes.empty() )
- return false;
- bool compatible = true;
- set<SMDSAbs_GeometryType>::const_iterator myOutType = _outElemTypes.begin();
- for ( ; myOutType != _outElemTypes.end() && compatible; ++myOutType )
- compatible = algo2._inElemTypes.count( *myOutType );
- return compatible;
- }
- };
-
- //================================================================================
- /*!
- * \brief Return AlgoData of the algorithm
- */
- //================================================================================
-
- const AlgoData& getAlgoData( const SMESH_Algo* algo )
- {
- static map< string, AlgoData > theDataByName;
- if ( theDataByName.empty() )
- {
- // Read Plugin.xml files
- vector< string > xmlPaths = SMESH_Gen::GetPluginXMLPaths();
- LDOMParser xmlParser;
- for ( size_t iXML = 0; iXML < xmlPaths.size(); ++iXML )
- {
- bool error = xmlParser.parse( xmlPaths[iXML].c_str() );
- if ( error )
- {
- TCollection_AsciiString data;
- INFOS( xmlParser.GetError(data) );
- continue;
- }
- // <algorithm type="Regular_1D"
- // ...
- // input="EDGE"
- // output="QUAD,TRIA">
- //
- LDOM_Document xmlDoc = xmlParser.getDocument();
- LDOM_NodeList algoNodeList = xmlDoc.getElementsByTagName( "algorithm" );
- for ( int i = 0; i < algoNodeList.getLength(); ++i )
- {
- LDOM_Node algoNode = algoNodeList.item( i );
- LDOM_Element& algoElem = (LDOM_Element&) algoNode;
- TCollection_AsciiString algoType = algoElem.getAttribute("type");
- TCollection_AsciiString input = algoElem.getAttribute("input");
- TCollection_AsciiString output = algoElem.getAttribute("output");
- TCollection_AsciiString dim = algoElem.getAttribute("dim");
- if ( algoType.IsEmpty() ) continue;
- AlgoData & data = theDataByName[ algoType.ToCString() ];
- data._dim = dim.IntegerValue();
- for ( int isInput = 0; isInput < 2; ++isInput )
- {
- TCollection_AsciiString& typeStr = isInput ? input : output;
- set<SMDSAbs_GeometryType>& typeSet = isInput ? data._inElemTypes : data._outElemTypes;
- int beg = 1, end;
- while ( beg <= typeStr.Length() )
- {
- while ( beg < typeStr.Length() && !isalpha( typeStr.Value( beg ) ))
- ++beg;
- end = beg;
- while ( end < typeStr.Length() && isalpha( typeStr.Value( end + 1 ) ))
- ++end;
- if ( end > beg )
- {
- TCollection_AsciiString typeName = typeStr.SubString( beg, end );
- if ( typeName == "EDGE" ) typeSet.insert( SMDSGeom_EDGE );
- else if ( typeName == "TRIA" ) typeSet.insert( SMDSGeom_TRIANGLE );
- else if ( typeName == "QUAD" ) typeSet.insert( SMDSGeom_QUADRANGLE );
- }
- beg = end + 1;
- }
- }
- }
- }
- }
- return theDataByName[ algo->GetName() ];
- }
-}
-
//=============================================================================
/*!
* Finds algo to mesh a shape. Optionally returns a shape the found algo is bound to
SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
filter.And( filter.IsApplicableTo( aShape ));
+ typedef SMESH_Algo::Features AlgoData;
+
TopoDS_Shape assignedToShape;
SMESH_Algo* algo =
(SMESH_Algo*) aMesh.GetHypothesis( aShape, filter, true, &assignedToShape );
// check compatibility of algos
if ( algos3D.size() > 1 )
{
- const AlgoData& algoData = getAlgoData( algo );
- const AlgoData& algoData2 = getAlgoData( algo2 );
- const AlgoData& algoData3d0 = getAlgoData( algos3D[0] );
- const AlgoData& algoData3d1 = getAlgoData( algos3D[1] );
+ const AlgoData& algoData = algo->SMESH_Algo::GetFeatures();
+ const AlgoData& algoData2 = algo2->SMESH_Algo::GetFeatures();
+ const AlgoData& algoData3d0 = algos3D[0]->SMESH_Algo::GetFeatures();
+ const AlgoData& algoData3d1 = algos3D[1]->SMESH_Algo::GetFeatures();
if (( algoData2.IsCompatible( algoData3d0 ) &&
algoData2.IsCompatible( algoData3d1 ))
&&
return true;
}
+//================================================================================
+/*!
+ * \brief Find out elements orientation on a geometrical face
+ * \param theFace - The face correctly oriented in the shape being meshed
+ * \retval bool - true if the face normal and the normal of first element
+ * in the correspoding submesh point in different directions
+ */
+//================================================================================
+
+bool SMESH_MesherHelper::IsReversedSubMesh (const TopoDS_Face& theFace)
+{
+ if ( theFace.IsNull() )
+ return false;
+
+ // find out orientation of a meshed face
+ int faceID = GetMeshDS()->ShapeToIndex( theFace );
+ TopoDS_Shape aMeshedFace = GetMeshDS()->IndexToShape( faceID );
+ bool isReversed = ( theFace.Orientation() != aMeshedFace.Orientation() );
+
+ const SMESHDS_SubMesh * aSubMeshDSFace = GetMeshDS()->MeshElements( faceID );
+ if ( !aSubMeshDSFace )
+ return isReversed;
+
+ // find an element with a good normal
+ gp_Vec Ne;
+ bool normalOK = false;
+ gp_XY uv;
+ SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
+ while ( !normalOK && iteratorElem->more() ) // loop on elements on theFace
+ {
+ const SMDS_MeshElement* elem = iteratorElem->next();
+ if ( elem && elem->NbCornerNodes() > 2 )
+ {
+ SMESH_TNodeXYZ nPnt[3];
+ SMDS_ElemIteratorPtr nodesIt = elem->nodesIterator();
+ for ( int iN = 0; nodesIt->more() && iN < 3; ++iN) // loop on nodes
+ nPnt[ iN ] = nodesIt->next();
+
+ // compute normal
+ gp_Vec v01( nPnt[0], nPnt[1] ), v02( nPnt[0], nPnt[2] );
+ if ( v01.SquareMagnitude() > RealSmall() &&
+ v02.SquareMagnitude() > RealSmall() )
+ {
+ Ne = v01 ^ v02;
+ if (( normalOK = ( Ne.SquareMagnitude() > RealSmall() )))
+ uv = GetNodeUV( theFace, nPnt[0]._node, nPnt[2]._node, &normalOK );
+ }
+ }
+ }
+ if ( !normalOK )
+ return isReversed;
+
+ // face normal at node position
+ TopLoc_Location loc;
+ Handle(Geom_Surface) surf = BRep_Tool::Surface( theFace, loc );
+ // if ( surf.IsNull() || surf->Continuity() < GeomAbs_C1 )
+ // some surfaces not detected as GeomAbs_C1 are nevertheless correct for meshing
+ if ( surf.IsNull() || surf->Continuity() < GeomAbs_C0 )
+ {
+ if (!surf.IsNull())
+ MESSAGE("surf->Continuity() < GeomAbs_C1 " << (surf->Continuity() < GeomAbs_C1));
+ return isReversed;
+ }
+ gp_Vec d1u, d1v; gp_Pnt p;
+ surf->D1( uv.X(), uv.Y(), p, d1u, d1v );
+ gp_Vec Nf = (d1u ^ d1v).Transformed( loc );
+
+ if ( theFace.Orientation() == TopAbs_REVERSED )
+ Nf.Reverse();
+
+ return Ne * Nf < 0.;
+}
+
//=======================================================================
//function : Count
//purpose : Count nb of sub-shapes
*/
bool GetIsQuadratic() const { return myCreateQuadratic; }
+ /*
+ * \brief Find out elements orientation on a geometrical face
+ */
+ bool IsReversedSubMesh (const TopoDS_Face& theFace);
+
/*!
* \brief Move medium nodes of faces and volumes to fix distorted elements
* \param error - container of fixed distorted elements
/*!
* \brief Return node UV on face
* \param inFaceNode - a node of element being created located inside a face
+ * \param check - if provided, returns result of UV check that it enforces
*/
gp_XY GetNodeUV(const TopoDS_Face& F,
const SMDS_MeshNode* n,
SMESHDS_Mesh * meshDS,
const TopoDS_Shape & aSubShape)
{
- _subShape = aSubShape;
- _subMeshDS = meshDS->MeshElements(_subShape); // may be null ...
- _father = father;
- _Id = Id;
- _dependenceAnalysed = _alwaysComputed = false;
-
- if (_subShape.ShapeType() == TopAbs_VERTEX)
- {
- _algoState = HYP_OK;
- _computeState = READY_TO_COMPUTE;
- }
- else
- {
- _algoState = NO_ALGO;
- _computeState = NOT_READY;
- }
+ _subShape = aSubShape;
+ _subMeshDS = meshDS->MeshElements(_subShape); // may be null ...
+ _father = father;
+ _Id = Id;
+ _dependenceAnalysed = _alwaysComputed = false;
+ _algo = 0;
+ if (_subShape.ShapeType() == TopAbs_VERTEX)
+ {
+ _algoState = HYP_OK;
+ _computeState = READY_TO_COMPUTE;
+ }
+ else
+ {
+ _algoState = NO_ALGO;
+ _computeState = NOT_READY;
+ }
}
//=============================================================================
SMESH_Algo* SMESH_subMesh::GetAlgo() const
{
- return _father->GetGen()->GetAlgo(*_father, _subShape);
+ if ( !_algo )
+ ((SMESH_subMesh*)this)->_algo = _father->GetGen()->GetAlgo(*_father, _subShape);
+ return _algo;
}
//================================================================================
*/
//=============================================================================
-bool SMESH_subMesh::SubMeshesComputed() const
+bool SMESH_subMesh::SubMeshesComputed(bool * isFailedToCompute/*=0*/) const
{
int myDim = SMESH_Gen::GetShapeDim( _subShape );
int dimToCheck = myDim - 1;
bool subMeshesComputed = true;
+ if ( isFailedToCompute ) *isFailedToCompute = false;
// check subMeshes with upper dimension => reverse iteration
SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,true);
while ( smIt->more() )
if ( sm->_alwaysComputed )
continue;
const TopoDS_Shape & ss = sm->GetSubShape();
+
// MSV 07.04.2006: restrict checking to myDim-1 only. Ex., there is no sense
// in checking of existence of edges if the algo needs only faces. Moreover,
// degenerated edges may have no submesh, as after computing NETGEN_2D.
- int dim = SMESH_Gen::GetShapeDim( ss );
- if (dim < dimToCheck)
- break; // the rest subMeshes are all of less dimension
+ if ( !_algo || _algo->NeedDiscreteBoundary() ) {
+ int dim = SMESH_Gen::GetShapeDim( ss );
+ if (dim < dimToCheck)
+ break; // the rest subMeshes are all of less dimension
+ }
SMESHDS_SubMesh * ds = sm->GetSubMeshDS();
bool computeOk = (sm->GetComputeState() == COMPUTE_OK ||
(ds && ( dimToCheck ? ds->NbElements() : ds->NbNodes() )));
if (!computeOk)
{
- int type = ss.ShapeType();
-
subMeshesComputed = false;
-
- switch (type)
- {
- case TopAbs_COMPOUND:
- {
- MESSAGE("The not computed sub mesh is a COMPOUND");
- break;
- }
- case TopAbs_COMPSOLID:
- {
- MESSAGE("The not computed sub mesh is a COMPSOLID");
- break;
- }
- case TopAbs_SHELL:
- {
- MESSAGE("The not computed sub mesh is a SHEL");
- break;
- }
- case TopAbs_WIRE:
- {
- MESSAGE("The not computed sub mesh is a WIRE");
- break;
- }
- case TopAbs_SOLID:
- {
- MESSAGE("The not computed sub mesh is a SOLID");
- break;
- }
- case TopAbs_FACE:
- {
- MESSAGE("The not computed sub mesh is a FACE");
- break;
- }
- case TopAbs_EDGE:
- {
- MESSAGE("The not computed sub mesh is a EDGE");
- break;
- }
- default:
- {
- MESSAGE("The not computed sub mesh is of unknown type");
- break;
- }
- }
-
- break;
+ if ( isFailedToCompute && !(*isFailedToCompute) )
+ *isFailedToCompute = ( sm->GetComputeState() == FAILED_TO_COMPUTE );
+
+ // int type = ss.ShapeType();
+
+ // switch (type)
+ // {
+ // case TopAbs_COMPOUND:
+ // {
+ // MESSAGE("The not computed sub mesh is a COMPOUND");
+ // break;
+ // }
+ // case TopAbs_COMPSOLID:
+ // {
+ // MESSAGE("The not computed sub mesh is a COMPSOLID");
+ // break;
+ // }
+ // case TopAbs_SHELL:
+ // {
+ // MESSAGE("The not computed sub mesh is a SHEL");
+ // break;
+ // }
+ // case TopAbs_WIRE:
+ // {
+ // MESSAGE("The not computed sub mesh is a WIRE");
+ // break;
+ // }
+ // case TopAbs_SOLID:
+ // {
+ // MESSAGE("The not computed sub mesh is a SOLID");
+ // break;
+ // }
+ // case TopAbs_FACE:
+ // {
+ // MESSAGE("The not computed sub mesh is a FACE");
+ // break;
+ // }
+ // case TopAbs_EDGE:
+ // {
+ // MESSAGE("The not computed sub mesh is a EDGE");
+ // break;
+ // }
+ // default:
+ // {
+ // MESSAGE("The not computed sub mesh is of unknown type");
+ // break;
+ // }
+ // }
+
+ if ( !isFailedToCompute )
+ break;
}
}
return subMeshesComputed;
SMESH_Hypothesis::Hypothesis_Status
SMESH_subMesh::AlgoStateEngine(int event, SMESH_Hypothesis * anHyp)
{
- // MESSAGE("SMESH_subMesh::AlgoStateEngine");
- //SCRUTE(_algoState);
- //SCRUTE(event);
-
// **** les retour des evenement shape sont significatifs
// (add ou remove fait ou non)
// le retour des evenement father n'indiquent pas que add ou remove fait
SMESH_Hypothesis::Hypothesis_Status aux_ret, ret = SMESH_Hypothesis::HYP_OK;
SMESHDS_Mesh* meshDS =_father->GetMeshDS();
- //SMESH_Gen* gen =_father->GetGen();
SMESH_Algo* algo = 0;
+ _algo = 0;
if (_subShape.ShapeType() == TopAbs_VERTEX )
{
int oldAlgoState = _algoState;
bool modifiedHyp = (event == MODIF_HYP); // if set to true, force event MODIF_ALGO_STATE
- bool needFullClean = false;
+ bool needFullClean = false, subMeshesSupported = false;
bool isApplicableHyp = IsApplicableHypotesis( anHyp );
SMESH_HypoFilter filter( SMESH_HypoFilter::HasType( algo->GetType() ));
filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+1 ));
filter.Or( SMESH_HypoFilter::HasType( algo->GetType()+2 ));
- if ( SMESH_Algo * curAlgo = (SMESH_Algo*) _father->GetHypothesis( _subShape, filter, true ))
+ if ( SMESH_Algo * curAlgo = (SMESH_Algo*)_father->GetHypothesis(_subShape, filter, true ))
needFullClean = ( !curAlgo->NeedDiscreteBoundary() );
}
}
// we must perform it now because later
// we will have no information about the type of the removed algo
needFullClean = true;
+ subMeshesSupported = algo->SupportSubmeshes();
}
}
}
// CLEAN was not called at event REMOVE_ALGO because the algo is not applicable to SOLID.
algo = dynamic_cast<SMESH_Algo*> (anHyp);
if (!algo->NeedDiscreteBoundary())
+ {
needFullClean = true;
-
+ subMeshesSupported = algo->SupportSubmeshes();
+ }
algo = GetAlgo();
if (algo == NULL) // no more applying algo on father
{
if ( needFullClean ) {
// added or removed algo is all-dimensional
ComputeStateEngine( CLEAN );
- cleanDependsOn();
+ cleanDependsOn( subMeshesSupported );
ComputeSubMeshStateEngine( CHECK_COMPUTE_STATE );
}
return ret;
}
-//=============================================================================
+//================================================================================
/*!
- *
+ * \brief Remove elements from sub-meshes.
+ * \param keepSupportedsubMeshes - if true, the sub-meshes computed using more
+ * local algorithms are not cleaned
*/
-//=============================================================================
+//================================================================================
-void SMESH_subMesh::cleanDependsOn()
+void SMESH_subMesh::cleanDependsOn( bool keepSupportedsubMeshes )
{
- SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,false);
- while ( smIt->more() )
- smIt->next()->ComputeStateEngine(CLEAN);
+ if ( _father->NbNodes() == 0 ) return;
+
+ SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,
+ /*complexShapeFirst=*/true);
+ if ( !keepSupportedsubMeshes )
+ {
+ while ( smIt->more() )
+ smIt->next()->ComputeStateEngine(CLEAN);
+ }
+ else
+ {
+ // find sub-meshes to keep elements on
+ set< SMESH_subMesh* > smToKeep;
+ SMESHDS_Mesh* meshDS = _father->GetMeshDS();
+ while ( smIt->more() )
+ {
+ SMESH_subMesh* sm = smIt->next();
+ if ( sm->IsEmpty() ) continue;
+
+ // look for an algo assigned to sm
+ bool algoFound = false;
+ const list<const SMESHDS_Hypothesis*>& hyps = meshDS->GetHypothesis( sm->_subShape );
+ list<const SMESHDS_Hypothesis*>::const_iterator h = hyps.begin();
+ for ( ; ( !algoFound && h != hyps.end() ); ++h )
+ algoFound = ((*h)->GetType() != SMESHDS_Hypothesis::PARAM_ALGO );
+
+ // remember all sub-meshes of sm
+ if ( algoFound )
+ {
+ SMESH_subMeshIteratorPtr smIt2 = getDependsOnIterator(false,true);
+ while ( smIt2->more() )
+ smToKeep.insert( smIt2->next() );
+ }
+ }
+ // remove elements
+ SMESH_subMeshIteratorPtr smIt = getDependsOnIterator(false,true);
+ while ( smIt->more() )
+ {
+ SMESH_subMesh* sm = smIt->next();
+ if ( !smToKeep.count( sm ))
+ sm->ComputeStateEngine(CLEAN);
+ }
+ }
}
//=============================================================================
default:;
}
- //MESSAGE("SMESH_subMesh::ComputeStateEngine");
- //SCRUTE(_computeState);
- //SCRUTE(event);
-
if (_subShape.ShapeType() == TopAbs_VERTEX)
{
_computeState = READY_TO_COMPUTE;
case MODIF_ALGO_STATE:
algo = GetAlgo();
if (algo && !algo->NeedDiscreteBoundary())
- cleanDependsOn(); // clean sub-meshes with event CLEAN
+ cleanDependsOn( algo->SupportSubmeshes() ); // clean sub-meshes with event CLEAN
if ( _algoState == HYP_OK )
_computeState = READY_TO_COMPUTE;
break;
if (algo)
{
if (!algo->NeedDiscreteBoundary())
- cleanDependsOn(); // clean sub-meshes with event CLEAN
+ cleanDependsOn( algo->SupportSubmeshes() ); // clean sub-meshes with event CLEAN
if ( _algoState == HYP_OK )
_computeState = READY_TO_COMPUTE;
}
TopoDS_Shape shape = _subShape;
// check submeshes needed
if (_father->HasShapeToMesh() ) {
- bool subComputed = false;
+ bool subComputed = false, subFailed = false;
if (!algo->OnlyUnaryInput())
- shape = getCollection( gen, algo, subComputed );
+ shape = getCollection( gen, algo, subComputed, subFailed );
else
subComputed = SubMeshesComputed();
ret = ( algo->NeedDiscreteBoundary() ? subComputed :
- algo->SupportSubmeshes() ? true :
+ algo->SupportSubmeshes() ? !subFailed :
( !subComputed || _father->IsNotConformAllowed() ));
- if (!ret) {
+ if (!ret)
+ {
_computeState = FAILED_TO_COMPUTE;
- if ( !algo->NeedDiscreteBoundary() )
+ if ( !algo->NeedDiscreteBoundary() && !subFailed )
_computeError =
SMESH_ComputeError::New(COMPERR_BAD_INPUT_MESH,
"Unexpected computed submesh",algo);
- break;
+ break; // goto exit
}
}
// Compute
}
// check if an error reported on any sub-shape
bool isComputeErrorSet = !checkComputeError( algo, ret, shape );
+ if ( isComputeErrorSet )
+ ret = false;
// check if anything was built
TopExp_Explorer subS(shape, _subShape.ShapeType());
if (ret)
ComputeStateEngine( CLEAN );
algo = GetAlgo();
if (algo && !algo->NeedDiscreteBoundary())
- cleanDependsOn(); // clean sub-meshes with event CLEAN
+ cleanDependsOn( algo->SupportSubmeshes() ); // clean sub-meshes with event CLEAN
break;
case COMPUTE: // nothing to do
break;
ComputeStateEngine( CLEAN );
algo = GetAlgo();
if (algo && !algo->NeedDiscreteBoundary())
- cleanDependsOn(); // clean sub-meshes with event CLEAN
+ cleanDependsOn( algo->SupportSubmeshes() ); // clean sub-meshes with event CLEAN
if (_algoState == HYP_OK)
_computeState = READY_TO_COMPUTE;
else
TopoDS_Shape SMESH_subMesh::getCollection(SMESH_Gen * theGen,
SMESH_Algo* theAlgo,
- bool & theSubComputed)
+ bool & theSubComputed,
+ bool & theSubFailed)
{
- theSubComputed = SubMeshesComputed();
+ theSubComputed = SubMeshesComputed( & theSubFailed );
TopoDS_Shape mainShape = _father->GetMeshDS()->ShapeToMesh();
void SetIsAlwaysComputed(bool isAlCo);
bool IsAlwaysComputed() { return _alwaysComputed; }
- bool SubMeshesComputed() const;
+ bool SubMeshesComputed(bool * isFailedToCompute=0) const;
/*!
void updateDependantsState(const compute_event theEvent);
void updateSubMeshState(const compute_state theState);
void cleanDependants();
- void cleanDependsOn();
+ void cleanDependsOn( bool keepSupportedsubMeshes = false );
void setAlgoState(algo_state state);
/*!
*/
TopoDS_Shape getCollection(SMESH_Gen * theGen,
SMESH_Algo* theAlgo,
- bool & theSubComputed);
+ bool & theSubComputed,
+ bool & theSubFailed);
/*!
* \brief Update compute_state by _computeError
* \retval bool - false if there are errors
std::map < int, SMESH_subMesh * >_mapDepend;
bool _dependenceAnalysed;
+ SMESH_Algo * _algo; // the algorithm found by last *StateEngine() call
algo_state _algoState;
compute_state _computeState;
SMESH_ComputeErrorPtr _computeError;
- // allow algo->Compute() if a subshape of lower dim is meshed but
+ // allow algo->Compute() if a sub-shape of lower dim is meshed but
// none mesh entity is bound to it. Eg StdMeshers_CompositeSegment_1D can
// mesh several edges as a whole and leave some of them without mesh entities
bool _alwaysComputed;
SMESHDS_Hypothesis(int hypId);
virtual ~SMESHDS_Hypothesis();
+ enum hypothesis_type { PARAM_ALGO, ALGO_0D, ALGO_1D, ALGO_2D, ALGO_3D };
+
const char* GetName() const;
- int GetID() const;
- int GetType() const;
+ int GetID() const;
+ int GetType() const;
virtual std::ostream & SaveTo(std::ostream & save)=0;
virtual std::istream & LoadFrom(std::istream & load)=0;
virtual bool operator==(const SMESHDS_Hypothesis& other) const;
bool operator!=(const SMESHDS_Hypothesis& other) const { return !(*this==other); }
- enum hypothesis_type { PARAM_ALGO, ALGO_0D, ALGO_1D, ALGO_2D, ALGO_3D };
-
protected:
- std::string _name; // identifier if hypothesis type
- int _hypId; // ID unique within application session
- int _type; // enum hypothesis_type
+ std::string _name; // identifier of hypothesis type
+ int _hypId; // ID unique within application session
+ hypothesis_type _type; // enum hypothesis_type
};
#endif
{
format = "GMF";
notSupportedElemTypes.push_back( SMESH::Entity_0D );
- notSupportedElemTypes.push_back( SMESH::Entity_Quad_Quadrangle );
notSupportedElemTypes.push_back( SMESH::Entity_Polygon );
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polygon );
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Pyramid );
- notSupportedElemTypes.push_back( SMESH::Entity_Quad_Hexa );
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Penta );
notSupportedElemTypes.push_back( SMESH::Entity_Hexagonal_Prism );
notSupportedElemTypes.push_back( SMESH::Entity_Polyhedra );
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()),SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(SelectionIntoArgument()));
/* to close dialog if study frame change */
- connect(mySMESHGUI, SIGNAL(SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL(SignalStudyFrameChanged()), SLOT(reject()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
if (Reverse)
connect(Reverse, SIGNAL(stateChanged(int)), SLOT(CheckBox(int)));
void SMESHGUI_AddMeshElementDlg::ClickOnOk()
{
ClickOnApply();
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_AddMeshElementDlg::ClickOnCancel()
+void SMESHGUI_AddMeshElementDlg::reject()
{
//mySelectionMgr->clearSelected();
mySimulation->SetVisibility(false);
aViewWindow->SetSelectionMode( ActorSelection );
disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_AddMeshElementDlg::closeEvent (QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=================================================================================
-// function : hideEvent()
-// purpose : caused by ESC key
-//=================================================================================
-void SMESHGUI_AddMeshElementDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=================================================================================
// function : CheckBox()
// purpose :
private:
void Init();
- void closeEvent( QCloseEvent* );
- void hideEvent( QHideEvent* ); /* ESC key */
void enterEvent( QEvent* ); /* mouse enter the QWidget */
void keyPressEvent( QKeyEvent* );
void displaySimulation();
QString myHelpFileName;
+protected slots:
+ virtual void reject();
+
private slots:
void ClickOnOk();
- void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
connect(myReverseCB, SIGNAL(stateChanged(int)), SLOT(onReverse(int)));
connect(buttonOk, SIGNAL(clicked()), SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), SLOT(ClickOnHelp()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), SLOT(DeactivateActiveDialog()));
- connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(ClickOnCancel()));
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), SLOT(reject()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), SLOT(reject()));
myCurrentLineEdit = myCornerNodes;
void SMESHGUI_AddQuadraticElementDlg::ClickOnOk()
{
ClickOnApply();
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_AddQuadraticElementDlg::ClickOnCancel()
+void SMESHGUI_AddQuadraticElementDlg::reject()
{
mySelectionMgr->clearSelected();
mySimulation->SetVisibility(false);
aViewWindow->SetSelectionMode( ActorSelection );
disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_AddQuadraticElementDlg::closeEvent (QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=================================================================================
-// function : hideEvent()
-// purpose : caused by ESC key
-//=================================================================================
-void SMESHGUI_AddQuadraticElementDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=================================================================================
// function : onReverse()
// purpose :
typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
void Init();
- void closeEvent( QCloseEvent* );
- void hideEvent( QHideEvent* ); /* ESC key */
void enterEvent( QEvent* ); /* mouse enter the QWidget */
void keyPressEvent( QKeyEvent* );
void displaySimulation();
QString myHelpFileName;
+protected slots:
+ virtual void reject();
+
private slots:
void onTextChange( const QString& );
void onCellTextChange( int, int );
void onCellDoubleClicked( int, int );
void ClickOnOk();
- void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetCurrentSelection();
// signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
LineEditName->setText(GetDefaultName(tr("COMPOUND_MESH")));
LineEditMeshes->setFocus();
{
setIsApplyAndClose( true );
if (ClickOnApply())
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_BuildCompoundDlg::ClickOnCancel()
+void SMESHGUI_BuildCompoundDlg::reject()
{
//mySelectionMgr->clearSelected();
mySelectionMgr->clearFilters();
disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_BuildCompoundDlg::closeEvent( QCloseEvent* )
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_BuildCompoundDlg::hideEvent( QHideEvent* )
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
-
//=================================================================================
// function : keyPressEvent()
// purpose :
private:
void Init();
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
bool isValid();
bool myIsApplyAndClose;
+protected slots:
+ virtual void reject();
+
private slots:
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
void ClickOnHelp();
void SelectionIntoArgument();
connect(PreviewCheckBox, SIGNAL(toggled(bool)), this, SLOT(OnPreviewToggle(bool)));
connect(AutoApplyCheckBox, SIGNAL(toggled(bool)), this, SLOT(onAutoApply(bool)));
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
/* to close dialog if study frame change */
- connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalStudyFrameChanged()), this, SLOT(reject()));
this->show();
}
void SMESHGUI_ClippingDlg::ClickOnOk()
{
ClickOnApply();
- ClickOnCancel();
+ reject();
}
//=======================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=======================================================================
-void SMESHGUI_ClippingDlg::ClickOnCancel()
+void SMESHGUI_ClippingDlg::reject()
{
- close();
+ //here we can insert actions to do at close.
+ QDialog::reject();
}
//=================================================================================
bool myIsSelectPlane;
QString myHelpFileName;
+protected slots:
+ virtual void reject();
+
public slots:
void onSelectPlane( int );
void ClickOnNew();
void OnPreviewToggle( bool );
void onAutoApply(bool);
void ClickOnOk();
- void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
};
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySelectionMgr, SIGNAL (currentSelectionChanged()),
this, SLOT (SelectionIntoArgument()));
connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()),/* to close dialog if study change */
- this, SLOT (ClickOnCancel()));
+ this, SLOT (reject()));
connect(myLineEditElements, SIGNAL(textChanged(const QString&)),
this, SLOT (onTextChange(const QString&)));
{
setIsApplyAndClose( true );
if( ClickOnApply() )
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_CopyMeshDlg::ClickOnCancel()
+void SMESHGUI_CopyMeshDlg::reject()
{
disconnect(mySelectionMgr, 0, this, 0);
if ( mySelectionMgr )
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection );
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_CopyMeshDlg::closeEvent (QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_CopyMeshDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=================================================================================
// function : keyPressEvent()
// purpose :
private:
void Init( bool = true );
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
int GetConstructorId();
void setNewMeshName();
bool myIsApplyAndClose;
+protected slots:
+ virtual void reject();
+
private slots:
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
void ClickOnHelp();
void SelectionIntoArgument();
aLay->addWidget( myHelpBtn );
connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( onOk() ) );
- connect( myCloseBtn, SIGNAL( clicked() ), this, SLOT( onClose() ) );
+ connect( myCloseBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect( mySaveBtn, SIGNAL( clicked() ), this, SLOT( onSave() ) );
connect( myHelpBtn, SIGNAL( clicked() ), this, SLOT( onHelp() ) );
connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ),
this, SLOT( onDeactivate() ) );
connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ),
- this, SLOT( onClose() ) );
+ this, SLOT( reject() ) );
mySwitch2d->setEnabled( theType == Type_2d );
mySwitch3d->setEnabled( theType == Type_3d );
}
//=======================================================================
-// function : onClose()
+// function : reject()
// purpose : SLOT called when "Close" button pressed. Close dialog
//=======================================================================
-void SMESHGUI_CreatePatternDlg::onClose()
+void SMESHGUI_CreatePatternDlg::reject()
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
aViewWindow->SetSelectionMode( ActorSelection );
disconnect( mySelectionMgr, 0, this, 0 );
disconnect( mySMESHGUI, 0, this, 0 );
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
emit Close();
}
}
}
-//=================================================================================
-// function : closeEvent()
-// purpose : Close dialog box
-//=================================================================================
-void SMESHGUI_CreatePatternDlg::closeEvent( QCloseEvent* )
-{
- onClose();
-}
-
//=======================================================================
// function : onSelBtnClicked()
// purpose : SLOT. Called when -> button clicked.
void Close();
private:
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* );
private slots:
void onOk();
void onSave();
- void onClose();
+ void reject();
void onHelp();
void onDeactivate();
/* signals and slots connections */
connect(buttonOk, SIGNAL( clicked() ), SLOT( ClickOnOk() ) );
- connect(buttonCancel, SIGNAL( clicked() ), SLOT( ClickOnCancel() ) );
+ connect(buttonCancel, SIGNAL( clicked() ), SLOT( reject() ) );
connect(buttonApply, SIGNAL( clicked() ), SLOT( ClickOnApply() ) );
connect(buttonHelp, SIGNAL( clicked() ), SLOT( ClickOnHelp() ) );
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
connect( Preview, SIGNAL(toggled(bool)), this, SLOT(ClickOnPreview(bool)));
/* to close dialog if study change */
- connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( ClickOnCancel() ) );
+ connect( mySMESHGUI, SIGNAL ( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
ConstructorsClicked(0);
SelectionIntoArgument();
{
if(checkEditLine(false) == -1) {return;}
ClickOnApply();
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_CreatePolyhedralVolumeDlg::ClickOnCancel()
+void SMESHGUI_CreatePolyhedralVolumeDlg::reject()
{
mySelectionMgr->clearFilters();
//SALOME_ListIO aList;
aViewWindow->SetSelectionMode( ActorSelection );
disconnect( mySelectionMgr, 0, this, 0 );
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_CreatePolyhedralVolumeDlg::closeEvent( QCloseEvent* e )
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-
-//=======================================================================
-//function : hideEvent
-//purpose : caused by ESC key
-//=======================================================================
-
-void SMESHGUI_CreatePolyhedralVolumeDlg::hideEvent ( QHideEvent * e )
-{
- if ( !isMinimized() )
- ClickOnCancel();
-}
-
-
//=================================================================================
// function : GetConstructorId()
// purpose :
typedef QList<SMESH::SMESH_GroupBase_var> GrpList;
void Init();
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
int GetConstructorId();
void displaySimulation();
void onAdd();
void onRemove();
+protected slots:
+ virtual void reject();
+
private slots:
void ConstructorsClicked( int );
void ClickOnPreview( bool );
void ClickOnOk();
- void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
// connect signals and slots
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
- connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
+ connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
// selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
// set selection mode
mySelectionMgr->installFilter(new SMESH_TypeFilter(SMESH::GROUP));
void SMESHGUI_DeleteGroupDlg::onOk()
{
if (onApply())
- onClose();
+ reject();
}
//=================================================================================
-// function : onClose()
+// function : reject()
// purpose : SLOT called when "Close" button pressed. Close dialog
//=================================================================================
-void SMESHGUI_DeleteGroupDlg::onClose()
+void SMESHGUI_DeleteGroupDlg::reject()
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState();
mySelectionMgr->clearFilters();
- reject();
+ QDialog::reject();
}
//=================================================================================
mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_DeleteGroupDlg::closeEvent (QCloseEvent*)
-{
- onClose();
-}
-
//=================================================================================
// function : keyPressEvent()
// purpose :
void Init ();
private:
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* );
+protected slots:
+ virtual void reject();
+
private slots:
void onOk();
bool onApply();
- void onClose();
void onHelp();
void onDeactivate();
connect(mySelectButton3, SIGNAL (clicked()), this, SLOT(onEditCurrentArgument()));
connect(myButtonOk, SIGNAL(clicked()), this, SLOT(onOk()));
- connect(myButtonClose, SIGNAL(clicked()), this, SLOT(onClose()));
+ connect(myButtonClose, SIGNAL(clicked()), this, SLOT(reject()));
connect(myButtonApply, SIGNAL(clicked()), this, SLOT(onApply()));
connect(myButtonHelp, SIGNAL(clicked()), this, SLOT(onHelp()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionChanged()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(onClose()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
}
/*!
void SMESHGUI_DuplicateNodesDlg::onOk()
{
if (onApply())
- onClose();
+ reject();
}
/*!
\brief SLOT called to close the dialog.
*/
-void SMESHGUI_DuplicateNodesDlg::onClose()
+void SMESHGUI_DuplicateNodesDlg::reject()
{
disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState();
mySelectionMgr->clearFilters();
- reject();
+ QDialog::reject();
}
/*!
}
}
-/*!
- \brief Receive close events.
- Reimplemented from QWidget class.
-*/
-void SMESHGUI_DuplicateNodesDlg::closeEvent (QCloseEvent*)
-{
- onClose();
-}
-
/*!
\brief Receive key press events.
Reimplemented from QWidget class.
bool isValid();
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* );
+protected slots:
+ virtual void reject();
+
private slots:
void onConstructorsClicked( int );
void onOk();
- void onClose();
bool onApply();
void onHelp();
/***************************************************************/
// signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
void SMESHGUI_ExtrusionDlg::ClickOnOk()
{
if (ClickOnApply())
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose : Called when dialog box is closed
//=================================================================================
-void SMESHGUI_ExtrusionDlg::ClickOnCancel()
+void SMESHGUI_ExtrusionDlg::reject()
{
- reject();
+ disconnect(mySelectionMgr, 0, this, 0);
+ mySelectionMgr->clearFilters();
+ //mySelectionMgr->clearSelected();
+ if (SMESH::GetCurrentVtkView()) {
+ SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
+ SMESH::SetPointRepresentation(false);
+ SMESH::SetPickable();
+ }
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
+ mySMESHGUI->ResetState();
+
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_ExtrusionDlg::closeEvent( QCloseEvent* )
-{
- /* same than click on cancel button */
- disconnect(mySelectionMgr, 0, this, 0);
- mySelectionMgr->clearFilters();
- //mySelectionMgr->clearSelected();
- if (SMESH::GetCurrentVtkView()) {
- SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
- SMESH::SetPointRepresentation(false);
- SMESH::SetPickable();
- }
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
- mySMESHGUI->ResetState();
-}
-
-void SMESHGUI_ExtrusionDlg::reject()
-{
- QDialog::reject();
- close();
-}
-
//=================================================================================
// function : onSelectMesh()
// purpose :
SMESHGUI_ExtrusionDlg( SMESHGUI* );
~SMESHGUI_ExtrusionDlg();
- void reject();
-
private:
void Init( bool = true );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void closeEvent( QCloseEvent* );
void keyPressEvent( QKeyEvent* );
int GetConstructorId();
void getExtrusionVector(SMESH::DirStruct& aVector);
SMESHGUI_FilterDlg* myFilterDlg;
protected slots:
- virtual void onDisplaySimulation( bool );
+ virtual void onDisplaySimulation( bool );
+ virtual void reject();
private slots:
void ConstructorsClicked( int );
void CheckIsEnable();
void ClickOnOk();
bool ClickOnApply();
- void ClickOnCancel();
void ClickOnHelp();
void ClickOnRadio();
void SetEditCurrentArgument();
aLay->addWidget(myButtons[ BTN_Help ]);
connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk()));
- connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(onClose()));
+ connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(reject()));
connect(myButtons[ BTN_Apply ], SIGNAL(clicked()), SLOT(onApply()));
connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp()));
mySMESHGUI->SetActiveDialogBox((QDialog*)this);
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
updateMainButtons();
updateSelection();
}
//=======================================================================
-// name : SMESHGUI_FilterDlg::onClose
+// name : SMESHGUI_FilterDlg::reject
// Purpose : SLOT called when "Close" button pressed. Close dialog
//=======================================================================
-void SMESHGUI_FilterDlg::onClose()
+void SMESHGUI_FilterDlg::reject()
{
// Restore previously selected object
if (mySelectionMgr)
disconnect(mySMESHGUI, 0, this, 0);
disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState();
- reject();
- return;
+ QDialog::reject();
}
//=================================================================================
setEnabled(true);
}
-//=======================================================================
-// name : closeEvent()
-// Purpose :
-//=======================================================================
-void SMESHGUI_FilterDlg::closeEvent (QCloseEvent*)
-{
- onClose();
-}
-
//=======================================================================
// name : SMESHGUI_FilterDlg::getIdsFromWg
// Purpose : Retrieve list of ids from given widget
void Accepted();
+protected slots:
+ virtual void reject();
+
private slots:
void onOk();
bool onApply();
- void onClose();
void onHelp();
void onDeactivate();
void onSelectionDone();
void construct( const QList<int>& );
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* );
aLay->addWidget(myButtons[ BTN_Help ]);
connect(myButtons[ BTN_OK ], SIGNAL(clicked()), SLOT(onOk()));
- connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(onClose()));
+ connect(myButtons[ BTN_Close ], SIGNAL(clicked()), SLOT(reject()));
connect(myButtons[ BTN_Apply ], SIGNAL(clicked()), SLOT(onApply()));
connect(myButtons[ BTN_Help ], SIGNAL(clicked()), SLOT(onHelp()));
setEnabled(true);
connect( mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
- connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+ connect( mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
if (myMode == ADD_TO)
{
void SMESHGUI_FilterLibraryDlg::onOk()
{
if (onApply())
- {
- disconnect( mySMESHGUI, 0, this, 0);
- mySMESHGUI->ResetState();
- accept();
- }
+ reject();
}
//=======================================================================
-// name : SMESHGUI_FilterLibraryDlg::onClose
+// name : SMESHGUI_FilterLibraryDlg::reject
// Purpose : SLOT called when "Close" button pressed. Close dialog
//=======================================================================
-void SMESHGUI_FilterLibraryDlg::onClose()
+void SMESHGUI_FilterLibraryDlg::reject()
{
disconnect( mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
setEnabled(true);
}
-//=================================================================================
-// function : closeEvent()
-// purpose : Close dialog
-//=================================================================================
-void SMESHGUI_FilterLibraryDlg::closeEvent(QCloseEvent* e)
-{
- onClose();
-}
-
//=======================================================================
// name : SMESHGUI_FilterLibraryDlg::getFileName
// Purpose : Get file name
void SetTable( const SMESHGUI_FilterTable* );
private:
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* );
+protected slots:
+ virtual void reject();
+
private slots:
void onOk();
bool onApply();
- void onClose();
void onHelp();
void onDeactivate();
connect(myOKBtn, SIGNAL(clicked()), this, SLOT(onOK()));
connect(myApplyBtn, SIGNAL(clicked()), this, SLOT(onApply()));
- connect(myCloseBtn, SIGNAL(clicked()), this, SLOT(onClose()));
+ connect(myCloseBtn, SIGNAL(clicked()), this, SLOT(reject()));
connect(myHelpBtn, SIGNAL(clicked()), this, SLOT(onHelp()));
/* Init selection */
myGeomFilter = new GEOM_SelectionFilter( aStudy, true );
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(onDeactivate()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(onClose()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(onObjectSelectionChanged()));
connect(mySMESHGUI, SIGNAL(SignalVisibilityChanged()), this, SLOT(onVisibilityChanged()));
{
setIsApplyAndClose( true );
if ( onApply() )
- onClose();
+ reject();
setIsApplyAndClose( false );
}
}
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_GroupDlg::closeEvent (QCloseEvent*)
-{
- onClose();
-}
-
//=================================================================================
// function : onVisibilityChanged()
// purpose :
}
//=================================================================================
-// function : SMESHGUI_GroupDlg::onClose
+// function : SMESHGUI_GroupDlg::reject
// purpose : SLOT called when "Close" button pressed. Close dialog
//=================================================================================
-void SMESHGUI_GroupDlg::onClose()
+void SMESHGUI_GroupDlg::reject()
{
if (SMESH::GetCurrentVtkView()) {
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
mySelectionMgr->clearFilters();
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
}
}
-//=================================================================================
-// function : hideEvent
-// purpose : caused by ESC key
-//=================================================================================
-void SMESHGUI_GroupDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized() && !myIsBusy)
- onClose();
-}
-
//=================================================================================
// function : keyPressEvent()
// purpose :
void onAdd();
void onRemove();
+protected slots:
+ virtual void reject();
+
private slots:
void onTypeChanged( int );
void onGrpTypeChanged( int );
void onColorChanged( QColor );
void onOK();
- void onClose();
bool onApply();
void onHelp();
void onDeactivate();
void init( SMESH::SMESH_Mesh_ptr );
void init( SMESH::SMESH_GroupBase_ptr,
const bool theIsConvert = false );
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* );
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
void setSelectionMode( int );
void updateButtons();
// connect signals and slots
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
- connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
+ connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
// selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnClose()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
// set selection mode
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
{
setIsApplyAndClose( true );
if ( onApply() )
- onClose();
+ reject();
setIsApplyAndClose( false );
}
/*!
- \brief SLOT called when "Close" button pressed closes dialog
+ \brief SLOT called when dialog is closed
*/
-void SMESHGUI_GroupOpDlg::onClose()
+void SMESHGUI_GroupOpDlg::reject()
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
mySelectionMgr->clearFilters();
reset();
- reject();
+ QDialog::reject();
}
/*!
mySelectionMgr->installFilter(new SMESH_TypeFilter (SMESH::GROUP));
}
-/*!
- \brief Provides reaction on close event, closes the dialog box
-*/
-void SMESHGUI_GroupOpDlg::closeEvent(QCloseEvent*)
-{
- onClose();
-}
-
/*!
\brief Resets state of the dialog, initializes its fields with default value, etc.
Usually called by onApply() slot to reinitialize dialog fields. This virtual method
bool isApplyAndClose() const;
private:
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* );
+protected slots:
+ virtual void reject();
+
private slots:
void onOk();
- void onClose();
void onHelp();
void onDeactivate();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
// Init Mesh field from selection
SelectionIntoArgument();
void SMESHGUI_MergeDlg::ClickOnOk()
{
if (ClickOnApply())
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_MergeDlg::ClickOnCancel()
+void SMESHGUI_MergeDlg::reject()
{
myIdPreview->SetPointsLabeled(false);
SMESH::SetPointRepresentation(false);
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_MergeDlg::closeEvent(QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_MergeDlg::hideEvent (QHideEvent *)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=================================================================================
// function : keyPressEvent()
// purpose :
private:
void Init();
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
void onEditGroup();
QString myEntry;
GrpList myGroups;
+protected slots:
+ virtual void reject();
+
private slots:
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
void ClickOnHelp();
void updateControls();
aLay->addWidget(myHelpBtn);
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
- connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
+ connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
// selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
myTypeGrp->button(Type_2d)->setChecked(true);
onTypeChanged(Type_2d);
void SMESHGUI_MeshPatternDlg::onOk()
{
if (onApply())
- onClose();
+ reject();
}
//=======================================================================
-// name : SMESHGUI_MeshPatternDlg::onClose
+// name : SMESHGUI_MeshPatternDlg::reject
// Purpose : SLOT called when "Close" button pressed. Close dialog
//=======================================================================
-void SMESHGUI_MeshPatternDlg::onClose()
+void SMESHGUI_MeshPatternDlg::reject()
{
mySelectionMgr->clearFilters();
SMESH::SetPickable();
disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState();
erasePreview();
- reject();
+ QDialog::reject();
}
//=================================================================================
onTextChanged(mySelEdit[Ids]->text());
}
-//=======================================================================
-// name : SMESHGUI_MeshPatternDlg::closeEvent
-// Purpose :
-//=======================================================================
-void SMESHGUI_MeshPatternDlg::closeEvent (QCloseEvent*)
-{
- onClose();
-}
-
//=======================================================================
// name : SMESHGUI_MeshPatternDlg::onSelInputChanged
// Purpose : SLOT. Called when -> button clicked.
void Init();
+protected slots:
+ virtual void reject();
+
private slots:
void onOk();
bool onApply();
- void onClose();
void onHelp();
void onDeactivate();
void activateSelection();
QStringList prepareFilters() const;
QString autoExtension( const QString& ) const;
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* );
void keyPressEvent( QKeyEvent* );
bool isValid( const bool = true );
// main buttons
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
- connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
+ connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
// selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
// dialog controls
connect(myFilterBtn, SIGNAL(clicked()), SLOT(onFilterBtn() ));
void SMESHGUI_MultiEditDlg::onOk()
{
if (onApply())
- onClose();
+ reject();
}
//=======================================================================
}
//=======================================================================
-// name : SMESHGUI_MultiEditDlg::onClose
+// name : SMESHGUI_MultiEditDlg::reject
// Purpose : SLOT called when "Close" button pressed. Close dialog
//=======================================================================
-void SMESHGUI_MultiEditDlg::onClose()
+void SMESHGUI_MultiEditDlg::reject()
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
//mySelectionMgr->clearSelected();
mySelectionMgr->clearFilters();
- reject();
+ QDialog::reject();
}
//=================================================================================
}
}
-//=======================================================================
-// name : SMESHGUI_MultiEditDlg::closeEvent
-// Purpose :
-//=======================================================================
-void SMESHGUI_MultiEditDlg::closeEvent (QCloseEvent*)
-{
- onClose();
-}
-//=======================================================================
-// name : SMESHGUI_MultiEditDlg::hideEvent
-// Purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_MultiEditDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- onClose();
-}
-
//=======================================================================
// name : SMESHGUI_MultiEditDlg::onFilterBtn
// Purpose : SLOT. Called when "Filter" button pressed.
{
}
-void SMESHGUI_CuttingOfQuadsDlg::onClose()
+void SMESHGUI_CuttingOfQuadsDlg::reject()
{
erasePreview();
- SMESHGUI_MultiEditDlg::onClose();
+ SMESHGUI_MultiEditDlg::reject();
}
bool SMESHGUI_CuttingOfQuadsDlg::process (SMESH::SMESH_MeshEditor_ptr theEditor,
protected slots:
void onOk();
virtual bool onApply();
- virtual void onClose();
+ virtual void reject();
void onHelp();
void onDeactivate();
SMESH::NumericalFunctor_ptr getNumericalFunctor();
protected:
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent * );
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
QWidget* createButtonFrame( QWidget* );
QWidget* createMainFrame( QWidget*, const bool );
SMESH::SMESH_IDSource_ptr obj);
protected slots:
- virtual void onClose();
+ virtual void reject();
void onCriterionRB();
void onPreviewChk();
/* signals and slots connections */
connect( buttonOk, SIGNAL( clicked() ), this, SLOT( ClickOnOk() ) );
- connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( ClickOnCancel() ) );
+ connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect( buttonApply, SIGNAL( clicked() ), this, SLOT( ClickOnApply() ) );
connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( ClickOnHelp() ) );
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), SLOT( SelectionIntoArgument() ) );
connect( mySMESHGUI, SIGNAL( SignalDeactivateActiveDialog() ), SLOT( DeactivateActiveDialog() ) );
/* to close dialog if study frame change */
- connect( mySMESHGUI, SIGNAL( SignalStudyFrameChanged() ), SLOT( ClickOnCancel() ) );
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(ClickOnCancel()));
+ connect( mySMESHGUI, SIGNAL( SignalStudyFrameChanged() ), SLOT( reject() ) );
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
// set selection mode
SMESH::SetPointRepresentation( true );
void SMESHGUI_NodesDlg::ClickOnOk()
{
if ( ClickOnApply() )
- ClickOnCancel();
+ reject();
}
//=================================================================================
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_NodesDlg::ClickOnCancel()
+void SMESHGUI_NodesDlg::reject()
{
disconnect( mySelectionMgr, 0, this, 0 );
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ) )
SMESH::SetPointRepresentation( false );
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
}
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_NodesDlg::closeEvent( QCloseEvent* )
-{
- this->ClickOnCancel(); /* same than click on cancel button */
-}
-
-//=================================================================================
-// function : hideEvent()
-// purpose : caused by ESC key
-//=================================================================================
-void SMESHGUI_NodesDlg::hideEvent( QHideEvent* )
-{
- if ( !isMinimized() )
- ClickOnCancel();
-}
-
//=================================================================================
// function : enterEvent()
// purpose : to reactivate this dialog box when mouse enter onto the window
void Init();
void enterEvent( QEvent* );
- void closeEvent( QCloseEvent* );
- void hideEvent ( QHideEvent* );
void keyPressEvent( QKeyEvent* );
bool isValid();
QString myHelpFileName;
+protected slots:
+ virtual void reject();
+
private slots:
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
void ClickOnHelp();
void DeactivateActiveDialog();
// Connect section
connect( myOkBtn, SIGNAL( clicked() ), this, SLOT( onOk() ) );
connect( myApplyBtn, SIGNAL( clicked() ), this, SLOT( onApply() ) );
- connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( onCancel() ) );
+ connect( myCancelBtn, SIGNAL( clicked() ), this, SLOT( reject() ) );
connect( myHelpBtn, SIGNAL(clicked()), this, SLOT( onHelp() ) );
connect( myMinEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( onMinMaxChanged() ) );
connect( myMaxEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( onMinMaxChanged() ) );
connect( myDistributionGrp, SIGNAL( toggled(bool) ), this, SLOT(onDistributionActivated(bool)) );
connect( myDistribColorGrp, SIGNAL( buttonClicked( int ) ), this, SLOT( onDistributionChanged( int ) ) );
connect( mySelectionMgr, SIGNAL( currentSelectionChanged() ), this, SLOT( onSelectionChanged() ) );
- connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( onCancel() ) );
+ connect( mySMESHGUI, SIGNAL( SignalCloseAllDialogs() ), this, SLOT( reject() ) );
myHelpFileName = "quality_page.html";
}
void SMESHGUI_Preferences_ScalarBarDlg::onOk()
{
if ( onApply() )
- onCancel();
+ reject();
}
//=================================================================================================
//=================================================================================================
/*!
- * SMESHGUI_Preferences_ScalarBarDlg::onCancel
+ * SMESHGUI_Preferences_ScalarBarDlg::reject
*
* Cancel button slot
*/
//=================================================================================================
-void SMESHGUI_Preferences_ScalarBarDlg::onCancel()
+void SMESHGUI_Preferences_ScalarBarDlg::reject()
{
- close();
+ myDlg = 0;
+ QDialog::reject();
}
//=================================================================================================
myDistributionGrp->setEnabled( false );
}
-//=================================================================================================
-/*!
- * SMESHGUI_Preferences_ScalarBarDlg::closeEvent
- *
- * Close event handler
- */
-//=================================================================================================
-void SMESHGUI_Preferences_ScalarBarDlg::closeEvent( QCloseEvent* e )
-{
- myDlg = 0;
- QDialog::closeEvent( e );
-}
-
//=================================================================================================
/*!
* SMESHGUI_Preferences_ScalarBarDlg::onMinMaxChanged
static void ScalarBarProperties( SMESHGUI* );
- void closeEvent( QCloseEvent* );
void setOriginAndSize( const double,
const double,
const double,
const double );
void initScalarBarFromResources();
+protected slots:
+ virtual void reject();
+
protected slots:
void onOk();
bool onApply();
- void onCancel();
void onHelp();
void onSelectionChanged();
void onXYChanged();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&)));
void SMESHGUI_RemoveElementsDlg::ClickOnOk()
{
ClickOnApply();
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_RemoveElementsDlg::ClickOnCancel()
+void SMESHGUI_RemoveElementsDlg::reject()
{
if (SMESH::GetCurrentVtkView())
SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_RemoveElementsDlg::closeEvent(QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_RemoveElementsDlg::hideEvent( QHideEvent* )
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=================================================================================
// function : keyPressEvent()
// purpose :
private:
void Init();
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
LightApp_SelectionMgr* mySelectionMgr;
SMESHGUI_FilterDlg* myFilterDlg;
+protected slots:
+ virtual void reject();
+
private slots:
void ClickOnOk();
- void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(myEditCurrentArgument, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&)));
void SMESHGUI_RemoveNodesDlg::ClickOnOk()
{
ClickOnApply();
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_RemoveNodesDlg::ClickOnCancel()
+void SMESHGUI_RemoveNodesDlg::reject()
{
//mySelectionMgr->clearSelected();
if (SMESH::GetCurrentVtkView()) {
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_RemoveNodesDlg::closeEvent(QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_RemoveNodesDlg::hideEvent( QHideEvent* )
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=================================================================================
// function : keyPressEvent()
// purpose :
private:
void Init();
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
LightApp_SelectionMgr* mySelectionMgr;
SMESHGUI_FilterDlg* myFilterDlg;
+protected slots:
+ virtual void reject();
+
private slots:
void ClickOnOk();
- void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
myEditCurrentArgument = LineEditMesh;
LineEditMesh->setFocus();
void SMESHGUI_RenumberingDlg::ClickOnOk()
{
ClickOnApply();
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_RenumberingDlg::ClickOnCancel()
+void SMESHGUI_RenumberingDlg::reject()
{
//mySelectionMgr->clearSelected();
mySelectionMgr->clearFilters();
disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_RenumberingDlg::closeEvent(QCloseEvent* e)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_RenumberingDlg::hideEvent (QHideEvent * e)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=================================================================================
// function : keyPressEvent()
// purpose :
private:
void Init();
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
SMESHGUI* mySMESHGUI; /* Current SMESHGUI object */
QString myHelpFileName;
+protected slots:
+ virtual void reject();
+
private slots:
void ClickOnOk();
- void ClickOnCancel();
void ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
void SMESHGUI_RevolutionDlg::ClickOnOk()
{
if( ClickOnApply() )
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_RevolutionDlg::ClickOnCancel()
-{
- reject();
-}
-
void SMESHGUI_RevolutionDlg::reject()
{
- close();
+ disconnect(mySelectionMgr, 0, this, 0);
+ mySelectionMgr->clearFilters();
+ //mySelectionMgr->clearSelected();
+ if (SMESH::GetCurrentVtkView()) {
+ SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
+ SMESH::SetPointRepresentation(false);
+ }
+ if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
+ aViewWindow->SetSelectionMode(ActorSelection);
+ mySMESHGUI->ResetState();
+
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_RevolutionDlg::closeEvent (QCloseEvent*)
-{
- /* same than click on cancel button */
- disconnect(mySelectionMgr, 0, this, 0);
- mySelectionMgr->clearFilters();
- //mySelectionMgr->clearSelected();
- if (SMESH::GetCurrentVtkView()) {
- SMESH::RemoveFilters(); // PAL6938 -- clean all mesh entity filters
- SMESH::SetPointRepresentation(false);
- }
- if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
- aViewWindow->SetSelectionMode(ActorSelection);
- mySMESHGUI->ResetState();
-}
-
//=======================================================================
//function : onSelectMesh
//purpose :
SMESHGUI_RevolutionDlg( SMESHGUI* );
~SMESHGUI_RevolutionDlg();
- void reject();
-
private:
enum {NONE_SELECT, POINT_SELECT, FACE_SELECT};
void Init( bool = true);
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
void keyPressEvent( QKeyEvent* );
int GetConstructorId();
protected slots:
virtual void onDisplaySimulation( bool );
+ virtual void reject();
private slots:
void ConstructorsClicked( int );
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
{
setIsApplyAndClose( true );
if( ClickOnApply() )
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_RotationDlg::ClickOnCancel()
+void SMESHGUI_RotationDlg::reject()
{
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_RotationDlg::closeEvent (QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=================================================================================
-// function : hideEvent()
-// purpose : caused by ESC key
-//=================================================================================
-void SMESHGUI_RotationDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=================================================================================
// function : onSelectMesh()
// purpose :
private:
void Init( bool = true );
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
bool IsAxisOk();
void setNewMeshName();
SMESHGUI_FilterDlg* myFilterDlg;
protected slots:
- virtual void onDisplaySimulation( bool );
+ virtual void onDisplaySimulation( bool );
+ virtual void reject();
private slots:
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
{
setIsApplyAndClose( true );
if( ClickOnApply() )
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_ScaleDlg::ClickOnCancel()
+void SMESHGUI_ScaleDlg::reject()
{
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection );
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_ScaleDlg::closeEvent (QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_ScaleDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=======================================================================
//function : onSelectMesh
//purpose :
private:
void Init( bool = true );
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
int GetConstructorId();
void setNewMeshName();
protected slots:
- virtual void onDisplaySimulation( bool );
+ virtual void onDisplaySimulation( bool );
+ virtual void reject();
private slots:
void ConstructorsClicked( int );
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(LineEdit1, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(LineEdit2, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
void SMESHGUI_SewingDlg::ClickOnOk()
{
if (ClickOnApply())
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_SewingDlg::ClickOnCancel()
+void SMESHGUI_SewingDlg::reject()
{
//mySelectionMgr->clearSelected();
SMESH::SetPointRepresentation(false);
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0);
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_SewingDlg::closeEvent (QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_SewingDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=================================================================================
// function : GetConstructorId()
// purpose :
private:
void Init();
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
int GetConstructorId();
bool IsValid();
QString myHelpFileName;
+protected slots:
+ virtual void reject();
+
private slots:
void ConstructorsClicked( int );
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
// main buttons
connect(myOkBtn, SIGNAL(clicked()), SLOT(onOk()));
- connect(myCloseBtn, SIGNAL(clicked()), SLOT(onClose()));
+ connect(myCloseBtn, SIGNAL(clicked()), SLOT(reject()));
connect(myApplyBtn, SIGNAL(clicked()), SLOT(onApply()));
connect(myHelpBtn, SIGNAL(clicked()), SLOT(onHelp()));
// selection and SMESHGUI
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), SLOT(onSelectionDone()));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), SLOT(onDeactivate()));
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(onClose()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), SLOT(reject()));
connect(myEdge, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
myOkBtn->setEnabled(false);
void SMESHGUI_SingleEditDlg::onOk()
{
if (onApply())
- onClose();
+ reject();
}
//=======================================================================
-// name : onClose()
+// name : reject()
// Purpose : SLOT called when "Close" button pressed. Close dialog
//=======================================================================
-void SMESHGUI_SingleEditDlg::onClose()
+void SMESHGUI_SingleEditDlg::reject()
{
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
disconnect(mySelectionMgr, 0, this, 0);
disconnect(mySMESHGUI, 0, this, 0);
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
}
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_SingleEditDlg::closeEvent (QCloseEvent*)
-{
- onClose();
-}
-
-//=======================================================================
-//function : hideEvent()
-//purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_SingleEditDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- onClose();
-}
-
//=================================================================================
// function : onApply()
// purpose : SLOT. Called when apply button is pressed
protected slots:
void onOk();
virtual bool onApply();
- void onClose();
+ virtual void reject();
void onHelp();
void onDeactivate();
void onTextChange( const QString& );
protected:
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* );
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
QWidget* createButtonFrame( QWidget* );
QWidget* createMainFrame( QWidget* );
/***************************************************************/
// signals and slots connections
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)),
SLOT(onTextChange(const QString&)));
connect(LineEditNodes, SIGNAL(textChanged(const QString&)),
void SMESHGUI_SmoothingDlg::ClickOnOk()
{
if( ClickOnApply() )
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose : Called when dialog box is closed
//=================================================================================
-void SMESHGUI_SmoothingDlg::ClickOnCancel()
+void SMESHGUI_SmoothingDlg::reject()
{
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_SmoothingDlg::closeEvent (QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-// function : hideEvent()
-// purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_SmoothingDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=======================================================================
// function : onSelectMesh()
// purpose :
private:
void Init();
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
void setFilters( const bool theIsElem );
QPushButton* myElemFilterBtn;
SMESHGUI_FilterDlg* myFilterDlg;
+protected slots:
+ virtual void reject();
+
private slots:
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
connect(mySMESHGUI, SIGNAL(SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL(SignalCloseAllDialogs()), this, SLOT(reject()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
{
setIsApplyAndClose( true );
if( ClickOnApply() )
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_SymmetryDlg::ClickOnCancel()
+void SMESHGUI_SymmetryDlg::reject()
{
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode(ActorSelection);
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_SymmetryDlg::closeEvent (QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-// function : hideEvent()
-// purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_SymmetryDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=======================================================================
//function : onSelectMesh
//purpose :
private:
void Init( bool = true );
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
int GetConstructorId();
bool IsMirrorOk();
protected slots:
virtual void onDisplaySimulation( bool );
+ virtual void reject();
private slots:
void ConstructorsClicked( int );
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
/* signals and slots connections */
connect(buttonOk, SIGNAL(clicked()), this, SLOT(ClickOnOk()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(ClickOnCancel()));
+ connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
connect(buttonApply, SIGNAL(clicked()), this, SLOT(ClickOnApply()));
connect(buttonHelp, SIGNAL(clicked()), this, SLOT(ClickOnHelp()));
connect(GroupConstructors, SIGNAL(buttonClicked(int)), SLOT(ConstructorsClicked(int)));
connect(mySMESHGUI, SIGNAL (SignalDeactivateActiveDialog()), this, SLOT(DeactivateActiveDialog()));
connect(mySelectionMgr, SIGNAL(currentSelectionChanged()), this, SLOT(SelectionIntoArgument()));
/* to close dialog if study change */
- connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(ClickOnCancel()));
+ connect(mySMESHGUI, SIGNAL (SignalCloseAllDialogs()), this, SLOT(reject()));
connect(LineEditElements, SIGNAL(textChanged(const QString&)), SLOT(onTextChange(const QString&)));
connect(CheckBoxMesh, SIGNAL(toggled(bool)), SLOT(onSelectMesh(bool)));
connect(ActionGroup, SIGNAL(buttonClicked(int)), SLOT(onActionClicked(int)));
{
setIsApplyAndClose( true );
if( ClickOnApply() )
- ClickOnCancel();
+ reject();
}
//=================================================================================
-// function : ClickOnCancel()
+// function : reject()
// purpose :
//=================================================================================
-void SMESHGUI_TranslationDlg::ClickOnCancel()
+void SMESHGUI_TranslationDlg::reject()
{
disconnect(mySelectionMgr, 0, this, 0);
mySelectionMgr->clearFilters();
if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
aViewWindow->SetSelectionMode( ActorSelection );
mySMESHGUI->ResetState();
- reject();
+ QDialog::reject();
}
//=================================================================================
ActivateThisDialog();
}
-//=================================================================================
-// function : closeEvent()
-// purpose :
-//=================================================================================
-void SMESHGUI_TranslationDlg::closeEvent (QCloseEvent*)
-{
- /* same than click on cancel button */
- ClickOnCancel();
-}
-
-//=======================================================================
-//function : hideEvent
-//purpose : caused by ESC key
-//=======================================================================
-void SMESHGUI_TranslationDlg::hideEvent (QHideEvent*)
-{
- if (!isMinimized())
- ClickOnCancel();
-}
-
//=======================================================================
//function : onSelectMesh
//purpose :
private:
void Init( bool = true );
- void closeEvent( QCloseEvent* );
void enterEvent( QEvent* ); /* mouse enter the QWidget */
- void hideEvent( QHideEvent* ); /* ESC key */
void keyPressEvent( QKeyEvent* );
int GetConstructorId();
void setNewMeshName();
SMESHGUI_FilterDlg* myFilterDlg;
protected slots:
- virtual void onDisplaySimulation( bool );
+ virtual void onDisplaySimulation( bool );
+ virtual void reject();
private slots:
void ConstructorsClicked( int );
void ClickOnOk();
- void ClickOnCancel();
bool ClickOnApply();
void ClickOnHelp();
void SetEditCurrentArgument();
{
const SMDS_MeshNode* _node;
double _xyz[3];
- SMESH_TNodeXYZ( const SMDS_MeshElement* e):gp_XYZ(0,0,0),_node(0) {
+ SMESH_TNodeXYZ( const SMDS_MeshElement* e=0):gp_XYZ(0,0,0),_node(0) {
if (e) {
assert( e->GetType() == SMDSAbs_Node );
_node = static_cast<const SMDS_MeshNode*>(e);
TopExp::MapShapes( SMESH_Mesh::PseudoShape(), pseudoSubShapes );
// index of pseudoSubShapes corresponding to srcMeshDS
- int subIndex = srcMeshDS->GetPersistentId() % pseudoSubShapes.Extent();
+ int subIndex = 1 + srcMeshDS->GetPersistentId() % pseudoSubShapes.Extent();
int nbSubShapes = 1 + srcMeshDS->GetPersistentId() / pseudoSubShapes.Extent();
// try to find already present shapeForSrcMesh
// cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl;\
// }
-typedef StdMeshers_ProjectionUtils TAssocTool;
-typedef SMESH_Comment TCom;
+namespace TAssocTool = StdMeshers_ProjectionUtils;
+
+typedef SMESH_Comment TCom;
enum { ID_BOT_FACE = SMESH_Block::ID_Fxy0,
ID_TOP_FACE = SMESH_Block::ID_Fxy1,
if ( nbSolids < 1 )
return true;
- Prism_3D::TPrismTopo prism;
-
- if ( nbSolids == 1 )
- {
- return ( initPrism( prism, TopExp_Explorer( theShape, TopAbs_SOLID ).Current() ) &&
- compute( prism ));
- }
-
TopTools_IndexedDataMapOfShapeListOfShape faceToSolids;
TopExp::MapShapesAndAncestors( theShape, TopAbs_FACE, TopAbs_SOLID, faceToSolids );
// look for meshed FACEs ("source" FACEs) that must be prism bottoms
- list< TopoDS_Face > meshedFaces;//, notQuadMeshedFaces, notQuadFaces;
+ list< TopoDS_Face > meshedFaces, notQuadMeshedFaces, notQuadFaces;
const bool meshHasQuads = ( theMesh.NbQuadrangles() > 0 );
for ( int iF = 1; iF < faceToSolids.Extent(); ++iF )
{
{
if ( !meshHasQuads ||
!helper.IsSameElemGeometry( faceSM->GetSubMeshDS(), SMDSGeom_QUADRANGLE ) ||
- !helper.IsStructured( faceSM ))
- // notQuadMeshedFaces are of higher priority
+ !helper.IsStructured( faceSM )
+ )
+ notQuadMeshedFaces.push_front( face );
+ else if ( myHelper->Count( face, TopAbs_EDGE, /*ignoreSame=*/false ) != 4 )
meshedFaces.push_front( face );
else
meshedFaces.push_back( face );
}
+ else if ( myHelper->Count( face, TopAbs_EDGE, /*ignoreSame=*/false ) != 4 )
+ {
+ notQuadFaces.push_back( face );
+ }
}
- //meshedFaces.splice( meshedFaces.begin(), notQuadMeshedFaces );
+ // notQuadFaces are of medium priority, put them before ordinary meshed faces
+ meshedFaces.splice( meshedFaces.begin(), notQuadFaces );
+ // notQuadMeshedFaces are of highest priority, put them before notQuadFaces
+ meshedFaces.splice( meshedFaces.begin(), notQuadMeshedFaces );
- // if ( meshedFaces.empty() )
- // return error( COMPERR_BAD_INPUT_MESH, "No meshed source faces found" );
+ Prism_3D::TPrismTopo prism;
+
+ if ( nbSolids == 1 )
+ {
+ if ( !meshedFaces.empty() )
+ prism.myBottom = meshedFaces.front();
+ return ( initPrism( prism, TopExp_Explorer( theShape, TopAbs_SOLID ).Current() ) &&
+ compute( prism ));
+ }
TopTools_MapOfShape meshedSolids;
list< Prism_3D::TPrismTopo > meshedPrism;
// TODO. there are other ways to find out the source FACE:
// propagation, topological similarity, ect.
+ // simply try to mesh all not meshed SOLIDs
+ if ( meshedFaces.empty() )
+ {
+ for ( TopExp_Explorer solid( theShape, TopAbs_SOLID ); solid.More(); solid.Next() )
+ {
+ mySetErrorToSM = false;
+ prism.Clear();
+ if ( !meshedSolids.Contains( solid.Current() ) &&
+ initPrism( prism, solid.Current() ))
+ {
+ mySetErrorToSM = true;
+ if ( !compute( prism ))
+ return false;
+ meshedFaces.push_front( prism.myTop );
+ meshedFaces.push_front( prism.myBottom );
+ meshedPrism.push_back( prism );
+ meshedSolids.Add( solid.Current() );
+ }
+ mySetErrorToSM = true;
+ }
+ }
if ( meshedFaces.empty() ) // set same error to 10 not-computed solids
{
SMESH_subMesh* sm = theMesh.GetSubMesh( solid.Current() );
sm->GetComputeError() = err;
}
- return false;
+ return error( err );
}
}
return true;
// -------------------------
// Compose a vector of indixes of right neighbour FACE for each wall FACE
- // that is not so evident in case of several WIREs
+ // that is not so evident in case of several WIREs in the bottom FACE
thePrism.myRightQuadIndex.clear();
for ( size_t i = 0; i < thePrism.myWallQuads.size(); ++i )
thePrism.myRightQuadIndex.push_back( i+1 );
SMESHDS_SubMesh * topSMDS = topSM->GetSubMeshDS();
if ( !botSMDS || botSMDS->NbElements() == 0 )
- return toSM( error(TCom("No elememts on face #") << botSM->GetId() ));
+ {
+ _gen->Compute( *myHelper->GetMesh(), botSM->GetSubShape() );
+ botSMDS = botSM->GetSubMeshDS();
+ if ( !botSMDS || botSMDS->NbElements() == 0 )
+ return toSM( error(TCom("No elememts on face #") << botSM->GetId() ));
+ }
bool needProject = !topSM->IsMeshComputed();
if ( !needProject &&
// if the bottom faces is orienetd OK then top faces must be reversed
bool reverseTop = true;
if ( myHelper->NbAncestors( botFace, *myBlock.Mesh(), TopAbs_SOLID ) > 1 )
- reverseTop = ! SMESH_Algo::IsReversedSubMesh( TopoDS::Face( botFace ), meshDS );
+ reverseTop = ! myHelper->IsReversedSubMesh( TopoDS::Face( botFace ));
int iFrw, iRev, *iPtr = &( reverseTop ? iRev : iFrw );
// loop on bottom mesh faces
#include "StdMeshers_ProjectionSource2D.hxx"
#include "StdMeshers_ProjectionSource3D.hxx"
+#include "SMDS_EdgePosition.hxx"
#include "SMESH_Algo.hxx"
#include "SMESH_Block.hxx"
#include "SMESH_Gen.hxx"
+#include "SMESH_HypoFilter.hxx"
#include "SMESH_Hypothesis.hxx"
#include "SMESH_Mesh.hxx"
#include "SMESH_MesherHelper.hxx"
#include "SMESH_subMesh.hxx"
#include "SMESH_subMeshEventListener.hxx"
-#include "SMDS_EdgePosition.hxx"
#include "utilities.h"
} // namespace
//=======================================================================
-/*!
- * \brief Looks for association of all sub-shapes of two shapes
- * \param theShape1 - target shape
- * \param theMesh1 - mesh built on shape 1
- * \param theShape2 - source shape
- * \param theMesh2 - mesh built on shape 2
- * \param theAssociation - association map to be filled that may
- * contain association of one or two pairs of vertices
- * \retval bool - true if association found
+/*
+ * Looks for association of all sub-shapes of two shapes
+ * \param theShape1 - target shape
+ * \param theMesh1 - mesh built on shape 1
+ * \param theShape2 - source shape
+ * \param theMesh2 - mesh built on shape 2
+ * \param theAssociation - association map to be filled that may
+ * contain association of one or two pairs of vertices
+ * \retval bool - true if association found
*/
//=======================================================================
}
//================================================================================
-/*!
- * \brief Find association of edges of faces
- * \param face1 - face 1
- * \param VV1 - vertices of face 1
- * \param face2 - face 2
- * \param VV2 - vertices of face 2 associated with ones of face 1
- * \param edges1 - out list of edges of face 1
- * \param edges2 - out list of edges of face 2
- * \retval int - nb of edges in an outer wire in a success case, else zero
+/*
+ * Find association of edges of faces
+ * \param face1 - face 1
+ * \param VV1 - vertices of face 1
+ * \param face2 - face 2
+ * \param VV2 - vertices of face 2 associated with ones of face 1
+ * \param edges1 - out list of edges of face 1
+ * \param edges2 - out list of edges of face 2
+ * \retval int - nb of edges in an outer wire in a success case, else zero
*/
//================================================================================
}
//=======================================================================
-/*!
- * \brief Inserts association theShape1 <-> theShape2 to TShapeShapeMap
- * \param theShape1 - target shape
- * \param theShape2 - source shape
- * \param theAssociationMap - association map
- * \retval bool - true if there was no association for these shapes before
+/*
+ * Inserts association theShape1 <-> theShape2 to TShapeShapeMap
+ * \param theShape1 - target shape
+ * \param theShape2 - source shape
+ * \param theAssociationMap - association map
+ * \retval bool - true if there was no association for these shapes before
*/
//=======================================================================
}
//=======================================================================
-/*!
- * \brief Finds an edge by its vertices in a main shape of the mesh
- * \param aMesh - the mesh
- * \param V1 - vertex 1
- * \param V2 - vertex 2
- * \retval TopoDS_Edge - found edge
+/*
+ * Finds an edge by its vertices in a main shape of the mesh
+ * \param aMesh - the mesh
+ * \param V1 - vertex 1
+ * \param V2 - vertex 2
+ * \retval TopoDS_Edge - found edge
*/
//=======================================================================
}
//================================================================================
-/*!
- * \brief Return another face sharing an edge
- * \param edgeToFaces - data map of descendants to ancestors
- * \param edge - edge
- * \param face - face
- * \retval TopoDS_Face - found face
+/*
+ * Return another face sharing an edge
+ * \param edgeToFaces - data map of descendants to ancestors
+ * \param edge - edge
+ * \param face - face
+ * \retval TopoDS_Face - found face
*/
//================================================================================
}
//================================================================================
-/*!
- * \brief Return other vertex of an edge
+/*
+ * Return other vertex of an edge
*/
//================================================================================
}
//================================================================================
-/*!
- * \brief Return a propagation edge
- * \param aMesh - mesh
- * \param theEdge - edge to find by propagation
- * \param fromEdge - start edge for propagation
- * \retval pair<int,TopoDS_Edge> - propagation step and found edge
+/*
+ * Return a propagation edge
+ * \param aMesh - mesh
+ * \param theEdge - edge to find by propagation
+ * \param fromEdge - start edge for propagation
+ * \retval pair<int,TopoDS_Edge> - propagation step and found edge
*/
//================================================================================
}
//================================================================================
- /*!
- * \brief Find corresponding nodes on two faces
- * \param face1 - the first face
- * \param mesh1 - mesh containing elements on the first face
- * \param face2 - the second face
- * \param mesh2 - mesh containing elements on the second face
- * \param assocMap - map associating sub-shapes of the faces
- * \param node1To2Map - map containing found matching nodes
- * \retval bool - is a success
- */
+/*
+ * Find corresponding nodes on two faces
+ * \param face1 - the first face
+ * \param mesh1 - mesh containing elements on the first face
+ * \param face2 - the second face
+ * \param mesh2 - mesh containing elements on the second face
+ * \param assocMap - map associating sub-shapes of the faces
+ * \param node1To2Map - map containing found matching nodes
+ * \retval bool - is a success
+ */
//================================================================================
bool StdMeshers_ProjectionUtils::
{
SMESHDS_Mesh* meshDS1 = mesh1->GetMeshDS();
SMESHDS_Mesh* meshDS2 = mesh2->GetMeshDS();
-
+
SMESH_MesherHelper helper1( *mesh1 );
SMESH_MesherHelper helper2( *mesh2 );
node1To2Map.insert( make_pair( vNode1, vNode2 ));
}
-// don't know why this condition is usually true :(
-// if ( node1To2Map.size() * quadFactor < SM1->NbNodes() )
-// MESSAGE("FindMatchingNodes() found too few node pairs starting from nodes ("
-// << vNode1->GetID() << " - " << eNode1[0]->GetID() << ") ("
-// << vNode2->GetID() << " - " << eNode2[0]->GetID() << "):"
-// << node1To2Map.size() * quadFactor << " < " << SM1->NbNodes());
-
+ // don't know why this condition is usually true :(
+ // if ( node1To2Map.size() * quadFactor < SM1->NbNodes() )
+ // MESSAGE("FindMatchingNodes() found too few node pairs starting from nodes ("
+ // << vNode1->GetID() << " - " << eNode1[0]->GetID() << ") ("
+ // << vNode2->GetID() << " - " << eNode2[0]->GetID() << "):"
+ // << node1To2Map.size() * quadFactor << " < " << SM1->NbNodes());
+
return true;
}
//================================================================================
- /*!
- * \brief Return any sub-shape of a face belonging to the outer wire
- * \param face - the face
- * \param type - type of sub-shape to return
- * \retval TopoDS_Shape - the found sub-shape
- */
+/*
+ * Return any sub-shape of a face belonging to the outer wire
+ * \param face - the face
+ * \param type - type of sub-shape to return
+ * \retval TopoDS_Shape - the found sub-shape
+ */
//================================================================================
TopoDS_Shape StdMeshers_ProjectionUtils::OuterShape( const TopoDS_Face& face,
}
//================================================================================
- /*!
- * \brief Check that submesh is computed and try to compute it if is not
- * \param sm - submesh to compute
- * \param iterationNb - int used to stop infinite recursive call
- * \retval bool - true if computed
- */
+/*
+ * Check that submesh is computed and try to compute it if is not
+ * \param sm - submesh to compute
+ * \param iterationNb - int used to stop infinite recursive call
+ * \retval bool - true if computed
+ */
//================================================================================
bool StdMeshers_ProjectionUtils::MakeComputed(SMESH_subMesh * sm, const int iterationNb)
return false;
}
+
+//================================================================================
+/*
+ * Returns an error message to show in case if MakeComputed( sm ) fails.
+ */
+//================================================================================
+
+std::string StdMeshers_ProjectionUtils::SourceNotComputedError( SMESH_subMesh * sm,
+ SMESH_Algo* projAlgo )
+{
+ const char usualMessage [] = "Source mesh not computed";
+ if ( !projAlgo )
+ return usualMessage;
+ if ( !sm || sm->GetAlgoState() != SMESH_subMesh::NO_ALGO )
+ return usualMessage; // algo is OK, anything else is KO.
+
+ // Try to find a type of all-dimentional algorithm that would compute the
+ // given sub-mesh if it could be launched before projection
+ const TopoDS_Shape shape = sm->GetSubShape();
+ const int shapeDim = SMESH_Gen::GetShapeDim( shape );
+
+ for ( int dimIncrement = 1; shapeDim + dimIncrement < 4; ++dimIncrement )
+ {
+ SMESH_HypoFilter filter( SMESH_HypoFilter::IsAlgo() );
+ filter.And( filter.HasDim( shapeDim + dimIncrement ));
+
+ SMESH_Algo* algo = (SMESH_Algo*) sm->GetFather()->GetHypothesis( shape, filter, true );
+ if ( algo && !algo->NeedDiscreteBoundary() )
+ return SMESH_Comment("\"")
+ << algo->GetFeatures()._label << "\""
+ << " can't be used to compute the source mesh for \""
+ << projAlgo->GetFeatures()._label << "\" in this case";
+ }
+ return usualMessage;
+}
+
//================================================================================
-/*!
- * \brief Return a boundary EDGE (or all boundary EDGEs) of edgeContainer
+/*
+ * Return a boundary EDGE (or all boundary EDGEs) of edgeContainer
*/
//================================================================================
}
//================================================================================
-/*!
- * \brief Set event listeners to submesh with projection algo
- * \param subMesh - submesh with projection algo
- * \param srcShape - source shape
- * \param srcMesh - source mesh
+/*
+ * Set event listeners to submesh with projection algo
+ * \param subMesh - submesh with projection algo
+ * \param srcShape - source shape
+ * \param srcMesh - source mesh
*/
//================================================================================
#include <list>
#include <map>
-class TopoDS_Shape;
class SMDS_MeshNode;
-class SMESH_Mesh;
+class SMESH_Algo;
class SMESH_Hypothesis;
+class SMESH_Mesh;
class SMESH_subMesh;
class TopTools_IndexedDataMapOfShapeListOfShape;
+class TopoDS_Shape;
/*!
* \brief Struct used instead of a sole TopTools_DataMapOfShapeShape to avoid
};
/*!
- * \brief Class encapsulating methods common to Projection algorithms
+ * \brief Methods common to Projection algorithms
*/
-class StdMeshers_ProjectionUtils
+namespace StdMeshers_ProjectionUtils
{
- public:
-
typedef StdMeshers_ShapeShapeBiDirectionMap TShapeShapeMap;
typedef TopTools_IndexedDataMapOfShapeListOfShape TAncestorMap;
typedef std::map<const SMDS_MeshNode*, const SMDS_MeshNode*> TNodeNodeMap;
/*!
* \brief Looks for association of all sub-shapes of two shapes
- * \param theShape1 - shape 1
- * \param theMesh1 - mesh built on shape 1
- * \param theShape2 - shape 2
- * \param theMesh2 - mesh built on shape 2
- * \param theAssociation - association map to be filled that may
- * contain association of one or two pairs of vertices
- * \retval bool - true if association found
+ * \param theShape1 - shape 1
+ * \param theMesh1 - mesh built on shape 1
+ * \param theShape2 - shape 2
+ * \param theMesh2 - mesh built on shape 2
+ * \param theAssociation - association map to be filled that may
+ * contain association of one or two pairs of vertices
+ * \retval bool - true if association found
*/
- static bool FindSubShapeAssociation(const TopoDS_Shape& theShape1,
- SMESH_Mesh* theMesh1,
- const TopoDS_Shape& theShape2,
- SMESH_Mesh* theMesh2,
- TShapeShapeMap & theAssociationMap);
+ bool FindSubShapeAssociation(const TopoDS_Shape& theShape1,
+ SMESH_Mesh* theMesh1,
+ const TopoDS_Shape& theShape2,
+ SMESH_Mesh* theMesh2,
+ TShapeShapeMap & theAssociationMap);
/*!
* \brief Find association of edges of faces
- * \param face1 - face 1
- * \param VV1 - vertices of face 1
- * \param face2 - face 2
- * \param VV2 - vertices of face 2 associated with oned of face 1
- * \param edges1 - out list of edges of face 1
- * \param edges2 - out list of edges of face 2
- * \retval int - nb of edges in an outer wire in a success case, else zero
+ * \param face1 - face 1
+ * \param VV1 - vertices of face 1
+ * \param face2 - face 2
+ * \param VV2 - vertices of face 2 associated with oned of face 1
+ * \param edges1 - out list of edges of face 1
+ * \param edges2 - out list of edges of face 2
+ * \retval int - nb of edges in an outer wire in a success case, else zero
*/
- static int FindFaceAssociation(const TopoDS_Face& face1,
- TopoDS_Vertex VV1[2],
- const TopoDS_Face& face2,
- TopoDS_Vertex VV2[2],
- std::list< TopoDS_Edge > & edges1,
- std::list< TopoDS_Edge > & edges2);
+ int FindFaceAssociation(const TopoDS_Face& face1,
+ TopoDS_Vertex VV1[2],
+ const TopoDS_Face& face2,
+ TopoDS_Vertex VV2[2],
+ std::list< TopoDS_Edge > & edges1,
+ std::list< TopoDS_Edge > & edges2);
/*!
* \brief Insert vertex association defined by a hypothesis into a map
- * \param theHyp - hypothesis
- * \param theAssociationMap - association map
- * \param theTargetShape - the shape theHyp assigned to
+ * \param theHyp - hypothesis
+ * \param theAssociationMap - association map
+ * \param theTargetShape - the shape theHyp assigned to
*/
- static void InitVertexAssociation( const SMESH_Hypothesis* theHyp,
- TShapeShapeMap & theAssociationMap);
+ void InitVertexAssociation( const SMESH_Hypothesis* theHyp,
+ TShapeShapeMap & theAssociationMap);
/*!
* \brief Inserts association theShape1 <-> theShape2 to TShapeShapeMap
- * \param theShape1 - target shape
- * \param theShape2 - source shape
- * \param theAssociationMap - association map
- * \param theBidirectional - if false, inserts theShape1 -> theShape2 association
- * \retval bool - true if there was no association for these shapes before
+ * \param theShape1 - target shape
+ * \param theShape2 - source shape
+ * \param theAssociationMap - association map
+ * \param theBidirectional - if false, inserts theShape1 -> theShape2 association
+ * \retval bool - true if there was no association for these shapes before
*/
- static bool InsertAssociation( const TopoDS_Shape& theShape1, // target
- const TopoDS_Shape& theShape2, // source
- TShapeShapeMap & theAssociationMap);
+ bool InsertAssociation( const TopoDS_Shape& theShape1, // target
+ const TopoDS_Shape& theShape2, // source
+ TShapeShapeMap & theAssociationMap);
/*!
* \brief Finds an edge by its vertices in a main shape of the mesh
*/
- static TopoDS_Edge GetEdgeByVertices( SMESH_Mesh* aMesh,
- const TopoDS_Vertex& V1,
- const TopoDS_Vertex& V2);
-
+ TopoDS_Edge GetEdgeByVertices( SMESH_Mesh* aMesh,
+ const TopoDS_Vertex& V1,
+ const TopoDS_Vertex& V2);
+
/*!
* \brief Return another face sharing an edge
* \param edgeToFaces - data map of descendants to ancestors
*/
- static TopoDS_Face GetNextFace( const TAncestorMap& edgeToFaces,
- const TopoDS_Edge& edge,
- const TopoDS_Face& face);
+ TopoDS_Face GetNextFace( const TAncestorMap& edgeToFaces,
+ const TopoDS_Edge& edge,
+ const TopoDS_Face& face);
/*!
* \brief Return other vertex of an edge
*/
- static TopoDS_Vertex GetNextVertex(const TopoDS_Edge& edge,
- const TopoDS_Vertex& vertex);
+ TopoDS_Vertex GetNextVertex(const TopoDS_Edge& edge,
+ const TopoDS_Vertex& vertex);
/*!
* \brief Return an oriented propagation edge
- * \param aMesh - mesh
- * \param fromEdge - start edge for propagation
- * \retval pair<int,TopoDS_Edge> - propagation step and found edge
+ * \param aMesh - mesh
+ * \param fromEdge - start edge for propagation
+ * \retval pair<int,TopoDS_Edge> - propagation step and found edge
*/
- static std::pair<int,TopoDS_Edge> GetPropagationEdge( SMESH_Mesh* aMesh,
- const TopoDS_Edge& anEdge,
- const TopoDS_Edge& fromEdge);
+ std::pair<int,TopoDS_Edge> GetPropagationEdge( SMESH_Mesh* aMesh,
+ const TopoDS_Edge& anEdge,
+ const TopoDS_Edge& fromEdge);
/*!
* \brief Find corresponding nodes on two faces
- * \param face1 - the first face
- * \param mesh1 - mesh containing elements on the first face
- * \param face2 - the second face
- * \param mesh2 - mesh containing elements on the second face
- * \param assocMap - map associating sub-shapes of the faces
- * \param nodeIn2OutMap - map containing found matching nodes
- * \retval bool - is a success
+ * \param face1 - the first face
+ * \param mesh1 - mesh containing elements on the first face
+ * \param face2 - the second face
+ * \param mesh2 - mesh containing elements on the second face
+ * \param assocMap - map associating sub-shapes of the faces
+ * \param nodeIn2OutMap - map containing found matching nodes
+ * \retval bool - is a success
*/
- static bool FindMatchingNodesOnFaces( const TopoDS_Face& face1,
- SMESH_Mesh* mesh1,
- const TopoDS_Face& face2,
- SMESH_Mesh* mesh2,
- const TShapeShapeMap & assocMap,
- TNodeNodeMap & nodeIn2OutMap);
+ bool FindMatchingNodesOnFaces( const TopoDS_Face& face1,
+ SMESH_Mesh* mesh1,
+ const TopoDS_Face& face2,
+ SMESH_Mesh* mesh2,
+ const TShapeShapeMap & assocMap,
+ TNodeNodeMap & nodeIn2OutMap);
/*!
* \brief Return any sub-shape of a face belonging to the outer wire
- * \param face - the face
- * \param type - type of sub-shape to return
- * \retval TopoDS_Shape - the found sub-shape
+ * \param face - the face
+ * \param type - type of sub-shape to return
+ * \retval TopoDS_Shape - the found sub-shape
*/
- static TopoDS_Shape OuterShape( const TopoDS_Face& face,
- TopAbs_ShapeEnum type);
+ TopoDS_Shape OuterShape( const TopoDS_Face& face,
+ TopAbs_ShapeEnum type);
/*!
* \brief Check that submeshis is computed and try to compute it if is not
- * \param sm - submesh to compute
- * \param iterationNb - int used to stop infinite recursive call
- * \retval bool - true if computed
+ * \param sm - submesh to compute
+ * \param iterationNb - int used to stop infinite recursive call
+ * \retval bool - true if computed
+ */
+ bool MakeComputed(SMESH_subMesh * sm, const int iterationNb = 0);
+
+ /*!
+ * \brief Returns an error message to show in case if MakeComputed( sm ) fails.
*/
- static bool MakeComputed(SMESH_subMesh * sm, const int iterationNb = 0);
+ std::string SourceNotComputedError( SMESH_subMesh * sm = 0,
+ SMESH_Algo* projAlgo=0);
/*!
* \brief Set event listeners to submesh with projection algo
- * \param subMesh - submesh with projection algo
- * \param srcShape - source shape
- * \param srcMesh - source mesh
+ * \param subMesh - submesh with projection algo
+ * \param srcShape - source shape
+ * \param srcMesh - source mesh
*/
- static void SetEventListener(SMESH_subMesh* subMesh,
- TopoDS_Shape srcShape,
- SMESH_Mesh* srcMesh);
+ void SetEventListener(SMESH_subMesh* subMesh,
+ TopoDS_Shape srcShape,
+ SMESH_Mesh* srcMesh);
/*!
* \brief Return a boundary EDGE (or all boundary EDGEs) of edgeContainer
*/
- static TopoDS_Edge GetBoundaryEdge(const TopoDS_Shape& edgeContainer,
- const SMESH_Mesh& mesh,
- std::list< TopoDS_Edge >* allBndEdges = 0 );
+ TopoDS_Edge GetBoundaryEdge(const TopoDS_Shape& edgeContainer,
+ const SMESH_Mesh& mesh,
+ std::list< TopoDS_Edge >* allBndEdges = 0 );
};
#endif
#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
-typedef StdMeshers_ProjectionUtils TAssocTool;
+//typedef StdMeshers_ProjectionUtils TAssocTool;
+namespace TAssocTool = StdMeshers_ProjectionUtils;
//=======================================================================
//function : StdMeshers_Projection_1D
SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcEdge );
//SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( tgtEdge );
+ string srcMeshError;
if ( tgtMesh == srcMesh ) {
if ( !TAssocTool::MakeComputed( srcSubMesh ))
- return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+ srcMeshError = TAssocTool::SourceNotComputedError( srcSubMesh, this );
}
else {
if ( !srcSubMesh->IsMeshComputed() )
- return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+ srcMeshError = TAssocTool::SourceNotComputedError();
}
+ if ( !srcMeshError.empty() )
+ return error(COMPERR_BAD_INPUT_MESH, srcMeshError );
+
// -----------------------------------------------
// Find out nodes distribution on the source edge
// -----------------------------------------------
if ( !srcMesh ) srcMesh = & theMesh;
SMESH_subMesh* srcFaceSM = srcMesh->GetSubMesh( srcFace );
- typedef StdMeshers_ProjectionUtils SPU;
+ namespace SPU = StdMeshers_ProjectionUtils;
SPU::TShapeShapeMap shape2ShapeMap;
SPU::InitVertexAssociation( _sourceHypo, shape2ShapeMap );
if ( !SPU::FindSubShapeAssociation( theShape, &theMesh, srcFace, srcMesh, shape2ShapeMap))
#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
-typedef StdMeshers_ProjectionUtils TAssocTool;
+namespace TAssocTool = StdMeshers_ProjectionUtils;
+//typedef StdMeshers_ProjectionUtils TAssocTool;
//=======================================================================
//function : StdMeshers_Projection_2D
SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( srcFace );
SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( tgtFace );
+ string srcMeshError;
if ( tgtMesh == srcMesh ) {
- if ( !TAssocTool::MakeComputed( srcSubMesh ) || !srcSubMesh->IsMeshComputed() )
- return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+ if ( !TAssocTool::MakeComputed( srcSubMesh ))
+ srcMeshError = TAssocTool::SourceNotComputedError( srcSubMesh, this );
}
else {
if ( !srcSubMesh->IsMeshComputed() )
- return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+ srcMeshError = TAssocTool::SourceNotComputedError();
}
+ if ( !srcMeshError.empty() )
+ return error(COMPERR_BAD_INPUT_MESH, srcMeshError );
// ===========
// Projection
done = projectBy2DSimilarity( tgtFace, srcFace, tgtMesh, srcMesh, shape2ShapeMap, is1DComputed);
}
+ SMESH_MesherHelper helper( theMesh );
+ helper.SetSubShape( tgtFace );
+
if ( !done )
{
// --------------------
// Prepare to mapping
// --------------------
- SMESH_MesherHelper helper( theMesh );
- helper.SetSubShape( tgtFace );
-
// Check if node projection to a face is needed
Bnd_B2d uvBox;
SMDS_ElemIteratorPtr faceIt = srcSubMesh->GetSubMeshDS()->GetElements();
}
}
// Fix orientation
- if ( SMESH_Algo::IsReversedSubMesh( face, meshDS ))
+ if ( helper.IsReversedSubMesh( face ))
{
SMESH_MeshEditor editor( tgtMesh );
SMDS_ElemIteratorPtr eIt = meshDS->MeshElements( face )->GetElements();
// cout << msg << " ("<< p.X() << "; " <<p.Y() << "; " <<p.Z() << ") " <<endl;\
// }
-typedef StdMeshers_ProjectionUtils TAssocTool;
+namespace TAssocTool = StdMeshers_ProjectionUtils;
//=======================================================================
SMESH_subMesh* srcSubMesh = srcMesh->GetSubMesh( _sourceHypo->GetSource3DShape() );
//SMESH_subMesh* tgtSubMesh = tgtMesh->GetSubMesh( aShape );
- if ( tgtMesh == srcMesh && !aShape.IsSame( _sourceHypo->GetSource3DShape() )) {
+ string srcMeshError;
+ if ( tgtMesh == srcMesh && !aShape.IsSame( _sourceHypo->GetSource3DShape() )) {
if ( !TAssocTool::MakeComputed( srcSubMesh ))
- return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+ srcMeshError = TAssocTool::SourceNotComputedError( srcSubMesh, this );
}
else {
if ( !srcSubMesh->IsMeshComputed() )
- return error(COMPERR_BAD_INPUT_MESH,"Source mesh not computed");
+ srcMeshError = TAssocTool::SourceNotComputedError();
}
// Find 2 pairs of corresponding vertices
{
bool isRev = false;
if ( helper.NbAncestors( aShapeFace, aMesh, aShape.ShapeType() ) > 1 )
- isRev = SMESH_Algo::IsReversedSubMesh( TopoDS::Face(aShapeFace), meshDS );
+ isRev = helper.IsReversedSubMesh( TopoDS::Face(aShapeFace) );
SMDS_ElemIteratorPtr iteratorElem = aSubMeshDSFace->GetElements();
while ( iteratorElem->more() ) // loop on elements on a geometrical face
#define RETURN_BAD_RESULT(msg) { MESSAGE(")-: Error: " << msg); return false; }
#define gpXYZ(n) gp_XYZ(n->X(),n->Y(),n->Z())
-typedef StdMeshers_ProjectionUtils TAssocTool;
+namespace TAssocTool = StdMeshers_ProjectionUtils;
//=======================================================================
//function : StdMeshers_RadialPrism_3D
{
_ignoreShapeIds.insert( faceInd );
ignoreFaces.push_back( exp.Current() );
- if ( SMESH_Algo::IsReversedSubMesh( TopoDS::Face( exp.Current() ), getMeshDS()))
+ if ( helper.IsReversedSubMesh( TopoDS::Face( exp.Current() )))
_sdVec[i]._reversedFaceIds.insert( faceInd );
}
}
{
if ( data._edges[i]->IsOnEdge() ) continue;
data._edges[i]->FindIntersection( *searcher, intersecDist, data._epsilon );
- if ( geomSize > intersecDist )
+ if ( geomSize > intersecDist && intersecDist > 0 )
geomSize = intersecDist;
}
if ( data._stepSize > 0.3 * geomSize )
reverse = ( helper.GetSubShapeOri( F, E ) == TopAbs_REVERSED );
if ( helper.GetSubShapeOri( data._solid, F ) == TopAbs_REVERSED )
reverse = !reverse, F.Reverse();
- if ( SMESH_Algo::IsReversedSubMesh( TopoDS::Face(F), getMeshDS() ))
+ if ( helper.IsReversedSubMesh( TopoDS::Face(F) ))
reverse = !reverse;
}
else
theMesh.GetSubMesh( theFace )->GetComputeError() = error;
else if ( !pm )
pm.reset( new SMESH_ProxyMesh( theMesh ));
- if ( getenv("ONLY_VL2D"))
+ if ( getenv("__ONLY__VL2D__"))
pm.reset();
}
else
normPar[ i - L._firstPntInd ] = ( points[i].normParam - normF ) / normDist;
// Create layers of faces
-
+
bool hasLeftNode = ( !L._leftLine->_rightNodes.empty() && leftEdgeShared );
bool hasRightNode = ( !L._rightLine->_leftNodes.empty() && rightEdgeShared );
bool hasOwnLeftNode = ( !L._leftNodes.empty() );
bool hasOwnRightNode = ( !L._rightNodes.empty() );
+ bool isClosedEdge = ( outerNodes.front() == outerNodes.back() );
size_t iS,
- iN0 = ( hasLeftNode || hasOwnLeftNode || _polyLineVec.size() == 1 ),
+ iN0 = ( hasLeftNode || hasOwnLeftNode || isClosedEdge ),
nbN = innerNodes.size() - ( hasRightNode || hasOwnRightNode );
L._leftNodes .reserve( _hyp->GetNumberLayers() );
L._rightNodes.reserve( _hyp->GetNumberLayers() );
else if ( hasLeftNode ) innerNodes.front() = L._leftLine->_rightNodes[ iF ];
if ( hasOwnRightNode ) innerNodes.back() = L._rightNodes[ iF ];
else if ( hasRightNode ) innerNodes.back() = L._rightLine->_leftNodes[ iF ];
- if ( _polyLineVec.size() == 1 ) innerNodes.front() = innerNodes.back(); // circle
+ if ( isClosedEdge ) innerNodes.front() = innerNodes.back(); // circle
if ( !hasOwnLeftNode ) L._leftNodes.push_back( innerNodes.front() );
if ( !hasOwnRightNode ) L._rightNodes.push_back( innerNodes.back() );