mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-02-09 18:53:07 +05:00
bos #20649 [CEA 19946] SMESH tests regression
partially roll back 0f2942 because of hung up at calling any method of shaperBuilder in TUI mode
This commit is contained in:
parent
d96d5ee20c
commit
2283860a0a
@ -1653,6 +1653,7 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
if self.geom:
|
if self.geom:
|
||||||
self.geompyD = None
|
self.geompyD = None
|
||||||
try:
|
try:
|
||||||
|
if salome.sg.hasDesktop():
|
||||||
so = salome.ObjectToSObject( self.geom )
|
so = salome.ObjectToSObject( self.geom )
|
||||||
comp = so.GetFatherComponent()
|
comp = so.GetFatherComponent()
|
||||||
if comp.ComponentDataType() == "SHAPERSTUDY":
|
if comp.ComponentDataType() == "SHAPERSTUDY":
|
||||||
@ -1663,7 +1664,6 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
if not self.geompyD:
|
if not self.geompyD:
|
||||||
self.geompyD = self.geom.GetGen()
|
self.geompyD = self.geom.GetGen()
|
||||||
pass
|
pass
|
||||||
pass
|
|
||||||
|
|
||||||
def GetMesh(self):
|
def GetMesh(self):
|
||||||
"""
|
"""
|
||||||
@ -2653,7 +2653,15 @@ class Mesh(metaclass = MeshMeta):
|
|||||||
elif tgeo == "SOLID" or tgeo == "COMPSOLID":
|
elif tgeo == "SOLID" or tgeo == "COMPSOLID":
|
||||||
typ = VOLUME
|
typ = VOLUME
|
||||||
elif tgeo == "COMPOUND":
|
elif tgeo == "COMPOUND":
|
||||||
|
try:
|
||||||
sub = self.geompyD.SubShapeAll( shape, self.geompyD.ShapeType["SHAPE"])
|
sub = self.geompyD.SubShapeAll( shape, self.geompyD.ShapeType["SHAPE"])
|
||||||
|
except:
|
||||||
|
# try to get the SHAPERSTUDY engine directly, because GetGen does not work because of
|
||||||
|
# simplification of access in geomBuilder: omniORB.registerObjref
|
||||||
|
from SHAPERSTUDY_utils import getEngine
|
||||||
|
gen = getEngine()
|
||||||
|
if gen:
|
||||||
|
sub = gen.GetIShapesOperations().ExtractSubShapes(shape, self.geompyD.ShapeType["SHAPE"], False)
|
||||||
if not sub:
|
if not sub:
|
||||||
raise ValueError("_groupTypeFromShape(): empty geometric group or compound '%s'" % GetName(shape))
|
raise ValueError("_groupTypeFromShape(): empty geometric group or compound '%s'" % GetName(shape))
|
||||||
return self._groupTypeFromShape( sub[0] )
|
return self._groupTypeFromShape( sub[0] )
|
||||||
|
@ -340,9 +340,20 @@ class Mesh_Algorithm:
|
|||||||
if faces and isinstance( faces[0], geomBuilder.GEOM._objref_GEOM_Object ):
|
if faces and isinstance( faces[0], geomBuilder.GEOM._objref_GEOM_Object ):
|
||||||
faceIDs = []
|
faceIDs = []
|
||||||
for shape in faces:
|
for shape in faces:
|
||||||
|
try:
|
||||||
ff = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["FACE"] )
|
ff = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["FACE"] )
|
||||||
for f in ff:
|
for f in ff:
|
||||||
faceIDs.append( self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f))
|
faceIDs.append( self.mesh.geompyD.GetSubShapeID(self.mesh.geom, f))
|
||||||
|
except:
|
||||||
|
# try to get the SHAPERSTUDY engine directly, because GetGen does not work because of
|
||||||
|
# simplification of access in geomBuilder: omniORB.registerObjref
|
||||||
|
from SHAPERSTUDY_utils import getEngine
|
||||||
|
gen = getEngine()
|
||||||
|
if gen:
|
||||||
|
aShapeOp = gen.GetIShapesOperations()
|
||||||
|
ff = aShapeOp.ExtractSubShapes( shape, self.mesh.geompyD.ShapeType["FACE"], False)
|
||||||
|
for f in ff:
|
||||||
|
faceIDs.append( aShapeOp.GetSubShapeIndex( self.mesh.geom, f ))
|
||||||
faces = faceIDs
|
faces = faceIDs
|
||||||
hyp = self.Hypothesis("ViscousLayers",
|
hyp = self.Hypothesis("ViscousLayers",
|
||||||
[thickness, numberOfLayers, stretchFactor, faces, isFacesToIgnore],
|
[thickness, numberOfLayers, stretchFactor, faces, isFacesToIgnore],
|
||||||
@ -392,9 +403,20 @@ class Mesh_Algorithm:
|
|||||||
if edges and isinstance( edges[0], geomBuilder.GEOM._objref_GEOM_Object ):
|
if edges and isinstance( edges[0], geomBuilder.GEOM._objref_GEOM_Object ):
|
||||||
edgeIDs = []
|
edgeIDs = []
|
||||||
for shape in edges:
|
for shape in edges:
|
||||||
|
try:
|
||||||
ee = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["EDGE"])
|
ee = self.mesh.geompyD.SubShapeAll( shape, self.mesh.geompyD.ShapeType["EDGE"])
|
||||||
for e in ee:
|
for e in ee:
|
||||||
edgeIDs.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, e ))
|
edgeIDs.append( self.mesh.geompyD.GetSubShapeID( self.mesh.geom, e ))
|
||||||
|
except:
|
||||||
|
# try to get the SHAPERSTUDY engine directly, because GetGen does not work because of
|
||||||
|
# simplification of access in geomBuilder: omniORB.registerObjref
|
||||||
|
from SHAPERSTUDY_utils import getEngine
|
||||||
|
gen = getEngine()
|
||||||
|
if gen:
|
||||||
|
aShapeOp = gen.GetIShapesOperations()
|
||||||
|
ee = aShapeOp.ExtractSubShapes( shape, self.mesh.geompyD.ShapeType["EDGE"], False)
|
||||||
|
for e in ee:
|
||||||
|
edgeIDs.append( aShapeOp.GetSubShapeIndex( self.mesh.geom, e ))
|
||||||
edges = edgeIDs
|
edges = edgeIDs
|
||||||
hyp = self.Hypothesis("ViscousLayers2D",
|
hyp = self.Hypothesis("ViscousLayers2D",
|
||||||
[thickness, numberOfLayers, stretchFactor, edges, isEdgesToIgnore],
|
[thickness, numberOfLayers, stretchFactor, edges, isEdgesToIgnore],
|
||||||
@ -418,6 +440,18 @@ class Mesh_Algorithm:
|
|||||||
for i in reverseList:
|
for i in reverseList:
|
||||||
if isinstance( i, int ):
|
if isinstance( i, int ):
|
||||||
s = geompy.GetSubShape(self.mesh.geom, [i])
|
s = geompy.GetSubShape(self.mesh.geom, [i])
|
||||||
|
|
||||||
|
#bos #20082 begin:
|
||||||
|
if s is None and type(self.geom) != geomBuilder.GEOM._objref_GEOM_Object:
|
||||||
|
# try to get the SHAPERSTUDY engine directly, as GetGen does not work because of
|
||||||
|
# simplification of access in geomBuilder: omniORB.registerObjref
|
||||||
|
from SHAPERSTUDY_utils import getEngine
|
||||||
|
gen = getEngine()
|
||||||
|
if gen:
|
||||||
|
aShapeOp = gen.GetIShapesOperations()
|
||||||
|
s = aShapeOp.GetSubShape(self.mesh.geom, i)
|
||||||
|
#bos #20082 end
|
||||||
|
|
||||||
if s.GetShapeType() != geomBuilder.GEOM.EDGE:
|
if s.GetShapeType() != geomBuilder.GEOM.EDGE:
|
||||||
raise TypeError("Not EDGE index given")
|
raise TypeError("Not EDGE index given")
|
||||||
resList.append( i )
|
resList.append( i )
|
||||||
|
Loading…
Reference in New Issue
Block a user