PoDoFo 0.9.20
Public Member Functions | List of all members
PoDoFo::PdfPainterPath Class Referencefinal

#include <PdfPainterPath.h>

Public Member Functions

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
 

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.

◆ 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