Rev 2097 | Rev 2180 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2097 | Rev 2131 | ||
---|---|---|---|
Line 10... | Line 10... | ||
10 | 10 | ||
11 | #include "point.h"
|
11 | #include "point.h"
|
12 | #include "multi_curve.h"
|
12 | #include "multi_curve.h"
|
13 | 13 | ||
14 | struct multi_curve; |
14 | struct multi_curve; |
- | 15 | ||
15 | struct hit_t { |
16 | struct hit_t { |
- | 17 | ||
16 | multi_curve* crv; // curve hit |
18 | multi_curve* crv; // curve hit |
17 | int crv_id; // id among list of curves |
19 | int crv_id; // id among list of curves |
18 | enum {NONE = 0, VERTEX, LEFT_TANGENT, RIGHT_TANGENT}; // things that can be hit |
20 | enum {NONE = 0, VERTEX, LEFT_TANGENT, RIGHT_TANGENT}; // things that can be hit |
19 | int what; // what was hit |
21 | int what; // what was hit |
20 | int id; // id of hit thing |
22 | int id; // id of hit thing |
Line 35... | Line 37... | ||
35 | int matched_id (const hit_t& h) {return ( (crv == h.crv) && (id == h.id) ); } |
37 | int matched_id (const hit_t& h) {return ( (crv == h.crv) && (id == h.id) ); } |
36 | void ensure_id (); |
38 | void ensure_id (); |
37 | hit_t& operator= (const hit_t& h); |
39 | hit_t& operator= (const hit_t& h); |
38 | void copy (const hit_t& src); |
40 | void copy (const hit_t& src); |
39 | const point<float>& get (); |
41 | const point<float>& get (); |
- | 42 | ||
40 | }; |
43 | }; |
41 | 44 | ||
42 | template <typename T> T& operator<< (T& t, const hit_t& h) { |
45 | template <typename T> T& operator<< (T& t, const hit_t& h) { |
43 | if (hit_t::name_only) |
46 | if (hit_t::name_only) |
44 | t << h.crv->name; |
47 | t << h.crv->name; |