LArSoft
v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
|
#include "Polygon2D.h"
Public Member Functions | |
Polygon2D () | |
Polygon2D (const std::vector< std::pair< float, float > > &points) | |
Polygon2D (const Polygon2D &poly1, const Polygon2D &poly2) | |
unsigned int | Size () const |
Create Intersection Polygon. More... | |
const std::pair< float, float > & | Point (unsigned int p) const |
std::pair< float, float > | Project (const std::pair< float, float > &, float) const |
float | Area () const |
float | Perimeter () const |
bool | Overlap (float slope, const Polygon2D &poly2, const std::pair< float, float > &origin) const |
bool | PolyOverlap (const Polygon2D &poly2) const |
bool | PolyOverlapSegments (const Polygon2D &poly2) const |
bool | PointInside (const std::pair< float, float > &point) const |
bool | Contained (const Polygon2D &poly2) const |
void | UntanglePolygon () |
check if poly2 is inside poly1 More... | |
Private Attributes | |
std::vector< std::pair< float, float > > | vertices |
Definition at line 37 of file Polygon2D.h.
|
inline |
|
inline |
Definition at line 49 of file Polygon2D.cxx.
References GetIntersection(), Point(), PointInside(), PolyOverlap(), SegmentOverlap(), Size(), and vertices.
float Polygon2D::Area | ( | ) | const |
Definition at line 96 of file Polygon2D.cxx.
References vertices.
Referenced by cmtool::CFAlgoVolumeOverlap::Float(), cmtool::CFAlgoWireOverlap::Float(), and Size().
bool Polygon2D::Contained | ( | const Polygon2D & | poly2 | ) | const |
Definition at line 271 of file Polygon2D.cxx.
References Point(), PointInside(), and Size().
Referenced by cmtool::CFAlgoVolumeOverlap::Float(), cmtool::CFAlgoWireOverlap::Float(), PolyOverlapSegments(), and Size().
bool Polygon2D::Overlap | ( | float | slope, |
const Polygon2D & | poly2, | ||
const std::pair< float, float > & | origin | ||
) | const |
Definition at line 180 of file Polygon2D.cxx.
References Project().
Referenced by PolyOverlap(), and Size().
float Polygon2D::Perimeter | ( | ) | const |
const std::pair< float, float > & Polygon2D::Point | ( | unsigned int | p | ) | const |
Definition at line 135 of file Polygon2D.cxx.
References vertices.
Referenced by Contained(), cmtool::CFAlgoWireOverlap::Float(), cmtool::CFAlgoVolumeOverlap::Float(), PointInside(), Polygon2D(), PolyOverlap(), PolyOverlapSegments(), and Size().
bool Polygon2D::PointInside | ( | const std::pair< float, float > & | point | ) | const |
Definition at line 249 of file Polygon2D.cxx.
References Point(), SegmentOverlap(), and Size().
Referenced by cmtool::CBAlgoCenterOfMass::Bool(), cmtool::CBAlgoCenterOfMassSmall::Bool(), Contained(), Polygon2D(), and Size().
bool Polygon2D::PolyOverlap | ( | const Polygon2D & | poly2 | ) | const |
Definition at line 199 of file Polygon2D.cxx.
References FindSlope(), Overlap(), Point(), and Size().
Referenced by Polygon2D(), and Size().
bool Polygon2D::PolyOverlapSegments | ( | const Polygon2D & | poly2 | ) | const |
Definition at line 227 of file Polygon2D.cxx.
References Contained(), Point(), SegmentOverlap(), and Size().
Referenced by Size().
std::pair< float, float > Polygon2D::Project | ( | const std::pair< float, float > & | p, |
float | theta | ||
) | const |
Definition at line 153 of file Polygon2D.cxx.
References vertices.
|
inline |
Create Intersection Polygon.
Definition at line 47 of file Polygon2D.h.
References Area(), Contained(), geo::origin(), Overlap(), Perimeter(), Point(), PointInside(), PolyOverlap(), PolyOverlapSegments(), Project(), and UntanglePolygon().
Referenced by Contained(), cmtool::CFAlgoWireOverlap::Float(), cmtool::CFAlgoVolumeOverlap::Float(), PointInside(), Polygon2D(), PolyOverlap(), and PolyOverlapSegments().
void Polygon2D::UntanglePolygon | ( | ) |
check if poly2 is inside poly1
Definition at line 286 of file Polygon2D.cxx.
References SegmentOverlap(), tmp, and vertices.
Referenced by cmtool::CFAlgoVolumeOverlap::Float(), cmtool::CFAlgoWireOverlap::Float(), and Size().
|
private |
Definition at line 40 of file Polygon2D.h.
Referenced by Area(), Perimeter(), Point(), Polygon2D(), Project(), and UntanglePolygon().