forked from organicmaps/organicmaps
Do NOT filter types for area features (They combine all drawing rules).
This commit is contained in:
parent
f54438b19e
commit
cdc487b5cf
4 changed files with 18 additions and 26 deletions
|
@ -115,7 +115,7 @@ public:
|
|||
|
||||
bool PreSerialize();
|
||||
|
||||
/// Note! This function overrides all previous assigned types.
|
||||
/// @note This function overrides all previous assigned types.
|
||||
/// Set all the parameters, except geometry type (it's set by other functions).
|
||||
inline void SetParams(FeatureParams const & params) { m_Params.SetParams(params); }
|
||||
|
||||
|
|
|
@ -380,8 +380,8 @@ protected:
|
|||
}
|
||||
else if (p->name == "way")
|
||||
{
|
||||
if (!feature::RemoveNoDrawableTypes(fValue.m_Types, FEATURE_TYPE_LINE_AREA))
|
||||
return;
|
||||
// It's useless here to skip any types by drawing criteria.
|
||||
// Area features can combine all drawing types (point, linear, unique area).
|
||||
|
||||
// geometry of feature
|
||||
for (size_t i = 0; i < p->childs.size(); ++i)
|
||||
|
@ -403,7 +403,7 @@ protected:
|
|||
if (count < 2)
|
||||
return;
|
||||
|
||||
// Try to set area feature (linear types are also suitable for this)
|
||||
// Try to set area feature (point and linear types are also suitable for this)
|
||||
if (feature::IsDrawableLike(fValue.m_Types, FEATURE_TYPE_AREA) &&
|
||||
(count > 2) && ft.IsGeometryClosed())
|
||||
{
|
||||
|
|
|
@ -259,32 +259,19 @@ namespace
|
|||
class CheckNonDrawableType
|
||||
{
|
||||
Classificator & m_c;
|
||||
FeatureGeoType m_arr[3];
|
||||
size_t m_count;
|
||||
FeatureGeoType m_type;
|
||||
|
||||
public:
|
||||
CheckNonDrawableType(FeatureGeoType ft)
|
||||
: m_c(classif()), m_count(0)
|
||||
: m_c(classif()), m_type(ft)
|
||||
{
|
||||
if (ft < FEATURE_TYPE_LINE_AREA)
|
||||
m_arr[m_count++] = ft;
|
||||
else
|
||||
{
|
||||
ASSERT_EQUAL ( ft, FEATURE_TYPE_LINE_AREA, () );
|
||||
m_arr[m_count++] = FEATURE_TYPE_LINE;
|
||||
m_arr[m_count++] = FEATURE_TYPE_AREA;
|
||||
}
|
||||
}
|
||||
|
||||
bool operator() (uint32_t t)
|
||||
{
|
||||
for (size_t i = 0; i < m_count; ++i)
|
||||
{
|
||||
IsDrawableLikeChecker doCheck(m_arr[i]);
|
||||
if (m_c.ProcessObjects(t, doCheck))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
IsDrawableLikeChecker doCheck(m_type);
|
||||
// return true if need to delete
|
||||
return !m_c.ProcessObjects(t, doCheck);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,19 +15,24 @@ namespace feature
|
|||
{
|
||||
class TypesHolder;
|
||||
|
||||
// Note! do not change this values. Should be equal with EGeomType.
|
||||
/// @note do not change this values. Should be equal with EGeomType.
|
||||
/// Used for checking visibility (by drawing style) for feature's geometry type
|
||||
/// (for Area - check only area type, but can draw symbol or caption).
|
||||
enum FeatureGeoType {
|
||||
FEATURE_TYPE_POINT = 0,
|
||||
FEATURE_TYPE_LINE = 1,
|
||||
FEATURE_TYPE_AREA = 2,
|
||||
FEATURE_TYPE_LINE_AREA = 3
|
||||
FEATURE_TYPE_AREA = 2
|
||||
};
|
||||
|
||||
bool IsDrawableAny(uint32_t type);
|
||||
bool IsDrawableLike(vector<uint32_t> const & types, FeatureGeoType ft);
|
||||
bool IsDrawableForIndex(FeatureBase const & f, int level);
|
||||
|
||||
/// @name Be carefull with FEATURE_TYPE_AREA.
|
||||
/// It's check only unique area styles, be it also can draw symbol or caption.
|
||||
//@{
|
||||
bool IsDrawableLike(vector<uint32_t> const & types, FeatureGeoType ft);
|
||||
bool RemoveNoDrawableTypes(vector<uint32_t> & types, FeatureGeoType ft);
|
||||
//@}
|
||||
|
||||
int GetMinDrawableScale(FeatureBase const & f);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue