| 130 | } |
| 131 | |
| 132 | bool TypeAlwaysExists(uint32_t type, GeomType geomType = GeomType::Undefined) |
| 133 | { |
| 134 | auto const & cl = classif(); |
| 135 | if (!cl.IsTypeValid(type)) |
| 136 | return false; |
| 137 | |
| 138 | if (IsUsefulStandaloneType(type, geomType)) |
| 139 | return true; |
| 140 | |
| 141 | if (ftypes::Subtypes::Instance().IsTypeWithSubtypesOrSubtype(type)) |
| 142 | return true; |
| 143 | |
| 144 | uint8_t const typeLevel = ftype::GetLevel(type); |
| 145 | ftype::TruncValue(type, 1); |
| 146 | |
| 147 | if (geomType != GeomType::Line) |
| 148 | { |
| 149 | static uint32_t const arrTypes[] = { |
| 150 | cl.GetTypeByPath({"internet_access"}), |
| 151 | cl.GetTypeByPath({"toilets"}), |
| 152 | cl.GetTypeByPath({"drinking_water"}), |
| 153 | }; |
| 154 | if (base::IsExist(arrTypes, type)) |
| 155 | return true; |
| 156 | |
| 157 | // Exclude generic 1-arity types like [organic]. |
| 158 | if (typeLevel >= 2) |
| 159 | { |
| 160 | static uint32_t const arrTypes[] = { |
| 161 | cl.GetTypeByPath({"organic"}), |
| 162 | cl.GetTypeByPath({"wheelchair"}), |
| 163 | }; |
| 164 | if (base::IsExist(arrTypes, type)) |
| 165 | return true; |
| 166 | } |
| 167 | } |
| 168 | |
| 169 | static uint32_t const complexEntry = cl.GetTypeByPath({"complex_entry"}); |
| 170 | return (type == complexEntry); |
| 171 | } |
| 172 | |
| 173 | bool IsUsefulNondrawableType(uint32_t type, GeomType geomType = GeomType::Undefined) |
| 174 | { |
no test coverage detected