blob: e2c59a22bdb092da24cbb6ed8c09c41d1957dc2d (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#pragma once
#include "routing/road_graph.hpp"
#include "routing/road_point.hpp"
#include "routing/route.hpp"
#include "traffic/traffic_info.hpp"
#include "base/cancellable.hpp"
#include "std/vector.hpp"
namespace routing
{
class IDirectionsEngine
{
public:
virtual ~IDirectionsEngine() = default;
virtual void Generate(IRoadGraph const & graph, vector<Junction> const & path,
Route::TTimes & times, Route::TTurns & turns,
vector<Junction> & routeGeometry,
vector<traffic::TrafficInfo::RoadSegmentId> & trafficSegs,
my::Cancellable const & cancellable) = 0;
protected:
/// \brief constructs route based on |graph| and |path|. Fills |routeEdges| with the route.
/// \returns false in case of any errors while reconstruction, if reconstruction process
/// was cancelled and in case of extremely short paths of 0 or 1 point. Returns true otherwise.
bool ReconstructPath(IRoadGraph const & graph, vector<Junction> const & path,
vector<Edge> & routeEdges, my::Cancellable const & cancellable) const;
void CalculateTimes(IRoadGraph const & graph, vector<Junction> const & path,
Route::TTimes & times) const;
};
} // namespace routing
|