17 #ifndef IGNITION_MATH_BOX_HH_ 18 #define IGNITION_MATH_BOX_HH_ 25 #include <ignition/math/config.hh> 31 inline namespace IGNITION_MATH_VERSION_NAMESPACE
38 class IGNITION_MATH_VISIBLE
Box 62 public:
Box(
double _vec1X,
double _vec1Y,
double _vec1Z,
63 double _vec2X,
double _vec2Y,
double _vec2Z);
67 public:
Box(
const Box &_b);
70 public:
virtual ~
Box();
74 public:
double XLength()
const;
78 public:
double YLength()
const;
82 public:
double ZLength()
const;
94 public:
void Merge(
const Box &_box);
99 public:
Box &operator=(
const Box &_b);
104 public:
Box operator+(
const Box &_b)
const;
109 public:
const Box &operator+=(
const Box &_b);
114 public:
bool operator==(
const Box &_b)
const;
119 public:
bool operator!=(
const Box &_b)
const;
131 const ignition::math::Box &_b)
133 _out <<
"Min[" << _b.Min() <<
"] Max[" << _b.Max() <<
"]";
139 public:
const Vector3d &Min()
const;
143 public:
const Vector3d &Max()
const;
158 public:
bool Intersects(
const Box &_box)
const;
163 public:
bool Contains(
const Vector3d &_p)
const;
172 const double _min,
const double _max)
const;
189 public: std::tuple<bool, double> IntersectDist(
191 const double _min,
const double _max)
const;
210 public: std::tuple<bool, double, Vector3d> Intersect(
212 const double _min,
const double _max)
const;
222 public: std::tuple<bool, double, Vector3d> Intersect(
223 const Line3d &_line)
const;
231 private:
bool ClipLine(
const int _d,
const Line3d &_line,
232 double &_low,
double &_high)
const;
235 private: BoxPrivate *dataPtr;
Mathematical representation of a box and related functions.
Definition: Box.hh:38
A three dimensional line segment.
Definition: Line3.hh:34
Vector3< double > Vector3d
Definition: Vector3.hh:756
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
friend std::ostream & operator<<(std::ostream &_out, const ignition::math::Box &_b)
Output operator.
Definition: Box.hh:130