File indexing completed on 2024-04-06 12:31:03
0001 #ifndef BoundingBox_h
0002 #define BoundingBox_h
0003
0004 #include <utility>
0005
0006 class BoundingBox {
0007 private:
0008 double r_min;
0009 double r_max;
0010 double z_min;
0011 double z_max;
0012
0013 public:
0014 BoundingBox() : r_min(0.), r_max(0.), z_min(0.), z_max(0.) {}
0015
0016 BoundingBox(const double& min_r, const double& max_r, const double& min_z, const double& max_z)
0017 : r_min(min_r), r_max(max_r), z_min(min_z), z_max(max_z) {}
0018
0019 void grow(const double& r, const double& z);
0020
0021 void grow(const double& skin);
0022
0023 inline bool inside(const double& r, const double& z) const {
0024 return (r >= r_min and r <= r_max and z >= z_min and z <= z_max);
0025 };
0026
0027 std::pair<double, double> range_r() const { return std::make_pair(r_min, r_max); }
0028
0029 std::pair<double, double> range_z() const { return std::make_pair(z_min, z_max); }
0030 };
0031
0032 #endif