LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
ConvexHull class definiton. More...
#include "ConvexHull.h"
Public Types | |
using | Point = std::tuple< float, float, const reco::ClusterHit3D * > |
Definitions used by the ConvexHull algorithm. More... | |
using | PointList = std::list< Point > |
using | PointPair = std::pair< Point, Point > |
using | MinMaxPointPair = std::pair< PointPair, PointPair > |
Public Member Functions | |
ConvexHull (const PointList &) | |
Constructor. More... | |
virtual | ~ConvexHull () |
Destructor. More... | |
const PointList & | getPointsList () |
recover the list of points used to build convex hull More... | |
const PointList & | getConvexHull () const |
recover the list of convex hull vertices More... | |
const MinMaxPointPair & | getMinMaxPointPair () const |
find the ends of the convex hull (along its x axis) More... | |
float | getConvexHullArea () const |
recover the area of the convex hull More... | |
PointPair | findNearestEdge (const Point &, float &) const |
Given an input Point, find the nearest edge. More... | |
float | findNearestDistance (const Point &) const |
Given an input point, find the distance to the nearest edge/point. More... | |
Private Member Functions | |
void | getConvexHull (const PointList &) |
Given an input set of 2D points build a convex hull around them. More... | |
float | crossProduct (const Point &p0, const Point &p1, const Point &p2) const |
Gets the cross product of line from p0 to p1 and p0 to p2. More... | |
float | Area () const |
Computes the area of the enclosed convext hull. More... | |
bool | isLeft (const Point &p0, const Point &p1, const Point &pCheck) const |
Determines whether a point is to the left, right or on line specifiec by p0 and p1. More... | |
Private Attributes | |
const PointList & | fPoints |
PointList | fConvexHull |
MinMaxPointPair | fMinMaxPointPair |
float | fConvexHullArea |
ConvexHull class definiton.
Definition at line 25 of file ConvexHull.h.
using lar_cluster3d::ConvexHull::MinMaxPointPair = std::pair<PointPair,PointPair> |
Definition at line 34 of file ConvexHull.h.
using lar_cluster3d::ConvexHull::Point = std::tuple<float,float,const reco::ClusterHit3D*> |
Definitions used by the ConvexHull algorithm.
Definition at line 31 of file ConvexHull.h.
using lar_cluster3d::ConvexHull::PointList = std::list<Point> |
Definition at line 32 of file ConvexHull.h.
using lar_cluster3d::ConvexHull::PointPair = std::pair<Point,Point> |
Definition at line 33 of file ConvexHull.h.
lar_cluster3d::ConvexHull::ConvexHull | ( | const PointList & | pointListIn | ) |
Constructor.
pset |
Definition at line 28 of file ConvexHull.cxx.
References Area(), fConvexHull, fConvexHullArea, fPoints, and getConvexHull().
|
virtual |
|
private |
Computes the area of the enclosed convext hull.
Definition at line 69 of file ConvexHull.cxx.
References crossProduct(), and fConvexHull.
Referenced by ConvexHull(), and getConvexHullArea().
|
private |
Gets the cross product of line from p0 to p1 and p0 to p2.
Definition at line 56 of file ConvexHull.cxx.
Referenced by Area(), getConvexHullArea(), and isLeft().
float lar_cluster3d::ConvexHull::findNearestDistance | ( | const Point & | point | ) | const |
Given an input point, find the distance to the nearest edge/point.
Definition at line 255 of file ConvexHull.cxx.
References findNearestEdge().
Referenced by getConvexHullArea().
ConvexHull::PointPair lar_cluster3d::ConvexHull::findNearestEdge | ( | const Point & | point, |
float & | closestDistance | ||
) | const |
Given an input Point, find the nearest edge.
Definition at line 194 of file ConvexHull.cxx.
References fConvexHull, isLeft(), and max.
Referenced by findNearestDistance(), and getConvexHullArea().
|
inline |
recover the list of convex hull vertices
Definition at line 56 of file ConvexHull.h.
References fConvexHull.
Referenced by lar_cluster3d::ClusterPathFinder::buildConvexHull(), lar_cluster3d::VoronoiPathFinder::buildConvexHull(), ConvexHull(), voronoi2d::VoronoiDiagram::getConvexHull(), and getConvexHullArea().
|
private |
Given an input set of 2D points build a convex hull around them.
PointList | The input list of 2D points to build hull around |
Definition at line 94 of file ConvexHull.cxx.
References fConvexHull, fMinMaxPointPair, and isLeft().
|
inline |
recover the area of the convex hull
Definition at line 66 of file ConvexHull.h.
References Area(), crossProduct(), fConvexHullArea, findNearestDistance(), findNearestEdge(), getConvexHull(), and isLeft().
Referenced by lar_cluster3d::ClusterPathFinder::buildConvexHull(), and lar_cluster3d::VoronoiPathFinder::buildConvexHull().
|
inline |
find the ends of the convex hull (along its x axis)
Definition at line 61 of file ConvexHull.h.
References fMinMaxPointPair.
|
inline |
recover the list of points used to build convex hull
Definition at line 51 of file ConvexHull.h.
References fPoints.
|
private |
Determines whether a point is to the left, right or on line specifiec by p0 and p1.
Definition at line 47 of file ConvexHull.cxx.
References crossProduct().
Referenced by findNearestEdge(), getConvexHull(), and getConvexHullArea().
|
private |
Definition at line 103 of file ConvexHull.h.
Referenced by Area(), ConvexHull(), findNearestEdge(), and getConvexHull().
|
private |
Definition at line 105 of file ConvexHull.h.
Referenced by ConvexHull(), and getConvexHullArea().
|
private |
Definition at line 104 of file ConvexHull.h.
Referenced by getConvexHull(), and getMinMaxPointPair().
|
private |
Definition at line 102 of file ConvexHull.h.
Referenced by ConvexHull(), and getPointsList().