X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_PY%2Fsmeshstudytools.py;h=c80998ee94c76d0960779659ab3878558bdf5fe1;hp=51bcc356773f266caad8bc13754f4729aac1ccbd;hb=bd7477efc255f965c479d88d1be1ee3dbf4aa760;hpb=251f8c052dd12dd29922210dc901b295fe999a0e diff --git a/src/SMESH_PY/smeshstudytools.py b/src/SMESH_PY/smeshstudytools.py index 51bcc3567..c80998ee9 100644 --- a/src/SMESH_PY/smeshstudytools.py +++ b/src/SMESH_PY/smeshstudytools.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # -# Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public @@ -77,12 +77,12 @@ class SMeshStudyTools: ## This function updates the tools so that it works on the # specified study. - def updateStudy(self, studyId=None): + def updateStudy(self): """ This function updates the tools so that it works on the specified study. """ - self.editor = getStudyEditor(studyId) + self.editor = getStudyEditor() ## Get the mesh item owning the mesh group \em meshGroupItem. # \param meshGroupItem (SObject) mesh group belonging to the searched mesh. @@ -125,10 +125,10 @@ class SMeshStudyTools: return None import SMESH from salome.smesh import smeshBuilder - smesh = smeshBuilder.New(self.editor.study) + smesh = smeshBuilder.New() - meshObject=smesh.IDToObject(entry) - return meshObject + meshObject=salome.IDToObject(entry) + return smesh.Mesh( meshObject ) ## Returns the SMESH object associated to the specified \em SObject, # (the SObject is an item in the objects browser). @@ -155,7 +155,7 @@ class SMeshStudyTools: self.smeshGui = salome.ImportComponentGUI("SMESH") if not helper.SalomeGUI.hasDesktop(): - print "displayMeshObject: no desktop available" + print("displayMeshObject: no desktop available") return self.smeshGui.CreateAndDisplayActor(entry) @@ -183,17 +183,16 @@ class SMeshStudyTools: def TEST_createBoxMesh(): - theStudy = helper.getActiveStudy() import GEOM from salome.geom import geomBuilder - geompy = geomBuilder.New(theStudy) + geompy = geomBuilder.New() box = geompy.MakeBoxDXDYDZ(200, 200, 200) import SMESH, SALOMEDS from salome.smesh import smeshBuilder - smesh = smeshBuilder.New(theStudy) + smesh = smeshBuilder.New() from salome.StdMeshers import StdMeshersBuilder boxmesh = smesh.Mesh(box) @@ -207,7 +206,7 @@ def TEST_createBoxMesh(): smesh.SetName(boxmesh.GetMesh(), 'boxmesh') if salome.sg.hasDesktop(): - salome.sg.updateObjBrowser(1) + salome.sg.updateObjBrowser() # # Definitions: