Rev 1624 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1624 | giacomo | 1 | #ifndef __PERCORSO_H__ |
2 | #define __PERCORSO_H__ |
||
3 | |||
4 | #define PATH_ELEM_ARC 1 |
||
5 | #define PATH_ELEM_LINE 2 |
||
6 | |||
7 | #define CLOCKWISE -1 |
||
8 | #define COUNTERCLOCK 1 |
||
9 | |||
10 | typedef struct point { |
||
11 | double x,y; |
||
12 | } POINT; |
||
13 | |||
14 | typedef struct path_elem { |
||
15 | int type; |
||
16 | void *data; |
||
17 | struct path_elem *next; |
||
18 | } PATH_ELEM; |
||
19 | |||
20 | typedef struct pd_arc { |
||
21 | POINT c; |
||
22 | double r; |
||
23 | double alpha1; |
||
24 | double alpha2; |
||
25 | int dir; |
||
26 | } PATH_DATA_ARC; |
||
27 | |||
28 | typedef struct pd_line { |
||
29 | POINT p1; |
||
30 | POINT p2; |
||
31 | double alpha; |
||
32 | int dir; |
||
33 | } PATH_DATA_LINE; |
||
34 | |||
35 | |||
36 | PATH_ELEM *find_closest_elem(POINT *p, double radius); |
||
37 | double get_distance_from_elem(POINT *p, PATH_ELEM *e); |
||
38 | double get_angle_from_elem(POINT *p, PATH_ELEM *e); |
||
39 | /* ritorna: |
||
40 | 1 : curva a sinistra |
||
41 | -1 : curva a destra |
||
42 | |||
43 | */ |
||
44 | int is_curve(PATH_ELEM *e); |
||
45 | |||
46 | void Init_All_Path(); |
||
47 | |||
48 | #endif |