ClangFormat: apply to source, most of intern
[blender.git] / source / blender / blenkernel / BKE_mesh_runtime.h
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) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  */
19 #ifndef __BKE_MESH_RUNTIME_H__
20 #define __BKE_MESH_RUNTIME_H__
21
22 /** \file
23  * \ingroup bke
24  *
25  * This file contains access functions for the Mesh.runtime struct.
26  */
27
28 //#include "BKE_customdata.h"  /* for CustomDataMask */
29
30 struct ColorBand;
31 struct CustomData;
32 struct CustomData_MeshMasks;
33 struct Depsgraph;
34 struct KeyBlock;
35 struct MLoop;
36 struct MLoopTri;
37 struct MVertTri;
38 struct Mesh;
39 struct Object;
40 struct Scene;
41
42 void BKE_mesh_runtime_reset(struct Mesh *mesh);
43 void BKE_mesh_runtime_reset_on_copy(struct Mesh *mesh, const int flag);
44 int BKE_mesh_runtime_looptri_len(const struct Mesh *mesh);
45 void BKE_mesh_runtime_looptri_recalc(struct Mesh *mesh);
46 const struct MLoopTri *BKE_mesh_runtime_looptri_ensure(struct Mesh *mesh);
47 bool BKE_mesh_runtime_ensure_edit_data(struct Mesh *mesh);
48 bool BKE_mesh_runtime_clear_edit_data(struct Mesh *mesh);
49 void BKE_mesh_runtime_clear_geometry(struct Mesh *mesh);
50 void BKE_mesh_runtime_clear_cache(struct Mesh *mesh);
51
52 void BKE_mesh_runtime_verttri_from_looptri(struct MVertTri *r_verttri,
53                                            const struct MLoop *mloop,
54                                            const struct MLoopTri *looptri,
55                                            int looptri_num);
56
57 /* NOTE: the functions below are defined in DerivedMesh.c, and are intended to be moved
58  * to a more suitable location when that file is removed.
59  * They should also be renamed to use conventions from BKE, not old DerivedMesh.c.
60  * For now keep the names similar to avoid confusion. */
61 struct Mesh *mesh_get_eval_final(struct Depsgraph *depsgraph,
62                                  struct Scene *scene,
63                                  struct Object *ob,
64                                  const struct CustomData_MeshMasks *dataMask);
65
66 struct Mesh *mesh_get_eval_deform(struct Depsgraph *depsgraph,
67                                   struct Scene *scene,
68                                   struct Object *ob,
69                                   const struct CustomData_MeshMasks *dataMask);
70
71 struct Mesh *mesh_create_eval_final_render(struct Depsgraph *depsgraph,
72                                            struct Scene *scene,
73                                            struct Object *ob,
74                                            const struct CustomData_MeshMasks *dataMask);
75
76 struct Mesh *mesh_create_eval_final_index_render(struct Depsgraph *depsgraph,
77                                                  struct Scene *scene,
78                                                  struct Object *ob,
79                                                  const struct CustomData_MeshMasks *dataMask,
80                                                  int index);
81
82 struct Mesh *mesh_create_eval_final_view(struct Depsgraph *depsgraph,
83                                          struct Scene *scene,
84                                          struct Object *ob,
85                                          const struct CustomData_MeshMasks *dataMask);
86
87 struct Mesh *mesh_create_eval_no_deform(struct Depsgraph *depsgraph,
88                                         struct Scene *scene,
89                                         struct Object *ob,
90                                         const struct CustomData_MeshMasks *dataMask);
91 struct Mesh *mesh_create_eval_no_deform_render(struct Depsgraph *depsgraph,
92                                                struct Scene *scene,
93                                                struct Object *ob,
94                                                const struct CustomData_MeshMasks *dataMask);
95
96 void BKE_mesh_runtime_eval_to_meshkey(struct Mesh *me_deformed,
97                                       struct Mesh *me,
98                                       struct KeyBlock *kb);
99
100 #ifndef NDEBUG
101 char *BKE_mesh_runtime_debug_info(struct Mesh *me_eval);
102 void BKE_mesh_runtime_debug_print(struct Mesh *me_eval);
103 void BKE_mesh_runtime_debug_print_cdlayers(struct CustomData *data);
104 bool BKE_mesh_runtime_is_valid(struct Mesh *me_eval);
105 #endif /* NDEBUG */
106
107 #endif /* __BKE_MESH_RUNTIME_H__ */