Blender V5.0
mathutils_Matrix.hh File Reference
#include <Python.h>
#include "mathutils.hh"

Go to the source code of this file.

Classes

struct  MatrixObject

Macros

#define MatrixObject_Check(v)
#define MatrixObject_CheckExact(v)
#define MATRIX_MAX_DIM   4
#define MATRIX_ITEM_ASSERT(_mat, _row, _col)
#define MATRIX_ITEM_INDEX_NUMROW(_totrow, _row, _col)
#define MATRIX_ITEM_INDEX(_mat, _row, _col)
#define MATRIX_ITEM_PTR(_mat, _row, _col)
#define MATRIX_ITEM(_mat, _row, _col)
#define MATRIX_COL_INDEX(_mat, _col)
#define MATRIX_COL_PTR(_mat, _col)

Functions

PyObject * Matrix_CreatePyObject (const float *mat, ushort col_num, ushort row_num, PyTypeObject *base_type)
PyObject * Matrix_CreatePyObject_wrap (float *mat, ushort col_num, ushort row_num, PyTypeObject *base_type) ATTR_NONNULL(1)
PyObject * Matrix_CreatePyObject_cb (PyObject *cb_user, unsigned short col_num, unsigned short row_num, unsigned char cb_type, unsigned char cb_subtype)
PyObject * Matrix_CreatePyObject_alloc (float *mat, ushort col_num, ushort row_num, PyTypeObject *base_type)
int Matrix_ParseAny (PyObject *o, void *p)
int Matrix_Parse2x2 (PyObject *o, void *p)
int Matrix_Parse3x3 (PyObject *o, void *p)
int Matrix_Parse4x4 (PyObject *o, void *p)
void matrix_as_3x3 (float mat[3][3], MatrixObject *self)

Variables

PyTypeObject matrix_Type
PyTypeObject matrix_access_Type
unsigned char mathutils_matrix_row_cb_index
unsigned char mathutils_matrix_col_cb_index
unsigned char mathutils_matrix_translation_cb_index
struct Mathutils_Callback mathutils_matrix_row_cb
struct Mathutils_Callback mathutils_matrix_col_cb
struct Mathutils_Callback mathutils_matrix_translation_cb

Macro Definition Documentation

◆ MATRIX_COL_INDEX

#define MATRIX_COL_INDEX ( _mat,
_col )
Value:
(MATRIX_ITEM_INDEX(_mat, 0, _col))
#define MATRIX_ITEM_INDEX(_mat, _row, _col)

Definition at line 40 of file mathutils_Matrix.hh.

◆ MATRIX_COL_PTR

#define MATRIX_COL_PTR ( _mat,
_col )
Value:
((_mat)->matrix + MATRIX_COL_INDEX(_mat, _col))
#define MATRIX_COL_INDEX(_mat, _col)

Definition at line 41 of file mathutils_Matrix.hh.

Referenced by matrix_as_3x3(), Matrix_resize_4x4(), Matrix_to_NxN(), and Matrix_to_translation().

◆ MATRIX_ITEM

◆ MATRIX_ITEM_ASSERT

#define MATRIX_ITEM_ASSERT ( _mat,
_row,
_col )
Value:
(BLI_assert(_row < (_mat)->row_num && _col < (_mat)->col_num))
#define BLI_assert(a)
Definition BLI_assert.h:46

Definition at line 28 of file mathutils_Matrix.hh.

◆ MATRIX_ITEM_INDEX

#define MATRIX_ITEM_INDEX ( _mat,
_row,
_col )
Value:
(MATRIX_ITEM_ASSERT(_mat, _row, _col), (((_mat)->row_num * (_col)) + (_row)))
#define MATRIX_ITEM_ASSERT(_mat, _row, _col)

Definition at line 35 of file mathutils_Matrix.hh.

◆ MATRIX_ITEM_INDEX_NUMROW

#define MATRIX_ITEM_INDEX_NUMROW ( _totrow,
_row,
_col )
Value:
(((_totrow) * (_col)) + (_row))

Definition at line 34 of file mathutils_Matrix.hh.

Referenced by matrix_invert_with_det_n_internal().

◆ MATRIX_ITEM_PTR

