PoDoFo 1.2.0
Loading...
Searching...
No Matches
PdfPainterPath.h
1// SPDX-FileCopyrightText: 2005 Dominik Seichter <domseichter@web.de>
2// SPDX-FileCopyrightText: 2020 Francesco Pretto <ceztko@gmail.com>
3// SPDX-License-Identifier: LGPL-2.0-or-later OR MPL-2.0
4
5#ifndef PDF_GRAPHICS_PATH_H
6#define PDF_GRAPHICS_PATH_H
7
8#include "PdfStringStream.h"
9#include <podofo/auxiliary/Rect.h>
10
11namespace PoDoFo {
12
14class PODOFO_API PdfPainterPath final
15{
16public:
18
19public:
23 void MoveTo(double x, double y);
24
29 void AddLineTo(double x, double y);
30
37 void AddLine(double x1, double y1, double x2, double y2);
38
47 void AddCubicBezierTo(double x1, double y1, double x2, double y2, double x3, double y3);
48
58 void AddCubicBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4);
59
64 void AddCircle(double x, double y, double radius);
65
71 void AddEllipse(double x, double y, double width, double height);
72
81 void AddArc(double x, double y, double radius, double angle1, double angle2, bool clockwise = false);
82
90 void AddArcTo(double x1, double y1, double x2, double y2, double radius);
91
99 void AddRectangle(double x, double y, double width, double height,
100 double roundX = 0.0, double roundY = 0.0);
101
106 void AddRectangle(const Rect& rect, double roundX = 0.0, double roundY = 0.0);
107
111 void AddPath(const PdfPainterPath& path, bool connect);
112
116 void Close();
117
119 void Reset();
120
121public:
123 std::string_view GetContent() const;
124
126 const Vector2& GetFirstPoint() const;
127
129 const Vector2& GetCurrentPoint() const;
130
131private:
132 void checkOpened() const;
133 void open(double x, double y);
134
135private:
136 PdfPainterPath(const PdfPainterPath& painter) = delete;
137 PdfPainterPath& operator=(const PdfPainterPath& painter) = delete;
138
139private:
140 PdfStringStream m_stream;
141 nullable<Vector2> m_FirstPoint;
142 Vector2 m_CurrentPoint;
143};
144
145}
146
147#endif // PDF_GRAPHICS_PATH_H
This class describes PDF paths being written to a PdfPainter.
Definition PdfPainterPath.h:15
A specialized Pdf output string stream It supplies an iostream-like operator<< interface,...
Definition PdfStringStream.h:16
An normalized rectangle defined by position (left-bottom) and size.
Definition Rect.h:17
Convenient type for char array storage and/or buffer with std::string compatibility.
Definition basetypes.h:30
All classes, functions, types and enums of PoDoFo are members of these namespace.
Definition basetypes.h:13