CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
Box.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 
24  class Box : public IVolume {
25 
26  public:
27  Box(CoordinateSystemPtr cs, LengthType const x, LengthType const y,
28  LengthType const z);
29 
30  Box(CoordinateSystemPtr cs, LengthType const side);
31 
33  bool contains(Point const& p) const override;
34 
35  Point const& getCenter() const { return center_; };
36  CoordinateSystemPtr const getCoordinateSystem() const { return cs_; }
37 
38  LengthType const getX() const { return x_; }
39  LengthType const getY() const { return y_; }
40  LengthType const getZ() const { return z_; }
41 
42  std::string asString() const;
43 
44  template <typename TDim>
45  void rotate(QuantityVector<TDim> const& axis, double const angle);
46 
47  protected:
48  Point center_;
49  CoordinateSystemPtr cs_; // local coordinate system with center_ in coordinate (0, 0,
50  // 0) and user defined orientation
51  LengthType x_;
52  LengthType y_;
53  LengthType z_;
54  };
55 
56 } // namespace corsika
57 
58 #include <corsika/detail/framework/geometry/Box.inl>
Import and extend the phys::units package.
`, since they are used everywhere as integral part of the framework.
std::shared_ptr< CoordinateSystem const > CoordinateSystemPtr
To refer to CoordinateSystems, only the CoordinateSystemPtr must be used.
bool contains(Point const &p) const override
returns true if the Point p is within the sphere
Describes a sphere in space.
Definition: Box.hpp:24