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:
57
drape_frontend/area_shape.hpp
Normal file
57
drape_frontend/area_shape.hpp
Normal file
@@ -0,0 +1,57 @@
|
||||
#pragma once
|
||||
|
||||
#include "drape_frontend/map_shape.hpp"
|
||||
#include "drape_frontend/shape_view_params.hpp"
|
||||
|
||||
#include "drape/glsl_types.hpp"
|
||||
#include "drape/pointers.hpp"
|
||||
|
||||
#include "geometry/point2d.hpp"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace df
|
||||
{
|
||||
|
||||
struct BuildingOutline
|
||||
{
|
||||
buffer_vector<m2::PointD, kBuildingOutlineSize> m_vertices;
|
||||
std::vector<int> m_indices;
|
||||
std::vector<m2::PointD> m_normals;
|
||||
bool m_generateOutline = false;
|
||||
};
|
||||
|
||||
class AreaShape : public MapShape
|
||||
{
|
||||
public:
|
||||
AreaShape(std::vector<m2::PointD> triangleList, BuildingOutline && buildingOutline,
|
||||
AreaViewParams const & params);
|
||||
|
||||
void Draw(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::Batcher> batcher,
|
||||
ref_ptr<dp::TextureManager> textures) const override;
|
||||
|
||||
private:
|
||||
glsl::vec2 ToShapeVertex2(m2::PointD const & vertex) const
|
||||
{
|
||||
return glsl::ToVec2(ConvertToLocal(vertex, m_params.m_tileCenter, kShapeCoordScalar));
|
||||
}
|
||||
glsl::vec3 ToShapeVertex3(m2::PointD const & vertex) const
|
||||
{
|
||||
return { ToShapeVertex2(vertex), m_params.m_depth };
|
||||
}
|
||||
|
||||
void DrawArea(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::Batcher> batcher,
|
||||
m2::PointD const & colorUv, m2::PointD const & outlineUv,
|
||||
ref_ptr<dp::Texture> texture) const;
|
||||
void DrawArea3D(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::Batcher> batcher,
|
||||
m2::PointD const & colorUv, m2::PointD const & outlineUv,
|
||||
ref_ptr<dp::Texture> texture) const;
|
||||
void DrawHatchingArea(ref_ptr<dp::GraphicsContext> context, ref_ptr<dp::Batcher> batcher,
|
||||
m2::PointD const & colorUv, ref_ptr<dp::Texture> texture,
|
||||
ref_ptr<dp::Texture> hatchingTexture) const;
|
||||
|
||||
std::vector<m2::PointD> m_vertexes;
|
||||
BuildingOutline m_buildingOutline;
|
||||
AreaViewParams m_params;
|
||||
};
|
||||
} // namespace df
|
||||
Reference in New Issue
Block a user