Integration layer between the C core and Python functions. More...
Go to the source code of this file.
Functions | |
| void | RegisterObject3D (PyObject *module) |
| Registers the Object3D object in the Python environment. More... | |
| void | Object3D_dealloc (Object3D *self) |
| Takes care of the deallocation of the vertices, faces and text the Object3D object. More... | |
| PyObject * | Object3D_new (PyTypeObject *type, PyObject *args, PyObject *kwds) |
| Takes care of the initialization of the Object3D object members. More... | |
| int | Object3D_init (Object3D *self, PyObject *args, PyObject *kwds) |
| The constructor of the Object3D object. More... | |
| PyObject * | Object3D_setVertCoo (Object3D *self, PyObject *args) |
| Sets a single coordinate value (x, y or z) for a vertex in G.world. More... | |
| PyObject * | Object3D_setNormCoo (Object3D *self, PyObject *args) |
| Sets a single normal component value (x, y or z) for a vertex in G.world. More... | |
| PyObject * | Object3D_setUVCoo (Object3D *self, PyObject *args) |
| Sets a single UV component value (U or V) for a vertex in G.world. More... | |
| PyObject * | Object3D_setColorIDComponent (Object3D *self, PyObject *args) |
| Sets a single color component value (R, G or B) for a vertex in G.world. More... | |
| PyObject * | Object3D_setColorComponent (Object3D *self, PyObject *args) |
| Sets a single color component value (R, G, B or A) for a vertex in G.world. More... | |
| PyObject * | Object3D_getShaderParameters (Object3D *self, void *closure) |
| Gets the shader parameter dictionary for this Object3D object. More... | |
| PyObject * | Object3D_getTranslation (Object3D *self, void *closure) |
| Gets the translation for this Object3D object as a list. More... | |
| int | Object3D_setTranslation (Object3D *self, PyObject *value) |
| Sets the translation for this Object3D object as a list. More... | |
| PyObject * | Object3D_getRotation (Object3D *self, void *closure) |
| Gets the rotation for this Object3D object as a list. More... | |
| int | Object3D_setRotation (Object3D *self, PyObject *value) |
| Sets the rotation for this Object3D object as a list. More... | |
| PyObject * | Object3D_getScale (Object3D *self, void *closure) |
| Gets the scale for this Object3D object as a list. More... | |
| int | Object3D_setScale (Object3D *self, PyObject *value) |
| Sets the scale for this Object3D object as a list. More... | |
| void | callMouseButtonDown (int b, int x, int y) |
| Invokes the Python mouseButtonDown function. More... | |
| void | callMouseButtonUp (int b, int x, int y) |
| Invokes the Python mouseButtonUp function. More... | |
| void | callMouseMotion (int s, int x, int y, int xrel, int yrel) |
| Invokes the Python mouseMotion function. More... | |
| void | callKeyDown (int key, unsigned short character, int modifiers) |
| Invokes the Python keyDown function. More... | |
| void | callKeyUp (int key, unsigned short character, int modifiers) |
| void | callResize (int w, int h, int fullscreen) |
| void | setClearColor (float r, float g, float b, float a) |
| float * | makeFloatArray (int n) |
| Creates an array of n floats and returns a pointer to that array. More... | |
| unsigned char * | makeUCharArray (int n) |
| Creates an array of n characters and returns a pointer to that array. More... | |
| int * | makeIntArray (int n) |
| Creates an array of n integers and returns a pointer to that array. More... | |
Variables | |
| static PyMemberDef | Object3D_members [] |
| static PyMethodDef | Object3D_methods [] |
| static PyGetSetDef | Object3D_getset [] |
| PyTypeObject | Object3DType |
Integration layer between the C core and Python functions.
| Project Name: | MakeHuman |
| Product Home Page: | http://www.makehuman.org/ |
| SourceForge Home Page: | http://sourceforge.net/projects/makehuman/ |
| Authors: | Manuel Bastioni, Paolo Colombo, Simone Re, Hans-Peter Dusel |
| Copyright(c): | MakeHuman Team 2001-2010 |
| Licensing: | GPL3 (see also http://makehuman.wiki.sourceforge.net/Licensing) |
| Coding Standards: | See http://makehuman.wiki.sourceforge.net/DG_Coding_Standards |
This module contains functions that pass events up from the SDL core to Python and functions that process calls from Python back to C. There are also a small number of utility functions for allocating memory for lists of Integers, Strings, Floats and Objects.
Definition in file core.c.
| void callKeyDown | ( | int | key, |
| unsigned short | character, | ||
| int | modifiers | ||
| ) |
Invokes the Python keyDown function.
| key | an int containing the key code of the key pressed. |
| character | an unsigned short character containing the Unicode character corresponding to the key pressed. |
This function invokes the Python keyDown function when the SDL module detects a standard keyboard event, ie. when a standard character key is pressed.
| void callKeyUp | ( | int | key, |
| unsigned short | character, | ||
| int | modifiers | ||
| ) |
| void callMouseButtonDown | ( | int | b, |
| int | x, | ||
| int | y | ||
| ) |
Invokes the Python mouseButtonDown function.
| b | an int indicating which button this event relates to. |
| x | an int specifying the horizontal mouse pointer position in the GUI window (in pixels). |
| y | an int specifying the vertical mouse pointer position in the GUI window (in pixels). |
This function invokes the Python mouseButtonDown function when the SDL module detects a mouse button down event.
| void callMouseButtonUp | ( | int | b, |
| int | x, | ||
| int | y | ||
| ) |
Invokes the Python mouseButtonUp function.
| b | an int indicating which button this event relates to. |
| x | an int specifying the horizontal mouse pointer position in the GUI window (in pixels). |
| y | an int specifying the vertical mouse pointer position in the GUI window (in pixels). |
This function invokes the Python mouseButtonUp function when the SDL module detects a mouse button up event.
| void callMouseMotion | ( | int | s, |
| int | x, | ||
| int | y, | ||
| int | xrel, | ||
| int | yrel | ||
| ) |
Invokes the Python mouseMotion function.
| s | an int indicating the mouse.motion.state of the event (1=Mouse moved, 0=Mouse click).. |
| x | an int specifying the horizontal mouse pointer position in the GUI window (in pixels). |
| y | an int specifying the vertical mouse pointer position in the GUI window (in pixels). |
| xrel | an int specifying the difference between the previously recorded horizontal mouse pointer position in the GUI window and the current position (in pixels). |
| yrel | an int specifying the difference between the previously recorded vertical mouse pointer position in the GUI window and the current position (in pixels). |
This function invokes the Python mouseMotion function when the SDL module detects movement of the mouse.
| float* makeFloatArray | ( | int | n | ) |
| int* makeIntArray | ( | int | n | ) |
| unsigned char* makeUCharArray | ( | int | n | ) |
| void Object3D_dealloc | ( | Object3D * | self | ) |
| PyObject* Object3D_getRotation | ( | Object3D * | self, |
| void * | closure | ||
| ) |
| PyObject* Object3D_getScale | ( | Object3D * | self, |
| void * | closure | ||
| ) |
| PyObject* Object3D_getShaderParameters | ( | Object3D * | self, |
| void * | closure | ||
| ) |
| PyObject* Object3D_getTranslation | ( | Object3D * | self, |
| void * | closure | ||
| ) |
| int Object3D_init | ( | Object3D * | self, |
| PyObject * | args, | ||
| PyObject * | kwds | ||
| ) |
| PyObject* Object3D_new | ( | PyTypeObject * | type, |
| PyObject * | args, | ||
| PyObject * | kwds | ||
| ) |
| PyObject* Object3D_setColorComponent | ( | Object3D * | self, |
| PyObject * | args | ||
| ) |
Sets a single color component value (R, G, B or A) for a vertex in G.world.
| objIndex | an int containing the index of the 3D object that contains this vertex. |
| nIdx | an int indexing the vertex color component to update. |
| r | an unsigned char (an integer value from 0-255) specifying the Red channel component to be assigned to this color component in the G.world array. |
| g | an unsigned char (an integer value from 0-255) specifying the Green channel component to be assigned to this color component in the G.world array. |
| b | an unsigned char (an integer value from 0-255) specifying the Blue channel component to be assigned to this color component in the G.world array. |
| a | an unsigned char (an integer value from 0-255) specifying the Alpha channel component to be assigned to this color component in the G.world array. |
This function sets the value of a G.world color component (R, G, B or A).
| PyObject* Object3D_setColorIDComponent | ( | Object3D * | self, |
| PyObject * | args | ||
| ) |
Sets a single color component value (R, G or B) for a vertex in G.world.
| objIndex | an int containing the index of the 3D object that contains this vertex. |
| nIdx | an int indexing the vertex color component to update. |
| r | an unsigned char (an integer value from 0-255) specifying the Red channel component to be assigned to this color component. |
| g | an unsigned char (an integer value from 0-255) specifying the Green channel component to be assigned to this color component. |
| b | an unsigned char (an integer value from 0-255) specifying the Blue channel component to be assigned to this color component. |
This function sets the value of a G.world color component (R, G or B). This function is called by the mh_setColorCoord function in main.c which splits a list of the three color components into 3 separate calls to this function.
| PyObject* Object3D_setNormCoo | ( | Object3D * | self, |
| PyObject * | args | ||
| ) |
Sets a single normal component value (x, y or z) for a vertex in G.world.
| objIndex | an int containing the index of the 3D object that contains this vertex. |
| nIdx | an int indexing the vertex normal component to update. |
| x | a float specifying the X component of the value to be assigned to this normal in the G.world array. |
| y | a float specifying the Y component of the value to be assigned to this normal in the G.world array. |
| z | a float specifying the Z component of the value to be assigned to this normal in the G.world array. |
This function sets the value of a G.world normal component (x, y or z). This function is called indirectly by the setNormCoord Python wrapper. The Python wrapper specifies a list of the three components, but this list is split up into 3 separate calls to this function by the mh_setNormCoord function in main.c.
| int Object3D_setRotation | ( | Object3D * | self, |
| PyObject * | value | ||
| ) |
| int Object3D_setScale | ( | Object3D * | self, |
| PyObject * | value | ||
| ) |
| int Object3D_setTranslation | ( | Object3D * | self, |
| PyObject * | value | ||
| ) |
| PyObject* Object3D_setUVCoo | ( | Object3D * | self, |
| PyObject * | args | ||
| ) |
Sets a single UV component value (U or V) for a vertex in G.world.
| objIndex | an int containing the index of the 3D object that contains this vertex. |
| nIdx | an int indexing the vertex UV component to update. |
| u | a float specifying the value to be assigned to the U component of the UV mapping data associated with the specified vertex in the G.world array. |
| v | a float specifying the value to be assigned to the V component of the UV mapping data associated with the specified vertex in the G.world array. |
This function sets the value of a G.world UV component (U or V). This function is called indirectly by the setUVCoord Python wrapper. The Python wrapper specifies a list of the two components, but this list is split up into 2 separate calls to this function by the mh_setUVCoord function in main.c.
| PyObject* Object3D_setVertCoo | ( | Object3D * | self, |
| PyObject * | args | ||
| ) |
Sets a single coordinate value (x, y or z) for a vertex in G.world.
| objIndex | an int containing the index of the 3D object that contains this vertex. |
| vIdx | an int indexing the vertex coordinate component to update. |
| x | a float specifying the X component of the value to be assigned to this vertex coordinate in the G.world array. |
| y | a float specifying the Y component of the value to be assigned to this vertex coordinate in the G.world array. |
| z | a float specifying the Z component of the value to be assigned to this vertex coordinate in the G.world array. |
This function sets the value of a G.world coordinate component (x, y or z). This function is called indirectly by the setVertCoord Python wrapper. The Python wrapper specifies a list of the three coordinates, but this list is split up into 3 separate calls to this function by the mh_setVertCoord function in main.c.
| void RegisterObject3D | ( | PyObject * | module | ) |
|
static |
|
static |
|
static |
1.8.5