|
Blender V4.3
|
#include <Python.h>#include "MEM_guardedalloc.h"#include "BLI_kdtree.h"#include "BLI_utildefines.h"#include "../generic/py_capi_utils.hh"#include "../generic/python_utildefines.hh"#include "mathutils.hh"#include "mathutils_kdtree.hh"#include "BLI_strict_flags.h"Go to the source code of this file.
Classes | |
| struct | PyKDTree |
| struct | PyKDTree_NearestData |
Macros | |
| #define | UINT_IS_NEG(n) ((n) > INT_MAX) |
Functions | |
| static void | kdtree_nearest_to_py_tuple (const KDTreeNearest_3d *nearest, PyObject *py_retval) |
| static PyObject * | kdtree_nearest_to_py (const KDTreeNearest_3d *nearest) |
| static PyObject * | kdtree_nearest_to_py_and_check (const KDTreeNearest_3d *nearest) |
| static int | PyKDTree__tp_init (PyKDTree *self, PyObject *args, PyObject *kwargs) |
| static void | PyKDTree__tp_dealloc (PyKDTree *self) |
| PyDoc_STRVAR (py_kdtree_insert_doc, ".. method:: insert(co, index)\n" "\n" " Insert a point into the KDTree.\n" "\n" " :arg co: Point 3d position.\n" " :type co: Sequence[float]\n" " :arg index: The index of the point.\n" " :type index: int\n") | |
| static PyObject * | py_kdtree_insert (PyKDTree *self, PyObject *args, PyObject *kwargs) |
| PyDoc_STRVAR (py_kdtree_balance_doc, ".. method:: balance()\n" "\n" " Balance the tree.\n" "\n" ".. note::\n" "\n" " This builds the entire tree, avoid calling after each insertion.\n") | |
| static PyObject * | py_kdtree_balance (PyKDTree *self) |
| static int | py_find_nearest_cb (void *user_data, int index, const float co[3], float dist_sq) |
| PyDoc_STRVAR (py_kdtree_find_doc, ".. method:: find(co, filter=None)\n" "\n" " Find nearest point to ``co``.\n" "\n" " :arg co: 3D coordinates.\n" " :type co: Sequence[float]\n" " :arg filter: function which takes an index and returns True for indices to " "include in the search.\n" " :type filter: Callable[[int], bool]\n" " :return: Returns (position, index, distance).\n" " :rtype: tuple[:class:`Vector`, int, float]\n") | |
| static PyObject * | py_kdtree_find (PyKDTree *self, PyObject *args, PyObject *kwargs) |
| PyDoc_STRVAR (py_kdtree_find_n_doc, ".. method:: find_n(co, n)\n" "\n" " Find nearest ``n`` points to ``co``.\n" "\n" " :arg co: 3D coordinates.\n" " :type co: Sequence[float]\n" " :arg n: Number of points to find.\n" " :type n: int\n" " :return: Returns a list of tuples (position, index, distance).\n" " :rtype: list[tuple[:class:`Vector`, int, float]]\n") | |
| static PyObject * | py_kdtree_find_n (PyKDTree *self, PyObject *args, PyObject *kwargs) |
| PyDoc_STRVAR (py_kdtree_find_range_doc, ".. method:: find_range(co, radius)\n" "\n" " Find all points within ``radius`` of ``co``.\n" "\n" " :arg co: 3D coordinates.\n" " :type co: Sequence[float]\n" " :arg radius: Distance to search for points.\n" " :type radius: float\n" " :return: Returns a list of tuples (position, index, distance).\n" " :rtype: list[tuple[:class:`Vector`, int, float]]\n") | |
| static PyObject * | py_kdtree_find_range (PyKDTree *self, PyObject *args, PyObject *kwargs) |
| PyDoc_STRVAR (py_KDtree_doc, "KdTree(size) -> new kd-tree initialized to hold ``size`` items.\n" "\n" ".. note::\n" "\n" " :class:`KDTree.balance` must have been called before using any of the ``find`` " "methods.\n") | |
| PyDoc_STRVAR (py_kdtree_doc, "Generic 3-dimensional kd-tree to perform spatial searches.") | |
| PyMODINIT_FUNC | PyInit_mathutils_kdtree () |
Variables | |
| static PyMethodDef | PyKDTree_methods [] |
| PyTypeObject | PyKDTree_Type |
| static PyModuleDef | kdtree_moduledef |
This file defines the 'mathutils.kdtree' module, a general purpose module to access blenders kdtree for 3d spatial lookups.
Definition in file mathutils_kdtree.cc.
| #define UINT_IS_NEG | ( | n | ) | ((n) > INT_MAX) |
Definition at line 80 of file mathutils_kdtree.cc.
Referenced by py_kdtree_find_n(), and PyKDTree__tp_init().
|
static |
Definition at line 49 of file mathutils_kdtree.cc.
References kdtree_nearest_to_py_tuple().
Referenced by py_kdtree_find_n(), and py_kdtree_find_range().
|
static |
Definition at line 60 of file mathutils_kdtree.cc.
References kdtree_nearest_to_py_tuple(), and PyC_Tuple_Fill().
Referenced by py_kdtree_find().
|
static |
Definition at line 38 of file mathutils_kdtree.cc.
References BLI_assert, PyTuple_SET_ITEMS, and Vector_CreatePyObject().
Referenced by kdtree_nearest_to_py(), and kdtree_nearest_to_py_and_check().
|
static |
Definition at line 174 of file mathutils_kdtree.cc.
References int, PyC_ParseBool(), and UNUSED_VARS.
Referenced by py_kdtree_find().
|
static |
Definition at line 162 of file mathutils_kdtree.cc.
References self.
|
static |
Definition at line 212 of file mathutils_kdtree.cc.
References kdtree_nearest_to_py_and_check(), mathutils_array_parse(), PyKDTree_NearestData::py_filter, py_find_nearest_cb(), and self.
|
static |
Definition at line 268 of file mathutils_kdtree.cc.
References kdtree_nearest_to_py(), mathutils_array_parse(), MEM_freeN(), MEM_mallocN, self, and UINT_IS_NEG.
|
static |
Definition at line 324 of file mathutils_kdtree.cc.
References kdtree_nearest_to_py(), mathutils_array_parse(), MEM_freeN(), and self.
|
static |
Definition at line 121 of file mathutils_kdtree.cc.
References mathutils_array_parse(), and self.
| PyDoc_STRVAR | ( | py_kdtree_balance_doc | , |
| ".. method:: balance()\n" "\n" " Balance the tree.\n" "\n" ".. note::\n" "\n" " This builds the entire | tree, | ||
| avoid calling after each insertion.\n" | ) |
| PyDoc_STRVAR | ( | py_kdtree_doc | , |
| "Generic 3-dimensional kd-tree to perform spatial searches." | ) |
| PyDoc_STRVAR | ( | py_KDtree_doc | , |
| "KdTree(size) -> new kd-tree initialized to hold ``size`` items.\n" "\n" ".. note::\n" "\n" " :class:`KDTree.balance` must have been called before using any of the ``find`` " "methods.\n" | ) |
| PyDoc_STRVAR | ( | py_kdtree_find_doc | , |
| ".. method:: find(co, filter=None)\n" "\n" " Find nearest point to ``co``.\n" "\n" " :arg co: 3D coordinates.\n" " :type co: Sequence\n" " :arg filter: function which takes an index and returns True for indices to " "include in the search.\n" " :type filter: | Callable[float][[int], | ||
| bool]\n" " :return:Returns(position, index, distance).\n" " :rtype:tuple\n" | [:class:`Vector`, int, float] ) |
| PyDoc_STRVAR | ( | py_kdtree_find_n_doc | , |
| ".. method:: find_n(co, n)\n" "\n" " Find nearest ``n`` points to ``co``.\n" "\n" " :arg co: 3D coordinates.\n" " :type co: Sequence\n" " :arg n: Number of points to find.\n" " :type n: int\n" " :return: Returns a list of tuples (position, index, distance).\n" " :rtype: list]\n" | [float][tuple[:class:`Vector`, int, float] ) |
| PyDoc_STRVAR | ( | py_kdtree_find_range_doc | , |
| ".. method:: find_range(co, radius)\n" "\n" " Find all points within ``radius`` of ``co``.\n" "\n" " :arg co: 3D coordinates.\n" " :type co: Sequence\n" " :arg radius: Distance to search for points.\n" " :type radius: float\n" " :return: Returns a list of tuples (position, index, distance).\n" " :rtype: list]\n" | [float][tuple[:class:`Vector`, int, float] ) |
| PyDoc_STRVAR | ( | py_kdtree_insert_doc | , |
| ".. method:: insert(co, index)\n" "\n" " Insert a point into the KDTree.\n" "\n" " :arg co: Point 3d position.\n" " :type co: Sequence\n" " :arg index: The index of the point.\n" " :type index: int\n" | [float] ) |
| PyMODINIT_FUNC PyInit_mathutils_kdtree | ( | ) |
Definition at line 469 of file mathutils_kdtree.cc.
References kdtree_moduledef, and PyKDTree_Type.
Referenced by PyInit_mathutils().
|
static |
Definition at line 104 of file mathutils_kdtree.cc.
References self.
Definition at line 82 of file mathutils_kdtree.cc.
References self, and UINT_IS_NEG.
|
static |
Definition at line 457 of file mathutils_kdtree.cc.
Referenced by PyInit_mathutils_kdtree().
|
static |
Definition at line 375 of file mathutils_kdtree.cc.
| PyTypeObject PyKDTree_Type |
Definition at line 401 of file mathutils_kdtree.cc.
Referenced by PyInit_mathutils_kdtree().