blob: a1a714a945c66f79818d720b4f47b35f76f4b307 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
/** \file
* \ingroup bmesh
*
* BM element callback functions.
*/
#include "BLI_utildefines.h"
#include "bmesh.h"
#include "intern/bmesh_callback_generic.h"
bool BM_elem_cb_check_hflag_ex(BMElem *ele, void *user_data)
{
const uint hflag_pair = POINTER_AS_INT(user_data);
const char hflag_p = (hflag_pair & 0xff);
const char hflag_n = (hflag_pair >> 8);
return ((BM_elem_flag_test(ele, hflag_p) != 0) && (BM_elem_flag_test(ele, hflag_n) == 0));
}
bool BM_elem_cb_check_hflag_enabled(BMElem *ele, void *user_data)
{
const char hflag = POINTER_AS_INT(user_data);
return (BM_elem_flag_test(ele, hflag) != 0);
}
bool BM_elem_cb_check_hflag_disabled(BMElem *ele, void *user_data)
{
const char hflag = POINTER_AS_INT(user_data);
return (BM_elem_flag_test(ele, hflag) == 0);
}
bool BM_elem_cb_check_elem_not_equal(BMElem *ele, void *user_data)
{
return (ele != user_data);
}
|