More DM func renames, this one includes renames of the function pointer members of...
authorAndrew Wiggin <ender79bl@gmail.com>
Tue, 29 Nov 2011 13:01:51 +0000 (13:01 +0000)
committerAndrew Wiggin <ender79bl@gmail.com>
Tue, 29 Nov 2011 13:01:51 +0000 (13:01 +0000)
15 files changed:
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenkernel/intern/DerivedMesh.c
source/blender/blenkernel/intern/anim.c
source/blender/blenkernel/intern/cdderivedmesh.c
source/blender/blenkernel/intern/dynamicpaint.c
source/blender/blenkernel/intern/editderivedbmesh.c
source/blender/blenkernel/intern/modifiers_bmesh.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/editors/mesh/editface.c
source/blender/editors/object/object_bake.c
source/blender/editors/space_info/info_stats.c
source/blender/editors/space_view3d/drawobject.c
source/blender/modifiers/intern/MOD_boolean.c
source/blender/modifiers/intern/MOD_build.c
source/blender/modifiers/intern/MOD_solidify.c

index e546f96fb91aef0db440df34e990d407c61db8ed..7a6f43b784695fad5cd7eb1963e20b77f21c3b01 100644 (file)
@@ -141,7 +141,7 @@ struct DerivedMesh {
        int (*getNumVerts)(DerivedMesh *dm);
        int (*getNumEdges)(DerivedMesh *dm);
        int (*getNumTessFaces)(DerivedMesh *dm);
-       int (*getNumFaces) (DerivedMesh *dm);
+       int (*getNumPolys)(DerivedMesh *dm);
 
        /* copy a single vert/edge/tesselated face from the derived mesh into
         * *{vert/edge/face}_r. note that the current implementation
@@ -203,7 +203,7 @@ struct DerivedMesh {
        CustomData *(*getEdgeDataLayout)(DerivedMesh *dm);
        CustomData *(*getTessFaceDataLayout)(DerivedMesh *dm);
        CustomData *(*getLoopDataLayout)(DerivedMesh *dm);
-       CustomData *(*getFaceDataLayout)(DerivedMesh *dm);
+       CustomData *(*getPolyDataLayout)(DerivedMesh *dm);
        
        /*copies all customdata for an element source into dst at index dest*/
        void (*copyFromVertCData)(DerivedMesh *dm, int source, CustomData *dst, int dest);
index c9c199d9c39d7b847ed079d636c222361f5253d1..c701e0a52f3772e9ad74529e86b7095daea39c10 100644 (file)
@@ -149,7 +149,7 @@ static MPoly *dm_getPolyArray(DerivedMesh *dm)
 
        if (!mpoly) {
                mpoly = CustomData_add_layer(&dm->polyData, CD_MPOLY, CD_CALLOC, NULL,
-                       dm->getNumFaces(dm));
+                       dm->getNumPolys(dm));
                CustomData_set_layer_flag(&dm->polyData, CD_MPOLY, CD_FLAG_TEMPORARY);
                dm->copyPolyArray(dm, mpoly);
        }
@@ -250,7 +250,7 @@ void DM_init_funcs(DerivedMesh *dm)
        dm->getEdgeDataLayout = dm_getEdgeCData;
        dm->getTessFaceDataLayout = dm_getFaceCData;
        dm->getLoopDataLayout = dm_getLoopCData;
-       dm->getFaceDataLayout = dm_getPolyCData;
+       dm->getPolyDataLayout = dm_getPolyCData;
 
        dm->getVertData = DM_get_vert_data;
        dm->getEdgeData = DM_get_edge_data;
@@ -365,7 +365,7 @@ void DM_to_mesh(DerivedMesh *dm, Mesh *me, Object *ob)
 
        totvert = tmp.totvert = dm->getNumVerts(dm);
        totedge = tmp.totedge = dm->getNumEdges(dm);
