OpenGL.GLU.glunurbs
index
/home/mcfletch/pylive/OpenGL/GLU/glunurbs.py

Implementation of GLU Nurbs structure and callback methods
 
Same basic pattern as seen with the gluTess* functions, just need to
add some bookkeeping to the structure class so that we can keep the
Python function references alive during the calling process.

 
Modules
       
OpenGL
OpenGL.arrays
OpenGL.converters
ctypes
OpenGL.error
OpenGL.GLU.glustruct
OpenGL.platform
OpenGL.raw.GLU
weakref
OpenGL.wrapper

 
Classes
       
GLUStruct(object)
GLUnurbs(GLUStruct, GLUnurbs)
GLUnurbs(Structure)
GLUnurbs(GLUStruct, GLUnurbs)

 
class GLUnurbs(GLUStruct, GLUnurbs)
    GLU Nurbs structure with oor and callback storage support
 
IMPORTANT NOTE: the texture coordinate callback receives a raw ctypes 
data-pointer, as without knowing what type of evaluation is being done 
(1D or 2D) we cannot safely determine the size of the array to convert 
it.  This is a limitation of the C implementation.  To convert to regular 
data-pointer, just call yourNurb.ptrAsArray( ptr, size, arrays.GLfloatArray )
with the size of data you expect.
 
 
Method resolution order:
GLUnurbs
GLUStruct
GLUnurbs
Structure
_ctypes._CData
object

Methods defined here:
FUNCTION_TYPE = CFUNCTYPE(restype, *argtypes, **kw)
CFUNCTYPE(restype, *argtypes,
             use_errno=False, use_last_error=False) -> function prototype.
 
restype: the result type
argtypes: a sequence specifying the argument types
 
The function prototype can be called in different ways to create a
callable object:
 
prototype(integer address) -> foreign function
prototype(callable) -> create and return a C callable function from callable
prototype(integer index, method name[, paramflags]) -> foreign function calling a COM method
prototype((ordinal number, dll object)[, paramflags]) -> foreign function exported by ordinal
prototype((function name, dll object)[, paramflags]) -> foreign function exported by name

Data and other attributes defined here:
CALLBACK_FUNCTION_REGISTRARS = {GLU_NURBS_ERROR: <CFunctionType object at 0x29102c0>, GLU_NURBS_BEGIN: <CFunctionType object at 0x2905870>, GLU_NURBS_VERTEX: <CFunctionType object at 0x2905940>, GLU_NURBS_NORMAL: <CFunctionType object at 0x2905a10>, GLU_NURBS_COLOR: <CFunctionType object at 0x2905ae0>, GLU_NURBS_TEXTURE_COORD: <CFunctionType object at 0x2905bb0>, GLU_NURBS_END: <CFunctionType object at 0x2905c80>, GLU_NURBS_BEGIN_DATA: <CFunctionType object at 0x2905d50>, GLU_NURBS_VERTEX_DATA: <CFunctionType object at 0x2905e20>, GLU_NURBS_NORMAL_DATA: <CFunctionType object at 0x2905ef0>, ...}
CALLBACK_TYPES = {GLU_NURBS_ERROR: <class 'ctypes.CFunctionType'>, GLU_NURBS_BEGIN: <class 'ctypes.CFunctionType'>, GLU_NURBS_VERTEX: <class 'ctypes.CFunctionType'>, GLU_NURBS_NORMAL: <class 'ctypes.CFunctionType'>, GLU_NURBS_COLOR: <class 'ctypes.CFunctionType'>, GLU_NURBS_TEXTURE_COORD: <class 'ctypes.CFunctionType'>, GLU_NURBS_END: <class 'ctypes.CFunctionType'>, GLU_NURBS_BEGIN_DATA: <class 'ctypes.CFunctionType'>, GLU_NURBS_VERTEX_DATA: <class 'ctypes.CFunctionType'>, GLU_NURBS_NORMAL_DATA: <class 'ctypes.CFunctionType'>, ...}
WRAPPER_METHODS = {GLU_NURBS_ERROR: None, GLU_NURBS_BEGIN: None, GLU_NURBS_VERTEX: '_vec3', GLU_NURBS_NORMAL: '_vec3', GLU_NURBS_COLOR: '_vec4', GLU_NURBS_TEXTURE_COORD: '_tex', GLU_NURBS_END: None, GLU_NURBS_BEGIN_DATA: '_justOOR', GLU_NURBS_VERTEX_DATA: '_vec3', GLU_NURBS_NORMAL_DATA: '_vec3', ...}

Methods inherited from GLUStruct:
addCallback(self, which, function)
Register a callback for this structure object
getAsParam(self)
Gets as a ctypes pointer to the underlying structure
noteObject(self, object)
Note object for later retrieval as a Python object pointer
 
This is the registration point for "original object return", returns 
a void pointer to the Python object, though this is, effectively, an 
opaque value.
originalObject(self, voidPointer)
Given a void-pointer, try to find our original Python object
ptrAsArray(self, ptr, length, type)
Copy length values from ptr into new array of given type

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

Methods inherited from Structure:
__init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Data and other attributes inherited from Structure:
__new__ = <built-in method __new__ of _ctypes.StructType object at 0x7f8ebe8a9960>
T.__new__(S, ...) -> a new object with type S, a subtype of T

Methods inherited from _ctypes._CData:
__ctypes_from_outparam__(...)
__hash__(...)
x.__hash__() <==> hash(x)
__reduce__(...)
__setstate__(...)

 
Functions
       
_callbackWithType(funcType)
Get gluNurbsCallback function with set last arg-type
checkKnots(knots, name)
Check that knots are in ascending order
checkOrder(order, knotCount, name)
Check that order is valid...
gluNurbsCallback(nurb, which, CallBackFunc)
Dispatch to the nurb's addCallback operation

 
Data
        MAX_ORDER = 8
PLATFORM = <OpenGL.platform.glx.GLXPlatform object at 0x20bad90>
__all__ = ('GLUnurbs', 'gluNewNurbsRenderer', 'gluNurbsCallback', 'gluNurbsCallbackData', 'gluNurbsCallbackDataEXT', 'gluNurbsCurve', 'gluNurbsSurface', 'gluPwlCurve')
__file__ = '/home/mcfletch/pylive/OpenGL/GLU/glunurbs.pyc'
__name__ = 'OpenGL.GLU.glunurbs'
__package__ = 'OpenGL.GLU'
gluNewNurbsRenderer = OpenGL.lazywrapper.lazy( 'gluNewNurbsRenderer' )
gluNurbsCallbackData = OpenGL.lazywrapper.lazy( 'gluNurbsCallbackData' )
gluNurbsCallbackDataEXT = OpenGL.lazywrapper.lazy( 'gluNurbsCallbackDataEXT' )
gluNurbsCurve = OpenGL.lazywrapper.lazy( 'gluNurbsCurve' )
gluNurbsSurface = OpenGL.lazywrapper.lazy( 'gluNurbsSurface' )
gluPwlCurve = OpenGL.lazywrapper.lazy( 'gluPwlCurve' )