X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH_SWIG%2FsmeshBuilder.py;h=38fba8060ecffc4cd6cf3d0107a21dd8c083def9;hp=841dacbdbcb34855381dbc8aa0a4befdbac8e414;hb=ed26bf4db7ca95b5fcb33ee167556f841840b98e;hpb=b7a7d49664daa32e1befb558280e13ed0bde37c9;ds=sidebyside diff --git a/src/SMESH_SWIG/smeshBuilder.py b/src/SMESH_SWIG/smeshBuilder.py index 841dacbdb..38fba8060 100644 --- a/src/SMESH_SWIG/smeshBuilder.py +++ b/src/SMESH_SWIG/smeshBuilder.py @@ -611,33 +611,35 @@ class smeshBuilder( SMESH._objref_SMESH_Gen, object ): return SMESH._objref_SMESH_Gen.IsEmbeddedMode(self) def UpdateStudy( self, geompyD = None ): - """ - Update the current study. Calling UpdateStudy() allows to - update meshes at switching GEOM->SMESH - """ + """ + Update the current study. Calling UpdateStudy() allows to + update meshes at switching GEOM->SMESH + """ #self.UpdateStudy() - if not geompyD: + if not geompyD: from salome.geom import geomBuilder geompyD = geomBuilder.geom + if not geompyD: + geompyD = geomBuilder.New() pass - self.geompyD=geompyD - self.SetGeomEngine(geompyD) - SMESH._objref_SMESH_Gen.UpdateStudy(self) - sb = salome.myStudy.NewBuilder() - sc = salome.myStudy.FindComponent("SMESH") - if sc: + self.geompyD=geompyD + self.SetGeomEngine(geompyD) + SMESH._objref_SMESH_Gen.UpdateStudy(self) + sb = salome.myStudy.NewBuilder() + sc = salome.myStudy.FindComponent("SMESH") + if sc: sb.LoadWith(sc, self) - pass + pass def SetEnablePublish( self, theIsEnablePublish ): - """ - Sets enable publishing in the study. Calling SetEnablePublish( false ) allows to - switch OFF publishing in the Study of mesh objects. - """ - #self.SetEnablePublish(theIsEnablePublish) - SMESH._objref_SMESH_Gen.SetEnablePublish(self,theIsEnablePublish) - global notebook - notebook = salome_notebook.NoteBook( theIsEnablePublish ) + """ + Set enable publishing in the study. Calling SetEnablePublish( False ) allows to + switch **off** publishing in the Study of mesh objects. + """ + #self.SetEnablePublish(theIsEnablePublish) + SMESH._objref_SMESH_Gen.SetEnablePublish(self,theIsEnablePublish) + global notebook + notebook = salome_notebook.NoteBook( theIsEnablePublish ) def CreateMeshesFromUNV( self,theFileName ): @@ -1406,7 +1408,7 @@ def New( instance=None, instanceGeom=None): Create a new smeshBuilder instance. The smeshBuilder class provides the Python interface to create or load meshes. - Typical use is: + Typical use is:: import salome salome.salome_init() @@ -1414,14 +1416,18 @@ def New( instance=None, instanceGeom=None): smesh = smeshBuilder.New() Parameters: - isPublished If False, the notebool will not be used. - instance CORBA proxy of SMESH Engine. If None, the default Engine is used. + instance: CORBA proxy of SMESH Engine. If None, the default Engine is used. + instanceGeom: CORBA proxy of GEOM Engine. If None, the default Engine is used. Returns: :class:`smeshBuilder` instance """ global engine global smeshInst global doLcc + if instance and isinstance( instance, SALOMEDS._objref_Study ): + import sys + sys.stderr.write("Warning: 'study' argument is no more needed in smeshBuilder.New(). Consider updating your script!!!\n\n") + instance = None engine = instance if engine is None: doLcc = True @@ -1875,6 +1881,7 @@ class Mesh(metaclass = MeshMeta): continue if ids == subShapeID: shapeText = '"%s"' % subSO.GetName() + break if not shapeText: shape = self.geompyD.GetSubShape( self.GetShape(), [subShapeID]) if shape: @@ -2157,14 +2164,16 @@ class Mesh(metaclass = MeshMeta): Parameters: fileName: is the file name auto_groups (boolean): parameter for creating/not creating - the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; - the typical use is auto_groups=False. + the groups Group_On_All_Nodes, Group_On_All_Faces, ... ; + the typical use is auto_groups=False. overwrite (boolean): parameter for overwriting/not overwriting the file - meshPart: a part of mesh (group, sub-mesh) to export instead of the mesh - autoDimension if @c True (default), a space dimension of a MED mesh can be either - - 1D if all mesh nodes lie on OX coordinate axis, or - - 2D if all mesh nodes lie on XOY coordinate plane, or - - 3D in the rest cases. + meshPart: a part of mesh (:class:`sub-mesh, group or filter `) to export instead of the mesh + autoDimension: if *True* (default), a space dimension of a MED mesh can be either + + - 1D if all mesh nodes lie on OX coordinate axis, or + - 2D if all mesh nodes lie on XOY coordinate plane, or + - 3D in the rest cases. + If *autoDimension* is *False*, the space dimension is always 3. fields: list of GEOM fields defined on the shape to mesh. geomAssocFields: each character of this string means a need to export a @@ -2366,7 +2375,7 @@ class Mesh(metaclass = MeshMeta): - 3D in the rest cases. If **autoDimension** is *False*, the space dimension is always 3. - """ + """ print("WARNING: ExportToMEDX() is deprecated, use ExportMED() instead") # process positional arguments @@ -6034,7 +6043,7 @@ class Mesh(metaclass = MeshMeta): def FindCoincidentNodesOnPart (self, SubMeshOrGroup, Tolerance, exceptNodes=[], SeparateCornerAndMediumNodes=False): """ - Find groups of ajacent nodes within Tolerance. + Find groups of adjacent nodes within Tolerance. Parameters: Tolerance: the value of tolerance @@ -6311,7 +6320,7 @@ class Mesh(metaclass = MeshMeta): a :class:`Mesh`, elements of highest dimension are duplicated theGroupName: a name of group to contain the generated elements. If a group with such a name already exists, the new elements - are added to the existng group, else a new group is created. + are added to the existing group, else a new group is created. If *theGroupName* is empty, new elements are not added in any group. @@ -7053,7 +7062,6 @@ class algoCreator: algoType = sorted( self.algoTypeToClass.keys() )[0] if algoType in self.algoTypeToClass: #print("Create algo",algoType) - return self.algoTypeToClass[ algoType ]( self.mesh, shape ) raise RuntimeError( "No class found for algo type %s" % algoType) return None