QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
QgsMapRenderer Class Reference

A non GUI class for rendering a map layer set onto a QPainter. More...

#include <qgsmaprenderer.h>

Inheritance diagram for QgsMapRenderer:
Inheritance graph
[legend]

Public Types

enum  BlendMode {
  BlendNormal, BlendLighten, BlendScreen, BlendDodge,
  BlendAddition, BlendDarken, BlendMultiply, BlendBurn,
  BlendOverlay, BlendSoftLight, BlendHardLight, BlendDifference,
  BlendSubtract, BlendSource, BlendDestinationOver, BlendClear,
  BlendDestination, BlendSourceIn, BlendDestinationIn, BlendSourceOut,
  BlendDestinationOut, BlendSourceAtop, BlendDestinationAtop, BlendXor
}
 Blending modes enum defining the available composition modes that can be used when rendering a layer. More...
 
enum  OutputUnits { Millimeters, Pixels }
 Output units for pen width and point marker width/height. More...
 

Public Slots

Q_DECL_DEPRECATED void onDrawingProgress (int current, int total)
 

Signals

void datumTransformInfoRequested (const QgsMapLayer *ml, const QString &srcAuthId, const QString &destAuthId) const
 Notifies higher level components to show the datum transform dialog and add a QgsLayerCoordinateTransformInfo for that layer. More...
 
void destinationSrsChanged ()
 
void drawError (QgsMapLayer *)
 emitted when layer's draw() returned false More...
 
void drawingProgress (int current, int total)
 
void extentsChanged ()
 emitted when the current extent gets changed More...
 
Q_DECL_DEPRECATED void hasCrsTransformEnabled (bool flag)
 This signal is emitted when CRS transformation is enabled/disabled. More...
 
void hasCrsTransformEnabledChanged (bool flag)
 This signal is emitted when CRS transformation is enabled/disabled. More...
 
void mapUnitsChanged ()
 
void rotationChanged (double)
 emitted when the current rotation gets changed More...
 
void updateMap ()
 

Public Member Functions

 QgsMapRenderer ()
 constructor More...
 
 ~QgsMapRenderer ()
 destructor More...
 
void addLayerCoordinateTransform (const QString &layerId, const QString &srcAuthId, const QString &destAuthId, int srcDatumTransform=-1, int destDatumTransform=-1)
 
void clearLayerCoordinateTransforms ()
 
const QgsMapToPixelcoordinateTransform ()
 
const QgsCoordinateReferenceSystemdestinationCrs () const
 returns CRS of destination coordinate reference system More...
 
void enableOverviewMode (bool isOverview=true)
 sets whether map image will be for overview More...
 
QgsRectangle extent () const
 returns current extent More...
 
QgsRectangle fullExtent ()
 returns current extent of layer set More...
 
bool hasCrsTransformEnabled () const
 returns true if projections are enabled for this layer set More...
 
int height () const
 
