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