#include <PdfPainterPath.h>
|
void | MoveTo (double x, double y) |
|
void | AddLineTo (double x, double y) |
|
void | AddLine (double x1, double y1, double x2, double y2) |
|
void | AddCubicBezierTo (double x1, double y1, double x2, double y2, double x3, double y3) |
|
void | AddCubicBezier (double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) |
|
void | AddCircle (double x, double y, double radius) |
|
void | AddEllipse (double x, double y, double width, double height) |
|
void | AddArc (double x, double y, double radius, double angle1, double angle2, bool clockwise=false) |
|
void | AddArcTo (double x1, double y1, double x2, double y2, double radius) |
|
void | AddRectangle (double x, double y, double width, double height, double roundX=0.0, double roundY=0.0) |
|
void | AddRectangle (const Rect &rect, double roundX=0.0, double roundY=0.0) |
|
void | AddPath (const PdfPainterPath &path, bool connect) |
|
void | Close () |
|
void | Reset () |
|
std::string_view | GetContent () const |
|
const Vector2 & | GetFirstPoint () const |
|
const Vector2 & | GetCurrentPoint () const |
|
This class describes PDF paths being written to a PdfPainter
◆ AddArc()
void PdfPainterPath::AddArc |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
radius, |
|
|
double |
angle1, |
|
|
double |
angle2, |
|
|
bool |
clockwise = false |
|
) |
| |
Add a counter clockwise arc into the current path spanning to the given angles and radius This is the equivalent of the "arc"/"arcn" operators in PostScript
- Parameters
-
x | x coordinate of the center of the arc (left coordinate) |
y | y coordinate of the center of the arc (top coordinate) |
radius | radius |
angle1 | angle1 in radians measured counterclockwise from the origin |
angle2 | angle2 in radians measured counterclockwise from the origin |
clockwise | The arc is drawn clockwise instead |
◆ AddArcTo()
void PdfPainterPath::AddArcTo |
( |
double |
x1, |
|
|
double |
y1, |
|
|
double |
x2, |
|
|
double |
y2, |
|
|
double |
radius |
|
) |
| |
Append an arc from the current point to the current path This is the equivalent of the "arct" operator in PostScript
- Parameters
-
x1 | x coordinate the first control point |
y1 | y coordinate the first control point |
x2 | x coordinate of the end point, which is the new current point |
y2 | y coordinate of the end point, which is the new current point |
radius | radius |
◆ AddCircle()
void PdfPainterPath::AddCircle |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
radius |
|
) |
| |
Add a circle into the current path to the given coordinates
- Parameters
-
x | x center coordinate of the circle |
y | y coordinate of the circle |
radius | radius of the circle |
◆ AddCubicBezier()
void PdfPainterPath::AddCubicBezier |
( |
double |
x1, |
|
|
double |
y1, |
|
|
double |
x2, |
|
|
double |
y2, |
|
|
double |
x3, |
|
|
double |
y3, |
|
|
double |
x4, |
|
|
double |
y4 |
|
) |
| |
Add a cubic bezier curve starting from the (x1,y1) point to the current path
- Parameters
-
x1 | x coordinate of the starting point |
y1 | y coordinate of the starting point |
x2 | x coordinate of the first control point |
y2 | y coordinate of the first control point |
x3 | x coordinate of the second control point |
y3 | y coordinate of the second control point |
x4 | x coordinate of the end point, which is the new current point |
y4 | y coordinate of the end point, which is the new current point |
◆ AddCubicBezierTo()
void PdfPainterPath::AddCubicBezierTo |
( |
double |
x1, |
|
|
double |
y1, |
|
|
double |
x2, |
|
|
double |
y2, |
|
|
double |
x3, |
|
|
double |
y3 |
|
) |
| |
Append a cubic bezier curve from from the current point to the current path Matches the PDF 'c' operator.
- Parameters
-
x1 | x coordinate of the first control point |
y1 | y coordinate of the first control point |
x2 | x coordinate of the second control point |
y2 | y coordinate of the second control point |
x3 | x coordinate of the end point, which is the new current point |
y3 | y coordinate of the end point, which is the new current point |
◆ AddEllipse()
void PdfPainterPath::AddEllipse |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
width, |
|
|
double |
height |
|
) |
| |
Add an ellipse into the current path to the given coordinates
- Parameters
-
x | x coordinate of the ellipse (left coordinate) |
y | y coordinate of the ellipse (top coordinate) |
width | width of the ellipse |
height | absolute height of the ellipse |
◆ AddLine()
void PdfPainterPath::AddLine |
( |
double |
x1, |
|
|
double |
y1, |
|
|
double |
x2, |
|
|
double |
y2 |
|
) |
| |
Add straight line segment from the point (x1, y1) to (x2, y2) the path Matches the PDF 'l' operator.
- Parameters
-
x1 | x coordinate of the first point |
y1 | y coordinate of the first point |
x2 | x coordinate of the second point |
y2 | y coordinate of the second point |
◆ AddLineTo()
void PdfPainterPath::AddLineTo |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
Append a straight line segment from the current point to the point (x, y) to the path Matches the PDF 'l' operator.
- Parameters
-
◆ AddPath()
void PdfPainterPath::AddPath |
( |
const PdfPainterPath & |
path, |
|
|
bool |
connect |
|
) |
| |
Add a path to the current path
- Parameters
-
path | the path to add |
connect | true if connect the first figure of the given the path to the last figure of this path |
◆ AddRectangle() [1/2]
void PdfPainterPath::AddRectangle |
( |
const Rect & |
rect, |
|
|
double |
roundX = 0.0 , |
|
|
double |
roundY = 0.0 |
|
) |
| |
Add a rectangle into the current path to the given coordinates
- Parameters
-
rect | the rectangle area |
roundX | rounding factor, x direction |
roundY | rounding factor, y direction |
◆ AddRectangle() [2/2]
void PdfPainterPath::AddRectangle |
( |
double |
x, |
|
|
double |
y, |
|
|
double |
width, |
|
|
double |
height, |
|
|
double |
roundX = 0.0 , |
|
|
double |
roundY = 0.0 |
|
) |
| |
Add a rectangle into the current path to the given coordinates
- Parameters
-
x | x coordinate of the rectangle (left coordinate) |
y | y coordinate of the rectangle (bottom coordinate) |
width | width of the rectangle |
height | absolute height of the rectangle |
roundX | rounding factor, x direction |
roundY | rounding factor, y direction |
◆ Close()
void PdfPainterPath::Close |
( |
| ) |
|
Closes the current path by drawing a line from the current point to the starting point of the path. Matches the PDF 'h' operator. This function is useful to construct a closed path or clipping.
◆ GetContent()
string_view PdfPainterPath::GetContent |
( |
| ) |
const |
Get a string view of the current content stream being built
◆ GetCurrentPoint()
const Vector2 & PdfPainterPath::GetCurrentPoint |
( |
| ) |
const |
Get the coordiantes of the current point
◆ GetFirstPoint()
const Vector2 & PdfPainterPath::GetFirstPoint |
( |
| ) |
const |
Get the coordiantes of the first point
◆ MoveTo()
void PdfPainterPath::MoveTo |
( |
double |
x, |
|
|
double |
y |
|
) |
| |
Begin a new path. Matches the PDF 'm' operator. This function is useful to construct an own path for drawing or clipping
◆ Reset()
void PdfPainterPath::Reset |
( |
| ) |
|
Clear the path currently building and reset the internal state