-       totpoly = tmp.totpoly = dm->getNumFaces(dm);
+       totpoly = tmp.totpoly = dm->getNumPolys(dm);
        totloop = tmp.totloop = dm->numLoopData;
 
        CustomData_copy(&dm->vertData, &tmp.vdata, CD_MASK_MESH, CD_DUPLICATE, totvert);
@@ -2410,7 +2410,7 @@ static void navmesh_DM_drawFacesSolid(DerivedMesh *dm,
 static DerivedMesh *navmesh_dm_createNavMeshForVisualization(DerivedMesh *dm)
 {
        DerivedMesh *result;
-       int maxFaces = dm->getNumFaces(dm);
+       int maxFaces = dm->getNumPolys(dm);
        int *recastData;
        int vertsPerPoly=0, nverts=0, ndtris=0, npolys=0;
        float* verts=NULL;
index ac104dfe206057c92b7de95327c6f19ea042a177..67bd1ec18aaf300730bcde81fede885548a6c82e 100644 (file)
@@ -1037,7 +1037,7 @@ static void face_duplilist(ListBase *lb, ID *id, Scene *scene, Object *par, floa
                dm = mesh_get_derived_deform(scene, par, CD_MASK_BAREMESH);
        }
 
-       totface= dm->getNumFaces(dm);
+       totface= dm->getNumPolys(dm);
        mpoly= dm->getPolyArray(dm);
        mloop= dm->getLoopArray(dm);
        mvert= dm->getVertArray(dm);
index ddc8d536d252187a5660e6078c4c8e5243cd09c3..64d44707cff6a69edeab26a3898f1c524247107c 100644 (file)
@@ -112,7 +112,7 @@ static int cdDM_getNumTessFaces(DerivedMesh *dm)
        return dm->numFaceData;
 }
 
-static int cdDM_getNumFaces(DerivedMesh *dm)
+static int cdDM_getNumPolys(DerivedMesh *dm)
 {
        return dm->numPolyData;
 }
@@ -129,7 +129,7 @@ static void cdDM_getEdge(DerivedMesh *dm, int index, MEdge *edge_r)
        *edge_r = cddm->medge[index];
 }
 
-static void cdDM_getFace(DerivedMesh *dm, int index, MFace *face_r)
+static void cdDM_getTessFace(DerivedMesh *dm, int index, MFace *face_r)
 {
        CDDerivedMesh *cddm = (CDDerivedMesh *)dm;
        *face_r = cddm->mface[index];
@@ -147,7 +147,7 @@ static void cdDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r)
        memcpy(edge_r, cddm->medge, sizeof(*edge_r) * dm->numEdgeData);
 }
 
