23250: [CEA 1766] 3D tab is empty when editing mesh

+ minor changes in docs

+ fix other problems with Mesh Dialog:
1) at mesh edition, old hypothesis remain assigned after playing with
   Mesh Type and Hypo Sets (change is in isSelectedHyp())
2) When a 3D algo is unset due to change of Mesh Type, its hypotheses remain
   assigned and a new hyp can be created
This commit is contained in:
eap 2016-03-03 15:42:23 +03:00
parent cc583a4ffa
commit 43f41f0c11
16 changed files with 138 additions and 95 deletions

View File

@ -1,4 +1,5 @@
# Aspect ratio # Aspect ratio
# This script demonstrates various usages of filters
# create mesh # create mesh
from SMESH_mechanic import * from SMESH_mechanic import *

View File

@ -1,23 +1,21 @@
# Free borders # Free borders
# create mesh # initialize SALOME and modules
import salome, SMESH
import salome
salome.salome_init() salome.salome_init()
import GEOM
from salome.geom import geomBuilder from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy) geompy = geomBuilder.New(salome.myStudy)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy) smesh = smeshBuilder.New(salome.myStudy)
# create mesh
face = geompy.MakeFaceHW(100, 100, 1) face = geompy.MakeFaceHW(100, 100, 1)
geompy.addToStudy( face, "quadrangle" ) geompy.addToStudy( face, "quadrangle" )
mesh = smesh.Mesh(face) mesh = smesh.Mesh(face)
mesh.Segment().NumberOfSegments(10) mesh.Segment().NumberOfSegments(10)
mesh.Triangle().MaxElementArea(25) mesh.Triangle().MaxElementArea(25)
mesh.Compute() mesh.Compute()
# get all free borders # get all free borders
filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_FreeBorders) filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_FreeBorders)
ids = mesh.GetIdsFromFilter(filter) ids = mesh.GetIdsFromFilter(filter)

View File

@ -1,23 +1,21 @@
# Free edges # Free edges
# create mesh # initialize SALOME and modules
import salome, SMESH
import salome
salome.salome_init() salome.salome_init()
import GEOM
from salome.geom import geomBuilder from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy) geompy = geomBuilder.New(salome.myStudy)
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy) smesh = smeshBuilder.New(salome.myStudy)
# create mesh
face = geompy.MakeFaceHW(100, 100, 1) face = geompy.MakeFaceHW(100, 100, 1)
geompy.addToStudy( face, "quadrangle" ) geompy.addToStudy( face, "quadrangle" )
mesh = smesh.Mesh(face) mesh = smesh.Mesh(face)
mesh.Segment().NumberOfSegments(10) mesh.Segment().NumberOfSegments(10)
mesh.Triangle().MaxElementArea(25) mesh.Triangle().MaxElementArea(25)
mesh.Compute() mesh.Compute()
# get all faces with free edges # get all faces with free edges
filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_FreeEdges) filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_FreeEdges)
ids = mesh.GetIdsFromFilter(filter) ids = mesh.GetIdsFromFilter(filter)

View File

@ -4,7 +4,7 @@
from SMESH_mechanic import * from SMESH_mechanic import *
# remove some faces to have faces with bare borders # remove some faces to have faces with bare borders
mesh.RemoveElements( mesh.GetElementsByType(SMESH.FACE)[0:5] ) mesh.RemoveElements( mesh.GetElementsByType(SMESH.FACE)[0:5] )
# get all faces bare borders # get all faces with bare borders
filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_BareBorderFace) filter = smesh.GetFilter(SMESH.FACE, SMESH.FT_BareBorderFace)
ids = mesh.GetIdsFromFilter(filter) ids = mesh.GetIdsFromFilter(filter)
print "Faces with bare borders:", ids print "Faces with bare borders:", ids

View File

@ -1,16 +1,12 @@
# Double nodes # Double nodes
import salome import salome
salome.salome_init() salome.salome_init()
import GEOM
from salome.geom import geomBuilder from salome.geom import geomBuilder
geompy = geomBuilder.New(salome.myStudy) geompy = geomBuilder.New(salome.myStudy)
import SMESH
import SMESH, SALOMEDS
from salome.smesh import smeshBuilder from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy) smesh = smeshBuilder.New(salome.myStudy)
import salome_notebook
# make a mesh on a box # make a mesh on a box
box = geompy.MakeBoxDXDYDZ(100,100,100) box = geompy.MakeBoxDXDYDZ(100,100,100)
@ -20,8 +16,8 @@ mesh.Quadrangle()
mesh.Hexahedron() mesh.Hexahedron()
mesh.Compute() mesh.Compute()
# copy all elements with translation # copy all elements with translation
mesh.TranslateObject( mesh, smesh.MakeDirStruct( 10,0,0), Copy=True ) mesh.TranslateObject( mesh, [10,0,0], Copy=True )
# create filters to find nodes equal within tolerance of 1e-5 # create a filter to find nodes equal within tolerance of 1e-5
filter = smesh.GetFilter(SMESH.NODE, SMESH.FT_EqualNodes, Tolerance=1e-5) filter = smesh.GetFilter(SMESH.NODE, SMESH.FT_EqualNodes, Tolerance=1e-5)
# get equal nodes # get equal nodes
print "Number of equal nodes:", len( mesh.GetIdsFromFilter( filter )) print "Number of equal nodes:", len( mesh.GetIdsFromFilter( filter ))

