CORSIKA8  0.0.0
The framework to simulate particle cascades for astroparticle physics
Sphere.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 
12 #include <corsika/framework/geometry/Point.hpp>
13 #include <corsika/framework/geometry/Line.hpp>
14 #include <corsika/framework/geometry/IVolume.hpp>
15 
16 namespace corsika {
17 
23  class Sphere : public IVolume {
24 
25  public:
26  Sphere(Point const& pCenter, LengthType const pRadius)
27  : center_(pCenter)
28  , radius_(pRadius) {}
29 
31  bool contains(Point const& p) const override;
32 
33  Point const& getCenter() const;
34 
35  void setCenter(Point const&);
36 
37  LengthType getRadius() const;
38 
39  void setRadius(LengthType const);
40 
41  private:
42  Point center_;
43  LengthType radius_;
44  };
45 
46 } // namespace corsika
47 
48 #include <corsika/detail/framework/geometry/Sphere.inl>
Import and extend the phys::units package.
The cascade namespace assembles all objects needed to simulate full particles cascades.
bool contains(Point const &p) const override
returns true if the Point p is within the sphere
Describes a sphere in space.
Definition: Sphere.hpp:23