本文整理汇总了C++中Vertices::position方法的典型用法代码示例。如果您正苦于以下问题:C++ Vertices::position方法的具体用法?C++ Vertices::position怎么用?C++ Vertices::position使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vertices
的用法示例。
在下文中一共展示了Vertices::position方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeEdges
void QTessellatorPrivate::removeEdges()
{
int cv = currentVertex;
while (cv < vertices.nPoints) {
const Vertex *v = vertices.sorted[cv];
if (v->y > y)
break;
if (v->flags & LineBeforeEnds) {
QDEBUG() << " removing edge" << vertices.prevPos(v);
int pos = scanline.findEdge(vertices.prevPos(v));
if (pos == -1)
continue;
scanline.edges[pos]->mark = true;
if (pos > 0)
scanline.edges[pos - 1]->intersect_right = true;
if (pos < scanline.size - 1)
scanline.edges[pos + 1]->intersect_left = true;
scanline.removeAt(pos);
}
if (v->flags & LineAfterEnds) {
QDEBUG() << " removing edge" << vertices.position(v);
int pos = scanline.findEdge(vertices.position(v));
if (pos == -1)
continue;
scanline.edges[pos]->mark = true;
if (pos > 0)
scanline.edges[pos - 1]->intersect_right = true;
if (pos < scanline.size - 1)
scanline.edges[pos + 1]->intersect_left = true;
scanline.removeAt(pos);
}
++cv;
}
}
示例2: addEdges
void QTessellatorPrivate::addEdges()
{
while (currentVertex < vertices.nPoints) {
const Vertex *v = vertices.sorted[currentVertex];
if (v->y > y)
break;
if (v->flags & LineBeforeStarts) {
// add new edge
int start = vertices.prevPos(v);
Edge e(vertices, start);
int pos = scanline.findEdgePosition(e);
QDEBUG() << " adding edge" << start << "at position" << pos;
scanline.insert(pos, e);
if (!mark_clever || !(v->flags & LineAfterEnds)) {
if (pos > 0)
scanline.edges[pos - 1]->mark = true;
if (pos < scanline.size - 1)
scanline.edges[pos + 1]->mark = true;
}
}
if (v->flags & LineAfterStarts) {
Edge e(vertices, vertices.position(v));
int pos = scanline.findEdgePosition(e);
QDEBUG() << " adding edge" << vertices.position(v) << "at position" << pos;
scanline.insert(pos, e);
if (!mark_clever || !(v->flags & LineBeforeEnds)) {
if (pos > 0)
scanline.edges[pos - 1]->mark = true;
if (pos < scanline.size - 1)
scanline.edges[pos + 1]->mark = true;
}
}
if (v->flags & LineAfterHorizontal) {
int pos1 = scanline.findEdgePosition(v->x, v->y);
const Vertex *next = vertices.next(v);
Q_ASSERT(v->y == next->y);
int pos2 = scanline.findEdgePosition(next->x, next->y);
if (pos2 < pos1)
qSwap(pos1, pos2);
if (pos1 > 0)
--pos1;
if (pos2 == scanline.size)
--pos2;
//QDEBUG() << "marking horizontal edge from " << pos1 << "to" << pos2;
scanline.markEdges(pos1, pos2);
}
++currentVertex;
}
}