QGIS API Documentation 3.34.0-Prizren (ffbdd678812)
Loading...
Searching...
No Matches
qgstiledscenelayer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgstiledscenelayer.h
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#ifndef QGSTILEDSCENELAYER_H
19#define QGSTILEDSCENELAYER_H
20
21#include "qgis_core.h"
22#include "qgsmaplayer.h"
24
27
35class CORE_EXPORT QgsTiledSceneLayer : public QgsMapLayer
36{
37 Q_OBJECT
38
39 public:
40
45 {
46
51 : transformContext( transformContext )
52 {}
53
58
60 bool loadDefaultStyle = true;
61
73 bool skipCrsValidation = false;
74 };
75
79 explicit QgsTiledSceneLayer( const QString &uri = QString(),
80 const QString &baseName = QString(),
81 const QString &provider = QString(),
83
85
87 QgsTiledSceneLayer( const QgsTiledSceneLayer &other ) = delete;
90
91#ifdef SIP_RUN
92 SIP_PYOBJECT __repr__();
93 % MethodCode
94 QString str = QStringLiteral( "<QgsTiledSceneLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral( "Invalid" ) );
95 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
96 % End
97#endif
98
99 QgsTiledSceneLayer *clone() const override SIP_FACTORY;
100 QgsRectangle extent() const override;
101 QgsTiledSceneDataProvider *dataProvider() override;
102 const QgsTiledSceneDataProvider *dataProvider() const override SIP_SKIP;
103 bool readXml( const QDomNode &layerNode, QgsReadWriteContext &context ) override;
104 bool writeXml( QDomNode &layerNode, QDomDocument &doc, const QgsReadWriteContext &context ) const override;
105 bool readSymbology( const QDomNode &node, QString &errorMessage,
106 QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) override;
107 bool readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) FINAL;
108 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
109 StyleCategories categories = AllStyleCategories ) const override;
110 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) const FINAL;
111 void setTransformContext( const QgsCoordinateTransformContext &transformContext ) override;
112 QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const override;
113 QString decodedSource( const QString &source, const QString &dataProvider, const QgsReadWriteContext &context ) const override;
114 QString loadDefaultStyle( bool &resultFlag SIP_OUT ) FINAL;
115 QString htmlMetadata() const override;
116 QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) override SIP_FACTORY;
117 QString loadDefaultMetadata( bool &resultFlag SIP_OUT ) override;
118 QgsMapLayerElevationProperties *elevationProperties() override;
119
125 QgsTiledSceneRenderer *renderer();
126
133 const QgsTiledSceneRenderer *renderer() const SIP_SKIP;
134
142 void setRenderer( QgsTiledSceneRenderer *renderer SIP_TRANSFER );
143
144 private slots:
145 void setDataSourcePrivate( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, QgsDataProvider::ReadFlags flags ) override;
146
147 private:
148
149 bool isReadOnly() const override;
150
151#ifdef SIP_RUN
153#endif
154
155 std::unique_ptr<QgsTiledSceneDataProvider> mDataProvider;
156 std::unique_ptr<QgsTiledSceneRenderer> mRenderer;
157 QgsTiledSceneLayerElevationProperties *mElevationProperties = nullptr;
158
159 LayerOptions mLayerOptions;
160};
161
162
163#endif // QGSTILEDSCENELAYER_H
Contains information about the context in which a coordinate transform is executed.
Abstract base class for spatial data provider implementations.
Base class for storage of map layer elevation properties.
Base class for utility classes that encapsulate information necessary for rendering of map layers.
Base class for all map layer types.
Definition qgsmaplayer.h:74
virtual QgsMapLayer * clone() const =0
Returns a new instance equivalent to this one except for the id which is still unique.
The class is used as a container of context for various read/write operations on other objects.
A rectangle specified with double values.
Contains information about the context of a rendering operation.
Base class for data providers for QgsTiledSceneLayer.
Tiled scene layer specific subclass of QgsMapLayerElevationProperties.
Represents a map layer supporting display of tiled scene objects.
QgsTiledSceneLayer & operator=(QgsTiledSceneLayer const &other)=delete
QgsTiledSceneLayer cannot be copied.
QgsTiledSceneLayer(const QgsTiledSceneLayer &other)=delete
QgsTiledSceneLayer cannot be copied.
~QgsTiledSceneLayer() override
Abstract base class for 2d tiled scene renderers.
#define str(x)
Definition qgis.cpp:38
#define SIP_SKIP
Definition qgis_sip.h:126
#define FINAL
Definition qgis_sip.h:237
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_OUT
Definition qgis_sip.h:58
#define SIP_FACTORY
Definition qgis_sip.h:76
Setting options for loading tiled scene layers.
QgsCoordinateTransformContext transformContext
Coordinate transform context.
LayerOptions(const QgsCoordinateTransformContext &transformContext=QgsCoordinateTransformContext())
Constructor for LayerOptions with optional transformContext.