libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
crn::Point2DInt Class Reference

A 2D point class. More...

#include <CRNPoint2DInt.h>

+ Inheritance diagram for crn::Point2DInt:
+ Collaboration diagram for crn::Point2DInt:

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...
 
Point2DIntoperator= (const Point2DInt &)=default
 
Point2DIntoperator= (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...
 
- Public Member Functions inherited from crn::Point2D< int >
 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...
 
Point2Doperator= (const Point2D &)=default
 
Point2Doperator= (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...
 
- Public Member Functions inherited from crn::Object
virtual ~Object ()=default
 

Additional Inherited Members

- Public Types inherited from crn::Point2D< int >
using value_type = int
 The value type. More...
 
- Public Attributes inherited from crn::Point2D< int >
value_type X
 
value_type Y
 

Detailed Description

A 2D point class.

Convenience 2D point class.

Author
Yann LEYDIER
Date
September 2008
Version
0.1

Definition at line 39 of file CRNPoint2DInt.h.

Constructor & Destructor Documentation

crn::Point2DInt::Point2DInt ( )
inlinenoexcept

Default constructor.

Definition at line 43 of file CRNPoint2DInt.h.

crn::Point2DInt::Point2DInt ( int  x,
int  y 
)
inlinenoexcept

Constructor from values.

Definition at line 45 of file CRNPoint2DInt.h.

crn::Point2DInt::Point2DInt ( const Point2D< int > &  p)
inlinenoexcept

Definition at line 46 of file CRNPoint2DInt.h.

crn::Point2DInt::Point2DInt ( const Point2DInt )
default
crn::Point2DInt::Point2DInt ( Point2DInt &&  )
default
virtual crn::Point2DInt::~Point2DInt ( )
overridevirtualdefault

Destructor.

Member Function Documentation

void Point2DInt::Advance ( const Direction dir,
int  step = 1 
)

Moves the point towards a direction.

Moves the point towards a direction

Parameters
[in]dirthe direction of the move
[in]stepthe 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.

Exceptions
ExceptionInvalidArgumentnot a Point2DInt
ExceptionNotFoundattribute not found
ExceptionDomainwrong attribute
Parameters
[in]elthe XML element to read

Definition at line 38 of file CRNPoint2DInt.cpp.

Point2DInt& crn::Point2DInt::operator= ( const Point2DInt )
default
Point2DInt& crn::Point2DInt::operator= ( Point2DInt &&  )
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.

Parameters
[in]parentthe element in which the new element will be stored
Returns
the newly created element

Definition at line 57 of file CRNPoint2DInt.cpp.


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