Fix bug 18122: 'Name Error' from some functions of smeshDC.Mesh class.

This commit is contained in:
jfa 2007-12-07 13:48:11 +00:00
parent bee39a08f4
commit 4d2bf97770

View File

@ -172,7 +172,7 @@ class smeshDC(SMESH._objref_SMESH_Gen):
## Make DirStruct from a triplet ## Make DirStruct from a triplet
# @param x,y,z are vector components # @param x,y,z are vector components
# @return SMESH.DirStruct # @return SMESH.DirStruct
def MakeDirStruct(x,y,z): def MakeDirStruct(self,x,y,z):
pnt = PointStruct(x,y,z) pnt = PointStruct(x,y,z)
return DirStruct(pnt) return DirStruct(pnt)
@ -2149,7 +2149,7 @@ class Mesh:
# @param Shape is geom object(subshape) IOR # @param Shape is geom object(subshape) IOR
# Shape must be subshape of a ShapeToMesh() # Shape must be subshape of a ShapeToMesh()
def GetSubMeshElementsId(self, Shape): def GetSubMeshElementsId(self, Shape):
if ( isinstance( Shape, geompy.GEOM._objref_GEOM_Object)): if ( isinstance( Shape, geompyDC.GEOM._objref_GEOM_Object)):
ShapeID = Shape.GetSubShapeIndices()[0] ShapeID = Shape.GetSubShapeIndices()[0]
else: else:
ShapeID = Shape ShapeID = Shape
@ -2159,7 +2159,7 @@ class Mesh:
# @param Shape is geom object(subshape) IOR # @param Shape is geom object(subshape) IOR
# Shape must be subshape of a ShapeToMesh() # Shape must be subshape of a ShapeToMesh()
def GetSubMeshNodesId(self, Shape, all): def GetSubMeshNodesId(self, Shape, all):
if ( isinstance( Shape, geompy.GEOM._objref_GEOM_Object)): if ( isinstance( Shape, geompyDC.GEOM._objref_GEOM_Object)):
ShapeID = Shape.GetSubShapeIndices()[0] ShapeID = Shape.GetSubShapeIndices()[0]
else: else:
ShapeID = Shape ShapeID = Shape
@ -2169,7 +2169,7 @@ class Mesh:
# @param Shape is geom object(subshape) IOR # @param Shape is geom object(subshape) IOR
# Shape must be subshape of a ShapeToMesh() # Shape must be subshape of a ShapeToMesh()
def GetSubMeshElementType(self, Shape): def GetSubMeshElementType(self, Shape):
if ( isinstance( Shape, geompy.GEOM._objref_GEOM_Object)): if ( isinstance( Shape, geompyDC.GEOM._objref_GEOM_Object)):
ShapeID = Shape.GetSubShapeIndices()[0] ShapeID = Shape.GetSubShapeIndices()[0]
else: else:
ShapeID = Shape ShapeID = Shape
@ -2327,7 +2327,7 @@ class Mesh:
# @param Vertex - vertex or vertex ID # @param Vertex - vertex or vertex ID
# @return True if succeed else raise an exception # @return True if succeed else raise an exception
def SetNodeOnVertex(self, NodeID, Vertex): def SetNodeOnVertex(self, NodeID, Vertex):
if ( isinstance( Vertex, geompy.GEOM._objref_GEOM_Object)): if ( isinstance( Vertex, geompyDC.GEOM._objref_GEOM_Object)):
VertexID = Vertex.GetSubShapeIndices()[0] VertexID = Vertex.GetSubShapeIndices()[0]
else: else:
VertexID = Vertex VertexID = Vertex
@ -2344,7 +2344,7 @@ class Mesh:
# @param paramOnEdge - parameter on edge where the node is located # @param paramOnEdge - parameter on edge where the node is located
# @return True if succeed else raise an exception # @return True if succeed else raise an exception
def SetNodeOnEdge(self, NodeID, Edge, paramOnEdge): def SetNodeOnEdge(self, NodeID, Edge, paramOnEdge):
if ( isinstance( Edge, geompy.GEOM._objref_GEOM_Object)): if ( isinstance( Edge, geompyDC.GEOM._objref_GEOM_Object)):
EdgeID = Edge.GetSubShapeIndices()[0] EdgeID = Edge.GetSubShapeIndices()[0]
else: else:
EdgeID = Edge EdgeID = Edge
@ -2361,7 +2361,7 @@ class Mesh:
# @param v - V parameter on face where the node is located # @param v - V parameter on face where the node is located
# @return True if succeed else raise an exception # @return True if succeed else raise an exception
def SetNodeOnFace(self, NodeID, Face, u, v): def SetNodeOnFace(self, NodeID, Face, u, v):
if ( isinstance( Face, geompy.GEOM._objref_GEOM_Object)): if ( isinstance( Face, geompyDC.GEOM._objref_GEOM_Object)):
FaceID = Face.GetSubShapeIndices()[0] FaceID = Face.GetSubShapeIndices()[0]
else: else:
FaceID = Face FaceID = Face
@ -2376,7 +2376,7 @@ class Mesh:
# @param Solid - solid or solid ID # @param Solid - solid or solid ID
# @return True if succeed else raise an exception # @return True if succeed else raise an exception
def SetNodeInVolume(self, NodeID, Solid): def SetNodeInVolume(self, NodeID, Solid):
if ( isinstance( Solid, geompy.GEOM._objref_GEOM_Object)): if ( isinstance( Solid, geompyDC.GEOM._objref_GEOM_Object)):
SolidID = Solid.GetSubShapeIndices()[0] SolidID = Solid.GetSubShapeIndices()[0]
else: else:
SolidID = Solid SolidID = Solid
@ -2391,7 +2391,7 @@ class Mesh:
# @param Shape - shape or shape ID # @param Shape - shape or shape ID
# @return True if succeed else raise an exception # @return True if succeed else raise an exception
def SetMeshElementOnShape(self, ElementID, Shape): def SetMeshElementOnShape(self, ElementID, Shape):
if ( isinstance( Shape, geompy.GEOM._objref_GEOM_Object)): if ( isinstance( Shape, geompyDC.GEOM._objref_GEOM_Object)):
ShapeID = Shape.GetSubShapeIndices()[0] ShapeID = Shape.GetSubShapeIndices()[0]
else: else:
ShapeID = Shape ShapeID = Shape