Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino
Contents of /trunk/src/segmentsx.h
Parent Directory
|
Revision Log
Revision 203 -
(show annotations)
(download)
(as text)
Thu Jun 25 17:46:46 2009 UTC (15 years, 8 months ago) by amb
File MIME type: text/x-chdr
File size: 2989 byte(s)
Thu Jun 25 17:46:46 2009 UTC (15 years, 8 months ago) by amb
File MIME type: text/x-chdr
File size: 2989 byte(s)
Reduce the number of ways in the output by compacting them (sharing the same information between identical ways).
1 | /*************************************** |
2 | $Header: /home/amb/CVS/routino/src/segmentsx.h,v 1.6 2009-06-25 17:46:45 amb Exp $ |
3 | |
4 | A header file for the extended segments. |
5 | |
6 | Part of the Routino routing software. |
7 | ******************/ /****************** |
8 | This file Copyright 2008,2009 Andrew M. Bishop |
9 | |
10 | 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 | ***************************************/ |
23 | |
24 | |
25 | #ifndef SEGMENTSX_H |
26 | #define SEGMENTSX_H /*+ To stop multiple inclusions. +*/ |
27 | |
28 | #include <stdint.h> |
29 | |
30 | #include "typesx.h" |
31 | #include "types.h" |
32 | #include "segments.h" |
33 | |
34 | |
35 | /* Data structures */ |
36 | |
37 | |
38 | /*+ An extended structure used for processing. +*/ |
39 | struct _SegmentX |
40 | { |
41 | node_t node1; /*+ The id of the starting node. +*/ |
42 | node_t node2; /*+ The id of the finishing node. +*/ |
43 | |
44 | way_t way; /*+ The id of the way. +*/ |
45 | |
46 | Segment segment; /*+ The real segment data. +*/ |
47 | }; |
48 | |
49 | |
50 | /*+ A structure containing a set of segments (memory format). +*/ |
51 | struct _SegmentsX |
52 | { |
53 | uint32_t sorted; /*+ Is the data sorted and therefore searchable? +*/ |
54 | uint32_t alloced; /*+ How many entries are allocated? +*/ |
55 | uint32_t xnumber; /*+ How many entries are used from those allocated? +*/ |
56 | uint32_t number; /*+ How many entries are still useful? +*/ |
57 | |
58 | SegmentX **sdata; /*+ The extended segment data (sorted by node). +*/ |
59 | SegmentX *xdata; /*+ The extended segment data (unsorted). +*/ |
60 | }; |
61 | |
62 | |
63 | /* Macros */ |
64 | |
65 | |
66 | #define LookupSegmentX(xxx,yyy) (&(xxx)->sdata[yyy]) |
67 | |
68 | |
69 | /* Functions */ |
70 | |
71 | |
72 | SegmentsX *NewSegmentList(void); |
73 | void FreeSegmentList(SegmentsX *segmentsx); |
74 | |
75 | void SaveSegmentList(SegmentsX *segmentsx,const char *filename); |
76 | |
77 | SegmentX **FindFirstSegmentX(SegmentsX* segmentsx,node_t node); |
78 | SegmentX **FindNextSegmentX(SegmentsX* segmentsx,SegmentX **segmentx); |
79 | |
80 | Segment *AppendSegment(SegmentsX* segmentsx,way_t way,node_t node1,node_t node2); |
81 | |
82 | void SortSegmentList(SegmentsX *segmentsx); |
83 | |
84 | void RemoveBadSegments(NodesX *nodesx,SegmentsX *segmentsx,WaysX *waysx); |
85 | |
86 | void MeasureSegments(SegmentsX *segmentsx,NodesX *nodesx); |
87 | |
88 | void RotateSegments(SegmentsX* segmentsx,NodesX *nodesx); |
89 | |
90 | void DeduplicateSegments(SegmentsX* segmentsx,NodesX *nodesx,WaysX *waysx); |
91 | |
92 | void IndexSegments(SegmentsX* segmentsx,NodesX *nodesx); |
93 | |
94 | distance_t DistanceX(NodeX *nodex1,NodeX *nodex2); |
95 | |
96 | |
97 | #endif /* SEGMENTSX_H */ |
Properties
Name | Value |
---|---|
cvs:description | Extended segments header. |