Run clang-format

This commit is contained in:
Patrick Niklaus
2016-01-08 01:31:57 +01:00
parent 6b18e4f7e9
commit 6991a38703
149 changed files with 457 additions and 498 deletions
@@ -63,4 +63,4 @@ inline void CombineSimilarSegments(std::vector<SegmentInformation> &segments)
} // namespace engine
} // namespace osrm
#endif //ENGINE_GUIDANCE_PROCESSING_SEGMENT_COMPRESSION_HPP_
#endif // ENGINE_GUIDANCE_PROCESSING_SEGMENT_COMPRESSION_HPP_
+4 -3
View File
@@ -146,7 +146,8 @@ void SegmentList<DataFacadeT>::AddLeg(const std::vector<PathData> &leg_data,
const extractor::TravelMode travel_mode =
(traversed_in_reverse ? target_node.backward_travel_mode : target_node.forward_travel_mode);
segments.emplace_back(target_node.location, target_node.name_id, segment_duration, 0.f,
is_via_leg ? extractor::TurnInstruction::ReachViaLocation : extractor::TurnInstruction::NoTurn,
is_via_leg ? extractor::TurnInstruction::ReachViaLocation
: extractor::TurnInstruction::NoTurn,
true, true, travel_mode);
}
@@ -220,8 +221,8 @@ void SegmentList<DataFacadeT>::Finalize(const bool extract_alternative,
{
// move down names by one, q&d hack
segments[i - 1].name_id = segments[i].name_id;
segments[i].length = util::coordinate_calculation::greatCircleDistance(segments[i - 1].location,
segments[i].location);
segments[i].length = util::coordinate_calculation::greatCircleDistance(
segments[i - 1].location, segments[i].location);
}
float segment_length = 0.;
@@ -21,13 +21,13 @@ namespace engine
{
namespace guidance
{
template< typename DataFacadeT >
inline util::json::Array
AnnotateRoute(const std::vector<SegmentInformation> &route_segments, DataFacadeT* facade)
template <typename DataFacadeT>
inline util::json::Array AnnotateRoute(const std::vector<SegmentInformation> &route_segments,
DataFacadeT *facade)
{
util::json::Array json_instruction_array;
if( route_segments.empty() )
return json_instruction_array;
if (route_segments.empty())
return json_instruction_array;
// Segment information has following format:
//["instruction id","streetname",length,position,time,"length","earth_direction",azimuth]
std::int32_t necessary_segments_running_index = 0;
@@ -42,7 +42,7 @@ AnnotateRoute(const std::vector<SegmentInformation> &route_segments, DataFacadeT
round_about = {std::numeric_limits<std::int32_t>::max(), 0, 0};
std::string temp_dist, temp_length, temp_duration, temp_bearing, temp_instruction;
//Generate annotations for every segment
// Generate annotations for every segment
for (const SegmentInformation &segment : route_segments)
{
util::json::Array json_instruction_row;
@@ -59,8 +59,8 @@ AnnotateRoute(const std::vector<SegmentInformation> &route_segments, DataFacadeT
std::string current_turn_instruction;
if (extractor::TurnInstruction::LeaveRoundAbout == current_instruction)
{
temp_instruction =
std::to_string(util::cast::enum_to_underlying(extractor::TurnInstruction::EnterRoundAbout));
temp_instruction = std::to_string(util::cast::enum_to_underlying(
extractor::TurnInstruction::EnterRoundAbout));
current_turn_instruction += temp_instruction;
current_turn_instruction += "-";
temp_instruction = std::to_string(round_about.leave_at_exit + 1);
@@ -110,9 +110,9 @@ AnnotateRoute(const std::vector<SegmentInformation> &route_segments, DataFacadeT
}
util::json::Array json_last_instruction_row;
temp_instruction =
std::to_string(util::cast::enum_to_underlying(extractor::TurnInstruction::ReachedYourDestination));
json_last_instruction_row.values.emplace_back( std::move(temp_instruction));
temp_instruction = std::to_string(
util::cast::enum_to_underlying(extractor::TurnInstruction::ReachedYourDestination));
json_last_instruction_row.values.emplace_back(std::move(temp_instruction));
json_last_instruction_row.values.push_back("");
json_last_instruction_row.values.push_back(0);
json_last_instruction_row.values.push_back(necessary_segments_running_index - 1);