mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-19 21:13:35 +00:00
Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run: git remote add om-historic [om-historic.git repo url] git fetch --tags om-historic git replace squashed-history historic-commits
This commit is contained in:
51
drape_frontend/debug_rect_renderer.hpp
Normal file
51
drape_frontend/debug_rect_renderer.hpp
Normal file
@@ -0,0 +1,51 @@
|
||||
#pragma once
|
||||
|
||||
#include "drape/debug_renderer.hpp"
|
||||
#include "drape/gpu_program.hpp"
|
||||
#include "drape/mesh_object.hpp"
|
||||
#include "drape/render_state.hpp"
|
||||
|
||||
#include "shaders/program_params.hpp"
|
||||
|
||||
#include "geometry/rect2d.hpp"
|
||||
#include "geometry/screenbase.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace df
|
||||
{
|
||||
class DebugRectRenderer : public dp::DebugRenderer
|
||||
{
|
||||
using Base = dp::MeshObject;
|
||||
public:
|
||||
DebugRectRenderer(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::GpuProgram> program,
|
||||
ref_ptr<gpu::ProgramParamsSetter> paramsSetter);
|
||||
|
||||
void SetEnabled(bool enabled);
|
||||
|
||||
bool IsEnabled() const override;
|
||||
void DrawRect(ref_ptr<dp::GraphicsContext> context, ScreenBase const & screen,
|
||||
m2::RectF const & rect, dp::Color const & color) override;
|
||||
void DrawArrow(ref_ptr<dp::GraphicsContext> context, ScreenBase const & screen,
|
||||
dp::OverlayTree::DisplacementData const & data) override;
|
||||
|
||||
void FinishRendering();
|
||||
|
||||
private:
|
||||
void SetArrow(ref_ptr<dp::GraphicsContext> context, m2::PointF const & arrowStart,
|
||||
m2::PointF const & arrowEnd, ScreenBase const & screen);
|
||||
void SetRect(ref_ptr<dp::GraphicsContext> context, m2::RectF const & rect,
|
||||
ScreenBase const & screen);
|
||||
|
||||
std::vector<drape_ptr<dp::MeshObject>> m_rectMeshes;
|
||||
std::vector<drape_ptr<dp::MeshObject>> m_arrowMeshes;
|
||||
size_t m_currentRectMesh = 0;
|
||||
size_t m_currentArrowMesh = 0;
|
||||
ref_ptr<dp::GpuProgram> m_program;
|
||||
ref_ptr<gpu::ProgramParamsSetter> m_paramsSetter;
|
||||
dp::RenderState m_state;
|
||||
|
||||
bool m_isEnabled = false;
|
||||
};
|
||||
} // namespace df
|
||||
|
||||
Reference in New Issue
Block a user