-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpath.h
72 lines (51 loc) · 1.55 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#ifndef PATH
#define PATH
#include <vector>
#include "segment.h"
#include "curve.h"
#include <eigen3/Eigen/Dense>
using namespace Eigen;
using namespace std;
class Path {
vector<Segment> segments;
//TODO winding is used by a built in java lib...
//Not sure if this is used
int winding_rule;
bool is_valid_seg_idx(size_t i);
public:
Path();
//Strait line between p1, p2
Path(my_point p1, my_point p2);
Path(vector<Segment>);
bool empty();
void clear();
Path get_transformed_copy(Transform<double,2,Affine> at);
void transform(Transform<double,2,Affine> at);
size_t get_num_segments() const;
size_t get_num_curves() const;
Path get_reverse_path();
Curve get_curve(size_t i) const;
Curve get_curve_before_seg_idx(size_t i);
Curve get_curve_after_seg_idx(size_t i);
vector<Curve> get_curves() const;
Segment get_segment(size_t i) const;
Segment get_first_segment();
Segment get_last_segment();
my_point get_first_point();
my_point get_last_point();
my_point get_tangent_in_at_segment_index(size_t i);
my_point get_tangent_out_at_segment_index(size_t i);
void set(size_t i, Segment new_seg);
void set_last_segment(Segment seg);
vector<my_point> get_bounding_box();
bool is_acute_angle(size_t i);
bool is_closed();
bool is_straight();
bool is_nondifferentiable_at_segment_index(size_t i);
void add_segment(Segment seg);
void add_curve(Curve curve);
void remove_segment(size_t i);
};
ostream& operator <<(ostream &o, const Path &p);
ostream& operator <<(ostream &o, const vector<Path> &p);
#endif