mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 13:30:06 +00:00
RadarProductView does not need QMapboxGL
This commit is contained in:
parent
7747e869ba
commit
d7e60a0d8c
7 changed files with 25 additions and 86 deletions
|
|
@ -104,8 +104,7 @@ void MapWidget::changeStyle()
|
|||
void MapWidget::AddLayers()
|
||||
{
|
||||
std::shared_ptr<view::RadarProductView> radarProductView =
|
||||
std::make_shared<view::RadarProductView>(p->radarProductManager_,
|
||||
p->map_);
|
||||
std::make_shared<view::RadarProductView>(p->radarProductManager_);
|
||||
|
||||
radarProductView->Initialize();
|
||||
|
||||
|
|
|
|||
|
|
@ -199,7 +199,7 @@ void RadarProductLayer::render(
|
|||
|
||||
p->shaderProgram_.Use();
|
||||
|
||||
const float scale = p->radarProductView_->scale() * 2.0f *
|
||||
const float scale = std::pow(2.0, params.zoom) * 2.0f *
|
||||
mbgl::util::tileSize / mbgl::util::DEGREES_MAX;
|
||||
const float xScale = scale / params.width;
|
||||
const float yScale = scale / params.height;
|
||||
|
|
|
|||
|
|
@ -24,10 +24,8 @@ class RadarProductViewImpl
|
|||
{
|
||||
public:
|
||||
explicit RadarProductViewImpl(
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager,
|
||||
std::shared_ptr<QMapboxGL> map) :
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager) :
|
||||
radarProductManager_(radarProductManager),
|
||||
map_(map),
|
||||
plotTime_(),
|
||||
colorTable_ {boost::gil::rgba8_pixel_t(0, 128, 0, 255),
|
||||
boost::gil::rgba8_pixel_t(255, 192, 0, 255),
|
||||
|
|
@ -37,7 +35,6 @@ public:
|
|||
~RadarProductViewImpl() = default;
|
||||
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager_;
|
||||
std::shared_ptr<QMapboxGL> map_;
|
||||
|
||||
std::vector<float> vertices_;
|
||||
std::vector<uint8_t> dataMoments8_;
|
||||
|
|
@ -49,9 +46,8 @@ public:
|
|||
};
|
||||
|
||||
RadarProductView::RadarProductView(
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager,
|
||||
std::shared_ptr<QMapboxGL> map) :
|
||||
p(std::make_unique<RadarProductViewImpl>(radarProductManager, map))
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager) :
|
||||
p(std::make_unique<RadarProductViewImpl>(radarProductManager))
|
||||
{
|
||||
connect(radarProductManager.get(),
|
||||
&manager::RadarProductManager::Level2DataLoaded,
|
||||
|
|
@ -60,26 +56,6 @@ RadarProductView::RadarProductView(
|
|||
}
|
||||
RadarProductView::~RadarProductView() = default;
|
||||
|
||||
double RadarProductView::bearing() const
|
||||
{
|
||||
return p->map_->bearing();
|
||||
}
|
||||
|
||||
double RadarProductView::scale() const
|
||||
{
|
||||
return p->map_->scale();
|
||||
}
|
||||
|
||||
const std::vector<uint8_t>& RadarProductView::data_moments8() const
|
||||
{
|
||||
return p->dataMoments8_;
|
||||
}
|
||||
|
||||
const std::vector<uint16_t>& RadarProductView::data_moments16() const
|
||||
{
|
||||
return p->dataMoments16_;
|
||||
}
|
||||
|
||||
const std::vector<float>& RadarProductView::vertices() const
|
||||
{
|
||||
return p->vertices_;
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@
|
|||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <QMapboxGL>
|
||||
|
||||
namespace scwx
|
||||
{
|
||||
namespace qt
|
||||
|
|
@ -24,16 +22,10 @@ class RadarProductView : public QObject
|
|||
|
||||
public:
|
||||
explicit RadarProductView(
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager,
|
||||
std::shared_ptr<QMapboxGL> map);
|
||||
std::shared_ptr<manager::RadarProductManager> radarProductManager);
|
||||
~RadarProductView();
|
||||
|
||||
double bearing() const;
|
||||
double scale() const;
|
||||
const std::vector<uint8_t>& data_moments8() const;
|
||||
const std::vector<uint16_t>& data_moments16() const;
|
||||
const std::vector<float>& vertices() const;
|
||||
|
||||
const std::vector<float>& vertices() const;
|
||||
const std::vector<boost::gil::rgba8_pixel_t>& color_table() const;
|
||||
|
||||
void Initialize();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue