VoronoiDiagram class definiton. More...
#include <Voronoi.h>
Public Types | |
using | PointPair = std::pair< dcel2d::Point, dcel2d::Point > |
using | MinMaxPointPair = std::pair< PointPair, PointPair > |
Public Member Functions | |
VoronoiDiagram (dcel2d::HalfEdgeList &, dcel2d::VertexList &, dcel2d::FaceList &) | |
Constructor. More... | |
~VoronoiDiagram () | |
Destructor. More... | |
void | buildVoronoiDiagram (const dcel2d::PointList &) |
Given an input set of 2D points construct a 2D voronoi diagram. More... | |
void | buildVoronoiDiagramBoost (const dcel2d::PointList &) |
const dcel2d::FaceList & | getFaceList () const |
Recover the list of faces. More... | |
const dcel2d::VertexList & | getVertexList () const |
Recover the list of vertices. More... | |
double | getVoronoiDiagramArea () const |
recover the area of the convex hull More... | |
const dcel2d::PointList & | getConvexHull () const |
recover the point list representing the convex hull More... | |
PointPair | getExtremePoints () const |
Given an input Point, find the nearest edge. More... | |
PointPair | findNearestEdge (const dcel2d::Point &, double &) const |
Given an input Point, find the nearest edge. More... | |
double | findNearestDistance (const dcel2d::Point &) const |
Given an input point, find the distance to the nearest edge/point. More... | |
Private Types | |
using | EventQueue = std::priority_queue< IEvent *, std::vector< IEvent * >, bool(*)(const IEvent *, const IEvent *)> |
using | BoostEdgeToEdgeMap = std::map< const boost::polygon::voronoi_edge< double > *, dcel2d::HalfEdge * > |
Translate boost to dcel. More... | |
using | BoostVertexToVertexMap = std::map< const boost::polygon::voronoi_vertex< double > *, dcel2d::Vertex * > |
using | BoostCellToFaceMap = std::map< const boost::polygon::voronoi_cell< double > *, dcel2d::Face * > |
Private Member Functions | |
void | handleSiteEvents (BeachLine &, EventQueue &, IEvent *) |
There are two types of events in the queue, here we handle site events. More... | |
void | handleCircleEvents (BeachLine &, EventQueue &, IEvent *) |
There are two types of events in the queue, here we handle circle events. More... | |
void | makeLeftCircleEvent (EventQueue &, BSTNode *, double) |
void | makeRightCircleEvent (EventQueue &, BSTNode *, double) |
IEvent * | makeCircleEvent (BSTNode *, BSTNode *, BSTNode *, double) |
There are two types of events in the queue, here we handle circle events. More... | |
bool | computeCircleCenter (const dcel2d::Coords &, const dcel2d::Coords &, const dcel2d::Coords &, dcel2d::Coords &, double &, double &) const |
bool | computeCircleCenter2 (const dcel2d::Coords &, const dcel2d::Coords &, const dcel2d::Coords &, dcel2d::Coords &, double &, double &) const |
bool | computeCircleCenter3 (const dcel2d::Coords &, const dcel2d::Coords &, const dcel2d::Coords &, dcel2d::Coords &, double &, double &) const |
void | getConvexHull (const BSTNode *) |
this function recovers the convex hull More... | |
void | terminateInfiniteEdges (BeachLine &, double) |
this aims to process remaining elements in the beachline after the event queue has been depleted More... | |
bool | isInsideConvexHull (const dcel2d::Vertex &) const |
Is a vertex inside the convex hull - meant to be a fast check. More... | |
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 More... | |
void | findBoundingBox (const dcel2d::VertexList &) |
Find the min/max values in x-y to use as a bounding box. More... | |
void | boostTranslation (const dcel2d::PointList &, const boost::polygon::voronoi_edge< double > *, const boost::polygon::voronoi_edge< double > *, BoostEdgeToEdgeMap &, BoostVertexToVertexMap &, BoostCellToFaceMap &) |
void | mergeDegenerateVertices () |
merge degenerate vertices (found by zero length edges) More... | |
double | ComputeFaceArea () |
Compute the area of the faces. More... | |
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. More... | |
double | Area () const |
Computes the area of the enclosed convext hull. More... | |
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. More... | |
Private Attributes | |
dcel2d::HalfEdgeList & | fHalfEdgeList |
dcel2d::VertexList & | fVertexList |
dcel2d::FaceList & | fFaceList |
dcel2d::PointList | fPointList |
SiteEventList | fSiteEventList |
CircleEventList | fCircleEventList |
BSTNodeList | fCircleNodeList |
dcel2d::PointList | fConvexHullList |
dcel2d::Coords | fConvexHullCenter |
double | fXMin |
double | fXMax |
double | fYMin |
double | fYMax |
int | fNumBadCircles |
double | fVoronoiDiagramArea |
EventUtilities | fUtilities |
VoronoiDiagram class definiton.
|
private |
|
private |
|
private |
|
private |
using voronoi2d::VoronoiDiagram::MinMaxPointPair = std::pair<PointPair,PointPair> |
using voronoi2d::VoronoiDiagram::PointPair = std::pair<dcel2d::Point,dcel2d::Point> |
voronoi2d::VoronoiDiagram::VoronoiDiagram | ( | dcel2d::HalfEdgeList & | halfEdgeList, |
dcel2d::VertexList & | vertexList, | ||
dcel2d::FaceList & | faceList | ||
) |
Constructor.
pset |
Definition at line 51 of file Voronoi.cxx.
voronoi2d::VoronoiDiagram::~VoronoiDiagram | ( | ) |
|
private |
Computes the area of the enclosed convext hull.
Definition at line 104 of file Voronoi.cxx.
|
private |
Definition at line 321 of file Voronoi.cxx.
void voronoi2d::VoronoiDiagram::buildVoronoiDiagram | ( | const dcel2d::PointList & | pointList | ) |
Given an input set of 2D points construct a 2D voronoi diagram.
PointList | The input list of 2D points |
Definition at line 133 of file Voronoi.cxx.
void voronoi2d::VoronoiDiagram::buildVoronoiDiagramBoost | ( | const dcel2d::PointList & | pointList | ) |
Definition at line 265 of file Voronoi.cxx.
|
private |
Definition at line 690 of file Voronoi.cxx.
|
private |
Definition at line 762 of file Voronoi.cxx.
|
private |
Definition at line 793 of file Voronoi.cxx.
|
private |
Compute the area of the faces.
Definition at line 1215 of file Voronoi.cxx.
|
private |
Gets the cross product of line from p0 to p1 and p0 to p2.
Definition at line 91 of file Voronoi.cxx.
|
private |
Find the min/max values in x-y to use as a bounding box.
Definition at line 1346 of file Voronoi.cxx.
double voronoi2d::VoronoiDiagram::findNearestDistance | ( | const dcel2d::Point & | point | ) | const |
Given an input point, find the distance to the nearest edge/point.
Definition at line 1424 of file Voronoi.cxx.
VoronoiDiagram::PointPair voronoi2d::VoronoiDiagram::findNearestEdge | ( | const dcel2d::Point & | point, |
double & | closestDistance | ||
) | const |
Given an input Point, find the nearest edge.
Definition at line 1363 of file Voronoi.cxx.
|
inline |
recover the point list representing the convex hull
Definition at line 76 of file Voronoi.h.
|
private |
this function recovers the convex hull
Definition at line 963 of file Voronoi.cxx.
VoronoiDiagram::PointPair voronoi2d::VoronoiDiagram::getExtremePoints | ( | ) | const |
Given an input Point, find the nearest edge.
Definition at line 1040 of file Voronoi.cxx.
|
inline |
|
inline |
|
inline |
|
private |
There are two types of events in the queue, here we handle circle events.
Definition at line 472 of file Voronoi.cxx.
|
private |
There are two types of events in the queue, here we handle site events.
Definition at line 415 of file Voronoi.cxx.
|
private |
Is a vertex inside the convex hull - meant to be a fast check.
Definition at line 1102 of file Voronoi.cxx.
|
private |
Determines whether a point is to the left, right or on line specifiec by p0 and p1.
Definition at line 82 of file Voronoi.cxx.
|
private |
is vertex outside the convex hull and if so return some useful information
Definition at line 1131 of file Voronoi.cxx.
|
private |
There are two types of events in the queue, here we handle circle events.
Definition at line 653 of file Voronoi.cxx.
|
private |
Definition at line 557 of file Voronoi.cxx.
|
private |
Definition at line 606 of file Voronoi.cxx.
|
private |
merge degenerate vertices (found by zero length edges)
Definition at line 1187 of file Voronoi.cxx.
|
private |
this aims to process remaining elements in the beachline after the event queue has been depleted
Definition at line 829 of file Voronoi.cxx.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
mutableprivate |
|
private |
|
private |
|
private |
|
private |
|
private |