OpenGL.GLU.glunurbs
index
/var/pylive/src/OpenGL-dev/OpenGL-ctypes/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.arrays
OpenGL.converters
ctypes
OpenGL.GLU.glustruct
OpenGL.platform
OpenGL.raw.GLU
weakref
OpenGL.wrapper

 
Classes
       
GLUStruct(Structure)
GLUnurbs

 
class GLUnurbs(GLUStruct)
    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
Structure
_ctypes._CData
object

Data and other attributes defined here:
CALLBACK_FUNCTION_REGISTRARS = {GLU_NURBS_ERROR: <CFunctionType object at 0x2aaab29e6820>, GLU_NURBS_BEGIN: <CFunctionType object at 0x2aaab29d9e60>, GLU_NURBS_VERTEX: <CFunctionType object at 0x2aaab29d9f28>, GLU_NURBS_NORMAL: <CFunctionType object at 0x2aaab29e6050>, GLU_NURBS_COLOR: <CFunctionType object at 0x2aaab29e6118>, GLU_NURBS_TEXTURE_COORD: <CFunctionType object at 0x2aaab29e61e0>, GLU_NURBS_END: <CFunctionType object at 0x2aaab29e62a8>, GLU_NURBS_BEGIN_DATA: <CFunctionType object at 0x2aaab29e6370>, GLU_NURBS_VERTEX_DATA: <CFunctionType object at 0x2aaab29e6438>, GLU_NURBS_NORMAL_DATA: <CFunctionType object at 0x2aaab29e6500>, ...}
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 0x2b54fb25d4a0>
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)

 
Functions
       
basegluGetNurbsProperty = gluGetNurbsProperty(...)
gluGetNurbsProperty( POINTER(GLUnurbs)(nurb), GLenum(property), arrays.GLfloatArray(data) ) -> None
basegluNewNurbsRenderer = gluNewNurbsRenderer(...)
gluNewNurbsRenderer(  ) -> POINTER(GLUnurbs)
basegluNurbsCallbackData = gluNurbsCallbackData(...)
gluNurbsCallbackData( POINTER(GLUnurbs)(nurb), POINTER(GLvoid)(userData) ) -> None
basegluNurbsCallbackDataEXT = gluNurbsCallbackDataEXT(...)
gluNurbsCallbackDataEXT( POINTER(GLUnurbs)(nurb), POINTER(GLvoid)(userData) ) -> None
basegluNurbsCurve = gluNurbsCurve(...)
gluNurbsCurve( POINTER(GLUnurbs)(nurb), GLint(knotCount), arrays.GLfloatArray(knots), GLint(stride), arrays.GLfloatArray(control), GLint(order), GLenum(type) ) -> None
basegluNurbsSurface = gluNurbsSurface(...)
gluNurbsSurface( POINTER(GLUnurbs)(nurb), GLint(sKnotCount), arrays.GLfloatArray(sKnots), GLint(tKnotCount), arrays.GLfloatArray(tKnots), GLint(sStride), GLint(tStride), arrays.GLfloatArray(control), GLint(sOrder), GLint(tOrder), GLenum(type) ) -> None
basegluPwlCurve = gluPwlCurve(...)
gluPwlCurve( POINTER(GLUnurbs)(nurb), GLint(count), arrays.GLfloatArray(data), GLint(stride), GLenum(type) ) -> None
gluBeginCurve(...)
gluBeginCurve( POINTER(GLUnurbs)(nurb) ) -> None
gluBeginSurface(...)
gluBeginSurface( POINTER(GLUnurbs)(nurb) ) -> None
gluBeginTrim(...)
gluBeginTrim( POINTER(GLUnurbs)(nurb) ) -> None
gluDeleteNurbsRenderer(...)
gluDeleteNurbsRenderer( POINTER(GLUnurbs)(nurb) ) -> None
gluEndCurve(...)
gluEndCurve( POINTER(GLUnurbs)(nurb) ) -> None
gluEndSurface(...)
gluEndSurface( POINTER(GLUnurbs)(nurb) ) -> None
gluEndTrim(...)
gluEndTrim( POINTER(GLUnurbs)(nurb) ) -> None
gluGetNurbsProperty(nurb, property)
Retrieve the indicated property for the given NURB object
gluLoadSamplingMatrices( nurb,model,perspective,view )
pyConverters: nurb=None, model=<OpenGL.converters.CallFuncPyConverter object at 0x2aaab29e4690>, perspective=<OpenGL.converters.CallFuncPyConverter object at 0x2aaab29e4750>, view=<OpenGL.converters.CallFuncPyConverter object at 0x2aaab29e4790>
cConverters: nurb=None, model=<OpenGL.converters.getPyArgsName object at 0x2aaab29dc910>, perspective=<OpenGL.converters.getPyArgsName object at 0x2aaab29dc9b0>, view=<OpenGL.converters.getPyArgsName object at 0x2aaab29dca50>
cResolvers: Not Used
storeValues: Not Used
returnValues:
returnPointer(result, baseOperation, pyArgs, cArgs)
Return the converted object as result of function
 
Note: this is a hack that always returns pyArgs[0]!
Wrapping Operation: gluLoadSamplingMatrices( POINTER(GLUnurbs)(nurb), arrays.GLfloatArray(model), arrays.GLfloatArray(perspective), arrays.GLintArray(view) ) -> None
gluNewNurbsRenderer()
Return a new nurbs renderer for the system (dereferences pointer)
gluNurbsCallback(nurb, which, CallBackFunc)
Dispatch to the nurb's callback operation
gluNurbsCallbackData(nurb, userData)
Note the Python object for use as userData by the nurb
gluNurbsCallbackDataEXT(nurb, userData)
Note the Python object for use as userData by the nurb
gluNurbsCurve(nurb, knots, control, type)
Pythonic version of gluNurbsCurve
 
Calculates knotCount, stride, and order automatically
gluNurbsProperty(...)
gluNurbsProperty( POINTER(GLUnurbs)(nurb), GLenum(property), GLfloat(value) ) -> None
gluNurbsSurface(nurb, sKnots, tKnots, control, type)
Pythonic version of gluNurbsSurface
 
Calculates knotCount, stride, and order automatically
gluPwlCurve(nurb, data, type)
gluPwlCurve -- piece-wise linear curve within GLU context
 
data -- the data-array 
type -- determines number of elements/data-point

 
Data
        __all__ = ('GLUnurbs', 'gluBeginCurve', 'gluBeginSurface', 'gluBeginTrim', 'gluDeleteNurbsRenderer', 'gluEndCurve', 'gluEndSurface', 'gluEndTrim', 'gluGetNurbsProperty', 'gluLoadSamplingMatrices', 'gluNewNurbsRenderer', 'gluNurbsCallback', 'gluNurbsCallbackData', 'gluNurbsCallbackDataEXT', 'gluNurbsCurve', 'gluNurbsProperty', 'gluNurbsSurface', 'gluPwlCurve')