Fix coarse DEM elevation rework#66441
Conversation
…s null in destructor
Tests failed for Qt 6 (ALL_BUT_PROVIDERS - fedora)One or more tests failed using the build from commit cb40e93 ambient_occlusion_1 (testAmbientOcclusion)ambient_occlusion_1Test failed at testAmbientOcclusion at tests/src/3d/testqgs3drendering.cpp:2131 Rendered image did not match tests/testdata/control_images/3d/expected_ambient_occlusion_1/expected_ambient_occlusion_1.png (found 54041 pixels different) The full test report (included comparison of rendered vs expected images) can be found here. Further documentation on the QGIS test infrastructure can be found in the Developer's Guide. |
Tests failed for Qt 6 (ALL_BUT_PROVIDERS - ubuntu)One or more tests failed using the build from commit cb40e93 ambient_occlusion_1 (testAmbientOcclusion)ambient_occlusion_1Test failed at testAmbientOcclusion at tests/src/3d/testqgs3drendering.cpp:2131 Rendered image did not match tests/testdata/control_images/3d/expected_ambient_occlusion_1/expected_ambient_occlusion_1.png (found 54040 pixels different) The full test report (included comparison of rendered vs expected images) can be found here. Further documentation on the QGIS test infrastructure can be found in the Developer's Guide. |
This PR improves the precision of the QgsDemTerrainGenerator::heightAt function. This function is used to compute the elevation of vector data (Z coordinate) when, for example, the user choose an altitude clamping based on the terrain elevation.
We also add a class
QgsDemHeightMapCacheto store height map data according to the ChunkNodeId (depth/x/y) of the received dem tile. This class listens for the QgsDemHeightMapGenerator to receive new dem tiles (height map data).When a vector layer calls the heightAt function, we look (in the cache) for the best height map data, if not present we fallback to the old (coarse) algorithm.
As vector data can be already loaded when height map data are received, the vector data elevations may not be accurate and need to be updated.
To do so, when we received an height map with high precision, we emit a signal caught by Qgs3DMapScene. The slot function in Qgs3DMapScene:
This PR supersedes #62676. It fixes the issues mentioned in this previous PR.
Sponsored by:
cc @nenad-vujicic