The Path2DF class describes a path consisting of different types of lines.
More...
#include "Path2D.h"
|
| Path2DF () |
| Default constructor.
|
|
| Path2DF (const Point2DD &_startPos) |
| Assignment constructor.
|
|
| Path2DF (const Path2DF &_other) |
| Copy constructor.
|
|
virtual | ~Path2DF () |
| Destructor.
|
|
Path2DF & | operator= (const Path2DF &_other) |
| Assignment operator.
|
|
virtual void | addToJsonObject (ot::JsonValue &_object, ot::JsonAllocator &_allocator) const override |
| Add the object contents to the provided JSON object.
|
|
virtual void | setFromJsonObject (const ot::ConstJsonObject &_object) override |
| Will set the object contents from the provided JSON object.
|
|
bool | isClosed (void) |
| Returns true if the path contains at least one entry, the entries are interconnected (end of a entry is start of another) and the start point is also the final end point.
|
|
void | moveTo (const Point2DD &_pos) |
| Moves the current position. No line will be added.
|
|
void | moveBy (const Point2DD &_d) |
| Moves the current position by the delta.
|
|
void | lineTo (const Point2DD &_dest) |
| Adds a line from the current position to the provided destination. The current position will be set to the destination.
|
|
void | berzierTo (const Point2DD &_ct1, const Point2DD &_ct2, const Point2DD &_dest) |
| Adds a berzier curve from the current position to the provided destination by taking the two control points into account. The current position will be set to the destination.
|
|
void | clear (void) |
| Remove all the entries from the path.
|
|
const std::list< PathEntry > & | getEntries (void) const |
| Returns the current entries.
|
|
| Serializable () |
|
virtual | ~Serializable () |
|
The Path2DF class describes a path consisting of different types of lines.
◆ PathEntryType
The type of a path entry.
Enumerator |
---|
LineType | |
BerzierType | |
◆ Path2DF() [1/3]
◆ Path2DF() [2/3]
ot::Path2DF::Path2DF |
( |
const Point2DD & | _startPos | ) |
|
Assignment constructor.
- Parameters
-
_startPos | The initial position of the path (same as calling moveTo()) |
◆ Path2DF() [3/3]
ot::Path2DF::Path2DF |
( |
const Path2DF & | _other | ) |
|
◆ ~Path2DF()
ot::Path2DF::~Path2DF |
( |
| ) |
|
|
virtual |
◆ addToJsonObject()
Add the object contents to the provided JSON object.
- Parameters
-
_object | Json object reference |
_allocator | Allocator |
Implements ot::Serializable.
◆ berzierTo()
Adds a berzier curve from the current position to the provided destination by taking the two control points into account. The current position will be set to the destination.
- Parameters
-
_ct1 | Control point 1. |
_ct2 | Control point 2. |
_dest | The curve destination. |
◆ clear()
void ot::Path2DF::clear |
( |
void | | ) |
|
Remove all the entries from the path.
- Note
- Note that the current position wont be changed.
◆ getEntries()
const std::list< PathEntry > & ot::Path2DF::getEntries |
( |
void | | ) |
const |
|
inline |
Returns the current entries.
◆ isClosed()
bool ot::Path2DF::isClosed |
( |
void | | ) |
|
Returns true if the path contains at least one entry, the entries are interconnected (end of a entry is start of another) and the start point is also the final end point.
◆ lineTo()
void ot::Path2DF::lineTo |
( |
const Point2DD & | _dest | ) |
|
Adds a line from the current position to the provided destination. The current position will be set to the destination.
- Parameters
-
_dest | The line destination. |
◆ moveBy()
void ot::Path2DF::moveBy |
( |
const Point2DD & | _d | ) |
|
|
inline |
Moves the current position by the delta.
- Parameters
-
_d | Move distance (incremental). |
◆ moveTo()
void ot::Path2DF::moveTo |
( |
const Point2DD & | _pos | ) |
|
|
inline |
Moves the current position. No line will be added.
- Parameters
-
_pos | The position to move to (absolute). |
◆ operator=()
◆ setFromJsonObject()
Will set the object contents from the provided JSON object.
- Parameters
-
_object | The JSON object containing the information |
- Exceptions
-
Will | throw an exception if the provided object is not valid (members missing or invalid types) |
Implements ot::Serializable.
The documentation for this class was generated from the following files: