OWLNext 7.0
Borland's Object Windows Library for the modern age
|
TPoint is a support class, derived from tagPOINT. More...
#include <owl/geometry.h>
Public Member Functions | |
TPoint () | |
Constructs an uninitialized point. | |
TPoint (int _x, int _y) | |
Creates a TPoint object with the given coordinates. | |
TPoint (const tagPOINT &point) | |
Creates a TPoint object with x = point.x, y = point.y. | |
TPoint (const TPoint &point) | |
Makes a copy of the point. | |
TPoint (const tagSIZE &size) | |
Creates a TPoint object with x = size.cx and y = size.cy. | |
TPoint (LPARAM packedPoint) | |
Creates a TPoint object from a packed point. | |
bool | operator== (const TPoint &other) const |
Returns true if this point is equal to the other point; otherwise returns false. | |
bool | operator!= (const TPoint &other) const |
Returns false if this point is equal to the other point; otherwise returns true. | |
int | X () const |
Returns the x coordinate of the point. | |
int | Y () const |
Returns the Y coordinate of the point. | |
int | Magnitude () const |
Returns the distance between the origin and the point. | |
TPoint | OffsetBy (int dx, int dy) const |
Calculates an offset to this point using the given displacement arguments. | |
TPoint | operator+ (const TSize &size) const |
Calculates an offset to this point using the given size argument as the displacement. | |
TSize | operator- (const TPoint &point) const |
Calculates a distance from this point to the point argument. | |
TPoint | operator- (const TSize &size) const |
Calculates a negative offset to this point using the given size argument as the displacement. | |
TPoint | operator- () const |
Returns the point (-x, -y). This point is not changed. | |
TPoint & | Offset (int dx, int dy) |
Offsets this point by the given delta arguments. | |
TPoint & | operator+= (const TSize &size) |
Offsets this point by the given size argument. | |
TPoint & | operator-= (const TSize &size) |
Negatively offsets this point by the given size argument. | |
TPoint is a support class, derived from tagPOINT.
The tagPOINT struct is defined as
TPoint encapsulates the notion of a two-dimensional point that usually represents a screen position. TPoint inherits two data members, the coordinates x and y, from tagPOINT. Member functions and operators are provided for comparing, assigning, and manipulating points. Overloaded << and >> operators allow chained insertion and extraction of TPoint objects with streams.
Definition at line 87 of file geometry.h.
|
inline |
Constructs an uninitialized point.
Definition at line 413 of file geometry.h.
Creates a TPoint object with the given coordinates.
Definition at line 423 of file geometry.h.
|
inline |
Creates a TPoint object with x = point.x, y = point.y.
Definition at line 433 of file geometry.h.
|
inline |
Makes a copy of the point.
Definition at line 443 of file geometry.h.
|
inline |
Creates a TPoint object with x = size.cx and y = size.cy.
Definition at line 453 of file geometry.h.
|
explicit |
Creates a TPoint object from a packed point.
The given point must be encoded as in the LPARAM argument of a Windows message such as the WM_CONTEXTMENU message.
Definition at line 61 of file geometry.cpp.
int owl::TPoint::Magnitude | ( | ) | const |
Returns the distance between the origin and the point.
Definition at line 70 of file geometry.cpp.
References owl::Sqrt().
Offsets this point by the given delta arguments.
This point is changed to (x + dx, y + dy). Returns a reference to this point.
Definition at line 551 of file geometry.h.
Calculates an offset to this point using the given displacement arguments.
Returns the point (x + dx, y + dy). This point is not changed.
Definition at line 482 of file geometry.h.
References TPoint().
Returns false if this point is equal to the other point; otherwise returns true.
Definition at line 509 of file geometry.h.
References owl::ToBool().
Calculates an offset to this point using the given size argument as the displacement.
Returns the point (x + size.cx, y + size.cy). This point is not changed.
Definition at line 520 of file geometry.h.
References TPoint().
Offsets this point by the given size argument.
This point is changed to(x + size.cx, y + size.cy). Returns a reference to this point.
Definition at line 563 of file geometry.h.
|
inline |
Returns the point (-x, -y). This point is not changed.
Definition at line 491 of file geometry.h.
References TPoint().
Calculates a distance from this point to the point argument.
Returns the TSize object (x - point.x, y - point.y). This point is not changed.
Definition at line 530 of file geometry.h.
Calculates a negative offset to this point using the given size argument as the displacement.
Returns the point (x - size.cx, y - size.cy). This point is not changed.
Definition at line 541 of file geometry.h.
References TPoint().
Negatively offsets this point by the given size argument.
This point is changed to (x - size.cx, y - size.cy). Returns a reference to this point.
Definition at line 575 of file geometry.h.
Returns true if this point is equal to the other point; otherwise returns false.
Definition at line 500 of file geometry.h.
References owl::ToBool().
|
inline |
Returns the x coordinate of the point.
Definition at line 463 of file geometry.h.
|
inline |
Returns the Y coordinate of the point.
Definition at line 472 of file geometry.h.