Renamed ambiguous FeatureType::ParseAll() to ParseGeometryAndTriangles().

This commit is contained in:
Alex Zolotarev 2016-01-04 15:49:26 +03:00 committed by Sergey Yershov
parent cb162b49b8
commit 075913c187
2 changed files with 30 additions and 6 deletions

View file

@ -278,8 +278,32 @@ namespace
string FeatureType::DebugString(int scale) const
{
return base_type::DebugString() + "; Center = " +
DebugPrint(MercatorBounds::ToLatLon(feature::GetCenter(*this, scale)));
ParseGeometryAndTriangles(scale);
string s = base_type::DebugString();
switch (GetFeatureType())
{
case GEOM_POINT:
s += (" Center:" + DebugPrint(m_center));
break;
case GEOM_LINE:
s += " Points:";
Points2String(s, m_points);
break;
case GEOM_AREA:
s += " Triangles:";
Points2String(s, m_triangles);
break;
case GEOM_UNDEFINED:
ASSERT(false, ("Assume that we have valid feature always"));
break;
}
return s;
}
string DebugPrint(FeatureType const & ft)
@ -289,7 +313,7 @@ string DebugPrint(FeatureType const & ft)
bool FeatureType::IsEmptyGeometry(int scale) const
{
ParseAll(scale);
ParseGeometryAndTriangles(scale);
switch (GetFeatureType())
{
@ -301,7 +325,7 @@ bool FeatureType::IsEmptyGeometry(int scale) const
m2::RectD FeatureType::GetLimitRect(int scale) const
{
ParseAll(scale);
ParseGeometryAndTriangles(scale);
if (m_triangles.empty() && m_points.empty() && (GetFeatureType() != GEOM_POINT))
{
@ -314,7 +338,7 @@ m2::RectD FeatureType::GetLimitRect(int scale) const
return m_limitRect;
}
void FeatureType::ParseAll(int scale) const
void FeatureType::ParseGeometryAndTriangles(int scale) const
{
ParseGeometry(scale);
ParseTriangles(scale);

View file

@ -322,7 +322,7 @@ public:
}
private:
void ParseAll(int scale) const;
void ParseGeometryAndTriangles(int scale) const;
// For better result this value should be greater than 17
// (number of points in inner triangle-strips).