Blender
V3.3
|
#include "testing/testing.h"
#include "MEM_guardedalloc.h"
#include "BLI_compiler_attrs.h"
#include "BLI_kdopbvh.h"
#include "BLI_math_vector.h"
#include "BLI_rand.h"
Go to the source code of this file.
Functions | |
static void | rng_v3_round (float *coords, int coords_len, struct RNG *rng, int round, float scale) |
TEST (kdopbvh, Empty) | |
TEST (kdopbvh, Single) | |
static void | optimal_check_callback (void *userdata, int index, const float co[3], BVHTreeNearest *nearest) |
static void | find_nearest_points_test (int points_len, float scale, int round, int random_seed, bool optimal=false) |
TEST (kdopbvh, FindNearest_1) | |
TEST (kdopbvh, FindNearest_2) | |
TEST (kdopbvh, FindNearest_500) | |
TEST (kdopbvh, OptimalFindNearest_1) | |
TEST (kdopbvh, OptimalFindNearest_2) | |
TEST (kdopbvh, OptimalFindNearest_500) | |
|
static |
Note that a small epsilon is added to the BVH nodes bounds, even if we pass in zero. Use rounding to ensure very close nodes don't cause the wrong node to be found as nearest.
Definition at line 69 of file BLI_kdopbvh_test.cc.
References BLI_bvhtree_balance(), BLI_bvhtree_find_nearest_ex(), BLI_bvhtree_free(), BLI_bvhtree_insert(), BLI_bvhtree_new(), BLI_rng_free(), BLI_rng_new(), BVH_NEAREST_OPTIMAL_ORDER, callback, float(), len_v3v3(), MEM_freeN, MEM_mallocN, optimal_check_callback(), print_v3_id, RNG::rng, rng_v3_round(), and tree.
Referenced by TEST().
|
static |
Definition at line 50 of file BLI_kdopbvh_test.cc.
References BVHTreeNearest::dist_sq, EXPECT_EQ(), float(), BVHTreeNearest::index, and len_squared_v3v3().
Referenced by find_nearest_points_test().
|
static |
Definition at line 17 of file BLI_kdopbvh_test.cc.
References BLI_rng_get_float(), and float().
Referenced by find_nearest_points_test().
TEST | ( | kdopbvh | , |
Empty | |||
) |
Definition at line 28 of file BLI_kdopbvh_test.cc.
References BLI_bvhtree_balance(), BLI_bvhtree_free(), BLI_bvhtree_get_len(), BLI_bvhtree_new(), EXPECT_EQ(), and tree.
TEST | ( | kdopbvh | , |
FindNearest_1 | |||
) |
Definition at line 110 of file BLI_kdopbvh_test.cc.
References find_nearest_points_test().
TEST | ( | kdopbvh | , |
FindNearest_2 | |||
) |
Definition at line 114 of file BLI_kdopbvh_test.cc.
References find_nearest_points_test().
TEST | ( | kdopbvh | , |
FindNearest_500 | |||
) |
Definition at line 118 of file BLI_kdopbvh_test.cc.
References find_nearest_points_test().
TEST | ( | kdopbvh | , |
OptimalFindNearest_1 | |||
) |
Definition at line 123 of file BLI_kdopbvh_test.cc.
References find_nearest_points_test().
TEST | ( | kdopbvh | , |
OptimalFindNearest_2 | |||
) |
Definition at line 127 of file BLI_kdopbvh_test.cc.
References find_nearest_points_test().
TEST | ( | kdopbvh | , |
OptimalFindNearest_500 | |||
) |
Definition at line 131 of file BLI_kdopbvh_test.cc.
References find_nearest_points_test().
TEST | ( | kdopbvh | , |
Single | |||
) |
Definition at line 36 of file BLI_kdopbvh_test.cc.
References BLI_bvhtree_balance(), BLI_bvhtree_free(), BLI_bvhtree_get_len(), BLI_bvhtree_insert(), BLI_bvhtree_new(), EXPECT_EQ(), and tree.