QgsLabelingEngineInterfacelabelingEngine ()
 Labeling engine (nullptr if there's no custom engine) More...
 
QgsRectangle layerExtentToOutputExtent (QgsMapLayer *theLayer, QgsRectangle extent)
 transform bounding box from layer's CRS to output CRS More...
 
QStringListlayerSet ()
 returns current layer set More...
 
QgsPoint layerToMapCoordinates (QgsMapLayer *theLayer, QgsPoint point)
 transform point coordinates from layer's CRS to output CRS More...
 
QgsRectangle layerToMapCoordinates (QgsMapLayer *theLayer, QgsRectangle rect)
 transform rectangle from layer's CRS to output CRS More...
 
const QgsMapSettingsmapSettings ()
 bridge to QgsMapSettings More...
 
QgsPoint mapToLayerCoordinates (QgsMapLayer *theLayer, QgsPoint point)
 transform point coordinates from output CRS to layer's CRS More...
 
QgsRectangle mapToLayerCoordinates (QgsMapLayer *theLayer, QgsRectangle rect)
 transform rectangle from output CRS to layer's CRS More...
 
QGis::UnitType mapUnits () const
 
double mapUnitsPerPixel () const
 
double outputDpi ()
 accessor for output dpi More...
 
QgsRectangle outputExtentToLayerExtent (QgsMapLayer *theLayer, QgsRectangle extent)
 transform bounding box from output CRS to layer's CRS More...
 
QSize outputSize () const
 Returns the size which the map will be rendered at. More...
 
QSizeF outputSizeF () const
 Returns the size which the map will be rendered at. More...
 
OutputUnits outputUnits () const
 
bool readXML (QDomNode &theNode)
 read settings More...
 
void render (QPainter *painter, double *forceWidthScale=nullptr)
 starts rendering More...
 
QgsRenderContextrendererContext ()
 Accessor for render context. More...
 
double rotation () const
 returns current rotation in clockwise degrees More...
 
double scale () const
 Scale denominator. More...
 
void setDestinationCrs (const QgsCoordinateReferenceSystem &crs, bool refreshCoordinateTransformInfo=true, bool transformExtent=true)
 sets destination coordinate reference system More...
 
bool setExtent (const QgsRectangle &extent)
 sets extent and checks whether suitable (returns false if not) More...
 
void setFeatureFilterProvider (const QgsFeatureFilterProvider *ffp)
 Set a feature filter provider to filter the features shown in the map. More...
 
void setLabelingEngine (QgsLabelingEngineInterface *iface)
 Set labeling engine. More...
 
void setLayerSet (const QStringList &layers)
 change current layer set More...
 
void setMapUnits (QGis::UnitType u)
 
void setOutputSize (QSize size, double dpi)
 Sets the desired size of the rendered map image. More...
 
void setOutputSize (QSizeF size, double dpi)
 Sets the desired size of the rendered map image. More...
 
void setOutputUnits (OutputUnits u)
 
void setProjectionsEnabled (bool enabled)
 sets whether to use projections for this layer set More...
 
void setRotation (double degrees)
 sets rotation value in clockwise degrees More...
 
void setScale (double scale)
 Sets scale for scale based visibility. More...
 
void setTileRenderMode (bool enabled)
 Set tile mode (render code tries to prevent tile border effects) More...
 
bool splitLayersExtent (QgsMapLayer *layer, QgsRectangle &extent, QgsRectangle &r2)
 Convenience function to project an extent into the layer source CRS, but also split it into two extents if it crosses the +/- 180 degree line. More...
 
const QgsCoordinateTransformtransformation (const QgsMapLayer *layer) const
 
void updateFullExtent ()
 updates extent of the layer set More...
 
void updateScale ()
 Recalculate the map scale. More...
 
int width () const
 
bool writeXML (QDomNode &theNode, QDomDocument &theDoc)
 write settings More...
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual ~QObject ()
 
bool blockSignals (bool block)
 
QObjectchild (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArraydynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObjectparent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThreadthread () const
 

Static Public Member Functions

static QgsMapRenderer::BlendMode getBlendModeEnum (QPainter::CompositionMode blendMode)
 Returns a BlendMode corresponding to a QPainter::CompositionMode. More...
 
static QPainter::CompositionMode getCompositionMode (BlendMode blendMode)
 Returns a QPainter::CompositionMode corresponding to a BlendMode. More...
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Protected Member Functions

void adjustExtentToSize ()
 adjust extent to fit the pixmap size More...
 
- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObjectsender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Protected Attributes

QHash< QPair< QString, QString >, QPair< int, int > > mDefaultDatumTransformations
 
QgsCoordinateReferenceSystemmDestCRS
 destination spatial reference system of the projection More...
 
QgsDistanceAreamDistArea
 tool for measuring More...
 
QgsRectangle mExtent
 current extent to be drawn More...
 
QgsRectangle mFullExtent
 full extent of the layer set More...
 
QgsLabelingEngineInterfacemLabelingEngine
 Labeling engine (nullptr by default) More...
 
QgsRectangle mLastExtent
 Last extent to we drew so we know if we can used layer render caching or not. More...
 
QHash< QString, QgsLayerCoordinateTransformmLayerCoordinateTransformInfo
 
QStringList mLayerSet
 stores array of layers to be rendered (identified by string) More...
 
QgsMapSettings mMapSettings
 map settings - used only for export in mapSettings() for use in classes that deal with QgsMapSettings More...
 
double mMapUnitsPerPixel
 map units per pixel More...
 
OutputUnits mOutputUnits
 Output units. More...
 
bool mOverview
 indicates whether it's map image for overview More...
 
bool mProjectionsEnabled
 detemines whether on the fly projection support is enabled More...
 
QgsRenderContext mRenderContext
 Encapsulates context of rendering. More...
 
QMutex mRenderMutex
 Locks rendering loop for concurrent draws. More...
 
double mRotation
 Map rotation. More...
 
double mScale
 Map scale denominator at its current zoom level. More...
 
QgsScaleCalculatormScaleCalculator
 scale calculator More...
 
QSizeF mSize
 
bool mTileRenderMode
 Tell the render system we are rendering a map tile. More...
 

Static Protected Attributes

static bool mDrawing = false
 indicates drawing in progress More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

Detailed Description

A non GUI class for rendering a map layer set onto a QPainter.

Definition at line 163 of file qgsmaprenderer.h.

Member Enumeration Documentation

◆ BlendMode

Blending modes enum defining the available composition modes that can be used when rendering a layer.

Enumerator
BlendNormal 
BlendLighten 
BlendScreen 
BlendDodge 
BlendAddition 
BlendDarken 
BlendMultiply 
BlendBurn 
BlendOverlay 
BlendSoftLight 
BlendHardLight 
BlendDifference 
BlendSubtract 
BlendSource 
BlendDestinationOver 
BlendClear 
BlendDestination 
BlendSourceIn 
BlendDestinationIn 
BlendSourceOut 
BlendDestinationOut 
BlendSourceAtop 
BlendDestinationAtop 
BlendXor 

Definition at line 180 of file qgsmaprenderer.h.

◆ OutputUnits

Output units for pen width and point marker width/height.

Enumerator
Millimeters 
Pixels 

Definition at line 170 of file qgsmaprenderer.h.

Constructor & Destructor Documentation

◆ QgsMapRenderer()

QgsMapRenderer::QgsMapRenderer ( )

constructor

Definition at line 42 of file qgsmaprenderer.cpp.

◆ ~QgsMapRenderer()

QgsMapRenderer::~QgsMapRenderer ( )

destructor

Definition at line 69 of file qgsmaprenderer.cpp.

Member Function Documentation

◆ addLayerCoordinateTransform()

void QgsMapRenderer::addLayerCoordinateTransform ( const QString layerId,
const QString srcAuthId,
const QString destAuthId,
int  srcDatumTransform = -1,
int  destDatumTransform = -1 
)

Definition at line 1283 of file qgsmaprenderer.cpp.

◆ adjustExtentToSize()

void QgsMapRenderer::adjustExtentToSize ( )
protected

adjust extent to fit the pixmap size

Definition at line 172 of file qgsmaprenderer.cpp.

◆ clearLayerCoordinateTransforms()

void QgsMapRenderer::clearLayerCoordinateTransforms ( )

Definition at line 1293 of file qgsmaprenderer.cpp.

◆ coordinateTransform()

const QgsMapToPixel* QgsMapRenderer::coordinateTransform ( )
inline

Definition at line 234 of file qgsmaprenderer.h.

◆ datumTransformInfoRequested

void QgsMapRenderer::datumTransformInfoRequested ( const QgsMapLayer ml,
const QString srcAuthId,
const QString destAuthId 
) const
signal

Notifies higher level components to show the datum transform dialog and add a QgsLayerCoordinateTransformInfo for that layer.

Note
not available in Python bindings

◆ destinationCrs()

const QgsCoordinateReferenceSystem & QgsMapRenderer::destinationCrs ( ) const

returns CRS of destination coordinate reference system

Definition at line 722 of file qgsmaprenderer.cpp.

◆ destinationSrsChanged

void QgsMapRenderer::destinationSrsChanged ( )
signal

◆ drawError

void QgsMapRenderer::drawError ( QgsMapLayer )
signal

emitted when layer's draw() returned false

◆ drawingProgress

void QgsMapRenderer::drawingProgress ( int  current,
int  total 
)
signal
Deprecated:
in 2.4 - not emitted anymore

◆ enableOverviewMode()

void QgsMapRenderer::enableOverviewMode ( bool  isOverview = true)
inline

sets whether map image will be for overview

Definition at line 253 of file qgsmaprenderer.h.

◆ extent()

QgsRectangle QgsMapRenderer::extent ( ) const

returns current extent

Definition at line 77 of file qgsmaprenderer.cpp.

◆ extentsChanged

void QgsMapRenderer::extentsChanged ( )
signal

emitted when the current extent gets changed

Note
added in 2.4

◆ fullExtent()

QgsRectangle QgsMapRenderer::fullExtent ( )

returns current extent of layer set

Definition at line 942 of file qgsmaprenderer.cpp.

◆ getBlendModeEnum()

QgsMapRenderer::BlendMode QgsMapRenderer::getBlendModeEnum ( QPainter::CompositionMode  blendMode)
static

Returns a BlendMode corresponding to a QPainter::CompositionMode.

Definition at line 1200 of file qgsmaprenderer.cpp.

◆ getCompositionMode()

QPainter::CompositionMode QgsMapRenderer::getCompositionMode ( QgsMapRenderer::BlendMode  blendMode)
static

Returns a QPainter::CompositionMode corresponding to a BlendMode.

Returns a QPainter::CompositionMode corresponding to a QgsMapRenderer::BlendMode.

Definition at line 1141 of file qgsmaprenderer.cpp.

◆ hasCrsTransformEnabled() [1/2]

bool QgsMapRenderer::hasCrsTransformEnabled ( ) const

returns true if projections are enabled for this layer set

Definition at line 678 of file qgsmaprenderer.cpp.

◆ hasCrsTransformEnabled [2/2]

Q_DECL_DEPRECATED void QgsMapRenderer::hasCrsTransformEnabled ( bool  flag)
signal

This signal is emitted when CRS transformation is enabled/disabled.

Parameters
flagtrue if transformation is enabled.
Deprecated:
Use hasCrsTransformEnabledChanged( bool flag ) to avoid conflict with method of the same name).

◆ hasCrsTransformEnabledChanged

void QgsMapRenderer::hasCrsTransformEnabledChanged ( bool  flag)
signal

This signal is emitted when CRS transformation is enabled/disabled.

Parameters
flagtrue if transformation is enabled.
Note
Added in 2.4

◆ height()

int QgsMapRenderer::height ( ) const
inline

Definition at line 244 of file qgsmaprenderer.h.

◆ labelingEngine()

QgsLabelingEngineInterface* QgsMapRenderer::labelingEngine ( )
inline

Labeling engine (nullptr if there's no custom engine)

Definition at line 362 of file qgsmaprenderer.h.

◆ layerExtentToOutputExtent()

QgsRectangle QgsMapRenderer::layerExtentToOutputExtent ( QgsMapLayer theLayer,
QgsRectangle  extent 
)

transform bounding box from layer's CRS to output CRS

See also
layerToMapCoordinates( QgsMapLayer* theLayer, QgsRectangle rect ) if you want to transform a rectangle
Returns
a bounding box (aligned rectangle) containing the transformed extent

Definition at line 794 of file qgsmaprenderer.cpp.

◆ layerSet()

QStringList & QgsMapRenderer::layerSet ( )

returns current layer set

Definition at line 1017 of file qgsmaprenderer.cpp.

◆ layerToMapCoordinates() [1/2]

QgsPoint QgsMapRenderer::layerToMapCoordinates ( QgsMapLayer theLayer,
QgsPoint  point 
)

transform point coordinates from layer's CRS to output CRS

Returns
the transformed point

Definition at line 849 of file qgsmaprenderer.cpp.

◆ layerToMapCoordinates() [2/2]

QgsRectangle QgsMapRenderer::layerToMapCoordinates ( QgsMapLayer theLayer,
QgsRectangle  rect 
)

transform rectangle from layer's CRS to output CRS

See also
layerExtentToOutputExtent() if you want to transform a bounding box
Returns
the transformed rectangle

Definition at line 873 of file qgsmaprenderer.cpp.

◆ mapSettings()

const QgsMapSettings & QgsMapRenderer::mapSettings ( )

bridge to QgsMapSettings

Note
added in 2.4

Definition at line 1261 of file qgsmaprenderer.cpp.

◆ mapToLayerCoordinates() [1/2]

QgsPoint QgsMapRenderer::mapToLayerCoordinates ( QgsMapLayer theLayer,
QgsPoint  point 
)

transform point coordinates from output CRS to layer's CRS

Returns
the transformed point

Definition at line 897 of file qgsmaprenderer.cpp.

◆ mapToLayerCoordinates() [2/2]

QgsRectangle QgsMapRenderer::mapToLayerCoordinates ( QgsMapLayer theLayer,
QgsRectangle  rect 
)

transform rectangle from output CRS to layer's CRS

See also
outputExtentToLayerExtent() if you want to transform a bounding box
Returns
the transformed rectangle

Definition at line 919 of file qgsmaprenderer.cpp.

◆ mapUnits()

QGis::UnitType QgsMapRenderer::mapUnits ( ) const

Definition at line 649 of file qgsmaprenderer.cpp.

◆ mapUnitsChanged

void QgsMapRenderer::mapUnitsChanged ( )
signal

◆ mapUnitsPerPixel()

double QgsMapRenderer::mapUnitsPerPixel ( ) const
inline

Definition at line 241 of file qgsmaprenderer.h.

◆ onDrawingProgress

void QgsMapRenderer::onDrawingProgress ( int  current,
int  total 
)
slot
Deprecated:
in 2.4 - does nothing

Definition at line 654 of file qgsmaprenderer.cpp.

◆ outputDpi()

double QgsMapRenderer::outputDpi ( )

accessor for output dpi

Definition at line 157 of file qgsmaprenderer.cpp.

◆ outputExtentToLayerExtent()

QgsRectangle QgsMapRenderer::outputExtentToLayerExtent ( QgsMapLayer theLayer,
QgsRectangle  extent 
)

transform bounding box from output CRS to layer's CRS

See also
mapToLayerCoordinates( QgsMapLayer* theLayer,QgsRectangle rect ) if you want to transform a rectangle
Returns
a bounding box (aligned rectangle) containing the transformed extent

Definition at line 820 of file qgsmaprenderer.cpp.

◆ outputSize()

QSize QgsMapRenderer::outputSize ( ) const

Returns the size which the map will be rendered at.

See also
setOutputSize()
outputSizeF()

Definition at line 162 of file qgsmaprenderer.cpp.

◆ outputSizeF()

QSizeF QgsMapRenderer::outputSizeF ( ) const

Returns the size which the map will be rendered at.

See also
setOutputSize()
outputSize()

Definition at line 167 of file qgsmaprenderer.cpp.

◆ outputUnits()

OutputUnits QgsMapRenderer::outputUnits ( ) const
inline

Definition at line 338 of file qgsmaprenderer.h.

◆ readXML()

bool QgsMapRenderer::readXML ( QDomNode theNode)

read settings

Definition at line 1022 of file qgsmaprenderer.cpp.

◆ render()

void QgsMapRenderer::render ( QPainter painter,
double *  forceWidthScale = nullptr 
)

starts rendering

Parameters
painterpainter to render to
forceWidthScaleForce a specific scale factor for line widths and marker sizes. Automatically calculated from output device DPI if 0

Definition at line 240 of file qgsmaprenderer.cpp.

◆ rendererContext()

QgsRenderContext* QgsMapRenderer::rendererContext ( )
inline

Accessor for render context.

Definition at line 359 of file qgsmaprenderer.h.

◆ rotation()

double QgsMapRenderer::rotation ( ) const

returns current rotation in clockwise degrees

Note
added in 2.8

Definition at line 137 of file qgsmaprenderer.cpp.

◆ rotationChanged

void QgsMapRenderer::rotationChanged ( double  )
signal

emitted when the current rotation gets changed

Note
added in 2.8

◆ scale()

double QgsMapRenderer::scale ( ) const
inline

Scale denominator.

Definition at line 237 of file qgsmaprenderer.h.

◆ setDestinationCrs()

void QgsMapRenderer::setDestinationCrs ( const QgsCoordinateReferenceSystem crs,
bool  refreshCoordinateTransformInfo = true,
bool  transformExtent = true 
)

sets destination coordinate reference system

Definition at line 683 of file qgsmaprenderer.cpp.

◆ setExtent()

bool QgsMapRenderer::setExtent ( const QgsRectangle extent)

sets extent and checks whether suitable (returns false if not)

Definition at line 87 of file qgsmaprenderer.cpp.

◆ setFeatureFilterProvider()

void QgsMapRenderer::setFeatureFilterProvider ( const QgsFeatureFilterProvider ffp)
inline

Set a feature filter provider to filter the features shown in the map.

Parameters
ffpthe feature filter provider
Note
added in QGIS 2.14

Definition at line 394 of file qgsmaprenderer.h.

◆ setLabelingEngine()

void QgsMapRenderer::setLabelingEngine ( QgsLabelingEngineInterface iface)

Set labeling engine.

Previous engine (if any) is deleted. Takes ownership of the engine.

Definition at line 1089 of file qgsmaprenderer.cpp.

◆ setLayerSet()

void QgsMapRenderer::setLayerSet ( const QStringList layers)

change current layer set

Definition at line 1010 of file qgsmaprenderer.cpp.

◆ setMapUnits()

void QgsMapRenderer::setMapUnits ( QGis::UnitType  u)

Definition at line 639 of file qgsmaprenderer.cpp.

◆ setOutputSize() [1/2]

void QgsMapRenderer::setOutputSize ( QSize  size,
double  dpi 
)

Sets the desired size of the rendered map image.

Parameters
sizesize in pixels
dpiresolution to render map using
See also
outputSize()

Definition at line 143 of file qgsmaprenderer.cpp.

◆ setOutputSize() [2/2]

void QgsMapRenderer::setOutputSize ( QSizeF  size,
double  dpi 
)

Sets the desired size of the rendered map image.

Parameters
sizesize in pixels
dpiresolution to render map using
See also
outputSizeF()

Definition at line 150 of file qgsmaprenderer.cpp.

◆ setOutputUnits()

void QgsMapRenderer::setOutputUnits ( OutputUnits  u)
inline

Definition at line 336 of file qgsmaprenderer.h.

◆ setProjectionsEnabled()

void QgsMapRenderer::setProjectionsEnabled ( bool  enabled)

sets whether to use projections for this layer set

Definition at line 660 of file qgsmaprenderer.cpp.

◆ setRotation()

void QgsMapRenderer::setRotation ( double  degrees)

sets rotation value in clockwise degrees

Note
added in 2.8

Definition at line 129 of file qgsmaprenderer.cpp.

◆ setScale()

void QgsMapRenderer::setScale ( double  scale)
inline

Sets scale for scale based visibility.

Normally, the scale is calculated automatically. This function is only used to force a preview scale (e.g. for print composer)

Definition at line 240 of file qgsmaprenderer.h.

◆ setTileRenderMode()

void QgsMapRenderer::setTileRenderMode ( bool  enabled)
inline

Set tile mode (render code tries to prevent tile border effects)

Definition at line 400 of file qgsmaprenderer.h.

◆ splitLayersExtent()

bool QgsMapRenderer::splitLayersExtent ( QgsMapLayer layer,
QgsRectangle extent,
QgsRectangle r2 
)

Convenience function to project an extent into the layer source CRS, but also split it into two extents if it crosses the +/- 180 degree line.

Modifies the given extent to be in the source CRS coordinates, and if it was split, returns true, and also sets the contents of the r2 parameter

Definition at line 731 of file qgsmaprenderer.cpp.

◆ transformation()

const QgsCoordinateTransform * QgsMapRenderer::transformation ( const QgsMapLayer layer) const

Definition at line 1097 of file qgsmaprenderer.cpp.

◆ updateFullExtent()

void QgsMapRenderer::updateFullExtent ( )

updates extent of the layer set

Definition at line 937 of file qgsmaprenderer.cpp.

◆ updateMap

void QgsMapRenderer::updateMap ( )
signal
Deprecated:
in 2.4 - not emitted anymore

◆ updateScale()

void QgsMapRenderer::updateScale ( )

Recalculate the map scale.

Definition at line 82 of file qgsmaprenderer.cpp.

◆ width()

int QgsMapRenderer::width ( ) const
inline

Definition at line 243 of file qgsmaprenderer.h.

◆ writeXML()

bool QgsMapRenderer::writeXML ( QDomNode theNode,
QDomDocument theDoc 
)

write settings

Definition at line 1061 of file qgsmaprenderer.cpp.

Member Data Documentation

◆ mDefaultDatumTransformations

QHash< QPair< QString, QString >, QPair< int, int > > QgsMapRenderer::mDefaultDatumTransformations
protected

Definition at line 516 of file qgsmaprenderer.h.

◆ mDestCRS

QgsCoordinateReferenceSystem* QgsMapRenderer::mDestCRS
protected

destination spatial reference system of the projection

Definition at line 488 of file qgsmaprenderer.h.

◆ mDistArea

QgsDistanceArea* QgsMapRenderer::mDistArea
protected

tool for measuring

Definition at line 497 of file qgsmaprenderer.h.

◆ mDrawing

bool QgsMapRenderer::mDrawing = false
staticprotected

indicates drawing in progress

Definition at line 455 of file qgsmaprenderer.h.

◆ mExtent

QgsRectangle QgsMapRenderer::mExtent
protected

current extent to be drawn

Definition at line 470 of file qgsmaprenderer.h.

◆ mFullExtent

QgsRectangle QgsMapRenderer::mFullExtent
protected

full extent of the layer set

Definition at line 494 of file qgsmaprenderer.h.

◆ mLabelingEngine

QgsLabelingEngineInterface* QgsMapRenderer::mLabelingEngine
protected

Labeling engine (nullptr by default)

Definition at line 506 of file qgsmaprenderer.h.

◆ mLastExtent

QgsRectangle QgsMapRenderer::mLastExtent
protected

Last extent to we drew so we know if we can used layer render caching or not.

Note there are no accessors for this as it is intended to internal use only.

Definition at line 476 of file qgsmaprenderer.h.

◆ mLayerCoordinateTransformInfo

QHash< QString, QgsLayerCoordinateTransform > QgsMapRenderer::mLayerCoordinateTransformInfo
protected

Definition at line 514 of file qgsmaprenderer.h.

◆ mLayerSet

QStringList QgsMapRenderer::mLayerSet
protected

stores array of layers to be rendered (identified by string)

Definition at line 491 of file qgsmaprenderer.h.

◆ mMapSettings

QgsMapSettings QgsMapRenderer::mMapSettings
protected

map settings - used only for export in mapSettings() for use in classes that deal with QgsMapSettings

Definition at line 512 of file qgsmaprenderer.h.

◆ mMapUnitsPerPixel

double QgsMapRenderer::mMapUnitsPerPixel
protected

map units per pixel

Definition at line 458 of file qgsmaprenderer.h.

◆ mOutputUnits

OutputUnits QgsMapRenderer::mOutputUnits
protected

Output units.

Definition at line 503 of file qgsmaprenderer.h.

◆ mOverview

bool QgsMapRenderer::mOverview
protected

indicates whether it's map image for overview

Definition at line 479 of file qgsmaprenderer.h.

◆ mProjectionsEnabled

bool QgsMapRenderer::mProjectionsEnabled
protected

detemines whether on the fly projection support is enabled

Definition at line 484 of file qgsmaprenderer.h.

◆ mRenderContext

QgsRenderContext QgsMapRenderer::mRenderContext
protected

Encapsulates context of rendering.

Definition at line 500 of file qgsmaprenderer.h.

◆ mRenderMutex

QMutex QgsMapRenderer::mRenderMutex
protected

Locks rendering loop for concurrent draws.

Definition at line 509 of file qgsmaprenderer.h.

◆ mRotation

double QgsMapRenderer::mRotation
protected

Map rotation.

Definition at line 464 of file qgsmaprenderer.h.

◆ mScale

double QgsMapRenderer::mScale
protected

Map scale denominator at its current zoom level.

Definition at line 461 of file qgsmaprenderer.h.

◆ mScaleCalculator

QgsScaleCalculator* QgsMapRenderer::mScaleCalculator
protected

scale calculator

Definition at line 467 of file qgsmaprenderer.h.

◆ mSize

QSizeF QgsMapRenderer::mSize
protected

Definition at line 481 of file qgsmaprenderer.h.

◆ mTileRenderMode

bool QgsMapRenderer::mTileRenderMode
protected

Tell the render system we are rendering a map tile.

Definition at line 519 of file qgsmaprenderer.h.


The documentation for this class was generated from the following files: