• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 
7 #ifndef XFA_FDE_CFDE_PATH_H_
8 #define XFA_FDE_CFDE_PATH_H_
9 
10 #include <vector>
11 
12 #include "core/fxge/cfx_pathdata.h"
13 #include "core/fxge/cfx_renderdevice.h"
14 
15 class CFDE_Path {
16  public:
17   void CloseFigure();
18 
19   void AddBezier(const std::vector<CFX_PointF>& points);
20   void AddBeziers(const std::vector<CFX_PointF>& points);
21   void AddCurve(const std::vector<CFX_PointF>& points,
22                 bool bClosed,
23                 FX_FLOAT fTension = 0.5f);
24   void AddEllipse(const CFX_RectF& rect);
25   void AddLines(const std::vector<CFX_PointF>& points);
26   void AddLine(const CFX_PointF& pt1, const CFX_PointF& pt2);
27   void AddPath(const CFDE_Path* pSrc, bool bConnect);
28   void AddPolygon(const std::vector<CFX_PointF>& points);
29   void AddRectangle(const CFX_RectF& rect);
30 
31   CFX_RectF GetBBox() const;
32   CFX_RectF GetBBox(FX_FLOAT fLineWidth, FX_FLOAT fMiterLimit) const;
33 
34   bool FigureClosed() const;
35   void BezierTo(const CFX_PointF& p1,
36                 const CFX_PointF& p2,
37                 const CFX_PointF& p3);
38   void ArcTo(bool bStart,
39              const CFX_RectF& rect,
40              FX_FLOAT startAngle,
41              FX_FLOAT endAngle);
42   void MoveTo(const CFX_PointF& p);
43   void LineTo(const CFX_PointF& p);
44 
45   void GetCurveTangents(const std::vector<CFX_PointF>& points,
46                         std::vector<CFX_PointF>* tangents,
47                         bool bClosed,
48                         FX_FLOAT fTension) const;
49   CFX_PathData m_Path;
50 };
51 
52 #endif  // XFA_FDE_CFDE_PATH_H_
53