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);
133 _out <<
"Min[" << _b.
Min() <<
"] Max[" << _b.
Max() <<
"]";
172 const double _min,
const double _max)
const;
191 const double _min,
const double _max)
const;
212 const double _min,
const double _max)
const;
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:39
Box operator+(const Box &_b) const
Addition operator.
const Vector3d & Min() const
Get the minimum corner.
Box()
Default constructor.
bool Contains(const Vector3d &_p) const
Check if a point lies inside the box.
friend std::ostream & operator<<(std::ostream &_out, const ignition::math::Box &_b)
Output operator.
Definition Box.hh:130
bool operator!=(const Box &_b) const
Inequality test operator.
std::tuple< bool, double, Vector3d > Intersect(const Line3d &_line) const
Check if a line intersects the box.
const Box & operator+=(const Box &_b)
Addition set operator.
bool operator==(const Box &_b) const
Equality test operator.
Vector3d & Max()
Get a mutable version of the maximum corner.
const Vector3d & Max() const
Get the maximum corner.
math::Vector3d Size() const
Get the size of the box.
Box & operator=(const Box &_b)
Assignment operator.
Box operator-(const Vector3d &_v)
Subtract a vector from the min and max values.
void Merge(const Box &_box)
Merge a box with this box.
bool Intersects(const Box &_box) const
Test box intersection.
double ZLength() const
Get the length along the z dimension.
math::Vector3d Center() const
Get the box center.
virtual ~Box()
Destructor.
Vector3d & Min()
Get a mutable version of the minimum corner.
std::tuple< bool, double, Vector3d > Intersect(const Vector3d &_origin, const Vector3d &_dir, const double _min, const double _max) const
Check if a ray (origin, direction) intersects the box.
double YLength() const
Get the length along the y dimension.
Box(const Vector3d &_vec1, const Vector3d &_vec2)
Constructor.
double XLength() const
Get the length along the x dimension.
bool IntersectCheck(const Vector3d &_origin, const Vector3d &_dir, const double _min, const double _max) const
Check if a ray (origin, direction) intersects the box.
std::tuple< bool, double > IntersectDist(const Vector3d &_origin, const Vector3d &_dir, const double _min, const double _max) const
Check if a ray (origin, direction) intersects the box.
Box(const Box &_b)
Copy Constructor.
Box(double _vec1X, double _vec1Y, double _vec1Z, double _vec2X, double _vec2Y, double _vec2Z)
Constructor.
A three dimensional line segment.
Definition Line3.hh:35
The Vector3 class represents the generic vector containing 3 elements.
Definition Vector3.hh:40