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 Vector2i & | operator*= (const Vector2i &_v) |
Multiplication operators. More... | |
const Vector2i & | operator*= (int _v) |
Multiplication operator. More... | |
Vector2i | operator+ (const Vector2i &_v) const |
Addition operator. More... | |
const Vector2i & | operator+= (const Vector2i &_v) |
Addition assignment operator. More... | |
Vector2i | operator- (const Vector2i &_v) const |
Subtraction operator. More... | |
const Vector2i & | operator-= (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 Vector2i & | operator/= (const Vector2i &_v) |
Division operator. More... | |
const Vector2i & | operator/= (int _v) |
Division operator. More... | |
Vector2i & | operator= (const Vector2i &_v) |
Assignment operator. More... | |
Vector2i & | operator= (const ignition::math::Vector2i &_v) |
Assignment operator for ignition math. More... | |
const Vector2i & | operator= (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... | |
Generic integer x, y vector.
Vector2i | ( | ) |
Constructor.
Vector2i | ( | const int & | _x, |
const int & | _y | ||
) |
Constructor.
[in] | _x | value along x |
[in] | _y | value along y |
Vector2i | ( | const ignition::math::Vector2i & | _pt | ) |
Copy constructor for ignition math.
[in] | _pt | a point |
|
virtual |
Destructor.
Return the cross product of this vector and _pt.
[in] | _pt | the other vector |
int Distance | ( | const Vector2i & | _pt | ) | const |
Calc distance to the given point.
[in] | _pt | a point |
ignition::math::Vector2i Ign | ( | ) | const |
Convert this vector to ignition::math::Vector2i.
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.
_v | the vector to compare with |
Multiplication operator.
[in] | _v | the vector |
const Vector2i operator* | ( | int | _v | ) | const |
Multiplication operator.
[in] | _v | the scaling factor |
Multiplication operators.
[in] | _v | the vector |
const Vector2i& operator*= | ( | int | _v | ) |
Multiplication operator.
[in] | _v | scaling factor |
Addition operator.
[in] | _v | the vector to add |
Addition assignment operator.
[in] | _v | the vector to add |
Subtraction operator.
[in] | _v | the vector to substract |
Subtraction operators.
[in] | _v | the vector to substract |
Division operator.
[in] | _v | the vector to divide |
const Vector2i operator/ | ( | int | _v | ) | const |
Division operator.
[in] | _v | the vector to divide |
Division operator.
[in] | _v | the vector to divide |
const Vector2i& operator/= | ( | int | _v | ) |
Division operator.
[in] | _v | the vector to divide |
Assignment operator.
[in] | _v | the value |
Vector2i& operator= | ( | const ignition::math::Vector2i & | _v | ) |
Assignment operator for ignition math.
[in] | _v | the value |
const Vector2i& operator= | ( | int | _value | ) |
Assignment operator.
[in] | _value | the value for x and y |
bool operator== | ( | const Vector2i & | _v | ) | const |
Equality operator.
_v | the vector to compare with |
int operator[] | ( | unsigned int | _index | ) | const |
Array subscript operator.
[in] | _index | the array index |
void Set | ( | int | _x, |
int | _y | ||
) |
Set the contents of the vector.
[in] | _x | value along x |
[in] | _y | value along y |
|
friend |
Stream insertion operator.
[in] | _out | output stream |
[in] | pt | Vector2i to output |
|
friend |
Stream extraction operator.
[in] | _in | input stream |
[in] | _pt | Vector3 to read values into |
int x |
x data
int y |
y data