OWLNext 7.0
Borland's Object Windows Library for the modern age
|
The tagSIZE struct is defined as. More...
#include <owl/geometry.h>
Public Member Functions | |
TSize () | |
Default constructor that does nothing. | |
TSize (int dx, int dy) | |
Creates a TSize object with cx = dx and cy = dy. | |
TSize (const tagPOINT &point) | |
Creates a TSize object with cx = point.x and cy = point.y. | |
TSize (const tagSIZE &size) | |
Creates a TSize object with cx = size.cx and cy = size.cy. | |
TSize (const TSize &size) | |
Creates a TSize object with cx = size.cx and cy = size.cy. | |
TSize (DWORD packedExtents) | |
Creates a size by extracting the extents from the given argument. | |
bool | operator== (const TSize &other) const |
Returns true if this TSize object is equal to the other TSize object; otherwise returns false. | |
bool | operator!= (const TSize &other) const |
Returns false if this TSize object is equal to the other TSize object; otherwise returns true. | |
int | X () const |
Returns the width. | |
int | Y () const |
Returns the height. | |
int | Magnitude () const |
Returns the length of the diagonal of the rectangle represented by this object. | |
TSize | operator+ (const TSize &size) const |
Calculates an offset to this TSize object using the given size argument as the displacement. | |
TSize | operator- (const TSize &size) const |
Calculates a negative offset to this TSize object using the given size argument as the displacement. | |
TSize | operator- () const |
Returns the TSize object (-cx, -cy). This object is not changed. | |
TSize & | operator+= (const TSize &size) |
Offsets this TSize object by the given size argument. | |
TSize & | operator-= (const TSize &size) |
Negatively offsets this TSize object by the given size argument. | |
The tagSIZE struct is defined as.
TSize encapsulates the notion of a two-dimensional quantity that usually represents a displacement or the height and width of a rectangle. TSize inherits the two data members cx and cy from tagSIZE. Member functions and operators are provided for comparing, assigning, and manipulating sizes. Overloaded << and >> operators allow chained insertion and extraction of TSize objects with streams.
Definition at line 234 of file geometry.h.
|
inline |
Default constructor that does nothing.
Definition at line 1406 of file geometry.h.
Creates a TSize object with cx = dx and cy = dy.
Definition at line 1416 of file geometry.h.
|
inline |
Creates a TSize object with cx = point.x and cy = point.y.
Definition at line 1426 of file geometry.h.
|
inline |
Creates a TSize object with cx = size.cx and cy = size.cy.
Definition at line 1436 of file geometry.h.
|
inline |
Creates a TSize object with cx = size.cx and cy = size.cy.
Definition at line 1446 of file geometry.h.
|
inlineexplicit |
Creates a size by extracting the extents from the given argument.
The constructor assumes that the low-word of the given argument is the horizontal extent and the high-word of the given argument is the vertical extent.
Definition at line 1459 of file geometry.h.
int owl::TSize::Magnitude | ( | ) | const |
Returns the length of the diagonal of the rectangle represented by this object.
The value returned is an int approximation to the square root of (cx2 + cy2).
Definition at line 81 of file geometry.cpp.
References owl::Sqrt().
Returns false if this TSize object is equal to the other TSize object; otherwise returns true.
Definition at line 1507 of file geometry.h.
References owl::ToBool().
Calculates an offset to this TSize object using the given size argument as the displacement.
Returns the object (cx + size.cx, cy + size.cy). This TSize object is not changed.
Definition at line 1518 of file geometry.h.
References TSize().
Offsets this TSize object by the given size argument.
This TSize object is changed to (cx + size.cx, cy + size.cy). Returns a reference to this object.
Definition at line 1539 of file geometry.h.
|
inline |
Returns the TSize object (-cx, -cy). This object is not changed.
Definition at line 1487 of file geometry.h.
References TSize().
Calculates a negative offset to this TSize object using the given size argument as the displacement.
Returns the point (cx - size.cx, cy - size.cy). This object is not changed.
Definition at line 1529 of file geometry.h.
References TSize().
Negatively offsets this TSize object by the given size argument.
This object is changed to (cx - size.cx, cy - size.cy). Returns a reference to this object.
Definition at line 1551 of file geometry.h.
Returns true if this TSize object is equal to the other TSize object; otherwise returns false.
Definition at line 1497 of file geometry.h.
References owl::ToBool().
|
inline |
Returns the width.
Definition at line 1469 of file geometry.h.
|
inline |
Returns the height.
Definition at line 1478 of file geometry.h.