diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2020-05-15 14:54:22 +0300 |
---|---|---|
committer | Jeroen Bakker <j.bakker@atmind.nl> | 2020-05-15 14:55:01 +0300 |
commit | 86580c437bb51a5a9c5f7875ad414bd619083886 (patch) | |
tree | 214b1210f0c57ac5bf46128a6171a9fedebd9aa9 /source/blender/blenkernel/BKE_bvhutils.h | |
parent | 03659c2cf9b38eef65b7d1dcd4263ef8a5602bde (diff) |
Cleanup: int->BVHCacheType enum
Diffstat (limited to 'source/blender/blenkernel/BKE_bvhutils.h')
-rw-r--r-- | source/blender/blenkernel/BKE_bvhutils.h | 51 |
1 files changed, 26 insertions, 25 deletions
diff --git a/source/blender/blenkernel/BKE_bvhutils.h b/source/blender/blenkernel/BKE_bvhutils.h index b83ebf8ce09..458f1ab7a56 100644 --- a/source/blender/blenkernel/BKE_bvhutils.h +++ b/source/blender/blenkernel/BKE_bvhutils.h @@ -85,6 +85,21 @@ typedef struct BVHTreeFromMesh { } BVHTreeFromMesh; +typedef enum BVHCacheType { + BVHTREE_FROM_VERTS, + BVHTREE_FROM_EDGES, + BVHTREE_FROM_FACES, + BVHTREE_FROM_LOOPTRI, + BVHTREE_FROM_LOOPTRI_NO_HIDDEN, + + BVHTREE_FROM_LOOSEVERTS, + BVHTREE_FROM_LOOSEEDGES, + + BVHTREE_FROM_EM_VERTS, + BVHTREE_FROM_EM_EDGES, + BVHTREE_FROM_EM_LOOPTRI, +} BVHCacheType; + /** * Builds a bvh tree where nodes are the relevant elements of the given mesh. * Configures #BVHTreeFromMesh. @@ -106,7 +121,7 @@ BVHTree *bvhtree_from_editmesh_verts_ex(BVHTreeFromEditMesh *data, float epsilon, int tree_type, int axis, - const int bvh_cache_type, + const BVHCacheType bvh_cache_type, BVHCache **bvh_cache); BVHTree *bvhtree_from_mesh_verts_ex(struct BVHTreeFromMesh *data, @@ -118,7 +133,7 @@ BVHTree *bvhtree_from_mesh_verts_ex(struct BVHTreeFromMesh *data, float epsilon, int tree_type, int axis, - const int bvh_cache_type, + const BVHCacheType bvh_cache_type, BVHCache **bvh_cache); BVHTree *bvhtree_from_editmesh_edges( @@ -131,7 +146,7 @@ BVHTree *bvhtree_from_editmesh_edges_ex(BVHTreeFromEditMesh *data, float epsilon, int tree_type, int axis, - const int bvh_cache_type, + const BVHCacheType bvh_cache_type, BVHCache **bvh_cache); BVHTree *bvhtree_from_mesh_edges_ex(struct BVHTreeFromMesh *data, @@ -145,7 +160,7 @@ BVHTree *bvhtree_from_mesh_edges_ex(struct BVHTreeFromMesh *data, float epsilon, int tree_type, int axis, - const int bvh_cache_type, + const BVHCacheType bvh_cache_type, BVHCache **bvh_cache); BVHTree *bvhtree_from_mesh_faces_ex(struct BVHTreeFromMesh *data, @@ -159,7 +174,7 @@ BVHTree *bvhtree_from_mesh_faces_ex(struct BVHTreeFromMesh *data, float epsilon, int tree_type, int axis, - const int bvh_cache_type, + const BVHCacheType bvh_cache_type, BVHCache **bvh_cache); BVHTree *bvhtree_from_editmesh_looptri( @@ -172,7 +187,7 @@ BVHTree *bvhtree_from_editmesh_looptri_ex(BVHTreeFromEditMesh *data, float epsilon, int tree_type, int axis, - const int bvh_cache_type, + const BVHCacheType bvh_cache_type, BVHCache **bvh_cache); BVHTree *bvhtree_from_mesh_looptri_ex(struct BVHTreeFromMesh *data, @@ -188,18 +203,18 @@ BVHTree *bvhtree_from_mesh_looptri_ex(struct BVHTreeFromMesh *data, float epsilon, int tree_type, int axis, - const int bvh_cache_type, + const BVHCacheType bvh_cache_type, BVHCache **bvh_cache); BVHTree *BKE_bvhtree_from_mesh_get(struct BVHTreeFromMesh *data, struct Mesh *mesh, - const int type, + const BVHCacheType bvh_cache_type, const int tree_type); BVHTree *BKE_bvhtree_from_editmesh_get(BVHTreeFromEditMesh *data, struct BMEditMesh *em, const int tree_type, - const int bvh_cache_type, + const BVHCacheType bvh_cache_type, BVHCache **bvh_cache); /** @@ -228,24 +243,10 @@ float bvhtree_sphereray_tri_intersection(const BVHTreeRay *ray, */ /* Using local coordinates */ -enum { - BVHTREE_FROM_VERTS, - BVHTREE_FROM_EDGES, - BVHTREE_FROM_FACES, - BVHTREE_FROM_LOOPTRI, - BVHTREE_FROM_LOOPTRI_NO_HIDDEN, - - BVHTREE_FROM_LOOSEVERTS, - BVHTREE_FROM_LOOSEEDGES, - - BVHTREE_FROM_EM_VERTS, - BVHTREE_FROM_EM_EDGES, - BVHTREE_FROM_EM_LOOPTRI, -}; -bool bvhcache_find(const BVHCache *cache, int type, BVHTree **r_tree); +bool bvhcache_find(const BVHCache *cache, BVHCacheType type, BVHTree **r_tree); bool bvhcache_has_tree(const BVHCache *cache, const BVHTree *tree); -void bvhcache_insert(BVHCache **cache_p, BVHTree *tree, int type); +void bvhcache_insert(BVHCache **cache_p, BVHTree *tree, BVHCacheType type); void bvhcache_free(BVHCache **cache_p); #ifdef __cplusplus |