OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
ot::Point2D Class Reference

2D Point with integer values More...

#include "Point2D.h"

Inheritance diagram for ot::Point2D:
ot::Serializable

Public Member Functions

 Point2D ()
 
 Point2D (int _x, int _y)
 
 Point2D (const Point2D &_other)
 
virtual ~Point2D ()
 
Point2Doperator= (const Point2D &_other)
 
bool operator== (const Point2D &_other) const
 
bool operator!= (const Point2D &_other) const
 
Point2D operator+ (const Point2D &_other) const
 
Point2Doperator+= (const Point2D &_other)
 
Point2D operator- (const Point2D &_other) const
 
Point2Doperator-= (const Point2D &_other)
 
virtual void addToJsonObject (JsonValue &_object, JsonAllocator &_allocator) const override
 Add the object contents to the provided JSON object.
 
virtual void setFromJsonObject (const ConstJsonObject &_object) override
 Will set the object contents from the provided JSON object.
 
int x (void) const
 Returns the current X value.
 
int y (void) const
 Returns the current Y value.
 
void setX (int _x)
 Set the X value.
 
void setY (int _y)
 Set the Y value.
 
void set (int _x, int _y)
 Set the X and Y value.
 
Point2DF toPoint2DF (void) const
 
Point2DD toPoint2DD (void) const
 
- Public Member Functions inherited from ot::Serializable
 Serializable ()
 
virtual ~Serializable ()
 
virtual void addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const =0
 Add the object contents to the provided JSON object.
 

Detailed Description

2D Point with integer values

Constructor & Destructor Documentation

◆ Point2D() [1/3]

ot::Point2D::Point2D ( )
inline

◆ Point2D() [2/3]

ot::Point2D::Point2D ( int _x,
int _y )
inline

◆ Point2D() [3/3]

ot::Point2D::Point2D ( const Point2D & _other)
inline

◆ ~Point2D()

virtual ot::Point2D::~Point2D ( )
inlinevirtual

Member Function Documentation

◆ addToJsonObject()

void ot::Point2D::addToJsonObject ( JsonValue & _object,
JsonAllocator & _allocator ) const
overridevirtual

Add the object contents to the provided JSON object.

Parameters
_documentThe JSON document (used to get the allocator)
_objectThe JSON object to add the contents to

◆ operator!=()

bool ot::Point2D::operator!= ( const Point2D & _other) const
inline

◆ operator+()

Point2D ot::Point2D::operator+ ( const Point2D & _other) const
inline

◆ operator+=()

Point2D & ot::Point2D::operator+= ( const Point2D & _other)
inline

◆ operator-()

Point2D ot::Point2D::operator- ( const Point2D & _other) const
inline

◆ operator-=()

Point2D & ot::Point2D::operator-= ( const Point2D & _other)
inline

◆ operator=()

Point2D & ot::Point2D::operator= ( const Point2D & _other)
inline

◆ operator==()

bool ot::Point2D::operator== ( const Point2D & _other) const
inline

◆ set()

void ot::Point2D::set ( int _x,
int _y )
inline

Set the X and Y value.

Parameters
_xThe X value to set
_yThe y value to set

◆ setFromJsonObject()

void ot::Point2D::setFromJsonObject ( const ConstJsonObject & _object)
overridevirtual

Will set the object contents from the provided JSON object.

Parameters
_objectThe JSON object containing the information
Exceptions
Willthrow an exception if the provided object is not valid (members missing or invalid types)

Implements ot::Serializable.

◆ setX()

void ot::Point2D::setX ( int _x)
inline

Set the X value.

Parameters
_xThe X value to set

◆ setY()

void ot::Point2D::setY ( int _y)
inline

Set the Y value.

Parameters
_yThe Y value to set

◆ toPoint2DD()

ot::Point2DD ot::Point2D::toPoint2DD ( void ) const

◆ toPoint2DF()

ot::Point2DF ot::Point2D::toPoint2DF ( void ) const

◆ x()

int ot::Point2D::x ( void ) const
inline

Returns the current X value.

◆ y()

int ot::Point2D::y ( void ) const
inline

Returns the current Y value.


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