我正在尝试编译使用boost :: geometry :: within的程序,但出现以下错误:
/usr/include/boost/geometry/algorithms/within.hpp:在实例化中 ‘bool boost :: geometry :: within(const Geometry1&,const Geometry2&) [使用Geometry1 = legacy_point;几何2 = std :: vector]’:glcanvas.cpp:1460:57:从此处开始 /usr/include/boost/geometry/algorithms/within.hpp:295:55:错误: “ apply”不是以下成员 ‘boost :: geometry :: dispatch :: inside,boost :: geometry :: point_tag, boost :: geometry :: multi_point_tag>
我的几何定义如下:
struct legacy_point{
float x, y, z;
};
BOOST_GEOMETRY_REGISTER_POINT_3D(legacy_point, float, cs::cartesian, x, y, z)
BOOST_GEOMETRY_REGISTER_MULTI_POINT(decltype(std::vector< legacy_point>{}))
我正在调用以下函数:
boost::geometry::within(point, conv_layer);
其中point
是legacy_point
类型,而conv_layer
是legacy_point
的向量。我可以使用boost :: geometry :: distance函数,但会在内部得到上述错误。