![]() |
Fréchet View
1.6.0
A Tool for Exploring Fréchet Distance Algorithms
|
Represents a polygonal curve.
Used when constructing curves from input data. Has methods for assembling and modifying the curve point by point.
This class appears in the JavaScript interface, so many methods are exposed as Qt slots. All methods marked as Q_INVOKABLE can be referred to from JavaScript. All methods return 'this' as result, allowing for a fluent API.
Note that this class has to live in the global namespace, rather than in the frechet::input namespace.
#include <path.h>
Inherits QObject.
Public Slots | |
int | size () const |
Path * | appendPath (Path *that) |
appends a copy of another Path More... | |
Path * | appendString (QString svg) |
appends a copy of an SVG path More... | |
Path * | M (QPointF p) |
append a new vertex at an absolute position More... | |
Path * | M (double x, double y) |
append a new vertex at an absolute position More... | |
Path * | H (double h) |
horizontal move to an absolute position More... | |
Path * | V (double v) |
vertical move to an absolute position More... | |
Path * | close () |
return to the first vertex, creating a closed curve More... | |
Path * | Z () |
return to the first vertex, creating a closed curve More... | |
Path * | undo () |
remove the last vertex More... | |
Path * | ensureClosed () |
make sure the curve is closed More... | |
Path * | m (QPointF p) |
append a new vertex, relative to the current position More... | |
Path * | m (double x, double y) |
append a new vertex, relative to the current position More... | |
Path * | h (double h) |
horizontal move, relative to the current position More... | |
Path * | v (double v) |
vertical move, relative to the current position More... | |
Path * | polar (double angle, double distance) |
append a new vertex, given by polar coordinates More... | |
Path * | map (QTransform tf) |
apply a transformation to all vertexes More... | |
Path * | map (QMatrix mx) |
apply a transformation to all vertexes More... | |
Path * | scale (double scale) |
scale the polygonal curve More... | |
Path * | scale (double scalex, double scaley) |
scale the polygonal curve More... | |
Path * | rotate (double angle) |
rotate the curve More... | |
Path * | translate (QPointF offset) |
translate the curve More... | |
Path * | translate (double dx, double dy) |
translate the curve More... | |
Path * | mirrorx () |
mirror the curve about the x-axis More... | |
Path * | mirrory () |
mirror the curve about the y-axis More... | |
Path * | revert () |
revert the order of vertexes More... | |
Path * | left (double angle) |
turn the turtle's head to the left More... | |
Path * | right (double angle) |
turn the turtle's head to the right More... | |
Path * | reset (double angle=0.0) |
turn the turtle's head to a given angle More... | |
Path * | forward (double distance) |
append a new vertex, relative to the current position More... | |
void | lineStyle (int) |
change the style of grid lines More... | |
void | setDefaultLineStyle (int) |
change the default style of grid lines More... | |
void | outerLineStyle (int) |
set the style of outermost grid lines More... | |
Public Member Functions | |
Q_INVOKABLE | Path (QObject *parent=0) |
default constructor More... | |
Q_INVOKABLE | Path (const Path &that) |
copy constructor More... | |
Q_INVOKABLE | Path (const Path *that) |
copy constructor More... | |
Q_INVOKABLE | Path (QString svg, bool forceAbsolute=false, QObject *parent=0) |
constructor from SVG input string More... | |
const QPolygonF & | toCurve (int precision=0) |
convert to a QPolygonF object, ready for processing by the Frechet distance algorithms More... | |
Q_INVOKABLE Path & | operator= (const Path &that) |
assignment operator More... | |
Q_INVOKABLE Path & | operator+= (const Path &that) |
append operator More... | |
Q_INVOKABLE Path & | operator+= (QString svg) |
append operator with SVG input string More... | |
void | parseSvg (QString str, bool forceAbsolute=false) |
parse an SVG input string More... | |
void | parseIpe (QString str) |
pare an IPE input string More... | |
LineStyle | getDefaultLineStyle () const |
const LineStyleVector & | getLineStyles () const |
Static Public Member Functions | |
static Path | svgPath (QString str, bool forceAbsolute=false) |
static constructor from SVG input string More... | |
static Path | ipePath (QString str) |
static constructor from IPE input string More... | |
Private Member Functions | |
void | append (QPointF p, char opcode) |
void | absolutize () |
replace all relative movements by absolute positions More... | |
void | setPrecision (int precision) |
set the numerical precision for input data (default is unlimited) More... | |
void | removeDuplicates () |
remove all duplicate points More... | |
Private Attributes | |
QPolygonF | points |
the list of vertexes More... | |
std::string | opcode |
used during assembly of a path: the next "move" operation More... | |
double | turtle_angle |
turtle_angle current direction of the turtle More... | |
LineStyle | defaultLineStyle |
default style for grid disaplay More... | |
LineStyleVector | lineStyles |
line styles for grid disaplay More... | |
Path::Path | ( | QObject * | parent = 0 | ) |
Path::Path | ( | const Path & | that | ) |
Path::Path | ( | const Path * | that | ) |
Path::Path | ( | QString | svg, |
bool | forceAbsolute = false , |
||
QObject * | parent = 0 |
||
) |
constructor from SVG input string
svg | an svg-encoded polygonal path |
forceAbsolute | assume all commands are absolute movements (no relative movements) |
parent | owning QObject, optional |
|
private |
|
private |
|
inlineslot |
appends a copy of an SVG path
svg |
|
slot |
|
slot |
|
slot |
|
inline |
|
inline |
|
inlineslot |
|
inlineslot |
|
static |
|
slot |
|
slot |
|
inlineslot |
|
inlineslot |
|
inlineslot |
|
inlineslot |
|
slot |
|
slot |
|
slot |
|
slot |
Path & Path::operator+= | ( | QString | svg | ) |
append operator with SVG input string
svg | an svg-encoded polygonal path |
|
slot |
void Path::parseIpe | ( | QString | str | ) |
void Path::parseSvg | ( | QString | str, |
bool | forceAbsolute = false |
||
) |
|
slot |
|
private |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
slot |
|
private |
|
inlineslot |
|
static |
static constructor from SVG input string
str | an svg-encoded polygonal path |
forceAbsolute | assume all commands are absolute movements (no relative movements) |
const QPolygonF & Path::toCurve | ( | int | precision = 0 | ) |
|
slot |
|
slot |
|
slot |
|
inlineslot |
|
inlineslot |
|
slot |
|
private |
|
private |
|
private |
|
private |