Rename DM *_face_* funcs to be either *_tessface_* or *_poly_* to avoid confusion

This is the first step in a few changes to cleanup confusing/missing DM funcs
This commit is contained in:
Andrew Wiggin 2011-11-29 05:09:54 +00:00
parent f2551ff799
commit 4e86b48cbd
10 changed files with 28 additions and 40 deletions

@ -447,7 +447,7 @@ void DM_add_tessface_layer(struct DerivedMesh *dm, int type, int alloctype,
void *layer);
void DM_add_loop_layer(DerivedMesh *dm, int type, int alloctype,
void *layer);
void DM_add_face_layer(struct DerivedMesh *dm, int type, int alloctype,
void DM_add_poly_layer(struct DerivedMesh *dm, int type, int alloctype,
void *layer);
/* custom data access functions
@ -457,7 +457,7 @@ void DM_add_face_layer(struct DerivedMesh *dm, int type, int alloctype,
*/
void *DM_get_vert_data(struct DerivedMesh *dm, int index, int type);
void *DM_get_edge_data(struct DerivedMesh *dm, int index, int type);
void *DM_get_face_data(struct DerivedMesh *dm, int index, int type);
void *DM_get_tessface_data(struct DerivedMesh *dm, int index, int type);
/* custom data layer access functions
* return pointer to first data layer which matches type (a flat array)
@ -467,7 +467,7 @@ void *DM_get_face_data(struct DerivedMesh *dm, int index, int type);
void *DM_get_vert_data_layer(struct DerivedMesh *dm, int type);
void *DM_get_edge_data_layer(struct DerivedMesh *dm, int type);
void *DM_get_tessface_data_layer(struct DerivedMesh *dm, int type);
void *DM_get_face_data_layer(struct DerivedMesh *dm, int type);
void *DM_get_poly_data_layer(struct DerivedMesh *dm, int type);
/* custom data setting functions
* copy supplied data into first layer of type using layer's copy function
@ -475,7 +475,7 @@ void *DM_get_face_data_layer(struct DerivedMesh *dm, int type);
*/
void DM_set_vert_data(struct DerivedMesh *dm, int index, int type, void *data);
void DM_set_edge_data(struct DerivedMesh *dm, int index, int type, void *data);
void DM_set_face_data(struct DerivedMesh *dm, int index, int type, void *data);
void DM_set_tessface_data(struct DerivedMesh *dm, int index, int type, void *data);
/* custom data copy functions
* copy count elements from source_index in source to dest_index in dest
@ -489,7 +489,7 @@ void DM_copy_tessface_data(struct DerivedMesh *source, struct DerivedMesh *dest,
int source_index, int dest_index, int count);
void DM_copy_loop_data(struct DerivedMesh *source, struct DerivedMesh *dest,
int source_index, int dest_index, int count);
void DM_copy_face_data(struct DerivedMesh *source, struct DerivedMesh *dest,
void DM_copy_poly_data(struct DerivedMesh *source, struct DerivedMesh *dest,
int source_index, int dest_index, int count);
/* custom data free functions
@ -500,7 +500,7 @@ void DM_free_vert_data(struct DerivedMesh *dm, int index, int count);
void DM_free_edge_data(struct DerivedMesh *dm, int index, int count);
void DM_free_tessface_data(struct DerivedMesh *dm, int index, int count);
void DM_free_loop_data(struct DerivedMesh *dm, int index, int count);
void DM_free_face_data(struct DerivedMesh *dm, int index, int count);
void DM_free_poly_data(struct DerivedMesh *dm, int index, int count);
/*sets up mpolys for a DM based on face iterators in source*/
void DM_DupPolys(DerivedMesh *source, DerivedMesh *target);
@ -545,7 +545,7 @@ void DM_interp_loop_data(struct DerivedMesh *source, struct DerivedMesh *dest,
int *src_indices,
float *weights, int count, int dest_index);
void DM_interp_face_data(struct DerivedMesh *source, struct DerivedMesh *dest,
void DM_interp_poly_data(struct DerivedMesh *source, struct DerivedMesh *dest,
int *src_indices,
float *weights, int count, int dest_index);

@ -254,7 +254,7 @@ void DM_init_funcs(DerivedMesh *dm)
dm->getVertData = DM_get_vert_data;
dm->getEdgeData = DM_get_edge_data;
dm->getTessFaceData = DM_get_face_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;
@ -496,7 +496,7 @@ void DM_add_loop_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
CustomData_add_layer(&dm->loopData, type, alloctype, layer, dm->numLoopData);
}
void DM_add_face_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
void DM_add_poly_layer(DerivedMesh *dm, int type, int alloctype, void *layer)
{
CustomData_add_layer(&dm->polyData, type, alloctype, layer, dm->numPolyData);
}
@ -511,7 +511,7 @@ void *DM_get_edge_data(DerivedMesh *dm, int index, int type)
return CustomData_get(&dm->edgeData, index, type);
}
void *DM_get_face_data(DerivedMesh *dm, int index, int type)
void *DM_get_tessface_data(DerivedMesh *dm, int index, int type)
{
return CustomData_get(&dm->faceData, index, type);
}
@ -540,7 +540,7 @@ void *DM_get_tessface_data_layer(DerivedMesh *dm, int type)
return CustomData_get_layer(&dm->faceData, type);
}
void *DM_get_face_data_layer(DerivedMesh *dm, int type)
void *DM_get_poly_data_layer(DerivedMesh *dm, int type)
{
return CustomData_get_layer(&dm->polyData, type);
}
@ -555,7 +555,7 @@ void DM_set_edge_data(DerivedMesh *dm, int index, int type, void *data)
CustomData_set(&dm->edgeData, index, type, data);
}
void DM_set_face_data(DerivedMesh *dm, int index, int type, void *data)
void DM_set_tessface_data(DerivedMesh *dm, int index, int type, void *data)
{
CustomData_set(&dm->faceData, index, type, data);
}
@ -588,7 +588,7 @@ void DM_copy_loop_data(DerivedMesh *source, DerivedMesh *dest,
source_index, dest_index, count);
}
void DM_copy_face_data(DerivedMesh *source, DerivedMesh *dest,
void DM_copy_poly_data(DerivedMesh *source, DerivedMesh *dest,
int source_index, int dest_index, int count)
{
CustomData_copy_data(&source->polyData, &dest->polyData,
@ -615,7 +615,7 @@ void DM_free_loop_data(struct DerivedMesh *dm, int index, int count)
CustomData_free_elem(&dm->loopData, index, count);
}
void DM_free_face_data(struct DerivedMesh *dm, int index, int count)
void DM_free_poly_data(struct DerivedMesh *dm, int index, int count)
{
CustomData_free_elem(&dm->polyData, index, count);
}
@ -659,7 +659,7 @@ void DM_interp_loop_data(DerivedMesh *source, DerivedMesh *dest,
weights, NULL, count, dest_index);
}
void DM_interp_face_data(DerivedMesh *source, DerivedMesh *dest,
void DM_interp_poly_data(DerivedMesh *source, DerivedMesh *dest,
int *src_indices,
float *weights, int count, int dest_index)
{
@ -1306,11 +1306,11 @@ static void mesh_calc_modifiers(Scene *scene, Object *ob, float (*inputVertexCos
/* calc */
DM_add_vert_layer(dm, CD_ORIGINDEX, CD_CALLOC, NULL);
DM_add_edge_layer(dm, CD_ORIGINDEX, CD_CALLOC, NULL);
DM_add_face_layer(dm, CD_ORIGINDEX, CD_CALLOC, NULL);
DM_add_poly_layer(dm, CD_ORIGINDEX, CD_CALLOC, NULL);
range_vn_i(DM_get_vert_data_layer(dm, CD_ORIGINDEX), dm->numVertData, 0);
range_vn_i(DM_get_edge_data_layer(dm, CD_ORIGINDEX), dm->numEdgeData, 0);
range_vn_i(DM_get_face_data_layer(dm, CD_ORIGINDEX), dm->numPolyData, 0);
range_vn_i(DM_get_poly_data_layer(dm, CD_ORIGINDEX), dm->numPolyData, 0);
}
if((dataMask & CD_MASK_WEIGHT_MCOL) && (ob->mode & OB_MODE_WEIGHT_PAINT))

@ -1641,12 +1641,6 @@ static CDDerivedMesh *cdDM_create(const char *desc)
dm->copyTessFaceArray = cdDM_copyFaceArray;
dm->copyLoopArray = cdDM_copyLoopArray;
dm->copyPolyArray = cdDM_copyPolyArray;
dm->getVertData = DM_get_vert_data;
dm->getEdgeData = DM_get_edge_data;
dm->getTessFaceData = DM_get_face_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;

@ -562,7 +562,7 @@ static int ss_sync_from_derivedmesh(CCGSubSurf *ss, DerivedMesh *dm,
}
mp = mpoly;
index = DM_get_face_data_layer(dm, CD_ORIGINDEX);
index = DM_get_poly_data_layer(dm, CD_ORIGINDEX);
for (i=0; i<dm->numPolyData; i++, mp++) {
CCGFace *f=NULL;
@ -2828,9 +2828,6 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->dm.copyTessFaceArray = ccgDM_copyFinalFaceArray;
ccgdm->dm.copyLoopArray = ccgDM_copyFinalLoopArray;
ccgdm->dm.copyPolyArray = ccgDM_copyFinalPolyArray;
ccgdm->dm.getVertData = DM_get_vert_data;
ccgdm->dm.getEdgeData = DM_get_edge_data;
ccgdm->dm.getTessFaceData = DM_get_face_data;
ccgdm->dm.getVertDataArray = ccgDM_get_vert_data_layer;
ccgdm->dm.getEdgeDataArray = ccgDM_get_edge_data_layer;
ccgdm->dm.getTessFaceDataArray = ccgDM_get_face_data_layer;
@ -2846,9 +2843,6 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
ccgdm->dm.copyVertArray = ccgDM_copyFinalVertArray;
ccgdm->dm.copyEdgeArray = ccgDM_copyFinalEdgeArray;
ccgdm->dm.copyTessFaceArray = ccgDM_copyFinalFaceArray;
ccgdm->dm.getVertData = DM_get_vert_data;
ccgdm->dm.getEdgeData = DM_get_edge_data;
ccgdm->dm.getTessFaceData = DM_get_face_data;
ccgdm->dm.calcNormals = ccgDM_calcNormals;
ccgdm->dm.recalcTesselation = ccgDM_recalcTesselection;
@ -2938,7 +2932,7 @@ static CCGDerivedMesh *getCCGDerivedMesh(CCGSubSurf *ss,
/*edgeOrigIndex = DM_get_edge_data_layer(&cgdm->dm, CD_ORIGINDEX);*/
faceOrigIndex = DM_get_tessface_data_layer(&ccgdm->dm, CD_ORIGINDEX);
polyOrigIndex = DM_get_face_data_layer(&ccgdm->dm, CD_ORIGINDEX);
polyOrigIndex = DM_get_poly_data_layer(&ccgdm->dm, CD_ORIGINDEX);
#if 0
/* this is not in trunk, can gives problems because colors initialize

@ -128,7 +128,7 @@ struct BMVert *BM_Make_Vert ( struct BMesh *bm, const float co[3], const struct
struct BMEdge *BM_Make_Edge ( struct BMesh *bm, struct BMVert *v1, struct BMVert *v2, const struct BMEdge *example, int nodouble );
struct BMFace *BM_Make_Quadtriangle ( struct BMesh *bm, struct BMVert **verts, BMEdge **edges, int len, const struct BMFace *example, int nodouble );
BMFace *BM_Make_Face(BMesh *bm, BMVert **verts, BMEdge **edges, int len, int nodouble);
BMFace *BM_Make_Face(BMesh *bm, BMVert **verts, BMEdge **edges, const int len, int nodouble);
/*more easier to use version of BM_Make_Quadtriangle.
creates edges if necassary.*/

@ -430,7 +430,7 @@ static int draw_tface__set_draw(MTFace *tface, int has_mcol, int matnr)
}
static void add_tface_color_layer(DerivedMesh *dm)
{
MTFace *tface = DM_get_face_data_layer(dm, CD_MTFACE);
MTFace *tface = DM_get_poly_data_layer(dm, CD_MTFACE);
MFace *mface = dm->getTessFaceArray(dm);
MCol *finalCol;
int i,j;

@ -3039,7 +3039,7 @@ static void draw_mesh_fancy(Scene *scene, ARegion *ar, View3D *v3d, RegionView3D
DynamicPaintModifierData *pmd = (DynamicPaintModifierData *)md;
/* if canvas is ready to preview vertex colors */
if (pmd->canvas && pmd->canvas->flags & MOD_DPAINT_PREVIEW_READY &&
DM_get_face_data_layer(dm, CD_WEIGHT_MCOL)) {
DM_get_poly_data_layer(dm, CD_WEIGHT_MCOL)) {
draw_flags |= DRAW_DYNAMIC_PAINT_PREVIEW;
}
}

@ -264,7 +264,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *UNUSED(ob),
source = mpolys + faceMap[i];
dest = mpolyd + i;
DM_copy_face_data(dm, result, faceMap[i], i, 1);
DM_copy_poly_data(dm, result, faceMap[i], i, 1);
*dest = *source;
dest->loopstart = k;

@ -291,7 +291,7 @@ static DerivedMesh * applyModifier(ModifierData *md, Object *ob,
}
inMF = orig_mface + i%totface;
DM_copy_face_data(dm, result, i%totface, i, 1);
DM_copy_poly_data(dm, result, i%totface, i, 1);
*mf = *inMF;
mf->v1+=(i/totface)*totvert;

@ -348,8 +348,8 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
DM_copy_loop_data(dm, result, 0, 0, numLoops);
DM_copy_loop_data(dm, result, 0, numLoops, numLoops);
DM_copy_face_data(dm, result, 0, 0, numFaces);
DM_copy_face_data(dm, result, 0, numFaces, numFaces);
DM_copy_poly_data(dm, result, 0, 0, numFaces);
DM_copy_poly_data(dm, result, 0, numFaces, numFaces);
/*flip normals*/
mp = mpoly + numFaces;
@ -567,7 +567,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
/* faces */
edge_origIndex = origindex;
origindex = DM_get_face_data_layer(result, CD_ORIGINDEX);
origindex = DM_get_poly_data_layer(result, CD_ORIGINDEX);
mp = mpoly + (numFaces * 2);
ml = mloop + (numLoops * 2);
@ -589,7 +589,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob,
ed= medge + eidx;
/* copy most of the face settings */
DM_copy_face_data(dm, result, fidx, (numFaces * 2) + i, 1);
DM_copy_poly_data(dm, result, fidx, (numFaces * 2) + i, 1);
mp->loopstart = j+numLoops*2;
mp->flag = mpoly[fidx].flag;
mp->totloop = 4;