Belle II Software  release-05-01-25
Polygon2D.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2015 Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Kirill Chilikin *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 /* KLM headers. */
14 #include <klm/eklm/geometry/Arc2D.h>
15 #include <klm/eklm/geometry/LineSegment2D.h>
16 
17 /* CLHEP headers. */
18 #include <CLHEP/Geometry/Point3D.h>
19 
20 namespace Belle2 {
26  namespace EKLM {
27 
31  class Polygon2D {
32 
33  public:
34 
40  Polygon2D(const HepGeom::Point3D<double>* points, int n);
41 
45  Polygon2D(const Polygon2D&) = delete;
46 
50  Polygon2D& operator=(const Polygon2D&) = delete;
51 
55  ~Polygon2D();
56 
60  bool pointInside(const HepGeom::Point3D<double>& point) const;
61 
67  bool hasIntersection(const LineSegment2D& lineSegment) const;
68 
74  bool hasIntersection(const Arc2D& arc) const;
75 
81  bool hasIntersection(const Polygon2D& polygon) const;
82 
86  LineSegment2D** getLineSegments() const
87  {
88  return m_LineSegments;
89  }
90 
91  private:
92 
94  int m_nPoints;
95 
98 
99  };
100 
101  }
102 
104 }
Belle2::EKLM::Polygon2D::operator=
Polygon2D & operator=(const Polygon2D &)=delete
Operator = (disabled).
Belle2::EKLM::Polygon2D::Polygon2D
Polygon2D(const HepGeom::Point3D< double > *points, int n)
Constructor.
Definition: Polygon2D.cc:19
Belle2::EKLM::Polygon2D::hasIntersection
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:65
Belle2::EKLM::LineSegment2D
2D line segment.
Definition: LineSegment2D.h:38
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::EKLM::Polygon2D::m_nPoints
int m_nPoints
Number of points.
Definition: Polygon2D.h:102
Belle2::EKLM::Polygon2D::m_LineSegments
LineSegment2D ** m_LineSegments
Line segments.
Definition: Polygon2D.h:105
Belle2::EKLM::Polygon2D::pointInside
bool pointInside(const HepGeom::Point3D< double > &point) const
Check if point is inside the polygon.
Definition: Polygon2D.cc:40
HepGeom::Point3D< double >
Belle2::EKLM::Polygon2D::getLineSegments
LineSegment2D ** getLineSegments() const
Get line segments.
Definition: Polygon2D.h:94
Belle2::EKLM::Polygon2D::~Polygon2D
~Polygon2D()
Destructor.
Definition: Polygon2D.cc:32