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


C++ Solid::write方法代码示例

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


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

示例1: main


//.........这里部分代码省略.........
	}
	//  [2/21/2013 Zhe]

	/************************************************************************/
	/* // 3.MST Algorithm [19:00/2/21/2013 Zhe]                                                                     */
	/************************************************************************/
	list<int> Mstqueue;
	queue<int> nLayer;
	list<int>::iterator mstiterator,Mstqueueiterator,Layeriterator;
	fiter.reset();
	int a[Num] = {0};

	Face *MSTface = *fiter;
	Mstqueue.push_back(MSTface->id());
	nLayer.push(MSTface->id()); //initialization
	a[MSTface->id()] = TRUE;
	while (!nLayer.empty())
	{
		int Faceid = nLayer.front();	
		nLayer.pop();
		//MstGraphface[Faceid].push_back(Faceid);
		for (mstiterator = Graphface[Faceid].begin();mstiterator != Graphface[Faceid].end();++mstiterator)
		{
			//Layeriterator = find (Mstqueue.begin(), Mstqueue.end(), *mstiterator);
			if (a[*mstiterator] == 0) 
			{
				Mstqueue.push_back(*mstiterator);
				nLayer.push(*mstiterator);
				a[*mstiterator] = TRUE;
				int nFaceid_father = Faceid;
				int nFaceId_son = *mstiterator;

				MeshLib::Face *f = mesh.idFace (nFaceid_father);
				MeshLib::FaceHalfedgeIterator fheiter(f);

				MeshLib::Edge * inter_edge;
				for (; !fheiter.end (); ++fheiter)
				{
					MeshLib::HalfEdge *he = *fheiter;
					he = he->he_sym ();
					if (he->face ()->id ()== nFaceId_son)
					{
						inter_edge=he->edge ();
						inter_edge->string () = std::string("");
						break;
					}
				}
			}
		}
	}



	// 3. cut the graph [23:19/2/21/2013 Zhe]
	SolidVertexIterator iter(&mesh);
	std::map<int, int> vidToObjID;

	do 
	{
		for(; !iter.end(); ++iter)
		{
			Vertex *v = *iter;
			MeshLib::VertexEdgeIterator edgeiter(v);
			MeshLib::Edge * inter_edge;
			int nsharp = 0;
			for (;!edgeiter.end();++edgeiter)
			{			
				inter_edge = *edgeiter;
				if (inter_edge->string() == "sharp")
				{
					nsharp++;
				}
			}


			//delete nsharp == 1
			if (1 == nsharp)
			{
				edgeiter.reset();
				for (;!edgeiter.end();++edgeiter)
				{			
					inter_edge = *edgeiter;
					if (inter_edge->string() == "sharp")
					{
						inter_edge->string () = std::string("");
						//nsharp = 0;
					}
				}

			}
			vidToObjID[v->id()] = nsharp;
		}
		iter.reset();

	} while (ifsharpequalone(vidToObjID));

	mesh.write (filename.c_str()); 

	//	os.close();
}
开发者ID:paperwhite,项目名称:Subdivision,代码行数:101,代码来源:Subdivision.cpp


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