LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
ConvexHull class definiton. More...
#include "ConvexHull.h"
Public Types | |
using | Point = std::tuple< float, float, const reco::ClusterHit3D * > |
projected x,y position and 3D hit More... | |
using | PointList = std::list< Point > |
The list of the projected points. More... | |
using | PointPair = std::pair< Point, Point > |
using | MinMaxPointPair = std::pair< PointPair, PointPair > |
Public Member Functions | |
ConvexHull (const PointList &, float=0.85, float=0.35) | |
Constructor. More... | |
~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... | |
const PointList & | getExtremePoints () |
Find the two points on the hull which are furthest apart. More... | |
const reco::ConvexHullKinkTupleList & | getKinkPoints () |
Find the points with the largest angles. 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 | |
float | fKinkAngle |
float | fMinEdgeDistance |
const PointList & | fPoints |
PointList | fConvexHull |
MinMaxPointPair | fMinMaxPointPair |
float | fConvexHullArea |
PointList | fExtremePoints |
reco::ConvexHullKinkTupleList | fKinkPoints |
ConvexHull class definiton.
Definition at line 26 of file ConvexHull.h.
using lar_cluster3d::ConvexHull::MinMaxPointPair = std::pair<PointPair, PointPair> |
Definition at line 35 of file ConvexHull.h.
using lar_cluster3d::ConvexHull::Point = std::tuple<float, float, const reco::ClusterHit3D*> |
projected x,y position and 3D hit
Definition at line 32 of file ConvexHull.h.
using lar_cluster3d::ConvexHull::PointList = std::list<Point> |
The list of the projected points.
Definition at line 33 of file ConvexHull.h.
using lar_cluster3d::ConvexHull::PointPair = std::pair<Point, Point> |
Definition at line 34 of file ConvexHull.h.
lar_cluster3d::ConvexHull::ConvexHull | ( | const PointList & | pointListIn, |
float | kinkAngle = 0.85 , |
||
float | minEdgeDistance = 0.35 |
||
) |
Constructor.
pset |
Definition at line 29 of file ConvexHull.cxx.
References Area(), fConvexHull, fConvexHullArea, fPoints, and getConvexHull().
lar_cluster3d::ConvexHull::~ConvexHull | ( | ) |
|
private |
Computes the area of the enclosed convext hull.
Definition at line 72 of file ConvexHull.cxx.
References crossProduct(), fConvexHull, n, x, and y.
Referenced by ConvexHull(), and getConvexHullArea().
|
private |
Gets the cross product of line from p0 to p1 and p0 to p2.
Definition at line 59 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 389 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 329 of file ConvexHull.cxx.
References fConvexHull, and isLeft().
Referenced by findNearestDistance(), and getConvexHullArea().
|
inline |
recover the list of convex hull vertices
Definition at line 57 of file ConvexHull.h.
References fConvexHull.
Referenced by lar_cluster3d::ClusterPathFinder::buildConvexHull(), lar_cluster3d::VoronoiPathFinder::buildConvexHull(), lar_cluster3d::ConvexHullPathFinder::buildConvexHull(), lar_cluster3d::MSTPathFinder::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 106 of file ConvexHull.cxx.
References fConvexHull, fMinMaxPointPair, and isLeft().
|
inline |
recover the area of the convex hull
Definition at line 77 of file ConvexHull.h.
References Area(), crossProduct(), fConvexHullArea, findNearestDistance(), findNearestEdge(), getConvexHull(), and isLeft().
Referenced by lar_cluster3d::ClusterPathFinder::buildConvexHull(), lar_cluster3d::VoronoiPathFinder::buildConvexHull(), lar_cluster3d::ConvexHullPathFinder::buildConvexHull(), and lar_cluster3d::MSTPathFinder::buildConvexHull().
const ConvexHull::PointList & lar_cluster3d::ConvexHull::getExtremePoints | ( | ) |
Find the two points on the hull which are furthest apart.
Definition at line 206 of file ConvexHull.cxx.
References fConvexHull, and fExtremePoints.
Referenced by getMinMaxPointPair().
const reco::ConvexHullKinkTupleList & lar_cluster3d::ConvexHull::getKinkPoints | ( | ) |
Find the points with the largest angles.
Definition at line 274 of file ConvexHull.cxx.
References fConvexHull, fKinkAngle, fKinkPoints, and fMinEdgeDistance.
Referenced by getMinMaxPointPair().
|
inline |
find the ends of the convex hull (along its x axis)
Definition at line 62 of file ConvexHull.h.
References fMinMaxPointPair, getExtremePoints(), and getKinkPoints().
|
inline |
recover the list of points used to build convex hull
Definition at line 52 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 50 of file ConvexHull.cxx.
References crossProduct().
Referenced by findNearestEdge(), getConvexHull(), and getConvexHullArea().
|
private |
Definition at line 116 of file ConvexHull.h.
Referenced by Area(), ConvexHull(), findNearestEdge(), getConvexHull(), getExtremePoints(), and getKinkPoints().
|
private |
Definition at line 118 of file ConvexHull.h.
Referenced by ConvexHull(), and getConvexHullArea().
|
private |
Definition at line 119 of file ConvexHull.h.
Referenced by getExtremePoints().
|
private |
Definition at line 112 of file ConvexHull.h.
Referenced by getKinkPoints().
|
private |
Definition at line 120 of file ConvexHull.h.
Referenced by getKinkPoints().
|
private |
Definition at line 113 of file ConvexHull.h.
Referenced by getKinkPoints().
|
private |
Definition at line 117 of file ConvexHull.h.
Referenced by getConvexHull(), and getMinMaxPointPair().
|
private |
Definition at line 115 of file ConvexHull.h.
Referenced by ConvexHull(), and getPointsList().