nones.py :  » Game-2D-3D » PyOpenGL » PyOpenGL-3.0.1 » OpenGL » arrays » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Game 2D 3D » PyOpenGL 
PyOpenGL » PyOpenGL 3.0.1 » OpenGL » arrays » nones.py
"""Passing of None as an array data-type
"""
REGISTRY_NAME = 'nones'
import logging
log = logging.getLogger( 'OpenGL.arrays.nones' )

from OpenGL import acceleratesupport
NoneHandler = None
if acceleratesupport.ACCELERATE_AVAILABLE:
    try:
        from OpenGL_accelerate.nones_formathandler import NoneHandler
    except ImportError, err:
        log.warn(
            "Unable to load nones_formathandler accelerator from OpenGL_accelerate"
        )
if NoneHandler is None:
    from OpenGL.arrays import formathandler
    class NoneHandler( formathandler.FormatHandler ):
        """Numpy-specific data-type handler for OpenGL"""
        HANDLED_TYPES = (type(None), )
        def from_param( self, value, typeCode=None  ):
            """Convert to a ctypes pointer value"""
            return None
        def dataPointer( self, value ):
            """return long for pointer value"""
            return None
        def voidDataPointer( cls, value ):
            """Given value in a known data-pointer type, return void_p for pointer"""
            return None
        def asArray( self, value, typeCode=None ):
            """Given a value, convert to array representation"""
            return None
        def arrayToGLType( self, value ):
            """Given a value, guess OpenGL type of the corresponding pointer"""
            raise TypeError( """Can't guess type of a NULL pointer""" )
        def arraySize( self, value, typeCode = None ):
            """Given a data-value, calculate dimensions for the array"""
            return 0
        def arrayByteCount( self, value, typeCode = None ):
            """Given a data-value, calculate number of bytes required to represent"""
            return 0
        def zeros( self, shape, typeCode= None ):
            """Create an array of given shape with given typeCode"""
            raise TypeError( """Can't create NULL pointer filled with values""" )
        def ones( self, shape, typeCode= None ):
            """Create an array of given shape with given typeCode"""
            raise TypeError( """Can't create NULL pointer filled with values""" )
        def unitSize( self, value, typeCode=None ):
            """Determine unit size of an array (if possible)"""
            raise TypeError( """Can't determine unit size of a null pointer""" )
        def dimensions( self, value, typeCode=None ):
            """Determine dimensions of the passed array value (if possible)"""
            return (0,)
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.