17 #ifndef IGNITION_MATH_ORIENTEDBOX_HH_ 18 #define IGNITION_MATH_ORIENTEDBOX_HH_ 25 #include <ignition/math/config.hh> 31 inline namespace IGNITION_MATH_VERSION_NAMESPACE
48 : size(_size), pose(_pose)
51 this->size = this->size.Abs();
58 : size(_size), pose(
Pose3<T>::Zero)
61 this->size = this->size.Abs();
67 : size(_b.size), pose(_b.pose)
80 return this->size.X();
87 return this->size.Y();
94 return this->size.Z();
117 this->size = _size.
Abs();
132 this->size = _b.size;
133 this->pose = _b.pose;
142 return this->size == _b.size && this->pose == _b.pose;
150 return this->size != _b.size || this->pose != _b.pose;
160 _out <<
"Size[" << _b.
Size() <<
"] Pose[" << _b.
Pose() <<
"]";
173 return p.
X() >= -this->size.X()*0.5 && p.X() <= this->size.X()*0.5 &&
174 p.Y() >= -this->size.Y()*0.5 && p.Y() <= this->size.Y()*0.5 &&
175 p.Z() >= -this->size.Z()*0.5 && p.Z() <= this->size.Z()*0.5;
OrientedBox(const Vector3< T > &_size)
Constructor which takes only the size.
Definition: OrientedBox.hh:57
OrientedBox & operator=(const OrientedBox< T > &_b)
Assignment operator.
Definition: OrientedBox.hh:130
void Pose(Pose3< T > &_pose)
Set the box pose.
Definition: OrientedBox.hh:122
OrientedBox()
Default constructor.
Definition: OrientedBox.hh:39
bool operator!=(const OrientedBox< T > &_b) const
Inequality test operator.
Definition: OrientedBox.hh:148
OrientedBox(const OrientedBox< T > &_b)
Copy constructor.
Definition: OrientedBox.hh:66
OrientedBox(const Vector3< T > &_size, const Pose3< T > &_pose)
Constructor which takes size and pose.
Definition: OrientedBox.hh:47
friend std::ostream & operator<<(std::ostream &_out, const OrientedBox< T > &_b)
Output operator.
Definition: OrientedBox.hh:157
OrientedBox< int > OrientedBoxi
Definition: OrientedBox.hh:185
Encapsulates a position and rotation in three space.
Definition: Pose3.hh:33
const Pose3< T > & Pose() const
Get the box pose, which is the pose of its center.
Definition: OrientedBox.hh:106
Mathematical representation of a box which can be arbitrarily positioned and rotated.
Definition: OrientedBox.hh:36
void Size(Vector3< T > &_size)
Set the box size.
Definition: OrientedBox.hh:114
virtual ~OrientedBox()
Destructor.
Definition: OrientedBox.hh:72
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
OrientedBox< float > OrientedBoxf
Definition: OrientedBox.hh:187
T X() const
Get the x value.
Definition: Vector3.hh:647
T XLength() const
Get the length along the x dimension.
Definition: OrientedBox.hh:78
T ZLength() const
Get the length along the z dimension.
Definition: OrientedBox.hh:92
A 4x4 matrix class.
Definition: Matrix4.hh:36
const Vector3< T > & Size() const
Get the size of the box.
Definition: OrientedBox.hh:99
bool operator==(const OrientedBox< T > &_b) const
Equality test operator.
Definition: OrientedBox.hh:140
Vector3 Abs() const
Get the absolute value of the vector.
Definition: Vector3.hh:222
bool Contains(const Vector3d &_p) const
Check if a point lies inside the box.
Definition: OrientedBox.hh:167
T YLength() const
Get the length along the y dimension.
Definition: OrientedBox.hh:85
OrientedBox< double > OrientedBoxd
Definition: OrientedBox.hh:186