Changeset 1212

Show
Ignore:
Timestamp:
03/28/08 17:49:25 (9 months ago)
Author:
JonNeal
Message:

Ticket #950: Cleaned up all files to comply with organisation standards, soy._core and NormalizationCubeMap? ommited.

Location:
trunk/pysoy/src
Files:
47 modified

Legend:

Unmodified
Added
Removed
  • trunk/pysoy/src/_datatypes/AudioDeviceTuple.pxi

    r1191 r1212  
    5656    slice of one of those two classes. 
    5757  ''' 
     58   
     59  ############################################################################ 
     60  # 
     61  # Python functions 
     62  # 
     63   
    5864  def __cinit__(self) : 
    5965    self._slice = slice(None) 
     
    123129    else : 
    124130      return '(%s)' % _string[:-2] 
    125  
    126      
    127   # C Functions 
     131   
     132  ############################################################################ 
     133  # 
     134  # C functions 
     135  # 
     136   
    128137  cdef int _get(self, char* _devices, int _index) : 
    129138    cdef int _i, _l, _n 
  • trunk/pysoy/src/_datatypes/BoneList.pxi

    r1191 r1212  
    2727  # rather as part of it's parent Mesh.  Parent must be in __cinit__ as 
    2828  # otherwise it's parent holds the real data. 
    29  
     29   
     30  ############################################################################ 
     31  # 
     32  # Python functions 
     33  # 
     34   
    3035  def __cinit__(self, parent) : 
    3136    if not isinstance(parent, soy.models.Mesh) : 
  • trunk/pysoy/src/_internals/AsyncQueue.pxi

    r1191 r1212  
    2626  ''' 
    2727 
     28  ############################################################################ 
     29  # 
     30  # Python functions 
     31  # 
     32   
    2833  def __cinit__(self) : 
    2934    self._asyncqueue = glib.g_async_queue_new() 
     
    3237    glib.g_async_queue_unref(self._asyncqueue) 
    3338 
     39  ############################################################################ 
     40  # 
     41  # C functions 
     42  # 
     43   
    3444  cdef void _push(self, void* data) : 
    3545    glib.g_async_queue_push(self._asyncqueue, data) 
  • trunk/pysoy/src/_internals/Loadable.pxi

    r1191 r1212  
    2525    This should be inherited by any PySoy class which can be loaded or saved. 
    2626  ''' 
     27 
     28  ############################################################################ 
     29  # 
     30  # Python functions 
     31  # 
     32   
    2733  def __cinit__(self, source=None, *args, **keywords) : 
    2834    self._source = source 
    2935 
     36  ############################################################################ 
     37  # 
     38  # C functions 
     39  # 
     40   
    3041  cdef int _load(self, void* _data, int _size) : 
    3142    return 0 
  • trunk/pysoy/src/_internals/LoopThread.pxi

    r1191 r1212  
    2929  ''' 
    3030 
     31  ############################################################################ 
     32  # 
     33  # Python functions 
     34  # 
     35   
    3136  def __cinit__(self, name) : 
    3237    assert type(name)==str, 'name must be a string' 
     
    7479    assert False, "cannot set daemon status of LoopThread" 
    7580 
    76  
     81  ############################################################################ 
     82  # 
     83  # C functions 
     84  # 
     85   
    7786  cdef void _loop(self) : 
    7887    cdef int _i, _t, _most 
  • trunk/pysoy/src/_internals/Loopable.pxi

    r1191 r1212  
    2323    This should be inherited by any PySoy class which LoopThread uses. 
    2424  ''' 
     25   
     26  ############################################################################ 
     27  # 
     28  # C functions 
     29  # 
     30   
    2531  cdef int _loop(self) : 
    2632    return 1000 
  • trunk/pysoy/src/_internals/PointerSet.pxi

    r1191 r1212  
    2323    Uses GLib HashTables. 
    2424  ''' 
     25 
     26  ############################################################################ 
     27  # 
     28  # Python functions 
     29  # 
     30   
    2531  def __cinit__(self) : 
    2632    self._hashtable = glib.g_hash_table_new(glib.g_direct_hash, glib.g_direct_equal) 
     
    2935    glib.g_hash_table_destroy(self._hashtable) 
    3036 
     37  ############################################################################ 
     38  # 
     39  # C functions 
     40  # 
     41   
    3142  cdef void _insert(self, void* key) : 
    3243    glib.g_hash_table_insert(self._hashtable, key, NULL) 
  • trunk/pysoy/src/colors/Color.pxi

    r1205 r1212  
    2929    (178, 211, 83, 255), (255, 34) 
    3030  ''' 
     31 
     32  ########################################################################## 
     33  # 
     34  # Python Functions 
     35  # 
     36 
    3137  def __cinit__(self, value) : 
    3238    if type(value) == str or type(value) == unicode : 
     
    210216      return "soy.colors.Color('%s') %s" % (_parts[0], _parts[1]) 
    211217 
     218  ############################################################################ 
     219  # 
     220  # Properties 
     221  # 
    212222 
    213223  property hex : 
  • trunk/pysoy/src/controllers/Controller.pxi

    r1191 r1212  
    2323    This is the base Controller class which all controllers must inherit. 
    2424  ''' 
     25   
     26  ############################################################################ 
     27  # 
     28  # Python functions 
     29  # 
     30   
    2531  def __repr__(self) : 
    2632    return '<Controller>' 
     33 
     34  ############################################################################ 
     35  # 
     36  # C functions 
     37  # 
    2738 
    2839  cdef void _coreEventKeyDown(self, unsigned char _cde, unsigned char _sym) : 
  • trunk/pysoy/src/controllers/Keyboard.pxi

    r1191 r1212  
    3434    See soy.controllers.Controller for how to program controllers.   
    3535  ''' 
     36   
     37  ############################################################################ 
     38  # 
     39  # Python functions 
     40  # 
     41   
    3642  def __cinit__(self, window, *args, **kw) : 
    3743    if not isinstance(window, soy._core.Window) : 
     
    95101      py.Py_INCREF(<soy.actions.Action> self._acts_keycde[key]) 
    96102 
     103  ############################################################################ 
     104  # 
     105  # C functions 
     106  # 
    97107 
    98108  cdef void _coreEventKeyDown(self, unsigned char _cde, unsigned char _sym) : 
  • trunk/pysoy/src/controllers/Keyboard2.pxi

    r1062 r1212  
    1515    See soy.controllers.Controller for how to program controllers.   
    1616  ''' 
     17   
     18  ############################################################################ 
     19  # 
     20  # Python functions 
     21  # 
     22   
    1723  def __cinit__(self, window, *args, **kw) : 
    1824    if not isinstance(window, soy._core.Window) : 
     
    103109      self._acts_keycde_up[key] = <void*> value2 
    104110      py.Py_INCREF(<soy.actions.Action> self._acts_keycde_up[key]) 
    105  
     111   
     112  ############################################################################ 
     113  # 
     114  # C functions 
     115  # 
     116   
    106117 
    107118  cdef void _coreEventKeyDown(self, unsigned char _cde, unsigned char _sym) : 
  • trunk/pysoy/src/controllers/Window.pxi

    r1191 r1212  
    2727 
    2828    See soy.controllers.Controller for how to program controllers.   
    29   '''  
     29  ''' 
     30   
     31  ############################################################################ 
     32  # 
     33  # Python functions 
     34  # 
     35   
    3036  def __cinit__(self, window, *args, **kw) : 
    3137    if not isinstance(window, soy._core.Window) : 
     
    7076    else : 
    7177      raise KeyError('%s unsupported, see help(soy.controllers.Window)' % key) 
    72  
    73  
     78   
     79  ############################################################################ 
     80  # 
     81  # C functions 
     82  # 
     83   
    7484  cdef void _coreEventWinClose(self) : 
    7585    if self._acts_close : 
  • trunk/pysoy/src/fields/Buoyancy.pxi

    r1191 r1212  
    2323    Adjusts the mass Monopole works based on 
    2424  ''' 
    25  
     25   
     26  ############################################################################ 
     27  # 
     28  # Python functions 
     29  # 
     30   
    2631  def __cinit__(self, *args, **keywords) : 
    2732    self._affected = soy._internals.Children() 
    2833    self._density = 0 
    29  
     34   
     35  ############################################################################ 
     36  # 
     37  # C functions 
     38  # 
     39   
    3040  cdef void _give(self, int _ccycle) : 
    3141    cdef int _i 
     
    6676    self._affected._append(<void*> other) 
    6777    return 1 
    68  
     78   
     79  ############################################################################ 
     80  # 
     81  # Properties 
     82  # 
     83   
    6984  property density : 
    7085    '''Buoyancy Density 
  • trunk/pysoy/src/fields/Field.pxi

    r1191 r1212  
    2424    forces and other changes to other bodies. 
    2525  ''' 
    26  
     26   
     27  ############################################################################ 
     28  # 
     29  # C functions 
     30  # 
     31   
    2732  cdef int _apply(self) : 
    2833    cdef int              _i, _r 
  • trunk/pysoy/src/fields/Monopole.pxi

    r1191 r1212  
    2424    bodies in the entire scene based on an inverse square law. 
    2525  ''' 
    26  
     26   
     27  ############################################################################ 
     28  # 
     29  # Python functions 
     30  # 
     31   
    2732  def __cinit__(self, soy.scenes.Scene parent, *args, **keywords) : 
    2833    self._multiplier = 0 
    2934    self._affected = soy._internals.Children() 
    30  
     35   
     36  ############################################################################ 
     37  # 
     38  # C functions 
     39  # 
     40   
    3141  cdef int _exert(self, soy.bodies.Body other) : 
    3242    self._affected._append(<void*> other) 
     
    6575    self._affected._iterDone() 
    6676    self._affected._empty() 
    67  
    68  
     77   
     78  ############################################################################ 
     79  # 
     80  # Properties 
     81  # 
     82   
    6983  property multiplier : 
    7084    '''Monopole's multiplier 
  • trunk/pysoy/src/fields/Shockwave.pxi

    r1191 r1212  
    2323    Models an constant-rate expanding shockwave 
    2424  ''' 
    25  
     25   
     26  ############################################################################ 
     27  # 
     28  # Python functions 
     29  # 
     30   
    2631  def __cinit__(self, *args, **keywords) : 
    2732    self._space = ode.dHashSpaceCreate(NULL) 
     
    2934  def __dealloc__(self) : 
    3035    ode.dSpaceDestroy (self._space) 
     36  
     37  def activate(self) : 
     38    if (self._t0 != 0) : 
     39      raise RuntimeError('Multiple use shockwaves are not yet available') 
     40    self._t0 = (<soy.scenes.Scene> self._scene)._time 
     41    self._inner = 0 
     42    self._outer = 0 
     43    self.shape = soy.shapes.Sphere(0) 
     44    stdio.printf("activate done\n") 
    3145 
     46  ############################################################################ 
     47  # 
     48  # C functions 
     49  # 
     50   
    3251  cdef int _exert(self, soy.bodies.Body other) : 
    3352    cdef float depth, force, dx, dy, dz, d 
     
    7695      self._t0 = 0 
    7796    stdio.printf("give complete\n") 
    78   
    79   def activate(self) : 
    80     if (self._t0 != 0) : 
    81       raise RuntimeError('Multiple use shockwaves are not yet available') 
    82     self._t0 = (<soy.scenes.Scene> self._scene)._time 
    83     self._inner = 0 
    84     self._outer = 0 
    85     self.shape = soy.shapes.Sphere(0) 
    86     stdio.printf("activate done\n") 
    8797 
     98  ############################################################################ 
     99  # 
     100  # Python functions 
     101  # 
     102   
    88103  property velocity : 
    89104    '''Shockwave Velocity 
  • trunk/pysoy/src/fields/Wind.pxi

    r1191 r1212  
    2424  ''' 
    2525 
     26  ############################################################################ 
     27  # 
     28  # Python functions 
     29  # 
     30   
    2631  def __cinit__(self, soy.scenes.Scene parent, *args, **keywords) : 
    2732    return 
    2833 
     34  ############################################################################ 
     35  # 
     36  # C functions 
     37  # 
     38   
    2939  # TODO incomplete: needs area measurements rather than assumptions 
    3040  cdef int _exert(self, soy.bodies.Body other) : 
     
    4454    return 1 
    4555 
     56  ############################################################################ 
     57  # 
     58  # Properties 
     59  # 
     60   
    4661  property vector : 
    4762    '''Wind Vector 
  • trunk/pysoy/src/joints/Ball.pxi

    r1191 r1212  
    2323    a "ball and socket" joint 
    2424  ''' 
     25 
     26  ############################################################################ 
     27  # 
     28  # Python functions 
     29  # 
     30   
    2531  def __init__(self, parent, body1, body2, position) : 
    2632    self._scene._stepLock() 
     
    3137    self._scene._stepUnlock() 
    3238 
     39  ############################################################################ 
     40  # 
     41  # Properties 
     42  # 
     43   
    3344  property position : 
    3445    '''Ball.position 
  • trunk/pysoy/src/joints/Fixed.pxi

    r1191 r1212  
    2323    This is a fixed joint 
    2424  ''' 
     25 
     26  ############################################################################ 
     27  # 
     28  # Python functions 
     29  # 
     30   
    2531  def __init__(self, parent, body1, body2) : 
    2632    self._scene._stepLock() 
  • trunk/pysoy/src/joints/Hinge.pxi

    r1191 r1212  
    2323    a hinge joint 
    2424  ''' 
     25 
     26  ############################################################################ 
     27  # 
     28  # Python functions 
     29  # 
     30   
    2531  def __init__(self, parent, body1, body2, position, axis) : 
    2632    self._scene._stepLock() 
     
    3137    self._scene._joints._append(<void*> self) 
    3238    self._scene._stepUnlock() 
    33      
     39 
     40  def addTorque(self, torque) : 
     41    ode.dJointAddHingeTorque(self._jointID, torque) 
     42 
     43  ############################################################################ 
     44  # 
     45  # Properties 
     46  # 
     47   
    3448  property position : 
    3549    '''Hinge.position 
     
    97111      return ode.dJointGetHingeParam(self._jointID, ode.dParamBounce) 
    98112 
    99   def addTorque(self, torque) : 
    100     ode.dJointAddHingeTorque(self._jointID, torque) 
  • trunk/pysoy/src/joints/Hinge2.pxi

    r1191 r1212  
    2323    a double hinge joint 
    2424  ''' 
     25 
     26  ############################################################################ 
     27  # 
     28  # Python functions 
     29  # 
     30   
    2531  def __init__(self, parent, body1, body2, position, axis1, axis2) : 
    2632    self._scene._stepLock() 
     
    3339    self._scene._stepUnlock() 
    3440 
     41  def addTorque(self, torque1, torque2) : 
     42    ode.dJointAddHinge2Torques(self._jointID, torque1, torque2) 
     43 
     44  ############################################################################ 
     45  # 
     46  # Properties 
     47  # 
     48   
    3549  property position : 
    3650    '''Hinge2.position 
     
    110124      return ode.dJointGetHinge2Param(self._jointID, ode.dParamBounce) 
    111125 
    112   def addTorque(self, torque1, torque2) : 
    113     ode.dJointAddHinge2Torques(self._jointID, torque1, torque2) 
    114  
  • trunk/pysoy/src/joints/Joint.pxi

    r1191 r1212  
    2424  ''' 
    2525 
     26  ############################################################################ 
     27  # 
     28  # Python functions 
     29  # 
     30   
    2631  def __cinit__(self, soy.scenes.Scene parent,  
    2732              soy.bodies.Body body1, soy.bodies.Body body2,  
  • trunk/pysoy/src/joints/Piston.pxi

    r1191 r1212  
    2323    a piston joint aka prismatic&rotoide 
    2424  ''' 
     25 
     26  ############################################################################ 
     27  # 
     28  # Python functions 
     29  # 
     30   
    2531  def __init__(self, parent, body1, body2, position, axis1, axis2) : 
    2632    self._scene._stepLock() 
     
    3339    self._scene._stepUnlock() 
    3440 
     41&n