]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
Fix bug in structural element generation when reference geom object is already a...
authorbarate <barate>
Tue, 15 May 2012 09:49:22 +0000 (09:49 +0000)
committerbarate <barate>
Tue, 15 May 2012 09:49:22 +0000 (09:49 +0000)
src/GEOM_PY/structelem/parts.py

index 9a4ba87b29ff0892dc82fc12687f41a5366426f8..538724268868689dd83c71af3bd7ad6a14b70d8b 100644 (file)
@@ -137,11 +137,13 @@ class StructuralElementPart:
         self.name = name
         self.geom = getGeompy(studyId)
         self.baseShapesSet = set()
-        mainShape = self.geom.GetMainShape(groupGeomObj)
-        listIDs = self.geom.GetObjectIDs(groupGeomObj)
-        if mainShape is not None and listIDs is not None:
-            for id in listIDs:
-                self.baseShapesSet.add(SubShapeID(mainShape, id))
+        self.isMainShape = groupGeomObj.IsMainShape()
+        if not self.isMainShape:
+            mainShape = self.geom.GetMainShape(groupGeomObj)
+            listIDs = self.geom.GetObjectIDs(groupGeomObj)
+            if mainShape is not None and listIDs is not None:
+                for id in listIDs:
+                    self.baseShapesSet.add(SubShapeID(mainShape, id))
         self.color = color
         if self.color is None:
             self.color = self._groupGeomObj.GetColor()
@@ -235,6 +237,8 @@ class StructuralElementPart:
         """
         Find and return the base sub-shapes in the structural element part.
         """
+        if self.isMainShape:
+            return [self._groupGeomObj]
         subShapes = []
         for subShapeID in self.baseShapesSet:
             subShape = subShapeID.getObj(self.geom)