View File

@ -1,8 +1,25 @@
# Borders at multi-connection # Borders at multi-connection
# create mesh import salome
from SMESH_mechanic import * salome.salome_init()
# get border edges with number of connected faces = 5 from salome.geom import geomBuilder
filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_MultiConnection, 5) geompy = geomBuilder.New(salome.myStudy)
import SMESH
from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(salome.myStudy)
# make a mesh on a box
box = geompy.MakeBoxDXDYDZ(100,100,100)
mesh = smesh.Mesh( box, "Box" )
mesh.Segment().NumberOfSegments(10)
mesh.Quadrangle()
mesh.Hexahedron()
mesh.Compute()
# copy all elements with translation and merge nodes
mesh.TranslateObject( mesh, [10,0,0], Copy=True )
mesh.MergeNodes( mesh.FindCoincidentNodes( 1e-5 ))
# get mesh edges with number of connected elements (faces and volumes) == 3
filter = smesh.GetFilter(SMESH.EDGE, SMESH.FT_MultiConnection, 3)
ids = mesh.GetIdsFromFilter(filter) ids = mesh.GetIdsFromFilter(filter)
print "Number of border edges with 5 faces connected:", len(ids) print "Number of border edges with 3 faces connected:", len(ids)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

@ -4,11 +4,11 @@
\b Filters allow picking only the mesh elements satisfying to a \b Filters allow picking only the mesh elements satisfying to a
specific condition or a set of conditions. Filters can be used to create specific condition or a set of conditions. Filters can be used to create
or edit mesh groups, remove elements from the mesh object, control or edit mesh groups, remove elements from the mesh, control
mesh quality by different parameters, etc. mesh quality by different parameters, etc.
Several criteria can be combined together by using logical operators \a Several criteria can be combined together by using logical operators \a
AND and \a OR. In addition, applied filter criterion can be reverted AND and \a OR. In addition, a filter criterion can be reverted
using logical operator \a NOT. using logical operator \a NOT.
Some filtering criteria use the functionality of \ref quality_page "mesh quality controls" Some filtering criteria use the functionality of \ref quality_page "mesh quality controls"
@ -27,6 +27,8 @@ about selection filters and their usage in GUI.
entities (nodes or elements) for the operations, which require the entities (nodes or elements) for the operations, which require the
list of entities as input parameter (create/modify group, remove list of entities as input parameter (create/modify group, remove
nodes/elements, etc) and for the operations, which accept objects nodes/elements, etc) and for the operations, which accept objects
as input parameter. The page \ref tui_filters_page provides (groups, sub-meshes) as input parameter. The page \ref
examples of the filters usage in Python scripts. tui_filters_page provides examples of the filters usage in Python
scripts.
*/ */

View File

@ -100,7 +100,8 @@ The mesh can include the following entities:
Every mesh entity has an attribute associating it to a sub-shape it is Every mesh entity has an attribute associating it to a sub-shape it is
generated on (if any). The node generated on the geometrical edge or generated on (if any). The node generated on the geometrical edge or
surface in addition stores its position in parametric space of the surface in addition stores its position in parametric space of the
associated geometrical entity. associated geometrical entity. This attribute is set up by meshing
algorithms generating elements and nodes.
Mesh entities are identified by integer IDs starting from 1. Mesh entities are identified by integer IDs starting from 1.
Nodes and elements are counted separately, i.e. there can be a node Nodes and elements are counted separately, i.e. there can be a node

View File

@ -73,7 +73,9 @@ the filtering algorithm works faster because node-to-shape association
is used instead of measuring distance between nodes and the shape, and is used instead of measuring distance between nodes and the shape, and
\b Tolerance is not used. If the threshold shape is any other shape, \b Tolerance is not used. If the threshold shape is any other shape,
the algorithm works slower because distance between nodes and the the algorithm works slower because distance between nodes and the
shape is measured and is compared with \b Tolerance. shape is measured and is compared with \b Tolerance. The latter
approach (distance measurement) is also used if an element is not
associated to any shape.
</li><li> </li><li>
<b>Lying on Geom</b> selects entities whose at least one node <b>Lying on Geom</b> selects entities whose at least one node
lies on the shape defined by the <b>Threshold Value</b>. lies on the shape defined by the <b>Threshold Value</b>.
@ -82,7 +84,9 @@ the filtering algorithm works faster because node-to-shape association
is used instead of measuring distance between nodes and the shape, and is used instead of measuring distance between nodes and the shape, and
\b Tolerance is not used. If the threshold shape is any other shape, \b Tolerance is not used. If the threshold shape is any other shape,
the algorithm works slower because distance between nodes and the the algorithm works slower because distance between nodes and the
shape is measured and is compared with \b Tolerance. shape is measured and is compared with \b Tolerance. The latter
approach (distance measurement) is also used if an element is not
associated to any shape.
</li><li> </li><li>
<b>Belong to Mesh Group</b> selects entities included into the mesh group <b>Belong to Mesh Group</b> selects entities included into the mesh group
defined by the <b>Threshold Value</b>. defined by the <b>Threshold Value</b>.

