本文整理汇总了C++中PatchMesh::getNumMapVerts方法的典型用法代码示例。如果您正苦于以下问题:C++ PatchMesh::getNumMapVerts方法的具体用法?C++ PatchMesh::getNumMapVerts怎么用?C++ PatchMesh::getNumMapVerts使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PatchMesh
的用法示例。
在下文中一共展示了PatchMesh::getNumMapVerts方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplyMapping
//.........这里部分代码省略.........
if (TVMaps.f[k]->flags & FLAG_CURVEDMAPPING)
{
patch.patches[k].flags &= ~PATCH_LINEARMAPPING;
if (TVMaps.f[k]->vecs)
{
for (int m = 0;m < TVMaps.f[k]->count;m++)
{
if (TVMaps.f[k]->flags & FLAG_INTERIOR)
{
tvFace[k].interiors[m] = TVMaps.f[k]->vecs->interiors[m];
}
tvFace[k].handles[m*2] = TVMaps.f[k]->vecs->handles[m*2];
tvFace[k].handles[m*2+1] = TVMaps.f[k]->vecs->handles[m*2+1];
}
}
}
else patch.patches[k].flags |= PATCH_LINEARMAPPING;
}
else{
tvFace[k].tv[0] = 0;
tvFace[k].tv[1] = 0;
tvFace[k].tv[2] = 0;
if (TVMaps.f[k]->count == 4) tvFace[k].tv[3] = 0;
for (int m = 0;m < TVMaps.f[k]->count;m++)
{
tvFace[k].interiors[m] = 0;
tvFace[k].handles[m*2] = 0;
tvFace[k].handles[m*2+1] = 0;
}
}
}
//match verts
patch.setNumMapVerts (mapChannel,TVMaps.v.Count());
PatchTVert *tVerts = patch.tVerts[mapChannel];
for (int k=0; k<TVMaps.v.Count(); k++)
tVerts[k].p = GetTVVert(k);
}
else
{
//copy into mesh struct
if (!tvFace)
{
// Create tvfaces and init to 0
patch.setNumMapPatches (mapChannel,patch.getNumPatches());
tvFace = patch.tvPatches[mapChannel];
for (int k=0; k<patch.getNumPatches(); k++)
{
for (int j=0; j<TVMaps.f[k]->count; j++)
{
tvFace[k].tv[j] = 0;
tvFace[k].interiors[j] = 0;
tvFace[k].handles[j*2] = 0;
tvFace[k].handles[j*2+1] = 0;
}
}
}
int offset = patch.getNumMapVerts (mapChannel);
for (int k=0; k<tvFaceCount; k++)
{
//copy if face is selected
if (patch.patchSel[k])
{
tvFace[k].tv[0] = TVMaps.f[k]->t[0]+offset;
tvFace[k].tv[1] = TVMaps.f[k]->t[1]+offset;
tvFace[k].tv[2] = TVMaps.f[k]->t[2]+offset;
if (TVMaps.f[k]->count == 4) tvFace[k].tv[3] = TVMaps.f[k]->t[3]+offset;
if (TVMaps.f[k]->flags & FLAG_CURVEDMAPPING)
{
patch.patches[k].flags &= ~PATCH_LINEARMAPPING;
if (TVMaps.f[k]->vecs)
{
for (int m = 0;m < TVMaps.f[k]->count;m++)
{
if (TVMaps.f[k]->flags & FLAG_INTERIOR)
{
tvFace[k].interiors[m] = TVMaps.f[k]->vecs->interiors[m]+offset;
}
tvFace[k].handles[m*2] = TVMaps.f[k]->vecs->handles[m*2]+offset;
tvFace[k].handles[m*2+1] = TVMaps.f[k]->vecs->handles[m*2+1]+offset;
}
}
}
else patch.patches[k].flags |= PATCH_LINEARMAPPING;
}
}
//match verts
patch.setNumMapVerts (mapChannel,TVMaps.v.Count()+offset,TRUE);
PatchTVert *tVerts = patch.tVerts[mapChannel];
for ( int k=0; k<TVMaps.v.Count(); k++)
tVerts[k+offset].p = GetTVVert(k);
}
RemoveDeadVerts(&patch,mapChannel);
}
示例2: SetCache
void MeshTopoData::SetCache(PatchMesh &patch, int mapChannel)
{
FreeCache();
this->patch = new PatchMesh(patch);
//build TVMAP and edge data
mFSelPrevious.SetSize(patch.patchSel.GetSize());
mFSelPrevious = patch.patchSel;
if ( (patch.selLevel==PATCH_PATCH) && (patch.patchSel.NumberSet() == 0) )
{
TVMaps.SetCountFaces(0);
TVMaps.v.SetCount(0);
TVMaps.FreeEdges();
TVMaps.FreeGeomEdges();
mVSel.SetSize(0);
mESel.SetSize(0);
mFSel.SetSize(0);
mGESel.SetSize(0);
mGVSel.SetSize(0);
return;
}
//loop through all maps
//get channel from mesh
TVMaps.channel = mapChannel;
//get from mesh based on cahne
PatchTVert *tVerts = NULL;
TVPatch *tvFace = NULL;
if (!patch.getMapSupport(mapChannel))
{
patch.setNumMaps(mapChannel+1);
}
tVerts = patch.tVerts[mapChannel];
tvFace = patch.tvPatches[mapChannel];
if (patch.selLevel!=PATCH_PATCH )
{
//copy into our structs
TVMaps.SetCountFaces(patch.getNumPatches());
TVMaps.v.SetCount(patch.getNumMapVerts(mapChannel));
mVSel.SetSize(patch.getNumMapVerts (mapChannel));
TVMaps.geomPoints.SetCount(patch.getNumVerts()+patch.getNumVecs());
for (int j=0; j<TVMaps.f.Count(); j++)
{
TVMaps.f[j]->flags = 0;
int pcount = 3;
if (patch.patches[j].type == PATCH_QUAD)
{
pcount = 4;
}
TVMaps.f[j]->t = new int[pcount];
TVMaps.f[j]->v = new int[pcount];
if (tvFace == NULL)
{
TVMaps.f[j]->t[0] = 0;
TVMaps.f[j]->t[1] = 0;
TVMaps.f[j]->t[2] = 0;
if (pcount ==4) TVMaps.f[j]->t[3] = 0;
TVMaps.f[j]->FaceIndex = j;
TVMaps.f[j]->MatID = patch.getPatchMtlIndex(j);
TVMaps.f[j]->flags = 0;
TVMaps.f[j]->count = pcount;
TVMaps.f[j]->vecs = NULL;
UVW_TVVectorClass *tempv = NULL;
//new an instance
if (!(patch.patches[j].flags & PATCH_AUTO))
TVMaps.f[j]->flags |= FLAG_INTERIOR;
if (!(patch.patches[j].flags & PATCH_LINEARMAPPING))
{
tempv = new UVW_TVVectorClass();
TVMaps.f[j]->flags |= FLAG_CURVEDMAPPING;
}
TVMaps.f[j]->vecs = tempv;
for (int k = 0; k < pcount; k++)
{
int index = patch.patches[j].v[k];
TVMaps.f[j]->v[k] = index;
TVMaps.geomPoints[index] = patch.verts[index].p;
//do handles and interiors
//.........这里部分代码省略.........