Welcome to mirror list, hosted at ThFree Co, Russian Federation.

overlay_renderer.hpp « graphics - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 60df0a344366fc44c35dd99eec13465ca079dfcb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#pragma once

#include "graphics/text_renderer.hpp"
#include "graphics/overlay.hpp"
#include "graphics/circle_element.hpp"
#include "graphics/symbol_element.hpp"
#include "graphics/straight_text_element.hpp"

#include "std/shared_ptr.hpp"
#include "std/map.hpp"


namespace graphics
{
  class OverlayRenderer : public TextRenderer
  {
  private:

    bool m_drawTexts;
    bool m_drawSymbols;
    shared_ptr<graphics::OverlayStorage> m_overlayStorage;

  public:

    struct Params : public TextRenderer::Params
    {
      bool m_drawTexts;
      bool m_drawSymbols;
      Params();
    };

    OverlayRenderer(Params const & p);

    /// Drawing POI symbol
    void drawSymbol(SymbolElement::Params & params);
    void drawSymbol(m2::PointD const & pt, string const & symbolName, EPosition pos, int depth);

    /// Drawing circle
    void drawCircle(CircleElement::Params & params);
    void drawCircle(m2::PointD const & pt,
                    Circle::Info const & ci,
                    EPosition pos,
                    double depth);

    void drawCircledSymbol(SymbolElement::Params const & symParams,
                           CircleElement::Params const & circleParams);

    /// drawing straight text
    void drawText(FontDesc const & fontDesc,
                  m2::PointD const & pt,
                  graphics::EPosition pos,
                  string const & utf8Text,
                  double depth,
                  bool log2vis,
                  bool doSplit = false);

    void drawTextEx(StraightTextElement::Params & params);

    void drawTextEx(FontDesc const & primaryFont,
                    FontDesc const & secondaryFont,
                    m2::PointD const & pt,
                    graphics::EPosition pos,
                    string const & text,
                    string const & secondaryText,
                    double depth,
                    bool log2vis,
                    bool doSplit = false);

    void drawPathText(FontDesc const & fontDesc,
                      m2::PointD const * path,
                      size_t s,
                      string const & utf8Text,
                      double fullLength,
                      double pathOffset,
                      double textOffset,
                      double depth);

    /// drawing text on the path
    void drawPathText(FontDesc const & fontDesc,
                      m2::PointD const * path,
                      size_t s,
                      string const & utf8Text,
                      double fullLength,
                      double pathOffset,
                      double const * textOffsets,
                      size_t offsSize,
                      double depth);

    void setOverlay(shared_ptr<OverlayStorage> const & overlayStorage);
    void resetOverlay();
  };
}