/*
5 * Authors: see git history
7 * Copyright (C) 2014 Authors
8 * Released under GNU GPL v2+, read the file
'COPYING' for more information.
128 std::vector<path_lineto>
pts;
235 int ArcTo (
Geom::Point const &ip,
double iRx,
double iRy,
double angle,
bool iLargeArc,
bool iClockwise);
249 void Convert (
double treshhold);
379 void Fill(
Shape *dest,
int pathID = -1,
bool justAdd =
false,
380 bool closeIfNeeded =
true,
bool invert =
false);
385 ButtType butt,
double miter,
bool justAdd =
false);
443 void DashPolyline(
float head,
float tail,
float body,
int nbD,
const float dashs[],
bool stPlain,
float stOffset);
523 void FastBBox(
double &l,
double &t,
double &r,
double &b);
553 void InsertArcTo (
Geom::Point const &ip,
double iRx,
double iRy,
double angle,
bool iLargeArc,
bool iClockwise,
int at);
558 void DashSubPath(
int spL,
int spP, std::vector<path_lineto>
const &orig_pts,
float head,
float tail,
float body,
int nbD,
const float dashs[],
bool stPlain,
float stOffset);
582 double angle,
bool large,
bool wise,
double tresh);
636 double angle,
bool large,
bool wise,
double tresh,
int piece,
637 bool relative, std::vector<double>
const &cuts = {});
639 double st,
double et,
int piece,
bool relative);
641 double st,
double et,
int piece,
bool relative, std::span<double>
const &cuts);
644 double ry,
double angle,
bool large,
bool wise,
645 double &sang,
double &eang);
650 struct outline_callback_data
656 double x1, y1, x2, y2;
661 double dx1, dy1, dx2, dy2;
671 double rx, ry,
angle;
680 typedef void (outlineCallback) (outline_callback_data *
data,
double tol,
double width);
681 struct outline_callbacks
683 outlineCallback *cubicto;
684 outlineCallback *arcto;
687 void SubContractOutline (
int off,
int num_pd,
688 Path * dest, outline_callbacks & calls,
690 ButtType butt,
double miter,
bool closeIfNeeded,
693 ButtType butt,
double miter,
bool justAdd =
false);
704 static bool IsNulCurve (std::vector<PathDescr*>
const &cmd,
int curD,
Geom::Point const &curX);
706 static void RecStdCubicTo (outline_callback_data *
data,
double tol,
707 double width,
int lev);
708 static void StdCubicTo (outline_callback_data *
data,
double tol,
710 static void RecStdArcTo (outline_callback_data *
data,
double tol,
711 double width,
int lev);
712 static void StdArcTo (outline_callback_data *
data,
double tol,
double width);
719 double nextL,
int *stNo,
int *enNo);
722 double nextL,
int &leftStNo,
int &leftEnNo,
int pathID=-1,
int pieceID=0,
double tID=0.0);
725 double nextL,
int &rightStNo,
int &rightEnNo,
int pathID=-1,
int pieceID=0,
double tID=0.0);
726 static void RecRound (
Shape * dest,
int sNo,
int eNo,
744 void DoSimplify(
int off,
int N,
double treshhold);
778 double *Xk,
double *Yk,
double *Qk,
double *tk,
int nbPt);
787 struct fitting_tables {
809 bool AttemptSimplify (fitting_tables &
data,
double treshhold,
PathDescrCubicTo & res,
int &worstP);
Cartesian point / 2D vector and related operations.
TODO: insert short description here.
3x3 matrix representing an affine transformation.
Abstract continuous curve on a plane defined on [0,1].
Sequence of contiguous curves, aka spline.
Two-dimensional point that doubles as a vector.
Path and its polyline approximation.
void ConvertWithBackData(double threshhold, bool relative=false)
Creates a polyline approximation of the path.
int LineTo(Geom::Point const &ip)
Appends a LineTo path command.
void SetBackData(bool nVal)
Sets the back variable to the value passed in and clears the polyline approximation.
void DashSubPath(int spL, int spP, std::vector< path_lineto > const &orig_pts, float head, float tail, float body, int nbD, const float dashs[], bool stPlain, float stOffset)
void DashPolylineFromStyle(SPStyle *style, float scale, float min_len)
void InsertLineTo(Geom::Point const &iPt, int at)
int Close()
Appends a close path command.
void ConvertForcedToVoid()
cut_position PointToCurvilignPosition(Geom::Point const &pos, unsigned seg=0) const
void OutsideOutline(Path *dest, double width, JoinType join, ButtType butt, double miter)
void ResetPoints()
Clears the polyline approximation.
void ConvertForcedToMoveTo()
void Fill(Shape *dest, int pathID=-1, bool justAdd=false, bool closeIfNeeded=true, bool invert=false)
Fills the shape with the polyline approximation stored in this object.
int ArcTo(Geom::Point const &ip, double iRx, double iRy, double angle, bool iLargeArc, bool iClockwise)
Appends an ArcTo path command.
void PointAt(int piece, double at, Geom::Point &pos)
int AddForcedPoint()
Adds a forced point to the polyline approximation's list of points.
std::string svg_dump_path() const
std::vector< path_lineto > pts
void Transform(const Geom::Affine &trans)
Apply a transformation on all path commands.
void ConvertEvenLines(double treshhold)
Creates a polyline approximation of the path.
void LoadPathVector(Geom::PathVector const &pv, Geom::Affine const &tr, bool doTransformation)
Load a lib2geom Geom::PathVector in this path object.
void PointAndTangentAt(int piece, double at, Geom::Point &pos, Geom::Point &tgt)
Geom::PathVector MakePathVector() const
Create a lib2geom Geom::PathVector from this Path object.
int MoveTo(Geom::Point const &ip)
Appends a MoveTo path command.
void LoadPath(Geom::Path const &path, Geom::Affine const &tr, bool doTransformation, bool append=false)
Load a lib2geom Geom::Path in this path object.
void InsertArcTo(Geom::Point const &ip, double iRx, double iRy, double angle, bool iLargeArc, bool iClockwise, int at)
std::vector< ForcedSubdivision > forced_subdivisions
void Copy(Path *who)
Clear all stored path commands, resets flags and imports path commands from the passed Path object.
const Geom::Point PrevPoint(const int i) const
void Outline(Path *dest, double width, JoinType join, ButtType butt, double miter)
Path ** SubPathsWithNesting(int &outNb, bool killNoSurf, int nbNest, int *nesting, int *conts)
void DoArc(Geom::Point const &iS, Geom::Point const &iE, double rx, double ry, double angle, bool large, bool wise, double tresh)
The function is quite similar to RecCubicTo.
void DashPolyline(float head, float tail, float body, int nbD, const float dashs[], bool stPlain, float stOffset)
void ConvertPositionsToMoveTo(int nbPos, cut_position *poss)
void InsideOutline(Path *dest, double width, JoinType join, ButtType butt, double miter)
bool IsLineSegment(int piece)
cut_position * CurvilignToPosition(int nbCv, double *cvAbs, int &nbCut)
void Coalesce(double tresh)
Simplify the path with a different approach.
void ConvertPositionsToForced(int nbPos, cut_position *poss)
void InsertCubicTo(Geom::Point const &ip, Geom::Point const &iStD, Geom::Point const &iEnD, int at)
void FastBBox(double &l, double &t, double &r, double &b)
void Stroke(Shape *dest, bool doClose, double width, JoinType join, ButtType butt, double miter, bool justAdd=false)
Path ** SubPaths(int &outNb, bool killNoSurf)
int CubicTo(Geom::Point const &ip, Geom::Point const &iStD, Geom::Point const &iEnD)
Appends a CubicBezier path command.
std::vector< PathDescr * > descr_cmd
int AddPoint(Geom::Point const &iPt, bool mvto=false)
Adds a point to the polyline approximation's list of points.
void InsertMoveTo(Geom::Point const &iPt, int at)
void Simplify(double treshhold)
Simplify the path.
void Convert(double treshhold)
Creates a polyline approximation of the path.
void PolylineBoundingBox(double &l, double &t, double &r, double &b)
void InsertForcePoint(int at)
int ForcePoint()
Appends a forced point path command.
void Reset()
Clears all stored path commands and resets flags that are used by command functions while adding path...
double PositionToLength(int piece, double t)
A class to store/manipulate directed graphs.
double angle(std::vector< Point > const &A)
void append(std::vector< T > &vec, std::vector< T > const &other)
void invert(const double v[16], double alpha[16])
Elliptical Arc path command.
Cubic Bezier path command.
A base class for Livarot's path commands.
Points of the polyline approximation.
path_lineto(bool m, Geom::Point const &pp)
path_lineto(bool m, Geom::Point const &pp, int pie, double tt)