QGIS API Documentation 4.0.0-Norrköping (1ddcee3d0e4)
Loading...
Searching...
No Matches
qgscesiumutils.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscesiumutils.h
3 --------------------
4 begin : July 2023
5 copyright : (C) 2023 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ******************************************************************
8 ***************************************************************************/
9
10/***************************************************************************
11 * *
12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. *
16 * *
17 ***************************************************************************/
18
19#ifndef QGSCESIUMUTILS_H
20#define QGSCESIUMUTILS_H
21
22#include <nlohmann/json_fwd.hpp>
23
24#include "qgis_core.h"
25#include "qgis_sip.h"
26#include "qgsbox3d.h"
27#include "qgsvector3d.h"
28
29#ifndef SIP_RUN
30using namespace nlohmann;
31#endif
32
33class QgsSphere;
35class QgsMatrix4x4;
36
44class CORE_EXPORT QgsCesiumUtils
45{
46 public:
47#ifndef SIP_RUN
48
54 static QgsBox3D parseRegion( const json &region );
55#endif
56
60 static QgsBox3D parseRegion( const QVariantList &region );
61
62#ifndef SIP_RUN
63
69 static QgsOrientedBox3D parseBox( const json &box );
70#endif
71
75 static QgsOrientedBox3D parseBox( const QVariantList &box );
76
77#ifndef SIP_RUN
78
84 static QgsSphere parseSphere( const json &sphere );
85#endif
86
90 static QgsSphere parseSphere( const QVariantList &sphere );
91
95 static QgsSphere transformSphere( const QgsSphere &sphere, const QgsMatrix4x4 &transform );
96
101 {
103 QByteArray gltf;
104
107 };
108
113 static B3DMContents extractGltfFromB3dm( const QByteArray &tileContent );
114
119 {
121 QByteArray gltf;
122
125 };
126
133 static TileContents extractGltfFromTileContent( const QByteArray &tileContent );
134};
135
136#endif // QGSCESIUMUTILS_H
A 3-dimensional box composed of x, y, z coordinates.
Definition qgsbox3d.h:45
Contains utilities for working with Cesium data.
static QgsSphere parseSphere(const json &sphere)
Parses a sphere object from a Cesium JSON document.
static B3DMContents extractGltfFromB3dm(const QByteArray &tileContent)
Extracts GLTF binary data and other contents from the legacy b3dm (Batched 3D Model) tile format.
static QgsOrientedBox3D parseBox(const json &box)
Parses a box object from a Cesium JSON document to an oriented bounding box.
static QgsBox3D parseRegion(const json &region)
Parses a region object from a Cesium JSON object to a 3D box.
static QgsSphere transformSphere(const QgsSphere &sphere, const QgsMatrix4x4 &transform)
Applies a transform to a sphere.
static TileContents extractGltfFromTileContent(const QByteArray &tileContent)
Parses tile content.
A simple 4x4 matrix implementation useful for transformation in 3D space.
Represents a oriented (rotated) box in 3 dimensions.
A spherical geometry object.
Definition qgssphere.h:46
A 3D vector (similar to QVector3D) with the difference that it uses double precision instead of singl...
Definition qgsvector3d.h:33
Encapsulates the contents of a B3DM file.
QByteArray gltf
GLTF binary content.
QgsVector3D rtcCenter
Optional RTC center.
Encapsulates the contents of a 3D tile.
QgsVector3D rtcCenter
Center position of relative-to-center coordinates (when used).
QByteArray gltf
GLTF binary content.