IDS peak IPL v1.18.0
Loading...
Searching...
No Matches
peak::common::detail::PointT< T > Class Template Reference

2D point template type. More...

#include <peak_common/types/geometry/peak_common_point.hpp>

Inheritance diagram for peak::common::detail::PointT< T >:
peak::common::detail::PointXd< T, 2 >

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.

Detailed Description

template<typename T>
class peak::common::detail::PointT< T >

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.

Template Parameters
TThe coordinate data type.
Since
ids_peak_common 1.0

Constructor & Destructor Documentation

◆ PointT() [1/2]

template<typename T>
peak::common::detail::PointT< T >::PointT ( )
constexprdefault

Default constructor for PointT (2D point).

Initializes the point with default-initialized coordinates (x and y).

Since
ids_peak_common 1.0

◆ PointT() [2/2]

template<typename T>
peak::common::detail::PointT< T >::PointT ( T x,
T y )
inlineconstexpr

Point constructor from x and y coordinates.

Parameters
xx coordinate
yy coordinate
Since
ids_peak_common 1.0

Member Function Documentation

◆ ToString()

template<typename T>
PEAK_COMMON_NO_DISCARD std::string peak::common::detail::PointT< T >::ToString ( ) const
inline

Returns a string representation of the point.

Formats the point as: { x: ..., y: ... }.

Returns
A string containing the formatted coordinates.
Since
ids_peak_common 1.0

◆ operator<<

template<typename T>
std::ostream & operator<< ( std::ostream & os,
PointT< T > point )
friend

Stream output operator for PointT.

Outputs the point's coordinates in a readable format: { x: ..., y: ... }.

Parameters
osThe output stream.
pointThe point to print.
Returns
A reference to the output stream.
Since
ids_peak_common 1.0

The documentation for this class was generated from the following file: