14 Commits

Author SHA1 Message Date
Nyall Dawson
5967344117 Rename QgsBox3d to QgsBox3D for consistency, monkey patch in old
name for PyQGIS compatibility
2023-07-20 15:31:00 +10:00
Nyall Dawson
8a259dd1d4 Fix documentation warning 2023-07-18 12:35:45 +02:00
Nyall Dawson
8f995fbdba Make root bounding volume accessible from tiled mesh data provider,
fix extent/crs handling for sphere/box bounding volume types

There's a tricky consideration here -- the default crs for sphere/
box bounding volumes is EPSG:4978. But we CANNOT transform from
EPSG:4978 without using valid z values (otherwise we get nonsense
results). This raises an issue with all the various QgsMapLayer
methods which use QgsMapLayer::crs to transform layer properties,
eg the layer's extent. If we advertise the layer (correctly) as
EPSG:4978, then the layer's extent will be incorrectly calculated
in 1000s of places in QGIS (and we are violating the api design
of these methods!)

So we handle this by always advertising these sources as EPSG:4979
(ie a geographic degrees based CRS of WGS84+height), and transform
the source's bounding volume to EPSG:4979 within the data provider,
considering correctly the source's z values, and use THIS as the
data provider's extent.

Then we add a new method to the QgsTiledMeshDataProvider interface
for meshCrs(), which returns the ACTUAL crs that the mesh
geometries are in (ie. EPSG:4978).

Care must be taken to use the correct choice of the advertised crs()
vs meshCrs() in methods which interact with tiled mesh data.
2023-07-18 12:35:45 +02:00
Nyall Dawson
f658e5de7b Create class for representing tiled mesh node bounding volumes
And implement for sphere, region and oriented box bounding volume
types
2023-07-18 12:35:45 +02:00
Nyall Dawson
c4b3608462 Rename to QgsOrientedBox3d 2023-07-16 14:43:38 +10:00
Nyall Dawson
8ca716907e Move QgsOrientedBoundingBox out to own file 2023-07-16 14:43:38 +10:00
Nyall Dawson
d1d0f02661 Handle spherical volumes for cesium layer bounds 2023-07-16 14:43:38 +10:00
Nyall Dawson
015fff4d39 Add support for oriented boxes as cesium volumes 2023-07-16 14:43:38 +10:00
Nyall Dawson
a739ad7097 Use nlohmann for json instead of QVariant
But leave QVariant version of util function for use in Python scripts
2023-07-12 14:58:33 +10:00
Nyall Dawson
b81e52dd43 Parse bounding region values from cesium tiles root tileset 2023-07-12 14:58:33 +10:00
Nyall Dawson
abeb8ae5fa Read tileset on creating cesium tiles data provider
And add some very basic provider metadata
2023-07-12 14:58:33 +10:00
Nyall Dawson
aa59687137 Setup framework for tiled mesh data providers to be cloned 2023-07-12 14:58:33 +10:00
Nyall Dawson
4557632c46 Move enum 2023-06-28 17:47:17 +10:00
Nyall Dawson
5cf8f2ceb5 Shell for QgsTiledMeshLayer/QgsTiledMeshDataProvider 2023-06-28 17:47:17 +10:00