Routino SVN Repository Browser

Check out the latest version of Routino: svn co http://routino.org/svn/trunk routino

ViewVC logotype

Contents of /trunk/src/segmentsx.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 243 - (show annotations) (download) (as text)
Wed Aug 19 18:02:08 2009 UTC (15 years, 7 months ago) by amb
File MIME type: text/x-chdr
File size: 2922 byte(s)
Remove "sorted" parameter in data structure and change assert statements.

1 /***************************************
2 $Header: /home/amb/CVS/routino/src/segmentsx.h,v 1.15 2009-08-19 18:02:08 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
33
34 /* Data structures */
35
36
37 /*+ An extended structure used for processing. +*/
38 struct _SegmentX
39 {
40 node_t node1; /*+ The id of the starting node. +*/
41 node_t node2; /*+ The id of the finishing node. +*/
42
43 way_t way; /*+ The id of the way. +*/
44
45 distance_t distance; /*+ The distance between the nodes. +*/
46 };
47
48
49 /*+ A structure containing a set of segments (memory format). +*/
50 struct _SegmentsX
51 {
52 int32_t row; /*+ How many rows are allocated? +*/
53 uint32_t col; /*+ How many columns are used in the last row? +*/
54
55 SegmentX **xdata; /*+ The extended segment data (unsorted). +*/
56
57 uint32_t number; /*+ How many entries are still useful? +*/
58
59 SegmentX **n1data; /*+ The extended segment data (sorted by node1). +*/
60 SegmentX **n2data; /*+ The extended segment data (sorted by node2). +*/
61
62 Segment *sdata; /*+ The segment data (same order as n1data). +*/
63 };
64
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 void AppendSegment(SegmentsX* segmentsx,way_t way,node_t node1,node_t node2,distance_t distance);
78
79 void SortSegmentList(SegmentsX *segmentsx);
80
81 void RemoveBadSegments(NodesX *nodesx,SegmentsX *segmentsx);
82
83 void MeasureSegments(SegmentsX *segmentsx,NodesX *nodesx);
84
85 void DeduplicateSegments(SegmentsX* segmentsx,WaysX *waysx);
86
87 void CreateRealSegments(SegmentsX *segmentsx,WaysX *waysx);
88
89 void IndexSegments(SegmentsX* segmentsx,NodesX *nodesx);
90
91
92 #endif /* SEGMENTSX_H */

Properties

Name Value
cvs:description Extended segments header.