return aMeshes, aStatus
## Creates a Mesh object importing data from the given GMF file.
- # GMF files have .mesh extension for the ASCII format and .meshb for
- # the bynary format.
+ # GMF files must have .mesh extension for the ASCII format and .meshb for
+ # the binary format.
# @return [ an instance of Mesh class, SMESH.ComputeError ]
# @ingroup l2_impexp
def CreateMeshesFromGMF( self, theFileName ):
return result
## Get sum of lengths of all 1D elements in the mesh object.
- # @param elemId obj mesh, submesh or group
+ # @param obj mesh, submesh or group
# @return sum of lengths of all 1D elements
# @ingroup l1_measurements
def GetLength(self, obj):
return value
## Get sum of areas of all 2D elements in the mesh object.
- # @param elemId obj mesh, submesh or group
+ # @param obj mesh, submesh or group
# @return sum of areas of all 2D elements
# @ingroup l1_measurements
def GetArea(self, obj):
return value
## Get sum of volumes of all 3D elements in the mesh object.
- # @param elemId obj mesh, submesh or group
+ # @param obj mesh, submesh or group
# @return sum of volumes of all 3D elements
# @ingroup l1_measurements
def GetVolume(self, obj):
else:
geo_name = "%s_%s to mesh"%(self.geom.GetShapeType(), id(self.geom)%100)
geompyD.addToStudy( self.geom, geo_name )
- self.mesh = self.smeshpyD.CreateMesh(self.geom)
+ self.SetMesh( self.smeshpyD.CreateMesh(self.geom) )
elif isinstance(obj, SMESH._objref_SMESH_Mesh):
self.SetMesh(obj)
else:
- self.mesh = self.smeshpyD.CreateEmptyMesh()
+ self.SetMesh( self.smeshpyD.CreateEmptyMesh() )
if name:
self.smeshpyD.SetName(self.mesh, name)
elif objHasName:
if isinstance( attr, algoCreator ):
#print "algoCreator ", attrName
setattr( self, attrName, attr.copy( self ))
+ pass
+ pass
+ pass
+ ## Destructor. Clean-up resources
+ def __del__(self):
+ if self.mesh:
+ #self.mesh.UnRegister()
+ pass
+ pass
+
## Initializes the Mesh object from an instance of SMESH_Mesh interface
# @param theMesh a SMESH_Mesh object
# @ingroup l2_construct
def SetMesh(self, theMesh):
- if self.mesh: self.mesh.UnRegister()
+ # do not call Register() as this prevents mesh servant deletion at closing study
+ #if self.mesh: self.mesh.UnRegister()
self.mesh = theMesh
if self.mesh:
- self.mesh.Register()
+ #self.mesh.Register()
self.geom = self.mesh.GetShapeToMesh()
+ pass
## Returns the mesh, that is an instance of SMESH_Mesh interface
# @return a SMESH_Mesh object
# the new mesh else only boundary elements will be copied into the new mesh
# @param toCopyExistingBondary - if true, not only new but also pre-existing
# boundary elements will be copied into the new mesh
- # @return tuple (mesh, group) where bondary elements were added to
+ # @return tuple (mesh, group) where boundary elements were added to
# @ingroup l2_modif_edit
def MakeBoundaryMesh(self, elements, dimension=SMESH.BND_2DFROM3D, groupName="", meshName="",
toCopyElements=False, toCopyExistingBondary=False):
self.mesh.SetParameters(Parameters)
return Mesh( self.smeshpyD, self.geompyD, mesh )
- ## Finds groups of ajacent nodes within Tolerance.
+ ## Finds groups of adjacent nodes within Tolerance.
# @param Tolerance the value of tolerance
- # @return the list of groups of nodes
+ # @return the list of pairs of nodes IDs (e.g. [[1,12],[25,4]])
# @ingroup l2_modif_trsf
def FindCoincidentNodes (self, Tolerance):
return self.editor.FindCoincidentNodes(Tolerance)
# @param Tolerance the value of tolerance
# @param SubMeshOrGroup SubMesh or Group
# @param exceptNodes list of either SubMeshes, Groups or node IDs to exclude from search
- # @return the list of groups of nodes
+ # @return the list of pairs of nodes IDs (e.g. [[1,12],[25,4]])
# @ingroup l2_modif_trsf
def FindCoincidentNodesOnPart (self, SubMeshOrGroup, Tolerance, exceptNodes=[]):
unRegister = genObjUnRegister()
return self.editor.FindCoincidentNodesOnPartBut(SubMeshOrGroup, Tolerance,exceptNodes)
## Merges nodes
- # @param GroupsOfNodes the list of groups of nodes
+ # @param GroupsOfNodes a list of pairs of nodes IDs for merging (e.g. [[1,12],[25,4]])
# @ingroup l2_modif_trsf
def MergeNodes (self, GroupsOfNodes):
self.editor.MergeNodes(GroupsOfNodes)
## Finds the elements built on the same nodes.
# @param MeshOrSubMeshOrGroup Mesh or SubMesh, or Group of elements for searching
- # @return a list of groups of equal elements
+ # @return the list of pairs of equal elements IDs (e.g. [[1,12],[25,4]])
# @ingroup l2_modif_trsf
def FindEqualElements (self, MeshOrSubMeshOrGroup):
if ( isinstance( MeshOrSubMeshOrGroup, Mesh )):
return self.editor.FindEqualElements(MeshOrSubMeshOrGroup)
## Merges elements in each given group.
- # @param GroupsOfElementsID groups of elements for merging
+ # @param GroupsOfElementsID a list of pairs of elements IDs for merging (e.g. [[1,12],[25,4]])
# @ingroup l2_modif_trsf
def MergeElements(self, GroupsOfElementsID):
self.editor.MergeElements(GroupsOfElementsID)
try:
exec( "from salome.%s.%s import *" % (pluginName, pluginBuilderName))
except Exception, e:
- print "Exception while loading %s: %s" % ( pluginBuilderName, e )
+ from salome_utils import verbose
+ if verbose(): print "Exception while loading %s: %s" % ( pluginBuilderName, e )
continue
exec( "from salome.%s import %s" % (pluginName, pluginBuilderName))
plugin = eval( pluginBuilderName )