/* Generated by Cython 0.29.12 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "opengl/SnapPyfont.h", 
            "opengl/opengl.h"
        ], 
        "include_dirs": [
            "opengl"
        ], 
        "name": "CyOpenGL", 
        "sources": [
            "opengl/CyOpenGL.pyx"
        ]
    }, 
    "module_name": "CyOpenGL"
}
END: Cython Metadata */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.6+ or Python 3.3+.
#else
#define CYTHON_ABI "0_29_12"
#define CYTHON_HEX_VERSION 0x001D0CF0
#define CYTHON_FUTURE_DIVISION 0
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #if PY_VERSION_HEX >= 0x02070000
    #define HAVE_LONG_LONG
  #endif
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 0
  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #if PY_VERSION_HEX < 0x02070000
    #undef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 0
  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
           typedef unsigned char     uint8_t;
           typedef unsigned int      uint32_t;
        #else
           typedef unsigned __int8   uint8_t;
           typedef unsigned __int32  uint32_t;
        #endif
    #endif
#else
   #include <stdint.h>
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #elif defined(__GNUC__)
    #define CYTHON_INLINE __inline__
  #elif defined(_MSC_VER)
    #define CYTHON_INLINE __inline
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_INLINE inline
  #else
    #define CYTHON_INLINE
  #endif
#endif

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
  #define __Pyx_DefaultClassType PyClass_Type
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
  #define __Pyx_DefaultClassType PyType_Type
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_FAST_PYCCALL
#define __Pyx_PyFastCFunction_Check(func)\
    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
#else
#define __Pyx_PyFastCFunction_Check(func) 0
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStr(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
#else
#define __Pyx_PyDict_GetItemStr(dict, name)  PyDict_GetItem(dict, name)
#endif
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         PyUnicode_KIND(u)
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         (sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
  #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
  #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
  #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
  #define PyObject_Unicode             PyObject_Str
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        (Py_TYPE(obj) == &PySet_Type)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   PyInt_AsLong
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   PyInt_AsSsize_t
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
#else
  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif


#define __PYX_ERR(f_index, lineno, Ln_error) \
{ \
  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
}

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE__CyOpenGL
#define __PYX_HAVE_API__CyOpenGL
/* Early includes */
#include "stdlib.h"
#include "opengl.h"
#include "SnapPyfont.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm= __FILE__;
static const char *__pyx_filename;

/* Header.proto */
#if !defined(CYTHON_CCOMPLEX)
  #if defined(__cplusplus)
    #define CYTHON_CCOMPLEX 1
  #elif defined(_Complex_I)
    #define CYTHON_CCOMPLEX 1
  #else
    #define CYTHON_CCOMPLEX 0
  #endif
#endif
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #include <complex>
  #else
    #include <complex.h>
  #endif
#endif
#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
  #undef _Complex_I
  #define _Complex_I 1.0fj
#endif


static const char *__pyx_f[] = {
  "opengl/CyOpenGL.pyx",
  "stringsource",
};
/* Declarations.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    typedef ::std::complex< double > __pyx_t_double_complex;
  #else
    typedef double _Complex __pyx_t_double_complex;
  #endif
#else
    typedef struct { double real, imag; } __pyx_t_double_complex;
#endif
static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);


/*--- Type declarations ---*/
struct __pyx_obj_8CyOpenGL_vector3;
struct __pyx_obj_8CyOpenGL_GL_context;
struct __pyx_obj_8CyOpenGL_GLobject;
struct __pyx_obj_8CyOpenGL_WireframeSphere;
struct __pyx_obj_8CyOpenGL_MeshedSurface;
struct __pyx_obj_8CyOpenGL_PoincareTriangle;
struct __pyx_obj_8CyOpenGL_PoincarePolygon;
struct __pyx_obj_8CyOpenGL_KleinPolygon;
struct __pyx_obj_8CyOpenGL_Colorizer;
struct __pyx_obj_8CyOpenGL_Horosphere;
struct __pyx_obj_8CyOpenGL_HoroballGroup;
struct __pyx_obj_8CyOpenGL_Parallelogram;
struct __pyx_obj_8CyOpenGL_EdgeSet;
struct __pyx_obj_8CyOpenGL_FordEdgeSet;
struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet;
struct __pyx_obj_8CyOpenGL_Label;
struct __pyx_obj_8CyOpenGL_LabelSet;
struct __pyx_obj_8CyOpenGL_HoroballScene;
struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw;
struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene;
struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr;
struct __pyx_defaults;
typedef struct __pyx_defaults __pyx_defaults;
struct __pyx_defaults1;
typedef struct __pyx_defaults1 __pyx_defaults1;
struct __pyx_defaults {
  PyObject *__pyx_arg_cnf;
};
struct __pyx_defaults1 {
  PyObject *__pyx_arg_cnf;
};

/* "CyOpenGL.pyx":38
 *         raise RuntimeError('No result - is there a current OpenGL context?')
 * 
 * cdef class vector3:             # <<<<<<<<<<<<<<
 *     """
 *     A simple real 3-dimensional vector which supports addition,
 */
struct __pyx_obj_8CyOpenGL_vector3 {
  PyObject_HEAD
  double x;
  double y;
  double z;
  double norm_squared;
  double norm;
};


/* "CyOpenGL.pyx":73
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
 * cdef class GL_context:             # <<<<<<<<<<<<<<
 *     """
 *     Sets up our default OpenGL environment.
 */
struct __pyx_obj_8CyOpenGL_GL_context {
  PyObject_HEAD
};


/* "CyOpenGL.pyx":137
 *         glLoadIdentity()
 * 
 * cdef class GLobject:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for the objects in our OpenGL scene.  Think of a
 */
struct __pyx_obj_8CyOpenGL_GLobject {
  PyObject_HEAD
  struct __pyx_vtabstruct_8CyOpenGL_GLobject *__pyx_vtab;
  GLfloat color[4];
  GLfloat front_specular[4];
  GLfloat back_specular[4];
  GLfloat emission[4];
  GLfloat front_shininess;
  GLfloat back_shininess;
};


/* "CyOpenGL.pyx":190
 *         glEndList()
 * 
 * cdef class WireframeSphere(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Draw a wireframe sphere.
 */
struct __pyx_obj_8CyOpenGL_WireframeSphere {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
};


/* "CyOpenGL.pyx":267
 * 
 * 
 * cdef class MeshedSurface(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     An object made out of a triangular mesh. See the subclass
 */
struct __pyx_obj_8CyOpenGL_MeshedSurface {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
  PyObject *vertices;
  PyObject *normals;
  PyObject *triangles;
  PyObject *count;
  GLfloat *nv_array;
  GLushort *indices;
};


/* "CyOpenGL.pyx":315
 * 
 * 
 * cdef class PoincareTriangle(MeshedSurface):             # <<<<<<<<<<<<<<
 *     """
 *     Draws a geodesic triangle in the Poincare model.  The geometric
 */
struct __pyx_obj_8CyOpenGL_PoincareTriangle {
  struct __pyx_obj_8CyOpenGL_MeshedSurface __pyx_base;
  PyObject *center;
  PyObject *mesh;
  PyObject *original_vertices;
};


/* "CyOpenGL.pyx":349
 *         self.build_arrays()
 * 
 * cdef class PoincarePolygon(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Draws a geodesic polygon in the Poincare model. The geometric
 */
struct __pyx_obj_8CyOpenGL_PoincarePolygon {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
  PyObject *vertices;
  PyObject *center;
  PyObject *triangles;
};


/* "CyOpenGL.pyx":380
 *             triangle.draw(use_material=False)
 * 
 * cdef class KleinPolygon(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Draws a geodesic polygon in the Klein model. The geometric
 */
struct __pyx_obj_8CyOpenGL_KleinPolygon {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
  PyObject *vertices;
  PyObject *closest;
};


/* "CyOpenGL.pyx":476
 *      glEndList()
 * 
 * cdef class Colorizer:             # <<<<<<<<<<<<<<
 *     """
 *     Callable class which returns a color when passed an index.
 */
struct __pyx_obj_8CyOpenGL_Colorizer {
  PyObject_HEAD
  struct __pyx_vtabstruct_8CyOpenGL_Colorizer *__pyx_vtab;
  int base_hue[6];
  double lightness;
  double saturation;
  double alpha;
};


/* "CyOpenGL.pyx":537
 * GetColor = Colorizer()
 * 
 * cdef class Horosphere(MeshedSurface):             # <<<<<<<<<<<<<<
 *     """
 *     Draw a horosphere.
 */
struct __pyx_obj_8CyOpenGL_Horosphere {
  struct __pyx_obj_8CyOpenGL_MeshedSurface __pyx_base;
  GLdouble radius;
  GLint stacks;
  GLint slices;
};


/* "CyOpenGL.pyx":605
 * 
 * 
 * cdef class HoroballGroup:             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of horoballs for a single cusp.  The paremeters
 */
struct __pyx_obj_8CyOpenGL_HoroballGroup {
  PyObject_HEAD
  struct __pyx_vtabstruct_8CyOpenGL_HoroballGroup *__pyx_vtab;
  PyObject *horoballs;
  PyObject *meridian;
  PyObject *longitude;
  PyObject *keys;
  PyObject *centers;
  PyObject *spheres;
  PyObject *list_ids;
  GLfloat color[4];
  GLuint list_id_base;
  GLuint num_lists;
  double cutoff;
  PyObject *original_indices;
};


/* "CyOpenGL.pyx":693
 *         glEndList()
 * 
 * cdef class Parallelogram(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Draws a parallelogram on the xy-plane centered at (0,0). The geometric
 */
struct __pyx_obj_8CyOpenGL_Parallelogram {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
};


/* "CyOpenGL.pyx":715
 *         glEnable(GL_LIGHTING)
 * 
 * cdef class EdgeSet(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for collections of segments to be drawn into a
 */
struct __pyx_obj_8CyOpenGL_EdgeSet {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
  PyObject *segments;
  PyObject *longitude;
  PyObject *meridian;
  PyObject *stipple;
};


/* "CyOpenGL.pyx":761
 *         glEnable(GL_LIGHTING)
 * 
 * cdef class FordEdgeSet(EdgeSet):             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of edges for the component of the Ford domain
 */
struct __pyx_obj_8CyOpenGL_FordEdgeSet {
  struct __pyx_obj_8CyOpenGL_EdgeSet __pyx_base;
};


/* "CyOpenGL.pyx":768
 *     """
 * 
 * cdef class TriangulationEdgeSet(EdgeSet):             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of edges for the 1-skeleton of the canonical
 */
struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet {
  struct __pyx_obj_8CyOpenGL_EdgeSet __pyx_base;
};


/* "CyOpenGL.pyx":782
 *         glColor4f(0.6, 0.6, 0.6, 1.0)
 * 
 * cdef class Label:             # <<<<<<<<<<<<<<
 *     cdef GLfloat x, y
 *     cdef codes
 */
struct __pyx_obj_8CyOpenGL_Label {
  PyObject_HEAD
  struct __pyx_vtabstruct_8CyOpenGL_Label *__pyx_vtab;
  GLfloat x;
  GLfloat y;
  PyObject *codes;
};


/* "CyOpenGL.pyx":813
 *                 glBitmap(0, 0, 0, 0, glyph.width, 0, NULL)
 * 
 * cdef class LabelSet(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Renders edge and vertex labels in the SnapPy font.
 */
struct __pyx_obj_8CyOpenGL_LabelSet {
  struct __pyx_obj_8CyOpenGL_GLobject __pyx_base;
  PyObject *segments;
  PyObject *vertices;
  PyObject *longitude;
  PyObject *meridian;
  PyObject *codes;
  SnapPy_glyph *glyph;
  GLfloat pix;
  GLfloat x;
  GLfloat y;
  int width;
  int height;
};


/* "CyOpenGL.pyx":844
 *             glPopMatrix()
 * 
 * cdef class HoroballScene:             # <<<<<<<<<<<<<<
 *     """
 *     A family of translations of a Horoball Group which fill the
 */
struct __pyx_obj_8CyOpenGL_HoroballScene {
  PyObject_HEAD
  struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *__pyx_vtab;
  PyObject *nbhd;
  PyObject *meridian;
  PyObject *longitude;
  PyObject *offset;
  PyObject *flipped;
  PyObject *cusp_view;
  PyObject *Ford;
  PyObject *tri;
  PyObject *pgram;
  PyObject *labels;
  PyObject *shifts;
  PyObject *pgram_var;
  PyObject *Ford_var;
  PyObject *tri_var;
  PyObject *horo_var;
  PyObject *label_var;
  GLfloat Xangle;
  GLfloat Yangle;
  GLuint ball_list_id;
  GLuint pgram_list_id;
  GLuint labels_list_id;
  GLuint tri_light_list_id;
  GLuint tri_dark_list_id;
  GLuint Ford_dark_list_id;
  GLuint Ford_light_list_id;
  double cutoff;
  int which_cusp;
};


/* "CyOpenGL.pyx":195
 *     """
 * 
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):             # <<<<<<<<<<<<<<
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()
 */
struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw {
  PyObject_HEAD
  PyObject *__pyx_v_r;
};


/* "CyOpenGL.pyx":898
 *         self.flipped = boolean_value
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):             # <<<<<<<<<<<<<<
 *         if self.nbhd is None:
 *             self.cusp_view = self.Ford = self.tri = self.labels = None
 */
struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene {
  PyObject_HEAD
  struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self;
};


/* "CyOpenGL.pyx":907
 *             self.which_cusp = which_cusp
 *         self.meridian, self.longitude = (
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))             # <<<<<<<<<<<<<<
 *         self.cusp_view = HoroballGroup(
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),
 */
struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr {
  PyObject_HEAD
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *__pyx_outer_scope;
  PyObject *__pyx_v_z;
  PyObject *__pyx_t_0;
  Py_ssize_t __pyx_t_1;
  PyObject *(*__pyx_t_2)(PyObject *);
};



/* "CyOpenGL.pyx":137
 *         glLoadIdentity()
 * 
 * cdef class GLobject:             # <<<<<<<<<<<<<<
 *     """
 *     Base class for the objects in our OpenGL scene.  Think of a
 */

struct __pyx_vtabstruct_8CyOpenGL_GLobject {
  PyObject *(*set_material)(struct __pyx_obj_8CyOpenGL_GLobject *);
};
static struct __pyx_vtabstruct_8CyOpenGL_GLobject *__pyx_vtabptr_8CyOpenGL_GLobject;


/* "CyOpenGL.pyx":190
 *         glEndList()
 * 
 * cdef class WireframeSphere(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Draw a wireframe sphere.
 */

struct __pyx_vtabstruct_8CyOpenGL_WireframeSphere {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_WireframeSphere *__pyx_vtabptr_8CyOpenGL_WireframeSphere;


/* "CyOpenGL.pyx":267
 * 
 * 
 * cdef class MeshedSurface(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     An object made out of a triangular mesh. See the subclass
 */

struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
  PyObject *(*build_arrays)(struct __pyx_obj_8CyOpenGL_MeshedSurface *);
};
static struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface *__pyx_vtabptr_8CyOpenGL_MeshedSurface;


/* "CyOpenGL.pyx":315
 * 
 * 
 * cdef class PoincareTriangle(MeshedSurface):             # <<<<<<<<<<<<<<
 *     """
 *     Draws a geodesic triangle in the Poincare model.  The geometric
 */

struct __pyx_vtabstruct_8CyOpenGL_PoincareTriangle {
  struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_PoincareTriangle *__pyx_vtabptr_8CyOpenGL_PoincareTriangle;


/* "CyOpenGL.pyx":349
 *         self.build_arrays()
 * 
 * cdef class PoincarePolygon(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Draws a geodesic polygon in the Poincare model. The geometric
 */

struct __pyx_vtabstruct_8CyOpenGL_PoincarePolygon {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
  PyObject *(*triangulate)(struct __pyx_obj_8CyOpenGL_PoincarePolygon *);
};
static struct __pyx_vtabstruct_8CyOpenGL_PoincarePolygon *__pyx_vtabptr_8CyOpenGL_PoincarePolygon;


/* "CyOpenGL.pyx":380
 *             triangle.draw(use_material=False)
 * 
 * cdef class KleinPolygon(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Draws a geodesic polygon in the Klein model. The geometric
 */

struct __pyx_vtabstruct_8CyOpenGL_KleinPolygon {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_KleinPolygon *__pyx_vtabptr_8CyOpenGL_KleinPolygon;


/* "CyOpenGL.pyx":476
 *      glEndList()
 * 
 * cdef class Colorizer:             # <<<<<<<<<<<<<<
 *     """
 *     Callable class which returns a color when passed an index.
 */

struct __pyx_vtabstruct_8CyOpenGL_Colorizer {
  double (*index_to_hue)(struct __pyx_obj_8CyOpenGL_Colorizer *, int);
  PyObject *(*hls_to_rgb)(struct __pyx_obj_8CyOpenGL_Colorizer *, double, double, double);
  PyObject *(*hls_interp)(struct __pyx_obj_8CyOpenGL_Colorizer *, double, double, double);
};
static struct __pyx_vtabstruct_8CyOpenGL_Colorizer *__pyx_vtabptr_8CyOpenGL_Colorizer;


/* "CyOpenGL.pyx":537
 * GetColor = Colorizer()
 * 
 * cdef class Horosphere(MeshedSurface):             # <<<<<<<<<<<<<<
 *     """
 *     Draw a horosphere.
 */

struct __pyx_vtabstruct_8CyOpenGL_Horosphere {
  struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface __pyx_base;
  PyObject *(*build_vertices_and_normals)(struct __pyx_obj_8CyOpenGL_Horosphere *);
  PyObject *(*build_triangles)(struct __pyx_obj_8CyOpenGL_Horosphere *);
};
static struct __pyx_vtabstruct_8CyOpenGL_Horosphere *__pyx_vtabptr_8CyOpenGL_Horosphere;


/* "CyOpenGL.pyx":605
 * 
 * 
 * cdef class HoroballGroup:             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of horoballs for a single cusp.  The paremeters
 */

struct __pyx_vtabstruct_8CyOpenGL_HoroballGroup {
  PyObject *(*get_list_ids)(struct __pyx_obj_8CyOpenGL_HoroballGroup *, PyObject *);
  PyObject *(*build_spheres)(struct __pyx_obj_8CyOpenGL_HoroballGroup *);
};
static struct __pyx_vtabstruct_8CyOpenGL_HoroballGroup *__pyx_vtabptr_8CyOpenGL_HoroballGroup;


/* "CyOpenGL.pyx":693
 *         glEndList()
 * 
 * cdef class Parallelogram(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Draws a parallelogram on the xy-plane centered at (0,0). The geometric
 */

struct __pyx_vtabstruct_8CyOpenGL_Parallelogram {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_Parallelogram *__pyx_vtabptr_8CyOpenGL_Parallelogram;


/* "CyOpenGL.pyx":715
 *         glEnable(GL_LIGHTING)
 * 
 * cdef class EdgeSet(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Base class for collections of segments to be drawn into a
 */

struct __pyx_vtabstruct_8CyOpenGL_EdgeSet {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
  PyObject *(*set_dark_color)(struct __pyx_obj_8CyOpenGL_EdgeSet *);
  PyObject *(*set_light_color)(struct __pyx_obj_8CyOpenGL_EdgeSet *);
};
static struct __pyx_vtabstruct_8CyOpenGL_EdgeSet *__pyx_vtabptr_8CyOpenGL_EdgeSet;


/* "CyOpenGL.pyx":761
 *         glEnable(GL_LIGHTING)
 * 
 * cdef class FordEdgeSet(EdgeSet):             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of edges for the component of the Ford domain
 */

struct __pyx_vtabstruct_8CyOpenGL_FordEdgeSet {
  struct __pyx_vtabstruct_8CyOpenGL_EdgeSet __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_FordEdgeSet *__pyx_vtabptr_8CyOpenGL_FordEdgeSet;


/* "CyOpenGL.pyx":768
 *     """
 * 
 * cdef class TriangulationEdgeSet(EdgeSet):             # <<<<<<<<<<<<<<
 *     """
 *     A fundamental set of edges for the 1-skeleton of the canonical
 */

struct __pyx_vtabstruct_8CyOpenGL_TriangulationEdgeSet {
  struct __pyx_vtabstruct_8CyOpenGL_EdgeSet __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_TriangulationEdgeSet *__pyx_vtabptr_8CyOpenGL_TriangulationEdgeSet;


/* "CyOpenGL.pyx":782
 *         glColor4f(0.6, 0.6, 0.6, 1.0)
 * 
 * cdef class Label:             # <<<<<<<<<<<<<<
 *     cdef GLfloat x, y
 *     cdef codes
 */

struct __pyx_vtabstruct_8CyOpenGL_Label {
  PyObject *(*get_shape)(struct __pyx_obj_8CyOpenGL_Label *);
};
static struct __pyx_vtabstruct_8CyOpenGL_Label *__pyx_vtabptr_8CyOpenGL_Label;


/* "CyOpenGL.pyx":813
 *                 glBitmap(0, 0, 0, 0, glyph.width, 0, NULL)
 * 
 * cdef class LabelSet(GLobject):             # <<<<<<<<<<<<<<
 *     """
 *     Renders edge and vertex labels in the SnapPy font.
 */

struct __pyx_vtabstruct_8CyOpenGL_LabelSet {
  struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_base;
};
static struct __pyx_vtabstruct_8CyOpenGL_LabelSet *__pyx_vtabptr_8CyOpenGL_LabelSet;


/* "CyOpenGL.pyx":844
 *             glPopMatrix()
 * 
 * cdef class HoroballScene:             # <<<<<<<<<<<<<<
 *     """
 *     A family of translations of a Horoball Group which fill the
 */

struct __pyx_vtabstruct_8CyOpenGL_HoroballScene {
  PyObject *(*build_shifts)(struct __pyx_obj_8CyOpenGL_HoroballScene *, PyObject *, PyObject *);
  PyObject *(*right_top)(struct __pyx_obj_8CyOpenGL_HoroballScene *);
  PyObject *(*gl_compile)(struct __pyx_obj_8CyOpenGL_HoroballScene *);
  PyObject *(*draw_segments)(struct __pyx_obj_8CyOpenGL_HoroballScene *, PyObject *, PyObject *);
};
static struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *__pyx_vtabptr_8CyOpenGL_HoroballScene;

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, int);
    void (*DECREF)(void*, PyObject*, int);
    void (*GOTREF)(void*, PyObject*, int);
    void (*GIVEREF)(void*, PyObject*, int);
    void* (*SetupContext)(const char*, int, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
  #define __Pyx_XINCREF(r)  do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
    const char* function_name);

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* PyCFunctionFastCall.proto */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
#else
#define __Pyx_PyCFunction_FastCall(func, args, nargs)  (assert(0), NULL)
#endif

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#else
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyObjectCall2Args.proto */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* KeywordStringCheck.proto */
static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);

/* None.proto */
static CYTHON_INLINE long __Pyx_mod_long(long, long);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);

/* CythonFunction.proto */
#define __Pyx_CyFunction_USED 1
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
} __pyx_CyFunctionObject;
static PyTypeObject *__pyx_CyFunctionType = 0;
#define __Pyx_CyFunction_Check(obj)  (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
    __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *self,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

/* ListAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
#endif

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod1.proto */
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg);

/* append.proto */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* ExtTypeTest.proto */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);

/* PyObjectCallNoArg.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
#else
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        Py_SIZE(list) = len+1;
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* StrEquals.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
#else
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_RemainderObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceRemainder(op1, op2) : PyNumber_Remainder(op1, op2))
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_FloorDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceFloorDivide(op1, op2) : PyNumber_FloorDivide(op1, op2))
#endif

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* None.proto */
static CYTHON_INLINE double __Pyx_mod_double(double, double);

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* UnicodeAsUCS4.proto */
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject*);

/* object_ord.proto */
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyObject_Ord(c)\
    (likely(PyUnicode_Check(c)) ? (long)__Pyx_PyUnicode_AsPy_UCS4(c) : __Pyx__PyObject_Ord(c))
#else
#define __Pyx_PyObject_Ord(c) __Pyx__PyObject_Ord(c)
#endif
static long __Pyx__PyObject_Ord(PyObject* c);

/* set_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
                                                  Py_ssize_t* p_orig_length, int* p_source_is_set);
static CYTHON_INLINE int __Pyx_set_iter_next(
        PyObject* iter_obj, Py_ssize_t orig_length,
        Py_ssize_t* ppos, PyObject **value,
        int source_is_set);

/* py_abs.proto */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *num);
#define __Pyx_PyNumber_Absolute(x)\
    ((likely(PyLong_CheckExact(x))) ?\
         (likely(Py_SIZE(x) >= 0) ? (Py_INCREF(x), (x)) : __Pyx_PyLong_AbsNeg(x)) :\
         PyNumber_Absolute(x))
#else
#define __Pyx_PyNumber_Absolute(x)  PyNumber_Absolute(x)
#endif

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* SliceObject.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
        PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
        int has_cstart, int has_cstop, int wraparound);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* pyobject_as_double.proto */
static double __Pyx__PyObject_AsDouble(PyObject* obj);
#if CYTHON_COMPILING_IN_PYPY
#define __Pyx_PyObject_AsDouble(obj)\
(likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
 likely(PyInt_CheckExact(obj)) ?\
 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
#else
#define __Pyx_PyObject_AsDouble(obj)\
((likely(PyFloat_CheckExact(obj))) ?\
 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
#endif

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_DivideObjC(op1, op2, floatval, inplace, zerodivision_check)\
    ((inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2)))
    #endif

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* CallNextTpTraverse.proto */
static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);

/* CallNextTpClear.proto */
static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

/* SetupReduce.proto */
static int __Pyx_setup_reduce(PyObject* type_obj);

/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);

/* SetNameInClass.proto */
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? _PyDict_SetItem_KnownHash(ns, name, value, ((PyASCIIObject *) name)->hash) : PyObject_SetItem(ns, name, value))
#elif CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_SetNameInClass(ns, name, value)\
    (likely(PyDict_CheckExact(ns)) ? PyDict_SetItem(ns, name, value) : PyObject_SetItem(ns, name, value))
#else
#define __Pyx_SetNameInClass(ns, name, value)  PyObject_SetItem(ns, name, value)
#endif

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_GLuint(GLuint value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_GLint(GLint value);

/* RealImag.proto */
#if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    #define __Pyx_CREAL(z) ((z).real())
    #define __Pyx_CIMAG(z) ((z).imag())
  #else
    #define __Pyx_CREAL(z) (__real__(z))
    #define __Pyx_CIMAG(z) (__imag__(z))
  #endif
#else
    #define __Pyx_CREAL(z) ((z).real)
    #define __Pyx_CIMAG(z) ((z).imag)
#endif
#if defined(__cplusplus) && CYTHON_CCOMPLEX\
        && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
    #define __Pyx_SET_CREAL(z,x) ((z).real(x))
    #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
#else
    #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
    #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
#endif

/* Arithmetic.proto */
#if CYTHON_CCOMPLEX
    #define __Pyx_c_eq_double(a, b)   ((a)==(b))
    #define __Pyx_c_sum_double(a, b)  ((a)+(b))
    #define __Pyx_c_diff_double(a, b) ((a)-(b))
    #define __Pyx_c_prod_double(a, b) ((a)*(b))
    #define __Pyx_c_quot_double(a, b) ((a)/(b))
    #define __Pyx_c_neg_double(a)     (-(a))
  #ifdef __cplusplus
    #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
    #define __Pyx_c_conj_double(z)    (::std::conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (::std::abs(z))
        #define __Pyx_c_pow_double(a, b)  (::std::pow(a, b))
    #endif
  #else
    #define __Pyx_c_is_zero_double(z) ((z)==0)
    #define __Pyx_c_conj_double(z)    (conj(z))
    #if 1
        #define __Pyx_c_abs_double(z)     (cabs(z))
        #define __Pyx_c_pow_double(a, b)  (cpow(a, b))
    #endif
 #endif
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
    #endif
#endif

/* CIntFromPy.proto */
static CYTHON_INLINE GLuint __Pyx_PyInt_As_GLuint(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE GLint __Pyx_PyInt_As_GLint(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE GLenum __Pyx_PyInt_As_GLenum(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE GLushort __Pyx_PyInt_As_GLushort(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE GLsizei __Pyx_PyInt_As_GLsizei(PyObject *);

/* SwapException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSwap(type, value, tb)  __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* CoroutineBase.proto */
typedef PyObject *(*__pyx_coroutine_body_t)(PyObject *, PyThreadState *, PyObject *);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_ExcInfoStruct  _PyErr_StackItem
#else
typedef struct {
    PyObject *exc_type;
    PyObject *exc_value;
    PyObject *exc_traceback;
} __Pyx_ExcInfoStruct;
#endif
typedef struct {
    PyObject_HEAD
    __pyx_coroutine_body_t body;
    PyObject *closure;
    __Pyx_ExcInfoStruct gi_exc_state;
    PyObject *gi_weakreflist;
    PyObject *classobj;
    PyObject *yieldfrom;
    PyObject *gi_name;
    PyObject *gi_qualname;
    PyObject *gi_modulename;
    PyObject *gi_code;
    int resume_label;
    char is_running;
} __pyx_CoroutineObject;
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
    PyTypeObject *type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
    PyObject *name, PyObject *qualname, PyObject *module_name);
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name);
static CYTHON_INLINE void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *self);
static int __Pyx_Coroutine_clear(PyObject *self);
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value);
static PyObject *__Pyx_Coroutine_Close(PyObject *self);
static PyObject *__Pyx_Coroutine_Throw(PyObject *gen, PyObject *args);
#if CYTHON_USE_EXC_INFO_STACK
#define __Pyx_Coroutine_SwapException(self)
#define __Pyx_Coroutine_ResetAndClearException(self)  __Pyx_Coroutine_ExceptionClear(&(self)->gi_exc_state)
#else
#define __Pyx_Coroutine_SwapException(self) {\
    __Pyx_ExceptionSwap(&(self)->gi_exc_state.exc_type, &(self)->gi_exc_state.exc_value, &(self)->gi_exc_state.exc_traceback);\
    __Pyx_Coroutine_ResetFrameBackpointer(&(self)->gi_exc_state);\
    }
#define __Pyx_Coroutine_ResetAndClearException(self) {\
    __Pyx_ExceptionReset((self)->gi_exc_state.exc_type, (self)->gi_exc_state.exc_value, (self)->gi_exc_state.exc_traceback);\
    (self)->gi_exc_state.exc_type = (self)->gi_exc_state.exc_value = (self)->gi_exc_state.exc_traceback = NULL;\
    }
#endif
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__pyx_tstate, pvalue)
#else
#define __Pyx_PyGen_FetchStopIterationValue(pvalue)\
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, pvalue)
#endif
static int __Pyx_PyGen__FetchStopIterationValue(PyThreadState *tstate, PyObject **pvalue);
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state);

/* PatchModuleWithCoroutine.proto */
static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code);

/* PatchGeneratorABC.proto */
static int __Pyx_patch_abc(void);

/* Generator.proto */
#define __Pyx_Generator_USED
static PyTypeObject *__pyx_GeneratorType = 0;
#define __Pyx_Generator_CheckExact(obj) (Py_TYPE(obj) == __pyx_GeneratorType)
#define __Pyx_Generator_New(body, code, closure, name, qualname, module_name)\
    __Pyx__Coroutine_New(__pyx_GeneratorType, body, code, closure, name, qualname, module_name)
static PyObject *__Pyx_Generator_Next(PyObject *self);
static int __pyx_Generator_init(void);

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* InitStrings.proto */
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);

static PyObject *__pyx_f_8CyOpenGL_8GLobject_set_material(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13MeshedSurface_build_arrays(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_15PoincarePolygon_triangulate(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self); /* proto*/
static double __pyx_f_8CyOpenGL_9Colorizer_index_to_hue(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, int __pyx_v_index); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_9Colorizer_hls_to_rgb(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, double __pyx_v_h, double __pyx_v_l, double __pyx_v_s); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_9Colorizer_hls_interp(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, double __pyx_v_m1, double __pyx_v_m2, double __pyx_v_hue); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_10Horosphere_build_vertices_and_normals(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_10Horosphere_build_triangles(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13HoroballGroup_get_list_ids(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_N); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13HoroballGroup_build_spheres(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_7EdgeSet_set_dark_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_7EdgeSet_set_light_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_20TriangulationEdgeSet_set_light_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_5Label_get_shape(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_build_shifts(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_T); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_right_top(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_gl_compile(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self); /* proto*/
static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_draw_segments(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_ford_height, PyObject *__pyx_v_pgram_height); /* proto*/

/* Module declarations from 'CyOpenGL' */
static PyTypeObject *__pyx_ptype_8CyOpenGL_vector3 = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_GL_context = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_GLobject = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_WireframeSphere = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_MeshedSurface = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_PoincareTriangle = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_PoincarePolygon = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_KleinPolygon = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_Colorizer = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_Horosphere = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_HoroballGroup = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_Parallelogram = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_EdgeSet = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_FordEdgeSet = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_TriangulationEdgeSet = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_Label = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_LabelSet = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL_HoroballScene = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_build_scene = 0;
static PyTypeObject *__pyx_ptype_8CyOpenGL___pyx_scope_struct_2_genexpr = 0;
__PYX_EXTERN_C PyObject *UCS2_hack(char *, Py_ssize_t, char *); /*proto*/
static PyObject *__pyx_f_8CyOpenGL_glTranslateScene(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_8CyOpenGL_glRotateScene(PyObject *, PyObject *, PyObject *, PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_8CyOpenGL___pyx_unpickle_HoroballGroup__set_state(struct __pyx_obj_8CyOpenGL_HoroballGroup *, PyObject *); /*proto*/
static PyObject *__pyx_f_8CyOpenGL___pyx_unpickle_Label__set_state(struct __pyx_obj_8CyOpenGL_Label *, PyObject *); /*proto*/
static PyObject *__pyx_f_8CyOpenGL___pyx_unpickle_HoroballScene__set_state(struct __pyx_obj_8CyOpenGL_HoroballScene *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_py_GLfloat(GLfloat *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_GLfloat(GLfloat *, Py_ssize_t); /*proto*/
static int __Pyx_carray_from_py_GLfloat(PyObject *, GLfloat *, Py_ssize_t); /*proto*/
#define __Pyx_MODULE_NAME "CyOpenGL"
extern int __pyx_module_is_main_CyOpenGL;
int __pyx_module_is_main_CyOpenGL = 0;

/* Implementation of 'CyOpenGL' */
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_zip;
static PyObject *__pyx_builtin_sum;
static PyObject *__pyx_builtin_round;
static PyObject *__pyx_builtin_OverflowError;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_IndexError;
static const char __pyx_k_R[] = "R";
static const char __pyx_k_T[] = "T";
static const char __pyx_k_V[] = "V";
static const char __pyx_k_b[] = "b";
static const char __pyx_k_g[] = "g";
static const char __pyx_k_h[] = "h";
static const char __pyx_k_n[] = "n";
static const char __pyx_k_r[] = "r";
static const char __pyx_k_t[] = "t";
static const char __pyx_k_w[] = "_w";
static const char __pyx_k_x[] = "x";
static const char __pyx_k_y[] = "y";
static const char __pyx_k_z[] = "z";
static const char __pyx_k_Tk[] = "Tk_";
static const char __pyx_k_VC[] = "VC";
static const char __pyx_k_kw[] = "kw";
static const char __pyx_k_os[] = "os";
static const char __pyx_k_pi[] = "pi";
static const char __pyx_k_s1[] = "s1";
static const char __pyx_k_s2[] = "s2";
static const char __pyx_k_tk[] = "-tk";
static const char __pyx_k_xy[] = "xy";
static const char __pyx_k_yz[] = "yz";
static const char __pyx_k_zx[] = "zx";
static const char __pyx_k_Map[] = "<Map>";
static const char __pyx_k__51[] = "";
static const char __pyx_k_cnf[] = "cnf";
static const char __pyx_k_cos[] = "cos";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_far[] = "far";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_hue[] = "hue";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_phi[] = "phi";
static const char __pyx_k_sin[] = "sin";
static const char __pyx_k_sum[] = "sum";
static const char __pyx_k_sys[] = "sys";
static const char __pyx_k_tan[] = "tan";
static const char __pyx_k_top[] = "top";
static const char __pyx_k_w_2[] = "w";
static const char __pyx_k_zip[] = "zip";
static const char __pyx_k_Misc[] = "Misc";
static const char __pyx_k_Togl[] = "Togl";
static const char __pyx_k_args[] = "args";
static const char __pyx_k_bind[] = "bind";
static const char __pyx_k_call[] = "call";
static const char __pyx_k_ceil[] = "ceil";
static const char __pyx_k_dark[] = "dark";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_draw[] = "draw";
static const char __pyx_k_face[] = "face";
static const char __pyx_k_file[] = "file";
static const char __pyx_k_fovy[] = "fovy";
static const char __pyx_k_hand[] = "hand";
static const char __pyx_k_help[] = "help";
static const char __pyx_k_imag[] = "imag";
static const char __pyx_k_init[] = "__init__";
static const char __pyx_k_join[] = "join";
static const char __pyx_k_list[] = "list";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_math[] = "math";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_nbhd[] = "nbhd";
static const char __pyx_k_near[] = "near";
static const char __pyx_k_norm[] = "norm";
static const char __pyx_k_objX[] = "objX";
static const char __pyx_k_objY[] = "objY";
static const char __pyx_k_objZ[] = "objZ";
static const char __pyx_k_path[] = "path";
static const char __pyx_k_pick[] = "pick";
static const char __pyx_k_proj[] = "proj";
static const char __pyx_k_real[] = "real";
static const char __pyx_k_repr[] = "__repr__";
static const char __pyx_k_root[] = "root";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_send[] = "send";
static const char __pyx_k_sqrt[] = "sqrt";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_time[] = "time";
static const char __pyx_k_tk_2[] = "tk";
static const char __pyx_k_togl[] = "togl";
static const char __pyx_k_view[] = "view";
static const char __pyx_k_xmax[] = "xmax";
static const char __pyx_k_ymax[] = "ymax";
static const char __pyx_k_zoom[] = "zoom";
static const char __pyx_k_64bit[] = "64bit";
static const char __pyx_k_Klein[] = "Klein";
static const char __pyx_k_Label[] = "Label";
static const char __pyx_k_after[] = "after";
static const char __pyx_k_alpha[] = "alpha";
static const char __pyx_k_close[] = "close";
static const char __pyx_k_color[] = "color";
static const char __pyx_k_dummy[] = "dummy";
static const char __pyx_k_event[] = "event";
static const char __pyx_k_fleur[] = "fleur";
static const char __pyx_k_floor[] = "floor";
static const char __pyx_k_index[] = "index";
static const char __pyx_k_linux[] = "linux";
static const char __pyx_k_major[] = "major";
static const char __pyx_k_minor[] = "minor";
static const char __pyx_k_model[] = "model";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_reset[] = "reset";
static const char __pyx_k_right[] = "right";
static const char __pyx_k_round[] = "round";
static const char __pyx_k_s_s_s[] = "< %s, %s, %s >";
static const char __pyx_k_scale[] = "scale";
static const char __pyx_k_theta[] = "theta";
static const char __pyx_k_throw[] = "throw";
static const char __pyx_k_tkMap[] = "tkMap";
static const char __pyx_k_width[] = "width";
static const char __pyx_k_win32[] = "win32";
static const char __pyx_k_yymax[] = "yymax";
static const char __pyx_k_Expose[] = "<Expose>";
static const char __pyx_k_Widget[] = "Widget";
static const char __pyx_k_Xangle[] = "Xangle";
static const char __pyx_k_Yangle[] = "Yangle";
static const char __pyx_k_append[] = "append";
static const char __pyx_k_aspect[] = "aspect";
static const char __pyx_k_b_back[] = "b_back";
static const char __pyx_k_center[] = "center";
static const char __pyx_k_config[] = "config";
static const char __pyx_k_cursor[] = "cursor";
static const char __pyx_k_cutoff[] = "cutoff";
static const char __pyx_k_darwin[] = "darwin";
static const char __pyx_k_dict_2[] = "dict";
static const char __pyx_k_exists[] = "exists";
static const char __pyx_k_file_2[] = "__file__";
static const char __pyx_k_g_back[] = "g_back";
static const char __pyx_k_getvar[] = "getvar";
static const char __pyx_k_height[] = "height";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_keysym[] = "keysym";
static const char __pyx_k_linux2[] = "linux2";
static const char __pyx_k_master[] = "master";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_r_back[] = "r_back";
static const char __pyx_k_radius[] = "radius";
static const char __pyx_k_random[] = "random";
static const char __pyx_k_redraw[] = "redraw";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_shifts[] = "shifts";
static const char __pyx_k_slices[] = "slices";
static const char __pyx_k_sphere[] = "sphere";
static const char __pyx_k_stacks[] = "stacks";
static const char __pyx_k_string[] = "string";
static const char __pyx_k_suffix[] = "suffix";
static const char __pyx_k_tmouse[] = "tmouse";
static const char __pyx_k_triple[] = "triple";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_vertex[] = "vertex";
static const char __pyx_k_x86_64[] = "-x86_64";
static const char __pyx_k_xmouse[] = "xmouse";
static const char __pyx_k_ymouse[] = "ymouse";
static const char __pyx_k_EdgeSet[] = "EdgeSet";
static const char __pyx_k_Tkinter[] = "Tkinter";
static const char __pyx_k_abspath[] = "abspath";
static const char __pyx_k_closest[] = "closest";
static const char __pyx_k_delta_t[] = "delta_t";
static const char __pyx_k_destroy[] = "destroy";
static const char __pyx_k_dirname[] = "dirname";
static const char __pyx_k_flipped[] = "flipped";
static const char __pyx_k_genexpr[] = "genexpr";
static const char __pyx_k_getitem[] = "__getitem__";
static const char __pyx_k_indices[] = "indices";
static const char __pyx_k_lappend[] = "lappend";
static const char __pyx_k_list_id[] = "list_id";
static const char __pyx_k_package[] = "package";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_require[] = "require";
static const char __pyx_k_tkPrint[] = "tkPrint";
static const char __pyx_k_tkScale[] = "tkScale";
static const char __pyx_k_tkinter[] = "tkinter";
static const char __pyx_k_tri_var[] = "tri_var";
static const char __pyx_k_vector3[] = "vector3";
static const char __pyx_k_xcenter[] = "xcenter";
static const char __pyx_k_ycenter[] = "ycenter";
static const char __pyx_k_zcenter[] = "zcenter";
static const char __pyx_k_Button_1[] = "<Button-1>";
static const char __pyx_k_Button_2[] = "<Button-2>";
static const char __pyx_k_Button_3[] = "<Button-3>";
static const char __pyx_k_CyOpenGL[] = "CyOpenGL";
static const char __pyx_k_Ford_var[] = "Ford_var";
static const char __pyx_k_GLobject[] = "GLobject";
static const char __pyx_k_GetColor[] = "GetColor";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_KeyPress[] = "<KeyPress>";
static const char __pyx_k_LabelSet[] = "LabelSet";
static const char __pyx_k_Poincare[] = "Poincare";
static const char __pyx_k_TclError[] = "TclError";
static const char __pyx_k_Togl_dir[] = "Togl_dir";
static const char __pyx_k_activate[] = "activate";
static const char __pyx_k_autospin[] = "autospin";
static const char __pyx_k_colorsys[] = "colorsys";
static const char __pyx_k_distance[] = "distance";
static const char __pyx_k_enumdict[] = "enumdict";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_horo_var[] = "horo_var";
static const char __pyx_k_meridian[] = "meridian";
static const char __pyx_k_platform[] = "platform";
static const char __pyx_k_position[] = "position";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_segments[] = "segments";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_tkExpose[] = "tkExpose";
static const char __pyx_k_tkRedraw[] = "tkRedraw";
static const char __pyx_k_tkRotate[] = "tkRotate";
static const char __pyx_k_triangle[] = "triangle";
static const char __pyx_k_vertices[] = "vertices";
static const char __pyx_k_B1_Motion[] = "<B1-Motion>";
static const char __pyx_k_B2_Motion[] = "<B2-Motion>";
static const char __pyx_k_B3_Motion[] = "<B3-Motion>";
static const char __pyx_k_Colorizer[] = "Colorizer";
static const char __pyx_k_Configure[] = "<Configure>";
static const char __pyx_k_GL_VENDOR[] = "GL_VENDOR";
static const char __pyx_k_GetString[] = "GetString";
static const char __pyx_k_Togl_path[] = "Togl_path";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_auto_path[] = "auto_path";
static const char __pyx_k_conjugate[] = "conjugate";
static const char __pyx_k_cpu_width[] = "cpu_width";
static const char __pyx_k_endpoints[] = "endpoints";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_facedicts[] = "facedicts";
static const char __pyx_k_full_list[] = "full_list";
static const char __pyx_k_help_text[] = "help_text";
static const char __pyx_k_horoballs[] = "horoballs";
static const char __pyx_k_int_label[] = "int_label";
static const char __pyx_k_label_var[] = "label_var";
static const char __pyx_k_lightness[] = "lightness";
static const char __pyx_k_longitude[] = "longitude";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_model_var[] = "model_var";
static const char __pyx_k_num_cusps[] = "num_cusps";
static const char __pyx_k_pgram_var[] = "pgram_var";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_subdivide[] = "subdivide";
static const char __pyx_k_triangles[] = "triangles";
static const char __pyx_k_GL_VERSION[] = "GL_VERSION";
static const char __pyx_k_GL_context[] = "GL_context";
static const char __pyx_k_Horosphere[] = "Horosphere";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_InfoDialog[] = "InfoDialog";
static const char __pyx_k_S_infinity[] = "S_infinity";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_draw_point[] = "draw_point";
static const char __pyx_k_hls_to_rgb[] = "hls_to_rgb";
static const char __pyx_k_infodialog[] = "infodialog";
static const char __pyx_k_key_action[] = "key_action";
static const char __pyx_k_mouse_pick[] = "mouse_pick";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_saturation[] = "saturation";
static const char __pyx_k_set_cutoff[] = "set_cutoff";
static const char __pyx_k_sphere_var[] = "sphere_var";
static const char __pyx_k_tkAutoSpin[] = "tkAutoSpin";
static const char __pyx_k_tkKeyPress[] = "tkKeyPress";
static const char __pyx_k_tk_version[] = "tk_version";
static const char __pyx_k_which_cusp[] = "which_cusp";
static const char __pyx_k_FordEdgeSet[] = "FordEdgeSet";
static const char __pyx_k_Ford_domain[] = "Ford_domain";
static const char __pyx_k_GL_RENDERER[] = "GL_RENDERER";
static const char __pyx_k_Klein_faces[] = "Klein_faces";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_StartRotate[] = "StartRotate";
static const char __pyx_k_Viewer_Help[] = "Viewer Help";
static const char __pyx_k_build_scene[] = "build_scene";
static const char __pyx_k_do_AutoSpin[] = "do_AutoSpin";
static const char __pyx_k_initialised[] = "initialised";
static const char __pyx_k_makecurrent[] = "makecurrent";
static const char __pyx_k_mouse_scale[] = "mouse_scale";
static const char __pyx_k_swapbuffers[] = "swapbuffers";
static const char __pyx_k_tkTranslate[] = "tkTranslate";
static const char __pyx_k_winfo_width[] = "winfo_width";
static const char __pyx_k_KleinPolygon[] = "KleinPolygon";
static const char __pyx_k_OpenGLWidget[] = "OpenGLWidget";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_TriangleMesh[] = "TriangleMesh";
static const char __pyx_k_architecture[] = "architecture";
static const char __pyx_k_delete_lists[] = "delete_lists";
static const char __pyx_k_mouse_rotate[] = "mouse_rotate";
static const char __pyx_k_mouse_update[] = "mouse_update";
static const char __pyx_k_norm_squared[] = "norm_squared";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_set_eyepoint[] = "set_eyepoint";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_tkHandlePick[] = "tkHandlePick";
static const char __pyx_k_translations[] = "translations";
static const char __pyx_k_use_material[] = "use_material";
static const char __pyx_k_version_info[] = "version_info";
static const char __pyx_k_winfo_height[] = "winfo_height";
static const char __pyx_k_GL_EXTENSIONS[] = "GL_EXTENSIONS";
static const char __pyx_k_HoroballGroup[] = "HoroballGroup";
static const char __pyx_k_HoroballScene[] = "HoroballScene";
static const char __pyx_k_MeshedSurface[] = "MeshedSurface";
static const char __pyx_k_OverflowError[] = "OverflowError";
static const char __pyx_k_Parallelogram[] = "Parallelogram";
static const char __pyx_k_back_specular[] = "back_specular";
static const char __pyx_k_curr_platform[] = "curr_platform";
static const char __pyx_k_face_specular[] = "face_specular";
static const char __pyx_k_klein_list_id[] = "klein_list_id";
static const char __pyx_k_new_triangles[] = "new_triangles";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_tkRecordMouse[] = "tkRecordMouse";
static const char __pyx_k_triangulation[] = "triangulation";
static const char __pyx_k_Poincare_faces[] = "Poincare_faces";
static const char __pyx_k_Shift_Button_1[] = "<Shift-Button-1>";
static const char __pyx_k_back_shininess[] = "back_shininess";
static const char __pyx_k_front_specular[] = "front_specular";
static const char __pyx_k_original_index[] = "original_index";
static const char __pyx_k_set_background[] = "set_background";
static const char __pyx_k_sphere_list_id[] = "sphere_list_id";
static const char __pyx_k_ButtonRelease_1[] = "<ButtonRelease-1>";
static const char __pyx_k_ButtonRelease_3[] = "<ButtonRelease-3>";
static const char __pyx_k_PoincarePolygon[] = "PoincarePolygon";
static const char __pyx_k_RawOpenGLWidget[] = "RawOpenGLWidget";
static const char __pyx_k_Shift_B1_Motion[] = "<Shift-B1-Motion>";
static const char __pyx_k_WireframeSphere[] = "WireframeSphere";
static const char __pyx_k_front_shininess[] = "front_shininess";
static const char __pyx_k_mouse_translate[] = "mouse_translate";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_set_centerpoint[] = "set_centerpoint";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_windows_version[] = "windows_version";
static const char __pyx_k_Control_Button_1[] = "<Control-Button-1>";
static const char __pyx_k_PoincareTriangle[] = "PoincareTriangle";
static const char __pyx_k_autospin_allowed[] = "autospin_allowed";
static const char __pyx_k_build_klein_poly[] = "build_klein_poly";
static const char __pyx_k_build_projection[] = "build_projection";
static const char __pyx_k_poincare_list_id[] = "poincare_list_id";
static const char __pyx_k_update_idletasks[] = "update_idletasks";
static const char __pyx_k_OpenGLOrthoWidget[] = "OpenGLOrthoWidget";
static const char __pyx_k_OpenGLWidget_help[] = "OpenGLWidget.help";
static const char __pyx_k_OpenGLWidget_zoom[] = "OpenGLWidget.zoom";
static const char __pyx_k_getwindowsversion[] = "getwindowsversion";
static const char __pyx_k_subdivision_depth[] = "subdivision_depth";
static const char __pyx_k_OpenGLWidget_reset[] = "OpenGLWidget.reset";
static const char __pyx_k_OpenGLWidget_tkMap[] = "OpenGLWidget.tkMap";
static const char __pyx_k_build_display_list[] = "build_display_list";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_pyx_unpickle_Label[] = "__pyx_unpickle_Label";
static const char __pyx_k_OpenGLWidget___init[] = "OpenGLWidget.__init__";
static const char __pyx_k_TriangleMesh___init[] = "TriangleMesh.__init__";
static const char __pyx_k_TriangleMesh___repr[] = "TriangleMesh.__repr__";
static const char __pyx_k_build_poincare_poly[] = "build_poincare_poly";
static const char __pyx_k_opengl_CyOpenGL_pyx[] = "opengl/CyOpenGL.pyx";
static const char __pyx_k_HyperbolicPolyhedron[] = "HyperbolicPolyhedron";
static const char __pyx_k_No_help_is_available[] = "No help is available.";
static const char __pyx_k_OpenGLWidget_tkPrint[] = "OpenGLWidget.tkPrint";
static const char __pyx_k_OpenGLWidget_tkScale[] = "OpenGLWidget.tkScale";
static const char __pyx_k_TriangulationEdgeSet[] = "TriangulationEdgeSet";
static const char __pyx_k_OpenGLWidget_activate[] = "OpenGLWidget.activate";
static const char __pyx_k_OpenGLWidget_tkExpose[] = "OpenGLWidget.tkExpose";
static const char __pyx_k_OpenGLWidget_tkRedraw[] = "OpenGLWidget.tkRedraw";
static const char __pyx_k_OpenGLWidget_tkRotate[] = "OpenGLWidget.tkRotate";
static const char __pyx_k_RawOpenGLWidget_tkMap[] = "RawOpenGLWidget.tkMap";
static const char __pyx_k_RawOpenGLWidget___init[] = "RawOpenGLWidget.__init__";
static const char __pyx_k_TriangleMesh___getitem[] = "TriangleMesh.__getitem__";
static const char __pyx_k_TriangleMesh_subdivide[] = "TriangleMesh.subdivide";
static const char __pyx_k_draw_locals_draw_point[] = "draw.<locals>.draw_point";
static const char __pyx_k_OpenGLWidget_tkAutoSpin[] = "OpenGLWidget.tkAutoSpin";
static const char __pyx_k_OpenGLWidget_tkKeyPress[] = "OpenGLWidget.tkKeyPress";
static const char __pyx_k_OpenGLOrthoWidget_redraw[] = "OpenGLOrthoWidget.redraw";
static const char __pyx_k_OpenGLWidget_StartRotate[] = "OpenGLWidget.StartRotate";
static const char __pyx_k_OpenGLWidget_do_AutoSpin[] = "OpenGLWidget.do_AutoSpin";
static const char __pyx_k_OpenGLWidget_tkTranslate[] = "OpenGLWidget.tkTranslate";
static const char __pyx_k_RawOpenGLWidget_tkExpose[] = "RawOpenGLWidget.tkExpose";
static const char __pyx_k_RawOpenGLWidget_tkRedraw[] = "RawOpenGLWidget.tkRedraw";
static const char __pyx_k_Togl_directory_s_missing[] = "Togl directory \"%s\" missing.";
static const char __pyx_k_vector3___repr___line_51[] = "vector3.__repr__ (line 51)";
static const char __pyx_k_HyperbolicPolyhedron_draw[] = "HyperbolicPolyhedron.draw";
static const char __pyx_k_OpenGLWidget_mouse_update[] = "OpenGLWidget.mouse_update";
static const char __pyx_k_OpenGLWidget_set_eyepoint[] = "OpenGLWidget.set_eyepoint";
static const char __pyx_k_OpenGLWidget_tkHandlePick[] = "OpenGLWidget.tkHandlePick";
static const char __pyx_k_vector3_0_1_2_0_0_1_0_2_0[] = "\n        >>> vector3( (0, 1, 2) )\n        < 0.0, 1.0, 2.0 >\n        ";
static const char __pyx_k_OpenGLWidget_tkRecordMouse[] = "OpenGLWidget.tkRecordMouse";
static const char __pyx_k_build_scene_locals_genexpr[] = "build_scene.<locals>.genexpr";
static const char __pyx_k_pyx_unpickle_HoroballGroup[] = "__pyx_unpickle_HoroballGroup";
static const char __pyx_k_pyx_unpickle_HoroballScene[] = "__pyx_unpickle_HoroballScene";
static const char __pyx_k_HyperbolicPolyhedron___init[] = "HyperbolicPolyhedron.__init__";
static const char __pyx_k_OpenGLWidget_set_background[] = "OpenGLWidget.set_background";
static const char __pyx_k_HyperbolicPolyhedron_destroy[] = "HyperbolicPolyhedron.destroy";
static const char __pyx_k_OpenGLWidget_set_centerpoint[] = "OpenGLWidget.set_centerpoint";
static const char __pyx_k_OpenGLOrthoWidget_tkTranslate[] = "OpenGLOrthoWidget.tkTranslate";
static const char __pyx_k_OpenGLWidget_build_projection[] = "OpenGLWidget.build_projection";
static const char __pyx_k_Control_Button_1_ButtonRelease[] = "<Control-Button-1><ButtonRelease-1>";
static const char __pyx_k_Tkinter_bindings_for_an_OpenGL[] = "\n    Tkinter bindings for an OpenGL widget.\n    Mike Hartshorn\n    Department of Chemistry\n    University of York, UK\n    http://www.yorvic.york.ac.uk/~mjh/\n    ";
static const char __pyx_k_A_hyperbolic_polyhedron_for_dis[] = "\n   A hyperbolic polyhedron for display in OpenGL, either in the Klein\n   model or the Poincare model.  Includes a representation of the\n   sphere at infinity.  It is initialized with the SnapPea description\n   of the faces of a Dirichlet domain, represented as a list of\n   dictionaries.\n   ";
static const char __pyx_k_A_triangle_which_can_tessellate[] = "\n    A triangle which can tessellate itself.\n    ";
static const char __pyx_k_A_version_of_the_widget_that_us[] = "\n    A version of the widget that uses orthographic projection instead\n    of perspective.\n    ";
static const char __pyx_k_Widget_without_any_sophisticate[] = "\n    Widget without any sophisticated bindings\n    by Tom Schwaller\n    ";
static const char __pyx_k_HyperbolicPolyhedron_build_klein[] = "HyperbolicPolyhedron.build_klein_poly";
static const char __pyx_k_HyperbolicPolyhedron_build_poinc[] = "HyperbolicPolyhedron.build_poincare_poly";
static const char __pyx_k_Incompatible_checksums_s_vs_0x0a[] = "Incompatible checksums (%s vs 0x0a6b5be = (centers, color, cutoff, horoballs, keys, list_id_base, list_ids, longitude, meridian, num_lists, original_indices, spheres))";
static const char __pyx_k_Incompatible_checksums_s_vs_0x8c[] = "Incompatible checksums (%s vs 0x8c950d7 = (codes, x, y))";
static const char __pyx_k_Incompatible_checksums_s_vs_0xcc[] = "Incompatible checksums (%s vs 0xcc0e0ec = (Ford, Ford_dark_list_id, Ford_light_list_id, Ford_var, Xangle, Yangle, ball_list_id, cusp_view, cutoff, flipped, horo_var, label_var, labels, labels_list_id, longitude, meridian, nbhd, offset, pgram, pgram_list_id, pgram_var, shifts, tri, tri_dark_list_id, tri_light_list_id, tri_var, which_cusp))";
static const char __pyx_k_Invalid_enum_Must_be_GL_VENDOR_G[] = "Invalid enum. Must be 'GL_VENDOR', 'GL_RENDERER', 'GL_VERSION', or 'GL_EXTENSIONS'";
static const char __pyx_k_No_result_is_there_a_current_Ope[] = "No result - is there a current OpenGL context?";
static const char __pyx_k_OpenGLOrthoWidget_build_projecti[] = "OpenGLOrthoWidget.build_projection";
static const char __pyx_k_Sorry_this_implementation_was_re[] = "Sorry, this implementation was removed";
static const char __pyx_k_Tcl_can_not_find_Togl_even_thoug[] = "Tcl can not find Togl even though directory %s exists";
static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
static PyObject *__pyx_kp_s_64bit;
static PyObject *__pyx_kp_s_A_hyperbolic_polyhedron_for_dis;
static PyObject *__pyx_kp_s_A_triangle_which_can_tessellate;
static PyObject *__pyx_kp_s_A_version_of_the_widget_that_us;
static PyObject *__pyx_kp_s_B1_Motion;
static PyObject *__pyx_kp_s_B2_Motion;
static PyObject *__pyx_kp_s_B3_Motion;
static PyObject *__pyx_kp_s_ButtonRelease_1;
static PyObject *__pyx_kp_s_ButtonRelease_3;
static PyObject *__pyx_kp_s_Button_1;
static PyObject *__pyx_kp_s_Button_2;
static PyObject *__pyx_kp_s_Button_3;
static PyObject *__pyx_n_s_Colorizer;
static PyObject *__pyx_kp_s_Configure;
static PyObject *__pyx_kp_s_Control_Button_1;
static PyObject *__pyx_kp_s_Control_Button_1_ButtonRelease;
static PyObject *__pyx_n_s_CyOpenGL;
static PyObject *__pyx_n_s_EdgeSet;
static PyObject *__pyx_kp_s_Expose;
static PyObject *__pyx_n_s_FordEdgeSet;
static PyObject *__pyx_n_s_Ford_domain;
static PyObject *__pyx_n_s_Ford_var;
static PyObject *__pyx_n_s_GL_EXTENSIONS;
static PyObject *__pyx_n_s_GL_RENDERER;
static PyObject *__pyx_n_s_GL_VENDOR;
static PyObject *__pyx_n_s_GL_VERSION;
static PyObject *__pyx_n_s_GL_context;
static PyObject *__pyx_n_s_GLobject;
static PyObject *__pyx_n_s_GetColor;
static PyObject *__pyx_n_s_GetString;
static PyObject *__pyx_n_s_HoroballGroup;
static PyObject *__pyx_n_s_HoroballScene;
static PyObject *__pyx_n_s_Horosphere;
static PyObject *__pyx_n_s_HyperbolicPolyhedron;
static PyObject *__pyx_n_s_HyperbolicPolyhedron___init;
static PyObject *__pyx_n_s_HyperbolicPolyhedron_build_klein;
static PyObject *__pyx_n_s_HyperbolicPolyhedron_build_poinc;
static PyObject *__pyx_n_s_HyperbolicPolyhedron_destroy;
static PyObject *__pyx_n_s_HyperbolicPolyhedron_draw;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x0a;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x8c;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xcc;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_n_s_InfoDialog;
static PyObject *__pyx_kp_s_Invalid_enum_Must_be_GL_VENDOR_G;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_kp_s_KeyPress;
static PyObject *__pyx_n_s_Klein;
static PyObject *__pyx_n_s_KleinPolygon;
static PyObject *__pyx_n_s_Klein_faces;
static PyObject *__pyx_n_s_Label;
static PyObject *__pyx_n_s_LabelSet;
static PyObject *__pyx_kp_s_Map;
static PyObject *__pyx_n_s_MeshedSurface;
static PyObject *__pyx_n_s_Misc;
static PyObject *__pyx_kp_s_No_help_is_available;
static PyObject *__pyx_kp_s_No_result_is_there_a_current_Ope;
static PyObject *__pyx_n_s_OpenGLOrthoWidget;
static PyObject *__pyx_n_s_OpenGLOrthoWidget_build_projecti;
static PyObject *__pyx_n_s_OpenGLOrthoWidget_redraw;
static PyObject *__pyx_n_s_OpenGLOrthoWidget_tkTranslate;
static PyObject *__pyx_n_s_OpenGLWidget;
static PyObject *__pyx_n_s_OpenGLWidget_StartRotate;
static PyObject *__pyx_n_s_OpenGLWidget___init;
static PyObject *__pyx_n_s_OpenGLWidget_activate;
static PyObject *__pyx_n_s_OpenGLWidget_build_projection;
static PyObject *__pyx_n_s_OpenGLWidget_do_AutoSpin;
static PyObject *__pyx_n_s_OpenGLWidget_help;
static PyObject *__pyx_n_s_OpenGLWidget_mouse_update;
static PyObject *__pyx_n_s_OpenGLWidget_reset;
static PyObject *__pyx_n_s_OpenGLWidget_set_background;
static PyObject *__pyx_n_s_OpenGLWidget_set_centerpoint;
static PyObject *__pyx_n_s_OpenGLWidget_set_eyepoint;
static PyObject *__pyx_n_s_OpenGLWidget_tkAutoSpin;
static PyObject *__pyx_n_s_OpenGLWidget_tkExpose;
static PyObject *__pyx_n_s_OpenGLWidget_tkHandlePick;
static PyObject *__pyx_n_s_OpenGLWidget_tkKeyPress;
static PyObject *__pyx_n_s_OpenGLWidget_tkMap;
static PyObject *__pyx_n_s_OpenGLWidget_tkPrint;
static PyObject *__pyx_n_s_OpenGLWidget_tkRecordMouse;
static PyObject *__pyx_n_s_OpenGLWidget_tkRedraw;
static PyObject *__pyx_n_s_OpenGLWidget_tkRotate;
static PyObject *__pyx_n_s_OpenGLWidget_tkScale;
static PyObject *__pyx_n_s_OpenGLWidget_tkTranslate;
static PyObject *__pyx_n_s_OpenGLWidget_zoom;
static PyObject *__pyx_n_s_OverflowError;
static PyObject *__pyx_n_s_Parallelogram;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_n_s_Poincare;
static PyObject *__pyx_n_s_PoincarePolygon;
static PyObject *__pyx_n_s_PoincareTriangle;
static PyObject *__pyx_n_s_Poincare_faces;
static PyObject *__pyx_n_s_R;
static PyObject *__pyx_n_s_RawOpenGLWidget;
static PyObject *__pyx_n_s_RawOpenGLWidget___init;
static PyObject *__pyx_n_s_RawOpenGLWidget_tkExpose;
static PyObject *__pyx_n_s_RawOpenGLWidget_tkMap;
static PyObject *__pyx_n_s_RawOpenGLWidget_tkRedraw;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_S_infinity;
static PyObject *__pyx_kp_s_Shift_B1_Motion;
static PyObject *__pyx_kp_s_Shift_Button_1;
static PyObject *__pyx_kp_s_Sorry_this_implementation_was_re;
static PyObject *__pyx_n_s_StartRotate;
static PyObject *__pyx_n_s_T;
static PyObject *__pyx_n_s_TclError;
static PyObject *__pyx_kp_s_Tcl_can_not_find_Togl_even_thoug;
static PyObject *__pyx_n_s_Tk;
static PyObject *__pyx_n_s_Tkinter;
static PyObject *__pyx_kp_s_Tkinter_bindings_for_an_OpenGL;
static PyObject *__pyx_n_s_Togl;
static PyObject *__pyx_n_s_Togl_dir;
static PyObject *__pyx_kp_s_Togl_directory_s_missing;
static PyObject *__pyx_n_s_Togl_path;
static PyObject *__pyx_n_s_TriangleMesh;
static PyObject *__pyx_n_s_TriangleMesh___getitem;
static PyObject *__pyx_n_s_TriangleMesh___init;
static PyObject *__pyx_n_s_TriangleMesh___repr;
static PyObject *__pyx_n_s_TriangleMesh_subdivide;
static PyObject *__pyx_n_s_TriangulationEdgeSet;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_V;
static PyObject *__pyx_n_s_VC;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_kp_s_Viewer_Help;
static PyObject *__pyx_n_s_Widget;
static PyObject *__pyx_kp_s_Widget_without_any_sophisticate;
static PyObject *__pyx_n_s_WireframeSphere;
static PyObject *__pyx_n_s_Xangle;
static PyObject *__pyx_n_s_Yangle;
static PyObject *__pyx_n_s__51;
static PyObject *__pyx_n_s_abspath;
static PyObject *__pyx_n_s_activate;
static PyObject *__pyx_n_s_after;
static PyObject *__pyx_n_s_alpha;
static PyObject *__pyx_n_s_append;
static PyObject *__pyx_n_s_architecture;
static PyObject *__pyx_n_s_args;
static PyObject *__pyx_n_s_aspect;
static PyObject *__pyx_n_s_auto_path;
static PyObject *__pyx_n_s_autospin;
static PyObject *__pyx_n_s_autospin_allowed;
static PyObject *__pyx_n_s_b;
static PyObject *__pyx_n_s_b_back;
static PyObject *__pyx_n_s_back_shininess;
static PyObject *__pyx_n_s_back_specular;
static PyObject *__pyx_n_s_bind;
static PyObject *__pyx_n_s_build_display_list;
static PyObject *__pyx_n_s_build_klein_poly;
static PyObject *__pyx_n_s_build_poincare_poly;
static PyObject *__pyx_n_s_build_projection;
static PyObject *__pyx_n_s_build_scene;
static PyObject *__pyx_n_s_build_scene_locals_genexpr;
static PyObject *__pyx_n_s_call;
static PyObject *__pyx_n_s_ceil;
static PyObject *__pyx_n_s_center;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_close;
static PyObject *__pyx_n_s_closest;
static PyObject *__pyx_n_s_cnf;
static PyObject *__pyx_n_s_color;
static PyObject *__pyx_n_s_colorsys;
static PyObject *__pyx_n_s_config;
static PyObject *__pyx_n_s_conjugate;
static PyObject *__pyx_n_s_cos;
static PyObject *__pyx_n_s_cpu_width;
static PyObject *__pyx_n_s_curr_platform;
static PyObject *__pyx_n_s_cursor;
static PyObject *__pyx_n_s_cutoff;
static PyObject *__pyx_n_s_dark;
static PyObject *__pyx_n_s_darwin;
static PyObject *__pyx_n_s_delete_lists;
static PyObject *__pyx_n_s_delta_t;
static PyObject *__pyx_n_s_destroy;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dict_2;
static PyObject *__pyx_n_s_dirname;
static PyObject *__pyx_n_s_distance;
static PyObject *__pyx_n_s_do_AutoSpin;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_draw;
static PyObject *__pyx_n_s_draw_locals_draw_point;
static PyObject *__pyx_n_s_draw_point;
static PyObject *__pyx_n_s_dummy;
static PyObject *__pyx_n_s_endpoints;
static PyObject *__pyx_n_s_enumdict;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_event;
static PyObject *__pyx_n_s_exists;
static PyObject *__pyx_n_s_face;
static PyObject *__pyx_n_s_face_specular;
static PyObject *__pyx_n_s_facedicts;
static PyObject *__pyx_n_s_far;
static PyObject *__pyx_n_s_file;
static PyObject *__pyx_n_s_file_2;
static PyObject *__pyx_n_s_fleur;
static PyObject *__pyx_n_s_flipped;
static PyObject *__pyx_n_s_floor;
static PyObject *__pyx_n_s_fovy;
static PyObject *__pyx_n_s_front_shininess;
static PyObject *__pyx_n_s_front_specular;
static PyObject *__pyx_n_s_full_list;
static PyObject *__pyx_n_s_g;
static PyObject *__pyx_n_s_g_back;
static PyObject *__pyx_n_s_genexpr;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_getitem;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_getvar;
static PyObject *__pyx_n_s_getwindowsversion;
static PyObject *__pyx_n_s_h;
static PyObject *__pyx_n_s_hand;
static PyObject *__pyx_n_s_height;
static PyObject *__pyx_n_s_help;
static PyObject *__pyx_n_s_help_text;
static PyObject *__pyx_n_s_hls_to_rgb;
static PyObject *__pyx_n_s_horo_var;
static PyObject *__pyx_n_s_horoballs;
static PyObject *__pyx_n_s_hue;
static PyObject *__pyx_n_s_imag;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_index;
static PyObject *__pyx_n_s_indices;
static PyObject *__pyx_n_s_infodialog;
static PyObject *__pyx_n_s_init;
static PyObject *__pyx_n_s_initialised;
static PyObject *__pyx_n_s_int_label;
static PyObject *__pyx_n_s_join;
static PyObject *__pyx_n_s_key_action;
static PyObject *__pyx_n_s_keysym;
static PyObject *__pyx_n_s_klein_list_id;
static PyObject *__pyx_n_s_kw;
static PyObject *__pyx_n_s_label_var;
static PyObject *__pyx_n_s_lappend;
static PyObject *__pyx_n_s_lightness;
static PyObject *__pyx_n_s_linux;
static PyObject *__pyx_n_s_linux2;
static PyObject *__pyx_n_s_list;
static PyObject *__pyx_n_s_list_id;
static PyObject *__pyx_n_s_longitude;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_major;
static PyObject *__pyx_n_s_makecurrent;
static PyObject *__pyx_n_s_master;
static PyObject *__pyx_n_s_math;
static PyObject *__pyx_n_s_meridian;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_s_minor;
static PyObject *__pyx_n_s_model;
static PyObject *__pyx_n_s_model_var;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_mouse_pick;
static PyObject *__pyx_n_s_mouse_rotate;
static PyObject *__pyx_n_s_mouse_scale;
static PyObject *__pyx_n_s_mouse_translate;
static PyObject *__pyx_n_s_mouse_update;
static PyObject *__pyx_n_s_n;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_nbhd;
static PyObject *__pyx_n_s_near;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_new_triangles;
static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
static PyObject *__pyx_n_s_norm;
static PyObject *__pyx_n_s_norm_squared;
static PyObject *__pyx_n_s_num_cusps;
static PyObject *__pyx_n_s_objX;
static PyObject *__pyx_n_s_objY;
static PyObject *__pyx_n_s_objZ;
static PyObject *__pyx_kp_s_opengl_CyOpenGL_pyx;
static PyObject *__pyx_n_s_original_index;
static PyObject *__pyx_n_s_os;
static PyObject *__pyx_n_s_package;
static PyObject *__pyx_n_s_path;
static PyObject *__pyx_n_s_pgram_var;
static PyObject *__pyx_n_s_phi;
static PyObject *__pyx_n_s_pi;
static PyObject *__pyx_n_s_pick;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_platform;
static PyObject *__pyx_n_s_poincare_list_id;
static PyObject *__pyx_n_s_position;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_proj;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_HoroballGroup;
static PyObject *__pyx_n_s_pyx_unpickle_HoroballScene;
static PyObject *__pyx_n_s_pyx_unpickle_Label;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_r;
static PyObject *__pyx_n_s_r_back;
static PyObject *__pyx_n_s_radius;
static PyObject *__pyx_n_s_random;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_real;
static PyObject *__pyx_n_s_redraw;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_repr;
static PyObject *__pyx_n_s_require;
static PyObject *__pyx_n_s_reset;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_right;
static PyObject *__pyx_n_s_root;
static PyObject *__pyx_n_s_round;
static PyObject *__pyx_n_s_s1;
static PyObject *__pyx_n_s_s2;
static PyObject *__pyx_kp_s_s_s_s;
static PyObject *__pyx_n_s_saturation;
static PyObject *__pyx_n_s_scale;
static PyObject *__pyx_n_s_segments;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_n_s_send;
static PyObject *__pyx_n_s_set_background;
static PyObject *__pyx_n_s_set_centerpoint;
static PyObject *__pyx_n_s_set_cutoff;
static PyObject *__pyx_n_s_set_eyepoint;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_shifts;
static PyObject *__pyx_n_s_sin;
static PyObject *__pyx_n_s_slices;
static PyObject *__pyx_n_s_sphere;
static PyObject *__pyx_n_s_sphere_list_id;
static PyObject *__pyx_n_s_sphere_var;
static PyObject *__pyx_n_s_sqrt;
static PyObject *__pyx_n_s_stacks;
static PyObject *__pyx_n_s_string;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_subdivide;
static PyObject *__pyx_n_s_subdivision_depth;
static PyObject *__pyx_n_s_suffix;
static PyObject *__pyx_n_s_sum;
static PyObject *__pyx_n_s_swapbuffers;
static PyObject *__pyx_n_s_sys;
static PyObject *__pyx_n_s_t;
static PyObject *__pyx_n_s_tan;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_theta;
static PyObject *__pyx_n_s_throw;
static PyObject *__pyx_n_s_time;
static PyObject *__pyx_kp_s_tk;
static PyObject *__pyx_n_s_tkAutoSpin;
static PyObject *__pyx_n_s_tkExpose;
static PyObject *__pyx_n_s_tkHandlePick;
static PyObject *__pyx_n_s_tkKeyPress;
static PyObject *__pyx_n_s_tkMap;
static PyObject *__pyx_n_s_tkPrint;
static PyObject *__pyx_n_s_tkRecordMouse;
static PyObject *__pyx_n_s_tkRedraw;
static PyObject *__pyx_n_s_tkRotate;
static PyObject *__pyx_n_s_tkScale;
static PyObject *__pyx_n_s_tkTranslate;
static PyObject *__pyx_n_s_tk_2;
static PyObject *__pyx_n_s_tk_version;
static PyObject *__pyx_n_s_tkinter;
static PyObject *__pyx_n_s_tmouse;
static PyObject *__pyx_n_s_togl;
static PyObject *__pyx_n_s_top;
static PyObject *__pyx_n_s_translations;
static PyObject *__pyx_n_s_tri_var;
static PyObject *__pyx_n_s_triangle;
static PyObject *__pyx_n_s_triangles;
static PyObject *__pyx_n_s_triangulation;
static PyObject *__pyx_n_s_triple;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_s_update_idletasks;
static PyObject *__pyx_n_s_use_material;
static PyObject *__pyx_n_s_vector3;
static PyObject *__pyx_kp_u_vector3_0_1_2_0_0_1_0_2_0;
static PyObject *__pyx_kp_u_vector3___repr___line_51;
static PyObject *__pyx_n_s_version_info;
static PyObject *__pyx_n_s_vertex;
static PyObject *__pyx_n_s_vertices;
static PyObject *__pyx_n_s_view;
static PyObject *__pyx_n_s_w;
static PyObject *__pyx_n_s_w_2;
static PyObject *__pyx_n_s_which_cusp;
static PyObject *__pyx_n_s_width;
static PyObject *__pyx_n_s_win32;
static PyObject *__pyx_n_s_windows_version;
static PyObject *__pyx_n_s_winfo_height;
static PyObject *__pyx_n_s_winfo_width;
static PyObject *__pyx_n_s_x;
static PyObject *__pyx_kp_s_x86_64;
static PyObject *__pyx_n_s_xcenter;
static PyObject *__pyx_n_s_xmax;
static PyObject *__pyx_n_s_xmouse;
static PyObject *__pyx_n_s_xy;
static PyObject *__pyx_n_s_y;
static PyObject *__pyx_n_s_ycenter;
static PyObject *__pyx_n_s_ymax;
static PyObject *__pyx_n_s_ymouse;
static PyObject *__pyx_n_s_yymax;
static PyObject *__pyx_n_s_yz;
static PyObject *__pyx_n_s_z;
static PyObject *__pyx_n_s_zcenter;
static PyObject *__pyx_n_s_zip;
static PyObject *__pyx_n_s_zoom;
static PyObject *__pyx_n_s_zx;
static PyObject *__pyx_pf_8CyOpenGL_GetString(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string); /* proto */
static int __pyx_pf_8CyOpenGL_7vector3___cinit__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, PyObject *__pyx_v_triple); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_2__repr__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_4__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_6__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_8__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar); /* proto */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_8CyOpenGL_7vector3_10__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar); /* proto */
#endif
static PyObject *__pyx_pf_8CyOpenGL_7vector3_12__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_1x___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_1y___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_1z___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_12norm_squared___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_4norm___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7vector3_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_10GL_context___cinit__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GL_context *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_10GL_context_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GL_context *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_10GL_context_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GL_context *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_8GLobject___cinit__(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_front_specular, PyObject *__pyx_v_back_specular, PyObject *__pyx_v_front_shininess, PyObject *__pyx_v_back_shininess, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8GLobject_2draw(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8GLobject_4build_display_list(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, PyObject *__pyx_v_list_id, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8GLobject_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8GLobject_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_4draw_draw_point(PyObject *__pyx_self, PyObject *__pyx_v_phi, PyObject *__pyx_v_theta); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_draw(struct __pyx_obj_8CyOpenGL_WireframeSphere *__pyx_v_self, GLfloat __pyx_v_radius, GLint __pyx_v_slices, GLint __pyx_v_stacks); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_WireframeSphere *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_WireframeSphere *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vertices); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh_6subdivide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static void __pyx_pf_8CyOpenGL_13MeshedSurface___dealloc__(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13MeshedSurface_2draw(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self, PyObject *__pyx_v_use_material); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13MeshedSurface_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13MeshedSurface_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_16PoincareTriangle___init__(struct __pyx_obj_8CyOpenGL_PoincareTriangle *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_center, PyObject *__pyx_v_subdivision_depth, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_16PoincareTriangle_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_PoincareTriangle *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_16PoincareTriangle_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_PoincareTriangle *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_15PoincarePolygon___init__(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_center, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15PoincarePolygon_2draw(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15PoincarePolygon_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15PoincarePolygon_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_12KleinPolygon___init__(struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_closest, CYTHON_UNUSED PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12KleinPolygon_2draw(struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12KleinPolygon_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12KleinPolygon_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_facedicts, PyObject *__pyx_v_model_var, PyObject *__pyx_v_sphere_var); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_2destroy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_4draw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_6build_klein_poly(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_list); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_8build_poincare_poly(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_list); /* proto */
static int __pyx_pf_8CyOpenGL_9Colorizer___cinit__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self); /* proto */
static int __pyx_pf_8CyOpenGL_9Colorizer_2__init__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, PyObject *__pyx_v_lightness, PyObject *__pyx_v_saturation, PyObject *__pyx_v_alpha); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_9Colorizer_4__call__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_9Colorizer_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_9Colorizer_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_10Horosphere___init__(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_color, PyObject *__pyx_v_radius, CYTHON_UNUSED PyObject *__pyx_v_front_specular, CYTHON_UNUSED PyObject *__pyx_v_back_specular, CYTHON_UNUSED PyObject *__pyx_v_front_shininess, CYTHON_UNUSED PyObject *__pyx_v_back_shininess); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_10Horosphere_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_10Horosphere_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_13HoroballGroup___init__(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_horoballs, PyObject *__pyx_v_indices, PyObject *__pyx_v_meridian, PyObject *__pyx_v_longitude); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_2delete_lists(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_4draw(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_T); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_6build_display_list(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_list_id, PyObject *__pyx_v_R, PyObject *__pyx_v_T); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_8__reduce_cython__(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_10__setstate_cython__(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13Parallelogram_draw(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Parallelogram *__pyx_v_self, PyObject *__pyx_v_s1, PyObject *__pyx_v_s2); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13Parallelogram_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Parallelogram *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13Parallelogram_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Parallelogram *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_7EdgeSet___init__(struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self, PyObject *__pyx_v_segments, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7EdgeSet_2draw(struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self, PyObject *__pyx_v_shifts, PyObject *__pyx_v_dark); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7EdgeSet_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_7EdgeSet_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_11FordEdgeSet___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_FordEdgeSet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_11FordEdgeSet_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_FordEdgeSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_20TriangulationEdgeSet___init__(struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self, PyObject *__pyx_v_triangulation, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_20TriangulationEdgeSet_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_20TriangulationEdgeSet_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_5Label___init__(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self, PyObject *__pyx_v_position, PyObject *__pyx_v_int_label); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_5Label_2draw(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_5Label_4__reduce_cython__(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_5Label_6__setstate_cython__(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_8LabelSet___init__(struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self, PyObject *__pyx_v_triangulation, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8LabelSet_2draw(struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self, PyObject *__pyx_v_shifts); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8LabelSet_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8LabelSet_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_8CyOpenGL_13HoroballScene___init__(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_nbhd, PyObject *__pyx_v_pgram_var, PyObject *__pyx_v_Ford_var, PyObject *__pyx_v_tri_var, PyObject *__pyx_v_horo_var, PyObject *__pyx_v_label_var, PyObject *__pyx_v_flipped, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_which_cusp); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_2destroy(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_4set_cutoff(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_cutoff); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_6flip(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_boolean_value); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_11build_scene_genexpr(PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_8build_scene(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_full_list); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_10translate(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_z); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_12draw(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_14__reduce_cython__(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_16__setstate_cython__(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_master, PyObject *__pyx_v_cnf, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget_2tkRedraw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget_4tkMap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget_6tkExpose(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_master, PyObject *__pyx_v_help, PyObject *__pyx_v_mouse_pick, PyObject *__pyx_v_mouse_rotate, PyObject *__pyx_v_mouse_translate, PyObject *__pyx_v_mouse_scale, PyObject *__pyx_v_fovy, PyObject *__pyx_v_near, PyObject *__pyx_v_far, PyObject *__pyx_v_cnf, PyObject *__pyx_v_kw); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_2help(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_4activate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_6set_background(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_r, PyObject *__pyx_v_g, PyObject *__pyx_v_b); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_8set_centerpoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_z); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_10set_eyepoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_distance); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_12reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_redraw); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_14tkHandlePick(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_16tkRecordMouse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_18StartRotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_20tkScale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_22zoom(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_24do_AutoSpin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_26tkAutoSpin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_28tkRotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_30tkTranslate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_32mouse_update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_34tkRedraw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_36build_projection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_38tkMap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_40tkExpose(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_42tkKeyPress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_44tkPrint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_file); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_build_projection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, CYTHON_UNUSED PyObject *__pyx_v_t); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_2tkTranslate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_4redraw(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_2__pyx_unpickle_HoroballGroup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_4__pyx_unpickle_Label(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_8CyOpenGL_6__pyx_unpickle_HoroballScene(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_8CyOpenGL_vector3(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_GL_context(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_GLobject(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_WireframeSphere(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_MeshedSurface(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_PoincareTriangle(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_PoincarePolygon(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_KleinPolygon(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_Colorizer(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_Horosphere(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_HoroballGroup(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_Parallelogram(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_EdgeSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_FordEdgeSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_TriangulationEdgeSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_Label(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_LabelSet(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL_HoroballScene(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL___pyx_scope_struct__draw(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL___pyx_scope_struct_1_build_scene(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_8CyOpenGL___pyx_scope_struct_2_genexpr(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_float__2;
static PyObject *__pyx_float_0_;
static PyObject *__pyx_float_1_;
static PyObject *__pyx_float_0_0;
static PyObject *__pyx_float_0_1;
static PyObject *__pyx_float_0_3;
static PyObject *__pyx_float_0_5;
static PyObject *__pyx_float_0_6;
static PyObject *__pyx_float_0_8;
static PyObject *__pyx_float_0_9;
static PyObject *__pyx_float_1_0;
static PyObject *__pyx_float_2_0;
static PyObject *__pyx_float_2_2;
static PyObject *__pyx_float_0_01;
static PyObject *__pyx_float_0_05;
static PyObject *__pyx_float_10_0;
static PyObject *__pyx_float_30_0;
static PyObject *__pyx_float_50_0;
static PyObject *__pyx_float_100_0;
static PyObject *__pyx_float_360_0;
static PyObject *__pyx_float_neg_2_0;
static PyObject *__pyx_float_neg_2_2;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_3;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_5;
static PyObject *__pyx_int_6;
static PyObject *__pyx_int_8;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_30;
static PyObject *__pyx_int_60;
static PyObject *__pyx_int_100;
static PyObject *__pyx_int_10925502;
static PyObject *__pyx_int_147411159;
static PyObject *__pyx_int_213967084;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_k__7;
static PyObject *__pyx_k__8;
static PyObject *__pyx_k__9;
static PyObject *__pyx_k__30;
static PyObject *__pyx_k__31;
static PyObject *__pyx_k__32;
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_slice__47;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__130;
static PyObject *__pyx_tuple__132;
static PyObject *__pyx_tuple__134;
static PyObject *__pyx_tuple__136;
static PyObject *__pyx_tuple__138;
static PyObject *__pyx_codeobj__13;
static PyObject *__pyx_codeobj__53;
static PyObject *__pyx_codeobj__55;
static PyObject *__pyx_codeobj__57;
static PyObject *__pyx_codeobj__59;
static PyObject *__pyx_codeobj__61;
static PyObject *__pyx_codeobj__63;
static PyObject *__pyx_codeobj__65;
static PyObject *__pyx_codeobj__67;
static PyObject *__pyx_codeobj__69;
static PyObject *__pyx_codeobj__71;
static PyObject *__pyx_codeobj__73;
static PyObject *__pyx_codeobj__75;
static PyObject *__pyx_codeobj__77;
static PyObject *__pyx_codeobj__79;
static PyObject *__pyx_codeobj__81;
static PyObject *__pyx_codeobj__83;
static PyObject *__pyx_codeobj__85;
static PyObject *__pyx_codeobj__87;
static PyObject *__pyx_codeobj__89;
static PyObject *__pyx_codeobj__91;
static PyObject *__pyx_codeobj__93;
static PyObject *__pyx_codeobj__96;
static PyObject *__pyx_codeobj__98;
static PyObject *__pyx_codeobj__100;
static PyObject *__pyx_codeobj__102;
static PyObject *__pyx_codeobj__104;
static PyObject *__pyx_codeobj__106;
static PyObject *__pyx_codeobj__108;
static PyObject *__pyx_codeobj__110;
static PyObject *__pyx_codeobj__112;
static PyObject *__pyx_codeobj__114;
static PyObject *__pyx_codeobj__116;
static PyObject *__pyx_codeobj__118;
static PyObject *__pyx_codeobj__120;
static PyObject *__pyx_codeobj__122;
static PyObject *__pyx_codeobj__124;
static PyObject *__pyx_codeobj__126;
static PyObject *__pyx_codeobj__128;
static PyObject *__pyx_codeobj__131;
static PyObject *__pyx_codeobj__133;
static PyObject *__pyx_codeobj__135;
static PyObject *__pyx_codeobj__137;
static PyObject *__pyx_codeobj__139;
/* Late includes */

/* "CyOpenGL.pyx":4
 * 
 * # This is part of the UCS2 hack.
 * cdef public UCS2_hack (char *string, Py_ssize_t length, char *errors) :             # <<<<<<<<<<<<<<
 *     return string
 * 
 */

PyObject *UCS2_hack(char *__pyx_v_string, CYTHON_UNUSED Py_ssize_t __pyx_v_length, CYTHON_UNUSED char *__pyx_v_errors) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("UCS2_hack", 0);

  /* "CyOpenGL.pyx":5
 * # This is part of the UCS2 hack.
 * cdef public UCS2_hack (char *string, Py_ssize_t length, char *errors) :
 *     return string             # <<<<<<<<<<<<<<
 * 
 * from .infodialog import InfoDialog
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":4
 * 
 * # This is part of the UCS2 hack.
 * cdef public UCS2_hack (char *string, Py_ssize_t length, char *errors) :             # <<<<<<<<<<<<<<
 *     return string
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.UCS2_hack", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":22
 *     import tkinter as Tk_
 * 
 * def GetString(string):             # <<<<<<<<<<<<<<
 *     enumdict = {
 *         'GL_VENDOR': GL_VENDOR,
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_1GetString(PyObject *__pyx_self, PyObject *__pyx_v_string); /*proto*/
static char __pyx_doc_8CyOpenGL_GetString[] = "GetString(string)";
static PyMethodDef __pyx_mdef_8CyOpenGL_1GetString = {"GetString", (PyCFunction)__pyx_pw_8CyOpenGL_1GetString, METH_O, __pyx_doc_8CyOpenGL_GetString};
static PyObject *__pyx_pw_8CyOpenGL_1GetString(PyObject *__pyx_self, PyObject *__pyx_v_string) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("GetString (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_GetString(__pyx_self, ((PyObject *)__pyx_v_string));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_GetString(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_string) {
  PyObject *__pyx_v_enumdict = NULL;
  char const *__pyx_v_result;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  GLenum __pyx_t_6;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("GetString", 0);

  /* "CyOpenGL.pyx":24
 * def GetString(string):
 *     enumdict = {
 *         'GL_VENDOR': GL_VENDOR,             # <<<<<<<<<<<<<<
 *         'GL_RENDERER': GL_RENDERER,
 *         'GL_VERSION': GL_VERSION,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_int(GL_VENDOR); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_GL_VENDOR, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":25
 *     enumdict = {
 *         'GL_VENDOR': GL_VENDOR,
 *         'GL_RENDERER': GL_RENDERER,             # <<<<<<<<<<<<<<
 *         'GL_VERSION': GL_VERSION,
 *         'GL_EXTENSIONS': GL_EXTENSIONS}
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GL_RENDERER); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_GL_RENDERER, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":26
 *         'GL_VENDOR': GL_VENDOR,
 *         'GL_RENDERER': GL_RENDERER,
 *         'GL_VERSION': GL_VERSION,             # <<<<<<<<<<<<<<
 *         'GL_EXTENSIONS': GL_EXTENSIONS}
 *     try:
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GL_VERSION); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 26, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_GL_VERSION, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":27
 *         'GL_RENDERER': GL_RENDERER,
 *         'GL_VERSION': GL_VERSION,
 *         'GL_EXTENSIONS': GL_EXTENSIONS}             # <<<<<<<<<<<<<<
 *     try:
 *         result = <const char*>glGetString(enumdict[string])
 */
  __pyx_t_2 = __Pyx_PyInt_From_int(GL_EXTENSIONS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 27, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_GL_EXTENSIONS, __pyx_t_2) < 0) __PYX_ERR(0, 24, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_enumdict = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":28
 *         'GL_VERSION': GL_VERSION,
 *         'GL_EXTENSIONS': GL_EXTENSIONS}
 *     try:             # <<<<<<<<<<<<<<
 *         result = <const char*>glGetString(enumdict[string])
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "CyOpenGL.pyx":29
 *         'GL_EXTENSIONS': GL_EXTENSIONS}
 *     try:
 *         result = <const char*>glGetString(enumdict[string])             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError(
 */
      __pyx_t_1 = __Pyx_PyDict_GetItem(__pyx_v_enumdict, __pyx_v_string); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 29, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = __Pyx_PyInt_As_GLenum(__pyx_t_1); if (unlikely((__pyx_t_6 == ((GLenum)-1)) && PyErr_Occurred())) __PYX_ERR(0, 29, __pyx_L3_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_v_result = ((char const *)glGetString(__pyx_t_6));

      /* "CyOpenGL.pyx":28
 *         'GL_VERSION': GL_VERSION,
 *         'GL_EXTENSIONS': GL_EXTENSIONS}
 *     try:             # <<<<<<<<<<<<<<
 *         result = <const char*>glGetString(enumdict[string])
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":30
 *     try:
 *         result = <const char*>glGetString(enumdict[string])
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError(
 *             "Invalid enum. Must be 'GL_VENDOR', 'GL_RENDERER', 'GL_VERSION', or 'GL_EXTENSIONS'")
 */
    __pyx_t_7 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_7) {
      __Pyx_AddTraceback("CyOpenGL.GetString", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_2, &__pyx_t_8) < 0) __PYX_ERR(0, 30, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GOTREF(__pyx_t_8);

      /* "CyOpenGL.pyx":31
 *         result = <const char*>glGetString(enumdict[string])
 *     except KeyError:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Invalid enum. Must be 'GL_VENDOR', 'GL_RENDERER', 'GL_VERSION', or 'GL_EXTENSIONS'")
 *     if result:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 31, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(0, 31, __pyx_L5_except_error)
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "CyOpenGL.pyx":28
 *         'GL_VERSION': GL_VERSION,
 *         'GL_EXTENSIONS': GL_EXTENSIONS}
 *     try:             # <<<<<<<<<<<<<<
 *         result = <const char*>glGetString(enumdict[string])
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L8_try_end:;
  }

  /* "CyOpenGL.pyx":33
 *         raise ValueError(
 *             "Invalid enum. Must be 'GL_VENDOR', 'GL_RENDERER', 'GL_VERSION', or 'GL_EXTENSIONS'")
 *     if result:             # <<<<<<<<<<<<<<
 *         return result
 *     else:
 */
  __pyx_t_10 = (__pyx_v_result != 0);
  if (likely(__pyx_t_10)) {

    /* "CyOpenGL.pyx":34
 *             "Invalid enum. Must be 'GL_VENDOR', 'GL_RENDERER', 'GL_VERSION', or 'GL_EXTENSIONS'")
 *     if result:
 *         return result             # <<<<<<<<<<<<<<
 *     else:
 *         raise RuntimeError('No result - is there a current OpenGL context?')
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_8 = __Pyx_PyBytes_FromString(__pyx_v_result); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 34, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __pyx_r = __pyx_t_8;
    __pyx_t_8 = 0;
    goto __pyx_L0;

    /* "CyOpenGL.pyx":33
 *         raise ValueError(
 *             "Invalid enum. Must be 'GL_VENDOR', 'GL_RENDERER', 'GL_VERSION', or 'GL_EXTENSIONS'")
 *     if result:             # <<<<<<<<<<<<<<
 *         return result
 *     else:
 */
  }

  /* "CyOpenGL.pyx":36
 *         return result
 *     else:
 *         raise RuntimeError('No result - is there a current OpenGL context?')             # <<<<<<<<<<<<<<
 * 
 * cdef class vector3:
 */
  /*else*/ {
    __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 36, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_Raise(__pyx_t_8, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __PYX_ERR(0, 36, __pyx_L1_error)
  }

  /* "CyOpenGL.pyx":22
 *     import tkinter as Tk_
 * 
 * def GetString(string):             # <<<<<<<<<<<<<<
 *     enumdict = {
 *         'GL_VENDOR': GL_VENDOR,
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("CyOpenGL.GetString", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_enumdict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":46
 *     cdef readonly double x, y, z, norm_squared, norm
 * 
 *     def __cinit__(self, triple):             # <<<<<<<<<<<<<<
 *         self.x, self.y, self.z = triple
 *         self.norm_squared = self.x*self.x + self.y*self.y + self.z*self.z
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_7vector3_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_7vector3_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_triple = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_triple,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_triple)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 46, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_triple = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 46, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.vector3.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3___cinit__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self), __pyx_v_triple);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_7vector3___cinit__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, PyObject *__pyx_v_triple) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  double __pyx_t_6;
  double __pyx_t_7;
  double __pyx_t_8;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "CyOpenGL.pyx":47
 * 
 *     def __cinit__(self, triple):
 *         self.x, self.y, self.z = triple             # <<<<<<<<<<<<<<
 *         self.norm_squared = self.x*self.x + self.y*self.y + self.z*self.z
 *         self.norm = sqrt(self.norm_squared)
 */
  if ((likely(PyTuple_CheckExact(__pyx_v_triple))) || (PyList_CheckExact(__pyx_v_triple))) {
    PyObject* sequence = __pyx_v_triple;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 47, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_2 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_v_triple); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 47, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 2; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 3) < 0) __PYX_ERR(0, 47, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 47, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_7 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 47, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->x = __pyx_t_6;
  __pyx_v_self->y = __pyx_t_7;
  __pyx_v_self->z = __pyx_t_8;

  /* "CyOpenGL.pyx":48
 *     def __cinit__(self, triple):
 *         self.x, self.y, self.z = triple
 *         self.norm_squared = self.x*self.x + self.y*self.y + self.z*self.z             # <<<<<<<<<<<<<<
 *         self.norm = sqrt(self.norm_squared)
 * 
 */
  __pyx_v_self->norm_squared = (((__pyx_v_self->x * __pyx_v_self->x) + (__pyx_v_self->y * __pyx_v_self->y)) + (__pyx_v_self->z * __pyx_v_self->z));

  /* "CyOpenGL.pyx":49
 *         self.x, self.y, self.z = triple
 *         self.norm_squared = self.x*self.x + self.y*self.y + self.z*self.z
 *         self.norm = sqrt(self.norm_squared)             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->norm_squared); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_1) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 49, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->norm = __pyx_t_8;

  /* "CyOpenGL.pyx":46
 *     cdef readonly double x, y, z, norm_squared, norm
 * 
 *     def __cinit__(self, triple):             # <<<<<<<<<<<<<<
 *         self.x, self.y, self.z = triple
 *         self.norm_squared = self.x*self.x + self.y*self.y + self.z*self.z
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("CyOpenGL.vector3.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":51
 *         self.norm = sqrt(self.norm_squared)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> vector3( (0, 1, 2) )
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_3__repr__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8CyOpenGL_7vector3_2__repr__[] = "\n        >>> vector3( (0, 1, 2) )\n        < 0.0, 1.0, 2.0 >\n        ";
#if CYTHON_COMPILING_IN_CPYTHON
struct wrapperbase __pyx_wrapperbase_8CyOpenGL_7vector3_2__repr__;
#endif
static PyObject *__pyx_pw_8CyOpenGL_7vector3_3__repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_2__repr__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_2__repr__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "CyOpenGL.pyx":56
 *         < 0.0, 1.0, 2.0 >
 *         """
 *         return '< %s, %s, %s >'%(self.x, self.y, self.z)             # <<<<<<<<<<<<<<
 * 
 *     def __add__(self, vector):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->z); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_s_s_s, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":51
 *         self.norm = sqrt(self.norm_squared)
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         """
 *         >>> vector3( (0, 1, 2) )
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("CyOpenGL.vector3.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":58
 *         return '< %s, %s, %s >'%(self.x, self.y, self.z)
 * 
 *     def __add__(self, vector):             # <<<<<<<<<<<<<<
 *         return vector3([self.x+vector.x, self.y+vector.y, self.z+vector.z])
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_5__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_5__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__add__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_4__add__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_vector));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_4__add__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__add__", 0);

  /* "CyOpenGL.pyx":59
 * 
 *     def __add__(self, vector):
 *         return vector3([self.x+vector.x, self.y+vector.y, self.z+vector.z])             # <<<<<<<<<<<<<<
 * 
 *     def __sub__(self, vector):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8CyOpenGL_vector3), __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 59, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":58
 *         return '< %s, %s, %s >'%(self.x, self.y, self.z)
 * 
 *     def __add__(self, vector):             # <<<<<<<<<<<<<<
 *         return vector3([self.x+vector.x, self.y+vector.y, self.z+vector.z])
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.vector3.__add__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":61
 *         return vector3([self.x+vector.x, self.y+vector.y, self.z+vector.z])
 * 
 *     def __sub__(self, vector):             # <<<<<<<<<<<<<<
 *         return vector3([self.x-vector.x, self.y-vector.y, self.z-vector.z])
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_7__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_7__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__sub__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_6__sub__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_vector));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_6__sub__(PyObject *__pyx_v_self, PyObject *__pyx_v_vector) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__sub__", 0);

  /* "CyOpenGL.pyx":62
 * 
 *     def __sub__(self, vector):
 *         return vector3([self.x-vector.x, self.y-vector.y, self.z-vector.z])             # <<<<<<<<<<<<<<
 * 
 *     def __mul__(self, scalar):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Subtract(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_vector, __pyx_n_s_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyList_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8CyOpenGL_vector3), __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 62, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":61
 *         return vector3([self.x+vector.x, self.y+vector.y, self.z+vector.z])
 * 
 *     def __sub__(self, vector):             # <<<<<<<<<<<<<<
 *         return vector3([self.x-vector.x, self.y-vector.y, self.z-vector.z])
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.vector3.__sub__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":64
 *         return vector3([self.x-vector.x, self.y-vector.y, self.z-vector.z])
 * 
 *     def __mul__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x*scalar, self.y*scalar, self.z*scalar])
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_9__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_9__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__mul__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_8__mul__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_scalar));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_8__mul__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__mul__", 0);

  /* "CyOpenGL.pyx":65
 * 
 *     def __mul__(self, scalar):
 *         return vector3([self.x*scalar, self.y*scalar, self.z*scalar])             # <<<<<<<<<<<<<<
 * 
 *     def __div__(self, scalar):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_scalar); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_scalar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_v_scalar); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8CyOpenGL_vector3), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":64
 *         return vector3([self.x-vector.x, self.y-vector.y, self.z-vector.z])
 * 
 *     def __mul__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x*scalar, self.y*scalar, self.z*scalar])
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("CyOpenGL.vector3.__mul__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":67
 *         return vector3([self.x*scalar, self.y*scalar, self.z*scalar])
 * 
 *     def __div__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
 */

/* Python wrapper */
#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pw_8CyOpenGL_7vector3_11__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_11__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__div__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_10__div__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_scalar));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/

#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
static PyObject *__pyx_pf_8CyOpenGL_7vector3_10__div__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__div__", 0);

  /* "CyOpenGL.pyx":68
 * 
 *     def __div__(self, scalar):
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])             # <<<<<<<<<<<<<<
 * 
 *     def __truediv__(self, scalar):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_scalar); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_scalar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_scalar); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8CyOpenGL_vector3), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 68, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":67
 *         return vector3([self.x*scalar, self.y*scalar, self.z*scalar])
 * 
 *     def __div__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("CyOpenGL.vector3.__div__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
#endif /*!(#if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000))*/

/* "CyOpenGL.pyx":70
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
 *     def __truediv__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_13__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_13__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__truediv__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_12__truediv__(((PyObject *)__pyx_v_self), ((PyObject *)__pyx_v_scalar));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_12__truediv__(PyObject *__pyx_v_self, PyObject *__pyx_v_scalar) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("__truediv__", 0);

  /* "CyOpenGL.pyx":71
 * 
 *     def __truediv__(self, scalar):
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])             # <<<<<<<<<<<<<<
 * 
 * cdef class GL_context:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_scalar); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_scalar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_scalar); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8CyOpenGL_vector3), __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":70
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
 *     def __truediv__(self, scalar):             # <<<<<<<<<<<<<<
 *         return vector3([self.x/scalar, self.y/scalar, self.z/scalar])
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("CyOpenGL.vector3.__truediv__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":44
 *     Attributes include its norm and the square of its norm.
 *     """
 *     cdef readonly double x, y, z, norm_squared, norm             # <<<<<<<<<<<<<<
 * 
 *     def __cinit__(self, triple):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_1x_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_1x_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_1x___get__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_1x___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.vector3.x.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_1y_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_1y_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_1y___get__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_1y___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.vector3.y.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_1z_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_1z_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_1z___get__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_1z___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.vector3.z.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_12norm_squared_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_12norm_squared_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_12norm_squared___get__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_12norm_squared___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->norm_squared); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.vector3.norm_squared.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_4norm_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_7vector3_4norm_1__get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_4norm___get__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_4norm___get__(struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->norm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 44, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.vector3.norm.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_7vector3_14__reduce_cython__[] = "vector3.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_7vector3_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_14__reduce_cython__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_14__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.vector3.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7vector3_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_7vector3_16__setstate_cython__[] = "vector3.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_7vector3_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7vector3_16__setstate_cython__(((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7vector3_16__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.vector3.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":78
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         # Lighting intensities and location
 *         cdef GLfloat* ambient = [0.75, 0.75, 0.75, 1.0]
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_10GL_context_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_10GL_context_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_8CyOpenGL_10GL_context___cinit__(((struct __pyx_obj_8CyOpenGL_GL_context *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_10GL_context___cinit__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GL_context *__pyx_v_self) {
  GLfloat *__pyx_v_ambient;
  GLfloat *__pyx_v_lightdiffuse;
  GLfloat *__pyx_v_lightspecular;
  GLfloat *__pyx_v_lightposition0;
  GLfloat *__pyx_v_lightposition1;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  GLfloat __pyx_t_1[4];
  GLfloat __pyx_t_2[4];
  GLfloat __pyx_t_3[4];
  GLfloat __pyx_t_4[4];
  GLfloat __pyx_t_5[4];
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "CyOpenGL.pyx":80
 *     def __cinit__(self):
 *         # Lighting intensities and location
 *         cdef GLfloat* ambient = [0.75, 0.75, 0.75, 1.0]             # <<<<<<<<<<<<<<
 *         cdef GLfloat* lightdiffuse = [0.8, 0.8, 0.8, 1.0]
 *         cdef GLfloat* lightspecular = [0.3, 0.3, 0.3, 1.0]
 */
  __pyx_t_1[0] = 0.75;
  __pyx_t_1[1] = 0.75;
  __pyx_t_1[2] = 0.75;
  __pyx_t_1[3] = 1.0;
  __pyx_v_ambient = __pyx_t_1;

  /* "CyOpenGL.pyx":81
 *         # Lighting intensities and location
 *         cdef GLfloat* ambient = [0.75, 0.75, 0.75, 1.0]
 *         cdef GLfloat* lightdiffuse = [0.8, 0.8, 0.8, 1.0]             # <<<<<<<<<<<<<<
 *         cdef GLfloat* lightspecular = [0.3, 0.3, 0.3, 1.0]
 *         # 2 units from the center, up and to the right
 */
  __pyx_t_2[0] = 0.8;
  __pyx_t_2[1] = 0.8;
  __pyx_t_2[2] = 0.8;
  __pyx_t_2[3] = 1.0;
  __pyx_v_lightdiffuse = __pyx_t_2;

  /* "CyOpenGL.pyx":82
 *         cdef GLfloat* ambient = [0.75, 0.75, 0.75, 1.0]
 *         cdef GLfloat* lightdiffuse = [0.8, 0.8, 0.8, 1.0]
 *         cdef GLfloat* lightspecular = [0.3, 0.3, 0.3, 1.0]             # <<<<<<<<<<<<<<
 *         # 2 units from the center, up and to the right
 *         # we should be able to control the light
 */
  __pyx_t_3[0] = 0.3;
  __pyx_t_3[1] = 0.3;
  __pyx_t_3[2] = 0.3;
  __pyx_t_3[3] = 1.0;
  __pyx_v_lightspecular = __pyx_t_3;

  /* "CyOpenGL.pyx":85
 *         # 2 units from the center, up and to the right
 *         # we should be able to control the light
 *         cdef GLfloat* lightposition0 = [0.3, 0.5, 3.0, 1.0]             # <<<<<<<<<<<<<<
 *         cdef GLfloat* lightposition1 = [0.3, -0.5, -3.0, 1.0]
 * 
 */
  __pyx_t_4[0] = 0.3;
  __pyx_t_4[1] = 0.5;
  __pyx_t_4[2] = 3.0;
  __pyx_t_4[3] = 1.0;
  __pyx_v_lightposition0 = __pyx_t_4;

  /* "CyOpenGL.pyx":86
 *         # we should be able to control the light
 *         cdef GLfloat* lightposition0 = [0.3, 0.5, 3.0, 1.0]
 *         cdef GLfloat* lightposition1 = [0.3, -0.5, -3.0, 1.0]             # <<<<<<<<<<<<<<
 * 
 *         ## Set parameters that apply to all objects:
 */
  __pyx_t_5[0] = 0.3;
  __pyx_t_5[1] = -0.5;
  __pyx_t_5[2] = -3.0;
  __pyx_t_5[3] = 1.0;
  __pyx_v_lightposition1 = __pyx_t_5;

  /* "CyOpenGL.pyx":90
 *         ## Set parameters that apply to all objects:
 *         # Remove hidden stuff
 *         glEnable(GL_DEPTH_TEST)             # <<<<<<<<<<<<<<
 *         # Allow transparency
 *         # glEnable(GL_ALPHA_TEST)
 */
  glEnable(GL_DEPTH_TEST);

  /* "CyOpenGL.pyx":93
 *         # Allow transparency
 *         # glEnable(GL_ALPHA_TEST)
 *         glEnable(GL_BLEND)             # <<<<<<<<<<<<<<
 *         glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
 *         # Enable anti-aliasing of points lines and polygons
 */
  glEnable(GL_BLEND);

  /* "CyOpenGL.pyx":94
 *         # glEnable(GL_ALPHA_TEST)
 *         glEnable(GL_BLEND)
 *         glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)             # <<<<<<<<<<<<<<
 *         # Enable anti-aliasing of points lines and polygons
 *         glEnable(GL_POINT_SMOOTH)
 */
  glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

  /* "CyOpenGL.pyx":96
 *         glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)
 *         # Enable anti-aliasing of points lines and polygons
 *         glEnable(GL_POINT_SMOOTH)             # <<<<<<<<<<<<<<
 *         glEnable(GL_LINE_SMOOTH)
 *         #Below call is deprecated and causes odd behavior on some systems.
 */
  glEnable(GL_POINT_SMOOTH);

  /* "CyOpenGL.pyx":97
 *         # Enable anti-aliasing of points lines and polygons
 *         glEnable(GL_POINT_SMOOTH)
 *         glEnable(GL_LINE_SMOOTH)             # <<<<<<<<<<<<<<
 *         #Below call is deprecated and causes odd behavior on some systems.
 *         #glEnable(GL_POLYGON_SMOOTH)
 */
  glEnable(GL_LINE_SMOOTH);

  /* "CyOpenGL.pyx":101
 *         #glEnable(GL_POLYGON_SMOOTH)
 *         # Use lights and materials to determine colors
 *         glEnable(GL_LIGHTING)             # <<<<<<<<<<<<<<
 *         # Make the Color command control ambient and diffuse material colors
 *         glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE)
 */
  glEnable(GL_LIGHTING);

  /* "CyOpenGL.pyx":103
 *         glEnable(GL_LIGHTING)
 *         # Make the Color command control ambient and diffuse material colors
 *         glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE)             # <<<<<<<<<<<<<<
 *         glEnable(GL_COLOR_MATERIAL)
 *         # Use interpolated shading (although colors are constant on faces)
 */
  glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE);

  /* "CyOpenGL.pyx":104
 *         # Make the Color command control ambient and diffuse material colors
 *         glColorMaterial(GL_FRONT_AND_BACK, GL_AMBIENT_AND_DIFFUSE)
 *         glEnable(GL_COLOR_MATERIAL)             # <<<<<<<<<<<<<<
 *         # Use interpolated shading (although colors are constant on faces)
 *         glShadeModel(GL_SMOOTH)
 */
  glEnable(GL_COLOR_MATERIAL);

  /* "CyOpenGL.pyx":106
 *         glEnable(GL_COLOR_MATERIAL)
 *         # Use interpolated shading (although colors are constant on faces)
 *         glShadeModel(GL_SMOOTH)             # <<<<<<<<<<<<<<
 *         # Define the counter-clockwise (outer) face to be the front.
 *         glFrontFace(GL_CCW)
 */
  glShadeModel(GL_SMOOTH);

  /* "CyOpenGL.pyx":108
 *         glShadeModel(GL_SMOOTH)
 *         # Define the counter-clockwise (outer) face to be the front.
 *         glFrontFace(GL_CCW)             # <<<<<<<<<<<<<<
 *         # Rasterize front and back Faces
 *         glDisable(GL_CULL_FACE)
 */
  glFrontFace(GL_CCW);

  /* "CyOpenGL.pyx":110
 *         glFrontFace(GL_CCW)
 *         # Rasterize front and back Faces
 *         glDisable(GL_CULL_FACE)             # <<<<<<<<<<<<<<
 *         ## Set up lighting
 *         # Allow different properties on fronts and backs
 */
  glDisable(GL_CULL_FACE);

  /* "CyOpenGL.pyx":113
 *         ## Set up lighting
 *         # Allow different properties on fronts and backs
 *         glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, 1.0)             # <<<<<<<<<<<<<<
 *         # Compute specular reflections from the eye
 *         glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, True)
 */
  glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, 1.0);

  /* "CyOpenGL.pyx":115
 *         glLightModelf(GL_LIGHT_MODEL_TWO_SIDE, 1.0)
 *         # Compute specular reflections from the eye
 *         glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, True)             # <<<<<<<<<<<<<<
 *         # Ambient light intensity for the entire scene
 *         glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient)
 */
  glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, 1);

  /* "CyOpenGL.pyx":117
 *         glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, True)
 *         # Ambient light intensity for the entire scene
 *         glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient)             # <<<<<<<<<<<<<<
 *         # Enable two lights, with attenuation
 *         glEnable(GL_LIGHT0)
 */
  glLightModelfv(GL_LIGHT_MODEL_AMBIENT, __pyx_v_ambient);

  /* "CyOpenGL.pyx":119
 *         glLightModelfv(GL_LIGHT_MODEL_AMBIENT, ambient)
 *         # Enable two lights, with attenuation
 *         glEnable(GL_LIGHT0)             # <<<<<<<<<<<<<<
 *         glLightfv(GL_LIGHT0, GL_POSITION, lightposition0)
 *         glLightfv(GL_LIGHT0, GL_DIFFUSE, lightdiffuse)
 */
  glEnable(GL_LIGHT0);

  /* "CyOpenGL.pyx":120
 *         # Enable two lights, with attenuation
 *         glEnable(GL_LIGHT0)
 *         glLightfv(GL_LIGHT0, GL_POSITION, lightposition0)             # <<<<<<<<<<<<<<
 *         glLightfv(GL_LIGHT0, GL_DIFFUSE, lightdiffuse)
 *         glLightfv(GL_LIGHT0, GL_SPECULAR, lightspecular)
 */
  glLightfv(GL_LIGHT0, GL_POSITION, __pyx_v_lightposition0);

  /* "CyOpenGL.pyx":121
 *         glEnable(GL_LIGHT0)
 *         glLightfv(GL_LIGHT0, GL_POSITION, lightposition0)
 *         glLightfv(GL_LIGHT0, GL_DIFFUSE, lightdiffuse)             # <<<<<<<<<<<<<<
 *         glLightfv(GL_LIGHT0, GL_SPECULAR, lightspecular)
 *         glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION,  1.0)
 */
  glLightfv(GL_LIGHT0, GL_DIFFUSE, __pyx_v_lightdiffuse);

  /* "CyOpenGL.pyx":122
 *         glLightfv(GL_LIGHT0, GL_POSITION, lightposition0)
 *         glLightfv(GL_LIGHT0, GL_DIFFUSE, lightdiffuse)
 *         glLightfv(GL_LIGHT0, GL_SPECULAR, lightspecular)             # <<<<<<<<<<<<<<
 *         glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION,  1.0)
 *         glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1)
 */
  glLightfv(GL_LIGHT0, GL_SPECULAR, __pyx_v_lightspecular);

  /* "CyOpenGL.pyx":123
 *         glLightfv(GL_LIGHT0, GL_DIFFUSE, lightdiffuse)
 *         glLightfv(GL_LIGHT0, GL_SPECULAR, lightspecular)
 *         glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION,  1.0)             # <<<<<<<<<<<<<<
 *         glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1)
 *         glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08)
 */
  glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION, 1.0);

  /* "CyOpenGL.pyx":124
 *         glLightfv(GL_LIGHT0, GL_SPECULAR, lightspecular)
 *         glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION,  1.0)
 *         glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1)             # <<<<<<<<<<<<<<
 *         glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08)
 *         glDisable(GL_LIGHT1)
 */
  glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1);

  /* "CyOpenGL.pyx":125
 *         glLightf(GL_LIGHT0, GL_CONSTANT_ATTENUATION,  1.0)
 *         glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1)
 *         glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08)             # <<<<<<<<<<<<<<
 *         glDisable(GL_LIGHT1)
 *         glLightfv(GL_LIGHT1, GL_POSITION, lightposition1)
 */
  glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08);

  /* "CyOpenGL.pyx":126
 *         glLightf(GL_LIGHT0, GL_LINEAR_ATTENUATION, 0.1)
 *         glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08)
 *         glDisable(GL_LIGHT1)             # <<<<<<<<<<<<<<
 *         glLightfv(GL_LIGHT1, GL_POSITION, lightposition1)
 *         glLightfv(GL_LIGHT1, GL_DIFFUSE, lightdiffuse)
 */
  glDisable(GL_LIGHT1);

  /* "CyOpenGL.pyx":127
 *         glLightf(GL_LIGHT0, GL_QUADRATIC_ATTENUATION, 0.08)
 *         glDisable(GL_LIGHT1)
 *         glLightfv(GL_LIGHT1, GL_POSITION, lightposition1)             # <<<<<<<<<<<<<<
 *         glLightfv(GL_LIGHT1, GL_DIFFUSE, lightdiffuse)
 *         glLightfv(GL_LIGHT1, GL_SPECULAR, lightspecular)
 */
  glLightfv(GL_LIGHT1, GL_POSITION, __pyx_v_lightposition1);

  /* "CyOpenGL.pyx":128
 *         glDisable(GL_LIGHT1)
 *         glLightfv(GL_LIGHT1, GL_POSITION, lightposition1)
 *         glLightfv(GL_LIGHT1, GL_DIFFUSE, lightdiffuse)             # <<<<<<<<<<<<<<
 *         glLightfv(GL_LIGHT1, GL_SPECULAR, lightspecular)
 *         glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION,  1.0)
 */
  glLightfv(GL_LIGHT1, GL_DIFFUSE, __pyx_v_lightdiffuse);

  /* "CyOpenGL.pyx":129
 *         glLightfv(GL_LIGHT1, GL_POSITION, lightposition1)
 *         glLightfv(GL_LIGHT1, GL_DIFFUSE, lightdiffuse)
 *         glLightfv(GL_LIGHT1, GL_SPECULAR, lightspecular)             # <<<<<<<<<<<<<<
 *         glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION,  1.0)
 *         glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.1)
 */
  glLightfv(GL_LIGHT1, GL_SPECULAR, __pyx_v_lightspecular);

  /* "CyOpenGL.pyx":130
 *         glLightfv(GL_LIGHT1, GL_DIFFUSE, lightdiffuse)
 *         glLightfv(GL_LIGHT1, GL_SPECULAR, lightspecular)
 *         glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION,  1.0)             # <<<<<<<<<<<<<<
 *         glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.1)
 *         glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.08)
 */
  glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION, 1.0);

  /* "CyOpenGL.pyx":131
 *         glLightfv(GL_LIGHT1, GL_SPECULAR, lightspecular)
 *         glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION,  1.0)
 *         glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.1)             # <<<<<<<<<<<<<<
 *         glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.08)
 *         # Use the Model View Matrix
 */
  glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.1);

  /* "CyOpenGL.pyx":132
 *         glLightf(GL_LIGHT1, GL_CONSTANT_ATTENUATION,  1.0)
 *         glLightf(GL_LIGHT1, GL_LINEAR_ATTENUATION, 0.1)
 *         glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.08)             # <<<<<<<<<<<<<<
 *         # Use the Model View Matrix
 *         glMatrixMode(GL_MODELVIEW)
 */
  glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.08);

  /* "CyOpenGL.pyx":134
 *         glLightf(GL_LIGHT1, GL_QUADRATIC_ATTENUATION, 0.08)
 *         # Use the Model View Matrix
 *         glMatrixMode(GL_MODELVIEW)             # <<<<<<<<<<<<<<
 *         glLoadIdentity()
 * 
 */
  glMatrixMode(GL_MODELVIEW);

  /* "CyOpenGL.pyx":135
 *         # Use the Model View Matrix
 *         glMatrixMode(GL_MODELVIEW)
 *         glLoadIdentity()             # <<<<<<<<<<<<<<
 * 
 * cdef class GLobject:
 */
  glLoadIdentity();

  /* "CyOpenGL.pyx":78
 *     """
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         # Lighting intensities and location
 *         cdef GLfloat* ambient = [0.75, 0.75, 0.75, 1.0]
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_10GL_context_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_10GL_context_2__reduce_cython__[] = "GL_context.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_10GL_context_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_10GL_context_2__reduce_cython__(((struct __pyx_obj_8CyOpenGL_GL_context *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_10GL_context_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GL_context *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.GL_context.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_10GL_context_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_10GL_context_4__setstate_cython__[] = "GL_context.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_10GL_context_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_10GL_context_4__setstate_cython__(((struct __pyx_obj_8CyOpenGL_GL_context *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_10GL_context_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GL_context *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.GL_context.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":152
 *     cdef GLfloat back_shininess
 * 
 *     def __cinit__(self, *args,             # <<<<<<<<<<<<<<
 *                   color = [0.8, 0.8, 0.8, 1.0],
 *                   front_specular = [0.8, 0.8, 0.8, 1.0],
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_8GLobject_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_8GLobject_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_front_specular = 0;
  PyObject *__pyx_v_back_specular = 0;
  PyObject *__pyx_v_front_shininess = 0;
  PyObject *__pyx_v_back_shininess = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 0) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 0, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return -1;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_front_specular,&__pyx_n_s_back_specular,&__pyx_n_s_front_shininess,&__pyx_n_s_back_shininess,0};
    PyObject* values[5] = {0,0,0,0,0};
    values[0] = __pyx_k__7;
    values[1] = __pyx_k__8;
    values[2] = __pyx_k__9;
    values[3] = ((PyObject *)__pyx_float_0_0);
    values[4] = ((PyObject *)__pyx_float_0_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      if (kw_args > 0 && (kw_args <= 5)) {
        Py_ssize_t index;
        for (index = 0; index < 5 && kw_args > 0; index++) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, *__pyx_pyargnames[index]);
          if (value) { values[index] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, 0, "__cinit__") < 0)) __PYX_ERR(0, 152, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 0) {
      goto __pyx_L5_argtuple_error;
    } else {
    }
    __pyx_v_color = values[0];
    __pyx_v_front_specular = values[1];
    __pyx_v_back_specular = values[2];
    __pyx_v_front_shininess = values[3];
    __pyx_v_back_shininess = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 0, 0, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 152, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("CyOpenGL.GLobject.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_8GLobject___cinit__(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self), __pyx_v_color, __pyx_v_front_specular, __pyx_v_back_specular, __pyx_v_front_shininess, __pyx_v_back_shininess, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_8GLobject___cinit__(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, PyObject *__pyx_v_color, PyObject *__pyx_v_front_specular, PyObject *__pyx_v_back_specular, PyObject *__pyx_v_front_shininess, PyObject *__pyx_v_back_shininess, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  int __pyx_v_n;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  GLfloat __pyx_t_2;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "CyOpenGL.pyx":160
 *                   **kwargs):
 *         cdef int n
 *         for n from 0 <= n < 4:             # <<<<<<<<<<<<<<
 *             self.color[n] = color[n]
 *             self.front_specular[n] = front_specular[n]
 */
  for (__pyx_v_n = 0; __pyx_v_n < 4; __pyx_v_n++) {

    /* "CyOpenGL.pyx":161
 *         cdef int n
 *         for n from 0 <= n < 4:
 *             self.color[n] = color[n]             # <<<<<<<<<<<<<<
 *             self.front_specular[n] = front_specular[n]
 *             self.back_specular[n] = back_specular[n]
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_color, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 161, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->color[__pyx_v_n]) = __pyx_t_2;

    /* "CyOpenGL.pyx":162
 *         for n from 0 <= n < 4:
 *             self.color[n] = color[n]
 *             self.front_specular[n] = front_specular[n]             # <<<<<<<<<<<<<<
 *             self.back_specular[n] = back_specular[n]
 *             self.emission[n] = 0.0
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_front_specular, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 162, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->front_specular[__pyx_v_n]) = __pyx_t_2;

    /* "CyOpenGL.pyx":163
 *             self.color[n] = color[n]
 *             self.front_specular[n] = front_specular[n]
 *             self.back_specular[n] = back_specular[n]             # <<<<<<<<<<<<<<
 *             self.emission[n] = 0.0
 *         self.front_shininess = front_shininess
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_back_specular, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 163, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 163, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->back_specular[__pyx_v_n]) = __pyx_t_2;

    /* "CyOpenGL.pyx":164
 *             self.front_specular[n] = front_specular[n]
 *             self.back_specular[n] = back_specular[n]
 *             self.emission[n] = 0.0             # <<<<<<<<<<<<<<
 *         self.front_shininess = front_shininess
 *         self.back_shininess = back_shininess
 */
    (__pyx_v_self->emission[__pyx_v_n]) = 0.0;
  }

  /* "CyOpenGL.pyx":165
 *             self.back_specular[n] = back_specular[n]
 *             self.emission[n] = 0.0
 *         self.front_shininess = front_shininess             # <<<<<<<<<<<<<<
 *         self.back_shininess = back_shininess
 * 
 */
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_front_shininess); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error)
  __pyx_v_self->front_shininess = __pyx_t_2;

  /* "CyOpenGL.pyx":166
 *             self.emission[n] = 0.0
 *         self.front_shininess = front_shininess
 *         self.back_shininess = back_shininess             # <<<<<<<<<<<<<<
 * 
 *     cdef set_material(self):
 */
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_back_shininess); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 166, __pyx_L1_error)
  __pyx_v_self->back_shininess = __pyx_t_2;

  /* "CyOpenGL.pyx":152
 *     cdef GLfloat back_shininess
 * 
 *     def __cinit__(self, *args,             # <<<<<<<<<<<<<<
 *                   color = [0.8, 0.8, 0.8, 1.0],
 *                   front_specular = [0.8, 0.8, 0.8, 1.0],
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.GLobject.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":168
 *         self.back_shininess = back_shininess
 * 
 *     cdef set_material(self):             # <<<<<<<<<<<<<<
 *         glMaterialfv(GL_FRONT, GL_SPECULAR, self.front_specular)
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)
 */

static PyObject *__pyx_f_8CyOpenGL_8GLobject_set_material(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_material", 0);

  /* "CyOpenGL.pyx":169
 * 
 *     cdef set_material(self):
 *         glMaterialfv(GL_FRONT, GL_SPECULAR, self.front_specular)             # <<<<<<<<<<<<<<
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)
 *         glMaterialfv(GL_BACK,  GL_SPECULAR, self.back_specular)
 */
  glMaterialfv(GL_FRONT, GL_SPECULAR, __pyx_v_self->front_specular);

  /* "CyOpenGL.pyx":170
 *     cdef set_material(self):
 *         glMaterialfv(GL_FRONT, GL_SPECULAR, self.front_specular)
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)             # <<<<<<<<<<<<<<
 *         glMaterialfv(GL_BACK,  GL_SPECULAR, self.back_specular)
 *         glMaterialf(GL_BACK,  GL_SHININESS, self.back_shininess)
 */
  glMaterialf(GL_FRONT, GL_SHININESS, __pyx_v_self->front_shininess);

  /* "CyOpenGL.pyx":171
 *         glMaterialfv(GL_FRONT, GL_SPECULAR, self.front_specular)
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)
 *         glMaterialfv(GL_BACK,  GL_SPECULAR, self.back_specular)             # <<<<<<<<<<<<<<
 *         glMaterialf(GL_BACK,  GL_SHININESS, self.back_shininess)
 *         glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, self.emission)
 */
  glMaterialfv(GL_BACK, GL_SPECULAR, __pyx_v_self->back_specular);

  /* "CyOpenGL.pyx":172
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)
 *         glMaterialfv(GL_BACK,  GL_SPECULAR, self.back_specular)
 *         glMaterialf(GL_BACK,  GL_SHININESS, self.back_shininess)             # <<<<<<<<<<<<<<
 *         glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, self.emission)
 *         glColor4fv(self.color)
 */
  glMaterialf(GL_BACK, GL_SHININESS, __pyx_v_self->back_shininess);

  /* "CyOpenGL.pyx":173
 *         glMaterialfv(GL_BACK,  GL_SPECULAR, self.back_specular)
 *         glMaterialf(GL_BACK,  GL_SHININESS, self.back_shininess)
 *         glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, self.emission)             # <<<<<<<<<<<<<<
 *         glColor4fv(self.color)
 * 
 */
  glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, __pyx_v_self->emission);

  /* "CyOpenGL.pyx":174
 *         glMaterialf(GL_BACK,  GL_SHININESS, self.back_shininess)
 *         glMaterialfv(GL_FRONT_AND_BACK, GL_EMISSION, self.emission)
 *         glColor4fv(self.color)             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, *args, **kwargs):
 */
  glColor4fv(__pyx_v_self->color);

  /* "CyOpenGL.pyx":168
 *         self.back_shininess = back_shininess
 * 
 *     cdef set_material(self):             # <<<<<<<<<<<<<<
 *         glMaterialfv(GL_FRONT, GL_SPECULAR, self.front_specular)
 *         glMaterialf(GL_FRONT, GL_SHININESS, self.front_shininess)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":176
 *         glColor4fv(self.color)
 * 
 *     def draw(self, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Issue the OpenGL commands to draw this object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_3draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_8GLobject_2draw[] = "GLobject.draw(self, *args, **kwargs)\n\n        Issue the OpenGL commands to draw this object.\n        (Subclasses must override this.)\n        ";
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_3draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "draw", 1))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_8CyOpenGL_8GLobject_2draw(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self), __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_8GLobject_2draw(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":182
 *         """
 * 
 *     def build_display_list(self, list_id, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Generate a display list containing the commands to draw this object.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_5build_display_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_8GLobject_4build_display_list[] = "GLobject.build_display_list(self, list_id, *args, **kwargs)\n\n        Generate a display list containing the commands to draw this object.\n        ";
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_5build_display_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_list_id = 0;
  PyObject *__pyx_v_args = 0;
  PyObject *__pyx_v_kwargs = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_display_list (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_list_id,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, used_pos_args, "build_display_list") < 0)) __PYX_ERR(0, 182, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_list_id = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_display_list", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 182, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("CyOpenGL.GLobject.build_display_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_8GLobject_4build_display_list(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self), __pyx_v_list_id, __pyx_v_args, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_8GLobject_4build_display_list(struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, PyObject *__pyx_v_list_id, PyObject *__pyx_v_args, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GLuint __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("build_display_list", 0);

  /* "CyOpenGL.pyx":186
 *         Generate a display list containing the commands to draw this object.
 *         """
 *         glNewList(list_id, GL_COMPILE)             # <<<<<<<<<<<<<<
 *         self.draw(*args, **kwargs)
 *         glEndList()
 */
  __pyx_t_1 = __Pyx_PyInt_As_GLuint(__pyx_v_list_id); if (unlikely((__pyx_t_1 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 186, __pyx_L1_error)
  glNewList(__pyx_t_1, GL_COMPILE);

  /* "CyOpenGL.pyx":187
 *         """
 *         glNewList(list_id, GL_COMPILE)
 *         self.draw(*args, **kwargs)             # <<<<<<<<<<<<<<
 *         glEndList()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_draw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_v_args, __pyx_v_kwargs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":188
 *         glNewList(list_id, GL_COMPILE)
 *         self.draw(*args, **kwargs)
 *         glEndList()             # <<<<<<<<<<<<<<
 * 
 * cdef class WireframeSphere(GLobject):
 */
  glEndList();

  /* "CyOpenGL.pyx":182
 *         """
 * 
 *     def build_display_list(self, list_id, *args, **kwargs):             # <<<<<<<<<<<<<<
 *         """
 *         Generate a display list containing the commands to draw this object.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.GLobject.build_display_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_8GLobject_6__reduce_cython__[] = "GLobject.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_8GLobject_6__reduce_cython__(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_8GLobject_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.GLobject.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_8GLobject_8__setstate_cython__[] = "GLobject.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_8GLobject_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_8GLobject_8__setstate_cython__(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_8GLobject_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_GLobject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.GLobject.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":195
 *     """
 * 
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):             # <<<<<<<<<<<<<<
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_1draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_15WireframeSphere_draw[] = "WireframeSphere.draw(self, GLfloat radius, GLint slices, GLint stacks)";
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_1draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  GLfloat __pyx_v_radius;
  GLint __pyx_v_slices;
  GLint __pyx_v_stacks;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_radius,&__pyx_n_s_slices,&__pyx_n_s_stacks,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_radius)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_slices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 3, 3, 1); __PYX_ERR(0, 195, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_stacks)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 3, 3, 2); __PYX_ERR(0, 195, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 195, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_radius = __pyx_PyFloat_AsFloat(values[0]); if (unlikely((__pyx_v_radius == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
    __pyx_v_slices = __Pyx_PyInt_As_GLint(values[1]); if (unlikely((__pyx_v_slices == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
    __pyx_v_stacks = __Pyx_PyInt_As_GLint(values[2]); if (unlikely((__pyx_v_stacks == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L3_error)
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 195, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.WireframeSphere.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15WireframeSphere_draw(((struct __pyx_obj_8CyOpenGL_WireframeSphere *)__pyx_v_self), __pyx_v_radius, __pyx_v_slices, __pyx_v_stacks);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":206
 *         dtheta = 2*pi/slices
 *         dphi = pi/stacks
 *         def draw_point(phi, theta):             # <<<<<<<<<<<<<<
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 *             glNormal3f(x, y, z)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_4draw_1draw_point(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyMethodDef __pyx_mdef_8CyOpenGL_15WireframeSphere_4draw_1draw_point = {"draw_point", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_15WireframeSphere_4draw_1draw_point, METH_VARARGS|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_4draw_1draw_point(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_phi = 0;
  PyObject *__pyx_v_theta = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw_point (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_phi,&__pyx_n_s_theta,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_phi)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_theta)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw_point", 1, 2, 2, 1); __PYX_ERR(0, 206, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw_point") < 0)) __PYX_ERR(0, 206, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_phi = values[0];
    __pyx_v_theta = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw_point", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 206, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.WireframeSphere.draw.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15WireframeSphere_4draw_draw_point(__pyx_self, __pyx_v_phi, __pyx_v_theta);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_4draw_draw_point(PyObject *__pyx_self, PyObject *__pyx_v_phi, PyObject *__pyx_v_theta) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *__pyx_cur_scope;
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *__pyx_outer_scope;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_z = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  GLfloat __pyx_t_6;
  GLfloat __pyx_t_7;
  GLfloat __pyx_t_8;
  __Pyx_RefNannySetupContext("draw_point", 0);
  __pyx_outer_scope = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *) __Pyx_CyFunction_GetClosure(__pyx_self);
  __pyx_cur_scope = __pyx_outer_scope;

  /* "CyOpenGL.pyx":207
 *         dphi = pi/stacks
 *         def draw_point(phi, theta):
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)             # <<<<<<<<<<<<<<
 *             glNormal3f(x, y, z)
 *             glVertex3f(r*x, r*y, r*z)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_phi) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_phi);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sin); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_4, __pyx_v_theta) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_theta);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_4, __pyx_v_phi) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_phi);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_cos); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_v_theta) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_theta);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_v_phi) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_phi);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 207, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_x = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_y = __pyx_t_4;
  __pyx_t_4 = 0;
  __pyx_v_z = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":208
 *         def draw_point(phi, theta):
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 *             glNormal3f(x, y, z)             # <<<<<<<<<<<<<<
 *             glVertex3f(r*x, r*y, r*z)
 * 
 */
  __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_x); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L1_error)
  __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_v_y); if (unlikely((__pyx_t_7 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L1_error)
  __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_v_z); if (unlikely((__pyx_t_8 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 208, __pyx_L1_error)
  glNormal3f(__pyx_t_6, __pyx_t_7, __pyx_t_8);

  /* "CyOpenGL.pyx":209
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 *             glNormal3f(x, y, z)
 *             glVertex3f(r*x, r*y, r*z)             # <<<<<<<<<<<<<<
 * 
 *         # Draw the longitudes
 */
  if (unlikely(!__pyx_cur_scope->__pyx_v_r)) { __Pyx_RaiseClosureNameError("r"); __PYX_ERR(0, 209, __pyx_L1_error) }
  __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_r, __pyx_v_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_8 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_8 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_r)) { __Pyx_RaiseClosureNameError("r"); __PYX_ERR(0, 209, __pyx_L1_error) }
  __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_r, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_7 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_cur_scope->__pyx_v_r)) { __Pyx_RaiseClosureNameError("r"); __PYX_ERR(0, 209, __pyx_L1_error) }
  __pyx_t_1 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_r, __pyx_v_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glVertex3f(__pyx_t_8, __pyx_t_7, __pyx_t_6);

  /* "CyOpenGL.pyx":206
 *         dtheta = 2*pi/slices
 *         dphi = pi/stacks
 *         def draw_point(phi, theta):             # <<<<<<<<<<<<<<
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 *             glNormal3f(x, y, z)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.WireframeSphere.draw.draw_point", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_z);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":195
 *     """
 * 
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):             # <<<<<<<<<<<<<<
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()
 */

static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_draw(struct __pyx_obj_8CyOpenGL_WireframeSphere *__pyx_v_self, GLfloat __pyx_v_radius, GLint __pyx_v_slices, GLint __pyx_v_stacks) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *__pyx_cur_scope;
  PyObject *__pyx_v_dtheta = NULL;
  PyObject *__pyx_v_dphi = NULL;
  PyObject *__pyx_v_draw_point = 0;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_theta = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_phi = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  __Pyx_RefNannySetupContext("draw", 0);
  __pyx_cur_scope = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)__pyx_tp_new_8CyOpenGL___pyx_scope_struct__draw(__pyx_ptype_8CyOpenGL___pyx_scope_struct__draw, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 195, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }

  /* "CyOpenGL.pyx":196
 * 
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):
 *         assert slices % 2 == 0 and stacks % 2 == 0             # <<<<<<<<<<<<<<
 *         self.set_material()
 *         r = radius
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_2 = ((__Pyx_mod_long(__pyx_v_slices, 2) == 0) != 0);
    if (__pyx_t_2) {
    } else {
      __pyx_t_1 = __pyx_t_2;
      goto __pyx_L3_bool_binop_done;
    }
    __pyx_t_2 = ((__Pyx_mod_long(__pyx_v_stacks, 2) == 0) != 0);
    __pyx_t_1 = __pyx_t_2;
    __pyx_L3_bool_binop_done:;
    if (unlikely(!__pyx_t_1)) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 196, __pyx_L1_error)
    }
  }
  #endif

  /* "CyOpenGL.pyx":197
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()             # <<<<<<<<<<<<<<
 *         r = radius
 *         # We put the north pole on the y-axis.
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_8CyOpenGL_WireframeSphere *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_material(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":198
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()
 *         r = radius             # <<<<<<<<<<<<<<
 *         # We put the north pole on the y-axis.
 *         glPushMatrix()
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_cur_scope->__pyx_v_r = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":200
 *         r = radius
 *         # We put the north pole on the y-axis.
 *         glPushMatrix()             # <<<<<<<<<<<<<<
 *         glLoadIdentity()
 *         glRotatef(90, 1.0, 0.0, 0.0)
 */
  glPushMatrix();

  /* "CyOpenGL.pyx":201
 *         # We put the north pole on the y-axis.
 *         glPushMatrix()
 *         glLoadIdentity()             # <<<<<<<<<<<<<<
 *         glRotatef(90, 1.0, 0.0, 0.0)
 * 
 */
  glLoadIdentity();

  /* "CyOpenGL.pyx":202
 *         glPushMatrix()
 *         glLoadIdentity()
 *         glRotatef(90, 1.0, 0.0, 0.0)             # <<<<<<<<<<<<<<
 * 
 *         dtheta = 2*pi/slices
 */
  glRotatef(90.0, 1.0, 0.0, 0.0);

  /* "CyOpenGL.pyx":204
 *         glRotatef(90, 1.0, 0.0, 0.0)
 * 
 *         dtheta = 2*pi/slices             # <<<<<<<<<<<<<<
 *         dphi = pi/stacks
 *         def draw_point(phi, theta):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Multiply(__pyx_int_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_From_GLint(__pyx_v_slices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_dtheta = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "CyOpenGL.pyx":205
 * 
 *         dtheta = 2*pi/slices
 *         dphi = pi/stacks             # <<<<<<<<<<<<<<
 *         def draw_point(phi, theta):
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pi); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyInt_From_GLint(__pyx_v_stacks); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_dphi = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":206
 *         dtheta = 2*pi/slices
 *         dphi = pi/stacks
 *         def draw_point(phi, theta):             # <<<<<<<<<<<<<<
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 *             glNormal3f(x, y, z)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_15WireframeSphere_4draw_1draw_point, 0, __pyx_n_s_draw_locals_draw_point, ((PyObject*)__pyx_cur_scope), __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_draw_point = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":212
 * 
 *         # Draw the longitudes
 *         for i in range(slices):             # <<<<<<<<<<<<<<
 *             theta = dtheta*i
 *             glBegin(GL_LINE_STRIP)
 */
  __pyx_t_4 = __Pyx_PyInt_From_GLint(__pyx_v_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 212, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 212, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 212, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 212, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_7(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 212, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":213
 *         # Draw the longitudes
 *         for i in range(slices):
 *             theta = dtheta*i             # <<<<<<<<<<<<<<
 *             glBegin(GL_LINE_STRIP)
 *             for j in range(stacks + 1):
 */
    __pyx_t_3 = PyNumber_Multiply(__pyx_v_dtheta, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_theta, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":214
 *         for i in range(slices):
 *             theta = dtheta*i
 *             glBegin(GL_LINE_STRIP)             # <<<<<<<<<<<<<<
 *             for j in range(stacks + 1):
 *                 draw_point(dphi*j, theta)
 */
    glBegin(GL_LINE_STRIP);

    /* "CyOpenGL.pyx":215
 *             theta = dtheta*i
 *             glBegin(GL_LINE_STRIP)
 *             for j in range(stacks + 1):             # <<<<<<<<<<<<<<
 *                 draw_point(dphi*j, theta)
 *             glEnd()
 */
    __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_stacks + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
      __pyx_t_3 = __pyx_t_5; __Pyx_INCREF(__pyx_t_3); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 215, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 215, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 215, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_8); __Pyx_INCREF(__pyx_t_5); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 215, __pyx_L1_error)
          #else
          __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 215, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_5);
          #endif
        }
      } else {
        __pyx_t_5 = __pyx_t_9(__pyx_t_3);
        if (unlikely(!__pyx_t_5)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 215, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "CyOpenGL.pyx":216
 *             glBegin(GL_LINE_STRIP)
 *             for j in range(stacks + 1):
 *                 draw_point(dphi*j, theta)             # <<<<<<<<<<<<<<
 *             glEnd()
 * 
 */
      __pyx_t_5 = PyNumber_Multiply(__pyx_v_dphi, __pyx_v_j); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_10 = __pyx_pf_8CyOpenGL_15WireframeSphere_4draw_draw_point(__pyx_v_draw_point, __pyx_t_5, __pyx_v_theta); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 216, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

      /* "CyOpenGL.pyx":215
 *             theta = dtheta*i
 *             glBegin(GL_LINE_STRIP)
 *             for j in range(stacks + 1):             # <<<<<<<<<<<<<<
 *                 draw_point(dphi*j, theta)
 *             glEnd()
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":217
 *             for j in range(stacks + 1):
 *                 draw_point(dphi*j, theta)
 *             glEnd()             # <<<<<<<<<<<<<<
 * 
 *         # Draw the latitudes
 */
    glEnd();

    /* "CyOpenGL.pyx":212
 * 
 *         # Draw the longitudes
 *         for i in range(slices):             # <<<<<<<<<<<<<<
 *             theta = dtheta*i
 *             glBegin(GL_LINE_STRIP)
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":220
 * 
 *         # Draw the latitudes
 *         for j in range(1, stacks):             # <<<<<<<<<<<<<<
 *             glBegin(GL_LINE_LOOP)
 *             phi = dphi*j
 */
  __pyx_t_4 = __Pyx_PyInt_From_GLint(__pyx_v_stacks); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 220, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 220, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 220, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 220, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 220, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_3);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 220, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":221
 *         # Draw the latitudes
 *         for j in range(1, stacks):
 *             glBegin(GL_LINE_LOOP)             # <<<<<<<<<<<<<<
 *             phi = dphi*j
 *             for i in range(0, slices):
 */
    glBegin(GL_LINE_LOOP);

    /* "CyOpenGL.pyx":222
 *         for j in range(1, stacks):
 *             glBegin(GL_LINE_LOOP)
 *             phi = dphi*j             # <<<<<<<<<<<<<<
 *             for i in range(0, slices):
 *                 draw_point(phi, dtheta*i)
 */
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_dphi, __pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_phi, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":223
 *             glBegin(GL_LINE_LOOP)
 *             phi = dphi*j
 *             for i in range(0, slices):             # <<<<<<<<<<<<<<
 *                 draw_point(phi, dtheta*i)
 *             glEnd()
 */
    __pyx_t_4 = __Pyx_PyInt_From_GLint(__pyx_v_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_int_0);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_10 = __pyx_t_4; __Pyx_INCREF(__pyx_t_10); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 223, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = Py_TYPE(__pyx_t_10)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 223, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_10))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 223, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_8); __Pyx_INCREF(__pyx_t_4); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 223, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_10, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 223, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_9(__pyx_t_10);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 223, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "CyOpenGL.pyx":224
 *             phi = dphi*j
 *             for i in range(0, slices):
 *                 draw_point(phi, dtheta*i)             # <<<<<<<<<<<<<<
 *             glEnd()
 *         glPopMatrix()
 */
      __pyx_t_4 = PyNumber_Multiply(__pyx_v_dtheta, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __pyx_pf_8CyOpenGL_15WireframeSphere_4draw_draw_point(__pyx_v_draw_point, __pyx_v_phi, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 224, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "CyOpenGL.pyx":223
 *             glBegin(GL_LINE_LOOP)
 *             phi = dphi*j
 *             for i in range(0, slices):             # <<<<<<<<<<<<<<
 *                 draw_point(phi, dtheta*i)
 *             glEnd()
 */
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "CyOpenGL.pyx":225
 *             for i in range(0, slices):
 *                 draw_point(phi, dtheta*i)
 *             glEnd()             # <<<<<<<<<<<<<<
 *         glPopMatrix()
 * 
 */
    glEnd();

    /* "CyOpenGL.pyx":220
 * 
 *         # Draw the latitudes
 *         for j in range(1, stacks):             # <<<<<<<<<<<<<<
 *             glBegin(GL_LINE_LOOP)
 *             phi = dphi*j
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":226
 *                 draw_point(phi, dtheta*i)
 *             glEnd()
 *         glPopMatrix()             # <<<<<<<<<<<<<<
 * 
 * class TriangleMesh:
 */
  glPopMatrix();

  /* "CyOpenGL.pyx":195
 *     """
 * 
 *     def draw(self, GLfloat radius, GLint slices, GLint stacks):             # <<<<<<<<<<<<<<
 *         assert slices % 2 == 0 and stacks % 2 == 0
 *         self.set_material()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("CyOpenGL.WireframeSphere.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dtheta);
  __Pyx_XDECREF(__pyx_v_dphi);
  __Pyx_XDECREF(__pyx_v_draw_point);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_theta);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_phi);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_15WireframeSphere_2__reduce_cython__[] = "WireframeSphere.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_15WireframeSphere_2__reduce_cython__(((struct __pyx_obj_8CyOpenGL_WireframeSphere *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_WireframeSphere *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.WireframeSphere.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_15WireframeSphere_4__setstate_cython__[] = "WireframeSphere.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_15WireframeSphere_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_15WireframeSphere_4__setstate_cython__(((struct __pyx_obj_8CyOpenGL_WireframeSphere *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_15WireframeSphere_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_WireframeSphere *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.WireframeSphere.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":232
 *     A triangle which can tessellate itself.
 *     """
 *     def __init__(self, vertices):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.triangles = [(0,1,2)]
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12TriangleMesh___init__[] = "TriangleMesh.__init__(self, vertices)";
static PyMethodDef __pyx_mdef_8CyOpenGL_12TriangleMesh_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12TriangleMesh_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12TriangleMesh___init__};
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_vertices = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_vertices,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 232, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 232, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_vertices = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 232, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.TriangleMesh.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12TriangleMesh___init__(__pyx_self, __pyx_v_self, __pyx_v_vertices);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_vertices) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":233
 *     """
 *     def __init__(self, vertices):
 *         self.vertices = vertices             # <<<<<<<<<<<<<<
 *         self.triangles = [(0,1,2)]
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_vertices, __pyx_v_vertices) < 0) __PYX_ERR(0, 233, __pyx_L1_error)

  /* "CyOpenGL.pyx":234
 *     def __init__(self, vertices):
 *         self.vertices = vertices
 *         self.triangles = [(0,1,2)]             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_tuple__16);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_triangles, __pyx_t_1) < 0) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":232
 *     A triangle which can tessellate itself.
 *     """
 *     def __init__(self, vertices):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.triangles = [(0,1,2)]
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.TriangleMesh.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":236
 *         self.triangles = [(0,1,2)]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self.triangles)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8CyOpenGL_12TriangleMesh_2__repr__[] = "TriangleMesh.__repr__(self)";
static PyMethodDef __pyx_mdef_8CyOpenGL_12TriangleMesh_3__repr__ = {"__repr__", (PyCFunction)__pyx_pw_8CyOpenGL_12TriangleMesh_3__repr__, METH_O, __pyx_doc_8CyOpenGL_12TriangleMesh_2__repr__};
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_3__repr__(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_12TriangleMesh_2__repr__(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh_2__repr__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__repr__", 0);

  /* "CyOpenGL.pyx":237
 * 
 *     def __repr__(self):
 *         return str(self.triangles)             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, n):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_triangles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyString_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":236
 *         self.triangles = [(0,1,2)]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self.triangles)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.TriangleMesh.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":239
 *         return str(self.triangles)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         x, y, z = self.triangles[n]
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_5__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12TriangleMesh_4__getitem__[] = "TriangleMesh.__getitem__(self, n)";
static PyMethodDef __pyx_mdef_8CyOpenGL_12TriangleMesh_5__getitem__ = {"__getitem__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12TriangleMesh_5__getitem__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12TriangleMesh_4__getitem__};
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_5__getitem__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_n = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_n,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, 1); __PYX_ERR(0, 239, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__getitem__") < 0)) __PYX_ERR(0, 239, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_n = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__getitem__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 239, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.TriangleMesh.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12TriangleMesh_4__getitem__(__pyx_self, __pyx_v_self, __pyx_v_n);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh_4__getitem__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_n) {
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_z = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "CyOpenGL.pyx":240
 * 
 *     def __getitem__(self, n):
 *         x, y, z = self.triangles[n]             # <<<<<<<<<<<<<<
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_triangles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
    PyObject* sequence = __pyx_t_2;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 240, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_4 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_t_4);
    #else
    __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    #endif
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 240, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
    index = 0; __pyx_t_1 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_1);
    index = 1; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    index = 2; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 3) < 0) __PYX_ERR(0, 240, __pyx_L1_error)
    __pyx_t_6 = NULL;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 240, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_x = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_y = __pyx_t_3;
  __pyx_t_3 = 0;
  __pyx_v_z = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":241
 *     def __getitem__(self, n):
 *         x, y, z = self.triangles[n]
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])             # <<<<<<<<<<<<<<
 * 
 *     def subdivide(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_y); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 241, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":239
 *         return str(self.triangles)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         x, y, z = self.triangles[n]
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.TriangleMesh.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_z);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":243
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 * 
 *     def subdivide(self):             # <<<<<<<<<<<<<<
 *         """
 *         Replace each triangle by four triangles:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_7subdivide(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8CyOpenGL_12TriangleMesh_6subdivide[] = "TriangleMesh.subdivide(self)\n\n        Replace each triangle by four triangles:\n                       z\n                     /                       zx - yz\n                   /  \\ /                    x -  xy - y\n        New midpoint vertices are appended to the vertex list.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12TriangleMesh_7subdivide = {"subdivide", (PyCFunction)__pyx_pw_8CyOpenGL_12TriangleMesh_7subdivide, METH_O, __pyx_doc_8CyOpenGL_12TriangleMesh_6subdivide};
static PyObject *__pyx_pw_8CyOpenGL_12TriangleMesh_7subdivide(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("subdivide (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_12TriangleMesh_6subdivide(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12TriangleMesh_6subdivide(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_v_new_triangles = NULL;
  PyObject *__pyx_v_V = NULL;
  PyObject *__pyx_v_triangle = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_z = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_xy = NULL;
  PyObject *__pyx_v_yz = NULL;
  PyObject *__pyx_v_zx = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("subdivide", 0);

  /* "CyOpenGL.pyx":253
 *         New midpoint vertices are appended to the vertex list.
 *         """
 *         new_triangles = []             # <<<<<<<<<<<<<<
 *         V = self.vertices
 *         for triangle in self.triangles:
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 253, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_new_triangles = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":254
 *         """
 *         new_triangles = []
 *         V = self.vertices             # <<<<<<<<<<<<<<
 *         for triangle in self.triangles:
 *             x, y, z = triangle
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 254, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_V = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":255
 *         new_triangles = []
 *         V = self.vertices
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             x, y, z = triangle
 *             n = len(V)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_triangles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 255, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 255, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 255, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 255, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 255, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_triangle, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":256
 *         V = self.vertices
 *         for triangle in self.triangles:
 *             x, y, z = triangle             # <<<<<<<<<<<<<<
 *             n = len(V)
 *             self.vertices.append((V[x] + V[y])/2)
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_triangle))) || (PyList_CheckExact(__pyx_v_triangle))) {
      PyObject* sequence = __pyx_v_triangle;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 256, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_v_triangle); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 256, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_1)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(0, 256, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 256, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
    __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_z, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":257
 *         for triangle in self.triangles:
 *             x, y, z = triangle
 *             n = len(V)             # <<<<<<<<<<<<<<
 *             self.vertices.append((V[x] + V[y])/2)
 *             self.vertices.append((V[y] + V[z])/2)
 */
    __pyx_t_9 = PyObject_Length(__pyx_v_V); if (unlikely(__pyx_t_9 == ((Py_ssize_t)-1))) __PYX_ERR(0, 257, __pyx_L1_error)
    __pyx_t_6 = PyInt_FromSsize_t(__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 257, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":258
 *             x, y, z = triangle
 *             n = len(V)
 *             self.vertices.append((V[x] + V[y])/2)             # <<<<<<<<<<<<<<
 *             self.vertices.append((V[y] + V[z])/2)
 *             self.vertices.append((V[z] + V[x])/2)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertices); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = PyNumber_Add(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_7, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_1); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 258, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":259
 *             n = len(V)
 *             self.vertices.append((V[x] + V[y])/2)
 *             self.vertices.append((V[y] + V[z])/2)             # <<<<<<<<<<<<<<
 *             self.vertices.append((V[z] + V[x])/2)
 *             xy, yz, zx = n, n+1, n+2
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_y); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_z); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_5 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_int_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 259, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_7); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 259, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "CyOpenGL.pyx":260
 *             self.vertices.append((V[x] + V[y])/2)
 *             self.vertices.append((V[y] + V[z])/2)
 *             self.vertices.append((V[z] + V[x])/2)             # <<<<<<<<<<<<<<
 *             xy, yz, zx = n, n+1, n+2
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_vertices); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_V, __pyx_v_x); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_int_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 260, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_10 = __Pyx_PyObject_Append(__pyx_t_7, __pyx_t_5); if (unlikely(__pyx_t_10 == ((int)-1))) __PYX_ERR(0, 260, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":261
 *             self.vertices.append((V[y] + V[z])/2)
 *             self.vertices.append((V[z] + V[x])/2)
 *             xy, yz, zx = n, n+1, n+2             # <<<<<<<<<<<<<<
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),
 *                               (zx, yz, z), (xy, y, yz)]
 */
    __pyx_t_5 = __pyx_v_n;
    __Pyx_INCREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 261, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_xy, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_yz, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_zx, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":262
 *             self.vertices.append((V[z] + V[x])/2)
 *             xy, yz, zx = n, n+1, n+2
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),             # <<<<<<<<<<<<<<
 *                               (zx, yz, z), (xy, y, yz)]
 *         self.triangles = new_triangles
 */
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_x);
    __Pyx_INCREF(__pyx_v_xy);
    __Pyx_GIVEREF(__pyx_v_xy);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_xy);
    __Pyx_INCREF(__pyx_v_zx);
    __Pyx_GIVEREF(__pyx_v_zx);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_zx);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_xy);
    __Pyx_GIVEREF(__pyx_v_xy);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_xy);
    __Pyx_INCREF(__pyx_v_yz);
    __Pyx_GIVEREF(__pyx_v_yz);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_yz);
    __Pyx_INCREF(__pyx_v_zx);
    __Pyx_GIVEREF(__pyx_v_zx);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_zx);

    /* "CyOpenGL.pyx":263
 *             xy, yz, zx = n, n+1, n+2
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),
 *                               (zx, yz, z), (xy, y, yz)]             # <<<<<<<<<<<<<<
 *         self.triangles = new_triangles
 * 
 */
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_zx);
    __Pyx_GIVEREF(__pyx_v_zx);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_zx);
    __Pyx_INCREF(__pyx_v_yz);
    __Pyx_GIVEREF(__pyx_v_yz);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_yz);
    __Pyx_INCREF(__pyx_v_z);
    __Pyx_GIVEREF(__pyx_v_z);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_z);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_xy);
    __Pyx_GIVEREF(__pyx_v_xy);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xy);
    __Pyx_INCREF(__pyx_v_y);
    __Pyx_GIVEREF(__pyx_v_y);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_y);
    __Pyx_INCREF(__pyx_v_yz);
    __Pyx_GIVEREF(__pyx_v_yz);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_yz);

    /* "CyOpenGL.pyx":262
 *             self.vertices.append((V[z] + V[x])/2)
 *             xy, yz, zx = n, n+1, n+2
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),             # <<<<<<<<<<<<<<
 *                               (zx, yz, z), (xy, y, yz)]
 *         self.triangles = new_triangles
 */
    __pyx_t_11 = PyList_New(4); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_6);
    PyList_SET_ITEM(__pyx_t_11, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_7);
    PyList_SET_ITEM(__pyx_t_11, 1, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_5);
    PyList_SET_ITEM(__pyx_t_11, 2, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyList_SET_ITEM(__pyx_t_11, 3, __pyx_t_1);
    __pyx_t_6 = 0;
    __pyx_t_7 = 0;
    __pyx_t_5 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_new_triangles, __pyx_t_11); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 262, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF_SET(__pyx_v_new_triangles, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":255
 *         new_triangles = []
 *         V = self.vertices
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             x, y, z = triangle
 *             n = len(V)
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":264
 *             new_triangles += [(x, xy, zx), (xy, yz, zx),
 *                               (zx, yz, z), (xy, y, yz)]
 *         self.triangles = new_triangles             # <<<<<<<<<<<<<<
 * 
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_triangles, __pyx_v_new_triangles) < 0) __PYX_ERR(0, 264, __pyx_L1_error)

  /* "CyOpenGL.pyx":243
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 * 
 *     def subdivide(self):             # <<<<<<<<<<<<<<
 *         """
 *         Replace each triangle by four triangles:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("CyOpenGL.TriangleMesh.subdivide", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_new_triangles);
  __Pyx_XDECREF(__pyx_v_V);
  __Pyx_XDECREF(__pyx_v_triangle);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_z);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_xy);
  __Pyx_XDECREF(__pyx_v_yz);
  __Pyx_XDECREF(__pyx_v_zx);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":277
 *     cdef GLushort* indices
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.nv_array)
 *         free(self.indices)
 */

/* Python wrapper */
static void __pyx_pw_8CyOpenGL_13MeshedSurface_1__dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pw_8CyOpenGL_13MeshedSurface_1__dealloc__(PyObject *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
  __pyx_pf_8CyOpenGL_13MeshedSurface___dealloc__(((struct __pyx_obj_8CyOpenGL_MeshedSurface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

static void __pyx_pf_8CyOpenGL_13MeshedSurface___dealloc__(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__dealloc__", 0);

  /* "CyOpenGL.pyx":278
 * 
 *     def __dealloc__(self):
 *         free(self.nv_array)             # <<<<<<<<<<<<<<
 *         free(self.indices)
 * 
 */
  free(__pyx_v_self->nv_array);

  /* "CyOpenGL.pyx":279
 *     def __dealloc__(self):
 *         free(self.nv_array)
 *         free(self.indices)             # <<<<<<<<<<<<<<
 * 
 *     cdef build_arrays(self):
 */
  free(__pyx_v_self->indices);

  /* "CyOpenGL.pyx":277
 *     cdef GLushort* indices
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         free(self.nv_array)
 *         free(self.indices)
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
}

/* "CyOpenGL.pyx":281
 *         free(self.indices)
 * 
 *     cdef build_arrays(self):             # <<<<<<<<<<<<<<
 *         cdef double scale
 *         cdef vector3 V, N
 */

static PyObject *__pyx_f_8CyOpenGL_13MeshedSurface_build_arrays(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self) {
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_V = 0;
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_N = 0;
  GLfloat *__pyx_v_NV;
  GLushort *__pyx_v_T;
  size_t __pyx_v_NVsize;
  PyObject *__pyx_v_Tsize = NULL;
  PyObject *__pyx_v_triangle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  GLfloat *__pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  double __pyx_t_10;
  double __pyx_t_11;
  double __pyx_t_12;
  size_t __pyx_t_13;
  GLushort *__pyx_t_14;
  GLushort __pyx_t_15;
  GLushort __pyx_t_16;
  GLushort __pyx_t_17;
  __Pyx_RefNannySetupContext("build_arrays", 0);

  /* "CyOpenGL.pyx":286
 *         cdef GLfloat* NV
 *         cdef GLushort* T
 *         NVsize = 6*len(self.vertices)*sizeof(GLfloat)             # <<<<<<<<<<<<<<
 *         self.nv_array = NV = <GLfloat *> malloc(NVsize)
 *         for V, N in zip(self.vertices, self.normals):
 */
  __pyx_t_1 = __pyx_v_self->vertices;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 286, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_NVsize = ((6 * __pyx_t_2) * (sizeof(GLfloat)));

  /* "CyOpenGL.pyx":287
 *         cdef GLushort* T
 *         NVsize = 6*len(self.vertices)*sizeof(GLfloat)
 *         self.nv_array = NV = <GLfloat *> malloc(NVsize)             # <<<<<<<<<<<<<<
 *         for V, N in zip(self.vertices, self.normals):
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z
 */
  __pyx_t_3 = ((GLfloat *)malloc(__pyx_v_NVsize));
  __pyx_v_self->nv_array = __pyx_t_3;
  __pyx_v_NV = __pyx_t_3;

  /* "CyOpenGL.pyx":288
 *         NVsize = 6*len(self.vertices)*sizeof(GLfloat)
 *         self.nv_array = NV = <GLfloat *> malloc(NVsize)
 *         for V, N in zip(self.vertices, self.normals):             # <<<<<<<<<<<<<<
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z
 *             NV[3], NV[4], NV[5] = V.x, V.y, V.z
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->vertices);
  __Pyx_GIVEREF(__pyx_v_self->vertices);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->vertices);
  __Pyx_INCREF(__pyx_v_self->normals);
  __Pyx_GIVEREF(__pyx_v_self->normals);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_self->normals);
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_zip, __pyx_t_1, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_1 = __pyx_t_4; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 288, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 288, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 288, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 288, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 288, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 288, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 288, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_8CyOpenGL_vector3))))) __PYX_ERR(0, 288, __pyx_L1_error)
    if (!(likely(((__pyx_t_7) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_7, __pyx_ptype_8CyOpenGL_vector3))))) __PYX_ERR(0, 288, __pyx_L1_error)
    __Pyx_XDECREF_SET(__pyx_v_V, ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_6));
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_N, ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "CyOpenGL.pyx":289
 *         self.nv_array = NV = <GLfloat *> malloc(NVsize)
 *         for V, N in zip(self.vertices, self.normals):
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z             # <<<<<<<<<<<<<<
 *             NV[3], NV[4], NV[5] = V.x, V.y, V.z
 *             NV += 6
 */
    __pyx_t_10 = __pyx_v_N->x;
    __pyx_t_11 = __pyx_v_N->y;
    __pyx_t_12 = __pyx_v_N->z;
    (__pyx_v_NV[0]) = __pyx_t_10;
    (__pyx_v_NV[1]) = __pyx_t_11;
    (__pyx_v_NV[2]) = __pyx_t_12;

    /* "CyOpenGL.pyx":290
 *         for V, N in zip(self.vertices, self.normals):
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z
 *             NV[3], NV[4], NV[5] = V.x, V.y, V.z             # <<<<<<<<<<<<<<
 *             NV += 6
 * 
 */
    __pyx_t_12 = __pyx_v_V->x;
    __pyx_t_11 = __pyx_v_V->y;
    __pyx_t_10 = __pyx_v_V->z;
    (__pyx_v_NV[3]) = __pyx_t_12;
    (__pyx_v_NV[4]) = __pyx_t_11;
    (__pyx_v_NV[5]) = __pyx_t_10;

    /* "CyOpenGL.pyx":291
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z
 *             NV[3], NV[4], NV[5] = V.x, V.y, V.z
 *             NV += 6             # <<<<<<<<<<<<<<
 * 
 *         self.count = 3*len(self.triangles)
 */
    __pyx_v_NV = (__pyx_v_NV + 6);

    /* "CyOpenGL.pyx":288
 *         NVsize = 6*len(self.vertices)*sizeof(GLfloat)
 *         self.nv_array = NV = <GLfloat *> malloc(NVsize)
 *         for V, N in zip(self.vertices, self.normals):             # <<<<<<<<<<<<<<
 *             NV[0], NV[1], NV[2] = N.x, N.y, N.z
 *             NV[3], NV[4], NV[5] = V.x, V.y, V.z
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":293
 *             NV += 6
 * 
 *         self.count = 3*len(self.triangles)             # <<<<<<<<<<<<<<
 *         Tsize = self.count*sizeof(GLushort)
 *         self.indices = T = <GLushort *> malloc(Tsize)
 */
  __pyx_t_1 = __pyx_v_self->triangles;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyInt_FromSsize_t((3 * __pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->count);
  __Pyx_DECREF(__pyx_v_self->count);
  __pyx_v_self->count = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":294
 * 
 *         self.count = 3*len(self.triangles)
 *         Tsize = self.count*sizeof(GLushort)             # <<<<<<<<<<<<<<
 *         self.indices = T = <GLushort *> malloc(Tsize)
 *         for triangle in self.triangles:
 */
  __pyx_t_1 = __Pyx_PyInt_FromSize_t((sizeof(GLushort))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Multiply(__pyx_v_self->count, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_Tsize = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":295
 *         self.count = 3*len(self.triangles)
 *         Tsize = self.count*sizeof(GLushort)
 *         self.indices = T = <GLushort *> malloc(Tsize)             # <<<<<<<<<<<<<<
 *         for triangle in self.triangles:
 *             T[0], T[1], T[2] = triangle
 */
  __pyx_t_13 = __Pyx_PyInt_As_size_t(__pyx_v_Tsize); if (unlikely((__pyx_t_13 == (size_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 295, __pyx_L1_error)
  __pyx_t_14 = ((GLushort *)malloc(__pyx_t_13));
  __pyx_v_self->indices = __pyx_t_14;
  __pyx_v_T = __pyx_t_14;

  /* "CyOpenGL.pyx":296
 *         Tsize = self.count*sizeof(GLushort)
 *         self.indices = T = <GLushort *> malloc(Tsize)
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             T[0], T[1], T[2] = triangle
 *             T += 3
 */
  if (likely(PyList_CheckExact(__pyx_v_self->triangles)) || PyTuple_CheckExact(__pyx_v_self->triangles)) {
    __pyx_t_4 = __pyx_v_self->triangles; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_self->triangles); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 296, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 296, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 296, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 296, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_4);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 296, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_triangle, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":297
 *         self.indices = T = <GLushort *> malloc(Tsize)
 *         for triangle in self.triangles:
 *             T[0], T[1], T[2] = triangle             # <<<<<<<<<<<<<<
 *             T += 3
 * 
 */
    if ((likely(PyTuple_CheckExact(__pyx_v_triangle))) || (PyList_CheckExact(__pyx_v_triangle))) {
      PyObject* sequence = __pyx_v_triangle;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 297, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_v_triangle); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 297, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_1 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_1)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_1);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 2; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 3) < 0) __PYX_ERR(0, 297, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 297, __pyx_L1_error)
      __pyx_L10_unpacking_done:;
    }
    __pyx_t_15 = __Pyx_PyInt_As_GLushort(__pyx_t_1); if (unlikely((__pyx_t_15 == ((GLushort)-1)) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_16 = __Pyx_PyInt_As_GLushort(__pyx_t_7); if (unlikely((__pyx_t_16 == ((GLushort)-1)) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_17 = __Pyx_PyInt_As_GLushort(__pyx_t_6); if (unlikely((__pyx_t_17 == ((GLushort)-1)) && PyErr_Occurred())) __PYX_ERR(0, 297, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    (__pyx_v_T[0]) = __pyx_t_15;
    (__pyx_v_T[1]) = __pyx_t_16;
    (__pyx_v_T[2]) = __pyx_t_17;

    /* "CyOpenGL.pyx":298
 *         for triangle in self.triangles:
 *             T[0], T[1], T[2] = triangle
 *             T += 3             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, use_material=True):
 */
    __pyx_v_T = (__pyx_v_T + 3);

    /* "CyOpenGL.pyx":296
 *         Tsize = self.count*sizeof(GLushort)
 *         self.indices = T = <GLushort *> malloc(Tsize)
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             T[0], T[1], T[2] = triangle
 *             T += 3
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":281
 *         free(self.indices)
 * 
 *     cdef build_arrays(self):             # <<<<<<<<<<<<<<
 *         cdef double scale
 *         cdef vector3 V, N
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("CyOpenGL.MeshedSurface.build_arrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_V);
  __Pyx_XDECREF((PyObject *)__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_Tsize);
  __Pyx_XDECREF(__pyx_v_triangle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":300
 *             T += 3
 * 
 *     def draw(self, use_material=True):             # <<<<<<<<<<<<<<
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13MeshedSurface_3draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_13MeshedSurface_2draw[] = "MeshedSurface.draw(self, use_material=True)";
static PyObject *__pyx_pw_8CyOpenGL_13MeshedSurface_3draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_use_material = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_use_material,0};
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_use_material);
          if (value) { values[0] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 300, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_use_material = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 300, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.MeshedSurface.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13MeshedSurface_2draw(((struct __pyx_obj_8CyOpenGL_MeshedSurface *)__pyx_v_self), __pyx_v_use_material);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13MeshedSurface_2draw(struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self, PyObject *__pyx_v_use_material) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  GLsizei __pyx_t_3;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "CyOpenGL.pyx":301
 * 
 *     def draw(self, use_material=True):
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)             # <<<<<<<<<<<<<<
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
 *         glEnableClientState(GL_NORMAL_ARRAY)
 */
  glNormalPointer(GL_FLOAT, (6 * (sizeof(GLfloat))), __pyx_v_self->nv_array);

  /* "CyOpenGL.pyx":302
 *     def draw(self, use_material=True):
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)             # <<<<<<<<<<<<<<
 *         glEnableClientState(GL_NORMAL_ARRAY)
 *         glEnableClientState(GL_VERTEX_ARRAY)
 */
  glVertexPointer(3, GL_FLOAT, (6 * (sizeof(GLfloat))), (__pyx_v_self->nv_array + 3));

  /* "CyOpenGL.pyx":303
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
 *         glEnableClientState(GL_NORMAL_ARRAY)             # <<<<<<<<<<<<<<
 *         glEnableClientState(GL_VERTEX_ARRAY)
 *         glDisableClientState(GL_COLOR_ARRAY)
 */
  glEnableClientState(GL_NORMAL_ARRAY);

  /* "CyOpenGL.pyx":304
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
 *         glEnableClientState(GL_NORMAL_ARRAY)
 *         glEnableClientState(GL_VERTEX_ARRAY)             # <<<<<<<<<<<<<<
 *         glDisableClientState(GL_COLOR_ARRAY)
 *         if use_material:
 */
  glEnableClientState(GL_VERTEX_ARRAY);

  /* "CyOpenGL.pyx":305
 *         glEnableClientState(GL_NORMAL_ARRAY)
 *         glEnableClientState(GL_VERTEX_ARRAY)
 *         glDisableClientState(GL_COLOR_ARRAY)             # <<<<<<<<<<<<<<
 *         if use_material:
 *             self.set_material()
 */
  glDisableClientState(GL_COLOR_ARRAY);

  /* "CyOpenGL.pyx":306
 *         glEnableClientState(GL_VERTEX_ARRAY)
 *         glDisableClientState(GL_COLOR_ARRAY)
 *         if use_material:             # <<<<<<<<<<<<<<
 *             self.set_material()
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_use_material); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 306, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":307
 *         glDisableClientState(GL_COLOR_ARRAY)
 *         if use_material:
 *             self.set_material()             # <<<<<<<<<<<<<<
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,
 *                        self.indices)
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_material(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 307, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":306
 *         glEnableClientState(GL_VERTEX_ARRAY)
 *         glDisableClientState(GL_COLOR_ARRAY)
 *         if use_material:             # <<<<<<<<<<<<<<
 *             self.set_material()
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,
 */
  }

  /* "CyOpenGL.pyx":308
 *         if use_material:
 *             self.set_material()
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,             # <<<<<<<<<<<<<<
 *                        self.indices)
 *         glDisableClientState(GL_NORMAL_ARRAY)
 */
  __pyx_t_3 = __Pyx_PyInt_As_GLsizei(__pyx_v_self->count); if (unlikely((__pyx_t_3 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(0, 308, __pyx_L1_error)

  /* "CyOpenGL.pyx":309
 *             self.set_material()
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,
 *                        self.indices)             # <<<<<<<<<<<<<<
 *         glDisableClientState(GL_NORMAL_ARRAY)
 *         glDisableClientState(GL_VERTEX_ARRAY)
 */
  glDrawElements(GL_TRIANGLES, __pyx_t_3, GL_UNSIGNED_SHORT, __pyx_v_self->indices);

  /* "CyOpenGL.pyx":310
 *         glDrawElements(GL_TRIANGLES, self.count, GL_UNSIGNED_SHORT,
 *                        self.indices)
 *         glDisableClientState(GL_NORMAL_ARRAY)             # <<<<<<<<<<<<<<
 *         glDisableClientState(GL_VERTEX_ARRAY)
 * 
 */
  glDisableClientState(GL_NORMAL_ARRAY);

  /* "CyOpenGL.pyx":311
 *                        self.indices)
 *         glDisableClientState(GL_NORMAL_ARRAY)
 *         glDisableClientState(GL_VERTEX_ARRAY)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  glDisableClientState(GL_VERTEX_ARRAY);

  /* "CyOpenGL.pyx":300
 *             T += 3
 * 
 *     def draw(self, use_material=True):             # <<<<<<<<<<<<<<
 *         glNormalPointer(GL_FLOAT, 6*sizeof(GLfloat), self.nv_array)
 *         glVertexPointer(3, GL_FLOAT, 6*sizeof(GLfloat), self.nv_array+3)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.MeshedSurface.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13MeshedSurface_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_13MeshedSurface_4__reduce_cython__[] = "MeshedSurface.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_13MeshedSurface_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13MeshedSurface_4__reduce_cython__(((struct __pyx_obj_8CyOpenGL_MeshedSurface *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13MeshedSurface_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.MeshedSurface.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13MeshedSurface_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_13MeshedSurface_6__setstate_cython__[] = "MeshedSurface.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_13MeshedSurface_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13MeshedSurface_6__setstate_cython__(((struct __pyx_obj_8CyOpenGL_MeshedSurface *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13MeshedSurface_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_MeshedSurface *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.MeshedSurface.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":328
 *     cdef center, mesh, original_vertices
 * 
 *     def __init__(self, vertices, center, subdivision_depth=4, **kwargs):             # <<<<<<<<<<<<<<
 *         self.original_vertices = vertices
 *         self.center = center
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_16PoincareTriangle_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_16PoincareTriangle_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vertices = 0;
  PyObject *__pyx_v_center = 0;
  PyObject *__pyx_v_subdivision_depth = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_center,&__pyx_n_s_subdivision_depth,0};
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)__pyx_int_4);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_center)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 328, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_subdivision_depth);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 328, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_vertices = values[0];
    __pyx_v_center = values[1];
    __pyx_v_subdivision_depth = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 328, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("CyOpenGL.PoincareTriangle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_16PoincareTriangle___init__(((struct __pyx_obj_8CyOpenGL_PoincareTriangle *)__pyx_v_self), __pyx_v_vertices, __pyx_v_center, __pyx_v_subdivision_depth, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_16PoincareTriangle___init__(struct __pyx_obj_8CyOpenGL_PoincareTriangle *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_center, PyObject *__pyx_v_subdivision_depth, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  CYTHON_UNUSED PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_normals = NULL;
  PyObject *__pyx_v_vertex = NULL;
  PyObject *__pyx_v_scale = NULL;
  PyObject *__pyx_v_V = NULL;
  PyObject *__pyx_v_N = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  long __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("__init__", 0);
  __Pyx_INCREF(__pyx_v_vertices);

  /* "CyOpenGL.pyx":329
 * 
 *     def __init__(self, vertices, center, subdivision_depth=4, **kwargs):
 *         self.original_vertices = vertices             # <<<<<<<<<<<<<<
 *         self.center = center
 *         self.mesh = TriangleMesh(vertices)
 */
  __Pyx_INCREF(__pyx_v_vertices);
  __Pyx_GIVEREF(__pyx_v_vertices);
  __Pyx_GOTREF(__pyx_v_self->original_vertices);
  __Pyx_DECREF(__pyx_v_self->original_vertices);
  __pyx_v_self->original_vertices = __pyx_v_vertices;

  /* "CyOpenGL.pyx":330
 *     def __init__(self, vertices, center, subdivision_depth=4, **kwargs):
 *         self.original_vertices = vertices
 *         self.center = center             # <<<<<<<<<<<<<<
 *         self.mesh = TriangleMesh(vertices)
 *         for n in range(subdivision_depth):
 */
  __Pyx_INCREF(__pyx_v_center);
  __Pyx_GIVEREF(__pyx_v_center);
  __Pyx_GOTREF(__pyx_v_self->center);
  __Pyx_DECREF(__pyx_v_self->center);
  __pyx_v_self->center = __pyx_v_center;

  /* "CyOpenGL.pyx":331
 *         self.original_vertices = vertices
 *         self.center = center
 *         self.mesh = TriangleMesh(vertices)             # <<<<<<<<<<<<<<
 *         for n in range(subdivision_depth):
 *             self.mesh.subdivide()
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_TriangleMesh); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_vertices) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_vertices);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->mesh);
  __Pyx_DECREF(__pyx_v_self->mesh);
  __pyx_v_self->mesh = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":332
 *         self.center = center
 *         self.mesh = TriangleMesh(vertices)
 *         for n in range(subdivision_depth):             # <<<<<<<<<<<<<<
 *             self.mesh.subdivide()
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_subdivision_depth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 332, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 332, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 332, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 332, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 332, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":333
 *         self.mesh = TriangleMesh(vertices)
 *         for n in range(subdivision_depth):
 *             self.mesh.subdivide()             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_subdivide); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 333, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":332
 *         self.center = center
 *         self.mesh = TriangleMesh(vertices)
 *         for n in range(subdivision_depth):             # <<<<<<<<<<<<<<
 *             self.mesh.subdivide()
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":336
 * 
 * 
 *         self.triangles = self.mesh.triangles             # <<<<<<<<<<<<<<
 *         self.vertices = vertices = []
 *         self.normals = normals = []
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_triangles); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 336, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.triangles);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.triangles);
  __pyx_v_self->__pyx_base.triangles = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":337
 * 
 *         self.triangles = self.mesh.triangles
 *         self.vertices = vertices = []             # <<<<<<<<<<<<<<
 *         self.normals = normals = []
 *         for vertex in self.mesh.vertices:
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.vertices);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.vertices);
  __pyx_v_self->__pyx_base.vertices = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_DECREF_SET(__pyx_v_vertices, __pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":338
 *         self.triangles = self.mesh.triangles
 *         self.vertices = vertices = []
 *         self.normals = normals = []             # <<<<<<<<<<<<<<
 *         for vertex in self.mesh.vertices:
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.normals);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.normals);
  __pyx_v_self->__pyx_base.normals = __pyx_t_2;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_normals = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":339
 *         self.vertices = vertices = []
 *         self.normals = normals = []
 *         for vertex in self.mesh.vertices:             # <<<<<<<<<<<<<<
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))
 *             V = vertex/scale
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->mesh, __pyx_n_s_vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 339, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 339, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 339, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 339, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 339, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 339, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_vertex, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":340
 *         self.normals = normals = []
 *         for vertex in self.mesh.vertices:
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))             # <<<<<<<<<<<<<<
 *             V = vertex/scale
 *             N = self.center - V
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_vertex, __pyx_n_s_norm_squared); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_6, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_8 = 0;
    __pyx_t_9 = __Pyx_PyInt_From_long(__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = PyObject_RichCompare(__pyx_t_7, __pyx_t_9, Py_GT); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (__pyx_t_11) {
      __Pyx_INCREF(__pyx_t_7);
      __pyx_t_6 = __pyx_t_7;
    } else {
      __pyx_t_10 = __Pyx_PyInt_From_long(__pyx_t_8); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 340, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_6 = __pyx_t_10;
      __pyx_t_10 = 0;
    }
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_2, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_scale, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":341
 *         for vertex in self.mesh.vertices:
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))
 *             V = vertex/scale             # <<<<<<<<<<<<<<
 *             N = self.center - V
 *             N = N/N.norm
 */
    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_vertex, __pyx_v_scale); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_V, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":342
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))
 *             V = vertex/scale
 *             N = self.center - V             # <<<<<<<<<<<<<<
 *             N = N/N.norm
 *             vertices.append(V)
 */
    __pyx_t_3 = PyNumber_Subtract(__pyx_v_self->center, __pyx_v_V); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_N, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":343
 *             V = vertex/scale
 *             N = self.center - V
 *             N = N/N.norm             # <<<<<<<<<<<<<<
 *             vertices.append(V)
 *             normals.append(N)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_N, __pyx_n_s_norm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_N, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_N, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":344
 *             N = self.center - V
 *             N = N/N.norm
 *             vertices.append(V)             # <<<<<<<<<<<<<<
 *             normals.append(N)
 * 
 */
    __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_vertices, __pyx_v_V); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 344, __pyx_L1_error)

    /* "CyOpenGL.pyx":345
 *             N = N/N.norm
 *             vertices.append(V)
 *             normals.append(N)             # <<<<<<<<<<<<<<
 * 
 *         self.build_arrays()
 */
    __pyx_t_12 = __Pyx_PyList_Append(__pyx_v_normals, __pyx_v_N); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 345, __pyx_L1_error)

    /* "CyOpenGL.pyx":339
 *         self.vertices = vertices = []
 *         self.normals = normals = []
 *         for vertex in self.mesh.vertices:             # <<<<<<<<<<<<<<
 *             scale = 1 + sqrt(max(0, 1 - vertex.norm_squared))
 *             V = vertex/scale
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":347
 *             normals.append(N)
 * 
 *         self.build_arrays()             # <<<<<<<<<<<<<<
 * 
 * cdef class PoincarePolygon(GLobject):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_PoincareTriangle *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.build_arrays(((struct __pyx_obj_8CyOpenGL_MeshedSurface *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":328
 *     cdef center, mesh, original_vertices
 * 
 *     def __init__(self, vertices, center, subdivision_depth=4, **kwargs):             # <<<<<<<<<<<<<<
 *         self.original_vertices = vertices
 *         self.center = center
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("CyOpenGL.PoincareTriangle.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_normals);
  __Pyx_XDECREF(__pyx_v_vertex);
  __Pyx_XDECREF(__pyx_v_scale);
  __Pyx_XDECREF(__pyx_v_V);
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_16PoincareTriangle_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_16PoincareTriangle_2__reduce_cython__[] = "PoincareTriangle.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_16PoincareTriangle_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_16PoincareTriangle_2__reduce_cython__(((struct __pyx_obj_8CyOpenGL_PoincareTriangle *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_16PoincareTriangle_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_PoincareTriangle *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.PoincareTriangle.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_16PoincareTriangle_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_16PoincareTriangle_4__setstate_cython__[] = "PoincareTriangle.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_16PoincareTriangle_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_16PoincareTriangle_4__setstate_cython__(((struct __pyx_obj_8CyOpenGL_PoincareTriangle *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_16PoincareTriangle_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_PoincareTriangle *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.PoincareTriangle.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":360
 *     cdef vertices, center, triangles
 * 
 *     def __init__(self, vertices, center, **kwargs):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.center = center
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_15PoincarePolygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_15PoincarePolygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vertices = 0;
  PyObject *__pyx_v_center = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_center,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_center)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 360, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 360, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_vertices = values[0];
    __pyx_v_center = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 360, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("CyOpenGL.PoincarePolygon.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15PoincarePolygon___init__(((struct __pyx_obj_8CyOpenGL_PoincarePolygon *)__pyx_v_self), __pyx_v_vertices, __pyx_v_center, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_15PoincarePolygon___init__(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_center, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":361
 * 
 *     def __init__(self, vertices, center, **kwargs):
 *         self.vertices = vertices             # <<<<<<<<<<<<<<
 *         self.center = center
 *         self.triangulate()
 */
  __Pyx_INCREF(__pyx_v_vertices);
  __Pyx_GIVEREF(__pyx_v_vertices);
  __Pyx_GOTREF(__pyx_v_self->vertices);
  __Pyx_DECREF(__pyx_v_self->vertices);
  __pyx_v_self->vertices = __pyx_v_vertices;

  /* "CyOpenGL.pyx":362
 *     def __init__(self, vertices, center, **kwargs):
 *         self.vertices = vertices
 *         self.center = center             # <<<<<<<<<<<<<<
 *         self.triangulate()
 * 
 */
  __Pyx_INCREF(__pyx_v_center);
  __Pyx_GIVEREF(__pyx_v_center);
  __Pyx_GOTREF(__pyx_v_self->center);
  __Pyx_DECREF(__pyx_v_self->center);
  __pyx_v_self->center = __pyx_v_center;

  /* "CyOpenGL.pyx":363
 *         self.vertices = vertices
 *         self.center = center
 *         self.triangulate()             # <<<<<<<<<<<<<<
 * 
 *     cdef triangulate(self):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_PoincarePolygon *)__pyx_v_self->__pyx_base.__pyx_vtab)->triangulate(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":360
 *     cdef vertices, center, triangles
 * 
 *     def __init__(self, vertices, center, **kwargs):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.center = center
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.PoincarePolygon.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":365
 *         self.triangulate()
 * 
 *     cdef triangulate(self):             # <<<<<<<<<<<<<<
 *         Vlist = self.vertices
 *         zero = vector3((0,0,0))
 */

static PyObject *__pyx_f_8CyOpenGL_15PoincarePolygon_triangulate(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self) {
  PyObject *__pyx_v_Vlist = NULL;
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_zero = NULL;
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_centroid = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_vertices = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("triangulate", 0);

  /* "CyOpenGL.pyx":366
 * 
 *     cdef triangulate(self):
 *         Vlist = self.vertices             # <<<<<<<<<<<<<<
 *         zero = vector3((0,0,0))
 *         N = len(Vlist)
 */
  __pyx_t_1 = __pyx_v_self->vertices;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_Vlist = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":367
 *     cdef triangulate(self):
 *         Vlist = self.vertices
 *         zero = vector3((0,0,0))             # <<<<<<<<<<<<<<
 *         N = len(Vlist)
 *         self.triangles = []
 */
  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_vector3), __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_zero = ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":368
 *         Vlist = self.vertices
 *         zero = vector3((0,0,0))
 *         N = len(Vlist)             # <<<<<<<<<<<<<<
 *         self.triangles = []
 *         centroid = sum(Vlist, zero)/N
 */
  __pyx_t_2 = PyObject_Length(__pyx_v_Vlist); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 368, __pyx_L1_error)
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":369
 *         zero = vector3((0,0,0))
 *         N = len(Vlist)
 *         self.triangles = []             # <<<<<<<<<<<<<<
 *         centroid = sum(Vlist, zero)/N
 *         for i in range(0,N):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 369, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->triangles);
  __Pyx_DECREF(__pyx_v_self->triangles);
  __pyx_v_self->triangles = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":370
 *         N = len(Vlist)
 *         self.triangles = []
 *         centroid = sum(Vlist, zero)/N             # <<<<<<<<<<<<<<
 *         for i in range(0,N):
 *             vertices = [centroid, Vlist[i-1],Vlist[i]]
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_Vlist);
  __Pyx_GIVEREF(__pyx_v_Vlist);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_Vlist);
  __Pyx_INCREF(((PyObject *)__pyx_v_zero));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_zero));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_zero));
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_sum, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_N); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_centroid = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":371
 *         self.triangles = []
 *         centroid = sum(Vlist, zero)/N
 *         for i in range(0,N):             # <<<<<<<<<<<<<<
 *             vertices = [centroid, Vlist[i-1],Vlist[i]]
 *             self.triangles.append(PoincareTriangle(vertices, self.center))
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_v_N);
  __Pyx_GIVEREF(__pyx_v_N);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_N);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 371, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 371, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 371, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 371, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 371, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 371, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":372
 *         centroid = sum(Vlist, zero)/N
 *         for i in range(0,N):
 *             vertices = [centroid, Vlist[i-1],Vlist[i]]             # <<<<<<<<<<<<<<
 *             self.triangles.append(PoincareTriangle(vertices, self.center))
 * 
 */
    __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_v_Vlist, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_Vlist, __pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = PyList_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 372, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_centroid);
    __Pyx_GIVEREF(__pyx_v_centroid);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_v_centroid);
    __Pyx_GIVEREF(__pyx_t_5);
    PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_6, 2, __pyx_t_3);
    __pyx_t_5 = 0;
    __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_vertices, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":373
 *         for i in range(0,N):
 *             vertices = [centroid, Vlist[i-1],Vlist[i]]
 *             self.triangles.append(PoincareTriangle(vertices, self.center))             # <<<<<<<<<<<<<<
 * 
 *     def draw(self):
 */
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_INCREF(__pyx_v_vertices);
    __Pyx_GIVEREF(__pyx_v_vertices);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_vertices);
    __Pyx_INCREF(__pyx_v_self->center);
    __Pyx_GIVEREF(__pyx_v_self->center);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_self->center);
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_PoincareTriangle), __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 373, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_7 = __Pyx_PyObject_Append(__pyx_v_self->triangles, __pyx_t_3); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(0, 373, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":371
 *         self.triangles = []
 *         centroid = sum(Vlist, zero)/N
 *         for i in range(0,N):             # <<<<<<<<<<<<<<
 *             vertices = [centroid, Vlist[i-1],Vlist[i]]
 *             self.triangles.append(PoincareTriangle(vertices, self.center))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":365
 *         self.triangulate()
 * 
 *     cdef triangulate(self):             # <<<<<<<<<<<<<<
 *         Vlist = self.vertices
 *         zero = vector3((0,0,0))
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.PoincarePolygon.triangulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_Vlist);
  __Pyx_XDECREF((PyObject *)__pyx_v_zero);
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_centroid);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":375
 *             self.triangles.append(PoincareTriangle(vertices, self.center))
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         self.set_material()
 *         for triangle in self.triangles:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15PoincarePolygon_3draw(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_15PoincarePolygon_2draw[] = "PoincarePolygon.draw(self)";
static PyObject *__pyx_pw_8CyOpenGL_15PoincarePolygon_3draw(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_15PoincarePolygon_2draw(((struct __pyx_obj_8CyOpenGL_PoincarePolygon *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_15PoincarePolygon_2draw(struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self) {
  PyObject *__pyx_v_triangle = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "CyOpenGL.pyx":376
 * 
 *     def draw(self):
 *         self.set_material()             # <<<<<<<<<<<<<<
 *         for triangle in self.triangles:
 *             triangle.draw(use_material=False)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_PoincarePolygon *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_material(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":377
 *     def draw(self):
 *         self.set_material()
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             triangle.draw(use_material=False)
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_self->triangles)) || PyTuple_CheckExact(__pyx_v_self->triangles)) {
    __pyx_t_1 = __pyx_v_self->triangles; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->triangles); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 377, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 377, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 377, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 377, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 377, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 377, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_triangle, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":378
 *         self.set_material()
 *         for triangle in self.triangles:
 *             triangle.draw(use_material=False)             # <<<<<<<<<<<<<<
 * 
 * cdef class KleinPolygon(GLobject):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_triangle, __pyx_n_s_draw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_use_material, Py_False) < 0) __PYX_ERR(0, 378, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 378, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":377
 *     def draw(self):
 *         self.set_material()
 *         for triangle in self.triangles:             # <<<<<<<<<<<<<<
 *             triangle.draw(use_material=False)
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":375
 *             self.triangles.append(PoincareTriangle(vertices, self.center))
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         self.set_material()
 *         for triangle in self.triangles:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.PoincarePolygon.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_triangle);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15PoincarePolygon_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_15PoincarePolygon_4__reduce_cython__[] = "PoincarePolygon.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_15PoincarePolygon_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_15PoincarePolygon_4__reduce_cython__(((struct __pyx_obj_8CyOpenGL_PoincarePolygon *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_15PoincarePolygon_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.PoincarePolygon.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15PoincarePolygon_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_15PoincarePolygon_6__setstate_cython__[] = "PoincarePolygon.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_15PoincarePolygon_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_15PoincarePolygon_6__setstate_cython__(((struct __pyx_obj_8CyOpenGL_PoincarePolygon *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_15PoincarePolygon_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_PoincarePolygon *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.PoincarePolygon.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":390
 *     cdef vertices, closest
 * 
 *     def __init__(self, vertices, closest, **kwargs):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.closest = closest
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_12KleinPolygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_12KleinPolygon_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_vertices = 0;
  PyObject *__pyx_v_closest = 0;
  CYTHON_UNUSED PyObject *__pyx_v_kwargs = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return -1;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_closest,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_closest)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 390, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kwargs, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 390, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_vertices = values[0];
    __pyx_v_closest = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 390, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("CyOpenGL.KleinPolygon.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12KleinPolygon___init__(((struct __pyx_obj_8CyOpenGL_KleinPolygon *)__pyx_v_self), __pyx_v_vertices, __pyx_v_closest, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_12KleinPolygon___init__(struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_closest, CYTHON_UNUSED PyObject *__pyx_v_kwargs) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":391
 * 
 *     def __init__(self, vertices, closest, **kwargs):
 *         self.vertices = vertices             # <<<<<<<<<<<<<<
 *         self.closest = closest
 * 
 */
  __Pyx_INCREF(__pyx_v_vertices);
  __Pyx_GIVEREF(__pyx_v_vertices);
  __Pyx_GOTREF(__pyx_v_self->vertices);
  __Pyx_DECREF(__pyx_v_self->vertices);
  __pyx_v_self->vertices = __pyx_v_vertices;

  /* "CyOpenGL.pyx":392
 *     def __init__(self, vertices, closest, **kwargs):
 *         self.vertices = vertices
 *         self.closest = closest             # <<<<<<<<<<<<<<
 * 
 *     def draw(self):
 */
  __Pyx_INCREF(__pyx_v_closest);
  __Pyx_GIVEREF(__pyx_v_closest);
  __Pyx_GOTREF(__pyx_v_self->closest);
  __Pyx_DECREF(__pyx_v_self->closest);
  __pyx_v_self->closest = __pyx_v_closest;

  /* "CyOpenGL.pyx":390
 *     cdef vertices, closest
 * 
 *     def __init__(self, vertices, closest, **kwargs):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.closest = closest
 */

  /* function exit code */
  __pyx_r = 0;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":394
 *         self.closest = closest
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         N = self.closest/self.closest.norm
 *         self.set_material()
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12KleinPolygon_3draw(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_12KleinPolygon_2draw[] = "KleinPolygon.draw(self)";
static PyObject *__pyx_pw_8CyOpenGL_12KleinPolygon_3draw(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_12KleinPolygon_2draw(((struct __pyx_obj_8CyOpenGL_KleinPolygon *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12KleinPolygon_2draw(struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self) {
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_V = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  GLfloat __pyx_t_3;
  GLfloat __pyx_t_4;
  GLfloat __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannySetupContext("draw", 0);

  /* "CyOpenGL.pyx":395
 * 
 *     def draw(self):
 *         N = self.closest/self.closest.norm             # <<<<<<<<<<<<<<
 *         self.set_material()
 *         glBegin(GL_POLYGON)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->closest, __pyx_n_s_norm); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_self->closest, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 395, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_N = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":396
 *     def draw(self):
 *         N = self.closest/self.closest.norm
 *         self.set_material()             # <<<<<<<<<<<<<<
 *         glBegin(GL_POLYGON)
 *         glNormal3f(N.x, N.y, N.z)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_KleinPolygon *)__pyx_v_self->__pyx_base.__pyx_vtab)->__pyx_base.set_material(((struct __pyx_obj_8CyOpenGL_GLobject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 396, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":397
 *         N = self.closest/self.closest.norm
 *         self.set_material()
 *         glBegin(GL_POLYGON)             # <<<<<<<<<<<<<<
 *         glNormal3f(N.x, N.y, N.z)
 *         for V in self.vertices:
 */
  glBegin(GL_POLYGON);

  /* "CyOpenGL.pyx":398
 *         self.set_material()
 *         glBegin(GL_POLYGON)
 *         glNormal3f(N.x, N.y, N.z)             # <<<<<<<<<<<<<<
 *         for V in self.vertices:
 *             glVertex3f(V.x, V.y, V.z)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_N, __pyx_n_s_x); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_N, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_N, __pyx_n_s_z); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_5 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  glNormal3f(__pyx_t_3, __pyx_t_4, __pyx_t_5);

  /* "CyOpenGL.pyx":399
 *         glBegin(GL_POLYGON)
 *         glNormal3f(N.x, N.y, N.z)
 *         for V in self.vertices:             # <<<<<<<<<<<<<<
 *             glVertex3f(V.x, V.y, V.z)
 *         glEnd()
 */
  if (likely(PyList_CheckExact(__pyx_v_self->vertices)) || PyTuple_CheckExact(__pyx_v_self->vertices)) {
    __pyx_t_2 = __pyx_v_self->vertices; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->vertices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 399, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 399, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 399, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 399, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 399, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_V, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":400
 *         glNormal3f(N.x, N.y, N.z)
 *         for V in self.vertices:
 *             glVertex3f(V.x, V.y, V.z)             # <<<<<<<<<<<<<<
 *         glEnd()
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_V, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_V, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_V, __pyx_n_s_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 400, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    glVertex3f(__pyx_t_5, __pyx_t_4, __pyx_t_3);

    /* "CyOpenGL.pyx":399
 *         glBegin(GL_POLYGON)
 *         glNormal3f(N.x, N.y, N.z)
 *         for V in self.vertices:             # <<<<<<<<<<<<<<
 *             glVertex3f(V.x, V.y, V.z)
 *         glEnd()
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":401
 *         for V in self.vertices:
 *             glVertex3f(V.x, V.y, V.z)
 *         glEnd()             # <<<<<<<<<<<<<<
 * 
 * class HyperbolicPolyhedron:
 */
  glEnd();

  /* "CyOpenGL.pyx":394
 *         self.closest = closest
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         N = self.closest/self.closest.norm
 *         self.set_material()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.KleinPolygon.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_V);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12KleinPolygon_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_12KleinPolygon_4__reduce_cython__[] = "KleinPolygon.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_12KleinPolygon_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_12KleinPolygon_4__reduce_cython__(((struct __pyx_obj_8CyOpenGL_KleinPolygon *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12KleinPolygon_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.KleinPolygon.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12KleinPolygon_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_12KleinPolygon_6__setstate_cython__[] = "KleinPolygon.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_12KleinPolygon_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_12KleinPolygon_6__setstate_cython__(((struct __pyx_obj_8CyOpenGL_KleinPolygon *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12KleinPolygon_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_KleinPolygon *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.KleinPolygon.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":412
 *    """
 * 
 *    def __init__(self, facedicts, model_var, sphere_var):             # <<<<<<<<<<<<<<
 *      self.facedicts = facedicts
 *      self.model = model_var
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron___init__[] = "HyperbolicPolyhedron.__init__(self, facedicts, model_var, sphere_var)";
static PyMethodDef __pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron___init__};
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_facedicts = 0;
  PyObject *__pyx_v_model_var = 0;
  PyObject *__pyx_v_sphere_var = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_facedicts,&__pyx_n_s_model_var,&__pyx_n_s_sphere_var,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_facedicts)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 412, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_model_var)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 412, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_sphere_var)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 412, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 412, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_facedicts = values[1];
    __pyx_v_model_var = values[2];
    __pyx_v_sphere_var = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 412, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_20HyperbolicPolyhedron___init__(__pyx_self, __pyx_v_self, __pyx_v_facedicts, __pyx_v_model_var, __pyx_v_sphere_var);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_facedicts, PyObject *__pyx_v_model_var, PyObject *__pyx_v_sphere_var) {
  PyObject *__pyx_v_dict = NULL;
  PyObject *__pyx_v_vertices = NULL;
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_closest = NULL;
  PyObject *__pyx_v_center = NULL;
  PyObject *__pyx_v_color = NULL;
  PyObject *__pyx_v_vertex = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  PyObject *(*__pyx_t_10)(PyObject *);
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":413
 * 
 *    def __init__(self, facedicts, model_var, sphere_var):
 *      self.facedicts = facedicts             # <<<<<<<<<<<<<<
 *      self.model = model_var
 *      self.sphere = sphere_var
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_facedicts, __pyx_v_facedicts) < 0) __PYX_ERR(0, 413, __pyx_L1_error)

  /* "CyOpenGL.pyx":414
 *    def __init__(self, facedicts, model_var, sphere_var):
 *      self.facedicts = facedicts
 *      self.model = model_var             # <<<<<<<<<<<<<<
 *      self.sphere = sphere_var
 *      self.face_specular = [0.5, 0.5, 0.5, 1.0]
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_model, __pyx_v_model_var) < 0) __PYX_ERR(0, 414, __pyx_L1_error)

  /* "CyOpenGL.pyx":415
 *      self.facedicts = facedicts
 *      self.model = model_var
 *      self.sphere = sphere_var             # <<<<<<<<<<<<<<
 *      self.face_specular = [0.5, 0.5, 0.5, 1.0]
 *      self.front_shininess = 50.0
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sphere, __pyx_v_sphere_var) < 0) __PYX_ERR(0, 415, __pyx_L1_error)

  /* "CyOpenGL.pyx":416
 *      self.model = model_var
 *      self.sphere = sphere_var
 *      self.face_specular = [0.5, 0.5, 0.5, 1.0]             # <<<<<<<<<<<<<<
 *      self.front_shininess = 50.0
 *      self.back_shininess = 50.0
 */
  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_float_0_5);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_float_0_5);
  __Pyx_INCREF(__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_float_0_5);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_float_0_5);
  __Pyx_INCREF(__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_float_0_5);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_float_0_5);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_float_1_0);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_face_specular, __pyx_t_1) < 0) __PYX_ERR(0, 416, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":417
 *      self.sphere = sphere_var
 *      self.face_specular = [0.5, 0.5, 0.5, 1.0]
 *      self.front_shininess = 50.0             # <<<<<<<<<<<<<<
 *      self.back_shininess = 50.0
 *      self.sphere_list_id = glGenLists(1)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_front_shininess, __pyx_float_50_0) < 0) __PYX_ERR(0, 417, __pyx_L1_error)

  /* "CyOpenGL.pyx":418
 *      self.face_specular = [0.5, 0.5, 0.5, 1.0]
 *      self.front_shininess = 50.0
 *      self.back_shininess = 50.0             # <<<<<<<<<<<<<<
 *      self.sphere_list_id = glGenLists(1)
 *      self.S_infinity = WireframeSphere(color=[1.0, 1.0, 1.0, .2],
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_back_shininess, __pyx_float_50_0) < 0) __PYX_ERR(0, 418, __pyx_L1_error)

  /* "CyOpenGL.pyx":419
 *      self.front_shininess = 50.0
 *      self.back_shininess = 50.0
 *      self.sphere_list_id = glGenLists(1)             # <<<<<<<<<<<<<<
 *      self.S_infinity = WireframeSphere(color=[1.0, 1.0, 1.0, .2],
 *                               front_specular=[0.5, 0.5, 0.5, 1.0],
 */
  __pyx_t_1 = __Pyx_PyInt_From_GLuint(glGenLists(1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_sphere_list_id, __pyx_t_1) < 0) __PYX_ERR(0, 419, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":420
 *      self.back_shininess = 50.0
 *      self.sphere_list_id = glGenLists(1)
 *      self.S_infinity = WireframeSphere(color=[1.0, 1.0, 1.0, .2],             # <<<<<<<<<<<<<<
 *                               front_specular=[0.5, 0.5, 0.5, 1.0],
 *                               front_shininess=50.0)
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_float_1_0);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_float_1_0);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_float_1_0);
  __Pyx_INCREF(__pyx_float__2);
  __Pyx_GIVEREF(__pyx_float__2);
  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_float__2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_color, __pyx_t_2) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":421
 *      self.sphere_list_id = glGenLists(1)
 *      self.S_infinity = WireframeSphere(color=[1.0, 1.0, 1.0, .2],
 *                               front_specular=[0.5, 0.5, 0.5, 1.0],             # <<<<<<<<<<<<<<
 *                               front_shininess=50.0)
 *      self.S_infinity.build_display_list(self.sphere_list_id, 1.0, 30, 30)
 */
  __pyx_t_2 = PyList_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_float_0_5);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_float_0_5);
  __Pyx_INCREF(__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_float_0_5);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_float_0_5);
  __Pyx_INCREF(__pyx_float_0_5);
  __Pyx_GIVEREF(__pyx_float_0_5);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_float_0_5);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_float_1_0);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_front_specular, __pyx_t_2) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_front_shininess, __pyx_float_50_0) < 0) __PYX_ERR(0, 420, __pyx_L1_error)

  /* "CyOpenGL.pyx":420
 *      self.back_shininess = 50.0
 *      self.sphere_list_id = glGenLists(1)
 *      self.S_infinity = WireframeSphere(color=[1.0, 1.0, 1.0, .2],             # <<<<<<<<<<<<<<
 *                               front_specular=[0.5, 0.5, 0.5, 1.0],
 *                               front_shininess=50.0)
 */
  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_WireframeSphere), __pyx_empty_tuple, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_S_infinity, __pyx_t_2) < 0) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":423
 *                               front_specular=[0.5, 0.5, 0.5, 1.0],
 *                               front_shininess=50.0)
 *      self.S_infinity.build_display_list(self.sphere_list_id, 1.0, 30, 30)             # <<<<<<<<<<<<<<
 *      self.Klein_faces = []
 *      self.Poincare_faces = []
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_S_infinity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_build_display_list); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sphere_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_t_1, __pyx_float_1_0, __pyx_int_30, __pyx_int_30};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[5] = {__pyx_t_4, __pyx_t_1, __pyx_float_1_0, __pyx_int_30, __pyx_int_30};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 4+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(4+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_1);
    __Pyx_INCREF(__pyx_float_1_0);
    __Pyx_GIVEREF(__pyx_float_1_0);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_float_1_0);
    __Pyx_INCREF(__pyx_int_30);
    __Pyx_GIVEREF(__pyx_int_30);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_int_30);
    __Pyx_INCREF(__pyx_int_30);
    __Pyx_GIVEREF(__pyx_int_30);
    PyTuple_SET_ITEM(__pyx_t_6, 3+__pyx_t_5, __pyx_int_30);
    __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":424
 *                               front_shininess=50.0)
 *      self.S_infinity.build_display_list(self.sphere_list_id, 1.0, 30, 30)
 *      self.Klein_faces = []             # <<<<<<<<<<<<<<
 *      self.Poincare_faces = []
 *      for dict in facedicts:
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Klein_faces, __pyx_t_2) < 0) __PYX_ERR(0, 424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":425
 *      self.S_infinity.build_display_list(self.sphere_list_id, 1.0, 30, 30)
 *      self.Klein_faces = []
 *      self.Poincare_faces = []             # <<<<<<<<<<<<<<
 *      for dict in facedicts:
 *          vertices = [vector3(vertex) for vertex in dict['vertices']]
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 425, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Poincare_faces, __pyx_t_2) < 0) __PYX_ERR(0, 425, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":426
 *      self.Klein_faces = []
 *      self.Poincare_faces = []
 *      for dict in facedicts:             # <<<<<<<<<<<<<<
 *          vertices = [vector3(vertex) for vertex in dict['vertices']]
 *          closest = vector3(dict['closest'])
 */
  if (likely(PyList_CheckExact(__pyx_v_facedicts)) || PyTuple_CheckExact(__pyx_v_facedicts)) {
    __pyx_t_2 = __pyx_v_facedicts; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_facedicts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 426, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 426, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 426, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_8(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 426, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_dict, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":427
 *      self.Poincare_faces = []
 *      for dict in facedicts:
 *          vertices = [vector3(vertex) for vertex in dict['vertices']]             # <<<<<<<<<<<<<<
 *          closest = vector3(dict['closest'])
 *          center = closest*(1/dict['distance']**2)
 */
    __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict, __pyx_n_s_vertices); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (likely(PyList_CheckExact(__pyx_t_6)) || PyTuple_CheckExact(__pyx_t_6)) {
      __pyx_t_1 = __pyx_t_6; __Pyx_INCREF(__pyx_t_1); __pyx_t_9 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_9 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_10 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 427, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_1))) {
          if (__pyx_t_9 >= PyList_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        } else {
          if (__pyx_t_9 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_6 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_9); __Pyx_INCREF(__pyx_t_6); __pyx_t_9++; if (unlikely(0 < 0)) __PYX_ERR(0, 427, __pyx_L1_error)
          #else
          __pyx_t_6 = PySequence_ITEM(__pyx_t_1, __pyx_t_9); __pyx_t_9++; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_6);
          #endif
        }
      } else {
        __pyx_t_6 = __pyx_t_10(__pyx_t_1);
        if (unlikely(!__pyx_t_6)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 427, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_6);
      }
      __Pyx_XDECREF_SET(__pyx_v_vertex, __pyx_t_6);
      __pyx_t_6 = 0;
      __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8CyOpenGL_vector3), __pyx_v_vertex); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 427, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_vertices, ((PyObject*)__pyx_t_3));
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":428
 *      for dict in facedicts:
 *          vertices = [vector3(vertex) for vertex in dict['vertices']]
 *          closest = vector3(dict['closest'])             # <<<<<<<<<<<<<<
 *          center = closest*(1/dict['distance']**2)
 *          color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict, __pyx_n_s_closest); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8CyOpenGL_vector3), __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_closest, ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":429
 *          vertices = [vector3(vertex) for vertex in dict['vertices']]
 *          closest = vector3(dict['closest'])
 *          center = closest*(1/dict['distance']**2)             # <<<<<<<<<<<<<<
 *          color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)
 *          self.Klein_faces.append(
 */
    __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict, __pyx_n_s_distance); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = PyNumber_Multiply(((PyObject *)__pyx_v_closest), __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF_SET(__pyx_v_center, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":430
 *          closest = vector3(dict['closest'])
 *          center = closest*(1/dict['distance']**2)
 *          color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)             # <<<<<<<<<<<<<<
 *          self.Klein_faces.append(
 *              KleinPolygon(vertices, closest,
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_hls_to_rgb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_dict, __pyx_n_s_hue); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = NULL;
    __pyx_t_5 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_5 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_6, __pyx_float_0_5, __pyx_float_1_0};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_6, __pyx_float_0_5, __pyx_float_1_0};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    } else
    #endif
    {
      __pyx_t_11 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      if (__pyx_t_4) {
        __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_4); __pyx_t_4 = NULL;
      }
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_11, 0+__pyx_t_5, __pyx_t_6);
      __Pyx_INCREF(__pyx_float_0_5);
      __Pyx_GIVEREF(__pyx_float_0_5);
      PyTuple_SET_ITEM(__pyx_t_11, 1+__pyx_t_5, __pyx_float_0_5);
      __Pyx_INCREF(__pyx_float_1_0);
      __Pyx_GIVEREF(__pyx_float_1_0);
      PyTuple_SET_ITEM(__pyx_t_11, 2+__pyx_t_5, __pyx_float_1_0);
      __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 430, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_tuple__27); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_color, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":431
 *          center = closest*(1/dict['distance']**2)
 *          color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)
 *          self.Klein_faces.append(             # <<<<<<<<<<<<<<
 *              KleinPolygon(vertices, closest,
 *                              color=color,
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Klein_faces); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "CyOpenGL.pyx":432
 *          color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)
 *          self.Klein_faces.append(
 *              KleinPolygon(vertices, closest,             # <<<<<<<<<<<<<<
 *                              color=color,
 *                              front_specular=self.face_specular,
 */
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_vertices);
    __Pyx_GIVEREF(__pyx_v_vertices);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vertices);
    __Pyx_INCREF(((PyObject *)__pyx_v_closest));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_closest));
    PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_closest));

    /* "CyOpenGL.pyx":433
 *          self.Klein_faces.append(
 *              KleinPolygon(vertices, closest,
 *                              color=color,             # <<<<<<<<<<<<<<
 *                              front_specular=self.face_specular,
 *                              back_specular=self.face_specular,
 */
    __pyx_t_11 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_color, __pyx_v_color) < 0) __PYX_ERR(0, 433, __pyx_L1_error)

    /* "CyOpenGL.pyx":434
 *              KleinPolygon(vertices, closest,
 *                              color=color,
 *                              front_specular=self.face_specular,             # <<<<<<<<<<<<<<
 *                              back_specular=self.face_specular,
 *                              front_shininess=self.front_shininess,
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_specular); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 434, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_front_specular, __pyx_t_6) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":435
 *                              color=color,
 *                              front_specular=self.face_specular,
 *                              back_specular=self.face_specular,             # <<<<<<<<<<<<<<
 *                              front_shininess=self.front_shininess,
 *                              back_shininess=self.back_shininess))
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_specular); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_back_specular, __pyx_t_6) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":436
 *                              front_specular=self.face_specular,
 *                              back_specular=self.face_specular,
 *                              front_shininess=self.front_shininess,             # <<<<<<<<<<<<<<
 *                              back_shininess=self.back_shininess))
 *          self.Poincare_faces.append(
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_front_shininess); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_front_shininess, __pyx_t_6) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":437
 *                              back_specular=self.face_specular,
 *                              front_shininess=self.front_shininess,
 *                              back_shininess=self.back_shininess))             # <<<<<<<<<<<<<<
 *          self.Poincare_faces.append(
 *              PoincarePolygon(vertices, center,
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_back_shininess); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 437, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_back_shininess, __pyx_t_6) < 0) __PYX_ERR(0, 433, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":432
 *          color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)
 *          self.Klein_faces.append(
 *              KleinPolygon(vertices, closest,             # <<<<<<<<<<<<<<
 *                              color=color,
 *                              front_specular=self.face_specular,
 */
    __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_KleinPolygon), __pyx_t_3, __pyx_t_11); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 432, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "CyOpenGL.pyx":431
 *          center = closest*(1/dict['distance']**2)
 *          color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)
 *          self.Klein_faces.append(             # <<<<<<<<<<<<<<
 *              KleinPolygon(vertices, closest,
 *                              color=color,
 */
    __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_1, __pyx_t_6); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 431, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":438
 *                              front_shininess=self.front_shininess,
 *                              back_shininess=self.back_shininess))
 *          self.Poincare_faces.append(             # <<<<<<<<<<<<<<
 *              PoincarePolygon(vertices, center,
 *                              color=color,
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Poincare_faces); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 438, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);

    /* "CyOpenGL.pyx":439
 *                              back_shininess=self.back_shininess))
 *          self.Poincare_faces.append(
 *              PoincarePolygon(vertices, center,             # <<<<<<<<<<<<<<
 *                              color=color,
 *                              front_specular=self.face_specular,
 */
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_INCREF(__pyx_v_vertices);
    __Pyx_GIVEREF(__pyx_v_vertices);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vertices);
    __Pyx_INCREF(__pyx_v_center);
    __Pyx_GIVEREF(__pyx_v_center);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_center);

    /* "CyOpenGL.pyx":440
 *          self.Poincare_faces.append(
 *              PoincarePolygon(vertices, center,
 *                              color=color,             # <<<<<<<<<<<<<<
 *                              front_specular=self.face_specular,
 *                              back_specular=self.face_specular,
 */
    __pyx_t_11 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_color, __pyx_v_color) < 0) __PYX_ERR(0, 440, __pyx_L1_error)

    /* "CyOpenGL.pyx":441
 *              PoincarePolygon(vertices, center,
 *                              color=color,
 *                              front_specular=self.face_specular,             # <<<<<<<<<<<<<<
 *                              back_specular=self.face_specular,
 *                              front_shininess=self.front_shininess,
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_specular); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 441, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_front_specular, __pyx_t_3) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":442
 *                              color=color,
 *                              front_specular=self.face_specular,
 *                              back_specular=self.face_specular,             # <<<<<<<<<<<<<<
 *                              front_shininess=self.front_shininess,
 *                              back_shininess=self.back_shininess))
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_face_specular); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 442, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_back_specular, __pyx_t_3) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":443
 *                              front_specular=self.face_specular,
 *                              back_specular=self.face_specular,
 *                              front_shininess=self.front_shininess,             # <<<<<<<<<<<<<<
 *                              back_shininess=self.back_shininess))
 *      self.klein_list_id = glGenLists(1)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_front_shininess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 443, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_front_shininess, __pyx_t_3) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":444
 *                              back_specular=self.face_specular,
 *                              front_shininess=self.front_shininess,
 *                              back_shininess=self.back_shininess))             # <<<<<<<<<<<<<<
 *      self.klein_list_id = glGenLists(1)
 *      self.build_klein_poly(self.klein_list_id)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_back_shininess); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 444, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_11, __pyx_n_s_back_shininess, __pyx_t_3) < 0) __PYX_ERR(0, 440, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":439
 *                              back_shininess=self.back_shininess))
 *          self.Poincare_faces.append(
 *              PoincarePolygon(vertices, center,             # <<<<<<<<<<<<<<
 *                              color=color,
 *                              front_specular=self.face_specular,
 */
    __pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_PoincarePolygon), __pyx_t_1, __pyx_t_11); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "CyOpenGL.pyx":438
 *                              front_shininess=self.front_shininess,
 *                              back_shininess=self.back_shininess))
 *          self.Poincare_faces.append(             # <<<<<<<<<<<<<<
 *              PoincarePolygon(vertices, center,
 *                              color=color,
 */
    __pyx_t_12 = __Pyx_PyObject_Append(__pyx_t_6, __pyx_t_3); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 438, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":426
 *      self.Klein_faces = []
 *      self.Poincare_faces = []
 *      for dict in facedicts:             # <<<<<<<<<<<<<<
 *          vertices = [vector3(vertex) for vertex in dict['vertices']]
 *          closest = vector3(dict['closest'])
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":445
 *                              front_shininess=self.front_shininess,
 *                              back_shininess=self.back_shininess))
 *      self.klein_list_id = glGenLists(1)             # <<<<<<<<<<<<<<
 *      self.build_klein_poly(self.klein_list_id)
 *      self.poincare_list_id = glGenLists(1)
 */
  __pyx_t_2 = __Pyx_PyInt_From_GLuint(glGenLists(1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_klein_list_id, __pyx_t_2) < 0) __PYX_ERR(0, 445, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":446
 *                              back_shininess=self.back_shininess))
 *      self.klein_list_id = glGenLists(1)
 *      self.build_klein_poly(self.klein_list_id)             # <<<<<<<<<<<<<<
 *      self.poincare_list_id = glGenLists(1)
 *      self.build_poincare_poly(self.poincare_list_id)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_build_klein_poly); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_klein_list_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_11 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_11, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 446, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":447
 *      self.klein_list_id = glGenLists(1)
 *      self.build_klein_poly(self.klein_list_id)
 *      self.poincare_list_id = glGenLists(1)             # <<<<<<<<<<<<<<
 *      self.build_poincare_poly(self.poincare_list_id)
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_From_GLuint(glGenLists(1)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_poincare_list_id, __pyx_t_2) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":448
 *      self.build_klein_poly(self.klein_list_id)
 *      self.poincare_list_id = glGenLists(1)
 *      self.build_poincare_poly(self.poincare_list_id)             # <<<<<<<<<<<<<<
 * 
 *    def destroy(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_build_poincare_poly); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_poincare_list_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_11 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_11)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_11);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_11, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":412
 *    """
 * 
 *    def __init__(self, facedicts, model_var, sphere_var):             # <<<<<<<<<<<<<<
 *      self.facedicts = facedicts
 *      self.model = model_var
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_dict);
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_XDECREF((PyObject *)__pyx_v_closest);
  __Pyx_XDECREF(__pyx_v_center);
  __Pyx_XDECREF(__pyx_v_color);
  __Pyx_XDECREF(__pyx_v_vertex);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":450
 *      self.build_poincare_poly(self.poincare_list_id)
 * 
 *    def destroy(self):             # <<<<<<<<<<<<<<
 *        glDeleteLists(self.sphere_list_id, 1)
 *        glDeleteLists(self.klein_list_id, 1)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_3destroy(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron_2destroy[] = "HyperbolicPolyhedron.destroy(self)";
static PyMethodDef __pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_3destroy = {"destroy", (PyCFunction)__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_3destroy, METH_O, __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron_2destroy};
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_3destroy(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_2destroy(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_2destroy(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  GLuint __pyx_t_2;
  __Pyx_RefNannySetupContext("destroy", 0);

  /* "CyOpenGL.pyx":451
 * 
 *    def destroy(self):
 *        glDeleteLists(self.sphere_list_id, 1)             # <<<<<<<<<<<<<<
 *        glDeleteLists(self.klein_list_id, 1)
 *        glDeleteLists(self.poincare_list_id, 1)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sphere_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 451, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glDeleteLists(__pyx_t_2, 1);

  /* "CyOpenGL.pyx":452
 *    def destroy(self):
 *        glDeleteLists(self.sphere_list_id, 1)
 *        glDeleteLists(self.klein_list_id, 1)             # <<<<<<<<<<<<<<
 *        glDeleteLists(self.poincare_list_id, 1)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_klein_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 452, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glDeleteLists(__pyx_t_2, 1);

  /* "CyOpenGL.pyx":453
 *        glDeleteLists(self.sphere_list_id, 1)
 *        glDeleteLists(self.klein_list_id, 1)
 *        glDeleteLists(self.poincare_list_id, 1)             # <<<<<<<<<<<<<<
 * 
 *    def draw(self, *args):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_poincare_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 453, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glDeleteLists(__pyx_t_2, 1);

  /* "CyOpenGL.pyx":450
 *      self.build_poincare_poly(self.poincare_list_id)
 * 
 *    def destroy(self):             # <<<<<<<<<<<<<<
 *        glDeleteLists(self.sphere_list_id, 1)
 *        glDeleteLists(self.klein_list_id, 1)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":455
 *        glDeleteLists(self.poincare_list_id, 1)
 * 
 *    def draw(self, *args):             # <<<<<<<<<<<<<<
 *        model = self.model.get()
 *        if model == 'Klein':
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_5draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron_4draw[] = "HyperbolicPolyhedron.draw(self, *args)";
static PyMethodDef __pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_5draw = {"draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_5draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron_4draw};
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_5draw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_args = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_args)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_args);
  } else {
    __pyx_v_args = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "draw") < 0)) __PYX_ERR(0, 455, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 455, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_args); __pyx_v_args = 0;
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_4draw(__pyx_self, __pyx_v_self, __pyx_v_args);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_4draw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
  PyObject *__pyx_v_model = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  GLuint __pyx_t_5;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "CyOpenGL.pyx":456
 * 
 *    def draw(self, *args):
 *        model = self.model.get()             # <<<<<<<<<<<<<<
 *        if model == 'Klein':
 *            glCallList(self.klein_list_id)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_model); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_get); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_model = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":457
 *    def draw(self, *args):
 *        model = self.model.get()
 *        if model == 'Klein':             # <<<<<<<<<<<<<<
 *            glCallList(self.klein_list_id)
 *        elif model == 'Poincare':
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_model, __pyx_n_s_Klein, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 457, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":458
 *        model = self.model.get()
 *        if model == 'Klein':
 *            glCallList(self.klein_list_id)             # <<<<<<<<<<<<<<
 *        elif model == 'Poincare':
 *            glCallList(self.poincare_list_id)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_klein_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_5 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 458, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    glCallList(__pyx_t_5);

    /* "CyOpenGL.pyx":457
 *    def draw(self, *args):
 *        model = self.model.get()
 *        if model == 'Klein':             # <<<<<<<<<<<<<<
 *            glCallList(self.klein_list_id)
 *        elif model == 'Poincare':
 */
    goto __pyx_L3;
  }

  /* "CyOpenGL.pyx":459
 *        if model == 'Klein':
 *            glCallList(self.klein_list_id)
 *        elif model == 'Poincare':             # <<<<<<<<<<<<<<
 *            glCallList(self.poincare_list_id)
 *        if self.sphere.get():
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_model, __pyx_n_s_Poincare, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 459, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":460
 *            glCallList(self.klein_list_id)
 *        elif model == 'Poincare':
 *            glCallList(self.poincare_list_id)             # <<<<<<<<<<<<<<
 *        if self.sphere.get():
 *            glCallList(self.sphere_list_id)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_poincare_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_5 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 460, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    glCallList(__pyx_t_5);

    /* "CyOpenGL.pyx":459
 *        if model == 'Klein':
 *            glCallList(self.klein_list_id)
 *        elif model == 'Poincare':             # <<<<<<<<<<<<<<
 *            glCallList(self.poincare_list_id)
 *        if self.sphere.get():
 */
  }
  __pyx_L3:;

  /* "CyOpenGL.pyx":461
 *        elif model == 'Poincare':
 *            glCallList(self.poincare_list_id)
 *        if self.sphere.get():             # <<<<<<<<<<<<<<
 *            glCallList(self.sphere_list_id)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sphere); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":462
 *            glCallList(self.poincare_list_id)
 *        if self.sphere.get():
 *            glCallList(self.sphere_list_id)             # <<<<<<<<<<<<<<
 * 
 *    def build_klein_poly(self, list):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_sphere_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 462, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_5 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 462, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    glCallList(__pyx_t_5);

    /* "CyOpenGL.pyx":461
 *        elif model == 'Poincare':
 *            glCallList(self.poincare_list_id)
 *        if self.sphere.get():             # <<<<<<<<<<<<<<
 *            glCallList(self.sphere_list_id)
 * 
 */
  }

  /* "CyOpenGL.pyx":455
 *        glDeleteLists(self.poincare_list_id, 1)
 * 
 *    def draw(self, *args):             # <<<<<<<<<<<<<<
 *        model = self.model.get()
 *        if model == 'Klein':
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_model);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":464
 *            glCallList(self.sphere_list_id)
 * 
 *    def build_klein_poly(self, list):             # <<<<<<<<<<<<<<
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Klein_faces:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_7build_klein_poly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron_6build_klein_poly[] = "HyperbolicPolyhedron.build_klein_poly(self, list)";
static PyMethodDef __pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_7build_klein_poly = {"build_klein_poly", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_7build_klein_poly, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron_6build_klein_poly};
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_7build_klein_poly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_list = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_klein_poly (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_list,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("build_klein_poly", 1, 2, 2, 1); __PYX_ERR(0, 464, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build_klein_poly") < 0)) __PYX_ERR(0, 464, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_list = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_klein_poly", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 464, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.build_klein_poly", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_6build_klein_poly(__pyx_self, __pyx_v_self, __pyx_v_list);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_6build_klein_poly(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_list) {
  PyObject *__pyx_v_face = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GLuint __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("build_klein_poly", 0);

  /* "CyOpenGL.pyx":465
 * 
 *    def build_klein_poly(self, list):
 *      glNewList(list, GL_COMPILE)             # <<<<<<<<<<<<<<
 *      for face in self.Klein_faces:
 *        face.draw()
 */
  __pyx_t_1 = __Pyx_PyInt_As_GLuint(__pyx_v_list); if (unlikely((__pyx_t_1 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 465, __pyx_L1_error)
  glNewList(__pyx_t_1, GL_COMPILE);

  /* "CyOpenGL.pyx":466
 *    def build_klein_poly(self, list):
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Klein_faces:             # <<<<<<<<<<<<<<
 *        face.draw()
 *      glEndList()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Klein_faces); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 466, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 466, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 466, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 466, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 466, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 466, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_face, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":467
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Klein_faces:
 *        face.draw()             # <<<<<<<<<<<<<<
 *      glEndList()
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_face, __pyx_n_s_draw); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 467, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":466
 *    def build_klein_poly(self, list):
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Klein_faces:             # <<<<<<<<<<<<<<
 *        face.draw()
 *      glEndList()
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":468
 *      for face in self.Klein_faces:
 *        face.draw()
 *      glEndList()             # <<<<<<<<<<<<<<
 * 
 *    def build_poincare_poly(self, list):
 */
  glEndList();

  /* "CyOpenGL.pyx":464
 *            glCallList(self.sphere_list_id)
 * 
 *    def build_klein_poly(self, list):             # <<<<<<<<<<<<<<
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Klein_faces:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.build_klein_poly", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_face);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":470
 *      glEndList()
 * 
 *    def build_poincare_poly(self, list):             # <<<<<<<<<<<<<<
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Poincare_faces:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_9build_poincare_poly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron_8build_poincare_poly[] = "HyperbolicPolyhedron.build_poincare_poly(self, list)";
static PyMethodDef __pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_9build_poincare_poly = {"build_poincare_poly", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_9build_poincare_poly, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_20HyperbolicPolyhedron_8build_poincare_poly};
static PyObject *__pyx_pw_8CyOpenGL_20HyperbolicPolyhedron_9build_poincare_poly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_list = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_poincare_poly (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_list,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("build_poincare_poly", 1, 2, 2, 1); __PYX_ERR(0, 470, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build_poincare_poly") < 0)) __PYX_ERR(0, 470, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_list = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_poincare_poly", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 470, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.build_poincare_poly", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_8build_poincare_poly(__pyx_self, __pyx_v_self, __pyx_v_list);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_20HyperbolicPolyhedron_8build_poincare_poly(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_list) {
  PyObject *__pyx_v_face = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GLuint __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("build_poincare_poly", 0);

  /* "CyOpenGL.pyx":471
 * 
 *    def build_poincare_poly(self, list):
 *      glNewList(list, GL_COMPILE)             # <<<<<<<<<<<<<<
 *      for face in self.Poincare_faces:
 *        face.draw()
 */
  __pyx_t_1 = __Pyx_PyInt_As_GLuint(__pyx_v_list); if (unlikely((__pyx_t_1 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 471, __pyx_L1_error)
  glNewList(__pyx_t_1, GL_COMPILE);

  /* "CyOpenGL.pyx":472
 *    def build_poincare_poly(self, list):
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Poincare_faces:             # <<<<<<<<<<<<<<
 *        face.draw()
 *      glEndList()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Poincare_faces); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 472, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 472, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 472, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 472, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 472, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 472, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_face, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":473
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Poincare_faces:
 *        face.draw()             # <<<<<<<<<<<<<<
 *      glEndList()
 * 
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_face, __pyx_n_s_draw); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":472
 *    def build_poincare_poly(self, list):
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Poincare_faces:             # <<<<<<<<<<<<<<
 *        face.draw()
 *      glEndList()
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":474
 *      for face in self.Poincare_faces:
 *        face.draw()
 *      glEndList()             # <<<<<<<<<<<<<<
 * 
 * cdef class Colorizer:
 */
  glEndList();

  /* "CyOpenGL.pyx":470
 *      glEndList()
 * 
 *    def build_poincare_poly(self, list):             # <<<<<<<<<<<<<<
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Poincare_faces:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.HyperbolicPolyhedron.build_poincare_poly", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_face);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":484
 *     cdef double lightness, saturation, alpha
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         cdef int n
 *         # red blue green cyan magenta yellow
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_9Colorizer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_9Colorizer_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
    __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
  __pyx_r = __pyx_pf_8CyOpenGL_9Colorizer___cinit__(((struct __pyx_obj_8CyOpenGL_Colorizer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_9Colorizer___cinit__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self) {
  int __pyx_v_n;
  PyObject *__pyx_v_hues = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_RefNannySetupContext("__cinit__", 0);

  /* "CyOpenGL.pyx":487
 *         cdef int n
 *         # red blue green cyan magenta yellow
 *         cdef hues = [0,4,2,3,5,1]             # <<<<<<<<<<<<<<
 *         # maybe one day Cython will let you initialize C arrays
 *         for n in range(6):
 */
  __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_int_4);
  __Pyx_GIVEREF(__pyx_int_4);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_int_4);
  __Pyx_INCREF(__pyx_int_2);
  __Pyx_GIVEREF(__pyx_int_2);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_int_2);
  __Pyx_INCREF(__pyx_int_3);
  __Pyx_GIVEREF(__pyx_int_3);
  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_int_3);
  __Pyx_INCREF(__pyx_int_5);
  __Pyx_GIVEREF(__pyx_int_5);
  PyList_SET_ITEM(__pyx_t_1, 4, __pyx_int_5);
  __Pyx_INCREF(__pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  PyList_SET_ITEM(__pyx_t_1, 5, __pyx_int_1);
  __pyx_v_hues = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":489
 *         cdef hues = [0,4,2,3,5,1]
 *         # maybe one day Cython will let you initialize C arrays
 *         for n in range(6):             # <<<<<<<<<<<<<<
 *             self.base_hue[n] = hues[n]
 * 
 */
  for (__pyx_t_2 = 0; __pyx_t_2 < 6; __pyx_t_2+=1) {
    __pyx_v_n = __pyx_t_2;

    /* "CyOpenGL.pyx":490
 *         # maybe one day Cython will let you initialize C arrays
 *         for n in range(6):
 *             self.base_hue[n] = hues[n]             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, lightness=0.6, saturation=0.9, alpha=0.8):
 */
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_hues, __pyx_v_n, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 490, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    (__pyx_v_self->base_hue[__pyx_v_n]) = __pyx_t_3;
  }

  /* "CyOpenGL.pyx":484
 *     cdef double lightness, saturation, alpha
 * 
 *     def __cinit__(self):             # <<<<<<<<<<<<<<
 *         cdef int n
 *         # red blue green cyan magenta yellow
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_hues);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":492
 *             self.base_hue[n] = hues[n]
 * 
 *     def __init__(self, lightness=0.6, saturation=0.9, alpha=0.8):             # <<<<<<<<<<<<<<
 *         self.lightness = lightness
 *         self.saturation = saturation
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_9Colorizer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_9Colorizer_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_lightness = 0;
  PyObject *__pyx_v_saturation = 0;
  PyObject *__pyx_v_alpha = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lightness,&__pyx_n_s_saturation,&__pyx_n_s_alpha,0};
    PyObject* values[3] = {0,0,0};
    values[0] = ((PyObject *)__pyx_float_0_6);
    values[1] = ((PyObject *)__pyx_float_0_9);
    values[2] = ((PyObject *)__pyx_float_0_8);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_lightness);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_saturation);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_alpha);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 492, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_lightness = values[0];
    __pyx_v_saturation = values[1];
    __pyx_v_alpha = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 492, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_9Colorizer_2__init__(((struct __pyx_obj_8CyOpenGL_Colorizer *)__pyx_v_self), __pyx_v_lightness, __pyx_v_saturation, __pyx_v_alpha);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_9Colorizer_2__init__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, PyObject *__pyx_v_lightness, PyObject *__pyx_v_saturation, PyObject *__pyx_v_alpha) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":493
 * 
 *     def __init__(self, lightness=0.6, saturation=0.9, alpha=0.8):
 *         self.lightness = lightness             # <<<<<<<<<<<<<<
 *         self.saturation = saturation
 *         self.alpha = alpha
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_lightness); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 493, __pyx_L1_error)
  __pyx_v_self->lightness = __pyx_t_1;

  /* "CyOpenGL.pyx":494
 *     def __init__(self, lightness=0.6, saturation=0.9, alpha=0.8):
 *         self.lightness = lightness
 *         self.saturation = saturation             # <<<<<<<<<<<<<<
 *         self.alpha = alpha
 * 
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_saturation); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 494, __pyx_L1_error)
  __pyx_v_self->saturation = __pyx_t_1;

  /* "CyOpenGL.pyx":495
 *         self.lightness = lightness
 *         self.saturation = saturation
 *         self.alpha = alpha             # <<<<<<<<<<<<<<
 * 
 *     def __call__(self, index):
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_alpha); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 495, __pyx_L1_error)
  __pyx_v_self->alpha = __pyx_t_1;

  /* "CyOpenGL.pyx":492
 *             self.base_hue[n] = hues[n]
 * 
 *     def __init__(self, lightness=0.6, saturation=0.9, alpha=0.8):             # <<<<<<<<<<<<<<
 *         self.lightness = lightness
 *         self.saturation = saturation
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":497
 *         self.alpha = alpha
 * 
 *     def __call__(self, index):             # <<<<<<<<<<<<<<
 *         cdef double hue, R, G, B
 *         hue = (self.base_hue[index%6] + self.index_to_hue(index//6)) / 6.0
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_9Colorizer_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyObject *__pyx_pw_8CyOpenGL_9Colorizer_5__call__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_index = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__call__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_index,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_index)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__call__") < 0)) __PYX_ERR(0, 497, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_index = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__call__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 497, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_9Colorizer_4__call__(((struct __pyx_obj_8CyOpenGL_Colorizer *)__pyx_v_self), __pyx_v_index);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_9Colorizer_4__call__(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, PyObject *__pyx_v_index) {
  double __pyx_v_hue;
  double __pyx_v_R;
  double __pyx_v_G;
  double __pyx_v_B;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  double __pyx_t_9;
  double __pyx_t_10;
  double __pyx_t_11;
  __Pyx_RefNannySetupContext("__call__", 0);

  /* "CyOpenGL.pyx":499
 *     def __call__(self, index):
 *         cdef double hue, R, G, B
 *         hue = (self.base_hue[index%6] + self.index_to_hue(index//6)) / 6.0             # <<<<<<<<<<<<<<
 *         R, G, B = self.hls_to_rgb(hue, self.lightness, self.saturation)
 *         return [R, G, B, self.alpha]
 */
  __pyx_t_1 = __Pyx_PyInt_RemainderObjC(__pyx_v_index, __pyx_int_6, 6, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_FloorDivideObjC(__pyx_v_index, __pyx_int_6, 6, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_hue = (((__pyx_v_self->base_hue[__pyx_t_2]) + ((struct __pyx_vtabstruct_8CyOpenGL_Colorizer *)__pyx_v_self->__pyx_vtab)->index_to_hue(__pyx_v_self, __pyx_t_3)) / 6.0);

  /* "CyOpenGL.pyx":500
 *         cdef double hue, R, G, B
 *         hue = (self.base_hue[index%6] + self.index_to_hue(index//6)) / 6.0
 *         R, G, B = self.hls_to_rgb(hue, self.lightness, self.saturation)             # <<<<<<<<<<<<<<
 *         return [R, G, B, self.alpha]
 * 
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_Colorizer *)__pyx_v_self->__pyx_vtab)->hls_to_rgb(__pyx_v_self, __pyx_v_hue, __pyx_v_self->lightness, __pyx_v_self->saturation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 3)) {
      if (size > 3) __Pyx_RaiseTooManyValuesError(3);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 500, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
    } else {
      __pyx_t_4 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_5 = PyList_GET_ITEM(sequence, 1); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
    }
    __Pyx_INCREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 500, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_4 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_4)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_4);
    index = 1; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 2; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 3) < 0) __PYX_ERR(0, 500, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 500, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_R = __pyx_t_9;
  __pyx_v_G = __pyx_t_10;
  __pyx_v_B = __pyx_t_11;

  /* "CyOpenGL.pyx":501
 *         hue = (self.base_hue[index%6] + self.index_to_hue(index//6)) / 6.0
 *         R, G, B = self.hls_to_rgb(hue, self.lightness, self.saturation)
 *         return [R, G, B, self.alpha]             # <<<<<<<<<<<<<<
 * 
 *     cdef double index_to_hue(self, int index):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_R); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_G); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_B); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->alpha); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_7 = PyList_New(4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_6);
  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_6 = 0;
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":497
 *         self.alpha = alpha
 * 
 *     def __call__(self, index):             # <<<<<<<<<<<<<<
 *         cdef double hue, R, G, B
 *         hue = (self.base_hue[index%6] + self.index_to_hue(index//6)) / 6.0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__call__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":503
 *         return [R, G, B, self.alpha]
 * 
 *     cdef double index_to_hue(self, int index):             # <<<<<<<<<<<<<<
 *         cdef unsigned int num=0, den=1
 *         while index:
 */

static double __pyx_f_8CyOpenGL_9Colorizer_index_to_hue(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, int __pyx_v_index) {
  unsigned int __pyx_v_num;
  unsigned int __pyx_v_den;
  double __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("index_to_hue", 0);

  /* "CyOpenGL.pyx":504
 * 
 *     cdef double index_to_hue(self, int index):
 *         cdef unsigned int num=0, den=1             # <<<<<<<<<<<<<<
 *         while index:
 *             num = num<<1
 */
  __pyx_v_num = 0;
  __pyx_v_den = 1;

  /* "CyOpenGL.pyx":505
 *     cdef double index_to_hue(self, int index):
 *         cdef unsigned int num=0, den=1
 *         while index:             # <<<<<<<<<<<<<<
 *             num = num<<1
 *             den = den<<1
 */
  while (1) {
    __pyx_t_1 = (__pyx_v_index != 0);
    if (!__pyx_t_1) break;

    /* "CyOpenGL.pyx":506
 *         cdef unsigned int num=0, den=1
 *         while index:
 *             num = num<<1             # <<<<<<<<<<<<<<
 *             den = den<<1
 *             if index & 0x1:
 */
    __pyx_v_num = (__pyx_v_num << 1);

    /* "CyOpenGL.pyx":507
 *         while index:
 *             num = num<<1
 *             den = den<<1             # <<<<<<<<<<<<<<
 *             if index & 0x1:
 *                 num += 1
 */
    __pyx_v_den = (__pyx_v_den << 1);

    /* "CyOpenGL.pyx":508
 *             num = num<<1
 *             den = den<<1
 *             if index & 0x1:             # <<<<<<<<<<<<<<
 *                 num += 1
 *             index = index>>1
 */
    __pyx_t_1 = ((__pyx_v_index & 0x1) != 0);
    if (__pyx_t_1) {

      /* "CyOpenGL.pyx":509
 *             den = den<<1
 *             if index & 0x1:
 *                 num += 1             # <<<<<<<<<<<<<<
 *             index = index>>1
 *         return <double>num/<double>den
 */
      __pyx_v_num = (__pyx_v_num + 1);

      /* "CyOpenGL.pyx":508
 *             num = num<<1
 *             den = den<<1
 *             if index & 0x1:             # <<<<<<<<<<<<<<
 *                 num += 1
 *             index = index>>1
 */
    }

    /* "CyOpenGL.pyx":510
 *             if index & 0x1:
 *                 num += 1
 *             index = index>>1             # <<<<<<<<<<<<<<
 *         return <double>num/<double>den
 * 
 */
    __pyx_v_index = (__pyx_v_index >> 1);
  }

  /* "CyOpenGL.pyx":511
 *                 num += 1
 *             index = index>>1
 *         return <double>num/<double>den             # <<<<<<<<<<<<<<
 * 
 *     cdef hls_to_rgb(self, double h, double l, double s):
 */
  if (unlikely(((double)__pyx_v_den) == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 511, __pyx_L1_error)
  }
  __pyx_r = (((double)__pyx_v_num) / ((double)__pyx_v_den));
  goto __pyx_L0;

  /* "CyOpenGL.pyx":503
 *         return [R, G, B, self.alpha]
 * 
 *     cdef double index_to_hue(self, int index):             # <<<<<<<<<<<<<<
 *         cdef unsigned int num=0, den=1
 *         while index:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("CyOpenGL.Colorizer.index_to_hue", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":513
 *         return <double>num/<double>den
 * 
 *     cdef hls_to_rgb(self, double h, double l, double s):             # <<<<<<<<<<<<<<
 *         if s == 0.0:
 *             return l, l, l
 */

static PyObject *__pyx_f_8CyOpenGL_9Colorizer_hls_to_rgb(struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, double __pyx_v_h, double __pyx_v_l, double __pyx_v_s) {
  double __pyx_v_m2;
  double __pyx_v_m1;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("hls_to_rgb", 0);

  /* "CyOpenGL.pyx":514
 * 
 *     cdef hls_to_rgb(self, double h, double l, double s):
 *         if s == 0.0:             # <<<<<<<<<<<<<<
 *             return l, l, l
 *         if l <= 0.5:
 */
  __pyx_t_1 = ((__pyx_v_s == 0.0) != 0);
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":515
 *     cdef hls_to_rgb(self, double h, double l, double s):
 *         if s == 0.0:
 *             return l, l, l             # <<<<<<<<<<<<<<
 *         if l <= 0.5:
 *             m2 = l * (1.0+s)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_l); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 515, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "CyOpenGL.pyx":514
 * 
 *     cdef hls_to_rgb(self, double h, double l, double s):
 *         if s == 0.0:             # <<<<<<<<<<<<<<
 *             return l, l, l
 *         if l <= 0.5:
 */
  }

  /* "CyOpenGL.pyx":516
 *         if s == 0.0:
 *             return l, l, l
 *         if l <= 0.5:             # <<<<<<<<<<<<<<
 *             m2 = l * (1.0+s)
 *         else:
 */
  __pyx_t_1 = ((__pyx_v_l <= 0.5) != 0);
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":517
 *             return l, l, l
 *         if l <= 0.5:
 *             m2 = l * (1.0+s)             # <<<<<<<<<<<<<<
 *         else:
 *             m2 = l+s-(l*s)
 */
    __pyx_v_m2 = (__pyx_v_l * (1.0 + __pyx_v_s));

    /* "CyOpenGL.pyx":516
 *         if s == 0.0:
 *             return l, l, l
 *         if l <= 0.5:             # <<<<<<<<<<<<<<
 *             m2 = l * (1.0+s)
 *         else:
 */
    goto __pyx_L4;
  }

  /* "CyOpenGL.pyx":519
 *             m2 = l * (1.0+s)
 *         else:
 *             m2 = l+s-(l*s)             # <<<<<<<<<<<<<<
 *         m1 = 2.0*l - m2
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),
 */
  /*else*/ {
    __pyx_v_m2 = ((__pyx_v_l + __pyx_v_s) - (__pyx_v_l * __pyx_v_s));
  }
  __pyx_L4:;

  /* "CyOpenGL.pyx":520
 *         else:
 *             m2 = l+s-(l*s)
 *         m1 = 2.0*l - m2             # <<<<<<<<<<<<<<
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),
 *                 self.hls_interp(m1, m2, h),
 */
  __pyx_v_m1 = ((2.0 * __pyx_v_l) - __pyx_v_m2);

  /* "CyOpenGL.pyx":521
 *             m2 = l+s-(l*s)
 *         m1 = 2.0*l - m2
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),             # <<<<<<<<<<<<<<
 *                 self.hls_interp(m1, m2, h),
 *                 self.hls_interp(m1, m2, h-1.0/3.0))
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_5 = ((struct __pyx_vtabstruct_8CyOpenGL_Colorizer *)__pyx_v_self->__pyx_vtab)->hls_interp(__pyx_v_self, __pyx_v_m1, __pyx_v_m2, (__pyx_v_h + (1.0 / 3.0))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "CyOpenGL.pyx":522
 *         m1 = 2.0*l - m2
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),
 *                 self.hls_interp(m1, m2, h),             # <<<<<<<<<<<<<<
 *                 self.hls_interp(m1, m2, h-1.0/3.0))
 * 
 */
  __pyx_t_4 = ((struct __pyx_vtabstruct_8CyOpenGL_Colorizer *)__pyx_v_self->__pyx_vtab)->hls_interp(__pyx_v_self, __pyx_v_m1, __pyx_v_m2, __pyx_v_h); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "CyOpenGL.pyx":523
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),
 *                 self.hls_interp(m1, m2, h),
 *                 self.hls_interp(m1, m2, h-1.0/3.0))             # <<<<<<<<<<<<<<
 * 
 *     cdef hls_interp(self, double m1, double m2, double hue):
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_8CyOpenGL_Colorizer *)__pyx_v_self->__pyx_vtab)->hls_interp(__pyx_v_self, __pyx_v_m1, __pyx_v_m2, (__pyx_v_h - (1.0 / 3.0))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "CyOpenGL.pyx":521
 *             m2 = l+s-(l*s)
 *         m1 = 2.0*l - m2
 *         return (self.hls_interp(m1, m2, h+1.0/3.0),             # <<<<<<<<<<<<<<
 *                 self.hls_interp(m1, m2, h),
 *                 self.hls_interp(m1, m2, h-1.0/3.0))
 */
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 521, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_3);
  __pyx_t_5 = 0;
  __pyx_t_4 = 0;
  __pyx_t_3 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":513
 *         return <double>num/<double>den
 * 
 *     cdef hls_to_rgb(self, double h, double l, double s):             # <<<<<<<<<<<<<<
 *         if s == 0.0:
 *             return l, l, l
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.Colorizer.hls_to_rgb", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":525
 *                 self.hls_interp(m1, m2, h-1.0/3.0))
 * 
 *     cdef hls_interp(self, double m1, double m2, double hue):             # <<<<<<<<<<<<<<
 *         hue = hue % 1.0
 *         if hue < 1.0/6.0:
 */

static PyObject *__pyx_f_8CyOpenGL_9Colorizer_hls_interp(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, double __pyx_v_m1, double __pyx_v_m2, double __pyx_v_hue) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("hls_interp", 0);

  /* "CyOpenGL.pyx":526
 * 
 *     cdef hls_interp(self, double m1, double m2, double hue):
 *         hue = hue % 1.0             # <<<<<<<<<<<<<<
 *         if hue < 1.0/6.0:
 *             return m1 + (m2-m1)*hue*6.0
 */
  __pyx_v_hue = __Pyx_mod_double(__pyx_v_hue, 1.0);

  /* "CyOpenGL.pyx":527
 *     cdef hls_interp(self, double m1, double m2, double hue):
 *         hue = hue % 1.0
 *         if hue < 1.0/6.0:             # <<<<<<<<<<<<<<
 *             return m1 + (m2-m1)*hue*6.0
 *         if hue < 0.5:
 */
  __pyx_t_1 = ((__pyx_v_hue < (1.0 / 6.0)) != 0);
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":528
 *         hue = hue % 1.0
 *         if hue < 1.0/6.0:
 *             return m1 + (m2-m1)*hue*6.0             # <<<<<<<<<<<<<<
 *         if hue < 0.5:
 *             return m2
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble((__pyx_v_m1 + (((__pyx_v_m2 - __pyx_v_m1) * __pyx_v_hue) * 6.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 528, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "CyOpenGL.pyx":527
 *     cdef hls_interp(self, double m1, double m2, double hue):
 *         hue = hue % 1.0
 *         if hue < 1.0/6.0:             # <<<<<<<<<<<<<<
 *             return m1 + (m2-m1)*hue*6.0
 *         if hue < 0.5:
 */
  }

  /* "CyOpenGL.pyx":529
 *         if hue < 1.0/6.0:
 *             return m1 + (m2-m1)*hue*6.0
 *         if hue < 0.5:             # <<<<<<<<<<<<<<
 *             return m2
 *         if hue < 2.0/3.0:
 */
  __pyx_t_1 = ((__pyx_v_hue < 0.5) != 0);
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":530
 *             return m1 + (m2-m1)*hue*6.0
 *         if hue < 0.5:
 *             return m2             # <<<<<<<<<<<<<<
 *         if hue < 2.0/3.0:
 *             return m1 + (m2-m1)*(2.0/3.0-hue)*6.0
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "CyOpenGL.pyx":529
 *         if hue < 1.0/6.0:
 *             return m1 + (m2-m1)*hue*6.0
 *         if hue < 0.5:             # <<<<<<<<<<<<<<
 *             return m2
 *         if hue < 2.0/3.0:
 */
  }

  /* "CyOpenGL.pyx":531
 *         if hue < 0.5:
 *             return m2
 *         if hue < 2.0/3.0:             # <<<<<<<<<<<<<<
 *             return m1 + (m2-m1)*(2.0/3.0-hue)*6.0
 *         return m1
 */
  __pyx_t_1 = ((__pyx_v_hue < (2.0 / 3.0)) != 0);
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":532
 *             return m2
 *         if hue < 2.0/3.0:
 *             return m1 + (m2-m1)*(2.0/3.0-hue)*6.0             # <<<<<<<<<<<<<<
 *         return m1
 * 
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyFloat_FromDouble((__pyx_v_m1 + (((__pyx_v_m2 - __pyx_v_m1) * ((2.0 / 3.0) - __pyx_v_hue)) * 6.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 532, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;

    /* "CyOpenGL.pyx":531
 *         if hue < 0.5:
 *             return m2
 *         if hue < 2.0/3.0:             # <<<<<<<<<<<<<<
 *             return m1 + (m2-m1)*(2.0/3.0-hue)*6.0
 *         return m1
 */
  }

  /* "CyOpenGL.pyx":533
 *         if hue < 2.0/3.0:
 *             return m1 + (m2-m1)*(2.0/3.0-hue)*6.0
 *         return m1             # <<<<<<<<<<<<<<
 * 
 * GetColor = Colorizer()
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_m1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 533, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":525
 *                 self.hls_interp(m1, m2, h-1.0/3.0))
 * 
 *     cdef hls_interp(self, double m1, double m2, double hue):             # <<<<<<<<<<<<<<
 *         hue = hue % 1.0
 *         if hue < 1.0/6.0:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.Colorizer.hls_interp", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_9Colorizer_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_9Colorizer_6__reduce_cython__[] = "Colorizer.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_9Colorizer_7__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_9Colorizer_6__reduce_cython__(((struct __pyx_obj_8CyOpenGL_Colorizer *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_9Colorizer_6__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_9Colorizer_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_9Colorizer_8__setstate_cython__[] = "Colorizer.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_9Colorizer_9__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_9Colorizer_8__setstate_cython__(((struct __pyx_obj_8CyOpenGL_Colorizer *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_9Colorizer_8__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Colorizer *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.Colorizer.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":544
 *     cdef GLint stacks, slices
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  color=[0.8,0.0,0.0,0.3],
 *                  radius=1.0,
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_10Horosphere_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_10Horosphere_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_color = 0;
  PyObject *__pyx_v_radius = 0;
  CYTHON_UNUSED PyObject *__pyx_v_front_specular = 0;
  CYTHON_UNUSED PyObject *__pyx_v_back_specular = 0;
  CYTHON_UNUSED PyObject *__pyx_v_front_shininess = 0;
  CYTHON_UNUSED PyObject *__pyx_v_back_shininess = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_color,&__pyx_n_s_radius,&__pyx_n_s_front_specular,&__pyx_n_s_back_specular,&__pyx_n_s_front_shininess,&__pyx_n_s_back_shininess,0};
    PyObject* values[6] = {0,0,0,0,0,0};
    values[0] = __pyx_k__30;
    values[1] = ((PyObject *)__pyx_float_1_0);
    values[2] = __pyx_k__31;
    values[3] = __pyx_k__32;
    values[4] = ((PyObject *)__pyx_float_50_0);
    values[5] = ((PyObject *)__pyx_float_0_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_color);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_radius);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_front_specular);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_back_specular);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_front_shininess);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_back_shininess);
          if (value) { values[5] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 544, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_color = values[0];
    __pyx_v_radius = values[1];
    __pyx_v_front_specular = values[2];
    __pyx_v_back_specular = values[3];
    __pyx_v_front_shininess = values[4];
    __pyx_v_back_shininess = values[5];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 544, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.Horosphere.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_10Horosphere___init__(((struct __pyx_obj_8CyOpenGL_Horosphere *)__pyx_v_self), __pyx_v_color, __pyx_v_radius, __pyx_v_front_specular, __pyx_v_back_specular, __pyx_v_front_shininess, __pyx_v_back_shininess);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_10Horosphere___init__(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_color, PyObject *__pyx_v_radius, CYTHON_UNUSED PyObject *__pyx_v_front_specular, CYTHON_UNUSED PyObject *__pyx_v_back_specular, CYTHON_UNUSED PyObject *__pyx_v_front_shininess, CYTHON_UNUSED PyObject *__pyx_v_back_shininess) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  GLdouble __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  GLint __pyx_t_8;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":552
 *                  back_shininess = 0.0
 *                  ):
 *         self.radius = radius             # <<<<<<<<<<<<<<
 *         self.stacks = 2*max(2, int(8*radius))
 *         self.slices = max(20, int(60*radius))
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_radius); if (unlikely((__pyx_t_1 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 552, __pyx_L1_error)
  __pyx_v_self->radius = __pyx_t_1;

  /* "CyOpenGL.pyx":553
 *                  ):
 *         self.radius = radius
 *         self.stacks = 2*max(2, int(8*radius))             # <<<<<<<<<<<<<<
 *         self.slices = max(20, int(60*radius))
 *         self.build_vertices_and_normals()
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_int_8, __pyx_v_radius); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = 2;
  __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_7) {
    __Pyx_INCREF(__pyx_t_3);
    __pyx_t_2 = __pyx_t_3;
  } else {
    __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 553, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_2, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_GLint(__pyx_t_3); if (unlikely((__pyx_t_8 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->stacks = __pyx_t_8;

  /* "CyOpenGL.pyx":554
 *         self.radius = radius
 *         self.stacks = 2*max(2, int(8*radius))
 *         self.slices = max(20, int(60*radius))             # <<<<<<<<<<<<<<
 *         self.build_vertices_and_normals()
 *         self.build_triangles()
 */
  __pyx_t_3 = PyNumber_Multiply(__pyx_int_60, __pyx_v_radius); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyNumber_Int(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = 20;
  __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_t_6, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_7) {
    __Pyx_INCREF(__pyx_t_2);
    __pyx_t_3 = __pyx_t_2;
  } else {
    __pyx_t_5 = __Pyx_PyInt_From_long(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 554, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_t_5;
    __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_GLint(__pyx_t_3); if (unlikely((__pyx_t_8 == ((GLint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->slices = __pyx_t_8;

  /* "CyOpenGL.pyx":555
 *         self.stacks = 2*max(2, int(8*radius))
 *         self.slices = max(20, int(60*radius))
 *         self.build_vertices_and_normals()             # <<<<<<<<<<<<<<
 *         self.build_triangles()
 *         self.build_arrays()
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_8CyOpenGL_Horosphere *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->build_vertices_and_normals(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 555, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":556
 *         self.slices = max(20, int(60*radius))
 *         self.build_vertices_and_normals()
 *         self.build_triangles()             # <<<<<<<<<<<<<<
 *         self.build_arrays()
 * 
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_8CyOpenGL_Horosphere *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->build_triangles(__pyx_v_self); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":557
 *         self.build_vertices_and_normals()
 *         self.build_triangles()
 *         self.build_arrays()             # <<<<<<<<<<<<<<
 * 
 *     cdef build_vertices_and_normals(self):
 */
  __pyx_t_3 = ((struct __pyx_vtabstruct_8CyOpenGL_Horosphere *)__pyx_v_self->__pyx_base.__pyx_base.__pyx_vtab)->__pyx_base.build_arrays(((struct __pyx_obj_8CyOpenGL_MeshedSurface *)__pyx_v_self)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":544
 *     cdef GLint stacks, slices
 * 
 *     def __init__(self,             # <<<<<<<<<<<<<<
 *                  color=[0.8,0.0,0.0,0.3],
 *                  radius=1.0,
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.Horosphere.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":559
 *         self.build_arrays()
 * 
 *     cdef build_vertices_and_normals(self):             # <<<<<<<<<<<<<<
 *         a, b = self.stacks, self.slices
 *         dtheta = 2*pi/b
 */

static PyObject *__pyx_f_8CyOpenGL_10Horosphere_build_vertices_and_normals(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self) {
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_v_dtheta = NULL;
  PyObject *__pyx_v_dphi = NULL;
  PyObject *__pyx_v_verts = NULL;
  PyObject *__pyx_v_phi = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_r = NULL;
  PyObject *__pyx_v_z = NULL;
  PyObject *__pyx_v_theta = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_N = NULL;
  PyObject *__pyx_v_V = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  __Pyx_RefNannySetupContext("build_vertices_and_normals", 0);

  /* "CyOpenGL.pyx":560
 * 
 *     cdef build_vertices_and_normals(self):
 *         a, b = self.stacks, self.slices             # <<<<<<<<<<<<<<
 *         dtheta = 2*pi/b
 *         dphi = pi/a
 */
  __pyx_t_1 = __Pyx_PyInt_From_GLint(__pyx_v_self->stacks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_GLint(__pyx_v_self->slices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_a = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_b = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":561
 *     cdef build_vertices_and_normals(self):
 *         a, b = self.stacks, self.slices
 *         dtheta = 2*pi/b             # <<<<<<<<<<<<<<
 *         dphi = pi/a
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_int_2, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_dtheta = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":562
 *         a, b = self.stacks, self.slices
 *         dtheta = 2*pi/b
 *         dphi = pi/a             # <<<<<<<<<<<<<<
 * 
 *         verts = []
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_v_a); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_dphi = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":564
 *         dphi = pi/a
 * 
 *         verts = []             # <<<<<<<<<<<<<<
 *         phi = 0
 *         for j in range(a - 1):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_verts = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":565
 * 
 *         verts = []
 *         phi = 0             # <<<<<<<<<<<<<<
 *         for j in range(a - 1):
 *             phi += dphi
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_phi = __pyx_int_0;

  /* "CyOpenGL.pyx":566
 *         verts = []
 *         phi = 0
 *         for j in range(a - 1):             # <<<<<<<<<<<<<<
 *             phi += dphi
 *             r, z = sin(phi), cos(phi)
 */
  __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_a, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_1 = __pyx_t_2; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 566, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 566, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 566, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 566, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 566, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 566, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":567
 *         phi = 0
 *         for j in range(a - 1):
 *             phi += dphi             # <<<<<<<<<<<<<<
 *             r, z = sin(phi), cos(phi)
 *             theta = 0
 */
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_phi, __pyx_v_dphi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF_SET(__pyx_v_phi, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":568
 *         for j in range(a - 1):
 *             phi += dphi
 *             r, z = sin(phi), cos(phi)             # <<<<<<<<<<<<<<
 *             theta = 0
 *             for i in range(0, b):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_phi) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_phi);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_cos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_phi) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_phi);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 568, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_r, __pyx_t_2);
    __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_z, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":569
 *             phi += dphi
 *             r, z = sin(phi), cos(phi)
 *             theta = 0             # <<<<<<<<<<<<<<
 *             for i in range(0, b):
 *                 verts.append((r*cos(theta), r*sin(theta), z))
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF_SET(__pyx_v_theta, __pyx_int_0);

    /* "CyOpenGL.pyx":570
 *             r, z = sin(phi), cos(phi)
 *             theta = 0
 *             for i in range(0, b):             # <<<<<<<<<<<<<<
 *                 verts.append((r*cos(theta), r*sin(theta), z))
 *                 theta += dtheta
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_GIVEREF(__pyx_int_0);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
    __Pyx_INCREF(__pyx_v_b);
    __Pyx_GIVEREF(__pyx_v_b);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_b);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
      __pyx_t_5 = __pyx_t_2; __Pyx_INCREF(__pyx_t_5); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 570, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_9 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 570, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 570, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_2); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 570, __pyx_L1_error)
          #else
          __pyx_t_2 = PySequence_ITEM(__pyx_t_5, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 570, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_2);
          #endif
        }
      } else {
        __pyx_t_2 = __pyx_t_9(__pyx_t_5);
        if (unlikely(!__pyx_t_2)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 570, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_2);
      }
      __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "CyOpenGL.pyx":571
 *             theta = 0
 *             for i in range(0, b):
 *                 verts.append((r*cos(theta), r*sin(theta), z))             # <<<<<<<<<<<<<<
 *                 theta += dtheta
 *         verts += [(0, 0, 1), (0, 0, -1)]
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_cos); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
        }
      }
      __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_theta) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_theta);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyNumber_Multiply(__pyx_v_r, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_sin); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_10)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_10);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_2 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_10, __pyx_v_theta) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_theta);
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Multiply(__pyx_v_r, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
      __Pyx_INCREF(__pyx_v_z);
      __Pyx_GIVEREF(__pyx_v_z);
      PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_z);
      __pyx_t_6 = 0;
      __pyx_t_7 = 0;
      __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_verts, __pyx_t_2); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 571, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "CyOpenGL.pyx":572
 *             for i in range(0, b):
 *                 verts.append((r*cos(theta), r*sin(theta), z))
 *                 theta += dtheta             # <<<<<<<<<<<<<<
 *         verts += [(0, 0, 1), (0, 0, -1)]
 *         assert len(verts) == a*b - b + 2
 */
      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_theta, __pyx_v_dtheta); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF_SET(__pyx_v_theta, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "CyOpenGL.pyx":570
 *             r, z = sin(phi), cos(phi)
 *             theta = 0
 *             for i in range(0, b):             # <<<<<<<<<<<<<<
 *                 verts.append((r*cos(theta), r*sin(theta), z))
 *                 theta += dtheta
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":566
 *         verts = []
 *         phi = 0
 *         for j in range(a - 1):             # <<<<<<<<<<<<<<
 *             phi += dphi
 *             r, z = sin(phi), cos(phi)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":573
 *                 verts.append((r*cos(theta), r*sin(theta), z))
 *                 theta += dtheta
 *         verts += [(0, 0, 1), (0, 0, -1)]             # <<<<<<<<<<<<<<
 *         assert len(verts) == a*b - b + 2
 * 
 */
  __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_tuple__33);
  __Pyx_INCREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_tuple__34);
  __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_v_verts, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_verts, ((PyObject*)__pyx_t_5));
  __pyx_t_5 = 0;

  /* "CyOpenGL.pyx":574
 *                 theta += dtheta
 *         verts += [(0, 0, 1), (0, 0, -1)]
 *         assert len(verts) == a*b - b + 2             # <<<<<<<<<<<<<<
 * 
 *         self.vertices, self.normals = [], []
 */
  #ifndef CYTHON_WITHOUT_ASSERTIONS
  if (unlikely(!Py_OptimizeFlag)) {
    __pyx_t_3 = PyList_GET_SIZE(__pyx_v_verts); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 574, __pyx_L1_error)
    __pyx_t_5 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyNumber_Subtract(__pyx_t_1, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_12 < 0)) __PYX_ERR(0, 574, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_12)) {
      PyErr_SetNone(PyExc_AssertionError);
      __PYX_ERR(0, 574, __pyx_L1_error)
    }
  }
  #endif

  /* "CyOpenGL.pyx":576
 *         assert len(verts) == a*b - b + 2
 * 
 *         self.vertices, self.normals = [], []             # <<<<<<<<<<<<<<
 *         for x, y, z in verts:
 *             N = vector3((x, y, z))
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 576, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.vertices);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.vertices);
  __pyx_v_self->__pyx_base.vertices = __pyx_t_2;
  __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.normals);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.normals);
  __pyx_v_self->__pyx_base.normals = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":577
 * 
 *         self.vertices, self.normals = [], []
 *         for x, y, z in verts:             # <<<<<<<<<<<<<<
 *             N = vector3((x, y, z))
 *             V = N*self.radius
 */
  __pyx_t_1 = __pyx_v_verts; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
  for (;;) {
    if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 577, __pyx_L1_error)
    #else
    __pyx_t_2 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    #endif
    if ((likely(PyTuple_CheckExact(__pyx_t_2))) || (PyList_CheckExact(__pyx_t_2))) {
      PyObject* sequence = __pyx_t_2;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 3)) {
        if (size > 3) __Pyx_RaiseTooManyValuesError(3);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 577, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 2); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 2); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_6 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_10 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 577, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_13 = Py_TYPE(__pyx_t_10)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_5)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_7 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_7)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      index = 2; __pyx_t_6 = __pyx_t_13(__pyx_t_10); if (unlikely(!__pyx_t_6)) goto __pyx_L9_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_13(__pyx_t_10), 3) < 0) __PYX_ERR(0, 577, __pyx_L1_error)
      __pyx_t_13 = NULL;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L10_unpacking_done;
      __pyx_L9_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_13 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 577, __pyx_L1_error)
      __pyx_L10_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_z, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":578
 *         self.vertices, self.normals = [], []
 *         for x, y, z in verts:
 *             N = vector3((x, y, z))             # <<<<<<<<<<<<<<
 *             V = N*self.radius
 *             self.vertices.append(V)
 */
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_x);
    __Pyx_GIVEREF(__pyx_v_x);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_x);
    __Pyx_INCREF(__pyx_v_y);
    __Pyx_GIVEREF(__pyx_v_y);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_y);
    __Pyx_INCREF(__pyx_v_z);
    __Pyx_GIVEREF(__pyx_v_z);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_z);
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8CyOpenGL_vector3), __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 578, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF_SET(__pyx_v_N, ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":579
 *         for x, y, z in verts:
 *             N = vector3((x, y, z))
 *             V = N*self.radius             # <<<<<<<<<<<<<<
 *             self.vertices.append(V)
 *             self.normals.append(N)
 */
    __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->radius); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyNumber_Multiply(((PyObject *)__pyx_v_N), __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 579, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_V, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":580
 *             N = vector3((x, y, z))
 *             V = N*self.radius
 *             self.vertices.append(V)             # <<<<<<<<<<<<<<
 *             self.normals.append(N)
 * 
 */
    __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_self->__pyx_base.vertices, __pyx_v_V); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 580, __pyx_L1_error)

    /* "CyOpenGL.pyx":581
 *             V = N*self.radius
 *             self.vertices.append(V)
 *             self.normals.append(N)             # <<<<<<<<<<<<<<
 * 
 *     cdef build_triangles(self):
 */
    __pyx_t_11 = __Pyx_PyObject_Append(__pyx_v_self->__pyx_base.normals, ((PyObject *)__pyx_v_N)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 581, __pyx_L1_error)

    /* "CyOpenGL.pyx":577
 * 
 *         self.vertices, self.normals = [], []
 *         for x, y, z in verts:             # <<<<<<<<<<<<<<
 *             N = vector3((x, y, z))
 *             V = N*self.radius
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":559
 *         self.build_arrays()
 * 
 *     cdef build_vertices_and_normals(self):             # <<<<<<<<<<<<<<
 *         a, b = self.stacks, self.slices
 *         dtheta = 2*pi/b
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("CyOpenGL.Horosphere.build_vertices_and_normals", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XDECREF(__pyx_v_dtheta);
  __Pyx_XDECREF(__pyx_v_dphi);
  __Pyx_XDECREF(__pyx_v_verts);
  __Pyx_XDECREF(__pyx_v_phi);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_r);
  __Pyx_XDECREF(__pyx_v_z);
  __Pyx_XDECREF(__pyx_v_theta);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF((PyObject *)__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_V);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":583
 *             self.normals.append(N)
 * 
 *     cdef build_triangles(self):             # <<<<<<<<<<<<<<
 *         self.triangles = tri = []
 *         a, b = self.stacks, self.slices
 */

static PyObject *__pyx_f_8CyOpenGL_10Horosphere_build_triangles(struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self) {
  PyObject *__pyx_v_tri = NULL;
  PyObject *__pyx_v_a = NULL;
  PyObject *__pyx_v_b = NULL;
  PyObject *__pyx_v_north = NULL;
  PyObject *__pyx_v_south = NULL;
  PyObject *__pyx_v_shift = NULL;
  PyObject *__pyx_v_annulus = NULL;
  PyObject *__pyx_v_v0 = NULL;
  PyObject *__pyx_v_w0 = NULL;
  PyObject *__pyx_v_v1 = NULL;
  PyObject *__pyx_v_w1 = NULL;
  PyObject *__pyx_v_s = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_u = NULL;
  PyObject *__pyx_v_v = NULL;
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *(*__pyx_t_12)(PyObject *);
  __Pyx_RefNannySetupContext("build_triangles", 0);

  /* "CyOpenGL.pyx":584
 * 
 *     cdef build_triangles(self):
 *         self.triangles = tri = []             # <<<<<<<<<<<<<<
 *         a, b = self.stacks, self.slices
 * 
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 584, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.triangles);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.triangles);
  __pyx_v_self->__pyx_base.triangles = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_tri = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":585
 *     cdef build_triangles(self):
 *         self.triangles = tri = []
 *         a, b = self.stacks, self.slices             # <<<<<<<<<<<<<<
 * 
 *         # Start with the two polar caps
 */
  __pyx_t_1 = __Pyx_PyInt_From_GLint(__pyx_v_self->stacks); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_GLint(__pyx_v_self->slices); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 585, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_a = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_b = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":588
 * 
 *         # Start with the two polar caps
 *         north = a*b - b             # <<<<<<<<<<<<<<
 *         south = north + 1
 *         tri += [(north, i, (i + 1) % b) for i in range(b)]
 */
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_a, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_north = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":589
 *         # Start with the two polar caps
 *         north = a*b - b
 *         south = north + 1             # <<<<<<<<<<<<<<
 *         tri += [(north, i, (i + 1) % b) for i in range(b)]
 *         shift = north - b
 */
  __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_north, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 589, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_south = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":590
 *         north = a*b - b
 *         south = north + 1
 *         tri += [(north, i, (i + 1) % b) for i in range(b)]             # <<<<<<<<<<<<<<
 *         shift = north - b
 *         tri += [(south, shift + (i + 1) % b, shift + i) for i in range(b)]
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_b); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
    __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 590, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_4); __Pyx_INCREF(__pyx_t_2); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 590, __pyx_L1_error)
        #else
        __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        #endif
      }
    } else {
      __pyx_t_2 = __pyx_t_5(__pyx_t_3);
      if (unlikely(!__pyx_t_2)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 590, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PyNumber_Remainder(__pyx_t_2, __pyx_v_b); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v_north);
    __Pyx_GIVEREF(__pyx_v_north);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_north);
    __Pyx_INCREF(__pyx_v_i);
    __Pyx_GIVEREF(__pyx_v_i);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_i);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6);
    __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 590, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_tri, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 590, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF_SET(__pyx_v_tri, ((PyObject*)__pyx_t_3));
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":591
 *         south = north + 1
 *         tri += [(north, i, (i + 1) % b) for i in range(b)]
 *         shift = north - b             # <<<<<<<<<<<<<<
 *         tri += [(south, shift + (i + 1) % b, shift + i) for i in range(b)]
 * 
 */
  __pyx_t_3 = PyNumber_Subtract(__pyx_v_north, __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v_shift = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":592
 *         tri += [(north, i, (i + 1) % b) for i in range(b)]
 *         shift = north - b
 *         tri += [(south, shift + (i + 1) % b, shift + i) for i in range(b)]             # <<<<<<<<<<<<<<
 * 
 *         # Now build the rest with annular bands
 */
  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_v_b); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 592, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 592, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 592, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 592, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = PyNumber_Remainder(__pyx_t_1, __pyx_v_b); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyNumber_Add(__pyx_v_shift, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_Add(__pyx_v_shift, __pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 592, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_south);
    __Pyx_GIVEREF(__pyx_v_south);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_south);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_t_6);
    __pyx_t_1 = 0;
    __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 592, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_tri, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 592, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_tri, ((PyObject*)__pyx_t_2));
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":595
 * 
 *         # Now build the rest with annular bands
 *         annulus = []             # <<<<<<<<<<<<<<
 *         for v0 in range(0, b):
 *             w0 = (v0 + 1) % b
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 595, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_annulus = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":596
 *         # Now build the rest with annular bands
 *         annulus = []
 *         for v0 in range(0, b):             # <<<<<<<<<<<<<<
 *             w0 = (v0 + 1) % b
 *             v1, w1 = v0 + b, w0 + b
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __Pyx_INCREF(__pyx_v_b);
  __Pyx_GIVEREF(__pyx_v_b);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_b);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 596, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 596, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 596, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 596, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 596, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 596, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_v0, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":597
 *         annulus = []
 *         for v0 in range(0, b):
 *             w0 = (v0 + 1) % b             # <<<<<<<<<<<<<<
 *             v1, w1 = v0 + b, w0 + b
 *             annulus += [(v0, v1, w1), (w0, v0, w1)]
 */
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_v0, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = PyNumber_Remainder(__pyx_t_3, __pyx_v_b); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 597, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF_SET(__pyx_v_w0, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "CyOpenGL.pyx":598
 *         for v0 in range(0, b):
 *             w0 = (v0 + 1) % b
 *             v1, w1 = v0 + b, w0 + b             # <<<<<<<<<<<<<<
 *             annulus += [(v0, v1, w1), (w0, v0, w1)]
 * 
 */
    __pyx_t_7 = PyNumber_Add(__pyx_v_v0, __pyx_v_b); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_3 = PyNumber_Add(__pyx_v_w0, __pyx_v_b); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 598, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_XDECREF_SET(__pyx_v_v1, __pyx_t_7);
    __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_w1, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":599
 *             w0 = (v0 + 1) % b
 *             v1, w1 = v0 + b, w0 + b
 *             annulus += [(v0, v1, w1), (w0, v0, w1)]             # <<<<<<<<<<<<<<
 * 
 *         for s in range(0, b*(a - 2), b):
 */
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v_v0);
    __Pyx_GIVEREF(__pyx_v_v0);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_v0);
    __Pyx_INCREF(__pyx_v_v1);
    __Pyx_GIVEREF(__pyx_v_v1);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_v1);
    __Pyx_INCREF(__pyx_v_w1);
    __Pyx_GIVEREF(__pyx_v_w1);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_w1);
    __pyx_t_7 = PyTuple_New(3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_INCREF(__pyx_v_w0);
    __Pyx_GIVEREF(__pyx_v_w0);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_w0);
    __Pyx_INCREF(__pyx_v_v0);
    __Pyx_GIVEREF(__pyx_v_v0);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_v0);
    __Pyx_INCREF(__pyx_v_w1);
    __Pyx_GIVEREF(__pyx_v_w1);
    PyTuple_SET_ITEM(__pyx_t_7, 2, __pyx_v_w1);
    __pyx_t_6 = PyList_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_3);
    PyList_SET_ITEM(__pyx_t_6, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_7);
    PyList_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
    __pyx_t_3 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_annulus, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 599, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_DECREF_SET(__pyx_v_annulus, ((PyObject*)__pyx_t_7));
    __pyx_t_7 = 0;

    /* "CyOpenGL.pyx":596
 *         # Now build the rest with annular bands
 *         annulus = []
 *         for v0 in range(0, b):             # <<<<<<<<<<<<<<
 *             w0 = (v0 + 1) % b
 *             v1, w1 = v0 + b, w0 + b
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":601
 *             annulus += [(v0, v1, w1), (w0, v0, w1)]
 * 
 *         for s in range(0, b*(a - 2), b):             # <<<<<<<<<<<<<<
 *             tri += [(u + s, v + s, w + s) for u, v, w in annulus]
 * 
 */
  __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_a, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_7 = PyNumber_Multiply(__pyx_v_b, __pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_int_0);
  __Pyx_GIVEREF(__pyx_int_0);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_int_0);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_7);
  __Pyx_INCREF(__pyx_v_b);
  __Pyx_GIVEREF(__pyx_v_b);
  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_b);
  __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_2, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 601, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 601, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 601, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_7); __pyx_t_4++; if (unlikely(0 < 0)) __PYX_ERR(0, 601, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 601, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_5(__pyx_t_2);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 601, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_s, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "CyOpenGL.pyx":602
 * 
 *         for s in range(0, b*(a - 2), b):
 *             tri += [(u + s, v + s, w + s) for u, v, w in annulus]             # <<<<<<<<<<<<<<
 * 
 * 
 */
    __pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __pyx_v_annulus; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
    for (;;) {
      if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 602, __pyx_L1_error)
      #else
      __pyx_t_3 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      #endif
      if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
        PyObject* sequence = __pyx_t_3;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 3)) {
          if (size > 3) __Pyx_RaiseTooManyValuesError(3);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 602, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_1 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyTuple_GET_ITEM(sequence, 1); 
          __pyx_t_10 = PyTuple_GET_ITEM(sequence, 2); 
        } else {
          __pyx_t_1 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_9 = PyList_GET_ITEM(sequence, 1); 
          __pyx_t_10 = PyList_GET_ITEM(sequence, 2); 
        }
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(__pyx_t_10);
        #else
        __pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_10 = PySequence_ITEM(sequence, 2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 602, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_11 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 602, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_12 = Py_TYPE(__pyx_t_11)->tp_iternext;
        index = 0; __pyx_t_1 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_1)) goto __pyx_L13_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_1);
        index = 1; __pyx_t_9 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_9)) goto __pyx_L13_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_9);
        index = 2; __pyx_t_10 = __pyx_t_12(__pyx_t_11); if (unlikely(!__pyx_t_10)) goto __pyx_L13_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_10);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_11), 3) < 0) __PYX_ERR(0, 602, __pyx_L1_error)
        __pyx_t_12 = NULL;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        goto __pyx_L14_unpacking_done;
        __pyx_L13_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_12 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 602, __pyx_L1_error)
        __pyx_L14_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_u, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_9);
      __pyx_t_9 = 0;
      __Pyx_XDECREF_SET(__pyx_v_w, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_t_3 = PyNumber_Add(__pyx_v_u, __pyx_v_s); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_10 = PyNumber_Add(__pyx_v_v, __pyx_v_s); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_9 = PyNumber_Add(__pyx_v_w, __pyx_v_s); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_3);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_10);
      PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_10);
      __Pyx_GIVEREF(__pyx_t_9);
      PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_9);
      __pyx_t_3 = 0;
      __pyx_t_10 = 0;
      __pyx_t_9 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_7, (PyObject*)__pyx_t_1))) __PYX_ERR(0, 602, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_tri, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF_SET(__pyx_v_tri, ((PyObject*)__pyx_t_6));
    __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":601
 *             annulus += [(v0, v1, w1), (w0, v0, w1)]
 * 
 *         for s in range(0, b*(a - 2), b):             # <<<<<<<<<<<<<<
 *             tri += [(u + s, v + s, w + s) for u, v, w in annulus]
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":583
 *             self.normals.append(N)
 * 
 *     cdef build_triangles(self):             # <<<<<<<<<<<<<<
 *         self.triangles = tri = []
 *         a, b = self.stacks, self.slices
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("CyOpenGL.Horosphere.build_triangles", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_tri);
  __Pyx_XDECREF(__pyx_v_a);
  __Pyx_XDECREF(__pyx_v_b);
  __Pyx_XDECREF(__pyx_v_north);
  __Pyx_XDECREF(__pyx_v_south);
  __Pyx_XDECREF(__pyx_v_shift);
  __Pyx_XDECREF(__pyx_v_annulus);
  __Pyx_XDECREF(__pyx_v_v0);
  __Pyx_XDECREF(__pyx_v_w0);
  __Pyx_XDECREF(__pyx_v_v1);
  __Pyx_XDECREF(__pyx_v_w1);
  __Pyx_XDECREF(__pyx_v_s);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_u);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_10Horosphere_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_10Horosphere_2__reduce_cython__[] = "Horosphere.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_10Horosphere_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_10Horosphere_2__reduce_cython__(((struct __pyx_obj_8CyOpenGL_Horosphere *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_10Horosphere_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.Horosphere.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_10Horosphere_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_10Horosphere_4__setstate_cython__[] = "Horosphere.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_10Horosphere_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_10Horosphere_4__setstate_cython__(((struct __pyx_obj_8CyOpenGL_Horosphere *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_10Horosphere_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Horosphere *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.Horosphere.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":620
 *     cdef original_indices
 * 
 *     def __init__(self, horoballs, indices, meridian, longitude):             # <<<<<<<<<<<<<<
 *         self.horoballs = horoballs
 *         self.meridian = complex(meridian)
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_13HoroballGroup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_13HoroballGroup_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_horoballs = 0;
  PyObject *__pyx_v_indices = 0;
  PyObject *__pyx_v_meridian = 0;
  PyObject *__pyx_v_longitude = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_horoballs,&__pyx_n_s_indices,&__pyx_n_s_meridian,&__pyx_n_s_longitude,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_horoballs)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_indices)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 1); __PYX_ERR(0, 620, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meridian)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 2); __PYX_ERR(0, 620, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_longitude)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, 3); __PYX_ERR(0, 620, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 620, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_horoballs = values[0];
    __pyx_v_indices = values[1];
    __pyx_v_meridian = values[2];
    __pyx_v_longitude = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 620, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballGroup___init__(((struct __pyx_obj_8CyOpenGL_HoroballGroup *)__pyx_v_self), __pyx_v_horoballs, __pyx_v_indices, __pyx_v_meridian, __pyx_v_longitude);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_13HoroballGroup___init__(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_horoballs, PyObject *__pyx_v_indices, PyObject *__pyx_v_meridian, PyObject *__pyx_v_longitude) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":621
 * 
 *     def __init__(self, horoballs, indices, meridian, longitude):
 *         self.horoballs = horoballs             # <<<<<<<<<<<<<<
 *         self.meridian = complex(meridian)
 *         self.longitude = complex(longitude)
 */
  __Pyx_INCREF(__pyx_v_horoballs);
  __Pyx_GIVEREF(__pyx_v_horoballs);
  __Pyx_GOTREF(__pyx_v_self->horoballs);
  __Pyx_DECREF(__pyx_v_self->horoballs);
  __pyx_v_self->horoballs = __pyx_v_horoballs;

  /* "CyOpenGL.pyx":622
 *     def __init__(self, horoballs, indices, meridian, longitude):
 *         self.horoballs = horoballs
 *         self.meridian = complex(meridian)             # <<<<<<<<<<<<<<
 *         self.longitude = complex(longitude)
 *         self.list_id_base = 0
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_v_meridian); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->meridian);
  __Pyx_DECREF(__pyx_v_self->meridian);
  __pyx_v_self->meridian = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":623
 *         self.horoballs = horoballs
 *         self.meridian = complex(meridian)
 *         self.longitude = complex(longitude)             # <<<<<<<<<<<<<<
 *         self.list_id_base = 0
 *         self.num_lists = 0
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_v_longitude); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 623, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->longitude);
  __Pyx_DECREF(__pyx_v_self->longitude);
  __pyx_v_self->longitude = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":624
 *         self.meridian = complex(meridian)
 *         self.longitude = complex(longitude)
 *         self.list_id_base = 0             # <<<<<<<<<<<<<<
 *         self.num_lists = 0
 *         self.original_indices = indices
 */
  __pyx_v_self->list_id_base = 0;

  /* "CyOpenGL.pyx":625
 *         self.longitude = complex(longitude)
 *         self.list_id_base = 0
 *         self.num_lists = 0             # <<<<<<<<<<<<<<
 *         self.original_indices = indices
 *         self.build_spheres()
 */
  __pyx_v_self->num_lists = 0;

  /* "CyOpenGL.pyx":626
 *         self.list_id_base = 0
 *         self.num_lists = 0
 *         self.original_indices = indices             # <<<<<<<<<<<<<<
 *         self.build_spheres()
 * 
 */
  __Pyx_INCREF(__pyx_v_indices);
  __Pyx_GIVEREF(__pyx_v_indices);
  __Pyx_GOTREF(__pyx_v_self->original_indices);
  __Pyx_DECREF(__pyx_v_self->original_indices);
  __pyx_v_self->original_indices = __pyx_v_indices;

  /* "CyOpenGL.pyx":627
 *         self.num_lists = 0
 *         self.original_indices = indices
 *         self.build_spheres()             # <<<<<<<<<<<<<<
 * 
 *     cdef get_list_ids(self, N):
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballGroup *)__pyx_v_self->__pyx_vtab)->build_spheres(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 627, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":620
 *     cdef original_indices
 * 
 *     def __init__(self, horoballs, indices, meridian, longitude):             # <<<<<<<<<<<<<<
 *         self.horoballs = horoballs
 *         self.meridian = complex(meridian)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":629
 *         self.build_spheres()
 * 
 *     cdef get_list_ids(self, N):             # <<<<<<<<<<<<<<
 *         self.delete_lists()
 *         self.list_id_base = glGenLists(N)
 */

static PyObject *__pyx_f_8CyOpenGL_13HoroballGroup_get_list_ids(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_N) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  GLsizei __pyx_t_4;
  GLuint __pyx_t_5;
  __Pyx_RefNannySetupContext("get_list_ids", 0);

  /* "CyOpenGL.pyx":630
 * 
 *     cdef get_list_ids(self, N):
 *         self.delete_lists()             # <<<<<<<<<<<<<<
 *         self.list_id_base = glGenLists(N)
 *         self.num_lists = N
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_delete_lists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":631
 *     cdef get_list_ids(self, N):
 *         self.delete_lists()
 *         self.list_id_base = glGenLists(N)             # <<<<<<<<<<<<<<
 *         self.num_lists = N
 * 
 */
  __pyx_t_4 = __Pyx_PyInt_As_GLsizei(__pyx_v_N); if (unlikely((__pyx_t_4 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(0, 631, __pyx_L1_error)
  __pyx_v_self->list_id_base = glGenLists(__pyx_t_4);

  /* "CyOpenGL.pyx":632
 *         self.delete_lists()
 *         self.list_id_base = glGenLists(N)
 *         self.num_lists = N             # <<<<<<<<<<<<<<
 * 
 *     def delete_lists(self):
 */
  __pyx_t_5 = __Pyx_PyInt_As_GLuint(__pyx_v_N); if (unlikely((__pyx_t_5 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 632, __pyx_L1_error)
  __pyx_v_self->num_lists = __pyx_t_5;

  /* "CyOpenGL.pyx":629
 *         self.build_spheres()
 * 
 *     cdef get_list_ids(self, N):             # <<<<<<<<<<<<<<
 *         self.delete_lists()
 *         self.list_id_base = glGenLists(N)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.get_list_ids", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":634
 *         self.num_lists = N
 * 
 *     def delete_lists(self):             # <<<<<<<<<<<<<<
 *         if self.list_id_base > 0:
 *             glDeleteLists(self.list_id_base, self.num_lists)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_3delete_lists(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballGroup_2delete_lists[] = "HoroballGroup.delete_lists(self)";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_3delete_lists(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("delete_lists (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballGroup_2delete_lists(((struct __pyx_obj_8CyOpenGL_HoroballGroup *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_2delete_lists(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  __Pyx_RefNannySetupContext("delete_lists", 0);

  /* "CyOpenGL.pyx":635
 * 
 *     def delete_lists(self):
 *         if self.list_id_base > 0:             # <<<<<<<<<<<<<<
 *             glDeleteLists(self.list_id_base, self.num_lists)
 * 
 */
  __pyx_t_1 = ((__pyx_v_self->list_id_base > 0) != 0);
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":636
 *     def delete_lists(self):
 *         if self.list_id_base > 0:
 *             glDeleteLists(self.list_id_base, self.num_lists)             # <<<<<<<<<<<<<<
 * 
 *     cdef build_spheres(self):
 */
    glDeleteLists(__pyx_v_self->list_id_base, __pyx_v_self->num_lists);

    /* "CyOpenGL.pyx":635
 * 
 *     def delete_lists(self):
 *         if self.list_id_base > 0:             # <<<<<<<<<<<<<<
 *             glDeleteLists(self.list_id_base, self.num_lists)
 * 
 */
  }

  /* "CyOpenGL.pyx":634
 *         self.num_lists = N
 * 
 *     def delete_lists(self):             # <<<<<<<<<<<<<<
 *         if self.list_id_base > 0:
 *             glDeleteLists(self.list_id_base, self.num_lists)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":638
 *             glDeleteLists(self.list_id_base, self.num_lists)
 * 
 *     cdef build_spheres(self):             # <<<<<<<<<<<<<<
 *         self.keys = keys = []
 *         self.spheres = spheres = {}
 */

static PyObject *__pyx_f_8CyOpenGL_13HoroballGroup_build_spheres(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self) {
  PyObject *__pyx_v_keys = NULL;
  PyObject *__pyx_v_spheres = NULL;
  PyObject *__pyx_v_centers = NULL;
  PyObject *__pyx_v_list_ids = NULL;
  PyObject *__pyx_v_D = NULL;
  PyObject *__pyx_v_z_center = NULL;
  PyObject *__pyx_v_radius = NULL;
  PyObject *__pyx_v_index = NULL;
  PyObject *__pyx_v_key = NULL;
  struct __pyx_obj_8CyOpenGL_vector3 *__pyx_v_center = NULL;
  PyObject *__pyx_v_color = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_t_11;
  int __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  __Pyx_RefNannySetupContext("build_spheres", 0);

  /* "CyOpenGL.pyx":639
 * 
 *     cdef build_spheres(self):
 *         self.keys = keys = []             # <<<<<<<<<<<<<<
 *         self.spheres = spheres = {}
 *         self.centers = centers = {}
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 639, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->keys);
  __Pyx_DECREF(__pyx_v_self->keys);
  __pyx_v_self->keys = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_keys = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":640
 *     cdef build_spheres(self):
 *         self.keys = keys = []
 *         self.spheres = spheres = {}             # <<<<<<<<<<<<<<
 *         self.centers = centers = {}
 *         self.list_ids = list_ids = {}
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 640, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->spheres);
  __Pyx_DECREF(__pyx_v_self->spheres);
  __pyx_v_self->spheres = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_spheres = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":641
 *         self.keys = keys = []
 *         self.spheres = spheres = {}
 *         self.centers = centers = {}             # <<<<<<<<<<<<<<
 *         self.list_ids = list_ids = {}
 *         for D in self.horoballs:
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 641, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->centers);
  __Pyx_DECREF(__pyx_v_self->centers);
  __pyx_v_self->centers = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_centers = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":642
 *         self.spheres = spheres = {}
 *         self.centers = centers = {}
 *         self.list_ids = list_ids = {}             # <<<<<<<<<<<<<<
 *         for D in self.horoballs:
 *             z_center = D['center']
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->list_ids);
  __Pyx_DECREF(__pyx_v_self->list_ids);
  __pyx_v_self->list_ids = __pyx_t_1;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_v_list_ids = __pyx_t_1;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":643
 *         self.centers = centers = {}
 *         self.list_ids = list_ids = {}
 *         for D in self.horoballs:             # <<<<<<<<<<<<<<
 *             z_center = D['center']
 *             radius = round(D['radius'], 10)
 */
  if (likely(PyList_CheckExact(__pyx_v_self->horoballs)) || PyTuple_CheckExact(__pyx_v_self->horoballs)) {
    __pyx_t_1 = __pyx_v_self->horoballs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->horoballs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 643, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 643, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 643, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 643, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 643, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_D, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":644
 *         self.list_ids = list_ids = {}
 *         for D in self.horoballs:
 *             z_center = D['center']             # <<<<<<<<<<<<<<
 *             radius = round(D['radius'], 10)
 *             index = D['index']
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_n_s_center); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 644, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_z_center, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":645
 *         for D in self.horoballs:
 *             z_center = D['center']
 *             radius = round(D['radius'], 10)             # <<<<<<<<<<<<<<
 *             index = D['index']
 *             key = (radius, index)
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_n_s_radius); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
    __Pyx_INCREF(__pyx_int_10);
    __Pyx_GIVEREF(__pyx_int_10);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_10);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_round, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 645, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_radius, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":646
 *             z_center = D['center']
 *             radius = round(D['radius'], 10)
 *             index = D['index']             # <<<<<<<<<<<<<<
 *             key = (radius, index)
 *             center = vector3((z_center.real, z_center.imag, radius))
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_n_s_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 646, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":647
 *             radius = round(D['radius'], 10)
 *             index = D['index']
 *             key = (radius, index)             # <<<<<<<<<<<<<<
 *             center = vector3((z_center.real, z_center.imag, radius))
 *             color = GetColor(self.original_indices[index])
 */
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 647, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_INCREF(__pyx_v_radius);
    __Pyx_GIVEREF(__pyx_v_radius);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_radius);
    __Pyx_INCREF(__pyx_v_index);
    __Pyx_GIVEREF(__pyx_v_index);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_index);
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":648
 *             index = D['index']
 *             key = (radius, index)
 *             center = vector3((z_center.real, z_center.imag, radius))             # <<<<<<<<<<<<<<
 *             color = GetColor(self.original_indices[index])
 *             try:
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_z_center, __pyx_n_s_real); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_z_center, __pyx_n_s_imag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_INCREF(__pyx_v_radius);
    __Pyx_GIVEREF(__pyx_v_radius);
    PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_radius);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)__pyx_ptype_8CyOpenGL_vector3), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 648, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_center, ((struct __pyx_obj_8CyOpenGL_vector3 *)__pyx_t_5));
    __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":649
 *             key = (radius, index)
 *             center = vector3((z_center.real, z_center.imag, radius))
 *             color = GetColor(self.original_indices[index])             # <<<<<<<<<<<<<<
 *             try:
 *                 centers[key].append(center)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_GetColor); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_self->original_indices, __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_7 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_6, function);
      }
    }
    __pyx_t_5 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 649, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_color, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":650
 *             center = vector3((z_center.real, z_center.imag, radius))
 *             color = GetColor(self.original_indices[index])
 *             try:             # <<<<<<<<<<<<<<
 *                 centers[key].append(center)
 *             except KeyError:
 */
    {
      __Pyx_PyThreadState_declare
      __Pyx_PyThreadState_assign
      __Pyx_ExceptionSave(&__pyx_t_8, &__pyx_t_9, &__pyx_t_10);
      __Pyx_XGOTREF(__pyx_t_8);
      __Pyx_XGOTREF(__pyx_t_9);
      __Pyx_XGOTREF(__pyx_t_10);
      /*try:*/ {

        /* "CyOpenGL.pyx":651
 *             color = GetColor(self.original_indices[index])
 *             try:
 *                 centers[key].append(center)             # <<<<<<<<<<<<<<
 *             except KeyError:
 *                 keys.append(key)
 */
        __pyx_t_5 = __Pyx_PyDict_GetItem(__pyx_v_centers, __pyx_v_key); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 651, __pyx_L5_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_11 = __Pyx_PyObject_Append(__pyx_t_5, ((PyObject *)__pyx_v_center)); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 651, __pyx_L5_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "CyOpenGL.pyx":650
 *             center = vector3((z_center.real, z_center.imag, radius))
 *             color = GetColor(self.original_indices[index])
 *             try:             # <<<<<<<<<<<<<<
 *                 centers[key].append(center)
 *             except KeyError:
 */
      }
      __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
      goto __pyx_L12_try_end;
      __pyx_L5_error:;
      __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "CyOpenGL.pyx":652
 *             try:
 *                 centers[key].append(center)
 *             except KeyError:             # <<<<<<<<<<<<<<
 *                 keys.append(key)
 *                 centers[key] = [center]
 */
      __pyx_t_12 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
      if (__pyx_t_12) {
        __Pyx_AddTraceback("CyOpenGL.HoroballGroup.build_spheres", __pyx_clineno, __pyx_lineno, __pyx_filename);
        if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_4) < 0) __PYX_ERR(0, 652, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_GOTREF(__pyx_t_4);

        /* "CyOpenGL.pyx":653
 *                 centers[key].append(center)
 *             except KeyError:
 *                 keys.append(key)             # <<<<<<<<<<<<<<
 *                 centers[key] = [center]
 *                 spheres[key] = Horosphere(radius=radius, color=color)
 */
        __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_keys, __pyx_v_key); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 653, __pyx_L7_except_error)

        /* "CyOpenGL.pyx":654
 *             except KeyError:
 *                 keys.append(key)
 *                 centers[key] = [center]             # <<<<<<<<<<<<<<
 *                 spheres[key] = Horosphere(radius=radius, color=color)
 *         keys.sort()
 */
        __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 654, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_INCREF(((PyObject *)__pyx_v_center));
        __Pyx_GIVEREF(((PyObject *)__pyx_v_center));
        PyList_SET_ITEM(__pyx_t_7, 0, ((PyObject *)__pyx_v_center));
        if (unlikely(PyDict_SetItem(__pyx_v_centers, __pyx_v_key, __pyx_t_7) < 0)) __PYX_ERR(0, 654, __pyx_L7_except_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

        /* "CyOpenGL.pyx":655
 *                 keys.append(key)
 *                 centers[key] = [center]
 *                 spheres[key] = Horosphere(radius=radius, color=color)             # <<<<<<<<<<<<<<
 *         keys.sort()
 *         self.get_list_ids(len(keys))
 */
        __pyx_t_7 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 655, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_radius, __pyx_v_radius) < 0) __PYX_ERR(0, 655, __pyx_L7_except_error)
        if (PyDict_SetItem(__pyx_t_7, __pyx_n_s_color, __pyx_v_color) < 0) __PYX_ERR(0, 655, __pyx_L7_except_error)
        __pyx_t_13 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_Horosphere), __pyx_empty_tuple, __pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 655, __pyx_L7_except_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(PyDict_SetItem(__pyx_v_spheres, __pyx_v_key, __pyx_t_13) < 0)) __PYX_ERR(0, 655, __pyx_L7_except_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
        goto __pyx_L6_exception_handled;
      }
      goto __pyx_L7_except_error;
      __pyx_L7_except_error:;

      /* "CyOpenGL.pyx":650
 *             center = vector3((z_center.real, z_center.imag, radius))
 *             color = GetColor(self.original_indices[index])
 *             try:             # <<<<<<<<<<<<<<
 *                 centers[key].append(center)
 *             except KeyError:
 */
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      goto __pyx_L1_error;
      __pyx_L6_exception_handled:;
      __Pyx_XGIVEREF(__pyx_t_8);
      __Pyx_XGIVEREF(__pyx_t_9);
      __Pyx_XGIVEREF(__pyx_t_10);
      __Pyx_ExceptionReset(__pyx_t_8, __pyx_t_9, __pyx_t_10);
      __pyx_L12_try_end:;
    }

    /* "CyOpenGL.pyx":643
 *         self.centers = centers = {}
 *         self.list_ids = list_ids = {}
 *         for D in self.horoballs:             # <<<<<<<<<<<<<<
 *             z_center = D['center']
 *             radius = round(D['radius'], 10)
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":656
 *                 centers[key] = [center]
 *                 spheres[key] = Horosphere(radius=radius, color=color)
 *         keys.sort()             # <<<<<<<<<<<<<<
 *         self.get_list_ids(len(keys))
 *         n = self.list_id_base
 */
  __pyx_t_11 = PyList_Sort(__pyx_v_keys); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 656, __pyx_L1_error)

  /* "CyOpenGL.pyx":657
 *                 spheres[key] = Horosphere(radius=radius, color=color)
 *         keys.sort()
 *         self.get_list_ids(len(keys))             # <<<<<<<<<<<<<<
 *         n = self.list_id_base
 *         for key in keys:
 */
  __pyx_t_2 = PyList_GET_SIZE(__pyx_v_keys); if (unlikely(__pyx_t_2 == ((Py_ssize_t)-1))) __PYX_ERR(0, 657, __pyx_L1_error)
  __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballGroup *)__pyx_v_self->__pyx_vtab)->get_list_ids(__pyx_v_self, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 657, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":658
 *         keys.sort()
 *         self.get_list_ids(len(keys))
 *         n = self.list_id_base             # <<<<<<<<<<<<<<
 *         for key in keys:
 *             spheres[key].build_display_list(n)
 */
  __pyx_t_4 = __Pyx_PyInt_From_GLuint(__pyx_v_self->list_id_base); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_n = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":659
 *         self.get_list_ids(len(keys))
 *         n = self.list_id_base
 *         for key in keys:             # <<<<<<<<<<<<<<
 *             spheres[key].build_display_list(n)
 *             list_ids[key] = n
 */
  __pyx_t_4 = __pyx_v_keys; __Pyx_INCREF(__pyx_t_4); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_4)) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_1 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_2); __Pyx_INCREF(__pyx_t_1); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 659, __pyx_L1_error)
    #else
    __pyx_t_1 = PySequence_ITEM(__pyx_t_4, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 659, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":660
 *         n = self.list_id_base
 *         for key in keys:
 *             spheres[key].build_display_list(n)             # <<<<<<<<<<<<<<
 *             list_ids[key] = n
 *             n += 1
 */
    __pyx_t_6 = __Pyx_PyDict_GetItem(__pyx_v_spheres, __pyx_v_key); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_build_display_list); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
      }
    }
    __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_v_n) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_n);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 660, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":661
 *         for key in keys:
 *             spheres[key].build_display_list(n)
 *             list_ids[key] = n             # <<<<<<<<<<<<<<
 *             n += 1
 * 
 */
    if (unlikely(PyDict_SetItem(__pyx_v_list_ids, __pyx_v_key, __pyx_v_n) < 0)) __PYX_ERR(0, 661, __pyx_L1_error)

    /* "CyOpenGL.pyx":662
 *             spheres[key].build_display_list(n)
 *             list_ids[key] = n
 *             n += 1             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, R, T):
 */
    __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 662, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":659
 *         self.get_list_ids(len(keys))
 *         n = self.list_id_base
 *         for key in keys:             # <<<<<<<<<<<<<<
 *             spheres[key].build_display_list(n)
 *             list_ids[key] = n
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":638
 *             glDeleteLists(self.list_id_base, self.num_lists)
 * 
 *     cdef build_spheres(self):             # <<<<<<<<<<<<<<
 *         self.keys = keys = []
 *         self.spheres = spheres = {}
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.build_spheres", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_keys);
  __Pyx_XDECREF(__pyx_v_spheres);
  __Pyx_XDECREF(__pyx_v_centers);
  __Pyx_XDECREF(__pyx_v_list_ids);
  __Pyx_XDECREF(__pyx_v_D);
  __Pyx_XDECREF(__pyx_v_z_center);
  __Pyx_XDECREF(__pyx_v_radius);
  __Pyx_XDECREF(__pyx_v_index);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF((PyObject *)__pyx_v_center);
  __Pyx_XDECREF(__pyx_v_color);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":664
 *             n += 1
 * 
 *     def draw(self, R, T):             # <<<<<<<<<<<<<<
 *         vx, vy = self.meridian.real, self.meridian.imag
 *         ux = self.longitude.real
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_5draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballGroup_4draw[] = "HoroballGroup.draw(self, R, T)";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_5draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_R = 0;
  PyObject *__pyx_v_T = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_R,&__pyx_n_s_T,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_T)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 2, 2, 1); __PYX_ERR(0, 664, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 664, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_R = values[0];
    __pyx_v_T = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 664, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballGroup_4draw(((struct __pyx_obj_8CyOpenGL_HoroballGroup *)__pyx_v_self), __pyx_v_R, __pyx_v_T);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_4draw(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_T) {
  PyObject *__pyx_v_vx = NULL;
  PyObject *__pyx_v_vy = NULL;
  PyObject *__pyx_v_ux = NULL;
  PyObject *__pyx_v_key = NULL;
  PyObject *__pyx_v_list_id = NULL;
  PyObject *__pyx_v_center = NULL;
  PyObject *__pyx_v_x = NULL;
  PyObject *__pyx_v_y = NULL;
  PyObject *__pyx_v_N_min = NULL;
  PyObject *__pyx_v_N_max = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_v_xn = NULL;
  CYTHON_UNUSED PyObject *__pyx_v_yn = NULL;
  PyObject *__pyx_v_M_min = NULL;
  PyObject *__pyx_v_M_max = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_disp = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  PyObject *__pyx_t_8 = NULL;
  GLfloat __pyx_t_9;
  GLfloat __pyx_t_10;
  GLfloat __pyx_t_11;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  long __pyx_t_14;
  long __pyx_t_15;
  long __pyx_t_16;
  long __pyx_t_17;
  long __pyx_t_18;
  long __pyx_t_19;
  GLuint __pyx_t_20;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "CyOpenGL.pyx":665
 * 
 *     def draw(self, R, T):
 *         vx, vy = self.meridian.real, self.meridian.imag             # <<<<<<<<<<<<<<
 *         ux = self.longitude.real
 *         for key in self.keys:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_n_s_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_n_s_imag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 665, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_vx = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_vy = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":666
 *     def draw(self, R, T):
 *         vx, vy = self.meridian.real, self.meridian.imag
 *         ux = self.longitude.real             # <<<<<<<<<<<<<<
 *         for key in self.keys:
 *             list_id = self.list_ids[key]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_n_s_real); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_ux = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":667
 *         vx, vy = self.meridian.real, self.meridian.imag
 *         ux = self.longitude.real
 *         for key in self.keys:             # <<<<<<<<<<<<<<
 *             list_id = self.list_ids[key]
 *             for center in self.centers[key]:
 */
  if (likely(PyList_CheckExact(__pyx_v_self->keys)) || PyTuple_CheckExact(__pyx_v_self->keys)) {
    __pyx_t_2 = __pyx_v_self->keys; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_self->keys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 667, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 667, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 667, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 667, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 667, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 667, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XDECREF_SET(__pyx_v_key, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":668
 *         ux = self.longitude.real
 *         for key in self.keys:
 *             list_id = self.list_ids[key]             # <<<<<<<<<<<<<<
 *             for center in self.centers[key]:
 *                 x, y = center.x, center.y
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->list_ids, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 668, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_list_id, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":669
 *         for key in self.keys:
 *             list_id = self.list_ids[key]
 *             for center in self.centers[key]:             # <<<<<<<<<<<<<<
 *                 x, y = center.x, center.y
 *                 glPushMatrix()
 */
    __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_self->centers, __pyx_v_key); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_5 = __pyx_t_1; __Pyx_INCREF(__pyx_t_5); __pyx_t_6 = 0;
      __pyx_t_7 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 669, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 669, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_7)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 669, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 669, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_5, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 669, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_7(__pyx_t_5);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 669, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_center, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "CyOpenGL.pyx":670
 *             list_id = self.list_ids[key]
 *             for center in self.centers[key]:
 *                 x, y = center.x, center.y             # <<<<<<<<<<<<<<
 *                 glPushMatrix()
 *                 glTranslatef(x, y, center.z)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_center, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_center, __pyx_n_s_y); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 670, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_1);
      __pyx_t_1 = 0;
      __Pyx_XDECREF_SET(__pyx_v_y, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "CyOpenGL.pyx":671
 *             for center in self.centers[key]:
 *                 x, y = center.x, center.y
 *                 glPushMatrix()             # <<<<<<<<<<<<<<
 *                 glTranslatef(x, y, center.z)
 *                 N_min = -ceil( (T + y)/vy )
 */
      glPushMatrix();

      /* "CyOpenGL.pyx":672
 *                 x, y = center.x, center.y
 *                 glPushMatrix()
 *                 glTranslatef(x, y, center.z)             # <<<<<<<<<<<<<<
 *                 N_min = -ceil( (T + y)/vy )
 *                 N_max = ceil( (T - y)/vy )
 */
      __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_v_x); if (unlikely((__pyx_t_9 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 672, __pyx_L1_error)
      __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_v_y); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 672, __pyx_L1_error)
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_center, __pyx_n_s_z); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 672, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_8); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 672, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      glTranslatef(__pyx_t_9, __pyx_t_10, __pyx_t_11);

      /* "CyOpenGL.pyx":673
 *                 glPushMatrix()
 *                 glTranslatef(x, y, center.z)
 *                 N_min = -ceil( (T + y)/vy )             # <<<<<<<<<<<<<<
 *                 N_max = ceil( (T - y)/vy )
 *                 for n from N_min <= n <= N_max:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_12 = PyNumber_Add(__pyx_v_T, __pyx_v_y); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_13 = __Pyx_PyNumber_Divide(__pyx_t_12, __pyx_v_vy); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_12)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_12);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
        }
      }
      __pyx_t_8 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_13);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyNumber_Negative(__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 673, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_N_min, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "CyOpenGL.pyx":674
 *                 glTranslatef(x, y, center.z)
 *                 N_min = -ceil( (T + y)/vy )
 *                 N_max = ceil( (T - y)/vy )             # <<<<<<<<<<<<<<
 *                 for n from N_min <= n <= N_max:
 *                     xn = x + n*vx
 */
      __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ceil); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 674, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __pyx_t_13 = PyNumber_Subtract(__pyx_v_T, __pyx_v_y); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 674, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __pyx_t_12 = __Pyx_PyNumber_Divide(__pyx_t_13, __pyx_v_vy); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 674, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      __pyx_t_13 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
        __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_8);
        if (likely(__pyx_t_13)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
          __Pyx_INCREF(__pyx_t_13);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_8, function);
        }
      }
      __pyx_t_1 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_13, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_12);
      __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 674, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_XDECREF_SET(__pyx_v_N_max, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "CyOpenGL.pyx":675
 *                 N_min = -ceil( (T + y)/vy )
 *                 N_max = ceil( (T - y)/vy )
 *                 for n from N_min <= n <= N_max:             # <<<<<<<<<<<<<<
 *                     xn = x + n*vx
 *                     yn = y + n*vy
 */
      __pyx_t_14 = __Pyx_PyInt_As_long(__pyx_v_N_min); if (unlikely((__pyx_t_14 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L1_error)
      __pyx_t_15 = __Pyx_PyInt_As_long(__pyx_v_N_max); if (unlikely((__pyx_t_15 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L1_error)
      for (__pyx_t_16 = __pyx_t_14; __pyx_t_16 <= __pyx_t_15; __pyx_t_16++) {
        __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_t_16); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "CyOpenGL.pyx":676
 *                 N_max = ceil( (T - y)/vy )
 *                 for n from N_min <= n <= N_max:
 *                     xn = x + n*vx             # <<<<<<<<<<<<<<
 *                     yn = y + n*vy
 *                     M_min = -ceil( (R + xn)/ux )
 */
        __pyx_t_1 = PyNumber_Multiply(__pyx_v_n, __pyx_v_vx); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 676, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_8 = PyNumber_Add(__pyx_v_x, __pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 676, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_xn, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "CyOpenGL.pyx":677
 *                 for n from N_min <= n <= N_max:
 *                     xn = x + n*vx
 *                     yn = y + n*vy             # <<<<<<<<<<<<<<
 *                     M_min = -ceil( (R + xn)/ux )
 *                     M_max = ceil( (R - xn)/ux )
 */
        __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_v_vy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_1 = PyNumber_Add(__pyx_v_y, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 677, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_XDECREF_SET(__pyx_v_yn, __pyx_t_1);
        __pyx_t_1 = 0;

        /* "CyOpenGL.pyx":678
 *                     xn = x + n*vx
 *                     yn = y + n*vy
 *                     M_min = -ceil( (R + xn)/ux )             # <<<<<<<<<<<<<<
 *                     M_max = ceil( (R - xn)/ux )
 *                     for m from M_min <= m <= M_max:
 */
        __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_ceil); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 678, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __pyx_t_12 = PyNumber_Add(__pyx_v_R, __pyx_v_xn); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 678, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = __Pyx_PyNumber_Divide(__pyx_t_12, __pyx_v_ux); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 678, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_12 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
          __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_8);
          if (likely(__pyx_t_12)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
            __Pyx_INCREF(__pyx_t_12);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_8, function);
          }
        }
        __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_12, __pyx_t_13) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_13);
        __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 678, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
        __pyx_t_8 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 678, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_M_min, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "CyOpenGL.pyx":679
 *                     yn = y + n*vy
 *                     M_min = -ceil( (R + xn)/ux )
 *                     M_max = ceil( (R - xn)/ux )             # <<<<<<<<<<<<<<
 *                     for m from M_min <= m <= M_max:
 *                         disp = n*self.meridian + m*self.longitude
 */
        __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_ceil); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_13 = PyNumber_Subtract(__pyx_v_R, __pyx_v_xn); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_12 = __Pyx_PyNumber_Divide(__pyx_t_13, __pyx_v_ux); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = NULL;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_1);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_1, function);
          }
        }
        __pyx_t_8 = (__pyx_t_13) ? __Pyx_PyObject_Call2Args(__pyx_t_1, __pyx_t_13, __pyx_t_12) : __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_12);
        __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_XDECREF_SET(__pyx_v_M_max, __pyx_t_8);
        __pyx_t_8 = 0;

        /* "CyOpenGL.pyx":680
 *                     M_min = -ceil( (R + xn)/ux )
 *                     M_max = ceil( (R - xn)/ux )
 *                     for m from M_min <= m <= M_max:             # <<<<<<<<<<<<<<
 *                         disp = n*self.meridian + m*self.longitude
 *                         glPushMatrix()
 */
        __pyx_t_17 = __Pyx_PyInt_As_long(__pyx_v_M_min); if (unlikely((__pyx_t_17 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L1_error)
        __pyx_t_18 = __Pyx_PyInt_As_long(__pyx_v_M_max); if (unlikely((__pyx_t_18 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L1_error)
        for (__pyx_t_19 = __pyx_t_17; __pyx_t_19 <= __pyx_t_18; __pyx_t_19++) {
          __pyx_t_8 = __Pyx_PyInt_From_long(__pyx_t_19); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 680, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_8);
          __pyx_t_8 = 0;

          /* "CyOpenGL.pyx":681
 *                     M_max = ceil( (R - xn)/ux )
 *                     for m from M_min <= m <= M_max:
 *                         disp = n*self.meridian + m*self.longitude             # <<<<<<<<<<<<<<
 *                         glPushMatrix()
 *                         glTranslatef(disp.real, disp.imag, 0.0)
 */
          __pyx_t_8 = PyNumber_Multiply(__pyx_v_n, __pyx_v_self->meridian); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 681, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_8);
          __pyx_t_1 = PyNumber_Multiply(__pyx_v_m, __pyx_v_self->longitude); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 681, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_12 = PyNumber_Add(__pyx_t_8, __pyx_t_1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 681, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
          __Pyx_XDECREF_SET(__pyx_v_disp, __pyx_t_12);
          __pyx_t_12 = 0;

          /* "CyOpenGL.pyx":682
 *                     for m from M_min <= m <= M_max:
 *                         disp = n*self.meridian + m*self.longitude
 *                         glPushMatrix()             # <<<<<<<<<<<<<<
 *                         glTranslatef(disp.real, disp.imag, 0.0)
 *                         glCallList(list_id)
 */
          glPushMatrix();

          /* "CyOpenGL.pyx":683
 *                         disp = n*self.meridian + m*self.longitude
 *                         glPushMatrix()
 *                         glTranslatef(disp.real, disp.imag, 0.0)             # <<<<<<<<<<<<<<
 *                         glCallList(list_id)
 *                         glPopMatrix()
 */
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_n_s_real); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 683, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_12); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_n_s_imag); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 683, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_12); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 683, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          glTranslatef(__pyx_t_11, __pyx_t_10, 0.0);

          /* "CyOpenGL.pyx":684
 *                         glPushMatrix()
 *                         glTranslatef(disp.real, disp.imag, 0.0)
 *                         glCallList(list_id)             # <<<<<<<<<<<<<<
 *                         glPopMatrix()
 *                 glPopMatrix()
 */
          __pyx_t_20 = __Pyx_PyInt_As_GLuint(__pyx_v_list_id); if (unlikely((__pyx_t_20 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 684, __pyx_L1_error)
          glCallList(__pyx_t_20);

          /* "CyOpenGL.pyx":685
 *                         glTranslatef(disp.real, disp.imag, 0.0)
 *                         glCallList(list_id)
 *                         glPopMatrix()             # <<<<<<<<<<<<<<
 *                 glPopMatrix()
 * 
 */
          glPopMatrix();
          __pyx_t_19 = __Pyx_PyInt_As_long(__pyx_v_m); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L1_error)
        }

        /* "CyOpenGL.pyx":680
 *                     M_min = -ceil( (R + xn)/ux )
 *                     M_max = ceil( (R - xn)/ux )
 *                     for m from M_min <= m <= M_max:             # <<<<<<<<<<<<<<
 *                         disp = n*self.meridian + m*self.longitude
 *                         glPushMatrix()
 */
        __pyx_t_12 = __Pyx_PyInt_From_long(__pyx_t_19); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 680, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_12);
        __pyx_t_12 = 0;
        __pyx_t_16 = __Pyx_PyInt_As_long(__pyx_v_n); if (unlikely((__pyx_t_16 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 675, __pyx_L1_error)
      }

      /* "CyOpenGL.pyx":675
 *                 N_min = -ceil( (T + y)/vy )
 *                 N_max = ceil( (T - y)/vy )
 *                 for n from N_min <= n <= N_max:             # <<<<<<<<<<<<<<
 *                     xn = x + n*vx
 *                     yn = y + n*vy
 */
      __pyx_t_12 = __Pyx_PyInt_From_long(__pyx_t_16); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 675, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_12);
      __pyx_t_12 = 0;

      /* "CyOpenGL.pyx":686
 *                         glCallList(list_id)
 *                         glPopMatrix()
 *                 glPopMatrix()             # <<<<<<<<<<<<<<
 * 
 *     def build_display_list(self, list_id, R, T):
 */
      glPopMatrix();

      /* "CyOpenGL.pyx":669
 *         for key in self.keys:
 *             list_id = self.list_ids[key]
 *             for center in self.centers[key]:             # <<<<<<<<<<<<<<
 *                 x, y = center.x, center.y
 *                 glPushMatrix()
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":667
 *         vx, vy = self.meridian.real, self.meridian.imag
 *         ux = self.longitude.real
 *         for key in self.keys:             # <<<<<<<<<<<<<<
 *             list_id = self.list_ids[key]
 *             for center in self.centers[key]:
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":664
 *             n += 1
 * 
 *     def draw(self, R, T):             # <<<<<<<<<<<<<<
 *         vx, vy = self.meridian.real, self.meridian.imag
 *         ux = self.longitude.real
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vx);
  __Pyx_XDECREF(__pyx_v_vy);
  __Pyx_XDECREF(__pyx_v_ux);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XDECREF(__pyx_v_list_id);
  __Pyx_XDECREF(__pyx_v_center);
  __Pyx_XDECREF(__pyx_v_x);
  __Pyx_XDECREF(__pyx_v_y);
  __Pyx_XDECREF(__pyx_v_N_min);
  __Pyx_XDECREF(__pyx_v_N_max);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_xn);
  __Pyx_XDECREF(__pyx_v_yn);
  __Pyx_XDECREF(__pyx_v_M_min);
  __Pyx_XDECREF(__pyx_v_M_max);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_disp);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":688
 *                 glPopMatrix()
 * 
 *     def build_display_list(self, list_id, R, T):             # <<<<<<<<<<<<<<
 *         glNewList(list_id, GL_COMPILE)
 *         self.draw(R, T)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_7build_display_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballGroup_6build_display_list[] = "HoroballGroup.build_display_list(self, list_id, R, T)";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_7build_display_list(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_list_id = 0;
  PyObject *__pyx_v_R = 0;
  PyObject *__pyx_v_T = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_display_list (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_list_id,&__pyx_n_s_R,&__pyx_n_s_T,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_list_id)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_R)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("build_display_list", 1, 3, 3, 1); __PYX_ERR(0, 688, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_T)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("build_display_list", 1, 3, 3, 2); __PYX_ERR(0, 688, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build_display_list") < 0)) __PYX_ERR(0, 688, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_list_id = values[0];
    __pyx_v_R = values[1];
    __pyx_v_T = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_display_list", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 688, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.build_display_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballGroup_6build_display_list(((struct __pyx_obj_8CyOpenGL_HoroballGroup *)__pyx_v_self), __pyx_v_list_id, __pyx_v_R, __pyx_v_T);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_6build_display_list(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v_list_id, PyObject *__pyx_v_R, PyObject *__pyx_v_T) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GLuint __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("build_display_list", 0);

  /* "CyOpenGL.pyx":689
 * 
 *     def build_display_list(self, list_id, R, T):
 *         glNewList(list_id, GL_COMPILE)             # <<<<<<<<<<<<<<
 *         self.draw(R, T)
 *         glEndList()
 */
  __pyx_t_1 = __Pyx_PyInt_As_GLuint(__pyx_v_list_id); if (unlikely((__pyx_t_1 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 689, __pyx_L1_error)
  glNewList(__pyx_t_1, GL_COMPILE);

  /* "CyOpenGL.pyx":690
 *     def build_display_list(self, list_id, R, T):
 *         glNewList(list_id, GL_COMPILE)
 *         self.draw(R, T)             # <<<<<<<<<<<<<<
 *         glEndList()
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_draw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 690, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_R, __pyx_v_T};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_v_R, __pyx_v_T};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_R);
    __Pyx_GIVEREF(__pyx_v_R);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_R);
    __Pyx_INCREF(__pyx_v_T);
    __Pyx_GIVEREF(__pyx_v_T);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_T);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 690, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":691
 *         glNewList(list_id, GL_COMPILE)
 *         self.draw(R, T)
 *         glEndList()             # <<<<<<<<<<<<<<
 * 
 * cdef class Parallelogram(GLobject):
 */
  glEndList();

  /* "CyOpenGL.pyx":688
 *                 glPopMatrix()
 * 
 *     def build_display_list(self, list_id, R, T):             # <<<<<<<<<<<<<<
 *         glNewList(list_id, GL_COMPILE)
 *         self.draw(R, T)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.build_display_list", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballGroup_8__reduce_cython__[] = "HoroballGroup.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_9__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballGroup_8__reduce_cython__(((struct __pyx_obj_8CyOpenGL_HoroballGroup *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_8__reduce_cython__(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.centers, self.color, self.cutoff, self.horoballs, self.keys, self.list_id_base, self.list_ids, self.longitude, self.meridian, self.num_lists, self.original_indices, self.spheres)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_carray_to_py_GLfloat(__pyx_v_self->color, 4); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_GLuint(__pyx_v_self->list_id_base); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_From_GLuint(__pyx_v_self->num_lists); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(12); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->centers);
  __Pyx_GIVEREF(__pyx_v_self->centers);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->centers);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->horoballs);
  __Pyx_GIVEREF(__pyx_v_self->horoballs);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_v_self->horoballs);
  __Pyx_INCREF(__pyx_v_self->keys);
  __Pyx_GIVEREF(__pyx_v_self->keys);
  PyTuple_SET_ITEM(__pyx_t_5, 4, __pyx_v_self->keys);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 5, __pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->list_ids);
  __Pyx_GIVEREF(__pyx_v_self->list_ids);
  PyTuple_SET_ITEM(__pyx_t_5, 6, __pyx_v_self->list_ids);
  __Pyx_INCREF(__pyx_v_self->longitude);
  __Pyx_GIVEREF(__pyx_v_self->longitude);
  PyTuple_SET_ITEM(__pyx_t_5, 7, __pyx_v_self->longitude);
  __Pyx_INCREF(__pyx_v_self->meridian);
  __Pyx_GIVEREF(__pyx_v_self->meridian);
  PyTuple_SET_ITEM(__pyx_t_5, 8, __pyx_v_self->meridian);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 9, __pyx_t_4);
  __Pyx_INCREF(__pyx_v_self->original_indices);
  __Pyx_GIVEREF(__pyx_v_self->original_indices);
  PyTuple_SET_ITEM(__pyx_t_5, 10, __pyx_v_self->original_indices);
  __Pyx_INCREF(__pyx_v_self->spheres);
  __Pyx_GIVEREF(__pyx_v_self->spheres);
  PyTuple_SET_ITEM(__pyx_t_5, 11, __pyx_v_self->spheres);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_5);
  __pyx_t_5 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.centers, self.color, self.cutoff, self.horoballs, self.keys, self.list_id_base, self.list_ids, self.longitude, self.meridian, self.num_lists, self.original_indices, self.spheres)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_5 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_v__dict = __pyx_t_5;
  __pyx_t_5 = 0;

  /* "(tree fragment)":7
 *     state = (self.centers, self.color, self.cutoff, self.horoballs, self.keys, self.list_id_base, self.list_ids, self.longitude, self.meridian, self.num_lists, self.original_indices, self.spheres)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_6 = (__pyx_v__dict != Py_None);
  __pyx_t_7 = (__pyx_t_6 != 0);
  if (__pyx_t_7) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v__dict);
    __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
    __pyx_t_4 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.centers is not None or self.horoballs is not None or self.keys is not None or self.list_ids is not None or self.longitude is not None or self.meridian is not None or self.original_indices is not None or self.spheres is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.centers, self.color, self.cutoff, self.horoballs, self.keys, self.list_id_base, self.list_ids, self.longitude, self.meridian, self.num_lists, self.original_indices, self.spheres)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.centers is not None or self.horoballs is not None or self.keys is not None or self.list_ids is not None or self.longitude is not None or self.meridian is not None or self.original_indices is not None or self.spheres is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_HoroballGroup, (type(self), 0x0a6b5be, None), state
 */
  /*else*/ {
    __pyx_t_6 = (__pyx_v_self->centers != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->horoballs != Py_None);
    __pyx_t_6 = (__pyx_t_8 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_7 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->keys != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->list_ids != Py_None);
    __pyx_t_6 = (__pyx_t_8 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_7 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->longitude != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->meridian != Py_None);
    __pyx_t_6 = (__pyx_t_8 != 0);
    if (!__pyx_t_6) {
    } else {
      __pyx_t_7 = __pyx_t_6;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_6 = (__pyx_v_self->original_indices != Py_None);
    __pyx_t_8 = (__pyx_t_6 != 0);
    if (!__pyx_t_8) {
    } else {
      __pyx_t_7 = __pyx_t_8;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_8 = (__pyx_v_self->spheres != Py_None);
    __pyx_t_6 = (__pyx_t_8 != 0);
    __pyx_t_7 = __pyx_t_6;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_7;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.centers is not None or self.horoballs is not None or self.keys is not None or self.list_ids is not None or self.longitude is not None or self.meridian is not None or self.original_indices is not None or self.spheres is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_HoroballGroup, (type(self), 0x0a6b5be, None), state
 *     else:
 */
  __pyx_t_7 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_7) {

    /* "(tree fragment)":13
 *         use_setstate = self.centers is not None or self.horoballs is not None or self.keys is not None or self.list_ids is not None or self.longitude is not None or self.meridian is not None or self.original_indices is not None or self.spheres is not None
 *     if use_setstate:
 *         return __pyx_unpickle_HoroballGroup, (type(self), 0x0a6b5be, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_HoroballGroup, (type(self), 0x0a6b5be, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_HoroballGroup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_10925502);
    __Pyx_GIVEREF(__pyx_int_10925502);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_10925502);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_5, 2, Py_None);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.centers is not None or self.horoballs is not None or self.keys is not None or self.list_ids is not None or self.longitude is not None or self.meridian is not None or self.original_indices is not None or self.spheres is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_HoroballGroup, (type(self), 0x0a6b5be, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_HoroballGroup, (type(self), 0x0a6b5be, None), state
 *     else:
 *         return __pyx_unpickle_HoroballGroup, (type(self), 0x0a6b5be, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_HoroballGroup__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pyx_unpickle_HoroballGroup); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_10925502);
    __Pyx_GIVEREF(__pyx_int_10925502);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_int_10925502);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
    __pyx_t_3 = 0;
    __pyx_t_5 = 0;
    __pyx_r = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_HoroballGroup, (type(self), 0x0a6b5be, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_HoroballGroup__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballGroup_10__setstate_cython__[] = "HoroballGroup.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballGroup_11__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballGroup_10__setstate_cython__(((struct __pyx_obj_8CyOpenGL_HoroballGroup *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballGroup_10__setstate_cython__(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_HoroballGroup, (type(self), 0x0a6b5be, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_HoroballGroup__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_8CyOpenGL___pyx_unpickle_HoroballGroup__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_HoroballGroup, (type(self), 0x0a6b5be, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_HoroballGroup__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.HoroballGroup.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":699
 *     """
 * 
 *     def draw(self, s1, s2):             # <<<<<<<<<<<<<<
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13Parallelogram_1draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_13Parallelogram_draw[] = "Parallelogram.draw(self, s1, s2)";
static PyObject *__pyx_pw_8CyOpenGL_13Parallelogram_1draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_s1 = 0;
  PyObject *__pyx_v_s2 = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_s1,&__pyx_n_s_s2,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s1)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_s2)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("draw", 1, 2, 2, 1); __PYX_ERR(0, 699, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 699, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_s1 = values[0];
    __pyx_v_s2 = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 699, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.Parallelogram.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13Parallelogram_draw(((struct __pyx_obj_8CyOpenGL_Parallelogram *)__pyx_v_self), __pyx_v_s1, __pyx_v_s2);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13Parallelogram_draw(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Parallelogram *__pyx_v_self, PyObject *__pyx_v_s1, PyObject *__pyx_v_s2) {
  PyObject *__pyx_v_p = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  GLfloat __pyx_t_3;
  GLfloat __pyx_t_4;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "CyOpenGL.pyx":700
 * 
 *     def draw(self, s1, s2):
 *         glDisable(GL_LIGHTING)             # <<<<<<<<<<<<<<
 *         glLineWidth(2.0)
 *         glColor4f(1.0, 0.0, 1.0, 1.0)
 */
  glDisable(GL_LIGHTING);

  /* "CyOpenGL.pyx":701
 *     def draw(self, s1, s2):
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)             # <<<<<<<<<<<<<<
 *         glColor4f(1.0, 0.0, 1.0, 1.0)
 *         glBegin(GL_LINE_LOOP)
 */
  glLineWidth(2.0);

  /* "CyOpenGL.pyx":702
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
 *         glColor4f(1.0, 0.0, 1.0, 1.0)             # <<<<<<<<<<<<<<
 *         glBegin(GL_LINE_LOOP)
 *         p = -(s1+s2)/2
 */
  glColor4f(1.0, 0.0, 1.0, 1.0);

  /* "CyOpenGL.pyx":703
 *         glLineWidth(2.0)
 *         glColor4f(1.0, 0.0, 1.0, 1.0)
 *         glBegin(GL_LINE_LOOP)             # <<<<<<<<<<<<<<
 *         p = -(s1+s2)/2
 *         glVertex3f(p.real, p.imag, 0.0)
 */
  glBegin(GL_LINE_LOOP);

  /* "CyOpenGL.pyx":704
 *         glColor4f(1.0, 0.0, 1.0, 1.0)
 *         glBegin(GL_LINE_LOOP)
 *         p = -(s1+s2)/2             # <<<<<<<<<<<<<<
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s1
 */
  __pyx_t_1 = PyNumber_Add(__pyx_v_s1, __pyx_v_s2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Negative(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 704, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_p = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":705
 *         glBegin(GL_LINE_LOOP)
 *         p = -(s1+s2)/2
 *         glVertex3f(p.real, p.imag, 0.0)             # <<<<<<<<<<<<<<
 *         p += s1
 *         glVertex3f(p.real, p.imag, 0.0)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glVertex3f(__pyx_t_3, __pyx_t_4, 0.0);

  /* "CyOpenGL.pyx":706
 *         p = -(s1+s2)/2
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s1             # <<<<<<<<<<<<<<
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s2
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_p, __pyx_v_s1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 706, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_p, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":707
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s1
 *         glVertex3f(p.real, p.imag, 0.0)             # <<<<<<<<<<<<<<
 *         p += s2
 *         glVertex3f(p.real, p.imag, 0.0)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 707, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glVertex3f(__pyx_t_4, __pyx_t_3, 0.0);

  /* "CyOpenGL.pyx":708
 *         p += s1
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s2             # <<<<<<<<<<<<<<
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p -= s1
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_p, __pyx_v_s2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 708, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_p, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":709
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p += s2
 *         glVertex3f(p.real, p.imag, 0.0)             # <<<<<<<<<<<<<<
 *         p -= s1
 *         glVertex3f(p.real, p.imag, 0.0)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 709, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 709, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glVertex3f(__pyx_t_3, __pyx_t_4, 0.0);

  /* "CyOpenGL.pyx":710
 *         p += s2
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p -= s1             # <<<<<<<<<<<<<<
 *         glVertex3f(p.real, p.imag, 0.0)
 *         glEnd()
 */
  __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_v_p, __pyx_v_s1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 710, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF_SET(__pyx_v_p, __pyx_t_1);
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":711
 *         glVertex3f(p.real, p.imag, 0.0)
 *         p -= s1
 *         glVertex3f(p.real, p.imag, 0.0)             # <<<<<<<<<<<<<<
 *         glEnd()
 *         glEnable(GL_LIGHTING)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_p, __pyx_n_s_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 711, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glVertex3f(__pyx_t_4, __pyx_t_3, 0.0);

  /* "CyOpenGL.pyx":712
 *         p -= s1
 *         glVertex3f(p.real, p.imag, 0.0)
 *         glEnd()             # <<<<<<<<<<<<<<
 *         glEnable(GL_LIGHTING)
 * 
 */
  glEnd();

  /* "CyOpenGL.pyx":713
 *         glVertex3f(p.real, p.imag, 0.0)
 *         glEnd()
 *         glEnable(GL_LIGHTING)             # <<<<<<<<<<<<<<
 * 
 * cdef class EdgeSet(GLobject):
 */
  glEnable(GL_LIGHTING);

  /* "CyOpenGL.pyx":699
 *     """
 * 
 *     def draw(self, s1, s2):             # <<<<<<<<<<<<<<
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.Parallelogram.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13Parallelogram_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_13Parallelogram_2__reduce_cython__[] = "Parallelogram.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_13Parallelogram_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13Parallelogram_2__reduce_cython__(((struct __pyx_obj_8CyOpenGL_Parallelogram *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13Parallelogram_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Parallelogram *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.Parallelogram.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13Parallelogram_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_13Parallelogram_4__setstate_cython__[] = "Parallelogram.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_13Parallelogram_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13Parallelogram_4__setstate_cython__(((struct __pyx_obj_8CyOpenGL_Parallelogram *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13Parallelogram_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_Parallelogram *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.Parallelogram.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":726
 *     cdef segments, longitude, meridian, stipple
 * 
 *     def __init__(self, segments, longitude, meridian):             # <<<<<<<<<<<<<<
 *         self.segments = segments
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_7EdgeSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_7EdgeSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_segments = 0;
  PyObject *__pyx_v_longitude = 0;
  PyObject *__pyx_v_meridian = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_segments,&__pyx_n_s_longitude,&__pyx_n_s_meridian,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_segments)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_longitude)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 726, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meridian)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 726, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 726, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_segments = values[0];
    __pyx_v_longitude = values[1];
    __pyx_v_meridian = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 726, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.EdgeSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_7EdgeSet___init__(((struct __pyx_obj_8CyOpenGL_EdgeSet *)__pyx_v_self), __pyx_v_segments, __pyx_v_longitude, __pyx_v_meridian);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_7EdgeSet___init__(struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self, PyObject *__pyx_v_segments, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":727
 * 
 *     def __init__(self, segments, longitude, meridian):
 *         self.segments = segments             # <<<<<<<<<<<<<<
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.stipple = True
 */
  __Pyx_INCREF(__pyx_v_segments);
  __Pyx_GIVEREF(__pyx_v_segments);
  __Pyx_GOTREF(__pyx_v_self->segments);
  __Pyx_DECREF(__pyx_v_self->segments);
  __pyx_v_self->segments = __pyx_v_segments;

  /* "CyOpenGL.pyx":728
 *     def __init__(self, segments, longitude, meridian):
 *         self.segments = segments
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)             # <<<<<<<<<<<<<<
 *         self.stipple = True
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_v_longitude); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_v_meridian); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 728, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->longitude);
  __Pyx_DECREF(__pyx_v_self->longitude);
  __pyx_v_self->longitude = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->meridian);
  __Pyx_DECREF(__pyx_v_self->meridian);
  __pyx_v_self->meridian = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":729
 *         self.segments = segments
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.stipple = True             # <<<<<<<<<<<<<<
 * 
 *     cdef set_dark_color(self):
 */
  __Pyx_INCREF(Py_True);
  __Pyx_GIVEREF(Py_True);
  __Pyx_GOTREF(__pyx_v_self->stipple);
  __Pyx_DECREF(__pyx_v_self->stipple);
  __pyx_v_self->stipple = Py_True;

  /* "CyOpenGL.pyx":726
 *     cdef segments, longitude, meridian, stipple
 * 
 *     def __init__(self, segments, longitude, meridian):             # <<<<<<<<<<<<<<
 *         self.segments = segments
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.EdgeSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":731
 *         self.stipple = True
 * 
 *     cdef set_dark_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.0, 0.0, 0.0, 1.0)
 * 
 */

static PyObject *__pyx_f_8CyOpenGL_7EdgeSet_set_dark_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_dark_color", 0);

  /* "CyOpenGL.pyx":732
 * 
 *     cdef set_dark_color(self):
 *         glColor4f(0.0, 0.0, 0.0, 1.0)             # <<<<<<<<<<<<<<
 * 
 *     cdef set_light_color(self):
 */
  glColor4f(0.0, 0.0, 0.0, 1.0);

  /* "CyOpenGL.pyx":731
 *         self.stipple = True
 * 
 *     cdef set_dark_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.0, 0.0, 0.0, 1.0)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":734
 *         glColor4f(0.0, 0.0, 0.0, 1.0)
 * 
 *     cdef set_light_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.7, 0.7, 0.7, 1.0)
 * 
 */

static PyObject *__pyx_f_8CyOpenGL_7EdgeSet_set_light_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_light_color", 0);

  /* "CyOpenGL.pyx":735
 * 
 *     cdef set_light_color(self):
 *         glColor4f(0.7, 0.7, 0.7, 1.0)             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, shifts, dark=True):
 */
  glColor4f(0.7, 0.7, 0.7, 1.0);

  /* "CyOpenGL.pyx":734
 *         glColor4f(0.0, 0.0, 0.0, 1.0)
 * 
 *     cdef set_light_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.7, 0.7, 0.7, 1.0)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":737
 *         glColor4f(0.7, 0.7, 0.7, 1.0)
 * 
 *     def draw(self, shifts, dark=True):             # <<<<<<<<<<<<<<
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7EdgeSet_3draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_7EdgeSet_2draw[] = "EdgeSet.draw(self, shifts, dark=True)";
static PyObject *__pyx_pw_8CyOpenGL_7EdgeSet_3draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_shifts = 0;
  PyObject *__pyx_v_dark = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shifts,&__pyx_n_s_dark,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shifts)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dark);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "draw") < 0)) __PYX_ERR(0, 737, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_shifts = values[0];
    __pyx_v_dark = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("draw", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 737, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.EdgeSet.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_7EdgeSet_2draw(((struct __pyx_obj_8CyOpenGL_EdgeSet *)__pyx_v_self), __pyx_v_shifts, __pyx_v_dark);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7EdgeSet_2draw(struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self, PyObject *__pyx_v_shifts, PyObject *__pyx_v_dark) {
  PyObject *__pyx_v_M = NULL;
  PyObject *__pyx_v_L = NULL;
  PyObject *__pyx_v_disp = NULL;
  PyObject *__pyx_v_P1 = NULL;
  PyObject *__pyx_v_P2 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *(*__pyx_t_9)(PyObject *);
  GLfloat __pyx_t_10;
  GLfloat __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "CyOpenGL.pyx":738
 * 
 *     def draw(self, shifts, dark=True):
 *         glDisable(GL_LIGHTING)             # <<<<<<<<<<<<<<
 *         glLineWidth(2.0)
 *         if self.stipple:
 */
  glDisable(GL_LIGHTING);

  /* "CyOpenGL.pyx":739
 *     def draw(self, shifts, dark=True):
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)             # <<<<<<<<<<<<<<
 *         if self.stipple:
 *             glEnable(GL_LINE_STIPPLE)
 */
  glLineWidth(2.0);

  /* "CyOpenGL.pyx":740
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
 *         if self.stipple:             # <<<<<<<<<<<<<<
 *             glEnable(GL_LINE_STIPPLE)
 *             glLineStipple(1, 0xcccc)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->stipple); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 740, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":741
 *         glLineWidth(2.0)
 *         if self.stipple:
 *             glEnable(GL_LINE_STIPPLE)             # <<<<<<<<<<<<<<
 *             glLineStipple(1, 0xcccc)
 *         if dark:
 */
    glEnable(GL_LINE_STIPPLE);

    /* "CyOpenGL.pyx":742
 *         if self.stipple:
 *             glEnable(GL_LINE_STIPPLE)
 *             glLineStipple(1, 0xcccc)             # <<<<<<<<<<<<<<
 *         if dark:
 *             self.set_dark_color()
 */
    glLineStipple(1, 0xcccc);

    /* "CyOpenGL.pyx":740
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
 *         if self.stipple:             # <<<<<<<<<<<<<<
 *             glEnable(GL_LINE_STIPPLE)
 *             glLineStipple(1, 0xcccc)
 */
  }

  /* "CyOpenGL.pyx":743
 *             glEnable(GL_LINE_STIPPLE)
 *             glLineStipple(1, 0xcccc)
 *         if dark:             # <<<<<<<<<<<<<<
 *             self.set_dark_color()
 *         else:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_dark); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 743, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":744
 *             glLineStipple(1, 0xcccc)
 *         if dark:
 *             self.set_dark_color()             # <<<<<<<<<<<<<<
 *         else:
 *             self.set_light_color()
 */
    __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_EdgeSet *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_dark_color(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 744, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":743
 *             glEnable(GL_LINE_STIPPLE)
 *             glLineStipple(1, 0xcccc)
 *         if dark:             # <<<<<<<<<<<<<<
 *             self.set_dark_color()
 *         else:
 */
    goto __pyx_L4;
  }

  /* "CyOpenGL.pyx":746
 *             self.set_dark_color()
 *         else:
 *             self.set_light_color()             # <<<<<<<<<<<<<<
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude
 */
  /*else*/ {
    __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_EdgeSet *)__pyx_v_self->__pyx_base.__pyx_vtab)->set_light_color(__pyx_v_self); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 746, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_L4:;

  /* "CyOpenGL.pyx":747
 *         else:
 *             self.set_light_color()
 *         for M, L in shifts:             # <<<<<<<<<<<<<<
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
 */
  if (likely(PyList_CheckExact(__pyx_v_shifts)) || PyTuple_CheckExact(__pyx_v_shifts)) {
    __pyx_t_2 = __pyx_v_shifts; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_shifts); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 747, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 747, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 747, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 747, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 747, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 747, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 747, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
      PyObject* sequence = __pyx_t_5;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 747, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_6 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_7 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      #else
      __pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      #endif
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_8 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 747, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_9 = Py_TYPE(__pyx_t_8)->tp_iternext;
      index = 0; __pyx_t_6 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_6)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      index = 1; __pyx_t_7 = __pyx_t_9(__pyx_t_8); if (unlikely(!__pyx_t_7)) goto __pyx_L7_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_7);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_8), 2) < 0) __PYX_ERR(0, 747, __pyx_L1_error)
      __pyx_t_9 = NULL;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      goto __pyx_L8_unpacking_done;
      __pyx_L7_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 747, __pyx_L1_error)
      __pyx_L8_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_M, __pyx_t_6);
    __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_L, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "CyOpenGL.pyx":748
 *             self.set_light_color()
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
 */
    __pyx_t_5 = PyNumber_Multiply(__pyx_v_M, __pyx_v_self->meridian); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyNumber_Multiply(__pyx_v_L, __pyx_v_self->longitude); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 748, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF_SET(__pyx_v_disp, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":749
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()             # <<<<<<<<<<<<<<
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for P1, P2 in self.segments:
 */
    glPushMatrix();

    /* "CyOpenGL.pyx":750
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)             # <<<<<<<<<<<<<<
 *             for P1, P2 in self.segments:
 *                 glBegin(GL_LINES)
 */
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_n_s_real); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_n_s_imag); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 750, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    glTranslatef(__pyx_t_10, __pyx_t_11, 0.0);

    /* "CyOpenGL.pyx":751
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for P1, P2 in self.segments:             # <<<<<<<<<<<<<<
 *                 glBegin(GL_LINES)
 *                 glVertex3f(P1.real, P1.imag, 0.0)
 */
    if (likely(PyList_CheckExact(__pyx_v_self->segments)) || PyTuple_CheckExact(__pyx_v_self->segments)) {
      __pyx_t_6 = __pyx_v_self->segments; __Pyx_INCREF(__pyx_t_6); __pyx_t_12 = 0;
      __pyx_t_13 = NULL;
    } else {
      __pyx_t_12 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_self->segments); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 751, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_13 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 751, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_13)) {
        if (likely(PyList_CheckExact(__pyx_t_6))) {
          if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 751, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 751, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        } else {
          if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_12); __Pyx_INCREF(__pyx_t_7); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 751, __pyx_L1_error)
          #else
          __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 751, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          #endif
        }
      } else {
        __pyx_t_7 = __pyx_t_13(__pyx_t_6);
        if (unlikely(!__pyx_t_7)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 751, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_7);
      }
      if ((likely(PyTuple_CheckExact(__pyx_t_7))) || (PyList_CheckExact(__pyx_t_7))) {
        PyObject* sequence = __pyx_t_7;
        Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
        if (unlikely(size != 2)) {
          if (size > 2) __Pyx_RaiseTooManyValuesError(2);
          else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
          __PYX_ERR(0, 751, __pyx_L1_error)
        }
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        if (likely(PyTuple_CheckExact(sequence))) {
          __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyTuple_GET_ITEM(sequence, 1); 
        } else {
          __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
          __pyx_t_8 = PyList_GET_ITEM(sequence, 1); 
        }
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_8);
        #else
        __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 751, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 751, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_8);
        #endif
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else {
        Py_ssize_t index = -1;
        __pyx_t_14 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 751, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_14);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_9 = Py_TYPE(__pyx_t_14)->tp_iternext;
        index = 0; __pyx_t_5 = __pyx_t_9(__pyx_t_14); if (unlikely(!__pyx_t_5)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_5);
        index = 1; __pyx_t_8 = __pyx_t_9(__pyx_t_14); if (unlikely(!__pyx_t_8)) goto __pyx_L11_unpacking_failed;
        __Pyx_GOTREF(__pyx_t_8);
        if (__Pyx_IternextUnpackEndCheck(__pyx_t_9(__pyx_t_14), 2) < 0) __PYX_ERR(0, 751, __pyx_L1_error)
        __pyx_t_9 = NULL;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        goto __pyx_L12_unpacking_done;
        __pyx_L11_unpacking_failed:;
        __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
        __pyx_t_9 = NULL;
        if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
        __PYX_ERR(0, 751, __pyx_L1_error)
        __pyx_L12_unpacking_done:;
      }
      __Pyx_XDECREF_SET(__pyx_v_P1, __pyx_t_5);
      __pyx_t_5 = 0;
      __Pyx_XDECREF_SET(__pyx_v_P2, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "CyOpenGL.pyx":752
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for P1, P2 in self.segments:
 *                 glBegin(GL_LINES)             # <<<<<<<<<<<<<<
 *                 glVertex3f(P1.real, P1.imag, 0.0)
 *                 glVertex3f(P2.real, P2.imag, 0.0)
 */
      glBegin(GL_LINES);

      /* "CyOpenGL.pyx":753
 *             for P1, P2 in self.segments:
 *                 glBegin(GL_LINES)
 *                 glVertex3f(P1.real, P1.imag, 0.0)             # <<<<<<<<<<<<<<
 *                 glVertex3f(P2.real, P2.imag, 0.0)
 *                 glEnd()
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_P1, __pyx_n_s_real); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_P1, __pyx_n_s_imag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 753, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 753, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      glVertex3f(__pyx_t_11, __pyx_t_10, 0.0);

      /* "CyOpenGL.pyx":754
 *                 glBegin(GL_LINES)
 *                 glVertex3f(P1.real, P1.imag, 0.0)
 *                 glVertex3f(P2.real, P2.imag, 0.0)             # <<<<<<<<<<<<<<
 *                 glEnd()
 *             glPopMatrix()
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_P2, __pyx_n_s_real); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 754, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 754, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_P2, __pyx_n_s_imag); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 754, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 754, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      glVertex3f(__pyx_t_10, __pyx_t_11, 0.0);

      /* "CyOpenGL.pyx":755
 *                 glVertex3f(P1.real, P1.imag, 0.0)
 *                 glVertex3f(P2.real, P2.imag, 0.0)
 *                 glEnd()             # <<<<<<<<<<<<<<
 *             glPopMatrix()
 *         if self.stipple:
 */
      glEnd();

      /* "CyOpenGL.pyx":751
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for P1, P2 in self.segments:             # <<<<<<<<<<<<<<
 *                 glBegin(GL_LINES)
 *                 glVertex3f(P1.real, P1.imag, 0.0)
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":756
 *                 glVertex3f(P2.real, P2.imag, 0.0)
 *                 glEnd()
 *             glPopMatrix()             # <<<<<<<<<<<<<<
 *         if self.stipple:
 *             glDisable(GL_LINE_STIPPLE)
 */
    glPopMatrix();

    /* "CyOpenGL.pyx":747
 *         else:
 *             self.set_light_color()
 *         for M, L in shifts:             # <<<<<<<<<<<<<<
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":757
 *                 glEnd()
 *             glPopMatrix()
 *         if self.stipple:             # <<<<<<<<<<<<<<
 *             glDisable(GL_LINE_STIPPLE)
 *         glEnable(GL_LIGHTING)
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->stipple); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 757, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":758
 *             glPopMatrix()
 *         if self.stipple:
 *             glDisable(GL_LINE_STIPPLE)             # <<<<<<<<<<<<<<
 *         glEnable(GL_LIGHTING)
 * 
 */
    glDisable(GL_LINE_STIPPLE);

    /* "CyOpenGL.pyx":757
 *                 glEnd()
 *             glPopMatrix()
 *         if self.stipple:             # <<<<<<<<<<<<<<
 *             glDisable(GL_LINE_STIPPLE)
 *         glEnable(GL_LIGHTING)
 */
  }

  /* "CyOpenGL.pyx":759
 *         if self.stipple:
 *             glDisable(GL_LINE_STIPPLE)
 *         glEnable(GL_LIGHTING)             # <<<<<<<<<<<<<<
 * 
 * cdef class FordEdgeSet(EdgeSet):
 */
  glEnable(GL_LIGHTING);

  /* "CyOpenGL.pyx":737
 *         glColor4f(0.7, 0.7, 0.7, 1.0)
 * 
 *     def draw(self, shifts, dark=True):             # <<<<<<<<<<<<<<
 *         glDisable(GL_LIGHTING)
 *         glLineWidth(2.0)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("CyOpenGL.EdgeSet.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_M);
  __Pyx_XDECREF(__pyx_v_L);
  __Pyx_XDECREF(__pyx_v_disp);
  __Pyx_XDECREF(__pyx_v_P1);
  __Pyx_XDECREF(__pyx_v_P2);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7EdgeSet_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_7EdgeSet_4__reduce_cython__[] = "EdgeSet.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_7EdgeSet_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7EdgeSet_4__reduce_cython__(((struct __pyx_obj_8CyOpenGL_EdgeSet *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7EdgeSet_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.EdgeSet.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7EdgeSet_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_7EdgeSet_6__setstate_cython__[] = "EdgeSet.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_7EdgeSet_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_7EdgeSet_6__setstate_cython__(((struct __pyx_obj_8CyOpenGL_EdgeSet *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_7EdgeSet_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_EdgeSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.EdgeSet.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_11FordEdgeSet_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_11FordEdgeSet___reduce_cython__[] = "FordEdgeSet.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_11FordEdgeSet_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_11FordEdgeSet___reduce_cython__(((struct __pyx_obj_8CyOpenGL_FordEdgeSet *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_11FordEdgeSet___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_FordEdgeSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.FordEdgeSet.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_11FordEdgeSet_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_11FordEdgeSet_2__setstate_cython__[] = "FordEdgeSet.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_11FordEdgeSet_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_11FordEdgeSet_2__setstate_cython__(((struct __pyx_obj_8CyOpenGL_FordEdgeSet *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_11FordEdgeSet_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_FordEdgeSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.FordEdgeSet.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":774
 *     xy-plane in upper half-space.
 *     """
 *     def __init__(self, triangulation, longitude, meridian):             # <<<<<<<<<<<<<<
 *         self.segments = [D['endpoints'] for D in triangulation]
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_20TriangulationEdgeSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_20TriangulationEdgeSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_triangulation = 0;
  PyObject *__pyx_v_longitude = 0;
  PyObject *__pyx_v_meridian = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_triangulation,&__pyx_n_s_longitude,&__pyx_n_s_meridian,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_triangulation)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_longitude)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 774, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meridian)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 774, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 774, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_triangulation = values[0];
    __pyx_v_longitude = values[1];
    __pyx_v_meridian = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 774, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.TriangulationEdgeSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_20TriangulationEdgeSet___init__(((struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *)__pyx_v_self), __pyx_v_triangulation, __pyx_v_longitude, __pyx_v_meridian);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_20TriangulationEdgeSet___init__(struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self, PyObject *__pyx_v_triangulation, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian) {
  PyObject *__pyx_v_D = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":775
 *     """
 *     def __init__(self, triangulation, longitude, meridian):
 *         self.segments = [D['endpoints'] for D in triangulation]             # <<<<<<<<<<<<<<
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.stipple = False
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 775, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (likely(PyList_CheckExact(__pyx_v_triangulation)) || PyTuple_CheckExact(__pyx_v_triangulation)) {
    __pyx_t_2 = __pyx_v_triangulation; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_triangulation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 775, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 775, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 775, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 775, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 775, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 775, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_D, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_n_s_endpoints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 775, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 775, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.segments);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.segments);
  __pyx_v_self->__pyx_base.segments = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":776
 *     def __init__(self, triangulation, longitude, meridian):
 *         self.segments = [D['endpoints'] for D in triangulation]
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)             # <<<<<<<<<<<<<<
 *         self.stipple = False
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_v_longitude); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_v_meridian); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 776, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.longitude);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.longitude);
  __pyx_v_self->__pyx_base.longitude = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.meridian);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.meridian);
  __pyx_v_self->__pyx_base.meridian = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":777
 *         self.segments = [D['endpoints'] for D in triangulation]
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.stipple = False             # <<<<<<<<<<<<<<
 * 
 *     cdef set_light_color(self):
 */
  __Pyx_INCREF(Py_False);
  __Pyx_GIVEREF(Py_False);
  __Pyx_GOTREF(__pyx_v_self->__pyx_base.stipple);
  __Pyx_DECREF(__pyx_v_self->__pyx_base.stipple);
  __pyx_v_self->__pyx_base.stipple = Py_False;

  /* "CyOpenGL.pyx":774
 *     xy-plane in upper half-space.
 *     """
 *     def __init__(self, triangulation, longitude, meridian):             # <<<<<<<<<<<<<<
 *         self.segments = [D['endpoints'] for D in triangulation]
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.TriangulationEdgeSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_D);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":779
 *         self.stipple = False
 * 
 *     cdef set_light_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.6, 0.6, 0.6, 1.0)
 * 
 */

static PyObject *__pyx_f_8CyOpenGL_20TriangulationEdgeSet_set_light_color(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_light_color", 0);

  /* "CyOpenGL.pyx":780
 * 
 *     cdef set_light_color(self):
 *         glColor4f(0.6, 0.6, 0.6, 1.0)             # <<<<<<<<<<<<<<
 * 
 * cdef class Label:
 */
  glColor4f(0.6, 0.6, 0.6, 1.0);

  /* "CyOpenGL.pyx":779
 *         self.stipple = False
 * 
 *     cdef set_light_color(self):             # <<<<<<<<<<<<<<
 *         glColor4f(0.6, 0.6, 0.6, 1.0)
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_20TriangulationEdgeSet_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_20TriangulationEdgeSet_2__reduce_cython__[] = "TriangulationEdgeSet.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_20TriangulationEdgeSet_3__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_20TriangulationEdgeSet_2__reduce_cython__(((struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_20TriangulationEdgeSet_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.TriangulationEdgeSet.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_20TriangulationEdgeSet_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_20TriangulationEdgeSet_4__setstate_cython__[] = "TriangulationEdgeSet.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_20TriangulationEdgeSet_5__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_20TriangulationEdgeSet_4__setstate_cython__(((struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_20TriangulationEdgeSet_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.TriangulationEdgeSet.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":786
 *     cdef codes
 * 
 *     def __init__(self, position, int_label):             # <<<<<<<<<<<<<<
 *         self.x, self.y = position.real, position.imag
 *         self.codes = [ord(c) for c in repr(int_label)]
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_5Label_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_5Label_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_position = 0;
  PyObject *__pyx_v_int_label = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_position,&__pyx_n_s_int_label,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_position)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_int_label)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 786, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 786, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_position = values[0];
    __pyx_v_int_label = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 786, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.Label.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_5Label___init__(((struct __pyx_obj_8CyOpenGL_Label *)__pyx_v_self), __pyx_v_position, __pyx_v_int_label);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_5Label___init__(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self, PyObject *__pyx_v_position, PyObject *__pyx_v_int_label) {
  PyObject *__pyx_v_c = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  GLfloat __pyx_t_2;
  GLfloat __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *(*__pyx_t_6)(PyObject *);
  long __pyx_t_7;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":787
 * 
 *     def __init__(self, position, int_label):
 *         self.x, self.y = position.real, position.imag             # <<<<<<<<<<<<<<
 *         self.codes = [ord(c) for c in repr(int_label)]
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_position, __pyx_n_s_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_position, __pyx_n_s_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 787, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->x = __pyx_t_2;
  __pyx_v_self->y = __pyx_t_3;

  /* "CyOpenGL.pyx":788
 *     def __init__(self, position, int_label):
 *         self.x, self.y = position.real, position.imag
 *         self.codes = [ord(c) for c in repr(int_label)]             # <<<<<<<<<<<<<<
 * 
 *     cdef get_shape(self):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyObject_Repr(__pyx_v_int_label); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 788, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    {
      __pyx_t_4 = __pyx_t_6(__pyx_t_5);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 788, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_7 = __Pyx_PyObject_Ord(__pyx_v_c); if (unlikely(__pyx_t_7 == ((long)(long)(Py_UCS4)-1))) __PYX_ERR(0, 788, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 788, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) __PYX_ERR(0, 788, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->codes);
  __Pyx_DECREF(__pyx_v_self->codes);
  __pyx_v_self->codes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":786
 *     cdef codes
 * 
 *     def __init__(self, position, int_label):             # <<<<<<<<<<<<<<
 *         self.x, self.y = position.real, position.imag
 *         self.codes = [ord(c) for c in repr(int_label)]
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.Label.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":790
 *         self.codes = [ord(c) for c in repr(int_label)]
 * 
 *     cdef get_shape(self):             # <<<<<<<<<<<<<<
 *         cdef SnapPy_glyph* glyph
 *         width, height = 0, 0
 */

static PyObject *__pyx_f_8CyOpenGL_5Label_get_shape(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self) {
  SnapPy_glyph *__pyx_v_glyph;
  PyObject *__pyx_v_width = NULL;
  long __pyx_v_height;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("get_shape", 0);

  /* "CyOpenGL.pyx":792
 *     cdef get_shape(self):
 *         cdef SnapPy_glyph* glyph
 *         width, height = 0, 0             # <<<<<<<<<<<<<<
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]
 */
  __pyx_t_1 = __pyx_int_0;
  __Pyx_INCREF(__pyx_t_1);
  __pyx_t_2 = 0;
  __pyx_v_width = __pyx_t_1;
  __pyx_t_1 = 0;
  __pyx_v_height = __pyx_t_2;

  /* "CyOpenGL.pyx":793
 *         cdef SnapPy_glyph* glyph
 *         width, height = 0, 0
 *         for c in self.codes:             # <<<<<<<<<<<<<<
 *             glyph = SnapPy_font[c]
 *             width += glyph.width
 */
  if (likely(PyList_CheckExact(__pyx_v_self->codes)) || PyTuple_CheckExact(__pyx_v_self->codes)) {
    __pyx_t_1 = __pyx_v_self->codes; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->codes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 793, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 793, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 793, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 793, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 793, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 793, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":794
 *         width, height = 0, 0
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]             # <<<<<<<<<<<<<<
 *             width += glyph.width
 *             height = glyph.height
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_c); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 794, __pyx_L1_error)
    __pyx_v_glyph = (SnapPy_font[__pyx_t_6]);

    /* "CyOpenGL.pyx":795
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]
 *             width += glyph.width             # <<<<<<<<<<<<<<
 *             height = glyph.height
 *         return width, height
 */
    __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_glyph->width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = PyNumber_InPlaceAdd(__pyx_v_width, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 795, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF_SET(__pyx_v_width, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "CyOpenGL.pyx":796
 *             glyph = SnapPy_font[c]
 *             width += glyph.width
 *             height = glyph.height             # <<<<<<<<<<<<<<
 *         return width, height
 * 
 */
    __pyx_t_8 = __pyx_v_glyph->height;
    __pyx_v_height = __pyx_t_8;

    /* "CyOpenGL.pyx":793
 *         cdef SnapPy_glyph* glyph
 *         width, height = 0, 0
 *         for c in self.codes:             # <<<<<<<<<<<<<<
 *             glyph = SnapPy_font[c]
 *             width += glyph.width
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":797
 *             width += glyph.width
 *             height = glyph.height
 *         return width, height             # <<<<<<<<<<<<<<
 * 
 *     def draw(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_height); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 797, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_INCREF(__pyx_v_width);
  __Pyx_GIVEREF(__pyx_v_width);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_width);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_7;
  __pyx_t_7 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":790
 *         self.codes = [ord(c) for c in repr(int_label)]
 * 
 *     cdef get_shape(self):             # <<<<<<<<<<<<<<
 *         cdef SnapPy_glyph* glyph
 *         width, height = 0, 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.Label.get_shape", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":799
 *         return width, height
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         cdef SnapPy_glyph* glyph
 *         glRasterPos2f(self.x, self.y)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_5Label_3draw(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_5Label_2draw[] = "Label.draw(self)";
static PyObject *__pyx_pw_8CyOpenGL_5Label_3draw(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_5Label_2draw(((struct __pyx_obj_8CyOpenGL_Label *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_5Label_2draw(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self) {
  SnapPy_glyph *__pyx_v_glyph;
  PyObject *__pyx_v_width = NULL;
  PyObject *__pyx_v_height = NULL;
  PyObject *__pyx_v_c = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  GLfloat __pyx_t_6;
  GLfloat __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "CyOpenGL.pyx":801
 *     def draw(self):
 *         cdef SnapPy_glyph* glyph
 *         glRasterPos2f(self.x, self.y)             # <<<<<<<<<<<<<<
 *         width, height = self.get_shape()
 *         # This is a trick to move the raster position in units of 1 pixel
 */
  glRasterPos2f(__pyx_v_self->x, __pyx_v_self->y);

  /* "CyOpenGL.pyx":802
 *         cdef SnapPy_glyph* glyph
 *         glRasterPos2f(self.x, self.y)
 *         width, height = self.get_shape()             # <<<<<<<<<<<<<<
 *         # This is a trick to move the raster position in units of 1 pixel
 *         glBitmap(0, 0, 0, 0, -width/2, -height/2, NULL)
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_Label *)__pyx_v_self->__pyx_vtab)->get_shape(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 802, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 802, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_3 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_3);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 802, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_3);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) __PYX_ERR(0, 802, __pyx_L1_error)
    __pyx_t_5 = NULL;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 802, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_width = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_height = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":804
 *         width, height = self.get_shape()
 *         # This is a trick to move the raster position in units of 1 pixel
 *         glBitmap(0, 0, 0, 0, -width/2, -height/2, NULL)             # <<<<<<<<<<<<<<
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]
 */
  __pyx_t_1 = PyNumber_Negative(__pyx_v_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_int_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Negative(__pyx_v_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_7 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 804, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glBitmap(0, 0, 0.0, 0.0, __pyx_t_6, __pyx_t_7, NULL);

  /* "CyOpenGL.pyx":805
 *         # This is a trick to move the raster position in units of 1 pixel
 *         glBitmap(0, 0, 0, 0, -width/2, -height/2, NULL)
 *         for c in self.codes:             # <<<<<<<<<<<<<<
 *             glyph = SnapPy_font[c]
 *             if glyph != NULL:
 */
  if (likely(PyList_CheckExact(__pyx_v_self->codes)) || PyTuple_CheckExact(__pyx_v_self->codes)) {
    __pyx_t_1 = __pyx_v_self->codes; __Pyx_INCREF(__pyx_t_1); __pyx_t_8 = 0;
    __pyx_t_9 = NULL;
  } else {
    __pyx_t_8 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_self->codes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 805, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 805, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_9)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 805, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_8); __Pyx_INCREF(__pyx_t_3); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 805, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 805, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_9(__pyx_t_1);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 805, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_c, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":806
 *         glBitmap(0, 0, 0, 0, -width/2, -height/2, NULL)
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]             # <<<<<<<<<<<<<<
 *             if glyph != NULL:
 *                 glDrawPixels(glyph.width, glyph.height,
 */
    __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_c); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 806, __pyx_L1_error)
    __pyx_v_glyph = (SnapPy_font[__pyx_t_10]);

    /* "CyOpenGL.pyx":807
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]
 *             if glyph != NULL:             # <<<<<<<<<<<<<<
 *                 glDrawPixels(glyph.width, glyph.height,
 *                              GL_RGBA, GL_UNSIGNED_BYTE,
 */
    __pyx_t_11 = ((__pyx_v_glyph != NULL) != 0);
    if (__pyx_t_11) {

      /* "CyOpenGL.pyx":808
 *             glyph = SnapPy_font[c]
 *             if glyph != NULL:
 *                 glDrawPixels(glyph.width, glyph.height,             # <<<<<<<<<<<<<<
 *                              GL_RGBA, GL_UNSIGNED_BYTE,
 *                              <GLvoid*> glyph.pixel_data)
 */
      glDrawPixels(__pyx_v_glyph->width, __pyx_v_glyph->height, GL_RGBA, GL_UNSIGNED_BYTE, ((GLvoid *)__pyx_v_glyph->pixel_data));

      /* "CyOpenGL.pyx":811
 *                              GL_RGBA, GL_UNSIGNED_BYTE,
 *                              <GLvoid*> glyph.pixel_data)
 *                 glBitmap(0, 0, 0, 0, glyph.width, 0, NULL)             # <<<<<<<<<<<<<<
 * 
 * cdef class LabelSet(GLobject):
 */
      glBitmap(0, 0, 0.0, 0.0, __pyx_v_glyph->width, 0.0, NULL);

      /* "CyOpenGL.pyx":807
 *         for c in self.codes:
 *             glyph = SnapPy_font[c]
 *             if glyph != NULL:             # <<<<<<<<<<<<<<
 *                 glDrawPixels(glyph.width, glyph.height,
 *                              GL_RGBA, GL_UNSIGNED_BYTE,
 */
    }

    /* "CyOpenGL.pyx":805
 *         # This is a trick to move the raster position in units of 1 pixel
 *         glBitmap(0, 0, 0, 0, -width/2, -height/2, NULL)
 *         for c in self.codes:             # <<<<<<<<<<<<<<
 *             glyph = SnapPy_font[c]
 *             if glyph != NULL:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":799
 *         return width, height
 * 
 *     def draw(self):             # <<<<<<<<<<<<<<
 *         cdef SnapPy_glyph* glyph
 *         glRasterPos2f(self.x, self.y)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("CyOpenGL.Label.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_width);
  __Pyx_XDECREF(__pyx_v_height);
  __Pyx_XDECREF(__pyx_v_c);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_5Label_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_5Label_4__reduce_cython__[] = "Label.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_5Label_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_5Label_4__reduce_cython__(((struct __pyx_obj_8CyOpenGL_Label *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_5Label_4__reduce_cython__(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.codes, self.x, self.y)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->x); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->y); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_v_self->codes);
  __Pyx_GIVEREF(__pyx_v_self->codes);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->codes);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_3);
  __pyx_t_3 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.codes, self.x, self.y)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_v__dict = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":7
 *     state = (self.codes, self.x, self.y)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_4 = (__pyx_v__dict != Py_None);
  __pyx_t_5 = (__pyx_t_4 != 0);
  if (__pyx_t_5) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
    __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
    __pyx_t_2 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.codes is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.codes, self.x, self.y)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.codes is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_Label, (type(self), 0x8c950d7, None), state
 */
  /*else*/ {
    __pyx_t_5 = (__pyx_v_self->codes != Py_None);
    __pyx_v_use_setstate = __pyx_t_5;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.codes is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Label, (type(self), 0x8c950d7, None), state
 *     else:
 */
  __pyx_t_5 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_5) {

    /* "(tree fragment)":13
 *         use_setstate = self.codes is not None
 *     if use_setstate:
 *         return __pyx_unpickle_Label, (type(self), 0x8c950d7, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_Label, (type(self), 0x8c950d7, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_pyx_unpickle_Label); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_147411159);
    __Pyx_GIVEREF(__pyx_int_147411159);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_147411159);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
    __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
    __pyx_t_2 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.codes is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_Label, (type(self), 0x8c950d7, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_Label, (type(self), 0x8c950d7, None), state
 *     else:
 *         return __pyx_unpickle_Label, (type(self), 0x8c950d7, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Label__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_Label); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_147411159);
    __Pyx_GIVEREF(__pyx_int_147411159);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_147411159);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
    __pyx_t_1 = 0;
    __pyx_t_3 = 0;
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.Label.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Label, (type(self), 0x8c950d7, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Label__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_5Label_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_5Label_6__setstate_cython__[] = "Label.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_5Label_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_5Label_6__setstate_cython__(((struct __pyx_obj_8CyOpenGL_Label *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_5Label_6__setstate_cython__(struct __pyx_obj_8CyOpenGL_Label *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_Label, (type(self), 0x8c950d7, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_Label__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_8CyOpenGL___pyx_unpickle_Label__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_Label, (type(self), 0x8c950d7, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_Label__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.Label.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":822
 *     cdef int width, height
 * 
 *     def __init__(self, triangulation, longitude, meridian):             # <<<<<<<<<<<<<<
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_8LabelSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_8LabelSet_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_triangulation = 0;
  PyObject *__pyx_v_longitude = 0;
  PyObject *__pyx_v_meridian = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_triangulation,&__pyx_n_s_longitude,&__pyx_n_s_meridian,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_triangulation)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_longitude)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 1); __PYX_ERR(0, 822, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_meridian)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, 2); __PYX_ERR(0, 822, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 822, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_triangulation = values[0];
    __pyx_v_longitude = values[1];
    __pyx_v_meridian = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 822, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.LabelSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_8LabelSet___init__(((struct __pyx_obj_8CyOpenGL_LabelSet *)__pyx_v_self), __pyx_v_triangulation, __pyx_v_longitude, __pyx_v_meridian);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_8LabelSet___init__(struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self, PyObject *__pyx_v_triangulation, PyObject *__pyx_v_longitude, PyObject *__pyx_v_meridian) {
  PyObject *__pyx_v_vertices = NULL;
  PyObject *__pyx_v_D = NULL;
  PyObject *__pyx_v_v = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":823
 * 
 *     def __init__(self, triangulation, longitude, meridian):
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)             # <<<<<<<<<<<<<<
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])
 *                           for D in triangulation]
 */
  __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_v_longitude); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_v_meridian); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 823, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->longitude);
  __Pyx_DECREF(__pyx_v_self->longitude);
  __pyx_v_self->longitude = __pyx_t_1;
  __pyx_t_1 = 0;
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->meridian);
  __Pyx_DECREF(__pyx_v_self->meridian);
  __pyx_v_self->meridian = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":824
 *     def __init__(self, triangulation, longitude, meridian):
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])             # <<<<<<<<<<<<<<
 *                           for D in triangulation]
 * 
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "CyOpenGL.pyx":825
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])
 *                           for D in triangulation]             # <<<<<<<<<<<<<<
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 */
  if (likely(PyList_CheckExact(__pyx_v_triangulation)) || PyTuple_CheckExact(__pyx_v_triangulation)) {
    __pyx_t_1 = __pyx_v_triangulation; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 825, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 825, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 825, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 825, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 825, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 825, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 825, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_D, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":824
 *     def __init__(self, triangulation, longitude, meridian):
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])             # <<<<<<<<<<<<<<
 *                           for D in triangulation]
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_n_s_endpoints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_builtin_sum, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_6, __pyx_int_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_7);
    __pyx_t_5 = 0;
    __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_Label), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 824, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "CyOpenGL.pyx":825
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])
 *                           for D in triangulation]             # <<<<<<<<<<<<<<
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":824
 *     def __init__(self, triangulation, longitude, meridian):
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])             # <<<<<<<<<<<<<<
 *                           for D in triangulation]
 * 
 */
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->segments);
  __Pyx_DECREF(__pyx_v_self->segments);
  __pyx_v_self->segments = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":827
 *                           for D in triangulation]
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))             # <<<<<<<<<<<<<<
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 827, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "CyOpenGL.pyx":828
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 *                      for D in triangulation]             # <<<<<<<<<<<<<<
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 *                       for D in triangulation]
 */
  if (likely(PyList_CheckExact(__pyx_v_triangulation)) || PyTuple_CheckExact(__pyx_v_triangulation)) {
    __pyx_t_1 = __pyx_v_triangulation; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 828, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 828, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 828, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 828, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 828, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_D, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "CyOpenGL.pyx":827
 *                           for D in triangulation]
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))             # <<<<<<<<<<<<<<
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 */
    __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_n_s_endpoints); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_7, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_6, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 827, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_6);
    __pyx_t_7 = 0;
    __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 827, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":828
 * 
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 *                      for D in triangulation]             # <<<<<<<<<<<<<<
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 *                       for D in triangulation]
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_vertices = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":829
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))             # <<<<<<<<<<<<<<
 *                       for D in triangulation]
 *         self.vertices = [Label(*v) for v in set(vertices)]
 */
  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "CyOpenGL.pyx":830
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 *                       for D in triangulation]             # <<<<<<<<<<<<<<
 *         self.vertices = [Label(*v) for v in set(vertices)]
 * 
 */
  if (likely(PyList_CheckExact(__pyx_v_triangulation)) || PyTuple_CheckExact(__pyx_v_triangulation)) {
    __pyx_t_1 = __pyx_v_triangulation; __Pyx_INCREF(__pyx_t_1); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_triangulation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 830, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 830, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 830, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 830, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_D, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":829
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))             # <<<<<<<<<<<<<<
 *                       for D in triangulation]
 *         self.vertices = [Label(*v) for v in set(vertices)]
 */
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_n_s_endpoints); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_D, __pyx_n_s_indices); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_6, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PyNumber_Int(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
    __pyx_t_5 = 0;
    __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 829, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "CyOpenGL.pyx":830
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 *                       for D in triangulation]             # <<<<<<<<<<<<<<
 *         self.vertices = [Label(*v) for v in set(vertices)]
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":829
 *         vertices = [ (complex(D['endpoints'][0]), int(D['indices'][0]))
 *                      for D in triangulation]
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))             # <<<<<<<<<<<<<<
 *                       for D in triangulation]
 *         self.vertices = [Label(*v) for v in set(vertices)]
 */
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_vertices, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 829, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF_SET(__pyx_v_vertices, ((PyObject*)__pyx_t_1));
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":831
 *         vertices += [ (complex(D['endpoints'][1]), int(D['indices'][2]))
 *                       for D in triangulation]
 *         self.vertices = [Label(*v) for v in set(vertices)]             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, shifts):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = 0;
  __pyx_t_7 = PySet_New(__pyx_v_vertices); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = __Pyx_set_iterator(__pyx_t_7, 1, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_XDECREF(__pyx_t_2);
  __pyx_t_2 = __pyx_t_6;
  __pyx_t_6 = 0;
  while (1) {
    __pyx_t_10 = __Pyx_set_iter_next(__pyx_t_2, __pyx_t_8, &__pyx_t_3, &__pyx_t_6, __pyx_t_9);
    if (unlikely(__pyx_t_10 == 0)) break;
    if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_XDECREF_SET(__pyx_v_v, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_6 = __Pyx_PySequence_Tuple(__pyx_v_v); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_Label), __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 831, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_7))) __PYX_ERR(0, 831, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->vertices);
  __Pyx_DECREF(__pyx_v_self->vertices);
  __pyx_v_self->vertices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":822
 *     cdef int width, height
 * 
 *     def __init__(self, triangulation, longitude, meridian):             # <<<<<<<<<<<<<<
 *         self.longitude, self.meridian = complex(longitude), complex(meridian)
 *         self.segments = [ Label(sum(D['endpoints'])/2, D['indices'][1])
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.LabelSet.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vertices);
  __Pyx_XDECREF(__pyx_v_D);
  __Pyx_XDECREF(__pyx_v_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":833
 *         self.vertices = [Label(*v) for v in set(vertices)]
 * 
 *     def draw(self, shifts):             # <<<<<<<<<<<<<<
 *         glRasterPos3f(0.0, 0.0, 0.0)
 *         for M, L in shifts:
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8LabelSet_3draw(PyObject *__pyx_v_self, PyObject *__pyx_v_shifts); /*proto*/
static char __pyx_doc_8CyOpenGL_8LabelSet_2draw[] = "LabelSet.draw(self, shifts)";
static PyObject *__pyx_pw_8CyOpenGL_8LabelSet_3draw(PyObject *__pyx_v_self, PyObject *__pyx_v_shifts) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_8LabelSet_2draw(((struct __pyx_obj_8CyOpenGL_LabelSet *)__pyx_v_self), ((PyObject *)__pyx_v_shifts));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_8LabelSet_2draw(struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self, PyObject *__pyx_v_shifts) {
  PyObject *__pyx_v_M = NULL;
  PyObject *__pyx_v_L = NULL;
  PyObject *__pyx_v_disp = NULL;
  PyObject *__pyx_v_labels = NULL;
  PyObject *__pyx_v_label = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  GLfloat __pyx_t_9;
  GLfloat __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *(*__pyx_t_13)(PyObject *);
  PyObject *__pyx_t_14 = NULL;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "CyOpenGL.pyx":834
 * 
 *     def draw(self, shifts):
 *         glRasterPos3f(0.0, 0.0, 0.0)             # <<<<<<<<<<<<<<
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude
 */
  glRasterPos3f(0.0, 0.0, 0.0);

  /* "CyOpenGL.pyx":835
 *     def draw(self, shifts):
 *         glRasterPos3f(0.0, 0.0, 0.0)
 *         for M, L in shifts:             # <<<<<<<<<<<<<<
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
 */
  if (likely(PyList_CheckExact(__pyx_v_shifts)) || PyTuple_CheckExact(__pyx_v_shifts)) {
    __pyx_t_1 = __pyx_v_shifts; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_shifts); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 835, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 835, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 835, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
      PyObject* sequence = __pyx_t_4;
      Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
      if (unlikely(size != 2)) {
        if (size > 2) __Pyx_RaiseTooManyValuesError(2);
        else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
        __PYX_ERR(0, 835, __pyx_L1_error)
      }
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      if (likely(PyTuple_CheckExact(sequence))) {
        __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
      } else {
        __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
        __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
      }
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      #else
      __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      #endif
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      Py_ssize_t index = -1;
      __pyx_t_7 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 835, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
      index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_5);
      index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
      __Pyx_GOTREF(__pyx_t_6);
      if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 835, __pyx_L1_error)
      __pyx_t_8 = NULL;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_unpacking_done;
      __pyx_L5_unpacking_failed:;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_8 = NULL;
      if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
      __PYX_ERR(0, 835, __pyx_L1_error)
      __pyx_L6_unpacking_done:;
    }
    __Pyx_XDECREF_SET(__pyx_v_M, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_L, __pyx_t_6);
    __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":836
 *         glRasterPos3f(0.0, 0.0, 0.0)
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
 */
    __pyx_t_4 = PyNumber_Multiply(__pyx_v_M, __pyx_v_self->meridian); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = PyNumber_Multiply(__pyx_v_L, __pyx_v_self->longitude); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 836, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF_SET(__pyx_v_disp, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":837
 *         for M, L in shifts:
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()             # <<<<<<<<<<<<<<
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for labels in (self.segments, self.vertices):
 */
    glPushMatrix();

    /* "CyOpenGL.pyx":838
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)             # <<<<<<<<<<<<<<
 *             for labels in (self.segments, self.vertices):
 *                 for label in labels:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_n_s_real); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_9 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 838, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_disp, __pyx_n_s_imag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_10 = __pyx_PyFloat_AsFloat(__pyx_t_5); if (unlikely((__pyx_t_10 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 838, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    glTranslatef(__pyx_t_9, __pyx_t_10, 0.0);

    /* "CyOpenGL.pyx":839
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for labels in (self.segments, self.vertices):             # <<<<<<<<<<<<<<
 *                 for label in labels:
 *                     label.draw()
 */
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 839, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_self->segments);
    __Pyx_GIVEREF(__pyx_v_self->segments);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_self->segments);
    __Pyx_INCREF(__pyx_v_self->vertices);
    __Pyx_GIVEREF(__pyx_v_self->vertices);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_self->vertices);
    __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    for (;;) {
      if (__pyx_t_11 >= 2) break;
      #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_11); __Pyx_INCREF(__pyx_t_5); __pyx_t_11++; if (unlikely(0 < 0)) __PYX_ERR(0, 839, __pyx_L1_error)
      #else
      __pyx_t_5 = PySequence_ITEM(__pyx_t_6, __pyx_t_11); __pyx_t_11++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      #endif
      __Pyx_XDECREF_SET(__pyx_v_labels, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "CyOpenGL.pyx":840
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for labels in (self.segments, self.vertices):
 *                 for label in labels:             # <<<<<<<<<<<<<<
 *                     label.draw()
 *             glPopMatrix()
 */
      if (likely(PyList_CheckExact(__pyx_v_labels)) || PyTuple_CheckExact(__pyx_v_labels)) {
        __pyx_t_5 = __pyx_v_labels; __Pyx_INCREF(__pyx_t_5); __pyx_t_12 = 0;
        __pyx_t_13 = NULL;
      } else {
        __pyx_t_12 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_labels); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 840, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_13 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 840, __pyx_L1_error)
      }
      for (;;) {
        if (likely(!__pyx_t_13)) {
          if (likely(PyList_CheckExact(__pyx_t_5))) {
            if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 840, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          } else {
            if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_12); __Pyx_INCREF(__pyx_t_4); __pyx_t_12++; if (unlikely(0 < 0)) __PYX_ERR(0, 840, __pyx_L1_error)
            #else
            __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 840, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            #endif
          }
        } else {
          __pyx_t_4 = __pyx_t_13(__pyx_t_5);
          if (unlikely(!__pyx_t_4)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 840, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_4);
        }
        __Pyx_XDECREF_SET(__pyx_v_label, __pyx_t_4);
        __pyx_t_4 = 0;

        /* "CyOpenGL.pyx":841
 *             for labels in (self.segments, self.vertices):
 *                 for label in labels:
 *                     label.draw()             # <<<<<<<<<<<<<<
 *             glPopMatrix()
 * 
 */
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_label, __pyx_n_s_draw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 841, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_14 = NULL;
        if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
          __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_7);
          if (likely(__pyx_t_14)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
            __Pyx_INCREF(__pyx_t_14);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_7, function);
          }
        }
        __pyx_t_4 = (__pyx_t_14) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_14) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
        __Pyx_XDECREF(__pyx_t_14); __pyx_t_14 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 841, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

        /* "CyOpenGL.pyx":840
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for labels in (self.segments, self.vertices):
 *                 for label in labels:             # <<<<<<<<<<<<<<
 *                     label.draw()
 *             glPopMatrix()
 */
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "CyOpenGL.pyx":839
 *             glPushMatrix()
 *             glTranslatef(disp.real, disp.imag, 0.0)
 *             for labels in (self.segments, self.vertices):             # <<<<<<<<<<<<<<
 *                 for label in labels:
 *                     label.draw()
 */
    }
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":842
 *                 for label in labels:
 *                     label.draw()
 *             glPopMatrix()             # <<<<<<<<<<<<<<
 * 
 * cdef class HoroballScene:
 */
    glPopMatrix();

    /* "CyOpenGL.pyx":835
 *     def draw(self, shifts):
 *         glRasterPos3f(0.0, 0.0, 0.0)
 *         for M, L in shifts:             # <<<<<<<<<<<<<<
 *             disp = M*self.meridian + L*self.longitude
 *             glPushMatrix()
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":833
 *         self.vertices = [Label(*v) for v in set(vertices)]
 * 
 *     def draw(self, shifts):             # <<<<<<<<<<<<<<
 *         glRasterPos3f(0.0, 0.0, 0.0)
 *         for M, L in shifts:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_14);
  __Pyx_AddTraceback("CyOpenGL.LabelSet.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_M);
  __Pyx_XDECREF(__pyx_v_L);
  __Pyx_XDECREF(__pyx_v_disp);
  __Pyx_XDECREF(__pyx_v_labels);
  __Pyx_XDECREF(__pyx_v_label);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8LabelSet_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_8LabelSet_4__reduce_cython__[] = "LabelSet.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_8LabelSet_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_8LabelSet_4__reduce_cython__(((struct __pyx_obj_8CyOpenGL_LabelSet *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_8LabelSet_4__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.LabelSet.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_8LabelSet_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_8LabelSet_6__setstate_cython__[] = "LabelSet.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_8LabelSet_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_8LabelSet_6__setstate_cython__(((struct __pyx_obj_8CyOpenGL_LabelSet *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_8LabelSet_6__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_LabelSet *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.LabelSet.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":862
 *     cdef int which_cusp
 * 
 *     def __init__(self, nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var,             # <<<<<<<<<<<<<<
 *                  flipped=False, cutoff=0.1, which_cusp=0):
 *         self.nbhd = nbhd
 */

/* Python wrapper */
static int __pyx_pw_8CyOpenGL_13HoroballScene_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_8CyOpenGL_13HoroballScene_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_nbhd = 0;
  PyObject *__pyx_v_pgram_var = 0;
  PyObject *__pyx_v_Ford_var = 0;
  PyObject *__pyx_v_tri_var = 0;
  PyObject *__pyx_v_horo_var = 0;
  PyObject *__pyx_v_label_var = 0;
  PyObject *__pyx_v_flipped = 0;
  PyObject *__pyx_v_cutoff = 0;
  PyObject *__pyx_v_which_cusp = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nbhd,&__pyx_n_s_pgram_var,&__pyx_n_s_Ford_var,&__pyx_n_s_tri_var,&__pyx_n_s_horo_var,&__pyx_n_s_label_var,&__pyx_n_s_flipped,&__pyx_n_s_cutoff,&__pyx_n_s_which_cusp,0};
    PyObject* values[9] = {0,0,0,0,0,0,0,0,0};

    /* "CyOpenGL.pyx":863
 * 
 *     def __init__(self, nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var,
 *                  flipped=False, cutoff=0.1, which_cusp=0):             # <<<<<<<<<<<<<<
 *         self.nbhd = nbhd
 *         self.which_cusp = which_cusp
 */
    values[6] = ((PyObject *)Py_False);
    values[7] = ((PyObject *)__pyx_float_0_1);
    values[8] = ((PyObject *)__pyx_int_0);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nbhd)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pgram_var)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 9, 1); __PYX_ERR(0, 862, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_Ford_var)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 9, 2); __PYX_ERR(0, 862, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_tri_var)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 9, 3); __PYX_ERR(0, 862, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_horo_var)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 9, 4); __PYX_ERR(0, 862, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_label_var)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 9, 5); __PYX_ERR(0, 862, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flipped);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cutoff);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[8] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 862, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_nbhd = values[0];
    __pyx_v_pgram_var = values[1];
    __pyx_v_Ford_var = values[2];
    __pyx_v_tri_var = values[3];
    __pyx_v_horo_var = values[4];
    __pyx_v_label_var = values[5];
    __pyx_v_flipped = values[6];
    __pyx_v_cutoff = values[7];
    __pyx_v_which_cusp = values[8];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 6, 9, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 862, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene___init__(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), __pyx_v_nbhd, __pyx_v_pgram_var, __pyx_v_Ford_var, __pyx_v_tri_var, __pyx_v_horo_var, __pyx_v_label_var, __pyx_v_flipped, __pyx_v_cutoff, __pyx_v_which_cusp);

  /* "CyOpenGL.pyx":862
 *     cdef int which_cusp
 * 
 *     def __init__(self, nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var,             # <<<<<<<<<<<<<<
 *                  flipped=False, cutoff=0.1, which_cusp=0):
 *         self.nbhd = nbhd
 */

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_8CyOpenGL_13HoroballScene___init__(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_nbhd, PyObject *__pyx_v_pgram_var, PyObject *__pyx_v_Ford_var, PyObject *__pyx_v_tri_var, PyObject *__pyx_v_horo_var, PyObject *__pyx_v_label_var, PyObject *__pyx_v_flipped, PyObject *__pyx_v_cutoff, PyObject *__pyx_v_which_cusp) {
  PyObject *__pyx_v_base = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  double __pyx_t_3;
  double __pyx_t_4;
  GLuint __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":864
 *     def __init__(self, nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var,
 *                  flipped=False, cutoff=0.1, which_cusp=0):
 *         self.nbhd = nbhd             # <<<<<<<<<<<<<<
 *         self.which_cusp = which_cusp
 *         self.flipped = flipped
 */
  __Pyx_INCREF(__pyx_v_nbhd);
  __Pyx_GIVEREF(__pyx_v_nbhd);
  __Pyx_GOTREF(__pyx_v_self->nbhd);
  __Pyx_DECREF(__pyx_v_self->nbhd);
  __pyx_v_self->nbhd = __pyx_v_nbhd;

  /* "CyOpenGL.pyx":865
 *                  flipped=False, cutoff=0.1, which_cusp=0):
 *         self.nbhd = nbhd
 *         self.which_cusp = which_cusp             # <<<<<<<<<<<<<<
 *         self.flipped = flipped
 *         self.tri_var = tri_var
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L1_error)
  __pyx_v_self->which_cusp = __pyx_t_1;

  /* "CyOpenGL.pyx":866
 *         self.nbhd = nbhd
 *         self.which_cusp = which_cusp
 *         self.flipped = flipped             # <<<<<<<<<<<<<<
 *         self.tri_var = tri_var
 *         self.Ford_var = Ford_var
 */
  __Pyx_INCREF(__pyx_v_flipped);
  __Pyx_GIVEREF(__pyx_v_flipped);
  __Pyx_GOTREF(__pyx_v_self->flipped);
  __Pyx_DECREF(__pyx_v_self->flipped);
  __pyx_v_self->flipped = __pyx_v_flipped;

  /* "CyOpenGL.pyx":867
 *         self.which_cusp = which_cusp
 *         self.flipped = flipped
 *         self.tri_var = tri_var             # <<<<<<<<<<<<<<
 *         self.Ford_var = Ford_var
 *         self.pgram_var = pgram_var
 */
  __Pyx_INCREF(__pyx_v_tri_var);
  __Pyx_GIVEREF(__pyx_v_tri_var);
  __Pyx_GOTREF(__pyx_v_self->tri_var);
  __Pyx_DECREF(__pyx_v_self->tri_var);
  __pyx_v_self->tri_var = __pyx_v_tri_var;

  /* "CyOpenGL.pyx":868
 *         self.flipped = flipped
 *         self.tri_var = tri_var
 *         self.Ford_var = Ford_var             # <<<<<<<<<<<<<<
 *         self.pgram_var = pgram_var
 *         self.horo_var = horo_var
 */
  __Pyx_INCREF(__pyx_v_Ford_var);
  __Pyx_GIVEREF(__pyx_v_Ford_var);
  __Pyx_GOTREF(__pyx_v_self->Ford_var);
  __Pyx_DECREF(__pyx_v_self->Ford_var);
  __pyx_v_self->Ford_var = __pyx_v_Ford_var;

  /* "CyOpenGL.pyx":869
 *         self.tri_var = tri_var
 *         self.Ford_var = Ford_var
 *         self.pgram_var = pgram_var             # <<<<<<<<<<<<<<
 *         self.horo_var = horo_var
 *         self.label_var = label_var
 */
  __Pyx_INCREF(__pyx_v_pgram_var);
  __Pyx_GIVEREF(__pyx_v_pgram_var);
  __Pyx_GOTREF(__pyx_v_self->pgram_var);
  __Pyx_DECREF(__pyx_v_self->pgram_var);
  __pyx_v_self->pgram_var = __pyx_v_pgram_var;

  /* "CyOpenGL.pyx":870
 *         self.Ford_var = Ford_var
 *         self.pgram_var = pgram_var
 *         self.horo_var = horo_var             # <<<<<<<<<<<<<<
 *         self.label_var = label_var
 *         self.offset = 0.0j
 */
  __Pyx_INCREF(__pyx_v_horo_var);
  __Pyx_GIVEREF(__pyx_v_horo_var);
  __Pyx_GOTREF(__pyx_v_self->horo_var);
  __Pyx_DECREF(__pyx_v_self->horo_var);
  __pyx_v_self->horo_var = __pyx_v_horo_var;

  /* "CyOpenGL.pyx":871
 *         self.pgram_var = pgram_var
 *         self.horo_var = horo_var
 *         self.label_var = label_var             # <<<<<<<<<<<<<<
 *         self.offset = 0.0j
 *         self.Xangle, self.Yangle = 0.0, 0.0
 */
  __Pyx_INCREF(__pyx_v_label_var);
  __Pyx_GIVEREF(__pyx_v_label_var);
  __Pyx_GOTREF(__pyx_v_self->label_var);
  __Pyx_DECREF(__pyx_v_self->label_var);
  __pyx_v_self->label_var = __pyx_v_label_var;

  /* "CyOpenGL.pyx":872
 *         self.horo_var = horo_var
 *         self.label_var = label_var
 *         self.offset = 0.0j             # <<<<<<<<<<<<<<
 *         self.Xangle, self.Yangle = 0.0, 0.0
 *         self.pgram_list_id = base = glGenLists(7)
 */
  __pyx_t_2 = PyComplex_FromDoubles(0.0, 0.0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 872, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->offset);
  __Pyx_DECREF(__pyx_v_self->offset);
  __pyx_v_self->offset = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":873
 *         self.label_var = label_var
 *         self.offset = 0.0j
 *         self.Xangle, self.Yangle = 0.0, 0.0             # <<<<<<<<<<<<<<
 *         self.pgram_list_id = base = glGenLists(7)
 *         self.ball_list_id = base + 1
 */
  __pyx_t_3 = 0.0;
  __pyx_t_4 = 0.0;
  __pyx_v_self->Xangle = __pyx_t_3;
  __pyx_v_self->Yangle = __pyx_t_4;

  /* "CyOpenGL.pyx":874
 *         self.offset = 0.0j
 *         self.Xangle, self.Yangle = 0.0, 0.0
 *         self.pgram_list_id = base = glGenLists(7)             # <<<<<<<<<<<<<<
 *         self.ball_list_id = base + 1
 *         self.Ford_light_list_id = base + 2
 */
  __pyx_t_5 = glGenLists(7);
  __pyx_t_2 = __Pyx_PyInt_From_GLuint(__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 874, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v_self->pgram_list_id = __pyx_t_5;
  __Pyx_INCREF(__pyx_t_2);
  __pyx_v_base = __pyx_t_2;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":875
 *         self.Xangle, self.Yangle = 0.0, 0.0
 *         self.pgram_list_id = base = glGenLists(7)
 *         self.ball_list_id = base + 1             # <<<<<<<<<<<<<<
 *         self.Ford_light_list_id = base + 2
 *         self.Ford_dark_list_id = base + 3
 */
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_base, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_As_GLuint(__pyx_t_2); if (unlikely((__pyx_t_5 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 875, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->ball_list_id = __pyx_t_5;

  /* "CyOpenGL.pyx":876
 *         self.pgram_list_id = base = glGenLists(7)
 *         self.ball_list_id = base + 1
 *         self.Ford_light_list_id = base + 2             # <<<<<<<<<<<<<<
 *         self.Ford_dark_list_id = base + 3
 *         self.tri_light_list_id = base + 4
 */
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_base, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_As_GLuint(__pyx_t_2); if (unlikely((__pyx_t_5 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->Ford_light_list_id = __pyx_t_5;

  /* "CyOpenGL.pyx":877
 *         self.ball_list_id = base + 1
 *         self.Ford_light_list_id = base + 2
 *         self.Ford_dark_list_id = base + 3             # <<<<<<<<<<<<<<
 *         self.tri_light_list_id = base + 4
 *         self.tri_dark_list_id = base + 5
 */
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_base, __pyx_int_3, 3, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 877, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_As_GLuint(__pyx_t_2); if (unlikely((__pyx_t_5 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 877, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->Ford_dark_list_id = __pyx_t_5;

  /* "CyOpenGL.pyx":878
 *         self.Ford_light_list_id = base + 2
 *         self.Ford_dark_list_id = base + 3
 *         self.tri_light_list_id = base + 4             # <<<<<<<<<<<<<<
 *         self.tri_dark_list_id = base + 5
 *         self.labels_list_id = base + 6
 */
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_base, __pyx_int_4, 4, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_As_GLuint(__pyx_t_2); if (unlikely((__pyx_t_5 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 878, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->tri_light_list_id = __pyx_t_5;

  /* "CyOpenGL.pyx":879
 *         self.Ford_dark_list_id = base + 3
 *         self.tri_light_list_id = base + 4
 *         self.tri_dark_list_id = base + 5             # <<<<<<<<<<<<<<
 *         self.labels_list_id = base + 6
 *         self.set_cutoff(cutoff)
 */
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_base, __pyx_int_5, 5, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_As_GLuint(__pyx_t_2); if (unlikely((__pyx_t_5 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 879, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->tri_dark_list_id = __pyx_t_5;

  /* "CyOpenGL.pyx":880
 *         self.tri_light_list_id = base + 4
 *         self.tri_dark_list_id = base + 5
 *         self.labels_list_id = base + 6             # <<<<<<<<<<<<<<
 *         self.set_cutoff(cutoff)
 *         self.pgram = Parallelogram()
 */
  __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_base, __pyx_int_6, 6, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_As_GLuint(__pyx_t_2); if (unlikely((__pyx_t_5 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(0, 880, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->labels_list_id = __pyx_t_5;

  /* "CyOpenGL.pyx":881
 *         self.tri_dark_list_id = base + 5
 *         self.labels_list_id = base + 6
 *         self.set_cutoff(cutoff)             # <<<<<<<<<<<<<<
 *         self.pgram = Parallelogram()
 *         self.build_scene()
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_cutoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_Call2Args(__pyx_t_6, __pyx_t_7, __pyx_v_cutoff) : __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_cutoff);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":882
 *         self.labels_list_id = base + 6
 *         self.set_cutoff(cutoff)
 *         self.pgram = Parallelogram()             # <<<<<<<<<<<<<<
 *         self.build_scene()
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8CyOpenGL_Parallelogram)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->pgram);
  __Pyx_DECREF(__pyx_v_self->pgram);
  __pyx_v_self->pgram = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":883
 *         self.set_cutoff(cutoff)
 *         self.pgram = Parallelogram()
 *         self.build_scene()             # <<<<<<<<<<<<<<
 * 
 *     def destroy(self):
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_build_scene); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_2 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":862
 *     cdef int which_cusp
 * 
 *     def __init__(self, nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var,             # <<<<<<<<<<<<<<
 *                  flipped=False, cutoff=0.1, which_cusp=0):
 *         self.nbhd = nbhd
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_base);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":885
 *         self.build_scene()
 * 
 *     def destroy(self):             # <<<<<<<<<<<<<<
 *         if self.cusp_view:
 *             self.cusp_view.delete_lists()
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_3destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballScene_2destroy[] = "HoroballScene.destroy(self)";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_3destroy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("destroy (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_2destroy(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_2destroy(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("destroy", 0);

  /* "CyOpenGL.pyx":886
 * 
 *     def destroy(self):
 *         if self.cusp_view:             # <<<<<<<<<<<<<<
 *             self.cusp_view.delete_lists()
 *         if self.pgram_list_id > 0:
 */
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_self->cusp_view); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 886, __pyx_L1_error)
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":887
 *     def destroy(self):
 *         if self.cusp_view:
 *             self.cusp_view.delete_lists()             # <<<<<<<<<<<<<<
 *         if self.pgram_list_id > 0:
 *             glDeleteLists(self.pgram_list_id, 7)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->cusp_view, __pyx_n_s_delete_lists); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_4)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_4);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
      }
    }
    __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 887, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":886
 * 
 *     def destroy(self):
 *         if self.cusp_view:             # <<<<<<<<<<<<<<
 *             self.cusp_view.delete_lists()
 *         if self.pgram_list_id > 0:
 */
  }

  /* "CyOpenGL.pyx":888
 *         if self.cusp_view:
 *             self.cusp_view.delete_lists()
 *         if self.pgram_list_id > 0:             # <<<<<<<<<<<<<<
 *             glDeleteLists(self.pgram_list_id, 7)
 *             self.pgram_list_id = 0
 */
  __pyx_t_1 = ((__pyx_v_self->pgram_list_id > 0) != 0);
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":889
 *             self.cusp_view.delete_lists()
 *         if self.pgram_list_id > 0:
 *             glDeleteLists(self.pgram_list_id, 7)             # <<<<<<<<<<<<<<
 *             self.pgram_list_id = 0
 * 
 */
    glDeleteLists(__pyx_v_self->pgram_list_id, 7);

    /* "CyOpenGL.pyx":890
 *         if self.pgram_list_id > 0:
 *             glDeleteLists(self.pgram_list_id, 7)
 *             self.pgram_list_id = 0             # <<<<<<<<<<<<<<
 * 
 *     def set_cutoff(self, cutoff):
 */
    __pyx_v_self->pgram_list_id = 0;

    /* "CyOpenGL.pyx":888
 *         if self.cusp_view:
 *             self.cusp_view.delete_lists()
 *         if self.pgram_list_id > 0:             # <<<<<<<<<<<<<<
 *             glDeleteLists(self.pgram_list_id, 7)
 *             self.pgram_list_id = 0
 */
  }

  /* "CyOpenGL.pyx":885
 *         self.build_scene()
 * 
 *     def destroy(self):             # <<<<<<<<<<<<<<
 *         if self.cusp_view:
 *             self.cusp_view.delete_lists()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.destroy", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":892
 *             self.pgram_list_id = 0
 * 
 *     def set_cutoff(self, cutoff):             # <<<<<<<<<<<<<<
 *         self.cutoff = cutoff
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_5set_cutoff(PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballScene_4set_cutoff[] = "HoroballScene.set_cutoff(self, cutoff)";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_5set_cutoff(PyObject *__pyx_v_self, PyObject *__pyx_v_cutoff) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_cutoff (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_4set_cutoff(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), ((PyObject *)__pyx_v_cutoff));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_4set_cutoff(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_cutoff) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  __Pyx_RefNannySetupContext("set_cutoff", 0);

  /* "CyOpenGL.pyx":893
 * 
 *     def set_cutoff(self, cutoff):
 *         self.cutoff = cutoff             # <<<<<<<<<<<<<<
 * 
 *     def flip(self, boolean_value):
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_cutoff); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 893, __pyx_L1_error)
  __pyx_v_self->cutoff = __pyx_t_1;

  /* "CyOpenGL.pyx":892
 *             self.pgram_list_id = 0
 * 
 *     def set_cutoff(self, cutoff):             # <<<<<<<<<<<<<<
 *         self.cutoff = cutoff
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.set_cutoff", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":895
 *         self.cutoff = cutoff
 * 
 *     def flip(self, boolean_value):             # <<<<<<<<<<<<<<
 *         self.flipped = boolean_value
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_7flip(PyObject *__pyx_v_self, PyObject *__pyx_v_boolean_value); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballScene_6flip[] = "HoroballScene.flip(self, boolean_value)";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_7flip(PyObject *__pyx_v_self, PyObject *__pyx_v_boolean_value) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flip (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_6flip(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), ((PyObject *)__pyx_v_boolean_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_6flip(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_boolean_value) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("flip", 0);

  /* "CyOpenGL.pyx":896
 * 
 *     def flip(self, boolean_value):
 *         self.flipped = boolean_value             # <<<<<<<<<<<<<<
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):
 */
  __Pyx_INCREF(__pyx_v_boolean_value);
  __Pyx_GIVEREF(__pyx_v_boolean_value);
  __Pyx_GOTREF(__pyx_v_self->flipped);
  __Pyx_DECREF(__pyx_v_self->flipped);
  __pyx_v_self->flipped = __pyx_v_boolean_value;

  /* "CyOpenGL.pyx":895
 *         self.cutoff = cutoff
 * 
 *     def flip(self, boolean_value):             # <<<<<<<<<<<<<<
 *         self.flipped = boolean_value
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":898
 *         self.flipped = boolean_value
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):             # <<<<<<<<<<<<<<
 *         if self.nbhd is None:
 *             self.cusp_view = self.Ford = self.tri = self.labels = None
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_9build_scene(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballScene_8build_scene[] = "HoroballScene.build_scene(self, which_cusp=None, full_list=True)";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_9build_scene(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_which_cusp = 0;
  PyObject *__pyx_v_full_list = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_scene (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_which_cusp,&__pyx_n_s_full_list,0};
    PyObject* values[2] = {0,0};
    values[0] = ((PyObject *)Py_None);
    values[1] = ((PyObject *)Py_True);
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_which_cusp);
          if (value) { values[0] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_full_list);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build_scene") < 0)) __PYX_ERR(0, 898, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_which_cusp = values[0];
    __pyx_v_full_list = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_scene", 0, 0, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 898, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.build_scene", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_8build_scene(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), __pyx_v_which_cusp, __pyx_v_full_list);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}
static PyObject *__pyx_gb_8CyOpenGL_13HoroballScene_11build_scene_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value); /* proto */

/* "CyOpenGL.pyx":907
 *             self.which_cusp = which_cusp
 *         self.meridian, self.longitude = (
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))             # <<<<<<<<<<<<<<
 *         self.cusp_view = HoroballGroup(
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),
 */

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_11build_scene_genexpr(PyObject *__pyx_self) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr *__pyx_cur_scope;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  __pyx_cur_scope = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr *)__pyx_tp_new_8CyOpenGL___pyx_scope_struct_2_genexpr(__pyx_ptype_8CyOpenGL___pyx_scope_struct_2_genexpr, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 907, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_outer_scope = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *) __pyx_self;
  __Pyx_INCREF(((PyObject *)__pyx_cur_scope->__pyx_outer_scope));
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_outer_scope);
  {
    __pyx_CoroutineObject *gen = __Pyx_Generator_New((__pyx_coroutine_body_t) __pyx_gb_8CyOpenGL_13HoroballScene_11build_scene_2generator, NULL, (PyObject *) __pyx_cur_scope, __pyx_n_s_genexpr, __pyx_n_s_build_scene_locals_genexpr, __pyx_n_s_CyOpenGL); if (unlikely(!gen)) __PYX_ERR(0, 907, __pyx_L1_error)
    __Pyx_DECREF(__pyx_cur_scope);
    __Pyx_RefNannyFinishContext();
    return (PyObject *) gen;
  }

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.build_scene.genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_gb_8CyOpenGL_13HoroballScene_11build_scene_2generator(__pyx_CoroutineObject *__pyx_generator, CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject *__pyx_sent_value) /* generator body */
{
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr *__pyx_cur_scope = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr *)__pyx_generator->closure);
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("genexpr", 0);
  switch (__pyx_generator->resume_label) {
    case 0: goto __pyx_L3_first_run;
    case 1: goto __pyx_L6_resume_from_yield;
    default: /* CPython raises the right error here */
    __Pyx_RefNannyFinishContext();
    return NULL;
  }
  __pyx_L3_first_run:;
  if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 907, __pyx_L1_error)
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 907, __pyx_L1_error) }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->nbhd, __pyx_n_s_translations); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (unlikely(!__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self)) { __Pyx_RaiseClosureNameError("self"); __PYX_ERR(0, 907, __pyx_L1_error) }
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_outer_scope->__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
    __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 907, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 907, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_5); __Pyx_INCREF(__pyx_t_1); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 907, __pyx_L1_error)
        #else
        __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        #endif
      }
    } else {
      __pyx_t_1 = __pyx_t_6(__pyx_t_2);
      if (unlikely(!__pyx_t_1)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 907, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_XGOTREF(__pyx_cur_scope->__pyx_v_z);
    __Pyx_XDECREF_SET(__pyx_cur_scope->__pyx_v_z, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyComplex_Type)), __pyx_cur_scope->__pyx_v_z); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 907, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    __Pyx_XGIVEREF(__pyx_t_2);
    __pyx_cur_scope->__pyx_t_0 = __pyx_t_2;
    __pyx_cur_scope->__pyx_t_1 = __pyx_t_5;
    __pyx_cur_scope->__pyx_t_2 = __pyx_t_6;
    __Pyx_XGIVEREF(__pyx_r);
    __Pyx_RefNannyFinishContext();
    __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
    /* return from generator, yielding value */
    __pyx_generator->resume_label = 1;
    return __pyx_r;
    __pyx_L6_resume_from_yield:;
    __pyx_t_2 = __pyx_cur_scope->__pyx_t_0;
    __pyx_cur_scope->__pyx_t_0 = 0;
    __Pyx_XGOTREF(__pyx_t_2);
    __pyx_t_5 = __pyx_cur_scope->__pyx_t_1;
    __pyx_t_6 = __pyx_cur_scope->__pyx_t_2;
    if (unlikely(!__pyx_sent_value)) __PYX_ERR(0, 907, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  CYTHON_MAYBE_UNUSED_VAR(__pyx_cur_scope);

  /* function exit code */
  PyErr_SetNone(PyExc_StopIteration);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("genexpr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_r); __pyx_r = 0;
  #if !CYTHON_USE_EXC_INFO_STACK
  __Pyx_Coroutine_ResetAndClearException(__pyx_generator);
  #endif
  __pyx_generator->resume_label = -1;
  __Pyx_Coroutine_clear((PyObject*)__pyx_generator);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":898
 *         self.flipped = boolean_value
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):             # <<<<<<<<<<<<<<
 *         if self.nbhd is None:
 *             self.cusp_view = self.Ford = self.tri = self.labels = None
 */

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_8build_scene(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_which_cusp, PyObject *__pyx_v_full_list) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *__pyx_cur_scope;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("build_scene", 0);
  __pyx_cur_scope = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *)__pyx_tp_new_8CyOpenGL___pyx_scope_struct_1_build_scene(__pyx_ptype_8CyOpenGL___pyx_scope_struct_1_build_scene, __pyx_empty_tuple, NULL);
  if (unlikely(!__pyx_cur_scope)) {
    __pyx_cur_scope = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *)Py_None);
    __Pyx_INCREF(Py_None);
    __PYX_ERR(0, 898, __pyx_L1_error)
  } else {
    __Pyx_GOTREF(__pyx_cur_scope);
  }
  __pyx_cur_scope->__pyx_v_self = __pyx_v_self;
  __Pyx_INCREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_GIVEREF((PyObject *)__pyx_cur_scope->__pyx_v_self);
  __Pyx_INCREF(__pyx_v_which_cusp);

  /* "CyOpenGL.pyx":899
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):
 *         if self.nbhd is None:             # <<<<<<<<<<<<<<
 *             self.cusp_view = self.Ford = self.tri = self.labels = None
 *             return
 */
  __pyx_t_1 = (__pyx_cur_scope->__pyx_v_self->nbhd == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "CyOpenGL.pyx":900
 *     def build_scene(self, which_cusp=None, full_list=True):
 *         if self.nbhd is None:
 *             self.cusp_view = self.Ford = self.tri = self.labels = None             # <<<<<<<<<<<<<<
 *             return
 *         if which_cusp == None:
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cusp_view);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cusp_view);
    __pyx_cur_scope->__pyx_v_self->cusp_view = Py_None;
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->Ford);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->Ford);
    __pyx_cur_scope->__pyx_v_self->Ford = Py_None;
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->tri);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->tri);
    __pyx_cur_scope->__pyx_v_self->tri = Py_None;
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->labels);
    __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->labels);
    __pyx_cur_scope->__pyx_v_self->labels = Py_None;

    /* "CyOpenGL.pyx":901
 *         if self.nbhd is None:
 *             self.cusp_view = self.Ford = self.tri = self.labels = None
 *             return             # <<<<<<<<<<<<<<
 *         if which_cusp == None:
 *             which_cusp = self.which_cusp
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "CyOpenGL.pyx":899
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):
 *         if self.nbhd is None:             # <<<<<<<<<<<<<<
 *             self.cusp_view = self.Ford = self.tri = self.labels = None
 *             return
 */
  }

  /* "CyOpenGL.pyx":902
 *             self.cusp_view = self.Ford = self.tri = self.labels = None
 *             return
 *         if which_cusp == None:             # <<<<<<<<<<<<<<
 *             which_cusp = self.which_cusp
 *         else:
 */
  __pyx_t_3 = PyObject_RichCompare(__pyx_v_which_cusp, Py_None, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 902, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 902, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "CyOpenGL.pyx":903
 *             return
 *         if which_cusp == None:
 *             which_cusp = self.which_cusp             # <<<<<<<<<<<<<<
 *         else:
 *             self.which_cusp = which_cusp
 */
    __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 903, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_which_cusp, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":902
 *             self.cusp_view = self.Ford = self.tri = self.labels = None
 *             return
 *         if which_cusp == None:             # <<<<<<<<<<<<<<
 *             which_cusp = self.which_cusp
 *         else:
 */
    goto __pyx_L4;
  }

  /* "CyOpenGL.pyx":905
 *             which_cusp = self.which_cusp
 *         else:
 *             self.which_cusp = which_cusp             # <<<<<<<<<<<<<<
 *         self.meridian, self.longitude = (
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))
 */
  /*else*/ {
    __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_which_cusp); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 905, __pyx_L1_error)
    __pyx_cur_scope->__pyx_v_self->which_cusp = __pyx_t_4;
  }
  __pyx_L4:;

  /* "CyOpenGL.pyx":907
 *             self.which_cusp = which_cusp
 *         self.meridian, self.longitude = (
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))             # <<<<<<<<<<<<<<
 *         self.cusp_view = HoroballGroup(
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),
 */
  __pyx_t_3 = __pyx_pf_8CyOpenGL_13HoroballScene_11build_scene_genexpr(((PyObject*)__pyx_cur_scope)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 907, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
    PyObject* sequence = __pyx_t_3;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 906, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_5 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_5 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_5 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_7 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = Py_TYPE(__pyx_t_7)->tp_iternext;
    index = 0; __pyx_t_5 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_5)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_5);
    index = 1; __pyx_t_6 = __pyx_t_8(__pyx_t_7); if (unlikely(!__pyx_t_6)) goto __pyx_L5_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_8(__pyx_t_7), 2) < 0) __PYX_ERR(0, 906, __pyx_L1_error)
    __pyx_t_8 = NULL;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L6_unpacking_done;
    __pyx_L5_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 906, __pyx_L1_error)
    __pyx_L6_unpacking_done:;
  }

  /* "CyOpenGL.pyx":906
 *         else:
 *             self.which_cusp = which_cusp
 *         self.meridian, self.longitude = (             # <<<<<<<<<<<<<<
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))
 *         self.cusp_view = HoroballGroup(
 */
  __Pyx_GIVEREF(__pyx_t_5);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->meridian);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->meridian);
  __pyx_cur_scope->__pyx_v_self->meridian = __pyx_t_5;
  __pyx_t_5 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->longitude);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->longitude);
  __pyx_cur_scope->__pyx_v_self->longitude = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":909
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))
 *         self.cusp_view = HoroballGroup(
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),             # <<<<<<<<<<<<<<
 *             [self.nbhd.original_index(n) for n in range(self.nbhd.num_cusps())],
 *             self.meridian,
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->nbhd, __pyx_n_s_horoballs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_cur_scope->__pyx_v_self->cutoff); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 909, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
      __pyx_t_4 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_5, __pyx_v_which_cusp, __pyx_v_full_list};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
    PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_5, __pyx_v_which_cusp, __pyx_v_full_list};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_4, 3+__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_9 = PyTuple_New(3+__pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_4, __pyx_t_5);
    __Pyx_INCREF(__pyx_v_which_cusp);
    __Pyx_GIVEREF(__pyx_v_which_cusp);
    PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_4, __pyx_v_which_cusp);
    __Pyx_INCREF(__pyx_v_full_list);
    __Pyx_GIVEREF(__pyx_v_full_list);
    PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_4, __pyx_v_full_list);
    __pyx_t_5 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 909, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":910
 *         self.cusp_view = HoroballGroup(
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),
 *             [self.nbhd.original_index(n) for n in range(self.nbhd.num_cusps())],             # <<<<<<<<<<<<<<
 *             self.meridian,
 *             self.longitude)
 */
  __pyx_t_6 = PyList_New(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->nbhd, __pyx_n_s_num_cusps); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_9 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 910, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_9 = __pyx_t_5; __Pyx_INCREF(__pyx_t_9); __pyx_t_10 = 0;
    __pyx_t_11 = NULL;
  } else {
    __pyx_t_10 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = Py_TYPE(__pyx_t_9)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 910, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_11)) {
      if (likely(PyList_CheckExact(__pyx_t_9))) {
        if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_9)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 910, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 910, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_10); __Pyx_INCREF(__pyx_t_5); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 910, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_9, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 910, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_11(__pyx_t_9);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 910, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->nbhd, __pyx_n_s_original_index); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_5 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_12, __pyx_v_n) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_v_n);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 910, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__Pyx_ListComp_Append(__pyx_t_6, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 910, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "CyOpenGL.pyx":908
 *         self.meridian, self.longitude = (
 *             complex(z) for z in self.nbhd.translations(self.which_cusp))
 *         self.cusp_view = HoroballGroup(             # <<<<<<<<<<<<<<
 *             self.nbhd.horoballs(self.cutoff, which_cusp, full_list),
 *             [self.nbhd.original_index(n) for n in range(self.nbhd.num_cusps())],
 */
  __pyx_t_9 = PyTuple_New(4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_6);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->meridian);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->meridian);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_cur_scope->__pyx_v_self->meridian);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->longitude);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->longitude);
  PyTuple_SET_ITEM(__pyx_t_9, 3, __pyx_cur_scope->__pyx_v_self->longitude);
  __pyx_t_3 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_HoroballGroup), __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 908, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->cusp_view);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->cusp_view);
  __pyx_cur_scope->__pyx_v_self->cusp_view = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":914
 *             self.longitude)
 *         self.Ford = FordEdgeSet(
 *                 self.nbhd.Ford_domain(self.which_cusp),             # <<<<<<<<<<<<<<
 *                 self.longitude, self.meridian)
 *         self.tri = TriangulationEdgeSet(
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->nbhd, __pyx_n_s_Ford_domain); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 914, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "CyOpenGL.pyx":913
 *             self.meridian,
 *             self.longitude)
 *         self.Ford = FordEdgeSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian)
 */
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->longitude);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->longitude);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_cur_scope->__pyx_v_self->longitude);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->meridian);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->meridian);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_cur_scope->__pyx_v_self->meridian);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_FordEdgeSet), __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 913, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->Ford);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->Ford);
  __pyx_cur_scope->__pyx_v_self->Ford = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":917
 *                 self.longitude, self.meridian)
 *         self.tri = TriangulationEdgeSet(
 *                 self.nbhd.triangulation(self.which_cusp),             # <<<<<<<<<<<<<<
 *                 self.longitude, self.meridian)
 *         self.labels = LabelSet(
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->nbhd, __pyx_n_s_triangulation); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 917, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "CyOpenGL.pyx":916
 *                 self.nbhd.Ford_domain(self.which_cusp),
 *                 self.longitude, self.meridian)
 *         self.tri = TriangulationEdgeSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian)
 */
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->longitude);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->longitude);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_cur_scope->__pyx_v_self->longitude);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->meridian);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->meridian);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_cur_scope->__pyx_v_self->meridian);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_TriangulationEdgeSet), __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 916, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->tri);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->tri);
  __pyx_cur_scope->__pyx_v_self->tri = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":920
 *                 self.longitude, self.meridian)
 *         self.labels = LabelSet(
 *                 self.nbhd.triangulation(self.which_cusp),             # <<<<<<<<<<<<<<
 *                 self.longitude, self.meridian)
 *         self.gl_compile()
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_self->nbhd, __pyx_n_s_triangulation); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_cur_scope->__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_9, function);
    }
  }
  __pyx_t_6 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_9, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 920, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

  /* "CyOpenGL.pyx":919
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian)
 *         self.labels = LabelSet(             # <<<<<<<<<<<<<<
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian)
 */
  __pyx_t_9 = PyTuple_New(3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->longitude);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->longitude);
  PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_cur_scope->__pyx_v_self->longitude);
  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_self->meridian);
  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_self->meridian);
  PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_cur_scope->__pyx_v_self->meridian);
  __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_8CyOpenGL_LabelSet), __pyx_t_9, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 919, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __Pyx_GIVEREF(__pyx_t_6);
  __Pyx_GOTREF(__pyx_cur_scope->__pyx_v_self->labels);
  __Pyx_DECREF(__pyx_cur_scope->__pyx_v_self->labels);
  __pyx_cur_scope->__pyx_v_self->labels = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":922
 *                 self.nbhd.triangulation(self.which_cusp),
 *                 self.longitude, self.meridian)
 *         self.gl_compile()             # <<<<<<<<<<<<<<
 * 
 *     cdef build_shifts(self, R, T):
 */
  __pyx_t_6 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *)__pyx_cur_scope->__pyx_v_self->__pyx_vtab)->gl_compile(__pyx_cur_scope->__pyx_v_self); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 922, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":898
 *         self.flipped = boolean_value
 * 
 *     def build_scene(self, which_cusp=None, full_list=True):             # <<<<<<<<<<<<<<
 *         if self.nbhd is None:
 *             self.cusp_view = self.Ford = self.tri = self.labels = None
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.build_scene", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XDECREF(__pyx_v_which_cusp);
  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":924
 *         self.gl_compile()
 * 
 *     cdef build_shifts(self, R, T):             # <<<<<<<<<<<<<<
 *         self.shifts = []
 *         if self.cusp_view is None:
 */

static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_build_shifts(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_R, PyObject *__pyx_v_T) {
  PyObject *__pyx_v_M = NULL;
  PyObject *__pyx_v_N = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_shear = NULL;
  PyObject *__pyx_v_left = NULL;
  PyObject *__pyx_v_n = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  PyObject *__pyx_t_9 = NULL;
  Py_ssize_t __pyx_t_10;
  PyObject *(*__pyx_t_11)(PyObject *);
  int __pyx_t_12;
  __Pyx_RefNannySetupContext("build_shifts", 0);

  /* "CyOpenGL.pyx":925
 * 
 *     cdef build_shifts(self, R, T):
 *         self.shifts = []             # <<<<<<<<<<<<<<
 *         if self.cusp_view is None:
 *             return
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 925, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->shifts);
  __Pyx_DECREF(__pyx_v_self->shifts);
  __pyx_v_self->shifts = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":926
 *     cdef build_shifts(self, R, T):
 *         self.shifts = []
 *         if self.cusp_view is None:             # <<<<<<<<<<<<<<
 *             return
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
 */
  __pyx_t_2 = (__pyx_v_self->cusp_view == Py_None);
  __pyx_t_3 = (__pyx_t_2 != 0);
  if (__pyx_t_3) {

    /* "CyOpenGL.pyx":927
 *         self.shifts = []
 *         if self.cusp_view is None:
 *             return             # <<<<<<<<<<<<<<
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
 *         N = 1 + int(ceil(R/self.longitude.real))
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "CyOpenGL.pyx":926
 *     cdef build_shifts(self, R, T):
 *         self.shifts = []
 *         if self.cusp_view is None:             # <<<<<<<<<<<<<<
 *             return
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
 */
  }

  /* "CyOpenGL.pyx":928
 *         if self.cusp_view is None:
 *             return
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))             # <<<<<<<<<<<<<<
 *         N = 1 + int(ceil(R/self.longitude.real))
 *         for m in range(-M,M+1):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ceil); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_n_s_imag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyNumber_Absolute(__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_v_T, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_6, __pyx_t_5) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_4, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 928, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_M = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":929
 *             return
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
 *         N = 1 + int(ceil(R/self.longitude.real))             # <<<<<<<<<<<<<<
 *         for m in range(-M,M+1):
 *             shear = m*self.meridian.real/self.longitude.real
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_ceil); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_n_s_real); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_R, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_1 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_4, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 929, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_N = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":930
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
 *         N = 1 + int(ceil(R/self.longitude.real))
 *         for m in range(-M,M+1):             # <<<<<<<<<<<<<<
 *             shear = m*self.meridian.real/self.longitude.real
 *             left = int(floor(-shear-N))
 */
  __pyx_t_1 = PyNumber_Negative(__pyx_v_M); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_M, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_6 = __pyx_t_4; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 930, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 930, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_4); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 930, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_8(__pyx_t_6);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 930, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":931
 *         N = 1 + int(ceil(R/self.longitude.real))
 *         for m in range(-M,M+1):
 *             shear = m*self.meridian.real/self.longitude.real             # <<<<<<<<<<<<<<
 *             left = int(floor(-shear-N))
 *             for n in range(left,left+2*N+1):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_n_s_real); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyNumber_Multiply(__pyx_v_m, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_n_s_real); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF_SET(__pyx_v_shear, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":932
 *         for m in range(-M,M+1):
 *             shear = m*self.meridian.real/self.longitude.real
 *             left = int(floor(-shear-N))             # <<<<<<<<<<<<<<
 *             for n in range(left,left+2*N+1):
 *                 self.shifts.append((m,n))
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_floor); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_1 = PyNumber_Negative(__pyx_v_shear); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_9 = PyNumber_Subtract(__pyx_t_1, __pyx_v_N); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_5 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_1, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyNumber_Int(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 932, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_left, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":933
 *             shear = m*self.meridian.real/self.longitude.real
 *             left = int(floor(-shear-N))
 *             for n in range(left,left+2*N+1):             # <<<<<<<<<<<<<<
 *                 self.shifts.append((m,n))
 * 
 */
    __pyx_t_4 = PyNumber_Multiply(__pyx_int_2, __pyx_v_N); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Add(__pyx_v_left, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_INCREF(__pyx_v_left);
    __Pyx_GIVEREF(__pyx_v_left);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_left);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
    __pyx_t_4 = 0;
    __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
      __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_10 = 0;
      __pyx_t_11 = NULL;
    } else {
      __pyx_t_10 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 933, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_11 = Py_TYPE(__pyx_t_5)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 933, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    for (;;) {
      if (likely(!__pyx_t_11)) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 933, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        } else {
          if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 933, __pyx_L1_error)
          #else
          __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 933, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_4);
          #endif
        }
      } else {
        __pyx_t_4 = __pyx_t_11(__pyx_t_5);
        if (unlikely(!__pyx_t_4)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 933, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_XDECREF_SET(__pyx_v_n, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "CyOpenGL.pyx":934
 *             left = int(floor(-shear-N))
 *             for n in range(left,left+2*N+1):
 *                 self.shifts.append((m,n))             # <<<<<<<<<<<<<<
 * 
 *     def translate(self, z):
 */
      __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 934, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_m);
      __Pyx_GIVEREF(__pyx_v_m);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_m);
      __Pyx_INCREF(__pyx_v_n);
      __Pyx_GIVEREF(__pyx_v_n);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_n);
      __pyx_t_12 = __Pyx_PyObject_Append(__pyx_v_self->shifts, __pyx_t_4); if (unlikely(__pyx_t_12 == ((int)-1))) __PYX_ERR(0, 934, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "CyOpenGL.pyx":933
 *             shear = m*self.meridian.real/self.longitude.real
 *             left = int(floor(-shear-N))
 *             for n in range(left,left+2*N+1):             # <<<<<<<<<<<<<<
 *                 self.shifts.append((m,n))
 * 
 */
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

    /* "CyOpenGL.pyx":930
 *         M = 1 + int(ceil(T/abs(self.meridian.imag)))
 *         N = 1 + int(ceil(R/self.longitude.real))
 *         for m in range(-M,M+1):             # <<<<<<<<<<<<<<
 *             shear = m*self.meridian.real/self.longitude.real
 *             left = int(floor(-shear-N))
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":924
 *         self.gl_compile()
 * 
 *     cdef build_shifts(self, R, T):             # <<<<<<<<<<<<<<
 *         self.shifts = []
 *         if self.cusp_view is None:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.build_shifts", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_M);
  __Pyx_XDECREF(__pyx_v_N);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_shear);
  __Pyx_XDECREF(__pyx_v_left);
  __Pyx_XDECREF(__pyx_v_n);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":936
 *                 self.shifts.append((m,n))
 * 
 *     def translate(self, z):             # <<<<<<<<<<<<<<
 *         """
 *         Translate modulo the cusp stabilizer.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_11translate(PyObject *__pyx_v_self, PyObject *__pyx_v_z); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballScene_10translate[] = "HoroballScene.translate(self, z)\n\n        Translate modulo the cusp stabilizer.\n        ";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_11translate(PyObject *__pyx_v_self, PyObject *__pyx_v_z) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("translate (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_10translate(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), ((PyObject *)__pyx_v_z));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_10translate(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_z) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("translate", 0);
  __Pyx_INCREF(__pyx_v_z);

  /* "CyOpenGL.pyx":940
 *         Translate modulo the cusp stabilizer.
 *         """
 *         if self.cusp_view is None:             # <<<<<<<<<<<<<<
 *             return
 *         if self.flipped:
 */
  __pyx_t_1 = (__pyx_v_self->cusp_view == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "CyOpenGL.pyx":941
 *         """
 *         if self.cusp_view is None:
 *             return             # <<<<<<<<<<<<<<
 *         if self.flipped:
 *             z = z.conjugate()
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "CyOpenGL.pyx":940
 *         Translate modulo the cusp stabilizer.
 *         """
 *         if self.cusp_view is None:             # <<<<<<<<<<<<<<
 *             return
 *         if self.flipped:
 */
  }

  /* "CyOpenGL.pyx":942
 *         if self.cusp_view is None:
 *             return
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             z = z.conjugate()
 *         z += self.offset
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->flipped); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 942, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "CyOpenGL.pyx":943
 *             return
 *         if self.flipped:
 *             z = z.conjugate()             # <<<<<<<<<<<<<<
 *         z += self.offset
 *         z += 0.5*self.meridian.imag*1j
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_z, __pyx_n_s_conjugate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_4, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 943, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":942
 *         if self.cusp_view is None:
 *             return
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             z = z.conjugate()
 *         z += self.offset
 */
  }

  /* "CyOpenGL.pyx":944
 *         if self.flipped:
 *             z = z.conjugate()
 *         z += self.offset             # <<<<<<<<<<<<<<
 *         z += 0.5*self.meridian.imag*1j
 *         z = z - (z.imag//self.meridian.imag)*self.meridian
 */
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_z, __pyx_v_self->offset); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 944, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":945
 *             z = z.conjugate()
 *         z += self.offset
 *         z += 0.5*self.meridian.imag*1j             # <<<<<<<<<<<<<<
 *         z = z - (z.imag//self.meridian.imag)*self.meridian
 *         z -= 0.5*self.meridian.imag*1j
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_n_s_imag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_z, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 945, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":946
 *         z += self.offset
 *         z += 0.5*self.meridian.imag*1j
 *         z = z - (z.imag//self.meridian.imag)*self.meridian             # <<<<<<<<<<<<<<
 *         z -= 0.5*self.meridian.imag*1j
 *         z += 0.5*self.longitude.real
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_z, __pyx_n_s_imag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_n_s_imag); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = PyNumber_FloorDivide(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_v_self->meridian); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Subtract(__pyx_v_z, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":947
 *         z += 0.5*self.meridian.imag*1j
 *         z = z - (z.imag//self.meridian.imag)*self.meridian
 *         z -= 0.5*self.meridian.imag*1j             # <<<<<<<<<<<<<<
 *         z += 0.5*self.longitude.real
 *         z = z - (z.real//self.longitude.real)*self.longitude
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_n_s_imag); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyComplex_FromDoubles(0.0, 1.0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_InPlaceSubtract(__pyx_v_z, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 947, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":948
 *         z = z - (z.imag//self.meridian.imag)*self.meridian
 *         z -= 0.5*self.meridian.imag*1j
 *         z += 0.5*self.longitude.real             # <<<<<<<<<<<<<<
 *         z = z - (z.real//self.longitude.real)*self.longitude
 *         z -= 0.5*self.longitude
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_n_s_real); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_z, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_4);
  __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":949
 *         z -= 0.5*self.meridian.imag*1j
 *         z += 0.5*self.longitude.real
 *         z = z - (z.real//self.longitude.real)*self.longitude             # <<<<<<<<<<<<<<
 *         z -= 0.5*self.longitude
 *         self.offset = z
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_z, __pyx_n_s_real); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_FloorDivide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_v_self->longitude); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Subtract(__pyx_v_z, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 949, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_5);
  __pyx_t_5 = 0;

  /* "CyOpenGL.pyx":950
 *         z += 0.5*self.longitude.real
 *         z = z - (z.real//self.longitude.real)*self.longitude
 *         z -= 0.5*self.longitude             # <<<<<<<<<<<<<<
 *         self.offset = z
 * 
 */
  __pyx_t_5 = PyNumber_Multiply(__pyx_float_0_5, __pyx_v_self->longitude); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_v_z, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 950, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF_SET(__pyx_v_z, __pyx_t_3);
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":951
 *         z = z - (z.real//self.longitude.real)*self.longitude
 *         z -= 0.5*self.longitude
 *         self.offset = z             # <<<<<<<<<<<<<<
 * 
 *     cdef right_top(self):
 */
  __Pyx_INCREF(__pyx_v_z);
  __Pyx_GIVEREF(__pyx_v_z);
  __Pyx_GOTREF(__pyx_v_self->offset);
  __Pyx_DECREF(__pyx_v_self->offset);
  __pyx_v_self->offset = __pyx_v_z;

  /* "CyOpenGL.pyx":936
 *                 self.shifts.append((m,n))
 * 
 *     def translate(self, z):             # <<<<<<<<<<<<<<
 *         """
 *         Translate modulo the cusp stabilizer.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.translate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_z);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":953
 *         self.offset = z
 * 
 *     cdef right_top(self):             # <<<<<<<<<<<<<<
 *         cdef GLfloat proj[16]
 *         glGetFloatv(GL_PROJECTION_MATRIX, proj)
 */

static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_right_top(CYTHON_UNUSED struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self) {
  GLfloat __pyx_v_proj[16];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("right_top", 0);

  /* "CyOpenGL.pyx":955
 *     cdef right_top(self):
 *         cdef GLfloat proj[16]
 *         glGetFloatv(GL_PROJECTION_MATRIX, proj)             # <<<<<<<<<<<<<<
 *         return (abs(<float>(1.0/proj[0])), abs(<float>(1.0/proj[5])))
 * 
 */
  glGetFloatv(GL_PROJECTION_MATRIX, __pyx_v_proj);

  /* "CyOpenGL.pyx":956
 *         cdef GLfloat proj[16]
 *         glGetFloatv(GL_PROJECTION_MATRIX, proj)
 *         return (abs(<float>(1.0/proj[0])), abs(<float>(1.0/proj[5])))             # <<<<<<<<<<<<<<
 * 
 *     cdef gl_compile(self):
 */
  __Pyx_XDECREF(__pyx_r);
  if (unlikely((__pyx_v_proj[0]) == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 956, __pyx_L1_error)
  }
  __pyx_t_1 = PyFloat_FromDouble(fabsf(((float)(1.0 / (__pyx_v_proj[0]))))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely((__pyx_v_proj[5]) == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 956, __pyx_L1_error)
  }
  __pyx_t_2 = PyFloat_FromDouble(fabsf(((float)(1.0 / (__pyx_v_proj[5]))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 956, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  /* "CyOpenGL.pyx":953
 *         self.offset = z
 * 
 *     cdef right_top(self):             # <<<<<<<<<<<<<<
 *         cdef GLfloat proj[16]
 *         glGetFloatv(GL_PROJECTION_MATRIX, proj)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.right_top", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":958
 *         return (abs(<float>(1.0/proj[0])), abs(<float>(1.0/proj[5])))
 * 
 *     cdef gl_compile(self):             # <<<<<<<<<<<<<<
 *         self.pgram.build_display_list(self.pgram_list_id,
 *                                       self.longitude, self.meridian)
 */

static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_gl_compile(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self) {
  PyObject *__pyx_v_right = NULL;
  PyObject *__pyx_v_top = NULL;
  PyObject *__pyx_v_R = NULL;
  PyObject *__pyx_v_T = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *(*__pyx_t_7)(PyObject *);
  __Pyx_RefNannySetupContext("gl_compile", 0);

  /* "CyOpenGL.pyx":959
 * 
 *     cdef gl_compile(self):
 *         self.pgram.build_display_list(self.pgram_list_id,             # <<<<<<<<<<<<<<
 *                                       self.longitude, self.meridian)
 *         right, top = self.right_top()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->pgram, __pyx_n_s_build_display_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_GLuint(__pyx_v_self->pgram_list_id); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 959, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "CyOpenGL.pyx":960
 *     cdef gl_compile(self):
 *         self.pgram.build_display_list(self.pgram_list_id,
 *                                       self.longitude, self.meridian)             # <<<<<<<<<<<<<<
 *         right, top = self.right_top()
 *         R = right + 2.0 + 0.5*self.longitude.real
 */
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->longitude, __pyx_v_self->meridian};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_t_3, __pyx_v_self->longitude, __pyx_v_self->meridian};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_3);
    __Pyx_INCREF(__pyx_v_self->longitude);
    __Pyx_GIVEREF(__pyx_v_self->longitude);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_v_self->longitude);
    __Pyx_INCREF(__pyx_v_self->meridian);
    __Pyx_GIVEREF(__pyx_v_self->meridian);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_v_self->meridian);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":961
 *         self.pgram.build_display_list(self.pgram_list_id,
 *                                       self.longitude, self.meridian)
 *         right, top = self.right_top()             # <<<<<<<<<<<<<<
 *         R = right + 2.0 + 0.5*self.longitude.real
 *         T = top + 2.0 + 0.5*self.meridian.imag
 */
  __pyx_t_1 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *)__pyx_v_self->__pyx_vtab)->right_top(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 961, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if ((likely(PyTuple_CheckExact(__pyx_t_1))) || (PyList_CheckExact(__pyx_t_1))) {
    PyObject* sequence = __pyx_t_1;
    Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
    if (unlikely(size != 2)) {
      if (size > 2) __Pyx_RaiseTooManyValuesError(2);
      else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
      __PYX_ERR(0, 961, __pyx_L1_error)
    }
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    if (likely(PyTuple_CheckExact(sequence))) {
      __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyTuple_GET_ITEM(sequence, 1); 
    } else {
      __pyx_t_2 = PyList_GET_ITEM(sequence, 0); 
      __pyx_t_6 = PyList_GET_ITEM(sequence, 1); 
    }
    __Pyx_INCREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_6);
    #else
    __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_6 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    #endif
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else {
    Py_ssize_t index = -1;
    __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 961, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext;
    index = 0; __pyx_t_2 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_2);
    index = 1; __pyx_t_6 = __pyx_t_7(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L3_unpacking_failed;
    __Pyx_GOTREF(__pyx_t_6);
    if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_3), 2) < 0) __PYX_ERR(0, 961, __pyx_L1_error)
    __pyx_t_7 = NULL;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L4_unpacking_done;
    __pyx_L3_unpacking_failed:;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = NULL;
    if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
    __PYX_ERR(0, 961, __pyx_L1_error)
    __pyx_L4_unpacking_done:;
  }
  __pyx_v_right = __pyx_t_2;
  __pyx_t_2 = 0;
  __pyx_v_top = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":962
 *                                       self.longitude, self.meridian)
 *         right, top = self.right_top()
 *         R = right + 2.0 + 0.5*self.longitude.real             # <<<<<<<<<<<<<<
 *         T = top + 2.0 + 0.5*self.meridian.imag
 *         self.cusp_view.build_display_list(self.ball_list_id, R, T)
 */
  __pyx_t_1 = __Pyx_PyFloat_AddObjC(__pyx_v_right, __pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->longitude, __pyx_n_s_real); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 962, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_R = __pyx_t_6;
  __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":963
 *         right, top = self.right_top()
 *         R = right + 2.0 + 0.5*self.longitude.real
 *         T = top + 2.0 + 0.5*self.meridian.imag             # <<<<<<<<<<<<<<
 *         self.cusp_view.build_display_list(self.ball_list_id, R, T)
 *         self.build_shifts(R, T)
 */
  __pyx_t_6 = __Pyx_PyFloat_AddObjC(__pyx_v_top, __pyx_float_2_0, 2.0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->meridian, __pyx_n_s_imag); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 963, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_T = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":964
 *         R = right + 2.0 + 0.5*self.longitude.real
 *         T = top + 2.0 + 0.5*self.meridian.imag
 *         self.cusp_view.build_display_list(self.ball_list_id, R, T)             # <<<<<<<<<<<<<<
 *         self.build_shifts(R, T)
 *         self.Ford.build_display_list(self.Ford_light_list_id, self.shifts, dark=False)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->cusp_view, __pyx_n_s_build_display_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyInt_From_GLuint(__pyx_v_self->ball_list_id); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 964, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_6, __pyx_v_R, __pyx_v_T};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_t_6, __pyx_v_R, __pyx_v_T};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_5, __pyx_t_6);
    __Pyx_INCREF(__pyx_v_R);
    __Pyx_GIVEREF(__pyx_v_R);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_5, __pyx_v_R);
    __Pyx_INCREF(__pyx_v_T);
    __Pyx_GIVEREF(__pyx_v_T);
    PyTuple_SET_ITEM(__pyx_t_4, 2+__pyx_t_5, __pyx_v_T);
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 964, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":965
 *         T = top + 2.0 + 0.5*self.meridian.imag
 *         self.cusp_view.build_display_list(self.ball_list_id, R, T)
 *         self.build_shifts(R, T)             # <<<<<<<<<<<<<<
 *         self.Ford.build_display_list(self.Ford_light_list_id, self.shifts, dark=False)
 *         self.Ford.build_display_list(self.Ford_dark_list_id, self.shifts, dark=True)
 */
  __pyx_t_2 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *)__pyx_v_self->__pyx_vtab)->build_shifts(__pyx_v_self, __pyx_v_R, __pyx_v_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 965, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":966
 *         self.cusp_view.build_display_list(self.ball_list_id, R, T)
 *         self.build_shifts(R, T)
 *         self.Ford.build_display_list(self.Ford_light_list_id, self.shifts, dark=False)             # <<<<<<<<<<<<<<
 *         self.Ford.build_display_list(self.Ford_dark_list_id, self.shifts, dark=True)
 *         self.tri.build_display_list(self.tri_light_list_id, self.shifts, dark=False)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Ford, __pyx_n_s_build_display_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyInt_From_GLuint(__pyx_v_self->Ford_light_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->shifts);
  __Pyx_GIVEREF(__pyx_v_self->shifts);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->shifts);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dark, Py_False) < 0) __PYX_ERR(0, 966, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 966, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":967
 *         self.build_shifts(R, T)
 *         self.Ford.build_display_list(self.Ford_light_list_id, self.shifts, dark=False)
 *         self.Ford.build_display_list(self.Ford_dark_list_id, self.shifts, dark=True)             # <<<<<<<<<<<<<<
 *         self.tri.build_display_list(self.tri_light_list_id, self.shifts, dark=False)
 *         self.tri.build_display_list(self.tri_dark_list_id, self.shifts, dark=True)
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Ford, __pyx_n_s_build_display_list); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyInt_From_GLuint(__pyx_v_self->Ford_dark_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->shifts);
  __Pyx_GIVEREF(__pyx_v_self->shifts);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->shifts);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dark, Py_True) < 0) __PYX_ERR(0, 967, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 967, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":968
 *         self.Ford.build_display_list(self.Ford_light_list_id, self.shifts, dark=False)
 *         self.Ford.build_display_list(self.Ford_dark_list_id, self.shifts, dark=True)
 *         self.tri.build_display_list(self.tri_light_list_id, self.shifts, dark=False)             # <<<<<<<<<<<<<<
 *         self.tri.build_display_list(self.tri_dark_list_id, self.shifts, dark=True)
 *         self.labels.build_display_list(self.labels_list_id, self.shifts)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->tri, __pyx_n_s_build_display_list); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyInt_From_GLuint(__pyx_v_self->tri_light_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->shifts);
  __Pyx_GIVEREF(__pyx_v_self->shifts);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->shifts);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dark, Py_False) < 0) __PYX_ERR(0, 968, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 968, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":969
 *         self.Ford.build_display_list(self.Ford_dark_list_id, self.shifts, dark=True)
 *         self.tri.build_display_list(self.tri_light_list_id, self.shifts, dark=False)
 *         self.tri.build_display_list(self.tri_dark_list_id, self.shifts, dark=True)             # <<<<<<<<<<<<<<
 *         self.labels.build_display_list(self.labels_list_id, self.shifts)
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->tri, __pyx_n_s_build_display_list); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_1 = __Pyx_PyInt_From_GLuint(__pyx_v_self->tri_dark_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_INCREF(__pyx_v_self->shifts);
  __Pyx_GIVEREF(__pyx_v_self->shifts);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_self->shifts);
  __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dark, Py_True) < 0) __PYX_ERR(0, 969, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 969, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":970
 *         self.tri.build_display_list(self.tri_light_list_id, self.shifts, dark=False)
 *         self.tri.build_display_list(self.tri_dark_list_id, self.shifts, dark=True)
 *         self.labels.build_display_list(self.labels_list_id, self.shifts)             # <<<<<<<<<<<<<<
 * 
 *     cdef draw_segments(self, ford_height, pgram_height):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->labels, __pyx_n_s_build_display_list); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_From_GLuint(__pyx_v_self->labels_list_id); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 970, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_self->shifts};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_self->shifts};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_5, __pyx_t_4);
    __Pyx_INCREF(__pyx_v_self->shifts);
    __Pyx_GIVEREF(__pyx_v_self->shifts);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_5, __pyx_v_self->shifts);
    __pyx_t_4 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 970, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":958
 *         return (abs(<float>(1.0/proj[0])), abs(<float>(1.0/proj[5])))
 * 
 *     cdef gl_compile(self):             # <<<<<<<<<<<<<<
 *         self.pgram.build_display_list(self.pgram_list_id,
 *                                       self.longitude, self.meridian)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.gl_compile", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_right);
  __Pyx_XDECREF(__pyx_v_top);
  __Pyx_XDECREF(__pyx_v_R);
  __Pyx_XDECREF(__pyx_v_T);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":972
 *         self.labels.build_display_list(self.labels_list_id, self.shifts)
 * 
 *     cdef draw_segments(self, ford_height, pgram_height):             # <<<<<<<<<<<<<<
 *         with_horoballs = self.horo_var.get()
 *         glPushMatrix()
 */

static PyObject *__pyx_f_8CyOpenGL_13HoroballScene_draw_segments(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v_ford_height, PyObject *__pyx_v_pgram_height) {
  PyObject *__pyx_v_with_horoballs = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  GLfloat __pyx_t_4;
  GLfloat __pyx_t_5;
  GLfloat __pyx_t_6;
  int __pyx_t_7;
  __Pyx_RefNannySetupContext("draw_segments", 0);

  /* "CyOpenGL.pyx":973
 * 
 *     cdef draw_segments(self, ford_height, pgram_height):
 *         with_horoballs = self.horo_var.get()             # <<<<<<<<<<<<<<
 *         glPushMatrix()
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->horo_var, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 973, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_with_horoballs = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":974
 *     cdef draw_segments(self, ford_height, pgram_height):
 *         with_horoballs = self.horo_var.get()
 *         glPushMatrix()             # <<<<<<<<<<<<<<
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
 *         if self.tri_var.get():
 */
  glPushMatrix();

  /* "CyOpenGL.pyx":975
 *         with_horoballs = self.horo_var.get()
 *         glPushMatrix()
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)             # <<<<<<<<<<<<<<
 *         if self.tri_var.get():
 *             if with_horoballs:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_n_s_real); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_n_s_imag); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_5 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 975, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_ford_height); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 975, __pyx_L1_error)
  glTranslatef(__pyx_t_4, __pyx_t_5, __pyx_t_6);

  /* "CyOpenGL.pyx":976
 *         glPushMatrix()
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
 *         if self.tri_var.get():             # <<<<<<<<<<<<<<
 *             if with_horoballs:
 *                 glCallList(self.tri_light_list_id)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->tri_var, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 976, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {

    /* "CyOpenGL.pyx":977
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
 *         if self.tri_var.get():
 *             if with_horoballs:             # <<<<<<<<<<<<<<
 *                 glCallList(self.tri_light_list_id)
 *             else:
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_with_horoballs); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 977, __pyx_L1_error)
    if (__pyx_t_7) {

      /* "CyOpenGL.pyx":978
 *         if self.tri_var.get():
 *             if with_horoballs:
 *                 glCallList(self.tri_light_list_id)             # <<<<<<<<<<<<<<
 *             else:
 *                 glCallList(self.tri_dark_list_id)
 */
      glCallList(__pyx_v_self->tri_light_list_id);

      /* "CyOpenGL.pyx":977
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
 *         if self.tri_var.get():
 *             if with_horoballs:             # <<<<<<<<<<<<<<
 *                 glCallList(self.tri_light_list_id)
 *             else:
 */
      goto __pyx_L4;
    }

    /* "CyOpenGL.pyx":980
 *                 glCallList(self.tri_light_list_id)
 *             else:
 *                 glCallList(self.tri_dark_list_id)             # <<<<<<<<<<<<<<
 *         if self.Ford_var.get():
 *             if with_horoballs:
 */
    /*else*/ {
      glCallList(__pyx_v_self->tri_dark_list_id);
    }
    __pyx_L4:;

    /* "CyOpenGL.pyx":976
 *         glPushMatrix()
 *         glTranslatef(self.offset.real, self.offset.imag, ford_height)
 *         if self.tri_var.get():             # <<<<<<<<<<<<<<
 *             if with_horoballs:
 *                 glCallList(self.tri_light_list_id)
 */
  }

  /* "CyOpenGL.pyx":981
 *             else:
 *                 glCallList(self.tri_dark_list_id)
 *         if self.Ford_var.get():             # <<<<<<<<<<<<<<
 *             if with_horoballs:
 *                 glCallList(self.Ford_light_list_id)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Ford_var, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 981, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {

    /* "CyOpenGL.pyx":982
 *                 glCallList(self.tri_dark_list_id)
 *         if self.Ford_var.get():
 *             if with_horoballs:             # <<<<<<<<<<<<<<
 *                 glCallList(self.Ford_light_list_id)
 *             else:
 */
    __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_v_with_horoballs); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 982, __pyx_L1_error)
    if (__pyx_t_7) {

      /* "CyOpenGL.pyx":983
 *         if self.Ford_var.get():
 *             if with_horoballs:
 *                 glCallList(self.Ford_light_list_id)             # <<<<<<<<<<<<<<
 *             else:
 *                 glCallList(self.Ford_dark_list_id)
 */
      glCallList(__pyx_v_self->Ford_light_list_id);

      /* "CyOpenGL.pyx":982
 *                 glCallList(self.tri_dark_list_id)
 *         if self.Ford_var.get():
 *             if with_horoballs:             # <<<<<<<<<<<<<<
 *                 glCallList(self.Ford_light_list_id)
 *             else:
 */
      goto __pyx_L6;
    }

    /* "CyOpenGL.pyx":985
 *                 glCallList(self.Ford_light_list_id)
 *             else:
 *                 glCallList(self.Ford_dark_list_id)             # <<<<<<<<<<<<<<
 *         glPopMatrix()
 *         if self.pgram_var.get():
 */
    /*else*/ {
      glCallList(__pyx_v_self->Ford_dark_list_id);
    }
    __pyx_L6:;

    /* "CyOpenGL.pyx":981
 *             else:
 *                 glCallList(self.tri_dark_list_id)
 *         if self.Ford_var.get():             # <<<<<<<<<<<<<<
 *             if with_horoballs:
 *                 glCallList(self.Ford_light_list_id)
 */
  }

  /* "CyOpenGL.pyx":986
 *             else:
 *                 glCallList(self.Ford_dark_list_id)
 *         glPopMatrix()             # <<<<<<<<<<<<<<
 *         if self.pgram_var.get():
 *             glPushMatrix()
 */
  glPopMatrix();

  /* "CyOpenGL.pyx":987
 *                 glCallList(self.Ford_dark_list_id)
 *         glPopMatrix()
 *         if self.pgram_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(0.0, 0.0, pgram_height)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->pgram_var, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 987, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_7) {

    /* "CyOpenGL.pyx":988
 *         glPopMatrix()
 *         if self.pgram_var.get():
 *             glPushMatrix()             # <<<<<<<<<<<<<<
 *             glTranslatef(0.0, 0.0, pgram_height)
 *             glCallList(self.pgram_list_id)
 */
    glPushMatrix();

    /* "CyOpenGL.pyx":989
 *         if self.pgram_var.get():
 *             glPushMatrix()
 *             glTranslatef(0.0, 0.0, pgram_height)             # <<<<<<<<<<<<<<
 *             glCallList(self.pgram_list_id)
 *             glPopMatrix()
 */
    __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_v_pgram_height); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
    glTranslatef(0.0, 0.0, __pyx_t_6);

    /* "CyOpenGL.pyx":990
 *             glPushMatrix()
 *             glTranslatef(0.0, 0.0, pgram_height)
 *             glCallList(self.pgram_list_id)             # <<<<<<<<<<<<<<
 *             glPopMatrix()
 * 
 */
    glCallList(__pyx_v_self->pgram_list_id);

    /* "CyOpenGL.pyx":991
 *             glTranslatef(0.0, 0.0, pgram_height)
 *             glCallList(self.pgram_list_id)
 *             glPopMatrix()             # <<<<<<<<<<<<<<
 * 
 *     def draw(self, *args):
 */
    glPopMatrix();

    /* "CyOpenGL.pyx":987
 *                 glCallList(self.Ford_dark_list_id)
 *         glPopMatrix()
 *         if self.pgram_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(0.0, 0.0, pgram_height)
 */
  }

  /* "CyOpenGL.pyx":972
 *         self.labels.build_display_list(self.labels_list_id, self.shifts)
 * 
 *     cdef draw_segments(self, ford_height, pgram_height):             # <<<<<<<<<<<<<<
 *         with_horoballs = self.horo_var.get()
 *         glPushMatrix()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.draw_segments", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_with_horoballs);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":993
 *             glPopMatrix()
 * 
 *     def draw(self, *args):             # <<<<<<<<<<<<<<
 *         """
 *         The scene is drawn translated by self.offset, but the
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_13draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballScene_12draw[] = "HoroballScene.draw(self, *args)\n\n        The scene is drawn translated by self.offset, but the\n        parallelogram stays fixed.\n        ";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_13draw(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  CYTHON_UNUSED PyObject *__pyx_v_args = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("draw (wrapper)", 0);
  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "draw", 0))) return NULL;
  __Pyx_INCREF(__pyx_args);
  __pyx_v_args = __pyx_args;
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_12draw(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), __pyx_v_args);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_args);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_12draw(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_args) {
  double __pyx_v_label_height;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  GLfloat __pyx_t_6;
  GLfloat __pyx_t_7;
  __Pyx_RefNannySetupContext("draw", 0);

  /* "CyOpenGL.pyx":998
 *         parallelogram stays fixed.
 *         """
 *         if self.nbhd is None:             # <<<<<<<<<<<<<<
 *             return
 *         glPushMatrix()
 */
  __pyx_t_1 = (__pyx_v_self->nbhd == Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "CyOpenGL.pyx":999
 *         """
 *         if self.nbhd is None:
 *             return             # <<<<<<<<<<<<<<
 *         glPushMatrix()
 *         if self.flipped:
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "CyOpenGL.pyx":998
 *         parallelogram stays fixed.
 *         """
 *         if self.nbhd is None:             # <<<<<<<<<<<<<<
 *             return
 *         glPushMatrix()
 */
  }

  /* "CyOpenGL.pyx":1000
 *         if self.nbhd is None:
 *             return
 *         glPushMatrix()             # <<<<<<<<<<<<<<
 *         if self.flipped:
 *             self.draw_segments(-2.0, -2.2)
 */
  glPushMatrix();

  /* "CyOpenGL.pyx":1001
 *             return
 *         glPushMatrix()
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             self.draw_segments(-2.0, -2.2)
 *             label_height = -2.4
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_self->flipped); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1001, __pyx_L1_error)
  if (__pyx_t_2) {

    /* "CyOpenGL.pyx":1002
 *         glPushMatrix()
 *         if self.flipped:
 *             self.draw_segments(-2.0, -2.2)             # <<<<<<<<<<<<<<
 *             label_height = -2.4
 *         else:
 */
    __pyx_t_3 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *)__pyx_v_self->__pyx_vtab)->draw_segments(__pyx_v_self, __pyx_float_neg_2_0, __pyx_float_neg_2_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1002, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1003
 *         if self.flipped:
 *             self.draw_segments(-2.0, -2.2)
 *             label_height = -2.4             # <<<<<<<<<<<<<<
 *         else:
 *             self.draw_segments(2.0, 2.2)
 */
    __pyx_v_label_height = -2.4;

    /* "CyOpenGL.pyx":1001
 *             return
 *         glPushMatrix()
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             self.draw_segments(-2.0, -2.2)
 *             label_height = -2.4
 */
    goto __pyx_L4;
  }

  /* "CyOpenGL.pyx":1005
 *             label_height = -2.4
 *         else:
 *             self.draw_segments(2.0, 2.2)             # <<<<<<<<<<<<<<
 *             label_height = 2.4
 *         if self.horo_var.get():
 */
  /*else*/ {
    __pyx_t_3 = ((struct __pyx_vtabstruct_8CyOpenGL_HoroballScene *)__pyx_v_self->__pyx_vtab)->draw_segments(__pyx_v_self, __pyx_float_2_0, __pyx_float_2_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1005, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1006
 *         else:
 *             self.draw_segments(2.0, 2.2)
 *             label_height = 2.4             # <<<<<<<<<<<<<<
 *         if self.horo_var.get():
 *             glPushMatrix()
 */
    __pyx_v_label_height = 2.4;
  }
  __pyx_L4:;

  /* "CyOpenGL.pyx":1007
 *             self.draw_segments(2.0, 2.2)
 *             label_height = 2.4
 *         if self.horo_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->horo_var, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1007, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1007, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "CyOpenGL.pyx":1008
 *             label_height = 2.4
 *         if self.horo_var.get():
 *             glPushMatrix()             # <<<<<<<<<<<<<<
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)
 *             glCallList(self.ball_list_id)
 */
    glPushMatrix();

    /* "CyOpenGL.pyx":1009
 *         if self.horo_var.get():
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)             # <<<<<<<<<<<<<<
 *             glCallList(self.ball_list_id)
 *             glPopMatrix()
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_n_s_imag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1009, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1009, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    glTranslatef(__pyx_t_6, __pyx_t_7, 0.0);

    /* "CyOpenGL.pyx":1010
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)
 *             glCallList(self.ball_list_id)             # <<<<<<<<<<<<<<
 *             glPopMatrix()
 *         if self.label_var.get():
 */
    glCallList(__pyx_v_self->ball_list_id);

    /* "CyOpenGL.pyx":1011
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)
 *             glCallList(self.ball_list_id)
 *             glPopMatrix()             # <<<<<<<<<<<<<<
 *         if self.label_var.get():
 *             glPushMatrix()
 */
    glPopMatrix();

    /* "CyOpenGL.pyx":1007
 *             self.draw_segments(2.0, 2.2)
 *             label_height = 2.4
 *         if self.horo_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, 0.0)
 */
  }

  /* "CyOpenGL.pyx":1012
 *             glCallList(self.ball_list_id)
 *             glPopMatrix()
 *         if self.label_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->label_var, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1012, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_2) {

    /* "CyOpenGL.pyx":1013
 *             glPopMatrix()
 *         if self.label_var.get():
 *             glPushMatrix()             # <<<<<<<<<<<<<<
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)
 *             glCallList(self.labels_list_id)
 */
    glPushMatrix();

    /* "CyOpenGL.pyx":1014
 *         if self.label_var.get():
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)             # <<<<<<<<<<<<<<
 *             glCallList(self.labels_list_id)
 *             glPopMatrix()
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_n_s_real); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_7 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->offset, __pyx_n_s_imag); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __pyx_PyFloat_AsFloat(__pyx_t_3); if (unlikely((__pyx_t_6 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    glTranslatef(__pyx_t_7, __pyx_t_6, __pyx_v_label_height);

    /* "CyOpenGL.pyx":1015
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)
 *             glCallList(self.labels_list_id)             # <<<<<<<<<<<<<<
 *             glPopMatrix()
 *         glPopMatrix()
 */
    glCallList(__pyx_v_self->labels_list_id);

    /* "CyOpenGL.pyx":1016
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)
 *             glCallList(self.labels_list_id)
 *             glPopMatrix()             # <<<<<<<<<<<<<<
 *         glPopMatrix()
 * 
 */
    glPopMatrix();

    /* "CyOpenGL.pyx":1012
 *             glCallList(self.ball_list_id)
 *             glPopMatrix()
 *         if self.label_var.get():             # <<<<<<<<<<<<<<
 *             glPushMatrix()
 *             glTranslatef(self.offset.real, self.offset.imag, label_height)
 */
  }

  /* "CyOpenGL.pyx":1017
 *             glCallList(self.labels_list_id)
 *             glPopMatrix()
 *         glPopMatrix()             # <<<<<<<<<<<<<<
 * 
 * # Methods to translate and rotate our scene.
 */
  glPopMatrix();

  /* "CyOpenGL.pyx":993
 *             glPopMatrix()
 * 
 *     def draw(self, *args):             # <<<<<<<<<<<<<<
 *         """
 *         The scene is drawn translated by self.offset, but the
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.draw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballScene_14__reduce_cython__[] = "HoroballScene.__reduce_cython__(self)";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_15__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_14__reduce_cython__(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_14__reduce_cython__(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_t_13;
  int __pyx_t_14;
  int __pyx_t_15;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.Ford, self.Ford_dark_list_id, self.Ford_light_list_id, self.Ford_var, self.Xangle, self.Yangle, self.ball_list_id, self.cusp_view, self.cutoff, self.flipped, self.horo_var, self.label_var, self.labels, self.labels_list_id, self.longitude, self.meridian, self.nbhd, self.offset, self.pgram, self.pgram_list_id, self.pgram_var, self.shifts, self.tri, self.tri_dark_list_id, self.tri_light_list_id, self.tri_var, self.which_cusp)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_GLuint(__pyx_v_self->Ford_dark_list_id); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_GLuint(__pyx_v_self->Ford_light_list_id); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_self->Xangle); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_self->Yangle); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyInt_From_GLuint(__pyx_v_self->ball_list_id); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_self->cutoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyInt_From_GLuint(__pyx_v_self->labels_list_id); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyInt_From_GLuint(__pyx_v_self->pgram_list_id); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_PyInt_From_GLuint(__pyx_v_self->tri_dark_list_id); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = __Pyx_PyInt_From_GLuint(__pyx_v_self->tri_light_list_id); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_self->which_cusp); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_11);
  __pyx_t_12 = PyTuple_New(27); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __Pyx_INCREF(__pyx_v_self->Ford);
  __Pyx_GIVEREF(__pyx_v_self->Ford);
  PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v_self->Ford);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_t_2);
  __Pyx_INCREF(__pyx_v_self->Ford_var);
  __Pyx_GIVEREF(__pyx_v_self->Ford_var);
  PyTuple_SET_ITEM(__pyx_t_12, 3, __pyx_v_self->Ford_var);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_12, 4, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_12, 5, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_5);
  PyTuple_SET_ITEM(__pyx_t_12, 6, __pyx_t_5);
  __Pyx_INCREF(__pyx_v_self->cusp_view);
  __Pyx_GIVEREF(__pyx_v_self->cusp_view);
  PyTuple_SET_ITEM(__pyx_t_12, 7, __pyx_v_self->cusp_view);
  __Pyx_GIVEREF(__pyx_t_6);
  PyTuple_SET_ITEM(__pyx_t_12, 8, __pyx_t_6);
  __Pyx_INCREF(__pyx_v_self->flipped);
  __Pyx_GIVEREF(__pyx_v_self->flipped);
  PyTuple_SET_ITEM(__pyx_t_12, 9, __pyx_v_self->flipped);
  __Pyx_INCREF(__pyx_v_self->horo_var);
  __Pyx_GIVEREF(__pyx_v_self->horo_var);
  PyTuple_SET_ITEM(__pyx_t_12, 10, __pyx_v_self->horo_var);
  __Pyx_INCREF(__pyx_v_self->label_var);
  __Pyx_GIVEREF(__pyx_v_self->label_var);
  PyTuple_SET_ITEM(__pyx_t_12, 11, __pyx_v_self->label_var);
  __Pyx_INCREF(__pyx_v_self->labels);
  __Pyx_GIVEREF(__pyx_v_self->labels);
  PyTuple_SET_ITEM(__pyx_t_12, 12, __pyx_v_self->labels);
  __Pyx_GIVEREF(__pyx_t_7);
  PyTuple_SET_ITEM(__pyx_t_12, 13, __pyx_t_7);
  __Pyx_INCREF(__pyx_v_self->longitude);
  __Pyx_GIVEREF(__pyx_v_self->longitude);
  PyTuple_SET_ITEM(__pyx_t_12, 14, __pyx_v_self->longitude);
  __Pyx_INCREF(__pyx_v_self->meridian);
  __Pyx_GIVEREF(__pyx_v_self->meridian);
  PyTuple_SET_ITEM(__pyx_t_12, 15, __pyx_v_self->meridian);
  __Pyx_INCREF(__pyx_v_self->nbhd);
  __Pyx_GIVEREF(__pyx_v_self->nbhd);
  PyTuple_SET_ITEM(__pyx_t_12, 16, __pyx_v_self->nbhd);
  __Pyx_INCREF(__pyx_v_self->offset);
  __Pyx_GIVEREF(__pyx_v_self->offset);
  PyTuple_SET_ITEM(__pyx_t_12, 17, __pyx_v_self->offset);
  __Pyx_INCREF(__pyx_v_self->pgram);
  __Pyx_GIVEREF(__pyx_v_self->pgram);
  PyTuple_SET_ITEM(__pyx_t_12, 18, __pyx_v_self->pgram);
  __Pyx_GIVEREF(__pyx_t_8);
  PyTuple_SET_ITEM(__pyx_t_12, 19, __pyx_t_8);
  __Pyx_INCREF(__pyx_v_self->pgram_var);
  __Pyx_GIVEREF(__pyx_v_self->pgram_var);
  PyTuple_SET_ITEM(__pyx_t_12, 20, __pyx_v_self->pgram_var);
  __Pyx_INCREF(__pyx_v_self->shifts);
  __Pyx_GIVEREF(__pyx_v_self->shifts);
  PyTuple_SET_ITEM(__pyx_t_12, 21, __pyx_v_self->shifts);
  __Pyx_INCREF(__pyx_v_self->tri);
  __Pyx_GIVEREF(__pyx_v_self->tri);
  PyTuple_SET_ITEM(__pyx_t_12, 22, __pyx_v_self->tri);
  __Pyx_GIVEREF(__pyx_t_9);
  PyTuple_SET_ITEM(__pyx_t_12, 23, __pyx_t_9);
  __Pyx_GIVEREF(__pyx_t_10);
  PyTuple_SET_ITEM(__pyx_t_12, 24, __pyx_t_10);
  __Pyx_INCREF(__pyx_v_self->tri_var);
  __Pyx_GIVEREF(__pyx_v_self->tri_var);
  PyTuple_SET_ITEM(__pyx_t_12, 25, __pyx_v_self->tri_var);
  __Pyx_GIVEREF(__pyx_t_11);
  PyTuple_SET_ITEM(__pyx_t_12, 26, __pyx_t_11);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_7 = 0;
  __pyx_t_8 = 0;
  __pyx_t_9 = 0;
  __pyx_t_10 = 0;
  __pyx_t_11 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_12);
  __pyx_t_12 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.Ford, self.Ford_dark_list_id, self.Ford_light_list_id, self.Ford_var, self.Xangle, self.Yangle, self.ball_list_id, self.cusp_view, self.cutoff, self.flipped, self.horo_var, self.label_var, self.labels, self.labels_list_id, self.longitude, self.meridian, self.nbhd, self.offset, self.pgram, self.pgram_list_id, self.pgram_var, self.shifts, self.tri, self.tri_dark_list_id, self.tri_light_list_id, self.tri_var, self.which_cusp)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_12 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_12);
  __pyx_v__dict = __pyx_t_12;
  __pyx_t_12 = 0;

  /* "(tree fragment)":7
 *     state = (self.Ford, self.Ford_dark_list_id, self.Ford_light_list_id, self.Ford_var, self.Xangle, self.Yangle, self.ball_list_id, self.cusp_view, self.cutoff, self.flipped, self.horo_var, self.label_var, self.labels, self.labels_list_id, self.longitude, self.meridian, self.nbhd, self.offset, self.pgram, self.pgram_list_id, self.pgram_var, self.shifts, self.tri, self.tri_dark_list_id, self.tri_light_list_id, self.tri_var, self.which_cusp)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_13 = (__pyx_v__dict != Py_None);
  __pyx_t_14 = (__pyx_t_13 != 0);
  if (__pyx_t_14) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_12 = PyTuple_New(1); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_v__dict);
    __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_11));
    __pyx_t_11 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = self.Ford is not None or self.Ford_var is not None or self.cusp_view is not None or self.flipped is not None or self.horo_var is not None or self.label_var is not None or self.labels is not None or self.longitude is not None or self.meridian is not None or self.nbhd is not None or self.offset is not None or self.pgram is not None or self.pgram_var is not None or self.shifts is not None or self.tri is not None or self.tri_var is not None
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.Ford, self.Ford_dark_list_id, self.Ford_light_list_id, self.Ford_var, self.Xangle, self.Yangle, self.ball_list_id, self.cusp_view, self.cutoff, self.flipped, self.horo_var, self.label_var, self.labels, self.labels_list_id, self.longitude, self.meridian, self.nbhd, self.offset, self.pgram, self.pgram_list_id, self.pgram_var, self.shifts, self.tri, self.tri_dark_list_id, self.tri_light_list_id, self.tri_var, self.which_cusp)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = self.Ford is not None or self.Ford_var is not None or self.cusp_view is not None or self.flipped is not None or self.horo_var is not None or self.label_var is not None or self.labels is not None or self.longitude is not None or self.meridian is not None or self.nbhd is not None or self.offset is not None or self.pgram is not None or self.pgram_var is not None or self.shifts is not None or self.tri is not None or self.tri_var is not None             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_HoroballScene, (type(self), 0xcc0e0ec, None), state
 */
  /*else*/ {
    __pyx_t_13 = (__pyx_v_self->Ford != Py_None);
    __pyx_t_15 = (__pyx_t_13 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_14 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->Ford_var != Py_None);
    __pyx_t_13 = (__pyx_t_15 != 0);
    if (!__pyx_t_13) {
    } else {
      __pyx_t_14 = __pyx_t_13;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_13 = (__pyx_v_self->cusp_view != Py_None);
    __pyx_t_15 = (__pyx_t_13 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_14 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->flipped != Py_None);
    __pyx_t_13 = (__pyx_t_15 != 0);
    if (!__pyx_t_13) {
    } else {
      __pyx_t_14 = __pyx_t_13;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_13 = (__pyx_v_self->horo_var != Py_None);
    __pyx_t_15 = (__pyx_t_13 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_14 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->label_var != Py_None);
    __pyx_t_13 = (__pyx_t_15 != 0);
    if (!__pyx_t_13) {
    } else {
      __pyx_t_14 = __pyx_t_13;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_13 = (__pyx_v_self->labels != Py_None);
    __pyx_t_15 = (__pyx_t_13 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_14 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->longitude != Py_None);
    __pyx_t_13 = (__pyx_t_15 != 0);
    if (!__pyx_t_13) {
    } else {
      __pyx_t_14 = __pyx_t_13;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_13 = (__pyx_v_self->meridian != Py_None);
    __pyx_t_15 = (__pyx_t_13 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_14 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->nbhd != Py_None);
    __pyx_t_13 = (__pyx_t_15 != 0);
    if (!__pyx_t_13) {
    } else {
      __pyx_t_14 = __pyx_t_13;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_13 = (__pyx_v_self->offset != Py_None);
    __pyx_t_15 = (__pyx_t_13 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_14 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->pgram != Py_None);
    __pyx_t_13 = (__pyx_t_15 != 0);
    if (!__pyx_t_13) {
    } else {
      __pyx_t_14 = __pyx_t_13;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_13 = (__pyx_v_self->pgram_var != Py_None);
    __pyx_t_15 = (__pyx_t_13 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_14 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->shifts != Py_None);
    __pyx_t_13 = (__pyx_t_15 != 0);
    if (!__pyx_t_13) {
    } else {
      __pyx_t_14 = __pyx_t_13;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_13 = (__pyx_v_self->tri != Py_None);
    __pyx_t_15 = (__pyx_t_13 != 0);
    if (!__pyx_t_15) {
    } else {
      __pyx_t_14 = __pyx_t_15;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_15 = (__pyx_v_self->tri_var != Py_None);
    __pyx_t_13 = (__pyx_t_15 != 0);
    __pyx_t_14 = __pyx_t_13;
    __pyx_L4_bool_binop_done:;
    __pyx_v_use_setstate = __pyx_t_14;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.Ford is not None or self.Ford_var is not None or self.cusp_view is not None or self.flipped is not None or self.horo_var is not None or self.label_var is not None or self.labels is not None or self.longitude is not None or self.meridian is not None or self.nbhd is not None or self.offset is not None or self.pgram is not None or self.pgram_var is not None or self.shifts is not None or self.tri is not None or self.tri_var is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_HoroballScene, (type(self), 0xcc0e0ec, None), state
 *     else:
 */
  __pyx_t_14 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_14) {

    /* "(tree fragment)":13
 *         use_setstate = self.Ford is not None or self.Ford_var is not None or self.cusp_view is not None or self.flipped is not None or self.horo_var is not None or self.label_var is not None or self.labels is not None or self.longitude is not None or self.meridian is not None or self.nbhd is not None or self.offset is not None or self.pgram is not None or self.pgram_var is not None or self.shifts is not None or self.tri is not None or self.tri_var is not None
 *     if use_setstate:
 *         return __pyx_unpickle_HoroballScene, (type(self), 0xcc0e0ec, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_HoroballScene, (type(self), 0xcc0e0ec, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_11, __pyx_n_s_pyx_unpickle_HoroballScene); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_213967084);
    __Pyx_GIVEREF(__pyx_int_213967084);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_213967084);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_12, 2, Py_None);
    __pyx_t_10 = PyTuple_New(3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_11);
    PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_v_state);
    __pyx_t_11 = 0;
    __pyx_t_12 = 0;
    __pyx_r = __pyx_t_10;
    __pyx_t_10 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = self.Ford is not None or self.Ford_var is not None or self.cusp_view is not None or self.flipped is not None or self.horo_var is not None or self.label_var is not None or self.labels is not None or self.longitude is not None or self.meridian is not None or self.nbhd is not None or self.offset is not None or self.pgram is not None or self.pgram_var is not None or self.shifts is not None or self.tri is not None or self.tri_var is not None
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_HoroballScene, (type(self), 0xcc0e0ec, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_HoroballScene, (type(self), 0xcc0e0ec, None), state
 *     else:
 *         return __pyx_unpickle_HoroballScene, (type(self), 0xcc0e0ec, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_HoroballScene__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_pyx_unpickle_HoroballScene); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = PyTuple_New(3); if (unlikely(!__pyx_t_12)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_12, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_213967084);
    __Pyx_GIVEREF(__pyx_int_213967084);
    PyTuple_SET_ITEM(__pyx_t_12, 1, __pyx_int_213967084);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_12, 2, __pyx_v_state);
    __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_GIVEREF(__pyx_t_10);
    PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10);
    __Pyx_GIVEREF(__pyx_t_12);
    PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_12);
    __pyx_t_10 = 0;
    __pyx_t_12 = 0;
    __pyx_r = __pyx_t_11;
    __pyx_t_11 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_HoroballScene, (type(self), 0xcc0e0ec, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_HoroballScene__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
static char __pyx_doc_8CyOpenGL_13HoroballScene_16__setstate_cython__[] = "HoroballScene.__setstate_cython__(self, __pyx_state)";
static PyObject *__pyx_pw_8CyOpenGL_13HoroballScene_17__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_13HoroballScene_16__setstate_cython__(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_13HoroballScene_16__setstate_cython__(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_HoroballScene, (type(self), 0xcc0e0ec, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_HoroballScene__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_8CyOpenGL___pyx_unpickle_HoroballScene__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_HoroballScene, (type(self), 0xcc0e0ec, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_HoroballScene__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("CyOpenGL.HoroballScene.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1021
 * # Methods to translate and rotate our scene.
 * 
 * cdef glTranslateScene(s, x, y, mousex, mousey):             # <<<<<<<<<<<<<<
 *     cdef GLdouble X, Y
 *     cdef GLdouble mat[16]
 */

static PyObject *__pyx_f_8CyOpenGL_glTranslateScene(PyObject *__pyx_v_s, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_mousex, PyObject *__pyx_v_mousey) {
  GLdouble __pyx_v_X;
  GLdouble __pyx_v_Y;
  GLdouble __pyx_v_mat[16];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  GLdouble __pyx_t_3;
  GLdouble __pyx_t_4;
  __Pyx_RefNannySetupContext("glTranslateScene", 0);

  /* "CyOpenGL.pyx":1025
 *     cdef GLdouble mat[16]
 * 
 *     X, Y = s * (x - mousex), s * (mousey - y)             # <<<<<<<<<<<<<<
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
 *     glLoadIdentity()
 */
  __pyx_t_1 = PyNumber_Subtract(__pyx_v_x, __pyx_v_mousex); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_s, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Subtract(__pyx_v_mousey, __pyx_v_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1025, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_X = __pyx_t_3;
  __pyx_v_Y = __pyx_t_4;

  /* "CyOpenGL.pyx":1026
 * 
 *     X, Y = s * (x - mousex), s * (mousey - y)
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)             # <<<<<<<<<<<<<<
 *     glLoadIdentity()
 *     glTranslatef(X, Y, 0.0)
 */
  glGetDoublev(GL_MODELVIEW_MATRIX, __pyx_v_mat);

  /* "CyOpenGL.pyx":1027
 *     X, Y = s * (x - mousex), s * (mousey - y)
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
 *     glLoadIdentity()             # <<<<<<<<<<<<<<
 *     glTranslatef(X, Y, 0.0)
 *     glMultMatrixd(mat)
 */
  glLoadIdentity();

  /* "CyOpenGL.pyx":1028
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
 *     glLoadIdentity()
 *     glTranslatef(X, Y, 0.0)             # <<<<<<<<<<<<<<
 *     glMultMatrixd(mat)
 * 
 */
  glTranslatef(__pyx_v_X, __pyx_v_Y, 0.0);

  /* "CyOpenGL.pyx":1029
 *     glLoadIdentity()
 *     glTranslatef(X, Y, 0.0)
 *     glMultMatrixd(mat)             # <<<<<<<<<<<<<<
 * 
 * cdef glRotateScene(xcenter, ycenter, zcenter, Xangle, Yangle):
 */
  glMultMatrixd(__pyx_v_mat);

  /* "CyOpenGL.pyx":1021
 * # Methods to translate and rotate our scene.
 * 
 * cdef glTranslateScene(s, x, y, mousex, mousey):             # <<<<<<<<<<<<<<
 *     cdef GLdouble X, Y
 *     cdef GLdouble mat[16]
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.glTranslateScene", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1031
 *     glMultMatrixd(mat)
 * 
 * cdef glRotateScene(xcenter, ycenter, zcenter, Xangle, Yangle):             # <<<<<<<<<<<<<<
 *     cdef GLdouble mat[16]
 * 
 */

static PyObject *__pyx_f_8CyOpenGL_glRotateScene(PyObject *__pyx_v_xcenter, PyObject *__pyx_v_ycenter, PyObject *__pyx_v_zcenter, PyObject *__pyx_v_Xangle, PyObject *__pyx_v_Yangle) {
  GLdouble __pyx_v_mat[16];
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  GLfloat __pyx_t_1;
  GLfloat __pyx_t_2;
  GLfloat __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("glRotateScene", 0);

  /* "CyOpenGL.pyx":1034
 *     cdef GLdouble mat[16]
 * 
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)             # <<<<<<<<<<<<<<
 *     glLoadIdentity()
 *     glTranslatef(xcenter, ycenter, zcenter)
 */
  glGetDoublev(GL_MODELVIEW_MATRIX, __pyx_v_mat);

  /* "CyOpenGL.pyx":1035
 * 
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
 *     glLoadIdentity()             # <<<<<<<<<<<<<<
 *     glTranslatef(xcenter, ycenter, zcenter)
 *     glRotatef(Yangle, 1., 0., 0.)
 */
  glLoadIdentity();

  /* "CyOpenGL.pyx":1036
 *     glGetDoublev(GL_MODELVIEW_MATRIX, mat)
 *     glLoadIdentity()
 *     glTranslatef(xcenter, ycenter, zcenter)             # <<<<<<<<<<<<<<
 *     glRotatef(Yangle, 1., 0., 0.)
 *     glRotatef(Xangle, 0., 1., 0.)
 */
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_v_xcenter); if (unlikely((__pyx_t_1 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1036, __pyx_L1_error)
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_v_ycenter); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1036, __pyx_L1_error)
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_zcenter); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1036, __pyx_L1_error)
  glTranslatef(__pyx_t_1, __pyx_t_2, __pyx_t_3);

  /* "CyOpenGL.pyx":1037
 *     glLoadIdentity()
 *     glTranslatef(xcenter, ycenter, zcenter)
 *     glRotatef(Yangle, 1., 0., 0.)             # <<<<<<<<<<<<<<
 *     glRotatef(Xangle, 0., 1., 0.)
 *     glTranslatef(-xcenter, -ycenter, -zcenter)
 */
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_Yangle); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1037, __pyx_L1_error)
  glRotatef(__pyx_t_3, 1., 0., 0.);

  /* "CyOpenGL.pyx":1038
 *     glTranslatef(xcenter, ycenter, zcenter)
 *     glRotatef(Yangle, 1., 0., 0.)
 *     glRotatef(Xangle, 0., 1., 0.)             # <<<<<<<<<<<<<<
 *     glTranslatef(-xcenter, -ycenter, -zcenter)
 *     glMultMatrixd(mat)
 */
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_v_Xangle); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1038, __pyx_L1_error)
  glRotatef(__pyx_t_3, 0., 1., 0.);

  /* "CyOpenGL.pyx":1039
 *     glRotatef(Yangle, 1., 0., 0.)
 *     glRotatef(Xangle, 0., 1., 0.)
 *     glTranslatef(-xcenter, -ycenter, -zcenter)             # <<<<<<<<<<<<<<
 *     glMultMatrixd(mat)
 * 
 */
  __pyx_t_4 = PyNumber_Negative(__pyx_v_xcenter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Negative(__pyx_v_ycenter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Negative(__pyx_v_zcenter); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1039, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_1 = __pyx_PyFloat_AsFloat(__pyx_t_4); if (unlikely((__pyx_t_1 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  glTranslatef(__pyx_t_3, __pyx_t_2, __pyx_t_1);

  /* "CyOpenGL.pyx":1040
 *     glRotatef(Xangle, 0., 1., 0.)
 *     glTranslatef(-xcenter, -ycenter, -zcenter)
 *     glMultMatrixd(mat)             # <<<<<<<<<<<<<<
 * 
 * class RawOpenGLWidget(Tk_.Widget, Tk_.Misc):
 */
  glMultMatrixd(__pyx_v_mat);

  /* "CyOpenGL.pyx":1031
 *     glMultMatrixd(mat)
 * 
 * cdef glRotateScene(xcenter, ycenter, zcenter, Xangle, Yangle):             # <<<<<<<<<<<<<<
 *     cdef GLdouble mat[16]
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("CyOpenGL.glRotateScene", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1048
 *     """
 * 
 *     def __init__(self, master, cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         curr_platform = sys.platform
 *         cpu_width = platform.architecture()[0]
 */

static PyObject *__pyx_pf_8CyOpenGL_8__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_cnf);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_cnf);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self)->__pyx_arg_cnf);
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_15RawOpenGLWidget___init__[] = "RawOpenGLWidget.__init__(self, master, cnf={}, **kw)";
static PyMethodDef __pyx_mdef_8CyOpenGL_15RawOpenGLWidget_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_15RawOpenGLWidget_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15RawOpenGLWidget___init__};
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_master = 0;
  PyObject *__pyx_v_cnf = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_master,&__pyx_n_s_cnf,0};
    PyObject* values[3] = {0,0,0};
    __pyx_defaults *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_self);
    values[2] = __pyx_dynamic_args->__pyx_arg_cnf;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_master)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 1048, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cnf);
          if (value) { values[2] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1048, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_master = values[1];
    __pyx_v_cnf = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1048, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15RawOpenGLWidget___init__(__pyx_self, __pyx_v_self, __pyx_v_master, __pyx_v_cnf, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_master, PyObject *__pyx_v_cnf, PyObject *__pyx_v_kw) {
  PyObject *__pyx_v_curr_platform = NULL;
  PyObject *__pyx_v_cpu_width = NULL;
  PyObject *__pyx_v_windows_version = NULL;
  PyObject *__pyx_v_suffix = NULL;
  PyObject *__pyx_v_Togl_path = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":1049
 * 
 *     def __init__(self, master, cnf={}, **kw):
 *         curr_platform = sys.platform             # <<<<<<<<<<<<<<
 *         cpu_width = platform.architecture()[0]
 *         if curr_platform[:5] == 'linux':
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1049, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_curr_platform = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1050
 *     def __init__(self, master, cnf={}, **kw):
 *         curr_platform = sys.platform
 *         cpu_width = platform.architecture()[0]             # <<<<<<<<<<<<<<
 *         if curr_platform[:5] == 'linux':
 *             curr_platform = 'linux2'
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_architecture); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1050, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_cpu_width = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1051
 *         curr_platform = sys.platform
 *         cpu_width = platform.architecture()[0]
 *         if curr_platform[:5] == 'linux':             # <<<<<<<<<<<<<<
 *             curr_platform = 'linux2'
 *         if curr_platform[:5] == "linux" and cpu_width == '64bit':
 */
  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_curr_platform, 0, 5, NULL, NULL, &__pyx_slice__47, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_linux, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":1052
 *         cpu_width = platform.architecture()[0]
 *         if curr_platform[:5] == 'linux':
 *             curr_platform = 'linux2'             # <<<<<<<<<<<<<<
 *         if curr_platform[:5] == "linux" and cpu_width == '64bit':
 *             curr_platform += "-x86_64"
 */
    __Pyx_INCREF(__pyx_n_s_linux2);
    __Pyx_DECREF_SET(__pyx_v_curr_platform, __pyx_n_s_linux2);

    /* "CyOpenGL.pyx":1051
 *         curr_platform = sys.platform
 *         cpu_width = platform.architecture()[0]
 *         if curr_platform[:5] == 'linux':             # <<<<<<<<<<<<<<
 *             curr_platform = 'linux2'
 *         if curr_platform[:5] == "linux" and cpu_width == '64bit':
 */
  }

  /* "CyOpenGL.pyx":1053
 *         if curr_platform[:5] == 'linux':
 *             curr_platform = 'linux2'
 *         if curr_platform[:5] == "linux" and cpu_width == '64bit':             # <<<<<<<<<<<<<<
 *             curr_platform += "-x86_64"
 *         if curr_platform == 'win32':
 */
  __pyx_t_3 = __Pyx_PyObject_GetSlice(__pyx_v_curr_platform, 0, 5, NULL, NULL, &__pyx_slice__47, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1053, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_linux, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1053, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {
  } else {
    __pyx_t_4 = __pyx_t_5;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_5 = (__Pyx_PyString_Equals(__pyx_v_cpu_width, __pyx_kp_s_64bit, Py_EQ)); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 1053, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_5;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":1054
 *             curr_platform = 'linux2'
 *         if curr_platform[:5] == "linux" and cpu_width == '64bit':
 *             curr_platform += "-x86_64"             # <<<<<<<<<<<<<<
 *         if curr_platform == 'win32':
 *             windows_version = sys.getwindowsversion()
 */
    __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_v_curr_platform, __pyx_kp_s_x86_64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1054, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF_SET(__pyx_v_curr_platform, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1053
 *         if curr_platform[:5] == 'linux':
 *             curr_platform = 'linux2'
 *         if curr_platform[:5] == "linux" and cpu_width == '64bit':             # <<<<<<<<<<<<<<
 *             curr_platform += "-x86_64"
 *         if curr_platform == 'win32':
 */
  }

  /* "CyOpenGL.pyx":1055
 *         if curr_platform[:5] == "linux" and cpu_width == '64bit':
 *             curr_platform += "-x86_64"
 *         if curr_platform == 'win32':             # <<<<<<<<<<<<<<
 *             windows_version = sys.getwindowsversion()
 *             if (windows_version.major, windows_version.minor) > (6,0):
 */
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_curr_platform, __pyx_n_s_win32, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1055, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":1056
 *             curr_platform += "-x86_64"
 *         if curr_platform == 'win32':
 *             windows_version = sys.getwindowsversion()             # <<<<<<<<<<<<<<
 *             if (windows_version.major, windows_version.minor) > (6,0):
 *                 curr_platform += 'VC'
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sys); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_getwindowsversion); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
      }
    }
    __pyx_t_3 = (__pyx_t_2) ? __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_2) : __Pyx_PyObject_CallNoArg(__pyx_t_1);
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1056, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_windows_version = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1057
 *         if curr_platform == 'win32':
 *             windows_version = sys.getwindowsversion()
 *             if (windows_version.major, windows_version.minor) > (6,0):             # <<<<<<<<<<<<<<
 *                 curr_platform += 'VC'
 *             if cpu_width == '64bit':
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_windows_version, __pyx_n_s_major); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_windows_version, __pyx_n_s_minor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1057, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_1);
    __pyx_t_3 = 0;
    __pyx_t_1 = 0;
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_tuple__48, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1057, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1057, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (__pyx_t_4) {

      /* "CyOpenGL.pyx":1058
 *             windows_version = sys.getwindowsversion()
 *             if (windows_version.major, windows_version.minor) > (6,0):
 *                 curr_platform += 'VC'             # <<<<<<<<<<<<<<
 *             if cpu_width == '64bit':
 *                 curr_platform += '-x86_64'
 */
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_curr_platform, __pyx_n_s_VC); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1058, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_curr_platform, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "CyOpenGL.pyx":1057
 *         if curr_platform == 'win32':
 *             windows_version = sys.getwindowsversion()
 *             if (windows_version.major, windows_version.minor) > (6,0):             # <<<<<<<<<<<<<<
 *                 curr_platform += 'VC'
 *             if cpu_width == '64bit':
 */
    }

    /* "CyOpenGL.pyx":1059
 *             if (windows_version.major, windows_version.minor) > (6,0):
 *                 curr_platform += 'VC'
 *             if cpu_width == '64bit':             # <<<<<<<<<<<<<<
 *                 curr_platform += '-x86_64'
 *         suffix = curr_platform + "-tk" + master.getvar("tk_version")
 */
    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_cpu_width, __pyx_kp_s_64bit, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1059, __pyx_L1_error)
    if (__pyx_t_4) {

      /* "CyOpenGL.pyx":1060
 *                 curr_platform += 'VC'
 *             if cpu_width == '64bit':
 *                 curr_platform += '-x86_64'             # <<<<<<<<<<<<<<
 *         suffix = curr_platform + "-tk" + master.getvar("tk_version")
 *         Togl_path = os.path.join(Togl_dir, suffix)
 */
      __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_curr_platform, __pyx_kp_s_x86_64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF_SET(__pyx_v_curr_platform, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "CyOpenGL.pyx":1059
 *             if (windows_version.major, windows_version.minor) > (6,0):
 *                 curr_platform += 'VC'
 *             if cpu_width == '64bit':             # <<<<<<<<<<<<<<
 *                 curr_platform += '-x86_64'
 *         suffix = curr_platform + "-tk" + master.getvar("tk_version")
 */
    }

    /* "CyOpenGL.pyx":1055
 *         if curr_platform[:5] == "linux" and cpu_width == '64bit':
 *             curr_platform += "-x86_64"
 *         if curr_platform == 'win32':             # <<<<<<<<<<<<<<
 *             windows_version = sys.getwindowsversion()
 *             if (windows_version.major, windows_version.minor) > (6,0):
 */
  }

  /* "CyOpenGL.pyx":1061
 *             if cpu_width == '64bit':
 *                 curr_platform += '-x86_64'
 *         suffix = curr_platform + "-tk" + master.getvar("tk_version")             # <<<<<<<<<<<<<<
 *         Togl_path = os.path.join(Togl_dir, suffix)
 *         if not os.path.exists(Togl_path):
 */
  __pyx_t_1 = PyNumber_Add(__pyx_v_curr_platform, __pyx_kp_s_tk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_master, __pyx_n_s_getvar); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_6, __pyx_n_s_tk_version) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_n_s_tk_version);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1061, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_suffix = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1062
 *                 curr_platform += '-x86_64'
 *         suffix = curr_platform + "-tk" + master.getvar("tk_version")
 *         Togl_path = os.path.join(Togl_dir, suffix)             # <<<<<<<<<<<<<<
 *         if not os.path.exists(Togl_path):
 *             raise RuntimeError('Togl directory "%s" missing.' % Togl_path)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_join); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_Togl_dir); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1062, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_suffix};
    __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_1, __pyx_v_suffix};
    __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1062, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
    __Pyx_INCREF(__pyx_v_suffix);
    __Pyx_GIVEREF(__pyx_v_suffix);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_suffix);
    __pyx_t_1 = 0;
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1062, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_Togl_path = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1063
 *         suffix = curr_platform + "-tk" + master.getvar("tk_version")
 *         Togl_path = os.path.join(Togl_dir, suffix)
 *         if not os.path.exists(Togl_path):             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Togl directory "%s" missing.' % Togl_path)
 * 
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_exists); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_8, __pyx_v_Togl_path) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_Togl_path);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1063, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (unlikely(__pyx_t_5)) {

    /* "CyOpenGL.pyx":1064
 *         Togl_path = os.path.join(Togl_dir, suffix)
 *         if not os.path.exists(Togl_path):
 *             raise RuntimeError('Togl directory "%s" missing.' % Togl_path)             # <<<<<<<<<<<<<<
 * 
 *         master.tk.call('lappend', 'auto_path', Togl_path)
 */
    __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Togl_directory_s_missing, __pyx_v_Togl_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1064, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1064, __pyx_L1_error)

    /* "CyOpenGL.pyx":1063
 *         suffix = curr_platform + "-tk" + master.getvar("tk_version")
 *         Togl_path = os.path.join(Togl_dir, suffix)
 *         if not os.path.exists(Togl_path):             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Togl directory "%s" missing.' % Togl_path)
 * 
 */
  }

  /* "CyOpenGL.pyx":1066
 *             raise RuntimeError('Togl directory "%s" missing.' % Togl_path)
 * 
 *         master.tk.call('lappend', 'auto_path', Togl_path)             # <<<<<<<<<<<<<<
 *         try:
 *             master.tk.call('package', 'require', 'Togl')
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_master, __pyx_n_s_tk_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_call); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1066, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_n_s_lappend, __pyx_n_s_auto_path, __pyx_v_Togl_path};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_n_s_lappend, __pyx_n_s_auto_path, __pyx_v_Togl_path};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_1 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1066, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_n_s_lappend);
    __Pyx_GIVEREF(__pyx_n_s_lappend);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_n_s_lappend);
    __Pyx_INCREF(__pyx_n_s_auto_path);
    __Pyx_GIVEREF(__pyx_n_s_auto_path);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_n_s_auto_path);
    __Pyx_INCREF(__pyx_v_Togl_path);
    __Pyx_GIVEREF(__pyx_v_Togl_path);
    PyTuple_SET_ITEM(__pyx_t_1, 2+__pyx_t_7, __pyx_v_Togl_path);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1066, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1067
 * 
 *         master.tk.call('lappend', 'auto_path', Togl_path)
 *         try:             # <<<<<<<<<<<<<<
 *             master.tk.call('package', 'require', 'Togl')
 *         except Tk_.TclError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
    __Pyx_XGOTREF(__pyx_t_9);
    __Pyx_XGOTREF(__pyx_t_10);
    __Pyx_XGOTREF(__pyx_t_11);
    /*try:*/ {

      /* "CyOpenGL.pyx":1068
 *         master.tk.call('lappend', 'auto_path', Togl_path)
 *         try:
 *             master.tk.call('package', 'require', 'Togl')             # <<<<<<<<<<<<<<
 *         except Tk_.TclError:
 *             raise RuntimeError('Tcl can not find Togl even though directory %s exists' % Togl_path)
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_master, __pyx_n_s_tk_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_call); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1068, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1068, __pyx_L11_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "CyOpenGL.pyx":1067
 * 
 *         master.tk.call('lappend', 'auto_path', Togl_path)
 *         try:             # <<<<<<<<<<<<<<
 *             master.tk.call('package', 'require', 'Togl')
 *         except Tk_.TclError:
 */
    }
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    goto __pyx_L16_try_end;
    __pyx_L11_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;

    /* "CyOpenGL.pyx":1069
 *         try:
 *             master.tk.call('package', 'require', 'Togl')
 *         except Tk_.TclError:             # <<<<<<<<<<<<<<
 *             raise RuntimeError('Tcl can not find Togl even though directory %s exists' % Togl_path)
 * 
 */
    __Pyx_ErrFetch(&__pyx_t_2, &__pyx_t_8, &__pyx_t_1);
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Tk); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1069, __pyx_L13_except_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_TclError); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1069, __pyx_L13_except_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_2, __pyx_t_6);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_ErrRestore(__pyx_t_2, __pyx_t_8, __pyx_t_1);
    __pyx_t_2 = 0; __pyx_t_8 = 0; __pyx_t_1 = 0;
    if (__pyx_t_7) {
      __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_1, &__pyx_t_8, &__pyx_t_2) < 0) __PYX_ERR(0, 1069, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_2);

      /* "CyOpenGL.pyx":1070
 *             master.tk.call('package', 'require', 'Togl')
 *         except Tk_.TclError:
 *             raise RuntimeError('Tcl can not find Togl even though directory %s exists' % Togl_path)             # <<<<<<<<<<<<<<
 * 
 *         Tk_.Widget.__init__(self, master, 'togl', cnf, kw)
 */
      __pyx_t_6 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Tcl_can_not_find_Togl_even_thoug, __pyx_v_Togl_path); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1070, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_RuntimeError, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1070, __pyx_L13_except_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __PYX_ERR(0, 1070, __pyx_L13_except_error)
    }
    goto __pyx_L13_except_error;
    __pyx_L13_except_error:;

    /* "CyOpenGL.pyx":1067
 * 
 *         master.tk.call('lappend', 'auto_path', Togl_path)
 *         try:             # <<<<<<<<<<<<<<
 *             master.tk.call('package', 'require', 'Togl')
 *         except Tk_.TclError:
 */
    __Pyx_XGIVEREF(__pyx_t_9);
    __Pyx_XGIVEREF(__pyx_t_10);
    __Pyx_XGIVEREF(__pyx_t_11);
    __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
    goto __pyx_L1_error;
    __pyx_L16_try_end:;
  }

  /* "CyOpenGL.pyx":1072
 *             raise RuntimeError('Tcl can not find Togl even though directory %s exists' % Togl_path)
 * 
 *         Tk_.Widget.__init__(self, master, 'togl', cnf, kw)             # <<<<<<<<<<<<<<
 *         self.root = master
 *         self.bind('<Map>', self.tkMap)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_8, __pyx_n_s_Tk); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_Widget); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1072, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[6] = {__pyx_t_1, __pyx_v_self, __pyx_v_master, __pyx_n_s_togl, __pyx_v_cnf, __pyx_v_kw};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 5+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[6] = {__pyx_t_1, __pyx_v_self, __pyx_v_master, __pyx_n_s_togl, __pyx_v_cnf, __pyx_v_kw};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 5+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(5+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_v_self);
    __Pyx_INCREF(__pyx_v_master);
    __Pyx_GIVEREF(__pyx_v_master);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_v_master);
    __Pyx_INCREF(__pyx_n_s_togl);
    __Pyx_GIVEREF(__pyx_n_s_togl);
    PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_7, __pyx_n_s_togl);
    __Pyx_INCREF(__pyx_v_cnf);
    __Pyx_GIVEREF(__pyx_v_cnf);
    PyTuple_SET_ITEM(__pyx_t_3, 3+__pyx_t_7, __pyx_v_cnf);
    __Pyx_INCREF(__pyx_v_kw);
    __Pyx_GIVEREF(__pyx_v_kw);
    PyTuple_SET_ITEM(__pyx_t_3, 4+__pyx_t_7, __pyx_v_kw);
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1072, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1073
 * 
 *         Tk_.Widget.__init__(self, master, 'togl', cnf, kw)
 *         self.root = master             # <<<<<<<<<<<<<<
 *         self.bind('<Map>', self.tkMap)
 *         self.bind('<Expose>', self.tkExpose)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_root, __pyx_v_master) < 0) __PYX_ERR(0, 1073, __pyx_L1_error)

  /* "CyOpenGL.pyx":1074
 *         Tk_.Widget.__init__(self, master, 'togl', cnf, kw)
 *         self.root = master
 *         self.bind('<Map>', self.tkMap)             # <<<<<<<<<<<<<<
 *         self.bind('<Expose>', self.tkExpose)
 *         self.bind('<Configure>', self.tkExpose)
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkMap); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1074, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_Map, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_1, __pyx_kp_s_Map, __pyx_t_3};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_1) {
      __Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_s_Map);
    __Pyx_GIVEREF(__pyx_kp_s_Map);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_kp_s_Map);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1074, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1075
 *         self.root = master
 *         self.bind('<Map>', self.tkMap)
 *         self.bind('<Expose>', self.tkExpose)             # <<<<<<<<<<<<<<
 *         self.bind('<Configure>', self.tkExpose)
 * 
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkExpose); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1075, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_s_Expose, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1075, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_kp_s_Expose, __pyx_t_6};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1075, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  } else
  #endif
  {
    __pyx_t_1 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__pyx_t_3) {
      __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3); __pyx_t_3 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_s_Expose);
    __Pyx_GIVEREF(__pyx_kp_s_Expose);
    PyTuple_SET_ITEM(__pyx_t_1, 0+__pyx_t_7, __pyx_kp_s_Expose);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_1, 1+__pyx_t_7, __pyx_t_6);
    __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1075, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1076
 *         self.bind('<Map>', self.tkMap)
 *         self.bind('<Expose>', self.tkExpose)
 *         self.bind('<Configure>', self.tkExpose)             # <<<<<<<<<<<<<<
 * 
 *     def tkRedraw(self, *dummy):
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkExpose); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1076, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_8, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_s_Configure, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1076, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_kp_s_Configure, __pyx_t_1};
    __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1076, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  } else
  #endif
  {
    __pyx_t_3 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_s_Configure);
    __Pyx_GIVEREF(__pyx_kp_s_Configure);
    PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_kp_s_Configure);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_t_1);
    __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1076, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1048
 *     """
 * 
 *     def __init__(self, master, cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         curr_platform = sys.platform
 *         cpu_width = platform.architecture()[0]
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_curr_platform);
  __Pyx_XDECREF(__pyx_v_cpu_width);
  __Pyx_XDECREF(__pyx_v_windows_version);
  __Pyx_XDECREF(__pyx_v_suffix);
  __Pyx_XDECREF(__pyx_v_Togl_path);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1078
 *         self.bind('<Configure>', self.tkExpose)
 * 
 *     def tkRedraw(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.update_idletasks()
 *         self.tk.call(self._w, 'makecurrent')
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_3tkRedraw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_15RawOpenGLWidget_2tkRedraw[] = "RawOpenGLWidget.tkRedraw(self, *dummy)";
static PyMethodDef __pyx_mdef_8CyOpenGL_15RawOpenGLWidget_3tkRedraw = {"tkRedraw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_15RawOpenGLWidget_3tkRedraw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15RawOpenGLWidget_2tkRedraw};
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_3tkRedraw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_dummy = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkRedraw (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_dummy = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_dummy)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_dummy);
  } else {
    __pyx_v_dummy = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "tkRedraw") < 0)) __PYX_ERR(0, 1078, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkRedraw", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1078, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_dummy); __pyx_v_dummy = 0;
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.tkRedraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15RawOpenGLWidget_2tkRedraw(__pyx_self, __pyx_v_self, __pyx_v_dummy);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_dummy);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget_2tkRedraw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("tkRedraw", 0);

  /* "CyOpenGL.pyx":1079
 * 
 *     def tkRedraw(self, *dummy):
 *         self.update_idletasks()             # <<<<<<<<<<<<<<
 *         self.tk.call(self._w, 'makecurrent')
 *         glPushMatrix()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update_idletasks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1079, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1080
 *     def tkRedraw(self, *dummy):
 *         self.update_idletasks()
 *         self.tk.call(self._w, 'makecurrent')             # <<<<<<<<<<<<<<
 *         glPushMatrix()
 *         self.redraw()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tk_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_call); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1080, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_makecurrent};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_makecurrent};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1080, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_makecurrent);
    __Pyx_GIVEREF(__pyx_n_s_makecurrent);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_n_s_makecurrent);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1080, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1081
 *         self.update_idletasks()
 *         self.tk.call(self._w, 'makecurrent')
 *         glPushMatrix()             # <<<<<<<<<<<<<<
 *         self.redraw()
 *         glPopMatrix()
 */
  glPushMatrix();

  /* "CyOpenGL.pyx":1082
 *         self.tk.call(self._w, 'makecurrent')
 *         glPushMatrix()
 *         self.redraw()             # <<<<<<<<<<<<<<
 *         glPopMatrix()
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_redraw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_1 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1083
 *         glPushMatrix()
 *         self.redraw()
 *         glPopMatrix()             # <<<<<<<<<<<<<<
 * 
 *     def tkMap(self, *dummy):
 */
  glPopMatrix();

  /* "CyOpenGL.pyx":1078
 *         self.bind('<Configure>', self.tkExpose)
 * 
 *     def tkRedraw(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.update_idletasks()
 *         self.tk.call(self._w, 'makecurrent')
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.tkRedraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1085
 *         glPopMatrix()
 * 
 *     def tkMap(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.tkExpose()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_5tkMap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_15RawOpenGLWidget_4tkMap[] = "RawOpenGLWidget.tkMap(self, *dummy)";
static PyMethodDef __pyx_mdef_8CyOpenGL_15RawOpenGLWidget_5tkMap = {"tkMap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_15RawOpenGLWidget_5tkMap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15RawOpenGLWidget_4tkMap};
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_5tkMap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_dummy = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkMap (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_dummy = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_dummy)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_dummy);
  } else {
    __pyx_v_dummy = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "tkMap") < 0)) __PYX_ERR(0, 1085, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkMap", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1085, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_dummy); __pyx_v_dummy = 0;
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.tkMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15RawOpenGLWidget_4tkMap(__pyx_self, __pyx_v_self, __pyx_v_dummy);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_dummy);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget_4tkMap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("tkMap", 0);

  /* "CyOpenGL.pyx":1086
 * 
 *     def tkMap(self, *dummy):
 *         self.tkExpose()             # <<<<<<<<<<<<<<
 * 
 *     def tkExpose(self, *dummy):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkExpose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1085
 *         glPopMatrix()
 * 
 *     def tkMap(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.tkExpose()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.tkMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1088
 *         self.tkExpose()
 * 
 *     def tkExpose(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_7tkExpose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_15RawOpenGLWidget_6tkExpose[] = "RawOpenGLWidget.tkExpose(self, *dummy)";
static PyMethodDef __pyx_mdef_8CyOpenGL_15RawOpenGLWidget_7tkExpose = {"tkExpose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_15RawOpenGLWidget_7tkExpose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15RawOpenGLWidget_6tkExpose};
static PyObject *__pyx_pw_8CyOpenGL_15RawOpenGLWidget_7tkExpose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_dummy = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkExpose (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_dummy = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_dummy)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_dummy);
  } else {
    __pyx_v_dummy = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "tkExpose") < 0)) __PYX_ERR(0, 1088, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkExpose", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1088, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_dummy); __pyx_v_dummy = 0;
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.tkExpose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_15RawOpenGLWidget_6tkExpose(__pyx_self, __pyx_v_self, __pyx_v_dummy);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_dummy);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_15RawOpenGLWidget_6tkExpose(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("tkExpose", 0);

  /* "CyOpenGL.pyx":1089
 * 
 *     def tkExpose(self, *dummy):
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 * 
 * class OpenGLWidget(RawOpenGLWidget):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1089, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1088
 *         self.tkExpose()
 * 
 *     def tkExpose(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 * 
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.RawOpenGLWidget.tkExpose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1100
 *     """
 * 
 *     def __init__(self, master=None, help='No help is available.',             # <<<<<<<<<<<<<<
 *                  mouse_pick=False, mouse_rotate=True, mouse_translate=False,
 *                  mouse_scale=False,
 */

static PyObject *__pyx_pf_8CyOpenGL_10__defaults__(CYTHON_UNUSED PyObject *__pyx_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_RefNannySetupContext("__defaults__", 0);
  __Pyx_XDECREF(__pyx_r);

  /* "CyOpenGL.pyx":1102
 *     def __init__(self, master=None, help='No help is available.',
 *                  mouse_pick=False, mouse_rotate=True, mouse_translate=False,
 *                  mouse_scale=False,             # <<<<<<<<<<<<<<
 *                  fovy=30.0, near=1.0, far=100.0,
 *                  cnf={}, **kw):
 */
  __pyx_t_1 = PyTuple_New(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(((PyObject *)Py_None));
  __Pyx_GIVEREF(((PyObject *)Py_None));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_None));
  __Pyx_INCREF(((PyObject*)__pyx_kp_s_No_help_is_available));
  __Pyx_GIVEREF(((PyObject*)__pyx_kp_s_No_help_is_available));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject*)__pyx_kp_s_No_help_is_available));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_True));
  __Pyx_GIVEREF(((PyObject *)Py_True));
  PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)Py_True));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject *)Py_False));
  __Pyx_GIVEREF(((PyObject *)Py_False));
  PyTuple_SET_ITEM(__pyx_t_1, 5, ((PyObject *)Py_False));
  __Pyx_INCREF(((PyObject*)__pyx_float_30_0));
  __Pyx_GIVEREF(((PyObject*)__pyx_float_30_0));
  PyTuple_SET_ITEM(__pyx_t_1, 6, ((PyObject*)__pyx_float_30_0));
  __Pyx_INCREF(((PyObject*)__pyx_float_1_0));
  __Pyx_GIVEREF(((PyObject*)__pyx_float_1_0));
  PyTuple_SET_ITEM(__pyx_t_1, 7, ((PyObject*)__pyx_float_1_0));
  __Pyx_INCREF(((PyObject*)__pyx_float_100_0));
  __Pyx_GIVEREF(((PyObject*)__pyx_float_100_0));
  PyTuple_SET_ITEM(__pyx_t_1, 8, ((PyObject*)__pyx_float_100_0));
  __Pyx_INCREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_cnf);
  __Pyx_GIVEREF(__Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_cnf);
  PyTuple_SET_ITEM(__pyx_t_1, 9, __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self)->__pyx_arg_cnf);

  /* "CyOpenGL.pyx":1100
 *     """
 * 
 *     def __init__(self, master=None, help='No help is available.',             # <<<<<<<<<<<<<<
 *                  mouse_pick=False, mouse_rotate=True, mouse_translate=False,
 *                  mouse_scale=False,
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
  __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("CyOpenGL.__defaults__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget___init__[] = "OpenGLWidget.__init__(self, master=None, help='No help is available.', mouse_pick=False, mouse_rotate=True, mouse_translate=False, mouse_scale=False, fovy=30.0, near=1.0, far=100.0, cnf={}, **kw)\n\n        Create an opengl widget.  Arrange for redraws when the window is\n        exposed or when it changes size.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_1__init__ = {"__init__", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_1__init__, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget___init__};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_1__init__(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_master = 0;
  PyObject *__pyx_v_help = 0;
  PyObject *__pyx_v_mouse_pick = 0;
  PyObject *__pyx_v_mouse_rotate = 0;
  PyObject *__pyx_v_mouse_translate = 0;
  PyObject *__pyx_v_mouse_scale = 0;
  PyObject *__pyx_v_fovy = 0;
  PyObject *__pyx_v_near = 0;
  PyObject *__pyx_v_far = 0;
  PyObject *__pyx_v_cnf = 0;
  PyObject *__pyx_v_kw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  __pyx_v_kw = PyDict_New(); if (unlikely(!__pyx_v_kw)) return NULL;
  __Pyx_GOTREF(__pyx_v_kw);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_master,&__pyx_n_s_help,&__pyx_n_s_mouse_pick,&__pyx_n_s_mouse_rotate,&__pyx_n_s_mouse_translate,&__pyx_n_s_mouse_scale,&__pyx_n_s_fovy,&__pyx_n_s_near,&__pyx_n_s_far,&__pyx_n_s_cnf,0};
    PyObject* values[11] = {0,0,0,0,0,0,0,0,0,0,0};
    __pyx_defaults1 *__pyx_dynamic_args = __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_self);
    values[1] = ((PyObject *)((PyObject *)Py_None));
    values[2] = ((PyObject *)((PyObject*)__pyx_kp_s_No_help_is_available));
    values[3] = ((PyObject *)((PyObject *)Py_False));
    values[4] = ((PyObject *)((PyObject *)Py_True));
    values[5] = ((PyObject *)((PyObject *)Py_False));
    values[6] = ((PyObject *)((PyObject *)Py_False));
    values[7] = ((PyObject *)((PyObject*)__pyx_float_30_0));
    values[8] = ((PyObject *)((PyObject*)__pyx_float_1_0));
    values[9] = ((PyObject *)((PyObject*)__pyx_float_100_0));
    values[10] = __pyx_dynamic_args->__pyx_arg_cnf;
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_master);
          if (value) { values[1] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_help);
          if (value) { values[2] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mouse_pick);
          if (value) { values[3] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mouse_rotate);
          if (value) { values[4] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mouse_translate);
          if (value) { values[5] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mouse_scale);
          if (value) { values[6] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_fovy);
          if (value) { values[7] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  8:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_near);
          if (value) { values[8] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case  9:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_far);
          if (value) { values[9] = value; kw_args--; }
        }
        CYTHON_FALLTHROUGH;
        case 10:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_cnf);
          if (value) { values[10] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, __pyx_v_kw, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 1100, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
        CYTHON_FALLTHROUGH;
        case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
        CYTHON_FALLTHROUGH;
        case  9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
        CYTHON_FALLTHROUGH;
        case  8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_master = values[1];
    __pyx_v_help = values[2];
    __pyx_v_mouse_pick = values[3];
    __pyx_v_mouse_rotate = values[4];
    __pyx_v_mouse_translate = values[5];
    __pyx_v_mouse_scale = values[6];
    __pyx_v_fovy = values[7];
    __pyx_v_near = values[8];
    __pyx_v_far = values[9];
    __pyx_v_cnf = values[10];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 11, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1100, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kw); __pyx_v_kw = 0;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget___init__(__pyx_self, __pyx_v_self, __pyx_v_master, __pyx_v_help, __pyx_v_mouse_pick, __pyx_v_mouse_rotate, __pyx_v_mouse_translate, __pyx_v_mouse_scale, __pyx_v_fovy, __pyx_v_near, __pyx_v_far, __pyx_v_cnf, __pyx_v_kw);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_kw);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget___init__(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_master, PyObject *__pyx_v_help, PyObject *__pyx_v_mouse_pick, PyObject *__pyx_v_mouse_rotate, PyObject *__pyx_v_mouse_translate, PyObject *__pyx_v_mouse_scale, PyObject *__pyx_v_fovy, PyObject *__pyx_v_near, PyObject *__pyx_v_far, PyObject *__pyx_v_cnf, PyObject *__pyx_v_kw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "CyOpenGL.pyx":1109
 *         exposed or when it changes size.
 *         """
 *         RawOpenGLWidget.__init__(*(self, master, cnf), **kw)             # <<<<<<<<<<<<<<
 *         self.help_text = help
 *         self.initialised = 0
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_RawOpenGLWidget); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_v_self);
  __Pyx_GIVEREF(__pyx_v_self);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self);
  __Pyx_INCREF(__pyx_v_master);
  __Pyx_GIVEREF(__pyx_v_master);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_master);
  __Pyx_INCREF(__pyx_v_cnf);
  __Pyx_GIVEREF(__pyx_v_cnf);
  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_cnf);
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_v_kw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1109, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1110
 *         """
 *         RawOpenGLWidget.__init__(*(self, master, cnf), **kw)
 *         self.help_text = help             # <<<<<<<<<<<<<<
 *         self.initialised = 0
 *         if sys.platform == 'darwin':
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_help_text, __pyx_v_help) < 0) __PYX_ERR(0, 1110, __pyx_L1_error)

  /* "CyOpenGL.pyx":1111
 *         RawOpenGLWidget.__init__(*(self, master, cnf), **kw)
 *         self.help_text = help
 *         self.initialised = 0             # <<<<<<<<<<<<<<
 *         if sys.platform == 'darwin':
 *             self.config(cursor='hand')
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_initialised, __pyx_int_0) < 0) __PYX_ERR(0, 1111, __pyx_L1_error)

  /* "CyOpenGL.pyx":1112
 *         self.help_text = help
 *         self.initialised = 0
 *         if sys.platform == 'darwin':             # <<<<<<<<<<<<<<
 *             self.config(cursor='hand')
 *         else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_sys); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_platform); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1112, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_darwin, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1112, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":1113
 *         self.initialised = 0
 *         if sys.platform == 'darwin':
 *             self.config(cursor='hand')             # <<<<<<<<<<<<<<
 *         else:
 *             self.config(cursor='fleur')
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_cursor, __pyx_n_s_hand) < 0) __PYX_ERR(0, 1113, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "CyOpenGL.pyx":1112
 *         self.help_text = help
 *         self.initialised = 0
 *         if sys.platform == 'darwin':             # <<<<<<<<<<<<<<
 *             self.config(cursor='hand')
 *         else:
 */
    goto __pyx_L3;
  }

  /* "CyOpenGL.pyx":1115
 *             self.config(cursor='hand')
 *         else:
 *             self.config(cursor='fleur')             # <<<<<<<<<<<<<<
 *         self.flipped = False
 * 
 */
  /*else*/ {
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_config); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_cursor, __pyx_n_s_fleur) < 0) __PYX_ERR(0, 1115, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_L3:;

  /* "CyOpenGL.pyx":1116
 *         else:
 *             self.config(cursor='fleur')
 *         self.flipped = False             # <<<<<<<<<<<<<<
 * 
 *         # Current coordinates of the mouse.
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_flipped, Py_False) < 0) __PYX_ERR(0, 1116, __pyx_L1_error)

  /* "CyOpenGL.pyx":1119
 * 
 *         # Current coordinates of the mouse.
 *         self.xmouse = self.ymouse = self.tmouse = self.delta_t = 0             # <<<<<<<<<<<<<<
 *         self.Xangle = self.Yangle = 0
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_xmouse, __pyx_int_0) < 0) __PYX_ERR(0, 1119, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ymouse, __pyx_int_0) < 0) __PYX_ERR(0, 1119, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tmouse, __pyx_int_0) < 0) __PYX_ERR(0, 1119, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_delta_t, __pyx_int_0) < 0) __PYX_ERR(0, 1119, __pyx_L1_error)

  /* "CyOpenGL.pyx":1120
 *         # Current coordinates of the mouse.
 *         self.xmouse = self.ymouse = self.tmouse = self.delta_t = 0
 *         self.Xangle = self.Yangle = 0             # <<<<<<<<<<<<<<
 * 
 *         # Where we are centering.
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Xangle, __pyx_int_0) < 0) __PYX_ERR(0, 1120, __pyx_L1_error)
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Yangle, __pyx_int_0) < 0) __PYX_ERR(0, 1120, __pyx_L1_error)

  /* "CyOpenGL.pyx":1123
 * 
 *         # Where we are centering.
 *         self.xcenter = 0.0             # <<<<<<<<<<<<<<
 *         self.ycenter = 0.0
 *         self.zcenter = 0.0
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_xcenter, __pyx_float_0_0) < 0) __PYX_ERR(0, 1123, __pyx_L1_error)

  /* "CyOpenGL.pyx":1124
 *         # Where we are centering.
 *         self.xcenter = 0.0
 *         self.ycenter = 0.0             # <<<<<<<<<<<<<<
 *         self.zcenter = 0.0
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ycenter, __pyx_float_0_0) < 0) __PYX_ERR(0, 1124, __pyx_L1_error)

  /* "CyOpenGL.pyx":1125
 *         self.xcenter = 0.0
 *         self.ycenter = 0.0
 *         self.zcenter = 0.0             # <<<<<<<<<<<<<<
 * 
 *         # The _back color
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_zcenter, __pyx_float_0_0) < 0) __PYX_ERR(0, 1125, __pyx_L1_error)

  /* "CyOpenGL.pyx":1128
 * 
 *         # The _back color
 *         self.r_back = 1.             # <<<<<<<<<<<<<<
 *         self.g_back = 0.
 *         self.b_back = 1.
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r_back, __pyx_float_1_) < 0) __PYX_ERR(0, 1128, __pyx_L1_error)

  /* "CyOpenGL.pyx":1129
 *         # The _back color
 *         self.r_back = 1.
 *         self.g_back = 0.             # <<<<<<<<<<<<<<
 *         self.b_back = 1.
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_g_back, __pyx_float_0_) < 0) __PYX_ERR(0, 1129, __pyx_L1_error)

  /* "CyOpenGL.pyx":1130
 *         self.r_back = 1.
 *         self.g_back = 0.
 *         self.b_back = 1.             # <<<<<<<<<<<<<<
 * 
 *         # Where the eye is
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_b_back, __pyx_float_1_) < 0) __PYX_ERR(0, 1130, __pyx_L1_error)

  /* "CyOpenGL.pyx":1133
 * 
 *         # Where the eye is
 *         self.distance = 10.0             # <<<<<<<<<<<<<<
 * 
 *         # Field of view in y direction
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_distance, __pyx_float_10_0) < 0) __PYX_ERR(0, 1133, __pyx_L1_error)

  /* "CyOpenGL.pyx":1136
 * 
 *         # Field of view in y direction
 *         self.fovy = fovy             # <<<<<<<<<<<<<<
 * 
 *         # Position of clipping planes.
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_fovy, __pyx_v_fovy) < 0) __PYX_ERR(0, 1136, __pyx_L1_error)

  /* "CyOpenGL.pyx":1139
 * 
 *         # Position of clipping planes.
 *         self.near = near             # <<<<<<<<<<<<<<
 *         self.far = far
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_near, __pyx_v_near) < 0) __PYX_ERR(0, 1139, __pyx_L1_error)

  /* "CyOpenGL.pyx":1140
 *         # Position of clipping planes.
 *         self.near = near
 *         self.far = far             # <<<<<<<<<<<<<<
 * 
 *         # Is the widget allowed to autospin?
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_far, __pyx_v_far) < 0) __PYX_ERR(0, 1140, __pyx_L1_error)

  /* "CyOpenGL.pyx":1143
 * 
 *         # Is the widget allowed to autospin?
 *         self.autospin_allowed = 0             # <<<<<<<<<<<<<<
 * 
 *         # Is the widget currently autospinning?
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_autospin_allowed, __pyx_int_0) < 0) __PYX_ERR(0, 1143, __pyx_L1_error)

  /* "CyOpenGL.pyx":1146
 * 
 *         # Is the widget currently autospinning?
 *         self.autospin = 0             # <<<<<<<<<<<<<<
 * 
 *         # Dictionary of key actions (keysym:function) .
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_autospin, __pyx_int_0) < 0) __PYX_ERR(0, 1146, __pyx_L1_error)

  /* "CyOpenGL.pyx":1149
 * 
 *         # Dictionary of key actions (keysym:function) .
 *         self.key_action = {}             # <<<<<<<<<<<<<<
 * 
 *         # Bindings for events.
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_key_action, __pyx_t_1) < 0) __PYX_ERR(0, 1149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1152
 * 
 *         # Bindings for events.
 *         self.bind('<Map>', self.tkMap)             # <<<<<<<<<<<<<<
 *         self.bind('<Expose>', self.tkExpose)
 *         self.bind('<Configure>', self.tkExpose)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkMap); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1152, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Map, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Map, __pyx_t_2};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    if (__pyx_t_5) {
      __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_s_Map);
    __Pyx_GIVEREF(__pyx_kp_s_Map);
    PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_Map);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_2);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1153
 *         # Bindings for events.
 *         self.bind('<Map>', self.tkMap)
 *         self.bind('<Expose>', self.tkExpose)             # <<<<<<<<<<<<<<
 *         self.bind('<Configure>', self.tkExpose)
 *         if mouse_pick:
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkExpose); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_2)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_2);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Expose, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Expose, __pyx_t_7};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  } else
  #endif
  {
    __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (__pyx_t_2) {
      __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_s_Expose);
    __Pyx_GIVEREF(__pyx_kp_s_Expose);
    PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_kp_s_Expose);
    __Pyx_GIVEREF(__pyx_t_7);
    PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_7);
    __pyx_t_7 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1154
 *         self.bind('<Map>', self.tkMap)
 *         self.bind('<Expose>', self.tkExpose)
 *         self.bind('<Configure>', self.tkExpose)             # <<<<<<<<<<<<<<
 *         if mouse_pick:
 *             self.bind('<Control-Button-1>', self.tkHandlePick)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkExpose); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_7 = NULL;
  __pyx_t_6 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_6 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Configure, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Configure, __pyx_t_5};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    if (__pyx_t_7) {
      __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
    }
    __Pyx_INCREF(__pyx_kp_s_Configure);
    __Pyx_GIVEREF(__pyx_kp_s_Configure);
    PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_kp_s_Configure);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_t_5);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1155
 *         self.bind('<Expose>', self.tkExpose)
 *         self.bind('<Configure>', self.tkExpose)
 *         if mouse_pick:             # <<<<<<<<<<<<<<
 *             self.bind('<Control-Button-1>', self.tkHandlePick)
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_pick); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1155, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":1156
 *         self.bind('<Configure>', self.tkExpose)
 *         if mouse_pick:
 *             self.bind('<Control-Button-1>', self.tkHandlePick)             # <<<<<<<<<<<<<<
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
 *         if mouse_translate and mouse_rotate:
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkHandlePick); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Control_Button_1, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Control_Button_1, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_Control_Button_1);
      __Pyx_GIVEREF(__pyx_kp_s_Control_Button_1);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_Control_Button_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1156, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":1157
 *         if mouse_pick:
 *             self.bind('<Control-Button-1>', self.tkHandlePick)
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)             # <<<<<<<<<<<<<<
 *         if mouse_translate and mouse_rotate:
 *             self.bind('<Button-1>', self.tkRecordMouse)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkHandlePick); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Control_Button_1_ButtonRelease, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1157, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Control_Button_1_ButtonRelease, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1157, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_Control_Button_1_ButtonRelease);
      __Pyx_GIVEREF(__pyx_kp_s_Control_Button_1_ButtonRelease);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_kp_s_Control_Button_1_ButtonRelease);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1157, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":1155
 *         self.bind('<Expose>', self.tkExpose)
 *         self.bind('<Configure>', self.tkExpose)
 *         if mouse_pick:             # <<<<<<<<<<<<<<
 *             self.bind('<Control-Button-1>', self.tkHandlePick)
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
 */
  }

  /* "CyOpenGL.pyx":1158
 *             self.bind('<Control-Button-1>', self.tkHandlePick)
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
 *         if mouse_translate and mouse_rotate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 */
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_translate); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1158, __pyx_L1_error)
  if (__pyx_t_8) {
  } else {
    __pyx_t_4 = __pyx_t_8;
    goto __pyx_L6_bool_binop_done;
  }
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_rotate); if (unlikely(__pyx_t_8 < 0)) __PYX_ERR(0, 1158, __pyx_L1_error)
  __pyx_t_4 = __pyx_t_8;
  __pyx_L6_bool_binop_done:;
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":1159
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
 *         if mouse_translate and mouse_rotate:
 *             self.bind('<Button-1>', self.tkRecordMouse)             # <<<<<<<<<<<<<<
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *             if sys.platform == 'darwin':
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRecordMouse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Button_1, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Button_1, __pyx_t_5};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_Button_1);
      __Pyx_GIVEREF(__pyx_kp_s_Button_1);
      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_kp_s_Button_1);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1159, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":1160
 *         if mouse_translate and mouse_rotate:
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)             # <<<<<<<<<<<<<<
 *             if sys.platform == 'darwin':
 *                 self.bind('<Shift-Button-1>', self.StartRotate)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkTranslate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_B1_Motion, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_B1_Motion, __pyx_t_2};
      __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_B1_Motion);
      __Pyx_GIVEREF(__pyx_kp_s_B1_Motion);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_B1_Motion);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1160, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":1161
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *             if sys.platform == 'darwin':             # <<<<<<<<<<<<<<
 *                 self.bind('<Shift-Button-1>', self.StartRotate)
 *                 self.bind('<Shift-B1-Motion>', self.tkRotate)
 */
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_sys); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_platform); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1161, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_t_3, __pyx_n_s_darwin, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1161, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_4) {

      /* "CyOpenGL.pyx":1162
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *             if sys.platform == 'darwin':
 *                 self.bind('<Shift-Button-1>', self.StartRotate)             # <<<<<<<<<<<<<<
 *                 self.bind('<Shift-B1-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_StartRotate); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1162, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Shift_Button_1, __pyx_t_7};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Shift_Button_1, __pyx_t_7};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1162, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_2) {
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_s_Shift_Button_1);
        __Pyx_GIVEREF(__pyx_kp_s_Shift_Button_1);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_kp_s_Shift_Button_1);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1162, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "CyOpenGL.pyx":1163
 *             if sys.platform == 'darwin':
 *                 self.bind('<Shift-Button-1>', self.StartRotate)
 *                 self.bind('<Shift-B1-Motion>', self.tkRotate)             # <<<<<<<<<<<<<<
 *                 self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *             else:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRotate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1163, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Shift_B1_Motion, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1163, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_Shift_B1_Motion, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1163, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_s_Shift_B1_Motion);
        __Pyx_GIVEREF(__pyx_kp_s_Shift_B1_Motion);
        PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_kp_s_Shift_B1_Motion);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1163, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "CyOpenGL.pyx":1164
 *                 self.bind('<Shift-Button-1>', self.StartRotate)
 *                 self.bind('<Shift-B1-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-1>', self.tkAutoSpin)             # <<<<<<<<<<<<<<
 *             else:
 *                 self.bind('<Button-3>', self.StartRotate)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkAutoSpin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1164, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_ButtonRelease_1, __pyx_t_2};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_ButtonRelease_1, __pyx_t_2};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1164, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_s_ButtonRelease_1);
        __Pyx_GIVEREF(__pyx_kp_s_ButtonRelease_1);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_ButtonRelease_1);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1164, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "CyOpenGL.pyx":1161
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *             if sys.platform == 'darwin':             # <<<<<<<<<<<<<<
 *                 self.bind('<Shift-Button-1>', self.StartRotate)
 *                 self.bind('<Shift-B1-Motion>', self.tkRotate)
 */
      goto __pyx_L8;
    }

    /* "CyOpenGL.pyx":1166
 *                 self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *             else:
 *                 self.bind('<Button-3>', self.StartRotate)             # <<<<<<<<<<<<<<
 *                 self.bind('<B3-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)
 */
    /*else*/ {
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_StartRotate); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1166, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_2 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_2)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_2);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Button_3, __pyx_t_7};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1166, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Button_3, __pyx_t_7};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1166, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      } else
      #endif
      {
        __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        if (__pyx_t_2) {
          __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_s_Button_3);
        __Pyx_GIVEREF(__pyx_kp_s_Button_3);
        PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_kp_s_Button_3);
        __Pyx_GIVEREF(__pyx_t_7);
        PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_7);
        __pyx_t_7 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1166, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "CyOpenGL.pyx":1167
 *             else:
 *                 self.bind('<Button-3>', self.StartRotate)
 *                 self.bind('<B3-Motion>', self.tkRotate)             # <<<<<<<<<<<<<<
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)
 *         elif mouse_rotate:
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRotate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1167, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_7)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_7);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_B3_Motion, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_B3_Motion, __pyx_t_5};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      } else
      #endif
      {
        __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        if (__pyx_t_7) {
          __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_s_B3_Motion);
        __Pyx_GIVEREF(__pyx_kp_s_B3_Motion);
        PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_kp_s_B3_Motion);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_t_5);
        __pyx_t_5 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1167, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "CyOpenGL.pyx":1168
 *                 self.bind('<Button-3>', self.StartRotate)
 *                 self.bind('<B3-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)             # <<<<<<<<<<<<<<
 *         elif mouse_rotate:
 *             self.bind('<Button-1>', self.StartRotate)
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkAutoSpin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1168, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_6 = 1;
        }
      }
      #if CYTHON_FAST_PYCALL
      if (PyFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_ButtonRelease_3, __pyx_t_2};
        __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1168, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      #if CYTHON_FAST_PYCCALL
      if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
        PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_ButtonRelease_3, __pyx_t_2};
        __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1168, __pyx_L1_error)
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      } else
      #endif
      {
        __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        if (__pyx_t_5) {
          __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
        }
        __Pyx_INCREF(__pyx_kp_s_ButtonRelease_3);
        __Pyx_GIVEREF(__pyx_kp_s_ButtonRelease_3);
        PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_ButtonRelease_3);
        __Pyx_GIVEREF(__pyx_t_2);
        PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_2);
        __pyx_t_2 = 0;
        __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1168, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_L8:;

    /* "CyOpenGL.pyx":1158
 *             self.bind('<Control-Button-1>', self.tkHandlePick)
 *             self.bind('<Control-Button-1><ButtonRelease-1>', self.tkHandlePick)
 *         if mouse_translate and mouse_rotate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 */
    goto __pyx_L5;
  }

  /* "CyOpenGL.pyx":1169
 *                 self.bind('<B3-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)
 *         elif mouse_rotate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.StartRotate)
 *             self.bind('<B1-Motion>', self.tkRotate)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_rotate); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1169, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":1170
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)
 *         elif mouse_rotate:
 *             self.bind('<Button-1>', self.StartRotate)             # <<<<<<<<<<<<<<
 *             self.bind('<B1-Motion>', self.tkRotate)
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_StartRotate); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Button_1, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Button_1, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_Button_1);
      __Pyx_GIVEREF(__pyx_kp_s_Button_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_kp_s_Button_1);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1170, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1171
 *         elif mouse_rotate:
 *             self.bind('<Button-1>', self.StartRotate)
 *             self.bind('<B1-Motion>', self.tkRotate)             # <<<<<<<<<<<<<<
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *         elif mouse_translate:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRotate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1171, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_B1_Motion, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1171, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_B1_Motion, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1171, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_B1_Motion);
      __Pyx_GIVEREF(__pyx_kp_s_B1_Motion);
      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_kp_s_B1_Motion);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1171, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1172
 *             self.bind('<Button-1>', self.StartRotate)
 *             self.bind('<B1-Motion>', self.tkRotate)
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)             # <<<<<<<<<<<<<<
 *         elif mouse_translate:
 *             self.bind('<Button-1>', self.tkRecordMouse)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkAutoSpin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_ButtonRelease_1, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1172, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_ButtonRelease_1, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1172, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_ButtonRelease_1);
      __Pyx_GIVEREF(__pyx_kp_s_ButtonRelease_1);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_ButtonRelease_1);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1172, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1169
 *                 self.bind('<B3-Motion>', self.tkRotate)
 *                 self.bind('<ButtonRelease-3>', self.tkAutoSpin)
 *         elif mouse_rotate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.StartRotate)
 *             self.bind('<B1-Motion>', self.tkRotate)
 */
    goto __pyx_L5;
  }

  /* "CyOpenGL.pyx":1173
 *             self.bind('<B1-Motion>', self.tkRotate)
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *         elif mouse_translate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_translate); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1173, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":1174
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *         elif mouse_translate:
 *             self.bind('<Button-1>', self.tkRecordMouse)             # <<<<<<<<<<<<<<
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *         if mouse_scale:
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRecordMouse); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1174, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Button_1, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_Button_1, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_Button_1);
      __Pyx_GIVEREF(__pyx_kp_s_Button_1);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_kp_s_Button_1);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1174, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1175
 *         elif mouse_translate:
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)             # <<<<<<<<<<<<<<
 *         if mouse_scale:
 *             self.bind('<Button-2>', self.tkRecordMouse)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkTranslate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_B1_Motion, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_B1_Motion, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_B1_Motion);
      __Pyx_GIVEREF(__pyx_kp_s_B1_Motion);
      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_kp_s_B1_Motion);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1175, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1173
 *             self.bind('<B1-Motion>', self.tkRotate)
 *             self.bind('<ButtonRelease-1>', self.tkAutoSpin)
 *         elif mouse_translate:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 */
  }
  __pyx_L5:;

  /* "CyOpenGL.pyx":1176
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *         if mouse_scale:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-2>', self.tkRecordMouse)
 *             self.bind('<B2-Motion>', self.tkScale)
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_mouse_scale); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1176, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":1177
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *         if mouse_scale:
 *             self.bind('<Button-2>', self.tkRecordMouse)             # <<<<<<<<<<<<<<
 *             self.bind('<B2-Motion>', self.tkScale)
 *             self.bind('<KeyPress>', self.tkKeyPress)
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRecordMouse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Button_2, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_kp_s_Button_2, __pyx_t_2};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    } else
    #endif
    {
      __pyx_t_7 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (__pyx_t_5) {
        __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_Button_2);
      __Pyx_GIVEREF(__pyx_kp_s_Button_2);
      PyTuple_SET_ITEM(__pyx_t_7, 0+__pyx_t_6, __pyx_kp_s_Button_2);
      __Pyx_GIVEREF(__pyx_t_2);
      PyTuple_SET_ITEM(__pyx_t_7, 1+__pyx_t_6, __pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1177, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1178
 *         if mouse_scale:
 *             self.bind('<Button-2>', self.tkRecordMouse)
 *             self.bind('<B2-Motion>', self.tkScale)             # <<<<<<<<<<<<<<
 *             self.bind('<KeyPress>', self.tkKeyPress)
 * 
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkScale); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_2 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_B2_Motion, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1178, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_kp_s_B2_Motion, __pyx_t_7};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1178, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    } else
    #endif
    {
      __pyx_t_5 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (__pyx_t_2) {
        __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_B2_Motion);
      __Pyx_GIVEREF(__pyx_kp_s_B2_Motion);
      PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_6, __pyx_kp_s_B2_Motion);
      __Pyx_GIVEREF(__pyx_t_7);
      PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_6, __pyx_t_7);
      __pyx_t_7 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1179
 *             self.bind('<Button-2>', self.tkRecordMouse)
 *             self.bind('<B2-Motion>', self.tkScale)
 *             self.bind('<KeyPress>', self.tkKeyPress)             # <<<<<<<<<<<<<<
 * 
 *     def help(self):
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_bind); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkKeyPress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = NULL;
    __pyx_t_6 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_1, function);
        __pyx_t_6 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_KeyPress, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
      PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_kp_s_KeyPress, __pyx_t_5};
      __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-__pyx_t_6, 2+__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(2+__pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__pyx_t_7) {
        __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_7); __pyx_t_7 = NULL;
      }
      __Pyx_INCREF(__pyx_kp_s_KeyPress);
      __Pyx_GIVEREF(__pyx_kp_s_KeyPress);
      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_6, __pyx_kp_s_KeyPress);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_6, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":1176
 *             self.bind('<Button-1>', self.tkRecordMouse)
 *             self.bind('<B1-Motion>', self.tkTranslate)
 *         if mouse_scale:             # <<<<<<<<<<<<<<
 *             self.bind('<Button-2>', self.tkRecordMouse)
 *             self.bind('<B2-Motion>', self.tkScale)
 */
  }

  /* "CyOpenGL.pyx":1100
 *     """
 * 
 *     def __init__(self, master=None, help='No help is available.',             # <<<<<<<<<<<<<<
 *                  mouse_pick=False, mouse_rotate=True, mouse_translate=False,
 *                  mouse_scale=False,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1181
 *             self.bind('<KeyPress>', self.tkKeyPress)
 * 
 *     def help(self):             # <<<<<<<<<<<<<<
 *         """
 *         Help message for the widget.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_3help(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_2help[] = "OpenGLWidget.help(self)\n\n        Help message for the widget.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_3help = {"help", (PyCFunction)__pyx_pw_8CyOpenGL_12OpenGLWidget_3help, METH_O, __pyx_doc_8CyOpenGL_12OpenGLWidget_2help};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_3help(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("help (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_2help(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_2help(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("help", 0);

  /* "CyOpenGL.pyx":1185
 *         Help message for the widget.
 *         """
 *         InfoDialog(self, 'Viewer Help', self.help_text)             # <<<<<<<<<<<<<<
 * 
 *     def activate(self):
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_InfoDialog); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_help_text); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_self, __pyx_kp_s_Viewer_Help, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
    PyObject *__pyx_temp[4] = {__pyx_t_4, __pyx_v_self, __pyx_kp_s_Viewer_Help, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_5, 3+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(3+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_self);
    __Pyx_INCREF(__pyx_kp_s_Viewer_Help);
    __Pyx_GIVEREF(__pyx_kp_s_Viewer_Help);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_kp_s_Viewer_Help);
    __Pyx_GIVEREF(__pyx_t_3);
    PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_5, __pyx_t_3);
    __pyx_t_3 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1185, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1181
 *             self.bind('<KeyPress>', self.tkKeyPress)
 * 
 *     def help(self):             # <<<<<<<<<<<<<<
 *         """
 *         Help message for the widget.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.help", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1187
 *         InfoDialog(self, 'Viewer Help', self.help_text)
 * 
 *     def activate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cause this OpenGLWidget to be the current destination for
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_5activate(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_4activate[] = "OpenGLWidget.activate(self)\n\n        Cause this OpenGLWidget to be the current destination for\n        drawing.  Does NOT make the widget be the focus of keyboard\n        events; SnapPy OpenGL widgets do not accept keyboard events.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_5activate = {"activate", (PyCFunction)__pyx_pw_8CyOpenGL_12OpenGLWidget_5activate, METH_O, __pyx_doc_8CyOpenGL_12OpenGLWidget_4activate};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_5activate(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("activate (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_4activate(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_4activate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("activate", 0);

  /* "CyOpenGL.pyx":1193
 *         events; SnapPy OpenGL widgets do not accept keyboard events.
 *         """
 *         self.tk.call(self._w, 'makecurrent')             # <<<<<<<<<<<<<<
 * 
 *         #self.focus_set()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tk_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_call); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1193, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_makecurrent};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
    PyObject *__pyx_temp[3] = {__pyx_t_4, __pyx_t_2, __pyx_n_s_makecurrent};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_4) {
      __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_makecurrent);
    __Pyx_GIVEREF(__pyx_n_s_makecurrent);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_n_s_makecurrent);
    __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1193, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1187
 *         InfoDialog(self, 'Viewer Help', self.help_text)
 * 
 *     def activate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cause this OpenGLWidget to be the current destination for
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.activate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1197
 *         #self.focus_set()
 * 
 *     def set_background(self, r, g, b):             # <<<<<<<<<<<<<<
 *         """
 *         Change the background colour of the widget.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_7set_background(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_6set_background[] = "OpenGLWidget.set_background(self, r, g, b)\n\n        Change the background colour of the widget.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_7set_background = {"set_background", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_7set_background, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_6set_background};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_7set_background(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_r = 0;
  PyObject *__pyx_v_g = 0;
  PyObject *__pyx_v_b = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_background (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_r,&__pyx_n_s_g,&__pyx_n_s_b,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_r)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_background", 1, 4, 4, 1); __PYX_ERR(0, 1197, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_g)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_background", 1, 4, 4, 2); __PYX_ERR(0, 1197, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_background", 1, 4, 4, 3); __PYX_ERR(0, 1197, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_background") < 0)) __PYX_ERR(0, 1197, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_r = values[1];
    __pyx_v_g = values[2];
    __pyx_v_b = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_background", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1197, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.set_background", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_6set_background(__pyx_self, __pyx_v_self, __pyx_v_r, __pyx_v_g, __pyx_v_b);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_6set_background(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_r, PyObject *__pyx_v_g, PyObject *__pyx_v_b) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("set_background", 0);

  /* "CyOpenGL.pyx":1201
 *         Change the background colour of the widget.
 *         """
 *         self.r_back = r             # <<<<<<<<<<<<<<
 *         self.g_back = g
 *         self.b_back = b
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_r_back, __pyx_v_r) < 0) __PYX_ERR(0, 1201, __pyx_L1_error)

  /* "CyOpenGL.pyx":1202
 *         """
 *         self.r_back = r
 *         self.g_back = g             # <<<<<<<<<<<<<<
 *         self.b_back = b
 *         self.tkRedraw()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_g_back, __pyx_v_g) < 0) __PYX_ERR(0, 1202, __pyx_L1_error)

  /* "CyOpenGL.pyx":1203
 *         self.r_back = r
 *         self.g_back = g
 *         self.b_back = b             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_b_back, __pyx_v_b) < 0) __PYX_ERR(0, 1203, __pyx_L1_error)

  /* "CyOpenGL.pyx":1204
 *         self.g_back = g
 *         self.b_back = b
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 * 
 *     def set_centerpoint(self, x, y, z):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1204, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1197
 *         #self.focus_set()
 * 
 *     def set_background(self, r, g, b):             # <<<<<<<<<<<<<<
 *         """
 *         Change the background colour of the widget.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.set_background", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1206
 *         self.tkRedraw()
 * 
 *     def set_centerpoint(self, x, y, z):             # <<<<<<<<<<<<<<
 *         """
 *         Set the new center point for the model.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_9set_centerpoint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_8set_centerpoint[] = "OpenGLWidget.set_centerpoint(self, x, y, z)\n\n        Set the new center point for the model.\n        This is where we are looking.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_9set_centerpoint = {"set_centerpoint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_9set_centerpoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_8set_centerpoint};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_9set_centerpoint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_v_y = 0;
  PyObject *__pyx_v_z = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_centerpoint (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_z,0};
    PyObject* values[4] = {0,0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_centerpoint", 1, 4, 4, 1); __PYX_ERR(0, 1206, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_centerpoint", 1, 4, 4, 2); __PYX_ERR(0, 1206, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_z)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_centerpoint", 1, 4, 4, 3); __PYX_ERR(0, 1206, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_centerpoint") < 0)) __PYX_ERR(0, 1206, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
    __pyx_v_y = values[2];
    __pyx_v_z = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_centerpoint", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1206, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.set_centerpoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_8set_centerpoint(__pyx_self, __pyx_v_self, __pyx_v_x, __pyx_v_y, __pyx_v_z);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_8set_centerpoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_z) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("set_centerpoint", 0);

  /* "CyOpenGL.pyx":1211
 *         This is where we are looking.
 *         """
 *         self.xcenter = x             # <<<<<<<<<<<<<<
 *         self.ycenter = y
 *         self.zcenter = z
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_xcenter, __pyx_v_x) < 0) __PYX_ERR(0, 1211, __pyx_L1_error)

  /* "CyOpenGL.pyx":1212
 *         """
 *         self.xcenter = x
 *         self.ycenter = y             # <<<<<<<<<<<<<<
 *         self.zcenter = z
 *         self.tkRedraw()
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ycenter, __pyx_v_y) < 0) __PYX_ERR(0, 1212, __pyx_L1_error)

  /* "CyOpenGL.pyx":1213
 *         self.xcenter = x
 *         self.ycenter = y
 *         self.zcenter = z             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_zcenter, __pyx_v_z) < 0) __PYX_ERR(0, 1213, __pyx_L1_error)

  /* "CyOpenGL.pyx":1214
 *         self.ycenter = y
 *         self.zcenter = z
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 * 
 *     def set_eyepoint(self, distance):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1214, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1206
 *         self.tkRedraw()
 * 
 *     def set_centerpoint(self, x, y, z):             # <<<<<<<<<<<<<<
 *         """
 *         Set the new center point for the model.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.set_centerpoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1216
 *         self.tkRedraw()
 * 
 *     def set_eyepoint(self, distance):             # <<<<<<<<<<<<<<
 *         """
 *         Set how far the eye is from the position we are looking.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_11set_eyepoint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_10set_eyepoint[] = "OpenGLWidget.set_eyepoint(self, distance)\n\n        Set how far the eye is from the position we are looking.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_11set_eyepoint = {"set_eyepoint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_11set_eyepoint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_10set_eyepoint};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_11set_eyepoint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_distance = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("set_eyepoint (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_distance,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_distance)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("set_eyepoint", 1, 2, 2, 1); __PYX_ERR(0, 1216, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "set_eyepoint") < 0)) __PYX_ERR(0, 1216, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_distance = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("set_eyepoint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1216, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.set_eyepoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_10set_eyepoint(__pyx_self, __pyx_v_self, __pyx_v_distance);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_10set_eyepoint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_distance) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("set_eyepoint", 0);

  /* "CyOpenGL.pyx":1220
 *         Set how far the eye is from the position we are looking.
 *         """
 *         self.distance = distance             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_distance, __pyx_v_distance) < 0) __PYX_ERR(0, 1220, __pyx_L1_error)

  /* "CyOpenGL.pyx":1221
 *         """
 *         self.distance = distance
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 * 
 *     def reset(self, redraw=True):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1221, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1216
 *         self.tkRedraw()
 * 
 *     def set_eyepoint(self, distance):             # <<<<<<<<<<<<<<
 *         """
 *         Set how far the eye is from the position we are looking.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.set_eyepoint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1223
 *         self.tkRedraw()
 * 
 *     def reset(self, redraw=True):             # <<<<<<<<<<<<<<
 *         """
 *         Reset rotation matrix for this widget.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_13reset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_12reset[] = "OpenGLWidget.reset(self, redraw=True)\n\n        Reset rotation matrix for this widget.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_13reset = {"reset", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_13reset, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_12reset};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_13reset(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_redraw = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("reset (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_redraw,0};
    PyObject* values[2] = {0,0};
    values[1] = ((PyObject *)((PyObject *)Py_True));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_redraw);
          if (value) { values[1] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "reset") < 0)) __PYX_ERR(0, 1223, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_redraw = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("reset", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1223, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_12reset(__pyx_self, __pyx_v_self, __pyx_v_redraw);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_12reset(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_redraw) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_RefNannySetupContext("reset", 0);

  /* "CyOpenGL.pyx":1227
 *         Reset rotation matrix for this widget.
 *         """
 *         self.autospin = 0             # <<<<<<<<<<<<<<
 *         self.activate()
 *         glMatrixMode(GL_MODELVIEW)
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_autospin, __pyx_int_0) < 0) __PYX_ERR(0, 1227, __pyx_L1_error)

  /* "CyOpenGL.pyx":1228
 *         """
 *         self.autospin = 0
 *         self.activate()             # <<<<<<<<<<<<<<
 *         glMatrixMode(GL_MODELVIEW)
 *         glLoadIdentity()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_activate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1229
 *         self.autospin = 0
 *         self.activate()
 *         glMatrixMode(GL_MODELVIEW)             # <<<<<<<<<<<<<<
 *         glLoadIdentity()
 *         if redraw:
 */
  glMatrixMode(GL_MODELVIEW);

  /* "CyOpenGL.pyx":1230
 *         self.activate()
 *         glMatrixMode(GL_MODELVIEW)
 *         glLoadIdentity()             # <<<<<<<<<<<<<<
 *         if redraw:
 *             self.tkRedraw()
 */
  glLoadIdentity();

  /* "CyOpenGL.pyx":1231
 *         glMatrixMode(GL_MODELVIEW)
 *         glLoadIdentity()
 *         if redraw:             # <<<<<<<<<<<<<<
 *             self.tkRedraw()
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_redraw); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1231, __pyx_L1_error)
  if (__pyx_t_4) {

    /* "CyOpenGL.pyx":1232
 *         glLoadIdentity()
 *         if redraw:
 *             self.tkRedraw()             # <<<<<<<<<<<<<<
 * 
 *     def tkHandlePick(self, event):
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "CyOpenGL.pyx":1231
 *         glMatrixMode(GL_MODELVIEW)
 *         glLoadIdentity()
 *         if redraw:             # <<<<<<<<<<<<<<
 *             self.tkRedraw()
 * 
 */
  }

  /* "CyOpenGL.pyx":1223
 *         self.tkRedraw()
 * 
 *     def reset(self, redraw=True):             # <<<<<<<<<<<<<<
 *         """
 *         Reset rotation matrix for this widget.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1234
 *             self.tkRedraw()
 * 
 *     def tkHandlePick(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle a pick on the scene.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_15tkHandlePick(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_14tkHandlePick[] = "OpenGLWidget.tkHandlePick(self, event)\n\n        Handle a pick on the scene.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_15tkHandlePick = {"tkHandlePick", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_15tkHandlePick, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_14tkHandlePick};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_15tkHandlePick(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_event = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkHandlePick (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_event,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tkHandlePick", 1, 2, 2, 1); __PYX_ERR(0, 1234, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tkHandlePick") < 0)) __PYX_ERR(0, 1234, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkHandlePick", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1234, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkHandlePick", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_14tkHandlePick(__pyx_self, __pyx_v_self, __pyx_v_event);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_14tkHandlePick(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_event) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("tkHandlePick", 0);

  /* "CyOpenGL.pyx":1243
 *         cdef GLint view[4]
 * 
 *         if hasattr(self, 'pick'):             # <<<<<<<<<<<<<<
 *             raise ValueError('Sorry, this implementation was removed')
 *             # See GLU/README.txt for how to restore.
 */
  __pyx_t_1 = __Pyx_HasAttr(__pyx_v_self, __pyx_n_s_pick); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 1243, __pyx_L1_error)
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (unlikely(__pyx_t_2)) {

    /* "CyOpenGL.pyx":1244
 * 
 *         if hasattr(self, 'pick'):
 *             raise ValueError('Sorry, this implementation was removed')             # <<<<<<<<<<<<<<
 *             # See GLU/README.txt for how to restore.
 *             #
 */
    __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1244, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(0, 1244, __pyx_L1_error)

    /* "CyOpenGL.pyx":1243
 *         cdef GLint view[4]
 * 
 *         if hasattr(self, 'pick'):             # <<<<<<<<<<<<<<
 *             raise ValueError('Sorry, this implementation was removed')
 *             # See GLU/README.txt for how to restore.
 */
  }

  /* "CyOpenGL.pyx":1234
 *             self.tkRedraw()
 * 
 *     def tkHandlePick(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle a pick on the scene.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkHandlePick", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1266
 *             #     self.tkRedraw()
 * 
 *     def tkRecordMouse(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Record the current mouse position.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_17tkRecordMouse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_16tkRecordMouse[] = "OpenGLWidget.tkRecordMouse(self, event)\n\n        Record the current mouse position.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_17tkRecordMouse = {"tkRecordMouse", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_17tkRecordMouse, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_16tkRecordMouse};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_17tkRecordMouse(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkRecordMouse (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_event,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tkRecordMouse", 1, 2, 2, 1); __PYX_ERR(0, 1266, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tkRecordMouse") < 0)) __PYX_ERR(0, 1266, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkRecordMouse", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1266, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkRecordMouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_16tkRecordMouse(__pyx_self, __pyx_v_self, __pyx_v_event);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_16tkRecordMouse(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("tkRecordMouse", 0);

  /* "CyOpenGL.pyx":1270
 *         Record the current mouse position.
 *         """
 *         self.delta_t = event.time - self.tmouse             # <<<<<<<<<<<<<<
 *         self.xmouse, self.ymouse, self.tmouse = event.x, event.y, event.time
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tmouse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_delta_t, __pyx_t_3) < 0) __PYX_ERR(0, 1270, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1271
 *         """
 *         self.delta_t = event.time - self.tmouse
 *         self.xmouse, self.ymouse, self.tmouse = event.x, event.y, event.time             # <<<<<<<<<<<<<<
 * 
 *     def StartRotate(self, event):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_time); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_xmouse, __pyx_t_3) < 0) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_ymouse, __pyx_t_2) < 0) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_tmouse, __pyx_t_1) < 0) __PYX_ERR(0, 1271, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1266
 *             #     self.tkRedraw()
 * 
 *     def tkRecordMouse(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Record the current mouse position.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkRecordMouse", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1273
 *         self.xmouse, self.ymouse, self.tmouse = event.x, event.y, event.time
 * 
 *     def StartRotate(self, event):             # <<<<<<<<<<<<<<
 *         # Switch off any autospinning if it was happening
 *         self.autospin = 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_19StartRotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_18StartRotate[] = "OpenGLWidget.StartRotate(self, event)";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_19StartRotate = {"StartRotate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_19StartRotate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_18StartRotate};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_19StartRotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("StartRotate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_event,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("StartRotate", 1, 2, 2, 1); __PYX_ERR(0, 1273, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "StartRotate") < 0)) __PYX_ERR(0, 1273, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("StartRotate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1273, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.StartRotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_18StartRotate(__pyx_self, __pyx_v_self, __pyx_v_event);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_18StartRotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("StartRotate", 0);

  /* "CyOpenGL.pyx":1275
 *     def StartRotate(self, event):
 *         # Switch off any autospinning if it was happening
 *         self.autospin = 0             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_autospin, __pyx_int_0) < 0) __PYX_ERR(0, 1275, __pyx_L1_error)

  /* "CyOpenGL.pyx":1276
 *         # Switch off any autospinning if it was happening
 *         self.autospin = 0
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
 * 
 *     def tkScale(self, event):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRecordMouse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_event) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_event);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1276, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1273
 *         self.xmouse, self.ymouse, self.tmouse = event.x, event.y, event.time
 * 
 *     def StartRotate(self, event):             # <<<<<<<<<<<<<<
 *         # Switch off any autospinning if it was happening
 *         self.autospin = 0
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.StartRotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1278
 *         self.tkRecordMouse(event)
 * 
 *     def tkScale(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Scale the scene.  Achieved by moving the eye position
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_21tkScale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_20tkScale[] = "OpenGLWidget.tkScale(self, event)\n\n        Scale the scene.  Achieved by moving the eye position\n        when using perspective.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_21tkScale = {"tkScale", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_21tkScale, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_20tkScale};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_21tkScale(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkScale (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_event,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tkScale", 1, 2, 2, 1); __PYX_ERR(0, 1278, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tkScale") < 0)) __PYX_ERR(0, 1278, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkScale", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1278, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkScale", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_20tkScale(__pyx_self, __pyx_v_self, __pyx_v_event);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_20tkScale(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event) {
  PyObject *__pyx_v_scale = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("tkScale", 0);

  /* "CyOpenGL.pyx":1283
 *         when using perspective.
 *         """
 *         scale = 1 - 0.01 * (event.y - self.ymouse)             # <<<<<<<<<<<<<<
 *         self.distance = self.distance * scale
 *         self.tkRedraw()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_y); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ymouse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_float_0_01, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_2, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1283, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_scale = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1284
 *         """
 *         scale = 1 - 0.01 * (event.y - self.ymouse)
 *         self.distance = self.distance * scale             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 *         self.tkRecordMouse(event)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_distance); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_v_scale); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1284, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_distance, __pyx_t_2) < 0) __PYX_ERR(0, 1284, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1285
 *         scale = 1 - 0.01 * (event.y - self.ymouse)
 *         self.distance = self.distance * scale
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_1) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1286
 *         self.distance = self.distance * scale
 *         self.tkRedraw()
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
 * 
 *     def zoom(self, x):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRecordMouse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_1) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_1, __pyx_v_event) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_event);
  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1286, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1278
 *         self.tkRecordMouse(event)
 * 
 *     def tkScale(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Scale the scene.  Achieved by moving the eye position
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkScale", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_scale);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1288
 *         self.tkRecordMouse(event)
 * 
 *     def zoom(self, x):             # <<<<<<<<<<<<<<
 *         t = float(x)/100.0
 *         self.distance = t*2.0 + (1-t)*10.0
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_23zoom(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_22zoom[] = "OpenGLWidget.zoom(self, x)";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_23zoom = {"zoom", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_23zoom, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_22zoom};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_23zoom(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_x = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("zoom (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_x,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("zoom", 1, 2, 2, 1); __PYX_ERR(0, 1288, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "zoom") < 0)) __PYX_ERR(0, 1288, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_x = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("zoom", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1288, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.zoom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_22zoom(__pyx_self, __pyx_v_self, __pyx_v_x);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_22zoom(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_x) {
  double __pyx_v_t;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_RefNannySetupContext("zoom", 0);

  /* "CyOpenGL.pyx":1289
 * 
 *     def zoom(self, x):
 *         t = float(x)/100.0             # <<<<<<<<<<<<<<
 *         self.distance = t*2.0 + (1-t)*10.0
 *         self.tkRedraw()
 */
  __pyx_t_1 = __Pyx_PyObject_AsDouble(__pyx_v_x); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1289, __pyx_L1_error)
  __pyx_v_t = (__pyx_t_1 / 100.0);

  /* "CyOpenGL.pyx":1290
 *     def zoom(self, x):
 *         t = float(x)/100.0
 *         self.distance = t*2.0 + (1-t)*10.0             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 * 
 */
  __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_t * 2.0) + ((1.0 - __pyx_v_t) * 10.0))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_distance, __pyx_t_2) < 0) __PYX_ERR(0, 1290, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1291
 *         t = float(x)/100.0
 *         self.distance = t*2.0 + (1-t)*10.0
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 * 
 *     def do_AutoSpin(self):
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
    }
  }
  __pyx_t_2 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1291, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1288
 *         self.tkRecordMouse(event)
 * 
 *     def zoom(self, x):             # <<<<<<<<<<<<<<
 *         t = float(x)/100.0
 *         self.distance = t*2.0 + (1-t)*10.0
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.zoom", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1293
 *         self.tkRedraw()
 * 
 *     def do_AutoSpin(self):             # <<<<<<<<<<<<<<
 *         self.activate()
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_25do_AutoSpin(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_24do_AutoSpin[] = "OpenGLWidget.do_AutoSpin(self)";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_25do_AutoSpin = {"do_AutoSpin", (PyCFunction)__pyx_pw_8CyOpenGL_12OpenGLWidget_25do_AutoSpin, METH_O, __pyx_doc_8CyOpenGL_12OpenGLWidget_24do_AutoSpin};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_25do_AutoSpin(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("do_AutoSpin (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_24do_AutoSpin(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_24do_AutoSpin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  int __pyx_t_8;
  __Pyx_RefNannySetupContext("do_AutoSpin", 0);

  /* "CyOpenGL.pyx":1294
 * 
 *     def do_AutoSpin(self):
 *         self.activate()             # <<<<<<<<<<<<<<
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                       self.Xangle, self.Yangle)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_activate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1294, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1295
 *     def do_AutoSpin(self):
 *         self.activate()
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,             # <<<<<<<<<<<<<<
 *                       self.Xangle, self.Yangle)
 *         self.tkRedraw()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xcenter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ycenter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_zcenter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "CyOpenGL.pyx":1296
 *         self.activate()
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                       self.Xangle, self.Yangle)             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Xangle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Yangle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1296, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "CyOpenGL.pyx":1295
 *     def do_AutoSpin(self):
 *         self.activate()
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,             # <<<<<<<<<<<<<<
 *                       self.Xangle, self.Yangle)
 *         self.tkRedraw()
 */
  __pyx_t_6 = __pyx_f_8CyOpenGL_glRotateScene(__pyx_t_1, __pyx_t_2, __pyx_t_3, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":1297
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                       self.Xangle, self.Yangle)
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 * 
 *         if self.autospin:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1297, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":1299
 *         self.tkRedraw()
 * 
 *         if self.autospin:             # <<<<<<<<<<<<<<
 *             self.after(10, self.do_AutoSpin)
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_autospin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_7 < 0)) __PYX_ERR(0, 1299, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (__pyx_t_7) {

    /* "CyOpenGL.pyx":1300
 * 
 *         if self.autospin:
 *             self.after(10, self.do_AutoSpin)             # <<<<<<<<<<<<<<
 * 
 *     def tkAutoSpin(self, event):
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_after); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_do_AutoSpin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1300, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_10, __pyx_t_4};
      __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1300, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
      PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_int_10, __pyx_t_4};
      __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1300, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else
    #endif
    {
      __pyx_t_2 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      if (__pyx_t_3) {
        __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
      }
      __Pyx_INCREF(__pyx_int_10);
      __Pyx_GIVEREF(__pyx_int_10);
      PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_8, __pyx_int_10);
      __Pyx_GIVEREF(__pyx_t_4);
      PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_8, __pyx_t_4);
      __pyx_t_4 = 0;
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1300, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "CyOpenGL.pyx":1299
 *         self.tkRedraw()
 * 
 *         if self.autospin:             # <<<<<<<<<<<<<<
 *             self.after(10, self.do_AutoSpin)
 * 
 */
  }

  /* "CyOpenGL.pyx":1293
 *         self.tkRedraw()
 * 
 *     def do_AutoSpin(self):             # <<<<<<<<<<<<<<
 *         self.activate()
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.do_AutoSpin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1302
 *             self.after(10, self.do_AutoSpin)
 * 
 *     def tkAutoSpin(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform autospin of scene.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_27tkAutoSpin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_26tkAutoSpin[] = "OpenGLWidget.tkAutoSpin(self, event)\n\n        Perform autospin of scene.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_27tkAutoSpin = {"tkAutoSpin", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_27tkAutoSpin, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_26tkAutoSpin};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_27tkAutoSpin(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_event = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkAutoSpin (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_event,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tkAutoSpin", 1, 2, 2, 1); __PYX_ERR(0, 1302, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tkAutoSpin") < 0)) __PYX_ERR(0, 1302, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkAutoSpin", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1302, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkAutoSpin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_26tkAutoSpin(__pyx_self, __pyx_v_self, __pyx_v_event);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_26tkAutoSpin(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_event) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  __Pyx_RefNannySetupContext("tkAutoSpin", 0);

  /* "CyOpenGL.pyx":1306
 *         Perform autospin of scene.
 *         """
 *         if self.autospin_allowed and 0 < self.delta_t < 100:             # <<<<<<<<<<<<<<
 *             self.autospin = 1
 *             self.after(10, self.do_AutoSpin)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_autospin_allowed); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_3) {
  } else {
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_delta_t); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_RichCompare(__pyx_int_0, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_4)) {
    __Pyx_DECREF(__pyx_t_4);
    __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_int_100, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1306, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 1306, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_1 = __pyx_t_3;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_1) {

    /* "CyOpenGL.pyx":1307
 *         """
 *         if self.autospin_allowed and 0 < self.delta_t < 100:
 *             self.autospin = 1             # <<<<<<<<<<<<<<
 *             self.after(10, self.do_AutoSpin)
 *         self.update_idletasks()
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_autospin, __pyx_int_1) < 0) __PYX_ERR(0, 1307, __pyx_L1_error)

    /* "CyOpenGL.pyx":1308
 *         if self.autospin_allowed and 0 < self.delta_t < 100:
 *             self.autospin = 1
 *             self.after(10, self.do_AutoSpin)             # <<<<<<<<<<<<<<
 *         self.update_idletasks()
 * 
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_after); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_do_AutoSpin); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1308, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = NULL;
    __pyx_t_7 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_7 = 1;
      }
    }
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_int_10, __pyx_t_5};
      __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1308, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
      PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_int_10, __pyx_t_5};
      __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1308, __pyx_L1_error)
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    } else
    #endif
    {
      __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_8);
      if (__pyx_t_6) {
        __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
      }
      __Pyx_INCREF(__pyx_int_10);
      __Pyx_GIVEREF(__pyx_int_10);
      PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_int_10);
      __Pyx_GIVEREF(__pyx_t_5);
      PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_5);
      __pyx_t_5 = 0;
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1308, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":1306
 *         Perform autospin of scene.
 *         """
 *         if self.autospin_allowed and 0 < self.delta_t < 100:             # <<<<<<<<<<<<<<
 *             self.autospin = 1
 *             self.after(10, self.do_AutoSpin)
 */
  }

  /* "CyOpenGL.pyx":1309
 *             self.autospin = 1
 *             self.after(10, self.do_AutoSpin)
 *         self.update_idletasks()             # <<<<<<<<<<<<<<
 * 
 *     def tkRotate(self, event):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_update_idletasks); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_4 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1309, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":1302
 *             self.after(10, self.do_AutoSpin)
 * 
 *     def tkAutoSpin(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform autospin of scene.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkAutoSpin", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1311
 *         self.update_idletasks()
 * 
 *     def tkRotate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform rotation of scene.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_29tkRotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_28tkRotate[] = "OpenGLWidget.tkRotate(self, event)\n\n        Perform rotation of scene.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_29tkRotate = {"tkRotate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_29tkRotate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_28tkRotate};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_29tkRotate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkRotate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_event,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tkRotate", 1, 2, 2, 1); __PYX_ERR(0, 1311, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tkRotate") < 0)) __PYX_ERR(0, 1311, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkRotate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1311, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkRotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_28tkRotate(__pyx_self, __pyx_v_self, __pyx_v_event);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_28tkRotate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannySetupContext("tkRotate", 0);

  /* "CyOpenGL.pyx":1316
 *         """
 *         cdef GLfloat Xangle, Yangle
 *         self.activate()             # <<<<<<<<<<<<<<
 *         self.Xangle = 0.5 * (event.x - self.xmouse)
 *         self.Yangle = 0.5 * (event.y - self.ymouse)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_activate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1316, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1317
 *         cdef GLfloat Xangle, Yangle
 *         self.activate()
 *         self.Xangle = 0.5 * (event.x - self.xmouse)             # <<<<<<<<<<<<<<
 *         self.Yangle = 0.5 * (event.y - self.ymouse)
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xmouse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1317, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Xangle, __pyx_t_2) < 0) __PYX_ERR(0, 1317, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1318
 *         self.activate()
 *         self.Xangle = 0.5 * (event.x - self.xmouse)
 *         self.Yangle = 0.5 * (event.y - self.ymouse)             # <<<<<<<<<<<<<<
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                       self.Xangle, self.Yangle)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ymouse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_Yangle, __pyx_t_3) < 0) __PYX_ERR(0, 1318, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1319
 *         self.Xangle = 0.5 * (event.x - self.xmouse)
 *         self.Yangle = 0.5 * (event.y - self.ymouse)
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,             # <<<<<<<<<<<<<<
 *                       self.Xangle, self.Yangle)
 *         self.tkRedraw()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xcenter); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ycenter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_zcenter); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);

  /* "CyOpenGL.pyx":1320
 *         self.Yangle = 0.5 * (event.y - self.ymouse)
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                       self.Xangle, self.Yangle)             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 *         self.tkRecordMouse(event)
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Xangle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_Yangle); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);

  /* "CyOpenGL.pyx":1319
 *         self.Xangle = 0.5 * (event.x - self.xmouse)
 *         self.Yangle = 0.5 * (event.y - self.ymouse)
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,             # <<<<<<<<<<<<<<
 *                       self.Xangle, self.Yangle)
 *         self.tkRedraw()
 */
  __pyx_t_6 = __pyx_f_8CyOpenGL_glRotateScene(__pyx_t_3, __pyx_t_1, __pyx_t_2, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1319, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":1321
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,
 *                       self.Xangle, self.Yangle)
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1321, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":1322
 *                       self.Xangle, self.Yangle)
 *         self.tkRedraw()
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
 * 
 *     def tkTranslate(self, event):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRecordMouse); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_6 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_4, __pyx_v_event) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_event);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1322, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "CyOpenGL.pyx":1311
 *         self.update_idletasks()
 * 
 *     def tkRotate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform rotation of scene.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkRotate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1324
 *         self.tkRecordMouse(event)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_31tkTranslate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_30tkTranslate[] = "OpenGLWidget.tkTranslate(self, event)\n\n        Perform translation of scene.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_31tkTranslate = {"tkTranslate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_31tkTranslate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_30tkTranslate};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_31tkTranslate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkTranslate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_event,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tkTranslate", 1, 2, 2, 1); __PYX_ERR(0, 1324, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tkTranslate") < 0)) __PYX_ERR(0, 1324, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkTranslate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1324, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkTranslate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_30tkTranslate(__pyx_self, __pyx_v_self, __pyx_v_event);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_30tkTranslate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_RefNannySetupContext("tkTranslate", 0);

  /* "CyOpenGL.pyx":1328
 *         Perform translation of scene.
 *         """
 *         self.activate()             # <<<<<<<<<<<<<<
 *         glTranslateScene(0.05, event.x, event.y, self.xmouse, self.ymouse)
 *         self.tkRedraw()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_activate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1328, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1329
 *         """
 *         self.activate()
 *         glTranslateScene(0.05, event.x, event.y, self.xmouse, self.ymouse)             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 *         self.tkRecordMouse(event)
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_x); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_y); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xmouse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ymouse); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __pyx_f_8CyOpenGL_glTranslateScene(__pyx_float_0_05, __pyx_t_1, __pyx_t_2, __pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1329, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "CyOpenGL.pyx":1330
 *         self.activate()
 *         glTranslateScene(0.05, event.x, event.y, self.xmouse, self.ymouse)
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "CyOpenGL.pyx":1331
 *         glTranslateScene(0.05, event.x, event.y, self.xmouse, self.ymouse)
 *         self.tkRedraw()
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
 * 
 *     def mouse_update(self, event):
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRecordMouse); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_5 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_3, __pyx_v_event) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_event);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1331, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "CyOpenGL.pyx":1324
 *         self.tkRecordMouse(event)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkTranslate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1333
 *         self.tkRecordMouse(event)
 * 
 *     def mouse_update(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw the scene and save the mouse coordinates.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_33mouse_update(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_32mouse_update[] = "OpenGLWidget.mouse_update(self, event)\n\n        Redraw the scene and save the mouse coordinates.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_33mouse_update = {"mouse_update", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_33mouse_update, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_32mouse_update};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_33mouse_update(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("mouse_update (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_event,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("mouse_update", 1, 2, 2, 1); __PYX_ERR(0, 1333, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "mouse_update") < 0)) __PYX_ERR(0, 1333, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("mouse_update", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1333, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.mouse_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_32mouse_update(__pyx_self, __pyx_v_self, __pyx_v_event);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_32mouse_update(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("mouse_update", 0);

  /* "CyOpenGL.pyx":1337
 *         Redraw the scene and save the mouse coordinates.
 *         """
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1337, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1338
 *         """
 *         self.tkRedraw()
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
 * 
 *     def tkRedraw(self, *dummy):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRecordMouse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_event) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_event);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1338, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1333
 *         self.tkRecordMouse(event)
 * 
 *     def mouse_update(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw the scene and save the mouse coordinates.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.mouse_update", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1340
 *         self.tkRecordMouse(event)
 * 
 *     def tkRedraw(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Cause the opengl widget to redraw itself.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_35tkRedraw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_34tkRedraw[] = "OpenGLWidget.tkRedraw(self, *dummy)\n\n        Cause the opengl widget to redraw itself.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_35tkRedraw = {"tkRedraw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_35tkRedraw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_34tkRedraw};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_35tkRedraw(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_dummy = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkRedraw (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_dummy = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_dummy)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_dummy);
  } else {
    __pyx_v_dummy = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "tkRedraw") < 0)) __PYX_ERR(0, 1340, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkRedraw", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1340, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_dummy); __pyx_v_dummy = 0;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkRedraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_34tkRedraw(__pyx_self, __pyx_v_self, __pyx_v_dummy);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_dummy);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_34tkRedraw(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
  PyObject *__pyx_v_w = NULL;
  PyObject *__pyx_v_h = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  PyObject *__pyx_t_8 = NULL;
  GLsizei __pyx_t_9;
  GLsizei __pyx_t_10;
  GLclampf __pyx_t_11;
  GLclampf __pyx_t_12;
  GLclampf __pyx_t_13;
  __Pyx_RefNannySetupContext("tkRedraw", 0);

  /* "CyOpenGL.pyx":1344
 *         Cause the opengl widget to redraw itself.
 *         """
 *         if not self.initialised: return             # <<<<<<<<<<<<<<
 *         self.tk.call(self._w, 'makecurrent')
 *         glPushMatrix()                        # Protect our matrix
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_initialised); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 1344, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = ((!__pyx_t_2) != 0);
  if (__pyx_t_3) {
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
  }

  /* "CyOpenGL.pyx":1345
 *         """
 *         if not self.initialised: return
 *         self.tk.call(self._w, 'makecurrent')             # <<<<<<<<<<<<<<
 *         glPushMatrix()                        # Protect our matrix
 *         w = self.winfo_width()
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tk_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_call); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_6 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_6)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_6);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_makecurrent};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_n_s_makecurrent};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  } else
  #endif
  {
    __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    if (__pyx_t_6) {
      __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
    __Pyx_INCREF(__pyx_n_s_makecurrent);
    __Pyx_GIVEREF(__pyx_n_s_makecurrent);
    PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_n_s_makecurrent);
    __pyx_t_4 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1345, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1346
 *         if not self.initialised: return
 *         self.tk.call(self._w, 'makecurrent')
 *         glPushMatrix()                        # Protect our matrix             # <<<<<<<<<<<<<<
 *         w = self.winfo_width()
 *         h = self.winfo_height()
 */
  glPushMatrix();

  /* "CyOpenGL.pyx":1347
 *         self.tk.call(self._w, 'makecurrent')
 *         glPushMatrix()                        # Protect our matrix
 *         w = self.winfo_width()             # <<<<<<<<<<<<<<
 *         h = self.winfo_height()
 *         glViewport(0, 0, w, h)
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_winfo_width); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1347, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_w = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1348
 *         glPushMatrix()                        # Protect our matrix
 *         w = self.winfo_width()
 *         h = self.winfo_height()             # <<<<<<<<<<<<<<
 *         glViewport(0, 0, w, h)
 * 
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_winfo_height); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_8) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1348, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_h = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1349
 *         w = self.winfo_width()
 *         h = self.winfo_height()
 *         glViewport(0, 0, w, h)             # <<<<<<<<<<<<<<
 * 
 *         # Clear the background and depth buffer.
 */
  __pyx_t_9 = __Pyx_PyInt_As_GLsizei(__pyx_v_w); if (unlikely((__pyx_t_9 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1349, __pyx_L1_error)
  __pyx_t_10 = __Pyx_PyInt_As_GLsizei(__pyx_v_h); if (unlikely((__pyx_t_10 == ((GLsizei)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1349, __pyx_L1_error)
  glViewport(0, 0, __pyx_t_9, __pyx_t_10);

  /* "CyOpenGL.pyx":1352
 * 
 *         # Clear the background and depth buffer.
 *         glClearColor(self.r_back, self.g_back, self.b_back, 0.0)             # <<<<<<<<<<<<<<
 *         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_r_back); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_11 == ((GLclampf)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_g_back); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_12 == ((GLclampf)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_b_back); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_13 == ((GLclampf)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1352, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  glClearColor(__pyx_t_11, __pyx_t_12, __pyx_t_13, 0.0);

  /* "CyOpenGL.pyx":1353
 *         # Clear the background and depth buffer.
 *         glClearColor(self.r_back, self.g_back, self.b_back, 0.0)
 *         glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)             # <<<<<<<<<<<<<<
 * 
 *         # build the projection matrix
 */
  glClear((GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT));

  /* "CyOpenGL.pyx":1356
 * 
 *         # build the projection matrix
 *         self.build_projection(w, h)             # <<<<<<<<<<<<<<
 * 
 *         # Call objects redraw method.
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_build_projection); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1356, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_w, __pyx_v_h};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_v_w, __pyx_v_h};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
  } else
  #endif
  {
    __pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_INCREF(__pyx_v_w);
    __Pyx_GIVEREF(__pyx_v_w);
    PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_w);
    __Pyx_INCREF(__pyx_v_h);
    __Pyx_GIVEREF(__pyx_v_h);
    PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_h);
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1356, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1359
 * 
 *         # Call objects redraw method.
 *         self.redraw()             # <<<<<<<<<<<<<<
 *         glPopMatrix()                            # Restore the matrix
 *         self.tk.call(self._w, 'swapbuffers')
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_redraw); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
    }
  }
  __pyx_t_1 = (__pyx_t_4) ? __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallNoArg(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1359, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1360
 *         # Call objects redraw method.
 *         self.redraw()
 *         glPopMatrix()                            # Restore the matrix             # <<<<<<<<<<<<<<
 *         self.tk.call(self._w, 'swapbuffers')
 * 
 */
  glPopMatrix();

  /* "CyOpenGL.pyx":1361
 *         self.redraw()
 *         glPopMatrix()                            # Restore the matrix
 *         self.tk.call(self._w, 'swapbuffers')             # <<<<<<<<<<<<<<
 * 
 *     def build_projection(self, width, height):
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tk_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_call); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_w); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1361, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_8 = NULL;
  __pyx_t_7 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_7 = 1;
    }
  }
  #if CYTHON_FAST_PYCALL
  if (PyFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_5, __pyx_n_s_swapbuffers};
    __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  #if CYTHON_FAST_PYCCALL
  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
    PyObject *__pyx_temp[3] = {__pyx_t_8, __pyx_t_5, __pyx_n_s_swapbuffers};
    __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error)
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  } else
  #endif
  {
    __pyx_t_6 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    if (__pyx_t_8) {
      __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_8); __pyx_t_8 = NULL;
    }
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_5);
    __Pyx_INCREF(__pyx_n_s_swapbuffers);
    __Pyx_GIVEREF(__pyx_n_s_swapbuffers);
    PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_n_s_swapbuffers);
    __pyx_t_5 = 0;
    __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1361, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1340
 *         self.tkRecordMouse(event)
 * 
 *     def tkRedraw(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Cause the opengl widget to redraw itself.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkRedraw", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_w);
  __Pyx_XDECREF(__pyx_v_h);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1363
 *         self.tk.call(self._w, 'swapbuffers')
 * 
 *     def build_projection(self, width, height):             # <<<<<<<<<<<<<<
 *         cdef GLdouble xmax, yymax, near, far
 *         aspect = float(width)/float(height)
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_37build_projection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_36build_projection[] = "OpenGLWidget.build_projection(self, width, height)";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_37build_projection = {"build_projection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_37build_projection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_36build_projection};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_37build_projection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_projection (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_width,&__pyx_n_s_height,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("build_projection", 1, 3, 3, 1); __PYX_ERR(0, 1363, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("build_projection", 1, 3, 3, 2); __PYX_ERR(0, 1363, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build_projection") < 0)) __PYX_ERR(0, 1363, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v_self = values[0];
    __pyx_v_width = values[1];
    __pyx_v_height = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_projection", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1363, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.build_projection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_36build_projection(__pyx_self, __pyx_v_self, __pyx_v_width, __pyx_v_height);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_36build_projection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height) {
  GLdouble __pyx_v_xmax;
  GLdouble __pyx_v_near;
  GLdouble __pyx_v_far;
  double __pyx_v_aspect;
  PyObject *__pyx_v_ymax = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  double __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  GLdouble __pyx_t_4;
  GLdouble __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  GLfloat __pyx_t_11;
  GLfloat __pyx_t_12;
  GLfloat __pyx_t_13;
  __Pyx_RefNannySetupContext("build_projection", 0);

  /* "CyOpenGL.pyx":1365
 *     def build_projection(self, width, height):
 *         cdef GLdouble xmax, yymax, near, far
 *         aspect = float(width)/float(height)             # <<<<<<<<<<<<<<
 *         near, far = self.near, self.far
 *         self.activate()
 */
  __pyx_t_1 = __Pyx_PyObject_AsDouble(__pyx_v_width); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1365, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_AsDouble(__pyx_v_height); if (unlikely(__pyx_t_2 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1365, __pyx_L1_error)
  if (unlikely(__pyx_t_2 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1365, __pyx_L1_error)
  }
  __pyx_v_aspect = (__pyx_t_1 / __pyx_t_2);

  /* "CyOpenGL.pyx":1366
 *         cdef GLdouble xmax, yymax, near, far
 *         aspect = float(width)/float(height)
 *         near, far = self.near, self.far             # <<<<<<<<<<<<<<
 *         self.activate()
 *         glMatrixMode(GL_PROJECTION)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_near); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_far); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1366, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_5 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1366, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_near = __pyx_t_4;
  __pyx_v_far = __pyx_t_5;

  /* "CyOpenGL.pyx":1367
 *         aspect = float(width)/float(height)
 *         near, far = self.near, self.far
 *         self.activate()             # <<<<<<<<<<<<<<
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_activate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_6, function);
    }
  }
  __pyx_t_3 = (__pyx_t_7) ? __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7) : __Pyx_PyObject_CallNoArg(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1368
 *         near, far = self.near, self.far
 *         self.activate()
 *         glMatrixMode(GL_PROJECTION)             # <<<<<<<<<<<<<<
 *         glLoadIdentity()
 *         ymax = near * tan(self.fovy*pi/360.0)
 */
  glMatrixMode(GL_PROJECTION);

  /* "CyOpenGL.pyx":1369
 *         self.activate()
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()             # <<<<<<<<<<<<<<
 *         ymax = near * tan(self.fovy*pi/360.0)
 *         xmax = ymax * aspect
 */
  glLoadIdentity();

  /* "CyOpenGL.pyx":1370
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()
 *         ymax = near * tan(self.fovy*pi/360.0)             # <<<<<<<<<<<<<<
 *         xmax = ymax * aspect
 *         glFrustum(-xmax, xmax, -ymax, ymax, near, far)
 */
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_near); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_7, __pyx_n_s_tan); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fovy); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_GetModuleGlobalName(__pyx_t_9, __pyx_n_s_pi); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_10 = PyNumber_Multiply(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = __Pyx_PyFloat_DivideObjC(__pyx_t_10, __pyx_float_360_0, 360.0, 0, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  __pyx_t_10 = NULL;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
    __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_7);
    if (likely(__pyx_t_10)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
      __Pyx_INCREF(__pyx_t_10);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_7, function);
    }
  }
  __pyx_t_6 = (__pyx_t_10) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_10, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Multiply(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1370, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_ymax = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "CyOpenGL.pyx":1371
 *         glLoadIdentity()
 *         ymax = near * tan(self.fovy*pi/360.0)
 *         xmax = ymax * aspect             # <<<<<<<<<<<<<<
 *         glFrustum(-xmax, xmax, -ymax, ymax, near, far)
 *         glTranslatef(-self.xcenter, -self.ycenter, -(self.zcenter+self.distance))
 */
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_aspect); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyNumber_Multiply(__pyx_v_ymax, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_5 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1371, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_xmax = __pyx_t_5;

  /* "CyOpenGL.pyx":1372
 *         ymax = near * tan(self.fovy*pi/360.0)
 *         xmax = ymax * aspect
 *         glFrustum(-xmax, xmax, -ymax, ymax, near, far)             # <<<<<<<<<<<<<<
 *         glTranslatef(-self.xcenter, -self.ycenter, -(self.zcenter+self.distance))
 *         glMatrixMode(GL_MODELVIEW)
 */
  __pyx_t_6 = PyNumber_Negative(__pyx_v_ymax); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_5 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_v_ymax); if (unlikely((__pyx_t_4 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1372, __pyx_L1_error)
  glFrustum((-__pyx_v_xmax), __pyx_v_xmax, __pyx_t_5, __pyx_t_4, __pyx_v_near, __pyx_v_far);

  /* "CyOpenGL.pyx":1373
 *         xmax = ymax * aspect
 *         glFrustum(-xmax, xmax, -ymax, ymax, near, far)
 *         glTranslatef(-self.xcenter, -self.ycenter, -(self.zcenter+self.distance))             # <<<<<<<<<<<<<<
 *         glMatrixMode(GL_MODELVIEW)
 * 
 */
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_xcenter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyNumber_Negative(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_ycenter); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyNumber_Negative(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_12 = __pyx_PyFloat_AsFloat(__pyx_t_6); if (unlikely((__pyx_t_12 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_zcenter); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_distance); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = PyNumber_Add(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_13 = __pyx_PyFloat_AsFloat(__pyx_t_7); if (unlikely((__pyx_t_13 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1373, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  glTranslatef(__pyx_t_11, __pyx_t_12, __pyx_t_13);

  /* "CyOpenGL.pyx":1374
 *         glFrustum(-xmax, xmax, -ymax, ymax, near, far)
 *         glTranslatef(-self.xcenter, -self.ycenter, -(self.zcenter+self.distance))
 *         glMatrixMode(GL_MODELVIEW)             # <<<<<<<<<<<<<<
 * 
 *     def tkMap(self, *dummy):
 */
  glMatrixMode(GL_MODELVIEW);

  /* "CyOpenGL.pyx":1363
 *         self.tk.call(self._w, 'swapbuffers')
 * 
 *     def build_projection(self, width, height):             # <<<<<<<<<<<<<<
 *         cdef GLdouble xmax, yymax, near, far
 *         aspect = float(width)/float(height)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.build_projection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_ymax);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1376
 *         glMatrixMode(GL_MODELVIEW)
 * 
 *     def tkMap(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Cause the opengl widget to redraw itself.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_39tkMap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_38tkMap[] = "OpenGLWidget.tkMap(self, *dummy)\n\n        Cause the opengl widget to redraw itself.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_39tkMap = {"tkMap", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_39tkMap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_38tkMap};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_39tkMap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_dummy = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkMap (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_dummy = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_dummy)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_dummy);
  } else {
    __pyx_v_dummy = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "tkMap") < 0)) __PYX_ERR(0, 1376, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkMap", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1376, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_dummy); __pyx_v_dummy = 0;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_38tkMap(__pyx_self, __pyx_v_self, __pyx_v_dummy);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_dummy);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_38tkMap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("tkMap", 0);

  /* "CyOpenGL.pyx":1380
 *         Cause the opengl widget to redraw itself.
 *         """
 *         self.tkExpose()             # <<<<<<<<<<<<<<
 * 
 *     def tkExpose(self, *dummy):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkExpose); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1376
 *         glMatrixMode(GL_MODELVIEW)
 * 
 *     def tkMap(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Cause the opengl widget to redraw itself.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkMap", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1382
 *         self.tkExpose()
 * 
 *     def tkExpose(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw the widget.  Make it active, update tk events, call redraw
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_41tkExpose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_40tkExpose[] = "OpenGLWidget.tkExpose(self, *dummy)\n\n        Redraw the widget.  Make it active, update tk events, call redraw\n        procedure and swap the buffers.  Note: swapbuffers is clever\n        enough to only swap double buffered visuals.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_41tkExpose = {"tkExpose", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_41tkExpose, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_40tkExpose};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_41tkExpose(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_dummy = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkExpose (wrapper)", 0);
  if (PyTuple_GET_SIZE(__pyx_args) > 1) {
    __pyx_v_dummy = PyTuple_GetSlice(__pyx_args, 1, PyTuple_GET_SIZE(__pyx_args));
    if (unlikely(!__pyx_v_dummy)) {
      __Pyx_RefNannyFinishContext();
      return NULL;
    }
    __Pyx_GOTREF(__pyx_v_dummy);
  } else {
    __pyx_v_dummy = __pyx_empty_tuple; __Pyx_INCREF(__pyx_empty_tuple);
  }
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,0};
    PyObject* values[1] = {0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        default:
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t used_pos_args = (pos_args < 1) ? pos_args : 1;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, used_pos_args, "tkExpose") < 0)) __PYX_ERR(0, 1382, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) < 1) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
    }
    __pyx_v_self = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkExpose", 0, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1382, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_dummy); __pyx_v_dummy = 0;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkExpose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_40tkExpose(__pyx_self, __pyx_v_self, __pyx_v_dummy);

  /* function exit code */
  __Pyx_XDECREF(__pyx_v_dummy);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_40tkExpose(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_dummy) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  __Pyx_RefNannySetupContext("tkExpose", 0);

  /* "CyOpenGL.pyx":1388
 *         enough to only swap double buffered visuals.
 *         """
 *         self.activate()             # <<<<<<<<<<<<<<
 *         if not self.initialised:
 *             self.initialised = 1
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_activate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1388, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1389
 *         """
 *         self.activate()
 *         if not self.initialised:             # <<<<<<<<<<<<<<
 *             self.initialised = 1
 *         self.tkRedraw()
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_initialised); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_5 = ((!__pyx_t_4) != 0);
  if (__pyx_t_5) {

    /* "CyOpenGL.pyx":1390
 *         self.activate()
 *         if not self.initialised:
 *             self.initialised = 1             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 * 
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_self, __pyx_n_s_initialised, __pyx_int_1) < 0) __PYX_ERR(0, 1390, __pyx_L1_error)

    /* "CyOpenGL.pyx":1389
 *         """
 *         self.activate()
 *         if not self.initialised:             # <<<<<<<<<<<<<<
 *             self.initialised = 1
 *         self.tkRedraw()
 */
  }

  /* "CyOpenGL.pyx":1391
 *         if not self.initialised:
 *             self.initialised = 1
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 * 
 *     def tkKeyPress(self, event):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1391, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1382
 *         self.tkExpose()
 * 
 *     def tkExpose(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw the widget.  Make it active, update tk events, call redraw
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkExpose", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1393
 *         self.tkRedraw()
 * 
 *     def tkKeyPress(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle keyboard events.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_43tkKeyPress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_42tkKeyPress[] = "OpenGLWidget.tkKeyPress(self, event)\n\n        Handle keyboard events.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_43tkKeyPress = {"tkKeyPress", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_43tkKeyPress, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_42tkKeyPress};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_43tkKeyPress(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkKeyPress (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_event,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tkKeyPress", 1, 2, 2, 1); __PYX_ERR(0, 1393, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tkKeyPress") < 0)) __PYX_ERR(0, 1393, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkKeyPress", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1393, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkKeyPress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_42tkKeyPress(__pyx_self, __pyx_v_self, __pyx_v_event);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_42tkKeyPress(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_t_10;
  __Pyx_RefNannySetupContext("tkKeyPress", 0);

  /* "CyOpenGL.pyx":1397
 *         Handle keyboard events.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             self.key_action[event.keysym]()
 *         except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "CyOpenGL.pyx":1398
 *         """
 *         try:
 *             self.key_action[event.keysym]()             # <<<<<<<<<<<<<<
 *         except KeyError:
 *             pass
 */
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_key_action); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1398, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_event, __pyx_n_s_keysym); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1398, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetItem(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1398, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
        }
      }
      __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
      __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1398, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "CyOpenGL.pyx":1397
 *         Handle keyboard events.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             self.key_action[event.keysym]()
 *         except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "CyOpenGL.pyx":1399
 *         try:
 *             self.key_action[event.keysym]()
 *         except KeyError:             # <<<<<<<<<<<<<<
 *             pass
 *         if not self.autospin:
 */
    __pyx_t_8 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_8) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "CyOpenGL.pyx":1397
 *         Handle keyboard events.
 *         """
 *         try:             # <<<<<<<<<<<<<<
 *             self.key_action[event.keysym]()
 *         except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "CyOpenGL.pyx":1401
 *         except KeyError:
 *             pass
 *         if not self.autospin:             # <<<<<<<<<<<<<<
 *             self.tkRedraw()
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_autospin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_9 < 0)) __PYX_ERR(0, 1401, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = ((!__pyx_t_9) != 0);
  if (__pyx_t_10) {

    /* "CyOpenGL.pyx":1402
 *             pass
 *         if not self.autospin:
 *             self.tkRedraw()             # <<<<<<<<<<<<<<
 * 
 *     def tkPrint(self, file):
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_6 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
      __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
      if (likely(__pyx_t_6)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
        __Pyx_INCREF(__pyx_t_6);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_7, function);
      }
    }
    __pyx_t_4 = (__pyx_t_6) ? __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6) : __Pyx_PyObject_CallNoArg(__pyx_t_7);
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1402, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "CyOpenGL.pyx":1401
 *         except KeyError:
 *             pass
 *         if not self.autospin:             # <<<<<<<<<<<<<<
 *             self.tkRedraw()
 * 
 */
  }

  /* "CyOpenGL.pyx":1393
 *         self.tkRedraw()
 * 
 *     def tkKeyPress(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle keyboard events.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkKeyPress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1404
 *             self.tkRedraw()
 * 
 *     def tkPrint(self, file):             # <<<<<<<<<<<<<<
 *         """
 *         Turn the current scene into PostScript via the feedback buffer.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_45tkPrint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_12OpenGLWidget_44tkPrint[] = "OpenGLWidget.tkPrint(self, file)\n\n        Turn the current scene into PostScript via the feedback buffer.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_12OpenGLWidget_45tkPrint = {"tkPrint", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_12OpenGLWidget_45tkPrint, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_12OpenGLWidget_44tkPrint};
static PyObject *__pyx_pw_8CyOpenGL_12OpenGLWidget_45tkPrint(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  CYTHON_UNUSED PyObject *__pyx_v_file = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkPrint (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_file,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_file)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tkPrint", 1, 2, 2, 1); __PYX_ERR(0, 1404, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tkPrint") < 0)) __PYX_ERR(0, 1404, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_file = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkPrint", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1404, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkPrint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_12OpenGLWidget_44tkPrint(__pyx_self, __pyx_v_self, __pyx_v_file);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_12OpenGLWidget_44tkPrint(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v_file) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("tkPrint", 0);

  /* "CyOpenGL.pyx":1408
 *         Turn the current scene into PostScript via the feedback buffer.
 *         """
 *         self.activate()             # <<<<<<<<<<<<<<
 *         # DEAL WITH THIS
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_activate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1408, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1404
 *             self.tkRedraw()
 * 
 *     def tkPrint(self, file):             # <<<<<<<<<<<<<<
 *         """
 *         Turn the current scene into PostScript via the feedback buffer.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLWidget.tkPrint", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1417
 *     """
 * 
 *     def build_projection(self, width, height, t=1.0):             # <<<<<<<<<<<<<<
 *         aspect = float(width)/float(height)
 *         top = self.fovy/2
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_1build_projection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_17OpenGLOrthoWidget_build_projection[] = "OpenGLOrthoWidget.build_projection(self, width, height, t=1.0)";
static PyMethodDef __pyx_mdef_8CyOpenGL_17OpenGLOrthoWidget_1build_projection = {"build_projection", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_1build_projection, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_17OpenGLOrthoWidget_build_projection};
static PyObject *__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_1build_projection(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_width = 0;
  PyObject *__pyx_v_height = 0;
  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("build_projection (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_width,&__pyx_n_s_height,&__pyx_n_s_t,0};
    PyObject* values[4] = {0,0,0,0};
    values[3] = ((PyObject *)((PyObject*)__pyx_float_1_0));
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_width)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("build_projection", 0, 3, 4, 1); __PYX_ERR(0, 1417, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_height)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("build_projection", 0, 3, 4, 2); __PYX_ERR(0, 1417, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (kw_args > 0) {
          PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t);
          if (value) { values[3] = value; kw_args--; }
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "build_projection") < 0)) __PYX_ERR(0, 1417, __pyx_L3_error)
      }
    } else {
      switch (PyTuple_GET_SIZE(__pyx_args)) {
        case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_self = values[0];
    __pyx_v_width = values[1];
    __pyx_v_height = values[2];
    __pyx_v_t = values[3];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("build_projection", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1417, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLOrthoWidget.build_projection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_build_projection(__pyx_self, __pyx_v_self, __pyx_v_width, __pyx_v_height, __pyx_v_t);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_build_projection(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_width, PyObject *__pyx_v_height, CYTHON_UNUSED PyObject *__pyx_v_t) {
  double __pyx_v_aspect;
  PyObject *__pyx_v_top = NULL;
  PyObject *__pyx_v_right = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  double __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  GLdouble __pyx_t_7;
  GLdouble __pyx_t_8;
  GLdouble __pyx_t_9;
  GLdouble __pyx_t_10;
  __Pyx_RefNannySetupContext("build_projection", 0);

  /* "CyOpenGL.pyx":1418
 * 
 *     def build_projection(self, width, height, t=1.0):
 *         aspect = float(width)/float(height)             # <<<<<<<<<<<<<<
 *         top = self.fovy/2
 *         right = top*aspect
 */
  __pyx_t_1 = __Pyx_PyObject_AsDouble(__pyx_v_width); if (unlikely(__pyx_t_1 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1418, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_AsDouble(__pyx_v_height); if (unlikely(__pyx_t_2 == ((double)((double)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1418, __pyx_L1_error)
  if (unlikely(__pyx_t_2 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1418, __pyx_L1_error)
  }
  __pyx_v_aspect = (__pyx_t_1 / __pyx_t_2);

  /* "CyOpenGL.pyx":1419
 *     def build_projection(self, width, height, t=1.0):
 *         aspect = float(width)/float(height)
 *         top = self.fovy/2             # <<<<<<<<<<<<<<
 *         right = top*aspect
 *         self.activate()
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_fovy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_int_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1419, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_top = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":1420
 *         aspect = float(width)/float(height)
 *         top = self.fovy/2
 *         right = top*aspect             # <<<<<<<<<<<<<<
 *         self.activate()
 *         glMatrixMode(GL_PROJECTION)
 */
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_aspect); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Multiply(__pyx_v_top, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_right = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1421
 *         top = self.fovy/2
 *         right = top*aspect
 *         self.activate()             # <<<<<<<<<<<<<<
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_activate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
    }
  }
  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1422
 *         right = top*aspect
 *         self.activate()
 *         glMatrixMode(GL_PROJECTION)             # <<<<<<<<<<<<<<
 *         glLoadIdentity()
 *         if self.flipped:
 */
  glMatrixMode(GL_PROJECTION);

  /* "CyOpenGL.pyx":1423
 *         self.activate()
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()             # <<<<<<<<<<<<<<
 *         if self.flipped:
 *             glEnable(GL_LIGHT1)
 */
  glLoadIdentity();

  /* "CyOpenGL.pyx":1424
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             glEnable(GL_LIGHT1)
 *             glDisable(GL_LIGHT0)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_flipped); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(0, 1424, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_6) {

    /* "CyOpenGL.pyx":1425
 *         glLoadIdentity()
 *         if self.flipped:
 *             glEnable(GL_LIGHT1)             # <<<<<<<<<<<<<<
 *             glDisable(GL_LIGHT0)
 *             glOrtho(-right, right, top, -top, 3.0, -3.0)
 */
    glEnable(GL_LIGHT1);

    /* "CyOpenGL.pyx":1426
 *         if self.flipped:
 *             glEnable(GL_LIGHT1)
 *             glDisable(GL_LIGHT0)             # <<<<<<<<<<<<<<
 *             glOrtho(-right, right, top, -top, 3.0, -3.0)
 *         else:
 */
    glDisable(GL_LIGHT0);

    /* "CyOpenGL.pyx":1427
 *             glEnable(GL_LIGHT1)
 *             glDisable(GL_LIGHT0)
 *             glOrtho(-right, right, top, -top, 3.0, -3.0)             # <<<<<<<<<<<<<<
 *         else:
 *             glEnable(GL_LIGHT0)
 */
    __pyx_t_3 = PyNumber_Negative(__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_7 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_v_right); if (unlikely((__pyx_t_8 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L1_error)
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_top); if (unlikely((__pyx_t_9 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L1_error)
    __pyx_t_3 = PyNumber_Negative(__pyx_v_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1427, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1427, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    glOrtho(__pyx_t_7, __pyx_t_8, __pyx_t_9, __pyx_t_10, 3.0, -3.0);

    /* "CyOpenGL.pyx":1424
 *         glMatrixMode(GL_PROJECTION)
 *         glLoadIdentity()
 *         if self.flipped:             # <<<<<<<<<<<<<<
 *             glEnable(GL_LIGHT1)
 *             glDisable(GL_LIGHT0)
 */
    goto __pyx_L3;
  }

  /* "CyOpenGL.pyx":1429
 *             glOrtho(-right, right, top, -top, 3.0, -3.0)
 *         else:
 *             glEnable(GL_LIGHT0)             # <<<<<<<<<<<<<<
 *             glDisable(GL_LIGHT1)
 *             glOrtho(-right, right, -top, top, -3.0, 3.0)
 */
  /*else*/ {
    glEnable(GL_LIGHT0);

    /* "CyOpenGL.pyx":1430
 *         else:
 *             glEnable(GL_LIGHT0)
 *             glDisable(GL_LIGHT1)             # <<<<<<<<<<<<<<
 *             glOrtho(-right, right, -top, top, -3.0, 3.0)
 *         glMatrixMode(GL_MODELVIEW)
 */
    glDisable(GL_LIGHT1);

    /* "CyOpenGL.pyx":1431
 *             glEnable(GL_LIGHT0)
 *             glDisable(GL_LIGHT1)
 *             glOrtho(-right, right, -top, top, -3.0, 3.0)             # <<<<<<<<<<<<<<
 *         glMatrixMode(GL_MODELVIEW)
 * 
 */
    __pyx_t_3 = PyNumber_Negative(__pyx_v_right); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1431, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_v_right); if (unlikely((__pyx_t_9 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1431, __pyx_L1_error)
    __pyx_t_3 = PyNumber_Negative(__pyx_v_top); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1431, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1431, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_v_top); if (unlikely((__pyx_t_7 == ((GLdouble)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1431, __pyx_L1_error)
    glOrtho(__pyx_t_10, __pyx_t_9, __pyx_t_8, __pyx_t_7, -3.0, 3.0);
  }
  __pyx_L3:;

  /* "CyOpenGL.pyx":1432
 *             glDisable(GL_LIGHT1)
 *             glOrtho(-right, right, -top, top, -3.0, 3.0)
 *         glMatrixMode(GL_MODELVIEW)             # <<<<<<<<<<<<<<
 * 
 *     def tkTranslate(self, event):
 */
  glMatrixMode(GL_MODELVIEW);

  /* "CyOpenGL.pyx":1417
 *     """
 * 
 *     def build_projection(self, width, height, t=1.0):             # <<<<<<<<<<<<<<
 *         aspect = float(width)/float(height)
 *         top = self.fovy/2
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.OpenGLOrthoWidget.build_projection", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_top);
  __Pyx_XDECREF(__pyx_v_right);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1434
 *         glMatrixMode(GL_MODELVIEW)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_3tkTranslate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_17OpenGLOrthoWidget_2tkTranslate[] = "OpenGLOrthoWidget.tkTranslate(self, event)\n\n        Perform translation of scene.\n        ";
static PyMethodDef __pyx_mdef_8CyOpenGL_17OpenGLOrthoWidget_3tkTranslate = {"tkTranslate", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_3tkTranslate, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_17OpenGLOrthoWidget_2tkTranslate};
static PyObject *__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_3tkTranslate(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_self = 0;
  PyObject *__pyx_v_event = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("tkTranslate (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_event,0};
    PyObject* values[2] = {0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_event)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("tkTranslate", 1, 2, 2, 1); __PYX_ERR(0, 1434, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "tkTranslate") < 0)) __PYX_ERR(0, 1434, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
    }
    __pyx_v_self = values[0];
    __pyx_v_event = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("tkTranslate", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1434, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.OpenGLOrthoWidget.tkTranslate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_2tkTranslate(__pyx_self, __pyx_v_self, __pyx_v_event);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_2tkTranslate(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_event) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_RefNannySetupContext("tkTranslate", 0);

  /* "CyOpenGL.pyx":1438
 *         Perform translation of scene.
 *         """
 *         self.tkRedraw()             # <<<<<<<<<<<<<<
 *         self.tkRecordMouse(event)
 * 
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRedraw); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3) : __Pyx_PyObject_CallNoArg(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1438, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1439
 *         """
 *         self.tkRedraw()
 *         self.tkRecordMouse(event)             # <<<<<<<<<<<<<<
 * 
 *     def redraw(self):
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_tkRecordMouse); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_1 = (__pyx_t_3) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_3, __pyx_v_event) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_event);
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1434
 *         glMatrixMode(GL_MODELVIEW)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("CyOpenGL.OpenGLOrthoWidget.tkTranslate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "CyOpenGL.pyx":1441
 *         self.tkRecordMouse(event)
 * 
 *     def redraw(self):             # <<<<<<<<<<<<<<
 *         pass
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_5redraw(PyObject *__pyx_self, PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_8CyOpenGL_17OpenGLOrthoWidget_4redraw[] = "OpenGLOrthoWidget.redraw(self)";
static PyMethodDef __pyx_mdef_8CyOpenGL_17OpenGLOrthoWidget_5redraw = {"redraw", (PyCFunction)__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_5redraw, METH_O, __pyx_doc_8CyOpenGL_17OpenGLOrthoWidget_4redraw};
static PyObject *__pyx_pw_8CyOpenGL_17OpenGLOrthoWidget_5redraw(PyObject *__pyx_self, PyObject *__pyx_v_self) {
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("redraw (wrapper)", 0);
  __pyx_r = __pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_4redraw(__pyx_self, ((PyObject *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_17OpenGLOrthoWidget_4redraw(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("redraw", 0);

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_HoroballGroup(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_3__pyx_unpickle_HoroballGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_2__pyx_unpickle_HoroballGroup[] = "__pyx_unpickle_HoroballGroup(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_8CyOpenGL_3__pyx_unpickle_HoroballGroup = {"__pyx_unpickle_HoroballGroup", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_3__pyx_unpickle_HoroballGroup, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_2__pyx_unpickle_HoroballGroup};
static PyObject *__pyx_pw_8CyOpenGL_3__pyx_unpickle_HoroballGroup(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_HoroballGroup (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_HoroballGroup", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_HoroballGroup", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_HoroballGroup") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_HoroballGroup", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.__pyx_unpickle_HoroballGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_2__pyx_unpickle_HoroballGroup(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_2__pyx_unpickle_HoroballGroup(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_HoroballGroup", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x0a6b5be:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0a6b5be = (centers, color, cutoff, horoballs, keys, list_id_base, list_ids, longitude, meridian, num_lists, original_indices, spheres))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x0a6b5be) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x0a6b5be:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0a6b5be = (centers, color, cutoff, horoballs, keys, list_id_base, list_ids, longitude, meridian, num_lists, original_indices, spheres))" % __pyx_checksum)
 *     __pyx_result = HoroballGroup.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x0a6b5be:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0a6b5be = (centers, color, cutoff, horoballs, keys, list_id_base, list_ids, longitude, meridian, num_lists, original_indices, spheres))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = HoroballGroup.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x0a, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x0a6b5be:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0a6b5be = (centers, color, cutoff, horoballs, keys, list_id_base, list_ids, longitude, meridian, num_lists, original_indices, spheres))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0a6b5be = (centers, color, cutoff, horoballs, keys, list_id_base, list_ids, longitude, meridian, num_lists, original_indices, spheres))" % __pyx_checksum)
 *     __pyx_result = HoroballGroup.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_HoroballGroup__set_state(<HoroballGroup> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8CyOpenGL_HoroballGroup), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0a6b5be = (centers, color, cutoff, horoballs, keys, list_id_base, list_ids, longitude, meridian, num_lists, original_indices, spheres))" % __pyx_checksum)
 *     __pyx_result = HoroballGroup.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_HoroballGroup__set_state(<HoroballGroup> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = HoroballGroup.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_HoroballGroup__set_state(<HoroballGroup> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_HoroballGroup__set_state(HoroballGroup __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8CyOpenGL___pyx_unpickle_HoroballGroup__set_state(((struct __pyx_obj_8CyOpenGL_HoroballGroup *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x0a6b5be = (centers, color, cutoff, horoballs, keys, list_id_base, list_ids, longitude, meridian, num_lists, original_indices, spheres))" % __pyx_checksum)
 *     __pyx_result = HoroballGroup.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_HoroballGroup__set_state(<HoroballGroup> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_HoroballGroup__set_state(<HoroballGroup> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_HoroballGroup__set_state(HoroballGroup __pyx_result, tuple __pyx_state):
 *     __pyx_result.centers = __pyx_state[0]; __pyx_result.color = __pyx_state[1]; __pyx_result.cutoff = __pyx_state[2]; __pyx_result.horoballs = __pyx_state[3]; __pyx_result.keys = __pyx_state[4]; __pyx_result.list_id_base = __pyx_state[5]; __pyx_result.list_ids = __pyx_state[6]; __pyx_result.longitude = __pyx_state[7]; __pyx_result.meridian = __pyx_state[8]; __pyx_result.num_lists = __pyx_state[9]; __pyx_result.original_indices = __pyx_state[10]; __pyx_result.spheres = __pyx_state[11]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_HoroballGroup(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.__pyx_unpickle_HoroballGroup", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_HoroballGroup__set_state(<HoroballGroup> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_HoroballGroup__set_state(HoroballGroup __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.centers = __pyx_state[0]; __pyx_result.color = __pyx_state[1]; __pyx_result.cutoff = __pyx_state[2]; __pyx_result.horoballs = __pyx_state[3]; __pyx_result.keys = __pyx_state[4]; __pyx_result.list_id_base = __pyx_state[5]; __pyx_result.list_ids = __pyx_state[6]; __pyx_result.longitude = __pyx_state[7]; __pyx_result.meridian = __pyx_state[8]; __pyx_result.num_lists = __pyx_state[9]; __pyx_result.original_indices = __pyx_state[10]; __pyx_result.spheres = __pyx_state[11]
 *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_8CyOpenGL___pyx_unpickle_HoroballGroup__set_state(struct __pyx_obj_8CyOpenGL_HoroballGroup *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  GLfloat __pyx_t_2[4];
  double __pyx_t_3;
  GLuint __pyx_t_4;
  int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_HoroballGroup__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_HoroballGroup__set_state(HoroballGroup __pyx_result, tuple __pyx_state):
 *     __pyx_result.centers = __pyx_state[0]; __pyx_result.color = __pyx_state[1]; __pyx_result.cutoff = __pyx_state[2]; __pyx_result.horoballs = __pyx_state[3]; __pyx_result.keys = __pyx_state[4]; __pyx_result.list_id_base = __pyx_state[5]; __pyx_result.list_ids = __pyx_state[6]; __pyx_result.longitude = __pyx_state[7]; __pyx_result.meridian = __pyx_state[8]; __pyx_result.num_lists = __pyx_state[9]; __pyx_result.original_indices = __pyx_state[10]; __pyx_result.spheres = __pyx_state[11]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[12])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->centers);
  __Pyx_DECREF(__pyx_v___pyx_result->centers);
  __pyx_v___pyx_result->centers = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely(__Pyx_carray_from_py_GLfloat(__pyx_t_1, __pyx_t_2, 4) < 0)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  memcpy(&(__pyx_v___pyx_result->color[0]), __pyx_t_2, sizeof(__pyx_v___pyx_result->color[0]) * (4));
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->cutoff = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->horoballs);
  __Pyx_DECREF(__pyx_v___pyx_result->horoballs);
  __pyx_v___pyx_result->horoballs = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->keys);
  __Pyx_DECREF(__pyx_v___pyx_result->keys);
  __pyx_v___pyx_result->keys = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->list_id_base = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->list_ids);
  __Pyx_DECREF(__pyx_v___pyx_result->list_ids);
  __pyx_v___pyx_result->list_ids = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->longitude);
  __Pyx_DECREF(__pyx_v___pyx_result->longitude);
  __pyx_v___pyx_result->longitude = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->meridian);
  __Pyx_DECREF(__pyx_v___pyx_result->meridian);
  __pyx_v___pyx_result->meridian = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_4 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->num_lists = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->original_indices);
  __Pyx_DECREF(__pyx_v___pyx_result->original_indices);
  __pyx_v___pyx_result->original_indices = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->spheres);
  __Pyx_DECREF(__pyx_v___pyx_result->spheres);
  __pyx_v___pyx_result->spheres = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_HoroballGroup__set_state(HoroballGroup __pyx_result, tuple __pyx_state):
 *     __pyx_result.centers = __pyx_state[0]; __pyx_result.color = __pyx_state[1]; __pyx_result.cutoff = __pyx_state[2]; __pyx_result.horoballs = __pyx_state[3]; __pyx_result.keys = __pyx_state[4]; __pyx_result.list_id_base = __pyx_state[5]; __pyx_result.list_ids = __pyx_state[6]; __pyx_result.longitude = __pyx_state[7]; __pyx_result.meridian = __pyx_state[8]; __pyx_result.num_lists = __pyx_state[9]; __pyx_result.original_indices = __pyx_state[10]; __pyx_result.spheres = __pyx_state[11]
 *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[12])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_6 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_7 = ((__pyx_t_6 > 12) != 0);
  if (__pyx_t_7) {
  } else {
    __pyx_t_5 = __pyx_t_7;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_7 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_8 = (__pyx_t_7 != 0);
  __pyx_t_5 = __pyx_t_8;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_5) {

    /* "(tree fragment)":14
 *     __pyx_result.centers = __pyx_state[0]; __pyx_result.color = __pyx_state[1]; __pyx_result.cutoff = __pyx_state[2]; __pyx_result.horoballs = __pyx_state[3]; __pyx_result.keys = __pyx_state[4]; __pyx_result.list_id_base = __pyx_state[5]; __pyx_result.list_ids = __pyx_state[6]; __pyx_result.longitude = __pyx_state[7]; __pyx_result.meridian = __pyx_state[8]; __pyx_result.num_lists = __pyx_state[9]; __pyx_result.original_indices = __pyx_state[10]; __pyx_result.spheres = __pyx_state[11]
 *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[12])             # <<<<<<<<<<<<<<
 */
    __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_update); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_9 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_11 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_11)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_11);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
      }
    }
    __pyx_t_1 = (__pyx_t_11) ? __Pyx_PyObject_Call2Args(__pyx_t_10, __pyx_t_11, __pyx_t_9) : __Pyx_PyObject_CallOneArg(__pyx_t_10, __pyx_t_9);
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_HoroballGroup__set_state(HoroballGroup __pyx_result, tuple __pyx_state):
 *     __pyx_result.centers = __pyx_state[0]; __pyx_result.color = __pyx_state[1]; __pyx_result.cutoff = __pyx_state[2]; __pyx_result.horoballs = __pyx_state[3]; __pyx_result.keys = __pyx_state[4]; __pyx_result.list_id_base = __pyx_state[5]; __pyx_result.list_ids = __pyx_state[6]; __pyx_result.longitude = __pyx_state[7]; __pyx_result.meridian = __pyx_state[8]; __pyx_result.num_lists = __pyx_state[9]; __pyx_result.original_indices = __pyx_state[10]; __pyx_result.spheres = __pyx_state[11]
 *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[12])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_HoroballGroup__set_state(<HoroballGroup> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_HoroballGroup__set_state(HoroballGroup __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.centers = __pyx_state[0]; __pyx_result.color = __pyx_state[1]; __pyx_result.cutoff = __pyx_state[2]; __pyx_result.horoballs = __pyx_state[3]; __pyx_result.keys = __pyx_state[4]; __pyx_result.list_id_base = __pyx_state[5]; __pyx_result.list_ids = __pyx_state[6]; __pyx_result.longitude = __pyx_state[7]; __pyx_result.meridian = __pyx_state[8]; __pyx_result.num_lists = __pyx_state[9]; __pyx_result.original_indices = __pyx_state[10]; __pyx_result.spheres = __pyx_state[11]
 *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("CyOpenGL.__pyx_unpickle_HoroballGroup__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_Label(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_5__pyx_unpickle_Label(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_4__pyx_unpickle_Label[] = "__pyx_unpickle_Label(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_8CyOpenGL_5__pyx_unpickle_Label = {"__pyx_unpickle_Label", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_5__pyx_unpickle_Label, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_4__pyx_unpickle_Label};
static PyObject *__pyx_pw_8CyOpenGL_5__pyx_unpickle_Label(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_Label (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Label", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Label", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Label") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Label", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.__pyx_unpickle_Label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_4__pyx_unpickle_Label(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_4__pyx_unpickle_Label(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Label", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x8c950d7:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x8c950d7 = (codes, x, y))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x8c950d7) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x8c950d7:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x8c950d7 = (codes, x, y))" % __pyx_checksum)
 *     __pyx_result = Label.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x8c950d7:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x8c950d7 = (codes, x, y))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = Label.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x8c, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x8c950d7:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x8c950d7 = (codes, x, y))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x8c950d7 = (codes, x, y))" % __pyx_checksum)
 *     __pyx_result = Label.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Label__set_state(<Label> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8CyOpenGL_Label), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x8c950d7 = (codes, x, y))" % __pyx_checksum)
 *     __pyx_result = Label.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Label__set_state(<Label> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = Label.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Label__set_state(<Label> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_Label__set_state(Label __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8CyOpenGL___pyx_unpickle_Label__set_state(((struct __pyx_obj_8CyOpenGL_Label *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0x8c950d7 = (codes, x, y))" % __pyx_checksum)
 *     __pyx_result = Label.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_Label__set_state(<Label> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_Label__set_state(<Label> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_Label__set_state(Label __pyx_result, tuple __pyx_state):
 *     __pyx_result.codes = __pyx_state[0]; __pyx_result.x = __pyx_state[1]; __pyx_result.y = __pyx_state[2]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_Label(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.__pyx_unpickle_Label", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_Label__set_state(<Label> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Label__set_state(Label __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.codes = __pyx_state[0]; __pyx_result.x = __pyx_state[1]; __pyx_result.y = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_8CyOpenGL___pyx_unpickle_Label__set_state(struct __pyx_obj_8CyOpenGL_Label *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  GLfloat __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_Label__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_Label__set_state(Label __pyx_result, tuple __pyx_state):
 *     __pyx_result.codes = __pyx_state[0]; __pyx_result.x = __pyx_state[1]; __pyx_result.y = __pyx_state[2]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->codes);
  __Pyx_DECREF(__pyx_v___pyx_result->codes);
  __pyx_v___pyx_result->codes = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->x = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->y = __pyx_t_2;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_Label__set_state(Label __pyx_result, tuple __pyx_state):
 *     __pyx_result.codes = __pyx_state[0]; __pyx_result.x = __pyx_state[1]; __pyx_result.y = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_5 = ((__pyx_t_4 > 3) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  __pyx_t_3 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "(tree fragment)":14
 *     __pyx_result.codes = __pyx_state[0]; __pyx_result.x = __pyx_state[1]; __pyx_result.y = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[3])             # <<<<<<<<<<<<<<
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
      }
    }
    __pyx_t_1 = (__pyx_t_9) ? __Pyx_PyObject_Call2Args(__pyx_t_8, __pyx_t_9, __pyx_t_7) : __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7);
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_Label__set_state(Label __pyx_result, tuple __pyx_state):
 *     __pyx_result.codes = __pyx_state[0]; __pyx_result.x = __pyx_state[1]; __pyx_result.y = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[3])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_Label__set_state(<Label> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_Label__set_state(Label __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.codes = __pyx_state[0]; __pyx_result.x = __pyx_state[1]; __pyx_result.y = __pyx_state[2]
 *     if len(__pyx_state) > 3 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("CyOpenGL.__pyx_unpickle_Label__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_HoroballScene(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_8CyOpenGL_7__pyx_unpickle_HoroballScene(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_8CyOpenGL_6__pyx_unpickle_HoroballScene[] = "__pyx_unpickle_HoroballScene(__pyx_type, long __pyx_checksum, __pyx_state)";
static PyMethodDef __pyx_mdef_8CyOpenGL_7__pyx_unpickle_HoroballScene = {"__pyx_unpickle_HoroballScene", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_7__pyx_unpickle_HoroballScene, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_6__pyx_unpickle_HoroballScene};
static PyObject *__pyx_pw_8CyOpenGL_7__pyx_unpickle_HoroballScene(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_HoroballScene (wrapper)", 0);
  {
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    PyObject* values[3] = {0,0,0};
    if (unlikely(__pyx_kwds)) {
      Py_ssize_t kw_args;
      const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
      switch (pos_args) {
        case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = PyDict_Size(__pyx_kwds);
      switch (pos_args) {
        case  0:
        if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_HoroballScene", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_HoroballScene", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_HoroballScene") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_HoroballScene", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("CyOpenGL.__pyx_unpickle_HoroballScene", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_8CyOpenGL_6__pyx_unpickle_HoroballScene(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_8CyOpenGL_6__pyx_unpickle_HoroballScene(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_RefNannySetupContext("__pyx_unpickle_HoroballScene", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xcc0e0ec:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcc0e0ec = (Ford, Ford_dark_list_id, Ford_light_list_id, Ford_var, Xangle, Yangle, ball_list_id, cusp_view, cutoff, flipped, horo_var, label_var, labels, labels_list_id, longitude, meridian, nbhd, offset, pgram, pgram_list_id, pgram_var, shifts, tri, tri_dark_list_id, tri_light_list_id, tri_var, which_cusp))" % __pyx_checksum)
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xcc0e0ec) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xcc0e0ec:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcc0e0ec = (Ford, Ford_dark_list_id, Ford_light_list_id, Ford_var, Xangle, Yangle, ball_list_id, cusp_view, cutoff, flipped, horo_var, label_var, labels, labels_list_id, longitude, meridian, nbhd, offset, pgram, pgram_list_id, pgram_var, shifts, tri, tri_dark_list_id, tri_light_list_id, tri_var, which_cusp))" % __pyx_checksum)
 *     __pyx_result = HoroballScene.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0xcc0e0ec:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcc0e0ec = (Ford, Ford_dark_list_id, Ford_light_list_id, Ford_var, Xangle, Yangle, ball_list_id, cusp_view, cutoff, flipped, horo_var, label_var, labels, labels_list_id, longitude, meridian, nbhd, offset, pgram, pgram_list_id, pgram_var, shifts, tri, tri_dark_list_id, tri_light_list_id, tri_var, which_cusp))" % __pyx_checksum)             # <<<<<<<<<<<<<<
 *     __pyx_result = HoroballScene.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xcc, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_INCREF(__pyx_v___pyx_PickleError);
    __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
      }
    }
    __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0xcc0e0ec:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcc0e0ec = (Ford, Ford_dark_list_id, Ford_light_list_id, Ford_var, Xangle, Yangle, ball_list_id, cusp_view, cutoff, flipped, horo_var, label_var, labels, labels_list_id, longitude, meridian, nbhd, offset, pgram, pgram_list_id, pgram_var, shifts, tri, tri_dark_list_id, tri_light_list_id, tri_var, which_cusp))" % __pyx_checksum)
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcc0e0ec = (Ford, Ford_dark_list_id, Ford_light_list_id, Ford_var, Xangle, Yangle, ball_list_id, cusp_view, cutoff, flipped, horo_var, label_var, labels, labels_list_id, longitude, meridian, nbhd, offset, pgram, pgram_list_id, pgram_var, shifts, tri, tri_dark_list_id, tri_light_list_id, tri_var, which_cusp))" % __pyx_checksum)
 *     __pyx_result = HoroballScene.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_HoroballScene__set_state(<HoroballScene> __pyx_result, __pyx_state)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_8CyOpenGL_HoroballScene), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = NULL;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
    }
  }
  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v___pyx_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcc0e0ec = (Ford, Ford_dark_list_id, Ford_light_list_id, Ford_var, Xangle, Yangle, ball_list_id, cusp_view, cutoff, flipped, horo_var, label_var, labels, labels_list_id, longitude, meridian, nbhd, offset, pgram, pgram_list_id, pgram_var, shifts, tri, tri_dark_list_id, tri_light_list_id, tri_var, which_cusp))" % __pyx_checksum)
 *     __pyx_result = HoroballScene.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_HoroballScene__set_state(<HoroballScene> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = HoroballScene.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_HoroballScene__set_state(<HoroballScene> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_HoroballScene__set_state(HoroballScene __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_3 = __pyx_f_8CyOpenGL___pyx_unpickle_HoroballScene__set_state(((struct __pyx_obj_8CyOpenGL_HoroballScene *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError("Incompatible checksums (%s vs 0xcc0e0ec = (Ford, Ford_dark_list_id, Ford_light_list_id, Ford_var, Xangle, Yangle, ball_list_id, cusp_view, cutoff, flipped, horo_var, label_var, labels, labels_list_id, longitude, meridian, nbhd, offset, pgram, pgram_list_id, pgram_var, shifts, tri, tri_dark_list_id, tri_light_list_id, tri_var, which_cusp))" % __pyx_checksum)
 *     __pyx_result = HoroballScene.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_HoroballScene__set_state(<HoroballScene> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_HoroballScene__set_state(<HoroballScene> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_HoroballScene__set_state(HoroballScene __pyx_result, tuple __pyx_state):
 *     __pyx_result.Ford = __pyx_state[0]; __pyx_result.Ford_dark_list_id = __pyx_state[1]; __pyx_result.Ford_light_list_id = __pyx_state[2]; __pyx_result.Ford_var = __pyx_state[3]; __pyx_result.Xangle = __pyx_state[4]; __pyx_result.Yangle = __pyx_state[5]; __pyx_result.ball_list_id = __pyx_state[6]; __pyx_result.cusp_view = __pyx_state[7]; __pyx_result.cutoff = __pyx_state[8]; __pyx_result.flipped = __pyx_state[9]; __pyx_result.horo_var = __pyx_state[10]; __pyx_result.label_var = __pyx_state[11]; __pyx_result.labels = __pyx_state[12]; __pyx_result.labels_list_id = __pyx_state[13]; __pyx_result.longitude = __pyx_state[14]; __pyx_result.meridian = __pyx_state[15]; __pyx_result.nbhd = __pyx_state[16]; __pyx_result.offset = __pyx_state[17]; __pyx_result.pgram = __pyx_state[18]; __pyx_result.pgram_list_id = __pyx_state[19]; __pyx_result.pgram_var = __pyx_state[20]; __pyx_result.shifts = __pyx_state[21]; __pyx_result.tri = __pyx_state[22]; __pyx_result.tri_dark_list_id = __pyx_state[23]; __pyx_result.tri_light_list_id = __pyx_state[24]; __pyx_result.tri_var = __pyx_state[25]; __pyx_result.which_cusp = __pyx_state[26]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_HoroballScene(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("CyOpenGL.__pyx_unpickle_HoroballScene", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_HoroballScene__set_state(<HoroballScene> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_HoroballScene__set_state(HoroballScene __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.Ford = __pyx_state[0]; __pyx_result.Ford_dark_list_id = __pyx_state[1]; __pyx_result.Ford_light_list_id = __pyx_state[2]; __pyx_result.Ford_var = __pyx_state[3]; __pyx_result.Xangle = __pyx_state[4]; __pyx_result.Yangle = __pyx_state[5]; __pyx_result.ball_list_id = __pyx_state[6]; __pyx_result.cusp_view = __pyx_state[7]; __pyx_result.cutoff = __pyx_state[8]; __pyx_result.flipped = __pyx_state[9]; __pyx_result.horo_var = __pyx_state[10]; __pyx_result.label_var = __pyx_state[11]; __pyx_result.labels = __pyx_state[12]; __pyx_result.labels_list_id = __pyx_state[13]; __pyx_result.longitude = __pyx_state[14]; __pyx_result.meridian = __pyx_state[15]; __pyx_result.nbhd = __pyx_state[16]; __pyx_result.offset = __pyx_state[17]; __pyx_result.pgram = __pyx_state[18]; __pyx_result.pgram_list_id = __pyx_state[19]; __pyx_result.pgram_var = __pyx_state[20]; __pyx_result.shifts = __pyx_state[21]; __pyx_result.tri = __pyx_state[22]; __pyx_result.tri_dark_list_id = __pyx_state[23]; __pyx_result.tri_light_list_id = __pyx_state[24]; __pyx_result.tri_var = __pyx_state[25]; __pyx_result.which_cusp = __pyx_state[26]
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_8CyOpenGL___pyx_unpickle_HoroballScene__set_state(struct __pyx_obj_8CyOpenGL_HoroballScene *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  GLuint __pyx_t_2;
  GLfloat __pyx_t_3;
  double __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  __Pyx_RefNannySetupContext("__pyx_unpickle_HoroballScene__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_HoroballScene__set_state(HoroballScene __pyx_result, tuple __pyx_state):
 *     __pyx_result.Ford = __pyx_state[0]; __pyx_result.Ford_dark_list_id = __pyx_state[1]; __pyx_result.Ford_light_list_id = __pyx_state[2]; __pyx_result.Ford_var = __pyx_state[3]; __pyx_result.Xangle = __pyx_state[4]; __pyx_result.Yangle = __pyx_state[5]; __pyx_result.ball_list_id = __pyx_state[6]; __pyx_result.cusp_view = __pyx_state[7]; __pyx_result.cutoff = __pyx_state[8]; __pyx_result.flipped = __pyx_state[9]; __pyx_result.horo_var = __pyx_state[10]; __pyx_result.label_var = __pyx_state[11]; __pyx_result.labels = __pyx_state[12]; __pyx_result.labels_list_id = __pyx_state[13]; __pyx_result.longitude = __pyx_state[14]; __pyx_result.meridian = __pyx_state[15]; __pyx_result.nbhd = __pyx_state[16]; __pyx_result.offset = __pyx_state[17]; __pyx_result.pgram = __pyx_state[18]; __pyx_result.pgram_list_id = __pyx_state[19]; __pyx_result.pgram_var = __pyx_state[20]; __pyx_result.shifts = __pyx_state[21]; __pyx_result.tri = __pyx_state[22]; __pyx_result.tri_dark_list_id = __pyx_state[23]; __pyx_result.tri_light_list_id = __pyx_state[24]; __pyx_result.tri_var = __pyx_state[25]; __pyx_result.which_cusp = __pyx_state[26]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[27])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->Ford);
  __Pyx_DECREF(__pyx_v___pyx_result->Ford);
  __pyx_v___pyx_result->Ford = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->Ford_dark_list_id = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->Ford_light_list_id = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->Ford_var);
  __Pyx_DECREF(__pyx_v___pyx_result->Ford_var);
  __pyx_v___pyx_result->Ford_var = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->Xangle = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __pyx_PyFloat_AsFloat(__pyx_t_1); if (unlikely((__pyx_t_3 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->Yangle = __pyx_t_3;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->ball_list_id = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->cusp_view);
  __Pyx_DECREF(__pyx_v___pyx_result->cusp_view);
  __pyx_v___pyx_result->cusp_view = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->cutoff = __pyx_t_4;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->flipped);
  __Pyx_DECREF(__pyx_v___pyx_result->flipped);
  __pyx_v___pyx_result->flipped = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->horo_var);
  __Pyx_DECREF(__pyx_v___pyx_result->horo_var);
  __pyx_v___pyx_result->horo_var = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->label_var);
  __Pyx_DECREF(__pyx_v___pyx_result->label_var);
  __pyx_v___pyx_result->label_var = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->labels);
  __Pyx_DECREF(__pyx_v___pyx_result->labels);
  __pyx_v___pyx_result->labels = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->labels_list_id = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->longitude);
  __Pyx_DECREF(__pyx_v___pyx_result->longitude);
  __pyx_v___pyx_result->longitude = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->meridian);
  __Pyx_DECREF(__pyx_v___pyx_result->meridian);
  __pyx_v___pyx_result->meridian = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->nbhd);
  __Pyx_DECREF(__pyx_v___pyx_result->nbhd);
  __pyx_v___pyx_result->nbhd = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->offset);
  __Pyx_DECREF(__pyx_v___pyx_result->offset);
  __pyx_v___pyx_result->offset = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->pgram);
  __Pyx_DECREF(__pyx_v___pyx_result->pgram);
  __pyx_v___pyx_result->pgram = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->pgram_list_id = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->pgram_var);
  __Pyx_DECREF(__pyx_v___pyx_result->pgram_var);
  __pyx_v___pyx_result->pgram_var = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->shifts);
  __Pyx_DECREF(__pyx_v___pyx_result->shifts);
  __pyx_v___pyx_result->shifts = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->tri);
  __Pyx_DECREF(__pyx_v___pyx_result->tri);
  __pyx_v___pyx_result->tri = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->tri_dark_list_id = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_GLuint(__pyx_t_1); if (unlikely((__pyx_t_2 == ((GLuint)-1)) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->tri_light_list_id = __pyx_t_2;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 25, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v___pyx_result->tri_var);
  __Pyx_DECREF(__pyx_v___pyx_result->tri_var);
  __pyx_v___pyx_result->tri_var = __pyx_t_1;
  __pyx_t_1 = 0;
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 26, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->which_cusp = __pyx_t_5;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_HoroballScene__set_state(HoroballScene __pyx_result, tuple __pyx_state):
 *     __pyx_result.Ford = __pyx_state[0]; __pyx_result.Ford_dark_list_id = __pyx_state[1]; __pyx_result.Ford_light_list_id = __pyx_state[2]; __pyx_result.Ford_var = __pyx_state[3]; __pyx_result.Xangle = __pyx_state[4]; __pyx_result.Yangle = __pyx_state[5]; __pyx_result.ball_list_id = __pyx_state[6]; __pyx_result.cusp_view = __pyx_state[7]; __pyx_result.cutoff = __pyx_state[8]; __pyx_result.flipped = __pyx_state[9]; __pyx_result.horo_var = __pyx_state[10]; __pyx_result.label_var = __pyx_state[11]; __pyx_result.labels = __pyx_state[12]; __pyx_result.labels_list_id = __pyx_state[13]; __pyx_result.longitude = __pyx_state[14]; __pyx_result.meridian = __pyx_state[15]; __pyx_result.nbhd = __pyx_state[16]; __pyx_result.offset = __pyx_state[17]; __pyx_result.pgram = __pyx_state[18]; __pyx_result.pgram_list_id = __pyx_state[19]; __pyx_result.pgram_var = __pyx_state[20]; __pyx_result.shifts = __pyx_state[21]; __pyx_result.tri = __pyx_state[22]; __pyx_result.tri_dark_list_id = __pyx_state[23]; __pyx_result.tri_light_list_id = __pyx_state[24]; __pyx_result.tri_var = __pyx_state[25]; __pyx_result.which_cusp = __pyx_state[26]
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[27])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_7 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_7 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_8 = ((__pyx_t_7 > 27) != 0);
  if (__pyx_t_8) {
  } else {
    __pyx_t_6 = __pyx_t_8;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_8 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_8 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_9 = (__pyx_t_8 != 0);
  __pyx_t_6 = __pyx_t_9;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_6) {

    /* "(tree fragment)":14
 *     __pyx_result.Ford = __pyx_state[0]; __pyx_result.Ford_dark_list_id = __pyx_state[1]; __pyx_result.Ford_light_list_id = __pyx_state[2]; __pyx_result.Ford_var = __pyx_state[3]; __pyx_result.Xangle = __pyx_state[4]; __pyx_result.Yangle = __pyx_state[5]; __pyx_result.ball_list_id = __pyx_state[6]; __pyx_result.cusp_view = __pyx_state[7]; __pyx_result.cutoff = __pyx_state[8]; __pyx_result.flipped = __pyx_state[9]; __pyx_result.horo_var = __pyx_state[10]; __pyx_result.label_var = __pyx_state[11]; __pyx_result.labels = __pyx_state[12]; __pyx_result.labels_list_id = __pyx_state[13]; __pyx_result.longitude = __pyx_state[14]; __pyx_result.meridian = __pyx_state[15]; __pyx_result.nbhd = __pyx_state[16]; __pyx_result.offset = __pyx_state[17]; __pyx_result.pgram = __pyx_state[18]; __pyx_result.pgram_list_id = __pyx_state[19]; __pyx_result.pgram_var = __pyx_state[20]; __pyx_result.shifts = __pyx_state[21]; __pyx_result.tri = __pyx_state[22]; __pyx_result.tri_dark_list_id = __pyx_state[23]; __pyx_result.tri_light_list_id = __pyx_state[24]; __pyx_result.tri_var = __pyx_state[25]; __pyx_result.which_cusp = __pyx_state[26]
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[27])             # <<<<<<<<<<<<<<
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_GetAttrStr(__pyx_t_10, __pyx_n_s_update); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_10 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 27, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_12 = NULL;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_11))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_11);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_11);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_11, function);
      }
    }
    __pyx_t_1 = (__pyx_t_12) ? __Pyx_PyObject_Call2Args(__pyx_t_11, __pyx_t_12, __pyx_t_10) : __Pyx_PyObject_CallOneArg(__pyx_t_11, __pyx_t_10);
    __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_HoroballScene__set_state(HoroballScene __pyx_result, tuple __pyx_state):
 *     __pyx_result.Ford = __pyx_state[0]; __pyx_result.Ford_dark_list_id = __pyx_state[1]; __pyx_result.Ford_light_list_id = __pyx_state[2]; __pyx_result.Ford_var = __pyx_state[3]; __pyx_result.Xangle = __pyx_state[4]; __pyx_result.Yangle = __pyx_state[5]; __pyx_result.ball_list_id = __pyx_state[6]; __pyx_result.cusp_view = __pyx_state[7]; __pyx_result.cutoff = __pyx_state[8]; __pyx_result.flipped = __pyx_state[9]; __pyx_result.horo_var = __pyx_state[10]; __pyx_result.label_var = __pyx_state[11]; __pyx_result.labels = __pyx_state[12]; __pyx_result.labels_list_id = __pyx_state[13]; __pyx_result.longitude = __pyx_state[14]; __pyx_result.meridian = __pyx_state[15]; __pyx_result.nbhd = __pyx_state[16]; __pyx_result.offset = __pyx_state[17]; __pyx_result.pgram = __pyx_state[18]; __pyx_result.pgram_list_id = __pyx_state[19]; __pyx_result.pgram_var = __pyx_state[20]; __pyx_result.shifts = __pyx_state[21]; __pyx_result.tri = __pyx_state[22]; __pyx_result.tri_dark_list_id = __pyx_state[23]; __pyx_result.tri_light_list_id = __pyx_state[24]; __pyx_result.tri_var = __pyx_state[25]; __pyx_result.which_cusp = __pyx_state[26]
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[27])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_HoroballScene__set_state(<HoroballScene> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_HoroballScene__set_state(HoroballScene __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.Ford = __pyx_state[0]; __pyx_result.Ford_dark_list_id = __pyx_state[1]; __pyx_result.Ford_light_list_id = __pyx_state[2]; __pyx_result.Ford_var = __pyx_state[3]; __pyx_result.Xangle = __pyx_state[4]; __pyx_result.Yangle = __pyx_state[5]; __pyx_result.ball_list_id = __pyx_state[6]; __pyx_result.cusp_view = __pyx_state[7]; __pyx_result.cutoff = __pyx_state[8]; __pyx_result.flipped = __pyx_state[9]; __pyx_result.horo_var = __pyx_state[10]; __pyx_result.label_var = __pyx_state[11]; __pyx_result.labels = __pyx_state[12]; __pyx_result.labels_list_id = __pyx_state[13]; __pyx_result.longitude = __pyx_state[14]; __pyx_result.meridian = __pyx_state[15]; __pyx_result.nbhd = __pyx_state[16]; __pyx_result.offset = __pyx_state[17]; __pyx_result.pgram = __pyx_state[18]; __pyx_result.pgram_list_id = __pyx_state[19]; __pyx_result.pgram_var = __pyx_state[20]; __pyx_result.shifts = __pyx_state[21]; __pyx_result.tri = __pyx_state[22]; __pyx_result.tri_dark_list_id = __pyx_state[23]; __pyx_result.tri_light_list_id = __pyx_state[24]; __pyx_result.tri_var = __pyx_state[25]; __pyx_result.which_cusp = __pyx_state[26]
 *     if len(__pyx_state) > 27 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("CyOpenGL.__pyx_unpickle_HoroballScene__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":112
 * 
 * @cname("__Pyx_carray_to_py_GLfloat")
 * cdef inline list __Pyx_carray_to_py_GLfloat(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_py_GLfloat(GLfloat *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_GLfloat", 0);

  /* "carray.to_py":115
 *     cdef size_t i
 *     cdef object value
 *     l = PyList_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":116
 *     cdef object value
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":117
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 */
    __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":118
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(l, i, value)
 *     return l
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":119
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
 *     return l
 * 
 */
    PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":120
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "carray.to_py":112
 * 
 * @cname("__Pyx_carray_to_py_GLfloat")
 * cdef inline list __Pyx_carray_to_py_GLfloat(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_GLfloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":124
 * 
 * @cname("__Pyx_carray_to_tuple_GLfloat")
 * cdef inline tuple __Pyx_carray_to_tuple_GLfloat(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_GLfloat(GLfloat *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_GLfloat", 0);

  /* "carray.to_py":127
 *     cdef size_t i
 *     cdef object value
 *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 127, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_t = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":128
 *     cdef object value
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":129
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 */
    __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":130
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":131
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 *     return t
 */
    PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":132
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  /* "carray.to_py":124
 * 
 * @cname("__Pyx_carray_to_tuple_GLfloat")
 * cdef inline tuple __Pyx_carray_to_tuple_GLfloat(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_GLfloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.from_py":77
 * 
 * @cname("__Pyx_carray_from_py_GLfloat")
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

static int __Pyx_carray_from_py_GLfloat(PyObject *__pyx_v_o, GLfloat *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  GLfloat __pyx_t_11;
  char const *__pyx_t_12;
  __Pyx_RefNannySetupContext("__Pyx_carray_from_py_GLfloat", 0);

  /* "carray.from_py":78
 * @cname("__Pyx_carray_from_py_GLfloat")
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length             # <<<<<<<<<<<<<<
 *     try:
 *         i = len(o)
 */
  __pyx_v_i = __pyx_v_length;

  /* "carray.from_py":79
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "carray.from_py":80
 *     cdef Py_ssize_t i = length
 *     try:
 *         i = len(o)             # <<<<<<<<<<<<<<
 *     except (TypeError, OverflowError):
 *         pass
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 80, __pyx_L3_error)
      __pyx_v_i = __pyx_t_4;

      /* "carray.from_py":79
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "carray.from_py":81
 *     try:
 *         i = len(o)
 *     except (TypeError, OverflowError):             # <<<<<<<<<<<<<<
 *         pass
 *     if i == length:
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError) || __Pyx_PyErr_ExceptionMatches(__pyx_builtin_OverflowError);
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "carray.from_py":79
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "carray.from_py":83
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
  if (__pyx_t_6) {

    /* "carray.from_py":84
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
      __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 84, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 84, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 84, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 84, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(1, 84, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 84, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 84, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = (__pyx_t_4 + 1);

      /* "carray.from_py":85
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":86
 *         for i, item in enumerate(o):
 *             if i >= length:
 *                 break             # <<<<<<<<<<<<<<
 *             v[i] = item
 *         else:
 */
        goto __pyx_L11_break;

        /* "carray.from_py":85
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      }

      /* "carray.from_py":87
 *             if i >= length:
 *                 break
 *             v[i] = item             # <<<<<<<<<<<<<<
 *         else:
 *             i += 1  # convert index to length
 */
      __pyx_t_11 = __pyx_PyFloat_AsFloat(__pyx_v_item); if (unlikely((__pyx_t_11 == ((GLfloat)-1)) && PyErr_Occurred())) __PYX_ERR(1, 87, __pyx_L1_error)
      (__pyx_v_v[__pyx_v_i]) = __pyx_t_11;

      /* "carray.from_py":84
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    }
    /*else*/ {

      /* "carray.from_py":89
 *             v[i] = item
 *         else:
 *             i += 1  # convert index to length             # <<<<<<<<<<<<<<
 *             if i == length:
 *                 return 0
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "carray.from_py":90
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":91
 *             i += 1  # convert index to length
 *             if i == length:
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *     PyErr_Format(
 */
        __pyx_r = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "carray.from_py":90
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      }
    }

    /* "carray.from_py":84
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_L11_break:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "carray.from_py":83
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  }

  /* "carray.from_py":96
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 *          if i >= length else             # <<<<<<<<<<<<<<
 *          "not enough values found during array assignment, expected %zd, got %zd"),
 *         length, i)
 */
  if (((__pyx_v_i >= __pyx_v_length) != 0)) {
    __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd");
  } else {
    __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd");
  }

  /* "carray.from_py":93
 *                 return 0
 * 
 *     PyErr_Format(             # <<<<<<<<<<<<<<
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 */
  __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "carray.from_py":77
 * 
 * @cname("__Pyx_carray_from_py_GLfloat")
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_GLfloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_8CyOpenGL_vector3(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_8CyOpenGL_7vector3_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8CyOpenGL_vector3(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_8CyOpenGL_7vector3_x(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_7vector3_1x_1__get__(o);
}

static PyObject *__pyx_getprop_8CyOpenGL_7vector3_y(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_7vector3_1y_1__get__(o);
}

static PyObject *__pyx_getprop_8CyOpenGL_7vector3_z(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_7vector3_1z_1__get__(o);
}

static PyObject *__pyx_getprop_8CyOpenGL_7vector3_norm_squared(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_7vector3_12norm_squared_1__get__(o);
}

static PyObject *__pyx_getprop_8CyOpenGL_7vector3_norm(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_8CyOpenGL_7vector3_4norm_1__get__(o);
}

static PyMethodDef __pyx_methods_8CyOpenGL_vector3[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_7vector3_15__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_7vector3_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_7vector3_17__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_7vector3_16__setstate_cython__},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_8CyOpenGL_vector3[] = {
  {(char *)"x", __pyx_getprop_8CyOpenGL_7vector3_x, 0, (char *)0, 0},
  {(char *)"y", __pyx_getprop_8CyOpenGL_7vector3_y, 0, (char *)0, 0},
  {(char *)"z", __pyx_getprop_8CyOpenGL_7vector3_z, 0, (char *)0, 0},
  {(char *)"norm_squared", __pyx_getprop_8CyOpenGL_7vector3_norm_squared, 0, (char *)0, 0},
  {(char *)"norm", __pyx_getprop_8CyOpenGL_7vector3_norm, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_vector3 = {
  __pyx_pw_8CyOpenGL_7vector3_5__add__, /*nb_add*/
  __pyx_pw_8CyOpenGL_7vector3_7__sub__, /*nb_subtract*/
  __pyx_pw_8CyOpenGL_7vector3_9__mul__, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  __pyx_pw_8CyOpenGL_7vector3_11__div__, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_long*/
  #else
  0, /*reserved*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3 || (CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x03050000)
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  __pyx_pw_8CyOpenGL_7vector3_13__truediv__, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  0, /*nb_index*/
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_matrix_multiply*/
  #endif
  #if PY_VERSION_HEX >= 0x03050000
  0, /*nb_inplace_matrix_multiply*/
  #endif
};

static PyTypeObject __pyx_type_8CyOpenGL_vector3 = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.vector3", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_vector3), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_vector3, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  __pyx_pw_8CyOpenGL_7vector3_3__repr__, /*tp_repr*/
  &__pyx_tp_as_number_vector3, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    A simple real 3-dimensional vector which supports addition,\n    subtraction and right multiplication or division by scalars.\n    Attributes include its norm and the square of its norm.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_vector3, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_8CyOpenGL_vector3, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_vector3, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static PyObject *__pyx_tp_new_8CyOpenGL_GL_context(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  if (unlikely(__pyx_pw_8CyOpenGL_10GL_context_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8CyOpenGL_GL_context(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_8CyOpenGL_GL_context[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_10GL_context_3__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_10GL_context_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_10GL_context_5__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_10GL_context_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_GL_context = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.GL_context", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_GL_context), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_GL_context, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Sets up our default OpenGL environment.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_GL_context, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_GL_context, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_GLobject __pyx_vtable_8CyOpenGL_GLobject;

static PyObject *__pyx_tp_new_8CyOpenGL_GLobject(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_GLobject *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_GLobject *)o);
  p->__pyx_vtab = __pyx_vtabptr_8CyOpenGL_GLobject;
  if (unlikely(__pyx_pw_8CyOpenGL_8GLobject_1__cinit__(o, a, k) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8CyOpenGL_GLobject(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_8CyOpenGL_GLobject[] = {
  {"draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_8GLobject_3draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8GLobject_2draw},
  {"build_display_list", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_8GLobject_5build_display_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_8GLobject_4build_display_list},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_8GLobject_7__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_8GLobject_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_8GLobject_9__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_8GLobject_8__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_GLobject = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.GLobject", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_GLobject), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_GLobject, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Base class for the objects in our OpenGL scene.  Think of a\n    GLobject as a helper who knows how to draw a certain type of\n    geometrical object with specific color and material characteristics.\n    The geometrical characteristics, e.g. radius or vertex locations,\n    should be passed as arguments to the object's draw method.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_GLobject, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_GLobject, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_WireframeSphere __pyx_vtable_8CyOpenGL_WireframeSphere;

static PyObject *__pyx_tp_new_8CyOpenGL_WireframeSphere(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_WireframeSphere *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_WireframeSphere *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_WireframeSphere;
  return o;
}

static PyMethodDef __pyx_methods_8CyOpenGL_WireframeSphere[] = {
  {"draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_15WireframeSphere_1draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_15WireframeSphere_draw},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_15WireframeSphere_3__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_15WireframeSphere_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_15WireframeSphere_5__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_15WireframeSphere_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_WireframeSphere = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.WireframeSphere", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_WireframeSphere), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_GLobject, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Draw a wireframe sphere.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_WireframeSphere, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_WireframeSphere, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_MeshedSurface __pyx_vtable_8CyOpenGL_MeshedSurface;

static PyObject *__pyx_tp_new_8CyOpenGL_MeshedSurface(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_MeshedSurface *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_MeshedSurface *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_MeshedSurface;
  p->vertices = Py_None; Py_INCREF(Py_None);
  p->normals = Py_None; Py_INCREF(Py_None);
  p->triangles = Py_None; Py_INCREF(Py_None);
  p->count = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_MeshedSurface(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_MeshedSurface *p = (struct __pyx_obj_8CyOpenGL_MeshedSurface *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pw_8CyOpenGL_13MeshedSurface_1__dealloc__(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_CLEAR(p->vertices);
  Py_CLEAR(p->normals);
  Py_CLEAR(p->triangles);
  Py_CLEAR(p->count);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_GLobject(o);
}

static int __pyx_tp_traverse_8CyOpenGL_MeshedSurface(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_MeshedSurface *p = (struct __pyx_obj_8CyOpenGL_MeshedSurface *)o;
  e = ((likely(__pyx_ptype_8CyOpenGL_GLobject)) ? ((__pyx_ptype_8CyOpenGL_GLobject->tp_traverse) ? __pyx_ptype_8CyOpenGL_GLobject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_8CyOpenGL_MeshedSurface)); if (e) return e;
  if (p->vertices) {
    e = (*v)(p->vertices, a); if (e) return e;
  }
  if (p->normals) {
    e = (*v)(p->normals, a); if (e) return e;
  }
  if (p->triangles) {
    e = (*v)(p->triangles, a); if (e) return e;
  }
  if (p->count) {
    e = (*v)(p->count, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_MeshedSurface(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_MeshedSurface *p = (struct __pyx_obj_8CyOpenGL_MeshedSurface *)o;
  if (likely(__pyx_ptype_8CyOpenGL_GLobject)) { if (__pyx_ptype_8CyOpenGL_GLobject->tp_clear) __pyx_ptype_8CyOpenGL_GLobject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_8CyOpenGL_MeshedSurface);
  tmp = ((PyObject*)p->vertices);
  p->vertices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->normals);
  p->normals = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->triangles);
  p->triangles = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->count);
  p->count = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_MeshedSurface[] = {
  {"draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_13MeshedSurface_3draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13MeshedSurface_2draw},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_13MeshedSurface_5__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_13MeshedSurface_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_13MeshedSurface_7__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_13MeshedSurface_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_MeshedSurface = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.MeshedSurface", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_MeshedSurface), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_MeshedSurface, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  " \n    An object made out of a triangular mesh. See the subclass\n    Horosphere below for a typical example.\n    ", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_MeshedSurface, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_MeshedSurface, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_MeshedSurface, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_MeshedSurface, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_PoincareTriangle __pyx_vtable_8CyOpenGL_PoincareTriangle;

static PyObject *__pyx_tp_new_8CyOpenGL_PoincareTriangle(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_PoincareTriangle *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_MeshedSurface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_PoincareTriangle *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_PoincareTriangle;
  p->center = Py_None; Py_INCREF(Py_None);
  p->mesh = Py_None; Py_INCREF(Py_None);
  p->original_vertices = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_PoincareTriangle(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_PoincareTriangle *p = (struct __pyx_obj_8CyOpenGL_PoincareTriangle *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->center);
  Py_CLEAR(p->mesh);
  Py_CLEAR(p->original_vertices);
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_MeshedSurface(o);
}

static int __pyx_tp_traverse_8CyOpenGL_PoincareTriangle(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_PoincareTriangle *p = (struct __pyx_obj_8CyOpenGL_PoincareTriangle *)o;
  e = __pyx_tp_traverse_8CyOpenGL_MeshedSurface(o, v, a); if (e) return e;
  if (p->center) {
    e = (*v)(p->center, a); if (e) return e;
  }
  if (p->mesh) {
    e = (*v)(p->mesh, a); if (e) return e;
  }
  if (p->original_vertices) {
    e = (*v)(p->original_vertices, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_PoincareTriangle(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_PoincareTriangle *p = (struct __pyx_obj_8CyOpenGL_PoincareTriangle *)o;
  __pyx_tp_clear_8CyOpenGL_MeshedSurface(o);
  tmp = ((PyObject*)p->center);
  p->center = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->mesh);
  p->mesh = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->original_vertices);
  p->original_vertices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_PoincareTriangle[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_16PoincareTriangle_3__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_16PoincareTriangle_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_16PoincareTriangle_5__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_16PoincareTriangle_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_PoincareTriangle = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.PoincareTriangle", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_PoincareTriangle), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_PoincareTriangle, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "PoincareTriangle(vertices, center, subdivision_depth=4, **kwargs)\n\n    Draws a geodesic triangle in the Poincare model.  The geometric\n    parameters are the vertex coordinates in the Klein model plus the\n    coordinates of the center of the sphere which represents the plane\n    of the triangle in the Poincare model.  The Poincare vertices are\n    constructed by projecting the Klein vertices onto the sphere from\n    the center.\n\n    The triangle is drawn as a mesh, using vertex and index arrays.\n    ", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_PoincareTriangle, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_PoincareTriangle, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_PoincareTriangle, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8CyOpenGL_16PoincareTriangle_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_PoincareTriangle, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_PoincarePolygon __pyx_vtable_8CyOpenGL_PoincarePolygon;

static PyObject *__pyx_tp_new_8CyOpenGL_PoincarePolygon(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_PoincarePolygon *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_PoincarePolygon *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_PoincarePolygon;
  p->vertices = Py_None; Py_INCREF(Py_None);
  p->center = Py_None; Py_INCREF(Py_None);
  p->triangles = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_PoincarePolygon(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_PoincarePolygon *p = (struct __pyx_obj_8CyOpenGL_PoincarePolygon *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->vertices);
  Py_CLEAR(p->center);
  Py_CLEAR(p->triangles);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_GLobject(o);
}

static int __pyx_tp_traverse_8CyOpenGL_PoincarePolygon(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_PoincarePolygon *p = (struct __pyx_obj_8CyOpenGL_PoincarePolygon *)o;
  e = ((likely(__pyx_ptype_8CyOpenGL_GLobject)) ? ((__pyx_ptype_8CyOpenGL_GLobject->tp_traverse) ? __pyx_ptype_8CyOpenGL_GLobject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_8CyOpenGL_PoincarePolygon)); if (e) return e;
  if (p->vertices) {
    e = (*v)(p->vertices, a); if (e) return e;
  }
  if (p->center) {
    e = (*v)(p->center, a); if (e) return e;
  }
  if (p->triangles) {
    e = (*v)(p->triangles, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_PoincarePolygon(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_PoincarePolygon *p = (struct __pyx_obj_8CyOpenGL_PoincarePolygon *)o;
  if (likely(__pyx_ptype_8CyOpenGL_GLobject)) { if (__pyx_ptype_8CyOpenGL_GLobject->tp_clear) __pyx_ptype_8CyOpenGL_GLobject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_8CyOpenGL_PoincarePolygon);
  tmp = ((PyObject*)p->vertices);
  p->vertices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->center);
  p->center = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->triangles);
  p->triangles = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_PoincarePolygon[] = {
  {"draw", (PyCFunction)__pyx_pw_8CyOpenGL_15PoincarePolygon_3draw, METH_NOARGS, __pyx_doc_8CyOpenGL_15PoincarePolygon_2draw},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_15PoincarePolygon_5__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_15PoincarePolygon_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_15PoincarePolygon_7__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_15PoincarePolygon_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_PoincarePolygon = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.PoincarePolygon", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_PoincarePolygon), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_PoincarePolygon, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "PoincarePolygon(vertices, center, **kwargs)\n\n    Draws a geodesic polygon in the Poincare model. The geometric\n    parameters are the vertex coordinates in the Klein model plus the\n    coordinates of the center of the sphere which represents the plane\n    of the triangle in the Poincare model.  The polygon is drawn by\n    subdividing into Poincare Triangles by coning from the barycenter,\n    then drawing each triangle.\n    ", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_PoincarePolygon, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_PoincarePolygon, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_PoincarePolygon, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8CyOpenGL_15PoincarePolygon_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_PoincarePolygon, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_KleinPolygon __pyx_vtable_8CyOpenGL_KleinPolygon;

static PyObject *__pyx_tp_new_8CyOpenGL_KleinPolygon(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_KleinPolygon *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_KleinPolygon *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_KleinPolygon;
  p->vertices = Py_None; Py_INCREF(Py_None);
  p->closest = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_KleinPolygon(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_KleinPolygon *p = (struct __pyx_obj_8CyOpenGL_KleinPolygon *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->vertices);
  Py_CLEAR(p->closest);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_GLobject(o);
}

static int __pyx_tp_traverse_8CyOpenGL_KleinPolygon(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_KleinPolygon *p = (struct __pyx_obj_8CyOpenGL_KleinPolygon *)o;
  e = ((likely(__pyx_ptype_8CyOpenGL_GLobject)) ? ((__pyx_ptype_8CyOpenGL_GLobject->tp_traverse) ? __pyx_ptype_8CyOpenGL_GLobject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_8CyOpenGL_KleinPolygon)); if (e) return e;
  if (p->vertices) {
    e = (*v)(p->vertices, a); if (e) return e;
  }
  if (p->closest) {
    e = (*v)(p->closest, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_KleinPolygon(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_KleinPolygon *p = (struct __pyx_obj_8CyOpenGL_KleinPolygon *)o;
  if (likely(__pyx_ptype_8CyOpenGL_GLobject)) { if (__pyx_ptype_8CyOpenGL_GLobject->tp_clear) __pyx_ptype_8CyOpenGL_GLobject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_8CyOpenGL_KleinPolygon);
  tmp = ((PyObject*)p->vertices);
  p->vertices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->closest);
  p->closest = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_KleinPolygon[] = {
  {"draw", (PyCFunction)__pyx_pw_8CyOpenGL_12KleinPolygon_3draw, METH_NOARGS, __pyx_doc_8CyOpenGL_12KleinPolygon_2draw},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_12KleinPolygon_5__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_12KleinPolygon_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_12KleinPolygon_7__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_12KleinPolygon_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_KleinPolygon = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.KleinPolygon", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_KleinPolygon), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_KleinPolygon, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "KleinPolygon(vertices, closest, **kwargs)\n\n    Draws a geodesic polygon in the Klein model. The geometric\n    parameters are the vertex coordinates in the Klein model plus the\n    coordinates of the nearest point to origin which lies on the plane\n    containing the polygon.  The polygon is drawn as an OpenGL\n    Polygon.\n    ", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_KleinPolygon, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_KleinPolygon, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_KleinPolygon, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8CyOpenGL_12KleinPolygon_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_KleinPolygon, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_Colorizer __pyx_vtable_8CyOpenGL_Colorizer;

static PyObject *__pyx_tp_new_8CyOpenGL_Colorizer(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8CyOpenGL_Colorizer *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_Colorizer *)o);
  p->__pyx_vtab = __pyx_vtabptr_8CyOpenGL_Colorizer;
  if (unlikely(__pyx_pw_8CyOpenGL_9Colorizer_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
  return o;
  bad:
  Py_DECREF(o); o = 0;
  return NULL;
}

static void __pyx_tp_dealloc_8CyOpenGL_Colorizer(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}

static PyMethodDef __pyx_methods_8CyOpenGL_Colorizer[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_9Colorizer_7__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_9Colorizer_6__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_9Colorizer_9__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_9Colorizer_8__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_Colorizer = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.Colorizer", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_Colorizer), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_Colorizer, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  __pyx_pw_8CyOpenGL_9Colorizer_5__call__, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "Colorizer(lightness=0.6, saturation=0.9, alpha=0.8)\n\n    Callable class which returns a color when passed an index.\n    Uses the same algorithm as the SnapPea kernel.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_Colorizer, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8CyOpenGL_9Colorizer_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_Colorizer, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_Horosphere __pyx_vtable_8CyOpenGL_Horosphere;

static PyObject *__pyx_tp_new_8CyOpenGL_Horosphere(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_Horosphere *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_MeshedSurface(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_Horosphere *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_Horosphere;
  return o;
}

static PyMethodDef __pyx_methods_8CyOpenGL_Horosphere[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_10Horosphere_3__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_10Horosphere_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_10Horosphere_5__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_10Horosphere_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_Horosphere = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.Horosphere", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_Horosphere), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_MeshedSurface, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Horosphere(color=[0.8, 0.0, 0.0, 0.3], radius=1.0, front_specular=[0.8, 0.8, 0.8, 1.0], back_specular=[0.8, 0.8, 0.8, 1.0], front_shininess=50.0, back_shininess=0.0)\n\n    Draw a horosphere.\n    ", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_MeshedSurface, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_MeshedSurface, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_Horosphere, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8CyOpenGL_10Horosphere_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_Horosphere, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_HoroballGroup __pyx_vtable_8CyOpenGL_HoroballGroup;

static PyObject *__pyx_tp_new_8CyOpenGL_HoroballGroup(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8CyOpenGL_HoroballGroup *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_HoroballGroup *)o);
  p->__pyx_vtab = __pyx_vtabptr_8CyOpenGL_HoroballGroup;
  p->horoballs = Py_None; Py_INCREF(Py_None);
  p->meridian = Py_None; Py_INCREF(Py_None);
  p->longitude = Py_None; Py_INCREF(Py_None);
  p->keys = Py_None; Py_INCREF(Py_None);
  p->centers = Py_None; Py_INCREF(Py_None);
  p->spheres = Py_None; Py_INCREF(Py_None);
  p->list_ids = Py_None; Py_INCREF(Py_None);
  p->original_indices = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_HoroballGroup(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_HoroballGroup *p = (struct __pyx_obj_8CyOpenGL_HoroballGroup *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->horoballs);
  Py_CLEAR(p->meridian);
  Py_CLEAR(p->longitude);
  Py_CLEAR(p->keys);
  Py_CLEAR(p->centers);
  Py_CLEAR(p->spheres);
  Py_CLEAR(p->list_ids);
  Py_CLEAR(p->original_indices);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8CyOpenGL_HoroballGroup(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_HoroballGroup *p = (struct __pyx_obj_8CyOpenGL_HoroballGroup *)o;
  if (p->horoballs) {
    e = (*v)(p->horoballs, a); if (e) return e;
  }
  if (p->meridian) {
    e = (*v)(p->meridian, a); if (e) return e;
  }
  if (p->longitude) {
    e = (*v)(p->longitude, a); if (e) return e;
  }
  if (p->keys) {
    e = (*v)(p->keys, a); if (e) return e;
  }
  if (p->centers) {
    e = (*v)(p->centers, a); if (e) return e;
  }
  if (p->spheres) {
    e = (*v)(p->spheres, a); if (e) return e;
  }
  if (p->list_ids) {
    e = (*v)(p->list_ids, a); if (e) return e;
  }
  if (p->original_indices) {
    e = (*v)(p->original_indices, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_HoroballGroup(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_HoroballGroup *p = (struct __pyx_obj_8CyOpenGL_HoroballGroup *)o;
  tmp = ((PyObject*)p->horoballs);
  p->horoballs = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->meridian);
  p->meridian = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->longitude);
  p->longitude = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->keys);
  p->keys = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->centers);
  p->centers = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->spheres);
  p->spheres = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->list_ids);
  p->list_ids = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->original_indices);
  p->original_indices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_HoroballGroup[] = {
  {"delete_lists", (PyCFunction)__pyx_pw_8CyOpenGL_13HoroballGroup_3delete_lists, METH_NOARGS, __pyx_doc_8CyOpenGL_13HoroballGroup_2delete_lists},
  {"draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_13HoroballGroup_5draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballGroup_4draw},
  {"build_display_list", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_13HoroballGroup_7build_display_list, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballGroup_6build_display_list},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_13HoroballGroup_9__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_13HoroballGroup_8__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_13HoroballGroup_11__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_13HoroballGroup_10__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_HoroballGroup = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.HoroballGroup", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_HoroballGroup), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_HoroballGroup, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "HoroballGroup(horoballs, indices, meridian, longitude)\n\n    A fundamental set of horoballs for a single cusp.  The paremeters\n    R and T for the draw method are the coordinates of the right top\n    corner of the visible rectangle with margins.  For each horoball,\n    all meridian and longitude translations centered in the rectangle\n    are drawn.\n    ", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_HoroballGroup, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_HoroballGroup, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_HoroballGroup, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8CyOpenGL_13HoroballGroup_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_HoroballGroup, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_Parallelogram __pyx_vtable_8CyOpenGL_Parallelogram;

static PyObject *__pyx_tp_new_8CyOpenGL_Parallelogram(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_Parallelogram *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_Parallelogram *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_Parallelogram;
  return o;
}

static PyMethodDef __pyx_methods_8CyOpenGL_Parallelogram[] = {
  {"draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_13Parallelogram_1draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13Parallelogram_draw},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_13Parallelogram_3__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_13Parallelogram_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_13Parallelogram_5__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_13Parallelogram_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_Parallelogram = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.Parallelogram", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_Parallelogram), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_GLobject, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  "\n    Draws a parallelogram on the xy-plane centered at (0,0). The geometric\n    parameters are complex numbers corresponding to the two side vectors.\n    ", /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_Parallelogram, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_Parallelogram, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_EdgeSet __pyx_vtable_8CyOpenGL_EdgeSet;

static PyObject *__pyx_tp_new_8CyOpenGL_EdgeSet(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_EdgeSet *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_EdgeSet *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_EdgeSet;
  p->segments = Py_None; Py_INCREF(Py_None);
  p->longitude = Py_None; Py_INCREF(Py_None);
  p->meridian = Py_None; Py_INCREF(Py_None);
  p->stipple = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_EdgeSet(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_EdgeSet *p = (struct __pyx_obj_8CyOpenGL_EdgeSet *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->segments);
  Py_CLEAR(p->longitude);
  Py_CLEAR(p->meridian);
  Py_CLEAR(p->stipple);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_GLobject(o);
}

static int __pyx_tp_traverse_8CyOpenGL_EdgeSet(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_EdgeSet *p = (struct __pyx_obj_8CyOpenGL_EdgeSet *)o;
  e = ((likely(__pyx_ptype_8CyOpenGL_GLobject)) ? ((__pyx_ptype_8CyOpenGL_GLobject->tp_traverse) ? __pyx_ptype_8CyOpenGL_GLobject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_8CyOpenGL_EdgeSet)); if (e) return e;
  if (p->segments) {
    e = (*v)(p->segments, a); if (e) return e;
  }
  if (p->longitude) {
    e = (*v)(p->longitude, a); if (e) return e;
  }
  if (p->meridian) {
    e = (*v)(p->meridian, a); if (e) return e;
  }
  if (p->stipple) {
    e = (*v)(p->stipple, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_EdgeSet(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_EdgeSet *p = (struct __pyx_obj_8CyOpenGL_EdgeSet *)o;
  if (likely(__pyx_ptype_8CyOpenGL_GLobject)) { if (__pyx_ptype_8CyOpenGL_GLobject->tp_clear) __pyx_ptype_8CyOpenGL_GLobject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_8CyOpenGL_EdgeSet);
  tmp = ((PyObject*)p->segments);
  p->segments = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->longitude);
  p->longitude = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->meridian);
  p->meridian = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->stipple);
  p->stipple = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_EdgeSet[] = {
  {"draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_7EdgeSet_3draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_7EdgeSet_2draw},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_7EdgeSet_5__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_7EdgeSet_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_7EdgeSet_7__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_7EdgeSet_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_EdgeSet = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.EdgeSet", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_EdgeSet), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_EdgeSet, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "EdgeSet(segments, longitude, meridian)\n\n    Base class for collections of segments to be drawn into a\n    horoball scene.\n\n    The geometric parameter for the draw method is a list\n    of shifts (M,L), meaning that each segment should be drawn\n    translated by M meridians and L longitudes.\n    ", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_EdgeSet, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_EdgeSet, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_EdgeSet, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8CyOpenGL_7EdgeSet_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_EdgeSet, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_FordEdgeSet __pyx_vtable_8CyOpenGL_FordEdgeSet;

static PyObject *__pyx_tp_new_8CyOpenGL_FordEdgeSet(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_FordEdgeSet *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_EdgeSet(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_FordEdgeSet *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_FordEdgeSet;
  return o;
}

static PyMethodDef __pyx_methods_8CyOpenGL_FordEdgeSet[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_11FordEdgeSet_1__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_11FordEdgeSet___reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_11FordEdgeSet_3__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_11FordEdgeSet_2__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_FordEdgeSet = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.FordEdgeSet", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_FordEdgeSet), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_EdgeSet, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "\n    A fundamental set of edges for the component of the Ford domain\n    associated to a given cusp, projected to the xy-plane in upper\n    half-space.\n    ", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_EdgeSet, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_EdgeSet, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_FordEdgeSet, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  #if CYTHON_COMPILING_IN_PYPY
  __pyx_pw_8CyOpenGL_7EdgeSet_1__init__, /*tp_init*/
  #else
  0, /*tp_init*/
  #endif
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_FordEdgeSet, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_TriangulationEdgeSet __pyx_vtable_8CyOpenGL_TriangulationEdgeSet;

static PyObject *__pyx_tp_new_8CyOpenGL_TriangulationEdgeSet(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_EdgeSet(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet *)o);
  p->__pyx_base.__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_TriangulationEdgeSet;
  return o;
}

static PyMethodDef __pyx_methods_8CyOpenGL_TriangulationEdgeSet[] = {
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_20TriangulationEdgeSet_3__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_20TriangulationEdgeSet_2__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_20TriangulationEdgeSet_5__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_20TriangulationEdgeSet_4__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_TriangulationEdgeSet = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.TriangulationEdgeSet", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_TriangulationEdgeSet), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_EdgeSet, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "TriangulationEdgeSet(triangulation, longitude, meridian)\n\n    A fundamental set of edges for the 1-skeleton of the canonical\n    triangulation dual to the Ford domain, projected to the\n    xy-plane in upper half-space.\n    ", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_EdgeSet, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_EdgeSet, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_TriangulationEdgeSet, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8CyOpenGL_20TriangulationEdgeSet_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_TriangulationEdgeSet, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_Label __pyx_vtable_8CyOpenGL_Label;

static PyObject *__pyx_tp_new_8CyOpenGL_Label(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8CyOpenGL_Label *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_Label *)o);
  p->__pyx_vtab = __pyx_vtabptr_8CyOpenGL_Label;
  p->codes = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_Label(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_Label *p = (struct __pyx_obj_8CyOpenGL_Label *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->codes);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8CyOpenGL_Label(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_Label *p = (struct __pyx_obj_8CyOpenGL_Label *)o;
  if (p->codes) {
    e = (*v)(p->codes, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_Label(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_Label *p = (struct __pyx_obj_8CyOpenGL_Label *)o;
  tmp = ((PyObject*)p->codes);
  p->codes = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_Label[] = {
  {"draw", (PyCFunction)__pyx_pw_8CyOpenGL_5Label_3draw, METH_NOARGS, __pyx_doc_8CyOpenGL_5Label_2draw},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_5Label_5__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_5Label_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_5Label_7__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_5Label_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_Label = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.Label", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_Label), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_Label, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "Label(position, int_label)", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_Label, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_Label, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_Label, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8CyOpenGL_5Label_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_Label, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_LabelSet __pyx_vtable_8CyOpenGL_LabelSet;

static PyObject *__pyx_tp_new_8CyOpenGL_LabelSet(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_8CyOpenGL_LabelSet *p;
  PyObject *o = __pyx_tp_new_8CyOpenGL_GLobject(t, a, k);
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_LabelSet *)o);
  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_8CyOpenGL_GLobject*)__pyx_vtabptr_8CyOpenGL_LabelSet;
  p->segments = Py_None; Py_INCREF(Py_None);
  p->vertices = Py_None; Py_INCREF(Py_None);
  p->longitude = Py_None; Py_INCREF(Py_None);
  p->meridian = Py_None; Py_INCREF(Py_None);
  p->codes = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_LabelSet(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_LabelSet *p = (struct __pyx_obj_8CyOpenGL_LabelSet *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->segments);
  Py_CLEAR(p->vertices);
  Py_CLEAR(p->longitude);
  Py_CLEAR(p->meridian);
  Py_CLEAR(p->codes);
  #if CYTHON_USE_TYPE_SLOTS
  if (PyType_IS_GC(Py_TYPE(o)->tp_base))
  #endif
  PyObject_GC_Track(o);
  __pyx_tp_dealloc_8CyOpenGL_GLobject(o);
}

static int __pyx_tp_traverse_8CyOpenGL_LabelSet(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_LabelSet *p = (struct __pyx_obj_8CyOpenGL_LabelSet *)o;
  e = ((likely(__pyx_ptype_8CyOpenGL_GLobject)) ? ((__pyx_ptype_8CyOpenGL_GLobject->tp_traverse) ? __pyx_ptype_8CyOpenGL_GLobject->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_8CyOpenGL_LabelSet)); if (e) return e;
  if (p->segments) {
    e = (*v)(p->segments, a); if (e) return e;
  }
  if (p->vertices) {
    e = (*v)(p->vertices, a); if (e) return e;
  }
  if (p->longitude) {
    e = (*v)(p->longitude, a); if (e) return e;
  }
  if (p->meridian) {
    e = (*v)(p->meridian, a); if (e) return e;
  }
  if (p->codes) {
    e = (*v)(p->codes, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_LabelSet(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_LabelSet *p = (struct __pyx_obj_8CyOpenGL_LabelSet *)o;
  if (likely(__pyx_ptype_8CyOpenGL_GLobject)) { if (__pyx_ptype_8CyOpenGL_GLobject->tp_clear) __pyx_ptype_8CyOpenGL_GLobject->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_8CyOpenGL_LabelSet);
  tmp = ((PyObject*)p->segments);
  p->segments = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->vertices);
  p->vertices = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->longitude);
  p->longitude = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->meridian);
  p->meridian = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->codes);
  p->codes = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_LabelSet[] = {
  {"draw", (PyCFunction)__pyx_pw_8CyOpenGL_8LabelSet_3draw, METH_O, __pyx_doc_8CyOpenGL_8LabelSet_2draw},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_8LabelSet_5__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_8LabelSet_4__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_8LabelSet_7__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_8LabelSet_6__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_LabelSet = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.LabelSet", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_LabelSet), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_LabelSet, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "LabelSet(triangulation, longitude, meridian)\n\n    Renders edge and vertex labels in the SnapPy font.\n    ", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_LabelSet, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_LabelSet, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_LabelSet, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8CyOpenGL_8LabelSet_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_LabelSet, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};
static struct __pyx_vtabstruct_8CyOpenGL_HoroballScene __pyx_vtable_8CyOpenGL_HoroballScene;

static PyObject *__pyx_tp_new_8CyOpenGL_HoroballScene(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_8CyOpenGL_HoroballScene *p;
  PyObject *o;
  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  p = ((struct __pyx_obj_8CyOpenGL_HoroballScene *)o);
  p->__pyx_vtab = __pyx_vtabptr_8CyOpenGL_HoroballScene;
  p->nbhd = Py_None; Py_INCREF(Py_None);
  p->meridian = Py_None; Py_INCREF(Py_None);
  p->longitude = Py_None; Py_INCREF(Py_None);
  p->offset = Py_None; Py_INCREF(Py_None);
  p->flipped = Py_None; Py_INCREF(Py_None);
  p->cusp_view = Py_None; Py_INCREF(Py_None);
  p->Ford = Py_None; Py_INCREF(Py_None);
  p->tri = Py_None; Py_INCREF(Py_None);
  p->pgram = Py_None; Py_INCREF(Py_None);
  p->labels = Py_None; Py_INCREF(Py_None);
  p->shifts = Py_None; Py_INCREF(Py_None);
  p->pgram_var = Py_None; Py_INCREF(Py_None);
  p->Ford_var = Py_None; Py_INCREF(Py_None);
  p->tri_var = Py_None; Py_INCREF(Py_None);
  p->horo_var = Py_None; Py_INCREF(Py_None);
  p->label_var = Py_None; Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL_HoroballScene(PyObject *o) {
  struct __pyx_obj_8CyOpenGL_HoroballScene *p = (struct __pyx_obj_8CyOpenGL_HoroballScene *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->nbhd);
  Py_CLEAR(p->meridian);
  Py_CLEAR(p->longitude);
  Py_CLEAR(p->offset);
  Py_CLEAR(p->flipped);
  Py_CLEAR(p->cusp_view);
  Py_CLEAR(p->Ford);
  Py_CLEAR(p->tri);
  Py_CLEAR(p->pgram);
  Py_CLEAR(p->labels);
  Py_CLEAR(p->shifts);
  Py_CLEAR(p->pgram_var);
  Py_CLEAR(p->Ford_var);
  Py_CLEAR(p->tri_var);
  Py_CLEAR(p->horo_var);
  Py_CLEAR(p->label_var);
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_8CyOpenGL_HoroballScene(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL_HoroballScene *p = (struct __pyx_obj_8CyOpenGL_HoroballScene *)o;
  if (p->nbhd) {
    e = (*v)(p->nbhd, a); if (e) return e;
  }
  if (p->meridian) {
    e = (*v)(p->meridian, a); if (e) return e;
  }
  if (p->longitude) {
    e = (*v)(p->longitude, a); if (e) return e;
  }
  if (p->offset) {
    e = (*v)(p->offset, a); if (e) return e;
  }
  if (p->flipped) {
    e = (*v)(p->flipped, a); if (e) return e;
  }
  if (p->cusp_view) {
    e = (*v)(p->cusp_view, a); if (e) return e;
  }
  if (p->Ford) {
    e = (*v)(p->Ford, a); if (e) return e;
  }
  if (p->tri) {
    e = (*v)(p->tri, a); if (e) return e;
  }
  if (p->pgram) {
    e = (*v)(p->pgram, a); if (e) return e;
  }
  if (p->labels) {
    e = (*v)(p->labels, a); if (e) return e;
  }
  if (p->shifts) {
    e = (*v)(p->shifts, a); if (e) return e;
  }
  if (p->pgram_var) {
    e = (*v)(p->pgram_var, a); if (e) return e;
  }
  if (p->Ford_var) {
    e = (*v)(p->Ford_var, a); if (e) return e;
  }
  if (p->tri_var) {
    e = (*v)(p->tri_var, a); if (e) return e;
  }
  if (p->horo_var) {
    e = (*v)(p->horo_var, a); if (e) return e;
  }
  if (p->label_var) {
    e = (*v)(p->label_var, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL_HoroballScene(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL_HoroballScene *p = (struct __pyx_obj_8CyOpenGL_HoroballScene *)o;
  tmp = ((PyObject*)p->nbhd);
  p->nbhd = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->meridian);
  p->meridian = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->longitude);
  p->longitude = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->offset);
  p->offset = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->flipped);
  p->flipped = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->cusp_view);
  p->cusp_view = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->Ford);
  p->Ford = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->tri);
  p->tri = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pgram);
  p->pgram = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->labels);
  p->labels = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->shifts);
  p->shifts = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->pgram_var);
  p->pgram_var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->Ford_var);
  p->Ford_var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->tri_var);
  p->tri_var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->horo_var);
  p->horo_var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->label_var);
  p->label_var = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyMethodDef __pyx_methods_8CyOpenGL_HoroballScene[] = {
  {"destroy", (PyCFunction)__pyx_pw_8CyOpenGL_13HoroballScene_3destroy, METH_NOARGS, __pyx_doc_8CyOpenGL_13HoroballScene_2destroy},
  {"set_cutoff", (PyCFunction)__pyx_pw_8CyOpenGL_13HoroballScene_5set_cutoff, METH_O, __pyx_doc_8CyOpenGL_13HoroballScene_4set_cutoff},
  {"flip", (PyCFunction)__pyx_pw_8CyOpenGL_13HoroballScene_7flip, METH_O, __pyx_doc_8CyOpenGL_13HoroballScene_6flip},
  {"build_scene", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_9build_scene, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_8build_scene},
  {"translate", (PyCFunction)__pyx_pw_8CyOpenGL_13HoroballScene_11translate, METH_O, __pyx_doc_8CyOpenGL_13HoroballScene_10translate},
  {"draw", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_8CyOpenGL_13HoroballScene_13draw, METH_VARARGS|METH_KEYWORDS, __pyx_doc_8CyOpenGL_13HoroballScene_12draw},
  {"__reduce_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_13HoroballScene_15__reduce_cython__, METH_NOARGS, __pyx_doc_8CyOpenGL_13HoroballScene_14__reduce_cython__},
  {"__setstate_cython__", (PyCFunction)__pyx_pw_8CyOpenGL_13HoroballScene_17__setstate_cython__, METH_O, __pyx_doc_8CyOpenGL_13HoroballScene_16__setstate_cython__},
  {0, 0, 0, 0}
};

static PyTypeObject __pyx_type_8CyOpenGL_HoroballScene = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.HoroballScene", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL_HoroballScene), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL_HoroballScene, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  "HoroballScene(nbhd, pgram_var, Ford_var, tri_var, horo_var, label_var, flipped=False, cutoff=0.1, which_cusp=0)\n\n    A family of translations of a Horoball Group which fill the\n    screen.  The horoballs are viewed by an observer sitting on one of\n    the horoballs.  The variable which_cusp selects which cusp the\n    viewer's horoball corresponds to.\n    ", /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL_HoroballScene, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL_HoroballScene, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_8CyOpenGL_HoroballScene, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_8CyOpenGL_13HoroballScene_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL_HoroballScene, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *__pyx_freelist_8CyOpenGL___pyx_scope_struct__draw[8];
static int __pyx_freecount_8CyOpenGL___pyx_scope_struct__draw = 0;

static PyObject *__pyx_tp_new_8CyOpenGL___pyx_scope_struct__draw(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8CyOpenGL___pyx_scope_struct__draw > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw)))) {
    o = (PyObject*)__pyx_freelist_8CyOpenGL___pyx_scope_struct__draw[--__pyx_freecount_8CyOpenGL___pyx_scope_struct__draw];
    memset(o, 0, sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct__draw(PyObject *o) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_r);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8CyOpenGL___pyx_scope_struct__draw < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw)))) {
    __pyx_freelist_8CyOpenGL___pyx_scope_struct__draw[__pyx_freecount_8CyOpenGL___pyx_scope_struct__draw++] = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8CyOpenGL___pyx_scope_struct__draw(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)o;
  if (p->__pyx_v_r) {
    e = (*v)(p->__pyx_v_r, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL___pyx_scope_struct__draw(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw *)o;
  tmp = ((PyObject*)p->__pyx_v_r);
  p->__pyx_v_r = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8CyOpenGL___pyx_scope_struct__draw = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.__pyx_scope_struct__draw", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct__draw), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct__draw, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL___pyx_scope_struct__draw, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL___pyx_scope_struct__draw, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL___pyx_scope_struct__draw, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *__pyx_freelist_8CyOpenGL___pyx_scope_struct_1_build_scene[8];
static int __pyx_freecount_8CyOpenGL___pyx_scope_struct_1_build_scene = 0;

static PyObject *__pyx_tp_new_8CyOpenGL___pyx_scope_struct_1_build_scene(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8CyOpenGL___pyx_scope_struct_1_build_scene > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene)))) {
    o = (PyObject*)__pyx_freelist_8CyOpenGL___pyx_scope_struct_1_build_scene[--__pyx_freecount_8CyOpenGL___pyx_scope_struct_1_build_scene];
    memset(o, 0, sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct_1_build_scene(PyObject *o) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_v_self);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8CyOpenGL___pyx_scope_struct_1_build_scene < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene)))) {
    __pyx_freelist_8CyOpenGL___pyx_scope_struct_1_build_scene[__pyx_freecount_8CyOpenGL___pyx_scope_struct_1_build_scene++] = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8CyOpenGL___pyx_scope_struct_1_build_scene(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *)o;
  if (p->__pyx_v_self) {
    e = (*v)(((PyObject *)p->__pyx_v_self), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_8CyOpenGL___pyx_scope_struct_1_build_scene(PyObject *o) {
  PyObject* tmp;
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene *)o;
  tmp = ((PyObject*)p->__pyx_v_self);
  p->__pyx_v_self = ((struct __pyx_obj_8CyOpenGL_HoroballScene *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyTypeObject __pyx_type_8CyOpenGL___pyx_scope_struct_1_build_scene = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.__pyx_scope_struct_1_build_scene", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_1_build_scene), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct_1_build_scene, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL___pyx_scope_struct_1_build_scene, /*tp_traverse*/
  __pyx_tp_clear_8CyOpenGL___pyx_scope_struct_1_build_scene, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL___pyx_scope_struct_1_build_scene, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr *__pyx_freelist_8CyOpenGL___pyx_scope_struct_2_genexpr[8];
static int __pyx_freecount_8CyOpenGL___pyx_scope_struct_2_genexpr = 0;

static PyObject *__pyx_tp_new_8CyOpenGL___pyx_scope_struct_2_genexpr(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_8CyOpenGL___pyx_scope_struct_2_genexpr > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr)))) {
    o = (PyObject*)__pyx_freelist_8CyOpenGL___pyx_scope_struct_2_genexpr[--__pyx_freecount_8CyOpenGL___pyx_scope_struct_2_genexpr];
    memset(o, 0, sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr));
    (void) PyObject_INIT(o, t);
    PyObject_GC_Track(o);
  } else {
    o = (*t->tp_alloc)(t, 0);
    if (unlikely(!o)) return 0;
  }
  return o;
}

static void __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct_2_genexpr(PyObject *o) {
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr *)o;
  PyObject_GC_UnTrack(o);
  Py_CLEAR(p->__pyx_outer_scope);
  Py_CLEAR(p->__pyx_v_z);
  Py_CLEAR(p->__pyx_t_0);
  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_8CyOpenGL___pyx_scope_struct_2_genexpr < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr)))) {
    __pyx_freelist_8CyOpenGL___pyx_scope_struct_2_genexpr[__pyx_freecount_8CyOpenGL___pyx_scope_struct_2_genexpr++] = ((struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr *)o);
  } else {
    (*Py_TYPE(o)->tp_free)(o);
  }
}

static int __pyx_tp_traverse_8CyOpenGL___pyx_scope_struct_2_genexpr(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr *p = (struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr *)o;
  if (p->__pyx_outer_scope) {
    e = (*v)(((PyObject *)p->__pyx_outer_scope), a); if (e) return e;
  }
  if (p->__pyx_v_z) {
    e = (*v)(p->__pyx_v_z, a); if (e) return e;
  }
  if (p->__pyx_t_0) {
    e = (*v)(p->__pyx_t_0, a); if (e) return e;
  }
  return 0;
}

static PyTypeObject __pyx_type_8CyOpenGL___pyx_scope_struct_2_genexpr = {
  PyVarObject_HEAD_INIT(0, 0)
  "CyOpenGL.__pyx_scope_struct_2_genexpr", /*tp_name*/
  sizeof(struct __pyx_obj_8CyOpenGL___pyx_scope_struct_2_genexpr), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_8CyOpenGL___pyx_scope_struct_2_genexpr, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  0, /*tp_doc*/
  __pyx_tp_traverse_8CyOpenGL___pyx_scope_struct_2_genexpr, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  0, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_8CyOpenGL___pyx_scope_struct_2_genexpr, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
};

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};

#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_CyOpenGL(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_CyOpenGL},
  {0, NULL}
};
#endif

static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    "CyOpenGL",
    0, /* m_doc */
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    0, /* m_size */
  #else
    -1, /* m_size */
  #endif
    __pyx_methods /* m_methods */,
  #if CYTHON_PEP489_MULTI_PHASE_INIT
    __pyx_moduledef_slots, /* m_slots */
  #else
    NULL, /* m_reload */
  #endif
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp_s_64bit, __pyx_k_64bit, sizeof(__pyx_k_64bit), 0, 0, 1, 0},
  {&__pyx_kp_s_A_hyperbolic_polyhedron_for_dis, __pyx_k_A_hyperbolic_polyhedron_for_dis, sizeof(__pyx_k_A_hyperbolic_polyhedron_for_dis), 0, 0, 1, 0},
  {&__pyx_kp_s_A_triangle_which_can_tessellate, __pyx_k_A_triangle_which_can_tessellate, sizeof(__pyx_k_A_triangle_which_can_tessellate), 0, 0, 1, 0},
  {&__pyx_kp_s_A_version_of_the_widget_that_us, __pyx_k_A_version_of_the_widget_that_us, sizeof(__pyx_k_A_version_of_the_widget_that_us), 0, 0, 1, 0},
  {&__pyx_kp_s_B1_Motion, __pyx_k_B1_Motion, sizeof(__pyx_k_B1_Motion), 0, 0, 1, 0},
  {&__pyx_kp_s_B2_Motion, __pyx_k_B2_Motion, sizeof(__pyx_k_B2_Motion), 0, 0, 1, 0},
  {&__pyx_kp_s_B3_Motion, __pyx_k_B3_Motion, sizeof(__pyx_k_B3_Motion), 0, 0, 1, 0},
  {&__pyx_kp_s_ButtonRelease_1, __pyx_k_ButtonRelease_1, sizeof(__pyx_k_ButtonRelease_1), 0, 0, 1, 0},
  {&__pyx_kp_s_ButtonRelease_3, __pyx_k_ButtonRelease_3, sizeof(__pyx_k_ButtonRelease_3), 0, 0, 1, 0},
  {&__pyx_kp_s_Button_1, __pyx_k_Button_1, sizeof(__pyx_k_Button_1), 0, 0, 1, 0},
  {&__pyx_kp_s_Button_2, __pyx_k_Button_2, sizeof(__pyx_k_Button_2), 0, 0, 1, 0},
  {&__pyx_kp_s_Button_3, __pyx_k_Button_3, sizeof(__pyx_k_Button_3), 0, 0, 1, 0},
  {&__pyx_n_s_Colorizer, __pyx_k_Colorizer, sizeof(__pyx_k_Colorizer), 0, 0, 1, 1},
  {&__pyx_kp_s_Configure, __pyx_k_Configure, sizeof(__pyx_k_Configure), 0, 0, 1, 0},
  {&__pyx_kp_s_Control_Button_1, __pyx_k_Control_Button_1, sizeof(__pyx_k_Control_Button_1), 0, 0, 1, 0},
  {&__pyx_kp_s_Control_Button_1_ButtonRelease, __pyx_k_Control_Button_1_ButtonRelease, sizeof(__pyx_k_Control_Button_1_ButtonRelease), 0, 0, 1, 0},
  {&__pyx_n_s_CyOpenGL, __pyx_k_CyOpenGL, sizeof(__pyx_k_CyOpenGL), 0, 0, 1, 1},
  {&__pyx_n_s_EdgeSet, __pyx_k_EdgeSet, sizeof(__pyx_k_EdgeSet), 0, 0, 1, 1},
  {&__pyx_kp_s_Expose, __pyx_k_Expose, sizeof(__pyx_k_Expose), 0, 0, 1, 0},
  {&__pyx_n_s_FordEdgeSet, __pyx_k_FordEdgeSet, sizeof(__pyx_k_FordEdgeSet), 0, 0, 1, 1},
  {&__pyx_n_s_Ford_domain, __pyx_k_Ford_domain, sizeof(__pyx_k_Ford_domain), 0, 0, 1, 1},
  {&__pyx_n_s_Ford_var, __pyx_k_Ford_var, sizeof(__pyx_k_Ford_var), 0, 0, 1, 1},
  {&__pyx_n_s_GL_EXTENSIONS, __pyx_k_GL_EXTENSIONS, sizeof(__pyx_k_GL_EXTENSIONS), 0, 0, 1, 1},
  {&__pyx_n_s_GL_RENDERER, __pyx_k_GL_RENDERER, sizeof(__pyx_k_GL_RENDERER), 0, 0, 1, 1},
  {&__pyx_n_s_GL_VENDOR, __pyx_k_GL_VENDOR, sizeof(__pyx_k_GL_VENDOR), 0, 0, 1, 1},
  {&__pyx_n_s_GL_VERSION, __pyx_k_GL_VERSION, sizeof(__pyx_k_GL_VERSION), 0, 0, 1, 1},
  {&__pyx_n_s_GL_context, __pyx_k_GL_context, sizeof(__pyx_k_GL_context), 0, 0, 1, 1},
  {&__pyx_n_s_GLobject, __pyx_k_GLobject, sizeof(__pyx_k_GLobject), 0, 0, 1, 1},
  {&__pyx_n_s_GetColor, __pyx_k_GetColor, sizeof(__pyx_k_GetColor), 0, 0, 1, 1},
  {&__pyx_n_s_GetString, __pyx_k_GetString, sizeof(__pyx_k_GetString), 0, 0, 1, 1},
  {&__pyx_n_s_HoroballGroup, __pyx_k_HoroballGroup, sizeof(__pyx_k_HoroballGroup), 0, 0, 1, 1},
  {&__pyx_n_s_HoroballScene, __pyx_k_HoroballScene, sizeof(__pyx_k_HoroballScene), 0, 0, 1, 1},
  {&__pyx_n_s_Horosphere, __pyx_k_Horosphere, sizeof(__pyx_k_Horosphere), 0, 0, 1, 1},
  {&__pyx_n_s_HyperbolicPolyhedron, __pyx_k_HyperbolicPolyhedron, sizeof(__pyx_k_HyperbolicPolyhedron), 0, 0, 1, 1},
  {&__pyx_n_s_HyperbolicPolyhedron___init, __pyx_k_HyperbolicPolyhedron___init, sizeof(__pyx_k_HyperbolicPolyhedron___init), 0, 0, 1, 1},
  {&__pyx_n_s_HyperbolicPolyhedron_build_klein, __pyx_k_HyperbolicPolyhedron_build_klein, sizeof(__pyx_k_HyperbolicPolyhedron_build_klein), 0, 0, 1, 1},
  {&__pyx_n_s_HyperbolicPolyhedron_build_poinc, __pyx_k_HyperbolicPolyhedron_build_poinc, sizeof(__pyx_k_HyperbolicPolyhedron_build_poinc), 0, 0, 1, 1},
  {&__pyx_n_s_HyperbolicPolyhedron_destroy, __pyx_k_HyperbolicPolyhedron_destroy, sizeof(__pyx_k_HyperbolicPolyhedron_destroy), 0, 0, 1, 1},
  {&__pyx_n_s_HyperbolicPolyhedron_draw, __pyx_k_HyperbolicPolyhedron_draw, sizeof(__pyx_k_HyperbolicPolyhedron_draw), 0, 0, 1, 1},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x0a, __pyx_k_Incompatible_checksums_s_vs_0x0a, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x0a), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x8c, __pyx_k_Incompatible_checksums_s_vs_0x8c, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x8c), 0, 0, 1, 0},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xcc, __pyx_k_Incompatible_checksums_s_vs_0xcc, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xcc), 0, 0, 1, 0},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_n_s_InfoDialog, __pyx_k_InfoDialog, sizeof(__pyx_k_InfoDialog), 0, 0, 1, 1},
  {&__pyx_kp_s_Invalid_enum_Must_be_GL_VENDOR_G, __pyx_k_Invalid_enum_Must_be_GL_VENDOR_G, sizeof(__pyx_k_Invalid_enum_Must_be_GL_VENDOR_G), 0, 0, 1, 0},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_kp_s_KeyPress, __pyx_k_KeyPress, sizeof(__pyx_k_KeyPress), 0, 0, 1, 0},
  {&__pyx_n_s_Klein, __pyx_k_Klein, sizeof(__pyx_k_Klein), 0, 0, 1, 1},
  {&__pyx_n_s_KleinPolygon, __pyx_k_KleinPolygon, sizeof(__pyx_k_KleinPolygon), 0, 0, 1, 1},
  {&__pyx_n_s_Klein_faces, __pyx_k_Klein_faces, sizeof(__pyx_k_Klein_faces), 0, 0, 1, 1},
  {&__pyx_n_s_Label, __pyx_k_Label, sizeof(__pyx_k_Label), 0, 0, 1, 1},
  {&__pyx_n_s_LabelSet, __pyx_k_LabelSet, sizeof(__pyx_k_LabelSet), 0, 0, 1, 1},
  {&__pyx_kp_s_Map, __pyx_k_Map, sizeof(__pyx_k_Map), 0, 0, 1, 0},
  {&__pyx_n_s_MeshedSurface, __pyx_k_MeshedSurface, sizeof(__pyx_k_MeshedSurface), 0, 0, 1, 1},
  {&__pyx_n_s_Misc, __pyx_k_Misc, sizeof(__pyx_k_Misc), 0, 0, 1, 1},
  {&__pyx_kp_s_No_help_is_available, __pyx_k_No_help_is_available, sizeof(__pyx_k_No_help_is_available), 0, 0, 1, 0},
  {&__pyx_kp_s_No_result_is_there_a_current_Ope, __pyx_k_No_result_is_there_a_current_Ope, sizeof(__pyx_k_No_result_is_there_a_current_Ope), 0, 0, 1, 0},
  {&__pyx_n_s_OpenGLOrthoWidget, __pyx_k_OpenGLOrthoWidget, sizeof(__pyx_k_OpenGLOrthoWidget), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLOrthoWidget_build_projecti, __pyx_k_OpenGLOrthoWidget_build_projecti, sizeof(__pyx_k_OpenGLOrthoWidget_build_projecti), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLOrthoWidget_redraw, __pyx_k_OpenGLOrthoWidget_redraw, sizeof(__pyx_k_OpenGLOrthoWidget_redraw), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLOrthoWidget_tkTranslate, __pyx_k_OpenGLOrthoWidget_tkTranslate, sizeof(__pyx_k_OpenGLOrthoWidget_tkTranslate), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget, __pyx_k_OpenGLWidget, sizeof(__pyx_k_OpenGLWidget), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_StartRotate, __pyx_k_OpenGLWidget_StartRotate, sizeof(__pyx_k_OpenGLWidget_StartRotate), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget___init, __pyx_k_OpenGLWidget___init, sizeof(__pyx_k_OpenGLWidget___init), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_activate, __pyx_k_OpenGLWidget_activate, sizeof(__pyx_k_OpenGLWidget_activate), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_build_projection, __pyx_k_OpenGLWidget_build_projection, sizeof(__pyx_k_OpenGLWidget_build_projection), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_do_AutoSpin, __pyx_k_OpenGLWidget_do_AutoSpin, sizeof(__pyx_k_OpenGLWidget_do_AutoSpin), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_help, __pyx_k_OpenGLWidget_help, sizeof(__pyx_k_OpenGLWidget_help), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_mouse_update, __pyx_k_OpenGLWidget_mouse_update, sizeof(__pyx_k_OpenGLWidget_mouse_update), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_reset, __pyx_k_OpenGLWidget_reset, sizeof(__pyx_k_OpenGLWidget_reset), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_set_background, __pyx_k_OpenGLWidget_set_background, sizeof(__pyx_k_OpenGLWidget_set_background), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_set_centerpoint, __pyx_k_OpenGLWidget_set_centerpoint, sizeof(__pyx_k_OpenGLWidget_set_centerpoint), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_set_eyepoint, __pyx_k_OpenGLWidget_set_eyepoint, sizeof(__pyx_k_OpenGLWidget_set_eyepoint), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_tkAutoSpin, __pyx_k_OpenGLWidget_tkAutoSpin, sizeof(__pyx_k_OpenGLWidget_tkAutoSpin), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_tkExpose, __pyx_k_OpenGLWidget_tkExpose, sizeof(__pyx_k_OpenGLWidget_tkExpose), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_tkHandlePick, __pyx_k_OpenGLWidget_tkHandlePick, sizeof(__pyx_k_OpenGLWidget_tkHandlePick), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_tkKeyPress, __pyx_k_OpenGLWidget_tkKeyPress, sizeof(__pyx_k_OpenGLWidget_tkKeyPress), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_tkMap, __pyx_k_OpenGLWidget_tkMap, sizeof(__pyx_k_OpenGLWidget_tkMap), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_tkPrint, __pyx_k_OpenGLWidget_tkPrint, sizeof(__pyx_k_OpenGLWidget_tkPrint), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_tkRecordMouse, __pyx_k_OpenGLWidget_tkRecordMouse, sizeof(__pyx_k_OpenGLWidget_tkRecordMouse), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_tkRedraw, __pyx_k_OpenGLWidget_tkRedraw, sizeof(__pyx_k_OpenGLWidget_tkRedraw), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_tkRotate, __pyx_k_OpenGLWidget_tkRotate, sizeof(__pyx_k_OpenGLWidget_tkRotate), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_tkScale, __pyx_k_OpenGLWidget_tkScale, sizeof(__pyx_k_OpenGLWidget_tkScale), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_tkTranslate, __pyx_k_OpenGLWidget_tkTranslate, sizeof(__pyx_k_OpenGLWidget_tkTranslate), 0, 0, 1, 1},
  {&__pyx_n_s_OpenGLWidget_zoom, __pyx_k_OpenGLWidget_zoom, sizeof(__pyx_k_OpenGLWidget_zoom), 0, 0, 1, 1},
  {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
  {&__pyx_n_s_Parallelogram, __pyx_k_Parallelogram, sizeof(__pyx_k_Parallelogram), 0, 0, 1, 1},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_Poincare, __pyx_k_Poincare, sizeof(__pyx_k_Poincare), 0, 0, 1, 1},
  {&__pyx_n_s_PoincarePolygon, __pyx_k_PoincarePolygon, sizeof(__pyx_k_PoincarePolygon), 0, 0, 1, 1},
  {&__pyx_n_s_PoincareTriangle, __pyx_k_PoincareTriangle, sizeof(__pyx_k_PoincareTriangle), 0, 0, 1, 1},
  {&__pyx_n_s_Poincare_faces, __pyx_k_Poincare_faces, sizeof(__pyx_k_Poincare_faces), 0, 0, 1, 1},
  {&__pyx_n_s_R, __pyx_k_R, sizeof(__pyx_k_R), 0, 0, 1, 1},
  {&__pyx_n_s_RawOpenGLWidget, __pyx_k_RawOpenGLWidget, sizeof(__pyx_k_RawOpenGLWidget), 0, 0, 1, 1},
  {&__pyx_n_s_RawOpenGLWidget___init, __pyx_k_RawOpenGLWidget___init, sizeof(__pyx_k_RawOpenGLWidget___init), 0, 0, 1, 1},
  {&__pyx_n_s_RawOpenGLWidget_tkExpose, __pyx_k_RawOpenGLWidget_tkExpose, sizeof(__pyx_k_RawOpenGLWidget_tkExpose), 0, 0, 1, 1},
  {&__pyx_n_s_RawOpenGLWidget_tkMap, __pyx_k_RawOpenGLWidget_tkMap, sizeof(__pyx_k_RawOpenGLWidget_tkMap), 0, 0, 1, 1},
  {&__pyx_n_s_RawOpenGLWidget_tkRedraw, __pyx_k_RawOpenGLWidget_tkRedraw, sizeof(__pyx_k_RawOpenGLWidget_tkRedraw), 0, 0, 1, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_S_infinity, __pyx_k_S_infinity, sizeof(__pyx_k_S_infinity), 0, 0, 1, 1},
  {&__pyx_kp_s_Shift_B1_Motion, __pyx_k_Shift_B1_Motion, sizeof(__pyx_k_Shift_B1_Motion), 0, 0, 1, 0},
  {&__pyx_kp_s_Shift_Button_1, __pyx_k_Shift_Button_1, sizeof(__pyx_k_Shift_Button_1), 0, 0, 1, 0},
  {&__pyx_kp_s_Sorry_this_implementation_was_re, __pyx_k_Sorry_this_implementation_was_re, sizeof(__pyx_k_Sorry_this_implementation_was_re), 0, 0, 1, 0},
  {&__pyx_n_s_StartRotate, __pyx_k_StartRotate, sizeof(__pyx_k_StartRotate), 0, 0, 1, 1},
  {&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
  {&__pyx_n_s_TclError, __pyx_k_TclError, sizeof(__pyx_k_TclError), 0, 0, 1, 1},
  {&__pyx_kp_s_Tcl_can_not_find_Togl_even_thoug, __pyx_k_Tcl_can_not_find_Togl_even_thoug, sizeof(__pyx_k_Tcl_can_not_find_Togl_even_thoug), 0, 0, 1, 0},
  {&__pyx_n_s_Tk, __pyx_k_Tk, sizeof(__pyx_k_Tk), 0, 0, 1, 1},
  {&__pyx_n_s_Tkinter, __pyx_k_Tkinter, sizeof(__pyx_k_Tkinter), 0, 0, 1, 1},
  {&__pyx_kp_s_Tkinter_bindings_for_an_OpenGL, __pyx_k_Tkinter_bindings_for_an_OpenGL, sizeof(__pyx_k_Tkinter_bindings_for_an_OpenGL), 0, 0, 1, 0},
  {&__pyx_n_s_Togl, __pyx_k_Togl, sizeof(__pyx_k_Togl), 0, 0, 1, 1},
  {&__pyx_n_s_Togl_dir, __pyx_k_Togl_dir, sizeof(__pyx_k_Togl_dir), 0, 0, 1, 1},
  {&__pyx_kp_s_Togl_directory_s_missing, __pyx_k_Togl_directory_s_missing, sizeof(__pyx_k_Togl_directory_s_missing), 0, 0, 1, 0},
  {&__pyx_n_s_Togl_path, __pyx_k_Togl_path, sizeof(__pyx_k_Togl_path), 0, 0, 1, 1},
  {&__pyx_n_s_TriangleMesh, __pyx_k_TriangleMesh, sizeof(__pyx_k_TriangleMesh), 0, 0, 1, 1},
  {&__pyx_n_s_TriangleMesh___getitem, __pyx_k_TriangleMesh___getitem, sizeof(__pyx_k_TriangleMesh___getitem), 0, 0, 1, 1},
  {&__pyx_n_s_TriangleMesh___init, __pyx_k_TriangleMesh___init, sizeof(__pyx_k_TriangleMesh___init), 0, 0, 1, 1},
  {&__pyx_n_s_TriangleMesh___repr, __pyx_k_TriangleMesh___repr, sizeof(__pyx_k_TriangleMesh___repr), 0, 0, 1, 1},
  {&__pyx_n_s_TriangleMesh_subdivide, __pyx_k_TriangleMesh_subdivide, sizeof(__pyx_k_TriangleMesh_subdivide), 0, 0, 1, 1},
  {&__pyx_n_s_TriangulationEdgeSet, __pyx_k_TriangulationEdgeSet, sizeof(__pyx_k_TriangulationEdgeSet), 0, 0, 1, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_V, __pyx_k_V, sizeof(__pyx_k_V), 0, 0, 1, 1},
  {&__pyx_n_s_VC, __pyx_k_VC, sizeof(__pyx_k_VC), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_kp_s_Viewer_Help, __pyx_k_Viewer_Help, sizeof(__pyx_k_Viewer_Help), 0, 0, 1, 0},
  {&__pyx_n_s_Widget, __pyx_k_Widget, sizeof(__pyx_k_Widget), 0, 0, 1, 1},
  {&__pyx_kp_s_Widget_without_any_sophisticate, __pyx_k_Widget_without_any_sophisticate, sizeof(__pyx_k_Widget_without_any_sophisticate), 0, 0, 1, 0},
  {&__pyx_n_s_WireframeSphere, __pyx_k_WireframeSphere, sizeof(__pyx_k_WireframeSphere), 0, 0, 1, 1},
  {&__pyx_n_s_Xangle, __pyx_k_Xangle, sizeof(__pyx_k_Xangle), 0, 0, 1, 1},
  {&__pyx_n_s_Yangle, __pyx_k_Yangle, sizeof(__pyx_k_Yangle), 0, 0, 1, 1},
  {&__pyx_n_s__51, __pyx_k__51, sizeof(__pyx_k__51), 0, 0, 1, 1},
  {&__pyx_n_s_abspath, __pyx_k_abspath, sizeof(__pyx_k_abspath), 0, 0, 1, 1},
  {&__pyx_n_s_activate, __pyx_k_activate, sizeof(__pyx_k_activate), 0, 0, 1, 1},
  {&__pyx_n_s_after, __pyx_k_after, sizeof(__pyx_k_after), 0, 0, 1, 1},
  {&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
  {&__pyx_n_s_append, __pyx_k_append, sizeof(__pyx_k_append), 0, 0, 1, 1},
  {&__pyx_n_s_architecture, __pyx_k_architecture, sizeof(__pyx_k_architecture), 0, 0, 1, 1},
  {&__pyx_n_s_args, __pyx_k_args, sizeof(__pyx_k_args), 0, 0, 1, 1},
  {&__pyx_n_s_aspect, __pyx_k_aspect, sizeof(__pyx_k_aspect), 0, 0, 1, 1},
  {&__pyx_n_s_auto_path, __pyx_k_auto_path, sizeof(__pyx_k_auto_path), 0, 0, 1, 1},
  {&__pyx_n_s_autospin, __pyx_k_autospin, sizeof(__pyx_k_autospin), 0, 0, 1, 1},
  {&__pyx_n_s_autospin_allowed, __pyx_k_autospin_allowed, sizeof(__pyx_k_autospin_allowed), 0, 0, 1, 1},
  {&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
  {&__pyx_n_s_b_back, __pyx_k_b_back, sizeof(__pyx_k_b_back), 0, 0, 1, 1},
  {&__pyx_n_s_back_shininess, __pyx_k_back_shininess, sizeof(__pyx_k_back_shininess), 0, 0, 1, 1},
  {&__pyx_n_s_back_specular, __pyx_k_back_specular, sizeof(__pyx_k_back_specular), 0, 0, 1, 1},
  {&__pyx_n_s_bind, __pyx_k_bind, sizeof(__pyx_k_bind), 0, 0, 1, 1},
  {&__pyx_n_s_build_display_list, __pyx_k_build_display_list, sizeof(__pyx_k_build_display_list), 0, 0, 1, 1},
  {&__pyx_n_s_build_klein_poly, __pyx_k_build_klein_poly, sizeof(__pyx_k_build_klein_poly), 0, 0, 1, 1},
  {&__pyx_n_s_build_poincare_poly, __pyx_k_build_poincare_poly, sizeof(__pyx_k_build_poincare_poly), 0, 0, 1, 1},
  {&__pyx_n_s_build_projection, __pyx_k_build_projection, sizeof(__pyx_k_build_projection), 0, 0, 1, 1},
  {&__pyx_n_s_build_scene, __pyx_k_build_scene, sizeof(__pyx_k_build_scene), 0, 0, 1, 1},
  {&__pyx_n_s_build_scene_locals_genexpr, __pyx_k_build_scene_locals_genexpr, sizeof(__pyx_k_build_scene_locals_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_call, __pyx_k_call, sizeof(__pyx_k_call), 0, 0, 1, 1},
  {&__pyx_n_s_ceil, __pyx_k_ceil, sizeof(__pyx_k_ceil), 0, 0, 1, 1},
  {&__pyx_n_s_center, __pyx_k_center, sizeof(__pyx_k_center), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_close, __pyx_k_close, sizeof(__pyx_k_close), 0, 0, 1, 1},
  {&__pyx_n_s_closest, __pyx_k_closest, sizeof(__pyx_k_closest), 0, 0, 1, 1},
  {&__pyx_n_s_cnf, __pyx_k_cnf, sizeof(__pyx_k_cnf), 0, 0, 1, 1},
  {&__pyx_n_s_color, __pyx_k_color, sizeof(__pyx_k_color), 0, 0, 1, 1},
  {&__pyx_n_s_colorsys, __pyx_k_colorsys, sizeof(__pyx_k_colorsys), 0, 0, 1, 1},
  {&__pyx_n_s_config, __pyx_k_config, sizeof(__pyx_k_config), 0, 0, 1, 1},
  {&__pyx_n_s_conjugate, __pyx_k_conjugate, sizeof(__pyx_k_conjugate), 0, 0, 1, 1},
  {&__pyx_n_s_cos, __pyx_k_cos, sizeof(__pyx_k_cos), 0, 0, 1, 1},
  {&__pyx_n_s_cpu_width, __pyx_k_cpu_width, sizeof(__pyx_k_cpu_width), 0, 0, 1, 1},
  {&__pyx_n_s_curr_platform, __pyx_k_curr_platform, sizeof(__pyx_k_curr_platform), 0, 0, 1, 1},
  {&__pyx_n_s_cursor, __pyx_k_cursor, sizeof(__pyx_k_cursor), 0, 0, 1, 1},
  {&__pyx_n_s_cutoff, __pyx_k_cutoff, sizeof(__pyx_k_cutoff), 0, 0, 1, 1},
  {&__pyx_n_s_dark, __pyx_k_dark, sizeof(__pyx_k_dark), 0, 0, 1, 1},
  {&__pyx_n_s_darwin, __pyx_k_darwin, sizeof(__pyx_k_darwin), 0, 0, 1, 1},
  {&__pyx_n_s_delete_lists, __pyx_k_delete_lists, sizeof(__pyx_k_delete_lists), 0, 0, 1, 1},
  {&__pyx_n_s_delta_t, __pyx_k_delta_t, sizeof(__pyx_k_delta_t), 0, 0, 1, 1},
  {&__pyx_n_s_destroy, __pyx_k_destroy, sizeof(__pyx_k_destroy), 0, 0, 1, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
  {&__pyx_n_s_dirname, __pyx_k_dirname, sizeof(__pyx_k_dirname), 0, 0, 1, 1},
  {&__pyx_n_s_distance, __pyx_k_distance, sizeof(__pyx_k_distance), 0, 0, 1, 1},
  {&__pyx_n_s_do_AutoSpin, __pyx_k_do_AutoSpin, sizeof(__pyx_k_do_AutoSpin), 0, 0, 1, 1},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_draw, __pyx_k_draw, sizeof(__pyx_k_draw), 0, 0, 1, 1},
  {&__pyx_n_s_draw_locals_draw_point, __pyx_k_draw_locals_draw_point, sizeof(__pyx_k_draw_locals_draw_point), 0, 0, 1, 1},
  {&__pyx_n_s_draw_point, __pyx_k_draw_point, sizeof(__pyx_k_draw_point), 0, 0, 1, 1},
  {&__pyx_n_s_dummy, __pyx_k_dummy, sizeof(__pyx_k_dummy), 0, 0, 1, 1},
  {&__pyx_n_s_endpoints, __pyx_k_endpoints, sizeof(__pyx_k_endpoints), 0, 0, 1, 1},
  {&__pyx_n_s_enumdict, __pyx_k_enumdict, sizeof(__pyx_k_enumdict), 0, 0, 1, 1},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_event, __pyx_k_event, sizeof(__pyx_k_event), 0, 0, 1, 1},
  {&__pyx_n_s_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 0, 0, 1, 1},
  {&__pyx_n_s_face, __pyx_k_face, sizeof(__pyx_k_face), 0, 0, 1, 1},
  {&__pyx_n_s_face_specular, __pyx_k_face_specular, sizeof(__pyx_k_face_specular), 0, 0, 1, 1},
  {&__pyx_n_s_facedicts, __pyx_k_facedicts, sizeof(__pyx_k_facedicts), 0, 0, 1, 1},
  {&__pyx_n_s_far, __pyx_k_far, sizeof(__pyx_k_far), 0, 0, 1, 1},
  {&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
  {&__pyx_n_s_file_2, __pyx_k_file_2, sizeof(__pyx_k_file_2), 0, 0, 1, 1},
  {&__pyx_n_s_fleur, __pyx_k_fleur, sizeof(__pyx_k_fleur), 0, 0, 1, 1},
  {&__pyx_n_s_flipped, __pyx_k_flipped, sizeof(__pyx_k_flipped), 0, 0, 1, 1},
  {&__pyx_n_s_floor, __pyx_k_floor, sizeof(__pyx_k_floor), 0, 0, 1, 1},
  {&__pyx_n_s_fovy, __pyx_k_fovy, sizeof(__pyx_k_fovy), 0, 0, 1, 1},
  {&__pyx_n_s_front_shininess, __pyx_k_front_shininess, sizeof(__pyx_k_front_shininess), 0, 0, 1, 1},
  {&__pyx_n_s_front_specular, __pyx_k_front_specular, sizeof(__pyx_k_front_specular), 0, 0, 1, 1},
  {&__pyx_n_s_full_list, __pyx_k_full_list, sizeof(__pyx_k_full_list), 0, 0, 1, 1},
  {&__pyx_n_s_g, __pyx_k_g, sizeof(__pyx_k_g), 0, 0, 1, 1},
  {&__pyx_n_s_g_back, __pyx_k_g_back, sizeof(__pyx_k_g_back), 0, 0, 1, 1},
  {&__pyx_n_s_genexpr, __pyx_k_genexpr, sizeof(__pyx_k_genexpr), 0, 0, 1, 1},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_getitem, __pyx_k_getitem, sizeof(__pyx_k_getitem), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_getvar, __pyx_k_getvar, sizeof(__pyx_k_getvar), 0, 0, 1, 1},
  {&__pyx_n_s_getwindowsversion, __pyx_k_getwindowsversion, sizeof(__pyx_k_getwindowsversion), 0, 0, 1, 1},
  {&__pyx_n_s_h, __pyx_k_h, sizeof(__pyx_k_h), 0, 0, 1, 1},
  {&__pyx_n_s_hand, __pyx_k_hand, sizeof(__pyx_k_hand), 0, 0, 1, 1},
  {&__pyx_n_s_height, __pyx_k_height, sizeof(__pyx_k_height), 0, 0, 1, 1},
  {&__pyx_n_s_help, __pyx_k_help, sizeof(__pyx_k_help), 0, 0, 1, 1},
  {&__pyx_n_s_help_text, __pyx_k_help_text, sizeof(__pyx_k_help_text), 0, 0, 1, 1},
  {&__pyx_n_s_hls_to_rgb, __pyx_k_hls_to_rgb, sizeof(__pyx_k_hls_to_rgb), 0, 0, 1, 1},
  {&__pyx_n_s_horo_var, __pyx_k_horo_var, sizeof(__pyx_k_horo_var), 0, 0, 1, 1},
  {&__pyx_n_s_horoballs, __pyx_k_horoballs, sizeof(__pyx_k_horoballs), 0, 0, 1, 1},
  {&__pyx_n_s_hue, __pyx_k_hue, sizeof(__pyx_k_hue), 0, 0, 1, 1},
  {&__pyx_n_s_imag, __pyx_k_imag, sizeof(__pyx_k_imag), 0, 0, 1, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
  {&__pyx_n_s_infodialog, __pyx_k_infodialog, sizeof(__pyx_k_infodialog), 0, 0, 1, 1},
  {&__pyx_n_s_init, __pyx_k_init, sizeof(__pyx_k_init), 0, 0, 1, 1},
  {&__pyx_n_s_initialised, __pyx_k_initialised, sizeof(__pyx_k_initialised), 0, 0, 1, 1},
  {&__pyx_n_s_int_label, __pyx_k_int_label, sizeof(__pyx_k_int_label), 0, 0, 1, 1},
  {&__pyx_n_s_join, __pyx_k_join, sizeof(__pyx_k_join), 0, 0, 1, 1},
  {&__pyx_n_s_key_action, __pyx_k_key_action, sizeof(__pyx_k_key_action), 0, 0, 1, 1},
  {&__pyx_n_s_keysym, __pyx_k_keysym, sizeof(__pyx_k_keysym), 0, 0, 1, 1},
  {&__pyx_n_s_klein_list_id, __pyx_k_klein_list_id, sizeof(__pyx_k_klein_list_id), 0, 0, 1, 1},
  {&__pyx_n_s_kw, __pyx_k_kw, sizeof(__pyx_k_kw), 0, 0, 1, 1},
  {&__pyx_n_s_label_var, __pyx_k_label_var, sizeof(__pyx_k_label_var), 0, 0, 1, 1},
  {&__pyx_n_s_lappend, __pyx_k_lappend, sizeof(__pyx_k_lappend), 0, 0, 1, 1},
  {&__pyx_n_s_lightness, __pyx_k_lightness, sizeof(__pyx_k_lightness), 0, 0, 1, 1},
  {&__pyx_n_s_linux, __pyx_k_linux, sizeof(__pyx_k_linux), 0, 0, 1, 1},
  {&__pyx_n_s_linux2, __pyx_k_linux2, sizeof(__pyx_k_linux2), 0, 0, 1, 1},
  {&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 0, 1, 1},
  {&__pyx_n_s_list_id, __pyx_k_list_id, sizeof(__pyx_k_list_id), 0, 0, 1, 1},
  {&__pyx_n_s_longitude, __pyx_k_longitude, sizeof(__pyx_k_longitude), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_major, __pyx_k_major, sizeof(__pyx_k_major), 0, 0, 1, 1},
  {&__pyx_n_s_makecurrent, __pyx_k_makecurrent, sizeof(__pyx_k_makecurrent), 0, 0, 1, 1},
  {&__pyx_n_s_master, __pyx_k_master, sizeof(__pyx_k_master), 0, 0, 1, 1},
  {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
  {&__pyx_n_s_meridian, __pyx_k_meridian, sizeof(__pyx_k_meridian), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_s_minor, __pyx_k_minor, sizeof(__pyx_k_minor), 0, 0, 1, 1},
  {&__pyx_n_s_model, __pyx_k_model, sizeof(__pyx_k_model), 0, 0, 1, 1},
  {&__pyx_n_s_model_var, __pyx_k_model_var, sizeof(__pyx_k_model_var), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_mouse_pick, __pyx_k_mouse_pick, sizeof(__pyx_k_mouse_pick), 0, 0, 1, 1},
  {&__pyx_n_s_mouse_rotate, __pyx_k_mouse_rotate, sizeof(__pyx_k_mouse_rotate), 0, 0, 1, 1},
  {&__pyx_n_s_mouse_scale, __pyx_k_mouse_scale, sizeof(__pyx_k_mouse_scale), 0, 0, 1, 1},
  {&__pyx_n_s_mouse_translate, __pyx_k_mouse_translate, sizeof(__pyx_k_mouse_translate), 0, 0, 1, 1},
  {&__pyx_n_s_mouse_update, __pyx_k_mouse_update, sizeof(__pyx_k_mouse_update), 0, 0, 1, 1},
  {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_nbhd, __pyx_k_nbhd, sizeof(__pyx_k_nbhd), 0, 0, 1, 1},
  {&__pyx_n_s_near, __pyx_k_near, sizeof(__pyx_k_near), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_new_triangles, __pyx_k_new_triangles, sizeof(__pyx_k_new_triangles), 0, 0, 1, 1},
  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
  {&__pyx_n_s_norm, __pyx_k_norm, sizeof(__pyx_k_norm), 0, 0, 1, 1},
  {&__pyx_n_s_norm_squared, __pyx_k_norm_squared, sizeof(__pyx_k_norm_squared), 0, 0, 1, 1},
  {&__pyx_n_s_num_cusps, __pyx_k_num_cusps, sizeof(__pyx_k_num_cusps), 0, 0, 1, 1},
  {&__pyx_n_s_objX, __pyx_k_objX, sizeof(__pyx_k_objX), 0, 0, 1, 1},
  {&__pyx_n_s_objY, __pyx_k_objY, sizeof(__pyx_k_objY), 0, 0, 1, 1},
  {&__pyx_n_s_objZ, __pyx_k_objZ, sizeof(__pyx_k_objZ), 0, 0, 1, 1},
  {&__pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_k_opengl_CyOpenGL_pyx, sizeof(__pyx_k_opengl_CyOpenGL_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_original_index, __pyx_k_original_index, sizeof(__pyx_k_original_index), 0, 0, 1, 1},
  {&__pyx_n_s_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 0, 1, 1},
  {&__pyx_n_s_package, __pyx_k_package, sizeof(__pyx_k_package), 0, 0, 1, 1},
  {&__pyx_n_s_path, __pyx_k_path, sizeof(__pyx_k_path), 0, 0, 1, 1},
  {&__pyx_n_s_pgram_var, __pyx_k_pgram_var, sizeof(__pyx_k_pgram_var), 0, 0, 1, 1},
  {&__pyx_n_s_phi, __pyx_k_phi, sizeof(__pyx_k_phi), 0, 0, 1, 1},
  {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},
  {&__pyx_n_s_pick, __pyx_k_pick, sizeof(__pyx_k_pick), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_platform, __pyx_k_platform, sizeof(__pyx_k_platform), 0, 0, 1, 1},
  {&__pyx_n_s_poincare_list_id, __pyx_k_poincare_list_id, sizeof(__pyx_k_poincare_list_id), 0, 0, 1, 1},
  {&__pyx_n_s_position, __pyx_k_position, sizeof(__pyx_k_position), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_proj, __pyx_k_proj, sizeof(__pyx_k_proj), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_HoroballGroup, __pyx_k_pyx_unpickle_HoroballGroup, sizeof(__pyx_k_pyx_unpickle_HoroballGroup), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_HoroballScene, __pyx_k_pyx_unpickle_HoroballScene, sizeof(__pyx_k_pyx_unpickle_HoroballScene), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_Label, __pyx_k_pyx_unpickle_Label, sizeof(__pyx_k_pyx_unpickle_Label), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_r, __pyx_k_r, sizeof(__pyx_k_r), 0, 0, 1, 1},
  {&__pyx_n_s_r_back, __pyx_k_r_back, sizeof(__pyx_k_r_back), 0, 0, 1, 1},
  {&__pyx_n_s_radius, __pyx_k_radius, sizeof(__pyx_k_radius), 0, 0, 1, 1},
  {&__pyx_n_s_random, __pyx_k_random, sizeof(__pyx_k_random), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_real, __pyx_k_real, sizeof(__pyx_k_real), 0, 0, 1, 1},
  {&__pyx_n_s_redraw, __pyx_k_redraw, sizeof(__pyx_k_redraw), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_repr, __pyx_k_repr, sizeof(__pyx_k_repr), 0, 0, 1, 1},
  {&__pyx_n_s_require, __pyx_k_require, sizeof(__pyx_k_require), 0, 0, 1, 1},
  {&__pyx_n_s_reset, __pyx_k_reset, sizeof(__pyx_k_reset), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1},
  {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1},
  {&__pyx_n_s_round, __pyx_k_round, sizeof(__pyx_k_round), 0, 0, 1, 1},
  {&__pyx_n_s_s1, __pyx_k_s1, sizeof(__pyx_k_s1), 0, 0, 1, 1},
  {&__pyx_n_s_s2, __pyx_k_s2, sizeof(__pyx_k_s2), 0, 0, 1, 1},
  {&__pyx_kp_s_s_s_s, __pyx_k_s_s_s, sizeof(__pyx_k_s_s_s), 0, 0, 1, 0},
  {&__pyx_n_s_saturation, __pyx_k_saturation, sizeof(__pyx_k_saturation), 0, 0, 1, 1},
  {&__pyx_n_s_scale, __pyx_k_scale, sizeof(__pyx_k_scale), 0, 0, 1, 1},
  {&__pyx_n_s_segments, __pyx_k_segments, sizeof(__pyx_k_segments), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_n_s_send, __pyx_k_send, sizeof(__pyx_k_send), 0, 0, 1, 1},
  {&__pyx_n_s_set_background, __pyx_k_set_background, sizeof(__pyx_k_set_background), 0, 0, 1, 1},
  {&__pyx_n_s_set_centerpoint, __pyx_k_set_centerpoint, sizeof(__pyx_k_set_centerpoint), 0, 0, 1, 1},
  {&__pyx_n_s_set_cutoff, __pyx_k_set_cutoff, sizeof(__pyx_k_set_cutoff), 0, 0, 1, 1},
  {&__pyx_n_s_set_eyepoint, __pyx_k_set_eyepoint, sizeof(__pyx_k_set_eyepoint), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_shifts, __pyx_k_shifts, sizeof(__pyx_k_shifts), 0, 0, 1, 1},
  {&__pyx_n_s_sin, __pyx_k_sin, sizeof(__pyx_k_sin), 0, 0, 1, 1},
  {&__pyx_n_s_slices, __pyx_k_slices, sizeof(__pyx_k_slices), 0, 0, 1, 1},
  {&__pyx_n_s_sphere, __pyx_k_sphere, sizeof(__pyx_k_sphere), 0, 0, 1, 1},
  {&__pyx_n_s_sphere_list_id, __pyx_k_sphere_list_id, sizeof(__pyx_k_sphere_list_id), 0, 0, 1, 1},
  {&__pyx_n_s_sphere_var, __pyx_k_sphere_var, sizeof(__pyx_k_sphere_var), 0, 0, 1, 1},
  {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
  {&__pyx_n_s_stacks, __pyx_k_stacks, sizeof(__pyx_k_stacks), 0, 0, 1, 1},
  {&__pyx_n_s_string, __pyx_k_string, sizeof(__pyx_k_string), 0, 0, 1, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_subdivide, __pyx_k_subdivide, sizeof(__pyx_k_subdivide), 0, 0, 1, 1},
  {&__pyx_n_s_subdivision_depth, __pyx_k_subdivision_depth, sizeof(__pyx_k_subdivision_depth), 0, 0, 1, 1},
  {&__pyx_n_s_suffix, __pyx_k_suffix, sizeof(__pyx_k_suffix), 0, 0, 1, 1},
  {&__pyx_n_s_sum, __pyx_k_sum, sizeof(__pyx_k_sum), 0, 0, 1, 1},
  {&__pyx_n_s_swapbuffers, __pyx_k_swapbuffers, sizeof(__pyx_k_swapbuffers), 0, 0, 1, 1},
  {&__pyx_n_s_sys, __pyx_k_sys, sizeof(__pyx_k_sys), 0, 0, 1, 1},
  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
  {&__pyx_n_s_tan, __pyx_k_tan, sizeof(__pyx_k_tan), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 0, 1, 1},
  {&__pyx_n_s_throw, __pyx_k_throw, sizeof(__pyx_k_throw), 0, 0, 1, 1},
  {&__pyx_n_s_time, __pyx_k_time, sizeof(__pyx_k_time), 0, 0, 1, 1},
  {&__pyx_kp_s_tk, __pyx_k_tk, sizeof(__pyx_k_tk), 0, 0, 1, 0},
  {&__pyx_n_s_tkAutoSpin, __pyx_k_tkAutoSpin, sizeof(__pyx_k_tkAutoSpin), 0, 0, 1, 1},
  {&__pyx_n_s_tkExpose, __pyx_k_tkExpose, sizeof(__pyx_k_tkExpose), 0, 0, 1, 1},
  {&__pyx_n_s_tkHandlePick, __pyx_k_tkHandlePick, sizeof(__pyx_k_tkHandlePick), 0, 0, 1, 1},
  {&__pyx_n_s_tkKeyPress, __pyx_k_tkKeyPress, sizeof(__pyx_k_tkKeyPress), 0, 0, 1, 1},
  {&__pyx_n_s_tkMap, __pyx_k_tkMap, sizeof(__pyx_k_tkMap), 0, 0, 1, 1},
  {&__pyx_n_s_tkPrint, __pyx_k_tkPrint, sizeof(__pyx_k_tkPrint), 0, 0, 1, 1},
  {&__pyx_n_s_tkRecordMouse, __pyx_k_tkRecordMouse, sizeof(__pyx_k_tkRecordMouse), 0, 0, 1, 1},
  {&__pyx_n_s_tkRedraw, __pyx_k_tkRedraw, sizeof(__pyx_k_tkRedraw), 0, 0, 1, 1},
  {&__pyx_n_s_tkRotate, __pyx_k_tkRotate, sizeof(__pyx_k_tkRotate), 0, 0, 1, 1},
  {&__pyx_n_s_tkScale, __pyx_k_tkScale, sizeof(__pyx_k_tkScale), 0, 0, 1, 1},
  {&__pyx_n_s_tkTranslate, __pyx_k_tkTranslate, sizeof(__pyx_k_tkTranslate), 0, 0, 1, 1},
  {&__pyx_n_s_tk_2, __pyx_k_tk_2, sizeof(__pyx_k_tk_2), 0, 0, 1, 1},
  {&__pyx_n_s_tk_version, __pyx_k_tk_version, sizeof(__pyx_k_tk_version), 0, 0, 1, 1},
  {&__pyx_n_s_tkinter, __pyx_k_tkinter, sizeof(__pyx_k_tkinter), 0, 0, 1, 1},
  {&__pyx_n_s_tmouse, __pyx_k_tmouse, sizeof(__pyx_k_tmouse), 0, 0, 1, 1},
  {&__pyx_n_s_togl, __pyx_k_togl, sizeof(__pyx_k_togl), 0, 0, 1, 1},
  {&__pyx_n_s_top, __pyx_k_top, sizeof(__pyx_k_top), 0, 0, 1, 1},
  {&__pyx_n_s_translations, __pyx_k_translations, sizeof(__pyx_k_translations), 0, 0, 1, 1},
  {&__pyx_n_s_tri_var, __pyx_k_tri_var, sizeof(__pyx_k_tri_var), 0, 0, 1, 1},
  {&__pyx_n_s_triangle, __pyx_k_triangle, sizeof(__pyx_k_triangle), 0, 0, 1, 1},
  {&__pyx_n_s_triangles, __pyx_k_triangles, sizeof(__pyx_k_triangles), 0, 0, 1, 1},
  {&__pyx_n_s_triangulation, __pyx_k_triangulation, sizeof(__pyx_k_triangulation), 0, 0, 1, 1},
  {&__pyx_n_s_triple, __pyx_k_triple, sizeof(__pyx_k_triple), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_s_update_idletasks, __pyx_k_update_idletasks, sizeof(__pyx_k_update_idletasks), 0, 0, 1, 1},
  {&__pyx_n_s_use_material, __pyx_k_use_material, sizeof(__pyx_k_use_material), 0, 0, 1, 1},
  {&__pyx_n_s_vector3, __pyx_k_vector3, sizeof(__pyx_k_vector3), 0, 0, 1, 1},
  {&__pyx_kp_u_vector3_0_1_2_0_0_1_0_2_0, __pyx_k_vector3_0_1_2_0_0_1_0_2_0, sizeof(__pyx_k_vector3_0_1_2_0_0_1_0_2_0), 0, 1, 0, 0},
  {&__pyx_kp_u_vector3___repr___line_51, __pyx_k_vector3___repr___line_51, sizeof(__pyx_k_vector3___repr___line_51), 0, 1, 0, 0},
  {&__pyx_n_s_version_info, __pyx_k_version_info, sizeof(__pyx_k_version_info), 0, 0, 1, 1},
  {&__pyx_n_s_vertex, __pyx_k_vertex, sizeof(__pyx_k_vertex), 0, 0, 1, 1},
  {&__pyx_n_s_vertices, __pyx_k_vertices, sizeof(__pyx_k_vertices), 0, 0, 1, 1},
  {&__pyx_n_s_view, __pyx_k_view, sizeof(__pyx_k_view), 0, 0, 1, 1},
  {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
  {&__pyx_n_s_w_2, __pyx_k_w_2, sizeof(__pyx_k_w_2), 0, 0, 1, 1},
  {&__pyx_n_s_which_cusp, __pyx_k_which_cusp, sizeof(__pyx_k_which_cusp), 0, 0, 1, 1},
  {&__pyx_n_s_width, __pyx_k_width, sizeof(__pyx_k_width), 0, 0, 1, 1},
  {&__pyx_n_s_win32, __pyx_k_win32, sizeof(__pyx_k_win32), 0, 0, 1, 1},
  {&__pyx_n_s_windows_version, __pyx_k_windows_version, sizeof(__pyx_k_windows_version), 0, 0, 1, 1},
  {&__pyx_n_s_winfo_height, __pyx_k_winfo_height, sizeof(__pyx_k_winfo_height), 0, 0, 1, 1},
  {&__pyx_n_s_winfo_width, __pyx_k_winfo_width, sizeof(__pyx_k_winfo_width), 0, 0, 1, 1},
  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
  {&__pyx_kp_s_x86_64, __pyx_k_x86_64, sizeof(__pyx_k_x86_64), 0, 0, 1, 0},
  {&__pyx_n_s_xcenter, __pyx_k_xcenter, sizeof(__pyx_k_xcenter), 0, 0, 1, 1},
  {&__pyx_n_s_xmax, __pyx_k_xmax, sizeof(__pyx_k_xmax), 0, 0, 1, 1},
  {&__pyx_n_s_xmouse, __pyx_k_xmouse, sizeof(__pyx_k_xmouse), 0, 0, 1, 1},
  {&__pyx_n_s_xy, __pyx_k_xy, sizeof(__pyx_k_xy), 0, 0, 1, 1},
  {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
  {&__pyx_n_s_ycenter, __pyx_k_ycenter, sizeof(__pyx_k_ycenter), 0, 0, 1, 1},
  {&__pyx_n_s_ymax, __pyx_k_ymax, sizeof(__pyx_k_ymax), 0, 0, 1, 1},
  {&__pyx_n_s_ymouse, __pyx_k_ymouse, sizeof(__pyx_k_ymouse), 0, 0, 1, 1},
  {&__pyx_n_s_yymax, __pyx_k_yymax, sizeof(__pyx_k_yymax), 0, 0, 1, 1},
  {&__pyx_n_s_yz, __pyx_k_yz, sizeof(__pyx_k_yz), 0, 0, 1, 1},
  {&__pyx_n_s_z, __pyx_k_z, sizeof(__pyx_k_z), 0, 0, 1, 1},
  {&__pyx_n_s_zcenter, __pyx_k_zcenter, sizeof(__pyx_k_zcenter), 0, 0, 1, 1},
  {&__pyx_n_s_zip, __pyx_k_zip, sizeof(__pyx_k_zip), 0, 0, 1, 1},
  {&__pyx_n_s_zoom, __pyx_k_zoom, sizeof(__pyx_k_zoom), 0, 0, 1, 1},
  {&__pyx_n_s_zx, __pyx_k_zx, sizeof(__pyx_k_zx), 0, 0, 1, 1},
  {0, 0, 0, 0, 0, 0, 0}
};
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(0, 30, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 31, __pyx_L1_error)
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 36, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 212, __pyx_L1_error)
  __pyx_builtin_zip = __Pyx_GetBuiltinName(__pyx_n_s_zip); if (!__pyx_builtin_zip) __PYX_ERR(0, 288, __pyx_L1_error)
  __pyx_builtin_sum = __Pyx_GetBuiltinName(__pyx_n_s_sum); if (!__pyx_builtin_sum) __PYX_ERR(0, 370, __pyx_L1_error)
  __pyx_builtin_round = __Pyx_GetBuiltinName(__pyx_n_s_round); if (!__pyx_builtin_round) __PYX_ERR(0, 645, __pyx_L1_error)
  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(1, 81, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 84, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 94, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "CyOpenGL.pyx":31
 *         result = <const char*>glGetString(enumdict[string])
 *     except KeyError:
 *         raise ValueError(             # <<<<<<<<<<<<<<
 *             "Invalid enum. Must be 'GL_VENDOR', 'GL_RENDERER', 'GL_VERSION', or 'GL_EXTENSIONS'")
 *     if result:
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_Invalid_enum_Must_be_GL_VENDOR_G); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 31, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "CyOpenGL.pyx":36
 *         return result
 *     else:
 *         raise RuntimeError('No result - is there a current OpenGL context?')             # <<<<<<<<<<<<<<
 * 
 * cdef class vector3:
 */
  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_No_result_is_there_a_current_Ope); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 36, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "CyOpenGL.pyx":206
 *         dtheta = 2*pi/slices
 *         dphi = pi/stacks
 *         def draw_point(phi, theta):             # <<<<<<<<<<<<<<
 *             x, y, z = sin(phi)*sin(theta), sin(phi)*cos(theta), cos(phi)
 *             glNormal3f(x, y, z)
 */
  __pyx_tuple__12 = PyTuple_Pack(5, __pyx_n_s_phi, __pyx_n_s_theta, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);
  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_draw_point, 206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 206, __pyx_L1_error)

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "CyOpenGL.pyx":234
 *     def __init__(self, vertices):
 *         self.vertices = vertices
 *         self.triangles = [(0,1,2)]             # <<<<<<<<<<<<<<
 * 
 *     def __repr__(self):
 */
  __pyx_tuple__16 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_1, __pyx_int_2); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "CyOpenGL.pyx":367
 *     cdef triangulate(self):
 *         Vlist = self.vertices
 *         zero = vector3((0,0,0))             # <<<<<<<<<<<<<<
 *         N = len(Vlist)
 *         self.triangles = []
 */
  __pyx_tuple__21 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_tuple__21); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 367, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "CyOpenGL.pyx":430
 *          closest = vector3(dict['closest'])
 *          center = closest*(1/dict['distance']**2)
 *          color = hls_to_rgb(dict['hue'], 0.5, 1.0) + (1.0,)             # <<<<<<<<<<<<<<
 *          self.Klein_faces.append(
 *              KleinPolygon(vertices, closest,
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_float_1_0); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(0, 430, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "CyOpenGL.pyx":573
 *                 verts.append((r*cos(theta), r*sin(theta), z))
 *                 theta += dtheta
 *         verts += [(0, 0, 1), (0, 0, -1)]             # <<<<<<<<<<<<<<
 *         assert len(verts) == a*b - b + 2
 * 
 */
  __pyx_tuple__33 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_1); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);
  __pyx_tuple__34 = PyTuple_Pack(3, __pyx_int_0, __pyx_int_0, __pyx_int_neg_1); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(0, 573, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 2, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "(tree fragment)":4
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError("no default __reduce__ due to non-trivial __cinit__")             # <<<<<<<<<<<<<<
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "CyOpenGL.pyx":1051
 *         curr_platform = sys.platform
 *         cpu_width = platform.architecture()[0]
 *         if curr_platform[:5] == 'linux':             # <<<<<<<<<<<<<<
 *             curr_platform = 'linux2'
 *         if curr_platform[:5] == "linux" and cpu_width == '64bit':
 */
  __pyx_slice__47 = PySlice_New(Py_None, __pyx_int_5, Py_None); if (unlikely(!__pyx_slice__47)) __PYX_ERR(0, 1051, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_slice__47);
  __Pyx_GIVEREF(__pyx_slice__47);

  /* "CyOpenGL.pyx":1057
 *         if curr_platform == 'win32':
 *             windows_version = sys.getwindowsversion()
 *             if (windows_version.major, windows_version.minor) > (6,0):             # <<<<<<<<<<<<<<
 *                 curr_platform += 'VC'
 *             if cpu_width == '64bit':
 */
  __pyx_tuple__48 = PyTuple_Pack(2, __pyx_int_6, __pyx_int_0); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(0, 1057, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);

  /* "CyOpenGL.pyx":1068
 *         master.tk.call('lappend', 'auto_path', Togl_path)
 *         try:
 *             master.tk.call('package', 'require', 'Togl')             # <<<<<<<<<<<<<<
 *         except Tk_.TclError:
 *             raise RuntimeError('Tcl can not find Togl even though directory %s exists' % Togl_path)
 */
  __pyx_tuple__49 = PyTuple_Pack(3, __pyx_n_s_package, __pyx_n_s_require, __pyx_n_s_Togl); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 1068, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "CyOpenGL.pyx":1244
 * 
 *         if hasattr(self, 'pick'):
 *             raise ValueError('Sorry, this implementation was removed')             # <<<<<<<<<<<<<<
 *             # See GLU/README.txt for how to restore.
 *             #
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_Sorry_this_implementation_was_re); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(0, 1244, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "CyOpenGL.pyx":22
 *     import tkinter as Tk_
 * 
 * def GetString(string):             # <<<<<<<<<<<<<<
 *     enumdict = {
 *         'GL_VENDOR': GL_VENDOR,
 */
  __pyx_tuple__52 = PyTuple_Pack(3, __pyx_n_s_string, __pyx_n_s_enumdict, __pyx_n_s_result); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);
  __pyx_codeobj__53 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__52, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_GetString, 22, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__53)) __PYX_ERR(0, 22, __pyx_L1_error)

  /* "CyOpenGL.pyx":232
 *     A triangle which can tessellate itself.
 *     """
 *     def __init__(self, vertices):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.triangles = [(0,1,2)]
 */
  __pyx_tuple__54 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_vertices); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);
  __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_init, 232, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(0, 232, __pyx_L1_error)

  /* "CyOpenGL.pyx":236
 *         self.triangles = [(0,1,2)]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self.triangles)
 * 
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);
  __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_repr, 236, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(0, 236, __pyx_L1_error)

  /* "CyOpenGL.pyx":239
 *         return str(self.triangles)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         x, y, z = self.triangles[n]
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 */
  __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_n, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);
  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(2, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_getitem, 239, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 239, __pyx_L1_error)

  /* "CyOpenGL.pyx":243
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 * 
 *     def subdivide(self):             # <<<<<<<<<<<<<<
 *         """
 *         Replace each triangle by four triangles:
 */
  __pyx_tuple__60 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_new_triangles, __pyx_n_s_V, __pyx_n_s_triangle, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z, __pyx_n_s_n, __pyx_n_s_xy, __pyx_n_s_yz, __pyx_n_s_zx); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);
  __pyx_codeobj__61 = (PyObject*)__Pyx_PyCode_New(1, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_subdivide, 243, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__61)) __PYX_ERR(0, 243, __pyx_L1_error)

  /* "CyOpenGL.pyx":412
 *    """
 * 
 *    def __init__(self, facedicts, model_var, sphere_var):             # <<<<<<<<<<<<<<
 *      self.facedicts = facedicts
 *      self.model = model_var
 */
  __pyx_tuple__62 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_facedicts, __pyx_n_s_model_var, __pyx_n_s_sphere_var, __pyx_n_s_dict_2, __pyx_n_s_vertices, __pyx_n_s_closest, __pyx_n_s_center, __pyx_n_s_color, __pyx_n_s_vertex); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);
  __pyx_codeobj__63 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_init, 412, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__63)) __PYX_ERR(0, 412, __pyx_L1_error)

  /* "CyOpenGL.pyx":450
 *      self.build_poincare_poly(self.poincare_list_id)
 * 
 *    def destroy(self):             # <<<<<<<<<<<<<<
 *        glDeleteLists(self.sphere_list_id, 1)
 *        glDeleteLists(self.klein_list_id, 1)
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);
  __pyx_codeobj__65 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_destroy, 450, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__65)) __PYX_ERR(0, 450, __pyx_L1_error)

  /* "CyOpenGL.pyx":455
 *        glDeleteLists(self.poincare_list_id, 1)
 * 
 *    def draw(self, *args):             # <<<<<<<<<<<<<<
 *        model = self.model.get()
 *        if model == 'Klein':
 */
  __pyx_tuple__66 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_args, __pyx_n_s_model); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);
  __pyx_codeobj__67 = (PyObject*)__Pyx_PyCode_New(1, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__66, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_draw, 455, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__67)) __PYX_ERR(0, 455, __pyx_L1_error)

  /* "CyOpenGL.pyx":464
 *            glCallList(self.sphere_list_id)
 * 
 *    def build_klein_poly(self, list):             # <<<<<<<<<<<<<<
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Klein_faces:
 */
  __pyx_tuple__68 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_list, __pyx_n_s_face); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);
  __pyx_codeobj__69 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__68, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_build_klein_poly, 464, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__69)) __PYX_ERR(0, 464, __pyx_L1_error)

  /* "CyOpenGL.pyx":470
 *      glEndList()
 * 
 *    def build_poincare_poly(self, list):             # <<<<<<<<<<<<<<
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Poincare_faces:
 */
  __pyx_tuple__70 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_list, __pyx_n_s_face); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);
  __pyx_codeobj__71 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__70, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_build_poincare_poly, 470, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__71)) __PYX_ERR(0, 470, __pyx_L1_error)

  /* "CyOpenGL.pyx":1048
 *     """
 * 
 *     def __init__(self, master, cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         curr_platform = sys.platform
 *         cpu_width = platform.architecture()[0]
 */
  __pyx_tuple__72 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_master, __pyx_n_s_cnf, __pyx_n_s_kw, __pyx_n_s_curr_platform, __pyx_n_s_cpu_width, __pyx_n_s_windows_version, __pyx_n_s_suffix, __pyx_n_s_Togl_path); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);
  __pyx_codeobj__73 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__72, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_init, 1048, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__73)) __PYX_ERR(0, 1048, __pyx_L1_error)

  /* "CyOpenGL.pyx":1078
 *         self.bind('<Configure>', self.tkExpose)
 * 
 *     def tkRedraw(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.update_idletasks()
 *         self.tk.call(self._w, 'makecurrent')
 */
  __pyx_tuple__74 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dummy); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);
  __pyx_codeobj__75 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__74, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkRedraw, 1078, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__75)) __PYX_ERR(0, 1078, __pyx_L1_error)

  /* "CyOpenGL.pyx":1085
 *         glPopMatrix()
 * 
 *     def tkMap(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.tkExpose()
 * 
 */
  __pyx_tuple__76 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dummy); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(0, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);
  __pyx_codeobj__77 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__76, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkMap, 1085, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__77)) __PYX_ERR(0, 1085, __pyx_L1_error)

  /* "CyOpenGL.pyx":1088
 *         self.tkExpose()
 * 
 *     def tkExpose(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 * 
 */
  __pyx_tuple__78 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dummy); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);
  __pyx_codeobj__79 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__78, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkExpose, 1088, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__79)) __PYX_ERR(0, 1088, __pyx_L1_error)

  /* "CyOpenGL.pyx":1100
 *     """
 * 
 *     def __init__(self, master=None, help='No help is available.',             # <<<<<<<<<<<<<<
 *                  mouse_pick=False, mouse_rotate=True, mouse_translate=False,
 *                  mouse_scale=False,
 */
  __pyx_tuple__80 = PyTuple_Pack(12, __pyx_n_s_self, __pyx_n_s_master, __pyx_n_s_help, __pyx_n_s_mouse_pick, __pyx_n_s_mouse_rotate, __pyx_n_s_mouse_translate, __pyx_n_s_mouse_scale, __pyx_n_s_fovy, __pyx_n_s_near, __pyx_n_s_far, __pyx_n_s_cnf, __pyx_n_s_kw); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(0, 1100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);
  __pyx_codeobj__81 = (PyObject*)__Pyx_PyCode_New(11, 0, 12, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__80, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_init, 1100, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__81)) __PYX_ERR(0, 1100, __pyx_L1_error)

  /* "CyOpenGL.pyx":1181
 *             self.bind('<KeyPress>', self.tkKeyPress)
 * 
 *     def help(self):             # <<<<<<<<<<<<<<
 *         """
 *         Help message for the widget.
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);
  __pyx_codeobj__83 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__82, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_help, 1181, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__83)) __PYX_ERR(0, 1181, __pyx_L1_error)

  /* "CyOpenGL.pyx":1187
 *         InfoDialog(self, 'Viewer Help', self.help_text)
 * 
 *     def activate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cause this OpenGLWidget to be the current destination for
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(0, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);
  __pyx_codeobj__85 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__84, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_activate, 1187, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__85)) __PYX_ERR(0, 1187, __pyx_L1_error)

  /* "CyOpenGL.pyx":1197
 *         #self.focus_set()
 * 
 *     def set_background(self, r, g, b):             # <<<<<<<<<<<<<<
 *         """
 *         Change the background colour of the widget.
 */
  __pyx_tuple__86 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_r, __pyx_n_s_g, __pyx_n_s_b); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(0, 1197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);
  __pyx_codeobj__87 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__86, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_set_background, 1197, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__87)) __PYX_ERR(0, 1197, __pyx_L1_error)

  /* "CyOpenGL.pyx":1206
 *         self.tkRedraw()
 * 
 *     def set_centerpoint(self, x, y, z):             # <<<<<<<<<<<<<<
 *         """
 *         Set the new center point for the model.
 */
  __pyx_tuple__88 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_z); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);
  __pyx_codeobj__89 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__88, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_set_centerpoint, 1206, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__89)) __PYX_ERR(0, 1206, __pyx_L1_error)

  /* "CyOpenGL.pyx":1216
 *         self.tkRedraw()
 * 
 *     def set_eyepoint(self, distance):             # <<<<<<<<<<<<<<
 *         """
 *         Set how far the eye is from the position we are looking.
 */
  __pyx_tuple__90 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_distance); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(0, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);
  __pyx_codeobj__91 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__90, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_set_eyepoint, 1216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__91)) __PYX_ERR(0, 1216, __pyx_L1_error)

  /* "CyOpenGL.pyx":1223
 *         self.tkRedraw()
 * 
 *     def reset(self, redraw=True):             # <<<<<<<<<<<<<<
 *         """
 *         Reset rotation matrix for this widget.
 */
  __pyx_tuple__92 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_redraw); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);
  __pyx_codeobj__93 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__92, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_reset, 1223, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__93)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __pyx_tuple__94 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "CyOpenGL.pyx":1234
 *             self.tkRedraw()
 * 
 *     def tkHandlePick(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle a pick on the scene.
 */
  __pyx_tuple__95 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_objX, __pyx_n_s_objY, __pyx_n_s_objZ, __pyx_n_s_model, __pyx_n_s_proj, __pyx_n_s_view); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);
  __pyx_codeobj__96 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__95, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkHandlePick, 1234, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__96)) __PYX_ERR(0, 1234, __pyx_L1_error)

  /* "CyOpenGL.pyx":1266
 *             #     self.tkRedraw()
 * 
 *     def tkRecordMouse(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Record the current mouse position.
 */
  __pyx_tuple__97 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_event); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(0, 1266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);
  __pyx_codeobj__98 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__97, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkRecordMouse, 1266, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__98)) __PYX_ERR(0, 1266, __pyx_L1_error)

  /* "CyOpenGL.pyx":1273
 *         self.xmouse, self.ymouse, self.tmouse = event.x, event.y, event.time
 * 
 *     def StartRotate(self, event):             # <<<<<<<<<<<<<<
 *         # Switch off any autospinning if it was happening
 *         self.autospin = 0
 */
  __pyx_tuple__99 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_event); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);
  __pyx_codeobj__100 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__99, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_StartRotate, 1273, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__100)) __PYX_ERR(0, 1273, __pyx_L1_error)

  /* "CyOpenGL.pyx":1278
 *         self.tkRecordMouse(event)
 * 
 *     def tkScale(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Scale the scene.  Achieved by moving the eye position
 */
  __pyx_tuple__101 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_scale); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);
  __pyx_codeobj__102 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__101, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkScale, 1278, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__102)) __PYX_ERR(0, 1278, __pyx_L1_error)

  /* "CyOpenGL.pyx":1288
 *         self.tkRecordMouse(event)
 * 
 *     def zoom(self, x):             # <<<<<<<<<<<<<<
 *         t = float(x)/100.0
 *         self.distance = t*2.0 + (1-t)*10.0
 */
  __pyx_tuple__103 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_x, __pyx_n_s_t); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);
  __pyx_codeobj__104 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__103, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_zoom, 1288, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__104)) __PYX_ERR(0, 1288, __pyx_L1_error)

  /* "CyOpenGL.pyx":1293
 *         self.tkRedraw()
 * 
 *     def do_AutoSpin(self):             # <<<<<<<<<<<<<<
 *         self.activate()
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(0, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);
  __pyx_codeobj__106 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__105, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_do_AutoSpin, 1293, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__106)) __PYX_ERR(0, 1293, __pyx_L1_error)

  /* "CyOpenGL.pyx":1302
 *             self.after(10, self.do_AutoSpin)
 * 
 *     def tkAutoSpin(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform autospin of scene.
 */
  __pyx_tuple__107 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_event); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);
  __pyx_codeobj__108 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__107, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkAutoSpin, 1302, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__108)) __PYX_ERR(0, 1302, __pyx_L1_error)

  /* "CyOpenGL.pyx":1311
 *         self.update_idletasks()
 * 
 *     def tkRotate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform rotation of scene.
 */
  __pyx_tuple__109 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_event, __pyx_n_s_Xangle, __pyx_n_s_Yangle); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);
  __pyx_codeobj__110 = (PyObject*)__Pyx_PyCode_New(2, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__109, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkRotate, 1311, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__110)) __PYX_ERR(0, 1311, __pyx_L1_error)

  /* "CyOpenGL.pyx":1324
 *         self.tkRecordMouse(event)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
 */
  __pyx_tuple__111 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_event); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);
  __pyx_codeobj__112 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__111, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkTranslate, 1324, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__112)) __PYX_ERR(0, 1324, __pyx_L1_error)

  /* "CyOpenGL.pyx":1333
 *         self.tkRecordMouse(event)
 * 
 *     def mouse_update(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw the scene and save the mouse coordinates.
 */
  __pyx_tuple__113 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_event); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);
  __pyx_codeobj__114 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__113, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_mouse_update, 1333, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__114)) __PYX_ERR(0, 1333, __pyx_L1_error)

  /* "CyOpenGL.pyx":1340
 *         self.tkRecordMouse(event)
 * 
 *     def tkRedraw(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Cause the opengl widget to redraw itself.
 */
  __pyx_tuple__115 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_dummy, __pyx_n_s_w_2, __pyx_n_s_h); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);
  __pyx_codeobj__116 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__115, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkRedraw, 1340, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__116)) __PYX_ERR(0, 1340, __pyx_L1_error)

  /* "CyOpenGL.pyx":1363
 *         self.tk.call(self._w, 'swapbuffers')
 * 
 *     def build_projection(self, width, height):             # <<<<<<<<<<<<<<
 *         cdef GLdouble xmax, yymax, near, far
 *         aspect = float(width)/float(height)
 */
  __pyx_tuple__117 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_xmax, __pyx_n_s_yymax, __pyx_n_s_near, __pyx_n_s_far, __pyx_n_s_aspect, __pyx_n_s_ymax); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(0, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);
  __pyx_codeobj__118 = (PyObject*)__Pyx_PyCode_New(3, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__117, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_build_projection, 1363, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__118)) __PYX_ERR(0, 1363, __pyx_L1_error)

  /* "CyOpenGL.pyx":1376
 *         glMatrixMode(GL_MODELVIEW)
 * 
 *     def tkMap(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Cause the opengl widget to redraw itself.
 */
  __pyx_tuple__119 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dummy); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(0, 1376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);
  __pyx_codeobj__120 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__119, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkMap, 1376, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__120)) __PYX_ERR(0, 1376, __pyx_L1_error)

  /* "CyOpenGL.pyx":1382
 *         self.tkExpose()
 * 
 *     def tkExpose(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw the widget.  Make it active, update tk events, call redraw
 */
  __pyx_tuple__121 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_dummy); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);
  __pyx_codeobj__122 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARARGS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__121, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkExpose, 1382, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__122)) __PYX_ERR(0, 1382, __pyx_L1_error)

  /* "CyOpenGL.pyx":1393
 *         self.tkRedraw()
 * 
 *     def tkKeyPress(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle keyboard events.
 */
  __pyx_tuple__123 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_event); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);
  __pyx_codeobj__124 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__123, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkKeyPress, 1393, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__124)) __PYX_ERR(0, 1393, __pyx_L1_error)

  /* "CyOpenGL.pyx":1404
 *             self.tkRedraw()
 * 
 *     def tkPrint(self, file):             # <<<<<<<<<<<<<<
 *         """
 *         Turn the current scene into PostScript via the feedback buffer.
 */
  __pyx_tuple__125 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_file); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(0, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);
  __pyx_codeobj__126 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__125, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkPrint, 1404, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__126)) __PYX_ERR(0, 1404, __pyx_L1_error)

  /* "CyOpenGL.pyx":1417
 *     """
 * 
 *     def build_projection(self, width, height, t=1.0):             # <<<<<<<<<<<<<<
 *         aspect = float(width)/float(height)
 *         top = self.fovy/2
 */
  __pyx_tuple__127 = PyTuple_Pack(7, __pyx_n_s_self, __pyx_n_s_width, __pyx_n_s_height, __pyx_n_s_t, __pyx_n_s_aspect, __pyx_n_s_top, __pyx_n_s_right); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_codeobj__128 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__127, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_build_projection, 1417, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__128)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __pyx_tuple__129 = PyTuple_Pack(1, ((PyObject*)__pyx_float_1_0)); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);

  /* "CyOpenGL.pyx":1434
 *         glMatrixMode(GL_MODELVIEW)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
 */
  __pyx_tuple__130 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_event); if (unlikely(!__pyx_tuple__130)) __PYX_ERR(0, 1434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__130);
  __Pyx_GIVEREF(__pyx_tuple__130);
  __pyx_codeobj__131 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__130, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_tkTranslate, 1434, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__131)) __PYX_ERR(0, 1434, __pyx_L1_error)

  /* "CyOpenGL.pyx":1441
 *         self.tkRecordMouse(event)
 * 
 *     def redraw(self):             # <<<<<<<<<<<<<<
 *         pass
 */
  __pyx_tuple__132 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__132)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__132);
  __Pyx_GIVEREF(__pyx_tuple__132);
  __pyx_codeobj__133 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__132, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_opengl_CyOpenGL_pyx, __pyx_n_s_redraw, 1441, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__133)) __PYX_ERR(0, 1441, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle_HoroballGroup(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__134 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__134)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__134);
  __Pyx_GIVEREF(__pyx_tuple__134);
  __pyx_codeobj__135 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__134, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_HoroballGroup, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__135)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_tuple__136 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__136)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__136);
  __Pyx_GIVEREF(__pyx_tuple__136);
  __pyx_codeobj__137 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__136, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Label, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__137)) __PYX_ERR(1, 1, __pyx_L1_error)
  __pyx_tuple__138 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__138)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__138);
  __Pyx_GIVEREF(__pyx_tuple__138);
  __pyx_codeobj__139 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__138, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_HoroballScene, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__139)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  __pyx_float__2 = PyFloat_FromDouble(.2); if (unlikely(!__pyx_float__2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_ = PyFloat_FromDouble(0.); if (unlikely(!__pyx_float_0_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1_ = PyFloat_FromDouble(1.); if (unlikely(!__pyx_float_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_0 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_float_0_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_1 = PyFloat_FromDouble(0.1); if (unlikely(!__pyx_float_0_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_3 = PyFloat_FromDouble(0.3); if (unlikely(!__pyx_float_0_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_6 = PyFloat_FromDouble(0.6); if (unlikely(!__pyx_float_0_6)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_8 = PyFloat_FromDouble(0.8); if (unlikely(!__pyx_float_0_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_9 = PyFloat_FromDouble(0.9); if (unlikely(!__pyx_float_0_9)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_2_0 = PyFloat_FromDouble(2.0); if (unlikely(!__pyx_float_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_2_2 = PyFloat_FromDouble(2.2); if (unlikely(!__pyx_float_2_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_01 = PyFloat_FromDouble(0.01); if (unlikely(!__pyx_float_0_01)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_05 = PyFloat_FromDouble(0.05); if (unlikely(!__pyx_float_0_05)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_10_0 = PyFloat_FromDouble(10.0); if (unlikely(!__pyx_float_10_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_30_0 = PyFloat_FromDouble(30.0); if (unlikely(!__pyx_float_30_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_50_0 = PyFloat_FromDouble(50.0); if (unlikely(!__pyx_float_50_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_100_0 = PyFloat_FromDouble(100.0); if (unlikely(!__pyx_float_100_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_360_0 = PyFloat_FromDouble(360.0); if (unlikely(!__pyx_float_360_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_neg_2_0 = PyFloat_FromDouble(-2.0); if (unlikely(!__pyx_float_neg_2_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_neg_2_2 = PyFloat_FromDouble(-2.2); if (unlikely(!__pyx_float_neg_2_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_8 = PyInt_FromLong(8); if (unlikely(!__pyx_int_8)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_60 = PyInt_FromLong(60); if (unlikely(!__pyx_int_60)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_100 = PyInt_FromLong(100); if (unlikely(!__pyx_int_100)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10925502 = PyInt_FromLong(10925502L); if (unlikely(!__pyx_int_10925502)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_147411159 = PyInt_FromLong(147411159L); if (unlikely(!__pyx_int_147411159)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_213967084 = PyInt_FromLong(213967084L); if (unlikely(!__pyx_int_213967084)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_8CyOpenGL_vector3) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_vector3.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_vector3.tp_dictoffset && __pyx_type_8CyOpenGL_vector3.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_vector3.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #if CYTHON_COMPILING_IN_CPYTHON
  {
    PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_8CyOpenGL_vector3, "__repr__"); if (unlikely(!wrapper)) __PYX_ERR(0, 38, __pyx_L1_error)
    if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
      __pyx_wrapperbase_8CyOpenGL_7vector3_2__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
      __pyx_wrapperbase_8CyOpenGL_7vector3_2__repr__.doc = __pyx_doc_8CyOpenGL_7vector3_2__repr__;
      ((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_8CyOpenGL_7vector3_2__repr__;
    }
  }
  #endif
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_vector3, (PyObject *)&__pyx_type_8CyOpenGL_vector3) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_vector3) < 0) __PYX_ERR(0, 38, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_vector3 = &__pyx_type_8CyOpenGL_vector3;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_GL_context) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_GL_context.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_GL_context.tp_dictoffset && __pyx_type_8CyOpenGL_GL_context.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_GL_context.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GL_context, (PyObject *)&__pyx_type_8CyOpenGL_GL_context) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_GL_context) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_GL_context = &__pyx_type_8CyOpenGL_GL_context;
  __pyx_vtabptr_8CyOpenGL_GLobject = &__pyx_vtable_8CyOpenGL_GLobject;
  __pyx_vtable_8CyOpenGL_GLobject.set_material = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_GLobject *))__pyx_f_8CyOpenGL_8GLobject_set_material;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_GLobject) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_GLobject.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_GLobject.tp_dictoffset && __pyx_type_8CyOpenGL_GLobject.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_GLobject.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_GLobject.tp_dict, __pyx_vtabptr_8CyOpenGL_GLobject) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_GLobject, (PyObject *)&__pyx_type_8CyOpenGL_GLobject) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_GLobject) < 0) __PYX_ERR(0, 137, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_GLobject = &__pyx_type_8CyOpenGL_GLobject;
  __pyx_vtabptr_8CyOpenGL_WireframeSphere = &__pyx_vtable_8CyOpenGL_WireframeSphere;
  __pyx_vtable_8CyOpenGL_WireframeSphere.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  __pyx_type_8CyOpenGL_WireframeSphere.tp_base = __pyx_ptype_8CyOpenGL_GLobject;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_WireframeSphere) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_WireframeSphere.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_WireframeSphere.tp_dictoffset && __pyx_type_8CyOpenGL_WireframeSphere.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_WireframeSphere.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_WireframeSphere.tp_dict, __pyx_vtabptr_8CyOpenGL_WireframeSphere) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_WireframeSphere, (PyObject *)&__pyx_type_8CyOpenGL_WireframeSphere) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_WireframeSphere) < 0) __PYX_ERR(0, 190, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_WireframeSphere = &__pyx_type_8CyOpenGL_WireframeSphere;
  __pyx_vtabptr_8CyOpenGL_MeshedSurface = &__pyx_vtable_8CyOpenGL_MeshedSurface;
  __pyx_vtable_8CyOpenGL_MeshedSurface.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  __pyx_vtable_8CyOpenGL_MeshedSurface.build_arrays = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_MeshedSurface *))__pyx_f_8CyOpenGL_13MeshedSurface_build_arrays;
  __pyx_type_8CyOpenGL_MeshedSurface.tp_base = __pyx_ptype_8CyOpenGL_GLobject;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_MeshedSurface) < 0) __PYX_ERR(0, 267, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_MeshedSurface.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_MeshedSurface.tp_dictoffset && __pyx_type_8CyOpenGL_MeshedSurface.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_MeshedSurface.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_MeshedSurface.tp_dict, __pyx_vtabptr_8CyOpenGL_MeshedSurface) < 0) __PYX_ERR(0, 267, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MeshedSurface, (PyObject *)&__pyx_type_8CyOpenGL_MeshedSurface) < 0) __PYX_ERR(0, 267, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_MeshedSurface) < 0) __PYX_ERR(0, 267, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_MeshedSurface = &__pyx_type_8CyOpenGL_MeshedSurface;
  __pyx_vtabptr_8CyOpenGL_PoincareTriangle = &__pyx_vtable_8CyOpenGL_PoincareTriangle;
  __pyx_vtable_8CyOpenGL_PoincareTriangle.__pyx_base = *__pyx_vtabptr_8CyOpenGL_MeshedSurface;
  __pyx_type_8CyOpenGL_PoincareTriangle.tp_base = __pyx_ptype_8CyOpenGL_MeshedSurface;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_PoincareTriangle) < 0) __PYX_ERR(0, 315, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_PoincareTriangle.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_PoincareTriangle.tp_dictoffset && __pyx_type_8CyOpenGL_PoincareTriangle.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_PoincareTriangle.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_PoincareTriangle.tp_dict, __pyx_vtabptr_8CyOpenGL_PoincareTriangle) < 0) __PYX_ERR(0, 315, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PoincareTriangle, (PyObject *)&__pyx_type_8CyOpenGL_PoincareTriangle) < 0) __PYX_ERR(0, 315, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_PoincareTriangle) < 0) __PYX_ERR(0, 315, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_PoincareTriangle = &__pyx_type_8CyOpenGL_PoincareTriangle;
  __pyx_vtabptr_8CyOpenGL_PoincarePolygon = &__pyx_vtable_8CyOpenGL_PoincarePolygon;
  __pyx_vtable_8CyOpenGL_PoincarePolygon.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  __pyx_vtable_8CyOpenGL_PoincarePolygon.triangulate = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_PoincarePolygon *))__pyx_f_8CyOpenGL_15PoincarePolygon_triangulate;
  __pyx_type_8CyOpenGL_PoincarePolygon.tp_base = __pyx_ptype_8CyOpenGL_GLobject;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_PoincarePolygon) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_PoincarePolygon.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_PoincarePolygon.tp_dictoffset && __pyx_type_8CyOpenGL_PoincarePolygon.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_PoincarePolygon.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_PoincarePolygon.tp_dict, __pyx_vtabptr_8CyOpenGL_PoincarePolygon) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_PoincarePolygon, (PyObject *)&__pyx_type_8CyOpenGL_PoincarePolygon) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_PoincarePolygon) < 0) __PYX_ERR(0, 349, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_PoincarePolygon = &__pyx_type_8CyOpenGL_PoincarePolygon;
  __pyx_vtabptr_8CyOpenGL_KleinPolygon = &__pyx_vtable_8CyOpenGL_KleinPolygon;
  __pyx_vtable_8CyOpenGL_KleinPolygon.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  __pyx_type_8CyOpenGL_KleinPolygon.tp_base = __pyx_ptype_8CyOpenGL_GLobject;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_KleinPolygon) < 0) __PYX_ERR(0, 380, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_KleinPolygon.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_KleinPolygon.tp_dictoffset && __pyx_type_8CyOpenGL_KleinPolygon.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_KleinPolygon.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_KleinPolygon.tp_dict, __pyx_vtabptr_8CyOpenGL_KleinPolygon) < 0) __PYX_ERR(0, 380, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_KleinPolygon, (PyObject *)&__pyx_type_8CyOpenGL_KleinPolygon) < 0) __PYX_ERR(0, 380, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_KleinPolygon) < 0) __PYX_ERR(0, 380, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_KleinPolygon = &__pyx_type_8CyOpenGL_KleinPolygon;
  __pyx_vtabptr_8CyOpenGL_Colorizer = &__pyx_vtable_8CyOpenGL_Colorizer;
  __pyx_vtable_8CyOpenGL_Colorizer.index_to_hue = (double (*)(struct __pyx_obj_8CyOpenGL_Colorizer *, int))__pyx_f_8CyOpenGL_9Colorizer_index_to_hue;
  __pyx_vtable_8CyOpenGL_Colorizer.hls_to_rgb = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_Colorizer *, double, double, double))__pyx_f_8CyOpenGL_9Colorizer_hls_to_rgb;
  __pyx_vtable_8CyOpenGL_Colorizer.hls_interp = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_Colorizer *, double, double, double))__pyx_f_8CyOpenGL_9Colorizer_hls_interp;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_Colorizer) < 0) __PYX_ERR(0, 476, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_Colorizer.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_Colorizer.tp_dictoffset && __pyx_type_8CyOpenGL_Colorizer.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_Colorizer.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_Colorizer.tp_dict, __pyx_vtabptr_8CyOpenGL_Colorizer) < 0) __PYX_ERR(0, 476, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Colorizer, (PyObject *)&__pyx_type_8CyOpenGL_Colorizer) < 0) __PYX_ERR(0, 476, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_Colorizer) < 0) __PYX_ERR(0, 476, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_Colorizer = &__pyx_type_8CyOpenGL_Colorizer;
  __pyx_vtabptr_8CyOpenGL_Horosphere = &__pyx_vtable_8CyOpenGL_Horosphere;
  __pyx_vtable_8CyOpenGL_Horosphere.__pyx_base = *__pyx_vtabptr_8CyOpenGL_MeshedSurface;
  __pyx_vtable_8CyOpenGL_Horosphere.build_vertices_and_normals = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_Horosphere *))__pyx_f_8CyOpenGL_10Horosphere_build_vertices_and_normals;
  __pyx_vtable_8CyOpenGL_Horosphere.build_triangles = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_Horosphere *))__pyx_f_8CyOpenGL_10Horosphere_build_triangles;
  __pyx_type_8CyOpenGL_Horosphere.tp_base = __pyx_ptype_8CyOpenGL_MeshedSurface;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_Horosphere) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_Horosphere.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_Horosphere.tp_dictoffset && __pyx_type_8CyOpenGL_Horosphere.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_Horosphere.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_Horosphere.tp_dict, __pyx_vtabptr_8CyOpenGL_Horosphere) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Horosphere, (PyObject *)&__pyx_type_8CyOpenGL_Horosphere) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_Horosphere) < 0) __PYX_ERR(0, 537, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_Horosphere = &__pyx_type_8CyOpenGL_Horosphere;
  __pyx_vtabptr_8CyOpenGL_HoroballGroup = &__pyx_vtable_8CyOpenGL_HoroballGroup;
  __pyx_vtable_8CyOpenGL_HoroballGroup.get_list_ids = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_HoroballGroup *, PyObject *))__pyx_f_8CyOpenGL_13HoroballGroup_get_list_ids;
  __pyx_vtable_8CyOpenGL_HoroballGroup.build_spheres = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_HoroballGroup *))__pyx_f_8CyOpenGL_13HoroballGroup_build_spheres;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_HoroballGroup) < 0) __PYX_ERR(0, 605, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_HoroballGroup.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_HoroballGroup.tp_dictoffset && __pyx_type_8CyOpenGL_HoroballGroup.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_HoroballGroup.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_HoroballGroup.tp_dict, __pyx_vtabptr_8CyOpenGL_HoroballGroup) < 0) __PYX_ERR(0, 605, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HoroballGroup, (PyObject *)&__pyx_type_8CyOpenGL_HoroballGroup) < 0) __PYX_ERR(0, 605, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_HoroballGroup) < 0) __PYX_ERR(0, 605, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_HoroballGroup = &__pyx_type_8CyOpenGL_HoroballGroup;
  __pyx_vtabptr_8CyOpenGL_Parallelogram = &__pyx_vtable_8CyOpenGL_Parallelogram;
  __pyx_vtable_8CyOpenGL_Parallelogram.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  __pyx_type_8CyOpenGL_Parallelogram.tp_base = __pyx_ptype_8CyOpenGL_GLobject;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_Parallelogram) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_Parallelogram.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_Parallelogram.tp_dictoffset && __pyx_type_8CyOpenGL_Parallelogram.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_Parallelogram.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_Parallelogram.tp_dict, __pyx_vtabptr_8CyOpenGL_Parallelogram) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Parallelogram, (PyObject *)&__pyx_type_8CyOpenGL_Parallelogram) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_Parallelogram) < 0) __PYX_ERR(0, 693, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_Parallelogram = &__pyx_type_8CyOpenGL_Parallelogram;
  __pyx_vtabptr_8CyOpenGL_EdgeSet = &__pyx_vtable_8CyOpenGL_EdgeSet;
  __pyx_vtable_8CyOpenGL_EdgeSet.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  __pyx_vtable_8CyOpenGL_EdgeSet.set_dark_color = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_EdgeSet *))__pyx_f_8CyOpenGL_7EdgeSet_set_dark_color;
  __pyx_vtable_8CyOpenGL_EdgeSet.set_light_color = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_EdgeSet *))__pyx_f_8CyOpenGL_7EdgeSet_set_light_color;
  __pyx_type_8CyOpenGL_EdgeSet.tp_base = __pyx_ptype_8CyOpenGL_GLobject;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_EdgeSet) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_EdgeSet.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_EdgeSet.tp_dictoffset && __pyx_type_8CyOpenGL_EdgeSet.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_EdgeSet.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_EdgeSet.tp_dict, __pyx_vtabptr_8CyOpenGL_EdgeSet) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_EdgeSet, (PyObject *)&__pyx_type_8CyOpenGL_EdgeSet) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_EdgeSet) < 0) __PYX_ERR(0, 715, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_EdgeSet = &__pyx_type_8CyOpenGL_EdgeSet;
  __pyx_vtabptr_8CyOpenGL_FordEdgeSet = &__pyx_vtable_8CyOpenGL_FordEdgeSet;
  __pyx_vtable_8CyOpenGL_FordEdgeSet.__pyx_base = *__pyx_vtabptr_8CyOpenGL_EdgeSet;
  __pyx_type_8CyOpenGL_FordEdgeSet.tp_base = __pyx_ptype_8CyOpenGL_EdgeSet;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_FordEdgeSet) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_FordEdgeSet.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_FordEdgeSet.tp_dictoffset && __pyx_type_8CyOpenGL_FordEdgeSet.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_FordEdgeSet.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_FordEdgeSet.tp_dict, __pyx_vtabptr_8CyOpenGL_FordEdgeSet) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FordEdgeSet, (PyObject *)&__pyx_type_8CyOpenGL_FordEdgeSet) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_FordEdgeSet) < 0) __PYX_ERR(0, 761, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_FordEdgeSet = &__pyx_type_8CyOpenGL_FordEdgeSet;
  __pyx_vtabptr_8CyOpenGL_TriangulationEdgeSet = &__pyx_vtable_8CyOpenGL_TriangulationEdgeSet;
  __pyx_vtable_8CyOpenGL_TriangulationEdgeSet.__pyx_base = *__pyx_vtabptr_8CyOpenGL_EdgeSet;
  __pyx_vtable_8CyOpenGL_TriangulationEdgeSet.__pyx_base.set_light_color = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_EdgeSet *))__pyx_f_8CyOpenGL_20TriangulationEdgeSet_set_light_color;
  __pyx_type_8CyOpenGL_TriangulationEdgeSet.tp_base = __pyx_ptype_8CyOpenGL_EdgeSet;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_TriangulationEdgeSet) < 0) __PYX_ERR(0, 768, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_TriangulationEdgeSet.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_TriangulationEdgeSet.tp_dictoffset && __pyx_type_8CyOpenGL_TriangulationEdgeSet.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_TriangulationEdgeSet.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_TriangulationEdgeSet.tp_dict, __pyx_vtabptr_8CyOpenGL_TriangulationEdgeSet) < 0) __PYX_ERR(0, 768, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_TriangulationEdgeSet, (PyObject *)&__pyx_type_8CyOpenGL_TriangulationEdgeSet) < 0) __PYX_ERR(0, 768, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_TriangulationEdgeSet) < 0) __PYX_ERR(0, 768, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_TriangulationEdgeSet = &__pyx_type_8CyOpenGL_TriangulationEdgeSet;
  __pyx_vtabptr_8CyOpenGL_Label = &__pyx_vtable_8CyOpenGL_Label;
  __pyx_vtable_8CyOpenGL_Label.get_shape = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_Label *))__pyx_f_8CyOpenGL_5Label_get_shape;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_Label) < 0) __PYX_ERR(0, 782, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_Label.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_Label.tp_dictoffset && __pyx_type_8CyOpenGL_Label.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_Label.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_Label.tp_dict, __pyx_vtabptr_8CyOpenGL_Label) < 0) __PYX_ERR(0, 782, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Label, (PyObject *)&__pyx_type_8CyOpenGL_Label) < 0) __PYX_ERR(0, 782, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_Label) < 0) __PYX_ERR(0, 782, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_Label = &__pyx_type_8CyOpenGL_Label;
  __pyx_vtabptr_8CyOpenGL_LabelSet = &__pyx_vtable_8CyOpenGL_LabelSet;
  __pyx_vtable_8CyOpenGL_LabelSet.__pyx_base = *__pyx_vtabptr_8CyOpenGL_GLobject;
  __pyx_type_8CyOpenGL_LabelSet.tp_base = __pyx_ptype_8CyOpenGL_GLobject;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_LabelSet) < 0) __PYX_ERR(0, 813, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_LabelSet.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_LabelSet.tp_dictoffset && __pyx_type_8CyOpenGL_LabelSet.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_LabelSet.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_LabelSet.tp_dict, __pyx_vtabptr_8CyOpenGL_LabelSet) < 0) __PYX_ERR(0, 813, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_LabelSet, (PyObject *)&__pyx_type_8CyOpenGL_LabelSet) < 0) __PYX_ERR(0, 813, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_LabelSet) < 0) __PYX_ERR(0, 813, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_LabelSet = &__pyx_type_8CyOpenGL_LabelSet;
  __pyx_vtabptr_8CyOpenGL_HoroballScene = &__pyx_vtable_8CyOpenGL_HoroballScene;
  __pyx_vtable_8CyOpenGL_HoroballScene.build_shifts = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_HoroballScene *, PyObject *, PyObject *))__pyx_f_8CyOpenGL_13HoroballScene_build_shifts;
  __pyx_vtable_8CyOpenGL_HoroballScene.right_top = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_HoroballScene *))__pyx_f_8CyOpenGL_13HoroballScene_right_top;
  __pyx_vtable_8CyOpenGL_HoroballScene.gl_compile = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_HoroballScene *))__pyx_f_8CyOpenGL_13HoroballScene_gl_compile;
  __pyx_vtable_8CyOpenGL_HoroballScene.draw_segments = (PyObject *(*)(struct __pyx_obj_8CyOpenGL_HoroballScene *, PyObject *, PyObject *))__pyx_f_8CyOpenGL_13HoroballScene_draw_segments;
  if (PyType_Ready(&__pyx_type_8CyOpenGL_HoroballScene) < 0) __PYX_ERR(0, 844, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL_HoroballScene.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL_HoroballScene.tp_dictoffset && __pyx_type_8CyOpenGL_HoroballScene.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL_HoroballScene.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  if (__Pyx_SetVtable(__pyx_type_8CyOpenGL_HoroballScene.tp_dict, __pyx_vtabptr_8CyOpenGL_HoroballScene) < 0) __PYX_ERR(0, 844, __pyx_L1_error)
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_HoroballScene, (PyObject *)&__pyx_type_8CyOpenGL_HoroballScene) < 0) __PYX_ERR(0, 844, __pyx_L1_error)
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_8CyOpenGL_HoroballScene) < 0) __PYX_ERR(0, 844, __pyx_L1_error)
  __pyx_ptype_8CyOpenGL_HoroballScene = &__pyx_type_8CyOpenGL_HoroballScene;
  if (PyType_Ready(&__pyx_type_8CyOpenGL___pyx_scope_struct__draw) < 0) __PYX_ERR(0, 195, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL___pyx_scope_struct__draw.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL___pyx_scope_struct__draw.tp_dictoffset && __pyx_type_8CyOpenGL___pyx_scope_struct__draw.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL___pyx_scope_struct__draw.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8CyOpenGL___pyx_scope_struct__draw = &__pyx_type_8CyOpenGL___pyx_scope_struct__draw;
  if (PyType_Ready(&__pyx_type_8CyOpenGL___pyx_scope_struct_1_build_scene) < 0) __PYX_ERR(0, 898, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL___pyx_scope_struct_1_build_scene.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL___pyx_scope_struct_1_build_scene.tp_dictoffset && __pyx_type_8CyOpenGL___pyx_scope_struct_1_build_scene.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL___pyx_scope_struct_1_build_scene.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8CyOpenGL___pyx_scope_struct_1_build_scene = &__pyx_type_8CyOpenGL___pyx_scope_struct_1_build_scene;
  if (PyType_Ready(&__pyx_type_8CyOpenGL___pyx_scope_struct_2_genexpr) < 0) __PYX_ERR(0, 907, __pyx_L1_error)
  #if PY_VERSION_HEX < 0x030800B1
  __pyx_type_8CyOpenGL___pyx_scope_struct_2_genexpr.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_8CyOpenGL___pyx_scope_struct_2_genexpr.tp_dictoffset && __pyx_type_8CyOpenGL___pyx_scope_struct_2_genexpr.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_8CyOpenGL___pyx_scope_struct_2_genexpr.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
  }
  __pyx_ptype_8CyOpenGL___pyx_scope_struct_2_genexpr = &__pyx_type_8CyOpenGL___pyx_scope_struct_2_genexpr;
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION < 3
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC void
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#else
#ifdef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initCyOpenGL(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initCyOpenGL(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_CyOpenGL(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_CyOpenGL(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
            result = PyDict_SetItemString(moddict, to_name, value);
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_CyOpenGL(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'CyOpenGL' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_CyOpenGL(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("CyOpenGL", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main_CyOpenGL) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "CyOpenGL")) {
      if (unlikely(PyDict_SetItemString(modules, "CyOpenGL", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) goto __pyx_L1_error;
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) goto __pyx_L1_error;
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "CyOpenGL.pyx":7
 *     return string
 * 
 * from .infodialog import InfoDialog             # <<<<<<<<<<<<<<
 * from . import togl
 * 
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_InfoDialog);
  __Pyx_GIVEREF(__pyx_n_s_InfoDialog);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_InfoDialog);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_infodialog, __pyx_t_1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_InfoDialog); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_InfoDialog, __pyx_t_1) < 0) __PYX_ERR(0, 7, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":8
 * 
 * from .infodialog import InfoDialog
 * from . import togl             # <<<<<<<<<<<<<<
 * 
 * import os, sys, platform
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_togl);
  __Pyx_GIVEREF(__pyx_n_s_togl);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_togl);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s__51, __pyx_t_2, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_togl); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_togl, __pyx_t_2) < 0) __PYX_ERR(0, 8, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":10
 * from . import togl
 * 
 * import os, sys, platform             # <<<<<<<<<<<<<<
 * from colorsys import hls_to_rgb
 * from math import sqrt, ceil, floor, pi, sin, cos, tan
 */
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_os, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_os, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_sys, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sys, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_platform, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_platform, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":11
 * 
 * import os, sys, platform
 * from colorsys import hls_to_rgb             # <<<<<<<<<<<<<<
 * from math import sqrt, ceil, floor, pi, sin, cos, tan
 * from random import random
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_hls_to_rgb);
  __Pyx_GIVEREF(__pyx_n_s_hls_to_rgb);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_hls_to_rgb);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_colorsys, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_hls_to_rgb); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_hls_to_rgb, __pyx_t_1) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":12
 * import os, sys, platform
 * from colorsys import hls_to_rgb
 * from math import sqrt, ceil, floor, pi, sin, cos, tan             # <<<<<<<<<<<<<<
 * from random import random
 * 
 */
  __pyx_t_2 = PyList_New(7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_sqrt);
  __Pyx_GIVEREF(__pyx_n_s_sqrt);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_sqrt);
  __Pyx_INCREF(__pyx_n_s_ceil);
  __Pyx_GIVEREF(__pyx_n_s_ceil);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_ceil);
  __Pyx_INCREF(__pyx_n_s_floor);
  __Pyx_GIVEREF(__pyx_n_s_floor);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_floor);
  __Pyx_INCREF(__pyx_n_s_pi);
  __Pyx_GIVEREF(__pyx_n_s_pi);
  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_pi);
  __Pyx_INCREF(__pyx_n_s_sin);
  __Pyx_GIVEREF(__pyx_n_s_sin);
  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_sin);
  __Pyx_INCREF(__pyx_n_s_cos);
  __Pyx_GIVEREF(__pyx_n_s_cos);
  PyList_SET_ITEM(__pyx_t_2, 5, __pyx_n_s_cos);
  __Pyx_INCREF(__pyx_n_s_tan);
  __Pyx_GIVEREF(__pyx_n_s_tan);
  PyList_SET_ITEM(__pyx_t_2, 6, __pyx_n_s_tan);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, __pyx_t_2, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sqrt, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_ceil); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ceil, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_floor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_floor, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sin, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_cos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cos, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_tan); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_tan, __pyx_t_2) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":13
 * from colorsys import hls_to_rgb
 * from math import sqrt, ceil, floor, pi, sin, cos, tan
 * from random import random             # <<<<<<<<<<<<<<
 * 
 * Togl_dir = os.path.abspath(os.path.dirname(togl.__file__))
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_random);
  __Pyx_GIVEREF(__pyx_n_s_random);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_random);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_random, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_random); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_random, __pyx_t_1) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":15
 * from random import random
 * 
 * Togl_dir = os.path.abspath(os.path.dirname(togl.__file__))             # <<<<<<<<<<<<<<
 * 
 * if sys.version_info[0] < 3:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_os); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_path); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_abspath); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_os); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_path); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_dirname); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_togl); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_file_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_Togl_dir, __pyx_t_4) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":17
 * Togl_dir = os.path.abspath(os.path.dirname(togl.__file__))
 * 
 * if sys.version_info[0] < 3:             # <<<<<<<<<<<<<<
 *     import Tkinter as Tk_
 * else:
 */
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sys); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_version_info); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_int_3, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 17, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "CyOpenGL.pyx":18
 * 
 * if sys.version_info[0] < 3:
 *     import Tkinter as Tk_             # <<<<<<<<<<<<<<
 * else:
 *     import tkinter as Tk_
 */
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_Tkinter, 0, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 18, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tk, __pyx_t_3) < 0) __PYX_ERR(0, 18, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "CyOpenGL.pyx":17
 * Togl_dir = os.path.abspath(os.path.dirname(togl.__file__))
 * 
 * if sys.version_info[0] < 3:             # <<<<<<<<<<<<<<
 *     import Tkinter as Tk_
 * else:
 */
    goto __pyx_L2;
  }

  /* "CyOpenGL.pyx":20
 *     import Tkinter as Tk_
 * else:
 *     import tkinter as Tk_             # <<<<<<<<<<<<<<
 * 
 * def GetString(string):
 */
  /*else*/ {
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_tkinter, 0, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 20, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    if (PyDict_SetItem(__pyx_d, __pyx_n_s_Tk, __pyx_t_3) < 0) __PYX_ERR(0, 20, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L2:;

  /* "CyOpenGL.pyx":22
 *     import tkinter as Tk_
 * 
 * def GetString(string):             # <<<<<<<<<<<<<<
 *     enumdict = {
 *         'GL_VENDOR': GL_VENDOR,
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_8CyOpenGL_1GetString, NULL, __pyx_n_s_CyOpenGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GetString, __pyx_t_3) < 0) __PYX_ERR(0, 22, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":153
 * 
 *     def __cinit__(self, *args,
 *                   color = [0.8, 0.8, 0.8, 1.0],             # <<<<<<<<<<<<<<
 *                   front_specular = [0.8, 0.8, 0.8, 1.0],
 *                   back_specular = [0.8, 0.8, 0.8, 1.0],
 */
  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyList_SET_ITEM(__pyx_t_3, 3, __pyx_float_1_0);
  __pyx_k__7 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":154
 *     def __cinit__(self, *args,
 *                   color = [0.8, 0.8, 0.8, 1.0],
 *                   front_specular = [0.8, 0.8, 0.8, 1.0],             # <<<<<<<<<<<<<<
 *                   back_specular = [0.8, 0.8, 0.8, 1.0],
 *                   front_shininess = 0.0,
 */
  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyList_SET_ITEM(__pyx_t_3, 3, __pyx_float_1_0);
  __pyx_k__8 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":155
 *                   color = [0.8, 0.8, 0.8, 1.0],
 *                   front_specular = [0.8, 0.8, 0.8, 1.0],
 *                   back_specular = [0.8, 0.8, 0.8, 1.0],             # <<<<<<<<<<<<<<
 *                   front_shininess = 0.0,
 *                   back_shininess = 0.0,
 */
  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyList_SET_ITEM(__pyx_t_3, 3, __pyx_float_1_0);
  __pyx_k__9 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":228
 *         glPopMatrix()
 * 
 * class TriangleMesh:             # <<<<<<<<<<<<<<
 *     """
 *     A triangle which can tessellate itself.
 */
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_TriangleMesh, __pyx_n_s_TriangleMesh, (PyObject *) NULL, __pyx_n_s_CyOpenGL, __pyx_kp_s_A_triangle_which_can_tessellate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "CyOpenGL.pyx":232
 *     A triangle which can tessellate itself.
 *     """
 *     def __init__(self, vertices):             # <<<<<<<<<<<<<<
 *         self.vertices = vertices
 *         self.triangles = [(0,1,2)]
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12TriangleMesh_1__init__, 0, __pyx_n_s_TriangleMesh___init, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__55)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 232, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":236
 *         self.triangles = [(0,1,2)]
 * 
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return str(self.triangles)
 * 
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12TriangleMesh_3__repr__, 0, __pyx_n_s_TriangleMesh___repr, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__57)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_repr, __pyx_t_4) < 0) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":239
 *         return str(self.triangles)
 * 
 *     def __getitem__(self, n):             # <<<<<<<<<<<<<<
 *         x, y, z = self.triangles[n]
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12TriangleMesh_5__getitem__, 0, __pyx_n_s_TriangleMesh___getitem, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__59)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_getitem, __pyx_t_4) < 0) __PYX_ERR(0, 239, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":243
 *         return (self.vertices[x], self.vertices[y], self.vertices[z])
 * 
 *     def subdivide(self):             # <<<<<<<<<<<<<<
 *         """
 *         Replace each triangle by four triangles:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12TriangleMesh_7subdivide, 0, __pyx_n_s_TriangleMesh_subdivide, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__61)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_subdivide, __pyx_t_4) < 0) __PYX_ERR(0, 243, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":228
 *         glPopMatrix()
 * 
 * class TriangleMesh:             # <<<<<<<<<<<<<<
 *     """
 *     A triangle which can tessellate itself.
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_TriangleMesh, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_TriangleMesh, __pyx_t_4) < 0) __PYX_ERR(0, 228, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":403
 *         glEnd()
 * 
 * class HyperbolicPolyhedron:             # <<<<<<<<<<<<<<
 *    """
 *    A hyperbolic polyhedron for display in OpenGL, either in the Klein
 */
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_HyperbolicPolyhedron, __pyx_n_s_HyperbolicPolyhedron, (PyObject *) NULL, __pyx_n_s_CyOpenGL, __pyx_kp_s_A_hyperbolic_polyhedron_for_dis); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);

  /* "CyOpenGL.pyx":412
 *    """
 * 
 *    def __init__(self, facedicts, model_var, sphere_var):             # <<<<<<<<<<<<<<
 *      self.facedicts = facedicts
 *      self.model = model_var
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_1__init__, 0, __pyx_n_s_HyperbolicPolyhedron___init, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__63)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_init, __pyx_t_4) < 0) __PYX_ERR(0, 412, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":450
 *      self.build_poincare_poly(self.poincare_list_id)
 * 
 *    def destroy(self):             # <<<<<<<<<<<<<<
 *        glDeleteLists(self.sphere_list_id, 1)
 *        glDeleteLists(self.klein_list_id, 1)
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_3destroy, 0, __pyx_n_s_HyperbolicPolyhedron_destroy, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__65)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_destroy, __pyx_t_4) < 0) __PYX_ERR(0, 450, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":455
 *        glDeleteLists(self.poincare_list_id, 1)
 * 
 *    def draw(self, *args):             # <<<<<<<<<<<<<<
 *        model = self.model.get()
 *        if model == 'Klein':
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_5draw, 0, __pyx_n_s_HyperbolicPolyhedron_draw, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__67)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_draw, __pyx_t_4) < 0) __PYX_ERR(0, 455, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":464
 *            glCallList(self.sphere_list_id)
 * 
 *    def build_klein_poly(self, list):             # <<<<<<<<<<<<<<
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Klein_faces:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_7build_klein_poly, 0, __pyx_n_s_HyperbolicPolyhedron_build_klein, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__69)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_build_klein_poly, __pyx_t_4) < 0) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":470
 *      glEndList()
 * 
 *    def build_poincare_poly(self, list):             # <<<<<<<<<<<<<<
 *      glNewList(list, GL_COMPILE)
 *      for face in self.Poincare_faces:
 */
  __pyx_t_4 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_20HyperbolicPolyhedron_9build_poincare_poly, 0, __pyx_n_s_HyperbolicPolyhedron_build_poinc, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__71)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_SetNameInClass(__pyx_t_3, __pyx_n_s_build_poincare_poly, __pyx_t_4) < 0) __PYX_ERR(0, 470, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "CyOpenGL.pyx":403
 *         glEnd()
 * 
 * class HyperbolicPolyhedron:             # <<<<<<<<<<<<<<
 *    """
 *    A hyperbolic polyhedron for display in OpenGL, either in the Klein
 */
  __pyx_t_4 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_HyperbolicPolyhedron, __pyx_empty_tuple, __pyx_t_3, NULL, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_HyperbolicPolyhedron, __pyx_t_4) < 0) __PYX_ERR(0, 403, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":535
 *         return m1
 * 
 * GetColor = Colorizer()             # <<<<<<<<<<<<<<
 * 
 * cdef class Horosphere(MeshedSurface):
 */
  __pyx_t_3 = __Pyx_PyObject_CallNoArg(((PyObject *)__pyx_ptype_8CyOpenGL_Colorizer)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_GetColor, __pyx_t_3) < 0) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":545
 * 
 *     def __init__(self,
 *                  color=[0.8,0.0,0.0,0.3],             # <<<<<<<<<<<<<<
 *                  radius=1.0,
 *                  front_specular = [0.8, 0.8, 0.8, 1.0],
 */
  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_float_0_0);
  __Pyx_INCREF(__pyx_float_0_0);
  __Pyx_GIVEREF(__pyx_float_0_0);
  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_float_0_0);
  __Pyx_INCREF(__pyx_float_0_3);
  __Pyx_GIVEREF(__pyx_float_0_3);
  PyList_SET_ITEM(__pyx_t_3, 3, __pyx_float_0_3);
  __pyx_k__30 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":547
 *                  color=[0.8,0.0,0.0,0.3],
 *                  radius=1.0,
 *                  front_specular = [0.8, 0.8, 0.8, 1.0],             # <<<<<<<<<<<<<<
 *                  back_specular = [0.8, 0.8, 0.8, 1.0],
 *                  front_shininess = 50.0,
 */
  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 547, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyList_SET_ITEM(__pyx_t_3, 3, __pyx_float_1_0);
  __pyx_k__31 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":548
 *                  radius=1.0,
 *                  front_specular = [0.8, 0.8, 0.8, 1.0],
 *                  back_specular = [0.8, 0.8, 0.8, 1.0],             # <<<<<<<<<<<<<<
 *                  front_shininess = 50.0,
 *                  back_shininess = 0.0
 */
  __pyx_t_3 = PyList_New(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 0, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 1, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_0_8);
  __Pyx_GIVEREF(__pyx_float_0_8);
  PyList_SET_ITEM(__pyx_t_3, 2, __pyx_float_0_8);
  __Pyx_INCREF(__pyx_float_1_0);
  __Pyx_GIVEREF(__pyx_float_1_0);
  PyList_SET_ITEM(__pyx_t_3, 3, __pyx_float_1_0);
  __pyx_k__32 = __pyx_t_3;
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1042
 *     glMultMatrixd(mat)
 * 
 * class RawOpenGLWidget(Tk_.Widget, Tk_.Misc):             # <<<<<<<<<<<<<<
 *     """
 *     Widget without any sophisticated bindings
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Tk); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Widget); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_Tk); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_Misc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __pyx_t_4 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_RawOpenGLWidget, __pyx_n_s_RawOpenGLWidget, (PyObject *) NULL, __pyx_n_s_CyOpenGL, __pyx_kp_s_Widget_without_any_sophisticate); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "CyOpenGL.pyx":1048
 *     """
 * 
 *     def __init__(self, master, cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         curr_platform = sys.platform
 *         cpu_width = platform.architecture()[0]
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_15RawOpenGLWidget_1__init__, 0, __pyx_n_s_RawOpenGLWidget___init, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__73)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_Defaults(__pyx_defaults, __pyx_t_1)->__pyx_arg_cnf = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_8CyOpenGL_8__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 1048, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1078
 *         self.bind('<Configure>', self.tkExpose)
 * 
 *     def tkRedraw(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.update_idletasks()
 *         self.tk.call(self._w, 'makecurrent')
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_15RawOpenGLWidget_3tkRedraw, 0, __pyx_n_s_RawOpenGLWidget_tkRedraw, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__75)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkRedraw, __pyx_t_1) < 0) __PYX_ERR(0, 1078, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1085
 *         glPopMatrix()
 * 
 *     def tkMap(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.tkExpose()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_15RawOpenGLWidget_5tkMap, 0, __pyx_n_s_RawOpenGLWidget_tkMap, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__77)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1085, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkMap, __pyx_t_1) < 0) __PYX_ERR(0, 1085, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1088
 *         self.tkExpose()
 * 
 *     def tkExpose(self, *dummy):             # <<<<<<<<<<<<<<
 *         self.tkRedraw()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_15RawOpenGLWidget_7tkExpose, 0, __pyx_n_s_RawOpenGLWidget_tkExpose, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__79)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkExpose, __pyx_t_1) < 0) __PYX_ERR(0, 1088, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1042
 *     glMultMatrixd(mat)
 * 
 * class RawOpenGLWidget(Tk_.Widget, Tk_.Misc):             # <<<<<<<<<<<<<<
 *     """
 *     Widget without any sophisticated bindings
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_RawOpenGLWidget, __pyx_t_3, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_RawOpenGLWidget, __pyx_t_1) < 0) __PYX_ERR(0, 1042, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1091
 *         self.tkRedraw()
 * 
 * class OpenGLWidget(RawOpenGLWidget):             # <<<<<<<<<<<<<<
 *     """
 *     Tkinter bindings for an OpenGL widget.
 */
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_RawOpenGLWidget); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_CalculateMetaclass(NULL, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_3, __pyx_t_2, __pyx_n_s_OpenGLWidget, __pyx_n_s_OpenGLWidget, (PyObject *) NULL, __pyx_n_s_CyOpenGL, __pyx_kp_s_Tkinter_bindings_for_an_OpenGL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "CyOpenGL.pyx":1100
 *     """
 * 
 *     def __init__(self, master=None, help='No help is available.',             # <<<<<<<<<<<<<<
 *                  mouse_pick=False, mouse_rotate=True, mouse_translate=False,
 *                  mouse_scale=False,
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_1__init__, 0, __pyx_n_s_OpenGLWidget___init, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__81)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_1, sizeof(__pyx_defaults1), 1)) __PYX_ERR(0, 1100, __pyx_L1_error)

  /* "CyOpenGL.pyx":1104
 *                  mouse_scale=False,
 *                  fovy=30.0, near=1.0, far=100.0,
 *                  cnf={}, **kw):             # <<<<<<<<<<<<<<
 *         """
 *         Create an opengl widget.  Arrange for redraws when the window is
 */
  __pyx_t_6 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1104, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_CyFunction_Defaults(__pyx_defaults1, __pyx_t_1)->__pyx_arg_cnf = __pyx_t_6;
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_6 = 0;
  __Pyx_CyFunction_SetDefaultsGetter(__pyx_t_1, __pyx_pf_8CyOpenGL_10__defaults__);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_init, __pyx_t_1) < 0) __PYX_ERR(0, 1100, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1181
 *             self.bind('<KeyPress>', self.tkKeyPress)
 * 
 *     def help(self):             # <<<<<<<<<<<<<<
 *         """
 *         Help message for the widget.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_3help, 0, __pyx_n_s_OpenGLWidget_help, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__83)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_help, __pyx_t_1) < 0) __PYX_ERR(0, 1181, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1187
 *         InfoDialog(self, 'Viewer Help', self.help_text)
 * 
 *     def activate(self):             # <<<<<<<<<<<<<<
 *         """
 *         Cause this OpenGLWidget to be the current destination for
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_5activate, 0, __pyx_n_s_OpenGLWidget_activate, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__85)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1187, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_activate, __pyx_t_1) < 0) __PYX_ERR(0, 1187, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1197
 *         #self.focus_set()
 * 
 *     def set_background(self, r, g, b):             # <<<<<<<<<<<<<<
 *         """
 *         Change the background colour of the widget.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_7set_background, 0, __pyx_n_s_OpenGLWidget_set_background, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__87)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1197, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_set_background, __pyx_t_1) < 0) __PYX_ERR(0, 1197, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1206
 *         self.tkRedraw()
 * 
 *     def set_centerpoint(self, x, y, z):             # <<<<<<<<<<<<<<
 *         """
 *         Set the new center point for the model.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_9set_centerpoint, 0, __pyx_n_s_OpenGLWidget_set_centerpoint, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__89)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_set_centerpoint, __pyx_t_1) < 0) __PYX_ERR(0, 1206, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1216
 *         self.tkRedraw()
 * 
 *     def set_eyepoint(self, distance):             # <<<<<<<<<<<<<<
 *         """
 *         Set how far the eye is from the position we are looking.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_11set_eyepoint, 0, __pyx_n_s_OpenGLWidget_set_eyepoint, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__91)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1216, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_set_eyepoint, __pyx_t_1) < 0) __PYX_ERR(0, 1216, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1223
 *         self.tkRedraw()
 * 
 *     def reset(self, redraw=True):             # <<<<<<<<<<<<<<
 *         """
 *         Reset rotation matrix for this widget.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_13reset, 0, __pyx_n_s_OpenGLWidget_reset, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__93)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__94);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_reset, __pyx_t_1) < 0) __PYX_ERR(0, 1223, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1234
 *             self.tkRedraw()
 * 
 *     def tkHandlePick(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle a pick on the scene.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_15tkHandlePick, 0, __pyx_n_s_OpenGLWidget_tkHandlePick, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__96)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkHandlePick, __pyx_t_1) < 0) __PYX_ERR(0, 1234, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1266
 *             #     self.tkRedraw()
 * 
 *     def tkRecordMouse(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Record the current mouse position.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_17tkRecordMouse, 0, __pyx_n_s_OpenGLWidget_tkRecordMouse, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__98)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1266, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkRecordMouse, __pyx_t_1) < 0) __PYX_ERR(0, 1266, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1273
 *         self.xmouse, self.ymouse, self.tmouse = event.x, event.y, event.time
 * 
 *     def StartRotate(self, event):             # <<<<<<<<<<<<<<
 *         # Switch off any autospinning if it was happening
 *         self.autospin = 0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_19StartRotate, 0, __pyx_n_s_OpenGLWidget_StartRotate, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__100)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_StartRotate, __pyx_t_1) < 0) __PYX_ERR(0, 1273, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1278
 *         self.tkRecordMouse(event)
 * 
 *     def tkScale(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Scale the scene.  Achieved by moving the eye position
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_21tkScale, 0, __pyx_n_s_OpenGLWidget_tkScale, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__102)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkScale, __pyx_t_1) < 0) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1288
 *         self.tkRecordMouse(event)
 * 
 *     def zoom(self, x):             # <<<<<<<<<<<<<<
 *         t = float(x)/100.0
 *         self.distance = t*2.0 + (1-t)*10.0
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_23zoom, 0, __pyx_n_s_OpenGLWidget_zoom, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__104)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_zoom, __pyx_t_1) < 0) __PYX_ERR(0, 1288, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1293
 *         self.tkRedraw()
 * 
 *     def do_AutoSpin(self):             # <<<<<<<<<<<<<<
 *         self.activate()
 *         glRotateScene(self.xcenter, self.ycenter, self.zcenter,
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_25do_AutoSpin, 0, __pyx_n_s_OpenGLWidget_do_AutoSpin, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__106)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1293, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_do_AutoSpin, __pyx_t_1) < 0) __PYX_ERR(0, 1293, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1302
 *             self.after(10, self.do_AutoSpin)
 * 
 *     def tkAutoSpin(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform autospin of scene.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_27tkAutoSpin, 0, __pyx_n_s_OpenGLWidget_tkAutoSpin, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__108)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkAutoSpin, __pyx_t_1) < 0) __PYX_ERR(0, 1302, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1311
 *         self.update_idletasks()
 * 
 *     def tkRotate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform rotation of scene.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_29tkRotate, 0, __pyx_n_s_OpenGLWidget_tkRotate, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__110)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkRotate, __pyx_t_1) < 0) __PYX_ERR(0, 1311, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1324
 *         self.tkRecordMouse(event)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_31tkTranslate, 0, __pyx_n_s_OpenGLWidget_tkTranslate, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__112)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkTranslate, __pyx_t_1) < 0) __PYX_ERR(0, 1324, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1333
 *         self.tkRecordMouse(event)
 * 
 *     def mouse_update(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw the scene and save the mouse coordinates.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_33mouse_update, 0, __pyx_n_s_OpenGLWidget_mouse_update, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__114)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_mouse_update, __pyx_t_1) < 0) __PYX_ERR(0, 1333, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1340
 *         self.tkRecordMouse(event)
 * 
 *     def tkRedraw(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Cause the opengl widget to redraw itself.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_35tkRedraw, 0, __pyx_n_s_OpenGLWidget_tkRedraw, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__116)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkRedraw, __pyx_t_1) < 0) __PYX_ERR(0, 1340, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1363
 *         self.tk.call(self._w, 'swapbuffers')
 * 
 *     def build_projection(self, width, height):             # <<<<<<<<<<<<<<
 *         cdef GLdouble xmax, yymax, near, far
 *         aspect = float(width)/float(height)
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_37build_projection, 0, __pyx_n_s_OpenGLWidget_build_projection, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__118)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1363, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_build_projection, __pyx_t_1) < 0) __PYX_ERR(0, 1363, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1376
 *         glMatrixMode(GL_MODELVIEW)
 * 
 *     def tkMap(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Cause the opengl widget to redraw itself.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_39tkMap, 0, __pyx_n_s_OpenGLWidget_tkMap, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__120)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1376, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkMap, __pyx_t_1) < 0) __PYX_ERR(0, 1376, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1382
 *         self.tkExpose()
 * 
 *     def tkExpose(self, *dummy):             # <<<<<<<<<<<<<<
 *         """
 *         Redraw the widget.  Make it active, update tk events, call redraw
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_41tkExpose, 0, __pyx_n_s_OpenGLWidget_tkExpose, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__122)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkExpose, __pyx_t_1) < 0) __PYX_ERR(0, 1382, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1393
 *         self.tkRedraw()
 * 
 *     def tkKeyPress(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Handle keyboard events.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_43tkKeyPress, 0, __pyx_n_s_OpenGLWidget_tkKeyPress, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__124)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkKeyPress, __pyx_t_1) < 0) __PYX_ERR(0, 1393, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1404
 *             self.tkRedraw()
 * 
 *     def tkPrint(self, file):             # <<<<<<<<<<<<<<
 *         """
 *         Turn the current scene into PostScript via the feedback buffer.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_12OpenGLWidget_45tkPrint, 0, __pyx_n_s_OpenGLWidget_tkPrint, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__126)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkPrint, __pyx_t_1) < 0) __PYX_ERR(0, 1404, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1091
 *         self.tkRedraw()
 * 
 * class OpenGLWidget(RawOpenGLWidget):             # <<<<<<<<<<<<<<
 *     """
 *     Tkinter bindings for an OpenGL widget.
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_3, __pyx_n_s_OpenGLWidget, __pyx_t_2, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1091, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OpenGLWidget, __pyx_t_1) < 0) __PYX_ERR(0, 1091, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "CyOpenGL.pyx":1411
 *         # DEAL WITH THIS
 * 
 * class OpenGLOrthoWidget(OpenGLWidget):             # <<<<<<<<<<<<<<
 *     """
 *     A version of the widget that uses orthographic projection instead
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_OpenGLWidget); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
  __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_3, __pyx_n_s_OpenGLOrthoWidget, __pyx_n_s_OpenGLOrthoWidget, (PyObject *) NULL, __pyx_n_s_CyOpenGL, __pyx_kp_s_A_version_of_the_widget_that_us); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);

  /* "CyOpenGL.pyx":1417
 *     """
 * 
 *     def build_projection(self, width, height, t=1.0):             # <<<<<<<<<<<<<<
 *         aspect = float(width)/float(height)
 *         top = self.fovy/2
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_17OpenGLOrthoWidget_1build_projection, 0, __pyx_n_s_OpenGLOrthoWidget_build_projecti, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__128)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_1, __pyx_tuple__129);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_build_projection, __pyx_t_1) < 0) __PYX_ERR(0, 1417, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1434
 *         glMatrixMode(GL_MODELVIEW)
 * 
 *     def tkTranslate(self, event):             # <<<<<<<<<<<<<<
 *         """
 *         Perform translation of scene.
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_17OpenGLOrthoWidget_3tkTranslate, 0, __pyx_n_s_OpenGLOrthoWidget_tkTranslate, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__131)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1434, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_tkTranslate, __pyx_t_1) < 0) __PYX_ERR(0, 1434, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1441
 *         self.tkRecordMouse(event)
 * 
 *     def redraw(self):             # <<<<<<<<<<<<<<
 *         pass
 */
  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_8CyOpenGL_17OpenGLOrthoWidget_5redraw, 0, __pyx_n_s_OpenGLOrthoWidget_redraw, NULL, __pyx_n_s_CyOpenGL, __pyx_d, ((PyObject *)__pyx_codeobj__133)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (__Pyx_SetNameInClass(__pyx_t_4, __pyx_n_s_redraw, __pyx_t_1) < 0) __PYX_ERR(0, 1441, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "CyOpenGL.pyx":1411
 *         # DEAL WITH THIS
 * 
 * class OpenGLOrthoWidget(OpenGLWidget):             # <<<<<<<<<<<<<<
 *     """
 *     A version of the widget that uses orthographic projection instead
 */
  __pyx_t_1 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_OpenGLOrthoWidget, __pyx_t_3, __pyx_t_4, NULL, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1411, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_OpenGLOrthoWidget, __pyx_t_1) < 0) __PYX_ERR(0, 1411, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_HoroballGroup(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_8CyOpenGL_3__pyx_unpickle_HoroballGroup, NULL, __pyx_n_s_CyOpenGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_HoroballGroup, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "(tree fragment)":11
 *         __pyx_unpickle_HoroballGroup__set_state(<HoroballGroup> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_HoroballGroup__set_state(HoroballGroup __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.centers = __pyx_state[0]; __pyx_result.color = __pyx_state[1]; __pyx_result.cutoff = __pyx_state[2]; __pyx_result.horoballs = __pyx_state[3]; __pyx_result.keys = __pyx_state[4]; __pyx_result.list_id_base = __pyx_state[5]; __pyx_result.list_ids = __pyx_state[6]; __pyx_result.longitude = __pyx_state[7]; __pyx_result.meridian = __pyx_state[8]; __pyx_result.num_lists = __pyx_state[9]; __pyx_result.original_indices = __pyx_state[10]; __pyx_result.spheres = __pyx_state[11]
 *     if len(__pyx_state) > 12 and hasattr(__pyx_result, '__dict__'):
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_8CyOpenGL_5__pyx_unpickle_Label, NULL, __pyx_n_s_CyOpenGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Label, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_HoroballScene(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_3 = PyCFunction_NewEx(&__pyx_mdef_8CyOpenGL_7__pyx_unpickle_HoroballScene, NULL, __pyx_n_s_CyOpenGL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_HoroballScene, __pyx_t_3) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "CyOpenGL.pyx":1
 * include "CyOpenGL.pxi"             # <<<<<<<<<<<<<<
 * 
 * # This is part of the UCS2 hack.
 */
  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_kp_u_vector3___repr___line_51, __pyx_kp_u_vector3_0_1_2_0_0_1_0_2_0) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "carray.from_py":77
 * 
 * @cname("__Pyx_carray_from_py_GLfloat")
 * cdef int __Pyx_carray_from_py_GLfloat(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init CyOpenGL", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    Py_CLEAR(__pyx_m);
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init CyOpenGL");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
    if (unlikely(!result)) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = func->ob_type->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
                        CYTHON_UNUSED PyObject *cause) {
    __Pyx_PyThreadState_declare
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (**name == key) ? 0 :
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key);
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* PyCFunctionFastCall */
#if CYTHON_FAST_PYCCALL
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
    PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
    PyCFunction meth = PyCFunction_GET_FUNCTION(func);
    PyObject *self = PyCFunction_GET_SELF(func);
    int flags = PyCFunction_GET_FLAGS(func);
    assert(PyCFunction_Check(func));
    assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
    assert(nargs >= 0);
    assert(nargs == 0 || args != NULL);
    /* _PyCFunction_FastCallDict() must not be called with an exception set,
       because it may clear it (directly or indirectly) and so the
       caller loses its exception */
    assert(!PyErr_Occurred());
    if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
        return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
    } else {
        return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
    }
}
#endif

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
#if 1 || PY_VERSION_HEX < 0x030600B1
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif
#endif

/* PyObjectCall2Args */
static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args, *result = NULL;
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyFunction_FastCall(function, args, 2);
    }
    #endif
    #if CYTHON_FAST_PYCCALL
    if (__Pyx_PyFastCFunction_Check(function)) {
        PyObject *args[2] = {arg1, arg2};
        return __Pyx_PyCFunction_FastCall(function, args, 2);
    }
    #endif
    args = PyTuple_New(2);
    if (unlikely(!args)) goto done;
    Py_INCREF(arg1);
    PyTuple_SET_ITEM(args, 0, arg1);
    Py_INCREF(arg2);
    PyTuple_SET_ITEM(args, 1, arg2);
    Py_INCREF(function);
    result = __Pyx_PyObject_Call(function, args, NULL);
    Py_DECREF(args);
    Py_DECREF(function);
done:
    return result;
}

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectCallOneArg */
#if CYTHON_COMPILING_IN_CPYTHON
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_New(1);
    if (unlikely(!args)) return NULL;
    Py_INCREF(arg);
    PyTuple_SET_ITEM(args, 0, arg);
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, &arg, 1);
    }
#endif
    if (likely(PyCFunction_Check(func))) {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
            return __Pyx_PyObject_CallMethO(func, arg);
#if CYTHON_FAST_PYCCALL
        } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
            return __Pyx_PyCFunction_FastCall(func, &arg, 1);
#endif
        }
    }
    return __Pyx__PyObject_CallOneArg(func, arg);
}
#else
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *result;
    PyObject *args = PyTuple_Pack(1, arg);
    if (unlikely(!args)) return NULL;
    result = __Pyx_PyObject_Call(func, args, NULL);
    Py_DECREF(args);
    return result;
}
#endif

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kwdict,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    while (PyDict_Next(kwdict, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if ((!kw_allowed) && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (!j) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
        if (likely(m && m->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
                Py_ssize_t l = m->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return m->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* None */
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
    PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
}

/* None */
static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
    long r = a % b;
    r += ((r != 0) & ((r ^ b) < 0)) * b;
    return r;
}

/* FetchCommonType */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* fake_module;
    PyTypeObject* cached_type = NULL;
    fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
    if (!fake_module) return NULL;
    Py_INCREF(fake_module);
    cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
    if (cached_type) {
        if (!PyType_Check((PyObject*)cached_type)) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s is not a type object",
                type->tp_name);
            goto bad;
        }
        if (cached_type->tp_basicsize != type->tp_basicsize) {
            PyErr_Format(PyExc_TypeError,
                "Shared Cython type %.200s has the wrong size, try recompiling",
                type->tp_name);
            goto bad;
        }
    } else {
        if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
        PyErr_Clear();
        if (PyType_Ready(type) < 0) goto bad;
        if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
            goto bad;
        Py_INCREF(type);
        cached_type = type;
    }
done:
    Py_DECREF(fake_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}

/* CythonFunction */
#include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
{
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp = op->func_doc;
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    op->func_doc = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = op->func_name;
    Py_INCREF(value);
    op->func_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = op->func_qualname;
    Py_INCREF(value);
    op->func_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
{
    PyObject *self;
    self = m->func_closure;
    if (self == NULL)
        self = Py_None;
    Py_INCREF(self);
    return self;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    tmp = op->func_dict;
    Py_INCREF(value);
    op->func_dict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyTuple_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_tuple;
    op->defaults_tuple = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_tuple;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value) {
        value = Py_None;
    } else if (value != Py_None && !PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    tmp = op->defaults_kwdict;
    op->defaults_kwdict = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->defaults_kwdict;
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
    PyObject* tmp;
    if (!value || value == Py_None) {
        value = NULL;
    } else if (!PyDict_Check(value)) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    tmp = op->func_annotations;
    op->func_annotations = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
    PyObject* result = op->func_annotations;
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromString(m->func.m_ml->ml_name);
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
    if (op == NULL)
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    PyObject_GC_Track(op);
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
{
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
        Py_INCREF(func);
        return func;
    }
    if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
        if (type == NULL)
            type = (PyObject *)(Py_TYPE(obj));
        return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
    }
    if (obj == Py_None)
        obj = NULL;
    return __Pyx_PyMethod_New(func, obj, type);
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags in "
                        "__Pyx_CyFunction_Call. METH_OLDARGS is no "
                        "longer supported!");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
    0,
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_CyFunction_descr_get,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
};
static int __pyx_CyFunction_init(void) {
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
    if (unlikely(!(m && m->sq_item))) {
        PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
        return NULL;
    }
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
    PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
    if (likely(m && m->mp_subscript)) {
        return m->mp_subscript(obj, key);
    }
    return __Pyx_PyObject_GetIndex(obj, key);
}
#endif

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || (Py_TYPE(descr) == &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (descr != NULL) {
        *method = descr;
        return 0;
    }
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(name));
#endif
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod1 */
static PyObject* __Pyx__PyObject_CallMethod1(PyObject* method, PyObject* arg) {
    PyObject *result = __Pyx_PyObject_CallOneArg(method, arg);
    Py_DECREF(method);
    return result;
}
static PyObject* __Pyx_PyObject_CallMethod1(PyObject* obj, PyObject* method_name, PyObject* arg) {
    PyObject *method = NULL, *result;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_Call2Args(method, obj, arg);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) return NULL;
    return __Pyx__PyObject_CallMethod1(method, arg);
}

/* append */
static CYTHON_INLINE int __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (unlikely(__Pyx_PyList_Append(L, x) < 0)) return -1;
    } else {
        PyObject* retval = __Pyx_PyObject_CallMethod1(L, __pyx_n_s_append, x);
        if (unlikely(!retval))
            return -1;
        Py_DECREF(retval);
    }
    return 0;
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* ExtTypeTest */
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (unlikely(!type)) {
        PyErr_SetString(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (likely(__Pyx_TypeCheck(obj, type)))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
                 Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

/* PyObjectCallNoArg */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
#if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCall(func, NULL, 0);
    }
#endif
#ifdef __Pyx_CyFunction_USED
    if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
#else
    if (likely(PyCFunction_Check(func)))
#endif
    {
        if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
            return __Pyx_PyObject_CallMethO(func, NULL);
        }
    }
    return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
        double b = PyFloat_AS_DOUBLE(op2);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
        double a = PyFloat_AS_DOUBLE(op1);
            double result;
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_RemainderObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_RemainderObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
            x = a % b;
            x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_remainder(op1, op2);
            }
        }
                __Pyx_PyInt_RemainderObjC_ZeroDivisionError(b)
                x = a % b;
                x += ((x != 0) & ((x ^ b) < 0)) * b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla % llb;
                llx += ((llx != 0) & ((llx ^ llb) < 0)) * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceRemainder : PyNumber_Remainder)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
#if PY_MAJOR_VERSION < 3 || CYTHON_USE_PYLONG_INTERNALS
#define __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(operand)\
    if (unlikely(zerodivision_check && ((operand) == 0))) {\
        PyErr_SetString(PyExc_ZeroDivisionError, "integer division by zero");\
        return NULL;\
    }
#endif
static PyObject* __Pyx_PyInt_FloorDivideObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
    (void)inplace;
    (void)zerodivision_check;
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
            __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(b)
            if (unlikely(b == -1 && ((unsigned long)a) == 0-(unsigned long)a))
                return PyInt_Type.tp_as_number->nb_floor_divide(op1, op2);
            else {
                long q, r;
                q = a / b;
                r = a - q*b;
                q -= ((r != 0) & ((r ^ b) < 0));
                x = q;
            }
            return PyInt_FromLong(x);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
#ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
#endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_floor_divide(op1, op2);
            }
        }
                __Pyx_PyInt_FloorDivideObjC_ZeroDivisionError(b)
                {
                    long q, r;
                    q = a / b;
                    r = a - q*b;
                    q -= ((r != 0) & ((r ^ b) < 0));
                    x = q;
                }
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                {
                    PY_LONG_LONG q, r;
                    q = lla / llb;
                    r = lla - q*llb;
                    q -= ((r != 0) & ((r ^ llb) < 0));
                    llx = q;
                }
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    return (inplace ? PyNumber_InPlaceFloorDivide : PyNumber_FloorDivide)(op1, op2);
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
                                  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
                                  int full_traceback, CYTHON_UNUSED int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* None */
static CYTHON_INLINE double __Pyx_mod_double(double a, double b) {
    double r = fmod(a, b);
    r += ((r != 0) & ((r < 0) ^ (b < 0))) * b;
    return r;
}

/* GetAttr */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r = __Pyx_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* UnicodeAsUCS4 */
static CYTHON_INLINE Py_UCS4 __Pyx_PyUnicode_AsPy_UCS4(PyObject* x) {
   Py_ssize_t length;
   #if CYTHON_PEP393_ENABLED
   length = PyUnicode_GET_LENGTH(x);
   if (likely(length == 1)) {
       return PyUnicode_READ_CHAR(x, 0);
   }
   #else
   length = PyUnicode_GET_SIZE(x);
   if (likely(length == 1)) {
       return PyUnicode_AS_UNICODE(x)[0];
   }
   #if Py_UNICODE_SIZE == 2
   else if (PyUnicode_GET_SIZE(x) == 2) {
       Py_UCS4 high_val = PyUnicode_AS_UNICODE(x)[0];
       if (high_val >= 0xD800 && high_val <= 0xDBFF) {
           Py_UCS4 low_val = PyUnicode_AS_UNICODE(x)[1];
           if (low_val >= 0xDC00 && low_val <= 0xDFFF) {
               return 0x10000 + (((high_val & ((1<<10)-1)) << 10) | (low_val & ((1<<10)-1)));
           }
       }
   }
   #endif
   #endif
   PyErr_Format(PyExc_ValueError,
                "only single character unicode strings can be converted to Py_UCS4, "
                "got length %" CYTHON_FORMAT_SSIZE_T "d", length);
   return (Py_UCS4)-1;
}

/* object_ord */
static long __Pyx__PyObject_Ord(PyObject* c) {
    Py_ssize_t size;
    if (PyBytes_Check(c)) {
        size = PyBytes_GET_SIZE(c);
        if (likely(size == 1)) {
            return (unsigned char) PyBytes_AS_STRING(c)[0];
        }
#if PY_MAJOR_VERSION < 3
    } else if (PyUnicode_Check(c)) {
        return (long)__Pyx_PyUnicode_AsPy_UCS4(c);
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    } else if (PyByteArray_Check(c)) {
        size = PyByteArray_GET_SIZE(c);
        if (likely(size == 1)) {
            return (unsigned char) PyByteArray_AS_STRING(c)[0];
        }
#endif
    } else {
        PyErr_Format(PyExc_TypeError,
            "ord() expected string of length 1, but %.200s found", c->ob_type->tp_name);
        return (long)(Py_UCS4)-1;
    }
    PyErr_Format(PyExc_TypeError,
        "ord() expected a character, but string of length %zd found", size);
    return (long)(Py_UCS4)-1;
}

/* set_iter */
static CYTHON_INLINE PyObject* __Pyx_set_iterator(PyObject* iterable, int is_set,
                                                  Py_ssize_t* p_orig_length, int* p_source_is_set) {
#if CYTHON_COMPILING_IN_CPYTHON
    is_set = is_set || likely(PySet_CheckExact(iterable) || PyFrozenSet_CheckExact(iterable));
    *p_source_is_set = is_set;
    if (likely(is_set)) {
        *p_orig_length = PySet_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
    }
#else
    (void)is_set;
    *p_source_is_set = 0;
#endif
    *p_orig_length = 0;
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_set_iter_next(
        PyObject* iter_obj, Py_ssize_t orig_length,
        Py_ssize_t* ppos, PyObject **value,
        int source_is_set) {
    if (!CYTHON_COMPILING_IN_CPYTHON || unlikely(!source_is_set)) {
        *value = PyIter_Next(iter_obj);
        if (unlikely(!*value)) {
            return __Pyx_IterFinish();
        }
        (void)orig_length;
        (void)ppos;
        return 1;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    if (unlikely(PySet_GET_SIZE(iter_obj) != orig_length)) {
        PyErr_SetString(
            PyExc_RuntimeError,
            "set changed size during iteration");
        return -1;
    }
    {
        Py_hash_t hash;
        int ret = _PySet_NextEntry(iter_obj, ppos, value, &hash);
        assert (ret != -1);
        if (likely(ret)) {
            Py_INCREF(*value);
            return 1;
        }
    }
#endif
    return 0;
}

/* py_abs */
#if CYTHON_USE_PYLONG_INTERNALS
static PyObject *__Pyx_PyLong_AbsNeg(PyObject *n) {
    if (likely(Py_SIZE(n) == -1)) {
        return PyLong_FromLong(((PyLongObject*)n)->ob_digit[0]);
    }
#if CYTHON_COMPILING_IN_CPYTHON
    {
        PyObject *copy = _PyLong_Copy((PyLongObject*)n);
        if (likely(copy)) {
            Py_SIZE(copy) = -(Py_SIZE(copy));
        }
        return copy;
    }
#else
    return PyNumber_Negative(n);
#endif
}
#endif

/* PyFloatBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double b = floatval;
    double a, result;
    (void)inplace;
    (void)zerodivision_check;
    if (likely(PyFloat_CheckExact(op1))) {
        a = PyFloat_AS_DOUBLE(op1);
        
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
        
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        switch (size) {
            case  0: a = 0.0; break;
            case -1: a = -(double) digits[0]; break;
            case  1: a = (double) digits[0]; break;
            case -2:
            case 2:
                if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                    a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -2)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -3:
            case 3:
                if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -3)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -4:
            case 4:
                if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -4)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            default:
        #else
        {
        #endif
            a = PyLong_AsDouble(op1);
            if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
            
        }
    } else {
        return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
    }
        
        PyFPE_START_PROTECT("add", return NULL)
        result = a + b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* SliceObject */
  static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
        Py_ssize_t cstart, Py_ssize_t cstop,
        PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
        int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
#if CYTHON_USE_TYPE_SLOTS
    PyMappingMethods* mp;
#if PY_MAJOR_VERSION < 3
    PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
    if (likely(ms && ms->sq_slice)) {
        if (!has_cstart) {
            if (_py_start && (*_py_start != Py_None)) {
                cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
                if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstart = 0;
        }
        if (!has_cstop) {
            if (_py_stop && (*_py_stop != Py_None)) {
                cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
                if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
            } else
                cstop = PY_SSIZE_T_MAX;
        }
        if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
            Py_ssize_t l = ms->sq_length(obj);
            if (likely(l >= 0)) {
                if (cstop < 0) {
                    cstop += l;
                    if (cstop < 0) cstop = 0;
                }
                if (cstart < 0) {
                    cstart += l;
                    if (cstart < 0) cstart = 0;
                }
            } else {
                if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                    goto bad;
                PyErr_Clear();
            }
        }
        return ms->sq_slice(obj, cstart, cstop);
    }
#endif
    mp = Py_TYPE(obj)->tp_as_mapping;
    if (likely(mp && mp->mp_subscript))
#endif
    {
        PyObject* result;
        PyObject *py_slice, *py_start, *py_stop;
        if (_py_slice) {
            py_slice = *_py_slice;
        } else {
            PyObject* owned_start = NULL;
            PyObject* owned_stop = NULL;
            if (_py_start) {
                py_start = *_py_start;
            } else {
                if (has_cstart) {
                    owned_start = py_start = PyInt_FromSsize_t(cstart);
                    if (unlikely(!py_start)) goto bad;
                } else
                    py_start = Py_None;
            }
            if (_py_stop) {
                py_stop = *_py_stop;
            } else {
                if (has_cstop) {
                    owned_stop = py_stop = PyInt_FromSsize_t(cstop);
                    if (unlikely(!py_stop)) {
                        Py_XDECREF(owned_start);
                        goto bad;
                    }
                } else
                    py_stop = Py_None;
            }
            py_slice = PySlice_New(py_start, py_stop, Py_None);
            Py_XDECREF(owned_start);
            Py_XDECREF(owned_stop);
            if (unlikely(!py_slice)) goto bad;
        }
#if CYTHON_USE_TYPE_SLOTS
        result = mp->mp_subscript(obj, py_slice);
#else
        result = PyObject_GetItem(obj, py_slice);
#endif
        if (!_py_slice) {
            Py_DECREF(py_slice);
        }
        return result;
    }
    PyErr_Format(PyExc_TypeError,
        "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
bad:
    return NULL;
}

/* FastTypeChecks */
  #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
    if (!res) {
        res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
    return res;
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* HasAttr */
  static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (unlikely(!r)) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* pyobject_as_double */
  static double __Pyx__PyObject_AsDouble(PyObject* obj) {
    PyObject* float_value;
#if !CYTHON_USE_TYPE_SLOTS
    float_value = PyNumber_Float(obj);  if ((0)) goto bad;
#else
    PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
    if (likely(nb) && likely(nb->nb_float)) {
        float_value = nb->nb_float(obj);
        if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
            PyErr_Format(PyExc_TypeError,
                "__float__ returned non-float (type %.200s)",
                Py_TYPE(float_value)->tp_name);
            Py_DECREF(float_value);
            goto bad;
        }
    } else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
#if PY_MAJOR_VERSION >= 3
        float_value = PyFloat_FromString(obj);
#else
        float_value = PyFloat_FromString(obj, 0);
#endif
    } else {
        PyObject* args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        PyTuple_SET_ITEM(args, 0, obj);
        float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
        PyTuple_SET_ITEM(args, 0, 0);
        Py_DECREF(args);
    }
#endif
    if (likely(float_value)) {
        double value = PyFloat_AS_DOUBLE(float_value);
        Py_DECREF(float_value);
        return value;
    }
bad:
    return (double)-1;
}

/* PyFloatBinop */
  #if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_DivideObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double b = floatval;
    double a, result;
    (void)inplace;
    (void)zerodivision_check;
    if (likely(PyFloat_CheckExact(op1))) {
        a = PyFloat_AS_DOUBLE(op1);
        
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
        
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        switch (size) {
            case  0: a = 0.0; break;
            case -1: a = -(double) digits[0]; break;
            case  1: a = (double) digits[0]; break;
            case -2:
            case 2:
                if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                    a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -2)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -3:
            case 3:
                if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -3)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -4:
            case 4:
                if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -4)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            default:
        #else
        {
        #endif
            a = PyLong_AsDouble(op1);
            if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
            
        }
    } else {
        return (inplace ? __Pyx_PyNumber_InPlaceDivide(op1, op2) : __Pyx_PyNumber_Divide(op1, op2));
    }
        
        PyFPE_START_PROTECT("divide", return NULL)
        result = a / b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* Import */
    static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (!py_import)
        goto bad;
    #endif
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if (strchr(__Pyx_MODULE_NAME, '.')) {
                module = PyImport_ImportModuleLevelObject(
                    name, global_dict, empty_dict, list, 1);
                if (!module) {
                    if (!PyErr_ExceptionMatches(PyExc_ImportError))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (!py_level)
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, global_dict, empty_dict, list, level);
            #endif
        }
    }
bad:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    Py_XDECREF(empty_list);
    Py_XDECREF(empty_dict);
    return module;
}

/* ImportFrom */
    static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* CallNextTpTraverse */
    static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_traverse != current_tp_traverse)
        type = type->tp_base;
    while (type && type->tp_traverse == current_tp_traverse)
        type = type->tp_base;
    if (type && type->tp_traverse)
        return type->tp_traverse(obj, v, a);
    return 0;
}

/* CallNextTpClear */
    static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
    PyTypeObject* type = Py_TYPE(obj);
    while (type && type->tp_clear != current_tp_clear)
        type = type->tp_base;
    while (type && type->tp_clear == current_tp_clear)
        type = type->tp_base;
    if (type && type->tp_clear)
        type->tp_clear(obj);
}

/* PyObject_GenericGetAttrNoDict */
    #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'%.50s' object has no attribute '%U'",
                 tp->tp_name, attr_name);
#else
                 "'%.50s' object has no attribute '%.400s'",
                 tp->tp_name, PyString_AS_STRING(attr_name));
#endif
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
    #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* SetupReduce */
    static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
            ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
            ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
            setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto GOOD;
BAD:
    if (!PyErr_Occurred())
        PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
    ret = -1;
GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}

/* SetVTable */
    static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#if PY_VERSION_HEX >= 0x02070000
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
#else
    PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
#endif
    if (!ob)
        goto bad;
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* CalculateMetaclass */
    static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* Py3ClassCreate */
    static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs = PyTuple_Pack(2, name, bases);
            if (unlikely(!pargs)) {
                Py_DECREF(prep);
                return NULL;
            }
            ns = PyObject_Call(prep, pargs, mkw);
            Py_DECREF(prep);
            Py_DECREF(pargs);
        } else {
            if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
                return NULL;
            PyErr_Clear();
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result, *margs;
    PyObject *owned_metaclass = NULL;
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    margs = PyTuple_Pack(3, name, bases, dict);
    if (unlikely(!margs)) {
        result = NULL;
    } else {
        result = PyObject_Call(metaclass, margs, mkw);
        Py_DECREF(margs);
    }
    Py_XDECREF(owned_metaclass);
    return result;
}

/* CLineInTraceback */
    #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
    static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}

/* AddTraceback */
    #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_GLuint(GLuint value) {
    const GLuint neg_one = (GLuint) ((GLuint) 0 - (GLuint) 1), const_zero = (GLuint) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(GLuint) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(GLuint) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(GLuint) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(GLuint) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(GLuint) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(GLuint),
                                     little, !is_unsigned);
    }
}

/* CIntFromPyVerify */
    #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_GLint(GLint value) {
    const GLint neg_one = (GLint) ((GLint) 0 - (GLint) 1), const_zero = (GLint) 0;
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(GLint) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(GLint) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(GLint) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(GLint) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(GLint) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(GLint),
                                     little, !is_unsigned);
    }
}

/* Declarations */
    #if CYTHON_CCOMPLEX
  #ifdef __cplusplus
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return ::std::complex< double >(x, y);
    }
  #else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
  #endif
#else
    static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex z;
      z.real = x;
      z.imag = y;
      return z;
    }
#endif

/* Arithmetic */
    #if CYTHON_CCOMPLEX
#else
    static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) && (a.imag == b.imag);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }
    #if 1
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else if (fabs(b.real) >= fabs(b.imag)) {
            if (b.real == 0 && b.imag == 0) {
                return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
            } else {
                double r = b.imag / b.real;
                double s = (double)(1.0) / (b.real + b.imag * r);
                return __pyx_t_double_complex_from_parts(
                    (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
            }
        } else {
            double r = b.real / b.imag;
            double s = (double)(1.0) / (b.imag + b.real * r);
            return __pyx_t_double_complex_from_parts(
                (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
        }
    }
    #else
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        if (b.imag == 0) {
            return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
        } else {
            double denom = b.real * b.real + b.imag * b.imag;
            return __pyx_t_double_complex_from_parts(
                (a.real * b.real + a.imag * b.imag) / denom,
                (a.imag * b.real - a.real * b.imag) / denom);
        }
    }
    #endif
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }
    static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
       return (a.real == 0) && (a.imag == 0);
    }
    static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real =  a.real;
        z.imag = -a.imag;
        return z;
    }
    #if 1
        static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
          #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
            return sqrt(z.real*z.real + z.imag*z.imag);
          #else
            return hypot(z.real, z.imag);
          #endif
        }
        static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
            __pyx_t_double_complex z;
            double r, lnr, theta, z_r, z_theta;
            if (b.imag == 0 && b.real == (int)b.real) {
                if (b.real < 0) {
                    double denom = a.real * a.real + a.imag * a.imag;
                    a.real = a.real / denom;
                    a.imag = -a.imag / denom;
                    b.real = -b.real;
                }
                switch ((int)b.real) {
                    case 0:
                        z.real = 1;
                        z.imag = 0;
                        return z;
                    case 1:
                        return a;
                    case 2:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(a, a);
                    case 3:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, a);
                    case 4:
                        z = __Pyx_c_prod_double(a, a);
                        return __Pyx_c_prod_double(z, z);
                }
            }
            if (a.imag == 0) {
                if (a.real == 0) {
                    return a;
                } else if (b.imag == 0) {
                    z.real = pow(a.real, b.real);
                    z.imag = 0;
                    return z;
                } else if (a.real > 0) {
                    r = a.real;
                    theta = 0;
                } else {
                    r = -a.real;
                    theta = atan2(0.0, -1.0);
                }
            } else {
                r = __Pyx_c_abs_double(a);
                theta = atan2(a.imag, a.real);
            }
            lnr = log(r);
            z_r = exp(lnr * b.real - theta * b.imag);
            z_theta = theta * b.real + lnr * b.imag;
            z.real = z_r * cos(z_theta);
            z.imag = z_r * sin(z_theta);
            return z;
        }
    #endif
#endif

/* CIntFromPy */
    static CYTHON_INLINE GLuint __Pyx_PyInt_As_GLuint(PyObject *x) {
    const GLuint neg_one = (GLuint) ((GLuint) 0 - (GLuint) 1), const_zero = (GLuint) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(GLuint) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(GLuint, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (GLuint) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (GLuint) 0;
                case  1: __PYX_VERIFY_RETURN_INT(GLuint, digit, digits[0])
                case 2:
                    if (8 * sizeof(GLuint) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLuint, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLuint) >= 2 * PyLong_SHIFT) {
                            return (GLuint) (((((GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(GLuint) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLuint, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLuint) >= 3 * PyLong_SHIFT) {
                            return (GLuint) (((((((GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(GLuint) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLuint, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLuint) >= 4 * PyLong_SHIFT) {
                            return (GLuint) (((((((((GLuint)digits[3]) << PyLong_SHIFT) | (GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (GLuint) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(GLuint) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLuint, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(GLuint) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLuint, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (GLuint) 0;
                case -1: __PYX_VERIFY_RETURN_INT(GLuint, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(GLuint,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(GLuint) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLuint, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLuint) - 1 > 2 * PyLong_SHIFT) {
                            return (GLuint) (((GLuint)-1)*(((((GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(GLuint) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLuint, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLuint) - 1 > 2 * PyLong_SHIFT) {
                            return (GLuint) ((((((GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(GLuint) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLuint, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLuint) - 1 > 3 * PyLong_SHIFT) {
                            return (GLuint) (((GLuint)-1)*(((((((GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(GLuint) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLuint, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLuint) - 1 > 3 * PyLong_SHIFT) {
                            return (GLuint) ((((((((GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(GLuint) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLuint, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLuint) - 1 > 4 * PyLong_SHIFT) {
                            return (GLuint) (((GLuint)-1)*(((((((((GLuint)digits[3]) << PyLong_SHIFT) | (GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(GLuint) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLuint, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLuint) - 1 > 4 * PyLong_SHIFT) {
                            return (GLuint) ((((((((((GLuint)digits[3]) << PyLong_SHIFT) | (GLuint)digits[2]) << PyLong_SHIFT) | (GLuint)digits[1]) << PyLong_SHIFT) | (GLuint)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(GLuint) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLuint, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(GLuint) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLuint, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            GLuint val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (GLuint) -1;
        }
    } else {
        GLuint val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (GLuint) -1;
        val = __Pyx_PyInt_As_GLuint(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to GLuint");
    return (GLuint) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to GLuint");
    return (GLuint) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
    const int neg_one = (int) ((int) 0 - (int) 1), const_zero = (int) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(int) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(int) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(int) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE GLint __Pyx_PyInt_As_GLint(PyObject *x) {
    const GLint neg_one = (GLint) ((GLint) 0 - (GLint) 1), const_zero = (GLint) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(GLint) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(GLint, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (GLint) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (GLint) 0;
                case  1: __PYX_VERIFY_RETURN_INT(GLint, digit, digits[0])
                case 2:
                    if (8 * sizeof(GLint) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLint, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLint) >= 2 * PyLong_SHIFT) {
                            return (GLint) (((((GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(GLint) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLint, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLint) >= 3 * PyLong_SHIFT) {
                            return (GLint) (((((((GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(GLint) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLint, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLint) >= 4 * PyLong_SHIFT) {
                            return (GLint) (((((((((GLint)digits[3]) << PyLong_SHIFT) | (GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (GLint) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(GLint) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLint, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(GLint) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLint, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (GLint) 0;
                case -1: __PYX_VERIFY_RETURN_INT(GLint, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(GLint,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(GLint) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLint, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLint) - 1 > 2 * PyLong_SHIFT) {
                            return (GLint) (((GLint)-1)*(((((GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(GLint) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLint, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLint) - 1 > 2 * PyLong_SHIFT) {
                            return (GLint) ((((((GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(GLint) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLint, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLint) - 1 > 3 * PyLong_SHIFT) {
                            return (GLint) (((GLint)-1)*(((((((GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(GLint) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLint, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLint) - 1 > 3 * PyLong_SHIFT) {
                            return (GLint) ((((((((GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(GLint) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLint, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLint) - 1 > 4 * PyLong_SHIFT) {
                            return (GLint) (((GLint)-1)*(((((((((GLint)digits[3]) << PyLong_SHIFT) | (GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(GLint) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLint, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLint) - 1 > 4 * PyLong_SHIFT) {
                            return (GLint) ((((((((((GLint)digits[3]) << PyLong_SHIFT) | (GLint)digits[2]) << PyLong_SHIFT) | (GLint)digits[1]) << PyLong_SHIFT) | (GLint)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(GLint) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLint, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(GLint) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLint, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            GLint val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (GLint) -1;
        }
    } else {
        GLint val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (GLint) -1;
        val = __Pyx_PyInt_As_GLint(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to GLint");
    return (GLint) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to GLint");
    return (GLint) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
    const long neg_one = (long) ((long) 0 - (long) 1), const_zero = (long) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(long) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(long) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(long) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE GLenum __Pyx_PyInt_As_GLenum(PyObject *x) {
    const GLenum neg_one = (GLenum) ((GLenum) 0 - (GLenum) 1), const_zero = (GLenum) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(GLenum) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(GLenum, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (GLenum) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (GLenum) 0;
                case  1: __PYX_VERIFY_RETURN_INT(GLenum, digit, digits[0])
                case 2:
                    if (8 * sizeof(GLenum) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLenum, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLenum) >= 2 * PyLong_SHIFT) {
                            return (GLenum) (((((GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(GLenum) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLenum, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLenum) >= 3 * PyLong_SHIFT) {
                            return (GLenum) (((((((GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(GLenum) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLenum, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLenum) >= 4 * PyLong_SHIFT) {
                            return (GLenum) (((((((((GLenum)digits[3]) << PyLong_SHIFT) | (GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (GLenum) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(GLenum) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLenum, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(GLenum) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLenum, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (GLenum) 0;
                case -1: __PYX_VERIFY_RETURN_INT(GLenum, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(GLenum,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(GLenum) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLenum, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLenum) - 1 > 2 * PyLong_SHIFT) {
                            return (GLenum) (((GLenum)-1)*(((((GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(GLenum) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLenum, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLenum) - 1 > 2 * PyLong_SHIFT) {
                            return (GLenum) ((((((GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(GLenum) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLenum, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLenum) - 1 > 3 * PyLong_SHIFT) {
                            return (GLenum) (((GLenum)-1)*(((((((GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(GLenum) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLenum, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLenum) - 1 > 3 * PyLong_SHIFT) {
                            return (GLenum) ((((((((GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(GLenum) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLenum, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLenum) - 1 > 4 * PyLong_SHIFT) {
                            return (GLenum) (((GLenum)-1)*(((((((((GLenum)digits[3]) << PyLong_SHIFT) | (GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(GLenum) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLenum, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLenum) - 1 > 4 * PyLong_SHIFT) {
                            return (GLenum) ((((((((((GLenum)digits[3]) << PyLong_SHIFT) | (GLenum)digits[2]) << PyLong_SHIFT) | (GLenum)digits[1]) << PyLong_SHIFT) | (GLenum)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(GLenum) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLenum, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(GLenum) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLenum, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            GLenum val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (GLenum) -1;
        }
    } else {
        GLenum val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (GLenum) -1;
        val = __Pyx_PyInt_As_GLenum(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to GLenum");
    return (GLenum) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to GLenum");
    return (GLenum) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
    const size_t neg_one = (size_t) ((size_t) 0 - (size_t) 1), const_zero = (size_t) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(size_t) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 2 * PyLong_SHIFT) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 3 * PyLong_SHIFT) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) >= 4 * PyLong_SHIFT) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(size_t) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(size_t) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(size_t) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(size_t) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(size_t) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(size_t) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE GLushort __Pyx_PyInt_As_GLushort(PyObject *x) {
    const GLushort neg_one = (GLushort) ((GLushort) 0 - (GLushort) 1), const_zero = (GLushort) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(GLushort) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(GLushort, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (GLushort) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (GLushort) 0;
                case  1: __PYX_VERIFY_RETURN_INT(GLushort, digit, digits[0])
                case 2:
                    if (8 * sizeof(GLushort) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLushort, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLushort) >= 2 * PyLong_SHIFT) {
                            return (GLushort) (((((GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(GLushort) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLushort, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLushort) >= 3 * PyLong_SHIFT) {
                            return (GLushort) (((((((GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(GLushort) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLushort, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLushort) >= 4 * PyLong_SHIFT) {
                            return (GLushort) (((((((((GLushort)digits[3]) << PyLong_SHIFT) | (GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (GLushort) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(GLushort) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLushort, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(GLushort) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLushort, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (GLushort) 0;
                case -1: __PYX_VERIFY_RETURN_INT(GLushort, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(GLushort,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(GLushort) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLushort, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLushort) - 1 > 2 * PyLong_SHIFT) {
                            return (GLushort) (((GLushort)-1)*(((((GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(GLushort) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLushort, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLushort) - 1 > 2 * PyLong_SHIFT) {
                            return (GLushort) ((((((GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(GLushort) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLushort, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLushort) - 1 > 3 * PyLong_SHIFT) {
                            return (GLushort) (((GLushort)-1)*(((((((GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(GLushort) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLushort, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLushort) - 1 > 3 * PyLong_SHIFT) {
                            return (GLushort) ((((((((GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(GLushort) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLushort, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLushort) - 1 > 4 * PyLong_SHIFT) {
                            return (GLushort) (((GLushort)-1)*(((((((((GLushort)digits[3]) << PyLong_SHIFT) | (GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(GLushort) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLushort, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLushort) - 1 > 4 * PyLong_SHIFT) {
                            return (GLushort) ((((((((((GLushort)digits[3]) << PyLong_SHIFT) | (GLushort)digits[2]) << PyLong_SHIFT) | (GLushort)digits[1]) << PyLong_SHIFT) | (GLushort)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(GLushort) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLushort, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(GLushort) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLushort, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            GLushort val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (GLushort) -1;
        }
    } else {
        GLushort val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (GLushort) -1;
        val = __Pyx_PyInt_As_GLushort(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to GLushort");
    return (GLushort) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to GLushort");
    return (GLushort) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE GLsizei __Pyx_PyInt_As_GLsizei(PyObject *x) {
    const GLsizei neg_one = (GLsizei) ((GLsizei) 0 - (GLsizei) 1), const_zero = (GLsizei) 0;
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if (sizeof(GLsizei) < sizeof(long)) {
            __PYX_VERIFY_RETURN_INT(GLsizei, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (GLsizei) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (GLsizei) 0;
                case  1: __PYX_VERIFY_RETURN_INT(GLsizei, digit, digits[0])
                case 2:
                    if (8 * sizeof(GLsizei) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLsizei, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLsizei) >= 2 * PyLong_SHIFT) {
                            return (GLsizei) (((((GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(GLsizei) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLsizei, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLsizei) >= 3 * PyLong_SHIFT) {
                            return (GLsizei) (((((((GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(GLsizei) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLsizei, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLsizei) >= 4 * PyLong_SHIFT) {
                            return (GLsizei) (((((((((GLsizei)digits[3]) << PyLong_SHIFT) | (GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (GLsizei) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if (sizeof(GLsizei) <= sizeof(unsigned long)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLsizei, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(GLsizei) <= sizeof(unsigned PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLsizei, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (GLsizei) 0;
                case -1: __PYX_VERIFY_RETURN_INT(GLsizei, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(GLsizei,  digit, +digits[0])
                case -2:
                    if (8 * sizeof(GLsizei) - 1 > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLsizei, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLsizei) - 1 > 2 * PyLong_SHIFT) {
                            return (GLsizei) (((GLsizei)-1)*(((((GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if (8 * sizeof(GLsizei) > 1 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLsizei, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLsizei) - 1 > 2 * PyLong_SHIFT) {
                            return (GLsizei) ((((((GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if (8 * sizeof(GLsizei) - 1 > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLsizei, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLsizei) - 1 > 3 * PyLong_SHIFT) {
                            return (GLsizei) (((GLsizei)-1)*(((((((GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if (8 * sizeof(GLsizei) > 2 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLsizei, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLsizei) - 1 > 3 * PyLong_SHIFT) {
                            return (GLsizei) ((((((((GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if (8 * sizeof(GLsizei) - 1 > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLsizei, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLsizei) - 1 > 4 * PyLong_SHIFT) {
                            return (GLsizei) (((GLsizei)-1)*(((((((((GLsizei)digits[3]) << PyLong_SHIFT) | (GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if (8 * sizeof(GLsizei) > 3 * PyLong_SHIFT) {
                        if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
                            __PYX_VERIFY_RETURN_INT(GLsizei, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if (8 * sizeof(GLsizei) - 1 > 4 * PyLong_SHIFT) {
                            return (GLsizei) ((((((((((GLsizei)digits[3]) << PyLong_SHIFT) | (GLsizei)digits[2]) << PyLong_SHIFT) | (GLsizei)digits[1]) << PyLong_SHIFT) | (GLsizei)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if (sizeof(GLsizei) <= sizeof(long)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLsizei, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if (sizeof(GLsizei) <= sizeof(PY_LONG_LONG)) {
                __PYX_VERIFY_RETURN_INT_EXC(GLsizei, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
#else
            GLsizei val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (GLsizei) -1;
        }
    } else {
        GLsizei val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (GLsizei) -1;
        val = __Pyx_PyInt_As_GLsizei(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to GLsizei");
    return (GLsizei) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to GLsizei");
    return (GLsizei) -1;
}

/* SwapException */
    #if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = *type;
    exc_info->exc_value = *value;
    exc_info->exc_traceback = *tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = *type;
    tstate->exc_value = *value;
    tstate->exc_traceback = *tb;
    #endif
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#else
static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
    PyErr_SetExcInfo(*type, *value, *tb);
    *type = tmp_type;
    *value = tmp_value;
    *tb = tmp_tb;
}
#endif

/* CoroutineBase */
    #include <structmember.h>
#include <frameobject.h>
#define __Pyx_Coroutine_Undelegate(gen) Py_CLEAR((gen)->yieldfrom)
static int __Pyx_PyGen__FetchStopIterationValue(CYTHON_UNUSED PyThreadState *__pyx_tstate, PyObject **pvalue) {
    PyObject *et, *ev, *tb;
    PyObject *value = NULL;
    __Pyx_ErrFetch(&et, &ev, &tb);
    if (!et) {
        Py_XDECREF(tb);
        Py_XDECREF(ev);
        Py_INCREF(Py_None);
        *pvalue = Py_None;
        return 0;
    }
    if (likely(et == PyExc_StopIteration)) {
        if (!ev) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#if PY_VERSION_HEX >= 0x030300A0
        else if (Py_TYPE(ev) == (PyTypeObject*)PyExc_StopIteration) {
            value = ((PyStopIterationObject *)ev)->value;
            Py_INCREF(value);
            Py_DECREF(ev);
        }
#endif
        else if (unlikely(PyTuple_Check(ev))) {
            if (PyTuple_GET_SIZE(ev) >= 1) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                value = PyTuple_GET_ITEM(ev, 0);
                Py_INCREF(value);
#else
                value = PySequence_ITEM(ev, 0);
#endif
            } else {
                Py_INCREF(Py_None);
                value = Py_None;
            }
            Py_DECREF(ev);
        }
        else if (!__Pyx_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration)) {
            value = ev;
        }
        if (likely(value)) {
            Py_XDECREF(tb);
            Py_DECREF(et);
            *pvalue = value;
            return 0;
        }
    } else if (!__Pyx_PyErr_GivenExceptionMatches(et, PyExc_StopIteration)) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    PyErr_NormalizeException(&et, &ev, &tb);
    if (unlikely(!PyObject_TypeCheck(ev, (PyTypeObject*)PyExc_StopIteration))) {
        __Pyx_ErrRestore(et, ev, tb);
        return -1;
    }
    Py_XDECREF(tb);
    Py_DECREF(et);
#if PY_VERSION_HEX >= 0x030300A0
    value = ((PyStopIterationObject *)ev)->value;
    Py_INCREF(value);
    Py_DECREF(ev);
#else
    {
        PyObject* args = __Pyx_PyObject_GetAttrStr(ev, __pyx_n_s_args);
        Py_DECREF(ev);
        if (likely(args)) {
            value = PySequence_GetItem(args, 0);
            Py_DECREF(args);
        }
        if (unlikely(!value)) {
            __Pyx_ErrRestore(NULL, NULL, NULL);
            Py_INCREF(Py_None);
            value = Py_None;
        }
    }
#endif
    *pvalue = value;
    return 0;
}
static CYTHON_INLINE
void __Pyx_Coroutine_ExceptionClear(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *t, *v, *tb;
    t = exc_state->exc_type;
    v = exc_state->exc_value;
    tb = exc_state->exc_traceback;
    exc_state->exc_type = NULL;
    exc_state->exc_value = NULL;
    exc_state->exc_traceback = NULL;
    Py_XDECREF(t);
    Py_XDECREF(v);
    Py_XDECREF(tb);
}
#define __Pyx_Coroutine_AlreadyRunningError(gen)  (__Pyx__Coroutine_AlreadyRunningError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyRunningError(CYTHON_UNUSED __pyx_CoroutineObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check((PyObject*)gen)) {
        msg = "coroutine already executing";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact((PyObject*)gen)) {
        msg = "async generator already executing";
    #endif
    } else {
        msg = "generator already executing";
    }
    PyErr_SetString(PyExc_ValueError, msg);
}
#define __Pyx_Coroutine_NotStartedError(gen)  (__Pyx__Coroutine_NotStartedError(gen), (PyObject*)NULL)
static void __Pyx__Coroutine_NotStartedError(CYTHON_UNUSED PyObject *gen) {
    const char *msg;
    if ((0)) {
    #ifdef __Pyx_Coroutine_USED
    } else if (__Pyx_Coroutine_Check(gen)) {
        msg = "can't send non-None value to a just-started coroutine";
    #endif
    #ifdef __Pyx_AsyncGen_USED
    } else if (__Pyx_AsyncGen_CheckExact(gen)) {
        msg = "can't send non-None value to a just-started async generator";
    #endif
    } else {
        msg = "can't send non-None value to a just-started generator";
    }
    PyErr_SetString(PyExc_TypeError, msg);
}
#define __Pyx_Coroutine_AlreadyTerminatedError(gen, value, closing)  (__Pyx__Coroutine_AlreadyTerminatedError(gen, value, closing), (PyObject*)NULL)
static void __Pyx__Coroutine_AlreadyTerminatedError(CYTHON_UNUSED PyObject *gen, PyObject *value, CYTHON_UNUSED int closing) {
    #ifdef __Pyx_Coroutine_USED
    if (!closing && __Pyx_Coroutine_Check(gen)) {
        PyErr_SetString(PyExc_RuntimeError, "cannot reuse already awaited coroutine");
    } else
    #endif
    if (value) {
        #ifdef __Pyx_AsyncGen_USED
        if (__Pyx_AsyncGen_CheckExact(gen))
            PyErr_SetNone(__Pyx_PyExc_StopAsyncIteration);
        else
        #endif
        PyErr_SetNone(PyExc_StopIteration);
    }
}
static
PyObject *__Pyx_Coroutine_SendEx(__pyx_CoroutineObject *self, PyObject *value, int closing) {
    __Pyx_PyThreadState_declare
    PyThreadState *tstate;
    __Pyx_ExcInfoStruct *exc_state;
    PyObject *retval;
    assert(!self->is_running);
    if (unlikely(self->resume_label == 0)) {
        if (unlikely(value && value != Py_None)) {
            return __Pyx_Coroutine_NotStartedError((PyObject*)self);
        }
    }
    if (unlikely(self->resume_label == -1)) {
        return __Pyx_Coroutine_AlreadyTerminatedError((PyObject*)self, value, closing);
    }
#if CYTHON_FAST_THREAD_STATE
    __Pyx_PyThreadState_assign
    tstate = __pyx_tstate;
#else
    tstate = __Pyx_PyThreadState_Current;
#endif
    exc_state = &self->gi_exc_state;
    if (exc_state->exc_type) {
        #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
        #else
        if (exc_state->exc_traceback) {
            PyTracebackObject *tb = (PyTracebackObject *) exc_state->exc_traceback;
            PyFrameObject *f = tb->tb_frame;
            Py_XINCREF(tstate->frame);
            assert(f->f_back == NULL);
            f->f_back = tstate->frame;
        }
        #endif
    }
#if CYTHON_USE_EXC_INFO_STACK
    exc_state->previous_item = tstate->exc_info;
    tstate->exc_info = exc_state;
#else
    if (exc_state->exc_type) {
        __Pyx_ExceptionSwap(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    } else {
        __Pyx_Coroutine_ExceptionClear(exc_state);
        __Pyx_ExceptionSave(&exc_state->exc_type, &exc_state->exc_value, &exc_state->exc_traceback);
    }
#endif
    self->is_running = 1;
    retval = self->body((PyObject *) self, tstate, value);
    self->is_running = 0;
#if CYTHON_USE_EXC_INFO_STACK
    exc_state = &self->gi_exc_state;
    tstate->exc_info = exc_state->previous_item;
    exc_state->previous_item = NULL;
    __Pyx_Coroutine_ResetFrameBackpointer(exc_state);
#endif
    return retval;
}
static CYTHON_INLINE void __Pyx_Coroutine_ResetFrameBackpointer(__Pyx_ExcInfoStruct *exc_state) {
    PyObject *exc_tb = exc_state->exc_traceback;
    if (likely(exc_tb)) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
#else
        PyTracebackObject *tb = (PyTracebackObject *) exc_tb;
        PyFrameObject *f = tb->tb_frame;
        Py_CLEAR(f->f_back);
#endif
    }
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_MethodReturn(CYTHON_UNUSED PyObject* gen, PyObject *retval) {
    if (unlikely(!retval)) {
        __Pyx_PyThreadState_declare
        __Pyx_PyThreadState_assign
        if (!__Pyx_PyErr_Occurred()) {
            PyObject *exc = PyExc_StopIteration;
            #ifdef __Pyx_AsyncGen_USED
            if (__Pyx_AsyncGen_CheckExact(gen))
                exc = __Pyx_PyExc_StopAsyncIteration;
            #endif
            __Pyx_PyErr_SetNone(exc);
        }
    }
    return retval;
}
static CYTHON_INLINE
PyObject *__Pyx_Coroutine_FinishDelegation(__pyx_CoroutineObject *gen) {
    PyObject *ret;
    PyObject *val = NULL;
    __Pyx_Coroutine_Undelegate(gen);
    __Pyx_PyGen__FetchStopIterationValue(__Pyx_PyThreadState_Current, &val);
    ret = __Pyx_Coroutine_SendEx(gen, val, 0);
    Py_XDECREF(val);
    return ret;
}
static PyObject *__Pyx_Coroutine_Send(PyObject *self, PyObject *value) {
    PyObject *retval;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, value);
        } else
        #endif
        #ifdef __Pyx_AsyncGen_USED
        if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
            ret = __Pyx_async_gen_asend_send(yf, value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03050000 && defined(PyCoro_CheckExact) && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyCoro_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, value == Py_None ? NULL : value);
        } else
        #endif
        {
            if (value == Py_None)
                ret = Py_TYPE(yf)->tp_iternext(yf);
            else
                ret = __Pyx_PyObject_CallMethod1(yf, __pyx_n_s_send, value);
        }
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        retval = __Pyx_Coroutine_FinishDelegation(gen);
    } else {
        retval = __Pyx_Coroutine_SendEx(gen, value, 0);
    }
    return __Pyx_Coroutine_MethodReturn(self, retval);
}
static int __Pyx_Coroutine_CloseIter(__pyx_CoroutineObject *gen, PyObject *yf) {
    PyObject *retval = NULL;
    int err = 0;
    #ifdef __Pyx_Generator_USED
    if (__Pyx_Generator_CheckExact(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_Coroutine_USED
    if (__Pyx_Coroutine_Check(yf)) {
        retval = __Pyx_Coroutine_Close(yf);
        if (!retval)
            return -1;
    } else
    if (__Pyx_CoroutineAwait_CheckExact(yf)) {
        retval = __Pyx_CoroutineAwait_Close((__pyx_CoroutineAwaitObject*)yf, NULL);
        if (!retval)
            return -1;
    } else
    #endif
    #ifdef __Pyx_AsyncGen_USED
    if (__pyx_PyAsyncGenASend_CheckExact(yf)) {
        retval = __Pyx_async_gen_asend_close(yf, NULL);
    } else
    if (__pyx_PyAsyncGenAThrow_CheckExact(yf)) {
        retval = __Pyx_async_gen_athrow_close(yf, NULL);
    } else
    #endif
    {
        PyObject *meth;
        gen->is_running = 1;
        meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_close);
        if (unlikely(!meth)) {
            if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                PyErr_WriteUnraisable(yf);
            }
            PyErr_Clear();
        } else {
            retval = PyObject_CallFunction(meth, NULL);
            Py_DECREF(meth);
            if (!retval)
                err = -1;
        }
        gen->is_running = 0;
    }
    Py_XDECREF(retval);
    return err;
}
static PyObject *__Pyx_Generator_Next(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject*) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        gen->is_running = 1;
        #ifdef __Pyx_Generator_USED
        if (__Pyx_Generator_CheckExact(yf)) {
            ret = __Pyx_Generator_Next(yf);
        } else
        #endif
        #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03030000 && (defined(__linux__) || PY_VERSION_HEX >= 0x030600B3)
        if (PyGen_CheckExact(yf)) {
            ret = _PyGen_Send((PyGenObject*)yf, NULL);
        } else
        #endif
        #ifdef __Pyx_Coroutine_USED
        if (__Pyx_Coroutine_Check(yf)) {
            ret = __Pyx_Coroutine_Send(yf, Py_None);
        } else
        #endif
            ret = Py_TYPE(yf)->tp_iternext(yf);
        gen->is_running = 0;
        if (likely(ret)) {
            return ret;
        }
        return __Pyx_Coroutine_FinishDelegation(gen);
    }
    return __Pyx_Coroutine_SendEx(gen, Py_None, 0);
}
static PyObject *__Pyx_Coroutine_Close_Method(PyObject *self, CYTHON_UNUSED PyObject *arg) {
    return __Pyx_Coroutine_Close(self);
}
static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *retval, *raised_exception;
    PyObject *yf = gen->yieldfrom;
    int err = 0;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        Py_INCREF(yf);
        err = __Pyx_Coroutine_CloseIter(gen, yf);
        __Pyx_Coroutine_Undelegate(gen);
        Py_DECREF(yf);
    }
    if (err == 0)
        PyErr_SetNone(PyExc_GeneratorExit);
    retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
    if (unlikely(retval)) {
        const char *msg;
        Py_DECREF(retval);
        if ((0)) {
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_Coroutine_Check(self)) {
            msg = "coroutine ignored GeneratorExit";
        #endif
        #ifdef __Pyx_AsyncGen_USED
        } else if (__Pyx_AsyncGen_CheckExact(self)) {
#if PY_VERSION_HEX < 0x03060000
            msg = "async generator ignored GeneratorExit - might require Python 3.6+ finalisation (PEP 525)";
#else
            msg = "async generator ignored GeneratorExit";
#endif
        #endif
        } else {
            msg = "generator ignored GeneratorExit";
        }
        PyErr_SetString(PyExc_RuntimeError, msg);
        return NULL;
    }
    raised_exception = PyErr_Occurred();
    if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
        if (raised_exception) PyErr_Clear();
        Py_INCREF(Py_None);
        return Py_None;
    }
    return NULL;
}
static PyObject *__Pyx__Coroutine_Throw(PyObject *self, PyObject *typ, PyObject *val, PyObject *tb,
                                        PyObject *args, int close_on_genexit) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject *yf = gen->yieldfrom;
    if (unlikely(gen->is_running))
        return __Pyx_Coroutine_AlreadyRunningError(gen);
    if (yf) {
        PyObject *ret;
        Py_INCREF(yf);
        if (__Pyx_PyErr_GivenExceptionMatches(typ, PyExc_GeneratorExit) && close_on_genexit) {
            int err = __Pyx_Coroutine_CloseIter(gen, yf);
            Py_DECREF(yf);
            __Pyx_Coroutine_Undelegate(gen);
            if (err < 0)
                return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
            goto throw_here;
        }
        gen->is_running = 1;
        if (0
        #ifdef __Pyx_Generator_USED
            || __Pyx_Generator_CheckExact(yf)
        #endif
        #ifdef __Pyx_Coroutine_USED
            || __Pyx_Coroutine_Check(yf)
        #endif
            ) {
            ret = __Pyx__Coroutine_Throw(yf, typ, val, tb, args, close_on_genexit);
        #ifdef __Pyx_Coroutine_USED
        } else if (__Pyx_CoroutineAwait_CheckExact(yf)) {
            ret = __Pyx__Coroutine_Throw(((__pyx_CoroutineAwaitObject*)yf)->coroutine, typ, val, tb, args, close_on_genexit);
        #endif
        } else {
            PyObject *meth = __Pyx_PyObject_GetAttrStr(yf, __pyx_n_s_throw);
            if (unlikely(!meth)) {
                Py_DECREF(yf);
                if (!PyErr_ExceptionMatches(PyExc_AttributeError)) {
                    gen->is_running = 0;
                    return NULL;
                }
                PyErr_Clear();
                __Pyx_Coroutine_Undelegate(gen);
                gen->is_running = 0;
                goto throw_here;
            }
            if (likely(args)) {
                ret = PyObject_CallObject(meth, args);
            } else {
                ret = PyObject_CallFunctionObjArgs(meth, typ, val, tb, NULL);
            }
            Py_DECREF(meth);
        }
        gen->is_running = 0;
        Py_DECREF(yf);
        if (!ret) {
            ret = __Pyx_Coroutine_FinishDelegation(gen);
        }
        return __Pyx_Coroutine_MethodReturn(self, ret);
    }
throw_here:
    __Pyx_Raise(typ, val, tb, NULL);
    return __Pyx_Coroutine_MethodReturn(self, __Pyx_Coroutine_SendEx(gen, NULL, 0));
}
static PyObject *__Pyx_Coroutine_Throw(PyObject *self, PyObject *args) {
    PyObject *typ;
    PyObject *val = NULL;
    PyObject *tb = NULL;
    if (!PyArg_UnpackTuple(args, (char *)"throw", 1, 3, &typ, &val, &tb))
        return NULL;
    return __Pyx__Coroutine_Throw(self, typ, val, tb, args, 1);
}
static CYTHON_INLINE int __Pyx_Coroutine_traverse_excstate(__Pyx_ExcInfoStruct *exc_state, visitproc visit, void *arg) {
    Py_VISIT(exc_state->exc_type);
    Py_VISIT(exc_state->exc_value);
    Py_VISIT(exc_state->exc_traceback);
    return 0;
}
static int __Pyx_Coroutine_traverse(__pyx_CoroutineObject *gen, visitproc visit, void *arg) {
    Py_VISIT(gen->closure);
    Py_VISIT(gen->classobj);
    Py_VISIT(gen->yieldfrom);
    return __Pyx_Coroutine_traverse_excstate(&gen->gi_exc_state, visit, arg);
}
static int __Pyx_Coroutine_clear(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    Py_CLEAR(gen->closure);
    Py_CLEAR(gen->classobj);
    Py_CLEAR(gen->yieldfrom);
    __Pyx_Coroutine_ExceptionClear(&gen->gi_exc_state);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        Py_CLEAR(((__pyx_PyAsyncGenObject*)gen)->ag_finalizer);
    }
#endif
    Py_CLEAR(gen->gi_code);
    Py_CLEAR(gen->gi_name);
    Py_CLEAR(gen->gi_qualname);
    Py_CLEAR(gen->gi_modulename);
    return 0;
}
static void __Pyx_Coroutine_dealloc(PyObject *self) {
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    PyObject_GC_UnTrack(gen);
    if (gen->gi_weakreflist != NULL)
        PyObject_ClearWeakRefs(self);
    if (gen->resume_label >= 0) {
        PyObject_GC_Track(self);
#if PY_VERSION_HEX >= 0x030400a1 && CYTHON_USE_TP_FINALIZE
        if (PyObject_CallFinalizerFromDealloc(self))
#else
        Py_TYPE(gen)->tp_del(self);
        if (self->ob_refcnt > 0)
#endif
        {
            return;
        }
        PyObject_GC_UnTrack(self);
    }
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        /* We have to handle this case for asynchronous generators
           right here, because this code has to be between UNTRACK
           and GC_Del. */
        Py_CLEAR(((__pyx_PyAsyncGenObject*)self)->ag_finalizer);
    }
#endif
    __Pyx_Coroutine_clear(self);
    PyObject_GC_Del(gen);
}
static void __Pyx_Coroutine_del(PyObject *self) {
    PyObject *error_type, *error_value, *error_traceback;
    __pyx_CoroutineObject *gen = (__pyx_CoroutineObject *) self;
    __Pyx_PyThreadState_declare
    if (gen->resume_label < 0) {
        return;
    }
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt == 0);
    self->ob_refcnt = 1;
#endif
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&error_type, &error_value, &error_traceback);
#ifdef __Pyx_AsyncGen_USED
    if (__Pyx_AsyncGen_CheckExact(self)) {
        __pyx_PyAsyncGenObject *agen = (__pyx_PyAsyncGenObject*)self;
        PyObject *finalizer = agen->ag_finalizer;
        if (finalizer && !agen->ag_closed) {
            PyObject *res = __Pyx_PyObject_CallOneArg(finalizer, self);
            if (unlikely(!res)) {
                PyErr_WriteUnraisable(self);
            } else {
                Py_DECREF(res);
            }
            __Pyx_ErrRestore(error_type, error_value, error_traceback);
            return;
        }
    }
#endif
    if (unlikely(gen->resume_label == 0 && !error_value)) {
#ifdef __Pyx_Coroutine_USED
#ifdef __Pyx_Generator_USED
    if (!__Pyx_Generator_CheckExact(self))
#endif
        {
        PyObject_GC_UnTrack(self);
#if PY_MAJOR_VERSION >= 3  || defined(PyErr_WarnFormat)
        if (unlikely(PyErr_WarnFormat(PyExc_RuntimeWarning, 1, "coroutine '%.50S' was never awaited", gen->gi_qualname) < 0))
            PyErr_WriteUnraisable(self);
#else
        {PyObject *msg;
        char *cmsg;
        #if CYTHON_COMPILING_IN_PYPY
        msg = NULL;
        cmsg = (char*) "coroutine was never awaited";
        #else
        char *cname;
        PyObject *qualname;
        qualname = gen->gi_qualname;
        cname = PyString_AS_STRING(qualname);
        msg = PyString_FromFormat("coroutine '%.50s' was never awaited", cname);
        if (unlikely(!msg)) {
            PyErr_Clear();
            cmsg = (char*) "coroutine was never awaited";
        } else {
            cmsg = PyString_AS_STRING(msg);
        }
        #endif
        if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, cmsg, 1) < 0))
            PyErr_WriteUnraisable(self);
        Py_XDECREF(msg);}
#endif
        PyObject_GC_Track(self);
        }
#endif
    } else {
        PyObject *res = __Pyx_Coroutine_Close(self);
        if (unlikely(!res)) {
            if (PyErr_Occurred())
                PyErr_WriteUnraisable(self);
        } else {
            Py_DECREF(res);
        }
    }
    __Pyx_ErrRestore(error_type, error_value, error_traceback);
#if !CYTHON_USE_TP_FINALIZE
    assert(self->ob_refcnt > 0);
    if (--self->ob_refcnt == 0) {
        return;
    }
    {
        Py_ssize_t refcnt = self->ob_refcnt;
        _Py_NewReference(self);
        self->ob_refcnt = refcnt;
    }
#if CYTHON_COMPILING_IN_CPYTHON
    assert(PyType_IS_GC(self->ob_type) &&
           _Py_AS_GC(self)->gc.gc_refs != _PyGC_REFS_UNTRACKED);
    _Py_DEC_REFTOTAL;
#endif
#ifdef COUNT_ALLOCS
    --Py_TYPE(self)->tp_frees;
    --Py_TYPE(self)->tp_allocs;
#endif
#endif
}
static PyObject *
__Pyx_Coroutine_get_name(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_name;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_name(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_name;
    Py_INCREF(value);
    self->gi_name = value;
    Py_XDECREF(tmp);
    return 0;
}
static PyObject *
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self, CYTHON_UNUSED void *context)
{
    PyObject *name = self->gi_qualname;
    if (unlikely(!name)) name = Py_None;
    Py_INCREF(name);
    return name;
}
static int
__Pyx_Coroutine_set_qualname(__pyx_CoroutineObject *self, PyObject *value, CYTHON_UNUSED void *context)
{
    PyObject *tmp;
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    tmp = self->gi_qualname;
    Py_INCREF(value);
    self->gi_qualname = value;
    Py_XDECREF(tmp);
    return 0;
}
static __pyx_CoroutineObject *__Pyx__Coroutine_New(
            PyTypeObject* type, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    __pyx_CoroutineObject *gen = PyObject_GC_New(__pyx_CoroutineObject, type);
    if (unlikely(!gen))
        return NULL;
    return __Pyx__Coroutine_NewInit(gen, body, code, closure, name, qualname, module_name);
}
static __pyx_CoroutineObject *__Pyx__Coroutine_NewInit(
            __pyx_CoroutineObject *gen, __pyx_coroutine_body_t body, PyObject *code, PyObject *closure,
            PyObject *name, PyObject *qualname, PyObject *module_name) {
    gen->body = body;
    gen->closure = closure;
    Py_XINCREF(closure);
    gen->is_running = 0;
    gen->resume_label = 0;
    gen->classobj = NULL;
    gen->yieldfrom = NULL;
    gen->gi_exc_state.exc_type = NULL;
    gen->gi_exc_state.exc_value = NULL;
    gen->gi_exc_state.exc_traceback = NULL;
#if CYTHON_USE_EXC_INFO_STACK
    gen->gi_exc_state.previous_item = NULL;
#endif
    gen->gi_weakreflist = NULL;
    Py_XINCREF(qualname);
    gen->gi_qualname = qualname;
    Py_XINCREF(name);
    gen->gi_name = name;
    Py_XINCREF(module_name);
    gen->gi_modulename = module_name;
    Py_XINCREF(code);
    gen->gi_code = code;
    PyObject_GC_Track(gen);
    return gen;
}

/* PatchModuleWithCoroutine */
    static PyObject* __Pyx_Coroutine_patch_module(PyObject* module, const char* py_code) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    int result;
    PyObject *globals, *result_obj;
    globals = PyDict_New();  if (unlikely(!globals)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_coroutine_type",
    #ifdef __Pyx_Coroutine_USED
        (PyObject*)__pyx_CoroutineType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    result = PyDict_SetItemString(globals, "_cython_generator_type",
    #ifdef __Pyx_Generator_USED
        (PyObject*)__pyx_GeneratorType);
    #else
        Py_None);
    #endif
    if (unlikely(result < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "_module", module) < 0)) goto ignore;
    if (unlikely(PyDict_SetItemString(globals, "__builtins__", __pyx_b) < 0)) goto ignore;
    result_obj = PyRun_String(py_code, Py_file_input, globals, globals);
    if (unlikely(!result_obj)) goto ignore;
    Py_DECREF(result_obj);
    Py_DECREF(globals);
    return module;
ignore:
    Py_XDECREF(globals);
    PyErr_WriteUnraisable(module);
    if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning, "Cython module failed to patch module with custom type", 1) < 0)) {
        Py_DECREF(module);
        module = NULL;
    }
#else
    py_code++;
#endif
    return module;
}

/* PatchGeneratorABC */
    #ifndef CYTHON_REGISTER_ABCS
#define CYTHON_REGISTER_ABCS 1
#endif
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
static PyObject* __Pyx_patch_abc_module(PyObject *module);
static PyObject* __Pyx_patch_abc_module(PyObject *module) {
    module = __Pyx_Coroutine_patch_module(
        module, ""
"if _cython_generator_type is not None:\n"
"    try: Generator = _module.Generator\n"
"    except AttributeError: pass\n"
"    else: Generator.register(_cython_generator_type)\n"
"if _cython_coroutine_type is not None:\n"
"    try: Coroutine = _module.Coroutine\n"
"    except AttributeError: pass\n"
"    else: Coroutine.register(_cython_coroutine_type)\n"
    );
    return module;
}
#endif
static int __Pyx_patch_abc(void) {
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
    static int abc_patched = 0;
    if (CYTHON_REGISTER_ABCS && !abc_patched) {
        PyObject *module;
        module = PyImport_ImportModule((PY_MAJOR_VERSION >= 3) ? "collections.abc" : "collections");
        if (!module) {
            PyErr_WriteUnraisable(NULL);
            if (unlikely(PyErr_WarnEx(PyExc_RuntimeWarning,
                    ((PY_MAJOR_VERSION >= 3) ?
                        "Cython module failed to register with collections.abc module" :
                        "Cython module failed to register with collections module"), 1) < 0)) {
                return -1;
            }
        } else {
            module = __Pyx_patch_abc_module(module);
            abc_patched = 1;
            if (unlikely(!module))
                return -1;
            Py_DECREF(module);
        }
        module = PyImport_ImportModule("backports_abc");
        if (module) {
            module = __Pyx_patch_abc_module(module);
            Py_XDECREF(module);
        }
        if (!module) {
            PyErr_Clear();
        }
    }
#else
    if ((0)) __Pyx_Coroutine_patch_module(NULL, NULL);
#endif
    return 0;
}

/* Generator */
    static PyMethodDef __pyx_Generator_methods[] = {
    {"send", (PyCFunction) __Pyx_Coroutine_Send, METH_O,
     (char*) PyDoc_STR("send(arg) -> send 'arg' into generator,\nreturn next yielded value or raise StopIteration.")},
    {"throw", (PyCFunction) __Pyx_Coroutine_Throw, METH_VARARGS,
     (char*) PyDoc_STR("throw(typ[,val[,tb]]) -> raise exception in generator,\nreturn next yielded value or raise StopIteration.")},
    {"close", (PyCFunction) __Pyx_Coroutine_Close_Method, METH_NOARGS,
     (char*) PyDoc_STR("close() -> raise GeneratorExit inside generator.")},
    {0, 0, 0, 0}
};
static PyMemberDef __pyx_Generator_memberlist[] = {
    {(char *) "gi_running", T_BOOL, offsetof(__pyx_CoroutineObject, is_running), READONLY, NULL},
    {(char*) "gi_yieldfrom", T_OBJECT, offsetof(__pyx_CoroutineObject, yieldfrom), READONLY,
     (char*) PyDoc_STR("object being iterated by 'yield from', or None")},
    {(char*) "gi_code", T_OBJECT, offsetof(__pyx_CoroutineObject, gi_code), READONLY, NULL},
    {0, 0, 0, 0, 0}
};
static PyGetSetDef __pyx_Generator_getsets[] = {
    {(char *) "__name__", (getter)__Pyx_Coroutine_get_name, (setter)__Pyx_Coroutine_set_name,
     (char*) PyDoc_STR("name of the generator"), 0},
    {(char *) "__qualname__", (getter)__Pyx_Coroutine_get_qualname, (setter)__Pyx_Coroutine_set_qualname,
     (char*) PyDoc_STR("qualified name of the generator"), 0},
    {0, 0, 0, 0, 0}
};
static PyTypeObject __pyx_GeneratorType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    "generator",
    sizeof(__pyx_CoroutineObject),
    0,
    (destructor) __Pyx_Coroutine_dealloc,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC | Py_TPFLAGS_HAVE_FINALIZE,
    0,
    (traverseproc) __Pyx_Coroutine_traverse,
    0,
    0,
    offsetof(__pyx_CoroutineObject, gi_weakreflist),
    0,
    (iternextfunc) __Pyx_Generator_Next,
    __pyx_Generator_methods,
    __pyx_Generator_memberlist,
    __pyx_Generator_getsets,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if CYTHON_USE_TP_FINALIZE
    0,
#else
    __Pyx_Coroutine_del,
#endif
    0,
#if CYTHON_USE_TP_FINALIZE
    __Pyx_Coroutine_del,
#elif PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
};
static int __pyx_Generator_init(void) {
    __pyx_GeneratorType_type.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
    __pyx_GeneratorType_type.tp_iter = PyObject_SelfIter;
    __pyx_GeneratorType = __Pyx_FetchCommonType(&__pyx_GeneratorType_type);
    if (unlikely(!__pyx_GeneratorType)) {
        return -1;
    }
    return 0;
}

/* CheckBinaryVersion */
    static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
    static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else
        if (t->is_unicode | t->is_str) {
            if (t->intern) {
                *t->p = PyUnicode_InternFromString(t->s);
            } else if (t->encoding) {
                *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
            } else {
                *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
            }
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        ++t;
    }
    return 0;
}

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type %.200s).  "
                "The ability to return an instance of a strict subclass of int "
                "is deprecated, and may be removed in a future version of Python.",
                Py_TYPE(result)->tp_name)) {
            Py_DECREF(result);
            return NULL;
        }
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type %.200s)",
                 type_name, type_name, Py_TYPE(result)->tp_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


#endif /* Py_PYTHON_H */
