mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-11-02 04:50:04 +00:00
commit
ea19de3e5f
26 changed files with 851 additions and 483 deletions
|
|
@ -14,6 +14,7 @@ layout (location = 3) in vec4 aModulate;
|
||||||
layout (location = 4) in float aAngleDeg;
|
layout (location = 4) in float aAngleDeg;
|
||||||
layout (location = 5) in int aThreshold;
|
layout (location = 5) in int aThreshold;
|
||||||
layout (location = 6) in ivec2 aTimeRange;
|
layout (location = 6) in ivec2 aTimeRange;
|
||||||
|
layout (location = 7) in int aDisplayed;
|
||||||
|
|
||||||
uniform mat4 uMVPMatrix;
|
uniform mat4 uMVPMatrix;
|
||||||
uniform mat4 uMapMatrix;
|
uniform mat4 uMapMatrix;
|
||||||
|
|
@ -42,8 +43,8 @@ vec2 latLngToScreenCoordinate(in vec2 latLng)
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
// Always set displayed to true
|
// Pass displayed to the geometry shader
|
||||||
vsOut.displayed = 1;
|
vsOut.displayed = aDisplayed;
|
||||||
|
|
||||||
// Pass the threshold and time range to the geometry shader
|
// Pass the threshold and time range to the geometry shader
|
||||||
vsOut.threshold = aThreshold;
|
vsOut.threshold = aThreshold;
|
||||||
|
|
|
||||||
BIN
scwx-qt/res/textures/images/cursor-17.png
Normal file
BIN
scwx-qt/res/textures/images/cursor-17.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 624 B |
BIN
scwx-qt/res/textures/images/dot-3.png
Normal file
BIN
scwx-qt/res/textures/images/dot-3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 551 B |
|
|
@ -70,7 +70,9 @@
|
||||||
<file>res/palettes/wct/ZDR.pal</file>
|
<file>res/palettes/wct/ZDR.pal</file>
|
||||||
<file>res/textures/lines/default-1x7.png</file>
|
<file>res/textures/lines/default-1x7.png</file>
|
||||||
<file>res/textures/lines/test-pattern.png</file>
|
<file>res/textures/lines/test-pattern.png</file>
|
||||||
|
<file>res/textures/images/cursor-17.png</file>
|
||||||
<file>res/textures/images/crosshairs-24.png</file>
|
<file>res/textures/images/crosshairs-24.png</file>
|
||||||
|
<file>res/textures/images/dot-3.png</file>
|
||||||
<file>res/textures/images/mapbox-logo.svg</file>
|
<file>res/textures/images/mapbox-logo.svg</file>
|
||||||
<file>res/textures/images/maptiler-logo.svg</file>
|
<file>res/textures/images/maptiler-logo.svg</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@
|
||||||
#include <execution>
|
#include <execution>
|
||||||
|
|
||||||
#include <boost/unordered/unordered_flat_map.hpp>
|
#include <boost/unordered/unordered_flat_map.hpp>
|
||||||
|
#include <boost/unordered/unordered_flat_set.hpp>
|
||||||
|
|
||||||
namespace scwx
|
namespace scwx
|
||||||
{
|
{
|
||||||
|
|
@ -32,8 +33,10 @@ static constexpr std::size_t kIconBufferLength =
|
||||||
static constexpr std::size_t kTextureBufferLength =
|
static constexpr std::size_t kTextureBufferLength =
|
||||||
kNumTriangles * kVerticesPerTriangle * kPointsPerTexCoord;
|
kNumTriangles * kVerticesPerTriangle * kPointsPerTexCoord;
|
||||||
|
|
||||||
// Threshold, start time, end time
|
// Threshold, start time, end time, displayed
|
||||||
static constexpr std::size_t kIntegersPerVertex_ = 3;
|
static constexpr std::size_t kIntegersPerVertex_ = 4;
|
||||||
|
static constexpr std::size_t kIntegerBufferLength_ =
|
||||||
|
kNumTriangles * kVerticesPerTriangle * kIntegersPerVertex_;
|
||||||
|
|
||||||
struct GeoIconDrawItem
|
struct GeoIconDrawItem
|
||||||
{
|
{
|
||||||
|
|
@ -42,6 +45,7 @@ struct GeoIconDrawItem
|
||||||
std::chrono::sys_time<std::chrono::seconds> endTime_ {};
|
std::chrono::sys_time<std::chrono::seconds> endTime_ {};
|
||||||
|
|
||||||
boost::gil::rgba32f_pixel_t modulate_ {1.0f, 1.0f, 1.0f, 1.0f};
|
boost::gil::rgba32f_pixel_t modulate_ {1.0f, 1.0f, 1.0f, 1.0f};
|
||||||
|
bool visible_ {true};
|
||||||
double latitude_ {};
|
double latitude_ {};
|
||||||
double longitude_ {};
|
double longitude_ {};
|
||||||
double x_ {};
|
double x_ {};
|
||||||
|
|
@ -50,6 +54,8 @@ struct GeoIconDrawItem
|
||||||
std::string iconSheet_ {};
|
std::string iconSheet_ {};
|
||||||
std::size_t iconIndex_ {};
|
std::size_t iconIndex_ {};
|
||||||
std::string hoverText_ {};
|
std::string hoverText_ {};
|
||||||
|
|
||||||
|
std::shared_ptr<types::IconInfo> iconInfo_ {};
|
||||||
};
|
};
|
||||||
|
|
||||||
class GeoIcons::Impl
|
class GeoIcons::Impl
|
||||||
|
|
@ -83,7 +89,13 @@ public:
|
||||||
~Impl() {}
|
~Impl() {}
|
||||||
|
|
||||||
void UpdateBuffers();
|
void UpdateBuffers();
|
||||||
|
static void UpdateSingleBuffer(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
|
std::size_t iconIndex,
|
||||||
|
std::vector<float>& iconBuffer,
|
||||||
|
std::vector<GLint>& integerBuffer,
|
||||||
|
std::vector<IconHoverEntry>& hoverIcons);
|
||||||
void UpdateTextureBuffer();
|
void UpdateTextureBuffer();
|
||||||
|
void UpdateModifiedIconBuffers();
|
||||||
void Update(bool textureAtlasChanged);
|
void Update(bool textureAtlasChanged);
|
||||||
|
|
||||||
std::shared_ptr<GlContext> context_;
|
std::shared_ptr<GlContext> context_;
|
||||||
|
|
@ -93,13 +105,16 @@ public:
|
||||||
bool thresholded_ {false};
|
bool thresholded_ {false};
|
||||||
bool lastTextureAtlasChanged_ {false};
|
bool lastTextureAtlasChanged_ {false};
|
||||||
|
|
||||||
|
boost::unordered_flat_set<std::shared_ptr<GeoIconDrawItem>> dirtyIcons_ {};
|
||||||
|
|
||||||
std::chrono::system_clock::time_point selectedTime_ {};
|
std::chrono::system_clock::time_point selectedTime_ {};
|
||||||
|
|
||||||
std::mutex iconMutex_;
|
std::mutex iconMutex_;
|
||||||
|
|
||||||
boost::unordered_flat_map<std::string, types::IconInfo>
|
boost::unordered_flat_map<std::string, std::shared_ptr<types::IconInfo>>
|
||||||
currentIconSheets_ {};
|
currentIconSheets_ {};
|
||||||
boost::unordered_flat_map<std::string, types::IconInfo> newIconSheets_ {};
|
boost::unordered_flat_map<std::string, std::shared_ptr<types::IconInfo>>
|
||||||
|
newIconSheets_ {};
|
||||||
|
|
||||||
std::vector<std::shared_ptr<GeoIconDrawItem>> currentIconList_ {};
|
std::vector<std::shared_ptr<GeoIconDrawItem>> currentIconList_ {};
|
||||||
std::vector<std::shared_ptr<GeoIconDrawItem>> newIconList_ {};
|
std::vector<std::shared_ptr<GeoIconDrawItem>> newIconList_ {};
|
||||||
|
|
@ -240,6 +255,15 @@ void GeoIcons::Initialize()
|
||||||
reinterpret_cast<void*>(1 * sizeof(GLint)));
|
reinterpret_cast<void*>(1 * sizeof(GLint)));
|
||||||
gl.glEnableVertexAttribArray(6);
|
gl.glEnableVertexAttribArray(6);
|
||||||
|
|
||||||
|
// aDisplayed
|
||||||
|
gl.glVertexAttribPointer(7,
|
||||||
|
1,
|
||||||
|
GL_INT,
|
||||||
|
GL_FALSE,
|
||||||
|
kIntegersPerVertex_ * sizeof(GLint),
|
||||||
|
reinterpret_cast<void*>(3 * sizeof(float)));
|
||||||
|
gl.glEnableVertexAttribArray(7);
|
||||||
|
|
||||||
p->dirty_ = true;
|
p->dirty_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,10 +362,11 @@ void GeoIcons::AddIconSheet(const std::string& name,
|
||||||
std::int32_t hotY)
|
std::int32_t hotY)
|
||||||
{
|
{
|
||||||
// Populate icon sheet map
|
// Populate icon sheet map
|
||||||
p->newIconSheets_.emplace(std::piecewise_construct,
|
p->newIconSheets_.emplace(
|
||||||
|
std::piecewise_construct,
|
||||||
std::tuple {name},
|
std::tuple {name},
|
||||||
std::forward_as_tuple(types::IconInfo {
|
std::forward_as_tuple(std::make_shared<types::IconInfo>(
|
||||||
name, iconWidth, iconHeight, hotX, hotY}));
|
name, iconWidth, iconHeight, hotX, hotY)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeoIcons::FinishIconSheets()
|
void GeoIcons::FinishIconSheets()
|
||||||
|
|
@ -349,7 +374,7 @@ void GeoIcons::FinishIconSheets()
|
||||||
// Update icon sheets
|
// Update icon sheets
|
||||||
for (auto& iconSheet : p->newIconSheets_)
|
for (auto& iconSheet : p->newIconSheets_)
|
||||||
{
|
{
|
||||||
iconSheet.second.UpdateTextureInfo();
|
iconSheet.second->UpdateTextureInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_lock lock {p->iconMutex_};
|
std::unique_lock lock {p->iconMutex_};
|
||||||
|
|
@ -379,12 +404,26 @@ std::shared_ptr<GeoIconDrawItem> GeoIcons::AddIcon()
|
||||||
return p->newIconList_.emplace_back(std::make_shared<GeoIconDrawItem>());
|
return p->newIconList_.emplace_back(std::make_shared<GeoIconDrawItem>());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeoIcons::SetIconVisible(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
|
bool visible)
|
||||||
|
{
|
||||||
|
if (di->visible_ != visible)
|
||||||
|
{
|
||||||
|
di->visible_ = visible;
|
||||||
|
p->dirtyIcons_.insert(di);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GeoIcons::SetIconTexture(const std::shared_ptr<GeoIconDrawItem>& di,
|
void GeoIcons::SetIconTexture(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
const std::string& iconSheet,
|
const std::string& iconSheet,
|
||||||
std::size_t iconIndex)
|
std::size_t iconIndex)
|
||||||
|
{
|
||||||
|
if (di->iconSheet_ != iconSheet || di->iconIndex_ != iconIndex)
|
||||||
{
|
{
|
||||||
di->iconSheet_ = iconSheet;
|
di->iconSheet_ = iconSheet;
|
||||||
di->iconIndex_ = iconIndex;
|
di->iconIndex_ = iconIndex;
|
||||||
|
p->dirtyIcons_.insert(di);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeoIcons::SetIconLocation(const std::shared_ptr<GeoIconDrawItem>& di,
|
void GeoIcons::SetIconLocation(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
|
|
@ -392,11 +431,17 @@ void GeoIcons::SetIconLocation(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
units::angle::degrees<double> longitude,
|
units::angle::degrees<double> longitude,
|
||||||
double xOffset,
|
double xOffset,
|
||||||
double yOffset)
|
double yOffset)
|
||||||
|
{
|
||||||
|
if (di->latitude_ != latitude.value() ||
|
||||||
|
di->longitude_ != longitude.value() || di->x_ != xOffset ||
|
||||||
|
di->y_ != yOffset)
|
||||||
{
|
{
|
||||||
di->latitude_ = latitude.value();
|
di->latitude_ = latitude.value();
|
||||||
di->longitude_ = longitude.value();
|
di->longitude_ = longitude.value();
|
||||||
di->x_ = xOffset;
|
di->x_ = xOffset;
|
||||||
di->y_ = yOffset;
|
di->y_ = yOffset;
|
||||||
|
p->dirtyIcons_.insert(di);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeoIcons::SetIconLocation(const std::shared_ptr<GeoIconDrawItem>& di,
|
void GeoIcons::SetIconLocation(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
|
|
@ -404,38 +449,64 @@ void GeoIcons::SetIconLocation(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
double longitude,
|
double longitude,
|
||||||
double xOffset,
|
double xOffset,
|
||||||
double yOffset)
|
double yOffset)
|
||||||
|
{
|
||||||
|
if (di->latitude_ != latitude || di->longitude_ != longitude ||
|
||||||
|
di->x_ != xOffset || di->y_ != yOffset)
|
||||||
{
|
{
|
||||||
di->latitude_ = latitude;
|
di->latitude_ = latitude;
|
||||||
di->longitude_ = longitude;
|
di->longitude_ = longitude;
|
||||||
di->x_ = xOffset;
|
di->x_ = xOffset;
|
||||||
di->y_ = yOffset;
|
di->y_ = yOffset;
|
||||||
|
p->dirtyIcons_.insert(di);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeoIcons::SetIconAngle(const std::shared_ptr<GeoIconDrawItem>& di,
|
void GeoIcons::SetIconAngle(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
units::angle::degrees<double> angle)
|
units::angle::degrees<double> angle)
|
||||||
|
{
|
||||||
|
if (di->angle_ != angle)
|
||||||
{
|
{
|
||||||
di->angle_ = angle;
|
di->angle_ = angle;
|
||||||
|
p->dirtyIcons_.insert(di);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeoIcons::SetIconModulate(const std::shared_ptr<GeoIconDrawItem>& di,
|
void GeoIcons::SetIconModulate(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
boost::gil::rgba8_pixel_t modulate)
|
boost::gil::rgba8_pixel_t modulate)
|
||||||
|
{
|
||||||
|
boost::gil::rgba32f_pixel_t newModulate = {modulate[0] / 255.0f,
|
||||||
|
modulate[1] / 255.0f,
|
||||||
|
modulate[2] / 255.0f,
|
||||||
|
modulate[3] / 255.0f};
|
||||||
|
|
||||||
|
if (di->modulate_ != newModulate)
|
||||||
{
|
{
|
||||||
di->modulate_ = {modulate[0] / 255.0f,
|
di->modulate_ = {modulate[0] / 255.0f,
|
||||||
modulate[1] / 255.0f,
|
modulate[1] / 255.0f,
|
||||||
modulate[2] / 255.0f,
|
modulate[2] / 255.0f,
|
||||||
modulate[3] / 255.0f};
|
modulate[3] / 255.0f};
|
||||||
|
p->dirtyIcons_.insert(di);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeoIcons::SetIconModulate(const std::shared_ptr<GeoIconDrawItem>& di,
|
void GeoIcons::SetIconModulate(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
boost::gil::rgba32f_pixel_t modulate)
|
boost::gil::rgba32f_pixel_t modulate)
|
||||||
|
{
|
||||||
|
if (di->modulate_ != modulate)
|
||||||
{
|
{
|
||||||
di->modulate_ = modulate;
|
di->modulate_ = modulate;
|
||||||
|
p->dirtyIcons_.insert(di);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeoIcons::SetIconHoverText(const std::shared_ptr<GeoIconDrawItem>& di,
|
void GeoIcons::SetIconHoverText(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
const std::string& text)
|
const std::string& text)
|
||||||
|
{
|
||||||
|
if (di->hoverText_ != text)
|
||||||
{
|
{
|
||||||
di->hoverText_ = text;
|
di->hoverText_ = text;
|
||||||
|
p->dirtyIcons_.insert(di);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeoIcons::FinishIcons()
|
void GeoIcons::FinishIcons()
|
||||||
|
|
@ -483,9 +554,10 @@ void GeoIcons::Impl::UpdateBuffers()
|
||||||
}
|
}
|
||||||
|
|
||||||
auto& icon = it->second;
|
auto& icon = it->second;
|
||||||
|
di->iconInfo_ = icon;
|
||||||
|
|
||||||
// Validate icon
|
// Validate icon
|
||||||
if (di->iconIndex_ >= icon.numIcons_)
|
if (di->iconIndex_ >= icon->numIcons_)
|
||||||
{
|
{
|
||||||
// No icon found
|
// No icon found
|
||||||
logger_->warn("Invalid icon index: {}", di->iconIndex_);
|
logger_->warn("Invalid icon index: {}", di->iconIndex_);
|
||||||
|
|
@ -495,6 +567,27 @@ void GeoIcons::Impl::UpdateBuffers()
|
||||||
// Icon is valid, add to valid icon list
|
// Icon is valid, add to valid icon list
|
||||||
newValidIconList_.push_back(di);
|
newValidIconList_.push_back(di);
|
||||||
|
|
||||||
|
// Update icon buffer
|
||||||
|
UpdateSingleBuffer(di,
|
||||||
|
newValidIconList_.size() - 1,
|
||||||
|
newIconBuffer_,
|
||||||
|
newIntegerBuffer_,
|
||||||
|
newHoverIcons_);
|
||||||
|
}
|
||||||
|
|
||||||
|
// All icons have been updated
|
||||||
|
dirtyIcons_.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GeoIcons::Impl::UpdateSingleBuffer(
|
||||||
|
const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
|
std::size_t iconIndex,
|
||||||
|
std::vector<float>& iconBuffer,
|
||||||
|
std::vector<GLint>& integerBuffer,
|
||||||
|
std::vector<IconHoverEntry>& hoverIcons)
|
||||||
|
{
|
||||||
|
auto& icon = di->iconInfo_;
|
||||||
|
|
||||||
// Threshold value
|
// Threshold value
|
||||||
units::length::nautical_miles<double> threshold = di->threshold_;
|
units::length::nautical_miles<double> threshold = di->threshold_;
|
||||||
GLint thresholdValue = static_cast<GLint>(std::round(threshold.value()));
|
GLint thresholdValue = static_cast<GLint>(std::round(threshold.value()));
|
||||||
|
|
@ -518,12 +611,12 @@ void GeoIcons::Impl::UpdateBuffers()
|
||||||
const float y = static_cast<float>(di->y_);
|
const float y = static_cast<float>(di->y_);
|
||||||
|
|
||||||
// Icon size
|
// Icon size
|
||||||
const float iw = static_cast<float>(icon.iconWidth_);
|
const float iw = static_cast<float>(icon->iconWidth_);
|
||||||
const float ih = static_cast<float>(icon.iconHeight_);
|
const float ih = static_cast<float>(icon->iconHeight_);
|
||||||
|
|
||||||
// Hot X/Y (zero-based icon center)
|
// Hot X/Y (zero-based icon center)
|
||||||
const float hx = static_cast<float>(icon.hotX_);
|
const float hx = static_cast<float>(icon->hotX_);
|
||||||
const float hy = static_cast<float>(icon.hotY_);
|
const float hy = static_cast<float>(icon->hotY_);
|
||||||
|
|
||||||
// Final X/Y offsets in pixels
|
// Final X/Y offsets in pixels
|
||||||
const float lx = std::roundf(x - hx);
|
const float lx = std::roundf(x - hx);
|
||||||
|
|
@ -541,8 +634,11 @@ void GeoIcons::Impl::UpdateBuffers()
|
||||||
const float mc2 = di->modulate_[2];
|
const float mc2 = di->modulate_[2];
|
||||||
const float mc3 = di->modulate_[3];
|
const float mc3 = di->modulate_[3];
|
||||||
|
|
||||||
newIconBuffer_.insert(newIconBuffer_.end(),
|
// Visibility
|
||||||
{
|
const GLint v = static_cast<GLint>(di->visible_);
|
||||||
|
|
||||||
|
// Icon initialize list data
|
||||||
|
const auto iconData = {
|
||||||
// Icon
|
// Icon
|
||||||
lat, lon, lx, by, mc0, mc1, mc2, mc3, a, // BL
|
lat, lon, lx, by, mc0, mc1, mc2, mc3, a, // BL
|
||||||
lat, lon, lx, ty, mc0, mc1, mc2, mc3, a, // TL
|
lat, lon, lx, ty, mc0, mc1, mc2, mc3, a, // TL
|
||||||
|
|
@ -550,28 +646,53 @@ void GeoIcons::Impl::UpdateBuffers()
|
||||||
lat, lon, rx, by, mc0, mc1, mc2, mc3, a, // BR
|
lat, lon, rx, by, mc0, mc1, mc2, mc3, a, // BR
|
||||||
lat, lon, rx, ty, mc0, mc1, mc2, mc3, a, // TR
|
lat, lon, rx, ty, mc0, mc1, mc2, mc3, a, // TR
|
||||||
lat, lon, lx, ty, mc0, mc1, mc2, mc3, a // TL
|
lat, lon, lx, ty, mc0, mc1, mc2, mc3, a // TL
|
||||||
});
|
};
|
||||||
newIntegerBuffer_.insert(newIntegerBuffer_.end(),
|
const auto integerData = {thresholdValue, startTime, endTime, v,
|
||||||
{thresholdValue,
|
thresholdValue, startTime, endTime, v,
|
||||||
startTime,
|
thresholdValue, startTime, endTime, v,
|
||||||
endTime,
|
thresholdValue, startTime, endTime, v,
|
||||||
thresholdValue,
|
thresholdValue, startTime, endTime, v,
|
||||||
startTime,
|
thresholdValue, startTime, endTime, v};
|
||||||
endTime,
|
|
||||||
thresholdValue,
|
|
||||||
startTime,
|
|
||||||
endTime,
|
|
||||||
thresholdValue,
|
|
||||||
startTime,
|
|
||||||
endTime,
|
|
||||||
thresholdValue,
|
|
||||||
startTime,
|
|
||||||
endTime,
|
|
||||||
thresholdValue,
|
|
||||||
startTime,
|
|
||||||
endTime});
|
|
||||||
|
|
||||||
if (!di->hoverText_.empty())
|
// Buffer position data
|
||||||
|
auto iconBufferPosition = iconBuffer.end();
|
||||||
|
auto iconBufferOffset = iconIndex * kIconBufferLength;
|
||||||
|
|
||||||
|
auto integerBufferPosition = integerBuffer.end();
|
||||||
|
auto integerBufferOffset = iconIndex * kIntegerBufferLength_;
|
||||||
|
|
||||||
|
if (iconBufferOffset < iconBuffer.size())
|
||||||
|
{
|
||||||
|
iconBufferPosition = iconBuffer.begin() + iconBufferOffset;
|
||||||
|
}
|
||||||
|
if (integerBufferOffset < integerBuffer.size())
|
||||||
|
{
|
||||||
|
integerBufferPosition = integerBuffer.begin() + integerBufferOffset;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (iconBufferPosition == iconBuffer.cend())
|
||||||
|
{
|
||||||
|
iconBuffer.insert(iconBufferPosition, iconData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::copy(iconData.begin(), iconData.end(), iconBufferPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (integerBufferPosition == integerBuffer.cend())
|
||||||
|
{
|
||||||
|
integerBuffer.insert(integerBufferPosition, integerData);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
std::copy(integerData.begin(), integerData.end(), integerBufferPosition);
|
||||||
|
}
|
||||||
|
|
||||||
|
auto hoverIt = std::find_if(hoverIcons.begin(),
|
||||||
|
hoverIcons.end(),
|
||||||
|
[&di](auto& entry) { return entry.di_ == di; });
|
||||||
|
|
||||||
|
if (di->visible_ && !di->hoverText_.empty())
|
||||||
{
|
{
|
||||||
const units::angle::radians<double> radians = angle;
|
const units::angle::radians<double> radians = angle;
|
||||||
|
|
||||||
|
|
@ -587,9 +708,21 @@ void GeoIcons::Impl::UpdateBuffers()
|
||||||
const glm::vec2 obl = rotate * glm::vec2 {lx, by};
|
const glm::vec2 obl = rotate * glm::vec2 {lx, by};
|
||||||
const glm::vec2 obr = rotate * glm::vec2 {rx, by};
|
const glm::vec2 obr = rotate * glm::vec2 {rx, by};
|
||||||
|
|
||||||
newHoverIcons_.emplace_back(
|
if (hoverIt == hoverIcons.end())
|
||||||
IconHoverEntry {di, sc, otl, otr, obl, obr});
|
{
|
||||||
|
hoverIcons.emplace_back(IconHoverEntry {di, sc, otl, otr, obl, obr});
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hoverIt->otl_ = otl;
|
||||||
|
hoverIt->otr_ = otr;
|
||||||
|
hoverIt->obl_ = obl;
|
||||||
|
hoverIt->obr_ = obr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (hoverIt != hoverIcons.end())
|
||||||
|
{
|
||||||
|
hoverIcons.erase(hoverIt);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -627,7 +760,7 @@ void GeoIcons::Impl::UpdateTextureBuffer()
|
||||||
auto& icon = it->second;
|
auto& icon = it->second;
|
||||||
|
|
||||||
// Validate icon
|
// Validate icon
|
||||||
if (di->iconIndex_ >= icon.numIcons_)
|
if (di->iconIndex_ >= icon->numIcons_)
|
||||||
{
|
{
|
||||||
// No icon found
|
// No icon found
|
||||||
logger_->error("Invalid icon index: {}", di->iconIndex_);
|
logger_->error("Invalid icon index: {}", di->iconIndex_);
|
||||||
|
|
@ -653,17 +786,17 @@ void GeoIcons::Impl::UpdateTextureBuffer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Texture coordinates
|
// Texture coordinates
|
||||||
const std::size_t iconRow = (di->iconIndex_) / icon.columns_;
|
const std::size_t iconRow = (di->iconIndex_) / icon->columns_;
|
||||||
const std::size_t iconColumn = (di->iconIndex_) % icon.columns_;
|
const std::size_t iconColumn = (di->iconIndex_) % icon->columns_;
|
||||||
|
|
||||||
const float iconX = iconColumn * icon.scaledWidth_;
|
const float iconX = iconColumn * icon->scaledWidth_;
|
||||||
const float iconY = iconRow * icon.scaledHeight_;
|
const float iconY = iconRow * icon->scaledHeight_;
|
||||||
|
|
||||||
const float ls = icon.texture_.sLeft_ + iconX;
|
const float ls = icon->texture_.sLeft_ + iconX;
|
||||||
const float rs = ls + icon.scaledWidth_;
|
const float rs = ls + icon->scaledWidth_;
|
||||||
const float tt = icon.texture_.tTop_ + iconY;
|
const float tt = icon->texture_.tTop_ + iconY;
|
||||||
const float bt = tt + icon.scaledHeight_;
|
const float bt = tt + icon->scaledHeight_;
|
||||||
const float r = static_cast<float>(icon.texture_.layerId_);
|
const float r = static_cast<float>(icon->texture_.layerId_);
|
||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
textureBuffer_.insert(
|
textureBuffer_.insert(
|
||||||
|
|
@ -681,17 +814,51 @@ void GeoIcons::Impl::UpdateTextureBuffer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeoIcons::Impl::UpdateModifiedIconBuffers()
|
||||||
|
{
|
||||||
|
// Update buffers for modified icons
|
||||||
|
for (auto& di : dirtyIcons_)
|
||||||
|
{
|
||||||
|
// Find modified icon in the current list
|
||||||
|
auto it =
|
||||||
|
std::find(currentIconList_.cbegin(), currentIconList_.cend(), di);
|
||||||
|
|
||||||
|
// Ignore invalid icons
|
||||||
|
if (it == currentIconList_.cend())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto iconIndex = std::distance(currentIconList_.cbegin(), it);
|
||||||
|
|
||||||
|
UpdateSingleBuffer(di,
|
||||||
|
iconIndex,
|
||||||
|
currentIconBuffer_,
|
||||||
|
currentIntegerBuffer_,
|
||||||
|
currentHoverIcons_);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Clear list of modified icons
|
||||||
|
if (!dirtyIcons_.empty())
|
||||||
|
{
|
||||||
|
dirtyIcons_.clear();
|
||||||
|
dirty_ = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GeoIcons::Impl::Update(bool textureAtlasChanged)
|
void GeoIcons::Impl::Update(bool textureAtlasChanged)
|
||||||
{
|
{
|
||||||
gl::OpenGLFunctions& gl = context_->gl();
|
gl::OpenGLFunctions& gl = context_->gl();
|
||||||
|
|
||||||
|
UpdateModifiedIconBuffers();
|
||||||
|
|
||||||
// If the texture atlas has changed
|
// If the texture atlas has changed
|
||||||
if (dirty_ || textureAtlasChanged || lastTextureAtlasChanged_)
|
if (dirty_ || textureAtlasChanged || lastTextureAtlasChanged_)
|
||||||
{
|
{
|
||||||
// Update texture coordinates
|
// Update texture coordinates
|
||||||
for (auto& iconSheet : currentIconSheets_)
|
for (auto& iconSheet : currentIconSheets_)
|
||||||
{
|
{
|
||||||
iconSheet.second.UpdateTextureInfo();
|
iconSheet.second->UpdateTextureInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update OpenGL texture buffer data
|
// Update OpenGL texture buffer data
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,13 @@ public:
|
||||||
*/
|
*/
|
||||||
std::shared_ptr<GeoIconDrawItem> AddIcon();
|
std::shared_ptr<GeoIconDrawItem> AddIcon();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param [in] di Geo icon draw item
|
||||||
|
* @param [in] visible Visibility of the icon
|
||||||
|
*/
|
||||||
|
void SetIconVisible(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
|
bool visible);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the texture of a geo icon.
|
* Sets the texture of a geo icon.
|
||||||
*
|
*
|
||||||
|
|
@ -101,7 +108,7 @@ public:
|
||||||
* @param [in] iconSheet The name of the icon sheet in the texture atlas
|
* @param [in] iconSheet The name of the icon sheet in the texture atlas
|
||||||
* @param [in] iconIndex The zero-based index of the icon in the icon sheet
|
* @param [in] iconIndex The zero-based index of the icon in the icon sheet
|
||||||
*/
|
*/
|
||||||
static void SetIconTexture(const std::shared_ptr<GeoIconDrawItem>& di,
|
void SetIconTexture(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
const std::string& iconSheet,
|
const std::string& iconSheet,
|
||||||
std::size_t iconIndex);
|
std::size_t iconIndex);
|
||||||
|
|
||||||
|
|
@ -114,7 +121,7 @@ public:
|
||||||
* @param [in] xOffset The x-offset of the geo icon in pixels. Default is 0.
|
* @param [in] xOffset The x-offset of the geo icon in pixels. Default is 0.
|
||||||
* @param [in] yOffset The y-offset of the geo icon in pixels. Default is 0.
|
* @param [in] yOffset The y-offset of the geo icon in pixels. Default is 0.
|
||||||
*/
|
*/
|
||||||
static void SetIconLocation(const std::shared_ptr<GeoIconDrawItem>& di,
|
void SetIconLocation(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
units::angle::degrees<double> latitude,
|
units::angle::degrees<double> latitude,
|
||||||
units::angle::degrees<double> longitude,
|
units::angle::degrees<double> longitude,
|
||||||
double xOffset = 0.0,
|
double xOffset = 0.0,
|
||||||
|
|
@ -129,7 +136,7 @@ public:
|
||||||
* @param [in] xOffset The x-offset of the geo icon in pixels. Default is 0.
|
* @param [in] xOffset The x-offset of the geo icon in pixels. Default is 0.
|
||||||
* @param [in] yOffset The y-offset of the geo icon in pixels. Default is 0.
|
* @param [in] yOffset The y-offset of the geo icon in pixels. Default is 0.
|
||||||
*/
|
*/
|
||||||
static void SetIconLocation(const std::shared_ptr<GeoIconDrawItem>& di,
|
void SetIconLocation(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
double latitude,
|
double latitude,
|
||||||
double longitude,
|
double longitude,
|
||||||
double xOffset = 0.0,
|
double xOffset = 0.0,
|
||||||
|
|
@ -141,7 +148,7 @@ public:
|
||||||
* @param [in] di Geo icon draw item
|
* @param [in] di Geo icon draw item
|
||||||
* @param [in] angle Angle in degrees
|
* @param [in] angle Angle in degrees
|
||||||
*/
|
*/
|
||||||
static void SetIconAngle(const std::shared_ptr<GeoIconDrawItem>& di,
|
void SetIconAngle(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
units::angle::degrees<double> angle);
|
units::angle::degrees<double> angle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -150,7 +157,7 @@ public:
|
||||||
* @param [in] di Geo icon draw item
|
* @param [in] di Geo icon draw item
|
||||||
* @param [in] modulate Modulate color
|
* @param [in] modulate Modulate color
|
||||||
*/
|
*/
|
||||||
static void SetIconModulate(const std::shared_ptr<GeoIconDrawItem>& di,
|
void SetIconModulate(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
boost::gil::rgba8_pixel_t modulate);
|
boost::gil::rgba8_pixel_t modulate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -159,7 +166,7 @@ public:
|
||||||
* @param [in] di Geo icon draw item
|
* @param [in] di Geo icon draw item
|
||||||
* @param [in] modulate Modulate color
|
* @param [in] modulate Modulate color
|
||||||
*/
|
*/
|
||||||
static void SetIconModulate(const std::shared_ptr<GeoIconDrawItem>& di,
|
void SetIconModulate(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
boost::gil::rgba32f_pixel_t modulate);
|
boost::gil::rgba32f_pixel_t modulate);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -168,7 +175,7 @@ public:
|
||||||
* @param [in] di Geo icon draw item
|
* @param [in] di Geo icon draw item
|
||||||
* @param [in] text Hover text
|
* @param [in] text Hover text
|
||||||
*/
|
*/
|
||||||
static void SetIconHoverText(const std::shared_ptr<GeoIconDrawItem>& di,
|
void SetIconHoverText(const std::shared_ptr<GeoIconDrawItem>& di,
|
||||||
const std::string& text);
|
const std::string& text);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -137,6 +137,7 @@ void GeoLines::set_thresholded(bool thresholded)
|
||||||
void GeoLines::Initialize()
|
void GeoLines::Initialize()
|
||||||
{
|
{
|
||||||
gl::OpenGLFunctions& gl = p->context_->gl();
|
gl::OpenGLFunctions& gl = p->context_->gl();
|
||||||
|
auto& gl30 = p->context_->gl30();
|
||||||
|
|
||||||
p->shaderProgram_ = p->context_->GetShaderProgram(
|
p->shaderProgram_ = p->context_->GetShaderProgram(
|
||||||
{{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"},
|
{{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"},
|
||||||
|
|
@ -215,6 +216,9 @@ void GeoLines::Initialize()
|
||||||
reinterpret_cast<void*>(1 * sizeof(GLint)));
|
reinterpret_cast<void*>(1 * sizeof(GLint)));
|
||||||
gl.glEnableVertexAttribArray(6);
|
gl.glEnableVertexAttribArray(6);
|
||||||
|
|
||||||
|
// aDisplayed
|
||||||
|
gl30.glVertexAttribI1i(7, 1);
|
||||||
|
|
||||||
p->dirty_ = true;
|
p->dirty_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,7 @@ void Icons::Initialize()
|
||||||
reinterpret_cast<void*>(8 * sizeof(float)));
|
reinterpret_cast<void*>(8 * sizeof(float)));
|
||||||
gl.glEnableVertexAttribArray(4);
|
gl.glEnableVertexAttribArray(4);
|
||||||
|
|
||||||
// aAngle
|
// aDisplayed
|
||||||
gl.glVertexAttribPointer(5,
|
gl.glVertexAttribPointer(5,
|
||||||
1,
|
1,
|
||||||
GL_FLOAT,
|
GL_FLOAT,
|
||||||
|
|
@ -315,59 +315,82 @@ std::shared_ptr<IconDrawItem> Icons::AddIcon()
|
||||||
|
|
||||||
void Icons::SetIconVisible(const std::shared_ptr<IconDrawItem>& di,
|
void Icons::SetIconVisible(const std::shared_ptr<IconDrawItem>& di,
|
||||||
bool visible)
|
bool visible)
|
||||||
|
{
|
||||||
|
if (di->visible_ != visible)
|
||||||
{
|
{
|
||||||
di->visible_ = visible;
|
di->visible_ = visible;
|
||||||
p->dirtyIcons_.insert(di);
|
p->dirtyIcons_.insert(di);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Icons::SetIconTexture(const std::shared_ptr<IconDrawItem>& di,
|
void Icons::SetIconTexture(const std::shared_ptr<IconDrawItem>& di,
|
||||||
const std::string& iconSheet,
|
const std::string& iconSheet,
|
||||||
std::size_t iconIndex)
|
std::size_t iconIndex)
|
||||||
|
{
|
||||||
|
if (di->iconSheet_ != iconSheet || di->iconIndex_ != iconIndex)
|
||||||
{
|
{
|
||||||
di->iconSheet_ = iconSheet;
|
di->iconSheet_ = iconSheet;
|
||||||
di->iconIndex_ = iconIndex;
|
di->iconIndex_ = iconIndex;
|
||||||
p->dirtyIcons_.insert(di);
|
p->dirtyIcons_.insert(di);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Icons::SetIconLocation(const std::shared_ptr<IconDrawItem>& di,
|
void Icons::SetIconLocation(const std::shared_ptr<IconDrawItem>& di,
|
||||||
double x,
|
double x,
|
||||||
double y)
|
double y)
|
||||||
|
{
|
||||||
|
if (di->x_ != x || di->y_ != y)
|
||||||
{
|
{
|
||||||
di->x_ = x;
|
di->x_ = x;
|
||||||
di->y_ = y;
|
di->y_ = y;
|
||||||
p->dirtyIcons_.insert(di);
|
p->dirtyIcons_.insert(di);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Icons::SetIconAngle(const std::shared_ptr<IconDrawItem>& di,
|
void Icons::SetIconAngle(const std::shared_ptr<IconDrawItem>& di,
|
||||||
units::angle::degrees<double> angle)
|
units::angle::degrees<double> angle)
|
||||||
|
{
|
||||||
|
if (di->angle_ != angle)
|
||||||
{
|
{
|
||||||
di->angle_ = angle;
|
di->angle_ = angle;
|
||||||
p->dirtyIcons_.insert(di);
|
p->dirtyIcons_.insert(di);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Icons::SetIconModulate(const std::shared_ptr<IconDrawItem>& di,
|
void Icons::SetIconModulate(const std::shared_ptr<IconDrawItem>& di,
|
||||||
boost::gil::rgba8_pixel_t modulate)
|
boost::gil::rgba8_pixel_t modulate)
|
||||||
{
|
{
|
||||||
di->modulate_ = {modulate[0] / 255.0f,
|
boost::gil::rgba32f_pixel_t newModulate = {modulate[0] / 255.0f,
|
||||||
modulate[1] / 255.0f,
|
modulate[1] / 255.0f,
|
||||||
modulate[2] / 255.0f,
|
modulate[2] / 255.0f,
|
||||||
modulate[3] / 255.0f};
|
modulate[3] / 255.0f};
|
||||||
|
|
||||||
|
if (di->modulate_ != newModulate)
|
||||||
|
{
|
||||||
|
di->modulate_ = newModulate;
|
||||||
p->dirtyIcons_.insert(di);
|
p->dirtyIcons_.insert(di);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Icons::SetIconModulate(const std::shared_ptr<IconDrawItem>& di,
|
void Icons::SetIconModulate(const std::shared_ptr<IconDrawItem>& di,
|
||||||
boost::gil::rgba32f_pixel_t modulate)
|
boost::gil::rgba32f_pixel_t modulate)
|
||||||
|
{
|
||||||
|
if (di->modulate_ != modulate)
|
||||||
{
|
{
|
||||||
di->modulate_ = modulate;
|
di->modulate_ = modulate;
|
||||||
p->dirtyIcons_.insert(di);
|
p->dirtyIcons_.insert(di);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Icons::SetIconHoverText(const std::shared_ptr<IconDrawItem>& di,
|
void Icons::SetIconHoverText(const std::shared_ptr<IconDrawItem>& di,
|
||||||
const std::string& text)
|
const std::string& text)
|
||||||
|
{
|
||||||
|
if (di->hoverText_ != text)
|
||||||
{
|
{
|
||||||
di->hoverText_ = text;
|
di->hoverText_ = text;
|
||||||
p->dirtyIcons_.insert(di);
|
p->dirtyIcons_.insert(di);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Icons::FinishIcons()
|
void Icons::FinishIcons()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -162,6 +162,7 @@ void PlacefileIcons::set_thresholded(bool thresholded)
|
||||||
void PlacefileIcons::Initialize()
|
void PlacefileIcons::Initialize()
|
||||||
{
|
{
|
||||||
gl::OpenGLFunctions& gl = p->context_->gl();
|
gl::OpenGLFunctions& gl = p->context_->gl();
|
||||||
|
auto& gl30 = p->context_->gl30();
|
||||||
|
|
||||||
p->shaderProgram_ = p->context_->GetShaderProgram(
|
p->shaderProgram_ = p->context_->GetShaderProgram(
|
||||||
{{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"},
|
{{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"},
|
||||||
|
|
@ -251,6 +252,9 @@ void PlacefileIcons::Initialize()
|
||||||
reinterpret_cast<void*>(1 * sizeof(GLint)));
|
reinterpret_cast<void*>(1 * sizeof(GLint)));
|
||||||
gl.glEnableVertexAttribArray(6);
|
gl.glEnableVertexAttribArray(6);
|
||||||
|
|
||||||
|
// aDisplayed
|
||||||
|
gl30.glVertexAttribI1i(7, 1);
|
||||||
|
|
||||||
p->dirty_ = true;
|
p->dirty_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,6 +140,7 @@ void PlacefileImages::set_thresholded(bool thresholded)
|
||||||
void PlacefileImages::Initialize()
|
void PlacefileImages::Initialize()
|
||||||
{
|
{
|
||||||
gl::OpenGLFunctions& gl = p->context_->gl();
|
gl::OpenGLFunctions& gl = p->context_->gl();
|
||||||
|
auto& gl30 = p->context_->gl30();
|
||||||
|
|
||||||
p->shaderProgram_ = p->context_->GetShaderProgram(
|
p->shaderProgram_ = p->context_->GetShaderProgram(
|
||||||
{{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"},
|
{{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"},
|
||||||
|
|
@ -220,6 +221,9 @@ void PlacefileImages::Initialize()
|
||||||
reinterpret_cast<void*>(1 * sizeof(GLint)));
|
reinterpret_cast<void*>(1 * sizeof(GLint)));
|
||||||
gl.glEnableVertexAttribArray(6);
|
gl.glEnableVertexAttribArray(6);
|
||||||
|
|
||||||
|
// aDisplayed
|
||||||
|
gl30.glVertexAttribI1i(7, 1);
|
||||||
|
|
||||||
p->dirty_ = true;
|
p->dirty_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -132,6 +132,7 @@ void PlacefileLines::set_thresholded(bool thresholded)
|
||||||
void PlacefileLines::Initialize()
|
void PlacefileLines::Initialize()
|
||||||
{
|
{
|
||||||
gl::OpenGLFunctions& gl = p->context_->gl();
|
gl::OpenGLFunctions& gl = p->context_->gl();
|
||||||
|
auto& gl30 = p->context_->gl30();
|
||||||
|
|
||||||
p->shaderProgram_ = p->context_->GetShaderProgram(
|
p->shaderProgram_ = p->context_->GetShaderProgram(
|
||||||
{{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"},
|
{{GL_VERTEX_SHADER, ":/gl/geo_texture2d.vert"},
|
||||||
|
|
@ -209,6 +210,9 @@ void PlacefileLines::Initialize()
|
||||||
reinterpret_cast<void*>(1 * sizeof(GLint)));
|
reinterpret_cast<void*>(1 * sizeof(GLint)));
|
||||||
gl.glEnableVertexAttribArray(6);
|
gl.glEnableVertexAttribArray(6);
|
||||||
|
|
||||||
|
// aDisplayed
|
||||||
|
gl30.glVertexAttribI1i(7, 1);
|
||||||
|
|
||||||
p->dirty_ = true;
|
p->dirty_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,7 @@ public:
|
||||||
GetShaderKey(std::initializer_list<std::pair<GLenum, std::string>> shaders);
|
GetShaderKey(std::initializer_list<std::pair<GLenum, std::string>> shaders);
|
||||||
|
|
||||||
gl::OpenGLFunctions gl_;
|
gl::OpenGLFunctions gl_;
|
||||||
|
QOpenGLFunctions_3_0 gl30_;
|
||||||
|
|
||||||
bool glInitialized_ {false};
|
bool glInitialized_ {false};
|
||||||
|
|
||||||
|
|
@ -56,6 +57,11 @@ gl::OpenGLFunctions& GlContext::gl()
|
||||||
return p->gl_;
|
return p->gl_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QOpenGLFunctions_3_0& GlContext::gl30()
|
||||||
|
{
|
||||||
|
return p->gl30_;
|
||||||
|
}
|
||||||
|
|
||||||
std::uint64_t GlContext::texture_buffer_count() const
|
std::uint64_t GlContext::texture_buffer_count() const
|
||||||
{
|
{
|
||||||
return p->textureBufferCount_;
|
return p->textureBufferCount_;
|
||||||
|
|
@ -68,6 +74,9 @@ void GlContext::Impl::InitializeGL()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
gl_.initializeOpenGLFunctions();
|
||||||
|
gl30_.initializeOpenGLFunctions();
|
||||||
|
|
||||||
gl_.glGenTextures(1, &textureAtlas_);
|
gl_.glGenTextures(1, &textureAtlas_);
|
||||||
|
|
||||||
glInitialized_ = true;
|
glInitialized_ = true;
|
||||||
|
|
@ -122,6 +131,11 @@ GLuint GlContext::GetTextureAtlas()
|
||||||
return p->textureAtlas_;
|
return p->textureAtlas_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GlContext::Initialize()
|
||||||
|
{
|
||||||
|
p->InitializeGL();
|
||||||
|
}
|
||||||
|
|
||||||
std::size_t GlContext::Impl::GetShaderKey(
|
std::size_t GlContext::Impl::GetShaderKey(
|
||||||
std::initializer_list<std::pair<GLenum, std::string>> shaders)
|
std::initializer_list<std::pair<GLenum, std::string>> shaders)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
#include <scwx/qt/gl/gl.hpp>
|
#include <scwx/qt/gl/gl.hpp>
|
||||||
#include <scwx/qt/gl/shader_program.hpp>
|
#include <scwx/qt/gl/shader_program.hpp>
|
||||||
|
|
||||||
|
#include <QOpenGLFunctions_3_0>
|
||||||
|
|
||||||
namespace scwx
|
namespace scwx
|
||||||
{
|
{
|
||||||
namespace qt
|
namespace qt
|
||||||
|
|
@ -23,6 +25,7 @@ public:
|
||||||
GlContext& operator=(GlContext&&) noexcept;
|
GlContext& operator=(GlContext&&) noexcept;
|
||||||
|
|
||||||
gl::OpenGLFunctions& gl();
|
gl::OpenGLFunctions& gl();
|
||||||
|
QOpenGLFunctions_3_0& gl30();
|
||||||
|
|
||||||
std::uint64_t texture_buffer_count() const;
|
std::uint64_t texture_buffer_count() const;
|
||||||
|
|
||||||
|
|
@ -34,6 +37,8 @@ public:
|
||||||
|
|
||||||
GLuint GetTextureAtlas();
|
GLuint GetTextureAtlas();
|
||||||
|
|
||||||
|
void Initialize();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Impl;
|
class Impl;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -824,6 +824,11 @@ void MainWindowImpl::ConnectMapSignals()
|
||||||
coordinateLabel_->setText(
|
coordinateLabel_->setText(
|
||||||
QString("%1, %2").arg(latitude).arg(longitude));
|
QString("%1, %2").arg(latitude).arg(longitude));
|
||||||
coordinateLabel_->setVisible(true);
|
coordinateLabel_->setVisible(true);
|
||||||
|
|
||||||
|
for (auto& map : maps_)
|
||||||
|
{
|
||||||
|
map->UpdateMouseCoordinate(coordinate);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,7 @@ public:
|
||||||
std::string mapCopyrights_ {};
|
std::string mapCopyrights_ {};
|
||||||
|
|
||||||
QMargins colorTableMargins_ {};
|
QMargins colorTableMargins_ {};
|
||||||
|
common::Coordinate mouseCoordinate_ {};
|
||||||
|
|
||||||
std::shared_ptr<view::OverlayProductView> overlayProductView_ {nullptr};
|
std::shared_ptr<view::OverlayProductView> overlayProductView_ {nullptr};
|
||||||
std::shared_ptr<view::RadarProductView> radarProductView_;
|
std::shared_ptr<view::RadarProductView> radarProductView_;
|
||||||
|
|
@ -78,6 +79,11 @@ float MapContext::pixel_ratio() const
|
||||||
return p->pixelRatio_;
|
return p->pixelRatio_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
common::Coordinate MapContext::mouse_coordinate() const
|
||||||
|
{
|
||||||
|
return p->mouseCoordinate_;
|
||||||
|
}
|
||||||
|
|
||||||
std::shared_ptr<view::OverlayProductView>
|
std::shared_ptr<view::OverlayProductView>
|
||||||
MapContext::overlay_product_view() const
|
MapContext::overlay_product_view() const
|
||||||
{
|
{
|
||||||
|
|
@ -129,6 +135,11 @@ void MapContext::set_color_table_margins(const QMargins& margins)
|
||||||
p->colorTableMargins_ = margins;
|
p->colorTableMargins_ = margins;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MapContext::set_mouse_coordinate(const common::Coordinate& coordinate)
|
||||||
|
{
|
||||||
|
p->mouseCoordinate_ = coordinate;
|
||||||
|
}
|
||||||
|
|
||||||
void MapContext::set_overlay_product_view(
|
void MapContext::set_overlay_product_view(
|
||||||
const std::shared_ptr<view::OverlayProductView>& overlayProductView)
|
const std::shared_ptr<view::OverlayProductView>& overlayProductView)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include <scwx/qt/gl/gl_context.hpp>
|
#include <scwx/qt/gl/gl_context.hpp>
|
||||||
#include <scwx/qt/map/map_provider.hpp>
|
#include <scwx/qt/map/map_provider.hpp>
|
||||||
|
#include <scwx/common/geographic.hpp>
|
||||||
#include <scwx/common/products.hpp>
|
#include <scwx/common/products.hpp>
|
||||||
|
|
||||||
#include <qmaplibre.hpp>
|
#include <qmaplibre.hpp>
|
||||||
|
|
@ -43,6 +44,7 @@ public:
|
||||||
MapSettings& settings();
|
MapSettings& settings();
|
||||||
QMargins color_table_margins() const;
|
QMargins color_table_margins() const;
|
||||||
float pixel_ratio() const;
|
float pixel_ratio() const;
|
||||||
|
common::Coordinate mouse_coordinate() const;
|
||||||
std::shared_ptr<view::OverlayProductView> overlay_product_view() const;
|
std::shared_ptr<view::OverlayProductView> overlay_product_view() const;
|
||||||
std::shared_ptr<view::RadarProductView> radar_product_view() const;
|
std::shared_ptr<view::RadarProductView> radar_product_view() const;
|
||||||
common::RadarProductGroup radar_product_group() const;
|
common::RadarProductGroup radar_product_group() const;
|
||||||
|
|
@ -54,6 +56,7 @@ public:
|
||||||
void set_map_copyrights(const std::string& copyrights);
|
void set_map_copyrights(const std::string& copyrights);
|
||||||
void set_map_provider(MapProvider provider);
|
void set_map_provider(MapProvider provider);
|
||||||
void set_color_table_margins(const QMargins& margins);
|
void set_color_table_margins(const QMargins& margins);
|
||||||
|
void set_mouse_coordinate(const common::Coordinate& coordinate);
|
||||||
void set_overlay_product_view(
|
void set_overlay_product_view(
|
||||||
const std::shared_ptr<view::OverlayProductView>& overlayProductView);
|
const std::shared_ptr<view::OverlayProductView>& overlayProductView);
|
||||||
void set_pixel_ratio(float pixelRatio);
|
void set_pixel_ratio(float pixelRatio);
|
||||||
|
|
|
||||||
|
|
@ -224,6 +224,9 @@ public:
|
||||||
const MapStyle* currentStyle_;
|
const MapStyle* currentStyle_;
|
||||||
std::string initialStyleName_ {};
|
std::string initialStyleName_ {};
|
||||||
|
|
||||||
|
Qt::KeyboardModifiers lastKeyboardModifiers_ {
|
||||||
|
Qt::KeyboardModifier::NoModifier};
|
||||||
|
|
||||||
std::shared_ptr<types::EventHandler> pickedEventHandler_ {nullptr};
|
std::shared_ptr<types::EventHandler> pickedEventHandler_ {nullptr};
|
||||||
|
|
||||||
uint64_t frameDraws_;
|
uint64_t frameDraws_;
|
||||||
|
|
@ -940,6 +943,24 @@ void MapWidget::SetMapStyle(const std::string& styleName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MapWidget::UpdateMouseCoordinate(const common::Coordinate& coordinate)
|
||||||
|
{
|
||||||
|
if (p->context_->mouse_coordinate() != coordinate)
|
||||||
|
{
|
||||||
|
p->context_->set_mouse_coordinate(coordinate);
|
||||||
|
|
||||||
|
auto keyboardModifiers = QGuiApplication::keyboardModifiers();
|
||||||
|
|
||||||
|
if (keyboardModifiers != Qt::KeyboardModifier::NoModifier ||
|
||||||
|
keyboardModifiers != p->lastKeyboardModifiers_)
|
||||||
|
{
|
||||||
|
update();
|
||||||
|
}
|
||||||
|
|
||||||
|
p->lastKeyboardModifiers_ = keyboardModifiers;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
qreal MapWidget::pixelRatio()
|
qreal MapWidget::pixelRatio()
|
||||||
{
|
{
|
||||||
return devicePixelRatioF();
|
return devicePixelRatioF();
|
||||||
|
|
@ -1311,7 +1332,7 @@ void MapWidget::initializeGL()
|
||||||
logger_->debug("initializeGL()");
|
logger_->debug("initializeGL()");
|
||||||
|
|
||||||
makeCurrent();
|
makeCurrent();
|
||||||
p->context_->gl().initializeOpenGLFunctions();
|
p->context_->Initialize();
|
||||||
|
|
||||||
// Lock ImGui font atlas prior to new ImGui frame
|
// Lock ImGui font atlas prior to new ImGui frame
|
||||||
std::shared_lock imguiFontAtlasLock {
|
std::shared_lock imguiFontAtlasLock {
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,13 @@ public:
|
||||||
void SetInitialMapStyle(const std::string& styleName);
|
void SetInitialMapStyle(const std::string& styleName);
|
||||||
void SetMapStyle(const std::string& styleName);
|
void SetMapStyle(const std::string& styleName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Updates the coordinates associated with mouse movement from another map.
|
||||||
|
*
|
||||||
|
* @param [in] coordinate Coordinate of the mouse
|
||||||
|
*/
|
||||||
|
void UpdateMouseCoordinate(const common::Coordinate& coordinate);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void changeStyle();
|
void changeStyle();
|
||||||
qreal pixelRatio();
|
qreal pixelRatio();
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include <imgui.h>
|
#include <imgui.h>
|
||||||
#include <QGeoPositionInfo>
|
#include <QGeoPositionInfo>
|
||||||
|
#include <QGuiApplication>
|
||||||
#include <QMouseEvent>
|
#include <QMouseEvent>
|
||||||
|
|
||||||
#if !defined(_MSC_VER)
|
#if !defined(_MSC_VER)
|
||||||
|
|
@ -69,6 +70,9 @@ public:
|
||||||
showMapAttributionCallbackUuid_ =
|
showMapAttributionCallbackUuid_ =
|
||||||
generalSettings.show_map_attribution().RegisterValueChangedCallback(
|
generalSettings.show_map_attribution().RegisterValueChangedCallback(
|
||||||
[this](const bool&) { Q_EMIT self_->NeedsRendering(); });
|
[this](const bool&) { Q_EMIT self_->NeedsRendering(); });
|
||||||
|
showMapCenterCallbackUuid_ =
|
||||||
|
generalSettings.show_map_center().RegisterValueChangedCallback(
|
||||||
|
[this](const bool&) { Q_EMIT self_->NeedsRendering(); });
|
||||||
showMapLogoCallbackUuid_ =
|
showMapLogoCallbackUuid_ =
|
||||||
generalSettings.show_map_logo().RegisterValueChangedCallback(
|
generalSettings.show_map_logo().RegisterValueChangedCallback(
|
||||||
[this](const bool&) { Q_EMIT self_->NeedsRendering(); });
|
[this](const bool&) { Q_EMIT self_->NeedsRendering(); });
|
||||||
|
|
@ -84,6 +88,8 @@ public:
|
||||||
defaultTimeZoneCallbackUuid_);
|
defaultTimeZoneCallbackUuid_);
|
||||||
generalSettings.show_map_attribution().UnregisterValueChangedCallback(
|
generalSettings.show_map_attribution().UnregisterValueChangedCallback(
|
||||||
showMapAttributionCallbackUuid_);
|
showMapAttributionCallbackUuid_);
|
||||||
|
generalSettings.show_map_center().UnregisterValueChangedCallback(
|
||||||
|
showMapCenterCallbackUuid_);
|
||||||
generalSettings.show_map_logo().UnregisterValueChangedCallback(
|
generalSettings.show_map_logo().UnregisterValueChangedCallback(
|
||||||
showMapLogoCallbackUuid_);
|
showMapLogoCallbackUuid_);
|
||||||
}
|
}
|
||||||
|
|
@ -93,6 +99,7 @@ public:
|
||||||
boost::uuids::uuid clockFormatCallbackUuid_;
|
boost::uuids::uuid clockFormatCallbackUuid_;
|
||||||
boost::uuids::uuid defaultTimeZoneCallbackUuid_;
|
boost::uuids::uuid defaultTimeZoneCallbackUuid_;
|
||||||
boost::uuids::uuid showMapAttributionCallbackUuid_;
|
boost::uuids::uuid showMapAttributionCallbackUuid_;
|
||||||
|
boost::uuids::uuid showMapCenterCallbackUuid_;
|
||||||
boost::uuids::uuid showMapLogoCallbackUuid_;
|
boost::uuids::uuid showMapLogoCallbackUuid_;
|
||||||
|
|
||||||
std::shared_ptr<manager::PositionManager> positionManager_ {
|
std::shared_ptr<manager::PositionManager> positionManager_ {
|
||||||
|
|
@ -108,10 +115,16 @@ public:
|
||||||
types::GetTextureName(types::ImageTexture::Crosshairs24)};
|
types::GetTextureName(types::ImageTexture::Crosshairs24)};
|
||||||
std::shared_ptr<gl::draw::GeoIconDrawItem> locationIcon_ {};
|
std::shared_ptr<gl::draw::GeoIconDrawItem> locationIcon_ {};
|
||||||
|
|
||||||
|
std::shared_ptr<gl::draw::GeoIconDrawItem> cursorIcon_ {};
|
||||||
|
|
||||||
const std::string& cardinalPointIconName_ {
|
const std::string& cardinalPointIconName_ {
|
||||||
types::GetTextureName(types::ImageTexture::CardinalPoint24)};
|
types::GetTextureName(types::ImageTexture::CardinalPoint24)};
|
||||||
const std::string& compassIconName_ {
|
const std::string& compassIconName_ {
|
||||||
types::GetTextureName(types::ImageTexture::Compass24)};
|
types::GetTextureName(types::ImageTexture::Compass24)};
|
||||||
|
const std::string& cursorIconName_ {
|
||||||
|
types::GetTextureName(types::ImageTexture::Dot3)};
|
||||||
|
const std::string& mapCenterIconName_ {
|
||||||
|
types::GetTextureName(types::ImageTexture::Cursor17)};
|
||||||
|
|
||||||
const std::string& mapboxLogoImageName_ {
|
const std::string& mapboxLogoImageName_ {
|
||||||
types::GetTextureName(types::ImageTexture::MapboxLogo)};
|
types::GetTextureName(types::ImageTexture::MapboxLogo)};
|
||||||
|
|
@ -119,6 +132,7 @@ public:
|
||||||
types::GetTextureName(types::ImageTexture::MapTilerLogo)};
|
types::GetTextureName(types::ImageTexture::MapTilerLogo)};
|
||||||
|
|
||||||
std::shared_ptr<gl::draw::IconDrawItem> compassIcon_ {};
|
std::shared_ptr<gl::draw::IconDrawItem> compassIcon_ {};
|
||||||
|
std::shared_ptr<gl::draw::IconDrawItem> mapCenterIcon_ {};
|
||||||
double lastBearing_ {0.0};
|
double lastBearing_ {0.0};
|
||||||
|
|
||||||
std::shared_ptr<gl::draw::IconDrawItem> mapLogoIcon_ {};
|
std::shared_ptr<gl::draw::IconDrawItem> mapLogoIcon_ {};
|
||||||
|
|
@ -168,23 +182,29 @@ void OverlayLayer::Initialize()
|
||||||
|
|
||||||
// Geo Icons
|
// Geo Icons
|
||||||
p->geoIcons_->StartIconSheets();
|
p->geoIcons_->StartIconSheets();
|
||||||
|
p->geoIcons_->AddIconSheet(p->cursorIconName_);
|
||||||
p->geoIcons_->AddIconSheet(p->locationIconName_);
|
p->geoIcons_->AddIconSheet(p->locationIconName_);
|
||||||
p->geoIcons_->FinishIconSheets();
|
p->geoIcons_->FinishIconSheets();
|
||||||
|
|
||||||
p->geoIcons_->StartIcons();
|
p->geoIcons_->StartIcons();
|
||||||
|
|
||||||
|
p->cursorIcon_ = p->geoIcons_->AddIcon();
|
||||||
|
p->geoIcons_->SetIconTexture(p->cursorIcon_, p->cursorIconName_, 0);
|
||||||
|
|
||||||
p->locationIcon_ = p->geoIcons_->AddIcon();
|
p->locationIcon_ = p->geoIcons_->AddIcon();
|
||||||
gl::draw::GeoIcons::SetIconTexture(
|
p->geoIcons_->SetIconTexture(p->locationIcon_, p->locationIconName_, 0);
|
||||||
p->locationIcon_, p->locationIconName_, 0);
|
p->geoIcons_->SetIconAngle(p->locationIcon_,
|
||||||
gl::draw::GeoIcons::SetIconAngle(p->locationIcon_,
|
|
||||||
units::angle::degrees<double> {45.0});
|
units::angle::degrees<double> {45.0});
|
||||||
gl::draw::GeoIcons::SetIconLocation(
|
p->geoIcons_->SetIconLocation(
|
||||||
p->locationIcon_, coordinate.latitude(), coordinate.longitude());
|
p->locationIcon_, coordinate.latitude(), coordinate.longitude());
|
||||||
|
|
||||||
p->geoIcons_->FinishIcons();
|
p->geoIcons_->FinishIcons();
|
||||||
|
|
||||||
// Icons
|
// Icons
|
||||||
p->icons_->StartIconSheets();
|
p->icons_->StartIconSheets();
|
||||||
p->icons_->AddIconSheet(p->cardinalPointIconName_);
|
p->icons_->AddIconSheet(p->cardinalPointIconName_);
|
||||||
p->icons_->AddIconSheet(p->compassIconName_);
|
p->icons_->AddIconSheet(p->compassIconName_);
|
||||||
|
p->icons_->AddIconSheet(p->mapCenterIconName_);
|
||||||
p->icons_->AddIconSheet(p->mapboxLogoImageName_)->SetAnchor(0.0f, 1.0f);
|
p->icons_->AddIconSheet(p->mapboxLogoImageName_)->SetAnchor(0.0f, 1.0f);
|
||||||
p->icons_->AddIconSheet(p->mapTilerLogoImageName_)->SetAnchor(0.0f, 1.0f);
|
p->icons_->AddIconSheet(p->mapTilerLogoImageName_)->SetAnchor(0.0f, 1.0f);
|
||||||
p->icons_->FinishIconSheets();
|
p->icons_->FinishIconSheets();
|
||||||
|
|
@ -234,6 +254,9 @@ void OverlayLayer::Initialize()
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
p->mapCenterIcon_ = p->icons_->AddIcon();
|
||||||
|
p->icons_->SetIconTexture(p->mapCenterIcon_, p->mapCenterIconName_, 0);
|
||||||
|
|
||||||
p->mapLogoIcon_ = p->icons_->AddIcon();
|
p->mapLogoIcon_ = p->icons_->AddIcon();
|
||||||
if (context()->map_provider() == MapProvider::Mapbox)
|
if (context()->map_provider() == MapProvider::Mapbox)
|
||||||
{
|
{
|
||||||
|
|
@ -259,10 +282,9 @@ void OverlayLayer::Initialize()
|
||||||
if (position.isValid() &&
|
if (position.isValid() &&
|
||||||
p->currentPosition_.coordinate() != coordinate)
|
p->currentPosition_.coordinate() != coordinate)
|
||||||
{
|
{
|
||||||
gl::draw::GeoIcons::SetIconLocation(p->locationIcon_,
|
p->geoIcons_->SetIconLocation(p->locationIcon_,
|
||||||
coordinate.latitude(),
|
coordinate.latitude(),
|
||||||
coordinate.longitude());
|
coordinate.longitude());
|
||||||
p->geoIcons_->FinishIcons();
|
|
||||||
Q_EMIT NeedsRendering();
|
Q_EMIT NeedsRendering();
|
||||||
}
|
}
|
||||||
p->currentPosition_ = position;
|
p->currentPosition_ = position;
|
||||||
|
|
@ -315,8 +337,20 @@ void OverlayLayer::Render(const QMapLibre::CustomLayerRenderParameters& params)
|
||||||
p->activeBoxInner_->SetBorder(1.0f * pixelRatio, {255, 255, 255, 255});
|
p->activeBoxInner_->SetBorder(1.0f * pixelRatio, {255, 255, 255, 255});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cursor Icon
|
||||||
|
bool cursorIconVisible = QGuiApplication::keyboardModifiers() &
|
||||||
|
Qt::KeyboardModifier::ControlModifier;
|
||||||
|
p->geoIcons_->SetIconVisible(p->cursorIcon_, cursorIconVisible);
|
||||||
|
if (cursorIconVisible)
|
||||||
|
{
|
||||||
|
common::Coordinate mouseCoordinate = context()->mouse_coordinate();
|
||||||
|
p->geoIcons_->SetIconLocation(
|
||||||
|
p->cursorIcon_, mouseCoordinate.latitude_, mouseCoordinate.longitude_);
|
||||||
|
}
|
||||||
|
|
||||||
// Location Icon
|
// Location Icon
|
||||||
p->geoIcons_->SetVisible(p->currentPosition_.isValid() &&
|
p->geoIcons_->SetIconVisible(p->locationIcon_,
|
||||||
|
p->currentPosition_.isValid() &&
|
||||||
p->positionManager_->IsLocationTracked());
|
p->positionManager_->IsLocationTracked());
|
||||||
|
|
||||||
// Compass Icon
|
// Compass Icon
|
||||||
|
|
@ -411,6 +445,16 @@ void OverlayLayer::Render(const QMapLibre::CustomLayerRenderParameters& params)
|
||||||
|
|
||||||
auto& generalSettings = settings::GeneralSettings::Instance();
|
auto& generalSettings = settings::GeneralSettings::Instance();
|
||||||
|
|
||||||
|
// Map Center Icon
|
||||||
|
if (params.width != p->lastWidth_ || params.height != p->lastHeight_)
|
||||||
|
{
|
||||||
|
// Draw the icon in the center of the widget
|
||||||
|
p->icons_->SetIconLocation(
|
||||||
|
p->mapCenterIcon_, params.width / 2.0, params.height / 2.0);
|
||||||
|
}
|
||||||
|
p->icons_->SetIconVisible(p->mapCenterIcon_,
|
||||||
|
generalSettings.show_map_center().GetValue());
|
||||||
|
|
||||||
QMargins colorTableMargins = context()->color_table_margins();
|
QMargins colorTableMargins = context()->color_table_margins();
|
||||||
if (colorTableMargins != p->lastColorTableMargins_ || p->firstRender_)
|
if (colorTableMargins != p->lastColorTableMargins_ || p->firstRender_)
|
||||||
{
|
{
|
||||||
|
|
@ -418,7 +462,6 @@ void OverlayLayer::Render(const QMapLibre::CustomLayerRenderParameters& params)
|
||||||
p->icons_->SetIconLocation(p->mapLogoIcon_,
|
p->icons_->SetIconLocation(p->mapLogoIcon_,
|
||||||
10 + colorTableMargins.left(),
|
10 + colorTableMargins.left(),
|
||||||
10 + colorTableMargins.bottom());
|
10 + colorTableMargins.bottom());
|
||||||
p->icons_->FinishIcons();
|
|
||||||
}
|
}
|
||||||
p->icons_->SetIconVisible(p->mapLogoIcon_,
|
p->icons_->SetIconVisible(p->mapLogoIcon_,
|
||||||
generalSettings.show_map_logo().GetValue());
|
generalSettings.show_map_logo().GetValue());
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,7 @@ public:
|
||||||
mapboxApiKey_.SetDefault("?");
|
mapboxApiKey_.SetDefault("?");
|
||||||
maptilerApiKey_.SetDefault("?");
|
maptilerApiKey_.SetDefault("?");
|
||||||
showMapAttribution_.SetDefault(true);
|
showMapAttribution_.SetDefault(true);
|
||||||
|
showMapCenter_.SetDefault(false);
|
||||||
showMapLogo_.SetDefault(true);
|
showMapLogo_.SetDefault(true);
|
||||||
theme_.SetDefault(defaultThemeValue);
|
theme_.SetDefault(defaultThemeValue);
|
||||||
trackLocation_.SetDefault(false);
|
trackLocation_.SetDefault(false);
|
||||||
|
|
@ -122,6 +123,7 @@ public:
|
||||||
SettingsVariable<std::string> mapboxApiKey_ {"mapbox_api_key"};
|
SettingsVariable<std::string> mapboxApiKey_ {"mapbox_api_key"};
|
||||||
SettingsVariable<std::string> maptilerApiKey_ {"maptiler_api_key"};
|
SettingsVariable<std::string> maptilerApiKey_ {"maptiler_api_key"};
|
||||||
SettingsVariable<bool> showMapAttribution_ {"show_map_attribution"};
|
SettingsVariable<bool> showMapAttribution_ {"show_map_attribution"};
|
||||||
|
SettingsVariable<bool> showMapCenter_ {"show_map_center"};
|
||||||
SettingsVariable<bool> showMapLogo_ {"show_map_logo"};
|
SettingsVariable<bool> showMapLogo_ {"show_map_logo"};
|
||||||
SettingsVariable<std::string> theme_ {"theme"};
|
SettingsVariable<std::string> theme_ {"theme"};
|
||||||
SettingsVariable<bool> trackLocation_ {"track_location"};
|
SettingsVariable<bool> trackLocation_ {"track_location"};
|
||||||
|
|
@ -147,6 +149,7 @@ GeneralSettings::GeneralSettings() :
|
||||||
&p->mapboxApiKey_,
|
&p->mapboxApiKey_,
|
||||||
&p->maptilerApiKey_,
|
&p->maptilerApiKey_,
|
||||||
&p->showMapAttribution_,
|
&p->showMapAttribution_,
|
||||||
|
&p->showMapCenter_,
|
||||||
&p->showMapLogo_,
|
&p->showMapLogo_,
|
||||||
&p->theme_,
|
&p->theme_,
|
||||||
&p->trackLocation_,
|
&p->trackLocation_,
|
||||||
|
|
@ -240,6 +243,11 @@ SettingsVariable<bool>& GeneralSettings::show_map_attribution() const
|
||||||
return p->showMapAttribution_;
|
return p->showMapAttribution_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsVariable<bool>& GeneralSettings::show_map_center() const
|
||||||
|
{
|
||||||
|
return p->showMapCenter_;
|
||||||
|
}
|
||||||
|
|
||||||
SettingsVariable<bool>& GeneralSettings::show_map_logo() const
|
SettingsVariable<bool>& GeneralSettings::show_map_logo() const
|
||||||
{
|
{
|
||||||
return p->showMapLogo_;
|
return p->showMapLogo_;
|
||||||
|
|
@ -297,6 +305,7 @@ bool operator==(const GeneralSettings& lhs, const GeneralSettings& rhs)
|
||||||
lhs.p->mapboxApiKey_ == rhs.p->mapboxApiKey_ &&
|
lhs.p->mapboxApiKey_ == rhs.p->mapboxApiKey_ &&
|
||||||
lhs.p->maptilerApiKey_ == rhs.p->maptilerApiKey_ &&
|
lhs.p->maptilerApiKey_ == rhs.p->maptilerApiKey_ &&
|
||||||
lhs.p->showMapAttribution_ == rhs.p->showMapAttribution_ &&
|
lhs.p->showMapAttribution_ == rhs.p->showMapAttribution_ &&
|
||||||
|
lhs.p->showMapCenter_ == rhs.p->showMapCenter_ &&
|
||||||
lhs.p->showMapLogo_ == rhs.p->showMapLogo_ &&
|
lhs.p->showMapLogo_ == rhs.p->showMapLogo_ &&
|
||||||
lhs.p->theme_ == rhs.p->theme_ &&
|
lhs.p->theme_ == rhs.p->theme_ &&
|
||||||
lhs.p->trackLocation_ == rhs.p->trackLocation_ &&
|
lhs.p->trackLocation_ == rhs.p->trackLocation_ &&
|
||||||
|
|
|
||||||
|
|
@ -41,6 +41,7 @@ public:
|
||||||
SettingsVariable<std::string>& mapbox_api_key() const;
|
SettingsVariable<std::string>& mapbox_api_key() const;
|
||||||
SettingsVariable<std::string>& maptiler_api_key() const;
|
SettingsVariable<std::string>& maptiler_api_key() const;
|
||||||
SettingsVariable<bool>& show_map_attribution() const;
|
SettingsVariable<bool>& show_map_attribution() const;
|
||||||
|
SettingsVariable<bool>& show_map_center() const;
|
||||||
SettingsVariable<bool>& show_map_logo() const;
|
SettingsVariable<bool>& show_map_logo() const;
|
||||||
SettingsVariable<std::string>& theme() const;
|
SettingsVariable<std::string>& theme() const;
|
||||||
SettingsVariable<bool>& track_location() const;
|
SettingsVariable<bool>& track_location() const;
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@ static const std::unordered_map<ImageTexture, TextureInfo> imageTextureInfo_ {
|
||||||
{"images/compass-24", ":/res/icons/flaticon/compass-24.png"}},
|
{"images/compass-24", ":/res/icons/flaticon/compass-24.png"}},
|
||||||
{ImageTexture::Crosshairs24,
|
{ImageTexture::Crosshairs24,
|
||||||
{"images/crosshairs-24", ":/res/textures/images/crosshairs-24.png"}},
|
{"images/crosshairs-24", ":/res/textures/images/crosshairs-24.png"}},
|
||||||
|
{ImageTexture::Cursor17,
|
||||||
|
{"images/cursor-17", ":/res/textures/images/cursor-17.png"}},
|
||||||
|
{ImageTexture::Dot3, {"images/dot-3", ":/res/textures/images/dot-3.png"}},
|
||||||
{ImageTexture::MapboxLogo,
|
{ImageTexture::MapboxLogo,
|
||||||
{"images/mapbox-logo", ":/res/textures/images/mapbox-logo.svg"}},
|
{"images/mapbox-logo", ":/res/textures/images/mapbox-logo.svg"}},
|
||||||
{ImageTexture::MapTilerLogo,
|
{ImageTexture::MapTilerLogo,
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@ enum class ImageTexture
|
||||||
CardinalPoint24,
|
CardinalPoint24,
|
||||||
Compass24,
|
Compass24,
|
||||||
Crosshairs24,
|
Crosshairs24,
|
||||||
|
Cursor17,
|
||||||
|
Dot3,
|
||||||
MapboxLogo,
|
MapboxLogo,
|
||||||
MapTilerLogo
|
MapTilerLogo
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -135,6 +135,7 @@ public:
|
||||||
&defaultTimeZone_,
|
&defaultTimeZone_,
|
||||||
&antiAliasingEnabled_,
|
&antiAliasingEnabled_,
|
||||||
&showMapAttribution_,
|
&showMapAttribution_,
|
||||||
|
&showMapCenter_,
|
||||||
&showMapLogo_,
|
&showMapLogo_,
|
||||||
&updateNotificationsEnabled_,
|
&updateNotificationsEnabled_,
|
||||||
&debugEnabled_,
|
&debugEnabled_,
|
||||||
|
|
@ -233,6 +234,7 @@ public:
|
||||||
settings::SettingsInterface<std::string> theme_ {};
|
settings::SettingsInterface<std::string> theme_ {};
|
||||||
settings::SettingsInterface<bool> antiAliasingEnabled_ {};
|
settings::SettingsInterface<bool> antiAliasingEnabled_ {};
|
||||||
settings::SettingsInterface<bool> showMapAttribution_ {};
|
settings::SettingsInterface<bool> showMapAttribution_ {};
|
||||||
|
settings::SettingsInterface<bool> showMapCenter_ {};
|
||||||
settings::SettingsInterface<bool> showMapLogo_ {};
|
settings::SettingsInterface<bool> showMapLogo_ {};
|
||||||
settings::SettingsInterface<bool> updateNotificationsEnabled_ {};
|
settings::SettingsInterface<bool> updateNotificationsEnabled_ {};
|
||||||
settings::SettingsInterface<bool> debugEnabled_ {};
|
settings::SettingsInterface<bool> debugEnabled_ {};
|
||||||
|
|
@ -666,6 +668,9 @@ void SettingsDialogImpl::SetupGeneralTab()
|
||||||
generalSettings.show_map_attribution());
|
generalSettings.show_map_attribution());
|
||||||
showMapAttribution_.SetEditWidget(self_->ui->showMapAttributionCheckBox);
|
showMapAttribution_.SetEditWidget(self_->ui->showMapAttributionCheckBox);
|
||||||
|
|
||||||
|
showMapCenter_.SetSettingsVariable(generalSettings.show_map_center());
|
||||||
|
showMapCenter_.SetEditWidget(self_->ui->showMapCenterCheckBox);
|
||||||
|
|
||||||
showMapLogo_.SetSettingsVariable(generalSettings.show_map_logo());
|
showMapLogo_.SetSettingsVariable(generalSettings.show_map_logo());
|
||||||
showMapLogo_.SetEditWidget(self_->ui->showMapLogoCheckBox);
|
showMapLogo_.SetEditWidget(self_->ui->showMapLogoCheckBox);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -117,13 +117,25 @@
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="general">
|
<widget class="QWidget" name="general">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
|
<item>
|
||||||
|
<widget class="QScrollArea" name="scrollArea_2">
|
||||||
|
<property name="widgetResizable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="scrollAreaWidgetContents_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>513</width>
|
||||||
|
<height>454</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QFrame" name="frame_2">
|
<widget class="QFrame" name="frame_2">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<enum>QFrame::NoFrame</enum>
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
|
||||||
<enum>QFrame::Raised</enum>
|
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_4">
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
|
|
@ -138,15 +150,26 @@
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="8" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="defaultAlertActionLabel">
|
<widget class="QLabel" name="label">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Default Alert Action</string>
|
<string>Default Radar Site</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="10" column="0">
|
||||||
<widget class="QComboBox" name="themeComboBox"/>
|
<widget class="QLabel" name="label_21">
|
||||||
|
<property name="text">
|
||||||
|
<string>Default Time Zone</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="0">
|
||||||
|
<widget class="QLabel" name="label_7">
|
||||||
|
<property name="text">
|
||||||
|
<string>Map Provider</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="4">
|
<item row="0" column="4">
|
||||||
<widget class="QToolButton" name="resetThemeButton">
|
<widget class="QToolButton" name="resetThemeButton">
|
||||||
|
|
@ -159,20 +182,24 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="8" column="2">
|
<item row="8" column="4">
|
||||||
<widget class="QComboBox" name="defaultAlertActionComboBox"/>
|
<widget class="QToolButton" name="resetDefaultAlertActionButton">
|
||||||
</item>
|
<property name="text">
|
||||||
<item row="6" column="2">
|
<string>...</string>
|
||||||
<widget class="QLineEdit" name="mapboxApiKeyLineEdit">
|
</property>
|
||||||
<property name="echoMode">
|
<property name="icon">
|
||||||
<enum>QLineEdit::Password</enum>
|
<iconset resource="../../../../scwx-qt.qrc">
|
||||||
|
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="0">
|
<item row="9" column="2">
|
||||||
<widget class="QLabel" name="label_21">
|
<widget class="QComboBox" name="clockFormatComboBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Default Time Zone</string>
|
<string>Mapbox API Key</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -183,20 +210,6 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="label_5">
|
|
||||||
<property name="text">
|
|
||||||
<string>Theme</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="0">
|
|
||||||
<widget class="QLabel" name="label_7">
|
|
||||||
<property name="text">
|
|
||||||
<string>Map Provider</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="0">
|
<item row="7" column="0">
|
||||||
<widget class="QLabel" name="label_6">
|
<widget class="QLabel" name="label_6">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
@ -204,6 +217,31 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="10" column="4">
|
||||||
|
<widget class="QToolButton" name="resetDefaultTimeZoneButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../scwx-qt.qrc">
|
||||||
|
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="8" column="2">
|
||||||
|
<widget class="QComboBox" name="defaultAlertActionComboBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="7" column="4">
|
||||||
|
<widget class="QToolButton" name="resetMapTilerApiKeyButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../scwx-qt.qrc">
|
||||||
|
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item row="3" column="4">
|
<item row="3" column="4">
|
||||||
<widget class="QToolButton" name="resetGridHeightButton">
|
<widget class="QToolButton" name="resetGridHeightButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
@ -215,68 +253,8 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="2">
|
<item row="1" column="2">
|
||||||
<widget class="QComboBox" name="mapProviderComboBox"/>
|
<widget class="QComboBox" name="radarSiteComboBox"/>
|
||||||
</item>
|
|
||||||
<item row="10" column="2">
|
|
||||||
<widget class="QComboBox" name="defaultTimeZoneComboBox"/>
|
|
||||||
</item>
|
|
||||||
<item row="7" column="4">
|
|
||||||
<widget class="QToolButton" name="resetMapTilerApiKeyButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../../../scwx-qt.qrc">
|
|
||||||
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="5" column="4">
|
|
||||||
<widget class="QToolButton" name="resetMapProviderButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../../../scwx-qt.qrc">
|
|
||||||
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="4">
|
|
||||||
<widget class="QToolButton" name="resetGridWidthButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../../../scwx-qt.qrc">
|
|
||||||
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="0">
|
|
||||||
<widget class="QLabel" name="label_20">
|
|
||||||
<property name="text">
|
|
||||||
<string>Clock Format</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="4">
|
|
||||||
<widget class="QToolButton" name="resetClockFormatButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../../../scwx-qt.qrc">
|
|
||||||
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="2">
|
|
||||||
<widget class="QSpinBox" name="gridWidthSpinBox"/>
|
|
||||||
</item>
|
|
||||||
<item row="9" column="2">
|
|
||||||
<widget class="QComboBox" name="clockFormatComboBox"/>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="4">
|
<item row="1" column="4">
|
||||||
<widget class="QToolButton" name="resetRadarSiteButton">
|
<widget class="QToolButton" name="resetRadarSiteButton">
|
||||||
|
|
@ -289,51 +267,25 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="2">
|
<item row="6" column="2">
|
||||||
<widget class="QComboBox" name="radarSiteComboBox"/>
|
<widget class="QLineEdit" name="mapboxApiKeyLineEdit">
|
||||||
</item>
|
<property name="echoMode">
|
||||||
<item row="1" column="0">
|
<enum>QLineEdit::Password</enum>
|
||||||
<widget class="QLabel" name="label">
|
|
||||||
<property name="text">
|
|
||||||
<string>Default Radar Site</string>
|
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="label_4">
|
<widget class="QLabel" name="label_5">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Mapbox API Key</string>
|
<string>Theme</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="6" column="4">
|
<item row="0" column="2">
|
||||||
<widget class="QToolButton" name="resetMapboxApiKeyButton">
|
<widget class="QComboBox" name="themeComboBox"/>
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../../../scwx-qt.qrc">
|
|
||||||
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
<item row="10" column="2">
|
||||||
<widget class="QLabel" name="label_3">
|
<widget class="QComboBox" name="defaultTimeZoneComboBox"/>
|
||||||
<property name="text">
|
|
||||||
<string>Grid Height</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="8" column="4">
|
|
||||||
<widget class="QToolButton" name="resetDefaultAlertActionButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>...</string>
|
|
||||||
</property>
|
|
||||||
<property name="icon">
|
|
||||||
<iconset resource="../../../../scwx-qt.qrc">
|
|
||||||
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="3">
|
<item row="1" column="3">
|
||||||
<widget class="QToolButton" name="radarSiteSelectButton">
|
<widget class="QToolButton" name="radarSiteSelectButton">
|
||||||
|
|
@ -349,11 +301,15 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
<item row="8" column="0">
|
||||||
<widget class="QSpinBox" name="gridHeightSpinBox"/>
|
<widget class="QLabel" name="defaultAlertActionLabel">
|
||||||
|
<property name="text">
|
||||||
|
<string>Default Alert Action</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="10" column="4">
|
<item row="2" column="4">
|
||||||
<widget class="QToolButton" name="resetDefaultTimeZoneButton">
|
<widget class="QToolButton" name="resetGridWidthButton">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>...</string>
|
<string>...</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
@ -363,6 +319,62 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="5" column="2">
|
||||||
|
<widget class="QComboBox" name="mapProviderComboBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="5" column="4">
|
||||||
|
<widget class="QToolButton" name="resetMapProviderButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../scwx-qt.qrc">
|
||||||
|
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="6" column="4">
|
||||||
|
<widget class="QToolButton" name="resetMapboxApiKeyButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../scwx-qt.qrc">
|
||||||
|
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="4">
|
||||||
|
<widget class="QToolButton" name="resetClockFormatButton">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../../../../scwx-qt.qrc">
|
||||||
|
<normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</normaloff>:/res/icons/font-awesome-6/rotate-left-solid.svg</iconset>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="2">
|
||||||
|
<widget class="QSpinBox" name="gridHeightSpinBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="2">
|
||||||
|
<widget class="QSpinBox" name="gridWidthSpinBox"/>
|
||||||
|
</item>
|
||||||
|
<item row="9" column="0">
|
||||||
|
<widget class="QLabel" name="label_20">
|
||||||
|
<property name="text">
|
||||||
|
<string>Clock Format</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>Grid Height</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|
@ -380,6 +392,13 @@
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="showMapCenterCheckBox">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Map Center</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QCheckBox" name="showMapLogoCheckBox">
|
<widget class="QCheckBox" name="showMapLogoCheckBox">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
|
@ -416,6 +435,10 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
<widget class="QWidget" name="palettes">
|
<widget class="QWidget" name="palettes">
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
|
|
@ -438,8 +461,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>498</width>
|
<width>63</width>
|
||||||
<height>383</height>
|
<height>18</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_3">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
|
|
||||||
|
|
@ -1 +1 @@
|
||||||
Subproject commit 260b340030487b01ce9aa37135d949008c972f27
|
Subproject commit ab32df5b0731d70aa5b977453c9aa4786eb0bd3f
|
||||||
Loading…
Add table
Add a link
Reference in a new issue