diff options
Diffstat (limited to 'source/blender/blenlib/BLI_pbvh.h')
-rw-r--r-- | source/blender/blenlib/BLI_pbvh.h | 31 |
1 files changed, 4 insertions, 27 deletions
diff --git a/source/blender/blenlib/BLI_pbvh.h b/source/blender/blenlib/BLI_pbvh.h index ef32ec03a61..e7dc5c4b065 100644 --- a/source/blender/blenlib/BLI_pbvh.h +++ b/source/blender/blenlib/BLI_pbvh.h @@ -171,34 +171,11 @@ typedef struct PBVHVertexIter { #pragma warning (disable:4127) // conditional expression is constant #endif +void pbvh_vertex_iter_init(PBVH *bvh, PBVHNode *node, + PBVHVertexIter *vi, int mode); + #define BLI_pbvh_vertex_iter_begin(bvh, node, vi, mode) \ - { \ - struct DMGridData **grids; \ - struct MVert *verts; \ - int *grid_indices, totgrid, gridsize, *vert_indices, uniq_verts, totvert; \ - \ - vi.grid= 0; \ - vi.no= 0; \ - vi.fno= 0; \ - vi.mvert= 0; \ - vi.skip= 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); \ - \ - vi.grids= grids; \ - vi.grid_indices= grid_indices; \ - vi.totgrid= (grids)? totgrid: 1; \ - vi.gridsize= gridsize; \ - \ - if(mode == PBVH_ITER_ALL) \ - vi.totvert = totvert; \ - else \ - vi.totvert= uniq_verts; \ - vi.vert_indices= vert_indices; \ - vi.mverts= verts; \ - }\ + pbvh_vertex_iter_init(bvh, node, &vi, mode); \ \ for(vi.i=0, vi.g=0; vi.g<vi.totgrid; vi.g++) { \ if(vi.grids) { \ |