PoDoFo  1.0.0-dev
PdfPainterPath.h
1 
7 #ifndef PDF_GRAPHICS_PATH_H
8 #define PDF_GRAPHICS_PATH_H
9 
10 #include "PdfStringStream.h"
11 #include <podofo/auxiliary/Rect.h>
12 
13 namespace PoDoFo {
14 
18 class PODOFO_API PdfPainterPath final
19 {
20 public:
22 
23 public:
28  void MoveTo(double x, double y);
29 
35  void AddLineTo(double x, double y);
36 
44  void AddLine(double x1, double y1, double x2, double y2);
45 
55  void AddCubicBezierTo(double x1, double y1, double x2, double y2, double x3, double y3);
56 
67  void AddCubicBezier(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4);
68 
74  void AddCircle(double x, double y, double radius);
75 
82  void AddEllipse(double x, double y, double width, double height);
83 
93  void AddArc(double x, double y, double radius, double angle1, double angle2, bool clockwise = false);
94 
103  void AddArcTo(double x1, double y1, double x2, double y2, double radius);
104 
113  void AddRectangle(double x, double y, double width, double height,
114  double roundX = 0.0, double roundY = 0.0);
115 
121  void AddRectangle(const Rect& rect, double roundX = 0.0, double roundY = 0.0);
122 
128  void AddPath(const PdfPainterPath& path, bool connect);
129 
134  void Close();
135 
139  void Reset();
140 
141 public:
145  std::string_view GetContent() const;
146 
150  const Vector2& GetFirstPoint() const;
151 
155  const Vector2& GetCurrentPoint() const;
156 
157 private:
158  void checkOpened() const;
159  void open(double x, double y);
160 
161 private:
162  PdfPainterPath(const PdfPainterPath& painter) = delete;
163  PdfPainterPath& operator=(const PdfPainterPath& painter) = delete;
164 
165 private:
166  PdfStringStream m_stream;
167  nullable<Vector2> m_FirstPoint;
168  Vector2 m_CurrentPoint;
169 };
170 
171 }
172 
173 #endif // PDF_GRAPHICS_PATH_H
This class describes PDF paths being written to a PdfPainter.
Definition: PdfPainterPath.h:19
A specialized Pdf output string stream It supplies an iostream-like operator<< interface,...
Definition: PdfStringStream.h:20
A rectangle defined by position and size.
Definition: Rect.h:20
SPDX-FileCopyrightText: (C) 2022 Francesco Pretto ceztko@gmail.com SPDX-License-Identifier: LGPL-2....
Definition: basetypes.h:16