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 constructor. More...
 
 Vector2i (const ignition::math::Vector2i &_pt)
 Copy constructor for ignition math. 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...
 
ignition::math::Vector2i Ign () const
 Convert this vector to ignition::math::Vector2i. 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...
 
Vector2ioperator= (const ignition::math::Vector2i &_v)
 Assignment operator for ignition math. 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

§ Vector2i() [1/4]

Vector2i ( )

Constructor.

§ Vector2i() [2/4]

Vector2i ( const int &  _x,
const int &  _y 
)

Constructor.

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

§ Vector2i() [3/4]

Vector2i ( const Vector2i _pt)

Copy constructor.

Parameters
[in]_pta point

§ Vector2i() [4/4]

Vector2i ( const ignition::math::Vector2i &  _pt)

Copy constructor for ignition math.

Parameters
[in]_pta point

§ ~Vector2i()

virtual ~Vector2i ( )
virtual

Destructor.

Member Function Documentation

§ Cross()

Vector2i Cross ( const Vector2i _pt) const

Return the cross product of this vector and _pt.

Parameters
[in]_ptthe other vector
Returns
the product

§ Distance()

int Distance ( const Vector2i _pt) const

Calc distance to the given point.

Parameters
[in]_pta point
Returns
the distance

§ Ign()

ignition::math::Vector2i Ign ( ) const

Convert this vector to ignition::math::Vector2i.

Returns
Return an ignition::math::Vector2i representation of this vector.

§ IsFinite()

bool IsFinite ( ) const

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

Returns
the result

§ Normalize()

void Normalize ( )

Normalize the vector length.

§ operator!=()

bool operator!= ( const Vector2i _v) const

Equality operators.

Parameters
_vthe vector to compare with
Returns
true if component have different values, false otherwise

§ operator*() [1/2]

const Vector2i operator* ( const Vector2i _v) const

Multiplication operator.

Remarks
this is an element wise multiplication
Parameters
[in]_vthe vector
Returns
the result

§ operator*() [2/2]

const Vector2i operator* ( int  _v) const

Multiplication operator.

Parameters
[in]_vthe scaling factor
Returns
the result

§ operator*=() [1/2]

const Vector2i& operator*= ( const Vector2i _v)

Multiplication operators.

Remarks
this is an element wise multiplication
Parameters
[in]_vthe vector
Returns
this

§ operator*=() [2/2]

const Vector2i& operator*= ( int  _v)

Multiplication operator.

Parameters
[in]_vscaling factor
Returns
this

§ operator+()

Vector2i operator+ ( const Vector2i _v) const

Addition operator.

Parameters
[in]_vthe vector to add
Returns
the sum vector

§ operator+=()

const Vector2i& operator+= ( const Vector2i _v)

Addition assignment operator.

Parameters
[in]_vthe vector to add
Returns
this

§ operator-()

Vector2i operator- ( const Vector2i _v) const

Subtraction operator.

Parameters
[in]_vthe vector to substract
Returns
the result vector

§ operator-=()

const Vector2i& operator-= ( const Vector2i _v)

Subtraction operators.

Parameters
[in]_vthe vector to substract
Returns
this

§ operator/() [1/2]

const Vector2i operator/ ( const Vector2i _v) const

Division operator.

Remarks
this is an element wise division.
Parameters
[in]_vthe vector to divide
Returns
the result

§ operator/() [2/2]

const Vector2i operator/ ( int  _v) const

Division operator.

Remarks
this is an element wise division.
Parameters
[in]_vthe vector to divide
Returns
the result

§ operator/=() [1/2]

const Vector2i& operator/= ( const Vector2i _v)

Division operator.

Remarks
this is an element wise division.
Parameters
[in]_vthe vector to divide
Returns
this

§ operator/=() [2/2]

const Vector2i& operator/= ( int  _v)

Division operator.

Remarks
this is an element wise division.
Parameters
[in]_vthe vector to divide
Returns
this

§ operator=() [1/3]

Vector2i& operator= ( const Vector2i _v)

Assignment operator.

Parameters
[in]_vthe value
Returns
this

§ operator=() [2/3]

Vector2i& operator= ( const ignition::math::Vector2i &  _v)

Assignment operator for ignition math.

Parameters
[in]_vthe value
Returns
this

§ operator=() [3/3]

const Vector2i& operator= ( int  _value)

Assignment operator.

Parameters
[in]_valuethe value for x and y
Returns
this

§ operator==()

bool operator== ( const Vector2i _v) const

Equality operator.

Parameters
_vthe vector to compare with
Returns
true if component have the same values, false otherwise

§ operator[]()

int operator[] ( unsigned int  _index) const

Array subscript operator.

Parameters
[in]_indexthe array index

§ Set()

void 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

§ operator<<

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

§ operator>>

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

§ x

int x

x data

§ y

int y

y data


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