| 491 | } |
| 492 | |
| 493 | double BaseApplyFeature::PriorityToDepth(int priority, drule::TypeT ruleType, double areaDepth) const |
| 494 | { |
| 495 | double depth = priority; |
| 496 | |
| 497 | if (ruleType == drule::area || ruleType == drule::line) |
| 498 | { |
| 499 | if (depth < drule::kBasePriorityBgTop) |
| 500 | { |
| 501 | ASSERT(ruleType == drule::area, (m_f.DebugString())); |
| 502 | ASSERT_GREATER_OR_EQUAL(depth, drule::kBasePriorityBgBySize, (m_f.DebugString())); |
| 503 | // Prioritize BG-by-size areas by their bbox sizes instead of style-set priorities. |
| 504 | ASSERT_GREATER_OR_EQUAL(areaDepth, drule::kBaseDepthBgBySize, (m_f.DebugString())); |
| 505 | depth = areaDepth; |
| 506 | } |
| 507 | else if (depth < drule::kBasePriorityFg) |
| 508 | { |
| 509 | // Adjust BG-top features depth range so that it sits just above the BG-by-size range. |
| 510 | depth = drule::kBaseDepthBgTop + (depth - drule::kBasePriorityBgTop) * drule::kBgTopRangeFraction; |
| 511 | } |
| 512 | |
| 513 | // Shift the depth according to layer=* value. |
| 514 | int8_t const layer = m_f.GetLayer(); |
| 515 | if (layer != feature::LAYER_EMPTY) |
| 516 | depth += layer * drule::kLayerPriorityRange; |
| 517 | } |
| 518 | else |
| 519 | { |
| 520 | // Note we don't adjust priorities of "point-styles" according to layer=*, |
| 521 | // because their priorities are used for displacement logic only. |
| 522 | /// @todo(pastk) we might want to hide e.g. a trash bin under man_made=bridge or a bench on underground railway |
| 523 | /// station? |
| 524 | |
| 525 | // Check overlays priorities range. |
| 526 | ASSERT(-drule::kOverlaysMaxPriority <= depth && depth < drule::kOverlaysMaxPriority, (depth, m_f.DebugString())); |
| 527 | } |
| 528 | |
| 529 | // Check no features are clipped by the depth range constraints. |
| 530 | ASSERT(dp::kMinDepth <= depth && depth <= dp::kMaxDepth, (depth, m_f.DebugString())); |
| 531 | return depth; |
| 532 | } |
| 533 | |
| 534 | ApplyPointFeature::ApplyPointFeature(TileKey const & tileKey, TInsertShapeFn const & insertShape, FeatureType & f, |
| 535 | CaptionDescription const & captions) |
nothing calls this directly
no test coverage detected