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 double scale()
const {
return mScale; }
196 int width()
const {
return (
int ) mSize.width(); }
197 int height()
const {
return (
int ) mSize.height(); }
208 void setOutputSize( QSize
size,
int dpi );
209 void setOutputSize( QSizeF
size,
double dpi );
215 QSizeF outputSizeF();
258 void setProjectionsEnabled(
bool enabled );
261 bool hasCrsTransformEnabled()
const;
264 void setDestinationCrs(
const QgsCoordinateReferenceSystem& crs,
bool refreshCoordinateTransformInfo =
true,
bool transformExtent =
true );
277 QStringList& layerSet();
280 void setLayerSet(
const QStringList& layers );
283 void updateFullExtent();
286 bool readXML( QDomNode & theNode );
289 bool writeXML( QDomNode & theNode, QDomDocument & theDoc );
306 void addLayerCoordinateTransform(
const QString& layerId,
const QString& srcAuthId,
const QString& destAuthId,
int srcDatumTransform = -1,
int destDatumTransform = -1 );
307 void clearLayerCoordinateTransforms();
326 void drawingProgress(
int current,
int total );
335 void hasCrsTransformEnabled(
bool flag );
340 void hasCrsTransformEnabledChanged(
bool flag );
342 void destinationSrsChanged();
347 void mapUnitsChanged();
354 void extentsChanged();
357 void datumTransformInfoRequested(
const QgsMapLayer* ml,
const QString& srcAuthId,
const QString& destAuthId )
const;
363 Q_DECL_DEPRECATED
void onDrawingProgress(
int current,
int total );
368 void adjustExtentToSize();