mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-26 01:10:35 +05:00
PAL10494 (SMESH python dump uses idl interface). Add GetAlgorithm() to class Mesh_Algorithm in order to have access to the wrapped mesher
This commit is contained in:
parent
01d6aed55b
commit
d9e37c0ebb
@ -77,6 +77,7 @@ class Mesh_Algorithm:
|
|||||||
mesh = 0
|
mesh = 0
|
||||||
geom = 0
|
geom = 0
|
||||||
subm = 0
|
subm = 0
|
||||||
|
algo = 0
|
||||||
|
|
||||||
def GetSubMesh(self):
|
def GetSubMesh(self):
|
||||||
"""
|
"""
|
||||||
@ -85,6 +86,12 @@ class Mesh_Algorithm:
|
|||||||
"""
|
"""
|
||||||
return self.subm
|
return self.subm
|
||||||
|
|
||||||
|
def GetAlgorithm(self):
|
||||||
|
"""
|
||||||
|
Return the wrapped mesher
|
||||||
|
"""
|
||||||
|
return self.algo
|
||||||
|
|
||||||
def Create(self, mesh, geom, hypo, so="libStdMeshersEngine.so"):
|
def Create(self, mesh, geom, hypo, so="libStdMeshersEngine.so"):
|
||||||
"""
|
"""
|
||||||
Private method
|
Private method
|
||||||
@ -102,9 +109,9 @@ class Mesh_Algorithm:
|
|||||||
geompy.addToStudyInFather(piece, geom, name)
|
geompy.addToStudyInFather(piece, geom, name)
|
||||||
self.subm = mesh.mesh.GetSubMesh(geom, hypo)
|
self.subm = mesh.mesh.GetSubMesh(geom, hypo)
|
||||||
|
|
||||||
algo = smesh.CreateHypothesis(hypo, so)
|
self.algo = smesh.CreateHypothesis(hypo, so)
|
||||||
SetName(algo, name + "/" + hypo)
|
SetName(self.algo, name + "/" + hypo)
|
||||||
mesh.mesh.AddHypothesis(self.geom, algo)
|
mesh.mesh.AddHypothesis(self.geom, self.algo)
|
||||||
|
|
||||||
def Hypothesis(self, hyp, args=[], so="libStdMeshersEngine.so"):
|
def Hypothesis(self, hyp, args=[], so="libStdMeshersEngine.so"):
|
||||||
"""
|
"""
|
||||||
@ -378,12 +385,16 @@ class Mesh:
|
|||||||
\param algo values are smesh.REGULAR or smesh.PYTHON for discretization via python function
|
\param algo values are smesh.REGULAR or smesh.PYTHON for discretization via python function
|
||||||
\param geom If defined, subshape to be meshed
|
\param geom If defined, subshape to be meshed
|
||||||
"""
|
"""
|
||||||
|
## if Segment(geom) is called by mistake
|
||||||
|
if ( isinstance( algo, geompy.GEOM._objref_GEOM_Object)):
|
||||||
|
algo, geom = geom, algo
|
||||||
|
pass
|
||||||
if algo == REGULAR:
|
if algo == REGULAR:
|
||||||
return Mesh_Segment(self, geom)
|
return Mesh_Segment(self, geom)
|
||||||
elif algo == PYTHON:
|
elif algo == PYTHON:
|
||||||
return Mesh_Segment_Python(self, geom)
|
return Mesh_Segment_Python(self, geom)
|
||||||
else:
|
else:
|
||||||
return Mesh_Segment(self, algo)
|
return Mesh_Segment(self, geom)
|
||||||
|
|
||||||
def Triangle(self, geom=0):
|
def Triangle(self, geom=0):
|
||||||
"""
|
"""
|
||||||
@ -412,6 +423,10 @@ class Mesh:
|
|||||||
\param algo values are: smesh.NETGEN, smesh.GHS3D
|
\param algo values are: smesh.NETGEN, smesh.GHS3D
|
||||||
\param geom If defined, subshape to be meshed
|
\param geom If defined, subshape to be meshed
|
||||||
"""
|
"""
|
||||||
|
## if Tetrahedron(geom) is called by mistake
|
||||||
|
if ( isinstance( algo, geompy.GEOM._objref_GEOM_Object)):
|
||||||
|
algo, geom = geom, algo
|
||||||
|
pass
|
||||||
return Mesh_Tetrahedron(self, algo, geom)
|
return Mesh_Tetrahedron(self, algo, geom)
|
||||||
|
|
||||||
def Hexahedron(self, geom=0):
|
def Hexahedron(self, geom=0):
|
||||||
@ -449,8 +464,7 @@ class Mesh:
|
|||||||
if dim > 2 :
|
if dim > 2 :
|
||||||
self.Tetrahedron(NETGEN)
|
self.Tetrahedron(NETGEN)
|
||||||
pass
|
pass
|
||||||
self.Compute()
|
return self.Compute()
|
||||||
pass
|
|
||||||
|
|
||||||
def AutomaticHexahedralization(self):
|
def AutomaticHexahedralization(self):
|
||||||
"""
|
"""
|
||||||
@ -466,8 +480,7 @@ class Mesh:
|
|||||||
if dim > 2 :
|
if dim > 2 :
|
||||||
self.Hexahedron()
|
self.Hexahedron()
|
||||||
pass
|
pass
|
||||||
self.Compute()
|
return self.Compute()
|
||||||
pass
|
|
||||||
|
|
||||||
def RemoveGlobalHypotheses(self):
|
def RemoveGlobalHypotheses(self):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user