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

arrow3d.hpp « drape_frontend - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7dcaeec3e21d296d6a3c2567f846f7b6fdf10f78 (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/glstate.hpp"
#include "drape/pointers.hpp"

#include "geometry/rect2d.hpp"

#include "std/vector.hpp"

namespace dp
{
class GpuProgram;
class GpuProgramManager;
class TextureManager;
}

class ScreenBase;

namespace df
{

class Arrow3d
{
public:
  Arrow3d();
  ~Arrow3d();

  void SetPosition(m2::PointD const & position);
  void SetAzimuth(double azimuth);
  void SetTexture(ref_ptr<dp::TextureManager> texMng);
  void SetPositionObsolete(bool obsolete);

  void Render(ScreenBase const & screen, int zoomLevel, ref_ptr<dp::GpuProgramManager> mng);

private:
  void Build();
  math::Matrix<float, 4, 4> CalculateTransform(ScreenBase const & screen, float dz) const;
  void RenderArrow(ScreenBase const & screen, ref_ptr<dp::GpuProgram> program,
                   dp::Color const & color, float dz, bool hasNormals);

  m2::PointD m_position;
  double m_azimuth = 0.0;
  bool m_obsoletePosition = false;

  uint32_t m_bufferId = 0;
  uint32_t m_bufferNormalsId = 0;

  vector<float> m_vertices;
  vector<float> m_normals;

  dp::GLState m_state;

  bool m_isInitialized = false;
};

}  // namespace df