implement ExtractionWay and -Node
This commit is contained in:
parent
d071e92a1c
commit
2f6f883f7f
42
Extractor/ExtractionNode.h
Normal file
42
Extractor/ExtractionNode.h
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/*
|
||||||
|
|
||||||
|
Copyright (c) 2013, Project OSRM, Dennis Luxen, others
|
||||||
|
All rights reserved.
|
||||||
|
|
||||||
|
Redistribution and use in source and binary forms, with or without modification,
|
||||||
|
are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
Redistributions of source code must retain the above copyright notice, this list
|
||||||
|
of conditions and the following disclaimer.
|
||||||
|
Redistributions in binary form must reproduce the above copyright notice, this
|
||||||
|
list of conditions and the following disclaimer in the documentation and/or
|
||||||
|
other materials provided with the distribution.
|
||||||
|
|
||||||
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||||
|
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||||
|
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||||
|
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||||
|
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||||
|
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||||
|
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||||
|
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef EXTRACTION_NODE_H__
|
||||||
|
#define EXTRACTION_NODE_H__
|
||||||
|
|
||||||
|
struct ExtractionNode
|
||||||
|
{
|
||||||
|
ExtractionNode() : traffic_lights(false), barrier(false) { }
|
||||||
|
void Clear()
|
||||||
|
{
|
||||||
|
traffic_lights = barrier = false;
|
||||||
|
}
|
||||||
|
bool traffic_lights;
|
||||||
|
bool barrier;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
@ -41,19 +41,13 @@ struct ExtractionWay
|
|||||||
|
|
||||||
inline void Clear()
|
inline void Clear()
|
||||||
{
|
{
|
||||||
id = SPECIAL_NODEID;
|
|
||||||
nameID = INVALID_NAMEID;
|
|
||||||
path.clear();
|
|
||||||
keyVals.Clear();
|
|
||||||
forward_speed = -1;
|
forward_speed = -1;
|
||||||
backward_speed = -1;
|
backward_speed = -1;
|
||||||
duration = -1;
|
duration = -1;
|
||||||
access = true;
|
|
||||||
roundabout = false;
|
roundabout = false;
|
||||||
isAccessRestricted = false;
|
is_access_restricted = false;
|
||||||
ignoreInGrid = false;
|
ignore_in_grid = false;
|
||||||
forward_travel_mode = TRAVEL_MODE_DEFAULT;
|
name.clear();
|
||||||
backward_travel_mode = TRAVEL_MODE_DEFAULT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
enum Directions
|
enum Directions
|
||||||
@ -61,9 +55,9 @@ struct ExtractionWay
|
|||||||
oneway,
|
oneway,
|
||||||
bidirectional,
|
bidirectional,
|
||||||
opposite };
|
opposite };
|
||||||
|
|
||||||
// These accessor methods exists to support the depreciated "way.direction" access
|
// These accessor methods exists to support the depreciated "way.direction" access
|
||||||
// in LUA. Since the direction attribute was removed from ExtractionWay, the
|
// in LUA. Since the direction attribute was removed from ExtractionWay, the
|
||||||
// accessors translate to/from the mode attributes.
|
// accessors translate to/from the mode attributes.
|
||||||
inline void set_direction(const Directions m)
|
inline void set_direction(const Directions m)
|
||||||
{
|
{
|
||||||
@ -111,18 +105,13 @@ struct ExtractionWay
|
|||||||
inline void set_backward_mode(const TravelMode m) { backward_travel_mode = m; }
|
inline void set_backward_mode(const TravelMode m) { backward_travel_mode = m; }
|
||||||
inline const TravelMode get_backward_mode() const { return backward_travel_mode; }
|
inline const TravelMode get_backward_mode() const { return backward_travel_mode; }
|
||||||
|
|
||||||
unsigned id;
|
|
||||||
unsigned nameID;
|
|
||||||
double forward_speed;
|
double forward_speed;
|
||||||
double backward_speed;
|
double backward_speed;
|
||||||
double duration;
|
double duration;
|
||||||
std::string name;
|
std::string name;
|
||||||
bool access;
|
|
||||||
bool roundabout;
|
bool roundabout;
|
||||||
bool isAccessRestricted;
|
bool is_access_restricted;
|
||||||
bool ignoreInGrid;
|
bool ignore_in_grid;
|
||||||
std::vector<NodeID> path;
|
|
||||||
HashTable<std::string, std::string> keyVals;
|
|
||||||
TravelMode forward_travel_mode : 4;
|
TravelMode forward_travel_mode : 4;
|
||||||
TravelMode backward_travel_mode : 4;
|
TravelMode backward_travel_mode : 4;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user