From: rnv Date: Thu, 22 Jun 2017 14:32:06 +0000 (+0300) Subject: Merge Python 3 porting. X-Git-Tag: V9_0_0~7 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7e5424a12a7f6894a5b9a029fd8251f2cb5780b8;p=modules%2Fgui.git Merge Python 3 porting. --- 7e5424a12a7f6894a5b9a029fd8251f2cb5780b8 diff --cc src/SalomeApp/pluginsdemo/tubebuilder.py index e121161c0,cd231842e..44e7ec508 --- a/src/SalomeApp/pluginsdemo/tubebuilder.py +++ b/src/SalomeApp/pluginsdemo/tubebuilder.py @@@ -32,8 -32,9 +32,8 @@@ def createGeometry(radius=DEFAULT_RADIU This function creates the geometry on the specified study and with given parameters. ''' - print "TUBE: creating the geometry ..." + print("TUBE: creating the geometry ...") - studyId = study._get_StudyId() - geompy = geomtools.getGeompy(studyId) + geompy = geomtools.getGeompy() radius_ext = radius radius_int = radius_ext - width @@@ -52,20 -53,21 +52,20 @@@ def createGeometryWithPartition(radius= # We have to create a partition so that we can use an hexaedric # meshing algorithm. - studyId = study._get_StudyId() - geompy = geomtools.getGeompy(studyId) + geompy = geomtools.getGeompy() - print "TUBE: creating a partition ..." + print("TUBE: creating a partition ...") toolPlane = geompy.MakeFaceHW(2.1*length,2.1*radius,3) partition = geompy.MakePartition([shape], [toolPlane], [], [], geompy.ShapeType["SOLID"], 0, [], 0) entry = geompy.addToStudy( partition, "TubeWithPartition" ) return partition -def createMesh(study, shape): - '''This function creates the mesh of the specified shape on the specified study''' +def createMesh(shape): + '''This function creates the mesh of the specified shape on the current study''' - print "TUBE: creating the mesh ..." + print("TUBE: creating the mesh ...") import SMESH from salome.smesh import smeshBuilder - smesh = smeshBuilder.New(study) + smesh = smeshBuilder.New() mesh = smesh.Mesh(shape) Regular_1D = mesh.Segment()