Added BKE_freestyle_lineset_delete() by generalizing FRS_delete_active_lineset().
[blender.git] / source / blender / blenkernel / BKE_subsurf.h
index 7f9881926a60a113a115a71536ebee568ab10551..3dae4087866f4d7320cea79f7bd127e4190f5153 100644 (file)
@@ -34,9 +34,9 @@
 /* struct DerivedMesh is used directly */
 #include "BKE_DerivedMesh.h"
 
+struct CCGElem;
 struct DMFlagMat;
 struct DMGridAdjacency;
-struct DMGridData;
 struct DerivedMesh;
 struct MeshElemMap;
 struct Mesh;
@@ -51,34 +51,45 @@ struct CCGSubsurf;
 struct CCGVert;
 struct EdgeHash;
 struct PBVH;
-struct DMGridData;
 struct DMGridAdjacency;
 
 /**************************** External *****************************/
 
+typedef enum {
+       SUBSURF_USE_RENDER_PARAMS = 1,
+       SUBSURF_IS_FINAL_CALC = 2,
+       SUBSURF_FOR_EDIT_MODE = 4,
+       SUBSURF_IN_EDIT_MODE = 8,
+       SUBSURF_ALLOC_PAINT_MASK = 16
+} SubsurfFlags;
+
 struct DerivedMesh *subsurf_make_derived_from_derived(
-                                               struct DerivedMesh *dm,
-                                               struct SubsurfModifierData *smd,
-                                               int useRenderParams, float (*vertCos)[3],
-                                               int isFinalCalc, int forEditMode, int inEditMode);
+        struct DerivedMesh *dm,
+        struct SubsurfModifierData *smd,
+        float (*vertCos)[3],
+        SubsurfFlags flags);
 
-void subsurf_calculate_limit_positions(struct Mesh *me, float (*positions_r)[3]);
+void subsurf_calculate_limit_positions(struct Mesh *me, float (*r_positions)[3]);
 
 /* get gridsize from 'level', level must be greater than zero */
-int ccg_gridsize(int level);
+int BKE_ccg_gridsize(int level);
 
 /* x/y grid coordinates at 'low_level' can be multiplied by the result
  of this function to convert to grid coordinates at 'high_level' */
-int ccg_factor(int low_level, int high_level);
* of this function to convert to grid coordinates at 'high_level' */
+int BKE_ccg_factor(int low_level, int high_level);
 
 void subsurf_copy_grid_hidden(struct DerivedMesh *dm,
-                                                         const struct MPoly *mpoly,
-                                                         struct MVert *mvert,
-                                                         const struct MDisps *mdisps);
+                              const struct MPoly *mpoly,
+                              struct MVert *mvert,
+                              const struct MDisps *mdisps);
+
+void subsurf_copy_grid_paint_mask(struct DerivedMesh *dm,
+                                  const struct MPoly *mpoly, float *paint_mask,
+                                  const struct GridPaintMask *grid_paint_mask);
 
 typedef enum MultiresModifiedFlags {
        /* indicates the grids have been sculpted on, so MDisps
-          have to be updated */
+        * have to be updated */
        MULTIRES_COORDS_MODIFIED = 1,
        /* indicates elements have been hidden or unhidden */
        MULTIRES_HIDDEN_MODIFIED = 2
@@ -93,10 +104,10 @@ typedef struct CCGDerivedMesh {
        int freeSS;
        int drawInteriorEdges, useSubsurfUv;
 
-       struct {int startVert; struct CCGVert *vert;} *vertMap;
-       struct {int startVert; int startEdge; struct CCGEdge *edge;} *edgeMap;
+       struct {int startVert; struct CCGVert *vert; } *vertMap;
+       struct {int startVert; int startEdge; struct CCGEdge *edge; } *edgeMap;
        struct {int startVert; int startEdge;
-                       int startFace; struct CCGFace *face;} *faceMap;
+                   int startFace; struct CCGFace *face; } *faceMap;
 
        short *edgeFlags;
        struct DMFlagMat *faceFlags;
@@ -108,7 +119,7 @@ typedef struct CCGDerivedMesh {
        struct MeshElemMap *pmap;
        int *pmap_mem;
 
-       struct DMGridData **gridData;
+       struct CCGElem **gridData;
        struct DMGridAdjacency *gridAdjacency;
        int *gridOffset;
        struct CCGFace **gridFaces;