forked from organicmaps/organicmaps
git-clang-format
This commit is contained in:
parent
4cac8206b3
commit
97a2bab208
8 changed files with 14 additions and 31 deletions
|
@ -232,8 +232,8 @@ bool FeatureBuilder1::IsRoad() const
|
|||
{
|
||||
static routing::PedestrianModel const pedModel;
|
||||
static routing::BicycleModel const bicModel;
|
||||
return routing::CarModel::Instance().HasRoadType(m_params.m_Types) || pedModel.HasRoadType(m_params.m_Types)
|
||||
|| bicModel.HasRoadType(m_params.m_Types);
|
||||
return routing::CarModel::Instance().HasRoadType(m_params.m_Types) ||
|
||||
pedModel.HasRoadType(m_params.m_Types) || bicModel.HasRoadType(m_params.m_Types);
|
||||
}
|
||||
|
||||
bool FeatureBuilder1::PreSerialize()
|
||||
|
|
|
@ -601,17 +601,14 @@ BicycleModel::BicycleModel(VehicleModel::InitListT const & speedLimits)
|
|||
|
||||
void BicycleModel::Init()
|
||||
{
|
||||
initializer_list<char const *> hwtagYesbicycle = { "hwtag", "yesbicycle" };
|
||||
initializer_list<char const *> hwtagYesbicycle = {"hwtag", "yesbicycle"};
|
||||
|
||||
m_yesBicycleType = classif().GetTypeByPath(hwtagYesbicycle);
|
||||
m_noBicycleType = classif().GetTypeByPath({ "hwtag", "nobicycle" });
|
||||
m_bicycleBidirType = classif().GetTypeByPath({ "hwtag", "bicycle_bidir" });
|
||||
m_noBicycleType = classif().GetTypeByPath({"hwtag", "nobicycle"});
|
||||
m_bicycleBidirType = classif().GetTypeByPath({"hwtag", "bicycle_bidir"});
|
||||
|
||||
initializer_list<char const *> arr[] =
|
||||
{
|
||||
hwtagYesbicycle,
|
||||
{ "route", "ferry" },
|
||||
{ "man_made", "pier" },
|
||||
initializer_list<char const *> arr[] = {
|
||||
hwtagYesbicycle, {"route", "ferry"}, {"man_made", "pier"},
|
||||
};
|
||||
|
||||
SetAdditionalRoadTypes(classif(), arr, ARRAY_SIZE(arr));
|
||||
|
|
|
@ -17,11 +17,6 @@ public:
|
|||
/// VehicleModel overrides:
|
||||
double GetSpeed(FeatureType const & f) const override;
|
||||
bool IsOneWay(FeatureType const & f) const override;
|
||||
/// @returns true if |f| could be considered as a road.
|
||||
/// @note If BicycleModel::IsRoad(f) returns false for a feature f and for an instance
|
||||
/// of |BicycleModel| created by default constructor
|
||||
/// BicycleModel::IsRoad(f) for the same feature f and for any instance
|
||||
/// of |BicycleModel| created by |BicycleModel(VehicleModel::InitListT const &)| must return false.
|
||||
bool IsRoad(FeatureType const & f) const override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -241,10 +241,7 @@ void FeaturesRoadGraph::ClearState()
|
|||
m_mwmLocks.clear();
|
||||
}
|
||||
|
||||
bool FeaturesRoadGraph::IsRoad(FeatureType const & ft) const
|
||||
{
|
||||
return m_vehicleModel.IsRoad(ft);
|
||||
}
|
||||
bool FeaturesRoadGraph::IsRoad(FeatureType const & ft) const { return m_vehicleModel.IsRoad(ft); }
|
||||
|
||||
bool FeaturesRoadGraph::IsOneWay(FeatureType const & ft) const
|
||||
{
|
||||
|
|
|
@ -621,16 +621,13 @@ PedestrianModel::PedestrianModel(VehicleModel::InitListT const & speedLimits)
|
|||
|
||||
void PedestrianModel::Init()
|
||||
{
|
||||
initializer_list<char const *> hwtagYesfoot = { "hwtag", "yesfoot" };
|
||||
initializer_list<char const *> hwtagYesfoot = {"hwtag", "yesfoot"};
|
||||
|
||||
m_noFootType = classif().GetTypeByPath({ "hwtag", "nofoot" });
|
||||
m_yesFootType = classif().GetTypeByPath(hwtagYesfoot);
|
||||
|
||||
initializer_list<char const *> arr[] =
|
||||
{
|
||||
hwtagYesfoot,
|
||||
{ "route", "ferry" },
|
||||
{ "man_made", "pier" },
|
||||
initializer_list<char const *> arr[] = {
|
||||
hwtagYesfoot, {"route", "ferry"}, {"man_made", "pier"},
|
||||
};
|
||||
|
||||
SetAdditionalRoadTypes(classif(), arr, ARRAY_SIZE(arr));
|
||||
|
|
|
@ -17,11 +17,6 @@ public:
|
|||
/// VehicleModel overrides:
|
||||
double GetSpeed(FeatureType const & f) const override;
|
||||
bool IsOneWay(FeatureType const &) const override { return false; }
|
||||
/// @returns true if |f| could be considered as a road for pedestrian routing.
|
||||
/// @note If PedestrianModel::IsRoad(f) returns false for a feature f and for an instance
|
||||
/// of |PedestrianModel| created by default constructor
|
||||
/// PedestrianModel::IsRoad(f) for the same feature f and for any instance
|
||||
/// of |PedestrianModel| created by |PedestrianModel(VehicleModel::InitListT const &)| must return false.
|
||||
bool IsRoad(FeatureType const & f) const override;
|
||||
|
||||
private:
|
||||
|
|
|
@ -23,6 +23,7 @@ class TestVehicleModel : public routing::VehicleModel
|
|||
{
|
||||
friend void CheckOneWay(initializer_list<uint32_t> const & types, bool expectedValue);
|
||||
friend void CheckSpeed(initializer_list<uint32_t> const & types, double expectedSpeed);
|
||||
|
||||
public:
|
||||
TestVehicleModel() : VehicleModel(classif(), s_testLimits) {}
|
||||
};
|
||||
|
|
|
@ -68,7 +68,8 @@ public:
|
|||
|
||||
/// @returns true if |m_types| or |m_addRoadTypes| contains |type| and false otherwise.
|
||||
bool IsRoadType(uint32_t type) const;
|
||||
template <class TList> bool HasRoadType(TList const & types) const
|
||||
template <class TList>
|
||||
bool HasRoadType(TList const & types) const
|
||||
{
|
||||
for (uint32_t t : types)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue