IDS peak ICV v1.4.0
Loading...
Searching...
No Matches
PointT< T > Class Template Reference

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

Inheritance diagram for PointT< T >:

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.
 
std::string ToString () const
 Returns a string representation of the point.
 
constexpr T GetX () const
 Returns the x-coordinate (first component).
 
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
 Equality operator for comparing floating-point coordinates.
 
constexpr bool operator!= (const PointXd< H, d > &rhs) const
 Inequality operator for comparing coordinates.
 
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 >
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 >
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

◆ GetCoordinates()

std::array< T, dimension > GetCoordinates ( ) const
inlineconstexprinherited

Returns the coordinates of the point as an array.

Returns
A copy of the internal coordinate array.
Since
ids_peak_common 1.0

◆ GetX()

T GetX ( ) const
inlineconstexprinherited

Returns the x-coordinate (first component).

Returns
The value of the first coordinate.
Since
ids_peak_common 1.0

◆ GetY()

T GetY ( ) const
inlineconstexprinherited

Returns the y-coordinate (second component).

Returns
The value of the second coordinate.
Since
ids_peak_common 1.0

◆ operator!=()

bool operator!= ( const PointXd< H, d > & rhs) const
inlineconstexprinherited

Inequality operator for comparing coordinates.

Returns true if any coordinates of this point are not equal to the corresponding coordinates of the other point.

Template Parameters
HThe type of the other point's coordinates.
dThe dimensionality of the point.
Since
ids_peak_common 1.0

◆ operator==() [1/2]

bool operator== ( const PointXd< H, d > & rhs) const
inlineconstexprinherited

Equality operator for comparing integral coordinates.

Returns true if all coordinates of this point are exactly equal to the corresponding coordinates of the other point. This overload is used for integral coordinate types.

Template Parameters
HThe type of the other point's coordinates.
dThe dimensionality of the point.
Since
ids_peak_common 1.0

◆ operator==() [2/2]

bool operator== ( const PointXd< H, d > & rhs) const
inlineconstexprinherited

Equality operator for comparing floating-point coordinates.

Returns true if all coordinates of this point are approximately equal to the corresponding coordinates of the other point. Comparison is performed using a tolerance based on units in the last place (ULP), allowing for small floating-point inaccuracies.

Template Parameters
HThe type of the other point's coordinates.
dThe dimensionality of the point.
Since
ids_peak_common 1.0

◆ ToString()

template<typename T >
std::string 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

Friends And Related Symbol Documentation

◆ 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