16 #ifndef QGSMAPRENDER_H
17 #define QGSMAPRENDER_H
21 #include <QStringList>
49 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 ):
50 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 ) {}
51 QgsLabelPosition(): featureId( -1 ), rotation( 0 ), labelRect(
QgsRectangle() ), width( 0 ), height( 0 ), layerID(
"" ), labelText(
"" ), labelFont( QFont() ), upsideDown( false ), isDiagram( false ), isPinned( false ) {}
81 virtual void clearActiveLayers() = 0;
83 virtual void clearActiveLayer(
const QString& layerID ) = 0;
90 { Q_UNUSED( layer ); Q_UNUSED( s );
return 0; }
95 { Q_UNUSED( layerID ); Q_UNUSED( feat ); Q_UNUSED( context ); }
99 virtual void exit() = 0;
102 Q_DECL_DEPRECATED
virtual QList<QgsLabelPosition> labelsAtPosition(
const QgsPoint& p ) = 0;
105 Q_DECL_DEPRECATED
virtual QList<QgsLabelPosition> labelsWithinRect(
const QgsRectangle& r ) = 0;
179 void render( QPainter* painter,
double* forceWidthScale = 0 );
190 void setRotation(
double degrees );
194 double rotation()
const;
199 double scale()
const {
return mScale; }
205 int width()
const {
return (
int ) mSize.width(); }
206 int height()
const {
return (
int ) mSize.height(); }
217 void setOutputSize( QSize
size,
int dpi );
218 void setOutputSize( QSizeF
size,
double dpi );
224 QSizeF outputSizeF();
267 void setProjectionsEnabled(
bool enabled );
270 bool hasCrsTransformEnabled()
const;
273 void setDestinationCrs(
const QgsCoordinateReferenceSystem& crs,
bool refreshCoordinateTransformInfo =
true,
bool transformExtent =
true );
286 QStringList& layerSet();
289 void setLayerSet(
const QStringList& layers );
292 void updateFullExtent();
295 bool readXML( QDomNode & theNode );
298 bool writeXML( QDomNode & theNode, QDomDocument & theDoc );
315 void addLayerCoordinateTransform(
const QString& layerId,
const QString& srcAuthId,
const QString& destAuthId,
int srcDatumTransform = -1,
int destDatumTransform = -1 );
316 void clearLayerCoordinateTransforms();
335 void drawingProgress(
int current,
int total );
344 void hasCrsTransformEnabled(
bool flag );
349 void hasCrsTransformEnabledChanged(
bool flag );
351 void destinationSrsChanged();
356 void mapUnitsChanged();
363 void extentsChanged();
367 void rotationChanged(
double );
370 void datumTransformInfoRequested(
const QgsMapLayer* ml,
const QString& srcAuthId,
const QString& destAuthId )
const;
376 Q_DECL_DEPRECATED
void onDrawingProgress(
int current,
int total );
381 void adjustExtentToSize();