本文整理汇总了C++中VPoint::set_next方法的典型用法代码示例。如果您正苦于以下问题:C++ VPoint::set_next方法的具体用法?C++ VPoint::set_next怎么用?C++ VPoint::set_next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VPoint
的用法示例。
在下文中一共展示了VPoint::set_next方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: normalize
/*! This method returns properly sorted dual linked list of all vertices
(including crossing ones) of this segment collection. The method should be
called after normalize(). The list created here is used as a source data when
the new polygons are generated. All logic operations are using this data. This
is effectively the input polygon vertices and the crossing points lined-up
conterclockwise*/
logicop::VPoint* logicop::segmentlist::dump_points() {
logicop::VPoint* vlist = NULL;
for (unsigned i = 0; i < _segs.size(); i++)
_segs[i]->dump_points(vlist);
logicop::VPoint* lastV = vlist;
VPoint* centinel = NULL;
while (vlist->prev()) {
if (-1 == vlist->visited()) centinel = vlist;
vlist = vlist->prev();
}
lastV->set_next(vlist);
vlist->set_prev(lastV);
if (NULL != centinel) {
VPoint* vwork = centinel;
do {
if (-1 == vwork->visited()) {
//here visited == 0 means only that the object is Cpoint.
VPoint* tbdel = NULL;
if ((*vwork->cp()) == (*vwork->prev()->cp())) {
tbdel = vwork->prev();
vwork->set_prev(vwork->prev()->prev());
vwork->prev()->set_next(vwork);
}
else if ((*vwork->cp()) == (*vwork->next()->cp())) {
tbdel = vwork->next();
vwork->set_next(vwork->next()->next());
vwork->next()->set_prev(vwork);
}
vwork = vwork->next();
if (tbdel) delete tbdel;
}
else vwork = vwork->next();
} while (centinel != vwork);
}
return vlist;
}