9 #ifndef VoronoiDiagram_h 10 #define VoronoiDiagram_h 20 #include <boost/polygon/voronoi.hpp> 32 using PointPair = std::pair<dcel2d::Point, dcel2d::Point>;
93 std::priority_queue<IEvent*, std::vector<IEvent*>, bool (*)(
const IEvent*,
const IEvent*)>;
170 const boost::polygon::voronoi_edge<double>*,
171 const boost::polygon::voronoi_edge<double>*,
double getVoronoiDiagramArea() const
recover the area of the convex hull
This defines the actual beach line. The idea is to implement this as a self balancing binary search t...
std::list< SiteEvent > SiteEventList
dcel2d::HalfEdgeList & fHalfEdgeList
std::list< HalfEdge > HalfEdgeList
std::list< CircleEvent > CircleEventList
Provides some basic functions operating in IEvent class objects.
std::pair< dcel2d::Point, dcel2d::Point > PointPair
BSTNode class definiton specifically for use in constructing Voronoi diagrams. We are trying to follo...
std::pair< PointPair, PointPair > MinMaxPointPair
bool isInsideConvexHull(const dcel2d::Vertex &) const
Is a vertex inside the convex hull - meant to be a fast check.
double Area() const
Computes the area of the enclosed convext hull.
bool computeCircleCenter2(const dcel2d::Coords &, const dcel2d::Coords &, const dcel2d::Coords &, dcel2d::Coords &, double &) const
dcel2d::FaceList & fFaceList
std::list< BSTNode > BSTNodeList
Internal class definitions to facilitate construction of diagram.
Represents the beachline implemented as a self balancing binary search tree.
~VoronoiDiagram()
Destructor.
void makeLeftCircleEvent(EventQueue &, BSTNode *, double)
bool computeCircleCenter(const dcel2d::Coords &, const dcel2d::Coords &, const dcel2d::Coords &, dcel2d::Coords &, double &, double &) const
BSTNodeList fCircleNodeList
double fVoronoiDiagramArea
IEvent * makeCircleEvent(BSTNode *, BSTNode *, BSTNode *, double)
There are two types of events in the queue, here we handle circle events.
void handleCircleEvents(BeachLine &, EventQueue &, IEvent *)
There are two types of events in the queue, here we handle circle events.
VoronoiDiagram class definiton.
std::list< Face > FaceList
CircleEventList fCircleEventList
SiteEventList fSiteEventList
EventUtilities fUtilities
double ComputeFaceArea()
Compute the area of the faces.
void buildVoronoiDiagram(const dcel2d::PointList &)
Given an input set of 2D points construct a 2D voronoi diagram.
double findNearestDistance(const dcel2d::Point &) const
Given an input point, find the distance to the nearest edge/point.
void findBoundingBox(const dcel2d::VertexList &)
Find the min/max values in x-y to use as a bounding box.
dcel2d::VertexList & fVertexList
std::priority_queue< IEvent *, std::vector< IEvent * >, bool(*)(const IEvent *, const IEvent *)> EventQueue
void mergeDegenerateVertices()
merge degenerate vertices (found by zero length edges)
dcel2d::Coords fConvexHullCenter
void makeRightCircleEvent(EventQueue &, BSTNode *, double)
dcel2d::PointList fPointList
double crossProduct(const dcel2d::Point &p0, const dcel2d::Point &p1, const dcel2d::Point &p2) const
Gets the cross product of line from p0 to p1 and p0 to p2.
PointPair findNearestEdge(const dcel2d::Point &, double &) const
Given an input Point, find the nearest edge.
dcel2d::PointList fConvexHullList
std::tuple< double, double, const reco::ClusterHit3D * > Point
Definitions used by the VoronoiDiagram algorithm.
const dcel2d::PointList & getConvexHull() const
recover the point list representing the convex hull
void boostTranslation(const dcel2d::PointList &, const boost::polygon::voronoi_edge< double > *, const boost::polygon::voronoi_edge< double > *, BoostEdgeToEdgeMap &, BoostVertexToVertexMap &, BoostCellToFaceMap &)
PointPair getExtremePoints() const
Given an input Point, find the nearest edge.
std::map< const boost::polygon::voronoi_edge< double > *, dcel2d::HalfEdge * > BoostEdgeToEdgeMap
Translate boost to dcel.
std::map< const boost::polygon::voronoi_vertex< double > *, dcel2d::Vertex * > BoostVertexToVertexMap
void terminateInfiniteEdges(BeachLine &, double)
this aims to process remaining elements in the beachline after the event queue has been depleted ...
bool computeCircleCenter3(const dcel2d::Coords &, const dcel2d::Coords &, const dcel2d::Coords &, dcel2d::Coords &, double &) const
std::list< Point > PointList
void buildVoronoiDiagramBoost(const dcel2d::PointList &)
const dcel2d::VertexList & getVertexList() const
Recover the list of vertices.
const dcel2d::FaceList & getFaceList() const
Recover the list of faces.
std::list< Vertex > VertexList
std::map< const boost::polygon::voronoi_cell< double > *, dcel2d::Face * > BoostCellToFaceMap
VoronoiDiagram(dcel2d::HalfEdgeList &, dcel2d::VertexList &, dcel2d::FaceList &)
Constructor.
bool isOutsideConvexHull(const dcel2d::Vertex &, dcel2d::PointList::const_iterator, dcel2d::Coords &, double &) const
is vertex outside the convex hull and if so return some useful information
bool isLeft(const dcel2d::Point &p0, const dcel2d::Point &p1, const dcel2d::Point &pCheck) const
Determines whether a point is to the left, right or on line specifiec by p0 and p1.
void handleSiteEvents(BeachLine &, EventQueue &, IEvent *)
There are two types of events in the queue, here we handle site events.