Intersection_inserter没有在这个作用域中声明
Intersection_inserter was not declared in this scope
我正在尝试计算两个椭圆之间的重叠区域。我现在用多边形近似椭圆,我已经找到了一个例子,显然使用了旧版本的Boost.Geometry
,根据这个答案。从这个问题的第二个答案中,我可以看出这也是一个旧的例子,因为一些头文件在v1.53中不存在。我已经将它们替换为:
#include <boost/geometry/geometries/adapted/c_array.hpp>
#include <boost/geometry/multi/multi.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/io/wkt/wkt.hpp>
#include <boost/geometry/multi/geometries/multi_polygon.hpp>
,还添加了以下代码:
typedef boost::geometry::model::d2::point_xy<double,
boost::geometry::cs::cartesian> point_2d;
typedef boost::geometry::model::polygon<point_2d> polygon_2d;
和几乎所有的工作。唯一的问题是:
polygon_2d poly, poly2;
typedef std::vector<polygon_2d > polygon_list;
polygon_list v;
intersection_inserter<polygon_2d >(poly2, poly, std::back_inserter(v));
我得到一个错误:
intersection_inserter was not declared in this scope
expected primary expression before '>' token
关于这个问题的boost文档是从2009年开始的,所以我想它不再适用了…据我所知,他们的例子和我的一样。我已经找到了在头文件intersection.hpp
中定义了intersection_inserter的地方,但我不能使它的头或尾…
我在win7的VS2012和Linux Mint 14的Qt 4.7.4中都得到了相同的错误。任何帮助将非常感激!
我在当前的boost文档中找不到intersection_inserter
的任何参考。也许这个功能已经被删除了?
似乎boost::geometry
中计算交叉点的"官方"方法是通过intersection
函数,如这里记录的(带有示例)
相关文章:
- 未在作用域中声明unordered_map
- 未在此作用域OpenCV3.4中声明cvSaveImage
- 未在此作用域中声明的函数和变量 (C++)
- 函数未在作用域中声明 / 如何结合使用 header.h、header.cpp 和 main.cpp?
- 重载时未在 C++ 的作用域错误中声明
- 在 C++ 中使用 "transform" 会给出一个错误,指出这未在作用域中声明
- Tictactoe 游戏变量未在作用域中声明
- 当变量在多个函数作用域中使用时,我应该在类 private 中声明该变量吗?
- 如何在C++中嵌套词法作用域可访问的作用域中声明静态信息?
- gets()未在作用域中声明
- 在C++14中,在哪个作用域中声明了重新声明枚举的非范围枚举器
- C++11 外部作用域变量声明为 auto
- 未在此作用域中声明类 (c++)
- 如何声明在函数作用域中定义的结构
- 未在此作用域中声明函数,即使存在头文件也是如此
- 变量声明中结构的作用域解析是什么意思
- 在C++中,在给定的相同作用域内声明相同的变量名
- 我可以使用相同的名称为周围作用域中的类型声明成员类型别名吗
- 类未在作用域中声明,但已声明该类
- 使用新的外部函数作用域声明和初始化变量