本文整理汇总了C++中MNMesh::FNum方法的典型用法代码示例。如果您正苦于以下问题:C++ MNMesh::FNum方法的具体用法?C++ MNMesh::FNum怎么用?C++ MNMesh::FNum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MNMesh
的用法示例。
在下文中一共展示了MNMesh::FNum方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplyMapping
void MeshTopoData::ApplyMapping(MNMesh &mesh, int mapChannel)
{
// allocate texture verts. Setup tv faces into a parallel
// topology as the regular faces
int numMaps = mesh.MNum ();
if (mapChannel >= numMaps)
{
mesh.SetMapNum(mapChannel+1);
mesh.InitMap(mapChannel);
}
MNMapFace *tvFace = mesh.M(mapChannel)->f;
if (!tvFace)
{
mesh.InitMap(mapChannel);
tvFace = mesh.M(mapChannel)->f;
}
int tvFaceCount = mesh.FNum();
if (mesh.selLevel!=MNM_SL_FACE)
{
//copy into mesh struct
for (int k=0; k<tvFaceCount; k++)
{
if (k < TVMaps.f.Count())
{
for (int m = 0; m< TVMaps.f[k]->count; m++)
tvFace[k].tv[m] = TVMaps.f[k]->t[m];
}
else
{
for (int m = 0; m< TVMaps.f[k]->count; m++)
tvFace[k].tv[m] = 0;
}
}
//match verts
mesh.M(mapChannel)->setNumVerts( TVMaps.v.Count());
Point3 *tVerts = mesh.M(mapChannel)->v;
for ( int k=0; k<TVMaps.v.Count(); k++)
{
tVerts[k] = GetTVVert(k);
}
}
else
{
//copy into mesh struct
//check if mesh has existing tv faces
int offset = mesh.M(mapChannel)->VNum();
int current = 0;
BitArray s;
mesh.getFaceSel(s);
for (int k=0; k<tvFaceCount; k++)
{
//copy if face is selected
if (s[k]==1)
{
for (int m = 0; m< TVMaps.f[k]->count; m++)
tvFace[k].tv[m] = TVMaps.f[k]->t[m] + offset;
}
}
//add our verts
for ( int k=0; k<TVMaps.v.Count(); k++)
mesh.M(mapChannel)->NewVert( GetTVVert(k));
}
mesh.M(mapChannel)->CollapseDeadVerts(mesh.f);
}
示例2: SetCache
void MeshTopoData::SetCache(MNMesh &mesh, int mapChannel)
{
FreeCache();
this->mnMesh = new MNMesh(mesh);
TVMaps.channel = mapChannel;
BitArray s;
mesh.getFaceSel(s);
mesh.getFaceSel(mFSelPrevious);
if ( (mesh.selLevel==MNM_SL_FACE) && (s == 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;
}
//get from mesh based on cahne
int numMaps = mesh.MNum ();
MNMapFace *tvFace=NULL;
Point3 *tVerts = NULL;
if (mapChannel >= numMaps)
{
}
else
{
tvFace = mesh.M(mapChannel)->f;
tVerts = mesh.M(mapChannel)->v;
}
if (mesh.selLevel!=MNM_SL_FACE)
{
//copy into our structs
TVMaps.SetCountFaces(mesh.FNum());
if (tVerts)
{
TVMaps.v.SetCount(mesh.M(mapChannel)->VNum());
mVSel.SetSize(mesh.M(mapChannel)->VNum());
}
else
{
TVMaps.v.SetCount(mesh.VNum());
mVSel.SetSize(mesh.VNum());
}
TVMaps.geomPoints.SetCount(mesh.VNum());
for (int j=0; j<TVMaps.f.Count(); j++)
{
TVMaps.f[j]->flags = 0;
int fct;
fct = mesh.f[j].deg;
if (mesh.f[j].GetFlag(MN_DEAD)) fct = 0;
if (fct > 0)
{
TVMaps.f[j]->t = new int[fct];
TVMaps.f[j]->v = new int[fct];
}
else
{
TVMaps.f[j]->t = NULL;
TVMaps.f[j]->v = NULL;
}
if (tvFace == NULL)
{
for (int k=0; k < fct;k++)
TVMaps.f[j]->t[k] = 0;
TVMaps.f[j]->FaceIndex = j;
TVMaps.f[j]->MatID = mesh.f[j].material;
TVMaps.f[j]->flags = 0;
TVMaps.f[j]->count = fct;
for (int k = 0; k < fct; k++)
{
int index = mesh.f[j].vtx[k];
TVMaps.f[j]->v[k] = index;
TVMaps.geomPoints[index] = mesh.v[index].p;
}
}
else
{
for (int k=0; k < fct;k++)
TVMaps.f[j]->t[k] = tvFace[j].tv[k];
TVMaps.f[j]->FaceIndex = j;
TVMaps.f[j]->MatID = mesh.f[j].material;
//.........这里部分代码省略.........