当前位置: 首页>>代码示例>>C++>>正文


C++ MNMesh::ClearMap方法代码示例

本文整理汇总了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();

//.........这里部分代码省略.........
开发者ID:DimondTheCat,项目名称:xray,代码行数:101,代码来源:MapChannelDelete.cpp


注:本文中的MNMesh::ClearMap方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。