本文整理汇总了C++中MNMesh::ClearMap方法的典型用法代码示例。如果您正苦于以下问题:C++ MNMesh::ClearMap方法的具体用法?C++ MNMesh::ClearMap怎么用?C++ MNMesh::ClearMap使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MNMesh
的用法示例。
在下文中一共展示了MNMesh::ClearMap方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ModifyObject
void MapChannelDelete::ModifyObject(TimeValue t, ModContext &mc, ObjectState * os, INode *node)
{
//TODO: Add the code for actually modifying the object
//get th map id
int mapID;
pblock->GetValue(pb_mapid,0,mapID,FOREVER);
Mesh *mesh = NULL;
MNMesh *mnmesh = NULL;
PatchMesh *pmesh = NULL;
TriObject *collapsedtobj = NULL;
if (os->obj->IsSubClassOf(triObjectClassID))
{
TriObject *tobj = (TriObject*)os->obj;
mesh = &tobj->GetMesh();
}
else if (os->obj->IsSubClassOf(polyObjectClassID))
{
PolyObject *pobj = (PolyObject*)os->obj;
mnmesh = &pobj->GetMesh();
}
else if (os->obj->IsSubClassOf(patchObjectClassID))
{
PatchObject *pobj = (PatchObject*)os->obj;
pmesh = &pobj->patch;
}
if (mnmesh)
{
int numMaps = mnmesh->numm;
if (mapID < numMaps)
{
mnmesh->M(mapID)->Clear();
mnmesh->ClearMap(mapID);
}
//if last channel reduce the number of channels
if ((numMaps-1) == mapID)
{
if (mapID >= 0)
mnmesh->SetMapNum(mapID);
}
}
else if (mesh)
{
int numMaps = mesh->getNumMaps();
if (mesh->mapSupport(mapID))
{
mesh->setNumMapVerts(mapID, 0);
mesh->setMapSupport(mapID, FALSE);
}
//if last channel reduce the number of channels
if ((numMaps-1) == mapID)
{
mesh->setNumMaps((numMaps-1), TRUE);
}
}
else if (pmesh)
{
int numMaps = pmesh->getNumMaps();
if (pmesh->getMapSupport(mapID))
{
// pmesh->setNumMapVerts(mapID, 0);
// pmesh->setNumMapPatches(mapID, 0);
pmesh->setMapSupport(mapID, FALSE);
}
//if last channel reduce the number of channels
if ((numMaps-1) == mapID)
{
if ((numMaps-1) >= 1)
pmesh->setNumMaps((numMaps-1), TRUE);
}
}
Interval iv;
iv = FOREVER;
os->obj->PointsWereChanged();
//.........这里部分代码省略.........