Blender V2.61 - r43446
|
#include <Python.h>
#include "mathutils.h"
#include "BLI_math.h"
#include "BLI_utildefines.h"
#include "BLI_dynstr.h"
Go to the source code of this file.
Defines | |
#define | SIGNMASK(i) (-(int)(((unsigned int)(i))>>31)) |
Functions | |
PyDoc_STRVAR (M_Mathutils_doc,"This module provides access to matrices, eulers, quaternions and vectors.") | |
static int | mathutils_array_parse_fast (float *array, int size, PyObject *value_fast, const char *error_prefix) |
int | mathutils_array_parse (float *array, int array_min, int array_max, PyObject *value, const char *error_prefix) |
int | mathutils_array_parse_alloc (float **array, int array_min, PyObject *value, const char *error_prefix) |
int | mathutils_any_to_rotmat (float rmat[3][3], PyObject *value, const char *error_prefix) |
int | EXPP_FloatsAreEqual (float af, float bf, int maxDiff) |
int | EXPP_VectorsAreEqual (float *vecA, float *vecB, int size, int floatSteps) |
PyObject * | mathutils_dynstr_to_py (struct DynStr *ds) |
int | Mathutils_RegisterCallback (Mathutils_Callback *cb) |
int | _BaseMathObject_ReadCallback (BaseMathObject *self) |
int | _BaseMathObject_WriteCallback (BaseMathObject *self) |
int | _BaseMathObject_ReadIndexCallback (BaseMathObject *self, int index) |
int | _BaseMathObject_WriteIndexCallback (BaseMathObject *self, int index) |
PyObject * | BaseMathObject_owner_get (BaseMathObject *self, void *UNUSED(closure)) |
PyObject * | BaseMathObject_is_wrapped_get (BaseMathObject *self, void *UNUSED(closure)) |
int | BaseMathObject_traverse (BaseMathObject *self, visitproc visit, void *arg) |
int | BaseMathObject_clear (BaseMathObject *self) |
void | BaseMathObject_dealloc (BaseMathObject *self) |
PyMODINIT_FUNC | PyInit_mathutils (void) |
Variables | |
static Mathutils_Callback * | mathutils_callbacks [8] = {NULL} |
char | BaseMathObject_owner_doc [] = "The item this is wrapping or None (readonly)." |
char | BaseMathObject_is_wrapped_doc [] = "True when this object wraps external data (readonly).\n\n:type: boolean" |
static struct PyMethodDef | M_Mathutils_methods [] |
static struct PyModuleDef | M_Mathutils_module_def |
Definition in file mathutils.c.
Definition at line 242 of file mathutils.c.
Referenced by EXPP_FloatsAreEqual().
int _BaseMathObject_ReadCallback | ( | BaseMathObject * | self | ) |
Definition at line 304 of file mathutils.c.
References Mathutils_Callback::get.
int _BaseMathObject_ReadIndexCallback | ( | BaseMathObject * | self, |
int | index | ||
) |
Definition at line 332 of file mathutils.c.
References Mathutils_Callback::get_index.
int _BaseMathObject_WriteCallback | ( | BaseMathObject * | self | ) |
Definition at line 318 of file mathutils.c.
References Mathutils_Callback::set.
int _BaseMathObject_WriteIndexCallback | ( | BaseMathObject * | self, |
int | index | ||
) |
Definition at line 346 of file mathutils.c.
References Mathutils_Callback::set_index.
int BaseMathObject_clear | ( | BaseMathObject * | self | ) |
Definition at line 381 of file mathutils.c.
Referenced by BaseMathObject_dealloc().
void BaseMathObject_dealloc | ( | BaseMathObject * | self | ) |
Definition at line 387 of file mathutils.c.
References BaseMathObject_clear(), and Py_WRAP.
PyObject* BaseMathObject_is_wrapped_get | ( | BaseMathObject * | self, |
void * | UNUSEDclosure | ||
) |
Definition at line 370 of file mathutils.c.
References Py_WRAP.
PyObject* BaseMathObject_owner_get | ( | BaseMathObject * | self, |
void * | UNUSEDclosure | ||
) |
Definition at line 362 of file mathutils.c.
int BaseMathObject_traverse | ( | BaseMathObject * | self, |
visitproc | visit, | ||
void * | arg | ||
) |
Definition at line 375 of file mathutils.c.
int EXPP_FloatsAreEqual | ( | float | af, |
float | bf, | ||
int | maxDiff | ||
) |
Definition at line 244 of file mathutils.c.
References assert, KDL::diff(), SIGNMASK, and rna_array::test.
Referenced by EXPP_VectorsAreEqual(), and quat__axis_angle_sanitize().
int EXPP_VectorsAreEqual | ( | float * | vecA, |
float * | vecB, | ||
int | size, | ||
int | floatSteps | ||
) |
Definition at line 261 of file mathutils.c.
References EXPP_FloatsAreEqual(), and size().
Referenced by Color_richcmpr(), Euler_richcmpr(), Matrix_richcmpr(), Quaternion_richcmpr(), and Vector_richcmpr().
int mathutils_any_to_rotmat | ( | float | rmat[3][3], |
PyObject * | value, | ||
const char * | error_prefix | ||
) |
Definition at line 189 of file mathutils.c.
References BaseMath_ReadCallback, EulerObject_Check, eulO_to_mat3(), matrix_as_3x3(), MatrixObject_Check, normalize_m3(), normalize_qt_qt(), quat_to_mat3(), and QuaternionObject_Check.
Referenced by Euler_rotate(), Matrix_rotate(), Quaternion_rotate(), and Vector_rotate().
int mathutils_array_parse | ( | float * | array, |
int | array_min, | ||
int | array_max, | ||
PyObject * | value, | ||
const char * | error_prefix | ||
) |
Definition at line 72 of file mathutils.c.
References BaseMath_ReadCallback, ColorObject_Check, data, EulerObject_Check, mathutils_array_parse_fast(), NULL, QuaternionObject_Check, size(), and VectorObject_Check.
Referenced by C_Matrix_OrthoProjection(), C_Matrix_Rotation(), C_Matrix_Scale(), C_Matrix_Shear(), C_Matrix_Translation(), Color_ass_slice(), Color_hsv_set(), Color_new(), Euler_ass_slice(), Euler_make_compatible(), Euler_new(), M_Noise_cell(), M_Noise_cell_vector(), M_Noise_fractal(), M_Noise_hetero_terrain(), M_Noise_hybrid_multi_fractal(), M_Noise_multi_fractal(), M_Noise_noise(), M_Noise_noise_vector(), M_Noise_ridged_multi_fractal(), M_Noise_turbulence(), M_Noise_turbulence_vector(), M_Noise_variable_lacunarity(), M_Noise_voronoi(), Matrix_ass_item_col(), Matrix_ass_item_row(), Matrix_ass_slice(), Matrix_translation_set(), Quaternion_ass_slice(), Quaternion_axis_vector_set(), Quaternion_cross(), Quaternion_dot(), Quaternion_new(), Quaternion_rotation_difference(), Quaternion_slerp(), Vector_angle(), Vector_cross(), Vector_project(), Vector_reflect(), Vector_rotation_difference(), and Vector_swizzle_set().
int mathutils_array_parse_alloc | ( | float ** | array, |
int | array_min, | ||
PyObject * | value, | ||
const char * | error_prefix | ||
) |
Definition at line 136 of file mathutils.c.
References BaseMath_ReadCallback, ColorObject_Check, data, EulerObject_Check, mathutils_array_parse_fast(), NULL, QuaternionObject_Check, size(), and VectorObject_Check.
Referenced by C_Vector_Repeat(), Vector_ass_slice(), Vector_dot(), Vector_lerp(), and Vector_new().
static int mathutils_array_parse_fast | ( | float * | array, |
int | size, | ||
PyObject * | value_fast, | ||
const char * | error_prefix | ||
) | [static] |
Definition at line 43 of file mathutils.c.
Referenced by mathutils_array_parse(), and mathutils_array_parse_alloc().
PyObject* mathutils_dynstr_to_py | ( | struct DynStr * | ds | ) |
Definition at line 272 of file mathutils.c.
References BLI_dynstr_free(), BLI_dynstr_get_cstring_ex(), and BLI_dynstr_get_len().
Referenced by Color_str(), Euler_str(), Matrix_str(), Quaternion_str(), and Vector_str().
int Mathutils_RegisterCallback | ( | Mathutils_Callback * | cb | ) |
Definition at line 289 of file mathutils.c.
References i.
Referenced by BPY_rna_init(), and PyInit_mathutils().
PyDoc_STRVAR | ( | M_Mathutils_doc | , |
"This module provides access to | matrices, | ||
eulers | , | ||
quaternions and vectors." | |||
) |
PyMODINIT_FUNC PyInit_mathutils | ( | void | ) |
Definition at line 419 of file mathutils.c.
References color_Type, euler_Type, mathutils_matrix_col_cb, mathutils_matrix_col_cb_index, mathutils_matrix_row_cb, mathutils_matrix_row_cb_index, mathutils_matrix_translation_cb, mathutils_matrix_translation_cb_index, Mathutils_RegisterCallback(), matrix_access_Type, matrix_Type, NULL, PyInit_mathutils_geometry(), PyInit_mathutils_noise(), quaternion_Type, and vector_Type.
char BaseMathObject_is_wrapped_doc[] = "True when this object wraps external data (readonly).\n\n:type: boolean" |
Definition at line 369 of file mathutils.c.
char BaseMathObject_owner_doc[] = "The item this is wrapping or None (readonly)." |
Definition at line 361 of file mathutils.c.
struct PyMethodDef M_Mathutils_methods[] [static] |
Definition at line 403 of file mathutils.c.
struct PyModuleDef M_Mathutils_module_def [static] |
{ PyModuleDef_HEAD_INIT, "mathutils", M_Mathutils_doc, 0, M_Mathutils_methods, NULL, NULL, NULL, NULL, }
Definition at line 407 of file mathutils.c.
Mathutils_Callback* mathutils_callbacks[8] = {NULL} [static] |
Definition at line 287 of file mathutils.c.