Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/BKE_pbvh.h
| Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
| * These structs represent logical verts/edges/faces. | * These structs represent logical verts/edges/faces. | ||||
| * for PBVH_GRIDS and PBVH_FACES they store integer | * for PBVH_GRIDS and PBVH_FACES they store integer | ||||
| * offsets, PBVH_BMESH stores pointers. | * offsets, PBVH_BMESH stores pointers. | ||||
| * | * | ||||
| * The idea is to enforce stronger type checking by encapsulating | * The idea is to enforce stronger type checking by encapsulating | ||||
| * intptr_t's in structs. | * intptr_t's in structs. | ||||
| */ | */ | ||||
| /* A generic PBVH vertex. | |||||
| * | |||||
| * Note: in PBVH_GRIDS we consider the final grid points | |||||
| * to be vertices. This is not true of edges or faces which are pulled from | |||||
| * the base mesh. | |||||
| */ | |||||
| typedef struct PBVHVertRef { | typedef struct PBVHVertRef { | ||||
| intptr_t i; | intptr_t i; | ||||
| } PBVHVertRef; | } PBVHVertRef; | ||||
| /* Note: edges in PBVH_GRIDS are always pulled from the base mesh.*/ | |||||
| typedef struct PBVHEdgeRef { | typedef struct PBVHEdgeRef { | ||||
| intptr_t i; | intptr_t i; | ||||
| } PBVHEdgeRef; | } PBVHEdgeRef; | ||||
| /* Note: faces in PBVH_GRIDS are always puled from the base mesh.*/ | |||||
| typedef struct PBVHFaceRef { | typedef struct PBVHFaceRef { | ||||
| intptr_t i; | intptr_t i; | ||||
| } PBVHFaceRef; | } PBVHFaceRef; | ||||
| #define PBVH_REF_NONE -1LL | #define PBVH_REF_NONE -1LL | ||||
| typedef struct { | typedef struct { | ||||
| float (*co)[3]; | float (*co)[3]; | ||||
| ▲ Show 20 Lines • Show All 341 Lines • ▼ Show 20 Lines | bool BKE_pbvh_bmesh_update_topology(PBVH *pbvh, | ||||
| bool use_frontface, | bool use_frontface, | ||||
| bool use_projected); | bool use_projected); | ||||
| /* Node Access */ | /* Node Access */ | ||||
| void BKE_pbvh_node_mark_update(PBVHNode *node); | void BKE_pbvh_node_mark_update(PBVHNode *node); | ||||
| void BKE_pbvh_node_mark_update_mask(PBVHNode *node); | void BKE_pbvh_node_mark_update_mask(PBVHNode *node); | ||||
| void BKE_pbvh_node_mark_update_color(PBVHNode *node); | void BKE_pbvh_node_mark_update_color(PBVHNode *node); | ||||
| void BKE_pbvh_node_mark_update_face_sets(PBVHNode *node); | |||||
| void BKE_pbvh_node_mark_update_visibility(PBVHNode *node); | void BKE_pbvh_node_mark_update_visibility(PBVHNode *node); | ||||
| void BKE_pbvh_node_mark_rebuild_draw(PBVHNode *node); | void BKE_pbvh_node_mark_rebuild_draw(PBVHNode *node); | ||||
| void BKE_pbvh_node_mark_redraw(PBVHNode *node); | void BKE_pbvh_node_mark_redraw(PBVHNode *node); | ||||
| void BKE_pbvh_node_mark_normals_update(PBVHNode *node); | void BKE_pbvh_node_mark_normals_update(PBVHNode *node); | ||||
| void BKE_pbvh_node_mark_topology_update(PBVHNode *node); | void BKE_pbvh_node_mark_topology_update(PBVHNode *node); | ||||
| void BKE_pbvh_node_fully_hidden_set(PBVHNode *node, int fully_hidden); | void BKE_pbvh_node_fully_hidden_set(PBVHNode *node, int fully_hidden); | ||||
| bool BKE_pbvh_node_fully_hidden_get(PBVHNode *node); | bool BKE_pbvh_node_fully_hidden_get(PBVHNode *node); | ||||
| void BKE_pbvh_node_fully_masked_set(PBVHNode *node, int fully_masked); | void BKE_pbvh_node_fully_masked_set(PBVHNode *node, int fully_masked); | ||||
| Show All 16 Lines | void BKE_pbvh_node_get_verts(PBVH *pbvh, | ||||
| PBVHNode *node, | PBVHNode *node, | ||||
| const int **r_vert_indices, | const int **r_vert_indices, | ||||
| struct MVert **r_verts); | struct MVert **r_verts); | ||||
| void BKE_pbvh_node_get_loops(PBVH *pbvh, | void BKE_pbvh_node_get_loops(PBVH *pbvh, | ||||
| PBVHNode *node, | PBVHNode *node, | ||||
| const int **r_loop_indices, | const int **r_loop_indices, | ||||
| const struct MLoop **r_loops); | const struct MLoop **r_loops); | ||||
| /* Get number of faces in the mesh; for PBVH_GRIDS the | |||||
| * number of base mesh faces is returned. | |||||
| */ | |||||
| int BKE_pbvh_num_faces(const PBVH *pbvh); | |||||
| void BKE_pbvh_node_get_BB(PBVHNode *node, float bb_min[3], float bb_max[3]); | void BKE_pbvh_node_get_BB(PBVHNode *node, float bb_min[3], float bb_max[3]); | ||||
| void BKE_pbvh_node_get_original_BB(PBVHNode *node, float bb_min[3], float bb_max[3]); | void BKE_pbvh_node_get_original_BB(PBVHNode *node, float bb_min[3], float bb_max[3]); | ||||
| float BKE_pbvh_node_get_tmin(PBVHNode *node); | float BKE_pbvh_node_get_tmin(PBVHNode *node); | ||||
| /** | /** | ||||
| * Test if AABB is at least partially inside the #PBVHFrustumPlanes volume. | * Test if AABB is at least partially inside the #PBVHFrustumPlanes volume. | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 183 Lines • ▼ Show 20 Lines | for (vi.gy = 0; vi.gy < vi.height; vi.gy++) { \ | ||||
| } | } | ||||
| #define BKE_pbvh_vertex_iter_end \ | #define BKE_pbvh_vertex_iter_end \ | ||||
| } \ | } \ | ||||
| } \ | } \ | ||||
| } \ | } \ | ||||
| ((void)0) | ((void)0) | ||||
| #define PBVH_FACE_ITER_VERTS_RESERVED 8 | |||||
| typedef struct PBVHFaceIter { | |||||
| PBVHFaceRef face; | |||||
| int index; | |||||
| bool *hide; | |||||
| int *face_set; | |||||
| int i; | |||||
| PBVHVertRef *verts; | |||||
| int verts_num; | |||||
| /* Private. */ | |||||
| #ifdef __cplusplus | |||||
| private: | |||||
| #endif | |||||
| PBVHVertRef verts_reserved_[PBVH_FACE_ITER_VERTS_RESERVED]; | |||||
| const PBVHNode *node_; | |||||
| PBVHType pbvh_type_; | |||||
| int verts_size_; | |||||
| GSetIterator bm_faces_iter_; | |||||
| int cd_hide_poly_, cd_face_set_; | |||||
| bool *hide_poly_; | |||||
| int *face_sets_; | |||||
| const struct MPoly *mpoly_; | |||||
| const struct MLoopTri *looptri_; | |||||
| const struct MLoop *mloop_; | |||||
| int prim_index_; | |||||
| const struct SubdivCCG *subdiv_ccg_; | |||||
| const struct BMesh *bm; | |||||
| int last_face_index_; | |||||
| } PBVHFaceIter; | |||||
| void BKE_pbvh_face_iter_init(PBVH *pbvh, PBVHNode *node, PBVHFaceIter *fd); | |||||
| void BKE_pbvh_face_iter_step(PBVHFaceIter *fd); | |||||
| bool BKE_pbvh_face_iter_done(PBVHFaceIter *fd); | |||||
| void BKE_pbvh_face_iter_finish(PBVHFaceIter *fd); | |||||
| /** Iterate over faces inside a PBVHNode. These are either base mesh faces | |||||
| * (for PBVH_FACES and PBVH_GRIDS) or BMesh faces (for PBVH_BMESH). | |||||
| */ | |||||
| #define BKE_pbvh_face_iter_begin(pbvh, node, fd) \ | |||||
| BKE_pbvh_face_iter_init(pbvh, node, &fd); \ | |||||
| for (; !BKE_pbvh_face_iter_done(&fd); BKE_pbvh_face_iter_step(&fd)) { | |||||
| #define BKE_pbvh_face_iter_end(fd) \ | |||||
| } \ | |||||
| BKE_pbvh_face_iter_finish(&fd) | |||||
| void BKE_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count); | void BKE_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count); | ||||
| void BKE_pbvh_node_free_proxies(PBVHNode *node); | void BKE_pbvh_node_free_proxies(PBVHNode *node); | ||||
| PBVHProxyNode *BKE_pbvh_node_add_proxy(PBVH *pbvh, PBVHNode *node); | PBVHProxyNode *BKE_pbvh_node_add_proxy(PBVH *pbvh, PBVHNode *node); | ||||
| void BKE_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***r_array, int *r_tot); | void BKE_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***r_array, int *r_tot); | ||||
| void BKE_pbvh_node_get_bm_orco_data(PBVHNode *node, | void BKE_pbvh_node_get_bm_orco_data(PBVHNode *node, | ||||
| int (**r_orco_tris)[3], | int (**r_orco_tris)[3], | ||||
| int *r_orco_tris_num, | int *r_orco_tris_num, | ||||
| float (**r_orco_coords)[3], | float (**r_orco_coords)[3], | ||||
| ▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines | |||||