Geometric objects and their operations.
Classes | |
struct | Dims |
Represents the dimensions of an object, or more generally, the displacement between two Posns. More... | |
class | origin_type |
The type of the special value the_origin. More... | |
struct | Posn |
A position in the COORDINATE -valued Cartesian plane, where COORDINATE can be any arithmetic type. More... | |
struct | Rect |
Represents a positioned rectangle. More... | |
class | Transform |
A rendering transformation, which can scale, flip, and rotate. More... | |
Functions | |
template<typename COORDINATE , typename SCALAR , typename = std::enable_if_t<Is_Arithmetic<SCALAR>>> | |
Dims< COORDINATE > | operator* (SCALAR scalar, Dims< COORDINATE > dims) |
Multiplies a scalar and a Dims. More... | |
Factory functions | |
template<typename COORDINATE > | |
Dims< COORDINATE > | make_dims (COORDINATE x, COORDINATE y) |
Constructs a Dims given the width and height. More... | |
template<typename COORDINATE > | |
Posn< COORDINATE > | make_posn (COORDINATE x, COORDINATE y) |
Constructs a Posn given the x and y coordinates. More... | |
template<typename COORDINATE > | |
Rect< COORDINATE > | make_rect (COORDINATE x, COORDINATE y, COORDINATE width, COORDINATE height) |
Constructs a Rect given its member variables. More... | |
Stream-insertion operators | |
template<typename COORDINATE > | |
std::ostream & | operator<< (std::ostream &out, Dims< COORDINATE > dims) |
Formats a Dims on an output stream. | |
template<typename COORDINATE > | |
std::ostream & | operator<< (std::ostream &out, Posn< COORDINATE > p) |
Formats a Posn on an output stream. | |
template<typename COORDINATE > | |
std::ostream & | operator<< (std::ostream &out, Rect< COORDINATE > rect) |
Formats a Rect on an output stream. | |
Variables | |
constexpr origin_type | the_origin |
Gets implicitly converted to Posn<COORDINATE>(0, 0) for any coordinate type COORDINATE . More... | |
Dims<COORDINATE> ge211::geometry::make_dims | ( | COORDINATE | x, |
COORDINATE | y | ||
) |
Constructs a Dims given the width and height.
Unlike the constructor, this function can infer the coordinate type from its arguments. For example:
Definition at line 941 of file ge211_geometry.hxx.
Posn<COORDINATE> ge211::geometry::make_posn | ( | COORDINATE | x, |
COORDINATE | y | ||
) |
Constructs a Posn given the x
and y
coordinates.
Unlike the constructor, this function can infer the coordinate type from its arguments. For example:
Definition at line 957 of file ge211_geometry.hxx.
Rect<COORDINATE> ge211::geometry::make_rect | ( | COORDINATE | x, |
COORDINATE | y, | ||
COORDINATE | width, | ||
COORDINATE | height | ||
) |
Constructs a Rect given its member variables.
It takes them in the same order as the constructor: the x
and y
coordinates followed by the width and height.
Unlike the constructor, this function can infer the coordinate type from its arguments. For example:
Definition at line 980 of file ge211_geometry.hxx.
Multiplies a scalar and a Dims.
(This is scalar-vector multiplication.)
Definition at line 255 of file ge211_geometry.hxx.
|
constexpr |
Gets implicitly converted to Posn<COORDINATE>(0, 0)
for any coordinate type COORDINATE
.
Examples:
Definition at line 924 of file ge211_geometry.hxx.