Blender V5.0
bmesh_private.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2004 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
14
15#include "bmesh_class.hh"
16
17/* returns positive nonzero on error */
18
19#ifdef NDEBUG
20/* No error checking for release,
21 * it can take most of the CPU time when running some tools. */
22# define BM_CHECK_ELEMENT(el) (void)(el)
23#else
30int bmesh_elem_check(void *element, char htype);
31# define BM_CHECK_ELEMENT(el) \
32 { \
33 if (bmesh_elem_check(el, ((BMHeader *)el)->htype)) { \
34 printf( \
35 "check_element failure, with code %i on line %i in file\n" \
36 " \"%s\"\n\n", \
37 bmesh_elem_check(el, ((BMHeader *)el)->htype), \
38 __LINE__, \
39 __FILE__); \
40 } \
41 } \
42 ((void)0)
43#endif
44
45int bmesh_radial_length(const BMLoop *l);
46int bmesh_disk_count_at_most(const BMVert *v, int count_max);
47int bmesh_disk_count(const BMVert *v);
48
54enum {
55 _FLAG_JF = (1 << 0), /* Join faces. */
56 _FLAG_MF = (1 << 1), /* Make face. */
57 _FLAG_MV = (1 << 1), /* Make face, vertex. */
58 _FLAG_OVERLAP = (1 << 2), /* General overlap flag. */
59 _FLAG_WALK = (1 << 3), /* General walk flag (keep clean). */
60 _FLAG_WALK_ALT = (1 << 4), /* Same as #_FLAG_WALK, for when a second tag is needed. */
61
62 _FLAG_ELEM_CHECK = (1 << 7), /* Reserved for bmesh_elem_check. */
63};
64
65#define BM_ELEM_API_FLAG_ENABLE(element, f) \
66 { \
67 ((element)->head.api_flag |= (f)); \
68 } \
69 (void)0
70#define BM_ELEM_API_FLAG_DISABLE(element, f) \
71 { \
72 ((element)->head.api_flag &= (uchar) ~(f)); \
73 } \
74 (void)0
75#define BM_ELEM_API_FLAG_TEST(element, f) ((element)->head.api_flag & (f))
76#define BM_ELEM_API_FLAG_CLEAR(element) \
77 { \
78 ((element)->head.api_flag = 0); \
79 } \
80 (void)0
81
88void poly_rotate_plane(const float normal[3], float (*verts)[3], uint nverts);
89
90/* include the rest of our private declarations */
91#include "bmesh_structure.hh" /* IWYU pragma: export */
unsigned int uint
ATTR_WARN_UNUSED_RESULT const void * element
int bmesh_radial_length(const BMLoop *l)
void poly_rotate_plane(const float normal[3], float(*verts)[3], uint nverts)
POLY ROTATE PLANE.
int bmesh_disk_count_at_most(const BMVert *v, int count_max)
@ _FLAG_WALK
@ _FLAG_JF
@ _FLAG_WALK_ALT
@ _FLAG_ELEM_CHECK
@ _FLAG_MV
@ _FLAG_MF
@ _FLAG_OVERLAP
int bmesh_elem_check(void *element, char htype)
int bmesh_disk_count(const BMVert *v)
ATTR_WARN_UNUSED_RESULT const BMLoop * l
ATTR_WARN_UNUSED_RESULT const BMVert * v
static float verts[][3]