@@ -22,7 +22,11 @@ class QgsProject;
22
22
23
23
class QDomElement ;
24
24
25
- // ! Definition of the world
25
+ /* * \ingroup 3d
26
+ * Definition of the world
27
+ *
28
+ * \since QGIS 3.0
29
+ */
26
30
class _3D_EXPORT Qgs3DMapSettings : public QObject
27
31
{
28
32
Q_OBJECT
@@ -31,42 +35,71 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject
31
35
Qgs3DMapSettings ( const Qgs3DMapSettings &other );
32
36
~Qgs3DMapSettings ();
33
37
38
+ // ! Reads configuration from a DOM element previously written by writeXml()
34
39
void readXml ( const QDomElement &elem, const QgsReadWriteContext &context );
35
-
40
+ // ! Writes configuration to a DOM element, to be used later with readXml()
36
41
QDomElement writeXml ( QDomDocument &doc, const QgsReadWriteContext &context ) const ;
37
-
42
+ // ! Resolves references to other objects (map layers) after the call to readXml()
38
43
void resolveReferences ( const QgsProject &project );
39
44
40
45
double originX, originY, originZ; // !< Coordinates in map CRS at which our 3D world has origin (0,0,0)
41
46
QgsCoordinateReferenceSystem crs; // !< Destination coordinate system of the world (TODO: not needed? can be
42
47
48
+ // ! Sets background color of the 3D map view
43
49
void setBackgroundColor ( const QColor &color );
50
+ // ! Returns background color of the 3D map view
44
51
QColor backgroundColor () const ;
45
52
53
+ // ! Sets color used for selected features
46
54
void setSelectionColor ( const QColor &color );
55
+ // ! Returns color used for selected features
47
56
QColor selectionColor () const ;
48
57
49
58
//
50
59
// terrain related config
51
60
//
52
61
62
+ // ! Sets vertical scale (exaggeration) of terrain
63
+ // ! (1 = true scale, > 1 = hills get more pronounced)
53
64
void setTerrainVerticalScale ( double zScale );
65
+ // ! Returns vertical scale (exaggeration) of terrain
54
66
double terrainVerticalScale () const ;
55
67
68
+ // ! Sets the list of map layers to be rendered as a texture of the terrain
56
69
void setLayers ( const QList<QgsMapLayer *> &layers );
70
+ // ! Returns the list of map layers to be rendered as a texture of the terrain
57
71
QList<QgsMapLayer *> layers () const ;
58
72
73
+ // ! Sets resolution (in pixels) of the texture of a terrain tile
74
+ // ! \sa mapTileResolution()
59
75
void setMapTileResolution ( int res );
76
+ // ! Returns resolution (in pixels) of the texture of a terrain tile. This parameter influences
77
+ // ! how many zoom levels for terrain tiles there will be (together with maxTerrainGroundError())
60
78
int mapTileResolution () const ;
61
79
80
+ // ! Sets maximum allowed screen error of terrain tiles in pixels.
81
+ // ! \sa maxTerrainScreenError()
62
82
void setMaxTerrainScreenError ( float error );
83
+ // ! Returns maximum allowed screen error of terrain tiles in pixels. This parameter decides
84
+ // ! how aggressively less detailed terrain tiles are swapped to more detailed ones as camera gets closer.
85
+ // ! Each tile has its error defined in world units - this error gets projected to screen pixels
86
+ // ! according to camera view and if the tile's error is greater than the allowed error, it will
87
+ // ! be swapped by more detailed tiles with lower error.
63
88
float maxTerrainScreenError () const ;
64
89
90
+ // ! Returns maximum ground error of terrain tiles in world units.
91
+ // ! \sa maxTerrainGroundError()
65
92
void setMaxTerrainGroundError ( float error );
93
+ // ! Returns maximum ground error of terrain tiles in world units. This parameter influences
94
+ // ! how many zoom levels there will be (together with mapTileResolution()).
95
+ // ! This value tells that when the given ground error is reached (e.g. 10 meters), it makes no sense
96
+ // ! to further split terrain tiles into finer ones because they will not add extra details anymore.
66
97
float maxTerrainGroundError () const ;
67
98
99
+ // ! Sets terrain generator. It takes care of producing terrain tiles from the input data.
68
100
// ! Takes ownership of the generator
69
101
void setTerrainGenerator ( TerrainGenerator *gen );
102
+ // ! Returns terrain generator. It takes care of producing terrain tiles from the input data.
70
103
TerrainGenerator *terrainGenerator () const { return mTerrainGenerator .get (); }
71
104
72
105
//
@@ -79,21 +112,35 @@ class _3D_EXPORT Qgs3DMapSettings : public QObject
79
112
QString skyboxFileBase;
80
113
QString skyboxFileExtension;
81
114
115
+ // ! Sets whether to display bounding boxes of terrain tiles (for debugging)
82
116
void setShowTerrainBoundingBoxes ( bool enabled );
117
+ // ! Returns whether to display bounding boxes of terrain tiles (for debugging)
83
118
bool showTerrainBoundingBoxes () const { return mShowTerrainBoundingBoxes ; }
119
+ // ! Sets whether to display extra tile info on top of terrain tiles (for debugging)
84
120
void setShowTerrainTilesInfo ( bool enabled );
121
+ // ! Returns whether to display extra tile info on top of terrain tiles (for debugging)
85
122
bool showTerrainTilesInfo () const { return mShowTerrainTileInfo ; }
86
123
87
124
signals:
125
+ // ! Emitted when the background color has changed
88
126
void backgroundColorChanged ();
127
+ // ! Emitted when the selection color has changed
89
128
void selectionColorChanged ();
129
+ // ! Emitted when the list of map layers for terrain texture has changed
90
130
void layersChanged ();
131
+ // ! Emitted when the terrain generator has changed
91
132
void terrainGeneratorChanged ();
133
+ // ! Emitted when the vertical scale of the terrain has changed
92
134
void terrainVerticalScaleChanged ();
135
+ // ! Emitted when the map tile resoulution has changed
93
136
void mapTileResolutionChanged ();
137
+ // ! Emitted when the maximum terrain screen error has changed
94
138
void maxTerrainScreenErrorChanged ();
139
+ // ! Emitted when the maximum terrain ground error has changed
95
140
void maxTerrainGroundErrorChanged ();
141
+ // ! Emitted when the flag whether terrain's bounding boxes are shown has changed
96
142
void showTerrainBoundingBoxesChanged ();
143
+ // ! Emitted when the flag whether terrain's tile info is shown has changed
97
144
void showTerrainTilesInfoChanged ();
98
145
99
146
private:
0 commit comments