mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-02 00:20:06 +00:00
Basic placefile lines rendering
Desired to make the line styling look more like warning boxes
This commit is contained in:
parent
e3c6850a1e
commit
c85e4cef58
6 changed files with 487 additions and 2 deletions
61
scwx-qt/source/scwx/qt/gl/draw/placefile_lines.hpp
Normal file
61
scwx-qt/source/scwx/qt/gl/draw/placefile_lines.hpp
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
#pragma once
|
||||
|
||||
#include <scwx/qt/gl/gl_context.hpp>
|
||||
#include <scwx/qt/gl/draw/draw_item.hpp>
|
||||
#include <scwx/gr/placefile.hpp>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
{
|
||||
namespace gl
|
||||
{
|
||||
namespace draw
|
||||
{
|
||||
|
||||
class PlacefileLines : public DrawItem
|
||||
{
|
||||
public:
|
||||
explicit PlacefileLines(std::shared_ptr<GlContext> context);
|
||||
~PlacefileLines();
|
||||
|
||||
PlacefileLines(const PlacefileLines&) = delete;
|
||||
PlacefileLines& operator=(const PlacefileLines&) = delete;
|
||||
|
||||
PlacefileLines(PlacefileLines&&) noexcept;
|
||||
PlacefileLines& operator=(PlacefileLines&&) noexcept;
|
||||
|
||||
void set_thresholded(bool thresholded);
|
||||
|
||||
void Initialize() override;
|
||||
void Render(const QMapLibreGL::CustomLayerRenderParameters& params,
|
||||
bool textureAtlasChanged) override;
|
||||
void Deinitialize() override;
|
||||
|
||||
/**
|
||||
* Resets and prepares the draw item for adding a new set of lines.
|
||||
*/
|
||||
void StartLines();
|
||||
|
||||
/**
|
||||
* Adds a placefile line to the internal draw list.
|
||||
*
|
||||
* @param [in] di Placefile line
|
||||
*/
|
||||
void AddLine(const std::shared_ptr<gr::Placefile::LineDrawItem>& di);
|
||||
|
||||
/**
|
||||
* Finalizes the draw item after adding new lines.
|
||||
*/
|
||||
void FinishLines();
|
||||
|
||||
private:
|
||||
class Impl;
|
||||
|
||||
std::unique_ptr<Impl> p;
|
||||
};
|
||||
|
||||
} // namespace draw
|
||||
} // namespace gl
|
||||
} // namespace qt
|
||||
} // namespace scwx
|
||||
Loading…
Add table
Add a link
Reference in a new issue