blob: c66e51be725f66d5882f978d6195074722d9c5a5 (
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
|
#pragma once
#include "drape/feature_geometry_decl.hpp"
#include "drape/pointers.hpp"
#include "std/function.hpp"
class ScreenBase;
namespace df
{
class BatchMergeHelper;
}
namespace dp
{
class OverlayHandle;
class OverlayTree;
class VertexArrayBuffer;
class RenderBucket
{
friend class df::BatchMergeHelper;
public:
RenderBucket(drape_ptr<VertexArrayBuffer> && buffer);
~RenderBucket();
ref_ptr<VertexArrayBuffer> GetBuffer();
drape_ptr<VertexArrayBuffer> && MoveBuffer();
size_t GetOverlayHandlesCount() const;
drape_ptr<OverlayHandle> PopOverlayHandle();
ref_ptr<OverlayHandle> GetOverlayHandle(size_t index);
void AddOverlayHandle(drape_ptr<OverlayHandle> && handle);
void Update(ScreenBase const & modelView);
void CollectOverlayHandles(ref_ptr<OverlayTree> tree);
void Render(ScreenBase const & screen);
// Only for testing! Don't use this function in production code!
void RenderDebug(ScreenBase const & screen) const;
// Only for testing! Don't use this function in production code!
template <typename ToDo>
void ForEachOverlay(ToDo const & todo)
{
for (drape_ptr<OverlayHandle> const & h : m_overlay)
todo(make_ref(h));
}
bool IsShared() const { return !m_featuresGeometryInfo.empty(); }
void StartFeatureRecord(FeatureGeometryId feature, m2::RectD const & limitRect);
void EndFeatureRecord(bool featureCompleted);
using TCheckFeaturesWaiting = function<bool(m2::RectD const &)>;
bool IsFeaturesWaiting(TCheckFeaturesWaiting isFeaturesWaiting);
void AddFeaturesInfo(RenderBucket const & bucket);
private:
struct FeatureGeometryInfo
{
FeatureGeometryInfo() = default;
FeatureGeometryInfo(m2::RectD const & limitRect)
: m_limitRect(limitRect)
{}
m2::RectD m_limitRect;
bool m_featureCompleted = false;
};
using TFeaturesGeometryInfo = map<FeatureGeometryId, FeatureGeometryInfo>;
using TFeatureInfo = pair<FeatureGeometryId, FeatureGeometryInfo>;
TFeatureInfo m_featureInfo;
TFeaturesGeometryInfo m_featuresGeometryInfo;
vector<drape_ptr<OverlayHandle> > m_overlay;
drape_ptr<VertexArrayBuffer> m_buffer;
};
} // namespace dp
|