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

line_shape.hpp « drape_frontend - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: fee0c814ec2e5d292518a435fc74f94c4f681c1d (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
#pragma once

#include "drape_frontend/map_shape.hpp"
#include "drape_frontend/shape_view_params.hpp"

#include "drape/binding_info.hpp"
#include "drape/glstate.hpp"

#include "geometry/spline.hpp"

#include "std/unique_ptr.hpp"

namespace df
{

class ILineShapeInfo
{
public:
  virtual ~ILineShapeInfo() {}

  virtual dp::BindingInfo const & GetBindingInfo() = 0;
  virtual dp::GLState GetState() = 0;

  virtual ref_ptr<void> GetLineData() = 0;
  virtual size_t GetLineSize() = 0;

  virtual ref_ptr<void> GetJoinData() = 0;
  virtual size_t GetJoinSize() = 0;

  virtual dp::BindingInfo const & GetCapBindingInfo() = 0;
  virtual dp::GLState GetCapState() = 0;
  virtual ref_ptr<void> GetCapData() = 0;
  virtual size_t GetCapSize() = 0;
};

class LineShape : public MapShape
{
public:
  LineShape(m2::SharedSpline const & spline, LineViewParams const & params);

  void Prepare(ref_ptr<dp::TextureManager> textures) const override;
  void Draw(ref_ptr<dp::Batcher> batcher, ref_ptr<dp::TextureManager> textures) const override;

private:
  template <typename TBuilder>
  void Construct(TBuilder & builder) const;

  bool CanBeSimplified(int & lineWidth) const;

  LineViewParams m_params;
  m2::SharedSpline m_spline;
  mutable unique_ptr<ILineShapeInfo> m_lineShapeInfo;
  mutable bool m_isSimple;
};

} // namespace df