Cleanup: Use const pbvh node pointers for some accessor functions

This commit is contained in:
Hans Goudey
2023-10-12 14:51:46 +02:00
parent 9ab290e1b3
commit de47c2a8b4
2 changed files with 12 additions and 6 deletions

View File

@@ -403,9 +403,12 @@ void BKE_pbvh_node_get_grids(PBVH *pbvh,
int *maxgrid,
int *gridsize,
CCGElem ***r_griddata);
void BKE_pbvh_node_num_verts(PBVH *pbvh, PBVHNode *node, int *r_uniquevert, int *r_totvert);
blender::Span<int> BKE_pbvh_node_get_vert_indices(PBVHNode *node);
blender::Span<int> BKE_pbvh_node_get_unique_vert_indices(PBVHNode *node);
void BKE_pbvh_node_num_verts(const PBVH *pbvh,
const PBVHNode *node,
int *r_uniquevert,
int *r_totvert);
blender::Span<int> BKE_pbvh_node_get_vert_indices(const PBVHNode *node);
blender::Span<int> BKE_pbvh_node_get_unique_vert_indices(const PBVHNode *node);
void BKE_pbvh_node_get_loops(PBVH *pbvh,
PBVHNode *node,
const int **r_loop_indices,

View File

@@ -1958,17 +1958,20 @@ int BKE_pbvh_num_faces(const PBVH *pbvh)
return 0;
}
blender::Span<int> BKE_pbvh_node_get_vert_indices(PBVHNode *node)
blender::Span<int> BKE_pbvh_node_get_vert_indices(const PBVHNode *node)
{
return node->vert_indices;
}
blender::Span<int> BKE_pbvh_node_get_unique_vert_indices(PBVHNode *node)
blender::Span<int> BKE_pbvh_node_get_unique_vert_indices(const PBVHNode *node)
{
return node->vert_indices.as_span().take_front(node->uniq_verts);
}
void BKE_pbvh_node_num_verts(PBVH *pbvh, PBVHNode *node, int *r_uniquevert, int *r_totvert)
void BKE_pbvh_node_num_verts(const PBVH *pbvh,
const PBVHNode *node,
int *r_uniquevert,
int *r_totvert)
{
int tot;