tbx  0.7.6
Public Member Functions | Public Attributes | List of all members
tbx::Point Class Reference

Class to represent a position in two dimensional space. More...

#include <point.h>

Public Member Functions

 Point ()
 Construct an uninitialised point. More...
 
 Point (int ix, int iy)
 Construct a point from the give coordinates. More...
 
 Point (const Point &other)
 Construct a point as a copy of another point. More...
 
Pointoperator= (const Point &other)
 Assign this point to the same value as another. More...
 
bool operator== (const Point &other) const
 Check if this point is the same as another. More...
 
bool operator!= (const Point &other) const
 Check if this point is different from another. More...
 
Size operator- (const Point &other) const
 Subtract another point from this one. More...
 
bool operator< (const Point &other) const
 Check if this points is less than another. More...
 
bool operator<= (const Point &other) const
 Check if this points is less than or equal another. More...
 
bool operator> (const Point &other) const
 Check if this points is greater than another. More...
 
bool operator>= (const Point &other) const
 Check if this points is greater than or equal to another. More...
 

Public Attributes

int x
 
int y
 

Detailed Description

Class to represent a position in two dimensional space.

Constructor & Destructor Documentation

◆ Point() [1/3]

tbx::Point::Point ( )
inline

Construct an uninitialised point.

The x and y values are undefined until set

◆ Point() [2/3]

tbx::Point::Point ( int  ix,
int  iy 
)
inline

Construct a point from the give coordinates.

Parameters
ixx coordinate
iyy coordinate

◆ Point() [3/3]

tbx::Point::Point ( const Point other)
inline

Construct a point as a copy of another point.

Parameters
otherpoint to copy

Member Function Documentation

◆ operator!=()

bool tbx::Point::operator!= ( const Point other) const
inline

Check if this point is different from another.

Parameters
otherpoint to compare with
Returns
true if this point is different

◆ operator-()

Size tbx::Point::operator- ( const Point other) const
inline

Subtract another point from this one.

Parameters
otherpoint to subtract
Returns
Size with x difference as width, y difference has height

◆ operator<()

bool tbx::Point::operator< ( const Point other) const
inline

Check if this points is less than another.

Check is x < other.x and y < other.y

Parameters
otherpoint to compare with
Returns
true if x & y coordinates are both less

◆ operator<=()

bool tbx::Point::operator<= ( const Point other) const
inline

Check if this points is less than or equal another.

Check is x <= other.x and y <= other.y

Parameters
otherpoint to compare with
Returns
true if x & y coordinates are both less than or equal

◆ operator=()

Point& tbx::Point::operator= ( const Point other)
inline

Assign this point to the same value as another.

Parameters
otherpoint to copy
Returns
*this

◆ operator==()

bool tbx::Point::operator== ( const Point other) const
inline

Check if this point is the same as another.

Parameters
otherpoint to compare with
Returns
true if this point is the same

◆ operator>()

bool tbx::Point::operator> ( const Point other) const
inline

Check if this points is greater than another.

Check is x > other.x and y > other.y

Parameters
otherpoint to compare with
Returns
true if x & y coordinates are both greater

◆ operator>=()

bool tbx::Point::operator>= ( const Point other) const
inline

Check if this points is greater than or equal to another.

Check is x >= other.x and y >= other.y

Parameters
otherpoint to compare with
Returns
true if x & y coordinates are both greater than or equal

Member Data Documentation

◆ x

int tbx::Point::x

x coordinate of the point

◆ y

int tbx::Point::y

y coordinate of the point


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