Docs: mathutils docstrings

This commit is contained in:
2017-09-09 11:02:26 +10:00
parent 90eb93791f
commit 30d8829780
2 changed files with 22 additions and 1 deletions

View File

@@ -41,9 +41,18 @@ extern char BaseMathObject_owner_doc[];
(struct_name *)((base_type ? (base_type)->tp_alloc(base_type, 0) : _PyObject_GC_New(&(root_type))));
/* BaseMathObject.flag */
/** BaseMathObject.flag */
enum {
/**
* 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.
* Prefer using callbacks where possible, see: #Mathutils_RegisterCallback
*/
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.
* (typical use cases for tuple).
*/
BASE_MATH_FLAG_IS_FROZEN = (1 << 1),
};
#define BASE_MATH_FLAG_DEFAULT 0

View File

@@ -3029,6 +3029,11 @@ PyObject *Vector_CreatePyObject(
return (PyObject *)self;
}
/**
* Create a vector that wraps existing memory.
*
* \param vec: Use this vector in-place.
*/
PyObject *Vector_CreatePyObject_wrap(
float *vec, const int size,
PyTypeObject *base_type)
@@ -3055,6 +3060,10 @@ PyObject *Vector_CreatePyObject_wrap(
return (PyObject *) self;
}
/**
* Create a vector where the value is defined by registered callbacks,
* see: #Mathutils_RegisterCallback
*/
PyObject *Vector_CreatePyObject_cb(
PyObject *cb_user, int size,
unsigned char cb_type, unsigned char cb_subtype)
@@ -3071,6 +3080,9 @@ PyObject *Vector_CreatePyObject_cb(
return (PyObject *)self;
}
/**
* \param vec: Initialized vector value to use in-place, allocated with: PyMem_Malloc
*/
PyObject *Vector_CreatePyObject_alloc(
float *vec, const int size,
PyTypeObject *base_type)