-
Notifications
You must be signed in to change notification settings - Fork 1
/
path.h
35 lines (27 loc) · 926 Bytes
/
path.h
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
#ifndef PATHFINDER_PATH_H_
#define PATHFINDER_PATH_H_
#include "math_helpers.h"
#include "vector.h"
#include <memory>
namespace pathfinder {
struct PathSegment {
virtual std::unique_ptr<PathSegment> clone() const = 0;
virtual ~PathSegment();
};
struct StraightPathSegment : public PathSegment {
StraightPathSegment(const Vector &start, const Vector &end);
StraightPathSegment(const StraightPathSegment &other);
std::unique_ptr<PathSegment> clone() const override;
Vector startPoint, endPoint;
};
struct ArcPathSegment : public PathSegment {
ArcPathSegment(const Vector ¢er, const double radius, const AngleDirection direction);
ArcPathSegment(const ArcPathSegment &other);
std::unique_ptr<PathSegment> clone() const override;
Vector circleCenter;
double circleRadius;
AngleDirection angleDirection;
double startAngle, endAngle;
};
} // namespace pathfinder
#endif // PATHFINDER_PATH_H_