All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Public Attributes | Friends | List of all members
gazebo::math::Vector2i Class Reference

Generic integer x, y vector. More...

#include <math/gzmath.hh>

Public Member Functions

 Vector2i ()
 Constructor. More...
 
 Vector2i (const int &_x, const int &_y)
 Constructor. More...
 
 Vector2i (const Vector2i &_pt)
 Copy onstructor. More...
 
virtual ~Vector2i ()
 Destructor. More...
 
Vector2i Cross (const Vector2i &_pt) const
 Return the cross product of this vector and _pt. More...
 
int Distance (const Vector2i &_pt) const
 Calc distance to the given point. More...
 
bool IsFinite () const
 See if a point is finite (e.g., not nan) More...
 
void Normalize ()
 Normalize the vector length. More...
 
bool operator!= (const Vector2i &_v) const
 Equality operators. More...
 
const Vector2i operator* (const Vector2i &_v) const
 Multiplication operator. More...
 
const Vector2i operator* (int _v) const
 Multiplication operator. More...
 
const Vector2ioperator*= (const Vector2i &_v)
 Multiplication operators. More...
 
const Vector2ioperator*= (int _v)
 Multiplication operator. More...
 
Vector2i operator+ (const Vector2i &_v) const
 Addition operator. More...
 
const Vector2ioperator+= (const Vector2i &_v)
 Addition assignment operator. More...
 
Vector2i operator- (const Vector2i &_v) const
 Subtraction operator. More...
 
const Vector2ioperator-= (const Vector2i &_v)
 Subtraction operators. More...
 
const Vector2i operator/ (const Vector2i &_v) const
 Division operator. More...
 
const Vector2i operator/ (int _v) const
 Division operator. More...
 
const Vector2ioperator/= (const Vector2i &_v)
 Division operator. More...
 
const Vector2ioperator/= (int _v)
 Division operator. More...
 
Vector2ioperator= (const Vector2i &_v)
 Assignment operator. More...
 
const Vector2ioperator= (int _value)
 Assignment operator. More...
 
bool operator== (const Vector2i &_v) const
 Equality operator. More...
 
int operator[] (unsigned int _index) const
 Array subscript operator. More...
 
void Set (int _x, int _y)
 Set the contents of the vector. More...
 

Public Attributes

int x
 x data More...
 
int y
 y data More...
 

Friends

std::ostream & operator<< (std::ostream &_out, const gazebo::math::Vector2i &_pt)
 Stream insertion operator. More...
 
std::istream & operator>> (std::istream &_in, gazebo::math::Vector2i &_pt)
 Stream extraction operator. More...
 

Detailed Description

Generic integer x, y vector.

Constructor & Destructor Documentation

gazebo::math::Vector2i::Vector2i ( )

Constructor.

gazebo::math::Vector2i::Vector2i ( const int &  _x,
const int &  _y 
)

Constructor.

Parameters
[in]_xvalue along x
[in]_yvalue along y
gazebo::math::Vector2i::Vector2i ( const Vector2i _pt)

Copy onstructor.

Parameters
[in]_pta point
virtual gazebo::math::Vector2i::~Vector2i ( )
virtual

Destructor.

Member Function Documentation

Vector2i gazebo::math::Vector2i::Cross ( const Vector2i _pt) const

Return the cross product of this vector and _pt.

Parameters
[in]_ptthe other vector
Returns
the product
int gazebo::math::Vector2i::Distance ( const Vector2i _pt) const

Calc distance to the given point.

Parameters
[in]_pta point
Returns
the distance
bool gazebo::math::Vector2i::IsFinite ( ) const

See if a point is finite (e.g., not nan)

Returns
the result
void gazebo::math::Vector2i::Normalize ( )

Normalize the vector length.

bool gazebo::math::Vector2i::operator!= ( const Vector2i _v) const

Equality operators.

Parameters
_vthe vector to compare with
Returns
true if component have different values, false otherwise
const Vector2i gazebo::math::Vector2i::operator* ( const Vector2i _v) const

Multiplication operator.

Remarks
this is an element wise multiplication
Parameters
[in]_vthe vector
Returns
the result
const Vector2i gazebo::math::Vector2i::operator* ( int  _v) const

Multiplication operator.

Parameters
[in]_vthe scaling factor
Returns
the result
const Vector2i& gazebo::math::Vector2i::operator*= ( const Vector2i _v)

Multiplication operators.

Remarks
this is an element wise multiplication
Parameters
[in]_vthe vector
Returns
this
const Vector2i& gazebo::math::Vector2i::operator*= ( int  _v)

Multiplication operator.

Parameters
[in]_vscaling factor
Returns
this
Vector2i gazebo::math::Vector2i::operator+ ( const Vector2i _v) const

Addition operator.

Parameters
[in]_vthe vector to add
Returns
the sum vector
const Vector2i& gazebo::math::Vector2i::operator+= ( const Vector2i _v)

Addition assignment operator.

Parameters
[in]_vthe vector to add
Returns
this
Vector2i gazebo::math::Vector2i::operator- ( const Vector2i _v) const

Subtraction operator.

Parameters
[in]_vthe vector to substract
Returns
the result vector
const Vector2i& gazebo::math::Vector2i::operator-= ( const Vector2i _v)

Subtraction operators.

Parameters
[in]_vthe vector to substract
Returns
this
const Vector2i gazebo::math::Vector2i::operator/ ( const Vector2i _v) const

Division operator.

Remarks
this is an element wise division.
Parameters
[in]_vthe vector to divide
Returns
the result
const Vector2i gazebo::math::Vector2i::operator/ ( int  _v) const

Division operator.

Remarks
this is an element wise division.
Parameters
[in]_vthe vector to divide
Returns
the result
const Vector2i& gazebo::math::Vector2i::operator/= ( const Vector2i _v)

Division operator.

Remarks
this is an element wise division.
Parameters
[in]_vthe vector to divide
Returns
this
const Vector2i& gazebo::math::Vector2i::operator/= ( int  _v)

Division operator.

Remarks
this is an element wise division.
Parameters
[in]_vthe vector to divide
Returns
this
Vector2i& gazebo::math::Vector2i::operator= ( const Vector2i _v)

Assignment operator.

Parameters
[in]_vthe value
Returns
this
const Vector2i& gazebo::math::Vector2i::operator= ( int  _value)

Assignment operator.

Parameters
[in]_valuethe value for x and y
Returns
this
bool gazebo::math::Vector2i::operator== ( const Vector2i _v) const

Equality operator.

Parameters
_vthe vector to compare with
Returns
true if component have the same values, false otherwise
int gazebo::math::Vector2i::operator[] ( unsigned int  _index) const

Array subscript operator.

Parameters
[in]_indexthe array index
void gazebo::math::Vector2i::Set ( int  _x,
int  _y 
)

Set the contents of the vector.

Parameters
[in]_xvalue along x
[in]_yvalue along y

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  _out,
const gazebo::math::Vector2i _pt 
)
friend

Stream insertion operator.

Parameters
[in]_outoutput stream
[in]ptVector2i to output
Returns
the stream
std::istream& operator>> ( std::istream &  _in,
gazebo::math::Vector2i _pt 
)
friend

Stream extraction operator.

Parameters
[in]_ininput stream
[in]_ptVector3 to read values into
Returns
The stream

Member Data Documentation

int gazebo::math::Vector2i::x

x data

int gazebo::math::Vector2i::y

y data


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