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

shape_view_params.hpp « drape_frontend - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fde5123bf8a936872632e07bd9d60d9ed35bba53 (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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#pragma once

#include "drape/drape_global.hpp"
#include "drape/color.hpp"
#include "drape/stipple_pen_resource.hpp"

#include "indexer/feature_decl.hpp"
#include "geometry/point2d.hpp"

#include "std/string.hpp"

namespace df
{

double const kShapeCoordScalar = 1000;
int constexpr kBuildingOutlineSize = 16;

struct CommonViewParams
{
  float m_depth = 0.0f;
  int m_minVisibleScale = 0;
  uint8_t m_rank = 0;
  m2::PointD m_tileCenter;
};

struct PoiSymbolViewParams : CommonViewParams
{
  PoiSymbolViewParams(FeatureID const & id) : m_id(id) {}

  FeatureID m_id;
  string m_symbolName;
  uint32_t m_extendingSize;
  float m_posZ = 0.0f;
  bool m_hasArea = false;
  bool m_prioritized = false;
  bool m_obsoleteInEditor = false;
  dp::Anchor m_anchor = dp::Center;
  m2::PointF m_offset = m2::PointF(0.0f, 0.0f);
};

struct AreaViewParams : CommonViewParams
{
  dp::Color m_color;
  dp::Color m_outlineColor = dp::Color::Transparent();
  float m_minPosZ = 0.0f;
  float m_posZ = 0.0f;
  bool m_is3D = false;
  bool m_hatching = false;
  float m_baseGtoPScale = 1.0f;
};

struct LineViewParams : CommonViewParams
{
  dp::Color m_color;
  float m_width = 0.0f;
  dp::LineCap m_cap;
  dp::LineJoin m_join;
  buffer_vector<uint8_t, 8> m_pattern;
  float m_baseGtoPScale = 1.0f;
  int m_zoomLevel = -1;
};

struct TextViewParams : CommonViewParams
{
  TextViewParams() {}

  FeatureID m_featureID;
  dp::FontDecl m_primaryTextFont;
  string m_primaryText;
  dp::FontDecl m_secondaryTextFont;
  string m_secondaryText;
  dp::Anchor m_anchor;
  m2::PointF m_primaryOffset = m2::PointF(0.0f, 0.0f);
  m2::PointF m_secondaryOffset = m2::PointF(0.0f, 0.0f);
  bool m_primaryOptional = false;
  bool m_secondaryOptional = false;
  bool m_hasArea = false;
  bool m_createdByEditor = false;
  uint32_t m_extendingSize = 0;
  float m_posZ = 0.0f;
  bool m_limitedText = false;
  m2::PointF m_limits = m2::PointF(0.0f, 0.0f);
};

struct PathTextViewParams : CommonViewParams
{
  FeatureID m_featureID;
  dp::FontDecl m_textFont;
  std::string m_mainText;
  std::string m_auxText;
  float m_baseGtoPScale = 1.0f;
};

struct PathSymbolViewParams : CommonViewParams
{
  FeatureID m_featureID;
  string m_symbolName;
  float m_offset = 0.0f;
  float m_step = 0.0f;
  float m_baseGtoPScale = 1.0f;
};

struct ColoredSymbolViewParams : CommonViewParams
{
  enum class Shape
  {
    Rectangle, Circle, RoundedRectangle
  };

  FeatureID m_featureID;
  Shape m_shape = Shape::Circle;
  dp::Anchor m_anchor = dp::Center;
  dp::Color m_color;
  dp::Color m_outlineColor;
  float m_radiusInPixels = 0.0f;
  m2::PointF m_sizeInPixels = m2::PointF(0.0f, 0.0f);
  float m_outlineWidth = 0.0f;
  m2::PointF m_offset = m2::PointF(0.0f, 0.0f);
};

} // namespace df