26
25
* ***** END GPL LICENSE BLOCK *****
27
#ifndef __BKE_SUBSURF_H__
28
#define __BKE_SUBSURF_H__
30
/** \file BKE_subsurf.h
34
/* struct DerivedMesh is used directly */
35
#include "BKE_DerivedMesh.h"
31
38
struct DMGridAdjacency;
33
40
struct DerivedMesh;
38
44
struct MultiresSubsurf;
41
47
struct SubsurfModifierData;
55
struct DMGridAdjacency;
47
57
/**************************** External *****************************/
50
60
struct DerivedMesh *dm,
51
61
struct SubsurfModifierData *smd,
52
62
int useRenderParams, float (*vertCos)[3],
53
int isFinalCalc, int editMode);
63
int isFinalCalc, int forEditMode, int inEditMode);
55
65
void subsurf_calculate_limit_positions(struct Mesh *me, float (*positions_r)[3]);
67
/* get gridsize from 'level', level must be greater than zero */
68
int ccg_gridsize(int level);
70
/* x/y grid coordinates at 'low_level' can be multiplied by the result
71
* of this function to convert to grid coordinates at 'high_level' */
72
int ccg_factor(int low_level, int high_level);
74
void subsurf_copy_grid_hidden(struct DerivedMesh *dm,
75
const struct MPoly *mpoly,
77
const struct MDisps *mdisps);
79
typedef enum MultiresModifiedFlags {
80
/* indicates the grids have been sculpted on, so MDisps
81
* have to be updated */
82
MULTIRES_COORDS_MODIFIED = 1,
83
/* indicates elements have been hidden or unhidden */
84
MULTIRES_HIDDEN_MODIFIED = 2
85
} MultiresModifiedFlags;
57
87
/**************************** Internal *****************************/
59
89
typedef struct CCGDerivedMesh {
62
struct _CCGSubSurf *ss;
92
struct CCGSubSurf *ss;
64
94
int drawInteriorEdges, useSubsurfUv;
66
struct {int startVert; struct _CCGVert *vert;} *vertMap;
67
struct {int startVert; int startEdge; struct _CCGEdge *edge;} *edgeMap;
96
struct {int startVert; struct CCGVert *vert;} *vertMap;
97
struct {int startVert; int startEdge; struct CCGEdge *edge;} *edgeMap;
68
98
struct {int startVert; int startEdge;
69
int startFace; struct _CCGFace *face;} *faceMap;
99
int startFace; struct CCGFace *face;} *faceMap;
102
struct DMFlagMat *faceFlags;
74
106
struct PBVH *pbvh;
76
struct ListBase *fmap;
77
struct IndexNode *fmap_mem;
108
struct MeshElemMap *pmap;
79
111
struct DMGridData **gridData;
80
112
struct DMGridAdjacency *gridAdjacency;
82
struct _CCGFace **gridFaces;
114
struct CCGFace **gridFaces;
115
struct DMFlagMat *gridFlagMats;
116
unsigned int **gridHidden;
85
119
struct MultiresModifierData *mmd;