]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
bos #19182: GEOM appears in Object browser when calling SMESH from python
authorjfa <jfa@opencascade.com>
Wed, 27 May 2020 12:01:53 +0000 (15:01 +0300)
committerjfa <jfa@opencascade.com>
Wed, 27 May 2020 12:01:53 +0000 (15:01 +0300)
src/GEOM_SWIG/geomBuilder.py

index 727b9761fd40801850f0a137e321ce681d656a5e..af56238e9d1fa2af8e20d2003b7202ce4c0880c8 100644 (file)
@@ -836,17 +836,11 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
             self.myStudy = salome.myStudy
             self.myBuilder = self.myStudy.NewBuilder()
             self.father = self.myStudy.FindComponent("GEOM")
-            notebook.myStudy = salome.myStudy
-            if self.father is None:
-                self.father = self.myBuilder.NewComponent("GEOM")
-                A1 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributeName")
-                FName = A1._narrow(SALOMEDS.AttributeName)
-                FName.SetValue("Geometry")
-                A2 = self.myBuilder.FindOrCreateAttribute(self.father, "AttributePixMap")
-                aPixmap = A2._narrow(SALOMEDS.AttributePixMap)
-                aPixmap.SetPixMap("ICON_OBJBROWSER_Geometry")
-                self.myBuilder.DefineComponentInstance(self.father,self)
-                pass
+
+            # load data from the study file, if necessary
+            if self.father:
+                self.myBuilder.LoadWith(self.father, self)
+
             self.BasicOp  = self.GetIBasicOperations    ()
             self.CurvesOp = self.GetICurvesOperations   ()
             self.PrimOp   = self.GetI3DPrimOperations   ()
@@ -866,8 +860,7 @@ class geomBuilder(GEOM._objref_GEOM_Gen):
             self.myUseCaseBuilder.SetRootCurrent()
             self.myUseCaseBuilder.Append(self.father)
 
-            # load data from the study file, if necessary
-            self.myBuilder.LoadWith(self.father, self)
+            notebook.myStudy = salome.myStudy
             pass
 
         def GetPluginOperations(self, libraryName):