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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1565 - (show annotations) (download) (as text)
Sat May 10 10:22:15 2014 UTC (10 years, 10 months ago) by amb
File MIME type: text/x-chdr
File size: 1989 byte(s)
Don't crash if the specified route contains two consecutive coincident
waypoints (route instructions at those points may not be perfect).

1 /***************************************
2 Header file for fake node and segment function prototypes
3
4 Part of the Routino routing software.
5 ******************/ /******************
6 This file Copyright 2008-2014 Andrew M. Bishop
7
8 This program is free software: you can redistribute it and/or modify
9 it under the terms of the GNU Affero General Public License as published by
10 the Free Software Foundation, either version 3 of the License, or
11 (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU Affero General Public License for more details.
17
18 You should have received a copy of the GNU Affero General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
20 ***************************************/
21
22
23 #ifndef FAKES_H
24 #define FAKES_H /*+ To stop multiple inclusions. +*/
25
26 #include "types.h"
27
28
29 /* Macros */
30
31 /*+ Return true if this is a fake node. +*/
32 #define IsFakeNode(xxx) ((xxx)>=NODE_FAKE && (xxx)!=NO_NODE)
33
34 /*+ Return true if this is a fake segment. +*/
35 #define IsFakeSegment(xxx) ((xxx)>=SEGMENT_FAKE && (xxx)!=NO_SEGMENT)
36
37
38 /* Functions in fakes.c */
39
40 index_t CreateFakes(Nodes *nodes,Segments *segments,int point,Segment *segmentp,index_t node1,index_t node2,distance_t dist1,distance_t dist2);
41
42 index_t CreateFakeNullSegment(Segments *segments,index_t node,index_t segment,int point);
43
44 void GetFakeLatLong(index_t fakenode, double *latitude,double *longitude);
45
46 Segment *FirstFakeSegment(index_t fakenode);
47 Segment *NextFakeSegment(Segment *fakesegmentp,index_t fakenode);
48 Segment *ExtraFakeSegment(index_t realnode,index_t fakenode);
49
50 Segment *LookupFakeSegment(index_t index);
51 index_t IndexFakeSegment(Segment *fakesegmentp);
52 index_t IndexRealSegment(index_t fakesegment);
53
54 int IsFakeUTurn(index_t fakesegment1,index_t fakesegment2);
55
56 #endif /* FAKES_H */