17 #ifndef IGNITION_MATH_ORIENTEDBOX_HH_ 18 #define IGNITION_MATH_ORIENTEDBOX_HH_ 45 : size(_size), pose(_pose)
48 this->size = this->size.Abs();
55 : size(_size), pose(
Pose3<T>::Zero)
58 this->size = this->size.Abs();
64 : size(_b.size), pose(_b.pose)
77 return this->size.X();
84 return this->size.Y();
91 return this->size.Z();
114 this->size = _size.
Abs();
129 this->size = _b.size;
130 this->pose = _b.pose;
139 return this->size == _b.size && this->pose == _b.pose;
147 return this->size != _b.size || this->pose != _b.pose;
157 _out <<
"Size[" << _b.
Size() <<
"] Pose[" << _b.
Pose() <<
"]";
170 return p.
X() >= -this->size.X()*0.5 && p.X() <= this->size.X()*0.5 &&
171 p.Y() >= -this->size.Y()*0.5 && p.Y() <= this->size.Y()*0.5 &&
172 p.Z() >= -this->size.Z()*0.5 && p.Z() <= this->size.Z()*0.5;
T X() const
Get the x value.
Definition: Vector3.hh:635
OrientedBox & operator=(const OrientedBox< T > &_b)
Assignment operator.
Definition: OrientedBox.hh:127
const Pose3< T > & Pose() const
Get the box pose, which is the pose of its center.
Definition: OrientedBox.hh:103
OrientedBox(const Vector3< T > &_size)
Constructor which takes only the size.
Definition: OrientedBox.hh:54
const Vector3< T > & Size() const
Get the size of the box.
Definition: OrientedBox.hh:96
Encapsulates a position and rotation in three space.
Definition: Pose3.hh:30
A 4x4 matrix class.
Definition: Matrix4.hh:33
Vector3 Abs() const
Get the absolute value of the vector.
Definition: Vector3.hh:219
OrientedBox()
Default constructor.
Definition: OrientedBox.hh:36
OrientedBox< int > OrientedBoxi
Definition: OrientedBox.hh:182
bool operator!=(const OrientedBox< T > &_b) const
Inequality test operator.
Definition: OrientedBox.hh:145
void Size(Vector3< T > &_size)
Set the box size.
Definition: OrientedBox.hh:111
OrientedBox< double > OrientedBoxd
Definition: OrientedBox.hh:183
virtual ~OrientedBox()
Destructor.
Definition: OrientedBox.hh:69
T ZLength() const
Get the length along the z dimension.
Definition: OrientedBox.hh:89
friend std::ostream & operator<<(std::ostream &_out, const OrientedBox< T > &_b)
Output operator.
Definition: OrientedBox.hh:154
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:36
bool operator==(const OrientedBox< T > &_b) const
Equality test operator.
Definition: OrientedBox.hh:137
OrientedBox< float > OrientedBoxf
Definition: OrientedBox.hh:184
Mathematical representation of a box which can be arbitrarily positioned and rotated.
Definition: OrientedBox.hh:33
OrientedBox(const OrientedBox< T > &_b)
Copy constructor.
Definition: OrientedBox.hh:63
OrientedBox(const Vector3< T > &_size, const Pose3< T > &_pose)
Constructor which takes size and pose.
Definition: OrientedBox.hh:44
bool Contains(const Vector3d &_p) const
Check if a point lies inside the box.
Definition: OrientedBox.hh:164
void Pose(Pose3< T > &_pose)
Set the box pose.
Definition: OrientedBox.hh:119
T XLength() const
Get the length along the x dimension.
Definition: OrientedBox.hh:75
T YLength() const
Get the length along the y dimension.
Definition: OrientedBox.hh:82