The Path2D class describes a path consisting of different types of lines.
More...
#include "Path2D.h"
|
| | Path2D () |
| | Default constructor.
|
| |
| | Path2D (const Point2D &_startPos) |
| | Assignment constructor.
|
| |
| | Path2D (const Path2D &_other) |
| | Copy constructor.
|
| |
| virtual | ~Path2D () |
| | Destructor.
|
| |
| Path2D & | operator= (const Path2D &_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 Point2D &_pos) |
| | Moves the current position. No line will be added.
|
| |
| void | moveBy (const Point2D &_d) |
| | Moves the current position by the delta.
|
| |
| void | lineTo (const Point2D &_dest) |
| | Adds a line from the current position to the provided destination. The current position will be set to the destination.
|
| |
| void | berzierTo (const Point2D &_ct1, const Point2D &_ct2, const Point2D &_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 Path2D class describes a path consisting of different types of lines.
◆ PathEntryType
The type of a path entry.
| Enumerator |
|---|
| LineType | |
| BerzierType | |
◆ Path2D() [1/3]
◆ Path2D() [2/3]
| ot::Path2D::Path2D |
( |
const Point2D & | _startPos | ) |
|
Assignment constructor.
- Parameters
-
| _startPos | The initial position of the path (same as calling moveTo()) |
◆ Path2D() [3/3]
| ot::Path2D::Path2D |
( |
const Path2D & | _other | ) |
|
◆ ~Path2D()
◆ 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::Path2D::clear |
( |
void | | ) |
|
Remove all the entries from the path.
- Note
- Note that the current position wont be changed.
◆ getEntries()
| const std::list< PathEntry > & ot::Path2D::getEntries |
( |
void | | ) |
const |
|
inline |
Returns the current entries.
◆ isClosed()
| bool ot::Path2D::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::Path2D::lineTo |
( |
const Point2D & | _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::Path2D::moveBy |
( |
const Point2D & | _d | ) |
|
|
inline |
Moves the current position by the delta.
- Parameters
-
| _d | Move distance (incremental). |
◆ moveTo()
| void ot::Path2D::moveTo |
( |
const Point2D & | _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: