LEFT | RIGHT |
1 /* | 1 /* |
2 * ***** BEGIN GPL LICENSE BLOCK ***** | 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
3 * | 3 * |
4 * This program is free software; you can redistribute it and/or | 4 * This program is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU General Public License | 5 * modify it under the terms of the GNU General Public License |
6 * as published by the Free Software Foundation; either version 2 | 6 * as published by the Free Software Foundation; either version 2 |
7 * of the License, or (at your option) any later version. | 7 * of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 16 matching lines...) Expand all Loading... |
27 #ifndef __BKE_SUBSURF_H__ | 27 #ifndef __BKE_SUBSURF_H__ |
28 #define __BKE_SUBSURF_H__ | 28 #define __BKE_SUBSURF_H__ |
29 | 29 |
30 /** \file BKE_subsurf.h | 30 /** \file BKE_subsurf.h |
31 * \ingroup bke | 31 * \ingroup bke |
32 */ | 32 */ |
33 | 33 |
34 /* struct DerivedMesh is used directly */ | 34 /* struct DerivedMesh is used directly */ |
35 #include "BKE_DerivedMesh.h" | 35 #include "BKE_DerivedMesh.h" |
36 | 36 |
37 struct CCGElem; | |
38 struct DMFlagMat; | 37 struct DMFlagMat; |
39 struct DMGridAdjacency; | 38 struct DMGridAdjacency; |
| 39 struct DMGridData; |
40 struct DerivedMesh; | 40 struct DerivedMesh; |
41 struct MeshElemMap; | 41 struct MeshElemMap; |
42 struct Mesh; | 42 struct Mesh; |
43 struct MPoly; | |
44 struct MultiresSubsurf; | |
45 struct Object; | |
46 struct PBVH; | |
47 struct SubsurfModifierData; | |
48 struct CCGEdge; | |
49 struct CCGFace; | |
50 struct CCGSubsurf; | |
51 struct CCGVert; | |
52 struct EdgeHash; | |
53 struct PBVH; | |
54 struct DMGridAdjacency; | |
55 | |
56 /**************************** External *****************************/ | |
57 | |
58 typedef enum { | |
59 SUBSURF_USE_RENDER_PARAMS = 1, | |
60 SUBSURF_IS_FINAL_CALC = 2, | |
61 SUBSURF_FOR_EDIT_MODE = 4, | |
62 SUBSURF_IN_EDIT_MODE = 8, | |
63 SUBSURF_ALLOC_PAINT_MASK = 16 | |
64 } SubsurfFlags; | |
65 | |
66 struct DerivedMesh *subsurf_make_derived_from_derived( | |
67 struct DerivedMesh *dm, | |
68 struct SubsurfModifierData *smd, | |
69 float (*vertCos)[3], | |
70 SubsurfFlags flags); | |
71 | |
72 void subsurf_calculate_limit_positions(struct Mesh *me, float (*positions_r)[3])
; | |
73 | |
74 /* get gridsize from 'level', level must be greater than zero */ | |
75 int ccg_gridsize(int level); | |
76 | |
77 /* x/y grid coordinates at 'low_level' can be multiplied by the result | |
78 * of this function to convert to grid coordinates at 'high_level' */ | |
79 int ccg_factor(int low_level, int high_level); | |
80 | |
81 void subsurf_copy_grid_hidden(struct DerivedMesh *dm, | |
82 const struct MPoly *mp
oly, | |
83 struct MVert *mvert, | |
84 const struct MDisps *m
disps); | |
85 | |
86 void subsurf_copy_grid_paint_mask(struct DerivedMesh *dm, | |
87 const struct M
Poly *mpoly, float *paint_mask, | |
88 const struct G
ridPaintMask *grid_paint_mask); | |
89 | |
90 typedef enum MultiresModifiedFlags { | |
91 /* indicates the grids have been sculpted on, so MDisps | |
92 * have to be updated */ | |
93 MULTIRES_COORDS_MODIFIED = 1, | |
94 /* indicates elements have been hidden or unhidden */ | |
95 MULTIRES_HIDDEN_MODIFIED = 2 | |
96 } MultiresModifiedFlags; | |
97 | |
98 /**************************** Internal *****************************/ | |
99 | |
100 typedef struct CCGDerivedMesh { | |
101 DerivedMesh dm; | |
102 | |
103 struct CCGSubSurf *ss; | |
104 int freeSS; | |
105 int drawInteriorEdges, useSubsurfUv; | |
106 | |
107 struct {int startVert; struct CCGVert *vert;} *vertMap; | |
108 struct {int startVert; int startEdge; struct CCGEdge *edge;} *edgeMap; | |
109 struct {int startVert; int startEdge; | |
110 int startFace; struct CCGFace *face;} *faceMap; | |
111 | |
112 short *edgeFlags; | |
113 struct DMFlagMat *faceFlags; | |
114 | |
115 int *reverseFaceMap; | |
116 | |
117 struct PBVH *pbvh; | |
118 | |
119 struct MeshElemMap *pmap; | |
120 int *pmap_mem; | |
121 | |
122 struct CCGElem **gridData; | |
123 struct DMGridAdjacency *gridAdjacency; | |
124 int *gridOffset; | |
125 struct CCGFace **gridFaces; | |
126 struct DMFlagMat *gridFlagMats; | |
127 unsigned int **gridHidden; | |
128 | |
129 struct { | |
130 struct MultiresModifierData *mmd; | |
131 int local_mmd; | |
132 | |
133 int lvl, totlvl; | |
134 float (*orco)[3]; | |
135 | |
136 struct Object *ob; | |
137 MultiresModifiedFlags modified_flags; | |
138 } multires; | |
139 | |
140 struct EdgeHash *ehash; | |
141 } CCGDerivedMesh; | |
142 | |
143 #endif | |
144 | |
LEFT | RIGHT |