View File

@ -6,7 +6,7 @@
Filters allow picking only the mesh elements satisfying to a Filters allow picking only the mesh elements satisfying to a
specific condition or a set of conditions. Filters can be used to create specific condition or a set of conditions. Filters can be used to create
or edit mesh groups, remove elements from the mesh object, control or edit mesh groups, remove elements from the mesh, control
mesh quality by different parameters, etc. mesh quality by different parameters, etc.
Several filtering criteria can be combined together by using logical Several filtering criteria can be combined together by using logical
@ -24,7 +24,7 @@ Python scripts.
\section filter_aspect_ratio Aspect ratio \section filter_aspect_ratio Aspect ratio
Filter 2D mesh elements (faces) according to the aspect ratio value: filters 2D mesh elements (faces) according to the aspect ratio value:
- element type should be \a SMESH.FACE - element type should be \a SMESH.FACE
- functor type should be \a SMESH.FT_AspectRatio - functor type should be \a SMESH.FT_AspectRatio
- threshold is floating point value (aspect ratio) - threshold is floating point value (aspect ratio)
@ -35,7 +35,7 @@ Filter 2D mesh elements (faces) according to the aspect ratio value:
\section filter_aspect_ratio_3d Aspect ratio 3D \section filter_aspect_ratio_3d Aspect ratio 3D
Filter 3D mesh elements (volumes) according to the aspect ratio value: filters 3D mesh elements (volumes) according to the aspect ratio value:
- element type is \a SMESH.VOLUME - element type is \a SMESH.VOLUME
- functor type is \a SMESH.FT_AspectRatio3D - functor type is \a SMESH.FT_AspectRatio3D
- threshold is floating point value (aspect ratio) - threshold is floating point value (aspect ratio)
@ -46,7 +46,7 @@ Filter 3D mesh elements (volumes) according to the aspect ratio value:
\section filter_warping_angle Warping angle \section filter_warping_angle Warping angle
Filter 2D mesh elements (faces) according to the warping angle value: filters 2D mesh elements (faces) according to the warping angle value:
- element type is \a SMESH.FACE - element type is \a SMESH.FACE
- functor type is \a SMESH.FT_Warping - functor type is \a SMESH.FT_Warping
- threshold is floating point value (warping angle) - threshold is floating point value (warping angle)
@ -57,7 +57,7 @@ Filter 2D mesh elements (faces) according to the warping angle value:
\section filter_minimum_angle Minimum angle \section filter_minimum_angle Minimum angle
Filter 2D mesh elements (faces) according to the minimum angle value: filters 2D mesh elements (faces) according to the minimum angle value:
- element type is \a SMESH.FACE - element type is \a SMESH.FACE
- functor type is \a SMESH.FT_MinimumAngle - functor type is \a SMESH.FT_MinimumAngle
- threshold is floating point value (minimum angle) - threshold is floating point value (minimum angle)
@ -68,7 +68,7 @@ Filter 2D mesh elements (faces) according to the minimum angle value:
\section filter_taper Taper \section filter_taper Taper
Filter 2D mesh elements (faces) according to the taper value: filters 2D mesh elements (faces) according to the taper value:
- element type is \a SMESH.FACE - element type is \a SMESH.FACE
- functor type is \a SMESH.FT_Taper - functor type is \a SMESH.FT_Taper
- threshold is floating point value (taper) - threshold is floating point value (taper)
@ -79,7 +79,7 @@ Filter 2D mesh elements (faces) according to the taper value:
\section filter_skew Skew \section filter_skew Skew
Filter 2D mesh elements (faces) according to the skew value: filters 2D mesh elements (faces) according to the skew value:
- element type is \a SMESH.FACE - element type is \a SMESH.FACE
- functor type is \a SMESH.FT_Skew - functor type is \a SMESH.FT_Skew
- threshold is floating point value (skew) - threshold is floating point value (skew)
@ -90,7 +90,7 @@ Filter 2D mesh elements (faces) according to the skew value:
\section filter_area Area \section filter_area Area
Filter 2D mesh elements (faces) according to the area value: filters 2D mesh elements (faces) according to the area value:
- element type is \a SMESH.FACE - element type is \a SMESH.FACE
- functor type is \a SMESH.FT_Area - functor type is \a SMESH.FT_Area
- threshold is floating point value (area) - threshold is floating point value (area)
@ -101,7 +101,7 @@ Filter 2D mesh elements (faces) according to the area value:
\section filter_volume Volume \section filter_volume Volume
Filter 3D mesh elements (volumes) according to the volume value: filters 3D mesh elements (volumes) according to the volume value:
- element type is \a SMESH.VOLUME - element type is \a SMESH.VOLUME
- functor type is \a SMESH.FT_Volume3D - functor type is \a SMESH.FT_Volume3D
- threshold is floating point value (volume) - threshold is floating point value (volume)
@ -112,7 +112,7 @@ Filter 3D mesh elements (volumes) according to the volume value:
\section filter_free_borders Free borders \section filter_free_borders Free borders
Filter 1D mesh elements (edges) which represent free borders of a mesh: filters 1D mesh elements (edges) which represent free borders of a mesh:
- element type is \a SMESH.EDGE - element type is \a SMESH.EDGE
- functor type is \a SMESH.FT_FreeBorders - functor type is \a SMESH.FT_FreeBorders
- threshold value is not required - threshold value is not required
@ -123,8 +123,8 @@ Filter 1D mesh elements (edges) which represent free borders of a mesh:
\section filter_free_edges Free edges \section filter_free_edges Free edges
Filter 2D mesh elements (faces) consisting of edges belonging to one filters 2D mesh elements (faces) having edges (i.e. links between
element of mesh only: nodes, not mesh segments) belonging to one face of mesh only:
- element type is \a SMESH.FACE - element type is \a SMESH.FACE
- functor type is \a SMESH.FT_FreeEdges - functor type is \a SMESH.FT_FreeEdges
- threshold value is not required - threshold value is not required
@ -135,7 +135,7 @@ element of mesh only:
\section filter_free_nodes Free nodes \section filter_free_nodes Free nodes
Filter free nodes: filters free nodes:
- element type is \a SMESH.NODE - element type is \a SMESH.NODE
- functor type is \a SMESH.FT_FreeNodes - functor type is \a SMESH.FT_FreeNodes
- threshold value is not required - threshold value is not required
@ -146,7 +146,7 @@ Filter free nodes:
\section filter_free_faces Free faces \section filter_free_faces Free faces
Filter free faces: filters free faces:
- element type is \a SMESH.FACE - element type is \a SMESH.FACE
- functor type is \a SMESH.FT_FreeFaces - functor type is \a SMESH.FT_FreeFaces
- threshold value is not required - threshold value is not required
@ -157,7 +157,7 @@ Filter free faces:
\section filter_bare_border_faces Bare border faces \section filter_bare_border_faces Bare border faces
Filter faces with bare borders: filters faces with bare borders:
- element type is \a SMESH.FACE - element type is \a SMESH.FACE
- functor type is \a SMESH.FT_BareBorderFace - functor type is \a SMESH.FT_BareBorderFace
- threshold value is not required - threshold value is not required
@ -168,7 +168,7 @@ Filter faces with bare borders:
\section filter_coplanar_faces Coplanar faces \section filter_coplanar_faces Coplanar faces
Filter faces with bare borders: filters coplanar faces:
- element type is \a SMESH.FACE - element type is \a SMESH.FACE
- functor type is \a SMESH.FT_CoplanarFaces - functor type is \a SMESH.FT_CoplanarFaces
- threshold value is the face ID - threshold value is the face ID
@ -178,7 +178,7 @@ Filter faces with bare borders:
\section filter_over_constrained_faces Over-constrained faces \section filter_over_constrained_faces Over-constrained faces
Filter over-constrained faces: filters over-constrained faces:
- element type is \a SMESH.FACE - element type is \a SMESH.FACE
- functor type is \a SMESH.FT_OverConstrainedFace - functor type is \a SMESH.FT_OverConstrainedFace
- threshold value is not required - threshold value is not required
@ -189,7 +189,7 @@ Filter over-constrained faces:
\section filter_double_elements Double edges, Double faces, Double volumes \section filter_double_elements Double edges, Double faces, Double volumes
filter mesh elements basing on the same set of nodes: filters mesh elements basing on the same set of nodes:
- element type is either \a SMESH.EGDE, \a SMESH.FACE or \a SMESH.VOLUME - element type is either \a SMESH.EGDE, \a SMESH.FACE or \a SMESH.VOLUME
- functor type is either \a SMESH.FT_EqualEdges, \a - functor type is either \a SMESH.FT_EqualEdges, \a
SMESH.FT_EqualFaces or \a SMESH.FT_EqualVolumes, SMESH.FT_EqualFaces or \a SMESH.FT_EqualVolumes,
@ -211,8 +211,8 @@ filters mesh nodes which are coincident with other nodes (within a given toleran
\section filter_borders_multiconnection Borders at multi-connection \section filter_borders_multiconnection Borders at multi-connection
Filter border 1D mesh elements (edges) according to the specified number of filters 1D mesh elements (segments) according to the specified number of
connections (faces belonging the border edges) connections (faces and volumes on whose border the segment lies):
- element type is \a SMESH.EDGE - element type is \a SMESH.EDGE
- functor type is \a SMESH.FT_MultiConnection - functor type is \a SMESH.FT_MultiConnection
- threshold is integer value (number of connections) - threshold is integer value (number of connections)
@ -223,8 +223,8 @@ connections (faces belonging the border edges)
\section filter_borders_multiconnection_2d Borders at multi-connection 2D \section filter_borders_multiconnection_2d Borders at multi-connection 2D
Filter 2D mesh elements (faces) which consist of edges belonging filters 2D mesh elements (faces) with the specified maximal number of
to the specified number of mesh elements faces connected to a border (link between nodes, not mesh segment):
- element type is \a SMESH.FACE - element type is \a SMESH.FACE
- functor type is \a SMESH.FT_MultiConnection2D - functor type is \a SMESH.FT_MultiConnection2D
- threshold is integer value (number of connections) - threshold is integer value (number of connections)
@ -235,7 +235,7 @@ to the specified number of mesh elements
\section filter_length Length \section filter_length Length
Filter 1D mesh elements (edges) according to the edge length value: filters 1D mesh elements (edges) according to the edge length value:
- element type should be \a SMESH.EDGE - element type should be \a SMESH.EDGE
- functor type should be \a SMESH.FT_Length - functor type should be \a SMESH.FT_Length
- threshold is floating point value (length) - threshold is floating point value (length)
@ -246,8 +246,8 @@ Filter 1D mesh elements (edges) according to the edge length value:
\section filter_length_2d Length 2D \section filter_length_2d Length 2D
Filter 2D mesh elements (faces) corresponding to the maximum length. filters 2D mesh elements (faces) according to the maximum length of its
value of its edges: edges (links between nodes):
- element type should be \a SMESH.FACE - element type should be \a SMESH.FACE
- functor type should be \a SMESH.FT_Length2D - functor type should be \a SMESH.FT_Length2D
- threshold is floating point value (edge length) - threshold is floating point value (edge length)
@ -258,11 +258,11 @@ value of its edges:
\section filter_max_element_length_2d Element Diameter 2D \section filter_max_element_length_2d Element Diameter 2D
Filter 2D mesh elements (faces) corresponding to the maximum length filters 2D mesh elements (faces) according to the maximum length
value of its edges and diagonals: of its edges and diagonals:
- element type should be \a SMESH.FACE - element type should be \a SMESH.FACE
- functor type should be \a SMESH.FT_MaxElementLength2D - functor type should be \a SMESH.FT_MaxElementLength2D
- threshold is floating point value (edge/diagonal length) - threshold is floating point value (length)
\tui_script{filters_ex22.py} \tui_script{filters_ex22.py}
@ -270,8 +270,8 @@ value of its edges and diagonals:
\section filter_max_element_length_3d Element Diameter 3D \section filter_max_element_length_3d Element Diameter 3D
Filter 3D mesh elements (volumes) corresponding to the maximum length filters 3D mesh elements (volumes) according to the maximum length
value of its edges and diagonals: of its edges and diagonals:
- element type should be \a SMESH.VOLUME - element type should be \a SMESH.VOLUME
- functor type should be \a SMESH.FT_MaxElementLength3D - functor type should be \a SMESH.FT_MaxElementLength3D
- threshold is floating point value (edge/diagonal length) - threshold is floating point value (edge/diagonal length)
@ -282,7 +282,8 @@ value of its edges and diagonals:
\section filter_bare_border_volumes Bare border volumes \section filter_bare_border_volumes Bare border volumes
Filter 3D mesh elements with bare borders: filters 3D mesh elements with bare borders, i.e. having a facet not
shared with other volumes and without a face on it:
- element type is \a SMESH.VOLUME - element type is \a SMESH.VOLUME
- functor type is \a SMESH.FT_BareBorderVolume - functor type is \a SMESH.FT_BareBorderVolume
- threshold value is not required - threshold value is not required
@ -293,7 +294,7 @@ Filter 3D mesh elements with bare borders:
\section filter_over_constrained_volumes Over-constrained volumes \section filter_over_constrained_volumes Over-constrained volumes
Filter over-constrained volumes: filters over-constrained volumes, whose all nodes are on the mesh boundary:
- element type is \a SMESH.VOLUME - element type is \a SMESH.VOLUME
- functor type is \a SMESH.FT_OverConstrainedVolume - functor type is \a SMESH.FT_OverConstrainedVolume
- threshold value is not required - threshold value is not required
@ -304,7 +305,7 @@ Filter over-constrained volumes:
\section filter_belong_to_group Belong to Mesh Group \section filter_belong_to_group Belong to Mesh Group
Filter mesh entities (nodes or elements) included in a mesh group filters mesh entities (nodes or elements) included in a mesh group
defined by threshold value: defined by threshold value:
- element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME - element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME
- functor type should be \a SMESH.FT_BelongToMeshGroup - functor type should be \a SMESH.FT_BelongToMeshGroup
@ -314,27 +315,31 @@ defined by threshold value:
\section filter_belong_to_geom Belong to Geom \section filter_belong_to_geom Belong to Geom
Filter mesh entities (nodes or elements) which all nodes lie on the filters mesh entities (nodes or elements) which all nodes lie on the
shape defined by threshold value: shape defined by threshold value:
- element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME - element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME
- functor type should be \a SMESH.FT_BelongToGeom - functor type should be \a SMESH.FT_BelongToGeom
- threshold is geometrical object - threshold is geometrical object
- tolerance is a distance between a node and the geometrical object;
it is used if an node is not associated to any geometry.
\tui_script{filters_ex26.py} \tui_script{filters_ex26.py}
\section filter_lying_on_geom Lying on Geom \section filter_lying_on_geom Lying on Geom
Filter mesh entities (nodes or elements) at least one node of which lies on the filters mesh entities (nodes or elements) at least one node of which lies on the
shape defined by threshold value: shape defined by threshold value:
- element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME - element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME
- functor type should be \a SMESH.FT_LyingOnGeom - functor type should be \a SMESH.FT_LyingOnGeom
- threshold is geometrical object - threshold is geometrical object
- tolerance is a distance between a node and the geometrical object;
it is used if an node is not associated to any geometry.
\tui_script{filters_ex27.py} \tui_script{filters_ex27.py}
\section filter_belong_to_plane Belong to Plane \section filter_belong_to_plane Belong to Plane
Filter mesh entities (nodes or elements) which all nodes belong to the filters mesh entities (nodes or elements) which all nodes belong to the
plane defined by threshold value with the given tolerance: plane defined by threshold value with the given tolerance:
- element type can be: \a SMESH.NODE, \a SMESH.EDGE, \a SMESH.FACE - element type can be: \a SMESH.NODE, \a SMESH.EDGE, \a SMESH.FACE
- functor type should be \a SMESH.FT_BelongToPlane - functor type should be \a SMESH.FT_BelongToPlane
@ -345,7 +350,7 @@ plane defined by threshold value with the given tolerance:
\section filter_belong_to_cylinder Belong to Cylinder \section filter_belong_to_cylinder Belong to Cylinder
Filter mesh entities (nodes or elements) which all nodes belong to the filters mesh entities (nodes or elements) which all nodes belong to the
cylindrical face defined by threshold value with the given tolerance: cylindrical face defined by threshold value with the given tolerance:
- element type can be: \a , \a SMESH.EDGE, \a SMESH.FACE - element type can be: \a , \a SMESH.EDGE, \a SMESH.FACE
- functor type should be \a SMESH.FT_BelongToCylinder - functor type should be \a SMESH.FT_BelongToCylinder
@ -356,7 +361,7 @@ cylindrical face defined by threshold value with the given tolerance:
\section filter_belong_to_surface Belong to Surface \section filter_belong_to_surface Belong to Surface
Filter mesh entities (nodes or elements) which all nodes belong to the filters mesh entities (nodes or elements) which all nodes belong to the
arbitrary surface defined by threshold value with the given tolerance: arbitrary surface defined by threshold value with the given tolerance:
- element type can be: \a SMESH.NODE, \a SMESH.EDGE, \a SMESH.FACE - element type can be: \a SMESH.NODE, \a SMESH.EDGE, \a SMESH.FACE
- functor type should be \a SMESH.FT_BelongToGenSurface - functor type should be \a SMESH.FT_BelongToGenSurface
@ -367,7 +372,7 @@ arbitrary surface defined by threshold value with the given tolerance:
\section filter_range_of_ids Range of IDs \section filter_range_of_ids Range of IDs
Filter mesh entities elements (nodes or elements) according to the filters mesh entities elements (nodes or elements) according to the
specified identifiers range: specified identifiers range:
- element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME - element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME
- functor type is \a SMESH.FT_RangeOfIds - functor type is \a SMESH.FT_RangeOfIds
@ -377,7 +382,7 @@ specified identifiers range:
\section filter_bad_oriented_volume Badly oriented volume \section filter_bad_oriented_volume Badly oriented volume
Filter 3D mesh elements (volumes), which are incorrectly oriented from filters 3D mesh elements (volumes), which are incorrectly oriented from
the point of view of MED convention. the point of view of MED convention.
- element type should be \a SMESH.VOLUME - element type should be \a SMESH.VOLUME
- functor type is \a SMESH.FT_BadOrientedVolume - functor type is \a SMESH.FT_BadOrientedVolume
@ -387,7 +392,7 @@ the point of view of MED convention.
\section filter_linear_or_quadratic Linear / quadratic \section filter_linear_or_quadratic Linear / quadratic
Filter linear / quadratic mesh elements: filters linear / quadratic mesh elements:
- element type should be any element type, e.g.: \a SMESH.EDGE, \a SMESH.FACE, \a SMESH.VOLUME - element type should be any element type, e.g.: \a SMESH.EDGE, \a SMESH.FACE, \a SMESH.VOLUME
- functor type is \a SMESH.FT_LinearOrQuadratic - functor type is \a SMESH.FT_LinearOrQuadratic
- threshold is not required - threshold is not required
@ -398,7 +403,7 @@ elements are selected, otherwise (by default) linear elements are selected
\section filter_group_color Group color \section filter_group_color Group color
Filter mesh entities, belonging to the group with the color defined by the threshold value. filters mesh entities, belonging to the group with the color defined by the threshold value.
- element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME - element type can be any entity type, from \a SMESH.NODE to \a SMESH.VOLUME
- functor type is \a SMESH.FT_GroupColor - functor type is \a SMESH.FT_GroupColor
- threshold should be of SALOMEDS.Color type - threshold should be of SALOMEDS.Color type
@ -407,7 +412,7 @@ Filter mesh entities, belonging to the group with the color defined by the thres
\section filter_geom_type Geometry type \section filter_geom_type Geometry type
Filter mesh elements by the geometric type defined with the threshold filters mesh elements by the geometric type defined with the threshold
value. The list of available geometric types depends on the element value. The list of available geometric types depends on the element
entity type. entity type.
- element type should be any element type, e.g.: \a SMESH.EDGE, \a SMESH.FACE, \a SMESH.VOLUME - element type should be any element type, e.g.: \a SMESH.EDGE, \a SMESH.FACE, \a SMESH.VOLUME

View File

@ -337,6 +337,8 @@ void SMESHGUI_MeshTab::setCurrentHyp( const int theId, const int theIndex )
} }
} }
else // more than one additional hyp assigned else // more than one additional hyp assigned
{
if ( theIndex > 0 )
{ {
// move a hyp from myHypCombo[ AddHyp ] to myAddHypList // move a hyp from myHypCombo[ AddHyp ] to myAddHypList
for ( int i = 1, nb = myHypCombo[ AddHyp ]->count(); i < nb; ++i ) for ( int i = 1, nb = myHypCombo[ AddHyp ]->count(); i < nb; ++i )
@ -350,6 +352,11 @@ void SMESHGUI_MeshTab::setCurrentHyp( const int theId, const int theIndex )
} }
} }
} }
else
{
myAddHypList->clear();
}
}
} }
//================================================================================ //================================================================================

