Пример #1
0
def kernelEngine( kernel, binding = "BoostPythonBinding" ):
    """render the c++ engine of the given kernel
    
    This factory method can only deal with kernels, but not scatterers.
    """
    from bindings import classes as bindingClasses
    binding = bindingClasses() [ binding ] ()
    
    from KernelComputationEngineFactory import KernelComputationEngineFactory
    factory = KernelComputationEngineFactory( binding )
    from KernelComputationEngineRenderer import KernelComputationEngineRenderer
    return KernelComputationEngineRenderer( factory ).render( kernel )
Пример #2
0
def kernelEngine(kernel, binding="BoostPythonBinding"):
    """render the c++ engine of the given kernel
    
    This factory method can only deal with kernels, but not scatterers.
    """
    from bindings import classes as bindingClasses
    binding = bindingClasses()[binding]()

    from KernelComputationEngineFactory import KernelComputationEngineFactory
    factory = KernelComputationEngineFactory(binding)
    from KernelComputationEngineRenderer import KernelComputationEngineRenderer
    return KernelComputationEngineRenderer(factory).render(kernel)
Пример #3
0
def shapeEngine(shape,
                binding="BoostPythonBinding",
                orientation_convention="McStasConvention"):

    "render the c++ engine of the given shape"

    from bindings import classes as bindingClasses
    bindingClass = bindingClasses()[binding]
    binding = bindingClass()

    from orientation_conventions import classes
    conventionClass = classes()[orientation_convention]
    orientation_convention = conventionClass()

    from ShapeComputationEngineFactory import ShapeComputationEngineFactory
    factory = ShapeComputationEngineFactory(binding, orientation_convention)
    from ShapeComputationEngineRenderer import ShapeComputationEngineRenderer
    return ShapeComputationEngineRenderer(factory).render(shape)
Пример #4
0
def shapeEngine(
    shape,
    binding = "BoostPythonBinding",
    orientation_convention = "McStasConvention" ):
    
    "render the c++ engine of the given shape"
    
    from bindings import classes as bindingClasses
    bindingClass = bindingClasses()[ binding ]
    binding = bindingClass()

    from orientation_conventions import classes
    conventionClass = classes()[ orientation_convention ]
    orientation_convention = conventionClass()

    from ShapeComputationEngineFactory import ShapeComputationEngineFactory
    factory = ShapeComputationEngineFactory( binding, orientation_convention )
    from ShapeComputationEngineRenderer import ShapeComputationEngineRenderer
    return ShapeComputationEngineRenderer( factory ).render( shape )