22 # define ERRMSG(format, args...) \
24 fprintf(stderr, "%s: " format ", " AT "\n", __func__, ##args); \
29 # define ERRMSG(format, ...) \
31 fprintf(stderr, "%s: " format ", " AT "\n", __func__, __VA_ARGS__); \
50 fprintf(stderr,
"\n");
51 ERRMSG(
"This is a debugging function and not intended for general use, running slow test!");
60 ERRMSG(
"vert %d: is hidden and selected", i);
93 ERRMSG(
"edge %d: is hidden and selected", i);
102 l_iter = l_first =
e->l;
105 if (l_iter->
e !=
e) {
106 ERRMSG(
"edge %d: has invalid loop, loop is of face %d", i,
BM_elem_index_get(l_iter->
f));
109 ERRMSG(
"edge %d: has invalid loop with vert not in edge, loop is of face %d",
114 ERRMSG(
"edge %d: has invalid loop with next vert not in edge, loop is of face %d",
118 }
while ((l_iter = l_iter->
radial_next) != l_first);
129 ERRMSG(
"face %d: is hidden and selected", i);
138 }
while ((l_iter = l_iter->
next) != l_first);
145 ERRMSG(
"face %d: has duplicate loop at corner: %d", i, j);
149 "face %d: has duplicate vert: %d, at corner: %d", i,
BM_elem_index_get(l_iter->
v), j);
153 "face %d: has duplicate edge: %d, at corner: %d", i,
BM_elem_index_get(l_iter->
e), j);
157 if (l_iter->
f != f) {
158 ERRMSG(
"face %d: has loop that points to face: %d at corner: %d",
164 ERRMSG(
"face %d: has invalid 'prev/next' at corner: %d", i, j);
167 ERRMSG(
"face %d: has invalid 'next/prev' at corner: %d", i, j);
170 ERRMSG(
"face %d: has invalid 'radial_prev/radial_next' at corner: %d", i, j);
173 ERRMSG(
"face %d: has invalid 'radial_next/radial_prev' at corner: %d", i, j);
180 }
while ((l_iter = l_iter->
next) != l_first);
183 ERRMSG(
"face %d: has length of %d but should be %d", i, f->
len, j);
191 }
while ((l_iter = l_iter->
next) != l_first);
196 const bool is_valid = (errtot == 0);
197 ERRMSG(
"Finished - errors %d", errtot);
void BLI_edgehash_free(EdgeHash *eh, EdgeHashFreeFP free_value)
bool BLI_edgehash_ensure_p(EdgeHash *eh, unsigned int v0, unsigned int v1, void ***r_val) ATTR_WARN_UNUSED_RESULT
EdgeHash * BLI_edgehash_new_ex(const char *info, unsigned int nentries_reserve)
#define BM_FACE_FIRST_LOOP(p)
#define BM_elem_index_get(ele)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
void BM_mesh_elem_index_ensure(BMesh *bm, const char htype)
bool BM_mesh_validate(BMesh *bm)
BLI_INLINE bool BM_vert_in_edge(const BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMVert * v
struct BMLoop * radial_prev
struct BMLoop * radial_next