#define MATRIX_ITEM_PTR ( _mat,
_row,
_col )
Value:
((_mat)->matrix + MATRIX_ITEM_INDEX(_mat, _row, _col))

Definition at line 37 of file mathutils_Matrix.hh.

◆ MATRIX_MAX_DIM

◆ MatrixObject_Check

◆ MatrixObject_CheckExact

#define MatrixObject_CheckExact ( v)
Value:
(Py_TYPE(v) == &matrix_Type)

Definition at line 21 of file mathutils_Matrix.hh.

Function Documentation

◆ matrix_as_3x3()

void matrix_as_3x3 ( float mat[3][3],
MatrixObject * self )

◆ Matrix_CreatePyObject()

◆ Matrix_CreatePyObject_alloc()

PyObject * Matrix_CreatePyObject_alloc ( float * mat,
ushort col_num,
ushort row_num,
PyTypeObject * base_type )
nodiscard
Parameters
matInitialized matrix value to use in-place, allocated with #PyMem_Malloc

Definition at line 3717 of file mathutils_Matrix.cc.

References BASE_MATH_FLAG_IS_WRAP, Matrix_CreatePyObject_wrap(), and self.

Referenced by Matrix_to_NxN().

◆ Matrix_CreatePyObject_cb()

PyObject * Matrix_CreatePyObject_cb ( PyObject * cb_user,
unsigned short col_num,
unsigned short row_num,
unsigned char cb_type,
unsigned char cb_subtype )
nodiscard

Definition at line 3702 of file mathutils_Matrix.cc.

References BLI_assert, Matrix_CreatePyObject(), and self.

Referenced by pyrna_math_object_from_array().

◆ Matrix_CreatePyObject_wrap()

PyObject * Matrix_CreatePyObject_wrap ( float * mat,
ushort col_num,
ushort row_num,
PyTypeObject * base_type )
nodiscard

◆ Matrix_Parse2x2()

int Matrix_Parse2x2 ( PyObject * o,
void * p )
nodiscard

Definition at line 3766 of file mathutils_Matrix.cc.

References MatrixObject::col_num, Matrix_ParseCheck(), and MatrixObject::row_num.

Referenced by Vector_rotate().

◆ Matrix_Parse3x3()

int Matrix_Parse3x3 ( PyObject * o,
void * p )
nodiscard

◆ Matrix_Parse4x4()

◆ Matrix_ParseAny()

int Matrix_ParseAny ( PyObject * o,
void * p )
nodiscard

Definition at line 3754 of file mathutils_Matrix.cc.

References Matrix_ParseCheck().

Referenced by bpy_slot_from_py().

Variable Documentation

◆ mathutils_matrix_col_cb

struct Mathutils_Callback mathutils_matrix_col_cb
extern

Definition at line 499 of file mathutils_Matrix.cc.

Referenced by PyInit_mathutils().

◆ mathutils_matrix_col_cb_index

unsigned char mathutils_matrix_col_cb_index
extern

Definition at line 412 of file mathutils_Matrix.cc.

Referenced by Matrix_item_col(), and PyInit_mathutils().

◆ mathutils_matrix_row_cb

struct Mathutils_Callback mathutils_matrix_row_cb
extern

Definition at line 397 of file mathutils_Matrix.cc.

Referenced by PyInit_mathutils().

◆ mathutils_matrix_row_cb_index

unsigned char mathutils_matrix_row_cb_index
extern

Definition at line 318 of file mathutils_Matrix.cc.

Referenced by Matrix_item_row(), Matrix_slice(), and PyInit_mathutils().

◆ mathutils_matrix_translation_cb

struct Mathutils_Callback mathutils_matrix_translation_cb
extern

Definition at line 583 of file mathutils_Matrix.cc.

Referenced by PyInit_mathutils().

◆ mathutils_matrix_translation_cb_index

unsigned char mathutils_matrix_translation_cb_index
extern

Definition at line 516 of file mathutils_Matrix.cc.

Referenced by Matrix_translation_get(), and PyInit_mathutils().

◆ matrix_access_Type

PyTypeObject matrix_access_Type
extern

Definition at line 4000 of file mathutils_Matrix.cc.

Referenced by MatrixAccess_CreatePyObject(), and PyInit_mathutils().

◆ matrix_Type

PyTypeObject matrix_Type
extern