PoDoFo  1.0.0-dev
Public Member Functions | List of all members
PoDoFo::PdfPainterPath Class Referencefinal

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.
 

Detailed Description

This class describes PDF paths being written to a PdfPainter.

Member Function Documentation

◆ 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
xx coordinate of the center of the arc (left coordinate)
yy coordinate of the center of the arc (top coordinate)
radiusradius
angle1angle1 in radians measured counterclockwise from the origin
angle2angle2 in radians measured counterclockwise from the origin
clockwiseThe 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
x1x coordinate the first control point
y1y coordinate the first control point
x2x coordinate of the end point, which is the new current point
y2y coordinate of the end point, which is the new current point
radiusradius

◆ AddCircle()

void PdfPainterPath::AddCircle ( double  x,
double  y,
double  radius 
)

Add a circle into the current path to the given coordinates.

Parameters
xx center coordinate of the circle
yy coordinate of the circle
radiusradius 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
x1x coordinate of the starting point
y1y coordinate of the starting point
x2x coordinate of the first control point
y2y coordinate of the first control point
x3x coordinate of the second control point
y3y coordinate of the second control point
x4x coordinate of the end point, which is the new current point
y4y 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
x1x coordinate of the first control point
y1y coordinate of the first control point
x2x coordinate of the second control point
y2y coordinate of the second control point
x3x coordinate of the end point, which is the new current point
y3y 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
xx coordinate of the ellipse (left coordinate)
yy coordinate of the ellipse (top coordinate)
widthwidth of the ellipse
heightabsolute 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
x1x coordinate of the first point
y1y coordinate of the first point
x2x coordinate of the second point
y2y 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
xx position
yy position

◆ AddPath()

void PdfPainterPath::AddPath ( const PdfPainterPath path,
bool  connect 
)

Add a path to the current path.

Parameters
paththe path to add
connecttrue 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
rectthe rectangle area
roundXrounding factor, x direction
roundYrounding 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
xx coordinate of the rectangle (left coordinate)
yy coordinate of the rectangle (bottom coordinate)
widthwidth of the rectangle
heightabsolute height of the rectangle
roundXrounding factor, x direction
roundYrounding 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.

◆ 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


The documentation for this class was generated from the following files: