mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 23:10:05 +00:00
Selectable elevation cuts
This commit is contained in:
parent
19f1207384
commit
e76ac3bc36
15 changed files with 230 additions and 51 deletions
|
|
@ -88,23 +88,33 @@ MapWidget::~MapWidget()
|
|||
makeCurrent();
|
||||
}
|
||||
|
||||
float MapWidget::GetElevation() const
|
||||
{
|
||||
return p->radarProductView_->elevation();
|
||||
}
|
||||
|
||||
std::vector<float> MapWidget::GetElevationCuts() const
|
||||
{
|
||||
return p->radarProductView_->GetElevationCuts();
|
||||
}
|
||||
|
||||
void MapWidget::SelectElevation(float elevation)
|
||||
{
|
||||
p->radarProductView_->SelectElevation(elevation);
|
||||
}
|
||||
|
||||
void MapWidget::SelectRadarProduct(common::Level2Product product)
|
||||
{
|
||||
p->radarProductView_ =
|
||||
view::RadarProductViewFactory::Create(product, p->radarProductManager_);
|
||||
float currentElevation = 0.0f;
|
||||
|
||||
p->radarProductView_->Initialize();
|
||||
|
||||
std::string colorTableFile =
|
||||
manager::SettingsManager::palette_settings()->palette(
|
||||
common::GetLevel2Palette(product));
|
||||
if (!colorTableFile.empty())
|
||||
if (p->radarProductView_ != nullptr)
|
||||
{
|
||||
std::shared_ptr<common::ColorTable> colorTable =
|
||||
common::ColorTable::Load(colorTableFile);
|
||||
p->radarProductView_->LoadColorTable(colorTable);
|
||||
currentElevation = p->radarProductView_->elevation();
|
||||
}
|
||||
|
||||
p->radarProductView_ = view::RadarProductViewFactory::Create(
|
||||
product, currentElevation, p->radarProductManager_);
|
||||
|
||||
connect(
|
||||
p->radarProductView_.get(),
|
||||
&view::RadarProductView::ColorTableUpdated,
|
||||
|
|
@ -118,9 +128,22 @@ void MapWidget::SelectRadarProduct(common::Level2Product product)
|
|||
[&]() {
|
||||
RadarRangeLayer::Update(p->map_, p->radarProductView_->range());
|
||||
update();
|
||||
emit RadarSweepUpdated();
|
||||
},
|
||||
Qt::QueuedConnection);
|
||||
|
||||
p->radarProductView_->Initialize();
|
||||
|
||||
std::string colorTableFile =
|
||||
manager::SettingsManager::palette_settings()->palette(
|
||||
common::GetLevel2Palette(product));
|
||||
if (!colorTableFile.empty())
|
||||
{
|
||||
std::shared_ptr<common::ColorTable> colorTable =
|
||||
common::ColorTable::Load(colorTableFile);
|
||||
p->radarProductView_->LoadColorTable(colorTable);
|
||||
}
|
||||
|
||||
if (p->map_ != nullptr)
|
||||
{
|
||||
AddLayers();
|
||||
|
|
|
|||
|
|
@ -31,7 +31,10 @@ public:
|
|||
explicit MapWidget(const QMapboxGLSettings&);
|
||||
~MapWidget();
|
||||
|
||||
void SelectRadarProduct(common::Level2Product product);
|
||||
float GetElevation() const;
|
||||
std::vector<float> GetElevationCuts() const;
|
||||
void SelectElevation(float elevation);
|
||||
void SelectRadarProduct(common::Level2Product product);
|
||||
|
||||
private:
|
||||
void changeStyle();
|
||||
|
|
@ -53,6 +56,9 @@ private:
|
|||
|
||||
private slots:
|
||||
void mapChanged(QMapboxGL::MapChange);
|
||||
|
||||
signals:
|
||||
void RadarSweepUpdated();
|
||||
};
|
||||
|
||||
} // namespace map
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue