QGIS API Documentation 3.39.0-Master (3aed037ce22)
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
86 QgsTiledSceneLayer( const QgsTiledSceneLayer &other ) = delete;
88
89#ifdef SIP_RUN
90 SIP_PYOBJECT __repr__();
91 % MethodCode
92 QString str = QStringLiteral( "<QgsTiledSceneLayer: '%1' (%2)>" ).arg( sipCpp->name(), sipCpp->dataProvider() ? sipCpp->dataProvider()->name() : QStringLiteral( "Invalid" ) );
93 sipRes = PyUnicode_FromString( str.toUtf8().constData() );
94 % End
95#endif
96
97 QgsTiledSceneLayer *clone() const override SIP_FACTORY;
98 QgsRectangle extent() const override;
99 QgsTiledSceneDataProvider *dataProvider() override;
100 const QgsTiledSceneDataProvider *dataProvider() const override SIP_SKIP;
101 bool readXml( const QDomNode &layerNode, QgsReadWriteContext &context ) override;
102 bool writeXml( QDomNode &layerNode, QDomDocument &doc, const QgsReadWriteContext &context ) const override;
103 bool readSymbology( const QDomNode &node, QString &errorMessage,
104 QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) override;
105 bool readStyle( const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) FINAL;
106 bool writeSymbology( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context,
107 StyleCategories categories = AllStyleCategories ) const override;
108 bool writeStyle( QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories = AllStyleCategories ) const FINAL;
109 void setTransformContext( const QgsCoordinateTransformContext &transformContext ) override;
110 QString encodedSource( const QString &source, const QgsReadWriteContext &context ) const override;
111 QString decodedSource( const QString &source, const QString &dataProvider, const QgsReadWriteContext &context ) const override;
112 QString loadDefaultStyle( bool &resultFlag SIP_OUT ) FINAL;
113 QString htmlMetadata() const override;
114 QgsMapLayerRenderer *createMapRenderer( QgsRenderContext &rendererContext ) override SIP_FACTORY;
115 QString loadDefaultMetadata( bool &resultFlag SIP_OUT ) override;
116 QgsMapLayerElevationProperties *elevationProperties() override;
117
123 QgsTiledSceneRenderer *renderer();
124
131 const QgsTiledSceneRenderer *renderer() const SIP_SKIP;
132
140 void setRenderer( QgsTiledSceneRenderer *renderer SIP_TRANSFER );
141
142 private slots:
143 void setDataSourcePrivate( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, Qgis::DataProviderReadFlags flags ) override;
144
145 private:
146
147 bool isReadOnly() const override;
148
149#ifdef SIP_RUN
151#endif
152
153 std::unique_ptr<QgsTiledSceneDataProvider> mDataProvider;
154 std::unique_ptr<QgsTiledSceneRenderer> mRenderer;
155 QgsTiledSceneLayerElevationProperties *mElevationProperties = nullptr;
156
157 LayerOptions mLayerOptions;
158};
159
160
161#endif // QGSTILEDSCENELAYER_H
The Qgis class provides global constants for use throughout the application.
Definition qgis.h:54
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:75
QFlags< StyleCategory > StyleCategories
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(const QgsTiledSceneLayer &other)=delete
~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:242
#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.