OpenGL.arrays.numeric
index
/home/mcfletch/pylive/OpenGL/arrays/numeric.py

Original Numeric module implementation of the OpenGL-ctypes array interfaces
 
Eventual Goals:
        * Be able to register handlers for a given data-storage mechanism at
                run-time
        * Be able to choose what data-type to use for any given operation where 
                we are getting return values and/or register a default format for
                return values (i.e. tell OpenGL to return ctypes pointers or Numeric 
                arrays or Numarray arrays for glGet* calls)

 
Modules
       
Numeric
OpenGL.arrays._numeric
OpenGL.constant
OpenGL.constants
OpenGL.arrays.formathandler
operator

 
Classes
       
FormatHandler(object)
NumericHandler

 
class NumericHandler(FormatHandler)
    Numeric-specific data-type handler for OpenGL
 
 
Method resolution order:
NumericHandler
FormatHandler
object

Methods defined here:
arraySize(self, value, typeCode=None)
Given a data-value, calculate dimensions for the array
arrayToGLType(self, value)
Given a value, guess OpenGL type of the corresponding pointer
asArray(self, value, typeCode=None)
Convert given value to an array value of given typeCode
contiguous(self, source, typeCode=None)
Get contiguous array from source
 
source -- Numeric Python array (or compatible object)
        for use as the data source.  If this is not a contiguous
        array of the given typeCode, a copy will be made, 
        otherwise will just be returned unchanged.
typeCode -- optional 1-character typeCode specifier for
        the Numeric.array function.
        
All gl*Pointer calls should use contiguous arrays, as non-
contiguous arrays will be re-copied on every rendering pass.
Although this doesn't raise an error, it does tend to slow
down rendering.
dimensions(self, value, typeCode=None)
Determine dimensions of the passed array value (if possible)
unitSize(self, value, typeCode=None)
Determine unit size of an array (if possible)
voidDataPointer(cls, value)
Given value in a known data-pointer type, return void_p for pointer
zeros(self, dims, typeCode)
Return Numeric array of zeros in given size

Class methods defined here:
from_param(cls, value, typeCode=None) from type

Static methods defined here:
dataPointer(data)
Return pointer-to-data + offset

Data and other attributes defined here:
HANDLED_TYPES = (<type 'array'>,)
isOutput = True

Methods inherited from FormatHandler:
register(self, types=None)
Register this class as handler for given set of types
registerReturn(self)
Register this handler as the default return-type handler

Class methods inherited from FormatHandler:
loadAll(cls) from type
Load all setuptools-registered FormatHandler classes
 
register a new datatype with code similar to this in your
package's setup.py for setuptools:
 
entry_points = {
        'OpenGL.arrays.formathandler':[
                'numpy = OpenGL.arrays.numpymodule.NumpyHandler',
        ],
}
loadPlugin(cls, entrypoint) from type
Load a single entry-point via plugins module
typeLookup(cls, type) from type
Lookup handler by data-type

Data descriptors inherited from FormatHandler:
__dict__
dictionary for instance variables (if defined)
__weakref__
list of weak references to the object (if defined)

Data and other attributes inherited from FormatHandler:
ALL_OUTPUT_HANDLERS = []
GENERIC_OUTPUT_PREFERENCES = ['numpy', 'numeric', 'ctypesarrays']
HANDLER_REGISTRY = {}
LAZY_TYPE_REGISTRY = {}
baseType = None
preferredOutput = None
typeConstant = None

 
Data
        ARRAY_TO_GL_TYPE_MAPPING = {'I': GL_UNSIGNED_INT, 'b': GL_BYTE, 'c': GL_UNSIGNED_BYTE, 'd': GL_DOUBLE, 'f': GL_FLOAT, 'i': GL_INT, 's': GL_SHORT}
GL_TYPE_TO_ARRAY_MAPPING = {GL_BYTE: 'b', GL_UNSIGNED_BYTE: 'c', GL_SHORT: 's', GL_UNSIGNED_SHORT: 's', GL_INT: 'i', GL_UNSIGNED_INT: 'i', GL_FLOAT: 'f', GL_DOUBLE: 'd'}
REGISTRY_NAME = 'numeric'
__warningregistry__ = {("Not importing directory '/usr/lib/python2.6/dist-packages/Numeric': missing __init__.py", <type 'exceptions.ImportWarning'>, 13): True}