Salome HOME
bos #20543 EDF 22638 - hyperpatch with CADSurf
[modules/smesh.git] / src / SMESH_SWIG / smeshBuilder.py
index 21456eed4fa3dfa94caf9f422c7606214f39f0e6..7bdc59eb4b2d63676e953e9f17e9e98f576072b7 100644 (file)
@@ -38,8 +38,9 @@ SMESH.MED_MINOR_7 = 27 # back compatibility
 SMESH.MED_MINOR_8 = 28 # back compatibility
 SMESH.MED_MINOR_9 = 29 # back compatibility
 
-from   SMESH import *
-from   salome.smesh.smesh_algorithm import Mesh_Algorithm
+from SMESH import *
+from salome.smesh.smesh_algorithm import Mesh_Algorithm
+from StdMeshers import BlockCS
 
 import SALOME
 import SALOMEDS
@@ -1650,7 +1651,17 @@ class Mesh(metaclass = MeshMeta):
             #self.mesh.Register()
             self.geom = self.mesh.GetShapeToMesh()
             if self.geom:
-                self.geompyD = self.geom.GetGen()
+                self.geompyD = None
+                try:
+                    so = salome.ObjectToSObject( self.geom )
+                    comp = so.GetFatherComponent()
+                    if comp.ComponentDataType() == "SHAPERSTUDY":
+                        import shaperBuilder
+                        self.geompyD = shaperBuilder.New()
+                except:
+                    pass
+                if not self.geompyD:
+                    self.geompyD = self.geom.GetGen()
                 pass
         pass
 
@@ -2641,15 +2652,7 @@ class Mesh(metaclass = MeshMeta):
         elif tgeo == "SOLID" or tgeo == "COMPSOLID":
             typ = VOLUME
         elif tgeo == "COMPOUND":
-            try:
-              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)
+            sub = self.geompyD.SubShapeAll( shape, self.geompyD.ShapeType["SHAPE"])
             if not sub:
                 raise ValueError("_groupTypeFromShape(): empty geometric group or compound '%s'" % GetName(shape))
             return self._groupTypeFromShape( sub[0] )
@@ -4449,7 +4452,7 @@ class Mesh(metaclass = MeshMeta):
 
         Returns:
              A list of edge groups and a list of corresponding node groups,
-             where the group is a list of IDs of edges or elements, like follows
+             where the group is a list of IDs of edges or nodes, like follows
              [[[branch_edges_1],[branch_edges_2]], [[branch_nodes_1],[branch_nodes_2]]].
              If a group is closed, the first and last nodes of the group are same.
         """