import SALOMEDS
import os
+class MeshMeta(type):
+ def __instancecheck__(cls, inst):
+ """Implement isinstance(inst, cls)."""
+ return any(cls.__subclasscheck__(c)
+ for c in {type(inst), inst.__class__})
+
+ def __subclasscheck__(cls, sub):
+ """Implement issubclass(sub, cls)."""
+ return type.__subclasscheck__(cls, sub) or (cls.__name__ == sub.__name__ and cls.__module__ == sub.__module__)
+
## @addtogroup l1_auxiliary
## @{
# new nodes and elements and by changing the existing entities), to get information
# about a mesh and to export a mesh into different formats.
class Mesh:
+ __metaclass__ = MeshMeta
geom = 0
mesh = 0
def RemoveGroupWithContents(self, group):
self.mesh.RemoveGroupWithContents(group)
- ## Gets the list of groups existing in the mesh
+ ## Gets the list of groups existing in the mesh in the order of creation (starting from the oldest one)
# @return a sequence of SMESH_GroupBase
# @ingroup l2_grps_create
def GetGroups(self):
pass
# axis
if isinstance( startHexPoint, geomBuilder.GEOM._objref_GEOM_Object):
- startHexPoint = self.geompyD.PointCoordinates( startHexPoint )
+ startHexPoint = self.smeshpyD.GetPointStruct( startHexPoint )
+ elif isinstance( startHexPoint, list ):
+ startHexPoint = SMESH.PointStruct( startHexPoint[0],
+ startHexPoint[1],
+ startHexPoint[2])
if isinstance( facetNormal, geomBuilder.GEOM._objref_GEOM_Object):
- facetNormal = self.geompyD.VectorCoordinates( facetNormal )
- axis = SMESH.AxisStruct( startHexPoint[0], startHexPoint[1], startHexPoint[2],
- facetNormal[0], facetNormal[1], facetNormal[2])
- self.mesh.SetParameters( axis.parameters )
+ facetNormal = self.smeshpyD.GetDirStruct( facetNormal )
+ elif isinstance( facetNormal, list ):
+ facetNormal = self.smeshpyD.MakeDirStruct( facetNormal[0],
+ facetNormal[1],
+ facetNormal[2])
+ self.mesh.SetParameters( startHexPoint.parameters + facetNormal.PS.parameters )
- self.editor.SplitHexahedraIntoPrisms(elems, method, axis, allDomains)
+ self.editor.SplitHexahedraIntoPrisms(elems, startHexPoint, facetNormal, method, allDomains)
## Splits quadrangle faces near triangular facets of volumes
#
return self._valueFromFunctor(SMESH.FT_Skew, elemId)
pass # end of Mesh class
-
+
## Helper class for wrapping of SMESH.SMESH_Pattern CORBA class
#
class Pattern(SMESH._objref_SMESH_Pattern):