30 class Path :
public QObject {
58 Path(QObject* parent=0);
84 Path(QString svg,
bool forceAbsolute=
false, QObject* parent=0);
106 const QPolygonF&
toCurve(
int precision=0);
172 Path*
M(
double x,
double y) {
return M(QPointF(x,y)); }
222 Path*
m(
double x,
double y) {
return m(QPointF(x,y)); }
271 Path*
scale(
double scalex,
double scaley);
357 void parseSvg(QString
str,
bool forceAbsolute=
false);
const LineStyleVector & getLineStyles() const
void parseIpe(QString str)
pare an IPE input string
QPolygonF points
the list of vertexes
Path * M(double x, double y)
append a new vertex at an absolute position
Path * mirrorx()
mirror the curve about the x-axis
static int distance(int a, int b, int n)
static Path svgPath(QString str, bool forceAbsolute=false)
static constructor from SVG input string
void parseSvg(QString str, bool forceAbsolute=false)
parse an SVG input string
static Path ipePath(QString str)
static constructor from IPE input string
std::vector< LineStyle > LineStyleVector
void removeDuplicates()
remove all duplicate points
Path * translate(QPointF offset)
translate the curve
Path * appendString(QString svg)
appends a copy of an SVG path
Path * left(double angle)
turn the turtle's head to the left
Path * H(double h)
horizontal move to an absolute position
void append(QPointF p, char opcode)
LineStyle defaultLineStyle
default style for grid disaplay
Path * reset(double angle=0.0)
turn the turtle's head to a given angle
Path * map(QTransform tf)
apply a transformation to all vertexes
Path * rotate(double angle)
rotate the curve
Path * ensureClosed()
make sure the curve is closed
Path * undo()
remove the last vertex
Path * h(double h)
horizontal move, relative to the current position
void setDefaultLineStyle(int)
change the default style of grid lines
Represents a polygonal curve.
Path * appendPath(Path *that)
appends a copy of another Path
Path * revert()
revert the order of vertexes
Path * mirrory()
mirror the curve about the y-axis
void outerLineStyle(int)
set the style of outermost grid lines
Path * V(double v)
vertical move to an absolute position
Path * close()
return to the first vertex, creating a closed curve
Path * forward(double distance)
append a new vertex, relative to the current position
Path * scale(double scale)
scale the polygonal curve
Path * Z()
return to the first vertex, creating a closed curve
Q_INVOKABLE Path & operator+=(const Path &that)
append operator
const QPolygonF & toCurve(int precision=0)
convert to a QPolygonF object, ready for processing by the Frechet distance algorithms
Path * polar(double angle, double distance)
append a new vertex, given by polar coordinates
void absolutize()
replace all relative movements by absolute positions
LineStyleVector lineStyles
line styles for grid disaplay
double turtle_angle
turtle_angle current direction of the turtle
Q_INVOKABLE Path(QObject *parent=0)
default constructor
Path * v(double v)
vertical move, relative to the current position
Q_INVOKABLE Path & operator=(const Path &that)
assignment operator
LineStyle
display style of grid lines in free-space diagram
std::string opcode
used during assembly of a path: the next "move" operation
Path * M(QPointF p)
append a new vertex at an absolute position
void lineStyle(int)
change the style of grid lines
void setPrecision(int precision)
set the numerical precision for input data (default is unlimited)
Path * m(double x, double y)
append a new vertex, relative to the current position
LineStyle getDefaultLineStyle() const
Path * m(QPointF p)
append a new vertex, relative to the current position
Path * right(double angle)
turn the turtle's head to the right