本文整理汇总了C++中QuadEdge::oNext方法的典型用法代码示例。如果您正苦于以下问题:C++ QuadEdge::oNext方法的具体用法?C++ QuadEdge::oNext怎么用?C++ QuadEdge::oNext使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QuadEdge
的用法示例。
在下文中一共展示了QuadEdge::oNext方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: LocateFailureException
QuadEdge& IncrementalDelaunayTriangulator::insertSite(const Vertex &v)
{
/**
* This code is based on Guibas and Stolfi (1985), with minor modifications
* and a bug fix from Dani Lischinski (Graphic Gems 1993). (The modification
* I believe is the test for the inserted site falling exactly on an
* existing edge. Without this test zero-width triangles have been observed
* to be created)
*/
QuadEdge *e = subdiv->locate(v);
if(!e) {
throw LocateFailureException("");
}
if (subdiv->isVertexOfEdge(*e, v)) {
// point is already in subdivision.
return *e;
}
else if (subdiv->isOnEdge(*e, v.getCoordinate())) {
// the point lies exactly on an edge, so delete the edge
// (it will be replaced by a pair of edges which have the point as a vertex)
e = &e->oPrev();
subdiv->remove(e->oNext());
}
/**
* Connect the new point to the vertices of the containing triangle
* (or quadrilateral, if the new point fell on an existing edge.)
*/
QuadEdge* base = &subdiv->makeEdge(e->orig(), v);
QuadEdge::splice(*base, *e);
QuadEdge *startEdge = base;
do {
base = &subdiv->connect(*e, base->sym());
e = &base->oPrev();
} while (&e->lNext() != startEdge);
// Examine suspect edges to ensure that the Delaunay condition
// is satisfied.
do {
QuadEdge* t = &e->oPrev();
if (t->dest().rightOf(*e) &&
v.isInCircle(e->orig(), t->dest(), e->dest())) {
QuadEdge::swap(*e);
e = &e->oPrev();
} else if (&e->oNext() == startEdge) {
return *base; // no more suspect edges.
} else {
e = &e->oNext().lPrev();
}
} while (true);
}
示例2:
void
QuadEdge::splice(QuadEdge &a, QuadEdge &b)
{
QuadEdge &alpha = a.oNext().rot();
QuadEdge &beta = b.oNext().rot();
QuadEdge &t1 = b.oNext();
QuadEdge &t2 = a.oNext();
QuadEdge &t3 = beta.oNext();
QuadEdge &t4 = alpha.oNext();
a.setNext(&t1);
b.setNext(&t2);
alpha.setNext(&t3);
beta.setNext(&t4);
}
示例3: if
bool
QuadEdge::testEqualQuadEdge(const QuadEdge& qe2)
{
/*
if(&qe1 == NULL && &qe2 == NULL)
{
return 1;
}
else if((&qe1==NULL && &qe2!=NULL) || (&qe1!=NULL && &qe2==NULL))
{
return 0;
}
*/
//when both of them are not null:
if((*_rot).testEqualQuadEdge(qe2.rot()) && (*next).testEqualQuadEdge(qe2.oNext()) //&& (*data == *(qe2.data))
&& (isAlive == qe2.isAlive) /*&& orig()==qe2.orig()*/)
return 1;
else
return 0;
}