Public Member Functions | Public Attributes | Friends | List of all members
gazebo::math::Box Class Reference

Mathematical representation of a box and related functions. More...

#include <math/gzmath.hh>

Public Member Functions

 Box ()
 Default constructor. More...
 
 Box (const Vector3 &_vec1, const Vector3 &_vec2)
 Constructor. More...
 
 Box (const ignition::math::Box &_box)
 Ignition math copy constructor. More...
 
 Box (const Box &_b)
 Copy Constructor. More...
 
virtual ~Box ()
 Destructor. More...
 
bool Contains (const math::Vector3 &_p) const
 Check if a point lies inside or on the box. More...
 
math::Vector3 GetCenter () const
 Get the box center. More...
 
math::Vector3 GetSize () const
 Get the size of the box. More...
 
double GetXLength () const
 Get the length along the x dimension. More...
 
double GetYLength () const
 Get the length along the y dimension. More...
 
double GetZLength () const
 Get the length along the z dimension. More...
 
ignition::math::Box Ign () const
 Convert this box to an ignition::math::Box. More...
 
void Merge (const Box &_box)
 Merge a box with this box. More...
 
Box operator+ (const Box &_b) const
 Addition operator. More...
 
const Boxoperator+= (const Box &_b)
 Addition set operator. More...
 
Box operator- (const Vector3 &_v)
 Subtract a vector from the min and max values. More...
 
Boxoperator= (const ignition::math::Box &_b)
 Assignment operator for ignition math. More...
 
Boxoperator= (const Box &_b)
 Assignment operator. More...
 
bool operator== (const Box &_b) const
 Equality test operatoer. More...
 

Public Attributes

Vector3 max
 Maximum corner of the box. More...
 
Vector3 min
 Minimum corner of the box. More...
 

Friends

std::ostream & operator<< (std::ostream &_out, const gazebo::math::Box &_b)
 Output operator. More...
 

Detailed Description

Mathematical representation of a box and related functions.

Constructor & Destructor Documentation

gazebo::math::Box::Box ( )

Default constructor.

gazebo::math::Box::Box ( const Vector3 _vec1,
const Vector3 _vec2 
)

Constructor.

This constructor will compute the box's minumum and maximum corners based on the two arguments.

Parameters
[in]_vec1One corner of the box
[in]_vec2Another corner of the box
gazebo::math::Box::Box ( const ignition::math::Box &  _box)

Ignition math copy constructor.

Parameters
[in]_boxIgnition box to convert
gazebo::math::Box::Box ( const Box _b)

Copy Constructor.

Parameters
[in]_bBox to copy
virtual gazebo::math::Box::~Box ( )
virtual

Destructor.

Member Function Documentation

bool gazebo::math::Box::Contains ( const math::Vector3 _p) const

Check if a point lies inside or on the box.

Parameters
[in]_pPoint to check.
Returns
True if the point is inside or on the box.
math::Vector3 gazebo::math::Box::GetCenter ( ) const

Get the box center.

Returns
The center position of the box
math::Vector3 gazebo::math::Box::GetSize ( ) const

Get the size of the box.

Returns
Size of the box
double gazebo::math::Box::GetXLength ( ) const

Get the length along the x dimension.

Returns
Double value of the length in the x dimension
double gazebo::math::Box::GetYLength ( ) const

Get the length along the y dimension.

Returns
Double value of the length in the y dimension
double gazebo::math::Box::GetZLength ( ) const

Get the length along the z dimension.

Returns
Double value of the length in the z dimension
ignition::math::Box gazebo::math::Box::Ign ( ) const

Convert this box to an ignition::math::Box.

Returns
This Box as an ignition::math::Box.
void gazebo::math::Box::Merge ( const Box _box)

Merge a box with this box.

Parameters
[in]_boxBox to add to this box
Box gazebo::math::Box::operator+ ( const Box _b) const

Addition operator.

result = this + _b

Parameters
[in]_bBox to add
Returns
The new box
const Box& gazebo::math::Box::operator+= ( const Box _b)

Addition set operator.

this = this + _b

Parameters
[in]_bBox to add
Returns
This new box
Box gazebo::math::Box::operator- ( const Vector3 _v)

Subtract a vector from the min and max values.

Parameters
_vThe vector to use during subtraction
Returns
The new box
Box& gazebo::math::Box::operator= ( const ignition::math::Box &  _b)

Assignment operator for ignition math.

Parameters
[in]_ba new value
Returns
The new box
Box& gazebo::math::Box::operator= ( const Box _b)

Assignment operator.

Set this box to the parameter

Parameters
[in]_bBox to copy
Returns
The new box.
bool gazebo::math::Box::operator== ( const Box _b) const

Equality test operatoer.

Parameters
[in]_bBox to test
Returns
True if equal

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  _out,
const gazebo::math::Box _b 
)
friend

Output operator.

Parameters
[in]_outOutput stream
[in]_bBox to output to the stream
Returns
The stream

Member Data Documentation

Vector3 gazebo::math::Box::max

Maximum corner of the box.

Vector3 gazebo::math::Box::min

Minimum corner of the box.


The documentation for this class was generated from the following file: