QGIS API Documentation  3.26.3-Buenos Aires (65e4edfdad)
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"
21 
22 #include "qgsabstract3drenderer.h"
23 #include "qgsmaplayerref.h"
24 
25 class QgsVectorLayer;
26 
38 {
39  public:
40 
48  int zoomLevelsCount() const { return mZoomLevelsCount; }
49 
53  void setZoomLevelsCount( int count ) { mZoomLevelsCount = count; }
54 
56  void setShowBoundingBoxes( bool enabled ) { mShowBoundingBoxes = enabled; }
58  bool showBoundingBoxes() const { return mShowBoundingBoxes; }
59 
61  void writeXml( QDomElement &elem ) const;
63  void readXml( const QDomElement &elem );
64 
65  private:
66  int mZoomLevelsCount = 3;
67  bool mShowBoundingBoxes = false;
68 };
69 
70 
78 {
79  public:
81 
83  void setLayer( QgsVectorLayer *layer );
85  QgsVectorLayer *layer() const;
86 
88  void setTilingSettings( const QgsVectorLayer3DTilingSettings &settings ) { mTilingSettings = settings; }
90  QgsVectorLayer3DTilingSettings tilingSettings() const { return mTilingSettings; }
91 
92  void resolveReferences( const QgsProject &project ) override;
93 
94  protected:
96  void copyBaseProperties( QgsAbstractVectorLayer3DRenderer *r ) const;
98  void writeXmlBaseProperties( QDomElement &elem, const QgsReadWriteContext &context ) const;
100  void readXmlBaseProperties( const QDomElement &elem, const QgsReadWriteContext &context );
101 
102  private:
103  QgsMapLayerRef mLayerRef;
104  QgsVectorLayer3DTilingSettings mTilingSettings;
105 };
106 
107 #endif // QGSABSTRACTVECTORLAYER3DRENDERER_H
QgsReadWriteContext
The class is used as a container of context for various read/write operations on other objects.
Definition: qgsreadwritecontext.h:34
QgsAbstract3DRenderer
Base class for all renderers that may to participate in 3D view.
Definition: qgsabstract3drenderer.h:48
QgsVectorLayer3DTilingSettings::setShowBoundingBoxes
void setShowBoundingBoxes(bool enabled)
Sets whether to display bounding boxes of entity's tiles (for debugging)
Definition: qgsabstractvectorlayer3drenderer.h:56
QgsVectorLayer3DTilingSettings::showBoundingBoxes
bool showBoundingBoxes() const
Returns whether to display bounding boxes of entity's tiles (for debugging)
Definition: qgsabstractvectorlayer3drenderer.h:58
qgsabstract3drenderer.h
QgsAbstractVectorLayer3DRenderer
Base class for 3D renderers that are based on vector layers.
Definition: qgsabstractvectorlayer3drenderer.h:77
QgsVectorLayer3DTilingSettings::setZoomLevelsCount
void setZoomLevelsCount(int count)
Sets number of zoom levels.
Definition: qgsabstractvectorlayer3drenderer.h:53
QgsProject
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:103
QgsAbstract3DRenderer::resolveReferences
virtual void resolveReferences(const QgsProject &project)
Resolves references to other objects - second phase of loading - after readXml()
Definition: qgsabstract3drenderer.cpp:19
QgsAbstractVectorLayer3DRenderer::tilingSettings
QgsVectorLayer3DTilingSettings tilingSettings() const
Returns tiling settings of the renderer.
Definition: qgsabstractvectorlayer3drenderer.h:90
qgis_sip.h
QgsVectorLayer3DTilingSettings::zoomLevelsCount
int zoomLevelsCount() const
Returns number of zoom levels.
Definition: qgsabstractvectorlayer3drenderer.h:48
QgsVectorLayer
Represents a vector layer which manages a vector based data sets.
Definition: qgsvectorlayer.h:391
QgsAbstractVectorLayer3DRenderer::setTilingSettings
void setTilingSettings(const QgsVectorLayer3DTilingSettings &settings)
Sets tiling settings of the renderer.
Definition: qgsabstractvectorlayer3drenderer.h:88
qgsmaplayerref.h
_LayerRef< QgsMapLayer >
QgsVectorLayer3DTilingSettings
This class defines configuration of how a vector layer gets tiled for 3D rendering.
Definition: qgsabstractvectorlayer3drenderer.h:37
SIP_ABSTRACT
#define SIP_ABSTRACT
Definition: qgis_sip.h:208