QGIS API Documentation 3.99.0-Master (21b3aa880ba)
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
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;
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;
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;
115 QString loadDefaultMetadata( bool &resultFlag SIP_OUT ) override;
117 Qgis::MapLayerProperties properties() const override;
118
125
133
142
143 private slots:
144 void setDataSourcePrivate( const QString &dataSource, const QString &baseName, const QString &provider, const QgsDataProvider::ProviderOptions &options, Qgis::DataProviderReadFlags flags ) override;
145
146 private:
147
148 bool isReadOnly() const override;
149
150#ifdef SIP_RUN
152#endif
153
154 std::unique_ptr<QgsTiledSceneDataProvider> mDataProvider;
155 std::unique_ptr<QgsTiledSceneRenderer> mRenderer;
156 QgsTiledSceneLayerElevationProperties *mElevationProperties = nullptr;
157
158 LayerOptions mLayerOptions;
159};
160
161
162#endif // QGSTILEDSCENELAYER_H
Provides global constants and enumerations for use throughout the application.
Definition qgis.h:56
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.
QString source() const
Returns the source for the layer.
QgsMapLayer(Qgis::LayerType type=Qgis::LayerType::Vector, const QString &name=QString(), const QString &source=QString())
Constructor for QgsMapLayer.
QFlags< StyleCategory > StyleCategories
QgsCoordinateTransformContext transformContext() const
Returns the layer data provider coordinate transform context or a default transform context if the la...
QgsMapLayer::LayerFlags flags
Definition qgsmaplayer.h:96
virtual QgsMapLayer * clone() const =0
Returns a new instance equivalent to this one except for the id which is still unique.
A container for the context for various read/write operations on 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.
Qgis::MapLayerProperties properties() const override
Returns the map layer properties of this layer.
void setTransformContext(const QgsCoordinateTransformContext &transformContext) override
Sets the coordinate transform context to transformContext.
QgsTiledSceneLayer(const QString &uri=QString(), const QString &baseName=QString(), const QString &provider=QString(), const QgsTiledSceneLayer::LayerOptions &options=QgsTiledSceneLayer::LayerOptions())
Constructor for QgsTiledSceneLayer.
QString htmlMetadata() const override
Obtain a formatted HTML string containing assorted metadata for this layer.
bool readSymbology(const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) override
Read the symbology for the current layer from the DOM node supplied.
QString loadDefaultStyle(bool &resultFlag) final
Retrieve the default style for this layer if one exists (either as a .qml file on disk or as a record...
QgsRectangle extent() const override
Returns the extent of the layer.
QString decodedSource(const QString &source, const QString &dataProvider, const QgsReadWriteContext &context) const override
Called by readLayerXML(), used by derived classes to decode provider's specific data source from proj...
QgsTiledSceneLayer & operator=(QgsTiledSceneLayer const &other)=delete
void setRenderer(QgsTiledSceneRenderer *renderer)
Sets the 2D renderer for the tiled scene.
QgsMapLayerElevationProperties * elevationProperties() override
Returns the layer's elevation properties.
QgsTiledSceneLayer(const QgsTiledSceneLayer &other)=delete
QString loadDefaultMetadata(bool &resultFlag) override
Retrieve the default metadata for this layer if one exists (either as a .qmd file on disk or as a rec...
QgsTiledSceneDataProvider * dataProvider() override
Returns the layer's data provider, it may be nullptr.
bool readStyle(const QDomNode &node, QString &errorMessage, QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) final
Read the style for the current layer from the DOM node supplied.
bool writeSymbology(QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) const override
Write the style for the layer into the document provided.
QString encodedSource(const QString &source, const QgsReadWriteContext &context) const override
Called by writeLayerXML(), used by derived classes to encode provider's specific data source to proje...
bool writeStyle(QDomNode &node, QDomDocument &doc, QString &errorMessage, const QgsReadWriteContext &context, StyleCategories categories=AllStyleCategories) const final
Write just the symbology information for the layer into the document.
~QgsTiledSceneLayer() override
QgsTiledSceneRenderer * renderer()
Returns the 2D renderer for the tiled scene.
bool writeXml(QDomNode &layerNode, QDomDocument &doc, const QgsReadWriteContext &context) const override
Called by writeLayerXML(), used by children to write state specific to them to project files.
bool readXml(const QDomNode &layerNode, QgsReadWriteContext &context) override
Called by readLayerXML(), used by children to read state specific to them from project files.
QgsMapLayerRenderer * createMapRenderer(QgsRenderContext &rendererContext) override
Returns new instance of QgsMapLayerRenderer that will be used for rendering of given context.
Abstract base class for 2d tiled scene renderers.
#define SIP_SKIP
Definition qgis_sip.h:134
#define SIP_TRANSFER
Definition qgis_sip.h:36
#define SIP_OUT
Definition qgis_sip.h:58
#define SIP_FACTORY
Definition qgis_sip.h:84
Setting options for loading tiled scene layers.
bool loadDefaultStyle
Set to true if the default layer style should be loaded.
QgsCoordinateTransformContext transformContext
Coordinate transform context.
bool skipCrsValidation
Controls whether the layer is allowed to have an invalid/unknown CRS.
LayerOptions(const QgsCoordinateTransformContext &transformContext=QgsCoordinateTransformContext())
Constructor for LayerOptions with optional transformContext.