Parasol Planning Library (PPL)
NSphericalShell.h
Go to the documentation of this file.
1 #ifndef PMPL_N_SPHERICAL_SHELL_H_
2 #define PMPL_N_SPHERICAL_SHELL_H_
3 
4 #include <cstddef>
5 #include <iostream>
6 #include <limits>
7 #include <vector>
8 
9 
17 
18  public:
19 
22 
28  explicit NSphericalShell(const size_t _n,
29  const double _outer = std::numeric_limits<double>::max(),
30  const double _inner = 0);
31 
36  explicit NSphericalShell(const std::vector<double>& _center,
37  const double _outer = std::numeric_limits<double>::max(),
38  const double _inner = 0);
39 
40  virtual ~NSphericalShell() noexcept;
41 
45 
47  size_t GetDimension() const noexcept;
48 
51  void SetCenter(const std::vector<double>& _c) noexcept;
52 
54  const std::vector<double>& GetCenter() const noexcept;
55 
57  double GetOuterRadius() const noexcept;
58 
60  double GetInnerRadius() const noexcept;
61 
63  void SetOuterRadius(const double _r) noexcept;
64 
66  void SetInnerRadius(const double _r) noexcept;
67 
70  void Translate(const std::vector<double>& _v) noexcept;
71 
73  double GetVolume() const noexcept;
74 
80 
84  bool Contains(const std::vector<double>& _p) const noexcept;
85 
91  double Clearance(std::vector<double> _p) const noexcept;
92 
96  std::vector<double> ClearancePoint(std::vector<double> _p) const noexcept;
97 
101 
104  std::vector<double> Sample() const;
105 
107 
108  private:
109 
112 
113  std::vector<double> m_center;
114  double m_outerRadius;
115  double m_innerRadius;
116 
118 
119  friend std::istream& operator>>(std::istream& _is, NSphericalShell& _sphere);
120 };
121 
122 /*----------------------------------- I/O ------------------------------------*/
123 
124 std::istream&
125 operator>>(std::istream& _is, NSphericalShell& _sphere);
126 
127 std::ostream&
128 operator<<(std::ostream& _os, const NSphericalShell& _sphere);
129 
130 /*----------------------------------------------------------------------------*/
131 
132 #endif
Definition: NSphericalShell.h:16
void SetCenter(const std::vector< double > &_c) noexcept
Definition: NSphericalShell.cpp:36
std::vector< double > Sample() const
Definition: NSphericalShell.cpp:158
double GetInnerRadius() const noexcept
Get the inner radius.
Definition: NSphericalShell.cpp:59
double Clearance(std::vector< double > _p) const noexcept
Definition: NSphericalShell.cpp:109
bool Contains(const std::vector< double > &_p) const noexcept
Definition: NSphericalShell.cpp:102
void SetInnerRadius(const double _r) noexcept
Set the inner radius.
Definition: NSphericalShell.cpp:73
double GetVolume() const noexcept
Compute the (hyper)volume or Lebesgue measure.
Definition: NSphericalShell.cpp:89
std::vector< double > ClearancePoint(std::vector< double > _p) const noexcept
Definition: NSphericalShell.cpp:126
void SetOuterRadius(const double _r) noexcept
Set the outer radius.
Definition: NSphericalShell.cpp:66
void Translate(const std::vector< double > &_v) noexcept
Definition: NSphericalShell.cpp:80
NSphericalShell(const size_t _n, const double _outer=std::numeric_limits< double >::max(), const double _inner=0)
Definition: NSphericalShell.cpp:12
size_t GetDimension() const noexcept
Get the dimension of this sphere.
Definition: NSphericalShell.cpp:29
const std::vector< double > & GetCenter() const noexcept
Get the center point.
Definition: NSphericalShell.cpp:45
double GetOuterRadius() const noexcept
Get the outer radius.
Definition: NSphericalShell.cpp:52
virtual ~NSphericalShell() noexcept