Esempio n. 1
0
    def register(self, mod):
        """
        Registers the module.
        """
        
        verifyClass(IModule, type(mod))

        self._registry[mod.name] = mod
        self._mod_type_reg.setdefault(type(mod),[]).append(mod)
Esempio n. 2
0
    def register(self, mod):
        """
        Registers the module.
        """

        verifyClass(IModule, type(mod))

        self._registry[mod.name] = mod
        self._mod_type_reg.setdefault(type(mod), []).append(mod)
Esempio n. 3
0
 def init(self, parent, name, scene, direction, min_force, max_force,
          material, position = Ogre.Vector3.ZERO, 
          orientation = Ogre.Quaternion.IDENTITY,
          scale = Ogre.Vector3(1,1,1)):
     
     core.verifyClass(IPart, parent)
     #Visual.init(self, parent, name, scene, mesh, material, position, 
     #            orietnation, scale)
     # Switch me back after the scene node issue is fixed
     Object.init(parent, name)
     
     Thruster._create(self, scene, min_force, max_force, direction, mesh, 
                      material, position, orientation, scale)
Esempio n. 4
0
    def _create_object(self, node, iface, parent = None):
        
        _class = core.Component.get_class(iface, node['type'])
        core.verifyClass(IKMLStorable, _class)
 
        # Build parameters to pass to __init__ 
        kwargs = {}
        
        # General parameters
        kwargs['name'] = node['name']
        kwargs['position'] = node['position']
        kwargs['orientation'] = Quat(node['orientation'], axis_angle = True)
        
        # Get all the class specific arguments
        kwargs.update(_class.kml_load(node))
        
        # Create the class    
        return _class(**kwargs)    
Esempio n. 5
0
    def _create_object(self, node, iface, parent=None):

        _class = core.Component.get_class(iface, node['type'])
        core.verifyClass(IKMLStorable, _class)

        # Build parameters to pass to __init__
        kwargs = {}

        # General parameters
        kwargs['name'] = node['name']
        kwargs['position'] = node['position']
        kwargs['orientation'] = Quat(node['orientation'], axis_angle=True)

        # Get all the class specific arguments
        kwargs.update(_class.kml_load(node))

        # Create the class
        return _class(**kwargs)
Esempio n. 6
0
    def init(self,
             parent,
             name,
             scene,
             direction,
             min_force,
             max_force,
             material,
             position=Ogre.Vector3.ZERO,
             orientation=Ogre.Quaternion.IDENTITY,
             scale=Ogre.Vector3(1, 1, 1)):

        core.verifyClass(IPart, parent)
        #Visual.init(self, parent, name, scene, mesh, material, position,
        #            orietnation, scale)
        # Switch me back after the scene node issue is fixed
        Object.init(parent, name)

        Thruster._create(self, scene, min_force, max_force, direction, mesh,
                         material, position, orientation, scale)