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


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

本文整理汇总了C++中MNMesh::ClearVFlags方法的典型用法代码示例。如果您正苦于以下问题:C++ MNMesh::ClearVFlags方法的具体用法?C++ MNMesh::ClearVFlags怎么用?C++ MNMesh::ClearVFlags使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MNMesh的用法示例。


在下文中一共展示了MNMesh::ClearVFlags方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SlicePolyObject

void SymmetryMod::SlicePolyObject (MNMesh & mesh, Point3 & N, float offset) {
	// Steve Anderson 9/14/2002
	// Using the new "MN_MESH_TEMP_1" flag to override Slice selection behavior,
	// which is undesirable here.
	mesh.SetFlag (MN_MESH_TEMP_1);
	// Slice off everything below the plane:
	mesh.Slice (N, offset, MNEPS, false, true);
	mesh.ClearFlag (MN_MESH_TEMP_1);

	// Make sure we have a valid edge list:
	if (!mesh.GetFlag (MN_MESH_FILLED_IN)) mesh.FillInMesh();

	// Mark the vertices on the plane boundary:
	mesh.ClearVFlags (MN_USER);
	for (int i=0; i<mesh.numv; i++) {
		if (mesh.v[i].GetFlag (MN_DEAD)) continue;
		float dist = DotProd (N, mesh.P(i)) - offset;
		if (fabsf(dist) > MNEPS) continue;
		mesh.v[i].SetFlag (MN_USER);
	}

	// Strip out faces on the mirror plane:  (These aren't always removed by slice.)
	// Find the faces that use only mirror-plane vertices:
	mesh.ClearFFlags (MN_USER);
	mesh.PropegateComponentFlags (MNM_SL_FACE, MN_USER,
		MNM_SL_VERTEX, MN_USER, true);
	mesh.DeleteFlaggedFaces (MN_USER);

	// Clear out dead components:
	mesh.CollapseDeadStructs ();
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:31,代码来源:Symmetry.cpp

示例2: SetPolyFlags

void VWeldMod::SetPolyFlags (MNMesh & mesh, DWORD flag) {
	// Convert existing selection (at whatever level) to vertex selection:
	mesh.ClearVFlags (flag);
	if (mesh.selLevel == MNM_SL_OBJECT) {
		for (int i=0; i<mesh.numv; i++) mesh.v[i].SetFlag (flag);
	} else {
		mesh.PropegateComponentFlags (MNM_SL_VERTEX, flag, mesh.selLevel, MN_SEL);
	}
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:9,代码来源:vweld.cpp

示例3: WeldPolyObject

void SymmetryMod::WeldPolyObject (MNMesh & mesh, Point3 & N, float offset, float threshold) {
	// Mark the vertices within the welding threshold of the plane:
	mesh.ClearVFlags (MN_USER);
	for (int i=0; i<mesh.numv; i++) {
		if (mesh.v[i].GetFlag (MN_DEAD)) continue;
		float dist = DotProd (N, mesh.P(i)) - offset;
		if (fabsf(dist) > threshold) continue;
		mesh.v[i].SetFlag (MN_USER);
	}

	// Do the welding:
	if (mesh.WeldBorderVerts (threshold, MN_USER)) {
		// If result was true, we have some MN_DEAD components:
		mesh.CollapseDeadStructs ();
	}
}
开发者ID:innovatelogic,项目名称:ilogic-vm,代码行数:16,代码来源:Symmetry.cpp

示例4: ModifyObject

void SelectByChannel::ModifyObject(TimeValue t, ModContext &mc, ObjectState * os, INode *node) 
{
	//TODO: Add the code for actually modifying the object

	//get th map id

	
//	TriObject *tobj = (TriObject*)os->obj;
//	Mesh &mesh = tobj->GetMesh();		

	Mesh *mesh = NULL;
	MNMesh *mnmesh = 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();
	}



	int mapID;
	int subID;

	int selType;

	pblock->GetValue(pb_mapid,0,mapID,FOREVER);
	pblock->GetValue(pb_mapsubid,0,subID,FOREVER);

	pblock->GetValue(pb_seltype,0,selType,FOREVER);

	if (subID < 0) subID = 0;
	if (subID > 2) subID = 2;
	
	
	if (mnmesh)
	{
		
		int numMaps = mnmesh->numm;

		mnmesh->dispFlags = MNDISP_VERTTICKS|MNDISP_SELVERTS ;
		mnmesh->selLevel = MNM_SL_VERTEX;

		if (mapID < numMaps)
		
		{
			UVVert *uvw = mnmesh->M(mapID)->v;
			MNMapFace *uvwFace = mnmesh->M(mapID)->f;
			if (uvw && uvwFace)
				
			{
				float *vsw = NULL;

				MNFace *face = mnmesh->f;

					

				vsw = mnmesh->getVSelectionWeights ();

				if (vsw == NULL)
				{
					mnmesh->SupportVSelectionWeights();
					vsw = mnmesh->getVSelectionWeights ();
				}

				BitArray processed;
				processed.SetSize(mnmesh->numv);
				processed.ClearAll();

				if (vsw && uvwFace && uvw)
				{
					if (selType == 0)
					{
						mnmesh->ClearVFlags (MN_SEL);
						for (int i = 0; i < mnmesh->numv; i++)
							vsw[i] = 0.0f;
					}

					for (int i = 0; i < mnmesh->numf; i++)
					{
						int deg = face[i].deg;
						for (int j = 0; j < deg; j++)
						{
							
							int index = uvwFace[i].tv[j];
							int gindex = face[i].vtx[j];
							if (!processed[gindex])
							{
								processed.Set(gindex);
								if (selType == 0)
								{	
									float w = uvw[index][subID];
									if (w >= 1.0f)
										mnmesh->v[gindex].SetFlag (MN_SEL);
//.........这里部分代码省略.........
开发者ID:DimondTheCat,项目名称:xray,代码行数:101,代码来源:SelectByChannel.cpp

示例5: ModifyObject


//.........这里部分代码省略.........
						for (int i = 0; i < buffer.numFaces; i++)
						{
							geomFace[i] = *buffer.geomMNFaces[i];
						}
					}
					else
					{
						for (int i = 0; i < buffer.numFaces; i++)
						{
							geomFace[i].MakePoly(buffer.uvwMNFaces[i]->deg,buffer.uvwMNFaces[i]->tv);
					//		geomFace[i].v[0] = buffer.uvwMNFaces[i].t[0];
					//		geomFace[i].v[1] = buffer.uvwMNFaces[i].t[1];
					//		geomFace[i].v[2] = buffer.uvwMNFaces[i].t[2];
						}

					}

				}

				else if ((buffer.pasteToChannelType == POLYSELCHANNEL) || (buffer.pasteToChannelType == CHANNEL_SEL))
				{
					MNVert *verts = mnmesh->v;
					MNFace *geomFace = mnmesh->f;

					mnmesh->SupportVSelectionWeights();


					

					float *vsw = NULL;

					vsw = mnmesh->getVSelectionWeights ();

					mnmesh->ClearVFlags (MN_SEL);

//					mesh->vertSel.ClearAll();

/*					for (int i = 0; i < buffer.w.Count(); i++)
					{
						if (vsw)
						{
							vsw[i] = buffer.w[i];
							if (vsw[i] >= 1.0f)
								mnmesh->v[i].SetFlag (MN_SEL);
								
						}
					}
*/					

					if ((buffer.copyType == POLYMESH_GEOM) || (buffer.copyType == POLYMESH_SEL))
					{
						for (int i = 0; i < buffer.numFaces; i++)
						{
//							geomFace[i] = *buffer.geomMNFaces[i];
							for (int k = 0; k < geomFace[i].deg; k++)
							{
//								geomFace[i].vtx[k] = buffer.uvwMNFaces[i]->tv[k];
								int id = buffer.geomMNFaces[i]->vtx[k];
								int gid = geomFace[i].vtx[k];
								if (vsw)
								{
									vsw[gid] = buffer.w[id];								
								}
							}

						}
开发者ID:artemeliy,项目名称:inf4715,代码行数:67,代码来源:MapChannelPaste.cpp


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