LArSoft
v07_13_02
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 * > |
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... | |
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... | |
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 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*> |
projected x,y position and 3D hit
Definition at line 31 of file ConvexHull.h.
using lar_cluster3d::ConvexHull::PointList = std::list<Point> |
The list of the projected points.
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, |
float | kinkAngle = 0.85 , |
||
float | minEdgeDistance = 0.35 |
||
) |
Constructor.
pset |
Definition at line 31 of file ConvexHull.cxx.
References Area(), fConvexHull, fConvexHullArea, fPoints, and getConvexHull().
|
virtual |
|
private |
Computes the area of the enclosed convext hull.
Definition at line 73 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 60 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 394 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 333 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::ConvexHullPathFinder::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 109 of file ConvexHull.cxx.
References fConvexHull, fMinMaxPointPair, and isLeft().
|
inline |
recover the area of the convex hull
Definition at line 76 of file ConvexHull.h.
References Area(), crossProduct(), fConvexHullArea, findNearestDistance(), findNearestEdge(), getConvexHull(), and isLeft().
Referenced by lar_cluster3d::ClusterPathFinder::buildConvexHull(), lar_cluster3d::ConvexHullPathFinder::buildConvexHull(), and lar_cluster3d::VoronoiPathFinder::buildConvexHull().
const ConvexHull::PointList & lar_cluster3d::ConvexHull::getExtremePoints | ( | ) |
Find the two points on the hull which are furthest apart.
Definition at line 209 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 278 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 61 of file ConvexHull.h.
References fMinMaxPointPair, getExtremePoints(), and getKinkPoints().
|
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 51 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().