Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/mathutils/mathutils.h
| /* SPDX-License-Identifier: GPL-2.0-or-later */ | /* SPDX-License-Identifier: GPL-2.0-or-later */ | ||||
| #pragma once | #pragma once | ||||
| /** \file | /** \file | ||||
| * \ingroup pymathutils | * \ingroup pymathutils | ||||
| */ | */ | ||||
| /* Can cast different mathutils types to this, use for generic funcs */ | /* Can cast different mathutils types to this, use for generic functions. */ | ||||
| #include "BLI_compiler_attrs.h" | #include "BLI_compiler_attrs.h" | ||||
| struct DynStr; | struct DynStr; | ||||
| extern char BaseMathObject_is_wrapped_doc[]; | extern char BaseMathObject_is_wrapped_doc[]; | ||||
| extern char BaseMathObject_is_frozen_doc[]; | extern char BaseMathObject_is_frozen_doc[]; | ||||
| extern char BaseMathObject_is_valid_doc[]; | extern char BaseMathObject_is_valid_doc[]; | ||||
| extern char BaseMathObject_owner_doc[]; | extern char BaseMathObject_owner_doc[]; | ||||
| #define BASE_MATH_NEW(struct_name, root_type, base_type) \ | #define BASE_MATH_NEW(struct_name, root_type, base_type) \ | ||||
| ((struct_name *)((base_type ? (base_type)->tp_alloc(base_type, 0) : \ | ((struct_name *)((base_type ? (base_type)->tp_alloc(base_type, 0) : \ | ||||
| _PyObject_GC_New(&(root_type))))) | _PyObject_GC_New(&(root_type))))) | ||||
| /** BaseMathObject.flag */ | /** #BaseMathObject.flag */ | ||||
| enum { | enum { | ||||
| /** | /** | ||||
| * Do not own the memory used in this vector, | * Do not own the memory used in this vector, | ||||
| * \note This is error prone if the memory may be freed while this vector is in use. | * \note This is error prone if the memory may be freed while this vector is in use. | ||||
| * Prefer using callbacks where possible, see: #Mathutils_RegisterCallback | * Prefer using callbacks where possible, see: #Mathutils_RegisterCallback | ||||
| */ | */ | ||||
| BASE_MATH_FLAG_IS_WRAP = (1 << 0), | BASE_MATH_FLAG_IS_WRAP = (1 << 0), | ||||
| /** | /** | ||||
| * Prevent changes to the vector so it can be used as a set or dictionary key for example. | * Prevent changes to the vector so it can be used as a set or dictionary key for example. | ||||
| * (typical use cases for tuple). | * (typical use cases for tuple). | ||||
| */ | */ | ||||
| BASE_MATH_FLAG_IS_FROZEN = (1 << 1), | BASE_MATH_FLAG_IS_FROZEN = (1 << 1), | ||||
| }; | }; | ||||
| #define BASE_MATH_FLAG_DEFAULT 0 | #define BASE_MATH_FLAG_DEFAULT 0 | ||||
| #define BASE_MATH_MEMBERS(_data) \ | #define BASE_MATH_MEMBERS(_data) \ | ||||
| /** Array of data (alias), wrapped status depends on wrapped status. */ \ | /** Array of data (alias), wrapped status depends on wrapped status. */ \ | ||||
| PyObject_VAR_HEAD \ | PyObject_VAR_HEAD \ | ||||
| float *_data; \ | float *_data; \ | ||||
| /** If this vector references another object, otherwise NULL, *Note* this owns its reference */ \ | /** If this vector references another object, otherwise NULL, *Note* this owns its reference */ \ | ||||
| PyObject *cb_user; \ | PyObject *cb_user; \ | ||||
| /** Which user funcs do we adhere to, RNA, etc */ \ | /** Which user functions do we adhere to, RNA, etc */ \ | ||||
| unsigned char cb_type; \ | unsigned char cb_type; \ | ||||
| /** Sub-type: location, rotation... \ | /** Sub-type: location, rotation... \ | ||||
| * to avoid defining many new functions for every attribute of the same type */ \ | * to avoid defining many new functions for every attribute of the same type */ \ | ||||
| unsigned char cb_subtype; \ | unsigned char cb_subtype; \ | ||||
| /** Wrapped data type. */ \ | /** Wrapped data type. */ \ | ||||
| unsigned char flag | unsigned char flag | ||||
| typedef struct { | typedef struct { | ||||
| ▲ Show 20 Lines • Show All 174 Lines • Show Last 20 Lines | |||||