2015-01-23 07:53:02 -05:00
|
|
|
#ifndef SEGMENT_INFORMATION_HPP
|
|
|
|
#define SEGMENT_INFORMATION_HPP
|
2011-11-24 11:47:05 -05:00
|
|
|
|
2016-01-02 11:13:44 -05:00
|
|
|
#include "extractor/turn_instructions.hpp"
|
2013-06-26 19:48:22 -04:00
|
|
|
|
2016-01-02 11:13:44 -05:00
|
|
|
#include "extractor/travel_mode.hpp"
|
|
|
|
#include "util/typedefs.hpp"
|
2012-12-17 07:14:43 -05:00
|
|
|
|
2016-01-02 11:13:44 -05:00
|
|
|
#include "osrm/coordinate.hpp"
|
2015-08-18 06:56:34 -04:00
|
|
|
#include <utility>
|
2013-12-17 11:59:44 -05:00
|
|
|
|
2013-12-08 12:33:53 -05:00
|
|
|
// Struct fits everything in one cache line
|
2014-05-07 12:39:16 -04:00
|
|
|
struct SegmentInformation
|
|
|
|
{
|
2013-08-14 07:12:28 -04:00
|
|
|
FixedPointCoordinate location;
|
2013-12-08 12:33:53 -05:00
|
|
|
NodeID name_id;
|
2014-06-03 05:28:39 -04:00
|
|
|
EdgeWeight duration;
|
2014-05-26 09:30:06 -04:00
|
|
|
float length;
|
2015-11-19 12:25:33 -05:00
|
|
|
short pre_turn_bearing; // more than enough [0..3600] fits into 12 bits
|
|
|
|
short post_turn_bearing;
|
2013-12-08 12:33:53 -05:00
|
|
|
TurnInstruction turn_instruction;
|
2015-01-23 08:24:02 -05:00
|
|
|
TravelMode travel_mode;
|
|
|
|
bool necessary;
|
|
|
|
bool is_via_location;
|
2014-08-18 10:27:51 -04:00
|
|
|
|
2015-08-18 06:56:34 -04:00
|
|
|
explicit SegmentInformation(FixedPointCoordinate location,
|
2014-05-07 12:39:16 -04:00
|
|
|
const NodeID name_id,
|
2014-06-03 05:28:39 -04:00
|
|
|
const EdgeWeight duration,
|
2014-05-26 09:30:06 -04:00
|
|
|
const float length,
|
2014-05-07 12:39:16 -04:00
|
|
|
const TurnInstruction turn_instruction,
|
2014-05-26 09:30:06 -04:00
|
|
|
const bool necessary,
|
2014-08-09 09:13:04 -04:00
|
|
|
const bool is_via_location,
|
|
|
|
const TravelMode travel_mode)
|
2015-08-18 06:56:34 -04:00
|
|
|
: location(std::move(location)), name_id(name_id), duration(duration), length(length),
|
2016-01-05 06:04:04 -05:00
|
|
|
pre_turn_bearing(0), post_turn_bearing(0), turn_instruction(turn_instruction),
|
|
|
|
travel_mode(travel_mode), necessary(necessary), is_via_location(is_via_location)
|
2014-05-07 12:39:16 -04:00
|
|
|
{
|
|
|
|
}
|
2013-12-08 12:33:53 -05:00
|
|
|
|
2015-08-18 06:56:34 -04:00
|
|
|
explicit SegmentInformation(FixedPointCoordinate location,
|
2014-05-07 12:39:16 -04:00
|
|
|
const NodeID name_id,
|
2014-06-03 05:28:39 -04:00
|
|
|
const EdgeWeight duration,
|
2014-05-26 09:30:06 -04:00
|
|
|
const float length,
|
2014-08-09 09:13:04 -04:00
|
|
|
const TurnInstruction turn_instruction,
|
|
|
|
const TravelMode travel_mode)
|
2015-08-18 06:56:34 -04:00
|
|
|
: location(std::move(location)), name_id(name_id), duration(duration), length(length),
|
2016-01-05 06:04:04 -05:00
|
|
|
pre_turn_bearing(0), post_turn_bearing(0), turn_instruction(turn_instruction),
|
|
|
|
travel_mode(travel_mode), necessary(turn_instruction != TurnInstruction::NoTurn),
|
|
|
|
is_via_location(false)
|
2014-05-07 12:39:16 -04:00
|
|
|
{
|
|
|
|
}
|
2011-11-24 11:47:05 -05:00
|
|
|
};
|
|
|
|
|
2015-01-23 07:53:02 -05:00
|
|
|
#endif /* SEGMENT_INFORMATION_HPP */
|