libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
crn::Point2D< T > Class Template Reference

A 2D point class. More...

#include <CRNPoint2D.h>

+ Inheritance diagram for crn::Point2D< T >:
+ Collaboration diagram for crn::Point2D< T >:

Classes

struct  Comparer
 Functor to compare points. More...
 

Public Types

using value_type = T
 The value type. More...
 

Public Member Functions

 Point2D () noexcept(noexcept(T{0}))
 Default constructor (sets coordinates to 0) More...
 
 Point2D (T x, T y) noexcept(std::is_nothrow_copy_constructible< T >::value)
 Constructor from values. More...
 
 Point2D (const Point2D &)=default
 
 Point2D (Point2D &&)=default
 
virtual ~Point2D () override=default
 Destructor. More...
 
String ToString () const
 Converts object to string. More...
 
template<typename U >
Point2D< U > Convert () const noexcept(noexcept(U{X}))
 Converts to another type of Point. More...
 
Point2Doperator= (const Point2D &)=default
 
Point2Doperator= (Point2D &&)=default
 
bool operator== (const Point2D &p) const noexcept
 
Point2D< T > & operator+= (const Point2D< T > &p) noexcept
 Translation. More...
 
Point2D< T > & operator-= (const Point2D< T > &p) noexcept
 Translation. More...
 
- Public Member Functions inherited from crn::Object
virtual ~Object ()=default
 

Public Attributes

value_type X
 
value_type Y
 

Detailed Description

template<typename T>
class crn::Point2D< T >

A 2D point class.

Convenience 2D point class.

Author
Yann LEYDIER
Date
September 2008
Version
0.1

Definition at line 45 of file CRNPoint2D.h.

Member Typedef Documentation

template<typename T>
using crn::Point2D< T >::value_type = T

The value type.

Definition at line 49 of file CRNPoint2D.h.

Constructor & Destructor Documentation

template<typename T>
crn::Point2D< T >::Point2D ( )
inlinenoexcept

Default constructor (sets coordinates to 0)

Definition at line 52 of file CRNPoint2D.h.

template<typename T>
crn::Point2D< T >::Point2D ( x,
y 
)
inlinenoexcept

Constructor from values.

Definition at line 54 of file CRNPoint2D.h.

template<typename T>
crn::Point2D< T >::Point2D ( const Point2D< T > &  )
default
template<typename T>
crn::Point2D< T >::Point2D ( Point2D< T > &&  )
default
template<typename T>
virtual crn::Point2D< T >::~Point2D ( )
overridevirtualdefault

Destructor.

Member Function Documentation

template<typename T>
template<typename U >
Point2D<U> crn::Point2D< T >::Convert ( ) const
inlinenoexcept

Converts to another type of Point.

Definition at line 66 of file CRNPoint2D.h.

template<typename T>
Point2D<T>& crn::Point2D< T >::operator+= ( const Point2D< T > &  p)
inlinenoexcept

Translation.

Definition at line 73 of file CRNPoint2D.h.

template<typename T>
Point2D<T>& crn::Point2D< T >::operator-= ( const Point2D< T > &  p)
inlinenoexcept

Translation.

Definition at line 75 of file CRNPoint2D.h.

template<typename T>
Point2D& crn::Point2D< T >::operator= ( const Point2D< T > &  )
default
template<typename T>
Point2D& crn::Point2D< T >::operator= ( Point2D< T > &&  )
default
template<typename T>
bool crn::Point2D< T >::operator== ( const Point2D< T > &  p) const
inlinenoexcept

Definition at line 71 of file CRNPoint2D.h.

template<typename T>
String crn::Point2D< T >::ToString ( ) const
inline

Converts object to string.

Definition at line 61 of file CRNPoint2D.h.

Member Data Documentation

template<typename T>
value_type crn::Point2D< T >::X

Definition at line 63 of file CRNPoint2D.h.

template<typename T>
value_type crn::Point2D< T >::Y

The coordinates

Definition at line 63 of file CRNPoint2D.h.


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