mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-28 14:05:38 +05:00
Merge changes from 'master' branch.
This commit is contained in:
commit
10191484fe
@ -31,7 +31,7 @@ ENDIF(WIN32)
|
|||||||
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
|
STRING(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UC)
|
||||||
|
|
||||||
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
|
SET(${PROJECT_NAME_UC}_MAJOR_VERSION 8)
|
||||||
SET(${PROJECT_NAME_UC}_MINOR_VERSION 3)
|
SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
|
||||||
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
|
SET(${PROJECT_NAME_UC}_PATCH_VERSION 0)
|
||||||
SET(${PROJECT_NAME_UC}_VERSION
|
SET(${PROJECT_NAME_UC}_VERSION
|
||||||
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
|
${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
|
||||||
@ -77,6 +77,11 @@ OPTION(SALOME_BUILD_DOC "Generate SALOME SMESH documentation" ON)
|
|||||||
OPTION(SALOME_BUILD_GUI "Enable GUI" ON)
|
OPTION(SALOME_BUILD_GUI "Enable GUI" ON)
|
||||||
OPTION(SALOME_SMESH_USE_CGNS "Enable import/export to CGNS format" OFF)
|
OPTION(SALOME_SMESH_USE_CGNS "Enable import/export to CGNS format" OFF)
|
||||||
OPTION(SALOME_SMESH_USE_TBB "Enable parallel computation" OFF)
|
OPTION(SALOME_SMESH_USE_TBB "Enable parallel computation" OFF)
|
||||||
|
OPTION(SALOME_SMESH_DYNLOAD_LOCAL "Load plug-ins' symbols locally (Linux only)" ON)
|
||||||
|
|
||||||
|
IF(SALOME_SMESH_DYNLOAD_LOCAL)
|
||||||
|
ADD_DEFINITIONS(-DDYNLOAD_LOCAL)
|
||||||
|
ENDIF(SALOME_SMESH_DYNLOAD_LOCAL)
|
||||||
|
|
||||||
#On Linux use Fortran to compile MEFISTO2D
|
#On Linux use Fortran to compile MEFISTO2D
|
||||||
IF(NOT WIN32)
|
IF(NOT WIN32)
|
||||||
@ -85,12 +90,12 @@ IF(NOT WIN32)
|
|||||||
ADD_DEFINITIONS(-DENABLE_MEFISTO)
|
ADD_DEFINITIONS(-DENABLE_MEFISTO)
|
||||||
ENDIF(NOT WIN32)
|
ENDIF(NOT WIN32)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_SMESH_USE_CGNS SALOME_SMESH_USE_TBB)
|
MARK_AS_ADVANCED(SALOME_BUILD_GUI SALOME_SMESH_USE_CGNS SALOME_SMESH_USE_TBB SALOME_SMESH_DYNLOAD_LOCAL)
|
||||||
|
|
||||||
# Prerequisites
|
# Prerequisites
|
||||||
# =============
|
# =============
|
||||||
# Find "big" prerequisites first - they reference themselves many others
|
# Find "big" prerequisites first - they reference themselves many others
|
||||||
# -> this can help finding the smaller prerequisites and detect conficts.
|
# -> this can help finding the smaller prerequisites and detect conflicts.
|
||||||
# In our case KERNEL has already loaded many prereq:
|
# In our case KERNEL has already loaded many prereq:
|
||||||
|
|
||||||
##
|
##
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
2004-01-05 16:14 Jerome Robert <jerome.robert@eads.net>
|
2004-01-05 16:14 Jerome Robert <jerome.robert@eads.net>
|
||||||
|
|
||||||
* adm_local/unix/config_files/check_Netgen.m4: Fix a mispelled
|
* adm_local/unix/config_files/check_Netgen.m4: Fix a misspelled
|
||||||
environment variable for idl python
|
environment variable for idl python
|
||||||
|
|
||||||
2004-01-05 14:28 tag V1_3_1
|
2004-01-05 14:28 tag V1_3_1
|
||||||
@ -59,7 +59,7 @@
|
|||||||
2004-01-05 09:05 Jerome Robert <jerome.robert@eads.net>
|
2004-01-05 09:05 Jerome Robert <jerome.robert@eads.net>
|
||||||
|
|
||||||
* src/: SMDS/SMDS_Mesh.cxx, SMESHDS/SMESHDS_Document.cxx: [Bug
|
* src/: SMDS/SMDS_Mesh.cxx, SMESHDS/SMESHDS_Document.cxx: [Bug
|
||||||
SMESH4830] bug in instal with gcc 2.95. Bug fixed. Note: SGI say
|
SMESH4830] bug in install with gcc 2.95. Bug fixed. Note: SGI say
|
||||||
that <algorithm> is requiered to use set_intersection (see
|
that <algorithm> is requiered to use set_intersection (see
|
||||||
http://www.sgi.com/tech/stl/set_intersection.html).
|
http://www.sgi.com/tech/stl/set_intersection.html).
|
||||||
|
|
||||||
@ -73,7 +73,7 @@
|
|||||||
2003-12-15 13:15 Nadir Bouhamou <nadir.bouhamou@cea.fr>
|
2003-12-15 13:15 Nadir Bouhamou <nadir.bouhamou@cea.fr>
|
||||||
|
|
||||||
* src/SMESHDS/SMESHDS_Script.cxx: correct a small bug found by the
|
* src/SMESHDS/SMESHDS_Script.cxx: correct a small bug found by the
|
||||||
EDF developpement team (PN and AT) : AddVolume in the case of a
|
EDF development team (PN and AT) : AddVolume in the case of a
|
||||||
Tetrahedron.
|
Tetrahedron.
|
||||||
|
|
||||||
2003-12-11 09:51 Jerome Robert <jerome.robert@eads.net>
|
2003-12-11 09:51 Jerome Robert <jerome.robert@eads.net>
|
||||||
@ -1194,7 +1194,7 @@
|
|||||||
|
|
||||||
* idl/Makefile.in, adm_local/unix/make_commence.in,
|
* idl/Makefile.in, adm_local/unix/make_commence.in,
|
||||||
adm_local/unix/make_omniorb.in, build_configure,
|
adm_local/unix/make_omniorb.in, build_configure,
|
||||||
configure.in.base: NRI : Update IDL Dependancies.
|
configure.in.base: NRI : Update IDL Dependencies.
|
||||||
|
|
||||||
2003-05-28 07:20 Nicolas Rejneri <nicolas.rejneri@opencascade.com>
|
2003-05-28 07:20 Nicolas Rejneri <nicolas.rejneri@opencascade.com>
|
||||||
|
|
||||||
|
2
README
2
README
@ -41,7 +41,7 @@ Installation
|
|||||||
Pre-requisites
|
Pre-requisites
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
SALOME platform relies on a set of third-party softwares; some of them are needed
|
SALOME platform relies on a set of third-party software; some of them are needed
|
||||||
at build time only, while other ones are needed in runtime also.
|
at build time only, while other ones are needed in runtime also.
|
||||||
|
|
||||||
For more information about the pre-requisites please visit SALOME platform web
|
For more information about the pre-requisites please visit SALOME platform web
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
# - Config file for the @PROJECT_NAME@ package
|
# - Config file for the @PROJECT_NAME@ package
|
||||||
# It defines the following variables.
|
# It defines the following variables.
|
||||||
# Specific to the pacakge @PROJECT_NAME@ itself:
|
# Specific to the package @PROJECT_NAME@ itself:
|
||||||
# @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file
|
# @PROJECT_NAME_UC@_ROOT_DIR_EXP - the root path of the installation providing this CMake file
|
||||||
#
|
#
|
||||||
|
|
||||||
|
42
doc/salome/examples/create_penta_biquad.py
Normal file
42
doc/salome/examples/create_penta_biquad.py
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import salome
|
||||||
|
|
||||||
|
salome.salome_init()
|
||||||
|
|
||||||
|
import SMESH, SALOMEDS
|
||||||
|
from salome.smesh import smeshBuilder
|
||||||
|
|
||||||
|
smesh = smeshBuilder.New()
|
||||||
|
unPentaBiQuad = smesh.Mesh()
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 0, 0, 0 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 10, 0, 0 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 0, 10, 0 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 0, 0, 10 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 10, 0, 10 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 0, 10, 10 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 5, 0, 0 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 7, 7, 0 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 0, 5, 0 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 5, 0, 10 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 7, 7, 10 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 0, 5, 10 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 0, 0, 5 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 10, 0, 5 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 0, 10, 5 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 5, -1, 5 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( 8, 8, 5 )
|
||||||
|
nodeID = unPentaBiQuad.AddNode( -1, 5, 5 )
|
||||||
|
volID = unPentaBiQuad.AddVolume( [ 4, 5, 6, 1, 2, 3, 10, 11, 12, 7, 8, 9, 13, 14, 15, 16, 17, 18 ] )
|
||||||
|
|
||||||
|
infos = unPentaBiQuad.GetMeshInfo()
|
||||||
|
print("Number of biquadratic pentahedrons:", infos[SMESH.Entity_BiQuad_Penta])
|
||||||
|
if (infos[SMESH.Entity_BiQuad_Penta] != 1):
|
||||||
|
raise RuntimeError("Bad number of biquadratic pentahedrons: should be 1")
|
||||||
|
|
||||||
|
## Set names of Mesh objects
|
||||||
|
smesh.SetName(unPentaBiQuad.GetMesh(), 'unPentaBiQuad')
|
||||||
|
|
||||||
|
if salome.sg.hasDesktop():
|
||||||
|
salome.sg.updateObjBrowser()
|
37
doc/salome/examples/ex_MakePolyLine.py
Normal file
37
doc/salome/examples/ex_MakePolyLine.py
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
import salome
|
||||||
|
salome.salome_init()
|
||||||
|
|
||||||
|
### create geometry
|
||||||
|
|
||||||
|
from salome.geom import geomBuilder
|
||||||
|
geompy = geomBuilder.New(salome.myStudy)
|
||||||
|
|
||||||
|
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||||
|
geompy.addToStudy( Box_1, 'Box_1' )
|
||||||
|
|
||||||
|
### create a mesh
|
||||||
|
|
||||||
|
import SMESH
|
||||||
|
from salome.smesh import smeshBuilder
|
||||||
|
smesh = smeshBuilder.New(salome.myStudy)
|
||||||
|
|
||||||
|
Mesh_1 = smesh.Mesh( Box_1 )
|
||||||
|
Mesh_1.Segment().NumberOfSegments(15)
|
||||||
|
Mesh_1.Triangle()
|
||||||
|
Mesh_1.Compute()
|
||||||
|
|
||||||
|
# define arguments for MakePolyLine
|
||||||
|
|
||||||
|
segments = []
|
||||||
|
# between nodes 20 and 1, default plane
|
||||||
|
segments.append( SMESH.PolySegment( 20, 0, 1, 0, smesh.MakeDirStruct(0,0,0) ))
|
||||||
|
# between nodes 1 and 100, default plane
|
||||||
|
segments.append( SMESH.PolySegment( 1, 0, 200, 0, smesh.MakeDirStruct(0,0,0) ))
|
||||||
|
# between nodes 200 and edge (578, 577), plane includes vector (1,1,1)
|
||||||
|
segments.append( SMESH.PolySegment( 200, 0, 578, 577, smesh.MakeDirStruct(1,1,1) ))
|
||||||
|
|
||||||
|
Mesh_1.MakePolyLine( segments, "1D group")
|
||||||
|
|
||||||
|
|
||||||
|
if salome.sg.hasDesktop():
|
||||||
|
salome.sg.updateObjBrowser()
|
54
doc/salome/examples/extrusion_penta_biquad.py
Normal file
54
doc/salome/examples/extrusion_penta_biquad.py
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import sys
|
||||||
|
import salome
|
||||||
|
|
||||||
|
salome.salome_init()
|
||||||
|
|
||||||
|
import GEOM
|
||||||
|
from salome.geom import geomBuilder
|
||||||
|
import math
|
||||||
|
import SALOMEDS
|
||||||
|
|
||||||
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
|
O = geompy.MakeVertex(0, 0, 0)
|
||||||
|
OX = geompy.MakeVectorDXDYDZ(1, 0, 0)
|
||||||
|
OY = geompy.MakeVectorDXDYDZ(0, 1, 0)
|
||||||
|
OZ = geompy.MakeVectorDXDYDZ(0, 0, 1)
|
||||||
|
Divided_Disk_1 = geompy.MakeDividedDisk(100, 1, GEOM.SQUARE)
|
||||||
|
geompy.addToStudy( O, 'O' )
|
||||||
|
geompy.addToStudy( OX, 'OX' )
|
||||||
|
geompy.addToStudy( OY, 'OY' )
|
||||||
|
geompy.addToStudy( OZ, 'OZ' )
|
||||||
|
geompy.addToStudy( Divided_Disk_1, 'Divided Disk_1' )
|
||||||
|
|
||||||
|
import SMESH, SALOMEDS
|
||||||
|
from salome.smesh import smeshBuilder
|
||||||
|
|
||||||
|
smesh = smeshBuilder.New()
|
||||||
|
aFilterManager = smesh.CreateFilterManager()
|
||||||
|
Mesh_1 = smesh.Mesh(Divided_Disk_1)
|
||||||
|
Regular_1D = Mesh_1.Segment()
|
||||||
|
Number_of_Segments_1 = Regular_1D.NumberOfSegments(6)
|
||||||
|
Quadrangle_2D = Mesh_1.Quadrangle(algo=smeshBuilder.QUADRANGLE)
|
||||||
|
isDone = Mesh_1.Compute()
|
||||||
|
aMaxElementLength2D0x5d7fdf0 = aFilterManager.CreateMaxElementLength2D()
|
||||||
|
isDone = Mesh_1.QuadToTriObject( Mesh_1, )
|
||||||
|
Mesh_1.ExtrusionSweepObjects( [ Mesh_1 ], [ Mesh_1 ], [ Mesh_1 ], [ 0, 0, 50 ], 3, 1 )
|
||||||
|
Mesh_1.ConvertToQuadratic(0, Mesh_1,True)
|
||||||
|
|
||||||
|
infos = Mesh_1.GetMeshInfo()
|
||||||
|
print("Number of biquadratic pentahedrons:", infos[SMESH.Entity_BiQuad_Penta])
|
||||||
|
if (infos[SMESH.Entity_BiQuad_Penta] != 1080):
|
||||||
|
raise RuntimeError("Bad number of biquadratic pentahedrons: should be 1080")
|
||||||
|
|
||||||
|
## Set names of Mesh objects
|
||||||
|
smesh.SetName(Regular_1D.GetAlgorithm(), 'Regular_1D')
|
||||||
|
smesh.SetName(Quadrangle_2D.GetAlgorithm(), 'Quadrangle_2D')
|
||||||
|
smesh.SetName(Number_of_Segments_1, 'Number of Segments_1')
|
||||||
|
smesh.SetName(Mesh_1.GetMesh(), 'Mesh_1')
|
||||||
|
|
||||||
|
|
||||||
|
if salome.sg.hasDesktop():
|
||||||
|
salome.sg.updateObjBrowser()
|
@ -28,22 +28,22 @@ critaria = [ \
|
|||||||
]
|
]
|
||||||
filt = smesh.GetFilterFromCriteria( critaria )
|
filt = smesh.GetFilterFromCriteria( critaria )
|
||||||
filtGroup = mesh.GroupOnFilter( SMESH.FACE, "group on filter", filt )
|
filtGroup = mesh.GroupOnFilter( SMESH.FACE, "group on filter", filt )
|
||||||
print("Group on filter contains %s elemens" % filtGroup.Size())
|
print("Group on filter contains %s elements" % filtGroup.Size())
|
||||||
|
|
||||||
# group on filter is updated if the mesh is modified
|
# group on filter is updated if the mesh is modified
|
||||||
hyp1D.SetStartLength( 2.5 )
|
hyp1D.SetStartLength( 2.5 )
|
||||||
hyp1D.SetEndLength( 2.5 )
|
hyp1D.SetEndLength( 2.5 )
|
||||||
mesh.Compute()
|
mesh.Compute()
|
||||||
print("After mesh change, group on filter contains %s elemens" % filtGroup.Size())
|
print("After mesh change, group on filter contains %s elements" % filtGroup.Size())
|
||||||
|
|
||||||
# set a new filter defining the group
|
# set a new filter defining the group
|
||||||
filt2 = smesh.GetFilter( SMESH.FACE, SMESH.FT_RangeOfIds, "1-50" )
|
filt2 = smesh.GetFilter( SMESH.FACE, SMESH.FT_RangeOfIds, "1-50" )
|
||||||
filtGroup.SetFilter( filt2 )
|
filtGroup.SetFilter( filt2 )
|
||||||
print("With a new filter, group on filter contains %s elemens" % filtGroup.Size())
|
print("With a new filter, group on filter contains %s elements" % filtGroup.Size())
|
||||||
|
|
||||||
# group is updated at modification of the filter
|
# group is updated at modification of the filter
|
||||||
filt2.SetCriteria( [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_RangeOfIds, "1-70" )])
|
filt2.SetCriteria( [ smesh.GetCriterion( SMESH.FACE, SMESH.FT_RangeOfIds, "1-70" )])
|
||||||
filtIDs3 = filtGroup.GetIDs()
|
filtIDs3 = filtGroup.GetIDs()
|
||||||
print("After filter modification, group on filter contains %s elemens" % filtGroup.Size())
|
print("After filter modification, group on filter contains %s elements" % filtGroup.Size())
|
||||||
|
|
||||||
salome.sg.updateObjBrowser()
|
salome.sg.updateObjBrowser()
|
||||||
|
45
doc/salome/examples/quality_controls_defl.py
Normal file
45
doc/salome/examples/quality_controls_defl.py
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
# Deflection 2D
|
||||||
|
|
||||||
|
|
||||||
|
import salome
|
||||||
|
salome.salome_init()
|
||||||
|
from salome.geom import geomBuilder
|
||||||
|
geompy = geomBuilder.New()
|
||||||
|
|
||||||
|
import SMESH
|
||||||
|
from salome.smesh import smeshBuilder
|
||||||
|
smesh = smeshBuilder.New()
|
||||||
|
|
||||||
|
# fuse a box and a sphere
|
||||||
|
Sphere_1 = geompy.MakeSphereR(100)
|
||||||
|
Box_1 = geompy.MakeBoxDXDYDZ(200, 200, 200)
|
||||||
|
Fuse = geompy.MakeFuse( Sphere_1, Box_1, theName="box + sphere" )
|
||||||
|
|
||||||
|
# create a mesh
|
||||||
|
mesh = smesh.Mesh( Fuse, "Deflection_2D")
|
||||||
|
algo = mesh.Segment()
|
||||||
|
algo.LocalLength(35)
|
||||||
|
algo = mesh.Triangle()
|
||||||
|
mesh.Compute()
|
||||||
|
|
||||||
|
# get min and max deflection
|
||||||
|
minMax = mesh.GetMinMax( SMESH.FT_Deflection2D )
|
||||||
|
print("min and max deflection: ", minMax)
|
||||||
|
|
||||||
|
# get deflection of a certain face
|
||||||
|
faceID = mesh.NbEdges() + mesh.NbFaces()
|
||||||
|
defl = mesh.FunctorValue( SMESH.FT_Deflection2D, faceID )
|
||||||
|
print("deflection of face %s = %s" % ( faceID, defl ))
|
||||||
|
|
||||||
|
margin = minMax[1] / 2
|
||||||
|
|
||||||
|
# get all faces with deflection LESS than the margin
|
||||||
|
aFilter = smesh.GetFilter(SMESH.FACE, SMESH.FT_Deflection2D, '<', margin, mesh=mesh)
|
||||||
|
anIds = aFilter.GetIDs()
|
||||||
|
print("%s faces have deflection less than %s" %( len(anIds), margin ))
|
||||||
|
|
||||||
|
# create a group of faces with deflection MORE than the margin
|
||||||
|
aGroup = mesh.MakeGroup("Deflection > " + repr(margin), SMESH.FACE, SMESH.FT_Deflection2D,'>',margin)
|
||||||
|
print("%s faces have deflection more than %s: %s ..." %( aGroup.Size(), margin, aGroup.GetIDs()[:10] ))
|
||||||
|
|
||||||
|
salome.sg.updateObjBrowser()
|
@ -46,6 +46,7 @@ SET(BAD_TESTS
|
|||||||
|
|
||||||
SET(GOOD_TESTS
|
SET(GOOD_TESTS
|
||||||
cartesian_algo.py
|
cartesian_algo.py
|
||||||
|
create_penta_biquad.py
|
||||||
creating_meshes_ex02.py
|
creating_meshes_ex02.py
|
||||||
creating_meshes_ex04.py
|
creating_meshes_ex04.py
|
||||||
creating_meshes_ex06.py
|
creating_meshes_ex06.py
|
||||||
@ -66,6 +67,7 @@ SET(GOOD_TESTS
|
|||||||
defining_hypotheses_ex15.py
|
defining_hypotheses_ex15.py
|
||||||
defining_hypotheses_ex16.py
|
defining_hypotheses_ex16.py
|
||||||
defining_hypotheses_adaptive1d.py
|
defining_hypotheses_adaptive1d.py
|
||||||
|
extrusion_penta_biquad.py
|
||||||
filters_ex01.py
|
filters_ex01.py
|
||||||
filters_ex03.py
|
filters_ex03.py
|
||||||
filters_ex04.py
|
filters_ex04.py
|
||||||
@ -154,6 +156,7 @@ SET(GOOD_TESTS
|
|||||||
quality_controls_ex17.py
|
quality_controls_ex17.py
|
||||||
quality_controls_ex18.py
|
quality_controls_ex18.py
|
||||||
quality_controls_ex19.py
|
quality_controls_ex19.py
|
||||||
|
quality_controls_defl.py
|
||||||
transforming_meshes_ex01.py
|
transforming_meshes_ex01.py
|
||||||
transforming_meshes_ex02.py
|
transforming_meshes_ex02.py
|
||||||
transforming_meshes_ex03.py
|
transforming_meshes_ex03.py
|
||||||
|
@ -41,6 +41,7 @@ WARNINGS = YES
|
|||||||
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/input $(GEOM_ROOT_DIR)/share/doc/salome/gui/GEOM/input
|
INPUT = @CMAKE_CURRENT_SOURCE_DIR@/input $(GEOM_ROOT_DIR)/share/doc/salome/gui/GEOM/input
|
||||||
FILE_PATTERNS = *.doc
|
FILE_PATTERNS = *.doc
|
||||||
EXCLUDE =
|
EXCLUDE =
|
||||||
|
EXCLUDE_PATTERNS = tui_*.doc
|
||||||
IMAGE_PATH = $(GEOM_ROOT_DIR)/share/doc/salome/gui/GEOM @CMAKE_CURRENT_SOURCE_DIR@/images
|
IMAGE_PATH = $(GEOM_ROOT_DIR)/share/doc/salome/gui/GEOM @CMAKE_CURRENT_SOURCE_DIR@/images
|
||||||
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/doc/salome/examples @CMAKE_SOURCE_DIR@/src/SMESH_SWIG
|
EXAMPLE_PATH = @CMAKE_SOURCE_DIR@/doc/salome/examples @CMAKE_SOURCE_DIR@/src/SMESH_SWIG
|
||||||
|
|
||||||
|
BIN
doc/salome/gui/SMESH/images/deflection_2d.png
Normal file
BIN
doc/salome/gui/SMESH/images/deflection_2d.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
@ -7,21 +7,22 @@ specific condition or a set of conditions. Filters can be used to create
|
|||||||
or edit mesh groups, remove elements from the mesh, 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 \ref filtering_criteria "filtering criteria" can be combined
|
||||||
AND and \a OR. In addition, a filter criterion can be reverted
|
together by using logical operators \a AND and \a OR. In addition, a
|
||||||
using logical operator \a NOT.
|
filter criterion can be reverted 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
|
||||||
to filter mesh nodes / elements by specific characteristic (Area, Length, etc).
|
"mesh quality controls" to filter mesh nodes / elements by specific
|
||||||
|
characteristic (Area, Length, etc).
|
||||||
|
|
||||||
The functinality of mesh filters is available in both GUI and TUI
|
The functinality of mesh filters is available in both GUI and TUI
|
||||||
modes:
|
modes:
|
||||||
|
|
||||||
- In GUI, filters are available in some dialog boxes via
|
- In GUI, filters are available in some dialog boxes via "Set Filters"
|
||||||
"Set Filters" button, clicking on which opens the dialog box
|
button, clicking on which opens the \ref filtering_elements "dialog box"
|
||||||
allowing to specify the list of filter criteria to be applied to the
|
allowing to specify the list of filter criteria to be applied to the
|
||||||
current selection. See \subpage selection_filter_library_page page to learn more
|
current selection. See \subpage selection_filter_library_page page to
|
||||||
about selection filters and their usage in GUI.
|
learn more about selection filters and their usage in GUI.
|
||||||
|
|
||||||
- In Python scripts, filters can be used to choose only some mesh
|
- In Python scripts, filters can be used to choose only some mesh
|
||||||
entities (nodes or elements) for the operations, which require the
|
entities (nodes or elements) for the operations, which require the
|
||||||
|
@ -37,6 +37,7 @@ Face quality controls:
|
|||||||
<li>\subpage bare_border_faces_page "Bare border faces"</li>
|
<li>\subpage bare_border_faces_page "Bare border faces"</li>
|
||||||
<li>\subpage over_constrained_faces_page "Over-constrained faces"</li>
|
<li>\subpage over_constrained_faces_page "Over-constrained faces"</li>
|
||||||
<li>\subpage length_2d_page "Length 2D"</li>
|
<li>\subpage length_2d_page "Length 2D"</li>
|
||||||
|
<li>\subpage deflection_2d_page "Deflection 2D"</li>
|
||||||
<li>\subpage borders_at_multi_connection_2d_page "Borders at multi-connection 2D"</li>
|
<li>\subpage borders_at_multi_connection_2d_page "Borders at multi-connection 2D"</li>
|
||||||
<li>\subpage area_page "Area"</li>
|
<li>\subpage area_page "Area"</li>
|
||||||
<li>\subpage taper_page "Taper"</li>
|
<li>\subpage taper_page "Taper"</li>
|
||||||
|
25
doc/salome/gui/SMESH/input/deflection_2d.doc
Normal file
25
doc/salome/gui/SMESH/input/deflection_2d.doc
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*!
|
||||||
|
|
||||||
|
\page deflection_2d_page Deflection 2D
|
||||||
|
|
||||||
|
\n This quality control criterion consists of calculation of distance
|
||||||
|
between a mesh face gravity corner and the surface the face discretizes.
|
||||||
|
|
||||||
|
<em>To apply the Deflection 2D quality criterion to your mesh:</em>
|
||||||
|
<ol>
|
||||||
|
<li>Display your mesh in the viewer. </li>
|
||||||
|
|
||||||
|
<li>Choose <b>Controls > Face Controls > Deflection 2D</b> or click
|
||||||
|
<em>"Deflection 2D"</em> button in the toolbar.
|
||||||
|
|
||||||
|
Your mesh will be displayed in the viewer with faces colored according
|
||||||
|
to the applied mesh quality control criterion:
|
||||||
|
|
||||||
|
\image html deflection_2d.png
|
||||||
|
</li>
|
||||||
|
</ol>
|
||||||
|
|
||||||
|
<br><b>See Also</b> a sample TUI Script of a
|
||||||
|
\ref tui_deflection_2d "Deflection 2D quality control" operation.
|
||||||
|
|
||||||
|
*/
|
@ -2,6 +2,10 @@
|
|||||||
|
|
||||||
\page selection_filter_library_page Selection filter library
|
\page selection_filter_library_page Selection filter library
|
||||||
|
|
||||||
|
\tableofcontents
|
||||||
|
|
||||||
|
\section selection_filter_library Filter library
|
||||||
|
|
||||||
\n Selection filter library allows creating and storing in files
|
\n Selection filter library allows creating and storing in files
|
||||||
the filters that can be later reused for operations on meshes. You can
|
the filters that can be later reused for operations on meshes. You can
|
||||||
access it from the Main Menu via <b>Tools / Selection filter library</b>.
|
access it from the Main Menu via <b>Tools / Selection filter library</b>.
|
||||||
@ -18,8 +22,7 @@ the current study. You can \b Add or \b Delete filters.
|
|||||||
\n In <b>Filter name</b> box you can specify the name for your
|
\n In <b>Filter name</b> box you can specify the name for your
|
||||||
filter. By default it is prefixed with the corresponding entity type.
|
filter. By default it is prefixed with the corresponding entity type.
|
||||||
|
|
||||||
\anchor filtering_elements
|
\section filtering_elements Filter Dialog
|
||||||
<h2>Filter Dialog</h2>
|
|
||||||
|
|
||||||
When we use filters during group creation or another operation (by
|
When we use filters during group creation or another operation (by
|
||||||
clicking <b>Set Filter</b> button in the corresponding dialog), the
|
clicking <b>Set Filter</b> button in the corresponding dialog), the
|
||||||
@ -64,6 +67,8 @@ in the Library.
|
|||||||
is no selected mesh in the Object Browser and the filter can not be
|
is no selected mesh in the Object Browser and the filter can not be
|
||||||
created. You have to select the mesh and the button will be enabled.
|
created. You have to select the mesh and the button will be enabled.
|
||||||
|
|
||||||
|
\section filtering_criteria Filtering Criteria
|
||||||
|
|
||||||
Some criteria are applicable to all <b>Entity types</b>:
|
Some criteria are applicable to all <b>Entity types</b>:
|
||||||
<ul><li>
|
<ul><li>
|
||||||
<b>Belong to Geom</b> selects entities whose all nodes lie on the
|
<b>Belong to Geom</b> selects entities whose all nodes lie on the
|
||||||
@ -231,6 +236,10 @@ normal to the neighboring face and the normal to the selected face is less then
|
|||||||
angular tolerance (defined in degrees). Selection continues among all neighbor faces of already
|
angular tolerance (defined in degrees). Selection continues among all neighbor faces of already
|
||||||
selected ones.<br>
|
selected ones.<br>
|
||||||
</li><li>
|
</li><li>
|
||||||
|
<b>Deflection 2D</b> selects 2D mesh elements having distance between their gravity
|
||||||
|
centers and underlying surfaces, which is more, less or equal (within a given <b>Tolerance</b>) to the predefined <b>Threshold Value</b>. See also a
|
||||||
|
\ref deflection_2d_page "Deflection 2D quality control".
|
||||||
|
</li><li>
|
||||||
<b>Element Diameter 2D</b> selects triangles and quadrangles composed of the edges and
|
<b>Element Diameter 2D</b> selects triangles and quadrangles composed of the edges and
|
||||||
diagonals with a value of length, which is more, less or equal
|
diagonals with a value of length, which is more, less or equal
|
||||||
(within a given <b>Tolerance</b>) to the predefined <b>Threshold Value</b>. See also a
|
(within a given <b>Tolerance</b>) to the predefined <b>Threshold Value</b>. See also a
|
||||||
|
@ -31,7 +31,7 @@ smesh = smeshBuilder.New()
|
|||||||
|
|
||||||
|
|
||||||
<b> Of course, <em>from smesh import *</em> is no more possible.</b>
|
<b> Of course, <em>from smesh import *</em> is no more possible.</b>
|
||||||
\n You have to explicitely write <em>smesh.some_method()</em>.
|
\n You have to explicitly write <em>smesh.some_method()</em>.
|
||||||
|
|
||||||
<b>All algorithms have been transferred from the namespace <em>smesh</em> to the namespace <em>smeshBuilder</em>.</b>
|
<b>All algorithms have been transferred from the namespace <em>smesh</em> to the namespace <em>smeshBuilder</em>.</b>
|
||||||
\n For instance:
|
\n For instance:
|
||||||
@ -79,7 +79,7 @@ is replaced by:
|
|||||||
Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
|
Compound1 = smesh.Concatenate([Mesh_inf.GetMesh(), Mesh_sup.GetMesh()], 0, 1, 1e-05)
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
<b>If you need to import a %SMESH Plugin explicitely, keep in mind that they are now located in separate namespaces.</b>
|
<b>If you need to import a %SMESH Plugin explicitly, keep in mind that they are now located in separate namespaces.</b>
|
||||||
\n For instance:
|
\n For instance:
|
||||||
\code
|
\code
|
||||||
import StdMeshers
|
import StdMeshers
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
\section tui_length_2d Length 2D
|
\section tui_length_2d Length 2D
|
||||||
\tui_script{quality_controls_ex11.py}
|
\tui_script{quality_controls_ex11.py}
|
||||||
|
|
||||||
|
\section tui_deflection_2d Deflection 2D
|
||||||
|
\tui_script{quality_controls_defl.py}
|
||||||
|
|
||||||
\section tui_borders_at_multiconnection_2d Borders at Multiconnection 2D
|
\section tui_borders_at_multiconnection_2d Borders at Multiconnection 2D
|
||||||
\tui_script{quality_controls_ex12.py}
|
\tui_script{quality_controls_ex12.py}
|
||||||
|
|
||||||
|
@ -61,6 +61,7 @@ module SMESH
|
|||||||
FT_MultiConnection2D,
|
FT_MultiConnection2D,
|
||||||
FT_Length,
|
FT_Length,
|
||||||
FT_Length2D,
|
FT_Length2D,
|
||||||
|
FT_Deflection2D,
|
||||||
FT_NodeConnectivityNumber,
|
FT_NodeConnectivityNumber,
|
||||||
FT_BelongToMeshGroup,
|
FT_BelongToMeshGroup,
|
||||||
FT_BelongToGeom,
|
FT_BelongToGeom,
|
||||||
@ -150,6 +151,7 @@ module SMESH
|
|||||||
typedef sequence<Value> Values;
|
typedef sequence<Value> Values;
|
||||||
Values GetValues();
|
Values GetValues();
|
||||||
};
|
};
|
||||||
|
interface Deflection2D : NumericalFunctor{};
|
||||||
interface MultiConnection : NumericalFunctor{};
|
interface MultiConnection : NumericalFunctor{};
|
||||||
interface MultiConnection2D : NumericalFunctor
|
interface MultiConnection2D : NumericalFunctor
|
||||||
{
|
{
|
||||||
@ -585,6 +587,7 @@ module SMESH
|
|||||||
MaxElementLength3D CreateMaxElementLength3D();
|
MaxElementLength3D CreateMaxElementLength3D();
|
||||||
Length CreateLength();
|
Length CreateLength();
|
||||||
Length2D CreateLength2D();
|
Length2D CreateLength2D();
|
||||||
|
Deflection2D CreateDeflection2D();
|
||||||
MultiConnection CreateMultiConnection();
|
MultiConnection CreateMultiConnection();
|
||||||
MultiConnection2D CreateMultiConnection2D();
|
MultiConnection2D CreateMultiConnection2D();
|
||||||
BallDiameter CreateBallDiameter();
|
BallDiameter CreateBallDiameter();
|
||||||
|
@ -154,7 +154,7 @@ module SMESH
|
|||||||
boolean IsEnablePublish();
|
boolean IsEnablePublish();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Create a hypothesis that can be shared by differents parts of the mesh.
|
* Create a hypothesis that can be shared by different parts of the mesh.
|
||||||
* An hypothesis is either:
|
* An hypothesis is either:
|
||||||
* - a method used to generate or modify a part of the mesh (algorithm).
|
* - a method used to generate or modify a part of the mesh (algorithm).
|
||||||
* - a parameter or a law used by an algorithm.
|
* - a parameter or a law used by an algorithm.
|
||||||
|
@ -191,6 +191,7 @@ module SMESH
|
|||||||
Entity_TriQuad_Hexa,
|
Entity_TriQuad_Hexa,
|
||||||
Entity_Penta,
|
Entity_Penta,
|
||||||
Entity_Quad_Penta,
|
Entity_Quad_Penta,
|
||||||
|
Entity_BiQuad_Penta,
|
||||||
Entity_Hexagonal_Prism,
|
Entity_Hexagonal_Prism,
|
||||||
Entity_Polyhedra,
|
Entity_Polyhedra,
|
||||||
Entity_Quad_Polyhedra,
|
Entity_Quad_Polyhedra,
|
||||||
@ -541,7 +542,7 @@ module SMESH
|
|||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Remove an hypothesis previouly added with AddHypothesis.
|
* Remove an hypothesis previously added with AddHypothesis.
|
||||||
*/
|
*/
|
||||||
Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
|
Hypothesis_Status RemoveHypothesis(in GEOM::GEOM_Object aSubObject,
|
||||||
in SMESH_Hypothesis anHyp)
|
in SMESH_Hypothesis anHyp)
|
||||||
@ -675,7 +676,8 @@ module SMESH
|
|||||||
in boolean isascii ) raises (SALOME::SALOME_Exception);
|
in boolean isascii ) raises (SALOME::SALOME_Exception);
|
||||||
void ExportCGNS( in SMESH_IDSource meshPart,
|
void ExportCGNS( in SMESH_IDSource meshPart,
|
||||||
in string file,
|
in string file,
|
||||||
in boolean overwrite ) raises (SALOME::SALOME_Exception);
|
in boolean overwrite,
|
||||||
|
in boolean groupElemsByType) raises (SALOME::SALOME_Exception);
|
||||||
void ExportGMF( in SMESH_IDSource meshPart,
|
void ExportGMF( in SMESH_IDSource meshPart,
|
||||||
in string file,
|
in string file,
|
||||||
in boolean withRequiredGroups) raises (SALOME::SALOME_Exception);
|
in boolean withRequiredGroups) raises (SALOME::SALOME_Exception);
|
||||||
@ -692,7 +694,7 @@ module SMESH
|
|||||||
double GetComputeProgress();
|
double GetComputeProgress();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* Get informations about mesh contents
|
* Get information about mesh contents
|
||||||
*/
|
*/
|
||||||
long NbNodes()
|
long NbNodes()
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
@ -57,6 +57,24 @@ module SMESH
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// structure used in MakePolyLine() to define a cutting plane
|
||||||
|
struct PolySegment
|
||||||
|
{
|
||||||
|
// point 1: if node1ID2 > 0, then the point is in the middle of a face edge defined
|
||||||
|
// by two nodes, else it is at node1ID1
|
||||||
|
long node1ID1;
|
||||||
|
long node1ID2;
|
||||||
|
|
||||||
|
// point 2: if node2ID2 > 0, then the point is in the middle of a face edge defined
|
||||||
|
// by two nodes, else it is at node2ID1
|
||||||
|
long node2ID1;
|
||||||
|
long node2ID2;
|
||||||
|
|
||||||
|
DirStruct vector; // vector on the plane; to use a default plane set vector = (0,0,0)
|
||||||
|
};
|
||||||
|
typedef sequence<PolySegment> ListOfPolySegments;
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* This interface makes modifications on the Mesh - removing elements and nodes etc.
|
* This interface makes modifications on the Mesh - removing elements and nodes etc.
|
||||||
*/
|
*/
|
||||||
@ -751,7 +769,31 @@ module SMESH
|
|||||||
* Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
|
* Return point state in a closed 2D mesh in terms of TopAbs_State enumeration.
|
||||||
* TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
|
* TopAbs_UNKNOWN state means that either mesh is wrong or the analysis fails.
|
||||||
*/
|
*/
|
||||||
short GetPointState(in double x, in double y, in double z)
|
short GetPointState(in double x, in double y, in double z)
|
||||||
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Check if a 2D mesh is manifold
|
||||||
|
*/
|
||||||
|
boolean IsManifold()
|
||||||
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Check if orientation of 2D elements is coherent
|
||||||
|
*/
|
||||||
|
boolean IsCoherentOrientation2D()
|
||||||
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Returns all or only closed FreeBorder's.
|
||||||
|
*/
|
||||||
|
ListOfFreeBorders FindFreeBorders(in boolean closedOnly)
|
||||||
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* Fill with 2D elements a hole defined by a FreeBorder.
|
||||||
|
*/
|
||||||
|
void FillHole(in FreeBorder hole)
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
@ -1184,7 +1226,28 @@ module SMESH
|
|||||||
in GEOM::GEOM_Object theShape,
|
in GEOM::GEOM_Object theShape,
|
||||||
in string groupName,
|
in string groupName,
|
||||||
in double_array theNodesCoords,
|
in double_array theNodesCoords,
|
||||||
out array_of_long_array GroupsOfNodes)
|
out array_of_long_array GroupsOfNodes)
|
||||||
|
raises (SALOME::SALOME_Exception);
|
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Create a polyline consisting of 1D mesh elements each lying on a 2D element of
|
||||||
|
* the initial mesh. Positions of new nodes are found by cutting the mesh by the
|
||||||
|
* plane passing through pairs of points specified by each PolySegment structure.
|
||||||
|
* If there are several paths connecting a pair of points, the shortest path is
|
||||||
|
* selected by the module. Position of the cutting plane is defined by the two
|
||||||
|
* points and an optional vector lying on the plane specified by a PolySegment.
|
||||||
|
* By default the vector is defined by Mesh module as following. A middle point
|
||||||
|
* of the two given points is computed. The middle point is projected to the mesh.
|
||||||
|
* The vector goes from the middle point to the projection point. In case of planar
|
||||||
|
* mesh, the vector is normal to the mesh.
|
||||||
|
* \param [inout] segments - PolySegment's defining positions of cutting planes.
|
||||||
|
* Return the used vector which goes from the middle point to its projection.
|
||||||
|
* \param [in] groupName - optional name of a group where created mesh segments will
|
||||||
|
* be added.
|
||||||
|
*/
|
||||||
|
void MakePolyLine(inout ListOfPolySegments segments,
|
||||||
|
in string groupName)
|
||||||
raises (SALOME::SALOME_Exception);
|
raises (SALOME::SALOME_Exception);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -228,6 +228,7 @@ SET(SMESH_RESOURCES_FILES
|
|||||||
mesh_quality.png
|
mesh_quality.png
|
||||||
mesh_show.png
|
mesh_show.png
|
||||||
mesh_hide.png
|
mesh_hide.png
|
||||||
|
mesh_deflection.png
|
||||||
)
|
)
|
||||||
|
|
||||||
INSTALL(FILES ${SMESH_RESOURCES_FILES} DESTINATION ${SALOME_SMESH_INSTALL_RES_DATA})
|
INSTALL(FILES ${SMESH_RESOURCES_FILES} DESTINATION ${SALOME_SMESH_INSTALL_RES_DATA})
|
||||||
|
BIN
resources/mesh_deflection.png
Normal file
BIN
resources/mesh_deflection.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 827 B |
@ -23,6 +23,7 @@
|
|||||||
#include "SMESH_ControlsDef.hxx"
|
#include "SMESH_ControlsDef.hxx"
|
||||||
|
|
||||||
#include "SMDS_BallElement.hxx"
|
#include "SMDS_BallElement.hxx"
|
||||||
|
#include "SMDS_FacePosition.hxx"
|
||||||
#include "SMDS_Iterator.hxx"
|
#include "SMDS_Iterator.hxx"
|
||||||
#include "SMDS_Mesh.hxx"
|
#include "SMDS_Mesh.hxx"
|
||||||
#include "SMDS_MeshElement.hxx"
|
#include "SMDS_MeshElement.hxx"
|
||||||
@ -41,13 +42,16 @@
|
|||||||
#include <BRepAdaptor_Surface.hxx>
|
#include <BRepAdaptor_Surface.hxx>
|
||||||
#include <BRepBndLib.hxx>
|
#include <BRepBndLib.hxx>
|
||||||
#include <BRepBuilderAPI_Copy.hxx>
|
#include <BRepBuilderAPI_Copy.hxx>
|
||||||
|
#include <BRepClass3d_SolidClassifier.hxx>
|
||||||
#include <BRepClass_FaceClassifier.hxx>
|
#include <BRepClass_FaceClassifier.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
|
#include <GeomLib_IsPlanarSurface.hxx>
|
||||||
#include <Geom_CylindricalSurface.hxx>
|
#include <Geom_CylindricalSurface.hxx>
|
||||||
#include <Geom_Plane.hxx>
|
#include <Geom_Plane.hxx>
|
||||||
#include <Geom_Surface.hxx>
|
#include <Geom_Surface.hxx>
|
||||||
#include <NCollection_Map.hxx>
|
#include <NCollection_Map.hxx>
|
||||||
#include <Precision.hxx>
|
#include <Precision.hxx>
|
||||||
|
#include <ShapeAnalysis_Surface.hxx>
|
||||||
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
#include <TColStd_MapIteratorOfMapOfInteger.hxx>
|
||||||
#include <TColStd_MapOfInteger.hxx>
|
#include <TColStd_MapOfInteger.hxx>
|
||||||
#include <TColStd_SequenceOfAsciiString.hxx>
|
#include <TColStd_SequenceOfAsciiString.hxx>
|
||||||
@ -95,6 +99,15 @@ namespace {
|
|||||||
v2.Magnitude() < gp::Resolution() ? 0 : v1.Angle( v2 );
|
v2.Magnitude() < gp::Resolution() ? 0 : v1.Angle( v2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline double getCos2( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
|
||||||
|
{
|
||||||
|
gp_Vec v1( P1 - P2 ), v2( P3 - P2 );
|
||||||
|
double dot = v1 * v2, len1 = v1.SquareMagnitude(), len2 = v2.SquareMagnitude();
|
||||||
|
|
||||||
|
return ( dot < 0 || len1 < gp::Resolution() || len2 < gp::Resolution() ? -1 :
|
||||||
|
dot * dot / len1 / len2 );
|
||||||
|
}
|
||||||
|
|
||||||
inline double getArea( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
|
inline double getArea( const gp_XYZ& P1, const gp_XYZ& P2, const gp_XYZ& P3 )
|
||||||
{
|
{
|
||||||
gp_Vec aVec1( P2 - P1 );
|
gp_Vec aVec1( P2 - P1 );
|
||||||
@ -261,13 +274,10 @@ bool NumericalFunctor::GetPoints(const SMDS_MeshElement* anElem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( anIter ) {
|
if ( anIter ) {
|
||||||
double xyz[3];
|
SMESH_NodeXYZ p;
|
||||||
while( anIter->more() ) {
|
while( anIter->more() ) {
|
||||||
if ( const SMDS_MeshNode* aNode = static_cast<const SMDS_MeshNode*>( anIter->next() ))
|
if ( p.Set( anIter->next() ))
|
||||||
{
|
theRes.push_back( p );
|
||||||
aNode->GetXYZ( xyz );
|
|
||||||
theRes.push_back( gp_XYZ( xyz[0], xyz[1], xyz[2] ));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -616,7 +626,8 @@ double MaxElementLength3D::GetValue( long theElementId )
|
|||||||
aVal = Max(aVal,Max(L7,L8));
|
aVal = Max(aVal,Max(L7,L8));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SMDSEntity_Quad_Penta: { // quadratic pentas
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta: { // quadratic pentas
|
||||||
double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 ));
|
double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 ));
|
||||||
double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 ));
|
double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 ));
|
||||||
double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
|
double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
|
||||||
@ -712,21 +723,25 @@ SMDSAbs_ElementType MaxElementLength3D::GetType() const
|
|||||||
|
|
||||||
double MinimumAngle::GetValue( const TSequenceOfXYZ& P )
|
double MinimumAngle::GetValue( const TSequenceOfXYZ& P )
|
||||||
{
|
{
|
||||||
double aMin;
|
if ( P.size() < 3 )
|
||||||
|
|
||||||
if (P.size() <3)
|
|
||||||
return 0.;
|
return 0.;
|
||||||
|
|
||||||
aMin = getAngle(P( P.size() ), P( 1 ), P( 2 ));
|
double aMaxCos2;
|
||||||
aMin = Min(aMin,getAngle(P( P.size()-1 ), P( P.size() ), P( 1 )));
|
|
||||||
|
aMaxCos2 = getCos2( P( P.size() ), P( 1 ), P( 2 ));
|
||||||
|
aMaxCos2 = Max( aMaxCos2, getCos2( P( P.size()-1 ), P( P.size() ), P( 1 )));
|
||||||
|
|
||||||
for ( size_t i = 2; i < P.size(); i++ )
|
for ( size_t i = 2; i < P.size(); i++ )
|
||||||
{
|
{
|
||||||
double A0 = getAngle( P( i-1 ), P( i ), P( i+1 ) );
|
double A0 = getCos2( P( i-1 ), P( i ), P( i+1 ) );
|
||||||
aMin = Min(aMin,A0);
|
aMaxCos2 = Max( aMaxCos2, A0 );
|
||||||
}
|
}
|
||||||
|
if ( aMaxCos2 < 0 )
|
||||||
|
return 0; // all nodes coincide
|
||||||
|
|
||||||
return aMin * 180.0 / M_PI;
|
double cos = sqrt( aMaxCos2 );
|
||||||
|
if ( cos >= 1 ) return 0;
|
||||||
|
return acos( cos ) * 180.0 / M_PI;
|
||||||
}
|
}
|
||||||
|
|
||||||
double MinimumAngle::GetBadRate( double Value, int nbNodes ) const
|
double MinimumAngle::GetBadRate( double Value, int nbNodes ) const
|
||||||
@ -785,58 +800,51 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
|
|||||||
|
|
||||||
if ( nbNodes == 3 ) {
|
if ( nbNodes == 3 ) {
|
||||||
// Compute lengths of the sides
|
// Compute lengths of the sides
|
||||||
std::vector< double > aLen (nbNodes);
|
double aLen1 = getDistance( P( 1 ), P( 2 ));
|
||||||
for ( int i = 0; i < nbNodes - 1; i++ )
|
double aLen2 = getDistance( P( 2 ), P( 3 ));
|
||||||
aLen[ i ] = getDistance( P( i + 1 ), P( i + 2 ) );
|
double aLen3 = getDistance( P( 3 ), P( 1 ));
|
||||||
aLen[ nbNodes - 1 ] = getDistance( P( 1 ), P( nbNodes ) );
|
|
||||||
// Q = alfa * h * p / S, where
|
// Q = alfa * h * p / S, where
|
||||||
//
|
//
|
||||||
// alfa = sqrt( 3 ) / 6
|
// alfa = sqrt( 3 ) / 6
|
||||||
// h - length of the longest edge
|
// h - length of the longest edge
|
||||||
// p - half perimeter
|
// p - half perimeter
|
||||||
// S - triangle surface
|
// S - triangle surface
|
||||||
const double alfa = sqrt( 3. ) / 6.;
|
const double alfa = sqrt( 3. ) / 6.;
|
||||||
double maxLen = Max( aLen[ 0 ], Max( aLen[ 1 ], aLen[ 2 ] ) );
|
double maxLen = Max( aLen1, Max( aLen2, aLen3 ));
|
||||||
double half_perimeter = ( aLen[0] + aLen[1] + aLen[2] ) / 2.;
|
double half_perimeter = ( aLen1 + aLen2 + aLen3 ) / 2.;
|
||||||
double anArea = getArea( P( 1 ), P( 2 ), P( 3 ) );
|
double anArea = getArea( P( 1 ), P( 2 ), P( 3 ));
|
||||||
if ( anArea <= theEps )
|
if ( anArea <= theEps )
|
||||||
return theInf;
|
return theInf;
|
||||||
return alfa * maxLen * half_perimeter / anArea;
|
return alfa * maxLen * half_perimeter / anArea;
|
||||||
}
|
}
|
||||||
else if ( nbNodes == 6 ) { // quadratic triangles
|
else if ( nbNodes == 6 ) { // quadratic triangles
|
||||||
// Compute lengths of the sides
|
// Compute lengths of the sides
|
||||||
std::vector< double > aLen (3);
|
double aLen1 = getDistance( P( 1 ), P( 3 ));
|
||||||
aLen[0] = getDistance( P(1), P(3) );
|
double aLen2 = getDistance( P( 3 ), P( 5 ));
|
||||||
aLen[1] = getDistance( P(3), P(5) );
|
double aLen3 = getDistance( P( 5 ), P( 1 ));
|
||||||
aLen[2] = getDistance( P(5), P(1) );
|
// algo same as for the linear triangle
|
||||||
// Q = alfa * h * p / S, where
|
const double alfa = sqrt( 3. ) / 6.;
|
||||||
//
|
double maxLen = Max( aLen1, Max( aLen2, aLen3 ));
|
||||||
// alfa = sqrt( 3 ) / 6
|
double half_perimeter = ( aLen1 + aLen2 + aLen3 ) / 2.;
|
||||||
// h - length of the longest edge
|
double anArea = getArea( P( 1 ), P( 3 ), P( 5 ));
|
||||||
// p - half perimeter
|
|
||||||
// S - triangle surface
|
|
||||||
const double alfa = sqrt( 3. ) / 6.;
|
|
||||||
double maxLen = Max( aLen[ 0 ], Max( aLen[ 1 ], aLen[ 2 ] ) );
|
|
||||||
double half_perimeter = ( aLen[0] + aLen[1] + aLen[2] ) / 2.;
|
|
||||||
double anArea = getArea( P(1), P(3), P(5) );
|
|
||||||
if ( anArea <= theEps )
|
if ( anArea <= theEps )
|
||||||
return theInf;
|
return theInf;
|
||||||
return alfa * maxLen * half_perimeter / anArea;
|
return alfa * maxLen * half_perimeter / anArea;
|
||||||
}
|
}
|
||||||
else if( nbNodes == 4 ) { // quadrangle
|
else if( nbNodes == 4 ) { // quadrangle
|
||||||
// Compute lengths of the sides
|
// Compute lengths of the sides
|
||||||
std::vector< double > aLen (4);
|
double aLen[4];
|
||||||
aLen[0] = getDistance( P(1), P(2) );
|
aLen[0] = getDistance( P(1), P(2) );
|
||||||
aLen[1] = getDistance( P(2), P(3) );
|
aLen[1] = getDistance( P(2), P(3) );
|
||||||
aLen[2] = getDistance( P(3), P(4) );
|
aLen[2] = getDistance( P(3), P(4) );
|
||||||
aLen[3] = getDistance( P(4), P(1) );
|
aLen[3] = getDistance( P(4), P(1) );
|
||||||
// Compute lengths of the diagonals
|
// Compute lengths of the diagonals
|
||||||
std::vector< double > aDia (2);
|
double aDia[2];
|
||||||
aDia[0] = getDistance( P(1), P(3) );
|
aDia[0] = getDistance( P(1), P(3) );
|
||||||
aDia[1] = getDistance( P(2), P(4) );
|
aDia[1] = getDistance( P(2), P(4) );
|
||||||
// Compute areas of all triangles which can be built
|
// Compute areas of all triangles which can be built
|
||||||
// taking three nodes of the quadrangle
|
// taking three nodes of the quadrangle
|
||||||
std::vector< double > anArea (4);
|
double anArea[4];
|
||||||
anArea[0] = getArea( P(1), P(2), P(3) );
|
anArea[0] = getArea( P(1), P(2), P(3) );
|
||||||
anArea[1] = getArea( P(1), P(2), P(4) );
|
anArea[1] = getArea( P(1), P(2), P(4) );
|
||||||
anArea[2] = getArea( P(1), P(3), P(4) );
|
anArea[2] = getArea( P(1), P(3), P(4) );
|
||||||
@ -852,35 +860,35 @@ double AspectRatio::GetValue( const TSequenceOfXYZ& P )
|
|||||||
// Si - areas of the triangles
|
// Si - areas of the triangles
|
||||||
const double alpha = sqrt( 1 / 32. );
|
const double alpha = sqrt( 1 / 32. );
|
||||||
double L = Max( aLen[ 0 ],
|
double L = Max( aLen[ 0 ],
|
||||||
Max( aLen[ 1 ],
|
Max( aLen[ 1 ],
|
||||||
Max( aLen[ 2 ],
|
Max( aLen[ 2 ],
|
||||||
Max( aLen[ 3 ],
|
Max( aLen[ 3 ],
|
||||||
Max( aDia[ 0 ], aDia[ 1 ] ) ) ) ) );
|
Max( aDia[ 0 ], aDia[ 1 ] ) ) ) ) );
|
||||||
double C1 = sqrt( ( aLen[0] * aLen[0] +
|
double C1 = sqrt( ( aLen[0] * aLen[0] +
|
||||||
aLen[1] * aLen[1] +
|
aLen[1] * aLen[1] +
|
||||||
aLen[2] * aLen[2] +
|
aLen[2] * aLen[2] +
|
||||||
aLen[3] * aLen[3] ) / 4. );
|
aLen[3] * aLen[3] ) / 4. );
|
||||||
double C2 = Min( anArea[ 0 ],
|
double C2 = Min( anArea[ 0 ],
|
||||||
Min( anArea[ 1 ],
|
Min( anArea[ 1 ],
|
||||||
Min( anArea[ 2 ], anArea[ 3 ] ) ) );
|
Min( anArea[ 2 ], anArea[ 3 ] ) ) );
|
||||||
if ( C2 <= theEps )
|
if ( C2 <= theEps )
|
||||||
return theInf;
|
return theInf;
|
||||||
return alpha * L * C1 / C2;
|
return alpha * L * C1 / C2;
|
||||||
}
|
}
|
||||||
else if( nbNodes == 8 || nbNodes == 9 ) { // nbNodes==8 - quadratic quadrangle
|
else if( nbNodes == 8 || nbNodes == 9 ) { // nbNodes==8 - quadratic quadrangle
|
||||||
// Compute lengths of the sides
|
// Compute lengths of the sides
|
||||||
std::vector< double > aLen (4);
|
double aLen[4];
|
||||||
aLen[0] = getDistance( P(1), P(3) );
|
aLen[0] = getDistance( P(1), P(3) );
|
||||||
aLen[1] = getDistance( P(3), P(5) );
|
aLen[1] = getDistance( P(3), P(5) );
|
||||||
aLen[2] = getDistance( P(5), P(7) );
|
aLen[2] = getDistance( P(5), P(7) );
|
||||||
aLen[3] = getDistance( P(7), P(1) );
|
aLen[3] = getDistance( P(7), P(1) );
|
||||||
// Compute lengths of the diagonals
|
// Compute lengths of the diagonals
|
||||||
std::vector< double > aDia (2);
|
double aDia[2];
|
||||||
aDia[0] = getDistance( P(1), P(5) );
|
aDia[0] = getDistance( P(1), P(5) );
|
||||||
aDia[1] = getDistance( P(3), P(7) );
|
aDia[1] = getDistance( P(3), P(7) );
|
||||||
// Compute areas of all triangles which can be built
|
// Compute areas of all triangles which can be built
|
||||||
// taking three nodes of the quadrangle
|
// taking three nodes of the quadrangle
|
||||||
std::vector< double > anArea (4);
|
double anArea[4];
|
||||||
anArea[0] = getArea( P(1), P(3), P(5) );
|
anArea[0] = getArea( P(1), P(3), P(5) );
|
||||||
anArea[1] = getArea( P(1), P(3), P(7) );
|
anArea[1] = getArea( P(1), P(3), P(7) );
|
||||||
anArea[2] = getArea( P(1), P(5), P(7) );
|
anArea[2] = getArea( P(1), P(5), P(7) );
|
||||||
@ -1552,246 +1560,240 @@ SMDSAbs_ElementType Length::GetType() const
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
double Length2D::GetValue( long theElementId )
|
double Length2D::GetValue( const TSequenceOfXYZ& P )
|
||||||
{
|
{
|
||||||
TSequenceOfXYZ P;
|
double aVal = 0;
|
||||||
|
int len = P.size();
|
||||||
|
SMDSAbs_EntityType aType = P.getElementEntity();
|
||||||
|
|
||||||
if ( GetPoints( theElementId, P ))
|
switch (aType) {
|
||||||
{
|
case SMDSEntity_Edge:
|
||||||
double aVal = 0;
|
if (len == 2)
|
||||||
int len = P.size();
|
aVal = getDistance( P( 1 ), P( 2 ) );
|
||||||
SMDSAbs_EntityType aType = P.getElementEntity();
|
break;
|
||||||
|
case SMDSEntity_Quad_Edge:
|
||||||
switch (aType) {
|
if (len == 3) // quadratic edge
|
||||||
case SMDSEntity_Edge:
|
aVal = getDistance(P( 1 ),P( 3 )) + getDistance(P( 3 ),P( 2 ));
|
||||||
if (len == 2)
|
break;
|
||||||
aVal = getDistance( P( 1 ), P( 2 ) );
|
case SMDSEntity_Triangle:
|
||||||
break;
|
if (len == 3){ // triangles
|
||||||
case SMDSEntity_Quad_Edge:
|
double L1 = getDistance(P( 1 ),P( 2 ));
|
||||||
if (len == 3) // quadratic edge
|
double L2 = getDistance(P( 2 ),P( 3 ));
|
||||||
aVal = getDistance(P( 1 ),P( 3 )) + getDistance(P( 3 ),P( 2 ));
|
double L3 = getDistance(P( 3 ),P( 1 ));
|
||||||
break;
|
aVal = Min(L1,Min(L2,L3));
|
||||||
case SMDSEntity_Triangle:
|
|
||||||
if (len == 3){ // triangles
|
|
||||||
double L1 = getDistance(P( 1 ),P( 2 ));
|
|
||||||
double L2 = getDistance(P( 2 ),P( 3 ));
|
|
||||||
double L3 = getDistance(P( 3 ),P( 1 ));
|
|
||||||
aVal = Min(L1,Min(L2,L3));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Quadrangle:
|
|
||||||
if (len == 4){ // quadrangles
|
|
||||||
double L1 = getDistance(P( 1 ),P( 2 ));
|
|
||||||
double L2 = getDistance(P( 2 ),P( 3 ));
|
|
||||||
double L3 = getDistance(P( 3 ),P( 4 ));
|
|
||||||
double L4 = getDistance(P( 4 ),P( 1 ));
|
|
||||||
aVal = Min(Min(L1,L2),Min(L3,L4));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Quad_Triangle:
|
|
||||||
case SMDSEntity_BiQuad_Triangle:
|
|
||||||
if (len >= 6){ // quadratic triangles
|
|
||||||
double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
|
|
||||||
double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
|
|
||||||
double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 1 ));
|
|
||||||
aVal = Min(L1,Min(L2,L3));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Quad_Quadrangle:
|
|
||||||
case SMDSEntity_BiQuad_Quadrangle:
|
|
||||||
if (len >= 8){ // quadratic quadrangles
|
|
||||||
double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
|
|
||||||
double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
|
|
||||||
double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 7 ));
|
|
||||||
double L4 = getDistance(P( 7 ),P( 8 )) + getDistance(P( 8 ),P( 1 ));
|
|
||||||
aVal = Min(Min(L1,L2),Min(L3,L4));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Tetra:
|
|
||||||
if (len == 4){ // tetrahedra
|
|
||||||
double L1 = getDistance(P( 1 ),P( 2 ));
|
|
||||||
double L2 = getDistance(P( 2 ),P( 3 ));
|
|
||||||
double L3 = getDistance(P( 3 ),P( 1 ));
|
|
||||||
double L4 = getDistance(P( 1 ),P( 4 ));
|
|
||||||
double L5 = getDistance(P( 2 ),P( 4 ));
|
|
||||||
double L6 = getDistance(P( 3 ),P( 4 ));
|
|
||||||
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Pyramid:
|
|
||||||
if (len == 5){ // piramids
|
|
||||||
double L1 = getDistance(P( 1 ),P( 2 ));
|
|
||||||
double L2 = getDistance(P( 2 ),P( 3 ));
|
|
||||||
double L3 = getDistance(P( 3 ),P( 4 ));
|
|
||||||
double L4 = getDistance(P( 4 ),P( 1 ));
|
|
||||||
double L5 = getDistance(P( 1 ),P( 5 ));
|
|
||||||
double L6 = getDistance(P( 2 ),P( 5 ));
|
|
||||||
double L7 = getDistance(P( 3 ),P( 5 ));
|
|
||||||
double L8 = getDistance(P( 4 ),P( 5 ));
|
|
||||||
|
|
||||||
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
|
||||||
aVal = Min(aVal,Min(L7,L8));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Penta:
|
|
||||||
if (len == 6) { // pentaidres
|
|
||||||
double L1 = getDistance(P( 1 ),P( 2 ));
|
|
||||||
double L2 = getDistance(P( 2 ),P( 3 ));
|
|
||||||
double L3 = getDistance(P( 3 ),P( 1 ));
|
|
||||||
double L4 = getDistance(P( 4 ),P( 5 ));
|
|
||||||
double L5 = getDistance(P( 5 ),P( 6 ));
|
|
||||||
double L6 = getDistance(P( 6 ),P( 4 ));
|
|
||||||
double L7 = getDistance(P( 1 ),P( 4 ));
|
|
||||||
double L8 = getDistance(P( 2 ),P( 5 ));
|
|
||||||
double L9 = getDistance(P( 3 ),P( 6 ));
|
|
||||||
|
|
||||||
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
|
||||||
aVal = Min(aVal,Min(Min(L7,L8),L9));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Hexa:
|
|
||||||
if (len == 8){ // hexahedron
|
|
||||||
double L1 = getDistance(P( 1 ),P( 2 ));
|
|
||||||
double L2 = getDistance(P( 2 ),P( 3 ));
|
|
||||||
double L3 = getDistance(P( 3 ),P( 4 ));
|
|
||||||
double L4 = getDistance(P( 4 ),P( 1 ));
|
|
||||||
double L5 = getDistance(P( 5 ),P( 6 ));
|
|
||||||
double L6 = getDistance(P( 6 ),P( 7 ));
|
|
||||||
double L7 = getDistance(P( 7 ),P( 8 ));
|
|
||||||
double L8 = getDistance(P( 8 ),P( 5 ));
|
|
||||||
double L9 = getDistance(P( 1 ),P( 5 ));
|
|
||||||
double L10= getDistance(P( 2 ),P( 6 ));
|
|
||||||
double L11= getDistance(P( 3 ),P( 7 ));
|
|
||||||
double L12= getDistance(P( 4 ),P( 8 ));
|
|
||||||
|
|
||||||
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
|
||||||
aVal = Min(aVal,Min(Min(L7,L8),Min(L9,L10)));
|
|
||||||
aVal = Min(aVal,Min(L11,L12));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Quad_Tetra:
|
|
||||||
if (len == 10){ // quadratic tetraidrs
|
|
||||||
double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 ));
|
|
||||||
double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 ));
|
|
||||||
double L3 = getDistance(P( 3 ),P( 7 )) + getDistance(P( 7 ),P( 1 ));
|
|
||||||
double L4 = getDistance(P( 1 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
|
|
||||||
double L5 = getDistance(P( 2 ),P( 9 )) + getDistance(P( 9 ),P( 4 ));
|
|
||||||
double L6 = getDistance(P( 3 ),P( 10 )) + getDistance(P( 10 ),P( 4 ));
|
|
||||||
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Quad_Pyramid:
|
|
||||||
if (len == 13){ // quadratic piramids
|
|
||||||
double L1 = getDistance(P( 1 ),P( 6 )) + getDistance(P( 6 ),P( 2 ));
|
|
||||||
double L2 = getDistance(P( 2 ),P( 7 )) + getDistance(P( 7 ),P( 3 ));
|
|
||||||
double L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
|
|
||||||
double L4 = getDistance(P( 4 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
|
|
||||||
double L5 = getDistance(P( 1 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
|
|
||||||
double L6 = getDistance(P( 2 ),P( 11 )) + getDistance(P( 11 ),P( 5 ));
|
|
||||||
double L7 = getDistance(P( 3 ),P( 12 )) + getDistance(P( 12 ),P( 5 ));
|
|
||||||
double L8 = getDistance(P( 4 ),P( 13 )) + getDistance(P( 13 ),P( 5 ));
|
|
||||||
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
|
||||||
aVal = Min(aVal,Min(L7,L8));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Quad_Penta:
|
|
||||||
if (len == 15){ // quadratic pentaidres
|
|
||||||
double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 ));
|
|
||||||
double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 ));
|
|
||||||
double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
|
|
||||||
double L4 = getDistance(P( 4 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
|
|
||||||
double L5 = getDistance(P( 5 ),P( 11 )) + getDistance(P( 11 ),P( 6 ));
|
|
||||||
double L6 = getDistance(P( 6 ),P( 12 )) + getDistance(P( 12 ),P( 4 ));
|
|
||||||
double L7 = getDistance(P( 1 ),P( 13 )) + getDistance(P( 13 ),P( 4 ));
|
|
||||||
double L8 = getDistance(P( 2 ),P( 14 )) + getDistance(P( 14 ),P( 5 ));
|
|
||||||
double L9 = getDistance(P( 3 ),P( 15 )) + getDistance(P( 15 ),P( 6 ));
|
|
||||||
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
|
||||||
aVal = Min(aVal,Min(Min(L7,L8),L9));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Quad_Hexa:
|
|
||||||
case SMDSEntity_TriQuad_Hexa:
|
|
||||||
if (len >= 20) { // quadratic hexaider
|
|
||||||
double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 ));
|
|
||||||
double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 ));
|
|
||||||
double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 ));
|
|
||||||
double L4 = getDistance(P( 4 ),P( 12 )) + getDistance(P( 12 ),P( 1 ));
|
|
||||||
double L5 = getDistance(P( 5 ),P( 13 )) + getDistance(P( 13 ),P( 6 ));
|
|
||||||
double L6 = getDistance(P( 6 ),P( 14 )) + getDistance(P( 14 ),P( 7 ));
|
|
||||||
double L7 = getDistance(P( 7 ),P( 15 )) + getDistance(P( 15 ),P( 8 ));
|
|
||||||
double L8 = getDistance(P( 8 ),P( 16 )) + getDistance(P( 16 ),P( 5 ));
|
|
||||||
double L9 = getDistance(P( 1 ),P( 17 )) + getDistance(P( 17 ),P( 5 ));
|
|
||||||
double L10= getDistance(P( 2 ),P( 18 )) + getDistance(P( 18 ),P( 6 ));
|
|
||||||
double L11= getDistance(P( 3 ),P( 19 )) + getDistance(P( 19 ),P( 7 ));
|
|
||||||
double L12= getDistance(P( 4 ),P( 20 )) + getDistance(P( 20 ),P( 8 ));
|
|
||||||
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
|
||||||
aVal = Min(aVal,Min(Min(L7,L8),Min(L9,L10)));
|
|
||||||
aVal = Min(aVal,Min(L11,L12));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Polygon:
|
|
||||||
if ( len > 1 ) {
|
|
||||||
aVal = getDistance( P(1), P( P.size() ));
|
|
||||||
for ( size_t i = 1; i < P.size(); ++i )
|
|
||||||
aVal = Min( aVal, getDistance( P( i ), P( i+1 )));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Quad_Polygon:
|
|
||||||
if ( len > 2 ) {
|
|
||||||
aVal = getDistance( P(1), P( P.size() )) + getDistance( P(P.size()), P( P.size()-1 ));
|
|
||||||
for ( size_t i = 1; i < P.size()-1; i += 2 )
|
|
||||||
aVal = Min( aVal, getDistance( P( i ), P( i+1 )) + getDistance( P( i+1 ), P( i+2 )));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Hexagonal_Prism:
|
|
||||||
if (len == 12) { // hexagonal prism
|
|
||||||
double L1 = getDistance(P( 1 ),P( 2 ));
|
|
||||||
double L2 = getDistance(P( 2 ),P( 3 ));
|
|
||||||
double L3 = getDistance(P( 3 ),P( 4 ));
|
|
||||||
double L4 = getDistance(P( 4 ),P( 5 ));
|
|
||||||
double L5 = getDistance(P( 5 ),P( 6 ));
|
|
||||||
double L6 = getDistance(P( 6 ),P( 1 ));
|
|
||||||
|
|
||||||
double L7 = getDistance(P( 7 ), P( 8 ));
|
|
||||||
double L8 = getDistance(P( 8 ), P( 9 ));
|
|
||||||
double L9 = getDistance(P( 9 ), P( 10 ));
|
|
||||||
double L10= getDistance(P( 10 ),P( 11 ));
|
|
||||||
double L11= getDistance(P( 11 ),P( 12 ));
|
|
||||||
double L12= getDistance(P( 12 ),P( 7 ));
|
|
||||||
|
|
||||||
double L13 = getDistance(P( 1 ),P( 7 ));
|
|
||||||
double L14 = getDistance(P( 2 ),P( 8 ));
|
|
||||||
double L15 = getDistance(P( 3 ),P( 9 ));
|
|
||||||
double L16 = getDistance(P( 4 ),P( 10 ));
|
|
||||||
double L17 = getDistance(P( 5 ),P( 11 ));
|
|
||||||
double L18 = getDistance(P( 6 ),P( 12 ));
|
|
||||||
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
|
||||||
aVal = Min(aVal, Min(Min(Min(L7,L8),Min(L9,L10)),Min(L11,L12)));
|
|
||||||
aVal = Min(aVal, Min(Min(Min(L13,L14),Min(L15,L16)),Min(L17,L18)));
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case SMDSEntity_Polyhedra:
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
case SMDSEntity_Quadrangle:
|
||||||
return 0;
|
if (len == 4){ // quadrangles
|
||||||
|
double L1 = getDistance(P( 1 ),P( 2 ));
|
||||||
|
double L2 = getDistance(P( 2 ),P( 3 ));
|
||||||
|
double L3 = getDistance(P( 3 ),P( 4 ));
|
||||||
|
double L4 = getDistance(P( 4 ),P( 1 ));
|
||||||
|
aVal = Min(Min(L1,L2),Min(L3,L4));
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
if (aVal < 0 ) {
|
case SMDSEntity_Quad_Triangle:
|
||||||
return 0.;
|
case SMDSEntity_BiQuad_Triangle:
|
||||||
|
if (len >= 6){ // quadratic triangles
|
||||||
|
double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
|
||||||
|
double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
|
||||||
|
double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 1 ));
|
||||||
|
aVal = Min(L1,Min(L2,L3));
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
if ( myPrecision >= 0 )
|
case SMDSEntity_Quad_Quadrangle:
|
||||||
{
|
case SMDSEntity_BiQuad_Quadrangle:
|
||||||
double prec = pow( 10., (double)( myPrecision ) );
|
if (len >= 8){ // quadratic quadrangles
|
||||||
aVal = floor( aVal * prec + 0.5 ) / prec;
|
double L1 = getDistance(P( 1 ),P( 2 )) + getDistance(P( 2 ),P( 3 ));
|
||||||
|
double L2 = getDistance(P( 3 ),P( 4 )) + getDistance(P( 4 ),P( 5 ));
|
||||||
|
double L3 = getDistance(P( 5 ),P( 6 )) + getDistance(P( 6 ),P( 7 ));
|
||||||
|
double L4 = getDistance(P( 7 ),P( 8 )) + getDistance(P( 8 ),P( 1 ));
|
||||||
|
aVal = Min(Min(L1,L2),Min(L3,L4));
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Tetra:
|
||||||
|
if (len == 4){ // tetrahedra
|
||||||
|
double L1 = getDistance(P( 1 ),P( 2 ));
|
||||||
|
double L2 = getDistance(P( 2 ),P( 3 ));
|
||||||
|
double L3 = getDistance(P( 3 ),P( 1 ));
|
||||||
|
double L4 = getDistance(P( 1 ),P( 4 ));
|
||||||
|
double L5 = getDistance(P( 2 ),P( 4 ));
|
||||||
|
double L6 = getDistance(P( 3 ),P( 4 ));
|
||||||
|
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Pyramid:
|
||||||
|
if (len == 5){ // pyramid
|
||||||
|
double L1 = getDistance(P( 1 ),P( 2 ));
|
||||||
|
double L2 = getDistance(P( 2 ),P( 3 ));
|
||||||
|
double L3 = getDistance(P( 3 ),P( 4 ));
|
||||||
|
double L4 = getDistance(P( 4 ),P( 1 ));
|
||||||
|
double L5 = getDistance(P( 1 ),P( 5 ));
|
||||||
|
double L6 = getDistance(P( 2 ),P( 5 ));
|
||||||
|
double L7 = getDistance(P( 3 ),P( 5 ));
|
||||||
|
double L8 = getDistance(P( 4 ),P( 5 ));
|
||||||
|
|
||||||
return aVal;
|
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
||||||
|
aVal = Min(aVal,Min(L7,L8));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Penta:
|
||||||
|
if (len == 6) { // pentahedron
|
||||||
|
double L1 = getDistance(P( 1 ),P( 2 ));
|
||||||
|
double L2 = getDistance(P( 2 ),P( 3 ));
|
||||||
|
double L3 = getDistance(P( 3 ),P( 1 ));
|
||||||
|
double L4 = getDistance(P( 4 ),P( 5 ));
|
||||||
|
double L5 = getDistance(P( 5 ),P( 6 ));
|
||||||
|
double L6 = getDistance(P( 6 ),P( 4 ));
|
||||||
|
double L7 = getDistance(P( 1 ),P( 4 ));
|
||||||
|
double L8 = getDistance(P( 2 ),P( 5 ));
|
||||||
|
double L9 = getDistance(P( 3 ),P( 6 ));
|
||||||
|
|
||||||
|
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
||||||
|
aVal = Min(aVal,Min(Min(L7,L8),L9));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Hexa:
|
||||||
|
if (len == 8){ // hexahedron
|
||||||
|
double L1 = getDistance(P( 1 ),P( 2 ));
|
||||||
|
double L2 = getDistance(P( 2 ),P( 3 ));
|
||||||
|
double L3 = getDistance(P( 3 ),P( 4 ));
|
||||||
|
double L4 = getDistance(P( 4 ),P( 1 ));
|
||||||
|
double L5 = getDistance(P( 5 ),P( 6 ));
|
||||||
|
double L6 = getDistance(P( 6 ),P( 7 ));
|
||||||
|
double L7 = getDistance(P( 7 ),P( 8 ));
|
||||||
|
double L8 = getDistance(P( 8 ),P( 5 ));
|
||||||
|
double L9 = getDistance(P( 1 ),P( 5 ));
|
||||||
|
double L10= getDistance(P( 2 ),P( 6 ));
|
||||||
|
double L11= getDistance(P( 3 ),P( 7 ));
|
||||||
|
double L12= getDistance(P( 4 ),P( 8 ));
|
||||||
|
|
||||||
|
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
||||||
|
aVal = Min(aVal,Min(Min(L7,L8),Min(L9,L10)));
|
||||||
|
aVal = Min(aVal,Min(L11,L12));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Quad_Tetra:
|
||||||
|
if (len == 10){ // quadratic tetrahedron
|
||||||
|
double L1 = getDistance(P( 1 ),P( 5 )) + getDistance(P( 5 ),P( 2 ));
|
||||||
|
double L2 = getDistance(P( 2 ),P( 6 )) + getDistance(P( 6 ),P( 3 ));
|
||||||
|
double L3 = getDistance(P( 3 ),P( 7 )) + getDistance(P( 7 ),P( 1 ));
|
||||||
|
double L4 = getDistance(P( 1 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
|
||||||
|
double L5 = getDistance(P( 2 ),P( 9 )) + getDistance(P( 9 ),P( 4 ));
|
||||||
|
double L6 = getDistance(P( 3 ),P( 10 )) + getDistance(P( 10 ),P( 4 ));
|
||||||
|
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Quad_Pyramid:
|
||||||
|
if (len == 13){ // quadratic pyramid
|
||||||
|
double L1 = getDistance(P( 1 ),P( 6 )) + getDistance(P( 6 ),P( 2 ));
|
||||||
|
double L2 = getDistance(P( 2 ),P( 7 )) + getDistance(P( 7 ),P( 3 ));
|
||||||
|
double L3 = getDistance(P( 3 ),P( 8 )) + getDistance(P( 8 ),P( 4 ));
|
||||||
|
double L4 = getDistance(P( 4 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
|
||||||
|
double L5 = getDistance(P( 1 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
|
||||||
|
double L6 = getDistance(P( 2 ),P( 11 )) + getDistance(P( 11 ),P( 5 ));
|
||||||
|
double L7 = getDistance(P( 3 ),P( 12 )) + getDistance(P( 12 ),P( 5 ));
|
||||||
|
double L8 = getDistance(P( 4 ),P( 13 )) + getDistance(P( 13 ),P( 5 ));
|
||||||
|
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
||||||
|
aVal = Min(aVal,Min(L7,L8));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
|
if (len >= 15){ // quadratic pentahedron
|
||||||
|
double L1 = getDistance(P( 1 ),P( 7 )) + getDistance(P( 7 ),P( 2 ));
|
||||||
|
double L2 = getDistance(P( 2 ),P( 8 )) + getDistance(P( 8 ),P( 3 ));
|
||||||
|
double L3 = getDistance(P( 3 ),P( 9 )) + getDistance(P( 9 ),P( 1 ));
|
||||||
|
double L4 = getDistance(P( 4 ),P( 10 )) + getDistance(P( 10 ),P( 5 ));
|
||||||
|
double L5 = getDistance(P( 5 ),P( 11 )) + getDistance(P( 11 ),P( 6 ));
|
||||||
|
double L6 = getDistance(P( 6 ),P( 12 )) + getDistance(P( 12 ),P( 4 ));
|
||||||
|
double L7 = getDistance(P( 1 ),P( 13 )) + getDistance(P( 13 ),P( 4 ));
|
||||||
|
double L8 = getDistance(P( 2 ),P( 14 )) + getDistance(P( 14 ),P( 5 ));
|
||||||
|
double L9 = getDistance(P( 3 ),P( 15 )) + getDistance(P( 15 ),P( 6 ));
|
||||||
|
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
||||||
|
aVal = Min(aVal,Min(Min(L7,L8),L9));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Quad_Hexa:
|
||||||
|
case SMDSEntity_TriQuad_Hexa:
|
||||||
|
if (len >= 20) { // quadratic hexahedron
|
||||||
|
double L1 = getDistance(P( 1 ),P( 9 )) + getDistance(P( 9 ),P( 2 ));
|
||||||
|
double L2 = getDistance(P( 2 ),P( 10 )) + getDistance(P( 10 ),P( 3 ));
|
||||||
|
double L3 = getDistance(P( 3 ),P( 11 )) + getDistance(P( 11 ),P( 4 ));
|
||||||
|
double L4 = getDistance(P( 4 ),P( 12 )) + getDistance(P( 12 ),P( 1 ));
|
||||||
|
double L5 = getDistance(P( 5 ),P( 13 )) + getDistance(P( 13 ),P( 6 ));
|
||||||
|
double L6 = getDistance(P( 6 ),P( 14 )) + getDistance(P( 14 ),P( 7 ));
|
||||||
|
double L7 = getDistance(P( 7 ),P( 15 )) + getDistance(P( 15 ),P( 8 ));
|
||||||
|
double L8 = getDistance(P( 8 ),P( 16 )) + getDistance(P( 16 ),P( 5 ));
|
||||||
|
double L9 = getDistance(P( 1 ),P( 17 )) + getDistance(P( 17 ),P( 5 ));
|
||||||
|
double L10= getDistance(P( 2 ),P( 18 )) + getDistance(P( 18 ),P( 6 ));
|
||||||
|
double L11= getDistance(P( 3 ),P( 19 )) + getDistance(P( 19 ),P( 7 ));
|
||||||
|
double L12= getDistance(P( 4 ),P( 20 )) + getDistance(P( 20 ),P( 8 ));
|
||||||
|
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
||||||
|
aVal = Min(aVal,Min(Min(L7,L8),Min(L9,L10)));
|
||||||
|
aVal = Min(aVal,Min(L11,L12));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Polygon:
|
||||||
|
if ( len > 1 ) {
|
||||||
|
aVal = getDistance( P(1), P( P.size() ));
|
||||||
|
for ( size_t i = 1; i < P.size(); ++i )
|
||||||
|
aVal = Min( aVal, getDistance( P( i ), P( i+1 )));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Quad_Polygon:
|
||||||
|
if ( len > 2 ) {
|
||||||
|
aVal = getDistance( P(1), P( P.size() )) + getDistance( P(P.size()), P( P.size()-1 ));
|
||||||
|
for ( size_t i = 1; i < P.size()-1; i += 2 )
|
||||||
|
aVal = Min( aVal, getDistance( P( i ), P( i+1 )) + getDistance( P( i+1 ), P( i+2 )));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Hexagonal_Prism:
|
||||||
|
if (len == 12) { // hexagonal prism
|
||||||
|
double L1 = getDistance(P( 1 ),P( 2 ));
|
||||||
|
double L2 = getDistance(P( 2 ),P( 3 ));
|
||||||
|
double L3 = getDistance(P( 3 ),P( 4 ));
|
||||||
|
double L4 = getDistance(P( 4 ),P( 5 ));
|
||||||
|
double L5 = getDistance(P( 5 ),P( 6 ));
|
||||||
|
double L6 = getDistance(P( 6 ),P( 1 ));
|
||||||
|
|
||||||
|
double L7 = getDistance(P( 7 ), P( 8 ));
|
||||||
|
double L8 = getDistance(P( 8 ), P( 9 ));
|
||||||
|
double L9 = getDistance(P( 9 ), P( 10 ));
|
||||||
|
double L10= getDistance(P( 10 ),P( 11 ));
|
||||||
|
double L11= getDistance(P( 11 ),P( 12 ));
|
||||||
|
double L12= getDistance(P( 12 ),P( 7 ));
|
||||||
|
|
||||||
|
double L13 = getDistance(P( 1 ),P( 7 ));
|
||||||
|
double L14 = getDistance(P( 2 ),P( 8 ));
|
||||||
|
double L15 = getDistance(P( 3 ),P( 9 ));
|
||||||
|
double L16 = getDistance(P( 4 ),P( 10 ));
|
||||||
|
double L17 = getDistance(P( 5 ),P( 11 ));
|
||||||
|
double L18 = getDistance(P( 6 ),P( 12 ));
|
||||||
|
aVal = Min(Min(Min(L1,L2),Min(L3,L4)),Min(L5,L6));
|
||||||
|
aVal = Min(aVal, Min(Min(Min(L7,L8),Min(L9,L10)),Min(L11,L12)));
|
||||||
|
aVal = Min(aVal, Min(Min(Min(L13,L14),Min(L15,L16)),Min(L17,L18)));
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SMDSEntity_Polyhedra:
|
||||||
|
{
|
||||||
}
|
}
|
||||||
return 0.;
|
break;
|
||||||
|
default:
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (aVal < 0 ) {
|
||||||
|
return 0.;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( myPrecision >= 0 )
|
||||||
|
{
|
||||||
|
double prec = pow( 10., (double)( myPrecision ) );
|
||||||
|
aVal = floor( aVal * prec + 0.5 ) / prec;
|
||||||
|
}
|
||||||
|
|
||||||
|
return aVal;
|
||||||
}
|
}
|
||||||
|
|
||||||
double Length2D::GetBadRate( double Value, int /*nbNodes*/ ) const
|
double Length2D::GetBadRate( double Value, int /*nbNodes*/ ) const
|
||||||
@ -1906,6 +1908,97 @@ void Length2D::GetValues(TValues& theValues)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*
|
||||||
|
Class : Deflection2D
|
||||||
|
Description : Functor for calculating number of faces conneted to the edge
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
double Deflection2D::GetValue( const TSequenceOfXYZ& P )
|
||||||
|
{
|
||||||
|
if ( myMesh && P.getElement() )
|
||||||
|
{
|
||||||
|
// get underlying surface
|
||||||
|
if ( myShapeIndex != P.getElement()->getshapeId() )
|
||||||
|
{
|
||||||
|
mySurface.Nullify();
|
||||||
|
myShapeIndex = P.getElement()->getshapeId();
|
||||||
|
const TopoDS_Shape& S =
|
||||||
|
static_cast< const SMESHDS_Mesh* >( myMesh )->IndexToShape( myShapeIndex );
|
||||||
|
if ( !S.IsNull() && S.ShapeType() == TopAbs_FACE )
|
||||||
|
{
|
||||||
|
mySurface = new ShapeAnalysis_Surface( BRep_Tool::Surface( TopoDS::Face( S )));
|
||||||
|
|
||||||
|
GeomLib_IsPlanarSurface isPlaneCheck( mySurface->Surface() );
|
||||||
|
if ( isPlaneCheck.IsPlanar() )
|
||||||
|
myPlane.reset( new gp_Pln( isPlaneCheck.Plan() ));
|
||||||
|
else
|
||||||
|
myPlane.reset();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// project gravity center to the surface
|
||||||
|
if ( !mySurface.IsNull() )
|
||||||
|
{
|
||||||
|
gp_XYZ gc(0,0,0);
|
||||||
|
gp_XY uv(0,0);
|
||||||
|
int nbUV = 0;
|
||||||
|
for ( size_t i = 0; i < P.size(); ++i )
|
||||||
|
{
|
||||||
|
gc += P(i+1);
|
||||||
|
|
||||||
|
if ( const SMDS_FacePosition* fPos = dynamic_cast<const SMDS_FacePosition*>
|
||||||
|
( P.getElement()->GetNode( i )->GetPosition() ))
|
||||||
|
{
|
||||||
|
uv.ChangeCoord(1) += fPos->GetUParameter();
|
||||||
|
uv.ChangeCoord(2) += fPos->GetVParameter();
|
||||||
|
++nbUV;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gc /= P.size();
|
||||||
|
if ( nbUV ) uv /= nbUV;
|
||||||
|
|
||||||
|
double maxLen = MaxElementLength2D().GetValue( P );
|
||||||
|
double tol = 1e-3 * maxLen;
|
||||||
|
double dist;
|
||||||
|
if ( myPlane )
|
||||||
|
{
|
||||||
|
dist = myPlane->Distance( gc );
|
||||||
|
if ( dist < tol )
|
||||||
|
dist = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if ( uv.X() != 0 && uv.Y() != 0 ) // faster way
|
||||||
|
mySurface->NextValueOfUV( uv, gc, tol, 0.5 * maxLen );
|
||||||
|
else
|
||||||
|
mySurface->ValueOfUV( gc, tol );
|
||||||
|
dist = mySurface->Gap();
|
||||||
|
}
|
||||||
|
return Round( dist );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Deflection2D::SetMesh( const SMDS_Mesh* theMesh )
|
||||||
|
{
|
||||||
|
NumericalFunctor::SetMesh( dynamic_cast<const SMESHDS_Mesh* >( theMesh ));
|
||||||
|
myShapeIndex = -100;
|
||||||
|
myPlane.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
SMDSAbs_ElementType Deflection2D::GetType() const
|
||||||
|
{
|
||||||
|
return SMDSAbs_Face;
|
||||||
|
}
|
||||||
|
|
||||||
|
double Deflection2D::GetBadRate( double Value, int /*nbNodes*/ ) const
|
||||||
|
{
|
||||||
|
// meaningless as it is not quality control functor
|
||||||
|
return Value;
|
||||||
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*
|
/*
|
||||||
Class : MultiConnection
|
Class : MultiConnection
|
||||||
|
@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include "SMESH_TypeDefs.hxx"
|
#include "SMESH_TypeDefs.hxx"
|
||||||
|
|
||||||
#include <BRepClass3d_SolidClassifier.hxx>
|
|
||||||
#include <Bnd_B3d.hxx>
|
#include <Bnd_B3d.hxx>
|
||||||
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
#include <GeomAPI_ProjectPointOnCurve.hxx>
|
||||||
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
#include <GeomAPI_ProjectPointOnSurf.hxx>
|
||||||
@ -54,6 +53,9 @@ class SMESHDS_Mesh;
|
|||||||
class SMESHDS_SubMesh;
|
class SMESHDS_SubMesh;
|
||||||
class SMESHDS_GroupBase;
|
class SMESHDS_GroupBase;
|
||||||
|
|
||||||
|
class BRepClass3d_SolidClassifier;
|
||||||
|
class ShapeAnalysis_Surface;
|
||||||
|
class gp_Pln;
|
||||||
class gp_Pnt;
|
class gp_Pnt;
|
||||||
|
|
||||||
namespace SMESH{
|
namespace SMESH{
|
||||||
@ -293,7 +295,7 @@ namespace SMESH{
|
|||||||
*/
|
*/
|
||||||
class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
|
class SMESHCONTROLS_EXPORT Length2D: public virtual NumericalFunctor{
|
||||||
public:
|
public:
|
||||||
virtual double GetValue( long theElementId );
|
virtual double GetValue( const TSequenceOfXYZ& thePoints );
|
||||||
virtual double GetBadRate( double Value, int nbNodes ) const;
|
virtual double GetBadRate( double Value, int nbNodes ) const;
|
||||||
virtual SMDSAbs_ElementType GetType() const;
|
virtual SMDSAbs_ElementType GetType() const;
|
||||||
struct Value{
|
struct Value{
|
||||||
@ -307,6 +309,22 @@ namespace SMESH{
|
|||||||
};
|
};
|
||||||
typedef boost::shared_ptr<Length2D> Length2DPtr;
|
typedef boost::shared_ptr<Length2D> Length2DPtr;
|
||||||
|
|
||||||
|
/*
|
||||||
|
Class : Deflection2D
|
||||||
|
Description : Functor for calculating distance between a face and geometry
|
||||||
|
*/
|
||||||
|
class SMESHCONTROLS_EXPORT Deflection2D: public virtual NumericalFunctor{
|
||||||
|
public:
|
||||||
|
virtual void SetMesh( const SMDS_Mesh* theMesh );
|
||||||
|
virtual double GetValue( const TSequenceOfXYZ& thePoints );
|
||||||
|
virtual double GetBadRate( double Value, int nbNodes ) const;
|
||||||
|
virtual SMDSAbs_ElementType GetType() const;
|
||||||
|
private:
|
||||||
|
Handle(ShapeAnalysis_Surface) mySurface;
|
||||||
|
int myShapeIndex;
|
||||||
|
boost::shared_ptr<gp_Pln> myPlane;
|
||||||
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Class : MultiConnection
|
Class : MultiConnection
|
||||||
Description : Functor for calculating number of faces connected to the edge
|
Description : Functor for calculating number of faces connected to the edge
|
||||||
|
@ -25,6 +25,7 @@
|
|||||||
|
|
||||||
#include "DriverCGNS_Write.hxx"
|
#include "DriverCGNS_Write.hxx"
|
||||||
|
|
||||||
|
#include "SMDS_IteratorOnIterators.hxx"
|
||||||
#include "SMDS_MeshNode.hxx"
|
#include "SMDS_MeshNode.hxx"
|
||||||
#include "SMDS_VolumeTool.hxx"
|
#include "SMDS_VolumeTool.hxx"
|
||||||
#include "SMESHDS_GroupBase.hxx"
|
#include "SMESHDS_GroupBase.hxx"
|
||||||
@ -129,6 +130,11 @@ namespace
|
|||||||
interlaces[SMDSEntity_Quad_Penta] = ids;
|
interlaces[SMDSEntity_Quad_Penta] = ids;
|
||||||
cgTypes [SMDSEntity_Quad_Penta] = CGNS_ENUMV( PENTA_15 );
|
cgTypes [SMDSEntity_Quad_Penta] = CGNS_ENUMV( PENTA_15 );
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
static int ids[] = { 0,2,1,3,5,4,8,7,6,9,11,10,14,13,12,15,16,17 }; // TODO: check CGNS ORDER
|
||||||
|
interlaces[SMDSEntity_BiQuad_Penta] = ids;
|
||||||
|
cgTypes [SMDSEntity_BiQuad_Penta] = CGNS_ENUMV( PENTA_18 );
|
||||||
|
}
|
||||||
{
|
{
|
||||||
static int ids[] = { 0,3,2,1,4,7,6,5 };
|
static int ids[] = { 0,3,2,1,4,7,6,5 };
|
||||||
interlaces[SMDSEntity_Hexa] = ids;
|
interlaces[SMDSEntity_Hexa] = ids;
|
||||||
@ -330,7 +336,24 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
// write into a section all successive elements of one geom type
|
// write into a section all successive elements of one geom type
|
||||||
int iSec;
|
int iSec;
|
||||||
vector< cgsize_t > elemData;
|
vector< cgsize_t > elemData;
|
||||||
SMDS_ElemIteratorPtr elemIt = myMesh->elementsIterator();
|
SMDS_ElemIteratorPtr elemIt = myMesh->elementsIterator();
|
||||||
|
vector< SMDS_ElemIteratorPtr > elemItVec;
|
||||||
|
if ( _elementsByType )
|
||||||
|
{
|
||||||
|
// create an iterator returning all elements by type
|
||||||
|
for ( int type = SMDSEntity_Node + 1; type < SMDSEntity_Last; ++type )
|
||||||
|
{
|
||||||
|
if ( type == SMDSEntity_Ball )
|
||||||
|
continue; // not supported
|
||||||
|
elemIt = myMesh->elementEntityIterator( SMDSAbs_EntityType( type ));
|
||||||
|
if ( elemIt->more() )
|
||||||
|
elemItVec.push_back( elemIt );
|
||||||
|
}
|
||||||
|
typedef SMDS_IteratorOnIterators< const SMDS_MeshElement*,
|
||||||
|
vector< SMDS_ElemIteratorPtr > > TVecIterator;
|
||||||
|
elemIt.reset( new TVecIterator( elemItVec ));
|
||||||
|
}
|
||||||
|
|
||||||
const SMDS_MeshElement* elem = elemIt->next();
|
const SMDS_MeshElement* elem = elemIt->next();
|
||||||
while ( elem )
|
while ( elem )
|
||||||
{
|
{
|
||||||
@ -397,6 +420,15 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
elem = elemIt->more() ? elemIt->next() : 0;
|
elem = elemIt->more() ? elemIt->next() : 0;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
else // skip NOT SUPPORTED elements
|
||||||
|
{
|
||||||
|
while ( elemIt->more() )
|
||||||
|
{
|
||||||
|
elem = elemIt->next();
|
||||||
|
if ( elem->GetEntityType() != elemType )
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SMESH_Comment sectionName( cg_ElementTypeName( cgType ));
|
SMESH_Comment sectionName( cg_ElementTypeName( cgType ));
|
||||||
sectionName << " " << startID << " - " << cgID-1;
|
sectionName << " " << startID << " - " << cgID-1;
|
||||||
@ -405,6 +437,7 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
cgID-1, /*nbndry=*/0, &elemData[0], &iSec) != CG_OK )
|
cgID-1, /*nbndry=*/0, &elemData[0], &iSec) != CG_OK )
|
||||||
return addMessage( cg_get_error(), /*fatal = */true );
|
return addMessage( cg_get_error(), /*fatal = */true );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write polyhedral volumes
|
// Write polyhedral volumes
|
||||||
// -------------------------
|
// -------------------------
|
||||||
|
|
||||||
@ -534,21 +567,33 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
switch ( meshDim ) {
|
switch ( meshDim ) {
|
||||||
case 3:
|
case 3:
|
||||||
switch ( group->GetType() ) {
|
switch ( group->GetType() ) {
|
||||||
case SMDSAbs_Volume: location = CGNS_ENUMV( FaceCenter ); break; // !!!
|
#if CGNS_VERSION > 3130
|
||||||
case SMDSAbs_Face: location = CGNS_ENUMV( FaceCenter ); break; // OK
|
case SMDSAbs_Volume: location = CGNS_ENUMV( CellCenter ); break;
|
||||||
case SMDSAbs_Edge: location = CGNS_ENUMV( EdgeCenter ); break; // OK
|
#else
|
||||||
|
case SMDSAbs_Volume: location = CGNS_ENUMV( FaceCenter ); break;
|
||||||
|
#endif
|
||||||
|
case SMDSAbs_Face: location = CGNS_ENUMV( FaceCenter ); break;
|
||||||
|
case SMDSAbs_Edge: location = CGNS_ENUMV( EdgeCenter ); break;
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
switch ( group->GetType() ) {
|
switch ( group->GetType() ) {
|
||||||
case SMDSAbs_Face: location = CGNS_ENUMV( FaceCenter ); break; // ???
|
#if CGNS_VERSION > 3130
|
||||||
case SMDSAbs_Edge: location = CGNS_ENUMV( EdgeCenter ); break; // OK
|
case SMDSAbs_Face: location = CGNS_ENUMV( CellCenter ); break;
|
||||||
|
#else
|
||||||
|
case SMDSAbs_Face: location = CGNS_ENUMV( FaceCenter ); break;
|
||||||
|
#endif
|
||||||
|
case SMDSAbs_Edge: location = CGNS_ENUMV( EdgeCenter ); break;
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
location = CGNS_ENUMV( EdgeCenter ); break; // ???
|
#if CGNS_VERSION > 3130
|
||||||
|
location = CGNS_ENUMV( CellCenter ); break;
|
||||||
|
#else
|
||||||
|
location = CGNS_ENUMV( EdgeCenter ); break;
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -556,9 +601,16 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
// try to extract type of boundary condition from the group name
|
// try to extract type of boundary condition from the group name
|
||||||
string name = group->GetStoreName();
|
string name = group->GetStoreName();
|
||||||
CGNS_ENUMT( BCType_t ) bcType = getBCType( name );
|
CGNS_ENUMT( BCType_t ) bcType = getBCType( name );
|
||||||
while ( !groupNames.insert( name ).second )
|
if ( !groupNames.insert( name ).second ) // assure name uniqueness
|
||||||
name = (SMESH_Comment( "Group_") << groupNames.size());
|
{
|
||||||
|
int index = 1;
|
||||||
|
string newName;
|
||||||
|
do {
|
||||||
|
newName = SMESH_Comment( name ) << "_" << index++;
|
||||||
|
}
|
||||||
|
while ( !groupNames.insert( newName ).second );
|
||||||
|
name = newName;
|
||||||
|
}
|
||||||
// write IDs of elements
|
// write IDs of elements
|
||||||
vector< cgsize_t > pnts;
|
vector< cgsize_t > pnts;
|
||||||
pnts.reserve( group->Extent() );
|
pnts.reserve( group->Extent() );
|
||||||
@ -568,13 +620,15 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
const SMDS_MeshElement* elem = elemIt->next();
|
const SMDS_MeshElement* elem = elemIt->next();
|
||||||
pnts.push_back( cgnsID( elem, elem2cgIDByEntity[ elem->GetEntityType() ]));
|
pnts.push_back( cgnsID( elem, elem2cgIDByEntity[ elem->GetEntityType() ]));
|
||||||
}
|
}
|
||||||
|
if ( pnts.size() == 0 )
|
||||||
|
continue; // can't store empty group
|
||||||
int iBC;
|
int iBC;
|
||||||
if ( cg_boco_write( _fn, iBase, iZone, name.c_str(), bcType,
|
if ( cg_boco_write( _fn, iBase, iZone, name.c_str(), bcType,
|
||||||
CGNS_ENUMV( PointList ), pnts.size(), &pnts[0], &iBC) != CG_OK )
|
CGNS_ENUMV( PointList ), pnts.size(), &pnts[0], &iBC) != CG_OK )
|
||||||
return addMessage( cg_get_error(), /*fatal = */true);
|
return addMessage( cg_get_error(), /*fatal = */true);
|
||||||
|
|
||||||
// write BC location
|
// write BC location
|
||||||
if ( location != CGNS_ENUMV( Vertex ))
|
if ( location != CGNS_ENUMV( Vertex ) || meshDim == 1 )
|
||||||
{
|
{
|
||||||
if ( cg_boco_gridlocation_write( _fn, iBase, iZone, iBC, location) != CG_OK )
|
if ( cg_boco_gridlocation_write( _fn, iBase, iZone, iBC, location) != CG_OK )
|
||||||
return addMessage( cg_get_error(), /*fatal = */false);
|
return addMessage( cg_get_error(), /*fatal = */false);
|
||||||
@ -589,7 +643,7 @@ Driver_Mesh::Status DriverCGNS_Write::Perform()
|
|||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
DriverCGNS_Write::DriverCGNS_Write(): _fn(0)
|
DriverCGNS_Write::DriverCGNS_Write(): _fn(0), _elementsByType( false )
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,9 +45,16 @@ public:
|
|||||||
|
|
||||||
virtual Status Perform();
|
virtual Status Perform();
|
||||||
|
|
||||||
|
// to export elements either in the order of their IDs or by geometric type
|
||||||
|
void SetElementsByType( bool isByType ) { _elementsByType = isByType; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
int _fn; //!< file index
|
int _fn; //!< file index
|
||||||
|
|
||||||
|
// if true all elements of same geometry are exported at ones,
|
||||||
|
// else elements are exported in order of their IDs
|
||||||
|
bool _elementsByType;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -93,7 +93,7 @@ DriverMED_Family
|
|||||||
return myType;
|
return myType;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::set< SMDSAbs_ElementType >&
|
const ElemTypeSet&
|
||||||
DriverMED_Family
|
DriverMED_Family
|
||||||
::GetTypes() const
|
::GetTypes() const
|
||||||
{
|
{
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
#include "SMESHDS_SubMesh.hxx"
|
#include "SMESHDS_SubMesh.hxx"
|
||||||
#include "MED_Common.hxx"
|
#include "MED_Common.hxx"
|
||||||
|
|
||||||
|
#include <boost/container/flat_set.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
@ -58,10 +59,11 @@
|
|||||||
#define NIG_BALL_FAMILY INT_MAX-5
|
#define NIG_BALL_FAMILY INT_MAX-5
|
||||||
#define NIG_GROUP_PREFIX "NOT_IN_GRP"
|
#define NIG_GROUP_PREFIX "NOT_IN_GRP"
|
||||||
|
|
||||||
typedef std::list<DriverMED_FamilyPtr > DriverMED_FamilyPtrList;
|
typedef std::list<DriverMED_FamilyPtr > DriverMED_FamilyPtrList;
|
||||||
typedef std::map<int,SMESHDS_SubMesh* > SMESHDS_SubMeshPtrMap;
|
typedef std::map<int,SMESHDS_SubMesh* > SMESHDS_SubMeshPtrMap;
|
||||||
typedef std::list<SMESHDS_GroupBase* > SMESHDS_GroupBasePtrList;
|
typedef std::list<SMESHDS_GroupBase* > SMESHDS_GroupBasePtrList;
|
||||||
typedef std::set<const SMDS_MeshElement*,TIDCompare > ElementsSet;
|
typedef std::set<const SMDS_MeshElement*,TIDCompare > ElementsSet;
|
||||||
|
typedef boost::container::flat_set< SMDSAbs_ElementType > ElemTypeSet;
|
||||||
|
|
||||||
class MESHDRIVERMED_EXPORT DriverMED_Family
|
class MESHDRIVERMED_EXPORT DriverMED_Family
|
||||||
{
|
{
|
||||||
@ -113,7 +115,7 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
|
|||||||
|
|
||||||
void SetType(const SMDSAbs_ElementType theType);
|
void SetType(const SMDSAbs_ElementType theType);
|
||||||
SMDSAbs_ElementType GetType();
|
SMDSAbs_ElementType GetType();
|
||||||
const std::set< SMDSAbs_ElementType >& GetTypes() const;
|
const ElemTypeSet& GetTypes() const;
|
||||||
|
|
||||||
bool MemberOf(std::string theGroupName) const;
|
bool MemberOf(std::string theGroupName) const;
|
||||||
|
|
||||||
@ -126,9 +128,8 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
|
|||||||
|
|
||||||
//! Split <theSubMesh> on some parts (families) on the basis of the elements type.
|
//! Split <theSubMesh> on some parts (families) on the basis of the elements type.
|
||||||
static
|
static
|
||||||
DriverMED_FamilyPtrList
|
DriverMED_FamilyPtrList SplitByType(SMESHDS_SubMesh* theSubMesh,
|
||||||
SplitByType(SMESHDS_SubMesh* theSubMesh,
|
const int theId);
|
||||||
const int theId);
|
|
||||||
|
|
||||||
|
|
||||||
/*! Remove from <Elements> elements, common with <by>,
|
/*! Remove from <Elements> elements, common with <by>,
|
||||||
@ -143,12 +144,12 @@ class MESHDRIVERMED_EXPORT DriverMED_Family
|
|||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int myId;
|
int myId;
|
||||||
SMDSAbs_ElementType myType;
|
SMDSAbs_ElementType myType;
|
||||||
ElementsSet myElements;
|
ElementsSet myElements;
|
||||||
MED::TStringSet myGroupNames;
|
MED::TStringSet myGroupNames;
|
||||||
int myGroupAttributVal;
|
int myGroupAttributVal;
|
||||||
std::set<SMDSAbs_ElementType> myTypes; // Issue 0020576
|
ElemTypeSet myTypes; // Issue 0020576
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -493,6 +493,7 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
|
|||||||
case ePYRA13: aNbNodes = 13; break;
|
case ePYRA13: aNbNodes = 13; break;
|
||||||
case ePENTA6: aNbNodes = 6; break;
|
case ePENTA6: aNbNodes = 6; break;
|
||||||
case ePENTA15: aNbNodes = 15; break;
|
case ePENTA15: aNbNodes = 15; break;
|
||||||
|
case ePENTA18: aNbNodes = 18; break;
|
||||||
case eHEXA8: aNbNodes = 8; break;
|
case eHEXA8: aNbNodes = 8; break;
|
||||||
case eHEXA20: aNbNodes = 20; break;
|
case eHEXA20: aNbNodes = 20; break;
|
||||||
case eHEXA27: aNbNodes = 27; break;
|
case eHEXA27: aNbNodes = 27; break;
|
||||||
@ -811,6 +812,41 @@ Driver_Mesh::Status DriverMED_R_SMESHDS_Mesh::Perform()
|
|||||||
isRenum = anIsElemNum;
|
isRenum = anIsElemNum;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ePENTA18:
|
||||||
|
aNbNodes = 18;
|
||||||
|
if(anIsElemNum)
|
||||||
|
anElement = myMesh->AddVolumeWithID(aNodeIds[0], aNodeIds[1],
|
||||||
|
aNodeIds[2], aNodeIds[3],
|
||||||
|
aNodeIds[4], aNodeIds[5],
|
||||||
|
aNodeIds[6], aNodeIds[7],
|
||||||
|
aNodeIds[8], aNodeIds[9],
|
||||||
|
aNodeIds[10], aNodeIds[11],
|
||||||
|
aNodeIds[12], aNodeIds[13],
|
||||||
|
aNodeIds[14], aNodeIds[15],
|
||||||
|
aNodeIds[16], aNodeIds[17],
|
||||||
|
aCellInfo->GetElemNum(iElem));
|
||||||
|
if (!anElement) {
|
||||||
|
anElement = myMesh->AddVolume(FindNode(myMesh,aNodeIds[0]),
|
||||||
|
FindNode(myMesh,aNodeIds[1]),
|
||||||
|
FindNode(myMesh,aNodeIds[2]),
|
||||||
|
FindNode(myMesh,aNodeIds[3]),
|
||||||
|
FindNode(myMesh,aNodeIds[4]),
|
||||||
|
FindNode(myMesh,aNodeIds[5]),
|
||||||
|
FindNode(myMesh,aNodeIds[6]),
|
||||||
|
FindNode(myMesh,aNodeIds[7]),
|
||||||
|
FindNode(myMesh,aNodeIds[8]),
|
||||||
|
FindNode(myMesh,aNodeIds[9]),
|
||||||
|
FindNode(myMesh,aNodeIds[10]),
|
||||||
|
FindNode(myMesh,aNodeIds[11]),
|
||||||
|
FindNode(myMesh,aNodeIds[12]),
|
||||||
|
FindNode(myMesh,aNodeIds[13]),
|
||||||
|
FindNode(myMesh,aNodeIds[14]),
|
||||||
|
FindNode(myMesh,aNodeIds[15]),
|
||||||
|
FindNode(myMesh,aNodeIds[16]),
|
||||||
|
FindNode(myMesh,aNodeIds[17]));
|
||||||
|
isRenum = anIsElemNum;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case eHEXA8:
|
case eHEXA8:
|
||||||
aNbNodes = 8;
|
aNbNodes = 8;
|
||||||
if(anIsElemNum)
|
if(anIsElemNum)
|
||||||
@ -1056,8 +1092,8 @@ list<TNameAndType> DriverMED_R_SMESHDS_Mesh::GetGroupNamesAndTypes()
|
|||||||
set<string>::const_iterator aGrNamesIter = aGroupNames.begin();
|
set<string>::const_iterator aGrNamesIter = aGroupNames.begin();
|
||||||
for (; aGrNamesIter != aGroupNames.end(); aGrNamesIter++)
|
for (; aGrNamesIter != aGroupNames.end(); aGrNamesIter++)
|
||||||
{
|
{
|
||||||
const set< SMDSAbs_ElementType >& types = aFamily->GetTypes();
|
const ElemTypeSet& types = aFamily->GetTypes();
|
||||||
set< SMDSAbs_ElementType >::const_iterator type = types.begin();
|
ElemTypeSet::const_iterator type = types.begin();
|
||||||
for ( ; type != types.end(); ++type )
|
for ( ; type != types.end(); ++type )
|
||||||
{
|
{
|
||||||
TNameAndType aNameAndType = make_pair( *aGrNamesIter, *type );
|
TNameAndType aNameAndType = make_pair( *aGrNamesIter, *type );
|
||||||
@ -1073,28 +1109,51 @@ list<TNameAndType> DriverMED_R_SMESHDS_Mesh::GetGroupNamesAndTypes()
|
|||||||
|
|
||||||
void DriverMED_R_SMESHDS_Mesh::GetGroup(SMESHDS_Group* theGroup)
|
void DriverMED_R_SMESHDS_Mesh::GetGroup(SMESHDS_Group* theGroup)
|
||||||
{
|
{
|
||||||
string aGroupName (theGroup->GetStoreName());
|
TFamilyVec * famVecPtr;
|
||||||
|
|
||||||
|
if ( myGroups2FamiliesMap.IsEmpty() ) // PAL23514
|
||||||
|
{
|
||||||
|
TFamilyVec famVector( 1 );
|
||||||
|
map<int, DriverMED_FamilyPtr>::iterator famIter = myFamilies.begin();
|
||||||
|
for ( ; famIter != myFamilies.end(); famIter++ )
|
||||||
|
{
|
||||||
|
DriverMED_FamilyPtr family = famIter->second;
|
||||||
|
const MED::TStringSet& groups = family->GetGroupNames();
|
||||||
|
famVector[ 0 ] = family;
|
||||||
|
MED::TStringSet::const_iterator grpIter = groups.begin();
|
||||||
|
for ( ; grpIter != groups.end(); ++grpIter )
|
||||||
|
{
|
||||||
|
TCollection_AsciiString groupName = grpIter->c_str();
|
||||||
|
if (( famVecPtr = myGroups2FamiliesMap.ChangeSeek( groupName )))
|
||||||
|
famVecPtr->push_back( family );
|
||||||
|
else
|
||||||
|
myGroups2FamiliesMap.Bind( groupName, famVector );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* aGroupName = theGroup->GetStoreName();
|
||||||
if(MYDEBUG) MESSAGE("Get Group " << aGroupName);
|
if(MYDEBUG) MESSAGE("Get Group " << aGroupName);
|
||||||
|
|
||||||
map<int, DriverMED_FamilyPtr>::iterator aFamsIter = myFamilies.begin();
|
if (( famVecPtr = myGroups2FamiliesMap.ChangeSeek( aGroupName )))
|
||||||
for (; aFamsIter != myFamilies.end(); aFamsIter++)
|
|
||||||
{
|
{
|
||||||
DriverMED_FamilyPtr aFamily = (*aFamsIter).second;
|
for ( size_t i = 0; i < famVecPtr->size(); ++i )
|
||||||
if (aFamily->GetTypes().count( theGroup->GetType() ) && aFamily->MemberOf(aGroupName))
|
|
||||||
{
|
{
|
||||||
const ElementsSet& anElements = aFamily->GetElements();
|
DriverMED_FamilyPtr aFamily = (*famVecPtr)[i];
|
||||||
ElementsSet::const_iterator anElemsIter = anElements.begin();
|
if ( aFamily->GetTypes().count( theGroup->GetType() ))
|
||||||
for (; anElemsIter != anElements.end(); anElemsIter++)
|
|
||||||
{
|
{
|
||||||
const SMDS_MeshElement * element = *anElemsIter;
|
const ElementsSet& anElements = aFamily->GetElements();
|
||||||
if ( element->GetType() == theGroup->GetType() ) // Issue 0020576
|
ElementsSet::const_iterator anElemsIter = anElements.begin();
|
||||||
theGroup->SMDSGroup().Add(element);
|
for (; anElemsIter != anElements.end(); anElemsIter++)
|
||||||
|
{
|
||||||
|
const SMDS_MeshElement * element = *anElemsIter;
|
||||||
|
if ( element->GetType() == theGroup->GetType() ) // Issue 0020576
|
||||||
|
theGroup->SMDSGroup().Add(element);
|
||||||
|
}
|
||||||
|
int aGroupAttrVal = aFamily->GetGroupAttributVal();
|
||||||
|
if( aGroupAttrVal != 0 )
|
||||||
|
theGroup->SetColorGroup(aGroupAttrVal);
|
||||||
}
|
}
|
||||||
int aGroupAttrVal = aFamily->GetGroupAttributVal();
|
|
||||||
if( aGroupAttrVal != 0)
|
|
||||||
theGroup->SetColorGroup(aGroupAttrVal);
|
|
||||||
// if ( element ) -- Issue 0020576
|
|
||||||
// theGroup->SetType( theGroup->SMDSGroup().GetType() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -36,11 +36,16 @@
|
|||||||
#include <list>
|
#include <list>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
|
#include <NCollection_DataMap.hxx>
|
||||||
|
#include <TCollection_AsciiString.hxx>
|
||||||
|
|
||||||
class SMESHDS_Mesh;
|
class SMESHDS_Mesh;
|
||||||
class SMESHDS_Group;
|
class SMESHDS_Group;
|
||||||
class SMESHDS_SubMesh;
|
class SMESHDS_SubMesh;
|
||||||
|
|
||||||
typedef std::pair< std::string, SMDSAbs_ElementType > TNameAndType;
|
typedef std::vector< DriverMED_FamilyPtr > TFamilyVec;
|
||||||
|
typedef std::pair< std::string, SMDSAbs_ElementType > TNameAndType;
|
||||||
|
typedef NCollection_DataMap< TCollection_AsciiString, TFamilyVec > TName2Falilies;
|
||||||
|
|
||||||
class MESHDRIVERMED_EXPORT DriverMED_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
|
class MESHDRIVERMED_EXPORT DriverMED_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
|
||||||
{
|
{
|
||||||
@ -56,9 +61,9 @@ class MESHDRIVERMED_EXPORT DriverMED_R_SMESHDS_Mesh: public Driver_SMESHDS_Mesh
|
|||||||
void SetMeshName(std::string theMeshName);
|
void SetMeshName(std::string theMeshName);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string myMeshName;
|
std::string myMeshName;
|
||||||
std::map<int, DriverMED_FamilyPtr> myFamilies;
|
std::map<int, DriverMED_FamilyPtr> myFamilies;
|
||||||
|
TName2Falilies myGroups2FamiliesMap;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -393,6 +393,7 @@ namespace DriverMED // Implemetation of fuctions declared in DriverMED.hxx
|
|||||||
theVec[ SMDSEntity_TriQuad_Hexa ] = MED::eHEXA27 ;
|
theVec[ SMDSEntity_TriQuad_Hexa ] = MED::eHEXA27 ;
|
||||||
theVec[ SMDSEntity_Penta ] = MED::ePENTA6 ;
|
theVec[ SMDSEntity_Penta ] = MED::ePENTA6 ;
|
||||||
theVec[ SMDSEntity_Quad_Penta ] = MED::ePENTA15 ;
|
theVec[ SMDSEntity_Quad_Penta ] = MED::ePENTA15 ;
|
||||||
|
theVec[ SMDSEntity_BiQuad_Penta ] = MED::ePENTA18 ;
|
||||||
theVec[ SMDSEntity_Hexagonal_Prism ] = MED::eOCTA12 ;
|
theVec[ SMDSEntity_Hexagonal_Prism ] = MED::eOCTA12 ;
|
||||||
theVec[ SMDSEntity_Polyhedra ] = MED::ePOLYEDRE;
|
theVec[ SMDSEntity_Polyhedra ] = MED::ePOLYEDRE;
|
||||||
//theVec[ SMDSEntity_Quad_Polyhedra ] = MED::ePOLYEDRE; // !!
|
//theVec[ SMDSEntity_Quad_Polyhedra ] = MED::ePOLYEDRE; // !!
|
||||||
|
@ -677,7 +677,11 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
|
|||||||
SMDSAbs_Volume));
|
SMDSAbs_Volume));
|
||||||
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
|
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
|
||||||
ePENTA15,
|
ePENTA15,
|
||||||
nbElemInfo.NbPrisms( ORDER_QUADRATIC ),
|
nbElemInfo.NbQuadPrisms(),
|
||||||
|
SMDSAbs_Volume));
|
||||||
|
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
|
||||||
|
ePENTA18,
|
||||||
|
nbElemInfo.NbBiQuadPrisms(),
|
||||||
SMDSAbs_Volume));
|
SMDSAbs_Volume));
|
||||||
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
|
aTElemTypeDatas.push_back( TElemTypeData(anEntity,
|
||||||
eHEXA8,
|
eHEXA8,
|
||||||
@ -729,6 +733,13 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// build map of family numbers for this type
|
||||||
|
if ( !isElemFamMapBuilt[ aElemTypeData->_smdsType ])
|
||||||
|
{
|
||||||
|
fillElemFamilyMap( anElemFamMap, aFamilies, aElemTypeData->_smdsType );
|
||||||
|
isElemFamMapBuilt[ aElemTypeData->_smdsType ] = true;
|
||||||
|
}
|
||||||
|
|
||||||
// iterator on elements of a current type
|
// iterator on elements of a current type
|
||||||
SMDS_ElemIteratorPtr elemIterator;
|
SMDS_ElemIteratorPtr elemIterator;
|
||||||
int iElem = 0;
|
int iElem = 0;
|
||||||
@ -802,7 +813,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
|
|||||||
else if (aElemTypeData->_geomType == ePOLYEDRE )
|
else if (aElemTypeData->_geomType == ePOLYEDRE )
|
||||||
{
|
{
|
||||||
elemIterator = myMesh->elementGeomIterator( SMDSGeom_POLYHEDRA );
|
elemIterator = myMesh->elementGeomIterator( SMDSGeom_POLYHEDRA );
|
||||||
|
|
||||||
if ( nbPolyhedronNodes == 0 ) {
|
if ( nbPolyhedronNodes == 0 ) {
|
||||||
// Count nb of nodes
|
// Count nb of nodes
|
||||||
while ( elemIterator->more() ) {
|
while ( elemIterator->more() ) {
|
||||||
@ -879,13 +890,6 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
|
|||||||
// allocate data arrays
|
// allocate data arrays
|
||||||
PBallInfo aBallInfo = myMed->CrBallInfo( aMeshInfo, aElemTypeData->_nbElems );
|
PBallInfo aBallInfo = myMed->CrBallInfo( aMeshInfo, aElemTypeData->_nbElems );
|
||||||
|
|
||||||
// build map of family numbers for this type
|
|
||||||
if ( !isElemFamMapBuilt[ aElemTypeData->_smdsType ])
|
|
||||||
{
|
|
||||||
fillElemFamilyMap( anElemFamMap, aFamilies, aElemTypeData->_smdsType );
|
|
||||||
isElemFamMapBuilt[ aElemTypeData->_smdsType ] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
elemIterator = myMesh->elementsIterator( SMDSAbs_Ball );
|
elemIterator = myMesh->elementsIterator( SMDSAbs_Ball );
|
||||||
while ( elemIterator->more() )
|
while ( elemIterator->more() )
|
||||||
{
|
{
|
||||||
@ -917,7 +921,6 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
|
|||||||
{
|
{
|
||||||
// Treat standard types
|
// Treat standard types
|
||||||
// ---------------------
|
// ---------------------
|
||||||
|
|
||||||
// allocate data arrays
|
// allocate data arrays
|
||||||
PCellInfo aCellInfo = myMed->CrCellInfo( aMeshInfo,
|
PCellInfo aCellInfo = myMed->CrCellInfo( aMeshInfo,
|
||||||
aElemTypeData->_entity,
|
aElemTypeData->_entity,
|
||||||
@ -926,13 +929,6 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
|
|||||||
theConnMode,
|
theConnMode,
|
||||||
theIsElemNum,
|
theIsElemNum,
|
||||||
theIsElemNames);
|
theIsElemNames);
|
||||||
// build map of family numbers for this type
|
|
||||||
if ( !isElemFamMapBuilt[ aElemTypeData->_smdsType ])
|
|
||||||
{
|
|
||||||
//cout << " fillElemFamilyMap()" << endl;
|
|
||||||
fillElemFamilyMap( anElemFamMap, aFamilies, aElemTypeData->_smdsType );
|
|
||||||
isElemFamMapBuilt[ aElemTypeData->_smdsType ] = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
TInt aNbNodes = MED::GetNbNodes(aElemTypeData->_geomType);
|
TInt aNbNodes = MED::GetNbNodes(aElemTypeData->_geomType);
|
||||||
elemIterator = myMesh->elementsIterator( aElemTypeData->_smdsType );
|
elemIterator = myMesh->elementsIterator( aElemTypeData->_smdsType );
|
||||||
@ -967,10 +963,7 @@ Driver_Mesh::Status DriverMED_W_SMESHDS_Mesh::Perform()
|
|||||||
// store data in a file
|
// store data in a file
|
||||||
myMed->SetCellInfo(aCellInfo);
|
myMed->SetCellInfo(aCellInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // loop on geom types
|
} // loop on geom types
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
catch(const std::exception& exc) {
|
catch(const std::exception& exc) {
|
||||||
INFOS("The following exception was caught:\n\t"<<exc.what());
|
INFOS("The following exception was caught:\n\t"<<exc.what());
|
||||||
|
@ -62,7 +62,7 @@ namespace MED
|
|||||||
typedef enum {ePOINT1=1, eSEG2=102, eSEG3=103, eTRIA3=203,
|
typedef enum {ePOINT1=1, eSEG2=102, eSEG3=103, eTRIA3=203,
|
||||||
eQUAD4=204, eTRIA6=206, eTRIA7=207, eQUAD8=208, eQUAD9=209, eTETRA4=304,
|
eQUAD4=204, eTRIA6=206, eTRIA7=207, eQUAD8=208, eQUAD9=209, eTETRA4=304,
|
||||||
ePYRA5=305, ePENTA6=306, eHEXA8=308, eOCTA12=312, eTETRA10=310,
|
ePYRA5=305, ePENTA6=306, eHEXA8=308, eOCTA12=312, eTETRA10=310,
|
||||||
ePYRA13=313, ePENTA15=315, eHEXA20=320, eHEXA27=327,
|
ePYRA13=313, ePENTA15=315, ePENTA18=318, eHEXA20=320, eHEXA27=327,
|
||||||
ePOLYGONE=400, ePOLYGON2=420, ePOLYEDRE=500, eNONE=0,
|
ePOLYGONE=400, ePOLYGON2=420, ePOLYEDRE=500, eNONE=0,
|
||||||
eBALL=1101, // no such a type in med.h, it's just a trick
|
eBALL=1101, // no such a type in med.h, it's just a trick
|
||||||
eAllGeoType=-1} EGeometrieElement;
|
eAllGeoType=-1} EGeometrieElement;
|
||||||
|
@ -183,7 +183,7 @@ namespace MED
|
|||||||
typedef SharedPtr<TElemNum> PElemNum;
|
typedef SharedPtr<TElemNum> PElemNum;
|
||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
//! Define a parent class for all MED entities that describes mesh entites such as nodes and cells.
|
//! Define a parent class for all MED entities that describes mesh entities such as nodes and cells.
|
||||||
struct MEDWRAPPER_EXPORT TElemInfo: virtual TBase
|
struct MEDWRAPPER_EXPORT TElemInfo: virtual TBase
|
||||||
{
|
{
|
||||||
PMeshInfo myMeshInfo; //!< A reference to correspondig MED Mesh
|
PMeshInfo myMeshInfo; //!< A reference to correspondig MED Mesh
|
||||||
@ -219,7 +219,7 @@ namespace MED
|
|||||||
|
|
||||||
//! Defines if the mesh elements are named
|
//! Defines if the mesh elements are named
|
||||||
EBooleen myIsElemNames;
|
EBooleen myIsElemNames;
|
||||||
//! Let know if the mesh elements havew names
|
//! Let know if the mesh elements have names
|
||||||
EBooleen IsElemNames() const { return myIsElemNames; }
|
EBooleen IsElemNames() const { return myIsElemNames; }
|
||||||
|
|
||||||
//! Contains sequence of the names for the mesh elements
|
//! Contains sequence of the names for the mesh elements
|
||||||
@ -1041,7 +1041,7 @@ namespace MED
|
|||||||
void SetGrilleStructure(TInt theAxis,TInt theNb);
|
void SetGrilleStructure(TInt theAxis,TInt theNb);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
*Defines sequence MED Family indexes for corresponding mesh entites
|
*Defines sequence MED Family indexes for corresponding mesh entities
|
||||||
*/
|
*/
|
||||||
TElemNum myFamNum;
|
TElemNum myFamNum;
|
||||||
//! Get number of a MED FAMILY by order number of the mesh element
|
//! Get number of a MED FAMILY by order number of the mesh element
|
||||||
@ -1050,7 +1050,7 @@ namespace MED
|
|||||||
void SetFamNum(TInt theId, TInt theVal);
|
void SetFamNum(TInt theId, TInt theVal);
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
*Defines sequence MED Family indexes for sub entites
|
*Defines sequence MED Family indexes for sub entities
|
||||||
*/
|
*/
|
||||||
TElemNum myFamSubNum;
|
TElemNum myFamSubNum;
|
||||||
//! Get number of a MED FAMILY by order number of sub element
|
//! Get number of a MED FAMILY by order number of sub element
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#pragma warning(disable:4250)
|
#pragma warning(disable:4250)
|
||||||
#endif
|
#endif
|
||||||
|
#include <utilities.h>
|
||||||
namespace MED
|
namespace MED
|
||||||
{
|
{
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
|
@ -279,6 +279,7 @@ SMESH_ActorDef::SMESH_ActorDef()
|
|||||||
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
||||||
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
||||||
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
||||||
|
aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
|
||||||
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
||||||
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
||||||
aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
||||||
@ -310,6 +311,7 @@ SMESH_ActorDef::SMESH_ActorDef()
|
|||||||
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
||||||
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
||||||
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
||||||
|
aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
|
||||||
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
||||||
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
||||||
aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
||||||
@ -842,11 +844,9 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case eLength2D:
|
case eLength2D:
|
||||||
{
|
|
||||||
myFunctor.reset(new SMESH::Controls::Length2D());
|
myFunctor.reset(new SMESH::Controls::Length2D());
|
||||||
myControlActor = my2DActor;
|
myControlActor = my2DActor;
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
case eFreeBorders:
|
case eFreeBorders:
|
||||||
myFunctor.reset(new SMESH::Controls::FreeBorders());
|
myFunctor.reset(new SMESH::Controls::FreeBorders());
|
||||||
myControlActor = my1DActor;
|
myControlActor = my1DActor;
|
||||||
@ -956,6 +956,14 @@ void SMESH_ActorDef::SetControlMode( eControl theMode, bool theCheckEntityMode )
|
|||||||
myControlActor = my3DActor;
|
myControlActor = my3DActor;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case eDeflection2D:
|
||||||
|
{
|
||||||
|
SMESH::Controls::Deflection2D* aControl = new SMESH::Controls::Deflection2D();
|
||||||
|
aControl->SetPrecision( myControlsPrecision );
|
||||||
|
myFunctor.reset( aControl );
|
||||||
|
myControlActor = my2DActor;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case eBareBorderVolume:
|
case eBareBorderVolume:
|
||||||
{
|
{
|
||||||
myFunctor.reset(new SMESH::Controls::BareBorderVolume());
|
myFunctor.reset(new SMESH::Controls::BareBorderVolume());
|
||||||
@ -1430,6 +1438,10 @@ double* SMESH_ActorDef::GetNodeCoord(int theObjID)
|
|||||||
return myPickableActor->GetNodeCoord(theObjID);
|
return myPickableActor->GetNodeCoord(theObjID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SMESH_ActorDef::GetNodeVtkId(int theObjID)
|
||||||
|
{
|
||||||
|
return myPickableActor->GetNodeVtkId(theObjID);
|
||||||
|
}
|
||||||
|
|
||||||
int SMESH_ActorDef::GetElemObjId(int theVtkID)
|
int SMESH_ActorDef::GetElemObjId(int theVtkID)
|
||||||
{
|
{
|
||||||
@ -1683,6 +1695,7 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
|
|||||||
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
aFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
||||||
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
||||||
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
aFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
||||||
|
aFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
|
||||||
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
aFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
||||||
aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
aFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
||||||
|
|
||||||
@ -1696,6 +1709,7 @@ void SMESH_ActorDef::SetEntityMode(unsigned int theMode)
|
|||||||
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_HEXAHEDRON);
|
||||||
aHltFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
aHltFilter->RegisterCellsWithType(VTK_TRIQUADRATIC_HEXAHEDRON);
|
||||||
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_WEDGE);
|
||||||
|
aHltFilter->RegisterCellsWithType(VTK_BIQUADRATIC_QUADRATIC_WEDGE);
|
||||||
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
aHltFilter->RegisterCellsWithType(VTK_QUADRATIC_PYRAMID);
|
||||||
aHltFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
aHltFilter->RegisterCellsWithType(VTK_CONVEX_POINT_SET);
|
||||||
aHltFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
aHltFilter->RegisterCellsWithType(VTK_POLYHEDRON);
|
||||||
|
@ -141,7 +141,7 @@ class SMESHOBJECT_EXPORT SMESH_Actor: public SALOME_Actor
|
|||||||
virtual void SetFacesOrientation3DVectors(bool theState) = 0;
|
virtual void SetFacesOrientation3DVectors(bool theState) = 0;
|
||||||
virtual bool GetFacesOrientation3DVectors() = 0;
|
virtual bool GetFacesOrientation3DVectors() = 0;
|
||||||
|
|
||||||
enum eControl{eNone, eLength, eLength2D, eFreeBorders, eFreeEdges, eFreeNodes,
|
enum eControl{eNone, eLength, eLength2D, eDeflection2D, eFreeBorders, eFreeEdges, eFreeNodes,
|
||||||
eFreeFaces, eMultiConnection, eArea, eTaper, eAspectRatio,
|
eFreeFaces, eMultiConnection, eArea, eTaper, eAspectRatio,
|
||||||
eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D,
|
eMinimumAngle, eWarping, eSkew, eAspectRatio3D, eMultiConnection2D, eVolume3D,
|
||||||
eMaxElementLength2D, eMaxElementLength3D, eBareBorderFace, eBareBorderVolume,
|
eMaxElementLength2D, eMaxElementLength3D, eBareBorderFace, eBareBorderVolume,
|
||||||
|
@ -150,6 +150,7 @@ class SMESH_ActorDef : public SMESH_Actor
|
|||||||
|
|
||||||
virtual int GetNodeObjId(int theVtkID);
|
virtual int GetNodeObjId(int theVtkID);
|
||||||
virtual double* GetNodeCoord(int theObjID);
|
virtual double* GetNodeCoord(int theObjID);
|
||||||
|
virtual int GetNodeVtkId(int theObjID);
|
||||||
|
|
||||||
virtual int GetElemObjId(int theVtkID);
|
virtual int GetElemObjId(int theVtkID);
|
||||||
virtual vtkCell* GetElemCell(int theObjID);
|
virtual vtkCell* GetElemCell(int theObjID);
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include <VTKViewer_Transform.h>
|
#include <VTKViewer_Transform.h>
|
||||||
#include <VTKViewer_TransformFilter.h>
|
#include <VTKViewer_TransformFilter.h>
|
||||||
#include <VTKViewer_ExtractUnstructuredGrid.h>
|
#include <VTKViewer_ExtractUnstructuredGrid.h>
|
||||||
|
#include <VTKViewer_Actor.h>
|
||||||
|
|
||||||
// VTK Includes
|
// VTK Includes
|
||||||
#include <vtkObjectFactory.h>
|
#include <vtkObjectFactory.h>
|
||||||
@ -94,8 +95,8 @@ SMESH_DeviceActor
|
|||||||
myMapper = VTKViewer_PolyDataMapper::New();
|
myMapper = VTKViewer_PolyDataMapper::New();
|
||||||
myPlaneCollection = vtkPlaneCollection::New();
|
myPlaneCollection = vtkPlaneCollection::New();
|
||||||
|
|
||||||
vtkMapper::GetResolveCoincidentTopologyPolygonOffsetParameters(myPolygonOffsetFactor,
|
VTKViewer_Actor::GetDefaultPolygonOffsetParameters(myPolygonOffsetFactor,
|
||||||
myPolygonOffsetUnits);
|
myPolygonOffsetUnits);
|
||||||
|
|
||||||
myMapper->UseLookupTableScalarRangeOn();
|
myMapper->UseLookupTableScalarRangeOn();
|
||||||
myMapper->SetColorModeToMapScalars();
|
myMapper->SetColorModeToMapScalars();
|
||||||
@ -860,6 +861,12 @@ SMESH_DeviceActor
|
|||||||
return aCoord;
|
return aCoord;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
SMESH_DeviceActor
|
||||||
|
::GetNodeVtkId(int theObjID)
|
||||||
|
{
|
||||||
|
return myVisualObj->GetNodeVTKId(theObjID);
|
||||||
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
SMESH_DeviceActor
|
SMESH_DeviceActor
|
||||||
|
@ -70,6 +70,7 @@ class SMESHOBJECT_EXPORT SMESH_DeviceActor: public vtkLODActor{
|
|||||||
|
|
||||||
virtual int GetNodeObjId(int theVtkID);
|
virtual int GetNodeObjId(int theVtkID);
|
||||||
virtual double* GetNodeCoord(int theObjID);
|
virtual double* GetNodeCoord(int theObjID);
|
||||||
|
virtual int GetNodeVtkId(int theObjID);
|
||||||
|
|
||||||
virtual int GetElemObjId(int theVtkID);
|
virtual int GetElemObjId(int theVtkID);
|
||||||
virtual vtkCell* GetElemCell(int theObjID);
|
virtual vtkCell* GetElemCell(int theObjID);
|
||||||
|
@ -98,6 +98,7 @@ enum SMDSAbs_EntityType {
|
|||||||
SMDSEntity_TriQuad_Hexa,
|
SMDSEntity_TriQuad_Hexa,
|
||||||
SMDSEntity_Penta,
|
SMDSEntity_Penta,
|
||||||
SMDSEntity_Quad_Penta,
|
SMDSEntity_Quad_Penta,
|
||||||
|
SMDSEntity_BiQuad_Penta,
|
||||||
SMDSEntity_Hexagonal_Prism,
|
SMDSEntity_Hexagonal_Prism,
|
||||||
SMDSEntity_Polyhedra,
|
SMDSEntity_Polyhedra,
|
||||||
SMDSEntity_Quad_Polyhedra,
|
SMDSEntity_Quad_Polyhedra,
|
||||||
|
@ -61,6 +61,7 @@ int SMDS_Downward::getCellDimension(unsigned char cellType)
|
|||||||
_cellDimension[VTK_TRIQUADRATIC_HEXAHEDRON] = 3;
|
_cellDimension[VTK_TRIQUADRATIC_HEXAHEDRON] = 3;
|
||||||
_cellDimension[VTK_WEDGE] = 3;
|
_cellDimension[VTK_WEDGE] = 3;
|
||||||
_cellDimension[VTK_QUADRATIC_WEDGE] = 3;
|
_cellDimension[VTK_QUADRATIC_WEDGE] = 3;
|
||||||
|
_cellDimension[VTK_BIQUADRATIC_QUADRATIC_WEDGE] = 3;
|
||||||
_cellDimension[VTK_PYRAMID] = 3;
|
_cellDimension[VTK_PYRAMID] = 3;
|
||||||
_cellDimension[VTK_QUADRATIC_PYRAMID] = 3;
|
_cellDimension[VTK_QUADRATIC_PYRAMID] = 3;
|
||||||
_cellDimension[VTK_HEXAGONAL_PRISM] = 3;
|
_cellDimension[VTK_HEXAGONAL_PRISM] = 3;
|
||||||
|
@ -1556,9 +1556,15 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeFromVtkIdsWithID(const std::vector<vtkIdTyp
|
|||||||
case VTK_QUADRATIC_WEDGE:
|
case VTK_QUADRATIC_WEDGE:
|
||||||
myInfo.myNbQuadPrisms++;
|
myInfo.myNbQuadPrisms++;
|
||||||
break;
|
break;
|
||||||
|
case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
|
||||||
|
myInfo.myNbBiQuadPrisms++;
|
||||||
|
break;
|
||||||
case VTK_QUADRATIC_HEXAHEDRON:
|
case VTK_QUADRATIC_HEXAHEDRON:
|
||||||
myInfo.myNbQuadHexas++;
|
myInfo.myNbQuadHexas++;
|
||||||
break;
|
break;
|
||||||
|
case VTK_TRIQUADRATIC_HEXAHEDRON:
|
||||||
|
myInfo.myNbTriQuadHexas++;
|
||||||
|
break;
|
||||||
//#ifdef VTK_HAVE_POLYHEDRON
|
//#ifdef VTK_HAVE_POLYHEDRON
|
||||||
case VTK_POLYHEDRON:
|
case VTK_POLYHEDRON:
|
||||||
myInfo.myNbPolyhedrons++;
|
myInfo.myNbPolyhedrons++;
|
||||||
@ -1690,10 +1696,10 @@ const SMDS_MeshNode * SMDS_Mesh::FindNodeVtk(int vtkId) const
|
|||||||
return (const SMDS_MeshNode *)myNodes[vtkId+1];
|
return (const SMDS_MeshNode *)myNodes[vtkId+1];
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
///Create a triangle and add it to the current mesh. This method do not bind an
|
///Create a triangle and add it to the current mesh. This method does not bind
|
||||||
///ID to the create triangle.
|
///an ID to the create triangle.
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////////////
|
||||||
SMDS_MeshFace * SMDS_Mesh::createTriangle(const SMDS_MeshNode * node1,
|
SMDS_MeshFace * SMDS_Mesh::createTriangle(const SMDS_MeshNode * node1,
|
||||||
const SMDS_MeshNode * node2,
|
const SMDS_MeshNode * node2,
|
||||||
const SMDS_MeshNode * node3,
|
const SMDS_MeshNode * node3,
|
||||||
@ -1740,10 +1746,10 @@ SMDS_MeshFace * SMDS_Mesh::createTriangle(const SMDS_MeshNode * node1,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
///Create a quadrangle and add it to the current mesh. This methode do not bind
|
///Create a quadrangle and add it to the current mesh. This method does not bind
|
||||||
///a ID to the create triangle.
|
///an ID to the create triangle.
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
SMDS_MeshFace * SMDS_Mesh::createQuadrangle(const SMDS_MeshNode * node1,
|
SMDS_MeshFace * SMDS_Mesh::createQuadrangle(const SMDS_MeshNode * node1,
|
||||||
const SMDS_MeshNode * node2,
|
const SMDS_MeshNode * node2,
|
||||||
const SMDS_MeshNode * node3,
|
const SMDS_MeshNode * node3,
|
||||||
@ -4210,7 +4216,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AddVolume
|
//function : AddVolume
|
||||||
//purpose :
|
//purpose : 2d order Pentahedron (prism) with 15 nodes
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
|
SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
|
||||||
const SMDS_MeshNode * n2,
|
const SMDS_MeshNode * n2,
|
||||||
@ -4238,7 +4244,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AddVolumeWithID
|
//function : AddVolumeWithID
|
||||||
//purpose :
|
//purpose : 2d order Pentahedron (prism) with 15 nodes
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
|
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
|
||||||
int n4, int n5, int n6,
|
int n4, int n5, int n6,
|
||||||
@ -4267,7 +4273,7 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AddVolumeWithID
|
//function : AddVolumeWithID
|
||||||
//purpose : 2d order Pentahedron with 15 nodes
|
//purpose : 2d order Pentahedron (prism) with 15 nodes
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
||||||
const SMDS_MeshNode * n2,
|
const SMDS_MeshNode * n2,
|
||||||
@ -4334,6 +4340,149 @@ SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
return volvtk;
|
return volvtk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : AddVolume
|
||||||
|
//purpose : 2d order Pentahedron (prism) with 18 nodes
|
||||||
|
//=======================================================================
|
||||||
|
SMDS_MeshVolume* SMDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
|
||||||
|
const SMDS_MeshNode * n2,
|
||||||
|
const SMDS_MeshNode * n3,
|
||||||
|
const SMDS_MeshNode * n4,
|
||||||
|
const SMDS_MeshNode * n5,
|
||||||
|
const SMDS_MeshNode * n6,
|
||||||
|
const SMDS_MeshNode * n12,
|
||||||
|
const SMDS_MeshNode * n23,
|
||||||
|
const SMDS_MeshNode * n31,
|
||||||
|
const SMDS_MeshNode * n45,
|
||||||
|
const SMDS_MeshNode * n56,
|
||||||
|
const SMDS_MeshNode * n64,
|
||||||
|
const SMDS_MeshNode * n14,
|
||||||
|
const SMDS_MeshNode * n25,
|
||||||
|
const SMDS_MeshNode * n36,
|
||||||
|
const SMDS_MeshNode * n1245,
|
||||||
|
const SMDS_MeshNode * n2356,
|
||||||
|
const SMDS_MeshNode * n1346)
|
||||||
|
{
|
||||||
|
//MESSAGE("AddVolume penta18");
|
||||||
|
int ID = myElementIDFactory->GetFreeID();
|
||||||
|
SMDS_MeshVolume * v =
|
||||||
|
SMDS_Mesh::AddVolumeWithID(n1, n2, n3, n4, n5, n6, n12, n23, n31,
|
||||||
|
n45, n56, n64, n14, n25, n36, n1245, n2356, n1346, ID);
|
||||||
|
if(v==NULL) myElementIDFactory->ReleaseID(ID);
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : AddVolumeWithID
|
||||||
|
//purpose : 2d order Pentahedron (prism) with 18 nodes
|
||||||
|
//=======================================================================
|
||||||
|
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
|
||||||
|
int n4, int n5, int n6,
|
||||||
|
int n12,int n23,int n31,
|
||||||
|
int n45,int n56,int n64,
|
||||||
|
int n14,int n25,int n36,
|
||||||
|
int n1245, int n2356, int n1346, int ID)
|
||||||
|
{
|
||||||
|
//MESSAGE("AddVolumeWithID penta18 " << ID);
|
||||||
|
return SMDS_Mesh::AddVolumeWithID
|
||||||
|
((SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1) ,
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2) ,
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n3) ,
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n4) ,
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n5) ,
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n6) ,
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n12),
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n23),
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n31),
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n45),
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n56),
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n64),
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n14),
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n25),
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n36),
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1245),
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n2356),
|
||||||
|
(SMDS_MeshNode*) myNodeIDFactory->MeshElement(n1346),
|
||||||
|
ID);
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : AddVolumeWithID
|
||||||
|
//purpose : 2d order Pentahedron (prism) with 18 nodes
|
||||||
|
//=======================================================================
|
||||||
|
SMDS_MeshVolume* SMDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
||||||
|
const SMDS_MeshNode * n2,
|
||||||
|
const SMDS_MeshNode * n3,
|
||||||
|
const SMDS_MeshNode * n4,
|
||||||
|
const SMDS_MeshNode * n5,
|
||||||
|
const SMDS_MeshNode * n6,
|
||||||
|
const SMDS_MeshNode * n12,
|
||||||
|
const SMDS_MeshNode * n23,
|
||||||
|
const SMDS_MeshNode * n31,
|
||||||
|
const SMDS_MeshNode * n45,
|
||||||
|
const SMDS_MeshNode * n56,
|
||||||
|
const SMDS_MeshNode * n64,
|
||||||
|
const SMDS_MeshNode * n14,
|
||||||
|
const SMDS_MeshNode * n25,
|
||||||
|
const SMDS_MeshNode * n36,
|
||||||
|
const SMDS_MeshNode * n1245,
|
||||||
|
const SMDS_MeshNode * n2356,
|
||||||
|
const SMDS_MeshNode * n1346,
|
||||||
|
int ID)
|
||||||
|
{
|
||||||
|
//MESSAGE("AddVolumeWithID penta18 "<< ID);
|
||||||
|
if (!n1 || !n2 || !n3 || !n4 || !n5 || !n6 || !n12 || !n23 ||
|
||||||
|
!n31 || !n45 || !n56 || !n64 || !n14 || !n25 || !n36 || !n1245 || !n2356 || !n1346)
|
||||||
|
return 0;
|
||||||
|
if(hasConstructionFaces()) {
|
||||||
|
// creation quadratic faces - not implemented
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
// --- retrieve nodes ID
|
||||||
|
myNodeIds.resize(18);
|
||||||
|
myNodeIds[0] = n1->getVtkId();
|
||||||
|
myNodeIds[1] = n2->getVtkId();
|
||||||
|
myNodeIds[2] = n3->getVtkId();
|
||||||
|
|
||||||
|
myNodeIds[3] = n4->getVtkId();
|
||||||
|
myNodeIds[4] = n5->getVtkId();
|
||||||
|
myNodeIds[5] = n6->getVtkId();
|
||||||
|
|
||||||
|
myNodeIds[6] = n12->getVtkId();
|
||||||
|
myNodeIds[7] = n23->getVtkId();
|
||||||
|
myNodeIds[8] = n31->getVtkId();
|
||||||
|
|
||||||
|
myNodeIds[9] = n45->getVtkId();
|
||||||
|
myNodeIds[10] = n56->getVtkId();
|
||||||
|
myNodeIds[11] = n64->getVtkId();
|
||||||
|
|
||||||
|
myNodeIds[12] = n14->getVtkId();
|
||||||
|
myNodeIds[13] = n25->getVtkId();
|
||||||
|
myNodeIds[14] = n36->getVtkId();
|
||||||
|
|
||||||
|
myNodeIds[15] = n1245->getVtkId();
|
||||||
|
myNodeIds[16] = n2356->getVtkId();
|
||||||
|
myNodeIds[17] = n1346->getVtkId();
|
||||||
|
|
||||||
|
SMDS_VtkVolume *volvtk = myVolumePool->getNew();
|
||||||
|
volvtk->init(myNodeIds, this);
|
||||||
|
if (!this->registerElement(ID,volvtk))
|
||||||
|
{
|
||||||
|
this->myGrid->GetCellTypesArray()->SetValue(volvtk->getVtkId(), VTK_EMPTY_CELL);
|
||||||
|
myVolumePool->destroy(volvtk);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
adjustmyCellsCapacity(ID);
|
||||||
|
myCells[ID] = volvtk;
|
||||||
|
myInfo.myNbBiQuadPrisms++;
|
||||||
|
|
||||||
|
// if (!registerElement(ID, volvtk)) {
|
||||||
|
// RemoveElement(volvtk, false);
|
||||||
|
// volvtk = NULL;
|
||||||
|
// }
|
||||||
|
return volvtk;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AddVolume
|
//function : AddVolume
|
||||||
|
@ -454,6 +454,53 @@ public:
|
|||||||
const SMDS_MeshNode * n25,
|
const SMDS_MeshNode * n25,
|
||||||
const SMDS_MeshNode * n36);
|
const SMDS_MeshNode * n36);
|
||||||
|
|
||||||
|
// 2d order Pentahedron with 18 nodes
|
||||||
|
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3,
|
||||||
|
int n4, int n5, int n6,
|
||||||
|
int n12,int n23,int n31,
|
||||||
|
int n45,int n56,int n64,
|
||||||
|
int n14,int n25,int n36,
|
||||||
|
int n1245, int n2356, int n1346,
|
||||||
|
int ID);
|
||||||
|
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
|
||||||
|
const SMDS_MeshNode * n2,
|
||||||
|
const SMDS_MeshNode * n3,
|
||||||
|
const SMDS_MeshNode * n4,
|
||||||
|
const SMDS_MeshNode * n5,
|
||||||
|
const SMDS_MeshNode * n6,
|
||||||
|
const SMDS_MeshNode * n12,
|
||||||
|
const SMDS_MeshNode * n23,
|
||||||
|
const SMDS_MeshNode * n31,
|
||||||
|
const SMDS_MeshNode * n45,
|
||||||
|
const SMDS_MeshNode * n56,
|
||||||
|
const SMDS_MeshNode * n64,
|
||||||
|
const SMDS_MeshNode * n14,
|
||||||
|
const SMDS_MeshNode * n25,
|
||||||
|
const SMDS_MeshNode * n36,
|
||||||
|
const SMDS_MeshNode * n1245,
|
||||||
|
const SMDS_MeshNode * n2356,
|
||||||
|
const SMDS_MeshNode * n1346,
|
||||||
|
int ID);
|
||||||
|
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
|
||||||
|
const SMDS_MeshNode * n2,
|
||||||
|
const SMDS_MeshNode * n3,
|
||||||
|
const SMDS_MeshNode * n4,
|
||||||
|
const SMDS_MeshNode * n5,
|
||||||
|
const SMDS_MeshNode * n6,
|
||||||
|
const SMDS_MeshNode * n12,
|
||||||
|
const SMDS_MeshNode * n23,
|
||||||
|
const SMDS_MeshNode * n31,
|
||||||
|
const SMDS_MeshNode * n45,
|
||||||
|
const SMDS_MeshNode * n56,
|
||||||
|
const SMDS_MeshNode * n64,
|
||||||
|
const SMDS_MeshNode * n14,
|
||||||
|
const SMDS_MeshNode * n25,
|
||||||
|
const SMDS_MeshNode * n36,
|
||||||
|
const SMDS_MeshNode * n1245,
|
||||||
|
const SMDS_MeshNode * n2356,
|
||||||
|
const SMDS_MeshNode * n1346);
|
||||||
|
|
||||||
|
|
||||||
// 2d oreder Hexahedrons with 20 nodes
|
// 2d oreder Hexahedrons with 20 nodes
|
||||||
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
|
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
|
||||||
int n5, int n6, int n7, int n8,
|
int n5, int n6, int n7, int n8,
|
||||||
@ -654,7 +701,7 @@ public:
|
|||||||
int idnode4, int idnode5, int idnode6) const;
|
int idnode4, int idnode5, int idnode6) const;
|
||||||
const SMDS_MeshFace *FindFace(int idnode1, int idnode2, int idnode3, int idnode4,
|
const SMDS_MeshFace *FindFace(int idnode1, int idnode2, int idnode3, int idnode4,
|
||||||
int idnode5, int idnode6, int idnode7, int idnode8) const;
|
int idnode5, int idnode6, int idnode7, int idnode8) const;
|
||||||
const SMDS_MeshElement *FindElement(int IDelem) const;
|
virtual const SMDS_MeshElement * FindElement(int IDelem) const;
|
||||||
static const SMDS_Mesh0DElement* Find0DElement(const SMDS_MeshNode * n);
|
static const SMDS_Mesh0DElement* Find0DElement(const SMDS_MeshNode * n);
|
||||||
static const SMDS_BallElement* FindBall(const SMDS_MeshNode * n);
|
static const SMDS_BallElement* FindBall(const SMDS_MeshNode * n);
|
||||||
static const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1,
|
static const SMDS_MeshEdge* FindEdge(const SMDS_MeshNode * n1,
|
||||||
|
@ -66,6 +66,7 @@ VTKCellType SMDS_MeshCell::toVtkType (SMDSAbs_EntityType smdsType)
|
|||||||
vtkTypes[ SMDSEntity_TriQuad_Hexa ] = VTK_TRIQUADRATIC_HEXAHEDRON;
|
vtkTypes[ SMDSEntity_TriQuad_Hexa ] = VTK_TRIQUADRATIC_HEXAHEDRON;
|
||||||
vtkTypes[ SMDSEntity_Penta ] = VTK_WEDGE;
|
vtkTypes[ SMDSEntity_Penta ] = VTK_WEDGE;
|
||||||
vtkTypes[ SMDSEntity_Quad_Penta ] = VTK_QUADRATIC_WEDGE;
|
vtkTypes[ SMDSEntity_Quad_Penta ] = VTK_QUADRATIC_WEDGE;
|
||||||
|
vtkTypes[ SMDSEntity_BiQuad_Penta ] = VTK_BIQUADRATIC_QUADRATIC_WEDGE;
|
||||||
vtkTypes[ SMDSEntity_Hexagonal_Prism ] = VTK_HEXAGONAL_PRISM;
|
vtkTypes[ SMDSEntity_Hexagonal_Prism ] = VTK_HEXAGONAL_PRISM;
|
||||||
vtkTypes[ SMDSEntity_Polyhedra ] = VTK_POLYHEDRON;
|
vtkTypes[ SMDSEntity_Polyhedra ] = VTK_POLYHEDRON;
|
||||||
//vtkTypes[ SMDSEntity_Quad_Polyhedra ] = ;
|
//vtkTypes[ SMDSEntity_Quad_Polyhedra ] = ;
|
||||||
@ -153,9 +154,13 @@ const std::vector< int >& SMDS_MeshCell::toVtkOrder(SMDSAbs_EntityType smdsType)
|
|||||||
toVtkInterlaces[SMDSEntity_Penta].assign( &ids[0], &ids[0]+6 );
|
toVtkInterlaces[SMDSEntity_Penta].assign( &ids[0], &ids[0]+6 );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
const int ids[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14};
|
const int ids[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14}; // TODO: check
|
||||||
toVtkInterlaces[SMDSEntity_Quad_Penta].assign( &ids[0], &ids[0]+15 );
|
toVtkInterlaces[SMDSEntity_Quad_Penta].assign( &ids[0], &ids[0]+15 );
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
const int ids[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17};// TODO: check
|
||||||
|
toVtkInterlaces[SMDSEntity_BiQuad_Penta].assign( &ids[0], &ids[0]+18 );
|
||||||
|
}
|
||||||
{
|
{
|
||||||
const int ids[] = {0,5,4,3,2,1,6,11,10,9,8,7};
|
const int ids[] = {0,5,4,3,2,1,6,11,10,9,8,7};
|
||||||
toVtkInterlaces[SMDSEntity_Hexagonal_Prism].assign( &ids[0], &ids[0]+12 );
|
toVtkInterlaces[SMDSEntity_Hexagonal_Prism].assign( &ids[0], &ids[0]+12 );
|
||||||
@ -254,6 +259,10 @@ const std::vector<int>& SMDS_MeshCell::reverseSmdsOrder(SMDSAbs_EntityType smdsT
|
|||||||
reverseInterlaces[SMDSEntity_Quad_Penta].assign( &ids[0], &ids[0]+15 );
|
reverseInterlaces[SMDSEntity_Quad_Penta].assign( &ids[0], &ids[0]+15 );
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
const int ids[] = {0,2,1,3,5,4, 8,7,6,11,10,9,12,14,13,15,16,17};
|
||||||
|
reverseInterlaces[SMDSEntity_BiQuad_Penta].assign( &ids[0], &ids[0]+18 );
|
||||||
|
}
|
||||||
|
{
|
||||||
const int ids[] = {0,5,4,3,2,1,6,11,10,9,8,7};
|
const int ids[] = {0,5,4,3,2,1,6,11,10,9,8,7};
|
||||||
reverseInterlaces[SMDSEntity_Hexagonal_Prism].assign( &ids[0], &ids[0]+12 );
|
reverseInterlaces[SMDSEntity_Hexagonal_Prism].assign( &ids[0], &ids[0]+12 );
|
||||||
}
|
}
|
||||||
@ -414,6 +423,7 @@ SMDSAbs_ElementType SMDS_MeshCell::toSmdsType(SMDSAbs_EntityType entityType)
|
|||||||
case SMDSEntity_TriQuad_Hexa:
|
case SMDSEntity_TriQuad_Hexa:
|
||||||
case SMDSEntity_Penta:
|
case SMDSEntity_Penta:
|
||||||
case SMDSEntity_Quad_Penta:
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
case SMDSEntity_Hexagonal_Prism:
|
case SMDSEntity_Hexagonal_Prism:
|
||||||
case SMDSEntity_Polyhedra:
|
case SMDSEntity_Polyhedra:
|
||||||
case SMDSEntity_Quad_Polyhedra: return SMDSAbs_Volume;
|
case SMDSEntity_Quad_Polyhedra: return SMDSAbs_Volume;
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
#include "SMESH_SMDS.hxx"
|
#include "SMESH_SMDS.hxx"
|
||||||
|
|
||||||
#include "SMDS_MeshElement.hxx"
|
#include "SMDS_MeshElement.hxx"
|
||||||
|
#include<utilities.h>
|
||||||
|
|
||||||
class SMDS_EXPORT SMDS_MeshInfo
|
class SMDS_EXPORT SMDS_MeshInfo
|
||||||
{
|
{
|
||||||
@ -64,6 +65,8 @@ public:
|
|||||||
inline int NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const;
|
inline int NbPrisms (SMDSAbs_ElementOrder order = ORDER_ANY) const;
|
||||||
inline int NbHexPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
|
inline int NbHexPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const;
|
||||||
int NbTriQuadHexas() const { return myNbTriQuadHexas; }
|
int NbTriQuadHexas() const { return myNbTriQuadHexas; }
|
||||||
|
int NbQuadPrisms() const { return myNbQuadPrisms; }
|
||||||
|
int NbBiQuadPrisms() const { return myNbBiQuadPrisms; }
|
||||||
int NbPolyhedrons() const { return myNbPolyhedrons; }
|
int NbPolyhedrons() const { return myNbPolyhedrons; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -94,7 +97,7 @@ private:
|
|||||||
int myNbTetras , myNbQuadTetras ;
|
int myNbTetras , myNbQuadTetras ;
|
||||||
int myNbHexas , myNbQuadHexas, myNbTriQuadHexas;
|
int myNbHexas , myNbQuadHexas, myNbTriQuadHexas;
|
||||||
int myNbPyramids, myNbQuadPyramids;
|
int myNbPyramids, myNbQuadPyramids;
|
||||||
int myNbPrisms , myNbQuadPrisms ;
|
int myNbPrisms , myNbQuadPrisms, myNbBiQuadPrisms;
|
||||||
int myNbHexPrism;
|
int myNbHexPrism;
|
||||||
int myNbPolyhedrons;
|
int myNbPolyhedrons;
|
||||||
|
|
||||||
@ -113,7 +116,7 @@ inline SMDS_MeshInfo::SMDS_MeshInfo():
|
|||||||
myNbTetras (0), myNbQuadTetras (0),
|
myNbTetras (0), myNbQuadTetras (0),
|
||||||
myNbHexas (0), myNbQuadHexas (0), myNbTriQuadHexas(0),
|
myNbHexas (0), myNbQuadHexas (0), myNbTriQuadHexas(0),
|
||||||
myNbPyramids (0), myNbQuadPyramids(0),
|
myNbPyramids (0), myNbQuadPyramids(0),
|
||||||
myNbPrisms (0), myNbQuadPrisms (0),
|
myNbPrisms (0), myNbQuadPrisms (0), myNbBiQuadPrisms(0),
|
||||||
myNbHexPrism (0),
|
myNbHexPrism (0),
|
||||||
myNbPolyhedrons(0)
|
myNbPolyhedrons(0)
|
||||||
{
|
{
|
||||||
@ -142,26 +145,30 @@ inline SMDS_MeshInfo::SMDS_MeshInfo():
|
|||||||
// 15 *
|
// 15 *
|
||||||
// 16 *
|
// 16 *
|
||||||
// 17 *
|
// 17 *
|
||||||
// 18 *
|
// 18 *
|
||||||
// 19 *
|
// 19
|
||||||
// 20 *
|
// 20 *
|
||||||
// 21 *
|
// 21
|
||||||
// 22 *
|
// 22
|
||||||
// 23 *
|
// 23
|
||||||
// 24 *
|
// 24
|
||||||
// 25
|
// 25 *
|
||||||
// 26
|
// 26 *
|
||||||
// 27 *
|
// 27 *
|
||||||
|
// 28 *
|
||||||
|
// 29 *
|
||||||
|
// 30 *
|
||||||
|
// 31 *
|
||||||
//
|
//
|
||||||
// So to have a unique index for each type basing on nb of nodes, we use a shift:
|
// So to have a unique index for each type basing on nb of nodes, we use a shift:
|
||||||
myShift.resize(SMDSAbs_NbElementTypes, 0);
|
myShift.resize(SMDSAbs_NbElementTypes, 0);
|
||||||
|
|
||||||
myShift[ SMDSAbs_Face ] = +15;// 3->18, 4->19, etc.
|
myShift[ SMDSAbs_Face ] = +22;// 3->25, 4->26, etc.
|
||||||
myShift[ SMDSAbs_Edge ] = +14;// 2->16, 3->17
|
myShift[ SMDSAbs_Edge ] = +14;// 2->16, 3->17
|
||||||
myShift[ SMDSAbs_0DElement ] = +2; // 1->3
|
myShift[ SMDSAbs_0DElement ] = +2; // 1->3
|
||||||
myShift[ SMDSAbs_Ball ] = +1; // 1->2
|
myShift[ SMDSAbs_Ball ] = +1; // 1->2
|
||||||
|
|
||||||
myNb.resize( index( SMDSAbs_Volume,27 ) + 1, NULL);
|
myNb.resize( index( SMDSAbs_Face,9 ) + 1, NULL);
|
||||||
|
|
||||||
myNb[ index( SMDSAbs_Node,1 )] = & myNbNodes;
|
myNb[ index( SMDSAbs_Node,1 )] = & myNbNodes;
|
||||||
myNb[ index( SMDSAbs_0DElement,1 )] = & myNb0DElements;
|
myNb[ index( SMDSAbs_0DElement,1 )] = & myNb0DElements;
|
||||||
@ -185,6 +192,7 @@ inline SMDS_MeshInfo::SMDS_MeshInfo():
|
|||||||
myNb[ index( SMDSAbs_Volume, 12)] = & myNbHexPrism;
|
myNb[ index( SMDSAbs_Volume, 12)] = & myNbHexPrism;
|
||||||
myNb[ index( SMDSAbs_Volume, 13)] = & myNbQuadPyramids;
|
myNb[ index( SMDSAbs_Volume, 13)] = & myNbQuadPyramids;
|
||||||
myNb[ index( SMDSAbs_Volume, 15)] = & myNbQuadPrisms;
|
myNb[ index( SMDSAbs_Volume, 15)] = & myNbQuadPrisms;
|
||||||
|
myNb[ index( SMDSAbs_Volume, 18)] = & myNbBiQuadPrisms;
|
||||||
myNb[ index( SMDSAbs_Volume, 20)] = & myNbQuadHexas;
|
myNb[ index( SMDSAbs_Volume, 20)] = & myNbQuadHexas;
|
||||||
myNb[ index( SMDSAbs_Volume, 27)] = & myNbTriQuadHexas;
|
myNb[ index( SMDSAbs_Volume, 27)] = & myNbTriQuadHexas;
|
||||||
}
|
}
|
||||||
@ -280,7 +288,7 @@ SMDS_MeshInfo::NbPyramids(SMDSAbs_ElementOrder order) const
|
|||||||
|
|
||||||
inline int // NbPrisms
|
inline int // NbPrisms
|
||||||
SMDS_MeshInfo::NbPrisms (SMDSAbs_ElementOrder order) const
|
SMDS_MeshInfo::NbPrisms (SMDSAbs_ElementOrder order) const
|
||||||
{ return order == ORDER_ANY ? myNbPrisms+myNbQuadPrisms : order == ORDER_LINEAR ? myNbPrisms : myNbQuadPrisms; }
|
{ return order == ORDER_ANY ? myNbPrisms+myNbQuadPrisms+myNbBiQuadPrisms: order == ORDER_LINEAR ? myNbPrisms : myNbQuadPrisms+myNbBiQuadPrisms; }
|
||||||
|
|
||||||
inline int // NbHexPrisms
|
inline int // NbHexPrisms
|
||||||
SMDS_MeshInfo::NbHexPrisms (SMDSAbs_ElementOrder order) const
|
SMDS_MeshInfo::NbHexPrisms (SMDSAbs_ElementOrder order) const
|
||||||
@ -297,7 +305,7 @@ SMDS_MeshInfo::NbElements(SMDSAbs_ElementType type) const
|
|||||||
break;
|
break;
|
||||||
case SMDSAbs_Volume:
|
case SMDSAbs_Volume:
|
||||||
nb = ( myNbTetras+ myNbPyramids+ myNbPrisms+ myNbHexas+ myNbHexPrism+
|
nb = ( myNbTetras+ myNbPyramids+ myNbPrisms+ myNbHexas+ myNbHexPrism+
|
||||||
myNbQuadTetras+ myNbQuadPyramids+ myNbQuadPrisms+ myNbQuadHexas+ myNbTriQuadHexas+
|
myNbQuadTetras+ myNbQuadPyramids+ myNbQuadPrisms+ myNbBiQuadPrisms + myNbQuadHexas+ myNbTriQuadHexas+
|
||||||
myNbPolyhedrons );
|
myNbPolyhedrons );
|
||||||
break;
|
break;
|
||||||
case SMDSAbs_Face:
|
case SMDSAbs_Face:
|
||||||
@ -345,6 +353,7 @@ SMDS_MeshInfo::NbEntities(SMDSAbs_EntityType type) const
|
|||||||
case SMDSEntity_TriQuad_Hexa: return myNbTriQuadHexas;
|
case SMDSEntity_TriQuad_Hexa: return myNbTriQuadHexas;
|
||||||
case SMDSEntity_Penta: return myNbPrisms;
|
case SMDSEntity_Penta: return myNbPrisms;
|
||||||
case SMDSEntity_Quad_Penta: return myNbQuadPrisms;
|
case SMDSEntity_Quad_Penta: return myNbQuadPrisms;
|
||||||
|
case SMDSEntity_BiQuad_Penta: return myNbBiQuadPrisms;
|
||||||
case SMDSEntity_Hexagonal_Prism: return myNbHexPrism;
|
case SMDSEntity_Hexagonal_Prism: return myNbHexPrism;
|
||||||
case SMDSEntity_Polyhedra: return myNbPolyhedrons;
|
case SMDSEntity_Polyhedra: return myNbPolyhedrons;
|
||||||
case SMDSEntity_0D: return myNb0DElements;
|
case SMDSEntity_0D: return myNb0DElements;
|
||||||
@ -383,7 +392,8 @@ SMDS_MeshInfo::NbElementsOfGeom(SMDSAbs_GeometryType geom) const
|
|||||||
myNbQuadHexas +
|
myNbQuadHexas +
|
||||||
myNbTriQuadHexas);
|
myNbTriQuadHexas);
|
||||||
case SMDSGeom_PENTA: return (myNbPrisms +
|
case SMDSGeom_PENTA: return (myNbPrisms +
|
||||||
myNbQuadPrisms);
|
myNbQuadPrisms +
|
||||||
|
myNbBiQuadPrisms);
|
||||||
case SMDSGeom_HEXAGONAL_PRISM: return myNbHexPrism;
|
case SMDSGeom_HEXAGONAL_PRISM: return myNbHexPrism;
|
||||||
case SMDSGeom_POLYHEDRA: return myNbPolyhedrons;
|
case SMDSGeom_POLYHEDRA: return myNbPolyhedrons;
|
||||||
// Discrete:
|
// Discrete:
|
||||||
@ -414,6 +424,7 @@ SMDS_MeshInfo::setNb(const SMDSAbs_EntityType geomType, const int nb)
|
|||||||
case SMDSEntity_Quad_Edge: myNbQuadEdges = nb; break;
|
case SMDSEntity_Quad_Edge: myNbQuadEdges = nb; break;
|
||||||
case SMDSEntity_Quad_Hexa: myNbQuadHexas = nb; break;
|
case SMDSEntity_Quad_Hexa: myNbQuadHexas = nb; break;
|
||||||
case SMDSEntity_Quad_Penta: myNbQuadPrisms = nb; break;
|
case SMDSEntity_Quad_Penta: myNbQuadPrisms = nb; break;
|
||||||
|
case SMDSEntity_BiQuad_Penta: myNbBiQuadPrisms = nb; break;
|
||||||
case SMDSEntity_Quad_Pyramid: myNbQuadPyramids = nb; break;
|
case SMDSEntity_Quad_Pyramid: myNbQuadPyramids = nb; break;
|
||||||
case SMDSEntity_Quad_Quadrangle: myNbQuadQuadrangles = nb; break;
|
case SMDSEntity_Quad_Quadrangle: myNbQuadQuadrangles = nb; break;
|
||||||
case SMDSEntity_Quad_Tetra: myNbQuadTetras = nb; break;
|
case SMDSEntity_Quad_Tetra: myNbQuadTetras = nb; break;
|
||||||
|
@ -381,6 +381,7 @@ SMDSAbs_EntityType SMDS_QuadraticVolumeOfNodes::GetEntityType() const
|
|||||||
case 10: aType = SMDSEntity_Quad_Tetra; break;
|
case 10: aType = SMDSEntity_Quad_Tetra; break;
|
||||||
case 13: aType = SMDSEntity_Quad_Pyramid; break;
|
case 13: aType = SMDSEntity_Quad_Pyramid; break;
|
||||||
case 15: aType = SMDSEntity_Quad_Penta; break;
|
case 15: aType = SMDSEntity_Quad_Penta; break;
|
||||||
|
case 18: aType = SMDSEntity_BiQuad_Penta; break;
|
||||||
case 20:
|
case 20:
|
||||||
default: aType = SMDSEntity_Quad_Hexa; break;
|
default: aType = SMDSEntity_Quad_Hexa; break;
|
||||||
}
|
}
|
||||||
|
@ -51,6 +51,11 @@ namespace SMDS {
|
|||||||
static VALUE value(VALUE_SET_ITERATOR it) { return (VALUE) it->second; }
|
static VALUE value(VALUE_SET_ITERATOR it) { return (VALUE) it->second; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<typename VALUE,typename VALUE_SET_ITERATOR>
|
||||||
|
struct PointerAccessor {
|
||||||
|
static VALUE value(VALUE_SET_ITERATOR it) { return (VALUE) &(*it); }
|
||||||
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
/// Filters of value pointed by iterator
|
/// Filters of value pointed by iterator
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -115,6 +115,7 @@ SMDS_VtkCellIteratorToUNV::SMDS_VtkCellIteratorToUNV(SMDS_Mesh* mesh, int vtkCel
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case SMDSEntity_Quad_Penta:
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta: //TODO: check
|
||||||
{
|
{
|
||||||
static int id[] = { 0, 8, 2, 7, 1, 6, 12, 14, 13, 3, 11, 5, 10, 4, 9 };
|
static int id[] = { 0, 8, 2, 7, 1, 6, 12, 14, 13, 3, 11, 5, 10, 4, 9 };
|
||||||
ids = id;
|
ids = id;
|
||||||
|
@ -45,16 +45,17 @@ void SMDS_VtkVolume::init(const std::vector<vtkIdType>& nodeIds, SMDS_Mesh* mesh
|
|||||||
vtkIdType aType = VTK_TETRA;
|
vtkIdType aType = VTK_TETRA;
|
||||||
switch (nodeIds.size()) // cases are in order of usage frequency
|
switch (nodeIds.size()) // cases are in order of usage frequency
|
||||||
{
|
{
|
||||||
case 4: aType = VTK_TETRA; break;
|
case 4: aType = VTK_TETRA; break;
|
||||||
case 8: aType = VTK_HEXAHEDRON; break;
|
case 8: aType = VTK_HEXAHEDRON; break;
|
||||||
case 5: aType = VTK_PYRAMID; break;
|
case 5: aType = VTK_PYRAMID; break;
|
||||||
case 6: aType = VTK_WEDGE; break;
|
case 6: aType = VTK_WEDGE; break;
|
||||||
case 10: aType = VTK_QUADRATIC_TETRA; break;
|
case 10: aType = VTK_QUADRATIC_TETRA; break;
|
||||||
case 20: aType = VTK_QUADRATIC_HEXAHEDRON; break;
|
case 20: aType = VTK_QUADRATIC_HEXAHEDRON; break;
|
||||||
case 13: aType = VTK_QUADRATIC_PYRAMID; break;
|
case 13: aType = VTK_QUADRATIC_PYRAMID; break;
|
||||||
case 15: aType = VTK_QUADRATIC_WEDGE; break;
|
case 15: aType = VTK_QUADRATIC_WEDGE; break;
|
||||||
case 12: aType = VTK_HEXAGONAL_PRISM; break;
|
case 18: aType = VTK_BIQUADRATIC_QUADRATIC_WEDGE; break;
|
||||||
case 27: aType = VTK_TRIQUADRATIC_HEXAHEDRON;break;
|
case 12: aType = VTK_HEXAGONAL_PRISM; break;
|
||||||
|
case 27: aType = VTK_TRIQUADRATIC_HEXAHEDRON; break;
|
||||||
default: aType = VTK_HEXAHEDRON;
|
default: aType = VTK_HEXAHEDRON;
|
||||||
}
|
}
|
||||||
myVtkID = mesh->getGrid()->InsertNextLinkedCell(aType, nodeIds.size(), (vtkIdType *) &nodeIds[0]);
|
myVtkID = mesh->getGrid()->InsertNextLinkedCell(aType, nodeIds.size(), (vtkIdType *) &nodeIds[0]);
|
||||||
@ -169,6 +170,7 @@ int SMDS_VtkVolume::NbFaces() const
|
|||||||
case VTK_WEDGE:
|
case VTK_WEDGE:
|
||||||
case VTK_QUADRATIC_PYRAMID:
|
case VTK_QUADRATIC_PYRAMID:
|
||||||
case VTK_QUADRATIC_WEDGE:
|
case VTK_QUADRATIC_WEDGE:
|
||||||
|
case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
|
||||||
nbFaces = 5;
|
nbFaces = 5;
|
||||||
break;
|
break;
|
||||||
case VTK_HEXAHEDRON:
|
case VTK_HEXAHEDRON:
|
||||||
@ -239,6 +241,7 @@ int SMDS_VtkVolume::NbEdges() const
|
|||||||
break;
|
break;
|
||||||
case VTK_WEDGE:
|
case VTK_WEDGE:
|
||||||
case VTK_QUADRATIC_WEDGE:
|
case VTK_QUADRATIC_WEDGE:
|
||||||
|
case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
|
||||||
nbEdges = 9;
|
nbEdges = 9;
|
||||||
break;
|
break;
|
||||||
case VTK_HEXAHEDRON:
|
case VTK_HEXAHEDRON:
|
||||||
@ -467,6 +470,7 @@ bool SMDS_VtkVolume::IsQuadratic() const
|
|||||||
case VTK_QUADRATIC_TETRA:
|
case VTK_QUADRATIC_TETRA:
|
||||||
case VTK_QUADRATIC_PYRAMID:
|
case VTK_QUADRATIC_PYRAMID:
|
||||||
case VTK_QUADRATIC_WEDGE:
|
case VTK_QUADRATIC_WEDGE:
|
||||||
|
case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
|
||||||
case VTK_QUADRATIC_HEXAHEDRON:
|
case VTK_QUADRATIC_HEXAHEDRON:
|
||||||
case VTK_TRIQUADRATIC_HEXAHEDRON:
|
case VTK_TRIQUADRATIC_HEXAHEDRON:
|
||||||
return true;
|
return true;
|
||||||
@ -497,6 +501,7 @@ bool SMDS_VtkVolume::IsMediumNode(const SMDS_MeshNode* node) const
|
|||||||
rankFirstMedium = 5; // medium nodes are of rank 5 to 12
|
rankFirstMedium = 5; // medium nodes are of rank 5 to 12
|
||||||
break;
|
break;
|
||||||
case VTK_QUADRATIC_WEDGE:
|
case VTK_QUADRATIC_WEDGE:
|
||||||
|
case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
|
||||||
rankFirstMedium = 6; // medium nodes are of rank 6 to 14
|
rankFirstMedium = 6; // medium nodes are of rank 6 to 14
|
||||||
break;
|
break;
|
||||||
case VTK_QUADRATIC_HEXAHEDRON:
|
case VTK_QUADRATIC_HEXAHEDRON:
|
||||||
@ -532,11 +537,12 @@ int SMDS_VtkVolume::NbCornerNodes() const
|
|||||||
vtkIdType aVtkType = grid->GetCellType(myVtkID);
|
vtkIdType aVtkType = grid->GetCellType(myVtkID);
|
||||||
switch (aVtkType)
|
switch (aVtkType)
|
||||||
{
|
{
|
||||||
case VTK_QUADRATIC_TETRA: return 4;
|
case VTK_QUADRATIC_TETRA: return 4;
|
||||||
case VTK_QUADRATIC_PYRAMID: return 5;
|
case VTK_QUADRATIC_PYRAMID: return 5;
|
||||||
case VTK_QUADRATIC_WEDGE: return 6;
|
case VTK_QUADRATIC_WEDGE:
|
||||||
|
case VTK_BIQUADRATIC_QUADRATIC_WEDGE: return 6;
|
||||||
case VTK_QUADRATIC_HEXAHEDRON:
|
case VTK_QUADRATIC_HEXAHEDRON:
|
||||||
case VTK_TRIQUADRATIC_HEXAHEDRON: return 8;
|
case VTK_TRIQUADRATIC_HEXAHEDRON: return 8;
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
return NbNodes();
|
return NbNodes();
|
||||||
@ -571,6 +577,9 @@ SMDSAbs_EntityType SMDS_VtkVolume::GetEntityType() const
|
|||||||
case VTK_QUADRATIC_WEDGE:
|
case VTK_QUADRATIC_WEDGE:
|
||||||
aType = SMDSEntity_Quad_Penta;
|
aType = SMDSEntity_Quad_Penta;
|
||||||
break;
|
break;
|
||||||
|
case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
|
||||||
|
aType = SMDSEntity_BiQuad_Penta;
|
||||||
|
break;
|
||||||
case VTK_QUADRATIC_HEXAHEDRON:
|
case VTK_QUADRATIC_HEXAHEDRON:
|
||||||
aType = SMDSEntity_Quad_Hexa;
|
aType = SMDSEntity_Quad_Hexa;
|
||||||
break;
|
break;
|
||||||
@ -608,6 +617,7 @@ SMDSAbs_GeometryType SMDS_VtkVolume::GetGeomType() const
|
|||||||
break;
|
break;
|
||||||
case VTK_WEDGE:
|
case VTK_WEDGE:
|
||||||
case VTK_QUADRATIC_WEDGE:
|
case VTK_QUADRATIC_WEDGE:
|
||||||
|
case VTK_BIQUADRATIC_QUADRATIC_WEDGE:
|
||||||
aType = SMDSGeom_PENTA;
|
aType = SMDSGeom_PENTA;
|
||||||
break;
|
break;
|
||||||
case VTK_HEXAHEDRON:
|
case VTK_HEXAHEDRON:
|
||||||
|
@ -42,8 +42,6 @@
|
|||||||
#include "SMESH_TypeDefs.hxx"
|
#include "SMESH_TypeDefs.hxx"
|
||||||
#include "SMESH_subMesh.hxx"
|
#include "SMESH_subMesh.hxx"
|
||||||
|
|
||||||
#include <Basics_OCCTVersion.hxx>
|
|
||||||
|
|
||||||
#include <BRepAdaptor_Curve.hxx>
|
#include <BRepAdaptor_Curve.hxx>
|
||||||
#include <BRepLProp.hxx>
|
#include <BRepLProp.hxx>
|
||||||
#include <BRep_Tool.hxx>
|
#include <BRep_Tool.hxx>
|
||||||
@ -87,7 +85,7 @@ using namespace std;
|
|||||||
bool SMESH_Algo::Features::IsCompatible( const SMESH_Algo::Features& algo2 ) const
|
bool SMESH_Algo::Features::IsCompatible( const SMESH_Algo::Features& algo2 ) const
|
||||||
{
|
{
|
||||||
if ( _dim > algo2._dim ) return algo2.IsCompatible( *this );
|
if ( _dim > algo2._dim ) return algo2.IsCompatible( *this );
|
||||||
// algo2 is of highter dimension
|
// algo2 is of higher dimension
|
||||||
if ( _outElemTypes.empty() || algo2._inElemTypes.empty() )
|
if ( _outElemTypes.empty() || algo2._inElemTypes.empty() )
|
||||||
return false;
|
return false;
|
||||||
bool compatible = true;
|
bool compatible = true;
|
||||||
|
@ -1397,6 +1397,7 @@ void SMESH_Mesh::ExportMED(const char * file,
|
|||||||
bool theAllElemsToGroup)
|
bool theAllElemsToGroup)
|
||||||
throw(SALOME_Exception)
|
throw(SALOME_Exception)
|
||||||
{
|
{
|
||||||
|
//MESSAGE("MED_VERSION:"<< theVersion);
|
||||||
SMESH_TRY;
|
SMESH_TRY;
|
||||||
|
|
||||||
DriverMED_W_SMESHDS_Mesh myWriter;
|
DriverMED_W_SMESHDS_Mesh myWriter;
|
||||||
@ -1532,6 +1533,7 @@ void SMESH_Mesh::ExportUNV(const char * file,
|
|||||||
myWriter.SetMeshId(_id);
|
myWriter.SetMeshId(_id);
|
||||||
// myWriter.SetGroups(_mapGroup);
|
// myWriter.SetGroups(_mapGroup);
|
||||||
|
|
||||||
|
// pass group names to SMESHDS
|
||||||
if ( !meshPart )
|
if ( !meshPart )
|
||||||
{
|
{
|
||||||
for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
|
for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
|
||||||
@ -1576,17 +1578,37 @@ void SMESH_Mesh::ExportSTL(const char * file,
|
|||||||
|
|
||||||
void SMESH_Mesh::ExportCGNS(const char * file,
|
void SMESH_Mesh::ExportCGNS(const char * file,
|
||||||
const SMESHDS_Mesh* meshDS,
|
const SMESHDS_Mesh* meshDS,
|
||||||
const char * meshName)
|
const char * meshName,
|
||||||
|
const bool groupElemsByType)
|
||||||
{
|
{
|
||||||
int res = Driver_Mesh::DRS_FAIL;
|
int res = Driver_Mesh::DRS_FAIL;
|
||||||
|
|
||||||
|
// pass group names to SMESHDS
|
||||||
|
for ( map<int, SMESH_Group*>::iterator it = _mapGroup.begin(); it != _mapGroup.end(); it++ ) {
|
||||||
|
SMESH_Group* group = it->second;
|
||||||
|
SMESHDS_GroupBase* groupDS = group->GetGroupDS();
|
||||||
|
if ( groupDS ) {
|
||||||
|
string groupName = group->GetName();
|
||||||
|
groupDS->SetStoreName( groupName.c_str() );
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef WITH_CGNS
|
#ifdef WITH_CGNS
|
||||||
|
|
||||||
DriverCGNS_Write myWriter;
|
DriverCGNS_Write myWriter;
|
||||||
myWriter.SetFile( file );
|
myWriter.SetFile( file );
|
||||||
myWriter.SetMesh( const_cast<SMESHDS_Mesh*>( meshDS ));
|
myWriter.SetMesh( const_cast<SMESHDS_Mesh*>( meshDS ));
|
||||||
myWriter.SetMeshName( SMESH_Comment("Mesh_") << meshDS->GetPersistentId());
|
myWriter.SetMeshName( SMESH_Comment("Mesh_") << meshDS->GetPersistentId());
|
||||||
if ( meshName && meshName[0] )
|
if ( meshName && meshName[0] )
|
||||||
myWriter.SetMeshName( meshName );
|
myWriter.SetMeshName( meshName );
|
||||||
|
myWriter.SetElementsByType( groupElemsByType );
|
||||||
res = myWriter.Perform();
|
res = myWriter.Perform();
|
||||||
|
if ( res != Driver_Mesh::DRS_OK )
|
||||||
|
{
|
||||||
|
SMESH_ComputeErrorPtr err = myWriter.GetError();
|
||||||
|
if ( err && !err->IsOK() && !err->myComment.empty() )
|
||||||
|
throw SALOME_Exception(("Export failed: " + err->myComment ).c_str() );
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if ( res != Driver_Mesh::DRS_OK )
|
if ( res != Driver_Mesh::DRS_OK )
|
||||||
throw SALOME_Exception("Export failed");
|
throw SALOME_Exception("Export failed");
|
||||||
@ -1864,6 +1886,19 @@ int SMESH_Mesh::NbPrisms(SMDSAbs_ElementOrder order) const throw(SALOME_Exceptio
|
|||||||
return _myMeshDS->GetMeshInfo().NbPrisms(order);
|
return _myMeshDS->GetMeshInfo().NbPrisms(order);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int SMESH_Mesh::NbQuadPrisms() const throw (SALOME_Exception)
|
||||||
|
{
|
||||||
|
Unexpect aCatch(SalomeException);
|
||||||
|
return _myMeshDS->GetMeshInfo().NbQuadPrisms();
|
||||||
|
}
|
||||||
|
|
||||||
|
int SMESH_Mesh::NbBiQuadPrisms() const throw (SALOME_Exception)
|
||||||
|
{
|
||||||
|
Unexpect aCatch(SalomeException);
|
||||||
|
return _myMeshDS->GetMeshInfo().NbBiQuadPrisms();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Return number of hexagonal prisms in the mesh
|
* \brief Return number of hexagonal prisms in the mesh
|
||||||
@ -2149,7 +2184,7 @@ ostream& SMESH_Mesh::Dump(ostream& save)
|
|||||||
save << clause << ".3) Faces in detail: " << endl;
|
save << clause << ".3) Faces in detail: " << endl;
|
||||||
map <int,int>::iterator itF;
|
map <int,int>::iterator itF;
|
||||||
for (itF = myFaceMap.begin(); itF != myFaceMap.end(); itF++)
|
for (itF = myFaceMap.begin(); itF != myFaceMap.end(); itF++)
|
||||||
save << "--> nb nodes: " << itF->first << " - nb elemens:\t" << itF->second << endl;
|
save << "--> nb nodes: " << itF->first << " - nb elements:\t" << itF->second << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
|
save << ++clause << ") Total number of " << orderStr << " volumes:\t" << NbVolumes(order) << endl;
|
||||||
@ -2174,7 +2209,7 @@ ostream& SMESH_Mesh::Dump(ostream& save)
|
|||||||
save << clause << ".5) Volumes in detail: " << endl;
|
save << clause << ".5) Volumes in detail: " << endl;
|
||||||
map <int,int>::iterator itV;
|
map <int,int>::iterator itV;
|
||||||
for (itV = myVolumesMap.begin(); itV != myVolumesMap.end(); itV++)
|
for (itV = myVolumesMap.begin(); itV != myVolumesMap.end(); itV++)
|
||||||
save << "--> nb nodes: " << itV->first << " - nb elemens:\t" << itV->second << endl;
|
save << "--> nb nodes: " << itV->first << " - nb elements:\t" << itV->second << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
save << endl;
|
save << endl;
|
||||||
|
@ -265,7 +265,8 @@ class SMESH_EXPORT SMESH_Mesh
|
|||||||
const SMESHDS_Mesh* meshPart = 0) throw(SALOME_Exception);
|
const SMESHDS_Mesh* meshPart = 0) throw(SALOME_Exception);
|
||||||
void ExportCGNS(const char * file,
|
void ExportCGNS(const char * file,
|
||||||
const SMESHDS_Mesh* mesh,
|
const SMESHDS_Mesh* mesh,
|
||||||
const char * meshName = 0);
|
const char * meshName = 0,
|
||||||
|
const bool groupElemsByType = false);
|
||||||
void ExportGMF(const char * file,
|
void ExportGMF(const char * file,
|
||||||
const SMESHDS_Mesh* mesh,
|
const SMESHDS_Mesh* mesh,
|
||||||
bool withRequiredGroups = true );
|
bool withRequiredGroups = true );
|
||||||
@ -294,6 +295,8 @@ class SMESH_EXPORT SMESH_Mesh
|
|||||||
int NbTriQuadraticHexas() const throw(SALOME_Exception);
|
int NbTriQuadraticHexas() const throw(SALOME_Exception);
|
||||||
int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception);
|
int NbPyramids(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception);
|
||||||
int NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception);
|
int NbPrisms(SMDSAbs_ElementOrder order = ORDER_ANY) const throw(SALOME_Exception);
|
||||||
|
int NbQuadPrisms() const throw(SALOME_Exception);
|
||||||
|
int NbBiQuadPrisms() const throw(SALOME_Exception);
|
||||||
int NbHexagonalPrisms() const throw(SALOME_Exception);
|
int NbHexagonalPrisms() const throw(SALOME_Exception);
|
||||||
int NbPolyhedrons() const throw(SALOME_Exception);
|
int NbPolyhedrons() const throw(SALOME_Exception);
|
||||||
|
|
||||||
|
@ -46,8 +46,6 @@
|
|||||||
#include "SMESH_OctreeNode.hxx"
|
#include "SMESH_OctreeNode.hxx"
|
||||||
#include "SMESH_subMesh.hxx"
|
#include "SMESH_subMesh.hxx"
|
||||||
|
|
||||||
#include <Basics_OCCTVersion.hxx>
|
|
||||||
|
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
#include "chrono.hxx"
|
#include "chrono.hxx"
|
||||||
|
|
||||||
@ -98,6 +96,9 @@
|
|||||||
|
|
||||||
#include <Standard_Failure.hxx>
|
#include <Standard_Failure.hxx>
|
||||||
#include <Standard_ErrorHandler.hxx>
|
#include <Standard_ErrorHandler.hxx>
|
||||||
|
#include <OSD_Parallel.hxx>
|
||||||
|
|
||||||
|
#include "SMESH_TryCatch.hxx" // include after OCCT headers!
|
||||||
|
|
||||||
#define cast2Node(elem) static_cast<const SMDS_MeshNode*>( elem )
|
#define cast2Node(elem) static_cast<const SMDS_MeshNode*>( elem )
|
||||||
|
|
||||||
@ -1914,6 +1915,7 @@ namespace
|
|||||||
break;
|
break;
|
||||||
case SMDSEntity_Penta:
|
case SMDSEntity_Penta:
|
||||||
case SMDSEntity_Quad_Penta:
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
connVariants = thePentaTo3; nbTet = 3; nbVariants = 6;
|
connVariants = thePentaTo3; nbTet = 3; nbVariants = 6;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -9229,6 +9231,7 @@ int SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm,
|
|||||||
SMESH_MesherHelper& theHelper,
|
SMESH_MesherHelper& theHelper,
|
||||||
const bool theForce3d)
|
const bool theForce3d)
|
||||||
{
|
{
|
||||||
|
//MESSAGE("convertElemToQuadratic");
|
||||||
int nbElem = 0;
|
int nbElem = 0;
|
||||||
if( !theSm ) return nbElem;
|
if( !theSm ) return nbElem;
|
||||||
|
|
||||||
@ -9254,18 +9257,20 @@ int SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm,
|
|||||||
case SMDSEntity_Quad_Triangle:
|
case SMDSEntity_Quad_Triangle:
|
||||||
case SMDSEntity_Quad_Quadrangle:
|
case SMDSEntity_Quad_Quadrangle:
|
||||||
case SMDSEntity_Quad_Hexa:
|
case SMDSEntity_Quad_Hexa:
|
||||||
|
case SMDSEntity_Quad_Penta:
|
||||||
alreadyOK = !theHelper.GetIsBiQuadratic(); break;
|
alreadyOK = !theHelper.GetIsBiQuadratic(); break;
|
||||||
|
|
||||||
case SMDSEntity_BiQuad_Triangle:
|
case SMDSEntity_BiQuad_Triangle:
|
||||||
case SMDSEntity_BiQuad_Quadrangle:
|
case SMDSEntity_BiQuad_Quadrangle:
|
||||||
case SMDSEntity_TriQuad_Hexa:
|
case SMDSEntity_TriQuad_Hexa:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
alreadyOK = theHelper.GetIsBiQuadratic();
|
alreadyOK = theHelper.GetIsBiQuadratic();
|
||||||
hasCentralNodes = true;
|
hasCentralNodes = true;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
alreadyOK = true;
|
alreadyOK = true;
|
||||||
}
|
}
|
||||||
// take into account already present modium nodes
|
// take into account already present medium nodes
|
||||||
switch ( aType ) {
|
switch ( aType ) {
|
||||||
case SMDSAbs_Volume:
|
case SMDSAbs_Volume:
|
||||||
theHelper.AddTLinks( static_cast< const SMDS_MeshVolume* >( elem )); break;
|
theHelper.AddTLinks( static_cast< const SMDS_MeshVolume* >( elem )); break;
|
||||||
@ -9332,6 +9337,8 @@ int SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm,
|
|||||||
NewElem = theHelper.AddVolume(nodes[0], nodes[1], nodes[2], nodes[3], nodes[4], id, theForce3d);
|
NewElem = theHelper.AddVolume(nodes[0], nodes[1], nodes[2], nodes[3], nodes[4], id, theForce3d);
|
||||||
break;
|
break;
|
||||||
case SMDSEntity_Penta:
|
case SMDSEntity_Penta:
|
||||||
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
NewElem = theHelper.AddVolume(nodes[0], nodes[1], nodes[2], nodes[3], nodes[4], nodes[5], id, theForce3d);
|
NewElem = theHelper.AddVolume(nodes[0], nodes[1], nodes[2], nodes[3], nodes[4], nodes[5], id, theForce3d);
|
||||||
break;
|
break;
|
||||||
case SMDSEntity_Hexa:
|
case SMDSEntity_Hexa:
|
||||||
@ -9362,6 +9369,7 @@ int SMESH_MeshEditor::convertElemToQuadratic(SMESHDS_SubMesh * theSm,
|
|||||||
|
|
||||||
void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theToBiQuad)
|
void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theToBiQuad)
|
||||||
{
|
{
|
||||||
|
//MESSAGE("ConvertToQuadratic "<< theForce3d << " " << theToBiQuad);
|
||||||
SMESHDS_Mesh* meshDS = GetMeshDS();
|
SMESHDS_Mesh* meshDS = GetMeshDS();
|
||||||
|
|
||||||
SMESH_MesherHelper aHelper(*myMesh);
|
SMESH_MesherHelper aHelper(*myMesh);
|
||||||
@ -9489,6 +9497,8 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT
|
|||||||
{
|
{
|
||||||
case SMDSEntity_Quad_Hexa: alreadyOK = !theToBiQuad; break;
|
case SMDSEntity_Quad_Hexa: alreadyOK = !theToBiQuad; break;
|
||||||
case SMDSEntity_TriQuad_Hexa: alreadyOK = theToBiQuad; break;
|
case SMDSEntity_TriQuad_Hexa: alreadyOK = theToBiQuad; break;
|
||||||
|
case SMDSEntity_Quad_Penta: alreadyOK = !theToBiQuad; break;
|
||||||
|
case SMDSEntity_BiQuad_Penta: alreadyOK = theToBiQuad; break;
|
||||||
default: alreadyOK = true;
|
default: alreadyOK = true;
|
||||||
}
|
}
|
||||||
if ( alreadyOK )
|
if ( alreadyOK )
|
||||||
@ -9526,8 +9536,13 @@ void SMESH_MeshEditor::ConvertToQuadratic(const bool theForce3d, const bool theT
|
|||||||
nodes[3], nodes[4], id, theForce3d);
|
nodes[3], nodes[4], id, theForce3d);
|
||||||
break;
|
break;
|
||||||
case SMDSEntity_Penta:
|
case SMDSEntity_Penta:
|
||||||
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
NewVolume = aHelper.AddVolume(nodes[0], nodes[1], nodes[2],
|
NewVolume = aHelper.AddVolume(nodes[0], nodes[1], nodes[2],
|
||||||
nodes[3], nodes[4], nodes[5], id, theForce3d);
|
nodes[3], nodes[4], nodes[5], id, theForce3d);
|
||||||
|
for ( size_t i = 15; i < nodes.size(); ++i ) // rm central nodes
|
||||||
|
if ( nodes[i]->NbInverseElements() == 0 )
|
||||||
|
GetMeshDS()->RemoveFreeNode( nodes[i], /*sm=*/0, /*fromGroups=*/true );
|
||||||
break;
|
break;
|
||||||
case SMDSEntity_Hexagonal_Prism:
|
case SMDSEntity_Hexagonal_Prism:
|
||||||
default:
|
default:
|
||||||
@ -12831,3 +12846,482 @@ void SMESH_MeshEditor::copyPosition( const SMDS_MeshNode* from,
|
|||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace // utils for MakePolyLine
|
||||||
|
{
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Sequence of found points and a current point data
|
||||||
|
*/
|
||||||
|
struct Path
|
||||||
|
{
|
||||||
|
std::vector< gp_XYZ > myPoints;
|
||||||
|
double myLength;
|
||||||
|
|
||||||
|
int mySrcPntInd; //!< start point index
|
||||||
|
const SMDS_MeshElement* myFace;
|
||||||
|
SMESH_NodeXYZ myNode1;
|
||||||
|
SMESH_NodeXYZ myNode2;
|
||||||
|
int myNodeInd1;
|
||||||
|
int myNodeInd2;
|
||||||
|
double myDot1;
|
||||||
|
double myDot2;
|
||||||
|
TIDSortedElemSet myElemSet, myAvoidSet;
|
||||||
|
|
||||||
|
Path(): myLength(0.0), myFace(0) {}
|
||||||
|
|
||||||
|
bool SetCutAtCorner( const SMESH_NodeXYZ& cornerNode,
|
||||||
|
const SMDS_MeshElement* face,
|
||||||
|
const gp_XYZ& plnNorm,
|
||||||
|
const gp_XYZ& plnOrig );
|
||||||
|
|
||||||
|
void AddPoint( const gp_XYZ& p );
|
||||||
|
|
||||||
|
bool Extend( const gp_XYZ& plnNorm, const gp_XYZ& plnOrig );
|
||||||
|
|
||||||
|
bool ReachSamePoint( const Path& other );
|
||||||
|
|
||||||
|
static void Remove( std::vector< Path > & paths, size_t& i );
|
||||||
|
};
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Return true if this Path meats another
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
bool Path::ReachSamePoint( const Path& other )
|
||||||
|
{
|
||||||
|
return ( mySrcPntInd != other.mySrcPntInd &&
|
||||||
|
myFace == other.myFace );
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Remove a path from a vector
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void Path::Remove( std::vector< Path > & paths, size_t& i )
|
||||||
|
{
|
||||||
|
if ( paths.size() > 1 )
|
||||||
|
{
|
||||||
|
size_t j = paths.size() - 1; // last item to be removed
|
||||||
|
if ( i < j )
|
||||||
|
{
|
||||||
|
paths[ i ].myPoints.swap( paths[ j ].myPoints );
|
||||||
|
paths[ i ].myLength = paths[ j ].myLength;
|
||||||
|
paths[ i ].mySrcPntInd = paths[ j ].mySrcPntInd;
|
||||||
|
paths[ i ].myFace = paths[ j ].myFace;
|
||||||
|
paths[ i ].myNode1 = paths[ j ].myNode1;
|
||||||
|
paths[ i ].myNode2 = paths[ j ].myNode2;
|
||||||
|
paths[ i ].myNodeInd1 = paths[ j ].myNodeInd1;
|
||||||
|
paths[ i ].myNodeInd2 = paths[ j ].myNodeInd2;
|
||||||
|
paths[ i ].myDot1 = paths[ j ].myDot1;
|
||||||
|
paths[ i ].myDot2 = paths[ j ].myDot2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
paths.pop_back();
|
||||||
|
if ( i > 0 )
|
||||||
|
--i;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Store a point that is at a node of a face if the face is intersected by plane.
|
||||||
|
* Return false if the node is a sole intersection point of the face and the plane
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
bool Path::SetCutAtCorner( const SMESH_NodeXYZ& cornerNode,
|
||||||
|
const SMDS_MeshElement* face,
|
||||||
|
const gp_XYZ& plnNorm,
|
||||||
|
const gp_XYZ& plnOrig )
|
||||||
|
{
|
||||||
|
if ( face == myFace )
|
||||||
|
return false;
|
||||||
|
myNodeInd1 = face->GetNodeIndex( cornerNode._node );
|
||||||
|
myNodeInd2 = ( myNodeInd1 + 1 ) % face->NbCornerNodes();
|
||||||
|
int ind3 = ( myNodeInd1 + 2 ) % face->NbCornerNodes();
|
||||||
|
myNode1.Set( face->GetNode( ind3 ));
|
||||||
|
myNode2.Set( face->GetNode( myNodeInd2 ));
|
||||||
|
|
||||||
|
myDot1 = plnNorm * ( myNode1 - plnOrig );
|
||||||
|
myDot2 = plnNorm * ( myNode2 - plnOrig );
|
||||||
|
|
||||||
|
bool ok = ( myDot1 * myDot2 < 0 );
|
||||||
|
if ( !ok && myDot1 * myDot2 == 0 )
|
||||||
|
{
|
||||||
|
ok = ( myDot1 != myDot2 );
|
||||||
|
if ( ok && myFace )
|
||||||
|
ok = ( myFace->GetNodeIndex(( myDot1 == 0 ? myNode1 : myNode2 )._node ) < 0 );
|
||||||
|
}
|
||||||
|
if ( ok )
|
||||||
|
{
|
||||||
|
myFace = face;
|
||||||
|
myDot1 = 0;
|
||||||
|
AddPoint( cornerNode );
|
||||||
|
}
|
||||||
|
return ok;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Store a point and update myLength
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void Path::AddPoint( const gp_XYZ& p )
|
||||||
|
{
|
||||||
|
if ( !myPoints.empty() )
|
||||||
|
myLength += ( p - myPoints.back() ).Modulus();
|
||||||
|
else
|
||||||
|
myLength = 0;
|
||||||
|
myPoints.push_back( p );
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Try to find the next point
|
||||||
|
* \param [in] plnNorm - cutting plane normal
|
||||||
|
* \param [in] plnOrig - cutting plane origin
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
bool Path::Extend( const gp_XYZ& plnNorm, const gp_XYZ& plnOrig )
|
||||||
|
{
|
||||||
|
int nodeInd3 = ( myNodeInd1 + 1 ) % myFace->NbCornerNodes();
|
||||||
|
if ( myNodeInd2 == nodeInd3 )
|
||||||
|
nodeInd3 = ( myNodeInd1 + 2 ) % myFace->NbCornerNodes();
|
||||||
|
|
||||||
|
SMESH_NodeXYZ node3 = myFace->GetNode( nodeInd3 );
|
||||||
|
double dot3 = plnNorm * ( node3 - plnOrig );
|
||||||
|
|
||||||
|
if ( dot3 * myDot1 < 0. )
|
||||||
|
{
|
||||||
|
myNode2 = node3;
|
||||||
|
myNodeInd2 = nodeInd3;
|
||||||
|
myDot2 = dot3;
|
||||||
|
}
|
||||||
|
else if ( dot3 * myDot2 < 0. )
|
||||||
|
{
|
||||||
|
myNode1 = node3;
|
||||||
|
myNodeInd1 = nodeInd3;
|
||||||
|
myDot1 = dot3;
|
||||||
|
}
|
||||||
|
else if ( dot3 == 0. )
|
||||||
|
{
|
||||||
|
SMDS_ElemIteratorPtr fIt = node3._node->GetInverseElementIterator(SMDSAbs_Face);
|
||||||
|
while ( fIt->more() )
|
||||||
|
if ( SetCutAtCorner( node3, fIt->next(), plnNorm, plnOrig ))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
else if ( myDot2 == 0. )
|
||||||
|
{
|
||||||
|
SMESH_NodeXYZ node2 = myNode2; // copy as myNode2 changes in SetCutAtCorner()
|
||||||
|
SMDS_ElemIteratorPtr fIt = node2._node->GetInverseElementIterator(SMDSAbs_Face);
|
||||||
|
while ( fIt->more() )
|
||||||
|
if ( SetCutAtCorner( node2, fIt->next(), plnNorm, plnOrig ))
|
||||||
|
return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
double r = Abs( myDot1 / ( myDot2 - myDot1 ));
|
||||||
|
AddPoint( myNode1 * ( 1 - r ) + myNode2 * r );
|
||||||
|
|
||||||
|
myAvoidSet.clear();
|
||||||
|
myAvoidSet.insert( myFace );
|
||||||
|
myFace = SMESH_MeshAlgos::FindFaceInSet( myNode1._node, myNode2._node,
|
||||||
|
myElemSet, myAvoidSet,
|
||||||
|
&myNodeInd1, &myNodeInd2 );
|
||||||
|
return myFace;
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Compute a path between two points of PolySegment
|
||||||
|
*/
|
||||||
|
struct PolyPathCompute
|
||||||
|
{
|
||||||
|
SMESH_MeshEditor::TListOfPolySegments& mySegments; //!< inout PolySegment's
|
||||||
|
std::vector< Path >& myPaths; //!< path of each of segments to compute
|
||||||
|
SMESH_Mesh* myMesh;
|
||||||
|
mutable std::vector< std::string > myErrors;
|
||||||
|
|
||||||
|
PolyPathCompute( SMESH_MeshEditor::TListOfPolySegments& theSegments,
|
||||||
|
std::vector< Path >& thePaths,
|
||||||
|
SMESH_Mesh* theMesh):
|
||||||
|
mySegments( theSegments ),
|
||||||
|
myPaths( thePaths ),
|
||||||
|
myMesh( theMesh ),
|
||||||
|
myErrors( theSegments.size() )
|
||||||
|
{
|
||||||
|
}
|
||||||
|
#undef SMESH_CAUGHT
|
||||||
|
#define SMESH_CAUGHT myErrors[i] =
|
||||||
|
void operator() ( const int i ) const
|
||||||
|
{
|
||||||
|
SMESH_TRY;
|
||||||
|
const_cast< PolyPathCompute* >( this )->Compute( i );
|
||||||
|
SMESH_CATCH( SMESH::returnError );
|
||||||
|
}
|
||||||
|
#undef SMESH_CAUGHT
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Compute a path of a given segment
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void Compute( const int iSeg )
|
||||||
|
{
|
||||||
|
SMESH_MeshEditor::PolySegment& polySeg = mySegments[ iSeg ];
|
||||||
|
|
||||||
|
// get a cutting plane
|
||||||
|
|
||||||
|
gp_XYZ p1 = SMESH_NodeXYZ( polySeg.myNode1[0] );
|
||||||
|
gp_XYZ p2 = SMESH_NodeXYZ( polySeg.myNode1[1] );
|
||||||
|
if ( polySeg.myNode2[0] ) p1 = 0.5 * ( p1 + SMESH_NodeXYZ( polySeg.myNode2[0] ));
|
||||||
|
if ( polySeg.myNode2[1] ) p2 = 0.5 * ( p2 + SMESH_NodeXYZ( polySeg.myNode2[1] ));
|
||||||
|
|
||||||
|
gp_XYZ plnNorm = ( p1 - p2 ) ^ polySeg.myVector.XYZ();
|
||||||
|
gp_XYZ plnOrig = p2;
|
||||||
|
|
||||||
|
// find paths connecting the 2 end points of polySeg
|
||||||
|
|
||||||
|
std::vector< Path > paths; paths.reserve(10);
|
||||||
|
|
||||||
|
// initialize paths
|
||||||
|
|
||||||
|
for ( int iP = 0; iP < 2; ++iP ) // loop on the polySeg end points
|
||||||
|
{
|
||||||
|
Path path;
|
||||||
|
path.mySrcPntInd = iP;
|
||||||
|
size_t nbPaths = paths.size();
|
||||||
|
|
||||||
|
if ( polySeg.myNode2[ iP ] && polySeg.myNode2[ iP ] != polySeg.myNode1[ iP ] )
|
||||||
|
{
|
||||||
|
while (( path.myFace = SMESH_MeshAlgos::FindFaceInSet( polySeg.myNode1[ iP ],
|
||||||
|
polySeg.myNode2[ iP ],
|
||||||
|
path.myElemSet,
|
||||||
|
path.myAvoidSet,
|
||||||
|
&path.myNodeInd1,
|
||||||
|
&path.myNodeInd2 )))
|
||||||
|
{
|
||||||
|
path.myNode1.Set( polySeg.myNode1[ iP ]);
|
||||||
|
path.myNode2.Set( polySeg.myNode2[ iP ]);
|
||||||
|
path.myDot1 = plnNorm * ( path.myNode1 - plnOrig );
|
||||||
|
path.myDot2 = plnNorm * ( path.myNode2 - plnOrig );
|
||||||
|
path.myPoints.clear();
|
||||||
|
path.AddPoint( 0.5 * ( path.myNode1 + path.myNode2 ));
|
||||||
|
path.myAvoidSet.insert( path.myFace );
|
||||||
|
paths.push_back( path );
|
||||||
|
}
|
||||||
|
if ( nbPaths == paths.size() )
|
||||||
|
throw SALOME_Exception ( SMESH_Comment("No face edge found by point ") << iP+1
|
||||||
|
<< " in a PolySegment " << iSeg );
|
||||||
|
}
|
||||||
|
else // an end point is at node
|
||||||
|
{
|
||||||
|
std::set<const SMDS_MeshNode* > nodes;
|
||||||
|
SMDS_ElemIteratorPtr fIt = polySeg.myNode1[ iP ]->GetInverseElementIterator(SMDSAbs_Face);
|
||||||
|
while ( fIt->more() )
|
||||||
|
{
|
||||||
|
path.myPoints.clear();
|
||||||
|
if ( path.SetCutAtCorner( polySeg.myNode1[ iP ], fIt->next(), plnNorm, plnOrig ))
|
||||||
|
{
|
||||||
|
if (( path.myDot1 * path.myDot2 != 0 ) ||
|
||||||
|
( nodes.insert( path.myDot1 == 0 ? path.myNode1._node : path.myNode2._node ).second ))
|
||||||
|
paths.push_back( path );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// look for a one-segment path
|
||||||
|
for ( size_t i = 0; i < nbPaths; ++i )
|
||||||
|
for ( size_t j = nbPaths; j < paths.size(); ++j )
|
||||||
|
if ( paths[i].myFace == paths[j].myFace )
|
||||||
|
{
|
||||||
|
myPaths[ iSeg ].myPoints.push_back( paths[i].myPoints[0] );
|
||||||
|
myPaths[ iSeg ].myPoints.push_back( paths[j].myPoints[0] );
|
||||||
|
paths.clear();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// extend paths
|
||||||
|
|
||||||
|
myPaths[ iSeg ].myLength = 1e100;
|
||||||
|
|
||||||
|
while ( paths.size() >= 2 )
|
||||||
|
{
|
||||||
|
for ( size_t i = 0; i < paths.size(); ++i )
|
||||||
|
{
|
||||||
|
Path& path = paths[ i ];
|
||||||
|
if ( !path.Extend( plnNorm, plnOrig ) || // path reached a mesh boundary
|
||||||
|
path.myLength > myPaths[ iSeg ].myLength ) // path is longer than others
|
||||||
|
{
|
||||||
|
Path::Remove( paths, i );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// join paths that reach same point
|
||||||
|
for ( size_t j = 0; j < paths.size(); ++j )
|
||||||
|
{
|
||||||
|
if ( i != j && paths[i].ReachSamePoint( paths[j] ))
|
||||||
|
{
|
||||||
|
double distLast = ( paths[i].myPoints.back() - paths[j].myPoints.back() ).Modulus();
|
||||||
|
double fullLength = ( paths[i].myLength + paths[j].myLength + distLast );
|
||||||
|
if ( fullLength < myPaths[ iSeg ].myLength )
|
||||||
|
{
|
||||||
|
myPaths[ iSeg ].myLength = fullLength;
|
||||||
|
std::vector< gp_XYZ > & allPoints = myPaths[ iSeg ].myPoints;
|
||||||
|
allPoints.swap( paths[i].myPoints );
|
||||||
|
allPoints.insert( allPoints.end(),
|
||||||
|
paths[j].myPoints.rbegin(),
|
||||||
|
paths[j].myPoints.rend() );
|
||||||
|
}
|
||||||
|
Path::Remove( paths, i );
|
||||||
|
Path::Remove( paths, j );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( !paths.empty() && (int) paths[0].myPoints.size() > myMesh->NbFaces() )
|
||||||
|
throw SALOME_Exception(LOCALIZED( "Infinite loop in MakePolyLine()"));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( myPaths[ iSeg ].myPoints.empty() )
|
||||||
|
throw SALOME_Exception( SMESH_Comment("Can't find a full path for PolySegment #") << iSeg );
|
||||||
|
|
||||||
|
} // PolyPathCompute::Compute()
|
||||||
|
|
||||||
|
}; // struct PolyPathCompute
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : MakePolyLine
|
||||||
|
//purpose : Create a polyline consisting of 1D mesh elements each lying on a 2D element of
|
||||||
|
// the initial mesh
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
void SMESH_MeshEditor::MakePolyLine( TListOfPolySegments& theSegments,
|
||||||
|
SMESHDS_Group* theGroup,
|
||||||
|
SMESH_ElementSearcher* theSearcher)
|
||||||
|
{
|
||||||
|
std::vector< Path > segPaths( theSegments.size() ); // path of each of segments
|
||||||
|
|
||||||
|
SMESH_ElementSearcher* searcher = theSearcher;
|
||||||
|
SMESHUtils::Deleter<SMESH_ElementSearcher> delSearcher;
|
||||||
|
if ( !searcher )
|
||||||
|
{
|
||||||
|
searcher = SMESH_MeshAlgos::GetElementSearcher( *GetMeshDS() );
|
||||||
|
delSearcher._obj = searcher;
|
||||||
|
}
|
||||||
|
|
||||||
|
// get cutting planes
|
||||||
|
|
||||||
|
std::vector< bool > isVectorOK( theSegments.size(), true );
|
||||||
|
const double planarCoef = 0.333; // plane height in planar case
|
||||||
|
|
||||||
|
for ( size_t iSeg = 0; iSeg < theSegments.size(); ++iSeg )
|
||||||
|
{
|
||||||
|
PolySegment& polySeg = theSegments[ iSeg ];
|
||||||
|
|
||||||
|
gp_XYZ p1 = SMESH_NodeXYZ( polySeg.myNode1[0] );
|
||||||
|
gp_XYZ p2 = SMESH_NodeXYZ( polySeg.myNode1[1] );
|
||||||
|
if ( polySeg.myNode2[0] ) p1 = 0.5 * ( p1 + SMESH_NodeXYZ( polySeg.myNode2[0] ));
|
||||||
|
if ( polySeg.myNode2[1] ) p2 = 0.5 * ( p2 + SMESH_NodeXYZ( polySeg.myNode2[1] ));
|
||||||
|
|
||||||
|
gp_XYZ plnNorm = ( p1 - p2 ) ^ polySeg.myVector.XYZ();
|
||||||
|
|
||||||
|
isVectorOK[ iSeg ] = ( plnNorm.Modulus() > std::numeric_limits<double>::min() );
|
||||||
|
if ( !isVectorOK[ iSeg ])
|
||||||
|
{
|
||||||
|
gp_XYZ pMid = 0.5 * ( p1 + p2 );
|
||||||
|
const SMDS_MeshElement* face;
|
||||||
|
polySeg.myMidProjPoint = searcher->Project( pMid, SMDSAbs_Face, &face );
|
||||||
|
polySeg.myVector = polySeg.myMidProjPoint.XYZ() - pMid;
|
||||||
|
|
||||||
|
gp_XYZ faceNorm;
|
||||||
|
SMESH_MeshAlgos::FaceNormal( face, faceNorm );
|
||||||
|
|
||||||
|
if ( polySeg.myVector.Magnitude() < Precision::Confusion() ||
|
||||||
|
polySeg.myVector * faceNorm < Precision::Confusion() )
|
||||||
|
{
|
||||||
|
polySeg.myVector = faceNorm;
|
||||||
|
polySeg.myMidProjPoint = pMid + faceNorm * ( p1 - p2 ).Modulus() * planarCoef;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
polySeg.myVector = plnNorm ^ ( p1 - p2 );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// assure that inverse elements are constructed, avoid their concurrent building in threads
|
||||||
|
GetMeshDS()->nodesIterator()->next()->NbInverseElements();
|
||||||
|
|
||||||
|
// find paths
|
||||||
|
|
||||||
|
PolyPathCompute algo( theSegments, segPaths, myMesh );
|
||||||
|
OSD_Parallel::For( 0, theSegments.size(), algo, theSegments.size() == 1 );
|
||||||
|
|
||||||
|
for ( size_t iSeg = 0; iSeg < theSegments.size(); ++iSeg )
|
||||||
|
if ( !algo.myErrors[ iSeg ].empty() )
|
||||||
|
throw SALOME_Exception( algo.myErrors[ iSeg ].c_str() );
|
||||||
|
|
||||||
|
// create an 1D mesh
|
||||||
|
|
||||||
|
const SMDS_MeshNode *n, *nPrev = 0;
|
||||||
|
SMESHDS_Mesh* mesh = GetMeshDS();
|
||||||
|
|
||||||
|
for ( size_t iSeg = 0; iSeg < theSegments.size(); ++iSeg )
|
||||||
|
{
|
||||||
|
const Path& path = segPaths[iSeg];
|
||||||
|
if ( path.myPoints.size() < 2 )
|
||||||
|
continue;
|
||||||
|
|
||||||
|
double tol = path.myLength / path.myPoints.size() / 1000.;
|
||||||
|
if ( !nPrev || ( SMESH_NodeXYZ( nPrev ) - path.myPoints[0] ).SquareModulus() > tol*tol )
|
||||||
|
{
|
||||||
|
nPrev = mesh->AddNode( path.myPoints[0].X(), path.myPoints[0].Y(), path.myPoints[0].Z() );
|
||||||
|
myLastCreatedNodes.Append( nPrev );
|
||||||
|
}
|
||||||
|
for ( size_t iP = 1; iP < path.myPoints.size(); ++iP )
|
||||||
|
{
|
||||||
|
n = mesh->AddNode( path.myPoints[iP].X(), path.myPoints[iP].Y(), path.myPoints[iP].Z() );
|
||||||
|
myLastCreatedNodes.Append( n );
|
||||||
|
|
||||||
|
const SMDS_MeshElement* elem = mesh->AddEdge( nPrev, n );
|
||||||
|
myLastCreatedElems.Append( elem );
|
||||||
|
if ( theGroup )
|
||||||
|
theGroup->Add( elem );
|
||||||
|
|
||||||
|
nPrev = n;
|
||||||
|
}
|
||||||
|
|
||||||
|
// return a vector
|
||||||
|
|
||||||
|
gp_XYZ pMid = 0.5 * ( path.myPoints[0] + path.myPoints.back() );
|
||||||
|
if ( isVectorOK[ iSeg ])
|
||||||
|
{
|
||||||
|
// find the most distance point of a path
|
||||||
|
double maxDist = 0;
|
||||||
|
for ( size_t iP = 1; iP < path.myPoints.size(); ++iP )
|
||||||
|
{
|
||||||
|
double dist = Abs( theSegments[iSeg].myVector * ( path.myPoints[iP] - path.myPoints[0] ));
|
||||||
|
if ( dist > maxDist )
|
||||||
|
{
|
||||||
|
maxDist = dist;
|
||||||
|
theSegments[iSeg].myMidProjPoint = path.myPoints[iP];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( maxDist < Precision::Confusion() ) // planar case
|
||||||
|
theSegments[iSeg].myMidProjPoint =
|
||||||
|
pMid + theSegments[iSeg].myVector.XYZ().Normalized() * path.myLength * planarCoef;
|
||||||
|
}
|
||||||
|
theSegments[iSeg].myVector = gp_Vec( pMid, theSegments[iSeg].myMidProjPoint );
|
||||||
|
}
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
@ -46,8 +46,10 @@
|
|||||||
class SMDS_MeshElement;
|
class SMDS_MeshElement;
|
||||||
class SMDS_MeshFace;
|
class SMDS_MeshFace;
|
||||||
class SMDS_MeshNode;
|
class SMDS_MeshNode;
|
||||||
|
class SMESHDS_Group;
|
||||||
class SMESHDS_Mesh;
|
class SMESHDS_Mesh;
|
||||||
class SMESHDS_SubMesh;
|
class SMESHDS_SubMesh;
|
||||||
|
class SMESH_ElementSearcher;
|
||||||
class SMESH_Group;
|
class SMESH_Group;
|
||||||
class SMESH_Mesh;
|
class SMESH_Mesh;
|
||||||
class SMESH_MesherHelper;
|
class SMESH_MesherHelper;
|
||||||
@ -173,7 +175,7 @@ public:
|
|||||||
* \param theElems - The triangles to be fused.
|
* \param theElems - The triangles to be fused.
|
||||||
* \param theCriterion - Is used to choose a neighbour to fuse with.
|
* \param theCriterion - Is used to choose a neighbour to fuse with.
|
||||||
* \param theMaxAngle - Is a max angle between element normals at which fusion
|
* \param theMaxAngle - Is a max angle between element normals at which fusion
|
||||||
* is still performed; theMaxAngle is mesured in radians.
|
* is still performed; theMaxAngle is measured in radians.
|
||||||
* \return bool - Success or not.
|
* \return bool - Success or not.
|
||||||
*/
|
*/
|
||||||
bool TriToQuad (TIDSortedElemSet & theElems,
|
bool TriToQuad (TIDSortedElemSet & theElems,
|
||||||
@ -181,7 +183,7 @@ public:
|
|||||||
const double theMaxAngle);
|
const double theMaxAngle);
|
||||||
/*!
|
/*!
|
||||||
* \brief Split quadrangles into triangles.
|
* \brief Split quadrangles into triangles.
|
||||||
* \param theElems - The faces to be splitted.
|
* \param theElems - The faces to be split.
|
||||||
* \param theCriterion - Is used to choose a diagonal for splitting.
|
* \param theCriterion - Is used to choose a diagonal for splitting.
|
||||||
* \return bool - Success or not.
|
* \return bool - Success or not.
|
||||||
*/
|
*/
|
||||||
@ -189,7 +191,7 @@ public:
|
|||||||
SMESH::Controls::NumericalFunctorPtr theCriterion);
|
SMESH::Controls::NumericalFunctorPtr theCriterion);
|
||||||
/*!
|
/*!
|
||||||
* \brief Split quadrangles into triangles.
|
* \brief Split quadrangles into triangles.
|
||||||
* \param theElems - The faces to be splitted.
|
* \param theElems - The faces to be split.
|
||||||
* \param the13Diag - Is used to choose a diagonal for splitting.
|
* \param the13Diag - Is used to choose a diagonal for splitting.
|
||||||
* \return bool - Success or not.
|
* \return bool - Success or not.
|
||||||
*/
|
*/
|
||||||
@ -707,6 +709,42 @@ public:
|
|||||||
bool toAddExistingBondary = false,
|
bool toAddExistingBondary = false,
|
||||||
bool aroundElements = false);
|
bool aroundElements = false);
|
||||||
|
|
||||||
|
|
||||||
|
// structure used in MakePolyLine() to define a cutting plane
|
||||||
|
struct PolySegment
|
||||||
|
{
|
||||||
|
// 2 points: if myNode2 != 0, then the point is the middle of a face edge defined
|
||||||
|
// by two nodes, else it is at myNode1
|
||||||
|
const SMDS_MeshNode* myNode1[2];
|
||||||
|
const SMDS_MeshNode* myNode2[2];
|
||||||
|
|
||||||
|
gp_Vec myVector; // vector on the plane; to use a default plane set vector = (0,0,0)
|
||||||
|
|
||||||
|
// point to return coordinates of a middle of the two points, projected to mesh
|
||||||
|
gp_Pnt myMidProjPoint;
|
||||||
|
};
|
||||||
|
typedef std::vector<PolySegment> TListOfPolySegments;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Create a polyline consisting of 1D mesh elements each lying on a 2D element of
|
||||||
|
* the initial mesh. Positions of new nodes are found by cutting the mesh by the
|
||||||
|
* plane passing through pairs of points specified by each PolySegment structure.
|
||||||
|
* If there are several paths connecting a pair of points, the shortest path is
|
||||||
|
* selected by the module. Position of the cutting plane is defined by the two
|
||||||
|
* points and an optional vector lying on the plane specified by a PolySegment.
|
||||||
|
* By default the vector is defined by Mesh module as following. A middle point
|
||||||
|
* of the two given points is computed. The middle point is projected to the mesh.
|
||||||
|
* The vector goes from the middle point to the projection point. In case of planar
|
||||||
|
* mesh, the vector is normal to the mesh.
|
||||||
|
* \param [inout] segments - PolySegment's defining positions of cutting planes.
|
||||||
|
* Return the used vector and position of the middle point.
|
||||||
|
* \param [in] group - an optional group where created mesh segments will
|
||||||
|
* be added.
|
||||||
|
*/
|
||||||
|
void MakePolyLine( TListOfPolySegments& segments,
|
||||||
|
SMESHDS_Group* group=0,
|
||||||
|
SMESH_ElementSearcher* searcher=0);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -2179,13 +2179,30 @@ SMDS_MeshVolume* SMESH_MesherHelper::AddVolume(const SMDS_MeshNode* n1,
|
|||||||
const SMDS_MeshNode* n14 = GetMediumNode( n1, n4, force3d, TopAbs_SOLID );
|
const SMDS_MeshNode* n14 = GetMediumNode( n1, n4, force3d, TopAbs_SOLID );
|
||||||
const SMDS_MeshNode* n25 = GetMediumNode( n2, n5, force3d, TopAbs_SOLID );
|
const SMDS_MeshNode* n25 = GetMediumNode( n2, n5, force3d, TopAbs_SOLID );
|
||||||
const SMDS_MeshNode* n36 = GetMediumNode( n3, n6, force3d, TopAbs_SOLID );
|
const SMDS_MeshNode* n36 = GetMediumNode( n3, n6, force3d, TopAbs_SOLID );
|
||||||
|
if ( myCreateBiQuadratic )
|
||||||
|
{
|
||||||
|
const SMDS_MeshNode* n1245 = GetCentralNode( n1,n2,n4,n5,n12,n25,n45,n14,force3d );
|
||||||
|
const SMDS_MeshNode* n1346 = GetCentralNode( n1,n3,n4,n6,n31,n36,n64,n14,force3d );
|
||||||
|
const SMDS_MeshNode* n2356 = GetCentralNode( n2,n3,n6,n5,n23,n36,n56,n25,force3d );
|
||||||
|
|
||||||
if(id)
|
if(id)
|
||||||
elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6,
|
elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6,
|
||||||
n12, n23, n31, n45, n56, n64, n14, n25, n36, id);
|
n12, n23, n31, n45, n56, n64, n14, n25, n36,
|
||||||
|
n1245, n2356, n1346, id);
|
||||||
|
else
|
||||||
|
elem = meshDS->AddVolume(n1, n2, n3, n4, n5, n6,
|
||||||
|
n12, n23, n31, n45, n56, n64, n14, n25, n36,
|
||||||
|
n1245, n2356, n1346);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
elem = meshDS->AddVolume(n1, n2, n3, n4, n5, n6,
|
{
|
||||||
n12, n23, n31, n45, n56, n64, n14, n25, n36);
|
if(id)
|
||||||
|
elem = meshDS->AddVolumeWithID(n1, n2, n3, n4, n5, n6,
|
||||||
|
n12, n23, n31, n45, n56, n64, n14, n25, n36, id);
|
||||||
|
else
|
||||||
|
elem = meshDS->AddVolume(n1, n2, n3, n4, n5, n6,
|
||||||
|
n12, n23, n31, n45, n56, n64, n14, n25, n36);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if ( mySetElemOnShape && myShapeID > 0 )
|
if ( mySetElemOnShape && myShapeID > 0 )
|
||||||
meshDS->SetMeshElementOnShape( elem, myShapeID );
|
meshDS->SetMeshElementOnShape( elem, myShapeID );
|
||||||
@ -3443,6 +3460,24 @@ double SMESH_MesherHelper::GetOtherParam(const double param) const
|
|||||||
return fabs(param-myPar1[i]) < fabs(param-myPar2[i]) ? myPar2[i] : myPar1[i];
|
return fabs(param-myPar1[i]) < fabs(param-myPar2[i]) ? myPar2[i] : myPar1[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : NbRealSeam
|
||||||
|
//purpose : Return a number of real seam edges in the shape set through
|
||||||
|
// IsQuadraticSubMesh() or SetSubShape(). A real seam edge encounters twice in a wire
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
size_t SMESH_MesherHelper::NbRealSeam() const
|
||||||
|
{
|
||||||
|
size_t nb = 0;
|
||||||
|
|
||||||
|
std::set< int >::const_iterator id = mySeamShapeIds.begin();
|
||||||
|
for ( ; id != mySeamShapeIds.end(); ++id )
|
||||||
|
if ( *id < 0 ) ++nb;
|
||||||
|
else break;
|
||||||
|
|
||||||
|
return nb;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : IsOnSeam
|
//function : IsOnSeam
|
||||||
//purpose : Check if UV is on seam. Return 0 if not, 1 for U seam, 2 for V seam
|
//purpose : Check if UV is on seam. Return 0 if not, 1 for U seam, 2 for V seam
|
||||||
@ -4866,6 +4901,7 @@ namespace { // Structures used by FixQuadraticElements()
|
|||||||
void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
|
void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
|
||||||
bool volumeOnly)
|
bool volumeOnly)
|
||||||
{
|
{
|
||||||
|
//MESSAGE("FixQuadraticElements " << volumeOnly);
|
||||||
// setenv NO_FixQuadraticElements to know if FixQuadraticElements() is guilty of bad conversion
|
// setenv NO_FixQuadraticElements to know if FixQuadraticElements() is guilty of bad conversion
|
||||||
if ( getenv("NO_FixQuadraticElements") )
|
if ( getenv("NO_FixQuadraticElements") )
|
||||||
return;
|
return;
|
||||||
@ -4907,6 +4943,7 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
|
|||||||
nbfaces = faces.Extent(); /*avoid "unused varianbles": */ nbfaces++, nbfaces--;
|
nbfaces = faces.Extent(); /*avoid "unused varianbles": */ nbfaces++, nbfaces--;
|
||||||
#endif
|
#endif
|
||||||
for ( TopTools_MapIteratorOfMapOfShape fIt( faces ); fIt.More(); fIt.Next() ) {
|
for ( TopTools_MapIteratorOfMapOfShape fIt( faces ); fIt.More(); fIt.Next() ) {
|
||||||
|
MESSAGE("FIX FACE " << nbfaces-- << " #" << GetMeshDS()->ShapeToIndex(fIt.Key()));
|
||||||
MSG("FIX FACE " << nbfaces-- << " #" << GetMeshDS()->ShapeToIndex(fIt.Key()));
|
MSG("FIX FACE " << nbfaces-- << " #" << GetMeshDS()->ShapeToIndex(fIt.Key()));
|
||||||
SMESH_MesherHelper h(*myMesh);
|
SMESH_MesherHelper h(*myMesh);
|
||||||
h.SetSubShape( fIt.Key() );
|
h.SetSubShape( fIt.Key() );
|
||||||
@ -5107,7 +5144,7 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
|
|||||||
MSG("Internal chain - ignore");
|
MSG("Internal chain - ignore");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// mesure chain length and compute link position along the chain
|
// measure chain length and compute link position along the chain
|
||||||
double chainLen = 0;
|
double chainLen = 0;
|
||||||
vector< double > linkPos;
|
vector< double > linkPos;
|
||||||
TChain savedChain; // backup
|
TChain savedChain; // backup
|
||||||
@ -5263,10 +5300,11 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
|
|||||||
// 4. Move nodes
|
// 4. Move nodes
|
||||||
// -------------
|
// -------------
|
||||||
|
|
||||||
TIDSortedElemSet biQuadQuas, biQuadTris, triQuadHexa;
|
TIDSortedElemSet biQuadQuas, biQuadTris, triQuadHexa, biQuadPenta;
|
||||||
const bool toFixCentralNodes = ( myMesh->NbBiQuadQuadrangles() +
|
const bool toFixCentralNodes = ( myMesh->NbBiQuadQuadrangles() +
|
||||||
myMesh->NbBiQuadTriangles() +
|
myMesh->NbBiQuadTriangles() +
|
||||||
myMesh->NbTriQuadraticHexas() );
|
myMesh->NbTriQuadraticHexas() +
|
||||||
|
myMesh->NbBiQuadPrisms());
|
||||||
double distXYZ[4];
|
double distXYZ[4];
|
||||||
faceHlp.ToFixNodeParameters( true );
|
faceHlp.ToFixNodeParameters( true );
|
||||||
|
|
||||||
@ -5302,6 +5340,7 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
|
|||||||
case SMDSEntity_BiQuad_Quadrangle: biQuadQuas.insert( e ); break;
|
case SMDSEntity_BiQuad_Quadrangle: biQuadQuas.insert( e ); break;
|
||||||
case SMDSEntity_BiQuad_Triangle: biQuadTris.insert( e ); break;
|
case SMDSEntity_BiQuad_Triangle: biQuadTris.insert( e ); break;
|
||||||
case SMDSEntity_TriQuad_Hexa: triQuadHexa.insert( e ); break;
|
case SMDSEntity_TriQuad_Hexa: triQuadHexa.insert( e ); break;
|
||||||
|
case SMDSEntity_BiQuad_Penta: biQuadPenta.insert( e ); break;
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -5452,6 +5491,16 @@ void SMESH_MesherHelper::FixQuadraticElements(SMESH_ComputeErrorPtr& compError,
|
|||||||
nCenterCoords.X(), nCenterCoords.Y(), nCenterCoords.Z());
|
nCenterCoords.X(), nCenterCoords.Y(), nCenterCoords.Z());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// treat tri-quadratic hexahedra
|
||||||
|
{
|
||||||
|
SMDS_VolumeTool volExp;
|
||||||
|
TIDSortedElemSet::iterator pentIt = biQuadPenta.begin();
|
||||||
|
for ( ; pentIt != biQuadPenta.end(); ++pentIt )
|
||||||
|
{
|
||||||
|
MESSAGE("---");
|
||||||
|
volExp.Set( *pentIt, /*ignoreCentralNodes=*/false );
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
// avoid warning: defined but not used operator<<()
|
// avoid warning: defined but not used operator<<()
|
||||||
SMESH_Comment() << *links.begin() << *faces.begin();
|
SMESH_Comment() << *links.begin() << *faces.begin();
|
||||||
|
@ -52,7 +52,7 @@ typedef std::map<SMESH_TLink, const SMDS_MeshNode*>::iterator ItTLinkNode;
|
|||||||
|
|
||||||
typedef SMDS_Iterator<const TopoDS_Shape*> PShapeIterator;
|
typedef SMDS_Iterator<const TopoDS_Shape*> PShapeIterator;
|
||||||
typedef boost::shared_ptr< PShapeIterator > PShapeIteratorPtr;
|
typedef boost::shared_ptr< PShapeIterator > PShapeIteratorPtr;
|
||||||
|
|
||||||
typedef std::vector<const SMDS_MeshNode* > TNodeColumn;
|
typedef std::vector<const SMDS_MeshNode* > TNodeColumn;
|
||||||
typedef std::map< double, TNodeColumn > TParam2ColumnMap;
|
typedef std::map< double, TNodeColumn > TParam2ColumnMap;
|
||||||
|
|
||||||
@ -561,9 +561,15 @@ public:
|
|||||||
/*!
|
/*!
|
||||||
* \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
|
* \brief Check if the shape set through IsQuadraticSubMesh() or SetSubShape()
|
||||||
* has a degenerated edges
|
* has a degenerated edges
|
||||||
* \retval bool - true if it has
|
* \retval bool - true if there are degenerated edges
|
||||||
*/
|
*/
|
||||||
bool HasDegeneratedEdges() const { return !myDegenShapeIds.empty(); }
|
bool HasDegeneratedEdges() const { return !myDegenShapeIds.empty(); }
|
||||||
|
/*!
|
||||||
|
* \brief Return a number of degenerated edges in the shape set through
|
||||||
|
* IsQuadraticSubMesh() or SetSubShape()
|
||||||
|
* \retval size_t - nb edges
|
||||||
|
*/
|
||||||
|
size_t NbDegeneratedEdges() const { return myDegenShapeIds.size(); }
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Check if shape is a seam edge or it's vertex
|
* \brief Check if shape is a seam edge or it's vertex
|
||||||
@ -610,6 +616,12 @@ public:
|
|||||||
* \retval bool - true if it has
|
* \retval bool - true if it has
|
||||||
*/
|
*/
|
||||||
bool HasRealSeam() const { return HasSeam() && ( *mySeamShapeIds.begin() < 0 ); }
|
bool HasRealSeam() const { return HasSeam() && ( *mySeamShapeIds.begin() < 0 ); }
|
||||||
|
/*!
|
||||||
|
* \brief Return a number of real seam edges in the shape set through
|
||||||
|
* IsQuadraticSubMesh() or SetSubShape(). A real seam edge encounters twice in a wire
|
||||||
|
* \retval size_t - nb of real seams
|
||||||
|
*/
|
||||||
|
size_t NbRealSeam() const;
|
||||||
/*!
|
/*!
|
||||||
* \brief Return index of periodic parametric direction of a closed face
|
* \brief Return index of periodic parametric direction of a closed face
|
||||||
* \retval int - 1 for U, 2 for V direction
|
* \retval int - 1 for U, 2 for V direction
|
||||||
|
@ -75,8 +75,6 @@
|
|||||||
#include <gp_XY.hxx>
|
#include <gp_XY.hxx>
|
||||||
#include <gp_XYZ.hxx>
|
#include <gp_XYZ.hxx>
|
||||||
|
|
||||||
#include <Basics_OCCTVersion.hxx>
|
|
||||||
|
|
||||||
#include <Basics_Utils.hxx>
|
#include <Basics_Utils.hxx>
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ SMESH_ProxyMesh::SMESH_ProxyMesh(std::vector<SMESH_ProxyMesh::Ptr>& components):
|
|||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Destructor deletes proxy submeshes and tmp elemens
|
* \brief Destructor deletes proxy submeshes and tmp elements
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
|
@ -38,8 +38,6 @@
|
|||||||
#include "SMESH_MesherHelper.hxx"
|
#include "SMESH_MesherHelper.hxx"
|
||||||
#include "SMESH_subMeshEventListener.hxx"
|
#include "SMESH_subMeshEventListener.hxx"
|
||||||
|
|
||||||
#include <Basics_OCCTVersion.hxx>
|
|
||||||
|
|
||||||
#include "utilities.h"
|
#include "utilities.h"
|
||||||
#include "OpUtil.hxx"
|
#include "OpUtil.hxx"
|
||||||
#include "Basics_Utils.hxx"
|
#include "Basics_Utils.hxx"
|
||||||
|
@ -684,6 +684,43 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2,
|
|||||||
myIntegers.push_back(n36);
|
myIntegers.push_back(n36);
|
||||||
myNumber++;
|
myNumber++;
|
||||||
}
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : AddVolume
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
|
void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2,
|
||||||
|
int n3, int n4, int n5,int n6,
|
||||||
|
int n12, int n23, int n31,
|
||||||
|
int n45, int n56, int n64,
|
||||||
|
int n14, int n25, int n36,
|
||||||
|
int n1245, int n2356, int n1346)
|
||||||
|
{
|
||||||
|
if ( myType != SMESHDS_AddBiQuadPentahedron) {
|
||||||
|
MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
myIntegers.push_back(NewVolID);
|
||||||
|
myIntegers.push_back(n1);
|
||||||
|
myIntegers.push_back(n2);
|
||||||
|
myIntegers.push_back(n3);
|
||||||
|
myIntegers.push_back(n4);
|
||||||
|
myIntegers.push_back(n5);
|
||||||
|
myIntegers.push_back(n6);
|
||||||
|
myIntegers.push_back(n12);
|
||||||
|
myIntegers.push_back(n23);
|
||||||
|
myIntegers.push_back(n31);
|
||||||
|
myIntegers.push_back(n45);
|
||||||
|
myIntegers.push_back(n56);
|
||||||
|
myIntegers.push_back(n64);
|
||||||
|
myIntegers.push_back(n14);
|
||||||
|
myIntegers.push_back(n25);
|
||||||
|
myIntegers.push_back(n36);
|
||||||
|
myIntegers.push_back(n1245);
|
||||||
|
myIntegers.push_back(n2356);
|
||||||
|
myIntegers.push_back(n1346);
|
||||||
|
myNumber++;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AddVolume
|
//function : AddVolume
|
||||||
@ -735,7 +772,7 @@ void SMESHDS_Command::AddVolume(int NewVolID, int n1, int n2, int n3,
|
|||||||
int n1234,int n1256,int n2367,int n3478,
|
int n1234,int n1256,int n2367,int n3478,
|
||||||
int n1458,int n5678,int nCenter)
|
int n1458,int n5678,int nCenter)
|
||||||
{
|
{
|
||||||
if ( myType != SMESHDS_AddQuadHexahedron) {
|
if ( myType != SMESHDS_AddTriQuadHexa) {
|
||||||
MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
|
MESSAGE("SMESHDS_Command::AddVolume : Bad Type");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -83,6 +83,12 @@ class SMESHDS_EXPORT SMESHDS_Command
|
|||||||
int n12, int n23, int n31,
|
int n12, int n23, int n31,
|
||||||
int n45, int n56, int n64,
|
int n45, int n56, int n64,
|
||||||
int n14, int n25, int n36);
|
int n14, int n25, int n36);
|
||||||
|
void AddVolume(int NewVolID, int n1, int n2, int n3,
|
||||||
|
int n4, int n5, int n6,
|
||||||
|
int n12, int n23, int n31,
|
||||||
|
int n45, int n56, int n64,
|
||||||
|
int n14, int n25, int n36,
|
||||||
|
int n1245, int n2356, int n1346);
|
||||||
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
|
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
|
||||||
int n5, int n6, int n7, int n8,
|
int n5, int n6, int n7, int n8,
|
||||||
int n12, int n23, int n34, int n41,
|
int n12, int n23, int n34, int n41,
|
||||||
|
@ -58,6 +58,7 @@ enum SMESHDS_CommandType {
|
|||||||
SMESHDS_Add0DElement,
|
SMESHDS_Add0DElement,
|
||||||
SMESHDS_AddBiQuadTriangle,
|
SMESHDS_AddBiQuadTriangle,
|
||||||
SMESHDS_AddBiQuadQuadrangle,
|
SMESHDS_AddBiQuadQuadrangle,
|
||||||
|
SMESHDS_AddBiQuadPentahedron,
|
||||||
SMESHDS_AddTriQuadHexa,
|
SMESHDS_AddTriQuadHexa,
|
||||||
SMESHDS_AddHexagonalPrism,
|
SMESHDS_AddHexagonalPrism,
|
||||||
SMESHDS_AddBall
|
SMESHDS_AddBall
|
||||||
|
@ -1862,7 +1862,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AddVolume
|
//function : AddVolume
|
||||||
//purpose :
|
//purpose : 2nd order pentahedron (prism) with 15 nodes
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
|
SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
|
||||||
const SMDS_MeshNode * n2,
|
const SMDS_MeshNode * n2,
|
||||||
@ -1893,7 +1893,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AddVolumeWithID
|
//function : AddVolumeWithID
|
||||||
//purpose :
|
//purpose : 2nd order pentahedron (prism) with 15 nodes
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
|
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
|
||||||
int n4, int n5, int n6,
|
int n4, int n5, int n6,
|
||||||
@ -1909,10 +1909,96 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
|
|||||||
n45,n56,n64,n14,n25,n36);
|
n45,n56,n64,n14,n25,n36);
|
||||||
return anElem;
|
return anElem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : AddVolumeWithID
|
||||||
|
//purpose : 2d order Pentahedron (prism) with 15 nodes
|
||||||
|
//=======================================================================
|
||||||
|
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
||||||
|
const SMDS_MeshNode * n2,
|
||||||
|
const SMDS_MeshNode * n3,
|
||||||
|
const SMDS_MeshNode * n4,
|
||||||
|
const SMDS_MeshNode * n5,
|
||||||
|
const SMDS_MeshNode * n6,
|
||||||
|
const SMDS_MeshNode * n12,
|
||||||
|
const SMDS_MeshNode * n23,
|
||||||
|
const SMDS_MeshNode * n31,
|
||||||
|
const SMDS_MeshNode * n45,
|
||||||
|
const SMDS_MeshNode * n56,
|
||||||
|
const SMDS_MeshNode * n64,
|
||||||
|
const SMDS_MeshNode * n14,
|
||||||
|
const SMDS_MeshNode * n25,
|
||||||
|
const SMDS_MeshNode * n36,
|
||||||
|
int ID)
|
||||||
|
{
|
||||||
|
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(),
|
||||||
|
n4->GetID(), n5->GetID(), n6->GetID(),
|
||||||
|
n12->GetID(), n23->GetID(), n31->GetID(),
|
||||||
|
n45->GetID(), n56->GetID(), n64->GetID(),
|
||||||
|
n14->GetID(), n25->GetID(), n36->GetID(),
|
||||||
|
ID);
|
||||||
|
}
|
||||||
|
//=======================================================================
|
||||||
|
//function : AddVolume
|
||||||
|
//purpose : 2nd order pentahedron (prism) with 18 nodes
|
||||||
|
//=======================================================================
|
||||||
|
SMDS_MeshVolume* SMESHDS_Mesh::AddVolume(const SMDS_MeshNode * n1,
|
||||||
|
const SMDS_MeshNode * n2,
|
||||||
|
const SMDS_MeshNode * n3,
|
||||||
|
const SMDS_MeshNode * n4,
|
||||||
|
const SMDS_MeshNode * n5,
|
||||||
|
const SMDS_MeshNode * n6,
|
||||||
|
const SMDS_MeshNode * n12,
|
||||||
|
const SMDS_MeshNode * n23,
|
||||||
|
const SMDS_MeshNode * n31,
|
||||||
|
const SMDS_MeshNode * n45,
|
||||||
|
const SMDS_MeshNode * n56,
|
||||||
|
const SMDS_MeshNode * n64,
|
||||||
|
const SMDS_MeshNode * n14,
|
||||||
|
const SMDS_MeshNode * n25,
|
||||||
|
const SMDS_MeshNode * n36,
|
||||||
|
const SMDS_MeshNode * n1245,
|
||||||
|
const SMDS_MeshNode * n2356,
|
||||||
|
const SMDS_MeshNode * n1346)
|
||||||
|
{
|
||||||
|
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolume(n1,n2,n3,n4,n5,n6,n12,n23,n31,
|
||||||
|
n45,n56,n64,n14,n25,n36,
|
||||||
|
n1245, n2356, n1346);
|
||||||
|
if(anElem)
|
||||||
|
myScript->AddVolume(anElem->GetID(), n1->GetID(), n2->GetID(),
|
||||||
|
n3->GetID(), n4->GetID(), n5->GetID(), n6->GetID(),
|
||||||
|
n12->GetID(), n23->GetID(), n31->GetID(),
|
||||||
|
n45->GetID(), n56->GetID(), n64->GetID(),
|
||||||
|
n14->GetID(), n25->GetID(), n36->GetID(),
|
||||||
|
n1245->GetID(), n2356->GetID(), n1346->GetID());
|
||||||
|
return anElem;
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : AddVolumeWithID
|
||||||
|
//purpose : 2nd order pentahedron (prism) with 18 nodes
|
||||||
|
//=======================================================================
|
||||||
|
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(int n1, int n2, int n3,
|
||||||
|
int n4, int n5, int n6,
|
||||||
|
int n12,int n23,int n31,
|
||||||
|
int n45,int n56,int n64,
|
||||||
|
int n14,int n25,int n36,
|
||||||
|
int n1245, int n2356, int n1346,
|
||||||
|
int ID)
|
||||||
|
{
|
||||||
|
SMDS_MeshVolume *anElem = SMDS_Mesh::AddVolumeWithID(n1,n2,n3,n4,n5,n6,
|
||||||
|
n12,n23,n31,
|
||||||
|
n45,n56,n64,
|
||||||
|
n14,n25,n36,
|
||||||
|
n1245, n2356, n1346, ID);
|
||||||
|
if(anElem) myScript->AddVolume(ID,n1,n2,n3,n4,n5,n6,n12,n23,n31,
|
||||||
|
n45,n56,n64,n14,n25,n36, n1245, n2356, n1346);
|
||||||
|
return anElem;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : AddVolumeWithID
|
//function : AddVolumeWithID
|
||||||
//purpose : 2d order Pentahedron with 15 nodes
|
//purpose : 2d order Pentahedron with 18 nodes
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
||||||
const SMDS_MeshNode * n2,
|
const SMDS_MeshNode * n2,
|
||||||
@ -1929,6 +2015,9 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
const SMDS_MeshNode * n14,
|
const SMDS_MeshNode * n14,
|
||||||
const SMDS_MeshNode * n25,
|
const SMDS_MeshNode * n25,
|
||||||
const SMDS_MeshNode * n36,
|
const SMDS_MeshNode * n36,
|
||||||
|
const SMDS_MeshNode * n1245,
|
||||||
|
const SMDS_MeshNode * n2356,
|
||||||
|
const SMDS_MeshNode * n1346,
|
||||||
int ID)
|
int ID)
|
||||||
{
|
{
|
||||||
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(),
|
return AddVolumeWithID(n1->GetID(), n2->GetID(), n3->GetID(),
|
||||||
@ -1936,7 +2025,7 @@ SMDS_MeshVolume* SMESHDS_Mesh::AddVolumeWithID(const SMDS_MeshNode * n1,
|
|||||||
n12->GetID(), n23->GetID(), n31->GetID(),
|
n12->GetID(), n23->GetID(), n31->GetID(),
|
||||||
n45->GetID(), n56->GetID(), n64->GetID(),
|
n45->GetID(), n56->GetID(), n64->GetID(),
|
||||||
n14->GetID(), n25->GetID(), n36->GetID(),
|
n14->GetID(), n25->GetID(), n36->GetID(),
|
||||||
ID);
|
n1245->GetID(), n2356->GetID(), n1346->GetID(), ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -389,6 +389,52 @@ public:
|
|||||||
const SMDS_MeshNode * n25,
|
const SMDS_MeshNode * n25,
|
||||||
const SMDS_MeshNode * n36);
|
const SMDS_MeshNode * n36);
|
||||||
|
|
||||||
|
// 2d order Pentahedron with 18 nodes
|
||||||
|
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3,
|
||||||
|
int n4, int n5, int n6,
|
||||||
|
int n12,int n23,int n31,
|
||||||
|
int n45,int n56,int n64,
|
||||||
|
int n14,int n25,int n36,
|
||||||
|
int n1245, int n2356, int n1346,
|
||||||
|
int ID);
|
||||||
|
virtual SMDS_MeshVolume* AddVolumeWithID(const SMDS_MeshNode * n1,
|
||||||
|
const SMDS_MeshNode * n2,
|
||||||
|
const SMDS_MeshNode * n3,
|
||||||
|
const SMDS_MeshNode * n4,
|
||||||
|
const SMDS_MeshNode * n5,
|
||||||
|
const SMDS_MeshNode * n6,
|
||||||
|
const SMDS_MeshNode * n12,
|
||||||
|
const SMDS_MeshNode * n23,
|
||||||
|
const SMDS_MeshNode * n31,
|
||||||
|
const SMDS_MeshNode * n45,
|
||||||
|
const SMDS_MeshNode * n56,
|
||||||
|
const SMDS_MeshNode * n64,
|
||||||
|
const SMDS_MeshNode * n14,
|
||||||
|
const SMDS_MeshNode * n25,
|
||||||
|
const SMDS_MeshNode * n36,
|
||||||
|
const SMDS_MeshNode * n1245,
|
||||||
|
const SMDS_MeshNode * n2356,
|
||||||
|
const SMDS_MeshNode * n1346,
|
||||||
|
int ID);
|
||||||
|
virtual SMDS_MeshVolume* AddVolume(const SMDS_MeshNode * n1,
|
||||||
|
const SMDS_MeshNode * n2,
|
||||||
|
const SMDS_MeshNode * n3,
|
||||||
|
const SMDS_MeshNode * n4,
|
||||||
|
const SMDS_MeshNode * n5,
|
||||||
|
const SMDS_MeshNode * n6,
|
||||||
|
const SMDS_MeshNode * n12,
|
||||||
|
const SMDS_MeshNode * n23,
|
||||||
|
const SMDS_MeshNode * n31,
|
||||||
|
const SMDS_MeshNode * n45,
|
||||||
|
const SMDS_MeshNode * n56,
|
||||||
|
const SMDS_MeshNode * n64,
|
||||||
|
const SMDS_MeshNode * n14,
|
||||||
|
const SMDS_MeshNode * n25,
|
||||||
|
const SMDS_MeshNode * n36,
|
||||||
|
const SMDS_MeshNode * n1245,
|
||||||
|
const SMDS_MeshNode * n2356,
|
||||||
|
const SMDS_MeshNode * n1346);
|
||||||
|
|
||||||
// 2d order Hexahedrons with 20 nodes
|
// 2d order Hexahedrons with 20 nodes
|
||||||
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
|
virtual SMDS_MeshVolume* AddVolumeWithID(int n1, int n2, int n3, int n4,
|
||||||
int n5, int n6, int n7, int n8,
|
int n5, int n6, int n7, int n8,
|
||||||
|
@ -550,6 +550,27 @@ void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
|
|||||||
//function : AddVolume
|
//function : AddVolume
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
|
||||||
|
int n5,int n6, int n12, int n23, int n31,
|
||||||
|
int n45, int n56, int n64,
|
||||||
|
int n14, int n25, int n36,
|
||||||
|
int n1245, int n2356, int n1346)
|
||||||
|
{
|
||||||
|
if(myIsEmbeddedMode){
|
||||||
|
myIsModified = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
getCommand(SMESHDS_AddBiQuadPentahedron)->AddVolume(NewVolID, n1,n2,n3,n4,n5,n6,
|
||||||
|
n12, n23, n31,
|
||||||
|
n45, n56, n64,
|
||||||
|
n14, n25, n36,
|
||||||
|
n1245, n2356, n1346);
|
||||||
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : AddVolume
|
||||||
|
//purpose :
|
||||||
|
//=======================================================================
|
||||||
void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3,
|
void SMESHDS_Script::AddVolume(int NewVolID, int n1, int n2, int n3,
|
||||||
int n4, int n5, int n6, int n7, int n8,
|
int n4, int n5, int n6, int n7, int n8,
|
||||||
int n12, int n23, int n34, int n41,
|
int n12, int n23, int n34, int n41,
|
||||||
|
@ -91,6 +91,12 @@ class SMESHDS_EXPORT SMESHDS_Script
|
|||||||
int n12, int n23, int n31,
|
int n12, int n23, int n31,
|
||||||
int n45, int n56, int n64,
|
int n45, int n56, int n64,
|
||||||
int n14, int n25, int n36);
|
int n14, int n25, int n36);
|
||||||
|
void AddVolume(int NewVolID, int n1, int n2, int n3,
|
||||||
|
int n4, int n5, int n6,
|
||||||
|
int n12, int n23, int n31,
|
||||||
|
int n45, int n56, int n64,
|
||||||
|
int n14, int n25, int n36,
|
||||||
|
int n1245, int n2356, int n1346);
|
||||||
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
|
void AddVolume(int NewVolID, int n1, int n2, int n3, int n4,
|
||||||
int n5, int n6, int n7, int n8,
|
int n5, int n6, int n7, int n8,
|
||||||
int n12, int n23, int n34, int n41,
|
int n12, int n23, int n34, int n41,
|
||||||
|
@ -143,6 +143,7 @@
|
|||||||
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
|
#include CORBA_CLIENT_HEADER(SALOMEDS_Attributes)
|
||||||
#include CORBA_CLIENT_HEADER(SMESH_MeshEditor)
|
#include CORBA_CLIENT_HEADER(SMESH_MeshEditor)
|
||||||
#include CORBA_CLIENT_HEADER(SMESH_Measurements)
|
#include CORBA_CLIENT_HEADER(SMESH_Measurements)
|
||||||
|
#include CORBA_CLIENT_HEADER(SMESH_Mesh)
|
||||||
|
|
||||||
// Qt includes
|
// Qt includes
|
||||||
// #define INCLUDE_MENUITEM_DEF // VSR commented ????????
|
// #define INCLUDE_MENUITEM_DEF // VSR commented ????????
|
||||||
@ -603,6 +604,7 @@ namespace
|
|||||||
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polygon );
|
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polygon );
|
||||||
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Pyramid );
|
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Pyramid );
|
||||||
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Penta );
|
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Penta );
|
||||||
|
notSupportedElemTypes.push_back( SMESH::Entity_BiQuad_Penta );
|
||||||
notSupportedElemTypes.push_back( SMESH::Entity_Hexagonal_Prism );
|
notSupportedElemTypes.push_back( SMESH::Entity_Hexagonal_Prism );
|
||||||
notSupportedElemTypes.push_back( SMESH::Entity_Polyhedra );
|
notSupportedElemTypes.push_back( SMESH::Entity_Polyhedra );
|
||||||
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polyhedra );
|
notSupportedElemTypes.push_back( SMESH::Entity_Quad_Polyhedra );
|
||||||
@ -626,6 +628,7 @@ namespace
|
|||||||
"SMESH_TETRAHEDRA","SMESH_QUADRATIC_TETRAHEDRONS","SMESH_PYRAMIDS",
|
"SMESH_TETRAHEDRA","SMESH_QUADRATIC_TETRAHEDRONS","SMESH_PYRAMIDS",
|
||||||
"SMESH_QUADRATIC_PYRAMIDS","SMESH_HEXAHEDRA","SMESH_QUADRATIC_HEXAHEDRONS",
|
"SMESH_QUADRATIC_PYRAMIDS","SMESH_HEXAHEDRA","SMESH_QUADRATIC_HEXAHEDRONS",
|
||||||
"SMESH_TRIQUADRATIC_HEXAHEDRONS","SMESH_PENTAHEDRA","SMESH_QUADRATIC_PENTAHEDRONS",
|
"SMESH_TRIQUADRATIC_HEXAHEDRONS","SMESH_PENTAHEDRA","SMESH_QUADRATIC_PENTAHEDRONS",
|
||||||
|
"SMESH_BIQUADRATIC_PENTAHEDRONS",
|
||||||
"SMESH_OCTAHEDRA","SMESH_POLYEDRONS","SMESH_QUADRATIC_POLYEDRONS","SMESH_BALLS"
|
"SMESH_OCTAHEDRA","SMESH_POLYEDRONS","SMESH_QUADRATIC_POLYEDRONS","SMESH_BALLS"
|
||||||
};
|
};
|
||||||
// is typeMsg complete? (compilation failure mains that enum SMDSAbs_EntityType changed)
|
// is typeMsg complete? (compilation failure mains that enum SMDSAbs_EntityType changed)
|
||||||
@ -683,7 +686,14 @@ namespace
|
|||||||
}
|
}
|
||||||
else if ( isCGNS )// Export to CGNS
|
else if ( isCGNS )// Export to CGNS
|
||||||
{
|
{
|
||||||
SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true );
|
const char* theByTypeResource = "cgns_group_elems_by_type";
|
||||||
|
toCreateGroups = SMESHGUI::resourceMgr()->booleanValue( "SMESH", theByTypeResource, false );
|
||||||
|
|
||||||
|
QStringList checkBoxes;
|
||||||
|
checkBoxes << QObject::tr("CGNS_EXPORT_ELEMS_BY_TYPE");
|
||||||
|
|
||||||
|
SalomeApp_CheckFileDlg* fd =
|
||||||
|
new SalomeApp_CheckFileDlg ( SMESHGUI::desktop(), false, checkBoxes, true, true );
|
||||||
fd->setWindowTitle( aTitle );
|
fd->setWindowTitle( aTitle );
|
||||||
fd->setNameFilter( QObject::tr( "CGNS_FILES_FILTER" ) + " (*.cgns)" );
|
fd->setNameFilter( QObject::tr( "CGNS_FILES_FILTER" ) + " (*.cgns)" );
|
||||||
if ( !anInitialPath.isEmpty() )
|
if ( !anInitialPath.isEmpty() )
|
||||||
@ -691,10 +701,13 @@ namespace
|
|||||||
fd->selectFile(aMeshName);
|
fd->selectFile(aMeshName);
|
||||||
SMESHGUI_FileValidator* fv = new SMESHGUI_FileValidator( fd );
|
SMESHGUI_FileValidator* fv = new SMESHGUI_FileValidator( fd );
|
||||||
fd->setValidator( fv );
|
fd->setValidator( fv );
|
||||||
|
fd->SetChecked( toCreateGroups, 0 );
|
||||||
|
|
||||||
if ( fd->exec() )
|
if ( fd->exec() )
|
||||||
aFilename = fd->selectedFile();
|
aFilename = fd->selectedFile();
|
||||||
toOverwrite = fv->isOverwrite();
|
toOverwrite = fv->isOverwrite();
|
||||||
|
toCreateGroups = fd->IsChecked(0);
|
||||||
|
SMESHGUI::resourceMgr()->setValue("SMESH", theByTypeResource, toCreateGroups );
|
||||||
|
|
||||||
delete fd;
|
delete fd;
|
||||||
}
|
}
|
||||||
@ -740,7 +753,7 @@ namespace
|
|||||||
|
|
||||||
SMESHGUI_FieldSelectorWdg* fieldSelWdg = new SMESHGUI_FieldSelectorWdg();
|
SMESHGUI_FieldSelectorWdg* fieldSelWdg = new SMESHGUI_FieldSelectorWdg();
|
||||||
QList< QWidget* > wdgList;
|
QList< QWidget* > wdgList;
|
||||||
if ( fieldSelWdg->GetAllFeilds( aMeshList, aFieldList ))
|
if ( fieldSelWdg->GetAllFields( aMeshList, aFieldList ))
|
||||||
wdgList.append( fieldSelWdg );
|
wdgList.append( fieldSelWdg );
|
||||||
|
|
||||||
SalomeApp_CheckFileDlg* fd =
|
SalomeApp_CheckFileDlg* fd =
|
||||||
@ -822,7 +835,7 @@ namespace
|
|||||||
}
|
}
|
||||||
toCreateGroups = fd->IsChecked(0);
|
toCreateGroups = fd->IsChecked(0);
|
||||||
toFindOutDim = fd->IsChecked(1);
|
toFindOutDim = fd->IsChecked(1);
|
||||||
fieldSelWdg->GetSelectedFeilds();
|
fieldSelWdg->GetSelectedFields();
|
||||||
if ( !fieldSelWdg->parent() )
|
if ( !fieldSelWdg->parent() )
|
||||||
delete fieldSelWdg;
|
delete fieldSelWdg;
|
||||||
delete fd;
|
delete fd;
|
||||||
@ -912,7 +925,8 @@ namespace
|
|||||||
SMESH::SMESH_Mesh_var aMeshItem = aMeshOrGroup->GetMesh();
|
SMESH::SMESH_Mesh_var aMeshItem = aMeshOrGroup->GetMesh();
|
||||||
aMeshItem->ExportCGNS( aMeshOrGroup,
|
aMeshItem->ExportCGNS( aMeshOrGroup,
|
||||||
aFilename.toUtf8().data(),
|
aFilename.toUtf8().data(),
|
||||||
toOverwrite && aMeshIndex == 0 );
|
toOverwrite && aMeshIndex == 0,
|
||||||
|
toCreateGroups );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if ( isGMF )
|
else if ( isGMF )
|
||||||
@ -1089,6 +1103,8 @@ namespace
|
|||||||
type = QObject::tr( "LENGTH_EDGES" );
|
type = QObject::tr( "LENGTH_EDGES" );
|
||||||
else if ( dynamic_cast< SMESH::Controls::Length2D* >( f.get() ) )
|
else if ( dynamic_cast< SMESH::Controls::Length2D* >( f.get() ) )
|
||||||
type = QObject::tr( "LENGTH2D_EDGES" );
|
type = QObject::tr( "LENGTH2D_EDGES" );
|
||||||
|
else if ( dynamic_cast< SMESH::Controls::Deflection2D* >( f.get() ) )
|
||||||
|
type = QObject::tr( "DEFLECTION2D_FACES" );
|
||||||
else if ( dynamic_cast< SMESH::Controls::MultiConnection* >( f.get() ) )
|
else if ( dynamic_cast< SMESH::Controls::MultiConnection* >( f.get() ) )
|
||||||
type = QObject::tr( "MULTI_BORDERS" );
|
type = QObject::tr( "MULTI_BORDERS" );
|
||||||
else if ( dynamic_cast< SMESH::Controls::MultiConnection2D* >( f.get() ) )
|
else if ( dynamic_cast< SMESH::Controls::MultiConnection2D* >( f.get() ) )
|
||||||
@ -1621,6 +1637,7 @@ namespace
|
|||||||
ActionControl.Bind( SMESHOp::OpBareBorderFace, SMESH_Actor::eBareBorderFace );
|
ActionControl.Bind( SMESHOp::OpBareBorderFace, SMESH_Actor::eBareBorderFace );
|
||||||
ActionControl.Bind( SMESHOp::OpOverConstrainedFace, SMESH_Actor::eOverConstrainedFace );
|
ActionControl.Bind( SMESHOp::OpOverConstrainedFace, SMESH_Actor::eOverConstrainedFace );
|
||||||
ActionControl.Bind( SMESHOp::OpLength2D, SMESH_Actor::eLength2D );
|
ActionControl.Bind( SMESHOp::OpLength2D, SMESH_Actor::eLength2D );
|
||||||
|
ActionControl.Bind( SMESHOp::OpDeflection2D, SMESH_Actor::eDeflection2D );
|
||||||
ActionControl.Bind( SMESHOp::OpConnection2D, SMESH_Actor::eMultiConnection2D );
|
ActionControl.Bind( SMESHOp::OpConnection2D, SMESH_Actor::eMultiConnection2D );
|
||||||
ActionControl.Bind( SMESHOp::OpArea, SMESH_Actor::eArea );
|
ActionControl.Bind( SMESHOp::OpArea, SMESH_Actor::eArea );
|
||||||
ActionControl.Bind( SMESHOp::OpTaper, SMESH_Actor::eTaper );
|
ActionControl.Bind( SMESHOp::OpTaper, SMESH_Actor::eTaper );
|
||||||
@ -2074,7 +2091,7 @@ bool SMESHGUI::automaticUpdate( SMESH::SMESH_IDSource_ptr theMesh,
|
|||||||
long nbVolumes = info[SMDSEntity_Tetra] + info[SMDSEntity_Quad_Tetra] +
|
long nbVolumes = info[SMDSEntity_Tetra] + info[SMDSEntity_Quad_Tetra] +
|
||||||
info[SMDSEntity_Hexa] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa] +
|
info[SMDSEntity_Hexa] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa] +
|
||||||
info[SMDSEntity_Pyramid] + info[SMDSEntity_Quad_Pyramid] +
|
info[SMDSEntity_Pyramid] + info[SMDSEntity_Quad_Pyramid] +
|
||||||
info[SMDSEntity_Penta] + info[SMDSEntity_Quad_Penta] +
|
info[SMDSEntity_Penta] + info[SMDSEntity_Quad_Penta] + info[SMDSEntity_BiQuad_Penta] +
|
||||||
info[SMDSEntity_Polyhedra] +
|
info[SMDSEntity_Polyhedra] +
|
||||||
info[SMDSEntity_Hexagonal_Prism];
|
info[SMDSEntity_Hexagonal_Prism];
|
||||||
long nbBalls = info[SMDSEntity_Ball];
|
long nbBalls = info[SMDSEntity_Ball];
|
||||||
@ -2569,9 +2586,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
if(isStudyLocked()) break;
|
if(isStudyLocked()) break;
|
||||||
SUIT_OverrideCursor wc;
|
SUIT_OverrideCursor wc;
|
||||||
try {
|
try {
|
||||||
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
|
|
||||||
OCC_CATCH_SIGNALS;
|
OCC_CATCH_SIGNALS;
|
||||||
#endif
|
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
}
|
}
|
||||||
catch (std::bad_alloc) { // PAL16774 (Crash after display of many groups)
|
catch (std::bad_alloc) { // PAL16774 (Crash after display of many groups)
|
||||||
@ -3229,6 +3244,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
case SMESHOp::OpQuadraticTetrahedron:
|
case SMESHOp::OpQuadraticTetrahedron:
|
||||||
case SMESHOp::OpQuadraticPyramid:
|
case SMESHOp::OpQuadraticPyramid:
|
||||||
case SMESHOp::OpQuadraticPentahedron:
|
case SMESHOp::OpQuadraticPentahedron:
|
||||||
|
case SMESHOp::OpBiQuadraticPentahedron:
|
||||||
case SMESHOp::OpQuadraticHexahedron:
|
case SMESHOp::OpQuadraticHexahedron:
|
||||||
case SMESHOp::OpTriQuadraticHexahedron:
|
case SMESHOp::OpTriQuadraticHexahedron:
|
||||||
{
|
{
|
||||||
@ -3247,6 +3263,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
case SMESHOp::OpQuadraticTetrahedron: type = SMDSEntity_Quad_Tetra; break;
|
case SMESHOp::OpQuadraticTetrahedron: type = SMDSEntity_Quad_Tetra; break;
|
||||||
case SMESHOp::OpQuadraticPyramid: type = SMDSEntity_Quad_Pyramid; break;
|
case SMESHOp::OpQuadraticPyramid: type = SMDSEntity_Quad_Pyramid; break;
|
||||||
case SMESHOp::OpQuadraticPentahedron: type = SMDSEntity_Quad_Penta; break;
|
case SMESHOp::OpQuadraticPentahedron: type = SMDSEntity_Quad_Penta; break;
|
||||||
|
case SMESHOp::OpBiQuadraticPentahedron: type = SMDSEntity_BiQuad_Penta; break;
|
||||||
case SMESHOp::OpQuadraticHexahedron: type = SMDSEntity_Quad_Hexa; break;
|
case SMESHOp::OpQuadraticHexahedron: type = SMDSEntity_Quad_Hexa; break;
|
||||||
case SMESHOp::OpTriQuadraticHexahedron: type = SMDSEntity_TriQuad_Hexa; break;
|
case SMESHOp::OpTriQuadraticHexahedron: type = SMDSEntity_TriQuad_Hexa; break;
|
||||||
default: break;
|
default: break;
|
||||||
@ -3538,6 +3555,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
|
|||||||
case SMESHOp::OpBareBorderFace:
|
case SMESHOp::OpBareBorderFace:
|
||||||
case SMESHOp::OpOverConstrainedFace:
|
case SMESHOp::OpOverConstrainedFace:
|
||||||
case SMESHOp::OpLength2D:
|
case SMESHOp::OpLength2D:
|
||||||
|
case SMESHOp::OpDeflection2D:
|
||||||
case SMESHOp::OpConnection2D:
|
case SMESHOp::OpConnection2D:
|
||||||
case SMESHOp::OpArea:
|
case SMESHOp::OpArea:
|
||||||
case SMESHOp::OpTaper:
|
case SMESHOp::OpTaper:
|
||||||
@ -3839,6 +3857,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
|||||||
createSMESHAction( SMESHOp::OpBareBorderFace, "BARE_BORDER_FACE", "ICON_BARE_BORDER_FACE", 0, true );
|
createSMESHAction( SMESHOp::OpBareBorderFace, "BARE_BORDER_FACE", "ICON_BARE_BORDER_FACE", 0, true );
|
||||||
createSMESHAction( SMESHOp::OpOverConstrainedFace, "OVER_CONSTRAINED_FACE", "ICON_OVER_CONSTRAINED_FACE", 0, true );
|
createSMESHAction( SMESHOp::OpOverConstrainedFace, "OVER_CONSTRAINED_FACE", "ICON_OVER_CONSTRAINED_FACE", 0, true );
|
||||||
createSMESHAction( SMESHOp::OpLength2D, "LENGTH_2D", "ICON_LENGTH_2D", 0, true );
|
createSMESHAction( SMESHOp::OpLength2D, "LENGTH_2D", "ICON_LENGTH_2D", 0, true );
|
||||||
|
createSMESHAction( SMESHOp::OpDeflection2D, "DEFLECTION_2D", "ICON_DEFLECTION_2D", 0, true );
|
||||||
createSMESHAction( SMESHOp::OpConnection2D, "CONNECTION_2D", "ICON_CONNECTION_2D", 0, true );
|
createSMESHAction( SMESHOp::OpConnection2D, "CONNECTION_2D", "ICON_CONNECTION_2D", 0, true );
|
||||||
createSMESHAction( SMESHOp::OpArea, "AREA", "ICON_AREA", 0, true );
|
createSMESHAction( SMESHOp::OpArea, "AREA", "ICON_AREA", 0, true );
|
||||||
createSMESHAction( SMESHOp::OpTaper, "TAPER", "ICON_TAPER", 0, true );
|
createSMESHAction( SMESHOp::OpTaper, "TAPER", "ICON_TAPER", 0, true );
|
||||||
@ -3879,6 +3898,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
|||||||
createSMESHAction( SMESHOp::OpQuadraticTetrahedron, "QUADRATIC_TETRAHEDRON", "ICON_DLG_QUADRATIC_TETRAHEDRON" );
|
createSMESHAction( SMESHOp::OpQuadraticTetrahedron, "QUADRATIC_TETRAHEDRON", "ICON_DLG_QUADRATIC_TETRAHEDRON" );
|
||||||
createSMESHAction( SMESHOp::OpQuadraticPyramid, "QUADRATIC_PYRAMID", "ICON_DLG_QUADRATIC_PYRAMID" );
|
createSMESHAction( SMESHOp::OpQuadraticPyramid, "QUADRATIC_PYRAMID", "ICON_DLG_QUADRATIC_PYRAMID" );
|
||||||
createSMESHAction( SMESHOp::OpQuadraticPentahedron, "QUADRATIC_PENTAHEDRON", "ICON_DLG_QUADRATIC_PENTAHEDRON" );
|
createSMESHAction( SMESHOp::OpQuadraticPentahedron, "QUADRATIC_PENTAHEDRON", "ICON_DLG_QUADRATIC_PENTAHEDRON" );
|
||||||
|
createSMESHAction( SMESHOp::OpBiQuadraticPentahedron, "BIQUADRATIC_PENTAHEDRON", "ICON_DLG_BIQUADRATIC_PENTAHEDRON" );
|
||||||
createSMESHAction( SMESHOp::OpQuadraticHexahedron, "QUADRATIC_HEXAHEDRON", "ICON_DLG_QUADRATIC_HEXAHEDRON" );
|
createSMESHAction( SMESHOp::OpQuadraticHexahedron, "QUADRATIC_HEXAHEDRON", "ICON_DLG_QUADRATIC_HEXAHEDRON" );
|
||||||
createSMESHAction( SMESHOp::OpTriQuadraticHexahedron, "TRIQUADRATIC_HEXAHEDRON", "ICON_DLG_TRIQUADRATIC_HEXAHEDRON" );
|
createSMESHAction( SMESHOp::OpTriQuadraticHexahedron, "TRIQUADRATIC_HEXAHEDRON", "ICON_DLG_TRIQUADRATIC_HEXAHEDRON" );
|
||||||
|
|
||||||
@ -3967,6 +3987,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
|||||||
<< SMESHOp::OpNodeConnectivityNb // node controls
|
<< SMESHOp::OpNodeConnectivityNb // node controls
|
||||||
<< SMESHOp::OpFreeEdge << SMESHOp::OpFreeBorder
|
<< SMESHOp::OpFreeEdge << SMESHOp::OpFreeBorder
|
||||||
<< SMESHOp::OpLength << SMESHOp::OpConnection << SMESHOp::OpEqualEdge // edge controls
|
<< SMESHOp::OpLength << SMESHOp::OpConnection << SMESHOp::OpEqualEdge // edge controls
|
||||||
|
<< SMESHOp::OpDeflection2D
|
||||||
<< SMESHOp::OpFreeFace << SMESHOp::OpLength2D << SMESHOp::OpConnection2D
|
<< SMESHOp::OpFreeFace << SMESHOp::OpLength2D << SMESHOp::OpConnection2D
|
||||||
<< SMESHOp::OpArea << SMESHOp::OpTaper << SMESHOp::OpAspectRatio
|
<< SMESHOp::OpArea << SMESHOp::OpTaper << SMESHOp::OpAspectRatio
|
||||||
<< SMESHOp::OpMinimumAngle << SMESHOp::OpWarpingAngle << SMESHOp::OpSkew
|
<< SMESHOp::OpMinimumAngle << SMESHOp::OpWarpingAngle << SMESHOp::OpSkew
|
||||||
@ -4080,6 +4101,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
|||||||
createMenu( SMESHOp::OpSkew, faceId, -1 );
|
createMenu( SMESHOp::OpSkew, faceId, -1 );
|
||||||
createMenu( SMESHOp::OpMaxElementLength2D, faceId, -1 );
|
createMenu( SMESHOp::OpMaxElementLength2D, faceId, -1 );
|
||||||
createMenu( SMESHOp::OpEqualFace, faceId, -1 );
|
createMenu( SMESHOp::OpEqualFace, faceId, -1 );
|
||||||
|
createMenu( SMESHOp::OpDeflection2D, faceId, -1 );
|
||||||
createMenu( SMESHOp::OpAspectRatio3D, volumeId, -1 );
|
createMenu( SMESHOp::OpAspectRatio3D, volumeId, -1 );
|
||||||
createMenu( SMESHOp::OpVolume, volumeId, -1 );
|
createMenu( SMESHOp::OpVolume, volumeId, -1 );
|
||||||
createMenu( SMESHOp::OpMaxElementLength3D, volumeId, -1 );
|
createMenu( SMESHOp::OpMaxElementLength3D, volumeId, -1 );
|
||||||
@ -4115,6 +4137,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
|||||||
createMenu( SMESHOp::OpQuadraticTetrahedron, addId, -1 );
|
createMenu( SMESHOp::OpQuadraticTetrahedron, addId, -1 );
|
||||||
createMenu( SMESHOp::OpQuadraticPyramid, addId, -1 );
|
createMenu( SMESHOp::OpQuadraticPyramid, addId, -1 );
|
||||||
createMenu( SMESHOp::OpQuadraticPentahedron, addId, -1 );
|
createMenu( SMESHOp::OpQuadraticPentahedron, addId, -1 );
|
||||||
|
createMenu( SMESHOp::OpBiQuadraticPentahedron, addId, -1 );
|
||||||
createMenu( SMESHOp::OpQuadraticHexahedron, addId, -1 );
|
createMenu( SMESHOp::OpQuadraticHexahedron, addId, -1 );
|
||||||
createMenu( SMESHOp::OpTriQuadraticHexahedron, addId, -1 );
|
createMenu( SMESHOp::OpTriQuadraticHexahedron, addId, -1 );
|
||||||
|
|
||||||
@ -4228,6 +4251,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
|||||||
createTool( SMESHOp::OpSkew, ctrl2dTb );
|
createTool( SMESHOp::OpSkew, ctrl2dTb );
|
||||||
createTool( SMESHOp::OpMaxElementLength2D, ctrl2dTb );
|
createTool( SMESHOp::OpMaxElementLength2D, ctrl2dTb );
|
||||||
createTool( SMESHOp::OpEqualFace, ctrl2dTb );
|
createTool( SMESHOp::OpEqualFace, ctrl2dTb );
|
||||||
|
createTool( SMESHOp::OpDeflection2D, ctrl2dTb );
|
||||||
|
|
||||||
createTool( SMESHOp::OpAspectRatio3D, ctrl3dTb );
|
createTool( SMESHOp::OpAspectRatio3D, ctrl3dTb );
|
||||||
createTool( SMESHOp::OpVolume, ctrl3dTb );
|
createTool( SMESHOp::OpVolume, ctrl3dTb );
|
||||||
@ -4260,6 +4284,7 @@ void SMESHGUI::initialize( CAM_Application* app )
|
|||||||
createTool( SMESHOp::OpQuadraticTetrahedron, addNonElemTb );
|
createTool( SMESHOp::OpQuadraticTetrahedron, addNonElemTb );
|
||||||
createTool( SMESHOp::OpQuadraticPyramid, addNonElemTb );
|
createTool( SMESHOp::OpQuadraticPyramid, addNonElemTb );
|
||||||
createTool( SMESHOp::OpQuadraticPentahedron, addNonElemTb );
|
createTool( SMESHOp::OpQuadraticPentahedron, addNonElemTb );
|
||||||
|
createTool( SMESHOp::OpBiQuadraticPentahedron, addNonElemTb );
|
||||||
createTool( SMESHOp::OpQuadraticHexahedron, addNonElemTb );
|
createTool( SMESHOp::OpQuadraticHexahedron, addNonElemTb );
|
||||||
createTool( SMESHOp::OpTriQuadraticHexahedron, addNonElemTb );
|
createTool( SMESHOp::OpTriQuadraticHexahedron, addNonElemTb );
|
||||||
|
|
||||||
@ -4638,10 +4663,15 @@ void SMESHGUI::initialize( CAM_Application* app )
|
|||||||
popupMgr()->insert ( action( SMESHOp::OpOverConstrainedFace ), aSubId, -1 );
|
popupMgr()->insert ( action( SMESHOp::OpOverConstrainedFace ), aSubId, -1 );
|
||||||
popupMgr()->setRule( action( SMESHOp::OpOverConstrainedFace ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
|
popupMgr()->setRule( action( SMESHOp::OpOverConstrainedFace ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
|
||||||
popupMgr()->setRule( action( SMESHOp::OpOverConstrainedFace ), "controlMode = 'eOverConstrainedFace'", QtxPopupMgr::ToggleRule );
|
popupMgr()->setRule( action( SMESHOp::OpOverConstrainedFace ), "controlMode = 'eOverConstrainedFace'", QtxPopupMgr::ToggleRule );
|
||||||
|
|
||||||
popupMgr()->insert ( action( SMESHOp::OpEqualFace ), aSubId, -1 );
|
popupMgr()->insert ( action( SMESHOp::OpEqualFace ), aSubId, -1 );
|
||||||
popupMgr()->setRule( action( SMESHOp::OpEqualFace ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
|
popupMgr()->setRule( action( SMESHOp::OpEqualFace ), aMeshInVtkHasFaces, QtxPopupMgr::VisibleRule );
|
||||||
popupMgr()->setRule( action( SMESHOp::OpEqualFace ), "controlMode = 'eCoincidentElems2D'", QtxPopupMgr::ToggleRule );
|
popupMgr()->setRule( action( SMESHOp::OpEqualFace ), "controlMode = 'eCoincidentElems2D'", QtxPopupMgr::ToggleRule );
|
||||||
|
|
||||||
|
popupMgr()->insert ( action( SMESHOp::OpDeflection2D ), aSubId, -1 );
|
||||||
|
popupMgr()->setRule( action( SMESHOp::OpDeflection2D ), aMeshInVtkHasFaces + " && hasGeomReference", QtxPopupMgr::VisibleRule );
|
||||||
|
popupMgr()->setRule( action( SMESHOp::OpDeflection2D ), "controlMode = 'eDeflection2D'", QtxPopupMgr::ToggleRule );
|
||||||
|
|
||||||
aSubId = popupMgr()->insert( tr( "MEN_VOLUME_CTRL" ), anId, -1 ); // VOLUME CONTROLS
|
aSubId = popupMgr()->insert( tr( "MEN_VOLUME_CTRL" ), anId, -1 ); // VOLUME CONTROLS
|
||||||
|
|
||||||
popupMgr()->insert ( action( SMESHOp::OpAspectRatio3D ), aSubId, -1 );
|
popupMgr()->insert ( action( SMESHOp::OpAspectRatio3D ), aSubId, -1 );
|
||||||
|
@ -380,6 +380,9 @@ SMESHGUI_AddQuadraticElementDlg::SMESHGUI_AddQuadraticElementDlg( SMESHGUI* theM
|
|||||||
case SMDSEntity_Quad_Penta:
|
case SMDSEntity_Quad_Penta:
|
||||||
anElementName = QString("QUADRATIC_PENTAHEDRON");
|
anElementName = QString("QUADRATIC_PENTAHEDRON");
|
||||||
break;
|
break;
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
|
anElementName = QString("BIQUADRATIC_PENTAHEDRON");
|
||||||
|
break;
|
||||||
case SMDSEntity_Quad_Hexa:
|
case SMDSEntity_Quad_Hexa:
|
||||||
anElementName = QString("QUADRATIC_HEXAHEDRON");
|
anElementName = QString("QUADRATIC_HEXAHEDRON");
|
||||||
break;
|
break;
|
||||||
@ -587,6 +590,12 @@ void SMESHGUI_AddQuadraticElementDlg::Init()
|
|||||||
myNbCorners = 6;
|
myNbCorners = 6;
|
||||||
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_pentahedrons
|
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_pentahedrons
|
||||||
break;
|
break;
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
|
aNumRows = 9;
|
||||||
|
myNbCorners = 6;
|
||||||
|
myNbMidFaceNodes = 3;
|
||||||
|
myHelpFileName = "adding_quadratic_elements_page.html#?"; //Adding_pentahedrons
|
||||||
|
break;
|
||||||
case SMDSEntity_Quad_Hexa:
|
case SMDSEntity_Quad_Hexa:
|
||||||
aNumRows = 12;
|
aNumRows = 12;
|
||||||
myNbCorners = 8;
|
myNbCorners = 8;
|
||||||
@ -707,6 +716,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
|
|||||||
case SMDSEntity_Quad_Tetra:
|
case SMDSEntity_Quad_Tetra:
|
||||||
case SMDSEntity_Quad_Pyramid:
|
case SMDSEntity_Quad_Pyramid:
|
||||||
case SMDSEntity_Quad_Penta:
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
case SMDSEntity_Quad_Hexa:
|
case SMDSEntity_Quad_Hexa:
|
||||||
case SMDSEntity_TriQuad_Hexa:
|
case SMDSEntity_TriQuad_Hexa:
|
||||||
for ( int row = 0; row < myNbCorners; row++ )
|
for ( int row = 0; row < myNbCorners; row++ )
|
||||||
@ -790,6 +800,7 @@ bool SMESHGUI_AddQuadraticElementDlg::ClickOnApply()
|
|||||||
case SMDSEntity_Quad_Tetra:
|
case SMDSEntity_Quad_Tetra:
|
||||||
case SMDSEntity_Quad_Pyramid:
|
case SMDSEntity_Quad_Pyramid:
|
||||||
case SMDSEntity_Quad_Penta:
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
case SMDSEntity_Quad_Hexa:
|
case SMDSEntity_Quad_Hexa:
|
||||||
case SMDSEntity_TriQuad_Hexa:
|
case SMDSEntity_TriQuad_Hexa:
|
||||||
anElementType = SMESH::VOLUME;
|
anElementType = SMESH::VOLUME;
|
||||||
@ -1068,6 +1079,7 @@ void SMESHGUI_AddQuadraticElementDlg::SelectionIntoArgument()
|
|||||||
case SMDSEntity_Quad_Tetra:
|
case SMDSEntity_Quad_Tetra:
|
||||||
case SMDSEntity_Quad_Pyramid:
|
case SMDSEntity_Quad_Pyramid:
|
||||||
case SMDSEntity_Quad_Penta:
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
case SMDSEntity_Quad_Hexa:
|
case SMDSEntity_Quad_Hexa:
|
||||||
case SMDSEntity_TriQuad_Hexa:
|
case SMDSEntity_TriQuad_Hexa:
|
||||||
anElementType = SMESH::VOLUME; break;
|
anElementType = SMESH::VOLUME; break;
|
||||||
@ -1402,6 +1414,7 @@ void SMESHGUI_AddQuadraticElementDlg::UpdateTable( bool theConersValidity )
|
|||||||
aLastColIds = LastPyramidIds;
|
aLastColIds = LastPyramidIds;
|
||||||
break;
|
break;
|
||||||
case SMDSEntity_Quad_Penta:
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
aFirstColIds = FirstPentahedronIds;
|
aFirstColIds = FirstPentahedronIds;
|
||||||
aLastColIds = LastPentahedronIds;
|
aLastColIds = LastPentahedronIds;
|
||||||
break;
|
break;
|
||||||
|
@ -1229,7 +1229,7 @@ void SMESHGUI_BaseComputeOp::showComputeResult( const bool theMemoryLack,
|
|||||||
currentCellChanged(); // to update buttons
|
currentCellChanged(); // to update buttons
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// show dialog and wait, becase Compute can be invoked from Preview operation
|
// show dialog and wait, because Compute can be invoked from Preview operation
|
||||||
//aCompDlg->exec(); // this way it becomes modal - impossible to rotate model in the Viewer
|
//aCompDlg->exec(); // this way it becomes modal - impossible to rotate model in the Viewer
|
||||||
aCompDlg->show();
|
aCompDlg->show();
|
||||||
}
|
}
|
||||||
@ -1535,7 +1535,7 @@ SMESHGUI_ComputeOp::SMESHGUI_ComputeOp()
|
|||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Desctructor
|
* \brief Destructor
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
@ -1978,9 +1978,7 @@ void SMESHGUI_PrecomputeOp::onPreview()
|
|||||||
|
|
||||||
SMESH::long_array_var aShapesId = new SMESH::long_array();
|
SMESH::long_array_var aShapesId = new SMESH::long_array();
|
||||||
try {
|
try {
|
||||||
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
|
|
||||||
OCC_CATCH_SIGNALS;
|
OCC_CATCH_SIGNALS;
|
||||||
#endif
|
|
||||||
|
|
||||||
SMESH::MeshPreviewStruct_var previewData =
|
SMESH::MeshPreviewStruct_var previewData =
|
||||||
gen->Precompute(myMesh, myMainShape, (SMESH::Dimension)dim, aShapesId);
|
gen->Precompute(myMesh, myMainShape, (SMESH::Dimension)dim, aShapesId);
|
||||||
@ -2003,9 +2001,7 @@ void SMESHGUI_PrecomputeOp::onPreview()
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
|
|
||||||
OCC_CATCH_SIGNALS;
|
OCC_CATCH_SIGNALS;
|
||||||
#endif
|
|
||||||
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
|
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
|
||||||
// check if there are memory problems
|
// check if there are memory problems
|
||||||
for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
|
for ( CORBA::ULong i = 0; (i < aCompErrors->length()) && !memoryLack; ++i )
|
||||||
@ -2152,7 +2148,7 @@ SMESHGUI_EvaluateOp::SMESHGUI_EvaluateOp()
|
|||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Desctructor
|
* \brief Destructor
|
||||||
*/
|
*/
|
||||||
//================================================================================
|
//================================================================================
|
||||||
|
|
||||||
@ -2221,9 +2217,7 @@ void SMESHGUI_BaseComputeOp::evaluateMesh()
|
|||||||
}
|
}
|
||||||
SUIT_OverrideCursor aWaitCursor;
|
SUIT_OverrideCursor aWaitCursor;
|
||||||
try {
|
try {
|
||||||
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
|
|
||||||
OCC_CATCH_SIGNALS;
|
OCC_CATCH_SIGNALS;
|
||||||
#endif
|
|
||||||
aRes = gen->Evaluate(myMesh, myMainShape);
|
aRes = gen->Evaluate(myMesh, myMainShape);
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception & S_ex){
|
catch(const SALOME::SALOME_Exception & S_ex){
|
||||||
@ -2231,9 +2225,7 @@ void SMESHGUI_BaseComputeOp::evaluateMesh()
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
|
|
||||||
OCC_CATCH_SIGNALS;
|
OCC_CATCH_SIGNALS;
|
||||||
#endif
|
|
||||||
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
|
aCompErrors = gen->GetComputeErrors( myMesh, myMainShape );
|
||||||
}
|
}
|
||||||
catch(const SALOME::SALOME_Exception & S_ex){
|
catch(const SALOME::SALOME_Exception & S_ex){
|
||||||
@ -2391,7 +2383,7 @@ void SMESHGUI_BaseComputeOp::showEvaluateResult(const SMESH::long_array& theRes,
|
|||||||
currentCellChanged(); // to update buttons
|
currentCellChanged(); // to update buttons
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// show dialog and wait, becase Compute can be invoked from Preview operation
|
// show dialog and wait, because Compute can be invoked from Preview operation
|
||||||
//aCompDlg->exec(); // this way it becomes modal - impossible to rotate model in the Viewer
|
//aCompDlg->exec(); // this way it becomes modal - impossible to rotate model in the Viewer
|
||||||
aCompDlg->show();
|
aCompDlg->show();
|
||||||
}
|
}
|
||||||
|
@ -332,6 +332,7 @@ SMESHGUI_ConvToQuadOp::DestinationMesh( const SMESH::SMESH_IDSource_var& idSourc
|
|||||||
|
|
||||||
bool hasBiQuad = ( nbElemOfType[SMDSEntity_BiQuad_Triangle ] ||
|
bool hasBiQuad = ( nbElemOfType[SMDSEntity_BiQuad_Triangle ] ||
|
||||||
nbElemOfType[SMDSEntity_BiQuad_Quadrangle ] ||
|
nbElemOfType[SMDSEntity_BiQuad_Quadrangle ] ||
|
||||||
|
nbElemOfType[SMDSEntity_BiQuad_Penta ] ||
|
||||||
nbElemOfType[SMDSEntity_TriQuad_Hexa ] );
|
nbElemOfType[SMDSEntity_TriQuad_Hexa ] );
|
||||||
bool hasLinBiQuad = ( nbElemOfType[SMDSEntity_Triangle ] ||
|
bool hasLinBiQuad = ( nbElemOfType[SMDSEntity_Triangle ] ||
|
||||||
nbElemOfType[SMDSEntity_Quadrangle ] ||
|
nbElemOfType[SMDSEntity_Quadrangle ] ||
|
||||||
|
@ -86,7 +86,7 @@ SMESHGUI_FieldSelectorWdg::SMESHGUI_FieldSelectorWdg( QWidget* p )
|
|||||||
* \brief Retrieves all fields defined on geometry of given meshes
|
* \brief Retrieves all fields defined on geometry of given meshes
|
||||||
*/
|
*/
|
||||||
bool SMESHGUI_FieldSelectorWdg::
|
bool SMESHGUI_FieldSelectorWdg::
|
||||||
GetAllFeilds(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
|
GetAllFields(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
|
||||||
QList< QPair< GEOM::ListOfFields_var, QString > >& fields)
|
QList< QPair< GEOM::ListOfFields_var, QString > >& fields)
|
||||||
{
|
{
|
||||||
myFields = & fields;
|
myFields = & fields;
|
||||||
@ -165,7 +165,7 @@ GetAllFeilds(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
|
|||||||
/*!
|
/*!
|
||||||
* \brief Filter off not selected fields from myFields
|
* \brief Filter off not selected fields from myFields
|
||||||
*/
|
*/
|
||||||
bool SMESHGUI_FieldSelectorWdg::GetSelectedFeilds()
|
bool SMESHGUI_FieldSelectorWdg::GetSelectedFields()
|
||||||
{
|
{
|
||||||
int nbSelected = 0;
|
int nbSelected = 0;
|
||||||
if ( myTree->isEnabled() )
|
if ( myTree->isEnabled() )
|
||||||
|
@ -43,13 +43,13 @@ class SMESHGUI_EXPORT SMESHGUI_FieldSelectorWdg : public QGroupBox
|
|||||||
public:
|
public:
|
||||||
SMESHGUI_FieldSelectorWdg( QWidget* = 0 );
|
SMESHGUI_FieldSelectorWdg( QWidget* = 0 );
|
||||||
|
|
||||||
bool GetAllFeilds(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
|
bool GetAllFields(const QList< QPair< SMESH::SMESH_IDSource_var, QString > >& meshes,
|
||||||
QList< QPair< GEOM::ListOfFields_var, QString > >& fields);
|
QList< QPair< GEOM::ListOfFields_var, QString > >& fields);
|
||||||
|
|
||||||
bool GetSelectedFeilds();
|
bool GetSelectedFields();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
|
||||||
void onItemCheck(QTreeWidgetItem * item, int column);
|
void onItemCheck(QTreeWidgetItem * item, int column);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -33,13 +33,13 @@
|
|||||||
#include <SMDS_Mesh.hxx>
|
#include <SMDS_Mesh.hxx>
|
||||||
#include <SMDSAbs_ElementType.hxx>
|
#include <SMDSAbs_ElementType.hxx>
|
||||||
|
|
||||||
OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_Filter, VTKViewer_Filter)
|
IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_Filter, VTKViewer_Filter)
|
||||||
OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_PredicateFilter, SMESHGUI_Filter)
|
IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_PredicateFilter, SMESHGUI_Filter)
|
||||||
OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_QuadrangleFilter, SMESHGUI_Filter)
|
IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_QuadrangleFilter, SMESHGUI_Filter)
|
||||||
OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_TriangleFilter, SMESHGUI_Filter)
|
IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_TriangleFilter, SMESHGUI_Filter)
|
||||||
OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_FacesFilter, SMESHGUI_Filter)
|
IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_FacesFilter, SMESHGUI_Filter)
|
||||||
OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_VolumesFilter, SMESHGUI_Filter)
|
IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_VolumesFilter, SMESHGUI_Filter)
|
||||||
OCCT_IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_VolumeShapeFilter, SMESHGUI_Filter)
|
IMPLEMENT_STANDARD_RTTIEXT(SMESHGUI_VolumeShapeFilter, SMESHGUI_Filter)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Class : SMESHGUI_PredicateFilter
|
Class : SMESHGUI_PredicateFilter
|
||||||
|
@ -70,7 +70,7 @@ public:
|
|||||||
Standard_EXPORT virtual bool IsObjValid( const int ) const = 0;
|
Standard_EXPORT virtual bool IsObjValid( const int ) const = 0;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_Filter,VTKViewer_Filter)
|
DEFINE_STANDARD_RTTIEXT(SMESHGUI_Filter,VTKViewer_Filter)
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -99,7 +99,7 @@ private:
|
|||||||
SMESH::Predicate_var myPred;
|
SMESH::Predicate_var myPred;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_PredicateFilter,SMESHGUI_Filter)
|
DEFINE_STANDARD_RTTIEXT(SMESHGUI_PredicateFilter,SMESHGUI_Filter)
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -121,7 +121,7 @@ public:
|
|||||||
Standard_EXPORT virtual bool IsNodeFilter() const;
|
Standard_EXPORT virtual bool IsNodeFilter() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_QuadrangleFilter,SMESHGUI_Filter)
|
DEFINE_STANDARD_RTTIEXT(SMESHGUI_QuadrangleFilter,SMESHGUI_Filter)
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -143,7 +143,7 @@ public:
|
|||||||
Standard_EXPORT virtual bool IsNodeFilter() const;
|
Standard_EXPORT virtual bool IsNodeFilter() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_TriangleFilter,SMESHGUI_Filter)
|
DEFINE_STANDARD_RTTIEXT(SMESHGUI_TriangleFilter,SMESHGUI_Filter)
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -165,7 +165,7 @@ public:
|
|||||||
Standard_EXPORT virtual bool IsNodeFilter() const;
|
Standard_EXPORT virtual bool IsNodeFilter() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_FacesFilter,SMESHGUI_Filter)
|
DEFINE_STANDARD_RTTIEXT(SMESHGUI_FacesFilter,SMESHGUI_Filter)
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -187,7 +187,7 @@ public:
|
|||||||
Standard_EXPORT virtual bool IsNodeFilter() const;
|
Standard_EXPORT virtual bool IsNodeFilter() const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_VolumesFilter,SMESHGUI_Filter)
|
DEFINE_STANDARD_RTTIEXT(SMESHGUI_VolumesFilter,SMESHGUI_Filter)
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -211,7 +211,7 @@ public:
|
|||||||
Standard_EXPORT static int GetId( SMDSAbs_GeometryType geom );
|
Standard_EXPORT static int GetId( SMDSAbs_GeometryType geom );
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OCCT_DEFINE_STANDARD_RTTIEXT(SMESHGUI_VolumeShapeFilter,SMESHGUI_Filter)
|
DEFINE_STANDARD_RTTIEXT(SMESHGUI_VolumeShapeFilter,SMESHGUI_Filter)
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // SMESHGUI_FILTER_H
|
#endif // SMESHGUI_FILTER_H
|
||||||
|
@ -798,7 +798,7 @@ void SMESHGUI_FilterTable::Table::setEditable (bool isEditable,
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// name : SMESHGUI_FilterTable::Table::isEditable
|
// name : SMESHGUI_FilterTable::Table::isEditable
|
||||||
// Purpose : Verify wheter cell is editable
|
// Purpose : Verify whether cell is editable
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
bool SMESHGUI_FilterTable::Table::isEditable (int row, int col) const
|
bool SMESHGUI_FilterTable::Table::isEditable (int row, int col) const
|
||||||
{
|
{
|
||||||
@ -1571,6 +1571,7 @@ void SMESHGUI_FilterTable::updateAdditionalWidget()
|
|||||||
aCriterion == SMESH::FT_MaxElementLength3D ||
|
aCriterion == SMESH::FT_MaxElementLength3D ||
|
||||||
aCriterion == SMESH::FT_Length ||
|
aCriterion == SMESH::FT_Length ||
|
||||||
aCriterion == SMESH::FT_Length2D ||
|
aCriterion == SMESH::FT_Length2D ||
|
||||||
|
aCriterion == SMESH::FT_Deflection2D ||
|
||||||
aCriterion == SMESH::FT_BallDiameter );
|
aCriterion == SMESH::FT_BallDiameter );
|
||||||
|
|
||||||
bool toEnable = (( isDbl && ((ComboItem*)aTable->item(aRow, 1))->value() == SMESH::FT_EqualTo) ||
|
bool toEnable = (( isDbl && ((ComboItem*)aTable->item(aRow, 1))->value() == SMESH::FT_EqualTo) ||
|
||||||
@ -1617,6 +1618,7 @@ const char* SMESHGUI_FilterTable::getPrecision( const int aType )
|
|||||||
retval = "len_tol_precision"; break;
|
retval = "len_tol_precision"; break;
|
||||||
case SMESH::FT_Length:
|
case SMESH::FT_Length:
|
||||||
case SMESH::FT_Length2D:
|
case SMESH::FT_Length2D:
|
||||||
|
case SMESH::FT_Deflection2D:
|
||||||
case SMESH::FT_MaxElementLength2D:
|
case SMESH::FT_MaxElementLength2D:
|
||||||
case SMESH::FT_MaxElementLength3D:
|
case SMESH::FT_MaxElementLength3D:
|
||||||
case SMESH::FT_BallDiameter:
|
case SMESH::FT_BallDiameter:
|
||||||
@ -1752,6 +1754,7 @@ static QList<int> entityTypes( const int theType )
|
|||||||
typeIds.append( SMDSEntity_TriQuad_Hexa );
|
typeIds.append( SMDSEntity_TriQuad_Hexa );
|
||||||
typeIds.append( SMDSEntity_Penta );
|
typeIds.append( SMDSEntity_Penta );
|
||||||
typeIds.append( SMDSEntity_Quad_Penta );
|
typeIds.append( SMDSEntity_Quad_Penta );
|
||||||
|
typeIds.append( SMDSEntity_BiQuad_Penta );
|
||||||
typeIds.append( SMDSEntity_Hexagonal_Prism );
|
typeIds.append( SMDSEntity_Hexagonal_Prism );
|
||||||
typeIds.append( SMDSEntity_Polyhedra );
|
typeIds.append( SMDSEntity_Polyhedra );
|
||||||
//typeIds.append( SMDSEntity_Quad_Polyhedra );
|
//typeIds.append( SMDSEntity_Quad_Polyhedra );
|
||||||
@ -1791,13 +1794,13 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
|
|||||||
}
|
}
|
||||||
|
|
||||||
// find out a type of item required by a new criterion and other table features
|
// find out a type of item required by a new criterion and other table features
|
||||||
int aCriterionType = GetCriterionType(row);
|
int aCriterionType = GetCriterionType(row);
|
||||||
bool anIsDoubleCriterion = false;
|
bool anIsDoubleCriterion = false;
|
||||||
bool anIsIntCriterion = false;
|
bool anIsIntCriterion = false;
|
||||||
bool anIsComboCriterion = false;
|
bool anIsComboCriterion = false;
|
||||||
// other features:
|
// other features:
|
||||||
QList<int> comboIDs; // values to show in a combo item
|
QList<int> comboIDs; // values to show in a combo item
|
||||||
int nbCompareSigns = 0; // possible values are 0,1,3
|
int nbCompareSigns = 0; // possible values are 0,1,3
|
||||||
bool isThresholdEditable = false; // actual for "simple" item types
|
bool isThresholdEditable = false; // actual for "simple" item types
|
||||||
switch ( aCriterionType )
|
switch ( aCriterionType )
|
||||||
{
|
{
|
||||||
@ -1810,8 +1813,7 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
|
|||||||
case SMESH::FT_Area:
|
case SMESH::FT_Area:
|
||||||
case SMESH::FT_Volume3D:
|
case SMESH::FT_Volume3D:
|
||||||
case SMESH::FT_MaxElementLength2D:
|
case SMESH::FT_MaxElementLength2D:
|
||||||
case SMESH::FT_MaxElementLength3D:
|
case SMESH::FT_MaxElementLength3D: anIsDoubleCriterion = true; break;
|
||||||
anIsDoubleCriterion = true; break;
|
|
||||||
|
|
||||||
case SMESH::FT_FreeBorders:
|
case SMESH::FT_FreeBorders:
|
||||||
case SMESH::FT_FreeEdges:
|
case SMESH::FT_FreeEdges:
|
||||||
@ -1827,7 +1829,8 @@ void SMESHGUI_FilterTable::onCriterionChanged (const int row, const int col, con
|
|||||||
case SMESH::FT_MultiConnection2D: anIsIntCriterion = true; nbCompareSigns = 3; break;
|
case SMESH::FT_MultiConnection2D: anIsIntCriterion = true; nbCompareSigns = 3; break;
|
||||||
|
|
||||||
case SMESH::FT_Length:
|
case SMESH::FT_Length:
|
||||||
case SMESH::FT_Length2D: anIsDoubleCriterion = true; break;
|
case SMESH::FT_Length2D:
|
||||||
|
case SMESH::FT_Deflection2D: anIsDoubleCriterion = true; break;
|
||||||
|
|
||||||
case SMESH::FT_BelongToMeshGroup: break;
|
case SMESH::FT_BelongToMeshGroup: break;
|
||||||
|
|
||||||
@ -2239,6 +2242,7 @@ const QMap<int, QString>& SMESHGUI_FilterTable::getCriteria (const int theType)
|
|||||||
aCriteria[ SMESH::FT_BelongToGenSurface ] = tr("BELONG_TO_GENSURFACE");
|
aCriteria[ SMESH::FT_BelongToGenSurface ] = tr("BELONG_TO_GENSURFACE");
|
||||||
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
|
aCriteria[ SMESH::FT_LyingOnGeom ] = tr("LYING_ON_GEOM");
|
||||||
aCriteria[ SMESH::FT_Length2D ] = tr("LENGTH2D");
|
aCriteria[ SMESH::FT_Length2D ] = tr("LENGTH2D");
|
||||||
|
aCriteria[ SMESH::FT_Deflection2D ] = tr("DEFLECTION2D");
|
||||||
aCriteria[ SMESH::FT_MultiConnection2D ] = tr("MULTI2D_BORDERS");
|
aCriteria[ SMESH::FT_MultiConnection2D ] = tr("MULTI2D_BORDERS");
|
||||||
aCriteria[ SMESH::FT_FreeFaces ] = tr("FREE_FACES");
|
aCriteria[ SMESH::FT_FreeFaces ] = tr("FREE_FACES");
|
||||||
aCriteria[ SMESH::FT_BareBorderFace ] = tr("BARE_BORDER_FACE");
|
aCriteria[ SMESH::FT_BareBorderFace ] = tr("BARE_BORDER_FACE");
|
||||||
|
@ -1113,14 +1113,14 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
{
|
{
|
||||||
if ( myFilter->_is_nil() ) return false;
|
if ( myFilter->_is_nil() ) return false;
|
||||||
|
|
||||||
if (CORBA::is_nil(myGroupOnFilter)) { // creation
|
if (CORBA::is_nil(myGroupOnFilter)) // creation
|
||||||
|
{
|
||||||
if (myMesh->_is_nil())
|
if (myMesh->_is_nil())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
myGroupOnFilter = myMesh->CreateGroupFromFilter(aType,
|
myGroupOnFilter = myMesh->CreateGroupFromFilter(aType,
|
||||||
SMESH::toUtf8(myName->text()),
|
SMESH::toUtf8(myName->text()),
|
||||||
myFilter);
|
myFilter);
|
||||||
|
|
||||||
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter );
|
resultGroup = SMESH::SMESH_GroupBase::_narrow( myGroupOnFilter );
|
||||||
isCreation = true;
|
isCreation = true;
|
||||||
}
|
}
|
||||||
@ -1134,7 +1134,7 @@ bool SMESHGUI_GroupDlg::onApply()
|
|||||||
anIsOk = true;
|
anIsOk = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( anIsOk )
|
if ( anIsOk )
|
||||||
{
|
{
|
||||||
SALOMEDS::Color aColor = getGroupColor();
|
SALOMEDS::Color aColor = getGroupColor();
|
||||||
resultGroup->SetColor(aColor);
|
resultGroup->SetColor(aColor);
|
||||||
|
@ -63,16 +63,20 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define LibHandle HMODULE
|
#define LibHandle HMODULE
|
||||||
#define LoadLib( name ) LoadLibrary( name )
|
#define LoadLib( name ) LoadLibrary( name )
|
||||||
#define GetProc GetProcAddress
|
#define GetProc GetProcAddress
|
||||||
#define UnLoadLib( handle ) FreeLibrary( handle );
|
#define UnLoadLib( handle ) FreeLibrary( handle );
|
||||||
#else
|
#else // WIN32
|
||||||
#define LibHandle void*
|
#define LibHandle void*
|
||||||
#define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL )
|
#ifdef DYNLOAD_LOCAL
|
||||||
#define GetProc dlsym
|
#define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_LOCAL )
|
||||||
#define UnLoadLib( handle ) dlclose( handle );
|
#else // DYNLOAD_LOCAL
|
||||||
#endif
|
#define LoadLib( name ) dlopen( name, RTLD_LAZY | RTLD_GLOBAL )
|
||||||
|
#endif // DYNLOAD_LOCAL
|
||||||
|
#define GetProc dlsym
|
||||||
|
#define UnLoadLib( handle ) dlclose( handle );
|
||||||
|
#endif // WIN32
|
||||||
|
|
||||||
#ifdef _DEBUG_
|
#ifdef _DEBUG_
|
||||||
static int MYDEBUG = 0;
|
static int MYDEBUG = 0;
|
||||||
|
@ -153,6 +153,7 @@ vtkIdType getCellType( const SMDSAbs_ElementType theType,
|
|||||||
else if ( theNbNodes == 20 ) return VTK_QUADRATIC_HEXAHEDRON;
|
else if ( theNbNodes == 20 ) return VTK_QUADRATIC_HEXAHEDRON;
|
||||||
else if ( theNbNodes == 27 ) return VTK_TRIQUADRATIC_HEXAHEDRON;
|
else if ( theNbNodes == 27 ) return VTK_TRIQUADRATIC_HEXAHEDRON;
|
||||||
else if ( theNbNodes == 15 ) return VTK_QUADRATIC_WEDGE;
|
else if ( theNbNodes == 15 ) return VTK_QUADRATIC_WEDGE;
|
||||||
|
else if ( theNbNodes == 18 ) return VTK_BIQUADRATIC_QUADRATIC_WEDGE;
|
||||||
else if ( theNbNodes == 13 ) return VTK_QUADRATIC_PYRAMID;//VTK_CONVEX_POINT_SET;
|
else if ( theNbNodes == 13 ) return VTK_QUADRATIC_PYRAMID;//VTK_CONVEX_POINT_SET;
|
||||||
else return VTK_EMPTY_CELL;
|
else return VTK_EMPTY_CELL;
|
||||||
|
|
||||||
|
@ -322,7 +322,7 @@ SMESHGUI_MeshInfo::SMESHGUI_MeshInfo( QWidget* parent )
|
|||||||
QLabel* a2DTriQuad = createField();
|
QLabel* a2DTriQuad = createField();
|
||||||
a2DTriQuad->setObjectName("nbQuadraticTriangle");
|
a2DTriQuad->setObjectName("nbQuadraticTriangle");
|
||||||
QLabel* a2DTriBiQuad = createField();
|
QLabel* a2DTriBiQuad = createField();
|
||||||
a2DTriBiQuad->setObjectName("nbBiQuadraticTriangle");
|
a2DTriBiQuad->setObjectName("nbBiQuadraticTriangle");
|
||||||
QLabel* a2DQuaLab = new QLabel( tr( "QUADRANGLES_LAB" ), this );
|
QLabel* a2DQuaLab = new QLabel( tr( "QUADRANGLES_LAB" ), this );
|
||||||
QLabel* a2DQuaTotal = createField();
|
QLabel* a2DQuaTotal = createField();
|
||||||
a2DQuaTotal->setObjectName("nbQuadrangle");
|
a2DQuaTotal->setObjectName("nbQuadrangle");
|
||||||
@ -386,6 +386,8 @@ SMESHGUI_MeshInfo::SMESHGUI_MeshInfo( QWidget* parent )
|
|||||||
a3DPriLin->setObjectName("nbLinearPrism");
|
a3DPriLin->setObjectName("nbLinearPrism");
|
||||||
QLabel* a3DPriQuad = createField();
|
QLabel* a3DPriQuad = createField();
|
||||||
a3DPriQuad->setObjectName("nbQuadraticPrism");
|
a3DPriQuad->setObjectName("nbQuadraticPrism");
|
||||||
|
QLabel* a3DPriBiQuad = createField();
|
||||||
|
a3DPriBiQuad->setObjectName("nbBiQuadraticPrism");
|
||||||
QLabel* a3DHexPriLab = new QLabel( tr( "HEX_PRISMS_LAB" ), this );
|
QLabel* a3DHexPriLab = new QLabel( tr( "HEX_PRISMS_LAB" ), this );
|
||||||
QLabel* a3DHexPriTotal = createField();
|
QLabel* a3DHexPriTotal = createField();
|
||||||
a3DHexPriTotal->setObjectName("nbHexagonalPrism");
|
a3DHexPriTotal->setObjectName("nbHexagonalPrism");
|
||||||
@ -397,7 +399,7 @@ SMESHGUI_MeshInfo::SMESHGUI_MeshInfo( QWidget* parent )
|
|||||||
myWidgets[ index++ ] << a3DTetLab << a3DTetTotal << a3DTetLin << a3DTetQuad;
|
myWidgets[ index++ ] << a3DTetLab << a3DTetTotal << a3DTetLin << a3DTetQuad;
|
||||||
myWidgets[ index++ ] << a3DHexLab << a3DHexTotal << a3DHexLin << a3DHexQuad << a3DHexBiQuad;
|
myWidgets[ index++ ] << a3DHexLab << a3DHexTotal << a3DHexLin << a3DHexQuad << a3DHexBiQuad;
|
||||||
myWidgets[ index++ ] << a3DPyrLab << a3DPyrTotal << a3DPyrLin << a3DPyrQuad;
|
myWidgets[ index++ ] << a3DPyrLab << a3DPyrTotal << a3DPyrLin << a3DPyrQuad;
|
||||||
myWidgets[ index++ ] << a3DPriLab << a3DPriTotal << a3DPriLin << a3DPriQuad;
|
myWidgets[ index++ ] << a3DPriLab << a3DPriTotal << a3DPriLin << a3DPriQuad << a3DPriBiQuad;
|
||||||
myWidgets[ index++ ] << a3DHexPriLab << a3DHexPriTotal;
|
myWidgets[ index++ ] << a3DHexPriLab << a3DHexPriTotal;
|
||||||
myWidgets[ index++ ] << a3DPolLab << a3DPolTotal;
|
myWidgets[ index++ ] << a3DPolLab << a3DPolTotal;
|
||||||
|
|
||||||
@ -491,6 +493,7 @@ SMESHGUI_MeshInfo::SMESHGUI_MeshInfo( QWidget* parent )
|
|||||||
l->addWidget( a3DPriTotal, 24, 1 );
|
l->addWidget( a3DPriTotal, 24, 1 );
|
||||||
l->addWidget( a3DPriLin, 24, 2 );
|
l->addWidget( a3DPriLin, 24, 2 );
|
||||||
l->addWidget( a3DPriQuad, 24, 3 );
|
l->addWidget( a3DPriQuad, 24, 3 );
|
||||||
|
l->addWidget( a3DPriBiQuad, 24, 4 );
|
||||||
l->addWidget( a3DHexPriLab, 25, 0 );
|
l->addWidget( a3DHexPriLab, 25, 0 );
|
||||||
l->addWidget( a3DHexPriTotal, 25, 1 );
|
l->addWidget( a3DHexPriTotal, 25, 1 );
|
||||||
l->addWidget( a3DPolLab, 26, 0 );
|
l->addWidget( a3DPolLab, 26, 0 );
|
||||||
@ -581,10 +584,10 @@ void SMESHGUI_MeshInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
|
|||||||
long nbTetrahedrons = info[SMDSEntity_Tetra] + info[SMDSEntity_Quad_Tetra];
|
long nbTetrahedrons = info[SMDSEntity_Tetra] + info[SMDSEntity_Quad_Tetra];
|
||||||
long nbHexahedrons = info[SMDSEntity_Hexa] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa];
|
long nbHexahedrons = info[SMDSEntity_Hexa] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_TriQuad_Hexa];
|
||||||
long nbPyramids = info[SMDSEntity_Pyramid] + info[SMDSEntity_Quad_Pyramid];
|
long nbPyramids = info[SMDSEntity_Pyramid] + info[SMDSEntity_Quad_Pyramid];
|
||||||
long nbPrisms = info[SMDSEntity_Penta] + info[SMDSEntity_Quad_Penta];
|
long nbPrisms = info[SMDSEntity_Penta] + info[SMDSEntity_Quad_Penta] + info[SMDSEntity_BiQuad_Penta];
|
||||||
long nb3DLinear = info[SMDSEntity_Tetra] + info[SMDSEntity_Hexa] + info[SMDSEntity_Pyramid] + info[SMDSEntity_Penta] + info[SMDSEntity_Polyhedra] + info[SMDSEntity_Hexagonal_Prism];
|
long nb3DLinear = info[SMDSEntity_Tetra] + info[SMDSEntity_Hexa] + info[SMDSEntity_Pyramid] + info[SMDSEntity_Penta] + info[SMDSEntity_Polyhedra] + info[SMDSEntity_Hexagonal_Prism];
|
||||||
long nb3DQuadratic = info[SMDSEntity_Quad_Tetra] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_Quad_Pyramid] + info[SMDSEntity_Quad_Penta];
|
long nb3DQuadratic = info[SMDSEntity_Quad_Tetra] + info[SMDSEntity_Quad_Hexa] + info[SMDSEntity_Quad_Pyramid] + info[SMDSEntity_Quad_Penta];
|
||||||
long nb3DBiQuadratic = info[SMDSEntity_TriQuad_Hexa];
|
long nb3DBiQuadratic = info[SMDSEntity_TriQuad_Hexa] + info[SMDSEntity_BiQuad_Penta];
|
||||||
long nb3DTotal = nb3DLinear + nb3DQuadratic + nb3DBiQuadratic;
|
long nb3DTotal = nb3DLinear + nb3DQuadratic + nb3DBiQuadratic;
|
||||||
myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( nb3DTotal ));
|
myWidgets[i3D][iTotal] ->setProperty( "text", QString::number( nb3DTotal ));
|
||||||
myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( nb3DLinear ));
|
myWidgets[i3D][iLinear] ->setProperty( "text", QString::number( nb3DLinear ));
|
||||||
@ -603,6 +606,7 @@ void SMESHGUI_MeshInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
|
|||||||
myWidgets[i3DPrisms][iTotal] ->setProperty( "text", QString::number( nbPrisms ));
|
myWidgets[i3DPrisms][iTotal] ->setProperty( "text", QString::number( nbPrisms ));
|
||||||
myWidgets[i3DPrisms][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Penta] ));
|
myWidgets[i3DPrisms][iLinear] ->setProperty( "text", QString::number( info[SMDSEntity_Penta] ));
|
||||||
myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Penta] ));
|
myWidgets[i3DPrisms][iQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_Quad_Penta] ));
|
||||||
|
myWidgets[i3DPrisms][iBiQuadratic] ->setProperty( "text", QString::number( info[SMDSEntity_BiQuad_Penta] ));
|
||||||
myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Hexagonal_Prism] ));
|
myWidgets[i3DHexaPrisms][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Hexagonal_Prism] ));
|
||||||
myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Polyhedra] ));
|
myWidgets[i3DPolyhedrons][iTotal] ->setProperty( "text", QString::number( info[SMDSEntity_Polyhedra] ));
|
||||||
long nbElemTotal = info[SMDSEntity_0D] + info[SMDSEntity_Ball] + nbEdges + nb2DTotal + nb3DTotal;
|
long nbElemTotal = info[SMDSEntity_0D] + info[SMDSEntity_Ball] + nbEdges + nb2DTotal + nb3DTotal;
|
||||||
@ -937,7 +941,7 @@ void SMESHGUI_MeshInfo::saveInfo( QTextStream &out )
|
|||||||
\param parent parent widget
|
\param parent parent widget
|
||||||
*/
|
*/
|
||||||
SMESHGUI_ElemInfo::SMESHGUI_ElemInfo( QWidget* parent )
|
SMESHGUI_ElemInfo::SMESHGUI_ElemInfo( QWidget* parent )
|
||||||
: QWidget( parent ), myActor( 0 ), myIsElement( -1 )
|
: QWidget( parent ), myActor( 0 ), myIsElement( -1 )
|
||||||
{
|
{
|
||||||
myFrame = new QWidget( this );
|
myFrame = new QWidget( this );
|
||||||
myExtra = new ExtraWidget( this );
|
myExtra = new ExtraWidget( this );
|
||||||
@ -962,11 +966,13 @@ SMESHGUI_ElemInfo::~SMESHGUI_ElemInfo()
|
|||||||
\brief Set mesh data source (actor)
|
\brief Set mesh data source (actor)
|
||||||
\param actor mesh object actor
|
\param actor mesh object actor
|
||||||
*/
|
*/
|
||||||
void SMESHGUI_ElemInfo::setSource( SMESH_Actor* actor )
|
void SMESHGUI_ElemInfo::setSource( SMESH_Actor* actor, SMESH::SMESH_IDSource_var obj )
|
||||||
{
|
{
|
||||||
if ( myActor != actor ) {
|
if ( myActor != actor ) {
|
||||||
myActor = actor;
|
myActor = actor;
|
||||||
myIsElement = -1;
|
myIsElement = -1;
|
||||||
|
SMESH::SMESH_Mesh_var mesh = obj->GetMesh();
|
||||||
|
myMeshHasShape = ( !mesh->_is_nil() && mesh->HasShapeToMesh() );
|
||||||
clear();
|
clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1159,7 +1165,7 @@ void SMESHGUI_ElemInfo::updateControls()
|
|||||||
\param parent parent widget
|
\param parent parent widget
|
||||||
*/
|
*/
|
||||||
SMESHGUI_SimpleElemInfo::SMESHGUI_SimpleElemInfo( QWidget* parent )
|
SMESHGUI_SimpleElemInfo::SMESHGUI_SimpleElemInfo( QWidget* parent )
|
||||||
: SMESHGUI_ElemInfo( parent )
|
: SMESHGUI_ElemInfo( parent )
|
||||||
{
|
{
|
||||||
myInfo = new QTextBrowser( frame() );
|
myInfo = new QTextBrowser( frame() );
|
||||||
QVBoxLayout* l = new QVBoxLayout( frame() );
|
QVBoxLayout* l = new QVBoxLayout( frame() );
|
||||||
@ -1174,12 +1180,12 @@ SMESHGUI_SimpleElemInfo::SMESHGUI_SimpleElemInfo( QWidget* parent )
|
|||||||
void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
||||||
{
|
{
|
||||||
clearInternal();
|
clearInternal();
|
||||||
|
|
||||||
if ( actor() ) {
|
if ( actor() ) {
|
||||||
int grp_details = SMESHGUI::resourceMgr()->booleanValue( "SMESH", "elem_info_grp_details", false );
|
int grp_details = SMESHGUI::resourceMgr()->booleanValue( "SMESH", "elem_info_grp_details", false );
|
||||||
int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 );
|
int precision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "length_precision", 6 );
|
||||||
int cprecision = -1;
|
int cprecision = -1;
|
||||||
if ( SMESHGUI::resourceMgr()->booleanValue( "SMESH", "use_precision", false ))
|
if ( SMESHGUI::resourceMgr()->booleanValue( "SMESH", "use_precision", false ))
|
||||||
cprecision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "controls_precision", -1 );
|
cprecision = SMESHGUI::resourceMgr()->integerValue( "SMESH", "controls_precision", -1 );
|
||||||
foreach ( long id, ids ) {
|
foreach ( long id, ids ) {
|
||||||
if ( !isElements() ) {
|
if ( !isElements() ) {
|
||||||
@ -1224,7 +1230,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
myInfo->append( QString( "<b>%1</b>" ).arg( SMESHGUI_ElemInfo::tr( "FREE_NODE" )).arg( id ));
|
myInfo->append( QString( "<b>%1</b>" ).arg( SMESHGUI_ElemInfo::tr( "FREE_NODE" )).arg( id ));
|
||||||
}
|
}
|
||||||
// node position
|
// node position
|
||||||
SMESH::SMESH_Mesh_ptr aMeshPtr = actor()->GetObject()->GetMeshServer();
|
SMESH::SMESH_Mesh_ptr aMeshPtr = actor()->GetObject()->GetMeshServer();
|
||||||
if ( !CORBA::is_nil( aMeshPtr )) {
|
if ( !CORBA::is_nil( aMeshPtr )) {
|
||||||
SMESH::NodePosition_var pos = aMeshPtr->GetNodePosition( id );
|
SMESH::NodePosition_var pos = aMeshPtr->GetNodePosition( id );
|
||||||
int shapeID = pos->shapeID;
|
int shapeID = pos->shapeID;
|
||||||
@ -1240,8 +1246,8 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
case GEOM::FACE:
|
case GEOM::FACE:
|
||||||
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" );
|
shapeType = SMESHGUI_ElemInfo::tr( "GEOM_FACE" );
|
||||||
if ( pos->params.length() == 2 ) {
|
if ( pos->params.length() == 2 ) {
|
||||||
u = pos->params[0];
|
u = pos->params[0];
|
||||||
v = pos->params[1];
|
v = pos->params[1];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case GEOM::VERTEX:
|
case GEOM::VERTEX:
|
||||||
@ -1285,7 +1291,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
|
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
|
||||||
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
|
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
|
||||||
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
|
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
|
||||||
|
|
||||||
// type : group on geometry, standalone group, group on filter
|
// type : group on geometry, standalone group, group on filter
|
||||||
if ( !CORBA::is_nil( aStdGroup )) {
|
if ( !CORBA::is_nil( aStdGroup )) {
|
||||||
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
|
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
|
||||||
@ -1305,11 +1311,11 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
|
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
|
||||||
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" )) );
|
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" )) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// size
|
// size
|
||||||
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" )).
|
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" )).
|
||||||
arg( QString::number( aGrp->Size() )) );
|
arg( QString::number( aGrp->Size() )) );
|
||||||
|
|
||||||
// color
|
// color
|
||||||
SALOMEDS::Color color = aGrp->GetColor();
|
SALOMEDS::Color color = aGrp->GetColor();
|
||||||
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" )).
|
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" )).
|
||||||
@ -1322,11 +1328,11 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
else {
|
else {
|
||||||
//
|
//
|
||||||
// show element info
|
// show element info
|
||||||
//
|
//
|
||||||
const SMDS_MeshElement* e = actor()->GetObject()->GetMesh()->FindElement( id );
|
const SMDS_MeshElement* e = actor()->GetObject()->GetMesh()->FindElement( id );
|
||||||
SMESH::Controls::NumericalFunctorPtr afunctor;
|
SMESH::Controls::NumericalFunctorPtr afunctor;
|
||||||
if ( !e ) return;
|
if ( !e ) return;
|
||||||
|
|
||||||
// Element ID && Type
|
// Element ID && Type
|
||||||
QString stype;
|
QString stype;
|
||||||
switch( e->GetType() ) {
|
switch( e->GetType() ) {
|
||||||
@ -1340,7 +1346,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
stype = SMESHGUI_ElemInfo::tr( "FACE" ); break;
|
stype = SMESHGUI_ElemInfo::tr( "FACE" ); break;
|
||||||
case SMDSAbs_Volume:
|
case SMDSAbs_Volume:
|
||||||
stype = SMESHGUI_ElemInfo::tr( "VOLUME" ); break;
|
stype = SMESHGUI_ElemInfo::tr( "VOLUME" ); break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( stype.isEmpty() ) return;
|
if ( stype.isEmpty() ) return;
|
||||||
@ -1374,13 +1380,14 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
gtype = SMESHGUI_ElemInfo::tr( "HEXAHEDRON" ); break;
|
gtype = SMESHGUI_ElemInfo::tr( "HEXAHEDRON" ); break;
|
||||||
case SMDSEntity_Penta:
|
case SMDSEntity_Penta:
|
||||||
case SMDSEntity_Quad_Penta:
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
gtype = SMESHGUI_ElemInfo::tr( "PRISM" ); break;
|
gtype = SMESHGUI_ElemInfo::tr( "PRISM" ); break;
|
||||||
case SMDSEntity_Hexagonal_Prism:
|
case SMDSEntity_Hexagonal_Prism:
|
||||||
gtype = SMESHGUI_ElemInfo::tr( "HEX_PRISM" ); break;
|
gtype = SMESHGUI_ElemInfo::tr( "HEX_PRISM" ); break;
|
||||||
case SMDSEntity_Polyhedra:
|
case SMDSEntity_Polyhedra:
|
||||||
case SMDSEntity_Quad_Polyhedra:
|
case SMDSEntity_Quad_Polyhedra:
|
||||||
gtype = SMESHGUI_ElemInfo::tr( "POLYHEDRON" ); break;
|
gtype = SMESHGUI_ElemInfo::tr( "POLYHEDRON" ); break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( !gtype.isEmpty() )
|
if ( !gtype.isEmpty() )
|
||||||
@ -1439,53 +1446,58 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
afunctor.reset( new SMESH::Controls::Length() );
|
afunctor.reset( new SMESH::Controls::Length() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
afunctor->SetPrecision( cprecision );
|
afunctor->SetPrecision( cprecision );
|
||||||
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "LENGTH_EDGES" )).arg( afunctor->GetValue( id )) );
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "LENGTH_EDGES" )).arg( afunctor->GetValue( id )) );
|
||||||
}
|
}
|
||||||
if( e->GetType() == SMDSAbs_Face ) {
|
if( e->GetType() == SMDSAbs_Face ) {
|
||||||
//Area
|
//Area
|
||||||
afunctor.reset( new SMESH::Controls::Area() );
|
afunctor.reset( new SMESH::Controls::Area() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
afunctor->SetPrecision( cprecision );
|
afunctor->SetPrecision( cprecision );
|
||||||
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "AREA_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "AREA_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
||||||
//Taper
|
//Taper
|
||||||
afunctor.reset( new SMESH::Controls::Taper() );
|
afunctor.reset( new SMESH::Controls::Taper() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
afunctor->SetPrecision( cprecision );
|
afunctor->SetPrecision( cprecision );
|
||||||
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "TAPER_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "TAPER_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
||||||
//AspectRatio2D
|
//AspectRatio2D
|
||||||
afunctor.reset( new SMESH::Controls::AspectRatio() );
|
afunctor.reset( new SMESH::Controls::AspectRatio() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "ASPECTRATIO_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "ASPECTRATIO_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
||||||
//Minimum angle
|
//Minimum angle
|
||||||
afunctor.reset( new SMESH::Controls::MinimumAngle() );
|
afunctor.reset( new SMESH::Controls::MinimumAngle() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
afunctor->SetPrecision( cprecision );
|
afunctor->SetPrecision( cprecision );
|
||||||
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MINIMUMANGLE_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MINIMUMANGLE_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
||||||
//Wraping angle
|
//Warping angle
|
||||||
afunctor.reset( new SMESH::Controls::Warping() );
|
afunctor.reset( new SMESH::Controls::Warping() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
afunctor->SetPrecision( cprecision );
|
afunctor->SetPrecision( cprecision );
|
||||||
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "WARP_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "WARP_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
||||||
//Skew
|
//Skew
|
||||||
afunctor.reset( new SMESH::Controls::Skew() );
|
afunctor.reset( new SMESH::Controls::Skew() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
afunctor->SetPrecision( cprecision );
|
afunctor->SetPrecision( cprecision );
|
||||||
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "SKEW_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "SKEW_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
||||||
//ElemDiam2D
|
//ElemDiam2D
|
||||||
afunctor.reset( new SMESH::Controls::MaxElementLength2D() );
|
afunctor.reset( new SMESH::Controls::MaxElementLength2D() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
|
afunctor->SetPrecision( cprecision );
|
||||||
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MAX_ELEMENT_LENGTH_2D" )).arg( afunctor->GetValue( id )) );
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MAX_ELEMENT_LENGTH_2D" )).arg( afunctor->GetValue( id )) );
|
||||||
|
//min edge length
|
||||||
|
afunctor.reset( new SMESH::Controls::Length2D() );
|
||||||
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MIN_ELEM_EDGE" )).arg( afunctor->GetValue( id )) );
|
||||||
}
|
}
|
||||||
if( e->GetType() == SMDSAbs_Volume ) {
|
if( e->GetType() == SMDSAbs_Volume ) {
|
||||||
//AspectRatio3D
|
//AspectRatio3D
|
||||||
afunctor.reset( new SMESH::Controls::AspectRatio3D() );
|
afunctor.reset( new SMESH::Controls::AspectRatio3D() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "ASPECTRATIO_3D_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "ASPECTRATIO_3D_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
||||||
//Volume
|
//Volume
|
||||||
afunctor.reset( new SMESH::Controls::Volume() );
|
afunctor.reset( new SMESH::Controls::Volume() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "VOLUME_3D_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "VOLUME_3D_ELEMENTS" )).arg( afunctor->GetValue( id )) );
|
||||||
//ElementDiameter3D
|
//ElementDiameter3D
|
||||||
afunctor.reset( new SMESH::Controls::Volume() );
|
afunctor.reset( new SMESH::Controls::Volume() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MAX_ELEMENT_LENGTH_3D" )).arg( afunctor->GetValue( id )) );
|
myInfo->append( QString( "- <b>%1:</b> %2" ).arg( tr( "MAX_ELEMENT_LENGTH_3D" )).arg( afunctor->GetValue( id )) );
|
||||||
@ -1496,7 +1508,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
// Gravity center
|
// Gravity center
|
||||||
XYZ gc = gravityCenter( e );
|
XYZ gc = gravityCenter( e );
|
||||||
myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "GRAVITY_CENTER" )).arg( gc.x() ).arg( gc.y() ).arg( gc.z() ));
|
myInfo->append( QString( "<b>%1:</b> (%2, %3, %4)" ).arg( SMESHGUI_ElemInfo::tr( "GRAVITY_CENTER" )).arg( gc.x() ).arg( gc.y() ).arg( gc.z() ));
|
||||||
|
|
||||||
// Normal vector
|
// Normal vector
|
||||||
if( e->GetType() == SMDSAbs_Face ) {
|
if( e->GetType() == SMDSAbs_Face ) {
|
||||||
XYZ gc = normal( e );
|
XYZ gc = normal( e );
|
||||||
@ -1505,7 +1517,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
|
|
||||||
// Element position
|
// Element position
|
||||||
if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
|
if ( e->GetType() >= SMDSAbs_Edge && e->GetType() <= SMDSAbs_Volume ) {
|
||||||
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
|
SMESH::SMESH_Mesh_ptr aMesh = actor()->GetObject()->GetMeshServer();
|
||||||
if ( !CORBA::is_nil( aMesh )) {
|
if ( !CORBA::is_nil( aMesh )) {
|
||||||
SMESH::ElementPosition pos = aMesh->GetElementPosition( id );
|
SMESH::ElementPosition pos = aMesh->GetElementPosition( id );
|
||||||
int shapeID = pos.shapeID;
|
int shapeID = pos.shapeID;
|
||||||
@ -1545,7 +1557,7 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
|
SMESH::SMESH_Group_var aStdGroup = SMESH::SMESH_Group::_narrow( aGrp );
|
||||||
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
|
SMESH::SMESH_GroupOnGeom_var aGeomGroup = SMESH::SMESH_GroupOnGeom::_narrow( aGrp );
|
||||||
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
|
SMESH::SMESH_GroupOnFilter_var aFltGroup = SMESH::SMESH_GroupOnFilter::_narrow( aGrp );
|
||||||
|
|
||||||
// type : group on geometry, standalone group, group on filter
|
// type : group on geometry, standalone group, group on filter
|
||||||
if ( !CORBA::is_nil( aStdGroup )) {
|
if ( !CORBA::is_nil( aStdGroup )) {
|
||||||
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
|
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
|
||||||
@ -1565,10 +1577,10 @@ void SMESHGUI_SimpleElemInfo::information( const QList<long>& ids )
|
|||||||
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
|
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "TYPE" )).
|
||||||
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" )) );
|
arg( SMESHGUI_AddInfo::tr( "GROUP_ON_FILTER" )) );
|
||||||
}
|
}
|
||||||
|
|
||||||
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" )).
|
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "SIZE" )).
|
||||||
arg( QString::number( aGrp->Size() )) );
|
arg( QString::number( aGrp->Size() )) );
|
||||||
|
|
||||||
// color
|
// color
|
||||||
SALOMEDS::Color color = aGrp->GetColor();
|
SALOMEDS::Color color = aGrp->GetColor();
|
||||||
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" )).
|
myInfo->append( QString( " - <b>%1:</b> %2" ).arg( SMESHGUI_AddInfo::tr( "COLOR" )).
|
||||||
@ -1647,7 +1659,7 @@ QWidget* SMESHGUI_TreeElemInfo::ItemDelegate::createEditor( QWidget* parent, con
|
|||||||
\param parent parent widget
|
\param parent parent widget
|
||||||
*/
|
*/
|
||||||
SMESHGUI_TreeElemInfo::SMESHGUI_TreeElemInfo( QWidget* parent )
|
SMESHGUI_TreeElemInfo::SMESHGUI_TreeElemInfo( QWidget* parent )
|
||||||
: SMESHGUI_ElemInfo( parent )
|
: SMESHGUI_ElemInfo( parent )
|
||||||
{
|
{
|
||||||
myInfo = new QTreeWidget( frame() );
|
myInfo = new QTreeWidget( frame() );
|
||||||
myInfo->setColumnCount( 2 );
|
myInfo->setColumnCount( 2 );
|
||||||
@ -1896,6 +1908,7 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
|
|||||||
gtype = SMESHGUI_ElemInfo::tr( "HEXAHEDRON" ); break;
|
gtype = SMESHGUI_ElemInfo::tr( "HEXAHEDRON" ); break;
|
||||||
case SMDSEntity_Penta:
|
case SMDSEntity_Penta:
|
||||||
case SMDSEntity_Quad_Penta:
|
case SMDSEntity_Quad_Penta:
|
||||||
|
case SMDSEntity_BiQuad_Penta:
|
||||||
gtype = SMESHGUI_ElemInfo::tr( "PRISM" ); break;
|
gtype = SMESHGUI_ElemInfo::tr( "PRISM" ); break;
|
||||||
case SMDSEntity_Hexagonal_Prism:
|
case SMDSEntity_Hexagonal_Prism:
|
||||||
gtype = SMESHGUI_ElemInfo::tr( "HEX_PRISM" ); break;
|
gtype = SMESHGUI_ElemInfo::tr( "HEX_PRISM" ); break;
|
||||||
@ -1986,7 +1999,7 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
|
|||||||
QTreeWidgetItem* taperlItem = createItem( cntrItem, Bold );
|
QTreeWidgetItem* taperlItem = createItem( cntrItem, Bold );
|
||||||
taperlItem->setText( 0, tr( "TAPER_ELEMENTS" ));
|
taperlItem->setText( 0, tr( "TAPER_ELEMENTS" ));
|
||||||
taperlItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
|
taperlItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
|
||||||
//Wraping angle
|
//Warping angle
|
||||||
afunctor.reset( new SMESH::Controls::Warping() );
|
afunctor.reset( new SMESH::Controls::Warping() );
|
||||||
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
afunctor->SetPrecision( cprecision );
|
afunctor->SetPrecision( cprecision );
|
||||||
@ -2020,6 +2033,15 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
|
|||||||
skewItem->setText( 0, tr( "SKEW_ELEMENTS" ));
|
skewItem->setText( 0, tr( "SKEW_ELEMENTS" ));
|
||||||
skewItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
|
skewItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
|
||||||
}
|
}
|
||||||
|
//Deflection
|
||||||
|
if ( hasShapeToMesh() )
|
||||||
|
{
|
||||||
|
afunctor.reset( new SMESH::Controls::Deflection2D() );
|
||||||
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
|
QTreeWidgetItem* deflItem = createItem( cntrItem, Bold );
|
||||||
|
deflItem->setText( 0, tr( "DEFLECTION_2D" ));
|
||||||
|
deflItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
|
||||||
|
}
|
||||||
//ElemDiam2D
|
//ElemDiam2D
|
||||||
if ( !e->IsPoly() )
|
if ( !e->IsPoly() )
|
||||||
{
|
{
|
||||||
@ -2054,6 +2076,13 @@ void SMESHGUI_TreeElemInfo::information( const QList<long>& ids )
|
|||||||
diam3Item->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
|
diam3Item->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//min edge length
|
||||||
|
afunctor.reset( new SMESH::Controls::Length2D() );
|
||||||
|
afunctor->SetMesh( actor()->GetObject()->GetMesh() );
|
||||||
|
QTreeWidgetItem* minEdgeItem = createItem( cntrItem, Bold );
|
||||||
|
minEdgeItem->setText( 0, tr( "MIN_ELEM_EDGE" ));
|
||||||
|
minEdgeItem->setText( 1, QString( "%1" ).arg( afunctor->GetValue( id )) );
|
||||||
|
|
||||||
// gravity center
|
// gravity center
|
||||||
XYZ gc = gravityCenter( e );
|
XYZ gc = gravityCenter( e );
|
||||||
QTreeWidgetItem* gcItem = createItem( elemItem, Bold );
|
QTreeWidgetItem* gcItem = createItem( elemItem, Bold );
|
||||||
@ -2380,7 +2409,7 @@ void GrpComputor::compute()
|
|||||||
\param parent parent widget
|
\param parent parent widget
|
||||||
*/
|
*/
|
||||||
SMESHGUI_AddInfo::SMESHGUI_AddInfo( QWidget* parent )
|
SMESHGUI_AddInfo::SMESHGUI_AddInfo( QWidget* parent )
|
||||||
: QTreeWidget( parent )
|
: QTreeWidget( parent )
|
||||||
{
|
{
|
||||||
setColumnCount( 2 );
|
setColumnCount( 2 );
|
||||||
header()->setStretchLastSection( true );
|
header()->setStretchLastSection( true );
|
||||||
@ -2984,7 +3013,7 @@ void SMESHGUI_MeshInfoDlg::showInfo( const Handle(SALOME_InteractiveObject)& IO
|
|||||||
SMESH::GetNameOfSelectedElements( selector, IO, ID ) :
|
SMESH::GetNameOfSelectedElements( selector, IO, ID ) :
|
||||||
SMESH::GetNameOfSelectedNodes( selector, IO, ID );
|
SMESH::GetNameOfSelectedNodes( selector, IO, ID );
|
||||||
}
|
}
|
||||||
myElemInfo->setSource( myActor ) ;
|
myElemInfo->setSource( myActor, obj ) ;
|
||||||
if ( nb > 0 ) {
|
if ( nb > 0 ) {
|
||||||
myID->setText( ID.trimmed() );
|
myID->setText( ID.trimmed() );
|
||||||
QSet<long> ids;
|
QSet<long> ids;
|
||||||
@ -3615,12 +3644,12 @@ void SMESHGUI_CtrlInfo::showInfo( SMESH::SMESH_IDSource_ptr obj )
|
|||||||
computeOverConstrainedVolumesInfo();
|
computeOverConstrainedVolumesInfo();
|
||||||
// aspect Ratio 3D histogram
|
// aspect Ratio 3D histogram
|
||||||
computeAspectRatio3D();
|
computeAspectRatio3D();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
myButtons[7]->setEnabled( true );
|
myButtons[7]->setEnabled( true );
|
||||||
myButtons[8]->setEnabled( true );
|
myButtons[8]->setEnabled( true );
|
||||||
myButtons[9]->setEnabled( true );
|
myButtons[9]->setEnabled( true );
|
||||||
}
|
}
|
||||||
#ifdef DISABLE_PLOT2DVIEWER
|
#ifdef DISABLE_PLOT2DVIEWER
|
||||||
myMainLayout->setRowStretch(17,0);
|
myMainLayout->setRowStretch(17,0);
|
||||||
for( int i=35; i<=37; i++)
|
for( int i=35; i<=37; i++)
|
||||||
@ -3848,7 +3877,7 @@ void SMESHGUI_CtrlInfo::saveInfo( QTextStream &out ) {
|
|||||||
\param parent parent widget
|
\param parent parent widget
|
||||||
*/
|
*/
|
||||||
SMESHGUI_CtrlInfoDlg::SMESHGUI_CtrlInfoDlg( QWidget* parent )
|
SMESHGUI_CtrlInfoDlg::SMESHGUI_CtrlInfoDlg( QWidget* parent )
|
||||||
: QDialog( parent )
|
: QDialog( parent )
|
||||||
{
|
{
|
||||||
setAttribute( Qt::WA_DeleteOnClose, true );
|
setAttribute( Qt::WA_DeleteOnClose, true );
|
||||||
setWindowTitle( tr( "CTRL_INFO" ));
|
setWindowTitle( tr( "CTRL_INFO" ));
|
||||||
|
@ -153,7 +153,7 @@ public:
|
|||||||
SMESHGUI_ElemInfo( QWidget* = 0 );
|
SMESHGUI_ElemInfo( QWidget* = 0 );
|
||||||
~SMESHGUI_ElemInfo();
|
~SMESHGUI_ElemInfo();
|
||||||
|
|
||||||
void setSource( SMESH_Actor* );
|
void setSource( SMESH_Actor*, SMESH::SMESH_IDSource_var );
|
||||||
void showInfo( long, bool );
|
void showInfo( long, bool );
|
||||||
void showInfo( QSet<long>, bool );
|
void showInfo( QSet<long>, bool );
|
||||||
void clear();
|
void clear();
|
||||||
@ -179,6 +179,7 @@ protected:
|
|||||||
QWidget* frame() const;
|
QWidget* frame() const;
|
||||||
SMESH_Actor* actor() const;
|
SMESH_Actor* actor() const;
|
||||||
bool isElements() const;
|
bool isElements() const;
|
||||||
|
bool hasShapeToMesh() const { return myMeshHasShape; }
|
||||||
|
|
||||||
virtual void information( const QList<long>& ) = 0;
|
virtual void information( const QList<long>& ) = 0;
|
||||||
virtual void clearInternal();
|
virtual void clearInternal();
|
||||||
@ -204,6 +205,7 @@ private:
|
|||||||
QWidget* myFrame;
|
QWidget* myFrame;
|
||||||
ExtraWidget* myExtra;
|
ExtraWidget* myExtra;
|
||||||
int myIndex;
|
int myIndex;
|
||||||
|
bool myMeshHasShape;
|
||||||
};
|
};
|
||||||
|
|
||||||
class SMESHGUI_EXPORT SMESHGUI_SimpleElemInfo : public SMESHGUI_ElemInfo
|
class SMESHGUI_EXPORT SMESHGUI_SimpleElemInfo : public SMESHGUI_ElemInfo
|
||||||
|
@ -70,7 +70,7 @@ SMESHGUI_MeshInfosBox::SMESHGUI_MeshInfosBox(const bool full, QWidget* theParent
|
|||||||
myNbHexa(0), myNbLinHexa(0), myNbQuadHexa(0), myNbBiQuadHexa(0),
|
myNbHexa(0), myNbLinHexa(0), myNbQuadHexa(0), myNbBiQuadHexa(0),
|
||||||
myNbTetra(0),myNbLinTetra(0),myNbQuadTetra(0),
|
myNbTetra(0),myNbLinTetra(0),myNbQuadTetra(0),
|
||||||
myNbPyra(0), myNbLinPyra(0), myNbQuadPyra(0),
|
myNbPyra(0), myNbLinPyra(0), myNbQuadPyra(0),
|
||||||
myNbPrism(0),myNbLinPrism(0), myNbQuadPrism(0),
|
myNbPrism(0),myNbLinPrism(0), myNbQuadPrism(0), myNbBiQuadPrism(0),
|
||||||
myNbVolum(0), myNbLinVolum(0), myNbQuadVolum(0), myNbBiQuadVolum(0),
|
myNbVolum(0), myNbLinVolum(0), myNbQuadVolum(0), myNbBiQuadVolum(0),
|
||||||
myNbHexaPrism(0),
|
myNbHexaPrism(0),
|
||||||
myNbPolyh(0)
|
myNbPolyh(0)
|
||||||
@ -309,6 +309,9 @@ SMESHGUI_MeshInfosBox::SMESHGUI_MeshInfosBox(const bool full, QWidget* theParent
|
|||||||
myNbQuadPrism = new QLabel( this );
|
myNbQuadPrism = new QLabel( this );
|
||||||
l->addWidget( myNbQuadPrism, row, 3 );
|
l->addWidget( myNbQuadPrism, row, 3 );
|
||||||
// --
|
// --
|
||||||
|
myNbBiQuadPrism = new QLabel( this );
|
||||||
|
l->addWidget( myNbBiQuadPrism, row, 4 );
|
||||||
|
// --
|
||||||
row++; // increment row count
|
row++; // increment row count
|
||||||
// ... hexa prisms
|
// ... hexa prisms
|
||||||
lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_HEXAPRISM")), this );
|
lab = new QLabel(COLONIZE(tr("SMESH_MESHINFO_HEXAPRISM")), this );
|
||||||
@ -460,6 +463,7 @@ void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo)
|
|||||||
theInfo[SMDSEntity_TriQuad_Hexa] +
|
theInfo[SMDSEntity_TriQuad_Hexa] +
|
||||||
theInfo[SMDSEntity_Penta] +
|
theInfo[SMDSEntity_Penta] +
|
||||||
theInfo[SMDSEntity_Quad_Penta] +
|
theInfo[SMDSEntity_Quad_Penta] +
|
||||||
|
theInfo[SMDSEntity_BiQuad_Penta] +
|
||||||
theInfo[SMDSEntity_Hexagonal_Prism] +
|
theInfo[SMDSEntity_Hexagonal_Prism] +
|
||||||
theInfo[SMDSEntity_Polyhedra] ));
|
theInfo[SMDSEntity_Polyhedra] ));
|
||||||
myNbLinVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
|
myNbLinVolum ->setText( QString("%1").arg( theInfo[SMDSEntity_Tetra] +
|
||||||
@ -471,7 +475,8 @@ void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo)
|
|||||||
theInfo[SMDSEntity_Quad_Pyramid] +
|
theInfo[SMDSEntity_Quad_Pyramid] +
|
||||||
theInfo[SMDSEntity_Quad_Hexa] +
|
theInfo[SMDSEntity_Quad_Hexa] +
|
||||||
theInfo[SMDSEntity_Quad_Penta] ));
|
theInfo[SMDSEntity_Quad_Penta] ));
|
||||||
myNbBiQuadVolum->setText( QString("%1").arg( theInfo[SMDSEntity_TriQuad_Hexa] ));
|
myNbBiQuadVolum->setText( QString("%1").arg( theInfo[SMDSEntity_TriQuad_Hexa] +
|
||||||
|
theInfo[SMDSEntity_BiQuad_Penta] ));
|
||||||
|
|
||||||
if ( myFull )
|
if ( myFull )
|
||||||
{
|
{
|
||||||
@ -514,9 +519,11 @@ void SMESHGUI_MeshInfosBox::SetMeshInfo(const SMESH::long_array& theInfo)
|
|||||||
myNbQuadPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Pyramid] ));
|
myNbQuadPyra ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Pyramid] ));
|
||||||
// prisms
|
// prisms
|
||||||
myNbPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] +
|
myNbPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] +
|
||||||
theInfo[SMDSEntity_Quad_Penta] ));
|
theInfo[SMDSEntity_Quad_Penta] +
|
||||||
myNbLinPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] ));
|
theInfo[SMDSEntity_BiQuad_Penta] ));
|
||||||
myNbQuadPrism->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Penta] ));
|
myNbLinPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Penta] ));
|
||||||
|
myNbQuadPrism ->setText( QString("%1").arg( theInfo[SMDSEntity_Quad_Penta] ));
|
||||||
|
myNbBiQuadPrism->setText( QString("%1").arg( theInfo[SMDSEntity_BiQuad_Penta] ));
|
||||||
// octahedra
|
// octahedra
|
||||||
myNbHexaPrism->setText( QString("%1").arg( theInfo[ SMDSEntity_Hexagonal_Prism ]));
|
myNbHexaPrism->setText( QString("%1").arg( theInfo[ SMDSEntity_Hexagonal_Prism ]));
|
||||||
// polyedres
|
// polyedres
|
||||||
|
@ -84,6 +84,7 @@ private:
|
|||||||
QLabel* myNbPrism;
|
QLabel* myNbPrism;
|
||||||
QLabel* myNbLinPrism;
|
QLabel* myNbLinPrism;
|
||||||
QLabel* myNbQuadPrism;
|
QLabel* myNbQuadPrism;
|
||||||
|
QLabel* myNbBiQuadPrism;
|
||||||
QLabel* myNbVolum;
|
QLabel* myNbVolum;
|
||||||
QLabel* myNbLinVolum;
|
QLabel* myNbLinVolum;
|
||||||
QLabel* myNbQuadVolum;
|
QLabel* myNbQuadVolum;
|
||||||
|
@ -435,7 +435,7 @@ void SMESHGUI_MultiEditDlg::onOk()
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
// name : SMESHGUI_MultiEditDlg::getIds
|
// name : SMESHGUI_MultiEditDlg::getIds
|
||||||
// Purpose : Retrive identifiers from list box or the whole object
|
// Purpose : Retrieve identifiers from list box or the whole object
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& obj)
|
SMESH::long_array_var SMESHGUI_MultiEditDlg::getIds(SMESH::SMESH_IDSource_var& obj)
|
||||||
|
@ -91,7 +91,7 @@ namespace SMESHOp {
|
|||||||
OpRemoveElemGroupPopup = 2082, // POPUP MENU - REMOVE ELEMENTS FROM GROUP
|
OpRemoveElemGroupPopup = 2082, // POPUP MENU - REMOVE ELEMENTS FROM GROUP
|
||||||
OpMeshInformation = 2100, // MENU MESH - MESH INFORMATION
|
OpMeshInformation = 2100, // MENU MESH - MESH INFORMATION
|
||||||
OpWhatIs = 2101, // MENU MESH - MESH ELEMENT INFORMATION
|
OpWhatIs = 2101, // MENU MESH - MESH ELEMENT INFORMATION
|
||||||
OpStdInfo = 2102, // MENU MESH - MESH STANDART INFORMATION
|
OpStdInfo = 2102, // MENU MESH - MESH STANDARD INFORMATION
|
||||||
OpFindElementByPoint = 2103, // MENU MESH - FIND ELEMENT BY POINT
|
OpFindElementByPoint = 2103, // MENU MESH - FIND ELEMENT BY POINT
|
||||||
OpUpdate = 2200, // POPUP MENU - UPDATE
|
OpUpdate = 2200, // POPUP MENU - UPDATE
|
||||||
// Controls -----------------------//--------------------------------
|
// Controls -----------------------//--------------------------------
|
||||||
@ -116,6 +116,7 @@ namespace SMESHOp {
|
|||||||
OpSkew = 3210, // MENU CONTROLS - SKEW
|
OpSkew = 3210, // MENU CONTROLS - SKEW
|
||||||
OpMaxElementLength2D = 3211, // MENU CONTROLS - ELEMENT DIAMETER 2D
|
OpMaxElementLength2D = 3211, // MENU CONTROLS - ELEMENT DIAMETER 2D
|
||||||
OpEqualFace = 3212, // MENU CONTROLS - DOUBLE FACES
|
OpEqualFace = 3212, // MENU CONTROLS - DOUBLE FACES
|
||||||
|
OpDeflection2D = 3213, // MENU CONTROLS - DEFLECTION 2D
|
||||||
OpAspectRatio3D = 3300, // MENU CONTROLS - ASPECT RATIO 3D
|
OpAspectRatio3D = 3300, // MENU CONTROLS - ASPECT RATIO 3D
|
||||||
OpVolume = 3301, // MENU CONTROLS - VOLUME
|
OpVolume = 3301, // MENU CONTROLS - VOLUME
|
||||||
OpMaxElementLength3D = 3302, // MENU CONTROLS - ELEMENT DIAMETER 3D
|
OpMaxElementLength3D = 3302, // MENU CONTROLS - ELEMENT DIAMETER 3D
|
||||||
@ -146,9 +147,10 @@ namespace SMESHOp {
|
|||||||
OpQuadraticTetrahedron = 4105, // MENU MODIFICATION - ADD - QUADRATIC TETRAHEDRON
|
OpQuadraticTetrahedron = 4105, // MENU MODIFICATION - ADD - QUADRATIC TETRAHEDRON
|
||||||
OpQuadraticPyramid = 4106, // MENU MODIFICATION - ADD - QUADRATIC PYRAMID
|
OpQuadraticPyramid = 4106, // MENU MODIFICATION - ADD - QUADRATIC PYRAMID
|
||||||
OpQuadraticPentahedron = 4107, // MENU MODIFICATION - ADD - QUADRATIC PENTAHEDRON
|
OpQuadraticPentahedron = 4107, // MENU MODIFICATION - ADD - QUADRATIC PENTAHEDRON
|
||||||
OpQuadraticHexahedron = 4108, // MENU MODIFICATION - ADD - QUADRATIC HEXAHEDRON
|
OpBiQuadraticPentahedron = 4108, // MENU MODIFICATION - ADD - BIQUADRATIC PENTAHEDRON
|
||||||
OpTriQuadraticHexahedron = 4109, // MENU MODIFICATION - ADD - TRIQUADRATIC HEXAHEDRON
|
OpQuadraticHexahedron = 4110, // MENU MODIFICATION - ADD - QUADRATIC HEXAHEDRON
|
||||||
OpQuadraticPolygon = 4110, // MENU MODIFICATION - ADD - QUADRATIC POLYGON
|
OpTriQuadraticHexahedron = 4111, // MENU MODIFICATION - ADD - TRIQUADRATIC HEXAHEDRON
|
||||||
|
OpQuadraticPolygon = 4112, // MENU MODIFICATION - ADD - QUADRATIC POLYGON
|
||||||
OpRemoveNodes = 4200, // MENU MODIFICATION - REMOVE - NODE
|
OpRemoveNodes = 4200, // MENU MODIFICATION - REMOVE - NODE
|
||||||
OpRemoveElements = 4201, // MENU MODIFICATION - REMOVE - ELEMENTS
|
OpRemoveElements = 4201, // MENU MODIFICATION - REMOVE - ELEMENTS
|
||||||
OpRemoveOrphanNodes = 4202, // MENU MODIFICATION - REMOVE - ORPHAN NODES
|
OpRemoveOrphanNodes = 4202, // MENU MODIFICATION - REMOVE - ORPHAN NODES
|
||||||
|
@ -359,6 +359,7 @@ QString SMESHGUI_Selection::controlMode( int ind ) const
|
|||||||
switch( actor->GetControlMode() ) {
|
switch( actor->GetControlMode() ) {
|
||||||
case SMESH_Actor::eLength: mode = "eLength"; break;
|
case SMESH_Actor::eLength: mode = "eLength"; break;
|
||||||
case SMESH_Actor::eLength2D: mode = "eLength2D"; break;
|
case SMESH_Actor::eLength2D: mode = "eLength2D"; break;
|
||||||
|
case SMESH_Actor::eDeflection2D: mode = "eDeflection2D"; break;
|
||||||
case SMESH_Actor::eFreeEdges: mode = "eFreeEdges"; break;
|
case SMESH_Actor::eFreeEdges: mode = "eFreeEdges"; break;
|
||||||
case SMESH_Actor::eFreeNodes: mode = "eFreeNodes"; break;
|
case SMESH_Actor::eFreeNodes: mode = "eFreeNodes"; break;
|
||||||
case SMESH_Actor::eFreeBorders: mode = "eFreeBorders"; break;
|
case SMESH_Actor::eFreeBorders: mode = "eFreeBorders"; break;
|
||||||
@ -406,6 +407,11 @@ QString SMESHGUI_Selection::controlMode() const
|
|||||||
return "eNone";
|
return "eNone";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
//function : isNumFunctor
|
||||||
|
//purpose : return true if a given actor is shown using a numeric functor
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
bool SMESHGUI_Selection::isNumFunctor( int ind ) const
|
bool SMESHGUI_Selection::isNumFunctor( int ind ) const
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
@ -414,6 +420,7 @@ bool SMESHGUI_Selection::isNumFunctor( int ind ) const
|
|||||||
switch( actor->GetControlMode() ) {
|
switch( actor->GetControlMode() ) {
|
||||||
case SMESH_Actor::eLength:
|
case SMESH_Actor::eLength:
|
||||||
case SMESH_Actor::eLength2D:
|
case SMESH_Actor::eLength2D:
|
||||||
|
case SMESH_Actor::eDeflection2D:
|
||||||
case SMESH_Actor::eMultiConnection:
|
case SMESH_Actor::eMultiConnection:
|
||||||
case SMESH_Actor::eMultiConnection2D:
|
case SMESH_Actor::eMultiConnection2D:
|
||||||
case SMESH_Actor::eArea:
|
case SMESH_Actor::eArea:
|
||||||
@ -437,7 +444,7 @@ bool SMESHGUI_Selection::isNumFunctor( int ind ) const
|
|||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
//function : facesOrientationMode
|
//function : facesOrientationMode
|
||||||
//purpose :
|
//purpose :
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
QString SMESHGUI_Selection::facesOrientationMode( int ind ) const
|
QString SMESHGUI_Selection::facesOrientationMode( int ind ) const
|
||||||
|
@ -22,6 +22,9 @@
|
|||||||
|
|
||||||
// File : SMESHGUI_SingleEditDlg.cxx
|
// File : SMESHGUI_SingleEditDlg.cxx
|
||||||
// Author : Sergey LITONIN, Open CASCADE S.A.S.
|
// Author : Sergey LITONIN, Open CASCADE S.A.S.
|
||||||
|
|
||||||
|
#include <SVTK_Selector.h>
|
||||||
|
|
||||||
// SMESH includes
|
// SMESH includes
|
||||||
//
|
//
|
||||||
#include "SMESHGUI_SingleEditDlg.h"
|
#include "SMESHGUI_SingleEditDlg.h"
|
||||||
@ -42,7 +45,6 @@
|
|||||||
#include <SUIT_Desktop.h>
|
#include <SUIT_Desktop.h>
|
||||||
#include <SUIT_Session.h>
|
#include <SUIT_Session.h>
|
||||||
|
|
||||||
#include <SVTK_Selector.h>
|
|
||||||
#include <SVTK_ViewWindow.h>
|
#include <SVTK_ViewWindow.h>
|
||||||
#include <SALOME_ListIO.hxx>
|
#include <SALOME_ListIO.hxx>
|
||||||
|
|
||||||
@ -347,9 +349,9 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText)
|
|||||||
aList.Append(anIO);
|
aList.Append(anIO);
|
||||||
mySelectionMgr->setSelectedObjects(aList,false);
|
mySelectionMgr->setSelectedObjects(aList,false);
|
||||||
|
|
||||||
TColStd_IndexedMapOfInteger selectedIndices;
|
SVTK_IndexedMapOfIds selectedIndices;
|
||||||
TColStd_MapOfInteger newIndices;
|
SVTK_ListOfInteger newIndices;
|
||||||
mySelector->GetIndex(anIO,selectedIndices);
|
mySelector->GetCompositeIndex(anIO,selectedIndices);
|
||||||
|
|
||||||
int id1, id2;
|
int id1, id2;
|
||||||
if ( !getNodeIds(myEdge->text(), id1, id2) )
|
if ( !getNodeIds(myEdge->text(), id1, id2) )
|
||||||
@ -367,25 +369,13 @@ void SMESHGUI_SingleEditDlg::onTextChange (const QString& theNewText)
|
|||||||
|
|
||||||
if ( findTriangles(aNode1,aNode2,tria1,tria2) )
|
if ( findTriangles(aNode1,aNode2,tria1,tria2) )
|
||||||
{
|
{
|
||||||
newIndices.Add(tria1->GetID());
|
newIndices.push_back( aNode1->GetID() );
|
||||||
|
newIndices.push_back( aNode2->GetID() );
|
||||||
const SMDS_MeshNode* a3Nodes[3];
|
|
||||||
SMDS_ElemIteratorPtr it;
|
|
||||||
int edgeInd = 2, i;
|
|
||||||
for (i = 0, it = tria1->nodesIterator(); it->more(); i++) {
|
|
||||||
a3Nodes[ i ] = static_cast<const SMDS_MeshNode*>(it->next());
|
|
||||||
if (i > 0 && ( (a3Nodes[ i ] == aNode1 && a3Nodes[ i - 1] == aNode2) ||
|
|
||||||
(a3Nodes[ i ] == aNode2 && a3Nodes[ i - 1] == aNode1) ) ) {
|
|
||||||
edgeInd = i - 1;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
newIndices.Add(-edgeInd-1);
|
|
||||||
|
|
||||||
myOkBtn->setEnabled(true);
|
myOkBtn->setEnabled(true);
|
||||||
myApplyBtn->setEnabled(true);
|
myApplyBtn->setEnabled(true);
|
||||||
}
|
}
|
||||||
mySelector->AddOrRemoveIndex(anIO,newIndices, false);
|
mySelector->AddOrRemoveCompositeIndex(anIO, newIndices, false);
|
||||||
SMESH::GetViewWindow(mySMESHGUI)->highlight( anIO, true, true );
|
SMESH::GetViewWindow(mySMESHGUI)->highlight( anIO, true, true );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -420,7 +410,17 @@ void SMESHGUI_SingleEditDlg::onSelectionDone()
|
|||||||
if(SMDS_Mesh* aMesh = aVisualObj->GetMesh())
|
if(SMDS_Mesh* aMesh = aVisualObj->GetMesh())
|
||||||
{
|
{
|
||||||
const SMDS_MeshElement* tria[2];
|
const SMDS_MeshElement* tria[2];
|
||||||
if( SMESH::GetEdgeNodes( mySelector, aVisualObj, anId1, anId2 ) >= 1 &&
|
|
||||||
|
bool valid = false;
|
||||||
|
SVTK_IndexedMapOfIds anIds;
|
||||||
|
mySelector->GetCompositeIndex(anIO,anIds);
|
||||||
|
if( anIds.Extent() == 1 && anIds(1).size() == 2 ) {
|
||||||
|
anId1 = anIds(1)[0];
|
||||||
|
anId2 = anIds(1)[1];
|
||||||
|
valid = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( valid &&
|
||||||
findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) )
|
findTriangles( aMesh->FindNode( anId1 ), aMesh->FindNode( anId2 ), tria[0],tria[1] ) )
|
||||||
{
|
{
|
||||||
QString aText = QString("%1-%2").arg(anId1).arg(anId2);
|
QString aText = QString("%1-%2").arg(anId1).arg(anId2);
|
||||||
@ -523,6 +523,7 @@ bool SMESHGUI_SingleEditDlg::onApply()
|
|||||||
// update actor
|
// update actor
|
||||||
if (aResult) {
|
if (aResult) {
|
||||||
mySelector->ClearIndex();
|
mySelector->ClearIndex();
|
||||||
|
mySelector->ClearCompositeIndex();
|
||||||
mySelectionMgr->setSelectedObjects(aList, false);
|
mySelectionMgr->setSelectedObjects(aList, false);
|
||||||
onSelectionDone();
|
onSelectionDone();
|
||||||
SMESH::UpdateView();
|
SMESH::UpdateView();
|
||||||
|
@ -350,7 +350,7 @@ namespace SMESH
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ( objModified ) {
|
if ( objModified ) {
|
||||||
// PAL16631. Mesurements showed that to show aVisualObj in SHADING(default) mode,
|
// PAL16631. Measurements showed that to show aVisualObj in SHADING(default) mode,
|
||||||
// ~5 times more memory is used than it occupies.
|
// ~5 times more memory is used than it occupies.
|
||||||
// Warn the user if there is less free memory than 30 sizes of a grid
|
// Warn the user if there is less free memory than 30 sizes of a grid
|
||||||
// TODO: estimate memory usage in other modes and take current mode into account
|
// TODO: estimate memory usage in other modes and take current mode into account
|
||||||
@ -384,7 +384,7 @@ namespace SMESH
|
|||||||
|
|
||||||
|
|
||||||
/*! Return active view window, if it instantiates SVTK_ViewWindow class,
|
/*! Return active view window, if it instantiates SVTK_ViewWindow class,
|
||||||
* overwise find or create corresponding view window, make it active and return it.
|
* otherwise find or create corresponding view window, make it active and return it.
|
||||||
* \note Active VVTK_ViewWindow can be returned, because it inherits SVTK_ViewWindow.
|
* \note Active VVTK_ViewWindow can be returned, because it inherits SVTK_ViewWindow.
|
||||||
*/
|
*/
|
||||||
SVTK_ViewWindow* GetViewWindow (const SalomeApp_Module* theModule,
|
SVTK_ViewWindow* GetViewWindow (const SalomeApp_Module* theModule,
|
||||||
|
@ -211,6 +211,10 @@
|
|||||||
<source>ICON_DLG_QUADRATIC_PENTAHEDRON</source>
|
<source>ICON_DLG_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>mesh_quad_pentahedron.png</translation>
|
<translation>mesh_quad_pentahedron.png</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ICON_DLG_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>mesh_quad_pentahedron.png</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ICON_DLG_QUADRATIC_PYRAMID</source>
|
<source>ICON_DLG_QUADRATIC_PYRAMID</source>
|
||||||
<translation>mesh_quad_pyramid.png</translation>
|
<translation>mesh_quad_pyramid.png</translation>
|
||||||
@ -343,6 +347,10 @@
|
|||||||
<source>ICON_LENGTH_2D</source>
|
<source>ICON_LENGTH_2D</source>
|
||||||
<translation>mesh_length_2d.png</translation>
|
<translation>mesh_length_2d.png</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ICON_DEFLECTION_2D</source>
|
||||||
|
<translation>mesh_deflection.png</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ICON_MAP</source>
|
<source>ICON_MAP</source>
|
||||||
<translation>mesh_pattern.png</translation>
|
<translation>mesh_pattern.png</translation>
|
||||||
|
@ -39,6 +39,10 @@
|
|||||||
<source>CGNS_FILES_FILTER</source>
|
<source>CGNS_FILES_FILTER</source>
|
||||||
<translation>CGNS files</translation>
|
<translation>CGNS files</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>CGNS_EXPORT_ELEMS_BY_TYPE</source>
|
||||||
|
<translation>Group elements by type</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GMF_ASCII_FILES_FILTER</source>
|
<source>GMF_ASCII_FILES_FILTER</source>
|
||||||
<translation>GMF ASCII files</translation>
|
<translation>GMF ASCII files</translation>
|
||||||
@ -99,6 +103,10 @@
|
|||||||
<source>MIN_DIAG_ELEMENTS</source>
|
<source>MIN_DIAG_ELEMENTS</source>
|
||||||
<translation>Minimum diagonal</translation>
|
<translation>Minimum diagonal</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MIN_ELEM_EDGE</source>
|
||||||
|
<translation>Minimum Edge Length</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ASPECTRATIO_3D_ELEMENTS</source>
|
<source>ASPECTRATIO_3D_ELEMENTS</source>
|
||||||
<translation>Aspect Ratio 3D</translation>
|
<translation>Aspect Ratio 3D</translation>
|
||||||
@ -220,6 +228,10 @@
|
|||||||
<source>LENGTH2D_EDGES</source>
|
<source>LENGTH2D_EDGES</source>
|
||||||
<translation>Length 2D</translation>
|
<translation>Length 2D</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>DEFLECTION2D_FACES</source>
|
||||||
|
<translation>Deflection 2D</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>LENGTH_EDGES</source>
|
<source>LENGTH_EDGES</source>
|
||||||
<translation>Length</translation>
|
<translation>Length</translation>
|
||||||
@ -236,6 +248,10 @@
|
|||||||
<source>MAX_ELEMENT_LENGTH_3D</source>
|
<source>MAX_ELEMENT_LENGTH_3D</source>
|
||||||
<translation>Element Diameter 3D</translation>
|
<translation>Element Diameter 3D</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>DEFLECTION_2D</source>
|
||||||
|
<translation>Deflection 2D</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_ADD</source>
|
<source>MEN_ADD</source>
|
||||||
<translation>Add</translation>
|
<translation>Add</translation>
|
||||||
@ -688,6 +704,10 @@
|
|||||||
<source>MEN_LENGTH_2D</source>
|
<source>MEN_LENGTH_2D</source>
|
||||||
<translation>Length 2D</translation>
|
<translation>Length 2D</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_DEFLECTION_2D</source>
|
||||||
|
<translation>Deflection 2D</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_MAP</source>
|
<source>MEN_MAP</source>
|
||||||
<translation>Pattern Mapping</translation>
|
<translation>Pattern Mapping</translation>
|
||||||
@ -888,6 +908,10 @@
|
|||||||
<source>MEN_QUADRATIC_PENTAHEDRON</source>
|
<source>MEN_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>Quadratic Pentahedron</translation>
|
<translation>Quadratic Pentahedron</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>BiQuadratic Pentahedron</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_QUADRATIC_PYRAMID</source>
|
<source>MEN_QUADRATIC_PYRAMID</source>
|
||||||
<translation>Quadratic Pyramid</translation>
|
<translation>Quadratic Pyramid</translation>
|
||||||
@ -1366,6 +1390,10 @@ Please enter correct values and try again</translation>
|
|||||||
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON_TITLE</source>
|
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON_TITLE</source>
|
||||||
<translation>Add Quadratic Pentahedron</translation>
|
<translation>Add Quadratic Pentahedron</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_ADD_BIQUADRATIC_PENTAHEDRON_TITLE</source>
|
||||||
|
<translation>Add BiQuadratic Pentahedron</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ADD_QUADRATIC_PYRAMID_TITLE</source>
|
<source>SMESH_ADD_QUADRATIC_PYRAMID_TITLE</source>
|
||||||
<translation>Add Quadratic Pyramid</translation>
|
<translation>Add Quadratic Pyramid</translation>
|
||||||
@ -2113,7 +2141,7 @@ Check algorithm documentation for supported geometry</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_MESHINFO_ALL_TYPES</source>
|
<source>SMESH_MESHINFO_ALL_TYPES</source>
|
||||||
<translation>Heterogenous</translation>
|
<translation>Heterogeneous</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_MESHINFO_EDGES</source>
|
<source>SMESH_MESHINFO_EDGES</source>
|
||||||
@ -2519,10 +2547,18 @@ Check algorithm documentation for supported geometry</translation>
|
|||||||
<source>SMESH_QUADRATIC_PENTAHEDRON</source>
|
<source>SMESH_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>Quadratic Pentahedron</translation>
|
<translation>Quadratic Pentahedron</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>BiQuadratic Pentahedron</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_QUADRATIC_PENTAHEDRONS</source>
|
<source>SMESH_QUADRATIC_PENTAHEDRONS</source>
|
||||||
<translation>Quadratic Pentahedrons</translation>
|
<translation>Quadratic Pentahedrons</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_BIQUADRATIC_PENTAHEDRONS</source>
|
||||||
|
<translation>BiQuadratic Pentahedrons</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_QUADRATIC_PYRAMID</source>
|
<source>SMESH_QUADRATIC_PYRAMID</source>
|
||||||
<translation>Quadratic Pyramid</translation>
|
<translation>Quadratic Pyramid</translation>
|
||||||
@ -3251,6 +3287,10 @@ Use Display Entity menu command to show them.
|
|||||||
<source>STB_LENGTH_2D</source>
|
<source>STB_LENGTH_2D</source>
|
||||||
<translation>Length 2D</translation>
|
<translation>Length 2D</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_DEFLECTION_2D</source>
|
||||||
|
<translation>Deflection 2D</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_MAP</source>
|
<source>STB_MAP</source>
|
||||||
<translation>Pattern mapping</translation>
|
<translation>Pattern mapping</translation>
|
||||||
@ -3375,6 +3415,10 @@ Use Display Entity menu command to show them.
|
|||||||
<source>STB_QUADRATIC_PENTAHEDRON</source>
|
<source>STB_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>Quadratic Pentahedron</translation>
|
<translation>Quadratic Pentahedron</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>BiQuadratic Pentahedron</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_QUADRATIC_PYRAMID</source>
|
<source>STB_QUADRATIC_PYRAMID</source>
|
||||||
<translation>Quadratic Pyramid</translation>
|
<translation>Quadratic Pyramid</translation>
|
||||||
@ -3927,6 +3971,10 @@ Use Display Entity menu command to show them.
|
|||||||
<source>TOP_LENGTH_2D</source>
|
<source>TOP_LENGTH_2D</source>
|
||||||
<translation>Length 2D</translation>
|
<translation>Length 2D</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_DEFLECTION_2D</source>
|
||||||
|
<translation>Deflection 2D</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_MAP</source>
|
<source>TOP_MAP</source>
|
||||||
<translation>Pattern mapping</translation>
|
<translation>Pattern mapping</translation>
|
||||||
@ -4051,6 +4099,10 @@ Use Display Entity menu command to show them.
|
|||||||
<source>TOP_QUADRATIC_PENTAHEDRON</source>
|
<source>TOP_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>Quadratic Pentahedron</translation>
|
<translation>Quadratic Pentahedron</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>BiQuadratic Pentahedron</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_QUADRATIC_PYRAMID</source>
|
<source>TOP_QUADRATIC_PYRAMID</source>
|
||||||
<translation>Quadratic Pyramid</translation>
|
<translation>Quadratic Pyramid</translation>
|
||||||
@ -4888,6 +4940,10 @@ Please, create VTK viewer and try again</translation>
|
|||||||
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON</source>
|
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>Add Quadratic Pentahedron</translation>
|
<translation>Add Quadratic Pentahedron</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_ADD_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>Add BiQuadratic Pentahedron</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ADD_QUADRATIC_PYRAMID</source>
|
<source>SMESH_ADD_QUADRATIC_PYRAMID</source>
|
||||||
<translation>Add Quadratic Pyramid</translation>
|
<translation>Add Quadratic Pyramid</translation>
|
||||||
@ -5830,6 +5886,10 @@ Please enter correct value and try again</translation>
|
|||||||
<source>LENGTH2D</source>
|
<source>LENGTH2D</source>
|
||||||
<translation>Length 2D</translation>
|
<translation>Length 2D</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>DEFLECTION2D</source>
|
||||||
|
<translation>Deflection 2D</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>LESS_THAN</source>
|
<source>LESS_THAN</source>
|
||||||
<translation>Less than</translation>
|
<translation>Less than</translation>
|
||||||
@ -6018,18 +6078,22 @@ Please enter correct value and try again</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ENTITY_TYPE_21</source>
|
<source>ENTITY_TYPE_21</source>
|
||||||
<translation>OCTA12</translation>
|
<translation>PENTA18</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ENTITY_TYPE_22</source>
|
<source>ENTITY_TYPE_22</source>
|
||||||
<translation>POLYEDRE</translation>
|
<translation>OCTA12</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ENTITY_TYPE_23</source>
|
<source>ENTITY_TYPE_23</source>
|
||||||
<translation>QPOLYEDRE</translation>
|
<translation>POLYEDRE</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ENTITY_TYPE_24</source>
|
<source>ENTITY_TYPE_24</source>
|
||||||
|
<translation>QPOLYEDRE</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ENTITY_TYPE_25</source>
|
||||||
<translation>BALL</translation>
|
<translation>BALL</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
|
@ -39,6 +39,10 @@
|
|||||||
<source>CGNS_FILES_FILTER</source>
|
<source>CGNS_FILES_FILTER</source>
|
||||||
<translation>Fichiers CGNS</translation>
|
<translation>Fichiers CGNS</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>CGNS_EXPORT_ELEMS_BY_TYPE</source>
|
||||||
|
<translation>Groupe les éléments par type</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GMF_ASCII_FILES_FILTER</source>
|
<source>GMF_ASCII_FILES_FILTER</source>
|
||||||
<translation>Fichiers GMF ASCII</translation>
|
<translation>Fichiers GMF ASCII</translation>
|
||||||
@ -384,6 +388,22 @@
|
|||||||
<source>MEN_DEL_GROUP</source>
|
<source>MEN_DEL_GROUP</source>
|
||||||
<translation>Supprimer les groupes et leur contenu</translation>
|
<translation>Supprimer les groupes et leur contenu</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_ADD_TO_GROUP</source>
|
||||||
|
<translation>Ajoute dans le groupe</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_REMOVE_FROM_GROUP</source>
|
||||||
|
<translation>Supprime du groupe</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_ADD_TO_GROUP</source>
|
||||||
|
<translation>Ajoute dans le groupe les éléments sélectionnés</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_REMOVE_FROM_GROUP</source>
|
||||||
|
<translation>Supprime du groupe les éléments sélectionnés</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_FACE_ORIENTATION</source>
|
<source>MEN_FACE_ORIENTATION</source>
|
||||||
<translation>Orientation des faces</translation>
|
<translation>Orientation des faces</translation>
|
||||||
@ -872,6 +892,10 @@
|
|||||||
<source>MEN_QUADRATIC_PENTAHEDRON</source>
|
<source>MEN_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>Pentaèdre quadratique</translation>
|
<translation>Pentaèdre quadratique</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>Pentaèdre biquadratique</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_QUADRATIC_PYRAMID</source>
|
<source>MEN_QUADRATIC_PYRAMID</source>
|
||||||
<translation>Pyramide quadratique</translation>
|
<translation>Pyramide quadratique</translation>
|
||||||
@ -1350,6 +1374,10 @@ Merci de les corriger, puis essayez de nouveau</translation>
|
|||||||
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON_TITLE</source>
|
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON_TITLE</source>
|
||||||
<translation>Ajouter un pentaèdre quadratique</translation>
|
<translation>Ajouter un pentaèdre quadratique</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_ADD_BIQUADRATIC_PENTAHEDRON_TITLE</source>
|
||||||
|
<translation>Ajouter un pentaèdre biquadratique</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ADD_QUADRATIC_PYRAMID_TITLE</source>
|
<source>SMESH_ADD_QUADRATIC_PYRAMID_TITLE</source>
|
||||||
<translation>Ajouter une pyramide quadratique</translation>
|
<translation>Ajouter une pyramide quadratique</translation>
|
||||||
@ -2503,10 +2531,18 @@ Référez-vous à la documentation sur l'algorithme et la géométrie suppo
|
|||||||
<source>SMESH_QUADRATIC_PENTAHEDRON</source>
|
<source>SMESH_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>Pentaèdre quadratique</translation>
|
<translation>Pentaèdre quadratique</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>Pentaèdre biquadratique</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_QUADRATIC_PENTAHEDRONS</source>
|
<source>SMESH_QUADRATIC_PENTAHEDRONS</source>
|
||||||
<translation>Pentaèdres quadratiques</translation>
|
<translation>Pentaèdres quadratiques</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_BIQUADRATIC_PENTAHEDRONS</source>
|
||||||
|
<translation>Pentaèdres biquadratiques</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_QUADRATIC_PYRAMID</source>
|
<source>SMESH_QUADRATIC_PYRAMID</source>
|
||||||
<translation>Pyramide quadratique</translation>
|
<translation>Pyramide quadratique</translation>
|
||||||
@ -3360,6 +3396,10 @@ Utilisez le menu "Visualiser une entité" pour les afficher.
|
|||||||
<source>STB_QUADRATIC_PENTAHEDRON</source>
|
<source>STB_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>Pentaèdre quadratique</translation>
|
<translation>Pentaèdre quadratique</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>Pentaèdre biquadratique</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_QUADRATIC_PYRAMID</source>
|
<source>STB_QUADRATIC_PYRAMID</source>
|
||||||
<translation>Pyramide quadratique</translation>
|
<translation>Pyramide quadratique</translation>
|
||||||
@ -4036,6 +4076,10 @@ Utilisez le menu "Visualiser une entité" pour les afficher.
|
|||||||
<source>TOP_QUADRATIC_PENTAHEDRON</source>
|
<source>TOP_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>Pentaèdre quadratique</translation>
|
<translation>Pentaèdre quadratique</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>Pentaèdre biquadratique</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_QUADRATIC_PYRAMID</source>
|
<source>TOP_QUADRATIC_PYRAMID</source>
|
||||||
<translation>Pyramide quadratique</translation>
|
<translation>Pyramide quadratique</translation>
|
||||||
@ -4873,6 +4917,10 @@ Ouvrez une fenêtre VTK et essayez de nouveau</translation>
|
|||||||
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON</source>
|
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>Ajouter un pentaèdre quadratique</translation>
|
<translation>Ajouter un pentaèdre quadratique</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_ADD_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>Ajouter un pentaèdre biquadratique</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ADD_QUADRATIC_PYRAMID</source>
|
<source>SMESH_ADD_QUADRATIC_PYRAMID</source>
|
||||||
<translation>Ajouter une pyramide quadratique</translation>
|
<translation>Ajouter une pyramide quadratique</translation>
|
||||||
@ -5302,6 +5350,10 @@ Choisissez un groupe et essayez de nouveau</translation>
|
|||||||
<source>SEPARATE_CORNERS_AND_MEDIUM</source>
|
<source>SEPARATE_CORNERS_AND_MEDIUM</source>
|
||||||
<translation>Pas de fusion du coin et des noeuds moyens des cellules quadratiques</translation>
|
<translation>Pas de fusion du coin et des noeuds moyens des cellules quadratiques</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AVOID_MAKING_HOLES</source>
|
||||||
|
<translation>Evite de créer des trous</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>KEEP_NODES</source>
|
<source>KEEP_NODES</source>
|
||||||
<translation>Les noeuds à conserver pendant la fusion</translation>
|
<translation>Les noeuds à conserver pendant la fusion</translation>
|
||||||
@ -6001,18 +6053,22 @@ Entrez une valeur correcte et essayez de nouveau</translation>
|
|||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ENTITY_TYPE_21</source>
|
<source>ENTITY_TYPE_21</source>
|
||||||
<translation>OCTA12</translation>
|
<translation>PENTA18</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ENTITY_TYPE_22</source>
|
<source>ENTITY_TYPE_22</source>
|
||||||
<translation>POLYEDRE</translation>
|
<translation>OCTA12</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ENTITY_TYPE_23</source>
|
<source>ENTITY_TYPE_23</source>
|
||||||
<translation>QPOLYEDRE</translation>
|
<translation>POLYEDRE</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>ENTITY_TYPE_24</source>
|
<source>ENTITY_TYPE_24</source>
|
||||||
|
<translation>QPOLYEDRE</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ENTITY_TYPE_25</source>
|
||||||
<translation>BALL</translation>
|
<translation>BALL</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
@ -6972,6 +7028,14 @@ Il y a trop peu de points dans le fichier </translation>
|
|||||||
<source>SMESH_CREATE_GROUP_FROM_GEOM</source>
|
<source>SMESH_CREATE_GROUP_FROM_GEOM</source>
|
||||||
<translation>Créer des groupes à partir de la géométrie</translation>
|
<translation>Créer des groupes à partir de la géométrie</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ELEMENTS</source>
|
||||||
|
<translation>Eléments</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ELEMENTS_TOOLTIP</source>
|
||||||
|
<translation>Pas d'éléments 0D</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SMESHGUI_MeshOrderDlg</name>
|
<name>SMESHGUI_MeshOrderDlg</name>
|
||||||
@ -7402,6 +7466,10 @@ en raison de leurs types incompatibles:
|
|||||||
<source>ELEM_MODE</source>
|
<source>ELEM_MODE</source>
|
||||||
<translation>Elément</translation>
|
<translation>Elément</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SHOW_IDS</source>
|
||||||
|
<translation>Montre les IDs</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>BUT_DUMP_MESH</source>
|
<source>BUT_DUMP_MESH</source>
|
||||||
<translation>&Dump</translation>
|
<translation>&Dump</translation>
|
||||||
|
@ -39,6 +39,10 @@
|
|||||||
<source>CGNS_FILES_FILTER</source>
|
<source>CGNS_FILES_FILTER</source>
|
||||||
<translation>CGNS ファイル</translation>
|
<translation>CGNS ファイル</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>CGNS_EXPORT_ELEMS_BY_TYPE</source>
|
||||||
|
<translation>タイプで要素をグループ化</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GMF_ASCII_FILES_FILTER</source>
|
<source>GMF_ASCII_FILES_FILTER</source>
|
||||||
<translation>GMFアスキーファイル</translation>
|
<translation>GMFアスキーファイル</translation>
|
||||||
@ -383,6 +387,22 @@
|
|||||||
<source>MEN_DEL_GROUP</source>
|
<source>MEN_DEL_GROUP</source>
|
||||||
<translation>グループとその内容を削除します。</translation>
|
<translation>グループとその内容を削除します。</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_ADD_TO_GROUP</source>
|
||||||
|
<translation>グループに追加</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_REMOVE_FROM_GROUP</source>
|
||||||
|
<translation>グループから削除</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_ADD_TO_GROUP</source>
|
||||||
|
<translation>選択要素をグループに追加</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_REMOVE_FROM_GROUP</source>
|
||||||
|
<translation>選択要素をグループから削除</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_FACE_ORIENTATION</source>
|
<source>MEN_FACE_ORIENTATION</source>
|
||||||
<translation>フェースの向き</translation>
|
<translation>フェースの向き</translation>
|
||||||
@ -871,6 +891,10 @@
|
|||||||
<source>MEN_QUADRATIC_PENTAHEDRON</source>
|
<source>MEN_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>二次ウェッジ</translation>
|
<translation>二次ウェッジ</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>MEN_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>4次五面体</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>MEN_QUADRATIC_PYRAMID</source>
|
<source>MEN_QUADRATIC_PYRAMID</source>
|
||||||
<translation>四角錐</translation>
|
<translation>四角錐</translation>
|
||||||
@ -1343,6 +1367,10 @@
|
|||||||
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON_TITLE</source>
|
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON_TITLE</source>
|
||||||
<translation>二次くさびを追加します。</translation>
|
<translation>二次くさびを追加します。</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_ADD_BIQUADRATIC_PENTAHEDRON_TITLE</source>
|
||||||
|
<translation>4次五面体の追加</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ADD_QUADRATIC_PYRAMID_TITLE</source>
|
<source>SMESH_ADD_QUADRATIC_PYRAMID_TITLE</source>
|
||||||
<translation>四角錐を追加します。</translation>
|
<translation>四角錐を追加します。</translation>
|
||||||
@ -2475,10 +2503,18 @@
|
|||||||
<source>SMESH_QUADRATIC_PENTAHEDRON</source>
|
<source>SMESH_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>二次ウェッジ</translation>
|
<translation>二次ウェッジ</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>4次五面体</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_QUADRATIC_PENTAHEDRONS</source>
|
<source>SMESH_QUADRATIC_PENTAHEDRONS</source>
|
||||||
<translation>二次ウェッジ</translation>
|
<translation>二次ウェッジ</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_BIQUADRATIC_PENTAHEDRONS</source>
|
||||||
|
<translation>4次五面体</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_QUADRATIC_PYRAMID</source>
|
<source>SMESH_QUADRATIC_PYRAMID</source>
|
||||||
<translation>四角錐</translation>
|
<translation>四角錐</translation>
|
||||||
@ -3323,6 +3359,10 @@
|
|||||||
<source>STB_QUADRATIC_PENTAHEDRON</source>
|
<source>STB_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>二次ウェッジ</translation>
|
<translation>二次ウェッジ</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>STB_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>4次五面体</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>STB_QUADRATIC_PYRAMID</source>
|
<source>STB_QUADRATIC_PYRAMID</source>
|
||||||
<translation>四角錐</translation>
|
<translation>四角錐</translation>
|
||||||
@ -3999,6 +4039,10 @@
|
|||||||
<source>TOP_QUADRATIC_PENTAHEDRON</source>
|
<source>TOP_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>二次ウェッジ</translation>
|
<translation>二次ウェッジ</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>TOP_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>4次五面体</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>TOP_QUADRATIC_PYRAMID</source>
|
<source>TOP_QUADRATIC_PYRAMID</source>
|
||||||
<translation>四角錐</translation>
|
<translation>四角錐</translation>
|
||||||
@ -4827,6 +4871,10 @@
|
|||||||
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON</source>
|
<source>SMESH_ADD_QUADRATIC_PENTAHEDRON</source>
|
||||||
<translation>二次くさびを追加します。</translation>
|
<translation>二次くさびを追加します。</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_ADD_BIQUADRATIC_PENTAHEDRON</source>
|
||||||
|
<translation>4次五面体の追加</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_ADD_QUADRATIC_PYRAMID</source>
|
<source>SMESH_ADD_QUADRATIC_PYRAMID</source>
|
||||||
<translation>二次ピラミッドの追加</translation>
|
<translation>二次ピラミッドの追加</translation>
|
||||||
@ -5248,6 +5296,10 @@
|
|||||||
<source>SEPARATE_CORNERS_AND_MEDIUM</source>
|
<source>SEPARATE_CORNERS_AND_MEDIUM</source>
|
||||||
<translation>2次セルのコーナ節点と中間節点をマージできません</translation>
|
<translation>2次セルのコーナ節点と中間節点をマージできません</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>AVOID_MAKING_HOLES</source>
|
||||||
|
<translation>穴作成の回避</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>KEEP_NODES</source>
|
<source>KEEP_NODES</source>
|
||||||
<translation>維持節点</translation>
|
<translation>維持節点</translation>
|
||||||
@ -5943,6 +5995,10 @@
|
|||||||
<source>ENTITY_TYPE_24</source>
|
<source>ENTITY_TYPE_24</source>
|
||||||
<translation>ボール</translation>
|
<translation>ボール</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ENTITY_TYPE_25</source>
|
||||||
|
<translation>ボール</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>GEOM_TYPE</source>
|
<source>GEOM_TYPE</source>
|
||||||
<translation>ジオメトリの種類</translation>
|
<translation>ジオメトリの種類</translation>
|
||||||
@ -6870,6 +6926,14 @@
|
|||||||
<source>SMESH_CREATE_GROUP_FROM_GEOM</source>
|
<source>SMESH_CREATE_GROUP_FROM_GEOM</source>
|
||||||
<translation>ジオメトリからグループを作成</translation>
|
<translation>ジオメトリからグループを作成</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ELEMENTS</source>
|
||||||
|
<translation>要素</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>ELEMENTS_TOOLTIP</source>
|
||||||
|
<translation>0D要素がない</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>SMESHGUI_MeshOrderDlg</name>
|
<name>SMESHGUI_MeshOrderDlg</name>
|
||||||
@ -7298,6 +7362,10 @@
|
|||||||
<source>ELEM_MODE</source>
|
<source>ELEM_MODE</source>
|
||||||
<translation>要素</translation>
|
<translation>要素</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SHOW_IDS</source>
|
||||||
|
<translation>IDの表示</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>BUT_DUMP_MESH</source>
|
<source>BUT_DUMP_MESH</source>
|
||||||
<translation>書き出し(&D)</translation>
|
<translation>書き出し(&D)</translation>
|
||||||
|
@ -47,7 +47,7 @@ SET(_link_LIBRARIES
|
|||||||
${CAS_TKMesh}
|
${CAS_TKMesh}
|
||||||
${Boost_LIBRARIES}
|
${Boost_LIBRARIES}
|
||||||
SMDS
|
SMDS
|
||||||
)
|
)
|
||||||
|
|
||||||
# --- headers ---
|
# --- headers ---
|
||||||
|
|
||||||
@ -68,7 +68,7 @@ SET(SMESHUtils_HEADERS
|
|||||||
SMESH_MAT2d.hxx
|
SMESH_MAT2d.hxx
|
||||||
SMESH_ControlPnt.hxx
|
SMESH_ControlPnt.hxx
|
||||||
SMESH_Delaunay.hxx
|
SMESH_Delaunay.hxx
|
||||||
)
|
)
|
||||||
|
|
||||||
# --- sources ---
|
# --- sources ---
|
||||||
|
|
||||||
@ -86,6 +86,7 @@ SET(SMESHUtils_SOURCES
|
|||||||
SMESH_ControlPnt.cxx
|
SMESH_ControlPnt.cxx
|
||||||
SMESH_DeMerge.cxx
|
SMESH_DeMerge.cxx
|
||||||
SMESH_Delaunay.cxx
|
SMESH_Delaunay.cxx
|
||||||
|
SMESH_FillHole.cxx
|
||||||
)
|
)
|
||||||
|
|
||||||
# --- rules ---
|
# --- rules ---
|
||||||
|
517
src/SMESHUtils/SMESH_FillHole.cxx
Normal file
517
src/SMESHUtils/SMESH_FillHole.cxx
Normal file
@ -0,0 +1,517 @@
|
|||||||
|
// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
|
||||||
|
//
|
||||||
|
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
|
||||||
|
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
|
||||||
|
//
|
||||||
|
// This library is free software; you can redistribute it and/or
|
||||||
|
// modify it under the terms of the GNU Lesser General Public
|
||||||
|
// License as published by the Free Software Foundation; either
|
||||||
|
// version 2.1 of the License, or (at your option) any later version.
|
||||||
|
//
|
||||||
|
// This library is distributed in the hope that it will be useful,
|
||||||
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
// Lesser General Public License for more details.
|
||||||
|
//
|
||||||
|
// You should have received a copy of the GNU Lesser General Public
|
||||||
|
// License along with this library; if not, write to the Free Software
|
||||||
|
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
//
|
||||||
|
// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
|
||||||
|
//
|
||||||
|
// File : SMESH_FillHole.cxx
|
||||||
|
// Created : Tue Sep 26 15:11:17 2017
|
||||||
|
// Author : Edward AGAPOV (eap)
|
||||||
|
//
|
||||||
|
|
||||||
|
#include "SMESH_MeshAlgos.hxx"
|
||||||
|
|
||||||
|
#include "SMESH_Comment.hxx"
|
||||||
|
|
||||||
|
#include "SMESH_TypeDefs.hxx"
|
||||||
|
#include "SMDS_Mesh.hxx"
|
||||||
|
|
||||||
|
#include <Utils_SALOME_Exception.hxx>
|
||||||
|
|
||||||
|
#include <boost/intrusive/circular_list_algorithms.hpp>
|
||||||
|
#include <boost/container/flat_map.hpp>
|
||||||
|
|
||||||
|
#include <Bnd_B3d.hxx>
|
||||||
|
|
||||||
|
namespace
|
||||||
|
{
|
||||||
|
bool isSmallAngle( double cos2 )
|
||||||
|
{
|
||||||
|
// cosine of min angle at which adjacent faces are considered overlapping
|
||||||
|
const double theMinCos2 = 0.996 * 0.996; // ~5 degrees
|
||||||
|
return ( cos2 > theMinCos2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
struct BEdge;
|
||||||
|
typedef std::multimap< double, BEdge* > TAngleMap;
|
||||||
|
typedef std::map< const SMDS_MeshElement*, int > TFaceIndMap;
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------------
|
||||||
|
/*!
|
||||||
|
* \brief Edge of a free border
|
||||||
|
*/
|
||||||
|
struct BEdge
|
||||||
|
{
|
||||||
|
const SMDS_MeshNode* myNode1;
|
||||||
|
const SMDS_MeshNode* myNode2;
|
||||||
|
const SMDS_MeshElement* myFace; // face adjacent to the border
|
||||||
|
|
||||||
|
gp_XYZ myFaceNorm;
|
||||||
|
gp_XYZ myDir; // myNode1 -> myNode2
|
||||||
|
double myDirCoef; // 1. or -1, to make myDir oriented as myNodes in myFace
|
||||||
|
double myLength; // between nodes
|
||||||
|
double myAngleWithPrev; // between myDir and -myPrev->myDir
|
||||||
|
double myMinMaxRatio; // of a possible triangle sides
|
||||||
|
TAngleMap::iterator myAngleMapPos;
|
||||||
|
double myOverlapAngle; // angle delta due to overlapping
|
||||||
|
const SMDS_MeshNode* myNode1Shift; // nodes created to avoid overlapping of faces
|
||||||
|
const SMDS_MeshNode* myNode2Shift;
|
||||||
|
|
||||||
|
BEdge* myPrev; // neighbors in the border
|
||||||
|
BEdge* myNext;
|
||||||
|
|
||||||
|
BEdge(): myNode1Shift(0), myNode2Shift(0) {}
|
||||||
|
void Init( const SMDS_MeshNode* n1, const SMDS_MeshNode* n2,
|
||||||
|
const SMDS_MeshElement* f=0,
|
||||||
|
const SMDS_MeshNode* nf1=0, const SMDS_MeshNode* nf2=0 );
|
||||||
|
void ComputeAngle( bool reverseAngle = false );
|
||||||
|
void ShiftOverlapped( const SMDS_MeshNode* oppNode,
|
||||||
|
const TFaceIndMap& capFaceWithBordInd,
|
||||||
|
SMDS_Mesh& mesh,
|
||||||
|
std::vector<const SMDS_MeshElement*>& newFaces);
|
||||||
|
void MakeShiftfFaces( SMDS_Mesh& mesh,
|
||||||
|
std::vector<const SMDS_MeshElement*>& newFaces,
|
||||||
|
const bool isReverse );
|
||||||
|
gp_XYZ GetInFaceDir() const { return myFaceNorm ^ myDir * myDirCoef; }
|
||||||
|
double ShapeFactor() const { return 0.5 * ( 1. - myMinMaxRatio ); }
|
||||||
|
void InsertSelf(TAngleMap& edgesByAngle, bool isReverseFaces, bool reBind, bool useOverlap )
|
||||||
|
{
|
||||||
|
if ( reBind ) edgesByAngle.erase( myAngleMapPos );
|
||||||
|
double key = (( isReverseFaces ? 2 * M_PI - myAngleWithPrev : myAngleWithPrev )
|
||||||
|
+ myOverlapAngle * useOverlap
|
||||||
|
+ ShapeFactor() );
|
||||||
|
myAngleMapPos = edgesByAngle.insert( std::make_pair( key, this ));
|
||||||
|
}
|
||||||
|
|
||||||
|
// traits used by boost::intrusive::circular_list_algorithms
|
||||||
|
typedef BEdge node;
|
||||||
|
typedef BEdge * node_ptr;
|
||||||
|
typedef const BEdge * const_node_ptr;
|
||||||
|
static node_ptr get_next(const_node_ptr n) { return n->myNext; }
|
||||||
|
static void set_next(node_ptr n, node_ptr next) { n->myNext = next; }
|
||||||
|
static node_ptr get_previous(const_node_ptr n) { return n->myPrev; }
|
||||||
|
static void set_previous(node_ptr n, node_ptr prev){ n->myPrev = prev; }
|
||||||
|
};
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Initialize a border edge data
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void BEdge::Init( const SMDS_MeshNode* n1,
|
||||||
|
const SMDS_MeshNode* n2,
|
||||||
|
const SMDS_MeshElement* newFace, // new cap face
|
||||||
|
const SMDS_MeshNode* nf1,
|
||||||
|
const SMDS_MeshNode* nf2 )
|
||||||
|
{
|
||||||
|
myNode1 = n1;
|
||||||
|
myNode2 = n2;
|
||||||
|
myDir = SMESH_NodeXYZ( n2 ) - SMESH_NodeXYZ( n1 );
|
||||||
|
myLength = myDir.Modulus();
|
||||||
|
if ( myLength > std::numeric_limits<double>::min() )
|
||||||
|
myDir /= myLength;
|
||||||
|
|
||||||
|
myFace = newFace;
|
||||||
|
if ( !myFace )
|
||||||
|
{
|
||||||
|
TIDSortedElemSet elemSet, avoidSet;
|
||||||
|
int ind1, ind2;
|
||||||
|
myFace = SMESH_MeshAlgos::FindFaceInSet( n1, n2, elemSet, avoidSet, &ind1, &ind2 );
|
||||||
|
if ( !myFace )
|
||||||
|
throw SALOME_Exception( SMESH_Comment("No face sharing nodes #")
|
||||||
|
<< myNode1->GetID() << " and #" << myNode2->GetID());
|
||||||
|
avoidSet.insert( myFace );
|
||||||
|
if ( SMESH_MeshAlgos::FindFaceInSet( n1, n2, elemSet, avoidSet ))
|
||||||
|
throw SALOME_Exception( SMESH_Comment("No free border between nodes #")
|
||||||
|
<< myNode1->GetID() << " and #" << myNode2->GetID());
|
||||||
|
|
||||||
|
myDirCoef = SMESH_MeshAlgos::IsRightOrder( myFace, myNode1, myNode2 ) ? 1. : -1.;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (! SMESH_MeshAlgos::FaceNormal( myFace, myFaceNorm, /*normalized=*/false ))
|
||||||
|
{
|
||||||
|
SMDS_ElemIteratorPtr fIt = myNode1->GetInverseElementIterator( SMDSAbs_Face );
|
||||||
|
while ( fIt->more() )
|
||||||
|
if ( SMESH_MeshAlgos::FaceNormal( fIt->next(), myFaceNorm, /*normalized=*/false ))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( newFace )
|
||||||
|
{
|
||||||
|
myFace = 0;
|
||||||
|
myDirCoef = SMESH_MeshAlgos::IsRightOrder( newFace, nf1, nf2 ) ? 1. : -1.;
|
||||||
|
if ( myPrev->myNode2 == n1 )
|
||||||
|
myNode1Shift = myPrev->myNode2Shift;
|
||||||
|
if ( myNext->myNode1 == n2 )
|
||||||
|
myNode2Shift = myNext->myNode1Shift;
|
||||||
|
}
|
||||||
|
else if ( myDirCoef * myPrev->myDirCoef < 0 ) // different orientation of faces
|
||||||
|
{
|
||||||
|
myFaceNorm *= -1;
|
||||||
|
myDirCoef *= -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Compute myAngleWithPrev
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void BEdge::ComputeAngle( bool theReverseAngle )
|
||||||
|
{
|
||||||
|
double dot = myDir.Dot( myPrev->myDir.Reversed() );
|
||||||
|
if ( dot >= 1 ) myAngleWithPrev = 0;
|
||||||
|
else if ( dot <= -1 ) myAngleWithPrev = M_PI;
|
||||||
|
else myAngleWithPrev = acos( dot );
|
||||||
|
|
||||||
|
bool isObtuse;
|
||||||
|
gp_XYZ inFaceDirNew = myDir - myPrev->myDir;
|
||||||
|
gp_XYZ inFaceDir1 = myPrev->GetInFaceDir();
|
||||||
|
gp_XYZ inFaceDir2 = this->GetInFaceDir();
|
||||||
|
double dot1 = inFaceDirNew * inFaceDir1;
|
||||||
|
double dot2 = inFaceDirNew * inFaceDir2;
|
||||||
|
bool isOverlap1 = ( dot1 > 0 );
|
||||||
|
bool isOverlap2 = ( dot2 > 0 );
|
||||||
|
if ( !myPrev->myFace )
|
||||||
|
isObtuse = isOverlap1;
|
||||||
|
else if ( !myFace )
|
||||||
|
isObtuse = isOverlap2;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
double dt1 = myDir.Dot( myPrev->myFaceNorm );
|
||||||
|
double dt2 = myPrev->myDir.Dot( myFaceNorm );
|
||||||
|
isObtuse = ( dt1 > 0 || dt2 < 0 ); // suppose face normals point outside the border
|
||||||
|
if ( theReverseAngle )
|
||||||
|
isObtuse = !isObtuse;
|
||||||
|
}
|
||||||
|
if ( isObtuse )
|
||||||
|
{
|
||||||
|
myAngleWithPrev = 2 * M_PI - myAngleWithPrev;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if ( ! isObtuse )
|
||||||
|
// isObtuse =
|
||||||
|
// isSmallAngle( 1 - myDir.CrossSquareMagnitude( myPrev->myDir )); // edges co-directed
|
||||||
|
|
||||||
|
myOverlapAngle = 0;
|
||||||
|
//if ( !isObtuse )
|
||||||
|
{
|
||||||
|
// check if myFace and a triangle built on this and prev edges overlap
|
||||||
|
if ( isOverlap1 )
|
||||||
|
{
|
||||||
|
double cos2 = dot1 * dot1 / inFaceDirNew.SquareModulus() / inFaceDir1.SquareModulus();
|
||||||
|
myOverlapAngle += 1. * M_PI * cos2;
|
||||||
|
}
|
||||||
|
if ( isOverlap2 )
|
||||||
|
{
|
||||||
|
double cos2 = dot2 * dot2 / inFaceDirNew.SquareModulus() / inFaceDir2.SquareModulus();
|
||||||
|
myOverlapAngle += 1. * M_PI * cos2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{
|
||||||
|
double len3 = SMESH_NodeXYZ( myPrev->myNode1 ).Distance( myNode2 );
|
||||||
|
double minLen = Min( myLength, Min( myPrev->myLength, len3 ));
|
||||||
|
double maxLen = Max( myLength, Max( myPrev->myLength, len3 ));
|
||||||
|
myMinMaxRatio = minLen / maxLen;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Check if myFace is overlapped by a triangle formed by myNode's and a
|
||||||
|
* given node. If so, create shifted nodes to avoid overlapping
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void BEdge::ShiftOverlapped( const SMDS_MeshNode* theOppNode,
|
||||||
|
const TFaceIndMap& theCapFaceWithBordInd,
|
||||||
|
SMDS_Mesh& theMesh,
|
||||||
|
std::vector<const SMDS_MeshElement*>& theNewFaces )
|
||||||
|
{
|
||||||
|
if ( myNode1Shift && myNode2Shift )
|
||||||
|
return;
|
||||||
|
|
||||||
|
gp_XYZ inNewFaceDir = SMESH_NodeXYZ( theOppNode ) - SMESH_NodeXYZ( myNode1 );
|
||||||
|
double dot = inNewFaceDir.Dot( myFaceNorm );
|
||||||
|
double cos2 = dot * dot / myFaceNorm.SquareModulus() / inNewFaceDir.SquareModulus();
|
||||||
|
bool isOverlap = ( isSmallAngle( 1 - cos2 ) && GetInFaceDir() * inNewFaceDir > 0 );
|
||||||
|
|
||||||
|
if ( isOverlap )
|
||||||
|
{
|
||||||
|
gp_XYZ shift = myFaceNorm / myLength / 4;
|
||||||
|
if ( myFace )
|
||||||
|
shift.Reverse();
|
||||||
|
if ( !myNode1Shift )
|
||||||
|
{
|
||||||
|
gp_XYZ p = SMESH_NodeXYZ( myNode1 ) + shift;
|
||||||
|
myNode1Shift = theMesh.AddNode( p.X(), p.Y(), p.Z() );
|
||||||
|
myPrev->myNode2Shift = myNode1Shift;
|
||||||
|
}
|
||||||
|
if ( !myNode2Shift )
|
||||||
|
{
|
||||||
|
gp_XYZ p = SMESH_NodeXYZ( myNode2 ) + shift;
|
||||||
|
myNode2Shift = theMesh.AddNode( p.X(), p.Y(), p.Z() );
|
||||||
|
myNext->myNode1Shift = myNode2Shift;
|
||||||
|
}
|
||||||
|
|
||||||
|
// MakeShiftfFaces() for already created cap faces
|
||||||
|
for ( int is2nd = 0; is2nd < 2; ++is2nd )
|
||||||
|
{
|
||||||
|
const SMDS_MeshNode* ns = is2nd ? myNode2Shift : myNode1Shift;
|
||||||
|
const SMDS_MeshNode* n = is2nd ? myNode2 : myNode1;
|
||||||
|
if ( !ns ) continue;
|
||||||
|
|
||||||
|
SMDS_ElemIteratorPtr fIt = n->GetInverseElementIterator( SMDSAbs_Face );
|
||||||
|
while ( fIt->more() )
|
||||||
|
{
|
||||||
|
const SMDS_MeshElement* f = fIt->next();
|
||||||
|
if ( !f->isMarked() ) continue;
|
||||||
|
|
||||||
|
TFaceIndMap::const_iterator f2i = theCapFaceWithBordInd.find( f );
|
||||||
|
if ( f2i == theCapFaceWithBordInd.end() )
|
||||||
|
continue;
|
||||||
|
const SMDS_MeshNode* nf1 = f->GetNode( f2i->second );
|
||||||
|
const SMDS_MeshNode* nf2 = f->GetNode(( f2i->second+1 ) % f->NbNodes() );
|
||||||
|
if ( nf1 == n || nf2 == n )
|
||||||
|
{
|
||||||
|
BEdge tmpE;
|
||||||
|
tmpE.myPrev = tmpE.myNext = this;
|
||||||
|
tmpE.Init( nf1, nf2, f, nf1, nf2 );
|
||||||
|
if ( !tmpE.myNode1Shift && !tmpE.myNode2Shift )
|
||||||
|
tmpE.Init( nf2, nf1, f, nf2, nf1 );
|
||||||
|
tmpE.myFace = f;
|
||||||
|
tmpE.MakeShiftfFaces( theMesh, theNewFaces, tmpE.myDirCoef < 0 );
|
||||||
|
}
|
||||||
|
std::vector< const SMDS_MeshNode* > nodes( f->begin_nodes(), f->end_nodes() );
|
||||||
|
nodes[ f->GetNodeIndex( n ) ] = ns;
|
||||||
|
theMesh.ChangeElementNodes( f, &nodes[0], nodes.size() );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Create a triangle
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
const SMDS_MeshElement* MakeTria( SMDS_Mesh& mesh,
|
||||||
|
const SMDS_MeshNode* n1,
|
||||||
|
const SMDS_MeshNode* n2,
|
||||||
|
const SMDS_MeshNode* n3,
|
||||||
|
const bool isReverse )
|
||||||
|
{
|
||||||
|
if ( isReverse )
|
||||||
|
return mesh.AddFace( n1, n3, n2 );
|
||||||
|
return mesh.AddFace( n1, n2, n3 );
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Create a quadrangle
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
// const SMDS_MeshElement* MakeQuad( SMDS_Mesh& mesh,
|
||||||
|
// const SMDS_MeshNode* n1,
|
||||||
|
// const SMDS_MeshNode* n2,
|
||||||
|
// const SMDS_MeshNode* n3,
|
||||||
|
// const SMDS_MeshNode* n4,
|
||||||
|
// const bool isReverse )
|
||||||
|
// {
|
||||||
|
// if ( isReverse )
|
||||||
|
// return mesh.AddFace( n4, n3, n2, n1 );
|
||||||
|
// return mesh.AddFace( n1, n2, n3, n4 );
|
||||||
|
// }
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Create faces on myNode* and myNode*Shift
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void BEdge::MakeShiftfFaces(SMDS_Mesh& mesh,
|
||||||
|
std::vector<const SMDS_MeshElement*>& newFaces,
|
||||||
|
const bool isReverse )
|
||||||
|
{
|
||||||
|
if ( !myFace )
|
||||||
|
return;
|
||||||
|
if ( myNode1Shift && myNode2Shift )
|
||||||
|
{
|
||||||
|
newFaces.push_back( MakeTria( mesh, myNode1, myNode2, myNode2Shift, isReverse ));
|
||||||
|
newFaces.push_back( MakeTria( mesh, myNode1, myNode2Shift, myNode1Shift, isReverse ));
|
||||||
|
}
|
||||||
|
else if ( myNode1Shift )
|
||||||
|
{
|
||||||
|
newFaces.push_back( MakeTria( mesh, myNode1, myNode2, myNode1Shift, isReverse ));
|
||||||
|
}
|
||||||
|
else if ( myNode2Shift )
|
||||||
|
{
|
||||||
|
newFaces.push_back( MakeTria( mesh, myNode1, myNode2, myNode2Shift, isReverse ));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Fill with 2D elements a hole defined by a TFreeBorder
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void SMESH_MeshAlgos::FillHole(const SMESH_MeshAlgos::TFreeBorder & theFreeBorder,
|
||||||
|
SMDS_Mesh& theMesh,
|
||||||
|
std::vector<const SMDS_MeshElement*>& theNewFaces)
|
||||||
|
{
|
||||||
|
if ( theFreeBorder.size() < 4 || // at least 3 nodes
|
||||||
|
theFreeBorder[0] != theFreeBorder.back() ) // the hole must be closed
|
||||||
|
return;
|
||||||
|
|
||||||
|
// prepare data of the border
|
||||||
|
|
||||||
|
ObjectPool< BEdge > edgeAllocator;
|
||||||
|
boost::intrusive::circular_list_algorithms< BEdge > circularList;
|
||||||
|
BEdge* edge;
|
||||||
|
BEdge* edge0 = edgeAllocator.getNew();
|
||||||
|
BEdge* edgePrev = edge0;
|
||||||
|
circularList.init_header( edge0 );
|
||||||
|
edge0->Init( theFreeBorder[0], theFreeBorder[1], 0 );
|
||||||
|
Bnd_B3d box;
|
||||||
|
box.Add( SMESH_NodeXYZ( edge0->myNode1 ));
|
||||||
|
for ( size_t i = 2; i < theFreeBorder.size(); ++i )
|
||||||
|
{
|
||||||
|
edge = edgeAllocator.getNew();
|
||||||
|
circularList.link_after( edgePrev, edge );
|
||||||
|
edge->Init( theFreeBorder[i-1], theFreeBorder[i] );
|
||||||
|
edge->ComputeAngle();
|
||||||
|
edgePrev = edge;
|
||||||
|
box.Add( SMESH_NodeXYZ( edge->myNode1 ));
|
||||||
|
}
|
||||||
|
edge0->ComputeAngle();
|
||||||
|
|
||||||
|
// check if face normals point outside the border
|
||||||
|
|
||||||
|
gp_XYZ hSize = 0.5 * ( box.CornerMax() - box.CornerMin() );
|
||||||
|
const double hDelta = 1e-6 * hSize.Modulus();
|
||||||
|
hSize -= gp_XYZ( hDelta, hDelta, hDelta );
|
||||||
|
if ( hSize.X() < 0 ) hSize.SetX(hDelta);
|
||||||
|
if ( hSize.Y() < 0 ) hSize.SetY(hDelta);
|
||||||
|
if ( hSize.Z() < 0 ) hSize.SetZ(hDelta);
|
||||||
|
box.SetHSize( hSize ); // decrease the box by hDelta
|
||||||
|
|
||||||
|
size_t nbEdges = theFreeBorder.size() - 1;
|
||||||
|
edge = edge0;
|
||||||
|
int nbRev = 0, nbFrw = 0;
|
||||||
|
double angTol = M_PI - ( nbEdges - 2 ) * M_PI / nbEdges, sumDirCoeff = 0;
|
||||||
|
for ( size_t i = 0; i < nbEdges; ++i, edge = edge->myNext )
|
||||||
|
{
|
||||||
|
if ( box.IsOut( SMESH_NodeXYZ( edge->myNode1 )) &&
|
||||||
|
edge->myOverlapAngle < 0.1 * M_PI )
|
||||||
|
{
|
||||||
|
nbRev += edge->myAngleWithPrev > M_PI + angTol;
|
||||||
|
nbFrw += edge->myAngleWithPrev < M_PI - angTol;
|
||||||
|
}
|
||||||
|
sumDirCoeff += edge->myDirCoef;
|
||||||
|
|
||||||
|
// unmark all adjacent faces, new faces will be marked
|
||||||
|
SMDS_ElemIteratorPtr fIt = edge->myNode1->GetInverseElementIterator( SMDSAbs_Face );
|
||||||
|
while ( fIt->more() )
|
||||||
|
fIt->next()->setIsMarked( false );
|
||||||
|
}
|
||||||
|
bool isReverseAngle = ( nbRev > nbFrw ); // true == face normals point inside the border
|
||||||
|
//std::cout << "nbRev="<< nbRev << ", nbFrw="<< nbFrw<<std::endl;
|
||||||
|
|
||||||
|
// sort border edges by myAngleWithPrev
|
||||||
|
|
||||||
|
TAngleMap edgesByAngle;
|
||||||
|
bool useOverlap = true; // to add BEdge.myOverlapAngle when filling edgesByAngle
|
||||||
|
edge = edge0;
|
||||||
|
for ( size_t i = 0; i < nbEdges; ++i, edge = edge->myNext )
|
||||||
|
edge->InsertSelf( edgesByAngle, isReverseAngle, /*reBind=*/false, useOverlap );
|
||||||
|
|
||||||
|
// create triangles to fill the hole
|
||||||
|
|
||||||
|
//compare order of nodes in the edges with their order in faces
|
||||||
|
bool isReverse = sumDirCoeff > 0.5 * nbEdges;
|
||||||
|
|
||||||
|
// faces filling the hole (cap faces) and indices of border edges in them
|
||||||
|
TFaceIndMap capFaceWithBordInd;
|
||||||
|
|
||||||
|
theNewFaces.reserve( nbEdges - 2 );
|
||||||
|
std::vector< const SMDS_MeshNode* > nodes(3);
|
||||||
|
while ( edgesByAngle.size() > 2 )
|
||||||
|
{
|
||||||
|
TAngleMap::iterator a2e = edgesByAngle.begin();
|
||||||
|
edge = a2e->second;
|
||||||
|
if ( useOverlap &&
|
||||||
|
a2e->first - edge->ShapeFactor() > M_PI - angTol ) // all new triangles need shift
|
||||||
|
{
|
||||||
|
// re-sort the edges w/o overlap consideration
|
||||||
|
useOverlap = false;
|
||||||
|
nbEdges = edgesByAngle.size();
|
||||||
|
edgesByAngle.clear();
|
||||||
|
for ( size_t i = 0; i < nbEdges; ++i, edge = edge->myNext )
|
||||||
|
edge->InsertSelf( edgesByAngle, isReverseAngle, /*reBind=*/false, useOverlap );
|
||||||
|
a2e = edgesByAngle.begin();
|
||||||
|
}
|
||||||
|
edge = a2e->second;
|
||||||
|
edgePrev = edge->myPrev;
|
||||||
|
|
||||||
|
// create shift nodes and faces
|
||||||
|
edgePrev->ShiftOverlapped( edge->myNode2, capFaceWithBordInd, theMesh, theNewFaces );
|
||||||
|
edge->ShiftOverlapped( edgePrev->myNode1, capFaceWithBordInd, theMesh, theNewFaces );
|
||||||
|
edge ->MakeShiftfFaces( theMesh, theNewFaces, isReverse );
|
||||||
|
edgePrev->MakeShiftfFaces( theMesh, theNewFaces, isReverse );
|
||||||
|
|
||||||
|
// make a cap face
|
||||||
|
//nodes.resize( 3 );
|
||||||
|
nodes[0] = edgePrev->myNode1Shift ? edgePrev->myNode1Shift : edgePrev->myNode1;
|
||||||
|
nodes[1] = edgePrev->myNode2Shift ? edgePrev->myNode2Shift : edgePrev->myNode2;
|
||||||
|
nodes[2] = edge->myNode2Shift ? edge->myNode2Shift : edge->myNode2;
|
||||||
|
theNewFaces.push_back( MakeTria( theMesh, nodes[0], nodes[1], nodes[2], isReverse ));
|
||||||
|
// std::cout << nodes[1]->GetID() << " " << nodes[0]->GetID() << " " << nodes[2]->GetID()
|
||||||
|
// << " " << edge->myAngleWithPrev << std::endl;
|
||||||
|
|
||||||
|
// remember a border edge within the new cap face
|
||||||
|
theNewFaces.back()->setIsMarked( true );
|
||||||
|
if ( edgePrev->myFace )
|
||||||
|
capFaceWithBordInd.insert( std::make_pair( theNewFaces.back(), isReverse ? 2 : 0 ));
|
||||||
|
if ( edge->myFace )
|
||||||
|
capFaceWithBordInd.insert( std::make_pair( theNewFaces.back(), 1 ));
|
||||||
|
|
||||||
|
// remove edgePrev from the list and update <edge>
|
||||||
|
edgesByAngle.erase( edgePrev->myAngleMapPos );
|
||||||
|
circularList.unlink( edgePrev ); // remove edgePrev from the border
|
||||||
|
|
||||||
|
edge->Init( edgePrev->myNode1, edge->myNode2, theNewFaces.back(), nodes[0], nodes[2] );
|
||||||
|
edge->ComputeAngle( isReverseAngle );
|
||||||
|
edge->InsertSelf( edgesByAngle, /*isReverse=*/false, /*reBind=*/true, useOverlap );
|
||||||
|
edge->myNext->ComputeAngle( isReverseAngle );
|
||||||
|
edge->myNext->InsertSelf( edgesByAngle, /*isReverse=*/false, /*reBind=*/true, useOverlap );
|
||||||
|
// std::cout << "A " << edge->myNode1->GetID() << " " << edge->myAngleWithPrev
|
||||||
|
// << " " << edge->myNext->myNode1->GetID() << " " << edge->myNext->myAngleWithPrev
|
||||||
|
// << std::endl;
|
||||||
|
}
|
||||||
|
edge = edgesByAngle.begin()->second;
|
||||||
|
edge-> MakeShiftfFaces( theMesh, theNewFaces, isReverse );
|
||||||
|
edge->myNext->MakeShiftfFaces( theMesh, theNewFaces, isReverse );
|
||||||
|
}
|
@ -131,8 +131,11 @@ namespace
|
|||||||
if ( myID < 0 )
|
if ( myID < 0 )
|
||||||
{
|
{
|
||||||
myID = id;
|
myID = id;
|
||||||
if ( myNext )
|
|
||||||
myNext->SetID( id + 1 );
|
for ( BEdge* be = myNext; be && be->myID < 0; be = be->myNext )
|
||||||
|
{
|
||||||
|
be->myID = ++id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//================================================================================
|
//================================================================================
|
||||||
@ -821,3 +824,136 @@ void SMESH_MeshAlgos::FindCoincidentFreeBorders(SMDS_Mesh& mesh,
|
|||||||
|
|
||||||
} // SMESH_MeshAlgos::FindCoincidentFreeBorders()
|
} // SMESH_MeshAlgos::FindCoincidentFreeBorders()
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*
|
||||||
|
* Returns all TFreeBorder's. Optionally check if the mesh is manifold
|
||||||
|
* and if faces are correctly oriented.
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
void SMESH_MeshAlgos::FindFreeBorders(SMDS_Mesh& theMesh,
|
||||||
|
TFreeBorderVec & theFoundFreeBordes,
|
||||||
|
const bool theClosedOnly,
|
||||||
|
bool* theIsManifold,
|
||||||
|
bool* theIsGoodOri)
|
||||||
|
{
|
||||||
|
bool isManifold = true;
|
||||||
|
|
||||||
|
// find free links
|
||||||
|
typedef NCollection_DataMap<SMESH_TLink, const SMDS_MeshElement*, SMESH_TLink > TLink2FaceMap;
|
||||||
|
TLink2FaceMap linkMap;
|
||||||
|
int nbSharedLinks = 0;
|
||||||
|
SMDS_FaceIteratorPtr faceIt = theMesh.facesIterator();
|
||||||
|
while ( faceIt->more() )
|
||||||
|
{
|
||||||
|
const SMDS_MeshElement* face = faceIt->next();
|
||||||
|
if ( !face ) continue;
|
||||||
|
|
||||||
|
const SMDS_MeshNode* n0 = face->GetNode( face->NbNodes() - 1 );
|
||||||
|
SMDS_NodeIteratorPtr nodeIt = face->interlacedNodesIterator();
|
||||||
|
while ( nodeIt->more() )
|
||||||
|
{
|
||||||
|
const SMDS_MeshNode* n1 = nodeIt->next();
|
||||||
|
SMESH_TLink link( n0, n1 );
|
||||||
|
if ( const SMDS_MeshElement** faceInMap = linkMap.ChangeSeek( link ))
|
||||||
|
{
|
||||||
|
if ( *faceInMap )
|
||||||
|
{
|
||||||
|
if ( theIsGoodOri && *theIsGoodOri && !IsRightOrder( *faceInMap, n1, n0 ))
|
||||||
|
*theIsGoodOri = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
isManifold = false;
|
||||||
|
}
|
||||||
|
nbSharedLinks += bool( *faceInMap );
|
||||||
|
*faceInMap = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
linkMap.Bind( link, face );
|
||||||
|
}
|
||||||
|
n0 = n1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( theIsManifold )
|
||||||
|
*theIsManifold = isManifold;
|
||||||
|
|
||||||
|
if ( linkMap.Extent() == nbSharedLinks )
|
||||||
|
return;
|
||||||
|
|
||||||
|
// form free borders
|
||||||
|
std::set < BNode > bNodes;
|
||||||
|
std::vector< BEdge > bEdges( linkMap.Extent() - nbSharedLinks );
|
||||||
|
|
||||||
|
TLink2FaceMap::Iterator linkIt( linkMap );
|
||||||
|
for ( int iEdge = 0; linkIt.More(); linkIt.Next() )
|
||||||
|
{
|
||||||
|
if ( !linkIt.Value() ) continue;
|
||||||
|
const SMESH_TLink & link = linkIt.Key();
|
||||||
|
std::set< BNode >::iterator n1 = bNodes.insert( BNode( link.node1() )).first;
|
||||||
|
std::set< BNode >::iterator n2 = bNodes.insert( BNode( link.node2() )).first;
|
||||||
|
bEdges[ iEdge ].Set( &*n1, &*n2, linkIt.Value(), iEdge+1 );
|
||||||
|
n1->AddLinked( & bEdges[ iEdge ] );
|
||||||
|
n2->AddLinked( & bEdges[ iEdge ] );
|
||||||
|
++iEdge;
|
||||||
|
}
|
||||||
|
linkMap.Clear();
|
||||||
|
|
||||||
|
// assign IDs to borders
|
||||||
|
std::vector< BEdge* > borders; // 1st of connected (via myPrev and myNext) edges
|
||||||
|
std::set< BNode >::iterator bn = bNodes.begin();
|
||||||
|
for ( ; bn != bNodes.end(); ++bn )
|
||||||
|
{
|
||||||
|
for ( size_t i = 0; i < bn->myLinkedEdges.size(); ++i )
|
||||||
|
{
|
||||||
|
if ( bn->myLinkedEdges[i]->myBorderID < 0 )
|
||||||
|
{
|
||||||
|
BEdge* be = bn->myLinkedEdges[i];
|
||||||
|
int borderID = borders.size();
|
||||||
|
borders.push_back( be );
|
||||||
|
for ( ; be && be->myBorderID < 0; be = be->myNext )
|
||||||
|
{
|
||||||
|
be->myBorderID = borderID;
|
||||||
|
be->Orient();
|
||||||
|
}
|
||||||
|
bool isClosed = ( be == bn->myLinkedEdges[i] );
|
||||||
|
if ( !isClosed && theClosedOnly )
|
||||||
|
{
|
||||||
|
borders.pop_back();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
be = bn->myLinkedEdges[i]->myPrev;
|
||||||
|
for ( ; be && be->myBorderID < 0; be = be->myPrev )
|
||||||
|
{
|
||||||
|
be->myBorderID = borderID;
|
||||||
|
be->Orient();
|
||||||
|
}
|
||||||
|
if ( !isClosed )
|
||||||
|
while ( borders.back()->myPrev )
|
||||||
|
borders.back() = borders.back()->myPrev;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
theFoundFreeBordes.resize( borders.size() );
|
||||||
|
for ( size_t i = 0; i < borders.size(); ++i )
|
||||||
|
{
|
||||||
|
TFreeBorder & bordNodes = theFoundFreeBordes[ i ];
|
||||||
|
BEdge* be = borders[i];
|
||||||
|
|
||||||
|
size_t cnt = 1;
|
||||||
|
for ( be = be->myNext; be && be != borders[i]; be = be->myNext )
|
||||||
|
++cnt;
|
||||||
|
bordNodes.resize( cnt + 1 );
|
||||||
|
|
||||||
|
BEdge* beLast;
|
||||||
|
for ( be = borders[i], cnt = 0;
|
||||||
|
be && cnt < bordNodes.size()-1;
|
||||||
|
be = be->myNext, ++cnt )
|
||||||
|
{
|
||||||
|
bordNodes[ cnt ] = be->myBNode1->Node();
|
||||||
|
beLast = be;
|
||||||
|
}
|
||||||
|
bordNodes.back() = beLast->myBNode2->Node();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@ -35,6 +35,8 @@
|
|||||||
#include "SMDS_VolumeTool.hxx"
|
#include "SMDS_VolumeTool.hxx"
|
||||||
#include "SMESH_OctreeNode.hxx"
|
#include "SMESH_OctreeNode.hxx"
|
||||||
|
|
||||||
|
#include <Utils_SALOME_Exception.hxx>
|
||||||
|
|
||||||
#include <GC_MakeSegment.hxx>
|
#include <GC_MakeSegment.hxx>
|
||||||
#include <GeomAPI_ExtremaCurveCurve.hxx>
|
#include <GeomAPI_ExtremaCurveCurve.hxx>
|
||||||
#include <Geom_Line.hxx>
|
#include <Geom_Line.hxx>
|
||||||
@ -228,12 +230,12 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
|
|||||||
SMDSAbs_ElementType elemType,
|
SMDSAbs_ElementType elemType,
|
||||||
SMDS_ElemIteratorPtr theElemIt = SMDS_ElemIteratorPtr(),
|
SMDS_ElemIteratorPtr theElemIt = SMDS_ElemIteratorPtr(),
|
||||||
double tolerance = NodeRadius );
|
double tolerance = NodeRadius );
|
||||||
void prepare(); // !!!call it before calling the following methods!!!
|
|
||||||
void getElementsNearPoint( const gp_Pnt& point, vector<const SMDS_MeshElement*>& foundElems );
|
void getElementsNearPoint( const gp_Pnt& point, vector<const SMDS_MeshElement*>& foundElems );
|
||||||
void getElementsNearLine ( const gp_Ax1& line, vector<const SMDS_MeshElement*>& foundElems);
|
void getElementsNearLine ( const gp_Ax1& line, vector<const SMDS_MeshElement*>& foundElems);
|
||||||
void getElementsInSphere ( const gp_XYZ& center,
|
void getElementsInSphere ( const gp_XYZ& center,
|
||||||
const double radius,
|
const double radius,
|
||||||
vector<const SMDS_MeshElement*>& foundElems);
|
vector<const SMDS_MeshElement*>& foundElems);
|
||||||
|
ElementBndBoxTree* getLeafAtPoint( const gp_XYZ& point );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ElementBndBoxTree() {}
|
ElementBndBoxTree() {}
|
||||||
@ -337,19 +339,6 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
|
||||||
/*!
|
|
||||||
* \brief Un-mark all elements
|
|
||||||
*/
|
|
||||||
//================================================================================
|
|
||||||
|
|
||||||
void ElementBndBoxTree::prepare()
|
|
||||||
{
|
|
||||||
// TElementBoxPool& elBoPool = getElementBoxPool();
|
|
||||||
// for ( size_t i = 0; i < elBoPool.nbElements(); ++i )
|
|
||||||
// const_cast< ElementBox* >( elBoPool[ i ])->_isMarked = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Return elements which can include the point
|
* \brief Return elements which can include the point
|
||||||
@ -471,6 +460,30 @@ namespace // Utils used in SMESH_ElementSearcherImpl::FindElementsByPoint()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Return a leaf including a point
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
ElementBndBoxTree* ElementBndBoxTree::getLeafAtPoint( const gp_XYZ& point )
|
||||||
|
{
|
||||||
|
if ( getBox()->IsOut( point ))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
if ( isLeaf() )
|
||||||
|
{
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (int i = 0; i < 8; i++)
|
||||||
|
if ( ElementBndBoxTree* l = ((ElementBndBoxTree*) myChildren[i])->getLeafAtPoint( point ))
|
||||||
|
return l;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Construct the element box
|
* \brief Construct the element box
|
||||||
@ -539,13 +552,16 @@ struct SMESH_ElementSearcherImpl: public SMESH_ElementSearcher
|
|||||||
virtual const SMDS_MeshElement* FindClosestTo( const gp_Pnt& point,
|
virtual const SMDS_MeshElement* FindClosestTo( const gp_Pnt& point,
|
||||||
SMDSAbs_ElementType type );
|
SMDSAbs_ElementType type );
|
||||||
|
|
||||||
void GetElementsNearLine( const gp_Ax1& line,
|
virtual void GetElementsNearLine( const gp_Ax1& line,
|
||||||
SMDSAbs_ElementType type,
|
SMDSAbs_ElementType type,
|
||||||
vector< const SMDS_MeshElement* >& foundElems);
|
vector< const SMDS_MeshElement* >& foundElems);
|
||||||
void GetElementsInSphere( const gp_XYZ& center,
|
virtual void GetElementsInSphere( const gp_XYZ& center,
|
||||||
const double radius,
|
const double radius,
|
||||||
SMDSAbs_ElementType type,
|
SMDSAbs_ElementType type,
|
||||||
vector< const SMDS_MeshElement* >& foundElems);
|
vector< const SMDS_MeshElement* >& foundElems);
|
||||||
|
virtual gp_XYZ Project(const gp_Pnt& point,
|
||||||
|
SMDSAbs_ElementType type,
|
||||||
|
const SMDS_MeshElement** closestElem);
|
||||||
double getTolerance();
|
double getTolerance();
|
||||||
bool getIntersParamOnLine(const gp_Lin& line, const SMDS_MeshElement* face,
|
bool getIntersParamOnLine(const gp_Lin& line, const SMDS_MeshElement* face,
|
||||||
const double tolerance, double & param);
|
const double tolerance, double & param);
|
||||||
@ -834,10 +850,6 @@ FindElementsByPoint(const gp_Pnt& point,
|
|||||||
{
|
{
|
||||||
_ebbTree[_elementType] = new ElementBndBoxTree( *_mesh, type, _meshPartIt, tolerance );
|
_ebbTree[_elementType] = new ElementBndBoxTree( *_mesh, type, _meshPartIt, tolerance );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
_ebbTree[ type ]->prepare();
|
|
||||||
}
|
|
||||||
vector< const SMDS_MeshElement* > suspectElems;
|
vector< const SMDS_MeshElement* > suspectElems;
|
||||||
_ebbTree[ type ]->getElementsNearPoint( point, suspectElems );
|
_ebbTree[ type ]->getElementsNearPoint( point, suspectElems );
|
||||||
vector< const SMDS_MeshElement* >::iterator elem = suspectElems.begin();
|
vector< const SMDS_MeshElement* >::iterator elem = suspectElems.begin();
|
||||||
@ -863,13 +875,13 @@ SMESH_ElementSearcherImpl::FindClosestTo( const gp_Pnt& point,
|
|||||||
const SMDS_MeshElement* closestElem = 0;
|
const SMDS_MeshElement* closestElem = 0;
|
||||||
_elementType = type;
|
_elementType = type;
|
||||||
|
|
||||||
if ( type == SMDSAbs_Face || type == SMDSAbs_Volume )
|
if ( type == SMDSAbs_Face ||
|
||||||
|
type == SMDSAbs_Volume ||
|
||||||
|
type == SMDSAbs_Edge )
|
||||||
{
|
{
|
||||||
ElementBndBoxTree*& ebbTree = _ebbTree[ type ];
|
ElementBndBoxTree*& ebbTree = _ebbTree[ type ];
|
||||||
if ( !ebbTree )
|
if ( !ebbTree )
|
||||||
ebbTree = new ElementBndBoxTree( *_mesh, type, _meshPartIt );
|
ebbTree = new ElementBndBoxTree( *_mesh, type, _meshPartIt );
|
||||||
else
|
|
||||||
ebbTree->prepare();
|
|
||||||
|
|
||||||
vector<const SMDS_MeshElement*> suspectElems;
|
vector<const SMDS_MeshElement*> suspectElems;
|
||||||
ebbTree->getElementsNearPoint( point, suspectElems );
|
ebbTree->getElementsNearPoint( point, suspectElems );
|
||||||
@ -885,7 +897,6 @@ SMESH_ElementSearcherImpl::FindClosestTo( const gp_Pnt& point,
|
|||||||
radius = ebbTree->maxSize() / pow( 2., getTreeHeight()) / 2;
|
radius = ebbTree->maxSize() / pow( 2., getTreeHeight()) / 2;
|
||||||
while ( suspectElems.empty() )
|
while ( suspectElems.empty() )
|
||||||
{
|
{
|
||||||
ebbTree->prepare();
|
|
||||||
ebbTree->getElementsInSphere( point.XYZ(), radius, suspectElems );
|
ebbTree->getElementsInSphere( point.XYZ(), radius, suspectElems );
|
||||||
radius *= 1.1;
|
radius *= 1.1;
|
||||||
}
|
}
|
||||||
@ -956,8 +967,6 @@ TopAbs_State SMESH_ElementSearcherImpl::GetPointState(const gp_Pnt& point)
|
|||||||
ElementBndBoxTree*& ebbTree = _ebbTree[ SMDSAbs_Face ];
|
ElementBndBoxTree*& ebbTree = _ebbTree[ SMDSAbs_Face ];
|
||||||
if ( !ebbTree )
|
if ( !ebbTree )
|
||||||
ebbTree = new ElementBndBoxTree( *_mesh, _elementType, _meshPartIt );
|
ebbTree = new ElementBndBoxTree( *_mesh, _elementType, _meshPartIt );
|
||||||
else
|
|
||||||
ebbTree->prepare();
|
|
||||||
|
|
||||||
// Algo: analyse transition of a line starting at the point through mesh boundary;
|
// Algo: analyse transition of a line starting at the point through mesh boundary;
|
||||||
// try three lines parallel to axis of the coordinate system and perform rough
|
// try three lines parallel to axis of the coordinate system and perform rough
|
||||||
@ -974,7 +983,6 @@ TopAbs_State SMESH_ElementSearcherImpl::GetPointState(const gp_Pnt& point)
|
|||||||
gp_Lin line ( lineAxis );
|
gp_Lin line ( lineAxis );
|
||||||
|
|
||||||
vector<const SMDS_MeshElement*> suspectFaces; // faces possibly intersecting the line
|
vector<const SMDS_MeshElement*> suspectFaces; // faces possibly intersecting the line
|
||||||
if ( axis > 0 ) ebbTree->prepare();
|
|
||||||
ebbTree->getElementsNearLine( lineAxis, suspectFaces );
|
ebbTree->getElementsNearLine( lineAxis, suspectFaces );
|
||||||
|
|
||||||
// Intersect faces with the line
|
// Intersect faces with the line
|
||||||
@ -1187,8 +1195,6 @@ void SMESH_ElementSearcherImpl::GetElementsNearLine( const gp_Ax1&
|
|||||||
ElementBndBoxTree*& ebbTree = _ebbTree[ type ];
|
ElementBndBoxTree*& ebbTree = _ebbTree[ type ];
|
||||||
if ( !ebbTree )
|
if ( !ebbTree )
|
||||||
ebbTree = new ElementBndBoxTree( *_mesh, _elementType, _meshPartIt );
|
ebbTree = new ElementBndBoxTree( *_mesh, _elementType, _meshPartIt );
|
||||||
else
|
|
||||||
ebbTree->prepare();
|
|
||||||
|
|
||||||
ebbTree->getElementsNearLine( line, foundElems );
|
ebbTree->getElementsNearLine( line, foundElems );
|
||||||
}
|
}
|
||||||
@ -1208,12 +1214,59 @@ void SMESH_ElementSearcherImpl::GetElementsInSphere( const gp_XYZ&
|
|||||||
ElementBndBoxTree*& ebbTree = _ebbTree[ type ];
|
ElementBndBoxTree*& ebbTree = _ebbTree[ type ];
|
||||||
if ( !ebbTree )
|
if ( !ebbTree )
|
||||||
ebbTree = new ElementBndBoxTree( *_mesh, _elementType, _meshPartIt );
|
ebbTree = new ElementBndBoxTree( *_mesh, _elementType, _meshPartIt );
|
||||||
else
|
|
||||||
ebbTree->prepare();
|
|
||||||
|
|
||||||
ebbTree->getElementsInSphere( center, radius, foundElems );
|
ebbTree->getElementsInSphere( center, radius, foundElems );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//=======================================================================
|
||||||
|
/*
|
||||||
|
* \brief Return a projection of a given point to a mesh.
|
||||||
|
* Optionally return the closest element
|
||||||
|
*/
|
||||||
|
//=======================================================================
|
||||||
|
|
||||||
|
gp_XYZ SMESH_ElementSearcherImpl::Project(const gp_Pnt& point,
|
||||||
|
SMDSAbs_ElementType type,
|
||||||
|
const SMDS_MeshElement** closestElem)
|
||||||
|
{
|
||||||
|
_elementType = type;
|
||||||
|
if ( _mesh->GetMeshInfo().NbElements( _elementType ) == 0 )
|
||||||
|
throw SALOME_Exception( LOCALIZED( "No elements of given type in the mesh" ));
|
||||||
|
|
||||||
|
ElementBndBoxTree*& ebbTree = _ebbTree[ _elementType ];
|
||||||
|
if ( !ebbTree )
|
||||||
|
ebbTree = new ElementBndBoxTree( *_mesh, _elementType );
|
||||||
|
|
||||||
|
gp_XYZ p = point.XYZ();
|
||||||
|
ElementBndBoxTree* ebbLeaf = ebbTree->getLeafAtPoint( p );
|
||||||
|
const Bnd_B3d* box = ebbLeaf->getBox();
|
||||||
|
double radius = ( box->CornerMax() - box->CornerMin() ).Modulus();
|
||||||
|
|
||||||
|
vector< const SMDS_MeshElement* > elems;
|
||||||
|
ebbTree->getElementsInSphere( p, radius, elems );
|
||||||
|
while ( elems.empty() )
|
||||||
|
{
|
||||||
|
radius *= 1.5;
|
||||||
|
ebbTree->getElementsInSphere( p, radius, elems );
|
||||||
|
}
|
||||||
|
gp_XYZ proj, bestProj;
|
||||||
|
const SMDS_MeshElement* elem = 0;
|
||||||
|
double minDist = 2 * radius;
|
||||||
|
for ( size_t i = 0; i < elems.size(); ++i )
|
||||||
|
{
|
||||||
|
double d = SMESH_MeshAlgos::GetDistance( elems[i], p, &proj );
|
||||||
|
if ( d < minDist )
|
||||||
|
{
|
||||||
|
bestProj = proj;
|
||||||
|
elem = elems[i];
|
||||||
|
minDist = d;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( closestElem ) *closestElem = elem;
|
||||||
|
|
||||||
|
return bestProj;
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
/*!
|
/*!
|
||||||
* \brief Return true if the point is IN or ON of the element
|
* \brief Return true if the point is IN or ON of the element
|
||||||
@ -1461,17 +1514,19 @@ namespace
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
double SMESH_MeshAlgos::GetDistance( const SMDS_MeshElement* elem,
|
double SMESH_MeshAlgos::GetDistance( const SMDS_MeshElement* elem,
|
||||||
const gp_Pnt& point )
|
const gp_Pnt& point,
|
||||||
|
gp_XYZ* closestPnt )
|
||||||
{
|
{
|
||||||
switch ( elem->GetType() )
|
switch ( elem->GetType() )
|
||||||
{
|
{
|
||||||
case SMDSAbs_Volume:
|
case SMDSAbs_Volume:
|
||||||
return GetDistance( dynamic_cast<const SMDS_MeshVolume*>( elem ), point);
|
return GetDistance( dynamic_cast<const SMDS_MeshVolume*>( elem ), point, closestPnt );
|
||||||
case SMDSAbs_Face:
|
case SMDSAbs_Face:
|
||||||
return GetDistance( dynamic_cast<const SMDS_MeshFace*>( elem ), point);
|
return GetDistance( dynamic_cast<const SMDS_MeshFace*>( elem ), point, closestPnt );
|
||||||
case SMDSAbs_Edge:
|
case SMDSAbs_Edge:
|
||||||
return GetDistance( dynamic_cast<const SMDS_MeshEdge*>( elem ), point);
|
return GetDistance( dynamic_cast<const SMDS_MeshEdge*>( elem ), point, closestPnt );
|
||||||
case SMDSAbs_Node:
|
case SMDSAbs_Node:
|
||||||
|
if ( closestPnt ) *closestPnt = SMESH_TNodeXYZ( elem );
|
||||||
return point.Distance( SMESH_TNodeXYZ( elem ));
|
return point.Distance( SMESH_TNodeXYZ( elem ));
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
@ -1487,9 +1542,10 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshElement* elem,
|
|||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face,
|
double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face,
|
||||||
const gp_Pnt& point )
|
const gp_Pnt& point,
|
||||||
|
gp_XYZ* closestPnt )
|
||||||
{
|
{
|
||||||
double badDistance = -1;
|
const double badDistance = -1;
|
||||||
if ( !face ) return badDistance;
|
if ( !face ) return badDistance;
|
||||||
|
|
||||||
// coordinates of nodes (medium nodes, if any, ignored)
|
// coordinates of nodes (medium nodes, if any, ignored)
|
||||||
@ -1533,7 +1589,7 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face,
|
|||||||
trsf.Transforms( tmpPnt );
|
trsf.Transforms( tmpPnt );
|
||||||
gp_XY point2D( tmpPnt.X(), tmpPnt.Z() );
|
gp_XY point2D( tmpPnt.X(), tmpPnt.Z() );
|
||||||
|
|
||||||
// loop on segments of the face to analyze point position ralative to the face
|
// loop on edges of the face to analyze point position ralative to the face
|
||||||
set< PointPos > pntPosSet;
|
set< PointPos > pntPosSet;
|
||||||
for ( size_t i = 1; i < xy.size(); ++i )
|
for ( size_t i = 1; i < xy.size(); ++i )
|
||||||
{
|
{
|
||||||
@ -1543,31 +1599,40 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face,
|
|||||||
|
|
||||||
// compute distance
|
// compute distance
|
||||||
PointPos pos = *pntPosSet.begin();
|
PointPos pos = *pntPosSet.begin();
|
||||||
// cout << "Face " << face->GetID() << " DIST: ";
|
|
||||||
switch ( pos._name )
|
switch ( pos._name )
|
||||||
{
|
{
|
||||||
case POS_LEFT: {
|
case POS_LEFT:
|
||||||
// point is most close to a segment
|
{
|
||||||
gp_Vec p0p1( point, xyz[ pos._index ] );
|
// point is most close to an edge
|
||||||
gp_Vec p1p2( xyz[ pos._index ], xyz[ pos._index+1 ]); // segment vector
|
gp_Vec edge( xyz[ pos._index ], xyz[ pos._index+1 ]);
|
||||||
p1p2.Normalize();
|
gp_Vec n1p ( xyz[ pos._index ], point );
|
||||||
double projDist = p0p1 * p1p2; // distance projected to the segment
|
double u = ( edge * n1p ) / edge.SquareMagnitude(); // param [0,1] on the edge
|
||||||
gp_Vec projVec = p1p2 * projDist;
|
// projection of the point on the edge
|
||||||
gp_Vec distVec = p0p1 - projVec;
|
gp_XYZ proj = ( 1. - u ) * xyz[ pos._index ] + u * xyz[ pos._index+1 ];
|
||||||
// cout << distVec.Magnitude() << ", SEG " << face->GetNode(pos._index)->GetID()
|
if ( closestPnt ) *closestPnt = proj;
|
||||||
// << " - " << face->GetNodeWrap(pos._index+1)->GetID() << endl;
|
return point.Distance( proj );
|
||||||
return distVec.Magnitude();
|
|
||||||
}
|
}
|
||||||
case POS_RIGHT: {
|
case POS_RIGHT:
|
||||||
|
{
|
||||||
// point is inside the face
|
// point is inside the face
|
||||||
double distToFacePlane = tmpPnt.Y();
|
double distToFacePlane = Abs( tmpPnt.Y() );
|
||||||
// cout << distToFacePlane << ", INSIDE " << endl;
|
if ( closestPnt )
|
||||||
return Abs( distToFacePlane );
|
{
|
||||||
|
if ( distToFacePlane < std::numeric_limits<double>::min() ) {
|
||||||
|
*closestPnt = point.XYZ();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tmpPnt.SetY( 0 );
|
||||||
|
trsf.Inverted().Transforms( tmpPnt );
|
||||||
|
*closestPnt = tmpPnt;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return distToFacePlane;
|
||||||
}
|
}
|
||||||
case POS_VERTEX: {
|
case POS_VERTEX:
|
||||||
|
{
|
||||||
// point is most close to a node
|
// point is most close to a node
|
||||||
gp_Vec distVec( point, xyz[ pos._index ]);
|
gp_Vec distVec( point, xyz[ pos._index ]);
|
||||||
// cout << distVec.Magnitude() << " VERTEX " << face->GetNode(pos._index)->GetID() << endl;
|
|
||||||
return distVec.Magnitude();
|
return distVec.Magnitude();
|
||||||
}
|
}
|
||||||
default:;
|
default:;
|
||||||
@ -1581,7 +1646,9 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshFace* face,
|
|||||||
*/
|
*/
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
double SMESH_MeshAlgos::GetDistance( const SMDS_MeshEdge* seg, const gp_Pnt& point )
|
double SMESH_MeshAlgos::GetDistance( const SMDS_MeshEdge* seg,
|
||||||
|
const gp_Pnt& point,
|
||||||
|
gp_XYZ* closestPnt )
|
||||||
{
|
{
|
||||||
double dist = Precision::Infinite();
|
double dist = Precision::Infinite();
|
||||||
if ( !seg ) return dist;
|
if ( !seg ) return dist;
|
||||||
@ -1597,16 +1664,25 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshEdge* seg, const gp_Pnt& poi
|
|||||||
{
|
{
|
||||||
gp_Vec edge( xyz[i-1], xyz[i] );
|
gp_Vec edge( xyz[i-1], xyz[i] );
|
||||||
gp_Vec n1p ( xyz[i-1], point );
|
gp_Vec n1p ( xyz[i-1], point );
|
||||||
double u = ( edge * n1p ) / edge.SquareMagnitude(); // param [0,1] on the edge
|
double d, u = ( edge * n1p ) / edge.SquareMagnitude(); // param [0,1] on the edge
|
||||||
if ( u <= 0. ) {
|
if ( u <= 0. ) {
|
||||||
dist = Min( dist, n1p.SquareMagnitude() );
|
if (( d = n1p.SquareMagnitude() ) < dist ) {
|
||||||
|
dist = d;
|
||||||
|
if ( closestPnt ) *closestPnt = xyz[i-1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if ( u >= 1. ) {
|
else if ( u >= 1. ) {
|
||||||
dist = Min( dist, point.SquareDistance( xyz[i] ));
|
if (( d = point.SquareDistance( xyz[i] )) < dist ) {
|
||||||
|
dist = d;
|
||||||
|
if ( closestPnt ) *closestPnt = xyz[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gp_XYZ proj = ( 1. - u ) * xyz[i-1] + u * xyz[i]; // projection of the point on the edge
|
gp_XYZ proj = xyz[i-1] + u * edge.XYZ(); // projection of the point on the edge
|
||||||
dist = Min( dist, point.SquareDistance( proj ));
|
if (( d = point.SquareDistance( proj )) < dist ) {
|
||||||
|
dist = d;
|
||||||
|
if ( closestPnt ) *closestPnt = proj;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Sqrt( dist );
|
return Sqrt( dist );
|
||||||
@ -1620,7 +1696,9 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshEdge* seg, const gp_Pnt& poi
|
|||||||
*/
|
*/
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
double SMESH_MeshAlgos::GetDistance( const SMDS_MeshVolume* volume, const gp_Pnt& point )
|
double SMESH_MeshAlgos::GetDistance( const SMDS_MeshVolume* volume,
|
||||||
|
const gp_Pnt& point,
|
||||||
|
gp_XYZ* closestPnt )
|
||||||
{
|
{
|
||||||
SMDS_VolumeTool vTool( volume );
|
SMDS_VolumeTool vTool( volume );
|
||||||
vTool.SetExternalNormal();
|
vTool.SetExternalNormal();
|
||||||
@ -1628,6 +1706,8 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshVolume* volume, const gp_Pnt
|
|||||||
|
|
||||||
double n[3], bc[3];
|
double n[3], bc[3];
|
||||||
double minDist = 1e100, dist;
|
double minDist = 1e100, dist;
|
||||||
|
gp_XYZ closeP = point.XYZ();
|
||||||
|
bool isOut = false;
|
||||||
for ( int iF = 0; iF < vTool.NbFaces(); ++iF )
|
for ( int iF = 0; iF < vTool.NbFaces(); ++iF )
|
||||||
{
|
{
|
||||||
// skip a facet with normal not "looking at" the point
|
// skip a facet with normal not "looking at" the point
|
||||||
@ -1644,23 +1724,34 @@ double SMESH_MeshAlgos::GetDistance( const SMDS_MeshVolume* volume, const gp_Pnt
|
|||||||
case 3:
|
case 3:
|
||||||
{
|
{
|
||||||
SMDS_FaceOfNodes tmpFace( nodes[0], nodes[ 1*iQ ], nodes[ 2*iQ ] );
|
SMDS_FaceOfNodes tmpFace( nodes[0], nodes[ 1*iQ ], nodes[ 2*iQ ] );
|
||||||
dist = GetDistance( &tmpFace, point );
|
dist = GetDistance( &tmpFace, point, closestPnt );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case 4:
|
case 4:
|
||||||
{
|
{
|
||||||
SMDS_FaceOfNodes tmpFace( nodes[0], nodes[ 1*iQ ], nodes[ 2*iQ ], nodes[ 3*iQ ]);
|
SMDS_FaceOfNodes tmpFace( nodes[0], nodes[ 1*iQ ], nodes[ 2*iQ ], nodes[ 3*iQ ]);
|
||||||
dist = GetDistance( &tmpFace, point );
|
dist = GetDistance( &tmpFace, point, closestPnt );
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
vector<const SMDS_MeshNode *> nvec( nodes, nodes + vTool.NbFaceNodes( iF ));
|
vector<const SMDS_MeshNode *> nvec( nodes, nodes + vTool.NbFaceNodes( iF ));
|
||||||
SMDS_PolygonalFaceOfNodes tmpFace( nvec );
|
SMDS_PolygonalFaceOfNodes tmpFace( nvec );
|
||||||
dist = GetDistance( &tmpFace, point );
|
dist = GetDistance( &tmpFace, point, closestPnt );
|
||||||
|
}
|
||||||
|
if ( dist < minDist )
|
||||||
|
{
|
||||||
|
minDist = dist;
|
||||||
|
isOut = true;
|
||||||
|
if ( closestPnt ) closeP = *closestPnt;
|
||||||
}
|
}
|
||||||
minDist = Min( minDist, dist );
|
|
||||||
}
|
}
|
||||||
return minDist;
|
if ( isOut )
|
||||||
|
{
|
||||||
|
if ( closestPnt ) *closestPnt = closeP;
|
||||||
|
return minDist;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0; // point is inside the volume
|
||||||
}
|
}
|
||||||
|
|
||||||
//================================================================================
|
//================================================================================
|
||||||
@ -1804,6 +1895,34 @@ vector< const SMDS_MeshNode*> SMESH_MeshAlgos::GetCommonNodes(const SMDS_MeshEle
|
|||||||
common.push_back( e1->GetNode( i ));
|
common.push_back( e1->GetNode( i ));
|
||||||
return common;
|
return common;
|
||||||
}
|
}
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Return true if node1 encounters first in the face and node2, after
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
bool SMESH_MeshAlgos::IsRightOrder( const SMDS_MeshElement* face,
|
||||||
|
const SMDS_MeshNode* node0,
|
||||||
|
const SMDS_MeshNode* node1 )
|
||||||
|
{
|
||||||
|
int i0 = face->GetNodeIndex( node0 );
|
||||||
|
int i1 = face->GetNodeIndex( node1 );
|
||||||
|
if ( face->IsQuadratic() )
|
||||||
|
{
|
||||||
|
if ( face->IsMediumNode( node0 ))
|
||||||
|
{
|
||||||
|
i0 -= ( face->NbNodes()/2 - 1 );
|
||||||
|
i1 *= 2;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i1 -= ( face->NbNodes()/2 - 1 );
|
||||||
|
i0 *= 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
int diff = i1 - i0;
|
||||||
|
return ( diff == 1 ) || ( diff == -face->NbNodes()+1 );
|
||||||
|
}
|
||||||
|
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
/*!
|
/*!
|
||||||
|
@ -100,6 +100,15 @@ struct SMESHUtils_EXPORT SMESH_ElementSearcher
|
|||||||
* \brief Find out if the given point is out of closed 2D mesh.
|
* \brief Find out if the given point is out of closed 2D mesh.
|
||||||
*/
|
*/
|
||||||
virtual TopAbs_State GetPointState(const gp_Pnt& point) = 0;
|
virtual TopAbs_State GetPointState(const gp_Pnt& point) = 0;
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Return a projection of a given point to a 2D mesh.
|
||||||
|
* Optionally return the closest face
|
||||||
|
*/
|
||||||
|
virtual gp_XYZ Project(const gp_Pnt& point,
|
||||||
|
SMDSAbs_ElementType type,
|
||||||
|
const SMDS_MeshElement** closestFace= 0) = 0;
|
||||||
|
|
||||||
virtual ~SMESH_ElementSearcher();
|
virtual ~SMESH_ElementSearcher();
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -112,16 +121,16 @@ namespace SMESH_MeshAlgos
|
|||||||
bool IsOut( const SMDS_MeshElement* element, const gp_Pnt& point, double tol );
|
bool IsOut( const SMDS_MeshElement* element, const gp_Pnt& point, double tol );
|
||||||
|
|
||||||
SMESHUtils_EXPORT
|
SMESHUtils_EXPORT
|
||||||
double GetDistance( const SMDS_MeshElement* elem, const gp_Pnt& point );
|
double GetDistance( const SMDS_MeshElement* elem, const gp_Pnt& point, gp_XYZ* closestPnt = 0 );
|
||||||
|
|
||||||
SMESHUtils_EXPORT
|
SMESHUtils_EXPORT
|
||||||
double GetDistance( const SMDS_MeshEdge* edge, const gp_Pnt& point );
|
double GetDistance( const SMDS_MeshEdge* edge, const gp_Pnt& point, gp_XYZ* closestPnt = 0 );
|
||||||
|
|
||||||
SMESHUtils_EXPORT
|
SMESHUtils_EXPORT
|
||||||
double GetDistance( const SMDS_MeshFace* face, const gp_Pnt& point );
|
double GetDistance( const SMDS_MeshFace* face, const gp_Pnt& point, gp_XYZ* closestPnt = 0 );
|
||||||
|
|
||||||
SMESHUtils_EXPORT
|
SMESHUtils_EXPORT
|
||||||
double GetDistance( const SMDS_MeshVolume* volume, const gp_Pnt& point );
|
double GetDistance( const SMDS_MeshVolume* volume, const gp_Pnt& point, gp_XYZ* closestPnt = 0 );
|
||||||
|
|
||||||
SMESHUtils_EXPORT
|
SMESHUtils_EXPORT
|
||||||
void GetBarycentricCoords( const gp_XY& point,
|
void GetBarycentricCoords( const gp_XY& point,
|
||||||
@ -153,6 +162,14 @@ namespace SMESH_MeshAlgos
|
|||||||
SMESHUtils_EXPORT
|
SMESHUtils_EXPORT
|
||||||
std::vector< const SMDS_MeshNode*> GetCommonNodes(const SMDS_MeshElement* e1,
|
std::vector< const SMDS_MeshNode*> GetCommonNodes(const SMDS_MeshElement* e1,
|
||||||
const SMDS_MeshElement* e2);
|
const SMDS_MeshElement* e2);
|
||||||
|
/*!
|
||||||
|
* \brief Return true if node1 encounters first in the face and node2, after.
|
||||||
|
* The nodes are supposed to be neighbor nodes in the face.
|
||||||
|
*/
|
||||||
|
SMESHUtils_EXPORT
|
||||||
|
bool IsRightOrder( const SMDS_MeshElement* face,
|
||||||
|
const SMDS_MeshNode* node0,
|
||||||
|
const SMDS_MeshNode* node1 );
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Return SMESH_NodeSearcher. The caller is responsible for deleteing it
|
* \brief Return SMESH_NodeSearcher. The caller is responsible for deleteing it
|
||||||
@ -204,7 +221,28 @@ namespace SMESH_MeshAlgos
|
|||||||
void FindCoincidentFreeBorders(SMDS_Mesh& mesh,
|
void FindCoincidentFreeBorders(SMDS_Mesh& mesh,
|
||||||
double tolerance,
|
double tolerance,
|
||||||
CoincidentFreeBorders & foundFreeBordes);
|
CoincidentFreeBorders & foundFreeBordes);
|
||||||
|
/*!
|
||||||
|
* Returns all or only closed TFreeBorder's.
|
||||||
|
* Optionally check if the mesh is manifold and if faces are correctly oriented.
|
||||||
|
*
|
||||||
|
* (Implemented in ./SMESH_FreeBorders.cxx)
|
||||||
|
*/
|
||||||
|
SMESHUtils_EXPORT
|
||||||
|
void FindFreeBorders(SMDS_Mesh& mesh,
|
||||||
|
TFreeBorderVec & foundFreeBordes,
|
||||||
|
const bool closedOnly,
|
||||||
|
bool* isManifold = 0,
|
||||||
|
bool* isGoodOri = 0);
|
||||||
|
/*!
|
||||||
|
* Fill a hole defined by a TFreeBorder with 2D elements.
|
||||||
|
*
|
||||||
|
* (Implemented in ./SMESH_FillHole.cxx)
|
||||||
|
*/
|
||||||
|
SMESHUtils_EXPORT
|
||||||
|
void FillHole(const TFreeBorder & freeBorder,
|
||||||
|
SMDS_Mesh& mesh,
|
||||||
|
std::vector<const SMDS_MeshElement*>& newFaces);
|
||||||
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Find nodes whose merge makes the element invalid
|
* \brief Find nodes whose merge makes the element invalid
|
||||||
|
@ -32,6 +32,12 @@ void SMESH::doNothing(const char* txt)
|
|||||||
{
|
{
|
||||||
MESSAGE( txt << " " << __FILE__ << ": " << __LINE__ );
|
MESSAGE( txt << " " << __FILE__ << ": " << __LINE__ );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const char* SMESH::returnError(const char* txt)
|
||||||
|
{
|
||||||
|
return txt;
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
#include "SMESH_ComputeError.hxx"
|
#include "SMESH_ComputeError.hxx"
|
||||||
|
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user