本文整理汇总了C++中MNMesh::FAlloc方法的典型用法代码示例。如果您正苦于以下问题:C++ MNMesh::FAlloc方法的具体用法?C++ MNMesh::FAlloc怎么用?C++ MNMesh::FAlloc使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MNMesh
的用法示例。
在下文中一共展示了MNMesh::FAlloc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplyAllOperations
void EditPolyData::ApplyAllOperations (MNMesh & mesh)
{
#ifdef __DEBUG_PRINT_EDIT_POLY
DebugPrint (_T("EditPolyData::ApplyAllOperations\n"));
#endif
if (mpOpList) {
// Preallocate if possible. (Upon first application, this will do nothing.)
PolyOperationRecord* pOpRec = NULL;
int newFaces(0), newVertices(0), newEdges(0);
Tab<int> newMapVertices;
newMapVertices.SetCount (mesh.numm + NUM_HIDDENMAPS);
for (int mp=-NUM_HIDDENMAPS; mp<mesh.numm; mp++) newMapVertices[mp+NUM_HIDDENMAPS] = 0;
for (pOpRec=mpOpList; pOpRec != NULL; pOpRec=pOpRec->Next()) {
newFaces += pOpRec->Operation()->NewFaceCount();
newVertices += pOpRec->Operation()->NewVertexCount();
newEdges += pOpRec->Operation()->NewEdgeCount ();
for (int mp=-NUM_HIDDENMAPS; mp<mesh.numm; mp++) {
if (mesh.M(mp)->GetFlag (MN_DEAD)) continue;
newMapVertices[mp+NUM_HIDDENMAPS] += pOpRec->Operation()->NewMapVertexCount(mp);
}
}
mesh.VAlloc (mesh.numv + newVertices);
mesh.EAlloc (mesh.nume + newEdges);
mesh.FAlloc (mesh.numf + newFaces);
for (int mp=-NUM_HIDDENMAPS; mp<mesh.numm; mp++) {
MNMap *map = mesh.M(mp);
if (map->GetFlag (MN_DEAD)) continue;
map->VAlloc (map->numv + newMapVertices[mp+NUM_HIDDENMAPS]);
map->FAlloc (map->numf + newFaces);
}
for (pOpRec=mpOpList; pOpRec != NULL; pOpRec=pOpRec->Next())
{
#ifdef __DEBUG_PRINT_EDIT_POLY
DebugPrint (_T("EditPolyData::Applying %s\n"), pOpRec->Operation()->Name());
#endif
pOpRec->Operation()->SetUserFlags (mesh);
bool ret = pOpRec->Operation()->Apply (mesh, pOpRec->LocalData());
if (ret && pOpRec->Operation()->CanDelete()) mesh.CollapseDeadStructs ();
}
}
}