diff options
author | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-12-30 22:31:31 +0400 |
---|---|---|
committer | Nicholas Bishop <nicholasbishop@gmail.com> | 2012-12-30 22:31:31 +0400 |
commit | 22c02c9d3aa589fcedf58e4d7ff4a5c20a18443c (patch) | |
tree | 8b5d74689fe6c2ff3059e71ba0187c124651b5e2 /source/blender/blenkernel/intern | |
parent | 21d79cf7691b53265d15efd3f061740611415d45 (diff) |
Code cleanup: rename BLI_pbvh to BKE_pbvh
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/cdderivedmesh.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/multires.c | 4 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pbvh.c | 146 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/pbvh_bmesh.c | 18 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/subsurf_ccg.c | 14 |
6 files changed, 104 insertions, 104 deletions
diff --git a/source/blender/blenkernel/intern/cdderivedmesh.c b/source/blender/blenkernel/intern/cdderivedmesh.c index 3d4cb7b4745..5f747827ba7 100644 --- a/source/blender/blenkernel/intern/cdderivedmesh.c +++ b/source/blender/blenkernel/intern/cdderivedmesh.c @@ -264,10 +264,10 @@ static PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm) /* Sculpting on a BMesh (dynamic-topology) gets a special PBVH */ if (!cddm->pbvh && ob->sculpt->bm) { - cddm->pbvh = BLI_pbvh_new(); + cddm->pbvh = BKE_pbvh_new(); cddm->pbvh_draw = TRUE; - BLI_pbvh_build_bmesh(cddm->pbvh, ob->sculpt->bm, + BKE_pbvh_build_bmesh(cddm->pbvh, ob->sculpt->bm, ob->sculpt->bm_smooth_shading, ob->sculpt->bm_log); } @@ -281,14 +281,14 @@ static PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm) Mesh *me = ob->data; int deformed = 0; - cddm->pbvh = BLI_pbvh_new(); + cddm->pbvh = BKE_pbvh_new(); cddm->pbvh_draw = can_pbvh_draw(ob, dm); pbvh_show_diffuse_color_set(cddm->pbvh, ob->sculpt->show_diffuse_color); BKE_mesh_tessface_ensure(me); - BLI_pbvh_build_mesh(cddm->pbvh, me->mface, me->mvert, + BKE_pbvh_build_mesh(cddm->pbvh, me->mface, me->mvert, me->totface, me->totvert, &me->vdata); deformed = ss->modifiers_active || me->key; @@ -301,7 +301,7 @@ static PBVH *cdDM_getPBVH(Object *ob, DerivedMesh *dm) totvert = deformdm->getNumVerts(deformdm); vertCos = MEM_callocN(3 * totvert * sizeof(float), "cdDM_getPBVH vertCos"); deformdm->getVertCos(deformdm, vertCos); - BLI_pbvh_apply_vertCos(cddm->pbvh, vertCos); + BKE_pbvh_apply_vertCos(cddm->pbvh, vertCos); MEM_freeN(vertCos); } } @@ -321,7 +321,7 @@ static void cdDM_update_normals_from_pbvh(DerivedMesh *dm) face_nors = CustomData_get_layer(&dm->faceData, CD_NORMAL); - BLI_pbvh_update(cddm->pbvh, PBVH_UpdateNormals, face_nors); + BKE_pbvh_update(cddm->pbvh, PBVH_UpdateNormals, face_nors); } static void cdDM_drawVerts(DerivedMesh *dm) @@ -427,9 +427,9 @@ static void cdDM_drawEdges(DerivedMesh *dm, int drawLooseEdges, int drawAllEdges int i; if (cddm->pbvh && cddm->pbvh_draw && - BLI_pbvh_type(cddm->pbvh) == PBVH_BMESH) + BKE_pbvh_type(cddm->pbvh) == PBVH_BMESH) { - BLI_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, TRUE); + BKE_pbvh_draw(cddm->pbvh, NULL, NULL, NULL, TRUE); return; } @@ -549,7 +549,7 @@ static void cdDM_drawFacesSolid(DerivedMesh *dm, if (dm->numTessFaceData) { float (*face_nors)[3] = CustomData_get_layer(&dm->faceData, CD_NORMAL); - BLI_pbvh_draw(cddm->pbvh, partial_redraw_planes, face_nors, + BKE_pbvh_draw(cddm->pbvh, partial_redraw_planes, face_nors, setMaterial, FALSE); glShadeModel(GL_FLAT); } diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c index 06d7cf55d49..b12463daf72 100644 --- a/source/blender/blenkernel/intern/multires.c +++ b/source/blender/blenkernel/intern/multires.c @@ -379,7 +379,7 @@ void multires_force_update(Object *ob) ob->derivedFinal = NULL; } if (ob->sculpt && ob->sculpt->pbvh) { - BLI_pbvh_free(ob->sculpt->pbvh); + BKE_pbvh_free(ob->sculpt->pbvh); ob->sculpt->pbvh = NULL; } } @@ -1407,7 +1407,7 @@ void multires_stitch_grids(Object *ob) int totface; if (ccgdm->pbvh) { - BLI_pbvh_get_grid_updates(ccgdm->pbvh, 0, (void ***)&faces, &totface); + BKE_pbvh_get_grid_updates(ccgdm->pbvh, 0, (void ***)&faces, &totface); if (totface) { ccgSubSurf_stitchFaces(ccgdm->ss, 0, faces, totface); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 92b2c8231d3..5914cbfc522 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -298,7 +298,7 @@ void free_sculptsession(Object *ob) } if (ss->pbvh) - BLI_pbvh_free(ss->pbvh); + BKE_pbvh_free(ss->pbvh); if (ss->bm_log) BM_log_free(ss->bm_log); @@ -2815,7 +2815,7 @@ void BKE_object_sculpt_modifiers_changed(Object *ob) * changing PVBH node organization, we hope topology does not change in * the meantime .. weak */ if (ss->pbvh) { - BLI_pbvh_free(ss->pbvh); + BKE_pbvh_free(ss->pbvh); ss->pbvh = NULL; } @@ -2825,10 +2825,10 @@ void BKE_object_sculpt_modifiers_changed(Object *ob) PBVHNode **nodes; int n, totnode; - BLI_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode); + BKE_pbvh_search_gather(ss->pbvh, NULL, NULL, &nodes, &totnode); for (n = 0; n < totnode; n++) - BLI_pbvh_node_mark_update(nodes[n]); + BKE_pbvh_node_mark_update(nodes[n]); MEM_freeN(nodes); } diff --git a/source/blender/blenkernel/intern/pbvh.c b/source/blender/blenkernel/intern/pbvh.c index 1b6a544339d..2df2dd631d5 100644 --- a/source/blender/blenkernel/intern/pbvh.c +++ b/source/blender/blenkernel/intern/pbvh.c @@ -56,7 +56,7 @@ typedef struct PBVHStack { typedef struct PBVHIter { PBVH *bvh; - BLI_pbvh_SearchCallback scb; + BKE_pbvh_SearchCallback scb; void *search_data; PBVHStack *stack; @@ -132,11 +132,11 @@ static void update_node_vb(PBVH *bvh, PBVHNode *node) if (node->flag & PBVH_Leaf) { PBVHVertexIter vd; - BLI_pbvh_vertex_iter_begin(bvh, node, vd, PBVH_ITER_ALL) + BKE_pbvh_vertex_iter_begin(bvh, node, vd, PBVH_ITER_ALL) { BB_expand(&vb, vd.co); } - BLI_pbvh_vertex_iter_end; + BKE_pbvh_vertex_iter_end; } else { BB_expand_with_bb(&vb, @@ -148,12 +148,12 @@ static void update_node_vb(PBVH *bvh, PBVHNode *node) node->vb = vb; } -//void BLI_pbvh_node_BB_reset(PBVHNode *node) +//void BKE_pbvh_node_BB_reset(PBVHNode *node) //{ // BB_reset(&node->vb); //} // -//void BLI_pbvh_node_BB_expand(PBVHNode *node, float co[3]) +//void BKE_pbvh_node_BB_expand(PBVHNode *node, float co[3]) //{ // BB_expand(&node->vb, co); //} @@ -493,7 +493,7 @@ static void pbvh_build(PBVH *bvh, BB *cb, BBC *prim_bbc, int totprim) } /* Do a full rebuild with on Mesh data structure */ -void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int totvert, struct CustomData *vdata) +void BKE_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int totvert, struct CustomData *vdata) { BBC *prim_bbc = NULL; BB cb; @@ -535,7 +535,7 @@ void BLI_pbvh_build_mesh(PBVH *bvh, MFace *faces, MVert *verts, int totface, int } /* Do a full rebuild with on Grids data structure */ -void BLI_pbvh_build_grids(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj, +void BKE_pbvh_build_grids(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj, int totgrid, CCGKey *key, void **gridfaces, DMFlagMat *flagmats, BLI_bitmap *grid_hidden) { BBC *prim_bbc = NULL; @@ -578,14 +578,14 @@ void BLI_pbvh_build_grids(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj, MEM_freeN(prim_bbc); } -PBVH *BLI_pbvh_new(void) +PBVH *BKE_pbvh_new(void) { PBVH *bvh = MEM_callocN(sizeof(PBVH), "pbvh"); return bvh; } -void BLI_pbvh_free(PBVH *bvh) +void BKE_pbvh_free(PBVH *bvh) { PBVHNode *node; int i; @@ -600,7 +600,7 @@ void BLI_pbvh_free(PBVH *bvh) MEM_freeN(node->vert_indices); if (node->face_vert_indices) MEM_freeN(node->face_vert_indices); - BLI_pbvh_node_layer_disp_free(node); + BKE_pbvh_node_layer_disp_free(node); if (node->bm_faces) BLI_ghash_free(node->bm_faces, NULL, NULL); @@ -635,7 +635,7 @@ void BLI_pbvh_free(PBVH *bvh) MEM_freeN(bvh); } -static void pbvh_iter_begin(PBVHIter *iter, PBVH *bvh, BLI_pbvh_SearchCallback scb, void *search_data) +static void pbvh_iter_begin(PBVHIter *iter, PBVH *bvh, BKE_pbvh_SearchCallback scb, void *search_data) { iter->bvh = bvh; iter->scb = scb; @@ -746,8 +746,8 @@ static PBVHNode *pbvh_iter_next_occluded(PBVHIter *iter) return NULL; } -void BLI_pbvh_search_gather(PBVH *bvh, - BLI_pbvh_SearchCallback scb, void *search_data, +void BKE_pbvh_search_gather(PBVH *bvh, + BKE_pbvh_SearchCallback scb, void *search_data, PBVHNode ***r_array, int *r_tot) { PBVHIter iter; @@ -787,9 +787,9 @@ void BLI_pbvh_search_gather(PBVH *bvh, *r_tot = tot; } -void BLI_pbvh_search_callback(PBVH *bvh, - BLI_pbvh_SearchCallback scb, void *search_data, - BLI_pbvh_HitCallback hcb, void *hit_data) +void BKE_pbvh_search_callback(PBVH *bvh, + BKE_pbvh_SearchCallback scb, void *search_data, + BKE_pbvh_HitCallback hcb, void *hit_data) { PBVHIter iter; PBVHNode *node; @@ -830,7 +830,7 @@ static void node_tree_insert(node_tree *tree, node_tree *new_node) } } -static void traverse_tree(node_tree *tree, BLI_pbvh_HitOccludedCallback hcb, void *hit_data, float *tmin) +static void traverse_tree(node_tree *tree, BKE_pbvh_HitOccludedCallback hcb, void *hit_data, float *tmin) { if (tree->left) traverse_tree(tree->left, hcb, hit_data, tmin); @@ -854,14 +854,14 @@ static void free_tree(node_tree *tree) free(tree); } -float BLI_pbvh_node_get_tmin(PBVHNode *node) +float BKE_pbvh_node_get_tmin(PBVHNode *node) { return node->tmin; } -static void BLI_pbvh_search_callback_occluded(PBVH *bvh, - BLI_pbvh_SearchCallback scb, void *search_data, - BLI_pbvh_HitOccludedCallback hcb, void *hit_data) +static void BKE_pbvh_search_callback_occluded(PBVH *bvh, + BKE_pbvh_SearchCallback scb, void *search_data, + BKE_pbvh_HitOccludedCallback hcb, void *hit_data) { PBVHIter iter; PBVHNode *node; @@ -1134,7 +1134,7 @@ static int pbvh_flush_bb(PBVH *bvh, PBVHNode *node, int flag) return update; } -void BLI_pbvh_update(PBVH *bvh, int flag, float (*face_nors)[3]) +void BKE_pbvh_update(PBVH *bvh, int flag, float (*face_nors)[3]) { PBVHNode **nodes; int totnode; @@ -1142,7 +1142,7 @@ void BLI_pbvh_update(PBVH *bvh, int flag, float (*face_nors)[3]) if (!bvh->nodes) return; - BLI_pbvh_search_gather(bvh, update_search_cb, SET_INT_IN_POINTER(flag), + BKE_pbvh_search_gather(bvh, update_search_cb, SET_INT_IN_POINTER(flag), &nodes, &totnode); if (flag & PBVH_UpdateNormals) @@ -1157,7 +1157,7 @@ void BLI_pbvh_update(PBVH *bvh, int flag, float (*face_nors)[3]) if (nodes) MEM_freeN(nodes); } -void BLI_pbvh_redraw_BB(PBVH *bvh, float bb_min[3], float bb_max[3]) +void BKE_pbvh_redraw_BB(PBVH *bvh, float bb_min[3], float bb_max[3]) { PBVHIter iter; PBVHNode *node; @@ -1177,7 +1177,7 @@ void BLI_pbvh_redraw_BB(PBVH *bvh, float bb_min[3], float bb_max[3]) copy_v3_v3(bb_max, bb.bmax); } -void BLI_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *totface) +void BKE_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *totface) { PBVHIter iter; PBVHNode *node; @@ -1233,24 +1233,24 @@ void BLI_pbvh_get_grid_updates(PBVH *bvh, int clear, void ***gridfaces, int *tot /***************************** PBVH Access ***********************************/ -PBVHType BLI_pbvh_type(const PBVH *bvh) +PBVHType BKE_pbvh_type(const PBVH *bvh) { return bvh->type; } -BLI_bitmap *BLI_pbvh_grid_hidden(const PBVH *bvh) +BLI_bitmap *BKE_pbvh_grid_hidden(const PBVH *bvh) { BLI_assert(bvh->type == PBVH_GRIDS); return bvh->grid_hidden; } -void BLI_pbvh_get_grid_key(const PBVH *bvh, CCGKey *key) +void BKE_pbvh_get_grid_key(const PBVH *bvh, CCGKey *key) { BLI_assert(bvh->type == PBVH_GRIDS); *key = bvh->gridkey; } -BMesh *BLI_pbvh_get_bmesh(PBVH *bvh) +BMesh *BKE_pbvh_get_bmesh(PBVH *bvh) { BLI_assert(bvh->type == PBVH_BMESH); return bvh->bm; @@ -1258,17 +1258,17 @@ BMesh *BLI_pbvh_get_bmesh(PBVH *bvh) /***************************** Node Access ***********************************/ -void BLI_pbvh_node_mark_update(PBVHNode *node) +void BKE_pbvh_node_mark_update(PBVHNode *node) { node->flag |= PBVH_UpdateNormals | PBVH_UpdateBB | PBVH_UpdateOriginalBB | PBVH_UpdateDrawBuffers | PBVH_UpdateRedraw; } -void BLI_pbvh_node_mark_rebuild_draw(PBVHNode *node) +void BKE_pbvh_node_mark_rebuild_draw(PBVHNode *node) { node->flag |= PBVH_RebuildDrawBuffers | PBVH_UpdateDrawBuffers | PBVH_UpdateRedraw; } -void BLI_pbvh_node_fully_hidden_set(PBVHNode *node, int fully_hidden) +void BKE_pbvh_node_fully_hidden_set(PBVHNode *node, int fully_hidden) { BLI_assert(node->flag & PBVH_Leaf); @@ -1278,13 +1278,13 @@ void BLI_pbvh_node_fully_hidden_set(PBVHNode *node, int fully_hidden) node->flag &= ~PBVH_FullyHidden; } -void BLI_pbvh_node_get_verts(PBVH *bvh, PBVHNode *node, int **vert_indices, MVert **verts) +void BKE_pbvh_node_get_verts(PBVH *bvh, PBVHNode *node, int **vert_indices, MVert **verts) { if (vert_indices) *vert_indices = node->vert_indices; if (verts) *verts = bvh->verts; } -void BLI_pbvh_node_num_verts(PBVH *bvh, PBVHNode *node, int *uniquevert, int *totvert) +void BKE_pbvh_node_num_verts(PBVH *bvh, PBVHNode *node, int *uniquevert, int *totvert) { int tot; @@ -1306,7 +1306,7 @@ void BLI_pbvh_node_num_verts(PBVH *bvh, PBVHNode *node, int *uniquevert, int *to } } -void BLI_pbvh_node_get_grids(PBVH *bvh, PBVHNode *node, int **grid_indices, int *totgrid, int *maxgrid, int *gridsize, CCGElem ***griddata, DMGridAdjacency **gridadj) +void BKE_pbvh_node_get_grids(PBVH *bvh, PBVHNode *node, int **grid_indices, int *totgrid, int *maxgrid, int *gridsize, CCGElem ***griddata, DMGridAdjacency **gridadj) { switch (bvh->type) { case PBVH_GRIDS: @@ -1329,19 +1329,19 @@ void BLI_pbvh_node_get_grids(PBVH *bvh, PBVHNode *node, int **grid_indices, int } } -void BLI_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]) { copy_v3_v3(bb_min, node->vb.bmin); copy_v3_v3(bb_max, node->vb.bmax); } -void BLI_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]) { copy_v3_v3(bb_min, node->orig_vb.bmin); copy_v3_v3(bb_max, node->orig_vb.bmax); } -void BLI_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count) +void BKE_pbvh_node_get_proxies(PBVHNode *node, PBVHProxyNode **proxies, int *proxy_count) { if (node->proxy_count > 0) { if (proxies) *proxies = node->proxies; @@ -1366,14 +1366,14 @@ static int ray_aabb_intersect(PBVHNode *node, void *data_v) float bb_min[3], bb_max[3]; if (rcd->original) - BLI_pbvh_node_get_original_BB(node, bb_min, bb_max); + BKE_pbvh_node_get_original_BB(node, bb_min, bb_max); else - BLI_pbvh_node_get_BB(node, bb_min, bb_max); + BKE_pbvh_node_get_BB(node, bb_min, bb_max); return isect_ray_aabb(&rcd->ray, bb_min, bb_max, &node->tmin); } -void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data, +void BKE_pbvh_raycast(PBVH *bvh, BKE_pbvh_HitOccludedCallback cb, void *data, const float ray_start[3], const float ray_normal[3], int original) { @@ -1382,7 +1382,7 @@ void BLI_pbvh_raycast(PBVH *bvh, BLI_pbvh_HitOccludedCallback cb, void *data, isect_ray_aabb_initialize(&rcd.ray, ray_start, ray_normal); rcd.original = original; - BLI_pbvh_search_callback_occluded(bvh, ray_aabb_intersect, &rcd, cb, data); + BKE_pbvh_search_callback_occluded(bvh, ray_aabb_intersect, &rcd, cb, data); } int ray_face_intersection(const float ray_start[3], @@ -1495,7 +1495,7 @@ static int pbvh_grids_node_raycast(PBVH *bvh, PBVHNode *node, return hit; } -int BLI_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3], int use_origco, +int BKE_pbvh_node_raycast(PBVH *bvh, PBVHNode *node, float (*origco)[3], int use_origco, const float ray_start[3], const float ray_normal[3], float *dist) { @@ -1528,7 +1528,7 @@ typedef struct { int wireframe; } PBVHNodeDrawData; -void BLI_pbvh_node_draw(PBVHNode *node, void *data_v) +void BKE_pbvh_node_draw(PBVHNode *node, void *data_v) { PBVHNodeDrawData *data = data_v; @@ -1595,19 +1595,19 @@ static PlaneAABBIsect test_planes_aabb(const float bb_min[3], return ret; } -int BLI_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data) +int BKE_pbvh_node_planes_contain_AABB(PBVHNode *node, void *data) { float bb_min[3], bb_max[3]; - BLI_pbvh_node_get_BB(node, bb_min, bb_max); + BKE_pbvh_node_get_BB(node, bb_min, bb_max); return test_planes_aabb(bb_min, bb_max, data) != ISECT_OUTSIDE; } -int BLI_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data) +int BKE_pbvh_node_planes_exclude_AABB(PBVHNode *node, void *data) { float bb_min[3], bb_max[3]; - BLI_pbvh_node_get_BB(node, bb_min, bb_max); + BKE_pbvh_node_get_BB(node, bb_min, bb_max); return test_planes_aabb(bb_min, bb_max, data) != ISECT_INSIDE; } @@ -1620,7 +1620,7 @@ static void pbvh_node_check_diffuse_changed(PBVH *bvh, PBVHNode *node) node->flag |= PBVH_UpdateDrawBuffers; } -void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], +void BKE_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], DMSetMaterial setMaterial, int wireframe) { PBVHNodeDrawData draw_data = {setMaterial, wireframe}; @@ -1630,7 +1630,7 @@ void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], for (a = 0; a < bvh->totnode; a++) pbvh_node_check_diffuse_changed(bvh, &bvh->nodes[a]); - BLI_pbvh_search_gather(bvh, update_search_cb, SET_INT_IN_POINTER(PBVH_UpdateNormals | PBVH_UpdateDrawBuffers), + BKE_pbvh_search_gather(bvh, update_search_cb, SET_INT_IN_POINTER(PBVH_UpdateNormals | PBVH_UpdateDrawBuffers), &nodes, &totnode); pbvh_update_normals(bvh, nodes, totnode, face_nors); @@ -1639,15 +1639,15 @@ void BLI_pbvh_draw(PBVH *bvh, float (*planes)[4], float (*face_nors)[3], if (nodes) MEM_freeN(nodes); if (planes) { - BLI_pbvh_search_callback(bvh, BLI_pbvh_node_planes_contain_AABB, - planes, BLI_pbvh_node_draw, &draw_data); + BKE_pbvh_search_callback(bvh, BKE_pbvh_node_planes_contain_AABB, + planes, BKE_pbvh_node_draw, &draw_data); } else { - BLI_pbvh_search_callback(bvh, NULL, NULL, BLI_pbvh_node_draw, &draw_data); + BKE_pbvh_search_callback(bvh, NULL, NULL, BKE_pbvh_node_draw, &draw_data); } } -void BLI_pbvh_grids_update(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj, void **gridfaces, +void BKE_pbvh_grids_update(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj, void **gridfaces, DMFlagMat *flagmats, BLI_bitmap *grid_hidden) { int a; @@ -1661,23 +1661,23 @@ void BLI_pbvh_grids_update(PBVH *bvh, CCGElem **grids, DMGridAdjacency *gridadj, bvh->grid_hidden = grid_hidden; for (a = 0; a < bvh->totnode; ++a) - BLI_pbvh_node_mark_rebuild_draw(&bvh->nodes[a]); + BKE_pbvh_node_mark_rebuild_draw(&bvh->nodes[a]); } } /* Get the node's displacement layer, creating it if necessary */ -float *BLI_pbvh_node_layer_disp_get(PBVH *bvh, PBVHNode *node) +float *BKE_pbvh_node_layer_disp_get(PBVH *bvh, PBVHNode *node) { if (!node->layer_disp) { int totvert = 0; - BLI_pbvh_node_num_verts(bvh, node, &totvert, NULL); + BKE_pbvh_node_num_verts(bvh, node, &totvert, NULL); node->layer_disp = MEM_callocN(sizeof(float) * totvert, "layer disp"); } return node->layer_disp; } /* If the node has a displacement layer, free it and set to null */ -void BLI_pbvh_node_layer_disp_free(PBVHNode *node) +void BKE_pbvh_node_layer_disp_free(PBVHNode *node) { if (node->layer_disp) { MEM_freeN(node->layer_disp); @@ -1685,7 +1685,7 @@ void BLI_pbvh_node_layer_disp_free(PBVHNode *node) } } -float (*BLI_pbvh_get_vertCos(PBVH * pbvh))[3] +float (*BKE_pbvh_get_vertCos(PBVH * pbvh))[3] { int a; float (*vertCos)[3] = NULL; @@ -1694,7 +1694,7 @@ float (*BLI_pbvh_get_vertCos(PBVH * pbvh))[3] float *co; MVert *mvert = pbvh->verts; - vertCos = MEM_callocN(3 * pbvh->totvert * sizeof(float), "BLI_pbvh_get_vertCoords"); + vertCos = MEM_callocN(3 * pbvh->totvert * sizeof(float), "BKE_pbvh_get_vertCoords"); co = (float *)vertCos; for (a = 0; a < pbvh->totvert; a++, mvert++, co += 3) { @@ -1705,7 +1705,7 @@ float (*BLI_pbvh_get_vertCos(PBVH * pbvh))[3] return vertCos; } -void BLI_pbvh_apply_vertCos(PBVH *pbvh, float (*vertCos)[3]) +void BKE_pbvh_apply_vertCos(PBVH *pbvh, float (*vertCos)[3]) { int a; @@ -1734,21 +1734,21 @@ void BLI_pbvh_apply_vertCos(PBVH *pbvh, float (*vertCos)[3]) BKE_mesh_calc_normals_tessface(pbvh->verts, pbvh->totvert, pbvh->faces, pbvh->totprim, NULL); for (a = 0; a < pbvh->totnode; ++a) - BLI_pbvh_node_mark_update(&pbvh->nodes[a]); + BKE_pbvh_node_mark_update(&pbvh->nodes[a]); - BLI_pbvh_update(pbvh, PBVH_UpdateBB, NULL); - BLI_pbvh_update(pbvh, PBVH_UpdateOriginalBB, NULL); + BKE_pbvh_update(pbvh, PBVH_UpdateBB, NULL); + BKE_pbvh_update(pbvh, PBVH_UpdateOriginalBB, NULL); } } -int BLI_pbvh_isDeformed(PBVH *pbvh) +int BKE_pbvh_isDeformed(PBVH *pbvh) { return pbvh->deformed; } /* Proxies */ -PBVHProxyNode *BLI_pbvh_node_add_proxy(PBVH *bvh, PBVHNode *node) +PBVHProxyNode *BKE_pbvh_node_add_proxy(PBVH *bvh, PBVHNode *node) { int index, totverts; @@ -1764,14 +1764,14 @@ PBVHProxyNode *BLI_pbvh_node_add_proxy(PBVH *bvh, PBVHNode *node) else node->proxies = MEM_mallocN(sizeof(PBVHProxyNode), "PBVHNodeProxy"); - BLI_pbvh_node_num_verts(bvh, node, &totverts, NULL); + BKE_pbvh_node_num_verts(bvh, node, &totverts, NULL); node->proxies[index].co = MEM_callocN(sizeof(float[3]) * totverts, "PBVHNodeProxy.co"); } return node->proxies + index; } -void BLI_pbvh_node_free_proxies(PBVHNode *node) +void BKE_pbvh_node_free_proxies(PBVHNode *node) { #pragma omp critical { @@ -1789,7 +1789,7 @@ void BLI_pbvh_node_free_proxies(PBVHNode *node) } } -void BLI_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***r_array, int *r_tot) +void BKE_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***r_array, int *r_tot) { PBVHNode **array = NULL, **newarray, *node; int tot = 0, space = 0; @@ -1802,7 +1802,7 @@ void BLI_pbvh_gather_proxies(PBVH *pbvh, PBVHNode ***r_array, int *r_tot) if (tot == space) { /* resize array if needed */ space = (tot == 0) ? 32 : space * 2; - newarray = MEM_callocN(sizeof(PBVHNode) * space, "BLI_pbvh_gather_proxies"); + newarray = MEM_callocN(sizeof(PBVHNode) * space, "BKE_pbvh_gather_proxies"); if (array) { memcpy(newarray, array, sizeof(PBVHNode) * tot); @@ -1839,9 +1839,9 @@ void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, vi->fno = 0; vi->mvert = 0; - BLI_pbvh_node_get_grids(bvh, node, &grid_indices, &totgrid, NULL, &gridsize, &grids, NULL); - BLI_pbvh_node_num_verts(bvh, node, &uniq_verts, &totvert); - BLI_pbvh_node_get_verts(bvh, node, &vert_indices, &verts); + BKE_pbvh_node_get_grids(bvh, node, &grid_indices, &totgrid, NULL, &gridsize, &grids, NULL); + BKE_pbvh_node_num_verts(bvh, node, &uniq_verts, &totvert); + BKE_pbvh_node_get_verts(bvh, node, &vert_indices, &verts); vi->key = &bvh->gridkey; vi->grids = grids; diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c index 9cc8fd09c73..30a032229b7 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.c +++ b/source/blender/blenkernel/intern/pbvh_bmesh.c @@ -999,7 +999,7 @@ void pbvh_bmesh_normals_update(PBVHNode **nodes, int totnode) /***************************** Public API *****************************/ /* Build a PBVH from a BMesh */ -void BLI_pbvh_build_bmesh(PBVH *bvh, BMesh *bm, int smooth_shading, +void BKE_pbvh_build_bmesh(PBVH *bvh, BMesh *bm, int smooth_shading, BMLog *log) { BMIter iter; @@ -1009,7 +1009,7 @@ void BLI_pbvh_build_bmesh(PBVH *bvh, BMesh *bm, int smooth_shading, bvh->bm = bm; - BLI_pbvh_bmesh_detail_size_set(bvh, 0.75); + BKE_pbvh_bmesh_detail_size_set(bvh, 0.75); bvh->type = PBVH_BMESH; bvh->bm_face_to_node = BLI_ghash_ptr_new("bm_face_to_node"); @@ -1038,7 +1038,7 @@ void BLI_pbvh_build_bmesh(PBVH *bvh, BMesh *bm, int smooth_shading, } /* Collapse short edges, subdivide long edges */ -int BLI_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode, +int BKE_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode, const float center[3], float radius) { BLI_buffer_declare(BMFace*, edge_faces, 8); @@ -1085,7 +1085,7 @@ int BLI_pbvh_bmesh_update_topology(PBVH *bvh, PBVHTopologyUpdateMode mode, /* In order to perform operations on the original node coordinates * (such as raycast), store the node's triangles and vertices.*/ -void BLI_pbvh_bmesh_node_save_orig(PBVHNode *node) +void BKE_pbvh_bmesh_node_save_orig(PBVHNode *node) { GHashIterator gh_iter; int i, totvert, tottri; @@ -1134,7 +1134,7 @@ void BLI_pbvh_bmesh_node_save_orig(PBVHNode *node) node->bm_tot_ortri = i; } -void BLI_pbvh_bmesh_after_stroke(PBVH *bvh) +void BKE_pbvh_bmesh_after_stroke(PBVH *bvh) { int i; for (i = 0; i < bvh->totnode; i++) { @@ -1150,23 +1150,23 @@ void BLI_pbvh_bmesh_after_stroke(PBVH *bvh) } } -void BLI_pbvh_bmesh_detail_size_set(PBVH *bvh, float detail_size) +void BKE_pbvh_bmesh_detail_size_set(PBVH *bvh, float detail_size) { bvh->bm_max_edge_len = detail_size; bvh->bm_min_edge_len = bvh->bm_max_edge_len * 0.4; } -void BLI_pbvh_node_mark_topology_update(PBVHNode *node) +void BKE_pbvh_node_mark_topology_update(PBVHNode *node) { node->flag |= PBVH_UpdateTopology; } -GHash *BLI_pbvh_bmesh_node_unique_verts(PBVHNode *node) +GHash *BKE_pbvh_bmesh_node_unique_verts(PBVHNode *node) { return node->bm_unique_verts; } -GHash *BLI_pbvh_bmesh_node_other_verts(PBVHNode *node) +GHash *BKE_pbvh_bmesh_node_other_verts(PBVHNode *node) { return node->bm_other_verts; } diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c index b72499b3b14..12a82ba38d7 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.c +++ b/source/blender/blenkernel/intern/subsurf_ccg.c @@ -1569,7 +1569,7 @@ static void ccgdm_pbvh_update(CCGDerivedMesh *ccgdm) CCGFace **faces; int totface; - BLI_pbvh_get_grid_updates(ccgdm->pbvh, 1, (void ***)&faces, &totface); + BKE_pbvh_get_grid_updates(ccgdm->pbvh, 1, (void ***)&faces, &totface); if (totface) { ccgSubSurf_updateFromFaces(ccgdm->ss, 0, faces, totface); ccgSubSurf_updateNormals(ccgdm->ss, faces, totface); @@ -1707,7 +1707,7 @@ static void ccgDM_drawFacesSolid(DerivedMesh *dm, float (*partial_redraw_planes) if (ccgdm->pbvh && ccgdm->multires.mmd && !fast) { if (dm->numTessFaceData) { - BLI_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL, + BKE_pbvh_draw(ccgdm->pbvh, partial_redraw_planes, NULL, setMaterial, FALSE); glShadeModel(GL_FLAT); } @@ -3026,7 +3026,7 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm) * when the ccgdm gets remade, the assumption is that the topology * does not change. */ ccgdm_create_grids(dm); - BLI_pbvh_grids_update(ob->sculpt->pbvh, ccgdm->gridData, ccgdm->gridAdjacency, (void **)ccgdm->gridFaces, + BKE_pbvh_grids_update(ob->sculpt->pbvh, ccgdm->gridData, ccgdm->gridAdjacency, (void **)ccgdm->gridFaces, ccgdm->gridFlagMats, ccgdm->gridHidden); } @@ -3044,15 +3044,15 @@ static struct PBVH *ccgDM_getPBVH(Object *ob, DerivedMesh *dm) numGrids = ccgDM_getNumGrids(dm); - ob->sculpt->pbvh = ccgdm->pbvh = BLI_pbvh_new(); - BLI_pbvh_build_grids(ccgdm->pbvh, ccgdm->gridData, ccgdm->gridAdjacency, + ob->sculpt->pbvh = ccgdm->pbvh = BKE_pbvh_new(); + BKE_pbvh_build_grids(ccgdm->pbvh, ccgdm->gridData, ccgdm->gridAdjacency, numGrids, &key, (void **) ccgdm->gridFaces, ccgdm->gridFlagMats, ccgdm->gridHidden); } else if (ob->type == OB_MESH) { Mesh *me = ob->data; - ob->sculpt->pbvh = ccgdm->pbvh = BLI_pbvh_new(); + ob->sculpt->pbvh = ccgdm->pbvh = BKE_pbvh_new(); BLI_assert(!(me->mface == NULL && me->mpoly != NULL)); /* BMESH ONLY complain if mpoly is valid but not mface */ - BLI_pbvh_build_mesh(ccgdm->pbvh, me->mface, me->mvert, + BKE_pbvh_build_mesh(ccgdm->pbvh, me->mface, me->mvert, me->totface, me->totvert, &me->vdata); } |