QGIS API Documentation 3.36.0-Maidenhead (09951dc0acf)
Loading...
Searching...
No Matches
qgstiledscenetile.cpp
Go to the documentation of this file.
1/***************************************************************************
2 qgstiledscenetile.cpp
3 --------------------
4 begin : June 2023
5 copyright : (C) 2023 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#include "qgstiledscenetile.h"
20
26
28 : mId( id )
29 , mBoundingVolume( QgsTiledSceneBoundingVolume( QgsOrientedBox3D() ) )
30{
31
32}
33
35
37 : mId( other.mId )
38 , mRefinementProcess( other.mRefinementProcess )
39 , mBoundingVolume( other.mBoundingVolume )
40 , mResources( other.mResources )
41 , mGeometricError( other.mGeometricError )
42 , mBaseUrl( other.mBaseUrl )
43 , mMetadata( other.mMetadata )
44{
45 mTransform.reset( other.mTransform ? new QgsMatrix4x4( *other.mTransform.get() ) : nullptr );
46}
47
49{
50 mId = other.mId;
51 mRefinementProcess = other.mRefinementProcess;
52 mTransform.reset( other.mTransform ? new QgsMatrix4x4( *other.mTransform.get() ) : nullptr );
53 mResources = other.mResources;
54 mGeometricError = other.mGeometricError;
55 mBoundingVolume = other.mBoundingVolume;
56 mBaseUrl = other.mBaseUrl;
57 mMetadata = other.mMetadata;
58 return *this;
59}
60
62{
63 mRefinementProcess = process;
64}
65
67{
68 mBoundingVolume = volume;
69}
70
72{
73 return mBoundingVolume;
74}
75
77{
78 if ( transform.isIdentity() )
79 mTransform.reset();
80 else
81 mTransform = std::make_unique< QgsMatrix4x4 >( transform );
82}
83
85{
86 return mResources;
87}
88
89void QgsTiledSceneTile::setResources( const QVariantMap &resources )
90{
91 mResources = resources;
92}
93
95{
96 mGeometricError = error;
97}
98
100{
101 return mBaseUrl;
102}
103
104void QgsTiledSceneTile::setBaseUrl( const QUrl &baseUrl )
105{
106 mBaseUrl = baseUrl;
107}
108
110{
111 return mMetadata;
112}
113
114void QgsTiledSceneTile::setMetadata( const QVariantMap &metadata )
115{
116 mMetadata = metadata;
117}
TileRefinementProcess
Tiled scene tile refinement processes.
Definition qgis.h:4514
A simple 4x4 matrix implementation useful for transformation in 3D space.
bool isIdentity() const
Returns whether this matrix is an identity matrix.
Represents a oriented (rotated) box in 3 dimensions.
Represents a bounding volume for a tiled scene.
Represents an individual tile from a tiled scene data source.
void setTransform(const QgsMatrix4x4 &transform)
Sets the tile's transform.
void setMetadata(const QVariantMap &metadata)
Sets additional metadata attached to the tile.
void setBaseUrl(const QUrl &baseUrl)
Sets the tile's base URL.
QVariantMap resources() const
Returns the resources attached to the tile.
void setGeometricError(double error)
Sets the tile's geometric error, which is the error, in scene CRS units, of the tile's simplified rep...
const QgsTiledSceneBoundingVolume & boundingVolume() const
Returns the bounding volume for the tile.
QgsTiledSceneTile()
Constructor for an invalid tile.
void setRefinementProcess(Qgis::TileRefinementProcess process)
Sets the tile's refinement process.
void setBoundingVolume(const QgsTiledSceneBoundingVolume &volume)
Sets the bounding volume for the tile.
QVariantMap metadata() const
Returns additional metadata attached to the tile.
const QgsMatrix4x4 * transform() const
Returns the tile's transform.
void setResources(const QVariantMap &resources)
Sets the resources attached to the tile.
QUrl baseUrl() const
Returns the tile's base URL.
QgsTiledSceneTile & operator=(const QgsTiledSceneTile &other)
Assignment operator.