Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/141.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ Boost.geometry实现多边形概念_C++_Boost_Boost Geometry - Fatal编程技术网

C++ Boost.geometry实现多边形概念

C++ Boost.geometry实现多边形概念,c++,boost,boost-geometry,C++,Boost,Boost Geometry,我正在尝试(但失败)在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) typedef矢量

我正在尝试(但失败)在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)
typedef矢量轮廓;
BOOST\u GEOMETRY\u REGISTER\u POINT\u 2D\u GET\u SET(QVector2D,float,
几何体::cs::笛卡尔,x,y,setX,setY)
升压环、几何环、寄存器环(轮廓)
现在,我尝试将多边形类定义为:

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;
};
类多边形
{
公众:
typedef QVector2D点_类型;
typedef轮廓环\ U型;
类型定义QVector内部容器类型;
等高线常量&outer()常量{return_outer;}
QVector const&inners()const{return_inners;}
轮廓和外部(){return_outer;}
QVector&inners(){return\u inners;}
私人:
外轮廓;
QVector_-inners;
};

我知道我需要在这个类中添加polygon标记,但是我找不到任何这样做的清晰示例,并且我得到的错误提示了更多的问题。如果有人能提供一个链接到实施该概念的工作示例,我想我可以从中找出我的问题。

最好的参考资料是文档:


链接不是答案;请在答案中提供足够的信息。