HerdSoftware  0.4.0
Segment.h
Go to the documentation of this file.
1 /*
2  * Segment.h
3  *
4  * Created on: 4 Mar 2022
5  * Author: Valerio Formato
6  */
7 
8 #ifndef HERD_SEGMENT_H
9 #define HERD_SEGMENT_H
10 
11 // HerdSoftware headers
14 
15 namespace Herd {
16 
17 class Segment {
18 public:
20  Segment(Point start, Point end) : m_start(std::move(start)), m_end(std::move(end)) {}
21 
22  [[nodiscard]] Point Start() const { return m_start; }
23  [[nodiscard]] Point End() const { return m_end; }
24 
25  [[nodiscard]] float Length() const { return (m_end - m_start).Mag(); }
26 
27  bool operator==(const Segment &rhs) const { return m_start == rhs.m_start && m_end == rhs.m_end; }
28 
29 private:
32 };
33 
34 } // namespace Herd
35 
36 #endif
Herd::Segment::Length
float Length() const
Definition: Segment.h:25
Point.h
Herd::Vec3D
A class describing a vector in 3D space.
Definition: Vec3D.h:33
DEFAULT_INIT
#define DEFAULT_INIT(x)
Definition: DefaultValues.h:23
Herd::Segment::m_start
Point m_start
Definition: Segment.h:30
Herd
CssGeoParams.h CssGeoParams class declaration.
Definition: CaloPDCalibrationAlgo.h:22
Herd::Segment::Segment
Segment(Point start, Point end)
Definition: Segment.h:20
Herd::Segment::operator==
bool operator==(const Segment &rhs) const
Definition: Segment.h:27
Herd::Segment::Start
Point Start() const
Definition: Segment.h:22
Herd::Segment::Segment
Segment()
Definition: Segment.h:19
Herd::Segment::m_end
Point m_end
Definition: Segment.h:31
Herd::Segment
Definition: Segment.h:17
Herd::Segment::End
Point End() const
Definition: Segment.h:23
DefaultValues.h