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

§ Box() [1/4]

Box ( )

Default constructor.

§ Box() [2/4]

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

§ Box() [3/4]

Box ( const ignition::math::Box &  _box)

Ignition math copy constructor.

Parameters
[in]_boxIgnition box to convert

§ Box() [4/4]

Box ( const Box _b)

Copy Constructor.

Parameters
[in]_bBox to copy

§ ~Box()

virtual ~Box ( )
virtual

Destructor.

Member Function Documentation

§ Contains()

bool 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.

§ GetCenter()

math::Vector3 GetCenter ( ) const

Get the box center.

Returns
The center position of the box

§ GetSize()

math::Vector3 GetSize ( ) const

Get the size of the box.

Returns
Size of the box

§ GetXLength()

double GetXLength ( ) const

Get the length along the x dimension.

Returns
Double value of the length in the x dimension

§ GetYLength()

double GetYLength ( ) const

Get the length along the y dimension.

Returns
Double value of the length in the y dimension

§ GetZLength()

double GetZLength ( ) const

Get the length along the z dimension.

Returns
Double value of the length in the z dimension

§ Ign()

ignition::math::Box Ign ( ) const

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

Returns
This Box as an ignition::math::Box.

§ Merge()

void Merge ( const Box _box)

Merge a box with this box.

Parameters
[in]_boxBox to add to this box

§ operator+()

Box operator+ ( const Box _b) const

Addition operator.

result = this + _b

Parameters
[in]_bBox to add
Returns
The new box

§ operator+=()

const Box& operator+= ( const Box _b)

Addition set operator.

this = this + _b

Parameters
[in]_bBox to add
Returns
This new box

§ operator-()

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

§ operator=() [1/2]

Box& operator= ( const ignition::math::Box &  _b)

Assignment operator for ignition math.

Parameters
[in]_ba new value
Returns
The new box

§ operator=() [2/2]

Box& operator= ( const Box _b)

Assignment operator.

Set this box to the parameter

Parameters
[in]_bBox to copy
Returns
The new box.

§ operator==()

bool operator== ( const Box _b) const

Equality test operatoer.

Parameters
[in]_bBox to test
Returns
True if equal

Friends And Related Function Documentation

§ operator<<

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

§ max

Vector3 max

Maximum corner of the box.

§ min

Vector3 min

Minimum corner of the box.


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