-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpath.cpp
27 lines (18 loc) · 1.02 KB
/
path.cpp
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
#include "path.h"
namespace pathfinder {
PathSegment::~PathSegment() {}
StraightPathSegment::StraightPathSegment(const Vector &start, const Vector &end) : startPoint(start), endPoint(end) {
}
StraightPathSegment::StraightPathSegment(const StraightPathSegment &other) : startPoint(other.startPoint), endPoint(other.endPoint) {
}
std::unique_ptr<PathSegment> StraightPathSegment::clone() const {
return std::unique_ptr<PathSegment>(new StraightPathSegment(*this));
}
ArcPathSegment::ArcPathSegment(const Vector ¢er, const double radius, const AngleDirection direction) : circleCenter(center), circleRadius(radius), angleDirection(direction) {
}
ArcPathSegment::ArcPathSegment(const ArcPathSegment &other) : circleCenter(other.circleCenter), circleRadius(other.circleRadius), angleDirection(other.angleDirection), startAngle(other.startAngle), endAngle(other.endAngle) {
}
std::unique_ptr<PathSegment> ArcPathSegment::clone() const {
return std::unique_ptr<PathSegment>(new ArcPathSegment(*this));
}
} // namespace pathfinder