|
Blender
V2.59
|
00001 /* 00002 * $Id: mathutils_Matrix.h 38409 2011-07-15 04:01:47Z campbellbarton $ 00003 * ***** BEGIN GPL LICENSE BLOCK ***** 00004 * 00005 * This program is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU General Public License 00007 * as published by the Free Software Foundation; either version 2 00008 * of the License, or (at your option) any later version. 00009 * 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 * GNU General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU General Public License 00016 * along with this program; if not, write to the Free Software Foundation, 00017 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00018 * 00019 * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. 00020 * All rights reserved. 00021 * 00022 * The Original Code is: all of this file. 00023 * 00024 * Contributor(s): Joseph Gilbert 00025 * 00026 * ***** END GPL LICENSE BLOCK ***** 00027 * 00028 */ 00029 00035 #ifndef MATHUTILS_MATRIX_H 00036 #define MATHUTILS_MATRIX_H 00037 00038 extern PyTypeObject matrix_Type; 00039 #define MatrixObject_Check(_v) PyObject_TypeCheck((_v), &matrix_Type) 00040 #define MATRIX_MAX_DIM 4 00041 00042 typedef struct { 00043 BASE_MATH_MEMBERS(contigPtr) 00044 float *matrix[MATRIX_MAX_DIM]; /* ptr to the contigPtr (accessor) */ 00045 unsigned short row_size; 00046 unsigned short col_size; 00047 } MatrixObject; 00048 00049 /*struct data contains a pointer to the actual data that the 00050 object uses. It can use either PyMem allocated data (which will 00051 be stored in py_data) or be a wrapper for data allocated through 00052 blender (stored in blend_data). This is an either/or struct not both*/ 00053 00054 /*prototypes*/ 00055 PyObject *newMatrixObject(float *mat, const unsigned short row_size, const unsigned short col_size, int type, PyTypeObject *base_type); 00056 PyObject *newMatrixObject_cb(PyObject *user, int row_size, int col_size, int cb_type, int cb_subtype); 00057 00058 extern int mathutils_matrix_vector_cb_index; 00059 extern struct Mathutils_Callback mathutils_matrix_vector_cb; 00060 00061 void matrix_as_3x3(float mat[3][3], MatrixObject *self); 00062 00063 #endif /* MATHUTILS_MATRIX_H */