@@ -13,6 +13,14 @@ class QgsMapRenderer : QObject
13
13
14
14
public:
15
15
16
+ /**Output units for pen width and point marker width/height*/
17
+ enum OutputUnits
18
+ {
19
+ Millimeters,
20
+ Pixels
21
+ //MAP_UNITS probably supported in future versions
22
+ };
23
+
16
24
//! constructor
17
25
QgsMapRenderer();
18
26
@@ -26,11 +34,14 @@ class QgsMapRenderer : QObject
26
34
bool setExtent(const QgsRectangle& extent);
27
35
28
36
//! returns current extent
29
- QgsRectangle extent();
37
+ QgsRectangle extent() const ;
30
38
31
39
const QgsMapToPixel* coordinateTransform();
32
40
33
41
double scale() const;
42
+ /**Sets scale for scale based visibility. Normally, the scale is calculated automatically. This
43
+ function is only used to force a preview scale (e.g. for print composer)*/
44
+ void setScale( double scale );
34
45
double mapUnitsPerPixel() const;
35
46
36
47
int width() const;
@@ -40,6 +51,7 @@ class QgsMapRenderer : QObject
40
51
//! Recalculate the map scale
41
52
void updateScale();
42
53
54
+ QgsDistanceArea* distanceArea();
43
55
QGis::UnitType mapUnits() const;
44
56
void setMapUnits(QGis::UnitType u);
45
57
@@ -77,6 +89,10 @@ class QgsMapRenderer : QObject
77
89
//! returns CRS ID of destination spatial reference system
78
90
const QgsCoordinateReferenceSystem& destinationSrs();
79
91
92
+ void setOutputUnits( OutputUnits u );
93
+
94
+ OutputUnits outputUnits() const;
95
+
80
96
//! returns current extent of layer set
81
97
QgsRectangle fullExtent();
82
98
@@ -95,9 +111,12 @@ class QgsMapRenderer : QObject
95
111
//! write settings
96
112
bool writeXML(QDomNode & theNode, QDomDocument & theDoc);
97
113
114
+ //! Accessor for render context
115
+ QgsRenderContext* rendererContext();
116
+
98
117
signals:
99
118
100
- void setProgress (int current, int total);
119
+ void drawingProgress (int current, int total);
101
120
102
121
void hasCrsTransformEnabled(bool flag);
103
122
0 commit comments