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/nodesx.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 228 - (show annotations) (download) (as text)
Sun Jul 12 09:01:48 2009 UTC (15 years, 8 months ago) by amb
File MIME type: text/x-chdr
File size: 2727 byte(s)
Tidy up and fix comments and include files.

1 /***************************************
2 $Header: /home/amb/CVS/routino/src/nodesx.h,v 1.11 2009-07-12 09:01:48 amb Exp $
3
4 A header file for the extended nodes.
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 NODESX_H
26 #define NODESX_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 _NodeX
39 {
40 node_t id; /*+ The node identifier. +*/
41
42 latlong_t latitude; /*+ The node latitude. +*/
43 latlong_t longitude; /*+ The node longitude. +*/
44
45 uint8_t super; /*+ A marker for super nodes. +*/
46 };
47
48 /*+ A structure containing a set of nodes (memory format). +*/
49 struct _NodesX
50 {
51 uint32_t sorted; /*+ Is the data sorted and therefore searchable? +*/
52
53 int32_t row; /*+ How many rows are allocated? +*/
54 uint32_t col; /*+ How many columns are used in the last row? +*/
55
56 NodeX **xdata; /*+ The extended node data (unsorted). +*/
57
58 uint32_t number; /*+ How many entries are still useful? +*/
59
60 NodeX **gdata; /*+ The extended node data (sorted geographically). +*/
61 NodeX **idata; /*+ The extended node data (sorted by ID). +*/
62
63 Node *ndata; /*+ The actual nodes (same order as idata). +*/
64 };
65
66
67 /* Functions */
68
69 NodesX *NewNodeList(void);
70 void FreeNodeList(NodesX *nodesx);
71
72 void SaveNodeList(NodesX *nodesx,const char *filename);
73
74 NodeX **FindNodeX(NodesX* nodesx,node_t id);
75
76 void AppendNode(NodesX* nodesx,node_t id,double latitude,double longitude);
77
78 void SortNodeList(NodesX *nodesx);
79
80 void SortNodeListGeographically(NodesX* nodesx);
81
82 void RemoveNonHighwayNodes(NodesX *nodesx,SegmentsX *segmentsx);
83
84 void CreateRealNodes(NodesX *nodesx,int iteration);
85
86 void IndexNodes(NodesX *nodesx,SegmentsX *segmentsx);
87
88
89 #endif /* NODESX_H */

Properties

Name Value
cvs:description Extended nodes header.