Cleanup: Make mesh function static

This commit is contained in:
Hans Goudey
2023-03-12 17:35:50 -04:00
parent 03fffc08b6
commit cbc73a1e05
3 changed files with 17 additions and 22 deletions

View File

@@ -25,7 +25,6 @@ struct BoundBox;
struct CustomData;
struct CustomData_MeshMasks;
struct Depsgraph;
struct EdgeHash;
struct ID;
struct KeyBlock;
struct LinkNode;
@@ -568,10 +567,6 @@ float BKE_mesh_calc_poly_area(const struct MLoop *poly_loops,
int verts_num);
float BKE_mesh_calc_area(const struct Mesh *me);
void BKE_mesh_poly_edgehash_insert(struct EdgeHash *ehash,
const struct MPoly *poly,
const struct MLoop *mloop);
bool BKE_mesh_center_median(const struct Mesh *me, float r_cent[3]);
/**
* Calculate the center from polygons,

View File

@@ -76,6 +76,22 @@ using blender::StringRefNull;
static CLG_LogRef LOG = {"bke.mesh_convert"};
static void poly_edgehash_insert(EdgeHash *ehash, const MPoly *poly, const MLoop *mloop)
{
const MLoop *ml, *ml_next;
int i = poly->totloop;
ml_next = mloop; /* first loop */
ml = &ml_next[i - 1]; /* last loop */
while (i-- != 0) {
BLI_edgehash_reinsert(ehash, ml->v, ml_next->v, nullptr);
ml = ml_next;
ml_next++;
}
}
/**
* Specialized function to use when we _know_ existing edges don't overlap with poly edges.
*/
@@ -90,7 +106,7 @@ static void make_edges_mdata_extend(Mesh &mesh)
EdgeHash *eh = BLI_edgehash_new_ex(__func__, eh_reserve);
for (const MPoly &poly : polys) {
BKE_mesh_poly_edgehash_insert(eh, &poly, &loops[poly.loopstart]);
poly_edgehash_insert(eh, &poly, &loops[poly.loopstart]);
}
const int totedge_new = BLI_edgehash_len(eh);

View File

@@ -263,22 +263,6 @@ void poly_angles_calc(const Span<float3> vert_positions,
} // namespace blender::bke::mesh
void BKE_mesh_poly_edgehash_insert(EdgeHash *ehash, const MPoly *poly, const MLoop *mloop)
{
const MLoop *ml, *ml_next;
int i = poly->totloop;
ml_next = mloop; /* first loop */
ml = &ml_next[i - 1]; /* last loop */
while (i-- != 0) {
BLI_edgehash_reinsert(ehash, ml->v, ml_next->v, nullptr);
ml = ml_next;
ml_next++;
}
}
/** \} */
/* -------------------------------------------------------------------- */