2011-07-07 13:03:32 -04:00
|
|
|
/*
|
2013-10-14 07:42:28 -04:00
|
|
|
|
2014-11-28 06:13:18 -05:00
|
|
|
Copyright (c) 2014, Project OSRM, Dennis Luxen, others
|
2013-10-14 07:42:28 -04:00
|
|
|
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.
|
|
|
|
|
|
|
|
*/
|
2011-07-07 13:03:32 -04:00
|
|
|
|
2014-11-28 06:13:18 -05:00
|
|
|
#ifndef RAW_ROUTE_DATA_HPP
|
|
|
|
#define RAW_ROUTE_DATA_HPP
|
2011-07-07 13:03:32 -04:00
|
|
|
|
2014-11-28 06:13:18 -05:00
|
|
|
#include "../data_structures/phantom_node.hpp"
|
|
|
|
#include "../data_structures/travel_mode.hpp"
|
|
|
|
#include "../data_structures/turn_instructions.hpp"
|
2012-08-27 11:40:59 -04:00
|
|
|
#include "../typedefs.h"
|
|
|
|
|
2014-11-24 11:57:01 -05:00
|
|
|
#include <osrm/coordinate.hpp>
|
2013-12-17 11:59:44 -05:00
|
|
|
|
2013-08-14 07:41:23 -04:00
|
|
|
#include <vector>
|
|
|
|
|
2014-05-07 12:39:16 -04:00
|
|
|
struct PathData
|
|
|
|
{
|
|
|
|
PathData()
|
2014-05-27 10:54:10 -04:00
|
|
|
: node(SPECIAL_NODEID), name_id(INVALID_EDGE_WEIGHT),
|
|
|
|
segment_duration(INVALID_EDGE_WEIGHT),
|
2014-08-09 09:13:04 -04:00
|
|
|
turn_instruction(TurnInstruction::NoTurn),
|
2014-08-18 09:11:24 -04:00
|
|
|
travel_mode(TRAVEL_MODE_INACCESSIBLE)
|
2014-05-07 12:39:16 -04:00
|
|
|
{
|
|
|
|
}
|
2013-12-12 18:35:23 -05:00
|
|
|
|
2014-08-09 09:13:04 -04:00
|
|
|
PathData(NodeID node,
|
|
|
|
unsigned name_id,
|
|
|
|
TurnInstruction turn_instruction,
|
|
|
|
EdgeWeight segment_duration,
|
|
|
|
TravelMode travel_mode)
|
|
|
|
: node(node), name_id(name_id), segment_duration(segment_duration), turn_instruction(turn_instruction),
|
|
|
|
travel_mode(travel_mode)
|
2014-05-07 12:39:16 -04:00
|
|
|
{
|
|
|
|
}
|
2012-08-27 11:40:59 -04:00
|
|
|
NodeID node;
|
2013-12-08 12:33:53 -05:00
|
|
|
unsigned name_id;
|
2014-05-28 12:20:29 -04:00
|
|
|
EdgeWeight segment_duration;
|
2014-05-08 10:39:38 -04:00
|
|
|
TurnInstruction turn_instruction;
|
2014-08-11 08:07:00 -04:00
|
|
|
TravelMode travel_mode : 4;
|
2012-08-27 11:40:59 -04:00
|
|
|
};
|
|
|
|
|
2014-05-07 12:39:16 -04:00
|
|
|
struct RawRouteData
|
|
|
|
{
|
|
|
|
std::vector<std::vector<PathData>> unpacked_path_segments;
|
|
|
|
std::vector<PathData> unpacked_alternative;
|
|
|
|
std::vector<PhantomNodes> segment_end_coordinates;
|
2014-05-27 10:54:10 -04:00
|
|
|
std::vector<bool> source_traversed_in_reverse;
|
|
|
|
std::vector<bool> target_traversed_in_reverse;
|
|
|
|
std::vector<bool> alt_source_traversed_in_reverse;
|
|
|
|
std::vector<bool> alt_target_traversed_in_reverse;
|
2014-05-07 12:39:16 -04:00
|
|
|
int shortest_path_length;
|
|
|
|
int alternative_path_length;
|
2014-03-28 12:13:00 -04:00
|
|
|
|
2014-08-11 14:29:15 -04:00
|
|
|
bool is_via_leg(const std::size_t leg) const
|
|
|
|
{
|
|
|
|
return (leg != unpacked_path_segments.size() - 1);
|
|
|
|
}
|
|
|
|
|
2014-10-22 13:02:19 -04:00
|
|
|
RawRouteData() :
|
2014-05-27 10:54:10 -04:00
|
|
|
shortest_path_length(INVALID_EDGE_WEIGHT),
|
|
|
|
alternative_path_length(INVALID_EDGE_WEIGHT)
|
2014-05-07 12:39:16 -04:00
|
|
|
{
|
|
|
|
}
|
2011-07-07 13:03:32 -04:00
|
|
|
};
|
|
|
|
|
2014-11-28 06:13:18 -05:00
|
|
|
#endif // RAW_ROUTE_DATA_HPP
|