@@ -93,13 +93,19 @@ class CORE_EXPORT QgsMapSettings
93
93
// ! returns CRS of destination coordinate reference system
94
94
const QgsCoordinateReferenceSystem& destinationCrs () const ;
95
95
96
+ // ! Get units of map's geographical coordinates - used for scale calculation
96
97
QGis::UnitType mapUnits () const ;
98
+ // ! Set units of map's geographical coordinates - used for scale calculation
97
99
void setMapUnits ( QGis::UnitType u );
98
100
101
+ // ! Set the background color of the map
99
102
void setBackgroundColor ( const QColor& color ) { mBackgroundColor = color; }
103
+ // ! Get the background color of the map
100
104
QColor backgroundColor () const { return mBackgroundColor ; }
101
105
106
+ // ! Set color that is used for drawing of selected vector features
102
107
void setSelectionColor ( const QColor& color ) { mSelectionColor = color; }
108
+ // ! Get color that is used for drawing of selected vector features
103
109
QColor selectionColor () const { return mSelectionColor ; }
104
110
105
111
/* *Sets whether vector selections should be shown in the rendered map
@@ -118,31 +124,40 @@ class CORE_EXPORT QgsMapSettings
118
124
*/
119
125
bool showSelection () const { return mShowSelection ; }
120
126
127
+ // ! Enumeration of flags that adjust the way how map is rendered
121
128
enum Flag
122
129
{
123
- Antialiasing = 0x01 ,
124
- DrawEditingInfo = 0x02 ,
125
- ForceVectorOutput = 0x04 ,
126
- UseAdvancedEffects = 0x08 ,
127
- DrawLabeling = 0x10 ,
128
- UseRenderingOptimization = 0x20 ,
130
+ Antialiasing = 0x01 , // !< Enable anti-aliasin for map rendering
131
+ DrawEditingInfo = 0x02 , // !< Enable drawing of vertex markers for layers in editing mode
132
+ ForceVectorOutput = 0x04 , // !< Vector graphics should not be cached and drawn as raster images
133
+ UseAdvancedEffects = 0x08 , // !< Enable layer transparency and blending effects
134
+ DrawLabeling = 0x10 , // !< Enable drawing of labels on top of the map
135
+ UseRenderingOptimization = 0x20 , // !< Enable vector simplification and other rendering optimizations
129
136
// TODO: ignore scale-based visibility (overview)
130
137
};
131
138
Q_DECLARE_FLAGS ( Flags, Flag )
132
139
140
+ // ! Set combination of flags that will be used for rendering
133
141
void setFlags ( Flags flags );
142
+ // ! Enable or disable a particular flag (other flags are not affected)
134
143
void setFlag ( Flag flag, bool on = true );
144
+ // ! Return combination of flags used for rendering
135
145
Flags flags () const ;
146
+ // ! Check whether a particular flag is enabled
136
147
bool testFlag ( Flag flag ) const ;
137
148
138
149
// ! sets format of internal QImage
139
150
void setOutputImageFormat ( QImage::Format format ) { mImageFormat = format; }
140
151
// ! format of internal QImage, default QImage::Format_ARGB32_Premultiplied
141
152
QImage::Format outputImageFormat () const { return mImageFormat ; }
142
153
154
+ // ! Check whether the map settings are valid and can be used for rendering
143
155
bool hasValidSettings () const ;
156
+ // ! Return the actual extent derived from requested extent that takes takes output image size into account
144
157
QgsRectangle visibleExtent () const ;
158
+ // ! Return the distance in geographical coordinates that equals to one pixel in the map
145
159
double mapUnitsPerPixel () const ;
160
+ // ! Return the calculated scale of the map
146
161
double scale () const ;
147
162
148
163
0 commit comments