【问题标题】:Boost.geometry implement Polygon ConceptBoost.geometry 实现多边形概念
【发布时间】:2013-10-29 01:36:38
【问题描述】:

我正在尝试(但失败)在 Boost.Geometry 中实现多边形概念。我已经成功地实现了点和环的概念:

typedef QVector<QVector2D> Contour;
BOOST_GEOMETRY_REGISTER_POINT_2D_GET_SET(QVector2D, float,
    boost::geometry::cs::cartesian, x, y, setX, setY)
BOOST_GEOMETRY_REGISTER_RING(Contour)

现在我正在尝试将 Polygon 类定义为:

class Polygon
{
public:
    typedef QVector2D point_type;
    typedef Contour ring_type;
    typedef QVector<Contour> inner_container_type;

    Contour const& outer() const { return _outer; }
    QVector<Contour> const& inners() const { return _inners; }

    Contour& outer() { return _outer; }
    QVector<Contour>& inners() { return _inners; }
private:
    Contour _outer;    
    QVector<Contour> _inners;
};

我知道我需要将多边形标签添加到此类,但我找不到任何明确的这样做的例子,而且我得到的错误提示更多问题。如果有人可以提供实现该概念的工作示例的链接,我想我可以从那里找出我的问题。

【问题讨论】:

    标签: c++ boost boost-geometry


    【解决方案1】:

    【讨论】:

    • 链接不是答案;请在答案中提供足够的信息。
    猜你喜欢
    • 1970-01-01
    • 2014-07-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-06-20
    • 1970-01-01
    相关资源
    最近更新 更多