All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator 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 <Vector2i.hh>

Public Member Functions

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

Public Attributes

int x
 x data
 
int y
 y data
 

Friends

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

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]theother 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: