Blender  V2.93
bmesh_private.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2004 Blender Foundation.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
30 /* returns positive nonzero on error */
31 
32 #ifdef NDEBUG
33 /* No error checking for release,
34  * it can take most of the CPU time when running some tools. */
35 # define BM_CHECK_ELEMENT(el) (void)(el)
36 #else
37 int bmesh_elem_check(void *element, const char htype);
38 # define BM_CHECK_ELEMENT(el) \
39  { \
40  if (bmesh_elem_check(el, ((BMHeader *)el)->htype)) { \
41  printf( \
42  "check_element failure, with code %i on line %i in file\n" \
43  " \"%s\"\n\n", \
44  bmesh_elem_check(el, ((BMHeader *)el)->htype), \
45  __LINE__, \
46  __FILE__); \
47  } \
48  } \
49  ((void)0)
50 #endif
51 
52 int bmesh_radial_length(const BMLoop *l);
53 int bmesh_disk_count_at_most(const BMVert *v, const int count_max);
54 int bmesh_disk_count(const BMVert *v);
55 
60 enum {
61  _FLAG_JF = (1 << 0), /* join faces */
62  _FLAG_MF = (1 << 1), /* make face */
63  _FLAG_MV = (1 << 1), /* make face, vertex */
64  _FLAG_OVERLAP = (1 << 2), /* general overlap flag */
65  _FLAG_WALK = (1 << 3), /* general walk flag (keep clean) */
66  _FLAG_WALK_ALT = (1 << 4), /* same as _FLAG_WALK, for when a second tag is needed */
67 
68  _FLAG_ELEM_CHECK = (1 << 7), /* reserved for bmesh_elem_check */
69 };
70 
71 #define BM_ELEM_API_FLAG_ENABLE(element, f) \
72  { \
73  ((element)->head.api_flag |= (f)); \
74  } \
75  (void)0
76 #define BM_ELEM_API_FLAG_DISABLE(element, f) \
77  { \
78  ((element)->head.api_flag &= (uchar) ~(f)); \
79  } \
80  (void)0
81 #define BM_ELEM_API_FLAG_TEST(element, f) ((element)->head.api_flag & (f))
82 #define BM_ELEM_API_FLAG_CLEAR(element) \
83  { \
84  ((element)->head.api_flag = 0); \
85  } \
86  (void)0
87 
88 void poly_rotate_plane(const float normal[3], float (*verts)[3], const uint nverts);
89 
90 /* include the rest of our private declarations */
91 #include "bmesh_structure.h"
unsigned int uint
Definition: BLI_sys_types.h:83
ATTR_WARN_UNUSED_RESULT const void * element
void poly_rotate_plane(const float normal[3], float(*verts)[3], const uint nverts)
POLY ROTATE PLANE.
int bmesh_radial_length(const BMLoop *l)
int bmesh_disk_count_at_most(const BMVert *v, const int count_max)
@ _FLAG_WALK
Definition: bmesh_private.h:65
@ _FLAG_JF
Definition: bmesh_private.h:61
@ _FLAG_WALK_ALT
Definition: bmesh_private.h:66
@ _FLAG_ELEM_CHECK
Definition: bmesh_private.h:68
@ _FLAG_MV
Definition: bmesh_private.h:63
@ _FLAG_MF
Definition: bmesh_private.h:62
@ _FLAG_OVERLAP
Definition: bmesh_private.h:64
int bmesh_elem_check(void *element, const char htype)
Definition: bmesh_core.c:529
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]
IconTextureDrawCall normal