blob: a2980f0171157f25186265ab831485ad186557ec (
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
|
#pragma once
#include "../drape/pointers.hpp"
#include "../drape/oglcontextfactory.hpp"
#include "../drape/batcher.hpp"
#include "../drape/gpu_program_manager.hpp"
#include "../drape/uniform_values_storage.hpp"
#include "../drape/texture_manager.hpp"
#include "../drape_frontend/viewport.hpp"
#include "../drape_frontend/map_data_provider.hpp"
#include "../std/map.hpp"
#include <QObject>
#include <QEvent>
namespace df
{
class TestingEngine : public QObject
{
public:
TestingEngine(dp::RefPointer<dp::OGLContextFactory> oglcontextfactory,
Viewport const & viewport,
MapDataProvider const & model);
~TestingEngine();
void Draw();
void Resize(int w, int h);
void DragStarted(m2::PointF const & p);
void Drag(m2::PointF const & p);
void DragEnded(m2::PointF const & p);
void Scale(m2::PointF const & p, double factor);
void UpdateCoverage(ScreenBase const & s){};
protected:
void timerEvent(QTimerEvent * e);
int m_timerId;
private:
void DrawImpl();
void DrawRects();
void ModelViewInit();
void ProjectionInit();
void OnFlushData(dp::GLState const & state, dp::TransferPointer<dp::RenderBucket> vao);
void ClearScene();
private:
dp::RefPointer<dp::OGLContextFactory> m_contextFactory;
dp::MasterPointer<dp::Batcher> m_batcher;
dp::MasterPointer<dp::GpuProgramManager> m_programManager;
dp::MasterPointer<dp::TextureManager> m_textures;
df::Viewport m_viewport;
typedef map<dp::GLState, vector<dp::MasterPointer<dp::RenderBucket> > > TScene;
TScene m_scene;
ScreenBase m_modelView;
float m_angle = 0.0;
dp::UniformValuesStorage m_generalUniforms;
vector<m2::RectD> m_boundRects;
vector<dp::OverlayHandle::Rects> m_rects;
};
} // namespace df
|