Project

General

Profile

Revision 1958

Added more functionality to database for mapping things.

View differences:

intersectData.h
1 1
#ifndef _NODE_DATABASE_
2 2
#define _NODE_DATABASE_
3 3

  
4
#define NUM_FEATURES 5
4
#define NUM_FEATURES 8
5 5

  
6 6

  
7 7
/****************************
8 8
 * Node Information: 5-bit Integer
9 9
 * 	3 bits of node type
10 10
 * 	2 bits of entry information
11
 * 	
12
 * Intersection Number stored in bits 6-12.
11 13
 *
12 14
 * Also contains a "feature id": 4 bits in positions 13,14,15,16
13 15
 * 
......
19 21
 *
20 22
 ********************************/
21 23
#define INTERSECTION_NODE	0
22
#define ROAD_NODE		1
24
#define ROAD_NODE			1
25
#define MAPPING_MARKER		NUM_FEATURES
26
//Used when mapping to signify return to previously visited intersection while driving on the wrong side of the road.
23 27
 
24 28
 /********************************
25 29
 *  Node TYPES:
......
30 34
 *  OFF_RAMP    2
31 35
 *  DOUBLE_C    3
32 36
 *  DOUBLE_T    4
33
 *
37
 *  ROAD		5
38
 * 
34 39
 ********************************/
35 40
 
36 41
 /********************************
37
 *  More Node TYPES:
38
 *
39
 ********************************/
40
#define ROAD	    5 
41
	/*placeholder for all roads atm, until we come up with a better solution */
42

  
43
 /********************************
44 42
 *  Turn TYPES:
45 43
 *  
46
 *  ISTRAIGHT		0
44
 *  ISTRAIGHT	0
47 45
 *  ILEFT		1
48 46
 *  IRIGHT		2
49 47
 *  IUTURN		3
......
64 62
 ********************************/
65 63

  
66 64
//DOUBLE_C intersection (Cross Intersection) positions
67
//use T-Junction positions
65
/*
66
	CTOP
67
	||
68
	||
69
	||
70
CLEFT=======CRIGHT
71
	||
72
	||
73
	||
74
	CBOT
75
*/
76
#define CTOP 0
77
#define CRIGHT 1
78
#define CBOT 2
79
#define CLEFT 3
68 80

  
69 81
//DOUBLE_T intersection (T-Junction) positions
70 82
/*
......
109 121
int NodeData[NUM_FEATURES];
110 122

  
111 123
void initializeData();
112
void insertNode(int key, int featureid, int node_type, int node_info);
113
void insertIntersection(int key, int intserction_type, int intersection_position);
114
void insertRoad(int key, int node_type, int road_type);
115 124

  
116 125
// Functions to get data from the Database:
117
int getFeatureId(int key);
118
int getIntersectType(int key);
119
int getIntersectPos(int key);
120
int getRoadType(int key);
121
int getRoadInfo(int key);
126
int getFeatureId(int key); //Returns value in Feature TYPES (see above)
127
int getIntersectType(int key); //Returns value in Node TYPE (values 0-4) (see above)
128
int getIntersectPos(int key); //Returns value in Intersect ENTRYPOINTS (see above)
129
int getRoadType(int key);  //Returns value in Node TYPE (values 5) (see above) 
130
int getRoadInfo(int key);  //Returns value in Road TYPES (see above) 
131
int getIntersectNum(int key); //Returns number of intersection
122 132

  
123 133
#endif

Also available in: Unified diff