我正在尝试使用 boost::geometry::model:polygon ,但我无法让它工作,我还发现里面还有其他东西:
#include <boost/geometry/geometry.hpp>
称为polygon_2d
我不知道我需要哪一个以及如何使用它。
我尝试编写以下代码:
double points[][2] = {{2.0, 1.3}, {4.1, 3.0}, {5.3, 2.6}, {2.9, 0.7}, {2.0, 1.3}};
model::polygon<model::d2::point_xy<double> > poly;
append(poly, points);
但不幸的是它不起作用,我收到以下编译错误:
boost::mpl::assertion:_failed : cannot convert parameter 1 from 'boost::mpl::failed**** (_cdecl boost::geometry::traits::point_type<Geometry>::NOT_IMPLEMENTED_FOR_THIS_POINT_TYPE
我的最终目标是创建一个多边形并检查点是否在他体内..
提前致谢
编辑:附加功能期望(Geometry& geometry, RangeOrPoint const& range_or_point);