mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 21:10:04 +00:00
Use layer names in ImGui Context names
This commit is contained in:
parent
ec296d98eb
commit
2be140d291
9 changed files with 38 additions and 25 deletions
|
|
@ -229,7 +229,10 @@ public:
|
||||||
|
|
||||||
AlertLayer::AlertLayer(std::shared_ptr<MapContext> context,
|
AlertLayer::AlertLayer(std::shared_ptr<MapContext> context,
|
||||||
awips::Phenomenon phenomenon) :
|
awips::Phenomenon phenomenon) :
|
||||||
DrawLayer(context), p(std::make_unique<Impl>(this, context, phenomenon))
|
DrawLayer(
|
||||||
|
context,
|
||||||
|
fmt::format("AlertLayer {}", awips::GetPhenomenonText(phenomenon))),
|
||||||
|
p(std::make_unique<Impl>(this, context, phenomenon))
|
||||||
{
|
{
|
||||||
for (auto alertActive : {false, true})
|
for (auto alertActive : {false, true})
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -20,11 +20,13 @@ static const auto logger_ = scwx::util::Logger::Create(logPrefix_);
|
||||||
class DrawLayerImpl
|
class DrawLayerImpl
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit DrawLayerImpl(std::shared_ptr<MapContext> context) :
|
explicit DrawLayerImpl(std::shared_ptr<MapContext> context,
|
||||||
|
const std::string& imGuiContextName) :
|
||||||
context_ {std::move(context)}, drawList_ {}
|
context_ {std::move(context)}, drawList_ {}
|
||||||
{
|
{
|
||||||
static size_t currentMapId_ {0u};
|
static size_t currentLayerId_ {0u};
|
||||||
imGuiContextName_ = fmt::format("Layer {}", ++currentMapId_);
|
imGuiContextName_ =
|
||||||
|
fmt::format("{} {}", imGuiContextName, ++currentLayerId_);
|
||||||
// This must be initialized after the last line
|
// This must be initialized after the last line
|
||||||
// NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
|
// NOLINTNEXTLINE(cppcoreguidelines-prefer-member-initializer)
|
||||||
imGuiContext_ =
|
imGuiContext_ =
|
||||||
|
|
@ -65,8 +67,10 @@ public:
|
||||||
bool imGuiRendererInitialized_ {};
|
bool imGuiRendererInitialized_ {};
|
||||||
};
|
};
|
||||||
|
|
||||||
DrawLayer::DrawLayer(const std::shared_ptr<MapContext>& context) :
|
DrawLayer::DrawLayer(const std::shared_ptr<MapContext>& context,
|
||||||
GenericLayer(context), p(std::make_unique<DrawLayerImpl>(context))
|
const std::string& imGuiContextName) :
|
||||||
|
GenericLayer(context),
|
||||||
|
p(std::make_unique<DrawLayerImpl>(context, imGuiContextName))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
DrawLayer::~DrawLayer() = default;
|
DrawLayer::~DrawLayer() = default;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,8 @@ class DrawLayerImpl;
|
||||||
class DrawLayer : public GenericLayer
|
class DrawLayer : public GenericLayer
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
explicit DrawLayer(const std::shared_ptr<MapContext>& context);
|
explicit DrawLayer(const std::shared_ptr<MapContext>& context,
|
||||||
|
const std::string& imGuiContextName);
|
||||||
virtual ~DrawLayer();
|
virtual ~DrawLayer();
|
||||||
|
|
||||||
virtual void Initialize() override;
|
virtual void Initialize() override;
|
||||||
|
|
|
||||||
|
|
@ -38,19 +38,21 @@ public:
|
||||||
MapContext(MapContext&&) noexcept;
|
MapContext(MapContext&&) noexcept;
|
||||||
MapContext& operator=(MapContext&&) noexcept;
|
MapContext& operator=(MapContext&&) noexcept;
|
||||||
|
|
||||||
std::weak_ptr<QMapLibre::Map> map() const;
|
[[nodiscard]] std::weak_ptr<QMapLibre::Map> map() const;
|
||||||
std::string map_copyrights() const;
|
[[nodiscard]] std::string map_copyrights() const;
|
||||||
MapProvider map_provider() const;
|
[[nodiscard]] MapProvider map_provider() const;
|
||||||
MapSettings& settings();
|
[[nodiscard]] MapSettings& settings();
|
||||||
QMargins color_table_margins() const;
|
[[nodiscard]] QMargins color_table_margins() const;
|
||||||
float pixel_ratio() const;
|
[[nodiscard]] float pixel_ratio() const;
|
||||||
common::Coordinate mouse_coordinate() const;
|
[[nodiscard]] common::Coordinate mouse_coordinate() const;
|
||||||
std::shared_ptr<view::OverlayProductView> overlay_product_view() const;
|
[[nodiscard]] std::shared_ptr<view::OverlayProductView>
|
||||||
std::shared_ptr<view::RadarProductView> radar_product_view() const;
|
overlay_product_view() const;
|
||||||
common::RadarProductGroup radar_product_group() const;
|
[[nodiscard]] std::shared_ptr<view::RadarProductView>
|
||||||
std::string radar_product() const;
|
radar_product_view() const;
|
||||||
int16_t radar_product_code() const;
|
[[nodiscard]] common::RadarProductGroup radar_product_group() const;
|
||||||
[[nodiscard]] QWidget* widget() const;
|
[[nodiscard]] std::string radar_product() const;
|
||||||
|
[[nodiscard]] int16_t radar_product_code() const;
|
||||||
|
[[nodiscard]] QWidget* widget() const;
|
||||||
|
|
||||||
void set_map(const std::shared_ptr<QMapLibre::Map>& map);
|
void set_map(const std::shared_ptr<QMapLibre::Map>& map);
|
||||||
void set_map_copyrights(const std::string& copyrights);
|
void set_map_copyrights(const std::string& copyrights);
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,8 @@ void MarkerLayer::Impl::ReloadMarkers()
|
||||||
}
|
}
|
||||||
|
|
||||||
MarkerLayer::MarkerLayer(const std::shared_ptr<MapContext>& context) :
|
MarkerLayer::MarkerLayer(const std::shared_ptr<MapContext>& context) :
|
||||||
DrawLayer(context), p(std::make_unique<MarkerLayer::Impl>(this, context))
|
DrawLayer(context, "MarkerLayer"),
|
||||||
|
p(std::make_unique<MarkerLayer::Impl>(this, context))
|
||||||
{
|
{
|
||||||
AddDrawItem(p->geoIcons_);
|
AddDrawItem(p->geoIcons_);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -143,7 +143,8 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
OverlayLayer::OverlayLayer(std::shared_ptr<MapContext> context) :
|
OverlayLayer::OverlayLayer(std::shared_ptr<MapContext> context) :
|
||||||
DrawLayer(context), p(std::make_unique<OverlayLayerImpl>(this, context))
|
DrawLayer(context, "OverlayLayer"),
|
||||||
|
p(std::make_unique<OverlayLayerImpl>(this, context))
|
||||||
{
|
{
|
||||||
AddDrawItem(p->activeBoxOuter_);
|
AddDrawItem(p->activeBoxOuter_);
|
||||||
AddDrawItem(p->activeBoxInner_);
|
AddDrawItem(p->activeBoxInner_);
|
||||||
|
|
|
||||||
|
|
@ -109,7 +109,8 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
OverlayProductLayer::OverlayProductLayer(std::shared_ptr<MapContext> context) :
|
OverlayProductLayer::OverlayProductLayer(std::shared_ptr<MapContext> context) :
|
||||||
DrawLayer(context), p(std::make_unique<Impl>(this, context))
|
DrawLayer(context, "OverlayProductLayer"),
|
||||||
|
p(std::make_unique<Impl>(this, context))
|
||||||
{
|
{
|
||||||
auto overlayProductView = context->overlay_product_view();
|
auto overlayProductView = context->overlay_product_view();
|
||||||
connect(overlayProductView.get(),
|
connect(overlayProductView.get(),
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,7 @@ public:
|
||||||
|
|
||||||
PlacefileLayer::PlacefileLayer(const std::shared_ptr<MapContext>& context,
|
PlacefileLayer::PlacefileLayer(const std::shared_ptr<MapContext>& context,
|
||||||
const std::string& placefileName) :
|
const std::string& placefileName) :
|
||||||
DrawLayer(context),
|
DrawLayer(context, fmt::format("PlacefileLayer {}", placefileName)),
|
||||||
p(std::make_unique<PlacefileLayer::Impl>(this, context, placefileName))
|
p(std::make_unique<PlacefileLayer::Impl>(this, context, placefileName))
|
||||||
{
|
{
|
||||||
AddDrawItem(p->placefileImages_);
|
AddDrawItem(p->placefileImages_);
|
||||||
|
|
|
||||||
|
|
@ -44,7 +44,7 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
RadarSiteLayer::RadarSiteLayer(std::shared_ptr<MapContext> context) :
|
RadarSiteLayer::RadarSiteLayer(std::shared_ptr<MapContext> context) :
|
||||||
DrawLayer(context), p(std::make_unique<Impl>(this))
|
DrawLayer(context, "RadarSiteLayer"), p(std::make_unique<Impl>(this))
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue