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 128 - (show annotations) (download) (as text)
Tue Feb 24 19:59:52 2009 UTC (16 years, 1 month ago) by amb
File MIME type: text/x-chdr
File size: 2387 byte(s)
Remove segment->next1 since it always points at the next segment or nowhere.

1 /***************************************
2 $Header: /home/amb/CVS/routino/src/segmentsx.h,v 1.2 2009-02-24 19:59:52 amb Exp $
3
4 A header file for the extended segments.
5 ******************/ /******************
6 Written by Andrew M. Bishop
7
8 This file Copyright 2009 Andrew M. Bishop
9 It may be distributed under the GNU Public License, version 2, or
10 any higher version. See section COPYING of the GNU Public license
11 for conditions under which this file may be redistributed.
12 ***************************************/
13
14
15 #ifndef SEGMENTSX_H
16 #define SEGMENTSX_H /*+ To stop multiple inclusions. +*/
17
18 #include <stdint.h>
19
20 #include "types.h"
21 #include "segments.h"
22
23
24 /* Data structures */
25
26
27 /*+ An extended structure used for processing. +*/
28 struct _SegmentX
29 {
30 node_t node1; /*+ The starting node. +*/
31 node_t node2; /*+ The finishing node. +*/
32
33 Segment segment; /*+ The real segment data. +*/
34 };
35
36
37 /*+ A structure containing a set of segments (memory format). +*/
38 struct _SegmentsX
39 {
40 uint32_t sorted; /*+ Is the data sorted and therefore searchable? +*/
41 uint32_t alloced; /*+ How many entries are allocated? +*/
42 uint32_t xnumber; /*+ How many entries are used from those allocated? +*/
43 uint32_t number; /*+ How many entries are still useful? +*/
44
45 SegmentX **sdata; /*+ The extended segment data (sorted by node). +*/
46 SegmentX *xdata; /*+ The extended segment data (unsorted). +*/
47 };
48
49
50 /* Macros */
51
52
53 #define LookupSegmentX(xxx,yyy) (&(xxx)->sdata[yyy])
54
55
56 /* Functions */
57
58
59 SegmentsX *NewSegmentList(void);
60 void FreeSegmentList(SegmentsX *segmentsx);
61
62 void SaveSegmentList(SegmentsX *segmentsx,const char *filename);
63
64 SegmentX **FindFirstSegmentX(SegmentsX* segmentsx,node_t node);
65 SegmentX **FindNextSegmentX(SegmentsX* segmentsx,SegmentX **segmentx);
66
67 Segment *AppendSegment(SegmentsX* segmentsx,node_t node1,node_t node2);
68
69 void SortSegmentList(SegmentsX *segmentsx);
70
71 void RemoveBadSegments(SegmentsX *segmentsx);
72
73 void MeasureSegments(SegmentsX *segmentsx,NodesX *nodesx);
74
75 void RotateSegments(SegmentsX* segmentsx,NodesX *nodesx);
76
77 void DeduplicateSegments(SegmentsX* segmentsx,NodesX *nodesx,WaysX *waysx);
78
79 void IndexSegments(SegmentsX* segmentsx,NodesX *nodesx);
80
81 distance_t DistanceX(NodeX *nodex1,NodeX *nodex2);
82
83
84 #endif /* SEGMENTSX_H */

Properties

Name Value
cvs:description Extended segments header.