PoDoFo
1.0.0-dev
|
This class describes PDF paths being written to a PdfPainter. More...
#include <PdfPainterPath.h>
Public Member Functions | |
void | MoveTo (double x, double y) |
Begin a new path. More... | |
void | 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. More... | |
void | 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. More... | |
void | 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. More... | |
void | 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. More... | |
void | AddCircle (double x, double y, double radius) |
Add a circle into the current path to the given coordinates. More... | |
void | AddEllipse (double x, double y, double width, double height) |
Add an ellipse into the current path to the given coordinates. More... | |
void | 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. More... | |
void | 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. More... | |
void | 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. More... | |
void | AddRectangle (const Rect &rect, double roundX=0.0, double roundY=0.0) |
Add a rectangle into the current path to the given coordinates. More... | |
void | AddPath (const PdfPainterPath &path, bool connect) |
Add a path to the current path. More... | |
void | Close () |
Closes the current path by drawing a line from the current point to the starting point of the path. More... | |
void | Reset () |
Clear the path currently building and reset the internal state. | |
std::string_view | GetContent () const |
Get a string view of the current content stream being built. | |
const Vector2 & | GetFirstPoint () const |
Get the coordinates of the first point. | |
const Vector2 & | GetCurrentPoint () const |
Get the coordinates of the current point. | |
This class describes PDF paths being written to a PdfPainter.
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.
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 |
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.
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 |
void PdfPainterPath::AddCircle | ( | double | x, |
double | y, | ||
double | radius | ||
) |
Add a circle into the current path to the given coordinates.
x | x center coordinate of the circle |
y | y coordinate of the circle |
radius | radius of the circle |
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.
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 |
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.
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 |
void PdfPainterPath::AddEllipse | ( | double | x, |
double | y, | ||
double | width, | ||
double | height | ||
) |
Add an ellipse into the current path to the given coordinates.
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 |
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.
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 |
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.
x | x position |
y | y position |
void PdfPainterPath::AddPath | ( | const PdfPainterPath & | path, |
bool | connect | ||
) |
Add a path to the current path.
path | the path to add |
connect | true if connect the first figure of the given the path to the last figure of this path |
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.
rect | the rectangle area |
roundX | rounding factor, x direction |
roundY | rounding factor, y direction |
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.
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 |
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.
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