25# define ERRMSG(format, args...) \
27 fprintf(stderr, "%s: " format ", " AT "\n", __func__, ##args); \
31# elif defined(_MSVC_TRADITIONAL) && !_MSVC_TRADITIONAL
32# define ERRMSG(format, ...) \
34 fprintf(stderr, "%s: " format ", " AT "\n", __func__, ##__VA_ARGS__); \
39# define ERRMSG(format, ...) \
41 fprintf(stderr, "%s: " format ", " AT "\n", __func__, __VA_ARGS__); \
51 for (
const BMVert *vert : value) {
72 fprintf(stderr,
"\n");
73 ERRMSG(
"This is a debugging function and not intended for general use, running slow test!");
82 ERRMSG(
"vert %d: is hidden and selected", i);
101 [&](
BMEdge **value) { *value =
e; },
111 ERRMSG(
"edge %d: is hidden and selected", i);
120 l_iter = l_first =
e->l;
123 if (l_iter->
e !=
e) {
127 ERRMSG(
"edge %d: has invalid loop with vert not in edge, loop is of face %d",
132 ERRMSG(
"edge %d: has invalid loop with next vert not in edge, loop is of face %d",
136 }
while ((l_iter = l_iter->
radial_next) != l_first);
148 ERRMSG(
"face %d: is hidden and selected", i);
157 }
while ((l_iter = l_iter->
next) != l_first);
166 ERRMSG(
"face %d: has duplicate loop at corner: %d", i, j);
170 "face %d: has duplicate vert: %d, at corner: %d", i,
BM_elem_index_get(l_iter->
v), j);
174 "face %d: has duplicate edge: %d, at corner: %d", i,
BM_elem_index_get(l_iter->
e), j);
178 if (l_iter->
f != f) {
179 ERRMSG(
"face %d: has loop that points to face: %d at corner: %d",
185 ERRMSG(
"face %d: has invalid 'prev/next' at corner: %d", i, j);
188 ERRMSG(
"face %d: has invalid 'next/prev' at corner: %d", i, j);
191 ERRMSG(
"face %d: has invalid 'radial_prev/radial_next' at corner: %d", i, j);
194 ERRMSG(
"face %d: has invalid 'radial_next/radial_prev' at corner: %d", i, j);
201 face_verts.
add(l_iter->
v);
204 }
while ((l_iter = l_iter->
next) != l_first);
207 std::move(face_verts),
208 [&](
int *value) { *value = i; },
209 [&](
int *value) {
ERRMSG(
"face %d: duplicate of %d", i, *value); });
212 ERRMSG(
"face %d: has length of %d but should be %d", i, f->
len, j);
220 }
while ((l_iter = l_iter->
next) != l_first);
223 const bool is_valid = (errtot == 0);
224 ERRMSG(
"Finished - errors %d", errtot);
#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)
#define ERRMSG(format,...)
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
auto add_or_modify(const Key &key, const CreateValueF &create_value, const ModifyValueF &modify_value) -> decltype(create_value(nullptr))
uint64_t get_default_hash(const T &v)
unsigned __int64 uint64_t
struct BMLoop * radial_prev
struct BMLoop * radial_next
uint64_t operator()(const blender::Set< const BMVert * > &value) const