H3D API
2.4.1
|
PyNumberTypeWrapperBase is a template wrapper class to create new Python types from types already existing in the H3DAPI (see PythonTypes.h) for example usage. More...
#include <H3D/PyTypeWrapper.h>
Static Public Member Functions | |
static PyObject * | add (PyObject *veca, PyObject *vecb) |
Performs addition between two instances. | |
static PyObject * | sub (PyObject *veca, PyObject *vecb) |
Performs subtraction between two instances. | |
static PyObject * | mul (PyObject *veca, PyObject *vecb) |
Performs multiplication between a instance of the type and a float, long or int. | |
static PyObject * | div (PyObject *veca, PyObject *floatb) |
Performs division with a float, long or int instance. | |
static PyObject * | neg (PyObject *vec) |
Negation. | |
![]() | |
static void | installType (PyObject *_H3D_module) |
Install type in the given python module. More... | |
static PyObject * | create () |
create() a new instance of Type using Python to allocate the memory and initialise the PyObject headers - to be called by PythonScript's internals. | |
static void | dealloc (PyObject *self) |
Python type deallocation. | |
static PyObject * | repr (PyObject *myself, PyObject *) |
Converts to a char* string. | |
static int | compare (PyObject *veca, PyObject *vecb) |
Test if two PyTypes are equal or not. | |
PyNumberTypeWrapperBase is a template wrapper class to create new Python types from types already existing in the H3DAPI (see PythonTypes.h) for example usage.
It is used especially on types that have arithmetical operator defined since these will be generated.
Type | The H3DAPI type to make a Python type of. |
TypeObject | A PyTypeObject for that type. |
CheckFunc | A function for checking that a PyObject * is of the new Python type. |
ValueFunc | A function for extracting the value of the type that has been wrapped in the python type. |
NewFunc | A function for creating a new instance of the Python class given an instance of Type. |