class MASKING_DLL_DECLSPEC Point

S simple class that holds two integers representing a point in 2D space.

Public Methods

[more] Point(int x=0, int y=0)
Default constructor
[more]bool operator==(const Point &p) const
[more]bool operator!=(const Point &p) const
Operators for comparing two points
[more]bool operator<(const Rect &r) const
[more]bool operator<=(const Rect &r) const
Operators for checking whether the point is inside a rectangle or not.
[more]void operator+=(const Point &p)
[more]void operator-=(const Point &p)
[more]Point operator+(const Point &p) const
[more]Point operator-(const Point &p) const
Operators for doing simple vector arithmetic with two points.
[more]int x() const
[more]int y() const
[more]void x(int v)
[more]void y(int v)
Get and set functions

Protected Fields

[more]int posx
The underlaying x coordinate
[more]int posy
The underlaying y coordinate


Documentation

S simple class that holds two integers representing a point in 2D space. It also has a number of functions and overloaded operators for manipulating point objects.

oint posx
The underlaying x coordinate

oint posy
The underlaying y coordinate

o Point(int x=0, int y=0)
Default constructor

obool operator==(const Point &p) const

obool operator!=(const Point &p) const
Operators for comparing two points

obool operator<(const Rect &r) const

obool operator<=(const Rect &r) const
Operators for checking whether the point is inside a rectangle or not. The < operator checks the inside of the rectangle only, while <= checks for borders as well.

ovoid operator+=(const Point &p)

ovoid operator-=(const Point &p)

oPoint operator+(const Point &p) const

oPoint operator-(const Point &p) const
Operators for doing simple vector arithmetic with two points.

Examples:

      Point a(10, 20);
      Point b(30, 40);

Point c = a + b; c = (40, 60) Point d = b - a; d = (20, 20) c += a; c = (50, 80) c -= b; c = (20, 40)

oint x() const

oint y() const

ovoid x(int v)

ovoid y(int v)
Get and set functions


This class has no child classes.
See Also:
Size

Alphabetic index Hierarchy of classes


Back to front page   |   page generated with DOC++