[indexer] naming fixes for feature::EHeaderMask, feature::EHeaderMask::HEADER_GEOTYPE_MASK, feature::ELayerFlags, FeatureType::GetTriangesAsPoints

This commit is contained in:
Arsentiy Milchakov 2019-04-17 14:40:26 +03:00 committed by Tatiana Yan
parent 0b9a22ea84
commit 5c46ed8c97
6 changed files with 15 additions and 15 deletions

View file

@ -67,7 +67,7 @@ FeatureID MigrateWayOrRelatonFeatureIndex(
if (ft.GetGeomType() != feature::GeomType::Area)
return;
++count;
auto ftGeometry = ft.GetTriangesAsPoints(FeatureType::BEST_GEOMETRY);
auto ftGeometry = ft.GetTrianglesAsPoints(FeatureType::BEST_GEOMETRY);
double score = 0.0;
try

View file

@ -250,7 +250,7 @@ feature::GeomType FeatureType::GetGeomType() const
{
// FeatureType::FeatureType(osm::MapObject const & emo) expects
// that GeomType::Undefined is never be returned.
auto const headerGeomType = static_cast<HeaderGeomType>(m_header & HEADER_GEOTYPE_MASK);
auto const headerGeomType = static_cast<HeaderGeomType>(m_header & HEADER_GEOMTYPE_MASK);
switch (headerGeomType)
{
case HeaderGeomType::Line: return GeomType::Line;
@ -338,7 +338,7 @@ void FeatureType::ParseHeader2()
uint8_t ptsCount = 0, ptsMask = 0, trgCount = 0, trgMask = 0;
BitSource bitSource(m_data + m_offsets.m_header2);
auto const headerGeomType = static_cast<HeaderGeomType>(Header(m_data) & HEADER_GEOTYPE_MASK);
auto const headerGeomType = static_cast<HeaderGeomType>(Header(m_data) & HEADER_GEOMTYPE_MASK);
if (headerGeomType == HeaderGeomType::Line)
{
@ -422,7 +422,7 @@ uint32_t FeatureType::ParseGeometry(int scale)
CHECK(m_loadInfo, ());
ParseHeader2();
auto const headerGeomType = static_cast<HeaderGeomType>(Header(m_data) & HEADER_GEOTYPE_MASK);
auto const headerGeomType = static_cast<HeaderGeomType>(Header(m_data) & HEADER_GEOMTYPE_MASK);
if (headerGeomType == HeaderGeomType::Line)
{
size_t const count = m_points.size();
@ -481,7 +481,7 @@ uint32_t FeatureType::ParseTriangles(int scale)
CHECK(m_loadInfo, ());
ParseHeader2();
auto const headerGeomType = static_cast<HeaderGeomType>(Header(m_data) & HEADER_GEOTYPE_MASK);
auto const headerGeomType = static_cast<HeaderGeomType>(Header(m_data) & HEADER_GEOMTYPE_MASK);
if (headerGeomType == HeaderGeomType::Area)
{
if (m_triangles.empty())
@ -636,7 +636,7 @@ m2::PointD const & FeatureType::GetPoint(size_t i) const
return m_points[i];
}
vector<m2::PointD> FeatureType::GetTriangesAsPoints(int scale)
vector<m2::PointD> FeatureType::GetTrianglesAsPoints(int scale)
{
ParseTriangles(scale);
return {m_triangles.begin(), m_triangles.end()};

View file

@ -70,7 +70,7 @@ public:
int8_t GetLayer();
std::vector<m2::PointD> GetTriangesAsPoints(int scale);
std::vector<m2::PointD> GetTrianglesAsPoints(int scale);
void SetID(FeatureID const & id) { m_id = id; }
FeatureID const & GetID() const { return m_id; }

View file

@ -22,12 +22,12 @@ class FeatureType;
namespace feature
{
enum EHeaderMask
enum HeaderMask
{
HEADER_TYPE_MASK = 7U,
HEADER_HAS_NAME = 1U << 3,
HEADER_HAS_LAYER = 1U << 4,
HEADER_GEOTYPE_MASK = 3U << 5,
HEADER_GEOMTYPE_MASK = 3U << 5,
HEADER_HAS_ADDINFO = 1U << 7
};
@ -42,7 +42,7 @@ namespace feature
static constexpr int kMaxTypesCount = HEADER_TYPE_MASK + 1;
enum ELayerFlags
enum LayerFlags
{
LAYER_LOW = -11,
@ -162,7 +162,7 @@ struct FeatureParamsBase
if (header & HEADER_HAS_ADDINFO)
{
auto const headerGeomType = static_cast<HeaderGeomType>(header & HEADER_GEOTYPE_MASK);
auto const headerGeomType = static_cast<HeaderGeomType>(header & HEADER_GEOMTYPE_MASK);
switch (headerGeomType)
{
case HeaderGeomType::Point:
@ -192,7 +192,7 @@ struct FeatureParamsBase
if (header & HEADER_HAS_ADDINFO)
{
auto const headerGeomType = static_cast<HeaderGeomType>(header & HEADER_GEOTYPE_MASK);
auto const headerGeomType = static_cast<HeaderGeomType>(header & HEADER_GEOMTYPE_MASK);
switch (headerGeomType)
{
case HeaderGeomType::Point:
@ -317,7 +317,7 @@ public:
using namespace feature;
uint8_t const header = ReadPrimitiveFromSource<uint8_t>(src);
m_geomType = static_cast<feature::HeaderGeomType>(header & HEADER_GEOTYPE_MASK);
m_geomType = static_cast<feature::HeaderGeomType>(header & HEADER_GEOMTYPE_MASK);
size_t const count = (header & HEADER_TYPE_MASK) + 1;
for (size_t i = 0; i < count; ++i)

View file

@ -79,7 +79,7 @@ void MapObject::SetFromFeatureType(FeatureType & ft)
m_geomType = ft.GetGeomType();
if (m_geomType == feature::GeomType::Area)
{
m_triangles = ft.GetTriangesAsPoints(FeatureType::BEST_GEOMETRY);
m_triangles = ft.GetTrianglesAsPoints(FeatureType::BEST_GEOMETRY);
}
else if (m_geomType == feature::GeomType::Line)
{

View file

@ -59,7 +59,7 @@ void StreetVicinityLoader::LoadStreet(uint32_t featureId, Street & street)
vector<m2::PointD> points;
if (feature->GetGeomType() == feature::GeomType::Area)
{
points = feature->GetTriangesAsPoints(FeatureType::BEST_GEOMETRY);
points = feature->GetTrianglesAsPoints(FeatureType::BEST_GEOMETRY);
}
else
{