Belle II Software  release-08-01-10
Polygon2D Class Reference

2D polygon. More...

#include <Polygon2D.h>

Collaboration diagram for Polygon2D:

Public Member Functions

 Polygon2D (const HepGeom::Point3D< double > *points, int n)
 Constructor. More...
 
 Polygon2D (const Polygon2D &)=delete
 Copy constructor (disabled).
 
Polygon2Doperator= (const Polygon2D &)=delete
 Operator = (disabled).
 
 ~Polygon2D ()
 Destructor.
 
bool pointInside (const HepGeom::Point3D< double > &point) const
 Check if point is inside the polygon.
 
bool hasIntersection (const LineSegment2D &lineSegment) const
 Check whether polygon has an intersection with a line segment or this line segment is fully inside the polygon. More...
 
bool hasIntersection (const Arc2D &arc) const
 Check whether polygon has an intersection with an arc or this arc is fully inside the polygon. More...
 
bool hasIntersection (const Polygon2D &polygon) const
 Check whether polygon has an intersection with a polygon or one of the polygons is fully inside another polygon. More...
 
LineSegment2D ** getLineSegments () const
 Get line segments.
 

Private Attributes

int m_nPoints
 Number of points.
 
LineSegment2D ** m_LineSegments
 Line segments.
 

Detailed Description

2D polygon.

Definition at line 29 of file Polygon2D.h.

Constructor & Destructor Documentation

◆ Polygon2D()

Polygon2D ( const HepGeom::Point3D< double > *  points,
int  n 
)

Constructor.

Parameters
[in]pointsPoints.
[in]nNumber of points.

Definition at line 17 of file Polygon2D.cc.

17  :
18  m_nPoints(n)
19 {
20  int i;
21  m_LineSegments = new LineSegment2D*[n];
22  for (i = 0; i < n; i++) {
23  if (i < n - 1)
24  m_LineSegments[i] = new LineSegment2D(points[i], points[i + 1]);
25  else
26  m_LineSegments[i] = new LineSegment2D(points[i], points[0]);
27  }
28 }
int m_nPoints
Number of points.
Definition: Polygon2D.h:92
LineSegment2D ** m_LineSegments
Line segments.
Definition: Polygon2D.h:95

Member Function Documentation

◆ hasIntersection() [1/3]

bool hasIntersection ( const Arc2D arc) const

Check whether polygon has an intersection with an arc or this arc is fully inside the polygon.

Parameters
[in]arcArc.

Definition at line 76 of file Polygon2D.cc.

◆ hasIntersection() [2/3]

bool hasIntersection ( const LineSegment2D lineSegment) const

Check whether polygon has an intersection with a line segment or this line segment is fully inside the polygon.

Parameters
[in]lineSegmentLine segment.

Definition at line 63 of file Polygon2D.cc.

◆ hasIntersection() [3/3]

bool hasIntersection ( const Polygon2D polygon) const

Check whether polygon has an intersection with a polygon or one of the polygons is fully inside another polygon.

Parameters
[in]polygonPolygon.

Definition at line 89 of file Polygon2D.cc.


The documentation for this class was generated from the following files: