Skip to content

Commit 6175ca2

Browse files
Merge with upstream/main
2 parents 1aefb45 + d9d7fad commit 6175ca2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+961
-396
lines changed

.github/workflows/windows.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,18 @@ jobs:
6565
- name: Build
6666
run: cmake --build ./build --config Debug
6767

68+
- name: List .exe files in ./build
69+
shell: pwsh
70+
run: |
71+
Write-Host "Searching for .exe files in ./build..."
72+
Get-ChildItem -Path "./build" -Filter "*.exe" -Recurse | ForEach-Object {
73+
Write-Host "Found: $($_.FullName)"
74+
}
75+
6876
- name: Unittests on Windows
6977
env:
7078
MESA_GL_VERSION_OVERRIDE: 3.3
7179
run: |
72-
./build/alp_external/radix/unittests/unittests_radix.exe
73-
./build/unittests/unittests_nucleus.exe
80+
./build/unittests_radix.exe
81+
./build/unittests_nucleus.exe
7482

CMakeLists.txt

+1-3
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ endif()
8383

8484
########################################### dependencies #################################################
8585
find_package(Qt6 REQUIRED COMPONENTS Core Gui OpenGL Network Quick QuickControls2 LinguistTools)
86-
qt_policy(
87-
SET QTP0002 NEW
88-
)
86+
qt_standard_project_setup(REQUIRES 6.8)
8987

