mirror of
https://codeberg.org/comaps/comaps
synced 2026-01-03 19:33:49 +00:00
[traffxml] Add router-based decoder, still crude, ugly and buggy
To use it, redefine DefaultTraffDecoder in traffxml/traff_decoder.hpp Signed-off-by: mvglasow <michael -at- vonglasow.com>
This commit is contained in:
@@ -65,6 +65,23 @@ public:
|
||||
m2::PointD const m_direction;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Creates a new `IndexRouter` instance.
|
||||
*
|
||||
* This is the constructor intended for normal routing. It requires a `TrafficCache` argument,
|
||||
* from which it may create a traffic stash so the traffic situation can be considered for the
|
||||
* route, depending on the vehicle type.
|
||||
*
|
||||
* @param vehicleType The vehichle type
|
||||
* @param loadAltitudes Whether to load altitudes
|
||||
* @param countryParentNameGetterFn Function which converts a country name into the name of its parent country)
|
||||
* @param countryFileFn Function which converts a pointer to its country name
|
||||
* @param countryRectFn Function which returns the rect for a country
|
||||
* @param numMwmIds
|
||||
* @param numMwmTree
|
||||
* @param trafficCache The traffic cache (used only if `vehicleType` is `VehicleType::Car`)
|
||||
* @param dataSource The MWM data source
|
||||
*/
|
||||
IndexRouter(VehicleType vehicleType, bool loadAltitudes,
|
||||
CountryParentNameGetterFn const & countryParentNameGetterFn,
|
||||
TCountryFileFn const & countryFileFn, CountryRectFn const & countryRectFn,
|
||||
@@ -89,6 +106,29 @@ public:
|
||||
|
||||
VehicleType GetVehicleType() const { return m_vehicleType; }
|
||||
|
||||
protected:
|
||||
/**
|
||||
* @brief Creates a new `IndexRouter` instance.
|
||||
*
|
||||
* This constructor is intended for use by the TraFF decoder, not for normal routing. It lacks the
|
||||
* `TrafficCache` argument and never creates a traffic stash. This creates a router instance which
|
||||
* ignores the traffic situation, regardless of the vehicle type.
|
||||
*
|
||||
* @param vehicleType The vehichle type
|
||||
* @param loadAltitudes Whether to load altitudes
|
||||
* @param countryParentNameGetterFn Function which converts a country name into the name of its parent country)
|
||||
* @param countryFileFn Function which converts a pointer to its country name
|
||||
* @param countryRectFn Function which returns the rect for a country
|
||||
* @param numMwmIds
|
||||
* @param numMwmTree
|
||||
* @param dataSource The MWM data source
|
||||
*/
|
||||
IndexRouter(VehicleType vehicleType, bool loadAltitudes,
|
||||
CountryParentNameGetterFn const & countryParentNameGetterFn,
|
||||
TCountryFileFn const & countryFileFn, CountryRectFn const & countryRectFn,
|
||||
std::shared_ptr<NumMwmIds> numMwmIds, std::unique_ptr<m4::Tree<NumMwmId>> numMwmTree,
|
||||
DataSource & dataSource);
|
||||
|
||||
private:
|
||||
RouterResultCode CalculateSubrouteJointsMode(IndexGraphStarter & starter,
|
||||
RouterDelegate const & delegate,
|
||||
|
||||
Reference in New Issue
Block a user