Blender V2.61 - r43446
Defines | Functions | Variables

mathutils_Euler.c File Reference

#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 EULER_SIZE   3

Functions

static PyObject * Euler_new (PyTypeObject *type, PyObject *args, PyObject *kwds)
static const char * euler_order_str (EulerObject *self)
short euler_order_from_string (const char *str, const char *error_prefix)
static PyObject * Euler_ToTupleExt (EulerObject *self, int ndigits)
 PyDoc_STRVAR (Euler_to_quaternion_doc,".. method:: to_quaternion()\n""\n"" Return a quaternion representation of the euler.\n""\n"" :return: Quaternion representation of the euler.\n"" :rtype: :class:`Quaternion`\n")
static PyObject * Euler_to_quaternion (EulerObject *self)
 PyDoc_STRVAR (Euler_to_matrix_doc,".. method:: to_matrix()\n""\n"" Return a matrix representation of the euler.\n""\n"" :return: A 3x3 roation matrix representation of the euler.\n"" :rtype: :class:`Matrix`\n")
static PyObject * Euler_to_matrix (EulerObject *self)
 PyDoc_STRVAR (Euler_zero_doc,".. method:: zero()\n""\n"" Set all values to zero.\n")
static PyObject * Euler_zero (EulerObject *self)
 PyDoc_STRVAR (Euler_rotate_axis_doc,".. method:: rotate_axis(axis, angle)\n""\n"" Rotates the euler a certain amount and returning a unique euler rotation\n"" (no 720 degree pitches).\n""\n"" :arg axis: single character in ['X, 'Y', 'Z'].\n"" :type axis: string\n"" :arg angle: angle in radians.\n"" :type angle: float\n")
static PyObject * Euler_rotate_axis (EulerObject *self, PyObject *args)
 PyDoc_STRVAR (Euler_rotate_doc,".. method:: rotate(other)\n""\n"" Rotates the euler a by another mathutils value.\n""\n"" :arg other: rotation component of mathutils value\n"" :type other: :class:`Euler`, :class:`Quaternion` or :class:`Matrix`\n")
static PyObject * Euler_rotate (EulerObject *self, PyObject *value)
 PyDoc_STRVAR (Euler_make_compatible_doc,".. method:: make_compatible(other)\n""\n"" Make this euler compatible with another,\n"" so interpolating between them works as intended.\n""\n"" .. note:: the rotation order is not taken into account for this function.\n")
static PyObject * Euler_make_compatible (EulerObject *self, PyObject *value)
 PyDoc_STRVAR (Euler_copy_doc,".. function:: copy()\n""\n"" Returns a copy of this euler.\n""\n"" :return: A copy of the euler.\n"" :rtype: :class:`Euler`\n""\n"" .. note:: use this to get a copy of a wrapped euler with\n"" no reference to the original data.\n")
static PyObject * Euler_copy (EulerObject *self)
static PyObject * Euler_repr (EulerObject *self)
static PyObject * Euler_str (EulerObject *self)
static PyObject * Euler_richcmpr (PyObject *a, PyObject *b, int op)
static int Euler_len (EulerObject *UNUSED(self))
static PyObject * Euler_item (EulerObject *self, int i)
static int Euler_ass_item (EulerObject *self, int i, PyObject *value)
static PyObject * Euler_slice (EulerObject *self, int begin, int end)
static int Euler_ass_slice (EulerObject *self, int begin, int end, PyObject *seq)
static PyObject * Euler_subscript (EulerObject *self, PyObject *item)
static int Euler_ass_subscript (EulerObject *self, PyObject *item, PyObject *value)
 PyDoc_STRVAR (Euler_axis_doc,"Euler axis angle in radians.\n\n:type: float")
static PyObject * Euler_axis_get (EulerObject *self, void *type)
static int Euler_axis_set (EulerObject *self, PyObject *value, void *type)
 PyDoc_STRVAR (Euler_order_doc,"Euler rotation order.\n\n:type: string in ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX']")
static PyObject * Euler_order_get (EulerObject *self, void *UNUSED(closure))
static int Euler_order_set (EulerObject *self, PyObject *value, void *UNUSED(closure))
 PyDoc_STRVAR (euler_doc,"This object gives access to Eulers in Blender.")
PyObject * Euler_CreatePyObject (float *eul, short order, int type, PyTypeObject *base_type)
PyObject * Euler_CreatePyObject_cb (PyObject *cb_user, short order, int cb_type, int cb_subtype)

Variables

static PySequenceMethods Euler_SeqMethods
static PyMappingMethods Euler_AsMapping
static PyGetSetDef Euler_getseters []
static struct PyMethodDef Euler_methods []
PyTypeObject euler_Type

Detailed Description

Definition in file mathutils_Euler.c.


Define Documentation

#define EULER_SIZE   3

Function Documentation

static int Euler_ass_item ( EulerObject self,
int  i,
PyObject *  value 
) [static]

Definition at line 400 of file mathutils_Euler.c.

References BaseMath_WriteIndexCallback, EULER_SIZE, and i.

Referenced by Euler_ass_subscript(), and Euler_axis_set().

