Project

General

Profile

Statistics
| Revision:

root / trunk / code / projects / traffic_navigation / intersectData.h @ 1911

History | View | Annotate | Download (2.42 KB)

1
#ifndef _INTERSECTION_DATABASE_
2
#define _INTERSECTION_DATABASE_
3
#define NUM_FEATURES 5
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
 /********************************
16
 *  Feature TYPES:
17
 *
18
 ********************************/
19
#define INTERSECTION_NODE        (0 << 12)
20
#define ROAD_NODE                (1 << 12)
21
 
22
 /********************************
23
 *  Intersection TYPES:
24
 *
25
 ********************************/
26

    
27

    
28
/* Old definitions, delete when possible
29
#define INTERSECTION_SINGLE         (0 << 2)
30
#define INTERSECTION_ON_RAMP         (1 << 2)
31
#define INTERSECTION_OFF_RAMP         (2 << 2)
32
#define INTERSECTION_DOUBLE_C        (3 << 2)
33
#define INTERSECTION_DOUBLE_T        (4 << 2)
34
#define ROAD                        (5 << 2) /placeholder for all roads atm, until we come up with a better solution */
35
#define SINGLE      0
36
#define ON_RAMP     1
37
#define OFF_RAMP    2
38
#define DOUBLE_C    3
39
#define DOUBLE_T    4
40

    
41
 /********************************
42
 *  Turn TYPES:
43
 *
44
 ********************************/
45

    
46
#define ISTRAIGHT        0
47
#define ILEFT                1
48
#define IRIGHT                2
49
#define IUTURN                3
50

    
51
 /********************************
52
 *  Road TYPES:
53
 *
54
 ********************************/
55
#define ROAD_DOUBLE        0
56
#define ROAD_SINGLE        1
57
#define HIGHWAY                2
58

    
59
/********************************
60
 *  Intersection ENTRYPOINTS:
61
 *
62
 ********************************/
63

    
64
//DOUBLE intersection (Cross Intersection) positions
65
//use T-Junction positions
66

    
67
//DOUBLE intersection (T-Junction) positions
68
/*
69
TLEFT=======TRIGHT
70
        ||
71
        ||
72
        ||
73
        TMIDDLE
74
*/
75
#define TLEFT                0                        
76
#define TRIGHT                1                        
77
#define TMIDDLE                2
78

    
79
//SINGLE intersection positions
80
/*
81
           /\
82
          /||\
83
           ||
84
SACROSS==========>
85
           ||
86
           ||
87
           ||
88
           SUP
89
*/
90
#define SACROSS                0
91
#define SUP                1
92

    
93

    
94
//ON_RAMP and OFF_RAMP intersection positions
95
/*
96
R_LEFT================R_RIGHT
97
            ||        
98
            ||
99
            ||
100
          R_RAMP
101
*/
102
#define R_LEFT                0
103
#define R_RIGHT                1
104
#define R_RAMP                2
105

    
106
// Global variable for the intersection database. You can change the size here. Size == number of intersections.
107
int IntersectData[NUM_FEATURES];
108

    
109
void initializeData();
110
void insertNode(int key, int featureid, int node_type, int node_info);
111

    
112
// Functions to get data from the Database:
113
int getIntersectType(int key);
114
int getTurningIntersect(int key);
115
int getIntersectPos(int key);
116
int getFeatureId(int key);
117
int getRoadType(int key);
118
int getRoadInfo(int key);
119

    
120
#endif