本文整理汇总了C++中HalfEdge::vertex方法的典型用法代码示例。如果您正苦于以下问题:C++ HalfEdge::vertex方法的具体用法?C++ HalfEdge::vertex怎么用?C++ HalfEdge::vertex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HalfEdge
的用法示例。
在下文中一共展示了HalfEdge::vertex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TraceBoundary
void Curve::TraceBoundary(HalfEdge * startHe, Vertex * endV)
{
HalfEdge * che = startHe;
if (!che->source()->boundary() || !che->target()->boundary())
{
std::cerr << "Error: the input halfedge is not on the boundary!" << std::endl;
return;
}
bool ccw;
Vertex * ver = che->source();
HalfEdge * the = ver->most_ccw_out_halfedge();
if (the == che)
{ //Possiblly ccw is right, except the case that there is only one out halfedge starting from ver
//in that case, check one more step forward is enough
HalfEdge * tempthe = the->target()->most_ccw_out_halfedge();
if (tempthe->edge()->boundary())
ccw = true;
else
{
assert(ver->most_ccw_out_halfedge() == ver->most_clw_out_halfedge());
ccw = false;
}
}
else
{
ccw = false;
the = ver->most_clw_out_halfedge();
assert(the == che);
}
the = che;
std::vector<HalfEdge *>::iterator finditer;
while (the->vertex() != endV)
{
helist.push_back(the);
if (ccw)
the = the->target()->most_ccw_out_halfedge();
else
the = the->target()->most_clw_out_halfedge();
if (helist.size()>10000000)
{
assert(0);
}
}
}