-static void cdDM_copyFaceArray(DerivedMesh *dm, MFace *face_r)
+static void cdDM_copyTessFaceArray(DerivedMesh *dm, MFace *face_r)
 {
        CDDerivedMesh *cddm = (CDDerivedMesh *)dm;
        memcpy(face_r, cddm->mface, sizeof(*face_r) * dm->numFaceData);
@@ -1631,17 +1631,25 @@ static CDDerivedMesh *cdDM_create(const char *desc)
        dm->getNumVerts = cdDM_getNumVerts;
        dm->getNumEdges = cdDM_getNumEdges;
        dm->getNumTessFaces = cdDM_getNumTessFaces;
-       dm->getNumFaces = cdDM_getNumFaces;
+       dm->getNumPolys = cdDM_getNumPolys;
 
        dm->getVert = cdDM_getVert;
        dm->getEdge = cdDM_getEdge;
-       dm->getTessFace = cdDM_getFace;
+       dm->getTessFace = cdDM_getTessFace;
+
        dm->copyVertArray = cdDM_copyVertArray;
        dm->copyEdgeArray = cdDM_copyEdgeArray;
-       dm->copyTessFaceArray = cdDM_copyFaceArray;
+       dm->copyTessFaceArray = cdDM_copyTessFaceArray;
        dm->copyLoopArray = cdDM_copyLoopArray;
        dm->copyPolyArray = cdDM_copyPolyArray;
 
+       dm->getVertData = DM_get_vert_data;
+       dm->getEdgeData = DM_get_edge_data;
+       dm->getTessFaceData = DM_get_tessface_data;
+       dm->getVertDataArray = DM_get_vert_data_layer;
+       dm->getEdgeDataArray = DM_get_edge_data_layer;
+       dm->getTessFaceDataArray = DM_get_tessface_data_layer;
+
        dm->calcNormals = CDDM_calc_normals;
        dm->recalcTesselation = CDDM_recalc_tesselation;
 
index aa8ff43d423c760bf8ef367a24db58523976bfe8..75b6cb10e7e8226f61be001c9c34771a612bfb4f 100644 (file)
@@ -1668,7 +1668,7 @@ static struct DerivedMesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData
                                                        /* Save preview results to weight layer, to be
                                                        *   able to share same drawing methods */
                                                        MFace *mface = result->getTessFaceArray(result);
-                                                       int numOfFaces = result->getNumFaces(result);
+                                                       int numOfFaces = result->getNumPolys(result);
                                                        int i;
                                                        MCol *col = result->getTessFaceDataArray(result, CD_WEIGHT_MCOL);
                                                        if (!col) col = CustomData_add_layer(&result->faceData, CD_WEIGHT_MCOL, CD_CALLOC, NULL, numOfFaces);
@@ -2091,7 +2091,7 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
        if (!dm) return setError(canvas, "Canvas mesh not updated.");
        if (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) return setError(canvas, "Can't bake non-\"image sequence\" formats.");
 
-       numOfFaces = dm->getNumFaces(dm);
+       numOfFaces = dm->getNumPolys(dm);
        mface = dm->getTessFaceArray(dm);
 
        /* get uv map */
index 0bc105ca5015156252a3f73ed058d6f9833fe521..55dd20061d8fbf2cce761e20334ff5aef80e6ca9 100644 (file)
@@ -1276,7 +1276,7 @@ static int bmDM_getNumTessFaces(DerivedMesh *dm)
        return bmdm->tc->tottri;
 }
 
-static int bmDM_getNumFaces(DerivedMesh *dm)
+static int bmDM_getNumPolys(DerivedMesh *dm)
 {
        EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
        
@@ -1415,7 +1415,7 @@ static void bmDM_copyEdgeArray(DerivedMesh *dm, MEdge *edge_r)
        }
 }
 
-static void bmDM_copyFaceArray(DerivedMesh *dm, MFace *face_r)
+static void bmDM_copyTessFaceArray(DerivedMesh *dm, MFace *face_r)
 {
        EditDerivedBMesh *bmdm = (EditDerivedBMesh *)dm;
        BMesh *bm = ((EditDerivedBMesh *)dm)->tc->bm;
@@ -1482,7 +1482,7 @@ static void bmDM_copyPolyArray(DerivedMesh *dm, MPoly *poly_r)
        }
 }
 
-static void *bmDM_getFaceDataArray(DerivedMesh *dm, int type)
+static void *bmDM_getTessFaceDataArray(DerivedMesh *dm, int type)
 {
        EditDerivedBMesh *bmdm= (EditDerivedBMesh*) dm;
        BMesh *bm= bmdm->tc->bm;
@@ -1592,7 +1592,7 @@ static CustomData *bmDm_getLoopDataLayout(DerivedMesh *dm)
        return &bmdm->tc->bm->ldata;
 }
 
-static CustomData *bmDm_getFaceDataLayout(DerivedMesh *dm)
+static CustomData *bmDm_getPolyDataLayout(DerivedMesh *dm)
 {
        EditDerivedBMesh *bmdm = (EditDerivedBMesh*)dm;
 
@@ -1620,23 +1620,23 @@ DerivedMesh *getEditDerivedBMesh(BMEditMesh *em, Object *UNUSED(ob),
        bmdm->dm.getEdgeDataLayout = bmDm_getEdgeDataLayout;
        bmdm->dm.getTessFaceDataLayout = bmDm_getTessFaceDataLayout;
        bmdm->dm.getLoopDataLayout = bmDm_getLoopDataLayout;
-       bmdm->dm.getFaceDataLayout = bmDm_getFaceDataLayout;
+       bmdm->dm.getPolyDataLayout = bmDm_getPolyDataLayout;
 
        bmdm->dm.getNumVerts = bmDM_getNumVerts;
        bmdm->dm.getNumEdges = bmDM_getNumEdges;
        bmdm->dm.getNumTessFaces = bmDM_getNumTessFaces;
-       bmdm->dm.getNumFaces = bmDM_getNumFaces;
+       bmdm->dm.getNumPolys = bmDM_getNumPolys;
 
        bmdm->dm.getVert = bmDM_getVert;
        bmdm->dm.getEdge = bmDM_getEdge;
        bmdm->dm.getTessFace = bmDM_getTessFace;
        bmdm->dm.copyVertArray = bmDM_copyVertArray;
        bmdm->dm.copyEdgeArray = bmDM_copyEdgeArray;
-       bmdm->dm.copyTessFaceArray = bmDM_copyFaceArray;
+       bmdm->dm.copyTessFaceArray = bmDM_copyTessFaceArray;
        bmdm->dm.copyLoopArray = bmDM_copyLoopArray;
        bmdm->dm.copyPolyArray = bmDM_copyPolyArray;
 
-       bmdm->dm.getTessFaceDataArray = bmDM_getFaceDataArray;
+       bmdm->dm.getTessFaceDataArray = bmDM_getTessFaceDataArray;
 
        bmdm->dm.calcNormals = bmDM_calcNormals;
        bmdm->dm.recalcTesselation = bmDM_recalcTesselation;
index 45c642fc0f354a85418614df553fbff93fe06f79..2dc994b215981773580fd7cebf61cf1d30dcea7e 100644 (file)
@@ -138,7 +138,7 @@ BMEditMesh *CDDM_To_BMesh(Object *ob, DerivedMesh *dm, BMEditMesh *existing)
 
        totvert = dm->getNumVerts(dm);
        totedge = dm->getNumEdges(dm);
-       totface = dm->getNumFaces(dm);
+       totface = dm->getNumPolys(dm);
 
        vtable = MEM_callocN(sizeof(void**)*totvert, "vert table in BMDM_Copy");
        etable = MEM_callocN(sizeof(void**)*totedge, "edge table in BMDM_Copy");
index 1d1a10f57e3640969d4d0fda30c09e37398ea55b..c4eb129de26b1e73f8623c0dc8da504ccabb9f9f 100644 (file)
@@ -223,7 +223,7 @@ static int ss_sync_from_uv(CCGSubSurf *ss, CCGSubSurf *origss, DerivedMesh *dm,
        MLoop *mloop = dm->getLoopArray(dm);
        MVert *mvert = dm->getVertArray(dm);
        int totvert = dm->getNumVerts(dm);
-       int totface = dm->getNumFaces(dm);
+       int totface = dm->getNumPolys(dm);
        int i, j, seam;
        UvMapVert *v;
        UvVertMap *vmap;
@@ -2502,7 +2502,7 @@ static void *ccgDM_get_edge_data_layer(DerivedMesh *dm, int type)
        return DM_get_edge_data_layer(dm, type);
 }
 
-static void *ccgDM_get_face_data_layer(DerivedMesh *dm, int type)
+static void *ccgDM_get_tessface_data_layer(DerivedMesh *dm, int type)
 {
        if(type == CD_ORIGINDEX) {
                /* create origindex on demand to save memory */
@@ -2813,7 +2813,8 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
        ccgdm->dm.getNumVerts = cgdm_getNumVerts;
        ccgdm->dm.getNumEdges = cgdm_getNumEdges;
        ccgdm->dm.getNumTessFaces = cgdm_getNumTessFaces;
-       ccgdm->dm.getNumFaces = cgdm_getNumTessFaces;
+       /* reuse of cgdm_getNumTessFaces is intentional here: subsurf polys are just created from tessfaces */
+       ccgdm->dm.getNumPolys = cgdm_getNumTessFaces;
 
        ccgdm->dm.getNumGrids = ccgDM_getNumGrids;
        ccgdm->dm.getPBVH = ccgDM_getPBVH;
@@ -2830,7 +2831,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
        ccgdm->dm.copyPolyArray = ccgDM_copyFinalPolyArray;
        ccgdm->dm.getVertDataArray = ccgDM_get_vert_data_layer;
        ccgdm->dm.getEdgeDataArray = ccgDM_get_edge_data_layer;
-       ccgdm->dm.getTessFaceDataArray = ccgDM_get_face_data_layer;
+       ccgdm->dm.getTessFaceDataArray = ccgDM_get_tessface_data_layer;
        ccgdm->dm.getNumGrids = ccgDM_getNumGrids;
        ccgdm->dm.getGridSize = ccgDM_getGridSize;
        ccgdm->dm.getGridData = ccgDM_getGridData;
index 9c39a744db7e9c1ca9f4d609022e0e83ec674ca7..b2b151bd34db38eba623f59c37f0b76a0e1bf90c 100644 (file)
@@ -103,7 +103,7 @@ void paintface_flush_flags(Object *ob)
 
        if ((index_array = CustomData_get_layer(&dm->polyData, CD_ORIGINDEX))) {
                polys = dm->getPolyArray(dm);
-               totpoly = dm->getNumFaces(dm);
+               totpoly = dm->getNumPolys(dm);
 
                /* loop over final derived polys */
                for (i= 0; i<totpoly; i++) {
index b1b7665d055ba061f5e81fc8b000ff4e65745304..8b9cc98e2fe7f3b7417172b72668b5f08c6898a9 100644 (file)
@@ -367,7 +367,7 @@ static void do_multires_bake(MultiresBakeRender *bkr, Image* ima, MPassKnownData
        DerivedMesh *dm= bkr->lores_dm;
        ImBuf *ibuf= BKE_image_get_ibuf(ima, NULL);
        const int lvl= bkr->lvl;
-       const int tot_face= dm->getNumFaces(dm);
+       const int tot_face= dm->getNumTessFaces(dm);
        MVert *mvert= dm->getVertArray(dm);
        MFace *mface= dm->getTessFaceArray(dm);
        MTFace *mtface= dm->getTessFaceDataArray(dm, CD_MTFACE);
@@ -817,7 +817,7 @@ static void count_images(MultiresBakeRender *bkr)
        bkr->image.first= bkr->image.last= NULL;
        bkr->tot_image= 0;
 
-       totface= dm->getNumFaces(dm);
+       totface= dm->getNumTessFaces(dm);
 
        for(a= 0; a<totface; a++)
                mtface[a].tpage->id.flag&= ~LIB_DOIT;
@@ -1134,7 +1134,7 @@ static void multiresbake_startjob(void *bkv, short *stop, short *do_update, floa
                        DerivedMesh *dm= data->lores_dm;
                        MTFace *mtface= CustomData_get_layer(&dm->faceData, CD_MTFACE);
 
-                       clear_images(mtface, dm->getNumFaces(dm));
+                       clear_images(mtface, dm->getNumTessFaces(dm));
                }
        }
 
index d94185098307bccc6737864e8f88db6878f67646..38d99c084b316c8c28953fb568caf1dff3a33469 100644 (file)
@@ -79,7 +79,7 @@ static void stats_object(Object *ob, int sel, int totob, SceneStats *stats)
                if(dm) {
                        totvert = dm->getNumVerts(dm);
                        totedge = dm->getNumEdges(dm);
-                       totface = dm->getNumFaces(dm);
+                       totface = dm->getNumPolys(dm);
 
                        stats->totvert += totvert*totob;
                        stats->totedge += totedge*totob;
index 4899a3172232d466526f8a8d3675f04ead75d19f..877d04baa2cf8db52e130db96bc2268e2d67f706 100644 (file)
@@ -3644,7 +3644,7 @@ static int drawCurveDerivedMesh(Scene *scene, View3D *v3d, RegionView3D *rv3d, B
                return 1;
        }
 
-       if(dt>OB_WIRE && dm->getNumFaces(dm)) {
+       if(dt>OB_WIRE && dm->getNumTessFaces(dm)) {
                int glsl = draw_glsl_material(scene, ob, v3d, dt);
                GPU_begin_object_materials(v3d, rv3d, scene, ob, glsl, NULL);
 
@@ -5981,7 +5981,7 @@ static void drawObjectSelect(Scene *scene, View3D *v3d, ARegion *ar, Base *base)
                int hasfaces= 0;
 
                if (dm) {
-                       hasfaces= dm->getNumFaces(dm);
+                       hasfaces= dm->getNumTessFaces(dm);
                } else {
                        hasfaces= displist_has_faces(&ob->disp);
                }
index b1460844213ef8788ed918eae1ca66bce14002a3..9670f661d75ff6d257ef88040c817219aaf61387 100644 (file)
@@ -94,14 +94,14 @@ static DerivedMesh *get_quick_derivedMesh(DerivedMesh *derivedData, DerivedMesh
 {
        DerivedMesh *result = NULL;
 
-       if(derivedData->getNumFaces(derivedData) == 0 || dm->getNumFaces(dm) == 0) {
+       if(derivedData->getNumPolys(derivedData) == 0 || dm->getNumPolys(dm) == 0) {
                switch(operation) {
                        case eBooleanModifierOp_Intersect:
                                result = CDDM_new(0, 0, 0, 0, 0);
                                break;
 
                        case eBooleanModifierOp_Union:
-                               if(derivedData->getNumFaces(derivedData)) result = derivedData;
+                               if(derivedData->getNumPolys(derivedData)) result = derivedData;
                                else result = CDDM_copy(dm, FALSE);
 
                                break;
index ff80823283cf3f4ecf44f69f1d58ac0c760b375d..63c83dcaf5423914d5e98d973002a8cbcb05d0fa 100644 (file)
@@ -101,7 +101,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
 
        const int maxVerts= dm->getNumVerts(dm);
        const int maxEdges= dm->getNumEdges(dm);
-       const int maxFaces= dm->getNumFaces(dm);
+       const int maxFaces= dm->getNumPolys(dm);
        
        if (!CDDM_Check(dm)) {
                result = CDDM_copy(dm, 0);
@@ -118,7 +118,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
        frac = (BKE_curframe(md->scene) - bmd->start) / bmd->length;
        CLAMP(frac, 0.0f, 1.0f);
 
-       numFaces = dm->getNumFaces(dm) * frac;
+       numFaces = dm->getNumPolys(dm) * frac;
        numEdges = dm->getNumEdges(dm) * frac;
 
        /* if there's at least one face, build based on faces */
index 8c59ecd432b733cd1e1621326ecdbb493ddaee16..fe17c39610fdcd00facd23f03b8eb1a5a936cab8 100644 (file)
@@ -71,7 +71,7 @@ static void dm_calc_normal(DerivedMesh *dm, float (*temp_nors)[3])
 
        numVerts = dm->getNumVerts(dm);
        numEdges = dm->getNumEdges(dm);
-       numFaces = dm->getNumFaces(dm);
+       numFaces = dm->getNumPolys(dm);
        mpoly = CDDM_get_polys(dm);
        mvert = dm->getVertArray(dm);
        mloop = CDDM_get_loops(dm);
@@ -208,7 +208,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
        MPoly *mp, *mpoly, *orig_mpoly;
        const int numVerts = dm->getNumVerts(dm);
        const int numEdges = dm->getNumEdges(dm);
-       const int numFaces = dm->getNumFaces(dm);
+       const int numFaces = dm->getNumPolys(dm);
        int numLoops=0, newLoops=0, newFaces=0, newEdges=0;
        int j;