Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Annotation of /trunk/src/segmentsx.h
Parent Directory
|
Revision Log
Revision 195 -
(hide annotations)
(download)
(as text)
Sat Jun 13 13:02:12 2009 UTC (15 years, 9 months ago) by amb
File MIME type: text/x-chdr
File size: 2866 byte(s)
Sat Jun 13 13:02:12 2009 UTC (15 years, 9 months ago) by amb
File MIME type: text/x-chdr
File size: 2866 byte(s)
Handle nodes that are missing from the .osm file (ignore the segment).
1 | amb | 110 | /*************************************** |
2 | amb | 195 | $Header: /home/amb/CVS/routino/src/segmentsx.h,v 1.4 2009-06-13 13:02:12 amb Exp $ |
3 | amb | 110 | |
4 | A header file for the extended segments. | ||
5 | amb | 151 | |
6 | Part of the Routino routing software. | ||
7 | amb | 110 | ******************/ /****************** |
8 | amb | 151 | This file Copyright 2008,2009 Andrew M. Bishop |
9 | amb | 110 | |
10 | amb | 151 | This program is free software: you can redistribute it and/or modify |
11 | it under the terms of the GNU Affero General Public License as published by | ||
12 | the Free Software Foundation, either version 3 of the License, or | ||
13 | (at your option) any later version. | ||
14 | |||
15 | This program is distributed in the hope that it will be useful, | ||
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | GNU Affero General Public License for more details. | ||
19 | |||
20 | You should have received a copy of the GNU Affero General Public License | ||
21 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
22 | amb | 110 | ***************************************/ |
23 | |||
24 | |||
25 | #ifndef SEGMENTSX_H | ||
26 | #define SEGMENTSX_H /*+ To stop multiple inclusions. +*/ | ||
27 | |||
28 | #include <stdint.h> | ||
29 | |||
30 | #include "types.h" | ||
31 | #include "segments.h" | ||
32 | |||
33 | |||
34 | /* Data structures */ | ||
35 | |||
36 | |||
37 | /*+ An extended structure used for processing. +*/ | ||
38 | struct _SegmentX | ||
39 | { | ||
40 | node_t node1; /*+ The starting node. +*/ | ||
41 | node_t node2; /*+ The finishing node. +*/ | ||
42 | |||
43 | Segment segment; /*+ The real segment data. +*/ | ||
44 | }; | ||
45 | |||
46 | |||
47 | /*+ A structure containing a set of segments (memory format). +*/ | ||
48 | struct _SegmentsX | ||
49 | { | ||
50 | uint32_t sorted; /*+ Is the data sorted and therefore searchable? +*/ | ||
51 | uint32_t alloced; /*+ How many entries are allocated? +*/ | ||
52 | amb | 128 | uint32_t xnumber; /*+ How many entries are used from those allocated? +*/ |
53 | uint32_t number; /*+ How many entries are still useful? +*/ | ||
54 | amb | 110 | |
55 | SegmentX **sdata; /*+ The extended segment data (sorted by node). +*/ | ||
56 | SegmentX *xdata; /*+ The extended segment data (unsorted). +*/ | ||
57 | }; | ||
58 | |||
59 | |||
60 | /* Macros */ | ||
61 | |||
62 | |||
63 | amb | 128 | #define LookupSegmentX(xxx,yyy) (&(xxx)->sdata[yyy]) |
64 | amb | 110 | |
65 | |||
66 | /* Functions */ | ||
67 | |||
68 | |||
69 | SegmentsX *NewSegmentList(void); | ||
70 | void FreeSegmentList(SegmentsX *segmentsx); | ||
71 | |||
72 | void SaveSegmentList(SegmentsX *segmentsx,const char *filename); | ||
73 | |||
74 | SegmentX **FindFirstSegmentX(SegmentsX* segmentsx,node_t node); | ||
75 | SegmentX **FindNextSegmentX(SegmentsX* segmentsx,SegmentX **segmentx); | ||
76 | |||
77 | Segment *AppendSegment(SegmentsX* segmentsx,node_t node1,node_t node2); | ||
78 | |||
79 | void SortSegmentList(SegmentsX *segmentsx); | ||
80 | |||
81 | amb | 195 | void RemoveBadSegments(NodesX *nodesx,SegmentsX *segmentsx); |
82 | amb | 110 | |
83 | void MeasureSegments(SegmentsX *segmentsx,NodesX *nodesx); | ||
84 | |||
85 | void RotateSegments(SegmentsX* segmentsx,NodesX *nodesx); | ||
86 | |||
87 | void DeduplicateSegments(SegmentsX* segmentsx,NodesX *nodesx,WaysX *waysx); | ||
88 | |||
89 | void IndexSegments(SegmentsX* segmentsx,NodesX *nodesx); | ||
90 | |||
91 | distance_t DistanceX(NodeX *nodex1,NodeX *nodex2); | ||
92 | |||
93 | |||
94 | #endif /* SEGMENTSX_H */ |
Properties
Name | Value |
---|---|
cvs:description | Extended segments header. |