16 #ifndef QGSMAPRENDER_H
17 #define QGSMAPRENDER_H
21 #include <QStringList>
48 QgsLabelPosition(
int id,
double r,
const QVector< QgsPoint >& corners,
const QgsRectangle& rect,
double w,
double h,
const QString& layer,
const QString& labeltext,
const QFont& labelfont,
bool upside_down,
bool diagram =
false,
bool pinned =
false ):
49 featureId( id ), rotation( r ), cornerPoints( corners ), labelRect( rect ), width( w ), height( h ), layerID( layer ), labelText( labeltext ), labelFont( labelfont ), upsideDown( upside_down ), isDiagram( diagram ), isPinned( pinned ) {}
50 QgsLabelPosition(): featureId( -1 ), rotation( 0 ), labelRect(
QgsRectangle() ), width( 0 ), height( 0 ), layerID(
"" ), labelText(
"" ), labelFont( QFont() ), upsideDown( false ), isDiagram( false ), isPinned( false ) {}
80 virtual void clearActiveLayers() = 0;
92 { Q_UNUSED( layer ); Q_UNUSED( s );
return 0; }
97 { Q_UNUSED( layer ); Q_UNUSED( feat ); Q_UNUSED( context ); }
101 virtual void exit() = 0;
104 virtual QList<QgsLabelPosition> labelsAtPosition(
const QgsPoint& p ) = 0;
107 virtual QList<QgsLabelPosition> labelsWithinRect(
const QgsRectangle& r ) = 0;
161 void render( QPainter* painter,
double* forceWidthScale = 0 );
172 double scale()
const {
return mScale; }
178 int width()
const {
return mSize.width(); };
179 int height()
const {
return mSize.height(); };
190 void setOutputSize( QSize
size,
int dpi );
191 void setOutputSize( QSizeF
size,
double dpi );
197 QSizeF outputSizeF();
240 void setProjectionsEnabled(
bool enabled );
243 bool hasCrsTransformEnabled()
const;
259 QStringList& layerSet();
262 void setLayerSet(
const QStringList& layers );
265 void updateFullExtent();
268 bool readXML( QDomNode & theNode );
271 bool writeXML( QDomNode & theNode, QDomDocument & theDoc );
294 void drawingProgress(
int current,
int total );
296 void hasCrsTransformEnabled(
bool flag );
298 void destinationSrsChanged();
302 void mapUnitsChanged();
310 void onDrawingProgress(
int current,
int total );
315 void adjustExtentToSize();