mirror of
https://codeberg.org/comaps/comaps
synced 2025-12-23 22:53:43 +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:
76
drape_frontend/my_position.hpp
Normal file
76
drape_frontend/my_position.hpp
Normal file
@@ -0,0 +1,76 @@
|
||||
#pragma once
|
||||
|
||||
#include "drape_frontend/arrow3d.hpp"
|
||||
#include "drape_frontend/frame_values.hpp"
|
||||
#include "drape_frontend/render_node.hpp"
|
||||
|
||||
#include "shaders/program_manager.hpp"
|
||||
|
||||
#include "drape/batcher.hpp"
|
||||
#include "drape/texture_manager.hpp"
|
||||
#include "drape/vertex_array_buffer.hpp"
|
||||
|
||||
#include "geometry/screenbase.hpp"
|
||||
|
||||
#include <optional>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
namespace df
|
||||
{
|
||||
class MyPosition
|
||||
{
|
||||
public:
|
||||
MyPosition(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> mng);
|
||||
|
||||
bool InitArrow(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> mng,
|
||||
Arrow3d::PreloadedData && preloadedData);
|
||||
|
||||
// pt - mercator point.
|
||||
void SetPosition(m2::PointF const & pt);
|
||||
void SetAzimuth(float azimut);
|
||||
void SetIsValidAzimuth(bool isValid);
|
||||
void SetAccuracy(float accuracy);
|
||||
void SetRoutingMode(bool routingMode);
|
||||
void SetPositionObsolete(bool obsolete);
|
||||
|
||||
void RenderAccuracy(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng,
|
||||
ScreenBase const & screen, int zoomLevel, FrameValues const & frameValues);
|
||||
|
||||
void RenderMyPosition(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng,
|
||||
ScreenBase const & screen, int zoomLevel, FrameValues const & frameValues);
|
||||
|
||||
private:
|
||||
void CacheAccuracySector(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> mng);
|
||||
void CachePointPosition(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::TextureManager> mng);
|
||||
|
||||
enum EMyPositionPart
|
||||
{
|
||||
// Don't change the order and the values.
|
||||
MyPositionAccuracy = 0,
|
||||
MyPositionPoint = 1,
|
||||
};
|
||||
|
||||
void RenderPart(ref_ptr<dp::GraphicsContext> context, ref_ptr<gpu::ProgramManager> mng,
|
||||
gpu::ShapesProgramParams const & params,
|
||||
EMyPositionPart part);
|
||||
|
||||
void CacheSymbol(ref_ptr<dp::GraphicsContext> context,
|
||||
dp::TextureManager::SymbolRegion const & symbol, dp::RenderState const & state,
|
||||
dp::Batcher & batcher, EMyPositionPart part);
|
||||
|
||||
m2::PointF m_position;
|
||||
float m_azimuth;
|
||||
float m_accuracy;
|
||||
bool m_showAzimuth;
|
||||
bool m_isRoutingMode;
|
||||
|
||||
using TPart = std::pair<dp::IndicesRange, size_t>;
|
||||
|
||||
std::vector<TPart> m_parts;
|
||||
std::vector<RenderNode> m_nodes;
|
||||
|
||||
drape_ptr<Arrow3d> m_arrow3d;
|
||||
};
|
||||
} // namespace df
|
||||
Reference in New Issue
Block a user