9088
include(cmake/alp_add_git_repository.cmake)
9189
alp_add_git_repository(renderer_static_data URL https://github.com/AlpineMapsOrg/renderer_static_data.git COMMITISH v23.11 DO_NOT_ADD_SUBPROJECT)

README.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
# alpine-renderer
1+
# AlpineMaps.org Renderer
22
This is the software behind [alpinemaps.org](https://alpinemaps.org).
33

44
A developer version (trunk) is released [here](https://alpinemapsorg.github.io/renderer/), including APKs for android. Be aware that it can break at any time!
55

6+
[If looking at the issues, best to filter out projects!](https://github.com/AlpineMapsOrg/renderer/issues?q=is%3Aissue%20state%3Aopen%20no%3Aproject)
7+
68
We are in discord, talk to us!
79
https://discord.gg/p8T9XzVwRa
810

@@ -13,7 +15,7 @@ After that it should be a normal cmake project. That is, you run cmake to genera
1315
We use Qt Creator (with mingw on Windows), which is the only tested setup atm and makes setup of Android and WebAssembly builds reasonably easy. If you have questions, please go to Discord.
1416

1517
## Dependencies
16-
* Qt 6.6.0, or greater
18+
* Qt 6.8.0, or greater
1719
* g++ 12+, clang or msvc
1820
* OpenGL
1921
* Qt Positioning and Charts modules
@@ -33,11 +35,9 @@ We use Qt Creator (with mingw on Windows), which is the only tested setup atm an
3335
* Finally, you are welcome to ask in discord if something is not working!
3436

3537
## Building the WebAssembly version:
36-
* Atm, none of the Qt versions works perfectly in all browsers
37-
* In Qt 6.6 touch doesn't work on Firefox (issues #33)
38-
* [The Qt documentation is quite good on how to get it to run](https://doc-snapshots.qt.io/qt6-dev/wasm.html#installing-emscripten). Be aware that only specific versions of emscripten work for specific versions of Qt, and the error messages are not helpfull.
39-
* The threaded version doesn't seem to work atm, so use the non-threaded (bug reported)!
40-
* There are a number of other bugs, we track them with the upstream tag.
38+
* [The Qt documentation is quite good on how to get it to run](https://doc-snapshots.qt.io/qt6-dev/wasm.html#installing-emscripten).
39+
* Be aware that only specific versions of emscripten work for specific versions of Qt, and the error messages are not helpfull.
40+
* [More info on building and getting Hotreload to work](https://github.com/AlpineMapsOrg/documentation/blob/main/WebAssembly_local_build.md)
4141

4242
# Code style
4343
* class names are CamelCase, method, function and variable names are snake_case.

app/CMakeLists.txt

+13-4
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
project(alpine-renderer-app LANGUAGES CXX)
2121

22+
option(ALP_ENABLE_QML_HOT_RELOAD "Enables hot-reloading of qml files (which slows down compilation)" OFF)
23+
2224
qt_add_executable(alpineapp
2325
main.cpp
2426
RenderThreadNotifier.h RenderThreadNotifier.cpp
@@ -100,6 +102,7 @@ qt_add_qml_module(alpineapp
100102
picker/Default.qml
101103
picker/PoiAlpineHut.qml
102104
picker/PoiSettlement.qml
105+
SOURCES TileStatistics.h TileStatistics.cpp
103106
)
104107

105108
qt_add_resources(alpineapp "fonts"
@@ -119,18 +122,24 @@ set_target_properties(alpineapp PROPERTIES
119122
QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android
120123
)
121124
target_link_libraries(alpineapp PUBLIC gl_engine Qt::Quick Qt::QuickControls2)
122-
if (ALP_ENABLE_DEV_TOOLS)
123-
message(WARNING "building alpine app with dev tools. this will increase the build size")
125+
126+
if (ALP_ENABLE_QML_HOT_RELOAD)
127+
message(WARNING "building alpine app with qml-hot-reload. It'll slow incremental building due to a fix for hotreload.")
124128

125129
# change prefer to project dir, as per https://bugreports.qt.io/browse/QTBUG-120435
126130
# otherwise we can't hotreload files in app when there is "import app" in the qml file.
127131
# but we need import app, if we want to use the new approach of registering qml types (directly in the class, not in main).
128-
129132
add_custom_command(
130133
TARGET alpineapp POST_BUILD
131-
COMMAND sed -i "s@^prefer .*@prefer ${CMAKE_CURRENT_SOURCE_DIR}/@" ${CMAKE_CURRENT_BINARY_DIR}/app/qmldir
134+
COMMAND ${CMAKE_COMMAND}
135+
-DBUILD_DIR="${CMAKE_CURRENT_BINARY_DIR}/app"
136+
-DSOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}"
137+
-P "${CMAKE_SOURCE_DIR}/cmake/alp_fix_qmldir_for_hotreload.cmake"
132138
)
139+
endif()
133140

141+
if (ALP_ENABLE_DEV_TOOLS)
142+
message(WARNING "building alpine app with dev tools. this will increase the build size.")
134143
qt_target_qml_sources(alpineapp
135144
QML_FILES
136145
StatsWindow.qml

app/RenderingContext.cpp

+29-24
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#include <nucleus/map_label/setup.h>
3636
#include <nucleus/picker/PickerManager.h>
3737
#include <nucleus/tile/GeometryScheduler.h>
38+
#include <nucleus/tile/SchedulerDirector.h>
3839
#include <nucleus/tile/TextureScheduler.h>
3940
#include <nucleus/tile/TileLoadService.h>
4041
#include <nucleus/tile/setup.h>
@@ -63,6 +64,7 @@ struct RenderingContext::Data {
6364
std::shared_ptr<nucleus::map_label::Filter> label_filter;
6465
std::shared_ptr<nucleus::picker::PickerManager> picker_manager;
6566
std::shared_ptr<nucleus::tile::utils::AabbDecorator> aabb_decorator;
67+
std::unique_ptr<nucleus::tile::SchedulerDirector> scheduler_director;
6668
};
6769

6870
RenderingContext::RenderingContext(QObject* parent)
@@ -77,6 +79,8 @@ RenderingContext::RenderingContext(QObject* parent)
7779
m->scheduler_thread->setObjectName("scheduler_thread");
7880
#endif
7981

82+
m->scheduler_director = std::make_unique<nucleus::tile::SchedulerDirector>();
83+
8084
// m->ortho_service.reset(new TileLoadService("https://tiles.bergfex.at/styles/bergfex-osm/", TileLoadService::UrlPattern::ZXY_yPointingSouth,
8185
// ".jpeg")); m->ortho_service.reset(new TileLoadService("https://alpinemaps.cg.tuwien.ac.at/tiles/ortho/",
8286
// TileLoadService::UrlPattern::ZYX_yPointingSouth, ".jpeg"));
@@ -85,32 +89,27 @@ RenderingContext::RenderingContext(QObject* parent)
8589
// ".jpeg",
8690
// {"", "1", "2", "3", "4"}));
8791
m->aabb_decorator = nucleus::tile::setup::aabb_decorator();
88-
m->geometry = nucleus::tile::setup::geometry_scheduler("geometry",
89-
std::make_unique<TileLoadService>("https://alpinemaps.cg.tuwien.ac.at/tiles/at_dtm_alpinemaps/", TilePattern::ZXY, ".png"),
90-
m->aabb_decorator,
91-
m->scheduler_thread.get()); // TODO currently hardcoded change to dtm model, but probably need to change this dynamically
92-
// "geometry", std::make_unique<TileLoadService>("https://alpinemaps.cg.tuwien.ac.at/tiles/alpine_png/", TilePattern::ZXY, ".png"), m->aabb_decorator, m->scheduler_thread.get());
93-
m->data_querier = std::make_shared<DataQuerier>(&m->geometry.scheduler->ram_cache());
94-
95-
m->ortho_texture = nucleus::tile::setup::texture_scheduler(
96-
"ortho", std::make_unique<TileLoadService>("https://gataki.cg.tuwien.ac.at/raw/basemap/tiles/", TilePattern::ZYX_yPointingSouth, ".jpeg"), m->aabb_decorator, m->scheduler_thread.get());
97-
98-
m->map_label = nucleus::map_label::setup::scheduler("map_label",
99-
std::make_unique<TileLoadService>("https://osm.cg.tuwien.ac.at/vector_tiles/poi_v1/", TilePattern::ZXY_yPointingSouth, ""),
100-
m->aabb_decorator,
101-
m->data_querier,
102-
m->scheduler_thread.get());
103-
m->map_label.scheduler->set_geometry_ram_cache(&m->geometry.scheduler->ram_cache());
104-
m->geometry.scheduler->set_dataquerier(m->data_querier);
10592

106-
m->vector_layer = nucleus::vector_layer::setup::scheduler("vector_layer",
107-
std::make_unique<TileLoadService>("https://osm.cg.tuwien.ac.at/vector_tiles/vector_layer_v1/", TilePattern::ZXY_yPointingSouth, ""),
108-
// std::make_unique<TileLoadService>("http://localhost:3000/getmvt/", TilePattern::ZXY_yPointingSouth, ""),
109-
// std::make_unique<TileLoadService>("http://localhost:8080/data/openmaptiles/", TilePattern::ZXY_yPointingSouth, ".pbf"),
110-
// std::make_unique<TileLoadService>("https://mapsneu.wien.gv.at/basemapv/bmapv/3857/tile/", TilePattern::ZYX_yPointingSouth, ".pbf"),
111-
m->aabb_decorator,
112-
m->scheduler_thread.get());
93+
{
94+
auto geometry_service = std::make_unique<TileLoadService>("https://alpinemaps.cg.tuwien.ac.at/tiles/at_dtm_alpinemaps/", TilePattern::ZXY, ".png");
95+
// auto geometry_service = std::make_unique<TileLoadService>("https://alpinemaps.cg.tuwien.ac.at/tiles/alpine_png/", TilePattern::ZXY, ".png");
96+
m->geometry = nucleus::tile::setup::geometry_scheduler(std::move(geometry_service), m->aabb_decorator, m->scheduler_thread.get());
97+
m->scheduler_director->check_in("geometry", m->geometry.scheduler);
98+
m->data_querier = std::make_shared<DataQuerier>(&m->geometry.scheduler->ram_cache());
99+
auto ortho_service = std::make_unique<TileLoadService>("https://gataki.cg.tuwien.ac.at/raw/basemap/tiles/", TilePattern::ZYX_yPointingSouth, ".jpeg");
100+
m->ortho_texture = nucleus::tile::setup::texture_scheduler(std::move(ortho_service), m->aabb_decorator, m->scheduler_thread.get());
101+
m->scheduler_director->check_in("ortho", m->ortho_texture.scheduler);
102+
auto map_label_service = std::make_unique<TileLoadService>("https://osm.cg.tuwien.ac.at/vector_tiles/poi_v1/", TilePattern::ZXY_yPointingSouth, "");
103+
m->map_label = nucleus::map_label::setup::scheduler(std::move(map_label_service), m->aabb_decorator, m->data_querier, m->scheduler_thread.get());
104+
m->scheduler_director->check_in("map_label", m->map_label.scheduler);
105+
106+
auto vector_layer_service = std::make_unique<TileLoadService>("https://osm.cg.tuwien.ac.at/vector_tiles/vector_layer_v1/", TilePattern::ZXY_yPointingSouth, "");
107+
m->vector_layer = nucleus::vector_layer::setup::scheduler(std::move(vector_layer_service), m->aabb_decorator, m->scheduler_thread.get());
108+
m->scheduler_director->check_in("map_label", m->map_label.scheduler);
109+
}
110+
m->map_label.scheduler->set_geometry_ram_cache(&m->geometry.scheduler->ram_cache());
113111
m->vector_layer.scheduler->set_geometry_ram_cache(&m->geometry.scheduler->ram_cache());
112+
m->geometry.scheduler->set_dataquerier(m->data_querier);
114113

115114
m->picker_manager = std::make_shared<PickerManager>();
116115
m->label_filter = std::make_shared<Filter>();
@@ -281,3 +280,9 @@ nucleus::tile::TextureScheduler* RenderingContext::ortho_scheduler() const
281280
QMutexLocker locker(&m->shared_ptr_mutex);
282281
return m->ortho_texture.scheduler.get();
283282
}
283+
284+
SchedulerDirector* RenderingContext::scheduler_director() const
285+
{
286+
QMutexLocker locker(&m->shared_ptr_mutex);
287+
return m->scheduler_director.get();
288+
}

app/RenderingContext.h

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ class Scheduler;
4343
namespace nucleus::tile {
4444
class GeometryScheduler;
4545
class TextureScheduler;
46+
class SchedulerDirector;
4647
}
4748
namespace nucleus::tile::utils {
4849
class AabbDecorator;
@@ -80,6 +81,7 @@ class RenderingContext : public QObject {
8081
[[nodiscard]] nucleus::map_label::Scheduler* map_label_scheduler() const;
8182
[[nodiscard]] nucleus::vector_layer::Scheduler* vector_layer_scheduler() const;
8283
[[nodiscard]] nucleus::tile::TextureScheduler* ortho_scheduler() const;
84+
[[nodiscard]] nucleus::tile::SchedulerDirector* scheduler_director() const;
8385

8486
signals:
8587
void initialised();

0 commit comments

Comments
 (0)