+ if verbose: print("save hypothesis in Object Browser")
+
+ name = "MGSurfOpt"
+ #how ??? icon = "mesh_tree_hypo.png"
+ namei = "MGSurfOpt Parameters_%i" % self.num
+ datai = self.getResumeData(separator=" ; ")
+
+ myStudy = salome.myStudy
+ myBuilder = myStudy.NewBuilder()
+ #myStudy.IsStudyLocked()
+ myComponent = myStudy.FindComponent(name)
+ if myComponent == None:
+ print("myComponent not found, create")
+ myComponent = myBuilder.NewComponent(name)
+ AName = myBuilder.FindOrCreateAttribute(myComponent, "AttributeName")
+ AName.SetValue(name)
+ ACmt = myBuilder.FindOrCreateAttribute(myComponent, "AttributeComment")
+ ACmt.SetValue(name)
+
+ myObject = myBuilder.NewObject(myComponent)
+ AName = myBuilder.FindOrCreateAttribute(myObject, "AttributeName")
+ AName.SetValue(namei)
+ ACmt = myBuilder.FindOrCreateAttribute(myObject, "AttributeComment")
+ ACmt.SetValue(datai)
+
+ if salome.sg.hasDesktop(): salome.sg.updateObjBrowser()
+ self.num += 1
+ if verbose: print(("save %s in Object Browser done: %s\n%s" % (name, myObject.GetID(), datai)))
+ return True
+
+ def PBSaveHypPressed(self):
+ """
+ save hypothesis in Object Browser
+ bug: affichage ne marche pas si inclusion dans dans GEOM ou MESH depuis salome 730
+ """