Back to index

salome-smesh  6.5.0
Public Member Functions | Public Attributes
smeshDC.algoCreator Class Reference

Private class used to bind methods creating algorithms to the class Mesh. More...

List of all members.

Public Member Functions

def __init__
def add
def copy
def __call__

Public Attributes

 mesh
 defaultAlgoType
 algoTypeToClass

Detailed Description

Private class used to bind methods creating algorithms to the class Mesh.

Definition at line 4321 of file smeshDC.py.


Constructor & Destructor Documentation

Definition at line 4322 of file smeshDC.py.

04322 
04323     def __init__(self):
04324         self.mesh = None
04325         self.defaultAlgoType = ""
04326         self.algoTypeToClass = {}


Member Function Documentation

def smeshDC.algoCreator.__call__ (   self,
  algo = "",
  geom = 0,
  args 
)

Definition at line 4346 of file smeshDC.py.

04346 
04347     def __call__(self,algo="",geom=0,*args):
04348         algoType = self.defaultAlgoType
04349         for arg in args + (algo,geom):
04350             if isinstance( arg, geompyDC.GEOM._objref_GEOM_Object ):
04351                 geom = arg
04352             if isinstance( arg, str ) and arg:
04353                 algoType = arg
04354         if not algoType and self.algoTypeToClass:
04355             algoType = self.algoTypeToClass.keys()[0]
04356         if self.algoTypeToClass.has_key( algoType ):
04357             #print "Create algo",algoType
04358             return self.algoTypeToClass[ algoType ]( self.mesh, geom )
04359         raise RuntimeError, "No class found for algo type %s" % algoType
04360         return None
04361 
# Private class used to substitute and store variable parameters of hypotheses.
def smeshDC.algoCreator.add (   self,
  algoClass 
)

Definition at line 4328 of file smeshDC.py.

04328 
04329     def add(self, algoClass):
04330         if type( algoClass ).__name__ == 'classobj' and \
04331            hasattr( algoClass, "algoType"):
04332             self.algoTypeToClass[ algoClass.algoType ] = algoClass
04333             if not self.defaultAlgoType and \
04334                hasattr( algoClass, "isDefault") and algoClass.isDefault:
04335                 self.defaultAlgoType = algoClass.algoType
04336             #print "Add",algoClass.algoType, "dflt",self.defaultAlgoType

def smeshDC.algoCreator.copy (   self,
  mesh 
)

Definition at line 4338 of file smeshDC.py.

04338 
04339     def copy(self, mesh):
04340         other = algoCreator()
04341         other.defaultAlgoType = self.defaultAlgoType
04342         other.algoTypeToClass  = self.algoTypeToClass
04343         other.mesh = mesh
04344         return other


Member Data Documentation

Definition at line 4325 of file smeshDC.py.

Definition at line 4324 of file smeshDC.py.

Definition at line 4323 of file smeshDC.py.


The documentation for this class was generated from the following file: