root / trunk / code / projects / traffic_navigation / intersectData.h @ 1903
History | View | Annotate | Download (1.82 KB)
1 |
#ifndef _INTERSECTION_DATABASE_
|
---|---|
2 |
#define _INTERSECTION_DATABASE_
|
3 |
#define NUM_INTERSECTIONS 1 |
4 |
|
5 |
/****************************
|
6 |
* Intersection Information: 5-bit Integer
|
7 |
* 3 bits of intersection type
|
8 |
* 2 bits of entry information
|
9 |
*
|
10 |
* Also contains a "feature id": 4 bits in positions 13,14,15,16
|
11 |
*
|
12 |
****************************/
|
13 |
|
14 |
/********************************
|
15 |
* Intersection TYPES:
|
16 |
*
|
17 |
********************************/
|
18 |
|
19 |
|
20 |
#define INTERSECTION_SINGLE (0 << 2) |
21 |
#define INTERSECTION_ON_RAMP (1 << 2) |
22 |
#define INTERSECTION_OFF_RAMP (2 << 2) |
23 |
#define INTERSECTION_DOUBLE_C (3 << 2) |
24 |
#define INTERSECTION_DOUBLE_T (4 << 2) |
25 |
|
26 |
/********************************
|
27 |
* Turn TYPES:
|
28 |
*
|
29 |
********************************/
|
30 |
|
31 |
#define ISTRAIGHT 0 |
32 |
#define ILEFT 1 |
33 |
#define IRIGHT 2 |
34 |
#define IUTURN 3 |
35 |
|
36 |
|
37 |
/********************************
|
38 |
* Intersection ENTRYPOINTS:
|
39 |
*
|
40 |
********************************/
|
41 |
|
42 |
//DOUBLE intersection (Cross Intersection) positions
|
43 |
//use T-Junction positions
|
44 |
|
45 |
//DOUBLE intersection (T-Junction) positions
|
46 |
/*
|
47 |
TLEFT=======TRIGHT
|
48 |
||
|
49 |
||
|
50 |
||
|
51 |
TMIDDLE
|
52 |
*/
|
53 |
#define TLEFT 0 |
54 |
#define TRIGHT 1 |
55 |
#define TMIDDLE 2 |
56 |
|
57 |
//SINGLE intersection positions
|
58 |
/*
|
59 |
/\
|
60 |
/||\
|
61 |
||
|
62 |
SACROSS==========>
|
63 |
||
|
64 |
||
|
65 |
||
|
66 |
SUP
|
67 |
*/
|
68 |
#define SACROSS 0 |
69 |
#define SUP 1 |
70 |
|
71 |
|
72 |
//ON_RAMP and OFF_RAMP intersection positions
|
73 |
/*
|
74 |
R_LEFT================R_RIGHT
|
75 |
||
|
76 |
||
|
77 |
||
|
78 |
R_RAMP
|
79 |
*/
|
80 |
#define R_LEFT 0 |
81 |
#define R_RIGHT 1 |
82 |
#define R_RAMP 2 |
83 |
|
84 |
// Global variable for the intersection database. You can change the size here. Size == number of intersections.
|
85 |
int IntersectData[NUM_INTERSECTIONS];
|
86 |
|
87 |
void initializeData();
|
88 |
void insertIntersection(int key, int featureid, int intersect_type, int intersect_position); |
89 |
|
90 |
// Functions to get data from the Database:
|
91 |
int getIntersectType(int entry); |
92 |
int getIntersectPos(int entry); |
93 |
int getFeatureId(int entry); |
94 |
|
95 |
#endif
|