Drag[en]gine Game Engine
1.21
|
2 Component Integer Point. More...
#include <decPoint.h>
Public Member Functions | |
Constructors and Destructors | |
decPoint () | |
Create new point initialized to ( 0,0 ). More... | |
decPoint (int nx, int ny) | |
Create new point with the given values. More... | |
decPoint (const decPoint &p) | |
Create new point with the values of another point. More... | |
decPoint (const decVector2 &v) | |
Create new point from a vector. Fractional parts of all components are discarded. More... | |
Management | |
float | Length () const |
Length of the point. More... | |
void | SetZero () |
Sets all components to 0. More... | |
void | Set (int nx, int ny) |
Set components to the given values. More... | |
decPoint | Absolute () const |
Retrieves absolute point. More... | |
void | SetSmallest (const decPoint &p) |
Set each component to the smallest value of this point and another point. More... | |
decPoint | Smallest (const decPoint &p) const |
Retrieve point with each component set to the smallest value of this point and another point. More... | |
void | SetLargest (const decPoint &p) |
Set each component to the largest value of this point and another point. More... | |
decPoint | Largest (const decPoint &p) const |
Retrieve point with each component set to the largest value of this point and another point. More... | |
void | SetClamped (const decPoint &minValue, const decPoint &maxValue) |
Clamp each component to the provided range. More... | |
decPoint | Clamped (const decPoint &minValue, const decPoint &maxValue) const |
Retrieves point with each component clamped to the provided range. More... | |
Operators | |
decPoint | operator- () const |
Negation of this point. More... | |
decPoint & | operator= (const decPoint &p) |
Set components of this point to the values of another one. More... | |
decPoint & | operator+= (const decPoint &p) |
Adds the components of another point to this one. More... | |
decPoint & | operator-= (const decPoint &p) |
Subtracts the components of another point from this point. More... | |
decPoint & | operator*= (int k) |
Multiplies the components of this point with a value k. More... | |
decPoint & | operator/= (int k) |
Divides the components of this point by a value k. If the value k is 0 an exception is thrown. More... | |
decPoint | operator+ (const decPoint &p) const |
Retrieves a new point with the sum of this point with another one. More... | |
decPoint | operator- (const decPoint &p) const |
Retrieves a new point with the difference of this point to another one. More... | |
decPoint | operator* (int k) const |
Retrieves a new point with this point scaled by k. More... | |
int | operator* (const decPoint &p) const |
Calculates the dot product of this point with another one. More... | |
decPoint | operator/ (int k) const |
Retrieves a new point with this point divided by k. If k is 0 an exception is thrown. More... | |
bool | operator== (const decPoint &p) const |
Determines if this point is component wise equal to another point. More... | |
bool | operator!= (const decPoint &p) const |
Determines if this point is component wise not equal to another point. More... | |
bool | operator< (const decPoint &p) const |
Determines if all the components of this point are less then the components of another one. More... | |
bool | operator> (const decPoint &p) const |
Determines if all the components of this point are greater then the components of another one. More... | |
bool | operator<= (const decPoint &p) const |
Determines if all the components of this point are less then or equal to the components of another one. More... | |
bool | operator>= (const decPoint &p) const |
Determines if all the components of this point are greater then or equal to the components of another one. More... | |
Public Attributes | |
int | x |
X Component of point. More... | |
int | y |
Y Component of point. More... | |
2 Component Integer Point.
decPoint::decPoint | ( | ) |
Create new point initialized to ( 0,0 ).
decPoint::decPoint | ( | int | nx, |
int | ny | ||
) |
Create new point with the given values.
decPoint::decPoint | ( | const decPoint & | p | ) |
Create new point with the values of another point.
decPoint::decPoint | ( | const decVector2 & | v | ) |
Create new point from a vector. Fractional parts of all components are discarded.
decPoint decPoint::Absolute | ( | ) | const |
Retrieves absolute point.
Retrieves point with each component clamped to the provided range.
Retrieve point with each component set to the largest value of this point and another point.
float decPoint::Length | ( | ) | const |
Length of the point.
bool decPoint::operator!= | ( | const decPoint & | p | ) | const |
Determines if this point is component wise not equal to another point.
int decPoint::operator* | ( | const decPoint & | p | ) | const |
Calculates the dot product of this point with another one.
decPoint decPoint::operator* | ( | int | k | ) | const |
Retrieves a new point with this point scaled by k.
decPoint& decPoint::operator*= | ( | int | k | ) |
Multiplies the components of this point with a value k.
Retrieves a new point with the sum of this point with another one.
Adds the components of another point to this one.
decPoint decPoint::operator- | ( | ) | const |
Negation of this point.
Retrieves a new point with the difference of this point to another one.
Subtracts the components of another point from this point.
decPoint decPoint::operator/ | ( | int | k | ) | const |
Retrieves a new point with this point divided by k. If k is 0 an exception is thrown.
decPoint& decPoint::operator/= | ( | int | k | ) |
Divides the components of this point by a value k. If the value k is 0 an exception is thrown.
bool decPoint::operator< | ( | const decPoint & | p | ) | const |
Determines if all the components of this point are less then the components of another one.
bool decPoint::operator<= | ( | const decPoint & | p | ) | const |
Determines if all the components of this point are less then or equal to the components of another one.
Set components of this point to the values of another one.
bool decPoint::operator== | ( | const decPoint & | p | ) | const |
Determines if this point is component wise equal to another point.
bool decPoint::operator> | ( | const decPoint & | p | ) | const |
Determines if all the components of this point are greater then the components of another one.
bool decPoint::operator>= | ( | const decPoint & | p | ) | const |
Determines if all the components of this point are greater then or equal to the components of another one.
void decPoint::Set | ( | int | nx, |
int | ny | ||
) |
Set components to the given values.
Clamp each component to the provided range.
void decPoint::SetLargest | ( | const decPoint & | p | ) |
Set each component to the largest value of this point and another point.
void decPoint::SetSmallest | ( | const decPoint & | p | ) |
Set each component to the smallest value of this point and another point.
void decPoint::SetZero | ( | ) |
Sets all components to 0.
Retrieve point with each component set to the smallest value of this point and another point.
int decPoint::x |
X Component of point.
Referenced by decBoundary::MapPoint().
int decPoint::y |
Y Component of point.
Referenced by decBoundary::MapPoint().