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

2D Point with float values More...

#include "Point2D.h"

Inheritance diagram for ot::Point2DF:
ot::Serializable

Public Member Functions

 Point2DF ()
 
 Point2DF (float _x, float _y)
 
 Point2DF (const Point2DF &_other)
 
virtual ~Point2DF ()
 
Point2DFoperator= (const Point2DF &_other)
 
bool operator== (const Point2DF &_other) const
 
bool operator!= (const Point2DF &_other) const
 
Point2DF operator+ (const Point2DF &_other) const
 
Point2DFoperator+= (const Point2DF &_other)
 
Point2DF operator- (const Point2DF &_other) const
 
Point2DFoperator-= (const Point2DF &_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.
 
float x (void) const
 Returns the current X value.
 
float y (void) const
 Returns the current Y value.
 
void setX (float _x)
 Set the X value.
 
void setY (float _y)
 Set the Y value.
 
void set (float _x, float _y)
 Set the X and Y value.
 
Point2D toPoint2D (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 float values

Constructor & Destructor Documentation

◆ Point2DF() [1/3]

ot::Point2DF::Point2DF ( )
inline

◆ Point2DF() [2/3]

ot::Point2DF::Point2DF ( float _x,
float _y )
inline

◆ Point2DF() [3/3]

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

◆ ~Point2DF()

virtual ot::Point2DF::~Point2DF ( )
inlinevirtual

Member Function Documentation

◆ addToJsonObject()

void ot::Point2DF::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::Point2DF::operator!= ( const Point2DF & _other) const
inline

◆ operator+()

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

◆ operator+=()

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

◆ operator-()

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

◆ operator-=()

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

◆ operator=()

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

◆ operator==()

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

◆ set()

void ot::Point2DF::set ( float _x,
float _y )
inline

Set the X and Y value.

Parameters
_xThe X value to set
_yThe y value to set

◆ setFromJsonObject()

void ot::Point2DF::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::Point2DF::setX ( float _x)
inline

Set the X value.

Parameters
_xThe X value to set

◆ setY()

void ot::Point2DF::setY ( float _y)
inline

Set the Y value.

Parameters
_yThe Y value to set

◆ toPoint2D()

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

◆ toPoint2DD()

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

◆ x()

float ot::Point2DF::x ( void ) const
inline

Returns the current X value.

◆ y()

float ot::Point2DF::y ( void ) const
inline

Returns the current Y value.


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