CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
Path.hpp
1 /*
2  * (c) Copyright 2020 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
11 #include <deque>
12 #include <corsika/framework/geometry/Point.hpp>
13 
14 namespace corsika {
15 
20  class Path {
21  std::deque<Point> points_;
22  LengthType length_ = LengthType::zero();
23  public:
27  Path(Point const& point);
28 
32  Path(std::deque<Point> const& points);
33 
37  inline void addToEnd(Point const& point);
38 
42  inline void removeFromEnd();
43 
47  inline LengthType getLength() const;
48 
52  inline Point getStart() const;
53 
57  inline Point getEnd() const;
58 
62  inline Point getPoint(std::size_t const index) const;
63 
67  inline auto begin();
68 
72  inline auto end();
73 
79  inline int getNSegments() const;
80 
81  }; // class Path
82 
83 } // namespace corsika
84 
85 #include <corsika/detail/framework/geometry/Path.inl>
int getNSegments() const
Get the number of steps in the path.
void addToEnd(Point const &point)
Add a new Point to the end of the path.
void removeFromEnd()
Remove a point from the end of the path.
Point getEnd() const
Get the end point of the path.
LengthType getLength() const
Get the total length of the path.
Path(Point const &point)
Create a Path with a given starting Point.
The cascade namespace assembles all objects needed to simulate full particles cascades.
static constexpr quantity zero()
We need a "zero" of each type – for comparisons, to initialize running totals, etc.
Definition: quantity.hpp:359
auto end()
Return an iterator to the end of the Path.
auto begin()
Return an iterator to the start of the Path.
Point getStart() const
Get the starting point of the path.
Point getPoint(std::size_t const index) const
Get a specific point of the path.
This class represents a (potentially) curved path between two points using N >= 1 straight-line segme...
Definition: Path.hpp:20