90 if (tc->custom.mode.data) {
94 BLI_assert_msg(0,
"Should never happen, at least one EdgeSlideData should be valid");
132 float p[3],
const float v1[3],
const float v2[3],
const float v3[3],
float t)
134 float t_mid, t_delta;
140 if (t_delta < 0.0f) {
150 t_mid = 1.0f - t_mid;
171 float dist = FLT_MAX;
180 if ((fac > -FLT_EPSILON) && (fac < 1.0f + FLT_EPSILON)) {
192 }
while ((l_iter = l_iter->
next) != l_last);
208 float vec_accum[3] = {0.0f, 0.0f, 0.0f};
209 float vec_accum_len = 0.0f;
219 if (
l->
e == e_next) {
230 if (l_tmp->
f->
len == 4) {
301 rv3d =
t->region ?
t->region->regiondata :
NULL;
315 float projectMat[4][4],
343 mval_dir[1] = 100.0f;
346 float mval_start[2], mval_end[2];
371 const bool use_occlude_geometry,
372 const bool use_calc_direction)
378 float projectMat[4][4];
384 float mval_dir[3], dist_best_sq;
388 v3d =
t->area ?
t->area->spacedata.first :
NULL;
393 if (use_occlude_geometry) {
403 dist_best_sq = -1.0f;
405 if (use_calc_direction) {
406 loop_dir =
MEM_callocN(
sizeof(
float[3]) * loop_nr,
"sv loop_dir");
407 loop_maxdist =
MEM_mallocN(
sizeof(
float) * loop_nr,
"sv loop_maxdist");
412 for (
int i = 0; i < sld->
totsv; i++, sv++) {
424 float sco_a[3], sco_b[3];
433 bool is_visible = !use_occlude_geometry ||
436 if (!is_visible && !use_calc_direction) {
445 if ((dist_best_sq == -1.0f) ||
448 dist_best_sq = dist_sq;
453 if (use_calc_direction) {
456 if (loop_maxdist[l_nr] == -1.0f || dist_sq < loop_maxdist[l_nr]) {
457 loop_maxdist[l_nr] = dist_sq;
464 if (use_calc_direction) {
467 for (i = 0; i < sld->
totsv; i++, sv++) {
470 if (
dot_v3v3(loop_dir[l_nr], mval_dir) < 0.0f) {
494 if (sld->
totsv > 0) {
496 float projectMat[4][4];
502 float dist_min_sq = FLT_MAX;
506 for (i = 0; i < sld->
totsv; i++, sv++) {
512 if (dist_sq < dist_min_sq) {
513 dist_min_sq = dist_sq;
534 const float mval[2] = {(
float)
t->mval[0], (
float)
t->mval[1]};
535 int numsel, i, loop_nr;
536 bool use_occlude_geometry =
false;
557 if (numsel == 0 || numsel > 2) {
578 #define INDEX_UNSET -1
579 #define INDEX_INVALID -2
612 float vec_a[3], vec_b[3];
614 BMLoop *l_a_prev, *l_b_prev;
622 #define EDGESLIDE_VERT_IS_INNER(v, e_dir) \
623 ((BM_edge_is_boundary(e_dir) == false) && (BM_vert_edge_count_nonwire(v) == 2))
658 }
while (
e != v_first->
e);
663 l_b =
e->l->radial_next;
705 #define SV_FROM_VERT(v) \
706 ((sv_table[BM_elem_index_get(v)] == INDEX_UNSET) ? \
707 ((void)(sv_table[BM_elem_index_get(v)] = STACK_SIZE(sv_array)), \
708 STACK_PUSH_RET_PTR(sv_array)) : \
709 (&sv_array[sv_table[BM_elem_index_get(v)]]))
728 if (l_a || l_a_prev) {
734 if (
l_b || l_b_prev) {
783 l_a_ok_prev = (l_a !=
NULL);
816 else if (
e->l !=
NULL) {
827 else if (l_b_ok_prev) {
833 if (!l_a_ok_prev && l_a) {
836 if (!l_b_ok_prev &&
l_b) {
843 }
while ((
e != v_first->
e) && (l_a ||
l_b));
851 #undef EDGESLIDE_VERT_IS_INNER
863 v3d =
t->area ?
t->area->spacedata.first :
NULL;
864 rv3d =
t->region ?
t->region->regiondata :
NULL;
894 const float mval[2] = {(
float)
t->mval[0], (
float)
t->mval[1]};
896 bool use_occlude_geometry =
false;
902 v3d =
t->area ?
t->area->spacedata.first :
NULL;
903 rv3d =
t->region ?
t->region->regiondata :
NULL;
914 float len_sq_max = -1.0f;
919 if (len_sq > len_sq_max) {
926 if (len_sq_max != -1.0f) {
976 const int sv_tot_nowire = sv_tot;
979 for (
int i = 0; i < sv_tot_nowire; i++, sv_iter++) {
1013 if ((endpoint == 2) && (sv_tot != j)) {
1022 int sv_tot_prev = sv_tot;
1023 const float *co_src = sv_iter->
v->
co;
1024 const float *co_dst = sv_end->
v->
co;
1025 const float *dir_src = sv_iter->
dir_side[0];
1026 const float *dir_dst = sv_end->
dir_side[0];
1029 while (j-- != sv_tot_prev) {
1032 interp_v3_v3v3(sv_array[j].dir_side[0], dir_src, dir_dst, factor);
1042 sld->
totsv = sv_tot;
1046 v3d =
t->area ?
t->area->spacedata.first :
NULL;
1047 rv3d =
t->region ?
t->region->regiondata :
NULL;
1085 switch (event->
type) {
1110 switch (event->
val) {
1112 sld->curr_sv_index = ((sld->curr_sv_index - 1) + sld->totsv) % sld->totsv;
1115 sld->curr_sv_index = (sld->curr_sv_index + 1) % sld->totsv;
1160 float co_a[3], co_b[3], co_mark[3];
1162 const float fac = (slp->
perc + 1.0f) / 2.0f;
1164 const float guide_size = ctrl_size - 0.5f;
1165 const int alpha_shade = -30;
1173 if (curr_sv->
v_side[0]) {
1177 if (curr_sv->
v_side[1]) {
1184 float *co_test =
NULL;
1186 if (curr_sv->
v_side[1]) {
1191 if (curr_sv->
v_side[0]) {
1196 if (co_test !=
NULL) {
1212 else if (is_clamp ==
false) {
1216 const int alpha_shade = -160;
1224 for (i = 0; i < sld->
totsv; i++, sv++) {
1247 const int alpha_shade = -160;
1275 float snap_point[3], co_orig[3], co_dest[2][3], dvec[3];
1290 float perc = *value;
1296 side_index = perc < 0.0f;
1307 side_index = t_snap >= t_mid;
1312 sub_v3_v3v3(co_dir, co_dest[side_index], co_orig);
1331 perc = (1.0f - perc) * t_mid;
1334 perc = perc * (1.0f - t_mid) + t_mid;
1341 perc = (2 * perc) - 1.0f;
1361 const int side_index = (perc < 0.0f);
1362 const float perc_final =
fabsf(perc);
1371 for (
int i = 0; i < sld->
totsv; i++, sv++) {
1378 const float perc_init =
fabsf(perc) *
1389 for (
int i = 0; i < sld->
totsv; i++, sv++) {
1391 float perc_final = perc_init;
1416 const float curr_length_perc = curr_sv->
edge_len *
1417 (((slp->
flipped ? perc : -perc) + 1.0f) / 2.0f);
1430 for (
int i = 0; i < sld->
totsv; i++, sv++) {
1458 const bool is_constrained = !(is_clamp ==
false ||
hasNumInput(&
t->num));
1460 final =
t->values[0] +
t->values_modal_offset[0];
1468 if (is_constrained) {
1469 CLAMP(
final, -1.0f, 1.0f);
1474 t->values_final[0] =
final;
1505 TransInfo *
t,
bool use_double_side,
bool use_even,
bool flipped,
bool use_clamp)
1521 if (use_double_side ==
false) {
1530 t->custom.mode.data = slp;
1531 t->custom.mode.use_free =
true;
1538 tc->custom.mode.data = sld;
1556 t->snap[1] =
t->snap[0] * 0.1f;
1559 t->num.unit_sys =
t->scene->unit.system;
1583 float projectMat[4][4];
1588 float mval_dir[3], sco_a[3], sco_b[3];
typedef float(TangentPoint)[2]
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
void BKE_bmbvh_free(BMBVHTree *tree)
BMBVHTree * BKE_bmbvh_new_from_editmesh(struct BMEditMesh *em, int flag, const float(*cos_cage)[3], bool cos_cage_free)
#define BLI_assert_msg(a, msg)
MINLINE float min_ff(float a, float b)
float line_point_factor_v3(const float p[3], const float l1[3], const float l2[3])
bool isect_line_plane_v3(float r_isect_co[3], const float l1[3], const float l2[3], const float plane_co[3], const float plane_no[3]) ATTR_WARN_UNUSED_RESULT
float dist_squared_to_line_segment_v2(const float p[2], const float l1[2], const float l2[2])
void unit_m4(float m[4][4])
void mul_m4_v3(const float M[4][4], float r[3])
MINLINE float len_squared_v2(const float v[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
MINLINE float len_squared_v2v2(const float a[2], const float b[2]) ATTR_WARN_UNUSED_RESULT
MINLINE float normalize_v3(float r[3])
MINLINE void sub_v3_v3(float r[3], const float a[3])
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void copy_v3_v3(float r[3], const float a[3])
MINLINE void negate_v3_v3(float r[3], const float a[3])
MINLINE bool is_zero_v3(const float a[3]) ATTR_WARN_UNUSED_RESULT
void copy_vn_fl(float *array_tar, int size, float val)
MINLINE float dot_v3v3(const float a[3], const float b[3]) ATTR_WARN_UNUSED_RESULT
void interp_v3_v3v3(float r[3], const float a[3], const float b[3], float t)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE void cross_v3_v3v3(float r[3], const float a[3], const float b[3])
MINLINE float normalize_v3_length(float r[3], float unit_scale)
MINLINE void zero_v2(float r[2])
MINLINE void swap_v3_v3(float a[3], float b[3])
MINLINE void copy_v3_fl(float r[3], float f)
MINLINE void madd_v3_v3v3fl(float r[3], const float a[3], const float b[3], float f)
MINLINE void zero_v3(float r[3])
MINLINE void add_v3_v3(float r[3], const float a[3])
size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
size_t BLI_snprintf_rlen(char *__restrict dst, size_t maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
#define UNUSED_VARS_NDEBUG(...)
#define STACK_DECLARE(stack)
#define STACK_SIZE(stack)
#define STACK_INIT(stack, stack_num)
@ SCE_SNAP_MODE_FACE_RAYCAST
bool BMBVH_EdgeVisible(struct BMBVHTree *tree, struct BMEdge *e, struct Depsgraph *depsgraph, struct ARegion *region, struct View3D *v3d, struct Object *obedit)
void ED_area_status_text(ScrArea *area, const char *str)
#define XRAY_ENABLED(v3d)
void ED_view3d_project_float_v3_m4(const struct ARegion *region, const float co[3], float r_co[3], const float mat[4][4])
void ED_view3d_ob_project_mat_get(const struct RegionView3D *v3d, const struct Object *ob, float r_pmat[4][4])
void ED_view3d_project_float_v2_m4(const struct ARegion *region, const float co[3], float r_co[2], const float mat[4][4])
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble v1
void GPU_matrix_pop(void)
#define GPU_matrix_mul(x)
void GPU_matrix_push(void)
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
void GPU_line_width(float width)
void GPU_point_size(float size)
void GPU_depth_test(eGPUDepthTest test)
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
float UI_GetThemeValuef(int colorid)
#define BM_DISK_EDGE_NEXT(e, v)
#define BM_elem_index_get(ele)
#define BM_elem_flag_disable(ele, hflag)
#define BM_elem_index_set(ele, index)
#define BM_elem_flag_test(ele, hflag)
#define BM_elem_flag_enable(ele, hflag)
#define BM_ITER_ELEM(ele, iter, data, itype)
#define BM_ITER_MESH(ele, iter, bm, itype)
#define BM_ITER_MESH_INDEX(ele, iter, bm, itype, indexvar)
ATTR_WARN_UNUSED_RESULT BMesh * bm
float BM_edge_calc_length_squared(const BMEdge *e)
BMVert * BM_edge_share_vert(BMEdge *e1, BMEdge *e2)
void BM_loop_calc_face_direction(const BMLoop *l, float r_dir[3])
BM_loop_calc_face_direction.
float BM_edge_calc_length(const BMEdge *e)
bool BM_vert_is_edge_pair(const BMVert *v)
BMLoop * BM_loop_other_edge_loop(BMLoop *l, BMVert *v)
BMLoop * BM_face_vert_share_loop(BMFace *f, BMVert *v)
Return the Loop Shared by Face and Vertex.
BLI_INLINE bool BM_edge_is_manifold(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE bool BM_edge_is_boundary(const BMEdge *e) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
BLI_INLINE BMVert * BM_edge_other_vert(BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
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 * v2
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
ATTR_WARN_UNUSED_RESULT const BMLoop * l_b
ATTR_WARN_UNUSED_RESULT const BMVert * v
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static const pxr::TfToken b("b", pxr::TfToken::Immortal)
struct BMLoop * radial_next
TransDataEdgeSlideVert * sv
TransCustomDataContainer custom
struct LinkNode ** cd_loop_groups
struct BMVert * v_side[2]
const char * WM_bool_as_string(bool test)