1 | #include <iostream>
|
---|
2 | #include <vector>
|
---|
3 |
|
---|
4 | #include <boost/geometry/geometry.hpp>
|
---|
5 | #include <boost/geometry/geometries/point_xy.hpp>
|
---|
6 | #include <boost/geometry/geometries/polygon.hpp>
|
---|
7 | #include <boost/geometry/geometries/box.hpp>
|
---|
8 | #include <boost/geometry/multi/geometries/multi_point.hpp>
|
---|
9 | #include <boost/polygon/polygon.hpp>
|
---|
10 | #include <boost/polygon/voronoi.hpp>
|
---|
11 | #include <boost/geometry/algorithms/detail/has_self_intersections.hpp>
|
---|
12 | #include <boost/geometry/index/rtree.hpp>
|
---|
13 |
|
---|
14 | typedef long double GeometryCoord;
|
---|
15 | typedef boost::geometry::model::d2::point_xy<GeometryCoord> GeometryPoint;
|
---|
16 | typedef boost::geometry::model::polygon<GeometryPoint> GeometryPolygon;
|
---|
17 | typedef boost::geometry::model::ring<GeometryPoint> GeometryRing;
|
---|
18 | typedef boost::geometry::model::polygon<GeometryPoint>::inner_container_type GeometryRingsList;
|
---|
19 | typedef boost::geometry::model::box<GeometryPoint> GeometryBox;
|
---|
20 | typedef boost::geometry::model::segment<GeometryPoint> GeometrySegment;
|
---|
21 | typedef boost::geometry::model::multi_point<GeometryPoint> GeometryMultiPoint;
|
---|
22 |
|
---|
23 | namespace bgi = boost::geometry::index;
|
---|
24 | typedef std::pair<GeometryBox, GeometryPolygon * > Value;
|
---|
25 |
|
---|
26 | int main()
|
---|
27 | {
|
---|
28 | boost::geometry::index::rtree<Value, boost::geometry::index::linear<16> > rtree;
|
---|
29 |
|
---|
30 | GeometryPolygon p;
|
---|
31 | GeometryBox Box;
|
---|
32 |
|
---|
33 | boost::geometry::envelope( p, Box );
|
---|
34 |
|
---|
35 | rtree.insert(std::make_pair(Box, &p));
|
---|
36 |
|
---|
37 | rtree.remove(std::make_pair(Box, &p));
|
---|
38 |
|
---|
39 | return 0;
|
---|
40 | }
|
---|
41 |
|
---|