From 7da21752716a0e9e6e6ad8ccbda20fb1c5e8e123 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 18 Mar 2014 09:05:07 +1100 Subject: KDTree: deprecate 'normal' argument Normals for each kdtree node were allocated but never used, and search args only use in particles/boids code. --- source/blender/blenlib/BLI_kdtree.h | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'source/blender/blenlib/BLI_kdtree.h') diff --git a/source/blender/blenlib/BLI_kdtree.h b/source/blender/blenlib/BLI_kdtree.h index e3c81021351..ebf03b5bc67 100644 --- a/source/blender/blenlib/BLI_kdtree.h +++ b/source/blender/blenlib/BLI_kdtree.h @@ -44,17 +44,29 @@ typedef struct KDTreeNearest { KDTree *BLI_kdtree_new(unsigned int maxsize); void BLI_kdtree_free(KDTree *tree); - -void BLI_kdtree_insert(KDTree *tree, int index, const float co[3], const float nor[3]) ATTR_NONNULL(1, 3); void BLI_kdtree_balance(KDTree *tree) ATTR_NONNULL(1); -int BLI_kdtree_find_nearest(KDTree *tree, const float co[3], const float nor[3], - KDTreeNearest *r_nearest) ATTR_NONNULL(1, 2); -int BLI_kdtree_find_nearest_n(KDTree *tree, const float co[3], const float nor[3], - KDTreeNearest *r_nearest, - unsigned int n) ATTR_NONNULL(1, 2, 4); -int BLI_kdtree_range_search(KDTree *tree, const float co[3], const float nor[3], - KDTreeNearest **r_nearest, - float range) ATTR_NONNULL(1, 2, 4) ATTR_WARN_UNUSED_RESULT; +void BLI_kdtree_insert( + KDTree *tree, int index, + const float co[3]) ATTR_NONNULL(1, 3); +int BLI_kdtree_find_nearest( + KDTree *tree, const float co[3], + KDTreeNearest *r_nearest) ATTR_NONNULL(1, 2); + +#define BLI_kdtree_find_nearest_n(tree, co, r_nearest, n) \ + BLI_kdtree_find_nearest_n__normal(tree, co, NULL, r_nearest, n) +#define BLI_kdtree_range_search(tree, co, r_nearest, range) \ + BLI_kdtree_range_search__normal(tree, co, NULL, r_nearest, range) + +/* Normal use is deprecated */ +/* remove __normal functions when last users drop */ +int BLI_kdtree_find_nearest_n__normal( + KDTree *tree, const float co[3], const float nor[3], + KDTreeNearest *r_nearest, + unsigned int n) ATTR_NONNULL(1, 2, 4); +int BLI_kdtree_range_search__normal( + KDTree *tree, const float co[3], const float nor[3], + KDTreeNearest **r_nearest, + float range) ATTR_NONNULL(1, 2, 4) ATTR_WARN_UNUSED_RESULT; #endif /* __BLI_KDTREE_H__ */ -- cgit v1.2.3