MCPcopy Create free account
hub / github.com/comaps/comaps / DrawTileNet

Method DrawTileNet

libs/drape_frontend/rule_drawer.cpp:500–550  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

498
499#ifdef DRAW_TILE_NET
500void RuleDrawer::DrawTileNet()
501{
502 if (CheckCancelled())
503 return;
504
505 auto const key = m_context->GetTileKey();
506
507 std::vector<m2::PointD> path;
508 path.reserve(4);
509 path.push_back(m_globalRect.LeftBottom());
510 path.push_back(m_globalRect.LeftTop());
511 path.push_back(m_globalRect.RightTop());
512 path.push_back(m_globalRect.RightBottom());
513
514 m2::SharedSpline spline(path);
515 df::LineViewParams p;
516 p.m_tileCenter = m_globalRect.Center();
517 p.m_baseGtoPScale = 1.0;
518 p.m_cap = dp::ButtCap;
519 p.m_color = dp::Color::Blue();
520 p.m_depth = dp::kMaxDepth;
521 p.m_depthLayer = DepthLayer::GeometryLayer;
522 p.m_width = 1;
523 p.m_join = dp::RoundJoin;
524
525 auto lineShape = make_unique_dp<LineShape>(spline, p);
526 lineShape->Prepare(m_context->GetTextureManager());
527 TMapShapes shapes;
528 shapes.push_back(std::move(lineShape));
529 m_context->Flush(std::move(shapes));
530
531 df::TextViewParams tp;
532 tp.m_markId = kml::kDebugMarkId;
533 tp.m_tileCenter = m_globalRect.Center();
534 tp.m_titleDecl.m_anchor = dp::Center;
535 tp.m_depth = dp::kMaxDepth;
536 tp.m_depthLayer = DepthLayer::OverlayLayer;
537 tp.m_titleDecl.m_primaryText = key.Coord2String();
538
539 tp.m_titleDecl.m_primaryTextFont = dp::FontDecl(dp::Color::Red(), 30);
540 tp.m_titleDecl.m_primaryOffset = {0.0f, 0.0f};
541 auto textShape =
542 make_unique_dp<TextShape>(m_globalRect.Center(), tp, key, m2::PointF(0.0f, 0.0f) /* symbolSize */,
543 m2::PointF(0.0f, 0.0f) /* symbolOffset */, dp::Anchor::Center, 0 /* textIndex */);
544 textShape->DisableDisplacing();
545
546 textShape->Prepare(m_context->GetTextureManager());
547 TMapShapes overlayShapes;
548 overlayShapes.push_back(std::move(textShape));
549 m_context->FlushOverlays(std::move(overlayShapes));
550}
551#endif
552} // namespace df

Callers 1

ReadFeaturesMethod · 0.80

Calls 14

LeftBottomMethod · 0.80
LeftTopMethod · 0.80
RightTopMethod · 0.80
RightBottomMethod · 0.80
GetTextureManagerMethod · 0.80
Coord2StringMethod · 0.80
DisableDisplacingMethod · 0.80
FlushOverlaysMethod · 0.80
FontDeclClass · 0.70
reserveMethod · 0.45
push_backMethod · 0.45
CenterMethod · 0.45

Tested by

no test coverage detected