IDS peak ICV v1.3.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

Definition at line 61 of file peak_icv_type_traits.hpp.

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

Definition at line 216 of file peak_common_point.hpp.

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

Definition at line 170 of file peak_common_point.hpp.

◆ GetX()

T GetX ( ) const
inlineconstexprinherited

Returns the x-coordinate (first component).

Returns
The value of the first coordinate.
Since
ids_peak_common 1.0

Definition at line 74 of file peak_common_point.hpp.

◆ GetY()

T GetY ( ) const
inlineconstexprinherited

Returns the y-coordinate (second component).

Returns
The value of the second coordinate.
Since
ids_peak_common 1.0

Definition at line 86 of file peak_common_point.hpp.

◆ 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

Definition at line 126 of file peak_common_point.hpp.

◆ 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

Definition at line 109 of file peak_common_point.hpp.

◆ 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

Definition at line 150 of file peak_common_point.hpp.

◆ 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

Definition at line 245 of file peak_common_point.hpp.

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

Definition at line 231 of file peak_common_point.hpp.