boost::geometry::ever_circling_iterator的使用及测试程序
boost::geometry::ever_circling_iterator是boost几何库中的一个迭代器,用于绕过一个区域无限循环。它可以用于在多边形内部或周围迭代,而不必担心越界或停止迭代。
下面我们来看一个简单的测试程序,用于展示如何使用boost::geometry::ever_circling_iterator。
#include <iostream>
#include <vector>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
// 设置别名
using boost::geometry::model::d2::point_xy;
using boost::geometry::model::polygon;
int main()
{
// 创建一个多边形
polygon<point_xy<double>> poly;
boost::geometry::read_wkt("POLYGON((0 0,0 10,10 10,10 0,0 0))", poly);
// 创建一个ever_circling_iterator对象
auto it = boost::geometry::ever_circling_it