QGIS API Documentation 3.99.0-Master (d270888f95f)
Loading...
Searching...
No Matches
qgsabstractvectorlayer3drenderer.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsabstractvectorlayer3drenderer.h
3 --------------------------------------
4 Date : January 2020
5 Copyright : (C) 2020 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 QGSABSTRACTVECTORLAYER3DRENDERER_H
17#define QGSABSTRACTVECTORLAYER3DRENDERER_H
18
19#include "qgis_3d.h"
20#include "qgis_sip.h"
22#include "qgsmaplayerref.h"
23
24class QgsVectorLayer;
25
44{
45 public:
54 Q_DECL_DEPRECATED int zoomLevelsCount() const SIP_DEPRECATED { return mZoomLevelsCount; }
55
60 Q_DECL_DEPRECATED void setZoomLevelsCount( int count ) SIP_DEPRECATED { mZoomLevelsCount = count; }
61
63 void setShowBoundingBoxes( bool enabled ) { mShowBoundingBoxes = enabled; }
65 bool showBoundingBoxes() const { return mShowBoundingBoxes; }
66
74 int maximumChunkFeatures() const { return mMaxChunkFeatures; }
75
83 void setMaximumChunkFeatures( int value ) { mMaxChunkFeatures = value; }
84
86 void writeXml( QDomElement &elem ) const;
88 void readXml( const QDomElement &elem );
89
96 static double tileGeometryErrorRatio() SIP_SKIP { return 0.01; }
97
105 static double maximumLeafExtent() SIP_SKIP { return 500'000; }
106
107 private:
108 int mZoomLevelsCount = 3;
109 bool mShowBoundingBoxes = false;
110 int mMaxChunkFeatures = 1000;
111};
112
113
121{
122 public:
124
128 QgsVectorLayer *layer() const;
129
131 void setTilingSettings( const QgsVectorLayer3DTilingSettings &settings ) { mTilingSettings = settings; }
133 QgsVectorLayer3DTilingSettings tilingSettings() const { return mTilingSettings; }
134
135 void resolveReferences( const QgsProject &project ) override;
136
137 protected:
139 void copyBaseProperties( QgsAbstractVectorLayer3DRenderer *r ) const;
141 void writeXmlBaseProperties( QDomElement &elem, const QgsReadWriteContext &context ) const;
143 void readXmlBaseProperties( const QDomElement &elem, const QgsReadWriteContext &context );
144
145 private:
146 QgsMapLayerRef mLayerRef;
147 QgsVectorLayer3DTilingSettings mTilingSettings;
148};
149
150#endif // QGSABSTRACTVECTORLAYER3DRENDERER_H
QgsAbstract3DRenderer()=default
Base class for 3D renderers that are based on vector layers.
void setTilingSettings(const QgsVectorLayer3DTilingSettings &settings)
Sets tiling settings of the renderer.
QgsVectorLayer3DTilingSettings tilingSettings() const
Returns tiling settings of the renderer.
void setLayer(QgsVectorLayer *layer)
Sets vector layer associated with the renderer.
QgsVectorLayer * layer() const
Returns vector layer associated with the renderer.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:112
A container for the context for various read/write operations on objects.
Defines configuration of how a vector layer gets tiled for 3D rendering.
void setMaximumChunkFeatures(int value)
Sets the maximum number of features that will be fetched in any chunk.
Q_DECL_DEPRECATED int zoomLevelsCount() const
Returns number of zoom levels.
void setShowBoundingBoxes(bool enabled)
Sets whether to display bounding boxes of entity's tiles (for debugging).
static double tileGeometryErrorRatio()
This is the ratio of tile's largest size to geometry error and is used when setting the root tile's e...
int maximumChunkFeatures() const
Returns the maximum number of features that will be fetched in any chunk.
Q_DECL_DEPRECATED void setZoomLevelsCount(int count)
Sets number of zoom levels.
bool showBoundingBoxes() const
Returns whether to display bounding boxes of entity's tiles (for debugging).
static double maximumLeafExtent()
This is the maximum width or height a tile can have and still be considered a leaf node.
Represents a vector layer which manages a vector based dataset.
#define SIP_DEPRECATED
Definition qgis_sip.h:114
#define SIP_SKIP
Definition qgis_sip.h:134
#define SIP_ABSTRACT
Definition qgis_sip.h:221
_LayerRef< QgsMapLayer > QgsMapLayerRef