| 1 | #pragma once |
| 2 | |
| 3 | #include <mbgl/renderer/query.hpp> |
| 4 | #include <mbgl/renderer/mode.hpp> |
| 5 | #include <mbgl/annotation/annotation.hpp> |
| 6 | #include <mbgl/util/geo.hpp> |
| 7 | #include <mbgl/util/geo.hpp> |
| 8 | |
| 9 | #include <functional> |
| 10 | #include <memory> |
| 11 | #include <string> |
| 12 | #include <vector> |
| 13 | |
| 14 | namespace mbgl { |
| 15 | |
| 16 | class FileSource; |
| 17 | class RendererBackend; |
| 18 | class RendererObserver; |
| 19 | class RenderedQueryOptions; |
| 20 | class Scheduler; |
| 21 | class SourceQueryOptions; |
| 22 | class UpdateParameters; |
| 23 | |
| 24 | class Renderer { |
| 25 | public: |
| 26 | Renderer(RendererBackend&, float pixelRatio_, FileSource&, Scheduler&, |
| 27 | GLContextMode = GLContextMode::Unique, |
| 28 | const optional<std::string> programCacheDir = {}, |
| 29 | const optional<std::string> localFontFamily = {}); |
| 30 | ~Renderer(); |
| 31 | |
| 32 | void markContextLost(); |
| 33 | |
| 34 | void setObserver(RendererObserver*); |
| 35 | |
| 36 | void render(const UpdateParameters&); |
| 37 | |
| 38 | // Feature queries |
| 39 | std::vector<Feature> queryRenderedFeatures(const ScreenLineString&, const RenderedQueryOptions& options = {}) const; |
| 40 | std::vector<Feature> queryRenderedFeatures(const ScreenCoordinate& point, const RenderedQueryOptions& options = {}) const; |
| 41 | std::vector<Feature> queryRenderedFeatures(const ScreenBox& box, const RenderedQueryOptions& options = {}) const; |
| 42 | std::vector<Feature> querySourceFeatures(const std::string& sourceID, const SourceQueryOptions& options = {}) const; |
| 43 | AnnotationIDs queryPointAnnotations(const ScreenBox& box) const; |
| 44 | AnnotationIDs queryShapeAnnotations(const ScreenBox& box) const; |
| 45 | AnnotationIDs getAnnotationIDs(const std::vector<Feature>&) const; |
| 46 | |
| 47 | // Debug |
| 48 | void dumpDebugLogs(); |
| 49 | |
| 50 | // Memory |
| 51 | void reduceMemoryUse(); |
| 52 | |
| 53 | private: |
| 54 | class Impl; |
| 55 | std::unique_ptr<Impl> impl; |
| 56 | }; |
| 57 | |
| 58 | } // namespace mbgl |
| 59 | |