本文整理汇总了C++中BPoint::linkto方法的典型用法代码示例。如果您正苦于以下问题:C++ BPoint::linkto方法的具体用法?C++ BPoint::linkto怎么用?C++ BPoint::linkto使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BPoint
的用法示例。
在下文中一共展示了BPoint::linkto方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check
pointlist* logicop::logic::hole2simple(const pointlist& outside, const pointlist& inside) {
segmentlist _segl0(outside,0);
segmentlist _segl1(inside,1);
EventQueue* _eq = new EventQueue(_segl0, _segl1); // create the event queue
SweepLine _sl;
BindCollection BC;
_eq->swipe4bind(_sl, BC);
BindSegment* sbc = BC.get_highest();
//insert 2 crossing points and link them
BPoint* cpsegA = _segl0.insertbindpoint(sbc->poly0seg(), sbc->poly0pnt());
BPoint* cpsegB = _segl1.insertbindpoint(sbc->poly1seg(), sbc->poly1pnt());
cpsegA->linkto(cpsegB);
cpsegB->linkto(cpsegA);
// normalize the segment lists
_segl0.normalize(outside);
_segl1.normalize(inside);
// dump the new polygons in VList terms
VPoint* outshape = _segl0.dump_points();
_segl1.dump_points();
// traverse and form the resulting shape
VPoint* centinel = outshape;
pointlist *shgen = new pointlist();
bool direction = true; /*next*/
VPoint* pickup = centinel;
VPoint* prev = centinel->prev();
bool modify = false;
do {
shgen->push_back(TP(pickup->cp()->x(), pickup->cp()->y()));
modify = (-1 == prev->visited());
prev = pickup;
pickup = pickup->follower(direction, modify);
} while (pickup != centinel);
// Validate the resulting polygon
laydata::valid_poly check(*shgen);
// delete shgen;
if (!check.valid()) {
std::ostringstream ost;
ost << ": Resulting shape is invalid - " << check.failtype();
tell_log(console::MT_ERROR, ost.str().c_str());
}
else {
if (laydata::shp_OK != check.status())
*shgen = check.get_validated();
}
return shgen;
}