Skip to content

Commit

Permalink
Merge pull request #87 from dpaulat/feature/placefiles
Browse files Browse the repository at this point in the history
Placefiles
  • Loading branch information
dpaulat authored Nov 5, 2023
2 parents a84fa72 + 66ef65f commit 3ce23e5
Show file tree
Hide file tree
Showing 155 changed files with 13,888 additions and 865 deletions.
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,9 @@
[submodule "external/date"]
path = external/date
url = https://github.com/HowardHinnant/date.git
[submodule "external/units"]
path = external/units
url = https://github.com/nholthaus/units.git
[submodule "external/textflowcpp"]
path = external/textflowcpp
url = https://github.com/catchorg/textflowcpp.git
5 changes: 5 additions & 0 deletions ACKNOWLEDGEMENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Supercell Wx uses code from the following dependencies:
| [CSS Color Parser](https://github.com/deanm/css-color-parser-js) | [MIT License](https://spdx.org/licenses/MIT.html) | Ported to C++ for MapLibre Native |
| [Date](https://github.com/HowardHinnant/date) | [MIT License](https://spdx.org/licenses/MIT.html) |
| [Dear ImGui](https://github.com/ocornut/imgui) | [MIT License](https://spdx.org/licenses/MIT.html) |
| [fontconfig](http://fontconfig.org/) | [MIT License](https://spdx.org/licenses/MIT.html) |
| [FreeType](https://freetype.org/) | [Freetype Project License](https://spdx.org/licenses/FTL.html) |
| [FreeType GL](https://github.com/rougier/freetype-gl) | [BSD 2-Clause with views sentence](https://spdx.org/licenses/BSD-2-Clause-Views.html) |
| [GeographicLib](https://geographiclib.sourceforge.io/) | [MIT License](https://spdx.org/licenses/MIT.html) |
Expand All @@ -36,6 +37,8 @@ Supercell Wx uses code from the following dependencies:
| [spdlog](https://github.com/gabime/spdlog) | [MIT License](https://spdx.org/licenses/MIT.html) |
| [SQLite](https://www.sqlite.org/) | Public Domain |
| [stb](https://github.com/nothings/stb) | Public Domain |
| [TextFlowCpp](https://github.com/catchorg/textflowcpp) | [Boost Software License 1.0](https://spdx.org/licenses/BSL-1.0.html) |
| [Units](https://github.com/nholthaus/units) | [MIT License](https://spdx.org/licenses/MIT.html) |
| [Vulkan SDK](https://www.vulkan.org/) | [Apache License 2.0](https://spdx.org/licenses/Apache-2.0.html) |
| [zlib](https://zlib.net/) | [zlib License](https://spdx.org/licenses/Zlib.html) |

Expand All @@ -55,7 +58,9 @@ Supercell Wx uses assets from the following sources:

| Source | License | Notes |
| ------ | ------- | ----- |
| Alte DIN 1451 Mittelschrift | SIL Open Font License |
| [Font Awesome Free](https://fontawesome.com/) | CC BY 4.0 License |
| [Inconsolata](https://fonts.google.com/specimen/Inconsolata) | SIL Open Font License |
| [NOAA's Weather and Climate Toolkit](https://www.ncdc.noaa.gov/wct/) | Public Domain | Default Color Tables |
| [Supercell thunderstorm with dramatic clouds](https://www.shutterstock.com/image-photo/supercell-thunderstorm-dramatic-clouds-1354353521) | Shutterstock Standard License | Photo by John Sirlin

Expand Down
1 change: 1 addition & 0 deletions conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class SupercellWxConan(ConanFile):
settings = ("os", "compiler", "build_type", "arch")
requires = ("boost/1.81.0",
"cpr/1.9.3",
"fontconfig/2.14.2",
"freetype/2.12.1",
"geographiclib/1.52",
"glew/2.2.0",
Expand Down
6 changes: 5 additions & 1 deletion external/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ set_property(DIRECTORY
hsluv-c.cmake
imgui.cmake
mapbox-gl-native.cmake
stb.cmake)
stb.cmake
textflowcpp.cmake
units.cmake)

include(aws-sdk-cpp.cmake)
include(date.cmake)
Expand All @@ -19,3 +21,5 @@ include(hsluv-c.cmake)
include(imgui.cmake)
include(mapbox-gl-native.cmake)
include(stb.cmake)
include(textflowcpp.cmake)
include(units.cmake)
2 changes: 1 addition & 1 deletion external/mapbox-gl-native
Submodule mapbox-gl-native updated 3303 files
2 changes: 1 addition & 1 deletion external/stb
1 change: 1 addition & 0 deletions external/textflowcpp
Submodule textflowcpp added at 12010d
4 changes: 4 additions & 0 deletions external/textflowcpp.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 3.20)
set(PROJECT_NAME scwx-textflowcpp)

set(TEXTFLOWCPP_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/textflowcpp PARENT_SCOPE)
1 change: 1 addition & 0 deletions external/units
Submodule units added at da6dd9
4 changes: 4 additions & 0 deletions external/units.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 3.20)
set(PROJECT_NAME scwx-units)

add_subdirectory(units)
2 changes: 1 addition & 1 deletion scwx-qt/gl/color.frag
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#version 330 core
in vec4 color;
smooth in vec4 color;

layout (location = 0) out vec4 fragColor;

Expand Down
2 changes: 1 addition & 1 deletion scwx-qt/gl/color.vert
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout (location = 1) in vec4 aColor;

uniform mat4 uMVPMatrix;

out vec4 color;
smooth out vec4 color;

void main()
{
Expand Down
8 changes: 4 additions & 4 deletions scwx-qt/gl/geo_line.vert
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@

layout (location = 0) in vec2 aLatLong;
layout (location = 1) in vec2 aXYOffset;
layout (location = 2) in vec2 aTexCoord;
layout (location = 2) in vec3 aTexCoord;
layout (location = 3) in vec4 aModulate;

uniform mat4 uMVPMatrix;
uniform mat4 uMapMatrix;
uniform vec2 uMapScreenCoord;

smooth out vec2 texCoord;
flat out vec4 modulate;
smooth out vec3 texCoord;
smooth out vec4 color;

vec2 latLngToScreenCoordinate(in vec2 latLng)
{
Expand All @@ -31,7 +31,7 @@ void main()
{
// Pass the texture coordinate and color modulate to the fragment shader
texCoord = aTexCoord;
modulate = aModulate;
color = aModulate;

vec2 p = latLngToScreenCoordinate(aLatLong) - uMapScreenCoord;

Expand Down
65 changes: 65 additions & 0 deletions scwx-qt/gl/geo_texture2d.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#version 330 core

#define DEGREES_MAX 360.0f
#define LATITUDE_MAX 85.051128779806604f
#define LONGITUDE_MAX 180.0f
#define PI 3.1415926535897932384626433f
#define RAD2DEG 57.295779513082320876798156332941f
#define DEG2RAD 0.0174532925199432957692369055556f

layout (location = 0) in vec2 aLatLong;
layout (location = 1) in vec2 aXYOffset;
layout (location = 2) in vec3 aTexCoord;
layout (location = 3) in vec4 aModulate;
layout (location = 4) in float aAngleDeg;
layout (location = 5) in int aThreshold;
layout (location = 6) in ivec2 aTimeRange;

uniform mat4 uMVPMatrix;
uniform mat4 uMapMatrix;
uniform vec2 uMapScreenCoord;

out VertexData
{
int threshold;
vec3 texCoord;
vec4 color;
ivec2 timeRange;
} vsOut;

smooth out vec3 texCoord;
smooth out vec4 color;

vec2 latLngToScreenCoordinate(in vec2 latLng)
{
vec2 p;
latLng.x = clamp(latLng.x, -LATITUDE_MAX, LATITUDE_MAX);
p.xy = vec2(LONGITUDE_MAX + latLng.y,
-(LONGITUDE_MAX - RAD2DEG * log(tan(PI / 4 + latLng.x * PI / DEGREES_MAX))));
return p;
}

void main()
{
// Pass the threshold and time range to the geometry shader
vsOut.threshold = aThreshold;
vsOut.timeRange = aTimeRange;

// Pass the texture coordinate and color modulate to the geometry and
// fragment shaders
vsOut.texCoord = aTexCoord;
vsOut.color = aModulate;
texCoord = aTexCoord;
color = aModulate;

vec2 p = latLngToScreenCoordinate(aLatLong) - uMapScreenCoord;

// Rotate clockwise
float angle = aAngleDeg * DEG2RAD;
mat2 rotate = mat2(cos(angle), -sin(angle),
sin(angle), cos(angle));

// Transform the position to screen coordinates
gl_Position = uMapMatrix * vec4(p, 0.0f, 1.0f) +
uMVPMatrix * vec4(rotate * aXYOffset, 0.0f, 0.0f);
}
38 changes: 38 additions & 0 deletions scwx-qt/gl/map_color.vert
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#version 330 core

layout (location = 0) in vec2 aScreenCoord;
layout (location = 1) in vec2 aXYOffset;
layout (location = 2) in vec4 aColor;
layout (location = 3) in int aThreshold;
layout (location = 4) in ivec2 aTimeRange;

uniform mat4 uMVPMatrix;
uniform mat4 uMapMatrix;
uniform vec2 uMapScreenCoord;

out VertexData
{
int threshold;
vec3 texCoord;
vec4 color;
ivec2 timeRange;
} vsOut;

smooth out vec4 color;

void main()
{
// Pass the threshold and time range to the geometry shader
vsOut.threshold = aThreshold;
vsOut.timeRange = aTimeRange;

// Pass the color to the geometry and fragment shaders
vsOut.color = aColor;
color = aColor;

vec2 p = aScreenCoord - uMapScreenCoord;

// Transform the position to screen coordinates
gl_Position = uMapMatrix * vec4(p, 0.0f, 1.0f) +
uMVPMatrix * vec4(aXYOffset, 0.0f, 0.0f);
}
4 changes: 2 additions & 2 deletions scwx-qt/gl/texture2d.frag
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ precision mediump float;
uniform sampler2D uTexture;

smooth in vec2 texCoord;
flat in vec4 modulate;
smooth in vec4 color;

layout (location = 0) out vec4 fragColor;

void main()
{
fragColor = texture(uTexture, texCoord) * modulate;
fragColor = texture(uTexture, texCoord) * color;
}
16 changes: 16 additions & 0 deletions scwx-qt/gl/texture2d_array.frag
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#version 330 core

// Lower the default precision to medium
precision mediump float;

uniform sampler2DArray uTexture;

smooth in vec3 texCoord;
smooth in vec4 color;

layout (location = 0) out vec4 fragColor;

void main()
{
fragColor = texture(uTexture, texCoord) * color;
}
46 changes: 46 additions & 0 deletions scwx-qt/gl/threshold.geom
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#version 330 core

layout (triangles) in;
layout (triangle_strip, max_vertices = 3) out;

uniform float uMapDistance;
uniform int uSelectedTime;

in VertexData
{
int threshold;
vec3 texCoord;
vec4 color;
ivec2 timeRange;
} gsIn[];

smooth out vec3 texCoord;
smooth out vec4 color;

void main()
{
if ((gsIn[0].threshold <= 0 || // If Threshold: 0 was specified, no threshold
gsIn[0].threshold >= uMapDistance || // If Threshold is above current map distance
gsIn[0].threshold >= 999) && // If Threshold: 999 was specified (or greater), no threshold
(gsIn[0].timeRange[0] == 0 || // If there is no start time specified
(gsIn[0].timeRange[0] <= uSelectedTime && // If the selected time is after the start time
uSelectedTime < gsIn[0].timeRange[1]))) // If the selected time is before the end time
{
gl_Position = gl_in[0].gl_Position;
texCoord = gsIn[0].texCoord;
color = gsIn[0].color;
EmitVertex();

gl_Position = gl_in[1].gl_Position;
texCoord = gsIn[1].texCoord;
color = gsIn[1].color;

EmitVertex();
gl_Position = gl_in[2].gl_Position;
texCoord = gsIn[2].texCoord;
color = gsIn[2].color;

EmitVertex();
EndPrimitive();
}
}
Binary file added scwx-qt/res/fonts/Inconsolata-Regular.ttf
Binary file not shown.
1 change: 1 addition & 0 deletions scwx-qt/res/icons/font-awesome-6/angle-down-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions scwx-qt/res/icons/font-awesome-6/angle-up-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions scwx-qt/res/icons/font-awesome-6/angles-down-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions scwx-qt/res/icons/font-awesome-6/angles-up-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions scwx-qt/res/icons/font-awesome-6/earth-americas-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions scwx-qt/res/icons/font-awesome-6/font-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions scwx-qt/res/icons/font-awesome-6/layer-group-solid.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3ce23e5

Please sign in to comment.