2 Component Integer Point. More...
#include <decPoint.h>
Public Member Functions | |
Constructors and Destructors | |
| decPoint () | |
| Creates a new point initialized to ( 0,0 ). | |
| decPoint (int nx, int ny) | |
| Creates a new point with the given values. | |
| decPoint (const decPoint &p) | |
| Creates a new point with the values of another point. | |
Management | |
| float | Length () const |
| Retrieves the length of the point. | |
| void | SetZero () |
| Sets all components to 0. | |
| void | Set (int nx, int ny) |
| Sets the components to the given values. | |
Operators | |
| decPoint | operator- () const |
| Retrieves the negation of this point. | |
| decPoint & | operator= (const decPoint &p) |
| Sets the components of this point to the values of another one. | |
| decPoint & | operator+= (const decPoint &p) |
| Adds the components of another point to this one. | |
| decPoint & | operator-= (const decPoint &p) |
| Subtracts the components of another point from this point. | |
| decPoint & | operator*= (float k) |
| Multiplies the components of this point with a value k. | |
| decPoint & | operator/= (float k) |
| Divides the components of this point by a value k. | |
| decPoint | operator+ (const decPoint &p) const |
| Retrieves a new point with the sum of this point with another one. | |
| decPoint | operator- (const decPoint &p) const |
| Retrieves a new point with the difference of this point to another one. | |
| decPoint | operator* (float k) const |
| Retrieves a new point with this point scaled by k. | |
| int | operator* (const decPoint &p) const |
| Calculates the dot product of this point with another one. | |
| decPoint | operator/ (float k) const |
| Retrieves a new point with this point divided by k. | |
| bool | operator== (const decPoint &p) const |
| Determines if this point is component wise equal to another point. | |
| bool | operator!= (const decPoint &p) const |
| Determines if this point is component wise not equal to another point. | |
| bool | operator< (const decPoint &p) const |
| Determines if all the components of this point are less then the components of another one. | |
| bool | operator> (const decPoint &p) const |
| Determines if all the components of this point are greater then the components of another one. | |
| 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. | |
| 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. | |
Public Attributes | |
| int | x |
| X Component of point. | |
| int | y |
| Y Component of point. | |
2 Component Integer Point.
| decPoint::decPoint | ( | ) | [inline] |
Creates a new point initialized to ( 0,0 ).
Referenced by operator*(), operator+(), operator-(), and operator/().
| decPoint::decPoint | ( | int | nx, |
| int | ny | ||
| ) | [inline] |
| decPoint::decPoint | ( | const decPoint & | p ) | [inline] |
| float decPoint::Length | ( | ) | const |
Retrieves the length of the point.
| bool decPoint::operator!= | ( | const decPoint & | p ) | const [inline] |
| decPoint decPoint::operator* | ( | float | k ) | const [inline] |
Retrieves a new point with this point scaled by k.
References decPoint(), x, and y.
| int decPoint::operator* | ( | const decPoint & | p ) | const [inline] |
| decPoint& decPoint::operator*= | ( | float | k ) | [inline] |
Retrieves a new point with the sum of this point with another one.
References decPoint(), x, and y.
| decPoint decPoint::operator- | ( | ) | const [inline] |
Retrieves the negation of this point.
References decPoint(), x, and y.
Retrieves a new point with the difference of this point to another one.
References decPoint(), x, and y.
| decPoint decPoint::operator/ | ( | float | k ) | const [inline] |
Retrieves a new point with this point divided by k.
If k is 0 an exception is thrown.
References decPoint(), THROW, x, and y.
| decPoint& decPoint::operator/= | ( | float | k ) | [inline] |
| bool decPoint::operator< | ( | const decPoint & | p ) | const [inline] |
| bool decPoint::operator<= | ( | const decPoint & | p ) | const [inline] |
| bool decPoint::operator== | ( | const decPoint & | p ) | const [inline] |
| bool decPoint::operator> | ( | const decPoint & | p ) | const [inline] |
| bool decPoint::operator>= | ( | const decPoint & | p ) | const [inline] |
| void decPoint::Set | ( | int | nx, |
| int | ny | ||
| ) | [inline] |
| int decPoint::x |
X Component of point.
Referenced by decPoint(), decBoundary::MapPoint(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), Set(), and SetZero().
| int decPoint::y |
Y Component of point.
Referenced by decPoint(), decBoundary::MapPoint(), operator!=(), operator*(), operator*=(), operator+(), operator+=(), operator-(), operator-=(), operator/(), operator/=(), operator<(), operator<=(), operator=(), operator==(), operator>(), operator>=(), Set(), and SetZero().
1.7.2