mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-20 05:13:58 +00:00
Format all C++ and Java code via clang-format
Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
@@ -7,9 +7,9 @@
|
||||
|
||||
#include "geometry/mercator.hpp"
|
||||
|
||||
#include "platform/distance.hpp"
|
||||
#include "platform/localization.hpp"
|
||||
#include "platform/measurement_utils.hpp"
|
||||
#include "platform/distance.hpp"
|
||||
|
||||
#include "base/logging.hpp"
|
||||
#include "base/string_utils.hpp"
|
||||
@@ -25,10 +25,7 @@ void MapObject::SetFromFeatureType(FeatureType & ft)
|
||||
|
||||
Classificator const & cl = classif();
|
||||
m_types = feature::TypesHolder(ft);
|
||||
m_types.RemoveIf([&cl](uint32_t t)
|
||||
{
|
||||
return !cl.IsTypeValid(t);
|
||||
});
|
||||
m_types.RemoveIf([&cl](uint32_t t) { return !cl.IsTypeValid(t); });
|
||||
// Actually, we can't select object on map with invalid (non-drawable or deprecated) type.
|
||||
// TODO: in android prod a user will see an "empty" PP if a spot is selected in old mwm
|
||||
// where a deprecated feature was; and could crash if play with routing to it, bookmarking it..
|
||||
@@ -49,7 +46,7 @@ void MapObject::SetFromFeatureType(FeatureType & ft)
|
||||
assign_range(m_triangles, ft.GetTrianglesAsPoints(FeatureType::BEST_GEOMETRY));
|
||||
else if (m_geomType == feature::GeomType::Line)
|
||||
assign_range(m_points, ft.GetPoints(FeatureType::BEST_GEOMETRY));
|
||||
|
||||
|
||||
// Fill runtime metadata
|
||||
m_metadata.Set(feature::Metadata::EType::FMD_WHEELCHAIR, feature::GetReadableWheelchairType(m_types));
|
||||
|
||||
@@ -59,12 +56,30 @@ void MapObject::SetFromFeatureType(FeatureType & ft)
|
||||
#endif
|
||||
}
|
||||
|
||||
FeatureID const & MapObject::GetID() const { return m_featureID; }
|
||||
ms::LatLon MapObject::GetLatLon() const { return mercator::ToLatLon(m_mercator); }
|
||||
m2::PointD const & MapObject::GetMercator() const { return m_mercator; }
|
||||
vector<m2::PointD> const & MapObject::GetTriangesAsPoints() const { return m_triangles; }
|
||||
vector<m2::PointD> const & MapObject::GetPoints() const { return m_points; }
|
||||
feature::TypesHolder const & MapObject::GetTypes() const { return m_types; }
|
||||
FeatureID const & MapObject::GetID() const
|
||||
{
|
||||
return m_featureID;
|
||||
}
|
||||
ms::LatLon MapObject::GetLatLon() const
|
||||
{
|
||||
return mercator::ToLatLon(m_mercator);
|
||||
}
|
||||
m2::PointD const & MapObject::GetMercator() const
|
||||
{
|
||||
return m_mercator;
|
||||
}
|
||||
vector<m2::PointD> const & MapObject::GetTriangesAsPoints() const
|
||||
{
|
||||
return m_triangles;
|
||||
}
|
||||
vector<m2::PointD> const & MapObject::GetPoints() const
|
||||
{
|
||||
return m_points;
|
||||
}
|
||||
feature::TypesHolder const & MapObject::GetTypes() const
|
||||
{
|
||||
return m_types;
|
||||
}
|
||||
|
||||
string_view MapObject::GetDefaultName() const
|
||||
{
|
||||
@@ -78,7 +93,10 @@ StringUtf8Multilang const & MapObject::GetNameMultilang() const
|
||||
return m_name;
|
||||
}
|
||||
|
||||
string const & MapObject::GetHouseNumber() const { return m_houseNumber; }
|
||||
string const & MapObject::GetHouseNumber() const
|
||||
{
|
||||
return m_houseNumber;
|
||||
}
|
||||
|
||||
std::string_view MapObject::GetPostcode() const
|
||||
{
|
||||
@@ -117,22 +135,22 @@ std::string MapObject::GetLocalizedAllTypes(bool withMainType) const
|
||||
// Ignore types that are not POI
|
||||
if (!isMainType && !isPoi(type))
|
||||
continue;
|
||||
|
||||
|
||||
// Ignore general amenity
|
||||
if (!isMainType && amenityChecker.GetType() == type)
|
||||
continue;
|
||||
|
||||
|
||||
isMainType = false;
|
||||
|
||||
|
||||
// Add fields separator between types
|
||||
if (isFirst)
|
||||
isFirst = false;
|
||||
else
|
||||
oss << feature::kFieldsSeparator;
|
||||
|
||||
|
||||
oss << platform::GetLocalizedTypeName(classif().GetReadableObjectName(type));
|
||||
}
|
||||
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
@@ -146,7 +164,7 @@ std::string MapObject::GetAllReadableTypes() const
|
||||
|
||||
for (auto const type : copy)
|
||||
oss << classif().GetReadableObjectName(type) << feature::kFieldsSeparator;
|
||||
|
||||
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
@@ -165,14 +183,20 @@ feature::Internet MapObject::GetInternet() const
|
||||
return feature::InternetFromString(m_metadata.Get(MetadataID::FMD_INTERNET));
|
||||
}
|
||||
|
||||
vector<string> MapObject::GetCuisines() const { return feature::GetCuisines(m_types); }
|
||||
vector<string> MapObject::GetCuisines() const
|
||||
{
|
||||
return feature::GetCuisines(m_types);
|
||||
}
|
||||
|
||||
vector<string> MapObject::GetLocalizedCuisines() const
|
||||
{
|
||||
return feature::GetLocalizedCuisines(m_types);
|
||||
}
|
||||
|
||||
vector<string> MapObject::GetRecyclingTypes() const { return feature::GetRecyclingTypes(m_types); }
|
||||
vector<string> MapObject::GetRecyclingTypes() const
|
||||
{
|
||||
return feature::GetRecyclingTypes(m_types);
|
||||
}
|
||||
|
||||
vector<string> MapObject::GetLocalizedRecyclingTypes() const
|
||||
{
|
||||
@@ -218,8 +242,17 @@ int MapObject::GetStars() const
|
||||
return count;
|
||||
}
|
||||
|
||||
bool MapObject::IsPointType() const { return m_geomType == feature::GeomType::Point; }
|
||||
bool MapObject::IsBuilding() const { return ftypes::IsBuildingChecker::Instance()(m_types); }
|
||||
bool MapObject::IsPublicTransportStop() const { return ftypes::IsPublicTransportStopChecker::Instance()(m_types); }
|
||||
bool MapObject::IsPointType() const
|
||||
{
|
||||
return m_geomType == feature::GeomType::Point;
|
||||
}
|
||||
bool MapObject::IsBuilding() const
|
||||
{
|
||||
return ftypes::IsBuildingChecker::Instance()(m_types);
|
||||
}
|
||||
bool MapObject::IsPublicTransportStop() const
|
||||
{
|
||||
return ftypes::IsPublicTransportStopChecker::Instance()(m_types);
|
||||
}
|
||||
|
||||
} // namespace osm
|
||||
|
||||
Reference in New Issue
Block a user