View File

@ -2010,6 +2010,9 @@ int SMESHGUI_MeshOp::currentHyp( const int theDim, const int theHypType ) const
bool SMESHGUI_MeshOp::isSelectedHyp( int theDim, int theHypType, int theIndex) const bool SMESHGUI_MeshOp::isSelectedHyp( int theDim, int theHypType, int theIndex) const
{ {
if ( theIndex < 0 )
return false;
if ( theHypType < AddHyp ) // only one hyp can be selected if ( theHypType < AddHyp ) // only one hyp can be selected
return currentHyp( theDim, theHypType ) == theIndex; return currentHyp( theDim, theHypType ) == theIndex;
@ -2050,17 +2053,28 @@ bool SMESHGUI_MeshOp::isAccessibleDim( const int theDim ) const
* \param theDim - dimension of hypothesis or algorithm * \param theDim - dimension of hypothesis or algorithm
* \param theHypType - Type of hypothesis (Algo, MainHyp, AddHyp) * \param theHypType - Type of hypothesis (Algo, MainHyp, AddHyp)
* \param theIndex - Index of hypothesis * \param theIndex - Index of hypothesis
* \param updateHypsOnAlgoDeselection - to clear and disable hyps if algo deselected
* *
* Gets current hypothesis or algorithms * Gets current hypothesis or algorithms
*/ */
//================================================================================ //================================================================================
void SMESHGUI_MeshOp::setCurrentHyp( const int theDim, void SMESHGUI_MeshOp::setCurrentHyp( const int theDim,
const int theHypType, const int theHypType,
const int theIndex ) const int theIndex,
const bool updateHypsOnAlgoDeselection)
{ {
myIgnoreAlgoSelection = true; myIgnoreAlgoSelection = true;
myDlg->tab( theDim )->setCurrentHyp( theHypType, theIndex + 1 ); myDlg->tab( theDim )->setCurrentHyp( theHypType, theIndex + 1 );
myIgnoreAlgoSelection = false; myIgnoreAlgoSelection = false;
if ( updateHypsOnAlgoDeselection && theHypType == Algo && theIndex < 0 )
{
const QStringList noHyps;
myDlg->tab( theDim )->setAvailableHyps( MainHyp, noHyps );
myDlg->tab( theDim )->setExistingHyps ( MainHyp, noHyps );
myDlg->tab( theDim )->setAvailableHyps( AddHyp, noHyps );
myDlg->tab( theDim )->setExistingHyps ( AddHyp, noHyps );
}
} }
//================================================================================ //================================================================================
@ -2705,7 +2719,7 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI
} }
else else
for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ ) { for ( int i = SMESH::DIM_0D; i <= SMESH::DIM_3D; i++ ) {
if ( i > myMaxShapeDim || ( isReqDisBound && i != aReqDim ) ) myDlg->disableTab( i ); if ( i > myMaxShapeDim || ( isReqDisBound && i < aReqDim ) ) myDlg->disableTab( i );
else myDlg->enableTab( i ); else myDlg->enableTab( i );
} }
myDlg->setCurrentTab( theTabIndex ); myDlg->setCurrentTab( theTabIndex );
@ -2740,7 +2754,7 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI
//set new algorithm list and select the current algorithm //set new algorithm list and select the current algorithm
myDlg->tab( dim )->setAvailableHyps( Algo, anAvailableAlgs ); myDlg->tab( dim )->setAvailableHyps( Algo, anAvailableAlgs );
anCurrentCompareType = ( anCompareType == "HEXA" || anCompareType == "QUAD" ) ? "QUAD" : "TRIA"; anCurrentCompareType = ( anCompareType == "HEXA" || anCompareType == "QUAD" ) ? "QUAD" : "TRIA";
setCurrentHyp( dim, Algo, anCurrentAvailableAlgo ); setCurrentHyp( dim, Algo, anCurrentAvailableAlgo, /*updateHyps=*/true );
} }
for ( int i = myMaxShapeDim; i >= SMESH::DIM_0D; i-- ) { for ( int i = myMaxShapeDim; i >= SMESH::DIM_0D; i-- ) {
@ -2753,7 +2767,7 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI
for (int j = myMaxShapeDim; j >= SMESH::DIM_0D; j--) { for (int j = myMaxShapeDim; j >= SMESH::DIM_0D; j--) {
if ( currentHyp( j, Algo ) < 0 ) { if ( currentHyp( j, Algo ) < 0 ) {
myDlg->disableTab( j ); myDlg->disableTab( j );
setCurrentHyp( j , Algo, -1 ); setCurrentHyp( j , Algo, -1, /*updateHyps=*/true );
} }
} }
break; break;
@ -2763,8 +2777,8 @@ void SMESHGUI_MeshOp::setFilteredAlgoData( const int theTabIndex, const int theI
} }
} }
if ( aDim == SMESH::DIM_2D) { if ( aDim == SMESH::DIM_2D) {
setCurrentHyp( SMESH::DIM_3D, Algo, -1, /*updateHyps=*/true );
myDlg->disableTab( SMESH::DIM_3D ); myDlg->disableTab( SMESH::DIM_3D );
setCurrentHyp( SMESH::DIM_3D, Algo, -1);
} }
int currentTab = ( theTabIndex <= aDim ) ? theTabIndex : aDim; int currentTab = ( theTabIndex <= aDim ) ? theTabIndex : aDim;

View File

@ -128,7 +128,7 @@ private:
bool isSelectedHyp( int, int, int ) const; bool isSelectedHyp( int, int, int ) const;
int nbDlgHypTypes( const int ) const; int nbDlgHypTypes( const int ) const;
bool isAccessibleDim( const int ) const; bool isAccessibleDim( const int ) const;
void setCurrentHyp( const int, const int, const int ); void setCurrentHyp( const int, const int, const int, const bool=false);
void setDefaultName( const QString& prefix="" ) const; void setDefaultName( const QString& prefix="" ) const;
SMESH::SMESH_Hypothesis_var getAlgo( const int ); SMESH::SMESH_Hypothesis_var getAlgo( const int );
void readMesh(); void readMesh();

View File

@ -127,8 +127,8 @@ class SMeshStudyTools:
from salome.smesh import smeshBuilder from salome.smesh import smeshBuilder
smesh = smeshBuilder.New(self.editor.study) smesh = smeshBuilder.New(self.editor.study)
meshObject=smesh.IDToObject(entry) meshObject=salome.IDToObject(entry)
return meshObject return smesh.Mesh( meshObject )
## Returns the SMESH object associated to the specified \em SObject, ## Returns the SMESH object associated to the specified \em SObject,
# (the SObject is an item in the objects browser). # (the SObject is an item in the objects browser).

View File

@ -1970,7 +1970,7 @@ class Mesh:
# @param groupName the name of the mesh group # @param groupName the name of the mesh group
# @param elementType the type of elements in the group; either of # @param elementType the type of elements in the group; either of
# (SMESH.NODE, SMESH.EDGE, SMESH.FACE, SMESH.VOLUME). # (SMESH.NODE, SMESH.EDGE, SMESH.FACE, SMESH.VOLUME).
# @param elemIDs the list of ids # @param elemIDs either the list of ids, group, sub-mesh, or filter
# @return SMESH_Group # @return SMESH_Group
# @ingroup l2_grps_create # @ingroup l2_grps_create
def MakeGroupByIds(self, groupName, elementType, elemIDs): def MakeGroupByIds(self, groupName, elementType, elemIDs):