libcrn
3.9.5
A document image processing library
|
A 2D point class. More...
#include <CRNPoint2DInt.h>
Public Member Functions | |
Point2DInt () noexcept | |
Default constructor. More... | |
Point2DInt (int x, int y) noexcept | |
Constructor from values. More... | |
Point2DInt (const Point2D< int > &p) noexcept | |
Point2DInt (const Point2DInt &)=default | |
Point2DInt (Point2DInt &&)=default | |
virtual | ~Point2DInt () override=default |
Destructor. More... | |
Point2DInt & | operator= (const Point2DInt &)=default |
Point2DInt & | operator= (Point2DInt &&)=default |
void | Advance (const Direction &dir, int step=1) |
Moves the point towards a direction. More... | |
void | Deserialize (xml::Element &el) |
Initializes the object from an XML element. Unsafe. More... | |
xml::Element | Serialize (xml::Element &parent) const |
Dumps the object to an XML element. Unsafe. More... | |
![]() | |
Point2D () noexcept(noexcept(int{0})) | |
Default constructor (sets coordinates to 0) More... | |
Point2D (intx, inty) noexcept(std::is_nothrow_copy_constructible< int >::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... | |
Point2D< U > | Convert () const noexcept(noexcept(U{X})) |
Converts to another type of Point. More... | |
Point2D & | operator= (const Point2D &)=default |
Point2D & | operator= (Point2D &&)=default |
bool | operator== (const Point2D &p) const noexcept |
Point2D< int > & | operator+= (const Point2D< int > &p) noexcept |
Translation. More... | |
Point2D< int > & | operator-= (const Point2D< int > &p) noexcept |
Translation. More... | |
![]() | |
virtual | ~Object ()=default |
Additional Inherited Members | |
![]() | |
using | value_type = int |
The value type. More... | |
![]() | |
value_type | X |
value_type | Y |
A 2D point class.
Convenience 2D point class.
Definition at line 39 of file CRNPoint2DInt.h.
|
inlinenoexcept |
Default constructor.
Definition at line 43 of file CRNPoint2DInt.h.
|
inlinenoexcept |
Constructor from values.
Definition at line 45 of file CRNPoint2DInt.h.
|
inlinenoexcept |
Definition at line 46 of file CRNPoint2DInt.h.
|
default |
|
default |
|
overridevirtualdefault |
Destructor.
void Point2DInt::Advance | ( | const Direction & | dir, |
int | step = 1 |
||
) |
Moves the point towards a direction.
Moves the point towards a direction
[in] | dir | the direction of the move |
[in] | step | the distance of the move |
Definition at line 71 of file CRNPoint2DInt.cpp.
void Point2DInt::Deserialize | ( | xml::Element & | el | ) |
Initializes the object from an XML element. Unsafe.
Initializes the object from an XML element. Unsafe.
ExceptionInvalidArgument | not a Point2DInt |
ExceptionNotFound | attribute not found |
ExceptionDomain | wrong attribute |
[in] | el | the XML element to read |
Definition at line 38 of file CRNPoint2DInt.cpp.
|
default |
|
default |
xml::Element Point2DInt::Serialize | ( | xml::Element & | parent | ) | const |
Dumps the object to an XML element. Unsafe.
Dumps the object to an XML element. Unsafe.
[in] | parent | the element in which the new element will be stored |
Definition at line 57 of file CRNPoint2DInt.cpp.