Blender  V2.93
BKE_editmesh.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 
17 #pragma once
18 
27 #include "BKE_customdata.h"
28 #include "bmesh.h"
29 
30 #ifdef __cplusplus
31 extern "C" {
32 #endif
33 
34 struct BMLoop;
35 struct BMesh;
36 struct BoundBox;
37 struct Depsgraph;
38 struct Mesh;
39 struct Object;
40 struct Scene;
41 
51 typedef struct BMEditMesh {
52  struct BMesh *bm;
53 
54  /*this is for undoing failed operations*/
55  struct BMEditMesh *emcopy;
57 
58  /* we store tessellations as triplets of three loops,
59  * which each define a triangle.*/
60  struct BMLoop *(*looptris)[3];
61  int tottri;
62 
64 
66  struct BoundBox *bb_cage;
67 
68  /*derivedmesh stuff*/
70 
71  /*selection mode*/
72  short selectmode;
73  short mat_nr;
74 
75  /*temp variables for x-mirror editing*/
76  int mirror_cdlayer; /* -1 is invalid */
77 
83 
85 
86 /* editmesh.c */
88 BMEditMesh *BKE_editmesh_create(BMesh *bm, const bool do_tessellate);
93 
95  struct BMEditMesh *em,
96  struct Scene *scene,
97  struct Object *ob,
98  int *r_vert_len))[3];
99 float (*BKE_editmesh_vert_coords_alloc_orco(BMEditMesh *em, int *r_vert_len))[3];
101  struct BMEditMesh *em,
102  struct Scene *scene,
103  struct Object *obedit,
104  int *r_vert_len,
105  bool *r_is_alloc))[3];
106 
107 void BKE_editmesh_lnorspace_update(BMEditMesh *em, struct Mesh *me);
108 void BKE_editmesh_ensure_autosmooth(BMEditMesh *em, struct Mesh *me);
110 
111 #ifdef __cplusplus
112 }
113 #endif
typedef float(TangentPoint)[2]
CustomData interface, see also DNA_customdata_types.h.
void BKE_editmesh_free_derivedmesh(BMEditMesh *em)
Definition: editmesh.c:151
void BKE_editmesh_looptri_calc(BMEditMesh *em)
Definition: editmesh.c:135
void BKE_editmesh_lnorspace_update(BMEditMesh *em, struct Mesh *me)
Definition: editmesh.c:264
void BKE_editmesh_ensure_autosmooth(BMEditMesh *em, struct Mesh *me)
Definition: editmesh.c:286
float(* BKE_editmesh_vert_coords_alloc(struct Depsgraph *depsgraph, struct BMEditMesh *em, struct Scene *scene, struct Object *ob, int *r_vert_len))[3]
Definition: editmesh.c:198
const float(* BKE_editmesh_vert_coords_when_deformed(struct Depsgraph *depsgraph, struct BMEditMesh *em, struct Scene *scene, struct Object *obedit, int *r_vert_len, bool *r_is_alloc))[3]
Definition: editmesh.c:231
BMEditMesh * BKE_editmesh_from_object(struct Object *ob)
Return the BMEditMesh for a given object.
Definition: editmesh.c:85
void BKE_editmesh_free(BMEditMesh *em)
Definition: editmesh.c:165
BMEditMesh * BKE_editmesh_copy(BMEditMesh *em)
Definition: editmesh.c:54
float(* BKE_editmesh_vert_coords_alloc_orco(BMEditMesh *em, int *r_vert_len))[3]
Definition: editmesh.c:259
struct BMEditMesh BMEditMesh
BMEditMesh * BKE_editmesh_create(BMesh *bm, const bool do_tessellate)
Definition: editmesh.c:42
struct BoundBox * BKE_editmesh_cage_boundbox_get(BMEditMesh *em)
Definition: editmesh.c:294
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
ATTR_WARN_UNUSED_RESULT BMesh * bm
Scene scene
const Depsgraph * depsgraph
struct Mesh * mesh_eval_final
Definition: BKE_editmesh.h:63
CustomData_MeshMasks lastDataMask
Definition: BKE_editmesh.h:69
struct Mesh * mesh_eval_cage
Definition: BKE_editmesh.h:63
struct BoundBox * bb_cage
Definition: BKE_editmesh.h:66
short selectmode
Definition: BKE_editmesh.h:72
int emcopyusers
Definition: BKE_editmesh.h:56
struct BMesh * bm
Definition: BKE_editmesh.h:52
short mat_nr
Definition: BKE_editmesh.h:73
struct BMEditMesh * emcopy
Definition: BKE_editmesh.h:55
char needs_flush_to_id
Definition: BKE_editmesh.h:82
int mirror_cdlayer
Definition: BKE_editmesh.h:76