X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_PY%2Fsmeshstudytools.py;h=87cfb16792c7477fd8f6f6be16478115fdfb34e0;hp=7d4277211ec398178d493b6968f0bd3ebd7cd326;hb=8d297d6698f361d4f2dde723050bcfbaea050920;hpb=43f41f0c11ce8e843ca6b0abac6f6f36c11d72b3 diff --git a/src/SMESH_PY/smeshstudytools.py b/src/SMESH_PY/smeshstudytools.py index 7d4277211..87cfb1679 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 @@ -29,7 +29,7 @@ # \} """ -This module provides a new class :class:`SMeshStudyTools` to facilitate the +This module provides a class :class:`SMeshStudyTools` to facilitate the use of mesh objects in Salome study. """ @@ -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,7 +125,7 @@ class SMeshStudyTools: return None import SMESH from salome.smesh import smeshBuilder - smesh = smeshBuilder.New(self.editor.study) + smesh = smeshBuilder.New() meshObject=salome.IDToObject(entry) return smesh.Mesh( meshObject ) @@ -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: