2D point template type. More...
#include <peak_common/types/geometry/peak_common_point.hpp>
Public Member Functions | |
| constexpr | PointT ()=default |
| Default constructor for PointT (2D point). | |
| constexpr | PointT (T x, T y) |
| Point constructor from x and y coordinates. | |
| PEAK_COMMON_NO_DISCARD std::string | ToString () const |
| Returns a string representation of the point. | |
| Public Member Functions inherited from peak::common::detail::PointXd< T, 2 > | |
| constexpr | PointXd ()=default |
| Default constructor for PointXd. | |
| PEAK_COMMON_NO_DISCARD constexpr T | GetX () const |
| Returns the x-coordinate (first component). | |
| PEAK_COMMON_NO_DISCARD constexpr T | GetY () const |
| Returns the y-coordinate (second component). | |
| constexpr bool | operator== (const PointXd< H, d > &rhs) const |
| Equality operator for comparing integral coordinates. | |
| constexpr bool | operator!= (const PointXd< H, d > &rhs) const |
| Inequality operator for comparing coordinates. | |
| PEAK_COMMON_NO_DISCARD constexpr std::array< T, dimension > | GetCoordinates () const |
| Returns the coordinates of the point as an array. | |
Friends | |
| std::ostream & | operator<< (std::ostream &os, PointT point) |
| Stream output operator for PointT. | |
2D point template type.
Represents a two-dimensional point consisting of x and y coordinates. This is a convenience alias for a PointXd with two dimensions.
| T | The coordinate data type. |
|
constexprdefault |
Default constructor for PointT (2D point).
Initializes the point with default-initialized coordinates (x and y).
|
inlineconstexpr |
Point constructor from x and y coordinates.
| x | x coordinate |
| y | y coordinate |
|
inline |
Returns a string representation of the point.
Formats the point as: { x: ..., y: ... }.
|
friend |
Stream output operator for PointT.
Outputs the point's coordinates in a readable format: { x: ..., y: ... }.
| os | The output stream. |
| point | The point to print. |