9#if !defined(OWL_GEOMETRY_H)
13#if defined(BI_HAS_PRAGMA_ONCE)
19#if !defined(OWL_OBJSTRM_H)
95 TPoint(
const tagSIZE & size);
104 int Magnitude()
const;
241 TSize(
const tagSIZE & size);
251 int Magnitude()
const;
328 operator const TPoint*()
const;
333 bool IsEmpty()
const;
347 const TPoint& TopLeft()
const;
350 TPoint BottomLeft()
const;
351 const TPoint& BottomRight()
const;
365 TRect MovedTo(
int x,
int y);
368 TRect Normalized()
const;
380 TRect& MoveTo(
int x,
int y);
522 return TPoint(x + size.cx, y + size.cy);
543 return TPoint(x - size.cx, y - size.cy);
687 return TPointL(x + size.cx, y + size.cy);
705 return TPointL(x - size.cx, y - size.cy);
911 return (
const TPoint*)
this;
1003 return TPoint(right, top);
1012 return TPoint(left, bottom);
1113 *(tagRECT *)
this =
rect;
1122 *(tagRECT *)
this = *(tagRECT *)&
rect;
1159 return ToBool(left >= right || top >= bottom);
1169 return ToBool(!left && !right && !top && !bottom);
1180 &&
other.right==right &&
other.bottom==bottom);
1214 &&
other.top >= top &&
other.bottom <= bottom);
1225 &&
other.bottom > top &&
other.top < bottom);
1260 return OffsetBy(-size.cx, -size.cy);
1312 return TRect(std::min(left, right), std::min(top, bottom),
1313 std::max(left, right), std::max(top, bottom));
1326 std::min(right,
other.right), std::min(bottom,
other.bottom));
1327 return TRect(0, 0, 0, 0);
1338 std::max(right,
other.right), std::max(bottom,
other.bottom));
1363 return *
this += -
delta;
1373 right = x +
Width();
1489 return TSize(-cx, -cy);
1520 return TSize(cx+size.cx, cy+size.cy);
1531 return TSize(cx-size.cx, cy-size.cy);
TPointF is similar to TPoint, but uses floating variables rather than integers.
TPointF & operator+=(const TPointF &size)
Returns the new point moved by the offset.
TPointF operator+(const TPointF &size) const
Returns a new point (x+cx, y+cy).
float X() const
Returns X component of the point.
bool operator==(const TPointF &other) const
Returns true if the points are at the same location.
TPointF & Offset(float dx, float dy)
Moves the point by an offset.
TPointF()
Default constructor that does nothing.
float Y() const
Returns Y component of the point.
TPointF & operator-=(const TPointF &size)
Returns the new point subtracted from the current.
bool operator!=(const TPointF &other) const
Return true if the points are not at the same location.
TPointF operator-() const
Returns the negative of the point.
TPointF OffsetBy(float dx, float dy) const
Moves the point by an offset.
TPoint is a support class, derived from tagPOINT.
TPoint operator-() const
Returns the point (-x, -y). This point is not changed.
bool operator==(const TPoint &other) const
Returns true if this point is equal to the other point; otherwise returns false.
TPoint OffsetBy(int dx, int dy) const
Calculates an offset to this point using the given displacement arguments.
TPoint & operator-=(const TSize &size)
Negatively offsets this point by the given size argument.
bool operator!=(const TPoint &other) const
Returns false if this point is equal to the other point; otherwise returns true.
TPoint & operator+=(const TSize &size)
Offsets this point by the given size argument.
TPoint operator+(const TSize &size) const
Calculates an offset to this point using the given size argument as the displacement.
TPoint()
Constructs an uninitialized point.
TPoint & Offset(int dx, int dy)
Offsets this point by the given delta arguments.
int X() const
Returns the x coordinate of the point.
int Y() const
Returns the Y coordinate of the point.
TPointL is similar to TPoint, but uses long rather than int variables.
bool operator!=(const TPointL &other) const
Returns true if the positions are not the same.
TPointL operator-() const
Returns the negative of the point.
TPointL & operator-=(const TSize &size)
Return the point (x-cx, y-cy).
long Y() const
Returns the Y component of the point.
TPointL operator+(const TSize &size) const
Returns the new point (x+cx, y+cy).
TPointL & operator+=(const TSize &size)
Return the point (x+cx, y+cy).
TPointL OffsetBy(long dx, long dy) const
Returns the new point (x+dx, y+dy).
TPointL()
Default constructor that does nothing.
long X() const
Returns the X component of the point.
TPointL & Offset(long dx, long dy)
Returns the point (x+dx, y+dy), shifting the point by the offset.
bool operator==(const TPointL &other) const
Returns true if positions are the same.
TRect is a mathematical class derived from tagRect.
TRect MovedTo(int x, int y)
Moves the upper left point of the rectangle while maintaining the current dimension.
bool operator!=(const TRect &other) const
Returns false if this rectangle has identical corner coordinates to the other rectangle; otherwise,...
int Height() const
Returns the height of this rectangle (bottom - top).
TRect OffsetBy(int dx, int dy) const
Returns a rectangle with the corners offset by the given delta values.
bool IsNull() const
Returns true if left, right, top, and bottom are all 0; otherwise, returns false.
void SetEmpty()
Empties this rectangle by setting left, top, right, and bottom to 0.
void Set(int _left, int _top, int _right, int _bottom)
Repositions and resizes this rectangle to the given values.
int X() const
Returns the left value.
TRect & Offset(int dx, int dy)
Changes this rectangle so its corners are offset by the given delta values.
bool operator==(const TRect &other) const
Returns true if this rectangle has identical corner coordinates to the other rectangle; otherwise,...
TRect InflatedBy(int dx, int dy) const
Returns a rectangle inflated by the given delta arguments.
void SetWH(int _left, int _top, int w, int h)
Determines the rectangle, given its upperleft point, width, and height.
TRect Normalized() const
Returns a normalized rectangle with the top left corner at (Min(left, right), Min(top,...
TRect & Inflate(int dx, int dy)
Inflates a rectangle inflated by the given delta arguments.
long Area() const
Returns the area of this rectangle.
const TPoint & BottomRight() const
Returns the TPoint object representing the bottom right corner of this rectangle.
TRect & operator-=(const TSize &delta)
Changes this rectangle so its corners are offset negatively by the given delta values,...
int Right() const
Returns the right value.
const TPoint & TopLeft() const
Returns the upperleft point.
TRect operator+(const TSize &size) const
Returns a rectangle offset positively by the delta values' given sizes.
int Width() const
Returns the width of this rectangle (right - left).
bool Touches(const TRect &other) const
Returns true if the other rectangle shares any interior points with this rectangle; otherwise,...
TRect operator-(const TSize &size) const
Returns a rectangle offset negatively by the delta values' given sizes.
bool Contains(const TPoint &point) const
Returns true if the given point lies within this rectangle; otherwise, it returns false.
void SetNull()
Sets the left, top, right, and bottom of the rectangle to 0.
TRect & DeflateRect(int dx, int dy)
TRect()
Default constructor that does nothing.
int Top() const
Returns the top value.
TRect operator|(const TRect &other) const
Returns the union of this rectangle and the other rectangle.
TRect & operator+=(const TSize &delta)
Changes this rectangle so its corners are offset by the given delta values, delta....
TRect operator&(const TRect &other) const
Returns the intersection of this rectangle and the other rectangle.
TRect & MoveTo(int x, int y)
Moves the upper left corner of the rectangle to a new location and maintains the current dimension.
int Bottom() const
Returns the bottom value.
TPoint BottomLeft() const
Returns the TPoint object representing the bottom left corner of this rectangle.
int Y() const
Returns the top value.
int Left() const
Returns the left value.
TSize Size() const
Returns the size of rectangle.
bool IsEmpty() const
Returns true if left >= right or top >= bottom; otherwise, returns false.
TPoint TopRight() const
Returns the upperright point.
The tagSIZE struct is defined as.
TSize & operator+=(const TSize &size)
Offsets this TSize object by the given size argument.
bool operator!=(const TSize &other) const
Returns false if this TSize object is equal to the other TSize object; otherwise returns true.
TSize operator+(const TSize &size) const
Calculates an offset to this TSize object using the given size argument as the displacement.
bool operator==(const TSize &other) const
Returns true if this TSize object is equal to the other TSize object; otherwise returns false.
int Y() const
Returns the height.
TSize & operator-=(const TSize &size)
Negatively offsets this TSize object by the given size argument.
TSize operator-() const
Returns the TSize object (-cx, -cy). This object is not changed.
TSize()
Default constructor that does nothing.
int X() const
Returns the width.
ipstream, a specialized input stream derivative of pstream, is the base class for reading (extracting...
Base class for writing streamable objects.
TAbsLocation
General use absolute 2-D rectangular location enum.
@ alTop
Refers to top edge of frame.
@ alRight
Refers to right edge of frame.
@ alBottom
Refers to bottom edge of frame.
@ alLeft
Refers to left edge of frame.
@ alNone
No location specified.
Object Windows Library (OWLNext Core)
owl::opstream & operator<<(owl::opstream &os, const TColor &c)
Insert the color value into a persistent output stream.
owl::ipstream & operator>>(owl::ipstream &is, TColor &c)
Extract the color value from a persistent input stream.
Base struct for the TPointF class.
Includes windowing system headers, with necessary macros defined.