QGIS API Documentation
2.4.0-Chugiak
|
The QgsMapSettings class contains configuration for rendering of the map. More...
#include <qgsmapsettings.h>
Public Types | |
enum | Flag { Antialiasing = 0x01, DrawEditingInfo = 0x02, ForceVectorOutput = 0x04, UseAdvancedEffects = 0x08, DrawLabeling = 0x10, UseRenderingOptimization = 0x20, DrawSelection = 0x40 } |
Enumeration of flags that adjust the way how map is rendered. More... | |
Public Member Functions | |
QgsMapSettings () | |
QgsRectangle | extent () const |
Return geographical coordinates of the rectangle that should be rendered. More... | |
void | setExtent (const QgsRectangle &rect) |
Set coordinates of the rectangle which should be rendered. More... | |
QSize | outputSize () const |
Return the size of the resulting map image. More... | |
void | setOutputSize (const QSize &size) |
Set the size of the resulting map image. More... | |
int | outputDpi () const |
Return DPI used for conversion between real world units (e.g. More... | |
void | setOutputDpi (int dpi) |
Set DPI used for conversion between real world units (e.g. mm) and pixels. More... | |
QStringList | layers () const |
Get list of layer IDs for map rendering The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top) More... | |
void | setLayers (const QStringList &layers) |
Set list of layer IDs for map rendering. More... | |
void | setCrsTransformEnabled (bool enabled) |
sets whether to use projections for this layer set More... | |
bool | hasCrsTransformEnabled () const |
returns true if projections are enabled for this layer set More... | |
void | setDestinationCrs (const QgsCoordinateReferenceSystem &crs) |
sets destination coordinate reference system More... | |
const QgsCoordinateReferenceSystem & | destinationCrs () const |
returns CRS of destination coordinate reference system More... | |
QGis::UnitType | mapUnits () const |
Get units of map's geographical coordinates - used for scale calculation. More... | |
void | setMapUnits (QGis::UnitType u) |
Set units of map's geographical coordinates - used for scale calculation. More... | |
void | setBackgroundColor (const QColor &color) |
Set the background color of the map. More... | |
QColor | backgroundColor () const |
Get the background color of the map. More... | |
void | setSelectionColor (const QColor &color) |
Set color that is used for drawing of selected vector features. More... | |
QColor | selectionColor () const |
Get color that is used for drawing of selected vector features. More... | |
void | setFlags (Flags flags) |
Set combination of flags that will be used for rendering. More... | |
void | setFlag (Flag flag, bool on=true) |
Enable or disable a particular flag (other flags are not affected) More... | |
Flags | flags () const |
Return combination of flags used for rendering. More... | |
bool | testFlag (Flag flag) const |
Check whether a particular flag is enabled. More... | |
void | setOutputImageFormat (QImage::Format format) |
sets format of internal QImage More... | |
QImage::Format | outputImageFormat () const |
format of internal QImage, default QImage::Format_ARGB32_Premultiplied More... | |
bool | hasValidSettings () const |
Check whether the map settings are valid and can be used for rendering. More... | |
QgsRectangle | visibleExtent () const |
Return the actual extent derived from requested extent that takes takes output image size into account. More... | |
double | mapUnitsPerPixel () const |
Return the distance in geographical coordinates that equals to one pixel in the map. More... | |
double | scale () const |
Return the calculated scale of the map. More... | |
const QgsDatumTransformStore & | datumTransformStore () const |
QgsDatumTransformStore & | datumTransformStore () |
const QgsMapToPixel & | mapToPixel () const |
QgsRectangle | layerExtentToOutputExtent (QgsMapLayer *theLayer, QgsRectangle extent) const |
transform bounding box from layer's CRS to output CRS More... | |
QgsRectangle | outputExtentToLayerExtent (QgsMapLayer *theLayer, QgsRectangle extent) const |
transform bounding box from output CRS to layer's CRS More... | |
QgsPoint | layerToMapCoordinates (QgsMapLayer *theLayer, QgsPoint point) const |
transform point coordinates from layer's CRS to output CRS More... | |
QgsRectangle | layerToMapCoordinates (QgsMapLayer *theLayer, QgsRectangle rect) const |
transform rectangle from layer's CRS to output CRS More... | |
QgsPoint | mapToLayerCoordinates (QgsMapLayer *theLayer, QgsPoint point) const |
transform point coordinates from output CRS to layer's CRS More... | |
QgsRectangle | mapToLayerCoordinates (QgsMapLayer *theLayer, QgsRectangle rect) const |
transform rectangle from output CRS to layer's CRS More... | |
const QgsCoordinateTransform * | layerTransfrom (QgsMapLayer *layer) const |
Return coordinate transform from layer's CRS to destination CRS. More... | |
QgsRectangle | fullExtent () const |
returns current extent of layer set More... | |
void | readXML (QDomNode &theNode) |
void | writeXML (QDomNode &theNode, QDomDocument &theDoc) |
Protected Member Functions | |
void | updateDerived () |
Protected Attributes | |
int | mDpi |
QSize | mSize |
QgsRectangle | mExtent |
QStringList | mLayers |
bool | mProjectionsEnabled |
QgsCoordinateReferenceSystem | mDestCRS |
QgsDatumTransformStore | mDatumTransformStore |
QColor | mBackgroundColor |
QColor | mSelectionColor |
Flags | mFlags |
QImage::Format | mImageFormat |
bool | mValid |
whether the actual settings are valid (set in updateDerived()) More... | |
QgsRectangle | mVisibleExtent |
extent with some additional white space that matches the output aspect ratio More... | |
double | mMapUnitsPerPixel |
double | mScale |
QgsScaleCalculator | mScaleCalculator |
QgsMapToPixel | mMapToPixel |
The QgsMapSettings class contains configuration for rendering of the map.
The rendering itself is done by QgsMapRendererJob subclasses.
In order to set up QgsMapSettings instance, it is necessary to set at least few members: extent, output size and layers.
QgsMapSettings and QgsMapRendererJob (+subclasses) are intended to replace QgsMapRenderer class that existed before QGIS 2.4. The advantage of the new classes is that they separate the settings from the rendering and provide asynchronous API for map rendering.
Definition at line 52 of file qgsmapsettings.h.
enum QgsMapSettings::Flag |
Enumeration of flags that adjust the way how map is rendered.
Definition at line 112 of file qgsmapsettings.h.
QgsMapSettings::QgsMapSettings | ( | ) |
Definition at line 33 of file qgsmapsettings.cpp.
References QGis::Degrees, setMapUnits(), and updateDerived().
|
inline |
Get the background color of the map.
Definition at line 104 of file qgsmapsettings.h.
Referenced by QgsMapRendererJob::composeImage(), and QgsMapRendererCustomPainterJob::start().
|
inline |
Definition at line 151 of file qgsmapsettings.h.
Referenced by QgsMapCanvas::getDatumTransformInfo(), QgsMapCanvas::readProject(), and QgsMapCanvas::updateDatumTransformEntries().
|
inline |
Definition at line 152 of file qgsmapsettings.h.
const QgsCoordinateReferenceSystem & QgsMapSettings::destinationCrs | ( | ) | const |
returns CRS of destination coordinate reference system
Definition at line 210 of file qgsmapsettings.cpp.
References mDestCRS.
Referenced by QgsPalLabeling::addDiagramLayer(), QgsAtlasComposition::computeExtent(), QgsMapOverviewCanvas::destinationSrsChanged(), QgsComposerMap::draw(), QgsComposerAttributeTable::getFeatureAttributes(), QgsMapToolIdentify::identifyRasterLayer(), QgsComposerScaleBar::mapWidth(), QgsMapCanvasRendererSync::onDestCrsC2R(), QgsPalLabeling::prepareLayer(), QgsMapCanvas::readProject(), QgsMapRenderer::readXML(), QgsMapCanvas::setDestinationCrs(), QgsMapCanvas::updateDatumTransformEntries(), and writeXML().
QgsRectangle QgsMapSettings::extent | ( | ) | const |
Return geographical coordinates of the rectangle that should be rendered.
The actual visible extent used for rendering could be slightly different since the given extent may be expanded in order to fit the aspect ratio of output size. Use visibleExtent() to get the resulting extent.
Definition at line 52 of file qgsmapsettings.cpp.
References mExtent.
Referenced by fullExtent(), layerExtentToOutputExtent(), QgsMapCanvasRendererSync::onExtentC2R(), outputExtentToLayerExtent(), QgsMapCanvas::readProject(), QgsMapRenderer::readXML(), QgsRenderChecker::runTest(), setExtent(), updateDerived(), and writeXML().
QgsMapSettings::Flags QgsMapSettings::flags | ( | ) | const |
Return combination of flags used for rendering.
Definition at line 237 of file qgsmapsettings.cpp.
References mFlags.
Referenced by QgsComposerMap::draw(), and setFlags().
QgsRectangle QgsMapSettings::fullExtent | ( | ) | const |
returns current extent of layer set
Definition at line 421 of file qgsmapsettings.cpp.
References extent(), QgsMapLayer::extent(), QgsRectangle::height(), QgsMapLayerRegistry::instance(), QgsRectangle::isNull(), layerExtentToOutputExtent(), QgsMapLayerRegistry::mapLayer(), mLayers, QgsMapLayer::name(), QgsDebugMsg, QgsRectangle::set(), QgsRectangle::setMinimal(), QgsRectangle::toString(), QgsRectangle::unionRect(), QgsRectangle::width(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by QgsMapCanvas::fullExtent(), and QgsMapOverviewCanvas::updateFullExtent().
bool QgsMapSettings::hasCrsTransformEnabled | ( | ) | const |
returns true if projections are enabled for this layer set
Definition at line 198 of file qgsmapsettings.cpp.
References mProjectionsEnabled.
Referenced by QgsPalLabeling::addDiagramLayer(), QgsTolerance::computeMapUnitPerPixel(), QgsComposerMap::draw(), QgsMapRendererJob::drawOldLabeling(), QgsComposerAttributeTable::getFeatureAttributes(), QgsMapCanvas::hasCrsTransformEnabled(), QgsHighlight::init(), layerExtentToOutputExtent(), layerToMapCoordinates(), mapToLayerCoordinates(), QgsComposerScaleBar::mapWidth(), QgsMapCanvasRendererSync::onCrsTransformC2R(), outputExtentToLayerExtent(), QgsMapRendererJob::prepareJobs(), QgsPalLabeling::prepareLayer(), QgsMapCanvas::readProject(), QgsMapRenderer::readXML(), QgsMapCanvas::setCrsTransformEnabled(), QgsMapCanvas::setDestinationCrs(), QgsMapCanvas::updateDatumTransformEntries(), and writeXML().
bool QgsMapSettings::hasValidSettings | ( | ) | const |
Check whether the map settings are valid and can be used for rendering.
Definition at line 253 of file qgsmapsettings.cpp.
References mValid.
Referenced by QgsMapOverviewCanvas::refresh(), QgsMapCanvas::refresh(), and QgsMapOverviewCanvas::updateFullExtent().
QgsRectangle QgsMapSettings::layerExtentToOutputExtent | ( | QgsMapLayer * | theLayer, |
QgsRectangle | extent | ||
) | const |
transform bounding box from layer's CRS to output CRS
Definition at line 284 of file qgsmapsettings.cpp.
References extent(), hasCrsTransformEnabled(), layerTransfrom(), QgsMessageLog::logMessage(), QgsDebugMsg, QgsRectangle::toString(), and QgsException::what().
Referenced by fullExtent(), QgsMapCanvas::panToSelected(), and QgsMapCanvas::zoomToSelected().
QStringList QgsMapSettings::layers | ( | ) | const |
Get list of layer IDs for map rendering The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
Definition at line 183 of file qgsmapsettings.cpp.
References mLayers.
Referenced by QgsComposerMap::containsAdvancedEffects(), QgsComposerMap::containsWMSLayer(), QgsMapRendererJob::drawOldLabeling(), QgsMapCanvas::layer(), QgsMapCanvas::layerCount(), QgsComposerLegend::layerIdList(), QgsMapOverviewCanvas::layerSet(), QgsComposerMap::layersToRender(), QgsMapCanvasRendererSync::onLayersC2R(), QgsMapRendererJob::prepareJobs(), QgsMapCanvas::refreshMap(), setLayers(), QgsMapCanvas::setLayerSet(), QgsComposerMap::storeCurrentLayerSet(), QgsComposerMap::syncLayerSet(), and QgsMapCanvas::updateDatumTransformEntries().
QgsPoint QgsMapSettings::layerToMapCoordinates | ( | QgsMapLayer * | theLayer, |
QgsPoint | point | ||
) | const |
transform point coordinates from layer's CRS to output CRS
Definition at line 336 of file qgsmapsettings.cpp.
References QgsCoordinateTransform::ForwardTransform, hasCrsTransformEnabled(), layerTransfrom(), QgsMessageLog::logMessage(), and QgsException::what().
Referenced by QgsRubberBand::addGeometry(), QgsMapToolIdentify::featureDerivedAttributes(), QgsSnapper::snapPoint(), and QgsMapTool::toMapCoordinates().
QgsRectangle QgsMapSettings::layerToMapCoordinates | ( | QgsMapLayer * | theLayer, |
QgsRectangle | rect | ||
) | const |
transform rectangle from layer's CRS to output CRS
Definition at line 358 of file qgsmapsettings.cpp.
References QgsCoordinateTransform::ForwardTransform, hasCrsTransformEnabled(), layerTransfrom(), QgsMessageLog::logMessage(), and QgsException::what().
const QgsCoordinateTransform * QgsMapSettings::layerTransfrom | ( | QgsMapLayer * | layer | ) | const |
Return coordinate transform from layer's CRS to destination CRS.
layer |
Definition at line 277 of file qgsmapsettings.cpp.
References mDatumTransformStore, and QgsDatumTransformStore::transformation().
Referenced by QgsMapRendererJob::drawOldLabeling(), QgsHighlight::init(), layerExtentToOutputExtent(), layerToMapCoordinates(), mapToLayerCoordinates(), outputExtentToLayerExtent(), and QgsMapRendererJob::prepareJobs().
QgsPoint QgsMapSettings::mapToLayerCoordinates | ( | QgsMapLayer * | theLayer, |
QgsPoint | point | ||
) | const |
transform point coordinates from output CRS to layer's CRS
Definition at line 380 of file qgsmapsettings.cpp.
References hasCrsTransformEnabled(), layerTransfrom(), QgsMessageLog::logMessage(), QgsCoordinateTransform::ReverseTransform, and QgsException::what().
Referenced by QgsMapTip::fetchFeature(), QgsAttributeTableFilterModel::generateListOfVisibleFeatures(), QgsSnapper::snapPoint(), QgsTolerance::toLayerCoordinates(), and QgsMapTool::toLayerCoordinates().
QgsRectangle QgsMapSettings::mapToLayerCoordinates | ( | QgsMapLayer * | theLayer, |
QgsRectangle | rect | ||
) | const |
transform rectangle from output CRS to layer's CRS
Definition at line 402 of file qgsmapsettings.cpp.
References hasCrsTransformEnabled(), layerTransfrom(), QgsMessageLog::logMessage(), QgsCoordinateTransform::ReverseTransform, and QgsException::what().
|
inline |
Definition at line 154 of file qgsmapsettings.h.
Referenced by QgsPalLabeling::addDiagramLayer(), QgsMapOverviewCanvas::drawExtentRect(), QgsPalLabeling::drawLabeling(), QgsRenderContext::fromMapSettings(), QgsAttributeTableFilterModel::generateListOfVisibleFeatures(), QgsMapCanvas::getCoordinateTransform(), QgsMapOverviewCanvas::mouseReleaseEvent(), QgsPalLabeling::prepareLayer(), QgsSnapper::snapPoint(), and QgsTolerance::toLayerCoordinates().
QGis::UnitType QgsMapSettings::mapUnits | ( | ) | const |
Get units of map's geographical coordinates - used for scale calculation.
Definition at line 247 of file qgsmapsettings.cpp.
References QgsScaleCalculator::mapUnits(), and mScaleCalculator.
Referenced by QgsComposerMap::draw(), QgsComposerMap::initGridAnnotationFormatFromProject(), QgsMapCanvas::mapUnits(), QgsMapCanvasRendererSync::onMapUnitsC2R(), QgsMapCanvas::readProject(), QgsMapRenderer::readXML(), QgsComposerMap::scale(), QgsMapCanvas::setMapUnits(), QgsComposerMap::setNewScale(), writeXML(), and QgsComposerMap::zoomContent().
double QgsMapSettings::mapUnitsPerPixel | ( | ) | const |
Return the distance in geographical coordinates that equals to one pixel in the map.
Definition at line 263 of file qgsmapsettings.cpp.
References mMapUnitsPerPixel.
Referenced by QgsTolerance::computeMapUnitPerPixel(), QgsMapCanvas::mapUnitsPerPixel(), QgsRenderChecker::runTest(), and updateDerived().
int QgsMapSettings::outputDpi | ( | ) | const |
Return DPI used for conversion between real world units (e.g.
mm) and pixels Default value is 96
Definition at line 170 of file qgsmapsettings.cpp.
References mDpi.
Referenced by QgsRenderContext::fromMapSettings(), QgsMapCanvas::QgsMapCanvas(), QgsMapCanvas::resizeEvent(), QgsMapCanvasItem::setRenderContextVariables(), and QgsMapRendererCustomPainterJob::start().
QgsRectangle QgsMapSettings::outputExtentToLayerExtent | ( | QgsMapLayer * | theLayer, |
QgsRectangle | extent | ||
) | const |
transform bounding box from output CRS to layer's CRS
Definition at line 310 of file qgsmapsettings.cpp.
References extent(), hasCrsTransformEnabled(), layerTransfrom(), QgsMessageLog::logMessage(), QgsDebugMsg, QgsCoordinateTransform::ReverseTransform, QgsRectangle::toString(), and QgsException::what().
|
inline |
format of internal QImage, default QImage::Format_ARGB32_Premultiplied
Definition at line 137 of file qgsmapsettings.h.
Referenced by QgsMapRendererJob::composeImage(), QgsComposerMap::draw(), QgsMapRendererJob::prepareJobs(), and QgsMapRendererSequentialJob::QgsMapRendererSequentialJob().
QSize QgsMapSettings::outputSize | ( | ) | const |
Return the size of the resulting map image.
Definition at line 158 of file qgsmapsettings.cpp.
References mSize.
Referenced by QgsMapRendererJob::composeImage(), QgsHighlight::paint(), QgsMapRendererJob::prepareJobs(), QgsMapRendererSequentialJob::QgsMapRendererSequentialJob(), QgsMapRendererCustomPainterJob::start(), and updateDerived().
void QgsMapSettings::readXML | ( | QDomNode & | theNode | ) |
Definition at line 493 of file qgsmapsettings.cpp.
References mDatumTransformStore, QgsXmlUtils::readMapUnits(), QgsXmlUtils::readRectangle(), QgsDatumTransformStore::readXML(), QgsCoordinateReferenceSystem::readXML(), setCrsTransformEnabled(), setDestinationCrs(), setExtent(), and setMapUnits().
Referenced by QgsMapCanvas::readProject(), and QgsMapRenderer::readXML().
double QgsMapSettings::scale | ( | ) | const |
Return the calculated scale of the map.
Definition at line 268 of file qgsmapsettings.cpp.
References mScale.
Referenced by QgsPalLabeling::drawLabeling(), QgsMapRendererJob::drawOldLabeling(), QgsRenderContext::fromMapSettings(), QgsAttributeTableFilterModel::generateListOfVisibleFeatures(), QgsMapToolIdentify::identifyVectorLayer(), QgsMapRendererJob::prepareJobs(), QgsMapCanvas::scale(), QgsScaleRangeWidget::setMaxScaleFromCanvas(), and QgsScaleRangeWidget::setMinScaleFromCanvas().
|
inline |
Get color that is used for drawing of selected vector features.
Definition at line 109 of file qgsmapsettings.h.
Referenced by QgsRenderContext::fromMapSettings().
|
inline |
Set the background color of the map.
Definition at line 102 of file qgsmapsettings.h.
Referenced by QgsComposerMap::draw(), QgsRenderChecker::runTest(), QgsMapOverviewCanvas::setBackgroundColor(), and QgsMapCanvas::setCanvasColor().
void QgsMapSettings::setCrsTransformEnabled | ( | bool | enabled | ) |
sets whether to use projections for this layer set
Definition at line 193 of file qgsmapsettings.cpp.
References mProjectionsEnabled.
Referenced by QgsComposerMap::draw(), QgsMapOverviewCanvas::hasCrsTransformEnabled(), QgsMapRenderer::mapSettings(), readXML(), QgsMapCanvas::setCrsTransformEnabled(), and QgsMapRenderer::writeXML().
void QgsMapSettings::setDestinationCrs | ( | const QgsCoordinateReferenceSystem & | crs | ) |
sets destination coordinate reference system
Definition at line 204 of file qgsmapsettings.cpp.
References mDatumTransformStore, mDestCRS, and QgsDatumTransformStore::setDestinationCrs().
Referenced by QgsMapOverviewCanvas::destinationSrsChanged(), QgsComposerMap::draw(), QgsMapRenderer::mapSettings(), readXML(), QgsMapCanvas::setDestinationCrs(), and QgsMapRenderer::writeXML().
void QgsMapSettings::setExtent | ( | const QgsRectangle & | rect | ) |
Set coordinates of the rectangle which should be rendered.
The actual visible extent used for rendering could be slightly different since the given extent may be expanded in order to fit the aspect ratio of output size. Use visibleExtent() to get the resulting extent.
Definition at line 57 of file qgsmapsettings.cpp.
References extent(), mExtent, and updateDerived().
Referenced by QgsComposerMap::draw(), QgsComposerMap::drawGrid(), QgsComposerMap::drawOverviewMapExtent(), QgsMapRenderer::mapSettings(), readXML(), QgsMapCanvas::setExtent(), QgsMapOverviewCanvas::updateFullExtent(), QgsMapRenderer::writeXML(), QgsMapCanvas::zoomToNextExtent(), and QgsMapCanvas::zoomToPreviousExtent().
void QgsMapSettings::setFlag | ( | QgsMapSettings::Flag | flag, |
bool | on = true |
||
) |
Enable or disable a particular flag (other flags are not affected)
Definition at line 229 of file qgsmapsettings.cpp.
References mFlags.
Referenced by QgsComposerMap::draw(), QgsMapCanvas::enableAntiAliasing(), QgsMapCanvas::QgsMapCanvas(), QgsMapOverviewCanvas::QgsMapOverviewCanvas(), and QgsRenderChecker::runTest().
void QgsMapSettings::setFlags | ( | Flags | flags | ) |
Set combination of flags that will be used for rendering.
Definition at line 224 of file qgsmapsettings.cpp.
References flags(), and mFlags.
Referenced by QgsComposerMap::draw().
void QgsMapSettings::setLayers | ( | const QStringList & | layers | ) |
Set list of layer IDs for map rendering.
The layers must be registered in QgsMapLayerRegistry. The layers are stored in the reverse order of how they are rendered (layer with index 0 will be on top)
Definition at line 188 of file qgsmapsettings.cpp.
References layers(), and mLayers.
Referenced by QgsComposerMap::draw(), QgsMapRenderer::mapSettings(), QgsMapOverviewCanvas::setLayerSet(), and QgsMapCanvas::setLayerSet().
void QgsMapSettings::setMapUnits | ( | QGis::UnitType | u | ) |
Set units of map's geographical coordinates - used for scale calculation.
Definition at line 216 of file qgsmapsettings.cpp.
References mScaleCalculator, QgsScaleCalculator::setMapUnits(), and updateDerived().
Referenced by QgsComposerMap::draw(), QgsMapRenderer::mapSettings(), QgsMapSettings(), readXML(), QgsMapCanvas::setMapUnits(), and QgsMapRenderer::writeXML().
void QgsMapSettings::setOutputDpi | ( | int | dpi | ) |
Set DPI used for conversion between real world units (e.g. mm) and pixels.
Definition at line 175 of file qgsmapsettings.cpp.
References mDpi, and updateDerived().
Referenced by QgsComposerMap::draw(), QgsComposerMap::drawGrid(), QgsComposerMap::drawOverviewMapExtent(), QgsComposerShape::drawShapeUsingSymbol(), QgsMapRenderer::mapSettings(), QgsPaperItem::paint(), and QgsMapRenderer::writeXML().
|
inline |
sets format of internal QImage
Definition at line 135 of file qgsmapsettings.h.
Referenced by QgsComposerMap::draw().
void QgsMapSettings::setOutputSize | ( | const QSize & | size | ) |
Set the size of the resulting map image.
Definition at line 163 of file qgsmapsettings.cpp.
References mSize, size, and updateDerived().
Referenced by QgsComposerMap::draw(), QgsComposerMap::drawGrid(), QgsComposerMap::drawOverviewMapExtent(), QgsMapRenderer::mapSettings(), QgsMapCanvas::QgsMapCanvas(), QgsMapOverviewCanvas::resizeEvent(), QgsMapCanvas::resizeEvent(), QgsRenderChecker::runTest(), and QgsMapRenderer::writeXML().
|
inline |
Set color that is used for drawing of selected vector features.
Definition at line 107 of file qgsmapsettings.h.
Referenced by QgsMapCanvas::setSelectionColor().
bool QgsMapSettings::testFlag | ( | QgsMapSettings::Flag | flag | ) | const |
Check whether a particular flag is enabled.
Definition at line 242 of file qgsmapsettings.cpp.
References mFlags.
Referenced by QgsMapRendererCustomPainterJob::doRender(), QgsRenderContext::fromMapSettings(), QgsMapRendererJob::needTemporaryImage(), QgsMapRendererJob::prepareJobs(), QgsMapRendererParallelJob::renderLayersFinished(), QgsMapRendererParallelJob::start(), and QgsMapRendererCustomPainterJob::start().
|
protected |
Definition at line 65 of file qgsmapsettings.cpp.
References QgsScaleCalculator::calculate(), extent(), QgsRectangle::height(), QgsRectangle::isEmpty(), QgsRectangle::isFinite(), mapUnitsPerPixel(), mDpi, mExtent, mMapToPixel, mMapUnitsPerPixel, mScale, mScaleCalculator, mSize, mValid, mVisibleExtent, outputSize(), QgsDebugMsg, qgsDoubleToString(), QgsRectangle::set(), QgsScaleCalculator::setDpi(), QgsRectangle::toString(), visibleExtent(), QgsRectangle::width(), QgsRectangle::xMaximum(), QgsRectangle::xMinimum(), QgsRectangle::yMaximum(), and QgsRectangle::yMinimum().
Referenced by QgsMapSettings(), setExtent(), setMapUnits(), setOutputDpi(), and setOutputSize().
QgsRectangle QgsMapSettings::visibleExtent | ( | ) | const |
Return the actual extent derived from requested extent that takes takes output image size into account.
Definition at line 258 of file qgsmapsettings.cpp.
References mVisibleExtent.
Referenced by QgsComposerMap::composerMapPosForItem(), QgsMapOverviewCanvas::drawExtentRect(), QgsMapRendererJob::drawNewLabeling(), QgsMapRendererJob::drawOldLabeling(), QgsMapCanvas::extent(), QgsRenderContext::fromMapSettings(), QgsAttributeTableFilterModel::generateListOfVisibleFeatures(), QgsMapCanvas::keyPressEvent(), QgsMapCanvas::mapUpdateTimeout(), QgsMapCanvas::panActionEnd(), QgsMapRendererJob::prepareJobs(), QgsPalLabeling::prepareLayer(), QgsComposerMap::QgsComposerMap(), QgsMapCanvas::rendererJobFinished(), QgsMapCanvas::saveAsImage(), QgsMapCanvas::setDestinationCrs(), updateDerived(), QgsMapCanvas::wheelEvent(), QgsMapCanvas::zoomByFactor(), and QgsMapCanvas::zoomWithCenter().
void QgsMapSettings::writeXML | ( | QDomNode & | theNode, |
QDomDocument & | theDoc | ||
) |
Definition at line 520 of file qgsmapsettings.cpp.
References destinationCrs(), extent(), hasCrsTransformEnabled(), mapUnits(), mDatumTransformStore, QgsXmlUtils::writeMapUnits(), QgsXmlUtils::writeRectangle(), QgsDatumTransformStore::writeXML(), and QgsCoordinateReferenceSystem::writeXML().
Referenced by QgsMapCanvas::writeProject(), and QgsMapRenderer::writeXML().
|
protected |
Definition at line 226 of file qgsmapsettings.h.
|
protected |
Definition at line 224 of file qgsmapsettings.h.
Referenced by layerTransfrom(), readXML(), setDestinationCrs(), and writeXML().
|
protected |
Definition at line 223 of file qgsmapsettings.h.
Referenced by destinationCrs(), and setDestinationCrs().
|
protected |
Definition at line 214 of file qgsmapsettings.h.
Referenced by outputDpi(), setOutputDpi(), and updateDerived().
|
protected |
Definition at line 218 of file qgsmapsettings.h.
Referenced by extent(), setExtent(), and updateDerived().
|
protected |
Definition at line 229 of file qgsmapsettings.h.
Referenced by flags(), setFlag(), setFlags(), and testFlag().
|
protected |
Definition at line 231 of file qgsmapsettings.h.
|
protected |
Definition at line 220 of file qgsmapsettings.h.
Referenced by fullExtent(), layers(), and setLayers().
|
protected |
Definition at line 242 of file qgsmapsettings.h.
Referenced by updateDerived().
|
protected |
Definition at line 236 of file qgsmapsettings.h.
Referenced by mapUnitsPerPixel(), and updateDerived().
|
protected |
Definition at line 222 of file qgsmapsettings.h.
Referenced by hasCrsTransformEnabled(), and setCrsTransformEnabled().
|
protected |
Definition at line 237 of file qgsmapsettings.h.
Referenced by scale(), and updateDerived().
|
protected |
Definition at line 241 of file qgsmapsettings.h.
Referenced by mapUnits(), setMapUnits(), and updateDerived().
|
protected |
Definition at line 227 of file qgsmapsettings.h.
|
protected |
Definition at line 216 of file qgsmapsettings.h.
Referenced by outputSize(), setOutputSize(), and updateDerived().
|
protected |
whether the actual settings are valid (set in updateDerived())
Definition at line 234 of file qgsmapsettings.h.
Referenced by hasValidSettings(), and updateDerived().
|
protected |
extent with some additional white space that matches the output aspect ratio
Definition at line 235 of file qgsmapsettings.h.
Referenced by updateDerived(), and visibleExtent().