QGIS API Documentation 3.99.0-Master (752b475928d)
Loading...
Searching...
No Matches
qgsgltf3dutils.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsgltfutils.h
3 --------------------------------------
4 Date : July 2023
5 Copyright : (C) 2023 by Martin Dobias
6 Email : wonder dot sk at gmail dot com
7 ***************************************************************************
8 * *
9 * This program is free software; you can redistribute it and/or modify *
10 * it under the terms of the GNU General Public License as published by *
11 * the Free Software Foundation; either version 2 of the License, or *
12 * (at your option) any later version. *
13 * *
14 ***************************************************************************/
15
16#ifndef QGSGLTF3DUTILS_H
17#define QGSGLTF3DUTILS_H
18
20
21//
22// W A R N I N G
23// -------------
24//
25// This file is not part of the QGIS API. It exists purely as an
26// implementation detail. This header file may change from version to
27// version without notice, or even be removed.
28//
29
30#define SIP_NO_FILE
31
32#include "qgis_3d.h"
33#include "qgsmatrix4x4.h"
34
35#define TINYGLTF_NO_STB_IMAGE // we use QImage-based reading of images
36#define TINYGLTF_NO_STB_IMAGE_WRITE // we don't need writing of images
37#include "tiny_gltf.h"
38
40
41namespace Qt3DCore
42{
43 class QEntity;
44}
45
53class _3D_EXPORT QgsGltf3DUtils
54{
55 public:
57 struct EntityTransform
58 {
60 QgsVector3D chunkOriginTargetCrs;
62 QgsMatrix4x4 tileTransform;
64 const QgsCoordinateTransform *ecefToTargetCrs = nullptr;
65
67 Qgis::Axis gltfUpAxis = Qgis::Axis::Y;
68
69 double zValueScale = 1;
70 double zValueOffset = 0;
71 };
72
86 static Qt3DCore::QEntity *gltfToEntity( const QByteArray &data, const EntityTransform &transform, const QString &baseUri, QStringList *errors = nullptr );
87
92 static Qt3DCore::QEntity *parsedGltfToEntity( tinygltf::Model &model, const QgsGltf3DUtils::EntityTransform &transform, QString baseUri, QStringList *errors );
93};
94
96
97#endif // QGSGLTF3DUTILS_H
Axis
Cartesian axes.
Definition qgis.h:2451
@ Y
Y-axis.
Definition qgis.h:2453
Handles coordinate transforms between two coordinate systems.