mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +00:00
[routing][traffic] Different routing options in navigation and decoder mode
Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
@@ -1091,10 +1091,15 @@ RouterResultCode IndexRouter::AdjustRoute(Checkpoints const & checkpoints, m2::P
|
||||
return RouterResultCode::NoError;
|
||||
}
|
||||
|
||||
RoutingOptions IndexRouter::GetRoutingOptions()
|
||||
{
|
||||
return RoutingOptions::LoadCarOptionsFromSettings();
|
||||
}
|
||||
|
||||
unique_ptr<WorldGraph> IndexRouter::MakeWorldGraph()
|
||||
{
|
||||
// Use saved routing options for all types (car, bicycle, pedestrian).
|
||||
RoutingOptions const routingOptions = RoutingOptions::LoadCarOptionsFromSettings();
|
||||
RoutingOptions const routingOptions = GetRoutingOptions();
|
||||
/// @DebugNote
|
||||
// Add avoid roads here for debug purpose.
|
||||
// routingOptions.Add(RoutingOptions::Road::Motorway);
|
||||
|
||||
@@ -175,6 +175,14 @@ protected:
|
||||
*/
|
||||
virtual Mode GetMode() { return Mode::Navigation; }
|
||||
|
||||
/**
|
||||
* @brief Returns current routing options.
|
||||
*
|
||||
* In this class, the routing options are the one set in the GUI. Subclasses may override this
|
||||
* method to provide different routing options.
|
||||
*/
|
||||
virtual RoutingOptions GetRoutingOptions();
|
||||
|
||||
private:
|
||||
RouterResultCode CalculateSubrouteJointsMode(IndexGraphStarter & starter, RouterDelegate const & delegate,
|
||||
std::shared_ptr<AStarProgress> const & progress,
|
||||
|
||||
@@ -674,6 +674,11 @@ RoutingTraffDecoder::DecoderRouter::DecoderRouter(CountryParentNameGetterFn cons
|
||||
//, m_directionsEngine(CreateDirectionsEngine(m_vehicleType, m_numMwmIds, m_dataSource)) // TODO we don’t need directions, can we disable that?
|
||||
{}
|
||||
|
||||
routing::RoutingOptions RoutingTraffDecoder::DecoderRouter::GetRoutingOptions()
|
||||
{
|
||||
return routing::RoutingOptions();
|
||||
}
|
||||
|
||||
RoutingTraffDecoder::RoutingTraffDecoder(DataSource & dataSource, CountryInfoGetterFn countryInfoGetter,
|
||||
const CountryParentNameGetterFn & countryParentNameGetter,
|
||||
std::map<std::string, TraffMessage> & messageCache)
|
||||
|
||||
@@ -266,6 +266,13 @@ public:
|
||||
*/
|
||||
IndexRouter::Mode GetMode() { return IndexRouter::Mode::Decoding; }
|
||||
|
||||
/**
|
||||
* @brief Returns current routing options.
|
||||
*
|
||||
* For traffic decoding purposes, all roads are allowed.
|
||||
*/
|
||||
routing::RoutingOptions GetRoutingOptions() override;
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user