SegmentList.hpp
Go to the documentation of this file.
1 
6 #pragma once
7 
8 #include <etk/types.hpp>
9 #include <etk/math/Vector2D.hpp>
10 #include <esvg/cap.hpp>
11 #include <esvg/join.hpp>
12 #include <esvg/render/Segment.hpp>
14 
15 namespace esvg {
16  namespace render {
17  class SegmentList {
18  public:
19  std::vector<esvg::render::Segment> m_data;
20  public:
21  SegmentList();
22  #ifdef DEBUG
23  void addSegment(const vec2& _pos0, const vec2& _pos1);
24  #endif
25  void addSegment(const esvg::render::Point& _pos0, const esvg::render::Point& _pos1);
26  void addSegment(const esvg::render::Point& _pos0, const esvg::render::Point& _pos1, bool _disableHorizontal);
27  void createSegmentList(const esvg::render::PointList& _listPoint);
28  void createSegmentListStroke(esvg::render::PointList& _listPoint,
29  float _width,
30  enum esvg::cap _cap,
31  enum esvg::join _join,
32  float _miterLimit);
33  private:
34  void startStopPoint(vec2& _leftPoint,
35  vec2& _rightPoint,
36  const esvg::render::Point& _point,
37  enum esvg::cap _cap,
38  float _width,
39  bool _isStart);
40  void createSegmentListStroke(const vec2& _point1,
41  const vec2& _point2,
42  const vec2& _center,
43  float _width,
44  bool _isStart);
45  public:
46  std::pair<vec2, vec2> getViewPort();
47  void applyMatrix(const mat2& _transformationMatrix);
48  };
49  }
50 }
Main esvg namespace.
Definition: Base.hpp:24
Definition: Point.hpp:14
Definition: PointList.hpp:16
Definition: SegmentList.hpp:17