Belle II Software development
Polygon2D.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11/* KLM headers. */
12#include <klm/eklm/geometry/Arc2D.h>
13#include <klm/eklm/geometry/LineSegment2D.h>
14
15/* CLHEP headers. */
16#include <CLHEP/Geometry/Point3D.h>
17
18namespace Belle2 {
24 namespace EKLM {
25
29 class Polygon2D {
30
31 public:
32
38 Polygon2D(const HepGeom::Point3D<double>* points, int n);
39
43 Polygon2D(const Polygon2D&) = delete;
44
48 Polygon2D& operator=(const Polygon2D&) = delete;
49
53 ~Polygon2D();
54
58 bool pointInside(const HepGeom::Point3D<double>& point) const;
59
65 bool hasIntersection(const LineSegment2D& lineSegment) const;
66
72 bool hasIntersection(const Arc2D& arc) const;
73
79 bool hasIntersection(const Polygon2D& polygon) const;
80
85 {
86 return m_LineSegments;
87 }
88
89 private:
90
93
96
97 };
98
99 }
100
102}
Polygon2D & operator=(const Polygon2D &)=delete
Operator = (disabled).
int m_nPoints
Number of points.
Definition: Polygon2D.h:92
Polygon2D(const Polygon2D &)=delete
Copy constructor (disabled).
bool pointInside(const HepGeom::Point3D< double > &point) const
Check if point is inside the polygon.
Definition: Polygon2D.cc:38
bool hasIntersection(const LineSegment2D &lineSegment) const
Check whether polygon has an intersection with a line segment or this line segment is fully inside th...
Definition: Polygon2D.cc:63
LineSegment2D ** m_LineSegments
Line segments.
Definition: Polygon2D.h:95
~Polygon2D()
Destructor.
Definition: Polygon2D.cc:30
LineSegment2D ** getLineSegments() const
Get line segments.
Definition: Polygon2D.h:84
Abstract base class for different kinds of events.