static int Euler_ass_slice ( EulerObject self,
int  begin,
int  end,
PyObject *  seq 
) [static]
static int Euler_ass_subscript ( EulerObject self,
PyObject *  item,
PyObject *  value 
) [static]

Definition at line 519 of file mathutils_Euler.c.

References Euler_ass_item(), Euler_ass_slice(), EULER_SIZE, i, and step().

static PyObject* Euler_axis_get ( EulerObject self,
void *  type 
) [static]

Definition at line 576 of file mathutils_Euler.c.

References Euler_item(), and GET_INT_FROM_POINTER.

static int Euler_axis_set ( EulerObject self,
PyObject *  value,
void *  type 
) [static]

Definition at line 581 of file mathutils_Euler.c.

References Euler_ass_item(), and GET_INT_FROM_POINTER.

static PyObject* Euler_copy ( EulerObject self) [static]

Definition at line 295 of file mathutils_Euler.c.

References BaseMath_ReadCallback, Euler_CreatePyObject(), NULL, and Py_NEW.

PyObject* Euler_CreatePyObject ( float *  eul,
short  order,
int  type,
PyTypeObject *  base_type 
)
PyObject* Euler_CreatePyObject_cb ( PyObject *  cb_user,
short  order,
int  cb_type,
int  cb_subtype 
)

Definition at line 735 of file mathutils_Euler.c.

References Euler_CreatePyObject(), and Py_NEW.

Referenced by pyrna_math_object_from_array().

static PyObject* Euler_item ( EulerObject self,
int  i 
) [static]

Definition at line 381 of file mathutils_Euler.c.

References BaseMath_ReadIndexCallback, EULER_SIZE, i, and NULL.

Referenced by Euler_axis_get(), and Euler_subscript().

static int Euler_len ( EulerObject UNUSEDself) [static]

Definition at line 375 of file mathutils_Euler.c.

References EULER_SIZE.

static PyObject* Euler_make_compatible ( EulerObject self,
PyObject *  value 
) [static]
static PyObject* Euler_new ( PyTypeObject *  type,
PyObject *  args,
PyObject *  kwds 
) [static]
short euler_order_from_string ( const char *  str,
const char *  error_prefix 
)
static PyObject* Euler_order_get ( EulerObject self,
void *  UNUSEDclosure 
) [static]

Definition at line 591 of file mathutils_Euler.c.

References BaseMath_ReadCallback, euler_order_str(), and NULL.

static int Euler_order_set ( EulerObject self,
PyObject *  value,
void *  UNUSEDclosure 
) [static]

Definition at line 599 of file mathutils_Euler.c.

References BaseMath_WriteCallback, and euler_order_from_string().

static const char* euler_order_str ( EulerObject self) [static]

Definition at line 79 of file mathutils_Euler.c.

References EULER_ORDER_XYZ.

Referenced by Euler_order_get(), Euler_repr(), and Euler_str().

static PyObject* Euler_repr ( EulerObject self) [static]

Definition at line 306 of file mathutils_Euler.c.

References BaseMath_ReadCallback, euler_order_str(), Euler_ToTupleExt(), and NULL.

static PyObject* Euler_richcmpr ( PyObject *  a,
PyObject *  b,
int  op 
) [static]
static PyObject* Euler_rotate ( EulerObject self,
PyObject *  value 
) [static]
static PyObject* Euler_rotate_axis ( EulerObject self,
PyObject *  args 
) [static]
static PyObject* Euler_slice ( EulerObject self,
int  begin,
int  end 
) [static]

Definition at line 429 of file mathutils_Euler.c.

References BaseMath_ReadCallback, CLAMP(), EULER_SIZE, MIN2, and NULL.

Referenced by Euler_subscript().

static PyObject* Euler_str ( EulerObject self) [static]
static PyObject* Euler_subscript ( EulerObject self,
PyObject *  item 
) [static]

Definition at line 481 of file mathutils_Euler.c.

References Euler_item(), EULER_SIZE, Euler_slice(), i, NULL, and step().

static PyObject* Euler_to_matrix ( EulerObject self) [static]
static PyObject* Euler_to_quaternion ( EulerObject self) [static]
static PyObject* Euler_ToTupleExt ( EulerObject self,
int  ndigits 
) [static]

Definition at line 105 of file mathutils_Euler.c.

References double_round(), EULER_SIZE, and i.

Referenced by Euler_repr().

static PyObject* Euler_zero ( EulerObject self) [static]

Definition at line 175 of file mathutils_Euler.c.

References BaseMath_WriteCallback, NULL, and zero_v3().

