CartoType C++ API 8.8-7-gb35e4dc71
for Windows, Linux, Qt and other platforms supporting C++ development
|
#include <cartotype_base.h>
Public Member Functions | |
Rect () | |
Rect (int32_t aMinX, int32_t aMinY, int32_t aMaxX, int32_t aMaxY) | |
Rect (const RectFP &aRectFP) noexcept | |
Rect (InputStream &aInput) | |
void | Write (OutputStream &aOutput) const |
bool | operator== (const Rect &aRect) const |
bool | operator!= (const Rect &aRect) const |
int32_t | MinX () const |
int32_t | MinY () const |
int32_t | MaxX () const |
int32_t | MaxY () const |
bool | IsEmpty () const |
bool | IsMaximal () const |
int32_t | Width () const |
int32_t | Height () const |
Point | MaxMin () const |
Point | MinMax () const |
Point | Center () const |
bool | Contains (const Point &aPoint) const |
bool | Contains (const Rect &aRect) const |
bool | IsOnEdge (const Point &aPoint) const noexcept |
bool | Intersects (const Rect &aRect) const noexcept |
bool | Intersects (const Point &aStart, const Point &aEnd, Point *aIntersectionStart=nullptr, Point *aIntersectionEnd=nullptr) const noexcept |
void | Intersection (const Rect &aRect) noexcept |
void | Combine (const Rect &aRect) noexcept |
void | Combine (const Point &aPoint) noexcept |
Rect | Expanded (int32_t aExpansion) const noexcept |
Public Attributes | |
Point | Min |
Point | Max |
A rectangle in two-dimensional space, aligned with the coordinate system and defined by opposite corners with minimum and maximum coordinates.
|
inline |
Creates an empty rectangle with both corners at the point (0,0).
|
inline |
Creates a rectangle with the specified edges.
|
explicitnoexcept |
Construct an integer rectangle from a floating-point rectangle, clamping to the 32-bit range and rounding.
|
inlineexplicit |
Creates a Rect by deserializing it from an input stream.
|
inline |
Returns the center.
|
noexcept |
Updates a rectangle so that it contains the specified point.
|
noexcept |
Sets a rectangle to the smallest new rectangle that contains itself and aRect.
|
inline |
Returns true if the rectangle contains the point, where containment is defined using half-open intervals: the rectangle includes points on its minimum X and Y edges but not its maximum X and Y edges.
|
inline |
Returns true if the rectangle contains another rectangle.
|
inlinenoexcept |
Returns a new rectangle expanded in all directions by aExpansion.
|
inline |
Returns the height.
|
noexcept |
Sets a rectangle to its intersection with aRect.
|
noexcept |
Returns true if the rectangle intersects the line from aStart to aEnd. If there is an intersection, and if aIntersectionStart and aIntersectionEnd are non-null, returns the intersecting line.
|
noexcept |
Returns true if the rectangle and aRect have an intersection. If both rectangles are non-empty, returns true only if the intersection is non-empy.
|
inline |
Returns true if the rectangle is empty, defined as having a width or height less than or equal to zero.
|
inline |
Returns true if the rectangle is maximal, defined as having minimum coords of INT32_MIN and maximum coords of INT32_MAX.
|
noexcept |
Returns true if aPoint is exactly on an edge of a rectangle.
|
inline |
Returns the point (Max.X,Min.Y).
|
inline |
Returns the maximum X coordinate..
|
inline |
Returns the maximum Y coordinate..
|
inline |
Returns the point (Min.X,Max.Y).
|
inline |
Returns the minimum X coordinate.
|
inline |
Returns the minimum Y coordinate.
|
inline |
The inequality operator.
|
inline |
The equality operator.
|
inline |
Returns the width.
|
inline |
Serializes a Rect to an output stream.
Point CartoTypeCore::Rect::Max |
The corner with maximum X and Y coordinates.
Point CartoTypeCore::Rect::Min |
The corner with minimum X and Y coordinates.