blob: 8c26d09e4516b01f0ed36fd8f3e481b404ea2766 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
#pragma once
#include "../geometry/point2d.hpp"
#include "../geometry/angles.hpp"
namespace graphics
{
struct PathPoint
{
int m_i; //< segment number
ang::AngleD m_segAngle;
m2::PointD m_pt; //< point on segment
PathPoint(int i = -1,
ang::AngleD const & segAngle = ang::AngleD(),
m2::PointD const & pt = m2::PointD());
};
struct PivotPoint
{
ang::AngleD m_angle;
PathPoint m_pp;
PivotPoint(ang::AngleD const & angle = ang::AngleD(), PathPoint const & pp = PathPoint());
};
class PathView
{
private:
m2::PointD const * m_pts;
size_t m_ptsCount;
bool m_isReverse;
public:
PathView();
PathView(m2::PointD const * pts, size_t ptsCount);
size_t size() const;
m2::PointD const & get(size_t i) const;
void setIsReverse(bool flag);
bool isReverse() const;
PathPoint const offsetPoint(PathPoint const & pp, double offset) const;
PivotPoint findPivotPoint(PathPoint const & pp, double advance, double kern) const;
PathPoint const front() const;
};
}
|