本文整理汇总了C++中PatchMesh::HookFixTopology方法的典型用法代码示例。如果您正苦于以下问题:C++ PatchMesh::HookFixTopology方法的具体用法?C++ PatchMesh::HookFixTopology怎么用?C++ PatchMesh::HookFixTopology使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PatchMesh
的用法示例。
在下文中一共展示了PatchMesh::HookFixTopology方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ResolveTopoChanges
// Selection set, misc fixup utility function
// This depends on PatchMesh::RecordTopologyTags being called prior to the topo changes
void EditPatchMod::ResolveTopoChanges()
{
ModContextList mcList;
INodeTab nodes;
TimeValue t = ip->GetTime();
ip->GetModContexts(mcList, nodes);
ClearPatchDataFlag(mcList, EPD_BEENDONE);
for (int i = 0; i < mcList.Count(); i++)
{
EditPatchData *patchData =(EditPatchData*)mcList[i]->localData;
if (!patchData)
continue;
if (patchData->GetFlag(EPD_BEENDONE))
continue;
// If the mesh isn't yet cache, this will cause it to get cached.
RPatchMesh *rpatch;
PatchMesh *patch = patchData->TempData(this)->GetPatch(t, rpatch);
if (!patch)
continue;
// First, the vertex selections
int set;
for (set = 0; set < patchData->vselSet.Count(); ++set)
{
BitArray *oldVS = &patchData->vselSet[set];
BitArray newVS;
newVS.SetSize(patch->numVerts);
for (int vert = 0; vert < patch->numVerts; ++vert)
{
// Get the knot's previous location, then copy that selection into the new set
int tag = patch->verts[vert].aux1;
if (tag >= 0)
newVS.Set(vert, (*oldVS)[tag]);
else
newVS.Clear(vert);
}
if (theHold.Holding())
theHold.Put(new ChangeNamedSetRestore(&patchData->vselSet, set, oldVS));
patchData->vselSet[set] = newVS;
}
// Now the edge selections
for (set = 0; set < patchData->eselSet.Count(); ++set)
{
BitArray *oldES = &patchData->eselSet[set];
BitArray newES;
newES.SetSize(patch->numEdges);
for (int edge = 0; edge < patch->numEdges; ++edge)
{
// Get the knot's previous location, then copy that selection into the new set
int tag = patch->edges[edge].aux1;
if (tag >= 0)
newES.Set(edge, (*oldES)[tag]);
else
newES.Clear(edge);
}
if (theHold.Holding())
theHold.Put(new ChangeNamedSetRestore(&patchData->eselSet, set, oldES));
patchData->eselSet[set] = newES;
}
// Now the patch selections
for (set = 0; set < patchData->pselSet.Count(); ++set)
{
BitArray *oldPS = &patchData->pselSet[set];
BitArray newPS;
newPS.SetSize(patch->numPatches);
for (int p = 0; p < patch->numPatches; ++p)
{
// Get the knot's previous location, then copy that selection into the new set
int tag = patch->patches[p].aux1;
if (tag >= 0)
newPS.Set(p, (*oldPS)[tag]);
else
newPS.Clear(p);
}
if (theHold.Holding())
theHold.Put(new ChangeNamedSetRestore(&patchData->pselSet, set, oldPS));
patchData->pselSet[set] = newPS;
}
// watje 4-16-99
patch->HookFixTopology();
patchData->SetFlag(EPD_BEENDONE, TRUE);
}
nodes.DisposeTemporary();
ClearPatchDataFlag(mcList, EPD_BEENDONE);
}