Two-dimensional size (width and height). More...
#include <size2d.h>
Public Member Functions | |
| Size2DTemplate (const T &width=0, const T &height=0) | |
| Constructs a 2D size with the given width and height, defaulting to 0x0. | |
| ~Size2DTemplate () | |
| Destructor. | |
| bool | isValid () const |
| Returns true if both width and height are greater than zero. | |
| void | set (const T &w, const T &h) |
| Sets both width and height. | |
| void | setWidth (const T &val) |
| Sets the width. | |
| const T & | width () const |
| Returns the width. | |
| void | setHeight (const T &val) |
| Sets the height. | |
| const T & | height () const |
| Returns the height. | |
| T | area () const |
| Returns the area (width * height). | |
| String | toString () const |
| Returns the size as a string in "WxH" format. | |
| operator String () const | |
| Converts to a String using toString(). | |
| template<typename N > | |
| bool | pointIsInside (const Point< N, 2 > &p) const |
| Returns true if the given 2D point lies within the size bounds. | |
Two-dimensional size (width and height).
A simple value type representing a 2D extent. Supports validity checks, area computation, point containment tests, and string serialization in
| T | The component type (e.g. size_t, float, double). |