HerdSoftware  0.3.2
Plane.h
Go to the documentation of this file.
1 /*
2  * Plane.h
3  *
4  * Created on: 31 May 2019
5  * Author: Lorenzo Pacini
6  */
7 
10 #ifndef HERD_PLANE_H_
11 #define HERD_PLANE_H_
12 
13 // HerdSoftware headers
14 #include "common/RefFrame.h"
15 #include "common/Vec3D.h"
16 #include "dataobjects/Line.h"
17 #include "dataobjects/Point.h"
18 
19 #ifdef HS_USE_ROOT
20 #include "Rtypes.h"
21 #endif
22 
23 namespace Herd {
24 
28 class Plane {
29 public:
39  Plane(Point point, const float polar, const float azimuth);
40 
49  Plane(Point point, Vec3D normal) : _point{std::move(point)}, _normal{std::move(normal)} { _normal /= _normal.Mag(); }
50 
59  Plane(std::array<Point, 3> points);
60 
69  Plane();
70 
72  virtual ~Plane() = default;
73 
80  inline float Polar() const { return _normal.PolarAngle(); };
81 
86  inline float Azimuth() const { return _normal.AzimuthAngle(); };
87 
92  Vec3D Normal() const { return _normal; };
93 
100  Point Origin() const { return _point; };
101 
109  Point Intersection(Line line) const;
110 
116  bool operator==(const Plane &rhs) const { return _point == rhs._point && _normal == rhs._normal; }
117 
118 private:
121 
122 #ifdef HS_USE_ROOT
123  ClassDef(Plane, 2)
124 #endif
125 };
126 
127 namespace {
128 template <> const Plane defaultValue<Plane> = Plane();
129 }
130 
131 } // namespace Herd
132 
133 #endif /* HERD_PLANE_H_ */
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:24
float Azimuth() const
Returns the azimuth angle of the plane.
Definition: Plane.h:86
float Polar() const
Returns the polar angle of the normal of the plane with respect to the NEGATIVE Z axis...
Definition: Plane.h:80
Vec3D _normal
Definition: Plane.h:120
float PolarAngle() const
Compute the polar angle.
Definition: Vec3D.h:147
A class describing a vector in 3D space.
Definition: Vec3D.h:33
Class describing a line in the 3D space.
Definition: Line.h:34
Point _point
Definition: Plane.h:119
float AzimuthAngle() const
Compute the azimuth angle.
Definition: Vec3D.h:157
Vec3D Normal() const
Returns the normal to the plane.
Definition: Plane.h:92
Plane(Point point, Vec3D normal)
Constructor.
Definition: Plane.h:49
Point Origin() const
Returns the "point of origin" of the plane.
Definition: Plane.h:100
float Mag() const
Compute the vector magnitude.
Definition: Vec3D.h:118
virtual ~Plane()=default
Virtual destructor.
Point Intersection(Line line) const
Returns the intersect between this plane and a Line If the plane and line are parallel, a point with the default coordinate: [std::numeric_limits<float>::max(), std::numeric_limits<float>::max(), std::numeric_limits<float>::max()].
Definition: Plane.cpp:48
Class describing a Plane in the 3D space.
Definition: Plane.h:28
Plane()
Default constructor.
Definition: Plane.cpp:46
bool operator==(const Plane &rhs) const
Comparison operator.
Definition: Plane.h:116