PyDoc_STRVAR ( Euler_axis_doc  ,
"Euler axis angle in radians.\n\n:type: float"   
)
PyDoc_STRVAR ( Euler_rotate_axis_doc  ,
".. method:: rotate_axis(axis, angle)\n""\n"" Rotates the euler a certain amount and returning a unique euler rotation\n"" (no 720 degree pitches).\n""\n"" :arg axis: single character in .\n"" :type axis: string\n"" :arg angle: angle in radians.\n"" :type angle: float\n"  ['X, 'Y', 'Z'] 
)
PyDoc_STRVAR ( euler_doc  ,
"This object gives access to Eulers in Blender."   
)
PyDoc_STRVAR ( Euler_to_matrix_doc  ,
".. method:: to_matrix()\n""\n"" Return a matrix representation of the euler.\n""\n"" :return: A 3x3 roation matrix representation of the euler.\n"" :rtype: :class:`Matrix`\n"   
)
PyDoc_STRVAR ( Euler_make_compatible_doc  ,
".. method:: make_compatible(other)\n""\n"" Make this euler compatible with  another,
\n""so interpolating between them works as intended.\n""\n""..note::the rotation order is not taken into account for this function.\n"   
)
PyDoc_STRVAR ( Euler_order_doc  ,
"Euler rotation order.\n\n:type: string in "  ['XYZ', 'XZY', 'YXZ', 'YZX', 'ZXY', 'ZYX'] 
)
PyDoc_STRVAR ( Euler_zero_doc  ,
".. method:: zero()\n""\n"" Set all values to zero.\n"   
)
PyDoc_STRVAR ( Euler_rotate_doc  ,
".. method:: rotate(other)\n""\n"" Rotates the euler a by another mathutils value.\n""\n"" :arg other: rotation component of mathutils value\n"" :type other: :class:`Euler`  ,
:class:`Quaternion`or:class:`Matrix`\n"   
)
PyDoc_STRVAR ( Euler_copy_doc  ,
".. function:: copy()\n""\n"" Returns a copy of this euler.\n""\n"" :return: A copy of the euler.\n"" :rtype: :class:`Euler`\n""\n"" .. note:: use this to get a copy of a wrapped euler with\n"" no reference to the original data.\n"   
)
PyDoc_STRVAR ( Euler_to_quaternion_doc  ,
".. method:: to_quaternion()\n""\n"" Return a quaternion representation of the euler.\n""\n"" :return: Quaternion representation of the euler.\n"" :rtype: :class:`Quaternion`\n"   
)

Variable Documentation

PyMappingMethods Euler_AsMapping [static]
Initial value:
 {
    (lenfunc)Euler_len,
    (binaryfunc)Euler_subscript,
    (objobjargproc)Euler_ass_subscript
}

Definition at line 565 of file mathutils_Euler.c.

PyGetSetDef Euler_getseters[] [static]
Initial value:
 {
    {(char *)"x", (getter)Euler_axis_get, (setter)Euler_axis_set, Euler_axis_doc, (void *)0},
    {(char *)"y", (getter)Euler_axis_get, (setter)Euler_axis_set, Euler_axis_doc, (void *)1},
    {(char *)"z", (getter)Euler_axis_get, (setter)Euler_axis_set, Euler_axis_doc, (void *)2},
    {(char *)"order", (getter)Euler_order_get, (setter)Euler_order_set, Euler_order_doc, (void *)NULL},

    {(char *)"is_wrapped", (getter)BaseMathObject_is_wrapped_get, (setter)NULL, BaseMathObject_is_wrapped_doc, NULL},
    {(char *)"owner", (getter)BaseMathObject_owner_get, (setter)NULL, BaseMathObject_owner_doc, NULL},
    {NULL, NULL, NULL, NULL, NULL}  
}

Definition at line 615 of file mathutils_Euler.c.

struct PyMethodDef Euler_methods[] [static]
Initial value:
 {
    {"zero", (PyCFunction) Euler_zero, METH_NOARGS, Euler_zero_doc},
    {"to_matrix", (PyCFunction) Euler_to_matrix, METH_NOARGS, Euler_to_matrix_doc},
    {"to_quaternion", (PyCFunction) Euler_to_quaternion, METH_NOARGS, Euler_to_quaternion_doc},
    {"rotate_axis", (PyCFunction) Euler_rotate_axis, METH_VARARGS, Euler_rotate_axis_doc},
    {"rotate", (PyCFunction) Euler_rotate, METH_O, Euler_rotate_doc},
    {"make_compatible", (PyCFunction) Euler_make_compatible, METH_O, Euler_make_compatible_doc},
    {"__copy__", (PyCFunction) Euler_copy, METH_NOARGS, Euler_copy_doc},
    {"copy", (PyCFunction) Euler_copy, METH_NOARGS, Euler_copy_doc},
    {NULL, NULL, 0, NULL}
}

Definition at line 628 of file mathutils_Euler.c.

PySequenceMethods Euler_SeqMethods [static]
Initial value:
 {
    (lenfunc) Euler_len,                    
    (binaryfunc) NULL,                      
    (ssizeargfunc) NULL,                    
    (ssizeargfunc) Euler_item,              
    (ssizessizeargfunc) NULL,               
    (ssizeobjargproc) Euler_ass_item,       
    (ssizessizeobjargproc) NULL,            
    (objobjproc) NULL,                      
    (binaryfunc) NULL,                      
    (ssizeargfunc) NULL,                    
}

Definition at line 552 of file mathutils_Euler.c.

PyTypeObject euler_Type

Definition at line 644 of file mathutils_Euler.c.

Referenced by Matrix_to_euler(), PyInit_mathutils(), and Quaternion_to_euler().