PAL8626: do not publish GEOM object, already present in the study.

This commit is contained in:
jfa 2005-04-25 06:09:31 +00:00
parent bf8dd8ada1
commit b646c942cc

View File

@ -46,9 +46,14 @@ smesh.SetCurrentStudy(salome.myStudy)
# Private functions # Private functions
# ----------------- # -----------------
NO_NAME = "NoName"
def GetName(obj): def GetName(obj):
ior = salome.orb.object_to_string(obj) ior = salome.orb.object_to_string(obj)
sobj = salome.myStudy.FindObjectIOR(ior) sobj = salome.myStudy.FindObjectIOR(ior)
if sobj is None:
return NO_NAME
else:
attr = sobj.FindAttribute("AttributeName")[1] attr = sobj.FindAttribute("AttributeName")[1]
return attr.Value() return attr.Value()
@ -91,6 +96,8 @@ class Mesh_Algorithm:
name = GetName(piece) name = GetName(piece)
else: else:
self.geom = geom self.geom = geom
name = GetName(geom)
if name==NO_NAME:
name = geompy.SubShapeName(geom, piece) name = geompy.SubShapeName(geom, piece)
geompy.addToStudyInFather(piece, geom, name) geompy.addToStudyInFather(piece, geom, name)
self.subm = mesh.mesh.GetSubMesh(geom, hypo) self.subm = mesh.mesh.GetSubMesh(geom, hypo)