Hermes
hermes::Point2< T > Class Template Reference

Geometric 2-dimensional point (x, y) More...

+ Inheritance diagram for hermes::Point2< T >:

Public Member Functions

HERMES_DEVICE_CALLABLE Point2 (T f=T(0))
 Constructs from single component value. More...
 
HERMES_DEVICE_CALLABLE Point2 (const real_t *v)
 Constructs from component array. More...
 
HERMES_DEVICE_CALLABLE Point2 (real_t _x, real_t _y)
 Constructs from component values. More...
 
template<typename U >
HERMES_DEVICE_CALLABLE Point2 (const Index2< U > &index)
 Constructs from index2. More...
 
template<typename U >
HERMES_DEVICE_CALLABLE operator Index2< U > () const
 Casts to index2. More...
 
template<typename U >
HERMES_DEVICE_CALLABLE Point2operator= (const Index2< U > &index)
 Copy assigns from index 2. More...
 
HERMES_DEVICE_CALLABLE const T & operator[] (int i) const
 Get i-th component. More...
 
HERMES_DEVICE_CALLABLE T & operator[] (int i)
 Get i-th component reference. More...
 
HERMES_DEVICE_CALLABLE Vector2< T > operator- (const Point2< T > &b) const
 
HERMES_DEVICE_CALLABLE bool operator== (const Point2< T > &b) const
 

Public Attributes

x = T(0.0)
 0-th component
 
y = T(0.0)
 1-th component
 

Additional Inherited Members

- Static Public Member Functions inherited from hermes::MathElement< T, 2u >
static constexpr u64 componentCount ()
 Gets the number of dimensional components. More...
 
static constexpr u64 numericTypeSizeInBytes ()
 Gets the size in bytes of underlying data type. More...
 
static MemoryDumper::RegionLayout memoryDumpLayout ()
 Gets memory layout. More...
 
- Static Public Attributes inherited from hermes::MathElement< T, 2u >
static T numeric_data
 Underlying data type.
 

Detailed Description

template<typename T>
class hermes::Point2< T >

Geometric 2-dimensional point (x, y)

Template Parameters
T

Forward declaration of Point2

Template Parameters
T

Constructor & Destructor Documentation

◆ Point2() [1/4]

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Point2< T >::Point2 ( f = T(0))
inlineexplicit

Constructs from single component value.

Parameters
f

◆ Point2() [2/4]

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Point2< T >::Point2 ( const real_t v)
inlineexplicit

Constructs from component array.

Parameters
v

◆ Point2() [3/4]

template<typename T >
HERMES_DEVICE_CALLABLE hermes::Point2< T >::Point2 ( real_t  _x,
real_t  _y 
)
inline

Constructs from component values.

Parameters
_x
_y

◆ Point2() [4/4]

template<typename T >
template<typename U >
HERMES_DEVICE_CALLABLE hermes::Point2< T >::Point2 ( const Index2< U > &  index)
inline

Constructs from index2.

Template Parameters
U
Parameters
index

Member Function Documentation

◆ operator Index2< U >()

template<typename T >
template<typename U >
HERMES_DEVICE_CALLABLE hermes::Point2< T >::operator Index2< U > ( ) const
inline

Casts to index2.

Template Parameters
U
Returns

◆ operator=()

template<typename T >
template<typename U >
HERMES_DEVICE_CALLABLE Point2& hermes::Point2< T >::operator= ( const Index2< U > &  index)
inline

Copy assigns from index 2.

Template Parameters
U
Parameters
index
Returns

◆ operator[]() [1/2]

template<typename T >
HERMES_DEVICE_CALLABLE T& hermes::Point2< T >::operator[] ( int  i)
inline

Get i-th component reference.

Warning
i is not checked
Parameters
icomponent index in [0, 1]
Returns

◆ operator[]() [2/2]

template<typename T >
HERMES_DEVICE_CALLABLE const T& hermes::Point2< T >::operator[] ( int  i) const
inline

Get i-th component.

Warning
i is not checked
Parameters
icomponent index in [0, 1]
Returns

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