Loading...
Searching...
No Matches
Math::IntPoint Struct Reference

2D Point with integer coords More...

`#include <src/math/intpoint.h>`

## Public Member Functions

| IntPoint (int aX=0, int aY=0)
bool | operator== (const IntPoint &p) const
bool | operator!= (const IntPoint &p) const
float | Length () const
void | LoadZero ()
| Sets the zero point: (0,0).
int * | Array ()
| Returns the struct cast to `int*` array; use with care!
const int * | Array () const
| Returns the struct cast to const int* array; use with care!
IntPoint | operator- () const
| Returns the inverted point.
const IntPoint & | operator+= (const IntPoint &right)
| Adds the given point.
const IntPoint & | operator-= (const IntPoint &right)
| Subtracts the given point.
const IntPoint & | operator*= (const float &right)
| Multiplies by given scalar.
const IntPoint & | operator/= (const float &right)
| Divides by given scalar.
std::string | ToString () const
| Returns a string "[x, y]".

## Public Attributes

int | x
| X coord.
int | y
| Y coord.

## Friends

const IntPoint | operator+ (const IntPoint &left, const IntPoint &right)
| Adds two points.
const IntPoint | operator- (const IntPoint &left, const IntPoint &right)
| Subtracts two points.
const IntPoint | operator* (const float &left, const IntPoint &right)
| Multiplies point by scalar.
const IntPoint | operator* (const IntPoint &left, const int &right)
| Multiplies point by scalar.
const IntPoint | operator/ (const IntPoint &left, const int &right)
| Divides point by scalar.

## Detailed Description

2D Point with integer coords

Analog of WinAPI's POINT struct.

## Member Function Documentation

## LoadZero()

void Math::IntPoint::LoadZero | ( |  | ) |

inline

Sets the zero point: (0,0).

## Array() [1/2]

int * Math::IntPoint::Array | ( |  | ) |

inline

Returns the struct cast to `int*` array; use with care!

## Array() [2/2]

const int * Math::IntPoint::Array | ( |  | ) | const

inline

Returns the struct cast to const int* array; use with care!

## operator-()

IntPoint Math::IntPoint::operator- | ( |  | ) | const

inline

Returns the inverted point.

## operator+=()

const IntPoint & Math::IntPoint::operator+= | ( | const IntPoint & | right | ) |

inline

Adds the given point.

## operator-=()

const IntPoint & Math::IntPoint::operator-= | ( | const IntPoint & | right | ) |

inline

Subtracts the given point.

## operator*=()

const IntPoint & Math::IntPoint::operator*= | ( | const float & | right | ) |

inline

Multiplies by given scalar.

## operator/=()

const IntPoint & Math::IntPoint::operator/= | ( | const float & | right | ) |

inline

Divides by given scalar.

## ToString()

std::string Math::IntPoint::ToString | ( |  | ) | const

inline

Returns a string "[x, y]".

## Friends And Related Symbol Documentation

## operator+

const IntPoint operator+ | ( | const IntPoint & | left,
|  | const IntPoint & | right )

friend

Adds two points.

## operator-

const IntPoint operator- | ( | const IntPoint & | left,
|  | const IntPoint & | right )

friend

Subtracts two points.

## operator* [1/2]

const IntPoint operator* | ( | const float & | left,
|  | const IntPoint & | right )

friend

Multiplies point by scalar.

## operator* [2/2]

const IntPoint operator* | ( | const IntPoint & | left,
|  | const int & | right )

friend

Multiplies point by scalar.

## operator/

const IntPoint operator/ | ( | const IntPoint & | left,
|  | const int & | right )

friend

Divides point by scalar.

## Member Data Documentation

## x

int Math::IntPoint::x

X coord.

## y

int Math::IntPoint::y

Y coord.

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

- src/math/intpoint.h