【问题标题】:Boost geometry intersection_inserter<polygon_2d> does not work提升几何 intersection_inserter<polygon_2d> 不起作用
【发布时间】:2012-12-11 09:32:55
【问题描述】:

我正在使用 boost 几何库 C++。该代码在旧版本的 Eclipse(从 pythonxy 安装)中运行良好。现在我安装最新版本的 eclipse 和 Mingw (x86_64-w64-mingw32)。错误出现在函数 intersection_inserter() 和 boost::geometry::enrich_intersection_points() 中。

        typedef std::vector<polygon_2d > polygon_list;
    polygon_list v;
    intersection_inserter<polygon_2d>(square, *polygon_iterator,
                                            std::back_inserter(v));

错误如下:

c:\program files\mingw64\bin\../lib/gcc/x86_64-w64-mingw32/4.7.1/
../../../../include/boost/geometry/algorithms/intersection.hpp:293:27:
required from 'OutputIterator boost::geometry::intersection_inserter(
const Geometry1&, const Geometry2&, OutputIterator) [with GeometryOut = 
boost::geometry::polygon<boost::geometry::point_xy<double,  
boost::geometry::cs::cartesian> >; Geometry1 = 
boost::geometry::box<boost::geometry::point_xy<double, 
boost::geometry::cs::cartesian> >; Geometry2 = 
boost::geometry::polygon<boost::geometry::point_xy<double,
boost::geometry::cs::cartesian> >; OutputIterator = 
std::back_insert_iterator<std::vector<boost::geometry::polygon<boost::
geometry::point_xy<double, boost::geometry::cs::cartesian> > > >]'
..\src\VoronoiPolygons.cpp:397:85:   required from here
c:\program files\mingw64\bin\../lib/gcc/x86_64-w64-
mingw32/4.7.1/../../../../include/boost/geometry/algorithms/overlay/
enrich_intersection_points.hpp:198:20: error: 'compare_distances' was not
declared in this scope, and no declarations were found by 
argument-dependent lookup at the point of instantiation [-fpermissive]

【问题讨论】:

    标签: c++ boost polygon boost-geometry


    【解决方案1】:

    compare_distances 当前未在上述行中使用,也未在整个文件中使用。您使用的是(非常)旧版本的 Boost 吗?

    可能是的,我建议升级。

    【讨论】:

    • 代码是基于老版本的boost,Boost几何库编写的。但现在我下载了最新版本的 Boost。你认为这是原因吗?如果是这样,那意味着我必须根据新版本的 boost 重写我的程序?是的,我比较了 boost 库。在最新版本中,一些文件被删除了。
    • 自发布以来界面并没有真正改变。但是,如果您使用的是预发布版本(GGL 或来自沙盒或主干),则可能会有更多更改。但是“重写”不应该是必要的。根据您的代码,我看不到影响。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-02
    • 1970-01-01
    • 1970-01-01
    • 2013-03-26
    • 2012-01-23
    • 2019-05-18
    • 1970-01-01
    相关资源
    最近更新 更多