Thunderbots Project
Loading...
Searching...
No Matches
voronoi_diagram.h
1#pragma once
2
3#include <memory>
4
5#include "software/geom/circle.h"
6#include "software/geom/point.h"
7#include "software/geom/rectangle.h"
8
9// We pre-declare this boost type so that we can hold a pointer to it as a member, but
10// not include the boost header files in this header to prevent them being included in
11// other files that include this one, as boost has *many* header files that slow down
12// compilation if included in too many places
13namespace boost::polygon
14{
15 template <typename T>
17 template <typename T, typename TRAITS>
19} // namespace boost::polygon
20
22{
23 public:
24 explicit VoronoiDiagram(const std::vector<Point> &points);
25
26 VoronoiDiagram() = delete;
27
28 const std::vector<Point> &getPointsUsedForGeneration() const
29 {
30 return points;
31 }
32
41 std::vector<Point> findVoronoiEdgeRecIntersects(const Rectangle &bounding_box);
42
52 std::vector<Circle> voronoiVerticesToOpenCircles(const Rectangle &bounding_box);
53
54 private:
55 std::shared_ptr<boost::polygon::voronoi_diagram<
57 diagram;
58 std::vector<Point> points;
59};
Definition rectangle.h:10
Definition voronoi_diagram.h:22
std::vector< Circle > voronoiVerticesToOpenCircles(const Rectangle &bounding_box)
Definition voronoi_diagram.cpp:72
std::vector< Point > findVoronoiEdgeRecIntersects(const Rectangle &bounding_box)
Definition voronoi_diagram.cpp:23
Definition voronoi_diagram.h:16
Definition voronoi_diagram.h:18