Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-03-18 02:05:07 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-03-18 02:14:47 +0400
commit7da21752716a0e9e6e6ad8ccbda20fb1c5e8e123 (patch)
treed72216f3cdf2e5887282fbce2e0eec28d025392d /source/blender/blenlib/BLI_kdtree.h
parenta861e5572a70111bbe3ae84d82595eddc43b7d88 (diff)
KDTree: deprecate 'normal' argument
Normals for each kdtree node were allocated but never used, and search args only use in particles/boids code.
Diffstat (limited to 'source/blender/blenlib/BLI_kdtree.h')
-rw-r--r--source/blender/blenlib/BLI_kdtree.h32
1 files changed, 22 insertions, 10 deletions
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__ */